=============================================================================== ffc0c58c : int IMFS_chown( const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group ) { ffc0c58c: 94 21 ff d8 stwu r1,-40(r1) ffc0c590: 7c 08 02 a6 mflr r0 ffc0c594: 90 01 00 2c stw r0,44(r1) ffc0c598: bf a1 00 1c stmw r29,28(r1) ffc0c59c: 7c 9e 23 78 mr r30,r4 ffc0c5a0: 7c bd 2b 78 mr r29,r5 IMFS_jnode_t *jnode; #if defined(RTEMS_POSIX_API) uid_t st_uid; #endif jnode = (IMFS_jnode_t *) loc->node_access; ffc0c5a4: 83 e3 00 08 lwz r31,8(r3) /* * Verify I am the owner of the node or the super user. */ #if defined(RTEMS_POSIX_API) st_uid = geteuid(); ffc0c5a8: 48 00 09 d5 bl ffc0cf7c if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) ffc0c5ac: a1 3f 00 3c lhz r9,60(r31) ffc0c5b0: 7f 89 18 00 cmpw cr7,r9,r3 ffc0c5b4: 41 9e 00 20 beq- cr7,ffc0c5d4 ffc0c5b8: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c5bc: 41 be 00 18 beq+ cr7,ffc0c5d4 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EPERM ); ffc0c5c0: 48 00 3f ed bl ffc105ac <__errno> ffc0c5c4: 39 20 00 01 li r9,1 ffc0c5c8: 91 23 00 00 stw r9,0(r3) ffc0c5cc: 38 60 ff ff li r3,-1 ffc0c5d0: 48 00 00 24 b ffc0c5f4 #endif jnode->st_uid = owner; ffc0c5d4: b3 df 00 3c sth r30,60(r31) jnode->st_gid = group; IMFS_update_ctime( jnode ); ffc0c5d8: 38 61 00 08 addi r3,r1,8 ffc0c5dc: 38 80 00 00 li r4,0 if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) rtems_set_errno_and_return_minus_one( EPERM ); #endif jnode->st_uid = owner; jnode->st_gid = group; ffc0c5e0: b3 bf 00 3e sth r29,62(r31) IMFS_update_ctime( jnode ); ffc0c5e4: 4b ff 80 49 bl ffc0462c ffc0c5e8: 81 21 00 08 lwz r9,8(r1) return 0; ffc0c5ec: 38 60 00 00 li r3,0 #endif jnode->st_uid = owner; jnode->st_gid = group; IMFS_update_ctime( jnode ); ffc0c5f0: 91 3f 00 48 stw r9,72(r31) return 0; } ffc0c5f4: 39 61 00 28 addi r11,r1,40 ffc0c5f8: 4b ff 3f c4 b ffc005bc <_restgpr_29_x> =============================================================================== 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 45 88 addi r25,r25,17800 ffc0690c: 3b de 28 30 addi r30,r30,10288 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); ffc06910: 3b 18 45 e2 addi r24,r24,17890 ) { 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 4c b3 addi r22,r22,19635 case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); ffc0691c: 3a b5 45 cf addi r21,r21,17871 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); ffc06920: 3b 5a 45 bb addi r26,r26,17851 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 e8 a5 bl ffc151d8 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 e8 85 bl ffc151d8 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 45 6c addi r9,r23,17772 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 e7 35 bl ffc150c0 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 45 8d addi r4,r4,17805 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 45 a0 addi r4,r4,17824 ffc069bc: 80 df 00 58 lwz r6,88(r31) ffc069c0: 4c c6 31 82 crclr 4*cr1+eq ffc069c4: 48 00 e6 19 bl ffc14fdc 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 45 af addi r4,r4,17839 ffc069dc: 4c c6 31 82 crclr 4*cr1+eq ffc069e0: 48 00 e5 fd bl ffc14fdc 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 e7 e1 bl ffc151d8 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 e5 cd bl ffc14fdc <== NOT EXECUTED ffc06a14: 48 00 00 0c b ffc06a20 <== NOT EXECUTED return; } puts(""); ffc06a18: 7e c3 b3 78 mr r3,r22 ffc06a1c: 48 01 07 95 bl ffc171b0 } 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> =============================================================================== ffc0c758 : rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { ffc0c758: 94 21 ff e0 stwu r1,-32(r1) ffc0c75c: 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( ffc0c760: 38 80 00 01 li r4,1 rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { ffc0c764: 90 01 00 24 stw r0,36(r1) ffc0c768: bf 41 00 08 stmw r26,8(r1) ffc0c76c: 7c bc 2b 78 mr r28,r5 ffc0c770: 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; ffc0c774: 83 a3 00 20 lwz r29,32(r3) rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { ffc0c778: 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( ffc0c77c: 80 bd 00 30 lwz r5,48(r29) ffc0c780: a0 dd 00 3c lhz r6,60(r29) ffc0c784: a0 fd 00 3e lhz r7,62(r29) ffc0c788: 48 00 0c 89 bl ffc0d410 dir->st_mode, dir->st_uid, dir->st_gid ); if ( access_ok ) { ffc0c78c: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c790: 40 9e 00 08 bne- cr7,ffc0c798 ffc0c794: 48 00 01 78 b ffc0c90c static inline bool rtems_filesystem_is_current_directory( const char *token, size_t tokenlen ) { return tokenlen == 1 && token [0] == '.'; ffc0c798: 2f 9b 00 01 cmpwi cr7,r27,1 ffc0c79c: 39 20 00 00 li r9,0 ffc0c7a0: 40 be 00 14 bne+ cr7,ffc0c7b4 ffc0c7a4: 89 3c 00 00 lbz r9,0(r28) ffc0c7a8: 69 29 00 2e xori r9,r9,46 ffc0c7ac: 7d 29 00 34 cntlzw r9,r9 ffc0c7b0: 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 ) ) { ffc0c7b4: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c7b8: 40 9e 00 94 bne- cr7,ffc0c84c static inline bool rtems_filesystem_is_parent_directory( const char *token, size_t tokenlen ) { return tokenlen == 2 && token [0] == '.' && token [1] == '.'; ffc0c7bc: 2f 9b 00 02 cmpwi cr7,r27,2 ffc0c7c0: 40 be 00 20 bne+ cr7,ffc0c7e0 ffc0c7c4: 89 5c 00 00 lbz r10,0(r28) ffc0c7c8: 2f 8a 00 2e cmpwi cr7,r10,46 ffc0c7cc: 40 be 00 14 bne+ cr7,ffc0c7e0 ffc0c7d0: 89 3c 00 01 lbz r9,1(r28) ffc0c7d4: 69 29 00 2e xori r9,r9,46 ffc0c7d8: 7d 29 00 34 cntlzw r9,r9 ffc0c7dc: 55 29 d9 7e rlwinm r9,r9,27,5,31 return dir; } else { if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) { ffc0c7e0: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c7e4: 41 be 00 0c beq+ cr7,ffc0c7f0 return dir->Parent; ffc0c7e8: 83 fd 00 08 lwz r31,8(r29) ffc0c7ec: 48 00 00 54 b ffc0c840 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc0c7f0: 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 ); ffc0c7f4: 3b 5d 00 54 addi r26,r29,84 ffc0c7f8: 48 00 00 3c b ffc0c834 while ( current != tail ) { IMFS_jnode_t *entry = (IMFS_jnode_t *) current; bool match = strncmp( entry->name, token, tokenlen ) == 0 ffc0c7fc: 38 7f 00 0c addi r3,r31,12 ffc0c800: 7f 84 e3 78 mr r4,r28 ffc0c804: 7f 65 db 78 mr r5,r27 ffc0c808: 48 00 57 05 bl ffc11f0c && entry->name [tokenlen] == '\0'; ffc0c80c: 39 20 00 00 li r9,0 ffc0c810: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c814: 40 9e 00 14 bne- cr7,ffc0c828 ffc0c818: 7d 3f da 14 add r9,r31,r27 ffc0c81c: 89 29 00 0c lbz r9,12(r9) ffc0c820: 7d 29 00 34 cntlzw r9,r9 ffc0c824: 55 29 d9 7e rlwinm r9,r9,27,5,31 if ( match ) { ffc0c828: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c82c: 40 9e 00 14 bne- cr7,ffc0c840 }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } ffc0c830: 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 ) { ffc0c834: 7f 9f d0 00 cmpw cr7,r31,r26 ffc0c838: 40 9e ff c4 bne+ cr7,ffc0c7fc ffc0c83c: 48 00 00 d8 b ffc0c914 ); if ( access_ok ) { IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen ); if ( entry != NULL ) { ffc0c840: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0c844: 40 be 00 0c bne+ cr7,ffc0c850 ffc0c848: 48 00 00 cc b ffc0c914 IMFS_jnode_t *dir, const char *token, size_t tokenlen ) { if ( rtems_filesystem_is_current_directory( token, tokenlen ) ) { ffc0c84c: 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; ffc0c850: 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; ffc0c854: 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 ); ffc0c858: 80 7e 00 04 lwz r3,4(r30) ffc0c85c: 81 29 00 00 lwz r9,0(r9) ffc0c860: 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 ); } ffc0c864: 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)) { ffc0c868: 2f 89 00 02 cmpwi cr7,r9,2 ffc0c86c: 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 ); ffc0c870: 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)) { ffc0c874: 40 be 00 1c bne+ cr7,ffc0c890 ffc0c878: 71 49 00 08 andi. r9,r10,8 ffc0c87c: 40 82 00 0c bne- ffc0c888 ffc0c880: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c884: 40 9e 00 98 bne- cr7,ffc0c91c <== ALWAYS TAKEN entry = entry->info.hard_link.link_node; ffc0c888: 83 ff 00 50 lwz r31,80(r31) ffc0c88c: 48 00 00 90 b ffc0c91c } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { ffc0c890: 2f 89 00 03 cmpwi cr7,r9,3 ffc0c894: 40 be 00 34 bne+ cr7,ffc0c8c8 ffc0c898: 71 49 00 10 andi. r9,r10,16 ffc0c89c: 40 82 00 0c bne- ffc0c8a8 ffc0c8a0: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c8a4: 40 be 00 78 bne+ cr7,ffc0c91c const char *target = entry->info.sym_link.name; ffc0c8a8: 83 ff 00 50 lwz r31,80(r31) rtems_filesystem_eval_path_recursive( ctx, target, strlen( target ) ); ffc0c8ac: 7f e3 fb 78 mr r3,r31 ffc0c8b0: 48 00 55 c1 bl ffc11e70 ffc0c8b4: 7f e4 fb 78 mr r4,r31 ffc0c8b8: 7c 65 1b 78 mr r5,r3 ffc0c8bc: 7f c3 f3 78 mr r3,r30 ffc0c8c0: 4b ff 92 19 bl ffc05ad8 ffc0c8c4: 48 00 00 48 b ffc0c90c IMFS_jnode_types_t type ) { rtems_filesystem_global_location_t **fs_root_ptr = NULL; if ( type == IMFS_DIRECTORY ) { ffc0c8c8: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c8cc: 40 9e 00 50 bne- cr7,ffc0c91c if ( node->info.directory.mt_fs != NULL ) { ffc0c8d0: 80 9f 00 5c lwz r4,92(r31) ffc0c8d4: 2f 84 00 00 cmpwi cr7,r4,0 ffc0c8d8: 41 9e 00 44 beq- cr7,ffc0c91c if ( !terminal ) { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE; } } else { access_ok = rtems_filesystem_eval_path_check_access( ffc0c8dc: 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; ffc0c8e0: 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( ffc0c8e4: a0 df 00 3c lhz r6,60(r31) ffc0c8e8: 7f c3 f3 78 mr r3,r30 ffc0c8ec: a0 ff 00 3e lhz r7,62(r31) ffc0c8f0: 38 80 00 01 li r4,1 ffc0c8f4: 48 00 0b 1d bl ffc0d410 RTEMS_FS_PERMS_EXEC, entry->st_mode, entry->st_uid, entry->st_gid ); if ( access_ok ) { ffc0c8f8: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c8fc: 41 be 00 10 beq+ cr7,ffc0c90c <== NEVER TAKEN rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); ffc0c900: 7f c3 f3 78 mr r3,r30 ffc0c904: 7f a4 eb 78 mr r4,r29 ffc0c908: 4b ff 91 49 bl ffc05a50 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = ffc0c90c: 38 60 00 01 li r3,1 ffc0c910: 48 00 00 34 b ffc0c944 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); } } } } else { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; ffc0c914: 38 60 00 02 li r3,2 ffc0c918: 48 00 00 2c b ffc0c944 } else { rtems_filesystem_global_location_t **fs_root_ptr = IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; ffc0c91c: a1 3d 00 34 lhz r9,52(r29) ffc0c920: 39 29 ff ff addi r9,r9,-1 ffc0c924: b1 3d 00 34 sth r9,52(r29) ++entry->reference_count; ffc0c928: a1 3f 00 34 lhz r9,52(r31) ffc0c92c: 39 29 00 01 addi r9,r9,1 ffc0c930: 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; ffc0c934: 81 3f 00 4c lwz r9,76(r31) currentloc->node_access = entry; ffc0c938: 93 fe 00 20 stw r31,32(r30) ffc0c93c: 81 29 00 04 lwz r9,4(r9) ffc0c940: 91 3e 00 28 stw r9,40(r30) status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } ffc0c944: 39 61 00 20 addi r11,r1,32 ffc0c948: 4b ff 3c 68 b ffc005b0 <_restgpr_26_x> =============================================================================== ffc0c95c : int IMFS_fchmod( const rtems_filesystem_location_info_t *loc, mode_t mode ) { ffc0c95c: 94 21 ff e0 stwu r1,-32(r1) ffc0c960: 7c 08 02 a6 mflr r0 ffc0c964: 90 01 00 24 stw r0,36(r1) ffc0c968: bf c1 00 18 stmw r30,24(r1) ffc0c96c: 7c 9e 23 78 mr r30,r4 IMFS_jnode_t *jnode; #if defined(RTEMS_POSIX_API) uid_t st_uid; #endif jnode = loc->node_access; ffc0c970: 83 e3 00 08 lwz r31,8(r3) /* * Verify I am the owner of the node or the super user. */ #if defined(RTEMS_POSIX_API) st_uid = geteuid(); ffc0c974: 48 00 06 09 bl ffc0cf7c if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) ffc0c978: a1 3f 00 3c lhz r9,60(r31) ffc0c97c: 7f 89 18 00 cmpw cr7,r9,r3 ffc0c980: 41 9e 00 20 beq- cr7,ffc0c9a0 ffc0c984: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c988: 41 be 00 18 beq+ cr7,ffc0c9a0 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EPERM ); ffc0c98c: 48 00 3c 21 bl ffc105ac <__errno> ffc0c990: 39 20 00 01 li r9,1 ffc0c994: 91 23 00 00 stw r9,0(r3) ffc0c998: 38 60 ff ff li r3,-1 ffc0c99c: 48 00 00 30 b ffc0c9cc /* * Change only the RWX permissions on the jnode to mode. */ jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); ffc0c9a0: 81 3f 00 30 lwz r9,48(r31) jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); ffc0c9a4: 57 de 05 3e clrlwi r30,r30,20 IMFS_update_ctime( jnode ); ffc0c9a8: 38 61 00 08 addi r3,r1,8 /* * Change only the RWX permissions on the jnode to mode. */ jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); ffc0c9ac: 55 29 00 26 rlwinm r9,r9,0,0,19 jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); ffc0c9b0: 7f c9 4b 78 or r9,r30,r9 ffc0c9b4: 91 3f 00 30 stw r9,48(r31) IMFS_update_ctime( jnode ); ffc0c9b8: 38 80 00 00 li r4,0 ffc0c9bc: 4b ff 7c 71 bl ffc0462c ffc0c9c0: 81 21 00 08 lwz r9,8(r1) return 0; ffc0c9c4: 38 60 00 00 li r3,0 */ jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); IMFS_update_ctime( jnode ); ffc0c9c8: 91 3f 00 48 stw r9,72(r31) return 0; } ffc0c9cc: 39 61 00 20 addi r11,r1,32 ffc0c9d0: 4b ff 3b f0 b ffc005c0 <_restgpr_30_x> =============================================================================== ffc046fc : static ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { ffc046fc: 94 21 ff e0 stwu r1,-32(r1) ffc04700: 7c 08 02 a6 mflr r0 ffc04704: 7c 66 1b 78 mr r6,r3 ffc04708: 90 01 00 24 stw r0,36(r1) ffc0470c: bf c1 00 18 stmw r30,24(r1) IMFS_jnode_t *jnode = iop->pathinfo.node_access; ffc04710: 83 e3 00 1c lwz r31,28(r3) int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); ffc04714: 80 7f 00 50 lwz r3,80(r31) ffc04718: 48 00 a9 99 bl ffc0f0b0 if (err > 0) { ffc0471c: 7c 7e 1b 79 mr. r30,r3 ffc04720: 40 81 00 20 ble- ffc04740 IMFS_mtime_ctime_update(jnode); ffc04724: 38 61 00 08 addi r3,r1,8 ffc04728: 38 80 00 00 li r4,0 ffc0472c: 48 00 0f 81 bl ffc056ac ffc04730: 81 21 00 08 lwz r9,8(r1) ffc04734: 91 3f 00 44 stw r9,68(r31) ffc04738: 91 3f 00 48 stw r9,72(r31) ffc0473c: 48 00 00 18 b ffc04754 } IMFS_FIFO_RETURN(err); ffc04740: 41 a2 00 14 beq+ ffc04754 <== NEVER TAKEN ffc04744: 7f de 00 d0 neg r30,r30 ffc04748: 48 00 da ed bl ffc12234 <__errno> ffc0474c: 93 c3 00 00 stw r30,0(r3) ffc04750: 3b c0 ff ff li r30,-1 } ffc04754: 39 61 00 20 addi r11,r1,32 ffc04758: 7f c3 f3 78 mr r3,r30 ffc0475c: 48 01 c3 c0 b ffc20b1c <_restgpr_30_x> =============================================================================== ffc0c9d4 : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { ffc0c9d4: 94 21 ff c8 stwu r1,-56(r1) ffc0c9d8: 7c 08 02 a6 mflr r0 ffc0c9dc: 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; ffc0c9e0: 38 81 00 08 addi r4,r1,8 ffc0c9e4: 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 ) { ffc0c9e8: 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 ); ffc0c9ec: 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; ffc0c9f0: 7c a3 c4 aa lswi r5,r3,24 ffc0c9f4: 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; ffc0c9f8: 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; ffc0c9fc: 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; ffc0ca00: 91 23 00 08 stw r9,8(r3) ffc0ca04: 48 00 00 08 b ffc0ca0c if ( IMFS_is_directory( jnode ) ) { if ( jnode_has_children( jnode ) ) jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); ffc0ca08: 7d 3f 4b 78 mr r31,r9 ffc0ca0c: 81 3f 00 4c lwz r9,76(r31) */ temp_mt_entry->mt_fs_root->location.node_access = NULL; do { next = jnode->Parent; ffc0ca10: 83 df 00 08 lwz r30,8(r31) ffc0ca14: 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 ) ) { ffc0ca18: 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; ffc0ca1c: 93 e1 00 10 stw r31,16(r1) IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { ffc0ca20: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ca24: 91 41 00 18 stw r10,24(r1) ffc0ca28: 40 9e 00 14 bne- cr7,ffc0ca3c ffc0ca2c: 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 ); ffc0ca30: 39 5f 00 54 addi r10,r31,84 ffc0ca34: 7f 89 50 00 cmpw cr7,r9,r10 ffc0ca38: 40 be 00 38 bne+ cr7,ffc0ca70 result = IMFS_rmnod( NULL, &loc ); ffc0ca3c: 38 60 00 00 li r3,0 ffc0ca40: 7f a4 eb 78 mr r4,r29 ffc0ca44: 4b ff 74 89 bl ffc03ecc if ( result != 0 ) ffc0ca48: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ca4c: 41 be 00 10 beq+ cr7,ffc0ca5c <== ALWAYS TAKEN rtems_fatal_error_occurred( 0xdeadbeef ); ffc0ca50: 3c 60 de ad lis r3,-8531 <== NOT EXECUTED ffc0ca54: 60 63 be ef ori r3,r3,48879 <== NOT EXECUTED ffc0ca58: 4b ff c6 1d bl ffc09074 <== NOT EXECUTED IMFS_node_destroy( jnode ); ffc0ca5c: 7f e3 fb 78 mr r3,r31 ffc0ca60: 4b ff 70 fd bl ffc03b5c jnode = next; } if ( jnode != NULL ) { ffc0ca64: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0ca68: 41 9e 00 30 beq- cr7,ffc0ca98 ffc0ca6c: 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; ffc0ca70: 81 3f 00 4c lwz r9,76(r31) if ( IMFS_is_directory( jnode ) ) { ffc0ca74: 81 29 00 00 lwz r9,0(r9) ffc0ca78: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ca7c: 40 be ff 90 bne- cr7,ffc0ca0c <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc0ca80: 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 ); ffc0ca84: 39 5f 00 54 addi r10,r31,84 if ( jnode_has_children( jnode ) ) ffc0ca88: 7f 89 50 00 cmpw cr7,r9,r10 ffc0ca8c: 41 be ff 80 beq- cr7,ffc0ca0c jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); ffc0ca90: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ca94: 40 9e ff 74 bne+ cr7,ffc0ca08 <== ALWAYS TAKEN } ffc0ca98: 39 61 00 38 addi r11,r1,56 ffc0ca9c: 4b ff 3b 20 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 29 2c lwz r9,10540(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 29 2c stw r9,10540(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 d1 01 addi r5,r5,-12031 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 8b 49 bl ffc0c5fc "", 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 d2 40 addi r9,r9,-11712 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 94 lwz r9,10132(r9) ffc03afc: 48 00 00 14 b ffc03b10 } else { errno = ENOMEM; rv = -1; } } else { errno = ENOMEM; ffc03b00: 48 00 ca ad bl ffc105ac <__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 44 stw r9,10308(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 90 lwz r9,10128(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 b8 8d bl ffc11044 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 f8 41 bl ffc15058 <__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> =============================================================================== ffc0f084 : */ MEMFILE_STATIC int IMFS_memfile_addblock( IMFS_jnode_t *the_jnode, unsigned int block ) { ffc0f084: 7c 2b 0b 78 mr r11,r1 ffc0f088: 7c 08 02 a6 mflr r0 ffc0f08c: 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 ); ffc0f090: 38 a0 00 01 li r5,1 */ MEMFILE_STATIC int IMFS_memfile_addblock( IMFS_jnode_t *the_jnode, unsigned int block ) { ffc0f094: 48 00 bd 29 bl ffc1adbc <_savegpr_31> ffc0f098: 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 ); ffc0f09c: 4b ff fb 91 bl ffc0ec2c if ( *block_entry_ptr ) ffc0f0a0: 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 ); ffc0f0a4: 7c 7f 1b 78 mr r31,r3 if ( *block_entry_ptr ) ffc0f0a8: 2f 89 00 00 cmpwi cr7,r9,0 ffc0f0ac: 40 be 00 14 bne+ cr7,ffc0f0c0 return 0; /* * There is no memory for this block number so allocate it. */ memory = memfile_alloc_block(); ffc0f0b0: 4b ff fb 39 bl ffc0ebe8 if ( !memory ) ffc0f0b4: 2c 03 00 00 cmpwi r3,0 ffc0f0b8: 41 82 00 10 beq- ffc0f0c8 <== NEVER TAKEN return 1; *block_entry_ptr = memory; ffc0f0bc: 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; ffc0f0c0: 38 60 00 00 li r3,0 ffc0f0c4: 48 00 00 08 b ffc0f0cc /* * There is no memory for this block number so allocate it. */ memory = memfile_alloc_block(); if ( !memory ) return 1; ffc0f0c8: 38 60 00 01 li r3,1 <== NOT EXECUTED *block_entry_ptr = memory; return 0; } ffc0f0cc: 39 61 00 10 addi r11,r1,16 ffc0f0d0: 4b ff 14 f4 b ffc005c4 <_restgpr_31_x> =============================================================================== ffc0f2d4 : MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { ffc0f2d4: 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 ) ffc0f2d8: 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 ) { ffc0f2dc: 7d 80 00 26 mfcr r12 ffc0f2e0: be e1 00 1c stmw r23,28(r1) ffc0f2e4: 7c 08 02 a6 mflr r0 ffc0f2e8: 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 ) ffc0f2ec: 83 c9 28 44 lwz r30,10308(r9) MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { ffc0f2f0: 7c 97 23 78 mr r23,r4 ffc0f2f4: 90 01 00 44 stw r0,68(r1) ffc0f2f8: 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 ) ffc0f2fc: 57 c9 f0 be rlwinm r9,r30,30,2,31 ffc0f300: 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 ) { ffc0f304: 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 ) ffc0f308: 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 ) { ffc0f30c: 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 ) ffc0f310: 39 4a 00 01 addi r10,r10,1 ffc0f314: 7d 2a 49 d6 mullw r9,r10,r9 ffc0f318: 39 40 00 00 li r10,0 ffc0f31c: 7f 8a 28 00 cmpw cr7,r10,r5 ffc0f320: 39 29 ff ff addi r9,r9,-1 ffc0f324: 7d 29 f1 d6 mullw r9,r9,r30 ffc0f328: 41 bd 00 1c bgt+ cr7,ffc0f344 <== NEVER TAKEN ffc0f32c: 40 9e 00 0c bne- cr7,ffc0f338 <== NEVER TAKEN ffc0f330: 7f 89 30 40 cmplw cr7,r9,r6 ffc0f334: 41 bd 00 10 bgt+ cr7,ffc0f344 rtems_set_errno_and_return_minus_one( EFBIG ); ffc0f338: 48 00 12 75 bl ffc105ac <__errno> ffc0f33c: 39 20 00 1b li r9,27 ffc0f340: 48 00 00 d8 b ffc0f418 /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) ffc0f344: 83 3f 00 50 lwz r25,80(r31) ffc0f348: 83 5f 00 54 lwz r26,84(r31) ffc0f34c: 7f 9c c8 00 cmpw cr7,r28,r25 ffc0f350: 41 bd 00 10 bgt+ cr7,ffc0f360 <== NEVER TAKEN ffc0f354: 40 9e 01 0c bne- cr7,ffc0f460 <== NEVER TAKEN ffc0f358: 7f 9d d0 40 cmplw cr7,r29,r26 ffc0f35c: 40 9d 01 04 ble- cr7,ffc0f460 <== NEVER TAKEN return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0f360: 7f db fe 70 srawi r27,r30,31 ffc0f364: 7f 65 db 78 mr r5,r27 ffc0f368: 7f c6 f3 78 mr r6,r30 ffc0f36c: 7f 83 e3 78 mr r3,r28 ffc0f370: 7f a4 eb 78 mr r4,r29 ffc0f374: 48 00 aa c1 bl ffc19e34 <__divdi3> old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0f378: 7f 23 cb 78 mr r3,r25 ffc0f37c: 7f 65 db 78 mr r5,r27 ffc0f380: 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; ffc0f384: 7c 98 23 78 mr r24,r4 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0f388: 7f 44 d3 78 mr r4,r26 ffc0f38c: 48 00 aa a9 bl ffc19e34 <__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 ) { ffc0f390: 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; ffc0f394: 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; ffc0f398: 7c 9b 23 78 mr r27,r4 offset = the_jnode->info.file.size - old_blocks * IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0f39c: 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; ffc0f3a0: 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++ ) { ffc0f3a4: 7c 9e 23 78 mr r30,r4 ffc0f3a8: 48 00 00 80 b ffc0f428 if ( !IMFS_memfile_addblock( the_jnode, block ) ) { ffc0f3ac: 7f e3 fb 78 mr r3,r31 ffc0f3b0: 7f c4 f3 78 mr r4,r30 ffc0f3b4: 4b ff fc d1 bl ffc0f084 ffc0f3b8: 2f 83 00 00 cmpwi cr7,r3,0 ffc0f3bc: 40 9e 00 4c bne- cr7,ffc0f408 <== NEVER TAKEN if ( zero_fill ) { ffc0f3c0: 41 b2 00 64 beq+ cr4,ffc0f424 size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; block_p *block_ptr = ffc0f3c4: 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; ffc0f3c8: 82 f9 28 44 lwz r23,10308(r25) block_p *block_ptr = ffc0f3cc: 38 a0 00 00 li r5,0 ffc0f3d0: 7f e3 fb 78 mr r3,r31 ffc0f3d4: 4b ff f8 59 bl ffc0ec2c * 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; ffc0f3d8: 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); ffc0f3dc: 80 63 00 00 lwz r3,0(r3) ffc0f3e0: 38 80 00 00 li r4,0 ffc0f3e4: 7e e5 bb 78 mr r5,r23 ffc0f3e8: 7c 63 d2 14 add r3,r3,r26 ffc0f3ec: 48 00 1f b9 bl ffc113a4 offset = 0; ffc0f3f0: 3b 40 00 00 li r26,0 ffc0f3f4: 48 00 00 30 b ffc0f424 } } else { for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); ffc0f3f8: 7f c4 f3 78 mr r4,r30 <== NOT EXECUTED ffc0f3fc: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc0f400: 4b ff fe 99 bl ffc0f298 <== NOT EXECUTED memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { ffc0f404: 3b de ff ff addi r30,r30,-1 <== NOT EXECUTED ffc0f408: 7f 9e d8 40 cmplw cr7,r30,r27 <== NOT EXECUTED ffc0f40c: 40 9c ff ec bge+ cr7,ffc0f3f8 <== NOT EXECUTED IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); ffc0f410: 48 00 11 9d bl ffc105ac <__errno> <== NOT EXECUTED ffc0f414: 39 20 00 1c li r9,28 <== NOT EXECUTED ffc0f418: 91 23 00 00 stw r9,0(r3) ffc0f41c: 38 60 ff ff li r3,-1 ffc0f420: 48 00 00 44 b ffc0f464 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++ ) { ffc0f424: 3b de 00 01 addi r30,r30,1 ffc0f428: 7f 9e c0 40 cmplw cr7,r30,r24 ffc0f42c: 40 9d ff 80 ble+ cr7,ffc0f3ac } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; ffc0f430: 93 9f 00 50 stw r28,80(r31) IMFS_update_ctime(the_jnode); ffc0f434: 38 80 00 00 li r4,0 ffc0f438: 38 61 00 08 addi r3,r1,8 } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; ffc0f43c: 93 bf 00 54 stw r29,84(r31) IMFS_update_ctime(the_jnode); ffc0f440: 4b ff 51 ed bl ffc0462c ffc0f444: 81 21 00 08 lwz r9,8(r1) IMFS_update_mtime(the_jnode); ffc0f448: 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); ffc0f44c: 91 3f 00 48 stw r9,72(r31) IMFS_update_mtime(the_jnode); ffc0f450: 38 80 00 00 li r4,0 ffc0f454: 4b ff 51 d9 bl ffc0462c ffc0f458: 81 21 00 08 lwz r9,8(r1) ffc0f45c: 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; ffc0f460: 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; } ffc0f464: 81 81 00 18 lwz r12,24(r1) ffc0f468: 39 61 00 40 addi r11,r1,64 ffc0f46c: 7d 80 81 20 mtcrf 8,r12 ffc0f470: 4b ff 11 34 b ffc005a4 <_restgpr_23_x> =============================================================================== ffc0ec2c : my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { ffc0ec2c: 3d 20 00 00 lis r9,0 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { ffc0ec30: 94 21 ff e8 stwu r1,-24(r1) ffc0ec34: 7c 08 02 a6 mflr r0 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { ffc0ec38: 81 29 28 44 lwz r9,10308(r9) #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { ffc0ec3c: bf 81 00 08 stmw r28,8(r1) ffc0ec40: 7c 7f 1b 78 mr r31,r3 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { ffc0ec44: 55 29 f0 be rlwinm r9,r9,30,2,31 ffc0ec48: 39 49 ff ff addi r10,r9,-1 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { ffc0ec4c: 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 ) { ffc0ec50: 7f 84 50 40 cmplw cr7,r4,r10 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { ffc0ec54: 7c 9e 23 78 mr r30,r4 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { ffc0ec58: 41 9d 00 4c bgt- cr7,ffc0eca4 p = info->indirect; if ( malloc_it ) { ffc0ec5c: 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; ffc0ec60: 81 23 00 58 lwz r9,88(r3) ffc0ec64: 2f 89 00 00 cmpwi cr7,r9,0 if ( malloc_it ) { ffc0ec68: 41 9a 00 2c beq- cr6,ffc0ec94 if ( !p ) { ffc0ec6c: 40 be 00 1c bne+ cr7,ffc0ec88 p = memfile_alloc_block(); ffc0ec70: 4b ff ff 79 bl ffc0ebe8 if ( !p ) ffc0ec74: 2c 03 00 00 cmpwi r3,0 ffc0ec78: 40 a2 00 0c bne+ ffc0ec84 <== ALWAYS TAKEN return 0; ffc0ec7c: 38 60 00 00 li r3,0 <== NOT EXECUTED ffc0ec80: 48 00 01 88 b ffc0ee08 <== NOT EXECUTED info->indirect = p; ffc0ec84: 90 7f 00 58 stw r3,88(r31) } return &info->indirect[ my_block ]; ffc0ec88: 57 de 10 3a rlwinm r30,r30,2,0,29 ffc0ec8c: 80 7f 00 58 lwz r3,88(r31) ffc0ec90: 48 00 00 84 b ffc0ed14 } if ( !p ) ffc0ec94: 41 be ff e8 beq- cr7,ffc0ec7c <== NEVER TAKEN return 0; return &info->indirect[ my_block ]; ffc0ec98: 54 9e 10 3a rlwinm r30,r4,2,0,29 ffc0ec9c: 7c 69 f2 14 add r3,r9,r30 ffc0eca0: 48 00 01 68 b ffc0ee08 /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { ffc0eca4: 38 69 00 01 addi r3,r9,1 ffc0eca8: 7c 63 49 d6 mullw r3,r3,r9 ffc0ecac: 39 43 ff ff addi r10,r3,-1 ffc0ecb0: 7f 84 50 40 cmplw cr7,r4,r10 ffc0ecb4: 41 9d 00 88 bgt- cr7,ffc0ed3c my_block -= FIRST_DOUBLY_INDIRECT; ffc0ecb8: 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; ffc0ecbc: 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; ffc0ecc0: 7f be 4b 96 divwu r29,r30,r9 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; p = info->doubly_indirect; if ( malloc_it ) { ffc0ecc4: 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; ffc0ecc8: 7d 3d 49 d6 mullw r9,r29,r9 ffc0eccc: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ecd0: 7f c9 f0 50 subf r30,r9,r30 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; p = info->doubly_indirect; if ( malloc_it ) { ffc0ecd4: 41 9a 00 48 beq- cr6,ffc0ed1c if ( !p ) { ffc0ecd8: 40 be 00 14 bne+ cr7,ffc0ecec p = memfile_alloc_block(); ffc0ecdc: 4b ff ff 0d bl ffc0ebe8 if ( !p ) ffc0ece0: 2c 03 00 00 cmpwi r3,0 ffc0ece4: 41 a2 ff 98 beq- ffc0ec7c <== NEVER TAKEN return 0; info->doubly_indirect = p; ffc0ece8: 90 7f 00 5c stw r3,92(r31) } p1 = (block_p *)p[ doubly ]; ffc0ecec: 57 bd 10 3a rlwinm r29,r29,2,0,29 ffc0ecf0: 7f e3 ea 14 add r31,r3,r29 ffc0ecf4: 7c 63 e8 2e lwzx r3,r3,r29 if ( !p1 ) { ffc0ecf8: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ecfc: 40 be 00 14 bne+ cr7,ffc0ed10 p1 = memfile_alloc_block(); ffc0ed00: 4b ff fe e9 bl ffc0ebe8 if ( !p1 ) ffc0ed04: 2c 03 00 00 cmpwi r3,0 ffc0ed08: 41 a2 ff 74 beq- ffc0ec7c <== NEVER TAKEN return 0; p[ doubly ] = (block_p) p1; ffc0ed0c: 90 7f 00 00 stw r3,0(r31) } return (block_p *)&p1[ singly ]; ffc0ed10: 57 de 10 3a rlwinm r30,r30,2,0,29 ffc0ed14: 7c 63 f2 14 add r3,r3,r30 ffc0ed18: 48 00 00 f0 b ffc0ee08 } if ( !p ) ffc0ed1c: 41 be ff 60 beq- cr7,ffc0ec7c <== NEVER TAKEN return 0; p = (block_p *)p[ doubly ]; ffc0ed20: 57 bd 10 3a rlwinm r29,r29,2,0,29 ffc0ed24: 7d 43 e8 2e lwzx r10,r3,r29 if ( !p ) ffc0ed28: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0ed2c: 41 be ff 50 beq- cr7,ffc0ec7c <== NEVER TAKEN return 0; return (block_p *)&p[ singly ]; ffc0ed30: 57 de 10 3a rlwinm r30,r30,2,0,29 ffc0ed34: 7c 6a f2 14 add r3,r10,r30 ffc0ed38: 48 00 00 d0 b ffc0ee08 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { ffc0ed3c: 39 43 00 01 addi r10,r3,1 ffc0ed40: 7d 4a 49 d6 mullw r10,r10,r9 ffc0ed44: 39 4a ff ff addi r10,r10,-1 ffc0ed48: 7f 84 50 40 cmplw cr7,r4,r10 ffc0ed4c: 41 bd ff 30 bgt- cr7,ffc0ec7c <== NEVER TAKEN my_block -= FIRST_TRIPLY_INDIRECT; ffc0ed50: 7f c3 20 50 subf r30,r3,r4 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; ffc0ed54: 7d 5e 4b 96 divwu r10,r30,r9 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; ffc0ed58: 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; ffc0ed5c: 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 ) { ffc0ed60: 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; ffc0ed64: 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; ffc0ed68: 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; ffc0ed6c: 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; ffc0ed70: 7f 89 50 50 subf r28,r9,r10 ffc0ed74: 2f 83 00 00 cmpwi cr7,r3,0 p = info->triply_indirect; if ( malloc_it ) { ffc0ed78: 41 9a 00 64 beq- cr6,ffc0eddc if ( !p ) { ffc0ed7c: 40 be 00 14 bne+ cr7,ffc0ed90 p = memfile_alloc_block(); ffc0ed80: 4b ff fe 69 bl ffc0ebe8 if ( !p ) ffc0ed84: 2c 03 00 00 cmpwi r3,0 ffc0ed88: 41 a2 fe f4 beq- ffc0ec7c <== NEVER TAKEN return 0; info->triply_indirect = p; ffc0ed8c: 90 7f 00 60 stw r3,96(r31) } p1 = (block_p *) p[ triply ]; ffc0ed90: 57 bd 10 3a rlwinm r29,r29,2,0,29 ffc0ed94: 7f e3 ea 14 add r31,r3,r29 ffc0ed98: 7c 63 e8 2e lwzx r3,r3,r29 if ( !p1 ) { ffc0ed9c: 2f 83 00 00 cmpwi cr7,r3,0 ffc0eda0: 40 be 00 14 bne+ cr7,ffc0edb4 p1 = memfile_alloc_block(); ffc0eda4: 4b ff fe 45 bl ffc0ebe8 if ( !p1 ) ffc0eda8: 2c 03 00 00 cmpwi r3,0 ffc0edac: 41 a2 fe d0 beq- ffc0ec7c <== NEVER TAKEN return 0; p[ triply ] = (block_p) p1; ffc0edb0: 90 7f 00 00 stw r3,0(r31) } p2 = (block_p *)p1[ doubly ]; ffc0edb4: 57 9c 10 3a rlwinm r28,r28,2,0,29 ffc0edb8: 7d 23 e0 2e lwzx r9,r3,r28 ffc0edbc: 7f e3 e2 14 add r31,r3,r28 if ( !p2 ) { ffc0edc0: 2f 89 00 00 cmpwi cr7,r9,0 ffc0edc4: 40 be 00 3c bne+ cr7,ffc0ee00 p2 = memfile_alloc_block(); ffc0edc8: 4b ff fe 21 bl ffc0ebe8 if ( !p2 ) ffc0edcc: 7c 69 1b 79 mr. r9,r3 ffc0edd0: 41 a2 fe ac beq- ffc0ec7c <== NEVER TAKEN return 0; p1[ doubly ] = (block_p) p2; ffc0edd4: 91 3f 00 00 stw r9,0(r31) ffc0edd8: 48 00 00 28 b ffc0ee00 } return (block_p *)&p2[ singly ]; } if ( !p ) ffc0eddc: 41 be fe a0 beq- cr7,ffc0ec7c <== NEVER TAKEN return 0; p1 = (block_p *) p[ triply ]; ffc0ede0: 57 bd 10 3a rlwinm r29,r29,2,0,29 ffc0ede4: 7d 03 e8 2e lwzx r8,r3,r29 if ( !p1 ) ffc0ede8: 2f 88 00 00 cmpwi cr7,r8,0 ffc0edec: 41 be fe 90 beq- cr7,ffc0ec7c <== NEVER TAKEN return 0; p2 = (block_p *)p1[ doubly ]; ffc0edf0: 57 9c 10 3a rlwinm r28,r28,2,0,29 ffc0edf4: 7d 28 e0 2e lwzx r9,r8,r28 if ( !p2 ) ffc0edf8: 2f 89 00 00 cmpwi cr7,r9,0 ffc0edfc: 41 be fe 80 beq- cr7,ffc0ec7c <== NEVER TAKEN return 0; return (block_p *)&p2[ singly ]; ffc0ee00: 57 c3 10 3a rlwinm r3,r30,2,0,29 ffc0ee04: 7c 69 1a 14 add r3,r9,r3 /* * This means the requested block number is out of range. */ return 0; } ffc0ee08: 39 61 00 18 addi r11,r1,24 ffc0ee0c: 4b ff 17 ac b ffc005b8 <_restgpr_28_x> =============================================================================== ffc0ee10 : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { ffc0ee10: 94 21 ff c8 stwu r1,-56(r1) ffc0ee14: 7c 08 02 a6 mflr r0 ffc0ee18: bf 01 00 18 stmw r24,24(r1) ffc0ee1c: 7c 7c 1b 78 mr r28,r3 ffc0ee20: 7c df 33 78 mr r31,r6 ffc0ee24: 90 01 00 3c stw r0,60(r1) ffc0ee28: 7c be 2b 78 mr r30,r5 ffc0ee2c: 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; ffc0ee30: 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 ) { ffc0ee34: 81 29 00 00 lwz r9,0(r9) ffc0ee38: 2f 89 00 05 cmpwi cr7,r9,5 ffc0ee3c: 40 be 00 68 bne+ cr7,ffc0eea4 unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) ffc0ee40: 81 43 00 50 lwz r10,80(r3) ffc0ee44: 39 20 00 00 li r9,0 ffc0ee48: 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; ffc0ee4c: 80 83 00 58 lwz r4,88(r3) if (my_length > (the_jnode->info.linearfile.size - start)) ffc0ee50: 7c ff 58 10 subfc r7,r31,r11 ffc0ee54: 7c de 51 10 subfe r6,r30,r10 ffc0ee58: 7f 89 30 00 cmpw cr7,r9,r6 ffc0ee5c: 41 bd 00 10 bgt+ cr7,ffc0ee6c <== NEVER TAKEN ffc0ee60: 40 9e 00 14 bne- cr7,ffc0ee74 <== NEVER TAKEN ffc0ee64: 7f 88 38 40 cmplw cr7,r8,r7 ffc0ee68: 40 9d 00 0c ble- cr7,ffc0ee74 <== NEVER TAKEN my_length = the_jnode->info.linearfile.size - start; ffc0ee6c: 7f bf 58 50 subf r29,r31,r11 ffc0ee70: 48 00 00 08 b ffc0ee78 /* * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; ffc0ee74: 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); ffc0ee78: 7c 84 fa 14 add r4,r4,r31 ffc0ee7c: 7f a5 eb 78 mr r5,r29 ffc0ee80: 7f 43 d3 78 mr r3,r26 ffc0ee84: 48 00 24 2d bl ffc112b0 IMFS_update_atime( the_jnode ); ffc0ee88: 38 61 00 08 addi r3,r1,8 ffc0ee8c: 38 80 00 00 li r4,0 ffc0ee90: 4b ff 57 9d bl ffc0462c ffc0ee94: 81 21 00 08 lwz r9,8(r1) return my_length; ffc0ee98: 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 ); ffc0ee9c: 91 3c 00 40 stw r9,64(r28) return my_length; ffc0eea0: 48 00 01 78 b ffc0f018 /* * 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 ) ffc0eea4: 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; ffc0eea8: 7c c9 33 78 mr r9,r6 ffc0eeac: 7c e8 32 14 add r7,r8,r6 if ( last_byte > the_jnode->info.file.size ) ffc0eeb0: 83 a3 00 54 lwz r29,84(r3) ffc0eeb4: 38 c0 00 00 li r6,0 ffc0eeb8: 7f 86 50 00 cmpw cr7,r6,r10 ffc0eebc: 41 9d 00 10 bgt- cr7,ffc0eecc <== NEVER TAKEN ffc0eec0: 40 9e 00 14 bne- cr7,ffc0eed4 <== NEVER TAKEN ffc0eec4: 7f 87 e8 40 cmplw cr7,r7,r29 ffc0eec8: 40 9d 00 0c ble- cr7,ffc0eed4 my_length = the_jnode->info.file.size - start; ffc0eecc: 7f a9 e8 50 subf r29,r9,r29 ffc0eed0: 48 00 00 08 b ffc0eed8 /* * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; ffc0eed4: 7d 1d 43 78 mr r29,r8 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0eed8: 3d 20 00 00 lis r9,0 ffc0eedc: 83 69 28 44 lwz r27,10308(r9) ffc0eee0: 7f c3 f3 78 mr r3,r30 ffc0eee4: 7f e4 fb 78 mr r4,r31 ffc0eee8: 7f 78 fe 70 srawi r24,r27,31 ffc0eeec: 7f 05 c3 78 mr r5,r24 ffc0eef0: 7f 66 db 78 mr r6,r27 ffc0eef4: 48 00 b3 65 bl ffc1a258 <__moddi3> block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0eef8: 7f c3 f3 78 mr r3,r30 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0eefc: 7c 99 23 78 mr r25,r4 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0ef00: 7f 05 c3 78 mr r5,r24 ffc0ef04: 7f e4 fb 78 mr r4,r31 ffc0ef08: 7f 66 db 78 mr r6,r27 ffc0ef0c: 48 00 af 29 bl ffc19e34 <__divdi3> if ( start_offset ) { ffc0ef10: 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; ffc0ef14: 7c 9e 23 78 mr r30,r4 if ( start_offset ) { ffc0ef18: 41 9e 00 5c beq- cr7,ffc0ef74 to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; ffc0ef1c: 7d 39 d8 50 subf r9,r25,r27 ffc0ef20: 7f 9d 48 40 cmplw cr7,r29,r9 ffc0ef24: 7f bb eb 78 mr r27,r29 ffc0ef28: 40 9d 00 08 ble- cr7,ffc0ef30 ffc0ef2c: 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 ); ffc0ef30: 7f 83 e3 78 mr r3,r28 ffc0ef34: 7f c4 f3 78 mr r4,r30 ffc0ef38: 38 a0 00 00 li r5,0 ffc0ef3c: 4b ff fc f1 bl ffc0ec2c if ( !block_ptr ) return copied; ffc0ef40: 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 ) ffc0ef44: 2c 03 00 00 cmpwi r3,0 ffc0ef48: 41 82 00 d0 beq- ffc0f018 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); ffc0ef4c: 80 83 00 00 lwz r4,0(r3) ffc0ef50: 7f 65 db 78 mr r5,r27 ffc0ef54: 7f 43 d3 78 mr r3,r26 ffc0ef58: 7c 84 ca 14 add r4,r4,r25 ffc0ef5c: 48 00 23 55 bl ffc112b0 dest += to_copy; ffc0ef60: 7f 5a da 14 add r26,r26,r27 block++; ffc0ef64: 3b de 00 01 addi r30,r30,1 my_length -= to_copy; ffc0ef68: 7f bb e8 50 subf r29,r27,r29 copied += to_copy; ffc0ef6c: 7f 7f db 78 mr r31,r27 ffc0ef70: 48 00 00 08 b ffc0ef78 */ last_byte = start + length; if ( last_byte > the_jnode->info.file.size ) my_length = the_jnode->info.file.size - start; copied = 0; ffc0ef74: 3b e0 00 00 li r31,0 } /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0ef78: 3d 20 00 00 lis r9,0 ffc0ef7c: 83 29 28 44 lwz r25,10308(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( ffc0ef80: 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 ) { ffc0ef84: 7d 38 4b 78 mr r24,r9 ffc0ef88: 48 00 00 38 b ffc0efc0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ffc0ef8c: 7f 83 e3 78 mr r3,r28 ffc0ef90: 7f c4 f3 78 mr r4,r30 ffc0ef94: 38 a0 00 00 li r5,0 ffc0ef98: 4b ff fc 95 bl ffc0ec2c if ( !block_ptr ) ffc0ef9c: 7c 69 1b 79 mr. r9,r3 ffc0efa0: 41 82 00 78 beq- ffc0f018 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); ffc0efa4: 80 89 00 00 lwz r4,0(r9) ffc0efa8: 7f 63 db 78 mr r3,r27 ffc0efac: 7f 25 cb 78 mr r5,r25 ffc0efb0: 48 00 23 01 bl ffc112b0 dest += to_copy; block++; ffc0efb4: 3b de 00 01 addi r30,r30,1 my_length -= to_copy; ffc0efb8: 7f b9 e8 50 subf r29,r25,r29 copied += to_copy; ffc0efbc: 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 ) { ffc0efc0: 81 38 28 44 lwz r9,10308(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( ffc0efc4: 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 ) { ffc0efc8: 7f 9d 48 40 cmplw cr7,r29,r9 ffc0efcc: 40 9c ff c0 bge+ cr7,ffc0ef8c /* * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { ffc0efd0: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0efd4: 41 9e 00 30 beq- cr7,ffc0f004 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ffc0efd8: 7f 83 e3 78 mr r3,r28 ffc0efdc: 7f c4 f3 78 mr r4,r30 ffc0efe0: 38 a0 00 00 li r5,0 ffc0efe4: 4b ff fc 49 bl ffc0ec2c if ( !block_ptr ) ffc0efe8: 7c 69 1b 79 mr. r9,r3 ffc0efec: 41 82 00 2c beq- ffc0f018 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); ffc0eff0: 80 89 00 00 lwz r4,0(r9) ffc0eff4: 7f 63 db 78 mr r3,r27 ffc0eff8: 7f a5 eb 78 mr r5,r29 ffc0effc: 48 00 22 b5 bl ffc112b0 copied += my_length; ffc0f000: 7f fd fa 14 add r31,r29,r31 } IMFS_update_atime( the_jnode ); ffc0f004: 38 61 00 08 addi r3,r1,8 ffc0f008: 38 80 00 00 li r4,0 ffc0f00c: 4b ff 56 21 bl ffc0462c ffc0f010: 81 21 00 08 lwz r9,8(r1) ffc0f014: 91 3c 00 40 stw r9,64(r28) return copied; } ffc0f018: 39 61 00 38 addi r11,r1,56 ffc0f01c: 7f e3 fb 78 mr r3,r31 ffc0f020: 4b ff 15 88 b ffc005a8 <_restgpr_24_x> =============================================================================== ffc0f168 : * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { ffc0f168: 94 21 ff d8 stwu r1,-40(r1) ffc0f16c: 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; ffc0f170: 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 ) { ffc0f174: 90 01 00 2c stw r0,44(r1) ffc0f178: bf 21 00 0c stmw r25,12(r1) ffc0f17c: 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; ffc0f180: 83 c9 28 44 lwz r30,10308(r9) * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { ffc0f184: 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; ffc0f188: 57 de f0 be rlwinm r30,r30,30,2,31 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { ffc0f18c: 2f 89 00 00 cmpwi cr7,r9,0 ffc0f190: 41 9e 00 10 beq- cr7,ffc0f1a0 memfile_free_blocks_in_table( &info->indirect, to_free ); ffc0f194: 38 63 00 58 addi r3,r3,88 ffc0f198: 7f c4 f3 78 mr r4,r30 ffc0f19c: 4b ff ff 69 bl ffc0f104 } if ( info->doubly_indirect ) { ffc0f1a0: 81 3f 00 5c lwz r9,92(r31) ffc0f1a4: 3b a0 00 00 li r29,0 for ( i=0 ; iindirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { ffc0f1ac: 2f 89 00 00 cmpwi cr7,r9,0 ffc0f1b0: 40 be 00 2c bne+ cr7,ffc0f1dc ffc0f1b4: 48 00 00 44 b ffc0f1f8 for ( i=0 ; idoubly_indirect[i] ) { ffc0f1b8: 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( ffc0f1bc: 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] ) { ffc0f1c0: 7c 69 52 14 add r3,r9,r10 ffc0f1c4: 7d 29 50 2e lwzx r9,r9,r10 ffc0f1c8: 2f 89 00 00 cmpwi cr7,r9,0 ffc0f1cc: 41 9e 00 0c beq- cr7,ffc0f1d8 <== NEVER TAKEN memfile_free_blocks_in_table( ffc0f1d0: 7f c4 f3 78 mr r4,r30 ffc0f1d4: 4b ff ff 31 bl ffc0f104 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 ); ffc0f1ec: 38 7f 00 5c addi r3,r31,92 ffc0f1f0: 7f c4 f3 78 mr r4,r30 ffc0f1f4: 4b ff ff 11 bl ffc0f104 } if ( info->triply_indirect ) { ffc0f1f8: 81 3f 00 60 lwz r9,96(r31) ffc0f1fc: 3b a0 00 00 li r29,0 for ( i=0 ; idoubly_indirect, to_free ); } if ( info->triply_indirect ) { ffc0f204: 2f 89 00 00 cmpwi cr7,r9,0 ffc0f208: 40 be 00 68 bne+ cr7,ffc0f270 ffc0f20c: 48 00 00 80 b ffc0f28c for ( i=0 ; itriply_indirect[i]; ffc0f210: 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( ffc0f214: 57 b9 10 3a rlwinm r25,r29,2,0,29 } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; ffc0f218: 7f 89 c8 2e lwzx r28,r9,r25 if ( !p ) /* ensure we have a valid pointer */ ffc0f21c: 2f 9c 00 00 cmpwi cr7,r28,0 ffc0f220: 41 9e 00 60 beq- cr7,ffc0f280 <== NEVER TAKEN ffc0f224: 3b 60 00 00 li r27,0 ffc0f228: 48 00 00 24 b ffc0f24c break; for ( j=0 ; j<== NEVER TAKEN memfile_free_blocks_in_table( (block_p **)&p[j], to_free); ffc0f238: 7f 83 e3 78 mr r3,r28 ffc0f23c: 7f c4 f3 78 mr r4,r30 ffc0f240: 4b ff fe c5 bl ffc0f104 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( ffc0f25c: 80 7f 00 60 lwz r3,96(r31) ffc0f260: 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( ffc0f280: 38 7f 00 60 addi r3,r31,96 ffc0f284: 7f c4 f3 78 mr r4,r30 ffc0f288: 4b ff fe 7d bl ffc0f104 (block_p **)&info->triply_indirect, to_free ); } return the_jnode; } ffc0f28c: 39 61 00 28 addi r11,r1,40 ffc0f290: 7f e3 fb 78 mr r3,r31 ffc0f294: 4b ff 13 18 b ffc005ac <_restgpr_25_x> =============================================================================== ffc0f298 : */ MEMFILE_STATIC int IMFS_memfile_remove_block( IMFS_jnode_t *the_jnode, unsigned int block ) { ffc0f298: 94 21 ff f8 stwu r1,-8(r1) <== NOT EXECUTED ffc0f29c: 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 ); ffc0f2a0: 38 a0 00 00 li r5,0 <== NOT EXECUTED */ MEMFILE_STATIC int IMFS_memfile_remove_block( IMFS_jnode_t *the_jnode, unsigned int block ) { ffc0f2a4: 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 ); ffc0f2a8: 4b ff f9 85 bl ffc0ec2c <== NOT EXECUTED ffc0f2ac: 7c 69 1b 78 mr r9,r3 <== NOT EXECUTED IMFS_assert( block_ptr ); ptr = *block_ptr; *block_ptr = 0; ffc0f2b0: 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; ffc0f2b4: 80 63 00 00 lwz r3,0(r3) <== NOT EXECUTED *block_ptr = 0; ffc0f2b8: 91 49 00 00 stw r10,0(r9) <== NOT EXECUTED memfile_free_block( ptr ); ffc0f2bc: 4b ff fe 19 bl ffc0f0d4 <== NOT EXECUTED return 1; } ffc0f2c0: 80 01 00 0c lwz r0,12(r1) <== NOT EXECUTED ffc0f2c4: 38 60 00 01 li r3,1 <== NOT EXECUTED ffc0f2c8: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc0f2cc: 38 21 00 08 addi r1,r1,8 <== NOT EXECUTED ffc0f2d0: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc0f474 : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { ffc0f474: 94 21 ff c8 stwu r1,-56(r1) ffc0f478: 7c 08 02 a6 mflr r0 ffc0f47c: bf 01 00 18 stmw r24,24(r1) ffc0f480: 7c dd 33 78 mr r29,r6 ffc0f484: 7d 1c 43 78 mr r28,r8 ffc0f488: 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; ffc0f48c: 7c c8 32 14 add r6,r8,r6 if ( last_byte > the_jnode->info.file.size ) { ffc0f490: 39 00 00 00 li r8,0 ffc0f494: 81 43 00 50 lwz r10,80(r3) IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { ffc0f498: 7c 7e 1b 78 mr r30,r3 ffc0f49c: 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 ) { ffc0f4a0: 81 23 00 54 lwz r9,84(r3) ffc0f4a4: 7f 88 50 00 cmpw cr7,r8,r10 IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { ffc0f4a8: 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 ) { ffc0f4ac: 41 9d 00 5c bgt- cr7,ffc0f508 <== NEVER TAKEN ffc0f4b0: 40 be 00 0c bne+ cr7,ffc0f4bc <== NEVER TAKEN ffc0f4b4: 7f 86 48 40 cmplw cr7,r6,r9 ffc0f4b8: 41 9d 00 50 bgt- cr7,ffc0f508 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0f4bc: 3d 20 00 00 lis r9,0 ffc0f4c0: 83 e9 28 44 lwz r31,10308(r9) ffc0f4c4: 7f a4 eb 78 mr r4,r29 ffc0f4c8: 7f 43 d3 78 mr r3,r26 ffc0f4cc: 7f f8 fe 70 srawi r24,r31,31 ffc0f4d0: 7f 05 c3 78 mr r5,r24 ffc0f4d4: 7f e6 fb 78 mr r6,r31 ffc0f4d8: 48 00 ad 81 bl ffc1a258 <__moddi3> block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0f4dc: 7f 43 d3 78 mr r3,r26 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0f4e0: 7c 99 23 78 mr r25,r4 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0f4e4: 7f 05 c3 78 mr r5,r24 ffc0f4e8: 7f a4 eb 78 mr r4,r29 ffc0f4ec: 7f e6 fb 78 mr r6,r31 ffc0f4f0: 48 00 a9 45 bl ffc19e34 <__divdi3> if ( start_offset ) { ffc0f4f4: 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; ffc0f4f8: 7c 9d 23 78 mr r29,r4 if ( start_offset ) { ffc0f4fc: 40 9e 00 44 bne- cr7,ffc0f540 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); if ( status ) return status; } copied = 0; ffc0f500: 3b e0 00 00 li r31,0 ffc0f504: 48 00 00 88 b ffc0f58c * 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; ffc0f508: 7f 9a 50 00 cmpw cr7,r26,r10 ffc0f50c: 38 80 00 01 li r4,1 ffc0f510: 41 9d 00 14 bgt- cr7,ffc0f524 <== NEVER TAKEN ffc0f514: 40 be 00 0c bne+ cr7,ffc0f520 <== NEVER TAKEN ffc0f518: 7f 9d 48 40 cmplw cr7,r29,r9 ffc0f51c: 41 9d 00 08 bgt- cr7,ffc0f524 ffc0f520: 38 80 00 00 li r4,0 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); ffc0f524: 7f c3 f3 78 mr r3,r30 ffc0f528: 54 84 07 fe clrlwi r4,r4,31 ffc0f52c: 38 a0 00 00 li r5,0 ffc0f530: 4b ff fd a5 bl ffc0f2d4 if ( status ) ffc0f534: 7c 69 1b 79 mr. r9,r3 ffc0f538: 41 82 ff 84 beq+ ffc0f4bc ffc0f53c: 48 00 00 fc b ffc0f638 * 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; ffc0f540: 7f f9 f8 50 subf r31,r25,r31 ffc0f544: 7f 9f e0 40 cmplw cr7,r31,r28 ffc0f548: 40 9d 00 08 ble- cr7,ffc0f550 ffc0f54c: 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 ); ffc0f550: 7f c3 f3 78 mr r3,r30 ffc0f554: 7f a4 eb 78 mr r4,r29 ffc0f558: 38 a0 00 00 li r5,0 ffc0f55c: 4b ff f6 d1 bl ffc0ec2c if ( !block_ptr ) return copied; ffc0f560: 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 ) ffc0f564: 2c 03 00 00 cmpwi r3,0 ffc0f568: 41 82 00 d0 beq- ffc0f638 <== NEVER TAKEN block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); ffc0f56c: 80 63 00 00 lwz r3,0(r3) ffc0f570: 7f 64 db 78 mr r4,r27 ffc0f574: 7f e5 fb 78 mr r5,r31 ffc0f578: 7c 63 ca 14 add r3,r3,r25 ffc0f57c: 48 00 1d 35 bl ffc112b0 src += to_copy; ffc0f580: 7f 7b fa 14 add r27,r27,r31 block++; ffc0f584: 3b bd 00 01 addi r29,r29,1 my_length -= to_copy; ffc0f588: 7f 9f e0 50 subf r28,r31,r28 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; ffc0f58c: 3d 20 00 00 lis r9,0 ffc0f590: 83 49 28 44 lwz r26,10308(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( ffc0f594: 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 ) { ffc0f598: 7d 38 4b 78 mr r24,r9 ffc0f59c: 48 00 00 38 b ffc0f5d4 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ffc0f5a0: 7f c3 f3 78 mr r3,r30 ffc0f5a4: 7f a4 eb 78 mr r4,r29 ffc0f5a8: 38 a0 00 00 li r5,0 ffc0f5ac: 4b ff f6 81 bl ffc0ec2c if ( !block_ptr ) ffc0f5b0: 2c 03 00 00 cmpwi r3,0 ffc0f5b4: 41 82 00 80 beq- ffc0f634 <== 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 ); ffc0f5b8: 80 63 00 00 lwz r3,0(r3) ffc0f5bc: 7f 24 cb 78 mr r4,r25 ffc0f5c0: 7f 45 d3 78 mr r5,r26 ffc0f5c4: 48 00 1c ed bl ffc112b0 src += to_copy; block++; ffc0f5c8: 3b bd 00 01 addi r29,r29,1 my_length -= to_copy; ffc0f5cc: 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( ffc0f5d0: 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 ) { ffc0f5d4: 81 38 28 44 lwz r9,10308(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( ffc0f5d8: 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 ) { ffc0f5dc: 7f 9c 48 40 cmplw cr7,r28,r9 ffc0f5e0: 40 9c ff c0 bge+ cr7,ffc0f5a0 * 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 ) { ffc0f5e4: 2f 9c 00 00 cmpwi cr7,r28,0 ffc0f5e8: 41 9e 00 34 beq- cr7,ffc0f61c block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ffc0f5ec: 7f c3 f3 78 mr r3,r30 ffc0f5f0: 7f a4 eb 78 mr r4,r29 ffc0f5f4: 38 a0 00 00 li r5,0 ffc0f5f8: 4b ff f6 35 bl ffc0ec2c if ( !block_ptr ) ffc0f5fc: 7f e9 fb 78 mr r9,r31 ffc0f600: 2c 03 00 00 cmpwi r3,0 ffc0f604: 41 82 00 34 beq- ffc0f638 <== 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 ); ffc0f608: 80 63 00 00 lwz r3,0(r3) ffc0f60c: 7f 24 cb 78 mr r4,r25 ffc0f610: 7f 85 e3 78 mr r5,r28 ffc0f614: 48 00 1c 9d bl ffc112b0 my_length = 0; copied += to_copy; ffc0f618: 7f ff e2 14 add r31,r31,r28 } IMFS_mtime_ctime_update( the_jnode ); ffc0f61c: 38 61 00 08 addi r3,r1,8 ffc0f620: 38 80 00 00 li r4,0 ffc0f624: 4b ff 50 09 bl ffc0462c ffc0f628: 81 21 00 08 lwz r9,8(r1) ffc0f62c: 91 3e 00 44 stw r9,68(r30) ffc0f630: 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 ) ffc0f634: 7f e9 fb 78 mr r9,r31 } IMFS_mtime_ctime_update( the_jnode ); return copied; } ffc0f638: 39 61 00 38 addi r11,r1,56 ffc0f63c: 7d 23 4b 78 mr r3,r9 ffc0f640: 4b ff 0f 68 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 71 59 bl ffc1adbc <_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 89 fd bl ffc0c6ec 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 c8 35 bl ffc105ac <__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 c8 29 bl ffc105ac <__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 =============================================================================== ffc0cb1c : } static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { ffc0cb1c: 94 21 ff f8 stwu r1,-8(r1) ffc0cb20: 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 ); ffc0cb24: 39 43 00 54 addi r10,r3,84 ffc0cb28: 90 01 00 0c stw r0,12(r1) if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { ffc0cb2c: 81 23 00 50 lwz r9,80(r3) ffc0cb30: 7f 89 50 00 cmpw cr7,r9,r10 ffc0cb34: 41 be 00 10 beq+ cr7,ffc0cb44 errno = ENOTEMPTY; ffc0cb38: 48 00 3a 75 bl ffc105ac <__errno> ffc0cb3c: 39 20 00 5a li r9,90 ffc0cb40: 48 00 00 18 b ffc0cb58 node = NULL; } else if ( IMFS_is_mount_point( node ) ) { ffc0cb44: 81 23 00 5c lwz r9,92(r3) ffc0cb48: 2f 89 00 00 cmpwi cr7,r9,0 ffc0cb4c: 41 be 00 14 beq+ cr7,ffc0cb60 <== ALWAYS TAKEN errno = EBUSY; ffc0cb50: 48 00 3a 5d bl ffc105ac <__errno> <== NOT EXECUTED ffc0cb54: 39 20 00 10 li r9,16 <== NOT EXECUTED ffc0cb58: 91 23 00 00 stw r9,0(r3) ffc0cb5c: 38 60 00 00 li r3,0 node = NULL; } return node; } ffc0cb60: 80 01 00 0c lwz r0,12(r1) ffc0cb64: 38 21 00 08 addi r1,r1,8 ffc0cb68: 7c 08 03 a6 mtlr r0 ffc0cb6c: 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 d4 61 bl ffc112b0 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 c7 05 bl ffc105ac <__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 c6 f9 bl ffc105ac <__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 c5 9d bl ffc105ac <__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 c5 91 bl ffc105ac <__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 90 lwz r28,10128(r9) if ( !rtems_configuration_get_unified_work_area() ) { ffc04838: 3d 20 ff c2 lis r9,-62 ffc0483c: 89 29 bf c9 lbz r9,-16439(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 9b 50 addi r30,r30,-25776 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 9b 50 addi r9,r9,-25776 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 55 19 bl ffc09dd0 <_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 28 08 lwz r9,10248(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 98 lwz r30,11160(r31) ffc048e0: 7f 83 e3 78 mr r3,r28 ffc048e4: 48 00 5d e1 bl ffc0a6c4 <_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 98 stw r3,11160(r31) } ffc048f4: 4b ff bc bc b ffc005b0 <_restgpr_26_x> =============================================================================== ffc23384 : static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { ffc23384: 94 21 ff c0 stwu r1,-64(r1) ffc23388: 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 ); ffc2338c: 39 23 00 c4 addi r9,r3,196 static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { ffc23390: 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); ffc23394: 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) ffc23398: 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 ) { ffc2339c: 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) ffc233a0: 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 ) { ffc233a4: 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); ffc233a8: 83 63 00 b4 lwz r27,180(r3) current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); ffc233ac: 83 29 00 20 lwz r25,32(r9) } low = Stack_check_usable_stack_start(stack); ffc233b0: 81 23 00 b8 lwz r9,184(r3) size = Stack_check_usable_stack_size(stack); ffc233b4: 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++) ffc233b8: 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); ffc233bc: 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; ffc233c0: 39 29 01 00 addi r9,r9,256 for (ebase = base + length; base < ebase; base++) ffc233c4: 7c e9 3a 14 add r7,r9,r7 ffc233c8: 48 00 00 14 b ffc233dc if (*base != U32_PATTERN) ffc233cc: 81 49 00 00 lwz r10,0(r9) ffc233d0: 7f 8a 30 00 cmpw cr7,r10,r6 ffc233d4: 40 9e 00 18 bne- cr7,ffc233ec * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) ffc233d8: 39 29 00 04 addi r9,r9,4 ffc233dc: 7f 89 38 40 cmplw cr7,r9,r7 ffc233e0: 41 9c ff ec blt+ cr7,ffc233cc <== 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; ffc233e4: 3b 80 00 00 li r28,0 <== NOT EXECUTED ffc233e8: 48 00 00 18 b ffc23400 <== 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 ) ffc233ec: 2f 89 00 00 cmpwi cr7,r9,0 used = Stack_check_Calculate_used( low, size, high_water_mark ); else used = 0; ffc233f0: 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 ) ffc233f4: 41 9e 00 0c beq- cr7,ffc23400 <== NEVER TAKEN used = Stack_check_Calculate_used( low, size, high_water_mark ); ffc233f8: 7f 88 da 14 add r28,r8,r27 ffc233fc: 7f 89 e0 50 subf r28,r9,r28 #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) #endif { (*print_handler)( ffc23400: 3f c0 00 00 lis r30,0 ffc23404: 83 5f 00 08 lwz r26,8(r31) ffc23408: 3b be 5d 48 addi r29,r30,23880 ffc2340c: 83 1e 5d 48 lwz r24,23880(r30) ffc23410: 82 fd 00 04 lwz r23,4(r29) ffc23414: 38 80 00 05 li r4,5 ffc23418: 38 a1 00 08 addi r5,r1,8 ffc2341c: 7f 43 d3 78 mr r3,r26 ffc23420: 4b fe ca f9 bl ffc0ff18 ffc23424: 3c 80 ff c6 lis r4,-58 ffc23428: 7c 66 1b 78 mr r6,r3 ffc2342c: 7f 09 03 a6 mtctr r24 ffc23430: 38 84 ae 68 addi r4,r4,-20888 ffc23434: 7f 45 d3 78 mr r5,r26 ffc23438: 7e e3 bb 78 mr r3,r23 ffc2343c: 4c c6 31 82 crclr 4*cr1+eq ffc23440: 4e 80 04 21 bctrl (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, ffc23444: 80 df 00 b4 lwz r6,180(r31) else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( ffc23448: 81 3e 5d 48 lwz r9,23880(r30) ffc2344c: 3c 80 ff c6 lis r4,-58 print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, ffc23450: 80 bf 00 b8 lwz r5,184(r31) ffc23454: 38 c6 ff ff addi r6,r6,-1 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( ffc23458: 7d 29 03 a6 mtctr r9 ffc2345c: 80 7d 00 04 lwz r3,4(r29) ffc23460: 38 84 ae 75 addi r4,r4,-20875 ffc23464: 7c c5 32 14 add r6,r5,r6 ffc23468: 7f 27 cb 78 mr r7,r25 ffc2346c: 7f 68 db 78 mr r8,r27 ffc23470: 4c c6 31 82 crclr 4*cr1+eq ffc23474: 4e 80 04 21 bctrl stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { ffc23478: 81 3d 00 08 lwz r9,8(r29) (*print_handler)( print_context, "Unavailable\n" ); ffc2347c: 80 7d 00 04 lwz r3,4(r29) stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { ffc23480: 2f 89 00 00 cmpwi cr7,r9,0 (*print_handler)( print_context, "Unavailable\n" ); ffc23484: 81 3e 5d 48 lwz r9,23880(r30) stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { ffc23488: 40 be 00 1c bne+ cr7,ffc234a4 <== ALWAYS TAKEN (*print_handler)( print_context, "Unavailable\n" ); ffc2348c: 3c 80 ff c6 lis r4,-58 <== NOT EXECUTED ffc23490: 7d 29 03 a6 mtctr r9 <== NOT EXECUTED ffc23494: 38 84 ae 93 addi r4,r4,-20845 <== NOT EXECUTED ffc23498: 4c c6 31 82 crclr 4*cr1+eq <== NOT EXECUTED ffc2349c: 4e 80 04 21 bctrl <== NOT EXECUTED ffc234a0: 48 00 00 1c b ffc234bc <== NOT EXECUTED } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); ffc234a4: 3c 80 ff c6 lis r4,-58 ffc234a8: 7d 29 03 a6 mtctr r9 ffc234ac: 38 84 ae a0 addi r4,r4,-20832 ffc234b0: 7f 85 e3 78 mr r5,r28 ffc234b4: 4c c6 31 82 crclr 4*cr1+eq ffc234b8: 4e 80 04 21 bctrl } } ffc234bc: 39 61 00 40 addi r11,r1,64 ffc234c0: 48 03 10 2c b ffc544ec <_restgpr_23_x> =============================================================================== ffc23594 : Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { ffc23594: 94 21 ff c8 stwu r1,-56(r1) ffc23598: 7c 08 02 a6 mflr r0 ffc2359c: 90 01 00 3c stw r0,60(r1) ffc235a0: bf a1 00 2c stmw r29,44(r1) ffc235a4: 7c 7f 1b 78 mr r31,r3 ffc235a8: 7c 9d 23 78 mr r29,r4 Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); ffc235ac: 83 c3 00 b8 lwz r30,184(r3) char name[32]; printk("BLOWN STACK!!!\n"); ffc235b0: 3c 60 ff c6 lis r3,-58 ffc235b4: 38 63 ae a6 addi r3,r3,-20826 ffc235b8: 4c c6 31 82 crclr 4*cr1+eq ffc235bc: 4b fe 17 e9 bl ffc04da4 printk("task control block: 0x%08" PRIxPTR "\n", running); ffc235c0: 3c 60 ff c6 lis r3,-58 ffc235c4: 38 63 ae b6 addi r3,r3,-20810 ffc235c8: 7f e4 fb 78 mr r4,r31 ffc235cc: 4c c6 31 82 crclr 4*cr1+eq ffc235d0: 4b fe 17 d5 bl ffc04da4 printk("task ID: 0x%08lx\n", (unsigned long) running->Object.id); ffc235d4: 80 9f 00 08 lwz r4,8(r31) ffc235d8: 3c 60 ff c6 lis r3,-58 ffc235dc: 38 63 ae d2 addi r3,r3,-20782 ffc235e0: 4c c6 31 82 crclr 4*cr1+eq ffc235e4: 4b fe 17 c1 bl ffc04da4 printk( ffc235e8: 80 9f 00 0c lwz r4,12(r31) ffc235ec: 3c 60 ff c6 lis r3,-58 ffc235f0: 38 63 ae e4 addi r3,r3,-20764 ffc235f4: 4c c6 31 82 crclr 4*cr1+eq ffc235f8: 4b fe 17 ad bl ffc04da4 "task name: 0x%08" PRIx32 "\n", running->Object.name.name_u32 ); printk( ffc235fc: 80 7f 00 08 lwz r3,8(r31) ffc23600: 38 a1 00 08 addi r5,r1,8 ffc23604: 38 80 00 20 li r4,32 ffc23608: 4b fe c9 11 bl ffc0ff18 ffc2360c: 7c 64 1b 78 mr r4,r3 ffc23610: 3c 60 ff c6 lis r3,-58 ffc23614: 38 63 ae f8 addi r3,r3,-20744 ffc23618: 4c c6 31 82 crclr 4*cr1+eq ffc2361c: 4b fe 17 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) ffc23620: 80 bf 00 b8 lwz r5,184(r31) ffc23624: 80 9f 00 b4 lwz r4,180(r31) ); printk( "task name string: %s\n", rtems_object_get_name(running->Object.id, sizeof(name), name) ); printk( ffc23628: 3c 60 ff c6 lis r3,-58 ffc2362c: 38 63 af 0e addi r3,r3,-20722 ffc23630: 7c c5 22 14 add r6,r5,r4 ffc23634: 4c c6 31 82 crclr 4*cr1+eq ffc23638: 4b fe 17 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) { ffc2363c: 2f 9d 00 00 cmpwi cr7,r29,0 ffc23640: 40 be 00 20 bne+ cr7,ffc23660 <== NEVER TAKEN printk( ffc23644: 3c 60 ff c6 lis r3,-58 ffc23648: 38 63 af 3d addi r3,r3,-20675 ffc2364c: 38 80 00 80 li r4,128 ffc23650: 38 be 00 08 addi r5,r30,8 ffc23654: 38 de 00 88 addi r6,r30,136 ffc23658: 4c c6 31 82 crclr 4*cr1+eq ffc2365c: 4b fe 17 49 bl ffc04da4 rtems_configuration_get_user_multiprocessing_table()->node ); } #endif rtems_fatal( ffc23660: 80 9f 00 0c lwz r4,12(r31) ffc23664: 38 60 00 09 li r3,9 ffc23668: 4b fe 52 b5 bl ffc0891c =============================================================================== ffc0ee34 : /** * 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(); ffc0ee34: 3d 20 ff c2 lis r9,-62 ffc0ee38: 81 49 58 54 lwz r10,22612(r9) ticks = microseconds / microseconds_per_tick; ffc0ee3c: 7d 23 53 96 divwu r9,r3,r10 if ( (microseconds % microseconds_per_tick) != 0 ) ffc0ee40: 7d 49 51 d6 mullw r10,r9,r10 ffc0ee44: 7f 83 50 00 cmpw cr7,r3,r10 ffc0ee48: 41 9e 00 08 beq- cr7,ffc0ee50 <== ALWAYS TAKEN ticks += 1; ffc0ee4c: 39 29 00 01 addi r9,r9,1 <== NOT EXECUTED return ticks; } ffc0ee50: 7d 23 4b 78 mr r3,r9 ffc0ee54: 4e 80 00 20 blr =============================================================================== ffc0a17c : /** * 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(); ffc0a17c: 3d 20 ff c2 lis r9,-62 ffc0a180: 81 49 d2 44 lwz r10,-11708(r9) ffc0a184: 39 20 03 e8 li r9,1000 ffc0a188: 7d 4a 4b 96 divwu r10,r10,r9 ticks = milliseconds / milliseconds_per_tick; ffc0a18c: 7d 23 53 96 divwu r9,r3,r10 if ( (milliseconds % milliseconds_per_tick) != 0 ) ffc0a190: 7d 49 51 d6 mullw r10,r9,r10 ffc0a194: 7f 83 50 00 cmpw cr7,r3,r10 ffc0a198: 41 9e 00 08 beq- cr7,ffc0a1a0 <== ALWAYS TAKEN ticks += 1; ffc0a19c: 39 29 00 01 addi r9,r9,1 <== NOT EXECUTED return ticks; } ffc0a1a0: 7d 23 4b 78 mr r3,r9 ffc0a1a4: 4e 80 00 20 blr =============================================================================== ffc0b874 <_CORE_RWLock_Release>: #include CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { ffc0b874: 7c 2b 0b 78 mr r11,r1 ffc0b878: 7c 08 02 a6 mflr r0 ffc0b87c: 94 21 ff f0 stwu r1,-16(r1) ISR_Level level; Thread_Control *executing = _Thread_Executing; ffc0b880: 3d 20 00 00 lis r9,0 #include CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { ffc0b884: 90 01 00 14 stw r0,20(r1) ffc0b888: 48 00 c0 41 bl ffc178c8 <_savegpr_31> ffc0b88c: 7c 7f 1b 78 mr r31,r3 ISR_Level level; Thread_Control *executing = _Thread_Executing; ffc0b890: 81 09 31 b0 lwz r8,12720(r9) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0b894: 7d 20 00 a6 mfmsr r9 ffc0b898: 7d 50 42 a6 mfsprg r10,0 ffc0b89c: 7d 2a 50 78 andc r10,r9,r10 ffc0b8a0: 7d 40 01 24 mtmsr r10 * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ ffc0b8a4: 81 43 00 44 lwz r10,68(r3) ffc0b8a8: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0b8ac: 40 be 00 14 bne+ cr7,ffc0b8c0 <_CORE_RWLock_Release+0x4c> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0b8b0: 7d 20 01 24 mtmsr r9 _ISR_Enable( level ); executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; ffc0b8b4: 39 20 00 02 li r9,2 ffc0b8b8: 91 28 00 34 stw r9,52(r8) return CORE_RWLOCK_SUCCESSFUL; ffc0b8bc: 48 00 00 a8 b ffc0b964 <_CORE_RWLock_Release+0xf0> } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { ffc0b8c0: 2f 8a 00 01 cmpwi cr7,r10,1 ffc0b8c4: 40 9e 00 20 bne- cr7,ffc0b8e4 <_CORE_RWLock_Release+0x70> the_rwlock->number_of_readers -= 1; ffc0b8c8: 81 43 00 48 lwz r10,72(r3) ffc0b8cc: 39 4a ff ff addi r10,r10,-1 if ( the_rwlock->number_of_readers != 0 ) { ffc0b8d0: 2f 8a 00 00 cmpwi cr7,r10,0 _ISR_Enable( level ); executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; return CORE_RWLOCK_SUCCESSFUL; } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { the_rwlock->number_of_readers -= 1; ffc0b8d4: 91 43 00 48 stw r10,72(r3) if ( the_rwlock->number_of_readers != 0 ) { ffc0b8d8: 41 be 00 0c beq+ cr7,ffc0b8e4 <_CORE_RWLock_Release+0x70> ffc0b8dc: 7d 20 01 24 mtmsr r9 /* must be unlocked again */ _ISR_Enable( level ); return CORE_RWLOCK_SUCCESSFUL; ffc0b8e0: 48 00 00 84 b ffc0b964 <_CORE_RWLock_Release+0xf0> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; ffc0b8e4: 39 40 00 00 li r10,0 ffc0b8e8: 91 48 00 34 stw r10,52(r8) /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; ffc0b8ec: 91 5f 00 44 stw r10,68(r31) ffc0b8f0: 7d 20 01 24 mtmsr r9 _ISR_Enable( level ); next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); ffc0b8f4: 7f e3 fb 78 mr r3,r31 ffc0b8f8: 48 00 1e 51 bl ffc0d748 <_Thread_queue_Dequeue> if ( next ) { ffc0b8fc: 2c 03 00 00 cmpwi r3,0 ffc0b900: 41 82 00 64 beq- ffc0b964 <_CORE_RWLock_Release+0xf0> if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { ffc0b904: 81 23 00 30 lwz r9,48(r3) ffc0b908: 2f 89 00 01 cmpwi cr7,r9,1 ffc0b90c: 40 be 00 10 bne+ cr7,ffc0b91c <_CORE_RWLock_Release+0xa8> the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; ffc0b910: 39 20 00 02 li r9,2 ffc0b914: 91 3f 00 44 stw r9,68(r31) return CORE_RWLOCK_SUCCESSFUL; ffc0b918: 48 00 00 4c b ffc0b964 <_CORE_RWLock_Release+0xf0> } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; ffc0b91c: 81 3f 00 48 lwz r9,72(r31) ffc0b920: 39 29 00 01 addi r9,r9,1 ffc0b924: 91 3f 00 48 stw r9,72(r31) the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; ffc0b928: 39 20 00 01 li r9,1 ffc0b92c: 91 3f 00 44 stw r9,68(r31) /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); ffc0b930: 7f e3 fb 78 mr r3,r31 ffc0b934: 48 00 23 6d bl ffc0dca0 <_Thread_queue_First> if ( !next || ffc0b938: 7c 64 1b 79 mr. r4,r3 ffc0b93c: 41 82 00 28 beq- ffc0b964 <_CORE_RWLock_Release+0xf0> ffc0b940: 81 24 00 30 lwz r9,48(r4) ffc0b944: 2f 89 00 01 cmpwi cr7,r9,1 ffc0b948: 41 9e 00 1c beq- cr7,ffc0b964 <_CORE_RWLock_Release+0xf0><== NEVER TAKEN next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; ffc0b94c: 81 3f 00 48 lwz r9,72(r31) _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); ffc0b950: 7f e3 fb 78 mr r3,r31 while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); if ( !next || next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; ffc0b954: 39 29 00 01 addi r9,r9,1 ffc0b958: 91 3f 00 48 stw r9,72(r31) _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); ffc0b95c: 48 00 21 dd bl ffc0db38 <_Thread_queue_Extract> } ffc0b960: 4b ff ff d0 b ffc0b930 <_CORE_RWLock_Release+0xbc> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } ffc0b964: 39 61 00 10 addi r11,r1,16 ffc0b968: 38 60 00 00 li r3,0 ffc0b96c: 4b ff 63 50 b ffc01cbc <_restgpr_31_x> =============================================================================== ffc0b970 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { ffc0b970: 94 21 ff e8 stwu r1,-24(r1) ffc0b974: 7c 08 02 a6 mflr r0 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0b978: 38 81 00 08 addi r4,r1,8 void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { ffc0b97c: 90 01 00 1c stw r0,28(r1) Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0b980: 48 00 1a 2d bl ffc0d3ac <_Thread_Get> switch ( location ) { ffc0b984: 81 21 00 08 lwz r9,8(r1) ffc0b988: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b98c: 40 9e 00 18 bne- cr7,ffc0b9a4 <_CORE_RWLock_Timeout+0x34><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); ffc0b990: 48 00 24 0d bl ffc0dd9c <_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; ffc0b994: 3d 20 00 00 lis r9,0 ffc0b998: 81 49 28 90 lwz r10,10384(r9) --level; ffc0b99c: 39 4a ff ff addi r10,r10,-1 _Thread_Dispatch_disable_level = level; ffc0b9a0: 91 49 28 90 stw r10,10384(r9) _Thread_Unnest_dispatch(); break; } } ffc0b9a4: 80 01 00 1c lwz r0,28(r1) ffc0b9a8: 38 21 00 18 addi r1,r1,24 ffc0b9ac: 7c 08 03 a6 mtlr r0 ffc0b9b0: 4e 80 00 20 blr =============================================================================== ffc09854 <_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 ) { ffc09854: 7c 2b 0b 78 mr r11,r1 ffc09858: 7c 08 02 a6 mflr r0 ffc0985c: 94 21 ff f0 stwu r1,-16(r1) ffc09860: 48 01 15 5d bl ffc1adbc <_savegpr_31> ffc09864: 90 01 00 14 stw r0,20(r1) ffc09868: 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)) ) { ffc0986c: 48 00 1d 75 bl ffc0b5e0 <_Thread_queue_Dequeue> ffc09870: 2f 83 00 00 cmpwi cr7,r3,0 ffc09874: 40 be 00 3c bne+ cr7,ffc098b0 <_CORE_semaphore_Surrender+0x5c> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc09878: 7d 00 00 a6 mfmsr r8 ffc0987c: 7d 30 42 a6 mfsprg r9,0 ffc09880: 7d 09 48 78 andc r9,r8,r9 ffc09884: 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 ) ffc09888: 81 3f 00 48 lwz r9,72(r31) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; ffc0988c: 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 ) ffc09890: 81 5f 00 40 lwz r10,64(r31) ffc09894: 7f 89 50 40 cmplw cr7,r9,r10 ffc09898: 40 9c 00 10 bge- cr7,ffc098a8 <_CORE_semaphore_Surrender+0x54><== NEVER TAKEN the_semaphore->count += 1; ffc0989c: 39 29 00 01 addi r9,r9,1 ffc098a0: 91 3f 00 48 stw r9,72(r31) { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; ffc098a4: 38 60 00 00 li r3,0 return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc098a8: 7d 00 01 24 mtmsr r8 ffc098ac: 48 00 00 08 b ffc098b4 <_CORE_semaphore_Surrender+0x60> ffc098b0: 38 60 00 00 li r3,0 status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } ffc098b4: 39 61 00 10 addi r11,r1,16 ffc098b8: 4b ff 6d 0c 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 29 59 bl ffc1adbc <_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 31 a0 addi r11,r11,12704 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 3b 8d bl ffc0c0f0 <_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 28 84 b ffc0ae08 <_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 28 1d bl ffc1adbc <_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 95 bl ffc0b244 <_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 31 b0 lwz r9,12720(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 fd bl ffc0ae08 <_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 68 lwz r10,10344(r9) --level; ffc08618: 39 4a ff ff addi r10,r10,-1 _Thread_Dispatch_disable_level = level; ffc0861c: 91 49 28 68 stw r10,10344(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> =============================================================================== ffc0e5dc <_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 ) { ffc0e5dc: 2c 04 00 00 cmpwi r4,0 return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { ffc0e5e0: 7c 08 02 a6 mflr r0 ffc0e5e4: 7c 2b 0b 78 mr r11,r1 ffc0e5e8: 94 21 ff f0 stwu r1,-16(r1) ffc0e5ec: 90 01 00 14 stw r0,20(r1) ffc0e5f0: 48 00 c7 cd bl ffc1adbc <_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 ) { ffc0e5f4: 41 82 01 e4 beq- ffc0e7d8 <_Heap_Free+0x1fc> ffc0e5f8: 81 03 00 10 lwz r8,16(r3) ffc0e5fc: 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 ffc0e600: 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); ffc0e604: 7d 44 43 96 divwu r10,r4,r8 ffc0e608: 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; ffc0e60c: 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); ffc0e610: 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; ffc0e614: 7f 8a 58 40 cmplw cr7,r10,r11 ffc0e618: 41 9c 00 14 blt- cr7,ffc0e62c <_Heap_Free+0x50> ffc0e61c: 81 03 00 24 lwz r8,36(r3) ffc0e620: 7d 0a 40 10 subfc r8,r10,r8 ffc0e624: 39 00 00 00 li r8,0 ffc0e628: 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 ) ) { ffc0e62c: 2f 88 00 00 cmpwi cr7,r8,0 return false; ffc0e630: 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 ) ) { ffc0e634: 41 9e 01 a8 beq- cr7,ffc0e7dc <_Heap_Free+0x200> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } ffc0e638: 80 8a 00 04 lwz r4,4(r10) ffc0e63c: 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; ffc0e640: 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); ffc0e644: 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; ffc0e648: 7f 88 58 40 cmplw cr7,r8,r11 ffc0e64c: 41 9c 00 14 blt- cr7,ffc0e660 <_Heap_Free+0x84> <== NEVER TAKEN ffc0e650: 80 c9 00 24 lwz r6,36(r9) ffc0e654: 7c c8 30 10 subfc r6,r8,r6 ffc0e658: 38 c0 00 00 li r6,0 ffc0e65c: 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 ) ) { ffc0e660: 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; ffc0e664: 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 ) ) { ffc0e668: 41 9e 01 74 beq- cr7,ffc0e7dc <_Heap_Free+0x200> <== NEVER TAKEN --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } ffc0e66c: 80 a8 00 04 lwz r5,4(r8) return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { ffc0e670: 70 a6 00 01 andi. r6,r5,1 ffc0e674: 41 82 01 68 beq- ffc0e7dc <_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 ffc0e678: 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; ffc0e67c: 54 a5 00 3c rlwinm r5,r5,0,0,30 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); ffc0e680: 7f 88 18 00 cmpw cr7,r8,r3 ffc0e684: 41 9e 00 18 beq- cr7,ffc0e69c <_Heap_Free+0xc0> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } ffc0e688: 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 )); ffc0e68c: 80 06 00 04 lwz r0,4(r6) ffc0e690: 68 00 00 01 xori r0,r0,1 ffc0e694: 54 00 07 fe clrlwi r0,r0,31 ffc0e698: 48 00 00 08 b ffc0e6a0 <_Heap_Free+0xc4> ffc0e69c: 38 00 00 00 li r0,0 if ( !_Heap_Is_prev_used( block ) ) { ffc0e6a0: 70 9f 00 01 andi. r31,r4,1 ffc0e6a4: 40 82 00 94 bne- ffc0e738 <_Heap_Free+0x15c> uintptr_t const prev_size = block->prev_size; ffc0e6a8: 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; ffc0e6ac: 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); ffc0e6b0: 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; ffc0e6b4: 7f 86 58 40 cmplw cr7,r6,r11 ffc0e6b8: 41 9c 00 10 blt- cr7,ffc0e6c8 <_Heap_Free+0xec> <== NEVER TAKEN ffc0e6bc: 7d 86 18 10 subfc r12,r6,r3 ffc0e6c0: 39 80 00 00 li r12,0 ffc0e6c4: 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 ) ) { ffc0e6c8: 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; ffc0e6cc: 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 ) ) { ffc0e6d0: 41 9e 01 0c beq- cr7,ffc0e7dc <_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; ffc0e6d4: 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) ) { ffc0e6d8: 71 7f 00 01 andi. r31,r11,1 ffc0e6dc: 41 82 01 00 beq- ffc0e7dc <_Heap_Free+0x200> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ ffc0e6e0: 2f 80 00 00 cmpwi cr7,r0,0 ffc0e6e4: 7c 87 22 14 add r4,r7,r4 ffc0e6e8: 41 be 00 34 beq+ cr7,ffc0e71c <_Heap_Free+0x140> } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; ffc0e6ec: 81 48 00 0c lwz r10,12(r8) uintptr_t const size = block_size + prev_size + next_block_size; ffc0e6f0: 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; ffc0e6f4: 80 88 00 08 lwz r4,8(r8) Heap_Block *prev = block->prev; prev->next = next; ffc0e6f8: 90 8a 00 08 stw r4,8(r10) next->prev = prev; ffc0e6fc: 91 44 00 0c stw r10,12(r4) _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; ffc0e700: 81 49 00 38 lwz r10,56(r9) ffc0e704: 39 4a ff ff addi r10,r10,-1 ffc0e708: 91 49 00 38 stw r10,56(r9) prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; ffc0e70c: 60 aa 00 01 ori r10,r5,1 ffc0e710: 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; ffc0e714: 7c a5 31 2e stwx r5,r5,r6 ffc0e718: 48 00 00 9c b ffc0e7b4 <_Heap_Free+0x1d8> } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; ffc0e71c: 60 85 00 01 ori r5,r4,1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; ffc0e720: 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; ffc0e724: 90 a6 00 04 stw r5,4(r6) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; ffc0e728: 80 c8 00 04 lwz r6,4(r8) ffc0e72c: 54 c6 00 3c rlwinm r6,r6,0,0,30 ffc0e730: 90 c8 00 04 stw r6,4(r8) ffc0e734: 48 00 00 80 b ffc0e7b4 <_Heap_Free+0x1d8> next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ ffc0e738: 2f 80 00 00 cmpwi cr7,r0,0 ffc0e73c: 41 be 00 30 beq+ cr7,ffc0e76c <_Heap_Free+0x190> uintptr_t const size = block_size + next_block_size; ffc0e740: 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; ffc0e744: 80 a8 00 08 lwz r5,8(r8) Heap_Block *prev = old_block->prev; ffc0e748: 81 08 00 0c lwz r8,12(r8) new_block->next = next; ffc0e74c: 90 aa 00 08 stw r5,8(r10) new_block->prev = prev; ffc0e750: 91 0a 00 0c stw r8,12(r10) next->prev = new_block; prev->next = new_block; ffc0e754: 91 48 00 08 stw r10,8(r8) _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; ffc0e758: 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; ffc0e75c: 91 45 00 0c stw r10,12(r5) ffc0e760: 91 0a 00 04 stw r8,4(r10) next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; ffc0e764: 7c c6 51 2e stwx r6,r6,r10 ffc0e768: 48 00 00 4c b ffc0e7b4 <_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; ffc0e76c: 80 c9 00 08 lwz r6,8(r9) new_block->next = next; new_block->prev = block_before; ffc0e770: 91 2a 00 0c stw r9,12(r10) Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; ffc0e774: 90 ca 00 08 stw r6,8(r10) new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; ffc0e778: 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; ffc0e77c: 60 e6 00 01 ori r6,r7,1 ffc0e780: 90 ca 00 04 stw r6,4(r10) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; ffc0e784: 80 c8 00 04 lwz r6,4(r8) next_block->prev_size = block_size; ffc0e788: 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; ffc0e78c: 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; ffc0e790: 91 49 00 08 stw r10,8(r9) next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; ffc0e794: 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; ffc0e798: 90 c8 00 04 stw r6,4(r8) next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; ffc0e79c: 39 4a 00 01 addi r10,r10,1 if ( stats->max_free_blocks < stats->free_blocks ) { ffc0e7a0: 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; ffc0e7a4: 91 49 00 38 stw r10,56(r9) if ( stats->max_free_blocks < stats->free_blocks ) { ffc0e7a8: 7f 88 50 40 cmplw cr7,r8,r10 ffc0e7ac: 40 9c 00 08 bge- cr7,ffc0e7b4 <_Heap_Free+0x1d8> stats->max_free_blocks = stats->free_blocks; ffc0e7b0: 91 49 00 3c stw r10,60(r9) } } /* Statistics */ --stats->used_blocks; ffc0e7b4: 81 49 00 40 lwz r10,64(r9) ffc0e7b8: 39 4a ff ff addi r10,r10,-1 ffc0e7bc: 91 49 00 40 stw r10,64(r9) ++stats->frees; ffc0e7c0: 81 49 00 50 lwz r10,80(r9) ffc0e7c4: 39 4a 00 01 addi r10,r10,1 ffc0e7c8: 91 49 00 50 stw r10,80(r9) stats->free_size += block_size; ffc0e7cc: 81 49 00 30 lwz r10,48(r9) ffc0e7d0: 7c ea 3a 14 add r7,r10,r7 ffc0e7d4: 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; ffc0e7d8: 38 60 00 01 li r3,1 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } ffc0e7dc: 39 61 00 10 addi r11,r1,16 ffc0e7e0: 4b ff 1d e4 b ffc005c4 <_restgpr_31_x> =============================================================================== ffc0b86c <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { ffc0b86c: 94 21 ff e0 stwu r1,-32(r1) ffc0b870: 7c 08 02 a6 mflr r0 ffc0b874: bf 61 00 0c stmw r27,12(r1) ffc0b878: 7c 7f 1b 78 mr r31,r3 ffc0b87c: 7c 9c 23 78 mr r28,r4 ffc0b880: 90 01 00 24 stw r0,36(r1) ffc0b884: 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) { ffc0b888: 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; ffc0b88c: 3b a0 00 00 li r29,0 Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { ffc0b890: 48 00 00 40 b ffc0b8d0 <_Heap_Greedy_allocate+0x64> #include "config.h" #endif #include Heap_Block *_Heap_Greedy_allocate( ffc0b894: 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 ); ffc0b898: 7c 9c 48 2e lwzx r4,r28,r9 ffc0b89c: 7f e3 fb 78 mr r3,r31 ffc0b8a0: 38 a0 00 00 li r5,0 ffc0b8a4: 38 c0 00 00 li r6,0 ffc0b8a8: 48 00 76 bd bl ffc12f64 <_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 ) { ffc0b8ac: 2c 03 00 00 cmpwi r3,0 ffc0b8b0: 41 82 00 1c beq- ffc0b8cc <_Heap_Greedy_allocate+0x60> <== NEVER TAKEN RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ffc0b8b4: 81 3f 00 10 lwz r9,16(r31) ffc0b8b8: 7c 63 4b 96 divwu r3,r3,r9 ffc0b8bc: 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; ffc0b8c0: 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); ffc0b8c4: 39 29 ff f8 addi r9,r9,-8 ffc0b8c8: 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) { ffc0b8cc: 3b de 00 01 addi r30,r30,1 ffc0b8d0: 7f 9e d8 00 cmpw cr7,r30,r27 ffc0b8d4: 40 9e ff c0 bne+ cr7,ffc0b894 <_Heap_Greedy_allocate+0x28> ffc0b8d8: 3b 80 00 00 li r28,0 ffc0b8dc: 48 00 00 28 b ffc0b904 <_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; ffc0b8e0: 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( ffc0b8e4: 7f e3 fb 78 mr r3,r31 ffc0b8e8: 7f c4 f3 78 mr r4,r30 ffc0b8ec: 54 c6 00 3c rlwinm r6,r6,0,0,30 ffc0b8f0: 38 be 00 08 addi r5,r30,8 ffc0b8f4: 38 c6 ff f8 addi r6,r6,-8 ffc0b8f8: 48 00 03 0d bl ffc0bc04 <_Heap_Block_allocate> current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; ffc0b8fc: 93 9e 00 08 stw r28,8(r30) ffc0b900: 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; ffc0b904: 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 ) { ffc0b908: 7f 9e f8 00 cmpw cr7,r30,r31 ffc0b90c: 40 9e ff d4 bne+ cr7,ffc0b8e0 <_Heap_Greedy_allocate+0x74> ffc0b910: 48 00 00 14 b ffc0b924 <_Heap_Greedy_allocate+0xb8> blocks = current; } while ( allocated_blocks != NULL ) { current = allocated_blocks; allocated_blocks = allocated_blocks->next; ffc0b914: 7f a4 eb 78 mr r4,r29 ffc0b918: 87 a4 00 08 lwzu r29,8(r4) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); ffc0b91c: 7f e3 fb 78 mr r3,r31 ffc0b920: 48 00 77 d5 bl ffc130f4 <_Heap_Free> current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { ffc0b924: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0b928: 40 9e ff ec bne+ cr7,ffc0b914 <_Heap_Greedy_allocate+0xa8> allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } ffc0b92c: 39 61 00 20 addi r11,r1,32 ffc0b930: 7f 83 e3 78 mr r3,r28 ffc0b934: 4b ff 57 f0 b ffc01124 <_restgpr_27_x> =============================================================================== ffc12f90 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { ffc12f90: 94 21 ff e8 stwu r1,-24(r1) ffc12f94: 7c 08 02 a6 mflr r0 ffc12f98: 90 01 00 1c stw r0,28(r1) ffc12f9c: bf 81 00 08 stmw r28,8(r1) ffc12fa0: 7c 9d 23 78 mr r29,r4 ffc12fa4: 7c bc 2b 78 mr r28,r5 Heap_Block *current = heap->first_block; ffc12fa8: 81 23 00 20 lwz r9,32(r3) Heap_Block *end = heap->last_block; ffc12fac: 83 c3 00 24 lwz r30,36(r3) ffc12fb0: 48 00 00 34 b ffc12fe4 <_Heap_Iterate+0x54> ffc12fb4: 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 ); ffc12fb8: 7d 23 4b 78 mr r3,r9 ffc12fbc: 7f 86 e3 78 mr r6,r28 ffc12fc0: 7f a9 03 a6 mtctr r29 ffc12fc4: 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); ffc12fc8: 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; ffc12fcc: 80 bf 00 04 lwz r5,4(r31) ffc12fd0: 54 a5 07 fe clrlwi r5,r5,31 ffc12fd4: 4e 80 04 21 bctrl ffc12fd8: 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 ) { ffc12fdc: 2f 83 00 00 cmpwi cr7,r3,0 ffc12fe0: 40 9e 00 0c bne- cr7,ffc12fec <_Heap_Iterate+0x5c> <== NEVER TAKEN ffc12fe4: 7f 89 f0 00 cmpw cr7,r9,r30 ffc12fe8: 40 9e ff cc bne+ cr7,ffc12fb4 <_Heap_Iterate+0x24> stop = (*visitor)( current, size, used, visitor_arg ); current = next; } } ffc12fec: 39 61 00 18 addi r11,r1,24 ffc12ff0: 4b ff 05 54 b ffc03544 <_restgpr_28_x> =============================================================================== ffc1bc64 <_Heap_Size_of_alloc_area>: RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ffc1bc64: 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 ) { ffc1bc68: 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 ffc1bc6c: 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); ffc1bc70: 7d 44 43 96 divwu r10,r4,r8 ffc1bc74: 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; ffc1bc78: 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); ffc1bc7c: 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; ffc1bc80: 7f 88 38 40 cmplw cr7,r8,r7 ffc1bc84: 41 9c 00 14 blt- cr7,ffc1bc98 <_Heap_Size_of_alloc_area+0x34> ffc1bc88: 81 43 00 24 lwz r10,36(r3) ffc1bc8c: 7d 48 50 10 subfc r10,r8,r10 ffc1bc90: 39 40 00 00 li r10,0 ffc1bc94: 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 ) ) { ffc1bc98: 2f 8a 00 00 cmpwi cr7,r10,0 return false; ffc1bc9c: 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 ) ) { ffc1bca0: 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; ffc1bca4: 81 48 00 04 lwz r10,4(r8) ffc1bca8: 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); ffc1bcac: 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; ffc1bcb0: 7f 8a 38 40 cmplw cr7,r10,r7 ffc1bcb4: 39 00 00 00 li r8,0 ffc1bcb8: 41 9c 00 14 blt- cr7,ffc1bccc <_Heap_Size_of_alloc_area+0x68><== NEVER TAKEN ffc1bcbc: 81 09 00 24 lwz r8,36(r9) ffc1bcc0: 7d 0a 40 10 subfc r8,r10,r8 ffc1bcc4: 39 00 00 00 li r8,0 ffc1bcc8: 7d 08 41 14 adde r8,r8,r8 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( ffc1bccc: 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; ffc1bcd0: 38 60 00 00 li r3,0 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( ffc1bcd4: 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; ffc1bcd8: 81 2a 00 04 lwz r9,4(r10) !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ffc1bcdc: 71 28 00 01 andi. r8,r9,1 ffc1bce0: 4d 82 00 20 beqlr ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; ffc1bce4: 20 84 00 04 subfic r4,r4,4 ffc1bce8: 7d 44 52 14 add r10,r4,r10 ffc1bcec: 91 45 00 00 stw r10,0(r5) return true; ffc1bcf0: 38 60 00 01 li r3,1 } ffc1bcf4: 4e 80 00 20 blr =============================================================================== ffc0a3a4 <_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; ffc0a3a4: 2f 85 00 00 cmpwi cr7,r5,0 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { ffc0a3a8: 94 21 ff 98 stwu r1,-104(r1) ffc0a3ac: 7c 08 02 a6 mflr r0 ffc0a3b0: bd c1 00 20 stmw r14,32(r1) ffc0a3b4: 7c 7d 1b 78 mr r29,r3 ffc0a3b8: 7c 9e 23 78 mr r30,r4 ffc0a3bc: 90 01 00 6c stw r0,108(r1) uintptr_t const page_size = heap->page_size; ffc0a3c0: 83 43 00 10 lwz r26,16(r3) uintptr_t const min_block_size = heap->min_block_size; ffc0a3c4: 83 03 00 14 lwz r24,20(r3) Heap_Block *const first_block = heap->first_block; ffc0a3c8: 83 83 00 20 lwz r28,32(r3) Heap_Block *const last_block = heap->last_block; ffc0a3cc: 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; ffc0a3d0: 41 9e 00 10 beq- cr7,ffc0a3e0 <_Heap_Walk+0x3c> ffc0a3d4: 3f e0 ff c1 lis r31,-63 ffc0a3d8: 3b ff a2 f4 addi r31,r31,-23820 ffc0a3dc: 48 00 00 0c b ffc0a3e8 <_Heap_Walk+0x44> ffc0a3e0: 3f e0 ff c1 lis r31,-63 ffc0a3e4: 3b ff a2 f0 addi r31,r31,-23824 if ( !_System_state_Is_up( _System_state_Get() ) ) { ffc0a3e8: 3d 20 00 00 lis r9,0 ffc0a3ec: 81 29 28 6c lwz r9,10348(r9) ffc0a3f0: 2f 89 00 03 cmpwi cr7,r9,3 ffc0a3f4: 41 9e 00 0c beq- cr7,ffc0a400 <_Heap_Walk+0x5c> return true; ffc0a3f8: 38 60 00 01 li r3,1 ffc0a3fc: 48 00 04 cc b ffc0a8c8 <_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)( ffc0a400: 81 5d 00 08 lwz r10,8(r29) ffc0a404: 3c a0 ff c1 lis r5,-63 ffc0a408: 81 1d 00 18 lwz r8,24(r29) ffc0a40c: 7f c3 f3 78 mr r3,r30 ffc0a410: 91 41 00 0c stw r10,12(r1) ffc0a414: 38 80 00 00 li r4,0 ffc0a418: 38 a5 7b f8 addi r5,r5,31736 ffc0a41c: 7f e9 03 a6 mtctr r31 ffc0a420: 81 5d 00 0c lwz r10,12(r29) ffc0a424: 7f 46 d3 78 mr r6,r26 ffc0a428: 81 3d 00 1c lwz r9,28(r29) ffc0a42c: 7f 07 c3 78 mr r7,r24 ffc0a430: 91 41 00 10 stw r10,16(r1) ffc0a434: 7f 8a e3 78 mr r10,r28 ffc0a438: 92 e1 00 08 stw r23,8(r1) ffc0a43c: 4c c6 31 82 crclr 4*cr1+eq ffc0a440: 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 ) { ffc0a444: 2f 9a 00 00 cmpwi cr7,r26,0 ffc0a448: 40 be 00 18 bne+ cr7,ffc0a460 <_Heap_Walk+0xbc> (*printer)( source, true, "page size is zero\n" ); ffc0a44c: 3c a0 ff c1 lis r5,-63 ffc0a450: 7f c3 f3 78 mr r3,r30 ffc0a454: 38 80 00 01 li r4,1 ffc0a458: 38 a5 7c 89 addi r5,r5,31881 ffc0a45c: 48 00 00 d8 b ffc0a534 <_Heap_Walk+0x190> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { ffc0a460: 73 47 00 07 andi. r7,r26,7 ffc0a464: 41 a2 00 1c beq+ ffc0a480 <_Heap_Walk+0xdc> (*printer)( ffc0a468: 3c a0 ff c1 lis r5,-63 ffc0a46c: 7f c3 f3 78 mr r3,r30 ffc0a470: 38 80 00 01 li r4,1 ffc0a474: 38 a5 7c 9c addi r5,r5,31900 ffc0a478: 7f 46 d3 78 mr r6,r26 ffc0a47c: 48 00 04 3c b ffc0a8b8 <_Heap_Walk+0x514> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; ffc0a480: 7d 38 d3 96 divwu r9,r24,r26 ffc0a484: 7d 29 d1 d6 mullw r9,r9,r26 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { ffc0a488: 7f 98 48 00 cmpw cr7,r24,r9 ffc0a48c: 41 be 00 1c beq+ cr7,ffc0a4a8 <_Heap_Walk+0x104> (*printer)( ffc0a490: 3c a0 ff c1 lis r5,-63 ffc0a494: 7f c3 f3 78 mr r3,r30 ffc0a498: 38 80 00 01 li r4,1 ffc0a49c: 38 a5 7c ba addi r5,r5,31930 ffc0a4a0: 7f 06 c3 78 mr r6,r24 ffc0a4a4: 48 00 04 14 b ffc0a8b8 <_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; ffc0a4a8: 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; ffc0a4ac: 7d 49 d3 96 divwu r10,r9,r26 ffc0a4b0: 7d 4a d1 d6 mullw r10,r10,r26 ); return false; } if ( ffc0a4b4: 7f 89 50 00 cmpw cr7,r9,r10 ffc0a4b8: 41 be 00 18 beq+ cr7,ffc0a4d0 <_Heap_Walk+0x12c> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( ffc0a4bc: 3c a0 ff c1 lis r5,-63 ffc0a4c0: 7f c3 f3 78 mr r3,r30 ffc0a4c4: 38 80 00 01 li r4,1 ffc0a4c8: 38 a5 7c de addi r5,r5,31966 ffc0a4cc: 48 00 03 e8 b ffc0a8b4 <_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; ffc0a4d0: 81 3c 00 04 lwz r9,4(r28) ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { ffc0a4d4: 71 27 00 01 andi. r7,r9,1 ffc0a4d8: 40 a2 00 18 bne+ ffc0a4f0 <_Heap_Walk+0x14c> (*printer)( ffc0a4dc: 3c a0 ff c1 lis r5,-63 ffc0a4e0: 7f c3 f3 78 mr r3,r30 ffc0a4e4: 38 80 00 01 li r4,1 ffc0a4e8: 38 a5 7d 0f addi r5,r5,32015 ffc0a4ec: 48 00 00 48 b ffc0a534 <_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; ffc0a4f0: 82 d7 00 04 lwz r22,4(r23) ffc0a4f4: 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); ffc0a4f8: 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; ffc0a4fc: 81 36 00 04 lwz r9,4(r22) ); return false; } if ( _Heap_Is_free( last_block ) ) { ffc0a500: 71 27 00 01 andi. r7,r9,1 ffc0a504: 40 a2 00 18 bne+ ffc0a51c <_Heap_Walk+0x178> (*printer)( ffc0a508: 3c a0 ff c1 lis r5,-63 ffc0a50c: 7f c3 f3 78 mr r3,r30 ffc0a510: 38 80 00 01 li r4,1 ffc0a514: 38 a5 7d 3d addi r5,r5,32061 ffc0a518: 48 00 00 1c b ffc0a534 <_Heap_Walk+0x190> ); return false; } if ( ffc0a51c: 7f 96 e0 00 cmpw cr7,r22,r28 ffc0a520: 41 9e 00 24 beq- cr7,ffc0a544 <_Heap_Walk+0x1a0> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*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 7d 52 addi r5,r5,32082 ffc0a534: 7f e9 03 a6 mtctr r31 ffc0a538: 4c c6 31 82 crclr 4*cr1+eq ffc0a53c: 4e 80 04 21 bctrl ffc0a540: 48 00 03 5c b ffc0a89c <_Heap_Walk+0x4f8> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; ffc0a544: 81 3d 00 10 lwz r9,16(r29) const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); ffc0a548: 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; ffc0a54c: 80 dd 00 08 lwz r6,8(r29) ffc0a550: 48 00 00 bc b ffc0a60c <_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; ffc0a554: 80 fd 00 20 lwz r7,32(r29) ffc0a558: 39 00 00 00 li r8,0 ffc0a55c: 7f 87 30 40 cmplw cr7,r7,r6 ffc0a560: 41 9d 00 14 bgt- cr7,ffc0a574 <_Heap_Walk+0x1d0> ffc0a564: 81 1d 00 24 lwz r8,36(r29) ffc0a568: 7d 06 40 10 subfc r8,r6,r8 ffc0a56c: 39 00 00 00 li r8,0 ffc0a570: 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 ) ) { ffc0a574: 2f 88 00 00 cmpwi cr7,r8,0 ffc0a578: 40 be 00 18 bne+ cr7,ffc0a590 <_Heap_Walk+0x1ec> (*printer)( ffc0a57c: 3c a0 ff c1 lis r5,-63 ffc0a580: 7f c3 f3 78 mr r3,r30 ffc0a584: 38 80 00 01 li r4,1 ffc0a588: 38 a5 7d 81 addi r5,r5,32129 ffc0a58c: 48 00 03 2c b ffc0a8b8 <_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; ffc0a590: 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; ffc0a594: 7c e8 4b 96 divwu r7,r8,r9 ffc0a598: 7c e7 49 d6 mullw r7,r7,r9 ); return false; } if ( ffc0a59c: 7f 88 38 00 cmpw cr7,r8,r7 ffc0a5a0: 41 be 00 18 beq+ cr7,ffc0a5b8 <_Heap_Walk+0x214> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( ffc0a5a4: 3c a0 ff c1 lis r5,-63 ffc0a5a8: 7f c3 f3 78 mr r3,r30 ffc0a5ac: 38 80 00 01 li r4,1 ffc0a5b0: 38 a5 7d a1 addi r5,r5,32161 ffc0a5b4: 48 00 03 04 b ffc0a8b8 <_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; ffc0a5b8: 81 06 00 04 lwz r8,4(r6) ffc0a5bc: 55 08 00 3c rlwinm r8,r8,0,0,30 block = next_block; } while ( block != first_block ); return true; } ffc0a5c0: 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; ffc0a5c4: 81 08 00 04 lwz r8,4(r8) ); return false; } if ( _Heap_Is_used( free_block ) ) { ffc0a5c8: 71 07 00 01 andi. r7,r8,1 ffc0a5cc: 41 a2 00 18 beq+ ffc0a5e4 <_Heap_Walk+0x240> (*printer)( ffc0a5d0: 3c a0 ff c1 lis r5,-63 ffc0a5d4: 7f c3 f3 78 mr r3,r30 ffc0a5d8: 38 80 00 01 li r4,1 ffc0a5dc: 38 a5 7d d1 addi r5,r5,32209 ffc0a5e0: 48 00 02 d8 b ffc0a8b8 <_Heap_Walk+0x514> ); return false; } if ( free_block->prev != prev_block ) { ffc0a5e4: 80 e6 00 0c lwz r7,12(r6) ffc0a5e8: 7f 87 50 00 cmpw cr7,r7,r10 ffc0a5ec: 41 be 00 18 beq+ cr7,ffc0a604 <_Heap_Walk+0x260> (*printer)( ffc0a5f0: 3c a0 ff c1 lis r5,-63 ffc0a5f4: 7f c3 f3 78 mr r3,r30 ffc0a5f8: 38 80 00 01 li r4,1 ffc0a5fc: 38 a5 7d ed addi r5,r5,32237 ffc0a600: 48 00 01 38 b ffc0a738 <_Heap_Walk+0x394> return false; } prev_block = free_block; free_block = free_block->next; ffc0a604: 7c ca 33 78 mr r10,r6 ffc0a608: 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 ) { ffc0a60c: 7f 86 e8 00 cmpw cr7,r6,r29 ffc0a610: 40 9e ff 44 bne+ cr7,ffc0a554 <_Heap_Walk+0x1b0> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( ffc0a614: 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)( ffc0a618: 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)( ffc0a61c: 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 ) { ffc0a620: 7e dc b3 78 mr r28,r22 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( ffc0a624: 3a 94 7f 8d addi r20,r20,32653 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( ffc0a628: 3a 73 7f 76 addi r19,r19,32630 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)( ffc0a62c: 3a 52 7e d9 addi r18,r18,32473 ffc0a630: 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)" : "") ffc0a634: 3e a0 ff c1 lis r21,-63 ffc0a638: 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)( ffc0a63c: 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)" : ""), ffc0a640: 3d c0 ff c1 lis r14,-63 block = next_block; } while ( block != first_block ); return true; } ffc0a644: 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; ffc0a648: 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; ffc0a64c: 81 1d 00 20 lwz r8,32(r29) ffc0a650: 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; ffc0a654: 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); ffc0a658: 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; ffc0a65c: 7f 88 c8 40 cmplw cr7,r8,r25 ffc0a660: 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; ffc0a664: 55 6b 07 fe clrlwi r11,r11,31 ffc0a668: 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; ffc0a66c: 39 40 00 00 li r10,0 ffc0a670: 41 9d 00 14 bgt- cr7,ffc0a684 <_Heap_Walk+0x2e0> <== NEVER TAKEN ffc0a674: 81 5d 00 24 lwz r10,36(r29) ffc0a678: 7d 59 50 10 subfc r10,r25,r10 ffc0a67c: 39 40 00 00 li r10,0 ffc0a680: 7d 4a 51 14 adde r10,r10,r10 if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { ffc0a684: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0a688: 40 be 00 18 bne+ cr7,ffc0a6a0 <_Heap_Walk+0x2fc> (*printer)( ffc0a68c: 3c a0 ff c1 lis r5,-63 ffc0a690: 7f c3 f3 78 mr r3,r30 ffc0a694: 38 80 00 01 li r4,1 ffc0a698: 38 a5 7e 1f addi r5,r5,32287 ffc0a69c: 48 00 00 94 b ffc0a730 <_Heap_Walk+0x38c> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; ffc0a6a0: 7d 5b d3 96 divwu r10,r27,r26 ffc0a6a4: 7d 4a d1 d6 mullw r10,r10,r26 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { ffc0a6a8: 7f 9b 50 00 cmpw cr7,r27,r10 ffc0a6ac: 41 9e 00 28 beq- cr7,ffc0a6d4 <_Heap_Walk+0x330> ffc0a6b0: 2f 89 00 00 cmpwi cr7,r9,0 ffc0a6b4: 41 be 00 94 beq+ cr7,ffc0a748 <_Heap_Walk+0x3a4> (*printer)( ffc0a6b8: 3c a0 ff c1 lis r5,-63 ffc0a6bc: 7f c3 f3 78 mr r3,r30 ffc0a6c0: 38 80 00 01 li r4,1 ffc0a6c4: 38 a5 7e 4c addi r5,r5,32332 ffc0a6c8: 7f 86 e3 78 mr r6,r28 ffc0a6cc: 7f 67 db 78 mr r7,r27 ffc0a6d0: 48 00 00 68 b ffc0a738 <_Heap_Walk+0x394> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { ffc0a6d4: 7f 9b c0 40 cmplw cr7,r27,r24 ffc0a6d8: 40 9c 00 38 bge- cr7,ffc0a710 <_Heap_Walk+0x36c> ffc0a6dc: 2f 89 00 00 cmpwi cr7,r9,0 ffc0a6e0: 41 be 00 68 beq+ cr7,ffc0a748 <_Heap_Walk+0x3a4> <== NEVER TAKEN (*printer)( ffc0a6e4: 3c a0 ff c1 lis r5,-63 ffc0a6e8: 7f e9 03 a6 mtctr r31 ffc0a6ec: 7f c3 f3 78 mr r3,r30 ffc0a6f0: 38 80 00 01 li r4,1 ffc0a6f4: 38 a5 7e 7a addi r5,r5,32378 ffc0a6f8: 7f 86 e3 78 mr r6,r28 ffc0a6fc: 7f 67 db 78 mr r7,r27 ffc0a700: 7f 08 c3 78 mr r8,r24 ffc0a704: 4c c6 31 82 crclr 4*cr1+eq ffc0a708: 4e 80 04 21 bctrl ffc0a70c: 48 00 01 90 b ffc0a89c <_Heap_Walk+0x4f8> ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { ffc0a710: 7f 99 e0 40 cmplw cr7,r25,r28 ffc0a714: 41 9d 00 34 bgt- cr7,ffc0a748 <_Heap_Walk+0x3a4> ffc0a718: 2f 89 00 00 cmpwi cr7,r9,0 ffc0a71c: 41 be 00 2c beq+ cr7,ffc0a748 <_Heap_Walk+0x3a4> (*printer)( ffc0a720: 3c a0 ff c1 lis r5,-63 ffc0a724: 7f c3 f3 78 mr r3,r30 ffc0a728: 38 80 00 01 li r4,1 ffc0a72c: 38 a5 7e a5 addi r5,r5,32421 ffc0a730: 7f 86 e3 78 mr r6,r28 ffc0a734: 7f 27 cb 78 mr r7,r25 ffc0a738: 7f e9 03 a6 mtctr r31 ffc0a73c: 4c c6 31 82 crclr 4*cr1+eq ffc0a740: 4e 80 04 21 bctrl ffc0a744: 48 00 01 58 b ffc0a89c <_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; ffc0a748: 81 39 00 04 lwz r9,4(r25) ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { ffc0a74c: 71 27 00 01 andi. r7,r9,1 ffc0a750: 40 a2 00 f4 bne+ ffc0a844 <_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 ? ffc0a754: 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)( ffc0a758: 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; ffc0a75c: 80 fd 00 0c lwz r7,12(r29) ffc0a760: 7f 88 48 00 cmpw cr7,r8,r9 ffc0a764: 41 9e 00 18 beq- cr7,ffc0a77c <_Heap_Walk+0x3d8> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), ffc0a768: 7f 88 e8 00 cmpw cr7,r8,r29 ffc0a76c: 39 35 7a 9d addi r9,r21,31389 ffc0a770: 40 be 00 10 bne+ cr7,ffc0a780 <_Heap_Walk+0x3dc> ffc0a774: 39 2e 7b d5 addi r9,r14,31701 ffc0a778: 48 00 00 08 b ffc0a780 <_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)( ffc0a77c: 39 2f 7b c5 addi r9,r15,31685 block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? ffc0a780: 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)( ffc0a784: 7f 8a 38 00 cmpw cr7,r10,r7 ffc0a788: 41 9e 00 18 beq- cr7,ffc0a7a0 <_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)" : "") ffc0a78c: 7f 8a e8 00 cmpw cr7,r10,r29 ffc0a790: 38 f5 7a 9d addi r7,r21,31389 ffc0a794: 40 be 00 10 bne+ cr7,ffc0a7a4 <_Heap_Walk+0x400> ffc0a798: 38 f0 7b ee addi r7,r16,31726 ffc0a79c: 48 00 00 08 b ffc0a7a4 <_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)( ffc0a7a0: 38 f1 7b df addi r7,r17,31711 ffc0a7a4: 90 e1 00 08 stw r7,8(r1) ffc0a7a8: 7f c3 f3 78 mr r3,r30 ffc0a7ac: 38 80 00 00 li r4,0 ffc0a7b0: 7f e9 03 a6 mtctr r31 ffc0a7b4: 91 61 00 18 stw r11,24(r1) ffc0a7b8: 7e 45 93 78 mr r5,r18 ffc0a7bc: 7f 86 e3 78 mr r6,r28 ffc0a7c0: 7f 67 db 78 mr r7,r27 ffc0a7c4: 4c c6 31 82 crclr 4*cr1+eq ffc0a7c8: 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 ) { ffc0a7cc: 81 19 00 00 lwz r8,0(r25) ffc0a7d0: 81 61 00 18 lwz r11,24(r1) ffc0a7d4: 7f 9b 40 00 cmpw cr7,r27,r8 ffc0a7d8: 41 be 00 30 beq+ cr7,ffc0a808 <_Heap_Walk+0x464> (*printer)( ffc0a7dc: 3c a0 ff c1 lis r5,-63 ffc0a7e0: 7f e9 03 a6 mtctr r31 ffc0a7e4: 7f c3 f3 78 mr r3,r30 ffc0a7e8: 38 80 00 01 li r4,1 ffc0a7ec: 38 a5 7f 0e addi r5,r5,32526 ffc0a7f0: 7f 86 e3 78 mr r6,r28 ffc0a7f4: 7f 67 db 78 mr r7,r27 ffc0a7f8: 7f 29 cb 78 mr r9,r25 ffc0a7fc: 4c c6 31 82 crclr 4*cr1+eq ffc0a800: 4e 80 04 21 bctrl ffc0a804: 48 00 00 98 b ffc0a89c <_Heap_Walk+0x4f8> ); return false; } if ( !prev_used ) { ffc0a808: 2f 8b 00 00 cmpwi cr7,r11,0 ffc0a80c: 40 be 00 18 bne+ cr7,ffc0a824 <_Heap_Walk+0x480> (*printer)( ffc0a810: 3c a0 ff c1 lis r5,-63 ffc0a814: 7f c3 f3 78 mr r3,r30 ffc0a818: 38 80 00 01 li r4,1 ffc0a81c: 38 a5 7f 47 addi r5,r5,32583 ffc0a820: 48 00 00 94 b ffc0a8b4 <_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; ffc0a824: 81 3d 00 08 lwz r9,8(r29) ffc0a828: 48 00 00 10 b ffc0a838 <_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 ) { ffc0a82c: 7f 89 e0 00 cmpw cr7,r9,r28 ffc0a830: 41 9e 00 5c beq- cr7,ffc0a88c <_Heap_Walk+0x4e8> return true; } free_block = free_block->next; ffc0a834: 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 ) { ffc0a838: 7f 89 e8 00 cmpw cr7,r9,r29 ffc0a83c: 40 9e ff f0 bne+ cr7,ffc0a82c <_Heap_Walk+0x488> ffc0a840: 48 00 00 64 b ffc0a8a4 <_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) { ffc0a844: 2f 8b 00 00 cmpwi cr7,r11,0 (*printer)( ffc0a848: 7f c3 f3 78 mr r3,r30 ffc0a84c: 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) { ffc0a850: 41 9e 00 20 beq- cr7,ffc0a870 <_Heap_Walk+0x4cc> (*printer)( ffc0a854: 7e 65 9b 78 mr r5,r19 ffc0a858: 7f e9 03 a6 mtctr r31 ffc0a85c: 7f 86 e3 78 mr r6,r28 ffc0a860: 7f 67 db 78 mr r7,r27 ffc0a864: 4c c6 31 82 crclr 4*cr1+eq ffc0a868: 4e 80 04 21 bctrl ffc0a86c: 48 00 00 20 b ffc0a88c <_Heap_Walk+0x4e8> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( ffc0a870: 7e 85 a3 78 mr r5,r20 ffc0a874: 81 1c 00 00 lwz r8,0(r28) ffc0a878: 7f 86 e3 78 mr r6,r28 ffc0a87c: 7f e9 03 a6 mtctr r31 ffc0a880: 7f 67 db 78 mr r7,r27 ffc0a884: 4c c6 31 82 crclr 4*cr1+eq ffc0a888: 4e 80 04 21 bctrl block->prev_size ); } block = next_block; } while ( block != first_block ); ffc0a88c: 7f 99 b0 00 cmpw cr7,r25,r22 ffc0a890: 7f 3c cb 78 mr r28,r25 ffc0a894: 40 9e fd b0 bne+ cr7,ffc0a644 <_Heap_Walk+0x2a0> ffc0a898: 4b ff fb 60 b ffc0a3f8 <_Heap_Walk+0x54> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; ffc0a89c: 38 60 00 00 li r3,0 ffc0a8a0: 48 00 00 28 b ffc0a8c8 <_Heap_Walk+0x524> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( ffc0a8a4: 3c a0 ff c1 lis r5,-63 ffc0a8a8: 7f c3 f3 78 mr r3,r30 ffc0a8ac: 38 80 00 01 li r4,1 ffc0a8b0: 38 a5 7f b2 addi r5,r5,32690 ffc0a8b4: 7f 86 e3 78 mr r6,r28 ffc0a8b8: 7f e9 03 a6 mtctr r31 ffc0a8bc: 4c c6 31 82 crclr 4*cr1+eq ffc0a8c0: 4e 80 04 21 bctrl ffc0a8c4: 4b ff ff d8 b ffc0a89c <_Heap_Walk+0x4f8> block = next_block; } while ( block != first_block ); return true; } ffc0a8c8: 39 61 00 68 addi r11,r1,104 ffc0a8cc: 4b ff 62 9c b ffc00b68 <_restgpr_14_x> =============================================================================== ffc0a2f4 <_Heap_Walk_print>: /* Do nothing */ } static void _Heap_Walk_print( int source, bool error, const char *fmt, ... ) { ffc0a2f4: 7c 2b 0b 78 mr r11,r1 ffc0a2f8: 7c 08 02 a6 mflr r0 ffc0a2fc: 94 21 ff 88 stwu r1,-120(r1) ffc0a300: 4b ff 68 61 bl ffc00b60 <_savegpr_31> ffc0a304: 90 01 00 7c stw r0,124(r1) ffc0a308: 7c 6b 1b 78 mr r11,r3 ffc0a30c: 90 c1 00 1c stw r6,28(r1) ffc0a310: 90 e1 00 20 stw r7,32(r1) ffc0a314: 91 01 00 24 stw r8,36(r1) ffc0a318: 91 21 00 28 stw r9,40(r1) ffc0a31c: 91 41 00 2c stw r10,44(r1) ffc0a320: 40 86 00 24 bne- cr1,ffc0a344 <_Heap_Walk_print+0x50> <== ALWAYS TAKEN ffc0a324: d8 21 00 30 stfd f1,48(r1) <== NOT EXECUTED ffc0a328: d8 41 00 38 stfd f2,56(r1) <== NOT EXECUTED ffc0a32c: d8 61 00 40 stfd f3,64(r1) <== NOT EXECUTED ffc0a330: d8 81 00 48 stfd f4,72(r1) <== NOT EXECUTED ffc0a334: d8 a1 00 50 stfd f5,80(r1) <== NOT EXECUTED ffc0a338: d8 c1 00 58 stfd f6,88(r1) <== NOT EXECUTED ffc0a33c: d8 e1 00 60 stfd f7,96(r1) <== NOT EXECUTED ffc0a340: d9 01 00 68 stfd f8,104(r1) <== NOT EXECUTED va_list ap; if ( error ) { ffc0a344: 2f 84 00 00 cmpwi cr7,r4,0 { /* Do nothing */ } static void _Heap_Walk_print( int source, bool error, const char *fmt, ... ) { ffc0a348: 7c bf 2b 78 mr r31,r5 va_list ap; if ( error ) { ffc0a34c: 41 be 00 10 beq+ cr7,ffc0a35c <_Heap_Walk_print+0x68> printk( "FAIL[%d]: ", source ); ffc0a350: 3c 60 ff c1 lis r3,-63 ffc0a354: 38 63 7b af addi r3,r3,31663 ffc0a358: 48 00 00 0c b ffc0a364 <_Heap_Walk_print+0x70> } else { printk( "PASS[%d]: ", source ); ffc0a35c: 3c 60 ff c1 lis r3,-63 ffc0a360: 38 63 7b ba addi r3,r3,31674 ffc0a364: 7d 64 5b 78 mr r4,r11 ffc0a368: 4c c6 31 82 crclr 4*cr1+eq ffc0a36c: 4b ff b3 01 bl ffc0566c } va_start( ap, fmt ); ffc0a370: 39 20 00 03 li r9,3 ffc0a374: 99 21 00 08 stb r9,8(r1) ffc0a378: 39 20 00 00 li r9,0 vprintk( fmt, ap ); ffc0a37c: 7f e3 fb 78 mr r3,r31 printk( "FAIL[%d]: ", source ); } else { printk( "PASS[%d]: ", source ); } va_start( ap, fmt ); ffc0a380: 99 21 00 09 stb r9,9(r1) ffc0a384: 39 21 00 80 addi r9,r1,128 vprintk( fmt, ap ); ffc0a388: 38 81 00 08 addi r4,r1,8 printk( "FAIL[%d]: ", source ); } else { printk( "PASS[%d]: ", source ); } va_start( ap, fmt ); ffc0a38c: 91 21 00 0c stw r9,12(r1) ffc0a390: 39 21 00 10 addi r9,r1,16 ffc0a394: 91 21 00 10 stw r9,16(r1) vprintk( fmt, ap ); ffc0a398: 4b ff dd 1d bl ffc080b4 va_end( ap ); } ffc0a39c: 39 61 00 78 addi r11,r1,120 ffc0a3a0: 4b ff 68 0c b ffc00bac <_restgpr_31_x> =============================================================================== ffc09dd0 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { ffc09dd0: 94 21 ff d8 stwu r1,-40(r1) ffc09dd4: 7c 08 02 a6 mflr r0 ffc09dd8: bf a1 00 1c stmw r29,28(r1) ffc09ddc: 7c 9e 23 78 mr r30,r4 ffc09de0: 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 }; ffc09de4: 98 81 00 0c stb r4,12(r1) _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); ffc09de8: 3c 80 ff c1 lis r4,-63 ffc09dec: 38 84 be 4c addi r4,r4,-16820 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; ffc09df0: 90 61 00 08 stw r3,8(r1) _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); ffc09df4: 38 61 00 08 addi r3,r1,8 ffc09df8: 7c bf 2b 78 mr r31,r5 ffc09dfc: 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 }; ffc09e00: 90 a1 00 10 stw r5,16(r1) _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); ffc09e04: 48 00 20 6d bl ffc0be70 <_User_extensions_Iterate> _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; ffc09e08: 3d 40 00 00 lis r10,0 ffc09e0c: 39 2a 31 78 addi r9,r10,12664 ffc09e10: 93 aa 31 78 stw r29,12664(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 ); ffc09e14: 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; ffc09e18: 9b c9 00 04 stb r30,4(r9) RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; ffc09e1c: 39 40 00 05 li r10,5 _Internal_errors_What_happened.the_error = the_error; ffc09e20: 93 e9 00 08 stw r31,8(r9) ffc09e24: 3d 20 00 00 lis r9,0 ffc09e28: 91 49 28 90 stw r10,10384(r9) _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); ffc09e2c: 4b ff 99 35 bl ffc03760 <_BSP_Fatal_error> ffc09e30: 48 00 00 00 b ffc09e30 <_Internal_error_Occurred+0x60><== NOT EXECUTED =============================================================================== ffc09e48 <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { ffc09e48: 94 21 ff f0 stwu r1,-16(r1) ffc09e4c: 7c 08 02 a6 mflr r0 ffc09e50: 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 ) ffc09e54: 81 23 00 18 lwz r9,24(r3) #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { ffc09e58: bf c1 00 08 stmw r30,8(r1) ffc09e5c: 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 ) ffc09e60: 2f 89 00 00 cmpwi cr7,r9,0 ffc09e64: 40 be 00 0c bne+ cr7,ffc09e70 <_Objects_Allocate+0x28> <== ALWAYS TAKEN return NULL; ffc09e68: 38 60 00 00 li r3,0 ffc09e6c: 48 00 00 70 b ffc09edc <_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 ); ffc09e70: 3b c3 00 20 addi r30,r3,32 ffc09e74: 7f c3 f3 78 mr r3,r30 ffc09e78: 4b ff f5 b9 bl ffc09430 <_Chain_Get> if ( information->auto_extend ) { ffc09e7c: 89 3f 00 12 lbz r9,18(r31) ffc09e80: 2f 89 00 00 cmpwi cr7,r9,0 ffc09e84: 41 9e 00 58 beq- cr7,ffc09edc <_Objects_Allocate+0x94> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { ffc09e88: 2f 83 00 00 cmpwi cr7,r3,0 ffc09e8c: 40 be 00 1c bne+ cr7,ffc09ea8 <_Objects_Allocate+0x60> _Objects_Extend_information( information ); ffc09e90: 7f e3 fb 78 mr r3,r31 ffc09e94: 48 00 00 69 bl ffc09efc <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); ffc09e98: 7f c3 f3 78 mr r3,r30 ffc09e9c: 4b ff f5 95 bl ffc09430 <_Chain_Get> } if ( the_object ) { ffc09ea0: 2c 03 00 00 cmpwi r3,0 ffc09ea4: 41 82 ff c4 beq+ ffc09e68 <_Objects_Allocate+0x20> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - ffc09ea8: a1 43 00 0a lhz r10,10(r3) ffc09eac: a1 3f 00 0a lhz r9,10(r31) ffc09eb0: 7d 29 50 50 subf r9,r9,r10 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; ffc09eb4: a1 5f 00 14 lhz r10,20(r31) ffc09eb8: 7d 29 53 96 divwu r9,r9,r10 information->inactive_per_block[ block ]--; ffc09ebc: 81 5f 00 30 lwz r10,48(r31) ffc09ec0: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc09ec4: 7d 0a 48 2e lwzx r8,r10,r9 ffc09ec8: 39 08 ff ff addi r8,r8,-1 ffc09ecc: 7d 0a 49 2e stwx r8,r10,r9 information->inactive--; ffc09ed0: a1 3f 00 2c lhz r9,44(r31) ffc09ed4: 39 29 ff ff addi r9,r9,-1 ffc09ed8: b1 3f 00 2c sth r9,44(r31) ); } #endif return the_object; } ffc09edc: 39 61 00 10 addi r11,r1,16 ffc09ee0: 4b ff 66 e0 b ffc005c0 <_restgpr_30_x> =============================================================================== ffc09efc <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { ffc09efc: 94 21 ff b8 stwu r1,-72(r1) ffc09f00: 7c 08 02 a6 mflr r0 ffc09f04: 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 ) ffc09f08: 81 43 00 34 lwz r10,52(r3) */ void _Objects_Extend_information( Objects_Information *information ) { ffc09f0c: be a1 00 1c stmw r21,28(r1) ffc09f10: 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 ) ffc09f14: 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 ); ffc09f18: a3 83 00 0a lhz r28,10(r3) index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) ffc09f1c: 41 9e 00 54 beq- cr7,ffc09f70 <_Objects_Extend_information+0x74> block_count = 0; else { block_count = information->maximum / information->allocation_size; ffc09f20: 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 ); ffc09f24: 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; ffc09f28: 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; ffc09f2c: 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; ffc09f30: 7f bd 43 96 divwu r29,r29,r8 ffc09f34: 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; ffc09f38: 39 3d 00 01 addi r9,r29,1 ffc09f3c: 40 be 00 24 bne+ cr7,ffc09f60 <_Objects_Extend_information+0x64><== ALWAYS TAKEN ffc09f40: 39 20 00 01 li r9,1 <== NOT EXECUTED ffc09f44: 48 00 00 1c b ffc09f60 <_Objects_Extend_information+0x64><== NOT EXECUTED * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( ffc09f48: 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 ) { ffc09f4c: 7c ea 38 2e lwzx r7,r10,r7 ffc09f50: 2f 87 00 00 cmpwi cr7,r7,0 ffc09f54: 41 9e 00 30 beq- cr7,ffc09f84 <_Objects_Extend_information+0x88> * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( ffc09f58: 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++ ) { ffc09f5c: 3b 7b 00 01 addi r27,r27,1 ffc09f60: 35 29 ff ff addic. r9,r9,-1 ffc09f64: 40 82 ff e4 bne+ ffc09f48 <_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; ffc09f68: 3b 40 00 01 li r26,1 ffc09f6c: 48 00 00 1c b ffc09f88 <_Objects_Extend_information+0x8c> minimum_index = _Objects_Get_index( information->minimum_id ); ffc09f70: 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; ffc09f74: 3b 40 00 01 li r26,1 minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; ffc09f78: 3b 60 00 00 li r27,0 /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; ffc09f7c: 3b a0 00 00 li r29,0 ffc09f80: 48 00 00 08 b ffc09f88 <_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; ffc09f84: 3b 40 00 00 li r26,0 } else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; ffc09f88: a1 3f 00 14 lhz r9,20(r31) ffc09f8c: a3 3f 00 10 lhz r25,16(r31) ffc09f90: 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 ) { ffc09f94: 2b 99 ff ff cmplwi cr7,r25,65535 ffc09f98: 41 9d 02 10 bgt- cr7,ffc0a1a8 <_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; ffc09f9c: 80 7f 00 18 lwz r3,24(r31) ffc09fa0: 7c 69 19 d6 mullw r3,r9,r3 if ( information->auto_extend ) { ffc09fa4: 89 3f 00 12 lbz r9,18(r31) ffc09fa8: 2f 89 00 00 cmpwi cr7,r9,0 ffc09fac: 41 9e 00 14 beq- cr7,ffc09fc0 <_Objects_Extend_information+0xc4> new_object_block = _Workspace_Allocate( block_size ); ffc09fb0: 48 00 23 c9 bl ffc0c378 <_Workspace_Allocate> if ( !new_object_block ) ffc09fb4: 7c 76 1b 79 mr. r22,r3 ffc09fb8: 40 a2 00 10 bne+ ffc09fc8 <_Objects_Extend_information+0xcc> ffc09fbc: 48 00 01 ec b ffc0a1a8 <_Objects_Extend_information+0x2ac> return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); ffc09fc0: 48 00 23 e1 bl ffc0c3a0 <_Workspace_Allocate_or_fatal_error> ffc09fc4: 7c 76 1b 78 mr r22,r3 } /* * Do we need to grow the tables? */ if ( do_extend ) { ffc09fc8: 2f 9a 00 00 cmpwi cr7,r26,0 ffc09fcc: 41 9e 01 58 beq- cr7,ffc0a124 <_Objects_Extend_information+0x228> */ /* * Up the block count and maximum */ block_count++; ffc09fd0: 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 *)) + ffc09fd4: 1d 38 00 03 mulli r9,r24,3 ((maximum + minimum_index) * sizeof(Objects_Control *)); ffc09fd8: 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 *)) + ffc09fdc: 7c 63 4a 14 add r3,r3,r9 ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { ffc09fe0: 89 3f 00 12 lbz r9,18(r31) block_count++; /* * Allocate the tables and break it up. */ block_size = block_count * ffc09fe4: 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 ) { ffc09fe8: 2f 89 00 00 cmpwi cr7,r9,0 ffc09fec: 41 9e 00 1c beq- cr7,ffc0a008 <_Objects_Extend_information+0x10c> object_blocks = _Workspace_Allocate( block_size ); ffc09ff0: 48 00 23 89 bl ffc0c378 <_Workspace_Allocate> if ( !object_blocks ) { ffc09ff4: 7c 7a 1b 79 mr. r26,r3 ffc09ff8: 40 a2 00 18 bne+ ffc0a010 <_Objects_Extend_information+0x114> _Workspace_Free( new_object_block ); ffc09ffc: 7e c3 b3 78 mr r3,r22 ffc0a000: 48 00 23 91 bl ffc0c390 <_Workspace_Free> ffc0a004: 48 00 01 a4 b ffc0a1a8 <_Objects_Extend_information+0x2ac> return; } } else { object_blocks = _Workspace_Allocate_or_fatal_error( block_size ); ffc0a008: 48 00 23 99 bl ffc0c3a0 <_Workspace_Allocate_or_fatal_error> ffc0a00c: 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 ) { ffc0a010: 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*) ); ffc0a014: 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); ffc0a018: 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 ) { ffc0a01c: 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; ffc0a020: 38 fc 00 01 addi r7,r28,1 ffc0a024: 7f 17 c2 14 add r24,r23,r24 ffc0a028: 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 ) { ffc0a02c: 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; ffc0a030: 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 ) { ffc0a034: 40 bd 00 50 ble+ cr7,ffc0a084 <_Objects_Extend_information+0x188> * separate parts as size of each block has changed. */ memcpy( object_blocks, information->object_blocks, block_count * sizeof(void*) ); ffc0a038: 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, ffc0a03c: 80 9f 00 34 lwz r4,52(r31) ffc0a040: 7e a5 ab 78 mr r5,r21 ffc0a044: 7f 43 d3 78 mr r3,r26 ffc0a048: 48 00 72 69 bl ffc112b0 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, ffc0a04c: 80 9f 00 30 lwz r4,48(r31) ffc0a050: 7e a5 ab 78 mr r5,r21 ffc0a054: 7e e3 bb 78 mr r3,r23 ffc0a058: 48 00 72 59 bl ffc112b0 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); ffc0a05c: 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, ffc0a060: 80 9f 00 1c lwz r4,28(r31) ffc0a064: 7f 03 c3 78 mr r3,r24 information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); ffc0a068: 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, ffc0a06c: 54 a5 10 3a rlwinm r5,r5,2,0,29 ffc0a070: 48 00 72 41 bl ffc112b0 ffc0a074: 48 00 00 14 b ffc0a088 <_Objects_Extend_information+0x18c> * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( ffc0a078: 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; ffc0a07c: 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++ ) { ffc0a080: 39 29 00 01 addi r9,r9,1 ffc0a084: 42 00 ff f4 bdnz+ ffc0a078 <_Objects_Extend_information+0x17c> } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; ffc0a088: 39 20 00 00 li r9,0 ffc0a08c: 57 bd 10 3a rlwinm r29,r29,2,0,29 ffc0a090: 7d 3a e9 2e stwx r9,r26,r29 inactive_per_block[block_count] = 0; for ( index=index_base ; ffc0a094: 7f ca f3 78 mr r10,r30 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; ffc0a098: 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; ffc0a09c: 7d 37 e9 2e stwx r9,r23,r29 for ( index=index_base ; index < ( information->allocation_size + index_base ); ffc0a0a0: a1 3f 00 14 lhz r9,20(r31) index++ ) { local_table[ index ] = NULL; ffc0a0a4: 7d 1e 4a 14 add r8,r30,r9 ffc0a0a8: 7f 9e 40 40 cmplw cr7,r30,r8 ffc0a0ac: 39 29 00 01 addi r9,r9,1 ffc0a0b0: 41 9d 00 0c bgt- cr7,ffc0a0bc <_Objects_Extend_information+0x1c0><== NEVER TAKEN ffc0a0b4: 2f 88 00 00 cmpwi cr7,r8,0 ffc0a0b8: 40 be 00 18 bne+ cr7,ffc0a0d0 <_Objects_Extend_information+0x1d4><== ALWAYS TAKEN ffc0a0bc: 39 20 00 01 li r9,1 <== NOT EXECUTED ffc0a0c0: 48 00 00 10 b ffc0a0d0 <_Objects_Extend_information+0x1d4><== NOT EXECUTED * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( ffc0a0c4: 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; ffc0a0c8: 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++ ) { ffc0a0cc: 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 ; ffc0a0d0: 35 29 ff ff addic. r9,r9,-1 ffc0a0d4: 40 82 ff f0 bne+ ffc0a0c4 <_Objects_Extend_information+0x1c8> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0a0d8: 7d 40 00 a6 mfmsr r10 ffc0a0dc: 7d 30 42 a6 mfsprg r9,0 ffc0a0e0: 7d 49 48 78 andc r9,r10,r9 ffc0a0e4: 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) | ffc0a0e8: 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( ffc0a0ec: a1 1f 00 04 lhz r8,4(r31) ffc0a0f0: 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; ffc0a0f4: b3 3f 00 10 sth r25,16(r31) ffc0a0f8: 65 29 00 01 oris r9,r9,1 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | ffc0a0fc: 7d 39 cb 78 or r25,r9,r25 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; ffc0a100: 80 7f 00 34 lwz r3,52(r31) ffc0a104: 55 08 d8 08 rlwinm r8,r8,27,0,4 information->object_blocks = object_blocks; ffc0a108: 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) | ffc0a10c: 7f 39 43 78 or r25,r25,r8 information->inactive_per_block = inactive_per_block; ffc0a110: 92 ff 00 30 stw r23,48(r31) information->local_table = local_table; ffc0a114: 93 1f 00 1c stw r24,28(r31) information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( ffc0a118: 93 3f 00 0c stw r25,12(r31) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0a11c: 7d 40 01 24 mtmsr r10 information->maximum ); _ISR_Enable( level ); _Workspace_Free( old_tables ); ffc0a120: 48 00 22 71 bl ffc0c390 <_Workspace_Free> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; ffc0a124: 81 3f 00 34 lwz r9,52(r31) ffc0a128: 57 7b 10 3a rlwinm r27,r27,2,0,29 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( ffc0a12c: 3b a1 00 08 addi r29,r1,8 ffc0a130: 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; ffc0a134: 7e c9 d9 2e stwx r22,r9,r27 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( ffc0a138: 7f a3 eb 78 mr r3,r29 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); ffc0a13c: 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( ffc0a140: 81 3f 00 34 lwz r9,52(r31) ffc0a144: 80 df 00 18 lwz r6,24(r31) ffc0a148: 7c 89 d8 2e lwzx r4,r9,r27 ffc0a14c: 4b ff f3 25 bl ffc09470 <_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 ) { ffc0a150: 48 00 00 30 b ffc0a180 <_Objects_Extend_information+0x284> ffc0a154: 81 3f 00 00 lwz r9,0(r31) information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); ffc0a158: 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( ffc0a15c: a1 5f 00 04 lhz r10,4(r31) ffc0a160: 55 29 c0 0e rlwinm r9,r9,24,0,7 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | ffc0a164: 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) | ffc0a168: 65 29 00 01 oris r9,r9,1 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | ffc0a16c: 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) | ffc0a170: 7d 29 f3 78 or r9,r9,r30 ffc0a174: 91 24 00 08 stw r9,8(r4) index ); _Chain_Append( &information->Inactive, &the_object->Node ); index++; ffc0a178: 3b de 00 01 addi r30,r30,1 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); ffc0a17c: 4b ff f2 85 bl ffc09400 <_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 ) { ffc0a180: 7f a3 eb 78 mr r3,r29 ffc0a184: 4b ff f2 ad bl ffc09430 <_Chain_Get> ffc0a188: 7c 64 1b 79 mr. r4,r3 ffc0a18c: 40 82 ff c8 bne+ ffc0a154 <_Objects_Extend_information+0x258> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; ffc0a190: a1 3f 00 14 lhz r9,20(r31) ffc0a194: 81 5f 00 30 lwz r10,48(r31) ffc0a198: 7d 2a d9 2e stwx r9,r10,r27 information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); ffc0a19c: a1 5f 00 2c lhz r10,44(r31) ffc0a1a0: 7d 29 52 14 add r9,r9,r10 index++; } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = ffc0a1a4: b1 3f 00 2c sth r9,44(r31) (Objects_Maximum)(information->inactive + information->allocation_size); } ffc0a1a8: 39 61 00 48 addi r11,r1,72 ffc0a1ac: 4b ff 63 f0 b ffc0059c <_restgpr_21_x> =============================================================================== ffc0a258 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { ffc0a258: 94 21 ff f0 stwu r1,-16(r1) ffc0a25c: 7c 08 02 a6 mflr r0 ffc0a260: bf c1 00 08 stmw r30,8(r1) Objects_Information *info; int the_class_api_maximum; if ( !the_class ) ffc0a264: 7c 9f 23 79 mr. r31,r4 Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { ffc0a268: 90 01 00 14 stw r0,20(r1) Objects_Information *info; int the_class_api_maximum; if ( !the_class ) ffc0a26c: 40 a2 00 0c bne+ ffc0a278 <_Objects_Get_information+0x20> return NULL; ffc0a270: 38 60 00 00 li r3,0 ffc0a274: 48 00 00 50 b ffc0a2c4 <_Objects_Get_information+0x6c> ffc0a278: 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 ); ffc0a27c: 48 00 45 69 bl ffc0e7e4 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) ffc0a280: 2c 03 00 00 cmpwi r3,0 ffc0a284: 41 a2 ff ec beq- ffc0a270 <_Objects_Get_information+0x18> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) ffc0a288: 7f 9f 18 40 cmplw cr7,r31,r3 ffc0a28c: 41 bd ff e4 bgt- cr7,ffc0a270 <_Objects_Get_information+0x18> return NULL; if ( !_Objects_Information_table[ the_api ] ) ffc0a290: 3d 20 00 00 lis r9,0 ffc0a294: 57 de 10 3a rlwinm r30,r30,2,0,29 ffc0a298: 39 29 2c 78 addi r9,r9,11384 ffc0a29c: 7d 29 f0 2e lwzx r9,r9,r30 ffc0a2a0: 2f 89 00 00 cmpwi cr7,r9,0 ffc0a2a4: 41 be ff cc beq- cr7,ffc0a270 <_Objects_Get_information+0x18><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; ffc0a2a8: 57 ff 10 3a rlwinm r31,r31,2,0,29 ffc0a2ac: 7c 69 f8 2e lwzx r3,r9,r31 if ( !info ) ffc0a2b0: 2f 83 00 00 cmpwi cr7,r3,0 ffc0a2b4: 41 be ff bc beq- cr7,ffc0a270 <_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 ) ffc0a2b8: a1 23 00 10 lhz r9,16(r3) ffc0a2bc: 2f 89 00 00 cmpwi cr7,r9,0 ffc0a2c0: 41 be ff b0 beq- cr7,ffc0a270 <_Objects_Get_information+0x18> return NULL; #endif return info; } ffc0a2c4: 39 61 00 10 addi r11,r1,16 ffc0a2c8: 4b ff 62 f8 b ffc005c0 <_restgpr_30_x> =============================================================================== ffc1c818 <_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; ffc1c818: 81 23 00 08 lwz r9,8(r3) ffc1c81c: 21 29 00 01 subfic r9,r9,1 ffc1c820: 7c 89 22 14 add r4,r9,r4 if ( information->maximum >= index ) { ffc1c824: a1 23 00 10 lhz r9,16(r3) ffc1c828: 7f 89 20 40 cmplw cr7,r9,r4 ffc1c82c: 41 9c 00 24 blt- cr7,ffc1c850 <_Objects_Get_no_protection+0x38> if ( (the_object = information->local_table[ index ]) != NULL ) { ffc1c830: 81 23 00 1c lwz r9,28(r3) ffc1c834: 54 84 10 3a rlwinm r4,r4,2,0,29 ffc1c838: 7c 69 20 2e lwzx r3,r9,r4 ffc1c83c: 2f 83 00 00 cmpwi cr7,r3,0 ffc1c840: 41 9e 00 10 beq- cr7,ffc1c850 <_Objects_Get_no_protection+0x38><== NEVER TAKEN *location = OBJECTS_LOCAL; ffc1c844: 39 20 00 00 li r9,0 ffc1c848: 91 25 00 00 stw r9,0(r5) return the_object; ffc1c84c: 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; ffc1c850: 39 20 00 01 li r9,1 ffc1c854: 91 25 00 00 stw r9,0(r5) return NULL; ffc1c858: 38 60 00 00 li r3,0 } ffc1c85c: 4e 80 00 20 blr =============================================================================== ffc0e280 <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { ffc0e280: 7c 2b 0b 78 mr r11,r1 ffc0e284: 94 21 ff e0 stwu r1,-32(r1) ffc0e288: 7c 08 02 a6 mflr r0 ffc0e28c: 48 01 b3 2d bl ffc295b8 <_savegpr_31> ffc0e290: 7c 9f 23 78 mr r31,r4 /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; ffc0e294: 7c 64 1b 79 mr. r4,r3 Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { ffc0e298: 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; ffc0e29c: 40 82 00 10 bne- ffc0e2ac <_Objects_Id_to_name+0x2c> ffc0e2a0: 3d 20 00 00 lis r9,0 ffc0e2a4: 81 29 3a f0 lwz r9,15088(r9) ffc0e2a8: 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); ffc0e2ac: 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 ) ffc0e2b0: 39 0a ff ff addi r8,r10,-1 ffc0e2b4: 2b 88 00 02 cmplwi cr7,r8,2 ffc0e2b8: 40 9d 00 4c ble- cr7,ffc0e304 <_Objects_Id_to_name+0x84> the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; ffc0e2bc: 38 60 00 03 li r3,3 ffc0e2c0: 48 00 00 60 b ffc0e320 <_Objects_Id_to_name+0xa0> if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; ffc0e2c4: 54 88 3e 7a rlwinm r8,r4,7,25,29 ffc0e2c8: 7c 6a 40 2e lwzx r3,r10,r8 if ( !information ) ffc0e2cc: 2f 83 00 00 cmpwi cr7,r3,0 ffc0e2d0: 41 be ff ec beq- cr7,ffc0e2bc <_Objects_Id_to_name+0x3c><== NEVER TAKEN return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) ffc0e2d4: 89 43 00 38 lbz r10,56(r3) ffc0e2d8: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0e2dc: 40 9e ff e0 bne+ cr7,ffc0e2bc <_Objects_Id_to_name+0x3c><== NEVER TAKEN return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); ffc0e2e0: 38 a1 00 08 addi r5,r1,8 ffc0e2e4: 4b ff ff 1d bl ffc0e200 <_Objects_Get> if ( !the_object ) ffc0e2e8: 2c 03 00 00 cmpwi r3,0 ffc0e2ec: 41 a2 ff d0 beq- ffc0e2bc <_Objects_Id_to_name+0x3c> return OBJECTS_INVALID_ID; *name = the_object->name; ffc0e2f0: 81 23 00 0c lwz r9,12(r3) ffc0e2f4: 91 3f 00 00 stw r9,0(r31) _Thread_Enable_dispatch(); ffc0e2f8: 48 00 0e 9d bl ffc0f194 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; ffc0e2fc: 38 60 00 00 li r3,0 ffc0e300: 48 00 00 20 b ffc0e320 <_Objects_Id_to_name+0xa0> the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) ffc0e304: 3d 00 00 00 lis r8,0 ffc0e308: 55 4a 10 3a rlwinm r10,r10,2,0,29 ffc0e30c: 39 08 35 78 addi r8,r8,13688 ffc0e310: 7d 48 50 2e lwzx r10,r8,r10 ffc0e314: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0e318: 40 9e ff ac bne+ cr7,ffc0e2c4 <_Objects_Id_to_name+0x44> ffc0e31c: 4b ff ff a0 b ffc0e2bc <_Objects_Id_to_name+0x3c> return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } ffc0e320: 39 61 00 20 addi r11,r1,32 ffc0e324: 4b ff 25 0c b ffc00830 <_restgpr_31_x> =============================================================================== ffc0a99c <_POSIX_Absolute_timeout_to_ticks>: */ POSIX_Absolute_timeout_conversion_results_t _POSIX_Absolute_timeout_to_ticks( const struct timespec *abstime, Watchdog_Interval *ticks_out ) { ffc0a99c: 94 21 ff c8 stwu r1,-56(r1) ffc0a9a0: 7c 08 02 a6 mflr r0 /* * Make sure there is always a value returned. */ *ticks_out = 0; ffc0a9a4: 39 20 00 00 li r9,0 */ POSIX_Absolute_timeout_conversion_results_t _POSIX_Absolute_timeout_to_ticks( const struct timespec *abstime, Watchdog_Interval *ticks_out ) { ffc0a9a8: bf 81 00 28 stmw r28,40(r1) ffc0a9ac: 7c 7c 1b 78 mr r28,r3 ffc0a9b0: 7c 9d 23 78 mr r29,r4 ffc0a9b4: 90 01 00 3c stw r0,60(r1) /* * Make sure there is always a value returned. */ *ticks_out = 0; ffc0a9b8: 91 24 00 00 stw r9,0(r4) /* * Is the absolute time even valid? */ if ( !_Timespec_Is_valid(abstime) ) ffc0a9bc: 48 00 44 61 bl ffc0ee1c <_Timespec_Is_valid> return POSIX_ABSOLUTE_TIMEOUT_INVALID; ffc0a9c0: 39 20 00 00 li r9,0 *ticks_out = 0; /* * Is the absolute time even valid? */ if ( !_Timespec_Is_valid(abstime) ) ffc0a9c4: 2f 83 00 00 cmpwi cr7,r3,0 ffc0a9c8: 41 be 00 9c beq+ cr7,ffc0aa64 <_POSIX_Absolute_timeout_to_ticks+0xc8> ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = ffc0a9cc: 3c 80 00 00 lis r4,0 ffc0a9d0: 38 84 2c c0 addi r4,r4,11456 ffc0a9d4: 38 61 00 18 addi r3,r1,24 ffc0a9d8: 48 00 1f 1d bl ffc0c8f4 <_TOD_Get_with_nanoseconds> static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); ffc0a9dc: 3c c0 3b 9a lis r6,15258 /* * This is the case we were expecting and it took this long to * get here. */ return POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE; } ffc0a9e0: 83 c3 00 00 lwz r30,0(r3) ffc0a9e4: 38 a0 00 00 li r5,0 ffc0a9e8: 83 e3 00 04 lwz r31,4(r3) ffc0a9ec: 60 c6 ca 00 ori r6,r6,51712 ffc0a9f0: 7f c3 f3 78 mr r3,r30 ffc0a9f4: 7f e4 fb 78 mr r4,r31 ffc0a9f8: 48 00 da b5 bl ffc184ac <__divdi3> _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); ffc0a9fc: 3c c0 3b 9a lis r6,15258 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); ffc0aa00: 90 81 00 10 stw r4,16(r1) _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); ffc0aa04: 38 a0 00 00 li r5,0 ffc0aa08: 60 c6 ca 00 ori r6,r6,51712 ffc0aa0c: 7f c3 f3 78 mr r3,r30 ffc0aa10: 7f e4 fb 78 mr r4,r31 ffc0aa14: 48 00 de bd bl ffc188d0 <__moddi3> /* * Is the absolute time in the past? */ _TOD_Get( ¤t_time ); if ( _Timespec_Less_than( abstime, ¤t_time ) ) ffc0aa18: 7f 83 e3 78 mr r3,r28 ffc0aa1c: 90 81 00 14 stw r4,20(r1) ffc0aa20: 38 81 00 10 addi r4,r1,16 ffc0aa24: 48 00 44 39 bl ffc0ee5c <_Timespec_Less_than> return POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST; ffc0aa28: 39 20 00 01 li r9,1 /* * Is the absolute time in the past? */ _TOD_Get( ¤t_time ); if ( _Timespec_Less_than( abstime, ¤t_time ) ) ffc0aa2c: 2f 83 00 00 cmpwi cr7,r3,0 ffc0aa30: 40 be 00 34 bne+ cr7,ffc0aa64 <_POSIX_Absolute_timeout_to_ticks+0xc8> return POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST; /* * How long until the requested absolute time? */ _Timespec_Subtract( ¤t_time, abstime, &difference ); ffc0aa34: 38 61 00 10 addi r3,r1,16 ffc0aa38: 7f 84 e3 78 mr r4,r28 ffc0aa3c: 38 a1 00 08 addi r5,r1,8 ffc0aa40: 48 00 44 59 bl ffc0ee98 <_Timespec_Subtract> /* * Internally the SuperCore uses ticks, so convert to them. */ *ticks_out = _Timespec_To_ticks( &difference ); ffc0aa44: 38 61 00 08 addi r3,r1,8 ffc0aa48: 48 00 44 91 bl ffc0eed8 <_Timespec_To_ticks> /* * This is the case we were expecting and it took this long to * get here. */ return POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE; ffc0aa4c: 39 20 00 03 li r9,3 /* * If the difference was 0, then the future is now. It is so bright * we better wear shades. */ if ( !*ticks_out ) ffc0aa50: 2f 83 00 00 cmpwi cr7,r3,0 _Timespec_Subtract( ¤t_time, abstime, &difference ); /* * Internally the SuperCore uses ticks, so convert to them. */ *ticks_out = _Timespec_To_ticks( &difference ); ffc0aa54: 90 7d 00 00 stw r3,0(r29) /* * If the difference was 0, then the future is now. It is so bright * we better wear shades. */ if ( !*ticks_out ) ffc0aa58: 40 9e 00 0c bne- cr7,ffc0aa64 <_POSIX_Absolute_timeout_to_ticks+0xc8><== ALWAYS TAKEN return POSIX_ABSOLUTE_TIMEOUT_IS_NOW; ffc0aa5c: 39 20 00 02 li r9,2 <== NOT EXECUTED ffc0aa60: 48 00 00 04 b ffc0aa64 <_POSIX_Absolute_timeout_to_ticks+0xc8><== NOT EXECUTED /* * This is the case we were expecting and it took this long to * get here. */ return POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE; } ffc0aa64: 39 61 00 38 addi r11,r1,56 ffc0aa68: 7d 23 4b 78 mr r3,r9 ffc0aa6c: 4b ff 7f 0c b ffc02978 <_restgpr_28_x> =============================================================================== ffc0fe50 <_POSIX_Keys_Run_destructors>: */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { ffc0fe50: 94 21 ff e0 stwu r1,-32(r1) ffc0fe54: 7c 08 02 a6 mflr r0 ffc0fe58: 90 01 00 24 stw r0,36(r1) Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id ); ffc0fe5c: 81 23 00 08 lwz r9,8(r3) */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { ffc0fe60: bf 41 00 08 stmw r26,8(r1) * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; ffc0fe64: 3f c0 00 00 lis r30,0 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; ffc0fe68: 55 3d 13 ba rlwinm r29,r9,2,14,29 ffc0fe6c: 55 29 56 fa rlwinm r9,r9,10,27,29 ffc0fe70: 3b 89 00 10 addi r28,r9,16 if ( value != NULL ) { key->Values [ thread_api ][ thread_index ] = NULL; ffc0fe74: 3b 60 00 00 li r27,0 * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; ffc0fe78: 39 3e 30 58 addi r9,r30,12376 ffc0fe7c: a3 49 00 10 lhz r26,16(r9) done = true; for ( index = 1 ; index <= max ; ++index ) { ffc0fe80: 3b e0 00 01 li r31,1 */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; ffc0fe84: 39 40 00 01 li r10,1 for ( index = 1 ; index <= max ; ++index ) { ffc0fe88: 48 00 00 58 b ffc0fee0 <_POSIX_Keys_Run_destructors+0x90> POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; ffc0fe8c: 39 3e 30 58 addi r9,r30,12376 Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) ffc0fe90: 81 09 00 1c lwz r8,28(r9) ffc0fe94: 57 e9 10 3a rlwinm r9,r31,2,0,29 ffc0fe98: 7d 28 48 2e lwzx r9,r8,r9 _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { ffc0fe9c: 2f 89 00 00 cmpwi cr7,r9,0 ffc0fea0: 41 9e 00 38 beq- cr7,ffc0fed8 <_POSIX_Keys_Run_destructors+0x88> ffc0fea4: 81 09 00 10 lwz r8,16(r9) ffc0fea8: 2f 88 00 00 cmpwi cr7,r8,0 ffc0feac: 41 9e 00 2c beq- cr7,ffc0fed8 <_POSIX_Keys_Run_destructors+0x88> void *value = key->Values [ thread_api ][ thread_index ]; ffc0feb0: 7d 09 e2 14 add r8,r9,r28 ffc0feb4: 81 08 00 04 lwz r8,4(r8) ffc0feb8: 7c 68 e8 2e lwzx r3,r8,r29 if ( value != NULL ) { ffc0febc: 2f 83 00 00 cmpwi cr7,r3,0 ffc0fec0: 41 9e 00 18 beq- cr7,ffc0fed8 <_POSIX_Keys_Run_destructors+0x88><== ALWAYS TAKEN key->Values [ thread_api ][ thread_index ] = NULL; ffc0fec4: 7f 68 e9 2e stwx r27,r8,r29 <== NOT EXECUTED (*key->destructor)( value ); ffc0fec8: 81 29 00 10 lwz r9,16(r9) <== NOT EXECUTED ffc0fecc: 7d 29 03 a6 mtctr r9 <== NOT EXECUTED ffc0fed0: 4e 80 04 21 bctrl <== NOT EXECUTED done = false; ffc0fed4: 39 40 00 00 li r10,0 <== NOT EXECUTED Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { ffc0fed8: 3b ff 00 01 addi r31,r31,1 ffc0fedc: 57 ff 04 3e clrlwi r31,r31,16 ffc0fee0: 7f 9f d0 40 cmplw cr7,r31,r26 ffc0fee4: 40 bd ff a8 ble- cr7,ffc0fe8c <_POSIX_Keys_Run_destructors+0x3c> * number of iterations. An infinite loop may happen if destructors set * thread specific data. This can be considered dubious. * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { ffc0fee8: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0feec: 41 9e ff 8c beq+ cr7,ffc0fe78 <_POSIX_Keys_Run_destructors+0x28><== NEVER TAKEN done = false; } } } } } ffc0fef0: 39 61 00 20 addi r11,r1,32 ffc0fef4: 4b ff 06 bc b ffc005b0 <_restgpr_26_x> =============================================================================== ffc0d5f0 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { ffc0d5f0: 94 21 ff c8 stwu r1,-56(r1) ffc0d5f4: 7c 08 02 a6 mflr r0 ffc0d5f8: bf 61 00 24 stmw r27,36(r1) ffc0d5fc: 7c 7e 1b 78 mr r30,r3 RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd ( mqd_t id, Objects_Locations *location ) { return (POSIX_Message_queue_Control_fd *) _Objects_Get( ffc0d600: 3c 60 00 00 lis r3,0 ffc0d604: 7c 9d 23 78 mr r29,r4 ffc0d608: 91 01 00 18 stw r8,24(r1) ffc0d60c: 7c bc 2b 78 mr r28,r5 ffc0d610: 38 63 36 4c addi r3,r3,13900 ffc0d614: 90 01 00 3c stw r0,60(r1) ffc0d618: 7f c4 f3 78 mr r4,r30 ffc0d61c: 38 a1 00 0c addi r5,r1,12 ffc0d620: 7c df 33 78 mr r31,r6 ffc0d624: 7c fb 3b 78 mr r27,r7 ffc0d628: 48 00 34 dd bl ffc10b04 <_Objects_Get> Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { ffc0d62c: 81 21 00 0c lwz r9,12(r1) ffc0d630: 81 01 00 18 lwz r8,24(r1) ffc0d634: 2f 89 00 00 cmpwi cr7,r9,0 ffc0d638: 40 9e 00 d0 bne- cr7,ffc0d708 <_POSIX_Message_queue_Receive_support+0x118> case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { ffc0d63c: 81 43 00 14 lwz r10,20(r3) ffc0d640: 55 49 07 be clrlwi r9,r10,30 ffc0d644: 2f 89 00 01 cmpwi cr7,r9,1 ffc0d648: 40 be 00 0c bne+ cr7,ffc0d654 <_POSIX_Message_queue_Receive_support+0x64> _Thread_Enable_dispatch(); ffc0d64c: 48 00 43 ad bl ffc119f8 <_Thread_Enable_dispatch> ffc0d650: 48 00 00 b8 b ffc0d708 <_POSIX_Message_queue_Receive_support+0x118> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; ffc0d654: 80 63 00 10 lwz r3,16(r3) if ( msg_len < the_mq->Message_queue.maximum_message_size ) { ffc0d658: 81 23 00 68 lwz r9,104(r3) ffc0d65c: 7f 9c 48 40 cmplw cr7,r28,r9 ffc0d660: 40 bc 00 14 bge+ cr7,ffc0d674 <_POSIX_Message_queue_Receive_support+0x84> _Thread_Enable_dispatch(); ffc0d664: 48 00 43 95 bl ffc119f8 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); ffc0d668: 48 00 9d 71 bl ffc173d8 <__errno> ffc0d66c: 39 20 00 7a li r9,122 ffc0d670: 48 00 00 a0 b ffc0d710 <_POSIX_Message_queue_Receive_support+0x120> length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) ffc0d674: 2f 9b 00 00 cmpwi cr7,r27,0 /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; ffc0d678: 39 20 ff ff li r9,-1 ffc0d67c: 91 21 00 08 stw r9,8(r1) /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) ffc0d680: 38 e0 00 00 li r7,0 ffc0d684: 41 9e 00 0c beq- cr7,ffc0d690 <_POSIX_Message_queue_Receive_support+0xa0> do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; ffc0d688: 69 49 40 00 xori r9,r10,16384 ffc0d68c: 55 27 97 fe rlwinm r7,r9,18,31,31 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( ffc0d690: 38 63 00 1c addi r3,r3,28 ffc0d694: 7f c4 f3 78 mr r4,r30 ffc0d698: 7f a5 eb 78 mr r5,r29 ffc0d69c: 38 c1 00 08 addi r6,r1,8 ffc0d6a0: 48 00 22 e5 bl ffc0f984 <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); ffc0d6a4: 48 00 43 55 bl ffc119f8 <_Thread_Enable_dispatch> if (msg_prio) { ffc0d6a8: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0d6ac: 41 9e 00 20 beq- cr7,ffc0d6cc <_POSIX_Message_queue_Receive_support+0xdc><== NEVER TAKEN *msg_prio = _POSIX_Message_queue_Priority_from_core( _Thread_Executing->Wait.count ffc0d6b0: 3d 20 00 00 lis r9,0 ffc0d6b4: 81 29 36 f0 lwz r9,14064(r9) RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core( CORE_message_queue_Submit_types priority ) { /* absolute value without a library dependency */ return (unsigned int) ((priority >= 0) ? priority : -priority); ffc0d6b8: 81 29 00 24 lwz r9,36(r9) ffc0d6bc: 7d 2a fe 70 srawi r10,r9,31 ffc0d6c0: 7d 49 4a 78 xor r9,r10,r9 ffc0d6c4: 7d 2a 48 50 subf r9,r10,r9 timeout ); _Thread_Enable_dispatch(); if (msg_prio) { *msg_prio = _POSIX_Message_queue_Priority_from_core( ffc0d6c8: 91 3f 00 00 stw r9,0(r31) _Thread_Executing->Wait.count ); } if ( !_Thread_Executing->Wait.return_code ) ffc0d6cc: 3f e0 00 00 lis r31,0 ffc0d6d0: 3b ff 36 e0 addi r31,r31,14048 ffc0d6d4: 81 3f 00 10 lwz r9,16(r31) ffc0d6d8: 81 29 00 34 lwz r9,52(r9) ffc0d6dc: 2f 89 00 00 cmpwi cr7,r9,0 ffc0d6e0: 40 9e 00 0c bne- cr7,ffc0d6ec <_POSIX_Message_queue_Receive_support+0xfc> return length_out; ffc0d6e4: 80 61 00 08 lwz r3,8(r1) ffc0d6e8: 48 00 00 30 b ffc0d718 <_POSIX_Message_queue_Receive_support+0x128> rtems_set_errno_and_return_minus_one( ffc0d6ec: 48 00 9c ed bl ffc173d8 <__errno> ffc0d6f0: 81 3f 00 10 lwz r9,16(r31) ffc0d6f4: 7c 7e 1b 78 mr r30,r3 ffc0d6f8: 80 69 00 34 lwz r3,52(r9) ffc0d6fc: 48 00 02 85 bl ffc0d980 <_POSIX_Message_queue_Translate_core_message_queue_return_code> ffc0d700: 90 7e 00 00 stw r3,0(r30) ffc0d704: 48 00 00 10 b ffc0d714 <_POSIX_Message_queue_Receive_support+0x124> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); ffc0d708: 48 00 9c d1 bl ffc173d8 <__errno> ffc0d70c: 39 20 00 09 li r9,9 ffc0d710: 91 23 00 00 stw r9,0(r3) ffc0d714: 38 60 ff ff li r3,-1 } ffc0d718: 39 61 00 38 addi r11,r1,56 ffc0d71c: 4b ff 81 80 b ffc0589c <_restgpr_27_x> =============================================================================== ffc0fd18 <_POSIX_Semaphore_Create_support>: POSIX_Semaphore_Control *the_semaphore; CORE_semaphore_Attributes *the_sem_attr; char *name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) ffc0fd18: 2f 85 00 00 cmpwi cr7,r5,0 size_t name_len, int pshared, unsigned int value, POSIX_Semaphore_Control **the_sem ) { ffc0fd1c: 94 21 ff d8 stwu r1,-40(r1) ffc0fd20: 7c 08 02 a6 mflr r0 ffc0fd24: bf 61 00 14 stmw r27,20(r1) ffc0fd28: 90 01 00 2c stw r0,44(r1) POSIX_Semaphore_Control *the_semaphore; CORE_semaphore_Attributes *the_sem_attr; char *name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) ffc0fd2c: 41 be 00 10 beq+ cr7,ffc0fd3c <_POSIX_Semaphore_Create_support+0x24> rtems_set_errno_and_return_minus_one( ENOSYS ); ffc0fd30: 48 00 27 e5 bl ffc12514 <__errno> ffc0fd34: 39 20 00 58 li r9,88 ffc0fd38: 48 00 00 4c b ffc0fd84 <_POSIX_Semaphore_Create_support+0x6c> * * 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; ffc0fd3c: 3d 20 00 00 lis r9,0 ffc0fd40: 81 49 28 a8 lwz r10,10408(r9) ffc0fd44: 7c 7e 1b 78 mr r30,r3 ffc0fd48: 7c db 33 78 mr r27,r6 ++level; ffc0fd4c: 39 4a 00 01 addi r10,r10,1 _Thread_Dispatch_disable_level = level; ffc0fd50: 91 49 28 a8 stw r10,10408(r9) ffc0fd54: 7c fc 3b 78 mr r28,r7 * _POSIX_Semaphore_Allocate */ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ) { return (POSIX_Semaphore_Control *) ffc0fd58: 3f a0 00 00 lis r29,0 ffc0fd5c: 90 81 00 08 stw r4,8(r1) ffc0fd60: 3b bd 59 00 addi r29,r29,22784 ffc0fd64: 7f a3 eb 78 mr r3,r29 ffc0fd68: 4b ff bd 25 bl ffc0ba8c <_Objects_Allocate> _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { ffc0fd6c: 80 81 00 08 lwz r4,8(r1) ffc0fd70: 7c 7f 1b 79 mr. r31,r3 ffc0fd74: 40 a2 00 1c bne+ ffc0fd90 <_POSIX_Semaphore_Create_support+0x78> _Thread_Enable_dispatch(); ffc0fd78: 4b ff d1 51 bl ffc0cec8 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSPC ); ffc0fd7c: 48 00 27 99 bl ffc12514 <__errno> ffc0fd80: 39 20 00 1c li r9,28 ffc0fd84: 91 23 00 00 stw r9,0(r3) ffc0fd88: 38 60 ff ff li r3,-1 ffc0fd8c: 48 00 00 b4 b ffc0fe40 <_POSIX_Semaphore_Create_support+0x128> /* * Make a copy of the user's string for name just in case it was * dynamically constructed. */ if ( name_arg != NULL ) { ffc0fd90: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0fd94: 41 9e 00 30 beq- cr7,ffc0fdc4 <_POSIX_Semaphore_Create_support+0xac> name = _Workspace_String_duplicate( name_arg, name_len ); ffc0fd98: 7f c3 f3 78 mr r3,r30 ffc0fd9c: 48 00 0f a1 bl ffc10d3c <_Workspace_String_duplicate> if ( !name ) { ffc0fda0: 7c 7e 1b 79 mr. r30,r3 ffc0fda4: 40 a2 00 24 bne+ ffc0fdc8 <_POSIX_Semaphore_Create_support+0xb0><== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free ( POSIX_Semaphore_Control *the_semaphore ) { _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object ); ffc0fda8: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED ffc0fdac: 7f e4 fb 78 mr r4,r31 <== NOT EXECUTED ffc0fdb0: 4b ff c0 45 bl ffc0bdf4 <_Objects_Free> <== NOT EXECUTED _POSIX_Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); ffc0fdb4: 4b ff d1 15 bl ffc0cec8 <_Thread_Enable_dispatch> <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); ffc0fdb8: 48 00 27 5d bl ffc12514 <__errno> <== NOT EXECUTED ffc0fdbc: 39 20 00 0c li r9,12 <== NOT EXECUTED ffc0fdc0: 4b ff ff c4 b ffc0fd84 <_POSIX_Semaphore_Create_support+0x6c><== NOT EXECUTED } } else { name = NULL; ffc0fdc4: 3b c0 00 00 li r30,0 } the_semaphore->process_shared = pshared; if ( name ) { ffc0fdc8: 2f 9e 00 00 cmpwi cr7,r30,0 } } else { name = NULL; } the_semaphore->process_shared = pshared; ffc0fdcc: 39 20 00 00 li r9,0 ffc0fdd0: 91 3f 00 10 stw r9,16(r31) if ( name ) { ffc0fdd4: 41 9e 00 1c beq- cr7,ffc0fdf0 <_POSIX_Semaphore_Create_support+0xd8> the_semaphore->named = true; ffc0fdd8: 39 20 00 01 li r9,1 ffc0fddc: 99 3f 00 14 stb r9,20(r31) the_semaphore->open_count = 1; ffc0fde0: 39 20 00 01 li r9,1 ffc0fde4: 91 3f 00 18 stw r9,24(r31) the_semaphore->linked = true; ffc0fde8: 99 3f 00 15 stb r9,21(r31) ffc0fdec: 48 00 00 10 b ffc0fdfc <_POSIX_Semaphore_Create_support+0xe4> } else { the_semaphore->named = false; ffc0fdf0: 9b df 00 14 stb r30,20(r31) the_semaphore->open_count = 0; ffc0fdf4: 93 df 00 18 stw r30,24(r31) the_semaphore->linked = false; ffc0fdf8: 9b df 00 15 stb r30,21(r31) * blocking tasks on this semaphore should be. It could somehow * be derived from the current scheduling policy. One * thing is certain, no matter what we decide, it won't be * the same as all other POSIX implementations. :) */ the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; ffc0fdfc: 39 20 00 00 li r9,0 ffc0fe00: 91 3f 00 60 stw r9,96(r31) /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; ffc0fe04: 39 20 ff ff li r9,-1 _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); ffc0fe08: 38 7f 00 1c addi r3,r31,28 the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; ffc0fe0c: 91 3f 00 5c stw r9,92(r31) _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); ffc0fe10: 38 9f 00 5c addi r4,r31,92 ffc0fe14: 7f 65 db 78 mr r5,r27 ffc0fe18: 4b ff b6 35 bl ffc0b44c <_CORE_semaphore_Initialize> Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( ffc0fe1c: a1 3f 00 0a lhz r9,10(r31) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; ffc0fe20: 3d 40 00 00 lis r10,0 ffc0fe24: 81 4a 59 1c lwz r10,22812(r10) ffc0fe28: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0fe2c: 7f ea 49 2e stwx r31,r10,r9 the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; ffc0fe30: 93 df 00 0c stw r30,12(r31) &_POSIX_Semaphore_Information, &the_semaphore->Object, name ); *the_sem = the_semaphore; ffc0fe34: 93 fc 00 00 stw r31,0(r28) _Thread_Enable_dispatch(); ffc0fe38: 4b ff d0 91 bl ffc0cec8 <_Thread_Enable_dispatch> return 0; ffc0fe3c: 38 60 00 00 li r3,0 } ffc0fe40: 39 61 00 28 addi r11,r1,40 ffc0fe44: 48 00 cf 60 b ffc1cda4 <_restgpr_27_x> =============================================================================== ffc0d3e8 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: Thread_Control *the_thread ) { POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; ffc0d3e8: 81 23 01 50 lwz r9,336(r3) if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && ffc0d3ec: 81 49 00 d8 lwz r10,216(r9) ffc0d3f0: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0d3f4: 40 9e 00 34 bne- cr7,ffc0d428 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x40><== NEVER TAKEN ffc0d3f8: 81 49 00 dc lwz r10,220(r9) ffc0d3fc: 2f 8a 00 01 cmpwi cr7,r10,1 ffc0d400: 40 be 00 28 bne+ cr7,ffc0d428 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x40> thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && ffc0d404: 81 29 00 e0 lwz r9,224(r9) ffc0d408: 2f 89 00 00 cmpwi cr7,r9,0 ffc0d40c: 41 be 00 1c beq+ cr7,ffc0d428 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x40> * * 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; ffc0d410: 3d 20 00 00 lis r9,0 ffc0d414: 81 49 28 70 lwz r10,10352(r9) thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); ffc0d418: 38 80 ff ff li r4,-1 --level; ffc0d41c: 39 4a ff ff addi r10,r10,-1 _Thread_Dispatch_disable_level = level; ffc0d420: 91 49 28 70 stw r10,10352(r9) ffc0d424: 48 00 06 94 b ffc0dab8 <_POSIX_Thread_Exit> } else _Thread_Enable_dispatch(); ffc0d428: 4b ff db 3c b ffc0af64 <_Thread_Enable_dispatch> =============================================================================== ffc0e7e4 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { ffc0e7e4: 94 21 ff e8 stwu r1,-24(r1) ffc0e7e8: 7c 08 02 a6 mflr r0 ffc0e7ec: bf 81 00 08 stmw r28,8(r1) ffc0e7f0: 7c 7e 1b 78 mr r30,r3 ffc0e7f4: 7c 9f 23 78 mr r31,r4 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) ffc0e7f8: 80 64 00 00 lwz r3,0(r4) int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { ffc0e7fc: 7c bd 2b 78 mr r29,r5 ffc0e800: 90 01 00 1c stw r0,28(r1) ffc0e804: 7c dc 33 78 mr r28,r6 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) ffc0e808: 4b ff ff b5 bl ffc0e7bc <_POSIX_Priority_Is_valid> ffc0e80c: 2f 83 00 00 cmpwi cr7,r3,0 ffc0e810: 40 9e 00 0c bne- cr7,ffc0e81c <_POSIX_Thread_Translate_sched_param+0x38><== ALWAYS TAKEN return EINVAL; ffc0e814: 38 60 00 16 li r3,22 ffc0e818: 48 00 00 b8 b ffc0e8d0 <_POSIX_Thread_Translate_sched_param+0xec> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; *budget_callout = NULL; if ( policy == SCHED_OTHER ) { ffc0e81c: 2f 9e 00 00 cmpwi cr7,r30,0 ) { if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; ffc0e820: 39 20 00 00 li r9,0 ffc0e824: 91 3d 00 00 stw r9,0(r29) *budget_callout = NULL; ffc0e828: 91 3c 00 00 stw r9,0(r28) if ( policy == SCHED_OTHER ) { ffc0e82c: 40 be 00 10 bne+ cr7,ffc0e83c <_POSIX_Thread_Translate_sched_param+0x58> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; ffc0e830: 39 20 00 01 li r9,1 ffc0e834: 91 3d 00 00 stw r9,0(r29) ffc0e838: 48 00 00 94 b ffc0e8cc <_POSIX_Thread_Translate_sched_param+0xe8> return 0; } if ( policy == SCHED_FIFO ) { ffc0e83c: 2f 9e 00 01 cmpwi cr7,r30,1 ffc0e840: 41 9e 00 8c beq- cr7,ffc0e8cc <_POSIX_Thread_Translate_sched_param+0xe8> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { ffc0e844: 2f 9e 00 02 cmpwi cr7,r30,2 ffc0e848: 40 be 00 0c bne+ cr7,ffc0e854 <_POSIX_Thread_Translate_sched_param+0x70> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; ffc0e84c: 93 dd 00 00 stw r30,0(r29) ffc0e850: 48 00 00 7c b ffc0e8cc <_POSIX_Thread_Translate_sched_param+0xe8> return 0; } if ( policy == SCHED_SPORADIC ) { ffc0e854: 2f 9e 00 04 cmpwi cr7,r30,4 ffc0e858: 40 9e ff bc bne+ cr7,ffc0e814 <_POSIX_Thread_Translate_sched_param+0x30> if ( (param->sched_ss_repl_period.tv_sec == 0) && ffc0e85c: 81 3f 00 08 lwz r9,8(r31) ffc0e860: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e864: 40 9e 00 10 bne- cr7,ffc0e874 <_POSIX_Thread_Translate_sched_param+0x90> ffc0e868: 81 3f 00 0c lwz r9,12(r31) ffc0e86c: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e870: 41 9e ff a4 beq+ cr7,ffc0e814 <_POSIX_Thread_Translate_sched_param+0x30> (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && ffc0e874: 81 3f 00 10 lwz r9,16(r31) ffc0e878: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e87c: 40 9e 00 10 bne- cr7,ffc0e88c <_POSIX_Thread_Translate_sched_param+0xa8> ffc0e880: 81 3f 00 14 lwz r9,20(r31) ffc0e884: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e888: 41 9e ff 8c beq+ cr7,ffc0e814 <_POSIX_Thread_Translate_sched_param+0x30> (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < ffc0e88c: 38 7f 00 08 addi r3,r31,8 ffc0e890: 4b ff e0 a1 bl ffc0c930 <_Timespec_To_ticks> ffc0e894: 7c 7e 1b 78 mr r30,r3 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) ffc0e898: 38 7f 00 10 addi r3,r31,16 ffc0e89c: 4b ff e0 95 bl ffc0c930 <_Timespec_To_ticks> if ( (param->sched_ss_init_budget.tv_sec == 0) && (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < ffc0e8a0: 7f 9e 18 40 cmplw cr7,r30,r3 ffc0e8a4: 41 9c ff 70 blt+ cr7,ffc0e814 <_POSIX_Thread_Translate_sched_param+0x30> _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) ffc0e8a8: 80 7f 00 04 lwz r3,4(r31) ffc0e8ac: 4b ff ff 11 bl ffc0e7bc <_POSIX_Priority_Is_valid> ffc0e8b0: 2f 83 00 00 cmpwi cr7,r3,0 ffc0e8b4: 41 9e ff 60 beq+ cr7,ffc0e814 <_POSIX_Thread_Translate_sched_param+0x30> return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; ffc0e8b8: 39 20 00 03 li r9,3 ffc0e8bc: 91 3d 00 00 stw r9,0(r29) *budget_callout = _POSIX_Threads_Sporadic_budget_callout; ffc0e8c0: 3d 20 ff c1 lis r9,-63 ffc0e8c4: 39 29 8a dc addi r9,r9,-29988 ffc0e8c8: 91 3c 00 00 stw r9,0(r28) return 0; } if ( policy == SCHED_FIFO ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; ffc0e8cc: 38 60 00 00 li r3,0 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; } ffc0e8d0: 39 61 00 18 addi r11,r1,24 ffc0e8d4: 4b ff 22 d0 b ffc00ba4 <_restgpr_28_x> =============================================================================== ffc0db30 <_POSIX_Threads_Delete_extension>: */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { ffc0db30: 94 21 ff e8 stwu r1,-24(r1) ffc0db34: 7c 08 02 a6 mflr r0 api = deleted->API_Extensions[ THREAD_API_POSIX ]; /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); ffc0db38: 7c 83 23 78 mr r3,r4 */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { ffc0db3c: bf 81 00 08 stmw r28,8(r1) ffc0db40: 7c 9f 23 78 mr r31,r4 Thread_Control *the_thread; POSIX_API_Control *api; void **value_ptr; api = deleted->API_Extensions[ THREAD_API_POSIX ]; ffc0db44: 83 c4 01 50 lwz r30,336(r4) */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { ffc0db48: 90 01 00 1c stw r0,28(r1) api = deleted->API_Extensions[ THREAD_API_POSIX ]; /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); ffc0db4c: 48 00 22 8d bl ffc0fdd8 <_POSIX_Threads_cancel_run> /* * Run all the key destructors */ _POSIX_Keys_Run_destructors( deleted ); ffc0db50: 7f e3 fb 78 mr r3,r31 ffc0db54: 48 00 22 fd bl ffc0fe50 <_POSIX_Keys_Run_destructors> /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) ffc0db58: 3b be 00 44 addi r29,r30,68 _POSIX_Keys_Run_destructors( deleted ); /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; ffc0db5c: 83 9f 00 28 lwz r28,40(r31) while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) ffc0db60: 48 00 00 0c b ffc0db6c <_POSIX_Threads_Delete_extension+0x3c> *(void **)the_thread->Wait.return_argument = value_ptr; ffc0db64: 81 23 00 28 lwz r9,40(r3) <== NOT EXECUTED ffc0db68: 93 89 00 00 stw r28,0(r9) <== NOT EXECUTED /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) ffc0db6c: 7f a3 eb 78 mr r3,r29 ffc0db70: 4b ff da 71 bl ffc0b5e0 <_Thread_queue_Dequeue> ffc0db74: 2c 03 00 00 cmpwi r3,0 ffc0db78: 40 82 ff ec bne+ ffc0db64 <_POSIX_Threads_Delete_extension+0x34><== NEVER TAKEN *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) ffc0db7c: 81 3e 00 84 lwz r9,132(r30) ffc0db80: 2f 89 00 04 cmpwi cr7,r9,4 ffc0db84: 40 be 00 0c bne+ cr7,ffc0db90 <_POSIX_Threads_Delete_extension+0x60> (void) _Watchdog_Remove( &api->Sporadic_timer ); ffc0db88: 38 7e 00 a8 addi r3,r30,168 ffc0db8c: 4b ff e5 65 bl ffc0c0f0 <_Watchdog_Remove> deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; _Workspace_Free( api ); } ffc0db90: 80 01 00 1c lwz r0,28(r1) *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; ffc0db94: 39 20 00 00 li r9,0 ffc0db98: 91 3f 01 50 stw r9,336(r31) _Workspace_Free( api ); ffc0db9c: 7f c3 f3 78 mr r3,r30 } ffc0dba0: 7c 08 03 a6 mtlr r0 ffc0dba4: bb 81 00 08 lmw r28,8(r1) ffc0dba8: 38 21 00 18 addi r1,r1,24 if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; _Workspace_Free( api ); ffc0dbac: 4b ff e7 e4 b ffc0c390 <_Workspace_Free> =============================================================================== ffc08808 <_POSIX_Threads_Initialize_user_threads_body>: #include #include #include void _POSIX_Threads_Initialize_user_threads_body(void) { ffc08808: 94 21 ff 98 stwu r1,-104(r1) ffc0880c: 7c 08 02 a6 mflr r0 uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; ffc08810: 3d 20 00 00 lis r9,0 #include #include #include void _POSIX_Threads_Initialize_user_threads_body(void) { ffc08814: 90 01 00 6c stw r0,108(r1) uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; ffc08818: 39 29 20 04 addi r9,r9,8196 #include #include #include void _POSIX_Threads_Initialize_user_threads_body(void) { ffc0881c: bf a1 00 5c stmw r29,92(r1) uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; ffc08820: 83 e9 00 34 lwz r31,52(r9) maximum = Configuration_POSIX_API.number_of_initialization_threads; ffc08824: 83 a9 00 30 lwz r29,48(r9) if ( !user_threads || maximum == 0 ) ffc08828: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0882c: 41 9e 00 68 beq- cr7,ffc08894 <_POSIX_Threads_Initialize_user_threads_body+0x8c><== NEVER TAKEN ffc08830: 2f 9d 00 00 cmpwi cr7,r29,0 ffc08834: 41 9e 00 60 beq- cr7,ffc08894 <_POSIX_Threads_Initialize_user_threads_body+0x8c><== NEVER TAKEN ffc08838: 3b c0 00 00 li r30,0 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); ffc0883c: 38 61 00 08 addi r3,r1,8 ffc08840: 48 00 60 99 bl ffc0e8d8 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); ffc08844: 38 80 00 02 li r4,2 ffc08848: 38 61 00 08 addi r3,r1,8 ffc0884c: 48 00 60 d1 bl ffc0e91c (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); ffc08850: 80 9f 00 04 lwz r4,4(r31) ffc08854: 38 61 00 08 addi r3,r1,8 ffc08858: 48 00 61 01 bl ffc0e958 status = pthread_create( ffc0885c: 80 bf 00 00 lwz r5,0(r31) ffc08860: 38 61 00 48 addi r3,r1,72 ffc08864: 38 81 00 08 addi r4,r1,8 ffc08868: 38 c0 00 00 li r6,0 ffc0886c: 4b ff fc 5d bl ffc084c8 ffc08870: 3b ff 00 08 addi r31,r31,8 &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) ffc08874: 7c 65 1b 79 mr. r5,r3 ffc08878: 41 a2 00 10 beq+ ffc08888 <_POSIX_Threads_Initialize_user_threads_body+0x80> _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); ffc0887c: 38 60 00 02 li r3,2 ffc08880: 38 80 00 01 li r4,1 ffc08884: 48 00 21 51 bl ffc0a9d4 <_Internal_error_Occurred> * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { ffc08888: 3b de 00 01 addi r30,r30,1 ffc0888c: 7f 9e e8 00 cmpw cr7,r30,r29 ffc08890: 40 9e ff ac bne+ cr7,ffc0883c <_POSIX_Threads_Initialize_user_threads_body+0x34><== NEVER TAKEN NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); } } ffc08894: 39 61 00 68 addi r11,r1,104 ffc08898: 4b ff 83 10 b ffc00ba8 <_restgpr_29_x> =============================================================================== ffc0dcb8 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { ffc0dcb8: 94 21 ff f0 stwu r1,-16(r1) ffc0dcbc: 7c 08 02 a6 mflr r0 ffc0dcc0: 90 01 00 14 stw r0,20(r1) ffc0dcc4: bf c1 00 08 stmw r30,8(r1) ffc0dcc8: 7c 9f 23 78 mr r31,r4 Thread_Control *the_thread; POSIX_API_Control *api; the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; ffc0dccc: 83 c4 01 50 lwz r30,336(r4) /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); ffc0dcd0: 38 7e 00 98 addi r3,r30,152 ffc0dcd4: 48 00 0e 51 bl ffc0eb24 <_Timespec_To_ticks> RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); ffc0dcd8: 3d 20 00 00 lis r9,0 ffc0dcdc: 88 89 27 84 lbz r4,10116(r9) ffc0dce0: 81 3e 00 88 lwz r9,136(r30) the_thread->cpu_time_budget = ticks; ffc0dce4: 90 7f 00 74 stw r3,116(r31) ffc0dce8: 7c 89 20 50 subf r4,r9,r4 */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { ffc0dcec: 81 3f 00 1c lwz r9,28(r31) ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); the_thread->cpu_time_budget = ticks; new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); the_thread->real_priority = new_priority; ffc0dcf0: 90 9f 00 18 stw r4,24(r31) */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { ffc0dcf4: 2f 89 00 00 cmpwi cr7,r9,0 ffc0dcf8: 40 9e 00 1c bne- cr7,ffc0dd14 <_POSIX_Threads_Sporadic_budget_TSR+0x5c><== NEVER TAKEN /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { ffc0dcfc: 81 3f 00 14 lwz r9,20(r31) ffc0dd00: 7f 89 20 40 cmplw cr7,r9,r4 ffc0dd04: 40 bd 00 10 ble+ cr7,ffc0dd14 <_POSIX_Threads_Sporadic_budget_TSR+0x5c> _Thread_Change_priority( the_thread, new_priority, true ); ffc0dd08: 7f e3 fb 78 mr r3,r31 ffc0dd0c: 38 a0 00 01 li r5,1 ffc0dd10: 4b ff cf d5 bl ffc0ace4 <_Thread_Change_priority> #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); ffc0dd14: 38 7e 00 90 addi r3,r30,144 ffc0dd18: 48 00 0e 0d bl ffc0eb24 <_Timespec_To_ticks> _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); } ffc0dd1c: 80 01 00 14 lwz r0,20(r1) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; ffc0dd20: 90 7e 00 b4 stw r3,180(r30) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc0dd24: 38 9e 00 a8 addi r4,r30,168 ffc0dd28: 7c 08 03 a6 mtlr r0 ffc0dd2c: 3c 60 00 00 lis r3,0 ffc0dd30: bb c1 00 08 lmw r30,8(r1) ffc0dd34: 38 63 2d a8 addi r3,r3,11688 ffc0dd38: 38 21 00 10 addi r1,r1,16 ffc0dd3c: 4b ff e2 58 b ffc0bf94 <_Watchdog_Insert> =============================================================================== ffc085e0 <_POSIX_Timer_TSR>: * This is the operation that is run when a timer expires */ void _POSIX_Timer_TSR( Objects_Id timer __attribute__((unused)), void *data) { ffc085e0: 94 21 ff d8 stwu r1,-40(r1) ffc085e4: 7c 08 02 a6 mflr r0 ffc085e8: 90 01 00 2c stw r0,44(r1) bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; ffc085ec: 81 24 00 68 lwz r9,104(r4) * This is the operation that is run when a timer expires */ void _POSIX_Timer_TSR( Objects_Id timer __attribute__((unused)), void *data) { ffc085f0: bf a1 00 1c stmw r29,28(r1) ffc085f4: 7c 9d 23 78 mr r29,r4 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; ffc085f8: 39 29 00 01 addi r9,r9,1 ffc085fc: 91 24 00 68 stw r9,104(r4) /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || ffc08600: 81 24 00 54 lwz r9,84(r4) ffc08604: 2f 89 00 00 cmpwi cr7,r9,0 ffc08608: 40 9e 00 10 bne- cr7,ffc08618 <_POSIX_Timer_TSR+0x38> ffc0860c: 81 24 00 58 lwz r9,88(r4) ffc08610: 2f 89 00 00 cmpwi cr7,r9,0 ffc08614: 41 9e 00 80 beq- cr7,ffc08694 <_POSIX_Timer_TSR+0xb4> <== NEVER TAKEN ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( ffc08618: 80 9d 00 64 lwz r4,100(r29) ffc0861c: 3c c0 ff c1 lis r6,-63 ffc08620: 80 bd 00 08 lwz r5,8(r29) ffc08624: 38 7d 00 10 addi r3,r29,16 ffc08628: 38 c6 85 e0 addi r6,r6,-31264 ffc0862c: 7f a7 eb 78 mr r7,r29 ffc08630: 48 00 5f d5 bl ffc0e604 <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) ffc08634: 2f 83 00 00 cmpwi cr7,r3,0 ffc08638: 41 be 00 78 beq+ cr7,ffc086b0 <_POSIX_Timer_TSR+0xd0> <== NEVER TAKEN ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = ffc0863c: 3c 80 00 00 lis r4,0 ffc08640: 38 84 2c a0 addi r4,r4,11424 ffc08644: 38 61 00 08 addi r3,r1,8 ffc08648: 48 00 18 8d bl ffc09ed4 <_TOD_Get_with_nanoseconds> static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); ffc0864c: 3c c0 3b 9a lis r6,15258 /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; } ffc08650: 83 e3 00 04 lwz r31,4(r3) ffc08654: 38 a0 00 00 li r5,0 ffc08658: 83 c3 00 00 lwz r30,0(r3) ffc0865c: 60 c6 ca 00 ori r6,r6,51712 ffc08660: 7f e4 fb 78 mr r4,r31 ffc08664: 7f c3 f3 78 mr r3,r30 ffc08668: 48 01 24 ad bl ffc1ab14 <__divdi3> _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); ffc0866c: 3c c0 3b 9a lis r6,15258 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); ffc08670: 90 9d 00 6c stw r4,108(r29) _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); ffc08674: 7f c3 f3 78 mr r3,r30 ffc08678: 7f e4 fb 78 mr r4,r31 ffc0867c: 38 a0 00 00 li r5,0 ffc08680: 60 c6 ca 00 ori r6,r6,51712 ffc08684: 48 01 28 b5 bl ffc1af38 <__moddi3> /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; ffc08688: 39 20 00 03 li r9,3 ffc0868c: 90 9d 00 70 stw r4,112(r29) ffc08690: 48 00 00 08 b ffc08698 <_POSIX_Timer_TSR+0xb8> } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; ffc08694: 39 20 00 04 li r9,4 <== NOT EXECUTED ffc08698: 99 3d 00 3c stb r9,60(r29) /* * The sending of the signal to the process running the handling function * specified for that signal is simulated */ if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) { ffc0869c: 80 7d 00 38 lwz r3,56(r29) ffc086a0: 80 9d 00 44 lwz r4,68(r29) ffc086a4: 48 00 5a fd bl ffc0e1a0 } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; ffc086a8: 39 20 00 00 li r9,0 ffc086ac: 91 3d 00 68 stw r9,104(r29) } ffc086b0: 39 61 00 28 addi r11,r1,40 ffc086b4: 4b ff 7f ec b ffc006a0 <_restgpr_29_x> =============================================================================== ffc0fef8 <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { ffc0fef8: 94 21 ff 98 stwu r1,-104(r1) ffc0fefc: 7c 08 02 a6 mflr r0 ffc0ff00: 7c a6 2b 78 mr r6,r5 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, ffc0ff04: 38 e0 00 01 li r7,1 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { ffc0ff08: bf 21 00 4c stmw r25,76(r1) siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, ffc0ff0c: 38 a1 00 30 addi r5,r1,48 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { ffc0ff10: 90 01 00 6c stw r0,108(r1) ffc0ff14: 7c 7f 1b 78 mr r31,r3 ffc0ff18: 7c 9e 23 78 mr r30,r4 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, ffc0ff1c: 48 00 00 b1 bl ffc0ffcc <_POSIX_signals_Clear_signals> ffc0ff20: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ff24: 41 9e 00 9c beq- cr7,ffc0ffc0 <_POSIX_signals_Check_signal+0xc8> #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) ffc0ff28: 3f 20 00 00 lis r25,0 ffc0ff2c: 1f 5e 00 0c mulli r26,r30,12 ffc0ff30: 3b 39 32 20 addi r25,r25,12832 ffc0ff34: 7d 39 d2 14 add r9,r25,r26 ffc0ff38: 83 a9 00 08 lwz r29,8(r9) ffc0ff3c: 2f 9d 00 01 cmpwi cr7,r29,1 ffc0ff40: 41 9e 00 80 beq- cr7,ffc0ffc0 <_POSIX_signals_Check_signal+0xc8><== NEVER TAKEN return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; ffc0ff44: 83 9f 00 d0 lwz r28,208(r31) /* * We have to save the blocking information of the current wait queue * because the signal handler may subsequently go on and put the thread * on a wait queue, for its own purposes. */ memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait, ffc0ff48: 3f 60 00 00 lis r27,0 /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; ffc0ff4c: 81 29 00 04 lwz r9,4(r9) /* * We have to save the blocking information of the current wait queue * because the signal handler may subsequently go on and put the thread * on a wait queue, for its own purposes. */ memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait, ffc0ff50: 38 61 00 08 addi r3,r1,8 ffc0ff54: 38 a0 00 28 li r5,40 /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; ffc0ff58: 7d 29 e3 78 or r9,r9,r28 ffc0ff5c: 91 3f 00 d0 stw r9,208(r31) /* * We have to save the blocking information of the current wait queue * because the signal handler may subsequently go on and put the thread * on a wait queue, for its own purposes. */ memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait, ffc0ff60: 39 3b 31 a0 addi r9,r27,12704 ffc0ff64: 80 89 00 10 lwz r4,16(r9) ffc0ff68: 38 84 00 20 addi r4,r4,32 ffc0ff6c: 48 00 13 45 bl ffc112b0 sizeof( Thread_Wait_information )); /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { ffc0ff70: 7d 39 d0 2e lwzx r9,r25,r26 case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( ffc0ff74: 7f c3 f3 78 mr r3,r30 sizeof( Thread_Wait_information )); /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { ffc0ff78: 2f 89 00 02 cmpwi cr7,r9,2 ffc0ff7c: 40 be 00 18 bne+ cr7,ffc0ff94 <_POSIX_signals_Check_signal+0x9c> case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( ffc0ff80: 38 81 00 30 addi r4,r1,48 ffc0ff84: 7f a9 03 a6 mtctr r29 ffc0ff88: 38 a0 00 00 li r5,0 ffc0ff8c: 4e 80 04 21 bctrl signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; ffc0ff90: 48 00 00 0c b ffc0ff9c <_POSIX_signals_Check_signal+0xa4> default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); ffc0ff94: 7f a9 03 a6 mtctr r29 ffc0ff98: 4e 80 04 21 bctrl } /* * Restore the blocking information */ memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information, ffc0ff9c: 3b 7b 31 a0 addi r27,r27,12704 ffc0ffa0: 80 7b 00 10 lwz r3,16(r27) ffc0ffa4: 38 81 00 08 addi r4,r1,8 ffc0ffa8: 38 a0 00 28 li r5,40 ffc0ffac: 38 63 00 20 addi r3,r3,32 ffc0ffb0: 48 00 13 01 bl ffc112b0 sizeof( Thread_Wait_information )); /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; ffc0ffb4: 93 9f 00 d0 stw r28,208(r31) return true; ffc0ffb8: 38 60 00 01 li r3,1 ffc0ffbc: 48 00 00 08 b ffc0ffc4 <_POSIX_signals_Check_signal+0xcc> sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, is_global, true ) ) return false; ffc0ffc0: 38 60 00 00 li r3,0 * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; } ffc0ffc4: 39 61 00 68 addi r11,r1,104 ffc0ffc8: 4b ff 05 e4 b ffc005ac <_restgpr_25_x> =============================================================================== ffc10524 <_POSIX_signals_Clear_process_signals>: ffc10524: 39 23 ff ff addi r9,r3,-1 ffc10528: 39 00 00 01 li r8,1 ffc1052c: 7d 08 48 30 slw r8,r8,r9 static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc10530: 7c e0 00 a6 mfmsr r7 ffc10534: 7d 30 42 a6 mfsprg r9,0 ffc10538: 7c e9 48 78 andc r9,r7,r9 ffc1053c: 7d 20 01 24 mtmsr r9 mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { ffc10540: 3d 20 00 00 lis r9,0 ffc10544: 1c 63 00 0c mulli r3,r3,12 ffc10548: 39 29 32 20 addi r9,r9,12832 ffc1054c: 7d 29 18 2e lwzx r9,r9,r3 ffc10550: 2f 89 00 02 cmpwi cr7,r9,2 ffc10554: 40 be 00 28 bne+ cr7,ffc1057c <_POSIX_signals_Clear_process_signals+0x58> if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) ffc10558: 3d 20 00 00 lis r9,0 ffc1055c: 39 29 34 14 addi r9,r9,13332 ffc10560: 7d 43 4a 14 add r10,r3,r9 ffc10564: 7d 23 48 2e lwzx r9,r3,r9 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); ffc10568: 39 4a 00 04 addi r10,r10,4 ffc1056c: 7f 89 50 00 cmpw cr7,r9,r10 ffc10570: 41 9e 00 0c beq- cr7,ffc1057c <_POSIX_signals_Clear_process_signals+0x58><== ALWAYS TAKEN return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc10574: 7c e0 01 24 mtmsr r7 ffc10578: 4e 80 00 20 blr clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; ffc1057c: 3d 20 00 00 lis r9,0 ffc10580: 81 49 28 98 lwz r10,10392(r9) ffc10584: 7d 4a 40 78 andc r10,r10,r8 ffc10588: 91 49 28 98 stw r10,10392(r9) ffc1058c: 4b ff ff e8 b ffc10574 <_POSIX_signals_Clear_process_signals+0x50> =============================================================================== ffc090d4 <_POSIX_signals_Get_lowest>: ffc090d4: 38 e0 00 05 li r7,5 ffc090d8: 7c e9 03 a6 mtctr r7 sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { ffc090dc: 39 20 00 1b li r9,27 ffc090e0: 39 40 00 01 li r10,1 #include #include #include #include static int _POSIX_signals_Get_lowest( ffc090e4: 39 09 ff ff addi r8,r9,-1 ffc090e8: 7d 48 40 30 slw r8,r10,r8 ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { ffc090ec: 7d 07 18 39 and. r7,r8,r3 ffc090f0: 40 82 00 34 bne- ffc09124 <_POSIX_signals_Get_lowest+0x50><== NEVER TAKEN sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { ffc090f4: 39 29 00 01 addi r9,r9,1 ffc090f8: 42 00 ff ec bdnz+ ffc090e4 <_POSIX_signals_Get_lowest+0x10> ffc090fc: 39 00 00 1a li r8,26 ffc09100: 7d 09 03 a6 mtctr r8 ffc09104: 39 20 00 01 li r9,1 ffc09108: 39 40 00 01 li r10,1 #include #include #include #include static int _POSIX_signals_Get_lowest( ffc0910c: 39 09 ff ff addi r8,r9,-1 ffc09110: 7d 48 40 30 slw r8,r10,r8 #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { if ( set & signo_to_mask( signo ) ) { ffc09114: 7d 07 18 39 and. r7,r8,r3 ffc09118: 40 82 00 0c bne- ffc09124 <_POSIX_signals_Get_lowest+0x50> */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { ffc0911c: 39 29 00 01 addi r9,r9,1 ffc09120: 42 00 ff ec bdnz+ ffc0910c <_POSIX_signals_Get_lowest+0x38> * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } ffc09124: 7d 23 4b 78 mr r3,r9 ffc09128: 4e 80 00 20 blr =============================================================================== ffc0d8e4 <_POSIX_signals_Post_switch_hook>: */ static void _POSIX_signals_Post_switch_hook( Thread_Control *the_thread ) { ffc0d8e4: 94 21 ff e8 stwu r1,-24(r1) ffc0d8e8: 7c 08 02 a6 mflr r0 /* * We need to ensure that if the signal handler executes a call * which overwrites the unblocking status, we restore it. */ hold_errno = _Thread_Executing->Wait.return_code; ffc0d8ec: 3d 20 00 00 lis r9,0 */ static void _POSIX_signals_Post_switch_hook( Thread_Control *the_thread ) { ffc0d8f0: 90 01 00 1c stw r0,28(r1) ffc0d8f4: bf 81 00 08 stmw r28,8(r1) POSIX_API_Control *api; int signo; ISR_Level level; int hold_errno; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; ffc0d8f8: 83 e3 01 50 lwz r31,336(r3) /* * We need to ensure that if the signal handler executes a call * which overwrites the unblocking status, we restore it. */ hold_errno = _Thread_Executing->Wait.return_code; ffc0d8fc: 81 29 31 b0 lwz r9,12720(r9) /* * api may be NULL in case of a thread close in progress */ if ( !api ) ffc0d900: 2f 9f 00 00 cmpwi cr7,r31,0 /* * We need to ensure that if the signal handler executes a call * which overwrites the unblocking status, we restore it. */ hold_errno = _Thread_Executing->Wait.return_code; ffc0d904: 83 a9 00 34 lwz r29,52(r9) /* * api may be NULL in case of a thread close in progress */ if ( !api ) ffc0d908: 41 9e 00 a8 beq- cr7,ffc0d9b0 <_POSIX_signals_Post_switch_hook+0xcc><== NEVER TAKEN * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { ffc0d90c: 3f 80 00 00 lis r28,0 static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0d910: 7d 20 00 a6 mfmsr r9 ffc0d914: 7d 50 42 a6 mfsprg r10,0 ffc0d918: 7d 2a 50 78 andc r10,r9,r10 ffc0d91c: 7d 40 01 24 mtmsr r10 ffc0d920: 81 5f 00 d4 lwz r10,212(r31) ffc0d924: 81 1c 28 98 lwz r8,10392(r28) ffc0d928: 7d 08 53 78 or r8,r8,r10 * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & ffc0d92c: 81 5f 00 d0 lwz r10,208(r31) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0d930: 7d 20 01 24 mtmsr r9 ffc0d934: 7d 07 50 79 andc. r7,r8,r10 ffc0d938: 40 a2 00 14 bne+ ffc0d94c <_POSIX_signals_Post_switch_hook+0x68> _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } } _Thread_Executing->Wait.return_code = hold_errno; ffc0d93c: 3d 20 00 00 lis r9,0 ffc0d940: 81 29 31 b0 lwz r9,12720(r9) ffc0d944: 93 a9 00 34 stw r29,52(r9) ffc0d948: 48 00 00 68 b ffc0d9b0 <_POSIX_signals_Post_switch_hook+0xcc> _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { ffc0d94c: 3b c0 00 1b li r30,27 _POSIX_signals_Check_signal( api, signo, false ); ffc0d950: 7f c4 f3 78 mr r4,r30 ffc0d954: 38 a0 00 00 li r5,0 ffc0d958: 7f e3 fb 78 mr r3,r31 ffc0d95c: 48 00 25 9d bl ffc0fef8 <_POSIX_signals_Check_signal> _POSIX_signals_Check_signal( api, signo, true ); ffc0d960: 7f c4 f3 78 mr r4,r30 ffc0d964: 7f e3 fb 78 mr r3,r31 ffc0d968: 38 a0 00 01 li r5,1 ffc0d96c: 48 00 25 8d bl ffc0fef8 <_POSIX_signals_Check_signal> _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { ffc0d970: 2f 9e 00 1f cmpwi cr7,r30,31 ffc0d974: 3b de 00 01 addi r30,r30,1 ffc0d978: 40 9e ff d8 bne+ cr7,ffc0d950 <_POSIX_signals_Post_switch_hook+0x6c> ffc0d97c: 3b c0 00 01 li r30,1 _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); ffc0d980: 7f c4 f3 78 mr r4,r30 ffc0d984: 38 a0 00 00 li r5,0 ffc0d988: 7f e3 fb 78 mr r3,r31 ffc0d98c: 48 00 25 6d bl ffc0fef8 <_POSIX_signals_Check_signal> _POSIX_signals_Check_signal( api, signo, true ); ffc0d990: 7f c4 f3 78 mr r4,r30 ffc0d994: 7f e3 fb 78 mr r3,r31 ffc0d998: 38 a0 00 01 li r5,1 ffc0d99c: 48 00 25 5d bl ffc0fef8 <_POSIX_signals_Check_signal> _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { ffc0d9a0: 2f 9e 00 1a cmpwi cr7,r30,26 ffc0d9a4: 3b de 00 01 addi r30,r30,1 ffc0d9a8: 40 9e ff d8 bne+ cr7,ffc0d980 <_POSIX_signals_Post_switch_hook+0x9c> ffc0d9ac: 4b ff ff 64 b ffc0d910 <_POSIX_signals_Post_switch_hook+0x2c> _POSIX_signals_Check_signal( api, signo, true ); } } _Thread_Executing->Wait.return_code = hold_errno; } ffc0d9b0: 39 61 00 18 addi r11,r1,24 ffc0d9b4: 4b ff 2c 04 b ffc005b8 <_restgpr_28_x> =============================================================================== ffc1b854 <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { ffc1b854: 7c 2b 0b 78 mr r11,r1 ffc1b858: 7c 08 02 a6 mflr r0 ffc1b85c: 94 21 ff f0 stwu r1,-16(r1) ffc1b860: 7c aa 2b 78 mr r10,r5 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { ffc1b864: 3c a0 10 00 lis r5,4096 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { ffc1b868: 90 01 00 14 stw r0,20(r1) /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { ffc1b86c: 60 a5 80 00 ori r5,r5,32768 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { ffc1b870: 4b ff f5 4d bl ffc1adbc <_savegpr_31> ffc1b874: 39 04 ff ff addi r8,r4,-1 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { ffc1b878: 81 23 00 10 lwz r9,16(r3) ffc1b87c: 38 e0 00 01 li r7,1 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { ffc1b880: 7c 7f 1b 78 mr r31,r3 POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; ffc1b884: 80 c3 01 50 lwz r6,336(r3) /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { ffc1b888: 7d 2b 28 38 and r11,r9,r5 ffc1b88c: 7f 8b 28 00 cmpw cr7,r11,r5 ffc1b890: 7c e8 40 30 slw r8,r7,r8 ffc1b894: 40 be 00 60 bne+ cr7,ffc1b8f4 <_POSIX_signals_Unblock_thread+0xa0> if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { ffc1b898: 81 23 00 30 lwz r9,48(r3) ffc1b89c: 7d 07 48 39 and. r7,r8,r9 ffc1b8a0: 40 82 00 14 bne- ffc1b8b4 <_POSIX_signals_Unblock_thread+0x60> ffc1b8a4: 81 26 00 d0 lwz r9,208(r6) ffc1b8a8: 7d 06 48 79 andc. r6,r8,r9 ffc1b8ac: 40 a2 00 08 bne+ ffc1b8b4 <_POSIX_signals_Unblock_thread+0x60> ffc1b8b0: 48 00 00 c8 b ffc1b978 <_POSIX_signals_Unblock_thread+0x124> the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { ffc1b8b4: 2f 8a 00 00 cmpwi cr7,r10,0 */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { the_thread->Wait.return_code = EINTR; ffc1b8b8: 39 20 00 04 li r9,4 ffc1b8bc: 91 3f 00 34 stw r9,52(r31) the_info = (siginfo_t *) the_thread->Wait.return_argument; ffc1b8c0: 81 3f 00 28 lwz r9,40(r31) if ( !info ) { ffc1b8c4: 40 be 00 18 bne+ cr7,ffc1b8dc <_POSIX_signals_Unblock_thread+0x88> the_info->si_signo = signo; the_info->si_code = SI_USER; ffc1b8c8: 39 00 00 01 li r8,1 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; ffc1b8cc: 90 89 00 00 stw r4,0(r9) the_info->si_code = SI_USER; ffc1b8d0: 91 09 00 04 stw r8,4(r9) the_info->si_value.sival_int = 0; ffc1b8d4: 91 49 00 08 stw r10,8(r9) ffc1b8d8: 48 00 00 0c b ffc1b8e4 <_POSIX_signals_Unblock_thread+0x90> } else { *the_info = *info; ffc1b8dc: 7c aa 64 aa lswi r5,r10,12 ffc1b8e0: 7c a9 65 aa stswi r5,r9,12 } _Thread_queue_Extract_with_proxy( the_thread ); ffc1b8e4: 7f e3 fb 78 mr r3,r31 ffc1b8e8: 4b ff 00 e9 bl ffc0b9d0 <_Thread_queue_Extract_with_proxy> return true; ffc1b8ec: 38 60 00 01 li r3,1 ffc1b8f0: 48 00 00 8c b ffc1b97c <_POSIX_signals_Unblock_thread+0x128> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { ffc1b8f4: 81 46 00 d0 lwz r10,208(r6) ffc1b8f8: 7d 06 50 79 andc. r6,r8,r10 ffc1b8fc: 41 82 00 7c beq- ffc1b978 <_POSIX_signals_Unblock_thread+0x124> * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) { ffc1b900: 75 28 10 00 andis. r8,r9,4096 ffc1b904: 41 82 00 48 beq- ffc1b94c <_POSIX_signals_Unblock_thread+0xf8> the_thread->Wait.return_code = EINTR; ffc1b908: 39 40 00 04 li r10,4 ffc1b90c: 91 43 00 34 stw r10,52(r3) /* * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) ffc1b910: 3d 40 00 03 lis r10,3 ffc1b914: 61 4a be e0 ori r10,r10,48864 ffc1b918: 7d 26 50 39 and. r6,r9,r10 ffc1b91c: 41 a2 00 0c beq+ ffc1b928 <_POSIX_signals_Unblock_thread+0xd4> _Thread_queue_Extract_with_proxy( the_thread ); ffc1b920: 4b ff 00 b1 bl ffc0b9d0 <_Thread_queue_Extract_with_proxy> ffc1b924: 48 00 00 54 b ffc1b978 <_POSIX_signals_Unblock_thread+0x124> else if ( _States_Is_delaying(the_thread->current_state) ) { ffc1b928: 71 27 00 08 andi. r7,r9,8 ffc1b92c: 41 a2 00 4c beq+ ffc1b978 <_POSIX_signals_Unblock_thread+0x124><== NEVER TAKEN (void) _Watchdog_Remove( &the_thread->Timer ); ffc1b930: 38 63 00 48 addi r3,r3,72 ffc1b934: 4b ff 07 bd bl ffc0c0f0 <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); ffc1b938: 3c 80 10 07 lis r4,4103 ffc1b93c: 7f e3 fb 78 mr r3,r31 ffc1b940: 60 84 ff f8 ori r4,r4,65528 ffc1b944: 4b fe f4 c5 bl ffc0ae08 <_Thread_Clear_state> ffc1b948: 48 00 00 30 b ffc1b978 <_POSIX_signals_Unblock_thread+0x124> _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { ffc1b94c: 2f 89 00 00 cmpwi cr7,r9,0 ffc1b950: 40 9e 00 28 bne- cr7,ffc1b978 <_POSIX_signals_Unblock_thread+0x124><== NEVER TAKEN if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) ffc1b954: 3d 20 00 00 lis r9,0 ffc1b958: 39 29 31 a0 addi r9,r9,12704 ffc1b95c: 81 49 00 08 lwz r10,8(r9) ffc1b960: 2f 8a 00 00 cmpwi cr7,r10,0 ffc1b964: 41 9e 00 14 beq- cr7,ffc1b978 <_POSIX_signals_Unblock_thread+0x124> ffc1b968: 81 49 00 10 lwz r10,16(r9) ffc1b96c: 7f 83 50 00 cmpw cr7,r3,r10 ffc1b970: 40 be 00 08 bne+ cr7,ffc1b978 <_POSIX_signals_Unblock_thread+0x124><== NEVER TAKEN _Thread_Dispatch_necessary = true; ffc1b974: 98 e9 00 0c stb r7,12(r9) } } return false; ffc1b978: 38 60 00 00 li r3,0 } ffc1b97c: 39 61 00 10 addi r11,r1,16 ffc1b980: 4b fe 4c 44 b ffc005c4 <_restgpr_31_x> =============================================================================== ffc0b0c0 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { ffc0b0c0: 94 21 ff e8 stwu r1,-24(r1) ffc0b0c4: 7c 08 02 a6 mflr r0 ffc0b0c8: bf 81 00 08 stmw r28,8(r1) RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; ffc0b0cc: 7c 9f 23 79 mr. r31,r4 */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { ffc0b0d0: 90 01 00 1c stw r0,28(r1) RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; ffc0b0d4: 41 82 01 9c beq- ffc0b270 <_RBTree_Extract_unprotected+0x1b0> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { ffc0b0d8: 81 23 00 08 lwz r9,8(r3) ffc0b0dc: 7c 7c 1b 78 mr r28,r3 ffc0b0e0: 7f 9f 48 00 cmpw cr7,r31,r9 ffc0b0e4: 40 be 00 14 bne+ cr7,ffc0b0f8 <_RBTree_Extract_unprotected+0x38> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_RIGHT ); ffc0b0e8: 7f e3 fb 78 mr r3,r31 ffc0b0ec: 38 80 00 01 li r4,1 ffc0b0f0: 48 00 04 f5 bl ffc0b5e4 <_RBTree_Next_unprotected> RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; ffc0b0f4: 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]) { ffc0b0f8: 81 3c 00 0c lwz r9,12(r28) ffc0b0fc: 7f 9f 48 00 cmpw cr7,r31,r9 ffc0b100: 40 be 00 14 bne+ cr7,ffc0b114 <_RBTree_Extract_unprotected+0x54> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_LEFT ); ffc0b104: 7f e3 fb 78 mr r3,r31 ffc0b108: 38 80 00 00 li r4,0 ffc0b10c: 48 00 04 d9 bl ffc0b5e4 <_RBTree_Next_unprotected> RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; ffc0b110: 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]) { ffc0b114: 83 df 00 04 lwz r30,4(r31) ffc0b118: 83 bf 00 08 lwz r29,8(r31) ffc0b11c: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0b120: 41 9e 00 d0 beq- cr7,ffc0b1f0 <_RBTree_Extract_unprotected+0x130> ffc0b124: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0b128: 40 be 00 0c bne+ cr7,ffc0b134 <_RBTree_Extract_unprotected+0x74> ffc0b12c: 48 00 00 d0 b ffc0b1fc <_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]; ffc0b130: 7d 3e 4b 78 mr r30,r9 ffc0b134: 81 3e 00 08 lwz r9,8(r30) ffc0b138: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b13c: 40 9e ff f4 bne+ cr7,ffc0b130 <_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]; ffc0b140: 83 be 00 04 lwz r29,4(r30) if(leaf) { ffc0b144: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0b148: 41 9e 00 10 beq- cr7,ffc0b158 <_RBTree_Extract_unprotected+0x98> leaf->parent = target->parent; ffc0b14c: 81 3e 00 00 lwz r9,0(r30) ffc0b150: 91 3d 00 00 stw r9,0(r29) ffc0b154: 48 00 00 0c b ffc0b160 <_RBTree_Extract_unprotected+0xa0> } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); ffc0b158: 7f c3 f3 78 mr r3,r30 ffc0b15c: 4b ff fd cd bl ffc0af28 <_RBTree_Extract_validate_unprotected> } victim_color = target->color; dir = target != target->parent->child[0]; ffc0b160: 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; ffc0b164: 81 5e 00 0c lwz r10,12(r30) dir = target != target->parent->child[0]; ffc0b168: 81 28 00 04 lwz r9,4(r8) ffc0b16c: 7f c9 4a 78 xor r9,r30,r9 ffc0b170: 7d 29 00 34 cntlzw r9,r9 ffc0b174: 55 29 d9 7e rlwinm r9,r9,27,5,31 ffc0b178: 69 29 00 01 xori r9,r9,1 target->parent->child[dir] = leaf; ffc0b17c: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0b180: 7d 08 4a 14 add r8,r8,r9 ffc0b184: 93 a8 00 04 stw r29,4(r8) /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; ffc0b188: 81 1f 00 00 lwz r8,0(r31) ffc0b18c: 81 28 00 04 lwz r9,4(r8) ffc0b190: 7f e9 4a 78 xor r9,r31,r9 ffc0b194: 7d 29 00 34 cntlzw r9,r9 ffc0b198: 55 29 d9 7e rlwinm r9,r9,27,5,31 ffc0b19c: 69 29 00 01 xori r9,r9,1 the_node->parent->child[dir] = target; ffc0b1a0: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0b1a4: 7d 08 4a 14 add r8,r8,r9 ffc0b1a8: 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]; ffc0b1ac: 81 3f 00 08 lwz r9,8(r31) ffc0b1b0: 91 3e 00 08 stw r9,8(r30) if (the_node->child[RBT_RIGHT]) ffc0b1b4: 81 3f 00 08 lwz r9,8(r31) ffc0b1b8: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b1bc: 41 9e 00 08 beq- cr7,ffc0b1c4 <_RBTree_Extract_unprotected+0x104><== NEVER TAKEN the_node->child[RBT_RIGHT]->parent = target; ffc0b1c0: 93 c9 00 00 stw r30,0(r9) target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; ffc0b1c4: 81 3f 00 04 lwz r9,4(r31) ffc0b1c8: 91 3e 00 04 stw r9,4(r30) if (the_node->child[RBT_LEFT]) ffc0b1cc: 81 3f 00 04 lwz r9,4(r31) ffc0b1d0: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b1d4: 41 9e 00 08 beq- cr7,ffc0b1dc <_RBTree_Extract_unprotected+0x11c> the_node->child[RBT_LEFT]->parent = target; ffc0b1d8: 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; ffc0b1dc: 81 3f 00 00 lwz r9,0(r31) ffc0b1e0: 91 3e 00 00 stw r9,0(r30) target->color = the_node->color; ffc0b1e4: 81 3f 00 0c lwz r9,12(r31) ffc0b1e8: 91 3e 00 0c stw r9,12(r30) ffc0b1ec: 48 00 00 50 b ffc0b23c <_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 ) { ffc0b1f0: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0b1f4: 40 be 00 0c bne+ cr7,ffc0b200 <_RBTree_Extract_unprotected+0x140> ffc0b1f8: 48 00 00 14 b ffc0b20c <_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]) { ffc0b1fc: 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; ffc0b200: 81 3f 00 00 lwz r9,0(r31) ffc0b204: 91 3d 00 00 stw r9,0(r29) ffc0b208: 48 00 00 0c b ffc0b214 <_RBTree_Extract_unprotected+0x154> } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); ffc0b20c: 7f e3 fb 78 mr r3,r31 ffc0b210: 4b ff fd 19 bl ffc0af28 <_RBTree_Extract_validate_unprotected> } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; ffc0b214: 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; ffc0b218: 81 5f 00 0c lwz r10,12(r31) /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; ffc0b21c: 81 28 00 04 lwz r9,4(r8) ffc0b220: 7f e9 4a 78 xor r9,r31,r9 ffc0b224: 7d 29 00 34 cntlzw r9,r9 ffc0b228: 55 29 d9 7e rlwinm r9,r9,27,5,31 ffc0b22c: 69 29 00 01 xori r9,r9,1 the_node->parent->child[dir] = leaf; ffc0b230: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0b234: 7d 08 4a 14 add r8,r8,r9 ffc0b238: 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 */ ffc0b23c: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0b240: 40 9e 00 10 bne- cr7,ffc0b250 <_RBTree_Extract_unprotected+0x190> if (leaf) { ffc0b244: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0b248: 41 9e 00 08 beq- cr7,ffc0b250 <_RBTree_Extract_unprotected+0x190> leaf->color = RBT_BLACK; /* case 2 */ ffc0b24c: 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; ffc0b250: 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; ffc0b254: 39 20 00 00 li r9,0 ffc0b258: 91 3f 00 08 stw r9,8(r31) ffc0b25c: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0b260: 91 3f 00 04 stw r9,4(r31) ffc0b264: 91 3f 00 00 stw r9,0(r31) ffc0b268: 41 9e 00 08 beq- cr7,ffc0b270 <_RBTree_Extract_unprotected+0x1b0> ffc0b26c: 91 2a 00 0c stw r9,12(r10) } ffc0b270: 39 61 00 18 addi r11,r1,24 ffc0b274: 4b ff 5a f8 b ffc00d6c <_restgpr_28_x> =============================================================================== ffc0ba98 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { ffc0ba98: 94 21 ff e8 stwu r1,-24(r1) ffc0ba9c: 7c 08 02 a6 mflr r0 ffc0baa0: bf 81 00 08 stmw r28,8(r1) size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; ffc0baa4: 7c 7f 1b 79 mr. r31,r3 void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { ffc0baa8: 90 01 00 1c stw r0,28(r1) size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; ffc0baac: 41 82 00 4c beq- ffc0baf8 <_RBTree_Initialize+0x60> <== NEVER TAKEN RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; ffc0bab0: 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; ffc0bab4: 90 9f 00 10 stw r4,16(r31) ffc0bab8: 7c de 33 78 mr r30,r6 ffc0babc: 7c fc 3b 78 mr r28,r7 RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; ffc0bac0: 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; ffc0bac4: 7c bd 2b 78 mr r29,r5 the_rbtree->root = NULL; ffc0bac8: 91 3f 00 04 stw r9,4(r31) the_rbtree->first[0] = NULL; ffc0bacc: 91 3f 00 08 stw r9,8(r31) the_rbtree->first[1] = NULL; ffc0bad0: 91 3f 00 0c stw r9,12(r31) the_rbtree->compare_function = compare_function; the_rbtree->is_unique = is_unique; ffc0bad4: 99 1f 00 14 stb r8,20(r31) while ( count-- ) { ffc0bad8: 48 00 00 18 b ffc0baf0 <_RBTree_Initialize+0x58> _RBTree_Insert_unprotected(the_rbtree, next); ffc0badc: 7f a4 eb 78 mr r4,r29 ffc0bae0: 7f e3 fb 78 mr r3,r31 ffc0bae4: 4b ff fc 91 bl ffc0b774 <_RBTree_Insert_unprotected> #include #include #include #include void _RBTree_Initialize( ffc0bae8: 7f bd e2 14 add r29,r29,r28 ffc0baec: 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-- ) { ffc0baf0: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0baf4: 40 9e ff e8 bne+ cr7,ffc0badc <_RBTree_Initialize+0x44> _RBTree_Insert_unprotected(the_rbtree, next); next = (RBTree_Node *) _Addresses_Add_offset( (void *) next, node_size ); } } ffc0baf8: 39 61 00 18 addi r11,r1,24 ffc0bafc: 4b ff 5e 6c b ffc01968 <_restgpr_28_x> =============================================================================== ffc0b328 <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { ffc0b328: 94 21 ff e0 stwu r1,-32(r1) ffc0b32c: 7c 08 02 a6 mflr r0 ffc0b330: bf 41 00 08 stmw r26,8(r1) if(!the_node) return (RBTree_Node*)-1; ffc0b334: 7c 9f 23 79 mr. r31,r4 */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { ffc0b338: 90 01 00 24 stw r0,36(r1) if(!the_node) return (RBTree_Node*)-1; ffc0b33c: 41 82 01 d8 beq- ffc0b514 <_RBTree_Insert_unprotected+0x1ec> RBTree_Node *iter_node = the_rbtree->root; ffc0b340: 83 c3 00 04 lwz r30,4(r3) ffc0b344: 7c 7d 1b 78 mr r29,r3 int compare_result; if (!iter_node) { /* special case: first node inserted */ ffc0b348: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0b34c: 7f db f3 78 mr r27,r30 ffc0b350: 40 be 00 28 bne+ cr7,ffc0b378 <_RBTree_Insert_unprotected+0x50> the_node->color = RBT_BLACK; ffc0b354: 93 df 00 0c stw r30,12(r31) the_rbtree->root = the_node; ffc0b358: 93 e3 00 04 stw r31,4(r3) the_rbtree->first[0] = the_rbtree->first[1] = the_node; ffc0b35c: 93 e3 00 0c stw r31,12(r3) ffc0b360: 93 e3 00 08 stw r31,8(r3) the_node->parent = (RBTree_Node *) the_rbtree; ffc0b364: 90 7f 00 00 stw r3,0(r31) the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; ffc0b368: 93 df 00 08 stw r30,8(r31) ffc0b36c: 93 df 00 04 stw r30,4(r31) ffc0b370: 48 00 01 c0 b ffc0b530 <_RBTree_Insert_unprotected+0x208> (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; } break; } else { iter_node = iter_node->child[dir]; ffc0b374: 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); ffc0b378: 81 3d 00 10 lwz r9,16(r29) ffc0b37c: 7f e3 fb 78 mr r3,r31 ffc0b380: 7f c4 f3 78 mr r4,r30 ffc0b384: 7d 29 03 a6 mtctr r9 ffc0b388: 4e 80 04 21 bctrl if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) ffc0b38c: 89 3d 00 14 lbz r9,20(r29) ffc0b390: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b394: 41 9e 00 0c beq- cr7,ffc0b3a0 <_RBTree_Insert_unprotected+0x78> ffc0b398: 2f 83 00 00 cmpwi cr7,r3,0 ffc0b39c: 41 9e 01 94 beq- cr7,ffc0b530 <_RBTree_Insert_unprotected+0x208> return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); ffc0b3a0: 7c 7c 18 f8 not r28,r3 ffc0b3a4: 57 9c 0f fe rlwinm r28,r28,1,31,31 if (!iter_node->child[dir]) { ffc0b3a8: 57 89 10 3a rlwinm r9,r28,2,0,29 ffc0b3ac: 7f de 4a 14 add r30,r30,r9 ffc0b3b0: 39 5e 00 04 addi r10,r30,4 ffc0b3b4: 83 de 00 04 lwz r30,4(r30) ffc0b3b8: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0b3bc: 40 9e ff b8 bne+ cr7,ffc0b374 <_RBTree_Insert_unprotected+0x4c> the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; ffc0b3c0: 93 df 00 08 stw r30,8(r31) the_node->color = RBT_RED; ffc0b3c4: 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]; ffc0b3c8: 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; ffc0b3cc: 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( ffc0b3d0: 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; ffc0b3d4: 93 ea 00 00 stw r31,0(r10) the_node->parent = iter_node; /* update min/max */ compare_result = the_rbtree->compare_function( ffc0b3d8: 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; ffc0b3dc: 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( ffc0b3e0: 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; ffc0b3e4: 93 7f 00 00 stw r27,0(r31) /* update min/max */ compare_result = the_rbtree->compare_function( ffc0b3e8: 80 89 00 08 lwz r4,8(r9) ffc0b3ec: 4e 80 04 21 bctrl the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || ffc0b3f0: 2f 1c 00 00 cmpwi cr6,r28,0 ffc0b3f4: 2f 83 00 00 cmpwi cr7,r3,0 ffc0b3f8: 40 9a 00 0c bne- cr6,ffc0b404 <_RBTree_Insert_unprotected+0xdc> ffc0b3fc: 40 bc 00 e4 bge+ cr7,ffc0b4e0 <_RBTree_Insert_unprotected+0x1b8> ffc0b400: 48 00 00 08 b ffc0b408 <_RBTree_Insert_unprotected+0xe0> (dir && _RBTree_Is_greater(compare_result)) ) { ffc0b404: 40 9d 00 dc ble- cr7,ffc0b4e0 <_RBTree_Insert_unprotected+0x1b8> the_rbtree->first[dir] = the_node; ffc0b408: 57 9c 10 3a rlwinm r28,r28,2,0,29 ffc0b40c: 7f bd e2 14 add r29,r29,r28 ffc0b410: 93 fd 00 08 stw r31,8(r29) ffc0b414: 48 00 00 cc b ffc0b4e0 <_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; ffc0b418: 41 9e 00 38 beq- cr7,ffc0b450 <_RBTree_Insert_unprotected+0x128><== NEVER TAKEN if(!(the_node->parent->parent->parent)) return NULL; ffc0b41c: 81 3d 00 00 lwz r9,0(r29) ffc0b420: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b424: 41 9e 00 2c beq- cr7,ffc0b450 <_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]) ffc0b428: 81 3d 00 04 lwz r9,4(r29) ffc0b42c: 7f 83 48 00 cmpw cr7,r3,r9 ffc0b430: 40 be 00 08 bne+ cr7,ffc0b438 <_RBTree_Insert_unprotected+0x110> return the_node->parent->child[RBT_RIGHT]; ffc0b434: 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); ffc0b438: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b43c: 41 9e 00 18 beq- cr7,ffc0b454 <_RBTree_Insert_unprotected+0x12c> ffc0b440: 81 49 00 0c lwz r10,12(r9) ffc0b444: 2f 8a 00 01 cmpwi cr7,r10,1 ffc0b448: 40 be 00 0c bne+ cr7,ffc0b454 <_RBTree_Insert_unprotected+0x12c> ffc0b44c: 48 00 00 10 b ffc0b45c <_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; ffc0b450: 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); ffc0b454: 39 40 00 00 li r10,0 ffc0b458: 48 00 00 08 b ffc0b460 <_RBTree_Insert_unprotected+0x138> ffc0b45c: 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)) { ffc0b460: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0b464: 41 9e 00 14 beq- cr7,ffc0b478 <_RBTree_Insert_unprotected+0x150> the_node->parent->color = RBT_BLACK; ffc0b468: 93 63 00 0c stw r27,12(r3) u->color = RBT_BLACK; ffc0b46c: 93 69 00 0c stw r27,12(r9) g->color = RBT_RED; ffc0b470: 93 5d 00 0c stw r26,12(r29) ffc0b474: 48 00 00 64 b ffc0b4d8 <_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]; ffc0b478: 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]; ffc0b47c: 81 23 00 04 lwz r9,4(r3) RBTree_Direction pdir = the_node->parent != g->child[0]; ffc0b480: 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]; ffc0b484: 7f e9 4a 78 xor r9,r31,r9 RBTree_Direction pdir = the_node->parent != g->child[0]; ffc0b488: 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]; ffc0b48c: 7d 29 00 34 cntlzw r9,r9 RBTree_Direction pdir = the_node->parent != g->child[0]; ffc0b490: 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]; ffc0b494: 55 29 d9 7e rlwinm r9,r9,27,5,31 RBTree_Direction pdir = the_node->parent != g->child[0]; ffc0b498: 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]; ffc0b49c: 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) { ffc0b4a0: 7f 89 e0 00 cmpw cr7,r9,r28 ffc0b4a4: 41 9e 00 18 beq- cr7,ffc0b4bc <_RBTree_Insert_unprotected+0x194> _RBTree_Rotate(the_node->parent, pdir); ffc0b4a8: 7f 84 e3 78 mr r4,r28 ffc0b4ac: 4b ff fe 01 bl ffc0b2ac <_RBTree_Rotate> the_node = the_node->child[pdir]; ffc0b4b0: 57 89 10 3a rlwinm r9,r28,2,0,29 ffc0b4b4: 7f ff 4a 14 add r31,r31,r9 ffc0b4b8: 83 ff 00 04 lwz r31,4(r31) } the_node->parent->color = RBT_BLACK; ffc0b4bc: 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)); ffc0b4c0: 7f a3 eb 78 mr r3,r29 ffc0b4c4: 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; ffc0b4c8: 93 69 00 0c stw r27,12(r9) g->color = RBT_RED; ffc0b4cc: 93 5d 00 0c stw r26,12(r29) /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); ffc0b4d0: 7f fd fb 78 mr r29,r31 ffc0b4d4: 4b ff fd d9 bl ffc0b2ac <_RBTree_Rotate> ffc0b4d8: 7f bf eb 78 mr r31,r29 ffc0b4dc: 48 00 00 0c b ffc0b4e8 <_RBTree_Insert_unprotected+0x1c0> ffc0b4e0: 3b 60 00 00 li r27,0 ffc0b4e4: 3b 40 00 01 li r26,1 _ISR_Disable( level ); return_node = _RBTree_Insert_unprotected( tree, node ); _ISR_Enable( level ); return return_node; } ffc0b4e8: 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; ffc0b4ec: 83 a3 00 00 lwz r29,0(r3) ffc0b4f0: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0b4f4: 40 be 00 28 bne+ cr7,ffc0b51c <_RBTree_Insert_unprotected+0x1f4> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); ffc0b4f8: 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))) { ffc0b4fc: 2f 09 00 00 cmpwi cr6,r9,0 ffc0b500: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0b504: 40 9a ff 14 bne+ cr6,ffc0b418 <_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; ffc0b508: 40 be 00 28 bne+ cr7,ffc0b530 <_RBTree_Insert_unprotected+0x208> ffc0b50c: 93 bf 00 0c stw r29,12(r31) ffc0b510: 48 00 00 20 b ffc0b530 <_RBTree_Insert_unprotected+0x208> RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { if(!the_node) return (RBTree_Node*)-1; ffc0b514: 3b c0 ff ff li r30,-1 ffc0b518: 48 00 00 18 b ffc0b530 <_RBTree_Insert_unprotected+0x208> ffc0b51c: 81 23 00 0c lwz r9,12(r3) ffc0b520: 69 29 00 01 xori r9,r9,1 ffc0b524: 7d 29 00 34 cntlzw r9,r9 ffc0b528: 55 29 d9 7e rlwinm r9,r9,27,5,31 ffc0b52c: 4b ff ff d0 b ffc0b4fc <_RBTree_Insert_unprotected+0x1d4> /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } ffc0b530: 39 61 00 20 addi r11,r1,32 ffc0b534: 7f c3 f3 78 mr r3,r30 ffc0b538: 4b ff 58 2c b ffc00d64 <_restgpr_26_x> =============================================================================== ffc0b570 <_RBTree_Iterate_unprotected>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { ffc0b570: 94 21 ff e0 stwu r1,-32(r1) ffc0b574: 7c 08 02 a6 mflr r0 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); ffc0b578: 7c 89 00 34 cntlzw r9,r4 ffc0b57c: 55 29 d9 7e rlwinm r9,r9,27,5,31 ffc0b580: 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]; ffc0b584: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0b588: 7c 63 4a 14 add r3,r3,r9 ffc0b58c: bf 61 00 0c stmw r27,12(r1) ffc0b590: 7c bd 2b 78 mr r29,r5 ffc0b594: 7c dc 33 78 mr r28,r6 ffc0b598: 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); ffc0b59c: 7c 9e 23 78 mr r30,r4 ffc0b5a0: 48 00 00 34 b ffc0b5d4 <_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 ); ffc0b5a4: 7f e3 fb 78 mr r3,r31 ffc0b5a8: 7f a9 03 a6 mtctr r29 ffc0b5ac: 7f c4 f3 78 mr r4,r30 ffc0b5b0: 7f 85 e3 78 mr r5,r28 ffc0b5b4: 4e 80 04 21 bctrl current = _RBTree_Next_unprotected( current, dir ); ffc0b5b8: 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 ); ffc0b5bc: 7c 7b 1b 78 mr r27,r3 current = _RBTree_Next_unprotected( current, dir ); ffc0b5c0: 7f e3 fb 78 mr r3,r31 ffc0b5c4: 48 00 00 21 bl ffc0b5e4 <_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 ) { ffc0b5c8: 2f 9b 00 00 cmpwi cr7,r27,0 stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); ffc0b5cc: 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 ) { ffc0b5d0: 40 9e 00 0c bne- cr7,ffc0b5dc <_RBTree_Iterate_unprotected+0x6c><== NEVER TAKEN ffc0b5d4: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0b5d8: 40 9e ff cc bne+ cr7,ffc0b5a4 <_RBTree_Iterate_unprotected+0x34> stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); } } ffc0b5dc: 39 61 00 20 addi r11,r1,32 ffc0b5e0: 4b ff 57 88 b ffc00d68 <_restgpr_27_x> =============================================================================== ffc0ae70 <_RBTree_Sibling>: */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; ffc0ae70: 7c 6a 1b 79 mr. r10,r3 ffc0ae74: 41 82 00 30 beq- ffc0aea4 <_RBTree_Sibling+0x34> <== NEVER TAKEN if(!(the_node->parent)) return NULL; ffc0ae78: 81 2a 00 00 lwz r9,0(r10) ffc0ae7c: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ae80: 41 9e 00 24 beq- cr7,ffc0aea4 <_RBTree_Sibling+0x34> <== NEVER TAKEN if(!(the_node->parent->parent)) return NULL; ffc0ae84: 81 09 00 00 lwz r8,0(r9) ffc0ae88: 2f 88 00 00 cmpwi cr7,r8,0 ffc0ae8c: 41 9e 00 18 beq- cr7,ffc0aea4 <_RBTree_Sibling+0x34> if(the_node == the_node->parent->child[RBT_LEFT]) ffc0ae90: 80 69 00 04 lwz r3,4(r9) ffc0ae94: 7f 8a 18 00 cmpw cr7,r10,r3 ffc0ae98: 4c be 00 20 bnelr+ cr7 return the_node->parent->child[RBT_RIGHT]; ffc0ae9c: 80 69 00 08 lwz r3,8(r9) ffc0aea0: 4e 80 00 20 blr */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; ffc0aea4: 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]; } ffc0aea8: 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 4c lwz r31,332(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> =============================================================================== ffc3461c <_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 ) { ffc3461c: 94 21 ff d8 stwu r1,-40(r1) ffc34620: 7c 08 02 a6 mflr r0 ffc34624: 90 01 00 2c stw r0,44(r1) ffc34628: bf 81 00 18 stmw r28,24(r1) ffc3462c: 7c 9d 23 78 mr r29,r4 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); ffc34630: 3c 80 00 00 lis r4,0 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; ffc34634: 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 ) { ffc34638: 7c 7f 1b 78 mr r31,r3 ffc3463c: 38 84 63 e8 addi r4,r4,25576 ffc34640: 38 61 00 08 addi r3,r1,8 ffc34644: 7c bc 2b 78 mr r28,r5 ffc34648: 4b fd 4b 35 bl ffc0917c <_TOD_Get_with_nanoseconds> const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; ffc3464c: 81 5f 00 50 lwz r10,80(r31) ffc34650: 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( ffc34654: 80 c1 00 08 lwz r6,8(r1) ffc34658: 80 e1 00 0c lwz r7,12(r1) ffc3465c: 7d 6b 38 10 subfc r11,r11,r7 ffc34660: 7d 4a 31 10 subfe r10,r10,r6 ffc34664: 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) { ffc34668: 3d 40 00 00 lis r10,0 ffc3466c: 39 4a 69 20 addi r10,r10,26912 ffc34670: 91 7d 00 04 stw r11,4(r29) ffc34674: 80 aa 00 10 lwz r5,16(r10) #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; ffc34678: 81 1e 00 80 lwz r8,128(r30) #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { ffc3467c: 7f 9e 28 00 cmpw cr7,r30,r5 #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; ffc34680: 81 3e 00 84 lwz r9,132(r30) #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { ffc34684: 40 be 00 48 bne+ cr7,ffc346cc <_Rate_monotonic_Get_status+0xb0> ffc34688: 81 6a 00 24 lwz r11,36(r10) ffc3468c: 81 4a 00 20 lwz r10,32(r10) ffc34690: 7c eb 38 10 subfc r7,r11,r7 ffc34694: 7c ca 31 10 subfe r6,r10,r6 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } ffc34698: 81 5f 00 48 lwz r10,72(r31) ffc3469c: 81 7f 00 4c lwz r11,76(r31) static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; ffc346a0: 7d 29 38 14 addc r9,r9,r7 ffc346a4: 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)) ffc346a8: 7f 8a 40 00 cmpw cr7,r10,r8 ffc346ac: 41 9d 00 28 bgt- cr7,ffc346d4 <_Rate_monotonic_Get_status+0xb8><== NEVER TAKEN ffc346b0: 40 be 00 0c bne+ cr7,ffc346bc <_Rate_monotonic_Get_status+0xa0> ffc346b4: 7f 8b 48 40 cmplw cr7,r11,r9 ffc346b8: 41 9d 00 1c bgt- cr7,ffc346d4 <_Rate_monotonic_Get_status+0xb8> const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; ffc346bc: 7d 6b 48 10 subfc r11,r11,r9 ffc346c0: 7d 4a 41 10 subfe r10,r10,r8 ffc346c4: 91 5c 00 00 stw r10,0(r28) ffc346c8: 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; ffc346cc: 38 60 00 01 li r3,1 ffc346d0: 48 00 00 08 b ffc346d8 <_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; ffc346d4: 38 60 00 00 li r3,0 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } ffc346d8: 39 61 00 28 addi r11,r1,40 ffc346dc: 48 01 fe 24 b ffc54500 <_restgpr_28_x> =============================================================================== ffc34a78 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { ffc34a78: 7c 2b 0b 78 mr r11,r1 ffc34a7c: 94 21 ff e0 stwu r1,-32(r1) ffc34a80: 7c 08 02 a6 mflr r0 ffc34a84: 7c 64 1b 78 mr r4,r3 ffc34a88: 3c 60 00 00 lis r3,0 ffc34a8c: 48 01 fa 35 bl ffc544c0 <_savegpr_31> ffc34a90: 38 63 6f 3c addi r3,r3,28476 ffc34a94: 90 01 00 24 stw r0,36(r1) ffc34a98: 38 a1 00 08 addi r5,r1,8 ffc34a9c: 4b fd 51 61 bl ffc09bfc <_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 ) { ffc34aa0: 81 21 00 08 lwz r9,8(r1) ffc34aa4: 2f 89 00 00 cmpwi cr7,r9,0 ffc34aa8: 40 9e 00 88 bne- cr7,ffc34b30 <_Rate_monotonic_Timeout+0xb8><== NEVER TAKEN ffc34aac: 7c 7f 1b 78 mr r31,r3 case OBJECTS_LOCAL: the_thread = the_period->owner; ffc34ab0: 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); ffc34ab4: 81 23 00 10 lwz r9,16(r3) if ( _States_Is_waiting_for_period( the_thread->current_state ) && ffc34ab8: 71 2a 40 00 andi. r10,r9,16384 ffc34abc: 41 82 00 24 beq- ffc34ae0 <_Rate_monotonic_Timeout+0x68> ffc34ac0: 81 43 00 20 lwz r10,32(r3) ffc34ac4: 81 3f 00 08 lwz r9,8(r31) ffc34ac8: 7f 8a 48 00 cmpw cr7,r10,r9 ffc34acc: 40 be 00 14 bne+ cr7,ffc34ae0 <_Rate_monotonic_Timeout+0x68> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); ffc34ad0: 3c 80 10 07 lis r4,4103 ffc34ad4: 60 84 ff f8 ori r4,r4,65528 ffc34ad8: 4b fd 5b 59 bl ffc0a630 <_Thread_Clear_state> ffc34adc: 48 00 00 18 b ffc34af4 <_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 ) { ffc34ae0: 81 3f 00 38 lwz r9,56(r31) ffc34ae4: 2f 89 00 01 cmpwi cr7,r9,1 ffc34ae8: 40 be 00 30 bne+ cr7,ffc34b18 <_Rate_monotonic_Timeout+0xa0> the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; ffc34aec: 39 20 00 03 li r9,3 ffc34af0: 91 3f 00 38 stw r9,56(r31) _Rate_monotonic_Initiate_statistics( the_period ); ffc34af4: 7f e3 fb 78 mr r3,r31 ffc34af8: 4b ff fd 15 bl ffc3480c <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; ffc34afc: 81 3f 00 3c lwz r9,60(r31) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc34b00: 3c 60 00 00 lis r3,0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; ffc34b04: 91 3f 00 1c stw r9,28(r31) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc34b08: 38 63 65 28 addi r3,r3,25896 ffc34b0c: 38 9f 00 10 addi r4,r31,16 ffc34b10: 4b fd 6c ad bl ffc0b7bc <_Watchdog_Insert> ffc34b14: 48 00 00 0c b ffc34b20 <_Rate_monotonic_Timeout+0xa8> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; ffc34b18: 39 20 00 04 li r9,4 ffc34b1c: 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; ffc34b20: 3d 20 00 00 lis r9,0 ffc34b24: 81 49 34 e4 lwz r10,13540(r9) --level; ffc34b28: 39 4a ff ff addi r10,r10,-1 _Thread_Dispatch_disable_level = level; ffc34b2c: 91 49 34 e4 stw r10,13540(r9) case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } ffc34b30: 39 61 00 20 addi r11,r1,32 ffc34b34: 48 01 f9 d8 b ffc5450c <_restgpr_31_x> =============================================================================== ffc346e0 <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { ffc346e0: 7c 2b 0b 78 mr r11,r1 ffc346e4: 7c 08 02 a6 mflr r0 ffc346e8: 94 21 ff e0 stwu r1,-32(r1) ffc346ec: 90 01 00 24 stw r0,36(r1) ffc346f0: 48 01 fd d1 bl ffc544c0 <_savegpr_31> ffc346f4: 7c 7f 1b 78 mr r31,r3 /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; ffc346f8: 81 23 00 58 lwz r9,88(r3) ffc346fc: 39 29 00 01 addi r9,r9,1 ffc34700: 91 23 00 58 stw r9,88(r3) if ( the_period->state == RATE_MONOTONIC_EXPIRED ) ffc34704: 81 23 00 38 lwz r9,56(r3) ffc34708: 2f 89 00 04 cmpwi cr7,r9,4 ffc3470c: 40 be 00 10 bne+ cr7,ffc3471c <_Rate_monotonic_Update_statistics+0x3c> stats->missed_count++; ffc34710: 81 23 00 5c lwz r9,92(r3) ffc34714: 39 29 00 01 addi r9,r9,1 ffc34718: 91 23 00 5c stw r9,92(r3) /* * Grab status for time statistics. */ valid_status = ffc3471c: 7f e3 fb 78 mr r3,r31 ffc34720: 38 81 00 08 addi r4,r1,8 ffc34724: 38 a1 00 10 addi r5,r1,16 ffc34728: 4b ff fe f5 bl ffc3461c <_Rate_monotonic_Get_status> _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) ffc3472c: 2f 83 00 00 cmpwi cr7,r3,0 ffc34730: 41 9e 00 d4 beq- cr7,ffc34804 <_Rate_monotonic_Update_statistics+0x124> /* * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); ffc34734: 81 41 00 10 lwz r10,16(r1) static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; ffc34738: 81 1f 00 70 lwz r8,112(r31) ffc3473c: 81 3f 00 74 lwz r9,116(r31) ffc34740: 81 61 00 14 lwz r11,20(r1) ffc34744: 7d 29 58 14 addc r9,r9,r11 ffc34748: 7d 08 51 14 adde r8,r8,r10 ffc3474c: 91 3f 00 74 stw r9,116(r31) if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) ffc34750: 81 3f 00 60 lwz r9,96(r31) ffc34754: 91 1f 00 70 stw r8,112(r31) ffc34758: 7f 89 50 00 cmpw cr7,r9,r10 ffc3475c: 41 9d 00 14 bgt- cr7,ffc34770 <_Rate_monotonic_Update_statistics+0x90> ffc34760: 40 9e 00 18 bne- cr7,ffc34778 <_Rate_monotonic_Update_statistics+0x98><== NEVER TAKEN ffc34764: 81 3f 00 64 lwz r9,100(r31) ffc34768: 7f 89 58 40 cmplw cr7,r9,r11 ffc3476c: 40 9d 00 0c ble- cr7,ffc34778 <_Rate_monotonic_Update_statistics+0x98> stats->min_cpu_time = executed; ffc34770: 91 5f 00 60 stw r10,96(r31) ffc34774: 91 7f 00 64 stw r11,100(r31) if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) ffc34778: 81 3f 00 68 lwz r9,104(r31) ffc3477c: 7f 89 50 00 cmpw cr7,r9,r10 ffc34780: 41 9c 00 14 blt- cr7,ffc34794 <_Rate_monotonic_Update_statistics+0xb4><== NEVER TAKEN ffc34784: 40 9e 00 18 bne- cr7,ffc3479c <_Rate_monotonic_Update_statistics+0xbc><== NEVER TAKEN ffc34788: 81 3f 00 6c lwz r9,108(r31) ffc3478c: 7f 89 58 40 cmplw cr7,r9,r11 ffc34790: 40 9c 00 0c bge- cr7,ffc3479c <_Rate_monotonic_Update_statistics+0xbc> stats->max_cpu_time = executed; ffc34794: 91 5f 00 68 stw r10,104(r31) ffc34798: 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 ); ffc3479c: 81 41 00 08 lwz r10,8(r1) ffc347a0: 81 1f 00 88 lwz r8,136(r31) ffc347a4: 81 3f 00 8c lwz r9,140(r31) ffc347a8: 81 61 00 0c lwz r11,12(r1) ffc347ac: 7d 29 58 14 addc r9,r9,r11 ffc347b0: 7d 08 51 14 adde r8,r8,r10 ffc347b4: 91 3f 00 8c stw r9,140(r31) if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) ffc347b8: 81 3f 00 78 lwz r9,120(r31) ffc347bc: 91 1f 00 88 stw r8,136(r31) ffc347c0: 7f 89 50 00 cmpw cr7,r9,r10 ffc347c4: 41 9d 00 14 bgt- cr7,ffc347d8 <_Rate_monotonic_Update_statistics+0xf8> ffc347c8: 40 9e 00 18 bne- cr7,ffc347e0 <_Rate_monotonic_Update_statistics+0x100><== NEVER TAKEN ffc347cc: 81 3f 00 7c lwz r9,124(r31) ffc347d0: 7f 89 58 40 cmplw cr7,r9,r11 ffc347d4: 40 9d 00 0c ble- cr7,ffc347e0 <_Rate_monotonic_Update_statistics+0x100> stats->min_wall_time = since_last_period; ffc347d8: 91 5f 00 78 stw r10,120(r31) ffc347dc: 91 7f 00 7c stw r11,124(r31) if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) ffc347e0: 81 3f 00 80 lwz r9,128(r31) ffc347e4: 7f 89 50 00 cmpw cr7,r9,r10 ffc347e8: 41 bc 00 14 blt+ cr7,ffc347fc <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN ffc347ec: 40 9e 00 18 bne- cr7,ffc34804 <_Rate_monotonic_Update_statistics+0x124> ffc347f0: 81 3f 00 84 lwz r9,132(r31) ffc347f4: 7f 89 58 40 cmplw cr7,r9,r11 ffc347f8: 40 9c 00 0c bge- cr7,ffc34804 <_Rate_monotonic_Update_statistics+0x124> stats->max_wall_time = since_last_period; ffc347fc: 91 5f 00 80 stw r10,128(r31) ffc34800: 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 } ffc34804: 39 61 00 20 addi r11,r1,32 ffc34808: 48 01 fd 04 b ffc5450c <_restgpr_31_x> =============================================================================== ffc0b0c8 <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { ffc0b0c8: 7c 2b 0b 78 mr r11,r1 ffc0b0cc: 94 21 ff f0 stwu r1,-16(r1) ffc0b0d0: 7c 08 02 a6 mflr r0 ffc0b0d4: 48 01 17 9d bl ffc1c870 <_savegpr_31> ffc0b0d8: 7c 7f 1b 78 mr r31,r3 void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); ffc0b0dc: 38 60 00 1c li r3,28 #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { ffc0b0e0: 90 01 00 14 stw r0,20(r1) void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); ffc0b0e4: 48 00 1c c9 bl ffc0cdac <_Workspace_Allocate> if ( sched ) { ffc0b0e8: 2c 03 00 00 cmpwi r3,0 ffc0b0ec: 41 82 00 1c beq- ffc0b108 <_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; ffc0b0f0: 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; ffc0b0f4: 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; ffc0b0f8: 91 43 00 14 stw r10,20(r3) schinfo->cbs_server = NULL; ffc0b0fc: 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; ffc0b100: 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; ffc0b104: 91 43 00 18 stw r10,24(r3) } return sched; } ffc0b108: 39 61 00 10 addi r11,r1,16 ffc0b10c: 4b ff 5a c0 b ffc00bcc <_restgpr_31_x> =============================================================================== ffc0c784 <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { ffc0c784: 7c 2b 0b 78 mr r11,r1 ffc0c788: 7c 08 02 a6 mflr r0 ffc0c78c: 94 21 ff e0 stwu r1,-32(r1) ffc0c790: 90 01 00 24 stw r0,36(r1) ffc0c794: 48 01 17 f1 bl ffc1df84 <_savegpr_31> ffc0c798: 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; ffc0c79c: 80 83 00 ac lwz r4,172(r3) if ( the_thread->real_priority != new_priority ) ffc0c7a0: 81 23 00 18 lwz r9,24(r3) ffc0c7a4: 7f 89 20 00 cmpw cr7,r9,r4 ffc0c7a8: 41 9e 00 08 beq- cr7,ffc0c7b0 <_Scheduler_CBS_Budget_callout+0x2c><== NEVER TAKEN the_thread->real_priority = new_priority; ffc0c7ac: 90 83 00 18 stw r4,24(r3) if ( the_thread->current_priority != new_priority ) ffc0c7b0: 81 3f 00 14 lwz r9,20(r31) ffc0c7b4: 7f 89 20 00 cmpw cr7,r9,r4 ffc0c7b8: 41 9e 00 10 beq- cr7,ffc0c7c8 <_Scheduler_CBS_Budget_callout+0x44><== NEVER TAKEN _Thread_Change_priority(the_thread, new_priority, true); ffc0c7bc: 7f e3 fb 78 mr r3,r31 ffc0c7c0: 38 a0 00 01 li r5,1 ffc0c7c4: 48 00 06 69 bl ffc0ce2c <_Thread_Change_priority> /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; ffc0c7c8: 83 ff 00 88 lwz r31,136(r31) if ( sched_info->cbs_server->cbs_budget_overrun ) { ffc0c7cc: 81 3f 00 18 lwz r9,24(r31) ffc0c7d0: 81 49 00 0c lwz r10,12(r9) ffc0c7d4: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0c7d8: 41 9e 00 24 beq- cr7,ffc0c7fc <_Scheduler_CBS_Budget_callout+0x78><== NEVER TAKEN _Scheduler_CBS_Get_server_id( ffc0c7dc: 80 69 00 00 lwz r3,0(r9) ffc0c7e0: 38 81 00 08 addi r4,r1,8 ffc0c7e4: 4b ff ff 49 bl ffc0c72c <_Scheduler_CBS_Get_server_id> sched_info->cbs_server->task_id, &server_id ); sched_info->cbs_server->cbs_budget_overrun( server_id ); ffc0c7e8: 81 3f 00 18 lwz r9,24(r31) ffc0c7ec: 80 61 00 08 lwz r3,8(r1) ffc0c7f0: 81 29 00 0c lwz r9,12(r9) ffc0c7f4: 7d 29 03 a6 mtctr r9 ffc0c7f8: 4e 80 04 21 bctrl } } ffc0c7fc: 39 61 00 20 addi r11,r1,32 ffc0c800: 4b ff 50 b8 b ffc018b8 <_restgpr_31_x> =============================================================================== ffc0c340 <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { ffc0c340: 94 21 ff e0 stwu r1,-32(r1) ffc0c344: 7c 08 02 a6 mflr r0 ffc0c348: 90 01 00 24 stw r0,36(r1) unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || ffc0c34c: 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 ) { ffc0c350: bf 41 00 08 stmw r26,8(r1) ffc0c354: 7c 7f 1b 78 mr r31,r3 unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || ffc0c358: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c35c: 40 9d 00 7c ble- cr7,ffc0c3d8 <_Scheduler_CBS_Create_server+0x98> ffc0c360: 81 23 00 00 lwz r9,0(r3) ffc0c364: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c368: 40 9d 00 70 ble- cr7,ffc0c3d8 <_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++ ) { ffc0c36c: 3d 20 00 00 lis r9,0 ffc0c370: 81 49 27 d4 lwz r10,10196(r9) if ( !_Scheduler_CBS_Server_list[i] ) ffc0c374: 3d 20 00 00 lis r9,0 ffc0c378: 81 09 28 f4 lwz r8,10484(r9) ffc0c37c: 7c 9a 23 78 mr r26,r4 ffc0c380: 39 4a 00 01 addi r10,r10,1 ffc0c384: 7c bd 2b 78 mr r29,r5 ffc0c388: 7d 49 03 a6 mtctr r10 ffc0c38c: 39 20 00 00 li r9,0 ffc0c390: 48 00 00 18 b ffc0c3a8 <_Scheduler_CBS_Create_server+0x68> #include #include #include #include int _Scheduler_CBS_Create_server ( ffc0c394: 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] ) ffc0c398: 7d 48 e0 2e lwzx r10,r8,r28 ffc0c39c: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0c3a0: 41 9e 00 48 beq- cr7,ffc0c3e8 <_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++ ) { ffc0c3a4: 39 29 00 01 addi r9,r9,1 ffc0c3a8: 42 00 ff ec bdnz+ ffc0c394 <_Scheduler_CBS_Create_server+0x54> if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; ffc0c3ac: 38 60 ff e6 li r3,-26 ffc0c3b0: 48 00 00 6c b ffc0c41c <_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; ffc0c3b4: 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; ffc0c3b8: 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; ffc0c3bc: 81 7f 00 04 lwz r11,4(r31) ffc0c3c0: 91 49 00 04 stw r10,4(r9) the_server->task_id = -1; ffc0c3c4: 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; ffc0c3c8: 91 69 00 08 stw r11,8(r9) the_server->task_id = -1; ffc0c3cc: 91 49 00 00 stw r10,0(r9) the_server->cbs_budget_overrun = budget_overrun_callback; ffc0c3d0: 93 49 00 0c stw r26,12(r9) return SCHEDULER_CBS_OK; ffc0c3d4: 48 00 00 48 b ffc0c41c <_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; ffc0c3d8: 38 60 ff ee li r3,-18 ffc0c3dc: 48 00 00 40 b ffc0c41c <_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; ffc0c3e0: 38 60 ff ef li r3,-17 <== NOT EXECUTED ffc0c3e4: 48 00 00 38 b ffc0c41c <_Scheduler_CBS_Create_server+0xdc><== NOT EXECUTED } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; ffc0c3e8: 91 3d 00 00 stw r9,0(r29) _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) ffc0c3ec: 3f c0 00 00 lis r30,0 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); ffc0c3f0: 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 *) ffc0c3f4: 83 7e 28 f4 lwz r27,10484(r30) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); ffc0c3f8: 48 00 20 c9 bl ffc0e4c0 <_Workspace_Allocate> the_server = _Scheduler_CBS_Server_list[*server_id]; ffc0c3fc: 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 *) ffc0c400: 7c 7b e1 2e stwx r3,r27,r28 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; ffc0c404: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0c408: 81 5e 28 f4 lwz r10,10484(r30) ffc0c40c: 7d 2a 48 2e lwzx r9,r10,r9 if ( !the_server ) ffc0c410: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c414: 40 9e ff a0 bne+ cr7,ffc0c3b4 <_Scheduler_CBS_Create_server+0x74><== ALWAYS TAKEN ffc0c418: 4b ff ff c8 b ffc0c3e0 <_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; } ffc0c41c: 39 61 00 20 addi r11,r1,32 ffc0c420: 4b ff 54 84 b ffc018a4 <_restgpr_26_x> =============================================================================== ffc0c4a8 <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { ffc0c4a8: 94 21 ff d8 stwu r1,-40(r1) ffc0c4ac: 7c 08 02 a6 mflr r0 ffc0c4b0: bf a1 00 1c stmw r29,28(r1) ffc0c4b4: 7c 7d 1b 78 mr r29,r3 ffc0c4b8: 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); ffc0c4bc: 7c 83 23 78 mr r3,r4 int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { ffc0c4c0: 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); ffc0c4c4: 38 81 00 08 addi r4,r1,8 ffc0c4c8: 48 00 0e c5 bl ffc0d38c <_Thread_Get> /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { ffc0c4cc: 7c 7f 1b 79 mr. r31,r3 ffc0c4d0: 41 82 00 08 beq- ffc0c4d8 <_Scheduler_CBS_Detach_thread+0x30> _Thread_Enable_dispatch(); ffc0c4d4: 48 00 0e 9d bl ffc0d370 <_Thread_Enable_dispatch> } if ( server_id >= _Scheduler_CBS_Maximum_servers ) ffc0c4d8: 3d 20 00 00 lis r9,0 ffc0c4dc: 81 29 27 d4 lwz r9,10196(r9) ffc0c4e0: 7f 9d 48 40 cmplw cr7,r29,r9 ffc0c4e4: 40 9c 00 6c bge- cr7,ffc0c550 <_Scheduler_CBS_Detach_thread+0xa8> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) ffc0c4e8: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0c4ec: 41 9e 00 64 beq- cr7,ffc0c550 <_Scheduler_CBS_Detach_thread+0xa8> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) ffc0c4f0: 3d 20 00 00 lis r9,0 ffc0c4f4: 81 29 28 f4 lwz r9,10484(r9) ffc0c4f8: 57 bd 10 3a rlwinm r29,r29,2,0,29 ffc0c4fc: 7d 29 e8 2e lwzx r9,r9,r29 ffc0c500: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c504: 41 9e 00 44 beq- cr7,ffc0c548 <_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 ) ffc0c508: 81 49 00 00 lwz r10,0(r9) ffc0c50c: 7f 8a f0 00 cmpw cr7,r10,r30 ffc0c510: 40 9e 00 40 bne- cr7,ffc0c550 <_Scheduler_CBS_Detach_thread+0xa8><== NEVER TAKEN return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; ffc0c514: 39 40 ff ff li r10,-1 ffc0c518: 91 49 00 00 stw r10,0(r9) sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; ffc0c51c: 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; ffc0c520: 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; ffc0c524: 81 3f 00 88 lwz r9,136(r31) ffc0c528: 91 49 00 18 stw r10,24(r9) the_thread->budget_algorithm = the_thread->Start.budget_algorithm; ffc0c52c: 81 3f 00 a0 lwz r9,160(r31) ffc0c530: 91 3f 00 78 stw r9,120(r31) the_thread->budget_callout = the_thread->Start.budget_callout; ffc0c534: 81 3f 00 a4 lwz r9,164(r31) ffc0c538: 91 3f 00 7c stw r9,124(r31) the_thread->is_preemptible = the_thread->Start.is_preemptible; ffc0c53c: 89 3f 00 9c lbz r9,156(r31) ffc0c540: 99 3f 00 70 stb r9,112(r31) ffc0c544: 48 00 00 10 b ffc0c554 <_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; ffc0c548: 38 60 ff e7 li r3,-25 ffc0c54c: 48 00 00 08 b ffc0c554 <_Scheduler_CBS_Detach_thread+0xac> if ( the_thread ) { _Thread_Enable_dispatch(); } if ( server_id >= _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; ffc0c550: 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; } ffc0c554: 39 61 00 28 addi r11,r1,40 ffc0c558: 4b ff 53 58 b ffc018b0 <_restgpr_29_x> =============================================================================== ffc0c804 <_Scheduler_CBS_Initialize>: int _Scheduler_CBS_Initialize(void) { ffc0c804: 7c 2b 0b 78 mr r11,r1 ffc0c808: 94 21 ff f0 stwu r1,-16(r1) ffc0c80c: 7c 08 02 a6 mflr r0 ffc0c810: 48 01 17 75 bl ffc1df84 <_savegpr_31> unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); ffc0c814: 3f e0 00 00 lis r31,0 ffc0c818: 80 7f 27 d4 lwz r3,10196(r31) sched_info->cbs_server->cbs_budget_overrun( server_id ); } } int _Scheduler_CBS_Initialize(void) { ffc0c81c: 90 01 00 14 stw r0,20(r1) unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( ffc0c820: 54 63 10 3a rlwinm r3,r3,2,0,29 ffc0c824: 48 00 1c 9d bl ffc0e4c0 <_Workspace_Allocate> ffc0c828: 3d 40 00 00 lis r10,0 _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) ffc0c82c: 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( ffc0c830: 90 6a 28 f4 stw r3,10484(r10) _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) ffc0c834: 41 9e 00 38 beq- cr7,ffc0c86c <_Scheduler_CBS_Initialize+0x68><== NEVER TAKEN return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { ffc0c838: 81 1f 27 d4 lwz r8,10196(r31) ffc0c83c: 39 20 00 00 li r9,0 _Scheduler_CBS_Server_list[i] = NULL; ffc0c840: 38 e0 00 00 li r7,0 ffc0c844: 39 08 00 01 addi r8,r8,1 ffc0c848: 7d 09 03 a6 mtctr r8 ffc0c84c: 48 00 00 14 b ffc0c860 <_Scheduler_CBS_Initialize+0x5c> ffc0c850: 81 0a 28 f4 lwz r8,10484(r10) ffc0c854: 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++) { ffc0c858: 39 29 00 01 addi r9,r9,1 _Scheduler_CBS_Server_list[i] = NULL; ffc0c85c: 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++) { ffc0c860: 42 00 ff f0 bdnz+ ffc0c850 <_Scheduler_CBS_Initialize+0x4c> _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; ffc0c864: 38 60 00 00 li r3,0 ffc0c868: 48 00 00 08 b ffc0c870 <_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; ffc0c86c: 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; } ffc0c870: 39 61 00 10 addi r11,r1,16 ffc0c874: 4b ff 50 44 b ffc018b8 <_restgpr_31_x> =============================================================================== ffc0b110 <_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) { ffc0b110: 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; ffc0b114: 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 = ffc0b118: 81 29 00 18 lwz r9,24(r9) ffc0b11c: 2f 89 00 00 cmpwi cr7,r9,0 (Scheduler_CBS_Server *) sched_info->cbs_server; if (deadline) { ffc0b120: 41 82 00 30 beq- ffc0b150 <_Scheduler_CBS_Release_job+0x40> ffc0b124: 3d 40 00 00 lis r10,0 /* Initializing or shifting deadline. */ if (serv_info) ffc0b128: 41 9e 00 18 beq- cr7,ffc0b140 <_Scheduler_CBS_Release_job+0x30> new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) ffc0b12c: 80 8a 28 e8 lwz r4,10472(r10) ffc0b130: 81 49 00 04 lwz r10,4(r9) ffc0b134: 7c 84 52 14 add r4,r4,r10 ffc0b138: 54 84 00 7e clrlwi r4,r4,1 ffc0b13c: 48 00 00 1c b ffc0b158 <_Scheduler_CBS_Release_job+0x48> & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) ffc0b140: 81 2a 28 e8 lwz r9,10472(r10) ffc0b144: 7c 84 4a 14 add r4,r4,r9 ffc0b148: 54 84 00 7e clrlwi r4,r4,1 ffc0b14c: 48 00 00 14 b ffc0b160 <_Scheduler_CBS_Release_job+0x50> & ~SCHEDULER_EDF_PRIO_MSB; } else { /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; ffc0b150: 80 83 00 ac lwz r4,172(r3) } /* Budget replenishment for the next job. */ if (serv_info) ffc0b154: 41 9e 00 0c beq- cr7,ffc0b160 <_Scheduler_CBS_Release_job+0x50><== NEVER TAKEN the_thread->cpu_time_budget = serv_info->parameters.budget; ffc0b158: 81 29 00 08 lwz r9,8(r9) ffc0b15c: 91 23 00 74 stw r9,116(r3) the_thread->real_priority = new_priority; ffc0b160: 90 83 00 18 stw r4,24(r3) _Thread_Change_priority(the_thread, new_priority, true); ffc0b164: 38 a0 00 01 li r5,1 ffc0b168: 48 00 04 f4 b ffc0b65c <_Thread_Change_priority> =============================================================================== ffc0b16c <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { ffc0b16c: 94 21 ff f0 stwu r1,-16(r1) ffc0b170: 7c 08 02 a6 mflr r0 ffc0b174: bf c1 00 08 stmw r30,8(r1) ffc0b178: 7c 7f 1b 78 mr r31,r3 ffc0b17c: 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); ffc0b180: 48 00 01 1d bl ffc0b29c <_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; ffc0b184: 81 3f 00 88 lwz r9,136(r31) ffc0b188: 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) { ffc0b18c: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b190: 41 9e 00 58 beq- cr7,ffc0b1e8 <_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 - ffc0b194: 3d 00 00 00 lis r8,0 ffc0b198: 81 5f 00 18 lwz r10,24(r31) ffc0b19c: 80 e8 28 e8 lwz r7,10472(r8) _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { ffc0b1a0: 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 - ffc0b1a4: 7c e7 50 50 subf r7,r7,r10 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { ffc0b1a8: 7d 07 41 d6 mullw r8,r7,r8 ffc0b1ac: 80 e9 00 08 lwz r7,8(r9) ffc0b1b0: 81 3f 00 74 lwz r9,116(r31) ffc0b1b4: 7d 27 49 d6 mullw r9,r7,r9 ffc0b1b8: 7f 88 48 00 cmpw cr7,r8,r9 ffc0b1bc: 40 9d 00 2c ble- cr7,ffc0b1e8 <_Scheduler_CBS_Unblock+0x7c> /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; ffc0b1c0: 80 9f 00 ac lwz r4,172(r31) if ( the_thread->real_priority != new_priority ) ffc0b1c4: 7f 8a 20 00 cmpw cr7,r10,r4 ffc0b1c8: 41 9e 00 08 beq- cr7,ffc0b1d0 <_Scheduler_CBS_Unblock+0x64> the_thread->real_priority = new_priority; ffc0b1cc: 90 9f 00 18 stw r4,24(r31) if ( the_thread->current_priority != new_priority ) ffc0b1d0: 81 3f 00 14 lwz r9,20(r31) ffc0b1d4: 7f 89 20 00 cmpw cr7,r9,r4 ffc0b1d8: 41 9e 00 10 beq- cr7,ffc0b1e8 <_Scheduler_CBS_Unblock+0x7c> _Thread_Change_priority(the_thread, new_priority, true); ffc0b1dc: 7f e3 fb 78 mr r3,r31 ffc0b1e0: 38 a0 00 01 li r5,1 ffc0b1e4: 48 00 04 79 bl ffc0b65c <_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, ffc0b1e8: 3f c0 00 00 lis r30,0 ffc0b1ec: 80 7f 00 14 lwz r3,20(r31) ffc0b1f0: 3b de 32 40 addi r30,r30,12864 ffc0b1f4: 3d 40 00 00 lis r10,0 ffc0b1f8: 81 3e 00 14 lwz r9,20(r30) ffc0b1fc: 81 4a 20 b0 lwz r10,8368(r10) ffc0b200: 80 89 00 14 lwz r4,20(r9) ffc0b204: 7d 49 03 a6 mtctr r10 ffc0b208: 4e 80 04 21 bctrl ffc0b20c: 2f 83 00 00 cmpwi cr7,r3,0 ffc0b210: 40 9d 00 34 ble- cr7,ffc0b244 <_Scheduler_CBS_Unblock+0xd8> _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || ffc0b214: 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; ffc0b218: 93 fe 00 14 stw r31,20(r30) if ( _Thread_Executing->is_preemptible || ffc0b21c: 89 29 00 70 lbz r9,112(r9) ffc0b220: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b224: 40 9e 00 10 bne- cr7,ffc0b234 <_Scheduler_CBS_Unblock+0xc8> ffc0b228: 81 3f 00 14 lwz r9,20(r31) ffc0b22c: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b230: 40 9e 00 14 bne- cr7,ffc0b244 <_Scheduler_CBS_Unblock+0xd8><== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; ffc0b234: 3d 20 00 00 lis r9,0 ffc0b238: 39 40 00 01 li r10,1 ffc0b23c: 39 29 32 40 addi r9,r9,12864 ffc0b240: 99 49 00 0c stb r10,12(r9) } } ffc0b244: 39 61 00 10 addi r11,r1,16 ffc0b248: 4b ff 59 80 b ffc00bc8 <_restgpr_30_x> =============================================================================== ffc0b0c8 <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { ffc0b0c8: 7c 2b 0b 78 mr r11,r1 ffc0b0cc: 94 21 ff f0 stwu r1,-16(r1) ffc0b0d0: 7c 08 02 a6 mflr r0 ffc0b0d4: 48 01 17 01 bl ffc1c7d4 <_savegpr_31> ffc0b0d8: 7c 7f 1b 78 mr r31,r3 void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); ffc0b0dc: 38 60 00 18 li r3,24 #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { ffc0b0e0: 90 01 00 14 stw r0,20(r1) void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); ffc0b0e4: 48 00 1c 2d bl ffc0cd10 <_Workspace_Allocate> if ( sched ) { ffc0b0e8: 2c 03 00 00 cmpwi r3,0 ffc0b0ec: 41 82 00 14 beq- ffc0b100 <_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; ffc0b0f0: 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; ffc0b0f4: 90 7f 00 88 stw r3,136(r31) schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; ffc0b0f8: 93 e3 00 00 stw r31,0(r3) schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; ffc0b0fc: 91 43 00 14 stw r10,20(r3) } return sched; } ffc0b100: 39 61 00 10 addi r11,r1,16 ffc0b104: 4b ff 5a c8 b ffc00bcc <_restgpr_31_x> =============================================================================== ffc0b2c8 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { ffc0b2c8: 94 21 ff f0 stwu r1,-16(r1) ffc0b2cc: 7c 08 02 a6 mflr r0 ffc0b2d0: 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( ffc0b2d4: 3f c0 00 00 lis r30,0 #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { ffc0b2d8: 7c 7f 1b 78 mr r31,r3 ffc0b2dc: 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( ffc0b2e0: 3b de 32 40 addi r30,r30,12864 void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { _Scheduler_EDF_Enqueue(the_thread); ffc0b2e4: 4b ff fe 75 bl ffc0b158 <_Scheduler_EDF_Enqueue> ffc0b2e8: 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( ffc0b2ec: 81 5e 00 14 lwz r10,20(r30) ffc0b2f0: 81 29 20 b0 lwz r9,8368(r9) ffc0b2f4: 80 6a 00 14 lwz r3,20(r10) ffc0b2f8: 80 9f 00 14 lwz r4,20(r31) ffc0b2fc: 7d 29 03 a6 mtctr r9 ffc0b300: 4e 80 04 21 bctrl ffc0b304: 2f 83 00 00 cmpwi cr7,r3,0 ffc0b308: 40 bc 00 34 bge+ cr7,ffc0b33c <_Scheduler_EDF_Unblock+0x74> _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || ffc0b30c: 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; ffc0b310: 93 fe 00 14 stw r31,20(r30) if ( _Thread_Executing->is_preemptible || ffc0b314: 89 29 00 70 lbz r9,112(r9) ffc0b318: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b31c: 40 9e 00 10 bne- cr7,ffc0b32c <_Scheduler_EDF_Unblock+0x64> ffc0b320: 81 3f 00 14 lwz r9,20(r31) ffc0b324: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b328: 40 9e 00 14 bne- cr7,ffc0b33c <_Scheduler_EDF_Unblock+0x74><== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; ffc0b32c: 3d 20 00 00 lis r9,0 ffc0b330: 39 40 00 01 li r10,1 ffc0b334: 39 29 32 40 addi r9,r9,12864 ffc0b338: 99 49 00 0c stb r10,12(r9) } } ffc0b33c: 39 61 00 10 addi r11,r1,16 ffc0b340: 4b ff 58 88 b ffc00bc8 <_restgpr_30_x> =============================================================================== ffc0a708 <_Scheduler_priority_Block>: ) { Scheduler_priority_Per_thread *sched_info; Chain_Control *ready; sched_info = (Scheduler_priority_Per_thread *) the_thread->scheduler_info; ffc0a708: 81 43 00 88 lwz r10,136(r3) ready = sched_info->ready_chain; ffc0a70c: 81 2a 00 00 lwz r9,0(r10) if ( _Chain_Has_only_one_node( ready ) ) { ffc0a710: 80 e9 00 00 lwz r7,0(r9) ffc0a714: 81 09 00 08 lwz r8,8(r9) ffc0a718: 7f 87 40 00 cmpw cr7,r7,r8 ffc0a71c: 40 be 00 4c bne+ cr7,ffc0a768 <_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 ); ffc0a720: 39 09 00 04 addi r8,r9,4 head->next = tail; head->previous = NULL; tail->previous = head; ffc0a724: 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; ffc0a728: 91 09 00 00 stw r8,0(r9) head->previous = NULL; ffc0a72c: 39 00 00 00 li r8,0 ffc0a730: 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; ffc0a734: 81 0a 00 04 lwz r8,4(r10) ffc0a738: 81 2a 00 14 lwz r9,20(r10) ffc0a73c: 80 e8 00 00 lwz r7,0(r8) ffc0a740: 7c e9 48 38 and r9,r7,r9 if ( *the_priority_map->minor == 0 ) ffc0a744: 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; ffc0a748: 91 28 00 00 stw r9,0(r8) if ( *the_priority_map->minor == 0 ) ffc0a74c: 40 9e 00 2c bne- cr7,ffc0a778 <_Scheduler_priority_Block+0x70> _Priority_Major_bit_map &= the_priority_map->block_major; ffc0a750: 3d 20 00 00 lis r9,0 ffc0a754: 81 4a 00 10 lwz r10,16(r10) ffc0a758: 81 09 28 94 lwz r8,10388(r9) ffc0a75c: 7d 0a 50 38 and r10,r8,r10 ffc0a760: 91 49 28 94 stw r10,10388(r9) ffc0a764: 48 00 00 14 b ffc0a778 <_Scheduler_priority_Block+0x70> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; ffc0a768: 81 23 00 00 lwz r9,0(r3) previous = the_node->previous; ffc0a76c: 81 43 00 04 lwz r10,4(r3) next->previous = previous; ffc0a770: 91 49 00 04 stw r10,4(r9) previous->next = next; ffc0a774: 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 ); ffc0a778: 3d 20 00 00 lis r9,0 { _Scheduler_priority_Ready_queue_extract( the_thread ); /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) ffc0a77c: 81 29 31 b4 lwz r9,12724(r9) ffc0a780: 7f 83 48 00 cmpw cr7,r3,r9 ffc0a784: 40 be 00 60 bne+ cr7,ffc0a7e4 <_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 ffc0a788: 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 ); ffc0a78c: 3c e0 00 00 lis r7,0 ffc0a790: 81 49 20 80 lwz r10,8320(r9) ffc0a794: 81 27 28 94 lwz r9,10388(r7) ffc0a798: 7d 28 00 34 cntlzw r8,r9 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); ffc0a79c: 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 ); ffc0a7a0: 91 27 28 94 stw r9,10388(r7) _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); ffc0a7a4: 38 c6 31 e0 addi r6,r6,12768 ffc0a7a8: 55 07 10 3a rlwinm r7,r8,2,0,29 ffc0a7ac: 7d 26 38 2e lwzx r9,r6,r7 ffc0a7b0: 7d 25 00 34 cntlzw r5,r9 ffc0a7b4: 7d 26 39 2e stwx r9,r6,r7 return (_Priority_Bits_index( major ) << 4) + ffc0a7b8: 55 09 20 36 rlwinm r9,r8,4,0,27 ffc0a7bc: 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 ] ) ) ffc0a7c0: 1d 29 00 0c mulli r9,r9,12 ffc0a7c4: 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; ffc0a7c8: 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 ); ffc0a7cc: 39 48 00 04 addi r10,r8,4 ffc0a7d0: 7f 89 50 00 cmpw cr7,r9,r10 ffc0a7d4: 40 be 00 08 bne+ cr7,ffc0a7dc <_Scheduler_priority_Block+0xd4><== ALWAYS TAKEN return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; ffc0a7d8: 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( ffc0a7dc: 3d 40 00 00 lis r10,0 ffc0a7e0: 91 2a 31 b4 stw r9,12724(r10) RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); ffc0a7e4: 3d 20 00 00 lis r9,0 ffc0a7e8: 39 29 31 a0 addi r9,r9,12704 _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) ffc0a7ec: 81 49 00 10 lwz r10,16(r9) ffc0a7f0: 7f 83 50 00 cmpw cr7,r3,r10 ffc0a7f4: 4c be 00 20 bnelr+ cr7 _Thread_Dispatch_necessary = true; ffc0a7f8: 39 40 00 01 li r10,1 ffc0a7fc: 99 49 00 0c stb r10,12(r9) ffc0a800: 4e 80 00 20 blr =============================================================================== ffc0a9b8 <_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 ffc0a9b8: 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 ); ffc0a9bc: 3c e0 00 00 lis r7,0 ffc0a9c0: 81 49 20 80 lwz r10,8320(r9) ffc0a9c4: 81 27 28 94 lwz r9,10388(r7) ffc0a9c8: 7d 28 00 34 cntlzw r8,r9 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); ffc0a9cc: 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 ); ffc0a9d0: 91 27 28 94 stw r9,10388(r7) _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); ffc0a9d4: 38 c6 31 e0 addi r6,r6,12768 ffc0a9d8: 55 07 10 3a rlwinm r7,r8,2,0,29 ffc0a9dc: 7d 26 38 2e lwzx r9,r6,r7 ffc0a9e0: 7d 25 00 34 cntlzw r5,r9 ffc0a9e4: 7d 26 39 2e stwx r9,r6,r7 return (_Priority_Bits_index( major ) << 4) + ffc0a9e8: 55 09 20 36 rlwinm r9,r8,4,0,27 ffc0a9ec: 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 ] ) ) ffc0a9f0: 1d 29 00 0c mulli r9,r9,12 ffc0a9f4: 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; ffc0a9f8: 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 ); ffc0a9fc: 39 48 00 04 addi r10,r8,4 ffc0aa00: 7f 89 50 00 cmpw cr7,r9,r10 ffc0aa04: 40 be 00 08 bne+ cr7,ffc0aa0c <_Scheduler_priority_Schedule+0x54><== ALWAYS TAKEN return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; ffc0aa08: 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( ffc0aa0c: 3d 40 00 00 lis r10,0 ffc0aa10: 91 2a 31 b4 stw r9,12724(r10) ffc0aa14: 4e 80 00 20 blr =============================================================================== ffc0aa18 <_Scheduler_priority_Tick>: #include #include void _Scheduler_priority_Tick( void ) { ffc0aa18: 7c 2b 0b 78 mr r11,r1 ffc0aa1c: 7c 08 02 a6 mflr r0 ffc0aa20: 94 21 ff f0 stwu r1,-16(r1) Thread_Control *executing; executing = _Thread_Executing; ffc0aa24: 3d 20 00 00 lis r9,0 #include #include void _Scheduler_priority_Tick( void ) { ffc0aa28: 90 01 00 14 stw r0,20(r1) ffc0aa2c: 48 01 03 91 bl ffc1adbc <_savegpr_31> Thread_Control *executing; executing = _Thread_Executing; ffc0aa30: 83 e9 31 b0 lwz r31,12720(r9) /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) ffc0aa34: 89 3f 00 70 lbz r9,112(r31) ffc0aa38: 2f 89 00 00 cmpwi cr7,r9,0 ffc0aa3c: 41 9e 00 98 beq- cr7,ffc0aad4 <_Scheduler_priority_Tick+0xbc> return; if ( !_States_Is_ready( executing->current_state ) ) ffc0aa40: 81 3f 00 10 lwz r9,16(r31) ffc0aa44: 2f 89 00 00 cmpwi cr7,r9,0 ffc0aa48: 40 9e 00 8c bne- cr7,ffc0aad4 <_Scheduler_priority_Tick+0xbc> /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { ffc0aa4c: 81 3f 00 78 lwz r9,120(r31) ffc0aa50: 2b 89 00 01 cmplwi cr7,r9,1 ffc0aa54: 41 9c 00 80 blt- cr7,ffc0aad4 <_Scheduler_priority_Tick+0xbc> ffc0aa58: 2b 89 00 02 cmplwi cr7,r9,2 ffc0aa5c: 40 9d 00 10 ble- cr7,ffc0aa6c <_Scheduler_priority_Tick+0x54> ffc0aa60: 2f 89 00 03 cmpwi cr7,r9,3 ffc0aa64: 40 be 00 70 bne+ cr7,ffc0aad4 <_Scheduler_priority_Tick+0xbc><== NEVER TAKEN ffc0aa68: 48 00 00 38 b ffc0aaa0 <_Scheduler_priority_Tick+0x88> case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: #endif if ( (int)(--executing->cpu_time_budget) <= 0 ) { ffc0aa6c: 81 3f 00 74 lwz r9,116(r31) ffc0aa70: 39 29 ff ff addi r9,r9,-1 ffc0aa74: 2f 89 00 00 cmpwi cr7,r9,0 ffc0aa78: 91 3f 00 74 stw r9,116(r31) ffc0aa7c: 41 bd 00 58 bgt+ cr7,ffc0aad4 <_Scheduler_priority_Tick+0xbc> * always operates on the scheduler that 'owns' the currently executing * thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void ) { _Scheduler.Operations.yield(); ffc0aa80: 3d 20 00 00 lis r9,0 ffc0aa84: 81 29 20 8c lwz r9,8332(r9) ffc0aa88: 7d 29 03 a6 mtctr r9 ffc0aa8c: 4e 80 04 21 bctrl * executing thread's timeslice is reset. Otherwise, the * currently executing thread is placed at the rear of the * FIFO for this priority and a new heir is selected. */ _Scheduler_Yield(); executing->cpu_time_budget = _Thread_Ticks_per_timeslice; ffc0aa90: 3d 20 00 00 lis r9,0 ffc0aa94: 81 29 28 64 lwz r9,10340(r9) ffc0aa98: 91 3f 00 74 stw r9,116(r31) ffc0aa9c: 48 00 00 38 b ffc0aad4 <_Scheduler_priority_Tick+0xbc> } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) ffc0aaa0: 81 3f 00 74 lwz r9,116(r31) ffc0aaa4: 39 29 ff ff addi r9,r9,-1 ffc0aaa8: 2f 89 00 00 cmpwi cr7,r9,0 ffc0aaac: 91 3f 00 74 stw r9,116(r31) ffc0aab0: 40 be 00 24 bne+ cr7,ffc0aad4 <_Scheduler_priority_Tick+0xbc> (*executing->budget_callout)( executing ); ffc0aab4: 81 3f 00 7c lwz r9,124(r31) ffc0aab8: 7f e3 fb 78 mr r3,r31 break; #endif } } ffc0aabc: 80 01 00 14 lwz r0,20(r1) break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) (*executing->budget_callout)( executing ); ffc0aac0: 7d 29 03 a6 mtctr r9 break; #endif } } ffc0aac4: 83 e1 00 0c lwz r31,12(r1) ffc0aac8: 7c 08 03 a6 mtlr r0 ffc0aacc: 38 21 00 10 addi r1,r1,16 break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) (*executing->budget_callout)( executing ); ffc0aad0: 4e 80 04 20 bctr break; #endif } } ffc0aad4: 39 61 00 10 addi r11,r1,16 ffc0aad8: 4b ff 5a ec b ffc005c4 <_restgpr_31_x> =============================================================================== ffc095c8 <_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(); ffc095c8: 3d 20 ff c2 lis r9,-62 ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / ffc095cc: 81 29 e2 04 lwz r9,-7676(r9) ffc095d0: 3d 00 00 0f lis r8,15 ffc095d4: 61 08 42 40 ori r8,r8,16960 ffc095d8: 7d 08 4b 96 divwu r8,r8,r9 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || ffc095dc: 7c 69 1b 79 mr. r9,r3 ffc095e0: 41 82 00 90 beq- ffc09670 <_TOD_Validate+0xa8> <== NEVER TAKEN ffc095e4: 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; ffc095e8: 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) || ffc095ec: 7f 8a 40 40 cmplw cr7,r10,r8 ffc095f0: 4c 9c 00 20 bgelr cr7 (the_tod->ticks >= ticks_per_second) || ffc095f4: 81 49 00 14 lwz r10,20(r9) ffc095f8: 2b 8a 00 3b cmplwi cr7,r10,59 ffc095fc: 4d 9d 00 20 bgtlr cr7 (the_tod->second >= TOD_SECONDS_PER_MINUTE) || ffc09600: 81 49 00 10 lwz r10,16(r9) ffc09604: 2b 8a 00 3b cmplwi cr7,r10,59 ffc09608: 4d 9d 00 20 bgtlr cr7 (the_tod->minute >= TOD_MINUTES_PER_HOUR) || ffc0960c: 81 49 00 0c lwz r10,12(r9) ffc09610: 2b 8a 00 17 cmplwi cr7,r10,23 ffc09614: 4d 9d 00 20 bgtlr cr7 (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || ffc09618: 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) || ffc0961c: 2f 8a 00 00 cmpwi cr7,r10,0 ffc09620: 4d 9e 00 20 beqlr cr7 (the_tod->month == 0) || ffc09624: 2b 8a 00 0c cmplwi cr7,r10,12 ffc09628: 4d 9d 00 20 bgtlr cr7 (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || ffc0962c: 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) || ffc09630: 2b 88 07 c3 cmplwi cr7,r8,1987 ffc09634: 4c 9d 00 20 blelr cr7 (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) ffc09638: 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) || ffc0963c: 2f 89 00 00 cmpwi cr7,r9,0 ffc09640: 4d 9e 00 20 beqlr cr7 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) ffc09644: 71 07 00 03 andi. r7,r8,3 ffc09648: 3c e0 ff c2 lis r7,-62 ffc0964c: 39 07 f9 48 addi r8,r7,-1720 ffc09650: 40 82 00 08 bne- ffc09658 <_TOD_Validate+0x90> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; ffc09654: 39 4a 00 0d addi r10,r10,13 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; ffc09658: 55 4a 10 3a rlwinm r10,r10,2,0,29 ffc0965c: 7c 68 50 2e lwzx r3,r8,r10 if ( the_tod->day > days_in_month ) ffc09660: 7c 69 18 10 subfc r3,r9,r3 ffc09664: 38 60 00 00 li r3,0 ffc09668: 7c 63 19 14 adde r3,r3,r3 ffc0966c: 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; ffc09670: 38 60 00 00 li r3,0 <== NOT EXECUTED if ( the_tod->day > days_in_month ) return false; return true; } ffc09674: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc0ace4 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { ffc0ace4: 94 21 ff e0 stwu r1,-32(r1) ffc0ace8: 7c 08 02 a6 mflr r0 ffc0acec: 90 01 00 24 stw r0,36(r1) ffc0acf0: bf 81 00 10 stmw r28,16(r1) ffc0acf4: 7c 7f 1b 78 mr r31,r3 ffc0acf8: 7c bd 2b 78 mr r29,r5 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; ffc0acfc: 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 ); ffc0ad00: 90 81 00 08 stw r4,8(r1) ffc0ad04: 48 00 0e dd bl ffc0bbe0 <_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 ) ffc0ad08: 81 3f 00 14 lwz r9,20(r31) ffc0ad0c: 80 81 00 08 lwz r4,8(r1) ffc0ad10: 7f 89 20 00 cmpw cr7,r9,r4 ffc0ad14: 41 9e 00 0c beq- cr7,ffc0ad20 <_Thread_Change_priority+0x3c> _Thread_Set_priority( the_thread, new_priority ); ffc0ad18: 7f e3 fb 78 mr r3,r31 ffc0ad1c: 48 00 0e 55 bl ffc0bb70 <_Thread_Set_priority> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0ad20: 7f c0 00 a6 mfmsr r30 ffc0ad24: 7d 30 42 a6 mfsprg r9,0 ffc0ad28: 7f c9 48 78 andc r9,r30,r9 ffc0ad2c: 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; ffc0ad30: 81 5f 00 10 lwz r10,16(r31) ffc0ad34: 57 89 07 7a rlwinm r9,r28,0,29,29 if ( state != STATES_TRANSIENT ) { ffc0ad38: 2f 8a 00 04 cmpwi cr7,r10,4 ffc0ad3c: 41 9e 00 44 beq- cr7,ffc0ad80 <_Thread_Change_priority+0x9c> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) ffc0ad40: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ad44: 40 9e 00 0c bne- cr7,ffc0ad50 <_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); ffc0ad48: 55 49 07 b8 rlwinm r9,r10,0,30,28 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); ffc0ad4c: 91 3f 00 10 stw r9,16(r31) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0ad50: 7f c0 01 24 mtmsr r30 _ISR_Enable( level ); if ( _States_Is_waiting_on_thread_queue( state ) ) { ffc0ad54: 3d 20 00 03 lis r9,3 ffc0ad58: 61 29 be e0 ori r9,r9,48864 ffc0ad5c: 7d 48 48 39 and. r8,r10,r9 ffc0ad60: 41 a2 00 a0 beq+ ffc0ae00 <_Thread_Change_priority+0x11c> if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; _ISR_Enable( level ); } ffc0ad64: 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 ); ffc0ad68: 7f e4 fb 78 mr r4,r31 ffc0ad6c: 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 ); } ffc0ad70: 7c 08 03 a6 mtlr r0 ffc0ad74: bb 81 00 10 lmw r28,16(r1) ffc0ad78: 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 ); ffc0ad7c: 48 00 0d 3c b ffc0bab8 <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { ffc0ad80: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ad84: 40 9e 00 30 bne- cr7,ffc0adb4 <_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 ) ffc0ad88: 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 ); ffc0ad8c: 91 3f 00 10 stw r9,16(r31) ffc0ad90: 3d 20 00 00 lis r9,0 ffc0ad94: 39 29 20 80 addi r9,r9,8320 if ( prepend_it ) ffc0ad98: 41 9e 00 0c beq- cr7,ffc0ada4 <_Thread_Change_priority+0xc0> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); ffc0ad9c: 81 29 00 28 lwz r9,40(r9) ffc0ada0: 48 00 00 08 b ffc0ada8 <_Thread_Change_priority+0xc4> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); ffc0ada4: 81 29 00 24 lwz r9,36(r9) ffc0ada8: 7f e3 fb 78 mr r3,r31 ffc0adac: 7d 29 03 a6 mtctr r9 ffc0adb0: 4e 80 04 21 bctrl static inline void ppc_interrupt_flash( uint32_t level ) { uint32_t current_level; __asm__ volatile ( ffc0adb4: 7d 20 00 a6 mfmsr r9 ffc0adb8: 7f c0 01 24 mtmsr r30 ffc0adbc: 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(); ffc0adc0: 3d 20 00 00 lis r9,0 ffc0adc4: 81 29 20 88 lwz r9,8328(r9) ffc0adc8: 7d 29 03 a6 mtctr r9 ffc0adcc: 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 ); ffc0add0: 3d 20 00 00 lis r9,0 ffc0add4: 39 29 31 a0 addi r9,r9,12704 ffc0add8: 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() && ffc0addc: 81 09 00 14 lwz r8,20(r9) ffc0ade0: 7f 8a 40 00 cmpw cr7,r10,r8 ffc0ade4: 41 9e 00 18 beq- cr7,ffc0adfc <_Thread_Change_priority+0x118> ffc0ade8: 89 4a 00 70 lbz r10,112(r10) ffc0adec: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0adf0: 41 9e 00 0c beq- cr7,ffc0adfc <_Thread_Change_priority+0x118> _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; ffc0adf4: 39 40 00 01 li r10,1 ffc0adf8: 99 49 00 0c stb r10,12(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0adfc: 7f c0 01 24 mtmsr r30 _ISR_Enable( level ); } ffc0ae00: 39 61 00 20 addi r11,r1,32 ffc0ae04: 4b ff 57 b4 b ffc005b8 <_restgpr_28_x> =============================================================================== ffc0b020 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { ffc0b020: 94 21 ff e8 stwu r1,-24(r1) ffc0b024: 7c 08 02 a6 mflr r0 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0b028: 38 81 00 08 addi r4,r1,8 void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { ffc0b02c: 90 01 00 1c stw r0,28(r1) Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0b030: 48 00 02 15 bl ffc0b244 <_Thread_Get> switch ( location ) { ffc0b034: 81 21 00 08 lwz r9,8(r1) ffc0b038: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b03c: 40 9e 00 20 bne- cr7,ffc0b05c <_Thread_Delay_ended+0x3c><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( ffc0b040: 3c 80 10 00 lis r4,4096 ffc0b044: 60 84 00 18 ori r4,r4,24 ffc0b048: 4b ff fd c1 bl ffc0ae08 <_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; ffc0b04c: 3d 20 00 00 lis r9,0 ffc0b050: 81 49 28 68 lwz r10,10344(r9) --level; ffc0b054: 39 4a ff ff addi r10,r10,-1 _Thread_Dispatch_disable_level = level; ffc0b058: 91 49 28 68 stw r10,10344(r9) | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } ffc0b05c: 80 01 00 1c lwz r0,28(r1) ffc0b060: 38 21 00 18 addi r1,r1,24 ffc0b064: 7c 08 03 a6 mtlr r0 ffc0b068: 4e 80 00 20 blr =============================================================================== ffc0b06c <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { ffc0b06c: 94 21 ff b8 stwu r1,-72(r1) ffc0b070: 7c 08 02 a6 mflr r0 ffc0b074: 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; ffc0b078: 3f e0 00 00 lis r31,0 ffc0b07c: 39 3f 31 a0 addi r9,r31,12704 #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { ffc0b080: 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; ffc0b084: 82 c9 00 10 lwz r22,16(r9) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0b088: 7d 40 00 a6 mfmsr r10 ffc0b08c: 7d 30 42 a6 mfsprg r9,0 ffc0b090: 7d 49 48 78 andc r9,r10,r9 ffc0b094: 7d 20 01 24 mtmsr r9 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); ffc0b098: 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 ) { ffc0b09c: 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; ffc0b0a0: 3f c0 00 00 lis r30,0 ffc0b0a4: 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; ffc0b0a8: 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; ffc0b0ac: 3f 60 00 00 lis r27,0 ffc0b0b0: 3b 5a 2c 68 addi r26,r26,11368 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { ffc0b0b4: 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; ffc0b0b8: 3f 00 00 00 lis r24,0 ffc0b0bc: 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 ) { ffc0b0c0: 48 00 01 30 b ffc0b1f0 <_Thread_Dispatch+0x184> heir = _Thread_Heir; ffc0b0c4: 82 a9 00 14 lwz r21,20(r9) ffc0b0c8: 93 be 28 68 stw r29,10344(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 ) ffc0b0cc: 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; ffc0b0d0: 9b 89 00 0c stb r28,12(r9) _Thread_Executing = heir; ffc0b0d4: 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 ) ffc0b0d8: 40 be 00 28 bne+ cr7,ffc0b100 <_Thread_Dispatch+0x94> ffc0b0dc: 39 00 00 00 li r8,0 ffc0b0e0: 3d 20 00 00 lis r9,0 ffc0b0e4: 91 09 28 68 stw r8,10344(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0b0e8: 7d 40 01 24 mtmsr r10 ffc0b0ec: 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 ) { ffc0b0f0: 3f c0 00 00 lis r30,0 ffc0b0f4: 83 e9 2d 90 lwz r31,11664(r9) ffc0b0f8: 3b de 2d 94 addi r30,r30,11668 ffc0b0fc: 48 00 01 1c b ffc0b218 <_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 ) ffc0b100: 81 35 00 78 lwz r9,120(r21) ffc0b104: 2f 89 00 01 cmpwi cr7,r9,1 ffc0b108: 40 be 00 0c bne+ cr7,ffc0b114 <_Thread_Dispatch+0xa8> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; ffc0b10c: 81 3b 28 64 lwz r9,10340(r27) ffc0b110: 91 35 00 74 stw r9,116(r21) ffc0b114: 7d 40 01 24 mtmsr r10 ffc0b118: 38 61 00 08 addi r3,r1,8 ffc0b11c: 7f 44 d3 78 mr r4,r26 ffc0b120: 4b ff e7 9d bl ffc098bc <_TOD_Get_with_nanoseconds> #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( ffc0b124: 38 bf 31 a0 addi r5,r31,12704 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; ffc0b128: 81 05 00 20 lwz r8,32(r5) ffc0b12c: 81 25 00 24 lwz r9,36(r5) ffc0b130: 81 41 00 08 lwz r10,8(r1) ffc0b134: 81 61 00 0c lwz r11,12(r1) ffc0b138: 7c e9 58 10 subfc r7,r9,r11 ffc0b13c: 7c c8 51 10 subfe r6,r8,r10 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; ffc0b140: 81 16 00 80 lwz r8,128(r22) ffc0b144: 81 36 00 84 lwz r9,132(r22) ffc0b148: 7d 29 38 14 addc r9,r9,r7 ffc0b14c: 7d 08 31 14 adde r8,r8,r6 ffc0b150: 91 36 00 84 stw r9,132(r22) #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { ffc0b154: 81 39 28 70 lwz r9,10352(r25) ffc0b158: 91 16 00 80 stw r8,128(r22) ffc0b15c: 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; ffc0b160: 91 45 00 20 stw r10,32(r5) ffc0b164: 91 65 00 24 stw r11,36(r5) #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { ffc0b168: 41 9e 00 14 beq- cr7,ffc0b17c <_Thread_Dispatch+0x110> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; ffc0b16c: 81 49 00 00 lwz r10,0(r9) ffc0b170: 91 56 01 48 stw r10,328(r22) *_Thread_libc_reent = heir->libc_reent; ffc0b174: 81 55 01 48 lwz r10,328(r21) ffc0b178: 91 49 00 00 stw r10,0(r9) ffc0b17c: 82 98 22 08 lwz r20,8712(r24) ffc0b180: 48 00 00 1c b ffc0b19c <_Thread_Dispatch+0x130> const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); ffc0b184: 81 34 00 08 lwz r9,8(r20) ffc0b188: 7e c3 b3 78 mr r3,r22 ffc0b18c: 7e a4 ab 78 mr r4,r21 ffc0b190: 7d 29 03 a6 mtctr r9 ffc0b194: 4e 80 04 21 bctrl #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } ffc0b198: 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 ) { ffc0b19c: 7f 94 b8 00 cmpw cr7,r20,r23 ffc0b1a0: 40 9e ff e4 bne+ cr7,ffc0b184 <_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 ) ffc0b1a4: 81 36 01 44 lwz r9,324(r22) ffc0b1a8: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b1ac: 41 9e 00 0c beq- cr7,ffc0b1b8 <_Thread_Dispatch+0x14c> _Context_Save_fp( &executing->fp_context ); ffc0b1b0: 38 76 01 44 addi r3,r22,324 ffc0b1b4: 48 00 fc cd bl ffc1ae80 <_CPU_Context_save_fp> #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); ffc0b1b8: 38 76 00 c4 addi r3,r22,196 ffc0b1bc: 38 95 00 c4 addi r4,r21,196 ffc0b1c0: 48 00 fe 41 bl ffc1b000 <_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 ) ffc0b1c4: 81 36 01 44 lwz r9,324(r22) ffc0b1c8: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b1cc: 41 9e 00 0c beq- cr7,ffc0b1d8 <_Thread_Dispatch+0x16c> _Context_Restore_fp( &executing->fp_context ); ffc0b1d0: 38 76 01 44 addi r3,r22,324 ffc0b1d4: 48 00 fd 6d bl ffc1af40 <_CPU_Context_restore_fp> #endif #endif executing = _Thread_Executing; ffc0b1d8: 39 3f 31 a0 addi r9,r31,12704 ffc0b1dc: 82 c9 00 10 lwz r22,16(r9) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0b1e0: 7d 40 00 a6 mfmsr r10 ffc0b1e4: 7d 30 42 a6 mfsprg r9,0 ffc0b1e8: 7d 49 48 78 andc r9,r10,r9 ffc0b1ec: 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 ) { ffc0b1f0: 39 3f 31 a0 addi r9,r31,12704 ffc0b1f4: 89 09 00 0c lbz r8,12(r9) ffc0b1f8: 2f 88 00 00 cmpwi cr7,r8,0 ffc0b1fc: 40 9e fe c8 bne+ cr7,ffc0b0c4 <_Thread_Dispatch+0x58> ffc0b200: 4b ff fe dc b ffc0b0dc <_Thread_Dispatch+0x70> const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); ffc0b204: 81 3f 00 08 lwz r9,8(r31) ffc0b208: 7e c3 b3 78 mr r3,r22 ffc0b20c: 7d 29 03 a6 mtctr r9 ffc0b210: 4e 80 04 21 bctrl #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } ffc0b214: 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 ) { ffc0b218: 7f 9f f0 00 cmpw cr7,r31,r30 ffc0b21c: 40 9e ff e8 bne+ cr7,ffc0b204 <_Thread_Dispatch+0x198> ffc0b220: 39 61 00 48 addi r11,r1,72 ffc0b224: 4b ff 53 74 b ffc00598 <_restgpr_20_x> =============================================================================== ffc1035c <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { ffc1035c: 94 21 ff f0 stwu r1,-16(r1) ffc10360: 7c 08 02 a6 mflr r0 #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; ffc10364: 3d 20 00 00 lis r9,0 #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { ffc10368: 90 01 00 14 stw r0,20(r1) ffc1036c: bf c1 00 08 stmw r30,8(r1) #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; ffc10370: 83 e9 31 b0 lwz r31,12720(r9) /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; ffc10374: 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); ffc10378: 39 20 00 00 li r9,0 ffc1037c: 7d 20 00 a6 mfmsr r9 if (!(level & CPU_MODES_INTERRUPT_MASK)) { ffc10380: 71 48 00 01 andi. r8,r10,1 static inline uint32_t ppc_interrupt_get_disable_mask( void ) { uint32_t mask; __asm__ volatile ( ffc10384: 7d 50 42 a6 mfsprg r10,0 ffc10388: 40 a2 00 0c bne+ ffc10394 <_Thread_Handler+0x38> msr |= ppc_interrupt_get_disable_mask(); ffc1038c: 7d 49 4b 78 or r9,r10,r9 ffc10390: 48 00 00 08 b ffc10398 <_Thread_Handler+0x3c> } else { msr &= ~ppc_interrupt_get_disable_mask(); ffc10394: 7d 29 50 78 andc r9,r9,r10 } _CPU_MSR_SET(msr); ffc10398: 7d 20 01 24 mtmsr r9 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; ffc1039c: 3d 20 00 00 lis r9,0 ffc103a0: 8b c9 2a 3c lbz r30,10812(r9) ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( ffc103a4: 3c 80 ff c1 lis r4,-63 doneConstructors = true; ffc103a8: 39 40 00 01 li r10,1 ffc103ac: 7f e3 fb 78 mr r3,r31 ffc103b0: 99 49 2a 3c stb r10,10812(r9) ffc103b4: 38 84 be 24 addi r4,r4,-16860 ffc103b8: 4b ff ba b9 bl ffc0be70 <_User_extensions_Iterate> _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); ffc103bc: 4b ff ae 6d bl ffc0b228 <_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) */ { ffc103c0: 2f 9e 00 00 cmpwi cr7,r30,0 ffc103c4: 40 be 00 08 bne+ cr7,ffc103cc <_Thread_Handler+0x70> INIT_NAME (); ffc103c8: 48 00 bb 75 bl ffc1bf3c <_init> _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { ffc103cc: 81 3f 00 90 lwz r9,144(r31) ffc103d0: 2f 89 00 00 cmpwi cr7,r9,0 ffc103d4: 40 be 00 10 bne+ cr7,ffc103e4 <_Thread_Handler+0x88> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( ffc103d8: 81 3f 00 8c lwz r9,140(r31) ffc103dc: 80 7f 00 98 lwz r3,152(r31) ffc103e0: 48 00 00 14 b ffc103f4 <_Thread_Handler+0x98> executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { ffc103e4: 2f 89 00 01 cmpwi cr7,r9,1 ffc103e8: 40 be 00 18 bne+ cr7,ffc10400 <_Thread_Handler+0xa4> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( ffc103ec: 81 3f 00 8c lwz r9,140(r31) ffc103f0: 80 7f 00 94 lwz r3,148(r31) ffc103f4: 7d 29 03 a6 mtctr r9 ffc103f8: 4e 80 04 21 bctrl executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = ffc103fc: 90 7f 00 28 stw r3,40(r31) } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( ffc10400: 3c 80 ff c1 lis r4,-63 ffc10404: 7f e3 fb 78 mr r3,r31 ffc10408: 38 84 be 38 addi r4,r4,-16840 ffc1040c: 4b ff ba 65 bl ffc0be70 <_User_extensions_Iterate> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( ffc10410: 38 60 00 00 li r3,0 ffc10414: 38 80 00 01 li r4,1 ffc10418: 38 a0 00 05 li r5,5 ffc1041c: 4b ff 99 b5 bl ffc09dd0 <_Internal_error_Occurred> =============================================================================== ffc0b518 <_Thread_Handler_initialization>: #include #endif void _Thread_Handler_initialization(void) { uint32_t ticks_per_timeslice = ffc0b518: 3d 20 ff c2 lis r9,-62 #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { ffc0b51c: 94 21 ff f0 stwu r1,-16(r1) uint32_t ticks_per_timeslice = ffc0b520: 39 29 bf 98 addi r9,r9,-16488 #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { ffc0b524: 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 || ffc0b528: 81 09 00 28 lwz r8,40(r9) #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { ffc0b52c: 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 || ffc0b530: 2f 88 00 00 cmpwi cr7,r8,0 #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { ffc0b534: 90 01 00 14 stw r0,20(r1) uint32_t ticks_per_timeslice = ffc0b538: 83 e9 00 14 lwz r31,20(r9) rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = ffc0b53c: 83 c9 00 08 lwz r30,8(r9) rtems_configuration_get_maximum_extensions(); rtems_stack_allocate_init_hook stack_allocate_init_hook = ffc0b540: 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 || ffc0b544: 41 9e 00 10 beq- cr7,ffc0b554 <_Thread_Handler_initialization+0x3c><== NEVER TAKEN ffc0b548: 81 09 00 2c lwz r8,44(r9) ffc0b54c: 2f 88 00 00 cmpwi cr7,r8,0 ffc0b550: 40 be 00 14 bne+ cr7,ffc0b564 <_Thread_Handler_initialization+0x4c> rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( ffc0b554: 38 60 00 00 li r3,0 ffc0b558: 38 80 00 01 li r4,1 ffc0b55c: 38 a0 00 0e li r5,14 ffc0b560: 4b ff e8 71 bl ffc09dd0 <_Internal_error_Occurred> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) ffc0b564: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0b568: 41 9e 00 10 beq- cr7,ffc0b578 <_Thread_Handler_initialization+0x60> (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); ffc0b56c: 80 69 00 04 lwz r3,4(r9) ffc0b570: 7d 49 03 a6 mtctr r10 ffc0b574: 4e 80 04 21 bctrl _Thread_Dispatch_necessary = false; ffc0b578: 3d 40 00 00 lis r10,0 false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } ffc0b57c: 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; ffc0b580: 39 4a 31 a0 addi r10,r10,12704 ffc0b584: 39 20 00 00 li r9,0 false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } ffc0b588: 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; ffc0b58c: 99 2a 00 0c stb r9,12(r10) _Thread_Executing = NULL; ffc0b590: 39 20 00 00 li r9,0 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0b594: 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; ffc0b598: 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( ffc0b59c: 38 63 2d f4 addi r3,r3,11764 ffc0b5a0: 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; ffc0b5a4: 91 2a 00 14 stw r9,20(r10) #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; ffc0b5a8: 3d 40 00 00 lis r10,0 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0b5ac: 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; ffc0b5b0: 91 2a 28 6c stw r9,10348(r10) #endif _Thread_Maximum_extensions = maximum_extensions; ffc0b5b4: 3d 20 00 00 lis r9,0 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0b5b8: 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; ffc0b5bc: 93 c9 28 74 stw r30,10356(r9) _Thread_Ticks_per_timeslice = ticks_per_timeslice; ffc0b5c0: 3d 20 00 00 lis r9,0 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0b5c4: 38 e0 01 60 li r7,352 _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; ffc0b5c8: 93 e9 28 64 stw r31,10340(r9) #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0b5cc: 39 00 00 00 li r8,0 ffc0b5d0: 39 20 00 08 li r9,8 false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } ffc0b5d4: bb c1 00 08 lmw r30,8(r1) ffc0b5d8: 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( ffc0b5dc: 4b ff ed e0 b ffc0a3bc <_Objects_Initialize_information> =============================================================================== ffc0b2d8 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { ffc0b2d8: 94 21 ff c0 stwu r1,-64(r1) ffc0b2dc: 7c 08 02 a6 mflr r0 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; ffc0b2e0: 39 60 00 00 li r11,0 Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { ffc0b2e4: be e1 00 1c stmw r23,28(r1) if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { ffc0b2e8: 7c bd 2b 79 mr. r29,r5 Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { ffc0b2ec: 7d 3a 4b 78 mr r26,r9 ffc0b2f0: 90 01 00 44 stw r0,68(r1) ffc0b2f4: 7c 78 1b 78 mr r24,r3 ffc0b2f8: 7c 9f 23 78 mr r31,r4 ffc0b2fc: 81 21 00 50 lwz r9,80(r1) ffc0b300: 7c de 33 78 mr r30,r6 ffc0b304: 7c f7 3b 78 mr r23,r7 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; ffc0b308: 91 64 01 4c stw r11,332(r4) Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { ffc0b30c: 7d 1c 43 78 mr r28,r8 ffc0b310: 7d 5b 53 78 mr r27,r10 ffc0b314: 83 29 00 00 lwz r25,0(r9) /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; ffc0b318: 91 64 01 50 stw r11,336(r4) extensions_area = NULL; the_thread->libc_reent = NULL; ffc0b31c: 91 64 01 48 stw r11,328(r4) if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { ffc0b320: 40 a2 00 38 bne+ ffc0b358 <_Thread_Initialize+0x80> actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); ffc0b324: 7c 83 23 78 mr r3,r4 ffc0b328: 7c c4 33 78 mr r4,r6 ffc0b32c: 48 00 09 09 bl ffc0bc34 <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ ffc0b330: 39 60 00 00 li r11,0 stack = the_thread->Start.stack; #else if ( !stack_area ) { actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) ffc0b334: 2c 03 00 00 cmpwi r3,0 ffc0b338: 41 82 01 d4 beq- ffc0b50c <_Thread_Initialize+0x234> ffc0b33c: 7f 83 f0 40 cmplw cr7,r3,r30 return false; /* stack allocation failed */ ffc0b340: 7f ab eb 78 mr r11,r29 stack = the_thread->Start.stack; #else if ( !stack_area ) { actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) ffc0b344: 41 9c 01 c8 blt- cr7,ffc0b50c <_Thread_Initialize+0x234><== NEVER TAKEN return false; /* stack allocation failed */ stack = the_thread->Start.stack; the_thread->Start.core_allocated_stack = true; ffc0b348: 39 20 00 01 li r9,1 if ( !stack_area ) { actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; ffc0b34c: 83 bf 00 c0 lwz r29,192(r31) the_thread->Start.core_allocated_stack = true; ffc0b350: 99 3f 00 b0 stb r9,176(r31) ffc0b354: 48 00 00 0c b ffc0b360 <_Thread_Initialize+0x88> } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; ffc0b358: 99 64 00 b0 stb r11,176(r4) ffc0b35c: 7c c3 33 78 mr r3,r6 /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { ffc0b360: 2f 97 00 00 cmpwi cr7,r23,0 Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; ffc0b364: 93 bf 00 b8 stw r29,184(r31) extensions_area = NULL; the_thread->libc_reent = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) fp_area = NULL; ffc0b368: 3b a0 00 00 li r29,0 the_stack->size = size; ffc0b36c: 90 7f 00 b4 stw r3,180(r31) /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { ffc0b370: 41 be 00 14 beq+ cr7,ffc0b384 <_Thread_Initialize+0xac> fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); ffc0b374: 38 60 01 08 li r3,264 ffc0b378: 48 00 10 01 bl ffc0c378 <_Workspace_Allocate> if ( !fp_area ) ffc0b37c: 7c 7d 1b 79 mr. r29,r3 ffc0b380: 41 82 01 48 beq- ffc0b4c8 <_Thread_Initialize+0x1f0> #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { ffc0b384: 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; ffc0b388: 93 bf 01 44 stw r29,324(r31) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; ffc0b38c: 38 e0 00 00 li r7,0 #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { ffc0b390: 80 69 28 74 lwz r3,10356(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; ffc0b394: 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; ffc0b398: 93 bf 00 bc stw r29,188(r31) #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { ffc0b39c: 2f 83 00 00 cmpwi cr7,r3,0 ffc0b3a0: 90 ff 00 50 stw r7,80(r31) the_watchdog->routine = routine; ffc0b3a4: 90 ff 00 64 stw r7,100(r31) the_watchdog->id = id; ffc0b3a8: 90 ff 00 68 stw r7,104(r31) the_watchdog->user_data = user_data; ffc0b3ac: 90 ff 00 6c stw r7,108(r31) ffc0b3b0: 41 be 00 18 beq+ cr7,ffc0b3c8 <_Thread_Initialize+0xf0> extensions_area = _Workspace_Allocate( ffc0b3b4: 38 63 00 01 addi r3,r3,1 ffc0b3b8: 54 63 10 3a rlwinm r3,r3,2,0,29 ffc0b3bc: 48 00 0f bd bl ffc0c378 <_Workspace_Allocate> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) ffc0b3c0: 7c 7e 1b 79 mr. r30,r3 ffc0b3c4: 41 82 01 08 beq- ffc0b4cc <_Thread_Initialize+0x1f4> * 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 ) { ffc0b3c8: 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; ffc0b3cc: 93 df 01 54 stw r30,340(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 ) { ffc0b3d0: 40 be 00 20 bne+ cr7,ffc0b3f0 <_Thread_Initialize+0x118> the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { ffc0b3d4: 2f 9b 00 02 cmpwi cr7,r27,2 * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; ffc0b3d8: 81 21 00 48 lwz r9,72(r1) /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; ffc0b3dc: 9b 5f 00 9c stb r26,156(r31) the_thread->Start.budget_algorithm = budget_algorithm; ffc0b3e0: 93 7f 00 a0 stw r27,160(r31) the_thread->Start.budget_callout = budget_callout; ffc0b3e4: 91 3f 00 a4 stw r9,164(r31) switch ( budget_algorithm ) { ffc0b3e8: 40 be 00 44 bne+ cr7,ffc0b42c <_Thread_Initialize+0x154> ffc0b3ec: 48 00 00 34 b ffc0b420 <_Thread_Initialize+0x148> * 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++ ) ffc0b3f0: 3d 20 00 00 lis r9,0 ffc0b3f4: 81 49 28 74 lwz r10,10356(r9) ffc0b3f8: 38 e0 00 00 li r7,0 the_thread->extensions[i] = NULL; ffc0b3fc: 39 00 00 00 li r8,0 ffc0b400: 48 00 00 14 b ffc0b414 <_Thread_Initialize+0x13c> ffc0b404: 81 3f 01 54 lwz r9,340(r31) ffc0b408: 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++ ) ffc0b40c: 38 e7 00 01 addi r7,r7,1 the_thread->extensions[i] = NULL; ffc0b410: 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++ ) ffc0b414: 7f 87 50 40 cmplw cr7,r7,r10 ffc0b418: 40 9d ff ec ble+ cr7,ffc0b404 <_Thread_Initialize+0x12c> ffc0b41c: 4b ff ff b8 b ffc0b3d4 <_Thread_Initialize+0xfc> case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; ffc0b420: 3d 20 00 00 lis r9,0 ffc0b424: 81 29 28 64 lwz r9,10340(r9) ffc0b428: 91 3f 00 74 stw r9,116(r31) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; ffc0b42c: 81 21 00 4c lwz r9,76(r1) the_thread->current_state = STATES_DORMANT; ffc0b430: 3b 40 00 01 li r26,1 ffc0b434: 93 5f 00 10 stw r26,16(r31) */ RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate( Thread_Control *the_thread ) { return _Scheduler.Operations.allocate( the_thread ); ffc0b438: 7f e3 fb 78 mr r3,r31 case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; ffc0b43c: 91 3f 00 a8 stw r9,168(r31) the_thread->current_state = STATES_DORMANT; the_thread->Wait.queue = NULL; ffc0b440: 39 20 00 00 li r9,0 ffc0b444: 91 3f 00 44 stw r9,68(r31) the_thread->resource_count = 0; ffc0b448: 91 3f 00 1c stw r9,28(r31) ffc0b44c: 3d 20 00 00 lis r9,0 ffc0b450: 81 29 20 98 lwz r9,8344(r9) the_thread->real_priority = priority; ffc0b454: 93 9f 00 18 stw r28,24(r31) ffc0b458: 7d 29 03 a6 mtctr r9 the_thread->Start.initial_priority = priority; ffc0b45c: 93 9f 00 ac stw r28,172(r31) ffc0b460: 4e 80 04 21 bctrl sched =_Scheduler_Allocate( the_thread ); if ( !sched ) ffc0b464: 7c 7b 1b 79 mr. r27,r3 ffc0b468: 41 82 00 68 beq- ffc0b4d0 <_Thread_Initialize+0x1f8> goto failed; _Thread_Set_priority( the_thread, priority ); ffc0b46c: 7f e3 fb 78 mr r3,r31 ffc0b470: 7f 84 e3 78 mr r4,r28 ffc0b474: 48 00 06 fd bl ffc0bb70 <_Thread_Set_priority> Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( ffc0b478: a1 3f 00 0a lhz r9,10(r31) static inline void _Timestamp64_implementation_Set_to_zero( Timestamp64_Control *_time ) { *_time = 0; ffc0b47c: 39 40 00 00 li r10,0 ffc0b480: 91 5f 00 80 stw r10,128(r31) ffc0b484: 39 60 00 00 li r11,0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; ffc0b488: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0b48c: 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 ); ffc0b490: 3c 80 ff c1 lis r4,-63 ffc0b494: 91 7f 00 84 stw r11,132(r31) ffc0b498: 38 61 00 08 addi r3,r1,8 ffc0b49c: 38 84 bd 94 addi r4,r4,-17004 ffc0b4a0: 7f ea 49 2e stwx r31,r10,r9 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; ffc0b4a4: 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 }; ffc0b4a8: 93 e1 00 08 stw r31,8(r1) ffc0b4ac: 9b 41 00 0c stb r26,12(r1) _User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor ); ffc0b4b0: 48 00 09 c1 bl ffc0be70 <_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; ffc0b4b4: 39 60 00 01 li r11,1 return ctx.ok; ffc0b4b8: 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 ) ffc0b4bc: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b4c0: 41 be 00 10 beq+ cr7,ffc0b4d0 <_Thread_Initialize+0x1f8> ffc0b4c4: 48 00 00 48 b ffc0b50c <_Thread_Initialize+0x234> * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; extensions_area = NULL; ffc0b4c8: 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; ffc0b4cc: 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 ); ffc0b4d0: 80 7f 01 48 lwz r3,328(r31) ffc0b4d4: 48 00 0e bd bl ffc0c390 <_Workspace_Free> for ( i=0 ; i <= THREAD_API_LAST ; i++ ) _Workspace_Free( the_thread->API_Extensions[i] ); ffc0b4d8: 80 7f 01 4c lwz r3,332(r31) ffc0b4dc: 48 00 0e b5 bl ffc0c390 <_Workspace_Free> ffc0b4e0: 80 7f 01 50 lwz r3,336(r31) ffc0b4e4: 48 00 0e ad bl ffc0c390 <_Workspace_Free> _Workspace_Free( extensions_area ); ffc0b4e8: 7f c3 f3 78 mr r3,r30 ffc0b4ec: 48 00 0e a5 bl ffc0c390 <_Workspace_Free> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); ffc0b4f0: 7f a3 eb 78 mr r3,r29 ffc0b4f4: 48 00 0e 9d bl ffc0c390 <_Workspace_Free> #endif _Workspace_Free( sched ); ffc0b4f8: 7f 63 db 78 mr r3,r27 ffc0b4fc: 48 00 0e 95 bl ffc0c390 <_Workspace_Free> _Thread_Stack_Free( the_thread ); ffc0b500: 7f e3 fb 78 mr r3,r31 ffc0b504: 48 00 07 8d bl ffc0bc90 <_Thread_Stack_Free> return false; ffc0b508: 39 60 00 00 li r11,0 } ffc0b50c: 7d 63 5b 78 mr r3,r11 ffc0b510: 39 61 00 40 addi r11,r1,64 ffc0b514: 4b ff 50 90 b ffc005a4 <_restgpr_23_x> =============================================================================== ffc0c3c4 <_Thread_Restart>: bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { ffc0c3c4: 94 21 ff e8 stwu r1,-24(r1) ffc0c3c8: 7c 08 02 a6 mflr r0 ffc0c3cc: 90 01 00 1c stw r0,28(r1) */ RTEMS_INLINE_ROUTINE bool _States_Is_dormant ( States_Control the_states ) { return (the_states & STATES_DORMANT); ffc0c3d0: 81 23 00 10 lwz r9,16(r3) ffc0c3d4: bf c1 00 10 stmw r30,16(r1) ffc0c3d8: 7c 7f 1b 78 mr r31,r3 if ( !_States_Is_dormant( the_thread->current_state ) ) { ffc0c3dc: 71 2a 00 01 andi. r10,r9,1 ffc0c3e0: 40 a2 00 7c bne+ ffc0c45c <_Thread_Restart+0x98> _Thread_Set_transient( the_thread ); ffc0c3e4: 90 81 00 08 stw r4,8(r1) ffc0c3e8: 90 a1 00 0c stw r5,12(r1) ffc0c3ec: 48 00 00 ed bl ffc0c4d8 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); ffc0c3f0: 7f e3 fb 78 mr r3,r31 ffc0c3f4: 80 81 00 08 lwz r4,8(r1) ffc0c3f8: 80 a1 00 0c lwz r5,12(r1) ffc0c3fc: 48 00 30 21 bl ffc0f41c <_Thread_Reset> _Thread_Load_environment( the_thread ); ffc0c400: 7f e3 fb 78 mr r3,r31 ffc0c404: 48 00 2c fd bl ffc0f100 <_Thread_Load_environment> _Thread_Ready( the_thread ); ffc0c408: 7f e3 fb 78 mr r3,r31 ffc0c40c: 48 00 2f c9 bl ffc0f3d4 <_Thread_Ready> ); } static inline void _User_extensions_Thread_restart( Thread_Control *restarted ) { _User_extensions_Iterate( ffc0c410: 3c 80 ff c1 lis r4,-63 ffc0c414: 7f e3 fb 78 mr r3,r31 ffc0c418: 38 84 c7 08 addi r4,r4,-14584 ffc0c41c: 48 00 03 4d bl ffc0c768 <_User_extensions_Iterate> RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); ffc0c420: 3d 20 00 00 lis r9,0 ffc0c424: 39 29 31 e0 addi r9,r9,12768 _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) ffc0c428: 81 49 00 10 lwz r10,16(r9) _Thread_Restart_self(); return true; ffc0c42c: 38 60 00 01 li r3,1 ffc0c430: 7d 3e 4b 78 mr r30,r9 _Thread_Ready( the_thread ); _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) ffc0c434: 7f 9f 50 00 cmpw cr7,r31,r10 ffc0c438: 40 be 00 28 bne+ cr7,ffc0c460 <_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 ) ffc0c43c: 81 3f 01 44 lwz r9,324(r31) ffc0c440: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c444: 41 9e 00 0c beq- cr7,ffc0c450 <_Thread_Restart+0x8c> <== NEVER TAKEN _Context_Restore_fp( &_Thread_Executing->fp_context ); ffc0c448: 38 7f 01 44 addi r3,r31,324 ffc0c44c: 48 00 f4 75 bl ffc1b8c0 <_CPU_Context_restore_fp> #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); ffc0c450: 80 7e 00 10 lwz r3,16(r30) ffc0c454: 38 63 00 c4 addi r3,r3,196 ffc0c458: 48 00 f5 fd bl ffc1ba54 <_CPU_Context_restore> _Thread_Restart_self(); return true; } return false; ffc0c45c: 38 60 00 00 li r3,0 } ffc0c460: 39 61 00 18 addi r11,r1,24 ffc0c464: 4b ff 49 bc b ffc00e20 <_restgpr_30_x> =============================================================================== ffc0bab8 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { ffc0bab8: 94 21 ff d8 stwu r1,-40(r1) ffc0babc: 7c 08 02 a6 mflr r0 ffc0bac0: 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 ) ffc0bac4: 7c 7f 1b 79 mr. r31,r3 void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { ffc0bac8: 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 ) ffc0bacc: 41 82 00 58 beq- ffc0bb24 <_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 ) { ffc0bad0: 81 3f 00 34 lwz r9,52(r31) ffc0bad4: 2f 89 00 01 cmpwi cr7,r9,1 ffc0bad8: 40 be 00 4c bne+ cr7,ffc0bb24 <_Thread_queue_Requeue+0x6c><== NEVER TAKEN ffc0badc: 7c 9e 23 78 mr r30,r4 static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0bae0: 7f a0 00 a6 mfmsr r29 ffc0bae4: 7d 50 42 a6 mfsprg r10,0 ffc0bae8: 7f aa 50 78 andc r10,r29,r10 ffc0baec: 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 ) ) { ffc0baf0: 3d 00 00 03 lis r8,3 ffc0baf4: 81 44 00 10 lwz r10,16(r4) ffc0baf8: 61 08 be e0 ori r8,r8,48864 ffc0bafc: 7d 07 50 39 and. r7,r8,r10 ffc0bb00: 41 a2 00 20 beq+ ffc0bb20 <_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; ffc0bb04: 91 3f 00 30 stw r9,48(r31) _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); ffc0bb08: 38 a0 00 01 li r5,1 ffc0bb0c: 48 00 2e 81 bl ffc0e98c <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); ffc0bb10: 7f e3 fb 78 mr r3,r31 ffc0bb14: 7f c4 f3 78 mr r4,r30 ffc0bb18: 38 a1 00 08 addi r5,r1,8 ffc0bb1c: 4b ff fd 11 bl ffc0b82c <_Thread_queue_Enqueue_priority> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0bb20: 7f a0 01 24 mtmsr r29 } _ISR_Enable( level ); } } ffc0bb24: 39 61 00 28 addi r11,r1,40 ffc0bb28: 4b ff 4a 94 b ffc005bc <_restgpr_29_x> =============================================================================== ffc0bb2c <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { ffc0bb2c: 94 21 ff e8 stwu r1,-24(r1) ffc0bb30: 7c 08 02 a6 mflr r0 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0bb34: 38 81 00 08 addi r4,r1,8 void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { ffc0bb38: 90 01 00 1c stw r0,28(r1) Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0bb3c: 4b ff f7 09 bl ffc0b244 <_Thread_Get> switch ( location ) { ffc0bb40: 81 21 00 08 lwz r9,8(r1) ffc0bb44: 2f 89 00 00 cmpwi cr7,r9,0 ffc0bb48: 40 9e 00 18 bne- cr7,ffc0bb60 <_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 ); ffc0bb4c: 48 00 2f 45 bl ffc0ea90 <_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; ffc0bb50: 3d 20 00 00 lis r9,0 ffc0bb54: 81 49 28 68 lwz r10,10344(r9) --level; ffc0bb58: 39 4a ff ff addi r10,r10,-1 _Thread_Dispatch_disable_level = level; ffc0bb5c: 91 49 28 68 stw r10,10344(r9) _Thread_Unnest_dispatch(); break; } } ffc0bb60: 80 01 00 1c lwz r0,28(r1) ffc0bb64: 38 21 00 18 addi r1,r1,24 ffc0bb68: 7c 08 03 a6 mtlr r0 ffc0bb6c: 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 5c lwz r9,10588(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 48 5d bl ffc1e618 <_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 80 addi r9,r20,28800 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 46 b1 bl ffc2e488 <__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 48 21 bl ffc1e618 <_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 47 4d bl ffc1e55c <_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 0b 45 bl ffc1a960 <_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 48 6d bl ffc1e6b4 <_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 29 3c lwz r9,10556(r27) ++level; ffc19ed0: 39 29 00 01 addi r9,r9,1 _Thread_Dispatch_disable_level = level; ffc19ed4: 91 3b 29 3c stw r9,10556(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 42 6d bl ffc1e14c <_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 38 59 bl ffc1d74c <_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 49 0d bl ffc1e810 <_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 49 05 bl ffc1e810 <_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 29 3c lwz r10,10556(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 29 3c stw r10,10556(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 5c lwz r10,10588(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 47 15 bl ffc1e6b4 <_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 80 addi r9,r9,28800 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 44 a1 bl ffc2e488 <__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 46 75 bl ffc1e6b4 <_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 36 e4 b ffc1d74c <_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 b0 b ffc1a930 <_Chain_Append> =============================================================================== ffc0d628 <_Timestamp64_Divide>: const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { ffc0d628: 94 21 ff e8 stwu r1,-24(r1) ffc0d62c: 7c 08 02 a6 mflr r0 ffc0d630: 90 01 00 1c stw r0,28(r1) ffc0d634: bf 81 00 08 stmw r28,8(r1) ffc0d638: 7c be 2b 78 mr r30,r5 ffc0d63c: 7c df 33 78 mr r31,r6 Timestamp64_Control answer; if ( *_rhs == 0 ) { ffc0d640: 80 a4 00 00 lwz r5,0(r4) ffc0d644: 81 24 00 04 lwz r9,4(r4) ffc0d648: 7c a8 4b 79 or. r8,r5,r9 ffc0d64c: 40 a2 00 10 bne+ ffc0d65c <_Timestamp64_Divide+0x34> <== ALWAYS TAKEN *_ival_percentage = 0; ffc0d650: 91 1e 00 00 stw r8,0(r30) <== NOT EXECUTED *_fval_percentage = 0; ffc0d654: 91 06 00 00 stw r8,0(r6) <== NOT EXECUTED return; ffc0d658: 48 00 00 5c b ffc0d6b4 <_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; ffc0d65c: 80 c3 00 04 lwz r6,4(r3) ffc0d660: 3d 00 00 01 lis r8,1 ffc0d664: 80 e3 00 00 lwz r7,0(r3) ffc0d668: 61 08 86 a0 ori r8,r8,34464 ffc0d66c: 7c 68 30 16 mulhwu r3,r8,r6 ffc0d670: 7c e8 39 d6 mullw r7,r8,r7 ffc0d674: 7c 88 31 d6 mullw r4,r8,r6 ffc0d678: 7c 67 1a 14 add r3,r7,r3 ffc0d67c: 7d 26 4b 78 mr r6,r9 ffc0d680: 48 00 ea 19 bl ffc1c098 <__divdi3> *_ival_percentage = answer / 1000; ffc0d684: 38 a0 00 00 li r5,0 ffc0d688: 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; ffc0d68c: 7c 7c 1b 78 mr r28,r3 ffc0d690: 7c 9d 23 78 mr r29,r4 *_ival_percentage = answer / 1000; ffc0d694: 48 00 ea 05 bl ffc1c098 <__divdi3> ffc0d698: 90 9e 00 00 stw r4,0(r30) *_fval_percentage = answer % 1000; ffc0d69c: 7f 83 e3 78 mr r3,r28 ffc0d6a0: 7f a4 eb 78 mr r4,r29 ffc0d6a4: 38 a0 00 00 li r5,0 ffc0d6a8: 38 c0 03 e8 li r6,1000 ffc0d6ac: 48 00 ee 11 bl ffc1c4bc <__moddi3> ffc0d6b0: 90 9f 00 00 stw r4,0(r31) } ffc0d6b4: 39 61 00 18 addi r11,r1,24 ffc0d6b8: 4b ff 3c 78 b ffc01330 <_restgpr_28_x> =============================================================================== ffc0d91c <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { ffc0d91c: 94 21 ff e8 stwu r1,-24(r1) ffc0d920: 7c 08 02 a6 mflr r0 ffc0d924: 90 01 00 1c stw r0,28(r1) ffc0d928: bf 81 00 08 stmw r28,8(r1) ffc0d92c: 7c 7e 1b 78 mr r30,r3 static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0d930: 7d 20 00 a6 mfmsr r9 ffc0d934: 7d 50 42 a6 mfsprg r10,0 ffc0d938: 7d 2a 50 78 andc r10,r9,r10 ffc0d93c: 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; ffc0d940: 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 ); ffc0d944: 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 ) ) { ffc0d948: 7f 8a e8 00 cmpw cr7,r10,r29 ffc0d94c: 41 9e 00 80 beq- cr7,ffc0d9cc <_Watchdog_Adjust+0xb0> switch ( direction ) { ffc0d950: 2f 84 00 00 cmpwi cr7,r4,0 ffc0d954: 7c bf 2b 78 mr r31,r5 ffc0d958: 41 9e 00 68 beq- cr7,ffc0d9c0 <_Watchdog_Adjust+0xa4> ffc0d95c: 2f 84 00 01 cmpwi cr7,r4,1 ffc0d960: 40 be 00 6c bne+ cr7,ffc0d9cc <_Watchdog_Adjust+0xb0> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; ffc0d964: 81 0a 00 10 lwz r8,16(r10) ffc0d968: 7f e8 2a 14 add r31,r8,r5 ffc0d96c: 48 00 00 18 b ffc0d984 <_Watchdog_Adjust+0x68> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc0d970: 81 5e 00 00 lwz r10,0(r30) break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { ffc0d974: 81 0a 00 10 lwz r8,16(r10) ffc0d978: 7f 9f 40 40 cmplw cr7,r31,r8 ffc0d97c: 40 bc 00 10 bge+ cr7,ffc0d98c <_Watchdog_Adjust+0x70> _Watchdog_First( header )->delta_interval -= units; ffc0d980: 7f ff 40 50 subf r31,r31,r8 ffc0d984: 93 ea 00 10 stw r31,16(r10) break; ffc0d988: 48 00 00 44 b ffc0d9cc <_Watchdog_Adjust+0xb0> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; ffc0d98c: 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; ffc0d990: 7f e8 f8 50 subf r31,r8,r31 return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0d994: 7d 20 01 24 mtmsr r9 _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); _Watchdog_Tickle( header ); ffc0d998: 7f c3 f3 78 mr r3,r30 ffc0d99c: 48 00 02 41 bl ffc0dbdc <_Watchdog_Tickle> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0d9a0: 7d 20 00 a6 mfmsr r9 ffc0d9a4: 7d 50 42 a6 mfsprg r10,0 ffc0d9a8: 7d 2a 50 78 andc r10,r9,r10 ffc0d9ac: 7d 40 01 24 mtmsr r10 _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) ffc0d9b0: 81 5e 00 00 lwz r10,0(r30) ffc0d9b4: 7f 8a e8 00 cmpw cr7,r10,r29 ffc0d9b8: 40 be 00 0c bne+ cr7,ffc0d9c4 <_Watchdog_Adjust+0xa8> ffc0d9bc: 48 00 00 10 b ffc0d9cc <_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; ffc0d9c0: 3b 80 00 01 li r28,1 switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { ffc0d9c4: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0d9c8: 40 9e ff a8 bne+ cr7,ffc0d970 <_Watchdog_Adjust+0x54> <== ALWAYS TAKEN return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0d9cc: 7d 20 01 24 mtmsr r9 } } _ISR_Enable( level ); } ffc0d9d0: 39 61 00 18 addi r11,r1,24 ffc0d9d4: 4b ff 39 5c b ffc01330 <_restgpr_28_x> =============================================================================== ffc0c0f0 <_Watchdog_Remove>: #include Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { ffc0c0f0: 7c 69 1b 78 mr r9,r3 static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0c0f4: 7c c0 00 a6 mfmsr r6 ffc0c0f8: 7d 50 42 a6 mfsprg r10,0 ffc0c0fc: 7c ca 50 78 andc r10,r6,r10 ffc0c100: 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; ffc0c104: 80 63 00 08 lwz r3,8(r3) switch ( previous_state ) { ffc0c108: 2f 83 00 01 cmpwi cr7,r3,1 ffc0c10c: 41 9e 00 18 beq- cr7,ffc0c124 <_Watchdog_Remove+0x34> ffc0c110: 2b 83 00 01 cmplwi cr7,r3,1 ffc0c114: 41 9c 00 70 blt- cr7,ffc0c184 <_Watchdog_Remove+0x94> ffc0c118: 2b 83 00 03 cmplwi cr7,r3,3 ffc0c11c: 41 9d 00 68 bgt- cr7,ffc0c184 <_Watchdog_Remove+0x94> <== NEVER TAKEN ffc0c120: 48 00 00 10 b ffc0c130 <_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; ffc0c124: 39 40 00 00 li r10,0 ffc0c128: 91 49 00 08 stw r10,8(r9) break; ffc0c12c: 48 00 00 58 b ffc0c184 <_Watchdog_Remove+0x94> case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; ffc0c130: 39 40 00 00 li r10,0 ffc0c134: 91 49 00 08 stw r10,8(r9) } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } ffc0c138: 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) ) ffc0c13c: 81 0a 00 00 lwz r8,0(r10) ffc0c140: 2f 88 00 00 cmpwi cr7,r8,0 ffc0c144: 41 9e 00 14 beq- cr7,ffc0c158 <_Watchdog_Remove+0x68> next_watchdog->delta_interval += the_watchdog->delta_interval; ffc0c148: 80 ea 00 10 lwz r7,16(r10) ffc0c14c: 81 09 00 10 lwz r8,16(r9) ffc0c150: 7d 07 42 14 add r8,r7,r8 ffc0c154: 91 0a 00 10 stw r8,16(r10) if ( _Watchdog_Sync_count ) ffc0c158: 3d 00 00 00 lis r8,0 ffc0c15c: 81 08 28 84 lwz r8,10372(r8) ffc0c160: 2f 88 00 00 cmpwi cr7,r8,0 ffc0c164: 41 9e 00 14 beq- cr7,ffc0c178 <_Watchdog_Remove+0x88> _Watchdog_Sync_level = _ISR_Nest_level; ffc0c168: 3d 00 00 00 lis r8,0 ffc0c16c: 80 e8 31 a8 lwz r7,12712(r8) ffc0c170: 3d 00 00 00 lis r8,0 ffc0c174: 90 e8 28 7c stw r7,10364(r8) { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; ffc0c178: 81 09 00 04 lwz r8,4(r9) next->previous = previous; ffc0c17c: 91 0a 00 04 stw r8,4(r10) previous->next = next; ffc0c180: 91 48 00 00 stw r10,0(r8) _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; ffc0c184: 3d 40 00 00 lis r10,0 ffc0c188: 81 4a 28 88 lwz r10,10376(r10) ffc0c18c: 91 49 00 18 stw r10,24(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0c190: 7c c0 01 24 mtmsr r6 _ISR_Enable( level ); return( previous_state ); } ffc0c194: 4e 80 00 20 blr =============================================================================== ffc0c240 <_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(); ffc0c240: 3d 40 ff c2 lis r10,-62 void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc0c244: 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(); ffc0c248: 39 2a bf 98 addi r9,r10,-16488 void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc0c24c: 94 21 ff d0 stwu r1,-48(r1) ffc0c250: 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(); ffc0c254: 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 ) { ffc0c258: bf 01 00 10 stmw r24,16(r1) ffc0c25c: 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(); ffc0c260: 2f 88 00 00 cmpwi cr7,r8,0 ffc0c264: 83 ca bf 98 lwz r30,-16488(r10) void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc0c268: 7c ba 2b 78 mr r26,r5 ffc0c26c: 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(); ffc0c270: 39 40 00 00 li r10,0 void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc0c274: 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(); ffc0c278: 40 9e 00 08 bne- cr7,ffc0c280 <_Workspace_Handler_initialization+0x40> ffc0c27c: 81 49 00 04 lwz r10,4(r9) ffc0c280: 7f ca f2 14 add r30,r10,r30 bool do_zero = rtems_configuration_get_do_zero_of_workspace(); ffc0c284: 89 49 00 30 lbz r10,48(r9) bool unified = rtems_configuration_get_unified_work_area(); ffc0c288: 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; ffc0c28c: 3f 60 ff c1 lis r27,-63 } else { size = 0; } } space_available = (*init_or_extend)( ffc0c290: 3f 00 00 00 lis r24,0 ffc0c294: 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) { ffc0c298: 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; ffc0c29c: 3b 7b 9b 50 addi r27,r27,-25776 size_t i; for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { ffc0c2a0: 2e 0a 00 00 cmpwi cr4,r10,0 if ( area->size > overhead ) { uintptr_t space_available; uintptr_t size; if ( unified ) { ffc0c2a4: 2d 89 00 00 cmpwi cr3,r9,0 } else { size = 0; } } space_available = (*init_or_extend)( ffc0c2a8: 3b 18 2d 14 addi r24,r24,11540 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) { ffc0c2ac: 48 00 00 9c b ffc0c348 <_Workspace_Handler_initialization+0x108> Heap_Area *area = &areas [i]; if ( do_zero ) { ffc0c2b0: 41 b2 00 14 beq+ cr4,ffc0c2c4 <_Workspace_Handler_initialization+0x84> memset( area->begin, 0, area->size ); ffc0c2b4: 80 7f 00 00 lwz r3,0(r31) ffc0c2b8: 38 80 00 00 li r4,0 ffc0c2bc: 80 bf 00 04 lwz r5,4(r31) ffc0c2c0: 48 00 50 e5 bl ffc113a4 } if ( area->size > overhead ) { ffc0c2c4: 83 bf 00 04 lwz r29,4(r31) ffc0c2c8: 2b 9d 00 16 cmplwi cr7,r29,22 ffc0c2cc: 40 9d 00 74 ble- cr7,ffc0c340 <_Workspace_Handler_initialization+0x100> uintptr_t space_available; uintptr_t size; if ( unified ) { ffc0c2d0: 40 8e 00 24 bne- cr3,ffc0c2f4 <_Workspace_Handler_initialization+0xb4> size = area->size; } else { if ( remaining > 0 ) { ffc0c2d4: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0c2d8: 41 9e 00 18 beq- cr7,ffc0c2f0 <_Workspace_Handler_initialization+0xb0><== NEVER TAKEN size = remaining < area->size - overhead ? ffc0c2dc: 39 3d ff ea addi r9,r29,-22 remaining + overhead : area->size; ffc0c2e0: 7f 9e 48 40 cmplw cr7,r30,r9 ffc0c2e4: 40 9c 00 10 bge- cr7,ffc0c2f4 <_Workspace_Handler_initialization+0xb4><== NEVER TAKEN ffc0c2e8: 3b be 00 16 addi r29,r30,22 ffc0c2ec: 48 00 00 08 b ffc0c2f4 <_Workspace_Handler_initialization+0xb4> } else { size = 0; ffc0c2f0: 3b a0 00 00 li r29,0 <== NOT EXECUTED } } space_available = (*init_or_extend)( ffc0c2f4: 7f a5 eb 78 mr r5,r29 ffc0c2f8: 80 9f 00 00 lwz r4,0(r31) ffc0c2fc: 7f 03 c3 78 mr r3,r24 ffc0c300: 7f 69 03 a6 mtctr r27 ffc0c304: 38 c0 00 08 li r6,8 ffc0c308: 4e 80 04 21 bctrl area->begin, size, page_size ); area->begin = (char *) area->begin + size; ffc0c30c: 81 3f 00 00 lwz r9,0(r31) area->size -= size; if ( space_available < remaining ) { ffc0c310: 7f 83 f0 40 cmplw cr7,r3,r30 area->begin, size, page_size ); area->begin = (char *) area->begin + size; ffc0c314: 7d 29 ea 14 add r9,r9,r29 ffc0c318: 91 3f 00 00 stw r9,0(r31) area->size -= size; ffc0c31c: 81 3f 00 04 lwz r9,4(r31) ffc0c320: 7f bd 48 50 subf r29,r29,r9 ffc0c324: 93 bf 00 04 stw r29,4(r31) if ( space_available < remaining ) { ffc0c328: 40 9c 00 10 bge- cr7,ffc0c338 <_Workspace_Handler_initialization+0xf8><== ALWAYS TAKEN remaining -= space_available; ffc0c32c: 7f c3 f0 50 subf r30,r3,r30 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; ffc0c330: 7f 5b d3 78 mr r27,r26 <== NOT EXECUTED ffc0c334: 48 00 00 0c b ffc0c340 <_Workspace_Handler_initialization+0x100><== NOT EXECUTED ffc0c338: 7f 5b d3 78 mr r27,r26 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; ffc0c33c: 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) { ffc0c340: 3b 9c 00 01 addi r28,r28,1 ffc0c344: 3b ff 00 08 addi r31,r31,8 ffc0c348: 7f 9c c8 00 cmpw cr7,r28,r25 ffc0c34c: 40 9e ff 64 bne+ cr7,ffc0c2b0 <_Workspace_Handler_initialization+0x70> init_or_extend = extend; } } if ( remaining > 0 ) { ffc0c350: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0c354: 41 be 00 14 beq+ cr7,ffc0c368 <_Workspace_Handler_initialization+0x128> _Internal_error_Occurred( ffc0c358: 38 60 00 00 li r3,0 ffc0c35c: 38 80 00 01 li r4,1 ffc0c360: 38 a0 00 02 li r5,2 ffc0c364: 4b ff da 6d bl ffc09dd0 <_Internal_error_Occurred> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_TOO_LITTLE_WORKSPACE ); } } ffc0c368: 81 81 00 0c lwz r12,12(r1) ffc0c36c: 39 61 00 30 addi r11,r1,48 ffc0c370: 7d 81 81 20 mtcrf 24,r12 ffc0c374: 4b ff 42 34 b ffc005a8 <_restgpr_24_x> =============================================================================== ffc13c70 <_fat_block_read>: uint32_t start, uint32_t offset, uint32_t count, void *buff ) { ffc13c70: 94 21 ff c8 stwu r1,-56(r1) ffc13c74: 7c 08 02 a6 mflr r0 ffc13c78: bf 21 00 1c stmw r25,28(r1) ffc13c7c: 7c 7a 1b 78 mr r26,r3 ffc13c80: 7c df 33 78 mr r31,r6 ffc13c84: 90 01 00 3c stw r0,60(r1) ffc13c88: 7c f9 3b 78 mr r25,r7 int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; uint32_t ofs = offset; ffc13c8c: 7c bb 2b 78 mr r27,r5 void *buff ) { int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; ffc13c90: 7c 9c 23 78 mr r28,r4 uint32_t count, void *buff ) { int rc = RC_OK; ssize_t cmpltd = 0; ffc13c94: 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) ffc13c98: 48 00 00 58 b ffc13cf0 <_fat_block_read+0x80> { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); ffc13c9c: 7f 43 d3 78 mr r3,r26 ffc13ca0: 7f 84 e3 78 mr r4,r28 ffc13ca4: 38 a0 00 01 li r5,1 ffc13ca8: 38 c1 00 08 addi r6,r1,8 ffc13cac: 4b ff fe fd bl ffc13ba8 if (rc != RC_OK) ffc13cb0: 2f 83 00 00 cmpwi cr7,r3,0 ffc13cb4: 40 9e 00 48 bne- cr7,ffc13cfc <_fat_block_read+0x8c> <== NEVER TAKEN return -1; c = MIN(count, (fs_info->vol.bps - ofs)); ffc13cb8: a3 ba 00 00 lhz r29,0(r26) ffc13cbc: 7f bb e8 50 subf r29,r27,r29 ffc13cc0: 7f 9d f8 40 cmplw cr7,r29,r31 ffc13cc4: 40 9d 00 08 ble- cr7,ffc13ccc <_fat_block_read+0x5c> ffc13cc8: 7f fd fb 78 mr r29,r31 memcpy((buff + cmpltd), (sec_buf + ofs), c); ffc13ccc: 80 81 00 08 lwz r4,8(r1) ffc13cd0: 7c 79 f2 14 add r3,r25,r30 ffc13cd4: 7f a5 eb 78 mr r5,r29 ffc13cd8: 7c 84 da 14 add r4,r4,r27 ffc13cdc: 48 00 90 ed bl ffc1cdc8 count -= c; ffc13ce0: 7f fd f8 50 subf r31,r29,r31 cmpltd += c; ffc13ce4: 7f dd f2 14 add r30,r29,r30 sec_num++; ffc13ce8: 3b 9c 00 01 addi r28,r28,1 ofs = 0; ffc13cec: 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) ffc13cf0: 2f 9f 00 00 cmpwi cr7,r31,0 ffc13cf4: 40 9e ff a8 bne+ cr7,ffc13c9c <_fat_block_read+0x2c> ffc13cf8: 48 00 00 08 b ffc13d00 <_fat_block_read+0x90> { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; ffc13cfc: 3b c0 ff ff li r30,-1 <== NOT EXECUTED cmpltd += c; sec_num++; ofs = 0; } return cmpltd; } ffc13d00: 39 61 00 38 addi r11,r1,56 ffc13d04: 7f c3 f3 78 mr r3,r30 ffc13d08: 4b fe d8 dc b ffc015e4 <_restgpr_25_x> =============================================================================== 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 =============================================================================== ffc086b4 : #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { ffc086b4: 94 21 ff e0 stwu r1,-32(r1) ffc086b8: 7c 08 02 a6 mflr r0 ffc086bc: bf 61 00 0c stmw r27,12(r1) rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); ffc086c0: 3f e0 00 00 lis r31,0 ffc086c4: 3b ff 2b b0 addi r31,r31,11184 #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { ffc086c8: 7c 7d 1b 78 mr r29,r3 ffc086cc: 90 01 00 24 stw r0,36(r1) rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); ffc086d0: 7f e3 fb 78 mr r3,r31 #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { ffc086d4: 7c 9e 23 78 mr r30,r4 rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); ffc086d8: 48 00 12 59 bl ffc09930 if (fcntl (fildes, F_GETFD) < 0) { ffc086dc: 7f a3 eb 78 mr r3,r29 ffc086e0: 38 80 00 01 li r4,1 ffc086e4: 4c c6 31 82 crclr 4*cr1+eq ffc086e8: 48 00 6a 1d bl ffc0f104 ffc086ec: 2f 83 00 00 cmpwi cr7,r3,0 ffc086f0: 40 bc 00 18 bge+ cr7,ffc08708 pthread_mutex_unlock(&aio_request_queue.mutex); ffc086f4: 7f e3 fb 78 mr r3,r31 ffc086f8: 48 00 12 c5 bl ffc099bc rtems_set_errno_and_return_minus_one (EBADF); ffc086fc: 48 00 a0 35 bl ffc12730 <__errno> ffc08700: 39 20 00 09 li r9,9 ffc08704: 48 00 01 20 b ffc08824 } /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { ffc08708: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0870c: 40 be 00 b8 bne+ cr7,ffc087c4 AIO_printf ("Cancel all requests\n"); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); ffc08710: 38 7f 00 48 addi r3,r31,72 ffc08714: 7f a4 eb 78 mr r4,r29 ffc08718: 38 a0 00 00 li r5,0 ffc0871c: 48 00 05 ad bl ffc08cc8 if (r_chain == NULL) { ffc08720: 7c 7e 1b 79 mr. r30,r3 ffc08724: 40 a2 00 6c bne+ ffc08790 AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { ffc08728: 81 3f 00 54 lwz r9,84(r31) ffc0872c: 39 5f 00 58 addi r10,r31,88 ffc08730: 7f 89 50 00 cmpw cr7,r9,r10 ffc08734: 41 9e 00 1c beq- cr7,ffc08750 <== NEVER TAKEN r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); ffc08738: 38 7f 00 54 addi r3,r31,84 ffc0873c: 7f a4 eb 78 mr r4,r29 ffc08740: 38 a0 00 00 li r5,0 ffc08744: 48 00 05 85 bl ffc08cc8 if (r_chain == NULL) { ffc08748: 7c 7e 1b 79 mr. r30,r3 ffc0874c: 40 a2 00 18 bne+ ffc08764 pthread_mutex_unlock(&aio_request_queue.mutex); ffc08750: 3c 60 00 00 lis r3,0 ffc08754: 38 63 2b b0 addi r3,r3,11184 ffc08758: 48 00 12 65 bl ffc099bc return AIO_ALLDONE; ffc0875c: 3b c0 00 02 li r30,2 ffc08760: 48 00 01 10 b ffc08870 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); ffc08764: 48 00 2c d9 bl ffc0b43c <_Chain_Extract> AIO_printf ("Request chain on [IQ]\n"); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); pthread_mutex_destroy (&r_chain->mutex); ffc08768: 3b be 00 1c addi r29,r30,28 } AIO_printf ("Request chain on [IQ]\n"); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); ffc0876c: 7f c3 f3 78 mr r3,r30 ffc08770: 48 00 06 19 bl ffc08d88 pthread_mutex_destroy (&r_chain->mutex); ffc08774: 7f a3 eb 78 mr r3,r29 ffc08778: 48 00 0e d9 bl ffc09650 pthread_cond_destroy (&r_chain->mutex); ffc0877c: 7f a3 eb 78 mr r3,r29 ffc08780: 48 00 0b 19 bl ffc09298 free (r_chain); ffc08784: 7f c3 f3 78 mr r3,r30 ffc08788: 4b ff c1 21 bl ffc048a8 ffc0878c: 48 00 00 28 b ffc087b4 return AIO_ALLDONE; } AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); ffc08790: 3b be 00 1c addi r29,r30,28 ffc08794: 7f a3 eb 78 mr r3,r29 ffc08798: 48 00 11 99 bl ffc09930 ffc0879c: 7f c3 f3 78 mr r3,r30 ffc087a0: 48 00 2c 9d bl ffc0b43c <_Chain_Extract> rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); ffc087a4: 7f c3 f3 78 mr r3,r30 ffc087a8: 48 00 05 e1 bl ffc08d88 pthread_mutex_unlock (&r_chain->mutex); ffc087ac: 7f a3 eb 78 mr r3,r29 ffc087b0: 48 00 12 0d bl ffc099bc pthread_mutex_unlock (&aio_request_queue.mutex); ffc087b4: 7f e3 fb 78 mr r3,r31 ffc087b8: 48 00 12 05 bl ffc099bc return AIO_CANCELED; ffc087bc: 3b c0 00 00 li r30,0 ffc087c0: 48 00 00 b0 b ffc08870 } else { AIO_printf ("Cancel request\n"); if (aiocbp->aio_fildes != fildes) { ffc087c4: 83 9e 00 00 lwz r28,0(r30) ffc087c8: 7f 9c e8 00 cmpw cr7,r28,r29 ffc087cc: 41 be 00 08 beq+ cr7,ffc087d4 ffc087d0: 48 00 00 44 b ffc08814 pthread_mutex_unlock (&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EINVAL); } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); ffc087d4: 38 7f 00 48 addi r3,r31,72 ffc087d8: 7f 84 e3 78 mr r4,r28 ffc087dc: 38 a0 00 00 li r5,0 ffc087e0: 48 00 04 e9 bl ffc08cc8 if (r_chain == NULL) { ffc087e4: 7c 7b 1b 79 mr. r27,r3 ffc087e8: 40 a2 00 5c bne+ ffc08844 if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { ffc087ec: 81 3f 00 54 lwz r9,84(r31) ffc087f0: 39 5f 00 58 addi r10,r31,88 ffc087f4: 7f 89 50 00 cmpw cr7,r9,r10 ffc087f8: 41 be ff 58 beq- cr7,ffc08750 <== NEVER TAKEN r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); ffc087fc: 38 7f 00 54 addi r3,r31,84 ffc08800: 7f 84 e3 78 mr r4,r28 ffc08804: 38 a0 00 00 li r5,0 ffc08808: 48 00 04 c1 bl ffc08cc8 if (r_chain == NULL) { ffc0880c: 2c 03 00 00 cmpwi r3,0 ffc08810: 40 a2 00 20 bne+ ffc08830 pthread_mutex_unlock (&aio_request_queue.mutex); ffc08814: 7f e3 fb 78 mr r3,r31 ffc08818: 48 00 11 a5 bl ffc099bc rtems_set_errno_and_return_minus_one (EINVAL); ffc0881c: 48 00 9f 15 bl ffc12730 <__errno> ffc08820: 39 20 00 16 li r9,22 ffc08824: 91 23 00 00 stw r9,0(r3) ffc08828: 3b c0 ff ff li r30,-1 ffc0882c: 48 00 00 44 b ffc08870 } AIO_printf ("Request on [IQ]\n"); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); ffc08830: 7f c4 f3 78 mr r4,r30 ffc08834: 38 63 00 08 addi r3,r3,8 ffc08838: 48 00 05 a9 bl ffc08de0 ffc0883c: 7c 7e 1b 78 mr r30,r3 ffc08840: 48 00 00 28 b ffc08868 return AIO_ALLDONE; } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); ffc08844: 3b bb 00 1c addi r29,r27,28 ffc08848: 7f a3 eb 78 mr r3,r29 ffc0884c: 48 00 10 e5 bl ffc09930 result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); ffc08850: 7f c4 f3 78 mr r4,r30 ffc08854: 38 7b 00 08 addi r3,r27,8 ffc08858: 48 00 05 89 bl ffc08de0 ffc0885c: 7c 7e 1b 78 mr r30,r3 pthread_mutex_unlock (&r_chain->mutex); ffc08860: 7f a3 eb 78 mr r3,r29 ffc08864: 48 00 11 59 bl ffc099bc pthread_mutex_unlock (&aio_request_queue.mutex); ffc08868: 7f e3 fb 78 mr r3,r31 ffc0886c: 48 00 11 51 bl ffc099bc return result; } return AIO_ALLDONE; } ffc08870: 39 61 00 20 addi r11,r1,32 ffc08874: 7f c3 f3 78 mr r3,r30 ffc08878: 4b ff 83 00 b ffc00b78 <_restgpr_27_x> =============================================================================== ffc08884 : ) { rtems_aio_request *req; int mode; if (op != O_SYNC) ffc08884: 2f 83 20 00 cmpwi cr7,r3,8192 int aio_fsync( int op, struct aiocb *aiocbp ) { ffc08888: 94 21 ff f0 stwu r1,-16(r1) ffc0888c: 7c 08 02 a6 mflr r0 ffc08890: bf c1 00 08 stmw r30,8(r1) ffc08894: 7c 9f 23 78 mr r31,r4 rtems_aio_request *req; int mode; if (op != O_SYNC) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); ffc08898: 3b c0 00 16 li r30,22 int aio_fsync( int op, struct aiocb *aiocbp ) { ffc0889c: 90 01 00 14 stw r0,20(r1) rtems_aio_request *req; int mode; if (op != O_SYNC) ffc088a0: 40 9e 00 3c bne- cr7,ffc088dc rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); ffc088a4: 80 64 00 00 lwz r3,0(r4) ffc088a8: 38 80 00 03 li r4,3 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); ffc088ac: 3b c0 00 09 li r30,9 int mode; if (op != O_SYNC) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); ffc088b0: 4c c6 31 82 crclr 4*cr1+eq ffc088b4: 48 00 68 51 bl ffc0f104 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) ffc088b8: 54 63 07 be clrlwi r3,r3,30 ffc088bc: 38 63 ff ff addi r3,r3,-1 ffc088c0: 2b 83 00 01 cmplwi cr7,r3,1 ffc088c4: 41 9d 00 18 bgt- cr7,ffc088dc rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); ffc088c8: 38 60 00 18 li r3,24 ffc088cc: 4b ff c4 dd bl ffc04da8 if (req == NULL) ffc088d0: 7c 69 1b 79 mr. r9,r3 ffc088d4: 40 a2 00 20 bne+ ffc088f4 <== ALWAYS TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); ffc088d8: 3b c0 00 0b li r30,11 <== NOT EXECUTED ffc088dc: 39 20 ff ff li r9,-1 ffc088e0: 93 df 00 34 stw r30,52(r31) ffc088e4: 91 3f 00 38 stw r9,56(r31) ffc088e8: 48 00 9e 49 bl ffc12730 <__errno> ffc088ec: 93 c3 00 00 stw r30,0(r3) ffc088f0: 48 00 00 24 b ffc08914 req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); } ffc088f4: 80 01 00 14 lwz r0,20(r1) req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; ffc088f8: 93 e9 00 14 stw r31,20(r9) req->aiocbp->aio_lio_opcode = LIO_SYNC; ffc088fc: 39 20 00 03 li r9,3 return rtems_aio_enqueue (req); } ffc08900: 7c 08 03 a6 mtlr r0 req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; ffc08904: 91 3f 00 30 stw r9,48(r31) return rtems_aio_enqueue (req); } ffc08908: bb c1 00 08 lmw r30,8(r1) ffc0890c: 38 21 00 10 addi r1,r1,16 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); ffc08910: 48 00 05 5c b ffc08e6c } ffc08914: 39 61 00 10 addi r11,r1,16 ffc08918: 38 60 ff ff li r3,-1 ffc0891c: 4b ff 82 68 b ffc00b84 <_restgpr_30_x> =============================================================================== ffc09064 : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { ffc09064: 94 21 ff f0 stwu r1,-16(r1) ffc09068: 7c 08 02 a6 mflr r0 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); ffc0906c: 38 80 00 03 li r4,3 * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { ffc09070: 90 01 00 14 stw r0,20(r1) ffc09074: bf c1 00 08 stmw r30,8(r1) ffc09078: 7c 7f 1b 78 mr r31,r3 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); ffc0907c: 80 63 00 00 lwz r3,0(r3) ffc09080: 4c c6 31 82 crclr 4*cr1+eq ffc09084: 48 00 60 81 bl ffc0f104 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) ffc09088: 70 63 00 03 andi. r3,r3,3 ffc0908c: 41 82 00 10 beq- ffc0909c <== NEVER TAKEN ffc09090: 2f 83 00 02 cmpwi cr7,r3,2 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); ffc09094: 3b c0 00 09 li r30,9 { rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) ffc09098: 40 9e 00 3c bne- cr7,ffc090d4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) ffc0909c: 81 3f 00 18 lwz r9,24(r31) ffc090a0: 2f 89 00 00 cmpwi cr7,r9,0 ffc090a4: 41 be 00 08 beq+ cr7,ffc090ac ffc090a8: 48 00 00 10 b ffc090b8 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) ffc090ac: 81 3f 00 08 lwz r9,8(r31) ffc090b0: 2f 89 00 00 cmpwi cr7,r9,0 ffc090b4: 40 9c 00 0c bge- cr7,ffc090c0 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); ffc090b8: 3b c0 00 16 li r30,22 ffc090bc: 48 00 00 18 b ffc090d4 req = malloc (sizeof (rtems_aio_request)); ffc090c0: 38 60 00 18 li r3,24 ffc090c4: 4b ff bc e5 bl ffc04da8 if (req == NULL) ffc090c8: 7c 69 1b 79 mr. r9,r3 ffc090cc: 40 a2 00 20 bne+ ffc090ec <== ALWAYS TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); ffc090d0: 3b c0 00 0b li r30,11 <== NOT EXECUTED ffc090d4: 39 20 ff ff li r9,-1 ffc090d8: 93 df 00 34 stw r30,52(r31) ffc090dc: 91 3f 00 38 stw r9,56(r31) ffc090e0: 48 00 96 51 bl ffc12730 <__errno> ffc090e4: 93 c3 00 00 stw r30,0(r3) ffc090e8: 48 00 00 24 b ffc0910c req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); } ffc090ec: 80 01 00 14 lwz r0,20(r1) req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; ffc090f0: 93 e9 00 14 stw r31,20(r9) req->aiocbp->aio_lio_opcode = LIO_READ; ffc090f4: 39 20 00 01 li r9,1 return rtems_aio_enqueue (req); } ffc090f8: 7c 08 03 a6 mtlr r0 req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; ffc090fc: 91 3f 00 30 stw r9,48(r31) return rtems_aio_enqueue (req); } ffc09100: bb c1 00 08 lmw r30,8(r1) ffc09104: 38 21 00 10 addi r1,r1,16 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); ffc09108: 4b ff fd 64 b ffc08e6c } ffc0910c: 39 61 00 10 addi r11,r1,16 ffc09110: 38 60 ff ff li r3,-1 ffc09114: 4b ff 7a 70 b ffc00b84 <_restgpr_30_x> =============================================================================== ffc09120 : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { ffc09120: 94 21 ff f0 stwu r1,-16(r1) ffc09124: 7c 08 02 a6 mflr r0 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); ffc09128: 38 80 00 03 li r4,3 * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { ffc0912c: 90 01 00 14 stw r0,20(r1) ffc09130: bf c1 00 08 stmw r30,8(r1) ffc09134: 7c 7f 1b 78 mr r31,r3 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); ffc09138: 3b c0 00 09 li r30,9 aio_write (struct aiocb *aiocbp) { rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); ffc0913c: 80 63 00 00 lwz r3,0(r3) ffc09140: 4c c6 31 82 crclr 4*cr1+eq ffc09144: 48 00 5f c1 bl ffc0f104 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) ffc09148: 54 63 07 be clrlwi r3,r3,30 ffc0914c: 38 63 ff ff addi r3,r3,-1 ffc09150: 2b 83 00 01 cmplwi cr7,r3,1 ffc09154: 41 9d 00 3c bgt- cr7,ffc09190 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) ffc09158: 81 3f 00 18 lwz r9,24(r31) ffc0915c: 2f 89 00 00 cmpwi cr7,r9,0 ffc09160: 41 be 00 08 beq+ cr7,ffc09168 ffc09164: 48 00 00 10 b ffc09174 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) ffc09168: 81 3f 00 08 lwz r9,8(r31) ffc0916c: 2f 89 00 00 cmpwi cr7,r9,0 ffc09170: 40 9c 00 0c bge- cr7,ffc0917c rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); ffc09174: 3b c0 00 16 li r30,22 ffc09178: 48 00 00 18 b ffc09190 req = malloc (sizeof (rtems_aio_request)); ffc0917c: 38 60 00 18 li r3,24 ffc09180: 4b ff bc 29 bl ffc04da8 if (req == NULL) ffc09184: 7c 69 1b 79 mr. r9,r3 ffc09188: 40 a2 00 20 bne+ ffc091a8 <== ALWAYS TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); ffc0918c: 3b c0 00 0b li r30,11 <== NOT EXECUTED ffc09190: 39 20 ff ff li r9,-1 ffc09194: 93 df 00 34 stw r30,52(r31) ffc09198: 91 3f 00 38 stw r9,56(r31) ffc0919c: 48 00 95 95 bl ffc12730 <__errno> ffc091a0: 93 c3 00 00 stw r30,0(r3) ffc091a4: 48 00 00 24 b ffc091c8 req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); } ffc091a8: 80 01 00 14 lwz r0,20(r1) req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; ffc091ac: 93 e9 00 14 stw r31,20(r9) req->aiocbp->aio_lio_opcode = LIO_WRITE; ffc091b0: 39 20 00 02 li r9,2 return rtems_aio_enqueue (req); } ffc091b4: 7c 08 03 a6 mtlr r0 req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; ffc091b8: 91 3f 00 30 stw r9,48(r31) return rtems_aio_enqueue (req); } ffc091bc: bb c1 00 08 lmw r30,8(r1) ffc091c0: 38 21 00 10 addi r1,r1,16 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); ffc091c4: 4b ff fc a8 b ffc08e6c } ffc091c8: 39 61 00 10 addi r11,r1,16 ffc091cc: 38 60 ff ff li r3,-1 ffc091d0: 4b ff 79 b4 b ffc00b84 <_restgpr_30_x> =============================================================================== 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 3b c0 addi r30,r30,15296 &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 68 lwz r3,10088(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 68 lwz r3,10088(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 83 05 bl ffc0d1ac <__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 82 ed bl ffc0d1ac <__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 c7 14 b ffc11618 <_restgpr_30_x> =============================================================================== ffc081e8 : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { ffc081e8: 94 21 ff d8 stwu r1,-40(r1) ffc081ec: 7c 08 02 a6 mflr r0 ffc081f0: bf a1 00 1c stmw r29,28(r1) if ( !tp ) ffc081f4: 7c 9d 23 79 mr. r29,r4 int clock_gettime( clockid_t clock_id, struct timespec *tp ) { ffc081f8: 90 01 00 2c stw r0,44(r1) if ( !tp ) ffc081fc: 40 a2 00 08 bne+ ffc08204 ffc08200: 48 00 00 94 b ffc08294 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { ffc08204: 2f 83 00 01 cmpwi cr7,r3,1 ffc08208: 40 be 00 58 bne+ cr7,ffc08260 ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = ffc0820c: 3c 80 00 00 lis r4,0 ffc08210: 38 84 2c a0 addi r4,r4,11424 ffc08214: 38 61 00 08 addi r3,r1,8 ffc08218: 48 00 20 d1 bl ffc0a2e8 <_TOD_Get_with_nanoseconds> static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); ffc0821c: 3c c0 3b 9a lis r6,15258 #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } ffc08220: 83 e3 00 04 lwz r31,4(r3) ffc08224: 38 a0 00 00 li r5,0 ffc08228: 83 c3 00 00 lwz r30,0(r3) ffc0822c: 60 c6 ca 00 ori r6,r6,51712 ffc08230: 7f e4 fb 78 mr r4,r31 ffc08234: 7f c3 f3 78 mr r3,r30 ffc08238: 48 00 f8 a9 bl ffc17ae0 <__divdi3> _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); ffc0823c: 3c c0 3b 9a lis r6,15258 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); ffc08240: 90 9d 00 00 stw r4,0(r29) _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); ffc08244: 7f c3 f3 78 mr r3,r30 ffc08248: 7f e4 fb 78 mr r4,r31 ffc0824c: 38 a0 00 00 li r5,0 ffc08250: 60 c6 ca 00 ori r6,r6,51712 ffc08254: 48 00 fc b1 bl ffc17f04 <__moddi3> ffc08258: 90 9d 00 04 stw r4,4(r29) ffc0825c: 48 00 00 14 b ffc08270 if ( clock_id == CLOCK_REALTIME ) { _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { ffc08260: 2f 83 00 04 cmpwi cr7,r3,4 ffc08264: 40 be 00 14 bne+ cr7,ffc08278 <== ALWAYS TAKEN _TOD_Get_uptime_as_timespec( tp ); ffc08268: 7f a3 eb 78 mr r3,r29 ffc0826c: 48 00 20 e5 bl ffc0a350 <_TOD_Get_uptime_as_timespec> return 0; ffc08270: 38 60 00 00 li r3,0 ffc08274: 48 00 00 30 b ffc082a4 } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) { ffc08278: 2f 83 00 02 cmpwi cr7,r3,2 ffc0827c: 41 be ff ec beq- cr7,ffc08268 return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) ffc08280: 2f 83 00 03 cmpwi cr7,r3,3 ffc08284: 40 be 00 10 bne+ cr7,ffc08294 rtems_set_errno_and_return_minus_one( ENOSYS ); ffc08288: 48 00 8f 49 bl ffc111d0 <__errno> ffc0828c: 39 20 00 58 li r9,88 ffc08290: 48 00 00 0c b ffc0829c #endif rtems_set_errno_and_return_minus_one( EINVAL ); ffc08294: 48 00 8f 3d bl ffc111d0 <__errno> ffc08298: 39 20 00 16 li r9,22 ffc0829c: 91 23 00 00 stw r9,0(r3) ffc082a0: 38 60 ff ff li r3,-1 return 0; } ffc082a4: 39 61 00 28 addi r11,r1,40 ffc082a8: 4b ff 86 e8 b ffc00990 <_restgpr_29_x> =============================================================================== ffc26f24 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { if ( !tp ) ffc26f24: 2c 04 00 00 cmpwi r4,0 int clock_settime( clockid_t clock_id, const struct timespec *tp ) { ffc26f28: 94 21 ff e8 stwu r1,-24(r1) ffc26f2c: 7c 08 02 a6 mflr r0 ffc26f30: 90 01 00 1c stw r0,28(r1) if ( !tp ) ffc26f34: 40 a2 00 08 bne+ ffc26f3c <== ALWAYS TAKEN ffc26f38: 48 00 00 94 b ffc26fcc <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { ffc26f3c: 2f 83 00 01 cmpwi cr7,r3,1 ffc26f40: 40 be 00 6c bne+ cr7,ffc26fac if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) ffc26f44: 81 24 00 00 lwz r9,0(r4) ffc26f48: 3d 40 21 da lis r10,8666 ffc26f4c: 61 4a e4 ff ori r10,r10,58623 ffc26f50: 7f 89 50 40 cmplw cr7,r9,r10 ffc26f54: 41 bd 00 08 bgt+ cr7,ffc26f5c ffc26f58: 48 00 00 74 b ffc26fcc * * 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; ffc26f5c: 3d 20 00 00 lis r9,0 ffc26f60: 81 49 34 e4 lwz r10,13540(r9) ++level; ffc26f64: 39 4a 00 01 addi r10,r10,1 _Thread_Dispatch_disable_level = level; ffc26f68: 91 49 34 e4 stw r10,13540(r9) Timestamp64_Control *_time, Timestamp64_Control _seconds, Timestamp64_Control _nanoseconds ) { *_time = _seconds * 1000000000L + _nanoseconds; ffc26f6c: 3c c0 3b 9a lis r6,15258 const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( ffc26f70: 81 44 00 00 lwz r10,0(r4) ffc26f74: 60 c6 ca 00 ori r6,r6,51712 ffc26f78: 81 64 00 04 lwz r11,4(r4) ffc26f7c: 7d 0a 30 96 mulhw r8,r10,r6 ffc26f80: 7d 2a 31 d6 mullw r9,r10,r6 ffc26f84: 7d 6a fe 70 srawi r10,r11,31 ffc26f88: 7d 6b 48 14 addc r11,r11,r9 ffc26f8c: 7d 4a 41 14 adde r10,r10,r8 ffc26f90: 7c 23 0b 78 mr r3,r1 ffc26f94: 95 43 00 08 stwu r10,8(r3) ffc26f98: 91 63 00 04 stw r11,4(r3) &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); ffc26f9c: 48 00 10 85 bl ffc28020 <_TOD_Set_with_timestamp> rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); ffc26fa0: 4b fe 3a b1 bl ffc0aa50 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; ffc26fa4: 38 60 00 00 li r3,0 ffc26fa8: 48 00 00 34 b ffc26fdc _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) ffc26fac: 2f 83 00 02 cmpwi cr7,r3,2 ffc26fb0: 40 be 00 08 bne+ cr7,ffc26fb8 ffc26fb4: 48 00 00 0c b ffc26fc0 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) ffc26fb8: 2f 83 00 03 cmpwi cr7,r3,3 ffc26fbc: 40 be 00 10 bne+ cr7,ffc26fcc rtems_set_errno_and_return_minus_one( ENOSYS ); ffc26fc0: 48 01 14 49 bl ffc38408 <__errno> ffc26fc4: 39 20 00 58 li r9,88 ffc26fc8: 48 00 00 0c b ffc26fd4 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); ffc26fcc: 48 01 14 3d bl ffc38408 <__errno> ffc26fd0: 39 20 00 16 li r9,22 ffc26fd4: 91 23 00 00 stw r9,0(r3) ffc26fd8: 38 60 ff ff li r3,-1 return 0; } ffc26fdc: 80 01 00 1c lwz r0,28(r1) ffc26fe0: 38 21 00 18 addi r1,r1,24 ffc26fe4: 7c 08 03 a6 mtlr r0 ffc26fe8: 4e 80 00 20 blr =============================================================================== 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 e0 addi r10,r9,10464 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 e0 lwz r28,10464(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 12 dd bl ffc155f8 <== NOT EXECUTED disktab = table; ffc04320: 3d 20 00 00 lis r9,0 <== NOT EXECUTED ffc04324: 39 49 28 e0 addi r10,r9,10464 <== NOT EXECUTED disktab_size = new_size; ffc04328: 93 e9 28 e0 stw r31,10464(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 e4 lwz r27,10468(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 12 61 bl ffc155f8 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 15 ad bl ffc15994 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 52 cc b ffc19728 <_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 5d 9c addi r3,r3,23964 ffc05968: 38 a0 00 06 li r5,6 ffc0596c: 48 01 10 29 bl ffc16994 * 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> =============================================================================== ffc0c5b4 : } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { ffc0c5b4: 94 21 ff d8 stwu r1,-40(r1) ffc0c5b8: 7c 08 02 a6 mflr r0 ffc0c5bc: 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; ffc0c5c0: 81 23 00 2c lwz r9,44(r3) ffc0c5c4: bf 01 00 08 stmw r24,8(r1) ffc0c5c8: 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; ffc0c5cc: 3b a0 00 00 li r29,0 ffc0c5d0: 81 29 00 10 lwz r9,16(r9) devFS_node *free_node = NULL; for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { ffc0c5d4: 3b 40 00 00 li r26,0 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } ffc0c5d8: 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; ffc0c5dc: 83 09 00 04 lwz r24,4(r9) ffc0c5e0: 83 c9 00 00 lwz r30,0(r9) devFS_node *nodes = data->nodes; devFS_node *node = NULL; devFS_node *free_node = NULL; ffc0c5e4: 39 20 00 00 li r9,0 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } ffc0c5e8: 83 63 00 04 lwz r27,4(r3) ffc0c5ec: 48 00 00 58 b ffc0c644 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) { ffc0c5f0: 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; ffc0c5f4: 7f dc f3 78 mr r28,r30 if (current->name != NULL) { ffc0c5f8: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c5fc: 41 9e 00 2c beq- cr7,ffc0c628 if ( ffc0c600: 81 5e 00 04 lwz r10,4(r30) ffc0c604: 7d 3c 4b 78 mr r28,r9 ffc0c608: 7f 8a d8 00 cmpw cr7,r10,r27 ffc0c60c: 40 be 00 1c bne+ cr7,ffc0c628 current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 ffc0c610: 7f 24 cb 78 mr r4,r25 ffc0c614: 7f 65 db 78 mr r5,r27 ffc0c618: 48 00 36 41 bl ffc0fc58 ffc0c61c: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c620: 40 9e 00 08 bne- cr7,ffc0c628 ffc0c624: 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) { ffc0c628: 2f 9c 00 00 cmpwi cr7,r28,0 ffc0c62c: 3b 5a 00 01 addi r26,r26,1 ffc0c630: 41 9e 00 0c beq- cr7,ffc0c63c <== NEVER TAKEN ffc0c634: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0c638: 40 9e 00 18 bne- cr7,ffc0c650 ffc0c63c: 3b de 00 14 addi r30,r30,20 ffc0c640: 7f 89 e3 78 mr r9,r28 ffc0c644: 7f 9a c0 00 cmpw cr7,r26,r24 ffc0c648: 40 9e ff a8 bne+ cr7,ffc0c5f0 ffc0c64c: 48 00 00 08 b ffc0c654 ffc0c650: 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) { ffc0c654: 2f 9d 00 00 cmpwi cr7,r29,0 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } ffc0c658: 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) { ffc0c65c: 41 9e 00 24 beq- cr7,ffc0c680 if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { ffc0c660: 71 49 00 40 andi. r9,r10,64 ffc0c664: 40 82 00 10 bne- ffc0c674 currentloc->node_access = node; ffc0c668: 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; ffc0c66c: 91 3f 00 04 stw r9,4(r31) ffc0c670: 48 00 00 64 b ffc0c6d4 rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); ffc0c674: 7f e3 fb 78 mr r3,r31 ffc0c678: 38 80 00 11 li r4,17 ffc0c67c: 48 00 00 44 b ffc0c6c0 } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { ffc0c680: 71 48 00 20 andi. r8,r10,32 ffc0c684: 41 82 00 34 beq- ffc0c6b8 <== NEVER TAKEN if (free_node != NULL) { ffc0c688: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c68c: 41 9e 00 20 beq- cr7,ffc0c6ac free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; ffc0c690: 39 40 01 ff li r10,511 ffc0c694: 91 49 00 10 stw r10,16(r9) currentloc->node_access = free_node; ffc0c698: 91 3f 00 20 stw r9,32(r31) rtems_filesystem_eval_path_context_t *ctx, const char *token, size_t tokenlen ) { ctx->token = token; ffc0c69c: 93 3f 00 08 stw r25,8(r31) ctx->tokenlen = tokenlen; ffc0c6a0: 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; ffc0c6a4: 93 bf 00 04 stw r29,4(r31) ffc0c6a8: 48 00 00 2c b ffc0c6d4 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); ffc0c6ac: 7f e3 fb 78 mr r3,r31 ffc0c6b0: 38 80 00 1c li r4,28 ffc0c6b4: 48 00 00 0c b ffc0c6c0 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); ffc0c6b8: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc0c6bc: 38 80 00 02 li r4,2 <== NOT EXECUTED } } } ffc0c6c0: 80 01 00 2c lwz r0,44(r1) ffc0c6c4: bb 01 00 08 lmw r24,8(r1) ffc0c6c8: 7c 08 03 a6 mtlr r0 ffc0c6cc: 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); ffc0c6d0: 4b ff 8e 60 b ffc05530 } } } ffc0c6d4: 39 61 00 28 addi r11,r1,40 ffc0c6d8: 48 00 b9 b0 b ffc18088 <_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 ba bd bl ffc0fcdc 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 a7 b5 bl ffc0e9e0 <__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 a7 99 bl ffc0e9e0 <__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 3e 3c b ffc18098 <_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 54 d9 bl ffc19704 <_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 e0 addi r31,r31,10464 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 54 f0 b ffc19750 <_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 e0 addi r9,r9,10464 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 0d bl ffc0a0a4 <== 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 f5 bl ffc09074 <== 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 3c c9 bl ffc1adbc <_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 e0 lwz r9,10208(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 d0 fe addi r28,r28,-12034 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); ffc071a4: 3b 7b d1 00 addi r27,r27,-12032 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 e0 lwz r6,10208(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 e0 lwz r10,10208(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 e0 lwz r9,10208(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> =============================================================================== ffc13ba8 : int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { ffc13ba8: 94 21 ff d8 stwu r1,-40(r1) ffc13bac: 7c 08 02 a6 mflr r0 ffc13bb0: bf 61 00 14 stmw r27,20(r1) ffc13bb4: 7c 9e 23 78 mr r30,r4 ffc13bb8: 7c 7f 1b 78 mr r31,r3 ffc13bbc: 90 01 00 2c stw r0,44(r1) ffc13bc0: 7c bb 2b 78 mr r27,r5 ffc13bc4: 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); ffc13bc8: 89 23 00 02 lbz r9,2(r3) ffc13bcc: 89 43 00 0c lbz r10,12(r3) ffc13bd0: 7d 49 50 50 subf r10,r9,r10 ffc13bd4: 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); ffc13bd8: 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 - ffc13bdc: 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); ffc13be0: 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) ffc13be4: 89 23 00 89 lbz r9,137(r3) ffc13be8: 2f 89 00 00 cmpwi cr7,r9,0 ffc13bec: 41 9e 00 10 beq- cr7,ffc13bfc ffc13bf0: 81 23 00 84 lwz r9,132(r3) ffc13bf4: 7f 89 f0 00 cmpw cr7,r9,r30 ffc13bf8: 41 9e 00 5c beq- cr7,ffc13c54 { fat_buf_release(fs_info); ffc13bfc: 7f e3 fb 78 mr r3,r31 ffc13c00: 90 81 00 08 stw r4,8(r1) ffc13c04: 4b ff fd e5 bl ffc139e8 if (op_type == FAT_OP_TYPE_READ) ffc13c08: 2f 9b 00 01 cmpwi cr7,r27,1 ffc13c0c: 80 7f 00 64 lwz r3,100(r31) ffc13c10: 38 bf 00 8c addi r5,r31,140 ffc13c14: 80 81 00 08 lwz r4,8(r1) ffc13c18: 40 be 00 0c bne+ cr7,ffc13c24 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); ffc13c1c: 4b ff dc ad bl ffc118c8 ffc13c20: 48 00 00 08 b ffc13c28 else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); ffc13c24: 4b ff db cd bl ffc117f0 if (sc != RTEMS_SUCCESSFUL) ffc13c28: 2f 83 00 00 cmpwi cr7,r3,0 ffc13c2c: 41 be 00 18 beq+ cr7,ffc13c44 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EIO); ffc13c30: 48 00 84 b9 bl ffc1c0e8 <__errno> <== NOT EXECUTED ffc13c34: 39 20 00 05 li r9,5 <== NOT EXECUTED ffc13c38: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc13c3c: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc13c40: 48 00 00 28 b ffc13c68 <== NOT EXECUTED fs_info->c.blk_num = sec_num; fs_info->c.modified = 0; fs_info->c.state = FAT_CACHE_ACTUAL; ffc13c44: 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; ffc13c48: 93 df 00 84 stw r30,132(r31) fs_info->c.modified = 0; ffc13c4c: 98 7f 00 88 stb r3,136(r31) fs_info->c.state = FAT_CACHE_ACTUAL; ffc13c50: 99 3f 00 89 stb r9,137(r31) } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; ffc13c54: 81 3f 00 8c lwz r9,140(r31) return RC_OK; ffc13c58: 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]; ffc13c5c: 81 29 00 1c lwz r9,28(r9) ffc13c60: 7f 89 e2 14 add r28,r9,r28 ffc13c64: 93 9d 00 00 stw r28,0(r29) return RC_OK; } ffc13c68: 39 61 00 28 addi r11,r1,40 ffc13c6c: 4b fe d9 80 b ffc015ec <_restgpr_27_x> =============================================================================== ffc139e8 : return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { ffc139e8: 94 21 ff d8 stwu r1,-40(r1) ffc139ec: 7c 08 02 a6 mflr r0 ffc139f0: bf a1 00 1c stmw r29,28(r1) ffc139f4: 7c 7f 1b 78 mr r31,r3 ffc139f8: 90 01 00 2c stw r0,44(r1) rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) ffc139fc: 89 23 00 89 lbz r9,137(r3) ffc13a00: 2f 89 00 00 cmpwi cr7,r9,0 ffc13a04: 41 9e 01 98 beq- cr7,ffc13b9c return RC_OK; if (fs_info->c.modified) ffc13a08: 89 23 00 88 lbz r9,136(r3) ffc13a0c: 2f 89 00 00 cmpwi cr7,r9,0 ffc13a10: 41 9e 01 60 beq- cr7,ffc13b70 { uint32_t sec_num = fs_info->c.blk_num; ffc13a14: 81 43 00 84 lwz r10,132(r3) bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && ffc13a18: 39 20 00 00 li r9,0 ffc13a1c: a1 03 00 18 lhz r8,24(r3) ffc13a20: 7f 8a 40 40 cmplw cr7,r10,r8 ffc13a24: 41 9c 00 14 blt- cr7,ffc13a38 ffc13a28: 81 23 00 20 lwz r9,32(r3) ffc13a2c: 7d 29 50 10 subfc r9,r9,r10 ffc13a30: 7d 29 49 10 subfe r9,r9,r9 ffc13a34: 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) ffc13a38: 2f 89 00 00 cmpwi cr7,r9,0 uint32_t ino ) { return (ino >= fs_info->uino_base); } ffc13a3c: 89 1f 00 02 lbz r8,2(r31) ffc13a40: 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) ffc13a44: 7d 3e 4b 78 mr r30,r9 ffc13a48: 41 9e 00 3c beq- cr7,ffc13a84 ffc13a4c: 89 3f 00 54 lbz r9,84(r31) ffc13a50: 2f 89 00 00 cmpwi cr7,r9,0 ffc13a54: 40 be 00 30 bne+ cr7,ffc13a84 <== NEVER TAKEN ffc13a58: 7c e8 38 50 subf r7,r8,r7 memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, ffc13a5c: 81 3f 00 8c lwz r9,140(r31) ffc13a60: 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, ffc13a64: 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); ffc13a68: 7c c7 38 30 slw r7,r6,r7 ffc13a6c: 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 - ffc13a70: 7d 47 50 50 subf r10,r7,r10 ffc13a74: 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); ffc13a78: 7d 48 40 30 slw r8,r10,r8 ffc13a7c: 7c 84 42 14 add r4,r4,r8 ffc13a80: 48 00 93 49 bl ffc1cdc8 fs_info->c.buf->buffer + blk_ofs, fs_info->vol.bps); sc = rtems_bdbuf_release_modified(fs_info->c.buf); ffc13a84: 80 7f 00 8c lwz r3,140(r31) ffc13a88: 4b ff e1 15 bl ffc11b9c if (sc != RTEMS_SUCCESSFUL) ffc13a8c: 2c 03 00 00 cmpwi r3,0 ffc13a90: 41 a2 00 08 beq+ ffc13a98 <== ALWAYS TAKEN ffc13a94: 48 00 00 ec b ffc13b80 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); fs_info->c.modified = 0; if (sec_of_fat && !fs_info->vol.mirror) ffc13a98: 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; ffc13a9c: 98 7f 00 88 stb r3,136(r31) if (sec_of_fat && !fs_info->vol.mirror) ffc13aa0: 41 9e 00 f4 beq- cr7,ffc13b94 ffc13aa4: 89 3f 00 54 lbz r9,84(r31) ffc13aa8: 2f 89 00 00 cmpwi cr7,r9,0 ffc13aac: 41 9e 00 b0 beq- cr7,ffc13b5c <== ALWAYS TAKEN ffc13ab0: 48 00 00 e4 b ffc13b94 <== 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, ffc13ab4: 81 5f 00 1c lwz r10,28(r31) ffc13ab8: 81 3f 00 84 lwz r9,132(r31) ffc13abc: 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); ffc13ac0: 88 7f 00 0c lbz r3,12(r31) ffc13ac4: 7d 4a 4a 14 add r10,r10,r9 ffc13ac8: 89 3f 00 02 lbz r9,2(r31) ffc13acc: 7c 69 18 50 subf r3,r9,r3 ffc13ad0: 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); ffc13ad4: 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 - ffc13ad8: 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 ffc13adc: 7c 7d 48 31 slw. r29,r3,r9 ffc13ae0: 40 82 00 24 bne- ffc13b04 && fs_info->vol.bps == fs_info->vol.bytes_per_block) ffc13ae4: a1 5f 00 00 lhz r10,0(r31) ffc13ae8: a1 3f 00 0a lhz r9,10(r31) ffc13aec: 7f 8a 48 00 cmpw cr7,r10,r9 ffc13af0: 40 be 00 14 bne+ cr7,ffc13b04 { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); ffc13af4: 80 7f 00 64 lwz r3,100(r31) ffc13af8: 38 a1 00 08 addi r5,r1,8 ffc13afc: 4b ff dc f5 bl ffc117f0 ffc13b00: 48 00 00 10 b ffc13b10 } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); ffc13b04: 80 7f 00 64 lwz r3,100(r31) ffc13b08: 38 a1 00 08 addi r5,r1,8 ffc13b0c: 4b ff dd bd bl ffc118c8 } if ( sc != RTEMS_SUCCESSFUL) ffc13b10: 2f 83 00 00 cmpwi cr7,r3,0 ffc13b14: 41 be 00 08 beq+ cr7,ffc13b1c <== ALWAYS TAKEN ffc13b18: 48 00 00 2c b ffc13b44 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); ffc13b1c: 81 21 00 08 lwz r9,8(r1) ffc13b20: 80 9f 00 90 lwz r4,144(r31) ffc13b24: 80 69 00 1c lwz r3,28(r9) ffc13b28: a0 bf 00 00 lhz r5,0(r31) ffc13b2c: 7c 63 ea 14 add r3,r3,r29 ffc13b30: 48 00 92 99 bl ffc1cdc8 sc = rtems_bdbuf_release_modified(bd); ffc13b34: 80 61 00 08 lwz r3,8(r1) ffc13b38: 4b ff e0 65 bl ffc11b9c if ( sc != RTEMS_SUCCESSFUL) ffc13b3c: 2f 83 00 00 cmpwi cr7,r3,0 ffc13b40: 41 be 00 10 beq+ cr7,ffc13b50 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(ENOMEM); ffc13b44: 48 00 85 a5 bl ffc1c0e8 <__errno> <== NOT EXECUTED ffc13b48: 39 20 00 0c li r9,12 <== NOT EXECUTED ffc13b4c: 48 00 00 3c b ffc13b88 <== NOT EXECUTED if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) ffc13b50: 3b de 00 01 addi r30,r30,1 ffc13b54: 57 de 06 3e clrlwi r30,r30,24 ffc13b58: 48 00 00 08 b ffc13b60 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) ffc13b5c: 3b c0 00 01 li r30,1 { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) ffc13b60: 89 3f 00 0d lbz r9,13(r31) ffc13b64: 7f 89 f0 40 cmplw cr7,r9,r30 ffc13b68: 41 9d ff 4c bgt+ cr7,ffc13ab4 ffc13b6c: 48 00 00 28 b ffc13b94 } } } else { sc = rtems_bdbuf_release(fs_info->c.buf); ffc13b70: 80 63 00 8c lwz r3,140(r3) ffc13b74: 4b ff df 4d bl ffc11ac0 if (sc != RTEMS_SUCCESSFUL) ffc13b78: 2f 83 00 00 cmpwi cr7,r3,0 ffc13b7c: 41 be 00 18 beq+ cr7,ffc13b94 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EIO); ffc13b80: 48 00 85 69 bl ffc1c0e8 <__errno> <== NOT EXECUTED ffc13b84: 39 20 00 05 li r9,5 <== NOT EXECUTED ffc13b88: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc13b8c: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc13b90: 48 00 00 10 b ffc13ba0 <== NOT EXECUTED } fs_info->c.state = FAT_CACHE_EMPTY; ffc13b94: 39 20 00 00 li r9,0 ffc13b98: 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; ffc13b9c: 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; } ffc13ba0: 39 61 00 28 addi r11,r1,40 ffc13ba4: 4b fe da 50 b ffc015f4 <_restgpr_29_x> =============================================================================== ffc13990 : 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)) ) ffc13990: 2c 04 00 00 cmpwi r4,0 ffc13994: 40 82 00 28 bne- ffc139bc ffc13998: 89 23 00 0e lbz r9,14(r3) ffc1399c: 71 2a 00 03 andi. r10,r9,3 ffc139a0: 41 a2 00 1c beq+ ffc139bc <== 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); ffc139a4: 89 43 00 0c lbz r10,12(r3) ffc139a8: 89 23 00 02 lbz r9,2(r3) ffc139ac: 80 63 00 20 lwz r3,32(r3) ffc139b0: 7d 29 50 50 subf r9,r9,r10 ffc139b4: 7c 63 4c 30 srw r3,r3,r9 ffc139b8: 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); ffc139bc: 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; ffc139c0: 39 44 ff fe addi r10,r4,-2 blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); ffc139c4: 89 03 00 08 lbz r8,8(r3) ffc139c8: 7d 09 40 50 subf r8,r9,r8 ffc139cc: 7d 4a 40 30 slw r10,r10,r8 ffc139d0: 89 03 00 02 lbz r8,2(r3) ffc139d4: 80 63 00 34 lwz r3,52(r3) ffc139d8: 7d 28 48 50 subf r9,r8,r9 ffc139dc: 7c 63 4c 30 srw r3,r3,r9 blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); ffc139e0: 7c 63 52 14 add r3,r3,r10 } return blk; } ffc139e4: 4e 80 00 20 blr =============================================================================== ffc12ca0 : 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)) ) ffc12ca0: 2c 04 00 00 cmpwi r4,0 ffc12ca4: 40 82 00 18 bne- ffc12cbc ffc12ca8: 89 23 00 0e lbz r9,14(r3) ffc12cac: 71 2a 00 03 andi. r10,r9,3 ffc12cb0: 41 a2 00 0c beq+ ffc12cbc <== NEVER TAKEN return fs_info->vol.rdir_loc; ffc12cb4: 80 63 00 20 lwz r3,32(r3) ffc12cb8: 4e 80 00 20 blr return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + ffc12cbc: 89 23 00 05 lbz r9,5(r3) ffc12cc0: 39 44 ff fe addi r10,r4,-2 ffc12cc4: 7d 4a 48 30 slw r10,r10,r9 ffc12cc8: 81 23 00 34 lwz r9,52(r3) ffc12ccc: 7c 6a 4a 14 add r3,r10,r9 fs_info->vol.data_fsec); } ffc12cd0: 4e 80 00 20 blr =============================================================================== ffc13dc0 : fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { ffc13dc0: 94 21 ff c0 stwu r1,-64(r1) ffc13dc4: 7c 08 02 a6 mflr r0 ffc13dc8: 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)); ffc13dcc: 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) { ffc13dd0: be e1 00 1c stmw r23,28(r1) ffc13dd4: 7c 7f 1b 78 mr r31,r3 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); ffc13dd8: 7d 25 48 50 subf r9,r5,r9 ffc13ddc: 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) { ffc13de0: 7c bd 2b 78 mr r29,r5 ffc13de4: 7c f8 3b 78 mr r24,r7 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); ffc13de8: 7c de 33 78 mr r30,r6 ffc13dec: 40 9d 00 08 ble- cr7,ffc13df4 <== ALWAYS TAKEN ffc13df0: 7d 3e 4b 78 mr r30,r9 <== NOT EXECUTED uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); ffc13df4: 7f e3 fb 78 mr r3,r31 ffc13df8: 4b ff fb 99 bl ffc13990 uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; ffc13dfc: 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; ffc13e00: 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; ffc13e04: 7f bb cc 30 srw r27,r29,r25 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ffc13e08: 7f 79 c8 30 slw r25,r27,r25 ffc13e0c: 7f 39 e8 50 subf r25,r25,r29 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; ffc13e10: 7f 63 da 14 add r27,r3,r27 ffc13e14: 3a e0 00 01 li r23,1 ffc13e18: 48 00 00 9c b ffc13eb4 while ( (RC_OK == rc) && (0 < bytes_to_write)) { uint32_t c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); ffc13e1c: a1 5f 00 0a lhz r10,10(r31) ffc13e20: 7d 39 50 50 subf r9,r25,r10 ffc13e24: 7f 89 f0 40 cmplw cr7,r9,r30 ffc13e28: 7d 3d 4b 78 mr r29,r9 ffc13e2c: 40 9d 00 08 ble- cr7,ffc13e34 <== ALWAYS TAKEN ffc13e30: 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)); ffc13e34: 7f 9d 48 40 cmplw cr7,r29,r9 ffc13e38: 7f bc eb 78 mr r28,r29 ffc13e3c: 40 9d 00 08 ble- cr7,ffc13e44 <== ALWAYS TAKEN ffc13e40: 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) ffc13e44: 2f 9c 00 00 cmpwi cr7,r28,0 uint32_t ino ) { return (ino >= fs_info->uino_base); } ffc13e48: 89 3f 00 02 lbz r9,2(r31) ffc13e4c: 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) ffc13e50: 41 9e 00 7c beq- cr7,ffc13ecc <== NEVER TAKEN { if (bytes_to_write == fs_info->vol.bytes_per_block) ffc13e54: 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); ffc13e58: 7c 89 20 50 subf r4,r9,r4 ffc13e5c: 7f 64 20 30 slw r4,r27,r4 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); ffc13e60: 7f e3 fb 78 mr r3,r31 ffc13e64: 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) ffc13e68: 41 9e 00 08 beq- cr7,ffc13e70 { 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); ffc13e6c: 38 a0 00 01 li r5,1 ffc13e70: 38 c1 00 08 addi r6,r1,8 ffc13e74: 4b ff fd 35 bl ffc13ba8 if (RC_OK == rc) ffc13e78: 2f 83 00 00 cmpwi cr7,r3,0 ffc13e7c: 40 be 00 20 bne+ cr7,ffc13e9c <== NEVER TAKEN { memset(blk_buf + offset, pattern, bytes_to_write); ffc13e80: 80 61 00 08 lwz r3,8(r1) ffc13e84: 7f 04 c3 78 mr r4,r24 ffc13e88: 7f 85 e3 78 mr r5,r28 ffc13e8c: 7c 63 ca 14 add r3,r3,r25 ffc13e90: 48 00 90 2d bl ffc1cebc } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; ffc13e94: 9a ff 00 88 stb r23,136(r31) ffc13e98: 48 00 00 34 b ffc13ecc fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) ffc13e9c: 7f 9d 18 00 cmpw cr7,r29,r3 ffc13ea0: 40 be 00 24 bne+ cr7,ffc13ec4 <== NEVER TAKEN rc = -1; else { bytes_to_write -= ret; ffc13ea4: 7f dd f0 50 subf r30,r29,r30 bytes_written += ret; ffc13ea8: 7f 5a ea 14 add r26,r26,r29 ++cur_blk; ffc13eac: 3b 7b 00 01 addi r27,r27,1 ffc13eb0: 3b 20 00 00 li r25,0 ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) ffc13eb4: 2f 9e 00 00 cmpwi cr7,r30,0 ffc13eb8: 40 9e ff 64 bne+ cr7,ffc13e1c ffc13ebc: 7f 43 d3 78 mr r3,r26 ffc13ec0: 48 00 00 14 b ffc13ed4 fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) ffc13ec4: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc13ec8: 48 00 00 0c b ffc13ed4 <== NOT EXECUTED } } if (RC_OK != rc) return rc; else return bytes_to_write; ffc13ecc: 7f 83 e3 78 mr r3,r28 ffc13ed0: 4b ff ff cc b ffc13e9c } if (RC_OK != rc) return rc; else return bytes_written; } ffc13ed4: 39 61 00 40 addi r11,r1,64 ffc13ed8: 4b fe d7 04 b ffc015dc <_restgpr_23_x> =============================================================================== ffc13edc : const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { ffc13edc: 94 21 ff c0 stwu r1,-64(r1) ffc13ee0: 7c 08 02 a6 mflr r0 ffc13ee4: 7d 80 00 26 mfcr r12 ffc13ee8: 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)); ffc13eec: 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) { ffc13ef0: be e1 00 1c stmw r23,28(r1) ffc13ef4: 7c 7f 1b 78 mr r31,r3 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); ffc13ef8: 7d 25 48 50 subf r9,r5,r9 ffc13efc: 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) { ffc13f00: 91 81 00 18 stw r12,24(r1) ffc13f04: 7c bd 2b 78 mr r29,r5 ffc13f08: 7c f8 3b 78 mr r24,r7 ffc13f0c: 7d 1c 43 78 mr r28,r8 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); ffc13f10: 7c de 33 78 mr r30,r6 ffc13f14: 40 9d 00 08 ble- cr7,ffc13f1c <== ALWAYS TAKEN ffc13f18: 7d 3e 4b 78 mr r30,r9 <== NOT EXECUTED uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); ffc13f1c: 7f e3 fb 78 mr r3,r31 ffc13f20: 4b ff fa 71 bl ffc13990 uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); ffc13f24: 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; ffc13f28: 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); ffc13f2c: 7f ba cc 30 srw r26,r29,r25 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ffc13f30: 7f 59 c8 30 slw r25,r26,r25 ffc13f34: 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; ffc13f38: 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 ffc13f3c: 2e 1c 00 00 cmpwi cr4,r28,0 ffc13f40: 3a e0 00 01 li r23,1 ffc13f44: 48 00 00 a4 b ffc13fe8 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)); ffc13f48: a1 5f 00 0a lhz r10,10(r31) ffc13f4c: 7d 39 50 50 subf r9,r25,r10 ffc13f50: 7f 89 f0 40 cmplw cr7,r9,r30 ffc13f54: 7d 3d 4b 78 mr r29,r9 ffc13f58: 40 9d 00 08 ble- cr7,ffc13f60 ffc13f5c: 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)); ffc13f60: 7f 9d 48 40 cmplw cr7,r29,r9 ffc13f64: 7f bc eb 78 mr r28,r29 ffc13f68: 40 9d 00 08 ble- cr7,ffc13f70 <== ALWAYS TAKEN ffc13f6c: 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) ffc13f70: 2f 9c 00 00 cmpwi cr7,r28,0 uint32_t ino ) { return (ino >= fs_info->uino_base); } ffc13f74: 89 3f 00 02 lbz r9,2(r31) ffc13f78: 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) ffc13f7c: 41 9e 00 84 beq- cr7,ffc14000 <== 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); ffc13f80: 7c 89 20 50 subf r4,r9,r4 ffc13f84: 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); ffc13f88: 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 ffc13f8c: 40 92 00 10 bne- cr4,ffc13f9c || (bytes_to_write == fs_info->vol.bytes_per_block)) ffc13f90: 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); ffc13f94: 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)) ffc13f98: 40 9e 00 0c bne- cr7,ffc13fa4 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); ffc13f9c: 38 a0 00 02 li r5,2 ffc13fa0: 48 00 00 04 b ffc13fa4 } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); ffc13fa4: 38 c1 00 08 addi r6,r1,8 ffc13fa8: 4b ff fc 01 bl ffc13ba8 if (RC_OK == rc) ffc13fac: 2f 83 00 00 cmpwi cr7,r3,0 ffc13fb0: 40 be 00 20 bne+ cr7,ffc13fd0 <== NEVER TAKEN { memcpy(blk_buf + offset, buf, bytes_to_write); ffc13fb4: 80 61 00 08 lwz r3,8(r1) ffc13fb8: 7c 98 da 14 add r4,r24,r27 ffc13fbc: 7f 85 e3 78 mr r5,r28 ffc13fc0: 7c 63 ca 14 add r3,r3,r25 ffc13fc4: 48 00 8e 05 bl ffc1cdc8 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; ffc13fc8: 9a ff 00 88 stb r23,136(r31) ffc13fcc: 48 00 00 34 b ffc14000 cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) ffc13fd0: 7f 9d 18 00 cmpw cr7,r29,r3 ffc13fd4: 40 be 00 24 bne+ cr7,ffc13ff8 <== NEVER TAKEN rc = -1; else { bytes_to_write -= ret; ffc13fd8: 7f dd f0 50 subf r30,r29,r30 bytes_written += ret; ffc13fdc: 7f 7b ea 14 add r27,r27,r29 ++cur_blk; ffc13fe0: 3b 5a 00 01 addi r26,r26,1 ffc13fe4: 3b 20 00 00 li r25,0 uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) ffc13fe8: 2f 9e 00 00 cmpwi cr7,r30,0 ffc13fec: 40 9e ff 5c bne+ cr7,ffc13f48 ffc13ff0: 7f 63 db 78 mr r3,r27 ffc13ff4: 48 00 00 14 b ffc14008 cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) ffc13ff8: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc13ffc: 48 00 00 0c b ffc14008 <== NOT EXECUTED } } if (RC_OK != rc) return rc; else return bytes_to_write; ffc14000: 7f 83 e3 78 mr r3,r28 ffc14004: 4b ff ff cc b ffc13fd0 } if (RC_OK != rc) return rc; else return bytes_written; } ffc14008: 81 81 00 18 lwz r12,24(r1) ffc1400c: 39 61 00 40 addi r11,r1,64 ffc14010: 7d 80 81 20 mtcrf 8,r12 ffc14014: 4b fe d5 c8 b ffc015dc <_restgpr_23_x> =============================================================================== ffc13254 : int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { ffc13254: 94 21 ff e8 stwu r1,-24(r1) ffc13258: 7c 08 02 a6 mflr r0 ffc1325c: 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) ffc13260: 81 24 00 08 lwz r9,8(r4) int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { ffc13264: bf a1 00 0c stmw r29,12(r1) ffc13268: 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) ffc1326c: 2b 89 00 01 cmplwi cr7,r9,1 ffc13270: 40 9d 00 14 ble- cr7,ffc13284 { fat_fd->links_num--; ffc13274: 39 29 ff ff addi r9,r9,-1 ffc13278: 91 24 00 08 stw r9,8(r4) return rc; ffc1327c: 38 60 00 00 li r3,0 ffc13280: 48 00 00 90 b ffc13310 } key = fat_construct_key(fs_info, &fat_fd->dir_pos.sname); if (fat_fd->flags & FAT_FILE_REMOVED) ffc13284: 89 24 00 30 lbz r9,48(r4) ffc13288: 7c 7e 1b 78 mr r30,r3 ffc1328c: 71 3d 00 01 andi. r29,r9,1 ffc13290: 41 82 00 40 beq- ffc132d0 { rc = fat_file_truncate(fs_info, fat_fd, 0); ffc13294: 38 a0 00 00 li r5,0 ffc13298: 4b ff fe a9 bl ffc13140 if ( rc != RC_OK ) ffc1329c: 2c 03 00 00 cmpwi r3,0 ffc132a0: 40 a2 00 70 bne+ ffc13310 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); ffc132a4: 7f e3 fb 78 mr r3,r31 ffc132a8: 48 00 3a e9 bl ffc16d90 <_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) ) ffc132ac: 80 9f 00 0c lwz r4,12(r31) ffc132b0: 7f c3 f3 78 mr r3,r30 ffc132b4: 48 00 17 e5 bl ffc14a98 ffc132b8: 2f 83 00 00 cmpwi cr7,r3,0 ffc132bc: 41 be 00 34 beq+ cr7,ffc132f0 <== ALWAYS TAKEN fat_free_unique_ino(fs_info, fat_fd->ino); ffc132c0: 80 9f 00 0c lwz r4,12(r31) <== NOT EXECUTED ffc132c4: 7f c3 f3 78 mr r3,r30 <== NOT EXECUTED ffc132c8: 48 00 17 a5 bl ffc14a6c <== NOT EXECUTED ffc132cc: 48 00 00 24 b ffc132f0 <== NOT EXECUTED free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) ffc132d0: 80 84 00 0c lwz r4,12(r4) ffc132d4: 48 00 17 c5 bl ffc14a98 ffc132d8: 2f 83 00 00 cmpwi cr7,r3,0 ffc132dc: 41 9e 00 0c beq- cr7,ffc132e8 { fat_fd->links_num = 0; ffc132e0: 93 bf 00 08 stw r29,8(r31) ffc132e4: 48 00 00 14 b ffc132f8 ffc132e8: 7f e3 fb 78 mr r3,r31 ffc132ec: 48 00 3a a5 bl ffc16d90 <_Chain_Extract> } else { _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); free(fat_fd); ffc132f0: 7f e3 fb 78 mr r3,r31 ffc132f4: 4b ff 29 e9 bl ffc05cdc * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); return rc; } ffc132f8: 80 01 00 1c lwz r0,28(r1) } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); ffc132fc: 7f c3 f3 78 mr r3,r30 return rc; } ffc13300: bb a1 00 0c lmw r29,12(r1) ffc13304: 7c 08 03 a6 mtlr r0 ffc13308: 38 21 00 18 addi r1,r1,24 } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); ffc1330c: 48 00 06 dc b ffc139e8 return rc; } ffc13310: 39 61 00 18 addi r11,r1,24 ffc13314: 4b fe e2 e0 b ffc015f4 <_restgpr_29_x> =============================================================================== ffc133ec : fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { ffc133ec: 94 21 ff c0 stwu r1,-64(r1) ffc133f0: 7c 08 02 a6 mflr r0 int rc = RC_OK; uint32_t chain = 0; ffc133f4: 39 20 00 00 li r9,0 fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { ffc133f8: be e1 00 1c stmw r23,28(r1) ffc133fc: 7c f8 3b 78 mr r24,r7 ffc13400: 7c 9e 23 78 mr r30,r4 ffc13404: 90 01 00 44 stw r0,68(r1) ffc13408: 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; ffc1340c: 90 d8 00 00 stw r6,0(r24) uint32_t new_length, uint32_t *a_length ) { int rc = RC_OK; uint32_t chain = 0; ffc13410: 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; ffc13414: 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) ffc13418: 81 24 00 18 lwz r9,24(r4) ffc1341c: 7f 86 48 40 cmplw cr7,r6,r9 ffc13420: 41 bd 00 0c bgt+ cr7,ffc1342c return RC_OK; ffc13424: 3b a0 00 00 li r29,0 ffc13428: 48 00 02 04 b ffc1362c if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && ffc1342c: 81 44 00 20 lwz r10,32(r4) ffc13430: 7c 7f 1b 78 mr r31,r3 ffc13434: 7c b7 2b 78 mr r23,r5 ffc13438: 2f 8a 00 01 cmpwi cr7,r10,1 ffc1343c: 40 be 00 20 bne+ cr7,ffc1345c ffc13440: 81 44 00 24 lwz r10,36(r4) ffc13444: 2f 8a 00 00 cmpwi cr7,r10,0 ffc13448: 40 9e 00 14 bne- cr7,ffc1345c <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) ffc1344c: 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)) && ffc13450: 71 48 00 03 andi. r8,r10,3 ffc13454: 41 a2 00 08 beq+ ffc1345c <== NEVER TAKEN ffc13458: 48 00 00 c8 b ffc13520 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) rtems_set_errno_and_return_minus_one( ENOSPC ); bytes_remain = (fs_info->vol.bpc - ffc1345c: 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; ffc13460: 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))) & ffc13464: 39 5b ff ff addi r10,r27,-1 ffc13468: 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 - ffc1346c: 7f 79 d8 50 subf r27,r25,r27 ffc13470: 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; ffc13474: 7d 49 e0 50 subf r10,r9,r28 if (bytes2add > bytes_remain) ffc13478: 7f 8a d8 40 cmplw cr7,r10,r27 ffc1347c: 40 9d 00 08 ble- cr7,ffc13484 bytes2add -= bytes_remain; ffc13480: 7f 5b 50 50 subf r26,r27,r10 else bytes2add = 0; if (zero_fill && bytes_remain > 0) { ffc13484: 2f 97 00 00 cmpwi cr7,r23,0 ffc13488: 41 9e 00 50 beq- cr7,ffc134d8 ffc1348c: 2f 9b 00 00 cmpwi cr7,r27,0 ffc13490: 41 be 00 48 beq+ cr7,ffc134d8 uint32_t start = fat_fd->fat_file_size; uint32_t cl_start = start >> fs_info->vol.bpc_log2; ffc13494: 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); ffc13498: 7f e3 fb 78 mr r3,r31 ffc1349c: 7f c4 f3 78 mr r4,r30 ffc134a0: 7d 25 2c 30 srw r5,r9,r5 ffc134a4: 38 c1 00 08 addi r6,r1,8 ffc134a8: 4b ff f8 85 bl ffc12d2c if (rc != RC_OK) ffc134ac: 7c 9d 23 79 mr. r29,r4 ffc134b0: 40 a2 01 7c bne+ ffc1362c <== NEVER TAKEN return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); ffc134b4: 80 81 00 08 lwz r4,8(r1) ffc134b8: 7f e3 fb 78 mr r3,r31 ffc134bc: 7f 25 cb 78 mr r5,r25 ffc134c0: 7f 66 db 78 mr r6,r27 ffc134c4: 38 e0 00 00 li r7,0 ffc134c8: 48 00 08 f9 bl ffc13dc0 if (bytes_remain != bytes_written) return -1; ffc134cc: 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) ffc134d0: 7f 9b 18 00 cmpw cr7,r27,r3 ffc134d4: 40 be 01 58 bne+ cr7,ffc1362c <== 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) ffc134d8: 2f 9a 00 00 cmpwi cr7,r26,0 ffc134dc: 41 9e ff 48 beq+ cr7,ffc13424 return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; ffc134e0: 89 3f 00 08 lbz r9,8(r31) ffc134e4: 3b 3a ff ff addi r25,r26,-1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, ffc134e8: 7f e3 fb 78 mr r3,r31 * file ) - return */ if (bytes2add == 0) return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; ffc134ec: 7f 39 4c 30 srw r25,r25,r9 ffc134f0: 3b 39 00 01 addi r25,r25,1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, ffc134f4: 38 81 00 14 addi r4,r1,20 ffc134f8: 7f 25 cb 78 mr r5,r25 ffc134fc: 38 c1 00 08 addi r6,r1,8 ffc13500: 38 e1 00 0c addi r7,r1,12 ffc13504: 7e e8 bb 78 mr r8,r23 ffc13508: 48 00 70 b1 bl ffc1a5b8 &cls_added, &last_cl, zero_fill); /* this means that low level I/O error occured */ if (rc != RC_OK) ffc1350c: 7c 7d 1b 79 mr. r29,r3 ffc13510: 40 82 01 1c bne- ffc1362c <== NEVER TAKEN return rc; /* this means that no space left on device */ if ((cls_added == 0) && (bytes_remain == 0)) ffc13514: 81 21 00 08 lwz r9,8(r1) ffc13518: 7f 6a 4b 79 or. r10,r27,r9 ffc1351c: 40 a2 00 18 bne+ ffc13534 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(ENOSPC); ffc13520: 48 00 8b c9 bl ffc1c0e8 <__errno> ffc13524: 39 20 00 1c li r9,28 ffc13528: 91 23 00 00 stw r9,0(r3) ffc1352c: 3b a0 ff ff li r29,-1 ffc13530: 48 00 00 fc b ffc1362c /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) ffc13534: 7f 99 48 00 cmpw cr7,r25,r9 ffc13538: 41 9e 00 24 beq- cr7,ffc1355c <== ALWAYS TAKEN { new_length -= bytes2add & (fs_info->vol.bpc - 1); ffc1353c: a1 5f 00 06 lhz r10,6(r31) <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; ffc13540: 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); ffc13544: 39 4a ff ff addi r10,r10,-1 <== NOT EXECUTED ffc13548: 7f 5a 50 38 and r26,r26,r10 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; ffc1354c: 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); ffc13550: 7f 9a e0 50 subf r28,r26,r28 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; ffc13554: 7d 29 50 30 slw r9,r9,r10 <== NOT EXECUTED ffc13558: 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 ) ffc1355c: 80 de 00 18 lwz r6,24(r30) ffc13560: 2f 86 00 00 cmpwi cr7,r6,0 ffc13564: 40 9e 00 18 bne- cr7,ffc1357c { fat_fd->map.disk_cln = fat_fd->cln = chain; ffc13568: 81 21 00 14 lwz r9,20(r1) fat_fd->map.file_cln = 0; ffc1356c: 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; ffc13570: 91 3e 00 1c stw r9,28(r30) ffc13574: 91 3e 00 38 stw r9,56(r30) ffc13578: 48 00 00 64 b ffc135dc fat_fd->map.file_cln = 0; } else { if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE) ffc1357c: 81 3e 00 3c lwz r9,60(r30) ffc13580: 2f 89 ff ff cmpwi cr7,r9,-1 ffc13584: 41 9e 00 0c beq- cr7,ffc13590 <== NEVER TAKEN { old_last_cl = fat_fd->map.last_cln; ffc13588: 91 21 00 10 stw r9,16(r1) ffc1358c: 48 00 00 2c b ffc135b8 } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, ffc13590: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc13594: 7f c4 f3 78 mr r4,r30 <== NOT EXECUTED ffc13598: 38 a0 00 01 li r5,1 <== NOT EXECUTED ffc1359c: 38 c6 ff ff addi r6,r6,-1 <== NOT EXECUTED ffc135a0: 38 e1 00 10 addi r7,r1,16 <== NOT EXECUTED ffc135a4: 4c c6 31 82 crclr 4*cr1+eq <== NOT EXECUTED ffc135a8: 4b ff fd 71 bl ffc13318 <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) ffc135ac: 7c 7b 1b 79 mr. r27,r3 <== NOT EXECUTED ffc135b0: 41 a2 00 08 beq+ ffc135b8 <== NOT EXECUTED ffc135b4: 48 00 00 5c b ffc13610 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, chain); return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); ffc135b8: 80 81 00 10 lwz r4,16(r1) ffc135bc: 7f e3 fb 78 mr r3,r31 ffc135c0: 80 a1 00 14 lwz r5,20(r1) ffc135c4: 48 00 6c 85 bl ffc1a248 if ( rc != RC_OK ) ffc135c8: 7c 7b 1b 79 mr. r27,r3 { fat_free_fat_clusters_chain(fs_info, chain); ffc135cc: 7f e3 fb 78 mr r3,r31 return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); if ( rc != RC_OK ) ffc135d0: 41 a2 00 08 beq+ ffc135d8 <== ALWAYS TAKEN ffc135d4: 48 00 00 40 b ffc13614 <== NOT EXECUTED { fat_free_fat_clusters_chain(fs_info, chain); return rc; } fat_buf_release(fs_info); ffc135d8: 48 00 04 11 bl ffc139e8 } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) ffc135dc: 81 21 00 08 lwz r9,8(r1) ffc135e0: 2f 89 00 00 cmpwi cr7,r9,0 ffc135e4: 41 9e 00 40 beq- cr7,ffc13624 <== NEVER TAKEN { fat_fd->map.last_cln = last_cl; ffc135e8: 81 21 00 0c lwz r9,12(r1) ffc135ec: 91 3e 00 3c stw r9,60(r30) if (fat_fd->fat_file_type == FAT_DIRECTORY) ffc135f0: 81 3e 00 10 lwz r9,16(r30) ffc135f4: 2f 89 00 00 cmpwi cr7,r9,0 ffc135f8: 40 be 00 2c bne+ cr7,ffc13624 { rc = fat_init_clusters_chain(fs_info, chain); ffc135fc: 80 81 00 14 lwz r4,20(r1) ffc13600: 7f e3 fb 78 mr r3,r31 ffc13604: 48 00 13 05 bl ffc14908 if ( rc != RC_OK ) ffc13608: 7c 7b 1b 79 mr. r27,r3 ffc1360c: 41 a2 00 18 beq+ ffc13624 <== ALWAYS TAKEN { fat_free_fat_clusters_chain(fs_info, chain); ffc13610: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc13614: 80 81 00 14 lwz r4,20(r1) <== NOT EXECUTED ffc13618: 7f 7d db 78 mr r29,r27 <== NOT EXECUTED ffc1361c: 48 00 6e c9 bl ffc1a4e4 <== NOT EXECUTED ffc13620: 48 00 00 0c b ffc1362c <== NOT EXECUTED return rc; } } } *a_length = new_length; ffc13624: 93 98 00 00 stw r28,0(r24) fat_fd->fat_file_size = new_length; ffc13628: 93 9e 00 18 stw r28,24(r30) return RC_OK; } ffc1362c: 39 61 00 40 addi r11,r1,64 ffc13630: 7f a3 eb 78 mr r3,r29 ffc13634: 4b fe df a8 b ffc015dc <_restgpr_23_x> =============================================================================== ffc13318 : fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { ffc13318: 94 21 ff d0 stwu r1,-48(r1) uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) ffc1331c: 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; ffc13320: 39 20 00 00 li r9,0 fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { ffc13324: 7c 08 02 a6 mflr r0 int rc = RC_OK; uint32_t cur_cln = 0; ffc13328: 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); ffc1332c: 39 20 00 03 li r9,3 ffc13330: 99 21 00 08 stb r9,8(r1) ffc13334: 39 21 00 38 addi r9,r1,56 ffc13338: 91 21 00 0c stw r9,12(r1) ffc1333c: 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, ...) { ffc13340: 90 01 00 34 stw r0,52(r1) ffc13344: bf c1 00 28 stmw r30,40(r1) ffc13348: 90 c1 00 1c stw r6,28(r1) ffc1334c: 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); ffc13350: 91 21 00 10 stw r9,16(r1) switch (cmd) ffc13354: 40 be 00 80 bne+ cr7,ffc133d4 <== 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 ) { ffc13358: 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 *); ffc1335c: 3b c0 00 05 li r30,5 va_start(ap, cmd); switch (cmd) { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ffc13360: 7c ca 33 78 mr r10,r6 ret = va_arg(ap, uint32_t *); ffc13364: 9b c1 00 08 stb r30,8(r1) /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { ffc13368: 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 *); ffc1336c: 7c ff 3b 78 mr r31,r7 /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { ffc13370: 41 bc 00 10 blt+ cr7,ffc13380 <== ALWAYS TAKEN va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); ffc13374: 48 00 8d 75 bl ffc1c0e8 <__errno> <== NOT EXECUTED ffc13378: 93 c3 00 00 stw r30,0(r3) <== NOT EXECUTED ffc1337c: 48 00 00 64 b ffc133e0 <== NOT EXECUTED } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && ffc13380: 81 24 00 20 lwz r9,32(r4) ffc13384: 2f 89 00 01 cmpwi cr7,r9,1 ffc13388: 40 9e 00 28 bne- cr7,ffc133b0 ffc1338c: 81 24 00 24 lwz r9,36(r4) ffc13390: 2f 89 00 00 cmpwi cr7,r9,0 ffc13394: 40 9e 00 1c bne- cr7,ffc133b0 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) ffc13398: 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)) && ffc1339c: 71 07 00 03 andi. r7,r8,3 ffc133a0: 41 82 00 10 beq- ffc133b0 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { /* cluster 0 (zero) reserved for root dir */ *ret = 0; ffc133a4: 91 3f 00 00 stw r9,0(r31) rc = RC_OK; ffc133a8: 38 60 00 00 li r3,0 break; ffc133ac: 48 00 00 38 b ffc133e4 } cl_start = pos >> fs_info->vol.bpc_log2; ffc133b0: 88 a3 00 08 lbz r5,8(r3) rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); ffc133b4: 38 c1 00 14 addi r6,r1,20 ffc133b8: 7d 45 2c 30 srw r5,r10,r5 ffc133bc: 4b ff f9 71 bl ffc12d2c if ( rc != RC_OK ) ffc133c0: 7c 83 23 79 mr. r3,r4 ffc133c4: 40 82 00 20 bne- ffc133e4 <== NEVER TAKEN break; *ret = cur_cln; ffc133c8: 81 21 00 14 lwz r9,20(r1) ffc133cc: 91 3f 00 00 stw r9,0(r31) break; ffc133d0: 48 00 00 14 b ffc133e4 default: errno = EINVAL; ffc133d4: 48 00 8d 15 bl ffc1c0e8 <__errno> <== NOT EXECUTED ffc133d8: 39 20 00 16 li r9,22 <== NOT EXECUTED ffc133dc: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED rc = -1; ffc133e0: 38 60 ff ff li r3,-1 <== NOT EXECUTED break; } va_end(ap); return rc; } ffc133e4: 39 61 00 30 addi r11,r1,48 ffc133e8: 4b fe e2 10 b ffc015f8 <_restgpr_30_x> =============================================================================== ffc12d2c : fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { ffc12d2c: 94 21 ff d0 stwu r1,-48(r1) ffc12d30: 7c 08 02 a6 mflr r0 ffc12d34: 90 01 00 34 stw r0,52(r1) int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) ffc12d38: 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 ) { ffc12d3c: bf 41 00 18 stmw r26,24(r1) ffc12d40: 7c 9f 23 78 mr r31,r4 int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) ffc12d44: 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 ) { ffc12d48: 7c be 2b 78 mr r30,r5 ffc12d4c: 7c dc 33 78 mr r28,r6 int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) ffc12d50: 40 be 00 10 bne+ cr7,ffc12d60 *disk_cln = fat_fd->map.disk_cln; ffc12d54: 81 24 00 38 lwz r9,56(r4) ffc12d58: 91 26 00 00 stw r9,0(r6) ffc12d5c: 48 00 00 70 b ffc12dcc { uint32_t cur_cln; uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) ffc12d60: 7f 85 48 40 cmplw cr7,r5,r9 ffc12d64: 7c 7a 1b 78 mr r26,r3 ffc12d68: 40 9d 00 14 ble- cr7,ffc12d7c { cur_cln = fat_fd->map.disk_cln; ffc12d6c: 81 44 00 38 lwz r10,56(r4) count = file_cln - fat_fd->map.file_cln; ffc12d70: 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; ffc12d74: 91 41 00 08 stw r10,8(r1) ffc12d78: 48 00 00 10 b ffc12d88 count = file_cln - fat_fd->map.file_cln; } else { cur_cln = fat_fd->cln; ffc12d7c: 81 24 00 1c lwz r9,28(r4) ffc12d80: 7c bb 2b 78 mr r27,r5 ffc12d84: 91 21 00 08 stw r9,8(r1) count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) ffc12d88: 3b a0 00 00 li r29,0 ffc12d8c: 48 00 00 28 b ffc12db4 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ffc12d90: 7f 43 d3 78 mr r3,r26 ffc12d94: 38 a1 00 08 addi r5,r1,8 ffc12d98: 48 00 72 f1 bl ffc1a088 if ( rc != RC_OK ) ffc12d9c: 2c 03 00 00 cmpwi r3,0 ffc12da0: 41 a2 00 10 beq+ ffc12db0 <== ALWAYS TAKEN return rc; ffc12da4: 7c 6b 1b 78 mr r11,r3 <== NOT EXECUTED ffc12da8: 7c 6a fe 70 srawi r10,r3,31 <== NOT EXECUTED ffc12dac: 48 00 00 28 b ffc12dd4 <== NOT EXECUTED cur_cln = fat_fd->cln; count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) ffc12db0: 3b bd 00 01 addi r29,r29,1 ffc12db4: 7f 9d d8 00 cmpw cr7,r29,r27 ffc12db8: 80 81 00 08 lwz r4,8(r1) ffc12dbc: 40 9e ff d4 bne+ cr7,ffc12d90 if ( rc != RC_OK ) return rc; } /* update cache */ fat_fd->map.file_cln = file_cln; ffc12dc0: 93 df 00 34 stw r30,52(r31) fat_fd->map.disk_cln = cur_cln; ffc12dc4: 90 9f 00 38 stw r4,56(r31) *disk_cln = cur_cln; ffc12dc8: 90 9c 00 00 stw r4,0(r28) } return RC_OK; ffc12dcc: 39 40 00 00 li r10,0 ffc12dd0: 39 60 00 00 li r11,0 } ffc12dd4: 7d 64 5b 78 mr r4,r11 ffc12dd8: 39 61 00 30 addi r11,r1,48 ffc12ddc: 7d 43 53 78 mr r3,r10 ffc12de0: 4b fe e8 08 b ffc015e8 <_restgpr_26_x> =============================================================================== ffc12de4 : fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { ffc12de4: 94 21 ff d8 stwu r1,-40(r1) ffc12de8: 7c 08 02 a6 mflr r0 ffc12dec: 7d 80 00 26 mfcr r12 ffc12df0: bf 21 00 0c stmw r25,12(r1) ffc12df4: 7c 7d 1b 78 mr r29,r3 ffc12df8: 7c 99 23 78 mr r25,r4 ffc12dfc: 90 01 00 2c stw r0,44(r1) ffc12e00: 7c bb 2b 78 mr r27,r5 ffc12e04: 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); ffc12e08: 4b ff fe cd bl ffc12cd4 uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { uint32_t mod = (key1) % FAT_HASH_MODULE; ffc12e0c: 54 7c 07 fe clrlwi r28,r3,31 rtems_chain_node *the_node = rtems_chain_first(hash + mod); ffc12e10: 1f 9c 00 0c mulli r28,r28,12 ffc12e14: 81 3d 00 6c lwz r9,108(r29) ffc12e18: 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; ffc12e1c: 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); ffc12e20: 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 )); ffc12e24: 3b 5a 00 04 addi r26,r26,4 ffc12e28: 48 00 00 30 b ffc12e58 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); ffc12e2c: 7f a3 eb 78 mr r3,r29 ffc12e30: 38 9f 00 20 addi r4,r31,32 ffc12e34: 4b ff fe a1 bl ffc12cd4 if ( (key1) == ck) ffc12e38: 7f 9e 18 00 cmpw cr7,r30,r3 ffc12e3c: 40 be 00 18 bne+ cr7,ffc12e54 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++; ffc12e40: 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; ffc12e44: 93 fb 00 00 stw r31,0(r27) lfat_fd->links_num++; ffc12e48: 39 29 00 01 addi r9,r9,1 ffc12e4c: 91 3f 00 08 stw r9,8(r31) ffc12e50: 48 00 00 f0 b ffc12f40 { *ret = (void *)the_node; return 0; } } the_node = the_node->next; ffc12e54: 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) ; ) ffc12e58: 7f 9f d0 00 cmpw cr7,r31,r26 ffc12e5c: 40 9e ff d0 bne+ cr7,ffc12e2c ffc12e60: 48 00 00 e8 b ffc12f48 { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); ffc12e64: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED ffc12e68: 38 9f 00 20 addi r4,r31,32 <== NOT EXECUTED ffc12e6c: 4b ff fe 69 bl ffc12cd4 <== NOT EXECUTED if ( (key1) == ck) ffc12e70: 7f 9e 18 00 cmpw cr7,r30,r3 <== NOT EXECUTED ffc12e74: 40 be 00 14 bne+ cr7,ffc12e88 <== NOT EXECUTED { if ( ((key2) == 0) || ((key2) == ffd->ino) ) ffc12e78: 41 92 00 24 beq- cr4,ffc12e9c <== NOT EXECUTED ffc12e7c: 81 3f 00 0c lwz r9,12(r31) <== NOT EXECUTED ffc12e80: 7f 9e 48 00 cmpw cr7,r30,r9 <== NOT EXECUTED ffc12e84: 41 9e 00 18 beq- cr7,ffc12e9c <== NOT EXECUTED { *ret = (void *)the_node; return 0; } } the_node = the_node->next; ffc12e88: 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) ; ) ffc12e8c: 7f 9f d0 00 cmpw cr7,r31,r26 ffc12e90: 40 9e ff d4 bne+ cr7,ffc12e64 <== NEVER TAKEN return 0; } } the_node = the_node->next; } return -1; ffc12e94: 3b 40 ff ff li r26,-1 ffc12e98: 48 00 00 08 b ffc12ea0 if ( (key1) == ck) { if ( ((key2) == 0) || ((key2) == ffd->ino) ) { *ret = (void *)the_node; return 0; ffc12e9c: 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)); ffc12ea0: 38 60 00 44 li r3,68 ffc12ea4: 4b ff 33 e9 bl ffc0628c if ( lfat_fd == NULL ) ffc12ea8: 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)); ffc12eac: 90 7b 00 00 stw r3,0(r27) ffc12eb0: 7c 7f 1b 78 mr r31,r3 if ( lfat_fd == NULL ) ffc12eb4: 40 be 00 08 bne+ cr7,ffc12ebc <== ALWAYS TAKEN ffc12eb8: 48 00 00 64 b ffc12f1c <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); ffc12ebc: 38 a0 00 44 li r5,68 ffc12ec0: 38 80 00 00 li r4,0 ffc12ec4: 48 00 9f f9 bl ffc1cebc lfat_fd->links_num = 1; ffc12ec8: 39 20 00 01 li r9,1 ffc12ecc: 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 ) ffc12ed0: 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; ffc12ed4: 89 3f 00 30 lbz r9,48(r31) ffc12ed8: 55 29 00 3c rlwinm r9,r9,0,0,30 ffc12edc: 99 3f 00 30 stb r9,48(r31) lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; ffc12ee0: 39 20 ff ff li r9,-1 ffc12ee4: 91 3f 00 3c stw r9,60(r31) lfat_fd->dir_pos = *dir_pos; ffc12ee8: 39 3f 00 20 addi r9,r31,32 ffc12eec: 7c b9 84 aa lswi r5,r25,16 ffc12ef0: 7c a9 85 aa stswi r5,r9,16 if ( rc != RC_OK ) ffc12ef4: 41 9e 00 0c beq- cr7,ffc12f00 <== NEVER TAKEN lfat_fd->ino = key; ffc12ef8: 93 df 00 0c stw r30,12(r31) ffc12efc: 48 00 00 34 b ffc12f30 else { lfat_fd->ino = fat_get_unique_ino(fs_info); ffc12f00: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED ffc12f04: 48 00 1a 89 bl ffc1498c <== NOT EXECUTED if ( lfat_fd->ino == 0 ) ffc12f08: 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); ffc12f0c: 90 7f 00 0c stw r3,12(r31) <== NOT EXECUTED if ( lfat_fd->ino == 0 ) ffc12f10: 40 be 00 20 bne+ cr7,ffc12f30 <== NOT EXECUTED { free((*fat_fd)); ffc12f14: 80 7b 00 00 lwz r3,0(r27) <== NOT EXECUTED ffc12f18: 4b ff 2d c5 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 ); ffc12f1c: 48 00 91 cd bl ffc1c0e8 <__errno> <== NOT EXECUTED ffc12f20: 39 20 00 0c li r9,12 <== NOT EXECUTED ffc12f24: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc12f28: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc12f2c: 48 00 00 34 b ffc12f60 <== 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); ffc12f30: 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 ); ffc12f34: 7f e4 fb 78 mr r4,r31 ffc12f38: 7c 63 e2 14 add r3,r3,r28 ffc12f3c: 4b ff 81 39 bl ffc0b074 <_Chain_Append> /* * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; ffc12f40: 38 60 00 00 li r3,0 ffc12f44: 48 00 00 1c b ffc12f60 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); ffc12f48: 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) ) ffc12f4c: 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); ffc12f50: 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; ffc12f54: 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 )); ffc12f58: 3b 5a 00 04 addi r26,r26,4 ffc12f5c: 4b ff ff 30 b ffc12e8c * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; } ffc12f60: 81 81 00 08 lwz r12,8(r1) ffc12f64: 39 61 00 28 addi r11,r1,40 ffc12f68: 7d 80 81 20 mtcrf 8,r12 ffc12f6c: 4b fe e6 78 b ffc015e4 <_restgpr_25_x> =============================================================================== ffc12f84 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { ffc12f84: 94 21 ff c0 stwu r1,-64(r1) ffc12f88: 7c 08 02 a6 mflr r0 int rc = RC_OK; ssize_t ret = 0; uint32_t cmpltd = 0; uint32_t cur_cln = 0; ffc12f8c: 39 20 00 00 li r9,0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { ffc12f90: 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) ffc12f94: 7c de 33 79 mr. r30,r6 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { ffc12f98: 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; ffc12f9c: 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) ffc12fa0: 41 82 01 8c beq- ffc1312c <== NEVER TAKEN /* * >= because start is offset and computed from 0 and file_size * computed from 1 */ if ( start >= fat_fd->fat_file_size ) ffc12fa4: 81 24 00 18 lwz r9,24(r4) ffc12fa8: 7c 7f 1b 78 mr r31,r3 ffc12fac: 7c 9d 23 78 mr r29,r4 ffc12fb0: 7f 85 48 40 cmplw cr7,r5,r9 ffc12fb4: 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; ffc12fb8: 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 ) ffc12fbc: 40 9c 01 7c bge- cr7,ffc13138 return FAT_EOF; if ((count > fat_fd->fat_file_size) || ffc12fc0: 7f 9e 48 40 cmplw cr7,r30,r9 ffc12fc4: 7c f7 3b 78 mr r23,r7 ffc12fc8: 41 9d 00 10 bgt- cr7,ffc12fd8 <== NEVER TAKEN (start > fat_fd->fat_file_size - count)) ffc12fcc: 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) || ffc12fd0: 7f 85 50 40 cmplw cr7,r5,r10 ffc12fd4: 40 9d 00 08 ble- cr7,ffc12fdc (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; ffc12fd8: 7f dc 48 50 subf r30,r28,r9 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && ffc12fdc: 81 3d 00 20 lwz r9,32(r29) ffc12fe0: 2f 89 00 01 cmpwi cr7,r9,1 ffc12fe4: 40 9e 00 5c bne- cr7,ffc13040 ffc12fe8: 81 3d 00 24 lwz r9,36(r29) ffc12fec: 2f 89 00 00 cmpwi cr7,r9,0 ffc12ff0: 40 9e 00 50 bne- cr7,ffc13040 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) ffc12ff4: 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)) && ffc12ff8: 71 2a 00 03 andi. r10,r9,3 ffc12ffc: 41 a2 00 44 beq+ ffc13040 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln); ffc13000: 80 9d 00 1c lwz r4,28(r29) ffc13004: 7f e3 fb 78 mr r3,r31 ffc13008: 4b ff fc 99 bl ffc12ca0 sec += (start >> fs_info->vol.sec_log2); ffc1300c: 88 9f 00 02 lbz r4,2(r31) byte = start & (fs_info->vol.bps - 1); ffc13010: a0 bf 00 00 lhz r5,0(r31) ret = _fat_block_read(fs_info, sec, byte, count, buf); ffc13014: 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); ffc13018: 7f 84 24 30 srw r4,r28,r4 byte = start & (fs_info->vol.bps - 1); ffc1301c: 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); ffc13020: 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); ffc13024: 7f 85 28 38 and r5,r28,r5 ffc13028: 7f e3 fb 78 mr r3,r31 ffc1302c: 7e e7 bb 78 mr r7,r23 ffc13030: 48 00 0c 41 bl ffc13c70 <_fat_block_read> if ( ret < 0 ) ffc13034: 2c 03 00 00 cmpwi r3,0 ffc13038: 40 a0 01 00 bge+ ffc13138 <== ALWAYS TAKEN ffc1303c: 48 00 00 f8 b ffc13134 <== NOT EXECUTED return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; ffc13040: 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); ffc13044: 3a c1 00 08 addi r22,r1,8 ffc13048: 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); ffc1304c: a3 7f 00 06 lhz r27,6(r31) return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; ffc13050: 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); ffc13054: 7f a4 eb 78 mr r4,r29 ffc13058: 7f 05 c3 78 mr r5,r24 ffc1305c: 7e c6 b3 78 mr r6,r22 ffc13060: 4b ff fc cd bl ffc12d2c if (rc != RC_OK) ffc13064: 2f 84 00 00 cmpwi cr7,r4,0 ffc13068: 7c 83 23 78 mr r3,r4 ffc1306c: 40 9e 00 cc bne- cr7,ffc13138 <== NEVER TAKEN return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); ffc13070: 3b 7b ff ff addi r27,r27,-1 ffc13074: 7f 9c d8 38 and r28,r28,r27 ffc13078: 7f 99 e3 78 mr r25,r28 ffc1307c: 3b 40 00 00 li r26,0 ffc13080: 3b 60 00 00 li r27,0 ffc13084: 48 00 00 7c b ffc13100 if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); ffc13088: a3 5f 00 06 lhz r26,6(r31) ffc1308c: 7f 59 d0 50 subf r26,r25,r26 ffc13090: 7f 9a f0 40 cmplw cr7,r26,r30 ffc13094: 40 9d 00 08 ble- cr7,ffc1309c ffc13098: 7f da f3 78 mr r26,r30 sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); ffc1309c: 80 81 00 08 lwz r4,8(r1) ffc130a0: 7f e3 fb 78 mr r3,r31 ffc130a4: 4b ff fb fd bl ffc12ca0 sec += (ofs >> fs_info->vol.sec_log2); ffc130a8: 88 9f 00 02 lbz r4,2(r31) byte = ofs & (fs_info->vol.bps - 1); ffc130ac: a0 bf 00 00 lhz r5,0(r31) ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); ffc130b0: 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); ffc130b4: 7f 24 24 30 srw r4,r25,r4 byte = ofs & (fs_info->vol.bps - 1); ffc130b8: 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); ffc130bc: 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); ffc130c0: 7f 25 28 38 and r5,r25,r5 ffc130c4: 7f e3 fb 78 mr r3,r31 ffc130c8: 7c f7 da 14 add r7,r23,r27 ffc130cc: 48 00 0b a5 bl ffc13c70 <_fat_block_read> if ( ret < 0 ) ffc130d0: 2f 83 00 00 cmpwi cr7,r3,0 ffc130d4: 41 9c 00 60 blt- cr7,ffc13134 <== NEVER TAKEN return -1; count -= c; ffc130d8: 7f da f0 50 subf r30,r26,r30 cmpltd += c; ffc130dc: 7f 7b d2 14 add r27,r27,r26 save_cln = cur_cln; ffc130e0: 83 41 00 08 lwz r26,8(r1) rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ffc130e4: 7f e3 fb 78 mr r3,r31 ffc130e8: 7f 44 d3 78 mr r4,r26 ffc130ec: 7e c5 b3 78 mr r5,r22 ffc130f0: 48 00 6f 99 bl ffc1a088 if ( rc != RC_OK ) return rc; ofs = 0; ffc130f4: 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 ) ffc130f8: 2c 03 00 00 cmpwi r3,0 ffc130fc: 40 82 00 3c bne- ffc13138 <== NEVER TAKEN rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) ffc13100: 2f 9e 00 00 cmpwi cr7,r30,0 ffc13104: 40 9e ff 84 bne+ cr7,ffc13088 } /* 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); ffc13108: 89 3f 00 08 lbz r9,8(r31) ffc1310c: 3b 9c ff ff addi r28,r28,-1 ffc13110: 7f 9c da 14 add r28,r28,r27 fat_fd->map.disk_cln = save_cln; ffc13114: 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); ffc13118: 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 + ffc1311c: 7f 1c c2 14 add r24,r28,r24 ffc13120: 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; ffc13124: 7f 63 db 78 mr r3,r27 ffc13128: 48 00 00 10 b ffc13138 uint32_t byte = 0; uint32_t c = 0; /* it couldn't be removed - otherwise cache update will be broken */ if (count == 0) return cmpltd; ffc1312c: 38 60 00 00 li r3,0 <== NOT EXECUTED ffc13130: 48 00 00 08 b ffc13138 <== 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; ffc13134: 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; } ffc13138: 39 61 00 40 addi r11,r1,64 ffc1313c: 4b fe e4 9c b ffc015d8 <_restgpr_22_x> =============================================================================== ffc138e0 : int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { ffc138e0: 94 21 ff d8 stwu r1,-40(r1) ffc138e4: 7c 08 02 a6 mflr r0 ffc138e8: 90 01 00 2c stw r0,44(r1) int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; ffc138ec: 81 24 00 1c lwz r9,28(r4) int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { ffc138f0: bf a1 00 1c stmw r29,28(r1) ffc138f4: 7c 7e 1b 78 mr r30,r3 ffc138f8: 7c 9f 23 78 mr r31,r4 int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; ffc138fc: 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)) && ffc13900: 81 24 00 20 lwz r9,32(r4) ffc13904: 2f 89 00 01 cmpwi cr7,r9,1 ffc13908: 40 be 00 28 bne+ cr7,ffc13930 ffc1390c: 81 24 00 24 lwz r9,36(r4) ffc13910: 2f 89 00 00 cmpwi cr7,r9,0 ffc13914: 40 9e 00 1c bne- cr7,ffc13930 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) ffc13918: 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)) && ffc1391c: 71 2a 00 03 andi. r10,r9,3 ffc13920: 41 a2 00 10 beq+ ffc13930 <== ALWAYS TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { fat_fd->fat_file_size = fs_info->vol.rdir_size; ffc13924: 81 23 00 2c lwz r9,44(r3) <== NOT EXECUTED ffc13928: 91 24 00 18 stw r9,24(r4) <== NOT EXECUTED ffc1392c: 48 00 00 58 b ffc13984 <== NOT EXECUTED return rc; } fat_fd->fat_file_size = 0; ffc13930: 39 20 00 00 li r9,0 ffc13934: 91 3f 00 18 stw r9,24(r31) while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) ffc13938: 48 00 00 30 b ffc13968 { save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ffc1393c: 7f c3 f3 78 mr r3,r30 ffc13940: 7f a4 eb 78 mr r4,r29 ffc13944: 38 a1 00 08 addi r5,r1,8 ffc13948: 48 00 67 41 bl ffc1a088 if ( rc != RC_OK ) ffc1394c: 2c 03 00 00 cmpwi r3,0 ffc13950: 40 82 00 38 bne- ffc13988 <== NEVER TAKEN return rc; fat_fd->fat_file_size += fs_info->vol.bpc; ffc13954: a1 5e 00 06 lhz r10,6(r30) ffc13958: 81 3f 00 18 lwz r9,24(r31) ffc1395c: 7d 29 52 14 add r9,r9,r10 ffc13960: 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; ffc13964: 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) ffc13968: 81 5e 00 10 lwz r10,16(r30) ffc1396c: 83 a1 00 08 lwz r29,8(r1) ffc13970: 7f a8 50 38 and r8,r29,r10 ffc13974: 81 5e 00 14 lwz r10,20(r30) ffc13978: 7f 88 50 40 cmplw cr7,r8,r10 ffc1397c: 41 9c ff c0 blt+ cr7,ffc1393c if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; } fat_fd->map.last_cln = save_cln; ffc13980: 91 3f 00 3c stw r9,60(r31) ffc13984: 38 60 00 00 li r3,0 return rc; } ffc13988: 39 61 00 28 addi r11,r1,40 ffc1398c: 4b fe dc 68 b ffc015f4 <_restgpr_29_x> =============================================================================== ffc13140 : fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { ffc13140: 94 21 ff d8 stwu r1,-40(r1) ffc13144: 7c 08 02 a6 mflr r0 int rc = RC_OK; uint32_t cur_cln = 0; ffc13148: 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 ) { ffc1314c: 90 01 00 2c stw r0,44(r1) int rc = RC_OK; uint32_t cur_cln = 0; ffc13150: 91 21 00 0c stw r9,12(r1) uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; ffc13154: 39 20 ff ff li r9,-1 ffc13158: 91 21 00 08 stw r9,8(r1) if ( new_length >= fat_fd->fat_file_size ) ffc1315c: 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 ) { ffc13160: bf a1 00 1c stmw r29,28(r1) ffc13164: 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 ) ffc13168: 7f 85 48 40 cmplw cr7,r5,r9 ffc1316c: 41 bc 00 0c blt+ cr7,ffc13178 return rc; ffc13170: 38 60 00 00 li r3,0 ffc13174: 48 00 00 d8 b ffc1324c assert(fat_fd->fat_file_size); ffc13178: 2f 89 00 00 cmpwi cr7,r9,0 ffc1317c: 40 be 00 24 bne+ cr7,ffc131a0 <== ALWAYS TAKEN ffc13180: 3c 60 ff c3 lis r3,-61 <== NOT EXECUTED ffc13184: 3c a0 ff c3 lis r5,-61 <== NOT EXECUTED ffc13188: 3c c0 ff c3 lis r6,-61 <== NOT EXECUTED ffc1318c: 38 63 c7 62 addi r3,r3,-14494 <== NOT EXECUTED ffc13190: 38 80 02 d1 li r4,721 <== NOT EXECUTED ffc13194: 38 a5 c7 50 addi r5,r5,-14512 <== NOT EXECUTED ffc13198: 38 c6 c7 aa addi r6,r6,-14422 <== NOT EXECUTED ffc1319c: 4b ff 29 81 bl ffc05b1c <__assert_func> <== NOT EXECUTED cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; ffc131a0: a3 e3 00 06 lhz r31,6(r3) ffc131a4: 7c 7d 1b 78 mr r29,r3 ffc131a8: 89 43 00 08 lbz r10,8(r3) ffc131ac: 3b ff ff ff addi r31,r31,-1 ffc131b0: 7f ff 2a 14 add r31,r31,r5 ffc131b4: 7f ff 54 30 srw r31,r31,r10 if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) ffc131b8: 7f ea 50 30 slw r10,r31,r10 ffc131bc: 7f 8a 48 40 cmplw cr7,r10,r9 ffc131c0: 40 bc ff b0 bge- cr7,ffc13170 return RC_OK; if (cl_start != 0) ffc131c4: 2f 9f 00 00 cmpwi cr7,r31,0 ffc131c8: 40 9e 00 24 bne- cr7,ffc131ec if (rc != RC_OK) return rc; } rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); ffc131cc: 7f a3 eb 78 mr r3,r29 ffc131d0: 7f c4 f3 78 mr r4,r30 ffc131d4: 7f e5 fb 78 mr r5,r31 ffc131d8: 38 c1 00 0c addi r6,r1,12 ffc131dc: 4b ff fb 51 bl ffc12d2c if (rc != RC_OK) ffc131e0: 7c 83 23 79 mr. r3,r4 ffc131e4: 40 a2 00 68 bne+ ffc1324c <== NEVER TAKEN ffc131e8: 48 00 00 1c b ffc13204 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); ffc131ec: 38 bf ff ff addi r5,r31,-1 ffc131f0: 38 c1 00 08 addi r6,r1,8 ffc131f4: 4b ff fb 39 bl ffc12d2c if (rc != RC_OK) ffc131f8: 7c 83 23 79 mr. r3,r4 ffc131fc: 41 82 ff d0 beq+ ffc131cc <== ALWAYS TAKEN ffc13200: 48 00 00 4c b ffc1324c <== 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); ffc13204: 80 81 00 0c lwz r4,12(r1) ffc13208: 7f a3 eb 78 mr r3,r29 ffc1320c: 48 00 72 d9 bl ffc1a4e4 if (rc != RC_OK) ffc13210: 2c 03 00 00 cmpwi r3,0 ffc13214: 40 82 00 38 bne- ffc1324c <== NEVER TAKEN return rc; if (cl_start != 0) ffc13218: 2f 9f 00 00 cmpwi cr7,r31,0 ffc1321c: 41 9e ff 54 beq+ cr7,ffc13170 { rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC); ffc13220: 80 81 00 08 lwz r4,8(r1) ffc13224: 7f a3 eb 78 mr r3,r29 ffc13228: 38 a0 ff ff li r5,-1 ffc1322c: 48 00 70 1d bl ffc1a248 if ( rc != RC_OK ) ffc13230: 2c 03 00 00 cmpwi r3,0 ffc13234: 40 82 00 18 bne- ffc1324c <== NEVER TAKEN return rc; fat_fd->map.file_cln = cl_start - 1; fat_fd->map.disk_cln = new_last_cln; ffc13238: 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; ffc1323c: 3b ff ff ff addi r31,r31,-1 ffc13240: 93 fe 00 34 stw r31,52(r30) fat_fd->map.disk_cln = new_last_cln; ffc13244: 91 3e 00 38 stw r9,56(r30) fat_fd->map.last_cln = new_last_cln; ffc13248: 91 3e 00 3c stw r9,60(r30) } return RC_OK; } ffc1324c: 39 61 00 28 addi r11,r1,40 ffc13250: 4b fe e3 a4 b ffc015f4 <_restgpr_29_x> =============================================================================== ffc13638 : 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 ) ffc13638: 2c 06 00 00 cmpwi r6,0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { ffc1363c: 94 21 ff b0 stwu r1,-80(r1) ffc13640: 7c 08 02 a6 mflr r0 int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; ffc13644: 39 20 00 00 li r9,0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { ffc13648: be 61 00 1c stmw r19,28(r1) ffc1364c: 7c bc 2b 78 mr r28,r5 ffc13650: 7c 9e 23 78 mr r30,r4 ffc13654: 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; ffc13658: 91 21 00 0c stw r9,12(r1) bool zero_fill = start > fat_fd->fat_file_size; ffc1365c: 80 a4 00 18 lwz r5,24(r4) uint32_t file_cln_initial = fat_fd->map.file_cln; ffc13660: 82 84 00 34 lwz r20,52(r4) uint32_t cln; if ( count == 0 ) ffc13664: 41 82 01 f4 beq- ffc13858 <== NEVER TAKEN return cmpltd; if (start >= fat_fd->size_limit) ffc13668: 83 e4 00 14 lwz r31,20(r4) ffc1366c: 7f 9c f8 40 cmplw cr7,r28,r31 ffc13670: 41 bc 00 18 blt+ cr7,ffc13688 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EFBIG); ffc13674: 48 00 8a 75 bl ffc1c0e8 <__errno> <== NOT EXECUTED ffc13678: 39 20 00 1b li r9,27 <== NOT EXECUTED ffc1367c: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc13680: 39 20 ff ff li r9,-1 <== NOT EXECUTED ffc13684: 48 00 01 f8 b ffc1387c <== NOT EXECUTED if (count > fat_fd->size_limit - start) ffc13688: 7f fc f8 50 subf r31,r28,r31 ffc1368c: 7f 9f 30 40 cmplw cr7,r31,r6 ffc13690: 7c 7d 1b 78 mr r29,r3 ffc13694: 7c f5 3b 78 mr r21,r7 ffc13698: 40 9d 00 08 ble- cr7,ffc136a0 <== NEVER TAKEN ffc1369c: 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); ffc136a0: 7f 7f e2 14 add r27,r31,r28 ffc136a4: 7c bc 28 10 subfc r5,r28,r5 ffc136a8: 7c a5 29 10 subfe r5,r5,r5 ffc136ac: 7f a3 eb 78 mr r3,r29 ffc136b0: 7f c4 f3 78 mr r4,r30 ffc136b4: 7c a5 00 d0 neg r5,r5 ffc136b8: 7f 66 db 78 mr r6,r27 ffc136bc: 38 e1 00 0c addi r7,r1,12 ffc136c0: 4b ff fd 2d bl ffc133ec if (RC_OK == rc) ffc136c4: 7c 69 1b 79 mr. r9,r3 ffc136c8: 40 82 01 b4 bne- ffc1387c { /* * check whether there was enough room on device to locate * file of 'start + count' bytes */ if (c != (start + count)) ffc136cc: 81 21 00 0c lwz r9,12(r1) ffc136d0: 7f 89 d8 00 cmpw cr7,r9,r27 ffc136d4: 41 9e 00 08 beq- cr7,ffc136dc <== ALWAYS TAKEN count = c - start; ffc136d8: 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)); ffc136dc: 81 5e 00 20 lwz r10,32(r30) ffc136e0: 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)) ffc136e4: 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)); ffc136e8: 2f 8a 00 01 cmpwi cr7,r10,1 ffc136ec: 40 be 00 1c bne+ cr7,ffc13708 ffc136f0: 81 5e 00 24 lwz r10,36(r30) ffc136f4: 2f 8a 00 00 cmpwi cr7,r10,0 ffc136f8: 40 9e 00 10 bne- cr7,ffc13708 <== NEVER TAKEN ffc136fc: 55 09 07 be clrlwi r9,r8,30 ffc13700: 7d 29 00 d0 neg r9,r9 ffc13704: 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)) ffc13708: 2f 89 00 00 cmpwi cr7,r9,0 ffc1370c: 8b 5d 00 08 lbz r26,8(r29) ffc13710: 41 9e 00 48 beq- cr7,ffc13758 { cln = fat_fd->cln; cln += (start >> fs_info->vol.bpc_log2); byte = start & (fs_info->vol.bpc -1); ffc13714: 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); ffc13718: 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; ffc1371c: 81 3e 00 1c lwz r9,28(r30) cln += (start >> fs_info->vol.bpc_log2); ffc13720: 7f 84 d4 30 srw r4,r28,r26 byte = start & (fs_info->vol.bpc -1); ffc13724: 38 a5 ff ff addi r5,r5,-1 ret = fat_cluster_write(fs_info, ffc13728: 7c 84 4a 14 add r4,r4,r9 ffc1372c: 7f a3 eb 78 mr r3,r29 ffc13730: 7f 85 28 38 and r5,r28,r5 ffc13734: 7f e6 fb 78 mr r6,r31 ffc13738: 7e a7 ab 78 mr r7,r21 ffc1373c: 39 00 00 00 li r8,0 ffc13740: 48 00 07 9d bl ffc13edc byte, count, buf, false); if (0 > ret) rc = -1; ffc13744: 39 20 ff ff li r9,-1 cln, byte, count, buf, false); if (0 > ret) ffc13748: 2c 03 00 00 cmpwi r3,0 ffc1374c: 41 80 01 30 blt- ffc1387c <== NEVER TAKEN rc = -1; else cmpltd = ret; ffc13750: 7c 7b 1b 78 mr r27,r3 ffc13754: 48 00 01 24 b ffc13878 const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; ffc13758: 7c 39 0b 78 mr r25,r1 ffc1375c: 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; ffc13760: 57 5a 06 3e clrlwi r26,r26,24 ffc13764: 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); ffc13768: 7f a3 eb 78 mr r3,r29 ffc1376c: 7f c4 f3 78 mr r4,r30 ffc13770: 7f 05 c3 78 mr r5,r24 ffc13774: 7f 26 cb 78 mr r6,r25 ffc13778: 4b ff f5 b5 bl ffc12d2c if (RC_OK == rc) ffc1377c: 7c 9b 23 79 mr. r27,r4 ffc13780: 40 82 00 c8 bne- ffc13848 <== 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); ffc13784: 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; ffc13788: 81 3e 00 1c lwz r9,28(r30) ffc1378c: 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); ffc13790: 7f 9a e0 50 subf r28,r26,r28 ffc13794: 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; ffc13798: 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; ffc1379c: 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 */ ffc137a0: 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; ffc137a4: 3b 40 00 00 li r26,0 ffc137a8: 48 00 00 60 b ffc13808 { 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)); ffc137ac: a0 dd 00 06 lhz r6,6(r29) ffc137b0: 7c c5 30 50 subf r6,r5,r6 ffc137b4: 7f 86 f8 40 cmplw cr7,r6,r31 ffc137b8: 40 9d 00 08 ble- cr7,ffc137c0 ffc137bc: 7f e6 fb 78 mr r6,r31 if (file_cln_initial < file_cln_cnt) ffc137c0: 7f 94 b8 40 cmplw cr7,r20,r23 ffc137c4: 40 9c 00 08 bge- cr7,ffc137cc overwrite_cluster = true; ffc137c8: 3a 60 00 01 li r19,1 ret = fat_cluster_write(fs_info, ffc137cc: 80 81 00 08 lwz r4,8(r1) ffc137d0: 7f a3 eb 78 mr r3,r29 ffc137d4: 7c f5 d2 14 add r7,r21,r26 ffc137d8: 7e 68 9b 78 mr r8,r19 ffc137dc: 48 00 07 01 bl ffc13edc cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) ffc137e0: 2c 03 00 00 cmpwi r3,0 ffc137e4: 40 a0 00 7c bge+ ffc13860 <== ALWAYS TAKEN ffc137e8: 48 00 00 2c b ffc13814 <== 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); ffc137ec: 7f a3 eb 78 mr r3,r29 ffc137f0: 7e c4 b3 78 mr r4,r22 ffc137f4: 7f 25 cb 78 mr r5,r25 ffc137f8: 48 00 68 91 bl ffc1a088 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) ffc137fc: 2c 03 00 00 cmpwi r3,0 ffc13800: 40 82 00 1c bne- ffc1381c <== NEVER TAKEN ffc13804: 38 a0 00 00 li r5,0 && (bytes_to_write > 0)) ffc13808: 2f 9f 00 00 cmpwi cr7,r31,0 ffc1380c: 40 9e ff a0 bne+ cr7,ffc137ac ffc13810: 48 00 00 10 b ffc13820 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) ffc13814: 3b 60 ff ff li r27,-1 <== NOT EXECUTED ffc13818: 48 00 00 08 b ffc13820 <== 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) ffc1381c: 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) ffc13820: 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); ffc13824: 89 3d 00 08 lbz r9,8(r29) ffc13828: 3b 9c ff ff addi r28,r28,-1 fat_fd->map.disk_cln = save_cln; ffc1382c: 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); ffc13830: 7f 9c d2 14 add r28,r28,r26 ffc13834: 7f 9c 4c 30 srw r28,r28,r9 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + ffc13838: 7f 1c c2 14 add r24,r28,r24 ffc1383c: 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) ffc13840: 40 9e 00 08 bne- cr7,ffc13848 <== NEVER TAKEN return rc; else return cmpltd; ffc13844: 7f 5b d3 78 mr r27,r26 fat_fd, start, count, buf, file_cln_initial); if (0 > ret) ffc13848: 2f 9b 00 00 cmpwi cr7,r27,0 rc = -1; ffc1384c: 39 20 ff ff li r9,-1 fat_fd, start, count, buf, file_cln_initial); if (0 > ret) ffc13850: 41 9c 00 2c blt- cr7,ffc1387c <== NEVER TAKEN ffc13854: 48 00 00 24 b ffc13878 uint32_t file_cln_initial = fat_fd->map.file_cln; uint32_t cln; if ( count == 0 ) return cmpltd; ffc13858: 39 20 00 00 li r9,0 <== NOT EXECUTED ffc1385c: 48 00 00 20 b ffc1387c <== NOT EXECUTED { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; if (0 < bytes_to_write) ffc13860: 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; ffc13864: 82 c1 00 08 lwz r22,8(r1) if (0 > ret) rc = -1; if (RC_OK == rc) { ++file_cln_cnt; ffc13868: 3a f7 00 01 addi r23,r23,1 bytes_to_write -= ret; cmpltd += ret; ffc1386c: 7f 5a 1a 14 add r26,r26,r3 save_cln = cur_cln; if (0 < bytes_to_write) ffc13870: 41 82 ff 94 beq+ ffc13804 ffc13874: 4b ff ff 78 b ffc137ec } } if (RC_OK != rc) return rc; else return cmpltd; ffc13878: 7f 69 db 78 mr r9,r27 } ffc1387c: 39 61 00 50 addi r11,r1,80 ffc13880: 7d 23 4b 78 mr r3,r9 ffc13884: 4b fe dd 48 b ffc015cc <_restgpr_19_x> =============================================================================== ffc1a4e4 : int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { ffc1a4e4: 94 21 ff c8 stwu r1,-56(r1) ffc1a4e8: 7c 08 02 a6 mflr r0 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; ffc1a4ec: 39 20 00 00 li r9,0 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { ffc1a4f0: 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; ffc1a4f4: 7c 3c 0b 78 mr r28,r1 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { ffc1a4f8: 7c 7f 1b 78 mr r31,r3 ffc1a4fc: 90 01 00 3c stw r0,60(r1) ffc1a500: 7c 9a 23 78 mr r26,r4 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; ffc1a504: 7c 9d 23 78 mr r29,r4 uint32_t next_cln = 0; ffc1a508: 95 3c 00 08 stwu r9,8(r28) uint32_t freed_cls_cnt = 0; ffc1a50c: 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; ffc1a510: 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) ffc1a514: 48 00 00 60 b ffc1a574 { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); ffc1a518: 7f e3 fb 78 mr r3,r31 ffc1a51c: 7f a4 eb 78 mr r4,r29 ffc1a520: 7f 85 e3 78 mr r5,r28 ffc1a524: 4b ff fb 65 bl ffc1a088 if ( rc != RC_OK ) ffc1a528: 7c 79 1b 79 mr. r25,r3 ffc1a52c: 41 a2 00 24 beq+ ffc1a550 <== ALWAYS TAKEN { if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) ffc1a530: 81 3f 00 44 lwz r9,68(r31) <== NOT EXECUTED ffc1a534: 2f 89 ff ff cmpwi cr7,r9,-1 <== NOT EXECUTED ffc1a538: 41 9e 00 0c beq- cr7,ffc1a544 <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; ffc1a53c: 7f de 4a 14 add r30,r30,r9 <== NOT EXECUTED ffc1a540: 93 df 00 44 stw r30,68(r31) <== NOT EXECUTED fat_buf_release(fs_info); ffc1a544: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc1a548: 4b ff 94 a1 bl ffc139e8 <== NOT EXECUTED ffc1a54c: 48 00 00 60 b ffc1a5ac <== NOT EXECUTED return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); ffc1a550: 7f e3 fb 78 mr r3,r31 ffc1a554: 7f a4 eb 78 mr r4,r29 ffc1a558: 38 a0 00 00 li r5,0 ffc1a55c: 4b ff fc ed bl ffc1a248 if ( rc != RC_OK ) ffc1a560: 2c 03 00 00 cmpwi r3,0 ffc1a564: 41 82 00 08 beq- ffc1a56c <== ALWAYS TAKEN ffc1a568: 7c 7b 1b 78 mr r27,r3 <== NOT EXECUTED rc1 = rc; freed_cls_cnt++; cur_cln = next_cln; ffc1a56c: 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++; ffc1a570: 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) ffc1a574: 81 3f 00 10 lwz r9,16(r31) ffc1a578: 7f aa 48 38 and r10,r29,r9 ffc1a57c: 81 3f 00 14 lwz r9,20(r31) ffc1a580: 7f 8a 48 40 cmplw cr7,r10,r9 ffc1a584: 41 9c ff 94 blt+ cr7,ffc1a518 freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) ffc1a588: 81 3f 00 44 lwz r9,68(r31) freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; ffc1a58c: 93 5f 00 4c stw r26,76(r31) if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) ffc1a590: 2f 89 ff ff cmpwi cr7,r9,-1 ffc1a594: 41 9e 00 0c beq- cr7,ffc1a5a0 <== ALWAYS TAKEN fs_info->vol.free_cls += freed_cls_cnt; ffc1a598: 7f de 4a 14 add r30,r30,r9 <== NOT EXECUTED ffc1a59c: 93 df 00 44 stw r30,68(r31) <== NOT EXECUTED fat_buf_release(fs_info); ffc1a5a0: 7f e3 fb 78 mr r3,r31 ffc1a5a4: 4b ff 94 45 bl ffc139e8 ffc1a5a8: 7f 79 db 78 mr r25,r27 if (rc1 != RC_OK) return rc1; return RC_OK; } ffc1a5ac: 39 61 00 38 addi r11,r1,56 ffc1a5b0: 7f 23 cb 78 mr r3,r25 ffc1a5b4: 4b fe 70 30 b ffc015e4 <_restgpr_25_x> =============================================================================== ffc14a6c : 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); ffc14a6c: 81 23 00 80 lwz r9,128(r3) <== NOT EXECUTED ffc14a70: 39 00 ff fe li r8,-2 <== NOT EXECUTED ffc14a74: 81 43 00 74 lwz r10,116(r3) <== NOT EXECUTED ffc14a78: 7c 89 20 50 subf r4,r9,r4 <== NOT EXECUTED ffc14a7c: 54 89 e8 fe rlwinm r9,r4,29,3,31 <== NOT EXECUTED ffc14a80: 54 84 07 7e clrlwi r4,r4,29 <== NOT EXECUTED ffc14a84: 5d 04 20 3e rotlw r4,r8,r4 <== NOT EXECUTED ffc14a88: 7d 0a 48 ae lbzx r8,r10,r9 <== NOT EXECUTED ffc14a8c: 7c 88 40 38 and r8,r4,r8 <== NOT EXECUTED ffc14a90: 7d 0a 49 ae stbx r8,r10,r9 <== NOT EXECUTED ffc14a94: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc1a088 : uint8_t *sec_buf; uint32_t sec = 0; uint32_t ofs = 0; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) ffc1a088: 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 ) { ffc1a08c: 94 21 ff c8 stwu r1,-56(r1) ffc1a090: 7c 08 02 a6 mflr r0 ffc1a094: bf 21 00 1c stmw r25,28(r1) ffc1a098: 7c 9f 23 78 mr r31,r4 ffc1a09c: 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)) ) ffc1a0a0: 40 9d 01 84 ble- cr7,ffc1a224 <== NEVER TAKEN ffc1a0a4: 81 23 00 38 lwz r9,56(r3) ffc1a0a8: 7c 7d 1b 78 mr r29,r3 ffc1a0ac: 39 29 00 01 addi r9,r9,1 ffc1a0b0: 7f 84 48 40 cmplw cr7,r4,r9 ffc1a0b4: 40 bd 00 08 ble+ cr7,ffc1a0bc <== ALWAYS TAKEN ffc1a0b8: 48 00 01 6c b ffc1a224 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + ffc1a0bc: 89 23 00 0e lbz r9,14(r3) ffc1a0c0: 7c be 2b 78 mr r30,r5 ffc1a0c4: 71 27 00 01 andi. r7,r9,1 ffc1a0c8: 41 82 00 10 beq- ffc1a0d8 ffc1a0cc: 54 8a f8 7e rlwinm r10,r4,31,1,31 ffc1a0d0: 7d 4a 22 14 add r10,r10,r4 ffc1a0d4: 48 00 00 18 b ffc1a0ec ffc1a0d8: 55 28 07 bc rlwinm r8,r9,0,30,30 ffc1a0dc: 71 06 00 ff andi. r6,r8,255 ffc1a0e0: 54 8a 10 3a rlwinm r10,r4,2,0,29 ffc1a0e4: 41 82 00 08 beq- ffc1a0ec ffc1a0e8: 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); ffc1a0ec: 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) + ffc1a0f0: 8b 5d 00 02 lbz r26,2(r29) ffc1a0f4: 81 1d 00 58 lwz r8,88(r29) ffc1a0f8: 7d 4a d4 30 srw r10,r10,r26 ffc1a0fc: 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); ffc1a100: 41 9e 00 10 beq- cr7,ffc1a110 ffc1a104: 57 fb f8 7e rlwinm r27,r31,31,1,31 ffc1a108: 7f 7b fa 14 add r27,r27,r31 ffc1a10c: 48 00 00 18 b ffc1a124 ffc1a110: 55 29 07 bc rlwinm r9,r9,0,30,30 ffc1a114: 71 2a 00 ff andi. r10,r9,255 ffc1a118: 57 fb 10 3a rlwinm r27,r31,2,0,29 ffc1a11c: 41 82 00 08 beq- ffc1a124 ffc1a120: 57 fb 08 3c rlwinm r27,r31,1,0,30 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); ffc1a124: 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); ffc1a128: a3 3d 00 00 lhz r25,0(r29) rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); ffc1a12c: 7f 44 d3 78 mr r4,r26 ffc1a130: 38 a0 00 01 li r5,1 ffc1a134: 38 c1 00 08 addi r6,r1,8 ffc1a138: 4b ff 9a 71 bl ffc13ba8 if (rc != RC_OK) ffc1a13c: 7c 7c 1b 79 mr. r28,r3 ffc1a140: 40 82 00 fc bne- ffc1a23c <== NEVER TAKEN return rc; switch ( fs_info->vol.type ) ffc1a144: 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); ffc1a148: 39 39 ff ff addi r9,r25,-1 ffc1a14c: 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 ) ffc1a150: 2f 8a 00 02 cmpwi cr7,r10,2 ffc1a154: 41 9e 00 98 beq- cr7,ffc1a1ec ffc1a158: 2f 8a 00 04 cmpwi cr7,r10,4 ffc1a15c: 41 9e 00 a8 beq- cr7,ffc1a204 ffc1a160: 2f 8a 00 01 cmpwi cr7,r10,1 ffc1a164: 40 be 00 c0 bne+ cr7,ffc1a224 <== 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) ) ffc1a168: 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)); ffc1a16c: 81 01 00 08 lwz r8,8(r1) if ( ofs == (fs_info->vol.bps - 1) ) ffc1a170: 38 e7 ff ff addi r7,r7,-1 ffc1a174: 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)); ffc1a178: 7d 48 48 ae lbzx r10,r8,r9 ffc1a17c: 91 5e 00 00 stw r10,0(r30) if ( ofs == (fs_info->vol.bps - 1) ) ffc1a180: 40 be 00 3c bne+ cr7,ffc1a1bc <== ALWAYS TAKEN { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, ffc1a184: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED ffc1a188: 38 9a 00 01 addi r4,r26,1 <== NOT EXECUTED ffc1a18c: 38 a0 00 01 li r5,1 <== NOT EXECUTED ffc1a190: 38 c1 00 08 addi r6,r1,8 <== NOT EXECUTED ffc1a194: 4b ff 9a 15 bl ffc13ba8 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) ffc1a198: 2c 03 00 00 cmpwi r3,0 <== NOT EXECUTED ffc1a19c: 40 82 00 9c bne- ffc1a238 <== NOT EXECUTED return rc; *ret_val |= *sec_buf << 8; ffc1a1a0: 81 21 00 08 lwz r9,8(r1) <== NOT EXECUTED ffc1a1a4: 89 49 00 00 lbz r10,0(r9) <== NOT EXECUTED ffc1a1a8: 81 3e 00 00 lwz r9,0(r30) <== NOT EXECUTED ffc1a1ac: 55 4a 40 2e rlwinm r10,r10,8,0,23 <== NOT EXECUTED ffc1a1b0: 7d 29 53 78 or r9,r9,r10 <== NOT EXECUTED ffc1a1b4: 91 3e 00 00 stw r9,0(r30) <== NOT EXECUTED ffc1a1b8: 48 00 00 18 b ffc1a1d0 <== NOT EXECUTED } else { *ret_val |= *(sec_buf + ofs + 1) << 8; ffc1a1bc: 7d 28 4a 14 add r9,r8,r9 ffc1a1c0: 89 29 00 01 lbz r9,1(r9) ffc1a1c4: 55 29 40 2e rlwinm r9,r9,8,0,23 ffc1a1c8: 7d 2a 53 78 or r10,r9,r10 ffc1a1cc: 91 5e 00 00 stw r10,0(r30) } if ( FAT_CLUSTER_IS_ODD(cln) ) ffc1a1d0: 73 e6 00 01 andi. r6,r31,1 ffc1a1d4: 81 3e 00 00 lwz r9,0(r30) ffc1a1d8: 41 82 00 0c beq- ffc1a1e4 *ret_val = (*ret_val) >> FAT12_SHIFT; ffc1a1dc: 55 29 e1 3e rlwinm r9,r9,28,4,31 ffc1a1e0: 48 00 00 3c b ffc1a21c else *ret_val = (*ret_val) & FAT_FAT12_MASK; ffc1a1e4: 55 29 05 3e clrlwi r9,r9,20 ffc1a1e8: 48 00 00 34 b ffc1a21c break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); ffc1a1ec: 81 41 00 08 lwz r10,8(r1) ffc1a1f0: 7d 2a 4a 2e lhzx r9,r10,r9 *ret_val = CF_LE_W(*ret_val); ffc1a1f4: 55 2a c2 3e rlwinm r10,r9,24,8,31 ffc1a1f8: 55 29 44 2e rlwinm r9,r9,8,16,23 ffc1a1fc: 7d 49 4b 78 or r9,r10,r9 ffc1a200: 48 00 00 1c b ffc1a21c break; case FAT_FAT32: *ret_val = *((uint32_t *)(sec_buf + ofs)); ffc1a204: 81 41 00 08 lwz r10,8(r1) ffc1a208: 7d 4a 48 2e lwzx r10,r10,r9 ffc1a20c: 51 49 46 3e rlwimi r9,r10,8,24,31 ffc1a210: 51 49 c4 2e rlwimi r9,r10,24,16,23 ffc1a214: 51 49 42 1e rlwimi r9,r10,8,8,15 ffc1a218: 51 49 c0 0e rlwimi r9,r10,24,0,7 *ret_val = CF_LE_L(*ret_val); ffc1a21c: 91 3e 00 00 stw r9,0(r30) break; ffc1a220: 48 00 00 1c b ffc1a23c default: rtems_set_errno_and_return_minus_one(EIO); ffc1a224: 48 00 1e c5 bl ffc1c0e8 <__errno> <== NOT EXECUTED ffc1a228: 39 20 00 05 li r9,5 <== NOT EXECUTED ffc1a22c: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc1a230: 3b 80 ff ff li r28,-1 <== NOT EXECUTED ffc1a234: 48 00 00 08 b ffc1a23c <== 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) ffc1a238: 7c 7c 1b 78 mr r28,r3 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } ffc1a23c: 39 61 00 38 addi r11,r1,56 ffc1a240: 7f 83 e3 78 mr r3,r28 ffc1a244: 4b fe 73 a0 b ffc015e4 <_restgpr_25_x> =============================================================================== ffc1498c : * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { ffc1498c: 94 21 ff e8 stwu r1,-24(r1) <== NOT EXECUTED ffc14990: 7c 08 02 a6 mflr r0 <== NOT EXECUTED ffc14994: 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)) ffc14998: 3f a0 0f ff lis r29,4095 <== NOT EXECUTED * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { ffc1499c: 7c 7f 1b 78 mr r31,r3 <== NOT EXECUTED ffc149a0: 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++) ffc149a4: 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)) ffc149a8: 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) ffc149ac: 48 00 00 a4 b ffc14a50 <== NOT EXECUTED { for (j = 0; j < fs_info->uino_pool_size; j++) { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) ffc149b0: 81 3f 00 78 lwz r9,120(r31) <== NOT EXECUTED ffc149b4: 81 5f 00 74 lwz r10,116(r31) <== NOT EXECUTED ffc149b8: 55 27 e8 fe rlwinm r7,r9,29,3,31 <== NOT EXECUTED ffc149bc: 7c ca 3a 14 add r6,r10,r7 <== NOT EXECUTED ffc149c0: 7d 4a 38 ae lbzx r10,r10,r7 <== NOT EXECUTED ffc149c4: 55 27 07 7e clrlwi r7,r9,29 <== NOT EXECUTED ffc149c8: 7d 45 3e 30 sraw r5,r10,r7 <== NOT EXECUTED ffc149cc: 70 a3 00 01 andi. r3,r5,1 <== NOT EXECUTED ffc149d0: 40 a2 00 24 bne+ ffc149f4 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); ffc149d4: 39 20 00 01 li r9,1 <== NOT EXECUTED ffc149d8: 7d 27 38 30 slw r7,r9,r7 <== NOT EXECUTED ffc149dc: 7c ea 53 78 or r10,r7,r10 <== NOT EXECUTED ffc149e0: 99 46 00 00 stb r10,0(r6) <== NOT EXECUTED return (fs_info->uino_base + fs_info->index); ffc149e4: 80 7f 00 78 lwz r3,120(r31) <== NOT EXECUTED ffc149e8: 81 3f 00 80 lwz r9,128(r31) <== NOT EXECUTED ffc149ec: 7c 63 4a 14 add r3,r3,r9 <== NOT EXECUTED ffc149f0: 48 00 00 74 b ffc14a64 <== NOT EXECUTED } fs_info->index++; ffc149f4: 39 29 00 01 addi r9,r9,1 <== NOT EXECUTED if (fs_info->index >= fs_info->uino_pool_size) ffc149f8: 7f 89 40 40 cmplw cr7,r9,r8 <== NOT EXECUTED ffc149fc: 40 9c 00 0c bge- cr7,ffc14a08 <== 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++; ffc14a00: 91 3f 00 78 stw r9,120(r31) <== NOT EXECUTED ffc14a04: 48 00 00 08 b ffc14a0c <== NOT EXECUTED if (fs_info->index >= fs_info->uino_pool_size) fs_info->index = 0; ffc14a08: 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++) ffc14a0c: 38 84 00 01 addi r4,r4,1 <== NOT EXECUTED ffc14a10: 42 00 ff a0 bdnz+ ffc149b0 <== 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)) ffc14a14: 81 3f 00 80 lwz r9,128(r31) <== NOT EXECUTED ffc14a18: 54 84 08 3c rlwinm r4,r4,1,0,30 <== NOT EXECUTED ffc14a1c: 7d 29 e8 50 subf r9,r9,r29 <== NOT EXECUTED ffc14a20: 7f 84 48 40 cmplw cr7,r4,r9 <== NOT EXECUTED ffc14a24: 41 9c 00 0c blt- cr7,ffc14a30 <== NOT EXECUTED resrc_unsuff = true; } else resrc_unsuff = true; } return 0; ffc14a28: 38 60 00 00 li r3,0 <== NOT EXECUTED ffc14a2c: 48 00 00 38 b ffc14a64 <== NOT EXECUTED fs_info->index = 0; } if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base)) { fs_info->uino_pool_size <<= 1; ffc14a30: 90 9f 00 7c stw r4,124(r31) <== NOT EXECUTED fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); ffc14a34: 80 7f 00 74 lwz r3,116(r31) <== NOT EXECUTED ffc14a38: 4b ff 23 65 bl ffc06d9c <== NOT EXECUTED if (fs_info->uino != NULL) ffc14a3c: 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); ffc14a40: 90 7f 00 74 stw r3,116(r31) <== NOT EXECUTED if (fs_info->uino != NULL) ffc14a44: 41 9e ff e4 beq+ cr7,ffc14a28 <== NOT EXECUTED fs_info->index = fs_info->uino_pool_size; ffc14a48: 81 3f 00 7c lwz r9,124(r31) <== NOT EXECUTED ffc14a4c: 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++) ffc14a50: 81 1f 00 7c lwz r8,124(r31) <== NOT EXECUTED ffc14a54: 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; ffc14a58: 39 28 00 01 addi r9,r8,1 <== NOT EXECUTED ffc14a5c: 7d 29 03 a6 mtctr r9 <== NOT EXECUTED ffc14a60: 4b ff ff b0 b ffc14a10 <== NOT EXECUTED } else resrc_unsuff = true; } return 0; } ffc14a64: 39 61 00 18 addi r11,r1,24 <== NOT EXECUTED ffc14a68: 4b fe cb 8c b ffc015f4 <_restgpr_29_x> <== NOT EXECUTED =============================================================================== ffc14908 : int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { ffc14908: 94 21 ff e0 stwu r1,-32(r1) ffc1490c: 7c 08 02 a6 mflr r0 ffc14910: bf c1 00 18 stmw r30,24(r1) int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; ffc14914: 7c 3e 0b 78 mr r30,r1 int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { ffc14918: 7c 7f 1b 78 mr r31,r3 ffc1491c: 90 01 00 24 stw r0,36(r1) int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; ffc14920: 94 9e 00 08 stwu r4,8(r30) while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) ffc14924: 48 00 00 3c b ffc14960 { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); ffc14928: a0 df 00 06 lhz r6,6(r31) ffc1492c: 7f e3 fb 78 mr r3,r31 ffc14930: 38 a0 00 00 li r5,0 ffc14934: 38 e0 00 00 li r7,0 ffc14938: 4b ff f4 89 bl ffc13dc0 if ( ret != fs_info->vol.bpc ) ffc1493c: a1 3f 00 06 lhz r9,6(r31) ffc14940: 7f 83 48 00 cmpw cr7,r3,r9 ffc14944: 40 9e 00 3c bne- cr7,ffc14980 <== NEVER TAKEN { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ffc14948: 80 81 00 08 lwz r4,8(r1) ffc1494c: 7f e3 fb 78 mr r3,r31 ffc14950: 7f c5 f3 78 mr r5,r30 ffc14954: 48 00 57 35 bl ffc1a088 if ( rc != RC_OK ) ffc14958: 2c 03 00 00 cmpwi r3,0 ffc1495c: 40 82 00 28 bne- ffc14984 <== 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) ffc14960: 81 3f 00 10 lwz r9,16(r31) ffc14964: 80 81 00 08 lwz r4,8(r1) ffc14968: 7c 8a 48 38 and r10,r4,r9 ffc1496c: 81 3f 00 14 lwz r9,20(r31) ffc14970: 7f 8a 48 40 cmplw cr7,r10,r9 ffc14974: 41 9c ff b4 blt+ cr7,ffc14928 return rc; } } return rc; ffc14978: 38 60 00 00 li r3,0 ffc1497c: 48 00 00 08 b ffc14984 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; ffc14980: 38 60 ff ff li r3,-1 <== NOT EXECUTED } } return rc; } ffc14984: 39 61 00 20 addi r11,r1,32 ffc14988: 4b fe cc 70 b ffc015f8 <_restgpr_30_x> =============================================================================== ffc14018 : * 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) { ffc14018: 94 21 ff 28 stwu r1,-216(r1) ffc1401c: 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; ffc14020: 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) { ffc14024: bd c1 00 90 stmw r14,144(r1) ffc14028: 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); ffc1402c: 7c 83 23 78 mr r3,r4 ffc14030: 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) { ffc14034: 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; ffc14038: 91 21 00 5c stw r9,92(r1) vol->fd = open(device, O_RDWR); ffc1403c: 4c c6 31 82 crclr 4*cr1+eq ffc14040: 4b ff 2a b5 bl ffc06af4 if (vol->fd < 0) ffc14044: 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); ffc14048: 90 7f 00 60 stw r3,96(r31) if (vol->fd < 0) ffc1404c: 40 bc 00 08 bge+ cr7,ffc14054 <== ALWAYS TAKEN ffc14050: 48 00 00 1c b ffc1406c <== NOT EXECUTED { rtems_set_errno_and_return_minus_one(ENXIO); } rc = fstat(vol->fd, &stat_buf); ffc14054: 38 81 00 08 addi r4,r1,8 ffc14058: 4b ff 1d 55 bl ffc05dac if (rc != 0) ffc1405c: 2f 83 00 00 cmpwi cr7,r3,0 ffc14060: 80 7f 00 60 lwz r3,96(r31) ffc14064: 41 be 00 14 beq+ cr7,ffc14078 <== ALWAYS TAKEN { close(vol->fd); ffc14068: 4b ff 1b ed bl ffc05c54 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); ffc1406c: 48 00 80 7d bl ffc1c0e8 <__errno> <== NOT EXECUTED ffc14070: 39 20 00 06 li r9,6 <== NOT EXECUTED ffc14074: 48 00 06 54 b ffc146c8 <== NOT EXECUTED } /* Must be a block device. */ if (!S_ISBLK(stat_buf.st_mode)) ffc14078: 81 21 00 14 lwz r9,20(r1) ffc1407c: 55 29 04 26 rlwinm r9,r9,0,16,19 ffc14080: 2f 89 60 00 cmpwi cr7,r9,24576 ffc14084: 41 be 00 08 beq+ cr7,ffc1408c <== ALWAYS TAKEN ffc14088: 4b ff ff e0 b ffc14068 <== 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); ffc1408c: 3c 80 40 04 lis r4,16388 ffc14090: 60 84 42 09 ori r4,r4,16905 ffc14094: 38 bf 00 64 addi r5,r31,100 ffc14098: 4c c6 31 82 crclr 4*cr1+eq ffc1409c: 48 00 15 e5 bl ffc15680 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) { ffc140a0: 2f 83 00 00 cmpwi cr7,r3,0 ffc140a4: 41 be 00 0c beq+ cr7,ffc140b0 <== ALWAYS TAKEN close(vol->fd); ffc140a8: 80 7f 00 60 lwz r3,96(r31) <== NOT EXECUTED ffc140ac: 4b ff ff bc b ffc14068 <== 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); ffc140b0: 80 7f 00 64 lwz r3,100(r31) ffc140b4: 38 80 00 00 li r4,0 ffc140b8: 38 a1 00 5c addi r5,r1,92 ffc140bc: 4b ff d8 0d bl ffc118c8 if (sc != RTEMS_SUCCESSFUL) ffc140c0: 2f 83 00 00 cmpwi cr7,r3,0 ffc140c4: 41 be 00 08 beq+ cr7,ffc140cc <== ALWAYS TAKEN ffc140c8: 48 00 00 cc b ffc14194 <== NOT EXECUTED { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); ffc140cc: 80 61 00 5c lwz r3,92(r1) ffc140d0: 81 23 00 1c lwz r9,28(r3) ffc140d4: 89 09 00 0c lbz r8,12(r9) ffc140d8: 89 89 00 0b lbz r12,11(r9) ffc140dc: 89 69 00 0e lbz r11,14(r9) ffc140e0: 88 c9 00 11 lbz r6,17(r9) ffc140e4: 88 e9 00 17 lbz r7,23(r9) ffc140e8: 88 09 00 0f lbz r0,15(r9) ffc140ec: 88 a9 00 12 lbz r5,18(r9) ffc140f0: 89 49 00 25 lbz r10,37(r9) ffc140f4: 88 89 00 31 lbz r4,49(r9) ffc140f8: 91 01 00 6c stw r8,108(r1) ffc140fc: 89 09 00 16 lbz r8,22(r9) ffc14100: 8b c9 00 0d lbz r30,13(r9) ffc14104: 8b 89 00 10 lbz r28,16(r9) ffc14108: 8a 49 00 13 lbz r18,19(r9) ffc1410c: 8a 29 00 14 lbz r17,20(r9) ffc14110: 8a a9 00 20 lbz r21,32(r9) ffc14114: 8a 69 00 21 lbz r19,33(r9) ffc14118: 8a 89 00 22 lbz r20,34(r9) ffc1411c: 8a c9 00 23 lbz r22,35(r9) ffc14120: 89 e9 00 24 lbz r15,36(r9) ffc14124: 89 c9 00 26 lbz r14,38(r9) ffc14128: 8a 09 00 27 lbz r16,39(r9) ffc1412c: 8b a9 00 28 lbz r29,40(r9) ffc14130: 8b 29 00 2c lbz r25,44(r9) ffc14134: 8a e9 00 2d lbz r23,45(r9) ffc14138: 8b 09 00 2e lbz r24,46(r9) ffc1413c: 8b 49 00 2f lbz r26,47(r9) ffc14140: 8b 69 00 30 lbz r27,48(r9) ffc14144: 91 41 00 68 stw r10,104(r1) sc = rtems_bdbuf_release( block); ffc14148: 90 01 00 8c stw r0,140(r1) ffc1414c: 90 81 00 70 stw r4,112(r1) ffc14150: 90 a1 00 78 stw r5,120(r1) ffc14154: 90 c1 00 74 stw r6,116(r1) ffc14158: 90 e1 00 80 stw r7,128(r1) ffc1415c: 91 01 00 7c stw r8,124(r1) ffc14160: 91 61 00 84 stw r11,132(r1) ffc14164: 91 81 00 88 stw r12,136(r1) ffc14168: 4b ff d9 59 bl ffc11ac0 if (sc != RTEMS_SUCCESSFUL) ffc1416c: 2f 83 00 00 cmpwi cr7,r3,0 ffc14170: 80 01 00 8c lwz r0,140(r1) ffc14174: 80 81 00 70 lwz r4,112(r1) ffc14178: 80 a1 00 78 lwz r5,120(r1) ffc1417c: 80 c1 00 74 lwz r6,116(r1) ffc14180: 80 e1 00 80 lwz r7,128(r1) ffc14184: 81 01 00 7c lwz r8,124(r1) ffc14188: 81 61 00 84 lwz r11,132(r1) ffc1418c: 81 81 00 88 lwz r12,136(r1) ffc14190: 41 be 00 18 beq+ cr7,ffc141a8 <== ALWAYS TAKEN { close(vol->fd); ffc14194: 80 7f 00 60 lwz r3,96(r31) <== NOT EXECUTED ffc14198: 4b ff 1a bd bl ffc05c54 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EIO ); ffc1419c: 48 00 7f 4d bl ffc1c0e8 <__errno> <== NOT EXECUTED ffc141a0: 39 20 00 05 li r9,5 <== NOT EXECUTED ffc141a4: 48 00 05 24 b ffc146c8 <== NOT EXECUTED } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); ffc141a8: 81 41 00 6c lwz r10,108(r1) ffc141ac: 55 49 40 2e rlwinm r9,r10,8,0,23 ffc141b0: 7d 2c 63 78 or r12,r9,r12 if ( (vol->bps != 512) && ffc141b4: 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); ffc141b8: b1 9f 00 00 sth r12,0(r31) if ( (vol->bps != 512) && ffc141bc: 41 9e 00 20 beq- cr7,ffc141dc <== ALWAYS TAKEN ffc141c0: 2f 8c 04 00 cmpwi cr7,r12,1024 <== NOT EXECUTED ffc141c4: 41 9e 00 18 beq- cr7,ffc141dc <== NOT EXECUTED (vol->bps != 1024) && ffc141c8: 2f 8c 08 00 cmpwi cr7,r12,2048 <== NOT EXECUTED ffc141cc: 41 9e 00 10 beq- cr7,ffc141dc <== NOT EXECUTED (vol->bps != 2048) && ffc141d0: 2f 8c 10 00 cmpwi cr7,r12,4096 <== NOT EXECUTED ffc141d4: 41 be 00 08 beq+ cr7,ffc141dc <== NOT EXECUTED ffc141d8: 48 00 02 e0 b ffc144b8 <== 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; ffc141dc: 39 20 00 00 li r9,0 ffc141e0: 99 3f 00 03 stb r9,3(r31) ffc141e4: 55 83 ba 7e rlwinm r3,r12,23,9,31 ffc141e8: 48 00 00 14 b ffc141fc i >>= 1, vol->sec_mul++); ffc141ec: 89 3f 00 03 lbz r9,3(r31) <== NOT EXECUTED ffc141f0: 7c 63 0e 70 srawi r3,r3,1 <== NOT EXECUTED ffc141f4: 39 29 00 01 addi r9,r9,1 <== NOT EXECUTED ffc141f8: 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; ffc141fc: 70 69 00 01 andi. r9,r3,1 ffc14200: 41 82 ff ec beq+ ffc141ec <== NEVER TAKEN i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; ffc14204: 39 20 00 00 li r9,0 ffc14208: 99 3f 00 02 stb r9,2(r31) ffc1420c: 7d 89 63 78 mr r9,r12 ffc14210: 48 00 00 10 b ffc14220 i >>= 1, vol->sec_log2++); ffc14214: 38 63 00 01 addi r3,r3,1 ffc14218: 98 7f 00 02 stb r3,2(r31) ffc1421c: 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; ffc14220: 71 2a 00 01 andi. r10,r9,1 ffc14224: 88 7f 00 02 lbz r3,2(r31) ffc14228: 41 82 ff ec beq+ ffc14214 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) ffc1422c: 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; ffc14230: b1 9f 00 0a sth r12,10(r31) vol->bytes_per_block_log2 = vol->sec_log2; ffc14234: 54 6a 06 3e clrlwi r10,r3,24 vol->sectors_per_block = 1; ffc14238: 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; ffc1423c: 99 5f 00 0c stb r10,12(r31) vol->sectors_per_block = 1; ffc14240: 99 3f 00 09 stb r9,9(r31) vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); ffc14244: 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) ffc14248: 40 be 00 08 bne+ cr7,ffc14250 <== ALWAYS TAKEN ffc1424c: 48 00 02 6c b ffc144b8 <== NOT EXECUTED { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; ffc14250: 39 20 00 00 li r9,0 ffc14254: 99 3f 00 05 stb r9,5(r31) ffc14258: 7f c9 f3 78 mr r9,r30 ffc1425c: 48 00 00 10 b ffc1426c i >>= 1, vol->spc_log2++); ffc14260: 38 63 00 01 addi r3,r3,1 ffc14264: 98 7f 00 05 stb r3,5(r31) ffc14268: 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; ffc1426c: 71 23 00 01 andi. r3,r9,1 ffc14270: 88 7f 00 05 lbz r3,5(r31) ffc14274: 41 82 ff ec beq+ ffc14260 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) ffc14278: 54 63 06 3e clrlwi r3,r3,24 ffc1427c: 7d 83 18 30 slw r3,r12,r3 ffc14280: 54 69 04 3e clrlwi r9,r3,16 ffc14284: 2b 89 80 00 cmplwi cr7,r9,32768 ffc14288: b1 3f 00 06 sth r9,6(r31) ffc1428c: 40 bd 00 08 ble+ cr7,ffc14294 <== ALWAYS TAKEN ffc14290: 48 00 02 28 b ffc144b8 <== NOT EXECUTED { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; ffc14294: 39 20 00 00 li r9,0 ffc14298: 99 3f 00 08 stb r9,8(r31) ffc1429c: 54 63 04 3e clrlwi r3,r3,16 ffc142a0: 48 00 00 14 b ffc142b4 i >>= 1, vol->bpc_log2++); ffc142a4: 89 3f 00 08 lbz r9,8(r31) ffc142a8: 7c 63 0e 70 srawi r3,r3,1 ffc142ac: 39 29 00 01 addi r9,r9,1 ffc142b0: 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; ffc142b4: 70 69 00 01 andi. r9,r3,1 ffc142b8: 41 82 ff ec beq+ ffc142a4 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); ffc142bc: 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); ffc142c0: 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); ffc142c4: 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)) / ffc142c8: 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); ffc142cc: 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)) / ffc142d0: 54 c6 28 34 rlwinm r6,r6,5,0,26 ffc142d4: 7c c6 4a 14 add r6,r6,r9 ffc142d8: 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) ffc142dc: 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)) / ffc142e0: 91 9f 00 28 stw r12,40(r31) vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; ffc142e4: 7d 89 50 30 slw r9,r12,r10 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) ffc142e8: 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; ffc142ec: 91 3f 00 2c stw r9,44(r31) if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) ffc142f0: 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); ffc142f4: 54 00 40 2e rlwinm r0,r0,8,0,23 ffc142f8: 7c 0b 5b 78 or r11,r0,r11 ffc142fc: 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) ffc14300: 41 82 00 10 beq- ffc14310 vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); ffc14304: 55 28 04 3e clrlwi r8,r9,16 ffc14308: 91 1f 00 1c stw r8,28(r31) ffc1430c: 48 00 00 24 b ffc14330 else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); ffc14310: 81 01 00 68 lwz r8,104(r1) ffc14314: 55 ce 80 1e rlwinm r14,r14,16,0,15 ffc14318: 56 10 c0 0e rlwinm r16,r16,24,0,7 ffc1431c: 55 0a 40 2e rlwinm r10,r8,8,0,23 ffc14320: 7d 4a 73 78 or r10,r10,r14 ffc14324: 7d 4f 7b 78 or r15,r10,r15 ffc14328: 7d f0 83 78 or r16,r15,r16 ffc1432c: 92 1f 00 1c stw r16,28(r31) vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + ffc14330: 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) ffc14334: 56 31 40 2e rlwinm r17,r17,8,0,23 ffc14338: 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 + ffc1433c: 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) ffc14340: 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 + ffc14344: 7f 8b e2 14 add r28,r11,r28 ffc14348: 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; ffc1434c: 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 + ffc14350: 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) ffc14354: 41 82 00 10 beq- ffc14364 vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); ffc14358: 55 32 04 3e clrlwi r18,r9,16 ffc1435c: 92 5f 00 30 stw r18,48(r31) ffc14360: 48 00 00 20 b ffc14380 else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); ffc14364: 56 73 40 2e rlwinm r19,r19,8,0,23 ffc14368: 56 94 80 1e rlwinm r20,r20,16,0,15 ffc1436c: 7e 74 a3 78 or r20,r19,r20 ffc14370: 7e 95 ab 78 or r21,r20,r21 ffc14374: 56 d6 c0 0e rlwinm r22,r22,24,0,7 ffc14378: 7e b6 b3 78 or r22,r21,r22 ffc1437c: 92 df 00 30 stw r22,48(r31) data_secs = vol->tot_secs - vol->data_fsec; ffc14380: 81 3f 00 30 lwz r9,48(r31) ffc14384: 7d 8c 48 50 subf r12,r12,r9 vol->data_cls = data_secs / vol->spc; ffc14388: 7f cc f3 96 divwu r30,r12,r30 /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) ffc1438c: 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; ffc14390: 93 df 00 38 stw r30,56(r31) /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) ffc14394: 41 9d 00 1c bgt- cr7,ffc143b0 { vol->type = FAT_FAT12; ffc14398: 39 20 00 01 li r9,1 ffc1439c: 99 3f 00 0e stb r9,14(r31) vol->mask = FAT_FAT12_MASK; ffc143a0: 39 20 0f ff li r9,4095 ffc143a4: 91 3f 00 10 stw r9,16(r31) vol->eoc_val = FAT_FAT12_EOC; ffc143a8: 39 20 0f f8 li r9,4088 ffc143ac: 48 00 00 44 b ffc143f0 } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) ffc143b0: 2b 9e ff f4 cmplwi cr7,r30,65524 ffc143b4: 41 9d 00 20 bgt- cr7,ffc143d4 { vol->type = FAT_FAT16; ffc143b8: 39 20 00 02 li r9,2 ffc143bc: 99 3f 00 0e stb r9,14(r31) vol->mask = FAT_FAT16_MASK; ffc143c0: 39 20 00 00 li r9,0 ffc143c4: 61 29 ff ff ori r9,r9,65535 ffc143c8: 91 3f 00 10 stw r9,16(r31) vol->eoc_val = FAT_FAT16_EOC; ffc143cc: 39 20 00 00 li r9,0 ffc143d0: 48 00 00 1c b ffc143ec } else { vol->type = FAT_FAT32; ffc143d4: 39 20 00 04 li r9,4 ffc143d8: 99 3f 00 0e stb r9,14(r31) vol->mask = FAT_FAT32_MASK; ffc143dc: 3d 20 0f ff lis r9,4095 ffc143e0: 61 29 ff ff ori r9,r9,65535 ffc143e4: 91 3f 00 10 stw r9,16(r31) vol->eoc_val = FAT_FAT32_EOC; ffc143e8: 3d 20 0f ff lis r9,4095 ffc143ec: 61 29 ff f8 ori r9,r9,65528 ffc143f0: 91 3f 00 14 stw r9,20(r31) } } if (vol->type == FAT_FAT32) ffc143f4: 89 3f 00 0e lbz r9,14(r31) ffc143f8: 2f 89 00 04 cmpwi cr7,r9,4 ffc143fc: 40 be 01 60 bne+ cr7,ffc1455c { 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; ffc14400: 57 a9 00 30 rlwinm r9,r29,0,0,24 ffc14404: 55 29 06 3e clrlwi r9,r9,24 if (vol->mirror) ffc14408: 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; ffc1440c: 99 3f 00 54 stb r9,84(r31) } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); ffc14410: 56 f7 40 2e rlwinm r23,r23,8,0,23 ffc14414: 57 18 80 1e rlwinm r24,r24,16,0,15 ffc14418: 7e f8 c3 78 or r24,r23,r24 ffc1441c: 7f 19 cb 78 or r25,r24,r25 ffc14420: 57 5a c0 0e rlwinm r26,r26,24,0,7 ffc14424: 7f 3a d3 78 or r26,r25,r26 ffc14428: 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) ffc1442c: 41 9e 00 10 beq- cr7,ffc1443c <== ALWAYS TAKEN vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; ffc14430: 57 bd 07 3e clrlwi r29,r29,28 <== NOT EXECUTED ffc14434: 9b bf 00 5c stb r29,92(r31) <== NOT EXECUTED ffc14438: 48 00 00 08 b ffc14440 <== NOT EXECUTED else vol->afat = 0; ffc1443c: 99 3f 00 5c stb r9,92(r31) vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); ffc14440: 54 84 40 2e rlwinm r4,r4,8,0,23 ffc14444: 7c 84 db 78 or r4,r4,r27 if( vol->info_sec == 0 ) ffc14448: 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); ffc1444c: b0 9f 00 40 sth r4,64(r31) if( vol->info_sec == 0 ) ffc14450: 40 be 00 08 bne+ cr7,ffc14458 <== ALWAYS TAKEN ffc14454: 48 00 00 64 b ffc144b8 <== NOT EXECUTED close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , 0, ffc14458: 7f e3 fb 78 mr r3,r31 ffc1445c: 38 a0 00 00 li r5,0 ffc14460: 38 c0 00 04 li r6,4 ffc14464: 38 e1 00 50 addi r7,r1,80 ffc14468: 4b ff f8 09 bl ffc13c70 <_fat_block_read> FAT_FSI_LEADSIG_SIZE, fs_info_sector); if ( ret < 0 ) ffc1446c: 2f 83 00 00 cmpwi cr7,r3,0 ffc14470: 40 bc 00 08 bge+ cr7,ffc14478 <== ALWAYS TAKEN ffc14474: 48 00 00 7c b ffc144f0 <== NOT EXECUTED { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != ffc14478: 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); ffc1447c: 7f e3 fb 78 mr r3,r31 { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != ffc14480: 89 21 00 52 lbz r9,82(r1) ffc14484: 55 4a 40 2e rlwinm r10,r10,8,0,23 ffc14488: 55 29 80 1e rlwinm r9,r9,16,0,15 ffc1448c: 7d 4a 4b 78 or r10,r10,r9 ffc14490: 89 21 00 50 lbz r9,80(r1) ffc14494: 7d 4a 4b 78 or r10,r10,r9 ffc14498: 89 21 00 53 lbz r9,83(r1) ffc1449c: 55 29 c0 0e rlwinm r9,r9,24,0,7 ffc144a0: 7d 4a 4b 78 or r10,r10,r9 ffc144a4: 3d 20 41 61 lis r9,16737 ffc144a8: 61 29 52 52 ori r9,r9,21074 ffc144ac: 7f 8a 48 00 cmpw cr7,r10,r9 ffc144b0: 41 be 00 1c beq+ cr7,ffc144cc <== 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); ffc144b4: 4b ff f5 35 bl ffc139e8 <== NOT EXECUTED if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != FAT_FSINFO_LEAD_SIGNATURE_VALUE) { _fat_block_release(fs_info); close(vol->fd); ffc144b8: 80 7f 00 60 lwz r3,96(r31) <== NOT EXECUTED ffc144bc: 4b ff 17 99 bl ffc05c54 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); ffc144c0: 48 00 7c 29 bl ffc1c0e8 <__errno> <== NOT EXECUTED ffc144c4: 39 20 00 16 li r9,22 <== NOT EXECUTED ffc144c8: 48 00 02 00 b ffc146c8 <== NOT EXECUTED } else { ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, ffc144cc: a0 9f 00 40 lhz r4,64(r31) ffc144d0: 38 a0 01 e4 li r5,484 ffc144d4: 38 c0 00 0c li r6,12 ffc144d8: 38 e1 00 50 addi r7,r1,80 ffc144dc: 4b ff f7 95 bl ffc13c70 <_fat_block_read> FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) ffc144e0: 2f 83 00 00 cmpwi cr7,r3,0 ffc144e4: 40 bc 00 18 bge+ cr7,ffc144fc <== 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); ffc144e8: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc144ec: 4b ff f4 fd bl ffc139e8 <== 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); ffc144f0: 80 7f 00 60 lwz r3,96(r31) <== NOT EXECUTED ffc144f4: 4b ff 17 61 bl ffc05c54 <== NOT EXECUTED ffc144f8: 48 00 01 d4 b ffc146cc <== NOT EXECUTED return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); ffc144fc: 89 41 00 55 lbz r10,85(r1) ffc14500: 89 21 00 56 lbz r9,86(r1) ffc14504: 55 4a 40 2e rlwinm r10,r10,8,0,23 ffc14508: 55 29 80 1e rlwinm r9,r9,16,0,15 ffc1450c: 7d 49 4b 78 or r9,r10,r9 ffc14510: 89 41 00 54 lbz r10,84(r1) ffc14514: 7d 29 53 78 or r9,r9,r10 ffc14518: 89 41 00 57 lbz r10,87(r1) ffc1451c: 55 4a c0 0e rlwinm r10,r10,24,0,7 ffc14520: 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); ffc14524: 89 41 00 59 lbz r10,89(r1) _fat_block_release(fs_info); close(vol->fd); return -1; } vol->free_cls_in_fs_info = ffc14528: 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); ffc1452c: 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; ffc14530: 91 3f 00 44 stw r9,68(r31) vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); ffc14534: 89 21 00 5a lbz r9,90(r1) ffc14538: 55 29 80 1e rlwinm r9,r9,16,0,15 ffc1453c: 7d 49 4b 78 or r9,r10,r9 ffc14540: 89 41 00 58 lbz r10,88(r1) ffc14544: 7d 29 53 78 or r9,r9,r10 ffc14548: 89 41 00 5b lbz r10,91(r1) ffc1454c: 55 4a c0 0e rlwinm r10,r10,24,0,7 ffc14550: 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 = ffc14554: 91 3f 00 50 stw r9,80(r31) ffc14558: 48 00 00 1c b ffc14574 } } } else { vol->rdir_cl = 0; ffc1455c: 39 20 00 00 li r9,0 ffc14560: 91 3f 00 3c stw r9,60(r31) vol->mirror = 0; ffc14564: 99 3f 00 54 stb r9,84(r31) vol->afat = 0; ffc14568: 99 3f 00 5c stb r9,92(r31) vol->free_cls = FAT_UNDEFINED_VALUE; ffc1456c: 39 20 ff ff li r9,-1 ffc14570: 91 3f 00 44 stw r9,68(r31) vol->next_cl = FAT_UNDEFINED_VALUE; ffc14574: 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); ffc14578: 7f e3 fb 78 mr r3,r31 ffc1457c: 4b ff f4 6d bl ffc139e8 vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; ffc14580: 89 5f 00 5c lbz r10,92(r31) ffc14584: 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)); ffc14588: 38 60 00 02 li r3,2 ffc1458c: 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; ffc14590: 7d 2a 49 d6 mullw r9,r10,r9 ffc14594: a1 5f 00 18 lhz r10,24(r31) ffc14598: 7d 29 52 14 add r9,r9,r10 ffc1459c: 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)); ffc145a0: 4b ff 16 59 bl ffc05bf8 if ( fs_info->vhash == NULL ) ffc145a4: 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)); ffc145a8: 90 7f 00 6c stw r3,108(r31) if ( fs_info->vhash == NULL ) ffc145ac: 41 9e 00 48 beq- cr7,ffc145f4 <== 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 ); ffc145b0: 39 23 00 04 addi r9,r3,4 head->next = tail; head->previous = NULL; tail->previous = head; ffc145b4: 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 ); ffc145b8: 39 43 00 10 addi r10,r3,16 head->next = tail; ffc145bc: 91 23 00 00 stw r9,0(r3) head->previous = NULL; ffc145c0: 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 ); ffc145c4: 39 23 00 0c addi r9,r3,12 head->next = tail; head->previous = NULL; ffc145c8: 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)); ffc145cc: 38 80 00 0c li r4,12 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; ffc145d0: 91 43 00 0c stw r10,12(r3) head->previous = NULL; ffc145d4: 93 c3 00 10 stw r30,16(r3) tail->previous = head; ffc145d8: 91 23 00 14 stw r9,20(r3) ffc145dc: 38 60 00 02 li r3,2 ffc145e0: 4b ff 16 19 bl ffc05bf8 if ( fs_info->rhash == NULL ) ffc145e4: 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)); ffc145e8: 90 7f 00 70 stw r3,112(r31) if ( fs_info->rhash == NULL ) ffc145ec: 40 be 00 14 bne+ cr7,ffc14600 <== ALWAYS TAKEN ffc145f0: 48 00 00 70 b ffc14660 <== 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); ffc145f4: 80 7f 00 60 lwz r3,96(r31) <== NOT EXECUTED ffc145f8: 4b ff 16 5d bl ffc05c54 <== NOT EXECUTED ffc145fc: 48 00 00 c4 b ffc146c0 <== 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 ); ffc14600: 39 23 00 04 addi r9,r3,4 head->next = tail; head->previous = NULL; ffc14604: 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 ); ffc14608: 39 43 00 10 addi r10,r3,16 head->next = tail; ffc1460c: 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 ); ffc14610: 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)); ffc14614: 38 80 00 01 li r4,1 head->next = tail; head->previous = NULL; tail->previous = head; ffc14618: 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; ffc1461c: 39 20 01 00 li r9,256 ffc14620: 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; ffc14624: 91 43 00 0c stw r10,12(r3) head->previous = NULL; ffc14628: 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)); ffc1462c: 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; ffc14630: 91 3f 00 7c stw r9,124(r31) fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; ffc14634: 89 5f 00 03 lbz r10,3(r31) ffc14638: 81 3f 00 30 lwz r9,48(r31) fs_info->index = 0; ffc1463c: 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; ffc14640: 7d 29 50 30 slw r9,r9,r10 ffc14644: 55 29 20 36 rlwinm r9,r9,4,0,27 ffc14648: 91 3f 00 80 stw r9,128(r31) fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); ffc1464c: 4b ff 15 ad bl ffc05bf8 if ( fs_info->uino == NULL ) ffc14650: 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)); ffc14654: 90 7f 00 74 stw r3,116(r31) if ( fs_info->uino == NULL ) ffc14658: 40 be 00 30 bne+ cr7,ffc14688 <== ALWAYS TAKEN ffc1465c: 48 00 00 14 b ffc14670 <== 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); ffc14660: 80 7f 00 60 lwz r3,96(r31) <== NOT EXECUTED ffc14664: 4b ff 15 f1 bl ffc05c54 <== NOT EXECUTED free(fs_info->vhash); ffc14668: 80 7f 00 6c lwz r3,108(r31) <== NOT EXECUTED ffc1466c: 48 00 00 50 b ffc146bc <== 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); ffc14670: 80 7f 00 60 lwz r3,96(r31) <== NOT EXECUTED ffc14674: 4b ff 15 e1 bl ffc05c54 <== NOT EXECUTED free(fs_info->vhash); ffc14678: 80 7f 00 6c lwz r3,108(r31) <== NOT EXECUTED ffc1467c: 4b ff 16 61 bl ffc05cdc <== NOT EXECUTED free(fs_info->rhash); ffc14680: 80 7f 00 70 lwz r3,112(r31) <== NOT EXECUTED ffc14684: 48 00 00 38 b ffc146bc <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); ffc14688: a0 7f 00 00 lhz r3,0(r31) ffc1468c: 38 80 00 01 li r4,1 ffc14690: 4b ff 15 69 bl ffc05bf8 if (fs_info->sec_buf == NULL) ffc14694: 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)); ffc14698: 90 7f 00 90 stw r3,144(r31) if (fs_info->sec_buf == NULL) ffc1469c: 40 be 00 38 bne+ cr7,ffc146d4 <== ALWAYS TAKEN { close(vol->fd); ffc146a0: 80 7f 00 60 lwz r3,96(r31) <== NOT EXECUTED ffc146a4: 4b ff 15 b1 bl ffc05c54 <== NOT EXECUTED free(fs_info->vhash); ffc146a8: 80 7f 00 6c lwz r3,108(r31) <== NOT EXECUTED ffc146ac: 4b ff 16 31 bl ffc05cdc <== NOT EXECUTED free(fs_info->rhash); ffc146b0: 80 7f 00 70 lwz r3,112(r31) <== NOT EXECUTED ffc146b4: 4b ff 16 29 bl ffc05cdc <== NOT EXECUTED free(fs_info->uino); ffc146b8: 80 7f 00 74 lwz r3,116(r31) <== NOT EXECUTED ffc146bc: 4b ff 16 21 bl ffc05cdc <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); ffc146c0: 48 00 7a 29 bl ffc1c0e8 <__errno> <== NOT EXECUTED ffc146c4: 39 20 00 0c li r9,12 <== NOT EXECUTED ffc146c8: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc146cc: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc146d0: 48 00 00 68 b ffc14738 <== 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; ffc146d4: 89 3f 00 04 lbz r9,4(r31) ffc146d8: 81 5f 00 34 lwz r10,52(r31) ffc146dc: 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) ffc146e0: 7d 23 50 39 and. r3,r9,r10 ffc146e4: 41 a2 00 0c beq+ ffc146f0 <== ALWAYS TAKEN vol->bytes_per_block_log2 = vol->bpc_log2; vol->sectors_per_block = vol->spc; } } return RC_OK; ffc146e8: 38 60 00 00 li r3,0 <== NOT EXECUTED ffc146ec: 48 00 00 4c b ffc14738 <== 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))) ffc146f0: 89 5f 00 0e lbz r10,14(r31) ffc146f4: 2f 8a 00 04 cmpwi cr7,r10,4 ffc146f8: 41 9e 00 10 beq- cr7,ffc14708 return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; ffc146fc: 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))) ffc14700: 7d 28 50 39 and. r8,r9,r10 ffc14704: 40 a2 ff e4 bne- ffc146e8 <== NEVER TAKEN { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); ffc14708: 80 7f 00 64 lwz r3,100(r31) ffc1470c: 38 a0 00 01 li r5,1 ffc14710: a0 9f 00 06 lhz r4,6(r31) ffc14714: 4b ff d8 49 bl ffc11f5c if (sc == RTEMS_SUCCESSFUL) ffc14718: 2f 83 00 00 cmpwi cr7,r3,0 ffc1471c: 40 be ff cc bne- cr7,ffc146e8 <== NEVER TAKEN { vol->bytes_per_block = vol->bpc; ffc14720: a1 3f 00 06 lhz r9,6(r31) ffc14724: b1 3f 00 0a sth r9,10(r31) vol->bytes_per_block_log2 = vol->bpc_log2; ffc14728: 89 3f 00 08 lbz r9,8(r31) ffc1472c: 99 3f 00 0c stb r9,12(r31) vol->sectors_per_block = vol->spc; ffc14730: 89 3f 00 04 lbz r9,4(r31) ffc14734: 99 3f 00 09 stb r9,9(r31) } } return RC_OK; } ffc14738: 39 61 00 d8 addi r11,r1,216 ffc1473c: 4b fe ce 7c b ffc015b8 <_restgpr_14_x> =============================================================================== ffc1a5b8 : uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { ffc1a5b8: 94 21 ff b8 stwu r1,-72(r1) ffc1a5bc: 7d 80 00 26 mfcr r12 ffc1a5c0: 7c 08 02 a6 mflr r0 int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; ffc1a5c4: 39 20 00 00 li r9,0 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { ffc1a5c8: be a1 00 1c stmw r21,28(r1) uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; if (count == 0) ffc1a5cc: 7c b6 2b 79 mr. r22,r5 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { ffc1a5d0: 7c 7f 1b 78 mr r31,r3 ffc1a5d4: 90 01 00 4c stw r0,76(r1) ffc1a5d8: 7c dd 33 78 mr r29,r6 ffc1a5dc: 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; ffc1a5e0: 82 e3 00 38 lwz r23,56(r3) bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; ffc1a5e4: 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; ffc1a5e8: 91 26 00 00 stw r9,0(r6) if (count == 0) ffc1a5ec: 41 82 01 cc beq- ffc1a7b8 <== NEVER TAKEN return rc; if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE) ffc1a5f0: 83 c3 00 4c lwz r30,76(r3) ffc1a5f4: 7c 9b 23 78 mr r27,r4 ffc1a5f8: 7c f8 3b 78 mr r24,r7 ffc1a5fc: 2f 9e ff ff cmpwi cr7,r30,-1 ffc1a600: 40 be 00 08 bne+ cr7,ffc1a608 uint32_t *last_cl, bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; ffc1a604: 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; ffc1a608: 3a f7 00 02 addi r23,r23,2 ffc1a60c: 3b 20 00 02 li r25,2 ffc1a610: 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) ffc1a614: 2e 08 00 00 cmpwi cr4,r8,0 ffc1a618: 48 00 01 3c b ffc1a754 * 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); ffc1a61c: 7f e3 fb 78 mr r3,r31 ffc1a620: 7f c4 f3 78 mr r4,r30 ffc1a624: 38 a1 00 08 addi r5,r1,8 ffc1a628: 4b ff fa 61 bl ffc1a088 if ( rc != RC_OK ) ffc1a62c: 7c 7c 1b 79 mr. r28,r3 ffc1a630: 41 a2 00 20 beq+ ffc1a650 <== ALWAYS TAKEN { if (*cls_added != 0) ffc1a634: 81 3d 00 00 lwz r9,0(r29) <== NOT EXECUTED ffc1a638: 2f 89 00 00 cmpwi cr7,r9,0 <== NOT EXECUTED ffc1a63c: 41 be 01 88 beq+ cr7,ffc1a7c4 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); ffc1a640: 80 9b 00 00 lwz r4,0(r27) <== NOT EXECUTED ffc1a644: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc1a648: 4b ff fe 9d bl ffc1a4e4 <== NOT EXECUTED ffc1a64c: 48 00 01 78 b ffc1a7c4 <== NOT EXECUTED return rc; } if (next_cln == FAT_GENFAT_FREE) ffc1a650: 81 21 00 08 lwz r9,8(r1) ffc1a654: 2f 89 00 00 cmpwi cr7,r9,0 ffc1a658: 40 9e 00 e8 bne- cr7,ffc1a740 /* * 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) ffc1a65c: 81 3d 00 00 lwz r9,0(r29) ffc1a660: 2f 89 00 00 cmpwi cr7,r9,0 ffc1a664: 40 9e 00 28 bne- cr7,ffc1a68c { *chain = cl4find; ffc1a668: 93 db 00 00 stw r30,0(r27) rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); ffc1a66c: 7f e3 fb 78 mr r3,r31 ffc1a670: 7f c4 f3 78 mr r4,r30 ffc1a674: 38 a0 ff ff li r5,-1 ffc1a678: 4b ff fb d1 bl ffc1a248 if ( rc != RC_OK ) ffc1a67c: 2c 03 00 00 cmpwi r3,0 ffc1a680: 40 82 01 40 bne- ffc1a7c0 <== NEVER TAKEN rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); if ( rc != RC_OK ) goto cleanup; } if (zero_fill) ffc1a684: 41 b2 00 4c beq+ cr4,ffc1a6d0 ffc1a688: 48 00 00 64 b ffc1a6ec } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); ffc1a68c: 7f e3 fb 78 mr r3,r31 ffc1a690: 7f c4 f3 78 mr r4,r30 ffc1a694: 38 a0 ff ff li r5,-1 ffc1a698: 4b ff fb b1 bl ffc1a248 if ( rc != RC_OK ) ffc1a69c: 7c 75 1b 79 mr. r21,r3 { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); ffc1a6a0: 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 ) ffc1a6a4: 41 a2 00 14 beq+ ffc1a6b8 <== ALWAYS TAKEN { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); ffc1a6a8: 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); ffc1a6ac: 7e bc ab 78 mr r28,r21 <== NOT EXECUTED if ( rc != RC_OK ) { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); ffc1a6b0: 4b ff fe 35 bl ffc1a4e4 <== NOT EXECUTED ffc1a6b4: 48 00 01 10 b ffc1a7c4 <== NOT EXECUTED return rc; } rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); ffc1a6b8: 7f 44 d3 78 mr r4,r26 ffc1a6bc: 7f c5 f3 78 mr r5,r30 ffc1a6c0: 4b ff fb 89 bl ffc1a248 if ( rc != RC_OK ) ffc1a6c4: 7c 7a 1b 79 mr. r26,r3 ffc1a6c8: 41 82 ff bc beq+ ffc1a684 <== ALWAYS TAKEN ffc1a6cc: 48 00 00 c0 b ffc1a78c <== NOT EXECUTED goto cleanup; } } save_cln = cl4find; (*cls_added)++; ffc1a6d0: 81 3d 00 00 lwz r9,0(r29) ffc1a6d4: 39 29 00 01 addi r9,r9,1 /* have we satisfied request ? */ if (*cls_added == count) ffc1a6d8: 7f 89 b0 00 cmpw cr7,r9,r22 goto cleanup; } } save_cln = cl4find; (*cls_added)++; ffc1a6dc: 91 3d 00 00 stw r9,0(r29) /* have we satisfied request ? */ if (*cls_added == count) ffc1a6e0: 41 9e 00 34 beq- cr7,ffc1a714 ffc1a6e4: 7f da f3 78 mr r26,r30 ffc1a6e8: 48 00 00 58 b ffc1a740 goto cleanup; } if (zero_fill) { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); ffc1a6ec: a0 df 00 06 lhz r6,6(r31) ffc1a6f0: 7f e3 fb 78 mr r3,r31 ffc1a6f4: 7f c4 f3 78 mr r4,r30 ffc1a6f8: 38 a0 00 00 li r5,0 ffc1a6fc: 38 e0 00 00 li r7,0 ffc1a700: 4b ff 96 c1 bl ffc13dc0 if (fs_info->vol.bpc != bytes_written) ffc1a704: a1 3f 00 06 lhz r9,6(r31) ffc1a708: 7f 89 18 00 cmpw cr7,r9,r3 ffc1a70c: 41 9e ff c4 beq+ cr7,ffc1a6d0 <== ALWAYS TAKEN ffc1a710: 48 00 00 78 b ffc1a788 <== 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) ffc1a714: 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; ffc1a718: 93 df 00 4c stw r30,76(r31) if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) ffc1a71c: 2f 89 ff ff cmpwi cr7,r9,-1 ffc1a720: 41 9e 00 10 beq- cr7,ffc1a730 <== ALWAYS TAKEN fs_info->vol.free_cls -= (*cls_added); ffc1a724: 81 5d 00 00 lwz r10,0(r29) <== NOT EXECUTED ffc1a728: 7d 2a 48 50 subf r9,r10,r9 <== NOT EXECUTED ffc1a72c: 91 3f 00 44 stw r9,68(r31) <== NOT EXECUTED *last_cl = save_cln; ffc1a730: 93 d8 00 00 stw r30,0(r24) fat_buf_release(fs_info); ffc1a734: 7f e3 fb 78 mr r3,r31 ffc1a738: 4b ff 92 b1 bl ffc139e8 ffc1a73c: 48 00 00 88 b ffc1a7c4 return rc; } } i++; cl4find++; ffc1a740: 3b de 00 01 addi r30,r30,1 if (cl4find >= data_cls_val) ffc1a744: 7f 9e b8 40 cmplw cr7,r30,r23 *last_cl = save_cln; fat_buf_release(fs_info); return rc; } } i++; ffc1a748: 3b 39 00 01 addi r25,r25,1 cl4find++; if (cl4find >= data_cls_val) ffc1a74c: 41 9c 00 08 blt- cr7,ffc1a754 <== ALWAYS TAKEN cl4find = 2; ffc1a750: 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) ffc1a754: 7f 99 b8 40 cmplw cr7,r25,r23 ffc1a758: 41 9c fe c4 blt+ cr7,ffc1a61c <== 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) ffc1a75c: 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; ffc1a760: 93 5f 00 4c stw r26,76(r31) <== NOT EXECUTED if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) ffc1a764: 2f 89 ff ff cmpwi cr7,r9,-1 <== NOT EXECUTED ffc1a768: 41 9e 00 10 beq- cr7,ffc1a778 <== NOT EXECUTED fs_info->vol.free_cls -= (*cls_added); ffc1a76c: 81 5d 00 00 lwz r10,0(r29) <== NOT EXECUTED ffc1a770: 7d 2a 48 50 subf r9,r10,r9 <== NOT EXECUTED ffc1a774: 91 3f 00 44 stw r9,68(r31) <== NOT EXECUTED *last_cl = save_cln; ffc1a778: 93 58 00 00 stw r26,0(r24) <== NOT EXECUTED fat_buf_release(fs_info); ffc1a77c: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc1a780: 4b ff 92 69 bl ffc139e8 <== NOT EXECUTED ffc1a784: 48 00 00 34 b ffc1a7b8 <== 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; ffc1a788: 3b 40 ff ff li r26,-1 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); ffc1a78c: 80 9b 00 00 lwz r4,0(r27) <== NOT EXECUTED ffc1a790: 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; ffc1a794: 7f 5c d3 78 mr r28,r26 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); ffc1a798: 4b ff fd 4d bl ffc1a4e4 <== NOT EXECUTED /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); ffc1a79c: 7f c4 f3 78 mr r4,r30 <== NOT EXECUTED ffc1a7a0: 38 a0 00 00 li r5,0 <== NOT EXECUTED ffc1a7a4: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc1a7a8: 4b ff fa a1 bl ffc1a248 <== NOT EXECUTED fat_buf_release(fs_info); ffc1a7ac: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc1a7b0: 4b ff 92 39 bl ffc139e8 <== NOT EXECUTED ffc1a7b4: 48 00 00 10 b ffc1a7c4 <== NOT EXECUTED ssize_t bytes_written; *cls_added = 0; if (count == 0) return rc; ffc1a7b8: 3b 80 00 00 li r28,0 <== NOT EXECUTED ffc1a7bc: 48 00 00 08 b ffc1a7c4 <== NOT EXECUTED * wouldn't work properly */ if (*cls_added == 0) { *chain = cl4find; rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); ffc1a7c0: 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; } ffc1a7c4: 81 81 00 18 lwz r12,24(r1) ffc1a7c8: 39 61 00 48 addi r11,r1,72 ffc1a7cc: 7f 83 e3 78 mr r3,r28 ffc1a7d0: 7d 80 81 20 mtcrf 8,r12 ffc1a7d4: 4b fe 6e 00 b ffc015d4 <_restgpr_21_x> =============================================================================== ffc13d0c : fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { ffc13d0c: 94 21 ff c8 stwu r1,-56(r1) ffc13d10: 7c 08 02 a6 mflr r0 ffc13d14: bf 01 00 18 stmw r24,24(r1) ffc13d18: 7c 7e 1b 78 mr r30,r3 ffc13d1c: 7c dd 33 78 mr r29,r6 ffc13d20: 90 01 00 3c stw r0,60(r1) ffc13d24: 7c f9 3b 78 mr r25,r7 int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; uint32_t ofs = offset; ffc13d28: 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; ffc13d2c: 7c 9b 23 78 mr r27,r4 uint32_t offset, uint32_t count, const void *buff) { int rc = RC_OK; ssize_t cmpltd = 0; ffc13d30: 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; ffc13d34: 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) ffc13d38: 48 00 00 6c b ffc13da4 { c = MIN(count, (fs_info->vol.bps - ofs)); ffc13d3c: a3 fe 00 00 lhz r31,0(r30) ffc13d40: 7f fa f8 50 subf r31,r26,r31 ffc13d44: 7f 9f e8 40 cmplw cr7,r31,r29 ffc13d48: 40 9d 00 08 ble- cr7,ffc13d50 ffc13d4c: 7f bf eb 78 mr r31,r29 if (c == fs_info->vol.bytes_per_block) ffc13d50: a1 3e 00 0a lhz r9,10(r30) rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); ffc13d54: 7f c3 f3 78 mr r3,r30 ffc13d58: 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) ffc13d5c: 7f 9f 48 00 cmpw cr7,r31,r9 rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); ffc13d60: 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) ffc13d64: 41 9e 00 08 beq- cr7,ffc13d6c <== 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); ffc13d68: 38 a0 00 01 li r5,1 ffc13d6c: 38 c1 00 08 addi r6,r1,8 ffc13d70: 4b ff fe 39 bl ffc13ba8 if (rc != RC_OK) ffc13d74: 2f 83 00 00 cmpwi cr7,r3,0 ffc13d78: 40 9e 00 38 bne- cr7,ffc13db0 <== NEVER TAKEN return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); ffc13d7c: 80 61 00 08 lwz r3,8(r1) ffc13d80: 7c 99 e2 14 add r4,r25,r28 ffc13d84: 7f e5 fb 78 mr r5,r31 ffc13d88: 7c 63 d2 14 add r3,r3,r26 ffc13d8c: 48 00 90 3d bl ffc1cdc8 ffc13d90: 9b 1e 00 88 stb r24,136(r30) fat_buf_mark_modified(fs_info); count -= c; ffc13d94: 7f bf e8 50 subf r29,r31,r29 cmpltd +=c; ffc13d98: 7f 9f e2 14 add r28,r31,r28 sec_num++; ffc13d9c: 3b 7b 00 01 addi r27,r27,1 ofs = 0; ffc13da0: 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) ffc13da4: 2f 9d 00 00 cmpwi cr7,r29,0 ffc13da8: 40 9e ff 94 bne+ cr7,ffc13d3c ffc13dac: 48 00 00 08 b ffc13db4 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; ffc13db0: 3b 80 ff ff li r28,-1 <== NOT EXECUTED cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } ffc13db4: 39 61 00 38 addi r11,r1,56 ffc13db8: 7f 83 e3 78 mr r3,r28 ffc13dbc: 4b fe d8 24 b ffc015e0 <_restgpr_24_x> =============================================================================== ffc1a248 : 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)) ) ffc1a248: 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 ) { ffc1a24c: 94 21 ff d0 stwu r1,-48(r1) ffc1a250: 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; ffc1a254: 39 20 00 00 li r9,0 fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { ffc1a258: bf 41 00 18 stmw r26,24(r1) ffc1a25c: 7c 9e 23 78 mr r30,r4 ffc1a260: 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; ffc1a264: 91 21 00 08 stw r9,8(r1) /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) ffc1a268: 40 9d 02 64 ble- cr7,ffc1a4cc <== NEVER TAKEN ffc1a26c: 81 23 00 38 lwz r9,56(r3) ffc1a270: 7c 7f 1b 78 mr r31,r3 ffc1a274: 39 29 00 01 addi r9,r9,1 ffc1a278: 7f 84 48 40 cmplw cr7,r4,r9 ffc1a27c: 40 bd 00 08 ble+ cr7,ffc1a284 <== ALWAYS TAKEN ffc1a280: 48 00 02 4c b ffc1a4cc <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + ffc1a284: 89 23 00 0e lbz r9,14(r3) ffc1a288: 7c bc 2b 78 mr r28,r5 ffc1a28c: 71 28 00 01 andi. r8,r9,1 ffc1a290: 41 82 00 10 beq- ffc1a2a0 ffc1a294: 54 9b f8 7e rlwinm r27,r4,31,1,31 ffc1a298: 7f 7b 22 14 add r27,r27,r4 ffc1a29c: 48 00 00 18 b ffc1a2b4 ffc1a2a0: 55 2a 07 bc rlwinm r10,r9,0,30,30 ffc1a2a4: 71 47 00 ff andi. r7,r10,255 ffc1a2a8: 54 9b 10 3a rlwinm r27,r4,2,0,29 ffc1a2ac: 41 82 00 08 beq- ffc1a2b4 ffc1a2b0: 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); ffc1a2b4: 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) + ffc1a2b8: 89 5f 00 02 lbz r10,2(r31) ffc1a2bc: 7f 7b 54 30 srw r27,r27,r10 ffc1a2c0: 81 5f 00 58 lwz r10,88(r31) ffc1a2c4: 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); ffc1a2c8: 41 9e 00 10 beq- cr7,ffc1a2d8 ffc1a2cc: 57 dd f8 7e rlwinm r29,r30,31,1,31 ffc1a2d0: 7f bd f2 14 add r29,r29,r30 ffc1a2d4: 48 00 00 18 b ffc1a2ec ffc1a2d8: 55 29 07 bc rlwinm r9,r9,0,30,30 ffc1a2dc: 71 2a 00 ff andi. r10,r9,255 ffc1a2e0: 57 dd 10 3a rlwinm r29,r30,2,0,29 ffc1a2e4: 41 82 00 08 beq- ffc1a2ec ffc1a2e8: 57 dd 08 3c rlwinm r29,r30,1,0,30 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); ffc1a2ec: 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); ffc1a2f0: a3 5f 00 00 lhz r26,0(r31) rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); ffc1a2f4: 7f 64 db 78 mr r4,r27 ffc1a2f8: 38 a0 00 01 li r5,1 ffc1a2fc: 38 c1 00 08 addi r6,r1,8 ffc1a300: 4b ff 98 a9 bl ffc13ba8 if (rc != RC_OK) ffc1a304: 2c 03 00 00 cmpwi r3,0 ffc1a308: 40 82 01 d4 bne- ffc1a4dc <== 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); ffc1a30c: 39 3a ff ff addi r9,r26,-1 ffc1a310: 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 ) ffc1a314: 8b bf 00 0e lbz r29,14(r31) ffc1a318: 2f 9d 00 02 cmpwi cr7,r29,2 ffc1a31c: 41 9e 01 50 beq- cr7,ffc1a46c ffc1a320: 2f 9d 00 04 cmpwi cr7,r29,4 ffc1a324: 41 9e 01 60 beq- cr7,ffc1a484 ffc1a328: 2f 9d 00 01 cmpwi cr7,r29,1 ffc1a32c: 40 be 01 a0 bne+ cr7,ffc1a4cc <== NEVER TAKEN { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) ffc1a330: 73 c7 00 01 andi. r7,r30,1 ffc1a334: 81 41 00 08 lwz r10,8(r1) ffc1a338: 41 82 00 90 beq- ffc1a3c8 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; ffc1a33c: 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; ffc1a340: 57 9c 24 36 rlwinm r28,r28,4,16,27 *(sec_buf + ofs) &= 0x0F; ffc1a344: 55 08 07 3e clrlwi r8,r8,28 ffc1a348: 7d 0a 49 ae stbx r8,r10,r9 *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); ffc1a34c: 81 41 00 08 lwz r10,8(r1) ffc1a350: 7d 0a 48 ae lbzx r8,r10,r9 ffc1a354: 7f 88 43 78 or r8,r28,r8 ffc1a358: 7d 0a 49 ae stbx r8,r10,r9 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) ffc1a35c: 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; ffc1a360: 9b bf 00 88 stb r29,136(r31) ffc1a364: 39 4a ff ff addi r10,r10,-1 ffc1a368: 7f 89 50 00 cmpw cr7,r9,r10 ffc1a36c: 40 be 00 3c bne+ cr7,ffc1a3a8 <== ALWAYS TAKEN { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, ffc1a370: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc1a374: 38 9b 00 01 addi r4,r27,1 <== NOT EXECUTED ffc1a378: 38 a0 00 01 li r5,1 <== NOT EXECUTED ffc1a37c: 38 c1 00 08 addi r6,r1,8 <== NOT EXECUTED ffc1a380: 4b ff 98 29 bl ffc13ba8 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) ffc1a384: 2c 03 00 00 cmpwi r3,0 <== NOT EXECUTED ffc1a388: 40 82 01 54 bne- ffc1a4dc <== NOT EXECUTED return rc; *sec_buf &= 0x00; ffc1a38c: 81 21 00 08 lwz r9,8(r1) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); ffc1a390: 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; ffc1a394: 98 69 00 00 stb r3,0(r9) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); ffc1a398: 81 21 00 08 lwz r9,8(r1) <== NOT EXECUTED ffc1a39c: 89 49 00 00 lbz r10,0(r9) <== NOT EXECUTED ffc1a3a0: 7f 8a 53 78 or r10,r28,r10 <== NOT EXECUTED ffc1a3a4: 48 00 00 90 b ffc1a434 <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; ffc1a3a8: 81 41 00 08 lwz r10,8(r1) ffc1a3ac: 39 29 00 01 addi r9,r9,1 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); ffc1a3b0: 57 9c c2 3e rlwinm r28,r28,24,8,31 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; ffc1a3b4: 7c 6a 49 ae stbx r3,r10,r9 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); ffc1a3b8: 81 41 00 08 lwz r10,8(r1) ffc1a3bc: 7d 0a 48 ae lbzx r8,r10,r9 ffc1a3c0: 7d 08 e3 78 or r8,r8,r28 ffc1a3c4: 48 00 00 a0 b ffc1a464 } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; ffc1a3c8: 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; ffc1a3cc: 57 9c 05 3e clrlwi r28,r28,20 ffc1a3d0: 57 9e 04 3e clrlwi r30,r28,16 *(sec_buf + ofs) &= 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); ffc1a3d4: 81 41 00 08 lwz r10,8(r1) ffc1a3d8: 7d 0a 48 ae lbzx r8,r10,r9 ffc1a3dc: 7d 1c e3 78 or r28,r8,r28 ffc1a3e0: 7f 8a 49 ae stbx r28,r10,r9 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) ffc1a3e4: a1 5f 00 00 lhz r10,0(r31) ffc1a3e8: 9b bf 00 88 stb r29,136(r31) ffc1a3ec: 39 4a ff ff addi r10,r10,-1 ffc1a3f0: 7f 89 50 00 cmpw cr7,r9,r10 ffc1a3f4: 40 be 00 4c bne+ cr7,ffc1a440 <== ALWAYS TAKEN { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, ffc1a3f8: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc1a3fc: 38 9b 00 01 addi r4,r27,1 <== NOT EXECUTED ffc1a400: 38 a0 00 01 li r5,1 <== NOT EXECUTED ffc1a404: 38 c1 00 08 addi r6,r1,8 <== NOT EXECUTED ffc1a408: 4b ff 97 a1 bl ffc13ba8 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) ffc1a40c: 2c 03 00 00 cmpwi r3,0 <== NOT EXECUTED ffc1a410: 40 82 00 cc bne- ffc1a4dc <== NOT EXECUTED return rc; *sec_buf &= 0xF0; ffc1a414: 81 21 00 08 lwz r9,8(r1) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); ffc1a418: 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; ffc1a41c: 89 49 00 00 lbz r10,0(r9) <== NOT EXECUTED ffc1a420: 55 4a 00 36 rlwinm r10,r10,0,0,27 <== NOT EXECUTED ffc1a424: 99 49 00 00 stb r10,0(r9) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); ffc1a428: 81 21 00 08 lwz r9,8(r1) <== NOT EXECUTED ffc1a42c: 89 49 00 00 lbz r10,0(r9) <== NOT EXECUTED ffc1a430: 7f ca 53 78 or r10,r30,r10 <== NOT EXECUTED ffc1a434: 99 49 00 00 stb r10,0(r9) <== NOT EXECUTED ffc1a438: 9b bf 00 88 stb r29,136(r31) <== NOT EXECUTED ffc1a43c: 48 00 00 a0 b ffc1a4dc <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; ffc1a440: 81 41 00 08 lwz r10,8(r1) ffc1a444: 39 29 00 01 addi r9,r9,1 *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); ffc1a448: 57 de c2 3e rlwinm r30,r30,24,8,31 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; ffc1a44c: 7d 0a 48 ae lbzx r8,r10,r9 ffc1a450: 55 08 00 36 rlwinm r8,r8,0,0,27 ffc1a454: 7d 0a 49 ae stbx r8,r10,r9 *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); ffc1a458: 81 41 00 08 lwz r10,8(r1) ffc1a45c: 7d 0a 48 ae lbzx r8,r10,r9 ffc1a460: 7d 08 f3 78 or r8,r8,r30 ffc1a464: 7d 0a 49 ae stbx r8,r10,r9 ffc1a468: 48 00 00 74 b ffc1a4dc } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = (uint16_t )(CT_LE_W(in_val)); ffc1a46c: 57 8a 42 2e rlwinm r10,r28,8,8,23 ffc1a470: 57 9c c6 3e rlwinm r28,r28,24,24,31 ffc1a474: 7d 5c e3 78 or r28,r10,r28 } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = ffc1a478: 81 41 00 08 lwz r10,8(r1) ffc1a47c: 7f 8a 4b 2e sthx r28,r10,r9 ffc1a480: 48 00 00 40 b ffc1a4c0 (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)); ffc1a484: 57 9c 01 3e clrlwi r28,r28,4 ffc1a488: 53 87 46 3e rlwimi r7,r28,8,24,31 ffc1a48c: 53 87 c4 2e rlwimi r7,r28,24,16,23 ffc1a490: 53 87 42 1e rlwimi r7,r28,8,8,15 ffc1a494: 53 87 c0 0e rlwimi r7,r28,24,0,7 ffc1a498: 3d 00 f0 00 lis r8,-4096 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); ffc1a49c: 81 41 00 08 lwz r10,8(r1) ffc1a4a0: 51 06 46 3e rlwimi r6,r8,8,24,31 ffc1a4a4: 51 06 c4 2e rlwimi r6,r8,24,16,23 ffc1a4a8: 51 06 42 1e rlwimi r6,r8,8,8,15 ffc1a4ac: 51 06 c0 0e rlwimi r6,r8,24,0,7 ffc1a4b0: 7d 0a 48 2e lwzx r8,r10,r9 ffc1a4b4: 7c c8 40 38 and r8,r6,r8 *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; ffc1a4b8: 7d 08 3b 78 or r8,r8,r7 ffc1a4bc: 7d 0a 49 2e stwx r8,r10,r9 ffc1a4c0: 39 20 00 01 li r9,1 ffc1a4c4: 99 3f 00 88 stb r9,136(r31) ffc1a4c8: 48 00 00 14 b ffc1a4dc fat_buf_mark_modified(fs_info); break; default: rtems_set_errno_and_return_minus_one(EIO); ffc1a4cc: 48 00 1c 1d bl ffc1c0e8 <__errno> <== NOT EXECUTED ffc1a4d0: 39 20 00 05 li r9,5 <== NOT EXECUTED ffc1a4d4: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc1a4d8: 38 60 ff ff li r3,-1 <== NOT EXECUTED break; } return RC_OK; } ffc1a4dc: 39 61 00 30 addi r11,r1,48 ffc1a4e0: 4b fe 71 08 b ffc015e8 <_restgpr_26_x> =============================================================================== ffc1483c : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_shutdown_drive(fat_fs_info_t *fs_info) { ffc1483c: 94 21 ff e8 stwu r1,-24(r1) ffc14840: 7c 08 02 a6 mflr r0 ffc14844: bf 81 00 08 stmw r28,8(r1) ffc14848: 7c 7f 1b 78 mr r31,r3 ffc1484c: 90 01 00 1c stw r0,28(r1) int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); ffc14850: 4b ff fe f1 bl ffc14740 if ( rc != RC_OK ) ffc14854: 7c 7d 1b 79 mr. r29,r3 ffc14858: 41 a2 00 08 beq+ ffc14860 <== ALWAYS TAKEN rc = -1; ffc1485c: 3b a0 ff ff li r29,-1 <== NOT EXECUTED ffc14860: 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; ffc14864: 83 9f 00 6c lwz r28,108(r31) ffc14868: 7f 9c f2 14 add r28,r28,r30 while ( (node = rtems_chain_get(the_chain)) != NULL ) ffc1486c: 48 00 00 08 b ffc14874 free(node); ffc14870: 4b ff 14 6d bl ffc05cdc */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); ffc14874: 7f 83 e3 78 mr r3,r28 ffc14878: 4b ff 68 2d bl ffc0b0a4 <_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 ) ffc1487c: 2f 83 00 00 cmpwi cr7,r3,0 ffc14880: 40 9e ff f0 bne+ cr7,ffc14870 rc = fat_sync(fs_info); if ( rc != RC_OK ) rc = -1; for (i = 0; i < FAT_HASH_SIZE; i++) ffc14884: 2f 9e 00 0c cmpwi cr7,r30,12 ffc14888: 3b de 00 0c addi r30,r30,12 ffc1488c: 40 be ff d8 bne- cr7,ffc14864 ffc14890: 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; ffc14894: 83 9f 00 70 lwz r28,112(r31) ffc14898: 7f 9c f2 14 add r28,r28,r30 while ( (node = rtems_chain_get(the_chain)) != NULL ) ffc1489c: 48 00 00 08 b ffc148a4 free(node); ffc148a0: 4b ff 14 3d bl ffc05cdc <== NOT EXECUTED ffc148a4: 7f 83 e3 78 mr r3,r28 ffc148a8: 4b ff 67 fd bl ffc0b0a4 <_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 ) ffc148ac: 2f 83 00 00 cmpwi cr7,r3,0 ffc148b0: 40 9e ff f0 bne+ cr7,ffc148a0 <== NEVER TAKEN while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } for (i = 0; i < FAT_HASH_SIZE; i++) ffc148b4: 2f 9e 00 0c cmpwi cr7,r30,12 ffc148b8: 3b de 00 0c addi r30,r30,12 ffc148bc: 40 be ff d8 bne- cr7,ffc14894 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } free(fs_info->vhash); ffc148c0: 80 7f 00 6c lwz r3,108(r31) ffc148c4: 4b ff 14 19 bl ffc05cdc free(fs_info->rhash); ffc148c8: 80 7f 00 70 lwz r3,112(r31) ffc148cc: 4b ff 14 11 bl ffc05cdc free(fs_info->uino); ffc148d0: 80 7f 00 74 lwz r3,116(r31) ffc148d4: 4b ff 14 09 bl ffc05cdc free(fs_info->sec_buf); ffc148d8: 80 7f 00 90 lwz r3,144(r31) ffc148dc: 4b ff 14 01 bl ffc05cdc close(fs_info->vol.fd); ffc148e0: 80 7f 00 60 lwz r3,96(r31) ffc148e4: 4b ff 13 71 bl ffc05c54 if (rc) ffc148e8: 2f 9d 00 00 cmpwi cr7,r29,0 ffc148ec: 41 be 00 10 beq+ cr7,ffc148fc <== ALWAYS TAKEN errno = EIO; ffc148f0: 48 00 77 f9 bl ffc1c0e8 <__errno> <== NOT EXECUTED ffc148f4: 39 20 00 05 li r9,5 <== NOT EXECUTED ffc148f8: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED return rc; } ffc148fc: 39 61 00 18 addi r11,r1,24 ffc14900: 7f a3 eb 78 mr r3,r29 ffc14904: 4b fe cc ec b ffc015f0 <_restgpr_28_x> =============================================================================== ffc14740 : return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { ffc14740: 94 21 ff d8 stwu r1,-40(r1) ffc14744: 7c 08 02 a6 mflr r0 ffc14748: bf a1 00 1c stmw r29,28(r1) ffc1474c: 7c 7f 1b 78 mr r31,r3 ffc14750: 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) ffc14754: 89 23 00 0e lbz r9,14(r3) ffc14758: 2f 89 00 04 cmpwi cr7,r9,4 ffc1475c: 41 9e 00 0c beq- cr7,ffc14768 * 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; ffc14760: 3b c0 00 00 li r30,0 ffc14764: 48 00 00 a0 b ffc14804 if (fs_info->vol.type == FAT_FAT32) { uint32_t free_count = fs_info->vol.free_cls; ffc14768: 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; ffc1476c: 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) ffc14770: 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; ffc14774: 83 a3 00 4c lwz r29,76(r3) if (free_count != fs_info->vol.free_cls_in_fs_info) ffc14778: 7f 89 50 00 cmpw cr7,r9,r10 ffc1477c: 41 9e 00 34 beq- cr7,ffc147b0 <== ALWAYS TAKEN uint32_t value ) { uint32_t swapped; __asm__ volatile("rlwimi %0,%1,8,24,31;" ffc14780: 51 2a 46 3e rlwimi r10,r9,8,24,31 <== NOT EXECUTED ffc14784: 51 2a c4 2e rlwimi r10,r9,24,16,23 <== NOT EXECUTED ffc14788: 51 2a 42 1e rlwimi r10,r9,8,8,15 <== NOT EXECUTED ffc1478c: 51 2a c0 0e rlwimi r10,r9,24,0,7 <== NOT EXECUTED { uint32_t le_free_count = CT_LE_L(free_count); ffc14790: 7c 27 0b 78 mr r7,r1 <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; ffc14794: 91 23 00 48 stw r9,72(r3) <== NOT EXECUTED ret1 = fat_sector_write(fs_info, ffc14798: 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); ffc1479c: 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, ffc147a0: 38 c0 00 04 li r6,4 <== NOT EXECUTED ffc147a4: a0 83 00 40 lhz r4,64(r3) <== NOT EXECUTED ffc147a8: 4b ff f5 65 bl ffc13d0c <== NOT EXECUTED ffc147ac: 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) ffc147b0: 81 3f 00 50 lwz r9,80(r31) ffc147b4: 7f 9d 48 00 cmpw cr7,r29,r9 ffc147b8: 41 9e 00 6c beq- cr7,ffc14824 <== NEVER TAKEN ffc147bc: 53 a9 46 3e rlwimi r9,r29,8,24,31 ffc147c0: 53 a9 c4 2e rlwimi r9,r29,24,16,23 ffc147c4: 53 a9 42 1e rlwimi r9,r29,8,8,15 ffc147c8: 53 a9 c0 0e rlwimi r9,r29,24,0,7 { uint32_t le_next_free = CT_LE_L(next_free); ffc147cc: 7c 27 0b 78 mr r7,r1 fs_info->vol.next_cl_in_fs_info = next_free; ffc147d0: 93 bf 00 50 stw r29,80(r31) ret2 = fat_sector_write(fs_info, ffc147d4: 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); ffc147d8: 95 27 00 08 stwu r9,8(r7) fs_info->vol.next_cl_in_fs_info = next_free; ret2 = fat_sector_write(fs_info, ffc147dc: 38 a0 01 ec li r5,492 ffc147e0: 38 c0 00 04 li r6,4 ffc147e4: a0 9f 00 40 lhz r4,64(r31) ffc147e8: 4b ff f5 25 bl ffc13d0c sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) ffc147ec: 2f 9e 00 00 cmpwi cr7,r30,0 ffc147f0: 40 bc 00 0c bge+ cr7,ffc147fc <== ALWAYS TAKEN { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; ffc147f4: 3b c0 ff ff li r30,-1 <== NOT EXECUTED ffc147f8: 48 00 00 0c b ffc14804 <== NOT EXECUTED sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) ffc147fc: 2f 83 00 00 cmpwi cr7,r3,0 ffc14800: 48 00 00 28 b ffc14828 rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; fat_buf_release(fs_info); ffc14804: 7f e3 fb 78 mr r3,r31 ffc14808: 4b ff f1 e1 bl ffc139e8 if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) ffc1480c: 80 7f 00 64 lwz r3,100(r31) ffc14810: 4b ff d5 31 bl ffc11d40 ffc14814: 2f 83 00 00 cmpwi cr7,r3,0 ffc14818: 41 be 00 18 beq+ cr7,ffc14830 <== ALWAYS TAKEN rc = -1; ffc1481c: 3b c0 ff ff li r30,-1 <== NOT EXECUTED ffc14820: 48 00 00 10 b ffc14830 <== NOT EXECUTED sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) ffc14824: 2f 9e 00 00 cmpwi cr7,r30,0 <== NOT EXECUTED ffc14828: 40 9c ff 38 bge+ cr7,ffc14760 <== ALWAYS TAKEN ffc1482c: 4b ff ff c8 b ffc147f4 <== NOT EXECUTED if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) rc = -1; return rc; } ffc14830: 39 61 00 28 addi r11,r1,40 ffc14834: 7f c3 f3 78 mr r3,r30 ffc14838: 4b fe cd bc b ffc015f4 <_restgpr_29_x> =============================================================================== ffc33de4 : /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { ffc33de4: 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; ffc33de8: 39 20 00 00 li r9,0 /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { ffc33dec: 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; ffc33df0: 91 21 00 14 stw r9,20(r1) st.st_uid = 0; ffc33df4: b1 21 00 1a sth r9,26(r1) st.st_gid = 0; ffc33df8: b1 21 00 1c sth r9,28(r1) rtems_libio_check_fd( fd ); ffc33dfc: 3d 20 00 00 lis r9,0 ffc33e00: 81 29 33 d8 lwz r9,13272(r9) /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { ffc33e04: 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 ); ffc33e08: 7f 83 48 40 cmplw cr7,r3,r9 /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { ffc33e0c: 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 ); ffc33e10: 41 bc 00 08 blt+ cr7,ffc33e18 ffc33e14: 48 00 00 20 b ffc33e34 iop = rtems_libio_iop( fd ); ffc33e18: 3d 20 00 00 lis r9,0 ffc33e1c: 83 c9 34 c8 lwz r30,13512(r9) ffc33e20: 1c 63 00 38 mulli r3,r3,56 ffc33e24: 7f de 1a 14 add r30,r30,r3 rtems_libio_check_is_open( iop ); ffc33e28: 81 3e 00 10 lwz r9,16(r30) ffc33e2c: 71 2a 01 00 andi. r10,r9,256 ffc33e30: 40 a2 00 18 bne+ ffc33e48 ffc33e34: 48 00 45 d5 bl ffc38408 <__errno> ffc33e38: 39 20 00 09 li r9,9 ffc33e3c: 91 23 00 00 stw r9,0(r3) ffc33e40: 3b e0 ff ff li r31,-1 ffc33e44: 48 00 00 a0 b ffc33ee4 if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } ffc33e48: 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 ); ffc33e4c: 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 ); ffc33e50: 81 23 00 0c lwz r9,12(r3) ffc33e54: 81 29 00 00 lwz r9,0(r9) ffc33e58: 7d 29 03 a6 mtctr r9 ffc33e5c: 4e 80 04 21 bctrl ffc33e60: 81 3e 00 24 lwz r9,36(r30) ffc33e64: 7f a3 eb 78 mr r3,r29 ffc33e68: 81 29 00 18 lwz r9,24(r9) ffc33e6c: 38 81 00 08 addi r4,r1,8 ffc33e70: 7d 29 03 a6 mtctr r9 ffc33e74: 4e 80 04 21 bctrl if ( rv == 0 ) { ffc33e78: 7c 7f 1b 79 mr. r31,r3 ffc33e7c: 40 a2 00 40 bne+ ffc33ebc <== NEVER TAKEN bool access_ok = rtems_filesystem_check_access( ffc33e80: 80 81 00 14 lwz r4,20(r1) ffc33e84: 38 60 00 01 li r3,1 ffc33e88: a0 a1 00 1a lhz r5,26(r1) ffc33e8c: a0 c1 00 1c lhz r6,28(r1) ffc33e90: 4b fd b4 a9 bl ffc0f338 st.st_mode, st.st_uid, st.st_gid ); if ( access_ok ) { ffc33e94: 2f 83 00 00 cmpwi cr7,r3,0 ffc33e98: 41 9e 00 14 beq- cr7,ffc33eac rtems_filesystem_location_clone( &loc, &iop->pathinfo ); ffc33e9c: 38 61 00 50 addi r3,r1,80 ffc33ea0: 7f a4 eb 78 mr r4,r29 ffc33ea4: 4b fd ad ad bl ffc0ec50 ffc33ea8: 48 00 00 14 b ffc33ebc } else { errno = EACCES; ffc33eac: 48 00 45 5d bl ffc38408 <__errno> ffc33eb0: 39 20 00 0d li r9,13 ffc33eb4: 91 23 00 00 stw r9,0(r3) rv = -1; ffc33eb8: 3b e0 ff ff li r31,-1 if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } ffc33ebc: 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 ); ffc33ec0: 81 23 00 0c lwz r9,12(r3) ffc33ec4: 81 29 00 04 lwz r9,4(r9) ffc33ec8: 7d 29 03 a6 mtctr r9 ffc33ecc: 4e 80 04 21 bctrl rv = -1; } } rtems_filesystem_instance_unlock( &iop->pathinfo ); if ( rv == 0 ) { ffc33ed0: 2f 9f 00 00 cmpwi cr7,r31,0 ffc33ed4: 40 be 00 10 bne+ cr7,ffc33ee4 rv = rtems_filesystem_chdir( &loc ); ffc33ed8: 38 61 00 50 addi r3,r1,80 ffc33edc: 4b ff 09 e5 bl ffc248c0 ffc33ee0: 7c 7f 1b 78 mr r31,r3 } return rv; } ffc33ee4: 39 61 00 78 addi r11,r1,120 ffc33ee8: 7f e3 fb 78 mr r3,r31 ffc33eec: 48 02 06 18 b ffc54504 <_restgpr_29_x> =============================================================================== ffc24eec : int fchmod( int fd, mode_t mode ) { int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc24eec: 3d 20 00 00 lis r9,0 /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { ffc24ef0: 94 21 ff e8 stwu r1,-24(r1) ffc24ef4: 7c 08 02 a6 mflr r0 int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc24ef8: 81 29 33 d8 lwz r9,13272(r9) /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { ffc24efc: 90 01 00 1c stw r0,28(r1) int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc24f00: 7f 83 48 40 cmplw cr7,r3,r9 /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { ffc24f04: bf c1 00 10 stmw r30,16(r1) int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc24f08: 41 bc 00 08 blt+ cr7,ffc24f10 ffc24f0c: 48 00 00 20 b ffc24f2c iop = rtems_libio_iop( fd ); ffc24f10: 3d 20 00 00 lis r9,0 ffc24f14: 83 e9 34 c8 lwz r31,13512(r9) ffc24f18: 1c 63 00 38 mulli r3,r3,56 ffc24f1c: 7f ff 1a 14 add r31,r31,r3 rtems_libio_check_is_open(iop); ffc24f20: 81 3f 00 10 lwz r9,16(r31) ffc24f24: 71 2a 01 00 andi. r10,r9,256 ffc24f28: 40 a2 00 10 bne+ ffc24f38 ffc24f2c: 48 01 34 dd bl ffc38408 <__errno> ffc24f30: 39 20 00 09 li r9,9 ffc24f34: 48 00 00 68 b ffc24f9c if (iop->pathinfo.mt_entry->writeable) { ffc24f38: 80 7f 00 28 lwz r3,40(r31) ffc24f3c: 89 23 00 29 lbz r9,41(r3) ffc24f40: 2f 89 00 00 cmpwi cr7,r9,0 ffc24f44: 41 9e 00 50 beq- cr7,ffc24f94 <== 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 ); ffc24f48: 81 23 00 0c lwz r9,12(r3) ffc24f4c: 81 29 00 00 lwz r9,0(r9) ffc24f50: 90 81 00 08 stw r4,8(r1) ffc24f54: 7d 29 03 a6 mtctr r9 ffc24f58: 4e 80 04 21 bctrl rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); ffc24f5c: 81 3f 00 28 lwz r9,40(r31) ffc24f60: 38 7f 00 14 addi r3,r31,20 ffc24f64: 80 81 00 08 lwz r4,8(r1) ffc24f68: 81 29 00 0c lwz r9,12(r9) ffc24f6c: 81 29 00 20 lwz r9,32(r9) ffc24f70: 7d 29 03 a6 mtctr r9 ffc24f74: 4e 80 04 21 bctrl ffc24f78: 7c 7e 1b 78 mr r30,r3 errno = EROFS; rv = -1; } return rv; } ffc24f7c: 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 ); ffc24f80: 81 23 00 0c lwz r9,12(r3) ffc24f84: 81 29 00 04 lwz r9,4(r9) ffc24f88: 7d 29 03 a6 mtctr r9 ffc24f8c: 4e 80 04 21 bctrl ffc24f90: 48 00 00 14 b ffc24fa4 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; ffc24f94: 48 01 34 75 bl ffc38408 <__errno> <== NOT EXECUTED ffc24f98: 39 20 00 1e li r9,30 <== NOT EXECUTED ffc24f9c: 91 23 00 00 stw r9,0(r3) rv = -1; ffc24fa0: 3b c0 ff ff li r30,-1 } return rv; } ffc24fa4: 39 61 00 18 addi r11,r1,24 ffc24fa8: 7f c3 f3 78 mr r3,r30 ffc24fac: 48 02 f5 5c b ffc54508 <_restgpr_30_x> =============================================================================== ffc24fb0 : int fchown( int fd, uid_t owner, gid_t group ) { int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc24fb0: 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 ) { ffc24fb4: 94 21 ff e8 stwu r1,-24(r1) ffc24fb8: 7c 08 02 a6 mflr r0 int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc24fbc: 81 29 33 d8 lwz r9,13272(r9) /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { ffc24fc0: 90 01 00 1c stw r0,28(r1) int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc24fc4: 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 ) { ffc24fc8: bf c1 00 10 stmw r30,16(r1) int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc24fcc: 41 bc 00 08 blt+ cr7,ffc24fd4 ffc24fd0: 48 00 00 20 b ffc24ff0 iop = rtems_libio_iop( fd ); ffc24fd4: 3d 20 00 00 lis r9,0 ffc24fd8: 83 e9 34 c8 lwz r31,13512(r9) ffc24fdc: 1c 63 00 38 mulli r3,r3,56 ffc24fe0: 7f ff 1a 14 add r31,r31,r3 rtems_libio_check_is_open(iop); ffc24fe4: 81 3f 00 10 lwz r9,16(r31) ffc24fe8: 71 2a 01 00 andi. r10,r9,256 ffc24fec: 40 a2 00 10 bne+ ffc24ffc ffc24ff0: 48 01 34 19 bl ffc38408 <__errno> ffc24ff4: 39 20 00 09 li r9,9 ffc24ff8: 48 00 00 70 b ffc25068 if (iop->pathinfo.mt_entry->writeable) { ffc24ffc: 80 7f 00 28 lwz r3,40(r31) ffc25000: 89 23 00 29 lbz r9,41(r3) ffc25004: 2f 89 00 00 cmpwi cr7,r9,0 ffc25008: 41 9e 00 58 beq- cr7,ffc25060 <== 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 ); ffc2500c: 81 23 00 0c lwz r9,12(r3) ffc25010: 81 29 00 00 lwz r9,0(r9) ffc25014: 90 81 00 08 stw r4,8(r1) ffc25018: 7d 29 03 a6 mtctr r9 ffc2501c: 90 a1 00 0c stw r5,12(r1) ffc25020: 4e 80 04 21 bctrl rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->chown_h)( ffc25024: 81 3f 00 28 lwz r9,40(r31) ffc25028: 38 7f 00 14 addi r3,r31,20 ffc2502c: 80 81 00 08 lwz r4,8(r1) ffc25030: 81 29 00 0c lwz r9,12(r9) ffc25034: 80 a1 00 0c lwz r5,12(r1) ffc25038: 81 29 00 24 lwz r9,36(r9) ffc2503c: 7d 29 03 a6 mtctr r9 ffc25040: 4e 80 04 21 bctrl ffc25044: 7c 7e 1b 78 mr r30,r3 errno = EROFS; rv = -1; } return rv; } ffc25048: 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 ); ffc2504c: 81 23 00 0c lwz r9,12(r3) ffc25050: 81 29 00 04 lwz r9,4(r9) ffc25054: 7d 29 03 a6 mtctr r9 ffc25058: 4e 80 04 21 bctrl ffc2505c: 48 00 00 14 b ffc25070 owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; ffc25060: 48 01 33 a9 bl ffc38408 <__errno> <== NOT EXECUTED ffc25064: 39 20 00 1e li r9,30 <== NOT EXECUTED ffc25068: 91 23 00 00 stw r9,0(r3) rv = -1; ffc2506c: 3b c0 ff ff li r30,-1 } return rv; } ffc25070: 39 61 00 18 addi r11,r1,24 ffc25074: 7f c3 f3 78 mr r3,r30 ffc25078: 48 02 f4 90 b ffc54508 <_restgpr_30_x> =============================================================================== ffc31d68 : int fcntl( int fd, int cmd, ... ) { ffc31d68: 94 21 ff c0 stwu r1,-64(r1) int ret; va_list ap; va_start( ap, cmd ); ffc31d6c: 39 20 00 02 li r9,2 int fcntl( int fd, int cmd, ... ) { ffc31d70: 7c 08 02 a6 mflr r0 int ret; va_list ap; va_start( ap, cmd ); ffc31d74: 99 21 00 08 stb r9,8(r1) ffc31d78: 39 21 00 48 addi r9,r1,72 ffc31d7c: 91 21 00 0c stw r9,12(r1) ffc31d80: 39 21 00 10 addi r9,r1,16 ffc31d84: 91 21 00 10 stw r9,16(r1) int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); ffc31d88: 3d 20 00 00 lis r9,0 ffc31d8c: 81 29 27 b8 lwz r9,10168(r9) int fcntl( int fd, int cmd, ... ) { ffc31d90: 90 01 00 44 stw r0,68(r1) int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); ffc31d94: 7f 83 48 40 cmplw cr7,r3,r9 int fcntl( int fd, int cmd, ... ) { ffc31d98: bf 61 00 2c stmw r27,44(r1) ffc31d9c: 90 a1 00 18 stw r5,24(r1) ffc31da0: 90 c1 00 1c stw r6,28(r1) ffc31da4: 90 e1 00 20 stw r7,32(r1) int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); ffc31da8: 41 bc 00 08 blt+ cr7,ffc31db0 ffc31dac: 48 00 00 20 b ffc31dcc iop = rtems_libio_iop( fd ); ffc31db0: 3d 20 00 00 lis r9,0 ffc31db4: 1c 63 00 38 mulli r3,r3,56 ffc31db8: 83 c9 28 68 lwz r30,10344(r9) ffc31dbc: 7f de 1a 14 add r30,r30,r3 rtems_libio_check_is_open(iop); ffc31dc0: 80 7e 00 10 lwz r3,16(r30) ffc31dc4: 70 69 01 00 andi. r9,r3,256 ffc31dc8: 40 a2 00 10 bne+ ffc31dd8 ffc31dcc: 4b ff 02 1d bl ffc21fe8 <__errno> ffc31dd0: 39 20 00 09 li r9,9 ffc31dd4: 48 00 01 d4 b ffc31fa8 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { ffc31dd8: 2b 84 00 09 cmplwi cr7,r4,9 ffc31ddc: 7c 9c 23 78 mr r28,r4 ffc31de0: 41 9d 01 c0 bgt- cr7,ffc31fa0 ffc31de4: 3d 20 ff c4 lis r9,-60 ffc31de8: 39 29 84 f8 addi r9,r9,-31496 ffc31dec: 54 8a 10 3a rlwinm r10,r4,2,0,29 ffc31df0: 7d 49 50 2e lwzx r10,r9,r10 ffc31df4: 7d 2a 4a 14 add r9,r10,r9 ffc31df8: 7d 29 03 a6 mtctr r9 ffc31dfc: 4e 80 04 20 bctr case F_DUPFD: /* dup */ fd2 = va_arg( ap, int ); ffc31e00: 89 21 00 08 lbz r9,8(r1) ffc31e04: 2b 89 00 07 cmplwi cr7,r9,7 ffc31e08: 41 9d 00 10 bgt- cr7,ffc31e18 <== NEVER TAKEN ffc31e0c: 39 29 00 01 addi r9,r9,1 ffc31e10: 99 21 00 08 stb r9,8(r1) ffc31e14: 48 00 00 10 b ffc31e24 ffc31e18: 81 21 00 0c lwz r9,12(r1) <== NOT EXECUTED ffc31e1c: 39 29 00 04 addi r9,r9,4 <== NOT EXECUTED ffc31e20: 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(); ffc31e24: 4b fd 71 11 bl ffc08f34 if (diop != NULL) { ffc31e28: 7c 7d 1b 79 mr. r29,r3 ffc31e2c: 41 82 01 b4 beq- ffc31fe0 int oflag = rtems_libio_to_fcntl_flags( iop->flags ); ffc31e30: 80 7e 00 10 lwz r3,16(r30) ffc31e34: 4b fd 70 b5 bl ffc08ee8 oflag &= ~O_CREAT; diop->flags |= rtems_libio_fcntl_flags( oflag ); ffc31e38: 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; ffc31e3c: 54 7f 05 ea rlwinm r31,r3,0,23,21 diop->flags |= rtems_libio_fcntl_flags( oflag ); ffc31e40: 7f e3 fb 78 mr r3,r31 ffc31e44: 4b fd 70 61 bl ffc08ea4 ffc31e48: 7c 63 db 78 or r3,r3,r27 ffc31e4c: 90 7d 00 10 stw r3,16(r29) int cmd, int arg ) { return fcntl( fd, cmd, arg ); } ffc31e50: 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 ); ffc31e54: 81 23 00 0c lwz r9,12(r3) ffc31e58: 81 29 00 00 lwz r9,0(r9) ffc31e5c: 7d 29 03 a6 mtctr r9 ffc31e60: 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 ); ffc31e64: 38 9e 00 14 addi r4,r30,20 ffc31e68: 38 7d 00 14 addi r3,r29,20 ffc31e6c: 4b fe 5c 4d bl ffc17ab8 int cmd, int arg ) { return fcntl( fd, cmd, arg ); } ffc31e70: 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 ); ffc31e74: 81 23 00 0c lwz r9,12(r3) ffc31e78: 81 29 00 04 lwz r9,4(r9) ffc31e7c: 7d 29 03 a6 mtctr r9 ffc31e80: 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 ); ffc31e84: 81 3d 00 24 lwz r9,36(r29) ffc31e88: 7f e5 fb 78 mr r5,r31 ffc31e8c: 81 29 00 00 lwz r9,0(r9) ffc31e90: 7f a3 eb 78 mr r3,r29 ffc31e94: 38 80 00 00 li r4,0 ffc31e98: 38 c0 00 00 li r6,0 ffc31e9c: 7d 29 03 a6 mtctr r9 ffc31ea0: 4e 80 04 21 bctrl if ( rv == 0 ) { ffc31ea4: 7c 7f 1b 79 mr. r31,r3 ffc31ea8: 40 82 00 24 bne- ffc31ecc <== NEVER TAKEN rv = diop - rtems_libio_iops; ffc31eac: 3d 20 00 00 lis r9,0 ffc31eb0: 83 e9 28 68 lwz r31,10344(r9) ffc31eb4: 3d 20 b6 db lis r9,-18725 ffc31eb8: 61 29 6d b7 ori r9,r9,28087 ffc31ebc: 7f ff e8 50 subf r31,r31,r29 ffc31ec0: 7f ff 1e 70 srawi r31,r31,3 ffc31ec4: 7f ff 49 d6 mullw r31,r31,r9 ffc31ec8: 48 00 00 e8 b ffc31fb0 } else { rtems_libio_free( diop ); ffc31ecc: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED ffc31ed0: 4b fd 70 d5 bl ffc08fa4 <== NOT EXECUTED ffc31ed4: 48 00 00 dc b ffc31fb0 <== 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); ffc31ed8: 54 7f af fe rlwinm r31,r3,21,31,31 ffc31edc: 48 00 00 dc b ffc31fb8 * 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 ) ) ffc31ee0: 89 41 00 08 lbz r10,8(r1) ffc31ee4: 2b 8a 00 07 cmplwi cr7,r10,7 ffc31ee8: 41 9d 00 1c bgt- cr7,ffc31f04 <== NEVER TAKEN ffc31eec: 81 21 00 10 lwz r9,16(r1) ffc31ef0: 55 48 10 3a rlwinm r8,r10,2,0,29 ffc31ef4: 39 4a 00 01 addi r10,r10,1 ffc31ef8: 7d 29 42 14 add r9,r9,r8 ffc31efc: 99 41 00 08 stb r10,8(r1) ffc31f00: 48 00 00 10 b ffc31f10 ffc31f04: 81 21 00 0c lwz r9,12(r1) <== NOT EXECUTED ffc31f08: 39 49 00 04 addi r10,r9,4 <== NOT EXECUTED ffc31f0c: 91 41 00 0c stw r10,12(r1) <== NOT EXECUTED ffc31f10: 81 29 00 00 lwz r9,0(r9) ffc31f14: 2f 89 00 00 cmpwi cr7,r9,0 ffc31f18: 41 9e 00 0c beq- cr7,ffc31f24 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; ffc31f1c: 60 63 08 00 ori r3,r3,2048 ffc31f20: 48 00 00 08 b ffc31f28 else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; ffc31f24: 54 63 05 66 rlwinm r3,r3,0,21,19 ffc31f28: 90 7e 00 10 stw r3,16(r30) ffc31f2c: 48 00 00 60 b ffc31f8c break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); ffc31f30: 4b fd 6f b9 bl ffc08ee8 ffc31f34: 7c 7f 1b 78 mr r31,r3 ffc31f38: 48 00 00 78 b ffc31fb0 break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); ffc31f3c: 89 41 00 08 lbz r10,8(r1) ffc31f40: 2b 8a 00 07 cmplwi cr7,r10,7 ffc31f44: 41 9d 00 1c bgt- cr7,ffc31f60 <== NEVER TAKEN ffc31f48: 81 21 00 10 lwz r9,16(r1) ffc31f4c: 55 48 10 3a rlwinm r8,r10,2,0,29 ffc31f50: 39 4a 00 01 addi r10,r10,1 ffc31f54: 7d 29 42 14 add r9,r9,r8 ffc31f58: 99 41 00 08 stb r10,8(r1) ffc31f5c: 48 00 00 10 b ffc31f6c ffc31f60: 81 21 00 0c lwz r9,12(r1) <== NOT EXECUTED ffc31f64: 39 49 00 04 addi r10,r9,4 <== NOT EXECUTED ffc31f68: 91 41 00 0c stw r10,12(r1) <== NOT EXECUTED ffc31f6c: 80 69 00 00 lwz r3,0(r9) ffc31f70: 4b fd 6f 35 bl ffc08ea4 /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); ffc31f74: 81 3e 00 10 lwz r9,16(r30) ffc31f78: 70 63 02 01 andi. r3,r3,513 ffc31f7c: 39 40 fd fe li r10,-514 ffc31f80: 7d 49 48 38 and r9,r10,r9 ffc31f84: 7c 69 4b 78 or r9,r3,r9 ffc31f88: 91 3e 00 10 stw r9,16(r30) { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; ffc31f8c: 3b e0 00 00 li r31,0 ffc31f90: 48 00 00 28 b ffc31fb8 errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; ffc31f94: 4b ff 00 55 bl ffc21fe8 <__errno> ffc31f98: 39 20 00 86 li r9,134 ffc31f9c: 48 00 00 0c b ffc31fa8 ret = -1; break; default: errno = EINVAL; ffc31fa0: 4b ff 00 49 bl ffc21fe8 <__errno> ffc31fa4: 39 20 00 16 li r9,22 ffc31fa8: 91 23 00 00 stw r9,0(r3) ffc31fac: 48 00 00 34 b ffc31fe0 /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { ffc31fb0: 2f 9f 00 00 cmpwi cr7,r31,0 ffc31fb4: 41 9c 00 30 blt- cr7,ffc31fe4 <== NEVER TAKEN int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); ffc31fb8: 81 3e 00 24 lwz r9,36(r30) ffc31fbc: 7f c3 f3 78 mr r3,r30 ffc31fc0: 7f 84 e3 78 mr r4,r28 ffc31fc4: 81 29 00 28 lwz r9,40(r9) ffc31fc8: 7d 29 03 a6 mtctr r9 ffc31fcc: 4e 80 04 21 bctrl if (err) { ffc31fd0: 7c 7e 1b 79 mr. r30,r3 ffc31fd4: 41 a2 00 10 beq+ ffc31fe4 <== ALWAYS TAKEN errno = err; ffc31fd8: 4b ff 00 11 bl ffc21fe8 <__errno> <== NOT EXECUTED ffc31fdc: 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); ffc31fe0: 3b e0 ff ff li r31,-1 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } ffc31fe4: 39 61 00 40 addi r11,r1,64 ffc31fe8: 7f e3 fb 78 mr r3,r31 ffc31fec: 4b fc f5 70 b ffc0155c <_restgpr_27_x> =============================================================================== ffc0eadc : int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { ffc0eadc: 94 21 ff d0 stwu r1,-48(r1) ffc0eae0: 7c 08 02 a6 mflr r0 ffc0eae4: 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) { ffc0eae8: 3f e0 00 00 lis r31,0 int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { ffc0eaec: 7c 7d 1b 78 mr r29,r3 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { ffc0eaf0: 81 3f 2a 1c lwz r9,10780(r31) int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { ffc0eaf4: 7c 9c 23 78 mr r28,r4 ffc0eaf8: 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) { ffc0eafc: 3b df 2a 1c addi r30,r31,10780 ffc0eb00: 2f 89 00 00 cmpwi cr7,r9,0 ffc0eb04: 41 9e 00 24 beq- cr7,ffc0eb28 rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); ffc0eb08: 3d 20 00 00 lis r9,0 ffc0eb0c: 80 69 2a 1c lwz r3,10780(r9) ffc0eb10: 38 80 00 00 li r4,0 ffc0eb14: 38 a0 00 00 li r5,0 ffc0eb18: 4b ff b4 4d bl ffc09f64 } if (sc == RTEMS_SUCCESSFUL) { ffc0eb1c: 2f 83 00 00 cmpwi cr7,r3,0 ffc0eb20: 41 be 03 b0 beq+ cr7,ffc0eed0 <== ALWAYS TAKEN ffc0eb24: 48 00 00 5c b ffc0eb80 <== NOT EXECUTED */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); ffc0eb28: 3d 20 00 00 lis r9,0 ffc0eb2c: 80 69 28 30 lwz r3,10288(r9) ffc0eb30: 38 80 00 00 li r4,0 ffc0eb34: 38 a0 00 00 li r5,0 ffc0eb38: 4b ff b4 2d bl ffc09f64 rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { ffc0eb3c: 81 3f 2a 1c lwz r9,10780(r31) free(pipe); } static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; ffc0eb40: 3b e0 00 00 li r31,0 if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { ffc0eb44: 2f 89 00 00 cmpwi cr7,r9,0 ffc0eb48: 40 be 00 24 bne+ cr7,ffc0eb6c <== NEVER TAKEN sc = rtems_semaphore_create( ffc0eb4c: 3c 60 50 49 lis r3,20553 ffc0eb50: 60 63 50 45 ori r3,r3,20549 ffc0eb54: 38 80 00 01 li r4,1 ffc0eb58: 38 a0 00 54 li r5,84 ffc0eb5c: 38 c0 00 00 li r6,0 ffc0eb60: 7f c7 f3 78 mr r7,r30 ffc0eb64: 4b ff b1 7d bl ffc09ce0 ffc0eb68: 7c 7f 1b 78 mr r31,r3 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); ffc0eb6c: 3d 20 00 00 lis r9,0 ffc0eb70: 80 69 28 30 lwz r3,10288(r9) ffc0eb74: 4b ff b5 15 bl ffc0a088 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { ffc0eb78: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0eb7c: 41 be ff 8c beq- cr7,ffc0eb08 } if (sc == RTEMS_SUCCESSFUL) { return 0; } else { return -ENOMEM; ffc0eb80: 3b c0 ff f4 li r30,-12 ffc0eb84: 48 00 03 70 b ffc0eef4 { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); ffc0eb88: 38 60 00 34 li r3,52 ffc0eb8c: 4b ff 6f 09 bl ffc05a94 if (pipe == NULL) ffc0eb90: 7c 7f 1b 79 mr. r31,r3 ffc0eb94: 41 82 03 4c beq- ffc0eee0 <== NEVER TAKEN return err; memset(pipe, 0, sizeof(pipe_control_t)); ffc0eb98: 38 80 00 00 li r4,0 ffc0eb9c: 38 a0 00 34 li r5,52 ffc0eba0: 48 00 4d 8d bl ffc1392c pipe->Size = PIPE_BUF; ffc0eba4: 39 20 02 00 li r9,512 ffc0eba8: 91 3f 00 04 stw r9,4(r31) pipe->Buffer = malloc(pipe->Size); ffc0ebac: 38 60 02 00 li r3,512 ffc0ebb0: 4b ff 6e e5 bl ffc05a94 if (! pipe->Buffer) ffc0ebb4: 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); ffc0ebb8: 90 7f 00 00 stw r3,0(r31) if (! pipe->Buffer) ffc0ebbc: 41 9e 00 ec beq- cr7,ffc0eca8 <== NEVER TAKEN goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), ffc0ebc0: 3f c0 00 00 lis r30,0 ffc0ebc4: 88 7e 22 14 lbz r3,8724(r30) if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( ffc0ebc8: 38 80 00 00 li r4,0 ffc0ebcc: 38 a0 00 00 li r5,0 ffc0ebd0: 64 63 50 49 oris r3,r3,20553 ffc0ebd4: 60 63 72 00 ori r3,r3,29184 ffc0ebd8: 38 df 00 2c addi r6,r31,44 ffc0ebdc: 48 00 18 25 bl ffc10400 ffc0ebe0: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ebe4: 40 9e 00 bc bne- cr7,ffc0eca0 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), ffc0ebe8: 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( ffc0ebec: 38 80 00 00 li r4,0 ffc0ebf0: 38 a0 00 00 li r5,0 ffc0ebf4: 64 63 50 49 oris r3,r3,20553 ffc0ebf8: 60 63 77 00 ori r3,r3,30464 ffc0ebfc: 38 df 00 30 addi r6,r31,48 ffc0ec00: 48 00 18 01 bl ffc10400 ffc0ec04: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ec08: 40 9e 00 90 bne- cr7,ffc0ec98 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, ffc0ec0c: 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( ffc0ec10: 38 80 00 01 li r4,1 ffc0ec14: 38 a0 00 10 li r5,16 ffc0ec18: 64 63 50 49 oris r3,r3,20553 ffc0ec1c: 60 63 73 00 ori r3,r3,29440 ffc0ec20: 38 c0 00 00 li r6,0 ffc0ec24: 38 ff 00 28 addi r7,r31,40 ffc0ec28: 4b ff b0 b9 bl ffc09ce0 ffc0ec2c: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ec30: 40 9e 00 60 bne- cr7,ffc0ec90 RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get ( Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) ffc0ec34: 3f 60 00 00 lis r27,0 ffc0ec38: 80 9f 00 2c lwz r4,44(r31) ffc0ec3c: 3b 7b 35 9c addi r27,r27,13724 ffc0ec40: 38 a1 00 08 addi r5,r1,8 ffc0ec44: 7f 63 db 78 mr r3,r27 ffc0ec48: 4b ff cd e9 bl ffc0ba30 <_Objects_Get> static void pipe_interruptible(pipe_control_t *pipe) { Objects_Locations location; _Barrier_Get(pipe->readBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; ffc0ec4c: 81 23 00 4c lwz r9,76(r3) ffc0ec50: 65 29 10 00 oris r9,r9,4096 ffc0ec54: 91 23 00 4c stw r9,76(r3) _Thread_Enable_dispatch(); ffc0ec58: 4b ff dc 2d bl ffc0c884 <_Thread_Enable_dispatch> ffc0ec5c: 80 9f 00 30 lwz r4,48(r31) ffc0ec60: 38 a1 00 08 addi r5,r1,8 ffc0ec64: 7f 63 db 78 mr r3,r27 ffc0ec68: 4b ff cd c9 bl ffc0ba30 <_Objects_Get> _Barrier_Get(pipe->writeBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; ffc0ec6c: 81 23 00 4c lwz r9,76(r3) ffc0ec70: 65 29 10 00 oris r9,r9,4096 ffc0ec74: 91 23 00 4c stw r9,76(r3) _Thread_Enable_dispatch(); ffc0ec78: 4b ff dc 0d bl ffc0c884 <_Thread_Enable_dispatch> #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') ffc0ec7c: 89 3e 22 14 lbz r9,8724(r30) ffc0ec80: 2f 89 00 7a cmpwi cr7,r9,122 ffc0ec84: 40 be 02 64 bne+ cr7,ffc0eee8 c = 'a'; ffc0ec88: 39 20 00 61 li r9,97 ffc0ec8c: 48 00 02 60 b ffc0eeec return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); ffc0ec90: 80 7f 00 30 lwz r3,48(r31) ffc0ec94: 48 00 18 39 bl ffc104cc err_wbar: rtems_barrier_delete(pipe->readBarrier); ffc0ec98: 80 7f 00 2c lwz r3,44(r31) ffc0ec9c: 48 00 18 31 bl ffc104cc err_rbar: free(pipe->Buffer); ffc0eca0: 80 7f 00 00 lwz r3,0(r31) ffc0eca4: 4b ff 69 29 bl ffc055cc err_buf: free(pipe); ffc0eca8: 7f e3 fb 78 mr r3,r31 ffc0ecac: 4b ff 69 21 bl ffc055cc ffc0ecb0: 48 00 02 30 b ffc0eee0 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) ffc0ecb4: 80 7f 00 28 lwz r3,40(r31) ffc0ecb8: 38 80 00 00 li r4,0 ffc0ecbc: 38 a0 00 00 li r5,0 ffc0ecc0: 4b ff b2 a5 bl ffc09f64 err = -EINTR; ffc0ecc4: 3b c0 ff fc li r30,-4 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) ffc0ecc8: 2f 83 00 00 cmpwi cr7,r3,0 ffc0eccc: 40 9e 00 08 bne- cr7,ffc0ecd4 <== NEVER TAKEN ffc0ecd0: 3b c0 00 00 li r30,0 err = -EINTR; if (*pipep == NULL) { ffc0ecd4: 81 3d 00 00 lwz r9,0(r29) ffc0ecd8: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ecdc: 40 be 00 1c bne+ cr7,ffc0ecf8 if (err) ffc0ece0: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0ece4: 41 be 00 10 beq+ cr7,ffc0ecf4 <== ALWAYS TAKEN pipe_free(pipe); ffc0ece8: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc0ecec: 4b ff fc e5 bl ffc0e9d0 <== NOT EXECUTED ffc0ecf0: 48 00 00 08 b ffc0ecf8 <== NOT EXECUTED else *pipep = pipe; ffc0ecf4: 93 fd 00 00 stw r31,0(r29) #ifdef RTEMS_DEBUG rtems_status_code sc = RTEMS_SUCCESSFUL; sc = #endif rtems_semaphore_release(pipe_semaphore); ffc0ecf8: 3d 20 00 00 lis r9,0 ffc0ecfc: 80 69 2a 1c lwz r3,10780(r9) ffc0ed00: 4b ff b3 89 bl ffc0a088 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) ffc0ed04: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0ed08: 40 9e 01 ec bne- cr7,ffc0eef4 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { ffc0ed0c: 81 3c 00 10 lwz r9,16(r28) int err; err = pipe_new(pipep); if (err) return err; pipe = *pipep; ffc0ed10: 83 fd 00 00 lwz r31,0(r29) switch (LIBIO_ACCMODE(iop)) { ffc0ed14: 55 29 07 7c rlwinm r9,r9,0,29,30 ffc0ed18: 2f 89 00 04 cmpwi cr7,r9,4 ffc0ed1c: 41 9e 00 a0 beq- cr7,ffc0edbc ffc0ed20: 2f 89 00 06 cmpwi cr7,r9,6 ffc0ed24: 41 9e 01 34 beq- cr7,ffc0ee58 ffc0ed28: 2f 89 00 02 cmpwi cr7,r9,2 ffc0ed2c: 40 be 01 84 bne+ cr7,ffc0eeb0 <== NEVER TAKEN case LIBIO_FLAGS_READ: pipe->readerCounter ++; ffc0ed30: 81 3f 00 20 lwz r9,32(r31) ffc0ed34: 39 29 00 01 addi r9,r9,1 ffc0ed38: 91 3f 00 20 stw r9,32(r31) if (pipe->Readers ++ == 0) ffc0ed3c: 81 3f 00 10 lwz r9,16(r31) ffc0ed40: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ed44: 39 49 00 01 addi r10,r9,1 ffc0ed48: 91 5f 00 10 stw r10,16(r31) ffc0ed4c: 40 be 00 10 bne+ cr7,ffc0ed5c <== NEVER TAKEN PIPE_WAKEUPWRITERS(pipe); ffc0ed50: 80 7f 00 30 lwz r3,48(r31) ffc0ed54: 38 81 00 0c addi r4,r1,12 ffc0ed58: 48 00 18 15 bl ffc1056c if (pipe->Writers == 0) { ffc0ed5c: 81 3f 00 14 lwz r9,20(r31) ffc0ed60: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ed64: 40 9e 01 4c bne- cr7,ffc0eeb0 /* Not an error */ if (LIBIO_NODELAY(iop)) ffc0ed68: 81 3c 00 10 lwz r9,16(r28) ffc0ed6c: 71 2a 00 01 andi. r10,r9,1 ffc0ed70: 40 82 01 40 bne- ffc0eeb0 break; prevCounter = pipe->writerCounter; ffc0ed74: 83 7f 00 24 lwz r27,36(r31) err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); ffc0ed78: 80 7f 00 28 lwz r3,40(r31) ffc0ed7c: 4b ff b3 0d bl ffc0a088 if (! PIPE_READWAIT(pipe)) ffc0ed80: 80 7f 00 2c lwz r3,44(r31) ffc0ed84: 38 80 00 00 li r4,0 ffc0ed88: 48 00 18 55 bl ffc105dc ffc0ed8c: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ed90: 40 9e 01 2c bne- cr7,ffc0eebc <== NEVER TAKEN goto out_error; if (! PIPE_LOCK(pipe)) ffc0ed94: 80 7f 00 28 lwz r3,40(r31) ffc0ed98: 38 80 00 00 li r4,0 ffc0ed9c: 38 a0 00 00 li r5,0 ffc0eda0: 4b ff b1 c5 bl ffc09f64 ffc0eda4: 2f 83 00 00 cmpwi cr7,r3,0 ffc0eda8: 40 9e 01 14 bne- cr7,ffc0eebc <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->writerCounter); ffc0edac: 81 3f 00 24 lwz r9,36(r31) ffc0edb0: 7f 9b 48 00 cmpw cr7,r27,r9 ffc0edb4: 41 9e ff c4 beq+ cr7,ffc0ed78 <== NEVER TAKEN ffc0edb8: 48 00 00 f8 b ffc0eeb0 } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; ffc0edbc: 81 3f 00 24 lwz r9,36(r31) ffc0edc0: 39 29 00 01 addi r9,r9,1 ffc0edc4: 91 3f 00 24 stw r9,36(r31) if (pipe->Writers ++ == 0) ffc0edc8: 81 3f 00 14 lwz r9,20(r31) ffc0edcc: 2f 89 00 00 cmpwi cr7,r9,0 ffc0edd0: 39 49 00 01 addi r10,r9,1 ffc0edd4: 91 5f 00 14 stw r10,20(r31) ffc0edd8: 40 be 00 10 bne+ cr7,ffc0ede8 <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); ffc0eddc: 80 7f 00 2c lwz r3,44(r31) ffc0ede0: 38 81 00 0c addi r4,r1,12 ffc0ede4: 48 00 17 89 bl ffc1056c if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { ffc0ede8: 81 3f 00 10 lwz r9,16(r31) ffc0edec: 2f 89 00 00 cmpwi cr7,r9,0 ffc0edf0: 40 9e 00 c0 bne- cr7,ffc0eeb0 ffc0edf4: 81 3c 00 10 lwz r9,16(r28) ffc0edf8: 71 2a 00 01 andi. r10,r9,1 ffc0edfc: 41 a2 00 14 beq+ ffc0ee10 PIPE_UNLOCK(pipe); ffc0ee00: 80 7f 00 28 lwz r3,40(r31) err = -ENXIO; ffc0ee04: 3b c0 ff fa li r30,-6 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { PIPE_UNLOCK(pipe); ffc0ee08: 4b ff b2 81 bl ffc0a088 err = -ENXIO; goto out_error; ffc0ee0c: 48 00 00 b4 b ffc0eec0 } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; ffc0ee10: 83 7f 00 20 lwz r27,32(r31) err = -EINTR; do { PIPE_UNLOCK(pipe); ffc0ee14: 80 7f 00 28 lwz r3,40(r31) ffc0ee18: 4b ff b2 71 bl ffc0a088 if (! PIPE_WRITEWAIT(pipe)) ffc0ee1c: 80 7f 00 30 lwz r3,48(r31) ffc0ee20: 38 80 00 00 li r4,0 ffc0ee24: 48 00 17 b9 bl ffc105dc ffc0ee28: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ee2c: 40 9e 00 90 bne- cr7,ffc0eebc <== NEVER TAKEN goto out_error; if (! PIPE_LOCK(pipe)) ffc0ee30: 80 7f 00 28 lwz r3,40(r31) ffc0ee34: 38 80 00 00 li r4,0 ffc0ee38: 38 a0 00 00 li r5,0 ffc0ee3c: 4b ff b1 29 bl ffc09f64 ffc0ee40: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ee44: 40 9e 00 78 bne- cr7,ffc0eebc <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->readerCounter); ffc0ee48: 81 3f 00 20 lwz r9,32(r31) ffc0ee4c: 7f 9b 48 00 cmpw cr7,r27,r9 ffc0ee50: 41 9e ff c4 beq+ cr7,ffc0ee14 <== NEVER TAKEN ffc0ee54: 48 00 00 5c b ffc0eeb0 } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; ffc0ee58: 81 3f 00 20 lwz r9,32(r31) ffc0ee5c: 39 29 00 01 addi r9,r9,1 ffc0ee60: 91 3f 00 20 stw r9,32(r31) if (pipe->Readers ++ == 0) ffc0ee64: 81 3f 00 10 lwz r9,16(r31) ffc0ee68: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ee6c: 39 49 00 01 addi r10,r9,1 ffc0ee70: 91 5f 00 10 stw r10,16(r31) ffc0ee74: 40 be 00 10 bne+ cr7,ffc0ee84 <== NEVER TAKEN PIPE_WAKEUPWRITERS(pipe); ffc0ee78: 80 7f 00 30 lwz r3,48(r31) ffc0ee7c: 38 81 00 0c addi r4,r1,12 ffc0ee80: 48 00 16 ed bl ffc1056c pipe->writerCounter ++; ffc0ee84: 81 3f 00 24 lwz r9,36(r31) ffc0ee88: 39 29 00 01 addi r9,r9,1 ffc0ee8c: 91 3f 00 24 stw r9,36(r31) if (pipe->Writers ++ == 0) ffc0ee90: 81 3f 00 14 lwz r9,20(r31) ffc0ee94: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ee98: 39 49 00 01 addi r10,r9,1 ffc0ee9c: 91 5f 00 14 stw r10,20(r31) ffc0eea0: 40 be 00 10 bne+ cr7,ffc0eeb0 <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); ffc0eea4: 80 7f 00 2c lwz r3,44(r31) ffc0eea8: 38 81 00 0c addi r4,r1,12 ffc0eeac: 48 00 16 c1 bl ffc1056c break; } PIPE_UNLOCK(pipe); ffc0eeb0: 80 7f 00 28 lwz r3,40(r31) ffc0eeb4: 4b ff b1 d5 bl ffc0a088 return 0; ffc0eeb8: 48 00 00 3c b ffc0eef4 /* Not an error */ if (LIBIO_NODELAY(iop)) break; prevCounter = pipe->writerCounter; err = -EINTR; ffc0eebc: 3b c0 ff fc li r30,-4 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); ffc0eec0: 7f a3 eb 78 mr r3,r29 ffc0eec4: 7f 84 e3 78 mr r4,r28 ffc0eec8: 4b ff fb 59 bl ffc0ea20 return err; ffc0eecc: 48 00 00 28 b ffc0eef4 err = pipe_lock(); if (err) return err; pipe = *pipep; ffc0eed0: 83 fd 00 00 lwz r31,0(r29) if (pipe == NULL) { ffc0eed4: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0eed8: 40 9e fd dc bne+ cr7,ffc0ecb4 ffc0eedc: 4b ff fc ac b ffc0eb88 if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; ffc0eee0: 3b c0 ff f4 li r30,-12 ffc0eee4: 4b ff fe 14 b ffc0ecf8 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') ffc0eee8: 39 29 00 01 addi r9,r9,1 ffc0eeec: 99 3e 22 14 stb r9,8724(r30) ffc0eef0: 4b ff fd c4 b ffc0ecb4 return 0; out_error: pipe_release(pipep, iop); return err; } ffc0eef4: 39 61 00 30 addi r11,r1,48 ffc0eef8: 7f c3 f3 78 mr r3,r30 ffc0eefc: 48 01 1c 14 b ffc20b10 <_restgpr_27_x> =============================================================================== ffc0ace0 : { long return_value; rtems_libio_t *iop; const rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); ffc0ace0: 3d 20 00 00 lis r9,0 */ long fpathconf( int fd, int name ) { ffc0ace4: 94 21 ff f8 stwu r1,-8(r1) ffc0ace8: 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); ffc0acec: 81 29 27 3c lwz r9,10044(r9) */ long fpathconf( int fd, int name ) { ffc0acf0: 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); ffc0acf4: 7f 83 48 40 cmplw cr7,r3,r9 ffc0acf8: 41 bc 00 08 blt+ cr7,ffc0ad00 ffc0acfc: 48 00 00 20 b ffc0ad1c iop = rtems_libio_iop(fd); ffc0ad00: 3d 20 00 00 lis r9,0 ffc0ad04: 81 29 27 ec lwz r9,10220(r9) ffc0ad08: 1c 63 00 38 mulli r3,r3,56 ffc0ad0c: 7c 69 1a 14 add r3,r9,r3 rtems_libio_check_is_open(iop); ffc0ad10: 81 23 00 10 lwz r9,16(r3) ffc0ad14: 71 2a 01 00 andi. r10,r9,256 ffc0ad18: 40 a2 00 10 bne+ ffc0ad28 <== ALWAYS TAKEN ffc0ad1c: 48 00 24 91 bl ffc0d1ac <__errno> ffc0ad20: 39 20 00 09 li r9,9 ffc0ad24: 48 00 00 98 b ffc0adbc * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; switch ( name ) { ffc0ad28: 2b 84 00 0b cmplwi cr7,r4,11 /* * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; ffc0ad2c: 81 23 00 28 lwz r9,40(r3) ffc0ad30: 81 29 00 2c lwz r9,44(r9) switch ( name ) { ffc0ad34: 41 9d 00 80 bgt- cr7,ffc0adb4 ffc0ad38: 3d 40 ff c1 lis r10,-63 ffc0ad3c: 39 4a 3c d0 addi r10,r10,15568 ffc0ad40: 54 84 10 3a rlwinm r4,r4,2,0,29 ffc0ad44: 7d 0a 20 2e lwzx r8,r10,r4 ffc0ad48: 7d 48 52 14 add r10,r8,r10 ffc0ad4c: 7d 49 03 a6 mtctr r10 ffc0ad50: 4e 80 04 20 bctr case _PC_LINK_MAX: return_value = the_limits->link_max; ffc0ad54: 80 69 00 00 lwz r3,0(r9) break; ffc0ad58: 48 00 00 6c b ffc0adc4 case _PC_MAX_CANON: return_value = the_limits->max_canon; ffc0ad5c: 80 69 00 04 lwz r3,4(r9) break; ffc0ad60: 48 00 00 64 b ffc0adc4 case _PC_MAX_INPUT: return_value = the_limits->max_input; ffc0ad64: 80 69 00 08 lwz r3,8(r9) break; ffc0ad68: 48 00 00 5c b ffc0adc4 case _PC_NAME_MAX: return_value = the_limits->name_max; ffc0ad6c: 80 69 00 0c lwz r3,12(r9) break; ffc0ad70: 48 00 00 54 b ffc0adc4 case _PC_PATH_MAX: return_value = the_limits->path_max; ffc0ad74: 80 69 00 10 lwz r3,16(r9) break; ffc0ad78: 48 00 00 4c b ffc0adc4 case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; ffc0ad7c: 80 69 00 14 lwz r3,20(r9) break; ffc0ad80: 48 00 00 44 b ffc0adc4 case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; ffc0ad84: 80 69 00 1c lwz r3,28(r9) break; ffc0ad88: 48 00 00 3c b ffc0adc4 case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; ffc0ad8c: 80 69 00 20 lwz r3,32(r9) break; ffc0ad90: 48 00 00 34 b ffc0adc4 case _PC_VDISABLE: return_value = the_limits->posix_vdisable; ffc0ad94: 80 69 00 2c lwz r3,44(r9) break; ffc0ad98: 48 00 00 2c b ffc0adc4 case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; ffc0ad9c: 80 69 00 18 lwz r3,24(r9) break; ffc0ada0: 48 00 00 24 b ffc0adc4 case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; ffc0ada4: 80 69 00 24 lwz r3,36(r9) break; ffc0ada8: 48 00 00 1c b ffc0adc4 case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; ffc0adac: 80 69 00 28 lwz r3,40(r9) break; ffc0adb0: 48 00 00 14 b ffc0adc4 default: rtems_set_errno_and_return_minus_one( EINVAL ); ffc0adb4: 48 00 23 f9 bl ffc0d1ac <__errno> ffc0adb8: 39 20 00 16 li r9,22 ffc0adbc: 91 23 00 00 stw r9,0(r3) ffc0adc0: 38 60 ff ff li r3,-1 break; } return return_value; } ffc0adc4: 80 01 00 0c lwz r0,12(r1) ffc0adc8: 38 21 00 08 addi r1,r1,8 ffc0adcc: 7c 08 03 a6 mtlr r0 ffc0add0: 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 98 addi r9,r9,11160 #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 90 lwz r9,10384(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 28 08 lwz r9,10248(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 90 lwz r3,10128(r30) ffc045e4: 7f e4 fb 78 mr r4,r31 ffc045e8: 48 00 60 95 bl ffc0a67c <_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 90 lwz r9,10128(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 d0 90 addi r3,r3,-12144 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> =============================================================================== ffc1b178 : int fstat( int fd, struct stat *sbuf ) { ffc1b178: 94 21 ff f0 stwu r1,-16(r1) ffc1b17c: 7c 08 02 a6 mflr r0 ffc1b180: bf c1 00 08 stmw r30,8(r1) rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) ffc1b184: 7c 9e 23 79 mr. r30,r4 int fstat( int fd, struct stat *sbuf ) { ffc1b188: 90 01 00 14 stw r0,20(r1) rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) ffc1b18c: 40 a2 00 10 bne+ ffc1b19c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); ffc1b190: 4b ff 54 1d bl ffc105ac <__errno> <== NOT EXECUTED ffc1b194: 39 20 00 0e li r9,14 <== NOT EXECUTED ffc1b198: 48 00 00 38 b ffc1b1d0 <== NOT EXECUTED /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); ffc1b19c: 3d 20 00 00 lis r9,0 ffc1b1a0: 81 29 27 98 lwz r9,10136(r9) ffc1b1a4: 7f 83 48 40 cmplw cr7,r3,r9 ffc1b1a8: 40 9c 00 20 bge- cr7,ffc1b1c8 ffc1b1ac: 3d 20 00 00 lis r9,0 ffc1b1b0: 83 e9 28 4c lwz r31,10316(r9) ffc1b1b4: 1c 63 00 38 mulli r3,r3,56 ffc1b1b8: 7f ff 1a 14 add r31,r31,r3 rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); ffc1b1bc: 81 3f 00 10 lwz r9,16(r31) ffc1b1c0: 71 2a 01 00 andi. r10,r9,256 ffc1b1c4: 40 a2 00 14 bne+ ffc1b1d8 ffc1b1c8: 4b ff 53 e5 bl ffc105ac <__errno> ffc1b1cc: 39 20 00 09 li r9,9 ffc1b1d0: 91 23 00 00 stw r9,0(r3) ffc1b1d4: 48 00 00 3c b ffc1b210 /* * Zero out the stat structure so the various support * versions of stat don't have to. */ memset( sbuf, 0, sizeof(struct stat) ); ffc1b1d8: 7f c3 f3 78 mr r3,r30 ffc1b1dc: 38 80 00 00 li r4,0 ffc1b1e0: 38 a0 00 48 li r5,72 ffc1b1e4: 4b ff 61 c1 bl ffc113a4 return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); ffc1b1e8: 81 3f 00 24 lwz r9,36(r31) } ffc1b1ec: 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 ); ffc1b1f0: 38 7f 00 14 addi r3,r31,20 ffc1b1f4: 81 29 00 18 lwz r9,24(r9) ffc1b1f8: 7f c4 f3 78 mr r4,r30 } ffc1b1fc: 7c 08 03 a6 mtlr r0 ffc1b200: 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 ); ffc1b204: 7d 29 03 a6 mtctr r9 } ffc1b208: 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 ); ffc1b20c: 4e 80 04 20 bctr } ffc1b210: 39 61 00 10 addi r11,r1,16 ffc1b214: 38 60 ff ff li r3,-1 ffc1b218: 4b fe 53 a8 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 e0 addi r10,r9,10464 ffc0412c: 81 29 28 e0 lwz r9,10464(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> =============================================================================== ffc3200c : rtems_filesystem_node_types_t type; /* * Get the file control block structure associated with the file descriptor */ iop = rtems_libio_iop( dd_fd ); ffc3200c: 3d 20 00 00 lis r9,0 int getdents( int dd_fd, char *dd_buf, int dd_len ) { ffc32010: 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 ); ffc32014: 81 29 27 b8 lwz r9,10168(r9) int getdents( int dd_fd, char *dd_buf, int dd_len ) { ffc32018: 7c 2b 0b 78 mr r11,r1 ffc3201c: 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 ); ffc32020: 7f 83 48 40 cmplw cr7,r3,r9 int getdents( int dd_fd, char *dd_buf, int dd_len ) { ffc32024: 4b fc f4 fd bl ffc01520 <_savegpr_31> ffc32028: 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 ); ffc3202c: 3b e0 00 00 li r31,0 ffc32030: 40 9c 00 14 bge- cr7,ffc32044 <== NEVER TAKEN ffc32034: 3d 20 00 00 lis r9,0 ffc32038: 1c 63 00 38 mulli r3,r3,56 ffc3203c: 83 e9 28 68 lwz r31,10344(r9) ffc32040: 7f ff 1a 14 add r31,r31,r3 /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); ffc32044: 38 7f 00 14 addi r3,r31,20 ffc32048: 90 81 00 08 stw r4,8(r1) ffc3204c: 90 a1 00 0c stw r5,12(r1) ffc32050: 4b fd 8d 45 bl ffc0ad94 if ( type != RTEMS_FILESYSTEM_DIRECTORY ) ffc32054: 2f 83 00 00 cmpwi cr7,r3,0 ffc32058: 80 81 00 08 lwz r4,8(r1) ffc3205c: 80 a1 00 0c lwz r5,12(r1) ffc32060: 40 9e 00 28 bne- cr7,ffc32088 /* * 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 ); ffc32064: 81 3f 00 24 lwz r9,36(r31) ffc32068: 7f e3 fb 78 mr r3,r31 } ffc3206c: 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 ); ffc32070: 81 29 00 08 lwz r9,8(r9) } ffc32074: 7c 08 03 a6 mtlr r0 ffc32078: 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 ); ffc3207c: 7d 29 03 a6 mtctr r9 } ffc32080: 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 ); ffc32084: 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 ); ffc32088: 4b fe ff 61 bl ffc21fe8 <__errno> ffc3208c: 39 20 00 14 li r9,20 ffc32090: 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 ); } ffc32094: 39 61 00 18 addi r11,r1,24 ffc32098: 38 60 ff ff li r3,-1 ffc3209c: 4b fc f4 d0 b ffc0156c <_restgpr_31_x> =============================================================================== ffc25628 : void init_etc_passwd_group(void) { FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) ffc25628: 3d 20 00 00 lis r9,0 ffc2562c: 89 49 5d 64 lbz r10,23908(r9) ffc25630: 2f 8a 00 00 cmpwi cr7,r10,0 ffc25634: 4c be 00 20 bnelr+ cr7 /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { ffc25638: 7c 2b 0b 78 mr r11,r1 ffc2563c: 94 21 ff f0 stwu r1,-16(r1) ffc25640: 7c 08 02 a6 mflr r0 static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; mkdir("/etc", 0777); ffc25644: 3c 60 ff c6 lis r3,-58 /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { ffc25648: 48 02 ee 79 bl ffc544c0 <_savegpr_31> FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; ffc2564c: 39 40 00 01 li r10,1 mkdir("/etc", 0777); ffc25650: 38 80 01 ff li r4,511 /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { ffc25654: 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); ffc25658: 38 63 b6 d0 addi r3,r3,-18736 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { ffc2565c: 3f e0 ff c6 lis r31,-58 FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; ffc25660: 99 49 5d 64 stb r10,23908(r9) mkdir("/etc", 0777); /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { ffc25664: 3b ff b6 d5 addi r31,r31,-18731 static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; mkdir("/etc", 0777); ffc25668: 4b fd ed ad bl ffc04414 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { ffc2566c: 3c 80 ff c5 lis r4,-59 ffc25670: 7f e3 fb 78 mr r3,r31 ffc25674: 38 84 78 7c addi r4,r4,30844 ffc25678: 48 01 3b 35 bl ffc391ac ffc2567c: 2f 83 00 00 cmpwi cr7,r3,0 ffc25680: 41 9e 00 08 beq- cr7,ffc25688 ffc25684: 48 00 00 30 b ffc256b4 fclose(fp); } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { ffc25688: 3c 80 ff c5 lis r4,-59 ffc2568c: 7f e3 fb 78 mr r3,r31 ffc25690: 38 84 78 79 addi r4,r4,30841 ffc25694: 48 01 3b 19 bl ffc391ac ffc25698: 7c 7f 1b 79 mr. r31,r3 ffc2569c: 41 82 00 1c beq- ffc256b8 <== NEVER TAKEN fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" ffc256a0: 3c 60 ff c6 lis r3,-58 ffc256a4: 38 63 b6 e1 addi r3,r3,-18719 ffc256a8: 7f e4 fb 78 mr r4,r31 ffc256ac: 48 01 3d 91 bl ffc3943c "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); ffc256b0: 7f e3 fb 78 mr r3,r31 ffc256b4: 48 01 2e e1 bl ffc38594 } /* * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { ffc256b8: 3f e0 ff c6 lis r31,-58 ffc256bc: 3b ff b7 48 addi r31,r31,-18616 ffc256c0: 3c 80 ff c5 lis r4,-59 ffc256c4: 7f e3 fb 78 mr r3,r31 ffc256c8: 38 84 78 7c addi r4,r4,30844 ffc256cc: 48 01 3a e1 bl ffc391ac ffc256d0: 2f 83 00 00 cmpwi cr7,r3,0 ffc256d4: 41 9e 00 08 beq- cr7,ffc256dc ffc256d8: 48 00 00 30 b ffc25708 fclose(fp); } else if ((fp = fopen("/etc/group", "w")) != NULL) { ffc256dc: 3c 80 ff c5 lis r4,-59 ffc256e0: 7f e3 fb 78 mr r3,r31 ffc256e4: 38 84 78 79 addi r4,r4,30841 ffc256e8: 48 01 3a c5 bl ffc391ac ffc256ec: 7c 7f 1b 79 mr. r31,r3 ffc256f0: 41 82 00 2c beq- ffc2571c <== NEVER TAKEN fprintf( fp, "root:x:0:root\n" ffc256f4: 3c 60 ff c6 lis r3,-58 ffc256f8: 38 63 b7 53 addi r3,r3,-18605 ffc256fc: 7f e4 fb 78 mr r4,r31 ffc25700: 48 01 3d 3d bl ffc3943c "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); ffc25704: 7f e3 fb 78 mr r3,r31 } } ffc25708: 80 01 00 14 lwz r0,20(r1) ffc2570c: 83 e1 00 0c lwz r31,12(r1) ffc25710: 7c 08 03 a6 mtlr r0 ffc25714: 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); ffc25718: 48 01 2e 7c b ffc38594 } } ffc2571c: 39 61 00 10 addi r11,r1,16 <== NOT EXECUTED ffc25720: 48 02 ed ec b ffc5450c <_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 e0 lwz r10,10208(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> =============================================================================== ffc1b59c : int killinfo( pid_t pid, int sig, const union sigval *value ) { ffc1b59c: 94 21 ff d8 stwu r1,-40(r1) ffc1b5a0: 7c 08 02 a6 mflr r0 ffc1b5a4: bf 81 00 18 stmw r28,24(r1) ffc1b5a8: 7c 7e 1b 78 mr r30,r3 ffc1b5ac: 7c 9f 23 78 mr r31,r4 ffc1b5b0: 90 01 00 2c stw r0,44(r1) ffc1b5b4: 7c bd 2b 78 mr r29,r5 POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) ffc1b5b8: 4b ff fc 71 bl ffc1b228 ffc1b5bc: 7f 9e 18 00 cmpw cr7,r30,r3 ffc1b5c0: 41 be 00 10 beq+ cr7,ffc1b5d0 rtems_set_errno_and_return_minus_one( ESRCH ); ffc1b5c4: 4b ff 4f e9 bl ffc105ac <__errno> ffc1b5c8: 39 20 00 03 li r9,3 ffc1b5cc: 48 00 02 24 b ffc1b7f0 /* * Validate the signal passed. */ if ( !sig ) ffc1b5d0: 2f 9f 00 00 cmpwi cr7,r31,0 ffc1b5d4: 40 be 00 08 bne+ cr7,ffc1b5dc ffc1b5d8: 48 00 00 10 b ffc1b5e8 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); ffc1b5dc: 3b df ff ff addi r30,r31,-1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) ffc1b5e0: 2b 9e 00 1f cmplwi cr7,r30,31 ffc1b5e4: 40 bd 00 10 ble+ cr7,ffc1b5f4 rtems_set_errno_and_return_minus_one( EINVAL ); ffc1b5e8: 4b ff 4f c5 bl ffc105ac <__errno> ffc1b5ec: 39 20 00 16 li r9,22 ffc1b5f0: 48 00 02 00 b ffc1b7f0 /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) ffc1b5f4: 1d 5f 00 0c mulli r10,r31,12 ffc1b5f8: 3d 20 00 00 lis r9,0 ffc1b5fc: 39 29 32 20 addi r9,r9,12832 ffc1b600: 7d 29 52 14 add r9,r9,r10 ffc1b604: 81 29 00 08 lwz r9,8(r9) ffc1b608: 2f 89 00 01 cmpwi cr7,r9,1 ffc1b60c: 41 9e 02 14 beq- cr7,ffc1b820 /* * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) ffc1b610: 2f 9f 00 08 cmpwi cr7,r31,8 ffc1b614: 41 9e 00 14 beq- cr7,ffc1b628 ffc1b618: 2f 9f 00 04 cmpwi cr7,r31,4 ffc1b61c: 41 9e 00 0c beq- cr7,ffc1b628 ffc1b620: 2f 9f 00 0b cmpwi cr7,r31,11 ffc1b624: 40 be 00 14 bne+ cr7,ffc1b638 return pthread_kill( pthread_self(), sig ); ffc1b628: 48 00 04 45 bl ffc1ba6c ffc1b62c: 7f e4 fb 78 mr r4,r31 ffc1b630: 48 00 03 55 bl ffc1b984 ffc1b634: 48 00 01 f0 b ffc1b824 * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; if ( !value ) { ffc1b638: 2f 9d 00 00 cmpwi cr7,r29,0 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; ffc1b63c: 93 e1 00 08 stw r31,8(r1) static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); ffc1b640: 39 20 00 01 li r9,1 ffc1b644: 7d 3e f0 30 slw r30,r9,r30 siginfo->si_code = SI_USER; ffc1b648: 91 21 00 0c stw r9,12(r1) if ( !value ) { ffc1b64c: 40 be 00 0c bne+ cr7,ffc1b658 siginfo->si_value.sival_int = 0; ffc1b650: 93 a1 00 10 stw r29,16(r1) ffc1b654: 48 00 00 0c b ffc1b660 } else { siginfo->si_value = *value; ffc1b658: 81 3d 00 00 lwz r9,0(r29) ffc1b65c: 91 21 00 10 stw r9,16(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; ffc1b660: 3d 20 00 00 lis r9,0 ffc1b664: 81 49 28 68 lwz r10,10344(r9) ++level; ffc1b668: 39 4a 00 01 addi r10,r10,1 _Thread_Dispatch_disable_level = level; ffc1b66c: 91 49 28 68 stw r10,10344(r9) */ void _POSIX_signals_Manager_Initialization(void); static inline void _POSIX_signals_Add_post_switch_extension(void) { _API_extensions_Add_post_switch( &_POSIX_signals_Post_switch ); ffc1b670: 3c 60 00 00 lis r3,0 ffc1b674: 38 63 22 20 addi r3,r3,8736 ffc1b678: 4b fe db fd bl ffc09274 <_API_extensions_Add_post_switch> /* * Is the currently executing thread interested? If so then it will * get it an execute it as soon as the dispatcher executes. */ the_thread = _Thread_Executing; ffc1b67c: 3d 20 00 00 lis r9,0 ffc1b680: 80 69 31 b0 lwz r3,12720(r9) api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { ffc1b684: 81 43 01 50 lwz r10,336(r3) ffc1b688: 81 4a 00 d0 lwz r10,208(r10) ffc1b68c: 7f c6 50 79 andc. r6,r30,r10 ffc1b690: 40 82 01 04 bne- ffc1b794 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc1b694: 3d 20 00 00 lis r9,0 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); ffc1b698: 3d 00 00 00 lis r8,0 ffc1b69c: 81 29 33 ac lwz r9,13228(r9) ffc1b6a0: 39 08 33 b0 addi r8,r8,13232 ffc1b6a4: 48 00 00 24 b ffc1b6c8 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) ffc1b6a8: 81 49 00 30 lwz r10,48(r9) for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; ffc1b6ac: 80 e9 01 50 lwz r7,336(r9) #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) ffc1b6b0: 7f dc 50 39 and. r28,r30,r10 ffc1b6b4: 40 82 00 dc bne- ffc1b790 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) ffc1b6b8: 81 47 00 d0 lwz r10,208(r7) ffc1b6bc: 7f c3 50 79 andc. r3,r30,r10 ffc1b6c0: 40 82 00 d0 bne- ffc1b790 the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { ffc1b6c4: 81 29 00 00 lwz r9,0(r9) /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); ffc1b6c8: 7f 89 40 00 cmpw cr7,r9,r8 ffc1b6cc: 40 9e ff dc bne+ cr7,ffc1b6a8 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; ffc1b6d0: 3d 20 00 00 lis r9,0 ffc1b6d4: 88 e9 27 84 lbz r7,10116(r9) ffc1b6d8: 3d 00 00 00 lis r8,0 ffc1b6dc: 39 08 2c 7c addi r8,r8,11388 ffc1b6e0: 38 e7 00 01 addi r7,r7,1 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( ffc1b6e4: 39 68 00 08 addi r11,r8,8 * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; ffc1b6e8: 39 20 00 00 li r9,0 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and an API is not configured. */ if ( !_Objects_Information_table[ the_api ] ) ffc1b6ec: 85 48 00 04 lwzu r10,4(r8) ffc1b6f0: 2f 8a 00 00 cmpwi cr7,r10,0 ffc1b6f4: 41 9e 00 8c beq- cr7,ffc1b780 <== NEVER TAKEN continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; ffc1b6f8: 81 4a 00 04 lwz r10,4(r10) #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { ffc1b6fc: 38 c0 00 01 li r6,1 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; ffc1b700: a0 0a 00 10 lhz r0,16(r10) object_table = the_info->local_table; ffc1b704: 83 aa 00 1c lwz r29,28(r10) for ( index = 1 ; index <= maximum ; index++ ) { ffc1b708: 48 00 00 70 b ffc1b778 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( ffc1b70c: 54 ca 10 3a rlwinm r10,r6,2,0,29 maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { the_thread = (Thread_Control *) object_table[ index ]; ffc1b710: 7d 5d 50 2e lwzx r10,r29,r10 if ( !the_thread ) ffc1b714: 2f 8a 00 00 cmpwi cr7,r10,0 ffc1b718: 41 9e 00 5c beq- cr7,ffc1b774 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) ffc1b71c: 80 aa 00 14 lwz r5,20(r10) ffc1b720: 7f 85 38 40 cmplw cr7,r5,r7 ffc1b724: 41 9d 00 50 bgt- cr7,ffc1b774 #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) ffc1b728: 80 8a 01 50 lwz r4,336(r10) ffc1b72c: 80 84 00 d0 lwz r4,208(r4) ffc1b730: 7f dc 20 79 andc. r28,r30,r4 ffc1b734: 41 82 00 40 beq- ffc1b774 * * NOTE: We initialized interested_priority to PRIORITY_MAXIMUM + 1 * so we never have to worry about deferencing a NULL * interested thread. */ if ( the_thread->current_priority < interested_priority ) { ffc1b738: 41 9c 00 34 blt- cr7,ffc1b76c * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( interested && !_States_Is_ready( interested->current_state ) ) { ffc1b73c: 2f 89 00 00 cmpwi cr7,r9,0 ffc1b740: 41 9e 00 34 beq- cr7,ffc1b774 <== NEVER TAKEN ffc1b744: 80 69 00 10 lwz r3,16(r9) ffc1b748: 2f 83 00 00 cmpwi cr7,r3,0 ffc1b74c: 41 9e 00 28 beq- cr7,ffc1b774 /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { ffc1b750: 80 8a 00 10 lwz r4,16(r10) ffc1b754: 2f 84 00 00 cmpwi cr7,r4,0 ffc1b758: 41 9e 00 14 beq- cr7,ffc1b76c continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { ffc1b75c: 74 7c 10 00 andis. r28,r3,4096 ffc1b760: 40 82 00 14 bne- ffc1b774 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { ffc1b764: 74 83 10 00 andis. r3,r4,4096 ffc1b768: 41 82 00 0c beq- ffc1b774 */ if ( interested && !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { ffc1b76c: 7c a7 2b 78 mr r7,r5 ffc1b770: 7d 49 53 78 mr r9,r10 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { ffc1b774: 38 c6 00 01 addi r6,r6,1 ffc1b778: 7f 86 00 40 cmplw cr7,r6,r0 ffc1b77c: 40 9d ff 90 ble+ cr7,ffc1b70c * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { ffc1b780: 7f 88 58 00 cmpw cr7,r8,r11 ffc1b784: 40 be ff 68 bne- cr7,ffc1b6ec } } } } if ( interested ) { ffc1b788: 2f 89 00 00 cmpwi cr7,r9,0 ffc1b78c: 41 9e 00 24 beq- cr7,ffc1b7b0 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) ffc1b790: 7d 23 4b 78 mr r3,r9 /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { ffc1b794: 7f e4 fb 78 mr r4,r31 ffc1b798: 38 a1 00 08 addi r5,r1,8 ffc1b79c: 48 00 00 b9 bl ffc1b854 <_POSIX_signals_Unblock_thread> ffc1b7a0: 2f 83 00 00 cmpwi cr7,r3,0 ffc1b7a4: 41 be 00 0c beq+ cr7,ffc1b7b0 _Thread_Enable_dispatch(); ffc1b7a8: 4b fe fa 81 bl ffc0b228 <_Thread_Enable_dispatch> ffc1b7ac: 48 00 00 74 b ffc1b820 /* * We may have woken up a thread but we definitely need to post the * signal to the process wide information set. */ _POSIX_signals_Set_process_signals( mask ); ffc1b7b0: 7f c3 f3 78 mr r3,r30 ffc1b7b4: 48 00 00 79 bl ffc1b82c <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { ffc1b7b8: 1f ff 00 0c mulli r31,r31,12 ffc1b7bc: 3d 20 00 00 lis r9,0 ffc1b7c0: 39 29 32 20 addi r9,r9,12832 ffc1b7c4: 7d 29 f8 2e lwzx r9,r9,r31 ffc1b7c8: 2f 89 00 02 cmpwi cr7,r9,2 ffc1b7cc: 40 9e ff dc bne+ cr7,ffc1b7a8 psiginfo = (POSIX_signals_Siginfo_node *) ffc1b7d0: 3c 60 00 00 lis r3,0 ffc1b7d4: 38 63 33 a0 addi r3,r3,13216 ffc1b7d8: 4b fe dc 59 bl ffc09430 <_Chain_Get> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { ffc1b7dc: 7c 64 1b 79 mr. r4,r3 ffc1b7e0: 40 a2 00 1c bne+ ffc1b7fc _Thread_Enable_dispatch(); ffc1b7e4: 4b fe fa 45 bl ffc0b228 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); ffc1b7e8: 4b ff 4d c5 bl ffc105ac <__errno> ffc1b7ec: 39 20 00 0b li r9,11 ffc1b7f0: 91 23 00 00 stw r9,0(r3) ffc1b7f4: 38 60 ff ff li r3,-1 ffc1b7f8: 48 00 00 2c b ffc1b824 } psiginfo->Info = *siginfo; ffc1b7fc: 39 24 00 08 addi r9,r4,8 ffc1b800: 39 41 00 08 addi r10,r1,8 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); ffc1b804: 3c 60 00 00 lis r3,0 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; ffc1b808: 7c aa 64 aa lswi r5,r10,12 ffc1b80c: 7c a9 65 aa stswi r5,r9,12 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); ffc1b810: 38 63 34 14 addi r3,r3,13332 ffc1b814: 7c 63 fa 14 add r3,r3,r31 ffc1b818: 4b fe db e9 bl ffc09400 <_Chain_Append> ffc1b81c: 4b ff ff 8c b ffc1b7a8 /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) return 0; ffc1b820: 38 60 00 00 li r3,0 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } ffc1b824: 39 61 00 28 addi r11,r1,40 ffc1b828: 4b fe 4d 90 b ffc005b8 <_restgpr_28_x> =============================================================================== 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 98 addi r9,r9,11160 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 90 lwz r9,10384(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 90 lwz r3,10128(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 cd bl ffc0a624 <_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 90 lwz r3,10128(r29) ffc04980: 81 29 27 8c lwz r9,10124(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 bc 15 bl ffc105ac <__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 28 04 lwz r9,10244(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 28 08 lwz r9,10248(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> =============================================================================== ffc0ebe8 : void *memfile_alloc_block(void) { void *memory; memory = (void *)calloc(1, IMFS_MEMFILE_BYTES_PER_BLOCK); ffc0ebe8: 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) { ffc0ebec: 94 21 ff f8 stwu r1,-8(r1) ffc0ebf0: 7c 08 02 a6 mflr r0 void *memory; memory = (void *)calloc(1, IMFS_MEMFILE_BYTES_PER_BLOCK); ffc0ebf4: 38 60 00 01 li r3,1 ffc0ebf8: 80 89 28 44 lwz r4,10308(r9) * Allocate a block for an in-memory file. */ int memfile_blocks_allocated = 0; void *memfile_alloc_block(void) { ffc0ebfc: 90 01 00 0c stw r0,12(r1) void *memory; memory = (void *)calloc(1, IMFS_MEMFILE_BYTES_PER_BLOCK); ffc0ec00: 4b ff 56 01 bl ffc04200 if ( memory ) ffc0ec04: 2c 03 00 00 cmpwi r3,0 ffc0ec08: 41 82 00 14 beq- ffc0ec1c <== NEVER TAKEN memfile_blocks_allocated++; ffc0ec0c: 3d 20 00 00 lis r9,0 ffc0ec10: 81 49 28 ac lwz r10,10412(r9) ffc0ec14: 39 4a 00 01 addi r10,r10,1 ffc0ec18: 91 49 28 ac stw r10,10412(r9) return memory; } ffc0ec1c: 80 01 00 0c lwz r0,12(r1) ffc0ec20: 38 21 00 08 addi r1,r1,8 ffc0ec24: 7c 08 03 a6 mtlr r0 ffc0ec28: 4e 80 00 20 blr =============================================================================== ffc0f768 : int memfile_ftruncate( rtems_libio_t *iop, off_t length ) { ffc0f768: 7c 2b 0b 78 mr r11,r1 ffc0f76c: 7c 08 02 a6 mflr r0 ffc0f770: 94 21 ff e0 stwu r1,-32(r1) ffc0f774: 90 01 00 24 stw r0,36(r1) ffc0f778: 48 00 b6 45 bl ffc1adbc <_savegpr_31> IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; ffc0f77c: 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 ) ffc0f780: 81 3f 00 50 lwz r9,80(r31) ffc0f784: 7f 89 28 00 cmpw cr7,r9,r5 ffc0f788: 41 9c 00 14 blt- cr7,ffc0f79c <== NEVER TAKEN ffc0f78c: 40 be 00 20 bne+ cr7,ffc0f7ac <== NEVER TAKEN ffc0f790: 81 3f 00 54 lwz r9,84(r31) ffc0f794: 7f 89 30 40 cmplw cr7,r9,r6 ffc0f798: 40 bc 00 14 bge+ cr7,ffc0f7ac return IMFS_memfile_extend( the_jnode, true, length ); ffc0f79c: 7f e3 fb 78 mr r3,r31 ffc0f7a0: 38 80 00 01 li r4,1 ffc0f7a4: 4b ff fb 31 bl ffc0f2d4 ffc0f7a8: 48 00 00 24 b ffc0f7cc /* * 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; ffc0f7ac: 90 bf 00 50 stw r5,80(r31) IMFS_update_atime( the_jnode ); ffc0f7b0: 38 61 00 08 addi r3,r1,8 ffc0f7b4: 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; ffc0f7b8: 90 df 00 54 stw r6,84(r31) IMFS_update_atime( the_jnode ); ffc0f7bc: 4b ff 4e 71 bl ffc0462c ffc0f7c0: 81 21 00 08 lwz r9,8(r1) return 0; ffc0f7c4: 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 ); ffc0f7c8: 91 3f 00 40 stw r9,64(r31) return 0; } ffc0f7cc: 39 61 00 20 addi r11,r1,32 ffc0f7d0: 4b ff 0d f4 b ffc005c4 <_restgpr_31_x> =============================================================================== ffc0f6c0 : the_jnode = iop->pathinfo.node_access; /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) ffc0f6c0: 81 43 00 10 lwz r10,16(r3) mode_t mode ) { IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; ffc0f6c4: 81 23 00 1c lwz r9,28(r3) /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) ffc0f6c8: 71 48 00 04 andi. r8,r10,4 ffc0f6cc: 40 a2 00 10 bne+ ffc0f6dc if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; ffc0f6d0: 39 20 00 00 li r9,0 } ffc0f6d4: 7d 23 4b 78 mr r3,r9 ffc0f6d8: 4e 80 00 20 blr ffc0f6dc: 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)) { ffc0f6e0: 81 4a 00 00 lwz r10,0(r10) ffc0f6e4: 2f 8a 00 05 cmpwi cr7,r10,5 ffc0f6e8: 40 9e ff e8 bne+ cr7,ffc0f6d0 <== ALWAYS TAKEN uint32_t count = the_jnode->info.linearfile.size; ffc0f6ec: 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; ffc0f6f0: 3d 40 ff c2 lis r10,-62 <== NOT EXECUTED ffc0f6f4: 39 4a d3 60 addi r10,r10,-11424 <== 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; ffc0f6f8: 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) ffc0f6fc: 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; ffc0f700: 91 49 00 4c stw r10,76(r9) <== NOT EXECUTED the_jnode->info.file.size = 0; ffc0f704: 39 40 00 00 li r10,0 <== NOT EXECUTED ffc0f708: 39 60 00 00 li r11,0 <== NOT EXECUTED ffc0f70c: 91 49 00 50 stw r10,80(r9) <== NOT EXECUTED the_jnode->info.file.indirect = 0; ffc0f710: 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; ffc0f714: 91 69 00 54 stw r11,84(r9) <== NOT EXECUTED the_jnode->info.file.indirect = 0; ffc0f718: 91 49 00 58 stw r10,88(r9) <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; ffc0f71c: 91 49 00 5c stw r10,92(r9) <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; ffc0f720: 91 49 00 60 stw r10,96(r9) <== NOT EXECUTED if ((count != 0) ffc0f724: 41 9e ff ac beq+ cr7,ffc0f6d0 <== NOT EXECUTED rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { ffc0f728: 94 21 ff f8 stwu r1,-8(r1) <== NOT EXECUTED ffc0f72c: 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)) ffc0f730: 7d 23 4b 78 mr r3,r9 <== NOT EXECUTED ffc0f734: 38 a0 00 00 li r5,0 <== NOT EXECUTED rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { ffc0f738: 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)) ffc0f73c: 38 c0 00 00 li r6,0 <== NOT EXECUTED ffc0f740: 4b ff fd 35 bl ffc0f474 <== NOT EXECUTED return -1; } return 0; ffc0f744: 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)) ffc0f748: 2f 83 ff ff cmpwi cr7,r3,-1 <== NOT EXECUTED ffc0f74c: 40 be 00 08 bne+ cr7,ffc0f754 <== NOT EXECUTED return -1; ffc0f750: 39 20 ff ff li r9,-1 <== NOT EXECUTED } return 0; } ffc0f754: 80 01 00 0c lwz r0,12(r1) <== NOT EXECUTED ffc0f758: 7d 23 4b 78 mr r3,r9 <== NOT EXECUTED ffc0f75c: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc0f760: 38 21 00 08 addi r1,r1,8 <== NOT EXECUTED ffc0f764: 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 86 d1 bl ffc0d20c 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 d0 f8 addi r26,r26,-12040 size_t filesystemtype_size = strlen( filesystemtype ) + 1; ffc04b5c: 7f 23 cb 78 mr r3,r25 ffc04b60: 48 00 d3 11 bl ffc11e70 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 d2 f9 bl ffc11e70 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 d2 e5 bl ffc11e70 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 c6 f1 bl ffc112b0 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 c6 cd bl ffc112b0 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 c6 b5 bl ffc112b0 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 d0 c8 addi r9,r9,-12088 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 48 35 bl ffc09470 <_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 54 lwz r3,10324(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 54 lwz r3,10324(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 54 lwz r3,10324(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 b8 31 bl ffc105ac <__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 54 lwz r3,10324(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 d8 lwz r3,10200(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 d8 lwz r3,10200(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 b7 ad bl ffc105ac <__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 b7 95 bl ffc105ac <__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 8b 95 bl ffc21fe8 <__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> =============================================================================== ffc1845c : msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { ffc1845c: 94 21 ff 30 stwu r1,-208(r1) ffc18460: 7c 08 02 a6 mflr r0 ffc18464: 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; ffc18468: 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) { ffc1846c: 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; ffc18470: 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) { ffc18474: 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; ffc18478: 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) { ffc1847c: 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; ffc18480: 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; ffc18484: 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); ffc18488: 38 80 00 00 li r4,0 ffc1848c: 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) { ffc18490: 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); ffc18494: 38 61 00 68 addi r3,r1,104 dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; ffc18498: 91 21 00 94 stw r9,148(r1) ffc1849c: 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) { ffc184a0: 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; ffc184a4: 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) { ffc184a8: 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; ffc184ac: b3 a1 00 9e sth r29,158(r1) uint16_t date = 0; ffc184b0: 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; ffc184b4: 93 a1 00 88 stw r29,136(r1) dir_pos->sname.ofs = 0; ffc184b8: 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); ffc184bc: 48 00 4a 01 bl ffc1cebc memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); ffc184c0: 38 61 00 08 addi r3,r1,8 ffc184c4: 38 80 00 00 li r4,0 ffc184c8: 38 a0 00 40 li r5,64 ffc184cc: 48 00 49 f1 bl ffc1cebc if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { ffc184d0: 2f 99 01 04 cmpwi cr7,r25,260 ffc184d4: 40 bd 00 10 ble+ cr7,ffc184e4 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(ENAMETOOLONG); ffc184d8: 48 00 3c 11 bl ffc1c0e8 <__errno> <== NOT EXECUTED ffc184dc: 39 20 00 5b li r9,91 <== NOT EXECUTED ffc184e0: 48 00 00 28 b ffc18508 <== NOT EXECUTED } name_type = msdos_long_to_short (name, name_len, ffc184e4: 7f 03 c3 78 mr r3,r24 ffc184e8: 7f 24 cb 78 mr r4,r25 ffc184ec: 38 a1 00 68 addi r5,r1,104 ffc184f0: 38 c0 00 0b li r6,11 ffc184f4: 48 00 04 8d bl ffc18980 MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { ffc184f8: 7c 77 1b 79 mr. r23,r3 ffc184fc: 40 a2 00 18 bne+ ffc18514 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EINVAL); ffc18500: 48 00 3b e9 bl ffc1c0e8 <__errno> <== NOT EXECUTED ffc18504: 39 20 00 16 li r9,22 <== NOT EXECUTED ffc18508: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc1850c: 3b a0 ff ff li r29,-1 <== NOT EXECUTED ffc18510: 48 00 02 dc b ffc187ec <== NOT EXECUTED } /* fill reserved field */ *MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE; ffc18514: 39 20 00 00 li r9,0 /* set up last write date and time */ time_ret = time(NULL); ffc18518: 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; ffc1851c: 99 21 00 74 stb r9,116(r1) /* set up last write date and time */ time_ret = time(NULL); ffc18520: 48 00 87 ed bl ffc20d0c