=============================================================================== ffc068d4 : */ static void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { ffc068d4: 94 21 ff c8 stwu r1,-56(r1) ffc068d8: 7c 08 02 a6 mflr r0 ffc068dc: 90 01 00 3c stw r0,60(r1) ffc068e0: be a1 00 0c stmw r21,12(r1) the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); ffc068e4: 3f 20 ff c2 lis r25,-62 ffc068e8: 3f c0 00 00 lis r30,0 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); ffc068ec: 3f 00 ff c2 lis r24,-62 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc068f0: 83 e3 00 50 lwz r31,80(r3) return; } puts(""); ffc068f4: 3e c0 ff c2 lis r22,-62 case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); ffc068f8: 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" ); ffc068fc: 3f 40 ff c2 lis r26,-62 */ static void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { ffc06900: 7c 7c 1b 78 mr r28,r3 ffc06904: 7c 9b 23 78 mr r27,r4 the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); ffc06908: 3b 39 33 28 addi r25,r25,13096 ffc0690c: 3b de 27 f0 addi r30,r30,10224 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); ffc06910: 3b 18 33 82 addi r24,r24,13186 ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { ffc06914: 3e e0 ff c2 lis r23,-62 default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); return; } puts(""); ffc06918: 3a d6 3a 53 addi r22,r22,14931 case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); ffc0691c: 3a b5 33 6f addi r21,r21,13167 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); ffc06920: 3b 5a 33 5b addi r26,r26,13147 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 ); ffc06924: 48 00 01 1c b ffc06a40 the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); ffc06928: 80 89 00 08 lwz r4,8(r9) ffc0692c: 7f 23 cb 78 mr r3,r25 !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++ ) ffc06930: 3b bd 00 01 addi r29,r29,1 fprintf(stdout, "...." ); ffc06934: 48 00 db 31 bl ffc14464 ffc06938: 48 00 00 08 b ffc06940 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 ); ffc0693c: 3b a0 00 00 li r29,0 !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++ ) ffc06940: 7f 9d d8 00 cmpw cr7,r29,r27 fprintf(stdout, "...." ); ffc06944: 81 3e 00 00 lwz r9,0(r30) !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++ ) ffc06948: 40 9d ff e0 ble+ cr7,ffc06928 IMFS_jnode_t *the_jnode ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); ffc0694c: 80 89 00 08 lwz r4,8(r9) ffc06950: 38 7f 00 0c addi r3,r31,12 ffc06954: 48 00 db 11 bl ffc14464 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; ffc06958: 81 3f 00 4c lwz r9,76(r31) ffc0695c: 80 a9 00 00 lwz r5,0(r9) switch( IMFS_type( the_jnode ) ) { ffc06960: 2b 85 00 06 cmplwi cr7,r5,6 ffc06964: 41 9d 00 9c bgt- cr7,ffc06a00 <== NEVER TAKEN ffc06968: 39 37 33 0c addi r9,r23,13068 ffc0696c: 54 a5 10 3a rlwinm r5,r5,2,0,29 ffc06970: 7d 49 28 2e lwzx r10,r9,r5 ffc06974: 7d 2a 4a 14 add r9,r10,r9 ffc06978: 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" ); ffc0697c: 81 3e 00 00 lwz r9,0(r30) ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { ffc06980: 4e 80 04 20 bctr case IMFS_DIRECTORY: fprintf(stdout, "/" ); ffc06984: 80 89 00 08 lwz r4,8(r9) ffc06988: 38 60 00 2f li r3,47 ffc0698c: 48 00 d9 c1 bl ffc1434c ffc06990: 48 00 00 88 b ffc06a18 break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", ffc06994: 3c 80 ff c2 lis r4,-62 ffc06998: 80 69 00 08 lwz r3,8(r9) ffc0699c: 38 84 33 2d addi r4,r4,13101 ffc069a0: 80 bf 00 50 lwz r5,80(r31) ffc069a4: 80 df 00 54 lwz r6,84(r31) ffc069a8: 48 00 00 18 b ffc069c0 the_jnode->info.device.major, the_jnode->info.device.minor ); break; case IMFS_LINEAR_FILE: fprintf(stdout, " (file %" PRId32 " %p)", ffc069ac: 3c 80 ff c2 lis r4,-62 ffc069b0: 80 69 00 08 lwz r3,8(r9) ffc069b4: 80 bf 00 54 lwz r5,84(r31) ffc069b8: 38 84 33 40 addi r4,r4,13120 ffc069bc: 80 df 00 58 lwz r6,88(r31) ffc069c0: 4c c6 31 82 crclr 4*cr1+eq ffc069c4: 48 00 d8 a5 bl ffc14268 ffc069c8: 48 00 00 50 b ffc06a18 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", ffc069cc: 80 69 00 08 lwz r3,8(r9) ffc069d0: 3c 80 ff c2 lis r4,-62 ffc069d4: 80 bf 00 54 lwz r5,84(r31) ffc069d8: 38 84 33 4f addi r4,r4,13135 ffc069dc: 4c c6 31 82 crclr 4*cr1+eq ffc069e0: 48 00 d8 89 bl ffc14268 ffc069e4: 48 00 00 34 b ffc06a18 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); ffc069e8: 7f 43 d3 78 mr r3,r26 ffc069ec: 48 00 00 08 b ffc069f4 return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); ffc069f0: 7e a3 ab 78 mr r3,r21 ffc069f4: 80 89 00 08 lwz r4,8(r9) ffc069f8: 48 00 da 6d bl ffc14464 ffc069fc: 48 00 00 24 b ffc06a20 return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); ffc06a00: 81 3e 00 00 lwz r9,0(r30) <== NOT EXECUTED ffc06a04: 7f 04 c3 78 mr r4,r24 <== NOT EXECUTED ffc06a08: 80 69 00 08 lwz r3,8(r9) <== NOT EXECUTED ffc06a0c: 4c c6 31 82 crclr 4*cr1+eq <== NOT EXECUTED ffc06a10: 48 00 d8 59 bl ffc14268 <== NOT EXECUTED ffc06a14: 48 00 00 0c b ffc06a20 <== NOT EXECUTED return; } puts(""); ffc06a18: 7e c3 b3 78 mr r3,r22 ffc06a1c: 48 00 fa 21 bl ffc1643c } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; ffc06a20: 81 3f 00 4c lwz r9,76(r31) 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 ) ) ffc06a24: 81 29 00 00 lwz r9,0(r9) ffc06a28: 2f 89 00 00 cmpwi cr7,r9,0 ffc06a2c: 40 be 00 10 bne+ cr7,ffc06a3c IMFS_dump_directory( the_jnode, level + 1 ); ffc06a30: 7f e3 fb 78 mr r3,r31 ffc06a34: 38 9b 00 01 addi r4,r27,1 ffc06a38: 4b ff fe 9d bl ffc068d4 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 ) { ffc06a3c: 83 ff 00 00 lwz r31,0(r31) 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 )); ffc06a40: 39 3c 00 54 addi r9,r28,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 ); ffc06a44: 7f 9f 48 00 cmpw cr7,r31,r9 ffc06a48: 40 9e fe f4 bne+ cr7,ffc0693c fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( IMFS_is_directory( the_jnode ) ) IMFS_dump_directory( the_jnode, level + 1 ); } } ffc06a4c: 39 61 00 38 addi r11,r1,56 ffc06a50: 4b ff c9 f0 b ffc03440 <_restgpr_21_x> =============================================================================== ffc0c648 : rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { ffc0c648: 94 21 ff e0 stwu r1,-32(r1) ffc0c64c: 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( ffc0c650: 38 80 00 01 li r4,1 rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { ffc0c654: 90 01 00 24 stw r0,36(r1) ffc0c658: bf 41 00 08 stmw r26,8(r1) ffc0c65c: 7c bc 2b 78 mr r28,r5 ffc0c660: 7c db 33 78 mr r27,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; ffc0c664: 83 a3 00 20 lwz r29,32(r3) rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { ffc0c668: 7c 7e 1b 78 mr r30,r3 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( ffc0c66c: 80 bd 00 30 lwz r5,48(r29) ffc0c670: a0 dd 00 3c lhz r6,60(r29) ffc0c674: a0 fd 00 3e lhz r7,62(r29) ffc0c678: 48 00 0c 3d bl ffc0d2b4 dir->st_mode, dir->st_uid, dir->st_gid ); if ( access_ok ) { ffc0c67c: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c680: 40 9e 00 08 bne- cr7,ffc0c688 ffc0c684: 48 00 01 78 b ffc0c7fc static inline bool rtems_filesystem_is_current_directory( const char *token, size_t tokenlen ) { return tokenlen == 1 && token [0] == '.'; ffc0c688: 2f 9b 00 01 cmpwi cr7,r27,1 ffc0c68c: 39 20 00 00 li r9,0 ffc0c690: 40 be 00 14 bne+ cr7,ffc0c6a4 ffc0c694: 89 3c 00 00 lbz r9,0(r28) ffc0c698: 69 29 00 2e xori r9,r9,46 ffc0c69c: 7d 29 00 34 cntlzw r9,r9 ffc0c6a0: 55 29 d9 7e rlwinm r9,r9,27,5,31 IMFS_jnode_t *dir, const char *token, size_t tokenlen ) { if ( rtems_filesystem_is_current_directory( token, tokenlen ) ) { ffc0c6a4: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c6a8: 40 9e 00 94 bne- cr7,ffc0c73c static inline bool rtems_filesystem_is_parent_directory( const char *token, size_t tokenlen ) { return tokenlen == 2 && token [0] == '.' && token [1] == '.'; ffc0c6ac: 2f 9b 00 02 cmpwi cr7,r27,2 ffc0c6b0: 40 be 00 20 bne+ cr7,ffc0c6d0 ffc0c6b4: 89 5c 00 00 lbz r10,0(r28) ffc0c6b8: 2f 8a 00 2e cmpwi cr7,r10,46 ffc0c6bc: 40 be 00 14 bne+ cr7,ffc0c6d0 ffc0c6c0: 89 3c 00 01 lbz r9,1(r28) ffc0c6c4: 69 29 00 2e xori r9,r9,46 ffc0c6c8: 7d 29 00 34 cntlzw r9,r9 ffc0c6cc: 55 29 d9 7e rlwinm r9,r9,27,5,31 return dir; } else { if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) { ffc0c6d0: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c6d4: 41 be 00 0c beq+ cr7,ffc0c6e0 return dir->Parent; ffc0c6d8: 83 fd 00 08 lwz r31,8(r29) ffc0c6dc: 48 00 00 54 b ffc0c730 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc0c6e0: 83 fd 00 50 lwz r31,80(r29) } 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 ); ffc0c6e4: 3b 5d 00 54 addi r26,r29,84 ffc0c6e8: 48 00 00 3c b ffc0c724 while ( current != tail ) { IMFS_jnode_t *entry = (IMFS_jnode_t *) current; bool match = strncmp( entry->name, token, tokenlen ) == 0 ffc0c6ec: 38 7f 00 0c addi r3,r31,12 ffc0c6f0: 7f 84 e3 78 mr r4,r28 ffc0c6f4: 7f 65 db 78 mr r5,r27 ffc0c6f8: 48 00 4a a1 bl ffc11198 && entry->name [tokenlen] == '\0'; ffc0c6fc: 39 20 00 00 li r9,0 ffc0c700: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c704: 40 9e 00 14 bne- cr7,ffc0c718 ffc0c708: 7d 3f da 14 add r9,r31,r27 ffc0c70c: 89 29 00 0c lbz r9,12(r9) ffc0c710: 7d 29 00 34 cntlzw r9,r9 ffc0c714: 55 29 d9 7e rlwinm r9,r9,27,5,31 if ( match ) { ffc0c718: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c71c: 40 9e 00 14 bne- cr7,ffc0c730 }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } ffc0c720: 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 ) { ffc0c724: 7f 9f d0 00 cmpw cr7,r31,r26 ffc0c728: 40 9e ff c4 bne+ cr7,ffc0c6ec ffc0c72c: 48 00 00 d8 b ffc0c804 ); if ( access_ok ) { IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen ); if ( entry != NULL ) { ffc0c730: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0c734: 40 be 00 0c bne+ cr7,ffc0c740 ffc0c738: 48 00 00 cc b ffc0c804 IMFS_jnode_t *dir, const char *token, size_t tokenlen ) { if ( rtems_filesystem_is_current_directory( token, tokenlen ) ) { ffc0c73c: 7f bf eb 78 mr r31,r29 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; ffc0c740: 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; ffc0c744: 39 00 00 00 li r8,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 ); ffc0c748: 80 7e 00 04 lwz r3,4(r30) ffc0c74c: 81 29 00 00 lwz r9,0(r9) ffc0c750: 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 ); } ffc0c754: 81 5e 00 10 lwz r10,16(r30) 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)) { ffc0c758: 2f 89 00 02 cmpwi cr7,r9,2 ffc0c75c: 91 1e 00 0c stw r8,12(r30) 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 ); ffc0c760: 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)) { ffc0c764: 40 be 00 1c bne+ cr7,ffc0c780 ffc0c768: 71 49 00 08 andi. r9,r10,8 ffc0c76c: 40 82 00 0c bne- ffc0c778 ffc0c770: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c774: 40 9e 00 98 bne- cr7,ffc0c80c <== ALWAYS TAKEN entry = entry->info.hard_link.link_node; ffc0c778: 83 ff 00 50 lwz r31,80(r31) ffc0c77c: 48 00 00 90 b ffc0c80c } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { ffc0c780: 2f 89 00 03 cmpwi cr7,r9,3 ffc0c784: 40 be 00 34 bne+ cr7,ffc0c7b8 ffc0c788: 71 49 00 10 andi. r9,r10,16 ffc0c78c: 40 82 00 0c bne- ffc0c798 ffc0c790: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c794: 40 be 00 78 bne+ cr7,ffc0c80c const char *target = entry->info.sym_link.name; ffc0c798: 83 ff 00 50 lwz r31,80(r31) rtems_filesystem_eval_path_recursive( ctx, target, strlen( target ) ); ffc0c79c: 7f e3 fb 78 mr r3,r31 ffc0c7a0: 48 00 49 5d bl ffc110fc ffc0c7a4: 7f e4 fb 78 mr r4,r31 ffc0c7a8: 7c 65 1b 78 mr r5,r3 ffc0c7ac: 7f c3 f3 78 mr r3,r30 ffc0c7b0: 4b ff 93 29 bl ffc05ad8 ffc0c7b4: 48 00 00 48 b ffc0c7fc IMFS_jnode_types_t type ) { rtems_filesystem_global_location_t **fs_root_ptr = NULL; if ( type == IMFS_DIRECTORY ) { ffc0c7b8: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c7bc: 40 9e 00 50 bne- cr7,ffc0c80c if ( node->info.directory.mt_fs != NULL ) { ffc0c7c0: 80 9f 00 5c lwz r4,92(r31) ffc0c7c4: 2f 84 00 00 cmpwi cr7,r4,0 ffc0c7c8: 41 9e 00 44 beq- cr7,ffc0c80c if ( !terminal ) { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE; } } else { access_ok = rtems_filesystem_eval_path_check_access( ffc0c7cc: 80 bf 00 30 lwz r5,48(r31) { rtems_filesystem_global_location_t **fs_root_ptr = NULL; if ( type == IMFS_DIRECTORY ) { if ( node->info.directory.mt_fs != NULL ) { fs_root_ptr = &node->info.directory.mt_fs->mt_fs_root; ffc0c7d0: 3b a4 00 24 addi r29,r4,36 if ( !terminal ) { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE; } } else { access_ok = rtems_filesystem_eval_path_check_access( ffc0c7d4: a0 df 00 3c lhz r6,60(r31) ffc0c7d8: 7f c3 f3 78 mr r3,r30 ffc0c7dc: a0 ff 00 3e lhz r7,62(r31) ffc0c7e0: 38 80 00 01 li r4,1 ffc0c7e4: 48 00 0a d1 bl ffc0d2b4 RTEMS_FS_PERMS_EXEC, entry->st_mode, entry->st_uid, entry->st_gid ); if ( access_ok ) { ffc0c7e8: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c7ec: 41 be 00 10 beq+ cr7,ffc0c7fc <== NEVER TAKEN rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); ffc0c7f0: 7f c3 f3 78 mr r3,r30 ffc0c7f4: 7f a4 eb 78 mr r4,r29 ffc0c7f8: 4b ff 92 59 bl ffc05a50 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = ffc0c7fc: 38 60 00 01 li r3,1 ffc0c800: 48 00 00 34 b ffc0c834 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); } } } } else { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; ffc0c804: 38 60 00 02 li r3,2 ffc0c808: 48 00 00 2c b ffc0c834 } else { rtems_filesystem_global_location_t **fs_root_ptr = IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; ffc0c80c: a1 3d 00 34 lhz r9,52(r29) ffc0c810: 39 29 ff ff addi r9,r9,-1 ffc0c814: b1 3d 00 34 sth r9,52(r29) ++entry->reference_count; ffc0c818: a1 3f 00 34 lhz r9,52(r31) ffc0c81c: 39 29 00 01 addi r9,r9,1 ffc0c820: b1 3f 00 34 sth r9,52(r31) 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; ffc0c824: 81 3f 00 4c lwz r9,76(r31) currentloc->node_access = entry; ffc0c828: 93 fe 00 20 stw r31,32(r30) ffc0c82c: 81 29 00 04 lwz r9,4(r9) ffc0c830: 91 3e 00 28 stw r9,40(r30) status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } ffc0c834: 39 61 00 20 addi r11,r1,32 ffc0c838: 4b ff 3d 78 b ffc005b0 <_restgpr_26_x> =============================================================================== ffc045d8 : static ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { ffc045d8: 94 21 ff e0 stwu r1,-32(r1) ffc045dc: 7c 08 02 a6 mflr r0 ffc045e0: 7c 66 1b 78 mr r6,r3 ffc045e4: 90 01 00 24 stw r0,36(r1) ffc045e8: bf c1 00 18 stmw r30,24(r1) IMFS_jnode_t *jnode = iop->pathinfo.node_access; ffc045ec: 83 e3 00 1c lwz r31,28(r3) int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); ffc045f0: 80 7f 00 50 lwz r3,80(r31) ffc045f4: 48 00 a8 69 bl ffc0ee5c if (err > 0) { ffc045f8: 7c 7e 1b 79 mr. r30,r3 ffc045fc: 40 81 00 20 ble- ffc0461c IMFS_mtime_ctime_update(jnode); ffc04600: 38 61 00 08 addi r3,r1,8 ffc04604: 38 80 00 00 li r4,0 ffc04608: 48 00 0f 71 bl ffc05578 ffc0460c: 81 21 00 08 lwz r9,8(r1) ffc04610: 91 3f 00 44 stw r9,68(r31) ffc04614: 91 3f 00 48 stw r9,72(r31) ffc04618: 48 00 00 18 b ffc04630 } IMFS_FIFO_RETURN(err); ffc0461c: 41 a2 00 14 beq+ ffc04630 <== NEVER TAKEN ffc04620: 7f de 00 d0 neg r30,r30 ffc04624: 48 00 c8 81 bl ffc10ea4 <__errno> ffc04628: 93 c3 00 00 stw r30,0(r3) ffc0462c: 3b c0 ff ff li r30,-1 } ffc04630: 39 61 00 20 addi r11,r1,32 ffc04634: 7f c3 f3 78 mr r3,r30 ffc04638: 48 01 b1 54 b ffc1f78c <_restgpr_30_x> =============================================================================== ffc0c898 : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { ffc0c898: 94 21 ff c8 stwu r1,-56(r1) ffc0c89c: 7c 08 02 a6 mflr r0 ffc0c8a0: 90 01 00 3c stw r0,60(r1) /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; ffc0c8a4: 38 81 00 08 addi r4,r1,8 ffc0c8a8: 80 63 00 24 lwz r3,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 ) { ffc0c8ac: bf a1 00 2c stmw r29,44(r1) next = jnode->Parent; loc.node_access = (void *)jnode; IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { result = IMFS_rmnod( NULL, &loc ); ffc0c8b0: 7c 9d 23 78 mr r29,r4 /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; ffc0c8b4: 7c a3 c4 aa lswi r5,r3,24 ffc0c8b8: 7c a4 c5 aa stswi r5,r4,24 /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root->location.node_access = NULL; ffc0c8bc: 39 20 00 00 li r9,0 * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; jnode = (IMFS_jnode_t *)loc.node_access; ffc0c8c0: 83 e1 00 10 lwz r31,16(r1) /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root->location.node_access = NULL; ffc0c8c4: 91 23 00 08 stw r9,8(r3) ffc0c8c8: 48 00 00 08 b ffc0c8d0 if ( IMFS_is_directory( jnode ) ) { if ( jnode_has_children( jnode ) ) jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); ffc0c8cc: 7d 3f 4b 78 mr r31,r9 ffc0c8d0: 81 3f 00 4c lwz r9,76(r31) */ temp_mt_entry->mt_fs_root->location.node_access = NULL; do { next = jnode->Parent; ffc0c8d4: 83 df 00 08 lwz r30,8(r31) ffc0c8d8: 81 49 00 04 lwz r10,4(r9) loc.node_access = (void *)jnode; IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { ffc0c8dc: 81 29 00 00 lwz r9,0(r9) temp_mt_entry->mt_fs_root->location.node_access = NULL; do { next = jnode->Parent; loc.node_access = (void *)jnode; ffc0c8e0: 93 e1 00 10 stw r31,16(r1) IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { ffc0c8e4: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c8e8: 91 41 00 18 stw r10,24(r1) ffc0c8ec: 40 9e 00 14 bne- cr7,ffc0c900 ffc0c8f0: 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 ); ffc0c8f4: 39 5f 00 54 addi r10,r31,84 ffc0c8f8: 7f 89 50 00 cmpw cr7,r9,r10 ffc0c8fc: 40 be 00 38 bne+ cr7,ffc0c934 result = IMFS_rmnod( NULL, &loc ); ffc0c900: 38 60 00 00 li r3,0 ffc0c904: 7f a4 eb 78 mr r4,r29 ffc0c908: 4b ff 75 c5 bl ffc03ecc if ( result != 0 ) ffc0c90c: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c910: 41 be 00 10 beq+ cr7,ffc0c920 <== ALWAYS TAKEN rtems_fatal_error_occurred( 0xdeadbeef ); ffc0c914: 3c 60 de ad lis r3,-8531 <== NOT EXECUTED ffc0c918: 60 63 be ef ori r3,r3,48879 <== NOT EXECUTED ffc0c91c: 4b ff c7 55 bl ffc09070 <== NOT EXECUTED IMFS_node_destroy( jnode ); ffc0c920: 7f e3 fb 78 mr r3,r31 ffc0c924: 4b ff 72 39 bl ffc03b5c jnode = next; } if ( jnode != NULL ) { ffc0c928: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0c92c: 41 9e 00 30 beq- cr7,ffc0c95c ffc0c930: 7f df f3 78 mr r31,r30 return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; ffc0c934: 81 3f 00 4c lwz r9,76(r31) if ( IMFS_is_directory( jnode ) ) { ffc0c938: 81 29 00 00 lwz r9,0(r9) ffc0c93c: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c940: 40 be ff 90 bne- cr7,ffc0c8d0 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc0c944: 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 ); ffc0c948: 39 5f 00 54 addi r10,r31,84 if ( jnode_has_children( jnode ) ) ffc0c94c: 7f 89 50 00 cmpw cr7,r9,r10 ffc0c950: 41 be ff 80 beq- cr7,ffc0c8d0 jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); ffc0c954: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c958: 40 9e ff 74 bne+ cr7,ffc0c8cc <== ALWAYS TAKEN } ffc0c95c: 39 61 00 38 addi r11,r1,56 ffc0c960: 4b ff 3c 5c b ffc005bc <_restgpr_29_x> =============================================================================== ffc03a4c : 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] ) { ffc03a4c: 94 21 ff e8 stwu r1,-24(r1) ffc03a50: 7c 08 02 a6 mflr r0 ffc03a54: bf 81 00 08 stmw r28,8(r1) ffc03a58: 7c 7f 1b 78 mr r31,r3 ffc03a5c: 7c 9d 23 78 mr r29,r4 static int imfs_instance; int rv = 0; IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) ); ffc03a60: 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] ) { ffc03a64: 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 ) ); ffc03a68: 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] ) { ffc03a6c: 7c bc 2b 78 mr r28,r5 static int imfs_instance; int rv = 0; IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) ); ffc03a70: 48 00 07 91 bl ffc04200 if ( fs_info != NULL ) { ffc03a74: 7c 7e 1b 79 mr. r30,r3 ffc03a78: 41 82 00 88 beq- ffc03b00 IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; ffc03a7c: 3d 40 00 00 lis r10,0 ffc03a80: 81 2a 28 b4 lwz r9,10420(r10) memcpy( fs_info->node_controls, ffc03a84: 38 9e 00 08 addi r4,r30,8 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++; ffc03a88: 91 3e 00 00 stw r9,0(r30) ffc03a8c: 39 29 00 01 addi r9,r9,1 ffc03a90: 91 2a 28 b4 stw r9,10420(r10) memcpy( ffc03a94: 7c bc e4 aa lswi r5,r28,28 ffc03a98: 7c a4 e5 aa stswi r5,r4,28 fs_info->node_controls, node_controls, sizeof( fs_info->node_controls ) ); root_node = IMFS_allocate_node( ffc03a9c: 3c a0 ff c2 lis r5,-62 ffc03aa0: 38 a5 be c1 addi r5,r5,-16703 ffc03aa4: 80 9e 00 08 lwz r4,8(r30) ffc03aa8: 38 c0 00 00 li r6,0 ffc03aac: 38 e0 41 ed li r7,16877 ffc03ab0: 39 00 00 00 li r8,0 ffc03ab4: 48 00 8a 41 bl ffc0c4f4 "", 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { ffc03ab8: 2c 03 00 00 cmpwi r3,0 ffc03abc: 41 82 00 44 beq- ffc03b00 <== NEVER TAKEN 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; ffc03ac0: 81 43 00 4c lwz r10,76(r3) mt_entry->fs_info = fs_info; mt_entry->ops = op_table; mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; ffc03ac4: 3d 20 ff c2 lis r9,-62 ffc03ac8: 39 29 bf fc addi r9,r9,-16388 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; ffc03acc: 93 df 00 08 stw r30,8(r31) int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { ffc03ad0: 39 00 00 06 li r8,6 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; ffc03ad4: 91 3f 00 2c stw r9,44(r31) int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { ffc03ad8: 7d 09 03 a6 mtctr r8 ); 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; ffc03adc: 81 3f 00 24 lwz r9,36(r31) ffc03ae0: 81 4a 00 04 lwz r10,4(r10) (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; mt_entry->ops = op_table; ffc03ae4: 93 bf 00 0c stw r29,12(r31) ffc03ae8: 91 49 00 10 stw r10,16(r9) int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { ffc03aec: 39 40 00 10 li 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; ffc03af0: 90 69 00 08 stw r3,8(r9) errno = ENOMEM; rv = -1; } if ( rv == 0 ) { IMFS_determine_bytes_per_block( ffc03af4: 3d 20 00 00 lis r9,0 ffc03af8: 81 29 27 54 lwz r9,10068(r9) ffc03afc: 48 00 00 14 b ffc03b10 } else { errno = ENOMEM; rv = -1; } } else { errno = ENOMEM; ffc03b00: 48 00 bd 39 bl ffc0f838 <__errno> ffc03b04: 39 20 00 0c li r9,12 ffc03b08: 91 23 00 00 stw r9,0(r3) ffc03b0c: 48 00 00 2c b ffc03b38 /* * 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) { ffc03b10: 7f 8a 48 00 cmpw cr7,r10,r9 ffc03b14: 41 9e 00 14 beq- cr7,ffc03b28 is_valid = true; break; } if(bit_mask > requested_bytes_per_block) ffc03b18: 41 9d 00 0c bgt- cr7,ffc03b24 int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { ffc03b1c: 55 4a 08 3c rlwinm r10,r10,1,0,30 ffc03b20: 42 00 ff f0 bdnz+ ffc03b10 if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) ? requested_bytes_per_block : default_bytes_per_block); ffc03b24: 39 20 00 80 li r9,128 break; } if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) ffc03b28: 3d 40 00 00 lis r10,0 ffc03b2c: 91 2a 28 00 stw r9,10240(r10) const IMFS_node_control *const node_controls [IMFS_TYPE_COUNT] ) { static int imfs_instance; int rv = 0; ffc03b30: 38 60 00 00 li r3,0 ffc03b34: 48 00 00 08 b ffc03b3c if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) ? requested_bytes_per_block : default_bytes_per_block); ffc03b38: 38 60 ff ff li r3,-1 IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK ); } return rv; } ffc03b3c: 39 61 00 18 addi r11,r1,24 ffc03b40: 4b ff ca 78 b ffc005b8 <_restgpr_28_x> =============================================================================== ffc05718 : const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { ffc05718: 94 21 ff 88 stwu r1,-120(r1) ffc0571c: 7c 08 02 a6 mflr r0 int rv = 0; mode &= ~rtems_filesystem_umask; ffc05720: 3d 20 00 00 lis r9,0 ffc05724: 81 29 27 50 lwz r9,10064(r9) const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { ffc05728: 7c 6a 1b 78 mr r10,r3 ffc0572c: 90 01 00 7c stw r0,124(r1) ffc05730: bf 81 00 68 stmw r28,104(r1) ffc05734: 7c bf 2b 78 mr r31,r5 ffc05738: 7c dc 33 78 mr r28,r6 int rv = 0; mode &= ~rtems_filesystem_umask; ffc0573c: 83 a9 00 08 lwz r29,8(r9) ffc05740: 7c 9d e8 78 andc r29,r4,r29 switch (mode & S_IFMT) { ffc05744: 57 a9 04 26 rlwinm r9,r29,0,16,19 ffc05748: 2f 89 20 00 cmpwi cr7,r9,8192 ffc0574c: 41 9e 00 e0 beq- cr7,ffc0582c ffc05750: 2b 89 20 00 cmplwi cr7,r9,8192 ffc05754: 41 9d 00 0c bgt- cr7,ffc05760 <== ALWAYS TAKEN ffc05758: 2f 89 10 00 cmpwi cr7,r9,4096 <== NOT EXECUTED ffc0575c: 48 00 00 18 b ffc05774 <== NOT EXECUTED ffc05760: 2f 89 60 00 cmpwi cr7,r9,24576 ffc05764: 41 9e 00 c8 beq- cr7,ffc0582c ffc05768: 39 00 00 00 li r8,0 ffc0576c: 61 08 80 00 ori r8,r8,32768 ffc05770: 7f 89 40 00 cmpw cr7,r9,r8 ffc05774: 41 9e 00 b8 beq- cr7,ffc0582c <== NEVER TAKEN ffc05778: 48 00 00 a0 b ffc05818 if ( node_control->imfs_type == IMFS_GENERIC ) { rtems_filesystem_eval_path_context_t ctx; int eval_flags = RTEMS_FS_FOLLOW_LINK | RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE; const rtems_filesystem_location_info_t *currentloc = ffc0577c: 7d 44 53 78 mr r4,r10 ffc05780: 38 a0 00 78 li r5,120 ffc05784: 38 61 00 08 addi r3,r1,8 ffc05788: 48 00 20 21 bl ffc077a8 ffc0578c: 7c 7e 1b 78 mr r30,r3 rtems_filesystem_eval_path_start( &ctx, path, eval_flags ); if ( IMFS_is_imfs_instance( currentloc ) ) { ffc05790: 4b ff ff 2d bl ffc056bc ffc05794: 2f 83 00 00 cmpwi cr7,r3,0 ffc05798: 41 9e 00 64 beq- cr7,ffc057fc IMFS_types_union info; IMFS_jnode_t *new_node; info.generic.context = context; new_node = IMFS_create_node_with_control( ffc0579c: 80 a1 00 10 lwz r5,16(r1) ffc057a0: 7f e4 fb 78 mr r4,r31 ffc057a4: 80 c1 00 14 lwz r6,20(r1) ffc057a8: 7f c3 f3 78 mr r3,r30 ffc057ac: 7f a7 eb 78 mr r7,r29 if ( IMFS_is_imfs_instance( currentloc ) ) { IMFS_types_union info; IMFS_jnode_t *new_node; info.generic.context = context; ffc057b0: 93 81 00 40 stw r28,64(r1) new_node = IMFS_create_node_with_control( ffc057b4: 39 01 00 40 addi r8,r1,64 ffc057b8: 48 00 b7 7d bl ffc10f34 IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); IMFS_update_mtime( parent ); } else { rv = -1; ffc057bc: 3b e0 ff ff li r31,-1 rtems_filesystem_eval_path_get_tokenlen( &ctx ), mode, &info ); if ( new_node != NULL ) { ffc057c0: 2f 83 00 00 cmpwi cr7,r3,0 ffc057c4: 41 9e 00 48 beq- cr7,ffc0580c IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); ffc057c8: 38 80 00 00 li r4,0 mode, &info ); if ( new_node != NULL ) { IMFS_jnode_t *parent = currentloc->node_access; ffc057cc: 83 fe 00 08 lwz r31,8(r30) IMFS_update_ctime( parent ); ffc057d0: 38 61 00 58 addi r3,r1,88 ffc057d4: 48 00 08 f5 bl ffc060c8 ffc057d8: 81 21 00 58 lwz r9,88(r1) IMFS_update_mtime( parent ); ffc057dc: 38 61 00 58 addi r3,r1,88 ); if ( new_node != NULL ) { IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); ffc057e0: 91 3f 00 48 stw r9,72(r31) IMFS_update_mtime( parent ); ffc057e4: 38 80 00 00 li r4,0 ffc057e8: 48 00 08 e1 bl ffc060c8 ffc057ec: 81 21 00 58 lwz r9,88(r1) ffc057f0: 91 3f 00 44 stw r9,68(r31) ffc057f4: 3b e0 00 00 li r31,0 ffc057f8: 48 00 00 14 b ffc0580c } else { rv = -1; } } else { rtems_filesystem_eval_path_error( &ctx, ENOTSUP ); ffc057fc: 38 61 00 08 addi r3,r1,8 ffc05800: 38 80 00 86 li r4,134 ffc05804: 48 00 1c 85 bl ffc07488 rv = -1; ffc05808: 3b e0 ff ff li r31,-1 } rtems_filesystem_eval_path_cleanup( &ctx ); ffc0580c: 38 61 00 08 addi r3,r1,8 ffc05810: 48 00 20 c1 bl ffc078d0 ffc05814: 48 00 00 28 b ffc0583c } else { errno = EINVAL; ffc05818: 48 00 ea cd bl ffc142e4 <__errno> ffc0581c: 39 20 00 16 li r9,22 ffc05820: 91 23 00 00 stw r9,0(r3) rv = -1; ffc05824: 3b e0 ff ff li r31,-1 ffc05828: 48 00 00 14 b ffc0583c rv = -1; break; } if ( rv == 0 ) { if ( node_control->imfs_type == IMFS_GENERIC ) { ffc0582c: 81 3f 00 00 lwz r9,0(r31) ffc05830: 2f 89 00 07 cmpwi cr7,r9,7 ffc05834: 41 9e ff 48 beq+ cr7,ffc0577c ffc05838: 4b ff ff e0 b ffc05818 rv = -1; } } return rv; } ffc0583c: 39 61 00 78 addi r11,r1,120 ffc05840: 7f e3 fb 78 mr r3,r31 ffc05844: 4b ff b8 e4 b ffc01128 <_restgpr_28_x> =============================================================================== ffc0e7a0 : */ MEMFILE_STATIC int IMFS_memfile_addblock( IMFS_jnode_t *the_jnode, unsigned int block ) { ffc0e7a0: 7c 2b 0b 78 mr r11,r1 ffc0e7a4: 7c 08 02 a6 mflr r0 ffc0e7a8: 94 21 ff f0 stwu r1,-16(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 ); ffc0e7ac: 38 a0 00 01 li r5,1 */ MEMFILE_STATIC int IMFS_memfile_addblock( IMFS_jnode_t *the_jnode, unsigned int block ) { ffc0e7b0: 48 00 b8 99 bl ffc1a048 <_savegpr_31> ffc0e7b4: 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 ); ffc0e7b8: 4b ff fb 91 bl ffc0e348 if ( *block_entry_ptr ) ffc0e7bc: 81 23 00 00 lwz r9,0(r3) 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 ); ffc0e7c0: 7c 7f 1b 78 mr r31,r3 if ( *block_entry_ptr ) ffc0e7c4: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e7c8: 40 be 00 14 bne+ cr7,ffc0e7dc return 0; /* * There is no memory for this block number so allocate it. */ memory = memfile_alloc_block(); ffc0e7cc: 4b ff fb 39 bl ffc0e304 if ( !memory ) ffc0e7d0: 2c 03 00 00 cmpwi r3,0 ffc0e7d4: 41 82 00 10 beq- ffc0e7e4 <== NEVER TAKEN return 1; *block_entry_ptr = memory; ffc0e7d8: 90 7f 00 00 stw r3,0(r31) /* * Obtain the pointer for the specified block number */ block_entry_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 1 ); if ( *block_entry_ptr ) return 0; ffc0e7dc: 38 60 00 00 li r3,0 ffc0e7e0: 48 00 00 08 b ffc0e7e8 /* * There is no memory for this block number so allocate it. */ memory = memfile_alloc_block(); if ( !memory ) return 1; ffc0e7e4: 38 60 00 01 li r3,1 <== NOT EXECUTED *block_entry_ptr = memory; return 0; } ffc0e7e8: 39 61 00 10 addi r11,r1,16 ffc0e7ec: 4b ff 1d d8 b ffc005c4 <_restgpr_31_x> =============================================================================== ffc0e9f0 : MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { ffc0e9f0: 94 21 ff c0 stwu r1,-64(r1) IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) ffc0e9f4: 3d 20 00 00 lis r9,0 MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { ffc0e9f8: 7d 80 00 26 mfcr r12 ffc0e9fc: be e1 00 1c stmw r23,28(r1) ffc0ea00: 7c 08 02 a6 mflr r0 ffc0ea04: 7c 7f 1b 78 mr r31,r3 IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) ffc0ea08: 83 c9 28 00 lwz r30,10240(r9) MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { ffc0ea0c: 7c 97 23 78 mr r23,r4 ffc0ea10: 90 01 00 44 stw r0,68(r1) ffc0ea14: 7c bc 2b 78 mr r28,r5 IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) ffc0ea18: 57 c9 f0 be rlwinm r9,r30,30,2,31 ffc0ea1c: 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 ) { ffc0ea20: 91 81 00 18 stw r12,24(r1) IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) ffc0ea24: 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 ) { ffc0ea28: 7c dd 33 78 mr r29,r6 IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) ffc0ea2c: 39 4a 00 01 addi r10,r10,1 ffc0ea30: 7d 2a 49 d6 mullw r9,r10,r9 ffc0ea34: 39 40 00 00 li r10,0 ffc0ea38: 7f 8a 28 00 cmpw cr7,r10,r5 ffc0ea3c: 39 29 ff ff addi r9,r9,-1 ffc0ea40: 7d 29 f1 d6 mullw r9,r9,r30 ffc0ea44: 41 bd 00 1c bgt+ cr7,ffc0ea60 <== NEVER TAKEN ffc0ea48: 40 9e 00 0c bne- cr7,ffc0ea54 <== NEVER TAKEN ffc0ea4c: 7f 89 30 40 cmplw cr7,r9,r6 ffc0ea50: 41 bd 00 10 bgt+ cr7,ffc0ea60 rtems_set_errno_and_return_minus_one( EFBIG ); ffc0ea54: 48 00 0d e5 bl ffc0f838 <__errno> ffc0ea58: 39 20 00 1b li r9,27 ffc0ea5c: 48 00 00 d8 b ffc0eb34 /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) ffc0ea60: 83 3f 00 50 lwz r25,80(r31) ffc0ea64: 83 5f 00 54 lwz r26,84(r31) ffc0ea68: 7f 9c c8 00 cmpw cr7,r28,r25 ffc0ea6c: 41 bd 00 10 bgt+ cr7,ffc0ea7c <== NEVER TAKEN ffc0ea70: 40 9e 01 0c bne- cr7,ffc0eb7c <== NEVER TAKEN ffc0ea74: 7f 9d d0 40 cmplw cr7,r29,r26 ffc0ea78: 40 9d 01 04 ble- cr7,ffc0eb7c <== NEVER TAKEN return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0ea7c: 7f db fe 70 srawi r27,r30,31 ffc0ea80: 7f 65 db 78 mr r5,r27 ffc0ea84: 7f c6 f3 78 mr r6,r30 ffc0ea88: 7f 83 e3 78 mr r3,r28 ffc0ea8c: 7f a4 eb 78 mr r4,r29 ffc0ea90: 48 00 a6 31 bl ffc190c0 <__divdi3> old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0ea94: 7f 23 cb 78 mr r3,r25 ffc0ea98: 7f 65 db 78 mr r5,r27 ffc0ea9c: 7f c6 f3 78 mr r6,r30 return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0eaa0: 7c 98 23 78 mr r24,r4 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0eaa4: 7f 44 d3 78 mr r4,r26 ffc0eaa8: 48 00 a6 19 bl ffc190c0 <__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 ) { ffc0eaac: 2e 17 00 00 cmpwi cr4,r23,0 /* * 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; ffc0eab0: 7f c4 f1 d6 mullw r30,r4,r30 /* * 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; ffc0eab4: 7c 9b 23 78 mr r27,r4 offset = the_jnode->info.file.size - old_blocks * IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0eab8: 7f 5e d0 50 subf r26,r30,r26 * 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; ffc0eabc: 3f 20 00 00 lis r25,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++ ) { ffc0eac0: 7c 9e 23 78 mr r30,r4 ffc0eac4: 48 00 00 80 b ffc0eb44 if ( !IMFS_memfile_addblock( the_jnode, block ) ) { ffc0eac8: 7f e3 fb 78 mr r3,r31 ffc0eacc: 7f c4 f3 78 mr r4,r30 ffc0ead0: 4b ff fc d1 bl ffc0e7a0 ffc0ead4: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ead8: 40 9e 00 4c bne- cr7,ffc0eb24 <== NEVER TAKEN if ( zero_fill ) { ffc0eadc: 41 b2 00 64 beq+ cr4,ffc0eb40 size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; block_p *block_ptr = ffc0eae0: 7f c4 f3 78 mr r4,r30 * 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; ffc0eae4: 82 f9 28 00 lwz r23,10240(r25) block_p *block_ptr = ffc0eae8: 38 a0 00 00 li r5,0 ffc0eaec: 7f e3 fb 78 mr r3,r31 ffc0eaf0: 4b ff f8 59 bl ffc0e348 * 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; ffc0eaf4: 7e fa b8 50 subf r23,r26,r23 block_p *block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); ffc0eaf8: 80 63 00 00 lwz r3,0(r3) ffc0eafc: 38 80 00 00 li r4,0 ffc0eb00: 7e e5 bb 78 mr r5,r23 ffc0eb04: 7c 63 d2 14 add r3,r3,r26 ffc0eb08: 48 00 1b 29 bl ffc10630 offset = 0; ffc0eb0c: 3b 40 00 00 li r26,0 ffc0eb10: 48 00 00 30 b ffc0eb40 } } else { for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); ffc0eb14: 7f c4 f3 78 mr r4,r30 <== NOT EXECUTED ffc0eb18: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc0eb1c: 4b ff fe 99 bl ffc0e9b4 <== NOT EXECUTED memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { ffc0eb20: 3b de ff ff addi r30,r30,-1 <== NOT EXECUTED ffc0eb24: 7f 9e d8 40 cmplw cr7,r30,r27 <== NOT EXECUTED ffc0eb28: 40 9c ff ec bge+ cr7,ffc0eb14 <== NOT EXECUTED IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); ffc0eb2c: 48 00 0d 0d bl ffc0f838 <__errno> <== NOT EXECUTED ffc0eb30: 39 20 00 1c li r9,28 <== NOT EXECUTED ffc0eb34: 91 23 00 00 stw r9,0(r3) ffc0eb38: 38 60 ff ff li r3,-1 ffc0eb3c: 48 00 00 44 b ffc0eb80 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++ ) { ffc0eb40: 3b de 00 01 addi r30,r30,1 ffc0eb44: 7f 9e c0 40 cmplw cr7,r30,r24 ffc0eb48: 40 9d ff 80 ble+ cr7,ffc0eac8 } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; ffc0eb4c: 93 9f 00 50 stw r28,80(r31) IMFS_update_ctime(the_jnode); ffc0eb50: 38 80 00 00 li r4,0 ffc0eb54: 38 61 00 08 addi r3,r1,8 } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; ffc0eb58: 93 bf 00 54 stw r29,84(r31) IMFS_update_ctime(the_jnode); ffc0eb5c: 4b ff 5a d1 bl ffc0462c ffc0eb60: 81 21 00 08 lwz r9,8(r1) IMFS_update_mtime(the_jnode); ffc0eb64: 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); ffc0eb68: 91 3f 00 48 stw r9,72(r31) IMFS_update_mtime(the_jnode); ffc0eb6c: 38 80 00 00 li r4,0 ffc0eb70: 4b ff 5a bd bl ffc0462c ffc0eb74: 81 21 00 08 lwz r9,8(r1) ffc0eb78: 91 3f 00 44 stw r9,68(r31) /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) return 0; ffc0eb7c: 38 60 00 00 li r3,0 the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); IMFS_update_mtime(the_jnode); return 0; } ffc0eb80: 81 81 00 18 lwz r12,24(r1) ffc0eb84: 39 61 00 40 addi r11,r1,64 ffc0eb88: 7d 80 81 20 mtcrf 8,r12 ffc0eb8c: 4b ff 1a 18 b ffc005a4 <_restgpr_23_x> =============================================================================== ffc0e348 : my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { ffc0e348: 3d 20 00 00 lis r9,0 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { ffc0e34c: 94 21 ff e8 stwu r1,-24(r1) ffc0e350: 7c 08 02 a6 mflr r0 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { ffc0e354: 81 29 28 00 lwz r9,10240(r9) #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { ffc0e358: bf 81 00 08 stmw r28,8(r1) ffc0e35c: 7c 7f 1b 78 mr r31,r3 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { ffc0e360: 55 29 f0 be rlwinm r9,r9,30,2,31 ffc0e364: 39 49 ff ff addi r10,r9,-1 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { ffc0e368: 90 01 00 1c stw r0,28(r1) my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { ffc0e36c: 7f 84 50 40 cmplw cr7,r4,r10 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { ffc0e370: 7c 9e 23 78 mr r30,r4 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { ffc0e374: 41 9d 00 4c bgt- cr7,ffc0e3c0 p = info->indirect; if ( malloc_it ) { ffc0e378: 2f 05 00 00 cmpwi cr6,r5,0 /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { p = info->indirect; ffc0e37c: 81 23 00 58 lwz r9,88(r3) ffc0e380: 2f 89 00 00 cmpwi cr7,r9,0 if ( malloc_it ) { ffc0e384: 41 9a 00 2c beq- cr6,ffc0e3b0 if ( !p ) { ffc0e388: 40 be 00 1c bne+ cr7,ffc0e3a4 p = memfile_alloc_block(); ffc0e38c: 4b ff ff 79 bl ffc0e304 if ( !p ) ffc0e390: 2c 03 00 00 cmpwi r3,0 ffc0e394: 40 a2 00 0c bne+ ffc0e3a0 <== ALWAYS TAKEN return 0; ffc0e398: 38 60 00 00 li r3,0 <== NOT EXECUTED ffc0e39c: 48 00 01 88 b ffc0e524 <== NOT EXECUTED info->indirect = p; ffc0e3a0: 90 7f 00 58 stw r3,88(r31) } return &info->indirect[ my_block ]; ffc0e3a4: 57 de 10 3a rlwinm r30,r30,2,0,29 ffc0e3a8: 80 7f 00 58 lwz r3,88(r31) ffc0e3ac: 48 00 00 84 b ffc0e430 } if ( !p ) ffc0e3b0: 41 be ff e8 beq- cr7,ffc0e398 <== NEVER TAKEN return 0; return &info->indirect[ my_block ]; ffc0e3b4: 54 9e 10 3a rlwinm r30,r4,2,0,29 ffc0e3b8: 7c 69 f2 14 add r3,r9,r30 ffc0e3bc: 48 00 01 68 b ffc0e524 /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { ffc0e3c0: 38 69 00 01 addi r3,r9,1 ffc0e3c4: 7c 63 49 d6 mullw r3,r3,r9 ffc0e3c8: 39 43 ff ff addi r10,r3,-1 ffc0e3cc: 7f 84 50 40 cmplw cr7,r4,r10 ffc0e3d0: 41 9d 00 88 bgt- cr7,ffc0e458 my_block -= FIRST_DOUBLY_INDIRECT; ffc0e3d4: 7f c9 20 50 subf r30,r9,r4 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; p = info->doubly_indirect; ffc0e3d8: 80 7f 00 5c lwz r3,92(r31) */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; ffc0e3dc: 7f be 4b 96 divwu r29,r30,r9 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; p = info->doubly_indirect; if ( malloc_it ) { ffc0e3e0: 2f 05 00 00 cmpwi cr6,r5,0 */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; ffc0e3e4: 7d 3d 49 d6 mullw r9,r29,r9 ffc0e3e8: 2f 83 00 00 cmpwi cr7,r3,0 ffc0e3ec: 7f c9 f0 50 subf r30,r9,r30 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; p = info->doubly_indirect; if ( malloc_it ) { ffc0e3f0: 41 9a 00 48 beq- cr6,ffc0e438 if ( !p ) { ffc0e3f4: 40 be 00 14 bne+ cr7,ffc0e408 p = memfile_alloc_block(); ffc0e3f8: 4b ff ff 0d bl ffc0e304 if ( !p ) ffc0e3fc: 2c 03 00 00 cmpwi r3,0 ffc0e400: 41 a2 ff 98 beq- ffc0e398 <== NEVER TAKEN return 0; info->doubly_indirect = p; ffc0e404: 90 7f 00 5c stw r3,92(r31) } p1 = (block_p *)p[ doubly ]; ffc0e408: 57 bd 10 3a rlwinm r29,r29,2,0,29 ffc0e40c: 7f e3 ea 14 add r31,r3,r29 ffc0e410: 7c 63 e8 2e lwzx r3,r3,r29 if ( !p1 ) { ffc0e414: 2f 83 00 00 cmpwi cr7,r3,0 ffc0e418: 40 be 00 14 bne+ cr7,ffc0e42c p1 = memfile_alloc_block(); ffc0e41c: 4b ff fe e9 bl ffc0e304 if ( !p1 ) ffc0e420: 2c 03 00 00 cmpwi r3,0 ffc0e424: 41 a2 ff 74 beq- ffc0e398 <== NEVER TAKEN return 0; p[ doubly ] = (block_p) p1; ffc0e428: 90 7f 00 00 stw r3,0(r31) } return (block_p *)&p1[ singly ]; ffc0e42c: 57 de 10 3a rlwinm r30,r30,2,0,29 ffc0e430: 7c 63 f2 14 add r3,r3,r30 ffc0e434: 48 00 00 f0 b ffc0e524 } if ( !p ) ffc0e438: 41 be ff 60 beq- cr7,ffc0e398 <== NEVER TAKEN return 0; p = (block_p *)p[ doubly ]; ffc0e43c: 57 bd 10 3a rlwinm r29,r29,2,0,29 ffc0e440: 7d 43 e8 2e lwzx r10,r3,r29 if ( !p ) ffc0e444: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0e448: 41 be ff 50 beq- cr7,ffc0e398 <== NEVER TAKEN return 0; return (block_p *)&p[ singly ]; ffc0e44c: 57 de 10 3a rlwinm r30,r30,2,0,29 ffc0e450: 7c 6a f2 14 add r3,r10,r30 ffc0e454: 48 00 00 d0 b ffc0e524 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { ffc0e458: 39 43 00 01 addi r10,r3,1 ffc0e45c: 7d 4a 49 d6 mullw r10,r10,r9 ffc0e460: 39 4a ff ff addi r10,r10,-1 ffc0e464: 7f 84 50 40 cmplw cr7,r4,r10 ffc0e468: 41 bd ff 30 bgt- cr7,ffc0e398 <== NEVER TAKEN my_block -= FIRST_TRIPLY_INDIRECT; ffc0e46c: 7f c3 20 50 subf r30,r3,r4 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; ffc0e470: 7d 5e 4b 96 divwu r10,r30,r9 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; ffc0e474: 7f aa 4b 96 divwu r29,r10,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; ffc0e478: 7c 6a 49 d6 mullw r3,r10,r9 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; doubly %= IMFS_MEMFILE_BLOCK_SLOTS; p = info->triply_indirect; if ( malloc_it ) { ffc0e47c: 2f 05 00 00 cmpwi cr6,r5,0 my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; doubly %= IMFS_MEMFILE_BLOCK_SLOTS; ffc0e480: 7d 3d 49 d6 mullw r9,r29,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; ffc0e484: 7f c3 f0 50 subf r30,r3,r30 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; doubly %= IMFS_MEMFILE_BLOCK_SLOTS; p = info->triply_indirect; ffc0e488: 80 7f 00 60 lwz r3,96(r31) my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; doubly %= IMFS_MEMFILE_BLOCK_SLOTS; ffc0e48c: 7f 89 50 50 subf r28,r9,r10 ffc0e490: 2f 83 00 00 cmpwi cr7,r3,0 p = info->triply_indirect; if ( malloc_it ) { ffc0e494: 41 9a 00 64 beq- cr6,ffc0e4f8 if ( !p ) { ffc0e498: 40 be 00 14 bne+ cr7,ffc0e4ac p = memfile_alloc_block(); ffc0e49c: 4b ff fe 69 bl ffc0e304 if ( !p ) ffc0e4a0: 2c 03 00 00 cmpwi r3,0 ffc0e4a4: 41 a2 fe f4 beq- ffc0e398 <== NEVER TAKEN return 0; info->triply_indirect = p; ffc0e4a8: 90 7f 00 60 stw r3,96(r31) } p1 = (block_p *) p[ triply ]; ffc0e4ac: 57 bd 10 3a rlwinm r29,r29,2,0,29 ffc0e4b0: 7f e3 ea 14 add r31,r3,r29 ffc0e4b4: 7c 63 e8 2e lwzx r3,r3,r29 if ( !p1 ) { ffc0e4b8: 2f 83 00 00 cmpwi cr7,r3,0 ffc0e4bc: 40 be 00 14 bne+ cr7,ffc0e4d0 p1 = memfile_alloc_block(); ffc0e4c0: 4b ff fe 45 bl ffc0e304 if ( !p1 ) ffc0e4c4: 2c 03 00 00 cmpwi r3,0 ffc0e4c8: 41 a2 fe d0 beq- ffc0e398 <== NEVER TAKEN return 0; p[ triply ] = (block_p) p1; ffc0e4cc: 90 7f 00 00 stw r3,0(r31) } p2 = (block_p *)p1[ doubly ]; ffc0e4d0: 57 9c 10 3a rlwinm r28,r28,2,0,29 ffc0e4d4: 7d 23 e0 2e lwzx r9,r3,r28 ffc0e4d8: 7f e3 e2 14 add r31,r3,r28 if ( !p2 ) { ffc0e4dc: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e4e0: 40 be 00 3c bne+ cr7,ffc0e51c p2 = memfile_alloc_block(); ffc0e4e4: 4b ff fe 21 bl ffc0e304 if ( !p2 ) ffc0e4e8: 7c 69 1b 79 mr. r9,r3 ffc0e4ec: 41 a2 fe ac beq- ffc0e398 <== NEVER TAKEN return 0; p1[ doubly ] = (block_p) p2; ffc0e4f0: 91 3f 00 00 stw r9,0(r31) ffc0e4f4: 48 00 00 28 b ffc0e51c } return (block_p *)&p2[ singly ]; } if ( !p ) ffc0e4f8: 41 be fe a0 beq- cr7,ffc0e398 <== NEVER TAKEN return 0; p1 = (block_p *) p[ triply ]; ffc0e4fc: 57 bd 10 3a rlwinm r29,r29,2,0,29 ffc0e500: 7d 03 e8 2e lwzx r8,r3,r29 if ( !p1 ) ffc0e504: 2f 88 00 00 cmpwi cr7,r8,0 ffc0e508: 41 be fe 90 beq- cr7,ffc0e398 <== NEVER TAKEN return 0; p2 = (block_p *)p1[ doubly ]; ffc0e50c: 57 9c 10 3a rlwinm r28,r28,2,0,29 ffc0e510: 7d 28 e0 2e lwzx r9,r8,r28 if ( !p2 ) ffc0e514: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e518: 41 be fe 80 beq- cr7,ffc0e398 <== NEVER TAKEN return 0; return (block_p *)&p2[ singly ]; ffc0e51c: 57 c3 10 3a rlwinm r3,r30,2,0,29 ffc0e520: 7c 69 1a 14 add r3,r9,r3 /* * This means the requested block number is out of range. */ return 0; } ffc0e524: 39 61 00 18 addi r11,r1,24 ffc0e528: 4b ff 20 90 b ffc005b8 <_restgpr_28_x> =============================================================================== ffc0e52c : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { ffc0e52c: 94 21 ff c8 stwu r1,-56(r1) ffc0e530: 7c 08 02 a6 mflr r0 ffc0e534: bf 01 00 18 stmw r24,24(r1) ffc0e538: 7c 7c 1b 78 mr r28,r3 ffc0e53c: 7c df 33 78 mr r31,r6 ffc0e540: 90 01 00 3c stw r0,60(r1) ffc0e544: 7c be 2b 78 mr r30,r5 ffc0e548: 7c fa 3b 78 mr r26,r7 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; ffc0e54c: 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 ) { ffc0e550: 81 29 00 00 lwz r9,0(r9) ffc0e554: 2f 89 00 05 cmpwi cr7,r9,5 ffc0e558: 40 be 00 68 bne+ cr7,ffc0e5c0 unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) ffc0e55c: 81 43 00 50 lwz r10,80(r3) ffc0e560: 39 20 00 00 li r9,0 ffc0e564: 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; ffc0e568: 80 83 00 58 lwz r4,88(r3) if (my_length > (the_jnode->info.linearfile.size - start)) ffc0e56c: 7c ff 58 10 subfc r7,r31,r11 ffc0e570: 7c de 51 10 subfe r6,r30,r10 ffc0e574: 7f 89 30 00 cmpw cr7,r9,r6 ffc0e578: 41 bd 00 10 bgt+ cr7,ffc0e588 <== NEVER TAKEN ffc0e57c: 40 9e 00 14 bne- cr7,ffc0e590 <== NEVER TAKEN ffc0e580: 7f 88 38 40 cmplw cr7,r8,r7 ffc0e584: 40 9d 00 0c ble- cr7,ffc0e590 <== NEVER TAKEN my_length = the_jnode->info.linearfile.size - start; ffc0e588: 7f bf 58 50 subf r29,r31,r11 ffc0e58c: 48 00 00 08 b ffc0e594 /* * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; ffc0e590: 7d 1d 43 78 mr r29,r8 <== NOT EXECUTED file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) my_length = the_jnode->info.linearfile.size - start; memcpy(dest, &file_ptr[start], my_length); ffc0e594: 7c 84 fa 14 add r4,r4,r31 ffc0e598: 7f a5 eb 78 mr r5,r29 ffc0e59c: 7f 43 d3 78 mr r3,r26 ffc0e5a0: 48 00 1f 9d bl ffc1053c IMFS_update_atime( the_jnode ); ffc0e5a4: 38 61 00 08 addi r3,r1,8 ffc0e5a8: 38 80 00 00 li r4,0 ffc0e5ac: 4b ff 60 81 bl ffc0462c ffc0e5b0: 81 21 00 08 lwz r9,8(r1) return my_length; ffc0e5b4: 7f bf eb 78 mr r31,r29 if (my_length > (the_jnode->info.linearfile.size - start)) my_length = the_jnode->info.linearfile.size - start; memcpy(dest, &file_ptr[start], my_length); IMFS_update_atime( the_jnode ); ffc0e5b8: 91 3c 00 40 stw r9,64(r28) return my_length; ffc0e5bc: 48 00 01 78 b ffc0e734 /* * 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 ) ffc0e5c0: 81 43 00 50 lwz r10,80(r3) /* * 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; ffc0e5c4: 7c c9 33 78 mr r9,r6 ffc0e5c8: 7c e8 32 14 add r7,r8,r6 if ( last_byte > the_jnode->info.file.size ) ffc0e5cc: 83 a3 00 54 lwz r29,84(r3) ffc0e5d0: 38 c0 00 00 li r6,0 ffc0e5d4: 7f 86 50 00 cmpw cr7,r6,r10 ffc0e5d8: 41 9d 00 10 bgt- cr7,ffc0e5e8 <== NEVER TAKEN ffc0e5dc: 40 9e 00 14 bne- cr7,ffc0e5f0 <== NEVER TAKEN ffc0e5e0: 7f 87 e8 40 cmplw cr7,r7,r29 ffc0e5e4: 40 9d 00 0c ble- cr7,ffc0e5f0 my_length = the_jnode->info.file.size - start; ffc0e5e8: 7f a9 e8 50 subf r29,r9,r29 ffc0e5ec: 48 00 00 08 b ffc0e5f4 /* * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; ffc0e5f0: 7d 1d 43 78 mr r29,r8 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0e5f4: 3d 20 00 00 lis r9,0 ffc0e5f8: 83 69 28 00 lwz r27,10240(r9) ffc0e5fc: 7f c3 f3 78 mr r3,r30 ffc0e600: 7f e4 fb 78 mr r4,r31 ffc0e604: 7f 78 fe 70 srawi r24,r27,31 ffc0e608: 7f 05 c3 78 mr r5,r24 ffc0e60c: 7f 66 db 78 mr r6,r27 ffc0e610: 48 00 ae d5 bl ffc194e4 <__moddi3> block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0e614: 7f c3 f3 78 mr r3,r30 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0e618: 7c 99 23 78 mr r25,r4 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0e61c: 7f 05 c3 78 mr r5,r24 ffc0e620: 7f e4 fb 78 mr r4,r31 ffc0e624: 7f 66 db 78 mr r6,r27 ffc0e628: 48 00 aa 99 bl ffc190c0 <__divdi3> if ( start_offset ) { ffc0e62c: 2f 99 00 00 cmpwi cr7,r25,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; ffc0e630: 7c 9e 23 78 mr r30,r4 if ( start_offset ) { ffc0e634: 41 9e 00 5c beq- cr7,ffc0e690 to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; ffc0e638: 7d 39 d8 50 subf r9,r25,r27 ffc0e63c: 7f 9d 48 40 cmplw cr7,r29,r9 ffc0e640: 7f bb eb 78 mr r27,r29 ffc0e644: 40 9d 00 08 ble- cr7,ffc0e64c ffc0e648: 7d 3b 4b 78 mr r27,r9 if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ffc0e64c: 7f 83 e3 78 mr r3,r28 ffc0e650: 7f c4 f3 78 mr r4,r30 ffc0e654: 38 a0 00 00 li r5,0 ffc0e658: 4b ff fc f1 bl ffc0e348 if ( !block_ptr ) return copied; ffc0e65c: 3b e0 00 00 li r31,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 ) ffc0e660: 2c 03 00 00 cmpwi r3,0 ffc0e664: 41 82 00 d0 beq- ffc0e734 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); ffc0e668: 80 83 00 00 lwz r4,0(r3) ffc0e66c: 7f 65 db 78 mr r5,r27 ffc0e670: 7f 43 d3 78 mr r3,r26 ffc0e674: 7c 84 ca 14 add r4,r4,r25 ffc0e678: 48 00 1e c5 bl ffc1053c dest += to_copy; ffc0e67c: 7f 5a da 14 add r26,r26,r27 block++; ffc0e680: 3b de 00 01 addi r30,r30,1 my_length -= to_copy; ffc0e684: 7f bb e8 50 subf r29,r27,r29 copied += to_copy; ffc0e688: 7f 7f db 78 mr r31,r27 ffc0e68c: 48 00 00 08 b ffc0e694 */ last_byte = start + length; if ( last_byte > the_jnode->info.file.size ) my_length = the_jnode->info.file.size - start; copied = 0; ffc0e690: 3b e0 00 00 li r31,0 } /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0e694: 3d 20 00 00 lis r9,0 ffc0e698: 83 29 28 00 lwz r25,10240(r9) * is considered an error. Read from an offset for more bytes than * are between the offset and the end of the file will result in * reading the data between offset and the end of the file (truncated * read). */ MEMFILE_STATIC ssize_t IMFS_memfile_read( ffc0e69c: 7f 5f d0 50 subf r26,r31,r26 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { ffc0e6a0: 7d 38 4b 78 mr r24,r9 ffc0e6a4: 48 00 00 38 b ffc0e6dc block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ffc0e6a8: 7f 83 e3 78 mr r3,r28 ffc0e6ac: 7f c4 f3 78 mr r4,r30 ffc0e6b0: 38 a0 00 00 li r5,0 ffc0e6b4: 4b ff fc 95 bl ffc0e348 if ( !block_ptr ) ffc0e6b8: 7c 69 1b 79 mr. r9,r3 ffc0e6bc: 41 82 00 78 beq- ffc0e734 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); ffc0e6c0: 80 89 00 00 lwz r4,0(r9) ffc0e6c4: 7f 63 db 78 mr r3,r27 ffc0e6c8: 7f 25 cb 78 mr r5,r25 ffc0e6cc: 48 00 1e 71 bl ffc1053c dest += to_copy; block++; ffc0e6d0: 3b de 00 01 addi r30,r30,1 my_length -= to_copy; ffc0e6d4: 7f b9 e8 50 subf r29,r25,r29 copied += to_copy; ffc0e6d8: 7f ff ca 14 add r31,r31,r25 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { ffc0e6dc: 81 38 28 00 lwz r9,10240(r24) * is considered an error. Read from an offset for more bytes than * are between the offset and the end of the file will result in * reading the data between offset and the end of the file (truncated * read). */ MEMFILE_STATIC ssize_t IMFS_memfile_read( ffc0e6e0: 7f 7a fa 14 add r27,r26,r31 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { ffc0e6e4: 7f 9d 48 40 cmplw cr7,r29,r9 ffc0e6e8: 40 9c ff c0 bge+ cr7,ffc0e6a8 /* * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { ffc0e6ec: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0e6f0: 41 9e 00 30 beq- cr7,ffc0e720 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ffc0e6f4: 7f 83 e3 78 mr r3,r28 ffc0e6f8: 7f c4 f3 78 mr r4,r30 ffc0e6fc: 38 a0 00 00 li r5,0 ffc0e700: 4b ff fc 49 bl ffc0e348 if ( !block_ptr ) ffc0e704: 7c 69 1b 79 mr. r9,r3 ffc0e708: 41 82 00 2c beq- ffc0e734 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); ffc0e70c: 80 89 00 00 lwz r4,0(r9) ffc0e710: 7f 63 db 78 mr r3,r27 ffc0e714: 7f a5 eb 78 mr r5,r29 ffc0e718: 48 00 1e 25 bl ffc1053c copied += my_length; ffc0e71c: 7f fd fa 14 add r31,r29,r31 } IMFS_update_atime( the_jnode ); ffc0e720: 38 61 00 08 addi r3,r1,8 ffc0e724: 38 80 00 00 li r4,0 ffc0e728: 4b ff 5f 05 bl ffc0462c ffc0e72c: 81 21 00 08 lwz r9,8(r1) ffc0e730: 91 3c 00 40 stw r9,64(r28) return copied; } ffc0e734: 39 61 00 38 addi r11,r1,56 ffc0e738: 7f e3 fb 78 mr r3,r31 ffc0e73c: 4b ff 1e 6c b ffc005a8 <_restgpr_24_x> =============================================================================== ffc0e884 : * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { ffc0e884: 94 21 ff d8 stwu r1,-40(r1) ffc0e888: 7c 08 02 a6 mflr r0 /* * 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; ffc0e88c: 3d 20 00 00 lis r9,0 * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { ffc0e890: 90 01 00 2c stw r0,44(r1) ffc0e894: bf 21 00 0c stmw r25,12(r1) ffc0e898: 7c 7f 1b 78 mr r31,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; ffc0e89c: 83 c9 28 00 lwz r30,10240(r9) * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { ffc0e8a0: 81 23 00 58 lwz r9,88(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; ffc0e8a4: 57 de f0 be rlwinm r30,r30,30,2,31 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { ffc0e8a8: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e8ac: 41 9e 00 10 beq- cr7,ffc0e8bc memfile_free_blocks_in_table( &info->indirect, to_free ); ffc0e8b0: 38 63 00 58 addi r3,r3,88 ffc0e8b4: 7f c4 f3 78 mr r4,r30 ffc0e8b8: 4b ff ff 69 bl ffc0e820 } if ( info->doubly_indirect ) { ffc0e8bc: 81 3f 00 5c lwz r9,92(r31) ffc0e8c0: 3b a0 00 00 li r29,0 for ( i=0 ; iindirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { ffc0e8c8: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e8cc: 40 be 00 2c bne+ cr7,ffc0e8f8 ffc0e8d0: 48 00 00 44 b ffc0e914 for ( i=0 ; idoubly_indirect[i] ) { ffc0e8d4: 81 3f 00 5c lwz r9,92(r31) * 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( ffc0e8d8: 57 aa 10 3a rlwinm r10,r29,2,0,29 memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; idoubly_indirect[i] ) { ffc0e8dc: 7c 69 52 14 add r3,r9,r10 ffc0e8e0: 7d 29 50 2e lwzx r9,r9,r10 ffc0e8e4: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e8e8: 41 9e 00 0c beq- cr7,ffc0e8f4 <== NEVER TAKEN memfile_free_blocks_in_table( ffc0e8ec: 7f c4 f3 78 mr r4,r30 ffc0e8f0: 4b ff ff 31 bl ffc0e820 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 ); ffc0e908: 38 7f 00 5c addi r3,r31,92 ffc0e90c: 7f c4 f3 78 mr r4,r30 ffc0e910: 4b ff ff 11 bl ffc0e820 } if ( info->triply_indirect ) { ffc0e914: 81 3f 00 60 lwz r9,96(r31) ffc0e918: 3b a0 00 00 li r29,0 for ( i=0 ; idoubly_indirect, to_free ); } if ( info->triply_indirect ) { ffc0e920: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e924: 40 be 00 68 bne+ cr7,ffc0e98c ffc0e928: 48 00 00 80 b ffc0e9a8 for ( i=0 ; itriply_indirect[i]; ffc0e92c: 81 3f 00 60 lwz r9,96(r31) * 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( ffc0e930: 57 b9 10 3a rlwinm r25,r29,2,0,29 } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; ffc0e934: 7f 89 c8 2e lwzx r28,r9,r25 if ( !p ) /* ensure we have a valid pointer */ ffc0e938: 2f 9c 00 00 cmpwi cr7,r28,0 ffc0e93c: 41 9e 00 60 beq- cr7,ffc0e99c <== NEVER TAKEN ffc0e940: 3b 60 00 00 li r27,0 ffc0e944: 48 00 00 24 b ffc0e968 break; for ( j=0 ; j<== NEVER TAKEN memfile_free_blocks_in_table( (block_p **)&p[j], to_free); ffc0e954: 7f 83 e3 78 mr r3,r28 ffc0e958: 7f c4 f3 78 mr r4,r30 ffc0e95c: 4b ff fe c5 bl ffc0e820 if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j if ( p[j] ) { memfile_free_blocks_in_table( (block_p **)&p[j], to_free); } } memfile_free_blocks_in_table( ffc0e978: 80 7f 00 60 lwz r3,96(r31) ffc0e97c: 7f c4 f3 78 mr r4,r30 memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i } } memfile_free_blocks_in_table( (block_p **)&info->triply_indirect[i], to_free ); } memfile_free_blocks_in_table( ffc0e99c: 38 7f 00 60 addi r3,r31,96 ffc0e9a0: 7f c4 f3 78 mr r4,r30 ffc0e9a4: 4b ff fe 7d bl ffc0e820 (block_p **)&info->triply_indirect, to_free ); } return the_jnode; } ffc0e9a8: 39 61 00 28 addi r11,r1,40 ffc0e9ac: 7f e3 fb 78 mr r3,r31 ffc0e9b0: 4b ff 1b fc b ffc005ac <_restgpr_25_x> =============================================================================== ffc0e9b4 : */ MEMFILE_STATIC int IMFS_memfile_remove_block( IMFS_jnode_t *the_jnode, unsigned int block ) { ffc0e9b4: 94 21 ff f8 stwu r1,-8(r1) <== NOT EXECUTED ffc0e9b8: 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 ); ffc0e9bc: 38 a0 00 00 li r5,0 <== NOT EXECUTED */ MEMFILE_STATIC int IMFS_memfile_remove_block( IMFS_jnode_t *the_jnode, unsigned int block ) { ffc0e9c0: 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 ); ffc0e9c4: 4b ff f9 85 bl ffc0e348 <== NOT EXECUTED ffc0e9c8: 7c 69 1b 78 mr r9,r3 <== NOT EXECUTED IMFS_assert( block_ptr ); ptr = *block_ptr; *block_ptr = 0; ffc0e9cc: 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; ffc0e9d0: 80 63 00 00 lwz r3,0(r3) <== NOT EXECUTED *block_ptr = 0; ffc0e9d4: 91 49 00 00 stw r10,0(r9) <== NOT EXECUTED memfile_free_block( ptr ); ffc0e9d8: 4b ff fe 19 bl ffc0e7f0 <== NOT EXECUTED return 1; } ffc0e9dc: 80 01 00 0c lwz r0,12(r1) <== NOT EXECUTED ffc0e9e0: 38 60 00 01 li r3,1 <== NOT EXECUTED ffc0e9e4: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc0e9e8: 38 21 00 08 addi r1,r1,8 <== NOT EXECUTED ffc0e9ec: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc0eb90 : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { ffc0eb90: 94 21 ff c8 stwu r1,-56(r1) ffc0eb94: 7c 08 02 a6 mflr r0 ffc0eb98: bf 01 00 18 stmw r24,24(r1) ffc0eb9c: 7c dd 33 78 mr r29,r6 ffc0eba0: 7d 1c 43 78 mr r28,r8 ffc0eba4: 90 01 00 3c stw r0,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; ffc0eba8: 7c c8 32 14 add r6,r8,r6 if ( last_byte > the_jnode->info.file.size ) { ffc0ebac: 39 00 00 00 li r8,0 ffc0ebb0: 81 43 00 50 lwz r10,80(r3) IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { ffc0ebb4: 7c 7e 1b 78 mr r30,r3 ffc0ebb8: 7c ba 2b 78 mr r26,r5 * 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 ) { ffc0ebbc: 81 23 00 54 lwz r9,84(r3) ffc0ebc0: 7f 88 50 00 cmpw cr7,r8,r10 IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { ffc0ebc4: 7c fb 3b 78 mr r27,r7 * 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 ) { ffc0ebc8: 41 9d 00 5c bgt- cr7,ffc0ec24 <== NEVER TAKEN ffc0ebcc: 40 be 00 0c bne+ cr7,ffc0ebd8 <== NEVER TAKEN ffc0ebd0: 7f 86 48 40 cmplw cr7,r6,r9 ffc0ebd4: 41 9d 00 50 bgt- cr7,ffc0ec24 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0ebd8: 3d 20 00 00 lis r9,0 ffc0ebdc: 83 e9 28 00 lwz r31,10240(r9) ffc0ebe0: 7f a4 eb 78 mr r4,r29 ffc0ebe4: 7f 43 d3 78 mr r3,r26 ffc0ebe8: 7f f8 fe 70 srawi r24,r31,31 ffc0ebec: 7f 05 c3 78 mr r5,r24 ffc0ebf0: 7f e6 fb 78 mr r6,r31 ffc0ebf4: 48 00 a8 f1 bl ffc194e4 <__moddi3> block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0ebf8: 7f 43 d3 78 mr r3,r26 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0ebfc: 7c 99 23 78 mr r25,r4 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0ec00: 7f 05 c3 78 mr r5,r24 ffc0ec04: 7f a4 eb 78 mr r4,r29 ffc0ec08: 7f e6 fb 78 mr r6,r31 ffc0ec0c: 48 00 a4 b5 bl ffc190c0 <__divdi3> if ( start_offset ) { ffc0ec10: 2f 99 00 00 cmpwi cr7,r25,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; ffc0ec14: 7c 9d 23 78 mr r29,r4 if ( start_offset ) { ffc0ec18: 40 9e 00 44 bne- cr7,ffc0ec5c status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); if ( status ) return status; } copied = 0; ffc0ec1c: 3b e0 00 00 li r31,0 ffc0ec20: 48 00 00 88 b ffc0eca8 * 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; ffc0ec24: 7f 9a 50 00 cmpw cr7,r26,r10 ffc0ec28: 38 80 00 01 li r4,1 ffc0ec2c: 41 9d 00 14 bgt- cr7,ffc0ec40 <== NEVER TAKEN ffc0ec30: 40 be 00 0c bne+ cr7,ffc0ec3c <== NEVER TAKEN ffc0ec34: 7f 9d 48 40 cmplw cr7,r29,r9 ffc0ec38: 41 9d 00 08 bgt- cr7,ffc0ec40 ffc0ec3c: 38 80 00 00 li r4,0 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); ffc0ec40: 7f c3 f3 78 mr r3,r30 ffc0ec44: 54 84 07 fe clrlwi r4,r4,31 ffc0ec48: 38 a0 00 00 li r5,0 ffc0ec4c: 4b ff fd a5 bl ffc0e9f0 if ( status ) ffc0ec50: 7c 69 1b 79 mr. r9,r3 ffc0ec54: 41 82 ff 84 beq+ ffc0ebd8 ffc0ec58: 48 00 00 fc b ffc0ed54 * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; ffc0ec5c: 7f f9 f8 50 subf r31,r25,r31 ffc0ec60: 7f 9f e0 40 cmplw cr7,r31,r28 ffc0ec64: 40 9d 00 08 ble- cr7,ffc0ec6c ffc0ec68: 7f 9f e3 78 mr r31,r28 if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ffc0ec6c: 7f c3 f3 78 mr r3,r30 ffc0ec70: 7f a4 eb 78 mr r4,r29 ffc0ec74: 38 a0 00 00 li r5,0 ffc0ec78: 4b ff f6 d1 bl ffc0e348 if ( !block_ptr ) return copied; ffc0ec7c: 39 20 00 00 li r9,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 ) ffc0ec80: 2c 03 00 00 cmpwi r3,0 ffc0ec84: 41 82 00 d0 beq- ffc0ed54 <== NEVER TAKEN block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); ffc0ec88: 80 63 00 00 lwz r3,0(r3) ffc0ec8c: 7f 64 db 78 mr r4,r27 ffc0ec90: 7f e5 fb 78 mr r5,r31 ffc0ec94: 7c 63 ca 14 add r3,r3,r25 ffc0ec98: 48 00 18 a5 bl ffc1053c src += to_copy; ffc0ec9c: 7f 7b fa 14 add r27,r27,r31 block++; ffc0eca0: 3b bd 00 01 addi r29,r29,1 my_length -= to_copy; ffc0eca4: 7f 9f e0 50 subf r28,r31,r28 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0eca8: 3d 20 00 00 lis r9,0 ffc0ecac: 83 49 28 00 lwz r26,10240(r9) * 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( ffc0ecb0: 7f 7f d8 50 subf r27,r31,r27 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { ffc0ecb4: 7d 38 4b 78 mr r24,r9 ffc0ecb8: 48 00 00 38 b ffc0ecf0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ffc0ecbc: 7f c3 f3 78 mr r3,r30 ffc0ecc0: 7f a4 eb 78 mr r4,r29 ffc0ecc4: 38 a0 00 00 li r5,0 ffc0ecc8: 4b ff f6 81 bl ffc0e348 if ( !block_ptr ) ffc0eccc: 2c 03 00 00 cmpwi r3,0 ffc0ecd0: 41 82 00 80 beq- ffc0ed50 <== 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, to_copy ); ffc0ecd4: 80 63 00 00 lwz r3,0(r3) ffc0ecd8: 7f 24 cb 78 mr r4,r25 ffc0ecdc: 7f 45 d3 78 mr r5,r26 ffc0ece0: 48 00 18 5d bl ffc1053c src += to_copy; block++; ffc0ece4: 3b bd 00 01 addi r29,r29,1 my_length -= to_copy; ffc0ece8: 7f 9a e0 50 subf r28,r26,r28 * 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( ffc0ecec: 7f ff d2 14 add r31,r31,r26 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { ffc0ecf0: 81 38 28 00 lwz r9,10240(r24) * 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( ffc0ecf4: 7f 3b fa 14 add r25,r27,r31 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { ffc0ecf8: 7f 9c 48 40 cmplw cr7,r28,r9 ffc0ecfc: 40 9c ff c0 bge+ cr7,ffc0ecbc * 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 ) { ffc0ed00: 2f 9c 00 00 cmpwi cr7,r28,0 ffc0ed04: 41 9e 00 34 beq- cr7,ffc0ed38 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ffc0ed08: 7f c3 f3 78 mr r3,r30 ffc0ed0c: 7f a4 eb 78 mr r4,r29 ffc0ed10: 38 a0 00 00 li r5,0 ffc0ed14: 4b ff f6 35 bl ffc0e348 if ( !block_ptr ) ffc0ed18: 7f e9 fb 78 mr r9,r31 ffc0ed1c: 2c 03 00 00 cmpwi r3,0 ffc0ed20: 41 82 00 34 beq- ffc0ed54 <== 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 ); ffc0ed24: 80 63 00 00 lwz r3,0(r3) ffc0ed28: 7f 24 cb 78 mr r4,r25 ffc0ed2c: 7f 85 e3 78 mr r5,r28 ffc0ed30: 48 00 18 0d bl ffc1053c my_length = 0; copied += to_copy; ffc0ed34: 7f ff e2 14 add r31,r31,r28 } IMFS_mtime_ctime_update( the_jnode ); ffc0ed38: 38 61 00 08 addi r3,r1,8 ffc0ed3c: 38 80 00 00 li r4,0 ffc0ed40: 4b ff 58 ed bl ffc0462c ffc0ed44: 81 21 00 08 lwz r9,8(r1) ffc0ed48: 91 3e 00 44 stw r9,68(r30) ffc0ed4c: 91 3e 00 48 stw r9,72(r30) */ 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 ) ffc0ed50: 7f e9 fb 78 mr r9,r31 } IMFS_mtime_ctime_update( the_jnode ); return copied; } ffc0ed54: 39 61 00 38 addi r11,r1,56 ffc0ed58: 7d 23 4b 78 mr r3,r9 ffc0ed5c: 4b ff 18 4c b ffc005a8 <_restgpr_24_x> =============================================================================== ffc03c4c : dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { ffc03c4c: 54 c9 04 26 rlwinm r9,r6,0,16,19 const char *name, size_t namelen, mode_t mode, dev_t dev ) { ffc03c50: 7c 08 02 a6 mflr r0 dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { ffc03c54: 2f 89 40 00 cmpwi cr7,r9,16384 const char *name, size_t namelen, mode_t mode, dev_t dev ) { ffc03c58: 7c 2b 0b 78 mr r11,r1 ffc03c5c: 94 21 ff d0 stwu r1,-48(r1) ffc03c60: 7c 8c 23 78 mr r12,r4 ffc03c64: 48 01 63 e5 bl ffc1a048 <_savegpr_31> ffc03c68: 90 01 00 34 stw r0,52(r1) ffc03c6c: 7c 7f 1b 78 mr r31,r3 ffc03c70: 7c a0 2b 78 mr r0,r5 ffc03c74: 7c cb 33 78 mr r11,r6 dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { ffc03c78: 41 9e 00 3c beq- cr7,ffc03cb4 *type = IMFS_DIRECTORY; } else if ( S_ISREG( mode ) ) { ffc03c7c: 6d 26 ff ff xoris r6,r9,65535 ffc03c80: 2f 86 80 00 cmpwi cr7,r6,-32768 ffc03c84: 41 9e 00 38 beq- cr7,ffc03cbc *type = IMFS_MEMORY_FILE; } else if ( S_ISBLK( mode ) || S_ISCHR( mode ) ) { ffc03c88: 2f 89 60 00 cmpwi cr7,r9,24576 ffc03c8c: 41 9e 00 0c beq- cr7,ffc03c98 ffc03c90: 2f 89 20 00 cmpwi cr7,r9,8192 ffc03c94: 40 be 00 14 bne+ cr7,ffc03ca8 *type = IMFS_DEVICE; rtems_filesystem_split_dev_t( ffc03c98: 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; ffc03c9c: 39 40 00 01 li r10,1 rtems_filesystem_split_dev_t( ffc03ca0: 91 01 00 0c stw r8,12(r1) ffc03ca4: 48 00 00 24 b ffc03cc8 dev, info->device.major, info->device.minor ); } else if (S_ISFIFO( mode )) { ffc03ca8: 2f 89 10 00 cmpwi cr7,r9,4096 ffc03cac: 40 be 00 1c bne+ cr7,ffc03cc8 <== NEVER TAKEN ffc03cb0: 48 00 00 14 b ffc03cc4 IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { *type = IMFS_DIRECTORY; ffc03cb4: 39 40 00 00 li r10,0 ffc03cb8: 48 00 00 10 b ffc03cc8 } else if ( S_ISREG( mode ) ) { *type = IMFS_MEMORY_FILE; ffc03cbc: 39 40 00 04 li r10,4 ffc03cc0: 48 00 00 08 b ffc03cc8 dev, info->device.major, info->device.minor ); } else if (S_ISFIFO( mode )) { *type = IMFS_FIFO; ffc03cc4: 39 40 00 06 li r10,6 size_t namelen, mode_t mode, const IMFS_types_union *info ) { const IMFS_fs_info_t *fs_info = ffc03cc8: 81 3f 00 14 lwz r9,20(r31) (const IMFS_fs_info_t *) parentloc->mt_entry->fs_info; return IMFS_create_node_with_control( ffc03ccc: 55 4a 10 3a rlwinm r10,r10,2,0,29 ffc03cd0: 7f e3 fb 78 mr r3,r31 ffc03cd4: 81 29 00 08 lwz r9,8(r9) ffc03cd8: 7d 85 63 78 mr r5,r12 ffc03cdc: 7c 06 03 78 mr r6,r0 ffc03ce0: 7d 49 52 14 add r10,r9,r10 ffc03ce4: 80 8a 00 08 lwz r4,8(r10) ffc03ce8: 7d 67 5b 78 mr r7,r11 ffc03cec: 39 01 00 08 addi r8,r1,8 ffc03cf0: 48 00 88 ed bl ffc0c5dc 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 ) { ffc03cf4: 2f 83 00 00 cmpwi cr7,r3,0 ffc03cf8: 41 9e 00 38 beq- cr7,ffc03d30 IMFS_jnode_t *parent = parentloc->node_access; IMFS_update_ctime( parent ); ffc03cfc: 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; ffc03d00: 83 ff 00 08 lwz r31,8(r31) IMFS_update_ctime( parent ); ffc03d04: 38 61 00 20 addi r3,r1,32 ffc03d08: 48 00 09 25 bl ffc0462c ffc03d0c: 81 21 00 20 lwz r9,32(r1) IMFS_update_mtime( parent ); ffc03d10: 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 ); ffc03d14: 91 3f 00 48 stw r9,72(r31) IMFS_update_mtime( parent ); ffc03d18: 38 80 00 00 li r4,0 ffc03d1c: 48 00 09 11 bl ffc0462c ffc03d20: 81 21 00 20 lwz r9,32(r1) size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; ffc03d24: 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 ); ffc03d28: 91 3f 00 44 stw r9,68(r31) ffc03d2c: 48 00 00 08 b ffc03d34 } else { rv = -1; ffc03d30: 38 60 ff ff li r3,-1 } return rv; } ffc03d34: 39 61 00 30 addi r11,r1,48 ffc03d38: 4b ff c8 8c b ffc005c4 <_restgpr_31_x> =============================================================================== ffc03d3c : #endif #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { ffc03d3c: 94 21 ff f8 stwu r1,-8(r1) ffc03d40: 7c 08 02 a6 mflr r0 ffc03d44: 90 01 00 0c stw r0,12(r1) int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; ffc03d48: 81 23 00 20 lwz r9,32(r3) ffc03d4c: 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; ffc03d50: 81 49 00 4c lwz r10,76(r9) if ( IMFS_is_directory( node ) ) { ffc03d54: 81 4a 00 00 lwz r10,0(r10) ffc03d58: 2f 8a 00 00 cmpwi cr7,r10,0 ffc03d5c: 40 9e 00 28 bne- cr7,ffc03d84 if ( node->info.directory.mt_fs == NULL ) { ffc03d60: 81 49 00 5c lwz r10,92(r9) ffc03d64: 2f 8a 00 00 cmpwi cr7,r10,0 ffc03d68: 40 9e 00 10 bne- cr7,ffc03d78 <== NEVER TAKEN node->info.directory.mt_fs = mt_entry; ffc03d6c: 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; ffc03d70: 38 60 00 00 li r3,0 ffc03d74: 48 00 00 20 b ffc03d94 if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == NULL ) { node->info.directory.mt_fs = mt_entry; } else { errno = EBUSY; ffc03d78: 48 00 ba c1 bl ffc0f838 <__errno> <== NOT EXECUTED ffc03d7c: 39 20 00 10 li r9,16 <== NOT EXECUTED ffc03d80: 48 00 00 0c b ffc03d8c <== NOT EXECUTED rv = -1; } } else { errno = ENOTDIR; ffc03d84: 48 00 ba b5 bl ffc0f838 <__errno> ffc03d88: 39 20 00 14 li r9,20 ffc03d8c: 91 23 00 00 stw r9,0(r3) rv = -1; ffc03d90: 38 60 ff ff li r3,-1 } return rv; } ffc03d94: 80 01 00 0c lwz r0,12(r1) ffc03d98: 38 21 00 08 addi r1,r1,8 ffc03d9c: 7c 08 03 a6 mtlr r0 ffc03da0: 4e 80 00 20 blr =============================================================================== ffc0c9e0 : } static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { ffc0c9e0: 94 21 ff f8 stwu r1,-8(r1) ffc0c9e4: 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 ); ffc0c9e8: 39 43 00 54 addi r10,r3,84 ffc0c9ec: 90 01 00 0c stw r0,12(r1) if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { ffc0c9f0: 81 23 00 50 lwz r9,80(r3) ffc0c9f4: 7f 89 50 00 cmpw cr7,r9,r10 ffc0c9f8: 41 be 00 10 beq+ cr7,ffc0ca08 errno = ENOTEMPTY; ffc0c9fc: 48 00 2e 3d bl ffc0f838 <__errno> ffc0ca00: 39 20 00 5a li r9,90 ffc0ca04: 48 00 00 18 b ffc0ca1c node = NULL; } else if ( IMFS_is_mount_point( node ) ) { ffc0ca08: 81 23 00 5c lwz r9,92(r3) ffc0ca0c: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ca10: 41 be 00 14 beq+ cr7,ffc0ca24 <== ALWAYS TAKEN errno = EBUSY; ffc0ca14: 48 00 2e 25 bl ffc0f838 <__errno> <== NOT EXECUTED ffc0ca18: 39 20 00 10 li r9,16 <== NOT EXECUTED ffc0ca1c: 91 23 00 00 stw r9,0(r3) ffc0ca20: 38 60 00 00 li r3,0 node = NULL; } return node; } ffc0ca24: 80 01 00 0c lwz r0,12(r1) ffc0ca28: 38 21 00 08 addi r1,r1,8 ffc0ca2c: 7c 08 03 a6 mtlr r0 ffc0ca30: 4e 80 00 20 blr =============================================================================== ffc03da4 : rtems_filesystem_node_types_t IMFS_node_type( const rtems_filesystem_location_info_t *loc ) { const IMFS_jnode_t *node = loc->node_access; ffc03da4: 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; ffc03da8: 81 2a 00 4c lwz r9,76(r10) ffc03dac: 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 ) { ffc03db0: 2f 89 00 02 cmpwi cr7,r9,2 ffc03db4: 41 9e 00 14 beq- cr7,ffc03dc8 ffc03db8: 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; ffc03dbc: 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 ) { ffc03dc0: 40 be 00 18 bne+ cr7,ffc03dd8 <== ALWAYS TAKEN ffc03dc4: 4e 80 00 20 blr <== NOT EXECUTED type = imfs_type; break; } return type; } ffc03dc8: 81 2a 00 50 lwz r9,80(r10) ffc03dcc: 81 29 00 4c lwz r9,76(r9) ffc03dd0: 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; ffc03dd4: 4e 80 00 20 blr ffc03dd8: 7d 23 4b 78 mr r3,r9 type = imfs_type; break; } return type; } ffc03ddc: 4e 80 00 20 blr =============================================================================== ffc03e14 : const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { ffc03e14: 94 21 ff d8 stwu r1,-40(r1) ffc03e18: 7c 08 02 a6 mflr r0 ffc03e1c: 90 01 00 2c stw r0,44(r1) ffc03e20: bf a1 00 1c stmw r29,28(r1) int rv = 0; IMFS_jnode_t *node = oldloc->node_access; ffc03e24: 83 e4 00 08 lwz r31,8(r4) IMFS_jnode_t *new_parent = newparentloc->node_access; ffc03e28: 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 ) { ffc03e2c: 81 3f 00 08 lwz r9,8(r31) ffc03e30: 2f 89 00 00 cmpwi cr7,r9,0 ffc03e34: 41 9e 00 80 beq- cr7,ffc03eb4 <== NEVER TAKEN if ( namelen < IMFS_NAME_MAX ) { ffc03e38: 2b 87 00 1f cmplwi cr7,r7,31 ffc03e3c: 7c fd 3b 78 mr r29,r7 ffc03e40: 41 9d 00 68 bgt- cr7,ffc03ea8 <== NEVER TAKEN memcpy( node->name, name, namelen ); ffc03e44: 7c c4 33 78 mr r4,r6 ffc03e48: 7c e5 3b 78 mr r5,r7 ffc03e4c: 38 7f 00 0c addi r3,r31,12 ffc03e50: 48 00 c6 ed bl ffc1053c node->name [namelen] = '\0'; ffc03e54: 7f bf ea 14 add r29,r31,r29 ffc03e58: 39 20 00 00 li r9,0 ffc03e5c: 99 3d 00 0c stb r9,12(r29) IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); ffc03e60: 38 61 00 08 addi r3,r1,8 ffc03e64: 38 80 00 00 li r4,0 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; ffc03e68: 81 3f 00 00 lwz r9,0(r31) previous = the_node->previous; ffc03e6c: 81 5f 00 04 lwz r10,4(r31) next->previous = previous; ffc03e70: 91 49 00 04 stw r10,4(r9) previous->next = next; ffc03e74: 91 2a 00 00 stw r9,0(r10) RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); ffc03e78: 39 5e 00 54 addi r10,r30,84 Chain_Node *old_last = tail->previous; ffc03e7c: 81 3e 00 58 lwz r9,88(r30) static inline void IMFS_add_to_directory( IMFS_jnode_t *dir, IMFS_jnode_t *node ) { node->Parent = dir; ffc03e80: 93 df 00 08 stw r30,8(r31) the_node->next = tail; ffc03e84: 91 5f 00 00 stw r10,0(r31) tail->previous = the_node; ffc03e88: 93 fe 00 58 stw r31,88(r30) old_last->next = the_node; ffc03e8c: 93 e9 00 00 stw r31,0(r9) the_node->previous = old_last; ffc03e90: 91 3f 00 04 stw r9,4(r31) ffc03e94: 48 00 07 99 bl ffc0462c ffc03e98: 81 21 00 08 lwz r9,8(r1) const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { int rv = 0; ffc03e9c: 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 ); ffc03ea0: 91 3f 00 48 stw r9,72(r31) ffc03ea4: 48 00 00 20 b ffc03ec4 } else { errno = ENAMETOOLONG; ffc03ea8: 48 00 b9 91 bl ffc0f838 <__errno> <== NOT EXECUTED ffc03eac: 39 20 00 5b li r9,91 <== NOT EXECUTED ffc03eb0: 48 00 00 0c b ffc03ebc <== NOT EXECUTED rv = -1; } } else { errno = EINVAL; ffc03eb4: 48 00 b9 85 bl ffc0f838 <__errno> <== NOT EXECUTED ffc03eb8: 39 20 00 16 li r9,22 <== NOT EXECUTED ffc03ebc: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED rv = -1; ffc03ec0: 38 60 ff ff li r3,-1 <== NOT EXECUTED } return rv; } ffc03ec4: 39 61 00 28 addi r11,r1,40 ffc03ec8: 4b ff c6 f4 b ffc005bc <_restgpr_29_x> =============================================================================== ffc03fd4 : #endif #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { ffc03fd4: 94 21 ff f8 stwu r1,-8(r1) ffc03fd8: 7c 08 02 a6 mflr r0 ffc03fdc: 90 01 00 0c stw r0,12(r1) int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; ffc03fe0: 81 23 00 20 lwz r9,32(r3) ffc03fe4: 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; ffc03fe8: 81 49 00 4c lwz r10,76(r9) if ( IMFS_is_directory( node ) ) { ffc03fec: 81 4a 00 00 lwz r10,0(r10) ffc03ff0: 2f 8a 00 00 cmpwi cr7,r10,0 ffc03ff4: 40 9e 00 28 bne- cr7,ffc0401c <== NEVER TAKEN if ( node->info.directory.mt_fs == mt_entry ) { ffc03ff8: 81 09 00 5c lwz r8,92(r9) ffc03ffc: 7f 88 18 00 cmpw cr7,r8,r3 ffc04000: 40 9e 00 10 bne- cr7,ffc04010 <== NEVER TAKEN node->info.directory.mt_fs = NULL; ffc04004: 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; ffc04008: 38 60 00 00 li r3,0 ffc0400c: 48 00 00 20 b ffc0402c if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == mt_entry ) { node->info.directory.mt_fs = NULL; } else { errno = EINVAL; ffc04010: 48 00 b8 29 bl ffc0f838 <__errno> <== NOT EXECUTED ffc04014: 39 20 00 16 li r9,22 <== NOT EXECUTED ffc04018: 48 00 00 0c b ffc04024 <== NOT EXECUTED rv = -1; } } else { errno = ENOTDIR; ffc0401c: 48 00 b8 1d bl ffc0f838 <__errno> <== NOT EXECUTED ffc04020: 39 20 00 14 li r9,20 <== NOT EXECUTED ffc04024: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED rv = -1; ffc04028: 38 60 ff ff li r3,-1 <== NOT EXECUTED } return rv; } ffc0402c: 80 01 00 0c lwz r0,12(r1) ffc04030: 38 21 00 08 addi r1,r1,8 ffc04034: 7c 08 03 a6 mtlr r0 ffc04038: 4e 80 00 20 blr =============================================================================== ffc04824 : void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc04824: 94 21 ff e0 stwu r1,-32(r1) Heap_Control *heap = RTEMS_Malloc_Heap; ffc04828: 3d 20 00 00 lis r9,0 void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc0482c: 7c 08 02 a6 mflr r0 ffc04830: bf 41 00 08 stmw r26,8(r1) Heap_Control *heap = RTEMS_Malloc_Heap; ffc04834: 83 89 27 50 lwz r28,10064(r9) if ( !rtems_configuration_get_unified_work_area() ) { ffc04838: 3d 20 ff c2 lis r9,-62 ffc0483c: 89 29 ad 89 lbz r9,-21111(r9) void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc04840: 90 01 00 24 stw r0,36(r1) Heap_Control *heap = RTEMS_Malloc_Heap; if ( !rtems_configuration_get_unified_work_area() ) { ffc04844: 2f 89 00 00 cmpwi cr7,r9,0 ffc04848: 40 9e 00 74 bne- cr7,ffc048bc ffc0484c: 3f c0 ff c1 lis r30,-63 ffc04850: 7c 9b 23 78 mr r27,r4 ffc04854: 7c ba 2b 78 mr r26,r5 ffc04858: 7c 7f 1b 78 mr r31,r3 ffc0485c: 3b a0 00 00 li r29,0 ffc04860: 3b de 9a f8 addi r30,r30,-25864 ffc04864: 48 00 00 30 b ffc04894 uintptr_t page_size = CPU_HEAP_ALIGNMENT; size_t i; for (i = 0; i < area_count; ++i) { const Heap_Area *area = &areas [i]; uintptr_t space_available = (*init_or_extend)( ffc04868: 7f 83 e3 78 mr r3,r28 ffc0486c: 80 9f 00 00 lwz r4,0(r31) ffc04870: 80 bf 00 04 lwz r5,4(r31) ffc04874: 38 c0 00 08 li r6,8 ffc04878: 7f c9 03 a6 mtctr r30 ffc0487c: 4e 80 04 21 bctrl area->begin, area->size, page_size ); if ( space_available > 0 ) { ffc04880: 2f 83 00 00 cmpwi cr7,r3,0 ffc04884: 41 9e 00 08 beq- cr7,ffc0488c <== NEVER TAKEN init_or_extend = extend; ffc04888: 7f 5e d3 78 mr r30,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) { ffc0488c: 3b bd 00 01 addi r29,r29,1 ffc04890: 3b ff 00 08 addi r31,r31,8 ffc04894: 7f 9d d8 00 cmpw cr7,r29,r27 ffc04898: 40 9e ff d0 bne+ cr7,ffc04868 if ( space_available > 0 ) { init_or_extend = extend; } } if ( init_or_extend == _Heap_Initialize ) { ffc0489c: 3d 20 ff c1 lis r9,-63 ffc048a0: 39 29 9a f8 addi r9,r9,-25864 ffc048a4: 7f 9e 48 00 cmpw cr7,r30,r9 ffc048a8: 40 be 00 14 bne+ cr7,ffc048bc _Internal_error_Occurred( ffc048ac: 38 60 00 00 li r3,0 ffc048b0: 38 80 00 01 li r4,1 ffc048b4: 38 a0 00 17 li r5,23 ffc048b8: 48 00 54 c1 bl ffc09d78 <_Internal_error_Occurred> } /* * If configured, initialize the statistics support */ if ( rtems_malloc_statistics_helpers != NULL ) { ffc048bc: 3d 20 00 00 lis r9,0 ffc048c0: 81 29 27 c4 lwz r9,10180(r9) ffc048c4: 2f 89 00 00 cmpwi cr7,r9,0 ffc048c8: 41 9e 00 10 beq- cr7,ffc048d8 (*rtems_malloc_statistics_helpers->initialize)(); ffc048cc: 81 29 00 00 lwz r9,0(r9) ffc048d0: 7d 29 03 a6 mtctr r9 ffc048d4: 4e 80 04 21 bctrl } MSBUMP( space_available, _Protected_heap_Get_size( heap ) ); ffc048d8: 3f e0 00 00 lis r31,0 ffc048dc: 83 df 2b 20 lwz r30,11040(r31) ffc048e0: 7f 83 e3 78 mr r3,r28 ffc048e4: 48 00 5d 55 bl ffc0a638 <_Protected_heap_Get_size> ffc048e8: 7c 63 f2 14 add r3,r3,r30 } ffc048ec: 39 61 00 20 addi r11,r1,32 */ if ( rtems_malloc_statistics_helpers != NULL ) { (*rtems_malloc_statistics_helpers->initialize)(); } MSBUMP( space_available, _Protected_heap_Get_size( heap ) ); ffc048f0: 90 7f 2b 20 stw r3,11040(r31) } ffc048f4: 4b ff bc bc b ffc005b0 <_restgpr_26_x> =============================================================================== ffc22a84 : static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { ffc22a84: 94 21 ff c0 stwu r1,-64(r1) ffc22a88: 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 ); ffc22a8c: 39 23 00 c0 addi r9,r3,192 static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { ffc22a90: 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); ffc22a94: 55 29 00 34 rlwinm r9,r9,0,0,26 * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) if (*base != U32_PATTERN) ffc22a98: 3c c0 a5 a5 lis r6,-23131 static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { ffc22a9c: be e1 00 1c stmw r23,28(r1) * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) if (*base != U32_PATTERN) ffc22aa0: 60 c6 a5 a5 ori r6,r6,42405 static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { ffc22aa4: 7c 7f 1b 78 mr r31,r3 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); ffc22aa8: 83 63 00 b0 lwz r27,176(r3) current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); ffc22aac: 83 29 00 20 lwz r25,32(r9) } low = Stack_check_usable_stack_start(stack); ffc22ab0: 81 23 00 b4 lwz r9,180(r3) size = Stack_check_usable_stack_size(stack); ffc22ab4: 3b 7b ff 80 addi r27,r27,-128 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) ffc22ab8: 57 67 00 3a rlwinm r7,r27,0,0,29 { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); ffc22abc: 39 09 00 80 addi r8,r9,128 /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; ffc22ac0: 39 29 01 00 addi r9,r9,256 for (ebase = base + length; base < ebase; base++) ffc22ac4: 7c e9 3a 14 add r7,r9,r7 ffc22ac8: 48 00 00 14 b ffc22adc if (*base != U32_PATTERN) ffc22acc: 81 49 00 00 lwz r10,0(r9) ffc22ad0: 7f 8a 30 00 cmpw cr7,r10,r6 ffc22ad4: 40 9e 00 18 bne- cr7,ffc22aec * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) ffc22ad8: 39 29 00 04 addi r9,r9,4 ffc22adc: 7f 89 38 40 cmplw cr7,r9,r7 ffc22ae0: 41 9c ff ec blt+ cr7,ffc22acc <== 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; ffc22ae4: 3b 80 00 00 li r28,0 <== NOT EXECUTED ffc22ae8: 48 00 00 18 b ffc22b00 <== NOT EXECUTED low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); high_water_mark = Stack_check_find_high_water_mark(low, size); if ( high_water_mark ) ffc22aec: 2f 89 00 00 cmpwi cr7,r9,0 used = Stack_check_Calculate_used( low, size, high_water_mark ); else used = 0; ffc22af0: 3b 80 00 00 li r28,0 low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); high_water_mark = Stack_check_find_high_water_mark(low, size); if ( high_water_mark ) ffc22af4: 41 9e 00 0c beq- cr7,ffc22b00 <== NEVER TAKEN used = Stack_check_Calculate_used( low, size, high_water_mark ); ffc22af8: 7f 88 da 14 add r28,r8,r27 ffc22afc: 7f 89 e0 50 subf r28,r9,r28 #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) #endif { (*print_handler)( ffc22b00: 3f c0 00 00 lis r30,0 ffc22b04: 83 5f 00 08 lwz r26,8(r31) ffc22b08: 3b be 5c b0 addi r29,r30,23728 ffc22b0c: 83 1e 5c b0 lwz r24,23728(r30) ffc22b10: 82 fd 00 04 lwz r23,4(r29) ffc22b14: 38 80 00 05 li r4,5 ffc22b18: 38 a1 00 08 addi r5,r1,8 ffc22b1c: 7f 43 d3 78 mr r3,r26 ffc22b20: 4b fe cb 91 bl ffc0f6b0 ffc22b24: 3c 80 ff c6 lis r4,-58 ffc22b28: 7c 66 1b 78 mr r6,r3 ffc22b2c: 7f 09 03 a6 mtctr r24 ffc22b30: 38 84 99 f8 addi r4,r4,-26120 ffc22b34: 7f 45 d3 78 mr r5,r26 ffc22b38: 7e e3 bb 78 mr r3,r23 ffc22b3c: 4c c6 31 82 crclr 4*cr1+eq ffc22b40: 4e 80 04 21 bctrl (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, ffc22b44: 80 df 00 b0 lwz r6,176(r31) else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( ffc22b48: 81 3e 5c b0 lwz r9,23728(r30) ffc22b4c: 3c 80 ff c6 lis r4,-58 print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, ffc22b50: 80 bf 00 b4 lwz r5,180(r31) ffc22b54: 38 c6 ff ff addi r6,r6,-1 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( ffc22b58: 7d 29 03 a6 mtctr r9 ffc22b5c: 80 7d 00 04 lwz r3,4(r29) ffc22b60: 38 84 9a 05 addi r4,r4,-26107 ffc22b64: 7c c5 32 14 add r6,r5,r6 ffc22b68: 7f 27 cb 78 mr r7,r25 ffc22b6c: 7f 68 db 78 mr r8,r27 ffc22b70: 4c c6 31 82 crclr 4*cr1+eq ffc22b74: 4e 80 04 21 bctrl stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { ffc22b78: 81 3d 00 08 lwz r9,8(r29) (*print_handler)( print_context, "Unavailable\n" ); ffc22b7c: 80 7d 00 04 lwz r3,4(r29) stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { ffc22b80: 2f 89 00 00 cmpwi cr7,r9,0 (*print_handler)( print_context, "Unavailable\n" ); ffc22b84: 81 3e 5c b0 lwz r9,23728(r30) stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { ffc22b88: 40 be 00 1c bne+ cr7,ffc22ba4 <== ALWAYS TAKEN (*print_handler)( print_context, "Unavailable\n" ); ffc22b8c: 3c 80 ff c6 lis r4,-58 <== NOT EXECUTED ffc22b90: 7d 29 03 a6 mtctr r9 <== NOT EXECUTED ffc22b94: 38 84 9a 23 addi r4,r4,-26077 <== NOT EXECUTED ffc22b98: 4c c6 31 82 crclr 4*cr1+eq <== NOT EXECUTED ffc22b9c: 4e 80 04 21 bctrl <== NOT EXECUTED ffc22ba0: 48 00 00 1c b ffc22bbc <== NOT EXECUTED } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); ffc22ba4: 3c 80 ff c6 lis r4,-58 ffc22ba8: 7d 29 03 a6 mtctr r9 ffc22bac: 38 84 9a 30 addi r4,r4,-26064 ffc22bb0: 7f 85 e3 78 mr r5,r28 ffc22bb4: 4c c6 31 82 crclr 4*cr1+eq ffc22bb8: 4e 80 04 21 bctrl } } ffc22bbc: 39 61 00 40 addi r11,r1,64 ffc22bc0: 48 03 0c 1c b ffc537dc <_restgpr_23_x> =============================================================================== ffc22c94 : Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { ffc22c94: 94 21 ff c8 stwu r1,-56(r1) ffc22c98: 7c 08 02 a6 mflr r0 ffc22c9c: 90 01 00 3c stw r0,60(r1) ffc22ca0: bf a1 00 2c stmw r29,44(r1) ffc22ca4: 7c 7f 1b 78 mr r31,r3 ffc22ca8: 7c 9d 23 78 mr r29,r4 Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); ffc22cac: 83 c3 00 b4 lwz r30,180(r3) char name[32]; printk("BLOWN STACK!!!\n"); ffc22cb0: 3c 60 ff c6 lis r3,-58 ffc22cb4: 38 63 9a 36 addi r3,r3,-26058 ffc22cb8: 4c c6 31 82 crclr 4*cr1+eq ffc22cbc: 4b fe 20 e9 bl ffc04da4 printk("task control block: 0x%08" PRIxPTR "\n", running); ffc22cc0: 3c 60 ff c6 lis r3,-58 ffc22cc4: 38 63 9a 46 addi r3,r3,-26042 ffc22cc8: 7f e4 fb 78 mr r4,r31 ffc22ccc: 4c c6 31 82 crclr 4*cr1+eq ffc22cd0: 4b fe 20 d5 bl ffc04da4 printk("task ID: 0x%08lx\n", (unsigned long) running->Object.id); ffc22cd4: 80 9f 00 08 lwz r4,8(r31) ffc22cd8: 3c 60 ff c6 lis r3,-58 ffc22cdc: 38 63 9a 62 addi r3,r3,-26014 ffc22ce0: 4c c6 31 82 crclr 4*cr1+eq ffc22ce4: 4b fe 20 c1 bl ffc04da4 printk( ffc22ce8: 80 9f 00 0c lwz r4,12(r31) ffc22cec: 3c 60 ff c6 lis r3,-58 ffc22cf0: 38 63 9a 74 addi r3,r3,-25996 ffc22cf4: 4c c6 31 82 crclr 4*cr1+eq ffc22cf8: 4b fe 20 ad bl ffc04da4 "task name: 0x%08" PRIx32 "\n", running->Object.name.name_u32 ); printk( ffc22cfc: 80 7f 00 08 lwz r3,8(r31) ffc22d00: 38 a1 00 08 addi r5,r1,8 ffc22d04: 38 80 00 20 li r4,32 ffc22d08: 4b fe c9 a9 bl ffc0f6b0 ffc22d0c: 7c 64 1b 78 mr r4,r3 ffc22d10: 3c 60 ff c6 lis r3,-58 ffc22d14: 38 63 9a 88 addi r3,r3,-25976 ffc22d18: 4c c6 31 82 crclr 4*cr1+eq ffc22d1c: 4b fe 20 89 bl ffc04da4 ); printk( "task stack area (%lu Bytes): 0x%08" PRIxPTR " .. 0x%08" PRIxPTR "\n", (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) ffc22d20: 80 bf 00 b4 lwz r5,180(r31) ffc22d24: 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( ffc22d28: 3c 60 ff c6 lis r3,-58 ffc22d2c: 38 63 9a 9e addi r3,r3,-25954 ffc22d30: 7c c5 22 14 add r6,r5,r4 ffc22d34: 4c c6 31 82 crclr 4*cr1+eq ffc22d38: 4b fe 20 6d bl ffc04da4 "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) { ffc22d3c: 2f 9d 00 00 cmpwi cr7,r29,0 ffc22d40: 40 be 00 20 bne+ cr7,ffc22d60 <== NEVER TAKEN printk( ffc22d44: 3c 60 ff c6 lis r3,-58 ffc22d48: 38 63 9a cd addi r3,r3,-25907 ffc22d4c: 38 80 00 80 li r4,128 ffc22d50: 38 be 00 08 addi r5,r30,8 ffc22d54: 38 de 00 88 addi r6,r30,136 ffc22d58: 4c c6 31 82 crclr 4*cr1+eq ffc22d5c: 4b fe 20 49 bl ffc04da4 rtems_configuration_get_user_multiprocessing_table()->node ); } #endif rtems_fatal( ffc22d60: 80 9f 00 0c lwz r4,12(r31) ffc22d64: 38 60 00 09 li r3,9 ffc22d68: 4b fe 5b b1 bl ffc08918 =============================================================================== ffc0eddc : /** * 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(); ffc0eddc: 3d 20 ff c2 lis r9,-62 ffc0ede0: 81 49 46 34 lwz r10,17972(r9) ticks = microseconds / microseconds_per_tick; ffc0ede4: 7d 23 53 96 divwu r9,r3,r10 if ( (microseconds % microseconds_per_tick) != 0 ) ffc0ede8: 7d 49 51 d6 mullw r10,r9,r10 ffc0edec: 7f 83 50 00 cmpw cr7,r3,r10 ffc0edf0: 41 9e 00 08 beq- cr7,ffc0edf8 <== ALWAYS TAKEN ticks += 1; ffc0edf4: 39 29 00 01 addi r9,r9,1 <== NOT EXECUTED return ticks; } ffc0edf8: 7d 23 4b 78 mr r3,r9 ffc0edfc: 4e 80 00 20 blr =============================================================================== ffc0a124 : /** * 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(); ffc0a124: 3d 20 ff c2 lis r9,-62 ffc0a128: 81 49 c0 04 lwz r10,-16380(r9) ffc0a12c: 39 20 03 e8 li r9,1000 ffc0a130: 7d 4a 4b 96 divwu r10,r10,r9 ticks = milliseconds / milliseconds_per_tick; ffc0a134: 7d 23 53 96 divwu r9,r3,r10 if ( (milliseconds % milliseconds_per_tick) != 0 ) ffc0a138: 7d 49 51 d6 mullw r10,r9,r10 ffc0a13c: 7f 83 50 00 cmpw cr7,r3,r10 ffc0a140: 41 9e 00 08 beq- cr7,ffc0a148 <== ALWAYS TAKEN ticks += 1; ffc0a144: 39 29 00 01 addi r9,r9,1 <== NOT EXECUTED return ticks; } ffc0a148: 7d 23 4b 78 mr r3,r9 ffc0a14c: 4e 80 00 20 blr =============================================================================== ffc121c4 <_CORE_message_queue_Initialize>: CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { ffc121c4: 94 21 ff e0 stwu r1,-32(r1) ffc121c8: 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; ffc121cc: 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 ) { ffc121d0: bf a1 00 14 stmw r29,20(r1) ffc121d4: 7c 7f 1b 78 mr r31,r3 ffc121d8: 7c 9d 23 78 mr r29,r4 ffc121dc: 90 01 00 24 stw r0,36(r1) 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; ffc121e0: 91 23 00 48 stw r9,72(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)) { ffc121e4: 70 c9 00 03 andi. r9,r6,3 ) { size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; ffc121e8: 90 a3 00 44 stw r5,68(r3) the_message_queue->number_of_pending_messages = 0; the_message_queue->maximum_message_size = maximum_message_size; ffc121ec: 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)) { ffc121f0: 41 82 00 1c beq- ffc1220c <_CORE_message_queue_Initialize+0x48> allocated_message_size += sizeof(uintptr_t); ffc121f4: 39 26 00 04 addi r9,r6,4 allocated_message_size &= ~(sizeof(uintptr_t) - 1); ffc121f8: 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) ffc121fc: 7f 89 30 40 cmplw cr7,r9,r6 ffc12200: 40 9c 00 10 bge- cr7,ffc12210 <_CORE_message_queue_Initialize+0x4c> return false; ffc12204: 38 60 00 00 li r3,0 ffc12208: 48 00 00 84 b ffc1228c <_CORE_message_queue_Initialize+0xc8> /* * 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)) { ffc1220c: 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( ffc12210: 3b c9 00 10 addi r30,r9,16 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; ffc12214: 7d 45 f0 16 mulhwu r10,r5,r30 ffc12218: 7d 65 f1 d6 mullw r11,r5,r30 if ( x > SIZE_MAX ) ffc1221c: 2f 8a 00 00 cmpwi cr7,r10,0 ffc12220: 41 bd ff e4 bgt- cr7,ffc12204 <_CORE_message_queue_Initialize+0x40> /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); ffc12224: 7d 63 5b 78 mr r3,r11 ffc12228: 90 a1 00 08 stw r5,8(r1) ffc1222c: 48 00 31 19 bl ffc15344 <_Workspace_Allocate> if (the_message_queue->message_buffers == 0) ffc12230: 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 *) ffc12234: 90 7f 00 5c stw r3,92(r31) _Workspace_Allocate( message_buffering_required ); ffc12238: 7c 64 1b 78 mr r4,r3 if (the_message_queue->message_buffers == 0) ffc1223c: 80 a1 00 08 lwz r5,8(r1) ffc12240: 41 be ff c4 beq- cr7,ffc12204 <_CORE_message_queue_Initialize+0x40><== NEVER TAKEN /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( ffc12244: 38 7f 00 60 addi r3,r31,96 ffc12248: 7f c6 f3 78 mr r6,r30 ffc1224c: 4b ff ff 3d bl ffc12188 <_Chain_Initialize> */ RTEMS_INLINE_ROUTINE bool _CORE_message_queue_Is_priority( CORE_message_queue_Attributes *the_attribute ) { return ffc12250: 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 ); ffc12254: 39 5f 00 54 addi r10,r31,84 ffc12258: 39 3f 00 50 addi r9,r31,80 head->next = tail; ffc1225c: 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( ffc12260: 68 84 00 01 xori r4,r4,1 head->previous = NULL; ffc12264: 39 40 00 00 li r10,0 tail->previous = head; ffc12268: 91 3f 00 58 stw r9,88(r31) ffc1226c: 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; ffc12270: 91 5f 00 54 stw r10,84(r31) ffc12274: 7f e3 fb 78 mr r3,r31 ffc12278: 54 84 d9 7e rlwinm r4,r4,27,5,31 ffc1227c: 38 a0 00 80 li r5,128 ffc12280: 38 c0 00 06 li r6,6 ffc12284: 48 00 27 a9 bl ffc14a2c <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; ffc12288: 38 60 00 01 li r3,1 } ffc1228c: 39 61 00 20 addi r11,r1,32 ffc12290: 4b ff 37 3c b ffc059cc <_restgpr_29_x> =============================================================================== ffc097fc <_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 ) { ffc097fc: 7c 2b 0b 78 mr r11,r1 ffc09800: 7c 08 02 a6 mflr r0 ffc09804: 94 21 ff f0 stwu r1,-16(r1) ffc09808: 48 01 08 41 bl ffc1a048 <_savegpr_31> ffc0980c: 90 01 00 14 stw r0,20(r1) ffc09810: 7c 7f 1b 78 mr r31,r3 ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { ffc09814: 48 00 1d 01 bl ffc0b514 <_Thread_queue_Dequeue> ffc09818: 2f 83 00 00 cmpwi cr7,r3,0 ffc0981c: 40 be 00 3c bne+ cr7,ffc09858 <_CORE_semaphore_Surrender+0x5c> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc09820: 7d 00 00 a6 mfmsr r8 ffc09824: 7d 30 42 a6 mfsprg r9,0 ffc09828: 7d 09 48 78 andc r9,r8,r9 ffc0982c: 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 ) ffc09830: 81 3f 00 48 lwz r9,72(r31) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; ffc09834: 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 ) ffc09838: 81 5f 00 40 lwz r10,64(r31) ffc0983c: 7f 89 50 40 cmplw cr7,r9,r10 ffc09840: 40 9c 00 10 bge- cr7,ffc09850 <_CORE_semaphore_Surrender+0x54><== NEVER TAKEN the_semaphore->count += 1; ffc09844: 39 29 00 01 addi r9,r9,1 ffc09848: 91 3f 00 48 stw r9,72(r31) { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; ffc0984c: 38 60 00 00 li r3,0 return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc09850: 7d 00 01 24 mtmsr r8 ffc09854: 48 00 00 08 b ffc0985c <_CORE_semaphore_Surrender+0x60> ffc09858: 38 60 00 00 li r3,0 status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } ffc0985c: 39 61 00 10 addi r11,r1,16 ffc09860: 4b ff 6d 64 b ffc005c4 <_restgpr_31_x> =============================================================================== ffc08454 <_Event_Surrender>: rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { ffc08454: 7c 2b 0b 78 mr r11,r1 ffc08458: 7c 08 02 a6 mflr r0 ffc0845c: 94 21 ff f0 stwu r1,-16(r1) ffc08460: 90 01 00 14 stw r0,20(r1) ffc08464: 48 01 1b e5 bl ffc1a048 <_savegpr_31> ffc08468: 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; ffc0846c: 80 63 00 30 lwz r3,48(r3) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc08470: 7d 20 00 a6 mfmsr r9 ffc08474: 7d 50 42 a6 mfsprg r10,0 ffc08478: 7d 2a 50 78 andc r10,r9,r10 ffc0847c: 7d 40 01 24 mtmsr r10 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; ffc08480: 81 45 00 00 lwz r10,0(r5) ffc08484: 7c 84 53 78 or r4,r4,r10 ffc08488: 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; ffc0848c: 81 1f 00 24 lwz r8,36(r31) seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { ffc08490: 7c 8a 40 39 and. r10,r4,r8 ffc08494: 40 a2 00 08 bne+ ffc0849c <_Event_Surrender+0x48> ffc08498: 48 00 00 f0 b ffc08588 <_Event_Surrender+0x134> /* * 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() && ffc0849c: 3d 60 00 00 lis r11,0 ffc084a0: 39 6b 2e 00 addi r11,r11,11776 ffc084a4: 80 0b 00 08 lwz r0,8(r11) ffc084a8: 2f 80 00 00 cmpwi cr7,r0,0 ffc084ac: 41 9e 00 54 beq- cr7,ffc08500 <_Event_Surrender+0xac> ffc084b0: 81 6b 00 10 lwz r11,16(r11) ffc084b4: 7f 9f 58 00 cmpw cr7,r31,r11 ffc084b8: 40 be 00 48 bne+ cr7,ffc08500 <_Event_Surrender+0xac> _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || ffc084bc: 81 66 00 00 lwz r11,0(r6) ffc084c0: 39 6b ff ff addi r11,r11,-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 ) && ffc084c4: 2b 8b 00 01 cmplwi cr7,r11,1 ffc084c8: 41 bd 00 38 bgt+ cr7,ffc08500 <_Event_Surrender+0xac> ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { ffc084cc: 7f 8a 40 00 cmpw cr7,r10,r8 ffc084d0: 41 9e 00 0c beq- cr7,ffc084dc <_Event_Surrender+0x88> ffc084d4: 70 68 00 02 andi. r8,r3,2 ffc084d8: 41 82 00 b0 beq- ffc08588 <_Event_Surrender+0x134> <== NEVER TAKEN 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) ); ffc084dc: 7c 84 50 78 andc r4,r4,r10 event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; ffc084e0: 39 00 00 00 li r8,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( ffc084e4: 90 85 00 00 stw r4,0(r5) pending_events, seized_events ); the_thread->Wait.count = 0; ffc084e8: 91 1f 00 24 stw r8,36(r31) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; ffc084ec: 81 1f 00 28 lwz r8,40(r31) ffc084f0: 91 48 00 00 stw r10,0(r8) *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; ffc084f4: 39 40 00 03 li r10,3 ffc084f8: 91 46 00 00 stw r10,0(r6) ffc084fc: 48 00 00 8c b ffc08588 <_Event_Surrender+0x134> RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); ffc08500: 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 ) ) { ffc08504: 7c eb 30 39 and. r11,r7,r6 ffc08508: 41 82 00 80 beq- ffc08588 <_Event_Surrender+0x134> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { ffc0850c: 7f 8a 40 00 cmpw cr7,r10,r8 ffc08510: 41 9e 00 0c beq- cr7,ffc0851c <_Event_Surrender+0xc8> ffc08514: 70 68 00 02 andi. r8,r3,2 ffc08518: 41 82 00 70 beq- ffc08588 <_Event_Surrender+0x134> <== NEVER TAKEN ffc0851c: 7c 84 50 78 andc r4,r4,r10 event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; ffc08520: 39 00 00 00 li r8,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( ffc08524: 90 85 00 00 stw r4,0(r5) pending_events, seized_events ); the_thread->Wait.count = 0; ffc08528: 91 1f 00 24 stw r8,36(r31) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; ffc0852c: 81 1f 00 28 lwz r8,40(r31) ffc08530: 91 48 00 00 stw r10,0(r8) static inline void ppc_interrupt_flash( uint32_t level ) { uint32_t current_level; __asm__ volatile ( ffc08534: 7d 40 00 a6 mfmsr r10 ffc08538: 7d 20 01 24 mtmsr r9 ffc0853c: 7d 40 01 24 mtmsr r10 _ISR_Flash( level ); if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { ffc08540: 81 5f 00 50 lwz r10,80(r31) ffc08544: 2f 8a 00 02 cmpwi cr7,r10,2 ffc08548: 41 9e 00 0c beq- cr7,ffc08554 <_Event_Surrender+0x100> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0854c: 7d 20 01 24 mtmsr r9 ffc08550: 48 00 00 18 b ffc08568 <_Event_Surrender+0x114> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; ffc08554: 39 40 00 03 li r10,3 ffc08558: 91 5f 00 50 stw r10,80(r31) ffc0855c: 7d 20 01 24 mtmsr r9 _ISR_Enable( level ); _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); (void) _Watchdog_Remove( &the_thread->Timer ); ffc08560: 38 7f 00 48 addi r3,r31,72 ffc08564: 48 00 3a b5 bl ffc0c018 <_Watchdog_Remove> } return; } } _ISR_Enable( level ); } ffc08568: 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 ); ffc0856c: 7f e3 fb 78 mr r3,r31 ffc08570: 3c 80 10 07 lis r4,4103 ffc08574: 83 e1 00 0c lwz r31,12(r1) ffc08578: 7c 08 03 a6 mtlr r0 ffc0857c: 60 84 ff f8 ori r4,r4,65528 ffc08580: 38 21 00 10 addi r1,r1,16 ffc08584: 48 00 27 f0 b ffc0ad74 <_Thread_Clear_state> ffc08588: 7d 20 01 24 mtmsr r9 ffc0858c: 39 61 00 10 addi r11,r1,16 ffc08590: 4b ff 80 34 b ffc005c4 <_restgpr_31_x> =============================================================================== ffc08594 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *arg ) { ffc08594: 7c 2b 0b 78 mr r11,r1 ffc08598: 94 21 ff e0 stwu r1,-32(r1) ffc0859c: 7c 08 02 a6 mflr r0 ffc085a0: 48 01 1a a9 bl ffc1a048 <_savegpr_31> ffc085a4: 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 ); ffc085a8: 38 81 00 08 addi r4,r1,8 void _Event_Timeout( Objects_Id id, void *arg ) { ffc085ac: 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 ); ffc085b0: 48 00 2c 01 bl ffc0b1b0 <_Thread_Get> switch ( location ) { ffc085b4: 81 21 00 08 lwz r9,8(r1) ffc085b8: 2f 89 00 00 cmpwi cr7,r9,0 ffc085bc: 40 9e 00 64 bne- cr7,ffc08620 <_Event_Timeout+0x8c> <== NEVER TAKEN static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc085c0: 7d 40 00 a6 mfmsr r10 ffc085c4: 7d 10 42 a6 mfsprg r8,0 ffc085c8: 7d 48 40 78 andc r8,r10,r8 ffc085cc: 7d 00 01 24 mtmsr r8 _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; ffc085d0: 91 23 00 24 stw r9,36(r3) RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); ffc085d4: 3d 20 00 00 lis r9,0 if ( _Thread_Is_executing( the_thread ) ) { ffc085d8: 81 29 2e 10 lwz r9,11792(r9) ffc085dc: 7f 83 48 00 cmpw cr7,r3,r9 ffc085e0: 40 be 00 18 bne+ cr7,ffc085f8 <_Event_Timeout+0x64> if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) ffc085e4: 81 3f 00 00 lwz r9,0(r31) ffc085e8: 2f 89 00 01 cmpwi cr7,r9,1 ffc085ec: 40 be 00 0c bne+ cr7,ffc085f8 <_Event_Timeout+0x64> *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; ffc085f0: 39 20 00 02 li r9,2 ffc085f4: 91 3f 00 00 stw r9,0(r31) } the_thread->Wait.return_code = RTEMS_TIMEOUT; ffc085f8: 39 20 00 06 li r9,6 ffc085fc: 91 23 00 34 stw r9,52(r3) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc08600: 7d 40 01 24 mtmsr r10 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); ffc08604: 3c 80 10 07 lis r4,4103 ffc08608: 60 84 ff f8 ori r4,r4,65528 ffc0860c: 48 00 27 69 bl ffc0ad74 <_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; ffc08610: 3d 20 00 00 lis r9,0 ffc08614: 81 49 28 24 lwz r10,10276(r9) --level; ffc08618: 39 4a ff ff addi r10,r10,-1 _Thread_Dispatch_disable_level = level; ffc0861c: 91 49 28 24 stw r10,10276(r9) case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } ffc08620: 39 61 00 20 addi r11,r1,32 ffc08624: 4b ff 7f a0 b ffc005c4 <_restgpr_31_x> =============================================================================== ffc0dd5c <_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 ) { ffc0dd5c: 2c 04 00 00 cmpwi r4,0 return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { ffc0dd60: 7c 08 02 a6 mflr r0 ffc0dd64: 7c 2b 0b 78 mr r11,r1 ffc0dd68: 94 21 ff f0 stwu r1,-16(r1) ffc0dd6c: 90 01 00 14 stw r0,20(r1) ffc0dd70: 48 00 c2 d9 bl ffc1a048 <_savegpr_31> /* * 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 ) { ffc0dd74: 41 82 01 e4 beq- ffc0df58 <_Heap_Free+0x1fc> ffc0dd78: 81 03 00 10 lwz r8,16(r3) ffc0dd7c: 7c 69 1b 78 mr r9,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 ffc0dd80: 81 63 00 20 lwz r11,32(r3) RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ffc0dd84: 7d 44 43 96 divwu r10,r4,r8 ffc0dd88: 7d 4a 41 d6 mullw r10,r10,r8 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; ffc0dd8c: 39 00 00 00 li r8,0 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); ffc0dd90: 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; ffc0dd94: 7f 8a 58 40 cmplw cr7,r10,r11 ffc0dd98: 41 9c 00 14 blt- cr7,ffc0ddac <_Heap_Free+0x50> ffc0dd9c: 81 03 00 24 lwz r8,36(r3) ffc0dda0: 7d 0a 40 10 subfc r8,r10,r8 ffc0dda4: 39 00 00 00 li r8,0 ffc0dda8: 7d 08 41 14 adde r8,r8,r8 } 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 ) ) { ffc0ddac: 2f 88 00 00 cmpwi cr7,r8,0 return false; ffc0ddb0: 38 60 00 00 li r3,0 } 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 ) ) { ffc0ddb4: 41 9e 01 a8 beq- cr7,ffc0df5c <_Heap_Free+0x200> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } ffc0ddb8: 80 8a 00 04 lwz r4,4(r10) ffc0ddbc: 38 c0 00 00 li r6,0 - 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; ffc0ddc0: 54 87 00 3c rlwinm r7,r4,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); ffc0ddc4: 7d 07 52 14 add r8,r7,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; ffc0ddc8: 7f 88 58 40 cmplw cr7,r8,r11 ffc0ddcc: 41 9c 00 14 blt- cr7,ffc0dde0 <_Heap_Free+0x84> <== NEVER TAKEN ffc0ddd0: 80 c9 00 24 lwz r6,36(r9) ffc0ddd4: 7c c8 30 10 subfc r6,r8,r6 ffc0ddd8: 38 c0 00 00 li r6,0 ffc0dddc: 7c c6 31 14 adde r6,r6,r6 _Heap_Protection_block_check( heap, block ); block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { ffc0dde0: 2f 86 00 00 cmpwi cr7,r6,0 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; ffc0dde4: 38 60 00 00 li r3,0 _Heap_Protection_block_check( heap, block ); block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { ffc0dde8: 41 9e 01 74 beq- cr7,ffc0df5c <_Heap_Free+0x200> <== NEVER TAKEN --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } ffc0ddec: 80 a8 00 04 lwz r5,4(r8) return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { ffc0ddf0: 70 a6 00 01 andi. r6,r5,1 ffc0ddf4: 41 82 01 68 beq- ffc0df5c <_Heap_Free+0x200> 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 ffc0ddf8: 80 69 00 24 lwz r3,36(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; ffc0ddfc: 54 a5 00 3c rlwinm r5,r5,0,0,30 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); ffc0de00: 7f 88 18 00 cmpw cr7,r8,r3 ffc0de04: 41 9e 00 18 beq- cr7,ffc0de1c <_Heap_Free+0xc0> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } ffc0de08: 7c c8 2a 14 add r6,r8,r5 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 )); ffc0de0c: 80 06 00 04 lwz r0,4(r6) ffc0de10: 68 00 00 01 xori r0,r0,1 ffc0de14: 54 00 07 fe clrlwi r0,r0,31 ffc0de18: 48 00 00 08 b ffc0de20 <_Heap_Free+0xc4> ffc0de1c: 38 00 00 00 li r0,0 if ( !_Heap_Is_prev_used( block ) ) { ffc0de20: 70 9f 00 01 andi. r31,r4,1 ffc0de24: 40 82 00 94 bne- ffc0deb8 <_Heap_Free+0x15c> uintptr_t const prev_size = block->prev_size; ffc0de28: 80 8a 00 00 lwz r4,0(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; ffc0de2c: 39 80 00 00 li r12,0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); ffc0de30: 7c c4 50 50 subf r6,r4,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; ffc0de34: 7f 86 58 40 cmplw cr7,r6,r11 ffc0de38: 41 9c 00 10 blt- cr7,ffc0de48 <_Heap_Free+0xec> <== NEVER TAKEN ffc0de3c: 7d 86 18 10 subfc r12,r6,r3 ffc0de40: 39 80 00 00 li r12,0 ffc0de44: 7d 8c 61 14 adde r12,r12,r12 Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { ffc0de48: 2f 8c 00 00 cmpwi cr7,r12,0 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; ffc0de4c: 38 60 00 00 li r3,0 if ( !_Heap_Is_prev_used( block ) ) { uintptr_t const prev_size = block->prev_size; Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { ffc0de50: 41 9e 01 0c beq- cr7,ffc0df5c <_Heap_Free+0x200> <== 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; ffc0de54: 81 66 00 04 lwz r11,4(r6) 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) ) { ffc0de58: 71 7f 00 01 andi. r31,r11,1 ffc0de5c: 41 82 01 00 beq- ffc0df5c <_Heap_Free+0x200> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ ffc0de60: 2f 80 00 00 cmpwi cr7,r0,0 ffc0de64: 7c 87 22 14 add r4,r7,r4 ffc0de68: 41 be 00 34 beq+ cr7,ffc0de9c <_Heap_Free+0x140> } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; ffc0de6c: 81 48 00 0c lwz r10,12(r8) uintptr_t const size = block_size + prev_size + next_block_size; ffc0de70: 7c a4 2a 14 add r5,r4,r5 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; ffc0de74: 80 88 00 08 lwz r4,8(r8) Heap_Block *prev = block->prev; prev->next = next; ffc0de78: 90 8a 00 08 stw r4,8(r10) next->prev = prev; ffc0de7c: 91 44 00 0c stw r10,12(r4) _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; ffc0de80: 81 49 00 38 lwz r10,56(r9) ffc0de84: 39 4a ff ff addi r10,r10,-1 ffc0de88: 91 49 00 38 stw r10,56(r9) prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; ffc0de8c: 60 aa 00 01 ori r10,r5,1 ffc0de90: 91 46 00 04 stw r10,4(r6) next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; ffc0de94: 7c a5 31 2e stwx r5,r5,r6 ffc0de98: 48 00 00 9c b ffc0df34 <_Heap_Free+0x1d8> } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; ffc0de9c: 60 85 00 01 ori r5,r4,1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; ffc0dea0: 7c 87 51 2e stwx r4,r7,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; ffc0dea4: 90 a6 00 04 stw r5,4(r6) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; ffc0dea8: 80 c8 00 04 lwz r6,4(r8) ffc0deac: 54 c6 00 3c rlwinm r6,r6,0,0,30 ffc0deb0: 90 c8 00 04 stw r6,4(r8) ffc0deb4: 48 00 00 80 b ffc0df34 <_Heap_Free+0x1d8> next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ ffc0deb8: 2f 80 00 00 cmpwi cr7,r0,0 ffc0debc: 41 be 00 30 beq+ cr7,ffc0deec <_Heap_Free+0x190> uintptr_t const size = block_size + next_block_size; ffc0dec0: 7c c5 3a 14 add r6,r5,r7 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; ffc0dec4: 80 a8 00 08 lwz r5,8(r8) Heap_Block *prev = old_block->prev; ffc0dec8: 81 08 00 0c lwz r8,12(r8) new_block->next = next; ffc0decc: 90 aa 00 08 stw r5,8(r10) new_block->prev = prev; ffc0ded0: 91 0a 00 0c stw r8,12(r10) next->prev = new_block; prev->next = new_block; ffc0ded4: 91 48 00 08 stw r10,8(r8) _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; ffc0ded8: 60 c8 00 01 ori r8,r6,1 Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; ffc0dedc: 91 45 00 0c stw r10,12(r5) ffc0dee0: 91 0a 00 04 stw r8,4(r10) next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; ffc0dee4: 7c c6 51 2e stwx r6,r6,r10 ffc0dee8: 48 00 00 4c b ffc0df34 <_Heap_Free+0x1d8> RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; ffc0deec: 80 c9 00 08 lwz r6,8(r9) new_block->next = next; new_block->prev = block_before; ffc0def0: 91 2a 00 0c stw r9,12(r10) Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; ffc0def4: 90 ca 00 08 stw r6,8(r10) new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; ffc0def8: 91 46 00 0c stw r10,12(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; ffc0defc: 60 e6 00 01 ori r6,r7,1 ffc0df00: 90 ca 00 04 stw r6,4(r10) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; ffc0df04: 80 c8 00 04 lwz r6,4(r8) next_block->prev_size = block_size; ffc0df08: 7c e7 51 2e stwx r7,r7,r10 } 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; ffc0df0c: 54 c6 00 3c rlwinm r6,r6,0,0,30 { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; ffc0df10: 91 49 00 08 stw r10,8(r9) next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; ffc0df14: 81 49 00 38 lwz r10,56(r9) } 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; ffc0df18: 90 c8 00 04 stw r6,4(r8) next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; ffc0df1c: 39 4a 00 01 addi r10,r10,1 if ( stats->max_free_blocks < stats->free_blocks ) { ffc0df20: 81 09 00 3c lwz r8,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; ffc0df24: 91 49 00 38 stw r10,56(r9) if ( stats->max_free_blocks < stats->free_blocks ) { ffc0df28: 7f 88 50 40 cmplw cr7,r8,r10 ffc0df2c: 40 9c 00 08 bge- cr7,ffc0df34 <_Heap_Free+0x1d8> stats->max_free_blocks = stats->free_blocks; ffc0df30: 91 49 00 3c stw r10,60(r9) } } /* Statistics */ --stats->used_blocks; ffc0df34: 81 49 00 40 lwz r10,64(r9) ffc0df38: 39 4a ff ff addi r10,r10,-1 ffc0df3c: 91 49 00 40 stw r10,64(r9) ++stats->frees; ffc0df40: 81 49 00 50 lwz r10,80(r9) ffc0df44: 39 4a 00 01 addi r10,r10,1 ffc0df48: 91 49 00 50 stw r10,80(r9) stats->free_size += block_size; ffc0df4c: 81 49 00 30 lwz r10,48(r9) ffc0df50: 7c ea 3a 14 add r7,r10,r7 ffc0df54: 90 e9 00 30 stw r7,48(r9) * 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; ffc0df58: 38 60 00 01 li r3,1 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } ffc0df5c: 39 61 00 10 addi r11,r1,16 ffc0df60: 4b ff 26 64 b ffc005c4 <_restgpr_31_x> =============================================================================== ffc0b814 <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { ffc0b814: 94 21 ff e0 stwu r1,-32(r1) ffc0b818: 7c 08 02 a6 mflr r0 ffc0b81c: bf 61 00 0c stmw r27,12(r1) ffc0b820: 7c 7f 1b 78 mr r31,r3 ffc0b824: 7c 9c 23 78 mr r28,r4 ffc0b828: 90 01 00 24 stw r0,36(r1) ffc0b82c: 7c bb 2b 78 mr r27,r5 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { ffc0b830: 3b c0 00 00 li r30,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; ffc0b834: 3b a0 00 00 li r29,0 Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { ffc0b838: 48 00 00 40 b ffc0b878 <_Heap_Greedy_allocate+0x64> #include "config.h" #endif #include Heap_Block *_Heap_Greedy_allocate( ffc0b83c: 57 c9 10 3a rlwinm r9,r30,2,0,29 * @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 ); ffc0b840: 7c 9c 48 2e lwzx r4,r28,r9 ffc0b844: 7f e3 fb 78 mr r3,r31 ffc0b848: 38 a0 00 00 li r5,0 ffc0b84c: 38 c0 00 00 li r6,0 ffc0b850: 48 00 6e 95 bl ffc126e4 <_Heap_Allocate_aligned_with_boundary> size_t i; for (i = 0; i < block_count; ++i) { void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { ffc0b854: 2c 03 00 00 cmpwi r3,0 ffc0b858: 41 82 00 1c beq- ffc0b874 <_Heap_Greedy_allocate+0x60> <== NEVER TAKEN RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ffc0b85c: 81 3f 00 10 lwz r9,16(r31) ffc0b860: 7c 63 4b 96 divwu r3,r3,r9 ffc0b864: 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; ffc0b868: 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); ffc0b86c: 39 29 ff f8 addi r9,r9,-8 ffc0b870: 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) { ffc0b874: 3b de 00 01 addi r30,r30,1 ffc0b878: 7f 9e d8 00 cmpw cr7,r30,r27 ffc0b87c: 40 9e ff c0 bne+ cr7,ffc0b83c <_Heap_Greedy_allocate+0x28> ffc0b880: 3b 80 00 00 li r28,0 ffc0b884: 48 00 00 28 b ffc0b8ac <_Heap_Greedy_allocate+0x98> } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; ffc0b888: 80 de 00 04 lwz r6,4(r30) allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { _Heap_Block_allocate( ffc0b88c: 7f e3 fb 78 mr r3,r31 ffc0b890: 7f c4 f3 78 mr r4,r30 ffc0b894: 54 c6 00 3c rlwinm r6,r6,0,0,30 ffc0b898: 38 be 00 08 addi r5,r30,8 ffc0b89c: 38 c6 ff f8 addi r6,r6,-8 ffc0b8a0: 48 00 03 0d bl ffc0bbac <_Heap_Block_allocate> current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; ffc0b8a4: 93 9e 00 08 stw r28,8(r30) ffc0b8a8: 7f dc f3 78 mr r28,r30 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; ffc0b8ac: 83 df 00 08 lwz r30,8(r31) next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { ffc0b8b0: 7f 9e f8 00 cmpw cr7,r30,r31 ffc0b8b4: 40 9e ff d4 bne+ cr7,ffc0b888 <_Heap_Greedy_allocate+0x74> ffc0b8b8: 48 00 00 14 b ffc0b8cc <_Heap_Greedy_allocate+0xb8> blocks = current; } while ( allocated_blocks != NULL ) { current = allocated_blocks; allocated_blocks = allocated_blocks->next; ffc0b8bc: 7f a4 eb 78 mr r4,r29 ffc0b8c0: 87 a4 00 08 lwzu r29,8(r4) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); ffc0b8c4: 7f e3 fb 78 mr r3,r31 ffc0b8c8: 48 00 6f ad bl ffc12874 <_Heap_Free> current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { ffc0b8cc: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0b8d0: 40 9e ff ec bne+ cr7,ffc0b8bc <_Heap_Greedy_allocate+0xa8> allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } ffc0b8d4: 39 61 00 20 addi r11,r1,32 ffc0b8d8: 7f 83 e3 78 mr r3,r28 ffc0b8dc: 4b ff 58 48 b ffc01124 <_restgpr_27_x> =============================================================================== ffc12710 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { ffc12710: 94 21 ff e8 stwu r1,-24(r1) ffc12714: 7c 08 02 a6 mflr r0 ffc12718: 90 01 00 1c stw r0,28(r1) ffc1271c: bf 81 00 08 stmw r28,8(r1) ffc12720: 7c 9d 23 78 mr r29,r4 ffc12724: 7c bc 2b 78 mr r28,r5 Heap_Block *current = heap->first_block; ffc12728: 81 23 00 20 lwz r9,32(r3) Heap_Block *end = heap->last_block; ffc1272c: 83 c3 00 24 lwz r30,36(r3) ffc12730: 48 00 00 34 b ffc12764 <_Heap_Iterate+0x54> ffc12734: 80 89 00 04 lwz r4,4(r9) while ( !stop && current != end ) { 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 ); ffc12738: 7d 23 4b 78 mr r3,r9 ffc1273c: 7f 86 e3 78 mr r6,r28 ffc12740: 7f a9 03 a6 mtctr r29 ffc12744: 54 84 00 3c rlwinm r4,r4,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); ffc12748: 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; ffc1274c: 80 bf 00 04 lwz r5,4(r31) ffc12750: 54 a5 07 fe clrlwi r5,r5,31 ffc12754: 4e 80 04 21 bctrl ffc12758: 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 ) { ffc1275c: 2f 83 00 00 cmpwi cr7,r3,0 ffc12760: 40 9e 00 0c bne- cr7,ffc1276c <_Heap_Iterate+0x5c> <== NEVER TAKEN ffc12764: 7f 89 f0 00 cmpw cr7,r9,r30 ffc12768: 40 9e ff cc bne+ cr7,ffc12734 <_Heap_Iterate+0x24> stop = (*visitor)( current, size, used, visitor_arg ); current = next; } } ffc1276c: 39 61 00 18 addi r11,r1,24 ffc12770: 4b ff 0d d4 b ffc03544 <_restgpr_28_x> =============================================================================== ffc1aa0c <_Heap_Size_of_alloc_area>: RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ffc1aa0c: 81 03 00 10 lwz r8,16(r3) bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { ffc1aa10: 7c 69 1b 78 mr r9,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 ffc1aa14: 80 e3 00 20 lwz r7,32(r3) RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ffc1aa18: 7d 44 43 96 divwu r10,r4,r8 ffc1aa1c: 7d 0a 41 d6 mullw r8,r10,r8 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; ffc1aa20: 39 40 00 00 li r10,0 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); ffc1aa24: 39 08 ff f8 addi r8,r8,-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; ffc1aa28: 7f 88 38 40 cmplw cr7,r8,r7 ffc1aa2c: 41 9c 00 14 blt- cr7,ffc1aa40 <_Heap_Size_of_alloc_area+0x34> ffc1aa30: 81 43 00 24 lwz r10,36(r3) ffc1aa34: 7d 48 50 10 subfc r10,r8,r10 ffc1aa38: 39 40 00 00 li r10,0 ffc1aa3c: 7d 4a 51 14 adde r10,r10,r10 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { ffc1aa40: 2f 8a 00 00 cmpwi cr7,r10,0 return false; ffc1aa44: 38 60 00 00 li r3,0 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { ffc1aa48: 4d 9e 00 20 beqlr cr7 - 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; ffc1aa4c: 81 48 00 04 lwz r10,4(r8) ffc1aa50: 55 4a 00 3c rlwinm r10,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); ffc1aa54: 7d 4a 42 14 add r10,r10,r8 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; ffc1aa58: 7f 8a 38 40 cmplw cr7,r10,r7 ffc1aa5c: 39 00 00 00 li r8,0 ffc1aa60: 41 9c 00 14 blt- cr7,ffc1aa74 <_Heap_Size_of_alloc_area+0x68><== NEVER TAKEN ffc1aa64: 81 09 00 24 lwz r8,36(r9) ffc1aa68: 7d 0a 40 10 subfc r8,r10,r8 ffc1aa6c: 39 00 00 00 li r8,0 ffc1aa70: 7d 08 41 14 adde r8,r8,r8 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( ffc1aa74: 2f 88 00 00 cmpwi cr7,r8,0 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; ffc1aa78: 38 60 00 00 li r3,0 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( ffc1aa7c: 4d 9e 00 20 beqlr cr7 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; ffc1aa80: 81 2a 00 04 lwz r9,4(r10) !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ffc1aa84: 71 28 00 01 andi. r8,r9,1 ffc1aa88: 4d 82 00 20 beqlr ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; ffc1aa8c: 20 84 00 04 subfic r4,r4,4 ffc1aa90: 7d 44 52 14 add r10,r4,r10 ffc1aa94: 91 45 00 00 stw r10,0(r5) return true; ffc1aa98: 38 60 00 01 li r3,1 } ffc1aa9c: 4e 80 00 20 blr =============================================================================== ffc0a34c <_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; ffc0a34c: 2f 85 00 00 cmpwi cr7,r5,0 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { ffc0a350: 94 21 ff 98 stwu r1,-104(r1) ffc0a354: 7c 08 02 a6 mflr r0 ffc0a358: bd c1 00 20 stmw r14,32(r1) ffc0a35c: 7c 7d 1b 78 mr r29,r3 ffc0a360: 7c 9e 23 78 mr r30,r4 ffc0a364: 90 01 00 6c stw r0,108(r1) uintptr_t const page_size = heap->page_size; ffc0a368: 83 43 00 10 lwz r26,16(r3) uintptr_t const min_block_size = heap->min_block_size; ffc0a36c: 83 03 00 14 lwz r24,20(r3) Heap_Block *const first_block = heap->first_block; ffc0a370: 83 83 00 20 lwz r28,32(r3) Heap_Block *const last_block = heap->last_block; ffc0a374: 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; ffc0a378: 41 9e 00 10 beq- cr7,ffc0a388 <_Heap_Walk+0x3c> ffc0a37c: 3f e0 ff c1 lis r31,-63 ffc0a380: 3b ff a2 9c addi r31,r31,-23908 ffc0a384: 48 00 00 0c b ffc0a390 <_Heap_Walk+0x44> ffc0a388: 3f e0 ff c1 lis r31,-63 ffc0a38c: 3b ff a2 98 addi r31,r31,-23912 if ( !_System_state_Is_up( _System_state_Get() ) ) { ffc0a390: 3d 20 00 00 lis r9,0 ffc0a394: 81 29 28 08 lwz r9,10248(r9) ffc0a398: 2f 89 00 03 cmpwi cr7,r9,3 ffc0a39c: 41 9e 00 0c beq- cr7,ffc0a3a8 <_Heap_Walk+0x5c> return true; ffc0a3a0: 38 60 00 01 li r3,1 ffc0a3a4: 48 00 04 cc b ffc0a870 <_Heap_Walk+0x524> 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)( ffc0a3a8: 81 5d 00 08 lwz r10,8(r29) ffc0a3ac: 3c a0 ff c1 lis r5,-63 ffc0a3b0: 81 1d 00 18 lwz r8,24(r29) ffc0a3b4: 7f c3 f3 78 mr r3,r30 ffc0a3b8: 91 41 00 0c stw r10,12(r1) ffc0a3bc: 38 80 00 00 li r4,0 ffc0a3c0: 38 a5 6e 94 addi r5,r5,28308 ffc0a3c4: 7f e9 03 a6 mtctr r31 ffc0a3c8: 81 5d 00 0c lwz r10,12(r29) ffc0a3cc: 7f 46 d3 78 mr r6,r26 ffc0a3d0: 81 3d 00 1c lwz r9,28(r29) ffc0a3d4: 7f 07 c3 78 mr r7,r24 ffc0a3d8: 91 41 00 10 stw r10,16(r1) ffc0a3dc: 7f 8a e3 78 mr r10,r28 ffc0a3e0: 92 e1 00 08 stw r23,8(r1) ffc0a3e4: 4c c6 31 82 crclr 4*cr1+eq ffc0a3e8: 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 ) { ffc0a3ec: 2f 9a 00 00 cmpwi cr7,r26,0 ffc0a3f0: 40 be 00 18 bne+ cr7,ffc0a408 <_Heap_Walk+0xbc> (*printer)( source, true, "page size is zero\n" ); ffc0a3f4: 3c a0 ff c1 lis r5,-63 ffc0a3f8: 7f c3 f3 78 mr r3,r30 ffc0a3fc: 38 80 00 01 li r4,1 ffc0a400: 38 a5 6f 25 addi r5,r5,28453 ffc0a404: 48 00 00 d8 b ffc0a4dc <_Heap_Walk+0x190> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { ffc0a408: 73 47 00 07 andi. r7,r26,7 ffc0a40c: 41 a2 00 1c beq+ ffc0a428 <_Heap_Walk+0xdc> (*printer)( ffc0a410: 3c a0 ff c1 lis r5,-63 ffc0a414: 7f c3 f3 78 mr r3,r30 ffc0a418: 38 80 00 01 li r4,1 ffc0a41c: 38 a5 6f 38 addi r5,r5,28472 ffc0a420: 7f 46 d3 78 mr r6,r26 ffc0a424: 48 00 04 3c b ffc0a860 <_Heap_Walk+0x514> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; ffc0a428: 7d 38 d3 96 divwu r9,r24,r26 ffc0a42c: 7d 29 d1 d6 mullw r9,r9,r26 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { ffc0a430: 7f 98 48 00 cmpw cr7,r24,r9 ffc0a434: 41 be 00 1c beq+ cr7,ffc0a450 <_Heap_Walk+0x104> (*printer)( ffc0a438: 3c a0 ff c1 lis r5,-63 ffc0a43c: 7f c3 f3 78 mr r3,r30 ffc0a440: 38 80 00 01 li r4,1 ffc0a444: 38 a5 6f 56 addi r5,r5,28502 ffc0a448: 7f 06 c3 78 mr r6,r24 ffc0a44c: 48 00 04 14 b ffc0a860 <_Heap_Walk+0x514> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; ffc0a450: 39 3c 00 08 addi r9,r28,8 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; ffc0a454: 7d 49 d3 96 divwu r10,r9,r26 ffc0a458: 7d 4a d1 d6 mullw r10,r10,r26 ); return false; } if ( ffc0a45c: 7f 89 50 00 cmpw cr7,r9,r10 ffc0a460: 41 be 00 18 beq+ cr7,ffc0a478 <_Heap_Walk+0x12c> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( ffc0a464: 3c a0 ff c1 lis r5,-63 ffc0a468: 7f c3 f3 78 mr r3,r30 ffc0a46c: 38 80 00 01 li r4,1 ffc0a470: 38 a5 6f 7a addi r5,r5,28538 ffc0a474: 48 00 03 e8 b ffc0a85c <_Heap_Walk+0x510> 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; ffc0a478: 81 3c 00 04 lwz r9,4(r28) ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { ffc0a47c: 71 27 00 01 andi. r7,r9,1 ffc0a480: 40 a2 00 18 bne+ ffc0a498 <_Heap_Walk+0x14c> (*printer)( ffc0a484: 3c a0 ff c1 lis r5,-63 ffc0a488: 7f c3 f3 78 mr r3,r30 ffc0a48c: 38 80 00 01 li r4,1 ffc0a490: 38 a5 6f ab addi r5,r5,28587 ffc0a494: 48 00 00 48 b ffc0a4dc <_Heap_Walk+0x190> - 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; ffc0a498: 82 d7 00 04 lwz r22,4(r23) ffc0a49c: 56 d6 00 3c rlwinm r22,r22,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); ffc0a4a0: 7e d7 b2 14 add r22,r23,r22 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; ffc0a4a4: 81 36 00 04 lwz r9,4(r22) ); return false; } if ( _Heap_Is_free( last_block ) ) { ffc0a4a8: 71 27 00 01 andi. r7,r9,1 ffc0a4ac: 40 a2 00 18 bne+ ffc0a4c4 <_Heap_Walk+0x178> (*printer)( ffc0a4b0: 3c a0 ff c1 lis r5,-63 ffc0a4b4: 7f c3 f3 78 mr r3,r30 ffc0a4b8: 38 80 00 01 li r4,1 ffc0a4bc: 38 a5 6f d9 addi r5,r5,28633 ffc0a4c0: 48 00 00 1c b ffc0a4dc <_Heap_Walk+0x190> ); return false; } if ( ffc0a4c4: 7f 96 e0 00 cmpw cr7,r22,r28 ffc0a4c8: 41 9e 00 24 beq- cr7,ffc0a4ec <_Heap_Walk+0x1a0> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( ffc0a4cc: 3c a0 ff c1 lis r5,-63 ffc0a4d0: 7f c3 f3 78 mr r3,r30 ffc0a4d4: 38 80 00 01 li r4,1 ffc0a4d8: 38 a5 6f ee addi r5,r5,28654 ffc0a4dc: 7f e9 03 a6 mtctr r31 ffc0a4e0: 4c c6 31 82 crclr 4*cr1+eq ffc0a4e4: 4e 80 04 21 bctrl ffc0a4e8: 48 00 03 5c b ffc0a844 <_Heap_Walk+0x4f8> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; ffc0a4ec: 81 3d 00 10 lwz r9,16(r29) const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); ffc0a4f0: 7f aa eb 78 mr r10,r29 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; ffc0a4f4: 80 dd 00 08 lwz r6,8(r29) ffc0a4f8: 48 00 00 bc b ffc0a5b4 <_Heap_Walk+0x268> 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; ffc0a4fc: 80 fd 00 20 lwz r7,32(r29) ffc0a500: 39 00 00 00 li r8,0 ffc0a504: 7f 87 30 40 cmplw cr7,r7,r6 ffc0a508: 41 9d 00 14 bgt- cr7,ffc0a51c <_Heap_Walk+0x1d0> ffc0a50c: 81 1d 00 24 lwz r8,36(r29) ffc0a510: 7d 06 40 10 subfc r8,r6,r8 ffc0a514: 39 00 00 00 li r8,0 ffc0a518: 7d 08 41 14 adde r8,r8,r8 const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { ffc0a51c: 2f 88 00 00 cmpwi cr7,r8,0 ffc0a520: 40 be 00 18 bne+ cr7,ffc0a538 <_Heap_Walk+0x1ec> (*printer)( ffc0a524: 3c a0 ff c1 lis r5,-63 ffc0a528: 7f c3 f3 78 mr r3,r30 ffc0a52c: 38 80 00 01 li r4,1 ffc0a530: 38 a5 70 1d addi r5,r5,28701 ffc0a534: 48 00 03 2c b ffc0a860 <_Heap_Walk+0x514> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; ffc0a538: 39 06 00 08 addi r8,r6,8 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; ffc0a53c: 7c e8 4b 96 divwu r7,r8,r9 ffc0a540: 7c e7 49 d6 mullw r7,r7,r9 ); return false; } if ( ffc0a544: 7f 88 38 00 cmpw cr7,r8,r7 ffc0a548: 41 be 00 18 beq+ cr7,ffc0a560 <_Heap_Walk+0x214> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( ffc0a54c: 3c a0 ff c1 lis r5,-63 ffc0a550: 7f c3 f3 78 mr r3,r30 ffc0a554: 38 80 00 01 li r4,1 ffc0a558: 38 a5 70 3d addi r5,r5,28733 ffc0a55c: 48 00 03 04 b ffc0a860 <_Heap_Walk+0x514> - 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; ffc0a560: 81 06 00 04 lwz r8,4(r6) ffc0a564: 55 08 00 3c rlwinm r8,r8,0,0,30 block = next_block; } while ( block != first_block ); return true; } ffc0a568: 7d 06 42 14 add r8,r6,r8 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; ffc0a56c: 81 08 00 04 lwz r8,4(r8) ); return false; } if ( _Heap_Is_used( free_block ) ) { ffc0a570: 71 07 00 01 andi. r7,r8,1 ffc0a574: 41 a2 00 18 beq+ ffc0a58c <_Heap_Walk+0x240> (*printer)( ffc0a578: 3c a0 ff c1 lis r5,-63 ffc0a57c: 7f c3 f3 78 mr r3,r30 ffc0a580: 38 80 00 01 li r4,1 ffc0a584: 38 a5 70 6d addi r5,r5,28781 ffc0a588: 48 00 02 d8 b ffc0a860 <_Heap_Walk+0x514> ); return false; } if ( free_block->prev != prev_block ) { ffc0a58c: 80 e6 00 0c lwz r7,12(r6) ffc0a590: 7f 87 50 00 cmpw cr7,r7,r10 ffc0a594: 41 be 00 18 beq+ cr7,ffc0a5ac <_Heap_Walk+0x260> (*printer)( ffc0a598: 3c a0 ff c1 lis r5,-63 ffc0a59c: 7f c3 f3 78 mr r3,r30 ffc0a5a0: 38 80 00 01 li r4,1 ffc0a5a4: 38 a5 70 89 addi r5,r5,28809 ffc0a5a8: 48 00 01 38 b ffc0a6e0 <_Heap_Walk+0x394> return false; } prev_block = free_block; free_block = free_block->next; ffc0a5ac: 7c ca 33 78 mr r10,r6 ffc0a5b0: 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 ) { ffc0a5b4: 7f 86 e8 00 cmpw cr7,r6,r29 ffc0a5b8: 40 9e ff 44 bne+ cr7,ffc0a4fc <_Heap_Walk+0x1b0> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( ffc0a5bc: 3e 80 ff c1 lis r20,-63 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( ffc0a5c0: 3e 60 ff c1 lis r19,-63 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)( ffc0a5c4: 3e 40 ff c1 lis r18,-63 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 ) { ffc0a5c8: 7e dc b3 78 mr r28,r22 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( ffc0a5cc: 3a 94 72 29 addi r20,r20,29225 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( ffc0a5d0: 3a 73 72 12 addi r19,r19,29202 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)( ffc0a5d4: 3a 52 71 75 addi r18,r18,29045 ffc0a5d8: 3e 20 ff c1 lis r17,-63 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ffc0a5dc: 3e a0 ff c1 lis r21,-63 ffc0a5e0: 3e 00 ff c1 lis r16,-63 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)( ffc0a5e4: 3d e0 ff c1 lis r15,-63 block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), ffc0a5e8: 3d c0 ff c1 lis r14,-63 block = next_block; } while ( block != first_block ); return true; } ffc0a5ec: 81 7c 00 04 lwz r11,4(r28) 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; ffc0a5f0: 7f 89 ba 78 xor r9,r28,r23 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; ffc0a5f4: 81 1d 00 20 lwz r8,32(r29) ffc0a5f8: 7d 29 00 34 cntlzw r9,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; ffc0a5fc: 55 7b 00 3c rlwinm r27,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); ffc0a600: 7f 3b e2 14 add r25,r27,r28 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; ffc0a604: 7f 88 c8 40 cmplw cr7,r8,r25 ffc0a608: 55 29 d9 7e rlwinm r9,r9,27,5,31 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; ffc0a60c: 55 6b 07 fe clrlwi r11,r11,31 ffc0a610: 69 29 00 01 xori r9,r9,1 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; ffc0a614: 39 40 00 00 li r10,0 ffc0a618: 41 9d 00 14 bgt- cr7,ffc0a62c <_Heap_Walk+0x2e0> <== NEVER TAKEN ffc0a61c: 81 5d 00 24 lwz r10,36(r29) ffc0a620: 7d 59 50 10 subfc r10,r25,r10 ffc0a624: 39 40 00 00 li r10,0 ffc0a628: 7d 4a 51 14 adde r10,r10,r10 if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { ffc0a62c: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0a630: 40 be 00 18 bne+ cr7,ffc0a648 <_Heap_Walk+0x2fc> (*printer)( ffc0a634: 3c a0 ff c1 lis r5,-63 ffc0a638: 7f c3 f3 78 mr r3,r30 ffc0a63c: 38 80 00 01 li r4,1 ffc0a640: 38 a5 70 bb addi r5,r5,28859 ffc0a644: 48 00 00 94 b ffc0a6d8 <_Heap_Walk+0x38c> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; ffc0a648: 7d 5b d3 96 divwu r10,r27,r26 ffc0a64c: 7d 4a d1 d6 mullw r10,r10,r26 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { ffc0a650: 7f 9b 50 00 cmpw cr7,r27,r10 ffc0a654: 41 9e 00 28 beq- cr7,ffc0a67c <_Heap_Walk+0x330> ffc0a658: 2f 89 00 00 cmpwi cr7,r9,0 ffc0a65c: 41 be 00 94 beq+ cr7,ffc0a6f0 <_Heap_Walk+0x3a4> (*printer)( ffc0a660: 3c a0 ff c1 lis r5,-63 ffc0a664: 7f c3 f3 78 mr r3,r30 ffc0a668: 38 80 00 01 li r4,1 ffc0a66c: 38 a5 70 e8 addi r5,r5,28904 ffc0a670: 7f 86 e3 78 mr r6,r28 ffc0a674: 7f 67 db 78 mr r7,r27 ffc0a678: 48 00 00 68 b ffc0a6e0 <_Heap_Walk+0x394> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { ffc0a67c: 7f 9b c0 40 cmplw cr7,r27,r24 ffc0a680: 40 9c 00 38 bge- cr7,ffc0a6b8 <_Heap_Walk+0x36c> ffc0a684: 2f 89 00 00 cmpwi cr7,r9,0 ffc0a688: 41 be 00 68 beq+ cr7,ffc0a6f0 <_Heap_Walk+0x3a4> <== NEVER TAKEN (*printer)( ffc0a68c: 3c a0 ff c1 lis r5,-63 ffc0a690: 7f e9 03 a6 mtctr r31 ffc0a694: 7f c3 f3 78 mr r3,r30 ffc0a698: 38 80 00 01 li r4,1 ffc0a69c: 38 a5 71 16 addi r5,r5,28950 ffc0a6a0: 7f 86 e3 78 mr r6,r28 ffc0a6a4: 7f 67 db 78 mr r7,r27 ffc0a6a8: 7f 08 c3 78 mr r8,r24 ffc0a6ac: 4c c6 31 82 crclr 4*cr1+eq ffc0a6b0: 4e 80 04 21 bctrl ffc0a6b4: 48 00 01 90 b ffc0a844 <_Heap_Walk+0x4f8> ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { ffc0a6b8: 7f 99 e0 40 cmplw cr7,r25,r28 ffc0a6bc: 41 9d 00 34 bgt- cr7,ffc0a6f0 <_Heap_Walk+0x3a4> ffc0a6c0: 2f 89 00 00 cmpwi cr7,r9,0 ffc0a6c4: 41 be 00 2c beq+ cr7,ffc0a6f0 <_Heap_Walk+0x3a4> (*printer)( ffc0a6c8: 3c a0 ff c1 lis r5,-63 ffc0a6cc: 7f c3 f3 78 mr r3,r30 ffc0a6d0: 38 80 00 01 li r4,1 ffc0a6d4: 38 a5 71 41 addi r5,r5,28993 ffc0a6d8: 7f 86 e3 78 mr r6,r28 ffc0a6dc: 7f 27 cb 78 mr r7,r25 ffc0a6e0: 7f e9 03 a6 mtctr r31 ffc0a6e4: 4c c6 31 82 crclr 4*cr1+eq ffc0a6e8: 4e 80 04 21 bctrl ffc0a6ec: 48 00 01 58 b ffc0a844 <_Heap_Walk+0x4f8> 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; ffc0a6f0: 81 39 00 04 lwz r9,4(r25) ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { ffc0a6f4: 71 27 00 01 andi. r7,r9,1 ffc0a6f8: 40 a2 00 f4 bne+ ffc0a7ec <_Heap_Walk+0x4a0> 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 ? ffc0a6fc: 81 1c 00 0c lwz r8,12(r28) 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)( ffc0a700: 81 3d 00 08 lwz r9,8(r29) 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; ffc0a704: 80 fd 00 0c lwz r7,12(r29) ffc0a708: 7f 88 48 00 cmpw cr7,r8,r9 ffc0a70c: 41 9e 00 18 beq- cr7,ffc0a724 <_Heap_Walk+0x3d8> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), ffc0a710: 7f 88 e8 00 cmpw cr7,r8,r29 ffc0a714: 39 35 6d 3d addi r9,r21,27965 ffc0a718: 40 be 00 10 bne+ cr7,ffc0a728 <_Heap_Walk+0x3dc> ffc0a71c: 39 2e 6e 71 addi r9,r14,28273 ffc0a720: 48 00 00 08 b ffc0a728 <_Heap_Walk+0x3dc> 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)( ffc0a724: 39 2f 6e 61 addi r9,r15,28257 block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? ffc0a728: 81 5c 00 08 lwz r10,8(r28) 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)( ffc0a72c: 7f 8a 38 00 cmpw cr7,r10,r7 ffc0a730: 41 9e 00 18 beq- cr7,ffc0a748 <_Heap_Walk+0x3fc> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ffc0a734: 7f 8a e8 00 cmpw cr7,r10,r29 ffc0a738: 38 f5 6d 3d addi r7,r21,27965 ffc0a73c: 40 be 00 10 bne+ cr7,ffc0a74c <_Heap_Walk+0x400> ffc0a740: 38 f0 6e 8a addi r7,r16,28298 ffc0a744: 48 00 00 08 b ffc0a74c <_Heap_Walk+0x400> 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)( ffc0a748: 38 f1 6e 7b addi r7,r17,28283 ffc0a74c: 90 e1 00 08 stw r7,8(r1) ffc0a750: 7f c3 f3 78 mr r3,r30 ffc0a754: 38 80 00 00 li r4,0 ffc0a758: 7f e9 03 a6 mtctr r31 ffc0a75c: 91 61 00 18 stw r11,24(r1) ffc0a760: 7e 45 93 78 mr r5,r18 ffc0a764: 7f 86 e3 78 mr r6,r28 ffc0a768: 7f 67 db 78 mr r7,r27 ffc0a76c: 4c c6 31 82 crclr 4*cr1+eq ffc0a770: 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 ) { ffc0a774: 81 19 00 00 lwz r8,0(r25) ffc0a778: 81 61 00 18 lwz r11,24(r1) ffc0a77c: 7f 9b 40 00 cmpw cr7,r27,r8 ffc0a780: 41 be 00 30 beq+ cr7,ffc0a7b0 <_Heap_Walk+0x464> (*printer)( ffc0a784: 3c a0 ff c1 lis r5,-63 ffc0a788: 7f e9 03 a6 mtctr r31 ffc0a78c: 7f c3 f3 78 mr r3,r30 ffc0a790: 38 80 00 01 li r4,1 ffc0a794: 38 a5 71 aa addi r5,r5,29098 ffc0a798: 7f 86 e3 78 mr r6,r28 ffc0a79c: 7f 67 db 78 mr r7,r27 ffc0a7a0: 7f 29 cb 78 mr r9,r25 ffc0a7a4: 4c c6 31 82 crclr 4*cr1+eq ffc0a7a8: 4e 80 04 21 bctrl ffc0a7ac: 48 00 00 98 b ffc0a844 <_Heap_Walk+0x4f8> ); return false; } if ( !prev_used ) { ffc0a7b0: 2f 8b 00 00 cmpwi cr7,r11,0 ffc0a7b4: 40 be 00 18 bne+ cr7,ffc0a7cc <_Heap_Walk+0x480> (*printer)( ffc0a7b8: 3c a0 ff c1 lis r5,-63 ffc0a7bc: 7f c3 f3 78 mr r3,r30 ffc0a7c0: 38 80 00 01 li r4,1 ffc0a7c4: 38 a5 71 e3 addi r5,r5,29155 ffc0a7c8: 48 00 00 94 b ffc0a85c <_Heap_Walk+0x510> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; ffc0a7cc: 81 3d 00 08 lwz r9,8(r29) ffc0a7d0: 48 00 00 10 b ffc0a7e0 <_Heap_Walk+0x494> { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { if ( free_block == block ) { ffc0a7d4: 7f 89 e0 00 cmpw cr7,r9,r28 ffc0a7d8: 41 9e 00 5c beq- cr7,ffc0a834 <_Heap_Walk+0x4e8> return true; } free_block = free_block->next; ffc0a7dc: 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 ) { ffc0a7e0: 7f 89 e8 00 cmpw cr7,r9,r29 ffc0a7e4: 40 9e ff f0 bne+ cr7,ffc0a7d4 <_Heap_Walk+0x488> ffc0a7e8: 48 00 00 64 b ffc0a84c <_Heap_Walk+0x500> if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { ffc0a7ec: 2f 8b 00 00 cmpwi cr7,r11,0 (*printer)( ffc0a7f0: 7f c3 f3 78 mr r3,r30 ffc0a7f4: 38 80 00 00 li r4,0 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { ffc0a7f8: 41 9e 00 20 beq- cr7,ffc0a818 <_Heap_Walk+0x4cc> (*printer)( ffc0a7fc: 7e 65 9b 78 mr r5,r19 ffc0a800: 7f e9 03 a6 mtctr r31 ffc0a804: 7f 86 e3 78 mr r6,r28 ffc0a808: 7f 67 db 78 mr r7,r27 ffc0a80c: 4c c6 31 82 crclr 4*cr1+eq ffc0a810: 4e 80 04 21 bctrl ffc0a814: 48 00 00 20 b ffc0a834 <_Heap_Walk+0x4e8> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( ffc0a818: 7e 85 a3 78 mr r5,r20 ffc0a81c: 81 1c 00 00 lwz r8,0(r28) ffc0a820: 7f 86 e3 78 mr r6,r28 ffc0a824: 7f e9 03 a6 mtctr r31 ffc0a828: 7f 67 db 78 mr r7,r27 ffc0a82c: 4c c6 31 82 crclr 4*cr1+eq ffc0a830: 4e 80 04 21 bctrl block->prev_size ); } block = next_block; } while ( block != first_block ); ffc0a834: 7f 99 b0 00 cmpw cr7,r25,r22 ffc0a838: 7f 3c cb 78 mr r28,r25 ffc0a83c: 40 9e fd b0 bne+ cr7,ffc0a5ec <_Heap_Walk+0x2a0> ffc0a840: 4b ff fb 60 b ffc0a3a0 <_Heap_Walk+0x54> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; ffc0a844: 38 60 00 00 li r3,0 ffc0a848: 48 00 00 28 b ffc0a870 <_Heap_Walk+0x524> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( ffc0a84c: 3c a0 ff c1 lis r5,-63 ffc0a850: 7f c3 f3 78 mr r3,r30 ffc0a854: 38 80 00 01 li r4,1 ffc0a858: 38 a5 72 4e addi r5,r5,29262 ffc0a85c: 7f 86 e3 78 mr r6,r28 ffc0a860: 7f e9 03 a6 mtctr r31 ffc0a864: 4c c6 31 82 crclr 4*cr1+eq ffc0a868: 4e 80 04 21 bctrl ffc0a86c: 4b ff ff d8 b ffc0a844 <_Heap_Walk+0x4f8> block = next_block; } while ( block != first_block ); return true; } ffc0a870: 39 61 00 68 addi r11,r1,104 ffc0a874: 4b ff 62 f4 b ffc00b68 <_restgpr_14_x> =============================================================================== ffc0a29c <_Heap_Walk_print>: /* Do nothing */ } static void _Heap_Walk_print( int source, bool error, const char *fmt, ... ) { ffc0a29c: 7c 2b 0b 78 mr r11,r1 ffc0a2a0: 7c 08 02 a6 mflr r0 ffc0a2a4: 94 21 ff 88 stwu r1,-120(r1) ffc0a2a8: 4b ff 68 b9 bl ffc00b60 <_savegpr_31> ffc0a2ac: 90 01 00 7c stw r0,124(r1) ffc0a2b0: 7c 6b 1b 78 mr r11,r3 ffc0a2b4: 90 c1 00 1c stw r6,28(r1) ffc0a2b8: 90 e1 00 20 stw r7,32(r1) ffc0a2bc: 91 01 00 24 stw r8,36(r1) ffc0a2c0: 91 21 00 28 stw r9,40(r1) ffc0a2c4: 91 41 00 2c stw r10,44(r1) ffc0a2c8: 40 86 00 24 bne- cr1,ffc0a2ec <_Heap_Walk_print+0x50> <== ALWAYS TAKEN ffc0a2cc: d8 21 00 30 stfd f1,48(r1) <== NOT EXECUTED ffc0a2d0: d8 41 00 38 stfd f2,56(r1) <== NOT EXECUTED ffc0a2d4: d8 61 00 40 stfd f3,64(r1) <== NOT EXECUTED ffc0a2d8: d8 81 00 48 stfd f4,72(r1) <== NOT EXECUTED ffc0a2dc: d8 a1 00 50 stfd f5,80(r1) <== NOT EXECUTED ffc0a2e0: d8 c1 00 58 stfd f6,88(r1) <== NOT EXECUTED ffc0a2e4: d8 e1 00 60 stfd f7,96(r1) <== NOT EXECUTED ffc0a2e8: d9 01 00 68 stfd f8,104(r1) <== NOT EXECUTED va_list ap; if ( error ) { ffc0a2ec: 2f 84 00 00 cmpwi cr7,r4,0 { /* Do nothing */ } static void _Heap_Walk_print( int source, bool error, const char *fmt, ... ) { ffc0a2f0: 7c bf 2b 78 mr r31,r5 va_list ap; if ( error ) { ffc0a2f4: 41 be 00 10 beq+ cr7,ffc0a304 <_Heap_Walk_print+0x68> printk( "FAIL[%d]: ", source ); ffc0a2f8: 3c 60 ff c1 lis r3,-63 ffc0a2fc: 38 63 6e 4b addi r3,r3,28235 ffc0a300: 48 00 00 0c b ffc0a30c <_Heap_Walk_print+0x70> } else { printk( "PASS[%d]: ", source ); ffc0a304: 3c 60 ff c1 lis r3,-63 ffc0a308: 38 63 6e 56 addi r3,r3,28246 ffc0a30c: 7d 64 5b 78 mr r4,r11 ffc0a310: 4c c6 31 82 crclr 4*cr1+eq ffc0a314: 4b ff b3 59 bl ffc0566c } va_start( ap, fmt ); ffc0a318: 39 20 00 03 li r9,3 ffc0a31c: 99 21 00 08 stb r9,8(r1) ffc0a320: 39 20 00 00 li r9,0 vprintk( fmt, ap ); ffc0a324: 7f e3 fb 78 mr r3,r31 printk( "FAIL[%d]: ", source ); } else { printk( "PASS[%d]: ", source ); } va_start( ap, fmt ); ffc0a328: 99 21 00 09 stb r9,9(r1) ffc0a32c: 39 21 00 80 addi r9,r1,128 vprintk( fmt, ap ); ffc0a330: 38 81 00 08 addi r4,r1,8 printk( "FAIL[%d]: ", source ); } else { printk( "PASS[%d]: ", source ); } va_start( ap, fmt ); ffc0a334: 91 21 00 0c stw r9,12(r1) ffc0a338: 39 21 00 10 addi r9,r1,16 ffc0a33c: 91 21 00 10 stw r9,16(r1) vprintk( fmt, ap ); ffc0a340: 4b ff dd 75 bl ffc080b4 va_end( ap ); } ffc0a344: 39 61 00 78 addi r11,r1,120 ffc0a348: 4b ff 68 64 b ffc00bac <_restgpr_31_x> =============================================================================== ffc09d78 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { ffc09d78: 94 21 ff d8 stwu r1,-40(r1) ffc09d7c: 7c 08 02 a6 mflr r0 ffc09d80: bf a1 00 1c stmw r29,28(r1) ffc09d84: 7c 9e 23 78 mr r30,r4 ffc09d88: 7c 7d 1b 78 mr r29,r3 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; ffc09d8c: 98 81 00 0c stb r4,12(r1) _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); ffc09d90: 3c 80 ff c1 lis r4,-63 ffc09d94: 38 84 bd 74 addi r4,r4,-17036 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; ffc09d98: 90 61 00 08 stw r3,8(r1) _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); ffc09d9c: 38 61 00 08 addi r3,r1,8 ffc09da0: 7c bf 2b 78 mr r31,r5 ffc09da4: 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 }; ffc09da8: 90 a1 00 10 stw r5,16(r1) _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); ffc09dac: 48 00 1f ed bl ffc0bd98 <_User_extensions_Iterate> _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; ffc09db0: 3d 40 00 00 lis r10,0 ffc09db4: 39 2a 2d ec addi r9,r10,11756 ffc09db8: 93 aa 2d ec stw r29,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 ); ffc09dbc: 7f e3 fb 78 mr r3,r31 ) { _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; ffc09dc0: 9b c9 00 04 stb r30,4(r9) RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; ffc09dc4: 39 40 00 05 li r10,5 _Internal_errors_What_happened.the_error = the_error; ffc09dc8: 93 e9 00 08 stw r31,8(r9) ffc09dcc: 3d 20 00 00 lis r9,0 ffc09dd0: 91 49 28 4c stw r10,10316(r9) _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); ffc09dd4: 4b ff 99 8d bl ffc03760 <_BSP_Fatal_error> ffc09dd8: 48 00 00 00 b ffc09dd8 <_Internal_error_Occurred+0x60><== NOT EXECUTED =============================================================================== ffc09df0 <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { ffc09df0: 94 21 ff f0 stwu r1,-16(r1) ffc09df4: 7c 08 02 a6 mflr r0 ffc09df8: 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 ) ffc09dfc: 81 23 00 18 lwz r9,24(r3) #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { ffc09e00: bf c1 00 08 stmw r30,8(r1) ffc09e04: 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 ) ffc09e08: 2f 89 00 00 cmpwi cr7,r9,0 ffc09e0c: 40 be 00 0c bne+ cr7,ffc09e18 <_Objects_Allocate+0x28> <== ALWAYS TAKEN return NULL; ffc09e10: 38 60 00 00 li r3,0 ffc09e14: 48 00 00 70 b ffc09e84 <_Objects_Allocate+0x94> /* * 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 ); ffc09e18: 3b c3 00 20 addi r30,r3,32 ffc09e1c: 7f c3 f3 78 mr r3,r30 ffc09e20: 4b ff f5 b9 bl ffc093d8 <_Chain_Get> if ( information->auto_extend ) { ffc09e24: 89 3f 00 12 lbz r9,18(r31) ffc09e28: 2f 89 00 00 cmpwi cr7,r9,0 ffc09e2c: 41 9e 00 58 beq- cr7,ffc09e84 <_Objects_Allocate+0x94> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { ffc09e30: 2f 83 00 00 cmpwi cr7,r3,0 ffc09e34: 40 be 00 1c bne+ cr7,ffc09e50 <_Objects_Allocate+0x60> _Objects_Extend_information( information ); ffc09e38: 7f e3 fb 78 mr r3,r31 ffc09e3c: 48 00 00 69 bl ffc09ea4 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); ffc09e40: 7f c3 f3 78 mr r3,r30 ffc09e44: 4b ff f5 95 bl ffc093d8 <_Chain_Get> } if ( the_object ) { ffc09e48: 2c 03 00 00 cmpwi r3,0 ffc09e4c: 41 82 ff c4 beq+ ffc09e10 <_Objects_Allocate+0x20> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - ffc09e50: a1 43 00 0a lhz r10,10(r3) ffc09e54: a1 3f 00 0a lhz r9,10(r31) ffc09e58: 7d 29 50 50 subf r9,r9,r10 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; ffc09e5c: a1 5f 00 14 lhz r10,20(r31) ffc09e60: 7d 29 53 96 divwu r9,r9,r10 information->inactive_per_block[ block ]--; ffc09e64: 81 5f 00 30 lwz r10,48(r31) ffc09e68: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc09e6c: 7d 0a 48 2e lwzx r8,r10,r9 ffc09e70: 39 08 ff ff addi r8,r8,-1 ffc09e74: 7d 0a 49 2e stwx r8,r10,r9 information->inactive--; ffc09e78: a1 3f 00 2c lhz r9,44(r31) ffc09e7c: 39 29 ff ff addi r9,r9,-1 ffc09e80: b1 3f 00 2c sth r9,44(r31) ); } #endif return the_object; } ffc09e84: 39 61 00 10 addi r11,r1,16 ffc09e88: 4b ff 67 38 b ffc005c0 <_restgpr_30_x> =============================================================================== ffc09ea4 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { ffc09ea4: 94 21 ff b8 stwu r1,-72(r1) ffc09ea8: 7c 08 02 a6 mflr r0 ffc09eac: 90 01 00 4c stw r0,76(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 ) ffc09eb0: 81 43 00 34 lwz r10,52(r3) */ void _Objects_Extend_information( Objects_Information *information ) { ffc09eb4: be a1 00 1c stmw r21,28(r1) ffc09eb8: 7c 7f 1b 78 mr r31,r3 minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) ffc09ebc: 2f 8a 00 00 cmpwi cr7,r10,0 /* * 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 ); ffc09ec0: a3 83 00 0a lhz r28,10(r3) index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) ffc09ec4: 41 9e 00 54 beq- cr7,ffc09f18 <_Objects_Extend_information+0x74> block_count = 0; else { block_count = information->maximum / information->allocation_size; ffc09ec8: a1 03 00 14 lhz r8,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 ); ffc09ecc: 7f 9e e3 78 mr r30,r28 /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; ffc09ed0: a3 a3 00 10 lhz r29,16(r3) * 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; ffc09ed4: 3b 60 00 00 li r27,0 /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; ffc09ed8: 7f bd 43 96 divwu r29,r29,r8 ffc09edc: 2f 9d 00 00 cmpwi cr7,r29,0 * 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; ffc09ee0: 39 3d 00 01 addi r9,r29,1 ffc09ee4: 40 be 00 24 bne+ cr7,ffc09f08 <_Objects_Extend_information+0x64><== ALWAYS TAKEN ffc09ee8: 39 20 00 01 li r9,1 <== NOT EXECUTED ffc09eec: 48 00 00 1c b ffc09f08 <_Objects_Extend_information+0x64><== NOT EXECUTED * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( ffc09ef0: 57 67 10 3a rlwinm r7,r27,2,0,29 block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { ffc09ef4: 7c ea 38 2e lwzx r7,r10,r7 ffc09ef8: 2f 87 00 00 cmpwi cr7,r7,0 ffc09efc: 41 9e 00 30 beq- cr7,ffc09f2c <_Objects_Extend_information+0x88> * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( ffc09f00: 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++ ) { ffc09f04: 3b 7b 00 01 addi r27,r27,1 ffc09f08: 35 29 ff ff addic. r9,r9,-1 ffc09f0c: 40 82 ff e4 bne+ ffc09ef0 <_Objects_Extend_information+0x4c> /* * 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; ffc09f10: 3b 40 00 01 li r26,1 ffc09f14: 48 00 00 1c b ffc09f30 <_Objects_Extend_information+0x8c> minimum_index = _Objects_Get_index( information->minimum_id ); ffc09f18: 7f 9e e3 78 mr r30,r28 /* * 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; ffc09f1c: 3b 40 00 01 li r26,1 minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; ffc09f20: 3b 60 00 00 li r27,0 /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; ffc09f24: 3b a0 00 00 li r29,0 ffc09f28: 48 00 00 08 b ffc09f30 <_Objects_Extend_information+0x8c> else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { do_extend = false; ffc09f2c: 3b 40 00 00 li r26,0 } else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; ffc09f30: a1 3f 00 14 lhz r9,20(r31) ffc09f34: a3 3f 00 10 lhz r25,16(r31) ffc09f38: 7f 29 ca 14 add r25,r9,r25 /* * 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 ) { ffc09f3c: 2b 99 ff ff cmplwi cr7,r25,65535 ffc09f40: 41 9d 02 10 bgt- cr7,ffc0a150 <_Objects_Extend_information+0x2ac> /* * 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; ffc09f44: 80 7f 00 18 lwz r3,24(r31) ffc09f48: 7c 69 19 d6 mullw r3,r9,r3 if ( information->auto_extend ) { ffc09f4c: 89 3f 00 12 lbz r9,18(r31) ffc09f50: 2f 89 00 00 cmpwi cr7,r9,0 ffc09f54: 41 9e 00 14 beq- cr7,ffc09f68 <_Objects_Extend_information+0xc4> new_object_block = _Workspace_Allocate( block_size ); ffc09f58: 48 00 23 49 bl ffc0c2a0 <_Workspace_Allocate> if ( !new_object_block ) ffc09f5c: 7c 76 1b 79 mr. r22,r3 ffc09f60: 40 a2 00 10 bne+ ffc09f70 <_Objects_Extend_information+0xcc> ffc09f64: 48 00 01 ec b ffc0a150 <_Objects_Extend_information+0x2ac> return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); ffc09f68: 48 00 23 61 bl ffc0c2c8 <_Workspace_Allocate_or_fatal_error> ffc09f6c: 7c 76 1b 78 mr r22,r3 } /* * Do we need to grow the tables? */ if ( do_extend ) { ffc09f70: 2f 9a 00 00 cmpwi cr7,r26,0 ffc09f74: 41 9e 01 58 beq- cr7,ffc0a0cc <_Objects_Extend_information+0x228> */ /* * Up the block count and maximum */ block_count++; ffc09f78: 3b 1d 00 01 addi r24,r29,1 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ffc09f7c: 1d 38 00 03 mulli r9,r24,3 ((maximum + minimum_index) * sizeof(Objects_Control *)); ffc09f80: 7c 79 e2 14 add r3,r25,r28 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ffc09f84: 7c 63 4a 14 add r3,r3,r9 ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { ffc09f88: 89 3f 00 12 lbz r9,18(r31) block_count++; /* * Allocate the tables and break it up. */ block_size = block_count * ffc09f8c: 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 ) { ffc09f90: 2f 89 00 00 cmpwi cr7,r9,0 ffc09f94: 41 9e 00 1c beq- cr7,ffc09fb0 <_Objects_Extend_information+0x10c> object_blocks = _Workspace_Allocate( block_size ); ffc09f98: 48 00 23 09 bl ffc0c2a0 <_Workspace_Allocate> if ( !object_blocks ) { ffc09f9c: 7c 7a 1b 79 mr. r26,r3 ffc09fa0: 40 a2 00 18 bne+ ffc09fb8 <_Objects_Extend_information+0x114> _Workspace_Free( new_object_block ); ffc09fa4: 7e c3 b3 78 mr r3,r22 ffc09fa8: 48 00 23 11 bl ffc0c2b8 <_Workspace_Free> ffc09fac: 48 00 01 a4 b ffc0a150 <_Objects_Extend_information+0x2ac> return; } } else { object_blocks = _Workspace_Allocate_or_fatal_error( block_size ); ffc09fb0: 48 00 23 19 bl ffc0c2c8 <_Workspace_Allocate_or_fatal_error> ffc09fb4: 7c 7a 1b 78 mr r26,r3 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { ffc09fb8: a1 1f 00 10 lhz r8,16(r31) /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( object_blocks, block_count * sizeof(void*) ); ffc09fbc: 57 18 10 3a rlwinm r24,r24,2,0,29 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); ffc09fc0: 7e fa c2 14 add r23,r26,r24 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { ffc09fc4: 7f 88 e0 40 cmplw cr7,r8,r28 /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; ffc09fc8: 38 fc 00 01 addi r7,r28,1 ffc09fcc: 7f 17 c2 14 add r24,r23,r24 ffc09fd0: 7c e9 03 a6 mtctr r7 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { ffc09fd4: 39 20 00 00 li r9,0 /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; ffc09fd8: 39 40 00 00 li r10,0 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { ffc09fdc: 40 bd 00 50 ble+ cr7,ffc0a02c <_Objects_Extend_information+0x188> * separate parts as size of each block has changed. */ memcpy( object_blocks, information->object_blocks, block_count * sizeof(void*) ); ffc09fe0: 57 b5 10 3a rlwinm r21,r29,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, ffc09fe4: 80 9f 00 34 lwz r4,52(r31) ffc09fe8: 7e a5 ab 78 mr r5,r21 ffc09fec: 7f 43 d3 78 mr r3,r26 ffc09ff0: 48 00 65 4d bl ffc1053c information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, ffc09ff4: 80 9f 00 30 lwz r4,48(r31) ffc09ff8: 7e a5 ab 78 mr r5,r21 ffc09ffc: 7e e3 bb 78 mr r3,r23 ffc0a000: 48 00 65 3d bl ffc1053c information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); ffc0a004: a1 3f 00 10 lhz r9,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, ffc0a008: 80 9f 00 1c lwz r4,28(r31) ffc0a00c: 7f 03 c3 78 mr r3,r24 information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); ffc0a010: 7c a9 e2 14 add r5,r9,r28 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, ffc0a014: 54 a5 10 3a rlwinm r5,r5,2,0,29 ffc0a018: 48 00 65 25 bl ffc1053c ffc0a01c: 48 00 00 14 b ffc0a030 <_Objects_Extend_information+0x18c> * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( ffc0a020: 55 28 10 3a rlwinm r8,r9,2,0,29 /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; ffc0a024: 7d 48 c1 2e stwx r10,r8,r24 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { ffc0a028: 39 29 00 01 addi r9,r9,1 ffc0a02c: 42 00 ff f4 bdnz+ ffc0a020 <_Objects_Extend_information+0x17c> } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; ffc0a030: 39 20 00 00 li r9,0 ffc0a034: 57 bd 10 3a rlwinm r29,r29,2,0,29 ffc0a038: 7d 3a e9 2e stwx r9,r26,r29 inactive_per_block[block_count] = 0; for ( index=index_base ; ffc0a03c: 7f ca f3 78 mr r10,r30 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; ffc0a040: 38 e0 00 00 li r7,0 /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; ffc0a044: 7d 37 e9 2e stwx r9,r23,r29 for ( index=index_base ; index < ( information->allocation_size + index_base ); ffc0a048: a1 3f 00 14 lhz r9,20(r31) index++ ) { local_table[ index ] = NULL; ffc0a04c: 7d 1e 4a 14 add r8,r30,r9 ffc0a050: 7f 9e 40 40 cmplw cr7,r30,r8 ffc0a054: 39 29 00 01 addi r9,r9,1 ffc0a058: 41 9d 00 0c bgt- cr7,ffc0a064 <_Objects_Extend_information+0x1c0><== NEVER TAKEN ffc0a05c: 2f 88 00 00 cmpwi cr7,r8,0 ffc0a060: 40 be 00 18 bne+ cr7,ffc0a078 <_Objects_Extend_information+0x1d4><== ALWAYS TAKEN ffc0a064: 39 20 00 01 li r9,1 <== NOT EXECUTED ffc0a068: 48 00 00 10 b ffc0a078 <_Objects_Extend_information+0x1d4><== NOT EXECUTED * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( ffc0a06c: 55 48 10 3a rlwinm r8,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; ffc0a070: 7c e8 c1 2e stwx r7,r8,r24 object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { ffc0a074: 39 4a 00 01 addi r10,r10,1 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; ffc0a078: 35 29 ff ff addic. r9,r9,-1 ffc0a07c: 40 82 ff f0 bne+ ffc0a06c <_Objects_Extend_information+0x1c8> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0a080: 7d 40 00 a6 mfmsr r10 ffc0a084: 7d 30 42 a6 mfsprg r9,0 ffc0a088: 7d 49 48 78 andc r9,r10,r9 ffc0a08c: 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) | ffc0a090: 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( ffc0a094: a1 1f 00 04 lhz r8,4(r31) ffc0a098: 55 29 c0 0e rlwinm r9,r9,24,0,7 old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; ffc0a09c: b3 3f 00 10 sth r25,16(r31) ffc0a0a0: 65 29 00 01 oris r9,r9,1 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | ffc0a0a4: 7d 39 cb 78 or r25,r9,r25 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; ffc0a0a8: 80 7f 00 34 lwz r3,52(r31) ffc0a0ac: 55 08 d8 08 rlwinm r8,r8,27,0,4 information->object_blocks = object_blocks; ffc0a0b0: 93 5f 00 34 stw r26,52(r31) uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | ffc0a0b4: 7f 39 43 78 or r25,r25,r8 information->inactive_per_block = inactive_per_block; ffc0a0b8: 92 ff 00 30 stw r23,48(r31) information->local_table = local_table; ffc0a0bc: 93 1f 00 1c stw r24,28(r31) information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( ffc0a0c0: 93 3f 00 0c stw r25,12(r31) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0a0c4: 7d 40 01 24 mtmsr r10 information->maximum ); _ISR_Enable( level ); _Workspace_Free( old_tables ); ffc0a0c8: 48 00 21 f1 bl ffc0c2b8 <_Workspace_Free> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; ffc0a0cc: 81 3f 00 34 lwz r9,52(r31) ffc0a0d0: 57 7b 10 3a rlwinm r27,r27,2,0,29 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( ffc0a0d4: 3b a1 00 08 addi r29,r1,8 ffc0a0d8: a0 bf 00 14 lhz r5,20(r31) } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; ffc0a0dc: 7e c9 d9 2e stwx r22,r9,r27 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( ffc0a0e0: 7f a3 eb 78 mr r3,r29 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); ffc0a0e4: 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( ffc0a0e8: 81 3f 00 34 lwz r9,52(r31) ffc0a0ec: 80 df 00 18 lwz r6,24(r31) ffc0a0f0: 7c 89 d8 2e lwzx r4,r9,r27 ffc0a0f4: 4b ff f3 25 bl ffc09418 <_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 ) { ffc0a0f8: 48 00 00 30 b ffc0a128 <_Objects_Extend_information+0x284> ffc0a0fc: 81 3f 00 00 lwz r9,0(r31) information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); ffc0a100: 7f 83 e3 78 mr r3,r28 */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { the_object->id = _Objects_Build_id( ffc0a104: a1 5f 00 04 lhz r10,4(r31) ffc0a108: 55 29 c0 0e rlwinm r9,r9,24,0,7 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | ffc0a10c: 55 4a d8 08 rlwinm r10,r10,27,0,4 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | ffc0a110: 65 29 00 01 oris r9,r9,1 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | ffc0a114: 7d 29 53 78 or r9,r9,r10 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | ffc0a118: 7d 29 f3 78 or r9,r9,r30 ffc0a11c: 91 24 00 08 stw r9,8(r4) index ); _Chain_Append( &information->Inactive, &the_object->Node ); index++; ffc0a120: 3b de 00 01 addi r30,r30,1 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); ffc0a124: 4b ff f2 85 bl ffc093a8 <_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 ) { ffc0a128: 7f a3 eb 78 mr r3,r29 ffc0a12c: 4b ff f2 ad bl ffc093d8 <_Chain_Get> ffc0a130: 7c 64 1b 79 mr. r4,r3 ffc0a134: 40 82 ff c8 bne+ ffc0a0fc <_Objects_Extend_information+0x258> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; ffc0a138: a1 3f 00 14 lhz r9,20(r31) ffc0a13c: 81 5f 00 30 lwz r10,48(r31) ffc0a140: 7d 2a d9 2e stwx r9,r10,r27 information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); ffc0a144: a1 5f 00 2c lhz r10,44(r31) ffc0a148: 7d 29 52 14 add r9,r9,r10 index++; } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = ffc0a14c: b1 3f 00 2c sth r9,44(r31) (Objects_Maximum)(information->inactive + information->allocation_size); } ffc0a150: 39 61 00 48 addi r11,r1,72 ffc0a154: 4b ff 64 48 b ffc0059c <_restgpr_21_x> =============================================================================== ffc0a200 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { ffc0a200: 94 21 ff f0 stwu r1,-16(r1) ffc0a204: 7c 08 02 a6 mflr r0 ffc0a208: bf c1 00 08 stmw r30,8(r1) Objects_Information *info; int the_class_api_maximum; if ( !the_class ) ffc0a20c: 7c 9f 23 79 mr. r31,r4 Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { ffc0a210: 90 01 00 14 stw r0,20(r1) Objects_Information *info; int the_class_api_maximum; if ( !the_class ) ffc0a214: 40 a2 00 0c bne+ ffc0a220 <_Objects_Get_information+0x20> return NULL; ffc0a218: 38 60 00 00 li r3,0 ffc0a21c: 48 00 00 50 b ffc0a26c <_Objects_Get_information+0x6c> ffc0a220: 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 ); ffc0a224: 48 00 3d 41 bl ffc0df64 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) ffc0a228: 2c 03 00 00 cmpwi r3,0 ffc0a22c: 41 a2 ff ec beq- ffc0a218 <_Objects_Get_information+0x18> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) ffc0a230: 7f 9f 18 40 cmplw cr7,r31,r3 ffc0a234: 41 bd ff e4 bgt- cr7,ffc0a218 <_Objects_Get_information+0x18> return NULL; if ( !_Objects_Information_table[ the_api ] ) ffc0a238: 3d 20 00 00 lis r9,0 ffc0a23c: 57 de 10 3a rlwinm r30,r30,2,0,29 ffc0a240: 39 29 2b f8 addi r9,r9,11256 ffc0a244: 7d 29 f0 2e lwzx r9,r9,r30 ffc0a248: 2f 89 00 00 cmpwi cr7,r9,0 ffc0a24c: 41 be ff cc beq- cr7,ffc0a218 <_Objects_Get_information+0x18><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; ffc0a250: 57 ff 10 3a rlwinm r31,r31,2,0,29 ffc0a254: 7c 69 f8 2e lwzx r3,r9,r31 if ( !info ) ffc0a258: 2f 83 00 00 cmpwi cr7,r3,0 ffc0a25c: 41 be ff bc beq- cr7,ffc0a218 <_Objects_Get_information+0x18><== 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 ) ffc0a260: a1 23 00 10 lhz r9,16(r3) ffc0a264: 2f 89 00 00 cmpwi cr7,r9,0 ffc0a268: 41 be ff b0 beq- cr7,ffc0a218 <_Objects_Get_information+0x18> return NULL; #endif return info; } ffc0a26c: 39 61 00 10 addi r11,r1,16 ffc0a270: 4b ff 63 50 b ffc005c0 <_restgpr_30_x> =============================================================================== ffc1c6ec <_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; ffc1c6ec: 81 23 00 08 lwz r9,8(r3) ffc1c6f0: 21 29 00 01 subfic r9,r9,1 ffc1c6f4: 7c 89 22 14 add r4,r9,r4 if ( information->maximum >= index ) { ffc1c6f8: a1 23 00 10 lhz r9,16(r3) ffc1c6fc: 7f 89 20 40 cmplw cr7,r9,r4 ffc1c700: 41 9c 00 24 blt- cr7,ffc1c724 <_Objects_Get_no_protection+0x38> if ( (the_object = information->local_table[ index ]) != NULL ) { ffc1c704: 81 23 00 1c lwz r9,28(r3) ffc1c708: 54 84 10 3a rlwinm r4,r4,2,0,29 ffc1c70c: 7c 69 20 2e lwzx r3,r9,r4 ffc1c710: 2f 83 00 00 cmpwi cr7,r3,0 ffc1c714: 41 9e 00 10 beq- cr7,ffc1c724 <_Objects_Get_no_protection+0x38><== NEVER TAKEN *location = OBJECTS_LOCAL; ffc1c718: 39 20 00 00 li r9,0 ffc1c71c: 91 25 00 00 stw r9,0(r5) return the_object; ffc1c720: 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; ffc1c724: 39 20 00 01 li r9,1 ffc1c728: 91 25 00 00 stw r9,0(r5) return NULL; ffc1c72c: 38 60 00 00 li r3,0 } ffc1c730: 4e 80 00 20 blr =============================================================================== ffc0e228 <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { ffc0e228: 7c 2b 0b 78 mr r11,r1 ffc0e22c: 94 21 ff e0 stwu r1,-32(r1) ffc0e230: 7c 08 02 a6 mflr r0 ffc0e234: 48 01 a4 55 bl ffc28688 <_savegpr_31> ffc0e238: 7c 9f 23 78 mr r31,r4 /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; ffc0e23c: 7c 64 1b 79 mr. r4,r3 Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { ffc0e240: 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; ffc0e244: 40 82 00 10 bne- ffc0e254 <_Objects_Id_to_name+0x2c> ffc0e248: 3d 20 00 00 lis r9,0 ffc0e24c: 81 29 37 30 lwz r9,14128(r9) ffc0e250: 80 89 00 08 lwz r4,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); ffc0e254: 54 8a 47 7e rlwinm r10,r4,8,29,31 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) ffc0e258: 39 0a ff ff addi r8,r10,-1 ffc0e25c: 2b 88 00 02 cmplwi cr7,r8,2 ffc0e260: 40 9d 00 40 ble- cr7,ffc0e2a0 <_Objects_Id_to_name+0x78> the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; ffc0e264: 38 60 00 03 li r3,3 ffc0e268: 48 00 00 54 b ffc0e2bc <_Objects_Id_to_name+0x94> if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; ffc0e26c: 54 88 3e 7a rlwinm r8,r4,7,25,29 ffc0e270: 7c 6a 40 2e lwzx r3,r10,r8 if ( !information ) ffc0e274: 2f 83 00 00 cmpwi cr7,r3,0 ffc0e278: 41 be ff ec beq- cr7,ffc0e264 <_Objects_Id_to_name+0x3c><== 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 ); ffc0e27c: 38 a1 00 08 addi r5,r1,8 ffc0e280: 4b ff ff 29 bl ffc0e1a8 <_Objects_Get> if ( !the_object ) ffc0e284: 2c 03 00 00 cmpwi r3,0 ffc0e288: 41 a2 ff dc beq- ffc0e264 <_Objects_Id_to_name+0x3c> return OBJECTS_INVALID_ID; *name = the_object->name; ffc0e28c: 81 23 00 0c lwz r9,12(r3) ffc0e290: 91 3f 00 00 stw r9,0(r31) _Thread_Enable_dispatch(); ffc0e294: 48 00 0e 61 bl ffc0f0f4 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; ffc0e298: 38 60 00 00 li r3,0 ffc0e29c: 48 00 00 20 b ffc0e2bc <_Objects_Id_to_name+0x94> the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) ffc0e2a0: 3d 00 00 00 lis r8,0 ffc0e2a4: 55 4a 10 3a rlwinm r10,r10,2,0,29 ffc0e2a8: 39 08 34 d8 addi r8,r8,13528 ffc0e2ac: 7d 48 50 2e lwzx r10,r8,r10 ffc0e2b0: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0e2b4: 40 9e ff b8 bne+ cr7,ffc0e26c <_Objects_Id_to_name+0x44> ffc0e2b8: 4b ff ff ac b ffc0e264 <_Objects_Id_to_name+0x3c> return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } ffc0e2bc: 39 61 00 20 addi r11,r1,32 ffc0e2c0: 4b ff 25 70 b ffc00830 <_restgpr_31_x> =============================================================================== ffc0b034 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { ffc0b034: 94 21 ff e8 stwu r1,-24(r1) ffc0b038: 7c 08 02 a6 mflr r0 ffc0b03c: bf 81 00 08 stmw r28,8(r1) RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; ffc0b040: 7c 9f 23 79 mr. r31,r4 */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { ffc0b044: 90 01 00 1c stw r0,28(r1) RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; ffc0b048: 41 82 01 9c beq- ffc0b1e4 <_RBTree_Extract_unprotected+0x1b0> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { ffc0b04c: 81 23 00 08 lwz r9,8(r3) ffc0b050: 7c 7c 1b 78 mr r28,r3 ffc0b054: 7f 9f 48 00 cmpw cr7,r31,r9 ffc0b058: 40 be 00 14 bne+ cr7,ffc0b06c <_RBTree_Extract_unprotected+0x38> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_RIGHT ); ffc0b05c: 7f e3 fb 78 mr r3,r31 ffc0b060: 38 80 00 01 li r4,1 ffc0b064: 48 00 04 f5 bl ffc0b558 <_RBTree_Next_unprotected> RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; ffc0b068: 90 7c 00 08 stw r3,8(r28) } /* 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]) { ffc0b06c: 81 3c 00 0c lwz r9,12(r28) ffc0b070: 7f 9f 48 00 cmpw cr7,r31,r9 ffc0b074: 40 be 00 14 bne+ cr7,ffc0b088 <_RBTree_Extract_unprotected+0x54> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_LEFT ); ffc0b078: 7f e3 fb 78 mr r3,r31 ffc0b07c: 38 80 00 00 li r4,0 ffc0b080: 48 00 04 d9 bl ffc0b558 <_RBTree_Next_unprotected> RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; ffc0b084: 90 7c 00 0c stw r3,12(r28) * 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]) { ffc0b088: 83 df 00 04 lwz r30,4(r31) ffc0b08c: 83 bf 00 08 lwz r29,8(r31) ffc0b090: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0b094: 41 9e 00 d0 beq- cr7,ffc0b164 <_RBTree_Extract_unprotected+0x130> ffc0b098: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0b09c: 40 be 00 0c bne+ cr7,ffc0b0a8 <_RBTree_Extract_unprotected+0x74> ffc0b0a0: 48 00 00 d0 b ffc0b170 <_RBTree_Extract_unprotected+0x13c> target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; ffc0b0a4: 7d 3e 4b 78 mr r30,r9 ffc0b0a8: 81 3e 00 08 lwz r9,8(r30) ffc0b0ac: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b0b0: 40 9e ff f4 bne+ cr7,ffc0b0a4 <_RBTree_Extract_unprotected+0x70> * 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]; ffc0b0b4: 83 be 00 04 lwz r29,4(r30) if(leaf) { ffc0b0b8: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0b0bc: 41 9e 00 10 beq- cr7,ffc0b0cc <_RBTree_Extract_unprotected+0x98> leaf->parent = target->parent; ffc0b0c0: 81 3e 00 00 lwz r9,0(r30) ffc0b0c4: 91 3d 00 00 stw r9,0(r29) ffc0b0c8: 48 00 00 0c b ffc0b0d4 <_RBTree_Extract_unprotected+0xa0> } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); ffc0b0cc: 7f c3 f3 78 mr r3,r30 ffc0b0d0: 4b ff fd cd bl ffc0ae9c <_RBTree_Extract_validate_unprotected> } victim_color = target->color; dir = target != target->parent->child[0]; ffc0b0d4: 81 1e 00 00 lwz r8,0(r30) 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; ffc0b0d8: 81 5e 00 0c lwz r10,12(r30) dir = target != target->parent->child[0]; ffc0b0dc: 81 28 00 04 lwz r9,4(r8) ffc0b0e0: 7f c9 4a 78 xor r9,r30,r9 ffc0b0e4: 7d 29 00 34 cntlzw r9,r9 ffc0b0e8: 55 29 d9 7e rlwinm r9,r9,27,5,31 ffc0b0ec: 69 29 00 01 xori r9,r9,1 target->parent->child[dir] = leaf; ffc0b0f0: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0b0f4: 7d 08 4a 14 add r8,r8,r9 ffc0b0f8: 93 a8 00 04 stw r29,4(r8) /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; ffc0b0fc: 81 1f 00 00 lwz r8,0(r31) ffc0b100: 81 28 00 04 lwz r9,4(r8) ffc0b104: 7f e9 4a 78 xor r9,r31,r9 ffc0b108: 7d 29 00 34 cntlzw r9,r9 ffc0b10c: 55 29 d9 7e rlwinm r9,r9,27,5,31 ffc0b110: 69 29 00 01 xori r9,r9,1 the_node->parent->child[dir] = target; ffc0b114: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0b118: 7d 08 4a 14 add r8,r8,r9 ffc0b11c: 93 c8 00 04 stw r30,4(r8) /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; ffc0b120: 81 3f 00 08 lwz r9,8(r31) ffc0b124: 91 3e 00 08 stw r9,8(r30) if (the_node->child[RBT_RIGHT]) ffc0b128: 81 3f 00 08 lwz r9,8(r31) ffc0b12c: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b130: 41 9e 00 08 beq- cr7,ffc0b138 <_RBTree_Extract_unprotected+0x104><== NEVER TAKEN the_node->child[RBT_RIGHT]->parent = target; ffc0b134: 93 c9 00 00 stw r30,0(r9) target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; ffc0b138: 81 3f 00 04 lwz r9,4(r31) ffc0b13c: 91 3e 00 04 stw r9,4(r30) if (the_node->child[RBT_LEFT]) ffc0b140: 81 3f 00 04 lwz r9,4(r31) ffc0b144: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b148: 41 9e 00 08 beq- cr7,ffc0b150 <_RBTree_Extract_unprotected+0x11c> the_node->child[RBT_LEFT]->parent = target; ffc0b14c: 93 c9 00 00 stw r30,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; ffc0b150: 81 3f 00 00 lwz r9,0(r31) ffc0b154: 91 3e 00 00 stw r9,0(r30) target->color = the_node->color; ffc0b158: 81 3f 00 0c lwz r9,12(r31) ffc0b15c: 91 3e 00 0c stw r9,12(r30) ffc0b160: 48 00 00 50 b ffc0b1b0 <_RBTree_Extract_unprotected+0x17c> * violated. We will fix it later. * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { ffc0b164: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0b168: 40 be 00 0c bne+ cr7,ffc0b174 <_RBTree_Extract_unprotected+0x140> ffc0b16c: 48 00 00 14 b ffc0b180 <_RBTree_Extract_unprotected+0x14c> * 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]) { ffc0b170: 7f dd f3 78 mr r29,r30 * 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; ffc0b174: 81 3f 00 00 lwz r9,0(r31) ffc0b178: 91 3d 00 00 stw r9,0(r29) ffc0b17c: 48 00 00 0c b ffc0b188 <_RBTree_Extract_unprotected+0x154> } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); ffc0b180: 7f e3 fb 78 mr r3,r31 ffc0b184: 4b ff fd 19 bl ffc0ae9c <_RBTree_Extract_validate_unprotected> } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; ffc0b188: 81 1f 00 00 lwz r8,0(r31) 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; ffc0b18c: 81 5f 00 0c lwz r10,12(r31) /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; ffc0b190: 81 28 00 04 lwz r9,4(r8) ffc0b194: 7f e9 4a 78 xor r9,r31,r9 ffc0b198: 7d 29 00 34 cntlzw r9,r9 ffc0b19c: 55 29 d9 7e rlwinm r9,r9,27,5,31 ffc0b1a0: 69 29 00 01 xori r9,r9,1 the_node->parent->child[dir] = leaf; ffc0b1a4: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0b1a8: 7d 08 4a 14 add r8,r8,r9 ffc0b1ac: 93 a8 00 04 stw r29,4(r8) /* 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 */ ffc0b1b0: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0b1b4: 40 9e 00 10 bne- cr7,ffc0b1c4 <_RBTree_Extract_unprotected+0x190> if (leaf) { ffc0b1b8: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0b1bc: 41 9e 00 08 beq- cr7,ffc0b1c4 <_RBTree_Extract_unprotected+0x190> leaf->color = RBT_BLACK; /* case 2 */ ffc0b1c0: 91 5d 00 0c stw r10,12(r29) /* 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; ffc0b1c4: 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; ffc0b1c8: 39 20 00 00 li r9,0 ffc0b1cc: 91 3f 00 08 stw r9,8(r31) ffc0b1d0: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0b1d4: 91 3f 00 04 stw r9,4(r31) ffc0b1d8: 91 3f 00 00 stw r9,0(r31) ffc0b1dc: 41 9e 00 08 beq- cr7,ffc0b1e4 <_RBTree_Extract_unprotected+0x1b0> ffc0b1e0: 91 2a 00 0c stw r9,12(r10) } ffc0b1e4: 39 61 00 18 addi r11,r1,24 ffc0b1e8: 4b ff 5b 84 b ffc00d6c <_restgpr_28_x> =============================================================================== ffc0ba0c <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { ffc0ba0c: 94 21 ff e8 stwu r1,-24(r1) ffc0ba10: 7c 08 02 a6 mflr r0 ffc0ba14: bf 81 00 08 stmw r28,8(r1) size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; ffc0ba18: 7c 7f 1b 79 mr. r31,r3 void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { ffc0ba1c: 90 01 00 1c stw r0,28(r1) size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; ffc0ba20: 41 82 00 4c beq- ffc0ba6c <_RBTree_Initialize+0x60> <== NEVER TAKEN RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; ffc0ba24: 39 20 00 00 li r9,0 the_rbtree->root = NULL; the_rbtree->first[0] = NULL; the_rbtree->first[1] = NULL; the_rbtree->compare_function = compare_function; ffc0ba28: 90 9f 00 10 stw r4,16(r31) ffc0ba2c: 7c de 33 78 mr r30,r6 ffc0ba30: 7c fc 3b 78 mr r28,r7 RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; ffc0ba34: 91 3f 00 00 stw r9,0(r31) /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; ffc0ba38: 7c bd 2b 78 mr r29,r5 the_rbtree->root = NULL; ffc0ba3c: 91 3f 00 04 stw r9,4(r31) the_rbtree->first[0] = NULL; ffc0ba40: 91 3f 00 08 stw r9,8(r31) the_rbtree->first[1] = NULL; ffc0ba44: 91 3f 00 0c stw r9,12(r31) the_rbtree->compare_function = compare_function; the_rbtree->is_unique = is_unique; ffc0ba48: 99 1f 00 14 stb r8,20(r31) while ( count-- ) { ffc0ba4c: 48 00 00 18 b ffc0ba64 <_RBTree_Initialize+0x58> _RBTree_Insert_unprotected(the_rbtree, next); ffc0ba50: 7f a4 eb 78 mr r4,r29 ffc0ba54: 7f e3 fb 78 mr r3,r31 ffc0ba58: 4b ff fc 91 bl ffc0b6e8 <_RBTree_Insert_unprotected> #include #include #include #include void _RBTree_Initialize( ffc0ba5c: 7f bd e2 14 add r29,r29,r28 ffc0ba60: 3b de ff ff addi r30,r30,-1 /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { ffc0ba64: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0ba68: 40 9e ff e8 bne+ cr7,ffc0ba50 <_RBTree_Initialize+0x44> _RBTree_Insert_unprotected(the_rbtree, next); next = (RBTree_Node *) _Addresses_Add_offset( (void *) next, node_size ); } } ffc0ba6c: 39 61 00 18 addi r11,r1,24 ffc0ba70: 4b ff 5e f8 b ffc01968 <_restgpr_28_x> =============================================================================== ffc0b29c <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { ffc0b29c: 94 21 ff e0 stwu r1,-32(r1) ffc0b2a0: 7c 08 02 a6 mflr r0 ffc0b2a4: bf 41 00 08 stmw r26,8(r1) if(!the_node) return (RBTree_Node*)-1; ffc0b2a8: 7c 9f 23 79 mr. r31,r4 */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { ffc0b2ac: 90 01 00 24 stw r0,36(r1) if(!the_node) return (RBTree_Node*)-1; ffc0b2b0: 41 82 01 d8 beq- ffc0b488 <_RBTree_Insert_unprotected+0x1ec> RBTree_Node *iter_node = the_rbtree->root; ffc0b2b4: 83 c3 00 04 lwz r30,4(r3) ffc0b2b8: 7c 7d 1b 78 mr r29,r3 int compare_result; if (!iter_node) { /* special case: first node inserted */ ffc0b2bc: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0b2c0: 7f db f3 78 mr r27,r30 ffc0b2c4: 40 be 00 28 bne+ cr7,ffc0b2ec <_RBTree_Insert_unprotected+0x50> the_node->color = RBT_BLACK; ffc0b2c8: 93 df 00 0c stw r30,12(r31) the_rbtree->root = the_node; ffc0b2cc: 93 e3 00 04 stw r31,4(r3) the_rbtree->first[0] = the_rbtree->first[1] = the_node; ffc0b2d0: 93 e3 00 0c stw r31,12(r3) ffc0b2d4: 93 e3 00 08 stw r31,8(r3) the_node->parent = (RBTree_Node *) the_rbtree; ffc0b2d8: 90 7f 00 00 stw r3,0(r31) the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; ffc0b2dc: 93 df 00 08 stw r30,8(r31) ffc0b2e0: 93 df 00 04 stw r30,4(r31) ffc0b2e4: 48 00 01 c0 b ffc0b4a4 <_RBTree_Insert_unprotected+0x208> (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; } break; } else { iter_node = iter_node->child[dir]; ffc0b2e8: 7f db f3 78 mr r27,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); ffc0b2ec: 81 3d 00 10 lwz r9,16(r29) ffc0b2f0: 7f e3 fb 78 mr r3,r31 ffc0b2f4: 7f c4 f3 78 mr r4,r30 ffc0b2f8: 7d 29 03 a6 mtctr r9 ffc0b2fc: 4e 80 04 21 bctrl if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) ffc0b300: 89 3d 00 14 lbz r9,20(r29) ffc0b304: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b308: 41 9e 00 0c beq- cr7,ffc0b314 <_RBTree_Insert_unprotected+0x78> ffc0b30c: 2f 83 00 00 cmpwi cr7,r3,0 ffc0b310: 41 9e 01 94 beq- cr7,ffc0b4a4 <_RBTree_Insert_unprotected+0x208> return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); ffc0b314: 7c 7c 18 f8 not r28,r3 ffc0b318: 57 9c 0f fe rlwinm r28,r28,1,31,31 if (!iter_node->child[dir]) { ffc0b31c: 57 89 10 3a rlwinm r9,r28,2,0,29 ffc0b320: 7f de 4a 14 add r30,r30,r9 ffc0b324: 39 5e 00 04 addi r10,r30,4 ffc0b328: 83 de 00 04 lwz r30,4(r30) ffc0b32c: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0b330: 40 9e ff b8 bne+ cr7,ffc0b2e8 <_RBTree_Insert_unprotected+0x4c> the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; ffc0b334: 93 df 00 08 stw r30,8(r31) the_node->color = RBT_RED; ffc0b338: 39 00 00 01 li r8,1 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; ffc0b33c: 7d 3d 4a 14 add r9,r29,r9 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; ffc0b340: 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( ffc0b344: 7f e3 fb 78 mr r3,r31 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; ffc0b348: 93 ea 00 00 stw r31,0(r10) the_node->parent = iter_node; /* update min/max */ compare_result = the_rbtree->compare_function( ffc0b34c: 81 5d 00 10 lwz r10,16(r29) if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); if (!iter_node->child[dir]) { the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; the_node->color = RBT_RED; ffc0b350: 91 1f 00 0c stw r8,12(r31) iter_node->child[dir] = the_node; the_node->parent = iter_node; /* update min/max */ compare_result = the_rbtree->compare_function( ffc0b354: 7d 49 03 a6 mtctr r10 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; the_node->parent = iter_node; ffc0b358: 93 7f 00 00 stw r27,0(r31) /* update min/max */ compare_result = the_rbtree->compare_function( ffc0b35c: 80 89 00 08 lwz r4,8(r9) ffc0b360: 4e 80 04 21 bctrl the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || ffc0b364: 2f 1c 00 00 cmpwi cr6,r28,0 ffc0b368: 2f 83 00 00 cmpwi cr7,r3,0 ffc0b36c: 40 9a 00 0c bne- cr6,ffc0b378 <_RBTree_Insert_unprotected+0xdc> ffc0b370: 40 bc 00 e4 bge+ cr7,ffc0b454 <_RBTree_Insert_unprotected+0x1b8> ffc0b374: 48 00 00 08 b ffc0b37c <_RBTree_Insert_unprotected+0xe0> (dir && _RBTree_Is_greater(compare_result)) ) { ffc0b378: 40 9d 00 dc ble- cr7,ffc0b454 <_RBTree_Insert_unprotected+0x1b8> the_rbtree->first[dir] = the_node; ffc0b37c: 57 9c 10 3a rlwinm r28,r28,2,0,29 ffc0b380: 7f bd e2 14 add r29,r29,r28 ffc0b384: 93 fd 00 08 stw r31,8(r29) ffc0b388: 48 00 00 cc b ffc0b454 <_RBTree_Insert_unprotected+0x1b8> const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; ffc0b38c: 41 9e 00 38 beq- cr7,ffc0b3c4 <_RBTree_Insert_unprotected+0x128><== NEVER TAKEN if(!(the_node->parent->parent->parent)) return NULL; ffc0b390: 81 3d 00 00 lwz r9,0(r29) ffc0b394: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b398: 41 9e 00 2c beq- cr7,ffc0b3c4 <_RBTree_Insert_unprotected+0x128><== 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]) ffc0b39c: 81 3d 00 04 lwz r9,4(r29) ffc0b3a0: 7f 83 48 00 cmpw cr7,r3,r9 ffc0b3a4: 40 be 00 08 bne+ cr7,ffc0b3ac <_RBTree_Insert_unprotected+0x110> return the_node->parent->child[RBT_RIGHT]; ffc0b3a8: 81 3d 00 08 lwz r9,8(r29) */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); ffc0b3ac: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b3b0: 41 9e 00 18 beq- cr7,ffc0b3c8 <_RBTree_Insert_unprotected+0x12c> ffc0b3b4: 81 49 00 0c lwz r10,12(r9) ffc0b3b8: 2f 8a 00 01 cmpwi cr7,r10,1 ffc0b3bc: 40 be 00 0c bne+ cr7,ffc0b3c8 <_RBTree_Insert_unprotected+0x12c> ffc0b3c0: 48 00 00 10 b ffc0b3d0 <_RBTree_Insert_unprotected+0x134> ) { 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; ffc0b3c4: 39 20 00 00 li r9,0 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); ffc0b3c8: 39 40 00 00 li r10,0 ffc0b3cc: 48 00 00 08 b ffc0b3d4 <_RBTree_Insert_unprotected+0x138> ffc0b3d0: 39 40 00 01 li r10,1 while (_RBTree_Is_red(_RBTree_Parent(the_node))) { u = _RBTree_Parent_sibling(the_node); g = the_node->parent->parent; /* if uncle is red, repaint uncle/parent black and grandparent red */ if(_RBTree_Is_red(u)) { ffc0b3d4: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0b3d8: 41 9e 00 14 beq- cr7,ffc0b3ec <_RBTree_Insert_unprotected+0x150> the_node->parent->color = RBT_BLACK; ffc0b3dc: 93 63 00 0c stw r27,12(r3) u->color = RBT_BLACK; ffc0b3e0: 93 69 00 0c stw r27,12(r9) g->color = RBT_RED; ffc0b3e4: 93 5d 00 0c stw r26,12(r29) ffc0b3e8: 48 00 00 64 b ffc0b44c <_RBTree_Insert_unprotected+0x1b0> the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; RBTree_Direction pdir = the_node->parent != g->child[0]; ffc0b3ec: 80 9d 00 04 lwz r4,4(r29) 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]; ffc0b3f0: 81 23 00 04 lwz r9,4(r3) RBTree_Direction pdir = the_node->parent != g->child[0]; ffc0b3f4: 7c 64 22 78 xor r4,r3,r4 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]; ffc0b3f8: 7f e9 4a 78 xor r9,r31,r9 RBTree_Direction pdir = the_node->parent != g->child[0]; ffc0b3fc: 7c 84 00 34 cntlzw r4,r4 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]; ffc0b400: 7d 29 00 34 cntlzw r9,r9 RBTree_Direction pdir = the_node->parent != g->child[0]; ffc0b404: 54 84 d9 7e rlwinm r4,r4,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]; ffc0b408: 55 29 d9 7e rlwinm r9,r9,27,5,31 RBTree_Direction pdir = the_node->parent != g->child[0]; ffc0b40c: 68 9c 00 01 xori r28,r4,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]; ffc0b410: 69 29 00 01 xori r9,r9,1 RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { ffc0b414: 7f 89 e0 00 cmpw cr7,r9,r28 ffc0b418: 41 9e 00 18 beq- cr7,ffc0b430 <_RBTree_Insert_unprotected+0x194> _RBTree_Rotate(the_node->parent, pdir); ffc0b41c: 7f 84 e3 78 mr r4,r28 ffc0b420: 4b ff fe 01 bl ffc0b220 <_RBTree_Rotate> the_node = the_node->child[pdir]; ffc0b424: 57 89 10 3a rlwinm r9,r28,2,0,29 ffc0b428: 7f ff 4a 14 add r31,r31,r9 ffc0b42c: 83 ff 00 04 lwz r31,4(r31) } the_node->parent->color = RBT_BLACK; ffc0b430: 81 3f 00 00 lwz r9,0(r31) g->color = RBT_RED; /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); ffc0b434: 7f a3 eb 78 mr r3,r29 ffc0b438: 20 9c 00 01 subfic r4,r28,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; ffc0b43c: 93 69 00 0c stw r27,12(r9) g->color = RBT_RED; ffc0b440: 93 5d 00 0c stw r26,12(r29) /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); ffc0b444: 7f fd fb 78 mr r29,r31 ffc0b448: 4b ff fd d9 bl ffc0b220 <_RBTree_Rotate> ffc0b44c: 7f bf eb 78 mr r31,r29 ffc0b450: 48 00 00 0c b ffc0b45c <_RBTree_Insert_unprotected+0x1c0> ffc0b454: 3b 60 00 00 li r27,0 ffc0b458: 3b 40 00 01 li r26,1 _ISR_Disable( level ); return_node = _RBTree_Insert_unprotected( tree, node ); _ISR_Enable( level ); return return_node; } ffc0b45c: 80 7f 00 00 lwz r3,0(r31) */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; ffc0b460: 83 a3 00 00 lwz r29,0(r3) ffc0b464: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0b468: 40 be 00 28 bne+ cr7,ffc0b490 <_RBTree_Insert_unprotected+0x1f4> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); ffc0b46c: 39 20 00 00 li r9,0 RBTree_Node *u,*g; /* note: the insert root case is handled already */ /* if the parent is black, nothing needs to be done * otherwise may need to loop a few times */ while (_RBTree_Is_red(_RBTree_Parent(the_node))) { ffc0b470: 2f 09 00 00 cmpwi cr6,r9,0 ffc0b474: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0b478: 40 9a ff 14 bne+ cr6,ffc0b38c <_RBTree_Insert_unprotected+0xf0> /* 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; ffc0b47c: 40 be 00 28 bne+ cr7,ffc0b4a4 <_RBTree_Insert_unprotected+0x208> ffc0b480: 93 bf 00 0c stw r29,12(r31) ffc0b484: 48 00 00 20 b ffc0b4a4 <_RBTree_Insert_unprotected+0x208> RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { if(!the_node) return (RBTree_Node*)-1; ffc0b488: 3b c0 ff ff li r30,-1 ffc0b48c: 48 00 00 18 b ffc0b4a4 <_RBTree_Insert_unprotected+0x208> ffc0b490: 81 23 00 0c lwz r9,12(r3) ffc0b494: 69 29 00 01 xori r9,r9,1 ffc0b498: 7d 29 00 34 cntlzw r9,r9 ffc0b49c: 55 29 d9 7e rlwinm r9,r9,27,5,31 ffc0b4a0: 4b ff ff d0 b ffc0b470 <_RBTree_Insert_unprotected+0x1d4> /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } ffc0b4a4: 39 61 00 20 addi r11,r1,32 ffc0b4a8: 7f c3 f3 78 mr r3,r30 ffc0b4ac: 4b ff 58 b8 b ffc00d64 <_restgpr_26_x> =============================================================================== ffc0b4e4 <_RBTree_Iterate_unprotected>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { ffc0b4e4: 94 21 ff e0 stwu r1,-32(r1) ffc0b4e8: 7c 08 02 a6 mflr r0 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); ffc0b4ec: 7c 89 00 34 cntlzw r9,r4 ffc0b4f0: 55 29 d9 7e rlwinm r9,r9,27,5,31 ffc0b4f4: 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]; ffc0b4f8: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0b4fc: 7c 63 4a 14 add r3,r3,r9 ffc0b500: bf 61 00 0c stmw r27,12(r1) ffc0b504: 7c bd 2b 78 mr r29,r5 ffc0b508: 7c dc 33 78 mr r28,r6 ffc0b50c: 83 e3 00 08 lwz r31,8(r3) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); ffc0b510: 7c 9e 23 78 mr r30,r4 ffc0b514: 48 00 00 34 b ffc0b548 <_RBTree_Iterate_unprotected+0x64> 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 ); ffc0b518: 7f e3 fb 78 mr r3,r31 ffc0b51c: 7f a9 03 a6 mtctr r29 ffc0b520: 7f c4 f3 78 mr r4,r30 ffc0b524: 7f 85 e3 78 mr r5,r28 ffc0b528: 4e 80 04 21 bctrl current = _RBTree_Next_unprotected( current, dir ); ffc0b52c: 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 ); ffc0b530: 7c 7b 1b 78 mr r27,r3 current = _RBTree_Next_unprotected( current, dir ); ffc0b534: 7f e3 fb 78 mr r3,r31 ffc0b538: 48 00 00 21 bl ffc0b558 <_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 ) { ffc0b53c: 2f 9b 00 00 cmpwi cr7,r27,0 stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); ffc0b540: 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 ) { ffc0b544: 40 9e 00 0c bne- cr7,ffc0b550 <_RBTree_Iterate_unprotected+0x6c><== NEVER TAKEN ffc0b548: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0b54c: 40 9e ff cc bne+ cr7,ffc0b518 <_RBTree_Iterate_unprotected+0x34> stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); } } ffc0b550: 39 61 00 20 addi r11,r1,32 ffc0b554: 4b ff 58 14 b ffc00d68 <_restgpr_27_x> =============================================================================== ffc0ade4 <_RBTree_Sibling>: */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; ffc0ade4: 7c 6a 1b 79 mr. r10,r3 ffc0ade8: 41 82 00 30 beq- ffc0ae18 <_RBTree_Sibling+0x34> <== NEVER TAKEN if(!(the_node->parent)) return NULL; ffc0adec: 81 2a 00 00 lwz r9,0(r10) ffc0adf0: 2f 89 00 00 cmpwi cr7,r9,0 ffc0adf4: 41 9e 00 24 beq- cr7,ffc0ae18 <_RBTree_Sibling+0x34> <== NEVER TAKEN if(!(the_node->parent->parent)) return NULL; ffc0adf8: 81 09 00 00 lwz r8,0(r9) ffc0adfc: 2f 88 00 00 cmpwi cr7,r8,0 ffc0ae00: 41 9e 00 18 beq- cr7,ffc0ae18 <_RBTree_Sibling+0x34> if(the_node == the_node->parent->child[RBT_LEFT]) ffc0ae04: 80 69 00 04 lwz r3,4(r9) ffc0ae08: 7f 8a 18 00 cmpw cr7,r10,r3 ffc0ae0c: 4c be 00 20 bnelr+ cr7 return the_node->parent->child[RBT_RIGHT]; ffc0ae10: 80 69 00 08 lwz r3,8(r9) ffc0ae14: 4e 80 00 20 blr */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; ffc0ae18: 38 60 00 00 li r3,0 if(the_node == the_node->parent->child[RBT_LEFT]) return the_node->parent->child[RBT_RIGHT]; else return the_node->parent->child[RBT_LEFT]; } ffc0ae1c: 4e 80 00 20 blr =============================================================================== ffc099d8 <_RTEMS_signal_Post_switch_hook>: #include #include #include static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing ) { ffc099d8: 94 21 ff e0 stwu r1,-32(r1) ffc099dc: 7c 08 02 a6 mflr r0 ffc099e0: 90 01 00 24 stw r0,36(r1) ffc099e4: bf c1 00 18 stmw r30,24(r1) RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; ffc099e8: 83 e3 01 48 lwz r31,328(r3) if ( !api ) ffc099ec: 2f 9f 00 00 cmpwi cr7,r31,0 ffc099f0: 41 9e 00 7c beq- cr7,ffc09a6c <_RTEMS_signal_Post_switch_hook+0x94><== NEVER TAKEN static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc099f4: 7d 20 00 a6 mfmsr r9 ffc099f8: 7d 50 42 a6 mfsprg r10,0 ffc099fc: 7d 2a 50 78 andc r10,r9,r10 ffc09a00: 7d 40 01 24 mtmsr r10 asr = &api->Signal; _ISR_Disable( level ); signal_set = asr->signals_posted; asr->signals_posted = 0; ffc09a04: 39 40 00 00 li r10,0 */ asr = &api->Signal; _ISR_Disable( level ); signal_set = asr->signals_posted; ffc09a08: 83 df 00 14 lwz r30,20(r31) asr->signals_posted = 0; ffc09a0c: 91 5f 00 14 stw r10,20(r31) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc09a10: 7d 20 01 24 mtmsr r9 _ISR_Enable( level ); if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ ffc09a14: 2f 9e 00 00 cmpwi cr7,r30,0 ffc09a18: 41 be 00 54 beq+ cr7,ffc09a6c <_RTEMS_signal_Post_switch_hook+0x94> return; asr->nest_level += 1; ffc09a1c: 81 3f 00 1c lwz r9,28(r31) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); ffc09a20: 38 80 00 00 li r4,0 ffc09a24: 80 7f 00 10 lwz r3,16(r31) ffc09a28: 60 84 ff ff ori r4,r4,65535 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; ffc09a2c: 39 29 00 01 addi r9,r9,1 ffc09a30: 91 3f 00 1c stw r9,28(r31) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); ffc09a34: 38 a1 00 08 addi r5,r1,8 ffc09a38: 48 00 04 41 bl ffc09e78 (*asr->handler)( signal_set ); ffc09a3c: 81 3f 00 0c lwz r9,12(r31) ffc09a40: 7f c3 f3 78 mr r3,r30 ffc09a44: 7d 29 03 a6 mtctr r9 ffc09a48: 4e 80 04 21 bctrl asr->nest_level -= 1; ffc09a4c: 81 3f 00 1c lwz r9,28(r31) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); ffc09a50: 38 80 00 00 li r4,0 ffc09a54: 80 61 00 08 lwz r3,8(r1) asr->nest_level += 1; rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); (*asr->handler)( signal_set ); asr->nest_level -= 1; ffc09a58: 39 29 ff ff addi r9,r9,-1 ffc09a5c: 91 3f 00 1c stw r9,28(r31) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); ffc09a60: 60 84 ff ff ori r4,r4,65535 ffc09a64: 38 a1 00 08 addi r5,r1,8 ffc09a68: 48 00 04 11 bl ffc09e78 } ffc09a6c: 39 61 00 20 addi r11,r1,32 ffc09a70: 4b ff 7a a0 b ffc01510 <_restgpr_30_x> =============================================================================== ffc338f4 <_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 ) { ffc338f4: 94 21 ff d8 stwu r1,-40(r1) ffc338f8: 7c 08 02 a6 mflr r0 ffc338fc: 90 01 00 2c stw r0,44(r1) ffc33900: bf 81 00 18 stmw r28,24(r1) ffc33904: 7c 9d 23 78 mr r29,r4 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); ffc33908: 3c 80 00 00 lis r4,0 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; ffc3390c: 83 c3 00 40 lwz r30,64(r3) 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 ) { ffc33910: 7c 7f 1b 78 mr r31,r3 ffc33914: 38 84 63 48 addi r4,r4,25416 ffc33918: 38 61 00 08 addi r3,r1,8 ffc3391c: 7c bc 2b 78 mr r28,r5 ffc33920: 4b fd 58 05 bl ffc09124 <_TOD_Get_with_nanoseconds> const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; ffc33924: 81 5f 00 50 lwz r10,80(r31) ffc33928: 81 7f 00 54 lwz r11,84(r31) /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( ffc3392c: 80 c1 00 08 lwz r6,8(r1) ffc33930: 80 e1 00 0c lwz r7,12(r1) ffc33934: 7d 6b 38 10 subfc r11,r11,r7 ffc33938: 7d 4a 31 10 subfe r10,r10,r6 ffc3393c: 91 5d 00 00 stw r10,0(r29) * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { ffc33940: 3d 40 00 00 lis r10,0 ffc33944: 39 4a 65 60 addi r10,r10,25952 ffc33948: 91 7d 00 04 stw r11,4(r29) ffc3394c: 80 aa 00 10 lwz r5,16(r10) #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; ffc33950: 81 1e 00 80 lwz r8,128(r30) #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { ffc33954: 7f 9e 28 00 cmpw cr7,r30,r5 #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; ffc33958: 81 3e 00 84 lwz r9,132(r30) #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { ffc3395c: 40 be 00 48 bne+ cr7,ffc339a4 <_Rate_monotonic_Get_status+0xb0> ffc33960: 81 6a 00 24 lwz r11,36(r10) ffc33964: 81 4a 00 20 lwz r10,32(r10) ffc33968: 7c eb 38 10 subfc r7,r11,r7 ffc3396c: 7c ca 31 10 subfe r6,r10,r6 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } ffc33970: 81 5f 00 48 lwz r10,72(r31) ffc33974: 81 7f 00 4c lwz r11,76(r31) static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; ffc33978: 7d 29 38 14 addc r9,r9,r7 ffc3397c: 7d 08 31 14 adde r8,r8,r6 /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) ffc33980: 7f 8a 40 00 cmpw cr7,r10,r8 ffc33984: 41 9d 00 28 bgt- cr7,ffc339ac <_Rate_monotonic_Get_status+0xb8><== NEVER TAKEN ffc33988: 40 be 00 0c bne+ cr7,ffc33994 <_Rate_monotonic_Get_status+0xa0> ffc3398c: 7f 8b 48 40 cmplw cr7,r11,r9 ffc33990: 41 9d 00 1c bgt- cr7,ffc339ac <_Rate_monotonic_Get_status+0xb8> const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; ffc33994: 7d 6b 48 10 subfc r11,r11,r9 ffc33998: 7d 4a 41 10 subfe r10,r10,r8 ffc3399c: 91 5c 00 00 stw r10,0(r28) ffc339a0: 91 7c 00 04 stw r11,4(r28) if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; ffc339a4: 38 60 00 01 li r3,1 ffc339a8: 48 00 00 08 b ffc339b0 <_Rate_monotonic_Get_status+0xbc> /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) return false; ffc339ac: 38 60 00 00 li r3,0 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } ffc339b0: 39 61 00 28 addi r11,r1,40 ffc339b4: 48 01 fe 3c b ffc537f0 <_restgpr_28_x> =============================================================================== ffc33d50 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { ffc33d50: 7c 2b 0b 78 mr r11,r1 ffc33d54: 94 21 ff e0 stwu r1,-32(r1) ffc33d58: 7c 08 02 a6 mflr r0 ffc33d5c: 7c 64 1b 78 mr r4,r3 ffc33d60: 3c 60 00 00 lis r3,0 ffc33d64: 48 01 fa 4d bl ffc537b0 <_savegpr_31> ffc33d68: 38 63 67 e0 addi r3,r3,26592 ffc33d6c: 90 01 00 24 stw r0,36(r1) ffc33d70: 38 a1 00 08 addi r5,r1,8 ffc33d74: 4b fd 5e 31 bl ffc09ba4 <_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 ) { ffc33d78: 81 21 00 08 lwz r9,8(r1) ffc33d7c: 2f 89 00 00 cmpwi cr7,r9,0 ffc33d80: 40 9e 00 88 bne- cr7,ffc33e08 <_Rate_monotonic_Timeout+0xb8><== NEVER TAKEN ffc33d84: 7c 7f 1b 78 mr r31,r3 case OBJECTS_LOCAL: the_thread = the_period->owner; ffc33d88: 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); ffc33d8c: 81 23 00 10 lwz r9,16(r3) if ( _States_Is_waiting_for_period( the_thread->current_state ) && ffc33d90: 71 2a 40 00 andi. r10,r9,16384 ffc33d94: 41 82 00 24 beq- ffc33db8 <_Rate_monotonic_Timeout+0x68> ffc33d98: 81 43 00 20 lwz r10,32(r3) ffc33d9c: 81 3f 00 08 lwz r9,8(r31) ffc33da0: 7f 8a 48 00 cmpw cr7,r10,r9 ffc33da4: 40 be 00 14 bne+ cr7,ffc33db8 <_Rate_monotonic_Timeout+0x68> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); ffc33da8: 3c 80 10 07 lis r4,4103 ffc33dac: 60 84 ff f8 ori r4,r4,65528 ffc33db0: 4b fd 67 ed bl ffc0a59c <_Thread_Clear_state> ffc33db4: 48 00 00 18 b ffc33dcc <_Rate_monotonic_Timeout+0x7c> _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 ) { ffc33db8: 81 3f 00 38 lwz r9,56(r31) ffc33dbc: 2f 89 00 01 cmpwi cr7,r9,1 ffc33dc0: 40 be 00 30 bne+ cr7,ffc33df0 <_Rate_monotonic_Timeout+0xa0> the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; ffc33dc4: 39 20 00 03 li r9,3 ffc33dc8: 91 3f 00 38 stw r9,56(r31) _Rate_monotonic_Initiate_statistics( the_period ); ffc33dcc: 7f e3 fb 78 mr r3,r31 ffc33dd0: 4b ff fd 15 bl ffc33ae4 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; ffc33dd4: 81 3f 00 3c lwz r9,60(r31) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc33dd8: 3c 60 00 00 lis r3,0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; ffc33ddc: 91 3f 00 1c stw r9,28(r31) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc33de0: 38 63 64 88 addi r3,r3,25736 ffc33de4: 38 9f 00 10 addi r4,r31,16 ffc33de8: 4b fd 78 fd bl ffc0b6e4 <_Watchdog_Insert> ffc33dec: 48 00 00 0c b ffc33df8 <_Rate_monotonic_Timeout+0xa8> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; ffc33df0: 39 20 00 04 li r9,4 ffc33df4: 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; ffc33df8: 3d 20 00 00 lis r9,0 ffc33dfc: 81 49 34 80 lwz r10,13440(r9) --level; ffc33e00: 39 4a ff ff addi r10,r10,-1 _Thread_Dispatch_disable_level = level; ffc33e04: 91 49 34 80 stw r10,13440(r9) case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } ffc33e08: 39 61 00 20 addi r11,r1,32 ffc33e0c: 48 01 f9 f0 b ffc537fc <_restgpr_31_x> =============================================================================== ffc339b8 <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { ffc339b8: 7c 2b 0b 78 mr r11,r1 ffc339bc: 7c 08 02 a6 mflr r0 ffc339c0: 94 21 ff e0 stwu r1,-32(r1) ffc339c4: 90 01 00 24 stw r0,36(r1) ffc339c8: 48 01 fd e9 bl ffc537b0 <_savegpr_31> ffc339cc: 7c 7f 1b 78 mr r31,r3 /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; ffc339d0: 81 23 00 58 lwz r9,88(r3) ffc339d4: 39 29 00 01 addi r9,r9,1 ffc339d8: 91 23 00 58 stw r9,88(r3) if ( the_period->state == RATE_MONOTONIC_EXPIRED ) ffc339dc: 81 23 00 38 lwz r9,56(r3) ffc339e0: 2f 89 00 04 cmpwi cr7,r9,4 ffc339e4: 40 be 00 10 bne+ cr7,ffc339f4 <_Rate_monotonic_Update_statistics+0x3c> stats->missed_count++; ffc339e8: 81 23 00 5c lwz r9,92(r3) ffc339ec: 39 29 00 01 addi r9,r9,1 ffc339f0: 91 23 00 5c stw r9,92(r3) /* * Grab status for time statistics. */ valid_status = ffc339f4: 7f e3 fb 78 mr r3,r31 ffc339f8: 38 81 00 08 addi r4,r1,8 ffc339fc: 38 a1 00 10 addi r5,r1,16 ffc33a00: 4b ff fe f5 bl ffc338f4 <_Rate_monotonic_Get_status> _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) ffc33a04: 2f 83 00 00 cmpwi cr7,r3,0 ffc33a08: 41 9e 00 d4 beq- cr7,ffc33adc <_Rate_monotonic_Update_statistics+0x124> /* * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); ffc33a0c: 81 41 00 10 lwz r10,16(r1) static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; ffc33a10: 81 1f 00 70 lwz r8,112(r31) ffc33a14: 81 3f 00 74 lwz r9,116(r31) ffc33a18: 81 61 00 14 lwz r11,20(r1) ffc33a1c: 7d 29 58 14 addc r9,r9,r11 ffc33a20: 7d 08 51 14 adde r8,r8,r10 ffc33a24: 91 3f 00 74 stw r9,116(r31) if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) ffc33a28: 81 3f 00 60 lwz r9,96(r31) ffc33a2c: 91 1f 00 70 stw r8,112(r31) ffc33a30: 7f 89 50 00 cmpw cr7,r9,r10 ffc33a34: 41 9d 00 14 bgt- cr7,ffc33a48 <_Rate_monotonic_Update_statistics+0x90> ffc33a38: 40 9e 00 18 bne- cr7,ffc33a50 <_Rate_monotonic_Update_statistics+0x98><== NEVER TAKEN ffc33a3c: 81 3f 00 64 lwz r9,100(r31) ffc33a40: 7f 89 58 40 cmplw cr7,r9,r11 ffc33a44: 40 9d 00 0c ble- cr7,ffc33a50 <_Rate_monotonic_Update_statistics+0x98> stats->min_cpu_time = executed; ffc33a48: 91 5f 00 60 stw r10,96(r31) ffc33a4c: 91 7f 00 64 stw r11,100(r31) if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) ffc33a50: 81 3f 00 68 lwz r9,104(r31) ffc33a54: 7f 89 50 00 cmpw cr7,r9,r10 ffc33a58: 41 9c 00 14 blt- cr7,ffc33a6c <_Rate_monotonic_Update_statistics+0xb4><== NEVER TAKEN ffc33a5c: 40 9e 00 18 bne- cr7,ffc33a74 <_Rate_monotonic_Update_statistics+0xbc><== NEVER TAKEN ffc33a60: 81 3f 00 6c lwz r9,108(r31) ffc33a64: 7f 89 58 40 cmplw cr7,r9,r11 ffc33a68: 40 9c 00 0c bge- cr7,ffc33a74 <_Rate_monotonic_Update_statistics+0xbc> stats->max_cpu_time = executed; ffc33a6c: 91 5f 00 68 stw r10,104(r31) ffc33a70: 91 7f 00 6c stw r11,108(r31) /* * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); ffc33a74: 81 41 00 08 lwz r10,8(r1) ffc33a78: 81 1f 00 88 lwz r8,136(r31) ffc33a7c: 81 3f 00 8c lwz r9,140(r31) ffc33a80: 81 61 00 0c lwz r11,12(r1) ffc33a84: 7d 29 58 14 addc r9,r9,r11 ffc33a88: 7d 08 51 14 adde r8,r8,r10 ffc33a8c: 91 3f 00 8c stw r9,140(r31) if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) ffc33a90: 81 3f 00 78 lwz r9,120(r31) ffc33a94: 91 1f 00 88 stw r8,136(r31) ffc33a98: 7f 89 50 00 cmpw cr7,r9,r10 ffc33a9c: 41 9d 00 14 bgt- cr7,ffc33ab0 <_Rate_monotonic_Update_statistics+0xf8> ffc33aa0: 40 9e 00 18 bne- cr7,ffc33ab8 <_Rate_monotonic_Update_statistics+0x100><== NEVER TAKEN ffc33aa4: 81 3f 00 7c lwz r9,124(r31) ffc33aa8: 7f 89 58 40 cmplw cr7,r9,r11 ffc33aac: 40 9d 00 0c ble- cr7,ffc33ab8 <_Rate_monotonic_Update_statistics+0x100> stats->min_wall_time = since_last_period; ffc33ab0: 91 5f 00 78 stw r10,120(r31) ffc33ab4: 91 7f 00 7c stw r11,124(r31) if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) ffc33ab8: 81 3f 00 80 lwz r9,128(r31) ffc33abc: 7f 89 50 00 cmpw cr7,r9,r10 ffc33ac0: 41 bc 00 14 blt+ cr7,ffc33ad4 <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN ffc33ac4: 40 9e 00 18 bne- cr7,ffc33adc <_Rate_monotonic_Update_statistics+0x124> ffc33ac8: 81 3f 00 84 lwz r9,132(r31) ffc33acc: 7f 89 58 40 cmplw cr7,r9,r11 ffc33ad0: 40 9c 00 0c bge- cr7,ffc33adc <_Rate_monotonic_Update_statistics+0x124> stats->max_wall_time = since_last_period; ffc33ad4: 91 5f 00 80 stw r10,128(r31) ffc33ad8: 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 } ffc33adc: 39 61 00 20 addi r11,r1,32 ffc33ae0: 48 01 fd 1c b ffc537fc <_restgpr_31_x> =============================================================================== ffc0b03c <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { ffc0b03c: 7c 2b 0b 78 mr r11,r1 ffc0b040: 94 21 ff f0 stwu r1,-16(r1) ffc0b044: 7c 08 02 a6 mflr r0 ffc0b048: 48 01 0a b5 bl ffc1bafc <_savegpr_31> ffc0b04c: 7c 7f 1b 78 mr r31,r3 void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); ffc0b050: 38 60 00 1c li r3,28 #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { ffc0b054: 90 01 00 14 stw r0,20(r1) void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); ffc0b058: 48 00 1c 7d bl ffc0ccd4 <_Workspace_Allocate> if ( sched ) { ffc0b05c: 2c 03 00 00 cmpwi r3,0 ffc0b060: 41 82 00 1c beq- ffc0b07c <_Scheduler_CBS_Allocate+0x40><== 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; ffc0b064: 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; ffc0b068: 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; ffc0b06c: 91 43 00 14 stw r10,20(r3) schinfo->cbs_server = NULL; ffc0b070: 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; ffc0b074: 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; ffc0b078: 91 43 00 18 stw r10,24(r3) } return sched; } ffc0b07c: 39 61 00 10 addi r11,r1,16 ffc0b080: 4b ff 5b 4c b ffc00bcc <_restgpr_31_x> =============================================================================== ffc0c6f8 <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { ffc0c6f8: 7c 2b 0b 78 mr r11,r1 ffc0c6fc: 7c 08 02 a6 mflr r0 ffc0c700: 94 21 ff e0 stwu r1,-32(r1) ffc0c704: 90 01 00 24 stw r0,36(r1) ffc0c708: 48 01 0b 09 bl ffc1d210 <_savegpr_31> ffc0c70c: 7c 7f 1b 78 mr r31,r3 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; ffc0c710: 80 83 00 ac lwz r4,172(r3) if ( the_thread->real_priority != new_priority ) ffc0c714: 81 23 00 18 lwz r9,24(r3) ffc0c718: 7f 89 20 00 cmpw cr7,r9,r4 ffc0c71c: 41 9e 00 08 beq- cr7,ffc0c724 <_Scheduler_CBS_Budget_callout+0x2c><== NEVER TAKEN the_thread->real_priority = new_priority; ffc0c720: 90 83 00 18 stw r4,24(r3) if ( the_thread->current_priority != new_priority ) ffc0c724: 81 3f 00 14 lwz r9,20(r31) ffc0c728: 7f 89 20 00 cmpw cr7,r9,r4 ffc0c72c: 41 9e 00 10 beq- cr7,ffc0c73c <_Scheduler_CBS_Budget_callout+0x44><== NEVER TAKEN _Thread_Change_priority(the_thread, new_priority, true); ffc0c730: 7f e3 fb 78 mr r3,r31 ffc0c734: 38 a0 00 01 li r5,1 ffc0c738: 48 00 06 61 bl ffc0cd98 <_Thread_Change_priority> /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; ffc0c73c: 83 ff 00 88 lwz r31,136(r31) if ( sched_info->cbs_server->cbs_budget_overrun ) { ffc0c740: 81 3f 00 18 lwz r9,24(r31) ffc0c744: 81 49 00 0c lwz r10,12(r9) ffc0c748: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0c74c: 41 9e 00 24 beq- cr7,ffc0c770 <_Scheduler_CBS_Budget_callout+0x78><== NEVER TAKEN _Scheduler_CBS_Get_server_id( ffc0c750: 80 69 00 00 lwz r3,0(r9) ffc0c754: 38 81 00 08 addi r4,r1,8 ffc0c758: 4b ff ff 49 bl ffc0c6a0 <_Scheduler_CBS_Get_server_id> sched_info->cbs_server->task_id, &server_id ); sched_info->cbs_server->cbs_budget_overrun( server_id ); ffc0c75c: 81 3f 00 18 lwz r9,24(r31) ffc0c760: 80 61 00 08 lwz r3,8(r1) ffc0c764: 81 29 00 0c lwz r9,12(r9) ffc0c768: 7d 29 03 a6 mtctr r9 ffc0c76c: 4e 80 04 21 bctrl } } ffc0c770: 39 61 00 20 addi r11,r1,32 ffc0c774: 4b ff 51 44 b ffc018b8 <_restgpr_31_x> =============================================================================== ffc0c2b4 <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { ffc0c2b4: 94 21 ff e0 stwu r1,-32(r1) ffc0c2b8: 7c 08 02 a6 mflr r0 ffc0c2bc: 90 01 00 24 stw r0,36(r1) unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || ffc0c2c0: 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 ) { ffc0c2c4: bf 41 00 08 stmw r26,8(r1) ffc0c2c8: 7c 7f 1b 78 mr r31,r3 unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || ffc0c2cc: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c2d0: 40 9d 00 7c ble- cr7,ffc0c34c <_Scheduler_CBS_Create_server+0x98> ffc0c2d4: 81 23 00 00 lwz r9,0(r3) ffc0c2d8: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c2dc: 40 9d 00 70 ble- cr7,ffc0c34c <_Scheduler_CBS_Create_server+0x98> 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++ ) { ffc0c2e0: 3d 20 00 00 lis r9,0 ffc0c2e4: 81 49 27 94 lwz r10,10132(r9) if ( !_Scheduler_CBS_Server_list[i] ) ffc0c2e8: 3d 20 00 00 lis r9,0 ffc0c2ec: 81 09 28 b0 lwz r8,10416(r9) ffc0c2f0: 7c 9a 23 78 mr r26,r4 ffc0c2f4: 39 4a 00 01 addi r10,r10,1 ffc0c2f8: 7c bd 2b 78 mr r29,r5 ffc0c2fc: 7d 49 03 a6 mtctr r10 ffc0c300: 39 20 00 00 li r9,0 ffc0c304: 48 00 00 18 b ffc0c31c <_Scheduler_CBS_Create_server+0x68> #include #include #include #include int _Scheduler_CBS_Create_server ( ffc0c308: 55 3c 10 3a rlwinm r28,r9,2,0,29 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] ) ffc0c30c: 7d 48 e0 2e lwzx r10,r8,r28 ffc0c310: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0c314: 41 9e 00 48 beq- cr7,ffc0c35c <_Scheduler_CBS_Create_server+0xa8> 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++ ) { ffc0c318: 39 29 00 01 addi r9,r9,1 ffc0c31c: 42 00 ff ec bdnz+ ffc0c308 <_Scheduler_CBS_Create_server+0x54> if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; ffc0c320: 38 60 ff e6 li r3,-26 ffc0c324: 48 00 00 6c b ffc0c390 <_Scheduler_CBS_Create_server+0xdc> _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; ffc0c328: 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; ffc0c32c: 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; ffc0c330: 81 7f 00 04 lwz r11,4(r31) ffc0c334: 91 49 00 04 stw r10,4(r9) the_server->task_id = -1; ffc0c338: 39 40 ff ff li r10,-1 _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; ffc0c33c: 91 69 00 08 stw r11,8(r9) the_server->task_id = -1; ffc0c340: 91 49 00 00 stw r10,0(r9) the_server->cbs_budget_overrun = budget_overrun_callback; ffc0c344: 93 49 00 0c stw r26,12(r9) return SCHEDULER_CBS_OK; ffc0c348: 48 00 00 48 b ffc0c390 <_Scheduler_CBS_Create_server+0xdc> 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; ffc0c34c: 38 60 ff ee li r3,-18 ffc0c350: 48 00 00 40 b ffc0c390 <_Scheduler_CBS_Create_server+0xdc> *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; ffc0c354: 38 60 ff ef li r3,-17 <== NOT EXECUTED ffc0c358: 48 00 00 38 b ffc0c390 <_Scheduler_CBS_Create_server+0xdc><== NOT EXECUTED } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; ffc0c35c: 91 3d 00 00 stw r9,0(r29) _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) ffc0c360: 3f c0 00 00 lis r30,0 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); ffc0c364: 38 60 00 10 li r3,16 if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) ffc0c368: 83 7e 28 b0 lwz r27,10416(r30) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); ffc0c36c: 48 00 20 7d bl ffc0e3e8 <_Workspace_Allocate> the_server = _Scheduler_CBS_Server_list[*server_id]; ffc0c370: 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 *) ffc0c374: 7c 7b e1 2e stwx r3,r27,r28 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; ffc0c378: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0c37c: 81 5e 28 b0 lwz r10,10416(r30) ffc0c380: 7d 2a 48 2e lwzx r9,r10,r9 if ( !the_server ) ffc0c384: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c388: 40 9e ff a0 bne+ cr7,ffc0c328 <_Scheduler_CBS_Create_server+0x74><== ALWAYS TAKEN ffc0c38c: 4b ff ff c8 b ffc0c354 <_Scheduler_CBS_Create_server+0xa0><== NOT EXECUTED the_server->parameters = *params; the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } ffc0c390: 39 61 00 20 addi r11,r1,32 ffc0c394: 4b ff 55 10 b ffc018a4 <_restgpr_26_x> =============================================================================== ffc0c41c <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { ffc0c41c: 94 21 ff d8 stwu r1,-40(r1) ffc0c420: 7c 08 02 a6 mflr r0 ffc0c424: bf a1 00 1c stmw r29,28(r1) ffc0c428: 7c 7d 1b 78 mr r29,r3 ffc0c42c: 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); ffc0c430: 7c 83 23 78 mr r3,r4 int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { ffc0c434: 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); ffc0c438: 38 81 00 08 addi r4,r1,8 ffc0c43c: 48 00 0e bd bl ffc0d2f8 <_Thread_Get> /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { ffc0c440: 7c 7f 1b 79 mr. r31,r3 ffc0c444: 41 82 00 08 beq- ffc0c44c <_Scheduler_CBS_Detach_thread+0x30> _Thread_Enable_dispatch(); ffc0c448: 48 00 0e 95 bl ffc0d2dc <_Thread_Enable_dispatch> } if ( server_id >= _Scheduler_CBS_Maximum_servers ) ffc0c44c: 3d 20 00 00 lis r9,0 ffc0c450: 81 29 27 94 lwz r9,10132(r9) ffc0c454: 7f 9d 48 40 cmplw cr7,r29,r9 ffc0c458: 40 9c 00 6c bge- cr7,ffc0c4c4 <_Scheduler_CBS_Detach_thread+0xa8> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) ffc0c45c: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0c460: 41 9e 00 64 beq- cr7,ffc0c4c4 <_Scheduler_CBS_Detach_thread+0xa8> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) ffc0c464: 3d 20 00 00 lis r9,0 ffc0c468: 81 29 28 b0 lwz r9,10416(r9) ffc0c46c: 57 bd 10 3a rlwinm r29,r29,2,0,29 ffc0c470: 7d 29 e8 2e lwzx r9,r9,r29 ffc0c474: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c478: 41 9e 00 44 beq- cr7,ffc0c4bc <_Scheduler_CBS_Detach_thread+0xa0> return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) ffc0c47c: 81 49 00 00 lwz r10,0(r9) ffc0c480: 7f 8a f0 00 cmpw cr7,r10,r30 ffc0c484: 40 9e 00 40 bne- cr7,ffc0c4c4 <_Scheduler_CBS_Detach_thread+0xa8><== NEVER TAKEN return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; ffc0c488: 39 40 ff ff li r10,-1 ffc0c48c: 91 49 00 00 stw r10,0(r9) sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; ffc0c490: 39 40 00 00 li r10,0 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; ffc0c494: 38 60 00 00 li r3,0 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; ffc0c498: 81 3f 00 88 lwz r9,136(r31) ffc0c49c: 91 49 00 18 stw r10,24(r9) the_thread->budget_algorithm = the_thread->Start.budget_algorithm; ffc0c4a0: 81 3f 00 a0 lwz r9,160(r31) ffc0c4a4: 91 3f 00 78 stw r9,120(r31) the_thread->budget_callout = the_thread->Start.budget_callout; ffc0c4a8: 81 3f 00 a4 lwz r9,164(r31) ffc0c4ac: 91 3f 00 7c stw r9,124(r31) the_thread->is_preemptible = the_thread->Start.is_preemptible; ffc0c4b0: 89 3f 00 9c lbz r9,156(r31) ffc0c4b4: 99 3f 00 70 stb r9,112(r31) ffc0c4b8: 48 00 00 10 b ffc0c4c8 <_Scheduler_CBS_Detach_thread+0xac> 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; ffc0c4bc: 38 60 ff e7 li r3,-25 ffc0c4c0: 48 00 00 08 b ffc0c4c8 <_Scheduler_CBS_Detach_thread+0xac> if ( the_thread ) { _Thread_Enable_dispatch(); } if ( server_id >= _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; ffc0c4c4: 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; } ffc0c4c8: 39 61 00 28 addi r11,r1,40 ffc0c4cc: 4b ff 53 e4 b ffc018b0 <_restgpr_29_x> =============================================================================== ffc0c778 <_Scheduler_CBS_Initialize>: int _Scheduler_CBS_Initialize(void) { ffc0c778: 7c 2b 0b 78 mr r11,r1 ffc0c77c: 94 21 ff f0 stwu r1,-16(r1) ffc0c780: 7c 08 02 a6 mflr r0 ffc0c784: 48 01 0a 8d bl ffc1d210 <_savegpr_31> unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); ffc0c788: 3f e0 00 00 lis r31,0 ffc0c78c: 80 7f 27 94 lwz r3,10132(r31) sched_info->cbs_server->cbs_budget_overrun( server_id ); } } int _Scheduler_CBS_Initialize(void) { ffc0c790: 90 01 00 14 stw r0,20(r1) unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( ffc0c794: 54 63 10 3a rlwinm r3,r3,2,0,29 ffc0c798: 48 00 1c 51 bl ffc0e3e8 <_Workspace_Allocate> ffc0c79c: 3d 40 00 00 lis r10,0 _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) ffc0c7a0: 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( ffc0c7a4: 90 6a 28 b0 stw r3,10416(r10) _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) ffc0c7a8: 41 9e 00 38 beq- cr7,ffc0c7e0 <_Scheduler_CBS_Initialize+0x68><== NEVER TAKEN return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { ffc0c7ac: 81 1f 27 94 lwz r8,10132(r31) ffc0c7b0: 39 20 00 00 li r9,0 _Scheduler_CBS_Server_list[i] = NULL; ffc0c7b4: 38 e0 00 00 li r7,0 ffc0c7b8: 39 08 00 01 addi r8,r8,1 ffc0c7bc: 7d 09 03 a6 mtctr r8 ffc0c7c0: 48 00 00 14 b ffc0c7d4 <_Scheduler_CBS_Initialize+0x5c> ffc0c7c4: 81 0a 28 b0 lwz r8,10416(r10) ffc0c7c8: 55 26 10 3a rlwinm r6,r9,2,0,29 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++) { ffc0c7cc: 39 29 00 01 addi r9,r9,1 _Scheduler_CBS_Server_list[i] = NULL; ffc0c7d0: 7c e8 31 2e stwx r7,r8,r6 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++) { ffc0c7d4: 42 00 ff f0 bdnz+ ffc0c7c4 <_Scheduler_CBS_Initialize+0x4c> _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; ffc0c7d8: 38 60 00 00 li r3,0 ffc0c7dc: 48 00 00 08 b ffc0c7e4 <_Scheduler_CBS_Initialize+0x6c> { 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; ffc0c7e0: 38 60 ff ef li r3,-17 <== NOT EXECUTED for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; } ffc0c7e4: 39 61 00 10 addi r11,r1,16 ffc0c7e8: 4b ff 50 d0 b ffc018b8 <_restgpr_31_x> =============================================================================== ffc0b084 <_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) { ffc0b084: 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; ffc0b088: 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 = ffc0b08c: 81 29 00 18 lwz r9,24(r9) ffc0b090: 2f 89 00 00 cmpwi cr7,r9,0 (Scheduler_CBS_Server *) sched_info->cbs_server; if (deadline) { ffc0b094: 41 82 00 30 beq- ffc0b0c4 <_Scheduler_CBS_Release_job+0x40> ffc0b098: 3d 40 00 00 lis r10,0 /* Initializing or shifting deadline. */ if (serv_info) ffc0b09c: 41 9e 00 18 beq- cr7,ffc0b0b4 <_Scheduler_CBS_Release_job+0x30> new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) ffc0b0a0: 80 8a 28 a4 lwz r4,10404(r10) ffc0b0a4: 81 49 00 04 lwz r10,4(r9) ffc0b0a8: 7c 84 52 14 add r4,r4,r10 ffc0b0ac: 54 84 00 7e clrlwi r4,r4,1 ffc0b0b0: 48 00 00 1c b ffc0b0cc <_Scheduler_CBS_Release_job+0x48> & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) ffc0b0b4: 81 2a 28 a4 lwz r9,10404(r10) ffc0b0b8: 7c 84 4a 14 add r4,r4,r9 ffc0b0bc: 54 84 00 7e clrlwi r4,r4,1 ffc0b0c0: 48 00 00 14 b ffc0b0d4 <_Scheduler_CBS_Release_job+0x50> & ~SCHEDULER_EDF_PRIO_MSB; } else { /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; ffc0b0c4: 80 83 00 ac lwz r4,172(r3) } /* Budget replenishment for the next job. */ if (serv_info) ffc0b0c8: 41 9e 00 0c beq- cr7,ffc0b0d4 <_Scheduler_CBS_Release_job+0x50><== NEVER TAKEN the_thread->cpu_time_budget = serv_info->parameters.budget; ffc0b0cc: 81 29 00 08 lwz r9,8(r9) ffc0b0d0: 91 23 00 74 stw r9,116(r3) the_thread->real_priority = new_priority; ffc0b0d4: 90 83 00 18 stw r4,24(r3) _Thread_Change_priority(the_thread, new_priority, true); ffc0b0d8: 38 a0 00 01 li r5,1 ffc0b0dc: 48 00 04 ec b ffc0b5c8 <_Thread_Change_priority> =============================================================================== ffc0b0e0 <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { ffc0b0e0: 94 21 ff f0 stwu r1,-16(r1) ffc0b0e4: 7c 08 02 a6 mflr r0 ffc0b0e8: bf c1 00 08 stmw r30,8(r1) ffc0b0ec: 7c 7f 1b 78 mr r31,r3 ffc0b0f0: 90 01 00 14 stw r0,20(r1) Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server *serv_info; Priority_Control new_priority; _Scheduler_EDF_Enqueue(the_thread); ffc0b0f4: 48 00 01 1d bl ffc0b210 <_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; ffc0b0f8: 81 3f 00 88 lwz r9,136(r31) ffc0b0fc: 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) { ffc0b100: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b104: 41 9e 00 58 beq- cr7,ffc0b15c <_Scheduler_CBS_Unblock+0x7c> 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 - ffc0b108: 3d 00 00 00 lis r8,0 ffc0b10c: 81 5f 00 18 lwz r10,24(r31) ffc0b110: 80 e8 28 a4 lwz r7,10404(r8) _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { ffc0b114: 81 09 00 04 lwz r8,4(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 - ffc0b118: 7c e7 50 50 subf r7,r7,r10 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { ffc0b11c: 7d 07 41 d6 mullw r8,r7,r8 ffc0b120: 80 e9 00 08 lwz r7,8(r9) ffc0b124: 81 3f 00 74 lwz r9,116(r31) ffc0b128: 7d 27 49 d6 mullw r9,r7,r9 ffc0b12c: 7f 88 48 00 cmpw cr7,r8,r9 ffc0b130: 40 9d 00 2c ble- cr7,ffc0b15c <_Scheduler_CBS_Unblock+0x7c> /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; ffc0b134: 80 9f 00 ac lwz r4,172(r31) if ( the_thread->real_priority != new_priority ) ffc0b138: 7f 8a 20 00 cmpw cr7,r10,r4 ffc0b13c: 41 9e 00 08 beq- cr7,ffc0b144 <_Scheduler_CBS_Unblock+0x64> the_thread->real_priority = new_priority; ffc0b140: 90 9f 00 18 stw r4,24(r31) if ( the_thread->current_priority != new_priority ) ffc0b144: 81 3f 00 14 lwz r9,20(r31) ffc0b148: 7f 89 20 00 cmpw cr7,r9,r4 ffc0b14c: 41 9e 00 10 beq- cr7,ffc0b15c <_Scheduler_CBS_Unblock+0x7c> _Thread_Change_priority(the_thread, new_priority, true); ffc0b150: 7f e3 fb 78 mr r3,r31 ffc0b154: 38 a0 00 01 li r5,1 ffc0b158: 48 00 04 71 bl ffc0b5c8 <_Thread_Change_priority> * 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, ffc0b15c: 3f c0 00 00 lis r30,0 ffc0b160: 80 7f 00 14 lwz r3,20(r31) ffc0b164: 3b de 2e 80 addi r30,r30,11904 ffc0b168: 3d 40 00 00 lis r10,0 ffc0b16c: 81 3e 00 14 lwz r9,20(r30) ffc0b170: 81 4a 20 b0 lwz r10,8368(r10) ffc0b174: 80 89 00 14 lwz r4,20(r9) ffc0b178: 7d 49 03 a6 mtctr r10 ffc0b17c: 4e 80 04 21 bctrl ffc0b180: 2f 83 00 00 cmpwi cr7,r3,0 ffc0b184: 40 9d 00 34 ble- cr7,ffc0b1b8 <_Scheduler_CBS_Unblock+0xd8> _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || ffc0b188: 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; ffc0b18c: 93 fe 00 14 stw r31,20(r30) if ( _Thread_Executing->is_preemptible || ffc0b190: 89 29 00 70 lbz r9,112(r9) ffc0b194: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b198: 40 9e 00 10 bne- cr7,ffc0b1a8 <_Scheduler_CBS_Unblock+0xc8> ffc0b19c: 81 3f 00 14 lwz r9,20(r31) ffc0b1a0: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b1a4: 40 9e 00 14 bne- cr7,ffc0b1b8 <_Scheduler_CBS_Unblock+0xd8><== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; ffc0b1a8: 3d 20 00 00 lis r9,0 ffc0b1ac: 39 40 00 01 li r10,1 ffc0b1b0: 39 29 2e 80 addi r9,r9,11904 ffc0b1b4: 99 49 00 0c stb r10,12(r9) } } ffc0b1b8: 39 61 00 10 addi r11,r1,16 ffc0b1bc: 4b ff 5a 0c b ffc00bc8 <_restgpr_30_x> =============================================================================== ffc0b03c <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { ffc0b03c: 7c 2b 0b 78 mr r11,r1 ffc0b040: 94 21 ff f0 stwu r1,-16(r1) ffc0b044: 7c 08 02 a6 mflr r0 ffc0b048: 48 01 0a 19 bl ffc1ba60 <_savegpr_31> ffc0b04c: 7c 7f 1b 78 mr r31,r3 void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); ffc0b050: 38 60 00 18 li r3,24 #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { ffc0b054: 90 01 00 14 stw r0,20(r1) void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); ffc0b058: 48 00 1b e1 bl ffc0cc38 <_Workspace_Allocate> if ( sched ) { ffc0b05c: 2c 03 00 00 cmpwi r3,0 ffc0b060: 41 82 00 14 beq- ffc0b074 <_Scheduler_EDF_Allocate+0x38><== 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; ffc0b064: 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; ffc0b068: 90 7f 00 88 stw r3,136(r31) schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; ffc0b06c: 93 e3 00 00 stw r31,0(r3) schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; ffc0b070: 91 43 00 14 stw r10,20(r3) } return sched; } ffc0b074: 39 61 00 10 addi r11,r1,16 ffc0b078: 4b ff 5b 54 b ffc00bcc <_restgpr_31_x> =============================================================================== ffc0b23c <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { ffc0b23c: 94 21 ff f0 stwu r1,-16(r1) ffc0b240: 7c 08 02 a6 mflr r0 ffc0b244: bf c1 00 08 stmw r30,8(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( ffc0b248: 3f c0 00 00 lis r30,0 #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { ffc0b24c: 7c 7f 1b 78 mr r31,r3 ffc0b250: 90 01 00 14 stw r0,20(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( ffc0b254: 3b de 2e 80 addi r30,r30,11904 void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { _Scheduler_EDF_Enqueue(the_thread); ffc0b258: 4b ff fe 75 bl ffc0b0cc <_Scheduler_EDF_Enqueue> ffc0b25c: 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( ffc0b260: 81 5e 00 14 lwz r10,20(r30) ffc0b264: 81 29 20 b0 lwz r9,8368(r9) ffc0b268: 80 6a 00 14 lwz r3,20(r10) ffc0b26c: 80 9f 00 14 lwz r4,20(r31) ffc0b270: 7d 29 03 a6 mtctr r9 ffc0b274: 4e 80 04 21 bctrl ffc0b278: 2f 83 00 00 cmpwi cr7,r3,0 ffc0b27c: 40 bc 00 34 bge+ cr7,ffc0b2b0 <_Scheduler_EDF_Unblock+0x74> _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || ffc0b280: 81 3e 00 10 lwz r9,16(r30) * 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; ffc0b284: 93 fe 00 14 stw r31,20(r30) if ( _Thread_Executing->is_preemptible || ffc0b288: 89 29 00 70 lbz r9,112(r9) ffc0b28c: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b290: 40 9e 00 10 bne- cr7,ffc0b2a0 <_Scheduler_EDF_Unblock+0x64> ffc0b294: 81 3f 00 14 lwz r9,20(r31) ffc0b298: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b29c: 40 9e 00 14 bne- cr7,ffc0b2b0 <_Scheduler_EDF_Unblock+0x74><== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; ffc0b2a0: 3d 20 00 00 lis r9,0 ffc0b2a4: 39 40 00 01 li r10,1 ffc0b2a8: 39 29 2e 80 addi r9,r9,11904 ffc0b2ac: 99 49 00 0c stb r10,12(r9) } } ffc0b2b0: 39 61 00 10 addi r11,r1,16 ffc0b2b4: 4b ff 59 14 b ffc00bc8 <_restgpr_30_x> =============================================================================== ffc0a67c <_Scheduler_priority_Block>: ) { Scheduler_priority_Per_thread *sched_info; Chain_Control *ready; sched_info = (Scheduler_priority_Per_thread *) the_thread->scheduler_info; ffc0a67c: 81 43 00 88 lwz r10,136(r3) ready = sched_info->ready_chain; ffc0a680: 81 2a 00 00 lwz r9,0(r10) if ( _Chain_Has_only_one_node( ready ) ) { ffc0a684: 80 e9 00 00 lwz r7,0(r9) ffc0a688: 81 09 00 08 lwz r8,8(r9) ffc0a68c: 7f 87 40 00 cmpw cr7,r7,r8 ffc0a690: 40 be 00 4c bne+ cr7,ffc0a6dc <_Scheduler_priority_Block+0x60> 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 ); ffc0a694: 39 09 00 04 addi r8,r9,4 head->next = tail; head->previous = NULL; tail->previous = head; ffc0a698: 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; ffc0a69c: 91 09 00 00 stw r8,0(r9) head->previous = NULL; ffc0a6a0: 39 00 00 00 li r8,0 ffc0a6a4: 91 09 00 04 stw r8,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; ffc0a6a8: 81 0a 00 04 lwz r8,4(r10) ffc0a6ac: 81 2a 00 14 lwz r9,20(r10) ffc0a6b0: 80 e8 00 00 lwz r7,0(r8) ffc0a6b4: 7c e9 48 38 and r9,r7,r9 if ( *the_priority_map->minor == 0 ) ffc0a6b8: 2f 89 00 00 cmpwi cr7,r9,0 RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove ( Priority_bit_map_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; ffc0a6bc: 91 28 00 00 stw r9,0(r8) if ( *the_priority_map->minor == 0 ) ffc0a6c0: 40 9e 00 2c bne- cr7,ffc0a6ec <_Scheduler_priority_Block+0x70> _Priority_Major_bit_map &= the_priority_map->block_major; ffc0a6c4: 3d 20 00 00 lis r9,0 ffc0a6c8: 81 4a 00 10 lwz r10,16(r10) ffc0a6cc: 81 09 28 50 lwz r8,10320(r9) ffc0a6d0: 7d 0a 50 38 and r10,r8,r10 ffc0a6d4: 91 49 28 50 stw r10,10320(r9) ffc0a6d8: 48 00 00 14 b ffc0a6ec <_Scheduler_priority_Block+0x70> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; ffc0a6dc: 81 23 00 00 lwz r9,0(r3) previous = the_node->previous; ffc0a6e0: 81 43 00 04 lwz r10,4(r3) next->previous = previous; ffc0a6e4: 91 49 00 04 stw r10,4(r9) previous->next = next; ffc0a6e8: 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 ); ffc0a6ec: 3d 20 00 00 lis r9,0 { _Scheduler_priority_Ready_queue_extract( the_thread ); /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) ffc0a6f0: 81 29 2e 14 lwz r9,11796(r9) ffc0a6f4: 7f 83 48 00 cmpw cr7,r3,r9 ffc0a6f8: 40 be 00 60 bne+ cr7,ffc0a758 <_Scheduler_priority_Block+0xdc> * @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 ffc0a6fc: 3d 20 00 00 lis r9,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 ); ffc0a700: 3c e0 00 00 lis r7,0 ffc0a704: 81 49 20 80 lwz r10,8320(r9) ffc0a708: 81 27 28 50 lwz r9,10320(r7) ffc0a70c: 7d 28 00 34 cntlzw r8,r9 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); ffc0a710: 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 ); ffc0a714: 91 27 28 50 stw r9,10320(r7) _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); ffc0a718: 38 c6 2e 40 addi r6,r6,11840 ffc0a71c: 55 07 10 3a rlwinm r7,r8,2,0,29 ffc0a720: 7d 26 38 2e lwzx r9,r6,r7 ffc0a724: 7d 25 00 34 cntlzw r5,r9 ffc0a728: 7d 26 39 2e stwx r9,r6,r7 return (_Priority_Bits_index( major ) << 4) + ffc0a72c: 55 09 20 36 rlwinm r9,r8,4,0,27 ffc0a730: 7d 29 2a 14 add r9,r9,r5 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) ffc0a734: 1d 29 00 0c mulli r9,r9,12 ffc0a738: 7d 0a 4a 14 add r8,r10,r9 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc0a73c: 7d 2a 48 2e lwzx r9,r10,r9 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); ffc0a740: 39 48 00 04 addi r10,r8,4 ffc0a744: 7f 89 50 00 cmpw cr7,r9,r10 ffc0a748: 40 be 00 08 bne+ cr7,ffc0a750 <_Scheduler_priority_Block+0xd4><== ALWAYS TAKEN return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; ffc0a74c: 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( ffc0a750: 3d 40 00 00 lis r10,0 ffc0a754: 91 2a 2e 14 stw r9,11796(r10) RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); ffc0a758: 3d 20 00 00 lis r9,0 ffc0a75c: 39 29 2e 00 addi r9,r9,11776 _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) ffc0a760: 81 49 00 10 lwz r10,16(r9) ffc0a764: 7f 83 50 00 cmpw cr7,r3,r10 ffc0a768: 4c be 00 20 bnelr+ cr7 _Thread_Dispatch_necessary = true; ffc0a76c: 39 40 00 01 li r10,1 ffc0a770: 99 49 00 0c stb r10,12(r9) ffc0a774: 4e 80 00 20 blr =============================================================================== ffc0a92c <_Scheduler_priority_Schedule>: * @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 ffc0a92c: 3d 20 00 00 lis r9,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 ); ffc0a930: 3c e0 00 00 lis r7,0 ffc0a934: 81 49 20 80 lwz r10,8320(r9) ffc0a938: 81 27 28 50 lwz r9,10320(r7) ffc0a93c: 7d 28 00 34 cntlzw r8,r9 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); ffc0a940: 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 ); ffc0a944: 91 27 28 50 stw r9,10320(r7) _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); ffc0a948: 38 c6 2e 40 addi r6,r6,11840 ffc0a94c: 55 07 10 3a rlwinm r7,r8,2,0,29 ffc0a950: 7d 26 38 2e lwzx r9,r6,r7 ffc0a954: 7d 25 00 34 cntlzw r5,r9 ffc0a958: 7d 26 39 2e stwx r9,r6,r7 return (_Priority_Bits_index( major ) << 4) + ffc0a95c: 55 09 20 36 rlwinm r9,r8,4,0,27 ffc0a960: 7d 29 2a 14 add r9,r9,r5 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) ffc0a964: 1d 29 00 0c mulli r9,r9,12 ffc0a968: 7d 0a 4a 14 add r8,r10,r9 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc0a96c: 7d 2a 48 2e lwzx r9,r10,r9 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); ffc0a970: 39 48 00 04 addi r10,r8,4 ffc0a974: 7f 89 50 00 cmpw cr7,r9,r10 ffc0a978: 40 be 00 08 bne+ cr7,ffc0a980 <_Scheduler_priority_Schedule+0x54><== ALWAYS TAKEN return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; ffc0a97c: 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( ffc0a980: 3d 40 00 00 lis r10,0 ffc0a984: 91 2a 2e 14 stw r9,11796(r10) ffc0a988: 4e 80 00 20 blr =============================================================================== ffc095d4 <_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(); ffc095d4: 3d 20 ff c2 lis r9,-62 ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / ffc095d8: 81 29 cf c4 lwz r9,-12348(r9) ffc095dc: 3d 00 00 0f lis r8,15 ffc095e0: 61 08 42 40 ori r8,r8,16960 ffc095e4: 7d 08 4b 96 divwu r8,r8,r9 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || ffc095e8: 7c 69 1b 79 mr. r9,r3 ffc095ec: 41 82 00 90 beq- ffc0967c <_TOD_Validate+0xa8> <== NEVER TAKEN ffc095f0: 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; ffc095f4: 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) || ffc095f8: 7f 8a 40 40 cmplw cr7,r10,r8 ffc095fc: 4c 9c 00 20 bgelr cr7 (the_tod->ticks >= ticks_per_second) || ffc09600: 81 49 00 14 lwz r10,20(r9) ffc09604: 2b 8a 00 3b cmplwi cr7,r10,59 ffc09608: 4d 9d 00 20 bgtlr cr7 (the_tod->second >= TOD_SECONDS_PER_MINUTE) || ffc0960c: 81 49 00 10 lwz r10,16(r9) ffc09610: 2b 8a 00 3b cmplwi cr7,r10,59 ffc09614: 4d 9d 00 20 bgtlr cr7 (the_tod->minute >= TOD_MINUTES_PER_HOUR) || ffc09618: 81 49 00 0c lwz r10,12(r9) ffc0961c: 2b 8a 00 17 cmplwi cr7,r10,23 ffc09620: 4d 9d 00 20 bgtlr cr7 (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || ffc09624: 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) || ffc09628: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0962c: 4d 9e 00 20 beqlr cr7 (the_tod->month == 0) || ffc09630: 2b 8a 00 0c cmplwi cr7,r10,12 ffc09634: 4d 9d 00 20 bgtlr cr7 (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || ffc09638: 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) || ffc0963c: 2b 88 07 c3 cmplwi cr7,r8,1987 ffc09640: 4c 9d 00 20 blelr cr7 (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) ffc09644: 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) || ffc09648: 2f 89 00 00 cmpwi cr7,r9,0 ffc0964c: 4d 9e 00 20 beqlr cr7 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) ffc09650: 71 07 00 03 andi. r7,r8,3 ffc09654: 3c e0 ff c2 lis r7,-62 ffc09658: 39 07 e7 08 addi r8,r7,-6392 ffc0965c: 40 82 00 08 bne- ffc09664 <_TOD_Validate+0x90> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; ffc09660: 39 4a 00 0d addi r10,r10,13 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; ffc09664: 55 4a 10 3a rlwinm r10,r10,2,0,29 ffc09668: 7c 68 50 2e lwzx r3,r8,r10 if ( the_tod->day > days_in_month ) ffc0966c: 7c 69 18 10 subfc r3,r9,r3 ffc09670: 38 60 00 00 li r3,0 ffc09674: 7c 63 19 14 adde r3,r3,r3 ffc09678: 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; ffc0967c: 38 60 00 00 li r3,0 <== NOT EXECUTED if ( the_tod->day > days_in_month ) return false; return true; } ffc09680: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc0ac50 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { ffc0ac50: 94 21 ff e0 stwu r1,-32(r1) ffc0ac54: 7c 08 02 a6 mflr r0 ffc0ac58: 90 01 00 24 stw r0,36(r1) ffc0ac5c: bf 81 00 10 stmw r28,16(r1) ffc0ac60: 7c 7f 1b 78 mr r31,r3 ffc0ac64: 7c bd 2b 78 mr r29,r5 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; ffc0ac68: 83 83 00 10 lwz r28,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 ); ffc0ac6c: 90 81 00 08 stw r4,8(r1) ffc0ac70: 48 00 0e a5 bl ffc0bb14 <_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 ) ffc0ac74: 81 3f 00 14 lwz r9,20(r31) ffc0ac78: 80 81 00 08 lwz r4,8(r1) ffc0ac7c: 7f 89 20 00 cmpw cr7,r9,r4 ffc0ac80: 41 9e 00 0c beq- cr7,ffc0ac8c <_Thread_Change_priority+0x3c> _Thread_Set_priority( the_thread, new_priority ); ffc0ac84: 7f e3 fb 78 mr r3,r31 ffc0ac88: 48 00 0e 1d bl ffc0baa4 <_Thread_Set_priority> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0ac8c: 7f c0 00 a6 mfmsr r30 ffc0ac90: 7d 30 42 a6 mfsprg r9,0 ffc0ac94: 7f c9 48 78 andc r9,r30,r9 ffc0ac98: 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; ffc0ac9c: 81 5f 00 10 lwz r10,16(r31) ffc0aca0: 57 89 07 7a rlwinm r9,r28,0,29,29 if ( state != STATES_TRANSIENT ) { ffc0aca4: 2f 8a 00 04 cmpwi cr7,r10,4 ffc0aca8: 41 9e 00 44 beq- cr7,ffc0acec <_Thread_Change_priority+0x9c> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) ffc0acac: 2f 89 00 00 cmpwi cr7,r9,0 ffc0acb0: 40 9e 00 0c bne- cr7,ffc0acbc <_Thread_Change_priority+0x6c><== NEVER TAKEN RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); ffc0acb4: 55 49 07 b8 rlwinm r9,r10,0,30,28 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); ffc0acb8: 91 3f 00 10 stw r9,16(r31) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0acbc: 7f c0 01 24 mtmsr r30 _ISR_Enable( level ); if ( _States_Is_waiting_on_thread_queue( state ) ) { ffc0acc0: 3d 20 00 03 lis r9,3 ffc0acc4: 61 29 be e0 ori r9,r9,48864 ffc0acc8: 7d 48 48 39 and. r8,r10,r9 ffc0accc: 41 a2 00 a0 beq+ ffc0ad6c <_Thread_Change_priority+0x11c> if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; _ISR_Enable( level ); } ffc0acd0: 80 01 00 24 lwz r0,36(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 ); ffc0acd4: 7f e4 fb 78 mr r4,r31 ffc0acd8: 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 ); } ffc0acdc: 7c 08 03 a6 mtlr r0 ffc0ace0: bb 81 00 10 lmw r28,16(r1) ffc0ace4: 38 21 00 20 addi r1,r1,32 /* 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 ); ffc0ace8: 48 00 0d 04 b ffc0b9ec <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { ffc0acec: 2f 89 00 00 cmpwi cr7,r9,0 ffc0acf0: 40 9e 00 30 bne- cr7,ffc0ad20 <_Thread_Change_priority+0xd0><== 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 ) ffc0acf4: 2f 9d 00 00 cmpwi cr7,r29,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 ); ffc0acf8: 91 3f 00 10 stw r9,16(r31) ffc0acfc: 3d 20 00 00 lis r9,0 ffc0ad00: 39 29 20 80 addi r9,r9,8320 if ( prepend_it ) ffc0ad04: 41 9e 00 0c beq- cr7,ffc0ad10 <_Thread_Change_priority+0xc0> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); ffc0ad08: 81 29 00 28 lwz r9,40(r9) ffc0ad0c: 48 00 00 08 b ffc0ad14 <_Thread_Change_priority+0xc4> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); ffc0ad10: 81 29 00 24 lwz r9,36(r9) ffc0ad14: 7f e3 fb 78 mr r3,r31 ffc0ad18: 7d 29 03 a6 mtctr r9 ffc0ad1c: 4e 80 04 21 bctrl static inline void ppc_interrupt_flash( uint32_t level ) { uint32_t current_level; __asm__ volatile ( ffc0ad20: 7d 20 00 a6 mfmsr r9 ffc0ad24: 7f c0 01 24 mtmsr r30 ffc0ad28: 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(); ffc0ad2c: 3d 20 00 00 lis r9,0 ffc0ad30: 81 29 20 88 lwz r9,8328(r9) ffc0ad34: 7d 29 03 a6 mtctr r9 ffc0ad38: 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 ); ffc0ad3c: 3d 20 00 00 lis r9,0 ffc0ad40: 39 29 2e 00 addi r9,r9,11776 ffc0ad44: 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() && ffc0ad48: 81 09 00 14 lwz r8,20(r9) ffc0ad4c: 7f 8a 40 00 cmpw cr7,r10,r8 ffc0ad50: 41 9e 00 18 beq- cr7,ffc0ad68 <_Thread_Change_priority+0x118> ffc0ad54: 89 4a 00 70 lbz r10,112(r10) ffc0ad58: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0ad5c: 41 9e 00 0c beq- cr7,ffc0ad68 <_Thread_Change_priority+0x118> _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; ffc0ad60: 39 40 00 01 li r10,1 ffc0ad64: 99 49 00 0c stb r10,12(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0ad68: 7f c0 01 24 mtmsr r30 _ISR_Enable( level ); } ffc0ad6c: 39 61 00 20 addi r11,r1,32 ffc0ad70: 4b ff 58 48 b ffc005b8 <_restgpr_28_x> =============================================================================== ffc0af8c <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { ffc0af8c: 94 21 ff e8 stwu r1,-24(r1) ffc0af90: 7c 08 02 a6 mflr r0 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0af94: 38 81 00 08 addi r4,r1,8 void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { ffc0af98: 90 01 00 1c stw r0,28(r1) Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0af9c: 48 00 02 15 bl ffc0b1b0 <_Thread_Get> switch ( location ) { ffc0afa0: 81 21 00 08 lwz r9,8(r1) ffc0afa4: 2f 89 00 00 cmpwi cr7,r9,0 ffc0afa8: 40 9e 00 20 bne- cr7,ffc0afc8 <_Thread_Delay_ended+0x3c><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( ffc0afac: 3c 80 10 00 lis r4,4096 ffc0afb0: 60 84 00 18 ori r4,r4,24 ffc0afb4: 4b ff fd c1 bl ffc0ad74 <_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; ffc0afb8: 3d 20 00 00 lis r9,0 ffc0afbc: 81 49 28 24 lwz r10,10276(r9) --level; ffc0afc0: 39 4a ff ff addi r10,r10,-1 _Thread_Dispatch_disable_level = level; ffc0afc4: 91 49 28 24 stw r10,10276(r9) | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } ffc0afc8: 80 01 00 1c lwz r0,28(r1) ffc0afcc: 38 21 00 18 addi r1,r1,24 ffc0afd0: 7c 08 03 a6 mtlr r0 ffc0afd4: 4e 80 00 20 blr =============================================================================== ffc0afd8 <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { ffc0afd8: 94 21 ff b8 stwu r1,-72(r1) ffc0afdc: 7c 08 02 a6 mflr r0 ffc0afe0: be 81 00 18 stmw r20,24(r1) #endif /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; ffc0afe4: 3f e0 00 00 lis r31,0 ffc0afe8: 39 3f 2e 00 addi r9,r31,11776 #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { ffc0afec: 90 01 00 4c stw r0,76(r1) #endif /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; ffc0aff0: 82 c9 00 10 lwz r22,16(r9) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0aff4: 7d 40 00 a6 mfmsr r10 ffc0aff8: 7d 30 42 a6 mfsprg r9,0 ffc0affc: 7d 49 48 78 andc r9,r10,r9 ffc0b000: 7d 20 01 24 mtmsr r9 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); ffc0b004: 3f 40 00 00 lis r26,0 { 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 ) { ffc0b008: 3e e0 00 00 lis r23,0 * 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; ffc0b00c: 3f c0 00 00 lis r30,0 ffc0b010: 3b a0 00 01 li r29,1 while ( _Thread_Dispatch_necessary == true ) { heir = _Thread_Heir; #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; ffc0b014: 3b 80 00 00 li r28,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 ) heir->cpu_time_budget = _Thread_Ticks_per_timeslice; ffc0b018: 3f 60 00 00 lis r27,0 ffc0b01c: 3b 5a 2b e8 addi r26,r26,11240 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { ffc0b020: 3f 20 00 00 lis r25,0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc0b024: 3f 00 00 00 lis r24,0 ffc0b028: 3a f7 22 0c addi r23,r23,8716 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { ffc0b02c: 48 00 01 30 b ffc0b15c <_Thread_Dispatch+0x184> heir = _Thread_Heir; ffc0b030: 82 a9 00 14 lwz r21,20(r9) ffc0b034: 93 be 28 24 stw r29,10276(r30) /* * 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 ) ffc0b038: 7f 95 b0 00 cmpw cr7,r21,r22 while ( _Thread_Dispatch_necessary == true ) { heir = _Thread_Heir; #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; ffc0b03c: 9b 89 00 0c stb r28,12(r9) _Thread_Executing = heir; ffc0b040: 92 a9 00 10 stw r21,16(r9) /* * 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 ) ffc0b044: 40 be 00 28 bne+ cr7,ffc0b06c <_Thread_Dispatch+0x94> ffc0b048: 39 00 00 00 li r8,0 ffc0b04c: 3d 20 00 00 lis r9,0 ffc0b050: 91 09 28 24 stw r8,10276(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0b054: 7d 40 01 24 mtmsr r10 ffc0b058: 3d 20 00 00 lis r9,0 { 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 ) { ffc0b05c: 3f c0 00 00 lis r30,0 ffc0b060: 83 e9 2d 10 lwz r31,11536(r9) ffc0b064: 3b de 2d 14 addi r30,r30,11540 ffc0b068: 48 00 01 1c b ffc0b184 <_Thread_Dispatch+0x1ac> */ #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 ) ffc0b06c: 81 35 00 78 lwz r9,120(r21) ffc0b070: 2f 89 00 01 cmpwi cr7,r9,1 ffc0b074: 40 be 00 0c bne+ cr7,ffc0b080 <_Thread_Dispatch+0xa8> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; ffc0b078: 81 3b 28 20 lwz r9,10272(r27) ffc0b07c: 91 35 00 74 stw r9,116(r21) ffc0b080: 7d 40 01 24 mtmsr r10 ffc0b084: 38 61 00 08 addi r3,r1,8 ffc0b088: 7f 44 d3 78 mr r4,r26 ffc0b08c: 4b ff e7 d9 bl ffc09864 <_TOD_Get_with_nanoseconds> #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( ffc0b090: 38 bf 2e 00 addi r5,r31,11776 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; ffc0b094: 81 05 00 20 lwz r8,32(r5) ffc0b098: 81 25 00 24 lwz r9,36(r5) ffc0b09c: 81 41 00 08 lwz r10,8(r1) ffc0b0a0: 81 61 00 0c lwz r11,12(r1) ffc0b0a4: 7c e9 58 10 subfc r7,r9,r11 ffc0b0a8: 7c c8 51 10 subfe r6,r8,r10 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; ffc0b0ac: 81 16 00 80 lwz r8,128(r22) ffc0b0b0: 81 36 00 84 lwz r9,132(r22) ffc0b0b4: 7d 29 38 14 addc r9,r9,r7 ffc0b0b8: 7d 08 31 14 adde r8,r8,r6 ffc0b0bc: 91 36 00 84 stw r9,132(r22) #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { ffc0b0c0: 81 39 28 2c lwz r9,10284(r25) ffc0b0c4: 91 16 00 80 stw r8,128(r22) ffc0b0c8: 2f 89 00 00 cmpwi cr7,r9,0 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; ffc0b0cc: 91 45 00 20 stw r10,32(r5) ffc0b0d0: 91 65 00 24 stw r11,36(r5) #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { ffc0b0d4: 41 9e 00 14 beq- cr7,ffc0b0e8 <_Thread_Dispatch+0x110> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; ffc0b0d8: 81 49 00 00 lwz r10,0(r9) ffc0b0dc: 91 56 01 44 stw r10,324(r22) *_Thread_libc_reent = heir->libc_reent; ffc0b0e0: 81 55 01 44 lwz r10,324(r21) ffc0b0e4: 91 49 00 00 stw r10,0(r9) ffc0b0e8: 82 98 22 08 lwz r20,8712(r24) ffc0b0ec: 48 00 00 1c b ffc0b108 <_Thread_Dispatch+0x130> const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); ffc0b0f0: 81 34 00 08 lwz r9,8(r20) ffc0b0f4: 7e c3 b3 78 mr r3,r22 ffc0b0f8: 7e a4 ab 78 mr r4,r21 ffc0b0fc: 7d 29 03 a6 mtctr r9 ffc0b100: 4e 80 04 21 bctrl #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } ffc0b104: 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 ) { ffc0b108: 7f 94 b8 00 cmpw cr7,r20,r23 ffc0b10c: 40 9e ff e4 bne+ cr7,ffc0b0f0 <_Thread_Dispatch+0x118> * operations. */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH != TRUE ) if ( executing->fp_context != NULL ) ffc0b110: 81 36 01 40 lwz r9,320(r22) ffc0b114: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b118: 41 9e 00 0c beq- cr7,ffc0b124 <_Thread_Dispatch+0x14c> _Context_Save_fp( &executing->fp_context ); ffc0b11c: 38 76 01 40 addi r3,r22,320 ffc0b120: 48 00 ef e1 bl ffc1a100 <_CPU_Context_save_fp> #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); ffc0b124: 38 76 00 c0 addi r3,r22,192 ffc0b128: 38 95 00 c0 addi r4,r21,192 ffc0b12c: 48 00 f1 55 bl ffc1a280 <_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 ) ffc0b130: 81 36 01 40 lwz r9,320(r22) ffc0b134: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b138: 41 9e 00 0c beq- cr7,ffc0b144 <_Thread_Dispatch+0x16c> _Context_Restore_fp( &executing->fp_context ); ffc0b13c: 38 76 01 40 addi r3,r22,320 ffc0b140: 48 00 f0 81 bl ffc1a1c0 <_CPU_Context_restore_fp> #endif #endif executing = _Thread_Executing; ffc0b144: 39 3f 2e 00 addi r9,r31,11776 ffc0b148: 82 c9 00 10 lwz r22,16(r9) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0b14c: 7d 40 00 a6 mfmsr r10 ffc0b150: 7d 30 42 a6 mfsprg r9,0 ffc0b154: 7d 49 48 78 andc r9,r10,r9 ffc0b158: 7d 20 01 24 mtmsr r9 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { ffc0b15c: 39 3f 2e 00 addi r9,r31,11776 ffc0b160: 89 09 00 0c lbz r8,12(r9) ffc0b164: 2f 88 00 00 cmpwi cr7,r8,0 ffc0b168: 40 9e fe c8 bne+ cr7,ffc0b030 <_Thread_Dispatch+0x58> ffc0b16c: 4b ff fe dc b ffc0b048 <_Thread_Dispatch+0x70> const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); ffc0b170: 81 3f 00 08 lwz r9,8(r31) ffc0b174: 7e c3 b3 78 mr r3,r22 ffc0b178: 7d 29 03 a6 mtctr r9 ffc0b17c: 4e 80 04 21 bctrl #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } ffc0b180: 83 ff 00 00 lwz r31,0(r31) { 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 ) { ffc0b184: 7f 9f f0 00 cmpw cr7,r31,r30 ffc0b188: 40 9e ff e8 bne+ cr7,ffc0b170 <_Thread_Dispatch+0x198> ffc0b18c: 39 61 00 48 addi r11,r1,72 ffc0b190: 4b ff 54 08 b ffc00598 <_restgpr_20_x> =============================================================================== ffc0f668 <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { ffc0f668: 94 21 ff f0 stwu r1,-16(r1) ffc0f66c: 7c 08 02 a6 mflr r0 #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; ffc0f670: 3d 20 00 00 lis r9,0 #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { ffc0f674: 90 01 00 14 stw r0,20(r1) ffc0f678: bf c1 00 08 stmw r30,8(r1) #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; ffc0f67c: 83 e9 2e 10 lwz r31,11792(r9) /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; ffc0f680: 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); ffc0f684: 39 20 00 00 li r9,0 ffc0f688: 7d 20 00 a6 mfmsr r9 if (!(level & CPU_MODES_INTERRUPT_MASK)) { ffc0f68c: 71 48 00 01 andi. r8,r10,1 static inline uint32_t ppc_interrupt_get_disable_mask( void ) { uint32_t mask; __asm__ volatile ( ffc0f690: 7d 50 42 a6 mfsprg r10,0 ffc0f694: 40 a2 00 0c bne+ ffc0f6a0 <_Thread_Handler+0x38> msr |= ppc_interrupt_get_disable_mask(); ffc0f698: 7d 49 4b 78 or r9,r10,r9 ffc0f69c: 48 00 00 08 b ffc0f6a4 <_Thread_Handler+0x3c> } else { msr &= ~ppc_interrupt_get_disable_mask(); ffc0f6a0: 7d 29 50 78 andc r9,r9,r10 } _CPU_MSR_SET(msr); ffc0f6a4: 7d 20 01 24 mtmsr r9 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; ffc0f6a8: 3d 20 00 00 lis r9,0 ffc0f6ac: 8b c9 29 c4 lbz r30,10692(r9) ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( ffc0f6b0: 3c 80 ff c1 lis r4,-63 doneConstructors = true; ffc0f6b4: 39 40 00 01 li r10,1 ffc0f6b8: 7f e3 fb 78 mr r3,r31 ffc0f6bc: 99 49 29 c4 stb r10,10692(r9) ffc0f6c0: 38 84 bd 4c addi r4,r4,-17076 ffc0f6c4: 4b ff c6 d5 bl ffc0bd98 <_User_extensions_Iterate> _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); ffc0f6c8: 4b ff ba cd bl ffc0b194 <_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) */ { ffc0f6cc: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0f6d0: 40 be 00 08 bne+ cr7,ffc0f6d8 <_Thread_Handler+0x70> INIT_NAME (); ffc0f6d4: 48 00 b6 29 bl ffc1acfc <_init> _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { ffc0f6d8: 81 3f 00 90 lwz r9,144(r31) ffc0f6dc: 2f 89 00 00 cmpwi cr7,r9,0 ffc0f6e0: 40 be 00 18 bne+ cr7,ffc0f6f8 <_Thread_Handler+0x90> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( ffc0f6e4: 81 3f 00 8c lwz r9,140(r31) ffc0f6e8: 80 7f 00 98 lwz r3,152(r31) ffc0f6ec: 7d 29 03 a6 mtctr r9 ffc0f6f0: 4e 80 04 21 bctrl #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = ffc0f6f4: 90 7f 00 28 stw r3,40(r31) } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( ffc0f6f8: 3c 80 ff c1 lis r4,-63 ffc0f6fc: 7f e3 fb 78 mr r3,r31 ffc0f700: 38 84 bd 60 addi r4,r4,-17056 ffc0f704: 4b ff c6 95 bl ffc0bd98 <_User_extensions_Iterate> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( ffc0f708: 38 60 00 00 li r3,0 ffc0f70c: 38 80 00 01 li r4,1 ffc0f710: 38 a0 00 05 li r5,5 ffc0f714: 4b ff a6 65 bl ffc09d78 <_Internal_error_Occurred> =============================================================================== ffc0b44c <_Thread_Handler_initialization>: #include #endif void _Thread_Handler_initialization(void) { uint32_t ticks_per_timeslice = ffc0b44c: 3d 20 ff c2 lis r9,-62 #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { ffc0b450: 94 21 ff f0 stwu r1,-16(r1) uint32_t ticks_per_timeslice = ffc0b454: 39 29 ad 58 addi r9,r9,-21160 #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { ffc0b458: 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 || ffc0b45c: 81 09 00 28 lwz r8,40(r9) #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { ffc0b460: bf c1 00 08 stmw 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 || ffc0b464: 2f 88 00 00 cmpwi cr7,r8,0 #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { ffc0b468: 90 01 00 14 stw r0,20(r1) uint32_t ticks_per_timeslice = ffc0b46c: 83 e9 00 14 lwz r31,20(r9) rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = ffc0b470: 83 c9 00 08 lwz r30,8(r9) rtems_configuration_get_maximum_extensions(); rtems_stack_allocate_init_hook stack_allocate_init_hook = ffc0b474: 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 || ffc0b478: 41 9e 00 10 beq- cr7,ffc0b488 <_Thread_Handler_initialization+0x3c><== NEVER TAKEN ffc0b47c: 81 09 00 2c lwz r8,44(r9) ffc0b480: 2f 88 00 00 cmpwi cr7,r8,0 ffc0b484: 40 be 00 14 bne+ cr7,ffc0b498 <_Thread_Handler_initialization+0x4c> rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( ffc0b488: 38 60 00 00 li r3,0 ffc0b48c: 38 80 00 01 li r4,1 ffc0b490: 38 a0 00 0e li r5,14 ffc0b494: 4b ff e8 e5 bl ffc09d78 <_Internal_error_Occurred> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) ffc0b498: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0b49c: 41 9e 00 10 beq- cr7,ffc0b4ac <_Thread_Handler_initialization+0x60> (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); ffc0b4a0: 80 69 00 04 lwz r3,4(r9) ffc0b4a4: 7d 49 03 a6 mtctr r10 ffc0b4a8: 4e 80 04 21 bctrl _Thread_Dispatch_necessary = false; ffc0b4ac: 3d 40 00 00 lis r10,0 false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } ffc0b4b0: 80 01 00 14 lwz r0,20(r1) ); if ( stack_allocate_init_hook != NULL ) (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); _Thread_Dispatch_necessary = false; ffc0b4b4: 39 4a 2e 00 addi r10,r10,11776 ffc0b4b8: 39 20 00 00 li r9,0 false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } ffc0b4bc: 7c 08 03 a6 mtlr r0 ); if ( stack_allocate_init_hook != NULL ) (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); _Thread_Dispatch_necessary = false; ffc0b4c0: 99 2a 00 0c stb r9,12(r10) _Thread_Executing = NULL; ffc0b4c4: 39 20 00 00 li r9,0 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0b4c8: 3c 60 00 00 lis r3,0 if ( stack_allocate_init_hook != NULL ) (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); _Thread_Dispatch_necessary = false; _Thread_Executing = NULL; ffc0b4cc: 91 2a 00 10 stw r9,16(r10) #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0b4d0: 38 63 2d 74 addi r3,r3,11636 ffc0b4d4: 38 80 00 01 li r4,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; ffc0b4d8: 91 2a 00 14 stw r9,20(r10) #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; ffc0b4dc: 3d 40 00 00 lis r10,0 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0b4e0: 38 a0 00 01 li r5,1 _Thread_Dispatch_necessary = false; _Thread_Executing = NULL; _Thread_Heir = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; ffc0b4e4: 91 2a 28 28 stw r9,10280(r10) #endif _Thread_Maximum_extensions = maximum_extensions; ffc0b4e8: 3d 20 00 00 lis r9,0 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0b4ec: 38 c0 00 01 li r6,1 _Thread_Heir = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; ffc0b4f0: 93 c9 28 30 stw r30,10288(r9) _Thread_Ticks_per_timeslice = ticks_per_timeslice; ffc0b4f4: 3d 20 00 00 lis r9,0 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0b4f8: 38 e0 01 58 li r7,344 _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; ffc0b4fc: 93 e9 28 20 stw r31,10272(r9) #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0b500: 39 00 00 00 li r8,0 ffc0b504: 39 20 00 08 li r9,8 false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } ffc0b508: bb c1 00 08 lmw r30,8(r1) ffc0b50c: 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( ffc0b510: 4b ff ee 54 b ffc0a364 <_Objects_Initialize_information> =============================================================================== ffc0b244 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { ffc0b244: 94 21 ff c0 stwu r1,-64(r1) ffc0b248: 7c 08 02 a6 mflr r0 ffc0b24c: be e1 00 1c stmw r23,28(r1) ffc0b250: 7d 1c 43 78 mr r28,r8 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; ffc0b254: 39 00 00 00 li r8,0 Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { ffc0b258: 90 01 00 44 stw r0,68(r1) ffc0b25c: 7d 3b 4b 78 mr r27,r9 ffc0b260: 7c 78 1b 78 mr r24,r3 ffc0b264: 81 21 00 50 lwz r9,80(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 ); ffc0b268: 7c 83 23 78 mr r3,r4 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; ffc0b26c: 91 04 01 48 stw r8,328(r4) Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { ffc0b270: 7c 9f 23 78 mr r31,r4 ffc0b274: 7c de 33 78 mr r30,r6 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; ffc0b278: 91 04 01 4c stw r8,332(r4) Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { ffc0b27c: 7c f7 3b 78 mr r23,r7 ffc0b280: 7d 5a 53 78 mr r26,r10 */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; extensions_area = NULL; the_thread->libc_reent = NULL; ffc0b284: 91 04 01 44 stw r8,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 ); ffc0b288: 7c c4 33 78 mr r4,r6 Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { ffc0b28c: 83 29 00 00 lwz r25,0(r9) /* * 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 ); ffc0b290: 48 00 08 d9 bl ffc0bb68 <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) ffc0b294: 7c 68 1b 79 mr. r8,r3 return false; /* stack allocation failed */ ffc0b298: 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 ) ffc0b29c: 41 82 01 a8 beq- ffc0b444 <_Thread_Initialize+0x200> ffc0b2a0: 7f 88 f0 40 cmplw cr7,r8,r30 ffc0b2a4: 41 9c 01 a0 blt- cr7,ffc0b444 <_Thread_Initialize+0x200><== NEVER TAKEN /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { ffc0b2a8: 2f 97 00 00 cmpwi cr7,r23,0 Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; ffc0b2ac: 81 3f 00 bc lwz r9,188(r31) the_stack->size = size; ffc0b2b0: 91 1f 00 b0 stw r8,176(r31) extensions_area = NULL; the_thread->libc_reent = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) fp_area = NULL; ffc0b2b4: 3b a0 00 00 li r29,0 Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; ffc0b2b8: 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 ) { ffc0b2bc: 41 be 00 14 beq+ cr7,ffc0b2d0 <_Thread_Initialize+0x8c> fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); ffc0b2c0: 38 60 01 08 li r3,264 ffc0b2c4: 48 00 0f dd bl ffc0c2a0 <_Workspace_Allocate> if ( !fp_area ) ffc0b2c8: 7c 7d 1b 79 mr. r29,r3 ffc0b2cc: 41 82 01 34 beq- ffc0b400 <_Thread_Initialize+0x1bc> #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { ffc0b2d0: 3d 20 00 00 lis r9,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; ffc0b2d4: 93 bf 01 40 stw r29,320(r31) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; ffc0b2d8: 38 e0 00 00 li r7,0 #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { ffc0b2dc: 81 09 28 30 lwz r8,10288(r9) * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; extensions_area = NULL; ffc0b2e0: 3b c0 00 00 li r30,0 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; ffc0b2e4: 93 bf 00 b8 stw r29,184(r31) #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { ffc0b2e8: 2f 88 00 00 cmpwi cr7,r8,0 ffc0b2ec: 90 ff 00 50 stw r7,80(r31) the_watchdog->routine = routine; ffc0b2f0: 90 ff 00 64 stw r7,100(r31) the_watchdog->id = id; ffc0b2f4: 90 ff 00 68 stw r7,104(r31) the_watchdog->user_data = user_data; ffc0b2f8: 90 ff 00 6c stw r7,108(r31) ffc0b2fc: 41 be 00 18 beq+ cr7,ffc0b314 <_Thread_Initialize+0xd0> extensions_area = _Workspace_Allocate( ffc0b300: 38 68 00 01 addi r3,r8,1 ffc0b304: 54 63 10 3a rlwinm r3,r3,2,0,29 ffc0b308: 48 00 0f 99 bl ffc0c2a0 <_Workspace_Allocate> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) ffc0b30c: 7c 7e 1b 79 mr. r30,r3 ffc0b310: 41 82 00 f4 beq- ffc0b404 <_Thread_Initialize+0x1c0> * if they are linked to the thread. An extension user may * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { ffc0b314: 2f 9e 00 00 cmpwi cr7,r30,0 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) goto failed; } the_thread->extensions = (void **) extensions_area; ffc0b318: 93 df 01 50 stw r30,336(r31) * if they are linked to the thread. An extension user may * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { ffc0b31c: 40 be 00 58 bne+ cr7,ffc0b374 <_Thread_Initialize+0x130> * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; ffc0b320: 81 21 00 48 lwz r9,72(r1) */ RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate( Thread_Control *the_thread ) { return _Scheduler.Operations.allocate( the_thread ); ffc0b324: 7f e3 fb 78 mr r3,r31 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; ffc0b328: 93 5f 00 a0 stw r26,160(r31) #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; ffc0b32c: 3b 40 00 01 li r26,1 * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; ffc0b330: 91 3f 00 a4 stw r9,164(r31) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; ffc0b334: 81 21 00 4c lwz r9,76(r1) /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; ffc0b338: 9b 7f 00 9c stb r27,156(r31) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; ffc0b33c: 91 3f 00 a8 stw r9,168(r31) the_thread->current_state = STATES_DORMANT; the_thread->Wait.queue = NULL; ffc0b340: 39 20 00 00 li r9,0 ffc0b344: 91 3f 00 44 stw r9,68(r31) the_thread->resource_count = 0; ffc0b348: 91 3f 00 1c stw r9,28(r31) ffc0b34c: 3d 20 00 00 lis r9,0 ffc0b350: 81 29 20 98 lwz r9,8344(r9) #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; ffc0b354: 93 5f 00 10 stw r26,16(r31) ffc0b358: 7d 29 03 a6 mtctr r9 the_thread->Wait.queue = NULL; the_thread->resource_count = 0; the_thread->real_priority = priority; ffc0b35c: 93 9f 00 18 stw r28,24(r31) the_thread->Start.initial_priority = priority; ffc0b360: 93 9f 00 ac stw r28,172(r31) ffc0b364: 4e 80 04 21 bctrl sched =_Scheduler_Allocate( the_thread ); if ( !sched ) ffc0b368: 7c 7b 1b 79 mr. r27,r3 ffc0b36c: 40 a2 00 38 bne+ ffc0b3a4 <_Thread_Initialize+0x160> ffc0b370: 48 00 00 98 b ffc0b408 <_Thread_Initialize+0x1c4> * 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++ ) ffc0b374: 3d 20 00 00 lis r9,0 ffc0b378: 81 49 28 30 lwz r10,10288(r9) ffc0b37c: 38 e0 00 00 li r7,0 the_thread->extensions[i] = NULL; ffc0b380: 39 00 00 00 li r8,0 ffc0b384: 48 00 00 14 b ffc0b398 <_Thread_Initialize+0x154> ffc0b388: 81 3f 01 50 lwz r9,336(r31) ffc0b38c: 54 e6 10 3a rlwinm r6,r7,2,0,29 * 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++ ) ffc0b390: 38 e7 00 01 addi r7,r7,1 the_thread->extensions[i] = NULL; ffc0b394: 7d 09 31 2e stwx r8,r9,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++ ) ffc0b398: 7f 87 50 40 cmplw cr7,r7,r10 ffc0b39c: 40 9d ff ec ble+ cr7,ffc0b388 <_Thread_Initialize+0x144> ffc0b3a0: 4b ff ff 80 b ffc0b320 <_Thread_Initialize+0xdc> the_thread->real_priority = priority; the_thread->Start.initial_priority = priority; sched =_Scheduler_Allocate( the_thread ); if ( !sched ) goto failed; _Thread_Set_priority( the_thread, priority ); ffc0b3a4: 7f e3 fb 78 mr r3,r31 ffc0b3a8: 7f 84 e3 78 mr r4,r28 ffc0b3ac: 48 00 06 f9 bl ffc0baa4 <_Thread_Set_priority> Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( ffc0b3b0: a1 3f 00 0a lhz r9,10(r31) static inline void _Timestamp64_implementation_Set_to_zero( Timestamp64_Control *_time ) { *_time = 0; ffc0b3b4: 39 40 00 00 li r10,0 ffc0b3b8: 91 5f 00 80 stw r10,128(r31) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; ffc0b3bc: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0b3c0: 39 60 00 00 li r11,0 ffc0b3c4: 81 58 00 1c lwz r10,28(r24) 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 ); ffc0b3c8: 3c 80 ff c1 lis r4,-63 ffc0b3cc: 91 7f 00 84 stw r11,132(r31) ffc0b3d0: 38 61 00 08 addi r3,r1,8 ffc0b3d4: 38 84 bc bc addi r4,r4,-17220 ffc0b3d8: 7f ea 49 2e stwx r31,r10,r9 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; ffc0b3dc: 93 3f 00 0c stw r25,12(r31) * @{ */ static inline bool _User_extensions_Thread_create( Thread_Control *created ) { User_extensions_Thread_create_context ctx = { created, true }; ffc0b3e0: 93 e1 00 08 stw r31,8(r1) ffc0b3e4: 9b 41 00 0c stb r26,12(r1) _User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor ); ffc0b3e8: 48 00 09 b1 bl ffc0bd98 <_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; ffc0b3ec: 38 60 00 01 li r3,1 return ctx.ok; ffc0b3f0: 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 ) ffc0b3f4: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b3f8: 41 be 00 10 beq+ cr7,ffc0b408 <_Thread_Initialize+0x1c4> ffc0b3fc: 48 00 00 48 b ffc0b444 <_Thread_Initialize+0x200> * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; extensions_area = NULL; ffc0b400: 3b c0 00 00 li r30,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; ffc0b404: 3b 60 00 00 li r27,0 extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; failed: _Workspace_Free( the_thread->libc_reent ); ffc0b408: 80 7f 01 44 lwz r3,324(r31) ffc0b40c: 48 00 0e ad bl ffc0c2b8 <_Workspace_Free> for ( i=0 ; i <= THREAD_API_LAST ; i++ ) _Workspace_Free( the_thread->API_Extensions[i] ); ffc0b410: 80 7f 01 48 lwz r3,328(r31) ffc0b414: 48 00 0e a5 bl ffc0c2b8 <_Workspace_Free> ffc0b418: 80 7f 01 4c lwz r3,332(r31) ffc0b41c: 48 00 0e 9d bl ffc0c2b8 <_Workspace_Free> _Workspace_Free( extensions_area ); ffc0b420: 7f c3 f3 78 mr r3,r30 ffc0b424: 48 00 0e 95 bl ffc0c2b8 <_Workspace_Free> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); ffc0b428: 7f a3 eb 78 mr r3,r29 ffc0b42c: 48 00 0e 8d bl ffc0c2b8 <_Workspace_Free> #endif _Workspace_Free( sched ); ffc0b430: 7f 63 db 78 mr r3,r27 ffc0b434: 48 00 0e 85 bl ffc0c2b8 <_Workspace_Free> _Thread_Stack_Free( the_thread ); ffc0b438: 7f e3 fb 78 mr r3,r31 ffc0b43c: 48 00 07 89 bl ffc0bbc4 <_Thread_Stack_Free> return false; ffc0b440: 38 60 00 00 li r3,0 } ffc0b444: 39 61 00 40 addi r11,r1,64 ffc0b448: 4b ff 51 5c b ffc005a4 <_restgpr_23_x> =============================================================================== ffc0c2f8 <_Thread_Restart>: bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { ffc0c2f8: 94 21 ff e8 stwu r1,-24(r1) ffc0c2fc: 7c 08 02 a6 mflr r0 ffc0c300: 90 01 00 1c stw r0,28(r1) */ RTEMS_INLINE_ROUTINE bool _States_Is_dormant ( States_Control the_states ) { return (the_states & STATES_DORMANT); ffc0c304: 81 23 00 10 lwz r9,16(r3) ffc0c308: bf c1 00 10 stmw r30,16(r1) ffc0c30c: 7c 7f 1b 78 mr r31,r3 if ( !_States_Is_dormant( the_thread->current_state ) ) { ffc0c310: 71 2a 00 01 andi. r10,r9,1 ffc0c314: 40 a2 00 7c bne+ ffc0c390 <_Thread_Restart+0x98> _Thread_Set_transient( the_thread ); ffc0c318: 90 81 00 08 stw r4,8(r1) ffc0c31c: 90 a1 00 0c stw r5,12(r1) ffc0c320: 48 00 00 ed bl ffc0c40c <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); ffc0c324: 7f e3 fb 78 mr r3,r31 ffc0c328: 80 81 00 08 lwz r4,8(r1) ffc0c32c: 80 a1 00 0c lwz r5,12(r1) ffc0c330: 48 00 28 6d bl ffc0eb9c <_Thread_Reset> _Thread_Load_environment( the_thread ); ffc0c334: 7f e3 fb 78 mr r3,r31 ffc0c338: 48 00 25 49 bl ffc0e880 <_Thread_Load_environment> _Thread_Ready( the_thread ); ffc0c33c: 7f e3 fb 78 mr r3,r31 ffc0c340: 48 00 28 15 bl ffc0eb54 <_Thread_Ready> ); } static inline void _User_extensions_Thread_restart( Thread_Control *restarted ) { _User_extensions_Iterate( ffc0c344: 3c 80 ff c1 lis r4,-63 ffc0c348: 7f e3 fb 78 mr r3,r31 ffc0c34c: 38 84 c6 30 addi r4,r4,-14800 ffc0c350: 48 00 03 41 bl ffc0c690 <_User_extensions_Iterate> RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); ffc0c354: 3d 20 00 00 lis r9,0 ffc0c358: 39 29 2e 20 addi r9,r9,11808 _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) ffc0c35c: 81 49 00 10 lwz r10,16(r9) _Thread_Restart_self(); return true; ffc0c360: 38 60 00 01 li r3,1 ffc0c364: 7d 3e 4b 78 mr r30,r9 _Thread_Ready( the_thread ); _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) ffc0c368: 7f 9f 50 00 cmpw cr7,r31,r10 ffc0c36c: 40 be 00 28 bne+ cr7,ffc0c394 <_Thread_Restart+0x9c> */ RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void ) { #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( _Thread_Executing->fp_context != NULL ) ffc0c370: 81 3f 01 40 lwz r9,320(r31) ffc0c374: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c378: 41 9e 00 0c beq- cr7,ffc0c384 <_Thread_Restart+0x8c> <== NEVER TAKEN _Context_Restore_fp( &_Thread_Executing->fp_context ); ffc0c37c: 38 7f 01 40 addi r3,r31,320 ffc0c380: 48 00 e7 c1 bl ffc1ab40 <_CPU_Context_restore_fp> #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); ffc0c384: 80 7e 00 10 lwz r3,16(r30) ffc0c388: 38 63 00 c0 addi r3,r3,192 ffc0c38c: 48 00 e9 49 bl ffc1acd4 <_CPU_Context_restore> _Thread_Restart_self(); return true; } return false; ffc0c390: 38 60 00 00 li r3,0 } ffc0c394: 39 61 00 18 addi r11,r1,24 ffc0c398: 4b ff 4a 88 b ffc00e20 <_restgpr_30_x> =============================================================================== ffc0e210 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { ffc0e210: 7c 64 1b 78 mr r4,r3 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; ffc0e214: 80 63 00 44 lwz r3,68(r3) * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && ffc0e218: 81 23 00 30 lwz r9,48(r3) ffc0e21c: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e220: 41 9e 00 30 beq- cr7,ffc0e250 <_Thread_queue_Process_timeout+0x40> RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); ffc0e224: 3d 40 00 00 lis r10,0 ffc0e228: 81 4a 2e 10 lwz r10,11792(r10) ffc0e22c: 7f 84 50 00 cmpw cr7,r4,r10 ffc0e230: 40 be 00 20 bne+ cr7,ffc0e250 <_Thread_queue_Process_timeout+0x40><== NEVER TAKEN _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { ffc0e234: 2f 89 00 03 cmpwi cr7,r9,3 ffc0e238: 4d 9e 00 20 beqlr cr7 the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; ffc0e23c: 81 23 00 3c lwz r9,60(r3) ffc0e240: 91 24 00 34 stw r9,52(r4) the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; ffc0e244: 39 20 00 02 li r9,2 ffc0e248: 91 23 00 30 stw r9,48(r3) ffc0e24c: 4e 80 00 20 blr } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; ffc0e250: 81 23 00 3c lwz r9,60(r3) ffc0e254: 91 24 00 34 stw r9,52(r4) _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); ffc0e258: 4b ff fe 9c b ffc0e0f4 <_Thread_queue_Extract> =============================================================================== ffc0b9ec <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { ffc0b9ec: 94 21 ff d8 stwu r1,-40(r1) ffc0b9f0: 7c 08 02 a6 mflr r0 ffc0b9f4: bf a1 00 1c stmw r29,28(r1) /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) ffc0b9f8: 7c 7f 1b 79 mr. r31,r3 void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { ffc0b9fc: 90 01 00 2c stw r0,44(r1) /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) ffc0ba00: 41 82 00 58 beq- ffc0ba58 <_Thread_queue_Requeue+0x6c> <== 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 ) { ffc0ba04: 81 3f 00 34 lwz r9,52(r31) ffc0ba08: 2f 89 00 01 cmpwi cr7,r9,1 ffc0ba0c: 40 be 00 4c bne+ cr7,ffc0ba58 <_Thread_queue_Requeue+0x6c><== NEVER TAKEN ffc0ba10: 7c 9e 23 78 mr r30,r4 static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0ba14: 7f a0 00 a6 mfmsr r29 ffc0ba18: 7d 50 42 a6 mfsprg r10,0 ffc0ba1c: 7f aa 50 78 andc r10,r29,r10 ffc0ba20: 7d 40 01 24 mtmsr r10 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 ) ) { ffc0ba24: 3d 00 00 03 lis r8,3 ffc0ba28: 81 44 00 10 lwz r10,16(r4) ffc0ba2c: 61 08 be e0 ori r8,r8,48864 ffc0ba30: 7d 07 50 39 and. r7,r8,r10 ffc0ba34: 41 a2 00 20 beq+ ffc0ba54 <_Thread_queue_Requeue+0x68> <== NEVER TAKEN 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; ffc0ba38: 91 3f 00 30 stw r9,48(r31) _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); ffc0ba3c: 38 a0 00 01 li r5,1 ffc0ba40: 48 00 26 cd bl ffc0e10c <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); ffc0ba44: 7f e3 fb 78 mr r3,r31 ffc0ba48: 7f c4 f3 78 mr r4,r30 ffc0ba4c: 38 a1 00 08 addi r5,r1,8 ffc0ba50: 4b ff fd 11 bl ffc0b760 <_Thread_queue_Enqueue_priority> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0ba54: 7f a0 01 24 mtmsr r29 } _ISR_Enable( level ); } } ffc0ba58: 39 61 00 28 addi r11,r1,40 ffc0ba5c: 4b ff 4b 60 b ffc005bc <_restgpr_29_x> =============================================================================== ffc0ba60 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { ffc0ba60: 94 21 ff e8 stwu r1,-24(r1) ffc0ba64: 7c 08 02 a6 mflr r0 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0ba68: 38 81 00 08 addi r4,r1,8 void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { ffc0ba6c: 90 01 00 1c stw r0,28(r1) Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0ba70: 4b ff f7 41 bl ffc0b1b0 <_Thread_Get> switch ( location ) { ffc0ba74: 81 21 00 08 lwz r9,8(r1) ffc0ba78: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ba7c: 40 9e 00 18 bne- cr7,ffc0ba94 <_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 ); ffc0ba80: 48 00 27 91 bl ffc0e210 <_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; ffc0ba84: 3d 20 00 00 lis r9,0 ffc0ba88: 81 49 28 24 lwz r10,10276(r9) --level; ffc0ba8c: 39 4a ff ff addi r10,r10,-1 _Thread_Dispatch_disable_level = level; ffc0ba90: 91 49 28 24 stw r10,10276(r9) _Thread_Unnest_dispatch(); break; } } ffc0ba94: 80 01 00 1c lwz r0,28(r1) ffc0ba98: 38 21 00 18 addi r1,r1,24 ffc0ba9c: 7c 08 03 a6 mtlr r0 ffc0baa0: 4e 80 00 20 blr =============================================================================== ffc19d40 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { ffc19d40: 94 21 ff a0 stwu r1,-96(r1) ffc19d44: 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; ffc19d48: 39 20 00 00 li r9,0 ffc19d4c: be 41 00 28 stmw r18,40(r1) ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; ffc19d50: 3a c1 00 14 addi r22,r1,20 ffc19d54: 3a 61 00 18 addi r19,r1,24 ffc19d58: 3b 21 00 0c addi r25,r1,12 ffc19d5c: 90 01 00 64 stw r0,100(r1) head->previous = NULL; tail->previous = head; ffc19d60: 3b a1 00 08 addi r29,r1,8 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; ffc19d64: 92 61 00 14 stw r19,20(r1) ffc19d68: 7c 7f 1b 78 mr r31,r3 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; ffc19d6c: 3e a0 00 00 lis r21,0 head->previous = NULL; ffc19d70: 91 21 00 18 stw r9,24(r1) */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); ffc19d74: 3b 43 00 30 addi r26,r3,48 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); ffc19d78: 3e 80 00 00 lis r20,0 tail->previous = head; ffc19d7c: 92 c1 00 1c stw r22,28(r1) /* * 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 ); ffc19d80: 3b 83 00 68 addi r28,r3,104 * 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; ffc19d84: 3a 40 00 00 li r18,0 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; ffc19d88: 93 21 00 08 stw r25,8(r1) * * 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; ffc19d8c: 3f 60 00 00 lis r27,0 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); ffc19d90: 3a e3 00 08 addi r23,r3,8 head->previous = NULL; ffc19d94: 91 21 00 0c stw r9,12(r1) static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); ffc19d98: 3b 03 00 40 addi r24,r3,64 tail->previous = head; ffc19d9c: 93 a1 00 10 stw r29,16(r1) { /* * 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; ffc19da0: 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; ffc19da4: 81 35 29 18 lwz r9,10520(r21) */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); ffc19da8: 7f 43 d3 78 mr r3,r26 Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; ffc19dac: 80 9f 00 3c lwz r4,60(r31) watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); ffc19db0: 7f a5 eb 78 mr r5,r29 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; ffc19db4: 91 3f 00 3c stw r9,60(r31) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); ffc19db8: 7c 84 48 50 subf r4,r4,r9 ffc19dbc: 48 00 46 b1 bl ffc1e46c <_Watchdog_Adjust_to_chain> static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); ffc19dc0: 39 34 70 00 addi r9,r20,28672 ffc19dc4: 80 69 00 00 lwz r3,0(r9) ffc19dc8: 3c c0 3b 9a lis r6,15258 ffc19dcc: 80 89 00 04 lwz r4,4(r9) ffc19dd0: 38 a0 00 00 li r5,0 ffc19dd4: 60 c6 ca 00 ori r6,r6,51712 ffc19dd8: 48 01 37 a1 bl ffc2d578 <__divdi3> Watchdog_Interval last_snapshot = watchdogs->last_snapshot; ffc19ddc: 80 bf 00 74 lwz r5,116(r31) ffc19de0: 7c 9e 23 78 mr r30,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 ) { ffc19de4: 7f 84 28 40 cmplw cr7,r4,r5 ffc19de8: 40 bd 00 18 ble+ cr7,ffc19e00 <_Timer_server_Body+0xc0> /* * 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 ); ffc19dec: 7c 85 20 50 subf r4,r5,r4 ffc19df0: 7f 83 e3 78 mr r3,r28 ffc19df4: 7f a5 eb 78 mr r5,r29 ffc19df8: 48 00 46 75 bl ffc1e46c <_Watchdog_Adjust_to_chain> ffc19dfc: 48 00 00 18 b ffc19e14 <_Timer_server_Body+0xd4> } else if ( snapshot < last_snapshot ) { ffc19e00: 40 bc 00 14 bge+ cr7,ffc19e14 <_Timer_server_Body+0xd4> /* * 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 ); ffc19e04: 7f 83 e3 78 mr r3,r28 ffc19e08: 38 80 00 01 li r4,1 ffc19e0c: 7c be 28 50 subf r5,r30,r5 ffc19e10: 48 00 45 a1 bl ffc1e3b0 <_Watchdog_Adjust> } watchdogs->last_snapshot = snapshot; ffc19e14: 93 df 00 74 stw r30,116(r31) } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); ffc19e18: 80 7f 00 78 lwz r3,120(r31) ffc19e1c: 48 00 0a ed bl ffc1a908 <_Chain_Get> if ( timer == NULL ) { ffc19e20: 7c 7e 1b 79 mr. r30,r3 ffc19e24: 41 82 00 2c beq- ffc19e50 <_Timer_server_Body+0x110> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { ffc19e28: 81 3e 00 38 lwz r9,56(r30) _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); ffc19e2c: 7f 43 d3 78 mr r3,r26 static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { ffc19e30: 2f 89 00 01 cmpwi cr7,r9,1 ffc19e34: 41 9e 00 10 beq- cr7,ffc19e44 <_Timer_server_Body+0x104> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { ffc19e38: 2f 89 00 03 cmpwi cr7,r9,3 ffc19e3c: 40 9e ff dc bne+ cr7,ffc19e18 <_Timer_server_Body+0xd8> <== NEVER TAKEN _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); ffc19e40: 7f 83 e3 78 mr r3,r28 ffc19e44: 38 9e 00 10 addi r4,r30,16 ffc19e48: 48 00 46 c1 bl ffc1e508 <_Watchdog_Insert> ffc19e4c: 4b ff ff cc b ffc19e18 <_Timer_server_Body+0xd8> * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); ffc19e50: 4b ff fe 05 bl ffc19c54 if ( _Chain_Is_empty( insert_chain ) ) { ffc19e54: 81 21 00 14 lwz r9,20(r1) ffc19e58: 7f 89 98 00 cmpw cr7,r9,r19 ffc19e5c: 40 be 00 1c bne+ cr7,ffc19e78 <_Timer_server_Body+0x138><== NEVER TAKEN ts->insert_chain = NULL; ffc19e60: 93 df 00 78 stw r30,120(r31) ffc19e64: 7c 60 01 24 mtmsr r3 _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 ) ) { ffc19e68: 81 21 00 08 lwz r9,8(r1) ffc19e6c: 7f 89 c8 00 cmpw cr7,r9,r25 ffc19e70: 40 be 00 10 bne+ cr7,ffc19e80 <_Timer_server_Body+0x140> ffc19e74: 48 00 00 50 b ffc19ec4 <_Timer_server_Body+0x184> ffc19e78: 7c 60 01 24 mtmsr r3 <== NOT EXECUTED ffc19e7c: 4b ff ff 28 b ffc19da4 <_Timer_server_Body+0x64> <== NOT EXECUTED /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); ffc19e80: 4b ff fd d5 bl ffc19c54 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc19e84: 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)) ffc19e88: 7f 89 c8 00 cmpw cr7,r9,r25 ffc19e8c: 41 9e 00 30 beq- cr7,ffc19ebc <_Timer_server_Body+0x17c> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; ffc19e90: 81 49 00 00 lwz r10,0(r9) head->next = new_first; new_first->previous = head; ffc19e94: 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; ffc19e98: 91 41 00 08 stw r10,8(r1) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; ffc19e9c: 92 49 00 08 stw r18,8(r9) ffc19ea0: 7c 60 01 24 mtmsr r3 /* * 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 ); ffc19ea4: 81 49 00 1c lwz r10,28(r9) ffc19ea8: 80 69 00 20 lwz r3,32(r9) ffc19eac: 80 89 00 24 lwz r4,36(r9) ffc19eb0: 7d 49 03 a6 mtctr r10 ffc19eb4: 4e 80 04 21 bctrl } ffc19eb8: 4b ff ff c8 b ffc19e80 <_Timer_server_Body+0x140> ffc19ebc: 7c 60 01 24 mtmsr r3 ffc19ec0: 4b ff fe e0 b ffc19da0 <_Timer_server_Body+0x60> } else { ts->active = false; ffc19ec4: 39 20 00 00 li r9,0 ffc19ec8: 99 3f 00 7c stb r9,124(r31) ffc19ecc: 81 3b 28 f8 lwz r9,10488(r27) ++level; ffc19ed0: 39 29 00 01 addi r9,r9,1 _Thread_Dispatch_disable_level = level; ffc19ed4: 91 3b 28 f8 stw r9,10488(r27) /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); ffc19ed8: 80 7f 00 00 lwz r3,0(r31) ffc19edc: 38 80 00 08 li r4,8 ffc19ee0: 48 00 40 cd bl ffc1dfac <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); ffc19ee4: 7f e3 fb 78 mr r3,r31 ffc19ee8: 4b ff fd 81 bl ffc19c68 <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); ffc19eec: 7f e3 fb 78 mr r3,r31 ffc19ef0: 4b ff fd e5 bl ffc19cd4 <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); ffc19ef4: 48 00 36 f1 bl ffc1d5e4 <_Thread_Enable_dispatch> ts->active = true; ffc19ef8: 39 20 00 01 li r9,1 ffc19efc: 99 3f 00 7c stb r9,124(r31) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); ffc19f00: 7e e3 bb 78 mr r3,r23 ffc19f04: 48 00 47 61 bl ffc1e664 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); ffc19f08: 7f 03 c3 78 mr r3,r24 ffc19f0c: 48 00 47 59 bl ffc1e664 <_Watchdog_Remove> ffc19f10: 4b ff fe 90 b ffc19da0 <_Timer_server_Body+0x60> =============================================================================== ffc19f14 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { ffc19f14: 94 21 ff e8 stwu r1,-24(r1) ffc19f18: 7c 08 02 a6 mflr r0 ffc19f1c: 90 01 00 1c stw r0,28(r1) if ( ts->insert_chain == NULL ) { ffc19f20: 81 23 00 78 lwz r9,120(r3) static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { ffc19f24: bf a1 00 0c stmw r29,12(r1) ffc19f28: 7c 7f 1b 78 mr r31,r3 if ( ts->insert_chain == NULL ) { ffc19f2c: 2f 89 00 00 cmpwi cr7,r9,0 ffc19f30: 40 be 01 3c bne+ cr7,ffc1a06c <_Timer_server_Schedule_operation_method+0x158> * * 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; ffc19f34: 3d 20 00 00 lis r9,0 ffc19f38: 81 49 28 f8 lwz r10,10488(r9) ffc19f3c: 7c 9e 23 78 mr r30,r4 ++level; ffc19f40: 39 4a 00 01 addi r10,r10,1 _Thread_Dispatch_disable_level = level; ffc19f44: 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 ) { ffc19f48: 81 24 00 38 lwz r9,56(r4) ffc19f4c: 2f 89 00 01 cmpwi cr7,r9,1 ffc19f50: 40 be 00 6c bne+ cr7,ffc19fbc <_Timer_server_Schedule_operation_method+0xa8> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); ffc19f54: 4b ff fd 01 bl ffc19c54 snapshot = _Watchdog_Ticks_since_boot; ffc19f58: 3d 20 00 00 lis r9,0 ffc19f5c: 81 49 29 18 lwz r10,10520(r9) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); ffc19f60: 39 1f 00 34 addi r8,r31,52 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc19f64: 81 3f 00 30 lwz r9,48(r31) last_snapshot = ts->Interval_watchdogs.last_snapshot; ffc19f68: 80 ff 00 3c lwz r7,60(r31) if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { ffc19f6c: 7f 89 40 00 cmpw cr7,r9,r8 ffc19f70: 41 9e 00 20 beq- cr7,ffc19f90 <_Timer_server_Schedule_operation_method+0x7c> /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; ffc19f74: 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; ffc19f78: 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; ffc19f7c: 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) { ffc19f80: 7f 86 38 40 cmplw cr7,r6,r7 ffc19f84: 40 9d 00 08 ble- cr7,ffc19f8c <_Timer_server_Schedule_operation_method+0x78> delta_interval -= delta; ffc19f88: 7d 07 30 50 subf r8,r7,r6 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; ffc19f8c: 91 09 00 10 stw r8,16(r9) } ts->Interval_watchdogs.last_snapshot = snapshot; ffc19f90: 91 5f 00 3c stw r10,60(r31) ffc19f94: 7c 60 01 24 mtmsr r3 _ISR_Enable( level ); _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); ffc19f98: 38 7f 00 30 addi r3,r31,48 ffc19f9c: 38 9e 00 10 addi r4,r30,16 ffc19fa0: 48 00 45 69 bl ffc1e508 <_Watchdog_Insert> if ( !ts->active ) { ffc19fa4: 89 3f 00 7c lbz r9,124(r31) ffc19fa8: 2f 89 00 00 cmpwi cr7,r9,0 ffc19fac: 40 be 00 ac bne+ cr7,ffc1a058 <_Timer_server_Schedule_operation_method+0x144> _Timer_server_Reset_interval_system_watchdog( ts ); ffc19fb0: 7f e3 fb 78 mr r3,r31 ffc19fb4: 4b ff fc b5 bl ffc19c68 <_Timer_server_Reset_interval_system_watchdog> ffc19fb8: 48 00 00 a0 b ffc1a058 <_Timer_server_Schedule_operation_method+0x144> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { ffc19fbc: 2f 89 00 03 cmpwi cr7,r9,3 ffc19fc0: 40 be 00 98 bne+ cr7,ffc1a058 <_Timer_server_Schedule_operation_method+0x144> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); ffc19fc4: 4b ff fc 91 bl ffc19c54 ffc19fc8: 7c 7d 1b 78 mr r29,r3 ffc19fcc: 3d 20 00 00 lis r9,0 ffc19fd0: 39 29 70 00 addi r9,r9,28672 ffc19fd4: 80 69 00 00 lwz r3,0(r9) ffc19fd8: 3c c0 3b 9a lis r6,15258 ffc19fdc: 80 89 00 04 lwz r4,4(r9) ffc19fe0: 38 a0 00 00 li r5,0 ffc19fe4: 60 c6 ca 00 ori r6,r6,51712 ffc19fe8: 48 01 35 91 bl ffc2d578 <__divdi3> ffc19fec: 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 ); ffc19ff0: 39 1f 00 6c addi r8,r31,108 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; ffc19ff4: 81 5f 00 74 lwz r10,116(r31) if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { ffc19ff8: 7f 89 40 00 cmpw cr7,r9,r8 ffc19ffc: 41 9e 00 34 beq- cr7,ffc1a030 <_Timer_server_Schedule_operation_method+0x11c> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; if ( snapshot > last_snapshot ) { ffc1a000: 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; ffc1a004: 81 09 00 10 lwz r8,16(r9) if ( snapshot > last_snapshot ) { ffc1a008: 40 9d 00 1c ble- cr7,ffc1a024 <_Timer_server_Schedule_operation_method+0x110> /* * We advanced in time. */ delta = snapshot - last_snapshot; ffc1a00c: 7c ea 20 50 subf r7,r10,r4 if (delta_interval > delta) { ffc1a010: 7f 88 38 40 cmplw cr7,r8,r7 delta_interval -= delta; } else { delta_interval = 0; ffc1a014: 39 40 00 00 li r10,0 if ( snapshot > last_snapshot ) { /* * We advanced in time. */ delta = snapshot - last_snapshot; if (delta_interval > delta) { ffc1a018: 40 9d 00 14 ble- cr7,ffc1a02c <_Timer_server_Schedule_operation_method+0x118><== NEVER TAKEN delta_interval -= delta; ffc1a01c: 7d 47 40 50 subf r10,r7,r8 ffc1a020: 48 00 00 0c b ffc1a02c <_Timer_server_Schedule_operation_method+0x118> } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; ffc1a024: 7d 48 52 14 add r10,r8,r10 delta_interval += delta; ffc1a028: 7d 44 50 50 subf r10,r4,r10 } first_watchdog->delta_interval = delta_interval; ffc1a02c: 91 49 00 10 stw r10,16(r9) } ts->TOD_watchdogs.last_snapshot = snapshot; ffc1a030: 90 9f 00 74 stw r4,116(r31) ffc1a034: 7f a0 01 24 mtmsr r29 _ISR_Enable( level ); _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); ffc1a038: 38 7f 00 68 addi r3,r31,104 ffc1a03c: 38 9e 00 10 addi r4,r30,16 ffc1a040: 48 00 44 c9 bl ffc1e508 <_Watchdog_Insert> if ( !ts->active ) { ffc1a044: 89 3f 00 7c lbz r9,124(r31) ffc1a048: 2f 89 00 00 cmpwi cr7,r9,0 ffc1a04c: 40 be 00 0c bne+ cr7,ffc1a058 <_Timer_server_Schedule_operation_method+0x144><== NEVER TAKEN _Timer_server_Reset_tod_system_watchdog( ts ); ffc1a050: 7f e3 fb 78 mr r3,r31 ffc1a054: 4b ff fc 81 bl ffc19cd4 <_Timer_server_Reset_tod_system_watchdog> * 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 ); } } ffc1a058: 80 01 00 1c lwz r0,28(r1) ffc1a05c: bb a1 00 0c lmw r29,12(r1) ffc1a060: 7c 08 03 a6 mtlr r0 ffc1a064: 38 21 00 18 addi r1,r1,24 if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); ffc1a068: 48 00 35 7c b ffc1d5e4 <_Thread_Enable_dispatch> * 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 ); } } ffc1a06c: 80 01 00 1c lwz r0,28(r1) ffc1a070: bb a1 00 0c lmw r29,12(r1) ffc1a074: 7c 08 03 a6 mtlr r0 * 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 ); ffc1a078: 80 63 00 78 lwz r3,120(r3) } } ffc1a07c: 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 ); ffc1a080: 48 00 08 58 b ffc1a8d8 <_Chain_Append> =============================================================================== ffc0d54c <_Timestamp64_Divide>: const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { ffc0d54c: 94 21 ff e8 stwu r1,-24(r1) ffc0d550: 7c 08 02 a6 mflr r0 ffc0d554: 90 01 00 1c stw r0,28(r1) ffc0d558: bf 81 00 08 stmw r28,8(r1) ffc0d55c: 7c be 2b 78 mr r30,r5 ffc0d560: 7c df 33 78 mr r31,r6 Timestamp64_Control answer; if ( *_rhs == 0 ) { ffc0d564: 80 a4 00 00 lwz r5,0(r4) ffc0d568: 81 24 00 04 lwz r9,4(r4) ffc0d56c: 7c a8 4b 79 or. r8,r5,r9 ffc0d570: 40 a2 00 10 bne+ ffc0d580 <_Timestamp64_Divide+0x34> <== ALWAYS TAKEN *_ival_percentage = 0; ffc0d574: 91 1e 00 00 stw r8,0(r30) <== NOT EXECUTED *_fval_percentage = 0; ffc0d578: 91 06 00 00 stw r8,0(r6) <== NOT EXECUTED return; ffc0d57c: 48 00 00 5c b ffc0d5d8 <_Timestamp64_Divide+0x8c> <== NOT EXECUTED * This looks odd but gives the results the proper precision. * * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; ffc0d580: 80 c3 00 04 lwz r6,4(r3) ffc0d584: 3d 00 00 01 lis r8,1 ffc0d588: 80 e3 00 00 lwz r7,0(r3) ffc0d58c: 61 08 86 a0 ori r8,r8,34464 ffc0d590: 7c 68 30 16 mulhwu r3,r8,r6 ffc0d594: 7c e8 39 d6 mullw r7,r8,r7 ffc0d598: 7c 88 31 d6 mullw r4,r8,r6 ffc0d59c: 7c 67 1a 14 add r3,r7,r3 ffc0d5a0: 7d 26 4b 78 mr r6,r9 ffc0d5a4: 48 00 dd 7d bl ffc1b320 <__divdi3> *_ival_percentage = answer / 1000; ffc0d5a8: 38 a0 00 00 li r5,0 ffc0d5ac: 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; ffc0d5b0: 7c 7c 1b 78 mr r28,r3 ffc0d5b4: 7c 9d 23 78 mr r29,r4 *_ival_percentage = answer / 1000; ffc0d5b8: 48 00 dd 69 bl ffc1b320 <__divdi3> ffc0d5bc: 90 9e 00 00 stw r4,0(r30) *_fval_percentage = answer % 1000; ffc0d5c0: 7f 83 e3 78 mr r3,r28 ffc0d5c4: 7f a4 eb 78 mr r4,r29 ffc0d5c8: 38 a0 00 00 li r5,0 ffc0d5cc: 38 c0 03 e8 li r6,1000 ffc0d5d0: 48 00 e1 75 bl ffc1b744 <__moddi3> ffc0d5d4: 90 9f 00 00 stw r4,0(r31) } ffc0d5d8: 39 61 00 18 addi r11,r1,24 ffc0d5dc: 4b ff 3d 54 b ffc01330 <_restgpr_28_x> =============================================================================== ffc0d840 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { ffc0d840: 94 21 ff e8 stwu r1,-24(r1) ffc0d844: 7c 08 02 a6 mflr r0 ffc0d848: 90 01 00 1c stw r0,28(r1) ffc0d84c: bf 81 00 08 stmw r28,8(r1) ffc0d850: 7c 7e 1b 78 mr r30,r3 static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0d854: 7d 20 00 a6 mfmsr r9 ffc0d858: 7d 50 42 a6 mfsprg r10,0 ffc0d85c: 7d 2a 50 78 andc r10,r9,r10 ffc0d860: 7d 40 01 24 mtmsr r10 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc0d864: 81 43 00 00 lwz r10,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 ); ffc0d868: 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 ) ) { ffc0d86c: 7f 8a e8 00 cmpw cr7,r10,r29 ffc0d870: 41 9e 00 80 beq- cr7,ffc0d8f0 <_Watchdog_Adjust+0xb0> switch ( direction ) { ffc0d874: 2f 84 00 00 cmpwi cr7,r4,0 ffc0d878: 7c bf 2b 78 mr r31,r5 ffc0d87c: 41 9e 00 68 beq- cr7,ffc0d8e4 <_Watchdog_Adjust+0xa4> ffc0d880: 2f 84 00 01 cmpwi cr7,r4,1 ffc0d884: 40 be 00 6c bne+ cr7,ffc0d8f0 <_Watchdog_Adjust+0xb0> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; ffc0d888: 81 0a 00 10 lwz r8,16(r10) ffc0d88c: 7f e8 2a 14 add r31,r8,r5 ffc0d890: 48 00 00 18 b ffc0d8a8 <_Watchdog_Adjust+0x68> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc0d894: 81 5e 00 00 lwz r10,0(r30) break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { ffc0d898: 81 0a 00 10 lwz r8,16(r10) ffc0d89c: 7f 9f 40 40 cmplw cr7,r31,r8 ffc0d8a0: 40 bc 00 10 bge+ cr7,ffc0d8b0 <_Watchdog_Adjust+0x70> _Watchdog_First( header )->delta_interval -= units; ffc0d8a4: 7f ff 40 50 subf r31,r31,r8 ffc0d8a8: 93 ea 00 10 stw r31,16(r10) break; ffc0d8ac: 48 00 00 44 b ffc0d8f0 <_Watchdog_Adjust+0xb0> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; ffc0d8b0: 93 8a 00 10 stw r28,16(r10) while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; ffc0d8b4: 7f e8 f8 50 subf r31,r8,r31 return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0d8b8: 7d 20 01 24 mtmsr r9 _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); _Watchdog_Tickle( header ); ffc0d8bc: 7f c3 f3 78 mr r3,r30 ffc0d8c0: 48 00 02 41 bl ffc0db00 <_Watchdog_Tickle> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0d8c4: 7d 20 00 a6 mfmsr r9 ffc0d8c8: 7d 50 42 a6 mfsprg r10,0 ffc0d8cc: 7d 2a 50 78 andc r10,r9,r10 ffc0d8d0: 7d 40 01 24 mtmsr r10 _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) ffc0d8d4: 81 5e 00 00 lwz r10,0(r30) ffc0d8d8: 7f 8a e8 00 cmpw cr7,r10,r29 ffc0d8dc: 40 be 00 0c bne+ cr7,ffc0d8e8 <_Watchdog_Adjust+0xa8> ffc0d8e0: 48 00 00 10 b ffc0d8f0 <_Watchdog_Adjust+0xb0> if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; ffc0d8e4: 3b 80 00 01 li r28,1 switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { ffc0d8e8: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0d8ec: 40 9e ff a8 bne+ cr7,ffc0d894 <_Watchdog_Adjust+0x54> <== ALWAYS TAKEN return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0d8f0: 7d 20 01 24 mtmsr r9 } } _ISR_Enable( level ); } ffc0d8f4: 39 61 00 18 addi r11,r1,24 ffc0d8f8: 4b ff 3a 38 b ffc01330 <_restgpr_28_x> =============================================================================== ffc0c018 <_Watchdog_Remove>: #include Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { ffc0c018: 7c 69 1b 78 mr r9,r3 static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0c01c: 7c c0 00 a6 mfmsr r6 ffc0c020: 7d 50 42 a6 mfsprg r10,0 ffc0c024: 7c ca 50 78 andc r10,r6,r10 ffc0c028: 7d 40 01 24 mtmsr r10 ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); previous_state = the_watchdog->state; ffc0c02c: 80 63 00 08 lwz r3,8(r3) switch ( previous_state ) { ffc0c030: 2f 83 00 01 cmpwi cr7,r3,1 ffc0c034: 41 9e 00 18 beq- cr7,ffc0c04c <_Watchdog_Remove+0x34> ffc0c038: 2b 83 00 01 cmplwi cr7,r3,1 ffc0c03c: 41 9c 00 70 blt- cr7,ffc0c0ac <_Watchdog_Remove+0x94> ffc0c040: 2b 83 00 03 cmplwi cr7,r3,3 ffc0c044: 41 9d 00 68 bgt- cr7,ffc0c0ac <_Watchdog_Remove+0x94> <== NEVER TAKEN ffc0c048: 48 00 00 10 b ffc0c058 <_Watchdog_Remove+0x40> /* * 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; ffc0c04c: 39 40 00 00 li r10,0 ffc0c050: 91 49 00 08 stw r10,8(r9) break; ffc0c054: 48 00 00 58 b ffc0c0ac <_Watchdog_Remove+0x94> case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; ffc0c058: 39 40 00 00 li r10,0 ffc0c05c: 91 49 00 08 stw r10,8(r9) } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } ffc0c060: 81 49 00 00 lwz r10,0(r9) case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) ffc0c064: 81 0a 00 00 lwz r8,0(r10) ffc0c068: 2f 88 00 00 cmpwi cr7,r8,0 ffc0c06c: 41 9e 00 14 beq- cr7,ffc0c080 <_Watchdog_Remove+0x68> next_watchdog->delta_interval += the_watchdog->delta_interval; ffc0c070: 80 ea 00 10 lwz r7,16(r10) ffc0c074: 81 09 00 10 lwz r8,16(r9) ffc0c078: 7d 07 42 14 add r8,r7,r8 ffc0c07c: 91 0a 00 10 stw r8,16(r10) if ( _Watchdog_Sync_count ) ffc0c080: 3d 00 00 00 lis r8,0 ffc0c084: 81 08 28 40 lwz r8,10304(r8) ffc0c088: 2f 88 00 00 cmpwi cr7,r8,0 ffc0c08c: 41 9e 00 14 beq- cr7,ffc0c0a0 <_Watchdog_Remove+0x88> _Watchdog_Sync_level = _ISR_Nest_level; ffc0c090: 3d 00 00 00 lis r8,0 ffc0c094: 80 e8 2e 08 lwz r7,11784(r8) ffc0c098: 3d 00 00 00 lis r8,0 ffc0c09c: 90 e8 28 38 stw r7,10296(r8) { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; ffc0c0a0: 81 09 00 04 lwz r8,4(r9) next->previous = previous; ffc0c0a4: 91 0a 00 04 stw r8,4(r10) previous->next = next; ffc0c0a8: 91 48 00 00 stw r10,0(r8) _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; ffc0c0ac: 3d 40 00 00 lis r10,0 ffc0c0b0: 81 4a 28 44 lwz r10,10308(r10) ffc0c0b4: 91 49 00 18 stw r10,24(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0c0b8: 7c c0 01 24 mtmsr r6 _ISR_Enable( level ); return( previous_state ); } ffc0c0bc: 4e 80 00 20 blr =============================================================================== ffc0c0c0 <_Watchdog_Tickle>: #include void _Watchdog_Tickle( Chain_Control *header ) { ffc0c0c0: 94 21 ff e8 stwu r1,-24(r1) ffc0c0c4: 7c 08 02 a6 mflr r0 ffc0c0c8: 90 01 00 1c stw r0,28(r1) ffc0c0cc: bf 81 00 08 stmw r28,8(r1) ffc0c0d0: 7c 7e 1b 78 mr r30,r3 static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0c0d4: 7f a0 00 a6 mfmsr r29 ffc0c0d8: 7d 30 42 a6 mfsprg r9,0 ffc0c0dc: 7f a9 48 78 andc r9,r29,r9 ffc0c0e0: 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; ffc0c0e4: 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 ); ffc0c0e8: 3b 83 00 04 addi r28,r3,4 * volatile data - till, 2003/7 */ _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) ffc0c0ec: 7f 9f e0 00 cmpw cr7,r31,r28 ffc0c0f0: 41 9e 00 6c beq- cr7,ffc0c15c <_Watchdog_Tickle+0x9c> * 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) { ffc0c0f4: 81 3f 00 10 lwz r9,16(r31) ffc0c0f8: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c0fc: 41 9e 00 14 beq- cr7,ffc0c110 <_Watchdog_Tickle+0x50> <== NEVER TAKEN the_watchdog->delta_interval--; ffc0c100: 39 29 ff ff addi r9,r9,-1 ffc0c104: 91 3f 00 10 stw r9,16(r31) if ( the_watchdog->delta_interval != 0 ) ffc0c108: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c10c: 40 9e 00 50 bne- cr7,ffc0c15c <_Watchdog_Tickle+0x9c> goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); ffc0c110: 7f e3 fb 78 mr r3,r31 ffc0c114: 4b ff ff 05 bl ffc0c018 <_Watchdog_Remove> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0c118: 7f a0 01 24 mtmsr r29 _ISR_Enable( level ); switch( watchdog_state ) { ffc0c11c: 2f 83 00 02 cmpwi cr7,r3,2 ffc0c120: 40 be 00 18 bne+ cr7,ffc0c138 <_Watchdog_Tickle+0x78> case WATCHDOG_ACTIVE: (*the_watchdog->routine)( ffc0c124: 81 3f 00 1c lwz r9,28(r31) ffc0c128: 80 7f 00 20 lwz r3,32(r31) ffc0c12c: 80 9f 00 24 lwz r4,36(r31) ffc0c130: 7d 29 03 a6 mtctr r9 ffc0c134: 4e 80 04 21 bctrl static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0c138: 7f a0 00 a6 mfmsr r29 ffc0c13c: 7d 30 42 a6 mfsprg r9,0 ffc0c140: 7f a9 48 78 andc r9,r29,r9 ffc0c144: 7d 20 01 24 mtmsr r9 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc0c148: 83 fe 00 00 lwz r31,0(r30) _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); ffc0c14c: 7f 9f e0 00 cmpw cr7,r31,r28 ffc0c150: 41 9e 00 0c beq- cr7,ffc0c15c <_Watchdog_Tickle+0x9c> } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && ffc0c154: 81 3f 00 10 lwz r9,16(r31) ffc0c158: 4b ff ff b0 b ffc0c108 <_Watchdog_Tickle+0x48> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0c15c: 7f a0 01 24 mtmsr r29 (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } ffc0c160: 39 61 00 18 addi r11,r1,24 ffc0c164: 4b ff 44 54 b ffc005b8 <_restgpr_28_x> =============================================================================== ffc0c168 <_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(); ffc0c168: 3d 40 ff c2 lis r10,-62 void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc0c16c: 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(); ffc0c170: 39 2a ad 58 addi r9,r10,-21160 void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc0c174: 94 21 ff d0 stwu r1,-48(r1) ffc0c178: 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(); ffc0c17c: 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 ) { ffc0c180: bf 01 00 10 stmw r24,16(r1) ffc0c184: 7c 99 23 78 mr r25,r4 Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); ffc0c188: 2f 88 00 00 cmpwi cr7,r8,0 ffc0c18c: 83 ca ad 58 lwz r30,-21160(r10) void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc0c190: 7c ba 2b 78 mr r26,r5 ffc0c194: 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(); ffc0c198: 39 40 00 00 li r10,0 void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc0c19c: 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(); ffc0c1a0: 40 9e 00 08 bne- cr7,ffc0c1a8 <_Workspace_Handler_initialization+0x40> ffc0c1a4: 81 49 00 04 lwz r10,4(r9) ffc0c1a8: 7f ca f2 14 add r30,r10,r30 bool do_zero = rtems_configuration_get_do_zero_of_workspace(); ffc0c1ac: 89 49 00 30 lbz r10,48(r9) bool unified = rtems_configuration_get_unified_work_area(); ffc0c1b0: 89 29 00 31 lbz r9,49(r9) Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; ffc0c1b4: 3f 60 ff c1 lis r27,-63 } else { size = 0; } } space_available = (*init_or_extend)( ffc0c1b8: 3f 00 00 00 lis r24,0 ffc0c1bc: 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) { ffc0c1c0: 3b 80 00 00 li r28,0 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; ffc0c1c4: 3b 7b 9a f8 addi r27,r27,-25864 size_t i; for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { ffc0c1c8: 2e 0a 00 00 cmpwi cr4,r10,0 if ( area->size > overhead ) { uintptr_t space_available; uintptr_t size; if ( unified ) { ffc0c1cc: 2d 89 00 00 cmpwi cr3,r9,0 } else { size = 0; } } space_available = (*init_or_extend)( ffc0c1d0: 3b 18 2c 94 addi r24,r24,11412 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) { ffc0c1d4: 48 00 00 9c b ffc0c270 <_Workspace_Handler_initialization+0x108> Heap_Area *area = &areas [i]; if ( do_zero ) { ffc0c1d8: 41 b2 00 14 beq+ cr4,ffc0c1ec <_Workspace_Handler_initialization+0x84> memset( area->begin, 0, area->size ); ffc0c1dc: 80 7f 00 00 lwz r3,0(r31) ffc0c1e0: 38 80 00 00 li r4,0 ffc0c1e4: 80 bf 00 04 lwz r5,4(r31) ffc0c1e8: 48 00 44 49 bl ffc10630 } if ( area->size > overhead ) { ffc0c1ec: 83 bf 00 04 lwz r29,4(r31) ffc0c1f0: 2b 9d 00 16 cmplwi cr7,r29,22 ffc0c1f4: 40 9d 00 74 ble- cr7,ffc0c268 <_Workspace_Handler_initialization+0x100> uintptr_t space_available; uintptr_t size; if ( unified ) { ffc0c1f8: 40 8e 00 24 bne- cr3,ffc0c21c <_Workspace_Handler_initialization+0xb4> size = area->size; } else { if ( remaining > 0 ) { ffc0c1fc: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0c200: 41 9e 00 18 beq- cr7,ffc0c218 <_Workspace_Handler_initialization+0xb0><== NEVER TAKEN size = remaining < area->size - overhead ? ffc0c204: 39 3d ff ea addi r9,r29,-22 remaining + overhead : area->size; ffc0c208: 7f 9e 48 40 cmplw cr7,r30,r9 ffc0c20c: 40 9c 00 10 bge- cr7,ffc0c21c <_Workspace_Handler_initialization+0xb4><== NEVER TAKEN ffc0c210: 3b be 00 16 addi r29,r30,22 ffc0c214: 48 00 00 08 b ffc0c21c <_Workspace_Handler_initialization+0xb4> } else { size = 0; ffc0c218: 3b a0 00 00 li r29,0 <== NOT EXECUTED } } space_available = (*init_or_extend)( ffc0c21c: 7f a5 eb 78 mr r5,r29 ffc0c220: 80 9f 00 00 lwz r4,0(r31) ffc0c224: 7f 03 c3 78 mr r3,r24 ffc0c228: 7f 69 03 a6 mtctr r27 ffc0c22c: 38 c0 00 08 li r6,8 ffc0c230: 4e 80 04 21 bctrl area->begin, size, page_size ); area->begin = (char *) area->begin + size; ffc0c234: 81 3f 00 00 lwz r9,0(r31) area->size -= size; if ( space_available < remaining ) { ffc0c238: 7f 83 f0 40 cmplw cr7,r3,r30 area->begin, size, page_size ); area->begin = (char *) area->begin + size; ffc0c23c: 7d 29 ea 14 add r9,r9,r29 ffc0c240: 91 3f 00 00 stw r9,0(r31) area->size -= size; ffc0c244: 81 3f 00 04 lwz r9,4(r31) ffc0c248: 7f bd 48 50 subf r29,r29,r9 ffc0c24c: 93 bf 00 04 stw r29,4(r31) if ( space_available < remaining ) { ffc0c250: 40 9c 00 10 bge- cr7,ffc0c260 <_Workspace_Handler_initialization+0xf8><== ALWAYS TAKEN remaining -= space_available; ffc0c254: 7f c3 f0 50 subf r30,r3,r30 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; ffc0c258: 7f 5b d3 78 mr r27,r26 <== NOT EXECUTED ffc0c25c: 48 00 00 0c b ffc0c268 <_Workspace_Handler_initialization+0x100><== NOT EXECUTED ffc0c260: 7f 5b d3 78 mr r27,r26 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; ffc0c264: 3b c0 00 00 li r30,0 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) { ffc0c268: 3b 9c 00 01 addi r28,r28,1 ffc0c26c: 3b ff 00 08 addi r31,r31,8 ffc0c270: 7f 9c c8 00 cmpw cr7,r28,r25 ffc0c274: 40 9e ff 64 bne+ cr7,ffc0c1d8 <_Workspace_Handler_initialization+0x70> init_or_extend = extend; } } if ( remaining > 0 ) { ffc0c278: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0c27c: 41 be 00 14 beq+ cr7,ffc0c290 <_Workspace_Handler_initialization+0x128> _Internal_error_Occurred( ffc0c280: 38 60 00 00 li r3,0 ffc0c284: 38 80 00 01 li r4,1 ffc0c288: 38 a0 00 02 li r5,2 ffc0c28c: 4b ff da ed bl ffc09d78 <_Internal_error_Occurred> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_TOO_LITTLE_WORKSPACE ); } } ffc0c290: 81 81 00 0c lwz r12,12(r1) ffc0c294: 39 61 00 30 addi r11,r1,48 ffc0c298: 7d 81 81 20 mtcrf 24,r12 ffc0c29c: 4b ff 43 0c b ffc005a8 <_restgpr_24_x> =============================================================================== ffc0bc58 <_Workspace_String_duplicate>: char *_Workspace_String_duplicate( const char *string, size_t len ) { ffc0bc58: 94 21 ff e8 stwu r1,-24(r1) ffc0bc5c: 7c 08 02 a6 mflr r0 ffc0bc60: bf a1 00 0c stmw r29,12(r1) ffc0bc64: 7c 7d 1b 78 mr r29,r3 char *dup = _Workspace_Allocate(len + 1); ffc0bc68: 38 64 00 01 addi r3,r4,1 char *_Workspace_String_duplicate( const char *string, size_t len ) { ffc0bc6c: 90 01 00 1c stw r0,28(r1) ffc0bc70: 7c 9f 23 78 mr r31,r4 char *dup = _Workspace_Allocate(len + 1); ffc0bc74: 4b ff ff 75 bl ffc0bbe8 <_Workspace_Allocate> if (dup != NULL) { ffc0bc78: 7c 7e 1b 79 mr. r30,r3 ffc0bc7c: 41 82 00 18 beq- ffc0bc94 <_Workspace_String_duplicate+0x3c><== NEVER TAKEN dup [len] = '\0'; ffc0bc80: 39 20 00 00 li r9,0 ffc0bc84: 7d 3e f9 ae stbx r9,r30,r31 memcpy(dup, string, len); ffc0bc88: 7f a4 eb 78 mr r4,r29 ffc0bc8c: 7f e5 fb 78 mr r5,r31 ffc0bc90: 48 00 41 2d bl ffc0fdbc } return dup; } ffc0bc94: 39 61 00 18 addi r11,r1,24 ffc0bc98: 7f c3 f3 78 mr r3,r30 ffc0bc9c: 48 00 83 64 b ffc14000 <_restgpr_29_x> =============================================================================== ffc1a4d0 <__kill>: #endif int __kill( pid_t pid, int sig ) { return 0; } ffc1a4d0: 38 60 00 00 li r3,0 <== NOT EXECUTED ffc1a4d4: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc13b98 <_fat_block_read>: uint32_t start, uint32_t offset, uint32_t count, void *buff ) { ffc13b98: 94 21 ff c8 stwu r1,-56(r1) ffc13b9c: 7c 08 02 a6 mflr r0 ffc13ba0: bf 21 00 1c stmw r25,28(r1) ffc13ba4: 7c 7a 1b 78 mr r26,r3 ffc13ba8: 7c df 33 78 mr r31,r6 ffc13bac: 90 01 00 3c stw r0,60(r1) ffc13bb0: 7c f9 3b 78 mr r25,r7 int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; uint32_t ofs = offset; ffc13bb4: 7c bb 2b 78 mr r27,r5 void *buff ) { int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; ffc13bb8: 7c 9c 23 78 mr r28,r4 uint32_t count, void *buff ) { int rc = RC_OK; ssize_t cmpltd = 0; ffc13bbc: 3b c0 00 00 li r30,0 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) ffc13bc0: 48 00 00 58 b ffc13c18 <_fat_block_read+0x80> { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); ffc13bc4: 7f 43 d3 78 mr r3,r26 ffc13bc8: 7f 84 e3 78 mr r4,r28 ffc13bcc: 38 a0 00 01 li r5,1 ffc13bd0: 38 c1 00 08 addi r6,r1,8 ffc13bd4: 4b ff fe fd bl ffc13ad0 if (rc != RC_OK) ffc13bd8: 2f 83 00 00 cmpwi cr7,r3,0 ffc13bdc: 40 9e 00 48 bne- cr7,ffc13c24 <_fat_block_read+0x8c> <== NEVER TAKEN return -1; c = MIN(count, (fs_info->vol.bps - ofs)); ffc13be0: a3 ba 00 00 lhz r29,0(r26) ffc13be4: 7f bb e8 50 subf r29,r27,r29 ffc13be8: 7f 9d f8 40 cmplw cr7,r29,r31 ffc13bec: 40 9d 00 08 ble- cr7,ffc13bf4 <_fat_block_read+0x5c> ffc13bf0: 7f fd fb 78 mr r29,r31 memcpy((buff + cmpltd), (sec_buf + ofs), c); ffc13bf4: 80 81 00 08 lwz r4,8(r1) ffc13bf8: 7c 79 f2 14 add r3,r25,r30 ffc13bfc: 7f a5 eb 78 mr r5,r29 ffc13c00: 7c 84 da 14 add r4,r4,r27 ffc13c04: 48 00 84 51 bl ffc1c054 count -= c; ffc13c08: 7f fd f8 50 subf r31,r29,r31 cmpltd += c; ffc13c0c: 7f dd f2 14 add r30,r29,r30 sec_num++; ffc13c10: 3b 9c 00 01 addi r28,r28,1 ofs = 0; ffc13c14: 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) ffc13c18: 2f 9f 00 00 cmpwi cr7,r31,0 ffc13c1c: 40 9e ff a8 bne+ cr7,ffc13bc4 <_fat_block_read+0x2c> ffc13c20: 48 00 00 08 b ffc13c28 <_fat_block_read+0x90> { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; ffc13c24: 3b c0 ff ff li r30,-1 <== NOT EXECUTED cmpltd += c; sec_num++; ofs = 0; } return cmpltd; } ffc13c28: 39 61 00 38 addi r11,r1,56 ffc13c2c: 7f c3 f3 78 mr r3,r30 ffc13c30: 4b fe d9 b4 b ffc015e4 <_restgpr_25_x> =============================================================================== ffc046cc <_gettimeofday>: int _gettimeofday( struct timeval *tp, struct timezone *tzp ) { return gettimeofday( tp, tzp ); ffc046cc: 4b ff ff 60 b ffc0462c <== NOT EXECUTED =============================================================================== ffc0523c <_lstat_r>: struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { return _STAT_NAME( path, buf ); ffc0523c: 7c 83 23 78 mr r3,r4 <== NOT EXECUTED ffc05240: 7c a4 2b 78 mr r4,r5 <== NOT EXECUTED ffc05244: 4b ff ff 8c b ffc051d0 <== NOT EXECUTED =============================================================================== ffc05514 <_stat_r>: struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { return _STAT_NAME( path, buf ); ffc05514: 7c 83 23 78 mr r3,r4 <== NOT EXECUTED ffc05518: 7c a4 2b 78 mr r4,r5 <== NOT EXECUTED ffc0551c: 4b ff ff 8c b ffc054a8 <== NOT EXECUTED =============================================================================== ffc04dec : #include #include int chroot( const char *path ) { ffc04dec: 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( ffc04df0: 3c c0 00 00 lis r6,0 #include #include int chroot( const char *path ) { ffc04df4: 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( ffc04df8: 38 c6 21 3c addi r6,r6,8508 #include #include int chroot( const char *path ) { ffc04dfc: 7c 64 1b 78 mr r4,r3 ffc04e00: bf c1 00 68 stmw 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( ffc04e04: 38 a0 00 19 li r5,25 ffc04e08: 38 e6 ff fc addi r7,r6,-4 #include #include int chroot( const char *path ) { ffc04e0c: 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( ffc04e10: 38 61 00 08 addi r3,r1,8 ffc04e14: 48 00 15 51 bl ffc06364 ffc04e18: 38 61 00 40 addi r3,r1,64 ffc04e1c: 38 81 00 20 addi r4,r1,32 ffc04e20: 48 00 1b 45 bl ffc06964 &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 ); ffc04e24: 38 61 00 40 addi r3,r1,64 ffc04e28: 48 00 1d 65 bl ffc06b8c if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { ffc04e2c: 3f c0 ff c1 lis r30,-63 ffc04e30: 81 23 00 10 lwz r9,16(r3) ffc04e34: 3b de 2d 80 addi r30,r30,11648 &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 ); ffc04e38: 90 61 00 58 stw r3,88(r1) if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { ffc04e3c: 7f 89 f0 00 cmpw cr7,r9,r30 ffc04e40: 41 9e 00 90 beq- cr7,ffc04ed0 rtems_filesystem_global_location_t *new_root_loc = ffc04e44: 38 61 00 58 addi r3,r1,88 ffc04e48: 48 00 1c 79 bl ffc06ac0 rtems_filesystem_global_location_obtain( &new_current_loc ); rtems_filesystem_node_types_t type = (*new_root_loc->location.mt_entry->ops->node_type_h)( ffc04e4c: 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 = ffc04e50: 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)( ffc04e54: 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 = ffc04e58: 81 29 00 14 lwz r9,20(r9) ffc04e5c: 7d 29 03 a6 mtctr r9 ffc04e60: 4e 80 04 21 bctrl (*new_root_loc->location.mt_entry->ops->node_type_h)( &new_root_loc->location ); if ( type == RTEMS_FILESYSTEM_DIRECTORY ) { ffc04e64: 2f 83 00 00 cmpwi cr7,r3,0 ffc04e68: 40 9e 00 4c bne- cr7,ffc04eb4 sc = rtems_libio_set_private_env(); ffc04e6c: 48 00 0d 81 bl ffc05bec if (sc == RTEMS_SUCCESSFUL) { ffc04e70: 2c 03 00 00 cmpwi r3,0 ffc04e74: 40 a2 00 2c bne+ ffc04ea0 rtems_filesystem_global_location_assign( ffc04e78: 3f c0 00 00 lis r30,0 ffc04e7c: 80 7e 27 08 lwz r3,9992(r30) ffc04e80: 7f e4 fb 78 mr r4,r31 &rtems_filesystem_root, new_root_loc ); rtems_filesystem_global_location_assign( ffc04e84: 3b e0 00 00 li r31,0 ); if ( type == RTEMS_FILESYSTEM_DIRECTORY ) { sc = rtems_libio_set_private_env(); if (sc == RTEMS_SUCCESSFUL) { rtems_filesystem_global_location_assign( ffc04e88: 38 63 00 04 addi r3,r3,4 ffc04e8c: 48 00 1b f5 bl ffc06a80 &rtems_filesystem_root, new_root_loc ); rtems_filesystem_global_location_assign( ffc04e90: 80 7e 27 08 lwz r3,9992(r30) ffc04e94: 80 81 00 58 lwz r4,88(r1) ffc04e98: 48 00 1b e9 bl ffc06a80 ffc04e9c: 48 00 00 38 b ffc04ed4 &rtems_filesystem_current, new_current_loc ); } else { if (sc != RTEMS_UNSATISFIED) { ffc04ea0: 2f 83 00 0d cmpwi cr7,r3,13 ffc04ea4: 41 9e 00 4c beq- cr7,ffc04ef0 <== NEVER TAKEN errno = ENOMEM; ffc04ea8: 48 00 74 ad bl ffc0c354 <__errno> ffc04eac: 39 20 00 0c li r9,12 ffc04eb0: 48 00 00 18 b ffc04ec8 static inline void rtems_filesystem_location_error( const rtems_filesystem_location_info_t *loc, int eno ) { if ( !rtems_filesystem_location_is_null( loc ) ) { ffc04eb4: 81 3f 00 10 lwz r9,16(r31) ffc04eb8: 7f 89 f0 00 cmpw cr7,r9,r30 ffc04ebc: 41 9e 00 34 beq- cr7,ffc04ef0 <== NEVER TAKEN errno = eno; ffc04ec0: 48 00 74 95 bl ffc0c354 <__errno> ffc04ec4: 39 20 00 14 li r9,20 ffc04ec8: 91 23 00 00 stw r9,0(r3) ffc04ecc: 48 00 00 24 b ffc04ef0 if ( rv != 0 ) { rtems_filesystem_global_location_release( new_root_loc ); } } else { rv = -1; ffc04ed0: 3b e0 ff ff li r31,-1 } rtems_filesystem_eval_path_cleanup( &ctx ); ffc04ed4: 38 61 00 08 addi r3,r1,8 ffc04ed8: 48 00 16 0d bl ffc064e4 if ( rv != 0 ) { ffc04edc: 2f 9f 00 00 cmpwi cr7,r31,0 ffc04ee0: 41 be 00 1c beq+ cr7,ffc04efc rtems_filesystem_global_location_release( new_current_loc ); ffc04ee4: 80 61 00 58 lwz r3,88(r1) ffc04ee8: 48 00 1b 41 bl ffc06a28 ffc04eec: 48 00 00 10 b ffc04efc rtems_filesystem_location_error( &new_root_loc->location, ENOTDIR ); rv = -1; } if ( rv != 0 ) { rtems_filesystem_global_location_release( new_root_loc ); ffc04ef0: 7f e3 fb 78 mr r3,r31 ffc04ef4: 48 00 1b 35 bl ffc06a28 ffc04ef8: 4b ff ff d8 b ffc04ed0 if ( rv != 0 ) { rtems_filesystem_global_location_release( new_current_loc ); } return rv; } ffc04efc: 39 61 00 70 addi r11,r1,112 ffc04f00: 7f e3 fb 78 mr r3,r31 ffc04f04: 48 00 b8 bc b ffc107c0 <_restgpr_30_x> =============================================================================== ffc042ac : dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { ffc042ac: 94 21 ff c8 stwu r1,-56(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) { ffc042b0: 3d 20 00 00 lis r9,0 dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { ffc042b4: 7c 08 02 a6 mflr r0 rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { ffc042b8: 39 49 28 48 addi r10,r9,10312 dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { ffc042bc: be a1 00 0c stmw r21,12(r1) ffc042c0: 7c 7d 1b 78 mr r29,r3 ffc042c4: 7c 9e 23 78 mr r30,r4 rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { ffc042c8: 83 89 28 48 lwz r28,10312(r9) dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { ffc042cc: 7c b9 2b 78 mr r25,r5 ffc042d0: 90 01 00 3c stw r0,60(r1) ffc042d4: 7c d7 33 78 mr r23,r6 rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { ffc042d8: 7f 83 e0 40 cmplw cr7,r3,r28 dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { ffc042dc: 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) { ffc042e0: 41 9c 00 50 blt- cr7,ffc04330 rtems_disk_device_table *table = disktab; rtems_device_major_number old_size = disktab_size; rtems_device_major_number new_size = 2 * old_size; ffc042e4: 57 9f 08 3c rlwinm r31,r28,1,0,30 rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { rtems_disk_device_table *table = disktab; ffc042e8: 80 6a 00 04 lwz r3,4(r10) rtems_device_major_number old_size = disktab_size; rtems_device_major_number new_size = 2 * old_size; if (major >= new_size) { ffc042ec: 7f 9d f8 40 cmplw cr7,r29,r31 ffc042f0: 41 9c 00 08 blt- cr7,ffc042f8 <== NEVER TAKEN new_size = major + 1; ffc042f4: 3b fd 00 01 addi r31,r29,1 } table = realloc(table, new_size * sizeof(*table)); ffc042f8: 57 e4 18 38 rlwinm r4,r31,3,0,28 ffc042fc: 48 00 21 3d bl ffc06438 if (table == NULL) { ffc04300: 7c 7b 1b 79 mr. r27,r3 ffc04304: 41 82 01 50 beq- ffc04454 <== ALWAYS TAKEN return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); ffc04308: 7c bc f8 50 subf r5,r28,r31 <== NOT EXECUTED ffc0430c: 57 83 18 38 rlwinm r3,r28,3,0,28 <== NOT EXECUTED ffc04310: 7c 7b 1a 14 add r3,r27,r3 <== NOT EXECUTED ffc04314: 38 80 00 00 li r4,0 <== NOT EXECUTED ffc04318: 54 a5 18 38 rlwinm r5,r5,3,0,28 <== NOT EXECUTED ffc0431c: 48 01 05 69 bl ffc14884 <== NOT EXECUTED disktab = table; ffc04320: 3d 20 00 00 lis r9,0 <== NOT EXECUTED ffc04324: 39 49 28 48 addi r10,r9,10312 <== NOT EXECUTED disktab_size = new_size; ffc04328: 93 e9 28 48 stw r31,10312(r9) <== NOT EXECUTED if (table == NULL) { return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); disktab = table; ffc0432c: 93 6a 00 04 stw r27,4(r10) <== NOT EXECUTED disktab_size = new_size; } if (disktab [major].minor == NULL || minor >= disktab[major].size) { ffc04330: 3d 20 00 00 lis r9,0 ffc04334: 83 69 28 4c lwz r27,10316(r9) ffc04338: 57 ba 18 38 rlwinm r26,r29,3,0,28 ffc0433c: 7c 7b d0 2e lwzx r3,r27,r26 ffc04340: 7f 1b d2 14 add r24,r27,r26 ffc04344: 83 98 00 04 lwz r28,4(r24) ffc04348: 2f 83 00 00 cmpwi cr7,r3,0 ffc0434c: 41 9e 00 0c beq- cr7,ffc04358 ffc04350: 7f 9e e0 40 cmplw cr7,r30,r28 ffc04354: 41 9c 00 50 blt- cr7,ffc043a4 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) { ffc04358: 2f 9c 00 00 cmpwi cr7,r28,0 new_size = DISKTAB_INITIAL_SIZE; ffc0435c: 3b e0 00 08 li r31,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) { ffc04360: 41 9e 00 08 beq- cr7,ffc04368 new_size = DISKTAB_INITIAL_SIZE; } else { new_size = 2 * old_size; ffc04364: 57 9f 08 3c rlwinm r31,r28,1,0,30 } if (minor >= new_size) { ffc04368: 7f 9e f8 40 cmplw cr7,r30,r31 ffc0436c: 41 9c 00 08 blt- cr7,ffc04374 new_size = minor + 1; ffc04370: 3b fe 00 01 addi r31,r30,1 } table = realloc(table, new_size * sizeof(*table)); ffc04374: 57 e4 10 3a rlwinm r4,r31,2,0,29 ffc04378: 48 00 20 c1 bl ffc06438 if (table == NULL) { ffc0437c: 7c 75 1b 79 mr. r21,r3 ffc04380: 41 82 00 d4 beq- ffc04454 return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); ffc04384: 7c bc f8 50 subf r5,r28,r31 ffc04388: 57 83 10 3a rlwinm r3,r28,2,0,29 ffc0438c: 7c 75 1a 14 add r3,r21,r3 ffc04390: 38 80 00 00 li r4,0 ffc04394: 54 a5 10 3a rlwinm r5,r5,2,0,29 ffc04398: 48 01 04 ed bl ffc14884 disktab [major].minor = table; ffc0439c: 7e bb d1 2e stwx r21,r27,r26 disktab [major].size = new_size; ffc043a0: 93 f8 00 04 stw r31,4(r24) } return disktab [major].minor + minor; ffc043a4: 7f 7b d0 2e lwzx r27,r27,r26 ffc043a8: 57 dc 10 3a rlwinm r28,r30,2,0,29 ffc043ac: 7d 3b e2 14 add r9,r27,r28 { rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; if (dd_entry == NULL) { ffc043b0: 2f 89 00 00 cmpwi cr7,r9,0 ffc043b4: 40 be 00 08 bne+ cr7,ffc043bc <== ALWAYS TAKEN ffc043b8: 48 00 00 9c b ffc04454 <== NOT EXECUTED return RTEMS_NO_MEMORY; } if (*dd_entry != NULL) { ffc043bc: 7d 5b e0 2e lwzx r10,r27,r28 return RTEMS_RESOURCE_IN_USE; ffc043c0: 38 60 00 0c li r3,12 if (dd_entry == NULL) { return RTEMS_NO_MEMORY; } if (*dd_entry != NULL) { ffc043c4: 2f 8a 00 00 cmpwi cr7,r10,0 ffc043c8: 40 be 00 90 bne+ cr7,ffc04458 return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); ffc043cc: 38 60 00 78 li r3,120 ffc043d0: 48 00 15 59 bl ffc05928 if (dd == NULL) { ffc043d4: 7c 7f 1b 79 mr. r31,r3 ffc043d8: 41 82 00 7c beq- ffc04454 <== NEVER TAKEN return RTEMS_NO_MEMORY; } if (name != NULL) { ffc043dc: 2f 99 00 00 cmpwi cr7,r25,0 ffc043e0: 41 9e 00 40 beq- cr7,ffc04420 alloc_name = strdup(name); ffc043e4: 7f 23 cb 78 mr r3,r25 ffc043e8: 48 01 08 39 bl ffc14c20 if (alloc_name == NULL) { ffc043ec: 2f 83 00 00 cmpwi cr7,r3,0 if (dd == NULL) { return RTEMS_NO_MEMORY; } if (name != NULL) { alloc_name = strdup(name); ffc043f0: 7c 7a 1b 78 mr r26,r3 ffc043f4: 7c 79 1b 78 mr r25,r3 if (alloc_name == NULL) { ffc043f8: 40 be 00 40 bne+ cr7,ffc04438 <== ALWAYS TAKEN free(dd); ffc043fc: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc04400: 48 00 0f 99 bl ffc05398 <== NOT EXECUTED ffc04404: 48 00 00 50 b ffc04454 <== NOT EXECUTED } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { free(alloc_name); ffc04408: 7f 43 d3 78 mr r3,r26 <== NOT EXECUTED ffc0440c: 48 00 0f 8d bl ffc05398 <== NOT EXECUTED free(dd); ffc04410: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc04414: 48 00 0f 85 bl ffc05398 <== NOT EXECUTED return RTEMS_UNSATISFIED; ffc04418: 38 60 00 0d li r3,13 <== NOT EXECUTED ffc0441c: 48 00 00 3c b ffc04458 <== NOT EXECUTED char **alloc_name_ptr ) { rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; ffc04420: 3b 20 00 00 li r25,0 free(dd); return RTEMS_UNSATISFIED; } } *dd_entry = dd; ffc04424: 7f fb e1 2e stwx r31,r27,r28 *dd_ptr = dd; *alloc_name_ptr = alloc_name; return RTEMS_SUCCESSFUL; ffc04428: 38 60 00 00 li r3,0 return RTEMS_UNSATISFIED; } } *dd_entry = dd; *dd_ptr = dd; ffc0442c: 93 f7 00 00 stw r31,0(r23) *alloc_name_ptr = alloc_name; ffc04430: 93 36 00 00 stw r25,0(r22) return RTEMS_SUCCESSFUL; ffc04434: 48 00 00 24 b ffc04458 return RTEMS_NO_MEMORY; } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { ffc04438: 38 80 61 ff li r4,25087 ffc0443c: 7f a5 eb 78 mr r5,r29 ffc04440: 7f c6 f3 78 mr r6,r30 ffc04444: 48 00 16 89 bl ffc05acc ffc04448: 2f 83 00 00 cmpwi cr7,r3,0 ffc0444c: 40 9c ff d8 bge+ cr7,ffc04424 <== ALWAYS TAKEN ffc04450: 4b ff ff b8 b ffc04408 <== NOT EXECUTED rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; if (dd_entry == NULL) { return RTEMS_NO_MEMORY; ffc04454: 38 60 00 1a li r3,26 *dd_entry = dd; *dd_ptr = dd; *alloc_name_ptr = alloc_name; return RTEMS_SUCCESSFUL; } ffc04458: 39 61 00 38 addi r11,r1,56 ffc0445c: 48 01 45 58 b ffc189b4 <_restgpr_21_x> =============================================================================== ffc058c8 : * 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) ffc058c8: 94 21 ff e8 stwu r1,-24(r1) ffc058cc: 7c 08 02 a6 mflr r0 if (new_part_desc == NULL) { return RTEMS_INTERNAL_ERROR; } *new_part_desc = NULL; ffc058d0: 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) ffc058d4: bf a1 00 0c stmw r29,12(r1) ffc058d8: 7c 7e 1b 78 mr r30,r3 ffc058dc: 7c 9d 23 78 mr r29,r4 ffc058e0: 90 01 00 1c stw r0,28(r1) return RTEMS_INTERNAL_ERROR; } *new_part_desc = NULL; if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) ffc058e4: 38 60 00 01 li r3,1 if (new_part_desc == NULL) { return RTEMS_INTERNAL_ERROR; } *new_part_desc = NULL; ffc058e8: 91 24 00 00 stw r9,0(r4) if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) ffc058ec: 38 80 00 28 li r4,40 ffc058f0: 48 00 0d 59 bl ffc06648 ffc058f4: 7c 7f 1b 79 mr. r31,r3 ffc058f8: 41 82 00 a0 beq- ffc05998 <== NEVER TAKEN { return RTEMS_NO_MEMORY; } part_desc->bootable = *(data + RTEMS_IDE_PARTITION_BOOTABLE_OFFSET); ffc058fc: 89 3e 00 00 lbz r9,0(r30) ffc05900: 99 3f 00 00 stb r9,0(r31) part_desc->sys_type = *(data + RTEMS_IDE_PARTITION_SYS_TYPE_OFFSET); ffc05904: 88 9e 00 04 lbz r4,4(r30) ffc05908: 98 9f 00 01 stb r4,1(r31) uint32_t value ) { uint32_t swapped; __asm__ volatile("rlwimi %0,%1,8,24,31;" ffc0590c: 81 3e 00 08 lwz r9,8(r30) ffc05910: 51 28 46 3e rlwimi r8,r9,8,24,31 ffc05914: 51 28 c4 2e rlwimi r8,r9,24,16,23 ffc05918: 51 28 42 1e rlwimi r8,r9,8,8,15 ffc0591c: 51 28 c0 0e rlwimi r8,r9,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); ffc05920: 91 1f 00 04 stw r8,4(r31) ffc05924: 81 3e 00 0c lwz r9,12(r30) ffc05928: 51 3e 46 3e rlwimi r30,r9,8,24,31 ffc0592c: 51 3e c4 2e rlwimi r30,r9,24,16,23 ffc05930: 51 3e 42 1e rlwimi r30,r9,8,8,15 ffc05934: 51 3e c0 0e rlwimi r30,r9,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)); ffc05938: 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); ffc0593c: 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)); ffc05940: 41 9e 00 14 beq- cr7,ffc05954 ffc05944: 68 89 00 85 xori r9,r4,133 ffc05948: 7d 29 00 34 cntlzw r9,r9 ffc0594c: 55 29 d9 7e rlwinm r9,r9,27,5,31 ffc05950: 48 00 00 08 b ffc05958 ffc05954: 39 20 00 01 li r9,1 * use partitions that are * - extended * or * - FAT type and non-zero */ if (is_extended(part_desc->sys_type) || ffc05958: 2f 89 00 00 cmpwi cr7,r9,0 ffc0595c: 40 9e 00 24 bne- cr7,ffc05980 DOS_P32MB_PARTITION, FAT32_PARTITION ,FAT32_LBA_PARTITION, FAT16_LBA_PARTITION }; return (NULL != memchr(fat_part_types,type,sizeof(fat_part_types))); ffc05960: 3c 60 ff c2 lis r3,-62 ffc05964: 38 63 50 1c addi r3,r3,20508 ffc05968: 38 a0 00 06 li r5,6 ffc0596c: 48 01 02 b5 bl ffc15c20 * use partitions that are * - extended * or * - FAT type and non-zero */ if (is_extended(part_desc->sys_type) || ffc05970: 2f 83 00 00 cmpwi cr7,r3,0 ffc05974: 41 9e 00 14 beq- cr7,ffc05988 ((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) { ffc05978: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0597c: 41 be 00 0c beq+ cr7,ffc05988 <== NEVER TAKEN *new_part_desc = part_desc; ffc05980: 93 fd 00 00 stw r31,0(r29) ffc05984: 48 00 00 0c b ffc05990 } else { /* empty partition */ free(part_desc); ffc05988: 7f e3 fb 78 mr r3,r31 ffc0598c: 48 00 0d a1 bl ffc0672c } return RTEMS_SUCCESSFUL; ffc05990: 38 60 00 00 li r3,0 ffc05994: 48 00 00 08 b ffc0599c *new_part_desc = NULL; if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) { return RTEMS_NO_MEMORY; ffc05998: 38 60 00 1a li r3,26 <== NOT EXECUTED else { /* empty partition */ free(part_desc); } return RTEMS_SUCCESSFUL; } ffc0599c: 39 61 00 18 addi r11,r1,24 ffc059a0: 4b ff ae 4c b ffc007ec <_restgpr_29_x> =============================================================================== ffc0c4dc : } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { ffc0c4dc: 94 21 ff d8 stwu r1,-40(r1) ffc0c4e0: 7c 08 02 a6 mflr r0 ffc0c4e4: 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; ffc0c4e8: 81 23 00 2c lwz r9,44(r3) ffc0c4ec: bf 01 00 08 stmw r24,8(r1) ffc0c4f0: 7c 7f 1b 78 mr r31,r3 ) { size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; devFS_node *node = NULL; ffc0c4f4: 3b a0 00 00 li r29,0 ffc0c4f8: 81 29 00 10 lwz r9,16(r9) devFS_node *free_node = NULL; for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { ffc0c4fc: 3b 40 00 00 li r26,0 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } ffc0c500: 83 23 00 00 lwz r25,0(r3) size_t pathlen, devFS_node **free_node_ptr ) { size_t i = 0; size_t n = data->count; ffc0c504: 83 09 00 04 lwz r24,4(r9) ffc0c508: 83 c9 00 00 lwz r30,0(r9) devFS_node *nodes = data->nodes; devFS_node *node = NULL; devFS_node *free_node = NULL; ffc0c50c: 39 20 00 00 li r9,0 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } ffc0c510: 83 63 00 04 lwz r27,4(r3) ffc0c514: 48 00 00 58 b ffc0c56c devFS_node *free_node = NULL; for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { devFS_node *current = nodes + i; if (current->name != NULL) { ffc0c518: 80 7e 00 00 lwz r3,0(r30) 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) { devFS_node *current = nodes + i; ffc0c51c: 7f dc f3 78 mr r28,r30 if (current->name != NULL) { ffc0c520: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c524: 41 9e 00 2c beq- cr7,ffc0c550 if ( ffc0c528: 81 5e 00 04 lwz r10,4(r30) ffc0c52c: 7d 3c 4b 78 mr r28,r9 ffc0c530: 7f 8a d8 00 cmpw cr7,r10,r27 ffc0c534: 40 be 00 1c bne+ cr7,ffc0c550 current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 ffc0c538: 7f 24 cb 78 mr r4,r25 ffc0c53c: 7f 65 db 78 mr r5,r27 ffc0c540: 48 00 2a 09 bl ffc0ef48 ffc0c544: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c548: 40 9e 00 08 bne- cr7,ffc0c550 ffc0c54c: 7f dd f3 78 mr r29,r30 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) { ffc0c550: 2f 9c 00 00 cmpwi cr7,r28,0 ffc0c554: 3b 5a 00 01 addi r26,r26,1 ffc0c558: 41 9e 00 0c beq- cr7,ffc0c564 <== NEVER TAKEN ffc0c55c: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0c560: 40 9e 00 18 bne- cr7,ffc0c578 ffc0c564: 3b de 00 14 addi r30,r30,20 ffc0c568: 7f 89 e3 78 mr r9,r28 ffc0c56c: 7f 9a c0 00 cmpw cr7,r26,r24 ffc0c570: 40 9e ff a8 bne+ cr7,ffc0c518 ffc0c574: 48 00 00 08 b ffc0c57c ffc0c578: 7f 89 e3 78 mr r9,r28 rtems_filesystem_eval_path_get_pathlen(ctx), &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { ffc0c57c: 2f 9d 00 00 cmpwi cr7,r29,0 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } ffc0c580: 81 5f 00 10 lwz r10,16(r31) rtems_filesystem_eval_path_get_pathlen(ctx), &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { ffc0c584: 41 9e 00 24 beq- cr7,ffc0c5a8 if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { ffc0c588: 71 49 00 40 andi. r9,r10,64 ffc0c58c: 40 82 00 10 bne- ffc0c59c currentloc->node_access = node; ffc0c590: 93 bf 00 20 stw r29,32(r31) static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; ffc0c594: 91 3f 00 04 stw r9,4(r31) ffc0c598: 48 00 00 64 b ffc0c5fc rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); ffc0c59c: 7f e3 fb 78 mr r3,r31 ffc0c5a0: 38 80 00 11 li r4,17 ffc0c5a4: 48 00 00 44 b ffc0c5e8 } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { ffc0c5a8: 71 48 00 20 andi. r8,r10,32 ffc0c5ac: 41 82 00 34 beq- ffc0c5e0 <== NEVER TAKEN if (free_node != NULL) { ffc0c5b0: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c5b4: 41 9e 00 20 beq- cr7,ffc0c5d4 free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; ffc0c5b8: 39 40 01 ff li r10,511 ffc0c5bc: 91 49 00 10 stw r10,16(r9) currentloc->node_access = free_node; ffc0c5c0: 91 3f 00 20 stw r9,32(r31) rtems_filesystem_eval_path_context_t *ctx, const char *token, size_t tokenlen ) { ctx->token = token; ffc0c5c4: 93 3f 00 08 stw r25,8(r31) ctx->tokenlen = tokenlen; ffc0c5c8: 93 7f 00 0c stw r27,12(r31) static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; ffc0c5cc: 93 bf 00 04 stw r29,4(r31) ffc0c5d0: 48 00 00 2c b ffc0c5fc 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); ffc0c5d4: 7f e3 fb 78 mr r3,r31 ffc0c5d8: 38 80 00 1c li r4,28 ffc0c5dc: 48 00 00 0c b ffc0c5e8 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); ffc0c5e0: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc0c5e4: 38 80 00 02 li r4,2 <== NOT EXECUTED } } } ffc0c5e8: 80 01 00 2c lwz r0,44(r1) ffc0c5ec: bb 01 00 08 lmw r24,8(r1) ffc0c5f0: 7c 08 03 a6 mtlr r0 ffc0c5f4: 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); ffc0c5f8: 4b ff 8f 38 b ffc05530 } } } ffc0c5fc: 39 61 00 28 addi r11,r1,40 ffc0c600: 48 00 ad 78 b ffc17378 <_restgpr_24_x> =============================================================================== ffc04188 : dev_t dev ) { int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { ffc04188: 2f 85 00 03 cmpwi cr7,r5,3 const char *name, size_t namelen, mode_t mode, dev_t dev ) { ffc0418c: 94 21 ff e0 stwu r1,-32(r1) ffc04190: 7c 08 02 a6 mflr r0 ffc04194: bf 81 00 10 stmw r28,16(r1) ffc04198: 7c 7e 1b 78 mr r30,r3 ffc0419c: 7c df 33 78 mr r31,r6 ffc041a0: 90 01 00 24 stw r0,36(r1) ffc041a4: 7c fd 3b 78 mr r29,r7 ffc041a8: 7d 1c 43 78 mr r28,r8 int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { ffc041ac: 40 be 00 28 bne+ cr7,ffc041d4 ffc041b0: 89 24 00 00 lbz r9,0(r4) ffc041b4: 2f 89 00 64 cmpwi cr7,r9,100 ffc041b8: 40 be 00 1c bne+ cr7,ffc041d4 <== NEVER TAKEN ffc041bc: 89 24 00 01 lbz r9,1(r4) ffc041c0: 2f 89 00 65 cmpwi cr7,r9,101 ffc041c4: 40 be 00 10 bne+ cr7,ffc041d4 <== NEVER TAKEN ffc041c8: 89 24 00 02 lbz r9,2(r4) ffc041cc: 2f 89 00 76 cmpwi cr7,r9,118 ffc041d0: 41 9e 00 68 beq- cr7,ffc04238 <== ALWAYS TAKEN if (S_ISBLK(mode) || S_ISCHR(mode)) { ffc041d4: 57 e9 04 26 rlwinm r9,r31,0,16,19 ffc041d8: 2f 89 60 00 cmpwi cr7,r9,24576 ffc041dc: 41 9e 00 0c beq- cr7,ffc041e8 ffc041e0: 2f 89 20 00 cmpwi cr7,r9,8192 ffc041e4: 40 9e 00 64 bne- cr7,ffc04248 char *dupname = malloc(namelen); ffc041e8: 7c a3 2b 78 mr r3,r5 ffc041ec: 90 81 00 08 stw r4,8(r1) ffc041f0: 90 a1 00 0c stw r5,12(r1) ffc041f4: 48 00 05 69 bl ffc0475c if (dupname != NULL) { ffc041f8: 7c 6a 1b 79 mr. r10,r3 ffc041fc: 80 81 00 08 lwz r4,8(r1) ffc04200: 80 a1 00 0c lwz r5,12(r1) ffc04204: 41 82 00 28 beq- ffc0422c devFS_node *node = parentloc->node_access; ffc04208: 81 3e 00 08 lwz r9,8(r30) node->name = dupname; ffc0420c: 91 49 00 00 stw r10,0(r9) node->namelen = namelen; ffc04210: 90 a9 00 04 stw r5,4(r9) node->major = rtems_filesystem_dev_major_t(dev); ffc04214: 93 a9 00 08 stw r29,8(r9) node->minor = rtems_filesystem_dev_minor_t(dev); ffc04218: 93 89 00 0c stw r28,12(r9) node->mode = mode; ffc0421c: 93 e9 00 10 stw r31,16(r9) memcpy(dupname, name, namelen); ffc04220: 48 00 ad ad bl ffc0efcc size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; ffc04224: 38 60 00 00 li r3,0 ffc04228: 48 00 00 30 b ffc04258 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; ffc0422c: 48 00 9a a5 bl ffc0dcd0 <__errno> ffc04230: 39 20 00 0c li r9,12 ffc04234: 48 00 00 1c b ffc04250 } else { errno = ENOTSUP; rv = -1; } } else { if (!S_ISDIR(mode)) { ffc04238: 54 df 04 26 rlwinm r31,r6,0,16,19 ffc0423c: 2f 9f 40 00 cmpwi cr7,r31,16384 size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; ffc04240: 38 60 00 00 li r3,0 } else { errno = ENOTSUP; rv = -1; } } else { if (!S_ISDIR(mode)) { ffc04244: 41 be 00 14 beq+ cr7,ffc04258 <== ALWAYS TAKEN errno = ENOTSUP; ffc04248: 48 00 9a 89 bl ffc0dcd0 <__errno> ffc0424c: 39 20 00 86 li r9,134 ffc04250: 91 23 00 00 stw r9,0(r3) rv = -1; ffc04254: 38 60 ff ff li r3,-1 } } return rv; } ffc04258: 39 61 00 20 addi r11,r1,32 ffc0425c: 48 01 31 2c b ffc17388 <_restgpr_28_x> =============================================================================== ffc04214 : */ static volatile bool diskdevs_protected; static rtems_status_code disk_lock(void) { ffc04214: 7c 2b 0b 78 mr r11,r1 ffc04218: 7c 08 02 a6 mflr r0 ffc0421c: 94 21 ff f0 stwu r1,-16(r1) rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); ffc04220: 38 80 00 00 li r4,0 ffc04224: 38 a0 00 00 li r5,0 */ static volatile bool diskdevs_protected; static rtems_status_code disk_lock(void) { ffc04228: 90 01 00 14 stw r0,20(r1) ffc0422c: 48 01 47 65 bl ffc18990 <_savegpr_31> rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); ffc04230: 3f e0 00 00 lis r31,0 ffc04234: 3b ff 28 48 addi r31,r31,10312 ffc04238: 80 7f 00 08 lwz r3,8(r31) ffc0423c: 48 00 57 69 bl ffc099a4 if (sc == RTEMS_SUCCESSFUL) { diskdevs_protected = true; return RTEMS_SUCCESSFUL; } else { return RTEMS_NOT_CONFIGURED; ffc04240: 39 20 00 16 li r9,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) { ffc04244: 2f 83 00 00 cmpwi cr7,r3,0 ffc04248: 40 be 00 10 bne+ cr7,ffc04258 <== NEVER TAKEN diskdevs_protected = true; ffc0424c: 39 20 00 01 li r9,1 ffc04250: 99 3f 00 0c stb r9,12(r31) return RTEMS_SUCCESSFUL; ffc04254: 39 20 00 00 li r9,0 } else { return RTEMS_NOT_CONFIGURED; } } ffc04258: 39 61 00 10 addi r11,r1,16 ffc0425c: 7d 23 4b 78 mr r3,r9 ffc04260: 48 01 47 7c b ffc189dc <_restgpr_31_x> =============================================================================== ffc04264 : static void disk_unlock(void) { ffc04264: 94 21 ff f8 stwu r1,-8(r1) ffc04268: 7c 08 02 a6 mflr r0 rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; ffc0426c: 3d 20 00 00 lis r9,0 } } static void disk_unlock(void) { ffc04270: 90 01 00 0c stw r0,12(r1) rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; ffc04274: 39 29 28 48 addi r9,r9,10312 ffc04278: 39 40 00 00 li r10,0 sc = rtems_semaphore_release(diskdevs_mutex); ffc0427c: 80 69 00 08 lwz r3,8(r9) static void disk_unlock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; ffc04280: 99 49 00 0c stb r10,12(r9) sc = rtems_semaphore_release(diskdevs_mutex); ffc04284: 48 00 58 45 bl ffc09ac8 if (sc != RTEMS_SUCCESSFUL) { ffc04288: 2f 83 00 00 cmpwi cr7,r3,0 ffc0428c: 41 be 00 10 beq+ cr7,ffc0429c <== ALWAYS TAKEN /* FIXME: Error number */ rtems_fatal_error_occurred(0xdeadbeef); ffc04290: 3c 60 de ad lis r3,-8531 <== NOT EXECUTED ffc04294: 60 63 be ef ori r3,r3,48879 <== NOT EXECUTED ffc04298: 48 00 5e 09 bl ffc0a0a0 <== NOT EXECUTED } } ffc0429c: 80 01 00 0c lwz r0,12(r1) ffc042a0: 38 21 00 08 addi r1,r1,8 ffc042a4: 7c 08 03 a6 mtlr r0 ffc042a8: 4e 80 00 20 blr =============================================================================== ffc06340 : /* * Drain output queue */ static void drainOutput (struct rtems_termios_tty *tty) ffc06340: 94 21 ff f0 stwu r1,-16(r1) ffc06344: 7c 08 02 a6 mflr r0 ffc06348: bf c1 00 08 stmw r30,8(r1) ffc0634c: 7c 7f 1b 78 mr r31,r3 ffc06350: 90 01 00 14 stw r0,20(r1) { rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); ffc06354: 4b ff fd 79 bl ffc060cc while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { tty->rawOutBufState = rob_wait; ffc06358: 3b c0 00 02 li r30,2 ffc0635c: 48 00 00 2c b ffc06388 ffc06360: 93 df 00 94 stw r30,148(r31) <== NOT EXECUTED ffc06364: 7c 60 01 24 mtmsr r3 <== NOT EXECUTED rtems_interrupt_enable (level); sc = rtems_semaphore_obtain( ffc06368: 80 7f 00 8c lwz r3,140(r31) <== NOT EXECUTED ffc0636c: 38 80 00 00 li r4,0 <== NOT EXECUTED ffc06370: 38 a0 00 00 li r5,0 <== NOT EXECUTED ffc06374: 48 00 25 39 bl ffc088ac <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) ffc06378: 2f 83 00 00 cmpwi cr7,r3,0 <== NOT EXECUTED ffc0637c: 41 be 00 08 beq+ cr7,ffc06384 <== NOT EXECUTED rtems_fatal_error_occurred (sc); ffc06380: 48 00 2c f1 bl ffc09070 <== NOT EXECUTED rtems_interrupt_disable (level); ffc06384: 4b ff fd 49 bl ffc060cc <== 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) { ffc06388: 81 5f 00 84 lwz r10,132(r31) ffc0638c: 81 3f 00 80 lwz r9,128(r31) ffc06390: 7f 8a 48 00 cmpw cr7,r10,r9 ffc06394: 40 9e ff cc bne+ cr7,ffc06360 <== NEVER TAKEN ffc06398: 7c 60 01 24 mtmsr r3 rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } rtems_interrupt_enable (level); } } ffc0639c: 39 61 00 10 addi r11,r1,16 ffc063a0: 4b ff a2 20 b ffc005c0 <_restgpr_30_x> =============================================================================== ffc04a90 : */ int dup2( int fildes, int fildes2 ) { ffc04a90: 94 21 ff a0 stwu r1,-96(r1) ffc04a94: 7c 08 02 a6 mflr r0 ffc04a98: bf c1 00 58 stmw r30,88(r1) ffc04a9c: 7c 9f 23 78 mr r31,r4 /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); ffc04aa0: 38 81 00 08 addi r4,r1,8 */ int dup2( int fildes, int fildes2 ) { ffc04aa4: 90 01 00 64 stw r0,100(r1) ffc04aa8: 7c 7e 1b 78 mr r30,r3 /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); ffc04aac: 48 00 05 3d bl ffc04fe8 if ( status == -1 ) ffc04ab0: 2f 83 ff ff cmpwi cr7,r3,-1 ffc04ab4: 40 be 00 0c bne+ cr7,ffc04ac0 return -1; ffc04ab8: 38 60 ff ff li r3,-1 ffc04abc: 48 00 00 2c b ffc04ae8 /* * If fildes2 is not valid, then we should not do anything either. */ status = fstat( fildes2, &buf ); ffc04ac0: 7f e3 fb 78 mr r3,r31 ffc04ac4: 38 81 00 08 addi r4,r1,8 ffc04ac8: 48 00 05 21 bl ffc04fe8 if ( status == -1 ) ffc04acc: 2f 83 ff ff cmpwi cr7,r3,-1 ffc04ad0: 41 be ff e8 beq- cr7,ffc04ab8 <== NEVER TAKEN /* * This fcntl handles everything else. */ return fcntl( fildes, F_DUPFD, fildes2 ); ffc04ad4: 7f c3 f3 78 mr r3,r30 ffc04ad8: 38 80 00 00 li r4,0 ffc04adc: 7f e5 fb 78 mr r5,r31 ffc04ae0: 4c c6 31 82 crclr 4*cr1+eq ffc04ae4: 48 00 00 1d bl ffc04b00 } ffc04ae8: 39 61 00 60 addi r11,r1,96 ffc04aec: 4b ff c2 80 b ffc00d6c <_restgpr_30_x> =============================================================================== ffc070e4 : /* * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { ffc070e4: 7c 2b 0b 78 mr r11,r1 ffc070e8: 7c 08 02 a6 mflr r0 ffc070ec: 94 21 ff e0 stwu r1,-32(r1) ffc070f0: 90 01 00 24 stw r0,36(r1) ffc070f4: 48 01 2f 55 bl ffc1a048 <_savegpr_31> ffc070f8: 7c 9f 23 78 mr r31,r4 if ((tty->termios.c_lflag & ECHOCTL) && ffc070fc: 81 24 00 3c lwz r9,60(r4) ffc07100: 71 2a 02 00 andi. r10,r9,512 ffc07104: 41 82 00 60 beq- ffc07164 <== NEVER TAKEN iscntrl(c) && (c != '\t') && (c != '\n')) { ffc07108: 3d 20 00 00 lis r9,0 ffc0710c: 81 29 27 a0 lwz r9,10144(r9) ffc07110: 7d 29 1a 14 add r9,r9,r3 ffc07114: 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) && ffc07118: 55 29 06 b4 rlwinm r9,r9,0,26,26 ffc0711c: 71 2a 00 ff andi. r10,r9,255 ffc07120: 41 82 00 44 beq- ffc07164 iscntrl(c) && (c != '\t') && (c != '\n')) { ffc07124: 2f 83 00 09 cmpwi cr7,r3,9 ffc07128: 41 9e 00 3c beq- cr7,ffc07164 ffc0712c: 2f 83 00 0a cmpwi cr7,r3,10 ffc07130: 41 be 00 34 beq+ cr7,ffc07164 char echobuf[2]; echobuf[0] = '^'; echobuf[1] = c ^ 0x40; ffc07134: 68 63 00 40 xori r3,r3,64 { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { char echobuf[2]; echobuf[0] = '^'; ffc07138: 39 20 00 5e li r9,94 echobuf[1] = c ^ 0x40; ffc0713c: 98 61 00 09 stb r3,9(r1) rtems_termios_puts (echobuf, 2, tty); ffc07140: 38 80 00 02 li r4,2 ffc07144: 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] = '^'; ffc07148: 99 21 00 08 stb r9,8(r1) echobuf[1] = c ^ 0x40; rtems_termios_puts (echobuf, 2, tty); ffc0714c: 7f e5 fb 78 mr r5,r31 ffc07150: 4b ff fc f5 bl ffc06e44 tty->column += 2; ffc07154: 81 3f 00 28 lwz r9,40(r31) ffc07158: 39 29 00 02 addi r9,r9,2 ffc0715c: 91 3f 00 28 stw r9,40(r31) ffc07160: 48 00 00 0c b ffc0716c } else { oproc (c, tty); ffc07164: 7f e4 fb 78 mr r4,r31 ffc07168: 4b ff fe 09 bl ffc06f70 } } ffc0716c: 39 61 00 20 addi r11,r1,32 ffc07170: 4b ff 94 54 b ffc005c4 <_restgpr_31_x> =============================================================================== ffc07174 : * 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) ffc07174: 94 21 ff e0 stwu r1,-32(r1) ffc07178: 7d 80 00 26 mfcr r12 ffc0717c: 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)) { ffc07180: 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) ffc07184: bf 61 00 0c stmw r27,12(r1) 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); ffc07188: 3f 80 ff c2 lis r28,-62 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); ffc0718c: 3f 60 ff c2 lis r27,-62 * 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) ffc07190: 90 01 00 24 stw r0,36(r1) ffc07194: 7c 7f 1b 78 mr r31,r3 ffc07198: 3f a0 00 00 lis r29,0 ffc0719c: 91 81 00 08 stw r12,8(r1) 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); ffc071a0: 3b 9c be be addi r28,r28,-16706 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); ffc071a4: 3b 7b be c0 addi r27,r27,-16704 ffc071a8: 48 00 01 74 b ffc0731c } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; if (tty->termios.c_lflag & ECHO) { ffc071ac: 81 3f 00 3c lwz r9,60(r31) return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; ffc071b0: 39 08 ff ff addi r8,r8,-1 ffc071b4: 80 ff 00 1c lwz r7,28(r31) if (tty->termios.c_lflag & ECHO) { ffc071b8: 71 25 00 08 andi. r5,r9,8 return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; ffc071bc: 91 1f 00 20 stw r8,32(r31) ffc071c0: 7f c7 40 ae lbzx r30,r7,r8 if (tty->termios.c_lflag & ECHO) { ffc071c4: 41 82 01 54 beq- ffc07318 <== NEVER TAKEN if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { ffc071c8: 40 92 00 30 bne- cr4,ffc071f8 ffc071cc: 71 2a 00 10 andi. r10,r9,16 ffc071d0: 40 a2 00 28 bne+ ffc071f8 <== ALWAYS TAKEN } } if (!lineFlag) break; } } ffc071d4: 80 01 00 24 lwz r0,36(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); ffc071d8: 7f e4 fb 78 mr r4,r31 <== NOT EXECUTED } } if (!lineFlag) break; } } ffc071dc: 81 81 00 08 lwz r12,8(r1) <== NOT EXECUTED ffc071e0: 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); ffc071e4: 88 7f 00 43 lbz r3,67(r31) <== NOT EXECUTED } } if (!lineFlag) break; } } ffc071e8: 7d 80 81 20 mtcrf 8,r12 <== NOT EXECUTED ffc071ec: bb 61 00 0c lmw r27,12(r1) <== NOT EXECUTED ffc071f0: 38 21 00 20 addi r1,r1,32 <== 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); ffc071f4: 4b ff fe f0 b ffc070e4 <== NOT EXECUTED } else if (c == '\t') { ffc071f8: 2f 9e 00 09 cmpwi cr7,r30,9 ffc071fc: 40 be 00 94 bne+ cr7,ffc07290 while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { if (tty->termios.c_lflag & ECHOCTL) ffc07200: 39 08 00 01 addi r8,r8,1 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; ffc07204: 83 df 00 2c lwz r30,44(r31) */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { ffc07208: 80 dd 27 a0 lwz r6,10144(r29) 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; ffc0720c: 39 40 00 00 li r10,0 while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { if (tty->termios.c_lflag & ECHOCTL) ffc07210: 71 25 02 00 andi. r5,r9,512 ffc07214: 7d 09 03 a6 mtctr r8 ffc07218: 48 00 00 44 b ffc0725c /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; ffc0721c: 7d 07 50 ae lbzx r8,r7,r10 ffc07220: 39 4a 00 01 addi r10,r10,1 if (c == '\t') { ffc07224: 2f 88 00 09 cmpwi cr7,r8,9 ffc07228: 40 be 00 0c bne+ cr7,ffc07234 col = (col | 7) + 1; ffc0722c: 63 de 00 07 ori r30,r30,7 ffc07230: 48 00 00 28 b ffc07258 } else if (iscntrl (c)) { ffc07234: 7d 06 42 14 add r8,r6,r8 ffc07238: 89 08 00 01 lbz r8,1(r8) ffc0723c: 55 08 06 b4 rlwinm r8,r8,0,26,26 ffc07240: 55 09 06 3e clrlwi r9,r8,24 ffc07244: 2f 89 00 00 cmpwi cr7,r9,0 ffc07248: 41 9e 00 10 beq- cr7,ffc07258 <== ALWAYS TAKEN if (tty->termios.c_lflag & ECHOCTL) ffc0724c: 41 82 00 10 beq- ffc0725c <== NOT EXECUTED col += 2; ffc07250: 3b de 00 02 addi r30,r30,2 <== NOT EXECUTED ffc07254: 48 00 00 08 b ffc0725c <== NOT EXECUTED } else { col++; ffc07258: 3b de 00 01 addi r30,r30,1 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { ffc0725c: 42 00 ff c0 bdnz+ ffc0721c ffc07260: 48 00 00 20 b ffc07280 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); ffc07264: 7f 63 db 78 mr r3,r27 ffc07268: 38 80 00 01 li r4,1 ffc0726c: 7f e5 fb 78 mr r5,r31 ffc07270: 4b ff fb d5 bl ffc06e44 tty->column--; ffc07274: 81 3f 00 28 lwz r9,40(r31) ffc07278: 39 29 ff ff addi r9,r9,-1 ffc0727c: 91 3f 00 28 stw r9,40(r31) } /* * Back up over the tab */ while (tty->column > col) { ffc07280: 81 3f 00 28 lwz r9,40(r31) ffc07284: 7f 89 f0 00 cmpw cr7,r9,r30 ffc07288: 41 9d ff dc bgt+ cr7,ffc07264 ffc0728c: 48 00 00 8c b ffc07318 rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { ffc07290: 81 5d 27 a0 lwz r10,10144(r29) ffc07294: 3b de 00 01 addi r30,r30,1 ffc07298: 7d 4a f0 ae lbzx r10,r10,r30 ffc0729c: 55 4a 06 b4 rlwinm r10,r10,0,26,26 ffc072a0: 71 45 00 ff andi. r5,r10,255 ffc072a4: 41 82 00 30 beq- ffc072d4 <== ALWAYS TAKEN ffc072a8: 71 28 02 00 andi. r8,r9,512 <== NOT EXECUTED ffc072ac: 41 a2 00 28 beq+ ffc072d4 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); ffc072b0: 7f 83 e3 78 mr r3,r28 <== NOT EXECUTED ffc072b4: 38 80 00 03 li r4,3 <== NOT EXECUTED ffc072b8: 7f e5 fb 78 mr r5,r31 <== NOT EXECUTED ffc072bc: 4b ff fb 89 bl ffc06e44 <== NOT EXECUTED if (tty->column) ffc072c0: 81 3f 00 28 lwz r9,40(r31) <== NOT EXECUTED ffc072c4: 2f 89 00 00 cmpwi cr7,r9,0 <== NOT EXECUTED ffc072c8: 41 9e 00 0c beq- cr7,ffc072d4 <== NOT EXECUTED tty->column--; ffc072cc: 39 29 ff ff addi r9,r9,-1 <== NOT EXECUTED ffc072d0: 91 3f 00 28 stw r9,40(r31) <== NOT EXECUTED } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { ffc072d4: 81 3d 27 a0 lwz r9,10144(r29) ffc072d8: 7d 29 f0 ae lbzx r9,r9,r30 ffc072dc: 55 29 06 b4 rlwinm r9,r9,0,26,26 ffc072e0: 71 2a 00 ff andi. r10,r9,255 ffc072e4: 41 82 00 10 beq- ffc072f4 <== ALWAYS TAKEN ffc072e8: 81 3f 00 3c lwz r9,60(r31) <== NOT EXECUTED ffc072ec: 71 25 02 00 andi. r5,r9,512 <== NOT EXECUTED ffc072f0: 41 82 00 28 beq- ffc07318 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); ffc072f4: 7f 83 e3 78 mr r3,r28 ffc072f8: 38 80 00 03 li r4,3 ffc072fc: 7f e5 fb 78 mr r5,r31 ffc07300: 4b ff fb 45 bl ffc06e44 if (tty->column) ffc07304: 81 3f 00 28 lwz r9,40(r31) ffc07308: 2f 89 00 00 cmpwi cr7,r9,0 ffc0730c: 41 9e 00 0c beq- cr7,ffc07318 <== NEVER TAKEN tty->column--; ffc07310: 39 29 ff ff addi r9,r9,-1 ffc07314: 91 3f 00 28 stw r9,40(r31) } } } if (!lineFlag) ffc07318: 41 92 00 10 beq- cr4,ffc07328 echo ('\n', tty); return; } } while (tty->ccount) { ffc0731c: 81 1f 00 20 lwz r8,32(r31) ffc07320: 2f 88 00 00 cmpwi cr7,r8,0 ffc07324: 40 9e fe 88 bne+ cr7,ffc071ac } } if (!lineFlag) break; } } ffc07328: 81 81 00 08 lwz r12,8(r1) ffc0732c: 39 61 00 20 addi r11,r1,32 ffc07330: 7d 80 81 20 mtcrf 8,r12 ffc07334: 4b ff 92 80 b ffc005b4 <_restgpr_27_x> =============================================================================== ffc13ad0 : int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { ffc13ad0: 94 21 ff d8 stwu r1,-40(r1) ffc13ad4: 7c 08 02 a6 mflr r0 ffc13ad8: bf 61 00 14 stmw r27,20(r1) ffc13adc: 7c 9e 23 78 mr r30,r4 ffc13ae0: 7c 7f 1b 78 mr r31,r3 ffc13ae4: 90 01 00 2c stw r0,44(r1) ffc13ae8: 7c bb 2b 78 mr r27,r5 ffc13aec: 7c dd 33 78 mr r29,r6 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); ffc13af0: 89 23 00 02 lbz r9,2(r3) ffc13af4: 89 43 00 0c lbz r10,12(r3) ffc13af8: 7d 49 50 50 subf r10,r9,r10 ffc13afc: 7c 84 54 30 srw r4,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); ffc13b00: 7c 9c 50 30 slw r28,r4,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 - ffc13b04: 7f 9c f0 50 subf r28,r28,r30 fat_block_num_to_sector_num (fs_info, fat_sector_num_to_block_num (fs_info, sector))) << fs_info->vol.sec_log2); ffc13b08: 7f 9c 48 30 slw r28,r28,r9 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) ffc13b0c: 89 23 00 89 lbz r9,137(r3) ffc13b10: 2f 89 00 00 cmpwi cr7,r9,0 ffc13b14: 41 9e 00 10 beq- cr7,ffc13b24 ffc13b18: 81 23 00 84 lwz r9,132(r3) ffc13b1c: 7f 89 f0 00 cmpw cr7,r9,r30 ffc13b20: 41 9e 00 5c beq- cr7,ffc13b7c { fat_buf_release(fs_info); ffc13b24: 7f e3 fb 78 mr r3,r31 ffc13b28: 90 81 00 08 stw r4,8(r1) ffc13b2c: 4b ff fd e5 bl ffc13910 if (op_type == FAT_OP_TYPE_READ) ffc13b30: 2f 9b 00 01 cmpwi cr7,r27,1 ffc13b34: 80 7f 00 64 lwz r3,100(r31) ffc13b38: 38 bf 00 8c addi r5,r31,140 ffc13b3c: 80 81 00 08 lwz r4,8(r1) ffc13b40: 40 be 00 0c bne+ cr7,ffc13b4c sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); ffc13b44: 4b ff dc ad bl ffc117f0 ffc13b48: 48 00 00 08 b ffc13b50 else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); ffc13b4c: 4b ff db cd bl ffc11718 if (sc != RTEMS_SUCCESSFUL) ffc13b50: 2f 83 00 00 cmpwi cr7,r3,0 ffc13b54: 41 be 00 18 beq+ cr7,ffc13b6c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EIO); ffc13b58: 48 00 78 1d bl ffc1b374 <__errno> <== NOT EXECUTED ffc13b5c: 39 20 00 05 li r9,5 <== NOT EXECUTED ffc13b60: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc13b64: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc13b68: 48 00 00 28 b ffc13b90 <== NOT EXECUTED fs_info->c.blk_num = sec_num; fs_info->c.modified = 0; fs_info->c.state = FAT_CACHE_ACTUAL; ffc13b6c: 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; ffc13b70: 93 df 00 84 stw r30,132(r31) fs_info->c.modified = 0; ffc13b74: 98 7f 00 88 stb r3,136(r31) fs_info->c.state = FAT_CACHE_ACTUAL; ffc13b78: 99 3f 00 89 stb r9,137(r31) } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; ffc13b7c: 81 3f 00 8c lwz r9,140(r31) return RC_OK; ffc13b80: 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]; ffc13b84: 81 29 00 1c lwz r9,28(r9) ffc13b88: 7f 89 e2 14 add r28,r9,r28 ffc13b8c: 93 9d 00 00 stw r28,0(r29) return RC_OK; } ffc13b90: 39 61 00 28 addi r11,r1,40 ffc13b94: 4b fe da 58 b ffc015ec <_restgpr_27_x> =============================================================================== ffc13910 : return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { ffc13910: 94 21 ff d8 stwu r1,-40(r1) ffc13914: 7c 08 02 a6 mflr r0 ffc13918: bf a1 00 1c stmw r29,28(r1) ffc1391c: 7c 7f 1b 78 mr r31,r3 ffc13920: 90 01 00 2c stw r0,44(r1) rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) ffc13924: 89 23 00 89 lbz r9,137(r3) ffc13928: 2f 89 00 00 cmpwi cr7,r9,0 ffc1392c: 41 9e 01 98 beq- cr7,ffc13ac4 return RC_OK; if (fs_info->c.modified) ffc13930: 89 23 00 88 lbz r9,136(r3) ffc13934: 2f 89 00 00 cmpwi cr7,r9,0 ffc13938: 41 9e 01 60 beq- cr7,ffc13a98 { uint32_t sec_num = fs_info->c.blk_num; ffc1393c: 81 43 00 84 lwz r10,132(r3) bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && ffc13940: 39 20 00 00 li r9,0 ffc13944: a1 03 00 18 lhz r8,24(r3) ffc13948: 7f 8a 40 40 cmplw cr7,r10,r8 ffc1394c: 41 9c 00 14 blt- cr7,ffc13960 ffc13950: 81 23 00 20 lwz r9,32(r3) ffc13954: 7d 29 50 10 subfc r9,r9,r10 ffc13958: 7d 29 49 10 subfe r9,r9,r9 ffc1395c: 7d 29 00 d0 neg r9,r9 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) ffc13960: 2f 89 00 00 cmpwi cr7,r9,0 uint32_t ino ) { return (ino >= fs_info->uino_base); } ffc13964: 89 1f 00 02 lbz r8,2(r31) ffc13968: 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) ffc1396c: 7d 3e 4b 78 mr r30,r9 ffc13970: 41 9e 00 3c beq- cr7,ffc139ac ffc13974: 89 3f 00 54 lbz r9,84(r31) ffc13978: 2f 89 00 00 cmpwi cr7,r9,0 ffc1397c: 40 be 00 30 bne+ cr7,ffc139ac <== NEVER TAKEN ffc13980: 7c e8 38 50 subf r7,r8,r7 memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, ffc13984: 81 3f 00 8c lwz r9,140(r31) ffc13988: 7d 46 3c 30 srw r6,r10,r7 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, ffc1398c: 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); ffc13990: 7c c7 38 30 slw r7,r6,r7 ffc13994: 80 89 00 1c lwz r4,28(r9) 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 - ffc13998: 7d 47 50 50 subf r10,r7,r10 ffc1399c: 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); ffc139a0: 7d 48 40 30 slw r8,r10,r8 ffc139a4: 7c 84 42 14 add r4,r4,r8 ffc139a8: 48 00 86 ad bl ffc1c054 fs_info->c.buf->buffer + blk_ofs, fs_info->vol.bps); sc = rtems_bdbuf_release_modified(fs_info->c.buf); ffc139ac: 80 7f 00 8c lwz r3,140(r31) ffc139b0: 4b ff e1 15 bl ffc11ac4 if (sc != RTEMS_SUCCESSFUL) ffc139b4: 2c 03 00 00 cmpwi r3,0 ffc139b8: 41 a2 00 08 beq+ ffc139c0 <== ALWAYS TAKEN ffc139bc: 48 00 00 ec b ffc13aa8 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); fs_info->c.modified = 0; if (sec_of_fat && !fs_info->vol.mirror) ffc139c0: 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; ffc139c4: 98 7f 00 88 stb r3,136(r31) if (sec_of_fat && !fs_info->vol.mirror) ffc139c8: 41 9e 00 f4 beq- cr7,ffc13abc ffc139cc: 89 3f 00 54 lbz r9,84(r31) ffc139d0: 2f 89 00 00 cmpwi cr7,r9,0 ffc139d4: 41 9e 00 b0 beq- cr7,ffc13a84 <== ALWAYS TAKEN ffc139d8: 48 00 00 e4 b ffc13abc <== NOT EXECUTED for (i = 1; i < fs_info->vol.fats; i++) { rtems_bdbuf_buffer *bd; sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i, ffc139dc: 81 5f 00 1c lwz r10,28(r31) ffc139e0: 81 3f 00 84 lwz r9,132(r31) ffc139e4: 7d 5e 51 d6 mullw r10,r30,r10 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); ffc139e8: 88 7f 00 0c lbz r3,12(r31) ffc139ec: 7d 4a 4a 14 add r10,r10,r9 ffc139f0: 89 3f 00 02 lbz r9,2(r31) ffc139f4: 7c 69 18 50 subf r3,r9,r3 ffc139f8: 7d 44 1c 30 srw r4,r10,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); ffc139fc: 7c 83 18 30 slw r3,r4,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 - ffc13a00: 7c 63 50 50 subf r3,r3,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 ffc13a04: 7c 7d 48 31 slw. r29,r3,r9 ffc13a08: 40 82 00 24 bne- ffc13a2c && fs_info->vol.bps == fs_info->vol.bytes_per_block) ffc13a0c: a1 5f 00 00 lhz r10,0(r31) ffc13a10: a1 3f 00 0a lhz r9,10(r31) ffc13a14: 7f 8a 48 00 cmpw cr7,r10,r9 ffc13a18: 40 be 00 14 bne+ cr7,ffc13a2c { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); ffc13a1c: 80 7f 00 64 lwz r3,100(r31) ffc13a20: 38 a1 00 08 addi r5,r1,8 ffc13a24: 4b ff dc f5 bl ffc11718 ffc13a28: 48 00 00 10 b ffc13a38 } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); ffc13a2c: 80 7f 00 64 lwz r3,100(r31) ffc13a30: 38 a1 00 08 addi r5,r1,8 ffc13a34: 4b ff dd bd bl ffc117f0 } if ( sc != RTEMS_SUCCESSFUL) ffc13a38: 2f 83 00 00 cmpwi cr7,r3,0 ffc13a3c: 41 be 00 08 beq+ cr7,ffc13a44 <== ALWAYS TAKEN ffc13a40: 48 00 00 2c b ffc13a6c <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); ffc13a44: 81 21 00 08 lwz r9,8(r1) ffc13a48: 80 9f 00 90 lwz r4,144(r31) ffc13a4c: 80 69 00 1c lwz r3,28(r9) ffc13a50: a0 bf 00 00 lhz r5,0(r31) ffc13a54: 7c 63 ea 14 add r3,r3,r29 ffc13a58: 48 00 85 fd bl ffc1c054 sc = rtems_bdbuf_release_modified(bd); ffc13a5c: 80 61 00 08 lwz r3,8(r1) ffc13a60: 4b ff e0 65 bl ffc11ac4 if ( sc != RTEMS_SUCCESSFUL) ffc13a64: 2f 83 00 00 cmpwi cr7,r3,0 ffc13a68: 41 be 00 10 beq+ cr7,ffc13a78 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(ENOMEM); ffc13a6c: 48 00 79 09 bl ffc1b374 <__errno> <== NOT EXECUTED ffc13a70: 39 20 00 0c li r9,12 <== NOT EXECUTED ffc13a74: 48 00 00 3c b ffc13ab0 <== NOT EXECUTED if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) ffc13a78: 3b de 00 01 addi r30,r30,1 ffc13a7c: 57 de 06 3e clrlwi r30,r30,24 ffc13a80: 48 00 00 08 b ffc13a88 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; if (sec_of_fat && !fs_info->vol.mirror) ffc13a84: 3b c0 00 01 li r30,1 { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) ffc13a88: 89 3f 00 0d lbz r9,13(r31) ffc13a8c: 7f 89 f0 40 cmplw cr7,r9,r30 ffc13a90: 41 9d ff 4c bgt+ cr7,ffc139dc ffc13a94: 48 00 00 28 b ffc13abc } } } else { sc = rtems_bdbuf_release(fs_info->c.buf); ffc13a98: 80 63 00 8c lwz r3,140(r3) ffc13a9c: 4b ff df 4d bl ffc119e8 if (sc != RTEMS_SUCCESSFUL) ffc13aa0: 2f 83 00 00 cmpwi cr7,r3,0 ffc13aa4: 41 be 00 18 beq+ cr7,ffc13abc <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EIO); ffc13aa8: 48 00 78 cd bl ffc1b374 <__errno> <== NOT EXECUTED ffc13aac: 39 20 00 05 li r9,5 <== NOT EXECUTED ffc13ab0: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc13ab4: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc13ab8: 48 00 00 10 b ffc13ac8 <== NOT EXECUTED } fs_info->c.state = FAT_CACHE_EMPTY; ffc13abc: 39 20 00 00 li r9,0 ffc13ac0: 99 3f 00 89 stb r9,137(r31) fat_buf_release(fat_fs_info_t *fs_info) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) return RC_OK; ffc13ac4: 38 60 00 00 li r3,0 if (sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(EIO); } fs_info->c.state = FAT_CACHE_EMPTY; return RC_OK; } ffc13ac8: 39 61 00 28 addi r11,r1,40 ffc13acc: 4b fe db 28 b ffc015f4 <_restgpr_29_x> =============================================================================== ffc138b8 : 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)) ) ffc138b8: 2c 04 00 00 cmpwi r4,0 ffc138bc: 40 82 00 28 bne- ffc138e4 ffc138c0: 89 23 00 0e lbz r9,14(r3) ffc138c4: 71 2a 00 03 andi. r10,r9,3 ffc138c8: 41 a2 00 1c beq+ ffc138e4 <== NEVER TAKEN 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); ffc138cc: 89 43 00 0c lbz r10,12(r3) ffc138d0: 89 23 00 02 lbz r9,2(r3) ffc138d4: 80 63 00 20 lwz r3,32(r3) ffc138d8: 7d 29 50 50 subf r9,r9,r10 ffc138dc: 7c 63 4c 30 srw r3,r3,r9 ffc138e0: 4e 80 00 20 blr blk = fat_sector_num_to_block_num(fs_info, fs_info->vol.rdir_loc); else { cln -= FAT_RSRVD_CLN; blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); ffc138e4: 89 23 00 0c lbz r9,12(r3) if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) blk = fat_sector_num_to_block_num(fs_info, fs_info->vol.rdir_loc); else { cln -= FAT_RSRVD_CLN; ffc138e8: 39 44 ff fe addi r10,r4,-2 blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); ffc138ec: 89 03 00 08 lbz r8,8(r3) ffc138f0: 7d 09 40 50 subf r8,r9,r8 ffc138f4: 7d 4a 40 30 slw r10,r10,r8 ffc138f8: 89 03 00 02 lbz r8,2(r3) ffc138fc: 80 63 00 34 lwz r3,52(r3) ffc13900: 7d 28 48 50 subf r9,r8,r9 ffc13904: 7c 63 4c 30 srw r3,r3,r9 blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); ffc13908: 7c 63 52 14 add r3,r3,r10 } return blk; } ffc1390c: 4e 80 00 20 blr =============================================================================== ffc12bc8 : 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)) ) ffc12bc8: 2c 04 00 00 cmpwi r4,0 ffc12bcc: 40 82 00 18 bne- ffc12be4 ffc12bd0: 89 23 00 0e lbz r9,14(r3) ffc12bd4: 71 2a 00 03 andi. r10,r9,3 ffc12bd8: 41 a2 00 0c beq+ ffc12be4 <== NEVER TAKEN return fs_info->vol.rdir_loc; ffc12bdc: 80 63 00 20 lwz r3,32(r3) ffc12be0: 4e 80 00 20 blr return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + ffc12be4: 89 23 00 05 lbz r9,5(r3) ffc12be8: 39 44 ff fe addi r10,r4,-2 ffc12bec: 7d 4a 48 30 slw r10,r10,r9 ffc12bf0: 81 23 00 34 lwz r9,52(r3) ffc12bf4: 7c 6a 4a 14 add r3,r10,r9 fs_info->vol.data_fsec); } ffc12bf8: 4e 80 00 20 blr =============================================================================== ffc13ce8 : fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { ffc13ce8: 94 21 ff c0 stwu r1,-64(r1) ffc13cec: 7c 08 02 a6 mflr r0 ffc13cf0: 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)); ffc13cf4: 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) { ffc13cf8: be e1 00 1c stmw r23,28(r1) ffc13cfc: 7c 7f 1b 78 mr r31,r3 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); ffc13d00: 7d 25 48 50 subf r9,r5,r9 ffc13d04: 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) { ffc13d08: 7c bd 2b 78 mr r29,r5 ffc13d0c: 7c f8 3b 78 mr r24,r7 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); ffc13d10: 7c de 33 78 mr r30,r6 ffc13d14: 40 9d 00 08 ble- cr7,ffc13d1c <== ALWAYS TAKEN ffc13d18: 7d 3e 4b 78 mr r30,r9 <== NOT EXECUTED uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); ffc13d1c: 7f e3 fb 78 mr r3,r31 ffc13d20: 4b ff fb 99 bl ffc138b8 uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; ffc13d24: 8b 3f 00 0c lbz r25,12(r31) uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ssize_t bytes_written = 0; ffc13d28: 3b 40 00 00 li r26,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; ffc13d2c: 7f bb cc 30 srw r27,r29,r25 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ffc13d30: 7f 79 c8 30 slw r25,r27,r25 ffc13d34: 7f 39 e8 50 subf r25,r25,r29 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; ffc13d38: 7f 63 da 14 add r27,r3,r27 ffc13d3c: 3a e0 00 01 li r23,1 ffc13d40: 48 00 00 9c b ffc13ddc while ( (RC_OK == rc) && (0 < bytes_to_write)) { uint32_t c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); ffc13d44: a1 5f 00 0a lhz r10,10(r31) ffc13d48: 7d 39 50 50 subf r9,r25,r10 ffc13d4c: 7f 89 f0 40 cmplw cr7,r9,r30 ffc13d50: 7d 3d 4b 78 mr r29,r9 ffc13d54: 40 9d 00 08 ble- cr7,ffc13d5c <== ALWAYS TAKEN ffc13d58: 7f dd f3 78 mr r29,r30 <== 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)); ffc13d5c: 7f 9d 48 40 cmplw cr7,r29,r9 ffc13d60: 7f bc eb 78 mr r28,r29 ffc13d64: 40 9d 00 08 ble- cr7,ffc13d6c <== ALWAYS TAKEN ffc13d68: 7d 3c 4b 78 mr r28,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) ffc13d6c: 2f 9c 00 00 cmpwi cr7,r28,0 uint32_t ino ) { return (ino >= fs_info->uino_base); } ffc13d70: 89 3f 00 02 lbz r9,2(r31) ffc13d74: 88 9f 00 0c lbz r4,12(r31) 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) ffc13d78: 41 9e 00 7c beq- cr7,ffc13df4 <== NEVER TAKEN { if (bytes_to_write == fs_info->vol.bytes_per_block) ffc13d7c: 7f 9c 50 00 cmpw cr7,r28,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); ffc13d80: 7c 89 20 50 subf r4,r9,r4 ffc13d84: 7f 64 20 30 slw r4,r27,r4 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); ffc13d88: 7f e3 fb 78 mr r3,r31 ffc13d8c: 38 a0 00 02 li r5,2 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) ffc13d90: 41 9e 00 08 beq- cr7,ffc13d98 { 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); ffc13d94: 38 a0 00 01 li r5,1 ffc13d98: 38 c1 00 08 addi r6,r1,8 ffc13d9c: 4b ff fd 35 bl ffc13ad0 if (RC_OK == rc) ffc13da0: 2f 83 00 00 cmpwi cr7,r3,0 ffc13da4: 40 be 00 20 bne+ cr7,ffc13dc4 <== NEVER TAKEN { memset(blk_buf + offset, pattern, bytes_to_write); ffc13da8: 80 61 00 08 lwz r3,8(r1) ffc13dac: 7f 04 c3 78 mr r4,r24 ffc13db0: 7f 85 e3 78 mr r5,r28 ffc13db4: 7c 63 ca 14 add r3,r3,r25 ffc13db8: 48 00 83 91 bl ffc1c148 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; ffc13dbc: 9a ff 00 88 stb r23,136(r31) ffc13dc0: 48 00 00 34 b ffc13df4 fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) ffc13dc4: 7f 9d 18 00 cmpw cr7,r29,r3 ffc13dc8: 40 be 00 24 bne+ cr7,ffc13dec <== NEVER TAKEN rc = -1; else { bytes_to_write -= ret; ffc13dcc: 7f dd f0 50 subf r30,r29,r30 bytes_written += ret; ffc13dd0: 7f 5a ea 14 add r26,r26,r29 ++cur_blk; ffc13dd4: 3b 7b 00 01 addi r27,r27,1 ffc13dd8: 3b 20 00 00 li r25,0 ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) ffc13ddc: 2f 9e 00 00 cmpwi cr7,r30,0 ffc13de0: 40 9e ff 64 bne+ cr7,ffc13d44 ffc13de4: 7f 43 d3 78 mr r3,r26 ffc13de8: 48 00 00 14 b ffc13dfc fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) ffc13dec: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc13df0: 48 00 00 0c b ffc13dfc <== NOT EXECUTED } } if (RC_OK != rc) return rc; else return bytes_to_write; ffc13df4: 7f 83 e3 78 mr r3,r28 ffc13df8: 4b ff ff cc b ffc13dc4 } if (RC_OK != rc) return rc; else return bytes_written; } ffc13dfc: 39 61 00 40 addi r11,r1,64 ffc13e00: 4b fe d7 dc b ffc015dc <_restgpr_23_x> =============================================================================== ffc13e04 : const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { ffc13e04: 94 21 ff c0 stwu r1,-64(r1) ffc13e08: 7c 08 02 a6 mflr r0 ffc13e0c: 7d 80 00 26 mfcr r12 ffc13e10: 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)); ffc13e14: 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) { ffc13e18: be e1 00 1c stmw r23,28(r1) ffc13e1c: 7c 7f 1b 78 mr r31,r3 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); ffc13e20: 7d 25 48 50 subf r9,r5,r9 ffc13e24: 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) { ffc13e28: 91 81 00 18 stw r12,24(r1) ffc13e2c: 7c bd 2b 78 mr r29,r5 ffc13e30: 7c f8 3b 78 mr r24,r7 ffc13e34: 7d 1c 43 78 mr r28,r8 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); ffc13e38: 7c de 33 78 mr r30,r6 ffc13e3c: 40 9d 00 08 ble- cr7,ffc13e44 <== ALWAYS TAKEN ffc13e40: 7d 3e 4b 78 mr r30,r9 <== NOT EXECUTED uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); ffc13e44: 7f e3 fb 78 mr r3,r31 ffc13e48: 4b ff fa 71 bl ffc138b8 uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); ffc13e4c: 8b 3f 00 0c lbz r25,12(r31) uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ssize_t bytes_written = 0; ffc13e50: 3b 60 00 00 li r27,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); ffc13e54: 7f ba cc 30 srw r26,r29,r25 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ffc13e58: 7f 59 c8 30 slw r25,r26,r25 ffc13e5c: 7f 39 e8 50 subf r25,r25,r29 ssize_t bytes_written = 0; uint8_t *buffer = (uint8_t*)buff; ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; ffc13e60: 7f 43 d2 14 add r26,r3,r26 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 ffc13e64: 2e 1c 00 00 cmpwi cr4,r28,0 ffc13e68: 3a e0 00 01 li r23,1 ffc13e6c: 48 00 00 a4 b ffc13f10 cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) { c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); ffc13e70: a1 5f 00 0a lhz r10,10(r31) ffc13e74: 7d 39 50 50 subf r9,r25,r10 ffc13e78: 7f 89 f0 40 cmplw cr7,r9,r30 ffc13e7c: 7d 3d 4b 78 mr r29,r9 ffc13e80: 40 9d 00 08 ble- cr7,ffc13e88 ffc13e84: 7f dd f3 78 mr r29,r30 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)); ffc13e88: 7f 9d 48 40 cmplw cr7,r29,r9 ffc13e8c: 7f bc eb 78 mr r28,r29 ffc13e90: 40 9d 00 08 ble- cr7,ffc13e98 <== ALWAYS TAKEN ffc13e94: 7d 3c 4b 78 mr r28,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) ffc13e98: 2f 9c 00 00 cmpwi cr7,r28,0 uint32_t ino ) { return (ino >= fs_info->uino_base); } ffc13e9c: 89 3f 00 02 lbz r9,2(r31) ffc13ea0: 88 9f 00 0c lbz r4,12(r31) 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) ffc13ea4: 41 9e 00 84 beq- cr7,ffc13f28 <== 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); ffc13ea8: 7c 89 20 50 subf r4,r9,r4 ffc13eac: 7f 44 20 30 slw r4,r26,r4 { 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); ffc13eb0: 7f e3 fb 78 mr r3,r31 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 ffc13eb4: 40 92 00 10 bne- cr4,ffc13ec4 || (bytes_to_write == fs_info->vol.bytes_per_block)) ffc13eb8: 7f 9c 50 00 cmpw cr7,r28,r10 { 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); ffc13ebc: 38 a0 00 01 li r5,1 uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk); if (0 < bytes_to_write) { if ( overwrite_block || (bytes_to_write == fs_info->vol.bytes_per_block)) ffc13ec0: 40 9e 00 0c bne- cr7,ffc13ecc { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); ffc13ec4: 38 a0 00 02 li r5,2 ffc13ec8: 48 00 00 04 b ffc13ecc } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); ffc13ecc: 38 c1 00 08 addi r6,r1,8 ffc13ed0: 4b ff fc 01 bl ffc13ad0 if (RC_OK == rc) ffc13ed4: 2f 83 00 00 cmpwi cr7,r3,0 ffc13ed8: 40 be 00 20 bne+ cr7,ffc13ef8 <== NEVER TAKEN { memcpy(blk_buf + offset, buf, bytes_to_write); ffc13edc: 80 61 00 08 lwz r3,8(r1) ffc13ee0: 7c 98 da 14 add r4,r24,r27 ffc13ee4: 7f 85 e3 78 mr r5,r28 ffc13ee8: 7c 63 ca 14 add r3,r3,r25 ffc13eec: 48 00 81 69 bl ffc1c054 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; ffc13ef0: 9a ff 00 88 stb r23,136(r31) ffc13ef4: 48 00 00 34 b ffc13f28 cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) ffc13ef8: 7f 9d 18 00 cmpw cr7,r29,r3 ffc13efc: 40 be 00 24 bne+ cr7,ffc13f20 <== NEVER TAKEN rc = -1; else { bytes_to_write -= ret; ffc13f00: 7f dd f0 50 subf r30,r29,r30 bytes_written += ret; ffc13f04: 7f 7b ea 14 add r27,r27,r29 ++cur_blk; ffc13f08: 3b 5a 00 01 addi r26,r26,1 ffc13f0c: 3b 20 00 00 li r25,0 uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) ffc13f10: 2f 9e 00 00 cmpwi cr7,r30,0 ffc13f14: 40 9e ff 5c bne+ cr7,ffc13e70 ffc13f18: 7f 63 db 78 mr r3,r27 ffc13f1c: 48 00 00 14 b ffc13f30 cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) ffc13f20: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc13f24: 48 00 00 0c b ffc13f30 <== NOT EXECUTED } } if (RC_OK != rc) return rc; else return bytes_to_write; ffc13f28: 7f 83 e3 78 mr r3,r28 ffc13f2c: 4b ff ff cc b ffc13ef8 } if (RC_OK != rc) return rc; else return bytes_written; } ffc13f30: 81 81 00 18 lwz r12,24(r1) ffc13f34: 39 61 00 40 addi r11,r1,64 ffc13f38: 7d 80 81 20 mtcrf 8,r12 ffc13f3c: 4b fe d6 a0 b ffc015dc <_restgpr_23_x> =============================================================================== ffc1317c : int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { ffc1317c: 94 21 ff e8 stwu r1,-24(r1) ffc13180: 7c 08 02 a6 mflr r0 ffc13184: 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) ffc13188: 81 24 00 08 lwz r9,8(r4) int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { ffc1318c: bf a1 00 0c stmw r29,12(r1) ffc13190: 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) ffc13194: 2b 89 00 01 cmplwi cr7,r9,1 ffc13198: 40 9d 00 14 ble- cr7,ffc131ac { fat_fd->links_num--; ffc1319c: 39 29 ff ff addi r9,r9,-1 ffc131a0: 91 24 00 08 stw r9,8(r4) return rc; ffc131a4: 38 60 00 00 li r3,0 ffc131a8: 48 00 00 90 b ffc13238 } key = fat_construct_key(fs_info, &fat_fd->dir_pos.sname); if (fat_fd->flags & FAT_FILE_REMOVED) ffc131ac: 89 24 00 30 lbz r9,48(r4) ffc131b0: 7c 7e 1b 78 mr r30,r3 ffc131b4: 71 3d 00 01 andi. r29,r9,1 ffc131b8: 41 82 00 40 beq- ffc131f8 { rc = fat_file_truncate(fs_info, fat_fd, 0); ffc131bc: 38 a0 00 00 li r5,0 ffc131c0: 4b ff fe a9 bl ffc13068 if ( rc != RC_OK ) ffc131c4: 2c 03 00 00 cmpwi r3,0 ffc131c8: 40 a2 00 70 bne+ ffc13238 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); ffc131cc: 7f e3 fb 78 mr r3,r31 ffc131d0: 48 00 33 59 bl ffc16528 <_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) ) ffc131d4: 80 9f 00 0c lwz r4,12(r31) ffc131d8: 7f c3 f3 78 mr r3,r30 ffc131dc: 48 00 17 e5 bl ffc149c0 ffc131e0: 2f 83 00 00 cmpwi cr7,r3,0 ffc131e4: 41 be 00 34 beq+ cr7,ffc13218 <== ALWAYS TAKEN fat_free_unique_ino(fs_info, fat_fd->ino); ffc131e8: 80 9f 00 0c lwz r4,12(r31) <== NOT EXECUTED ffc131ec: 7f c3 f3 78 mr r3,r30 <== NOT EXECUTED ffc131f0: 48 00 17 a5 bl ffc14994 <== NOT EXECUTED ffc131f4: 48 00 00 24 b ffc13218 <== NOT EXECUTED free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) ffc131f8: 80 84 00 0c lwz r4,12(r4) ffc131fc: 48 00 17 c5 bl ffc149c0 ffc13200: 2f 83 00 00 cmpwi cr7,r3,0 ffc13204: 41 9e 00 0c beq- cr7,ffc13210 { fat_fd->links_num = 0; ffc13208: 93 bf 00 08 stw r29,8(r31) ffc1320c: 48 00 00 14 b ffc13220 ffc13210: 7f e3 fb 78 mr r3,r31 ffc13214: 48 00 33 15 bl ffc16528 <_Chain_Extract> } else { _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); free(fat_fd); ffc13218: 7f e3 fb 78 mr r3,r31 ffc1321c: 4b ff 2a c1 bl ffc05cdc * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); return rc; } ffc13220: 80 01 00 1c lwz r0,28(r1) } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); ffc13224: 7f c3 f3 78 mr r3,r30 return rc; } ffc13228: bb a1 00 0c lmw r29,12(r1) ffc1322c: 7c 08 03 a6 mtlr r0 ffc13230: 38 21 00 18 addi r1,r1,24 } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); ffc13234: 48 00 06 dc b ffc13910 return rc; } ffc13238: 39 61 00 18 addi r11,r1,24 ffc1323c: 4b fe e3 b8 b ffc015f4 <_restgpr_29_x> =============================================================================== ffc13314 : fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { ffc13314: 94 21 ff c0 stwu r1,-64(r1) ffc13318: 7c 08 02 a6 mflr r0 int rc = RC_OK; uint32_t chain = 0; ffc1331c: 39 20 00 00 li r9,0 fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { ffc13320: be e1 00 1c stmw r23,28(r1) ffc13324: 7c f8 3b 78 mr r24,r7 ffc13328: 7c 9e 23 78 mr r30,r4 ffc1332c: 90 01 00 44 stw r0,68(r1) ffc13330: 7c dc 33 78 mr r28,r6 uint32_t last_cl = 0; uint32_t bytes_remain = 0; uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; ffc13334: 90 d8 00 00 stw r6,0(r24) uint32_t new_length, uint32_t *a_length ) { int rc = RC_OK; uint32_t chain = 0; ffc13338: 91 21 00 14 stw r9,20(r1) uint32_t bytes2add = 0; uint32_t cls2add = 0; uint32_t old_last_cl; uint32_t last_cl = 0; ffc1333c: 91 21 00 0c stw r9,12(r1) uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) ffc13340: 81 24 00 18 lwz r9,24(r4) ffc13344: 7f 86 48 40 cmplw cr7,r6,r9 ffc13348: 41 bd 00 0c bgt+ cr7,ffc13354 return RC_OK; ffc1334c: 3b a0 00 00 li r29,0 ffc13350: 48 00 02 04 b ffc13554 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && ffc13354: 81 44 00 20 lwz r10,32(r4) ffc13358: 7c 7f 1b 78 mr r31,r3 ffc1335c: 7c b7 2b 78 mr r23,r5 ffc13360: 2f 8a 00 01 cmpwi cr7,r10,1 ffc13364: 40 be 00 20 bne+ cr7,ffc13384 ffc13368: 81 44 00 24 lwz r10,36(r4) ffc1336c: 2f 8a 00 00 cmpwi cr7,r10,0 ffc13370: 40 9e 00 14 bne- cr7,ffc13384 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) ffc13374: 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)) && ffc13378: 71 48 00 03 andi. r8,r10,3 ffc1337c: 41 a2 00 08 beq+ ffc13384 <== NEVER TAKEN ffc13380: 48 00 00 c8 b ffc13448 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) rtems_set_errno_and_return_minus_one( ENOSPC ); bytes_remain = (fs_info->vol.bpc - ffc13384: a3 7f 00 06 lhz r27,6(r31) bytes2add = new_length - fat_fd->fat_file_size; if (bytes2add > bytes_remain) bytes2add -= bytes_remain; else bytes2add = 0; ffc13388: 3b 40 00 00 li r26,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))) & ffc1338c: 39 5b ff ff addi r10,r27,-1 ffc13390: 7d 59 48 38 and r25,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 - ffc13394: 7f 79 d8 50 subf r27,r25,r27 ffc13398: 7f 7b 50 38 and r27,r27,r10 (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & (fs_info->vol.bpc - 1); bytes2add = new_length - fat_fd->fat_file_size; ffc1339c: 7d 49 e0 50 subf r10,r9,r28 if (bytes2add > bytes_remain) ffc133a0: 7f 8a d8 40 cmplw cr7,r10,r27 ffc133a4: 40 9d 00 08 ble- cr7,ffc133ac bytes2add -= bytes_remain; ffc133a8: 7f 5b 50 50 subf r26,r27,r10 else bytes2add = 0; if (zero_fill && bytes_remain > 0) { ffc133ac: 2f 97 00 00 cmpwi cr7,r23,0 ffc133b0: 41 9e 00 50 beq- cr7,ffc13400 ffc133b4: 2f 9b 00 00 cmpwi cr7,r27,0 ffc133b8: 41 be 00 48 beq+ cr7,ffc13400 uint32_t start = fat_fd->fat_file_size; uint32_t cl_start = start >> fs_info->vol.bpc_log2; ffc133bc: 88 bf 00 08 lbz r5,8(r31) 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); ffc133c0: 7f e3 fb 78 mr r3,r31 ffc133c4: 7f c4 f3 78 mr r4,r30 ffc133c8: 7d 25 2c 30 srw r5,r9,r5 ffc133cc: 38 c1 00 08 addi r6,r1,8 ffc133d0: 4b ff f8 85 bl ffc12c54 if (rc != RC_OK) ffc133d4: 7c 9d 23 79 mr. r29,r4 ffc133d8: 40 a2 01 7c bne+ ffc13554 <== NEVER TAKEN return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); ffc133dc: 80 81 00 08 lwz r4,8(r1) ffc133e0: 7f e3 fb 78 mr r3,r31 ffc133e4: 7f 25 cb 78 mr r5,r25 ffc133e8: 7f 66 db 78 mr r6,r27 ffc133ec: 38 e0 00 00 li r7,0 ffc133f0: 48 00 08 f9 bl ffc13ce8 if (bytes_remain != bytes_written) return -1; ffc133f4: 3b a0 ff ff li r29,-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) ffc133f8: 7f 9b 18 00 cmpw cr7,r27,r3 ffc133fc: 40 be 01 58 bne+ cr7,ffc13554 <== NEVER TAKEN /* * 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) ffc13400: 2f 9a 00 00 cmpwi cr7,r26,0 ffc13404: 41 9e ff 48 beq+ cr7,ffc1334c return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; ffc13408: 89 3f 00 08 lbz r9,8(r31) ffc1340c: 3b 3a ff ff addi r25,r26,-1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, ffc13410: 7f e3 fb 78 mr r3,r31 * file ) - return */ if (bytes2add == 0) return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; ffc13414: 7f 39 4c 30 srw r25,r25,r9 ffc13418: 3b 39 00 01 addi r25,r25,1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, ffc1341c: 38 81 00 14 addi r4,r1,20 ffc13420: 7f 25 cb 78 mr r5,r25 ffc13424: 38 c1 00 08 addi r6,r1,8 ffc13428: 38 e1 00 0c addi r7,r1,12 ffc1342c: 7e e8 bb 78 mr r8,r23 ffc13430: 48 00 68 a5 bl ffc19cd4 &cls_added, &last_cl, zero_fill); /* this means that low level I/O error occured */ if (rc != RC_OK) ffc13434: 7c 7d 1b 79 mr. r29,r3 ffc13438: 40 82 01 1c bne- ffc13554 <== NEVER TAKEN return rc; /* this means that no space left on device */ if ((cls_added == 0) && (bytes_remain == 0)) ffc1343c: 81 21 00 08 lwz r9,8(r1) ffc13440: 7f 6a 4b 79 or. r10,r27,r9 ffc13444: 40 a2 00 18 bne+ ffc1345c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(ENOSPC); ffc13448: 48 00 7f 2d bl ffc1b374 <__errno> ffc1344c: 39 20 00 1c li r9,28 ffc13450: 91 23 00 00 stw r9,0(r3) ffc13454: 3b a0 ff ff li r29,-1 ffc13458: 48 00 00 fc b ffc13554 /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) ffc1345c: 7f 99 48 00 cmpw cr7,r25,r9 ffc13460: 41 9e 00 24 beq- cr7,ffc13484 <== ALWAYS TAKEN { new_length -= bytes2add & (fs_info->vol.bpc - 1); ffc13464: a1 5f 00 06 lhz r10,6(r31) <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; ffc13468: 7d 29 c8 50 subf r9,r9,r25 <== 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); ffc1346c: 39 4a ff ff addi r10,r10,-1 <== NOT EXECUTED ffc13470: 7f 5a 50 38 and r26,r26,r10 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; ffc13474: 89 5f 00 08 lbz r10,8(r31) <== 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); ffc13478: 7f 9a e0 50 subf r28,r26,r28 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; ffc1347c: 7d 29 50 30 slw r9,r9,r10 <== NOT EXECUTED ffc13480: 7f 89 e0 50 subf r28,r9,r28 <== NOT EXECUTED } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) ffc13484: 80 de 00 18 lwz r6,24(r30) ffc13488: 2f 86 00 00 cmpwi cr7,r6,0 ffc1348c: 40 9e 00 18 bne- cr7,ffc134a4 { fat_fd->map.disk_cln = fat_fd->cln = chain; ffc13490: 81 21 00 14 lwz r9,20(r1) fat_fd->map.file_cln = 0; ffc13494: 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; ffc13498: 91 3e 00 1c stw r9,28(r30) ffc1349c: 91 3e 00 38 stw r9,56(r30) ffc134a0: 48 00 00 64 b ffc13504 fat_fd->map.file_cln = 0; } else { if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE) ffc134a4: 81 3e 00 3c lwz r9,60(r30) ffc134a8: 2f 89 ff ff cmpwi cr7,r9,-1 ffc134ac: 41 9e 00 0c beq- cr7,ffc134b8 <== NEVER TAKEN { old_last_cl = fat_fd->map.last_cln; ffc134b0: 91 21 00 10 stw r9,16(r1) ffc134b4: 48 00 00 2c b ffc134e0 } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, ffc134b8: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc134bc: 7f c4 f3 78 mr r4,r30 <== NOT EXECUTED ffc134c0: 38 a0 00 01 li r5,1 <== NOT EXECUTED ffc134c4: 38 c6 ff ff addi r6,r6,-1 <== NOT EXECUTED ffc134c8: 38 e1 00 10 addi r7,r1,16 <== NOT EXECUTED ffc134cc: 4c c6 31 82 crclr 4*cr1+eq <== NOT EXECUTED ffc134d0: 4b ff fd 71 bl ffc13240 <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) ffc134d4: 7c 7b 1b 79 mr. r27,r3 <== NOT EXECUTED ffc134d8: 41 a2 00 08 beq+ ffc134e0 <== NOT EXECUTED ffc134dc: 48 00 00 5c b ffc13538 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, chain); return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); ffc134e0: 80 81 00 10 lwz r4,16(r1) ffc134e4: 7f e3 fb 78 mr r3,r31 ffc134e8: 80 a1 00 14 lwz r5,20(r1) ffc134ec: 48 00 64 79 bl ffc19964 if ( rc != RC_OK ) ffc134f0: 7c 7b 1b 79 mr. r27,r3 { fat_free_fat_clusters_chain(fs_info, chain); ffc134f4: 7f e3 fb 78 mr r3,r31 return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); if ( rc != RC_OK ) ffc134f8: 41 a2 00 08 beq+ ffc13500 <== ALWAYS TAKEN ffc134fc: 48 00 00 40 b ffc1353c <== NOT EXECUTED { fat_free_fat_clusters_chain(fs_info, chain); return rc; } fat_buf_release(fs_info); ffc13500: 48 00 04 11 bl ffc13910 } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) ffc13504: 81 21 00 08 lwz r9,8(r1) ffc13508: 2f 89 00 00 cmpwi cr7,r9,0 ffc1350c: 41 9e 00 40 beq- cr7,ffc1354c <== NEVER TAKEN { fat_fd->map.last_cln = last_cl; ffc13510: 81 21 00 0c lwz r9,12(r1) ffc13514: 91 3e 00 3c stw r9,60(r30) if (fat_fd->fat_file_type == FAT_DIRECTORY) ffc13518: 81 3e 00 10 lwz r9,16(r30) ffc1351c: 2f 89 00 00 cmpwi cr7,r9,0 ffc13520: 40 be 00 2c bne+ cr7,ffc1354c { rc = fat_init_clusters_chain(fs_info, chain); ffc13524: 80 81 00 14 lwz r4,20(r1) ffc13528: 7f e3 fb 78 mr r3,r31 ffc1352c: 48 00 13 05 bl ffc14830 if ( rc != RC_OK ) ffc13530: 7c 7b 1b 79 mr. r27,r3 ffc13534: 41 a2 00 18 beq+ ffc1354c <== ALWAYS TAKEN { fat_free_fat_clusters_chain(fs_info, chain); ffc13538: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc1353c: 80 81 00 14 lwz r4,20(r1) <== NOT EXECUTED ffc13540: 7f 7d db 78 mr r29,r27 <== NOT EXECUTED ffc13544: 48 00 66 bd bl ffc19c00 <== NOT EXECUTED ffc13548: 48 00 00 0c b ffc13554 <== NOT EXECUTED return rc; } } } *a_length = new_length; ffc1354c: 93 98 00 00 stw r28,0(r24) fat_fd->fat_file_size = new_length; ffc13550: 93 9e 00 18 stw r28,24(r30) return RC_OK; } ffc13554: 39 61 00 40 addi r11,r1,64 ffc13558: 7f a3 eb 78 mr r3,r29 ffc1355c: 4b fe e0 80 b ffc015dc <_restgpr_23_x> =============================================================================== ffc13240 : fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { ffc13240: 94 21 ff d0 stwu r1,-48(r1) uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) ffc13244: 2f 85 00 01 cmpwi cr7,r5,1 fat_file_fd_t *fat_fd, int cmd, ...) { int rc = RC_OK; uint32_t cur_cln = 0; ffc13248: 39 20 00 00 li r9,0 fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { ffc1324c: 7c 08 02 a6 mflr r0 int rc = RC_OK; uint32_t cur_cln = 0; ffc13250: 91 21 00 14 stw r9,20(r1) uint32_t cl_start = 0; uint32_t pos = 0; uint32_t *ret; va_list ap; va_start(ap, cmd); ffc13254: 39 20 00 03 li r9,3 ffc13258: 99 21 00 08 stb r9,8(r1) ffc1325c: 39 21 00 38 addi r9,r1,56 ffc13260: 91 21 00 0c stw r9,12(r1) ffc13264: 39 21 00 10 addi r9,r1,16 fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { ffc13268: 90 01 00 34 stw r0,52(r1) ffc1326c: bf c1 00 28 stmw r30,40(r1) ffc13270: 90 c1 00 1c stw r6,28(r1) ffc13274: 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); ffc13278: 91 21 00 10 stw r9,16(r1) switch (cmd) ffc1327c: 40 be 00 80 bne+ cr7,ffc132fc <== NEVER TAKEN 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 ) { ffc13280: 81 24 00 18 lwz r9,24(r4) switch (cmd) { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); ffc13284: 3b c0 00 05 li r30,5 va_start(ap, cmd); switch (cmd) { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ffc13288: 7c ca 33 78 mr r10,r6 ret = va_arg(ap, uint32_t *); ffc1328c: 9b c1 00 08 stb r30,8(r1) /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { ffc13290: 7f 86 48 40 cmplw cr7,r6,r9 switch (cmd) { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); ffc13294: 7c ff 3b 78 mr r31,r7 /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { ffc13298: 41 bc 00 10 blt+ cr7,ffc132a8 <== ALWAYS TAKEN va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); ffc1329c: 48 00 80 d9 bl ffc1b374 <__errno> <== NOT EXECUTED ffc132a0: 93 c3 00 00 stw r30,0(r3) <== NOT EXECUTED ffc132a4: 48 00 00 64 b ffc13308 <== NOT EXECUTED } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && ffc132a8: 81 24 00 20 lwz r9,32(r4) ffc132ac: 2f 89 00 01 cmpwi cr7,r9,1 ffc132b0: 40 9e 00 28 bne- cr7,ffc132d8 ffc132b4: 81 24 00 24 lwz r9,36(r4) ffc132b8: 2f 89 00 00 cmpwi cr7,r9,0 ffc132bc: 40 9e 00 1c bne- cr7,ffc132d8 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) ffc132c0: 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)) && ffc132c4: 71 07 00 03 andi. r7,r8,3 ffc132c8: 41 82 00 10 beq- ffc132d8 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { /* cluster 0 (zero) reserved for root dir */ *ret = 0; ffc132cc: 91 3f 00 00 stw r9,0(r31) rc = RC_OK; ffc132d0: 38 60 00 00 li r3,0 break; ffc132d4: 48 00 00 38 b ffc1330c } cl_start = pos >> fs_info->vol.bpc_log2; ffc132d8: 88 a3 00 08 lbz r5,8(r3) rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); ffc132dc: 38 c1 00 14 addi r6,r1,20 ffc132e0: 7d 45 2c 30 srw r5,r10,r5 ffc132e4: 4b ff f9 71 bl ffc12c54 if ( rc != RC_OK ) ffc132e8: 7c 83 23 79 mr. r3,r4 ffc132ec: 40 82 00 20 bne- ffc1330c <== NEVER TAKEN break; *ret = cur_cln; ffc132f0: 81 21 00 14 lwz r9,20(r1) ffc132f4: 91 3f 00 00 stw r9,0(r31) break; ffc132f8: 48 00 00 14 b ffc1330c default: errno = EINVAL; ffc132fc: 48 00 80 79 bl ffc1b374 <__errno> <== NOT EXECUTED ffc13300: 39 20 00 16 li r9,22 <== NOT EXECUTED ffc13304: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED rc = -1; ffc13308: 38 60 ff ff li r3,-1 <== NOT EXECUTED break; } va_end(ap); return rc; } ffc1330c: 39 61 00 30 addi r11,r1,48 ffc13310: 4b fe e2 e8 b ffc015f8 <_restgpr_30_x> =============================================================================== ffc12c54 : fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { ffc12c54: 94 21 ff d0 stwu r1,-48(r1) ffc12c58: 7c 08 02 a6 mflr r0 ffc12c5c: 90 01 00 34 stw r0,52(r1) int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) ffc12c60: 81 24 00 34 lwz r9,52(r4) fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { ffc12c64: bf 41 00 18 stmw r26,24(r1) ffc12c68: 7c 9f 23 78 mr r31,r4 int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) ffc12c6c: 7f 85 48 00 cmpw cr7,r5,r9 fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { ffc12c70: 7c be 2b 78 mr r30,r5 ffc12c74: 7c dc 33 78 mr r28,r6 int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) ffc12c78: 40 be 00 10 bne+ cr7,ffc12c88 *disk_cln = fat_fd->map.disk_cln; ffc12c7c: 81 24 00 38 lwz r9,56(r4) ffc12c80: 91 26 00 00 stw r9,0(r6) ffc12c84: 48 00 00 70 b ffc12cf4 { uint32_t cur_cln; uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) ffc12c88: 7f 85 48 40 cmplw cr7,r5,r9 ffc12c8c: 7c 7a 1b 78 mr r26,r3 ffc12c90: 40 9d 00 14 ble- cr7,ffc12ca4 { cur_cln = fat_fd->map.disk_cln; ffc12c94: 81 44 00 38 lwz r10,56(r4) count = file_cln - fat_fd->map.file_cln; ffc12c98: 7f 69 28 50 subf r27,r9,r5 uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) { cur_cln = fat_fd->map.disk_cln; ffc12c9c: 91 41 00 08 stw r10,8(r1) ffc12ca0: 48 00 00 10 b ffc12cb0 count = file_cln - fat_fd->map.file_cln; } else { cur_cln = fat_fd->cln; ffc12ca4: 81 24 00 1c lwz r9,28(r4) ffc12ca8: 7c bb 2b 78 mr r27,r5 ffc12cac: 91 21 00 08 stw r9,8(r1) count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) ffc12cb0: 3b a0 00 00 li r29,0 ffc12cb4: 48 00 00 28 b ffc12cdc { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ffc12cb8: 7f 43 d3 78 mr r3,r26 ffc12cbc: 38 a1 00 08 addi r5,r1,8 ffc12cc0: 48 00 6a e5 bl ffc197a4 if ( rc != RC_OK ) ffc12cc4: 2c 03 00 00 cmpwi r3,0 ffc12cc8: 41 a2 00 10 beq+ ffc12cd8 <== ALWAYS TAKEN return rc; ffc12ccc: 7c 6b 1b 78 mr r11,r3 <== NOT EXECUTED ffc12cd0: 7c 6a fe 70 srawi r10,r3,31 <== NOT EXECUTED ffc12cd4: 48 00 00 28 b ffc12cfc <== NOT EXECUTED cur_cln = fat_fd->cln; count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) ffc12cd8: 3b bd 00 01 addi r29,r29,1 ffc12cdc: 7f 9d d8 00 cmpw cr7,r29,r27 ffc12ce0: 80 81 00 08 lwz r4,8(r1) ffc12ce4: 40 9e ff d4 bne+ cr7,ffc12cb8 if ( rc != RC_OK ) return rc; } /* update cache */ fat_fd->map.file_cln = file_cln; ffc12ce8: 93 df 00 34 stw r30,52(r31) fat_fd->map.disk_cln = cur_cln; ffc12cec: 90 9f 00 38 stw r4,56(r31) *disk_cln = cur_cln; ffc12cf0: 90 9c 00 00 stw r4,0(r28) } return RC_OK; ffc12cf4: 39 40 00 00 li r10,0 ffc12cf8: 39 60 00 00 li r11,0 } ffc12cfc: 7d 64 5b 78 mr r4,r11 ffc12d00: 39 61 00 30 addi r11,r1,48 ffc12d04: 7d 43 53 78 mr r3,r10 ffc12d08: 4b fe e8 e0 b ffc015e8 <_restgpr_26_x> =============================================================================== ffc12d0c : fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { ffc12d0c: 94 21 ff d8 stwu r1,-40(r1) ffc12d10: 7c 08 02 a6 mflr r0 ffc12d14: 7d 80 00 26 mfcr r12 ffc12d18: bf 21 00 0c stmw r25,12(r1) ffc12d1c: 7c 7d 1b 78 mr r29,r3 ffc12d20: 7c 99 23 78 mr r25,r4 ffc12d24: 90 01 00 2c stw r0,44(r1) ffc12d28: 7c bb 2b 78 mr r27,r5 ffc12d2c: 91 81 00 08 stw r12,8(r1) int rc = RC_OK; fat_file_fd_t *lfat_fd = NULL; uint32_t key = 0; /* construct key */ key = fat_construct_key(fs_info, &dir_pos->sname); ffc12d30: 4b ff fe cd bl ffc12bfc uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { uint32_t mod = (key1) % FAT_HASH_MODULE; ffc12d34: 54 7c 07 fe clrlwi r28,r3,31 rtems_chain_node *the_node = rtems_chain_first(hash + mod); ffc12d38: 1f 9c 00 0c mulli r28,r28,12 ffc12d3c: 81 3d 00 6c lwz r9,108(r29) ffc12d40: 7f 49 e2 14 add r26,r9,r28 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc12d44: 7f e9 e0 2e lwzx r31,r9,r28 int rc = RC_OK; fat_file_fd_t *lfat_fd = NULL; uint32_t key = 0; /* construct key */ key = fat_construct_key(fs_info, &dir_pos->sname); ffc12d48: 7c 7e 1b 78 mr r30,r3 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 )); ffc12d4c: 3b 5a 00 04 addi r26,r26,4 ffc12d50: 48 00 00 30 b ffc12d80 rtems_chain_node *the_node = rtems_chain_first(hash + mod); for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); ffc12d54: 7f a3 eb 78 mr r3,r29 ffc12d58: 38 9f 00 20 addi r4,r31,32 ffc12d5c: 4b ff fe a1 bl ffc12bfc if ( (key1) == ck) ffc12d60: 7f 9e 18 00 cmpw cr7,r30,r3 ffc12d64: 40 be 00 18 bne+ cr7,ffc12d7c 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++; ffc12d68: 81 3f 00 08 lwz r9,8(r31) /* 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; ffc12d6c: 93 fb 00 00 stw r31,0(r27) lfat_fd->links_num++; ffc12d70: 39 29 00 01 addi r9,r9,1 ffc12d74: 91 3f 00 08 stw r9,8(r31) ffc12d78: 48 00 00 f0 b ffc12e68 { *ret = (void *)the_node; return 0; } } the_node = the_node->next; ffc12d7c: 83 ff 00 00 lwz r31,0(r31) ) { 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) ; ) ffc12d80: 7f 9f d0 00 cmpw cr7,r31,r26 ffc12d84: 40 9e ff d0 bne+ cr7,ffc12d54 ffc12d88: 48 00 00 e8 b ffc12e70 { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); ffc12d8c: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED ffc12d90: 38 9f 00 20 addi r4,r31,32 <== NOT EXECUTED ffc12d94: 4b ff fe 69 bl ffc12bfc <== NOT EXECUTED if ( (key1) == ck) ffc12d98: 7f 9e 18 00 cmpw cr7,r30,r3 <== NOT EXECUTED ffc12d9c: 40 be 00 14 bne+ cr7,ffc12db0 <== NOT EXECUTED { if ( ((key2) == 0) || ((key2) == ffd->ino) ) ffc12da0: 41 92 00 24 beq- cr4,ffc12dc4 <== NOT EXECUTED ffc12da4: 81 3f 00 0c lwz r9,12(r31) <== NOT EXECUTED ffc12da8: 7f 9e 48 00 cmpw cr7,r30,r9 <== NOT EXECUTED ffc12dac: 41 9e 00 18 beq- cr7,ffc12dc4 <== NOT EXECUTED { *ret = (void *)the_node; return 0; } } the_node = the_node->next; ffc12db0: 83 ff 00 00 lwz r31,0(r31) <== 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) ; ) ffc12db4: 7f 9f d0 00 cmpw cr7,r31,r26 ffc12db8: 40 9e ff d4 bne+ cr7,ffc12d8c <== NEVER TAKEN return 0; } } the_node = the_node->next; } return -1; ffc12dbc: 3b 40 ff ff li r26,-1 ffc12dc0: 48 00 00 08 b ffc12dc8 if ( (key1) == ck) { if ( ((key2) == 0) || ((key2) == ffd->ino) ) { *ret = (void *)the_node; return 0; ffc12dc4: 3b 40 00 00 li r26,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)); ffc12dc8: 38 60 00 44 li r3,68 ffc12dcc: 4b ff 34 c1 bl ffc0628c if ( lfat_fd == NULL ) ffc12dd0: 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)); ffc12dd4: 90 7b 00 00 stw r3,0(r27) ffc12dd8: 7c 7f 1b 78 mr r31,r3 if ( lfat_fd == NULL ) ffc12ddc: 40 be 00 08 bne+ cr7,ffc12de4 <== ALWAYS TAKEN ffc12de0: 48 00 00 64 b ffc12e44 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); ffc12de4: 38 a0 00 44 li r5,68 ffc12de8: 38 80 00 00 li r4,0 ffc12dec: 48 00 93 5d bl ffc1c148 lfat_fd->links_num = 1; ffc12df0: 39 20 00 01 li r9,1 ffc12df4: 91 3f 00 08 stw r9,8(r31) lfat_fd->flags &= ~FAT_FILE_REMOVED; lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; lfat_fd->dir_pos = *dir_pos; if ( rc != RC_OK ) ffc12df8: 2f 9a 00 00 cmpwi cr7,r26,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; ffc12dfc: 89 3f 00 30 lbz r9,48(r31) ffc12e00: 55 29 00 3c rlwinm r9,r9,0,0,30 ffc12e04: 99 3f 00 30 stb r9,48(r31) lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; ffc12e08: 39 20 ff ff li r9,-1 ffc12e0c: 91 3f 00 3c stw r9,60(r31) lfat_fd->dir_pos = *dir_pos; ffc12e10: 39 3f 00 20 addi r9,r31,32 ffc12e14: 7c b9 84 aa lswi r5,r25,16 ffc12e18: 7c a9 85 aa stswi r5,r9,16 if ( rc != RC_OK ) ffc12e1c: 41 9e 00 0c beq- cr7,ffc12e28 <== NEVER TAKEN lfat_fd->ino = key; ffc12e20: 93 df 00 0c stw r30,12(r31) ffc12e24: 48 00 00 34 b ffc12e58 else { lfat_fd->ino = fat_get_unique_ino(fs_info); ffc12e28: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED ffc12e2c: 48 00 1a 89 bl ffc148b4 <== NOT EXECUTED if ( lfat_fd->ino == 0 ) ffc12e30: 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); ffc12e34: 90 7f 00 0c stw r3,12(r31) <== NOT EXECUTED if ( lfat_fd->ino == 0 ) ffc12e38: 40 be 00 20 bne+ cr7,ffc12e58 <== NOT EXECUTED { free((*fat_fd)); ffc12e3c: 80 7b 00 00 lwz r3,0(r27) <== NOT EXECUTED ffc12e40: 4b ff 2e 9d bl ffc05cdc <== 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 ); ffc12e44: 48 00 85 31 bl ffc1b374 <__errno> <== NOT EXECUTED ffc12e48: 39 20 00 0c li r9,12 <== NOT EXECUTED ffc12e4c: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc12e50: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc12e54: 48 00 00 34 b ffc12e88 <== NOT EXECUTED */ static inline void _hash_insert(rtems_chain_control *hash, uint32_t key1, uint32_t key2, fat_file_fd_t *el) { rtems_chain_append((hash) + ((key1) % FAT_HASH_MODULE), &(el)->link); ffc12e58: 80 7d 00 6c lwz r3,108(r29) RTEMS_INLINE_ROUTINE void rtems_chain_append( rtems_chain_control *the_chain, rtems_chain_node *the_node ) { _Chain_Append( the_chain, the_node ); ffc12e5c: 7f e4 fb 78 mr r4,r31 ffc12e60: 7c 63 e2 14 add r3,r3,r28 ffc12e64: 4b ff 81 b9 bl ffc0b01c <_Chain_Append> /* * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; ffc12e68: 38 60 00 00 li r3,0 ffc12e6c: 48 00 00 1c b ffc12e88 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); ffc12e70: 81 3d 00 70 lwz r9,112(r29) 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) ) ffc12e74: 2e 1e 00 00 cmpwi cr4,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); ffc12e78: 7f 49 e2 14 add r26,r9,r28 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc12e7c: 7f e9 e0 2e lwzx r31,r9,r28 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 )); ffc12e80: 3b 5a 00 04 addi r26,r26,4 ffc12e84: 4b ff ff 30 b ffc12db4 * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; } ffc12e88: 81 81 00 08 lwz r12,8(r1) ffc12e8c: 39 61 00 28 addi r11,r1,40 ffc12e90: 7d 80 81 20 mtcrf 8,r12 ffc12e94: 4b fe e7 50 b ffc015e4 <_restgpr_25_x> =============================================================================== ffc12eac : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { ffc12eac: 94 21 ff c0 stwu r1,-64(r1) ffc12eb0: 7c 08 02 a6 mflr r0 int rc = RC_OK; ssize_t ret = 0; uint32_t cmpltd = 0; uint32_t cur_cln = 0; ffc12eb4: 39 20 00 00 li r9,0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { ffc12eb8: be c1 00 18 stmw r22,24(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) ffc12ebc: 7c de 33 79 mr. r30,r6 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { ffc12ec0: 90 01 00 44 stw r0,68(r1) int rc = RC_OK; ssize_t ret = 0; uint32_t cmpltd = 0; uint32_t cur_cln = 0; ffc12ec4: 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) ffc12ec8: 41 82 01 8c beq- ffc13054 <== NEVER TAKEN /* * >= because start is offset and computed from 0 and file_size * computed from 1 */ if ( start >= fat_fd->fat_file_size ) ffc12ecc: 81 24 00 18 lwz r9,24(r4) ffc12ed0: 7c 7f 1b 78 mr r31,r3 ffc12ed4: 7c 9d 23 78 mr r29,r4 ffc12ed8: 7f 85 48 40 cmplw cr7,r5,r9 ffc12edc: 7c bc 2b 78 mr r28,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; ffc12ee0: 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 ) ffc12ee4: 40 9c 01 7c bge- cr7,ffc13060 return FAT_EOF; if ((count > fat_fd->fat_file_size) || ffc12ee8: 7f 9e 48 40 cmplw cr7,r30,r9 ffc12eec: 7c f7 3b 78 mr r23,r7 ffc12ef0: 41 9d 00 10 bgt- cr7,ffc12f00 <== NEVER TAKEN (start > fat_fd->fat_file_size - count)) ffc12ef4: 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) || ffc12ef8: 7f 85 50 40 cmplw cr7,r5,r10 ffc12efc: 40 9d 00 08 ble- cr7,ffc12f04 (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; ffc12f00: 7f dc 48 50 subf r30,r28,r9 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && ffc12f04: 81 3d 00 20 lwz r9,32(r29) ffc12f08: 2f 89 00 01 cmpwi cr7,r9,1 ffc12f0c: 40 9e 00 5c bne- cr7,ffc12f68 ffc12f10: 81 3d 00 24 lwz r9,36(r29) ffc12f14: 2f 89 00 00 cmpwi cr7,r9,0 ffc12f18: 40 9e 00 50 bne- cr7,ffc12f68 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) ffc12f1c: 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)) && ffc12f20: 71 2a 00 03 andi. r10,r9,3 ffc12f24: 41 a2 00 44 beq+ ffc12f68 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln); ffc12f28: 80 9d 00 1c lwz r4,28(r29) ffc12f2c: 7f e3 fb 78 mr r3,r31 ffc12f30: 4b ff fc 99 bl ffc12bc8 sec += (start >> fs_info->vol.sec_log2); ffc12f34: 88 9f 00 02 lbz r4,2(r31) byte = start & (fs_info->vol.bps - 1); ffc12f38: a0 bf 00 00 lhz r5,0(r31) ret = _fat_block_read(fs_info, sec, byte, count, buf); ffc12f3c: 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); ffc12f40: 7f 84 24 30 srw r4,r28,r4 byte = start & (fs_info->vol.bps - 1); ffc12f44: 38 a5 ff ff addi r5,r5,-1 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); ffc12f48: 7c 83 22 14 add r4,r3,r4 byte = start & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, count, buf); ffc12f4c: 7f 85 28 38 and r5,r28,r5 ffc12f50: 7f e3 fb 78 mr r3,r31 ffc12f54: 7e e7 bb 78 mr r7,r23 ffc12f58: 48 00 0c 41 bl ffc13b98 <_fat_block_read> if ( ret < 0 ) ffc12f5c: 2c 03 00 00 cmpwi r3,0 ffc12f60: 40 a0 01 00 bge+ ffc13060 <== ALWAYS TAKEN ffc12f64: 48 00 00 f8 b ffc1305c <== NOT EXECUTED return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; ffc12f68: 8b 1f 00 08 lbz r24,8(r31) save_ofs = ofs = start & (fs_info->vol.bpc - 1); rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); ffc12f6c: 3a c1 00 08 addi r22,r1,8 ffc12f70: 7f e3 fb 78 mr r3,r31 return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); ffc12f74: a3 7f 00 06 lhz r27,6(r31) return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; ffc12f78: 7f 98 c4 30 srw r24,r28,r24 save_ofs = ofs = start & (fs_info->vol.bpc - 1); rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); ffc12f7c: 7f a4 eb 78 mr r4,r29 ffc12f80: 7f 05 c3 78 mr r5,r24 ffc12f84: 7e c6 b3 78 mr r6,r22 ffc12f88: 4b ff fc cd bl ffc12c54 if (rc != RC_OK) ffc12f8c: 2f 84 00 00 cmpwi cr7,r4,0 ffc12f90: 7c 83 23 78 mr r3,r4 ffc12f94: 40 9e 00 cc bne- cr7,ffc13060 <== NEVER TAKEN return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); ffc12f98: 3b 7b ff ff addi r27,r27,-1 ffc12f9c: 7f 9c d8 38 and r28,r28,r27 ffc12fa0: 7f 99 e3 78 mr r25,r28 ffc12fa4: 3b 40 00 00 li r26,0 ffc12fa8: 3b 60 00 00 li r27,0 ffc12fac: 48 00 00 7c b ffc13028 if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); ffc12fb0: a3 5f 00 06 lhz r26,6(r31) ffc12fb4: 7f 59 d0 50 subf r26,r25,r26 ffc12fb8: 7f 9a f0 40 cmplw cr7,r26,r30 ffc12fbc: 40 9d 00 08 ble- cr7,ffc12fc4 ffc12fc0: 7f da f3 78 mr r26,r30 sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); ffc12fc4: 80 81 00 08 lwz r4,8(r1) ffc12fc8: 7f e3 fb 78 mr r3,r31 ffc12fcc: 4b ff fb fd bl ffc12bc8 sec += (ofs >> fs_info->vol.sec_log2); ffc12fd0: 88 9f 00 02 lbz r4,2(r31) byte = ofs & (fs_info->vol.bps - 1); ffc12fd4: a0 bf 00 00 lhz r5,0(r31) ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); ffc12fd8: 7f 46 d3 78 mr r6,r26 while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); sec += (ofs >> fs_info->vol.sec_log2); ffc12fdc: 7f 24 24 30 srw r4,r25,r4 byte = ofs & (fs_info->vol.bps - 1); ffc12fe0: 38 a5 ff ff addi r5,r5,-1 while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); sec += (ofs >> fs_info->vol.sec_log2); ffc12fe4: 7c 83 22 14 add r4,r3,r4 byte = ofs & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); ffc12fe8: 7f 25 28 38 and r5,r25,r5 ffc12fec: 7f e3 fb 78 mr r3,r31 ffc12ff0: 7c f7 da 14 add r7,r23,r27 ffc12ff4: 48 00 0b a5 bl ffc13b98 <_fat_block_read> if ( ret < 0 ) ffc12ff8: 2f 83 00 00 cmpwi cr7,r3,0 ffc12ffc: 41 9c 00 60 blt- cr7,ffc1305c <== NEVER TAKEN return -1; count -= c; ffc13000: 7f da f0 50 subf r30,r26,r30 cmpltd += c; ffc13004: 7f 7b d2 14 add r27,r27,r26 save_cln = cur_cln; ffc13008: 83 41 00 08 lwz r26,8(r1) rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ffc1300c: 7f e3 fb 78 mr r3,r31 ffc13010: 7f 44 d3 78 mr r4,r26 ffc13014: 7e c5 b3 78 mr r5,r22 ffc13018: 48 00 67 8d bl ffc197a4 if ( rc != RC_OK ) return rc; ofs = 0; ffc1301c: 3b 20 00 00 li r25,0 count -= c; cmpltd += c; save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) ffc13020: 2c 03 00 00 cmpwi r3,0 ffc13024: 40 82 00 3c bne- ffc13060 <== NEVER TAKEN rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) ffc13028: 2f 9e 00 00 cmpwi cr7,r30,0 ffc1302c: 40 9e ff 84 bne+ cr7,ffc12fb0 } /* 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); ffc13030: 89 3f 00 08 lbz r9,8(r31) ffc13034: 3b 9c ff ff addi r28,r28,-1 ffc13038: 7f 9c da 14 add r28,r28,r27 fat_fd->map.disk_cln = save_cln; ffc1303c: 93 5d 00 38 stw r26,56(r29) } /* 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); ffc13040: 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 + ffc13044: 7f 1c c2 14 add r24,r28,r24 ffc13048: 93 1d 00 34 stw r24,52(r29) ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; return cmpltd; ffc1304c: 7f 63 db 78 mr r3,r27 ffc13050: 48 00 00 10 b ffc13060 uint32_t byte = 0; uint32_t c = 0; /* it couldn't be removed - otherwise cache update will be broken */ if (count == 0) return cmpltd; ffc13054: 38 60 00 00 li r3,0 <== NOT EXECUTED ffc13058: 48 00 00 08 b ffc13060 <== NOT EXECUTED 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; ffc1305c: 38 60 ff ff li r3,-1 <== 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; } ffc13060: 39 61 00 40 addi r11,r1,64 ffc13064: 4b fe e5 74 b ffc015d8 <_restgpr_22_x> =============================================================================== ffc13808 : int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { ffc13808: 94 21 ff d8 stwu r1,-40(r1) ffc1380c: 7c 08 02 a6 mflr r0 ffc13810: 90 01 00 2c stw r0,44(r1) int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; ffc13814: 81 24 00 1c lwz r9,28(r4) int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { ffc13818: bf a1 00 1c stmw r29,28(r1) ffc1381c: 7c 7e 1b 78 mr r30,r3 ffc13820: 7c 9f 23 78 mr r31,r4 int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; ffc13824: 91 21 00 08 stw r9,8(r1) uint32_t save_cln = 0; /* Have we requested root dir size for FAT12/16? */ if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && ffc13828: 81 24 00 20 lwz r9,32(r4) ffc1382c: 2f 89 00 01 cmpwi cr7,r9,1 ffc13830: 40 be 00 28 bne+ cr7,ffc13858 ffc13834: 81 24 00 24 lwz r9,36(r4) ffc13838: 2f 89 00 00 cmpwi cr7,r9,0 ffc1383c: 40 9e 00 1c bne- cr7,ffc13858 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) ffc13840: 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)) && ffc13844: 71 2a 00 03 andi. r10,r9,3 ffc13848: 41 a2 00 10 beq+ ffc13858 <== ALWAYS TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { fat_fd->fat_file_size = fs_info->vol.rdir_size; ffc1384c: 81 23 00 2c lwz r9,44(r3) <== NOT EXECUTED ffc13850: 91 24 00 18 stw r9,24(r4) <== NOT EXECUTED ffc13854: 48 00 00 58 b ffc138ac <== NOT EXECUTED return rc; } fat_fd->fat_file_size = 0; ffc13858: 39 20 00 00 li r9,0 ffc1385c: 91 3f 00 18 stw r9,24(r31) while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) ffc13860: 48 00 00 30 b ffc13890 { save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ffc13864: 7f c3 f3 78 mr r3,r30 ffc13868: 7f a4 eb 78 mr r4,r29 ffc1386c: 38 a1 00 08 addi r5,r1,8 ffc13870: 48 00 5f 35 bl ffc197a4 if ( rc != RC_OK ) ffc13874: 2c 03 00 00 cmpwi r3,0 ffc13878: 40 82 00 38 bne- ffc138b0 <== NEVER TAKEN return rc; fat_fd->fat_file_size += fs_info->vol.bpc; ffc1387c: a1 5e 00 06 lhz r10,6(r30) ffc13880: 81 3f 00 18 lwz r9,24(r31) ffc13884: 7d 29 52 14 add r9,r9,r10 ffc13888: 91 3f 00 18 stw r9,24(r31) fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { save_cln = cur_cln; ffc1388c: 7f a9 eb 78 mr r9,r29 return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) ffc13890: 81 5e 00 10 lwz r10,16(r30) ffc13894: 83 a1 00 08 lwz r29,8(r1) ffc13898: 7f a8 50 38 and r8,r29,r10 ffc1389c: 81 5e 00 14 lwz r10,20(r30) ffc138a0: 7f 88 50 40 cmplw cr7,r8,r10 ffc138a4: 41 9c ff c0 blt+ cr7,ffc13864 if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; } fat_fd->map.last_cln = save_cln; ffc138a8: 91 3f 00 3c stw r9,60(r31) ffc138ac: 38 60 00 00 li r3,0 return rc; } ffc138b0: 39 61 00 28 addi r11,r1,40 ffc138b4: 4b fe dd 40 b ffc015f4 <_restgpr_29_x> =============================================================================== ffc13068 : fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { ffc13068: 94 21 ff d8 stwu r1,-40(r1) ffc1306c: 7c 08 02 a6 mflr r0 int rc = RC_OK; uint32_t cur_cln = 0; ffc13070: 39 20 00 00 li r9,0 fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { ffc13074: 90 01 00 2c stw r0,44(r1) int rc = RC_OK; uint32_t cur_cln = 0; ffc13078: 91 21 00 0c stw r9,12(r1) uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; ffc1307c: 39 20 ff ff li r9,-1 ffc13080: 91 21 00 08 stw r9,8(r1) if ( new_length >= fat_fd->fat_file_size ) ffc13084: 81 24 00 18 lwz r9,24(r4) fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { ffc13088: bf a1 00 1c stmw r29,28(r1) ffc1308c: 7c 9e 23 78 mr r30,r4 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 ) ffc13090: 7f 85 48 40 cmplw cr7,r5,r9 ffc13094: 41 bc 00 0c blt+ cr7,ffc130a0 return rc; ffc13098: 38 60 00 00 li r3,0 ffc1309c: 48 00 00 d8 b ffc13174 assert(fat_fd->fat_file_size); ffc130a0: 2f 89 00 00 cmpwi cr7,r9,0 ffc130a4: 40 be 00 24 bne+ cr7,ffc130c8 <== ALWAYS TAKEN ffc130a8: 3c 60 ff c3 lis r3,-61 <== NOT EXECUTED ffc130ac: 3c a0 ff c3 lis r5,-61 <== NOT EXECUTED ffc130b0: 3c c0 ff c3 lis r6,-61 <== NOT EXECUTED ffc130b4: 38 63 b9 de addi r3,r3,-17954 <== NOT EXECUTED ffc130b8: 38 80 02 d1 li r4,721 <== NOT EXECUTED ffc130bc: 38 a5 b9 cc addi r5,r5,-17972 <== NOT EXECUTED ffc130c0: 38 c6 ba 26 addi r6,r6,-17882 <== NOT EXECUTED ffc130c4: 4b ff 2a 59 bl ffc05b1c <__assert_func> <== NOT EXECUTED cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; ffc130c8: a3 e3 00 06 lhz r31,6(r3) ffc130cc: 7c 7d 1b 78 mr r29,r3 ffc130d0: 89 43 00 08 lbz r10,8(r3) ffc130d4: 3b ff ff ff addi r31,r31,-1 ffc130d8: 7f ff 2a 14 add r31,r31,r5 ffc130dc: 7f ff 54 30 srw r31,r31,r10 if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) ffc130e0: 7f ea 50 30 slw r10,r31,r10 ffc130e4: 7f 8a 48 40 cmplw cr7,r10,r9 ffc130e8: 40 bc ff b0 bge- cr7,ffc13098 return RC_OK; if (cl_start != 0) ffc130ec: 2f 9f 00 00 cmpwi cr7,r31,0 ffc130f0: 40 9e 00 24 bne- cr7,ffc13114 if (rc != RC_OK) return rc; } rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); ffc130f4: 7f a3 eb 78 mr r3,r29 ffc130f8: 7f c4 f3 78 mr r4,r30 ffc130fc: 7f e5 fb 78 mr r5,r31 ffc13100: 38 c1 00 0c addi r6,r1,12 ffc13104: 4b ff fb 51 bl ffc12c54 if (rc != RC_OK) ffc13108: 7c 83 23 79 mr. r3,r4 ffc1310c: 40 a2 00 68 bne+ ffc13174 <== NEVER TAKEN ffc13110: 48 00 00 1c b ffc1312c if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) return RC_OK; if (cl_start != 0) { rc = fat_file_lseek(fs_info, fat_fd, cl_start - 1, &new_last_cln); ffc13114: 38 bf ff ff addi r5,r31,-1 ffc13118: 38 c1 00 08 addi r6,r1,8 ffc1311c: 4b ff fb 39 bl ffc12c54 if (rc != RC_OK) ffc13120: 7c 83 23 79 mr. r3,r4 ffc13124: 41 82 ff d0 beq+ ffc130f4 <== ALWAYS TAKEN ffc13128: 48 00 00 4c b ffc13174 <== NOT EXECUTED rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; rc = fat_free_fat_clusters_chain(fs_info, cur_cln); ffc1312c: 80 81 00 0c lwz r4,12(r1) ffc13130: 7f a3 eb 78 mr r3,r29 ffc13134: 48 00 6a cd bl ffc19c00 if (rc != RC_OK) ffc13138: 2c 03 00 00 cmpwi r3,0 ffc1313c: 40 82 00 38 bne- ffc13174 <== NEVER TAKEN return rc; if (cl_start != 0) ffc13140: 2f 9f 00 00 cmpwi cr7,r31,0 ffc13144: 41 9e ff 54 beq+ cr7,ffc13098 { rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC); ffc13148: 80 81 00 08 lwz r4,8(r1) ffc1314c: 7f a3 eb 78 mr r3,r29 ffc13150: 38 a0 ff ff li r5,-1 ffc13154: 48 00 68 11 bl ffc19964 if ( rc != RC_OK ) ffc13158: 2c 03 00 00 cmpwi r3,0 ffc1315c: 40 82 00 18 bne- ffc13174 <== NEVER TAKEN return rc; fat_fd->map.file_cln = cl_start - 1; fat_fd->map.disk_cln = new_last_cln; ffc13160: 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; ffc13164: 3b ff ff ff addi r31,r31,-1 ffc13168: 93 fe 00 34 stw r31,52(r30) fat_fd->map.disk_cln = new_last_cln; ffc1316c: 91 3e 00 38 stw r9,56(r30) fat_fd->map.last_cln = new_last_cln; ffc13170: 91 3e 00 3c stw r9,60(r30) } return RC_OK; } ffc13174: 39 61 00 28 addi r11,r1,40 ffc13178: 4b fe e4 7c b ffc015f4 <_restgpr_29_x> =============================================================================== ffc13560 : 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 ) ffc13560: 2c 06 00 00 cmpwi r6,0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { ffc13564: 94 21 ff b0 stwu r1,-80(r1) ffc13568: 7c 08 02 a6 mflr r0 int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; ffc1356c: 39 20 00 00 li r9,0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { ffc13570: be 61 00 1c stmw r19,28(r1) ffc13574: 7c bc 2b 78 mr r28,r5 ffc13578: 7c 9e 23 78 mr r30,r4 ffc1357c: 90 01 00 54 stw r0,84(r1) int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; ffc13580: 91 21 00 0c stw r9,12(r1) bool zero_fill = start > fat_fd->fat_file_size; ffc13584: 80 a4 00 18 lwz r5,24(r4) uint32_t file_cln_initial = fat_fd->map.file_cln; ffc13588: 82 84 00 34 lwz r20,52(r4) uint32_t cln; if ( count == 0 ) ffc1358c: 41 82 01 f4 beq- ffc13780 <== NEVER TAKEN return cmpltd; if (start >= fat_fd->size_limit) ffc13590: 83 e4 00 14 lwz r31,20(r4) ffc13594: 7f 9c f8 40 cmplw cr7,r28,r31 ffc13598: 41 bc 00 18 blt+ cr7,ffc135b0 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EFBIG); ffc1359c: 48 00 7d d9 bl ffc1b374 <__errno> <== NOT EXECUTED ffc135a0: 39 20 00 1b li r9,27 <== NOT EXECUTED ffc135a4: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc135a8: 39 20 ff ff li r9,-1 <== NOT EXECUTED ffc135ac: 48 00 01 f8 b ffc137a4 <== NOT EXECUTED if (count > fat_fd->size_limit - start) ffc135b0: 7f fc f8 50 subf r31,r28,r31 ffc135b4: 7f 9f 30 40 cmplw cr7,r31,r6 ffc135b8: 7c 7d 1b 78 mr r29,r3 ffc135bc: 7c f5 3b 78 mr r21,r7 ffc135c0: 40 9d 00 08 ble- cr7,ffc135c8 <== NEVER TAKEN ffc135c4: 7c df 33 78 mr r31,r6 count = fat_fd->size_limit - start; rc = fat_file_extend(fs_info, fat_fd, zero_fill, start + count, &c); ffc135c8: 7f 7f e2 14 add r27,r31,r28 ffc135cc: 7c bc 28 10 subfc r5,r28,r5 ffc135d0: 7c a5 29 10 subfe r5,r5,r5 ffc135d4: 7f a3 eb 78 mr r3,r29 ffc135d8: 7f c4 f3 78 mr r4,r30 ffc135dc: 7c a5 00 d0 neg r5,r5 ffc135e0: 7f 66 db 78 mr r6,r27 ffc135e4: 38 e1 00 0c addi r7,r1,12 ffc135e8: 4b ff fd 2d bl ffc13314 if (RC_OK == rc) ffc135ec: 7c 69 1b 79 mr. r9,r3 ffc135f0: 40 82 01 b4 bne- ffc137a4 { /* * check whether there was enough room on device to locate * file of 'start + count' bytes */ if (c != (start + count)) ffc135f4: 81 21 00 0c lwz r9,12(r1) ffc135f8: 7f 89 d8 00 cmpw cr7,r9,r27 ffc135fc: 41 9e 00 08 beq- cr7,ffc13604 <== ALWAYS TAKEN count = c - start; ffc13600: 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)); ffc13604: 81 5e 00 20 lwz r10,32(r30) ffc13608: 39 20 00 00 li r9,0 */ 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)) ffc1360c: 89 1d 00 0e lbz r8,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)); ffc13610: 2f 8a 00 01 cmpwi cr7,r10,1 ffc13614: 40 be 00 1c bne+ cr7,ffc13630 ffc13618: 81 5e 00 24 lwz r10,36(r30) ffc1361c: 2f 8a 00 00 cmpwi cr7,r10,0 ffc13620: 40 9e 00 10 bne- cr7,ffc13630 <== NEVER TAKEN ffc13624: 55 09 07 be clrlwi r9,r8,30 ffc13628: 7d 29 00 d0 neg r9,r9 ffc1362c: 55 29 0f fe rlwinm r9,r9,1,31,31 */ 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)) ffc13630: 2f 89 00 00 cmpwi cr7,r9,0 ffc13634: 8b 5d 00 08 lbz r26,8(r29) ffc13638: 41 9e 00 48 beq- cr7,ffc13680 { cln = fat_fd->cln; cln += (start >> fs_info->vol.bpc_log2); byte = start & (fs_info->vol.bpc -1); ffc1363c: a0 bd 00 06 lhz r5,6(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); ffc13640: 57 5a 06 3e clrlwi r26,r26,24 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; ffc13644: 81 3e 00 1c lwz r9,28(r30) cln += (start >> fs_info->vol.bpc_log2); ffc13648: 7f 84 d4 30 srw r4,r28,r26 byte = start & (fs_info->vol.bpc -1); ffc1364c: 38 a5 ff ff addi r5,r5,-1 ret = fat_cluster_write(fs_info, ffc13650: 7c 84 4a 14 add r4,r4,r9 ffc13654: 7f a3 eb 78 mr r3,r29 ffc13658: 7f 85 28 38 and r5,r28,r5 ffc1365c: 7f e6 fb 78 mr r6,r31 ffc13660: 7e a7 ab 78 mr r7,r21 ffc13664: 39 00 00 00 li r8,0 ffc13668: 48 00 07 9d bl ffc13e04 byte, count, buf, false); if (0 > ret) rc = -1; ffc1366c: 39 20 ff ff li r9,-1 cln, byte, count, buf, false); if (0 > ret) ffc13670: 2c 03 00 00 cmpwi r3,0 ffc13674: 41 80 01 30 blt- ffc137a4 <== NEVER TAKEN rc = -1; else cmpltd = ret; ffc13678: 7c 7b 1b 78 mr r27,r3 ffc1367c: 48 00 01 24 b ffc137a0 const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; ffc13680: 7c 39 0b 78 mr r25,r1 ffc13684: 95 39 00 08 stwu r9,8(r25) uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; ffc13688: 57 5a 06 3e clrlwi r26,r26,24 ffc1368c: 7f 98 d4 30 srw r24,r28,r26 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); ffc13690: 7f a3 eb 78 mr r3,r29 ffc13694: 7f c4 f3 78 mr r4,r30 ffc13698: 7f 05 c3 78 mr r5,r24 ffc1369c: 7f 26 cb 78 mr r6,r25 ffc136a0: 4b ff f5 b5 bl ffc12c54 if (RC_OK == rc) ffc136a4: 7c 9b 23 79 mr. r27,r4 ffc136a8: 40 82 00 c8 bne- ffc13770 <== NEVER TAKEN 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); ffc136ac: 7f 1a d0 30 slw r26,r24,r26 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; ffc136b0: 81 3e 00 1c lwz r9,28(r30) ffc136b4: 82 e1 00 08 lwz r23,8(r1) 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); ffc136b8: 7f 9a e0 50 subf r28,r26,r28 ffc136bc: 7f 85 e3 78 mr r5,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; ffc136c0: 7e e9 b8 50 subf r23,r9,r23 uint32_t ofs_cln_save = ofs_cln; uint32_t bytes_to_write = count; uint32_t file_cln_cnt; ssize_t ret; uint32_t c; bool overwrite_cluster = false; ffc136c4: 3a 60 00 00 li r19,0 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 */ ffc136c8: 3a c0 00 00 li r22,0 const uint32_t count, const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; ffc136cc: 3b 40 00 00 li r26,0 ffc136d0: 48 00 00 60 b ffc13730 { 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)); ffc136d4: a0 dd 00 06 lhz r6,6(r29) ffc136d8: 7c c5 30 50 subf r6,r5,r6 ffc136dc: 7f 86 f8 40 cmplw cr7,r6,r31 ffc136e0: 40 9d 00 08 ble- cr7,ffc136e8 ffc136e4: 7f e6 fb 78 mr r6,r31 if (file_cln_initial < file_cln_cnt) ffc136e8: 7f 94 b8 40 cmplw cr7,r20,r23 ffc136ec: 40 9c 00 08 bge- cr7,ffc136f4 overwrite_cluster = true; ffc136f0: 3a 60 00 01 li r19,1 ret = fat_cluster_write(fs_info, ffc136f4: 80 81 00 08 lwz r4,8(r1) ffc136f8: 7f a3 eb 78 mr r3,r29 ffc136fc: 7c f5 d2 14 add r7,r21,r26 ffc13700: 7e 68 9b 78 mr r8,r19 ffc13704: 48 00 07 01 bl ffc13e04 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) ffc13708: 2c 03 00 00 cmpwi r3,0 ffc1370c: 40 a0 00 7c bge+ ffc13788 <== ALWAYS TAKEN ffc13710: 48 00 00 2c b ffc1373c <== 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); ffc13714: 7f a3 eb 78 mr r3,r29 ffc13718: 7e c4 b3 78 mr r4,r22 ffc1371c: 7f 25 cb 78 mr r5,r25 ffc13720: 48 00 60 85 bl ffc197a4 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) ffc13724: 2c 03 00 00 cmpwi r3,0 ffc13728: 40 82 00 1c bne- ffc13744 <== NEVER TAKEN ffc1372c: 38 a0 00 00 li r5,0 && (bytes_to_write > 0)) ffc13730: 2f 9f 00 00 cmpwi cr7,r31,0 ffc13734: 40 9e ff a0 bne+ cr7,ffc136d4 ffc13738: 48 00 00 10 b ffc13748 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) ffc1373c: 3b 60 ff ff li r27,-1 <== NOT EXECUTED ffc13740: 48 00 00 08 b ffc13748 <== NOT EXECUTED 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) ffc13744: 7c 7b 1b 78 mr r27,r3 <== NOT EXECUTED fat_fd->map.file_cln = start_cln + ((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; } if (RC_OK != rc) ffc13748: 2f 9b 00 00 cmpwi cr7,r27,0 } /* 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); ffc1374c: 89 3d 00 08 lbz r9,8(r29) ffc13750: 3b 9c ff ff addi r28,r28,-1 fat_fd->map.disk_cln = save_cln; ffc13754: 92 de 00 38 stw r22,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); ffc13758: 7f 9c d2 14 add r28,r28,r26 ffc1375c: 7f 9c 4c 30 srw r28,r28,r9 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + ffc13760: 7f 1c c2 14 add r24,r28,r24 ffc13764: 93 1e 00 34 stw r24,52(r30) ((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; } if (RC_OK != rc) ffc13768: 40 9e 00 08 bne- cr7,ffc13770 <== NEVER TAKEN return rc; else return cmpltd; ffc1376c: 7f 5b d3 78 mr r27,r26 fat_fd, start, count, buf, file_cln_initial); if (0 > ret) ffc13770: 2f 9b 00 00 cmpwi cr7,r27,0 rc = -1; ffc13774: 39 20 ff ff li r9,-1 fat_fd, start, count, buf, file_cln_initial); if (0 > ret) ffc13778: 41 9c 00 2c blt- cr7,ffc137a4 <== NEVER TAKEN ffc1377c: 48 00 00 24 b ffc137a0 uint32_t file_cln_initial = fat_fd->map.file_cln; uint32_t cln; if ( count == 0 ) return cmpltd; ffc13780: 39 20 00 00 li r9,0 <== NOT EXECUTED ffc13784: 48 00 00 20 b ffc137a4 <== NOT EXECUTED { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; if (0 < bytes_to_write) ffc13788: 7f e3 f8 51 subf. r31,r3,r31 if (RC_OK == rc) { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; ffc1378c: 82 c1 00 08 lwz r22,8(r1) if (0 > ret) rc = -1; if (RC_OK == rc) { ++file_cln_cnt; ffc13790: 3a f7 00 01 addi r23,r23,1 bytes_to_write -= ret; cmpltd += ret; ffc13794: 7f 5a 1a 14 add r26,r26,r3 save_cln = cur_cln; if (0 < bytes_to_write) ffc13798: 41 82 ff 94 beq+ ffc1372c ffc1379c: 4b ff ff 78 b ffc13714 } } if (RC_OK != rc) return rc; else return cmpltd; ffc137a0: 7f 69 db 78 mr r9,r27 } ffc137a4: 39 61 00 50 addi r11,r1,80 ffc137a8: 7d 23 4b 78 mr r3,r9 ffc137ac: 4b fe de 20 b ffc015cc <_restgpr_19_x> =============================================================================== ffc19c00 : int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { ffc19c00: 94 21 ff c8 stwu r1,-56(r1) ffc19c04: 7c 08 02 a6 mflr r0 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; ffc19c08: 39 20 00 00 li r9,0 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { ffc19c0c: bf 21 00 1c stmw r25,28(r1) int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; ffc19c10: 7c 3c 0b 78 mr r28,r1 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { ffc19c14: 7c 7f 1b 78 mr r31,r3 ffc19c18: 90 01 00 3c stw r0,60(r1) ffc19c1c: 7c 9a 23 78 mr r26,r4 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; ffc19c20: 7c 9d 23 78 mr r29,r4 uint32_t next_cln = 0; ffc19c24: 95 3c 00 08 stwu r9,8(r28) uint32_t freed_cls_cnt = 0; ffc19c28: 3b c0 00 00 li r30,0 fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { int rc = RC_OK, rc1 = RC_OK; ffc19c2c: 3b 60 00 00 li r27,0 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) ffc19c30: 48 00 00 60 b ffc19c90 { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); ffc19c34: 7f e3 fb 78 mr r3,r31 ffc19c38: 7f a4 eb 78 mr r4,r29 ffc19c3c: 7f 85 e3 78 mr r5,r28 ffc19c40: 4b ff fb 65 bl ffc197a4 if ( rc != RC_OK ) ffc19c44: 7c 79 1b 79 mr. r25,r3 ffc19c48: 41 a2 00 24 beq+ ffc19c6c <== ALWAYS TAKEN { if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) ffc19c4c: 81 3f 00 44 lwz r9,68(r31) <== NOT EXECUTED ffc19c50: 2f 89 ff ff cmpwi cr7,r9,-1 <== NOT EXECUTED ffc19c54: 41 9e 00 0c beq- cr7,ffc19c60 <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; ffc19c58: 7f de 4a 14 add r30,r30,r9 <== NOT EXECUTED ffc19c5c: 93 df 00 44 stw r30,68(r31) <== NOT EXECUTED fat_buf_release(fs_info); ffc19c60: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc19c64: 4b ff 9c ad bl ffc13910 <== NOT EXECUTED ffc19c68: 48 00 00 60 b ffc19cc8 <== NOT EXECUTED return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); ffc19c6c: 7f e3 fb 78 mr r3,r31 ffc19c70: 7f a4 eb 78 mr r4,r29 ffc19c74: 38 a0 00 00 li r5,0 ffc19c78: 4b ff fc ed bl ffc19964 if ( rc != RC_OK ) ffc19c7c: 2c 03 00 00 cmpwi r3,0 ffc19c80: 41 82 00 08 beq- ffc19c88 <== ALWAYS TAKEN ffc19c84: 7c 7b 1b 78 mr r27,r3 <== NOT EXECUTED rc1 = rc; freed_cls_cnt++; cur_cln = next_cln; ffc19c88: 83 a1 00 08 lwz r29,8(r1) rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); if ( rc != RC_OK ) rc1 = rc; freed_cls_cnt++; ffc19c8c: 3b de 00 01 addi r30,r30,1 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) ffc19c90: 81 3f 00 10 lwz r9,16(r31) ffc19c94: 7f aa 48 38 and r10,r29,r9 ffc19c98: 81 3f 00 14 lwz r9,20(r31) ffc19c9c: 7f 8a 48 40 cmplw cr7,r10,r9 ffc19ca0: 41 9c ff 94 blt+ cr7,ffc19c34 freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) ffc19ca4: 81 3f 00 44 lwz r9,68(r31) freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; ffc19ca8: 93 5f 00 4c stw r26,76(r31) if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) ffc19cac: 2f 89 ff ff cmpwi cr7,r9,-1 ffc19cb0: 41 9e 00 0c beq- cr7,ffc19cbc <== ALWAYS TAKEN fs_info->vol.free_cls += freed_cls_cnt; ffc19cb4: 7f de 4a 14 add r30,r30,r9 <== NOT EXECUTED ffc19cb8: 93 df 00 44 stw r30,68(r31) <== NOT EXECUTED fat_buf_release(fs_info); ffc19cbc: 7f e3 fb 78 mr r3,r31 ffc19cc0: 4b ff 9c 51 bl ffc13910 ffc19cc4: 7f 79 db 78 mr r25,r27 if (rc1 != RC_OK) return rc1; return RC_OK; } ffc19cc8: 39 61 00 38 addi r11,r1,56 ffc19ccc: 7f 23 cb 78 mr r3,r25 ffc19cd0: 4b fe 79 14 b ffc015e4 <_restgpr_25_x> =============================================================================== ffc14994 : 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); ffc14994: 81 23 00 80 lwz r9,128(r3) <== NOT EXECUTED ffc14998: 39 00 ff fe li r8,-2 <== NOT EXECUTED ffc1499c: 81 43 00 74 lwz r10,116(r3) <== NOT EXECUTED ffc149a0: 7c 89 20 50 subf r4,r9,r4 <== NOT EXECUTED ffc149a4: 54 89 e8 fe rlwinm r9,r4,29,3,31 <== NOT EXECUTED ffc149a8: 54 84 07 7e clrlwi r4,r4,29 <== NOT EXECUTED ffc149ac: 5d 04 20 3e rotlw r4,r8,r4 <== NOT EXECUTED ffc149b0: 7d 0a 48 ae lbzx r8,r10,r9 <== NOT EXECUTED ffc149b4: 7c 88 40 38 and r8,r4,r8 <== NOT EXECUTED ffc149b8: 7d 0a 49 ae stbx r8,r10,r9 <== NOT EXECUTED ffc149bc: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc197a4 : uint8_t *sec_buf; uint32_t sec = 0; uint32_t ofs = 0; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) ffc197a4: 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 ) { ffc197a8: 94 21 ff c8 stwu r1,-56(r1) ffc197ac: 7c 08 02 a6 mflr r0 ffc197b0: bf 21 00 1c stmw r25,28(r1) ffc197b4: 7c 9f 23 78 mr r31,r4 ffc197b8: 90 01 00 3c stw r0,60(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)) ) ffc197bc: 40 9d 01 84 ble- cr7,ffc19940 <== NEVER TAKEN ffc197c0: 81 23 00 38 lwz r9,56(r3) ffc197c4: 7c 7d 1b 78 mr r29,r3 ffc197c8: 39 29 00 01 addi r9,r9,1 ffc197cc: 7f 84 48 40 cmplw cr7,r4,r9 ffc197d0: 40 bd 00 08 ble+ cr7,ffc197d8 <== ALWAYS TAKEN ffc197d4: 48 00 01 6c b ffc19940 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + ffc197d8: 89 23 00 0e lbz r9,14(r3) ffc197dc: 7c be 2b 78 mr r30,r5 ffc197e0: 71 27 00 01 andi. r7,r9,1 ffc197e4: 41 82 00 10 beq- ffc197f4 ffc197e8: 54 8a f8 7e rlwinm r10,r4,31,1,31 ffc197ec: 7d 4a 22 14 add r10,r10,r4 ffc197f0: 48 00 00 18 b ffc19808 ffc197f4: 55 28 07 bc rlwinm r8,r9,0,30,30 ffc197f8: 71 06 00 ff andi. r6,r8,255 ffc197fc: 54 8a 10 3a rlwinm r10,r4,2,0,29 ffc19800: 41 82 00 08 beq- ffc19808 ffc19804: 54 8a 08 3c rlwinm r10,r4,1,0,30 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); ffc19808: 2f 87 00 00 cmpwi cr7,r7,0 /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + ffc1980c: 8b 5d 00 02 lbz r26,2(r29) ffc19810: 81 1d 00 58 lwz r8,88(r29) ffc19814: 7d 4a d4 30 srw r10,r10,r26 ffc19818: 7f 4a 42 14 add r26,r10,r8 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); ffc1981c: 41 9e 00 10 beq- cr7,ffc1982c ffc19820: 57 fb f8 7e rlwinm r27,r31,31,1,31 ffc19824: 7f 7b fa 14 add r27,r27,r31 ffc19828: 48 00 00 18 b ffc19840 ffc1982c: 55 29 07 bc rlwinm r9,r9,0,30,30 ffc19830: 71 2a 00 ff andi. r10,r9,255 ffc19834: 57 fb 10 3a rlwinm r27,r31,2,0,29 ffc19838: 41 82 00 08 beq- ffc19840 ffc1983c: 57 fb 08 3c rlwinm r27,r31,1,0,30 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); ffc19840: 7f a3 eb 78 mr r3,r29 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); ffc19844: a3 3d 00 00 lhz r25,0(r29) rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); ffc19848: 7f 44 d3 78 mr r4,r26 ffc1984c: 38 a0 00 01 li r5,1 ffc19850: 38 c1 00 08 addi r6,r1,8 ffc19854: 4b ff a2 7d bl ffc13ad0 if (rc != RC_OK) ffc19858: 7c 7c 1b 79 mr. r28,r3 ffc1985c: 40 82 00 fc bne- ffc19958 <== NEVER TAKEN return rc; switch ( fs_info->vol.type ) ffc19860: 89 5d 00 0e lbz r10,14(r29) 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); ffc19864: 39 39 ff ff addi r9,r25,-1 ffc19868: 7f 69 48 38 and r9,r27,r9 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) ffc1986c: 2f 8a 00 02 cmpwi cr7,r10,2 ffc19870: 41 9e 00 98 beq- cr7,ffc19908 ffc19874: 2f 8a 00 04 cmpwi cr7,r10,4 ffc19878: 41 9e 00 a8 beq- cr7,ffc19920 ffc1987c: 2f 8a 00 01 cmpwi cr7,r10,1 ffc19880: 40 be 00 c0 bne+ cr7,ffc19940 <== NEVER TAKEN /* * 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) ) ffc19884: a0 fd 00 00 lhz r7,0(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)); ffc19888: 81 01 00 08 lwz r8,8(r1) if ( ofs == (fs_info->vol.bps - 1) ) ffc1988c: 38 e7 ff ff addi r7,r7,-1 ffc19890: 7f 89 38 00 cmpw cr7,r9,r7 case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); ffc19894: 7d 48 48 ae lbzx r10,r8,r9 ffc19898: 91 5e 00 00 stw r10,0(r30) if ( ofs == (fs_info->vol.bps - 1) ) ffc1989c: 40 be 00 3c bne+ cr7,ffc198d8 <== ALWAYS TAKEN { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, ffc198a0: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED ffc198a4: 38 9a 00 01 addi r4,r26,1 <== NOT EXECUTED ffc198a8: 38 a0 00 01 li r5,1 <== NOT EXECUTED ffc198ac: 38 c1 00 08 addi r6,r1,8 <== NOT EXECUTED ffc198b0: 4b ff a2 21 bl ffc13ad0 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) ffc198b4: 2c 03 00 00 cmpwi r3,0 <== NOT EXECUTED ffc198b8: 40 82 00 9c bne- ffc19954 <== NOT EXECUTED return rc; *ret_val |= *sec_buf << 8; ffc198bc: 81 21 00 08 lwz r9,8(r1) <== NOT EXECUTED ffc198c0: 89 49 00 00 lbz r10,0(r9) <== NOT EXECUTED ffc198c4: 81 3e 00 00 lwz r9,0(r30) <== NOT EXECUTED ffc198c8: 55 4a 40 2e rlwinm r10,r10,8,0,23 <== NOT EXECUTED ffc198cc: 7d 29 53 78 or r9,r9,r10 <== NOT EXECUTED ffc198d0: 91 3e 00 00 stw r9,0(r30) <== NOT EXECUTED ffc198d4: 48 00 00 18 b ffc198ec <== NOT EXECUTED } else { *ret_val |= *(sec_buf + ofs + 1) << 8; ffc198d8: 7d 28 4a 14 add r9,r8,r9 ffc198dc: 89 29 00 01 lbz r9,1(r9) ffc198e0: 55 29 40 2e rlwinm r9,r9,8,0,23 ffc198e4: 7d 2a 53 78 or r10,r9,r10 ffc198e8: 91 5e 00 00 stw r10,0(r30) } if ( FAT_CLUSTER_IS_ODD(cln) ) ffc198ec: 73 e6 00 01 andi. r6,r31,1 ffc198f0: 81 3e 00 00 lwz r9,0(r30) ffc198f4: 41 82 00 0c beq- ffc19900 *ret_val = (*ret_val) >> FAT12_SHIFT; ffc198f8: 55 29 e1 3e rlwinm r9,r9,28,4,31 ffc198fc: 48 00 00 3c b ffc19938 else *ret_val = (*ret_val) & FAT_FAT12_MASK; ffc19900: 55 29 05 3e clrlwi r9,r9,20 ffc19904: 48 00 00 34 b ffc19938 break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); ffc19908: 81 41 00 08 lwz r10,8(r1) ffc1990c: 7d 2a 4a 2e lhzx r9,r10,r9 *ret_val = CF_LE_W(*ret_val); ffc19910: 55 2a c2 3e rlwinm r10,r9,24,8,31 ffc19914: 55 29 44 2e rlwinm r9,r9,8,16,23 ffc19918: 7d 49 4b 78 or r9,r10,r9 ffc1991c: 48 00 00 1c b ffc19938 break; case FAT_FAT32: *ret_val = *((uint32_t *)(sec_buf + ofs)); ffc19920: 81 41 00 08 lwz r10,8(r1) ffc19924: 7d 4a 48 2e lwzx r10,r10,r9 ffc19928: 51 49 46 3e rlwimi r9,r10,8,24,31 ffc1992c: 51 49 c4 2e rlwimi r9,r10,24,16,23 ffc19930: 51 49 42 1e rlwimi r9,r10,8,8,15 ffc19934: 51 49 c0 0e rlwimi r9,r10,24,0,7 *ret_val = CF_LE_L(*ret_val); ffc19938: 91 3e 00 00 stw r9,0(r30) break; ffc1993c: 48 00 00 1c b ffc19958 default: rtems_set_errno_and_return_minus_one(EIO); ffc19940: 48 00 1a 35 bl ffc1b374 <__errno> <== NOT EXECUTED ffc19944: 39 20 00 05 li r9,5 <== NOT EXECUTED ffc19948: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc1994c: 3b 80 ff ff li r28,-1 <== NOT EXECUTED ffc19950: 48 00 00 08 b ffc19958 <== 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) ffc19954: 7c 7c 1b 78 mr r28,r3 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } ffc19958: 39 61 00 38 addi r11,r1,56 ffc1995c: 7f 83 e3 78 mr r3,r28 ffc19960: 4b fe 7c 84 b ffc015e4 <_restgpr_25_x> =============================================================================== ffc148b4 : * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { ffc148b4: 94 21 ff e8 stwu r1,-24(r1) <== NOT EXECUTED ffc148b8: 7c 08 02 a6 mflr r0 <== NOT EXECUTED ffc148bc: bf a1 00 0c stmw 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)) ffc148c0: 3f a0 0f ff lis r29,4095 <== NOT EXECUTED * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { ffc148c4: 7c 7f 1b 78 mr r31,r3 <== NOT EXECUTED ffc148c8: 90 01 00 1c stw r0,28(r1) <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) ffc148cc: 3b c0 00 00 li r30,0 <== 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)) ffc148d0: 63 bd ff ff ori r29,r29,65535 <== NOT EXECUTED fat_get_unique_ino(fat_fs_info_t *fs_info) { uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) ffc148d4: 48 00 00 a4 b ffc14978 <== NOT EXECUTED { for (j = 0; j < fs_info->uino_pool_size; j++) { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) ffc148d8: 81 3f 00 78 lwz r9,120(r31) <== NOT EXECUTED ffc148dc: 81 5f 00 74 lwz r10,116(r31) <== NOT EXECUTED ffc148e0: 55 27 e8 fe rlwinm r7,r9,29,3,31 <== NOT EXECUTED ffc148e4: 7c ca 3a 14 add r6,r10,r7 <== NOT EXECUTED ffc148e8: 7d 4a 38 ae lbzx r10,r10,r7 <== NOT EXECUTED ffc148ec: 55 27 07 7e clrlwi r7,r9,29 <== NOT EXECUTED ffc148f0: 7d 45 3e 30 sraw r5,r10,r7 <== NOT EXECUTED ffc148f4: 70 a3 00 01 andi. r3,r5,1 <== NOT EXECUTED ffc148f8: 40 a2 00 24 bne+ ffc1491c <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); ffc148fc: 39 20 00 01 li r9,1 <== NOT EXECUTED ffc14900: 7d 27 38 30 slw r7,r9,r7 <== NOT EXECUTED ffc14904: 7c ea 53 78 or r10,r7,r10 <== NOT EXECUTED ffc14908: 99 46 00 00 stb r10,0(r6) <== NOT EXECUTED return (fs_info->uino_base + fs_info->index); ffc1490c: 80 7f 00 78 lwz r3,120(r31) <== NOT EXECUTED ffc14910: 81 3f 00 80 lwz r9,128(r31) <== NOT EXECUTED ffc14914: 7c 63 4a 14 add r3,r3,r9 <== NOT EXECUTED ffc14918: 48 00 00 74 b ffc1498c <== NOT EXECUTED } fs_info->index++; ffc1491c: 39 29 00 01 addi r9,r9,1 <== NOT EXECUTED if (fs_info->index >= fs_info->uino_pool_size) ffc14920: 7f 89 40 40 cmplw cr7,r9,r8 <== NOT EXECUTED ffc14924: 40 9c 00 0c bge- cr7,ffc14930 <== 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++; ffc14928: 91 3f 00 78 stw r9,120(r31) <== NOT EXECUTED ffc1492c: 48 00 00 08 b ffc14934 <== NOT EXECUTED if (fs_info->index >= fs_info->uino_pool_size) fs_info->index = 0; ffc14930: 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++) ffc14934: 38 84 00 01 addi r4,r4,1 <== NOT EXECUTED ffc14938: 42 00 ff a0 bdnz+ ffc148d8 <== 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)) ffc1493c: 81 3f 00 80 lwz r9,128(r31) <== NOT EXECUTED ffc14940: 54 84 08 3c rlwinm r4,r4,1,0,30 <== NOT EXECUTED ffc14944: 7d 29 e8 50 subf r9,r9,r29 <== NOT EXECUTED ffc14948: 7f 84 48 40 cmplw cr7,r4,r9 <== NOT EXECUTED ffc1494c: 41 9c 00 0c blt- cr7,ffc14958 <== NOT EXECUTED resrc_unsuff = true; } else resrc_unsuff = true; } return 0; ffc14950: 38 60 00 00 li r3,0 <== NOT EXECUTED ffc14954: 48 00 00 38 b ffc1498c <== NOT EXECUTED fs_info->index = 0; } if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base)) { fs_info->uino_pool_size <<= 1; ffc14958: 90 9f 00 7c stw r4,124(r31) <== NOT EXECUTED fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); ffc1495c: 80 7f 00 74 lwz r3,116(r31) <== NOT EXECUTED ffc14960: 4b ff 24 3d bl ffc06d9c <== NOT EXECUTED if (fs_info->uino != NULL) ffc14964: 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); ffc14968: 90 7f 00 74 stw r3,116(r31) <== NOT EXECUTED if (fs_info->uino != NULL) ffc1496c: 41 9e ff e4 beq+ cr7,ffc14950 <== NOT EXECUTED fs_info->index = fs_info->uino_pool_size; ffc14970: 81 3f 00 7c lwz r9,124(r31) <== NOT EXECUTED ffc14974: 91 3f 00 78 stw r9,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++) ffc14978: 81 1f 00 7c lwz r8,124(r31) <== NOT EXECUTED ffc1497c: 38 80 00 00 li r4,0 <== 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; ffc14980: 39 28 00 01 addi r9,r8,1 <== NOT EXECUTED ffc14984: 7d 29 03 a6 mtctr r9 <== NOT EXECUTED ffc14988: 4b ff ff b0 b ffc14938 <== NOT EXECUTED } else resrc_unsuff = true; } return 0; } ffc1498c: 39 61 00 18 addi r11,r1,24 <== NOT EXECUTED ffc14990: 4b fe cc 64 b ffc015f4 <_restgpr_29_x> <== NOT EXECUTED =============================================================================== ffc14830 : int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { ffc14830: 94 21 ff e0 stwu r1,-32(r1) ffc14834: 7c 08 02 a6 mflr r0 ffc14838: bf c1 00 18 stmw r30,24(r1) int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; ffc1483c: 7c 3e 0b 78 mr r30,r1 int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { ffc14840: 7c 7f 1b 78 mr r31,r3 ffc14844: 90 01 00 24 stw r0,36(r1) int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; ffc14848: 94 9e 00 08 stwu r4,8(r30) while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) ffc1484c: 48 00 00 3c b ffc14888 { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); ffc14850: a0 df 00 06 lhz r6,6(r31) ffc14854: 7f e3 fb 78 mr r3,r31 ffc14858: 38 a0 00 00 li r5,0 ffc1485c: 38 e0 00 00 li r7,0 ffc14860: 4b ff f4 89 bl ffc13ce8 if ( ret != fs_info->vol.bpc ) ffc14864: a1 3f 00 06 lhz r9,6(r31) ffc14868: 7f 83 48 00 cmpw cr7,r3,r9 ffc1486c: 40 9e 00 3c bne- cr7,ffc148a8 <== NEVER TAKEN { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ffc14870: 80 81 00 08 lwz r4,8(r1) ffc14874: 7f e3 fb 78 mr r3,r31 ffc14878: 7f c5 f3 78 mr r5,r30 ffc1487c: 48 00 4f 29 bl ffc197a4 if ( rc != RC_OK ) ffc14880: 2c 03 00 00 cmpwi r3,0 ffc14884: 40 82 00 28 bne- ffc148ac <== NEVER TAKEN { 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) ffc14888: 81 3f 00 10 lwz r9,16(r31) ffc1488c: 80 81 00 08 lwz r4,8(r1) ffc14890: 7c 8a 48 38 and r10,r4,r9 ffc14894: 81 3f 00 14 lwz r9,20(r31) ffc14898: 7f 8a 48 40 cmplw cr7,r10,r9 ffc1489c: 41 9c ff b4 blt+ cr7,ffc14850 return rc; } } return rc; ffc148a0: 38 60 00 00 li r3,0 ffc148a4: 48 00 00 08 b ffc148ac 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; ffc148a8: 38 60 ff ff li r3,-1 <== NOT EXECUTED } } return rc; } ffc148ac: 39 61 00 20 addi r11,r1,32 ffc148b0: 4b fe cd 48 b ffc015f8 <_restgpr_30_x> =============================================================================== ffc13f40 : * 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) { ffc13f40: 94 21 ff 28 stwu r1,-216(r1) ffc13f44: 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; ffc13f48: 39 20 00 00 li r9,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) { ffc13f4c: bd c1 00 90 stmw r14,144(r1) ffc13f50: 7c 7f 1b 78 mr r31,r3 ssize_t ret = 0; struct stat stat_buf; int i = 0; rtems_bdbuf_buffer *block = NULL; vol->fd = open(device, O_RDWR); ffc13f54: 7c 83 23 78 mr r3,r4 ffc13f58: 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) { ffc13f5c: 90 01 00 dc stw r0,220(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; ffc13f60: 91 21 00 5c stw r9,92(r1) vol->fd = open(device, O_RDWR); ffc13f64: 4c c6 31 82 crclr 4*cr1+eq ffc13f68: 4b ff 2b 8d bl ffc06af4 if (vol->fd < 0) ffc13f6c: 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); ffc13f70: 90 7f 00 60 stw r3,96(r31) if (vol->fd < 0) ffc13f74: 40 bc 00 08 bge+ cr7,ffc13f7c <== ALWAYS TAKEN ffc13f78: 48 00 00 1c b ffc13f94 <== NOT EXECUTED { rtems_set_errno_and_return_minus_one(ENXIO); } rc = fstat(vol->fd, &stat_buf); ffc13f7c: 38 81 00 08 addi r4,r1,8 ffc13f80: 4b ff 1e 2d bl ffc05dac if (rc != 0) ffc13f84: 2f 83 00 00 cmpwi cr7,r3,0 ffc13f88: 80 7f 00 60 lwz r3,96(r31) ffc13f8c: 41 be 00 14 beq+ cr7,ffc13fa0 <== ALWAYS TAKEN { close(vol->fd); ffc13f90: 4b ff 1c c5 bl ffc05c54 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); ffc13f94: 48 00 73 e1 bl ffc1b374 <__errno> <== NOT EXECUTED ffc13f98: 39 20 00 06 li r9,6 <== NOT EXECUTED ffc13f9c: 48 00 06 54 b ffc145f0 <== NOT EXECUTED } /* Must be a block device. */ if (!S_ISBLK(stat_buf.st_mode)) ffc13fa0: 81 21 00 14 lwz r9,20(r1) ffc13fa4: 55 29 04 26 rlwinm r9,r9,0,16,19 ffc13fa8: 2f 89 60 00 cmpwi cr7,r9,24576 ffc13fac: 41 be 00 08 beq+ cr7,ffc13fb4 <== ALWAYS TAKEN ffc13fb0: 4b ff ff e0 b ffc13f90 <== NOT EXECUTED static inline int rtems_disk_fd_get_disk_device( int fd, rtems_disk_device **dd_ptr ) { return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr); ffc13fb4: 3c 80 40 04 lis r4,16388 ffc13fb8: 60 84 42 09 ori r4,r4,16905 ffc13fbc: 38 bf 00 64 addi r5,r31,100 ffc13fc0: 4c c6 31 82 crclr 4*cr1+eq ffc13fc4: 48 00 15 61 bl ffc15524 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) { ffc13fc8: 2f 83 00 00 cmpwi cr7,r3,0 ffc13fcc: 41 be 00 0c beq+ cr7,ffc13fd8 <== ALWAYS TAKEN close(vol->fd); ffc13fd0: 80 7f 00 60 lwz r3,96(r31) <== NOT EXECUTED ffc13fd4: 4b ff ff bc b ffc13f90 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); } /* Read boot record */ /* FIXME: Asserts FAT_MAX_BPB_SIZE < bdbuf block size */ sc = rtems_bdbuf_read( vol->dd, 0, &block); ffc13fd8: 80 7f 00 64 lwz r3,100(r31) ffc13fdc: 38 80 00 00 li r4,0 ffc13fe0: 38 a1 00 5c addi r5,r1,92 ffc13fe4: 4b ff d8 0d bl ffc117f0 if (sc != RTEMS_SUCCESSFUL) ffc13fe8: 2f 83 00 00 cmpwi cr7,r3,0 ffc13fec: 41 be 00 08 beq+ cr7,ffc13ff4 <== ALWAYS TAKEN ffc13ff0: 48 00 00 cc b ffc140bc <== NOT EXECUTED { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); ffc13ff4: 80 61 00 5c lwz r3,92(r1) ffc13ff8: 81 23 00 1c lwz r9,28(r3) ffc13ffc: 89 09 00 0c lbz r8,12(r9) ffc14000: 89 89 00 0b lbz r12,11(r9) ffc14004: 89 69 00 0e lbz r11,14(r9) ffc14008: 88 c9 00 11 lbz r6,17(r9) ffc1400c: 88 e9 00 17 lbz r7,23(r9) ffc14010: 88 09 00 0f lbz r0,15(r9) ffc14014: 88 a9 00 12 lbz r5,18(r9) ffc14018: 89 49 00 25 lbz r10,37(r9) ffc1401c: 88 89 00 31 lbz r4,49(r9) ffc14020: 91 01 00 6c stw r8,108(r1) ffc14024: 89 09 00 16 lbz r8,22(r9) ffc14028: 8b c9 00 0d lbz r30,13(r9) ffc1402c: 8b 89 00 10 lbz r28,16(r9) ffc14030: 8a 49 00 13 lbz r18,19(r9) ffc14034: 8a 29 00 14 lbz r17,20(r9) ffc14038: 8a a9 00 20 lbz r21,32(r9) ffc1403c: 8a 69 00 21 lbz r19,33(r9) ffc14040: 8a 89 00 22 lbz r20,34(r9) ffc14044: 8a c9 00 23 lbz r22,35(r9) ffc14048: 89 e9 00 24 lbz r15,36(r9) ffc1404c: 89 c9 00 26 lbz r14,38(r9) ffc14050: 8a 09 00 27 lbz r16,39(r9) ffc14054: 8b a9 00 28 lbz r29,40(r9) ffc14058: 8b 29 00 2c lbz r25,44(r9) ffc1405c: 8a e9 00 2d lbz r23,45(r9) ffc14060: 8b 09 00 2e lbz r24,46(r9) ffc14064: 8b 49 00 2f lbz r26,47(r9) ffc14068: 8b 69 00 30 lbz r27,48(r9) ffc1406c: 91 41 00 68 stw r10,104(r1) sc = rtems_bdbuf_release( block); ffc14070: 90 01 00 8c stw r0,140(r1) ffc14074: 90 81 00 70 stw r4,112(r1) ffc14078: 90 a1 00 78 stw r5,120(r1) ffc1407c: 90 c1 00 74 stw r6,116(r1) ffc14080: 90 e1 00 80 stw r7,128(r1) ffc14084: 91 01 00 7c stw r8,124(r1) ffc14088: 91 61 00 84 stw r11,132(r1) ffc1408c: 91 81 00 88 stw r12,136(r1) ffc14090: 4b ff d9 59 bl ffc119e8 if (sc != RTEMS_SUCCESSFUL) ffc14094: 2f 83 00 00 cmpwi cr7,r3,0 ffc14098: 80 01 00 8c lwz r0,140(r1) ffc1409c: 80 81 00 70 lwz r4,112(r1) ffc140a0: 80 a1 00 78 lwz r5,120(r1) ffc140a4: 80 c1 00 74 lwz r6,116(r1) ffc140a8: 80 e1 00 80 lwz r7,128(r1) ffc140ac: 81 01 00 7c lwz r8,124(r1) ffc140b0: 81 61 00 84 lwz r11,132(r1) ffc140b4: 81 81 00 88 lwz r12,136(r1) ffc140b8: 41 be 00 18 beq+ cr7,ffc140d0 <== ALWAYS TAKEN { close(vol->fd); ffc140bc: 80 7f 00 60 lwz r3,96(r31) <== NOT EXECUTED ffc140c0: 4b ff 1b 95 bl ffc05c54 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EIO ); ffc140c4: 48 00 72 b1 bl ffc1b374 <__errno> <== NOT EXECUTED ffc140c8: 39 20 00 05 li r9,5 <== NOT EXECUTED ffc140cc: 48 00 05 24 b ffc145f0 <== NOT EXECUTED } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); ffc140d0: 81 41 00 6c lwz r10,108(r1) ffc140d4: 55 49 40 2e rlwinm r9,r10,8,0,23 ffc140d8: 7d 2c 63 78 or r12,r9,r12 if ( (vol->bps != 512) && ffc140dc: 2f 8c 02 00 cmpwi cr7,r12,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); ffc140e0: b1 9f 00 00 sth r12,0(r31) if ( (vol->bps != 512) && ffc140e4: 41 9e 00 20 beq- cr7,ffc14104 <== ALWAYS TAKEN ffc140e8: 2f 8c 04 00 cmpwi cr7,r12,1024 <== NOT EXECUTED ffc140ec: 41 9e 00 18 beq- cr7,ffc14104 <== NOT EXECUTED (vol->bps != 1024) && ffc140f0: 2f 8c 08 00 cmpwi cr7,r12,2048 <== NOT EXECUTED ffc140f4: 41 9e 00 10 beq- cr7,ffc14104 <== NOT EXECUTED (vol->bps != 2048) && ffc140f8: 2f 8c 10 00 cmpwi cr7,r12,4096 <== NOT EXECUTED ffc140fc: 41 be 00 08 beq+ cr7,ffc14104 <== NOT EXECUTED ffc14100: 48 00 02 e0 b ffc143e0 <== 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; ffc14104: 39 20 00 00 li r9,0 ffc14108: 99 3f 00 03 stb r9,3(r31) ffc1410c: 55 83 ba 7e rlwinm r3,r12,23,9,31 ffc14110: 48 00 00 14 b ffc14124 i >>= 1, vol->sec_mul++); ffc14114: 89 3f 00 03 lbz r9,3(r31) <== NOT EXECUTED ffc14118: 7c 63 0e 70 srawi r3,r3,1 <== NOT EXECUTED ffc1411c: 39 29 00 01 addi r9,r9,1 <== NOT EXECUTED ffc14120: 99 3f 00 03 stb r9,3(r31) <== 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; ffc14124: 70 69 00 01 andi. r9,r3,1 ffc14128: 41 82 ff ec beq+ ffc14114 <== NEVER TAKEN i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; ffc1412c: 39 20 00 00 li r9,0 ffc14130: 99 3f 00 02 stb r9,2(r31) ffc14134: 7d 89 63 78 mr r9,r12 ffc14138: 48 00 00 10 b ffc14148 i >>= 1, vol->sec_log2++); ffc1413c: 38 63 00 01 addi r3,r3,1 ffc14140: 98 7f 00 02 stb r3,2(r31) ffc14144: 7d 29 0e 70 srawi r9,r9,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; ffc14148: 71 2a 00 01 andi. r10,r9,1 ffc1414c: 88 7f 00 02 lbz r3,2(r31) ffc14150: 41 82 ff ec beq+ ffc1413c 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) ffc14154: 2f 9e 00 00 cmpwi cr7,r30,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; ffc14158: b1 9f 00 0a sth r12,10(r31) vol->bytes_per_block_log2 = vol->sec_log2; ffc1415c: 54 6a 06 3e clrlwi r10,r3,24 vol->sectors_per_block = 1; ffc14160: 39 20 00 01 li r9,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; ffc14164: 99 5f 00 0c stb r10,12(r31) vol->sectors_per_block = 1; ffc14168: 99 3f 00 09 stb r9,9(r31) vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); ffc1416c: 9b df 00 04 stb r30,4(r31) /* * "sectors per cluster" of zero is invalid * (and would hang the following loop) */ if (vol->spc == 0) ffc14170: 40 be 00 08 bne+ cr7,ffc14178 <== ALWAYS TAKEN ffc14174: 48 00 02 6c b ffc143e0 <== NOT EXECUTED { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; ffc14178: 39 20 00 00 li r9,0 ffc1417c: 99 3f 00 05 stb r9,5(r31) ffc14180: 7f c9 f3 78 mr r9,r30 ffc14184: 48 00 00 10 b ffc14194 i >>= 1, vol->spc_log2++); ffc14188: 38 63 00 01 addi r3,r3,1 ffc1418c: 98 7f 00 05 stb r3,5(r31) ffc14190: 7d 29 0e 70 srawi r9,r9,1 { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; ffc14194: 71 23 00 01 andi. r3,r9,1 ffc14198: 88 7f 00 05 lbz r3,5(r31) ffc1419c: 41 82 ff ec beq+ ffc14188 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) ffc141a0: 54 63 06 3e clrlwi r3,r3,24 ffc141a4: 7d 83 18 30 slw r3,r12,r3 ffc141a8: 54 69 04 3e clrlwi r9,r3,16 ffc141ac: 2b 89 80 00 cmplwi cr7,r9,32768 ffc141b0: b1 3f 00 06 sth r9,6(r31) ffc141b4: 40 bd 00 08 ble+ cr7,ffc141bc <== ALWAYS TAKEN ffc141b8: 48 00 02 28 b ffc143e0 <== NOT EXECUTED { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; ffc141bc: 39 20 00 00 li r9,0 ffc141c0: 99 3f 00 08 stb r9,8(r31) ffc141c4: 54 63 04 3e clrlwi r3,r3,16 ffc141c8: 48 00 00 14 b ffc141dc i >>= 1, vol->bpc_log2++); ffc141cc: 89 3f 00 08 lbz r9,8(r31) ffc141d0: 7c 63 0e 70 srawi r3,r3,1 ffc141d4: 39 29 00 01 addi r9,r9,1 ffc141d8: 99 3f 00 08 stb r9,8(r31) { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; ffc141dc: 70 69 00 01 andi. r9,r3,1 ffc141e0: 41 82 ff ec beq+ ffc141cc 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); ffc141e4: 54 a5 40 2e rlwinm r5,r5,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); ffc141e8: 9b 9f 00 0d stb r28,13(r31) vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); ffc141ec: 7c a6 33 78 or r6,r5,r6 /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / ffc141f0: 39 2c ff ff addi r9,r12,-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); ffc141f4: b0 df 00 24 sth r6,36(r31) /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / ffc141f8: 54 c6 28 34 rlwinm r6,r6,5,0,26 ffc141fc: 7c c6 4a 14 add r6,r6,r9 ffc14200: 7d 86 63 d6 divw r12,r6,r12 vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) ffc14204: 54 e7 40 2e rlwinm r7,r7,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)) / ffc14208: 91 9f 00 28 stw r12,40(r31) vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; ffc1420c: 7d 89 50 30 slw r9,r12,r10 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) ffc14210: 7c e8 43 78 or r8,r7,r8 /* 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; ffc14214: 91 3f 00 2c stw r9,44(r31) if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) ffc14218: 7d 09 07 35 extsh. r9,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); ffc1421c: 54 00 40 2e rlwinm r0,r0,8,0,23 ffc14220: 7c 0b 5b 78 or r11,r0,r11 ffc14224: b1 7f 00 18 sth r11,24(r31) vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) ffc14228: 41 82 00 10 beq- ffc14238 vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); ffc1422c: 55 28 04 3e clrlwi r8,r9,16 ffc14230: 91 1f 00 1c stw r8,28(r31) ffc14234: 48 00 00 24 b ffc14258 else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); ffc14238: 81 01 00 68 lwz r8,104(r1) ffc1423c: 55 ce 80 1e rlwinm r14,r14,16,0,15 ffc14240: 56 10 c0 0e rlwinm r16,r16,24,0,7 ffc14244: 55 0a 40 2e rlwinm r10,r8,8,0,23 ffc14248: 7d 4a 73 78 or r10,r10,r14 ffc1424c: 7d 4f 7b 78 or r15,r10,r15 ffc14250: 7d f0 83 78 or r16,r15,r16 ffc14254: 92 1f 00 1c stw r16,28(r31) vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + ffc14258: 81 3f 00 1c lwz r9,28(r31) 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) ffc1425c: 56 31 40 2e rlwinm r17,r17,8,0,23 ffc14260: 7e 32 93 78 or r18,r17,r18 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 + ffc14264: 7f 9c 49 d6 mullw r28,r28,r9 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) ffc14268: 7e 49 07 35 extsh. r9,r18 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 + ffc1426c: 7f 8b e2 14 add r28,r11,r28 ffc14270: 7d 8c e2 14 add r12,r12,r28 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; ffc14274: 93 9f 00 20 stw r28,32(r31) 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 + ffc14278: 91 9f 00 34 stw r12,52(r31) 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) ffc1427c: 41 82 00 10 beq- ffc1428c vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); ffc14280: 55 32 04 3e clrlwi r18,r9,16 ffc14284: 92 5f 00 30 stw r18,48(r31) ffc14288: 48 00 00 20 b ffc142a8 else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); ffc1428c: 56 73 40 2e rlwinm r19,r19,8,0,23 ffc14290: 56 94 80 1e rlwinm r20,r20,16,0,15 ffc14294: 7e 74 a3 78 or r20,r19,r20 ffc14298: 7e 95 ab 78 or r21,r20,r21 ffc1429c: 56 d6 c0 0e rlwinm r22,r22,24,0,7 ffc142a0: 7e b6 b3 78 or r22,r21,r22 ffc142a4: 92 df 00 30 stw r22,48(r31) data_secs = vol->tot_secs - vol->data_fsec; ffc142a8: 81 3f 00 30 lwz r9,48(r31) ffc142ac: 7d 8c 48 50 subf r12,r12,r9 vol->data_cls = data_secs / vol->spc; ffc142b0: 7f cc f3 96 divwu r30,r12,r30 /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) ffc142b4: 2b 9e 0f f4 cmplwi cr7,r30,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; ffc142b8: 93 df 00 38 stw r30,56(r31) /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) ffc142bc: 41 9d 00 1c bgt- cr7,ffc142d8 { vol->type = FAT_FAT12; ffc142c0: 39 20 00 01 li r9,1 ffc142c4: 99 3f 00 0e stb r9,14(r31) vol->mask = FAT_FAT12_MASK; ffc142c8: 39 20 0f ff li r9,4095 ffc142cc: 91 3f 00 10 stw r9,16(r31) vol->eoc_val = FAT_FAT12_EOC; ffc142d0: 39 20 0f f8 li r9,4088 ffc142d4: 48 00 00 44 b ffc14318 } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) ffc142d8: 2b 9e ff f4 cmplwi cr7,r30,65524 ffc142dc: 41 9d 00 20 bgt- cr7,ffc142fc { vol->type = FAT_FAT16; ffc142e0: 39 20 00 02 li r9,2 ffc142e4: 99 3f 00 0e stb r9,14(r31) vol->mask = FAT_FAT16_MASK; ffc142e8: 39 20 00 00 li r9,0 ffc142ec: 61 29 ff ff ori r9,r9,65535 ffc142f0: 91 3f 00 10 stw r9,16(r31) vol->eoc_val = FAT_FAT16_EOC; ffc142f4: 39 20 00 00 li r9,0 ffc142f8: 48 00 00 1c b ffc14314 } else { vol->type = FAT_FAT32; ffc142fc: 39 20 00 04 li r9,4 ffc14300: 99 3f 00 0e stb r9,14(r31) vol->mask = FAT_FAT32_MASK; ffc14304: 3d 20 0f ff lis r9,4095 ffc14308: 61 29 ff ff ori r9,r9,65535 ffc1430c: 91 3f 00 10 stw r9,16(r31) vol->eoc_val = FAT_FAT32_EOC; ffc14310: 3d 20 0f ff lis r9,4095 ffc14314: 61 29 ff f8 ori r9,r9,65528 ffc14318: 91 3f 00 14 stw r9,20(r31) } } if (vol->type == FAT_FAT32) ffc1431c: 89 3f 00 0e lbz r9,14(r31) ffc14320: 2f 89 00 04 cmpwi cr7,r9,4 ffc14324: 40 be 01 60 bne+ cr7,ffc14484 { 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; ffc14328: 57 a9 00 30 rlwinm r9,r29,0,0,24 ffc1432c: 55 29 06 3e clrlwi r9,r9,24 if (vol->mirror) ffc14330: 2f 89 00 00 cmpwi cr7,r9,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; ffc14334: 99 3f 00 54 stb r9,84(r31) } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); ffc14338: 56 f7 40 2e rlwinm r23,r23,8,0,23 ffc1433c: 57 18 80 1e rlwinm r24,r24,16,0,15 ffc14340: 7e f8 c3 78 or r24,r23,r24 ffc14344: 7f 19 cb 78 or r25,r24,r25 ffc14348: 57 5a c0 0e rlwinm r26,r26,24,0,7 ffc1434c: 7f 3a d3 78 or r26,r25,r26 ffc14350: 93 5f 00 3c stw r26,60(r31) vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; if (vol->mirror) ffc14354: 41 9e 00 10 beq- cr7,ffc14364 <== ALWAYS TAKEN vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; ffc14358: 57 bd 07 3e clrlwi r29,r29,28 <== NOT EXECUTED ffc1435c: 9b bf 00 5c stb r29,92(r31) <== NOT EXECUTED ffc14360: 48 00 00 08 b ffc14368 <== NOT EXECUTED else vol->afat = 0; ffc14364: 99 3f 00 5c stb r9,92(r31) vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); ffc14368: 54 84 40 2e rlwinm r4,r4,8,0,23 ffc1436c: 7c 84 db 78 or r4,r4,r27 if( vol->info_sec == 0 ) ffc14370: 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); ffc14374: b0 9f 00 40 sth r4,64(r31) if( vol->info_sec == 0 ) ffc14378: 40 be 00 08 bne+ cr7,ffc14380 <== ALWAYS TAKEN ffc1437c: 48 00 00 64 b ffc143e0 <== NOT EXECUTED close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , 0, ffc14380: 7f e3 fb 78 mr r3,r31 ffc14384: 38 a0 00 00 li r5,0 ffc14388: 38 c0 00 04 li r6,4 ffc1438c: 38 e1 00 50 addi r7,r1,80 ffc14390: 4b ff f8 09 bl ffc13b98 <_fat_block_read> FAT_FSI_LEADSIG_SIZE, fs_info_sector); if ( ret < 0 ) ffc14394: 2f 83 00 00 cmpwi cr7,r3,0 ffc14398: 40 bc 00 08 bge+ cr7,ffc143a0 <== ALWAYS TAKEN ffc1439c: 48 00 00 7c b ffc14418 <== NOT EXECUTED { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != ffc143a0: 89 41 00 51 lbz r10,81(r1) * 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); ffc143a4: 7f e3 fb 78 mr r3,r31 { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != ffc143a8: 89 21 00 52 lbz r9,82(r1) ffc143ac: 55 4a 40 2e rlwinm r10,r10,8,0,23 ffc143b0: 55 29 80 1e rlwinm r9,r9,16,0,15 ffc143b4: 7d 4a 4b 78 or r10,r10,r9 ffc143b8: 89 21 00 50 lbz r9,80(r1) ffc143bc: 7d 4a 4b 78 or r10,r10,r9 ffc143c0: 89 21 00 53 lbz r9,83(r1) ffc143c4: 55 29 c0 0e rlwinm r9,r9,24,0,7 ffc143c8: 7d 4a 4b 78 or r10,r10,r9 ffc143cc: 3d 20 41 61 lis r9,16737 ffc143d0: 61 29 52 52 ori r9,r9,21074 ffc143d4: 7f 8a 48 00 cmpw cr7,r10,r9 ffc143d8: 41 be 00 1c beq+ cr7,ffc143f4 <== ALWAYS TAKEN * 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); ffc143dc: 4b ff f5 35 bl ffc13910 <== NOT EXECUTED if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != FAT_FSINFO_LEAD_SIGNATURE_VALUE) { _fat_block_release(fs_info); close(vol->fd); ffc143e0: 80 7f 00 60 lwz r3,96(r31) <== NOT EXECUTED ffc143e4: 4b ff 18 71 bl ffc05c54 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); ffc143e8: 48 00 6f 8d bl ffc1b374 <__errno> <== NOT EXECUTED ffc143ec: 39 20 00 16 li r9,22 <== NOT EXECUTED ffc143f0: 48 00 02 00 b ffc145f0 <== NOT EXECUTED } else { ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, ffc143f4: a0 9f 00 40 lhz r4,64(r31) ffc143f8: 38 a0 01 e4 li r5,484 ffc143fc: 38 c0 00 0c li r6,12 ffc14400: 38 e1 00 50 addi r7,r1,80 ffc14404: 4b ff f7 95 bl ffc13b98 <_fat_block_read> FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) ffc14408: 2f 83 00 00 cmpwi cr7,r3,0 ffc1440c: 40 bc 00 18 bge+ cr7,ffc14424 <== ALWAYS TAKEN * 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); ffc14410: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc14414: 4b ff f4 fd bl ffc13910 <== 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); ffc14418: 80 7f 00 60 lwz r3,96(r31) <== NOT EXECUTED ffc1441c: 4b ff 18 39 bl ffc05c54 <== NOT EXECUTED ffc14420: 48 00 01 d4 b ffc145f4 <== NOT EXECUTED return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); ffc14424: 89 41 00 55 lbz r10,85(r1) ffc14428: 89 21 00 56 lbz r9,86(r1) ffc1442c: 55 4a 40 2e rlwinm r10,r10,8,0,23 ffc14430: 55 29 80 1e rlwinm r9,r9,16,0,15 ffc14434: 7d 49 4b 78 or r9,r10,r9 ffc14438: 89 41 00 54 lbz r10,84(r1) ffc1443c: 7d 29 53 78 or r9,r9,r10 ffc14440: 89 41 00 57 lbz r10,87(r1) ffc14444: 55 4a c0 0e rlwinm r10,r10,24,0,7 ffc14448: 7d 29 53 78 or r9,r9,r10 vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); ffc1444c: 89 41 00 59 lbz r10,89(r1) _fat_block_release(fs_info); close(vol->fd); return -1; } vol->free_cls_in_fs_info = ffc14450: 91 3f 00 48 stw r9,72(r31) FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); ffc14454: 55 4a 40 2e rlwinm r10,r10,8,0,23 return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); vol->free_cls = vol->free_cls_in_fs_info; ffc14458: 91 3f 00 44 stw r9,68(r31) vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); ffc1445c: 89 21 00 5a lbz r9,90(r1) ffc14460: 55 29 80 1e rlwinm r9,r9,16,0,15 ffc14464: 7d 49 4b 78 or r9,r10,r9 ffc14468: 89 41 00 58 lbz r10,88(r1) ffc1446c: 7d 29 53 78 or r9,r9,r10 ffc14470: 89 41 00 5b lbz r10,91(r1) ffc14474: 55 4a c0 0e rlwinm r10,r10,24,0,7 ffc14478: 7d 29 53 78 or r9,r9,r10 } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = ffc1447c: 91 3f 00 50 stw r9,80(r31) ffc14480: 48 00 00 1c b ffc1449c } } } else { vol->rdir_cl = 0; ffc14484: 39 20 00 00 li r9,0 ffc14488: 91 3f 00 3c stw r9,60(r31) vol->mirror = 0; ffc1448c: 99 3f 00 54 stb r9,84(r31) vol->afat = 0; ffc14490: 99 3f 00 5c stb r9,92(r31) vol->free_cls = FAT_UNDEFINED_VALUE; ffc14494: 39 20 ff ff li r9,-1 ffc14498: 91 3f 00 44 stw r9,68(r31) vol->next_cl = FAT_UNDEFINED_VALUE; ffc1449c: 91 3f 00 4c stw r9,76(r31) * 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); ffc144a0: 7f e3 fb 78 mr r3,r31 ffc144a4: 4b ff f4 6d bl ffc13910 vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; ffc144a8: 89 5f 00 5c lbz r10,92(r31) ffc144ac: 81 3f 00 1c lwz r9,28(r31) /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); ffc144b0: 38 60 00 02 li r3,2 ffc144b4: 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; ffc144b8: 7d 2a 49 d6 mullw r9,r10,r9 ffc144bc: a1 5f 00 18 lhz r10,24(r31) ffc144c0: 7d 29 52 14 add r9,r9,r10 ffc144c4: 91 3f 00 58 stw r9,88(r31) /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); ffc144c8: 4b ff 17 31 bl ffc05bf8 if ( fs_info->vhash == NULL ) ffc144cc: 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)); ffc144d0: 90 7f 00 6c stw r3,108(r31) if ( fs_info->vhash == NULL ) ffc144d4: 41 9e 00 48 beq- cr7,ffc1451c <== 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 ); ffc144d8: 39 23 00 04 addi r9,r3,4 head->next = tail; head->previous = NULL; tail->previous = head; ffc144dc: 90 63 00 08 stw r3,8(r3) 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 ); ffc144e0: 39 43 00 10 addi r10,r3,16 head->next = tail; ffc144e4: 91 23 00 00 stw r9,0(r3) head->previous = NULL; ffc144e8: 3b c0 00 00 li r30,0 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 ); ffc144ec: 39 23 00 0c addi r9,r3,12 head->next = tail; head->previous = NULL; ffc144f0: 93 c3 00 04 stw r30,4(r3) } 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)); ffc144f4: 38 80 00 0c li r4,12 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; ffc144f8: 91 43 00 0c stw r10,12(r3) head->previous = NULL; ffc144fc: 93 c3 00 10 stw r30,16(r3) tail->previous = head; ffc14500: 91 23 00 14 stw r9,20(r3) ffc14504: 38 60 00 02 li r3,2 ffc14508: 4b ff 16 f1 bl ffc05bf8 if ( fs_info->rhash == NULL ) ffc1450c: 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)); ffc14510: 90 7f 00 70 stw r3,112(r31) if ( fs_info->rhash == NULL ) ffc14514: 40 be 00 14 bne+ cr7,ffc14528 <== ALWAYS TAKEN ffc14518: 48 00 00 70 b ffc14588 <== 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); ffc1451c: 80 7f 00 60 lwz r3,96(r31) <== NOT EXECUTED ffc14520: 4b ff 17 35 bl ffc05c54 <== NOT EXECUTED ffc14524: 48 00 00 c4 b ffc145e8 <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); ffc14528: 39 23 00 04 addi r9,r3,4 head->next = tail; head->previous = NULL; ffc1452c: 93 c3 00 04 stw r30,4(r3) 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 ); ffc14530: 39 43 00 10 addi r10,r3,16 head->next = tail; ffc14534: 91 23 00 00 stw r9,0(r3) 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 ); ffc14538: 39 23 00 0c addi r9,r3,12 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)); ffc1453c: 38 80 00 01 li r4,1 head->next = tail; head->previous = NULL; tail->previous = head; ffc14540: 91 23 00 14 stw r9,20(r3) 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; ffc14544: 39 20 01 00 li r9,256 ffc14548: 90 63 00 08 stw r3,8(r3) ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; ffc1454c: 91 43 00 0c stw r10,12(r3) head->previous = NULL; ffc14550: 93 c3 00 10 stw r30,16(r3) 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)); ffc14554: 38 60 01 00 li r3,256 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; ffc14558: 91 3f 00 7c stw r9,124(r31) fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; ffc1455c: 89 5f 00 03 lbz r10,3(r31) ffc14560: 81 3f 00 30 lwz r9,48(r31) fs_info->index = 0; ffc14564: 93 df 00 78 stw r30,120(r31) } 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; ffc14568: 7d 29 50 30 slw r9,r9,r10 ffc1456c: 55 29 20 36 rlwinm r9,r9,4,0,27 ffc14570: 91 3f 00 80 stw r9,128(r31) fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); ffc14574: 4b ff 16 85 bl ffc05bf8 if ( fs_info->uino == NULL ) ffc14578: 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)); ffc1457c: 90 7f 00 74 stw r3,116(r31) if ( fs_info->uino == NULL ) ffc14580: 40 be 00 30 bne+ cr7,ffc145b0 <== ALWAYS TAKEN ffc14584: 48 00 00 14 b ffc14598 <== 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); ffc14588: 80 7f 00 60 lwz r3,96(r31) <== NOT EXECUTED ffc1458c: 4b ff 16 c9 bl ffc05c54 <== NOT EXECUTED free(fs_info->vhash); ffc14590: 80 7f 00 6c lwz r3,108(r31) <== NOT EXECUTED ffc14594: 48 00 00 50 b ffc145e4 <== 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); ffc14598: 80 7f 00 60 lwz r3,96(r31) <== NOT EXECUTED ffc1459c: 4b ff 16 b9 bl ffc05c54 <== NOT EXECUTED free(fs_info->vhash); ffc145a0: 80 7f 00 6c lwz r3,108(r31) <== NOT EXECUTED ffc145a4: 4b ff 17 39 bl ffc05cdc <== NOT EXECUTED free(fs_info->rhash); ffc145a8: 80 7f 00 70 lwz r3,112(r31) <== NOT EXECUTED ffc145ac: 48 00 00 38 b ffc145e4 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); ffc145b0: a0 7f 00 00 lhz r3,0(r31) ffc145b4: 38 80 00 01 li r4,1 ffc145b8: 4b ff 16 41 bl ffc05bf8 if (fs_info->sec_buf == NULL) ffc145bc: 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)); ffc145c0: 90 7f 00 90 stw r3,144(r31) if (fs_info->sec_buf == NULL) ffc145c4: 40 be 00 38 bne+ cr7,ffc145fc <== ALWAYS TAKEN { close(vol->fd); ffc145c8: 80 7f 00 60 lwz r3,96(r31) <== NOT EXECUTED ffc145cc: 4b ff 16 89 bl ffc05c54 <== NOT EXECUTED free(fs_info->vhash); ffc145d0: 80 7f 00 6c lwz r3,108(r31) <== NOT EXECUTED ffc145d4: 4b ff 17 09 bl ffc05cdc <== NOT EXECUTED free(fs_info->rhash); ffc145d8: 80 7f 00 70 lwz r3,112(r31) <== NOT EXECUTED ffc145dc: 4b ff 17 01 bl ffc05cdc <== NOT EXECUTED free(fs_info->uino); ffc145e0: 80 7f 00 74 lwz r3,116(r31) <== NOT EXECUTED ffc145e4: 4b ff 16 f9 bl ffc05cdc <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); ffc145e8: 48 00 6d 8d bl ffc1b374 <__errno> <== NOT EXECUTED ffc145ec: 39 20 00 0c li r9,12 <== NOT EXECUTED ffc145f0: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc145f4: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc145f8: 48 00 00 68 b ffc14660 <== NOT EXECUTED return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; ffc145fc: 89 3f 00 04 lbz r9,4(r31) ffc14600: 81 5f 00 34 lwz r10,52(r31) ffc14604: 39 29 ff ff addi r9,r9,-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) ffc14608: 7d 23 50 39 and. r3,r9,r10 ffc1460c: 41 a2 00 0c beq+ ffc14618 <== ALWAYS TAKEN vol->bytes_per_block_log2 = vol->bpc_log2; vol->sectors_per_block = vol->spc; } } return RC_OK; ffc14610: 38 60 00 00 li r3,0 <== NOT EXECUTED ffc14614: 48 00 00 4c b ffc14660 <== NOT EXECUTED * If possible we will use the cluster size as bdbuf block size for faster * file access. This requires that certain sectors are aligned to cluster * borders. */ if (is_cluster_aligned(vol, vol->data_fsec) && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) ffc14618: 89 5f 00 0e lbz r10,14(r31) ffc1461c: 2f 8a 00 04 cmpwi cr7,r10,4 ffc14620: 41 9e 00 10 beq- cr7,ffc14630 return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; ffc14624: 81 5f 00 20 lwz r10,32(r31) * 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))) ffc14628: 7d 28 50 39 and. r8,r9,r10 ffc1462c: 40 a2 ff e4 bne- ffc14610 <== NEVER TAKEN { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); ffc14630: 80 7f 00 64 lwz r3,100(r31) ffc14634: 38 a0 00 01 li r5,1 ffc14638: a0 9f 00 06 lhz r4,6(r31) ffc1463c: 4b ff d8 49 bl ffc11e84 if (sc == RTEMS_SUCCESSFUL) ffc14640: 2f 83 00 00 cmpwi cr7,r3,0 ffc14644: 40 be ff cc bne- cr7,ffc14610 <== NEVER TAKEN { vol->bytes_per_block = vol->bpc; ffc14648: a1 3f 00 06 lhz r9,6(r31) ffc1464c: b1 3f 00 0a sth r9,10(r31) vol->bytes_per_block_log2 = vol->bpc_log2; ffc14650: 89 3f 00 08 lbz r9,8(r31) ffc14654: 99 3f 00 0c stb r9,12(r31) vol->sectors_per_block = vol->spc; ffc14658: 89 3f 00 04 lbz r9,4(r31) ffc1465c: 99 3f 00 09 stb r9,9(r31) } } return RC_OK; } ffc14660: 39 61 00 d8 addi r11,r1,216 ffc14664: 4b fe cf 54 b ffc015b8 <_restgpr_14_x> =============================================================================== ffc19cd4 : uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { ffc19cd4: 94 21 ff b8 stwu r1,-72(r1) ffc19cd8: 7d 80 00 26 mfcr r12 ffc19cdc: 7c 08 02 a6 mflr r0 int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; ffc19ce0: 39 20 00 00 li r9,0 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { ffc19ce4: be a1 00 1c stmw r21,28(r1) uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; if (count == 0) ffc19ce8: 7c b6 2b 79 mr. r22,r5 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { ffc19cec: 7c 7f 1b 78 mr r31,r3 ffc19cf0: 90 01 00 4c stw r0,76(r1) ffc19cf4: 7c dd 33 78 mr r29,r6 ffc19cf8: 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; ffc19cfc: 82 e3 00 38 lwz r23,56(r3) bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; ffc19d00: 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; ffc19d04: 91 26 00 00 stw r9,0(r6) if (count == 0) ffc19d08: 41 82 01 cc beq- ffc19ed4 <== NEVER TAKEN return rc; if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE) ffc19d0c: 83 c3 00 4c lwz r30,76(r3) ffc19d10: 7c 9b 23 78 mr r27,r4 ffc19d14: 7c f8 3b 78 mr r24,r7 ffc19d18: 2f 9e ff ff cmpwi cr7,r30,-1 ffc19d1c: 40 be 00 08 bne+ cr7,ffc19d24 uint32_t *last_cl, bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; ffc19d20: 3b c0 00 02 li r30,2 uint32_t next_cln = 0; uint32_t save_cln = 0; uint32_t data_cls_val = fs_info->vol.data_cls + 2; ffc19d24: 3a f7 00 02 addi r23,r23,2 ffc19d28: 3b 20 00 02 li r25,2 ffc19d2c: 3b 40 00 00 li r26,0 rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); if ( rc != RC_OK ) goto cleanup; } if (zero_fill) ffc19d30: 2e 08 00 00 cmpwi cr4,r8,0 ffc19d34: 48 00 01 3c b ffc19e70 * starting at cluster 2, so the maximum valid cluster number is * (fs_info->vol.data_cls + 1) */ while (i < data_cls_val) { rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln); ffc19d38: 7f e3 fb 78 mr r3,r31 ffc19d3c: 7f c4 f3 78 mr r4,r30 ffc19d40: 38 a1 00 08 addi r5,r1,8 ffc19d44: 4b ff fa 61 bl ffc197a4 if ( rc != RC_OK ) ffc19d48: 7c 7c 1b 79 mr. r28,r3 ffc19d4c: 41 a2 00 20 beq+ ffc19d6c <== ALWAYS TAKEN { if (*cls_added != 0) ffc19d50: 81 3d 00 00 lwz r9,0(r29) <== NOT EXECUTED ffc19d54: 2f 89 00 00 cmpwi cr7,r9,0 <== NOT EXECUTED ffc19d58: 41 be 01 88 beq+ cr7,ffc19ee0 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); ffc19d5c: 80 9b 00 00 lwz r4,0(r27) <== NOT EXECUTED ffc19d60: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc19d64: 4b ff fe 9d bl ffc19c00 <== NOT EXECUTED ffc19d68: 48 00 01 78 b ffc19ee0 <== NOT EXECUTED return rc; } if (next_cln == FAT_GENFAT_FREE) ffc19d6c: 81 21 00 08 lwz r9,8(r1) ffc19d70: 2f 89 00 00 cmpwi cr7,r9,0 ffc19d74: 40 9e 00 e8 bne- cr7,ffc19e5c /* * 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) ffc19d78: 81 3d 00 00 lwz r9,0(r29) ffc19d7c: 2f 89 00 00 cmpwi cr7,r9,0 ffc19d80: 40 9e 00 28 bne- cr7,ffc19da8 { *chain = cl4find; ffc19d84: 93 db 00 00 stw r30,0(r27) rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); ffc19d88: 7f e3 fb 78 mr r3,r31 ffc19d8c: 7f c4 f3 78 mr r4,r30 ffc19d90: 38 a0 ff ff li r5,-1 ffc19d94: 4b ff fb d1 bl ffc19964 if ( rc != RC_OK ) ffc19d98: 2c 03 00 00 cmpwi r3,0 ffc19d9c: 40 82 01 40 bne- ffc19edc <== NEVER TAKEN rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); if ( rc != RC_OK ) goto cleanup; } if (zero_fill) ffc19da0: 41 b2 00 4c beq+ cr4,ffc19dec ffc19da4: 48 00 00 64 b ffc19e08 } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); ffc19da8: 7f e3 fb 78 mr r3,r31 ffc19dac: 7f c4 f3 78 mr r4,r30 ffc19db0: 38 a0 ff ff li r5,-1 ffc19db4: 4b ff fb b1 bl ffc19964 if ( rc != RC_OK ) ffc19db8: 7c 75 1b 79 mr. r21,r3 { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); ffc19dbc: 7f e3 fb 78 mr r3,r31 } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); if ( rc != RC_OK ) ffc19dc0: 41 a2 00 14 beq+ ffc19dd4 <== ALWAYS TAKEN { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); ffc19dc4: 80 9b 00 00 lwz r4,0(r27) <== NOT EXECUTED } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); ffc19dc8: 7e bc ab 78 mr r28,r21 <== NOT EXECUTED if ( rc != RC_OK ) { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); ffc19dcc: 4b ff fe 35 bl ffc19c00 <== NOT EXECUTED ffc19dd0: 48 00 01 10 b ffc19ee0 <== NOT EXECUTED return rc; } rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); ffc19dd4: 7f 44 d3 78 mr r4,r26 ffc19dd8: 7f c5 f3 78 mr r5,r30 ffc19ddc: 4b ff fb 89 bl ffc19964 if ( rc != RC_OK ) ffc19de0: 7c 7a 1b 79 mr. r26,r3 ffc19de4: 41 82 ff bc beq+ ffc19da0 <== ALWAYS TAKEN ffc19de8: 48 00 00 c0 b ffc19ea8 <== NOT EXECUTED goto cleanup; } } save_cln = cl4find; (*cls_added)++; ffc19dec: 81 3d 00 00 lwz r9,0(r29) ffc19df0: 39 29 00 01 addi r9,r9,1 /* have we satisfied request ? */ if (*cls_added == count) ffc19df4: 7f 89 b0 00 cmpw cr7,r9,r22 goto cleanup; } } save_cln = cl4find; (*cls_added)++; ffc19df8: 91 3d 00 00 stw r9,0(r29) /* have we satisfied request ? */ if (*cls_added == count) ffc19dfc: 41 9e 00 34 beq- cr7,ffc19e30 ffc19e00: 7f da f3 78 mr r26,r30 ffc19e04: 48 00 00 58 b ffc19e5c goto cleanup; } if (zero_fill) { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); ffc19e08: a0 df 00 06 lhz r6,6(r31) ffc19e0c: 7f e3 fb 78 mr r3,r31 ffc19e10: 7f c4 f3 78 mr r4,r30 ffc19e14: 38 a0 00 00 li r5,0 ffc19e18: 38 e0 00 00 li r7,0 ffc19e1c: 4b ff 9e cd bl ffc13ce8 if (fs_info->vol.bpc != bytes_written) ffc19e20: a1 3f 00 06 lhz r9,6(r31) ffc19e24: 7f 89 18 00 cmpw cr7,r9,r3 ffc19e28: 41 9e ff c4 beq+ cr7,ffc19dec <== ALWAYS TAKEN ffc19e2c: 48 00 00 78 b ffc19ea4 <== 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) ffc19e30: 81 3f 00 44 lwz r9,68(r31) (*cls_added)++; /* have we satisfied request ? */ if (*cls_added == count) { fs_info->vol.next_cl = save_cln; ffc19e34: 93 df 00 4c stw r30,76(r31) if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) ffc19e38: 2f 89 ff ff cmpwi cr7,r9,-1 ffc19e3c: 41 9e 00 10 beq- cr7,ffc19e4c <== ALWAYS TAKEN fs_info->vol.free_cls -= (*cls_added); ffc19e40: 81 5d 00 00 lwz r10,0(r29) <== NOT EXECUTED ffc19e44: 7d 2a 48 50 subf r9,r10,r9 <== NOT EXECUTED ffc19e48: 91 3f 00 44 stw r9,68(r31) <== NOT EXECUTED *last_cl = save_cln; ffc19e4c: 93 d8 00 00 stw r30,0(r24) fat_buf_release(fs_info); ffc19e50: 7f e3 fb 78 mr r3,r31 ffc19e54: 4b ff 9a bd bl ffc13910 ffc19e58: 48 00 00 88 b ffc19ee0 return rc; } } i++; cl4find++; ffc19e5c: 3b de 00 01 addi r30,r30,1 if (cl4find >= data_cls_val) ffc19e60: 7f 9e b8 40 cmplw cr7,r30,r23 *last_cl = save_cln; fat_buf_release(fs_info); return rc; } } i++; ffc19e64: 3b 39 00 01 addi r25,r25,1 cl4find++; if (cl4find >= data_cls_val) ffc19e68: 41 9c 00 08 blt- cr7,ffc19e70 <== ALWAYS TAKEN cl4find = 2; ffc19e6c: 3b c0 00 02 li r30,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) ffc19e70: 7f 99 b8 40 cmplw cr7,r25,r23 ffc19e74: 41 9c fe c4 blt+ cr7,ffc19d38 <== 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) ffc19e78: 81 3f 00 44 lwz r9,68(r31) <== NOT EXECUTED cl4find++; if (cl4find >= data_cls_val) cl4find = 2; } fs_info->vol.next_cl = save_cln; ffc19e7c: 93 5f 00 4c stw r26,76(r31) <== NOT EXECUTED if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) ffc19e80: 2f 89 ff ff cmpwi cr7,r9,-1 <== NOT EXECUTED ffc19e84: 41 9e 00 10 beq- cr7,ffc19e94 <== NOT EXECUTED fs_info->vol.free_cls -= (*cls_added); ffc19e88: 81 5d 00 00 lwz r10,0(r29) <== NOT EXECUTED ffc19e8c: 7d 2a 48 50 subf r9,r10,r9 <== NOT EXECUTED ffc19e90: 91 3f 00 44 stw r9,68(r31) <== NOT EXECUTED *last_cl = save_cln; ffc19e94: 93 58 00 00 stw r26,0(r24) <== NOT EXECUTED fat_buf_release(fs_info); ffc19e98: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc19e9c: 4b ff 9a 75 bl ffc13910 <== NOT EXECUTED ffc19ea0: 48 00 00 34 b ffc19ed4 <== NOT EXECUTED if (zero_fill) { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); if (fs_info->vol.bpc != bytes_written) { rc = -1; ffc19ea4: 3b 40 ff ff li r26,-1 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); ffc19ea8: 80 9b 00 00 lwz r4,0(r27) <== NOT EXECUTED ffc19eac: 7f e3 fb 78 mr r3,r31 <== 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; ffc19eb0: 7f 5c d3 78 mr r28,r26 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); ffc19eb4: 4b ff fd 4d bl ffc19c00 <== NOT EXECUTED /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); ffc19eb8: 7f c4 f3 78 mr r4,r30 <== NOT EXECUTED ffc19ebc: 38 a0 00 00 li r5,0 <== NOT EXECUTED ffc19ec0: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc19ec4: 4b ff fa a1 bl ffc19964 <== NOT EXECUTED fat_buf_release(fs_info); ffc19ec8: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc19ecc: 4b ff 9a 45 bl ffc13910 <== NOT EXECUTED ffc19ed0: 48 00 00 10 b ffc19ee0 <== NOT EXECUTED ssize_t bytes_written; *cls_added = 0; if (count == 0) return rc; ffc19ed4: 3b 80 00 00 li r28,0 <== NOT EXECUTED ffc19ed8: 48 00 00 08 b ffc19ee0 <== NOT EXECUTED * wouldn't work properly */ if (*cls_added == 0) { *chain = cl4find; rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); ffc19edc: 7c 7c 1b 78 mr r28,r3 <== 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; } ffc19ee0: 81 81 00 18 lwz r12,24(r1) ffc19ee4: 39 61 00 48 addi r11,r1,72 ffc19ee8: 7f 83 e3 78 mr r3,r28 ffc19eec: 7d 80 81 20 mtcrf 8,r12 ffc19ef0: 4b fe 76 e4 b ffc015d4 <_restgpr_21_x> =============================================================================== ffc13c34 : fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { ffc13c34: 94 21 ff c8 stwu r1,-56(r1) ffc13c38: 7c 08 02 a6 mflr r0 ffc13c3c: bf 01 00 18 stmw r24,24(r1) ffc13c40: 7c 7e 1b 78 mr r30,r3 ffc13c44: 7c dd 33 78 mr r29,r6 ffc13c48: 90 01 00 3c stw r0,60(r1) ffc13c4c: 7c f9 3b 78 mr r25,r7 int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; uint32_t ofs = offset; ffc13c50: 7c ba 2b 78 mr r26,r5 uint32_t count, const void *buff) { int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; ffc13c54: 7c 9b 23 78 mr r27,r4 uint32_t offset, uint32_t count, const void *buff) { int rc = RC_OK; ssize_t cmpltd = 0; ffc13c58: 3b 80 00 00 li r28,0 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; ffc13c5c: 3b 00 00 01 li r24,1 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) ffc13c60: 48 00 00 6c b ffc13ccc { c = MIN(count, (fs_info->vol.bps - ofs)); ffc13c64: a3 fe 00 00 lhz r31,0(r30) ffc13c68: 7f fa f8 50 subf r31,r26,r31 ffc13c6c: 7f 9f e8 40 cmplw cr7,r31,r29 ffc13c70: 40 9d 00 08 ble- cr7,ffc13c78 ffc13c74: 7f bf eb 78 mr r31,r29 if (c == fs_info->vol.bytes_per_block) ffc13c78: a1 3e 00 0a lhz r9,10(r30) rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); ffc13c7c: 7f c3 f3 78 mr r3,r30 ffc13c80: 7f 64 db 78 mr r4,r27 while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); if (c == fs_info->vol.bytes_per_block) ffc13c84: 7f 9f 48 00 cmpw cr7,r31,r9 rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); ffc13c88: 38 a0 00 02 li r5,2 while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); if (c == fs_info->vol.bytes_per_block) ffc13c8c: 41 9e 00 08 beq- cr7,ffc13c94 <== NEVER TAKEN 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); ffc13c90: 38 a0 00 01 li r5,1 ffc13c94: 38 c1 00 08 addi r6,r1,8 ffc13c98: 4b ff fe 39 bl ffc13ad0 if (rc != RC_OK) ffc13c9c: 2f 83 00 00 cmpwi cr7,r3,0 ffc13ca0: 40 9e 00 38 bne- cr7,ffc13cd8 <== NEVER TAKEN return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); ffc13ca4: 80 61 00 08 lwz r3,8(r1) ffc13ca8: 7c 99 e2 14 add r4,r25,r28 ffc13cac: 7f e5 fb 78 mr r5,r31 ffc13cb0: 7c 63 d2 14 add r3,r3,r26 ffc13cb4: 48 00 83 a1 bl ffc1c054 ffc13cb8: 9b 1e 00 88 stb r24,136(r30) fat_buf_mark_modified(fs_info); count -= c; ffc13cbc: 7f bf e8 50 subf r29,r31,r29 cmpltd +=c; ffc13cc0: 7f 9f e2 14 add r28,r31,r28 sec_num++; ffc13cc4: 3b 7b 00 01 addi r27,r27,1 ofs = 0; ffc13cc8: 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) ffc13ccc: 2f 9d 00 00 cmpwi cr7,r29,0 ffc13cd0: 40 9e ff 94 bne+ cr7,ffc13c64 ffc13cd4: 48 00 00 08 b ffc13cdc if (c == fs_info->vol.bytes_per_block) rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; ffc13cd8: 3b 80 ff ff li r28,-1 <== NOT EXECUTED cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } ffc13cdc: 39 61 00 38 addi r11,r1,56 ffc13ce0: 7f 83 e3 78 mr r3,r28 ffc13ce4: 4b fe d8 fc b ffc015e0 <_restgpr_24_x> =============================================================================== ffc19964 : 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)) ) ffc19964: 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 ) { ffc19968: 94 21 ff d0 stwu r1,-48(r1) ffc1996c: 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; ffc19970: 39 20 00 00 li r9,0 fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { ffc19974: bf 41 00 18 stmw r26,24(r1) ffc19978: 7c 9e 23 78 mr r30,r4 ffc1997c: 90 01 00 34 stw r0,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; ffc19980: 91 21 00 08 stw r9,8(r1) /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) ffc19984: 40 9d 02 64 ble- cr7,ffc19be8 <== NEVER TAKEN ffc19988: 81 23 00 38 lwz r9,56(r3) ffc1998c: 7c 7f 1b 78 mr r31,r3 ffc19990: 39 29 00 01 addi r9,r9,1 ffc19994: 7f 84 48 40 cmplw cr7,r4,r9 ffc19998: 40 bd 00 08 ble+ cr7,ffc199a0 <== ALWAYS TAKEN ffc1999c: 48 00 02 4c b ffc19be8 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + ffc199a0: 89 23 00 0e lbz r9,14(r3) ffc199a4: 7c bc 2b 78 mr r28,r5 ffc199a8: 71 28 00 01 andi. r8,r9,1 ffc199ac: 41 82 00 10 beq- ffc199bc ffc199b0: 54 9b f8 7e rlwinm r27,r4,31,1,31 ffc199b4: 7f 7b 22 14 add r27,r27,r4 ffc199b8: 48 00 00 18 b ffc199d0 ffc199bc: 55 2a 07 bc rlwinm r10,r9,0,30,30 ffc199c0: 71 47 00 ff andi. r7,r10,255 ffc199c4: 54 9b 10 3a rlwinm r27,r4,2,0,29 ffc199c8: 41 82 00 08 beq- ffc199d0 ffc199cc: 54 9b 08 3c rlwinm r27,r4,1,0,30 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); ffc199d0: 2f 88 00 00 cmpwi cr7,r8,0 /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + ffc199d4: 89 5f 00 02 lbz r10,2(r31) ffc199d8: 7f 7b 54 30 srw r27,r27,r10 ffc199dc: 81 5f 00 58 lwz r10,88(r31) ffc199e0: 7f 7b 52 14 add r27,r27,r10 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); ffc199e4: 41 9e 00 10 beq- cr7,ffc199f4 ffc199e8: 57 dd f8 7e rlwinm r29,r30,31,1,31 ffc199ec: 7f bd f2 14 add r29,r29,r30 ffc199f0: 48 00 00 18 b ffc19a08 ffc199f4: 55 29 07 bc rlwinm r9,r9,0,30,30 ffc199f8: 71 2a 00 ff andi. r10,r9,255 ffc199fc: 57 dd 10 3a rlwinm r29,r30,2,0,29 ffc19a00: 41 82 00 08 beq- ffc19a08 ffc19a04: 57 dd 08 3c rlwinm r29,r30,1,0,30 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); ffc19a08: 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); ffc19a0c: a3 5f 00 00 lhz r26,0(r31) rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); ffc19a10: 7f 64 db 78 mr r4,r27 ffc19a14: 38 a0 00 01 li r5,1 ffc19a18: 38 c1 00 08 addi r6,r1,8 ffc19a1c: 4b ff a0 b5 bl ffc13ad0 if (rc != RC_OK) ffc19a20: 2c 03 00 00 cmpwi r3,0 ffc19a24: 40 82 01 d4 bne- ffc19bf8 <== NEVER TAKEN 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); ffc19a28: 39 3a ff ff addi r9,r26,-1 ffc19a2c: 7f a9 48 38 and r9,r29,r9 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) ffc19a30: 8b bf 00 0e lbz r29,14(r31) ffc19a34: 2f 9d 00 02 cmpwi cr7,r29,2 ffc19a38: 41 9e 01 50 beq- cr7,ffc19b88 ffc19a3c: 2f 9d 00 04 cmpwi cr7,r29,4 ffc19a40: 41 9e 01 60 beq- cr7,ffc19ba0 ffc19a44: 2f 9d 00 01 cmpwi cr7,r29,1 ffc19a48: 40 be 01 a0 bne+ cr7,ffc19be8 <== NEVER TAKEN { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) ffc19a4c: 73 c7 00 01 andi. r7,r30,1 ffc19a50: 81 41 00 08 lwz r10,8(r1) ffc19a54: 41 82 00 90 beq- ffc19ae4 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; ffc19a58: 7d 0a 48 ae lbzx r8,r10,r9 switch ( fs_info->vol.type ) { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; ffc19a5c: 57 9c 24 36 rlwinm r28,r28,4,16,27 *(sec_buf + ofs) &= 0x0F; ffc19a60: 55 08 07 3e clrlwi r8,r8,28 ffc19a64: 7d 0a 49 ae stbx r8,r10,r9 *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); ffc19a68: 81 41 00 08 lwz r10,8(r1) ffc19a6c: 7d 0a 48 ae lbzx r8,r10,r9 ffc19a70: 7f 88 43 78 or r8,r28,r8 ffc19a74: 7d 0a 49 ae stbx r8,r10,r9 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) ffc19a78: a1 5f 00 00 lhz r10,0(r31) } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; ffc19a7c: 9b bf 00 88 stb r29,136(r31) ffc19a80: 39 4a ff ff addi r10,r10,-1 ffc19a84: 7f 89 50 00 cmpw cr7,r9,r10 ffc19a88: 40 be 00 3c bne+ cr7,ffc19ac4 <== ALWAYS TAKEN { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, ffc19a8c: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc19a90: 38 9b 00 01 addi r4,r27,1 <== NOT EXECUTED ffc19a94: 38 a0 00 01 li r5,1 <== NOT EXECUTED ffc19a98: 38 c1 00 08 addi r6,r1,8 <== NOT EXECUTED ffc19a9c: 4b ff a0 35 bl ffc13ad0 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) ffc19aa0: 2c 03 00 00 cmpwi r3,0 <== NOT EXECUTED ffc19aa4: 40 82 01 54 bne- ffc19bf8 <== NOT EXECUTED return rc; *sec_buf &= 0x00; ffc19aa8: 81 21 00 08 lwz r9,8(r1) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); ffc19aac: 57 9c c2 3e rlwinm r28,r28,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; ffc19ab0: 98 69 00 00 stb r3,0(r9) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); ffc19ab4: 81 21 00 08 lwz r9,8(r1) <== NOT EXECUTED ffc19ab8: 89 49 00 00 lbz r10,0(r9) <== NOT EXECUTED ffc19abc: 7f 8a 53 78 or r10,r28,r10 <== NOT EXECUTED ffc19ac0: 48 00 00 90 b ffc19b50 <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; ffc19ac4: 81 41 00 08 lwz r10,8(r1) ffc19ac8: 39 29 00 01 addi r9,r9,1 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); ffc19acc: 57 9c c2 3e rlwinm r28,r28,24,8,31 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; ffc19ad0: 7c 6a 49 ae stbx r3,r10,r9 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); ffc19ad4: 81 41 00 08 lwz r10,8(r1) ffc19ad8: 7d 0a 48 ae lbzx r8,r10,r9 ffc19adc: 7d 08 e3 78 or r8,r8,r28 ffc19ae0: 48 00 00 a0 b ffc19b80 } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; ffc19ae4: 7c 6a 49 ae stbx r3,r10,r9 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; ffc19ae8: 57 9c 05 3e clrlwi r28,r28,20 ffc19aec: 57 9e 04 3e clrlwi r30,r28,16 *(sec_buf + ofs) &= 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); ffc19af0: 81 41 00 08 lwz r10,8(r1) ffc19af4: 7d 0a 48 ae lbzx r8,r10,r9 ffc19af8: 7d 1c e3 78 or r28,r8,r28 ffc19afc: 7f 8a 49 ae stbx r28,r10,r9 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) ffc19b00: a1 5f 00 00 lhz r10,0(r31) ffc19b04: 9b bf 00 88 stb r29,136(r31) ffc19b08: 39 4a ff ff addi r10,r10,-1 ffc19b0c: 7f 89 50 00 cmpw cr7,r9,r10 ffc19b10: 40 be 00 4c bne+ cr7,ffc19b5c <== ALWAYS TAKEN { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, ffc19b14: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc19b18: 38 9b 00 01 addi r4,r27,1 <== NOT EXECUTED ffc19b1c: 38 a0 00 01 li r5,1 <== NOT EXECUTED ffc19b20: 38 c1 00 08 addi r6,r1,8 <== NOT EXECUTED ffc19b24: 4b ff 9f ad bl ffc13ad0 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) ffc19b28: 2c 03 00 00 cmpwi r3,0 <== NOT EXECUTED ffc19b2c: 40 82 00 cc bne- ffc19bf8 <== NOT EXECUTED return rc; *sec_buf &= 0xF0; ffc19b30: 81 21 00 08 lwz r9,8(r1) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); ffc19b34: 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; ffc19b38: 89 49 00 00 lbz r10,0(r9) <== NOT EXECUTED ffc19b3c: 55 4a 00 36 rlwinm r10,r10,0,0,27 <== NOT EXECUTED ffc19b40: 99 49 00 00 stb r10,0(r9) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); ffc19b44: 81 21 00 08 lwz r9,8(r1) <== NOT EXECUTED ffc19b48: 89 49 00 00 lbz r10,0(r9) <== NOT EXECUTED ffc19b4c: 7f ca 53 78 or r10,r30,r10 <== NOT EXECUTED ffc19b50: 99 49 00 00 stb r10,0(r9) <== NOT EXECUTED ffc19b54: 9b bf 00 88 stb r29,136(r31) <== NOT EXECUTED ffc19b58: 48 00 00 a0 b ffc19bf8 <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; ffc19b5c: 81 41 00 08 lwz r10,8(r1) ffc19b60: 39 29 00 01 addi r9,r9,1 *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); ffc19b64: 57 de c2 3e rlwinm r30,r30,24,8,31 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; ffc19b68: 7d 0a 48 ae lbzx r8,r10,r9 ffc19b6c: 55 08 00 36 rlwinm r8,r8,0,0,27 ffc19b70: 7d 0a 49 ae stbx r8,r10,r9 *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); ffc19b74: 81 41 00 08 lwz r10,8(r1) ffc19b78: 7d 0a 48 ae lbzx r8,r10,r9 ffc19b7c: 7d 08 f3 78 or r8,r8,r30 ffc19b80: 7d 0a 49 ae stbx r8,r10,r9 ffc19b84: 48 00 00 74 b ffc19bf8 } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = (uint16_t )(CT_LE_W(in_val)); ffc19b88: 57 8a 42 2e rlwinm r10,r28,8,8,23 ffc19b8c: 57 9c c6 3e rlwinm r28,r28,24,24,31 ffc19b90: 7d 5c e3 78 or r28,r10,r28 } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = ffc19b94: 81 41 00 08 lwz r10,8(r1) ffc19b98: 7f 8a 4b 2e sthx r28,r10,r9 ffc19b9c: 48 00 00 40 b ffc19bdc (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)); ffc19ba0: 57 9c 01 3e clrlwi r28,r28,4 ffc19ba4: 53 87 46 3e rlwimi r7,r28,8,24,31 ffc19ba8: 53 87 c4 2e rlwimi r7,r28,24,16,23 ffc19bac: 53 87 42 1e rlwimi r7,r28,8,8,15 ffc19bb0: 53 87 c0 0e rlwimi r7,r28,24,0,7 ffc19bb4: 3d 00 f0 00 lis r8,-4096 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); ffc19bb8: 81 41 00 08 lwz r10,8(r1) ffc19bbc: 51 06 46 3e rlwimi r6,r8,8,24,31 ffc19bc0: 51 06 c4 2e rlwimi r6,r8,24,16,23 ffc19bc4: 51 06 42 1e rlwimi r6,r8,8,8,15 ffc19bc8: 51 06 c0 0e rlwimi r6,r8,24,0,7 ffc19bcc: 7d 0a 48 2e lwzx r8,r10,r9 ffc19bd0: 7c c8 40 38 and r8,r6,r8 *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; ffc19bd4: 7d 08 3b 78 or r8,r8,r7 ffc19bd8: 7d 0a 49 2e stwx r8,r10,r9 ffc19bdc: 39 20 00 01 li r9,1 ffc19be0: 99 3f 00 88 stb r9,136(r31) ffc19be4: 48 00 00 14 b ffc19bf8 fat_buf_mark_modified(fs_info); break; default: rtems_set_errno_and_return_minus_one(EIO); ffc19be8: 48 00 17 8d bl ffc1b374 <__errno> <== NOT EXECUTED ffc19bec: 39 20 00 05 li r9,5 <== NOT EXECUTED ffc19bf0: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc19bf4: 38 60 ff ff li r3,-1 <== NOT EXECUTED break; } return RC_OK; } ffc19bf8: 39 61 00 30 addi r11,r1,48 ffc19bfc: 4b fe 79 ec b ffc015e8 <_restgpr_26_x> =============================================================================== ffc14764 : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_shutdown_drive(fat_fs_info_t *fs_info) { ffc14764: 94 21 ff e8 stwu r1,-24(r1) ffc14768: 7c 08 02 a6 mflr r0 ffc1476c: bf 81 00 08 stmw r28,8(r1) ffc14770: 7c 7f 1b 78 mr r31,r3 ffc14774: 90 01 00 1c stw r0,28(r1) int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); ffc14778: 4b ff fe f1 bl ffc14668 if ( rc != RC_OK ) ffc1477c: 7c 7d 1b 79 mr. r29,r3 ffc14780: 41 a2 00 08 beq+ ffc14788 <== ALWAYS TAKEN rc = -1; ffc14784: 3b a0 ff ff li r29,-1 <== NOT EXECUTED ffc14788: 3b c0 00 00 li r30,0 for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->vhash + i; ffc1478c: 83 9f 00 6c lwz r28,108(r31) ffc14790: 7f 9c f2 14 add r28,r28,r30 while ( (node = rtems_chain_get(the_chain)) != NULL ) ffc14794: 48 00 00 08 b ffc1479c free(node); ffc14798: 4b ff 15 45 bl ffc05cdc */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); ffc1479c: 7f 83 e3 78 mr r3,r28 ffc147a0: 4b ff 68 ad bl ffc0b04c <_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 ) ffc147a4: 2f 83 00 00 cmpwi cr7,r3,0 ffc147a8: 40 9e ff f0 bne+ cr7,ffc14798 rc = fat_sync(fs_info); if ( rc != RC_OK ) rc = -1; for (i = 0; i < FAT_HASH_SIZE; i++) ffc147ac: 2f 9e 00 0c cmpwi cr7,r30,12 ffc147b0: 3b de 00 0c addi r30,r30,12 ffc147b4: 40 be ff d8 bne- cr7,ffc1478c ffc147b8: 3b c0 00 00 li r30,0 } for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; ffc147bc: 83 9f 00 70 lwz r28,112(r31) ffc147c0: 7f 9c f2 14 add r28,r28,r30 while ( (node = rtems_chain_get(the_chain)) != NULL ) ffc147c4: 48 00 00 08 b ffc147cc free(node); ffc147c8: 4b ff 15 15 bl ffc05cdc <== NOT EXECUTED ffc147cc: 7f 83 e3 78 mr r3,r28 ffc147d0: 4b ff 68 7d bl ffc0b04c <_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 ) ffc147d4: 2f 83 00 00 cmpwi cr7,r3,0 ffc147d8: 40 9e ff f0 bne+ cr7,ffc147c8 <== NEVER TAKEN while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } for (i = 0; i < FAT_HASH_SIZE; i++) ffc147dc: 2f 9e 00 0c cmpwi cr7,r30,12 ffc147e0: 3b de 00 0c addi r30,r30,12 ffc147e4: 40 be ff d8 bne- cr7,ffc147bc while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } free(fs_info->vhash); ffc147e8: 80 7f 00 6c lwz r3,108(r31) ffc147ec: 4b ff 14 f1 bl ffc05cdc free(fs_info->rhash); ffc147f0: 80 7f 00 70 lwz r3,112(r31) ffc147f4: 4b ff 14 e9 bl ffc05cdc free(fs_info->uino); ffc147f8: 80 7f 00 74 lwz r3,116(r31) ffc147fc: 4b ff 14 e1 bl ffc05cdc free(fs_info->sec_buf); ffc14800: 80 7f 00 90 lwz r3,144(r31) ffc14804: 4b ff 14 d9 bl ffc05cdc close(fs_info->vol.fd); ffc14808: 80 7f 00 60 lwz r3,96(r31) ffc1480c: 4b ff 14 49 bl ffc05c54 if (rc) ffc14810: 2f 9d 00 00 cmpwi cr7,r29,0 ffc14814: 41 be 00 10 beq+ cr7,ffc14824 <== ALWAYS TAKEN errno = EIO; ffc14818: 48 00 6b 5d bl ffc1b374 <__errno> <== NOT EXECUTED ffc1481c: 39 20 00 05 li r9,5 <== NOT EXECUTED ffc14820: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED return rc; } ffc14824: 39 61 00 18 addi r11,r1,24 ffc14828: 7f a3 eb 78 mr r3,r29 ffc1482c: 4b fe cd c4 b ffc015f0 <_restgpr_28_x> =============================================================================== ffc14668 : return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { ffc14668: 94 21 ff d8 stwu r1,-40(r1) ffc1466c: 7c 08 02 a6 mflr r0 ffc14670: bf a1 00 1c stmw r29,28(r1) ffc14674: 7c 7f 1b 78 mr r31,r3 ffc14678: 90 01 00 2c stw r0,44(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) ffc1467c: 89 23 00 0e lbz r9,14(r3) ffc14680: 2f 89 00 04 cmpwi cr7,r9,4 ffc14684: 41 9e 00 0c beq- cr7,ffc14690 * 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; ffc14688: 3b c0 00 00 li r30,0 ffc1468c: 48 00 00 a0 b ffc1472c if (fs_info->vol.type == FAT_FAT32) { uint32_t free_count = fs_info->vol.free_cls; ffc14690: 81 23 00 44 lwz r9,68(r3) * 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; ffc14694: 3b c0 00 00 li r30,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; if (free_count != fs_info->vol.free_cls_in_fs_info) ffc14698: 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; ffc1469c: 83 a3 00 4c lwz r29,76(r3) if (free_count != fs_info->vol.free_cls_in_fs_info) ffc146a0: 7f 89 50 00 cmpw cr7,r9,r10 ffc146a4: 41 9e 00 34 beq- cr7,ffc146d8 <== ALWAYS TAKEN uint32_t value ) { uint32_t swapped; __asm__ volatile("rlwimi %0,%1,8,24,31;" ffc146a8: 51 2a 46 3e rlwimi r10,r9,8,24,31 <== NOT EXECUTED ffc146ac: 51 2a c4 2e rlwimi r10,r9,24,16,23 <== NOT EXECUTED ffc146b0: 51 2a 42 1e rlwimi r10,r9,8,8,15 <== NOT EXECUTED ffc146b4: 51 2a c0 0e rlwimi r10,r9,24,0,7 <== NOT EXECUTED { uint32_t le_free_count = CT_LE_L(free_count); ffc146b8: 7c 27 0b 78 mr r7,r1 <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; ffc146bc: 91 23 00 48 stw r9,72(r3) <== NOT EXECUTED ret1 = fat_sector_write(fs_info, ffc146c0: 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); ffc146c4: 95 47 00 08 stwu r10,8(r7) <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; ret1 = fat_sector_write(fs_info, ffc146c8: 38 c0 00 04 li r6,4 <== NOT EXECUTED ffc146cc: a0 83 00 40 lhz r4,64(r3) <== NOT EXECUTED ffc146d0: 4b ff f5 65 bl ffc13c34 <== NOT EXECUTED ffc146d4: 7c 7e 1b 78 mr r30,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) ffc146d8: 81 3f 00 50 lwz r9,80(r31) ffc146dc: 7f 9d 48 00 cmpw cr7,r29,r9 ffc146e0: 41 9e 00 6c beq- cr7,ffc1474c <== NEVER TAKEN ffc146e4: 53 a9 46 3e rlwimi r9,r29,8,24,31 ffc146e8: 53 a9 c4 2e rlwimi r9,r29,24,16,23 ffc146ec: 53 a9 42 1e rlwimi r9,r29,8,8,15 ffc146f0: 53 a9 c0 0e rlwimi r9,r29,24,0,7 { uint32_t le_next_free = CT_LE_L(next_free); ffc146f4: 7c 27 0b 78 mr r7,r1 fs_info->vol.next_cl_in_fs_info = next_free; ffc146f8: 93 bf 00 50 stw r29,80(r31) ret2 = fat_sector_write(fs_info, ffc146fc: 7f e3 fb 78 mr r3,r31 &le_free_count); } if (next_free != fs_info->vol.next_cl_in_fs_info) { uint32_t le_next_free = CT_LE_L(next_free); ffc14700: 95 27 00 08 stwu r9,8(r7) fs_info->vol.next_cl_in_fs_info = next_free; ret2 = fat_sector_write(fs_info, ffc14704: 38 a0 01 ec li r5,492 ffc14708: 38 c0 00 04 li r6,4 ffc1470c: a0 9f 00 40 lhz r4,64(r31) ffc14710: 4b ff f5 25 bl ffc13c34 sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) ffc14714: 2f 9e 00 00 cmpwi cr7,r30,0 ffc14718: 40 bc 00 0c bge+ cr7,ffc14724 <== ALWAYS TAKEN { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; ffc1471c: 3b c0 ff ff li r30,-1 <== NOT EXECUTED ffc14720: 48 00 00 0c b ffc1472c <== NOT EXECUTED sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) ffc14724: 2f 83 00 00 cmpwi cr7,r3,0 ffc14728: 48 00 00 28 b ffc14750 rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; fat_buf_release(fs_info); ffc1472c: 7f e3 fb 78 mr r3,r31 ffc14730: 4b ff f1 e1 bl ffc13910 if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) ffc14734: 80 7f 00 64 lwz r3,100(r31) ffc14738: 4b ff d5 31 bl ffc11c68 ffc1473c: 2f 83 00 00 cmpwi cr7,r3,0 ffc14740: 41 be 00 18 beq+ cr7,ffc14758 <== ALWAYS TAKEN rc = -1; ffc14744: 3b c0 ff ff li r30,-1 <== NOT EXECUTED ffc14748: 48 00 00 10 b ffc14758 <== NOT EXECUTED sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) ffc1474c: 2f 9e 00 00 cmpwi cr7,r30,0 <== NOT EXECUTED ffc14750: 40 9c ff 38 bge+ cr7,ffc14688 <== ALWAYS TAKEN ffc14754: 4b ff ff c8 b ffc1471c <== NOT EXECUTED if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) rc = -1; return rc; } ffc14758: 39 61 00 28 addi r11,r1,40 ffc1475c: 7f c3 f3 78 mr r3,r30 ffc14760: 4b fe ce 94 b ffc015f4 <_restgpr_29_x> =============================================================================== ffc33128 : /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { ffc33128: 94 21 ff 88 stwu r1,-120(r1) int rv = 0; rtems_libio_t *iop; struct stat st; rtems_filesystem_location_info_t loc; st.st_mode = 0; ffc3312c: 39 20 00 00 li r9,0 /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { ffc33130: 7c 08 02 a6 mflr r0 int rv = 0; rtems_libio_t *iop; struct stat st; rtems_filesystem_location_info_t loc; st.st_mode = 0; ffc33134: 91 21 00 14 stw r9,20(r1) st.st_uid = 0; ffc33138: b1 21 00 1a sth r9,26(r1) st.st_gid = 0; ffc3313c: b1 21 00 1c sth r9,28(r1) rtems_libio_check_fd( fd ); ffc33140: 3d 20 00 00 lis r9,0 ffc33144: 81 29 33 78 lwz r9,13176(r9) /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { ffc33148: 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 ); ffc3314c: 7f 83 48 40 cmplw cr7,r3,r9 /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { ffc33150: bf a1 00 6c stmw r29,108(r1) st.st_mode = 0; st.st_uid = 0; st.st_gid = 0; rtems_libio_check_fd( fd ); ffc33154: 41 bc 00 08 blt+ cr7,ffc3315c ffc33158: 48 00 00 20 b ffc33178 iop = rtems_libio_iop( fd ); ffc3315c: 3d 20 00 00 lis r9,0 ffc33160: 83 c9 34 64 lwz r30,13412(r9) ffc33164: 1c 63 00 38 mulli r3,r3,56 ffc33168: 7f de 1a 14 add r30,r30,r3 rtems_libio_check_is_open( iop ); ffc3316c: 81 3e 00 10 lwz r9,16(r30) ffc33170: 71 2a 01 00 andi. r10,r9,256 ffc33174: 40 a2 00 18 bne+ ffc3318c ffc33178: 48 00 45 81 bl ffc376f8 <__errno> ffc3317c: 39 20 00 09 li r9,9 ffc33180: 91 23 00 00 stw r9,0(r3) ffc33184: 3b e0 ff ff li r31,-1 ffc33188: 48 00 00 a0 b ffc33228 if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } ffc3318c: 80 7e 00 28 lwz r3,40(r30) 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 ); ffc33190: 3b be 00 14 addi r29,r30,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 ); ffc33194: 81 23 00 0c lwz r9,12(r3) ffc33198: 81 29 00 00 lwz r9,0(r9) ffc3319c: 7d 29 03 a6 mtctr r9 ffc331a0: 4e 80 04 21 bctrl ffc331a4: 81 3e 00 24 lwz r9,36(r30) ffc331a8: 7f a3 eb 78 mr r3,r29 ffc331ac: 81 29 00 18 lwz r9,24(r9) ffc331b0: 38 81 00 08 addi r4,r1,8 ffc331b4: 7d 29 03 a6 mtctr r9 ffc331b8: 4e 80 04 21 bctrl if ( rv == 0 ) { ffc331bc: 7c 7f 1b 79 mr. r31,r3 ffc331c0: 40 a2 00 40 bne+ ffc33200 <== NEVER TAKEN bool access_ok = rtems_filesystem_check_access( ffc331c4: 80 81 00 14 lwz r4,20(r1) ffc331c8: 38 60 00 01 li r3,1 ffc331cc: a0 a1 00 1a lhz r5,26(r1) ffc331d0: a0 c1 00 1c lhz r6,28(r1) ffc331d4: 4b fd c0 09 bl ffc0f1dc st.st_mode, st.st_uid, st.st_gid ); if ( access_ok ) { ffc331d8: 2f 83 00 00 cmpwi cr7,r3,0 ffc331dc: 41 9e 00 14 beq- cr7,ffc331f0 rtems_filesystem_location_clone( &loc, &iop->pathinfo ); ffc331e0: 38 61 00 50 addi r3,r1,80 ffc331e4: 7f a4 eb 78 mr r4,r29 ffc331e8: 4b fd b9 2d bl ffc0eb14 ffc331ec: 48 00 00 14 b ffc33200 } else { errno = EACCES; ffc331f0: 48 00 45 09 bl ffc376f8 <__errno> ffc331f4: 39 20 00 0d li r9,13 ffc331f8: 91 23 00 00 stw r9,0(r3) rv = -1; ffc331fc: 3b e0 ff ff li r31,-1 if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } ffc33200: 80 7e 00 28 lwz r3,40(r30) 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 ); ffc33204: 81 23 00 0c lwz r9,12(r3) ffc33208: 81 29 00 04 lwz r9,4(r9) ffc3320c: 7d 29 03 a6 mtctr r9 ffc33210: 4e 80 04 21 bctrl rv = -1; } } rtems_filesystem_instance_unlock( &iop->pathinfo ); if ( rv == 0 ) { ffc33214: 2f 9f 00 00 cmpwi cr7,r31,0 ffc33218: 40 be 00 10 bne+ cr7,ffc33228 rv = rtems_filesystem_chdir( &loc ); ffc3321c: 38 61 00 50 addi r3,r1,80 ffc33220: 4b ff 0d ad bl ffc23fcc ffc33224: 7c 7f 1b 78 mr r31,r3 } return rv; } ffc33228: 39 61 00 78 addi r11,r1,120 ffc3322c: 7f e3 fb 78 mr r3,r31 ffc33230: 48 02 05 c4 b ffc537f4 <_restgpr_29_x> =============================================================================== ffc245f8 : int fchmod( int fd, mode_t mode ) { int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc245f8: 3d 20 00 00 lis r9,0 /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { ffc245fc: 94 21 ff e8 stwu r1,-24(r1) ffc24600: 7c 08 02 a6 mflr r0 int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc24604: 81 29 33 78 lwz r9,13176(r9) /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { ffc24608: 90 01 00 1c stw r0,28(r1) int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc2460c: 7f 83 48 40 cmplw cr7,r3,r9 /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { ffc24610: bf c1 00 10 stmw r30,16(r1) int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc24614: 41 bc 00 08 blt+ cr7,ffc2461c ffc24618: 48 00 00 20 b ffc24638 iop = rtems_libio_iop( fd ); ffc2461c: 3d 20 00 00 lis r9,0 ffc24620: 83 e9 34 64 lwz r31,13412(r9) ffc24624: 1c 63 00 38 mulli r3,r3,56 ffc24628: 7f ff 1a 14 add r31,r31,r3 rtems_libio_check_is_open(iop); ffc2462c: 81 3f 00 10 lwz r9,16(r31) ffc24630: 71 2a 01 00 andi. r10,r9,256 ffc24634: 40 a2 00 10 bne+ ffc24644 ffc24638: 48 01 30 c1 bl ffc376f8 <__errno> ffc2463c: 39 20 00 09 li r9,9 ffc24640: 48 00 00 68 b ffc246a8 if (iop->pathinfo.mt_entry->writeable) { ffc24644: 80 7f 00 28 lwz r3,40(r31) ffc24648: 89 23 00 29 lbz r9,41(r3) ffc2464c: 2f 89 00 00 cmpwi cr7,r9,0 ffc24650: 41 9e 00 50 beq- cr7,ffc246a0 <== NEVER TAKEN 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 ); ffc24654: 81 23 00 0c lwz r9,12(r3) ffc24658: 81 29 00 00 lwz r9,0(r9) ffc2465c: 90 81 00 08 stw r4,8(r1) ffc24660: 7d 29 03 a6 mtctr r9 ffc24664: 4e 80 04 21 bctrl rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); ffc24668: 81 3f 00 28 lwz r9,40(r31) ffc2466c: 38 7f 00 14 addi r3,r31,20 ffc24670: 80 81 00 08 lwz r4,8(r1) ffc24674: 81 29 00 0c lwz r9,12(r9) ffc24678: 81 29 00 20 lwz r9,32(r9) ffc2467c: 7d 29 03 a6 mtctr r9 ffc24680: 4e 80 04 21 bctrl ffc24684: 7c 7e 1b 78 mr r30,r3 errno = EROFS; rv = -1; } return rv; } ffc24688: 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 ); ffc2468c: 81 23 00 0c lwz r9,12(r3) ffc24690: 81 29 00 04 lwz r9,4(r9) ffc24694: 7d 29 03 a6 mtctr r9 ffc24698: 4e 80 04 21 bctrl ffc2469c: 48 00 00 14 b ffc246b0 if (iop->pathinfo.mt_entry->writeable) { 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; ffc246a0: 48 01 30 59 bl ffc376f8 <__errno> <== NOT EXECUTED ffc246a4: 39 20 00 1e li r9,30 <== NOT EXECUTED ffc246a8: 91 23 00 00 stw r9,0(r3) rv = -1; ffc246ac: 3b c0 ff ff li r30,-1 } return rv; } ffc246b0: 39 61 00 18 addi r11,r1,24 ffc246b4: 7f c3 f3 78 mr r3,r30 ffc246b8: 48 02 f1 40 b ffc537f8 <_restgpr_30_x> =============================================================================== ffc246bc : int fchown( int fd, uid_t owner, gid_t group ) { int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc246bc: 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 ) { ffc246c0: 94 21 ff e8 stwu r1,-24(r1) ffc246c4: 7c 08 02 a6 mflr r0 int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc246c8: 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 ) { ffc246cc: 90 01 00 1c stw r0,28(r1) int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc246d0: 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 ) { ffc246d4: bf c1 00 10 stmw r30,16(r1) int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc246d8: 41 bc 00 08 blt+ cr7,ffc246e0 ffc246dc: 48 00 00 20 b ffc246fc iop = rtems_libio_iop( fd ); ffc246e0: 3d 20 00 00 lis r9,0 ffc246e4: 83 e9 34 64 lwz r31,13412(r9) ffc246e8: 1c 63 00 38 mulli r3,r3,56 ffc246ec: 7f ff 1a 14 add r31,r31,r3 rtems_libio_check_is_open(iop); ffc246f0: 81 3f 00 10 lwz r9,16(r31) ffc246f4: 71 2a 01 00 andi. r10,r9,256 ffc246f8: 40 a2 00 10 bne+ ffc24708 ffc246fc: 48 01 2f fd bl ffc376f8 <__errno> ffc24700: 39 20 00 09 li r9,9 ffc24704: 48 00 00 70 b ffc24774 if (iop->pathinfo.mt_entry->writeable) { ffc24708: 80 7f 00 28 lwz r3,40(r31) ffc2470c: 89 23 00 29 lbz r9,41(r3) ffc24710: 2f 89 00 00 cmpwi cr7,r9,0 ffc24714: 41 9e 00 58 beq- cr7,ffc2476c <== NEVER TAKEN 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 ); ffc24718: 81 23 00 0c lwz r9,12(r3) ffc2471c: 81 29 00 00 lwz r9,0(r9) ffc24720: 90 81 00 08 stw r4,8(r1) ffc24724: 7d 29 03 a6 mtctr r9 ffc24728: 90 a1 00 0c stw r5,12(r1) ffc2472c: 4e 80 04 21 bctrl rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->chown_h)( ffc24730: 81 3f 00 28 lwz r9,40(r31) ffc24734: 38 7f 00 14 addi r3,r31,20 ffc24738: 80 81 00 08 lwz r4,8(r1) ffc2473c: 81 29 00 0c lwz r9,12(r9) ffc24740: 80 a1 00 0c lwz r5,12(r1) ffc24744: 81 29 00 24 lwz r9,36(r9) ffc24748: 7d 29 03 a6 mtctr r9 ffc2474c: 4e 80 04 21 bctrl ffc24750: 7c 7e 1b 78 mr r30,r3 errno = EROFS; rv = -1; } return rv; } ffc24754: 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 ); ffc24758: 81 23 00 0c lwz r9,12(r3) ffc2475c: 81 29 00 04 lwz r9,4(r9) ffc24760: 7d 29 03 a6 mtctr r9 ffc24764: 4e 80 04 21 bctrl ffc24768: 48 00 00 14 b ffc2477c owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; ffc2476c: 48 01 2f 8d bl ffc376f8 <__errno> <== NOT EXECUTED ffc24770: 39 20 00 1e li r9,30 <== NOT EXECUTED ffc24774: 91 23 00 00 stw r9,0(r3) rv = -1; ffc24778: 3b c0 ff ff li r30,-1 } return rv; } ffc2477c: 39 61 00 18 addi r11,r1,24 ffc24780: 7f c3 f3 78 mr r3,r30 ffc24784: 48 02 f0 74 b ffc537f8 <_restgpr_30_x> =============================================================================== ffc30f48 : int fcntl( int fd, int cmd, ... ) { ffc30f48: 94 21 ff c0 stwu r1,-64(r1) int ret; va_list ap; va_start( ap, cmd ); ffc30f4c: 39 20 00 02 li r9,2 int fcntl( int fd, int cmd, ... ) { ffc30f50: 7c 08 02 a6 mflr r0 int ret; va_list ap; va_start( ap, cmd ); ffc30f54: 99 21 00 08 stb r9,8(r1) ffc30f58: 39 21 00 48 addi r9,r1,72 ffc30f5c: 91 21 00 0c stw r9,12(r1) ffc30f60: 39 21 00 10 addi r9,r1,16 ffc30f64: 91 21 00 10 stw r9,16(r1) int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); ffc30f68: 3d 20 00 00 lis r9,0 ffc30f6c: 81 29 27 78 lwz r9,10104(r9) int fcntl( int fd, int cmd, ... ) { ffc30f70: 90 01 00 44 stw r0,68(r1) int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); ffc30f74: 7f 83 48 40 cmplw cr7,r3,r9 int fcntl( int fd, int cmd, ... ) { ffc30f78: bf 61 00 2c stmw r27,44(r1) ffc30f7c: 90 a1 00 18 stw r5,24(r1) ffc30f80: 90 c1 00 1c stw r6,28(r1) ffc30f84: 90 e1 00 20 stw r7,32(r1) int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); ffc30f88: 41 bc 00 08 blt+ cr7,ffc30f90 ffc30f8c: 48 00 00 20 b ffc30fac iop = rtems_libio_iop( fd ); ffc30f90: 3d 20 00 00 lis r9,0 ffc30f94: 1c 63 00 38 mulli r3,r3,56 ffc30f98: 83 c9 28 24 lwz r30,10276(r9) ffc30f9c: 7f de 1a 14 add r30,r30,r3 rtems_libio_check_is_open(iop); ffc30fa0: 80 7e 00 10 lwz r3,16(r30) ffc30fa4: 70 69 01 00 andi. r9,r3,256 ffc30fa8: 40 a2 00 10 bne+ ffc30fb8 ffc30fac: 4b ff 02 21 bl ffc211cc <__errno> ffc30fb0: 39 20 00 09 li r9,9 ffc30fb4: 48 00 01 d4 b ffc31188 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { ffc30fb8: 2b 84 00 09 cmplwi cr7,r4,9 ffc30fbc: 7c 9c 23 78 mr r28,r4 ffc30fc0: 41 9d 01 c0 bgt- cr7,ffc31180 ffc30fc4: 3d 20 ff c3 lis r9,-61 ffc30fc8: 39 29 70 30 addi r9,r9,28720 ffc30fcc: 54 8a 10 3a rlwinm r10,r4,2,0,29 ffc30fd0: 7d 49 50 2e lwzx r10,r9,r10 ffc30fd4: 7d 2a 4a 14 add r9,r10,r9 ffc30fd8: 7d 29 03 a6 mtctr r9 ffc30fdc: 4e 80 04 20 bctr case F_DUPFD: /* dup */ fd2 = va_arg( ap, int ); ffc30fe0: 89 21 00 08 lbz r9,8(r1) ffc30fe4: 2b 89 00 07 cmplwi cr7,r9,7 ffc30fe8: 41 9d 00 10 bgt- cr7,ffc30ff8 <== NEVER TAKEN ffc30fec: 39 29 00 01 addi r9,r9,1 ffc30ff0: 99 21 00 08 stb r9,8(r1) ffc30ff4: 48 00 00 10 b ffc31004 ffc30ff8: 81 21 00 0c lwz r9,12(r1) <== NOT EXECUTED ffc30ffc: 39 29 00 04 addi r9,r9,4 <== NOT EXECUTED ffc31000: 91 21 00 0c stw r9,12(r1) <== NOT EXECUTED /* * FIXME: We ignore the start value fd2 for the file descriptor search. This * is not POSIX conform. */ rtems_libio_t *diop = rtems_libio_allocate(); ffc31004: 4b fd 7f 31 bl ffc08f34 if (diop != NULL) { ffc31008: 7c 7d 1b 79 mr. r29,r3 ffc3100c: 41 82 01 b4 beq- ffc311c0 int oflag = rtems_libio_to_fcntl_flags( iop->flags ); ffc31010: 80 7e 00 10 lwz r3,16(r30) ffc31014: 4b fd 7e d5 bl ffc08ee8 oflag &= ~O_CREAT; diop->flags |= rtems_libio_fcntl_flags( oflag ); ffc31018: 83 7d 00 10 lwz r27,16(r29) rtems_libio_t *diop = rtems_libio_allocate(); if (diop != NULL) { int oflag = rtems_libio_to_fcntl_flags( iop->flags ); oflag &= ~O_CREAT; ffc3101c: 54 7f 05 ea rlwinm r31,r3,0,23,21 diop->flags |= rtems_libio_fcntl_flags( oflag ); ffc31020: 7f e3 fb 78 mr r3,r31 ffc31024: 4b fd 7e 81 bl ffc08ea4 ffc31028: 7c 63 db 78 or r3,r3,r27 ffc3102c: 90 7d 00 10 stw r3,16(r29) int cmd, int arg ) { return fcntl( fd, cmd, arg ); } ffc31030: 80 7e 00 28 lwz r3,40(r30) 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 ); ffc31034: 81 23 00 0c lwz r9,12(r3) ffc31038: 81 29 00 00 lwz r9,0(r9) ffc3103c: 7d 29 03 a6 mtctr r9 ffc31040: 4e 80 04 21 bctrl oflag &= ~O_CREAT; diop->flags |= rtems_libio_fcntl_flags( oflag ); rtems_filesystem_instance_lock( &iop->pathinfo ); rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo ); ffc31044: 38 9e 00 14 addi r4,r30,20 ffc31048: 38 7d 00 14 addi r3,r29,20 ffc3104c: 4b fe 68 89 bl ffc178d4 int cmd, int arg ) { return fcntl( fd, cmd, arg ); } ffc31050: 80 7e 00 28 lwz r3,40(r30) 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 ); ffc31054: 81 23 00 0c lwz r9,12(r3) ffc31058: 81 29 00 04 lwz r9,4(r9) ffc3105c: 7d 29 03 a6 mtctr r9 ffc31060: 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 ); ffc31064: 81 3d 00 24 lwz r9,36(r29) ffc31068: 7f e5 fb 78 mr r5,r31 ffc3106c: 81 29 00 00 lwz r9,0(r9) ffc31070: 7f a3 eb 78 mr r3,r29 ffc31074: 38 80 00 00 li r4,0 ffc31078: 38 c0 00 00 li r6,0 ffc3107c: 7d 29 03 a6 mtctr r9 ffc31080: 4e 80 04 21 bctrl if ( rv == 0 ) { ffc31084: 7c 7f 1b 79 mr. r31,r3 ffc31088: 40 82 00 24 bne- ffc310ac <== NEVER TAKEN rv = diop - rtems_libio_iops; ffc3108c: 3d 20 00 00 lis r9,0 ffc31090: 83 e9 28 24 lwz r31,10276(r9) ffc31094: 3d 20 b6 db lis r9,-18725 ffc31098: 61 29 6d b7 ori r9,r9,28087 ffc3109c: 7f ff e8 50 subf r31,r31,r29 ffc310a0: 7f ff 1e 70 srawi r31,r31,3 ffc310a4: 7f ff 49 d6 mullw r31,r31,r9 ffc310a8: 48 00 00 e8 b ffc31190 } else { rtems_libio_free( diop ); ffc310ac: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED ffc310b0: 4b fd 7e f5 bl ffc08fa4 <== NOT EXECUTED ffc310b4: 48 00 00 dc b ffc31190 <== NOT EXECUTED fd2 = va_arg( ap, int ); ret = duplicate_iop( iop, fd2 ); break; case F_GETFD: /* get f_flags */ ret = ((iop->flags & LIBIO_FLAGS_CLOSE_ON_EXEC) != 0); ffc310b8: 54 7f af fe rlwinm r31,r3,21,31,31 ffc310bc: 48 00 00 dc b ffc31198 * 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 ) ) ffc310c0: 89 41 00 08 lbz r10,8(r1) ffc310c4: 2b 8a 00 07 cmplwi cr7,r10,7 ffc310c8: 41 9d 00 1c bgt- cr7,ffc310e4 <== NEVER TAKEN ffc310cc: 81 21 00 10 lwz r9,16(r1) ffc310d0: 55 48 10 3a rlwinm r8,r10,2,0,29 ffc310d4: 39 4a 00 01 addi r10,r10,1 ffc310d8: 7d 29 42 14 add r9,r9,r8 ffc310dc: 99 41 00 08 stb r10,8(r1) ffc310e0: 48 00 00 10 b ffc310f0 ffc310e4: 81 21 00 0c lwz r9,12(r1) <== NOT EXECUTED ffc310e8: 39 49 00 04 addi r10,r9,4 <== NOT EXECUTED ffc310ec: 91 41 00 0c stw r10,12(r1) <== NOT EXECUTED ffc310f0: 81 29 00 00 lwz r9,0(r9) ffc310f4: 2f 89 00 00 cmpwi cr7,r9,0 ffc310f8: 41 9e 00 0c beq- cr7,ffc31104 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; ffc310fc: 60 63 08 00 ori r3,r3,2048 ffc31100: 48 00 00 08 b ffc31108 else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; ffc31104: 54 63 05 66 rlwinm r3,r3,0,21,19 ffc31108: 90 7e 00 10 stw r3,16(r30) ffc3110c: 48 00 00 60 b ffc3116c break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); ffc31110: 4b fd 7d d9 bl ffc08ee8 ffc31114: 7c 7f 1b 78 mr r31,r3 ffc31118: 48 00 00 78 b ffc31190 break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); ffc3111c: 89 41 00 08 lbz r10,8(r1) ffc31120: 2b 8a 00 07 cmplwi cr7,r10,7 ffc31124: 41 9d 00 1c bgt- cr7,ffc31140 <== NEVER TAKEN ffc31128: 81 21 00 10 lwz r9,16(r1) ffc3112c: 55 48 10 3a rlwinm r8,r10,2,0,29 ffc31130: 39 4a 00 01 addi r10,r10,1 ffc31134: 7d 29 42 14 add r9,r9,r8 ffc31138: 99 41 00 08 stb r10,8(r1) ffc3113c: 48 00 00 10 b ffc3114c ffc31140: 81 21 00 0c lwz r9,12(r1) <== NOT EXECUTED ffc31144: 39 49 00 04 addi r10,r9,4 <== NOT EXECUTED ffc31148: 91 41 00 0c stw r10,12(r1) <== NOT EXECUTED ffc3114c: 80 69 00 00 lwz r3,0(r9) ffc31150: 4b fd 7d 55 bl ffc08ea4 /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); ffc31154: 81 3e 00 10 lwz r9,16(r30) ffc31158: 70 63 02 01 andi. r3,r3,513 ffc3115c: 39 40 fd fe li r10,-514 ffc31160: 7d 49 48 38 and r9,r10,r9 ffc31164: 7c 69 4b 78 or r9,r3,r9 ffc31168: 91 3e 00 10 stw r9,16(r30) { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; ffc3116c: 3b e0 00 00 li r31,0 ffc31170: 48 00 00 28 b ffc31198 errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; ffc31174: 4b ff 00 59 bl ffc211cc <__errno> ffc31178: 39 20 00 86 li r9,134 ffc3117c: 48 00 00 0c b ffc31188 ret = -1; break; default: errno = EINVAL; ffc31180: 4b ff 00 4d bl ffc211cc <__errno> ffc31184: 39 20 00 16 li r9,22 ffc31188: 91 23 00 00 stw r9,0(r3) ffc3118c: 48 00 00 34 b ffc311c0 /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { ffc31190: 2f 9f 00 00 cmpwi cr7,r31,0 ffc31194: 41 9c 00 30 blt- cr7,ffc311c4 <== NEVER TAKEN int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); ffc31198: 81 3e 00 24 lwz r9,36(r30) ffc3119c: 7f c3 f3 78 mr r3,r30 ffc311a0: 7f 84 e3 78 mr r4,r28 ffc311a4: 81 29 00 28 lwz r9,40(r9) ffc311a8: 7d 29 03 a6 mtctr r9 ffc311ac: 4e 80 04 21 bctrl if (err) { ffc311b0: 7c 7e 1b 79 mr. r30,r3 ffc311b4: 41 a2 00 10 beq+ ffc311c4 <== ALWAYS TAKEN errno = err; ffc311b8: 4b ff 00 15 bl ffc211cc <__errno> <== NOT EXECUTED ffc311bc: 93 c3 00 00 stw r30,0(r3) <== NOT EXECUTED int mask; int ret = 0; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); ffc311c0: 3b e0 ff ff li r31,-1 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } ffc311c4: 39 61 00 40 addi r11,r1,64 ffc311c8: 7f e3 fb 78 mr r3,r31 ffc311cc: 4b fd 03 90 b ffc0155c <_restgpr_27_x> =============================================================================== ffc0e8d0 : int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { ffc0e8d0: 94 21 ff d0 stwu r1,-48(r1) ffc0e8d4: 7c 08 02 a6 mflr r0 ffc0e8d8: bf 61 00 1c stmw r27,28(r1) static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { ffc0e8dc: 3f e0 00 00 lis r31,0 int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { ffc0e8e0: 7c 7d 1b 78 mr r29,r3 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { ffc0e8e4: 81 3f 29 a4 lwz r9,10660(r31) int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { ffc0e8e8: 7c 9c 23 78 mr r28,r4 ffc0e8ec: 90 01 00 34 stw r0,52(r1) static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { ffc0e8f0: 3b df 29 a4 addi r30,r31,10660 ffc0e8f4: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e8f8: 41 9e 00 24 beq- cr7,ffc0e91c rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); ffc0e8fc: 3d 20 00 00 lis r9,0 ffc0e900: 80 69 29 a4 lwz r3,10660(r9) ffc0e904: 38 80 00 00 li r4,0 ffc0e908: 38 a0 00 00 li r5,0 ffc0e90c: 4b ff b5 25 bl ffc09e30 } if (sc == RTEMS_SUCCESSFUL) { ffc0e910: 2f 83 00 00 cmpwi cr7,r3,0 ffc0e914: 41 be 03 68 beq+ cr7,ffc0ec7c <== ALWAYS TAKEN ffc0e918: 48 00 00 5c b ffc0e974 <== NOT EXECUTED */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); ffc0e91c: 3d 20 00 00 lis r9,0 ffc0e920: 80 69 27 ec lwz r3,10220(r9) ffc0e924: 38 80 00 00 li r4,0 ffc0e928: 38 a0 00 00 li r5,0 ffc0e92c: 4b ff b5 05 bl ffc09e30 rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { ffc0e930: 81 3f 29 a4 lwz r9,10660(r31) free(pipe); } static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; ffc0e934: 3b e0 00 00 li r31,0 if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { ffc0e938: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e93c: 40 be 00 24 bne+ cr7,ffc0e960 <== NEVER TAKEN sc = rtems_semaphore_create( ffc0e940: 3c 60 50 49 lis r3,20553 ffc0e944: 60 63 50 45 ori r3,r3,20549 ffc0e948: 38 80 00 01 li r4,1 ffc0e94c: 38 a0 00 54 li r5,84 ffc0e950: 38 c0 00 00 li r6,0 ffc0e954: 7f c7 f3 78 mr r7,r30 ffc0e958: 4b ff b2 55 bl ffc09bac ffc0e95c: 7c 7f 1b 78 mr r31,r3 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); ffc0e960: 3d 20 00 00 lis r9,0 ffc0e964: 80 69 27 ec lwz r3,10220(r9) ffc0e968: 4b ff b5 ed bl ffc09f54 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { ffc0e96c: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0e970: 41 be ff 8c beq- cr7,ffc0e8fc } if (sc == RTEMS_SUCCESSFUL) { return 0; } else { return -ENOMEM; ffc0e974: 3b c0 ff f4 li r30,-12 ffc0e978: 48 00 03 28 b ffc0eca0 { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); ffc0e97c: 38 60 00 34 li r3,52 ffc0e980: 4b ff 6f e1 bl ffc05960 if (pipe == NULL) ffc0e984: 7c 7f 1b 79 mr. r31,r3 ffc0e988: 41 82 03 04 beq- ffc0ec8c <== NEVER TAKEN return err; memset(pipe, 0, sizeof(pipe_control_t)); ffc0e98c: 38 80 00 00 li r4,0 ffc0e990: 38 a0 00 34 li r5,52 ffc0e994: 48 00 3c 09 bl ffc1259c pipe->Size = PIPE_BUF; ffc0e998: 39 20 02 00 li r9,512 ffc0e99c: 91 3f 00 04 stw r9,4(r31) pipe->Buffer = malloc(pipe->Size); ffc0e9a0: 38 60 02 00 li r3,512 ffc0e9a4: 4b ff 6f bd bl ffc05960 if (! pipe->Buffer) ffc0e9a8: 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); ffc0e9ac: 90 7f 00 00 stw r3,0(r31) if (! pipe->Buffer) ffc0e9b0: 41 9e 00 a4 beq- cr7,ffc0ea54 <== NEVER TAKEN goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), ffc0e9b4: 3f c0 00 00 lis r30,0 ffc0e9b8: 88 7e 22 14 lbz r3,8724(r30) if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( ffc0e9bc: 38 80 00 00 li r4,0 ffc0e9c0: 38 a0 00 00 li r5,0 ffc0e9c4: 64 63 50 49 oris r3,r3,20553 ffc0e9c8: 60 63 72 00 ori r3,r3,29184 ffc0e9cc: 38 df 00 2c addi r6,r31,44 ffc0e9d0: 48 00 10 ad bl ffc0fa7c ffc0e9d4: 2f 83 00 00 cmpwi cr7,r3,0 ffc0e9d8: 40 9e 00 74 bne- cr7,ffc0ea4c 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), ffc0e9dc: 88 7e 22 14 lbz r3,8724(r30) 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( ffc0e9e0: 38 80 00 00 li r4,0 ffc0e9e4: 38 a0 00 00 li r5,0 ffc0e9e8: 64 63 50 49 oris r3,r3,20553 ffc0e9ec: 60 63 77 00 ori r3,r3,30464 ffc0e9f0: 38 df 00 30 addi r6,r31,48 ffc0e9f4: 48 00 10 89 bl ffc0fa7c ffc0e9f8: 2f 83 00 00 cmpwi cr7,r3,0 ffc0e9fc: 40 9e 00 48 bne- cr7,ffc0ea44 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, ffc0ea00: 88 7e 22 14 lbz r3,8724(r30) 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( ffc0ea04: 38 80 00 01 li r4,1 ffc0ea08: 38 a0 00 10 li r5,16 ffc0ea0c: 64 63 50 49 oris r3,r3,20553 ffc0ea10: 60 63 73 00 ori r3,r3,29440 ffc0ea14: 38 c0 00 00 li r6,0 ffc0ea18: 38 ff 00 28 addi r7,r31,40 ffc0ea1c: 4b ff b1 91 bl ffc09bac ffc0ea20: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ea24: 40 9e 00 18 bne- cr7,ffc0ea3c #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') ffc0ea28: 89 3e 22 14 lbz r9,8724(r30) ffc0ea2c: 2f 89 00 7a cmpwi cr7,r9,122 ffc0ea30: 40 be 02 64 bne+ cr7,ffc0ec94 c = 'a'; ffc0ea34: 39 20 00 61 li r9,97 ffc0ea38: 48 00 02 60 b ffc0ec98 return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); ffc0ea3c: 80 7f 00 30 lwz r3,48(r31) ffc0ea40: 48 00 11 09 bl ffc0fb48 err_wbar: rtems_barrier_delete(pipe->readBarrier); ffc0ea44: 80 7f 00 2c lwz r3,44(r31) ffc0ea48: 48 00 11 01 bl ffc0fb48 err_rbar: free(pipe->Buffer); ffc0ea4c: 80 7f 00 00 lwz r3,0(r31) ffc0ea50: 4b ff 6a 59 bl ffc054a8 err_buf: free(pipe); ffc0ea54: 7f e3 fb 78 mr r3,r31 ffc0ea58: 4b ff 6a 51 bl ffc054a8 ffc0ea5c: 48 00 02 30 b ffc0ec8c err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) ffc0ea60: 80 7f 00 28 lwz r3,40(r31) ffc0ea64: 38 80 00 00 li r4,0 ffc0ea68: 38 a0 00 00 li r5,0 ffc0ea6c: 4b ff b3 c5 bl ffc09e30 err = -EINTR; ffc0ea70: 3b c0 ff fc li r30,-4 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) ffc0ea74: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ea78: 40 9e 00 08 bne- cr7,ffc0ea80 <== NEVER TAKEN ffc0ea7c: 3b c0 00 00 li r30,0 err = -EINTR; if (*pipep == NULL) { ffc0ea80: 81 3d 00 00 lwz r9,0(r29) ffc0ea84: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ea88: 40 be 00 1c bne+ cr7,ffc0eaa4 if (err) ffc0ea8c: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0ea90: 41 be 00 10 beq+ cr7,ffc0eaa0 <== ALWAYS TAKEN pipe_free(pipe); ffc0ea94: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc0ea98: 4b ff fd 2d bl ffc0e7c4 <== NOT EXECUTED ffc0ea9c: 48 00 00 08 b ffc0eaa4 <== NOT EXECUTED else *pipep = pipe; ffc0eaa0: 93 fd 00 00 stw r31,0(r29) #ifdef RTEMS_DEBUG rtems_status_code sc = RTEMS_SUCCESSFUL; sc = #endif rtems_semaphore_release(pipe_semaphore); ffc0eaa4: 3d 20 00 00 lis r9,0 ffc0eaa8: 80 69 29 a4 lwz r3,10660(r9) ffc0eaac: 4b ff b4 a9 bl ffc09f54 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) ffc0eab0: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0eab4: 40 9e 01 ec bne- cr7,ffc0eca0 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { ffc0eab8: 81 3c 00 10 lwz r9,16(r28) int err; err = pipe_new(pipep); if (err) return err; pipe = *pipep; ffc0eabc: 83 fd 00 00 lwz r31,0(r29) switch (LIBIO_ACCMODE(iop)) { ffc0eac0: 55 29 07 7c rlwinm r9,r9,0,29,30 ffc0eac4: 2f 89 00 04 cmpwi cr7,r9,4 ffc0eac8: 41 9e 00 a0 beq- cr7,ffc0eb68 ffc0eacc: 2f 89 00 06 cmpwi cr7,r9,6 ffc0ead0: 41 9e 01 34 beq- cr7,ffc0ec04 ffc0ead4: 2f 89 00 02 cmpwi cr7,r9,2 ffc0ead8: 40 be 01 84 bne+ cr7,ffc0ec5c <== NEVER TAKEN case LIBIO_FLAGS_READ: pipe->readerCounter ++; ffc0eadc: 81 3f 00 20 lwz r9,32(r31) ffc0eae0: 39 29 00 01 addi r9,r9,1 ffc0eae4: 91 3f 00 20 stw r9,32(r31) if (pipe->Readers ++ == 0) ffc0eae8: 81 3f 00 10 lwz r9,16(r31) ffc0eaec: 2f 89 00 00 cmpwi cr7,r9,0 ffc0eaf0: 39 49 00 01 addi r10,r9,1 ffc0eaf4: 91 5f 00 10 stw r10,16(r31) ffc0eaf8: 40 be 00 10 bne+ cr7,ffc0eb08 <== NEVER TAKEN PIPE_WAKEUPWRITERS(pipe); ffc0eafc: 80 7f 00 30 lwz r3,48(r31) ffc0eb00: 38 81 00 08 addi r4,r1,8 ffc0eb04: 48 00 10 e5 bl ffc0fbe8 if (pipe->Writers == 0) { ffc0eb08: 81 3f 00 14 lwz r9,20(r31) ffc0eb0c: 2f 89 00 00 cmpwi cr7,r9,0 ffc0eb10: 40 9e 01 4c bne- cr7,ffc0ec5c /* Not an error */ if (LIBIO_NODELAY(iop)) ffc0eb14: 81 3c 00 10 lwz r9,16(r28) ffc0eb18: 71 2a 00 01 andi. r10,r9,1 ffc0eb1c: 40 82 01 40 bne- ffc0ec5c break; prevCounter = pipe->writerCounter; ffc0eb20: 83 7f 00 24 lwz r27,36(r31) err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); ffc0eb24: 80 7f 00 28 lwz r3,40(r31) ffc0eb28: 4b ff b4 2d bl ffc09f54 if (! PIPE_READWAIT(pipe)) ffc0eb2c: 80 7f 00 2c lwz r3,44(r31) ffc0eb30: 38 80 00 00 li r4,0 ffc0eb34: 48 00 11 25 bl ffc0fc58 ffc0eb38: 2f 83 00 00 cmpwi cr7,r3,0 ffc0eb3c: 40 9e 01 2c bne- cr7,ffc0ec68 <== NEVER TAKEN goto out_error; if (! PIPE_LOCK(pipe)) ffc0eb40: 80 7f 00 28 lwz r3,40(r31) ffc0eb44: 38 80 00 00 li r4,0 ffc0eb48: 38 a0 00 00 li r5,0 ffc0eb4c: 4b ff b2 e5 bl ffc09e30 ffc0eb50: 2f 83 00 00 cmpwi cr7,r3,0 ffc0eb54: 40 9e 01 14 bne- cr7,ffc0ec68 <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->writerCounter); ffc0eb58: 81 3f 00 24 lwz r9,36(r31) ffc0eb5c: 7f 9b 48 00 cmpw cr7,r27,r9 ffc0eb60: 41 9e ff c4 beq+ cr7,ffc0eb24 <== NEVER TAKEN ffc0eb64: 48 00 00 f8 b ffc0ec5c } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; ffc0eb68: 81 3f 00 24 lwz r9,36(r31) ffc0eb6c: 39 29 00 01 addi r9,r9,1 ffc0eb70: 91 3f 00 24 stw r9,36(r31) if (pipe->Writers ++ == 0) ffc0eb74: 81 3f 00 14 lwz r9,20(r31) ffc0eb78: 2f 89 00 00 cmpwi cr7,r9,0 ffc0eb7c: 39 49 00 01 addi r10,r9,1 ffc0eb80: 91 5f 00 14 stw r10,20(r31) ffc0eb84: 40 be 00 10 bne+ cr7,ffc0eb94 <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); ffc0eb88: 80 7f 00 2c lwz r3,44(r31) ffc0eb8c: 38 81 00 08 addi r4,r1,8 ffc0eb90: 48 00 10 59 bl ffc0fbe8 if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { ffc0eb94: 81 3f 00 10 lwz r9,16(r31) ffc0eb98: 2f 89 00 00 cmpwi cr7,r9,0 ffc0eb9c: 40 9e 00 c0 bne- cr7,ffc0ec5c ffc0eba0: 81 3c 00 10 lwz r9,16(r28) ffc0eba4: 71 2a 00 01 andi. r10,r9,1 ffc0eba8: 41 a2 00 14 beq+ ffc0ebbc PIPE_UNLOCK(pipe); ffc0ebac: 80 7f 00 28 lwz r3,40(r31) err = -ENXIO; ffc0ebb0: 3b c0 ff fa li r30,-6 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { PIPE_UNLOCK(pipe); ffc0ebb4: 4b ff b3 a1 bl ffc09f54 err = -ENXIO; goto out_error; ffc0ebb8: 48 00 00 b4 b ffc0ec6c } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; ffc0ebbc: 83 7f 00 20 lwz r27,32(r31) err = -EINTR; do { PIPE_UNLOCK(pipe); ffc0ebc0: 80 7f 00 28 lwz r3,40(r31) ffc0ebc4: 4b ff b3 91 bl ffc09f54 if (! PIPE_WRITEWAIT(pipe)) ffc0ebc8: 80 7f 00 30 lwz r3,48(r31) ffc0ebcc: 38 80 00 00 li r4,0 ffc0ebd0: 48 00 10 89 bl ffc0fc58 ffc0ebd4: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ebd8: 40 9e 00 90 bne- cr7,ffc0ec68 <== NEVER TAKEN goto out_error; if (! PIPE_LOCK(pipe)) ffc0ebdc: 80 7f 00 28 lwz r3,40(r31) ffc0ebe0: 38 80 00 00 li r4,0 ffc0ebe4: 38 a0 00 00 li r5,0 ffc0ebe8: 4b ff b2 49 bl ffc09e30 ffc0ebec: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ebf0: 40 9e 00 78 bne- cr7,ffc0ec68 <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->readerCounter); ffc0ebf4: 81 3f 00 20 lwz r9,32(r31) ffc0ebf8: 7f 9b 48 00 cmpw cr7,r27,r9 ffc0ebfc: 41 9e ff c4 beq+ cr7,ffc0ebc0 <== NEVER TAKEN ffc0ec00: 48 00 00 5c b ffc0ec5c } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; ffc0ec04: 81 3f 00 20 lwz r9,32(r31) ffc0ec08: 39 29 00 01 addi r9,r9,1 ffc0ec0c: 91 3f 00 20 stw r9,32(r31) if (pipe->Readers ++ == 0) ffc0ec10: 81 3f 00 10 lwz r9,16(r31) ffc0ec14: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ec18: 39 49 00 01 addi r10,r9,1 ffc0ec1c: 91 5f 00 10 stw r10,16(r31) ffc0ec20: 40 be 00 10 bne+ cr7,ffc0ec30 <== NEVER TAKEN PIPE_WAKEUPWRITERS(pipe); ffc0ec24: 80 7f 00 30 lwz r3,48(r31) ffc0ec28: 38 81 00 08 addi r4,r1,8 ffc0ec2c: 48 00 0f bd bl ffc0fbe8 pipe->writerCounter ++; ffc0ec30: 81 3f 00 24 lwz r9,36(r31) ffc0ec34: 39 29 00 01 addi r9,r9,1 ffc0ec38: 91 3f 00 24 stw r9,36(r31) if (pipe->Writers ++ == 0) ffc0ec3c: 81 3f 00 14 lwz r9,20(r31) ffc0ec40: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ec44: 39 49 00 01 addi r10,r9,1 ffc0ec48: 91 5f 00 14 stw r10,20(r31) ffc0ec4c: 40 be 00 10 bne+ cr7,ffc0ec5c <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); ffc0ec50: 80 7f 00 2c lwz r3,44(r31) ffc0ec54: 38 81 00 08 addi r4,r1,8 ffc0ec58: 48 00 0f 91 bl ffc0fbe8 break; } PIPE_UNLOCK(pipe); ffc0ec5c: 80 7f 00 28 lwz r3,40(r31) ffc0ec60: 4b ff b2 f5 bl ffc09f54 return 0; ffc0ec64: 48 00 00 3c b ffc0eca0 /* Not an error */ if (LIBIO_NODELAY(iop)) break; prevCounter = pipe->writerCounter; err = -EINTR; ffc0ec68: 3b c0 ff fc li r30,-4 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); ffc0ec6c: 7f a3 eb 78 mr r3,r29 ffc0ec70: 7f 84 e3 78 mr r4,r28 ffc0ec74: 4b ff fb a1 bl ffc0e814 return err; ffc0ec78: 48 00 00 28 b ffc0eca0 err = pipe_lock(); if (err) return err; pipe = *pipep; ffc0ec7c: 83 fd 00 00 lwz r31,0(r29) if (pipe == NULL) { ffc0ec80: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0ec84: 40 9e fd dc bne+ cr7,ffc0ea60 ffc0ec88: 4b ff fc f4 b ffc0e97c if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; ffc0ec8c: 3b c0 ff f4 li r30,-12 ffc0ec90: 4b ff fe 14 b ffc0eaa4 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') ffc0ec94: 39 29 00 01 addi r9,r9,1 ffc0ec98: 99 3e 22 14 stb r9,8724(r30) ffc0ec9c: 4b ff fd c4 b ffc0ea60 return 0; out_error: pipe_release(pipep, iop); return err; } ffc0eca0: 39 61 00 30 addi r11,r1,48 ffc0eca4: 7f c3 f3 78 mr r3,r30 ffc0eca8: 48 01 0a d8 b ffc1f780 <_restgpr_27_x> =============================================================================== ffc0ac38 : { long return_value; rtems_libio_t *iop; const rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); ffc0ac38: 3d 20 00 00 lis r9,0 */ long fpathconf( int fd, int name ) { ffc0ac3c: 94 21 ff f8 stwu r1,-8(r1) ffc0ac40: 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); ffc0ac44: 81 29 26 dc lwz r9,9948(r9) */ long fpathconf( int fd, int name ) { ffc0ac48: 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); ffc0ac4c: 7f 83 48 40 cmplw cr7,r3,r9 ffc0ac50: 41 bc 00 08 blt+ cr7,ffc0ac58 ffc0ac54: 48 00 00 20 b ffc0ac74 iop = rtems_libio_iop(fd); ffc0ac58: 3d 20 00 00 lis r9,0 ffc0ac5c: 81 29 27 88 lwz r9,10120(r9) ffc0ac60: 1c 63 00 38 mulli r3,r3,56 ffc0ac64: 7c 69 1a 14 add r3,r9,r3 rtems_libio_check_is_open(iop); ffc0ac68: 81 23 00 10 lwz r9,16(r3) ffc0ac6c: 71 2a 01 00 andi. r10,r9,256 ffc0ac70: 40 a2 00 10 bne+ ffc0ac80 <== ALWAYS TAKEN ffc0ac74: 48 00 16 e1 bl ffc0c354 <__errno> ffc0ac78: 39 20 00 09 li r9,9 ffc0ac7c: 48 00 00 98 b ffc0ad14 * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; switch ( name ) { ffc0ac80: 2b 84 00 0b cmplwi cr7,r4,11 /* * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; ffc0ac84: 81 23 00 28 lwz r9,40(r3) ffc0ac88: 81 29 00 2c lwz r9,44(r9) switch ( name ) { ffc0ac8c: 41 9d 00 80 bgt- cr7,ffc0ad0c ffc0ac90: 3d 40 ff c1 lis r10,-63 ffc0ac94: 39 4a 2e 8c addi r10,r10,11916 ffc0ac98: 54 84 10 3a rlwinm r4,r4,2,0,29 ffc0ac9c: 7d 0a 20 2e lwzx r8,r10,r4 ffc0aca0: 7d 48 52 14 add r10,r8,r10 ffc0aca4: 7d 49 03 a6 mtctr r10 ffc0aca8: 4e 80 04 20 bctr case _PC_LINK_MAX: return_value = the_limits->link_max; ffc0acac: 80 69 00 00 lwz r3,0(r9) break; ffc0acb0: 48 00 00 6c b ffc0ad1c case _PC_MAX_CANON: return_value = the_limits->max_canon; ffc0acb4: 80 69 00 04 lwz r3,4(r9) break; ffc0acb8: 48 00 00 64 b ffc0ad1c case _PC_MAX_INPUT: return_value = the_limits->max_input; ffc0acbc: 80 69 00 08 lwz r3,8(r9) break; ffc0acc0: 48 00 00 5c b ffc0ad1c case _PC_NAME_MAX: return_value = the_limits->name_max; ffc0acc4: 80 69 00 0c lwz r3,12(r9) break; ffc0acc8: 48 00 00 54 b ffc0ad1c case _PC_PATH_MAX: return_value = the_limits->path_max; ffc0accc: 80 69 00 10 lwz r3,16(r9) break; ffc0acd0: 48 00 00 4c b ffc0ad1c case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; ffc0acd4: 80 69 00 14 lwz r3,20(r9) break; ffc0acd8: 48 00 00 44 b ffc0ad1c case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; ffc0acdc: 80 69 00 1c lwz r3,28(r9) break; ffc0ace0: 48 00 00 3c b ffc0ad1c case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; ffc0ace4: 80 69 00 20 lwz r3,32(r9) break; ffc0ace8: 48 00 00 34 b ffc0ad1c case _PC_VDISABLE: return_value = the_limits->posix_vdisable; ffc0acec: 80 69 00 2c lwz r3,44(r9) break; ffc0acf0: 48 00 00 2c b ffc0ad1c case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; ffc0acf4: 80 69 00 18 lwz r3,24(r9) break; ffc0acf8: 48 00 00 24 b ffc0ad1c case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; ffc0acfc: 80 69 00 24 lwz r3,36(r9) break; ffc0ad00: 48 00 00 1c b ffc0ad1c case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; ffc0ad04: 80 69 00 28 lwz r3,40(r9) break; ffc0ad08: 48 00 00 14 b ffc0ad1c default: rtems_set_errno_and_return_minus_one( EINVAL ); ffc0ad0c: 48 00 16 49 bl ffc0c354 <__errno> ffc0ad10: 39 20 00 16 li r9,22 ffc0ad14: 91 23 00 00 stw r9,0(r3) ffc0ad18: 38 60 ff ff li r3,-1 break; } return return_value; } ffc0ad1c: 80 01 00 0c lwz r0,12(r1) ffc0ad20: 38 21 00 08 addi r1,r1,8 ffc0ad24: 7c 08 03 a6 mtlr r0 ffc0ad28: 4e 80 00 20 blr =============================================================================== ffc0455c : #include void free( void *ptr ) { ffc0455c: 94 21 ff f0 stwu r1,-16(r1) ffc04560: 7c 08 02 a6 mflr r0 MSBUMP(free_calls, 1); ffc04564: 3d 20 00 00 lis r9,0 #include void free( void *ptr ) { ffc04568: 90 01 00 14 stw r0,20(r1) MSBUMP(free_calls, 1); ffc0456c: 39 29 2b 20 addi r9,r9,11040 #include void free( void *ptr ) { ffc04570: bf c1 00 08 stmw r30,8(r1) MSBUMP(free_calls, 1); if ( !ptr ) ffc04574: 7c 7f 1b 79 mr. r31,r3 void free( void *ptr ) { MSBUMP(free_calls, 1); ffc04578: 81 49 00 0c lwz r10,12(r9) ffc0457c: 39 4a 00 01 addi r10,r10,1 ffc04580: 91 49 00 0c stw r10,12(r9) if ( !ptr ) ffc04584: 41 82 00 a0 beq- ffc04624 return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && ffc04588: 3d 20 00 00 lis r9,0 ffc0458c: 81 29 28 4c lwz r9,10316(r9) ffc04590: 2f 89 00 03 cmpwi cr7,r9,3 ffc04594: 40 be 00 28 bne+ cr7,ffc045bc <== NEVER TAKEN !malloc_is_system_state_OK() ) { ffc04598: 48 00 02 15 bl ffc047ac return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && ffc0459c: 2f 83 00 00 cmpwi cr7,r3,0 ffc045a0: 40 be 00 1c bne+ cr7,ffc045bc RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } ffc045a4: 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); ffc045a8: 7f e3 fb 78 mr r3,r31 RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } ffc045ac: bb c1 00 08 lmw r30,8(r1) ffc045b0: 7c 08 03 a6 mtlr r0 ffc045b4: 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); ffc045b8: 48 00 02 5c b ffc04814 } /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) ffc045bc: 3d 20 00 00 lis r9,0 ffc045c0: 81 29 27 c4 lwz r9,10180(r9) ffc045c4: 2f 89 00 00 cmpwi cr7,r9,0 ffc045c8: 41 9e 00 14 beq- cr7,ffc045dc (*rtems_malloc_statistics_helpers->at_free)(ptr); ffc045cc: 81 29 00 08 lwz r9,8(r9) ffc045d0: 7f e3 fb 78 mr r3,r31 ffc045d4: 7d 29 03 a6 mtctr r9 ffc045d8: 4e 80 04 21 bctrl if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { ffc045dc: 3f c0 00 00 lis r30,0 ffc045e0: 80 7e 27 50 lwz r3,10064(r30) ffc045e4: 7f e4 fb 78 mr r4,r31 ffc045e8: 48 00 60 09 bl ffc0a5f0 <_Protected_heap_Free> ffc045ec: 2f 83 00 00 cmpwi cr7,r3,0 ffc045f0: 40 be 00 34 bne+ cr7,ffc04624 RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } ffc045f4: 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", ffc045f8: 3c 60 ff c2 lis r3,-62 ptr, RTEMS_Malloc_Heap->area_begin, ffc045fc: 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", ffc04600: 7f e4 fb 78 mr r4,r31 RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } ffc04604: 7c 08 03 a6 mtlr r0 ffc04608: bb c1 00 08 lmw r30,8(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", ffc0460c: 80 a9 00 18 lwz r5,24(r9) ffc04610: 38 63 be 50 addi r3,r3,-16816 ffc04614: 80 c9 00 1c lwz r6,28(r9) RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } ffc04618: 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", ffc0461c: 4c c6 31 82 crclr 4*cr1+eq ffc04620: 48 00 0d fc b ffc0541c RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } ffc04624: 39 61 00 10 addi r11,r1,16 ffc04628: 4b ff bf 98 b ffc005c0 <_restgpr_30_x> =============================================================================== ffc1a3f8 : int fstat( int fd, struct stat *sbuf ) { ffc1a3f8: 94 21 ff f0 stwu r1,-16(r1) ffc1a3fc: 7c 08 02 a6 mflr r0 ffc1a400: bf c1 00 08 stmw r30,8(r1) rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) ffc1a404: 7c 9e 23 79 mr. r30,r4 int fstat( int fd, struct stat *sbuf ) { ffc1a408: 90 01 00 14 stw r0,20(r1) rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) ffc1a40c: 40 a2 00 10 bne+ ffc1a41c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); ffc1a410: 4b ff 54 29 bl ffc0f838 <__errno> <== NOT EXECUTED ffc1a414: 39 20 00 0e li r9,14 <== NOT EXECUTED ffc1a418: 48 00 00 38 b ffc1a450 <== NOT EXECUTED /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); ffc1a41c: 3d 20 00 00 lis r9,0 ffc1a420: 81 29 27 58 lwz r9,10072(r9) ffc1a424: 7f 83 48 40 cmplw cr7,r3,r9 ffc1a428: 40 9c 00 20 bge- cr7,ffc1a448 ffc1a42c: 3d 20 00 00 lis r9,0 ffc1a430: 83 e9 28 08 lwz r31,10248(r9) ffc1a434: 1c 63 00 38 mulli r3,r3,56 ffc1a438: 7f ff 1a 14 add r31,r31,r3 rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); ffc1a43c: 81 3f 00 10 lwz r9,16(r31) ffc1a440: 71 2a 01 00 andi. r10,r9,256 ffc1a444: 40 a2 00 14 bne+ ffc1a458 ffc1a448: 4b ff 53 f1 bl ffc0f838 <__errno> ffc1a44c: 39 20 00 09 li r9,9 ffc1a450: 91 23 00 00 stw r9,0(r3) ffc1a454: 48 00 00 3c b ffc1a490 /* * Zero out the stat structure so the various support * versions of stat don't have to. */ memset( sbuf, 0, sizeof(struct stat) ); ffc1a458: 7f c3 f3 78 mr r3,r30 ffc1a45c: 38 80 00 00 li r4,0 ffc1a460: 38 a0 00 48 li r5,72 ffc1a464: 4b ff 61 cd bl ffc10630 return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); ffc1a468: 81 3f 00 24 lwz r9,36(r31) } ffc1a46c: 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 ); ffc1a470: 38 7f 00 14 addi r3,r31,20 ffc1a474: 81 29 00 18 lwz r9,24(r9) ffc1a478: 7f c4 f3 78 mr r4,r30 } ffc1a47c: 7c 08 03 a6 mtlr r0 ffc1a480: bb c1 00 08 lmw 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 ); ffc1a484: 7d 29 03 a6 mtctr r9 } ffc1a488: 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 ); ffc1a48c: 4e 80 04 20 bctr } ffc1a490: 39 61 00 10 addi r11,r1,16 ffc1a494: 38 60 ff ff li r3,-1 ffc1a498: 4b fe 61 28 b ffc005c0 <_restgpr_30_x> =============================================================================== ffc04124 : 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) { ffc04124: 3d 20 00 00 lis r9,0 ffc04128: 39 49 28 48 addi r10,r9,10312 ffc0412c: 81 29 28 48 lwz r9,10312(r9) ffc04130: 7f 83 48 40 cmplw cr7,r3,r9 ffc04134: 40 9c 00 64 bge- cr7,ffc04198 <== NEVER TAKEN ffc04138: 81 2a 00 04 lwz r9,4(r10) ffc0413c: 2f 89 00 00 cmpwi cr7,r9,0 ffc04140: 41 9e 00 58 beq- cr7,ffc04198 <== NEVER TAKEN rtems_disk_device_table *dtab = disktab + major; ffc04144: 54 63 18 38 rlwinm r3,r3,3,0,28 ffc04148: 7d 49 1a 14 add r10,r9,r3 if (minor < dtab->size && dtab->minor != NULL) { ffc0414c: 81 4a 00 04 lwz r10,4(r10) ffc04150: 7f 84 50 40 cmplw cr7,r4,r10 ffc04154: 40 9c 00 44 bge- cr7,ffc04198 <== NEVER TAKEN ffc04158: 7d 29 18 2e lwzx r9,r9,r3 ffc0415c: 2f 89 00 00 cmpwi cr7,r9,0 ffc04160: 41 9e 00 38 beq- cr7,ffc04198 <== NEVER TAKEN rtems_disk_device *dd = dtab->minor [minor]; ffc04164: 54 84 10 3a rlwinm r4,r4,2,0,29 ffc04168: 7c 69 20 2e lwzx r3,r9,r4 if (dd != NULL && !lookup_only) { ffc0416c: 2f 83 00 00 cmpwi cr7,r3,0 ffc04170: 4d 9e 00 20 beqlr cr7 ffc04174: 2f 85 00 00 cmpwi cr7,r5,0 ffc04178: 4c 9e 00 20 bnelr cr7 if (!dd->deleted) { ffc0417c: 89 23 00 40 lbz r9,64(r3) ffc04180: 2f 89 00 00 cmpwi cr7,r9,0 ffc04184: 40 9e 00 14 bne- cr7,ffc04198 ++dd->uses; ffc04188: 81 23 00 14 lwz r9,20(r3) ffc0418c: 39 29 00 01 addi r9,r9,1 ffc04190: 91 23 00 14 stw r9,20(r3) ffc04194: 4e 80 00 20 blr return dd; } } return NULL; ffc04198: 38 60 00 00 li r3,0 } ffc0419c: 4e 80 00 20 blr =============================================================================== ffc05790 : * 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, ffc05790: 94 21 ff e8 stwu r1,-24(r1) ffc05794: 7c 08 02 a6 mflr r0 ffc05798: bf 81 00 08 stmw r28,8(r1) ffc0579c: 7c 7c 1b 78 mr r28,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); ffc057a0: 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, ffc057a4: 90 01 00 1c stw r0,28(r1) ffc057a8: 7c 9d 23 78 mr r29,r4 ffc057ac: 7c be 2b 78 mr r30,r5 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); ffc057b0: 48 00 16 45 bl ffc06df4 if (s == NULL) ffc057b4: 7c 7f 1b 79 mr. r31,r3 ffc057b8: 41 82 00 3c beq- ffc057f4 <== NEVER TAKEN { return RTEMS_NO_MEMORY; } n = read(fd, s->data, RTEMS_IDE_SECTOR_SIZE); ffc057bc: 7f 83 e3 78 mr r3,r28 ffc057c0: 38 9f 00 04 addi r4,r31,4 ffc057c4: 38 a0 02 00 li r5,512 ffc057c8: 48 00 21 3d bl ffc07904 if (n != RTEMS_IDE_SECTOR_SIZE) ffc057cc: 2f 83 02 00 cmpwi cr7,r3,512 ffc057d0: 41 9e 00 14 beq- cr7,ffc057e4 <== ALWAYS TAKEN { free(s); ffc057d4: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc057d8: 48 00 0f 55 bl ffc0672c <== NOT EXECUTED return RTEMS_IO_ERROR; ffc057dc: 38 60 00 1b li r3,27 <== NOT EXECUTED ffc057e0: 48 00 00 18 b ffc057f8 <== NOT EXECUTED } s->sector_num = sector_num; ffc057e4: 93 bf 00 00 stw r29,0(r31) *sector = s; return RTEMS_SUCCESSFUL; ffc057e8: 38 60 00 00 li r3,0 return RTEMS_IO_ERROR; } s->sector_num = sector_num; *sector = s; ffc057ec: 93 fe 00 00 stw r31,0(r30) ffc057f0: 48 00 00 08 b ffc057f8 } s = (rtems_sector_data_t *) malloc(sizeof(rtems_sector_data_t) + RTEMS_IDE_SECTOR_SIZE); if (s == NULL) { return RTEMS_NO_MEMORY; ffc057f4: 38 60 00 1a li r3,26 <== NOT EXECUTED s->sector_num = sector_num; *sector = s; return RTEMS_SUCCESSFUL; } ffc057f8: 39 61 00 18 addi r11,r1,24 ffc057fc: 4b ff af ec b ffc007e8 <_restgpr_28_x> =============================================================================== ffc311ec : rtems_filesystem_node_types_t type; /* * Get the file control block structure associated with the file descriptor */ iop = rtems_libio_iop( dd_fd ); ffc311ec: 3d 20 00 00 lis r9,0 int getdents( int dd_fd, char *dd_buf, int dd_len ) { ffc311f0: 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 ); ffc311f4: 81 29 27 78 lwz r9,10104(r9) int getdents( int dd_fd, char *dd_buf, int dd_len ) { ffc311f8: 7c 2b 0b 78 mr r11,r1 ffc311fc: 94 21 ff e8 stwu r1,-24(r1) rtems_filesystem_node_types_t type; /* * Get the file control block structure associated with the file descriptor */ iop = rtems_libio_iop( dd_fd ); ffc31200: 7f 83 48 40 cmplw cr7,r3,r9 int getdents( int dd_fd, char *dd_buf, int dd_len ) { ffc31204: 4b fd 03 1d bl ffc01520 <_savegpr_31> ffc31208: 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 ); ffc3120c: 3b e0 00 00 li r31,0 ffc31210: 40 9c 00 14 bge- cr7,ffc31224 <== NEVER TAKEN ffc31214: 3d 20 00 00 lis r9,0 ffc31218: 1c 63 00 38 mulli r3,r3,56 ffc3121c: 83 e9 28 24 lwz r31,10276(r9) ffc31220: 7f ff 1a 14 add r31,r31,r3 /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); ffc31224: 38 7f 00 14 addi r3,r31,20 ffc31228: 90 81 00 08 stw r4,8(r1) ffc3122c: 90 a1 00 0c stw r5,12(r1) ffc31230: 4b fd 9b 65 bl ffc0ad94 if ( type != RTEMS_FILESYSTEM_DIRECTORY ) ffc31234: 2f 83 00 00 cmpwi cr7,r3,0 ffc31238: 80 81 00 08 lwz r4,8(r1) ffc3123c: 80 a1 00 0c lwz r5,12(r1) ffc31240: 40 9e 00 28 bne- cr7,ffc31268 /* * 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 ); ffc31244: 81 3f 00 24 lwz r9,36(r31) ffc31248: 7f e3 fb 78 mr r3,r31 } ffc3124c: 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 ); ffc31250: 81 29 00 08 lwz r9,8(r9) } ffc31254: 7c 08 03 a6 mtlr r0 ffc31258: 83 e1 00 14 lwz r31,20(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 ); ffc3125c: 7d 29 03 a6 mtctr r9 } ffc31260: 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 ); ffc31264: 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 ); ffc31268: 4b fe ff 65 bl ffc211cc <__errno> ffc3126c: 39 20 00 14 li r9,20 ffc31270: 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 ); } ffc31274: 39 61 00 18 addi r11,r1,24 ffc31278: 38 60 ff ff li r3,-1 ffc3127c: 4b fd 02 f0 b ffc0156c <_restgpr_31_x> =============================================================================== ffc0462c : */ int gettimeofday( struct timeval *tp, void * __tz __attribute__((unused)) ) { ffc0462c: 94 21 ff d8 stwu r1,-40(r1) ffc04630: 7c 08 02 a6 mflr r0 ffc04634: bf a1 00 1c stmw r29,28(r1) /* struct timezone* tzp = (struct timezone*) __tz; */ if ( !tp ) ffc04638: 7c 7d 1b 79 mr. r29,r3 */ int gettimeofday( struct timeval *tp, void * __tz __attribute__((unused)) ) { ffc0463c: 90 01 00 2c stw r0,44(r1) /* struct timezone* tzp = (struct timezone*) __tz; */ if ( !tp ) ffc04640: 40 a2 00 18 bne+ ffc04658 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); ffc04644: 48 00 b1 f5 bl ffc0f838 <__errno> <== NOT EXECUTED ffc04648: 39 20 00 0e li r9,14 <== NOT EXECUTED ffc0464c: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc04650: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc04654: 48 00 00 64 b ffc046b8 <== NOT EXECUTED ) { Timestamp_Control snapshot_as_timestamp; Timestamp_Control *snapshot_as_timestamp_ptr; snapshot_as_timestamp_ptr = ffc04658: 3c 80 00 00 lis r4,0 ffc0465c: 38 84 2b e0 addi r4,r4,11232 ffc04660: 38 61 00 08 addi r3,r1,8 ffc04664: 48 00 52 01 bl ffc09864 <_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); ffc04668: 3c c0 3b 9a lis r6,15258 struct timeval *tp, struct timezone *tzp ) { return gettimeofday( tp, tzp ); } ffc0466c: 83 e3 00 04 lwz r31,4(r3) ffc04670: 38 a0 00 00 li r5,0 ffc04674: 83 c3 00 00 lwz r30,0(r3) ffc04678: 60 c6 ca 00 ori r6,r6,51712 ffc0467c: 7f e4 fb 78 mr r4,r31 ffc04680: 7f c3 f3 78 mr r3,r30 ffc04684: 48 01 4a 3d bl ffc190c0 <__divdi3> _timeval->tv_usec = (suseconds_t) ((*_timestamp % 1000000000U) / 1000U); ffc04688: 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); ffc0468c: 90 9d 00 00 stw r4,0(r29) _timeval->tv_usec = (suseconds_t) ((*_timestamp % 1000000000U) / 1000U); ffc04690: 38 a0 00 00 li r5,0 ffc04694: 60 c6 ca 00 ori r6,r6,51712 ffc04698: 7f c3 f3 78 mr r3,r30 ffc0469c: 7f e4 fb 78 mr r4,r31 ffc046a0: 48 01 4e 45 bl ffc194e4 <__moddi3> ffc046a4: 38 a0 00 00 li r5,0 ffc046a8: 38 c0 03 e8 li r6,1000 ffc046ac: 48 01 4a 15 bl ffc190c0 <__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; ffc046b0: 38 60 00 00 li r3,0 ffc046b4: 90 9d 00 04 stw r4,4(r29) } ffc046b8: 39 61 00 28 addi r11,r1,40 ffc046bc: 4b ff bf 00 b ffc005bc <_restgpr_29_x> =============================================================================== ffc24d54 : void init_etc_passwd_group(void) { FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) ffc24d54: 3d 20 00 00 lis r9,0 ffc24d58: 89 49 5c cc lbz r10,23756(r9) ffc24d5c: 2f 8a 00 00 cmpwi cr7,r10,0 ffc24d60: 4c be 00 20 bnelr+ cr7 /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { ffc24d64: 7c 2b 0b 78 mr r11,r1 ffc24d68: 94 21 ff f0 stwu r1,-16(r1) ffc24d6c: 7c 08 02 a6 mflr r0 static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; mkdir("/etc", 0777); ffc24d70: 3c 60 ff c6 lis r3,-58 /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { ffc24d74: 48 02 ea 3d bl ffc537b0 <_savegpr_31> FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; ffc24d78: 39 40 00 01 li r10,1 mkdir("/etc", 0777); ffc24d7c: 38 80 01 ff li r4,511 /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { ffc24d80: 90 01 00 14 stw r0,20(r1) static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; mkdir("/etc", 0777); ffc24d84: 38 63 a2 60 addi r3,r3,-23968 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { ffc24d88: 3f e0 ff c6 lis r31,-58 FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; ffc24d8c: 99 49 5c cc stb r10,23756(r9) mkdir("/etc", 0777); /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { ffc24d90: 3b ff a2 65 addi r31,r31,-23963 static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; mkdir("/etc", 0777); ffc24d94: 4b fd f6 81 bl ffc04414 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { ffc24d98: 3c 80 ff c5 lis r4,-59 ffc24d9c: 7f e3 fb 78 mr r3,r31 ffc24da0: 38 84 64 0c addi r4,r4,25612 ffc24da4: 48 01 36 f9 bl ffc3849c ffc24da8: 2f 83 00 00 cmpwi cr7,r3,0 ffc24dac: 41 9e 00 08 beq- cr7,ffc24db4 ffc24db0: 48 00 00 30 b ffc24de0 fclose(fp); } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { ffc24db4: 3c 80 ff c5 lis r4,-59 ffc24db8: 7f e3 fb 78 mr r3,r31 ffc24dbc: 38 84 64 09 addi r4,r4,25609 ffc24dc0: 48 01 36 dd bl ffc3849c ffc24dc4: 7c 7f 1b 79 mr. r31,r3 ffc24dc8: 41 82 00 1c beq- ffc24de4 <== NEVER TAKEN fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" ffc24dcc: 3c 60 ff c6 lis r3,-58 ffc24dd0: 38 63 a2 71 addi r3,r3,-23951 ffc24dd4: 7f e4 fb 78 mr r4,r31 ffc24dd8: 48 01 39 55 bl ffc3872c "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); ffc24ddc: 7f e3 fb 78 mr r3,r31 ffc24de0: 48 01 2a a5 bl ffc37884 } /* * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { ffc24de4: 3f e0 ff c6 lis r31,-58 ffc24de8: 3b ff a2 d8 addi r31,r31,-23848 ffc24dec: 3c 80 ff c5 lis r4,-59 ffc24df0: 7f e3 fb 78 mr r3,r31 ffc24df4: 38 84 64 0c addi r4,r4,25612 ffc24df8: 48 01 36 a5 bl ffc3849c ffc24dfc: 2f 83 00 00 cmpwi cr7,r3,0 ffc24e00: 41 9e 00 08 beq- cr7,ffc24e08 ffc24e04: 48 00 00 30 b ffc24e34 fclose(fp); } else if ((fp = fopen("/etc/group", "w")) != NULL) { ffc24e08: 3c 80 ff c5 lis r4,-59 ffc24e0c: 7f e3 fb 78 mr r3,r31 ffc24e10: 38 84 64 09 addi r4,r4,25609 ffc24e14: 48 01 36 89 bl ffc3849c ffc24e18: 7c 7f 1b 79 mr. r31,r3 ffc24e1c: 41 82 00 2c beq- ffc24e48 <== NEVER TAKEN fprintf( fp, "root:x:0:root\n" ffc24e20: 3c 60 ff c6 lis r3,-58 ffc24e24: 38 63 a2 e3 addi r3,r3,-23837 ffc24e28: 7f e4 fb 78 mr r4,r31 ffc24e2c: 48 01 39 01 bl ffc3872c "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); ffc24e30: 7f e3 fb 78 mr r3,r31 } } ffc24e34: 80 01 00 14 lwz r0,20(r1) ffc24e38: 83 e1 00 0c lwz r31,12(r1) ffc24e3c: 7c 08 03 a6 mtlr r0 ffc24e40: 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); ffc24e44: 48 01 2a 40 b ffc37884 } } ffc24e48: 39 61 00 10 addi r11,r1,16 <== NOT EXECUTED ffc24e4c: 48 02 e9 b0 b ffc537fc <_restgpr_31_x> <== NOT EXECUTED =============================================================================== ffc07338 : /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { ffc07338: 94 21 ff f0 stwu r1,-16(r1) ffc0733c: 7c 08 02 a6 mflr r0 ffc07340: 90 01 00 14 stw r0,20(r1) if (tty->termios.c_iflag & ISTRIP) ffc07344: 81 24 00 30 lwz r9,48(r4) /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { ffc07348: bf c1 00 08 stmw r30,8(r1) ffc0734c: 7c 7e 1b 78 mr r30,r3 if (tty->termios.c_iflag & ISTRIP) ffc07350: 71 2a 00 20 andi. r10,r9,32 /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { ffc07354: 7c 9f 23 78 mr r31,r4 if (tty->termios.c_iflag & ISTRIP) ffc07358: 41 82 00 08 beq- ffc07360 <== ALWAYS TAKEN c &= 0x7f; ffc0735c: 54 7e 06 7e clrlwi r30,r3,25 <== NOT EXECUTED if (tty->termios.c_iflag & IUCLC) ffc07360: 71 2a 02 00 andi. r10,r9,512 ffc07364: 41 82 00 28 beq- ffc0738c c = tolower (c); ffc07368: 3d 40 00 00 lis r10,0 ffc0736c: 81 4a 27 a0 lwz r10,10144(r10) ffc07370: 7d 4a f2 14 add r10,r10,r30 ffc07374: 89 4a 00 01 lbz r10,1(r10) ffc07378: 55 4a 07 be clrlwi r10,r10,30 ffc0737c: 2f 8a 00 01 cmpwi cr7,r10,1 ffc07380: 40 be 00 08 bne+ cr7,ffc07388 ffc07384: 3b de 00 20 addi r30,r30,32 ffc07388: 57 de 06 3e clrlwi r30,r30,24 if (c == '\r') { ffc0738c: 2f 9e 00 0d cmpwi cr7,r30,13 ffc07390: 40 be 00 20 bne+ cr7,ffc073b0 if (tty->termios.c_iflag & IGNCR) ffc07394: 71 2a 00 80 andi. r10,r9,128 ffc07398: 41 a2 00 08 beq+ ffc073a0 <== ALWAYS TAKEN ffc0739c: 48 00 01 94 b ffc07530 <== NOT EXECUTED return 0; if (tty->termios.c_iflag & ICRNL) ffc073a0: 71 2a 01 00 andi. r10,r9,256 ffc073a4: 41 82 00 2c beq- ffc073d0 <== NEVER TAKEN c = '\n'; ffc073a8: 3b c0 00 0a li r30,10 ffc073ac: 48 00 00 24 b ffc073d0 } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { ffc073b0: 2f 9e 00 0a cmpwi cr7,r30,10 ffc073b4: 40 be 00 14 bne+ cr7,ffc073c8 ffc073b8: 71 2a 00 40 andi. r10,r9,64 ffc073bc: 41 82 00 14 beq- ffc073d0 <== ALWAYS TAKEN c = '\r'; ffc073c0: 3b c0 00 0d li r30,13 <== NOT EXECUTED ffc073c4: 48 00 00 0c b ffc073d0 <== NOT EXECUTED } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { ffc073c8: 2f 9e 00 00 cmpwi cr7,r30,0 ffc073cc: 41 be 01 20 beq+ cr7,ffc074ec <== NEVER TAKEN ffc073d0: 81 3f 00 3c lwz r9,60(r31) ffc073d4: 71 2a 00 02 andi. r10,r9,2 ffc073d8: 41 82 01 14 beq- ffc074ec if (c == tty->termios.c_cc[VERASE]) { ffc073dc: 89 5f 00 43 lbz r10,67(r31) ffc073e0: 7f 8a f0 00 cmpw cr7,r10,r30 ffc073e4: 40 be 00 1c bne+ cr7,ffc07400 * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) ffc073e8: 81 3f 00 20 lwz r9,32(r31) ffc073ec: 2f 89 00 00 cmpwi cr7,r9,0 ffc073f0: 41 9e 01 40 beq- cr7,ffc07530 ffc073f4: 7f e3 fb 78 mr r3,r31 ffc073f8: 38 80 00 00 li r4,0 ffc073fc: 48 00 00 68 b ffc07464 if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { if (c == tty->termios.c_cc[VERASE]) { erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { ffc07400: 89 5f 00 44 lbz r10,68(r31) ffc07404: 7f 8a f0 00 cmpw cr7,r10,r30 ffc07408: 40 be 00 64 bne+ cr7,ffc0746c * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) ffc0740c: 81 5f 00 20 lwz r10,32(r31) ffc07410: 2f 8a 00 00 cmpwi cr7,r10,0 ffc07414: 41 9e 01 1c beq- cr7,ffc07530 <== NEVER TAKEN return; if (lineFlag) { if (!(tty->termios.c_lflag & ECHO)) { ffc07418: 71 2a 00 08 andi. r10,r9,8 ffc0741c: 40 a2 00 0c bne+ ffc07428 <== ALWAYS TAKEN tty->ccount = 0; ffc07420: 91 5f 00 20 stw r10,32(r31) <== NOT EXECUTED ffc07424: 48 00 01 0c b ffc07530 <== NOT EXECUTED return; } if (!(tty->termios.c_lflag & ECHOE)) { ffc07428: 71 2a 00 10 andi. r10,r9,16 ffc0742c: 7f e3 fb 78 mr r3,r31 ffc07430: 38 80 00 01 li r4,1 ffc07434: 40 a2 00 30 bne+ ffc07464 <== ALWAYS TAKEN tty->ccount = 0; ffc07438: 91 5f 00 20 stw r10,32(r31) <== NOT EXECUTED echo (tty->termios.c_cc[VKILL], tty); ffc0743c: 7f c3 f3 78 mr r3,r30 <== NOT EXECUTED ffc07440: 7f e4 fb 78 mr r4,r31 <== NOT EXECUTED ffc07444: 4b ff fc a1 bl ffc070e4 <== NOT EXECUTED if (tty->termios.c_lflag & ECHOK) ffc07448: 81 3f 00 3c lwz r9,60(r31) <== NOT EXECUTED ffc0744c: 71 2a 00 20 andi. r10,r9,32 <== NOT EXECUTED ffc07450: 41 a2 00 e0 beq+ ffc07530 <== NOT EXECUTED echo ('\n', tty); ffc07454: 38 60 00 0a li r3,10 <== NOT EXECUTED ffc07458: 7f e4 fb 78 mr r4,r31 <== NOT EXECUTED ffc0745c: 4b ff fc 89 bl ffc070e4 <== NOT EXECUTED ffc07460: 48 00 00 d0 b ffc07530 <== NOT EXECUTED ffc07464: 4b ff fd 11 bl ffc07174 ffc07468: 48 00 00 c8 b ffc07530 } else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { ffc0746c: 89 5f 00 45 lbz r10,69(r31) ffc07470: 7f 8a f0 00 cmpw cr7,r10,r30 ffc07474: 41 9e 00 c4 beq- cr7,ffc07538 <== NEVER TAKEN return 1; } else if (c == '\n') { ffc07478: 2f 9e 00 0a cmpwi cr7,r30,10 ffc0747c: 40 be 00 2c bne+ cr7,ffc074a8 if (tty->termios.c_lflag & (ECHO | ECHONL)) ffc07480: 71 2a 00 48 andi. r10,r9,72 ffc07484: 41 a2 00 10 beq+ ffc07494 <== NEVER TAKEN echo (c, tty); ffc07488: 38 60 00 0a li r3,10 ffc0748c: 7f e4 fb 78 mr r4,r31 ffc07490: 4b ff fc 55 bl ffc070e4 tty->cbuf[tty->ccount++] = c; ffc07494: 81 3f 00 20 lwz r9,32(r31) ffc07498: 39 00 00 0a li r8,10 ffc0749c: 81 5f 00 1c lwz r10,28(r31) ffc074a0: 7d 0a 49 ae stbx r8,r10,r9 ffc074a4: 48 00 00 3c b ffc074e0 return 1; } else if ((c == tty->termios.c_cc[VEOL]) || ffc074a8: 89 5f 00 4c lbz r10,76(r31) ffc074ac: 7f 8a f0 00 cmpw cr7,r10,r30 ffc074b0: 41 9e 00 10 beq- cr7,ffc074c0 <== NEVER TAKEN ffc074b4: 89 5f 00 51 lbz r10,81(r31) ffc074b8: 7f 8a f0 00 cmpw cr7,r10,r30 ffc074bc: 40 be 00 30 bne+ cr7,ffc074ec <== ALWAYS TAKEN (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) ffc074c0: 71 2a 00 08 andi. r10,r9,8 <== NOT EXECUTED ffc074c4: 41 a2 00 10 beq+ ffc074d4 <== NOT EXECUTED echo (c, tty); ffc074c8: 7f c3 f3 78 mr r3,r30 <== NOT EXECUTED ffc074cc: 7f e4 fb 78 mr r4,r31 <== NOT EXECUTED ffc074d0: 4b ff fc 15 bl ffc070e4 <== NOT EXECUTED tty->cbuf[tty->ccount++] = c; ffc074d4: 81 3f 00 20 lwz r9,32(r31) <== NOT EXECUTED ffc074d8: 81 5f 00 1c lwz r10,28(r31) <== NOT EXECUTED ffc074dc: 7f ca 49 ae stbx r30,r10,r9 <== NOT EXECUTED ffc074e0: 39 29 00 01 addi r9,r9,1 ffc074e4: 91 3f 00 20 stw r9,32(r31) ffc074e8: 48 00 00 50 b ffc07538 } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { ffc074ec: 3d 20 00 00 lis r9,0 ffc074f0: 81 49 21 64 lwz r10,8548(r9) ffc074f4: 81 3f 00 20 lwz r9,32(r31) ffc074f8: 39 4a ff ff addi r10,r10,-1 ffc074fc: 7f 89 50 40 cmplw cr7,r9,r10 ffc07500: 40 9c 00 30 bge- cr7,ffc07530 <== NEVER TAKEN if (tty->termios.c_lflag & ECHO) ffc07504: 81 3f 00 3c lwz r9,60(r31) ffc07508: 71 2a 00 08 andi. r10,r9,8 ffc0750c: 41 a2 00 10 beq+ ffc0751c <== NEVER TAKEN echo (c, tty); ffc07510: 7f c3 f3 78 mr r3,r30 ffc07514: 7f e4 fb 78 mr r4,r31 ffc07518: 4b ff fb cd bl ffc070e4 tty->cbuf[tty->ccount++] = c; ffc0751c: 81 3f 00 20 lwz r9,32(r31) ffc07520: 81 5f 00 1c lwz r10,28(r31) ffc07524: 7f ca 49 ae stbx r30,r10,r9 ffc07528: 39 29 00 01 addi r9,r9,1 ffc0752c: 91 3f 00 20 stw r9,32(r31) } return 0; ffc07530: 38 60 00 00 li r3,0 ffc07534: 48 00 00 08 b ffc0753c else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { return 1; ffc07538: 38 60 00 01 li r3,1 if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; } ffc0753c: 39 61 00 10 addi r11,r1,16 ffc07540: 4b ff 90 80 b ffc005c0 <_restgpr_30_x> =============================================================================== ffc1a4c0 : #if !defined(RTEMS_POSIX_API) int kill( pid_t pid, int sig ) { return 0; } ffc1a4c0: 38 60 00 00 li r3,0 <== NOT EXECUTED ffc1a4c4: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc048f8 : #include "malloc_p.h" void *malloc( size_t size ) { ffc048f8: 94 21 ff e8 stwu r1,-24(r1) ffc048fc: 7c 08 02 a6 mflr r0 void *return_this; MSBUMP(malloc_calls, 1); ffc04900: 3d 20 00 00 lis r9,0 #include "malloc_p.h" void *malloc( size_t size ) { ffc04904: 90 01 00 1c stw r0,28(r1) void *return_this; MSBUMP(malloc_calls, 1); ffc04908: 39 29 2b 20 addi r9,r9,11040 ffc0490c: 81 49 00 04 lwz r10,4(r9) #include "malloc_p.h" void *malloc( size_t size ) { ffc04910: bf a1 00 0c stmw r29,12(r1) ffc04914: 7c 7e 1b 78 mr r30,r3 void *return_this; MSBUMP(malloc_calls, 1); ffc04918: 39 4a 00 01 addi r10,r10,1 ffc0491c: 91 49 00 04 stw r10,4(r9) /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); ffc04920: 4b ff fe b9 bl ffc047d8 /* * Validate the parameters */ if ( !size ) ffc04924: 2f 9e 00 00 cmpwi cr7,r30,0 ffc04928: 40 be 00 0c bne+ cr7,ffc04934 return (void *) 0; ffc0492c: 3b e0 00 00 li r31,0 ffc04930: 48 00 00 b8 b ffc049e8 /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && ffc04934: 3d 20 00 00 lis r9,0 ffc04938: 81 29 28 4c lwz r9,10316(r9) ffc0493c: 2f 89 00 03 cmpwi cr7,r9,3 ffc04940: 41 9e 00 28 beq- cr7,ffc04968 RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); ffc04944: 3f a0 00 00 lis r29,0 ffc04948: 80 7d 27 50 lwz r3,10064(r29) ffc0494c: 7f c4 f3 78 mr r4,r30 ffc04950: 38 a0 00 00 li r5,0 ffc04954: 38 c0 00 00 li r6,0 ffc04958: 48 00 5c 41 bl ffc0a598 <_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 ) { ffc0495c: 7c 7f 1b 79 mr. r31,r3 ffc04960: 40 a2 00 48 bne+ ffc049a8 ffc04964: 48 00 00 14 b ffc04978 /* * 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() ) ffc04968: 4b ff fe 45 bl ffc047ac return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && ffc0496c: 2f 83 00 00 cmpwi cr7,r3,0 ffc04970: 40 9e ff d4 bne+ cr7,ffc04944 <== ALWAYS TAKEN ffc04974: 4b ff ff b8 b ffc0492c <== NOT EXECUTED */ return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); if ( !return_this ) { return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); ffc04978: 3d 20 00 00 lis r9,0 ffc0497c: 80 7d 27 50 lwz r3,10064(r29) ffc04980: 81 29 27 4c lwz r9,10060(r9) ffc04984: 7f c4 f3 78 mr r4,r30 ffc04988: 7d 29 03 a6 mtctr r9 ffc0498c: 4e 80 04 21 bctrl if ( !return_this ) { ffc04990: 7c 7f 1b 79 mr. r31,r3 ffc04994: 40 a2 00 14 bne+ ffc049a8 <== NEVER TAKEN errno = ENOMEM; ffc04998: 48 00 ae a1 bl ffc0f838 <__errno> ffc0499c: 39 20 00 0c li r9,12 ffc049a0: 91 23 00 00 stw r9,0(r3) return (void *) 0; ffc049a4: 48 00 00 44 b ffc049e8 } /* * If the user wants us to dirty the allocated memory, then do it. */ if ( rtems_malloc_dirty_helper ) ffc049a8: 3d 20 00 00 lis r9,0 ffc049ac: 81 29 27 c0 lwz r9,10176(r9) ffc049b0: 2f 89 00 00 cmpwi cr7,r9,0 ffc049b4: 41 9e 00 14 beq- cr7,ffc049c8 (*rtems_malloc_dirty_helper)( return_this, size ); ffc049b8: 7f e3 fb 78 mr r3,r31 ffc049bc: 7d 29 03 a6 mtctr r9 ffc049c0: 7f c4 f3 78 mr r4,r30 ffc049c4: 4e 80 04 21 bctrl /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) ffc049c8: 3d 20 00 00 lis r9,0 ffc049cc: 81 29 27 c4 lwz r9,10180(r9) ffc049d0: 2f 89 00 00 cmpwi cr7,r9,0 ffc049d4: 41 9e 00 14 beq- cr7,ffc049e8 (*rtems_malloc_statistics_helpers->at_malloc)(return_this); ffc049d8: 81 29 00 04 lwz r9,4(r9) ffc049dc: 7f e3 fb 78 mr r3,r31 ffc049e0: 7d 29 03 a6 mtctr r9 ffc049e4: 4e 80 04 21 bctrl return return_this; } ffc049e8: 39 61 00 18 addi r11,r1,24 ffc049ec: 7f e3 fb 78 mr r3,r31 ffc049f0: 4b ff bb cc b ffc005bc <_restgpr_29_x> =============================================================================== ffc0e304 : void *memfile_alloc_block(void) { void *memory; memory = (void *)calloc(1, IMFS_MEMFILE_BYTES_PER_BLOCK); ffc0e304: 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) { ffc0e308: 94 21 ff f8 stwu r1,-8(r1) ffc0e30c: 7c 08 02 a6 mflr r0 void *memory; memory = (void *)calloc(1, IMFS_MEMFILE_BYTES_PER_BLOCK); ffc0e310: 38 60 00 01 li r3,1 ffc0e314: 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) { ffc0e318: 90 01 00 0c stw r0,12(r1) void *memory; memory = (void *)calloc(1, IMFS_MEMFILE_BYTES_PER_BLOCK); ffc0e31c: 4b ff 5e e5 bl ffc04200 if ( memory ) ffc0e320: 2c 03 00 00 cmpwi r3,0 ffc0e324: 41 82 00 14 beq- ffc0e338 <== NEVER TAKEN memfile_blocks_allocated++; ffc0e328: 3d 20 00 00 lis r9,0 ffc0e32c: 81 49 28 64 lwz r10,10340(r9) ffc0e330: 39 4a 00 01 addi r10,r10,1 ffc0e334: 91 49 28 64 stw r10,10340(r9) return memory; } ffc0e338: 80 01 00 0c lwz r0,12(r1) ffc0e33c: 38 21 00 08 addi r1,r1,8 ffc0e340: 7c 08 03 a6 mtlr r0 ffc0e344: 4e 80 00 20 blr =============================================================================== ffc0ee84 : int memfile_ftruncate( rtems_libio_t *iop, off_t length ) { ffc0ee84: 7c 2b 0b 78 mr r11,r1 ffc0ee88: 7c 08 02 a6 mflr r0 ffc0ee8c: 94 21 ff e0 stwu r1,-32(r1) ffc0ee90: 90 01 00 24 stw r0,36(r1) ffc0ee94: 48 00 b1 b5 bl ffc1a048 <_savegpr_31> IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; ffc0ee98: 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 ) ffc0ee9c: 81 3f 00 50 lwz r9,80(r31) ffc0eea0: 7f 89 28 00 cmpw cr7,r9,r5 ffc0eea4: 41 9c 00 14 blt- cr7,ffc0eeb8 <== NEVER TAKEN ffc0eea8: 40 be 00 20 bne+ cr7,ffc0eec8 <== NEVER TAKEN ffc0eeac: 81 3f 00 54 lwz r9,84(r31) ffc0eeb0: 7f 89 30 40 cmplw cr7,r9,r6 ffc0eeb4: 40 bc 00 14 bge+ cr7,ffc0eec8 return IMFS_memfile_extend( the_jnode, true, length ); ffc0eeb8: 7f e3 fb 78 mr r3,r31 ffc0eebc: 38 80 00 01 li r4,1 ffc0eec0: 4b ff fb 31 bl ffc0e9f0 ffc0eec4: 48 00 00 24 b ffc0eee8 /* * 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; ffc0eec8: 90 bf 00 50 stw r5,80(r31) IMFS_update_atime( the_jnode ); ffc0eecc: 38 61 00 08 addi r3,r1,8 ffc0eed0: 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; ffc0eed4: 90 df 00 54 stw r6,84(r31) IMFS_update_atime( the_jnode ); ffc0eed8: 4b ff 57 55 bl ffc0462c ffc0eedc: 81 21 00 08 lwz r9,8(r1) return 0; ffc0eee0: 38 60 00 00 li r3,0 * 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 ); ffc0eee4: 91 3f 00 40 stw r9,64(r31) return 0; } ffc0eee8: 39 61 00 20 addi r11,r1,32 ffc0eeec: 4b ff 16 d8 b ffc005c4 <_restgpr_31_x> =============================================================================== ffc0eddc : the_jnode = iop->pathinfo.node_access; /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) ffc0eddc: 81 43 00 10 lwz r10,16(r3) mode_t mode ) { IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; ffc0ede0: 81 23 00 1c lwz r9,28(r3) /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) ffc0ede4: 71 48 00 04 andi. r8,r10,4 ffc0ede8: 40 a2 00 10 bne+ ffc0edf8 if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; ffc0edec: 39 20 00 00 li r9,0 } ffc0edf0: 7d 23 4b 78 mr r3,r9 ffc0edf4: 4e 80 00 20 blr ffc0edf8: 81 49 00 4c lwz r10,76(r9) /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { ffc0edfc: 81 4a 00 00 lwz r10,0(r10) ffc0ee00: 2f 8a 00 05 cmpwi cr7,r10,5 ffc0ee04: 40 9e ff e8 bne+ cr7,ffc0edec <== ALWAYS TAKEN uint32_t count = the_jnode->info.linearfile.size; ffc0ee08: 81 09 00 54 lwz r8,84(r9) <== NOT EXECUTED const unsigned char *buffer = the_jnode->info.linearfile.direct; the_jnode->control = &IMFS_node_control_memfile; ffc0ee0c: 3d 40 ff c2 lis r10,-62 <== NOT EXECUTED ffc0ee10: 39 4a c1 1c addi r10,r10,-16100 <== 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; ffc0ee14: 80 e9 00 58 lwz r7,88(r9) <== 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) ffc0ee18: 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; ffc0ee1c: 91 49 00 4c stw r10,76(r9) <== NOT EXECUTED the_jnode->info.file.size = 0; ffc0ee20: 39 40 00 00 li r10,0 <== NOT EXECUTED ffc0ee24: 39 60 00 00 li r11,0 <== NOT EXECUTED ffc0ee28: 91 49 00 50 stw r10,80(r9) <== NOT EXECUTED the_jnode->info.file.indirect = 0; ffc0ee2c: 39 40 00 00 li r10,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; ffc0ee30: 91 69 00 54 stw r11,84(r9) <== NOT EXECUTED the_jnode->info.file.indirect = 0; ffc0ee34: 91 49 00 58 stw r10,88(r9) <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; ffc0ee38: 91 49 00 5c stw r10,92(r9) <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; ffc0ee3c: 91 49 00 60 stw r10,96(r9) <== NOT EXECUTED if ((count != 0) ffc0ee40: 41 9e ff ac beq+ cr7,ffc0edec <== NOT EXECUTED rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { ffc0ee44: 94 21 ff f8 stwu r1,-8(r1) <== NOT EXECUTED ffc0ee48: 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)) ffc0ee4c: 7d 23 4b 78 mr r3,r9 <== NOT EXECUTED ffc0ee50: 38 a0 00 00 li r5,0 <== NOT EXECUTED rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { ffc0ee54: 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)) ffc0ee58: 38 c0 00 00 li r6,0 <== NOT EXECUTED ffc0ee5c: 4b ff fd 35 bl ffc0eb90 <== NOT EXECUTED return -1; } return 0; ffc0ee60: 39 20 00 00 li r9,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)) ffc0ee64: 2f 83 ff ff cmpwi cr7,r3,-1 <== NOT EXECUTED ffc0ee68: 40 be 00 08 bne+ cr7,ffc0ee70 <== NOT EXECUTED return -1; ffc0ee6c: 39 20 ff ff li r9,-1 <== NOT EXECUTED } return 0; } ffc0ee70: 80 01 00 0c lwz r0,12(r1) <== NOT EXECUTED ffc0ee74: 7d 23 4b 78 mr r3,r9 <== NOT EXECUTED ffc0ee78: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc0ee7c: 38 21 00 08 addi r1,r1,8 <== NOT EXECUTED ffc0ee80: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc04b0c : const void *data ) { int rv = 0; if ( ffc04b0c: 2b 86 00 01 cmplwi cr7,r6,1 const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { ffc04b10: 94 21 ff 70 stwu r1,-144(r1) ffc04b14: 7c 08 02 a6 mflr r0 ffc04b18: be 61 00 5c stmw r19,92(r1) ffc04b1c: 7c d8 33 78 mr r24,r6 ffc04b20: 90 01 00 94 stw r0,148(r1) int rv = 0; if ( ffc04b24: 41 9d 02 dc bgt- cr7,ffc04e00 ffc04b28: 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 = ffc04b2c: 7c a3 2b 78 mr r3,r5 ffc04b30: 7c 9d 23 78 mr r29,r4 ffc04b34: 7c b9 2b 78 mr r25,r5 ffc04b38: 7c f3 3b 78 mr r19,r7 ffc04b3c: 48 00 85 75 bl ffc0d0b0 rtems_filesystem_get_mount_handler( filesystemtype ); if ( fsmount_me_h != NULL ) { ffc04b40: 7c 74 1b 79 mr. r20,r3 ffc04b44: 41 82 02 bc beq- ffc04e00 const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; ffc04b48: 2f 9d 00 00 cmpwi cr7,r29,0 ffc04b4c: 7f ba eb 78 mr r26,r29 ffc04b50: 40 be 00 0c bne+ cr7,ffc04b5c ffc04b54: 3f 40 ff c2 lis r26,-62 ffc04b58: 3b 5a be b8 addi r26,r26,-16712 size_t filesystemtype_size = strlen( filesystemtype ) + 1; ffc04b5c: 7f 23 cb 78 mr r3,r25 ffc04b60: 48 00 c5 9d bl ffc110fc size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; ffc04b64: 2f 9b 00 00 cmpwi cr7,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; ffc04b68: 7c 7f 1b 78 mr r31,r3 ffc04b6c: 3a a3 00 01 addi r21,r3,1 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; ffc04b70: 41 9e 00 14 beq- cr7,ffc04b84 ffc04b74: 7f 63 db 78 mr r3,r27 ffc04b78: 48 00 c5 85 bl ffc110fc ffc04b7c: 3b 83 00 01 addi r28,r3,1 ffc04b80: 48 00 00 08 b ffc04b88 ffc04b84: 3b 80 00 00 li r28,0 size_t target_size = strlen( target ) + 1; ffc04b88: 7f 43 d3 78 mr r3,r26 ffc04b8c: 48 00 c5 71 bl ffc110fc size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size ffc04b90: 3b ff 00 65 addi r31,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; size_t target_size = strlen( target ) + 1; ffc04b94: 3a c3 00 01 addi r22,r3,1 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size ffc04b98: 7c 9f e2 14 add r4,r31,r28 + sizeof( rtems_filesystem_global_location_t ); rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); ffc04b9c: 38 60 00 01 li r3,1 ffc04ba0: 7c 84 b2 14 add r4,r4,r22 ffc04ba4: 4b ff f6 5d bl ffc04200 if ( mt_entry != NULL ) { ffc04ba8: 7c 7f 1b 79 mr. r31,r3 ffc04bac: 41 82 02 6c beq- ffc04e18 <== 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 ); ffc04bb0: 3b df 00 64 addi r30,r31,100 memcpy( str, filesystemtype, filesystemtype_size ); ffc04bb4: 7f c3 f3 78 mr r3,r30 ffc04bb8: 7f 24 cb 78 mr r4,r25 ffc04bbc: 7e a5 ab 78 mr r5,r21 ffc04bc0: 48 00 b9 7d bl ffc1053c mt_entry->type = str; str += filesystemtype_size; if ( source_or_null != NULL ) { ffc04bc4: 2f 9b 00 00 cmpwi cr7,r27,0 (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; ffc04bc8: 93 df 00 34 stw r30,52(r31) + 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 = ffc04bcc: 3a ff 00 40 addi r23,r31,64 ((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; str += filesystemtype_size; ffc04bd0: 7f de aa 14 add r30,r30,r21 if ( source_or_null != NULL ) { ffc04bd4: 41 9e 00 1c beq- cr7,ffc04bf0 memcpy( str, source_or_null, source_size ); ffc04bd8: 7f c3 f3 78 mr r3,r30 ffc04bdc: 7f 64 db 78 mr r4,r27 ffc04be0: 7f 85 e3 78 mr r5,r28 ffc04be4: 48 00 b9 59 bl ffc1053c mt_entry->dev = str; ffc04be8: 93 df 00 38 stw r30,56(r31) str += source_size; ffc04bec: 7f de e2 14 add r30,r30,r28 } memcpy( str, target, target_size ); ffc04bf0: 7f c3 f3 78 mr r3,r30 ffc04bf4: 7f 44 d3 78 mr r4,r26 ffc04bf8: 7e c5 b3 78 mr r5,r22 ffc04bfc: 48 00 b9 41 bl ffc1053c mt_entry->target = str; str += target_size; mt_entry->mounted = true; ffc04c00: 39 20 00 01 li r9,1 ffc04c04: 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; ffc04c08: 3d 20 ff c2 lis r9,-62 ffc04c0c: 39 29 be 88 addi r9,r9,-16760 ffc04c10: 91 3f 00 2c stw r9,44(r31) mt_fs_root->location.mt_entry = mt_entry; mt_fs_root->reference_count = 1; ffc04c14: 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 ); ffc04c18: 38 7f 00 14 addi r3,r31,20 mt_entry->dev = str; str += source_size; } memcpy( str, target, target_size ); mt_entry->target = str; ffc04c1c: 93 df 00 30 stw r30,48(r31) ffc04c20: 7e e4 bb 78 mr r4,r23 ffc04c24: 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; ffc04c28: 91 3f 00 58 stw r9,88(r31) ffc04c2c: 38 c0 00 24 li r6,36 filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; ffc04c30: 57 18 07 fe clrlwi r24,r24,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; ffc04c34: 92 ff 00 24 stw r23,36(r31) mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; mt_fs_root->location.mt_entry = mt_entry; ffc04c38: 93 ff 00 54 stw r31,84(r31) ffc04c3c: 48 00 47 dd bl ffc09418 <_Chain_Initialize> filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; ffc04c40: 9b 1f 00 29 stb r24,41(r31) rv = (*fsmount_me_h)( mt_entry, data ); ffc04c44: 7f e3 fb 78 mr r3,r31 ffc04c48: 7e 89 03 a6 mtctr r20 ffc04c4c: 7e 64 9b 78 mr r4,r19 ffc04c50: 4e 80 04 21 bctrl if ( rv == 0 ) { ffc04c54: 7c 7e 1b 79 mr. r30,r3 ffc04c58: 40 82 01 b4 bne- ffc04e0c if ( target != NULL ) { ffc04c5c: 2f 9d 00 00 cmpwi cr7,r29,0 ffc04c60: 41 9e 00 d8 beq- cr7,ffc04d38 { 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 = ffc04c64: 7f a4 eb 78 mr r4,r29 ffc04c68: 38 a0 00 1f li r5,31 ffc04c6c: 38 61 00 08 addi r3,r1,8 ffc04c70: 48 00 0c 29 bl ffc05898 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; ffc04c74: 81 23 00 14 lwz r9,20(r3) return (*mt_entry->ops->are_nodes_equal_h)( ffc04c78: 81 49 00 0c lwz r10,12(r9) ffc04c7c: 80 89 00 24 lwz r4,36(r9) ffc04c80: 81 4a 00 10 lwz r10,16(r10) ffc04c84: 7d 49 03 a6 mtctr r10 ffc04c88: 4e 80 04 21 bctrl rtems_filesystem_eval_path_start( &ctx, target, eval_flags ); if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) { ffc04c8c: 2f 83 00 00 cmpwi cr7,r3,0 ffc04c90: 40 9e 00 8c bne- cr7,ffc04d1c 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( ffc04c94: 38 81 00 20 addi r4,r1,32 ffc04c98: 38 61 00 40 addi r3,r1,64 ffc04c9c: 48 00 11 39 bl ffc05dd4 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 ); ffc04ca0: 38 61 00 40 addi r3,r1,64 ffc04ca4: 48 00 13 59 bl ffc05ffc mt_entry->mt_point_node = mt_point_node; rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); ffc04ca8: 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 ); ffc04cac: 7c 7d 1b 78 mr r29,r3 mt_entry->mt_point_node = mt_point_node; ffc04cb0: 90 7f 00 20 stw r3,32(r31) rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); ffc04cb4: 7f e3 fb 78 mr r3,r31 ffc04cb8: 81 29 00 0c lwz r9,12(r9) ffc04cbc: 81 29 00 30 lwz r9,48(r9) ffc04cc0: 7d 29 03 a6 mtctr r9 ffc04cc4: 4e 80 04 21 bctrl if ( rv == 0 ) { ffc04cc8: 7c 7e 1b 79 mr. r30,r3 ffc04ccc: 40 82 00 44 bne- ffc04d10 */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); ffc04cd0: 3f a0 00 00 lis r29,0 ffc04cd4: 80 7d 28 10 lwz r3,10256(r29) ffc04cd8: 38 80 00 00 li r4,0 ffc04cdc: 38 a0 00 00 li r5,0 ffc04ce0: 48 00 3b cd bl ffc088ac Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; ffc04ce4: 3d 20 00 00 lis r9,0 ffc04ce8: 39 29 21 50 addi r9,r9,8528 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); ffc04cec: 80 7d 28 10 lwz r3,10256(r29) ffc04cf0: 81 49 00 08 lwz r10,8(r9) the_node->next = tail; ffc04cf4: 39 09 00 04 addi r8,r9,4 ffc04cf8: 91 1f 00 00 stw r8,0(r31) tail->previous = the_node; ffc04cfc: 93 e9 00 08 stw r31,8(r9) old_last->next = the_node; ffc04d00: 93 ea 00 00 stw r31,0(r10) the_node->previous = old_last; ffc04d04: 91 5f 00 04 stw r10,4(r31) ffc04d08: 48 00 3c c9 bl ffc089d0 ffc04d0c: 48 00 00 20 b ffc04d2c &rtems_filesystem_mount_table, &mt_entry->mt_node ); rtems_filesystem_mt_unlock(); } else { rtems_filesystem_global_location_release( mt_point_node ); ffc04d10: 7f a3 eb 78 mr r3,r29 ffc04d14: 48 00 11 85 bl ffc05e98 ffc04d18: 48 00 00 14 b ffc04d2c } } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); ffc04d1c: 38 61 00 08 addi r3,r1,8 ffc04d20: 38 80 00 10 li r4,16 ffc04d24: 48 00 08 55 bl ffc05578 rv = -1; ffc04d28: 3b c0 ff ff li r30,-1 } rtems_filesystem_eval_path_cleanup( &ctx ); ffc04d2c: 38 61 00 08 addi r3,r1,8 ffc04d30: 48 00 0c 91 bl ffc059c0 ffc04d34: 48 00 00 ac b ffc04de0 */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); ffc04d38: 3d 20 00 00 lis r9,0 ffc04d3c: 80 69 28 10 lwz r3,10256(r9) ffc04d40: 38 80 00 00 li r4,0 ffc04d44: 38 a0 00 00 li r5,0 ffc04d48: 48 00 3b 65 bl ffc088ac */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc04d4c: 3d 40 00 00 lis r10,0 ffc04d50: 39 2a 21 50 addi r9,r10,8528 ) { int rv = 0; rtems_filesystem_mt_lock(); if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) { ffc04d54: 81 0a 21 50 lwz r8,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 ); ffc04d58: 38 e9 00 04 addi r7,r9,4 ffc04d5c: 7f 88 38 00 cmpw cr7,r8,r7 ffc04d60: 40 9e 00 1c bne- cr7,ffc04d7c <== NEVER TAKEN Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; ffc04d64: 81 49 00 08 lwz r10,8(r9) the_node->next = tail; ffc04d68: 91 1f 00 00 stw r8,0(r31) tail->previous = the_node; ffc04d6c: 93 e9 00 08 stw r31,8(r9) old_last->next = the_node; ffc04d70: 93 ea 00 00 stw r31,0(r10) the_node->previous = old_last; ffc04d74: 91 5f 00 04 stw r10,4(r31) ffc04d78: 48 00 00 14 b ffc04d8c rtems_chain_append_unprotected( &rtems_filesystem_mount_table, &mt_entry->mt_node ); } else { errno = EINVAL; ffc04d7c: 48 00 aa bd bl ffc0f838 <__errno> <== NOT EXECUTED ffc04d80: 39 20 00 16 li r9,22 <== NOT EXECUTED ffc04d84: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED rv = -1; ffc04d88: 3b c0 ff ff li r30,-1 <== NOT EXECUTED } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); ffc04d8c: 3d 20 00 00 lis r9,0 ffc04d90: 80 69 28 10 lwz r3,10256(r9) ffc04d94: 48 00 3c 3d bl ffc089d0 } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { ffc04d98: 2f 9e 00 00 cmpwi cr7,r30,0 ffc04d9c: 40 be 00 44 bne+ cr7,ffc04de0 <== NEVER TAKEN rtems_filesystem_global_location_t *new_fs_root = rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); ffc04da0: 3b ff 00 24 addi r31,r31,36 rv = -1; } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { rtems_filesystem_global_location_t *new_fs_root = ffc04da4: 7f e3 fb 78 mr r3,r31 ffc04da8: 48 00 11 89 bl ffc05f30 ffc04dac: 7c 7c 1b 78 mr r28,r3 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_t *new_fs_current = ffc04db0: 7f e3 fb 78 mr r3,r31 ffc04db4: 48 00 11 7d bl ffc05f30 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( ffc04db8: 3f e0 00 00 lis r31,0 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 = ffc04dbc: 7c 7d 1b 78 mr r29,r3 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( ffc04dc0: 80 7f 27 98 lwz r3,10136(r31) ffc04dc4: 7f 84 e3 78 mr r4,r28 ffc04dc8: 38 63 00 04 addi r3,r3,4 ffc04dcc: 48 00 11 25 bl ffc05ef0 &rtems_filesystem_root, new_fs_root ); rtems_filesystem_global_location_assign( ffc04dd0: 80 7f 27 98 lwz r3,10136(r31) ffc04dd4: 7f a4 eb 78 mr r4,r29 ffc04dd8: 48 00 11 19 bl ffc05ef0 ffc04ddc: 48 00 00 4c b ffc04e28 rv = register_subordinate_file_system( mt_entry, target ); } else { rv = register_root_file_system( mt_entry ); } if ( rv != 0 ) { ffc04de0: 2f 9e 00 00 cmpwi cr7,r30,0 ffc04de4: 41 be 00 44 beq+ cr7,ffc04e28 (*mt_entry->ops->fsunmount_me_h)( mt_entry ); ffc04de8: 81 3f 00 0c lwz r9,12(r31) ffc04dec: 7f e3 fb 78 mr r3,r31 ffc04df0: 81 29 00 3c lwz r9,60(r9) ffc04df4: 7d 29 03 a6 mtctr r9 ffc04df8: 4e 80 04 21 bctrl ffc04dfc: 48 00 00 10 b ffc04e0c } else { errno = EINVAL; rv = -1; } } else { errno = EINVAL; ffc04e00: 48 00 aa 39 bl ffc0f838 <__errno> ffc04e04: 39 20 00 16 li r9,22 ffc04e08: 48 00 00 18 b ffc04e20 (*mt_entry->ops->fsunmount_me_h)( mt_entry ); } } if ( rv != 0 ) { free( mt_entry ); ffc04e0c: 7f e3 fb 78 mr r3,r31 ffc04e10: 4b ff f7 4d bl ffc0455c ffc04e14: 48 00 00 14 b ffc04e28 } } else { errno = ENOMEM; ffc04e18: 48 00 aa 21 bl ffc0f838 <__errno> <== NOT EXECUTED ffc04e1c: 39 20 00 0c li r9,12 <== NOT EXECUTED ffc04e20: 91 23 00 00 stw r9,0(r3) rv = -1; ffc04e24: 3b c0 ff ff li r30,-1 errno = EINVAL; rv = -1; } return rv; } ffc04e28: 39 61 00 90 addi r11,r1,144 ffc04e2c: 7f c3 f3 78 mr r3,r30 ffc04e30: 4b ff b7 64 b ffc00594 <_restgpr_19_x> =============================================================================== ffc093f0 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { ffc093f0: 94 21 ff e0 stwu r1,-32(r1) ffc093f4: 7c 08 02 a6 mflr r0 ffc093f8: bf c1 00 18 stmw r30,24(r1) int rv = -1; if (target != NULL) { ffc093fc: 7c 9f 23 79 mr. r31,r4 const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { ffc09400: 90 01 00 24 stw r0,36(r1) int rv = -1; if (target != NULL) { ffc09404: 41 82 00 50 beq- ffc09454 ffc09408: 7c 7e 1b 78 mr r30,r3 rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); ffc0940c: 90 a1 00 08 stw r5,8(r1) ffc09410: 7f e3 fb 78 mr r3,r31 ffc09414: 38 80 01 ff li r4,511 ffc09418: 90 c1 00 0c stw r6,12(r1) ffc0941c: 90 e1 00 10 stw r7,16(r1) ffc09420: 48 00 0c 05 bl ffc0a024 if (rv == 0) { ffc09424: 2c 03 00 00 cmpwi r3,0 ffc09428: 80 a1 00 08 lwz r5,8(r1) ffc0942c: 80 c1 00 0c lwz r6,12(r1) ffc09430: 80 e1 00 10 lwz r7,16(r1) ffc09434: 40 a2 00 30 bne+ ffc09464 <== NEVER TAKEN } else { errno = EINVAL; } return rv; } ffc09438: 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( ffc0943c: 7f c3 f3 78 mr r3,r30 ffc09440: 7f e4 fb 78 mr r4,r31 } else { errno = EINVAL; } return rv; } ffc09444: bb c1 00 18 lmw r30,24(r1) ffc09448: 7c 08 03 a6 mtlr r0 ffc0944c: 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( ffc09450: 48 00 00 1c b ffc0946c options, data ); } } else { errno = EINVAL; ffc09454: 48 01 7d 79 bl ffc211cc <__errno> ffc09458: 39 20 00 16 li r9,22 ffc0945c: 91 23 00 00 stw r9,0(r3) const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { int rv = -1; ffc09460: 38 60 ff ff li r3,-1 } else { errno = EINVAL; } return rv; } ffc09464: 39 61 00 20 addi r11,r1,32 ffc09468: 4b ff 81 00 b ffc01568 <_restgpr_30_x> =============================================================================== ffc17b78 : msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { ffc17b78: 94 21 ff 30 stwu r1,-208(r1) ffc17b7c: 7c 08 02 a6 mflr r0 ffc17b80: 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; ffc17b84: 81 23 00 14 lwz r9,20(r3) msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { ffc17b88: be e1 00 ac stmw r23,172(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; ffc17b8c: 3b a0 00 00 li r29,0 msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { ffc17b90: 7c 7c 1b 78 mr r28,r3 int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; ffc17b94: 83 e9 00 08 lwz r31,8(r9) msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { ffc17b98: 7c 9e 23 78 mr r30,r4 fat_dir_pos_t *dir_pos ) { dir_pos->sname.cln = 0; dir_pos->sname.ofs = 0; dir_pos->lname.cln = FAT_FILE_SHORT_NAME; ffc17b9c: 39 20 ff ff li r9,-1 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; ffc17ba0: 83 63 00 08 lwz r27,8(r3) uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); ffc17ba4: 38 80 00 00 li r4,0 ffc17ba8: 91 21 00 90 stw r9,144(r1) msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { ffc17bac: 7c b8 2b 78 mr r24,r5 uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); ffc17bb0: 38 61 00 68 addi r3,r1,104 dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; ffc17bb4: 91 21 00 94 stw r9,148(r1) ffc17bb8: 38 a0 00 20 li r5,32 msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { ffc17bbc: 7c d9 33 78 mr r25,r6 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; ffc17bc0: 93 a1 00 98 stw r29,152(r1) msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { ffc17bc4: 7d 1a 43 78 mr r26,r8 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; time_t time_ret = 0; uint16_t time_val = 0; ffc17bc8: b3 a1 00 9e sth r29,158(r1) uint16_t date = 0; ffc17bcc: b3 a1 00 9c sth r29,156(r1) static inline void fat_dir_pos_init( fat_dir_pos_t *dir_pos ) { dir_pos->sname.cln = 0; ffc17bd0: 93 a1 00 88 stw r29,136(r1) dir_pos->sname.ofs = 0; ffc17bd4: 93 a1 00 8c stw r29,140(r1) uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); ffc17bd8: 48 00 45 71 bl ffc1c148 memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); ffc17bdc: 38 61 00 08 addi r3,r1,8 ffc17be0: 38 80 00 00 li r4,0 ffc17be4: 38 a0 00 40 li r5,64 ffc17be8: 48 00 45 61 bl ffc1c148 if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { ffc17bec: 2f 99 01 04 cmpwi cr7,r25,260 ffc17bf0: 40 bd 00 10 ble+ cr7,ffc17c00 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(ENAMETOOLONG); ffc17bf4: 48 00 37 81 bl ffc1b374 <__errno> <== NOT EXECUTED ffc17bf8: 39 20 00 5b li r9,91 <== NOT EXECUTED ffc17bfc: 48 00 00 28 b ffc17c24 <== NOT EXECUTED } name_type = msdos_long_to_short (name, name_len, ffc17c00: 7f 03 c3 78 mr r3,r24 ffc17c04: 7f 24 cb 78 mr r4,r25 ffc17c08: 38 a1 00 68 addi r5,r1,104 ffc17c0c: 38 c0 00 0b li r6,11 ffc17c10: 48 00 04 8d bl ffc1809c MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { ffc17c14: 7c 77 1b 79 mr. r23,r3 ffc17c18: 40 a2 00 18 bne+ ffc17c30 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EINVAL); ffc17c1c: 48 00 37 59 bl ffc1b374 <__errno> <== NOT EXECUTED ffc17c20: 39 20 00 16 li r9,22 <== NOT EXECUTED ffc17c24: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc17c28: 3b a0 ff ff li r29,-1 <== NOT EXECUTED ffc17c2c: 48 00 02 dc b ffc17f08 <== NOT EXECUTED } /* fill reserved field */ *MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE; ffc17c30: 39 20 00 00 li r9,0 /* set up last write date and time */ time_ret = time(NULL); ffc17c34: 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; ffc17c38: 99 21 00 74 stb r9,116(r1) /* set up last write date and time */ time_ret = time(NULL); ffc17c3c: 48 00 83 5d bl ffc1ff98