=============================================================================== 00049800 : int IMFS_chown( const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group ) { 49800: 4e56 ffe8 linkw %fp,#-24 IMFS_jnode_t *jnode; #if defined(RTEMS_POSIX_API) uid_t st_uid; #endif jnode = (IMFS_jnode_t *) loc->node_access; 49804: 206e 0008 moveal %fp@(8),%a0 int IMFS_chown( const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group ) { 49808: 48d7 041c moveml %d2-%d4/%a2,%sp@ IMFS_jnode_t *jnode; #if defined(RTEMS_POSIX_API) uid_t st_uid; #endif jnode = (IMFS_jnode_t *) loc->node_access; 4980c: 2468 0008 moveal %a0@(8),%a2 */ #if defined(RTEMS_POSIX_API) st_uid = geteuid(); if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) 49810: 4284 clrl %d4 int IMFS_chown( const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group ) { 49812: 362e 000e movew %fp@(14),%d3 49816: 342e 0012 movew %fp@(18),%d2 /* * Verify I am the owner of the node or the super user. */ #if defined(RTEMS_POSIX_API) st_uid = geteuid(); 4981a: 4eb9 0004 a1a4 jsr 4a1a4 if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) 49820: 4281 clrl %d1 49822: 3800 movew %d0,%d4 49824: 322a 003a movew %a2@(58),%d1 49828: b284 cmpl %d4,%d1 4982a: 6714 beqs 49840 4982c: 4a40 tstw %d0 4982e: 6710 beqs 49840 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EPERM ); 49830: 4eb9 0004 cf98 jsr 4cf98 <__errno> 49836: 2040 moveal %d0,%a0 49838: 7001 moveq #1,%d0 4983a: 2080 movel %d0,%a0@ 4983c: 70ff moveq #-1,%d0 4983e: 601e bras 4985e #endif jnode->st_uid = owner; 49840: 3543 003a movew %d3,%a2@(58) jnode->st_gid = group; 49844: 3542 003c movew %d2,%a2@(60) IMFS_update_ctime( jnode ); 49848: 42a7 clrl %sp@- 4984a: 486e fff8 pea %fp@(-8) 4984e: 4eb9 0004 2ae8 jsr 42ae8 49854: 256e fff8 0046 movel %fp@(-8),%a2@(70) return 0; 4985a: 508f addql #8,%sp 4985c: 4280 clrl %d0 } 4985e: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 49864: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000448f4 : */ static void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { 448f4: 4e56 ffdc linkw %fp,#-36 448f8: 206e 0008 moveal %fp@(8),%a0 448fc: 48d7 3c7c moveml %d2-%d6/%a2-%a5,%sp@ 44900: 262e 000c movel %fp@(12),%d3 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 )); 44904: 2808 movel %a0,%d4 for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( IMFS_is_directory( the_jnode ) ) IMFS_dump_directory( the_jnode, level + 1 ); 44906: 2c03 movel %d3,%d6 44908: 0684 0000 0052 addil #82,%d4 the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); 4490e: 47f9 0005 0e4a lea 50e4a ,%a3 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 44914: 49f9 0005 0cf6 lea 50cf6 ,%a4 return; } puts(""); 4491a: 4bf9 0005 2640 lea 52640 ,%a5 IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { case IMFS_DIRECTORY: fprintf(stdout, "/" ); 44920: 2a3c 0005 0d74 movel #331124,%d5 for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( IMFS_is_directory( the_jnode ) ) IMFS_dump_directory( the_jnode, level + 1 ); 44926: 5286 addql #1,%d6 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 44928: 2468 004e moveal %a0@(78),%a2 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 ); 4492c: 6000 00f6 braw 44a24 the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); 44930: 2f28 0008 movel %a0@(8),%sp@- !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++ ) 44934: 5282 addql #1,%d2 fprintf(stdout, "...." ); 44936: 4879 0006 1449 pea 61449 4493c: 4e93 jsr %a3@ !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++ ) 4493e: 508f addql #8,%sp 44940: 6002 bras 44944 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 ); 44942: 4282 clrl %d2 44944: 2079 0006 2f2c moveal 62f2c <_impure_ptr>,%a0 !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++ ) 4494a: b682 cmpl %d2,%d3 4494c: 6ce2 bges 44930 IMFS_jnode_t *the_jnode ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); 4494e: 2f28 0008 movel %a0@(8),%sp@- 44952: 486a 000c pea %a2@(12) 44956: 4e93 jsr %a3@ rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 44958: 206a 004a moveal %a2@(74),%a0 switch( IMFS_type( the_jnode ) ) { 4495c: 508f addql #8,%sp 4495e: 7206 moveq #6,%d1 44960: 2010 movel %a0@,%d0 44962: 2079 0006 2f2c moveal 62f2c <_impure_ptr>,%a0 44968: b280 cmpl %d0,%d1 4496a: 6500 0086 bcsw 449f2 4496e: 303b 0a08 movew %pc@(44978 ,%d0:l:2),%d0 44972: 48c0 extl %d0 44974: 4efb 0802 jmp %pc@(44978 ,%d0:l) 44978: 000e .short 0x000e <== NOT EXECUTED 4497a: 001e .short 0x001e <== NOT EXECUTED 4497c: 005e .short 0x005e <== NOT EXECUTED 4497e: 005e .short 0x005e <== NOT EXECUTED 44980: 0048 .short 0x0048 <== NOT EXECUTED 44982: 002e .short 0x002e <== NOT EXECUTED 44984: 006a .short 0x006a <== NOT EXECUTED case IMFS_DIRECTORY: fprintf(stdout, "/" ); 44986: 2f28 0008 movel %a0@(8),%sp@- 4498a: 2045 moveal %d5,%a0 4498c: 4878 002f pea 2f 44990: 4e90 jsr %a0@ 44992: 508f addql #8,%sp 44994: 6070 bras 44a06 break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 44996: 2f2a 0052 movel %a2@(82),%sp@- 4499a: 2f2a 004e movel %a2@(78),%sp@- 4499e: 4879 0006 144e pea 6144e 449a4: 600e bras 449b4 the_jnode->info.device.major, the_jnode->info.device.minor ); break; case IMFS_LINEAR_FILE: fprintf(stdout, " (file %" PRId32 " %p)", 449a6: 2f2a 0056 movel %a2@(86),%sp@- 449aa: 2f2a 0052 movel %a2@(82),%sp@- 449ae: 4879 0006 1461 pea 61461 449b4: 2f28 0008 movel %a0@(8),%sp@- 449b8: 4e94 jsr %a4@ 449ba: 4fef 0010 lea %sp@(16),%sp 449be: 6046 bras 44a06 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 449c0: 2f2a 0052 movel %a2@(82),%sp@- 449c4: 4879 0006 1470 pea 61470 449ca: 2f28 0008 movel %a0@(8),%sp@- 449ce: 4e94 jsr %a4@ 449d0: 4fef 000c lea %sp@(12),%sp 449d4: 6030 bras 44a06 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 449d6: 2f28 0008 movel %a0@(8),%sp@- 449da: 4879 0006 147c pea 6147c 449e0: 600a bras 449ec return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 449e2: 2f28 0008 movel %a0@(8),%sp@- 449e6: 4879 0006 1490 pea 61490 449ec: 4e93 jsr %a3@ 449ee: 508f addql #8,%sp 449f0: 601e bras 44a10 return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 449f2: 2f00 movel %d0,%sp@- <== NOT EXECUTED 449f4: 4879 0006 14a3 pea 614a3 <== NOT EXECUTED 449fa: 2f28 0008 movel %a0@(8),%sp@- <== NOT EXECUTED 449fe: 4e94 jsr %a4@ <== NOT EXECUTED 44a00: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED 44a04: 600a bras 44a10 <== NOT EXECUTED return; } puts(""); 44a06: 4879 0006 1c8a pea 61c8a 44a0c: 4e95 jsr %a5@ 44a0e: 588f addql #4,%sp } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 44a10: 206a 004a moveal %a2@(74),%a0 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 ) ) 44a14: 4a90 tstl %a0@ 44a16: 660a bnes 44a22 IMFS_dump_directory( the_jnode, level + 1 ); 44a18: 2f06 movel %d6,%sp@- 44a1a: 2f0a movel %a2,%sp@- 44a1c: 4eba fed6 jsr %pc@(448f4 ) 44a20: 508f addql #8,%sp 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 ) { 44a22: 2452 moveal %a2@,%a2 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 ); 44a24: b88a cmpl %a2,%d4 44a26: 6600 ff1a bnew 44942 fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( IMFS_is_directory( the_jnode ) ) IMFS_dump_directory( the_jnode, level + 1 ); } } 44a2a: 4cee 3c7c ffdc moveml %fp@(-36),%d2-%d6/%a2-%a5 44a30: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000499ba : 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( 499ba: 4280 clrl %d0 rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 499bc: 4e56 ffe4 linkw %fp,#-28 499c0: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 499c4: 266e 0008 moveal %fp@(8),%a3 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; 499c8: 286b 0020 moveal %a3@(32),%a4 bool access_ok = rtems_filesystem_eval_path_check_access( 499cc: 302c 003c movew %a4@(60),%d0 rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 499d0: 2a6e 0010 moveal %fp@(16),%a5 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( 499d4: 2f00 movel %d0,%sp@- rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 499d6: 242e 0014 movel %fp@(20),%d2 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( 499da: 302c 003a movew %a4@(58),%d0 499de: 2f00 movel %d0,%sp@- 499e0: 2f2c 002e movel %a4@(46),%sp@- 499e4: 4878 0001 pea 1 499e8: 2f0b movel %a3,%sp@- 499ea: 4eb9 0004 a5aa jsr 4a5aa dir->st_mode, dir->st_uid, dir->st_gid ); if ( access_ok ) { 499f0: 4fef 0014 lea %sp@(20),%sp 499f4: 4a00 tstb %d0 499f6: 6604 bnes 499fc 499f8: 6000 013c braw 49b36 static inline bool rtems_filesystem_is_current_directory( const char *token, size_t tokenlen ) { return tokenlen == 1 && token [0] == '.'; 499fc: 7001 moveq #1,%d0 499fe: b082 cmpl %d2,%d0 49a00: 6610 bnes 49a12 49a02: 722e moveq #46,%d1 49a04: 1015 moveb %a5@,%d0 49a06: b380 eorl %d1,%d0 49a08: 4a00 tstb %d0 49a0a: 57c0 seq %d0 49a0c: 49c0 extbl %d0 49a0e: 4480 negl %d0 49a10: 6002 bras 49a14 49a12: 4280 clrl %d0 IMFS_jnode_t *dir, const char *token, size_t tokenlen ) { if ( rtems_filesystem_is_current_directory( token, tokenlen ) ) { 49a14: 0800 0000 btst #0,%d0 49a18: 667c bnes 49a96 static inline bool rtems_filesystem_is_parent_directory( const char *token, size_t tokenlen ) { return tokenlen == 2 && token [0] == '.' && token [1] == '.'; 49a1a: 7602 moveq #2,%d3 49a1c: b682 cmpl %d2,%d3 49a1e: 661a bnes 49a3a 49a20: 722e moveq #46,%d1 49a22: 1015 moveb %a5@,%d0 49a24: 49c0 extbl %d0 49a26: b280 cmpl %d0,%d1 49a28: 6610 bnes 49a3a 49a2a: 102d 0001 moveb %a5@(1),%d0 49a2e: b380 eorl %d1,%d0 49a30: 4a00 tstb %d0 49a32: 57c0 seq %d0 49a34: 49c0 extbl %d0 49a36: 4480 negl %d0 49a38: 6002 bras 49a3c 49a3a: 4280 clrl %d0 return dir; } else { if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) { 49a3c: 0800 0000 btst #0,%d0 49a40: 6706 beqs 49a48 return dir->Parent; 49a42: 246c 0008 moveal %a4@(8),%a2 49a46: 6046 bras 49a8e } 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 ); 49a48: 260c movel %a4,%d3 49a4a: 0683 0000 0052 addil #82,%d3 while ( current != tail ) { IMFS_jnode_t *entry = (IMFS_jnode_t *) current; bool match = strncmp( entry->name, token, tokenlen ) == 0 49a50: 283c 0004 e314 movel #320276,%d4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 49a56: 246c 004e moveal %a4@(78),%a2 49a5a: 602a bras 49a86 49a5c: 2f02 movel %d2,%sp@- 49a5e: 2044 moveal %d4,%a0 49a60: 2f0d movel %a5,%sp@- 49a62: 486a 000c pea %a2@(12) 49a66: 4e90 jsr %a0@ 49a68: 4fef 000c lea %sp@(12),%sp && entry->name [tokenlen] == '\0'; 49a6c: 4a80 tstl %d0 49a6e: 660c bnes 49a7c 49a70: 4a32 280c tstb %a2@(0000000c,%d2:l) 49a74: 57c0 seq %d0 49a76: 49c0 extbl %d0 49a78: 4480 negl %d0 49a7a: 6002 bras 49a7e 49a7c: 4280 clrl %d0 if ( match ) { 49a7e: 0800 0000 btst #0,%d0 49a82: 660a bnes 49a8e }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } 49a84: 2452 moveal %a2@,%a2 } 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 ) { 49a86: b68a cmpl %a2,%d3 49a88: 66d2 bnes 49a5c 49a8a: 6000 00ae braw 49b3a ); if ( access_ok ) { IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen ); if ( entry != NULL ) { 49a8e: 4a8a tstl %a2 49a90: 6606 bnes 49a98 49a92: 6000 00a6 braw 49b3a IMFS_jnode_t *dir, const char *token, size_t tokenlen ) { if ( rtems_filesystem_is_current_directory( token, tokenlen ) ) { 49a96: 244c moveal %a4,%a2 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 49a98: 206a 004a moveal %a2@(74),%a0 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)) { 49a9c: 7602 moveq #2,%d3 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 ); 49a9e: 4aab 0004 tstl %a3@(4) 49aa2: 57c0 seq %d0 49aa4: 2210 movel %a0@,%d1 49aa6: 4480 negl %d0 }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } 49aa8: 242b 0010 movel %a3@(16),%d2 static inline void rtems_filesystem_eval_path_clear_token( rtems_filesystem_eval_path_context_t *ctx ) { ctx->tokenlen = 0; 49aac: 42ab 000c clrl %a3@(12) 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)) { 49ab0: b681 cmpl %d1,%d3 49ab2: 6610 bnes 49ac4 49ab4: 44c2 movew %d2,%ccr 49ab6: 6b06 bmis 49abe 49ab8: 4a00 tstb %d0 49aba: 6600 0082 bnew 49b3e entry = entry->info.hard_link.link_node; 49abe: 246a 004e moveal %a2@(78),%a2 49ac2: 607a bras 49b3e } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { 49ac4: 7603 moveq #3,%d3 49ac6: b681 cmpl %d1,%d3 49ac8: 6628 bnes 49af2 49aca: 0802 0004 btst #4,%d2 49ace: 6604 bnes 49ad4 49ad0: 4a00 tstb %d0 49ad2: 666a bnes 49b3e const char *target = entry->info.sym_link.name; 49ad4: 242a 004e movel %a2@(78),%d2 rtems_filesystem_eval_path_recursive( ctx, target, strlen( target ) ); 49ad8: 2f02 movel %d2,%sp@- 49ada: 4eb9 0004 e2f8 jsr 4e2f8 49ae0: 2e80 movel %d0,%sp@ 49ae2: 2f02 movel %d2,%sp@- 49ae4: 2f0b movel %a3,%sp@- 49ae6: 4eb9 0004 3c4a jsr 43c4a if ( type == IMFS_HARD_LINK && (follow_hard_link || !terminal)) { entry = entry->info.hard_link.link_node; } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { 49aec: 4fef 000c lea %sp@(12),%sp 49af0: 6044 bras 49b36 IMFS_jnode_types_t type ) { rtems_filesystem_global_location_t **fs_root_ptr = NULL; if ( type == IMFS_DIRECTORY ) { 49af2: 4a81 tstl %d1 49af4: 6648 bnes 49b3e if ( node->info.directory.mt_fs != NULL ) { 49af6: 222a 005a movel %a2@(90),%d1 49afa: 6742 beqs 49b3e if ( !terminal ) { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE; } } else { access_ok = rtems_filesystem_eval_path_check_access( 49afc: 4280 clrl %d0 { 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; 49afe: 2401 movel %d1,%d2 49b00: 0682 0000 0024 addil #36,%d2 if ( !terminal ) { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE; } } else { access_ok = rtems_filesystem_eval_path_check_access( 49b06: 302a 003c movew %a2@(60),%d0 49b0a: 2f00 movel %d0,%sp@- 49b0c: 302a 003a movew %a2@(58),%d0 49b10: 2f00 movel %d0,%sp@- 49b12: 2f2a 002e movel %a2@(46),%sp@- 49b16: 4878 0001 pea 1 49b1a: 2f0b movel %a3,%sp@- 49b1c: 4eb9 0004 a5aa jsr 4a5aa RTEMS_FS_PERMS_EXEC, entry->st_mode, entry->st_uid, entry->st_gid ); if ( access_ok ) { 49b22: 4fef 0014 lea %sp@(20),%sp 49b26: 4a00 tstb %d0 49b28: 670c beqs 49b36 <== NEVER TAKEN rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); 49b2a: 2f02 movel %d2,%sp@- 49b2c: 2f0b movel %a3,%sp@- 49b2e: 4eb9 0004 3bd6 jsr 43bd6 49b34: 508f addql #8,%sp void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 49b36: 7001 moveq #1,%d0 49b38: 602c bras 49b66 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); } } } } else { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; 49b3a: 7002 moveq #2,%d0 49b3c: 6028 bras 49b66 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; 49b3e: 206a 004a moveal %a2@(74),%a0 } else { rtems_filesystem_global_location_t **fs_root_ptr = IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; 49b42: 322c 0032 movew %a4@(50),%d1 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 49b46: 0280 0000 00ff andil #255,%d0 } else { rtems_filesystem_global_location_t **fs_root_ptr = IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; 49b4c: 5381 subql #1,%d1 49b4e: 3941 0032 movew %d1,%a4@(50) ++entry->reference_count; 49b52: 322a 0032 movew %a2@(50),%d1 49b56: 5281 addql #1,%d1 49b58: 3541 0032 movew %d1,%a2@(50) currentloc->node_access = entry; 49b5c: 274a 0020 movel %a2,%a3@(32) 49b60: 2768 0004 0028 movel %a0@(4),%a3@(40) status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } 49b66: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 49b6c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049b90 : int IMFS_fchmod( const rtems_filesystem_location_info_t *loc, mode_t mode ) { 49b90: 4e56 fff8 linkw %fp,#-8 IMFS_jnode_t *jnode; #if defined(RTEMS_POSIX_API) uid_t st_uid; #endif jnode = loc->node_access; 49b94: 206e 0008 moveal %fp@(8),%a0 int IMFS_fchmod( const rtems_filesystem_location_info_t *loc, mode_t mode ) { 49b98: 2f0a movel %a2,%sp@- IMFS_jnode_t *jnode; #if defined(RTEMS_POSIX_API) uid_t st_uid; #endif jnode = loc->node_access; 49b9a: 2468 0008 moveal %a0@(8),%a2 int IMFS_fchmod( const rtems_filesystem_location_info_t *loc, mode_t mode ) { 49b9e: 2f02 movel %d2,%sp@- * Verify I am the owner of the node or the super user. */ #if defined(RTEMS_POSIX_API) st_uid = geteuid(); if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) 49ba0: 4282 clrl %d2 /* * Verify I am the owner of the node or the super user. */ #if defined(RTEMS_POSIX_API) st_uid = geteuid(); 49ba2: 4eb9 0004 a1a4 jsr 4a1a4 if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) 49ba8: 4281 clrl %d1 49baa: 3400 movew %d0,%d2 49bac: 322a 003a movew %a2@(58),%d1 49bb0: b282 cmpl %d2,%d1 49bb2: 6714 beqs 49bc8 49bb4: 4a40 tstw %d0 49bb6: 6710 beqs 49bc8 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EPERM ); 49bb8: 4eb9 0004 cf98 jsr 4cf98 <__errno> 49bbe: 2040 moveal %d0,%a0 49bc0: 7001 moveq #1,%d0 49bc2: 2080 movel %d0,%a0@ 49bc4: 70ff moveq #-1,%d0 49bc6: 6030 bras 49bf8 /* * 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); 49bc8: 202a 002e movel %a2@(46),%d0 jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); 49bcc: 222e 000c movel %fp@(12),%d1 /* * 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); 49bd0: 0280 ffff f000 andil #-4096,%d0 jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); 49bd6: 0281 0000 0fff andil #4095,%d1 49bdc: 8280 orl %d0,%d1 49bde: 2541 002e movel %d1,%a2@(46) IMFS_update_ctime( jnode ); 49be2: 42a7 clrl %sp@- 49be4: 486e fff8 pea %fp@(-8) 49be8: 4eb9 0004 2ae8 jsr 42ae8 49bee: 256e fff8 0046 movel %fp@(-8),%a2@(70) return 0; 49bf4: 508f addql #8,%sp 49bf6: 4280 clrl %d0 } 49bf8: 242e fff0 movel %fp@(-16),%d2 49bfc: 246e fff4 moveal %fp@(-12),%a2 49c00: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00042c60 : static ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 42c60: 4e56 fff8 linkw %fp,#-8 42c64: 206e 0008 moveal %fp@(8),%a0 42c68: 2f0a movel %a2,%sp@- IMFS_jnode_t *jnode = iop->pathinfo.node_access; 42c6a: 2468 0018 moveal %a0@(24),%a2 static ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 42c6e: 2f02 movel %d2,%sp@- IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); 42c70: 2f08 movel %a0,%sp@- 42c72: 2f2e 0010 movel %fp@(16),%sp@- 42c76: 2f2e 000c movel %fp@(12),%sp@- 42c7a: 2f2a 004e movel %a2@(78),%sp@- 42c7e: 4eb9 0004 c07e jsr 4c07e if (err > 0) { 42c84: 4fef 0010 lea %sp@(16),%sp size_t count ) { IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); 42c88: 2400 movel %d0,%d2 if (err > 0) { 42c8a: 6f1c bles 42ca8 IMFS_mtime_ctime_update(jnode); 42c8c: 42a7 clrl %sp@- 42c8e: 486e fff8 pea %fp@(-8) 42c92: 4eb9 0004 3c44 jsr 43c44 42c98: 202e fff8 movel %fp@(-8),%d0 42c9c: 508f addql #8,%sp 42c9e: 2540 0042 movel %d0,%a2@(66) 42ca2: 2540 0046 movel %d0,%a2@(70) 42ca6: 6012 bras 42cba } IMFS_FIFO_RETURN(err); 42ca8: 4a80 tstl %d0 42caa: 670e beqs 42cba <== NEVER TAKEN 42cac: 4eb9 0004 ecec jsr 4ecec <__errno> 42cb2: 4482 negl %d2 42cb4: 2040 moveal %d0,%a0 42cb6: 2082 movel %d2,%a0@ 42cb8: 74ff moveq #-1,%d2 } 42cba: 2002 movel %d2,%d0 42cbc: 242e fff0 movel %fp@(-16),%d2 42cc0: 246e fff4 moveal %fp@(-12),%a2 42cc4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049c04 : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 49c04: 4e56 ffd4 linkw %fp,#-44 /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; 49c08: 206e 0008 moveal %fp@(8),%a0 ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 49c0c: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; 49c10: 2668 0024 moveal %a0@(36),%a3 49c14: 4878 0018 pea 18 49c18: 240e movel %fp,%d2 49c1a: 0682 ffff ffe8 addil #-24,%d2 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 ); 49c20: 49f9 0004 25d0 lea 425d0 ,%a4 if ( result != 0 ) rtems_fatal_error_occurred( 0xdeadbeef ); IMFS_node_destroy( jnode ); 49c26: 4bf9 0004 22b6 lea 422b6 ,%a5 /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; 49c2c: 2f0b movel %a3,%sp@- 49c2e: 2f02 movel %d2,%sp@- 49c30: 4eb9 0004 d7b8 jsr 4d7b8 jnode = (IMFS_jnode_t *)loc.node_access; 49c36: 246e fff0 moveal %fp@(-16),%a2 /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root->location.node_access = NULL; 49c3a: 4fef 000c lea %sp@(12),%sp 49c3e: 42ab 0008 clrl %a3@(8) 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 ); 49c42: 2642 moveal %d2,%a3 49c44: 6002 bras 49c48 if ( IMFS_is_directory( jnode ) ) { if ( jnode_has_children( jnode ) ) jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); 49c46: 2440 moveal %d0,%a2 */ temp_mt_entry->mt_fs_root->location.node_access = NULL; do { next = jnode->Parent; 49c48: 242a 0008 movel %a2@(8),%d2 49c4c: 206a 004a moveal %a2@(74),%a0 49c50: 2d68 0004 fff8 movel %a0@(4),%fp@(-8) loc.node_access = (void *)jnode; 49c56: 2d4a fff0 movel %a2,%fp@(-16) IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { 49c5a: 4a90 tstl %a0@ 49c5c: 660e bnes 49c6c RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 49c5e: 200a movel %a2,%d0 49c60: 0680 0000 0052 addil #82,%d0 49c66: b0aa 004e cmpl %a2@(78),%d0 49c6a: 6624 bnes 49c90 result = IMFS_rmnod( NULL, &loc ); 49c6c: 2f0b movel %a3,%sp@- 49c6e: 42a7 clrl %sp@- 49c70: 4e94 jsr %a4@ if ( result != 0 ) 49c72: 508f addql #8,%sp 49c74: 4a80 tstl %d0 49c76: 670c beqs 49c84 <== ALWAYS TAKEN rtems_fatal_error_occurred( 0xdeadbeef ); 49c78: 2f3c dead beef movel #-559038737,%sp@- <== NOT EXECUTED 49c7e: 4eb9 0004 69f0 jsr 469f0 <== NOT EXECUTED IMFS_node_destroy( jnode ); 49c84: 2f0a movel %a2,%sp@- 49c86: 4e95 jsr %a5@ jnode = next; } if ( jnode != NULL ) { 49c88: 588f addql #4,%sp 49c8a: 4a82 tstl %d2 49c8c: 671e beqs 49cac 49c8e: 2442 moveal %d2,%a2 return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 49c90: 206a 004a moveal %a2@(74),%a0 if ( IMFS_is_directory( jnode ) ) { 49c94: 4a90 tstl %a0@ 49c96: 66b0 bnes 49c48 <== NEVER TAKEN 49c98: 220a movel %a2,%d1 49c9a: 0681 0000 0052 addil #82,%d1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 49ca0: 202a 004e movel %a2@(78),%d0 if ( jnode_has_children( jnode ) ) 49ca4: b280 cmpl %d0,%d1 49ca6: 67a0 beqs 49c48 jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); 49ca8: 4a80 tstl %d0 49caa: 669a bnes 49c46 <== ALWAYS TAKEN } 49cac: 4cee 3c04 ffd4 moveml %fp@(-44),%d2/%a2-%a5 49cb2: 4e5e unlk %fp ... =============================================================================== 000421b4 : 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] ) { 421b4: 4e56 0000 linkw %fp,#0 421b8: 2f0b movel %a3,%sp@- 421ba: 266e 0008 moveal %fp@(8),%a3 421be: 2f0a movel %a2,%sp@- static int imfs_instance; int rv = 0; IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) ); 421c0: 4878 0024 pea 24 421c4: 4878 0001 pea 1 421c8: 4eb9 0004 2818 jsr 42818 if ( fs_info != NULL ) { 421ce: 508f addql #8,%sp ) { static int imfs_instance; int rv = 0; IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) ); 421d0: 2440 moveal %d0,%a2 if ( fs_info != NULL ) { 421d2: 4a80 tstl %d0 421d4: 6700 008a beqw 42260 IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; 421d8: 2039 0005 e5c0 movel 5e5c0 ,%d0 421de: 2480 movel %d0,%a2@ memcpy( 421e0: 4878 001c pea 1c 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++; 421e4: 5280 addql #1,%d0 memcpy( 421e6: 2f2e 0010 movel %fp@(16),%sp@- 421ea: 486a 0008 pea %a2@(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++; 421ee: 23c0 0005 e5c0 movel %d0,5e5c0 memcpy( 421f4: 4eb9 0004 d7b8 jsr 4d7b8 fs_info->node_controls, node_controls, sizeof( fs_info->node_controls ) ); root_node = IMFS_allocate_node( 421fa: 42a7 clrl %sp@- 421fc: 4878 41ed pea 41ed 42200: 42a7 clrl %sp@- 42202: 4879 0005 c68e pea 5c68e 42208: 2f2a 0008 movel %a2@(8),%sp@- 4220c: 2f0a movel %a2,%sp@- 4220e: 4eb9 0004 9868 jsr 49868 "", 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { 42214: 4fef 0024 lea %sp@(36),%sp 42218: 4a80 tstl %d0 4221a: 6736 beqs 42252 <== NEVER TAKEN mt_entry->fs_info = fs_info; 4221c: 274a 0008 movel %a2,%a3@(8) 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; 42220: 2440 moveal %d0,%a2 mt_entry->ops = op_table; 42222: 276e 000c 000c movel %fp@(12),%a3@(12) mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; 42228: 223c 0005 c8ca movel #379082,%d1 mt_entry->mt_fs_root->location.node_access = root_node; 4222e: 206b 0024 moveal %a3@(36),%a0 42232: 226a 004a moveal %a2@(74),%a1 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; 42236: 2741 002a movel %d1,%a3@(42) 4223a: 2169 0004 0010 movel %a1@(4),%a0@(16) int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 42240: 7210 moveq #16,%d1 ); 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; 42242: 2140 0008 movel %d0,%a0@(8) errno = ENOMEM; rv = -1; } if ( rv == 0 ) { IMFS_determine_bytes_per_block( 42246: 2039 0005 d69c movel 5d69c ,%d0 4224c: 307c 0006 moveaw #6,%a0 42250: 601c bras 4226e 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; IMFS_Set_handlers( &mt_entry->mt_fs_root->location ); } else { errno = ENOMEM; 42252: 4eb9 0004 cf98 jsr 4cf98 <__errno> <== NOT EXECUTED 42258: 720c moveq #12,%d1 <== NOT EXECUTED 4225a: 2040 moveal %d0,%a0 <== NOT EXECUTED 4225c: 2081 movel %d1,%a0@ <== NOT EXECUTED 4225e: 602c bras 4228c <== NOT EXECUTED rv = -1; } } else { errno = ENOMEM; 42260: 4eb9 0004 cf98 jsr 4cf98 <__errno> <== NOT EXECUTED 42266: 2440 moveal %d0,%a2 <== NOT EXECUTED 42268: 700c moveq #12,%d0 <== NOT EXECUTED 4226a: 2480 movel %d0,%a2@ <== NOT EXECUTED 4226c: 601e bras 4228c <== NOT EXECUTED /* * 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) { 4226e: b081 cmpl %d1,%d0 42270: 6710 beqs 42282 is_valid = true; break; } if(bit_mask > requested_bytes_per_block) 42272: 6d08 blts 4227c 42274: 5388 subql #1,%a0 int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 42276: d281 addl %d1,%d1 42278: 4a88 tstl %a0 4227a: 66f2 bnes 4226e <== ALWAYS TAKEN if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) ? requested_bytes_per_block : default_bytes_per_block); 4227c: 203c 0000 0080 movel #128,%d0 break; } if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) 42282: 23c0 0005 e5bc movel %d0,5e5bc const IMFS_node_control *const node_controls [IMFS_TYPE_COUNT] ) { static int imfs_instance; int rv = 0; 42288: 4280 clrl %d0 4228a: 6002 bras 4228e if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) ? requested_bytes_per_block : default_bytes_per_block); 4228c: 70ff moveq #-1,%d0 <== NOT EXECUTED IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK ); } return rv; } 4228e: 246e fff8 moveal %fp@(-8),%a2 42292: 266e fffc moveal %fp@(-4),%a3 42296: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00043910 : const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 43910: 4e56 ff9c linkw %fp,#-100 int rv = 0; mode &= ~rtems_filesystem_umask; 43914: 2079 0006 15d8 moveal 615d8 ,%a0 const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 4391a: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ int rv = 0; mode &= ~rtems_filesystem_umask; 4391e: 2428 0008 movel %a0@(8),%d2 43922: 4682 notl %d2 43924: c4ae 000c andl %fp@(12),%d2 const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 43928: 266e 0010 moveal %fp@(16),%a3 int rv = 0; mode &= ~rtems_filesystem_umask; switch (mode & S_IFMT) { 4392c: 2002 movel %d2,%d0 4392e: 0280 0000 f000 andil #61440,%d0 43934: 0c80 0000 2000 cmpil #8192,%d0 4393a: 6700 00da beqw 43a16 4393e: 620e bhis 4394e <== ALWAYS TAKEN 43940: 0c80 0000 1000 cmpil #4096,%d0 <== NOT EXECUTED 43946: 6600 00be bnew 43a06 <== NOT EXECUTED 4394a: 6000 00ca braw 43a16 <== NOT EXECUTED 4394e: 0c80 0000 6000 cmpil #24576,%d0 43954: 6700 00c0 beqw 43a16 43958: 0c80 0000 8000 cmpil #32768,%d0 4395e: 6700 00b6 beqw 43a16 43962: 6000 00a2 braw 43a06 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 = 43966: 4878 0078 pea 78 rtems_filesystem_eval_path_start( &ctx, path, eval_flags ); 4396a: 260e movel %fp,%d3 4396c: 0683 ffff ffc8 addil #-56,%d3 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 = 43972: 2f2e 0008 movel %fp@(8),%sp@- 43976: 2f03 movel %d3,%sp@- 43978: 4eb9 0004 56de jsr 456de 4397e: 2440 moveal %d0,%a2 rtems_filesystem_eval_path_start( &ctx, path, eval_flags ); if ( IMFS_is_imfs_instance( currentloc ) ) { 43980: 2f00 movel %d0,%sp@- 43982: 4eb9 0004 38be jsr 438be 43988: 4fef 0010 lea %sp@(16),%sp 4398c: 4a00 tstb %d0 4398e: 6758 beqs 439e8 IMFS_types_union info; IMFS_jnode_t *new_node; info.generic.context = context; new_node = IMFS_create_node_with_control( 43990: 486e ffb4 pea %fp@(-76) if ( IMFS_is_imfs_instance( currentloc ) ) { IMFS_types_union info; IMFS_jnode_t *new_node; info.generic.context = context; 43994: 2d6e 0014 ffb4 movel %fp@(20),%fp@(-76) new_node = IMFS_create_node_with_control( 4399a: 2f02 movel %d2,%sp@- 4399c: 2f2e ffd4 movel %fp@(-44),%sp@- 439a0: 2f2e ffd0 movel %fp@(-48),%sp@- 439a4: 2f0b movel %a3,%sp@- 439a6: 2f0a movel %a2,%sp@- 439a8: 4eb9 0004 d9d8 jsr 4d9d8 rtems_filesystem_eval_path_get_tokenlen( &ctx ), mode, &info ); if ( new_node != NULL ) { 439ae: 4fef 0018 lea %sp@(24),%sp 439b2: 4a80 tstl %d0 439b4: 6740 beqs 439f6 IMFS_jnode_t *parent = currentloc->node_access; 439b6: 246a 0008 moveal %a2@(8),%a2 IMFS_update_ctime( parent ); 439ba: 240e movel %fp,%d2 439bc: 0682 ffff ffac addil #-84,%d2 439c2: 47f9 0004 42e4 lea 442e4 ,%a3 439c8: 42a7 clrl %sp@- 439ca: 2f02 movel %d2,%sp@- 439cc: 4e93 jsr %a3@ 439ce: 256e ffac 0046 movel %fp@(-84),%a2@(70) IMFS_update_mtime( parent ); 439d4: 42a7 clrl %sp@- 439d6: 2f02 movel %d2,%sp@- 439d8: 4282 clrl %d2 439da: 4e93 jsr %a3@ 439dc: 256e ffac 0042 movel %fp@(-84),%a2@(66) 439e2: 4fef 0010 lea %sp@(16),%sp 439e6: 6010 bras 439f8 } else { rv = -1; } } else { rtems_filesystem_eval_path_error( &ctx, ENOTSUP ); 439e8: 4878 0086 pea 86 439ec: 2f03 movel %d3,%sp@- 439ee: 4eb9 0004 546e jsr 4546e 439f4: 508f addql #8,%sp rv = -1; 439f6: 74ff moveq #-1,%d2 } rtems_filesystem_eval_path_cleanup( &ctx ); 439f8: 486e ffc8 pea %fp@(-56) 439fc: 4eb9 0004 57d0 jsr 457d0 43a02: 588f addql #4,%sp 43a04: 601a bras 43a20 } else { errno = EINVAL; 43a06: 4eb9 0005 11bc jsr 511bc <__errno> rv = -1; 43a0c: 74ff moveq #-1,%d2 rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); } else { errno = EINVAL; 43a0e: 2040 moveal %d0,%a0 43a10: 7016 moveq #22,%d0 43a12: 2080 movel %d0,%a0@ 43a14: 600a bras 43a20 rv = -1; break; } if ( rv == 0 ) { if ( node_control->imfs_type == IMFS_GENERIC ) { 43a16: 7007 moveq #7,%d0 43a18: b093 cmpl %a3@,%d0 43a1a: 6700 ff4a beqw 43966 43a1e: 60e6 bras 43a06 rv = -1; } } return rv; } 43a20: 2002 movel %d2,%d0 43a22: 4cee 0c0c ff9c moveml %fp@(-100),%d2-%d3/%a2-%a3 43a28: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004bdac : */ MEMFILE_STATIC int IMFS_memfile_addblock( IMFS_jnode_t *the_jnode, unsigned int block ) { 4bdac: 4e56 0000 linkw %fp,#0 4bdb0: 2f0a movel %a2,%sp@- 4bdb2: 2f02 movel %d2,%sp@- IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Obtain the pointer for the specified block number */ block_entry_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 1 ); 4bdb4: 4878 0001 pea 1 if ( *block_entry_ptr ) return 0; 4bdb8: 4282 clrl %d2 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 ); 4bdba: 2f2e 000c movel %fp@(12),%sp@- 4bdbe: 2f2e 0008 movel %fp@(8),%sp@- 4bdc2: 4eb9 0004 ba6c jsr 4ba6c if ( *block_entry_ptr ) 4bdc8: 4fef 000c lea %sp@(12),%sp IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Obtain the pointer for the specified block number */ block_entry_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 1 ); 4bdcc: 2440 moveal %d0,%a2 if ( *block_entry_ptr ) 4bdce: 4a92 tstl %a2@ 4bdd0: 6610 bnes 4bde2 return 0; /* * There is no memory for this block number so allocate it. */ memory = memfile_alloc_block(); 4bdd2: 4eb9 0004 ba48 jsr 4ba48 if ( !memory ) 4bdd8: 4a80 tstl %d0 4bdda: 6704 beqs 4bde0 <== NEVER TAKEN return 1; *block_entry_ptr = memory; 4bddc: 2480 movel %d0,%a2@ return 0; 4bdde: 6002 bras 4bde2 /* * There is no memory for this block number so allocate it. */ memory = memfile_alloc_block(); if ( !memory ) return 1; 4bde0: 7401 moveq #1,%d2 <== NOT EXECUTED *block_entry_ptr = memory; return 0; } 4bde2: 2002 movel %d2,%d0 4bde4: 242e fff8 movel %fp@(-8),%d2 4bde8: 246e fffc moveal %fp@(-4),%a2 4bdec: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004bf4c : IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 4bf4c: 4280 clrl %d0 MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 4bf4e: 4e56 ffc8 linkw %fp,#-56 4bf52: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4bf56: 182e 000f moveb %fp@(15),%d4 IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 4bf5a: 2a79 0005 e5bc moveal 5e5bc ,%a5 4bf60: 2a0d movel %a5,%d5 4bf62: e48d lsrl #2,%d5 MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 4bf64: 1d44 fff3 moveb %d4,%fp@(-13) IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 4bf68: 2805 movel %d5,%d4 4bf6a: 5284 addql #1,%d4 4bf6c: 4c05 4800 mulsl %d5,%d4 MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 4bf70: 242e 0010 movel %fp@(16),%d2 4bf74: 262e 0014 movel %fp@(20),%d3 4bf78: 246e 0008 moveal %fp@(8),%a2 IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 4bf7c: 5284 addql #1,%d4 4bf7e: 4c05 4800 mulsl %d5,%d4 4bf82: 2a0d movel %a5,%d5 4bf84: 5384 subql #1,%d4 4bf86: 4c05 4800 mulsl %d5,%d4 4bf8a: 2204 movel %d4,%d1 4bf8c: 2802 movel %d2,%d4 4bf8e: 2a03 movel %d3,%d5 4bf90: 9a81 subl %d1,%d5 4bf92: 9980 subxl %d0,%d4 4bf94: 6d10 blts 4bfa6 rtems_set_errno_and_return_minus_one( EFBIG ); 4bf96: 4eb9 0004 cf98 jsr 4cf98 <__errno> 4bf9c: 721b moveq #27,%d1 4bf9e: 2040 moveal %d0,%a0 4bfa0: 2081 movel %d1,%a0@ 4bfa2: 6000 00c4 braw 4c068 /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) 4bfa6: 282a 004e movel %a2@(78),%d4 4bfaa: 2a2a 0052 movel %a2@(82),%d5 4bfae: 2002 movel %d2,%d0 4bfb0: 2203 movel %d3,%d1 4bfb2: 9285 subl %d5,%d1 4bfb4: 9184 subxl %d4,%d0 4bfb6: 6f00 00e8 blew 4c0a0 return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; 4bfba: 49f9 0005 9654 lea 59654 <__divdi3>,%a4 4bfc0: 2e0d movel %a5,%d7 4bfc2: 5bc6 smi %d6 4bfc4: 49c6 extbl %d6 4bfc6: 2f07 movel %d7,%sp@- 4bfc8: 2f06 movel %d6,%sp@- 4bfca: 2f03 movel %d3,%sp@- 4bfcc: 2f02 movel %d2,%sp@- 4bfce: 4e94 jsr %a4@ 4bfd0: 4fef 0010 lea %sp@(16),%sp 4bfd4: 2641 moveal %d1,%a3 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 4bfd6: 2f07 movel %d7,%sp@- if ( zero_fill ) { size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; block_p *block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); 4bfd8: 2e3c 0004 d828 movel #317480,%d7 /* * 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; 4bfde: 2f06 movel %d6,%sp@- 4bfe0: 2f05 movel %d5,%sp@- 4bfe2: 2f04 movel %d4,%sp@- offset = the_jnode->info.file.size - old_blocks * IMFS_MEMFILE_BYTES_PER_BLOCK; 4bfe4: 2805 movel %d5,%d4 */ 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; block_p *block_ptr = 4bfe6: 2a3c 0004 ba6c movel #309868,%d5 /* * 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; 4bfec: 4e94 jsr %a4@ 4bfee: 4fef 0010 lea %sp@(16),%sp offset = the_jnode->info.file.size - old_blocks * IMFS_MEMFILE_BYTES_PER_BLOCK; 4bff2: 200d movel %a5,%d0 4bff4: 4c01 0800 mulsl %d1,%d0 /* * 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; 4bff8: 2c01 movel %d1,%d6 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++ ) { 4bffa: 2841 moveal %d1,%a4 /* * 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; 4bffc: 9880 subl %d0,%d4 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { if ( !IMFS_memfile_addblock( the_jnode, block ) ) { 4bffe: 4bf9 0004 bdac lea 4bdac ,%a5 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++ ) { 4c004: 6068 bras 4c06e if ( !IMFS_memfile_addblock( the_jnode, block ) ) { 4c006: 2f0c movel %a4,%sp@- 4c008: 2f0a movel %a2,%sp@- 4c00a: 4e95 jsr %a5@ 4c00c: 508f addql #8,%sp 4c00e: 4a80 tstl %d0 4c010: 6640 bnes 4c052 <== NEVER TAKEN if ( zero_fill ) { 4c012: 4a2e fff3 tstb %fp@(-13) 4c016: 6754 beqs 4c06c size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; block_p *block_ptr = 4c018: 42a7 clrl %sp@- * 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; 4c01a: 2239 0005 e5bc movel 5e5bc ,%d1 4c020: 9284 subl %d4,%d1 block_p *block_ptr = 4c022: 2045 moveal %d5,%a0 4c024: 2f0c movel %a4,%sp@- * 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; 4c026: 2d41 fff4 movel %d1,%fp@(-12) block_p *block_ptr = 4c02a: 2f0a movel %a2,%sp@- 4c02c: 4e90 jsr %a0@ IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); 4c02e: 2f2e fff4 movel %fp@(-12),%sp@- 4c032: 2040 moveal %d0,%a0 4c034: 42a7 clrl %sp@- 4c036: d890 addl %a0@,%d4 4c038: 2047 moveal %d7,%a0 4c03a: 2f04 movel %d4,%sp@- offset = 0; 4c03c: 4284 clrl %d4 if ( zero_fill ) { size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; block_p *block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); 4c03e: 4e90 jsr %a0@ 4c040: 4fef 0018 lea %sp@(24),%sp 4c044: 6026 bras 4c06c offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); 4c046: 2f0c movel %a4,%sp@- <== NOT EXECUTED memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { 4c048: 538c subql #1,%a4 <== NOT EXECUTED IMFS_memfile_remove_block( the_jnode, block ); 4c04a: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4c04c: 4e93 jsr %a3@ <== NOT EXECUTED memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { 4c04e: 508f addql #8,%sp <== NOT EXECUTED 4c050: 6006 bras 4c058 <== NOT EXECUTED IMFS_memfile_remove_block( the_jnode, block ); 4c052: 47f9 0004 bf24 lea 4bf24 ,%a3 <== NOT EXECUTED memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { 4c058: bc8c cmpl %a4,%d6 <== NOT EXECUTED 4c05a: 63ea blss 4c046 <== NOT EXECUTED IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); 4c05c: 4eb9 0004 cf98 jsr 4cf98 <__errno> <== NOT EXECUTED 4c062: 2040 moveal %d0,%a0 <== NOT EXECUTED 4c064: 701c moveq #28,%d0 <== NOT EXECUTED 4c066: 2080 movel %d0,%a0@ <== NOT EXECUTED 4c068: 70ff moveq #-1,%d0 4c06a: 6036 bras 4c0a2 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++ ) { 4c06c: 528c addql #1,%a4 4c06e: b7cc cmpal %a4,%a3 4c070: 6494 bccs 4c006 /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); 4c072: 47f9 0004 2ae8 lea 42ae8 ,%a3 } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; 4c078: 2542 004e movel %d2,%a2@(78) 4c07c: 2543 0052 movel %d3,%a2@(82) IMFS_update_ctime(the_jnode); 4c080: 240e movel %fp,%d2 4c082: 5182 subql #8,%d2 4c084: 42a7 clrl %sp@- 4c086: 2f02 movel %d2,%sp@- 4c088: 4e93 jsr %a3@ 4c08a: 256e fff8 0046 movel %fp@(-8),%a2@(70) IMFS_update_mtime(the_jnode); 4c090: 42a7 clrl %sp@- 4c092: 2f02 movel %d2,%sp@- 4c094: 4e93 jsr %a3@ 4c096: 256e fff8 0042 movel %fp@(-8),%a2@(66) return 0; 4c09c: 4fef 0010 lea %sp@(16),%sp /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) return 0; 4c0a0: 4280 clrl %d0 the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); IMFS_update_mtime(the_jnode); return 0; } 4c0a2: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 4c0a8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004ba6c : #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 4ba6c: 4e56 fff0 linkw %fp,#-16 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 4ba70: 2239 0005 e5bc movel 5e5bc ,%d1 4ba76: e489 lsrl #2,%d1 4ba78: 2001 movel %d1,%d0 4ba7a: 5380 subql #1,%d0 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 4ba7c: 48d7 041c moveml %d2-%d4/%a2,%sp@ 4ba80: 246e 0008 moveal %fp@(8),%a2 4ba84: 242e 000c movel %fp@(12),%d2 4ba88: 206e 0010 moveal %fp@(16),%a0 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 4ba8c: b082 cmpl %d2,%d0 4ba8e: 6538 bcss 4bac8 p = info->indirect; 4ba90: 226a 0056 moveal %a2@(86),%a1 if ( malloc_it ) { 4ba94: 4a88 tstl %a0 4ba96: 6724 beqs 4babc if ( !p ) { 4ba98: 4a89 tstl %a1 4ba9a: 6614 bnes 4bab0 p = memfile_alloc_block(); 4ba9c: 4eb9 0004 ba48 jsr 4ba48 if ( !p ) 4baa2: 4a80 tstl %d0 4baa4: 6606 bnes 4baac <== ALWAYS TAKEN return 0; 4baa6: 91c8 subal %a0,%a0 <== NOT EXECUTED 4baa8: 6000 00fc braw 4bba6 <== NOT EXECUTED info->indirect = p; 4baac: 2540 0056 movel %d0,%a2@(86) } return &info->indirect[ my_block ]; 4bab0: 206a 0056 moveal %a2@(86),%a0 4bab4: e58a lsll #2,%d2 4bab6: d1c2 addal %d2,%a0 4bab8: 6000 00ec braw 4bba6 } if ( !p ) 4babc: 4a89 tstl %a1 4babe: 67e6 beqs 4baa6 <== NEVER TAKEN return 0; return &info->indirect[ my_block ]; 4bac0: 41f1 2c00 lea %a1@(00000000,%d2:l:4),%a0 4bac4: 6000 00e0 braw 4bba6 /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { 4bac8: 2001 movel %d1,%d0 4baca: 5280 addql #1,%d0 4bacc: 4c01 0800 mulsl %d1,%d0 4bad0: 2240 moveal %d0,%a1 4bad2: 5389 subql #1,%a1 4bad4: b3c2 cmpal %d2,%a1 4bad6: 653a bcss 4bb12 my_block -= FIRST_DOUBLY_INDIRECT; 4bad8: 9481 subl %d1,%d2 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; p = info->doubly_indirect; 4bada: 202a 005a movel %a2@(90),%d0 */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 4bade: 4c41 2003 remul %d1,%d3,%d2 4bae2: 4c41 2002 remul %d1,%d2,%d2 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; p = info->doubly_indirect; if ( malloc_it ) { 4bae6: 4a88 tstl %a0 4bae8: 671a beqs 4bb04 if ( !p ) { 4baea: 4a80 tstl %d0 4baec: 660e bnes 4bafc p = memfile_alloc_block(); 4baee: 4eb9 0004 ba48 jsr 4ba48 if ( !p ) 4baf4: 4a80 tstl %d0 4baf6: 67ae beqs 4baa6 <== NEVER TAKEN return 0; info->doubly_indirect = p; 4baf8: 2540 005a movel %d0,%a2@(90) } p1 = (block_p *)p[ doubly ]; 4bafc: 2040 moveal %d0,%a0 4bafe: 45f0 2c00 lea %a0@(00000000,%d2:l:4),%a2 4bb02: 6068 bras 4bb6c } return (block_p *)&p1[ singly ]; } if ( !p ) 4bb04: 4a80 tstl %d0 4bb06: 679e beqs 4baa6 <== NEVER TAKEN return 0; p = (block_p *)p[ doubly ]; 4bb08: 2240 moveal %d0,%a1 4bb0a: 2071 2c00 moveal %a1@(00000000,%d2:l:4),%a0 4bb0e: 6000 008c braw 4bb9c } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 4bb12: 2600 movel %d0,%d3 4bb14: 5283 addql #1,%d3 4bb16: 4c01 3800 mulsl %d1,%d3 4bb1a: 5383 subql #1,%d3 4bb1c: b682 cmpl %d2,%d3 4bb1e: 6586 bcss 4baa6 <== NEVER TAKEN my_block -= FIRST_TRIPLY_INDIRECT; 4bb20: 9480 subl %d0,%d2 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 4bb22: 4c41 2003 remul %d1,%d3,%d2 4bb26: 4c41 2002 remul %d1,%d2,%d2 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; doubly %= IMFS_MEMFILE_BLOCK_SLOTS; p = info->triply_indirect; 4bb2a: 202a 005e movel %a2@(94),%d0 if ( my_block <= LAST_TRIPLY_INDIRECT ) { my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 4bb2e: 4c41 2004 remul %d1,%d4,%d2 4bb32: 4c41 2002 remul %d1,%d2,%d2 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; p = info->triply_indirect; if ( malloc_it ) { 4bb36: 4a88 tstl %a0 4bb38: 674c beqs 4bb86 if ( !p ) { 4bb3a: 4a80 tstl %d0 4bb3c: 6610 bnes 4bb4e p = memfile_alloc_block(); 4bb3e: 4eb9 0004 ba48 jsr 4ba48 if ( !p ) 4bb44: 4a80 tstl %d0 4bb46: 6700 ff5e beqw 4baa6 return 0; info->triply_indirect = p; 4bb4a: 2540 005e movel %d0,%a2@(94) } p1 = (block_p *) p[ triply ]; 4bb4e: 2040 moveal %d0,%a0 4bb50: 45f0 2c00 lea %a0@(00000000,%d2:l:4),%a2 4bb54: 2012 movel %a2@,%d0 if ( !p1 ) { 4bb56: 660e bnes 4bb66 p1 = memfile_alloc_block(); 4bb58: 4eb9 0004 ba48 jsr 4ba48 if ( !p1 ) 4bb5e: 4a80 tstl %d0 4bb60: 6700 ff44 beqw 4baa6 return 0; p[ triply ] = (block_p) p1; 4bb64: 2480 movel %d0,%a2@ } p2 = (block_p *)p1[ doubly ]; 4bb66: 2240 moveal %d0,%a1 4bb68: 45f1 4c00 lea %a1@(00000000,%d4:l:4),%a2 4bb6c: 2012 movel %a2@,%d0 if ( !p2 ) { 4bb6e: 660e bnes 4bb7e p2 = memfile_alloc_block(); 4bb70: 4eb9 0004 ba48 jsr 4ba48 if ( !p2 ) 4bb76: 4a80 tstl %d0 4bb78: 6700 ff2c beqw 4baa6 return 0; p1[ doubly ] = (block_p) p2; 4bb7c: 2480 movel %d0,%a2@ } return (block_p *)&p2[ singly ]; 4bb7e: 2240 moveal %d0,%a1 4bb80: 41f1 3c00 lea %a1@(00000000,%d3:l:4),%a0 4bb84: 6020 bras 4bba6 } if ( !p ) 4bb86: 4a80 tstl %d0 4bb88: 6700 ff1c beqw 4baa6 return 0; p1 = (block_p *) p[ triply ]; 4bb8c: 2240 moveal %d0,%a1 4bb8e: 2071 2c00 moveal %a1@(00000000,%d2:l:4),%a0 if ( !p1 ) 4bb92: 4a88 tstl %a0 4bb94: 6700 ff10 beqw 4baa6 return 0; p2 = (block_p *)p1[ doubly ]; 4bb98: 2070 4c00 moveal %a0@(00000000,%d4:l:4),%a0 if ( !p2 ) 4bb9c: 4a88 tstl %a0 4bb9e: 6700 ff06 beqw 4baa6 return 0; return (block_p *)&p2[ singly ]; 4bba2: 41f0 3c00 lea %a0@(00000000,%d3:l:4),%a0 /* * This means the requested block number is out of range. */ return 0; } 4bba6: 2008 movel %a0,%d0 4bba8: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 4bbae: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004bbb2 : * 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 ) { 4bbb2: 7005 moveq #5,%d0 IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 4bbb4: 4e56 ffd0 linkw %fp,#-48 4bbb8: 226e 0018 moveal %fp@(24),%a1 4bbbc: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4bbc0: 246e 0008 moveal %fp@(8),%a2 4bbc4: 266e 0014 moveal %fp@(20),%a3 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 4bbc8: 206a 004a moveal %a2@(74),%a0 4bbcc: 242e 000c movel %fp@(12),%d2 4bbd0: 262e 0010 movel %fp@(16),%d3 * 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 ) { 4bbd4: b090 cmpl %a0@,%d0 4bbd6: 6654 bnes 4bc2c unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) 4bbd8: 2a49 moveal %a1,%a5 4bbda: 99cc subal %a4,%a4 4bbdc: 282a 004e movel %a2@(78),%d4 4bbe0: 2a2a 0052 movel %a2@(82),%d5 my_length = length; if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) { unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; 4bbe4: 206a 0056 moveal %a2@(86),%a0 if (my_length > (the_jnode->info.linearfile.size - start)) 4bbe8: 2004 movel %d4,%d0 4bbea: 2205 movel %d5,%d1 4bbec: 2c0c movel %a4,%d6 4bbee: 2e0d movel %a5,%d7 4bbf0: 9283 subl %d3,%d1 4bbf2: 9182 subxl %d2,%d0 4bbf4: 9e81 subl %d1,%d7 4bbf6: 9d80 subxl %d0,%d6 4bbf8: 6f06 bles 4bc00 <== NEVER TAKEN my_length = the_jnode->info.linearfile.size - start; 4bbfa: 2805 movel %d5,%d4 4bbfc: 9883 subl %d3,%d4 4bbfe: 6002 bras 4bc02 /* * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; 4bc00: 2809 movel %a1,%d4 <== 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); 4bc02: 2f04 movel %d4,%sp@- 4bc04: 4870 3800 pea %a0@(00000000,%d3:l) 4bc08: 2f0b movel %a3,%sp@- 4bc0a: 4eb9 0004 d7b8 jsr 4d7b8 IMFS_update_atime( the_jnode ); 4bc10: 42a7 clrl %sp@- 4bc12: 486e fff8 pea %fp@(-8) 4bc16: 4eb9 0004 2ae8 jsr 42ae8 4bc1c: 256e fff8 003e movel %fp@(-8),%a2@(62) return my_length; 4bc22: 2004 movel %d4,%d0 4bc24: 4fef 0014 lea %sp@(20),%sp 4bc28: 6000 012c braw 4bd56 /* * 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; 4bc2c: 2c09 movel %a1,%d6 4bc2e: dc83 addl %d3,%d6 if ( last_byte > the_jnode->info.file.size ) 4bc30: 2a06 movel %d6,%d5 4bc32: 4284 clrl %d4 4bc34: 202a 004e movel %a2@(78),%d0 4bc38: 222a 0052 movel %a2@(82),%d1 4bc3c: 2c04 movel %d4,%d6 4bc3e: 2e05 movel %d5,%d7 4bc40: 9e81 subl %d1,%d7 4bc42: 9d80 subxl %d0,%d6 4bc44: 6f06 bles 4bc4c my_length = the_jnode->info.file.size - start; 4bc46: 2c01 movel %d1,%d6 4bc48: 9c83 subl %d3,%d6 4bc4a: 6002 bras 4bc4e /* * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; 4bc4c: 2c09 movel %a1,%d6 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4bc4e: 2879 0005 e5bc moveal 5e5bc ,%a4 4bc54: 2a0c movel %a4,%d5 4bc56: 5bc4 smi %d4 4bc58: 49c4 extbl %d4 4bc5a: 2f05 movel %d5,%sp@- 4bc5c: 2f04 movel %d4,%sp@- 4bc5e: 2f03 movel %d3,%sp@- 4bc60: 2f02 movel %d2,%sp@- 4bc62: 4eb9 0005 9ab4 jsr 59ab4 <__moddi3> 4bc68: 4fef 0010 lea %sp@(16),%sp 4bc6c: 2e01 movel %d1,%d7 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4bc6e: 2f05 movel %d5,%sp@- 4bc70: 2f04 movel %d4,%sp@- 4bc72: 2f03 movel %d3,%sp@- 4bc74: 2f02 movel %d2,%sp@- 4bc76: 4eb9 0005 9654 jsr 59654 <__divdi3> 4bc7c: 4fef 0010 lea %sp@(16),%sp 4bc80: 2601 movel %d1,%d3 if ( start_offset ) { 4bc82: 4a87 tstl %d7 4bc84: 673c beqs 4bcc2 to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; 4bc86: 99c7 subal %d7,%a4 4bc88: 2406 movel %d6,%d2 4bc8a: b9c6 cmpal %d6,%a4 4bc8c: 6402 bccs 4bc90 4bc8e: 240c movel %a4,%d2 if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4bc90: 42a7 clrl %sp@- 4bc92: 2f03 movel %d3,%sp@- 4bc94: 2f0a movel %a2,%sp@- 4bc96: 4eb9 0004 ba6c jsr 4ba6c if ( !block_ptr ) 4bc9c: 4fef 000c lea %sp@(12),%sp 4bca0: 4a80 tstl %d0 4bca2: 6700 00b0 beqw 4bd54 return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); 4bca6: 2f02 movel %d2,%sp@- 4bca8: 2040 moveal %d0,%a0 4bcaa: de90 addl %a0@,%d7 dest += to_copy; block++; 4bcac: 5283 addql #1,%d3 my_length -= to_copy; 4bcae: 9c82 subl %d2,%d6 if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); 4bcb0: 2f07 movel %d7,%sp@- 4bcb2: 2f0b movel %a3,%sp@- dest += to_copy; 4bcb4: d7c2 addal %d2,%a3 if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); 4bcb6: 4eb9 0004 d7b8 jsr 4d7b8 dest += to_copy; block++; my_length -= to_copy; 4bcbc: 4fef 000c lea %sp@(12),%sp 4bcc0: 6002 bras 4bcc4 */ last_byte = start + length; if ( last_byte > the_jnode->info.file.size ) my_length = the_jnode->info.file.size - start; copied = 0; 4bcc2: 4282 clrl %d2 } /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4bcc4: 2839 0005 e5bc movel 5e5bc ,%d4 * 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( 4bcca: 97c2 subal %d2,%a3 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4bccc: 49f9 0004 ba6c lea 4ba6c ,%a4 if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 4bcd2: 4bf9 0004 d7b8 lea 4d7b8 ,%a5 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 4bcd8: 6026 bras 4bd00 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4bcda: 42a7 clrl %sp@- 4bcdc: 2f03 movel %d3,%sp@- 4bcde: 2f0a movel %a2,%sp@- 4bce0: 4e94 jsr %a4@ if ( !block_ptr ) 4bce2: 4fef 000c lea %sp@(12),%sp 4bce6: 4a80 tstl %d0 4bce8: 6602 bnes 4bcec <== ALWAYS TAKEN 4bcea: 6038 bras 4bd24 <== NOT EXECUTED return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 4bcec: 2040 moveal %d0,%a0 dest += to_copy; block++; 4bcee: 5283 addql #1,%d3 my_length -= to_copy; 4bcf0: 9c84 subl %d4,%d6 copied += to_copy; 4bcf2: d484 addl %d4,%d2 to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 4bcf4: 2f04 movel %d4,%sp@- 4bcf6: 2f10 movel %a0@,%sp@- 4bcf8: 2f05 movel %d5,%sp@- 4bcfa: 4e95 jsr %a5@ dest += to_copy; block++; my_length -= to_copy; copied += to_copy; 4bcfc: 4fef 000c lea %sp@(12),%sp * 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( 4bd00: 2a0b movel %a3,%d5 4bd02: da82 addl %d2,%d5 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 4bd04: bcb9 0005 e5bc cmpl 5e5bc ,%d6 4bd0a: 64ce bccs 4bcda /* * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { 4bd0c: 4a86 tstl %d6 4bd0e: 672c beqs 4bd3c block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4bd10: 42a7 clrl %sp@- 4bd12: 2f03 movel %d3,%sp@- 4bd14: 2f0a movel %a2,%sp@- 4bd16: 4eb9 0004 ba6c jsr 4ba6c if ( !block_ptr ) 4bd1c: 4fef 000c lea %sp@(12),%sp 4bd20: 4a80 tstl %d0 4bd22: 6604 bnes 4bd28 <== ALWAYS TAKEN return copied; 4bd24: 2002 movel %d2,%d0 <== NOT EXECUTED 4bd26: 602e bras 4bd56 <== NOT EXECUTED memcpy( dest, &(*block_ptr)[ 0 ], my_length ); 4bd28: 2040 moveal %d0,%a0 copied += my_length; 4bd2a: d486 addl %d6,%d2 if ( my_length ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); 4bd2c: 2f06 movel %d6,%sp@- 4bd2e: 2f10 movel %a0@,%sp@- 4bd30: 2f05 movel %d5,%sp@- 4bd32: 4eb9 0004 d7b8 jsr 4d7b8 copied += my_length; 4bd38: 4fef 000c lea %sp@(12),%sp } IMFS_update_atime( the_jnode ); 4bd3c: 42a7 clrl %sp@- 4bd3e: 486e fff8 pea %fp@(-8) 4bd42: 4eb9 0004 2ae8 jsr 42ae8 4bd48: 256e fff8 003e movel %fp@(-8),%a2@(62) return copied; 4bd4e: 2002 movel %d2,%d0 4bd50: 508f addql #8,%sp 4bd52: 6002 bras 4bd56 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 ) return copied; 4bd54: 4280 clrl %d0 <== NOT EXECUTED } IMFS_update_atime( the_jnode ); return copied; } 4bd56: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5 4bd5c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004be4e : * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { 4be4e: 4e56 ffe4 linkw %fp,#-28 4be52: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@ /* * Eventually this could be set smarter at each call to * memfile_free_blocks_in_table to greatly speed this up. */ to_free = IMFS_MEMFILE_BLOCK_SLOTS; 4be56: 2439 0005 e5bc movel 5e5bc ,%d2 4be5c: e48a lsrl #2,%d2 * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { 4be5e: 246e 0008 moveal %fp@(8),%a2 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 4be62: 4aaa 0056 tstl %a2@(86) 4be66: 670c beqs 4be74 memfile_free_blocks_in_table( &info->indirect, to_free ); 4be68: 2f02 movel %d2,%sp@- 4be6a: 486a 0056 pea %a2@(86) 4be6e: 4eba ff9a jsr %pc@(4be0a ) 4be72: 508f addql #8,%sp } if ( info->doubly_indirect ) { 4be74: 4aaa 005a tstl %a2@(90) 4be78: 661c bnes 4be96 4be7a: 6038 bras 4beb4 * 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( 4be7c: 2003 movel %d3,%d0 4be7e: e588 lsll #2,%d0 memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; idoubly_indirect[i] ) { 4be80: 206a 005a moveal %a2@(90),%a0 4be84: d1c0 addal %d0,%a0 4be86: 4a90 tstl %a0@ 4be88: 6708 beqs 4be92 <== NEVER TAKEN memfile_free_blocks_in_table( 4be8a: 2f02 movel %d2,%sp@- 4be8c: 2f08 movel %a0,%sp@- 4be8e: 4e93 jsr %a3@ 4be90: 508f addql #8,%sp if ( info->indirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; i if ( info->indirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { 4be96: 4283 clrl %d3 for ( i=0 ; idoubly_indirect[i] ) { memfile_free_blocks_in_table( 4be98: 47fa ff70 lea %pc@(4be0a ),%a3 if ( info->indirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; i,%d0 4bea2: e488 lsrl #2,%d0 4bea4: b083 cmpl %d3,%d0 4bea6: 62d4 bhis 4be7c 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 ); 4bea8: 2f02 movel %d2,%sp@- 4beaa: 486a 005a pea %a2@(90) 4beae: 4eba ff5a jsr %pc@(4be0a ) 4beb2: 508f addql #8,%sp } if ( info->triply_indirect ) { 4beb4: 4283 clrl %d3 p = (block_p *) info->triply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j),%a3 } memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { 4beba: 4aaa 005e tstl %a2@(94) 4bebe: 6640 bnes 4bf00 4bec0: 6056 bras 4bf18 * 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( 4bec2: 2c03 movel %d3,%d6 } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; 4bec4: 206a 005e moveal %a2@(94),%a0 * 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( 4bec8: e58e lsll #2,%d6 } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; 4beca: 2a30 6800 movel %a0@(00000000,%d6:l),%d5 if ( !p ) /* ensure we have a valid pointer */ 4bece: 673c beqs 4bf0c <== NEVER TAKEN 4bed0: 4284 clrl %d4 4bed2: 6012 bras 4bee6 break; for ( j=0 ; j <== NEVER TAKEN memfile_free_blocks_in_table( (block_p **)&p[j], to_free); 4bedc: 2f02 movel %d2,%sp@- 4bede: 2f08 movel %a0,%sp@- 4bee0: 4e93 jsr %a3@ 4bee2: 508f addql #8,%sp if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j,%d0 4beec: e488 lsrl #2,%d0 4beee: b084 cmpl %d4,%d0 4bef0: 62e2 bhis 4bed4 if ( p[j] ) { memfile_free_blocks_in_table( (block_p **)&p[j], to_free); } } memfile_free_blocks_in_table( 4bef2: 2f02 movel %d2,%sp@- 4bef4: dcaa 005e addl %a2@(94),%d6 memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; idoubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i,%d0 4bf06: e488 lsrl #2,%d0 4bf08: b083 cmpl %d3,%d0 4bf0a: 62b6 bhis 4bec2 } } memfile_free_blocks_in_table( (block_p **)&info->triply_indirect[i], to_free ); } memfile_free_blocks_in_table( 4bf0c: 2f02 movel %d2,%sp@- 4bf0e: 486a 005e pea %a2@(94) 4bf12: 4eba fef6 jsr %pc@(4be0a ) 4bf16: 508f addql #8,%sp (block_p **)&info->triply_indirect, to_free ); } return the_jnode; } 4bf18: 200a movel %a2,%d0 4bf1a: 4cee 0c7c ffe4 moveml %fp@(-28),%d2-%d6/%a2-%a3 4bf20: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004bf24 : */ MEMFILE_STATIC int IMFS_memfile_remove_block( IMFS_jnode_t *the_jnode, unsigned int block ) { 4bf24: 4e56 0000 linkw %fp,#0 <== NOT EXECUTED block_p *block_ptr; block_p ptr; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4bf28: 42a7 clrl %sp@- <== NOT EXECUTED 4bf2a: 2f2e 000c movel %fp@(12),%sp@- <== NOT EXECUTED 4bf2e: 2f2e 0008 movel %fp@(8),%sp@- <== NOT EXECUTED 4bf32: 4eb9 0004 ba6c jsr 4ba6c <== NOT EXECUTED IMFS_assert( block_ptr ); ptr = *block_ptr; 4bf38: 2040 moveal %d0,%a0 <== NOT EXECUTED 4bf3a: 2210 movel %a0@,%d1 <== NOT EXECUTED *block_ptr = 0; 4bf3c: 4290 clrl %a0@ <== NOT EXECUTED memfile_free_block( ptr ); 4bf3e: 2f01 movel %d1,%sp@- <== NOT EXECUTED 4bf40: 4eb9 0004 bdf0 jsr 4bdf0 <== NOT EXECUTED return 1; } 4bf46: 7001 moveq #1,%d0 <== NOT EXECUTED 4bf48: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004c0ac : * 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 ) { 4c0ac: 4280 clrl %d0 IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 4c0ae: 4e56 ffd4 linkw %fp,#-44 /* * 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; 4c0b2: 206e 0010 moveal %fp@(16),%a0 IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 4c0b6: 48d7 1cfc moveml %d2-%d7/%a2-%a4,%sp@ 4c0ba: 2c2e 0018 movel %fp@(24),%d6 /* * 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; 4c0be: d1c6 addal %d6,%a0 if ( last_byte > the_jnode->info.file.size ) { 4c0c0: 2208 movel %a0,%d1 IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 4c0c2: 246e 0008 moveal %fp@(8),%a2 4c0c6: 2e2e 0014 movel %fp@(20),%d7 * 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 ) { 4c0ca: 282a 004e movel %a2@(78),%d4 4c0ce: 2a2a 0052 movel %a2@(82),%d5 4c0d2: 2400 movel %d0,%d2 4c0d4: 2601 movel %d1,%d3 4c0d6: 9685 subl %d5,%d3 4c0d8: 9584 subxl %d4,%d2 4c0da: 6e44 bgts 4c120 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4c0dc: 2879 0005 e5bc moveal 5e5bc ,%a4 4c0e2: 2a0c movel %a4,%d5 4c0e4: 5bc4 smi %d4 4c0e6: 49c4 extbl %d4 4c0e8: 2f05 movel %d5,%sp@- 4c0ea: 2f04 movel %d4,%sp@- 4c0ec: 2f2e 0010 movel %fp@(16),%sp@- 4c0f0: 2f2e 000c movel %fp@(12),%sp@- 4c0f4: 4eb9 0005 9ab4 jsr 59ab4 <__moddi3> 4c0fa: 4fef 0010 lea %sp@(16),%sp 4c0fe: 2641 moveal %d1,%a3 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4c100: 2f05 movel %d5,%sp@- 4c102: 2f04 movel %d4,%sp@- 4c104: 2f2e 0010 movel %fp@(16),%sp@- 4c108: 2f2e 000c movel %fp@(12),%sp@- 4c10c: 4eb9 0005 9654 jsr 59654 <__divdi3> 4c112: 4fef 0010 lea %sp@(16),%sp 4c116: 2601 movel %d1,%d3 if ( start_offset ) { 4c118: 4a8b tstl %a3 4c11a: 6632 bnes 4c14e status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); if ( status ) return status; } copied = 0; 4c11c: 4282 clrl %d2 4c11e: 6068 bras 4c188 last_byte = start + my_length; if ( last_byte > the_jnode->info.file.size ) { bool zero_fill = start > the_jnode->info.file.size; status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); 4c120: 2f08 movel %a0,%sp@- * 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; 4c122: b8ae 000c cmpl %fp@(12),%d4 4c126: 6608 bnes 4c130 <== NEVER TAKEN 4c128: baae 0010 cmpl %fp@(16),%d5 4c12c: 55c4 scs %d4 4c12e: 6002 bras 4c132 4c130: 5dc4 slt %d4 <== NOT EXECUTED status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); 4c132: 2f00 movel %d0,%sp@- * 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; 4c134: 49c4 extbl %d4 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); 4c136: 4484 negl %d4 4c138: 2f04 movel %d4,%sp@- 4c13a: 2f0a movel %a2,%sp@- 4c13c: 4eb9 0004 bf4c jsr 4bf4c if ( status ) 4c142: 4fef 0010 lea %sp@(16),%sp 4c146: 4a80 tstl %d0 4c148: 6792 beqs 4c0dc 4c14a: 6000 00d0 braw 4c21c * 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; 4c14e: 240c movel %a4,%d2 4c150: 948b subl %a3,%d2 4c152: bc82 cmpl %d2,%d6 4c154: 6402 bccs 4c158 4c156: 2406 movel %d6,%d2 if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4c158: 42a7 clrl %sp@- 4c15a: 2f03 movel %d3,%sp@- 4c15c: 2f0a movel %a2,%sp@- 4c15e: 4eb9 0004 ba6c jsr 4ba6c if ( !block_ptr ) 4c164: 4fef 000c lea %sp@(12),%sp 4c168: 4a80 tstl %d0 4c16a: 6700 00aa beqw 4c216 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); 4c16e: 2f02 movel %d2,%sp@- 4c170: 2040 moveal %d0,%a0 src += to_copy; block++; 4c172: 5283 addql #1,%d3 my_length -= to_copy; 4c174: 9c82 subl %d2,%d6 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); 4c176: 2f07 movel %d7,%sp@- 4c178: d7d0 addal %a0@,%a3 src += to_copy; 4c17a: de82 addl %d2,%d7 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); 4c17c: 2f0b movel %a3,%sp@- 4c17e: 4eb9 0004 d7b8 jsr 4d7b8 src += to_copy; block++; my_length -= to_copy; copied += to_copy; 4c184: 4fef 000c lea %sp@(12),%sp /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4c188: 2839 0005 e5bc movel 5e5bc ,%d4 * 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( 4c18e: 9e82 subl %d2,%d7 * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4c190: 47f9 0004 ba6c lea 4ba6c ,%a3 if ( !block_ptr ) return copied; #if 0 fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src ); #endif memcpy( &(*block_ptr)[ 0 ], src, to_copy ); 4c196: 49f9 0004 d7b8 lea 4d7b8 ,%a4 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 4c19c: 6024 bras 4c1c2 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4c19e: 42a7 clrl %sp@- 4c1a0: 2f03 movel %d3,%sp@- 4c1a2: 2f0a movel %a2,%sp@- 4c1a4: 4e93 jsr %a3@ if ( !block_ptr ) 4c1a6: 4fef 000c lea %sp@(12),%sp 4c1aa: 4a80 tstl %d0 4c1ac: 676c beqs 4c21a <== 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 ); 4c1ae: 2f04 movel %d4,%sp@- 4c1b0: 2040 moveal %d0,%a0 src += to_copy; block++; 4c1b2: 5283 addql #1,%d3 my_length -= to_copy; 4c1b4: 9c84 subl %d4,%d6 * 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( 4c1b6: d484 addl %d4,%d2 if ( !block_ptr ) return copied; #if 0 fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src ); #endif memcpy( &(*block_ptr)[ 0 ], src, to_copy ); 4c1b8: 2f05 movel %d5,%sp@- 4c1ba: 2f10 movel %a0@,%sp@- 4c1bc: 4e94 jsr %a4@ * 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( 4c1be: 4fef 000c lea %sp@(12),%sp 4c1c2: 2a07 movel %d7,%d5 4c1c4: da82 addl %d2,%d5 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 4c1c6: bcb9 0005 e5bc cmpl 5e5bc ,%d6 4c1cc: 64d0 bccs 4c19e * 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 ) { 4c1ce: 4a86 tstl %d6 4c1d0: 6728 beqs 4c1fa block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4c1d2: 42a7 clrl %sp@- 4c1d4: 2f03 movel %d3,%sp@- 4c1d6: 2f0a movel %a2,%sp@- 4c1d8: 4eb9 0004 ba6c jsr 4ba6c if ( !block_ptr ) 4c1de: 4fef 000c lea %sp@(12),%sp 4c1e2: 4a80 tstl %d0 4c1e4: 6734 beqs 4c21a <== 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 ); 4c1e6: 2f06 movel %d6,%sp@- 4c1e8: 2040 moveal %d0,%a0 my_length = 0; copied += to_copy; 4c1ea: d486 addl %d6,%d2 if ( !block_ptr ) return copied; #if 0 fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src ); #endif memcpy( &(*block_ptr)[ 0 ], src, my_length ); 4c1ec: 2f05 movel %d5,%sp@- 4c1ee: 2f10 movel %a0@,%sp@- 4c1f0: 4eb9 0004 d7b8 jsr 4d7b8 my_length = 0; copied += to_copy; 4c1f6: 4fef 000c lea %sp@(12),%sp } IMFS_mtime_ctime_update( the_jnode ); 4c1fa: 42a7 clrl %sp@- 4c1fc: 486e fff8 pea %fp@(-8) 4c200: 4eb9 0004 2ae8 jsr 42ae8 4c206: 202e fff8 movel %fp@(-8),%d0 return copied; 4c20a: 508f addql #8,%sp memcpy( &(*block_ptr)[ 0 ], src, my_length ); my_length = 0; copied += to_copy; } IMFS_mtime_ctime_update( the_jnode ); 4c20c: 2540 0042 movel %d0,%a2@(66) 4c210: 2540 0046 movel %d0,%a2@(70) 4c214: 6004 bras 4c21a 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 ) return copied; 4c216: 4280 clrl %d0 <== NOT EXECUTED 4c218: 6002 bras 4c21c <== NOT EXECUTED IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); to_copy = my_length; if ( my_length ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) 4c21a: 2002 movel %d2,%d0 } IMFS_mtime_ctime_update( the_jnode ); return copied; } 4c21c: 4cee 1cfc ffd4 moveml %fp@(-44),%d2-%d7/%a2-%a4 4c222: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000423b0 : const char *name, size_t namelen, mode_t mode, dev_t dev ) { 423b0: 4e56 ffd8 linkw %fp,#-40 423b4: 226e 0018 moveal %fp@(24),%a1 423b8: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 423bc: 242e 0014 movel %fp@(20),%d2 dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { 423c0: 2002 movel %d2,%d0 423c2: 0280 0000 f000 andil #61440,%d0 const char *name, size_t namelen, mode_t mode, dev_t dev ) { 423c8: 246e 0008 moveal %fp@(8),%a2 423cc: 206e 001c moveal %fp@(28),%a0 dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { 423d0: 0c80 0000 4000 cmpil #16384,%d0 423d6: 672e beqs 42406 *type = IMFS_DIRECTORY; } else if ( S_ISREG( mode ) ) { 423d8: 0c80 0000 8000 cmpil #32768,%d0 423de: 672a beqs 4240a *type = IMFS_MEMORY_FILE; } else if ( S_ISBLK( mode ) || S_ISCHR( mode ) ) { 423e0: 0c80 0000 6000 cmpil #24576,%d0 423e6: 6708 beqs 423f0 423e8: 0c80 0000 2000 cmpil #8192,%d0 423ee: 660c bnes 423fc *type = IMFS_DEVICE; rtems_filesystem_split_dev_t( 423f0: 2d49 ffec movel %a1,%fp@(-20) 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; 423f4: 7201 moveq #1,%d1 rtems_filesystem_split_dev_t( 423f6: 2d48 fff0 movel %a0,%fp@(-16) 423fa: 6014 bras 42410 dev, info->device.major, info->device.minor ); } else if (S_ISFIFO( mode )) { 423fc: 0c80 0000 1000 cmpil #4096,%d0 42402: 660c bnes 42410 <== NEVER TAKEN 42404: 6008 bras 4240e IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { *type = IMFS_DIRECTORY; 42406: 4281 clrl %d1 42408: 6006 bras 42410 } else if ( S_ISREG( mode ) ) { *type = IMFS_MEMORY_FILE; 4240a: 7204 moveq #4,%d1 4240c: 6002 bras 42410 dev, info->device.major, info->device.minor ); } else if (S_ISFIFO( mode )) { *type = IMFS_FIFO; 4240e: 7206 moveq #6,%d1 42410: 486e ffec pea %fp@(-20) 42414: 2f02 movel %d2,%sp@- 42416: 2f2e 0010 movel %fp@(16),%sp@- 4241a: 2f2e 000c movel %fp@(12),%sp@- size_t namelen, mode_t mode, const IMFS_types_union *info ) { const IMFS_fs_info_t *fs_info = 4241e: 206a 0014 moveal %a2@(20),%a0 (const IMFS_fs_info_t *) parentloc->mt_entry->fs_info; return IMFS_create_node_with_control( 42422: 2068 0008 moveal %a0@(8),%a0 42426: 2f30 1c08 movel %a0@(00000008,%d1:l:4),%sp@- 4242a: 2f0a movel %a2,%sp@- 4242c: 4eb9 0004 993c jsr 4993c 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 ) { 42432: 4fef 0018 lea %sp@(24),%sp 42436: 4a80 tstl %d0 42438: 6732 beqs 4246c IMFS_jnode_t *parent = parentloc->node_access; 4243a: 246a 0008 moveal %a2@(8),%a2 IMFS_update_ctime( parent ); 4243e: 240e movel %fp,%d2 42440: 0682 ffff ffe4 addil #-28,%d2 42446: 47f9 0004 2ae8 lea 42ae8 ,%a3 4244c: 42a7 clrl %sp@- 4244e: 2f02 movel %d2,%sp@- 42450: 4e93 jsr %a3@ 42452: 256e ffe4 0046 movel %fp@(-28),%a2@(70) IMFS_update_mtime( parent ); 42458: 42a7 clrl %sp@- 4245a: 2f02 movel %d2,%sp@- 4245c: 4e93 jsr %a3@ 4245e: 256e ffe4 0042 movel %fp@(-28),%a2@(66) 42464: 4fef 0010 lea %sp@(16),%sp size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; 42468: 4280 clrl %d0 4246a: 6002 bras 4246e IMFS_jnode_t *parent = parentloc->node_access; IMFS_update_ctime( parent ); IMFS_update_mtime( parent ); } else { rv = -1; 4246c: 70ff moveq #-1,%d0 } return rv; } 4246e: 4cee 0c04 ffd8 moveml %fp@(-40),%d2/%a2-%a3 42474: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00042478 : #endif #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 42478: 4e56 0000 linkw %fp,#0 4247c: 226e 0008 moveal %fp@(8),%a1 int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 42480: 2069 0020 moveal %a1@(32),%a0 42484: 2068 0008 moveal %a0@(8),%a0 #endif #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 42488: 2f0a movel %a2,%sp@- int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; if ( IMFS_is_directory( node ) ) { 4248a: 2468 004a moveal %a0@(74),%a2 4248e: 4a92 tstl %a2@ 42490: 661c bnes 424ae if ( node->info.directory.mt_fs == NULL ) { 42492: 4aa8 005a tstl %a0@(90) 42496: 6608 bnes 424a0 <== NEVER TAKEN node->info.directory.mt_fs = mt_entry; 42498: 2149 005a movel %a1,%a0@(90) #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; 4249c: 4280 clrl %d0 4249e: 601c bras 424bc if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == NULL ) { node->info.directory.mt_fs = mt_entry; } else { errno = EBUSY; 424a0: 4eb9 0004 cf98 jsr 4cf98 <__errno> <== NOT EXECUTED 424a6: 7210 moveq #16,%d1 <== NOT EXECUTED 424a8: 2040 moveal %d0,%a0 <== NOT EXECUTED 424aa: 2081 movel %d1,%a0@ <== NOT EXECUTED 424ac: 600c bras 424ba <== NOT EXECUTED rv = -1; } } else { errno = ENOTDIR; 424ae: 4eb9 0004 cf98 jsr 4cf98 <__errno> 424b4: 2440 moveal %d0,%a2 424b6: 7014 moveq #20,%d0 424b8: 2480 movel %d0,%a2@ rv = -1; 424ba: 70ff moveq #-1,%d0 } return rv; } 424bc: 246e fffc moveal %fp@(-4),%a2 424c0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049d6a : } static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { 49d6a: 4e56 0000 linkw %fp,#0 49d6e: 202e 0008 movel %fp@(8),%d0 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 49d72: 2200 movel %d0,%d1 49d74: 0681 0000 0052 addil #82,%d1 if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { 49d7a: 2040 moveal %d0,%a0 49d7c: b2a8 004e cmpl %a0@(78),%d1 49d80: 670e beqs 49d90 errno = ENOTEMPTY; 49d82: 4eb9 0004 cf98 jsr 4cf98 <__errno> 49d88: 725a moveq #90,%d1 49d8a: 2040 moveal %d0,%a0 49d8c: 2081 movel %d1,%a0@ 49d8e: 6014 bras 49da4 node = NULL; } else if ( IMFS_is_mount_point( node ) ) { 49d90: 2040 moveal %d0,%a0 49d92: 4aa8 005a tstl %a0@(90) 49d96: 670e beqs 49da6 <== ALWAYS TAKEN errno = EBUSY; 49d98: 4eb9 0004 cf98 jsr 4cf98 <__errno> <== NOT EXECUTED 49d9e: 2040 moveal %d0,%a0 <== NOT EXECUTED 49da0: 7010 moveq #16,%d0 <== NOT EXECUTED 49da2: 2080 movel %d0,%a0@ <== NOT EXECUTED 49da4: 4280 clrl %d0 node = NULL; } return node; } 49da6: 4e5e unlk %fp ... =============================================================================== 000424c4 : { 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 ) { 424c4: 7202 moveq #2,%d1 #include "imfs.h" rtems_filesystem_node_types_t IMFS_node_type( const rtems_filesystem_location_info_t *loc ) { 424c6: 4e56 0000 linkw %fp,#0 const IMFS_jnode_t *node = loc->node_access; 424ca: 206e 0008 moveal %fp@(8),%a0 424ce: 2068 0008 moveal %a0@(8),%a0 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 424d2: 2268 004a moveal %a0@(74),%a1 424d6: 2011 movel %a1@,%d0 IMFS_jnode_types_t imfs_type = IMFS_type( node ); rtems_filesystem_node_types_t type; switch ( imfs_type ) { 424d8: b280 cmpl %d0,%d1 424da: 670c beqs 424e8 424dc: 123c 0005 moveb #5,%d1 424e0: b280 cmpl %d0,%d1 424e2: 660e bnes 424f2 <== ALWAYS TAKEN case IMFS_HARD_LINK: type = IMFS_type( node->info.hard_link.link_node ); break; case IMFS_LINEAR_FILE: type = RTEMS_FILESYSTEM_MEMORY_FILE; 424e4: 7004 moveq #4,%d0 <== NOT EXECUTED 424e6: 600a bras 424f2 <== NOT EXECUTED type = imfs_type; break; } return type; } 424e8: 2068 004e moveal %a0@(78),%a0 424ec: 2068 004a moveal %a0@(74),%a0 424f0: 2010 movel %a0@,%d0 424f2: 4e5e unlk %fp ... =============================================================================== 0004252c : const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { 4252c: 4e56 ffec linkw %fp,#-20 int rv = 0; IMFS_jnode_t *node = oldloc->node_access; 42530: 206e 000c moveal %fp@(12),%a0 const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { 42534: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ int rv = 0; IMFS_jnode_t *node = oldloc->node_access; 42538: 2468 0008 moveal %a0@(8),%a2 IMFS_jnode_t *new_parent = newparentloc->node_access; 4253c: 206e 0010 moveal %fp@(16),%a0 const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { 42540: 242e 0018 movel %fp@(24),%d2 int rv = 0; IMFS_jnode_t *node = oldloc->node_access; IMFS_jnode_t *new_parent = newparentloc->node_access; 42544: 2668 0008 moveal %a0@(8),%a3 /* * FIXME: Due to insufficient checks we can create inaccessible nodes with * this operation. */ if ( node->Parent != NULL ) { 42548: 4aaa 0008 tstl %a2@(8) 4254c: 6768 beqs 425b6 <== NEVER TAKEN if ( namelen < IMFS_NAME_MAX ) { 4254e: 701f moveq #31,%d0 42550: b082 cmpl %d2,%d0 42552: 6554 bcss 425a8 <== NEVER TAKEN memcpy( node->name, name, namelen ); 42554: 2f02 movel %d2,%sp@- 42556: 2f2e 0014 movel %fp@(20),%sp@- 4255a: 486a 000c pea %a2@(12) 4255e: 4eb9 0004 d7b8 jsr 4d7b8 node->name [namelen] = '\0'; 42564: 4200 clrb %d0 42566: 1580 280c moveb %d0,%a2@(0000000c,%d2:l) ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4256a: 2252 moveal %a2@,%a1 previous = the_node->previous; 4256c: 206a 0004 moveal %a2@(4),%a0 next->previous = previous; 42570: 2348 0004 movel %a0,%a1@(4) previous->next = next; 42574: 2089 movel %a1,%a0@ Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 42576: 206b 0056 moveal %a3@(86),%a0 RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 4257a: 43eb 0052 lea %a3@(82),%a1 static inline void IMFS_add_to_directory( IMFS_jnode_t *dir, IMFS_jnode_t *node ) { node->Parent = dir; 4257e: 254b 0008 movel %a3,%a2@(8) 42582: 2489 movel %a1,%a2@ Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 42584: 274a 0056 movel %a2,%a3@(86) old_last->next = the_node; 42588: 208a movel %a2,%a0@ the_node->previous = old_last; 4258a: 2548 0004 movel %a0,%a2@(4) IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); 4258e: 42a7 clrl %sp@- 42590: 486e fff8 pea %fp@(-8) 42594: 4eb9 0004 2ae8 jsr 42ae8 4259a: 256e fff8 0046 movel %fp@(-8),%a2@(70) 425a0: 4fef 0014 lea %sp@(20),%sp const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { int rv = 0; 425a4: 4280 clrl %d0 425a6: 601c bras 425c4 IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); } else { errno = ENAMETOOLONG; 425a8: 4eb9 0004 cf98 jsr 4cf98 <__errno> <== NOT EXECUTED 425ae: 725b moveq #91,%d1 <== NOT EXECUTED 425b0: 2040 moveal %d0,%a0 <== NOT EXECUTED 425b2: 2081 movel %d1,%a0@ <== NOT EXECUTED 425b4: 600c bras 425c2 <== NOT EXECUTED rv = -1; } } else { errno = EINVAL; 425b6: 4eb9 0004 cf98 jsr 4cf98 <__errno> <== NOT EXECUTED 425bc: 2240 moveal %d0,%a1 <== NOT EXECUTED 425be: 7016 moveq #22,%d0 <== NOT EXECUTED 425c0: 2280 movel %d0,%a1@ <== NOT EXECUTED rv = -1; 425c2: 70ff moveq #-1,%d0 <== NOT EXECUTED } return rv; } 425c4: 4cee 0c04 ffec moveml %fp@(-20),%d2/%a2-%a3 425ca: 4e5e unlk %fp ... =============================================================================== 00049cd4 : static int IMFS_stat_device( const rtems_filesystem_location_info_t *loc, struct stat *buf ) { 49cd4: 4e56 0000 linkw %fp,#0 49cd8: 226e 0008 moveal %fp@(8),%a1 49cdc: 2f0a movel %a2,%sp@- const IMFS_jnode_t *node = loc->node_access; 49cde: 2469 0008 moveal %a1@(8),%a2 static int IMFS_stat_device( const rtems_filesystem_location_info_t *loc, struct stat *buf ) { 49ce2: 206e 000c moveal %fp@(12),%a0 const IMFS_jnode_t *node = loc->node_access; const IMFS_device_t *io = &node->info.device; buf->st_rdev = rtems_filesystem_make_dev_t( io->major, io->minor ); 49ce6: 202a 0052 movel %a2@(82),%d0 49cea: 216a 004e 0016 movel %a2@(78),%a0@(22) return IMFS_stat( loc, buf ); } 49cf0: 245f moveal %sp@+,%a2 49cf2: 4e5e unlk %fp ) { const IMFS_jnode_t *node = loc->node_access; const IMFS_device_t *io = &node->info.device; buf->st_rdev = rtems_filesystem_make_dev_t( io->major, io->minor ); 49cf4: 2140 001a movel %d0,%a0@(26) return IMFS_stat( loc, buf ); 49cf8: 4ef9 0004 9f0c jmp 49f0c ... =============================================================================== 00049ed4 : static int IMFS_stat_file( const rtems_filesystem_location_info_t *loc, struct stat *buf ) { 49ed4: 4e56 0000 linkw %fp,#0 49ed8: 226e 0008 moveal %fp@(8),%a1 49edc: 2f0a movel %a2,%sp@- const IMFS_jnode_t *node = loc->node_access; buf->st_size = node->info.file.size; 49ede: 2469 0008 moveal %a1@(8),%a2 static int IMFS_stat_file( const rtems_filesystem_location_info_t *loc, struct stat *buf ) { 49ee2: 206e 000c moveal %fp@(12),%a0 const IMFS_jnode_t *node = loc->node_access; buf->st_size = node->info.file.size; 49ee6: 202a 004e movel %a2@(78),%d0 49eea: 222a 0052 movel %a2@(82),%d1 buf->st_blksize = imfs_rq_memfile_bytes_per_block; 49eee: 45f9 0005 d69c lea 5d69c ,%a2 49ef4: 2152 003e movel %a2@,%a0@(62) return IMFS_stat( loc, buf ); } 49ef8: 245f moveal %sp@+,%a2 49efa: 4e5e unlk %fp struct stat *buf ) { const IMFS_jnode_t *node = loc->node_access; buf->st_size = node->info.file.size; 49efc: 2140 001e movel %d0,%a0@(30) 49f00: 2141 0022 movel %d1,%a0@(34) buf->st_blksize = imfs_rq_memfile_bytes_per_block; return IMFS_stat( loc, buf ); 49f04: 4ef9 0004 9f0c jmp 49f0c ... =============================================================================== 000426a8 : #endif #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 426a8: 4e56 0000 linkw %fp,#0 426ac: 226e 0008 moveal %fp@(8),%a1 int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 426b0: 2069 0020 moveal %a1@(32),%a0 426b4: 2068 0008 moveal %a0@(8),%a0 #endif #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 426b8: 2f0a movel %a2,%sp@- int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; if ( IMFS_is_directory( node ) ) { 426ba: 2468 004a moveal %a0@(74),%a2 426be: 4a92 tstl %a2@ 426c0: 661c bnes 426de <== NEVER TAKEN if ( node->info.directory.mt_fs == mt_entry ) { 426c2: b3e8 005a cmpal %a0@(90),%a1 426c6: 6608 bnes 426d0 <== NEVER TAKEN node->info.directory.mt_fs = NULL; 426c8: 42a8 005a clrl %a0@(90) #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; 426cc: 4280 clrl %d0 426ce: 601c bras 426ec if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == mt_entry ) { node->info.directory.mt_fs = NULL; } else { errno = EINVAL; 426d0: 4eb9 0004 cf98 jsr 4cf98 <__errno> <== NOT EXECUTED 426d6: 7216 moveq #22,%d1 <== NOT EXECUTED 426d8: 2040 moveal %d0,%a0 <== NOT EXECUTED 426da: 2081 movel %d1,%a0@ <== NOT EXECUTED 426dc: 600c bras 426ea <== NOT EXECUTED rv = -1; } } else { errno = ENOTDIR; 426de: 4eb9 0004 cf98 jsr 4cf98 <__errno> <== NOT EXECUTED 426e4: 2440 moveal %d0,%a2 <== NOT EXECUTED 426e6: 7014 moveq #20,%d0 <== NOT EXECUTED 426e8: 2480 movel %d0,%a2@ <== NOT EXECUTED rv = -1; 426ea: 70ff moveq #-1,%d0 <== NOT EXECUTED } return rv; } 426ec: 246e fffc moveal %fp@(-4),%a2 426f0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00042ca0 : void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 42ca0: 4e56 fff0 linkw %fp,#-16 42ca4: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ Heap_Control *heap = RTEMS_Malloc_Heap; 42ca8: 2639 0005 d65c movel 5d65c ,%d3 if ( !rtems_configuration_get_unified_work_area() ) { 42cae: 4a39 0005 b885 tstb 5b885 42cb4: 664a bnes 42d00 42cb6: 246e 0008 moveal %fp@(8),%a2 42cba: 4282 clrl %d2 42cbc: 47f9 0004 735c lea 4735c <_Heap_Initialize>,%a3 42cc2: 601e bras 42ce2 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)( 42cc4: 4878 0004 pea 4 42cc8: 2f2a 0004 movel %a2@(4),%sp@- 42ccc: 2f12 movel %a2@,%sp@- 42cce: 2f03 movel %d3,%sp@- 42cd0: 4e93 jsr %a3@ area->begin, area->size, page_size ); if ( space_available > 0 ) { 42cd2: 4fef 0010 lea %sp@(16),%sp 42cd6: 4a80 tstl %d0 42cd8: 6704 beqs 42cde <== NEVER TAKEN init_or_extend = extend; 42cda: 266e 0010 moveal %fp@(16),%a3 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) { 42cde: 5282 addql #1,%d2 42ce0: 508a addql #8,%a2 42ce2: b4ae 000c cmpl %fp@(12),%d2 42ce6: 66dc bnes 42cc4 if ( space_available > 0 ) { init_or_extend = extend; } } if ( init_or_extend == _Heap_Initialize ) { 42ce8: b7fc 0004 735c cmpal #291676,%a3 42cee: 6610 bnes 42d00 _Internal_error_Occurred( 42cf0: 4878 0017 pea 17 42cf4: 4878 0001 pea 1 42cf8: 42a7 clrl %sp@- 42cfa: 4eb9 0004 7550 jsr 47550 <_Internal_error_Occurred> } /* * If configured, initialize the statistics support */ if ( rtems_malloc_statistics_helpers != NULL ) { 42d00: 2079 0005 dd90 moveal 5dd90 ,%a0 42d06: 4a88 tstl %a0 42d08: 6704 beqs 42d0e (*rtems_malloc_statistics_helpers->initialize)(); 42d0a: 2050 moveal %a0@,%a0 42d0c: 4e90 jsr %a0@ } MSBUMP( space_available, _Protected_heap_Get_size( heap ) ); 42d0e: 2439 0005 edcc movel 5edcc ,%d2 42d14: 2f03 movel %d3,%sp@- 42d16: 4eb9 0004 7d9c jsr 47d9c <_Protected_heap_Get_size> 42d1c: 588f addql #4,%sp 42d1e: d082 addl %d2,%d0 } 42d20: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 */ if ( rtems_malloc_statistics_helpers != NULL ) { (*rtems_malloc_statistics_helpers->initialize)(); } MSBUMP( space_available, _Protected_heap_Get_size( heap ) ); 42d26: 23c0 0005 edcc movel %d0,5edcc } 42d2c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005cef0 : /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { 5cef0: 70ff moveq #-1,%d0 <== NOT EXECUTED static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 5cef2: 4e56 ffe0 linkw %fp,#-32 <== NOT EXECUTED 5cef6: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ <== NOT EXECUTED 5cefa: 246e 0008 moveal %fp@(8),%a2 <== NOT EXECUTED /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { 5cefe: b08a cmpl %a2,%d0 <== NOT EXECUTED 5cf00: 6616 bnes 5cf18 <== NOT EXECUTED if (!Stack_check_Interrupt_stack.area) 5cf02: 4ab9 0009 7eb4 tstl 97eb4 <== NOT EXECUTED 5cf08: 6700 00fe beqw 5d008 <== NOT EXECUTED return; stack = &Stack_check_Interrupt_stack; 5cf0c: 47f9 0009 7eb0 lea 97eb0 ,%a3 <== NOT EXECUTED the_thread = 0; current = 0; 5cf12: 4284 clrl %d4 <== NOT EXECUTED #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { if (!Stack_check_Interrupt_stack.area) return; stack = &Stack_check_Interrupt_stack; the_thread = 0; 5cf14: 95ca subal %a2,%a2 <== NOT EXECUTED 5cf16: 6008 bras 5cf20 <== NOT EXECUTED current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); 5cf18: 282a 00ee movel %a2@(238),%d4 <== NOT EXECUTED the_thread = 0; current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; 5cf1c: 47ea 00ae lea %a2@(174),%a3 <== NOT EXECUTED current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); 5cf20: 2613 movel %a3@,%d3 <== NOT EXECUTED * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 5cf22: 70fc moveq #-4,%d0 <== NOT EXECUTED 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); 5cf24: 0683 ffff fff0 addil #-16,%d3 <== NOT EXECUTED { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 5cf2a: 206b 0004 moveal %a3@(4),%a0 <== NOT EXECUTED 5cf2e: 2408 movel %a0,%d2 <== NOT EXECUTED /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; 5cf30: 41e8 0020 lea %a0@(32),%a0 <== NOT EXECUTED { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 5cf34: 0682 0000 0010 addil #16,%d2 <== NOT EXECUTED * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 5cf3a: c083 andl %d3,%d0 <== NOT EXECUTED 5cf3c: d088 addl %a0,%d0 <== NOT EXECUTED 5cf3e: 600c bras 5cf4c <== NOT EXECUTED if (*base != U32_PATTERN) 5cf40: 223c a5a5 a5a5 movel #-1515870811,%d1 <== NOT EXECUTED 5cf46: b290 cmpl %a0@,%d1 <== NOT EXECUTED 5cf48: 6608 bnes 5cf52 <== NOT EXECUTED * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 5cf4a: 5888 addql #4,%a0 <== NOT EXECUTED 5cf4c: b088 cmpl %a0,%d0 <== NOT EXECUTED 5cf4e: 62f0 bhis 5cf40 <== NOT EXECUTED 5cf50: 600a bras 5cf5c <== 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 ) 5cf52: 4a88 tstl %a0 <== NOT EXECUTED 5cf54: 6706 beqs 5cf5c <== NOT EXECUTED used = Stack_check_Calculate_used( low, size, high_water_mark ); 5cf56: d483 addl %d3,%d2 <== NOT EXECUTED 5cf58: 9488 subl %a0,%d2 <== NOT EXECUTED 5cf5a: 6002 bras 5cf5e <== NOT EXECUTED else used = 0; 5cf5c: 4282 clrl %d2 <== NOT EXECUTED 5cf5e: 2879 0009 68f4 moveal 968f4 ,%a4 <== NOT EXECUTED #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) 5cf64: 4a8a tstl %a2 <== NOT EXECUTED 5cf66: 672c beqs 5cf94 <== NOT EXECUTED #endif { (*print_handler)( 5cf68: 486e fffb pea %fp@(-5) <== NOT EXECUTED 5cf6c: 4878 0005 pea 5 <== NOT EXECUTED 5cf70: 2f2a 0008 movel %a2@(8),%sp@- <== NOT EXECUTED 5cf74: 4eb9 0004 ce20 jsr 4ce20 <== NOT EXECUTED 5cf7a: 2f00 movel %d0,%sp@- <== NOT EXECUTED 5cf7c: 2f2a 0008 movel %a2@(8),%sp@- <== NOT EXECUTED 5cf80: 4879 0008 e04e pea 8e04e <== NOT EXECUTED 5cf86: 2f39 0009 68f0 movel 968f0 ,%sp@- <== NOT EXECUTED 5cf8c: 4e94 jsr %a4@ <== NOT EXECUTED 5cf8e: 4fef 001c lea %sp@(28),%sp <== NOT EXECUTED 5cf92: 6016 bras 5cfaa <== NOT EXECUTED rtems_object_get_name( the_thread->Object.id, sizeof(name), name ) ); } #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); 5cf94: 4878 ffff pea ffffffff <== NOT EXECUTED 5cf98: 4879 0008 e05b pea 8e05b <== NOT EXECUTED 5cf9e: 2f39 0009 68f0 movel 968f0 ,%sp@- <== NOT EXECUTED 5cfa4: 4e94 jsr %a4@ <== NOT EXECUTED 5cfa6: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 5cfaa: 206b 0004 moveal %a3@(4),%a0 <== NOT EXECUTED else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 5cfae: 2f03 movel %d3,%sp@- <== NOT EXECUTED 5cfb0: 2f04 movel %d4,%sp@- <== NOT EXECUTED print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 5cfb2: 2013 movel %a3@,%d0 <== NOT EXECUTED 5cfb4: 5380 subql #1,%d0 <== NOT EXECUTED else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 5cfb6: 4870 0800 pea %a0@(00000000,%d0:l) <== NOT EXECUTED 5cfba: 2f08 movel %a0,%sp@- <== NOT EXECUTED 5cfbc: 4879 0008 e069 pea 8e069 <== NOT EXECUTED 5cfc2: 2f39 0009 68f0 movel 968f0 ,%sp@- <== NOT EXECUTED 5cfc8: 2079 0009 68f4 moveal 968f4 ,%a0 <== NOT EXECUTED 5cfce: 4e90 jsr %a0@ <== NOT EXECUTED 5cfd0: 2079 0009 68f4 moveal 968f4 ,%a0 <== NOT EXECUTED stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 5cfd6: 4fef 0018 lea %sp@(24),%sp <== NOT EXECUTED 5cfda: 4ab9 0009 68ec tstl 968ec <== NOT EXECUTED 5cfe0: 6612 bnes 5cff4 <== NOT EXECUTED (*print_handler)( print_context, "Unavailable\n" ); 5cfe2: 4879 0008 e087 pea 8e087 <== NOT EXECUTED 5cfe8: 2f39 0009 68f0 movel 968f0 ,%sp@- <== NOT EXECUTED 5cfee: 4e90 jsr %a0@ <== NOT EXECUTED 5cff0: 508f addql #8,%sp <== NOT EXECUTED 5cff2: 6014 bras 5d008 <== NOT EXECUTED } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 5cff4: 2f02 movel %d2,%sp@- <== NOT EXECUTED 5cff6: 4879 0008 e094 pea 8e094 <== NOT EXECUTED 5cffc: 2f39 0009 68f0 movel 968f0 ,%sp@- <== NOT EXECUTED 5d002: 4e90 jsr %a0@ <== NOT EXECUTED 5d004: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED } } 5d008: 4cee 1c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a4 <== NOT EXECUTED 5d00e: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005d0de : Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { 5d0de: 4e56 ffd0 linkw %fp,#-48 <== NOT EXECUTED 5d0e2: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ <== NOT EXECUTED 5d0e6: 246e 0008 moveal %fp@(8),%a2 <== NOT EXECUTED Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); char name[32]; printk("BLOWN STACK!!!\n"); 5d0ea: 47f9 0004 3564 lea 43564 ,%a3 <== NOT EXECUTED ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); 5d0f0: 286a 00b2 moveal %a2@(178),%a4 <== NOT EXECUTED char name[32]; printk("BLOWN STACK!!!\n"); 5d0f4: 4879 0008 e09a pea 8e09a <== NOT EXECUTED Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { 5d0fa: 142e 000f moveb %fp@(15),%d2 <== NOT EXECUTED Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); char name[32]; printk("BLOWN STACK!!!\n"); 5d0fe: 4e93 jsr %a3@ <== NOT EXECUTED printk("task control block: 0x%08" PRIxPTR "\n", running); 5d100: 2f0a movel %a2,%sp@- <== NOT EXECUTED 5d102: 4879 0008 e0aa pea 8e0aa <== NOT EXECUTED 5d108: 4e93 jsr %a3@ <== NOT EXECUTED printk("task ID: 0x%08lx\n", (unsigned long) running->Object.id); 5d10a: 2f2a 0008 movel %a2@(8),%sp@- <== NOT EXECUTED 5d10e: 4879 0008 e0c7 pea 8e0c7 <== NOT EXECUTED 5d114: 4e93 jsr %a3@ <== NOT EXECUTED printk( 5d116: 2f2a 000c movel %a2@(12),%sp@- <== NOT EXECUTED 5d11a: 4879 0008 e0d9 pea 8e0d9 <== NOT EXECUTED 5d120: 4e93 jsr %a3@ <== NOT EXECUTED "task name: 0x%08" PRIx32 "\n", running->Object.name.name_u32 ); printk( 5d122: 486e ffe0 pea %fp@(-32) <== NOT EXECUTED 5d126: 4878 0020 pea 20 <== NOT EXECUTED 5d12a: 2f2a 0008 movel %a2@(8),%sp@- <== NOT EXECUTED 5d12e: 4eb9 0004 ce20 jsr 4ce20 <== NOT EXECUTED 5d134: 4fef 0024 lea %sp@(36),%sp <== NOT EXECUTED 5d138: 2e80 movel %d0,%sp@ <== NOT EXECUTED 5d13a: 4879 0008 e0ed pea 8e0ed <== NOT EXECUTED 5d140: 4e93 jsr %a3@ <== NOT EXECUTED ); printk( "task stack area (%lu Bytes): 0x%08" PRIxPTR " .. 0x%08" PRIxPTR "\n", (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) 5d142: 206a 00b2 moveal %a2@(178),%a0 <== NOT EXECUTED 5d146: 202a 00ae movel %a2@(174),%d0 <== NOT EXECUTED ); printk( "task name string: %s\n", rtems_object_get_name(running->Object.id, sizeof(name), name) ); printk( 5d14a: 4870 0800 pea %a0@(00000000,%d0:l) <== NOT EXECUTED 5d14e: 2f08 movel %a0,%sp@- <== NOT EXECUTED 5d150: 2f00 movel %d0,%sp@- <== NOT EXECUTED 5d152: 4879 0008 e103 pea 8e103 <== NOT EXECUTED 5d158: 4e93 jsr %a3@ <== NOT EXECUTED "task stack area (%lu Bytes): 0x%08" PRIxPTR " .. 0x%08" PRIxPTR "\n", (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) ); if (!pattern_ok) { 5d15a: 4fef 0018 lea %sp@(24),%sp <== NOT EXECUTED 5d15e: 4a02 tstb %d2 <== NOT EXECUTED 5d160: 6618 bnes 5d17a <== NOT EXECUTED printk( 5d162: 486c 0018 pea %a4@(24) <== NOT EXECUTED 5d166: 486c 0008 pea %a4@(8) <== NOT EXECUTED 5d16a: 4878 0010 pea 10 <== NOT EXECUTED 5d16e: 4879 0008 e134 pea 8e134 <== NOT EXECUTED 5d174: 4e93 jsr %a3@ <== NOT EXECUTED 5d176: 4fef 0010 lea %sp@(16),%sp <== NOT EXECUTED rtems_configuration_get_user_multiprocessing_table()->node ); } #endif rtems_fatal( 5d17a: 2f2a 000c movel %a2@(12),%sp@- <== NOT EXECUTED 5d17e: 4878 0009 pea 9 <== NOT EXECUTED 5d182: 4eb9 0004 67c8 jsr 467c8 <== NOT EXECUTED =============================================================================== 0004b674 : * 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(); ticks = microseconds / microseconds_per_tick; 4b674: 41f9 0006 0484 lea 60484 ,%a0 #include uint32_t TOD_MICROSECONDS_TO_TICKS( uint32_t microseconds ) { 4b67a: 4e56 0000 linkw %fp,#0 * 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(); ticks = microseconds / microseconds_per_tick; 4b67e: 202e 0008 movel %fp@(8),%d0 4b682: 4c50 0001 remul %a0@,%d1,%d0 4b686: 4c50 0000 remul %a0@,%d0,%d0 if ( (microseconds % microseconds_per_tick) != 0 ) 4b68a: 4a81 tstl %d1 4b68c: 6702 beqs 4b690 <== ALWAYS TAKEN ticks += 1; 4b68e: 5280 addql #1,%d0 <== NOT EXECUTED return ticks; } 4b690: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000477b4 : #include uint32_t TOD_MILLISECONDS_TO_TICKS( uint32_t milliseconds ) { 477b4: 4e56 0000 linkw %fp,#0 /** * 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(); 477b8: 2039 0005 c6f4 movel 5c6f4 ,%d0 #include uint32_t TOD_MILLISECONDS_TO_TICKS( uint32_t milliseconds ) { 477be: 2f02 movel %d2,%sp@- /** * 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(); 477c0: 243c 0000 03e8 movel #1000,%d2 477c6: 4c42 0000 remul %d2,%d0,%d0 ticks = milliseconds / milliseconds_per_tick; 477ca: 242e 0008 movel %fp@(8),%d2 477ce: 4c40 2001 remul %d0,%d1,%d2 477d2: 4c40 2002 remul %d0,%d2,%d2 477d6: 2002 movel %d2,%d0 if ( (milliseconds % milliseconds_per_tick) != 0 ) 477d8: 4a81 tstl %d1 477da: 6702 beqs 477de <== ALWAYS TAKEN ticks += 1; 477dc: 5280 addql #1,%d0 <== NOT EXECUTED return ticks; } 477de: 241f movel %sp@+,%d2 477e0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046cf0 <_API_Mutex_Unlock>: #include void _API_Mutex_Unlock( API_Mutex_Control *the_mutex ) { 46cf0: 4e56 0000 linkw %fp,#0 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 46cf4: 2039 0005 eed6 movel 5eed6 <_Thread_Dispatch_disable_level>,%d0 ++level; 46cfa: 5280 addql #1,%d0 46cfc: 206e 0008 moveal %fp@(8),%a0 _Thread_Dispatch_disable_level = level; 46d00: 23c0 0005 eed6 movel %d0,5eed6 <_Thread_Dispatch_disable_level> /* Dispatch is already disabled in SMP while lock is held. */ #if !defined(RTEMS_SMP) _Thread_Disable_dispatch(); #endif _CORE_mutex_Surrender( 46d06: 42a7 clrl %sp@- 46d08: 2f28 0008 movel %a0@(8),%sp@- 46d0c: 4868 0010 pea %a0@(16) 46d10: 4eb9 0004 6fa4 jsr 46fa4 <_CORE_mutex_Surrender> &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 46d16: 4fef 000c lea %sp@(12),%sp } 46d1a: 4e5e unlk %fp _CORE_mutex_Surrender( &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 46d1c: 4ef9 0004 86fc jmp 486fc <_Thread_Enable_dispatch> ... =============================================================================== 00048e64 <_CORE_RWLock_Release>: * Otherwise, we have to block. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 48e64: 223c 0000 0700 movel #1792,%d1 #include CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 48e6a: 4e56 fff0 linkw %fp,#-16 ISR_Level level; Thread_Control *executing = _Thread_Executing; 48e6e: 2079 0006 1de2 moveal 61de2 <_Per_CPU_Information+0xe>,%a0 #include CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 48e74: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 48e78: 246e 0008 moveal %fp@(8),%a2 * Otherwise, we have to block. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 48e7c: 40c0 movew %sr,%d0 48e7e: 8280 orl %d0,%d1 48e80: 46c1 movew %d1,%sr if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 48e82: 222a 0044 movel %a2@(68),%d1 48e86: 660a bnes 48e92 <_CORE_RWLock_Release+0x2e> _ISR_Enable( level ); 48e88: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 48e8a: 7002 moveq #2,%d0 48e8c: 2140 0034 movel %d0,%a0@(52) return CORE_RWLOCK_SUCCESSFUL; 48e90: 6078 bras 48f0a <_CORE_RWLock_Release+0xa6> } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 48e92: 7401 moveq #1,%d2 48e94: b481 cmpl %d1,%d2 48e96: 6610 bnes 48ea8 <_CORE_RWLock_Release+0x44> the_rwlock->number_of_readers -= 1; 48e98: 222a 0048 movel %a2@(72),%d1 48e9c: 5381 subql #1,%d1 48e9e: 2541 0048 movel %d1,%a2@(72) if ( the_rwlock->number_of_readers != 0 ) { 48ea2: 6704 beqs 48ea8 <_CORE_RWLock_Release+0x44> /* must be unlocked again */ _ISR_Enable( level ); 48ea4: 46c0 movew %d0,%sr return CORE_RWLOCK_SUCCESSFUL; 48ea6: 6062 bras 48f0a <_CORE_RWLock_Release+0xa6> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 48ea8: 42a8 0034 clrl %a0@(52) /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; 48eac: 42aa 0044 clrl %a2@(68) _ISR_Enable( level ); 48eb0: 46c0 movew %d0,%sr next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 48eb2: 2f0a movel %a2,%sp@- 48eb4: 4eb9 0004 a8c0 jsr 4a8c0 <_Thread_queue_Dequeue> if ( next ) { 48eba: 588f addql #4,%sp 48ebc: 4a80 tstl %d0 48ebe: 674a beqs 48f0a <_CORE_RWLock_Release+0xa6> if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 48ec0: 7201 moveq #1,%d1 48ec2: 2040 moveal %d0,%a0 48ec4: b2a8 0030 cmpl %a0@(48),%d1 48ec8: 6608 bnes 48ed2 <_CORE_RWLock_Release+0x6e> the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 48eca: 7002 moveq #2,%d0 48ecc: 2540 0044 movel %d0,%a2@(68) return CORE_RWLOCK_SUCCESSFUL; 48ed0: 6038 bras 48f0a <_CORE_RWLock_Release+0xa6> /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 48ed2: 7201 moveq #1,%d1 } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 48ed4: 52aa 0048 addql #1,%a2@(72) /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 48ed8: 49f9 0004 acf8 lea 4acf8 <_Thread_queue_First>,%a4 if ( !next || next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 48ede: 47f9 0004 abc8 lea 4abc8 <_Thread_queue_Extract>,%a3 /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 48ee4: 2541 0044 movel %d1,%a2@(68) /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 48ee8: 2f0a movel %a2,%sp@- 48eea: 4e94 jsr %a4@ if ( !next || 48eec: 588f addql #4,%sp 48eee: 4a80 tstl %d0 48ef0: 6718 beqs 48f0a <_CORE_RWLock_Release+0xa6> 48ef2: 7401 moveq #1,%d2 48ef4: 2040 moveal %d0,%a0 48ef6: b4a8 0030 cmpl %a0@(48),%d2 48efa: 670e beqs 48f0a <_CORE_RWLock_Release+0xa6> <== NEVER TAKEN next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 48efc: 52aa 0048 addql #1,%a2@(72) _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 48f00: 2f00 movel %d0,%sp@- 48f02: 2f0a movel %a2,%sp@- 48f04: 4e93 jsr %a3@ } 48f06: 508f addql #8,%sp 48f08: 60de bras 48ee8 <_CORE_RWLock_Release+0x84> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 48f0a: 4280 clrl %d0 48f0c: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 48f12: 4e5e unlk %fp ... =============================================================================== 00048f18 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 48f18: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 48f1c: 486e fffc pea %fp@(-4) 48f20: 2f2e 0008 movel %fp@(8),%sp@- 48f24: 4eb9 0004 a5d0 jsr 4a5d0 <_Thread_Get> switch ( location ) { 48f2a: 508f addql #8,%sp 48f2c: 4aae fffc tstl %fp@(-4) 48f30: 6618 bnes 48f4a <_CORE_RWLock_Timeout+0x32> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 48f32: 2f00 movel %d0,%sp@- 48f34: 4eb9 0004 addc jsr 4addc <_Thread_queue_Process_timeout> RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; --level; _Thread_Dispatch_disable_level = level; 48f3a: 588f addql #4,%sp * * 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; 48f3c: 2039 0006 199a movel 6199a <_Thread_Dispatch_disable_level>,%d0 --level; 48f42: 5380 subql #1,%d0 _Thread_Dispatch_disable_level = level; 48f44: 23c0 0006 199a movel %d0,6199a <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 48f4a: 4e5e unlk %fp ... =============================================================================== 00047ba8 <_CORE_barrier_Wait>: Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; _ISR_Disable( level ); 47ba8: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 47bae: 4e56 fff4 linkw %fp,#-12 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; 47bb2: 2279 0006 0692 moveal 60692 <_Per_CPU_Information+0xe>,%a1 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 47bb8: 48d7 001c moveml %d2-%d4,%sp@ 47bbc: 206e 0008 moveal %fp@(8),%a0 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; 47bc0: 42a9 0034 clrl %a1@(52) Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 47bc4: 242e 000c movel %fp@(12),%d2 47bc8: 262e 0014 movel %fp@(20),%d3 47bcc: 282e 0018 movel %fp@(24),%d4 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; _ISR_Disable( level ); 47bd0: 40c1 movew %sr,%d1 47bd2: 8081 orl %d1,%d0 47bd4: 46c0 movew %d0,%sr the_barrier->number_of_waiting_threads++; 47bd6: 2028 0048 movel %a0@(72),%d0 47bda: 5280 addql #1,%d0 47bdc: 2140 0048 movel %d0,%a0@(72) if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { 47be0: 4aa8 0040 tstl %a0@(64) 47be4: 6626 bnes 47c0c <_CORE_barrier_Wait+0x64> if ( the_barrier->number_of_waiting_threads == 47be6: b0a8 0044 cmpl %a0@(68),%d0 47bea: 6620 bnes 47c0c <_CORE_barrier_Wait+0x64> the_barrier->Attributes.maximum_count) { executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; 47bec: 7001 moveq #1,%d0 47bee: 2340 0034 movel %d0,%a1@(52) _ISR_Enable( level ); 47bf2: 46c1 movew %d1,%sr _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 47bf4: 2d44 0010 movel %d4,%fp@(16) 47bf8: 2d42 000c movel %d2,%fp@(12) executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); } 47bfc: 4cd7 001c moveml %sp@,%d2-%d4 if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { if ( the_barrier->number_of_waiting_threads == the_barrier->Attributes.maximum_count) { executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; _ISR_Enable( level ); _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 47c00: 2d48 0008 movel %a0,%fp@(8) executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); } 47c04: 4e5e unlk %fp if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { if ( the_barrier->number_of_waiting_threads == the_barrier->Attributes.maximum_count) { executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; _ISR_Enable( level ); _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 47c06: 4ef9 0004 c1a4 jmp 4c1a4 <_CORE_barrier_Release> 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; 47c0c: 7001 moveq #1,%d0 47c0e: 2140 0030 movel %d0,%a0@(48) return; } } _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; 47c12: 2348 0044 movel %a0,%a1@(68) executing->Wait.id = id; 47c16: 2342 0020 movel %d2,%a1@(32) _ISR_Enable( level ); 47c1a: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 47c1c: 2d43 000c movel %d3,%fp@(12) 47c20: 203c 0004 9c28 movel #302120,%d0 47c26: 2d48 0008 movel %a0,%fp@(8) } 47c2a: 4cd7 001c moveml %sp@,%d2-%d4 _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 47c2e: 2d40 0010 movel %d0,%fp@(16) } 47c32: 4e5e unlk %fp _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 47c34: 4ef9 0004 9938 jmp 49938 <_Thread_queue_Enqueue_with_handler> ... =============================================================================== 0004e754 <_CORE_message_queue_Initialize>: /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { 4e754: 7003 moveq #3,%d0 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { 4e756: 4e56 ffe4 linkw %fp,#-28 4e75a: 222e 0014 movel %fp@(20),%d1 4e75e: 48d7 04fc moveml %d2-%d7/%a2,%sp@ 4e762: 246e 0008 moveal %fp@(8),%a2 4e766: 282e 0010 movel %fp@(16),%d4 /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { 4e76a: c081 andl %d1,%d0 ) { size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 4e76c: 2544 0044 movel %d4,%a2@(68) the_message_queue->number_of_pending_messages = 0; 4e770: 42aa 0048 clrl %a2@(72) the_message_queue->maximum_message_size = maximum_message_size; 4e774: 2541 004c movel %d1,%a2@(76) CORE_message_queue_Control *the_message_queue, CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; 4e778: 42aa 0060 clrl %a2@(96) the_message_queue->notify_argument = the_argument; 4e77c: 42aa 0064 clrl %a2@(100) /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { 4e780: 4a80 tstl %d0 4e782: 6712 beqs 4e796 <_CORE_message_queue_Initialize+0x42> allocated_message_size += sizeof(uintptr_t); 4e784: 2001 movel %d1,%d0 4e786: 5880 addql #4,%d0 allocated_message_size &= ~(sizeof(uintptr_t) - 1); 4e788: 74fc moveq #-4,%d2 4e78a: c082 andl %d2,%d0 /* * Check for an overflow. It can occur while increasing allocated_message_size * to multiplicity of uintptr_t above. */ if (allocated_message_size < maximum_message_size) 4e78c: b280 cmpl %d0,%d1 4e78e: 6308 blss 4e798 <_CORE_message_queue_Initialize+0x44> return false; 4e790: 4200 clrb %d0 4e792: 6000 0086 braw 4e81a <_CORE_message_queue_Initialize+0xc6> /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { 4e796: 2001 movel %d1,%d0 /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ if ( !size_t_mult32_with_overflow( 4e798: 2a00 movel %d0,%d5 4e79a: 0685 0000 0014 addil #20,%d5 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; 4e7a0: 2f05 movel %d5,%sp@- if ( x > SIZE_MAX ) 4e7a2: 4286 clrl %d6 4e7a4: 7eff moveq #-1,%d7 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; 4e7a6: 42a7 clrl %sp@- 4e7a8: 2f04 movel %d4,%sp@- 4e7aa: 42a7 clrl %sp@- 4e7ac: 4eb9 0006 1704 jsr 61704 <__muldi3> 4e7b2: 4fef 0010 lea %sp@(16),%sp 4e7b6: 2400 movel %d0,%d2 4e7b8: 2601 movel %d1,%d3 if ( x > SIZE_MAX ) 4e7ba: 9e83 subl %d3,%d7 4e7bc: 9d82 subxl %d2,%d6 4e7be: 6dd0 blts 4e790 <_CORE_message_queue_Initialize+0x3c><== NEVER TAKEN /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); 4e7c0: 2f01 movel %d1,%sp@- 4e7c2: 4eb9 0005 11cc jsr 511cc <_Workspace_Allocate> if (the_message_queue->message_buffers == 0) 4e7c8: 588f addql #4,%sp return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4e7ca: 2540 005c movel %d0,%a2@(92) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4e7ce: 67c0 beqs 4e790 <_CORE_message_queue_Initialize+0x3c> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 4e7d0: 2f05 movel %d5,%sp@- 4e7d2: 2f04 movel %d4,%sp@- 4e7d4: 2f00 movel %d0,%sp@- 4e7d6: 486a 0068 pea %a2@(104) 4e7da: 4eb9 0004 e710 jsr 4e710 <_Chain_Initialize> 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 ); 4e7e0: 41ea 0054 lea %a2@(84),%a0 */ RTEMS_INLINE_ROUTINE bool _CORE_message_queue_Is_priority( CORE_message_queue_Attributes *the_attribute ) { return 4e7e4: 7001 moveq #1,%d0 4e7e6: 2548 0050 movel %a0,%a2@(80) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 4e7ea: 41ea 0050 lea %a2@(80),%a0 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 4e7ee: 42aa 0054 clrl %a2@(84) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 4e7f2: 2548 0058 movel %a0,%a2@(88) allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 4e7f6: 4878 0006 pea 6 4e7fa: 206e 000c moveal %fp@(12),%a0 4e7fe: 4878 0080 pea 80 4e802: b090 cmpl %a0@,%d0 4e804: 57c0 seq %d0 4e806: 49c0 extbl %d0 4e808: 4480 negl %d0 4e80a: 2f00 movel %d0,%sp@- 4e80c: 2f0a movel %a2,%sp@- 4e80e: 4eb9 0005 0a80 jsr 50a80 <_Thread_queue_Initialize> 4e814: 4fef 0020 lea %sp@(32),%sp THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4e818: 7001 moveq #1,%d0 } 4e81a: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2 4e820: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004e824 <_CORE_message_queue_Seize>: CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4e824: 223c 0000 0700 movel #1792,%d1 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4e82a: 4e56 ffe4 linkw %fp,#-28 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 4e82e: 2079 0006 7c86 moveal 67c86 <_Per_CPU_Information+0xe>,%a0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4e834: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4e838: 246e 0008 moveal %fp@(8),%a2 4e83c: 262e 000c movel %fp@(12),%d3 4e840: 286e 0010 moveal %fp@(16),%a4 4e844: 226e 0014 moveal %fp@(20),%a1 4e848: 242e 001c movel %fp@(28),%d2 4e84c: 182e 001b moveb %fp@(27),%d4 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 4e850: 42a8 0034 clrl %a0@(52) _ISR_Disable( level ); 4e854: 40c0 movew %sr,%d0 4e856: 8280 orl %d0,%d1 4e858: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4e85a: 220a movel %a2,%d1 4e85c: 2a0a movel %a2,%d5 4e85e: 0681 0000 0050 addil #80,%d1 4e864: 0685 0000 0054 addil #84,%d5 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4e86a: 266a 0050 moveal %a2@(80),%a3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 4e86e: ba8b cmpl %a3,%d5 4e870: 6700 009c beqw 4e90e <_CORE_message_queue_Seize+0xea> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 4e874: 2053 moveal %a3@,%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 4e876: 2141 0004 movel %d1,%a0@(4) the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; 4e87a: 53aa 0048 subql #1,%a2@(72) Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 4e87e: 2548 0050 movel %a0,%a2@(80) _ISR_Enable( level ); 4e882: 46c0 movew %d0,%sr *size_p = the_message->Contents.size; _Thread_Executing->Wait.count = 4e884: 2079 0006 7c86 moveal 67c86 <_Per_CPU_Information+0xe>,%a0 _CORE_message_queue_Get_message_priority( the_message ); _CORE_message_queue_Copy_buffer( the_message->Contents.buffer, 4e88a: 240b movel %a3,%d2 4e88c: 0682 0000 0010 addil #16,%d2 the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; _ISR_Enable( level ); *size_p = the_message->Contents.size; 4e892: 22ab 000c movel %a3@(12),%a1@ _Thread_Executing->Wait.count = 4e896: 216b 0008 0024 movel %a3@(8),%a0@(36) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4e89c: 2f11 movel %a1@,%sp@- 4e89e: 2f02 movel %d2,%sp@- 4e8a0: 2f0c movel %a4,%sp@- 4e8a2: 49f9 0005 581c lea 5581c ,%a4 4e8a8: 4e94 jsr %a4@ * is not, then we can go ahead and free the buffer. * * NOTE: If we note that the queue was not full before this receive, * then we can avoid this dequeue. */ the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 4e8aa: 2f0a movel %a2,%sp@- 4e8ac: 4eb9 0005 0720 jsr 50720 <_Thread_queue_Dequeue> if ( !the_thread ) { 4e8b2: 4fef 0010 lea %sp@(16),%sp * is not, then we can go ahead and free the buffer. * * NOTE: If we note that the queue was not full before this receive, * then we can avoid this dequeue. */ the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 4e8b6: 2040 moveal %d0,%a0 if ( !the_thread ) { 4e8b8: 4a80 tstl %d0 4e8ba: 661a bnes 4e8d6 <_CORE_message_queue_Seize+0xb2> <== NEVER TAKEN RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer ( CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer_control *the_message ) { _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node ); 4e8bc: 45ea 0068 lea %a2@(104),%a2 4e8c0: 2d4b 000c movel %a3,%fp@(12) 4e8c4: 2d4a 0008 movel %a2,%fp@(8) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 4e8c8: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4e8ce: 4e5e unlk %fp 4e8d0: 4ef9 0004 e6a4 jmp 4e6a4 <_Chain_Append> */ _CORE_message_queue_Set_message_priority( the_message, the_thread->Wait.count ); the_message->Contents.size = (size_t) the_thread->Wait.option; 4e8d6: 2028 0030 movel %a0@(48),%d0 CORE_message_queue_Buffer_control *the_message, int priority ) { #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) the_message->priority = priority; 4e8da: 2768 0024 0008 movel %a0@(36),%a3@(8) 4e8e0: 2740 000c movel %d0,%a3@(12) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4e8e4: 2f00 movel %d0,%sp@- 4e8e6: 2f28 002c movel %a0@(44),%sp@- 4e8ea: 2f02 movel %d2,%sp@- 4e8ec: 4e94 jsr %a4@ the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 4e8ee: 2d6b 0008 0010 movel %a3@(8),%fp@(16) 4e8f4: 4fef 000c lea %sp@(12),%sp 4e8f8: 2d4b 000c movel %a3,%fp@(12) 4e8fc: 2d4a 0008 movel %a2,%fp@(8) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 4e900: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4e906: 4e5e unlk %fp the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 4e908: 4ef9 0005 315c jmp 5315c <_CORE_message_queue_Insert_message> return; } #endif } if ( !wait ) { 4e90e: 4a04 tstb %d4 4e910: 660a bnes 4e91c <_CORE_message_queue_Seize+0xf8> _ISR_Enable( level ); 4e912: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 4e914: 7004 moveq #4,%d0 4e916: 2140 0034 movel %d0,%a0@(52) return; 4e91a: 6038 bras 4e954 <_CORE_message_queue_Seize+0x130> 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; 4e91c: 7201 moveq #1,%d1 4e91e: 2541 0030 movel %d1,%a2@(48) } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; 4e922: 214c 002c movel %a4,%a0@(44) executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 4e926: 214a 0044 movel %a2,%a0@(68) executing->Wait.id = id; 4e92a: 2143 0020 movel %d3,%a0@(32) executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; 4e92e: 2149 0028 movel %a1,%a0@(40) /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 4e932: 46c0 movew %d0,%sr _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 4e934: 2d42 000c movel %d2,%fp@(12) 4e938: 203c 0005 0b48 movel #330568,%d0 4e93e: 2d4a 0008 movel %a2,%fp@(8) } 4e942: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 4e948: 2d40 0010 movel %d0,%fp@(16) } 4e94c: 4e5e unlk %fp executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 4e94e: 4ef9 0005 0858 jmp 50858 <_Thread_queue_Enqueue_with_handler> } 4e954: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4e95a: 4e5e unlk %fp ... =============================================================================== 0004e960 <_CORE_message_queue_Submit>: #endif CORE_message_queue_Submit_types submit_type, bool wait, Watchdog_Interval timeout ) { 4e960: 4e56 ffe8 linkw %fp,#-24 4e964: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 4e968: 246e 0008 moveal %fp@(8),%a2 4e96c: 282e 000c movel %fp@(12),%d4 4e970: 242e 0010 movel %fp@(16),%d2 4e974: 262e 001c movel %fp@(28),%d3 4e978: 1a2e 0023 moveb %fp@(35),%d5 CORE_message_queue_Buffer_control *the_message; Thread_Control *the_thread; if ( size > the_message_queue->maximum_message_size ) { 4e97c: b4aa 004c cmpl %a2@(76),%d2 4e980: 6200 00c8 bhiw 4ea4a <_CORE_message_queue_Submit+0xea> } /* * Is there a thread currently waiting on this message queue? */ if ( the_message_queue->number_of_pending_messages == 0 ) { 4e984: 4aaa 0048 tstl %a2@(72) 4e988: 662e bnes 4e9b8 <_CORE_message_queue_Submit+0x58> the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 4e98a: 2f0a movel %a2,%sp@- 4e98c: 4eb9 0005 0720 jsr 50720 <_Thread_queue_Dequeue> if ( the_thread ) { 4e992: 588f addql #4,%sp /* * Is there a thread currently waiting on this message queue? */ if ( the_message_queue->number_of_pending_messages == 0 ) { the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 4e994: 2640 moveal %d0,%a3 if ( the_thread ) { 4e996: 4a80 tstl %d0 4e998: 671e beqs 4e9b8 <_CORE_message_queue_Submit+0x58> 4e99a: 2f02 movel %d2,%sp@- 4e99c: 2f04 movel %d4,%sp@- 4e99e: 2f2b 002c movel %a3@(44),%sp@- 4e9a2: 4eb9 0005 581c jsr 5581c _CORE_message_queue_Copy_buffer( buffer, the_thread->Wait.return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 4e9a8: 206b 0028 moveal %a3@(40),%a0 #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 4e9ac: 4fef 000c lea %sp@(12),%sp _CORE_message_queue_Copy_buffer( buffer, the_thread->Wait.return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 4e9b0: 2082 movel %d2,%a0@ the_thread->Wait.count = (uint32_t) submit_type; 4e9b2: 2743 0024 movel %d3,%a3@(36) 4e9b6: 6038 bras 4e9f0 <_CORE_message_queue_Submit+0x90> RTEMS_INLINE_ROUTINE CORE_message_queue_Buffer_control * _CORE_message_queue_Allocate_message_buffer ( CORE_message_queue_Control *the_message_queue ) { return (CORE_message_queue_Buffer_control *) 4e9b8: 486a 0068 pea %a2@(104) 4e9bc: 4eb9 0004 e6dc jsr 4e6dc <_Chain_Get> * No one waiting on the message queue at this time, so attempt to * queue the message up for a future receive. */ the_message = _CORE_message_queue_Allocate_message_buffer( the_message_queue ); if ( the_message ) { 4e9c2: 588f addql #4,%sp 4e9c4: 2640 moveal %d0,%a3 4e9c6: 4a80 tstl %d0 4e9c8: 672a beqs 4e9f4 <_CORE_message_queue_Submit+0x94> const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4e9ca: 2f02 movel %d2,%sp@- 4e9cc: 2f04 movel %d4,%sp@- 4e9ce: 486b 0010 pea %a3@(16) 4e9d2: 4eb9 0005 581c jsr 5581c _CORE_message_queue_Copy_buffer( buffer, the_message->Contents.buffer, size ); the_message->Contents.size = size; 4e9d8: 2742 000c movel %d2,%a3@(12) CORE_message_queue_Buffer_control *the_message, int priority ) { #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) the_message->priority = priority; 4e9dc: 2743 0008 movel %d3,%a3@(8) _CORE_message_queue_Set_message_priority( the_message, submit_type ); _CORE_message_queue_Insert_message( 4e9e0: 2f03 movel %d3,%sp@- 4e9e2: 2f0b movel %a3,%sp@- 4e9e4: 2f0a movel %a2,%sp@- 4e9e6: 4eb9 0005 315c jsr 5315c <_CORE_message_queue_Insert_message> the_message_queue, the_message, submit_type ); return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 4e9ec: 4fef 0018 lea %sp@(24),%sp 4e9f0: 4280 clrl %d0 4e9f2: 6060 bras 4ea54 <_CORE_message_queue_Submit+0xf4> /* * No message buffers were available so we may need to return an * overflow error or block the sender until the message is placed * on the queue. */ if ( !wait ) { 4e9f4: 4a05 tstb %d5 4e9f6: 6756 beqs 4ea4e <_CORE_message_queue_Submit+0xee> /* * Do NOT block on a send if the caller is in an ISR. It is * deadly to block in an ISR. */ if ( _ISR_Is_in_progress() ) { 4e9f8: 4ab9 0006 7c80 tstl 67c80 <_Per_CPU_Information+0x8> 4e9fe: 6652 bnes 4ea52 <_CORE_message_queue_Submit+0xf2><== NEVER TAKEN * Thus the unusual choice to open a new scope and declare * it as a variable. Doing this emphasizes how dangerous it * would be to use this variable prior to here. */ { Thread_Control *executing = _Thread_Executing; 4ea00: 2079 0006 7c86 moveal 67c86 <_Per_CPU_Information+0xe>,%a0 ISR_Level level; _ISR_Disable( level ); 4ea06: 203c 0000 0700 movel #1792,%d0 4ea0c: 40c1 movew %sr,%d1 4ea0e: 8081 orl %d1,%d0 4ea10: 46c0 movew %d0,%sr 4ea12: 7001 moveq #1,%d0 4ea14: 2540 0030 movel %d0,%a2@(48) _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; 4ea18: 216e 0014 0020 movel %fp@(20),%a0@(32) Thread_Control *executing = _Thread_Executing; ISR_Level level; _ISR_Disable( level ); _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 4ea1e: 214a 0044 movel %a2,%a0@(68) executing->Wait.id = id; executing->Wait.return_argument_second.immutable_object = buffer; 4ea22: 2144 002c movel %d4,%a0@(44) executing->Wait.option = (uint32_t) size; 4ea26: 2142 0030 movel %d2,%a0@(48) executing->Wait.count = submit_type; 4ea2a: 2143 0024 movel %d3,%a0@(36) _ISR_Enable( level ); 4ea2e: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 4ea30: 4879 0005 0b48 pea 50b48 <_Thread_queue_Timeout> 4ea36: 2f2e 0024 movel %fp@(36),%sp@- 4ea3a: 2f0a movel %a2,%sp@- 4ea3c: 4eb9 0005 0858 jsr 50858 <_Thread_queue_Enqueue_with_handler> } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; 4ea42: 4fef 000c lea %sp@(12),%sp 4ea46: 7007 moveq #7,%d0 4ea48: 600a bras 4ea54 <_CORE_message_queue_Submit+0xf4> { CORE_message_queue_Buffer_control *the_message; Thread_Control *the_thread; if ( size > the_message_queue->maximum_message_size ) { return CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE; 4ea4a: 7001 moveq #1,%d0 4ea4c: 6006 bras 4ea54 <_CORE_message_queue_Submit+0xf4> * No message buffers were available so we may need to return an * overflow error or block the sender until the message is placed * on the queue. */ if ( !wait ) { return CORE_MESSAGE_QUEUE_STATUS_TOO_MANY; 4ea4e: 7002 moveq #2,%d0 4ea50: 6002 bras 4ea54 <_CORE_message_queue_Submit+0xf4> /* * Do NOT block on a send if the caller is in an ISR. It is * deadly to block in an ISR. */ if ( _ISR_Is_in_progress() ) { return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED; 4ea52: 7003 moveq #3,%d0 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 4ea54: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 4ea5a: 4e5e unlk %fp ... =============================================================================== 000470dc <_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 ) { 470dc: 4e56 0000 linkw %fp,#0 470e0: 2f0a movel %a2,%sp@- 470e2: 246e 0008 moveal %fp@(8),%a2 ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 470e6: 2f0a movel %a2,%sp@- 470e8: 4eb9 0004 8a0c jsr 48a0c <_Thread_queue_Dequeue> 470ee: 588f addql #4,%sp 470f0: 4a80 tstl %d0 470f2: 6624 bnes 47118 <_CORE_semaphore_Surrender+0x3c> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 470f4: 303c 0700 movew #1792,%d0 470f8: 40c1 movew %sr,%d1 470fa: 8081 orl %d1,%d0 470fc: 46c0 movew %d0,%sr if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 470fe: 202a 0048 movel %a2@(72),%d0 47102: b0aa 0040 cmpl %a2@(64),%d0 47106: 640a bccs 47112 <_CORE_semaphore_Surrender+0x36> <== NEVER TAKEN the_semaphore->count += 1; 47108: 5280 addql #1,%d0 4710a: 2540 0048 movel %d0,%a2@(72) { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 4710e: 4280 clrl %d0 47110: 6002 bras 47114 <_CORE_semaphore_Surrender+0x38> } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 47112: 7004 moveq #4,%d0 <== NOT EXECUTED _ISR_Enable( level ); 47114: 46c1 movew %d1,%sr 47116: 6002 bras 4711a <_CORE_semaphore_Surrender+0x3e> { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 47118: 4280 clrl %d0 status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 4711a: 246e fffc moveal %fp@(-4),%a2 4711e: 4e5e unlk %fp ... =============================================================================== 00045ed8 <_Event_Surrender>: rtems_event_set seized_events; rtems_option option_set; option_set = the_thread->Wait.option; _ISR_Disable( level ); 45ed8: 203c 0000 0700 movel #1792,%d0 rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 45ede: 4e56 ffe4 linkw %fp,#-28 45ee2: 206e 0010 moveal %fp@(16),%a0 45ee6: 48d7 04fc moveml %d2-%d7/%a2,%sp@ 45eea: 246e 0008 moveal %fp@(8),%a2 45eee: 242e 000c movel %fp@(12),%d2 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; 45ef2: 282a 0030 movel %a2@(48),%d4 rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 45ef6: 226e 0014 moveal %fp@(20),%a1 45efa: 2a2e 0018 movel %fp@(24),%d5 rtems_event_set seized_events; rtems_option option_set; option_set = the_thread->Wait.option; _ISR_Disable( level ); 45efe: 40c1 movew %sr,%d1 45f00: 8081 orl %d1,%d0 45f02: 46c0 movew %d0,%sr 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; 45f04: 8490 orl %a0@,%d2 45f06: 2082 movel %d2,%a0@ _Event_sets_Post( event_in, &event->pending_events ); pending_events = event->pending_events; event_condition = the_thread->Wait.count; 45f08: 262a 0024 movel %a2@(36),%d3 RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 45f0c: 2002 movel %d2,%d0 45f0e: c083 andl %d3,%d0 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 45f10: 6604 bnes 45f16 <_Event_Surrender+0x3e> 45f12: 6000 00aa braw 45fbe <_Event_Surrender+0xe6> /* * 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() && 45f16: 4ab9 0005 f318 tstl 5f318 <_Per_CPU_Information+0x8> 45f1c: 6736 beqs 45f54 <_Event_Surrender+0x7c> 45f1e: b5f9 0005 f31e cmpal 5f31e <_Per_CPU_Information+0xe>,%a2 45f24: 662e bnes 45f54 <_Event_Surrender+0x7c> _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 45f26: 2c11 movel %a1@,%d6 /* * 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 ) && 45f28: 7e01 moveq #1,%d7 ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 45f2a: 5386 subql #1,%d6 /* * 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 ) && 45f2c: be86 cmpl %d6,%d7 45f2e: 6524 bcss 45f54 <_Event_Surrender+0x7c> <== NEVER TAKEN ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 45f30: b680 cmpl %d0,%d3 45f32: 6708 beqs 45f3c <_Event_Surrender+0x64> <== NEVER TAKEN 45f34: 0804 0001 btst #1,%d4 45f38: 6700 0084 beqw 45fbe <_Event_Surrender+0xe6> 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) ); 45f3c: 2600 movel %d0,%d3 45f3e: 4683 notl %d3 45f40: c682 andl %d2,%d3 45f42: 2083 movel %d3,%a0@ event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 45f44: 206a 0028 moveal %a2@(40),%a0 if ( seized_events == event_condition || _Options_Is_any(option_set) ) { event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; 45f48: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 45f4c: 2080 movel %d0,%a0@ *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 45f4e: 7003 moveq #3,%d0 45f50: 2280 movel %d0,%a1@ 45f52: 606a bras 45fbe <_Event_Surrender+0xe6> RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 45f54: caaa 0010 andl %a2@(16),%d5 } /* * Otherwise, this is a normal send to another thread */ if ( _States_Are_set( the_thread->current_state, wait_state ) ) { 45f58: 6764 beqs 45fbe <_Event_Surrender+0xe6> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 45f5a: b680 cmpl %d0,%d3 45f5c: 6706 beqs 45f64 <_Event_Surrender+0x8c> 45f5e: 0804 0001 btst #1,%d4 45f62: 675a beqs 45fbe <_Event_Surrender+0xe6> <== NEVER TAKEN 45f64: 2600 movel %d0,%d3 45f66: 4683 notl %d3 45f68: c682 andl %d2,%d3 45f6a: 2083 movel %d3,%a0@ event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 45f6c: 206a 0028 moveal %a2@(40),%a0 if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; 45f70: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 45f74: 2080 movel %d0,%a0@ _ISR_Flash( level ); 45f76: 203c 0000 0700 movel #1792,%d0 45f7c: 46c1 movew %d1,%sr 45f7e: 8081 orl %d1,%d0 45f80: 46c0 movew %d0,%sr if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 45f82: 7002 moveq #2,%d0 45f84: b0aa 0050 cmpl %a2@(80),%d0 45f88: 6704 beqs 45f8e <_Event_Surrender+0xb6> _ISR_Enable( level ); 45f8a: 46c1 movew %d1,%sr 45f8c: 6014 bras 45fa2 <_Event_Surrender+0xca> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 45f8e: 7003 moveq #3,%d0 45f90: 2540 0050 movel %d0,%a2@(80) _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 45f94: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 45f96: 486a 0048 pea %a2@(72) 45f9a: 4eb9 0004 92f8 jsr 492f8 <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 45fa0: 588f addql #4,%sp 45fa2: 2d4a 0008 movel %a2,%fp@(8) 45fa6: 2e3c 1007 fff8 movel #268959736,%d7 45fac: 2d47 000c movel %d7,%fp@(12) } return; } } _ISR_Enable( level ); } 45fb0: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2 45fb6: 4e5e unlk %fp 45fb8: 4ef9 0004 8388 jmp 48388 <_Thread_Clear_state> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 45fbe: 46c1 movew %d1,%sr } 45fc0: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2 45fc6: 4e5e unlk %fp ... =============================================================================== 00045fcc <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *arg ) { 45fcc: 4e56 fffc linkw %fp,#-4 45fd0: 2f0a movel %a2,%sp@- 45fd2: 246e 000c moveal %fp@(12),%a2 45fd6: 2f02 movel %d2,%sp@- ISR_Level level; Thread_blocking_operation_States *sync_state; sync_state = arg; the_thread = _Thread_Get( id, &location ); 45fd8: 486e fffc pea %fp@(-4) 45fdc: 2f2e 0008 movel %fp@(8),%sp@- 45fe0: 4eb9 0004 871c jsr 4871c <_Thread_Get> switch ( location ) { 45fe6: 508f addql #8,%sp 45fe8: 4aae fffc tstl %fp@(-4) 45fec: 664c bnes 4603a <_Event_Timeout+0x6e> <== NEVER TAKEN * * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ _ISR_Disable( level ); 45fee: 223c 0000 0700 movel #1792,%d1 45ff4: 40c2 movew %sr,%d2 45ff6: 8282 orl %d2,%d1 45ff8: 46c1 movew %d1,%sr _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 45ffa: 2040 moveal %d0,%a0 45ffc: 42a8 0024 clrl %a0@(36) if ( _Thread_Is_executing( the_thread ) ) { 46000: b0b9 0005 f31e cmpl 5f31e <_Per_CPU_Information+0xe>,%d0 46006: 660a bnes 46012 <_Event_Timeout+0x46> if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 46008: 7201 moveq #1,%d1 4600a: b292 cmpl %a2@,%d1 4600c: 6604 bnes 46012 <_Event_Timeout+0x46> *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4600e: 7202 moveq #2,%d1 46010: 2481 movel %d1,%a2@ } the_thread->Wait.return_code = RTEMS_TIMEOUT; 46012: 7206 moveq #6,%d1 46014: 2040 moveal %d0,%a0 46016: 2141 0034 movel %d1,%a0@(52) _ISR_Enable( level ); 4601a: 46c2 movew %d2,%sr 4601c: 2f3c 1007 fff8 movel #268959736,%sp@- 46022: 2f00 movel %d0,%sp@- 46024: 4eb9 0004 8388 jsr 48388 <_Thread_Clear_state> RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; --level; _Thread_Dispatch_disable_level = level; 4602a: 508f addql #8,%sp * * 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; 4602c: 2039 0005 eed6 movel 5eed6 <_Thread_Dispatch_disable_level>,%d0 --level; 46032: 5380 subql #1,%d0 _Thread_Dispatch_disable_level = level; 46034: 23c0 0005 eed6 movel %d0,5eed6 <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 4603a: 242e fff4 movel %fp@(-12),%d2 4603e: 246e fff8 moveal %fp@(-8),%a2 46042: 4e5e unlk %fp ... =============================================================================== 0004745a <_Heap_Block_allocate>: - 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; 4745a: 70fe moveq #-2,%d0 Heap_Control *heap, Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { 4745c: 4e56 ffe4 linkw %fp,#-28 47460: 222e 0010 movel %fp@(16),%d1 47464: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 47468: 246e 000c moveal %fp@(12),%a2 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; 4746c: 7401 moveq #1,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 4746e: 2841 moveal %d1,%a4 47470: 518c subql #8,%a4 Heap_Statistics *const stats = &heap->stats; uintptr_t const alloc_area_begin = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_area_offset = alloc_begin - alloc_area_begin; 47472: 2a4c moveal %a4,%a5 47474: 9bca subal %a2,%a5 - 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; 47476: c0aa 0004 andl %a2@(4),%d0 Heap_Control *heap, Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { 4747a: 266e 0008 moveal %fp@(8),%a3 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; 4747e: c4b2 0804 andl %a2@(00000004,%d0:l),%d2 47482: 282e 0014 movel %fp@(20),%d4 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 47486: 4a82 tstl %d2 47488: 6626 bnes 474b0 <_Heap_Block_allocate+0x56> return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 4748a: 202a 0008 movel %a2@(8),%d0 Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 4748e: 2240 moveal %d0,%a1 free_list_anchor = block->prev; 47490: 206a 000c moveal %a2@(12),%a0 RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 47494: 2140 0008 movel %d0,%a0@(8) - 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; 47498: 70fe moveq #-2,%d0 { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 4749a: 2348 000c movel %a0,%a1@(12) _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; 4749e: 53ab 0038 subql #1,%a3@(56) ++stats->used_blocks; 474a2: 52ab 0040 addql #1,%a3@(64) - 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; 474a6: c0aa 0004 andl %a2@(4),%d0 stats->free_size -= _Heap_Block_size( block ); 474aa: 91ab 0030 subl %d0,%a3@(48) 474ae: 6002 bras 474b2 <_Heap_Block_allocate+0x58> } else { free_list_anchor = _Heap_Free_list_head( heap ); 474b0: 204b moveal %a3,%a0 } if ( alloc_area_offset < heap->page_size ) { 474b2: 202b 0010 movel %a3@(16),%d0 474b6: b08d cmpl %a5,%d0 474b8: 6314 blss 474ce <_Heap_Block_allocate+0x74> Heap_Block *block, Heap_Block *free_list_anchor, uintptr_t alloc_size ) { _Heap_Block_split( heap, block, free_list_anchor, alloc_size ); 474ba: 4875 4800 pea %a5@(00000000,%d4:l) 474be: 2f08 movel %a0,%sp@- 474c0: 2f0a movel %a2,%sp@- 474c2: 2f0b movel %a3,%sp@- 474c4: 4eba fd62 jsr %pc@(47228 <_Heap_Block_split>) 474c8: 4fef 0010 lea %sp@(16),%sp 474cc: 6066 bras 47534 <_Heap_Block_allocate+0xda> } _Heap_Protection_block_initialize( heap, block ); return block; } 474ce: 242a 0004 movel %a2@(4),%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 474d2: 4c40 1003 remul %d0,%d3,%d1 - 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; 474d6: 72fe moveq #-2,%d1 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 474d8: 99c3 subal %d3,%a4 _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); uintptr_t const new_block_begin = (uintptr_t) new_block; uintptr_t const new_block_size = block_end - new_block_begin; block_end = new_block_begin; block_size = block_end - block_begin; 474da: 200c movel %a4,%d0 474dc: 908a subl %a2,%d0 _HAssert( block_size >= heap->min_block_size ); _HAssert( new_block_size >= heap->min_block_size ); /* Statistics */ stats->free_size += block_size; 474de: d1ab 0030 addl %d0,%a3@(48) } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 474e2: c282 andl %d2,%d1 { Heap_Statistics *const stats = &heap->stats; uintptr_t block_begin = (uintptr_t) block; uintptr_t block_size = _Heap_Block_size( block ); uintptr_t block_end = block_begin + block_size; 474e4: d28a addl %a2,%d1 Heap_Block *const new_block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); uintptr_t const new_block_begin = (uintptr_t) new_block; uintptr_t const new_block_size = block_end - new_block_begin; 474e6: 928c subl %a4,%d1 _HAssert( new_block_size >= heap->min_block_size ); /* Statistics */ stats->free_size += block_size; if ( _Heap_Is_prev_used( block ) ) { 474e8: 0802 0000 btst #0,%d2 474ec: 671c beqs 4750a <_Heap_Block_allocate+0xb0> <== NEVER TAKEN RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 474ee: 2a68 0008 moveal %a0@(8),%a5 new_block->next = next; new_block->prev = block_before; 474f2: 2548 000c movel %a0,%a2@(12) Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 474f6: 254d 0008 movel %a5,%a2@(8) new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 474fa: 2b4a 000c movel %a2,%a5@(12) { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 474fe: 214a 0008 movel %a2,%a0@(8) _Heap_Free_list_insert_after( free_list_anchor, block ); free_list_anchor = block; /* Statistics */ ++stats->free_blocks; 47502: 52ab 0038 addql #1,%a3@(56) 47506: 204a moveal %a2,%a0 47508: 600a bras 47514 <_Heap_Block_allocate+0xba> RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Prev_block( const Heap_Block *block ) { return (Heap_Block *) ((uintptr_t) block - block->prev_size); 4750a: 95d2 subal %a2@,%a2 - 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; 4750c: 74fe moveq #-2,%d2 4750e: c4aa 0004 andl %a2@(4),%d2 } else { Heap_Block *const prev_block = _Heap_Prev_block( block ); uintptr_t const prev_block_size = _Heap_Block_size( prev_block ); block = prev_block; block_size += prev_block_size; 47512: d082 addl %d2,%d0 } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 47514: 7401 moveq #1,%d2 47516: 8480 orl %d0,%d2 new_block->prev_size = block_size; 47518: 2880 movel %d0,%a4@ block = prev_block; block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 4751a: 2542 0004 movel %d2,%a2@(4) new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; _Heap_Block_split( heap, new_block, free_list_anchor, alloc_size ); 4751e: 244c moveal %a4,%a2 } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; 47520: 2941 0004 movel %d1,%a4@(4) _Heap_Block_split( heap, new_block, free_list_anchor, alloc_size ); 47524: 2f04 movel %d4,%sp@- 47526: 2f08 movel %a0,%sp@- 47528: 2f0c movel %a4,%sp@- 4752a: 2f0b movel %a3,%sp@- 4752c: 4eba fcfa jsr %pc@(47228 <_Heap_Block_split>) 47530: 4fef 0010 lea %sp@(16),%sp alloc_size ); } /* Statistics */ if ( stats->min_free_size > stats->free_size ) { 47534: 202b 0030 movel %a3@(48),%d0 47538: b0ab 0034 cmpl %a3@(52),%d0 4753c: 6404 bccs 47542 <_Heap_Block_allocate+0xe8> stats->min_free_size = stats->free_size; 4753e: 2740 0034 movel %d0,%a3@(52) } _Heap_Protection_block_initialize( heap, block ); return block; } 47542: 200a movel %a2,%d0 47544: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 4754a: 4e5e unlk %fp ... =============================================================================== 0004b55c <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4b55c: 4e56 ffe8 linkw %fp,#-24 4b560: 206e 0008 moveal %fp@(8),%a0 4b564: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 4b568: 202e 000c movel %fp@(12),%d0 /* * 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 ) { 4b56c: 6700 0154 beqw 4b6c2 <_Heap_Free+0x166> 4b570: 2240 moveal %d0,%a1 4b572: 5189 subql #8,%a1 4b574: 4c68 0001 0010 remul %a0@(16),%d1,%d0 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 4b57a: 2828 0020 movel %a0@(32),%d4 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4b57e: 93c1 subal %d1,%a1 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; 4b580: b889 cmpl %a1,%d4 4b582: 620c bhis 4b590 <_Heap_Free+0x34> 4b584: b3e8 0024 cmpal %a0@(36),%a1 4b588: 53c0 sls %d0 4b58a: 49c0 extbl %d0 4b58c: 4480 negl %d0 4b58e: 6002 bras 4b592 <_Heap_Free+0x36> 4b590: 4280 clrl %d0 } 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 ) ) { 4b592: 0800 0000 btst #0,%d0 4b596: 6700 012e beqw 4b6c6 <_Heap_Free+0x16a> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4b59a: 2629 0004 movel %a1@(4),%d3 - 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; 4b59e: 70fe moveq #-2,%d0 4b5a0: c083 andl %d3,%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4b5a2: 45f1 0800 lea %a1@(00000000,%d0:l),%a2 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; 4b5a6: b88a cmpl %a2,%d4 4b5a8: 620c bhis 4b5b6 <_Heap_Free+0x5a> <== NEVER TAKEN 4b5aa: b5e8 0024 cmpal %a0@(36),%a2 4b5ae: 53c1 sls %d1 4b5b0: 49c1 extbl %d1 4b5b2: 4481 negl %d1 4b5b4: 6002 bras 4b5b8 <_Heap_Free+0x5c> 4b5b6: 4281 clrl %d1 <== NOT EXECUTED _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 ) ) { 4b5b8: 0801 0000 btst #0,%d1 4b5bc: 6700 0108 beqw 4b6c6 <_Heap_Free+0x16a> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4b5c0: 242a 0004 movel %a2@(4),%d2 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 4b5c4: 0802 0000 btst #0,%d2 4b5c8: 6700 00fc beqw 4b6c6 <_Heap_Free+0x16a> - 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; 4b5cc: 72fe moveq #-2,%d1 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 4b5ce: 2668 0024 moveal %a0@(36),%a3 4b5d2: c481 andl %d1,%d2 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4b5d4: b7ca cmpal %a2,%a3 4b5d6: 670c beqs 4b5e4 <_Heap_Free+0x88> 4b5d8: 2232 2804 movel %a2@(00000004,%d2:l),%d1 4b5dc: 7a01 moveq #1,%d5 4b5de: bb81 eorl %d5,%d1 4b5e0: c285 andl %d5,%d1 4b5e2: 6002 bras 4b5e6 <_Heap_Free+0x8a> 4b5e4: 4281 clrl %d1 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 4b5e6: 1a01 moveb %d1,%d5 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 4b5e8: 0803 0000 btst #0,%d3 4b5ec: 6662 bnes 4b650 <_Heap_Free+0xf4> uintptr_t const prev_size = block->prev_size; 4b5ee: 2611 movel %a1@,%d3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4b5f0: 93c3 subal %d3,%a1 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; 4b5f2: b889 cmpl %a1,%d4 4b5f4: 620a bhis 4b600 <_Heap_Free+0xa4> <== NEVER TAKEN 4b5f6: b3cb cmpal %a3,%a1 4b5f8: 53c1 sls %d1 4b5fa: 49c1 extbl %d1 4b5fc: 4481 negl %d1 4b5fe: 6002 bras 4b602 <_Heap_Free+0xa6> 4b600: 4281 clrl %d1 <== NOT EXECUTED Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 4b602: 0801 0000 btst #0,%d1 4b606: 6700 00be beqw 4b6c6 <_Heap_Free+0x16a> 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; 4b60a: 7201 moveq #1,%d1 4b60c: c2a9 0004 andl %a1@(4),%d1 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) ) { 4b610: 6700 00b4 beqw 4b6c6 <_Heap_Free+0x16a> 4b614: d680 addl %d0,%d3 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4b616: 4a05 tstb %d5 4b618: 6724 beqs 4b63e <_Heap_Free+0xe2> return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 4b61a: 266a 0008 moveal %a2@(8),%a3 uintptr_t const size = block_size + prev_size + next_block_size; 4b61e: d483 addl %d3,%d2 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4b620: 7201 moveq #1,%d1 Heap_Block *prev = block->prev; 4b622: 246a 000c moveal %a2@(12),%a2 prev->next = next; 4b626: 254b 0008 movel %a3,%a2@(8) 4b62a: 8282 orl %d2,%d1 next->prev = prev; 4b62c: 274a 000c movel %a2,%a3@(12) } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4b630: 53a8 0038 subql #1,%a0@(56) prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 4b634: 2382 2800 movel %d2,%a1@(00000000,%d2:l) if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4b638: 2341 0004 movel %d1,%a1@(4) 4b63c: 6078 bras 4b6b6 <_Heap_Free+0x15a> 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; 4b63e: 7401 moveq #1,%d2 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4b640: 7afe moveq #-2,%d5 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; 4b642: 8483 orl %d3,%d2 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; 4b644: 2483 movel %d3,%a2@ 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; 4b646: 2342 0004 movel %d2,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4b64a: cbaa 0004 andl %d5,%a2@(4) 4b64e: 6066 bras 4b6b6 <_Heap_Free+0x15a> next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 4b650: 4a01 tstb %d1 4b652: 672a beqs 4b67e <_Heap_Free+0x122> RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 4b654: 266a 0008 moveal %a2@(8),%a3 uintptr_t const size = block_size + next_block_size; 4b658: 2202 movel %d2,%d1 4b65a: d280 addl %d0,%d1 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4b65c: 7401 moveq #1,%d2 Heap_Block *prev = old_block->prev; 4b65e: 246a 000c moveal %a2@(12),%a2 new_block->next = next; 4b662: 234b 0008 movel %a3,%a1@(8) 4b666: 8481 orl %d1,%d2 new_block->prev = prev; 4b668: 234a 000c movel %a2,%a1@(12) next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4b66c: 2381 1800 movel %d1,%a1@(00000000,%d1:l) next->prev = new_block; 4b670: 2749 000c movel %a1,%a3@(12) prev->next = new_block; 4b674: 2549 0008 movel %a1,%a2@(8) next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4b678: 2342 0004 movel %d2,%a1@(4) 4b67c: 6038 bras 4b6b6 <_Heap_Free+0x15a> next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 4b67e: 7a01 moveq #1,%d5 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4b680: 72fe moveq #-2,%d1 next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 4b682: 8a80 orl %d0,%d5 RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 4b684: 2668 0008 moveal %a0@(8),%a3 new_block->next = next; new_block->prev = block_before; 4b688: 2348 000c movel %a0,%a1@(12) 4b68c: 2345 0004 movel %d5,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4b690: c3aa 0004 andl %d1,%a2@(4) next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4b694: 2228 0038 movel %a0@(56),%d1 4b698: 5281 addql #1,%d1 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 4b69a: 234b 0008 movel %a3,%a1@(8) new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 4b69e: 2749 000c movel %a1,%a3@(12) /* 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; next_block->prev_size = block_size; 4b6a2: 2480 movel %d0,%a2@ { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 4b6a4: 2149 0008 movel %a1,%a0@(8) /* Statistics */ ++stats->free_blocks; 4b6a8: 2141 0038 movel %d1,%a0@(56) if ( stats->max_free_blocks < stats->free_blocks ) { 4b6ac: b2a8 003c cmpl %a0@(60),%d1 4b6b0: 6304 blss 4b6b6 <_Heap_Free+0x15a> stats->max_free_blocks = stats->free_blocks; 4b6b2: 2141 003c movel %d1,%a0@(60) } } /* Statistics */ --stats->used_blocks; 4b6b6: 53a8 0040 subql #1,%a0@(64) ++stats->frees; 4b6ba: 52a8 0050 addql #1,%a0@(80) stats->free_size += block_size; 4b6be: d1a8 0030 addl %d0,%a0@(48) * 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; 4b6c2: 7001 moveq #1,%d0 4b6c4: 6002 bras 4b6c8 <_Heap_Free+0x16c> 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; 4b6c6: 4200 clrb %d0 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4b6c8: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3 4b6cc: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048f78 <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 48f78: 4e56 ffe8 linkw %fp,#-24 48f7c: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 48f80: 246e 0008 moveal %fp@(8),%a2 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 48f84: 4282 clrl %d2 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; 48f86: 97cb subal %a3,%a3 * @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 ); 48f88: 4bf9 0004 f5c8 lea 4f5c8 <_Heap_Allocate_aligned_with_boundary>,%a5 48f8e: 286e 000c moveal %fp@(12),%a4 Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 48f92: 6026 bras 48fba <_Heap_Greedy_allocate+0x42> 48f94: 42a7 clrl %sp@- 48f96: 42a7 clrl %sp@- 48f98: 2f1c movel %a4@+,%sp@- 48f9a: 2f0a movel %a2,%sp@- 48f9c: 4e95 jsr %a5@ void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 48f9e: 4fef 0010 lea %sp@(16),%sp 48fa2: 4a80 tstl %d0 48fa4: 6712 beqs 48fb8 <_Heap_Greedy_allocate+0x40> <== NEVER TAKEN RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 48fa6: 2040 moveal %d0,%a0 48fa8: 5188 subql #8,%a0 48faa: 4c6a 0001 0010 remul %a2@(16),%d1,%d0 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 48fb0: 91c1 subal %d1,%a0 Heap_Block *next_block = _Heap_Block_of_alloc_area( (uintptr_t) next, heap->page_size ); next_block->next = allocated_blocks; 48fb2: 214b 0008 movel %a3,%a0@(8) 48fb6: 2648 moveal %a0,%a3 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 48fb8: 5282 addql #1,%d2 48fba: b4ae 0010 cmpl %fp@(16),%d2 48fbe: 66d4 bnes 48f94 <_Heap_Greedy_allocate+0x1c> 48fc0: 4282 clrl %d2 allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { _Heap_Block_allocate( 48fc2: 4bf9 0004 9286 lea 49286 <_Heap_Block_allocate>,%a5 48fc8: 6020 bras 48fea <_Heap_Greedy_allocate+0x72> } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 48fca: 70fe moveq #-2,%d0 48fcc: c0ac 0004 andl %a4@(4),%d0 48fd0: 2040 moveal %d0,%a0 48fd2: 4868 fff8 pea %a0@(-8) 48fd6: 486c 0008 pea %a4@(8) 48fda: 2f0c movel %a4,%sp@- 48fdc: 2f0a movel %a2,%sp@- 48fde: 4e95 jsr %a5@ 48fe0: 4fef 0010 lea %sp@(16),%sp current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; 48fe4: 2942 0008 movel %d2,%a4@(8) 48fe8: 240c movel %a4,%d2 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 48fea: 286a 0008 moveal %a2@(8),%a4 next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 48fee: b5cc cmpal %a4,%a2 48ff0: 66d8 bnes 48fca <_Heap_Greedy_allocate+0x52> 48ff2: 6012 bras 49006 <_Heap_Greedy_allocate+0x8e> blocks = current; } while ( allocated_blocks != NULL ) { current = allocated_blocks; allocated_blocks = allocated_blocks->next; 48ff4: 262b 0008 movel %a3@(8),%d3 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 48ff8: 486b 0008 pea %a3@(8) blocks = current; } while ( allocated_blocks != NULL ) { current = allocated_blocks; allocated_blocks = allocated_blocks->next; 48ffc: 2643 moveal %d3,%a3 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 48ffe: 2f0a movel %a2,%sp@- 49000: 4e94 jsr %a4@ 49002: 508f addql #8,%sp 49004: 6006 bras 4900c <_Heap_Greedy_allocate+0x94> 49006: 49f9 0004 f728 lea 4f728 <_Heap_Free>,%a4 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 4900c: 4a8b tstl %a3 4900e: 66e4 bnes 48ff4 <_Heap_Greedy_allocate+0x7c> allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } 49010: 2002 movel %d2,%d0 49012: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 49018: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004fcac <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 4fcac: 4e56 0000 linkw %fp,#0 4fcb0: 226e 0008 moveal %fp@(8),%a1 4fcb4: 2f0a movel %a2,%sp@- Heap_Block *current = heap->first_block; 4fcb6: 2069 0020 moveal %a1@(32),%a0 void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 4fcba: 2f02 movel %d2,%sp@- Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; 4fcbc: 2429 0024 movel %a1@(36),%d2 4fcc0: 602a bras 4fcec <_Heap_Iterate+0x40> 4fcc2: 70fe moveq #-2,%d0 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 ); 4fcc4: 7201 moveq #1,%d1 4fcc6: c0a8 0004 andl %a0@(4),%d0 4fcca: 2f2e 0010 movel %fp@(16),%sp@- RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4fcce: 45f0 0800 lea %a0@(00000000,%d0:l),%a2 4fcd2: c2aa 0004 andl %a2@(4),%d1 4fcd6: 2f01 movel %d1,%sp@- 4fcd8: 2f00 movel %d0,%sp@- 4fcda: 2f08 movel %a0,%sp@- 4fcdc: 206e 000c moveal %fp@(12),%a0 4fce0: 4e90 jsr %a0@ { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 4fce2: 4fef 0010 lea %sp@(16),%sp 4fce6: 204a moveal %a2,%a0 4fce8: 4a00 tstb %d0 4fcea: 6604 bnes 4fcf0 <_Heap_Iterate+0x44> <== NEVER TAKEN 4fcec: b488 cmpl %a0,%d2 4fcee: 66d2 bnes 4fcc2 <_Heap_Iterate+0x16> stop = (*visitor)( current, size, used, visitor_arg ); current = next; } } 4fcf0: 242e fff8 movel %fp@(-8),%d2 4fcf4: 246e fffc moveal %fp@(-4),%a2 4fcf8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005b510 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 5b510: 4e56 0000 linkw %fp,#0 5b514: 202e 000c movel %fp@(12),%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 5b518: 2040 moveal %d0,%a0 5b51a: 5188 subql #8,%a0 5b51c: 226e 0008 moveal %fp@(8),%a1 5b520: 2f02 movel %d2,%sp@- 5b522: 2400 movel %d0,%d2 5b524: 4c69 2001 0010 remul %a1@(16),%d1,%d2 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 5b52a: 2429 0020 movel %a1@(32),%d2 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 5b52e: 91c1 subal %d1,%a0 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; 5b530: b488 cmpl %a0,%d2 5b532: 620c bhis 5b540 <_Heap_Size_of_alloc_area+0x30> 5b534: b1e9 0024 cmpal %a1@(36),%a0 5b538: 53c1 sls %d1 5b53a: 49c1 extbl %d1 5b53c: 4481 negl %d1 5b53e: 6002 bras 5b542 <_Heap_Size_of_alloc_area+0x32> 5b540: 4281 clrl %d1 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 ) ) { 5b542: 0801 0000 btst #0,%d1 5b546: 673c beqs 5b584 <_Heap_Size_of_alloc_area+0x74> - 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; 5b548: 72fe moveq #-2,%d1 5b54a: c2a8 0004 andl %a0@(4),%d1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 5b54e: 41f0 1800 lea %a0@(00000000,%d1:l),%a0 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; 5b552: b488 cmpl %a0,%d2 5b554: 620c bhis 5b562 <_Heap_Size_of_alloc_area+0x52> <== NEVER TAKEN 5b556: b1e9 0024 cmpal %a1@(36),%a0 5b55a: 53c1 sls %d1 5b55c: 49c1 extbl %d1 5b55e: 4481 negl %d1 5b560: 6002 bras 5b564 <_Heap_Size_of_alloc_area+0x54> 5b562: 4281 clrl %d1 <== NOT EXECUTED } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 5b564: 0801 0000 btst #0,%d1 5b568: 671a beqs 5b584 <_Heap_Size_of_alloc_area+0x74> <== 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; 5b56a: 7201 moveq #1,%d1 5b56c: c2a8 0004 andl %a0@(4),%d1 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 5b570: 6712 beqs 5b584 <_Heap_Size_of_alloc_area+0x74> <== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 5b572: 7204 moveq #4,%d1 5b574: 9280 subl %d0,%d1 5b576: 2001 movel %d1,%d0 5b578: d088 addl %a0,%d0 5b57a: 226e 0010 moveal %fp@(16),%a1 5b57e: 2280 movel %d0,%a1@ return true; 5b580: 7001 moveq #1,%d0 5b582: 6002 bras 5b586 <_Heap_Size_of_alloc_area+0x76> 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; 5b584: 4200 clrb %d0 } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; } 5b586: 241f movel %sp@+,%d2 5b588: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047d72 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 47d72: 4e56 ffd0 linkw %fp,#-48 47d76: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 47d7a: 266e 0008 moveal %fp@(8),%a3 47d7e: 242e 000c movel %fp@(12),%d2 uintptr_t const page_size = heap->page_size; 47d82: 282b 0010 movel %a3@(16),%d4 uintptr_t const min_block_size = heap->min_block_size; 47d86: 2a2b 0014 movel %a3@(20),%d5 Heap_Block *const first_block = heap->first_block; 47d8a: 286b 0020 moveal %a3@(32),%a4 Heap_Block *const last_block = heap->last_block; 47d8e: 2c2b 0024 movel %a3@(36),%d6 Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 47d92: 4a2e 0013 tstb %fp@(19) 47d96: 6706 beqs 47d9e <_Heap_Walk+0x2c> 47d98: 45fa ff9a lea %pc@(47d34 <_Heap_Walk_print>),%a2 47d9c: 6004 bras 47da2 <_Heap_Walk+0x30> 47d9e: 45fa ff8c lea %pc@(47d2c <_Heap_Walk_print_nothing>),%a2 if ( !_System_state_Is_up( _System_state_Get() ) ) { 47da2: 7003 moveq #3,%d0 47da4: b0b9 0006 1442 cmpl 61442 <_System_state_Current>,%d0 47daa: 6706 beqs 47db2 <_Heap_Walk+0x40> return true; 47dac: 7001 moveq #1,%d0 47dae: 6000 02fc braw 480ac <_Heap_Walk+0x33a> 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)( 47db2: 2f2b 000c movel %a3@(12),%sp@- 47db6: 2f2b 0008 movel %a3@(8),%sp@- 47dba: 2f06 movel %d6,%sp@- 47dbc: 2f0c movel %a4,%sp@- 47dbe: 2f2b 001c movel %a3@(28),%sp@- 47dc2: 2f2b 0018 movel %a3@(24),%sp@- 47dc6: 2f05 movel %d5,%sp@- 47dc8: 2f04 movel %d4,%sp@- 47dca: 4879 0005 d476 pea 5d476 <_Copyright_Notice+0x94> 47dd0: 42a7 clrl %sp@- 47dd2: 2f02 movel %d2,%sp@- 47dd4: 4e92 jsr %a2@ heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 47dd6: 4fef 002c lea %sp@(44),%sp 47dda: 4a84 tstl %d4 47ddc: 6608 bnes 47de6 <_Heap_Walk+0x74> (*printer)( source, true, "page size is zero\n" ); 47dde: 4879 0005 d507 pea 5d507 <_Copyright_Notice+0x125> 47de4: 6076 bras 47e5c <_Heap_Walk+0xea> ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 47de6: 7003 moveq #3,%d0 47de8: c084 andl %d4,%d0 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 47dea: 670c beqs 47df8 <_Heap_Walk+0x86> (*printer)( 47dec: 2f04 movel %d4,%sp@- 47dee: 4879 0005 d51a pea 5d51a <_Copyright_Notice+0x138> 47df4: 6000 02a8 braw 4809e <_Heap_Walk+0x32c> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 47df8: 2205 movel %d5,%d1 47dfa: 4c44 1000 remul %d4,%d0,%d1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 47dfe: 4a80 tstl %d0 47e00: 670c beqs 47e0e <_Heap_Walk+0x9c> (*printer)( 47e02: 2f05 movel %d5,%sp@- 47e04: 4879 0005 d538 pea 5d538 <_Copyright_Notice+0x156> 47e0a: 6000 0292 braw 4809e <_Heap_Walk+0x32c> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 47e0e: 200c movel %a4,%d0 47e10: 5080 addql #8,%d0 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 47e12: 4c44 0001 remul %d4,%d1,%d0 ); return false; } if ( 47e16: 4a81 tstl %d1 47e18: 670c beqs 47e26 <_Heap_Walk+0xb4> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 47e1a: 2f0c movel %a4,%sp@- 47e1c: 4879 0005 d55c pea 5d55c <_Copyright_Notice+0x17a> 47e22: 6000 027a braw 4809e <_Heap_Walk+0x32c> 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; 47e26: 7001 moveq #1,%d0 47e28: c0ac 0004 andl %a4@(4),%d0 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 47e2c: 6608 bnes 47e36 <_Heap_Walk+0xc4> (*printer)( 47e2e: 4879 0005 d58d pea 5d58d <_Copyright_Notice+0x1ab> 47e34: 6026 bras 47e5c <_Heap_Walk+0xea> - 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; 47e36: 70fe moveq #-2,%d0 47e38: 2046 moveal %d6,%a0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 47e3a: 2a46 moveal %d6,%a5 - 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; 47e3c: c0a8 0004 andl %a0@(4),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 47e40: dbc0 addal %d0,%a5 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; 47e42: 7001 moveq #1,%d0 47e44: c0ad 0004 andl %a5@(4),%d0 ); return false; } if ( _Heap_Is_free( last_block ) ) { 47e48: 6608 bnes 47e52 <_Heap_Walk+0xe0> (*printer)( 47e4a: 4879 0005 d5bb pea 5d5bb <_Copyright_Notice+0x1d9> 47e50: 600a bras 47e5c <_Heap_Walk+0xea> ); return false; } if ( 47e52: b9cd cmpal %a5,%a4 47e54: 6716 beqs 47e6c <_Heap_Walk+0xfa> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 47e56: 4879 0005 d5d0 pea 5d5d0 <_Copyright_Notice+0x1ee> 47e5c: 4878 0001 pea 1 47e60: 2f02 movel %d2,%sp@- 47e62: 4e92 jsr %a2@ 47e64: 4fef 000c lea %sp@(12),%sp 47e68: 6000 0228 braw 48092 <_Heap_Walk+0x320> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 47e6c: 222b 0010 movel %a3@(16),%d1 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 47e70: 224b moveal %a3,%a1 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 47e72: 206b 0008 moveal %a3@(8),%a0 47e76: 6074 bras 47eec <_Heap_Walk+0x17a> 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; 47e78: b1eb 0020 cmpal %a3@(32),%a0 47e7c: 650c bcss 47e8a <_Heap_Walk+0x118> 47e7e: b1eb 0024 cmpal %a3@(36),%a0 47e82: 53c0 sls %d0 47e84: 49c0 extbl %d0 47e86: 4480 negl %d0 47e88: 6002 bras 47e8c <_Heap_Walk+0x11a> 47e8a: 4280 clrl %d0 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 ) ) { 47e8c: 0800 0000 btst #0,%d0 47e90: 660c bnes 47e9e <_Heap_Walk+0x12c> (*printer)( 47e92: 2f08 movel %a0,%sp@- 47e94: 4879 0005 d5ff pea 5d5ff <_Copyright_Notice+0x21d> 47e9a: 6000 0202 braw 4809e <_Heap_Walk+0x32c> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 47e9e: 2008 movel %a0,%d0 47ea0: 5080 addql #8,%d0 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 47ea2: 4c41 0003 remul %d1,%d3,%d0 ); return false; } if ( 47ea6: 4a83 tstl %d3 47ea8: 670c beqs 47eb6 <_Heap_Walk+0x144> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 47eaa: 2f08 movel %a0,%sp@- 47eac: 4879 0005 d61f pea 5d61f <_Copyright_Notice+0x23d> 47eb2: 6000 01ea braw 4809e <_Heap_Walk+0x32c> - 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; 47eb6: 70fe moveq #-2,%d0 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; 47eb8: 7601 moveq #1,%d3 - 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; 47eba: c0a8 0004 andl %a0@(4),%d0 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; 47ebe: c6b0 0804 andl %a0@(00000004,%d0:l),%d3 ); return false; } if ( _Heap_Is_used( free_block ) ) { 47ec2: 670c beqs 47ed0 <_Heap_Walk+0x15e> (*printer)( 47ec4: 2f08 movel %a0,%sp@- 47ec6: 4879 0005 d64f pea 5d64f <_Copyright_Notice+0x26d> 47ecc: 6000 01d0 braw 4809e <_Heap_Walk+0x32c> ); return false; } if ( free_block->prev != prev_block ) { 47ed0: 2028 000c movel %a0@(12),%d0 47ed4: b3c0 cmpal %d0,%a1 47ed6: 670e beqs 47ee6 <_Heap_Walk+0x174> (*printer)( 47ed8: 2f00 movel %d0,%sp@- 47eda: 2f08 movel %a0,%sp@- 47edc: 4879 0005 d66b pea 5d66b <_Copyright_Notice+0x289> 47ee2: 6000 00aa braw 47f8e <_Heap_Walk+0x21c> return false; } prev_block = free_block; free_block = free_block->next; 47ee6: 2248 moveal %a0,%a1 47ee8: 2068 0008 moveal %a0@(8),%a0 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 ) { 47eec: b7c8 cmpal %a0,%a3 47eee: 6688 bnes 47e78 <_Heap_Walk+0x106> 47ef0: 284d moveal %a5,%a4 block = next_block; } while ( block != first_block ); return true; } 47ef2: 202c 0004 movel %a4@(4),%d0 47ef6: 7201 moveq #1,%d1 - 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; 47ef8: 76fe moveq #-2,%d3 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; 47efa: c280 andl %d0,%d1 - 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; 47efc: c680 andl %d0,%d3 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; 47efe: 2d41 fffc movel %d1,%fp@(-4) 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; 47f02: bc8c cmpl %a4,%d6 47f04: 56c1 sne %d1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 47f06: 2e03 movel %d3,%d7 47f08: de8c addl %a4,%d7 47f0a: 2001 movel %d1,%d0 47f0c: 4480 negl %d0 47f0e: 1d40 fffb moveb %d0,%fp@(-5) 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; 47f12: beab 0020 cmpl %a3@(32),%d7 47f16: 650c bcss 47f24 <_Heap_Walk+0x1b2> <== NEVER TAKEN 47f18: beab 0024 cmpl %a3@(36),%d7 47f1c: 53c0 sls %d0 47f1e: 49c0 extbl %d0 47f20: 4480 negl %d0 47f22: 6002 bras 47f26 <_Heap_Walk+0x1b4> 47f24: 4280 clrl %d0 <== NOT EXECUTED if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 47f26: 0800 0000 btst #0,%d0 47f2a: 660c bnes 47f38 <_Heap_Walk+0x1c6> (*printer)( 47f2c: 2f07 movel %d7,%sp@- 47f2e: 2f0c movel %a4,%sp@- 47f30: 4879 0005 d69d pea 5d69d <_Copyright_Notice+0x2bb> 47f36: 6056 bras 47f8e <_Heap_Walk+0x21c> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 47f38: 2203 movel %d3,%d1 47f3a: 4c44 1000 remul %d4,%d0,%d1 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 47f3e: 4a80 tstl %d0 47f40: 6712 beqs 47f54 <_Heap_Walk+0x1e2> 47f42: 4a2e fffb tstb %fp@(-5) 47f46: 6756 beqs 47f9e <_Heap_Walk+0x22c> (*printer)( 47f48: 2f03 movel %d3,%sp@- 47f4a: 2f0c movel %a4,%sp@- 47f4c: 4879 0005 d6ca pea 5d6ca <_Copyright_Notice+0x2e8> 47f52: 603a bras 47f8e <_Heap_Walk+0x21c> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 47f54: ba83 cmpl %d3,%d5 47f56: 6322 blss 47f7a <_Heap_Walk+0x208> 47f58: 4a2e fffb tstb %fp@(-5) 47f5c: 6740 beqs 47f9e <_Heap_Walk+0x22c> <== NEVER TAKEN (*printer)( 47f5e: 2f05 movel %d5,%sp@- 47f60: 2f03 movel %d3,%sp@- 47f62: 2f0c movel %a4,%sp@- 47f64: 4879 0005 d6f8 pea 5d6f8 <_Copyright_Notice+0x316> 47f6a: 4878 0001 pea 1 47f6e: 2f02 movel %d2,%sp@- 47f70: 4e92 jsr %a2@ block, block_size, min_block_size ); return false; 47f72: 4fef 0018 lea %sp@(24),%sp 47f76: 6000 011a braw 48092 <_Heap_Walk+0x320> } if ( next_block_begin <= block_begin && is_not_last_block ) { 47f7a: b9c7 cmpal %d7,%a4 47f7c: 6520 bcss 47f9e <_Heap_Walk+0x22c> 47f7e: 4a2e fffb tstb %fp@(-5) 47f82: 671a beqs 47f9e <_Heap_Walk+0x22c> (*printer)( 47f84: 2f07 movel %d7,%sp@- 47f86: 2f0c movel %a4,%sp@- 47f88: 4879 0005 d723 pea 5d723 <_Copyright_Notice+0x341> 47f8e: 4878 0001 pea 1 47f92: 2f02 movel %d2,%sp@- 47f94: 4e92 jsr %a2@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 47f96: 4fef 0014 lea %sp@(20),%sp 47f9a: 6000 00f6 braw 48092 <_Heap_Walk+0x320> 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; 47f9e: 7001 moveq #1,%d0 47fa0: 2047 moveal %d7,%a0 47fa2: c0a8 0004 andl %a0@(4),%d0 } if ( !_Heap_Is_prev_used( next_block ) ) { 47fa6: 6600 00ac bnew 48054 <_Heap_Walk+0x2e2> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 47faa: 222b 0008 movel %a3@(8),%d1 block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 47fae: 206c 0008 moveal %a4@(8),%a0 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)( 47fb2: b1eb 000c cmpal %a3@(12),%a0 47fb6: 6712 beqs 47fca <_Heap_Walk+0x258> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 47fb8: 43f9 0005 d31e lea 5d31e ,%a1 47fbe: b7c8 cmpal %a0,%a3 47fc0: 660e bnes 47fd0 <_Heap_Walk+0x25e> 47fc2: 43f9 0005 d452 lea 5d452 <_Copyright_Notice+0x70>,%a1 47fc8: 6006 bras 47fd0 <_Heap_Walk+0x25e> 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)( 47fca: 43f9 0005 d443 lea 5d443 <_Copyright_Notice+0x61>,%a1 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 ? 47fd0: 202c 000c movel %a4@(12),%d0 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)( 47fd4: b280 cmpl %d0,%d1 47fd6: 6712 beqs 47fea <_Heap_Walk+0x278> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 47fd8: 223c 0005 d31e movel #381726,%d1 47fde: b7c0 cmpal %d0,%a3 47fe0: 660e bnes 47ff0 <_Heap_Walk+0x27e> 47fe2: 223c 0005 d46c movel #382060,%d1 47fe8: 6006 bras 47ff0 <_Heap_Walk+0x27e> 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)( 47fea: 223c 0005 d45c movel #382044,%d1 47ff0: 2f09 movel %a1,%sp@- 47ff2: 2f08 movel %a0,%sp@- 47ff4: 2f01 movel %d1,%sp@- 47ff6: 2f00 movel %d0,%sp@- 47ff8: 2f03 movel %d3,%sp@- 47ffa: 2f0c movel %a4,%sp@- 47ffc: 4879 0005 d757 pea 5d757 <_Copyright_Notice+0x375> 48002: 42a7 clrl %sp@- 48004: 2f02 movel %d2,%sp@- 48006: 4e92 jsr %a2@ block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 48008: 4fef 0024 lea %sp@(36),%sp 4800c: 2047 moveal %d7,%a0 4800e: 2010 movel %a0@,%d0 48010: b083 cmpl %d3,%d0 48012: 671c beqs 48030 <_Heap_Walk+0x2be> (*printer)( 48014: 2f07 movel %d7,%sp@- 48016: 2f00 movel %d0,%sp@- 48018: 2f03 movel %d3,%sp@- 4801a: 2f0c movel %a4,%sp@- 4801c: 4879 0005 d78c pea 5d78c <_Copyright_Notice+0x3aa> 48022: 4878 0001 pea 1 48026: 2f02 movel %d2,%sp@- 48028: 4e92 jsr %a2@ 4802a: 4fef 001c lea %sp@(28),%sp 4802e: 6062 bras 48092 <_Heap_Walk+0x320> ); return false; } if ( !prev_used ) { 48030: 4aae fffc tstl %fp@(-4) 48034: 660a bnes 48040 <_Heap_Walk+0x2ce> (*printer)( 48036: 2f0c movel %a4,%sp@- 48038: 4879 0005 d7c5 pea 5d7c5 <_Copyright_Notice+0x3e3> 4803e: 605e bras 4809e <_Heap_Walk+0x32c> 48040: 206b 0008 moveal %a3@(8),%a0 48044: 6008 bras 4804e <_Heap_Walk+0x2dc> { 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 ) { 48046: b9c8 cmpal %a0,%a4 48048: 673c beqs 48086 <_Heap_Walk+0x314> return true; } free_block = free_block->next; 4804a: 2068 0008 moveal %a0@(8),%a0 ) { 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 ) { 4804e: b7c8 cmpal %a0,%a3 48050: 66f4 bnes 48046 <_Heap_Walk+0x2d4> 48052: 6042 bras 48096 <_Heap_Walk+0x324> if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 48054: 4aae fffc tstl %fp@(-4) 48058: 6716 beqs 48070 <_Heap_Walk+0x2fe> (*printer)( 4805a: 2f03 movel %d3,%sp@- 4805c: 2f0c movel %a4,%sp@- 4805e: 4879 0005 d7f4 pea 5d7f4 <_Copyright_Notice+0x412> 48064: 42a7 clrl %sp@- 48066: 2f02 movel %d2,%sp@- 48068: 4e92 jsr %a2@ 4806a: 4fef 0014 lea %sp@(20),%sp 4806e: 6016 bras 48086 <_Heap_Walk+0x314> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 48070: 2f14 movel %a4@,%sp@- 48072: 2f03 movel %d3,%sp@- 48074: 2f0c movel %a4,%sp@- 48076: 4879 0005 d80b pea 5d80b <_Copyright_Notice+0x429> 4807c: 42a7 clrl %sp@- 4807e: 2f02 movel %d2,%sp@- 48080: 4e92 jsr %a2@ 48082: 4fef 0018 lea %sp@(24),%sp 48086: 2847 moveal %d7,%a4 block->prev_size ); } block = next_block; } while ( block != first_block ); 48088: bbc7 cmpal %d7,%a5 4808a: 6600 fe66 bnew 47ef2 <_Heap_Walk+0x180> 4808e: 6000 fd1c braw 47dac <_Heap_Walk+0x3a> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 48092: 4200 clrb %d0 48094: 6016 bras 480ac <_Heap_Walk+0x33a> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 48096: 2f0c movel %a4,%sp@- 48098: 4879 0005 d830 pea 5d830 <_Copyright_Notice+0x44e> 4809e: 4878 0001 pea 1 480a2: 2f02 movel %d2,%sp@- 480a4: 4e92 jsr %a2@ 480a6: 4fef 0010 lea %sp@(16),%sp 480aa: 60e6 bras 48092 <_Heap_Walk+0x320> block = next_block; } while ( block != first_block ); return true; } 480ac: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5 480b2: 4e5e unlk %fp ... =============================================================================== 00047550 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 47550: 4e56 ffe8 linkw %fp,#-24 47554: 48d7 001c moveml %d2-%d4,%sp@ Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 47558: 4879 0004 90c6 pea 490c6 <_User_extensions_Fatal_visitor> 4755e: 262e 0008 movel %fp@(8),%d3 47562: 486e fff6 pea %fp@(-10) 47566: 242e 0010 movel %fp@(16),%d2 4756a: 282e 000c movel %fp@(12),%d4 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 4756e: 2d43 fff6 movel %d3,%fp@(-10) 47572: 1d44 fffa moveb %d4,%fp@(-6) 47576: 2d42 fffc movel %d2,%fp@(-4) _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 4757a: 4eb9 0004 90f6 jsr 490f6 <_User_extensions_Iterate> RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 47580: 7005 moveq #5,%d0 <== NOT EXECUTED _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; 47582: 23c3 0005 f300 movel %d3,5f300 <_Internal_errors_What_happened><== NOT EXECUTED _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 ); 47588: 263c 0000 0700 movel #1792,%d3 <== NOT EXECUTED ) { _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; 4758e: 13c4 0005 f304 moveb %d4,5f304 <_Internal_errors_What_happened+0x4><== NOT EXECUTED _Internal_errors_What_happened.the_error = the_error; 47594: 23c2 0005 f306 movel %d2,5f306 <_Internal_errors_What_happened+0x6><== NOT EXECUTED 4759a: 23c0 0005 f30a movel %d0,5f30a <_System_state_Current> <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 475a0: 40c0 movew %sr,%d0 <== NOT EXECUTED 475a2: 8083 orl %d3,%d0 <== NOT EXECUTED 475a4: 46c0 movew %d0,%sr <== NOT EXECUTED 475a6: 2002 movel %d2,%d0 <== NOT EXECUTED 475a8: 223c dead beef movel #-559038737,%d1 <== NOT EXECUTED 475ae: 4ac8 halt <== NOT EXECUTED 475b0: 508f addql #8,%sp <== NOT EXECUTED 475b2: 60fe bras 475b2 <_Internal_error_Occurred+0x62> <== NOT EXECUTED =============================================================================== 00047614 <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { 47614: 4e56 fff0 linkw %fp,#-16 47618: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 4761c: 246e 0008 moveal %fp@(8),%a2 * 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 ) 47620: 4aaa 0014 tstl %a2@(20) 47624: 6604 bnes 4762a <_Objects_Allocate+0x16> <== ALWAYS TAKEN return NULL; 47626: 4280 clrl %d0 47628: 6066 bras 47690 <_Objects_Allocate+0x7c> /* * 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 ); 4762a: 240a movel %a2,%d2 4762c: 0682 0000 001c addil #28,%d2 47632: 47f9 0004 6d5c lea 46d5c <_Chain_Get>,%a3 47638: 2f02 movel %d2,%sp@- 4763a: 4e93 jsr %a3@ if ( information->auto_extend ) { 4763c: 588f addql #4,%sp 4763e: 4a2a 0010 tstb %a2@(16) 47642: 674c beqs 47690 <_Objects_Allocate+0x7c> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 47644: 4a80 tstl %d0 47646: 6612 bnes 4765a <_Objects_Allocate+0x46> _Objects_Extend_information( information ); 47648: 2f0a movel %a2,%sp@- 4764a: 4eb9 0004 76c8 jsr 476c8 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 47650: 2f02 movel %d2,%sp@- 47652: 4e93 jsr %a3@ } if ( the_object ) { 47654: 508f addql #8,%sp 47656: 4a80 tstl %d0 47658: 67cc beqs 47626 <_Objects_Allocate+0x12> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 4765a: 2040 moveal %d0,%a0 4765c: 242a 0006 movel %a2@(6),%d2 47660: 2228 0008 movel %a0@(8),%d1 47664: 0282 0000 ffff andil #65535,%d2 4766a: 0281 0000 ffff andil #65535,%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 47670: 206a 002a moveal %a2@(42),%a0 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 47674: 9282 subl %d2,%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 47676: 4282 clrl %d2 47678: 342a 0012 movew %a2@(18),%d2 4767c: 4c42 1001 remul %d2,%d1,%d1 information->inactive_per_block[ block ]--; 47680: e589 lsll #2,%d1 47682: d1c1 addal %d1,%a0 47684: 5390 subql #1,%a0@ information->inactive--; 47686: 322a 0028 movew %a2@(40),%d1 4768a: 5381 subql #1,%d1 4768c: 3541 0028 movew %d1,%a2@(40) ); } #endif return the_object; } 47690: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 47696: 4e5e unlk %fp ... =============================================================================== 0004769c <_Objects_Close>: void _Objects_Close( Objects_Information *information, Objects_Control *the_object ) { 4769c: 4e56 0000 linkw %fp,#0 476a0: 226e 000c moveal %fp@(12),%a1 476a4: 206e 0008 moveal %fp@(8),%a0 RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id( Objects_Information *information, Objects_Control *the_object ) { _Objects_Set_local_object( 476a8: 2029 0008 movel %a1@(8),%d0 476ac: 2f0a movel %a2,%sp@- #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 476ae: 2468 0018 moveal %a0@(24),%a2 RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id( Objects_Information *information, Objects_Control *the_object ) { _Objects_Set_local_object( 476b2: 0280 0000 ffff andil #65535,%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 476b8: 42b2 0c00 clrl %a2@(00000000,%d0:l:4) _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); } 476bc: 245f moveal %sp@+,%a2 476be: 4e5e unlk %fp Objects_Control *the_object ) { _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 476c0: 4ef9 0004 7bd4 jmp 47bd4 <_Objects_Namespace_remove> ... =============================================================================== 000479dc <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 479dc: 4e56 0000 linkw %fp,#0 479e0: 2f03 movel %d3,%sp@- 479e2: 362e 000e movew %fp@(14),%d3 479e6: 2f02 movel %d2,%sp@- 479e8: 242e 0008 movel %fp@(8),%d2 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 479ec: 4a43 tstw %d3 479ee: 6604 bnes 479f4 <_Objects_Get_information+0x18> return NULL; 479f0: 4280 clrl %d0 479f2: 6034 bras 47a28 <_Objects_Get_information+0x4c> /* * 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 ); 479f4: 2f02 movel %d2,%sp@- 479f6: 4eb9 0004 b6d0 jsr 4b6d0 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 479fc: 588f addql #4,%sp 479fe: 4a80 tstl %d0 47a00: 67ee beqs 479f0 <_Objects_Get_information+0x14> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 47a02: 0283 0000 ffff andil #65535,%d3 47a08: b083 cmpl %d3,%d0 47a0a: 65e4 bcss 479f0 <_Objects_Get_information+0x14> return NULL; if ( !_Objects_Information_table[ the_api ] ) 47a0c: 41f9 0005 ee92 lea 5ee92 <_Objects_Information_table>,%a0 47a12: 2070 2c00 moveal %a0@(00000000,%d2:l:4),%a0 47a16: 4a88 tstl %a0 47a18: 67d6 beqs 479f0 <_Objects_Get_information+0x14> <== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 47a1a: 2030 3c00 movel %a0@(00000000,%d3:l:4),%d0 if ( !info ) 47a1e: 67d0 beqs 479f0 <_Objects_Get_information+0x14> <== 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 ) 47a20: 2040 moveal %d0,%a0 47a22: 4a68 000e tstw %a0@(14) 47a26: 67c8 beqs 479f0 <_Objects_Get_information+0x14> return NULL; #endif return info; } 47a28: 242e fff8 movel %fp@(-8),%d2 47a2c: 262e fffc movel %fp@(-4),%d3 47a30: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000516c8 <_Objects_Get_name_as_string>: char *_Objects_Get_name_as_string( Objects_Id id, size_t length, char *name ) { 516c8: 4e56 ffe4 linkw %fp,#-28 516cc: 48d7 041c moveml %d2-%d4/%a2,%sp@ 516d0: 262e 0008 movel %fp@(8),%d3 516d4: 282e 000c movel %fp@(12),%d4 516d8: 242e 0010 movel %fp@(16),%d2 char lname[5]; Objects_Control *the_object; Objects_Locations location; Objects_Id tmpId; if ( length == 0 ) 516dc: 4a84 tstl %d4 516de: 6604 bnes 516e4 <_Objects_Get_name_as_string+0x1c> 516e0: 6000 00ba braw 5179c <_Objects_Get_name_as_string+0xd4> return NULL; if ( name == NULL ) 516e4: 4a82 tstl %d2 516e6: 6700 00b4 beqw 5179c <_Objects_Get_name_as_string+0xd4> return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 516ea: 4a83 tstl %d3 516ec: 660a bnes 516f8 <_Objects_Get_name_as_string+0x30> 516ee: 2079 0006 a5d2 moveal 6a5d2 <_Per_CPU_Information+0xe>,%a0 516f4: 2628 0008 movel %a0@(8),%d3 information = _Objects_Get_information_id( tmpId ); 516f8: 2f03 movel %d3,%sp@- 516fa: 4eb9 0004 aee8 jsr 4aee8 <_Objects_Get_information_id> if ( !information ) 51700: 588f addql #4,%sp if ( name == NULL ) return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; information = _Objects_Get_information_id( tmpId ); 51702: 2440 moveal %d0,%a2 if ( !information ) 51704: 4a80 tstl %d0 51706: 6700 0094 beqw 5179c <_Objects_Get_name_as_string+0xd4> return NULL; the_object = _Objects_Get( information, tmpId, &location ); 5170a: 486e fff6 pea %fp@(-10) 5170e: 2f03 movel %d3,%sp@- 51710: 2f00 movel %d0,%sp@- 51712: 4eb9 0004 afc4 jsr 4afc4 <_Objects_Get> switch ( location ) { 51718: 4fef 000c lea %sp@(12),%sp 5171c: 4aae fff6 tstl %fp@(-10) 51720: 667a bnes 5179c <_Objects_Get_name_as_string+0xd4> case OBJECTS_LOCAL: #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { s = the_object->name.name_p; 51722: 2040 moveal %d0,%a0 return NULL; case OBJECTS_LOCAL: #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 51724: 4a2a 0032 tstb %a2@(50) 51728: 670a beqs 51734 <_Objects_Get_name_as_string+0x6c> s = the_object->name.name_p; 5172a: 2028 000c movel %a0@(12),%d0 lname[ 4 ] = '\0'; s = lname; } d = name; if ( s ) { 5172e: 6632 bnes 51762 <_Objects_Get_name_as_string+0x9a><== NEVER TAKEN 51730: 2042 moveal %d2,%a0 51732: 605e bras 51792 <_Objects_Get_name_as_string+0xca> if ( information->is_string ) { s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; 51734: 2028 000c movel %a0@(12),%d0 lname[ 0 ] = (u32_name >> 24) & 0xff; 51738: 7618 moveq #24,%d3 5173a: 2200 movel %d0,%d1 5173c: e6a9 lsrl %d3,%d1 5173e: 1d41 fffb moveb %d1,%fp@(-5) lname[ 1 ] = (u32_name >> 16) & 0xff; 51742: 2200 movel %d0,%d1 51744: 4241 clrw %d1 51746: 4841 swap %d1 lname[ 2 ] = (u32_name >> 8) & 0xff; lname[ 3 ] = (u32_name >> 0) & 0xff; 51748: 1d40 fffe moveb %d0,%fp@(-2) #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; 5174c: 1d41 fffc moveb %d1,%fp@(-4) lname[ 2 ] = (u32_name >> 8) & 0xff; 51750: 2200 movel %d0,%d1 51752: e089 lsrl #8,%d1 lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 51754: 4200 clrb %d0 { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 51756: 1d41 fffd moveb %d1,%fp@(-3) lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 5175a: 1d40 ffff moveb %d0,%fp@(-1) s = lname; 5175e: 200e movel %fp,%d0 51760: 5b80 subql #5,%d0 51762: 2240 moveal %d0,%a1 } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { *d = (isprint((unsigned char)*s)) ? *s : '*'; 51764: 2042 moveal %d2,%a0 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 51766: 5384 subql #1,%d4 51768: 601c bras 51786 <_Objects_Get_name_as_string+0xbe> *d = (isprint((unsigned char)*s)) ? *s : '*'; 5176a: 4281 clrl %d1 5176c: 1200 moveb %d0,%d1 5176e: 2479 0006 83e0 moveal 683e0 <__ctype_ptr__>,%a2 51774: 1232 1801 moveb %a2@(00000001,%d1:l),%d1 51778: 49c1 extbl %d1 5177a: 0281 0000 0097 andil #151,%d1 51780: 6602 bnes 51784 <_Objects_Get_name_as_string+0xbc> 51782: 702a moveq #42,%d0 51784: 10c0 moveb %d0,%a0@+ s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 51786: 2008 movel %a0,%d0 51788: 9082 subl %d2,%d0 5178a: b880 cmpl %d0,%d4 5178c: 6304 blss 51792 <_Objects_Get_name_as_string+0xca> 5178e: 1019 moveb %a1@+,%d0 51790: 66d8 bnes 5176a <_Objects_Get_name_as_string+0xa2> *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; 51792: 4210 clrb %a0@ _Thread_Enable_dispatch(); 51794: 4eb9 0004 bcc0 jsr 4bcc0 <_Thread_Enable_dispatch> 5179a: 6002 bras 5179e <_Objects_Get_name_as_string+0xd6> #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* not supported */ #endif case OBJECTS_ERROR: return NULL; 5179c: 4282 clrl %d2 _Thread_Enable_dispatch(); return name; } return NULL; /* unreachable path */ } 5179e: 2002 movel %d2,%d0 517a0: 4cee 041c ffe4 moveml %fp@(-28),%d2-%d4/%a2 517a6: 4e5e unlk %fp ... =============================================================================== 00054c10 <_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; 54c10: 7001 moveq #1,%d0 if ( information->maximum >= index ) { 54c12: 4281 clrl %d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 54c14: 4e56 0000 linkw %fp,#0 54c18: 206e 0008 moveal %fp@(8),%a0 /* * 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; 54c1c: 90a8 0006 subl %a0@(6),%d0 54c20: d0ae 000c addl %fp@(12),%d0 if ( information->maximum >= index ) { 54c24: 3228 000e movew %a0@(14),%d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 54c28: 226e 0010 moveal %fp@(16),%a1 * 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; if ( information->maximum >= index ) { 54c2c: b081 cmpl %d1,%d0 54c2e: 620e bhis 54c3e <_Objects_Get_no_protection+0x2e> if ( (the_object = information->local_table[ index ]) != NULL ) { 54c30: 2068 0018 moveal %a0@(24),%a0 54c34: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 54c38: 6704 beqs 54c3e <_Objects_Get_no_protection+0x2e><== NEVER TAKEN *location = OBJECTS_LOCAL; 54c3a: 4291 clrl %a1@ return the_object; 54c3c: 6006 bras 54c44 <_Objects_Get_no_protection+0x34> /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 54c3e: 7001 moveq #1,%d0 54c40: 2280 movel %d0,%a1@ return NULL; 54c42: 4280 clrl %d0 } 54c44: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004b024 <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 4b024: 4e56 fffc linkw %fp,#-4 4b028: 222e 0008 movel %fp@(8),%d1 4b02c: 2f02 movel %d2,%sp@- /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 4b02e: 4a81 tstl %d1 4b030: 660a bnes 4b03c <_Objects_Id_to_name+0x18> 4b032: 2079 0006 a5d2 moveal 6a5d2 <_Per_CPU_Information+0xe>,%a0 4b038: 2228 0008 movel %a0@(8),%d1 4b03c: 7418 moveq #24,%d2 4b03e: 2001 movel %d1,%d0 4b040: e4a8 lsrl %d2,%d0 4b042: 143c 0007 moveb #7,%d2 4b046: c082 andl %d2,%d0 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 4b048: 143c 0002 moveb #2,%d2 4b04c: 2040 moveal %d0,%a0 4b04e: 5388 subql #1,%a0 4b050: b488 cmpl %a0,%d2 4b052: 6442 bccs 4b096 <_Objects_Id_to_name+0x72> the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 4b054: 7003 moveq #3,%d0 4b056: 604e bras 4b0a6 <_Objects_Id_to_name+0x82> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 4b058: 2001 movel %d1,%d0 4b05a: 741b moveq #27,%d2 4b05c: e4a8 lsrl %d2,%d0 if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 4b05e: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 if ( !information ) 4b062: 4a88 tstl %a0 4b064: 67ee beqs 4b054 <_Objects_Id_to_name+0x30> <== NEVER TAKEN return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 4b066: 4a28 0032 tstb %a0@(50) 4b06a: 66e8 bnes 4b054 <_Objects_Id_to_name+0x30> <== NEVER TAKEN return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 4b06c: 486e fffc pea %fp@(-4) 4b070: 2f01 movel %d1,%sp@- 4b072: 2f08 movel %a0,%sp@- 4b074: 4eb9 0004 afc4 jsr 4afc4 <_Objects_Get> if ( !the_object ) 4b07a: 4fef 000c lea %sp@(12),%sp 4b07e: 4a80 tstl %d0 4b080: 67d2 beqs 4b054 <_Objects_Id_to_name+0x30> return OBJECTS_INVALID_ID; *name = the_object->name; 4b082: 206e 000c moveal %fp@(12),%a0 4b086: 2240 moveal %d0,%a1 4b088: 20a9 000c movel %a1@(12),%a0@ _Thread_Enable_dispatch(); 4b08c: 4eb9 0004 bcc0 jsr 4bcc0 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 4b092: 4280 clrl %d0 4b094: 6010 bras 4b0a6 <_Objects_Id_to_name+0x82> the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 4b096: 41f9 0006 a10e lea 6a10e <_Objects_Information_table>,%a0 4b09c: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 4b0a0: 4a88 tstl %a0 4b0a2: 66b4 bnes 4b058 <_Objects_Id_to_name+0x34> 4b0a4: 60ae bras 4b054 <_Objects_Id_to_name+0x30> return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 4b0a6: 242e fff8 movel %fp@(-8),%d2 4b0aa: 4e5e unlk %fp ... =============================================================================== 000461e4 <_POSIX_Keys_Free_memory>: #include void _POSIX_Keys_Free_memory( POSIX_Keys_Control *the_key ) { 461e4: 4e56 0000 linkw %fp,#0 461e8: 2f0b movel %a3,%sp@- uint32_t the_api; for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) _Workspace_Free( the_key->Values[ the_api ] ); 461ea: 47f9 0004 a20c lea 4a20c <_Workspace_Free>,%a3 #include void _POSIX_Keys_Free_memory( POSIX_Keys_Control *the_key ) { 461f0: 2f0a movel %a2,%sp@- 461f2: 246e 0008 moveal %fp@(8),%a2 uint32_t the_api; for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) _Workspace_Free( the_key->Values[ the_api ] ); 461f6: 2f2a 0018 movel %a2@(24),%sp@- 461fa: 4e93 jsr %a3@ 461fc: 2f2a 001c movel %a2@(28),%sp@- 46200: 4e93 jsr %a3@ 46202: 2d6a 0020 0008 movel %a2@(32),%fp@(8) 46208: 508f addql #8,%sp } 4620a: 246e fff8 moveal %fp@(-8),%a2 4620e: 266e fffc moveal %fp@(-4),%a3 46212: 4e5e unlk %fp ) { uint32_t the_api; for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) _Workspace_Free( the_key->Values[ the_api ] ); 46214: 4ef9 0004 a20c jmp 4a20c <_Workspace_Free> ... =============================================================================== 0004c8f8 <_POSIX_Keys_Run_destructors>: 4c8f8: 7218 moveq #24,%d1 */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { 4c8fa: 4e56 ffe8 linkw %fp,#-24 Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id ); 4c8fe: 206e 0008 moveal %fp@(8),%a0 */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { 4c902: 48d7 047c moveml %d2-%d6/%a2,%sp@ Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id ); 4c906: 2428 0008 movel %a0@(8),%d2 4c90a: 2002 movel %d2,%d0 4c90c: e2a8 lsrl %d1,%d0 4c90e: 123c 0007 moveb #7,%d1 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 ]; 4c912: 0282 0000 ffff andil #65535,%d2 4c918: c081 andl %d1,%d0 4c91a: e58a lsll #2,%d2 4c91c: 2a00 movel %d0,%d5 4c91e: 5a85 addql #5,%d5 Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 4c920: 4286 clrl %d6 4c922: 7601 moveq #1,%d3 */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; 4c924: 7201 moveq #1,%d1 for ( index = 1 ; index <= max ; ++index ) { 4c926: 3c39 0005 f200 movew 5f200 <_POSIX_Keys_Information+0xe>,%d6 4c92c: 6030 bras 4c95e <_POSIX_Keys_Run_destructors+0x66> POSIX_Keys_Control *key = (POSIX_Keys_Control *) 4c92e: 2079 0005 f20a moveal 5f20a <_POSIX_Keys_Information+0x18>,%a0 4c934: 2070 4c00 moveal %a0@(00000000,%d4:l:4),%a0 _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { 4c938: 4a88 tstl %a0 4c93a: 6720 beqs 4c95c <_POSIX_Keys_Run_destructors+0x64> 4c93c: 4aa8 0010 tstl %a0@(16) 4c940: 671a beqs 4c95c <_POSIX_Keys_Run_destructors+0x64> void *value = key->Values [ thread_api ][ thread_index ]; 4c942: 2470 5c00 moveal %a0@(00000000,%d5:l:4),%a2 4c946: d5c2 addal %d2,%a2 4c948: 2252 moveal %a2@,%a1 if ( value != NULL ) { 4c94a: 4a89 tstl %a1 4c94c: 670e beqs 4c95c <_POSIX_Keys_Run_destructors+0x64><== ALWAYS TAKEN key->Values [ thread_api ][ thread_index ] = NULL; 4c94e: 4292 clrl %a2@ <== NOT EXECUTED (*key->destructor)( value ); 4c950: 2f09 movel %a1,%sp@- <== NOT EXECUTED 4c952: 2068 0010 moveal %a0@(16),%a0 <== NOT EXECUTED 4c956: 4e90 jsr %a0@ <== NOT EXECUTED 4c958: 588f addql #4,%sp <== NOT EXECUTED done = false; 4c95a: 4201 clrb %d1 <== NOT EXECUTED Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 4c95c: 5283 addql #1,%d3 4c95e: 4284 clrl %d4 4c960: 3803 movew %d3,%d4 4c962: bc84 cmpl %d4,%d6 4c964: 64c8 bccs 4c92e <_POSIX_Keys_Run_destructors+0x36> * 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 ) { 4c966: 4a01 tstb %d1 4c968: 67b6 beqs 4c920 <_POSIX_Keys_Run_destructors+0x28><== NEVER TAKEN done = false; } } } } } 4c96a: 4cee 047c ffe8 moveml %fp@(-24),%d2-%d6/%a2 4c970: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a750 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 4a750: 4e56 ffe4 linkw %fp,#-28 4a754: 48d7 043c moveml %d2-%d5/%a2,%sp@ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd ( mqd_t id, Objects_Locations *location ) { return (POSIX_Message_queue_Control_fd *) _Objects_Get( 4a758: 486e fff8 pea %fp@(-8) 4a75c: 242e 0008 movel %fp@(8),%d2 4a760: 2f02 movel %d2,%sp@- 4a762: 4879 0006 70ca pea 670ca <_POSIX_Message_queue_Information_fds> 4a768: 246e 0014 moveal %fp@(20),%a2 4a76c: 162e 001b moveb %fp@(27),%d3 4a770: 4eb9 0004 d6b0 jsr 4d6b0 <_Objects_Get> Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 4a776: 4fef 000c lea %sp@(12),%sp 4a77a: 4aae fff8 tstl %fp@(-8) 4a77e: 6600 00c0 bnew 4a840 <_POSIX_Message_queue_Receive_support+0xf0> case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 4a782: 2040 moveal %d0,%a0 4a784: 7803 moveq #3,%d4 4a786: 7a01 moveq #1,%d5 4a788: 2228 0014 movel %a0@(20),%d1 4a78c: c881 andl %d1,%d4 4a78e: ba84 cmpl %d4,%d5 4a790: 660a bnes 4a79c <_POSIX_Message_queue_Receive_support+0x4c> _Thread_Enable_dispatch(); 4a792: 4eb9 0004 e324 jsr 4e324 <_Thread_Enable_dispatch> 4a798: 6000 00a6 braw 4a840 <_POSIX_Message_queue_Receive_support+0xf0> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 4a79c: 2068 0010 moveal %a0@(16),%a0 if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 4a7a0: 2028 0066 movel %a0@(102),%d0 4a7a4: b0ae 0010 cmpl %fp@(16),%d0 4a7a8: 6316 blss 4a7c0 <_POSIX_Message_queue_Receive_support+0x70> _Thread_Enable_dispatch(); 4a7aa: 4eb9 0004 e324 jsr 4e324 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); 4a7b0: 4eb9 0005 31a0 jsr 531a0 <__errno> 4a7b6: 727a moveq #122,%d1 4a7b8: 2040 moveal %d0,%a0 4a7ba: 2081 movel %d1,%a0@ 4a7bc: 6000 008e braw 4a84c <_POSIX_Message_queue_Receive_support+0xfc> /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 4a7c0: 70ff moveq #-1,%d0 4a7c2: 2d40 fffc movel %d0,%fp@(-4) /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4a7c6: 4a03 tstb %d3 4a7c8: 670e beqs 4a7d8 <_POSIX_Message_queue_Receive_support+0x88> do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 4a7ca: 2001 movel %d1,%d0 4a7cc: 760e moveq #14,%d3 4a7ce: 7a01 moveq #1,%d5 4a7d0: e6a8 lsrl %d3,%d0 4a7d2: bb80 eorl %d5,%d0 4a7d4: c085 andl %d5,%d0 4a7d6: 6002 bras 4a7da <_POSIX_Message_queue_Receive_support+0x8a> length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4a7d8: 4200 clrb %d0 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4a7da: 2f2e 001c movel %fp@(28),%sp@- 4a7de: 7201 moveq #1,%d1 4a7e0: c280 andl %d0,%d1 4a7e2: 2f01 movel %d1,%sp@- 4a7e4: 486e fffc pea %fp@(-4) 4a7e8: 2f2e 000c movel %fp@(12),%sp@- 4a7ec: 2f02 movel %d2,%sp@- 4a7ee: 4868 001a pea %a0@(26) 4a7f2: 4eb9 0004 c75c jsr 4c75c <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 4a7f8: 4eb9 0004 e324 jsr 4e324 <_Thread_Enable_dispatch> 4a7fe: 2079 0006 714e moveal 6714e <_Per_CPU_Information+0xe>,%a0 if (msg_prio) { 4a804: 4fef 0018 lea %sp@(24),%sp 4a808: 4a8a tstl %a2 4a80a: 670a beqs 4a816 <_POSIX_Message_queue_Receive_support+0xc6><== NEVER TAKEN 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); 4a80c: 2028 0024 movel %a0@(36),%d0 4a810: 6c02 bges 4a814 <_POSIX_Message_queue_Receive_support+0xc4> 4a812: 4480 negl %d0 *msg_prio = _POSIX_Message_queue_Priority_from_core( 4a814: 2480 movel %d0,%a2@ _Thread_Executing->Wait.count ); } if ( !_Thread_Executing->Wait.return_code ) 4a816: 4aa8 0034 tstl %a0@(52) 4a81a: 6606 bnes 4a822 <_POSIX_Message_queue_Receive_support+0xd2> return length_out; 4a81c: 202e fffc movel %fp@(-4),%d0 4a820: 602c bras 4a84e <_POSIX_Message_queue_Receive_support+0xfe> rtems_set_errno_and_return_minus_one( 4a822: 4eb9 0005 31a0 jsr 531a0 <__errno> 4a828: 2079 0006 714e moveal 6714e <_Per_CPU_Information+0xe>,%a0 4a82e: 2440 moveal %d0,%a2 4a830: 2f28 0034 movel %a0@(52),%sp@- 4a834: 4eb9 0004 aa68 jsr 4aa68 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 4a83a: 588f addql #4,%sp 4a83c: 2480 movel %d0,%a2@ 4a83e: 600c bras 4a84c <_POSIX_Message_queue_Receive_support+0xfc> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4a840: 4eb9 0005 31a0 jsr 531a0 <__errno> 4a846: 2040 moveal %d0,%a0 4a848: 7009 moveq #9,%d0 4a84a: 2080 movel %d0,%a0@ 4a84c: 70ff moveq #-1,%d0 } 4a84e: 4cee 043c ffe4 moveml %fp@(-28),%d2-%d5/%a2 4a854: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004c93c <_POSIX_Semaphore_Create_support>: size_t name_len, int pshared, unsigned int value, POSIX_Semaphore_Control **the_sem ) { 4c93c: 4e56 0000 linkw %fp,#0 4c940: 2f0a movel %a2,%sp@- 4c942: 2f02 movel %d2,%sp@- 4c944: 242e 0008 movel %fp@(8),%d2 POSIX_Semaphore_Control *the_semaphore; CORE_semaphore_Attributes *the_sem_attr; char *name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) 4c948: 4aae 0010 tstl %fp@(16) 4c94c: 670e beqs 4c95c <_POSIX_Semaphore_Create_support+0x20> rtems_set_errno_and_return_minus_one( ENOSYS ); 4c94e: 4eb9 0004 ea90 jsr 4ea90 <__errno> 4c954: 7458 moveq #88,%d2 4c956: 2040 moveal %d0,%a0 4c958: 2082 movel %d2,%a0@ 4c95a: 6034 bras 4c990 <_POSIX_Semaphore_Create_support+0x54> * * 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; 4c95c: 2039 0006 3440 movel 63440 <_Thread_Dispatch_disable_level>,%d0 ++level; 4c962: 5280 addql #1,%d0 _Thread_Dispatch_disable_level = level; 4c964: 23c0 0006 3440 movel %d0,63440 <_Thread_Dispatch_disable_level> * _POSIX_Semaphore_Allocate */ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ) { return (POSIX_Semaphore_Control *) 4c96a: 4879 0006 365c pea 6365c <_POSIX_Semaphore_Information> 4c970: 4eb9 0004 8ea0 jsr 48ea0 <_Objects_Allocate> _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { 4c976: 588f addql #4,%sp 4c978: 2440 moveal %d0,%a2 4c97a: 4a80 tstl %d0 4c97c: 6618 bnes 4c996 <_POSIX_Semaphore_Create_support+0x5a> _Thread_Enable_dispatch(); 4c97e: 4eb9 0004 9fdc jsr 49fdc <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSPC ); 4c984: 4eb9 0004 ea90 jsr 4ea90 <__errno> 4c98a: 721c moveq #28,%d1 4c98c: 2040 moveal %d0,%a0 4c98e: 2081 movel %d1,%a0@ 4c990: 70ff moveq #-1,%d0 4c992: 6000 00a8 braw 4ca3c <_POSIX_Semaphore_Create_support+0x100> /* * Make a copy of the user's string for name just in case it was * dynamically constructed. */ if ( name_arg != NULL ) { 4c996: 4a82 tstl %d2 4c998: 6736 beqs 4c9d0 <_POSIX_Semaphore_Create_support+0x94> name = _Workspace_String_duplicate( name_arg, name_len ); 4c99a: 2f2e 000c movel %fp@(12),%sp@- 4c99e: 2f02 movel %d2,%sp@- 4c9a0: 4eb9 0004 d6f8 jsr 4d6f8 <_Workspace_String_duplicate> if ( !name ) { 4c9a6: 508f addql #8,%sp /* * Make a copy of the user's string for name just in case it was * dynamically constructed. */ if ( name_arg != NULL ) { name = _Workspace_String_duplicate( name_arg, name_len ); 4c9a8: 2400 movel %d0,%d2 if ( !name ) { 4c9aa: 6626 bnes 4c9d2 <_POSIX_Semaphore_Create_support+0x96><== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free ( POSIX_Semaphore_Control *the_semaphore ) { _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object ); 4c9ac: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4c9ae: 4879 0006 365c pea 6365c <_POSIX_Semaphore_Information> <== NOT EXECUTED 4c9b4: 4eb9 0004 91b0 jsr 491b0 <_Objects_Free> <== NOT EXECUTED _POSIX_Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 4c9ba: 4eb9 0004 9fdc jsr 49fdc <_Thread_Enable_dispatch> <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 4c9c0: 4eb9 0004 ea90 jsr 4ea90 <__errno> <== NOT EXECUTED 4c9c6: 508f addql #8,%sp <== NOT EXECUTED 4c9c8: 2040 moveal %d0,%a0 <== NOT EXECUTED 4c9ca: 700c moveq #12,%d0 <== NOT EXECUTED 4c9cc: 2080 movel %d0,%a0@ <== NOT EXECUTED 4c9ce: 60c0 bras 4c990 <_POSIX_Semaphore_Create_support+0x54><== NOT EXECUTED } } else { name = NULL; 4c9d0: 4282 clrl %d2 } the_semaphore->process_shared = pshared; 4c9d2: 42aa 0010 clrl %a2@(16) if ( name ) { 4c9d6: 4a82 tstl %d2 4c9d8: 670e beqs 4c9e8 <_POSIX_Semaphore_Create_support+0xac> the_semaphore->named = true; 4c9da: 7001 moveq #1,%d0 4c9dc: 1540 0014 moveb %d0,%a2@(20) the_semaphore->open_count = 1; 4c9e0: 7001 moveq #1,%d0 4c9e2: 2540 0016 movel %d0,%a2@(22) 4c9e6: 600a bras 4c9f2 <_POSIX_Semaphore_Create_support+0xb6> the_semaphore->linked = true; } else { the_semaphore->named = false; the_semaphore->open_count = 0; 4c9e8: 42aa 0016 clrl %a2@(22) if ( name ) { the_semaphore->named = true; the_semaphore->open_count = 1; the_semaphore->linked = true; } else { the_semaphore->named = false; 4c9ec: 4200 clrb %d0 4c9ee: 1540 0014 moveb %d0,%a2@(20) * 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; 4c9f2: 42aa 005e clrl %a2@(94) the_semaphore->open_count = 1; the_semaphore->linked = true; } else { the_semaphore->named = false; the_semaphore->open_count = 0; the_semaphore->linked = false; 4c9f6: 1540 0015 moveb %d0,%a2@(21) the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 4c9fa: 70ff moveq #-1,%d0 4c9fc: 2540 005a movel %d0,%a2@(90) _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 4ca00: 2f2e 0014 movel %fp@(20),%sp@- 4ca04: 486a 005a pea %a2@(90) 4ca08: 486a 001a pea %a2@(26) 4ca0c: 4eb9 0004 8900 jsr 48900 <_CORE_semaphore_Initialize> Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( 4ca12: 202a 0008 movel %a2@(8),%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4ca16: 2079 0006 3674 moveal 63674 <_POSIX_Semaphore_Information+0x18>,%a0 Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( 4ca1c: 0280 0000 ffff andil #65535,%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4ca22: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4) &_POSIX_Semaphore_Information, &the_semaphore->Object, name ); *the_sem = the_semaphore; 4ca26: 206e 0018 moveal %fp@(24),%a0 the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 4ca2a: 2542 000c movel %d2,%a2@(12) 4ca2e: 208a movel %a2,%a0@ _Thread_Enable_dispatch(); 4ca30: 4eb9 0004 9fdc jsr 49fdc <_Thread_Enable_dispatch> return 0; 4ca36: 4fef 000c lea %sp@(12),%sp 4ca3a: 4280 clrl %d0 } 4ca3c: 242e fff8 movel %fp@(-8),%d2 4ca40: 246e fffc moveal %fp@(-4),%a2 4ca44: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a9a0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: #include void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( Thread_Control *the_thread ) { 4a9a0: 4e56 0000 linkw %fp,#0 4a9a4: 226e 0008 moveal %fp@(8),%a1 POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4a9a8: 2069 00fe moveal %a1@(254),%a0 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 4a9ac: 4aa8 00d8 tstl %a0@(216) 4a9b0: 662c bnes 4a9de <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x3e><== NEVER TAKEN 4a9b2: 7001 moveq #1,%d0 4a9b4: b0a8 00dc cmpl %a0@(220),%d0 4a9b8: 6624 bnes 4a9de <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x3e> thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 4a9ba: 4aa8 00e0 tstl %a0@(224) 4a9be: 671e beqs 4a9de <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x3e> thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 4a9c0: 4878 ffff pea ffffffff * * 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; 4a9c4: 2039 0005 f31a movel 5f31a <_Thread_Dispatch_disable_level>,%d0 --level; 4a9ca: 5380 subql #1,%d0 4a9cc: 2f09 movel %a1,%sp@- _Thread_Dispatch_disable_level = level; 4a9ce: 23c0 0005 f31a movel %d0,5f31a <_Thread_Dispatch_disable_level> 4a9d4: 4eb9 0004 b000 jsr 4b000 <_POSIX_Thread_Exit> 4a9da: 508f addql #8,%sp 4a9dc: 6008 bras 4a9e6 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x46> } else _Thread_Enable_dispatch(); } 4a9de: 4e5e unlk %fp thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); } else _Thread_Enable_dispatch(); 4a9e0: 4ef9 0004 8860 jmp 48860 <_Thread_Enable_dispatch> } 4a9e6: 4e5e unlk %fp ... =============================================================================== 0004bab8 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4bab8: 4e56 ffec linkw %fp,#-20 4babc: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 4bac0: 246e 000c moveal %fp@(12),%a2 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4bac4: 2f12 movel %a2@,%sp@- int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4bac6: 242e 0008 movel %fp@(8),%d2 4baca: 266e 0010 moveal %fp@(16),%a3 4bace: 286e 0014 moveal %fp@(20),%a4 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4bad2: 4eb9 0004 ba90 jsr 4ba90 <_POSIX_Priority_Is_valid> 4bad8: 588f addql #4,%sp 4bada: 4a00 tstb %d0 4badc: 6604 bnes 4bae2 <_POSIX_Thread_Translate_sched_param+0x2a><== ALWAYS TAKEN return EINVAL; 4bade: 7016 moveq #22,%d0 4bae0: 6078 bras 4bb5a <_POSIX_Thread_Translate_sched_param+0xa2> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4bae2: 4293 clrl %a3@ *budget_callout = NULL; 4bae4: 4294 clrl %a4@ if ( policy == SCHED_OTHER ) { 4bae6: 4a82 tstl %d2 4bae8: 6606 bnes 4baf0 <_POSIX_Thread_Translate_sched_param+0x38> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4baea: 7401 moveq #1,%d2 4baec: 2682 movel %d2,%a3@ 4baee: 6068 bras 4bb58 <_POSIX_Thread_Translate_sched_param+0xa0> return 0; } if ( policy == SCHED_FIFO ) { 4baf0: 7001 moveq #1,%d0 4baf2: b082 cmpl %d2,%d0 4baf4: 6762 beqs 4bb58 <_POSIX_Thread_Translate_sched_param+0xa0> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 4baf6: 103c 0002 moveb #2,%d0 4bafa: b082 cmpl %d2,%d0 4bafc: 6608 bnes 4bb06 <_POSIX_Thread_Translate_sched_param+0x4e> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 4bafe: 7202 moveq #2,%d1 return 0; 4bb00: 4200 clrb %d0 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 4bb02: 2681 movel %d1,%a3@ return 0; 4bb04: 6054 bras 4bb5a <_POSIX_Thread_Translate_sched_param+0xa2> } if ( policy == SCHED_SPORADIC ) { 4bb06: 7004 moveq #4,%d0 4bb08: b082 cmpl %d2,%d0 4bb0a: 66d2 bnes 4bade <_POSIX_Thread_Translate_sched_param+0x26> if ( (param->sched_ss_repl_period.tv_sec == 0) && 4bb0c: 4aaa 0008 tstl %a2@(8) 4bb10: 6606 bnes 4bb18 <_POSIX_Thread_Translate_sched_param+0x60> 4bb12: 4aaa 000c tstl %a2@(12) 4bb16: 67c6 beqs 4bade <_POSIX_Thread_Translate_sched_param+0x26> (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 4bb18: 4aaa 0010 tstl %a2@(16) 4bb1c: 6606 bnes 4bb24 <_POSIX_Thread_Translate_sched_param+0x6c> 4bb1e: 4aaa 0014 tstl %a2@(20) 4bb22: 67ba beqs 4bade <_POSIX_Thread_Translate_sched_param+0x26> (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4bb24: 486a 0008 pea %a2@(8) 4bb28: 4bf9 0004 9d80 lea 49d80 <_Timespec_To_ticks>,%a5 4bb2e: 4e95 jsr %a5@ _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 4bb30: 486a 0010 pea %a2@(16) 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 ) < 4bb34: 2400 movel %d0,%d2 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 4bb36: 4e95 jsr %a5@ 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 ) < 4bb38: 508f addql #8,%sp 4bb3a: b082 cmpl %d2,%d0 4bb3c: 62a0 bhis 4bade <_POSIX_Thread_Translate_sched_param+0x26> _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) 4bb3e: 2f2a 0004 movel %a2@(4),%sp@- 4bb42: 4eb9 0004 ba90 jsr 4ba90 <_POSIX_Priority_Is_valid> 4bb48: 588f addql #4,%sp 4bb4a: 4a00 tstb %d0 4bb4c: 6790 beqs 4bade <_POSIX_Thread_Translate_sched_param+0x26> return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4bb4e: 7003 moveq #3,%d0 4bb50: 2680 movel %d0,%a3@ *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4bb52: 28bc 0004 67e8 movel #288744,%a4@ return 0; } if ( policy == SCHED_FIFO ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; 4bb58: 4280 clrl %d0 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; } 4bb5a: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4bb60: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004abf2 <_POSIX_Threads_Delete_extension>: */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { 4abf2: 4e56 ffec linkw %fp,#-20 4abf6: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 4abfa: 246e 000c moveal %fp@(12),%a2 /* * 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 )) ) 4abfe: 49f9 0004 8a0c lea 48a0c <_Thread_queue_Dequeue>,%a4 { Thread_Control *the_thread; POSIX_API_Control *api; void **value_ptr; api = deleted->API_Extensions[ THREAD_API_POSIX ]; 4ac04: 266a 00fe moveal %a2@(254),%a3 /* * 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 )) ) 4ac08: 240b movel %a3,%d2 4ac0a: 0682 0000 0044 addil #68,%d2 api = deleted->API_Extensions[ THREAD_API_POSIX ]; /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); 4ac10: 2f0a movel %a2,%sp@- 4ac12: 4eb9 0004 c890 jsr 4c890 <_POSIX_Threads_cancel_run> /* * Run all the key destructors */ _POSIX_Keys_Run_destructors( deleted ); 4ac18: 2f0a movel %a2,%sp@- 4ac1a: 4eb9 0004 c8f8 jsr 4c8f8 <_POSIX_Keys_Run_destructors> /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; 4ac20: 262a 0028 movel %a2@(40),%d3 while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 4ac24: 508f addql #8,%sp 4ac26: 6008 bras 4ac30 <_POSIX_Threads_Delete_extension+0x3e> *(void **)the_thread->Wait.return_argument = value_ptr; 4ac28: 2240 moveal %d0,%a1 <== NOT EXECUTED 4ac2a: 2069 0028 moveal %a1@(40),%a0 <== NOT EXECUTED 4ac2e: 2083 movel %d3,%a0@ <== 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 )) ) 4ac30: 2f02 movel %d2,%sp@- 4ac32: 4e94 jsr %a4@ 4ac34: 588f addql #4,%sp 4ac36: 4a80 tstl %d0 4ac38: 66ee bnes 4ac28 <_POSIX_Threads_Delete_extension+0x36><== NEVER TAKEN *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) 4ac3a: 103c 0004 moveb #4,%d0 4ac3e: b0ab 0084 cmpl %a3@(132),%d0 4ac42: 660c bnes 4ac50 <_POSIX_Threads_Delete_extension+0x5e> (void) _Watchdog_Remove( &api->Sporadic_timer ); 4ac44: 486b 00a8 pea %a3@(168) 4ac48: 4eb9 0004 92f8 jsr 492f8 <_Watchdog_Remove> 4ac4e: 588f addql #4,%sp deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; 4ac50: 42aa 00fe clrl %a2@(254) _Workspace_Free( api ); 4ac54: 2d4b 0008 movel %a3,%fp@(8) } 4ac58: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 4ac5e: 4e5e unlk %fp if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; _Workspace_Free( api ); 4ac60: 4ef9 0004 94d4 jmp 494d4 <_Workspace_Free> =============================================================================== 00046528 <_POSIX_Threads_Initialize_user_threads_body>: #include #include #include void _POSIX_Threads_Initialize_user_threads_body(void) { 46528: 4e56 ff98 linkw %fp,#-104 4652c: 48d7 3c7c moveml %d2-%d6/%a2-%a5,%sp@ uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; 46530: 2479 0005 e526 moveal 5e526 ,%a2 maximum = Configuration_POSIX_API.number_of_initialization_threads; 46536: 2839 0005 e522 movel 5e522 ,%d4 if ( !user_threads || maximum == 0 ) 4653c: 4a8a tstl %a2 4653e: 676e beqs 465ae <_POSIX_Threads_Initialize_user_threads_body+0x86><== NEVER TAKEN 46540: 4a84 tstl %d4 46542: 676a beqs 465ae <_POSIX_Threads_Initialize_user_threads_body+0x86><== NEVER TAKEN for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 46544: 240e movel %fp,%d2 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); status = pthread_create( 46546: 2a0e movel %fp,%d5 pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; maximum = Configuration_POSIX_API.number_of_initialization_threads; if ( !user_threads || maximum == 0 ) 46548: 4283 clrl %d3 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 4654a: 0682 ffff ffc0 addil #-64,%d2 46550: 47f9 0004 bb64 lea 4bb64 ,%a3 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 46556: 49f9 0004 bb90 lea 4bb90 ,%a4 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 4655c: 4bf9 0004 bbc8 lea 4bbc8 ,%a5 status = pthread_create( 46562: 0685 ffff ffbc addil #-68,%d5 46568: 2c3c 0004 6208 movel #287240,%d6 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 4656e: 2f02 movel %d2,%sp@- 46570: 4e93 jsr %a3@ (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 46572: 4878 0002 pea 2 46576: 2f02 movel %d2,%sp@- 46578: 4e94 jsr %a4@ (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 4657a: 2f2a 0004 movel %a2@(4),%sp@- 4657e: 2f02 movel %d2,%sp@- 46580: 4e95 jsr %a5@ status = pthread_create( 46582: 2046 moveal %d6,%a0 46584: 42a7 clrl %sp@- 46586: 2f12 movel %a2@,%sp@- 46588: 508a addql #8,%a2 4658a: 2f02 movel %d2,%sp@- 4658c: 2f05 movel %d5,%sp@- 4658e: 4e90 jsr %a0@ &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 46590: 4fef 0024 lea %sp@(36),%sp 46594: 4a80 tstl %d0 46596: 6710 beqs 465a8 <_POSIX_Threads_Initialize_user_threads_body+0x80> _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 46598: 2f00 movel %d0,%sp@- 4659a: 4878 0001 pea 1 4659e: 4878 0002 pea 2 465a2: 4eb9 0004 82f8 jsr 482f8 <_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++ ) { 465a8: 5283 addql #1,%d3 465aa: b883 cmpl %d3,%d4 465ac: 66c0 bnes 4656e <_POSIX_Threads_Initialize_user_threads_body+0x46><== NEVER TAKEN NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); } } 465ae: 4cee 3c7c ff98 moveml %fp@(-104),%d2-%d6/%a2-%a5 465b4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004ad60 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 4ad60: 4e56 0000 linkw %fp,#0 4ad64: 2f0b movel %a3,%sp@- 4ad66: 2f0a movel %a2,%sp@- 4ad68: 246e 000c moveal %fp@(12),%a2 Thread_Control *the_thread; POSIX_API_Control *api; the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4ad6c: 266a 00fe moveal %a2@(254),%a3 /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 4ad70: 486b 0098 pea %a3@(152) 4ad74: 4eb9 0004 b9bc jsr 4b9bc <_Timespec_To_ticks> */ #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 ) { 4ad7a: 588f addql #4,%sp api = the_thread->API_Extensions[ THREAD_API_POSIX ]; /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); the_thread->cpu_time_budget = ticks; 4ad7c: 2540 0072 movel %d0,%a2@(114) RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 4ad80: 4280 clrl %d0 4ad82: 1039 0005 d5dc moveb 5d5dc ,%d0 4ad88: 90ab 0088 subl %a3@(136),%d0 new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); the_thread->real_priority = new_priority; 4ad8c: 2540 0018 movel %d0,%a2@(24) */ #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 ) { 4ad90: 4aaa 001c tstl %a2@(28) 4ad94: 6618 bnes 4adae <_POSIX_Threads_Sporadic_budget_TSR+0x4e><== NEVER TAKEN /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { 4ad96: b0aa 0014 cmpl %a2@(20),%d0 4ad9a: 6412 bccs 4adae <_POSIX_Threads_Sporadic_budget_TSR+0x4e> _Thread_Change_priority( the_thread, new_priority, true ); 4ad9c: 4878 0001 pea 1 4ada0: 2f00 movel %d0,%sp@- 4ada2: 2f0a movel %a2,%sp@- 4ada4: 4eb9 0004 82ac jsr 482ac <_Thread_Change_priority> 4adaa: 4fef 000c lea %sp@(12),%sp #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); 4adae: 486b 0090 pea %a3@(144) 4adb2: 4eb9 0004 b9bc jsr 4b9bc <_Timespec_To_ticks> _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); } 4adb8: 246e fff8 moveal %fp@(-8),%a2 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4adbc: 588f addql #4,%sp Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4adbe: 2740 00b4 movel %d0,%a3@(180) } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); 4adc2: 47eb 00a8 lea %a3@(168),%a3 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4adc6: 203c 0005 ef72 movel #388978,%d0 4adcc: 2d4b 000c movel %a3,%fp@(12) } 4add0: 266e fffc moveal %fp@(-4),%a3 4add4: 2d40 0008 movel %d0,%fp@(8) 4add8: 4e5e unlk %fp 4adda: 4ef9 0004 91d4 jmp 491d4 <_Watchdog_Insert> =============================================================================== 0004ade0 <_POSIX_Threads_Sporadic_budget_callout>: /* * This will prevent the thread from consuming its entire "budget" * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ 4ade0: 70ff moveq #-1,%d0 * _POSIX_Threads_Sporadic_budget_callout */ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread ) { 4ade2: 4e56 0000 linkw %fp,#0 4ade6: 206e 0008 moveal %fp@(8),%a0 /* * This will prevent the thread from consuming its entire "budget" * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ 4adea: 2140 0072 movel %d0,%a0@(114) 4adee: 4280 clrl %d0 4adf0: 1039 0005 d5dc moveb 5d5dc ,%d0 ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4adf6: 2268 00fe moveal %a0@(254),%a1 4adfa: 90a9 008c subl %a1@(140),%d0 * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority); the_thread->real_priority = new_priority; 4adfe: 2140 0018 movel %d0,%a0@(24) */ #if 0 printk( "callout %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 4ae02: 4aa8 001c tstl %a0@(28) 4ae06: 6618 bnes 4ae20 <_POSIX_Threads_Sporadic_budget_callout+0x40><== NEVER TAKEN /* * Make sure we are actually lowering it. If they have lowered it * to logically lower than sched_ss_low_priority, then we do not want to * change it. */ if ( the_thread->current_priority < new_priority ) { 4ae08: b0a8 0014 cmpl %a0@(20),%d0 4ae0c: 6312 blss 4ae20 <_POSIX_Threads_Sporadic_budget_callout+0x40><== NEVER TAKEN _Thread_Change_priority( the_thread, new_priority, true ); 4ae0e: 4878 0001 pea 1 4ae12: 2f00 movel %d0,%sp@- 4ae14: 2f08 movel %a0,%sp@- 4ae16: 4eb9 0004 82ac jsr 482ac <_Thread_Change_priority> 4ae1c: 4fef 000c lea %sp@(12),%sp #if 0 printk( "lower priority\n" ); #endif } } } 4ae20: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000460cc <_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) { 460cc: 4e56 ffec linkw %fp,#-20 460d0: 48d7 040c moveml %d2-%d3/%a2,%sp@ 460d4: 246e 000c moveal %fp@(12),%a2 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 460d8: 52aa 0066 addql #1,%a2@(102) /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 460dc: 4aaa 0052 tstl %a2@(82) 460e0: 6606 bnes 460e8 <_POSIX_Timer_TSR+0x1c> 460e2: 4aaa 0056 tstl %a2@(86) 460e6: 6776 beqs 4615e <_POSIX_Timer_TSR+0x92> <== NEVER TAKEN ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 460e8: 2f0a movel %a2,%sp@- 460ea: 4879 0004 60cc pea 460cc <_POSIX_Timer_TSR> 460f0: 2f2a 0008 movel %a2@(8),%sp@- 460f4: 2f2a 0062 movel %a2@(98),%sp@- 460f8: 486a 0010 pea %a2@(16) 460fc: 4eb9 0004 b624 jsr 4b624 <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 46102: 4fef 0014 lea %sp@(20),%sp 46106: 4a00 tstb %d0 46108: 676e beqs 46178 <_POSIX_Timer_TSR+0xac> <== NEVER TAKEN ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 4610a: 4879 0005 f8d8 pea 5f8d8 <_TOD> 46110: 486e fff8 pea %fp@(-8) 46114: 4eb9 0004 7718 jsr 47718 <_TOD_Get_with_nanoseconds> /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; } 4611a: 2040 moveal %d0,%a0 4611c: 2410 movel %a0@,%d2 4611e: 2628 0004 movel %a0@(4),%d3 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 46122: 2f3c 3b9a ca00 movel #1000000000,%sp@- 46128: 42a7 clrl %sp@- 4612a: 2f03 movel %d3,%sp@- 4612c: 2f02 movel %d2,%sp@- 4612e: 4eb9 0005 a1d4 jsr 5a1d4 <__divdi3> 46134: 4fef 0010 lea %sp@(16),%sp 46138: 2541 006a movel %d1,%a2@(106) _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 4613c: 2f3c 3b9a ca00 movel #1000000000,%sp@- 46142: 42a7 clrl %sp@- 46144: 2f03 movel %d3,%sp@- 46146: 2f02 movel %d2,%sp@- 46148: 4eb9 0005 a634 jsr 5a634 <__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; 4614e: 4fef 0018 lea %sp@(24),%sp 46152: 7003 moveq #3,%d0 46154: 2541 006e movel %d1,%a2@(110) 46158: 1540 003c moveb %d0,%a2@(60) 4615c: 6006 bras 46164 <_POSIX_Timer_TSR+0x98> } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 4615e: 7004 moveq #4,%d0 <== NOT EXECUTED 46160: 1540 003c moveb %d0,%a2@(60) <== NOT EXECUTED /* * 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 ) ) { 46164: 2f2a 0042 movel %a2@(66),%sp@- 46168: 2f2a 0038 movel %a2@(56),%sp@- 4616c: 4eb9 0004 b218 jsr 4b218 } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 46172: 508f addql #8,%sp 46174: 42aa 0066 clrl %a2@(102) } 46178: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 4617e: 4e5e unlk %fp ... =============================================================================== 0004c974 <_POSIX_signals_Check_signal>: { 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, 4c974: 4280 clrl %d0 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4c976: 4e56 ffb4 linkw %fp,#-76 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, 4c97a: 102e 0013 moveb %fp@(19),%d0 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4c97e: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4c982: 4878 0001 pea 1 4c986: 2a0e movel %fp,%d5 4c988: 0685 ffff ffcc addil #-52,%d5 4c98e: 2f00 movel %d0,%sp@- bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4c990: 242e 000c movel %fp@(12),%d2 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, 4c994: 2f05 movel %d5,%sp@- bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4c996: 246e 0008 moveal %fp@(8),%a2 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, 4c99a: 2f02 movel %d2,%sp@- 4c99c: 2f0a movel %a2,%sp@- 4c99e: 4eb9 0004 ca4c jsr 4ca4c <_POSIX_signals_Clear_signals> 4c9a4: 4fef 0014 lea %sp@(20),%sp 4c9a8: 4a00 tstb %d0 4c9aa: 6700 0092 beqw 4ca3e <_POSIX_signals_Check_signal+0xca> #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 4c9ae: 2002 movel %d2,%d0 4c9b0: 2602 movel %d2,%d3 4c9b2: e588 lsll #2,%d0 4c9b4: e98b lsll #4,%d3 4c9b6: 9680 subl %d0,%d3 4c9b8: 2043 moveal %d3,%a0 4c9ba: d1fc 0005 f358 addal #389976,%a0 4c9c0: 7001 moveq #1,%d0 4c9c2: 2668 0008 moveal %a0@(8),%a3 4c9c6: b08b cmpl %a3,%d0 4c9c8: 6774 beqs 4ca3e <_POSIX_signals_Check_signal+0xca><== NEVER TAKEN /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4c9ca: 2028 0004 movel %a0@(4),%d0 return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 4c9ce: 282a 00d0 movel %a2@(208),%d4 api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4c9d2: 8084 orl %d4,%d0 /* * 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, 4c9d4: 2079 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a0 4c9da: 41e8 0020 lea %a0@(32),%a0 /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4c9de: 2540 00d0 movel %d0,%a2@(208) /* * 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, 4c9e2: 4878 0028 pea 28 4c9e6: 2f08 movel %a0,%sp@- 4c9e8: 486e ffd8 pea %fp@(-40) 4c9ec: 4eb9 0004 d7b8 jsr 4d7b8 sizeof( Thread_Wait_information )); /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 4c9f2: 4fef 000c lea %sp@(12),%sp 4c9f6: 41f9 0005 f358 lea 5f358 <_POSIX_signals_Vectors>,%a0 4c9fc: 7002 moveq #2,%d0 4c9fe: b0b0 3800 cmpl %a0@(00000000,%d3:l),%d0 4ca02: 660e bnes 4ca12 <_POSIX_signals_Check_signal+0x9e> case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 4ca04: 42a7 clrl %sp@- 4ca06: 2f05 movel %d5,%sp@- 4ca08: 2f02 movel %d2,%sp@- 4ca0a: 4e93 jsr %a3@ signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 4ca0c: 4fef 000c lea %sp@(12),%sp 4ca10: 6006 bras 4ca18 <_POSIX_signals_Check_signal+0xa4> default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 4ca12: 2f02 movel %d2,%sp@- 4ca14: 4e93 jsr %a3@ break; 4ca16: 588f addql #4,%sp } /* * Restore the blocking information */ memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information, 4ca18: 4878 0028 pea 28 4ca1c: 486e ffd8 pea %fp@(-40) 4ca20: 2079 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a0 4ca26: 41e8 0020 lea %a0@(32),%a0 4ca2a: 2f08 movel %a0,%sp@- 4ca2c: 4eb9 0004 d7b8 jsr 4d7b8 sizeof( Thread_Wait_information )); /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 4ca32: 4fef 000c lea %sp@(12),%sp 4ca36: 2544 00d0 movel %d4,%a2@(208) return true; 4ca3a: 7001 moveq #1,%d0 4ca3c: 6002 bras 4ca40 <_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; 4ca3e: 4200 clrb %d0 * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; } 4ca40: 4cee 0c3c ffb4 moveml %fp@(-76),%d2-%d5/%a2-%a3 4ca46: 4e5e unlk %fp ... =============================================================================== 0004cf0c <_POSIX_signals_Clear_process_signals>: 4cf0c: 7201 moveq #1,%d1 */ void _POSIX_signals_Clear_process_signals( int signo ) { 4cf0e: 4e56 0000 linkw %fp,#0 4cf12: 202e 0008 movel %fp@(8),%d0 4cf16: 2f03 movel %d3,%sp@- 4cf18: 2f02 movel %d2,%sp@- 4cf1a: 2400 movel %d0,%d2 4cf1c: 5382 subql #1,%d2 4cf1e: e5a9 lsll %d2,%d1 clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4cf20: 243c 0000 0700 movel #1792,%d2 4cf26: 40c3 movew %sr,%d3 4cf28: 8483 orl %d3,%d2 4cf2a: 46c2 movew %d2,%sr if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4cf2c: 2400 movel %d0,%d2 4cf2e: 41f9 0005 f358 lea 5f358 <_POSIX_signals_Vectors>,%a0 4cf34: e58a lsll #2,%d2 4cf36: e988 lsll #4,%d0 4cf38: 9082 subl %d2,%d0 4cf3a: 7402 moveq #2,%d2 4cf3c: b4b0 0800 cmpl %a0@(00000000,%d0:l),%d2 4cf40: 6614 bnes 4cf56 <_POSIX_signals_Clear_process_signals+0x4a> if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 4cf42: 2040 moveal %d0,%a0 4cf44: d1fc 0005 f550 addal #390480,%a0 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4cf4a: 2008 movel %a0,%d0 4cf4c: 5880 addql #4,%d0 4cf4e: b090 cmpl %a0@,%d0 4cf50: 6704 beqs 4cf56 <_POSIX_signals_Clear_process_signals+0x4a><== ALWAYS TAKEN clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; } _ISR_Enable( level ); 4cf52: 46c3 movew %d3,%sr 4cf54: 600a bras 4cf60 <_POSIX_signals_Clear_process_signals+0x54> if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 4cf56: 4681 notl %d1 4cf58: c3b9 0005 f54c andl %d1,5f54c <_POSIX_signals_Pending> 4cf5e: 60f2 bras 4cf52 <_POSIX_signals_Clear_process_signals+0x46> } _ISR_Enable( level ); } 4cf60: 241f movel %sp@+,%d2 4cf62: 261f movel %sp@+,%d3 4cf64: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004ca4c <_POSIX_signals_Clear_signals>: static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 4ca4c: 7001 moveq #1,%d0 int signo, siginfo_t *info, bool is_global, bool check_blocked ) { 4ca4e: 4e56 ffec linkw %fp,#-20 4ca52: 206e 0008 moveal %fp@(8),%a0 4ca56: 48d7 043c moveml %d2-%d5/%a2,%sp@ 4ca5a: 242e 000c movel %fp@(12),%d2 4ca5e: 2202 movel %d2,%d1 4ca60: 5381 subql #1,%d1 4ca62: 1a2e 0017 moveb %fp@(23),%d5 4ca66: e3a8 lsll %d1,%d0 /* set blocked signals based on if checking for them, SIGNAL_ALL_MASK * insures that no signals are blocked and all are checked. */ if ( check_blocked ) 4ca68: 4a2e 001b tstb %fp@(27) 4ca6c: 6708 beqs 4ca76 <_POSIX_signals_Clear_signals+0x2a> signals_blocked = ~api->signals_blocked; 4ca6e: 2628 00d0 movel %a0@(208),%d3 4ca72: 4683 notl %d3 4ca74: 6002 bras 4ca78 <_POSIX_signals_Clear_signals+0x2c> else signals_blocked = SIGNAL_ALL_MASK; 4ca76: 76ff moveq #-1,%d3 /* XXX is this right for siginfo type signals? */ /* XXX are we sure they can be cleared the same way? */ _ISR_Disable( level ); 4ca78: 223c 0000 0700 movel #1792,%d1 4ca7e: 40c4 movew %sr,%d4 4ca80: 8284 orl %d4,%d1 4ca82: 46c1 movew %d1,%sr if ( is_global ) { 4ca84: 4a05 tstb %d5 4ca86: 6700 008a beqw 4cb12 <_POSIX_signals_Clear_signals+0xc6> if ( mask & (_POSIX_signals_Pending & signals_blocked) ) { 4ca8a: c0b9 0005 f54c andl 5f54c <_POSIX_signals_Pending>,%d0 4ca90: c083 andl %d3,%d0 4ca92: 6700 0096 beqw 4cb2a <_POSIX_signals_Clear_signals+0xde> if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4ca96: 2202 movel %d2,%d1 4ca98: 2002 movel %d2,%d0 4ca9a: 41f9 0005 f358 lea 5f358 <_POSIX_signals_Vectors>,%a0 4caa0: e589 lsll #2,%d1 4caa2: e988 lsll #4,%d0 4caa4: 9081 subl %d1,%d0 4caa6: 7202 moveq #2,%d1 4caa8: b2b0 0800 cmpl %a0@(00000000,%d0:l),%d1 4caac: 6658 bnes 4cb06 <_POSIX_signals_Clear_signals+0xba> psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get_unprotected( &_POSIX_signals_Siginfo[ signo ] ); 4caae: 2040 moveal %d0,%a0 4cab0: d1fc 0005 f550 addal #390480,%a0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4cab6: 2248 moveal %a0,%a1 4cab8: 2459 moveal %a1@+,%a2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 4caba: b3ca cmpal %a2,%a1 4cabc: 670a beqs 4cac8 <_POSIX_signals_Clear_signals+0x7c> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 4cabe: 2252 moveal %a2@,%a1 head->next = new_first; 4cac0: 2089 movel %a1,%a0@ new_first->previous = head; 4cac2: 2348 0004 movel %a0,%a1@(4) 4cac6: 6002 bras 4caca <_POSIX_signals_Clear_signals+0x7e> ) { if ( !_Chain_Is_empty(the_chain)) return _Chain_Get_first_unprotected(the_chain); else return NULL; 4cac8: 95ca subal %a2,%a2 _POSIX_signals_Clear_process_signals( signo ); 4caca: 2f02 movel %d2,%sp@- 4cacc: 4eb9 0004 cf0c jsr 4cf0c <_POSIX_signals_Clear_process_signals> /* * It may be impossible to get here with an empty chain * BUT until that is proven we need to be defensive and * protect against it. */ if ( psiginfo ) { 4cad2: 588f addql #4,%sp 4cad4: 4a8a tstl %a2 4cad6: 672e beqs 4cb06 <_POSIX_signals_Clear_signals+0xba><== NEVER TAKEN *info = psiginfo->Info; 4cad8: 4878 000c pea c 4cadc: 486a 0008 pea %a2@(8) 4cae0: 2f2e 0010 movel %fp@(16),%sp@- 4cae4: 4eb9 0004 d7b8 jsr 4d7b8 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 4caea: 2079 0005 f4e0 moveal 5f4e0 <_POSIX_signals_Inactive_siginfo+0x8>,%a0 the_node->next = tail; tail->previous = the_node; old_last->next = the_node; the_node->previous = old_last; 4caf0: 4fef 000c lea %sp@(12),%sp ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; 4caf4: 24bc 0005 f4dc movel #390364,%a2@ tail->previous = the_node; 4cafa: 23ca 0005 f4e0 movel %a2,5f4e0 <_POSIX_signals_Inactive_siginfo+0x8> old_last->next = the_node; 4cb00: 208a movel %a2,%a0@ the_node->previous = old_last; 4cb02: 2548 0004 movel %a0,%a2@(4) &psiginfo->Node ); } else do_callout = false; } _POSIX_signals_Clear_process_signals( signo ); 4cb06: 2f02 movel %d2,%sp@- 4cb08: 4eb9 0004 cf0c jsr 4cf0c <_POSIX_signals_Clear_process_signals> 4cb0e: 588f addql #4,%sp 4cb10: 6014 bras 4cb26 <_POSIX_signals_Clear_signals+0xda> do_callout = true; } } else { if ( mask & (api->signals_pending & signals_blocked) ) { 4cb12: 2428 00d4 movel %a0@(212),%d2 4cb16: 2200 movel %d0,%d1 4cb18: c282 andl %d2,%d1 4cb1a: c283 andl %d3,%d1 4cb1c: 670c beqs 4cb2a <_POSIX_signals_Clear_signals+0xde> api->signals_pending &= ~mask; 4cb1e: 4680 notl %d0 4cb20: c082 andl %d2,%d0 4cb22: 2140 00d4 movel %d0,%a0@(212) do_callout = true; 4cb26: 7001 moveq #1,%d0 4cb28: 6002 bras 4cb2c <_POSIX_signals_Clear_signals+0xe0> bool do_callout; POSIX_signals_Siginfo_node *psiginfo; mask = signo_to_mask( signo ); do_callout = false; 4cb2a: 4200 clrb %d0 if ( mask & (api->signals_pending & signals_blocked) ) { api->signals_pending &= ~mask; do_callout = true; } } _ISR_Enable( level ); 4cb2c: 46c4 movew %d4,%sr return do_callout; } 4cb2e: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 4cb34: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046c6c <_POSIX_signals_Get_lowest>: sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 46c6c: 701b moveq #27,%d0 #include static int _POSIX_signals_Get_lowest( sigset_t set ) { 46c6e: 4e56 fff4 linkw %fp,#-12 46c72: 48d7 001c moveml %d2-%d4,%sp@ 46c76: 242e 0008 movel %fp@(8),%d2 46c7a: 7601 moveq #1,%d3 #include #include #include #include static int _POSIX_signals_Get_lowest( 46c7c: 2200 movel %d0,%d1 46c7e: 5381 subql #1,%d1 46c80: 2803 movel %d3,%d4 46c82: e3ac lsll %d1,%d4 46c84: 2204 movel %d4,%d1 ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 46c86: c282 andl %d2,%d1 46c88: 6626 bnes 46cb0 <_POSIX_signals_Get_lowest+0x44> <== NEVER TAKEN sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 46c8a: 5280 addql #1,%d0 46c8c: 123c 0020 moveb #32,%d1 46c90: b280 cmpl %d0,%d1 46c92: 66e8 bnes 46c7c <_POSIX_signals_Get_lowest+0x10> 46c94: 7001 moveq #1,%d0 46c96: 7601 moveq #1,%d3 #include #include #include #include static int _POSIX_signals_Get_lowest( 46c98: 2200 movel %d0,%d1 46c9a: 5381 subql #1,%d1 46c9c: 2803 movel %d3,%d4 46c9e: e3ac lsll %d1,%d4 46ca0: 2204 movel %d4,%d1 #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 46ca2: c282 andl %d2,%d1 46ca4: 660a bnes 46cb0 <_POSIX_signals_Get_lowest+0x44> */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 46ca6: 5280 addql #1,%d0 46ca8: 123c 001b moveb #27,%d1 46cac: b280 cmpl %d0,%d1 46cae: 66e8 bnes 46c98 <_POSIX_signals_Get_lowest+0x2c> <== ALWAYS TAKEN * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } 46cb0: 4cd7 001c moveml %sp@,%d2-%d4 46cb4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a9cc <_POSIX_signals_Post_switch_hook>: */ static void _POSIX_signals_Post_switch_hook( Thread_Control *the_thread ) { 4a9cc: 4e56 ffec linkw %fp,#-20 POSIX_API_Control *api; int signo; ISR_Level level; int hold_errno; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4a9d0: 206e 0008 moveal %fp@(8),%a0 */ static void _POSIX_signals_Post_switch_hook( Thread_Control *the_thread ) { 4a9d4: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ POSIX_API_Control *api; int signo; ISR_Level level; int hold_errno; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4a9d8: 2468 00fe moveal %a0@(254),%a2 /* * 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; 4a9dc: 2079 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a0 4a9e2: 2628 0034 movel %a0@(52),%d3 /* * api may be NULL in case of a thread close in progress */ if ( !api ) 4a9e6: 4a8a tstl %a2 4a9e8: 677a beqs 4aa64 <_POSIX_signals_Post_switch_hook+0x98><== NEVER TAKEN * * 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 ); 4a9ea: 283c 0000 0700 movel #1792,%d4 break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 4a9f0: 47f9 0004 c974 lea 4c974 <_POSIX_signals_Check_signal>,%a3 * * 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 ); 4a9f6: 2004 movel %d4,%d0 4a9f8: 40c1 movew %sr,%d1 4a9fa: 8081 orl %d1,%d0 4a9fc: 46c0 movew %d0,%sr if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 4a9fe: 2039 0005 f54c movel 5f54c <_POSIX_signals_Pending>,%d0 * 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 & 4aa04: 242a 00d0 movel %a2@(208),%d2 4aa08: 4682 notl %d2 (api->signals_pending | _POSIX_signals_Pending)) ) { 4aa0a: 80aa 00d4 orl %a2@(212),%d0 * 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 & 4aa0e: c082 andl %d2,%d0 (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); 4aa10: 46c1 movew %d1,%sr * 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 & 4aa12: 4a80 tstl %d0 4aa14: 660c bnes 4aa22 <_POSIX_signals_Post_switch_hook+0x56> _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } } _Thread_Executing->Wait.return_code = hold_errno; 4aa16: 2079 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a0 4aa1c: 2143 0034 movel %d3,%a0@(52) 4aa20: 6042 bras 4aa64 <_POSIX_signals_Post_switch_hook+0x98> _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4aa22: 741b moveq #27,%d2 _POSIX_signals_Check_signal( api, signo, false ); 4aa24: 42a7 clrl %sp@- 4aa26: 2f02 movel %d2,%sp@- 4aa28: 2f0a movel %a2,%sp@- 4aa2a: 4e93 jsr %a3@ _POSIX_signals_Check_signal( api, signo, true ); 4aa2c: 4878 0001 pea 1 4aa30: 2f02 movel %d2,%sp@- _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4aa32: 5282 addql #1,%d2 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); 4aa34: 2f0a movel %a2,%sp@- 4aa36: 4e93 jsr %a3@ _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4aa38: 4fef 0018 lea %sp@(24),%sp 4aa3c: 7020 moveq #32,%d0 4aa3e: b082 cmpl %d2,%d0 4aa40: 66e2 bnes 4aa24 <_POSIX_signals_Post_switch_hook+0x58> 4aa42: 7401 moveq #1,%d2 _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 ); 4aa44: 42a7 clrl %sp@- 4aa46: 2f02 movel %d2,%sp@- 4aa48: 2f0a movel %a2,%sp@- 4aa4a: 4e93 jsr %a3@ _POSIX_signals_Check_signal( api, signo, true ); 4aa4c: 4878 0001 pea 1 4aa50: 2f02 movel %d2,%sp@- _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++ ) { 4aa52: 5282 addql #1,%d2 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); 4aa54: 2f0a movel %a2,%sp@- 4aa56: 4e93 jsr %a3@ _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++ ) { 4aa58: 4fef 0018 lea %sp@(24),%sp 4aa5c: 701b moveq #27,%d0 4aa5e: b082 cmpl %d2,%d0 4aa60: 66e2 bnes 4aa44 <_POSIX_signals_Post_switch_hook+0x78> 4aa62: 6092 bras 4a9f6 <_POSIX_signals_Post_switch_hook+0x2a> _POSIX_signals_Check_signal( api, signo, true ); } } _Thread_Executing->Wait.return_code = hold_errno; } 4aa64: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 4aa6a: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005b1d0 <_POSIX_signals_Unblock_thread>: 5b1d0: 7201 moveq #1,%d1 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 5b1d2: 4e56 fff4 linkw %fp,#-12 5b1d6: 226e 0010 moveal %fp@(16),%a1 5b1da: 48d7 040c moveml %d2-%d3/%a2,%sp@ 5b1de: 242e 000c movel %fp@(12),%d2 5b1e2: 2002 movel %d2,%d0 5b1e4: 5380 subql #1,%d0 5b1e6: 246e 0008 moveal %fp@(8),%a2 5b1ea: e1a9 lsll %d0,%d1 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 5b1ec: 202a 0010 movel %a2@(16),%d0 5b1f0: 2600 movel %d0,%d3 5b1f2: 0283 1000 8000 andil #268468224,%d3 { POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 5b1f8: 206a 00fe moveal %a2@(254),%a0 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 5b1fc: 0c83 1000 8000 cmpil #268468224,%d3 5b202: 6652 bnes 5b256 <_POSIX_signals_Unblock_thread+0x86> if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 5b204: 2001 movel %d1,%d0 5b206: c0aa 0030 andl %a2@(48),%d0 5b20a: 660e bnes 5b21a <_POSIX_signals_Unblock_thread+0x4a> 5b20c: 2028 00d0 movel %a0@(208),%d0 5b210: 4680 notl %d0 5b212: c280 andl %d0,%d1 5b214: 6604 bnes 5b21a <_POSIX_signals_Unblock_thread+0x4a> 5b216: 6000 00a8 braw 5b2c0 <_POSIX_signals_Unblock_thread+0xf0> the_thread->Wait.return_code = EINTR; 5b21a: 7004 moveq #4,%d0 the_info = (siginfo_t *) the_thread->Wait.return_argument; 5b21c: 206a 0028 moveal %a2@(40),%a0 */ 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; 5b220: 2540 0034 movel %d0,%a2@(52) the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 5b224: 4a89 tstl %a1 5b226: 660e bnes 5b236 <_POSIX_signals_Unblock_thread+0x66> the_info->si_signo = signo; the_info->si_code = SI_USER; 5b228: 7201 moveq #1,%d1 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; 5b22a: 2082 movel %d2,%a0@ the_info->si_code = SI_USER; 5b22c: 2141 0004 movel %d1,%a0@(4) the_info->si_value.sival_int = 0; 5b230: 42a8 0008 clrl %a0@(8) 5b234: 6012 bras 5b248 <_POSIX_signals_Unblock_thread+0x78> } else { *the_info = *info; 5b236: 4878 000c pea c 5b23a: 2f09 movel %a1,%sp@- 5b23c: 2f08 movel %a0,%sp@- 5b23e: 4eb9 0004 d7b8 jsr 4d7b8 5b244: 4fef 000c lea %sp@(12),%sp } _Thread_queue_Extract_with_proxy( the_thread ); 5b248: 2f0a movel %a2,%sp@- 5b24a: 4eb9 0004 8d14 jsr 48d14 <_Thread_queue_Extract_with_proxy> return true; 5b250: 588f addql #4,%sp 5b252: 7001 moveq #1,%d0 5b254: 606c bras 5b2c2 <_POSIX_signals_Unblock_thread+0xf2> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 5b256: 2428 00d0 movel %a0@(208),%d2 5b25a: 4682 notl %d2 5b25c: c282 andl %d2,%d1 5b25e: 6760 beqs 5b2c0 <_POSIX_signals_Unblock_thread+0xf0> * 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 ) ) { 5b260: 0800 001c btst #28,%d0 5b264: 673e beqs 5b2a4 <_POSIX_signals_Unblock_thread+0xd4> the_thread->Wait.return_code = EINTR; 5b266: 7204 moveq #4,%d1 5b268: 2541 0034 movel %d1,%a2@(52) */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 5b26c: 2200 movel %d0,%d1 5b26e: 0281 0003 bee0 andil #245472,%d1 /* * 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) ) 5b274: 670c beqs 5b282 <_POSIX_signals_Unblock_thread+0xb2> _Thread_queue_Extract_with_proxy( the_thread ); 5b276: 2f0a movel %a2,%sp@- 5b278: 4eb9 0004 8d14 jsr 48d14 <_Thread_queue_Extract_with_proxy> 5b27e: 588f addql #4,%sp 5b280: 603e bras 5b2c0 <_POSIX_signals_Unblock_thread+0xf0> else if ( _States_Is_delaying(the_thread->current_state) ) { 5b282: 44c0 movew %d0,%ccr 5b284: 6a3a bpls 5b2c0 <_POSIX_signals_Unblock_thread+0xf0><== NEVER TAKEN (void) _Watchdog_Remove( &the_thread->Timer ); 5b286: 486a 0048 pea %a2@(72) 5b28a: 4eb9 0004 92f8 jsr 492f8 <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 5b290: 2f3c 1007 fff8 movel #268959736,%sp@- 5b296: 2f0a movel %a2,%sp@- 5b298: 4eb9 0004 8388 jsr 48388 <_Thread_Clear_state> 5b29e: 4fef 000c lea %sp@(12),%sp 5b2a2: 601c bras 5b2c0 <_POSIX_signals_Unblock_thread+0xf0> _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 5b2a4: 4a80 tstl %d0 5b2a6: 6618 bnes 5b2c0 <_POSIX_signals_Unblock_thread+0xf0><== NEVER TAKEN if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 5b2a8: 4ab9 0005 f318 tstl 5f318 <_Per_CPU_Information+0x8> 5b2ae: 6710 beqs 5b2c0 <_POSIX_signals_Unblock_thread+0xf0> 5b2b0: b5f9 0005 f31e cmpal 5f31e <_Per_CPU_Information+0xe>,%a2 5b2b6: 6608 bnes 5b2c0 <_POSIX_signals_Unblock_thread+0xf0><== NEVER TAKEN _Thread_Dispatch_necessary = true; 5b2b8: 7001 moveq #1,%d0 5b2ba: 13c0 0005 f31c moveb %d0,5f31c <_Per_CPU_Information+0xc> } } return false; 5b2c0: 4200 clrb %d0 } 5b2c2: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 5b2c8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048812 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 48812: 4e56 ffec linkw %fp,#-20 48816: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 4881a: 2a6e 0008 moveal %fp@(8),%a5 4881e: 246e 000c moveal %fp@(12),%a2 RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 48822: 4a8a tstl %a2 48824: 6700 00fe beqw 48924 <_RBTree_Extract_unprotected+0x112> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 48828: b5ed 0008 cmpal %a5@(8),%a2 4882c: 6612 bnes 48840 <_RBTree_Extract_unprotected+0x2e> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_RIGHT ); 4882e: 4878 0001 pea 1 48832: 2f0a movel %a2,%sp@- 48834: 4eb9 0004 8ba4 jsr 48ba4 <_RBTree_Next_unprotected> RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; 4883a: 508f addql #8,%sp 4883c: 2b40 0008 movel %d0,%a5@(8) } /* Check if max needs to be updated. min=max for 1 element trees so * do not use else if here. */ if (the_node == the_rbtree->first[RBT_RIGHT]) { 48840: b5ed 000c cmpal %a5@(12),%a2 48844: 6610 bnes 48856 <_RBTree_Extract_unprotected+0x44> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_LEFT ); 48846: 42a7 clrl %sp@- 48848: 2f0a movel %a2,%sp@- 4884a: 4eb9 0004 8ba4 jsr 48ba4 <_RBTree_Next_unprotected> RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; 48850: 508f addql #8,%sp 48852: 2b40 000c movel %d0,%a5@(12) * 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]) { 48856: 266a 0004 moveal %a2@(4),%a3 4885a: 4a8b tstl %a3 4885c: 6776 beqs 488d4 <_RBTree_Extract_unprotected+0xc2> 4885e: 4aaa 0008 tstl %a2@(8) 48862: 6604 bnes 48868 <_RBTree_Extract_unprotected+0x56> 48864: 6078 bras 488de <_RBTree_Extract_unprotected+0xcc> target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; 48866: 2640 moveal %d0,%a3 48868: 202b 0008 movel %a3@(8),%d0 4886c: 66f8 bnes 48866 <_RBTree_Extract_unprotected+0x54> * 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]; 4886e: 286b 0004 moveal %a3@(4),%a4 if(leaf) { 48872: 4a8c tstl %a4 48874: 6704 beqs 4887a <_RBTree_Extract_unprotected+0x68> leaf->parent = target->parent; 48876: 2893 movel %a3@,%a4@ 48878: 6008 bras 48882 <_RBTree_Extract_unprotected+0x70> } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 4887a: 2f0b movel %a3,%sp@- 4887c: 4eba fe60 jsr %pc@(486de <_RBTree_Extract_validate_unprotected>) 48880: 588f addql #4,%sp } victim_color = target->color; dir = target != target->parent->child[0]; 48882: 2053 moveal %a3@,%a0 48884: b7e8 0004 cmpal %a0@(4),%a3 48888: 56c1 sne %d1 target->parent->child[dir] = leaf; 4888a: 7401 moveq #1,%d2 } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; dir = target != target->parent->child[0]; 4888c: 49c1 extbl %d1 target->parent->child[dir] = leaf; 4888e: 9481 subl %d1,%d2 48890: 218c 2c00 movel %a4,%a0@(00000000,%d2:l:4) /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; the_node->parent->child[dir] = target; 48894: 7401 moveq #1,%d2 victim_color = target->color; dir = target != target->parent->child[0]; target->parent->child[dir] = leaf; /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 48896: 2052 moveal %a2@,%a0 48898: b5e8 0004 cmpal %a0@(4),%a2 4889c: 56c1 sne %d1 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; 4889e: 202b 000c movel %a3@(12),%d0 dir = target != target->parent->child[0]; target->parent->child[dir] = leaf; /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 488a2: 49c1 extbl %d1 the_node->parent->child[dir] = target; 488a4: 9481 subl %d1,%d2 488a6: 218b 2c00 movel %a3,%a0@(00000000,%d2:l:4) /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; 488aa: 276a 0008 0008 movel %a2@(8),%a3@(8) if (the_node->child[RBT_RIGHT]) 488b0: 206a 0008 moveal %a2@(8),%a0 488b4: 4a88 tstl %a0 488b6: 6702 beqs 488ba <_RBTree_Extract_unprotected+0xa8><== NEVER TAKEN the_node->child[RBT_RIGHT]->parent = target; 488b8: 208b movel %a3,%a0@ target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 488ba: 276a 0004 0004 movel %a2@(4),%a3@(4) if (the_node->child[RBT_LEFT]) 488c0: 206a 0004 moveal %a2@(4),%a0 488c4: 4a88 tstl %a0 488c6: 6702 beqs 488ca <_RBTree_Extract_unprotected+0xb8> the_node->child[RBT_LEFT]->parent = target; 488c8: 208b movel %a3,%a0@ /* 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; 488ca: 2692 movel %a2@,%a3@ target->color = the_node->color; 488cc: 276a 000c 000c movel %a2@(12),%a3@(12) 488d2: 602e bras 48902 <_RBTree_Extract_unprotected+0xf0> * the_node's location in the tree. This may cause the coloring to be * violated. We will fix it later. * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; 488d4: 286a 0008 moveal %a2@(8),%a4 if( leaf ) { 488d8: 4a8c tstl %a4 488da: 6604 bnes 488e0 <_RBTree_Extract_unprotected+0xce> 488dc: 6006 bras 488e4 <_RBTree_Extract_unprotected+0xd2> * 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]) { 488de: 284b moveal %a3,%a4 * 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; 488e0: 2892 movel %a2@,%a4@ 488e2: 6008 bras 488ec <_RBTree_Extract_unprotected+0xda> } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 488e4: 2f0a movel %a2,%sp@- 488e6: 4eba fdf6 jsr %pc@(486de <_RBTree_Extract_validate_unprotected>) 488ea: 588f addql #4,%sp } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 488ec: 2052 moveal %a2@,%a0 488ee: b5e8 0004 cmpal %a0@(4),%a2 488f2: 56c1 sne %d1 the_node->parent->child[dir] = leaf; 488f4: 7401 moveq #1,%d2 _RBTree_Extract_validate_unprotected(the_node); } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 488f6: 49c1 extbl %d1 the_node->parent->child[dir] = leaf; 488f8: 9481 subl %d1,%d2 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; 488fa: 202a 000c movel %a2@(12),%d0 /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; the_node->parent->child[dir] = leaf; 488fe: 218c 2c00 movel %a4,%a0@(00000000,%d2:l:4) /* fix coloring. leaf has moved up the tree. The color of the deleted * node is in victim_color. There are two cases: * 1. Deleted a red node, its child must be black. Nothing must be done. * 2. Deleted a black node, its child must be red. Paint child black. */ if (victim_color == RBT_BLACK) { /* eliminate case 1 */ 48902: 4a80 tstl %d0 48904: 6608 bnes 4890e <_RBTree_Extract_unprotected+0xfc> if (leaf) { 48906: 4a8c tstl %a4 48908: 6704 beqs 4890e <_RBTree_Extract_unprotected+0xfc> leaf->color = RBT_BLACK; /* case 2 */ 4890a: 42ac 000c clrl %a4@(12) /* 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; 4890e: 206d 0004 moveal %a5@(4),%a0 */ RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree( RBTree_Node *node ) { node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL; 48912: 42aa 0008 clrl %a2@(8) 48916: 42aa 0004 clrl %a2@(4) 4891a: 4292 clrl %a2@ 4891c: 4a88 tstl %a0 4891e: 6704 beqs 48924 <_RBTree_Extract_unprotected+0x112> 48920: 42a8 000c clrl %a0@(12) } 48924: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4892a: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000494d4 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 494d4: 4e56 fff0 linkw %fp,#-16 494d8: 202e 001c movel %fp@(28),%d0 494dc: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 494e0: 246e 0008 moveal %fp@(8),%a2 494e4: 242e 0014 movel %fp@(20),%d2 size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 494e8: 4a8a tstl %a2 494ea: 6736 beqs 49522 <_RBTree_Initialize+0x4e> <== NEVER TAKEN RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 494ec: 4292 clrl %a2@ the_rbtree->root = NULL; the_rbtree->first[0] = NULL; the_rbtree->first[1] = NULL; the_rbtree->compare_function = compare_function; 494ee: 256e 000c 0010 movel %fp@(12),%a2@(16) /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; 494f4: 262e 0010 movel %fp@(16),%d3 RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; the_rbtree->root = NULL; 494f8: 42aa 0004 clrl %a2@(4) while ( count-- ) { _RBTree_Insert_unprotected(the_rbtree, next); 494fc: 47f9 0004 92b4 lea 492b4 <_RBTree_Insert_unprotected>,%a3 the_rbtree->first[0] = NULL; 49502: 42aa 0008 clrl %a2@(8) the_rbtree->first[1] = NULL; 49506: 42aa 000c clrl %a2@(12) the_rbtree->compare_function = compare_function; the_rbtree->is_unique = is_unique; 4950a: 1540 0014 moveb %d0,%a2@(20) /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 4950e: 600e bras 4951e <_RBTree_Initialize+0x4a> _RBTree_Insert_unprotected(the_rbtree, next); 49510: 2f03 movel %d3,%sp@- 49512: 5382 subql #1,%d2 49514: 2f0a movel %a2,%sp@- 49516: 4e93 jsr %a3@ 49518: 508f addql #8,%sp #include #include #include #include void _RBTree_Initialize( 4951a: d6ae 0018 addl %fp@(24),%d3 /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 4951e: 4a82 tstl %d2 49520: 66ee bnes 49510 <_RBTree_Initialize+0x3c> _RBTree_Insert_unprotected(the_rbtree, next); next = (RBTree_Node *) _Addresses_Add_offset( (void *) next, node_size ); } } 49522: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 49528: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000489b8 <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 489b8: 4e56 ffec linkw %fp,#-20 489bc: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 489c0: 266e 0008 moveal %fp@(8),%a3 489c4: 246e 000c moveal %fp@(12),%a2 if(!the_node) return (RBTree_Node*)-1; 489c8: 4a8a tstl %a2 489ca: 6700 013a beqw 48b06 <_RBTree_Insert_unprotected+0x14e> RBTree_Node *iter_node = the_rbtree->root; 489ce: 286b 0004 moveal %a3@(4),%a4 int compare_result; if (!iter_node) { /* special case: first node inserted */ 489d2: 2a4c moveal %a4,%a5 489d4: 4a8c tstl %a4 489d6: 6620 bnes 489f8 <_RBTree_Insert_unprotected+0x40> the_node->color = RBT_BLACK; 489d8: 42aa 000c clrl %a2@(12) the_rbtree->root = the_node; 489dc: 274a 0004 movel %a2,%a3@(4) the_rbtree->first[0] = the_rbtree->first[1] = the_node; 489e0: 274a 000c movel %a2,%a3@(12) 489e4: 274a 0008 movel %a2,%a3@(8) the_node->parent = (RBTree_Node *) the_rbtree; 489e8: 248b movel %a3,%a2@ the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 489ea: 42aa 0008 clrl %a2@(8) 489ee: 42aa 0004 clrl %a2@(4) 489f2: 6000 0126 braw 48b1a <_RBTree_Insert_unprotected+0x162> (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; } break; } else { iter_node = iter_node->child[dir]; 489f6: 2a4c moveal %a4,%a5 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); 489f8: 2f0c movel %a4,%sp@- 489fa: 2f0a movel %a2,%sp@- 489fc: 206b 0010 moveal %a3@(16),%a0 48a00: 4e90 jsr %a0@ if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 48a02: 508f addql #8,%sp 48a04: 4a2b 0014 tstb %a3@(20) 48a08: 6706 beqs 48a10 <_RBTree_Insert_unprotected+0x58> 48a0a: 4a80 tstl %d0 48a0c: 6700 010c beqw 48b1a <_RBTree_Insert_unprotected+0x162> return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 48a10: 2400 movel %d0,%d2 48a12: 4682 notl %d2 48a14: d482 addl %d2,%d2 48a16: 9582 subxl %d2,%d2 48a18: 4482 negl %d2 if (!iter_node->child[dir]) { 48a1a: 2002 movel %d2,%d0 48a1c: 5280 addql #1,%d0 48a1e: 2874 0c00 moveal %a4@(00000000,%d0:l:4),%a4 48a22: 4a8c tstl %a4 48a24: 66d0 bnes 489f6 <_RBTree_Insert_unprotected+0x3e> the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 48a26: 42aa 0008 clrl %a2@(8) the_node->color = RBT_RED; 48a2a: 7201 moveq #1,%d1 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; 48a2c: 42aa 0004 clrl %a2@(4) the_node->color = RBT_RED; iter_node->child[dir] = the_node; 48a30: 2b8a 0c00 movel %a2,%a5@(00000000,%d0:l:4) the_node->parent = iter_node; 48a34: 248d movel %a5,%a2@ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 48a36: 2a42 moveal %d2,%a5 48a38: 548d addql #2,%a5 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; 48a3a: 2541 000c movel %d1,%a2@(12) iter_node->child[dir] = the_node; the_node->parent = iter_node; /* update min/max */ compare_result = the_rbtree->compare_function( 48a3e: 2f33 dc00 movel %a3@(00000000,%a5:l:4),%sp@- 48a42: 2f0a movel %a2,%sp@- 48a44: 206b 0010 moveal %a3@(16),%a0 48a48: 4e90 jsr %a0@ the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 48a4a: 508f addql #8,%sp 48a4c: 4a82 tstl %d2 48a4e: 6608 bnes 48a58 <_RBTree_Insert_unprotected+0xa0> 48a50: 4a80 tstl %d0 48a52: 6c00 0092 bgew 48ae6 <_RBTree_Insert_unprotected+0x12e> 48a56: 6006 bras 48a5e <_RBTree_Insert_unprotected+0xa6> (dir && _RBTree_Is_greater(compare_result)) ) { 48a58: 4a80 tstl %d0 48a5a: 6f00 008a blew 48ae6 <_RBTree_Insert_unprotected+0x12e> the_rbtree->first[dir] = the_node; 48a5e: 278a dc00 movel %a2,%a3@(00000000,%a5:l:4) 48a62: 6000 0082 braw 48ae6 <_RBTree_Insert_unprotected+0x12e> const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; 48a66: 4a8b tstl %a3 48a68: 671e beqs 48a88 <_RBTree_Insert_unprotected+0xd0><== NEVER TAKEN if(!(the_node->parent->parent->parent)) return NULL; 48a6a: 4a93 tstl %a3@ 48a6c: 671a beqs 48a88 <_RBTree_Insert_unprotected+0xd0><== 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]) 48a6e: 226b 0004 moveal %a3@(4),%a1 48a72: b3c8 cmpal %a0,%a1 48a74: 6604 bnes 48a7a <_RBTree_Insert_unprotected+0xc2> return the_node->parent->child[RBT_RIGHT]; 48a76: 226b 0008 moveal %a3@(8),%a1 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 48a7a: 4a89 tstl %a1 48a7c: 670c beqs 48a8a <_RBTree_Insert_unprotected+0xd2> 48a7e: 7001 moveq #1,%d0 48a80: b0a9 000c cmpl %a1@(12),%d0 48a84: 6604 bnes 48a8a <_RBTree_Insert_unprotected+0xd2> 48a86: 6006 bras 48a8e <_RBTree_Insert_unprotected+0xd6> ) { 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; 48a88: 93c9 subal %a1,%a1 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 48a8a: 4280 clrl %d0 48a8c: 6002 bras 48a90 <_RBTree_Insert_unprotected+0xd8> 48a8e: 7001 moveq #1,%d0 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)) { 48a90: 4a80 tstl %d0 48a92: 6710 beqs 48aa4 <_RBTree_Insert_unprotected+0xec> the_node->parent->color = RBT_BLACK; 48a94: 42a8 000c clrl %a0@(12) u->color = RBT_BLACK; g->color = RBT_RED; 48a98: 7201 moveq #1,%d1 g = the_node->parent->parent; /* if uncle is red, repaint uncle/parent black and grandparent red */ if(_RBTree_Is_red(u)) { the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; 48a9a: 42a9 000c clrl %a1@(12) g->color = RBT_RED; 48a9e: 2741 000c movel %d1,%a3@(12) 48aa2: 603e bras 48ae2 <_RBTree_Insert_unprotected+0x12a> 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]; 48aa4: b1eb 0004 cmpal %a3@(4),%a0 48aa8: 56c0 sne %d0 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]; 48aaa: b5e8 0004 cmpal %a0@(4),%a2 48aae: 56c1 sne %d1 RBTree_Direction pdir = the_node->parent != g->child[0]; 48ab0: 49c0 extbl %d0 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]; 48ab2: 2400 movel %d0,%d2 48ab4: 49c1 extbl %d1 48ab6: 4482 negl %d2 RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { 48ab8: b081 cmpl %d1,%d0 48aba: 670c beqs 48ac8 <_RBTree_Insert_unprotected+0x110> _RBTree_Rotate(the_node->parent, pdir); 48abc: 2f02 movel %d2,%sp@- 48abe: 2f08 movel %a0,%sp@- 48ac0: 4e95 jsr %a5@ the_node = the_node->child[pdir]; 48ac2: 508f addql #8,%sp 48ac4: 2472 2c04 moveal %a2@(00000004,%d2:l:4),%a2 } the_node->parent->color = RBT_BLACK; 48ac8: 2052 moveal %a2@,%a0 g->color = RBT_RED; 48aca: 7001 moveq #1,%d0 /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 48acc: 7201 moveq #1,%d1 48ace: 9282 subl %d2,%d1 /* 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; 48ad0: 42a8 000c clrl %a0@(12) g->color = RBT_RED; 48ad4: 2740 000c movel %d0,%a3@(12) /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 48ad8: 2f01 movel %d1,%sp@- 48ada: 2f0b movel %a3,%sp@- 48adc: 264a moveal %a2,%a3 48ade: 4e95 jsr %a5@ 48ae0: 508f addql #8,%sp 48ae2: 244b moveal %a3,%a2 48ae4: 6004 bras 48aea <_RBTree_Insert_unprotected+0x132> 48ae6: 4bfa fe74 lea %pc@(4895c <_RBTree_Rotate>),%a5 _ISR_Disable( level ); return_node = _RBTree_Insert_unprotected( tree, node ); _ISR_Enable( level ); return return_node; } 48aea: 2052 moveal %a2@,%a0 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 48aec: 2650 moveal %a0@,%a3 48aee: 4a8b tstl %a3 48af0: 661a bnes 48b0c <_RBTree_Insert_unprotected+0x154> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 48af2: 4280 clrl %d0 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))) { 48af4: 0800 0000 btst #0,%d0 48af8: 6600 ff6c bnew 48a66 <_RBTree_Insert_unprotected+0xae> /* 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; 48afc: 4a8b tstl %a3 48afe: 661a bnes 48b1a <_RBTree_Insert_unprotected+0x162> 48b00: 42aa 000c clrl %a2@(12) 48b04: 6014 bras 48b1a <_RBTree_Insert_unprotected+0x162> RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { if(!the_node) return (RBTree_Node*)-1; 48b06: 387c ffff moveaw #-1,%a4 48b0a: 600e bras 48b1a <_RBTree_Insert_unprotected+0x162> 48b0c: 7001 moveq #1,%d0 48b0e: b0a8 000c cmpl %a0@(12),%d0 48b12: 57c0 seq %d0 48b14: 49c0 extbl %d0 48b16: 4480 negl %d0 48b18: 60da bras 48af4 <_RBTree_Insert_unprotected+0x13c> /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 48b1a: 200c movel %a4,%d0 48b1c: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 48b22: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048b50 <_RBTree_Iterate_unprotected>: RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 48b50: 7202 moveq #2,%d1 const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 48b52: 4e56 fff0 linkw %fp,#-16 48b56: 206e 0008 moveal %fp@(8),%a0 48b5a: 48d7 041c moveml %d2-%d4/%a2,%sp@ 48b5e: 262e 000c movel %fp@(12),%d3 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 48b62: 57c0 seq %d0 bool stop = false; while ( !stop && current != NULL ) { stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); 48b64: 45f9 0004 8ba4 lea 48ba4 <_RBTree_Next_unprotected>,%a2 48b6a: 49c0 extbl %d0 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 48b6c: 9280 subl %d0,%d1 48b6e: 2430 1c00 movel %a0@(00000000,%d1:l:4),%d2 48b72: 6020 bras 48b94 <_RBTree_Iterate_unprotected+0x44> 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 ); 48b74: 2f2e 0014 movel %fp@(20),%sp@- 48b78: 206e 0010 moveal %fp@(16),%a0 48b7c: 2f03 movel %d3,%sp@- 48b7e: 2f02 movel %d2,%sp@- 48b80: 4e90 jsr %a0@ current = _RBTree_Next_unprotected( current, dir ); 48b82: 2f03 movel %d3,%sp@- 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 ); 48b84: 1800 moveb %d0,%d4 current = _RBTree_Next_unprotected( current, dir ); 48b86: 2f02 movel %d2,%sp@- 48b88: 4e92 jsr %a2@ { RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { 48b8a: 4fef 0014 lea %sp@(20),%sp stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); 48b8e: 2400 movel %d0,%d2 { RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { 48b90: 4a04 tstb %d4 48b92: 6604 bnes 48b98 <_RBTree_Iterate_unprotected+0x48><== NEVER TAKEN 48b94: 4a82 tstl %d2 48b96: 66dc bnes 48b74 <_RBTree_Iterate_unprotected+0x24> stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); } } 48b98: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 48b9e: 4e5e unlk %fp ... =============================================================================== 00048682 <_RBTree_Rotate>: */ RTEMS_INLINE_ROUTINE void _RBTree_Rotate( RBTree_Node *the_node, RBTree_Direction dir ) { 48682: 4e56 0000 linkw %fp,#0 48686: 206e 0008 moveal %fp@(8),%a0 4868a: 2f0a movel %a2,%sp@- 4868c: 202e 000c movel %fp@(12),%d0 48690: 2f02 movel %d2,%sp@- RBTree_Node *c; if (the_node == NULL) return; 48692: 4a88 tstl %a0 48694: 6740 beqs 486d6 <_RBTree_Rotate+0x54> <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 48696: 4a80 tstl %d0 48698: 57c1 seq %d1 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 4869a: 7401 moveq #1,%d2 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 4869c: 49c1 extbl %d1 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 4869e: 9481 subl %d1,%d2 486a0: 2270 2c00 moveal %a0@(00000000,%d2:l:4),%a1 486a4: 4a89 tstl %a1 486a6: 672e beqs 486d6 <_RBTree_Rotate+0x54> <== NEVER TAKEN c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 486a8: 5280 addql #1,%d0 486aa: 45f1 0c00 lea %a1@(00000000,%d0:l:4),%a2 486ae: 2192 2c00 movel %a2@,%a0@(00000000,%d2:l:4) if (c->child[dir]) 486b2: 2471 0c00 moveal %a1@(00000000,%d0:l:4),%a2 486b6: 4a8a tstl %a2 486b8: 6702 beqs 486bc <_RBTree_Rotate+0x3a> c->child[dir]->parent = the_node; 486ba: 2488 movel %a0,%a2@ c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 486bc: 2450 moveal %a0@,%a2 486be: 7201 moveq #1,%d1 the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 486c0: 2388 0c00 movel %a0,%a1@(00000000,%d0:l:4) the_node->parent->child[the_node != the_node->parent->child[0]] = c; 486c4: b1ea 0004 cmpal %a2@(4),%a0 486c8: 56c0 sne %d0 c->parent = the_node->parent; 486ca: 228a movel %a2,%a1@ if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 486cc: 49c0 extbl %d0 486ce: 9280 subl %d0,%d1 486d0: 2589 1c00 movel %a1,%a2@(00000000,%d1:l:4) c->parent = the_node->parent; the_node->parent = c; 486d4: 2089 movel %a1,%a0@ } 486d6: 241f movel %sp@+,%d2 486d8: 245f moveal %sp@+,%a2 486da: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048658 <_RBTree_Sibling>: * exists, and NULL if not. */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { 48658: 4e56 0000 linkw %fp,#0 4865c: 226e 0008 moveal %fp@(8),%a1 if(!the_node) return NULL; 48660: 4a89 tstl %a1 48662: 6718 beqs 4867c <_RBTree_Sibling+0x24> <== NEVER TAKEN if(!(the_node->parent)) return NULL; 48664: 2051 moveal %a1@,%a0 48666: 4a88 tstl %a0 48668: 6712 beqs 4867c <_RBTree_Sibling+0x24> <== NEVER TAKEN if(!(the_node->parent->parent)) return NULL; 4866a: 4a90 tstl %a0@ 4866c: 670e beqs 4867c <_RBTree_Sibling+0x24> if(the_node == the_node->parent->child[RBT_LEFT]) 4866e: 2028 0004 movel %a0@(4),%d0 48672: b089 cmpl %a1,%d0 48674: 6608 bnes 4867e <_RBTree_Sibling+0x26> return the_node->parent->child[RBT_RIGHT]; 48676: 2028 0008 movel %a0@(8),%d0 4867a: 6002 bras 4867e <_RBTree_Sibling+0x26> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; 4867c: 4280 clrl %d0 if(the_node == the_node->parent->child[RBT_LEFT]) return the_node->parent->child[RBT_RIGHT]; else return the_node->parent->child[RBT_LEFT]; } 4867e: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047028 <_RTEMS_signal_Post_switch_hook>: #include #include #include static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing ) { 47028: 4e56 ffec linkw %fp,#-20 RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4702c: 206e 0008 moveal %fp@(8),%a0 #include #include #include static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing ) { 47030: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 47034: 2468 00fa moveal %a0@(250),%a2 if ( !api ) 47038: 4a8a tstl %a2 4703a: 6754 beqs 47090 <_RTEMS_signal_Post_switch_hook+0x68><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 4703c: 203c 0000 0700 movel #1792,%d0 47042: 40c1 movew %sr,%d1 47044: 8081 orl %d1,%d0 47046: 46c0 movew %d0,%sr signal_set = asr->signals_posted; 47048: 262a 0012 movel %a2@(18),%d3 asr->signals_posted = 0; 4704c: 42aa 0012 clrl %a2@(18) _ISR_Enable( level ); 47050: 46c1 movew %d1,%sr if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 47052: 4a83 tstl %d3 47054: 673a beqs 47090 <_RTEMS_signal_Post_switch_hook+0x68> return; asr->nest_level += 1; 47056: 52aa 001a addql #1,%a2@(26) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4705a: 240e movel %fp,%d2 4705c: 5982 subql #4,%d2 4705e: 47f9 0004 7434 lea 47434 ,%a3 47064: 2f02 movel %d2,%sp@- 47066: 2f3c 0000 ffff movel #65535,%sp@- 4706c: 2f2a 000e movel %a2@(14),%sp@- 47070: 4e93 jsr %a3@ (*asr->handler)( signal_set ); 47072: 2f03 movel %d3,%sp@- 47074: 206a 000a moveal %a2@(10),%a0 47078: 4e90 jsr %a0@ asr->nest_level -= 1; 4707a: 53aa 001a subql #1,%a2@(26) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4707e: 2f02 movel %d2,%sp@- 47080: 2f3c 0000 ffff movel #65535,%sp@- 47086: 2f2e fffc movel %fp@(-4),%sp@- 4708a: 4e93 jsr %a3@ 4708c: 4fef 001c lea %sp@(28),%sp } 47090: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 47096: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00058390 <_Region_Process_queue>: #include void _Region_Process_queue( Region_Control *the_region ) { 58390: 4e56 ffe4 linkw %fp,#-28 * * 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; 58394: 2039 0007 747a movel 7747a <_Thread_Dispatch_disable_level>,%d0 ++level; 5839a: 5280 addql #1,%d0 5839c: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 583a0: 266e 0008 moveal %fp@(8),%a3 _Thread_Dispatch_disable_level = level; 583a4: 23c0 0007 747a movel %d0,7747a <_Thread_Dispatch_disable_level> * NOTE: Be sure to disable dispatching before unlocking the mutex * since we do not want to open a window where a context * switch could occur. */ _Thread_Disable_dispatch(); _RTEMS_Unlock_allocator(); 583aa: 2f39 0007 74fe movel 774fe <_RTEMS_Allocator_Mutex>,%sp@- /* * NOTE: The following loop is O(n) where n is the number of * threads whose memory request is satisfied. */ for ( ; ; ) { the_thread = _Thread_queue_First( &the_region->Wait_queue ); 583b0: 240b movel %a3,%d2 RTEMS_INLINE_ROUTINE void *_Region_Allocate_segment ( Region_Control *the_region, uintptr_t size ) { return _Heap_Allocate( &the_region->Memory, size ); 583b2: 260b movel %a3,%d3 583b4: 0682 0000 0010 addil #16,%d2 583ba: 4bf9 0005 8acc lea 58acc <_Thread_queue_First>,%a5 583c0: 0683 0000 0068 addil #104,%d3 if ( the_segment == NULL ) break; *(void **)the_thread->Wait.return_argument = the_segment; the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); 583c6: 49f9 0005 89c8 lea 589c8 <_Thread_queue_Extract>,%a4 * NOTE: Be sure to disable dispatching before unlocking the mutex * since we do not want to open a window where a context * switch could occur. */ _Thread_Disable_dispatch(); _RTEMS_Unlock_allocator(); 583cc: 4eb9 0005 31b4 jsr 531b4 <_API_Mutex_Unlock> 583d2: 588f addql #4,%sp 583d4: 283c 0005 3c3c movel #343100,%d4 /* * NOTE: The following loop is O(n) where n is the number of * threads whose memory request is satisfied. */ for ( ; ; ) { the_thread = _Thread_queue_First( &the_region->Wait_queue ); 583da: 2f02 movel %d2,%sp@- 583dc: 4e95 jsr %a5@ if ( the_thread == NULL ) 583de: 588f addql #4,%sp /* * NOTE: The following loop is O(n) where n is the number of * threads whose memory request is satisfied. */ for ( ; ; ) { the_thread = _Thread_queue_First( &the_region->Wait_queue ); 583e0: 2440 moveal %d0,%a2 if ( the_thread == NULL ) 583e2: 4a80 tstl %d0 583e4: 672e beqs 58414 <_Region_Process_queue+0x84> 583e6: 42a7 clrl %sp@- 583e8: 2044 moveal %d4,%a0 583ea: 42a7 clrl %sp@- 583ec: 2f2a 0024 movel %a2@(36),%sp@- 583f0: 2f03 movel %d3,%sp@- 583f2: 4e90 jsr %a0@ the_segment = (void **) _Region_Allocate_segment( the_region, the_thread->Wait.count ); if ( the_segment == NULL ) 583f4: 4fef 0010 lea %sp@(16),%sp 583f8: 4a80 tstl %d0 583fa: 6718 beqs 58414 <_Region_Process_queue+0x84> break; *(void **)the_thread->Wait.return_argument = the_segment; 583fc: 206a 0028 moveal %a2@(40),%a0 58400: 2080 movel %d0,%a0@ the_region->number_of_used_blocks += 1; 58402: 52ab 0064 addql #1,%a3@(100) _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); 58406: 2f0a movel %a2,%sp@- 58408: 2f02 movel %d2,%sp@- 5840a: 4e94 jsr %a4@ the_thread->Wait.return_code = RTEMS_SUCCESSFUL; } 5840c: 508f addql #8,%sp break; *(void **)the_thread->Wait.return_argument = the_segment; the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); the_thread->Wait.return_code = RTEMS_SUCCESSFUL; 5840e: 42aa 0034 clrl %a2@(52) } 58412: 60c6 bras 583da <_Region_Process_queue+0x4a> _Thread_Enable_dispatch(); } 58414: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 5841a: 4e5e unlk %fp *(void **)the_thread->Wait.return_argument = the_segment; the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); the_thread->Wait.return_code = RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 5841c: 4ef9 0005 58b8 jmp 558b8 <_Thread_Enable_dispatch> ... =============================================================================== 00048520 <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 48520: 4e56 0000 linkw %fp,#0 48524: 2f0a movel %a2,%sp@- void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 48526: 4878 001c pea 1c #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 4852a: 246e 0008 moveal %fp@(8),%a2 void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 4852e: 4eb9 0004 9c4c jsr 49c4c <_Workspace_Allocate> if ( sched ) { 48534: 588f addql #4,%sp 48536: 4a80 tstl %d0 48538: 6712 beqs 4854c <_Scheduler_CBS_Allocate+0x2c> <== NEVER TAKEN the_thread->scheduler_info = sched; 4853a: 2540 0086 movel %d0,%a2@(134) schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; 4853e: 2040 moveal %d0,%a0 schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 48540: 7202 moveq #2,%d1 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; 48542: 208a movel %a2,%a0@ schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 48544: 2141 0014 movel %d1,%a0@(20) schinfo->cbs_server = NULL; 48548: 42a8 0018 clrl %a0@(24) } return sched; } 4854c: 246e fffc moveal %fp@(-4),%a2 48550: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000499e8 <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 499e8: 4e56 fffc linkw %fp,#-4 499ec: 2f0a movel %a2,%sp@- 499ee: 246e 0008 moveal %fp@(8),%a2 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; 499f2: 202a 00a8 movel %a2@(168),%d0 if ( the_thread->real_priority != new_priority ) 499f6: b0aa 0018 cmpl %a2@(24),%d0 499fa: 6704 beqs 49a00 <_Scheduler_CBS_Budget_callout+0x18><== NEVER TAKEN the_thread->real_priority = new_priority; 499fc: 2540 0018 movel %d0,%a2@(24) if ( the_thread->current_priority != new_priority ) 49a00: b0aa 0014 cmpl %a2@(20),%d0 49a04: 6712 beqs 49a18 <_Scheduler_CBS_Budget_callout+0x30><== NEVER TAKEN _Thread_Change_priority(the_thread, new_priority, true); 49a06: 4878 0001 pea 1 49a0a: 2f00 movel %d0,%sp@- 49a0c: 2f0a movel %a2,%sp@- 49a0e: 4eb9 0004 9f44 jsr 49f44 <_Thread_Change_priority> 49a14: 4fef 000c lea %sp@(12),%sp /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; 49a18: 246a 0086 moveal %a2@(134),%a2 if ( sched_info->cbs_server->cbs_budget_overrun ) { 49a1c: 206a 0018 moveal %a2@(24),%a0 49a20: 4aa8 000c tstl %a0@(12) 49a24: 671e beqs 49a44 <_Scheduler_CBS_Budget_callout+0x5c> _Scheduler_CBS_Get_server_id( 49a26: 486e fffc pea %fp@(-4) 49a2a: 2f10 movel %a0@,%sp@- 49a2c: 4eb9 0004 99ac jsr 499ac <_Scheduler_CBS_Get_server_id> sched_info->cbs_server->task_id, &server_id ); sched_info->cbs_server->cbs_budget_overrun( server_id ); 49a32: 206a 0018 moveal %a2@(24),%a0 49a36: 2f2e fffc movel %fp@(-4),%sp@- 49a3a: 2068 000c moveal %a0@(12),%a0 49a3e: 4e90 jsr %a0@ 49a40: 4fef 000c lea %sp@(12),%sp } } 49a44: 246e fff8 moveal %fp@(-8),%a2 49a48: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000496bc <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 496bc: 4e56 fff4 linkw %fp,#-12 496c0: 48d7 1c00 moveml %a2-%a4,%sp@ 496c4: 246e 0008 moveal %fp@(8),%a2 496c8: 266e 0010 moveal %fp@(16),%a3 unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 496cc: 4aaa 0004 tstl %a2@(4) 496d0: 6f3e bles 49710 <_Scheduler_CBS_Create_server+0x54> 496d2: 4a92 tstl %a2@ 496d4: 6f3a bles 49710 <_Scheduler_CBS_Create_server+0x54> 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++ ) { 496d6: 2239 0006 079c movel 6079c <_Scheduler_CBS_Maximum_servers>,%d1 if ( !_Scheduler_CBS_Server_list[i] ) 496dc: 4280 clrl %d0 496de: 2079 0006 24d2 moveal 624d2 <_Scheduler_CBS_Server_list>,%a0 496e4: 6006 bras 496ec <_Scheduler_CBS_Create_server+0x30> 496e6: 4a98 tstl %a0@+ 496e8: 672e beqs 49718 <_Scheduler_CBS_Create_server+0x5c> 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++ ) { 496ea: 5280 addql #1,%d0 496ec: b280 cmpl %d0,%d1 496ee: 66f6 bnes 496e6 <_Scheduler_CBS_Create_server+0x2a> if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 496f0: 70e6 moveq #-26,%d0 496f2: 6050 bras 49744 <_Scheduler_CBS_Create_server+0x88> _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; 496f4: 2012 movel %a2@,%d0 496f6: 222a 0004 movel %a2@(4),%d1 the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; 496fa: 216e 000c 000c movel %fp@(12),%a0@(12) _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; 49700: 2140 0004 movel %d0,%a0@(4) 49704: 2141 0008 movel %d1,%a0@(8) the_server->task_id = -1; 49708: 70ff moveq #-1,%d0 4970a: 2080 movel %d0,%a0@ the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; 4970c: 4280 clrl %d0 4970e: 6034 bras 49744 <_Scheduler_CBS_Create_server+0x88> 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; 49710: 70ee moveq #-18,%d0 49712: 6030 bras 49744 <_Scheduler_CBS_Create_server+0x88> *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; 49714: 70ef moveq #-17,%d0 <== NOT EXECUTED 49716: 602c bras 49744 <_Scheduler_CBS_Create_server+0x88><== NOT EXECUTED } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 49718: 2680 movel %d0,%a3@ _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 4971a: 4878 0010 pea 10 if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 4971e: 2879 0006 24d2 moveal 624d2 <_Scheduler_CBS_Server_list>,%a4 49724: e588 lsll #2,%d0 49726: d9c0 addal %d0,%a4 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 49728: 4eb9 0004 b150 jsr 4b150 <_Workspace_Allocate> the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) 4972e: 588f addql #4,%sp if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 49730: 2880 movel %d0,%a4@ _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 49732: 2013 movel %a3@,%d0 49734: 2079 0006 24d2 moveal 624d2 <_Scheduler_CBS_Server_list>,%a0 4973a: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 if ( !the_server ) 4973e: 4a88 tstl %a0 49740: 66b2 bnes 496f4 <_Scheduler_CBS_Create_server+0x38><== ALWAYS TAKEN 49742: 60d0 bras 49714 <_Scheduler_CBS_Create_server+0x58><== NOT EXECUTED the_server->parameters = *params; the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } 49744: 4cee 1c00 fff4 moveml %fp@(-12),%a2-%a4 4974a: 4e5e unlk %fp ... =============================================================================== 000497c8 <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 497c8: 4e56 fff0 linkw %fp,#-16 497cc: 48d7 040c moveml %d2-%d3/%a2,%sp@ Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); 497d0: 486e fffc pea %fp@(-4) int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 497d4: 242e 000c movel %fp@(12),%d2 497d8: 262e 0008 movel %fp@(8),%d3 Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); 497dc: 2f02 movel %d2,%sp@- 497de: 4eb9 0004 a3b4 jsr 4a3b4 <_Thread_Get> /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 497e4: 508f addql #8,%sp { Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); 497e6: 2440 moveal %d0,%a2 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 497e8: 4a80 tstl %d0 497ea: 6706 beqs 497f2 <_Scheduler_CBS_Detach_thread+0x2a> _Thread_Enable_dispatch(); 497ec: 4eb9 0004 a394 jsr 4a394 <_Thread_Enable_dispatch> } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 497f2: b6b9 0006 079c cmpl 6079c <_Scheduler_CBS_Maximum_servers>,%d3 497f8: 643c bccs 49836 <_Scheduler_CBS_Detach_thread+0x6e> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) 497fa: 4a8a tstl %a2 497fc: 6738 beqs 49836 <_Scheduler_CBS_Detach_thread+0x6e> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 497fe: 2079 0006 24d2 moveal 624d2 <_Scheduler_CBS_Server_list>,%a0 49804: 2070 3c00 moveal %a0@(00000000,%d3:l:4),%a0 49808: 4a88 tstl %a0 4980a: 6726 beqs 49832 <_Scheduler_CBS_Detach_thread+0x6a> return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) 4980c: b490 cmpl %a0@,%d2 4980e: 6626 bnes 49836 <_Scheduler_CBS_Detach_thread+0x6e><== NEVER TAKEN return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; 49810: 70ff moveq #-1,%d0 49812: 2080 movel %d0,%a0@ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 49814: 206a 0086 moveal %a2@(134),%a0 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; 49818: 4280 clrl %d0 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; 4981a: 42a8 0018 clrl %a0@(24) the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 4981e: 256a 009c 0076 movel %a2@(156),%a2@(118) the_thread->budget_callout = the_thread->Start.budget_callout; 49824: 256a 00a0 007a movel %a2@(160),%a2@(122) the_thread->is_preemptible = the_thread->Start.is_preemptible; 4982a: 156a 009a 0070 moveb %a2@(154),%a2@(112) 49830: 6006 bras 49838 <_Scheduler_CBS_Detach_thread+0x70> 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; 49832: 70e7 moveq #-25,%d0 49834: 6002 bras 49838 <_Scheduler_CBS_Detach_thread+0x70> if ( the_thread ) { _Thread_Enable_dispatch(); } if ( server_id >= _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 49836: 70ee moveq #-18,%d0 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; } 49838: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2 4983e: 4e5e unlk %fp ... =============================================================================== 00049a4c <_Scheduler_CBS_Initialize>: int _Scheduler_CBS_Initialize(void) { 49a4c: 4e56 0000 linkw %fp,#0 unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 49a50: 2039 0006 079c movel 6079c <_Scheduler_CBS_Maximum_servers>,%d0 49a56: e588 lsll #2,%d0 49a58: 2f00 movel %d0,%sp@- 49a5a: 4eb9 0004 b150 jsr 4b150 <_Workspace_Allocate> _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 49a60: 588f addql #4,%sp } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 49a62: 23c0 0006 24d2 movel %d0,624d2 <_Scheduler_CBS_Server_list> _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 49a68: 671e beqs 49a88 <_Scheduler_CBS_Initialize+0x3c> <== NEVER TAKEN return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 49a6a: 2239 0006 079c movel 6079c <_Scheduler_CBS_Maximum_servers>,%d1 49a70: 4280 clrl %d0 49a72: 600c bras 49a80 <_Scheduler_CBS_Initialize+0x34> _Scheduler_CBS_Server_list[i] = NULL; 49a74: 2079 0006 24d2 moveal 624d2 <_Scheduler_CBS_Server_list>,%a0 49a7a: 42b0 0c00 clrl %a0@(00000000,%d0:l:4) 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++) { 49a7e: 5280 addql #1,%d0 49a80: b280 cmpl %d0,%d1 49a82: 66f0 bnes 49a74 <_Scheduler_CBS_Initialize+0x28> _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 49a84: 4280 clrl %d0 49a86: 6002 bras 49a8a <_Scheduler_CBS_Initialize+0x3e> { 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; 49a88: 70ef moveq #-17,%d0 <== NOT EXECUTED for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; } 49a8a: 4e5e unlk %fp ... =============================================================================== 00048554 <_Scheduler_CBS_Release_job>: void _Scheduler_CBS_Release_job( Thread_Control *the_thread, uint32_t deadline ) { 48554: 4e56 0000 linkw %fp,#0 48558: 206e 0008 moveal %fp@(8),%a0 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; 4855c: 2268 0086 moveal %a0@(134),%a1 void _Scheduler_CBS_Release_job( Thread_Control *the_thread, uint32_t deadline ) { 48560: 202e 000c movel %fp@(12),%d0 Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; Scheduler_CBS_Server *serv_info = 48564: 2269 0018 moveal %a1@(24),%a1 (Scheduler_CBS_Server *) sched_info->cbs_server; if (deadline) { 48568: 6722 beqs 4858c <_Scheduler_CBS_Release_job+0x38> /* Initializing or shifting deadline. */ if (serv_info) 4856a: 4a89 tstl %a1 4856c: 6710 beqs 4857e <_Scheduler_CBS_Release_job+0x2a> new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 4856e: 2039 0006 0574 movel 60574 <_Watchdog_Ticks_since_boot>,%d0 48574: d0a9 0004 addl %a1@(4),%d0 48578: 0880 001f bclr #31,%d0 4857c: 6016 bras 48594 <_Scheduler_CBS_Release_job+0x40> & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 4857e: 2239 0006 0574 movel 60574 <_Watchdog_Ticks_since_boot>,%d1 48584: d081 addl %d1,%d0 48586: 0880 001f bclr #31,%d0 4858a: 600e bras 4859a <_Scheduler_CBS_Release_job+0x46> & ~SCHEDULER_EDF_PRIO_MSB; } else { /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; 4858c: 2028 00a8 movel %a0@(168),%d0 } /* Budget replenishment for the next job. */ if (serv_info) 48590: 4a89 tstl %a1 48592: 6706 beqs 4859a <_Scheduler_CBS_Release_job+0x46><== NEVER TAKEN the_thread->cpu_time_budget = serv_info->parameters.budget; 48594: 2169 0008 0072 movel %a1@(8),%a0@(114) the_thread->real_priority = new_priority; 4859a: 2140 0018 movel %d0,%a0@(24) _Thread_Change_priority(the_thread, new_priority, true); 4859e: 4878 0001 pea 1 485a2: 2f00 movel %d0,%sp@- 485a4: 2f08 movel %a0,%sp@- 485a6: 4eb9 0004 89c0 jsr 489c0 <_Thread_Change_priority> 485ac: 4fef 000c lea %sp@(12),%sp } 485b0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000485b4 <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { 485b4: 4e56 0000 linkw %fp,#0 485b8: 2f0a movel %a2,%sp@- 485ba: 246e 0008 moveal %fp@(8),%a2 485be: 2f02 movel %d2,%sp@- Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server *serv_info; Priority_Control new_priority; _Scheduler_EDF_Enqueue(the_thread); 485c0: 2f0a movel %a2,%sp@- 485c2: 4eb9 0004 86b4 jsr 486b4 <_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; 485c8: 206a 0086 moveal %a2@(134),%a0 * 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) { 485cc: 588f addql #4,%sp _Scheduler_EDF_Enqueue(the_thread); /* TODO: flash critical section? */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 485ce: 2068 0018 moveal %a0@(24),%a0 * 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) { 485d2: 4a88 tstl %a0 485d4: 674c beqs 48622 <_Scheduler_CBS_Unblock+0x6e> 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 - 485d6: 222a 0018 movel %a2@(24),%d1 485da: 2401 movel %d1,%d2 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 485dc: 43e8 0004 lea %a0@(4),%a1 */ 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 - 485e0: 2039 0006 0574 movel 60574 <_Watchdog_Ticks_since_boot>,%d0 485e6: 9480 subl %d0,%d2 485e8: 2002 movel %d2,%d0 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 485ea: 4c11 0800 mulsl %a1@,%d0 485ee: 43ea 0072 lea %a2@(114),%a1 485f2: 2428 0008 movel %a0@(8),%d2 485f6: 4c11 2800 mulsl %a1@,%d2 485fa: b480 cmpl %d0,%d2 485fc: 6c24 bges 48622 <_Scheduler_CBS_Unblock+0x6e> /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 485fe: 202a 00a8 movel %a2@(168),%d0 if ( the_thread->real_priority != new_priority ) 48602: b081 cmpl %d1,%d0 48604: 6704 beqs 4860a <_Scheduler_CBS_Unblock+0x56> the_thread->real_priority = new_priority; 48606: 2540 0018 movel %d0,%a2@(24) if ( the_thread->current_priority != new_priority ) 4860a: b0aa 0014 cmpl %a2@(20),%d0 4860e: 6712 beqs 48622 <_Scheduler_CBS_Unblock+0x6e> _Thread_Change_priority(the_thread, new_priority, true); 48610: 4878 0001 pea 1 48614: 2f00 movel %d0,%sp@- 48616: 2f0a movel %a2,%sp@- 48618: 4eb9 0004 89c0 jsr 489c0 <_Thread_Change_priority> 4861e: 4fef 000c lea %sp@(12),%sp * 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, 48622: 2079 0006 08da moveal 608da <_Per_CPU_Information+0x12>,%a0 48628: 2f28 0014 movel %a0@(20),%sp@- 4862c: 2f2a 0014 movel %a2@(20),%sp@- 48630: 2079 0005 ebe0 moveal 5ebe0 <_Scheduler+0x30>,%a0 48636: 4e90 jsr %a0@ 48638: 508f addql #8,%sp 4863a: 4a80 tstl %d0 4863c: 6f20 bles 4865e <_Scheduler_CBS_Unblock+0xaa> _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4863e: 2079 0006 08d6 moveal 608d6 <_Per_CPU_Information+0xe>,%a0 * 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; 48644: 23ca 0006 08da movel %a2,608da <_Per_CPU_Information+0x12> if ( _Thread_Executing->is_preemptible || 4864a: 4a28 0070 tstb %a0@(112) 4864e: 6606 bnes 48656 <_Scheduler_CBS_Unblock+0xa2> 48650: 4aaa 0014 tstl %a2@(20) 48654: 6608 bnes 4865e <_Scheduler_CBS_Unblock+0xaa> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 48656: 7001 moveq #1,%d0 48658: 13c0 0006 08d4 moveb %d0,608d4 <_Per_CPU_Information+0xc> } } 4865e: 242e fff8 movel %fp@(-8),%d2 48662: 246e fffc moveal %fp@(-4),%a2 48666: 4e5e unlk %fp ... =============================================================================== 00048520 <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 48520: 4e56 0000 linkw %fp,#0 48524: 2f0a movel %a2,%sp@- void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 48526: 4878 0018 pea 18 #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 4852a: 246e 0008 moveal %fp@(8),%a2 void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 4852e: 4eb9 0004 9bc4 jsr 49bc4 <_Workspace_Allocate> if ( sched ) { 48534: 588f addql #4,%sp 48536: 4a80 tstl %d0 48538: 670e beqs 48548 <_Scheduler_EDF_Allocate+0x28> <== NEVER TAKEN the_thread->scheduler_info = sched; 4853a: 2540 0086 movel %d0,%a2@(134) schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 4853e: 2040 moveal %d0,%a0 schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 48540: 7202 moveq #2,%d1 sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); if ( sched ) { the_thread->scheduler_info = sched; schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 48542: 208a movel %a2,%a0@ schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 48544: 2141 0014 movel %d1,%a0@(20) } return sched; } 48548: 246e fffc moveal %fp@(-4),%a2 4854c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048710 <_Scheduler_EDF_Free>: #include void _Scheduler_EDF_Free( Thread_Control *the_thread ) { 48710: 4e56 0000 linkw %fp,#0 _Workspace_Free( the_thread->scheduler_info ); 48714: 206e 0008 moveal %fp@(8),%a0 48718: 2d68 0086 0008 movel %a0@(134),%fp@(8) } 4871e: 4e5e unlk %fp void _Scheduler_EDF_Free( Thread_Control *the_thread ) { _Workspace_Free( the_thread->scheduler_info ); 48720: 4ef9 0004 9c68 jmp 49c68 <_Workspace_Free> ... =============================================================================== 000486fc <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 486fc: 4e56 0000 linkw %fp,#0 48700: 2f0a movel %a2,%sp@- 48702: 246e 0008 moveal %fp@(8),%a2 _Scheduler_EDF_Enqueue(the_thread); 48706: 2f0a movel %a2,%sp@- 48708: 4eb9 0004 8598 jsr 48598 <_Scheduler_EDF_Enqueue> 4870e: 2f2a 0014 movel %a2@(20),%sp@- * 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( 48712: 2079 0006 084a moveal 6084a <_Per_CPU_Information+0x12>,%a0 48718: 2f28 0014 movel %a0@(20),%sp@- 4871c: 2079 0005 eb50 moveal 5eb50 <_Scheduler+0x30>,%a0 48722: 4e90 jsr %a0@ 48724: 4fef 000c lea %sp@(12),%sp 48728: 4a80 tstl %d0 4872a: 6c20 bges 4874c <_Scheduler_EDF_Unblock+0x50> _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4872c: 2079 0006 0846 moveal 60846 <_Per_CPU_Information+0xe>,%a0 * 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; 48732: 23ca 0006 084a movel %a2,6084a <_Per_CPU_Information+0x12> if ( _Thread_Executing->is_preemptible || 48738: 4a28 0070 tstb %a0@(112) 4873c: 6606 bnes 48744 <_Scheduler_EDF_Unblock+0x48> 4873e: 4aaa 0014 tstl %a2@(20) 48742: 6608 bnes 4874c <_Scheduler_EDF_Unblock+0x50> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 48744: 7001 moveq #1,%d0 48746: 13c0 0006 0844 moveb %d0,60844 <_Per_CPU_Information+0xc> } } 4874c: 246e fffc moveal %fp@(-4),%a2 48750: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047dac <_Scheduler_Handler_initialization>: #include #include #include void _Scheduler_Handler_initialization(void) { 47dac: 4e56 0000 linkw %fp,#0 (*_Scheduler.Operations.initialize)(); } 47db0: 4e5e unlk %fp #include #include void _Scheduler_Handler_initialization(void) { (*_Scheduler.Operations.initialize)(); 47db2: 2279 0005 d664 moveal 5d664 <_Scheduler+0x4>,%a1 47db8: 4ed1 jmp %a1@ ... =============================================================================== 00047f84 <_Scheduler_priority_Free>: #include void _Scheduler_priority_Free ( Thread_Control *the_thread ) { 47f84: 4e56 0000 linkw %fp,#0 _Workspace_Free( the_thread->scheduler_info ); 47f88: 206e 0008 moveal %fp@(8),%a0 47f8c: 2d68 0086 0008 movel %a0@(134),%fp@(8) } 47f92: 4e5e unlk %fp void _Scheduler_priority_Free ( Thread_Control *the_thread ) { _Workspace_Free( the_thread->scheduler_info ); 47f94: 4ef9 0004 94d4 jmp 494d4 <_Workspace_Free> ... =============================================================================== 00048080 <_Scheduler_priority_Tick>: #include #include void _Scheduler_priority_Tick( void ) { 48080: 4e56 0000 linkw %fp,#0 48084: 2f0a movel %a2,%sp@- Thread_Control *executing; executing = _Thread_Executing; 48086: 2479 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a2 /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 4808c: 4a2a 0070 tstb %a2@(112) 48090: 6758 beqs 480ea <_Scheduler_priority_Tick+0x6a> return; if ( !_States_Is_ready( executing->current_state ) ) 48092: 4aaa 0010 tstl %a2@(16) 48096: 6652 bnes 480ea <_Scheduler_priority_Tick+0x6a> /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 48098: 202a 0076 movel %a2@(118),%d0 4809c: 7201 moveq #1,%d1 4809e: b280 cmpl %d0,%d1 480a0: 6248 bhis 480ea <_Scheduler_priority_Tick+0x6a> 480a2: 123c 0002 moveb #2,%d1 480a6: b280 cmpl %d0,%d1 480a8: 640a bccs 480b4 <_Scheduler_priority_Tick+0x34> 480aa: 123c 0003 moveb #3,%d1 480ae: b280 cmpl %d0,%d1 480b0: 6638 bnes 480ea <_Scheduler_priority_Tick+0x6a> <== NEVER TAKEN 480b2: 6020 bras 480d4 <_Scheduler_priority_Tick+0x54> 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 ) { 480b4: 202a 0072 movel %a2@(114),%d0 480b8: 5380 subql #1,%d0 480ba: 2540 0072 movel %d0,%a2@(114) 480be: 6e2a bgts 480ea <_Scheduler_priority_Tick+0x6a> * always operates on the scheduler that 'owns' the currently executing * thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void ) { _Scheduler.Operations.yield(); 480c0: 2079 0005 d66c moveal 5d66c <_Scheduler+0xc>,%a0 480c6: 4e90 jsr %a0@ * 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; 480c8: 41f9 0005 ee8e lea 5ee8e <_Thread_Ticks_per_timeslice>,%a0 480ce: 2550 0072 movel %a0@,%a2@(114) 480d2: 6016 bras 480ea <_Scheduler_priority_Tick+0x6a> } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 480d4: 202a 0072 movel %a2@(114),%d0 480d8: 5380 subql #1,%d0 480da: 2540 0072 movel %d0,%a2@(114) 480de: 660a bnes 480ea <_Scheduler_priority_Tick+0x6a> (*executing->budget_callout)( executing ); 480e0: 2f0a movel %a2,%sp@- 480e2: 206a 007a moveal %a2@(122),%a0 480e6: 4e90 jsr %a0@ 480e8: 588f addql #4,%sp break; #endif } } 480ea: 246e fffc moveal %fp@(-4),%a2 480ee: 4e5e unlk %fp ... =============================================================================== 00048300 <_TOD_Set_with_timestamp>: #include void _TOD_Set_with_timestamp( const Timestamp_Control *tod ) { 48300: 4e56 ffec linkw %fp,#-20 48304: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 48308: 246e 0008 moveal %fp@(8),%a2 static inline uint32_t _Timestamp64_implementation_Get_seconds( const Timestamp64_Control *_time ) { return (uint32_t) (*_time / 1000000000L); 4830c: 47f9 0005 b0a8 lea 5b0a8 <__divdi3>,%a3 _TOD.seconds_trigger = nanoseconds; _TOD.is_set = true; _TOD_Activate(); _Thread_Enable_dispatch(); } 48312: 2412 movel %a2@,%d2 48314: 262a 0004 movel %a2@(4),%d3 static inline uint32_t _Timestamp64_implementation_Get_nanoseconds( const Timestamp64_Control *_time ) { return (uint32_t) (*_time % 1000000000L); 48318: 2f3c 3b9a ca00 movel #1000000000,%sp@- 4831e: 42a7 clrl %sp@- 48320: 2f03 movel %d3,%sp@- 48322: 2f02 movel %d2,%sp@- 48324: 4eb9 0005 b508 jsr 5b508 <__moddi3> 4832a: 4fef 0010 lea %sp@(16),%sp 4832e: 2801 movel %d1,%d4 static inline uint32_t _Timestamp64_implementation_Get_seconds( const Timestamp64_Control *_time ) { return (uint32_t) (*_time / 1000000000L); 48330: 2f3c 3b9a ca00 movel #1000000000,%sp@- 48336: 42a7 clrl %sp@- 48338: 2f03 movel %d3,%sp@- 4833a: 2f02 movel %d2,%sp@- 4833c: 4e93 jsr %a3@ * * 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; 4833e: 2039 0006 1316 movel 61316 <_Thread_Dispatch_disable_level>,%d0 ++level; 48344: 5280 addql #1,%d0 48346: 4fef 0010 lea %sp@(16),%sp 4834a: 2401 movel %d1,%d2 _Thread_Dispatch_disable_level = level; 4834c: 23c0 0006 1316 movel %d0,61316 <_Thread_Dispatch_disable_level> 48352: 2f3c 3b9a ca00 movel #1000000000,%sp@- 48358: 42a7 clrl %sp@- 4835a: 2f39 0006 12bc movel 612bc <_TOD+0x4>,%sp@- 48360: 2f39 0006 12b8 movel 612b8 <_TOD>,%sp@- 48366: 4e93 jsr %a3@ 48368: 4fef 0010 lea %sp@(16),%sp _Thread_Disable_dispatch(); _TOD_Deactivate(); seconds_now = _TOD_Seconds_since_epoch(); if ( seconds_next < seconds_now ) 4836c: b282 cmpl %d2,%d1 4836e: 630a blss 4837a <_TOD_Set_with_timestamp+0x7a> Watchdog_Adjust_directions direction, Watchdog_Interval units ) { _Watchdog_Adjust( &_Watchdog_Seconds_chain, direction, units ); 48370: 9282 subl %d2,%d1 48372: 2f01 movel %d1,%sp@- 48374: 4878 0001 pea 1 48378: 6006 bras 48380 <_TOD_Set_with_timestamp+0x80> 4837a: 9481 subl %d1,%d2 4837c: 2f02 movel %d2,%sp@- 4837e: 42a7 clrl %sp@- 48380: 4879 0006 13a6 pea 613a6 <_Watchdog_Seconds_chain> 48386: 4eb9 0004 a584 jsr 4a584 <_Watchdog_Adjust> 4838c: 4fef 000c lea %sp@(12),%sp _Watchdog_Adjust_seconds( WATCHDOG_BACKWARD, seconds_now - seconds_next ); else _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, seconds_next - seconds_now ); _TOD.now = *tod; 48390: 2012 movel %a2@,%d0 48392: 222a 0004 movel %a2@(4),%d1 _TOD.seconds_trigger = nanoseconds; 48396: 23c4 0006 12c8 movel %d4,612c8 <_TOD+0x10> if ( seconds_next < seconds_now ) _Watchdog_Adjust_seconds( WATCHDOG_BACKWARD, seconds_now - seconds_next ); else _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, seconds_next - seconds_now ); _TOD.now = *tod; 4839c: 23c0 0006 12b8 movel %d0,612b8 <_TOD> 483a2: 23c1 0006 12bc movel %d1,612bc <_TOD+0x4> _TOD.seconds_trigger = nanoseconds; _TOD.is_set = true; _TOD_Activate(); _Thread_Enable_dispatch(); } 483a8: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 else _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, seconds_next - seconds_now ); _TOD.now = *tod; _TOD.seconds_trigger = nanoseconds; _TOD.is_set = true; 483ae: 7201 moveq #1,%d1 _TOD_Activate(); _Thread_Enable_dispatch(); } 483b0: 4e5e unlk %fp else _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, seconds_next - seconds_now ); _TOD.now = *tod; _TOD.seconds_trigger = nanoseconds; _TOD.is_set = true; 483b2: 13c1 0006 12cc moveb %d1,612cc <_TOD+0x14> _TOD_Activate(); _Thread_Enable_dispatch(); 483b8: 4ef9 0004 99dc jmp 499dc <_Thread_Enable_dispatch> ... =============================================================================== 00046c1c <_TOD_Validate>: ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 46c1c: 43f9 0005 d33e lea 5d33e ,%a1 }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 46c22: 4e56 0000 linkw %fp,#0 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 46c26: 203c 000f 4240 movel #1000000,%d0 }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 46c2c: 2f03 movel %d3,%sp@- 46c2e: 206e 0008 moveal %fp@(8),%a0 46c32: 2f02 movel %d2,%sp@- uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 46c34: 4c51 0000 remul %a1@,%d0,%d0 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 46c38: 4a88 tstl %a0 46c3a: 6758 beqs 46c94 <_TOD_Validate+0x78> <== NEVER TAKEN 46c3c: b0a8 0018 cmpl %a0@(24),%d0 46c40: 6352 blss 46c94 <_TOD_Validate+0x78> (the_tod->ticks >= ticks_per_second) || 46c42: 703b moveq #59,%d0 46c44: b0a8 0014 cmpl %a0@(20),%d0 46c48: 654a bcss 46c94 <_TOD_Validate+0x78> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 46c4a: b0a8 0010 cmpl %a0@(16),%d0 46c4e: 6544 bcss 46c94 <_TOD_Validate+0x78> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 46c50: 7217 moveq #23,%d1 46c52: b2a8 000c cmpl %a0@(12),%d1 46c56: 653c bcss 46c94 <_TOD_Validate+0x78> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 46c58: 2028 0004 movel %a0@(4),%d0 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) || 46c5c: 6736 beqs 46c94 <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->month == 0) || 46c5e: 760c moveq #12,%d3 46c60: b680 cmpl %d0,%d3 46c62: 6530 bcss 46c94 <_TOD_Validate+0x78> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 46c64: 2410 movel %a0@,%d2 (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) || 46c66: 0c82 0000 07c3 cmpil #1987,%d2 46c6c: 6326 blss 46c94 <_TOD_Validate+0x78> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 46c6e: 2228 0008 movel %a0@(8),%d1 (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) || 46c72: 6720 beqs 46c94 <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 46c74: 163c 0003 moveb #3,%d3 46c78: 41f9 0005 e6c8 lea 5e6c8 <_TOD_Days_per_month>,%a0 46c7e: c483 andl %d3,%d2 46c80: 6606 bnes 46c88 <_TOD_Validate+0x6c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 46c82: 2030 0c34 movel %a0@(00000034,%d0:l:4),%d0 46c86: 6004 bras 46c8c <_TOD_Validate+0x70> else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 46c88: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 if ( the_tod->day > days_in_month ) 46c8c: b081 cmpl %d1,%d0 46c8e: 54c0 scc %d0 46c90: 4480 negl %d0 46c92: 6002 bras 46c96 <_TOD_Validate+0x7a> (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; 46c94: 4200 clrb %d0 if ( the_tod->day > days_in_month ) return false; return true; } 46c96: 241f movel %sp@+,%d2 46c98: 261f movel %sp@+,%d3 46c9a: 4e5e unlk %fp ... =============================================================================== 000482ac <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 482ac: 4e56 fff0 linkw %fp,#-16 482b0: 48d7 041c moveml %d2-%d4/%a2,%sp@ 482b4: 246e 0008 moveal %fp@(8),%a2 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 482b8: 282a 0010 movel %a2@(16),%d4 void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 482bc: 242e 000c movel %fp@(12),%d2 /* * 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 ); 482c0: 2f0a movel %a2,%sp@- void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 482c2: 162e 0013 moveb %fp@(19),%d3 /* * 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 ); 482c6: 4eb9 0004 8ec8 jsr 48ec8 <_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 ) 482cc: 588f addql #4,%sp 482ce: b4aa 0014 cmpl %a2@(20),%d2 482d2: 670c beqs 482e0 <_Thread_Change_priority+0x34> _Thread_Set_priority( the_thread, new_priority ); 482d4: 2f02 movel %d2,%sp@- 482d6: 2f0a movel %a2,%sp@- 482d8: 4eb9 0004 8e6c jsr 48e6c <_Thread_Set_priority> 482de: 508f addql #8,%sp _ISR_Disable( level ); 482e0: 203c 0000 0700 movel #1792,%d0 482e6: 40c2 movew %sr,%d2 482e8: 8082 orl %d2,%d0 482ea: 46c0 movew %d0,%sr 482ec: 7204 moveq #4,%d1 /* * 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; 482ee: 202a 0010 movel %a2@(16),%d0 482f2: c284 andl %d4,%d1 if ( state != STATES_TRANSIENT ) { 482f4: 7804 moveq #4,%d4 482f6: b880 cmpl %d0,%d4 482f8: 672e beqs 48328 <_Thread_Change_priority+0x7c> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 482fa: 4a81 tstl %d1 482fc: 6608 bnes 48306 <_Thread_Change_priority+0x5a> <== NEVER TAKEN RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 482fe: 72fb moveq #-5,%d1 48300: c280 andl %d0,%d1 48302: 2541 0010 movel %d1,%a2@(16) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 48306: 46c2 movew %d2,%sr */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 48308: 0280 0003 bee0 andil #245472,%d0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 4830e: 676c beqs 4837c <_Thread_Change_priority+0xd0> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 48310: 2d4a 000c movel %a2,%fp@(12) 48314: 2d6a 0044 0008 movel %a2@(68),%fp@(8) if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; _ISR_Enable( level ); } 4831a: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 48320: 4e5e unlk %fp /* 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 ); 48322: 4ef9 0004 8dd0 jmp 48dd0 <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 48328: 4a81 tstl %d1 4832a: 661e bnes 4834a <_Thread_Change_priority+0x9e> <== NEVER TAKEN * 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 ); 4832c: 42aa 0010 clrl %a2@(16) if ( prepend_it ) 48330: 4a03 tstb %d3 48332: 670a beqs 4833e <_Thread_Change_priority+0x92> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 48334: 2f0a movel %a2,%sp@- 48336: 2079 0005 d688 moveal 5d688 <_Scheduler+0x28>,%a0 4833c: 6008 bras 48346 <_Thread_Change_priority+0x9a> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 4833e: 2079 0005 d684 moveal 5d684 <_Scheduler+0x24>,%a0 48344: 2f0a movel %a2,%sp@- 48346: 4e90 jsr %a0@ 48348: 588f addql #4,%sp _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 4834a: 203c 0000 0700 movel #1792,%d0 48350: 46c2 movew %d2,%sr 48352: 8082 orl %d2,%d0 48354: 46c0 movew %d0,%sr * 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(); 48356: 2079 0005 d668 moveal 5d668 <_Scheduler+0x8>,%a0 4835c: 4e90 jsr %a0@ * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 4835e: 2079 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a0 * 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() && 48364: b1f9 0005 f322 cmpal 5f322 <_Per_CPU_Information+0x12>,%a0 4836a: 670e beqs 4837a <_Thread_Change_priority+0xce> 4836c: 4a28 0070 tstb %a0@(112) 48370: 6708 beqs 4837a <_Thread_Change_priority+0xce> _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 48372: 7801 moveq #1,%d4 48374: 13c4 0005 f31c moveb %d4,5f31c <_Per_CPU_Information+0xc> _ISR_Enable( level ); 4837a: 46c2 movew %d2,%sr } 4837c: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 48382: 4e5e unlk %fp ... =============================================================================== 00048554 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 48554: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 48558: 486e fffc pea %fp@(-4) 4855c: 2f2e 0008 movel %fp@(8),%sp@- 48560: 4eb9 0004 871c jsr 4871c <_Thread_Get> switch ( location ) { 48566: 508f addql #8,%sp 48568: 4aae fffc tstl %fp@(-4) 4856c: 661e bnes 4858c <_Thread_Delay_ended+0x38> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 4856e: 2f3c 1000 0018 movel #268435480,%sp@- 48574: 2f00 movel %d0,%sp@- 48576: 4eb9 0004 8388 jsr 48388 <_Thread_Clear_state> 4857c: 508f addql #8,%sp * * 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; 4857e: 2039 0005 eed6 movel 5eed6 <_Thread_Dispatch_disable_level>,%d0 --level; 48584: 5380 subql #1,%d0 _Thread_Dispatch_disable_level = level; 48586: 23c0 0005 eed6 movel %d0,5eed6 <_Thread_Dispatch_disable_level> | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 4858c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048590 <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { 48590: 4e56 ffd0 linkw %fp,#-48 48594: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); 48598: 283c 0000 0700 movel #1792,%d4 4859e: 2204 movel %d4,%d1 #endif /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; 485a0: 2479 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a2 _ISR_Disable( level ); 485a6: 40c0 movew %sr,%d0 485a8: 8280 orl %d0,%d1 485aa: 46c1 movew %d1,%sr _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 485ac: 240e movel %fp,%d2 485ae: 5182 subql #8,%d2 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 485b0: 2a3c 0004 7124 movel #291108,%d5 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 485b6: 49f9 0004 9524 lea 49524 <_CPU_Context_switch>,%a4 #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); _Context_Restore_fp( &executing->fp_context ); 485bc: 4bf9 0004 968c lea 4968c <_CPU_Context_restore_fp>,%a5 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 485c2: 263c 0004 966a movel #300650,%d3 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 485c8: 6000 0104 braw 486ce <_Thread_Dispatch+0x13e> * 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; 485cc: 7201 moveq #1,%d1 heir = _Thread_Heir; #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 485ce: 4206 clrb %d6 * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { heir = _Thread_Heir; 485d0: 2679 0005 f322 moveal 5f322 <_Per_CPU_Information+0x12>,%a3 485d6: 23c1 0005 eed6 movel %d1,5eed6 <_Thread_Dispatch_disable_level> #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 485dc: 13c6 0005 f31c moveb %d6,5f31c <_Per_CPU_Information+0xc> _Thread_Executing = heir; 485e2: 23cb 0005 f31e movel %a3,5f31e <_Per_CPU_Information+0xe> /* * 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 ) 485e8: b5cb cmpal %a3,%a2 485ea: 6612 bnes 485fe <_Thread_Dispatch+0x6e> 485ec: 42b9 0005 eed6 clrl 5eed6 <_Thread_Dispatch_disable_level> post_switch: #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 0 ); #endif _ISR_Enable( level ); 485f2: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 485f4: 2679 0005 ef4a moveal 5ef4a <_API_extensions_Post_switch_list>,%a3 485fa: 6000 00ec braw 486e8 <_Thread_Dispatch+0x158> */ #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 ) 485fe: 7201 moveq #1,%d1 48600: b2ab 0076 cmpl %a3@(118),%d1 48604: 660a bnes 48610 <_Thread_Dispatch+0x80> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 48606: 41f9 0005 ee8e lea 5ee8e <_Thread_Ticks_per_timeslice>,%a0 4860c: 2750 0072 movel %a0@,%a3@(114) _ISR_Enable( level ); 48610: 46c0 movew %d0,%sr 48612: 4879 0005 ee80 pea 5ee80 <_TOD+0x8> 48618: 2245 moveal %d5,%a1 4861a: 2f02 movel %d2,%sp@- 4861c: 4e91 jsr %a1@ #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 4861e: 508f addql #8,%sp #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 48620: 206e fff8 moveal %fp@(-8),%a0 48624: 226e fffc moveal %fp@(-4),%a1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 48628: 2008 movel %a0,%d0 4862a: 2209 movel %a1,%d1 4862c: 2c39 0005 f32a movel 5f32a <_Per_CPU_Information+0x1a>,%d6 48632: 92b9 0005 f32e subl 5f32e <_Per_CPU_Information+0x1e>,%d1 48638: 9186 subxl %d6,%d0 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 4863a: d3aa 0082 addl %d1,%a2@(130) 4863e: 2c2a 007e movel %a2@(126),%d6 48642: dd80 addxl %d0,%d6 48644: 2546 007e movel %d6,%a2@(126) &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 48648: 23c8 0005 f32a movel %a0,5f32a <_Per_CPU_Information+0x1a> 4864e: 23c9 0005 f32e movel %a1,5f32e <_Per_CPU_Information+0x1e> #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 48654: 2079 0005 ef46 moveal 5ef46 <_Thread_libc_reent>,%a0 4865a: 4a88 tstl %a0 4865c: 6708 beqs 48666 <_Thread_Dispatch+0xd6> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 4865e: 2550 00f6 movel %a0@,%a2@(246) *_Thread_libc_reent = heir->libc_reent; 48662: 20ab 00f6 movel %a3@(246),%a0@ 48666: 2c39 0005 d788 movel 5d788 <_User_extensions_Switches_list>,%d6 4866c: 6012 bras 48680 <_Thread_Dispatch+0xf0> while ( node != tail ) { const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); 4866e: 2f0b movel %a3,%sp@- 48670: 2246 moveal %d6,%a1 48672: 2f0a movel %a2,%sp@- 48674: 2069 0008 moveal %a1@(8),%a0 48678: 4e90 jsr %a0@ #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 4867a: 508f addql #8,%sp 4867c: 2046 moveal %d6,%a0 4867e: 2c10 movel %a0@,%d6 { 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 ) { 48680: 0c86 0005 d78c cmpil #382860,%d6 48686: 66e6 bnes 4866e <_Thread_Dispatch+0xde> if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 48688: 486b 00be pea %a3@(190) 4868c: 486a 00be pea %a2@(190) 48690: 4e94 jsr %a4@ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 48692: 508f addql #8,%sp 48694: 4aaa 00f2 tstl %a2@(242) 48698: 6726 beqs 486c0 <_Thread_Dispatch+0x130> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Allocated_fp ); 4869a: 2079 0005 ef42 moveal 5ef42 <_Thread_Allocated_fp>,%a0 486a0: b1ca cmpal %a2,%a0 486a2: 671c beqs 486c0 <_Thread_Dispatch+0x130> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 486a4: 4a88 tstl %a0 486a6: 670a beqs 486b2 <_Thread_Dispatch+0x122> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 486a8: 4868 00f2 pea %a0@(242) 486ac: 2243 moveal %d3,%a1 486ae: 4e91 jsr %a1@ 486b0: 588f addql #4,%sp _Context_Restore_fp( &executing->fp_context ); 486b2: 486a 00f2 pea %a2@(242) 486b6: 4e95 jsr %a5@ _Thread_Allocated_fp = executing; 486b8: 588f addql #4,%sp 486ba: 23ca 0005 ef42 movel %a2,5ef42 <_Thread_Allocated_fp> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 486c0: 2479 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a2 _ISR_Disable( level ); 486c6: 2204 movel %d4,%d1 486c8: 40c0 movew %sr,%d0 486ca: 8280 orl %d0,%d1 486cc: 46c1 movew %d1,%sr /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 486ce: 1239 0005 f31c moveb 5f31c <_Per_CPU_Information+0xc>,%d1 486d4: 6600 fef6 bnew 485cc <_Thread_Dispatch+0x3c> 486d8: 6000 ff12 braw 485ec <_Thread_Dispatch+0x5c> while ( node != tail ) { const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); 486dc: 2f0a movel %a2,%sp@- 486de: 206b 0008 moveal %a3@(8),%a0 486e2: 4e90 jsr %a0@ #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 486e4: 2653 moveal %a3@,%a3 486e6: 588f addql #4,%sp { 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 ) { 486e8: b7fc 0005 ef4e cmpal #388942,%a3 486ee: 66ec bnes 486dc <_Thread_Dispatch+0x14c> 486f0: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5 486f6: 4e5e unlk %fp ... =============================================================================== 0004cda4 <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { 4cda4: 4e56 0000 linkw %fp,#0 4cda8: 2f0a movel %a2,%sp@- #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 4cdaa: 2479 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a2 #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { 4cdb0: 2f02 movel %d2,%sp@- /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 4cdb2: 222a 00a4 movel %a2@(164),%d1 _ISR_Set_level(level); 4cdb6: 40c0 movew %sr,%d0 4cdb8: e189 lsll #8,%d1 4cdba: 0280 0000 f8ff andil #63743,%d0 4cdc0: 8081 orl %d1,%d0 4cdc2: 46c0 movew %d0,%sr && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; doneConstructors = true; 4cdc4: 7001 moveq #1,%d0 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; 4cdc6: 1439 0005 e6d4 moveb 5e6d4 ,%d2 doneConstructors = true; 4cdcc: 13c0 0005 e6d4 moveb %d0,5e6d4 #endif #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4cdd2: 4aaa 00f2 tstl %a2@(242) 4cdd6: 6720 beqs 4cdf8 <_Thread_Handler+0x54> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Allocated_fp ); 4cdd8: 2079 0005 ef42 moveal 5ef42 <_Thread_Allocated_fp>,%a0 4cdde: b1ca cmpal %a2,%a0 4cde0: 6716 beqs 4cdf8 <_Thread_Handler+0x54> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 4cde2: 4a88 tstl %a0 4cde4: 670c beqs 4cdf2 <_Thread_Handler+0x4e> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 4cde6: 4868 00f2 pea %a0@(242) 4cdea: 4eb9 0004 966a jsr 4966a <_CPU_Context_save_fp> 4cdf0: 588f addql #4,%sp _Thread_Allocated_fp = executing; 4cdf2: 23ca 0005 ef42 movel %a2,5ef42 <_Thread_Allocated_fp> ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( 4cdf8: 4879 0004 9096 pea 49096 <_User_extensions_Thread_begin_visitor> 4cdfe: 2f0a movel %a2,%sp@- 4ce00: 4eb9 0004 90f6 jsr 490f6 <_User_extensions_Iterate> _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4ce06: 4eb9 0004 86fc jsr 486fc <_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) */ { 4ce0c: 508f addql #8,%sp 4ce0e: 4a02 tstb %d2 4ce10: 6606 bnes 4ce18 <_Thread_Handler+0x74> INIT_NAME (); 4ce12: 4eb9 0005 b620 jsr 5b620 <_init> _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4ce18: 202a 008e movel %a2@(142),%d0 4ce1c: 6606 bnes 4ce24 <_Thread_Handler+0x80> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4ce1e: 2f2a 0096 movel %a2@(150),%sp@- 4ce22: 600a bras 4ce2e <_Thread_Handler+0x8a> executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 4ce24: 7201 moveq #1,%d1 4ce26: b280 cmpl %d0,%d1 4ce28: 6610 bnes 4ce3a <_Thread_Handler+0x96> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 4ce2a: 2f2a 0092 movel %a2@(146),%sp@- 4ce2e: 206a 008a moveal %a2@(138),%a0 4ce32: 4e90 jsr %a0@ executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 4ce34: 588f addql #4,%sp 4ce36: 2540 0028 movel %d0,%a2@(40) } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( 4ce3a: 4879 0004 90ae pea 490ae <_User_extensions_Thread_exitted_visitor> 4ce40: 2f0a movel %a2,%sp@- 4ce42: 4eb9 0004 90f6 jsr 490f6 <_User_extensions_Iterate> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( 4ce48: 4878 0005 pea 5 4ce4c: 4878 0001 pea 1 4ce50: 42a7 clrl %sp@- 4ce52: 4eb9 0004 7550 jsr 47550 <_Internal_error_Occurred> =============================================================================== 00048978 <_Thread_Handler_initialization>: #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { 48978: 4e56 0000 linkw %fp,#0 uint32_t ticks_per_timeslice = rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = rtems_configuration_get_maximum_extensions(); rtems_stack_allocate_init_hook stack_allocate_init_hook = 4897c: 2079 0005 b878 moveal 5b878 ,%a0 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 48982: 4ab9 0005 b87c tstl 5b87c 48988: 6708 beqs 48992 <_Thread_Handler_initialization+0x1a><== NEVER TAKEN 4898a: 4ab9 0005 b880 tstl 5b880 48990: 6610 bnes 489a2 <_Thread_Handler_initialization+0x2a> rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( 48992: 4878 000e pea e 48996: 4878 0001 pea 1 4899a: 42a7 clrl %sp@- 4899c: 4eb9 0004 7550 jsr 47550 <_Internal_error_Occurred> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 489a2: 4a88 tstl %a0 489a4: 670a beqs 489b0 <_Thread_Handler_initialization+0x38> (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 489a6: 2f39 0005 b858 movel 5b858 ,%sp@- 489ac: 4e90 jsr %a0@ 489ae: 588f addql #4,%sp #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 489b0: 4878 0008 pea 8 _Thread_Heir = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; 489b4: 41f9 0005 b85c lea 5b85c ,%a0 489ba: 23d0 0005 ef56 movel %a0@,5ef56 <_Thread_Maximum_extensions> _Thread_Ticks_per_timeslice = ticks_per_timeslice; 489c0: 41f9 0005 b868 lea 5b868 ,%a0 489c6: 23d0 0005 ee8e movel %a0@,5ee8e <_Thread_Ticks_per_timeslice> ); if ( stack_allocate_init_hook != NULL ) (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); _Thread_Dispatch_necessary = false; 489cc: 4200 clrb %d0 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 489ce: 42a7 clrl %sp@- 489d0: 4878 010a pea 10a 489d4: 4878 0001 pea 1 489d8: 4878 0001 pea 1 489dc: 4878 0001 pea 1 489e0: 4879 0005 efc4 pea 5efc4 <_Thread_Internal_information> ); if ( stack_allocate_init_hook != NULL ) (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); _Thread_Dispatch_necessary = false; 489e6: 13c0 0005 f31c moveb %d0,5f31c <_Per_CPU_Information+0xc> _Thread_Executing = NULL; 489ec: 42b9 0005 f31e clrl 5f31e <_Per_CPU_Information+0xe> _Thread_Heir = NULL; 489f2: 42b9 0005 f322 clrl 5f322 <_Per_CPU_Information+0x12> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; 489f8: 42b9 0005 ef42 clrl 5ef42 <_Thread_Allocated_fp> #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 489fe: 4eb9 0004 7aec jsr 47aec <_Objects_Initialize_information> 48a04: 4fef 001c lea %sp@(28),%sp false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } 48a08: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049468 <_Thread_Restart>: */ RTEMS_INLINE_ROUTINE bool _States_Is_dormant ( States_Control the_states ) { return (the_states & STATES_DORMANT); 49468: 7001 moveq #1,%d0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 4946a: 4e56 0000 linkw %fp,#0 4946e: 2f0a movel %a2,%sp@- 49470: 246e 0008 moveal %fp@(8),%a2 49474: c0aa 0010 andl %a2@(16),%d0 if ( !_States_Is_dormant( the_thread->current_state ) ) { 49478: 666e bnes 494e8 <_Thread_Restart+0x80> _Thread_Set_transient( the_thread ); 4947a: 2f0a movel %a2,%sp@- 4947c: 4eb9 0004 9550 jsr 49550 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 49482: 2f2e 0010 movel %fp@(16),%sp@- 49486: 2f2e 000c movel %fp@(12),%sp@- 4948a: 2f0a movel %a2,%sp@- 4948c: 4eb9 0004 c044 jsr 4c044 <_Thread_Reset> _Thread_Load_environment( the_thread ); 49492: 2f0a movel %a2,%sp@- 49494: 4eb9 0004 bd80 jsr 4bd80 <_Thread_Load_environment> _Thread_Ready( the_thread ); 4949a: 2f0a movel %a2,%sp@- 4949c: 4eb9 0004 c014 jsr 4c014 <_Thread_Ready> ); } static inline void _User_extensions_Thread_restart( Thread_Control *restarted ) { _User_extensions_Iterate( 494a2: 4879 0004 9706 pea 49706 <_User_extensions_Thread_restart_visitor> 494a8: 2f0a movel %a2,%sp@- 494aa: 4eb9 0004 977e jsr 4977e <_User_extensions_Iterate> _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) 494b0: 4fef 0020 lea %sp@(32),%sp _Thread_Restart_self(); return true; 494b4: 7001 moveq #1,%d0 _Thread_Ready( the_thread ); _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) 494b6: b5f9 0005 fbd6 cmpal 5fbd6 <_Per_CPU_Information+0xe>,%a2 494bc: 662c bnes 494ea <_Thread_Restart+0x82> */ RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void ) { #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( _Thread_Executing->fp_context != NULL ) 494be: 4aaa 00f2 tstl %a2@(242) 494c2: 670c beqs 494d0 <_Thread_Restart+0x68> _Context_Restore_fp( &_Thread_Executing->fp_context ); 494c4: 486a 00f2 pea %a2@(242) 494c8: 4eb9 0004 9d14 jsr 49d14 <_CPU_Context_restore_fp> 494ce: 588f addql #4,%sp #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 494d0: 2079 0005 fbd6 moveal 5fbd6 <_Per_CPU_Information+0xe>,%a0 494d6: 41e8 00be lea %a0@(190),%a0 494da: 2f08 movel %a0,%sp@- 494dc: 4eb9 0004 9bc2 jsr 49bc2 <_CPU_Context_Restart_self> 494e2: 588f addql #4,%sp <== NOT EXECUTED _Thread_Restart_self(); return true; 494e4: 7001 moveq #1,%d0 <== NOT EXECUTED 494e6: 6002 bras 494ea <_Thread_Restart+0x82> <== NOT EXECUTED } return false; 494e8: 4200 clrb %d0 } 494ea: 246e fffc moveal %fp@(-4),%a2 494ee: 4e5e unlk %fp ... =============================================================================== 00048f40 <_Thread_Stack_Free>: #include void _Thread_Stack_Free( Thread_Control *the_thread ) { 48f40: 4e56 0000 linkw %fp,#0 48f44: 206e 0008 moveal %fp@(8),%a0 #if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) /* * If the API provided the stack space, then don't free it. */ if ( !the_thread->Start.core_allocated_stack ) 48f48: 4a28 00ac tstb %a0@(172) 48f4c: 6710 beqs 48f5e <_Thread_Stack_Free+0x1e> <== NEVER TAKEN * Call ONLY the CPU table stack free hook, or the * the RTEMS workspace free. This is so the free * routine properly matches the allocation of the stack. */ (*stack_free_hook)( the_thread->Start.Initial_stack.area ); 48f4e: 2279 0005 b880 moveal 5b880 ,%a1 48f54: 2d68 00b2 0008 movel %a0@(178),%fp@(8) } 48f5a: 4e5e unlk %fp * Call ONLY the CPU table stack free hook, or the * the RTEMS workspace free. This is so the free * routine properly matches the allocation of the stack. */ (*stack_free_hook)( the_thread->Start.Initial_stack.area ); 48f5c: 4ed1 jmp %a1@ } 48f5e: 4e5e unlk %fp <== NOT EXECUTED ... =============================================================================== 0004825c <_Thread_blocking_operation_Cancel>: /* * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { 4825c: 7202 moveq #2,%d1 Thread_blocking_operation_States sync_state __attribute__((unused)), #endif Thread_Control *the_thread, ISR_Level level ) { 4825e: 4e56 0000 linkw %fp,#0 48262: 202e 0010 movel %fp@(16),%d0 48266: 2f0a movel %a2,%sp@- 48268: 246e 000c moveal %fp@(12),%a2 #endif /* * The thread is not waiting on anything after this completes. */ the_thread->Wait.queue = NULL; 4826c: 42aa 0044 clrl %a2@(68) /* * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { 48270: b2aa 0050 cmpl %a2@(80),%d1 48274: 6618 bnes 4828e <_Thread_blocking_operation_Cancel+0x32> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 48276: 123c 0003 moveb #3,%d1 4827a: 2541 0050 movel %d1,%a2@(80) _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4827e: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 48280: 486a 0048 pea %a2@(72) 48284: 4eb9 0004 92f8 jsr 492f8 <_Watchdog_Remove> 4828a: 588f addql #4,%sp 4828c: 6002 bras 48290 <_Thread_blocking_operation_Cancel+0x34> } else _ISR_Enable( level ); 4828e: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 48290: 2d4a 0008 movel %a2,%fp@(8) #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 48294: 246e fffc moveal %fp@(-4),%a2 48298: 203c 1007 fff8 movel #268959736,%d0 4829e: 2d40 000c movel %d0,%fp@(12) 482a2: 4e5e unlk %fp 482a4: 4ef9 0004 8388 jmp 48388 <_Thread_Clear_state> ... =============================================================================== 0004b948 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 4b948: 4e56 0000 linkw %fp,#0 4b94c: 226e 0008 moveal %fp@(8),%a1 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 4b950: 2069 0044 moveal %a1@(68),%a0 * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && 4b954: 2028 0030 movel %a0@(48),%d0 4b958: 671c beqs 4b976 <_Thread_queue_Process_timeout+0x2e> 4b95a: b3f9 0005 f31e cmpal 5f31e <_Per_CPU_Information+0xe>,%a1 4b960: 6614 bnes 4b976 <_Thread_queue_Process_timeout+0x2e><== NEVER TAKEN _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 4b962: 7203 moveq #3,%d1 4b964: b280 cmpl %d0,%d1 4b966: 6720 beqs 4b988 <_Thread_queue_Process_timeout+0x40> the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4b968: 7002 moveq #2,%d0 */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 4b96a: 2368 003c 0034 movel %a0@(60),%a1@(52) the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4b970: 2140 0030 movel %d0,%a0@(48) 4b974: 6012 bras 4b988 <_Thread_queue_Process_timeout+0x40> } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 4b976: 2368 003c 0034 movel %a0@(60),%a1@(52) _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 4b97c: 2f09 movel %a1,%sp@- 4b97e: 2f08 movel %a0,%sp@- 4b980: 4eb9 0004 b844 jsr 4b844 <_Thread_queue_Extract> 4b986: 508f addql #8,%sp } } 4b988: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048dd0 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 48dd0: 4e56 fff0 linkw %fp,#-16 48dd4: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 48dd8: 246e 0008 moveal %fp@(8),%a2 48ddc: 266e 000c moveal %fp@(12),%a3 /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 48de0: 4a8a tstl %a2 48de2: 6746 beqs 48e2a <_Thread_queue_Requeue+0x5a> <== 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 ) { 48de4: 7001 moveq #1,%d0 48de6: b0aa 0034 cmpl %a2@(52),%d0 48dea: 663e bnes 48e2a <_Thread_queue_Requeue+0x5a> <== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 48dec: 303c 0700 movew #1792,%d0 48df0: 40c2 movew %sr,%d2 48df2: 8082 orl %d2,%d0 48df4: 46c0 movew %d0,%sr 48df6: 202b 0010 movel %a3@(16),%d0 48dfa: 0280 0003 bee0 andil #245472,%d0 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 48e00: 6726 beqs 48e28 <_Thread_queue_Requeue+0x58> <== 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; 48e02: 7001 moveq #1,%d0 48e04: 2540 0030 movel %d0,%a2@(48) _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 48e08: 4878 0001 pea 1 48e0c: 2f0b movel %a3,%sp@- 48e0e: 2f0a movel %a2,%sp@- 48e10: 4eb9 0004 b880 jsr 4b880 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 48e16: 486e fffc pea %fp@(-4) 48e1a: 2f0b movel %a3,%sp@- 48e1c: 2f0a movel %a2,%sp@- 48e1e: 4eb9 0004 8bdc jsr 48bdc <_Thread_queue_Enqueue_priority> 48e24: 4fef 0018 lea %sp@(24),%sp } _ISR_Enable( level ); 48e28: 46c2 movew %d2,%sr } } 48e2a: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 48e30: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048e34 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 48e34: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 48e38: 486e fffc pea %fp@(-4) 48e3c: 2f2e 0008 movel %fp@(8),%sp@- 48e40: 4eb9 0004 871c jsr 4871c <_Thread_Get> switch ( location ) { 48e46: 508f addql #8,%sp 48e48: 4aae fffc tstl %fp@(-4) 48e4c: 6618 bnes 48e66 <_Thread_queue_Timeout+0x32> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 48e4e: 2f00 movel %d0,%sp@- 48e50: 4eb9 0004 b948 jsr 4b948 <_Thread_queue_Process_timeout> RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; --level; _Thread_Dispatch_disable_level = level; 48e56: 588f addql #4,%sp * * 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; 48e58: 2039 0005 eed6 movel 5eed6 <_Thread_Dispatch_disable_level>,%d0 --level; 48e5e: 5380 subql #1,%d0 _Thread_Dispatch_disable_level = level; 48e60: 23c0 0005 eed6 movel %d0,5eed6 <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 48e66: 4e5e unlk %fp ... =============================================================================== 000526b8 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 526b8: 4e56 ffc0 linkw %fp,#-64 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 526bc: 200e movel %fp,%d0 526be: 220e movel %fp,%d1 526c0: 41ee ffec lea %fp@(-20),%a0 526c4: 5181 subql #8,%d1 526c6: 0680 ffff ffe8 addil #-24,%d0 526cc: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 526d0: 246e 0008 moveal %fp@(8),%a2 526d4: 240e movel %fp,%d2 526d6: 0682 ffff fff4 addil #-12,%d2 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 526dc: 280a movel %a2,%d4 /* * 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 ); 526de: 260a movel %a2,%d3 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 526e0: 0684 0000 0030 addil #48,%d4 /* * 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 ); 526e6: 0683 0000 0068 addil #104,%d3 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 526ec: 2c08 movel %a0,%d6 526ee: 2a01 movel %d1,%d5 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 526f0: 2d48 ffe8 movel %a0,%fp@(-24) head->previous = NULL; 526f4: 42ae ffec clrl %fp@(-20) tail->previous = head; 526f8: 2d40 fff0 movel %d0,%fp@(-16) ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 526fc: 2d41 fff4 movel %d1,%fp@(-12) head->previous = NULL; 52700: 42ae fff8 clrl %fp@(-8) tail->previous = head; 52704: 2d42 fffc movel %d2,%fp@(-4) { /* * 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; 52708: 41ee ffe8 lea %fp@(-24),%a0 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 5270c: 47f9 0005 649c lea 5649c <_Watchdog_Adjust_to_chain>,%a3 52712: 4bf9 0006 6f48 lea 66f48 <__divdi3>,%a5 { /* * 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; 52718: 2548 0078 movel %a0,%a2@(120) static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 5271c: 2039 0007 7560 movel 77560 <_Watchdog_Ticks_since_boot>,%d0 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 52722: 222a 003c movel %a2@(60),%d1 watchdogs->last_snapshot = snapshot; 52726: 2540 003c movel %d0,%a2@(60) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 5272a: 9081 subl %d1,%d0 5272c: 2f02 movel %d2,%sp@- 5272e: 2f00 movel %d0,%sp@- 52730: 2f04 movel %d4,%sp@- 52732: 4e93 jsr %a3@ 52734: 2f3c 3b9a ca00 movel #1000000000,%sp@- 5273a: 42a7 clrl %sp@- 5273c: 2f39 0007 7420 movel 77420 <_TOD+0x4>,%sp@- 52742: 2f39 0007 741c movel 7741c <_TOD>,%sp@- 52748: 4e95 jsr %a5@ Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 5274a: 202a 0074 movel %a2@(116),%d0 5274e: 2e01 movel %d1,%d7 /* * 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 ) { 52750: 4fef 001c lea %sp@(28),%sp 52754: b081 cmpl %d1,%d0 52756: 640c bccs 52764 <_Timer_server_Body+0xac> /* * 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 ); 52758: 2f02 movel %d2,%sp@- 5275a: 9280 subl %d0,%d1 5275c: 2f01 movel %d1,%sp@- 5275e: 2f03 movel %d3,%sp@- 52760: 4e93 jsr %a3@ 52762: 6014 bras 52778 <_Timer_server_Body+0xc0> } else if ( snapshot < last_snapshot ) { 52764: b081 cmpl %d1,%d0 52766: 6314 blss 5277c <_Timer_server_Body+0xc4> /* * 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 ); 52768: 9081 subl %d1,%d0 5276a: 2f00 movel %d0,%sp@- 5276c: 4878 0001 pea 1 52770: 2f03 movel %d3,%sp@- 52772: 4eb9 0005 641c jsr 5641c <_Watchdog_Adjust> 52778: 4fef 000c lea %sp@(12),%sp } watchdogs->last_snapshot = snapshot; 5277c: 2547 0074 movel %d7,%a2@(116) ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 52780: 49f9 0005 6520 lea 56520 <_Watchdog_Insert>,%a4 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 52786: 2e3c 0005 3220 movel #340512,%d7 5278c: 202a 0078 movel %a2@(120),%d0 52790: 2047 moveal %d7,%a0 52792: 2f00 movel %d0,%sp@- 52794: 4e90 jsr %a0@ if ( timer == NULL ) { 52796: 588f addql #4,%sp } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 52798: 2040 moveal %d0,%a0 if ( timer == NULL ) { 5279a: 4a80 tstl %d0 5279c: 6724 beqs 527c2 <_Timer_server_Body+0x10a> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 5279e: 2028 0038 movel %a0@(56),%d0 527a2: 7201 moveq #1,%d1 527a4: b280 cmpl %d0,%d1 527a6: 6608 bnes 527b0 <_Timer_server_Body+0xf8> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 527a8: 4868 0010 pea %a0@(16) 527ac: 2f04 movel %d4,%sp@- 527ae: 600c bras 527bc <_Timer_server_Body+0x104> } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 527b0: 7203 moveq #3,%d1 527b2: b280 cmpl %d0,%d1 527b4: 66d6 bnes 5278c <_Timer_server_Body+0xd4> <== NEVER TAKEN _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 527b6: 4868 0010 pea %a0@(16) 527ba: 2f03 movel %d3,%sp@- 527bc: 4e94 jsr %a4@ 527be: 508f addql #8,%sp 527c0: 60ca bras 5278c <_Timer_server_Body+0xd4> * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 527c2: 203c 0000 0700 movel #1792,%d0 527c8: 40c1 movew %sr,%d1 527ca: 8081 orl %d1,%d0 527cc: 46c0 movew %d0,%sr if ( _Chain_Is_empty( insert_chain ) ) { 527ce: bcae ffe8 cmpl %fp@(-24),%d6 527d2: 6614 bnes 527e8 <_Timer_server_Body+0x130> <== NEVER TAKEN ts->insert_chain = NULL; 527d4: 42aa 0078 clrl %a2@(120) _ISR_Enable( level ); 527d8: 46c1 movew %d1,%sr /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 527da: 2e3c 0000 0700 movel #1792,%d7 _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 ) ) { 527e0: baae fff4 cmpl %fp@(-12),%d5 527e4: 6608 bnes 527ee <_Timer_server_Body+0x136> 527e6: 603e bras 52826 <_Timer_server_Body+0x16e> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 527e8: 46c1 movew %d1,%sr <== NOT EXECUTED 527ea: 6000 ff30 braw 5271c <_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 ); 527ee: 2007 movel %d7,%d0 527f0: 40c1 movew %sr,%d1 527f2: 8081 orl %d1,%d0 527f4: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 527f6: 206e fff4 moveal %fp@(-12),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 527fa: ba88 cmpl %a0,%d5 527fc: 6722 beqs 52820 <_Timer_server_Body+0x168> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 527fe: 2250 moveal %a0@,%a1 head->next = new_first; new_first->previous = head; 52800: 2342 0004 movel %d2,%a1@(4) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 52804: 42a8 0008 clrl %a0@(8) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 52808: 2d49 fff4 movel %a1,%fp@(-12) _ISR_Enable( level ); 5280c: 46c1 movew %d1,%sr /* * 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 ); 5280e: 2f28 0024 movel %a0@(36),%sp@- 52812: 2f28 0020 movel %a0@(32),%sp@- 52816: 2068 001c moveal %a0@(28),%a0 5281a: 4e90 jsr %a0@ } 5281c: 508f addql #8,%sp 5281e: 60ce bras 527ee <_Timer_server_Body+0x136> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 52820: 46c1 movew %d1,%sr 52822: 6000 fee4 braw 52708 <_Timer_server_Body+0x50> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 52826: 4200 clrb %d0 52828: 1540 007c moveb %d0,%a2@(124) * * 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; 5282c: 2039 0007 747a movel 7747a <_Thread_Dispatch_disable_level>,%d0 ++level; 52832: 5280 addql #1,%d0 _Thread_Dispatch_disable_level = level; 52834: 23c0 0007 747a movel %d0,7747a <_Thread_Dispatch_disable_level> /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 5283a: 4878 0008 pea 8 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 5283e: 47f9 0005 6644 lea 56644 <_Watchdog_Remove>,%a3 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 52844: 2f12 movel %a2@,%sp@- 52846: 4eb9 0005 60cc jsr 560cc <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 5284c: 2f0a movel %a2,%sp@- 5284e: 4eba fda4 jsr %pc@(525f4 <_Timer_server_Reset_interval_system_watchdog>) _Timer_server_Reset_tod_system_watchdog( ts ); 52852: 2f0a movel %a2,%sp@- 52854: 4eba fdfe jsr %pc@(52654 <_Timer_server_Reset_tod_system_watchdog>) _Thread_Enable_dispatch(); 52858: 4eb9 0005 58b8 jsr 558b8 <_Thread_Enable_dispatch> ts->active = true; 5285e: 7201 moveq #1,%d1 52860: 1541 007c moveb %d1,%a2@(124) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 52864: 486a 0008 pea %a2@(8) 52868: 4e93 jsr %a3@ static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 5286a: 486a 0040 pea %a2@(64) 5286e: 4e93 jsr %a3@ 52870: 4fef 0018 lea %sp@(24),%sp 52874: 6000 fe92 braw 52708 <_Timer_server_Body+0x50> =============================================================================== 00052878 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 52878: 4e56 fff0 linkw %fp,#-16 5287c: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 52880: 246e 0008 moveal %fp@(8),%a2 52884: 266e 000c moveal %fp@(12),%a3 if ( ts->insert_chain == NULL ) { 52888: 202a 0078 movel %a2@(120),%d0 5288c: 6600 0112 bnew 529a0 <_Timer_server_Schedule_operation_method+0x128> * * 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; 52890: 2039 0007 747a movel 7747a <_Thread_Dispatch_disable_level>,%d0 ++level; 52896: 5280 addql #1,%d0 _Thread_Dispatch_disable_level = level; 52898: 23c0 0007 747a movel %d0,7747a <_Thread_Dispatch_disable_level> * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 5289e: 202b 0038 movel %a3@(56),%d0 528a2: 7201 moveq #1,%d1 528a4: b280 cmpl %d0,%d1 528a6: 6660 bnes 52908 <_Timer_server_Schedule_operation_method+0x90> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 528a8: 203c 0000 0700 movel #1792,%d0 528ae: 40c2 movew %sr,%d2 528b0: 8082 orl %d2,%d0 528b2: 46c0 movew %d0,%sr snapshot = _Watchdog_Ticks_since_boot; 528b4: 2039 0007 7560 movel 77560 <_Watchdog_Ticks_since_boot>,%d0 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 528ba: 43ea 0034 lea %a2@(52),%a1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 528be: 222a 003c movel %a2@(60),%d1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 528c2: 206a 0030 moveal %a2@(48),%a0 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 528c6: b3c8 cmpal %a0,%a1 528c8: 6716 beqs 528e0 <_Timer_server_Schedule_operation_method+0x68> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 528ca: 2240 moveal %d0,%a1 528cc: 93c1 subal %d1,%a1 delta_interval = first_watchdog->delta_interval; 528ce: 2228 0010 movel %a0@(16),%d1 if (delta_interval > delta) { 528d2: b3c1 cmpal %d1,%a1 528d4: 6404 bccs 528da <_Timer_server_Schedule_operation_method+0x62> delta_interval -= delta; 528d6: 9289 subl %a1,%d1 528d8: 6002 bras 528dc <_Timer_server_Schedule_operation_method+0x64> } else { delta_interval = 0; 528da: 4281 clrl %d1 } first_watchdog->delta_interval = delta_interval; 528dc: 2141 0010 movel %d1,%a0@(16) } ts->Interval_watchdogs.last_snapshot = snapshot; 528e0: 2540 003c movel %d0,%a2@(60) _ISR_Enable( level ); 528e4: 46c2 movew %d2,%sr _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 528e6: 486b 0010 pea %a3@(16) 528ea: 486a 0030 pea %a2@(48) 528ee: 4eb9 0005 6520 jsr 56520 <_Watchdog_Insert> if ( !ts->active ) { 528f4: 508f addql #8,%sp 528f6: 102a 007c moveb %a2@(124),%d0 528fa: 6600 0096 bnew 52992 <_Timer_server_Schedule_operation_method+0x11a> _Timer_server_Reset_interval_system_watchdog( ts ); 528fe: 2f0a movel %a2,%sp@- 52900: 4eba fcf2 jsr %pc@(525f4 <_Timer_server_Reset_interval_system_watchdog>) 52904: 6000 008a braw 52990 <_Timer_server_Schedule_operation_method+0x118> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 52908: 7203 moveq #3,%d1 5290a: b280 cmpl %d0,%d1 5290c: 6600 0084 bnew 52992 <_Timer_server_Schedule_operation_method+0x11a> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 52910: 203c 0000 0700 movel #1792,%d0 52916: 40c2 movew %sr,%d2 52918: 8082 orl %d2,%d0 5291a: 46c0 movew %d0,%sr 5291c: 2f3c 3b9a ca00 movel #1000000000,%sp@- 52922: 42a7 clrl %sp@- 52924: 2f39 0007 7420 movel 77420 <_TOD+0x4>,%sp@- 5292a: 2f39 0007 741c movel 7741c <_TOD>,%sp@- 52930: 4eb9 0006 6f48 jsr 66f48 <__divdi3> snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; 52936: 226a 0074 moveal %a2@(116),%a1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 5293a: 200a movel %a2,%d0 5293c: 4fef 0010 lea %sp@(16),%sp 52940: 0680 0000 006c addil #108,%d0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 52946: 206a 0068 moveal %a2@(104),%a0 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 5294a: b088 cmpl %a0,%d0 5294c: 6720 beqs 5296e <_Timer_server_Schedule_operation_method+0xf6> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 5294e: 2028 0010 movel %a0@(16),%d0 if ( snapshot > last_snapshot ) { 52952: b3c1 cmpal %d1,%a1 52954: 640c bccs 52962 <_Timer_server_Schedule_operation_method+0xea> /* * We advanced in time. */ delta = snapshot - last_snapshot; 52956: 2841 moveal %d1,%a4 52958: 99c9 subal %a1,%a4 if (delta_interval > delta) { 5295a: b9c0 cmpal %d0,%a4 5295c: 640a bccs 52968 <_Timer_server_Schedule_operation_method+0xf0><== NEVER TAKEN delta_interval -= delta; 5295e: 908c subl %a4,%d0 52960: 6008 bras 5296a <_Timer_server_Schedule_operation_method+0xf2> } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 52962: d089 addl %a1,%d0 delta_interval += delta; 52964: 9081 subl %d1,%d0 52966: 6002 bras 5296a <_Timer_server_Schedule_operation_method+0xf2> */ delta = snapshot - last_snapshot; if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 52968: 4280 clrl %d0 <== NOT EXECUTED * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 5296a: 2140 0010 movel %d0,%a0@(16) } ts->TOD_watchdogs.last_snapshot = snapshot; 5296e: 2541 0074 movel %d1,%a2@(116) _ISR_Enable( level ); 52972: 46c2 movew %d2,%sr _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 52974: 486b 0010 pea %a3@(16) 52978: 486a 0068 pea %a2@(104) 5297c: 4eb9 0005 6520 jsr 56520 <_Watchdog_Insert> if ( !ts->active ) { 52982: 508f addql #8,%sp 52984: 102a 007c moveb %a2@(124),%d0 52988: 6608 bnes 52992 <_Timer_server_Schedule_operation_method+0x11a><== NEVER TAKEN _Timer_server_Reset_tod_system_watchdog( ts ); 5298a: 2f0a movel %a2,%sp@- 5298c: 4eba fcc6 jsr %pc@(52654 <_Timer_server_Reset_tod_system_watchdog>) 52990: 588f addql #4,%sp * 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 ); } } 52992: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 52998: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 5299a: 4ef9 0005 58b8 jmp 558b8 <_Thread_Enable_dispatch> * 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 ); 529a0: 246a 0078 moveal %a2@(120),%a2 529a4: 2d4b 000c movel %a3,%fp@(12) 529a8: 2d4a 0008 movel %a2,%fp@(8) } } 529ac: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 529b2: 4e5e unlk %fp * 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 ); 529b4: 4ef9 0005 31e8 jmp 531e8 <_Chain_Append> =============================================================================== 0004a2f0 <_Timestamp64_Divide>: const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 4a2f0: 4e56 ffec linkw %fp,#-20 Timestamp64_Control answer; if ( *_rhs == 0 ) { 4a2f4: 206e 000c moveal %fp@(12),%a0 const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 4a2f8: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 4a2fc: 266e 0010 moveal %fp@(16),%a3 4a300: 246e 0014 moveal %fp@(20),%a2 Timestamp64_Control answer; if ( *_rhs == 0 ) { 4a304: 2410 movel %a0@,%d2 4a306: 2628 0004 movel %a0@(4),%d3 4a30a: 2002 movel %d2,%d0 4a30c: 8083 orl %d3,%d0 4a30e: 6606 bnes 4a316 <_Timestamp64_Divide+0x26> <== ALWAYS TAKEN *_ival_percentage = 0; 4a310: 4293 clrl %a3@ <== NOT EXECUTED *_fval_percentage = 0; 4a312: 4292 clrl %a2@ <== NOT EXECUTED return; 4a314: 605c bras 4a372 <_Timestamp64_Divide+0x82> <== 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; 4a316: 206e 0008 moveal %fp@(8),%a0 4a31a: 49f9 0005 b0a8 lea 5b0a8 <__divdi3>,%a4 4a320: 2f3c 0001 86a0 movel #100000,%sp@- 4a326: 42a7 clrl %sp@- 4a328: 2f28 0004 movel %a0@(4),%sp@- 4a32c: 2f10 movel %a0@,%sp@- 4a32e: 4eb9 0005 aff8 jsr 5aff8 <__muldi3> 4a334: 4fef 0010 lea %sp@(16),%sp 4a338: 2f03 movel %d3,%sp@- 4a33a: 2f02 movel %d2,%sp@- 4a33c: 2f01 movel %d1,%sp@- 4a33e: 2f00 movel %d0,%sp@- 4a340: 4e94 jsr %a4@ 4a342: 4fef 0010 lea %sp@(16),%sp 4a346: 2400 movel %d0,%d2 *_ival_percentage = answer / 1000; 4a348: 4878 03e8 pea 3e8 * This looks odd but gives the results the proper precision. * * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; 4a34c: 2601 movel %d1,%d3 *_ival_percentage = answer / 1000; 4a34e: 42a7 clrl %sp@- 4a350: 2f01 movel %d1,%sp@- 4a352: 2f02 movel %d2,%sp@- 4a354: 4e94 jsr %a4@ 4a356: 4fef 0010 lea %sp@(16),%sp 4a35a: 2681 movel %d1,%a3@ *_fval_percentage = answer % 1000; 4a35c: 4878 03e8 pea 3e8 4a360: 42a7 clrl %sp@- 4a362: 2f03 movel %d3,%sp@- 4a364: 2f02 movel %d2,%sp@- 4a366: 4eb9 0005 b508 jsr 5b508 <__moddi3> 4a36c: 4fef 0010 lea %sp@(16),%sp 4a370: 2481 movel %d1,%a2@ } 4a372: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 4a378: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000491a0 <_User_extensions_Handler_initialization>: void _User_extensions_Handler_initialization(void) { 491a0: 4e56 fffc linkw %fp,#-4 uint32_t number_of_initial_extensions = 491a4: 2039 0005 b894 movel 5b894 ,%d0 rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { 491aa: 6724 beqs 491d0 <_User_extensions_Handler_initialization+0x30><== NEVER TAKEN User_extensions_Switch_control *initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( 491ac: 2200 movel %d0,%d1 491ae: e988 lsll #4,%d0 491b0: e589 lsll #2,%d1 { uint32_t number_of_initial_extensions = rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { User_extensions_Switch_control *initial_extension_switch_controls = 491b2: 9081 subl %d1,%d0 491b4: 2f00 movel %d0,%sp@- 491b6: 4eb9 0004 94ee jsr 494ee <_Workspace_Allocate_or_fatal_error> _Workspace_Allocate_or_fatal_error( number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) ); User_extensions_Switch_context ctx = { initial_extension_switch_controls }; 491bc: 204e moveal %fp,%a0 491be: 2100 movel %d0,%a0@- _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 491c0: 487a ff9e pea %pc@(49160 <_User_extensions_Switch_visitor>) 491c4: 2f08 movel %a0,%sp@- 491c6: 4eb9 0004 90f6 jsr 490f6 <_User_extensions_Iterate> 491cc: 4fef 000c lea %sp@(12),%sp } } 491d0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a584 <_Watchdog_Adjust>: Watchdog_Interval units ) { ISR_Level level; _ISR_Disable( level ); 4a584: 327c 0700 moveaw #1792,%a1 4a588: 2209 movel %a1,%d1 void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4a58a: 4e56 ffec linkw %fp,#-20 4a58e: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 4a592: 246e 0008 moveal %fp@(8),%a2 4a596: 262e 000c movel %fp@(12),%d3 4a59a: 242e 0010 movel %fp@(16),%d2 ISR_Level level; _ISR_Disable( level ); 4a59e: 40c0 movew %sr,%d0 4a5a0: 8280 orl %d0,%d1 4a5a2: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4a5a4: 264a moveal %a2,%a3 4a5a6: 205b moveal %a3@+,%a0 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 4a5a8: b7c8 cmpal %a0,%a3 4a5aa: 674c beqs 4a5f8 <_Watchdog_Adjust+0x74> switch ( direction ) { 4a5ac: 4a83 tstl %d3 4a5ae: 673c beqs 4a5ec <_Watchdog_Adjust+0x68> 4a5b0: 7201 moveq #1,%d1 4a5b2: b283 cmpl %d3,%d1 4a5b4: 6642 bnes 4a5f8 <_Watchdog_Adjust+0x74> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4a5b6: d5a8 0010 addl %d2,%a0@(16) break; 4a5ba: 603c bras 4a5f8 <_Watchdog_Adjust+0x74> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4a5bc: 2052 moveal %a2@,%a0 case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 4a5be: 2228 0010 movel %a0@(16),%d1 4a5c2: b282 cmpl %d2,%d1 4a5c4: 6308 blss 4a5ce <_Watchdog_Adjust+0x4a> _Watchdog_First( header )->delta_interval -= units; 4a5c6: 9282 subl %d2,%d1 4a5c8: 2141 0010 movel %d1,%a0@(16) break; 4a5cc: 602a bras 4a5f8 <_Watchdog_Adjust+0x74> } else { units -= _Watchdog_First( header )->delta_interval; 4a5ce: 9481 subl %d1,%d2 _Watchdog_First( header )->delta_interval = 1; 4a5d0: 7201 moveq #1,%d1 4a5d2: 2141 0010 movel %d1,%a0@(16) _ISR_Enable( level ); 4a5d6: 46c0 movew %d0,%sr _Watchdog_Tickle( header ); 4a5d8: 2f0a movel %a2,%sp@- 4a5da: 4e94 jsr %a4@ _ISR_Disable( level ); 4a5dc: 2203 movel %d3,%d1 4a5de: 40c0 movew %sr,%d0 4a5e0: 8280 orl %d0,%d1 4a5e2: 46c1 movew %d1,%sr if ( _Chain_Is_empty( header ) ) 4a5e4: 588f addql #4,%sp 4a5e6: b7d2 cmpal %a2@,%a3 4a5e8: 660a bnes 4a5f4 <_Watchdog_Adjust+0x70> 4a5ea: 600c bras 4a5f8 <_Watchdog_Adjust+0x74> units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); _Watchdog_Tickle( header ); 4a5ec: 49f9 0004 a7a4 lea 4a7a4 <_Watchdog_Tickle>,%a4 _ISR_Disable( level ); 4a5f2: 2609 movel %a1,%d3 switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4a5f4: 4a82 tstl %d2 4a5f6: 66c4 bnes 4a5bc <_Watchdog_Adjust+0x38> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 4a5f8: 46c0 movew %d0,%sr } 4a5fa: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 4a600: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000492f8 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 492f8: 203c 0000 0700 movel #1792,%d0 #include Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 492fe: 4e56 0000 linkw %fp,#0 49302: 206e 0008 moveal %fp@(8),%a0 49306: 2f0a movel %a2,%sp@- 49308: 2f02 movel %d2,%sp@- ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4930a: 40c1 movew %sr,%d1 4930c: 8081 orl %d1,%d0 4930e: 46c0 movew %d0,%sr previous_state = the_watchdog->state; 49310: 2028 0008 movel %a0@(8),%d0 switch ( previous_state ) { 49314: 7401 moveq #1,%d2 49316: b480 cmpl %d0,%d2 49318: 670c beqs 49326 <_Watchdog_Remove+0x2e> 4931a: 6242 bhis 4935e <_Watchdog_Remove+0x66> 4931c: 143c 0003 moveb #3,%d2 49320: b480 cmpl %d0,%d2 49322: 653a bcss 4935e <_Watchdog_Remove+0x66> <== NEVER TAKEN 49324: 6006 bras 4932c <_Watchdog_Remove+0x34> /* * 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; 49326: 42a8 0008 clrl %a0@(8) break; 4932a: 6032 bras 4935e <_Watchdog_Remove+0x66> } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 4932c: 2250 moveal %a0@,%a1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 4932e: 42a8 0008 clrl %a0@(8) next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 49332: 4a91 tstl %a1@ 49334: 6708 beqs 4933e <_Watchdog_Remove+0x46> next_watchdog->delta_interval += the_watchdog->delta_interval; 49336: 2428 0010 movel %a0@(16),%d2 4933a: d5a9 0010 addl %d2,%a1@(16) if ( _Watchdog_Sync_count ) 4933e: 2479 0005 efb8 moveal 5efb8 <_Watchdog_Sync_count>,%a2 49344: 4a8a tstl %a2 49346: 670c beqs 49354 <_Watchdog_Remove+0x5c> _Watchdog_Sync_level = _ISR_Nest_level; 49348: 45f9 0005 f318 lea 5f318 <_Per_CPU_Information+0x8>,%a2 4934e: 23d2 0005 ef5e movel %a2@,5ef5e <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 49354: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; 49358: 234a 0004 movel %a2,%a1@(4) previous->next = next; 4935c: 2489 movel %a1,%a2@ _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4935e: 2439 0005 efbc movel 5efbc <_Watchdog_Ticks_since_boot>,%d2 49364: 2142 0018 movel %d2,%a0@(24) _ISR_Enable( level ); 49368: 46c1 movew %d1,%sr return( previous_state ); } 4936a: 241f movel %sp@+,%d2 4936c: 245f moveal %sp@+,%a2 4936e: 4e5e unlk %fp ... =============================================================================== 00049374 <_Watchdog_Tickle>: * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 49374: 203c 0000 0700 movel #1792,%d0 #include void _Watchdog_Tickle( Chain_Control *header ) { 4937a: 4e56 ffe8 linkw %fp,#-24 4937e: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 49382: 286e 0008 moveal %fp@(8),%a4 * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 49386: 40c2 movew %sr,%d2 49388: 8082 orl %d2,%d0 4938a: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4938c: 264c moveal %a4,%a3 4938e: 245b moveal %a3@+,%a2 if ( _Chain_Is_empty( header ) ) 49390: b7ca cmpal %a2,%a3 49392: 674c beqs 493e0 <_Watchdog_Tickle+0x6c> * to be inserted has already had its delta_interval adjusted to 0, and * so is added to the head of the chain with a delta_interval of 0. * * Steven Johnson - 12/2005 (gcc-3.2.3 -O3 on powerpc) */ if (the_watchdog->delta_interval != 0) { 49394: 202a 0010 movel %a2@(16),%d0 49398: 6708 beqs 493a2 <_Watchdog_Tickle+0x2e> <== NEVER TAKEN the_watchdog->delta_interval--; 4939a: 5380 subql #1,%d0 4939c: 2540 0010 movel %d0,%a2@(16) if ( the_watchdog->delta_interval != 0 ) 493a0: 663e bnes 493e0 <_Watchdog_Tickle+0x6c> goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 493a2: 4bf9 0004 92f8 lea 492f8 <_Watchdog_Remove>,%a5 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 493a8: 263c 0000 0700 movel #1792,%d3 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 493ae: 2f0a movel %a2,%sp@- 493b0: 4e95 jsr %a5@ _ISR_Enable( level ); 493b2: 46c2 movew %d2,%sr switch( watchdog_state ) { 493b4: 7202 moveq #2,%d1 493b6: 588f addql #4,%sp 493b8: b280 cmpl %d0,%d1 493ba: 6610 bnes 493cc <_Watchdog_Tickle+0x58> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 493bc: 2f2a 0024 movel %a2@(36),%sp@- 493c0: 2f2a 0020 movel %a2@(32),%sp@- 493c4: 206a 001c moveal %a2@(28),%a0 493c8: 4e90 jsr %a0@ the_watchdog->id, the_watchdog->user_data ); break; 493ca: 508f addql #8,%sp case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 493cc: 2003 movel %d3,%d0 493ce: 40c2 movew %sr,%d2 493d0: 8082 orl %d2,%d0 493d2: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 493d4: 2454 moveal %a4@,%a2 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 493d6: b7ca cmpal %a2,%a3 493d8: 6706 beqs 493e0 <_Watchdog_Tickle+0x6c> } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 493da: 4aaa 0010 tstl %a2@(16) 493de: 67ce beqs 493ae <_Watchdog_Tickle+0x3a> (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 493e0: 46c2 movew %d2,%sr } 493e2: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 493e8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000493ec <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 493ec: 4e56 ffe4 linkw %fp,#-28 493f0: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 493f4: 2a2e 0010 movel %fp@(16),%d5 Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 493f8: 4a39 0005 b886 tstb 5b886 493fe: 6608 bnes 49408 <_Workspace_Handler_initialization+0x1c> 49400: 2439 0005 b858 movel 5b858 ,%d2 49406: 6002 bras 4940a <_Workspace_Handler_initialization+0x1e> 49408: 4282 clrl %d2 4940a: d4b9 0005 b854 addl 5b854 ,%d2 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) { 49410: 4284 clrl %d4 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 49412: 47f9 0004 735c lea 4735c <_Heap_Initialize>,%a3 for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { memset( area->begin, 0, area->size ); 49418: 49f9 0004 d828 lea 4d828 ,%a4 4941e: 246e 0008 moveal %fp@(8),%a2 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) { 49422: 6070 bras 49494 <_Workspace_Handler_initialization+0xa8> Heap_Area *area = &areas [i]; if ( do_zero ) { 49424: 4a39 0005 b884 tstb 5b884 4942a: 670e beqs 4943a <_Workspace_Handler_initialization+0x4e> memset( area->begin, 0, area->size ); 4942c: 2f2a 0004 movel %a2@(4),%sp@- 49430: 42a7 clrl %sp@- 49432: 2f12 movel %a2@,%sp@- 49434: 4e94 jsr %a4@ 49436: 4fef 000c lea %sp@(12),%sp } if ( area->size > overhead ) { 4943a: 262a 0004 movel %a2@(4),%d3 4943e: 700e moveq #14,%d0 49440: b083 cmpl %d3,%d0 49442: 644c bccs 49490 <_Workspace_Handler_initialization+0xa4> uintptr_t space_available; uintptr_t size; if ( unified ) { 49444: 4a39 0005 b885 tstb 5b885 4944a: 661c bnes 49468 <_Workspace_Handler_initialization+0x7c> size = area->size; } else { if ( remaining > 0 ) { 4944c: 4a82 tstl %d2 4944e: 6716 beqs 49466 <_Workspace_Handler_initialization+0x7a><== NEVER TAKEN size = remaining < area->size - overhead ? 49450: 2003 movel %d3,%d0 49452: 0680 ffff fff2 addil #-14,%d0 remaining + overhead : area->size; 49458: b082 cmpl %d2,%d0 4945a: 630c blss 49468 <_Workspace_Handler_initialization+0x7c><== NEVER TAKEN 4945c: 2602 movel %d2,%d3 4945e: 0683 0000 000e addil #14,%d3 49464: 6002 bras 49468 <_Workspace_Handler_initialization+0x7c> } else { size = 0; 49466: 4283 clrl %d3 <== NOT EXECUTED } } space_available = (*init_or_extend)( 49468: 4878 0004 pea 4 4946c: 2f03 movel %d3,%sp@- 4946e: 2f12 movel %a2@,%sp@- 49470: 4879 0005 eee6 pea 5eee6 <_Workspace_Area> 49476: 4e93 jsr %a3@ ); area->begin = (char *) area->begin + size; area->size -= size; if ( space_available < remaining ) { 49478: 4fef 0010 lea %sp@(16),%sp area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4947c: d792 addl %d3,%a2@ area->size -= size; 4947e: 97aa 0004 subl %d3,%a2@(4) if ( space_available < remaining ) { 49482: b480 cmpl %d0,%d2 49484: 6306 blss 4948c <_Workspace_Handler_initialization+0xa0><== ALWAYS TAKEN remaining -= space_available; 49486: 9480 subl %d0,%d2 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; 49488: 2645 moveal %d5,%a3 <== NOT EXECUTED 4948a: 6004 bras 49490 <_Workspace_Handler_initialization+0xa4><== NOT EXECUTED 4948c: 2645 moveal %d5,%a3 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; 4948e: 4282 clrl %d2 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) { 49490: 5284 addql #1,%d4 49492: 508a addql #8,%a2 49494: b8ae 000c cmpl %fp@(12),%d4 49498: 668a bnes 49424 <_Workspace_Handler_initialization+0x38> init_or_extend = extend; } } if ( remaining > 0 ) { 4949a: 4a82 tstl %d2 4949c: 6710 beqs 494ae <_Workspace_Handler_initialization+0xc2> _Internal_error_Occurred( 4949e: 4878 0002 pea 2 494a2: 4878 0001 pea 1 494a6: 42a7 clrl %sp@- 494a8: 4eb9 0004 7550 jsr 47550 <_Internal_error_Occurred> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_TOO_LITTLE_WORKSPACE ); } } 494ae: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 494b4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045338 <__assert_func>: const char *file, int line, const char *func, const char *failedexpr ) { 45338: 4e56 0000 linkw %fp,#0 4533c: 2f02 movel %d2,%sp@- 4533e: 242e 0010 movel %fp@(16),%d2 printk("assertion \"%s\" failed: file \"%s\", line %d%s%s\n", 45342: 660a bnes 4534e <__assert_func+0x16> 45344: 203c 0005 f660 movel #390752,%d0 4534a: 2200 movel %d0,%d1 4534c: 6008 bras 45356 <__assert_func+0x1e> 4534e: 2002 movel %d2,%d0 45350: 223c 0005 efc0 movel #389056,%d1 45356: 2f00 movel %d0,%sp@- 45358: 2f01 movel %d1,%sp@- 4535a: 2f2e 000c movel %fp@(12),%sp@- 4535e: 2f2e 0008 movel %fp@(8),%sp@- 45362: 2f2e 0014 movel %fp@(20),%sp@- 45366: 4879 0005 efcd pea 5efcd 4536c: 4eb9 0004 62f4 jsr 462f4 file, line, (func) ? ", function: " : "", (func) ? func : "" ); rtems_fatal( RTEMS_FATAL_SOURCE_ASSERT, (rtems_fatal_code) func ); 45372: 2f02 movel %d2,%sp@- 45374: 4878 0008 pea 8 45378: 4eb9 0004 997c jsr 4997c ... =============================================================================== 0005aab4 <_calloc_r>: void *_calloc_r( struct _reent *ignored __attribute__((unused)), size_t elements, size_t size ) { 5aab4: 4e56 0000 linkw %fp,#0 5aab8: 202e 000c movel %fp@(12),%d0 return calloc( elements, size ); 5aabc: 2d6e 0010 000c movel %fp@(16),%fp@(12) void *_calloc_r( struct _reent *ignored __attribute__((unused)), size_t elements, size_t size ) { 5aac2: 2d40 0008 movel %d0,%fp@(8) return calloc( elements, size ); } 5aac6: 4e5e unlk %fp struct _reent *ignored __attribute__((unused)), size_t elements, size_t size ) { return calloc( elements, size ); 5aac8: 4ef9 0004 2818 jmp 42818 ... =============================================================================== 00043270 <_exit>: extern void FINI_SYMBOL( void ); #endif void EXIT_SYMBOL(int status) { 43270: 4e56 0000 linkw %fp,#0 /* * If the toolset uses init/fini sections, then we need to * run the global destructors now. */ #if defined(FINI_SYMBOL) FINI_SYMBOL(); 43274: 4eb9 0005 b634 jsr 5b634 <_fini> * We need to do the exit processing on the global reentrancy structure. * This has already been done on the per task reentrancy structure * associated with this task. */ libc_wrapup(); 4327a: 4eb9 0004 320c jsr 4320c rtems_shutdown_executive(status); 43280: 2f2e 0008 movel %fp@(8),%sp@- 43284: 4eb9 0004 6968 jsr 46968 ... =============================================================================== 0004fdfc <_fat_block_read>: uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 4fdfc: 4e56 ffd8 linkw %fp,#-40 4fe00: 48d7 1cfc moveml %d2-%d7/%a2-%a4,%sp@ uint8_t *sec_buf; uint32_t c = 0; while (count > 0) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 4fe04: 2e0e movel %fp,%d7 uint32_t count, void *buff ) { int rc = RC_OK; ssize_t cmpltd = 0; 4fe06: 4284 clrl %d4 uint8_t *sec_buf; uint32_t c = 0; while (count > 0) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 4fe08: 5987 subql #4,%d7 4fe0a: 47f9 0004 fd48 lea 4fd48 ,%a3 if (rc != RC_OK) return -1; c = MIN(count, (fs_info->vol.bps - ofs)); memcpy((buff + cmpltd), (sec_buf + ofs), c); 4fe10: 49f9 0005 7dd0 lea 57dd0 ,%a4 uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 4fe16: 246e 0008 moveal %fp@(8),%a2 4fe1a: 262e 0014 movel %fp@(20),%d3 int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; uint32_t ofs = offset; 4fe1e: 2c2e 0010 movel %fp@(16),%d6 void *buff ) { int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; 4fe22: 2a2e 000c movel %fp@(12),%d5 uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 4fe26: 603e bras 4fe66 <_fat_block_read+0x6a> { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 4fe28: 2f07 movel %d7,%sp@- 4fe2a: 4878 0001 pea 1 4fe2e: 2f05 movel %d5,%sp@- 4fe30: 2f0a movel %a2,%sp@- 4fe32: 4e93 jsr %a3@ if (rc != RC_OK) 4fe34: 4fef 0010 lea %sp@(16),%sp 4fe38: 4a80 tstl %d0 4fe3a: 6630 bnes 4fe6c <_fat_block_read+0x70> <== NEVER TAKEN return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 4fe3c: 4282 clrl %d2 4fe3e: 3412 movew %a2@,%d2 4fe40: 9486 subl %d6,%d2 4fe42: b682 cmpl %d2,%d3 4fe44: 6402 bccs 4fe48 <_fat_block_read+0x4c> <== ALWAYS TAKEN 4fe46: 2403 movel %d3,%d2 <== NOT EXECUTED memcpy((buff + cmpltd), (sec_buf + ofs), c); 4fe48: dcae fffc addl %fp@(-4),%d6 count -= c; 4fe4c: 9682 subl %d2,%d3 cmpltd += c; sec_num++; 4fe4e: 5285 addql #1,%d5 rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; c = MIN(count, (fs_info->vol.bps - ofs)); memcpy((buff + cmpltd), (sec_buf + ofs), c); 4fe50: 2f02 movel %d2,%sp@- 4fe52: 206e 0018 moveal %fp@(24),%a0 4fe56: 2f06 movel %d6,%sp@- 4fe58: 4870 4800 pea %a0@(00000000,%d4:l) count -= c; cmpltd += c; sec_num++; ofs = 0; 4fe5c: 4286 clrl %d6 c = MIN(count, (fs_info->vol.bps - ofs)); memcpy((buff + cmpltd), (sec_buf + ofs), c); count -= c; cmpltd += c; 4fe5e: d882 addl %d2,%d4 rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; c = MIN(count, (fs_info->vol.bps - ofs)); memcpy((buff + cmpltd), (sec_buf + ofs), c); 4fe60: 4e94 jsr %a4@ count -= c; cmpltd += c; sec_num++; ofs = 0; 4fe62: 4fef 000c lea %sp@(12),%sp uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 4fe66: 4a83 tstl %d3 4fe68: 66be bnes 4fe28 <_fat_block_read+0x2c> 4fe6a: 6002 bras 4fe6e <_fat_block_read+0x72> { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; 4fe6c: 78ff moveq #-1,%d4 <== NOT EXECUTED cmpltd += c; sec_num++; ofs = 0; } return cmpltd; } 4fe6e: 2004 movel %d4,%d0 4fe70: 4cee 1cfc ffd8 moveml %fp@(-40),%d2-%d7/%a2-%a4 4fe76: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005ab48 <_free_r>: void _free_r( struct _reent *ignored __attribute__((unused)), void *ptr ) { 5ab48: 4e56 0000 linkw %fp,#0 free( ptr ); 5ab4c: 2d6e 000c 0008 movel %fp@(12),%fp@(8) } 5ab52: 4e5e unlk %fp void _free_r( struct _reent *ignored __attribute__((unused)), void *ptr ) { free( ptr ); 5ab54: 4ef9 0004 2a60 jmp 42a60 ... =============================================================================== 00042b8a <_gettimeofday>: */ int _gettimeofday( struct timeval *tp, struct timezone *tzp ) { 42b8a: 4e56 0000 linkw %fp,#0 return gettimeofday( tp, tzp ); } 42b8e: 4e5e unlk %fp int _gettimeofday( struct timeval *tp, struct timezone *tzp ) { return gettimeofday( tp, tzp ); 42b90: 4ef9 0004 2ae8 jmp 42ae8 ... =============================================================================== 0005ac1c <_isatty_r>: int _isatty_r( struct _reent *ptr __attribute__((unused)), int fd ) { 5ac1c: 4e56 0000 linkw %fp,#0 return isatty( fd ); 5ac20: 2d6e 000c 0008 movel %fp@(12),%fp@(8) } 5ac26: 4e5e unlk %fp int _isatty_r( struct _reent *ptr __attribute__((unused)), int fd ) { return isatty( fd ); 5ac28: 4ef9 0005 b58c jmp 5b58c ... =============================================================================== 000428f4 <_link_r>: int _link_r( struct _reent *ptr __attribute__((unused)), const char *path1, const char *path2 ) { 428f4: 4e56 0000 linkw %fp,#0 428f8: 202e 000c movel %fp@(12),%d0 return link( path1, path2 ); 428fc: 2d6e 0010 000c movel %fp@(16),%fp@(12) int _link_r( struct _reent *ptr __attribute__((unused)), const char *path1, const char *path2 ) { 42902: 2d40 0008 movel %d0,%fp@(8) return link( path1, path2 ); } 42906: 4e5e unlk %fp struct _reent *ptr __attribute__((unused)), const char *path1, const char *path2 ) { return link( path1, path2 ); 42908: 4ef9 0004 2870 jmp 42870 ... =============================================================================== 0005acac <_lseek_r>: struct _reent *ptr __attribute__((unused)), int fd, off_t offset, int whence ) { 5acac: 4e56 0000 linkw %fp,#0 5acb0: 202e 000c movel %fp@(12),%d0 5acb4: 2d40 0008 movel %d0,%fp@(8) 5acb8: 202e 0010 movel %fp@(16),%d0 5acbc: 222e 0014 movel %fp@(20),%d1 return lseek( fd, offset, whence ); 5acc0: 2d6e 0018 0014 movel %fp@(24),%fp@(20) 5acc6: 2d40 000c movel %d0,%fp@(12) 5acca: 2d41 0010 movel %d1,%fp@(16) } 5acce: 4e5e unlk %fp int fd, off_t offset, int whence ) { return lseek( fd, offset, whence ); 5acd0: 4ef9 0005 ac30 jmp 5ac30 ... =============================================================================== 00042970 <_lstat_r>: int _STAT_R_NAME( struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { 42970: 4e56 0000 linkw %fp,#0 <== NOT EXECUTED 42974: 202e 000c movel %fp@(12),%d0 <== NOT EXECUTED return _STAT_NAME( path, buf ); 42978: 2d6e 0010 000c movel %fp@(16),%fp@(12) <== NOT EXECUTED int _STAT_R_NAME( struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { 4297e: 2d40 0008 movel %d0,%fp@(8) <== NOT EXECUTED return _STAT_NAME( path, buf ); } 42982: 4e5e unlk %fp <== NOT EXECUTED struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { return _STAT_NAME( path, buf ); 42984: 4ef9 0004 2910 jmp 42910 <== NOT EXECUTED ... =============================================================================== 0005acd8 <_malloc_r>: void *_malloc_r( struct _reent *ignored __attribute__((unused)), size_t size ) { 5acd8: 4e56 0000 linkw %fp,#0 return malloc( size ); 5acdc: 2d6e 000c 0008 movel %fp@(12),%fp@(8) } 5ace2: 4e5e unlk %fp void *_malloc_r( struct _reent *ignored __attribute__((unused)), size_t size ) { return malloc( size ); 5ace4: 4ef9 0004 2d30 jmp 42d30 ... =============================================================================== 00043708 <_open_r>: struct _reent *ptr __attribute__((unused)), const char *buf, int oflag, int mode ) { 43708: 4e56 0000 linkw %fp,#0 4370c: 202e 000c movel %fp@(12),%d0 43710: 2d40 0008 movel %d0,%fp@(8) 43714: 202e 0010 movel %fp@(16),%d0 return open( buf, oflag, mode ); 43718: 2d6e 0014 0010 movel %fp@(20),%fp@(16) struct _reent *ptr __attribute__((unused)), const char *buf, int oflag, int mode ) { 4371e: 2d40 000c movel %d0,%fp@(12) return open( buf, oflag, mode ); } 43722: 4e5e unlk %fp const char *buf, int oflag, int mode ) { return open( buf, oflag, mode ); 43724: 4ef9 0004 3554 jmp 43554 ... =============================================================================== 0005ad80 <_read_r>: struct _reent *ptr __attribute__((unused)), int fd, void *buf, size_t nbytes ) { 5ad80: 4e56 0000 linkw %fp,#0 5ad84: 202e 000c movel %fp@(12),%d0 5ad88: 2d40 0008 movel %d0,%fp@(8) 5ad8c: 202e 0010 movel %fp@(16),%d0 return read( fd, buf, nbytes ); 5ad90: 2d6e 0014 0010 movel %fp@(20),%fp@(16) struct _reent *ptr __attribute__((unused)), int fd, void *buf, size_t nbytes ) { 5ad96: 2d40 000c movel %d0,%fp@(12) return read( fd, buf, nbytes ); } 5ad9a: 4e5e unlk %fp int fd, void *buf, size_t nbytes ) { return read( fd, buf, nbytes ); 5ad9c: 4ef9 0005 acec jmp 5acec ... =============================================================================== 0005ada4 <_realloc_r>: void *_realloc_r( struct _reent *ignored __attribute__((unused)), void *ptr, size_t size ) { 5ada4: 4e56 0000 linkw %fp,#0 5ada8: 202e 000c movel %fp@(12),%d0 return realloc( ptr, size ); 5adac: 2d6e 0010 000c movel %fp@(16),%fp@(12) void *_realloc_r( struct _reent *ignored __attribute__((unused)), void *ptr, size_t size ) { 5adb2: 2d40 0008 movel %d0,%fp@(8) return realloc( ptr, size ); } 5adb6: 4e5e unlk %fp struct _reent *ignored __attribute__((unused)), void *ptr, size_t size ) { return realloc( ptr, size ); 5adb8: 4ef9 0005 ae04 jmp 5ae04 ... =============================================================================== 000437b0 <_stat_r>: int _STAT_R_NAME( struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { 437b0: 4e56 0000 linkw %fp,#0 <== NOT EXECUTED 437b4: 202e 000c movel %fp@(12),%d0 <== NOT EXECUTED return _STAT_NAME( path, buf ); 437b8: 2d6e 0010 000c movel %fp@(16),%fp@(12) <== NOT EXECUTED int _STAT_R_NAME( struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { 437be: 2d40 0008 movel %d0,%fp@(8) <== NOT EXECUTED return _STAT_NAME( path, buf ); } 437c2: 4e5e unlk %fp <== NOT EXECUTED struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { return _STAT_NAME( path, buf ); 437c4: 4ef9 0004 3750 jmp 43750 <== NOT EXECUTED ... =============================================================================== 0005adc0 <_write_r>: struct _reent *ptr __attribute__((unused)), int fd, const void *buf, size_t nbytes ) { 5adc0: 4e56 0000 linkw %fp,#0 5adc4: 202e 000c movel %fp@(12),%d0 5adc8: 2d40 0008 movel %d0,%fp@(8) 5adcc: 202e 0010 movel %fp@(16),%d0 return write( fd, buf, nbytes ); 5add0: 2d6e 0014 0010 movel %fp@(20),%fp@(16) struct _reent *ptr __attribute__((unused)), int fd, const void *buf, size_t nbytes ) { 5add6: 2d40 000c movel %d0,%fp@(12) return write( fd, buf, nbytes ); } 5adda: 4e5e unlk %fp int fd, const void *buf, size_t nbytes ) { return write( fd, buf, nbytes ); 5addc: 4ef9 0005 aeec jmp 5aeec ... =============================================================================== 000462f4 : #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { 462f4: 4e56 ffe8 linkw %fp,#-24 462f8: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 462fc: 4879 0006 0f6c pea 60f6c 46302: 47f9 0004 740c lea 4740c ,%a3 #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { 46308: 242e 0008 movel %fp@(8),%d2 4630c: 246e 000c moveal %fp@(12),%a2 rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 46310: 4e93 jsr %a3@ if (fcntl (fildes, F_GETFD) < 0) { 46312: 4878 0001 pea 1 46316: 2f02 movel %d2,%sp@- 46318: 4eb9 0004 c2b0 jsr 4c2b0 4631e: 4fef 000c lea %sp@(12),%sp 46322: 4a80 tstl %d0 46324: 6c1c bges 46342 pthread_mutex_unlock(&aio_request_queue.mutex); 46326: 4879 0006 0f6c pea 60f6c 4632c: 4eb9 0004 74a4 jsr 474a4 rtems_set_errno_and_return_minus_one (EBADF); 46332: 4eb9 0004 f05c jsr 4f05c <__errno> 46338: 7209 moveq #9,%d1 4633a: 2040 moveal %d0,%a0 4633c: 2081 movel %d1,%a0@ 4633e: 6000 0134 braw 46474 } /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { 46342: 4a8a tstl %a2 46344: 6600 00ce bnew 46414 AIO_printf ("Cancel all requests\n"); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 46348: 42a7 clrl %sp@- 4634a: 49f9 0004 693e lea 4693e ,%a4 46350: 2f02 movel %d2,%sp@- 46352: 4879 0006 0fb4 pea 60fb4 46358: 4e94 jsr %a4@ if (r_chain == NULL) { 4635a: 4fef 000c lea %sp@(12),%sp /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { AIO_printf ("Cancel all requests\n"); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 4635e: 2440 moveal %d0,%a2 if (r_chain == NULL) { 46360: 4a80 tstl %d0 46362: 6678 bnes 463dc <== NEVER TAKEN AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 46364: 203c 0006 0fc4 movel #397252,%d0 4636a: b0b9 0006 0fc0 cmpl 60fc0 ,%d0 46370: 6714 beqs 46386 <== NEVER TAKEN r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 46372: 42a7 clrl %sp@- 46374: 2f02 movel %d2,%sp@- 46376: 4879 0006 0fc0 pea 60fc0 4637c: 4e94 jsr %a4@ if (r_chain == NULL) { 4637e: 4fef 000c lea %sp@(12),%sp r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); if (r_chain == NULL) { AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 46382: 2400 movel %d0,%d2 if (r_chain == NULL) { 46384: 6614 bnes 4639a pthread_mutex_unlock(&aio_request_queue.mutex); 46386: 4879 0006 0f6c pea 60f6c return AIO_ALLDONE; 4638c: 7402 moveq #2,%d2 AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); if (r_chain == NULL) { pthread_mutex_unlock(&aio_request_queue.mutex); 4638e: 4eb9 0004 74a4 jsr 474a4 return AIO_ALLDONE; 46394: 588f addql #4,%sp 46396: 6000 0134 braw 464cc */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 4639a: 2f00 movel %d0,%sp@- 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); 4639c: 2602 movel %d2,%d3 4639e: 0683 0000 001c addil #28,%d3 463a4: 4eb9 0004 8d18 jsr 48d18 <_Chain_Extract> } AIO_printf ("Request chain on [IQ]\n"); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 463aa: 2f02 movel %d2,%sp@- 463ac: 4eb9 0004 69ce jsr 469ce pthread_mutex_destroy (&r_chain->mutex); 463b2: 2f03 movel %d3,%sp@- 463b4: 4eb9 0004 71d0 jsr 471d0 pthread_cond_destroy (&r_chain->mutex); 463ba: 2f03 movel %d3,%sp@- 463bc: 4eb9 0004 6ec4 jsr 46ec4 free (r_chain); 463c2: 2f02 movel %d2,%sp@- 463c4: 4eb9 0004 2e98 jsr 42e98 pthread_mutex_unlock (&aio_request_queue.mutex); 463ca: 4879 0006 0f6c pea 60f6c 463d0: 4eb9 0004 74a4 jsr 474a4 return AIO_CANCELED; 463d6: 4fef 0018 lea %sp@(24),%sp 463da: 6032 bras 4640e return AIO_ALLDONE; } AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 463dc: 2400 movel %d0,%d2 463de: 0682 0000 001c addil #28,%d2 463e4: 2f02 movel %d2,%sp@- 463e6: 4e93 jsr %a3@ 463e8: 2f0a movel %a2,%sp@- 463ea: 4eb9 0004 8d18 jsr 48d18 <_Chain_Extract> rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 463f0: 2f0a movel %a2,%sp@- pthread_mutex_unlock (&r_chain->mutex); 463f2: 45f9 0004 74a4 lea 474a4 ,%a2 AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 463f8: 4eb9 0004 69ce jsr 469ce pthread_mutex_unlock (&r_chain->mutex); 463fe: 2f02 movel %d2,%sp@- 46400: 4e92 jsr %a2@ pthread_mutex_unlock (&aio_request_queue.mutex); 46402: 4879 0006 0f6c pea 60f6c 46408: 4e92 jsr %a2@ return AIO_CANCELED; 4640a: 4fef 0014 lea %sp@(20),%sp 4640e: 4282 clrl %d2 46410: 6000 00ba braw 464cc } else { AIO_printf ("Cancel request\n"); if (aiocbp->aio_fildes != fildes) { 46414: 2612 movel %a2@,%d3 46416: b483 cmpl %d3,%d2 46418: 6702 beqs 4641c 4641a: 6040 bras 4645c 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); 4641c: 42a7 clrl %sp@- 4641e: 4bf9 0004 693e lea 4693e ,%a5 46424: 2f03 movel %d3,%sp@- 46426: 4879 0006 0fb4 pea 60fb4 4642c: 4e95 jsr %a5@ if (r_chain == NULL) { 4642e: 4fef 000c lea %sp@(12),%sp if (aiocbp->aio_fildes != fildes) { 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); 46432: 2840 moveal %d0,%a4 if (r_chain == NULL) { 46434: 4a80 tstl %d0 46436: 6664 bnes 4649c if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 46438: 203c 0006 0fc4 movel #397252,%d0 4643e: b0b9 0006 0fc0 cmpl 60fc0 ,%d0 46444: 6700 ff40 beqw 46386 r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 46448: 42a7 clrl %sp@- 4644a: 2f03 movel %d3,%sp@- 4644c: 4879 0006 0fc0 pea 60fc0 46452: 4e95 jsr %a5@ if (r_chain == NULL) { 46454: 4fef 000c lea %sp@(12),%sp 46458: 4a80 tstl %d0 4645a: 661e bnes 4647a pthread_mutex_unlock (&aio_request_queue.mutex); 4645c: 4879 0006 0f6c pea 60f6c 46462: 4eb9 0004 74a4 jsr 474a4 rtems_set_errno_and_return_minus_one (EINVAL); 46468: 4eb9 0004 f05c jsr 4f05c <__errno> 4646e: 2040 moveal %d0,%a0 46470: 7016 moveq #22,%d0 46472: 2080 movel %d0,%a0@ 46474: 588f addql #4,%sp 46476: 74ff moveq #-1,%d2 46478: 6052 bras 464cc } AIO_printf ("Request on [IQ]\n"); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 4647a: 2f0a movel %a2,%sp@- 4647c: 2040 moveal %d0,%a0 4647e: 4868 0008 pea %a0@(8) 46482: 4eb9 0004 6a24 jsr 46a24 pthread_mutex_unlock (&aio_request_queue.mutex); 46488: 4879 0006 0f6c pea 60f6c rtems_set_errno_and_return_minus_one (EINVAL); } AIO_printf ("Request on [IQ]\n"); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 4648e: 2400 movel %d0,%d2 pthread_mutex_unlock (&aio_request_queue.mutex); 46490: 4eb9 0004 74a4 jsr 474a4 return result; 46496: 4fef 000c lea %sp@(12),%sp 4649a: 6030 bras 464cc return AIO_ALLDONE; } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 4649c: 2600 movel %d0,%d3 4649e: 0683 0000 001c addil #28,%d3 464a4: 2f03 movel %d3,%sp@- 464a6: 4e93 jsr %a3@ result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 464a8: 2f0a movel %a2,%sp@- 464aa: 486c 0008 pea %a4@(8) pthread_mutex_unlock (&r_chain->mutex); 464ae: 45f9 0004 74a4 lea 474a4 ,%a2 } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 464b4: 4eb9 0004 6a24 jsr 46a24 464ba: 2400 movel %d0,%d2 pthread_mutex_unlock (&r_chain->mutex); 464bc: 2f03 movel %d3,%sp@- 464be: 4e92 jsr %a2@ pthread_mutex_unlock (&aio_request_queue.mutex); 464c0: 4879 0006 0f6c pea 60f6c 464c6: 4e92 jsr %a2@ return result; 464c8: 4fef 0014 lea %sp@(20),%sp } return AIO_ALLDONE; } 464cc: 2002 movel %d2,%d0 464ce: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 464d4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000464e8 : ) { rtems_aio_request *req; int mode; if (op != O_SYNC) 464e8: 203c 0000 2000 movel #8192,%d0 int aio_fsync( int op, struct aiocb *aiocbp ) { 464ee: 4e56 0000 linkw %fp,#0 464f2: 2f0a movel %a2,%sp@- 464f4: 246e 000c moveal %fp@(12),%a2 rtems_aio_request *req; int mode; if (op != O_SYNC) 464f8: b0ae 0008 cmpl %fp@(8),%d0 464fc: 671a beqs 46518 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 464fe: 7216 moveq #22,%d1 46500: 70ff moveq #-1,%d0 46502: 2541 0030 movel %d1,%a2@(48) 46506: 2540 0034 movel %d0,%a2@(52) 4650a: 4eb9 0004 f05c jsr 4f05c <__errno> 46510: 2040 moveal %d0,%a0 46512: 7016 moveq #22,%d0 46514: 2080 movel %d0,%a0@ 46516: 607e bras 46596 mode = fcntl (aiocbp->aio_fildes, F_GETFL); 46518: 4878 0003 pea 3 4651c: 2f12 movel %a2@,%sp@- 4651e: 4eb9 0004 c2b0 jsr 4c2b0 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 46524: 508f addql #8,%sp 46526: 7203 moveq #3,%d1 46528: c081 andl %d1,%d0 4652a: 123c 0001 moveb #1,%d1 4652e: 5380 subql #1,%d0 46530: b280 cmpl %d0,%d1 46532: 641a bccs 4654e rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 46534: 72ff moveq #-1,%d1 46536: 7009 moveq #9,%d0 46538: 2541 0034 movel %d1,%a2@(52) 4653c: 2540 0030 movel %d0,%a2@(48) 46540: 4eb9 0004 f05c jsr 4f05c <__errno> 46546: 7209 moveq #9,%d1 46548: 2040 moveal %d0,%a0 4654a: 2081 movel %d1,%a0@ 4654c: 6048 bras 46596 req = malloc (sizeof (rtems_aio_request)); 4654e: 4878 0018 pea 18 46552: 4eb9 0004 32b0 jsr 432b0 if (req == NULL) 46558: 588f addql #4,%sp 4655a: 4a80 tstl %d0 4655c: 661c bnes 4657a <== ALWAYS TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 4655e: 103c 000b moveb #11,%d0 <== NOT EXECUTED 46562: 72ff moveq #-1,%d1 <== NOT EXECUTED 46564: 2540 0030 movel %d0,%a2@(48) <== NOT EXECUTED 46568: 2541 0034 movel %d1,%a2@(52) <== NOT EXECUTED 4656c: 4eb9 0004 f05c jsr 4f05c <__errno> <== NOT EXECUTED 46572: 2040 moveal %d0,%a0 <== NOT EXECUTED 46574: 700b moveq #11,%d0 <== NOT EXECUTED 46576: 2080 movel %d0,%a0@ <== NOT EXECUTED 46578: 601c bras 46596 <== NOT EXECUTED req->aiocbp = aiocbp; 4657a: 2040 moveal %d0,%a0 req->aiocbp->aio_lio_opcode = LIO_SYNC; 4657c: 7203 moveq #3,%d1 req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 4657e: 214a 0014 movel %a2,%a0@(20) req->aiocbp->aio_lio_opcode = LIO_SYNC; 46582: 2541 002c movel %d1,%a2@(44) return rtems_aio_enqueue (req); } 46586: 246e fffc moveal %fp@(-4),%a2 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); 4658a: 2d40 0008 movel %d0,%fp@(8) } 4658e: 4e5e unlk %fp rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); 46590: 4ef9 0004 6a84 jmp 46a84 } 46596: 246e fffc moveal %fp@(-4),%a2 4659a: 70ff moveq #-1,%d0 4659c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046c84 : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 46c84: 4e56 0000 linkw %fp,#0 46c88: 2f0a movel %a2,%sp@- rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 46c8a: 4878 0003 pea 3 * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 46c8e: 246e 0008 moveal %fp@(8),%a2 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 46c92: 2f12 movel %a2@,%sp@- 46c94: 4eb9 0004 c2b0 jsr 4c2b0 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 46c9a: 508f addql #8,%sp 46c9c: 7203 moveq #3,%d1 46c9e: c081 andl %d1,%d0 46ca0: 6722 beqs 46cc4 <== NEVER TAKEN 46ca2: 123c 0002 moveb #2,%d1 46ca6: b280 cmpl %d0,%d1 46ca8: 671a beqs 46cc4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 46caa: 7009 moveq #9,%d0 46cac: 72ff moveq #-1,%d1 46cae: 2540 0030 movel %d0,%a2@(48) 46cb2: 2541 0034 movel %d1,%a2@(52) 46cb6: 4eb9 0004 f05c jsr 4f05c <__errno> 46cbc: 2040 moveal %d0,%a0 46cbe: 7009 moveq #9,%d0 46cc0: 2080 movel %d0,%a0@ 46cc2: 6070 bras 46d34 if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 46cc4: 4aaa 0014 tstl %a2@(20) 46cc8: 6702 beqs 46ccc 46cca: 6006 bras 46cd2 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 46ccc: 4aaa 0004 tstl %a2@(4) 46cd0: 6a1a bpls 46cec rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 46cd2: 72ff moveq #-1,%d1 46cd4: 7016 moveq #22,%d0 46cd6: 2541 0034 movel %d1,%a2@(52) 46cda: 2540 0030 movel %d0,%a2@(48) 46cde: 4eb9 0004 f05c jsr 4f05c <__errno> 46ce4: 7216 moveq #22,%d1 46ce6: 2040 moveal %d0,%a0 46ce8: 2081 movel %d1,%a0@ 46cea: 6048 bras 46d34 req = malloc (sizeof (rtems_aio_request)); 46cec: 4878 0018 pea 18 46cf0: 4eb9 0004 32b0 jsr 432b0 if (req == NULL) 46cf6: 588f addql #4,%sp 46cf8: 4a80 tstl %d0 46cfa: 661c bnes 46d18 <== ALWAYS TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 46cfc: 103c 000b moveb #11,%d0 <== NOT EXECUTED 46d00: 72ff moveq #-1,%d1 <== NOT EXECUTED 46d02: 2540 0030 movel %d0,%a2@(48) <== NOT EXECUTED 46d06: 2541 0034 movel %d1,%a2@(52) <== NOT EXECUTED 46d0a: 4eb9 0004 f05c jsr 4f05c <__errno> <== NOT EXECUTED 46d10: 2040 moveal %d0,%a0 <== NOT EXECUTED 46d12: 700b moveq #11,%d0 <== NOT EXECUTED 46d14: 2080 movel %d0,%a0@ <== NOT EXECUTED 46d16: 601c bras 46d34 <== NOT EXECUTED req->aiocbp = aiocbp; 46d18: 2040 moveal %d0,%a0 req->aiocbp->aio_lio_opcode = LIO_READ; 46d1a: 7201 moveq #1,%d1 req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 46d1c: 214a 0014 movel %a2,%a0@(20) req->aiocbp->aio_lio_opcode = LIO_READ; 46d20: 2541 002c movel %d1,%a2@(44) return rtems_aio_enqueue (req); } 46d24: 246e fffc moveal %fp@(-4),%a2 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); 46d28: 2d40 0008 movel %d0,%fp@(8) } 46d2c: 4e5e unlk %fp rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); 46d2e: 4ef9 0004 6a84 jmp 46a84 } 46d34: 246e fffc moveal %fp@(-4),%a2 46d38: 70ff moveq #-1,%d0 46d3a: 4e5e unlk %fp ... =============================================================================== 00046d50 : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 46d50: 4e56 0000 linkw %fp,#0 46d54: 2f0a movel %a2,%sp@- rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 46d56: 4878 0003 pea 3 * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 46d5a: 246e 0008 moveal %fp@(8),%a2 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 46d5e: 2f12 movel %a2@,%sp@- 46d60: 4eb9 0004 c2b0 jsr 4c2b0 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 46d66: 508f addql #8,%sp 46d68: 7203 moveq #3,%d1 46d6a: c081 andl %d1,%d0 46d6c: 123c 0001 moveb #1,%d1 46d70: 5380 subql #1,%d0 46d72: b280 cmpl %d0,%d1 46d74: 641a bccs 46d90 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 46d76: 7009 moveq #9,%d0 46d78: 72ff moveq #-1,%d1 46d7a: 2540 0030 movel %d0,%a2@(48) 46d7e: 2541 0034 movel %d1,%a2@(52) 46d82: 4eb9 0004 f05c jsr 4f05c <__errno> 46d88: 2040 moveal %d0,%a0 46d8a: 7009 moveq #9,%d0 46d8c: 2080 movel %d0,%a0@ 46d8e: 6070 bras 46e00 if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 46d90: 4aaa 0014 tstl %a2@(20) 46d94: 6702 beqs 46d98 46d96: 6006 bras 46d9e rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 46d98: 4aaa 0004 tstl %a2@(4) 46d9c: 6a1a bpls 46db8 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 46d9e: 72ff moveq #-1,%d1 46da0: 7016 moveq #22,%d0 46da2: 2541 0034 movel %d1,%a2@(52) 46da6: 2540 0030 movel %d0,%a2@(48) 46daa: 4eb9 0004 f05c jsr 4f05c <__errno> 46db0: 7216 moveq #22,%d1 46db2: 2040 moveal %d0,%a0 46db4: 2081 movel %d1,%a0@ 46db6: 6048 bras 46e00 req = malloc (sizeof (rtems_aio_request)); 46db8: 4878 0018 pea 18 46dbc: 4eb9 0004 32b0 jsr 432b0 if (req == NULL) 46dc2: 588f addql #4,%sp 46dc4: 4a80 tstl %d0 46dc6: 661c bnes 46de4 <== ALWAYS TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 46dc8: 103c 000b moveb #11,%d0 <== NOT EXECUTED 46dcc: 72ff moveq #-1,%d1 <== NOT EXECUTED 46dce: 2540 0030 movel %d0,%a2@(48) <== NOT EXECUTED 46dd2: 2541 0034 movel %d1,%a2@(52) <== NOT EXECUTED 46dd6: 4eb9 0004 f05c jsr 4f05c <__errno> <== NOT EXECUTED 46ddc: 2040 moveal %d0,%a0 <== NOT EXECUTED 46dde: 700b moveq #11,%d0 <== NOT EXECUTED 46de0: 2080 movel %d0,%a0@ <== NOT EXECUTED 46de2: 601c bras 46e00 <== NOT EXECUTED req->aiocbp = aiocbp; 46de4: 2040 moveal %d0,%a0 req->aiocbp->aio_lio_opcode = LIO_WRITE; 46de6: 7202 moveq #2,%d1 req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 46de8: 214a 0014 movel %a2,%a0@(20) req->aiocbp->aio_lio_opcode = LIO_WRITE; 46dec: 2541 002c movel %d1,%a2@(44) return rtems_aio_enqueue (req); } 46df0: 246e fffc moveal %fp@(-4),%a2 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); 46df4: 2d40 0008 movel %d0,%fp@(8) } 46df8: 4e5e unlk %fp rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); 46dfa: 4ef9 0004 6a84 jmp 46a84 } 46e00: 246e fffc moveal %fp@(-4),%a2 46e04: 70ff moveq #-1,%d0 46e06: 4e5e unlk %fp ... =============================================================================== 0004245c : #include #include int chroot( const char *path ) { 4245c: 4e56 ffac linkw %fp,#-84 42460: 2f0a movel %a2,%sp@- /* * We use the global environment for path evaluation. This makes it possible * to escape from a chroot environment referencing an unmounted file system. */ rtems_filesystem_eval_path_start_with_root_and_current( 42462: 4879 0005 c598 pea 5c598 eval_flags, &rtems_global_user_env.root_directory, &rtems_global_user_env.current_directory ); rtems_filesystem_eval_path_extract_currentloc( &ctx, &loc ); 42468: 45ee ffb0 lea %fp@(-80),%a2 /* * 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( 4246c: 4879 0005 c59c pea 5c59c 42472: 4878 0019 pea 19 42476: 2f2e 0008 movel %fp@(8),%sp@- 4247a: 486e ffc8 pea %fp@(-56) 4247e: 4eb9 0004 3750 jsr 43750 42484: 486e ffe0 pea %fp@(-32) 42488: 2f0a movel %a2,%sp@- 4248a: 4eb9 0004 3be4 jsr 43be4 &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 ); 42490: 2f0a movel %a2,%sp@- 42492: 4eb9 0004 3da4 jsr 43da4 if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { 42498: 4fef 0020 lea %sp@(32),%sp 4249c: 223c 0005 b534 movel #374068,%d1 424a2: 2040 moveal %d0,%a0 &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 ); 424a4: 2d40 ffac movel %d0,%fp@(-84) if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { 424a8: b2a8 0010 cmpl %a0@(16),%d1 424ac: 6700 0084 beqw 42532 rtems_filesystem_global_location_t *new_root_loc = 424b0: 486e ffac pea %fp@(-84) 424b4: 4eb9 0004 3d04 jsr 43d04 424ba: 2440 moveal %d0,%a2 rtems_filesystem_global_location_obtain( &new_current_loc ); rtems_filesystem_node_types_t type = (*new_root_loc->location.mt_entry->ops->node_type_h)( 424bc: 206a 0014 moveal %a2@(20),%a0 424c0: 2068 000c moveal %a0@(12),%a0 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 = 424c4: 2f00 movel %d0,%sp@- 424c6: 2068 0014 moveal %a0@(20),%a0 424ca: 4e90 jsr %a0@ (*new_root_loc->location.mt_entry->ops->node_type_h)( &new_root_loc->location ); if ( type == RTEMS_FILESYSTEM_DIRECTORY ) { 424cc: 508f addql #8,%sp 424ce: 4a80 tstl %d0 424d0: 6646 bnes 42518 sc = rtems_libio_set_private_env(); 424d2: 4eb9 0004 3108 jsr 43108 if (sc == RTEMS_SUCCESSFUL) { 424d8: 4a80 tstl %d0 424da: 6628 bnes 42504 rtems_filesystem_global_location_assign( 424dc: 2079 0005 c594 moveal 5c594 ,%a0 424e2: 5888 addql #4,%a0 424e4: 2f0a movel %a2,%sp@- 424e6: 45f9 0004 3cda lea 43cda ,%a2 424ec: 2f08 movel %a0,%sp@- 424ee: 4e92 jsr %a2@ &rtems_filesystem_root, new_root_loc ); rtems_filesystem_global_location_assign( 424f0: 2f2e ffac movel %fp@(-84),%sp@- 424f4: 2f39 0005 c594 movel 5c594 ,%sp@- 424fa: 4e92 jsr %a2@ 424fc: 4fef 0010 lea %sp@(16),%sp 42500: 95ca subal %a2,%a2 42502: 6032 bras 42536 &rtems_filesystem_current, new_current_loc ); } else { if (sc != RTEMS_UNSATISFIED) { 42504: 720d moveq #13,%d1 42506: b280 cmpl %d0,%d1 42508: 674a beqs 42554 <== NEVER TAKEN errno = ENOMEM; 4250a: 4eb9 0004 995c jsr 4995c <__errno> 42510: 720c moveq #12,%d1 42512: 2040 moveal %d0,%a0 42514: 2081 movel %d1,%a0@ 42516: 603c bras 42554 static inline void rtems_filesystem_location_error( const rtems_filesystem_location_info_t *loc, int eno ) { if ( !rtems_filesystem_location_is_null( loc ) ) { 42518: 203c 0005 b534 movel #374068,%d0 4251e: b0aa 0010 cmpl %a2@(16),%d0 42522: 6730 beqs 42554 <== NEVER TAKEN errno = eno; 42524: 4eb9 0004 995c jsr 4995c <__errno> 4252a: 2040 moveal %d0,%a0 4252c: 7014 moveq #20,%d0 4252e: 2080 movel %d0,%a0@ 42530: 6022 bras 42554 if ( rv != 0 ) { rtems_filesystem_global_location_release( new_root_loc ); } } else { rv = -1; 42532: 347c ffff moveaw #-1,%a2 } rtems_filesystem_eval_path_cleanup( &ctx ); 42536: 486e ffc8 pea %fp@(-56) 4253a: 4eb9 0004 3874 jsr 43874 if ( rv != 0 ) { 42540: 588f addql #4,%sp 42542: 4a8a tstl %a2 42544: 671a beqs 42560 rtems_filesystem_global_location_release( new_current_loc ); 42546: 2f2e ffac movel %fp@(-84),%sp@- 4254a: 4eb9 0004 3c8e jsr 43c8e 42550: 588f addql #4,%sp 42552: 600c bras 42560 rtems_filesystem_location_error( &new_root_loc->location, ENOTDIR ); rv = -1; } if ( rv != 0 ) { rtems_filesystem_global_location_release( new_root_loc ); 42554: 2f0a movel %a2,%sp@- 42556: 4eb9 0004 3c8e jsr 43c8e 4255c: 588f addql #4,%sp 4255e: 60d2 bras 42532 if ( rv != 0 ) { rtems_filesystem_global_location_release( new_current_loc ); } return rv; } 42560: 200a movel %a2,%d0 42562: 246e ffa8 moveal %fp@(-88),%a2 42566: 4e5e unlk %fp ... =============================================================================== 00045f98 : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 45f98: 4e56 ffec linkw %fp,#-20 45f9c: 222e 0008 movel %fp@(8),%d1 45fa0: 48d7 040c moveml %d2-%d3/%a2,%sp@ 45fa4: 246e 000c moveal %fp@(12),%a2 if ( !tp ) 45fa8: 4a8a tstl %a2 45faa: 660a bnes 45fb6 rtems_set_errno_and_return_minus_one( EINVAL ); 45fac: 4eb9 0004 dd90 jsr 4dd90 <__errno> 45fb2: 6000 0088 braw 4603c if ( clock_id == CLOCK_REALTIME ) { 45fb6: 7001 moveq #1,%d0 45fb8: b081 cmpl %d1,%d0 45fba: 664c bnes 46008 ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 45fbc: 4879 0006 0a18 pea 60a18 <_TOD> 45fc2: 486e fff8 pea %fp@(-8) 45fc6: 4eb9 0004 7d50 jsr 47d50 <_TOD_Get_with_nanoseconds> #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 45fcc: 2040 moveal %d0,%a0 45fce: 2410 movel %a0@,%d2 45fd0: 2628 0004 movel %a0@(4),%d3 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 45fd4: 2f3c 3b9a ca00 movel #1000000000,%sp@- 45fda: 42a7 clrl %sp@- 45fdc: 2f03 movel %d3,%sp@- 45fde: 2f02 movel %d2,%sp@- 45fe0: 4eb9 0005 b250 jsr 5b250 <__divdi3> 45fe6: 4fef 0010 lea %sp@(16),%sp 45fea: 2481 movel %d1,%a2@ _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 45fec: 2f3c 3b9a ca00 movel #1000000000,%sp@- 45ff2: 42a7 clrl %sp@- 45ff4: 2f03 movel %d3,%sp@- 45ff6: 2f02 movel %d2,%sp@- 45ff8: 4eb9 0005 b6b0 jsr 5b6b0 <__moddi3> 45ffe: 4fef 0018 lea %sp@(24),%sp 46002: 2541 0004 movel %d1,%a2@(4) 46006: 6010 bras 46018 if ( clock_id == CLOCK_REALTIME ) { _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 46008: 7004 moveq #4,%d0 4600a: b081 cmpl %d1,%d0 4600c: 660e bnes 4601c <== ALWAYS TAKEN _TOD_Get_uptime_as_timespec( tp ); 4600e: 2f0a movel %a2,%sp@- 46010: 4eb9 0004 7d9c jsr 47d9c <_TOD_Get_uptime_as_timespec> return 0; 46016: 588f addql #4,%sp 46018: 4280 clrl %d0 4601a: 6028 bras 46044 } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) { 4601c: 7002 moveq #2,%d0 4601e: b081 cmpl %d1,%d0 46020: 67ec beqs 4600e 46022: 41f9 0004 dd90 lea 4dd90 <__errno>,%a0 return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 46028: 103c 0003 moveb #3,%d0 4602c: b081 cmpl %d1,%d0 4602e: 660a bnes 4603a rtems_set_errno_and_return_minus_one( ENOSYS ); 46030: 4e90 jsr %a0@ 46032: 7258 moveq #88,%d1 46034: 2040 moveal %d0,%a0 46036: 2081 movel %d1,%a0@ 46038: 6008 bras 46042 #endif rtems_set_errno_and_return_minus_one( EINVAL ); 4603a: 4e90 jsr %a0@ 4603c: 2040 moveal %d0,%a0 4603e: 7016 moveq #22,%d0 46040: 2080 movel %d0,%a0@ 46042: 70ff moveq #-1,%d0 return 0; } 46044: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 4604a: 4e5e unlk %fp ... =============================================================================== 0005fdac : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 5fdac: 4e56 ffec linkw %fp,#-20 5fdb0: 202e 0008 movel %fp@(8),%d0 5fdb4: 48d7 040c moveml %d2-%d3/%a2,%sp@ 5fdb8: 246e 000c moveal %fp@(12),%a2 if ( !tp ) 5fdbc: 4a8a tstl %a2 5fdbe: 6602 bnes 5fdc2 <== ALWAYS TAKEN 5fdc0: 6010 bras 5fdd2 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 5fdc2: 7201 moveq #1,%d1 5fdc4: b280 cmpl %d0,%d1 5fdc6: 6660 bnes 5fe28 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 5fdc8: 207c 21da e4ff moveal #567993599,%a0 5fdce: b1d2 cmpal %a2@,%a0 5fdd0: 6508 bcss 5fdda rtems_set_errno_and_return_minus_one( EINVAL ); 5fdd2: 4eb9 0006 e674 jsr 6e674 <__errno> 5fdd8: 606e bras 5fe48 * * 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; 5fdda: 2039 0009 756a movel 9756a <_Thread_Dispatch_disable_level>,%d0 ++level; 5fde0: 5280 addql #1,%d0 _Thread_Dispatch_disable_level = level; 5fde2: 23c0 0009 756a movel %d0,9756a <_Thread_Dispatch_disable_level> Timestamp64_Control *_time, Timestamp64_Control _seconds, Timestamp64_Control _nanoseconds ) { *_time = _seconds * 1000000000L + _nanoseconds; 5fde8: 2f3c 3b9a ca00 movel #1000000000,%sp@- 5fdee: 42a7 clrl %sp@- 5fdf0: 2f12 movel %a2@,%sp@- 5fdf2: 5bc0 smi %d0 5fdf4: 49c0 extbl %d0 5fdf6: 2f00 movel %d0,%sp@- 5fdf8: 4eb9 0008 6408 jsr 86408 <__muldi3> 5fdfe: 4fef 0010 lea %sp@(16),%sp 5fe02: 204e moveal %fp,%a0 const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 5fe04: 262a 0004 movel %a2@(4),%d3 5fe08: 5bc2 smi %d2 5fe0a: 49c2 extbl %d2 5fe0c: d283 addl %d3,%d1 5fe0e: d182 addxl %d2,%d0 5fe10: 2101 movel %d1,%a0@- 5fe12: 2100 movel %d0,%a0@- &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 5fe14: 2f08 movel %a0,%sp@- 5fe16: 4eb9 0006 0c10 jsr 60c10 <_TOD_Set_with_timestamp> _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); 5fe1c: 4eb9 0004 8474 jsr 48474 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 5fe22: 588f addql #4,%sp 5fe24: 4280 clrl %d0 5fe26: 6028 bras 5fe50 5fe28: 41f9 0006 e674 lea 6e674 <__errno>,%a0 _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) 5fe2e: 7202 moveq #2,%d1 5fe30: b280 cmpl %d0,%d1 5fe32: 6602 bnes 5fe36 5fe34: 6006 bras 5fe3c rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 5fe36: 7203 moveq #3,%d1 5fe38: b280 cmpl %d0,%d1 5fe3a: 660a bnes 5fe46 rtems_set_errno_and_return_minus_one( ENOSYS ); 5fe3c: 4e90 jsr %a0@ 5fe3e: 7258 moveq #88,%d1 5fe40: 2040 moveal %d0,%a0 5fe42: 2081 movel %d1,%a0@ 5fe44: 6008 bras 5fe4e #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 5fe46: 4e90 jsr %a0@ 5fe48: 2040 moveal %d0,%a0 5fe4a: 7016 moveq #22,%d0 5fe4c: 2080 movel %d0,%a0@ 5fe4e: 70ff moveq #-1,%d0 return 0; } 5fe50: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 5fe56: 4e5e unlk %fp ... =============================================================================== 00042842 : dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { 42842: 4e56 ffdc linkw %fp,#-36 42846: 48d7 1cfc moveml %d2-%d7/%a2-%a4,%sp@ 4284a: 242e 0008 movel %fp@(8),%d2 4284e: 262e 000c movel %fp@(12),%d3 42852: 286e 0010 moveal %fp@(16),%a4 ) { union __rtems_dev_t temp; temp.device = device; return temp.__overlay.major; 42856: 2c02 movel %d2,%d6 ) { union __rtems_dev_t temp; temp.device = device; return temp.__overlay.minor; 42858: 2a03 movel %d3,%d5 rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { 4285a: 2e39 0006 1e52 movel 61e52 ,%d7 42860: be86 cmpl %d6,%d7 42862: 6252 bhis 428b6 rtems_disk_device_table *table = disktab; rtems_device_major_number old_size = disktab_size; rtems_device_major_number new_size = 2 * old_size; 42864: 2807 movel %d7,%d4 42866: d884 addl %d4,%d4 rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { rtems_disk_device_table *table = disktab; 42868: 2039 0006 1e56 movel 61e56 ,%d0 rtems_device_major_number old_size = disktab_size; rtems_device_major_number new_size = 2 * old_size; if (major >= new_size) { 4286e: b886 cmpl %d6,%d4 42870: 6204 bhis 42876 <== NEVER TAKEN new_size = major + 1; 42872: 2806 movel %d6,%d4 42874: 5284 addql #1,%d4 } table = realloc(table, new_size * sizeof(*table)); 42876: 2204 movel %d4,%d1 42878: e789 lsll #3,%d1 4287a: 2f01 movel %d1,%sp@- 4287c: 2f00 movel %d0,%sp@- 4287e: 4eb9 0004 4698 jsr 44698 if (table == NULL) { 42884: 508f addql #8,%sp if (major >= new_size) { new_size = major + 1; } table = realloc(table, new_size * sizeof(*table)); 42886: 2640 moveal %d0,%a3 if (table == NULL) { 42888: 4a80 tstl %d0 4288a: 6700 010e beqw 4299a return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 4288e: 2004 movel %d4,%d0 <== NOT EXECUTED 42890: 9087 subl %d7,%d0 <== NOT EXECUTED 42892: 2207 movel %d7,%d1 <== NOT EXECUTED 42894: e788 lsll #3,%d0 <== NOT EXECUTED 42896: e789 lsll #3,%d1 <== NOT EXECUTED 42898: 2f00 movel %d0,%sp@- <== NOT EXECUTED 4289a: 42a7 clrl %sp@- <== NOT EXECUTED 4289c: 4873 1800 pea %a3@(00000000,%d1:l) <== NOT EXECUTED 428a0: 4eb9 0005 13b4 jsr 513b4 <== NOT EXECUTED disktab = table; disktab_size = new_size; 428a6: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED if (table == NULL) { return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); disktab = table; 428aa: 23cb 0006 1e56 movel %a3,61e56 <== NOT EXECUTED disktab_size = new_size; 428b0: 23c4 0006 1e52 movel %d4,61e52 <== NOT EXECUTED } if (disktab [major].minor == NULL || minor >= disktab[major].size) { 428b6: 2479 0006 1e56 moveal 61e56 ,%a2 428bc: e78e lsll #3,%d6 428be: d5c6 addal %d6,%a2 428c0: 2012 movel %a2@,%d0 428c2: 6706 beqs 428ca 428c4: baaa 0004 cmpl %a2@(4),%d5 428c8: 654c bcss 42916 rtems_disk_device **table = disktab [major].minor; rtems_device_minor_number old_size = disktab [major].size; 428ca: 2c2a 0004 movel %a2@(4),%d6 rtems_device_minor_number new_size = 0; if (old_size == 0) { 428ce: 6706 beqs 428d6 new_size = DISKTAB_INITIAL_SIZE; } else { new_size = 2 * old_size; 428d0: 2806 movel %d6,%d4 428d2: d884 addl %d4,%d4 428d4: 6002 bras 428d8 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) { new_size = DISKTAB_INITIAL_SIZE; 428d6: 7808 moveq #8,%d4 } else { new_size = 2 * old_size; } if (minor >= new_size) { 428d8: b885 cmpl %d5,%d4 428da: 6204 bhis 428e0 new_size = minor + 1; 428dc: 2805 movel %d5,%d4 428de: 5284 addql #1,%d4 } table = realloc(table, new_size * sizeof(*table)); 428e0: 2204 movel %d4,%d1 428e2: e589 lsll #2,%d1 428e4: 2f01 movel %d1,%sp@- 428e6: 2f00 movel %d0,%sp@- 428e8: 4eb9 0004 4698 jsr 44698 if (table == NULL) { 428ee: 508f addql #8,%sp } if (minor >= new_size) { new_size = minor + 1; } table = realloc(table, new_size * sizeof(*table)); 428f0: 2640 moveal %d0,%a3 if (table == NULL) { 428f2: 4a80 tstl %d0 428f4: 6700 00a4 beqw 4299a return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 428f8: 2004 movel %d4,%d0 428fa: 9086 subl %d6,%d0 428fc: e588 lsll #2,%d0 428fe: 2f00 movel %d0,%sp@- 42900: 42a7 clrl %sp@- 42902: 4873 6c00 pea %a3@(00000000,%d6:l:4) 42906: 4eb9 0005 13b4 jsr 513b4 disktab [major].minor = table; disktab [major].size = new_size; 4290c: 4fef 000c lea %sp@(12),%sp if (table == NULL) { return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); disktab [major].minor = table; 42910: 248b movel %a3,%a2@ disktab [major].size = new_size; 42912: 2544 0004 movel %d4,%a2@(4) } return disktab [major].minor + minor; 42916: 2452 moveal %a2@,%a2 42918: e58d lsll #2,%d5 4291a: d5c5 addal %d5,%a2 { rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; if (dd_entry == NULL) { 4291c: 4a8a tstl %a2 4291e: 6602 bnes 42922 <== ALWAYS TAKEN 42920: 6078 bras 4299a <== NOT EXECUTED return RTEMS_NO_MEMORY; } if (*dd_entry != NULL) { return RTEMS_RESOURCE_IN_USE; 42922: 700c moveq #12,%d0 if (dd_entry == NULL) { return RTEMS_NO_MEMORY; } if (*dd_entry != NULL) { 42924: 4a92 tstl %a2@ 42926: 6674 bnes 4299c return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); 42928: 4878 0072 pea 72 4292c: 4eb9 0004 3c84 jsr 43c84 if (dd == NULL) { 42932: 588f addql #4,%sp if (*dd_entry != NULL) { return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); 42934: 2800 movel %d0,%d4 if (dd == NULL) { 42936: 6762 beqs 4299a <== NEVER TAKEN return RTEMS_NO_MEMORY; } if (name != NULL) { 42938: 4a8c tstl %a4 4293a: 6730 beqs 4296c alloc_name = strdup(name); 4293c: 2f0c movel %a4,%sp@- 4293e: 4eb9 0005 1998 jsr 51998 if (alloc_name == NULL) { 42944: 588f addql #4,%sp if (dd == NULL) { return RTEMS_NO_MEMORY; } if (name != NULL) { alloc_name = strdup(name); 42946: 2c00 movel %d0,%d6 42948: 2a00 movel %d0,%d5 if (alloc_name == NULL) { 4294a: 6634 bnes 42980 <== ALWAYS TAKEN free(dd); 4294c: 2f04 movel %d4,%sp@- <== NOT EXECUTED 4294e: 4eb9 0004 3810 jsr 43810 <== NOT EXECUTED return RTEMS_NO_MEMORY; 42954: 588f addql #4,%sp <== NOT EXECUTED 42956: 6042 bras 4299a <== NOT EXECUTED } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { free(alloc_name); 42958: 2f06 movel %d6,%sp@- <== NOT EXECUTED 4295a: 45f9 0004 3810 lea 43810 ,%a2 <== NOT EXECUTED 42960: 4e92 jsr %a2@ <== NOT EXECUTED free(dd); 42962: 2f04 movel %d4,%sp@- <== NOT EXECUTED 42964: 4e92 jsr %a2@ <== NOT EXECUTED return RTEMS_UNSATISFIED; 42966: 508f addql #8,%sp <== NOT EXECUTED 42968: 700d moveq #13,%d0 <== NOT EXECUTED 4296a: 6030 bras 4299c <== 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; 4296c: 4285 clrl %d5 free(dd); return RTEMS_UNSATISFIED; } } *dd_entry = dd; 4296e: 2484 movel %d4,%a2@ *dd_ptr = dd; 42970: 206e 0014 moveal %fp@(20),%a0 *alloc_name_ptr = alloc_name; return RTEMS_SUCCESSFUL; 42974: 4280 clrl %d0 return RTEMS_UNSATISFIED; } } *dd_entry = dd; *dd_ptr = dd; 42976: 2084 movel %d4,%a0@ *alloc_name_ptr = alloc_name; 42978: 206e 0018 moveal %fp@(24),%a0 4297c: 2085 movel %d5,%a0@ return RTEMS_SUCCESSFUL; 4297e: 601c bras 4299c return RTEMS_NO_MEMORY; } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { 42980: 2f03 movel %d3,%sp@- 42982: 2f02 movel %d2,%sp@- 42984: 4878 61ff pea 61ff 42988: 2f00 movel %d0,%sp@- 4298a: 4eb9 0004 3df6 jsr 43df6 42990: 4fef 0010 lea %sp@(16),%sp 42994: 4a80 tstl %d0 42996: 6cd6 bges 4296e <== ALWAYS TAKEN 42998: 60be bras 42958 <== 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; 4299a: 701a moveq #26,%d0 *dd_entry = dd; *dd_ptr = dd; *alloc_name_ptr = alloc_name; return RTEMS_SUCCESSFUL; } 4299c: 4cee 1cfc ffdc moveml %fp@(-36),%d2-%d7/%a2-%a4 429a2: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000439f0 : * 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) 439f0: 4e56 ffec linkw %fp,#-20 439f4: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 439f8: 286e 000c moveal %fp@(12),%a4 if (new_part_desc == NULL) { return RTEMS_INTERNAL_ERROR; } *new_part_desc = NULL; 439fc: 4294 clrl %a4@ if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) 439fe: 4878 0028 pea 28 43a02: 4878 0001 pea 1 * RTEMS_SUCCESSFUL, if success; * RTEMS_NO_MEMOTY, if cannot allocate memory for part_desc_t strucure; * RTEMS_INTERNAL_ERROR, if other error occurs. */ static rtems_status_code data_to_part_desc(uint8_t *data, rtems_part_desc_t **new_part_desc) 43a06: 266e 0008 moveal %fp@(8),%a3 return RTEMS_INTERNAL_ERROR; } *new_part_desc = NULL; if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) 43a0a: 4eb9 0004 4584 jsr 44584 43a10: 508f addql #8,%sp 43a12: 2440 moveal %d0,%a2 43a14: 4a80 tstl %d0 43a16: 677c beqs 43a94 <== NEVER TAKEN /* 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); 43a18: 4bfa fea6 lea %pc@(438c0 ),%a5 if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) { return RTEMS_NO_MEMORY; } part_desc->bootable = *(data + RTEMS_IDE_PARTITION_BOOTABLE_OFFSET); 43a1c: 1493 moveb %a3@,%a2@ part_desc->sys_type = *(data + RTEMS_IDE_PARTITION_SYS_TYPE_OFFSET); 43a1e: 142b 0004 moveb %a3@(4),%d2 43a22: 1542 0001 moveb %d2,%a2@(1) /* read the offset start position and partition size in sectors */ /* due to incorrect data alignment one have to align data first */ memcpy(&temp, data + RTEMS_IDE_PARTITION_START_OFFSET, sizeof(uint32_t)); part_desc->start = LE_TO_CPU_U32(temp); 43a26: 2f2b 0008 movel %a3@(8),%sp@- 43a2a: 4e95 jsr %a5@ 43a2c: 2540 0004 movel %d0,%a2@(4) memcpy(&temp, data + RTEMS_IDE_PARTITION_SIZE_OFFSET, sizeof(uint32_t)); part_desc->size = LE_TO_CPU_U32(temp); 43a30: 2eab 000c movel %a3@(12),%sp@ 43a34: 4e95 jsr %a5@ 43a36: 588f addql #4,%sp * true if partition type is extended, false otherwise */ static bool is_extended(uint8_t type) { return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED)); 43a38: 7205 moveq #5,%d1 /* 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); 43a3a: 2640 moveal %d0,%a3 43a3c: 2540 0008 movel %d0,%a2@(8) * true if partition type is extended, false otherwise */ static bool is_extended(uint8_t type) { return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED)); 43a40: 4280 clrl %d0 43a42: 1002 moveb %d2,%d0 43a44: b280 cmpl %d0,%d1 43a46: 670e beqs 43a56 43a48: 7085 moveq #-123,%d0 43a4a: b580 eorl %d2,%d0 43a4c: 4a00 tstb %d0 43a4e: 57c1 seq %d1 43a50: 49c1 extbl %d1 43a52: 4481 negl %d1 43a54: 6002 bras 43a58 43a56: 7201 moveq #1,%d1 * use partitions that are * - extended * or * - FAT type and non-zero */ if (is_extended(part_desc->sys_type) || 43a58: 0801 0000 btst #0,%d1 43a5c: 6624 bnes 43a82 DOS_P32MB_PARTITION, FAT32_PARTITION ,FAT32_LBA_PARTITION, FAT16_LBA_PARTITION }; return (NULL != memchr(fat_part_types,type,sizeof(fat_part_types))); 43a5e: 4878 0006 pea 6 43a62: 0282 0000 00ff andil #255,%d2 43a68: 2f02 movel %d2,%sp@- 43a6a: 4879 0006 0aa5 pea 60aa5 43a70: 4eb9 0005 2358 jsr 52358 43a76: 4fef 000c lea %sp@(12),%sp * use partitions that are * - extended * or * - FAT type and non-zero */ if (is_extended(part_desc->sys_type) || 43a7a: 4a80 tstl %d0 43a7c: 6708 beqs 43a86 ((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) { 43a7e: 4a8b tstl %a3 43a80: 6704 beqs 43a86 <== NEVER TAKEN *new_part_desc = part_desc; 43a82: 288a movel %a2,%a4@ 43a84: 600a bras 43a90 } else { /* empty partition */ free(part_desc); 43a86: 2f0a movel %a2,%sp@- 43a88: 4eb9 0004 4844 jsr 44844 43a8e: 588f addql #4,%sp } return RTEMS_SUCCESSFUL; 43a90: 4280 clrl %d0 43a92: 6002 bras 43a96 *new_part_desc = NULL; if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) { return RTEMS_NO_MEMORY; 43a94: 701a moveq #26,%d0 <== NOT EXECUTED else { /* empty partition */ free(part_desc); } return RTEMS_SUCCESSFUL; } 43a96: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 43a9c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00042068 : #endif #include "devfs.h" void devFS_Show(void) { 42068: 4e56 ffe8 linkw %fp,#-24 rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location; if (rootloc->mt_entry->ops == &devFS_ops) { 4206c: 203c 0005 9a4e movel #367182,%d0 #include "devfs.h" void devFS_Show(void) { rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location; 42072: 2079 0005 afbc moveal 5afbc ,%a0 if (rootloc->mt_entry->ops == &devFS_ops) { 42078: 2068 0004 moveal %a0@(4),%a0 4207c: 2068 0014 moveal %a0@(20),%a0 #endif #include "devfs.h" void devFS_Show(void) { 42080: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location; if (rootloc->mt_entry->ops == &devFS_ops) { 42084: b0a8 000c cmpl %a0@(12),%d0 42088: 6662 bnes 420ec <== NEVER TAKEN 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; 4208a: 2068 0010 moveal %a0@(16),%a0 const devFS_data *data = devFS_get_data(rootloc); size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; for (i = 0; i < n; ++i) { 4208e: 4283 clrl %d3 if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); 42090: 47f9 0004 2fec lea 42fec ,%a3 rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location; if (rootloc->mt_entry->ops == &devFS_ops) { const devFS_data *data = devFS_get_data(rootloc); size_t i = 0; size_t n = data->count; 42096: 2828 0004 movel %a0@(4),%d4 4209a: 2450 moveal %a0@,%a2 devFS_node *nodes = data->nodes; for (i = 0; i < n; ++i) { 4209c: 604a bras 420e8 devFS_node *current = nodes + i; if (current->name != NULL) { 4209e: 4a92 tstl %a2@ 420a0: 6740 beqs 420e2 size_t j = 0; size_t m = current->namelen; 420a2: 2a2a 0004 movel %a2@(4),%d5 printk("/"); 420a6: 4879 0005 9aa2 pea 59aa2 for (j = 0; j < m; ++j) { 420ac: 4282 clrl %d2 if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); 420ae: 4e93 jsr %a3@ for (j = 0; j < m; ++j) { 420b0: 588f addql #4,%sp 420b2: 6016 bras 420ca printk("%c", current->name [j]); 420b4: 2052 moveal %a2@,%a0 420b6: 1030 2800 moveb %a0@(00000000,%d2:l),%d0 if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); for (j = 0; j < m; ++j) { 420ba: 5282 addql #1,%d2 printk("%c", current->name [j]); 420bc: 49c0 extbl %d0 420be: 2f00 movel %d0,%sp@- 420c0: 4879 0005 9aa4 pea 59aa4 420c6: 4e93 jsr %a3@ if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); for (j = 0; j < m; ++j) { 420c8: 508f addql #8,%sp 420ca: ba82 cmpl %d2,%d5 420cc: 66e6 bnes 420b4 printk("%c", current->name [j]); } printk( 420ce: 2f2a 000c movel %a2@(12),%sp@- 420d2: 2f2a 0008 movel %a2@(8),%sp@- 420d6: 4879 0005 9aa7 pea 59aa7 420dc: 4e93 jsr %a3@ 420de: 4fef 000c lea %sp@(12),%sp const devFS_data *data = devFS_get_data(rootloc); size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; for (i = 0; i < n; ++i) { 420e2: 5283 addql #1,%d3 420e4: 45ea 0014 lea %a2@(20),%a2 420e8: b883 cmpl %d3,%d4 420ea: 66b2 bnes 4209e (unsigned long) current->minor ); } } } } 420ec: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 420f2: 4e5e unlk %fp ... =============================================================================== 0004ad94 : } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { 4ad94: 4e56 ffdc linkw %fp,#-36 4ad98: 48d7 3c7c moveml %d2-%d6/%a2-%a5,%sp@ 4ad9c: 246e 0008 moveal %fp@(8),%a2 ) { size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; devFS_node *node = NULL; 4ada0: 4282 clrl %d2 devFS_node *free_node = NULL; 4ada2: 97cb subal %a3,%a3 for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { 4ada4: 4284 clrl %d4 devFS_node *current = nodes + i; if (current->name != NULL) { if ( current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 4ada6: 4bf9 0004 dc88 lea 4dc88 ,%a5 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; 4adac: 206a 002c moveal %a2@(44),%a0 4adb0: 2068 0010 moveal %a0@(16),%a0 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } 4adb4: 262a 0004 movel %a2@(4),%d3 4adb8: 2a12 movel %a2@,%d5 size_t pathlen, devFS_node **free_node_ptr ) { size_t i = 0; size_t n = data->count; 4adba: 2c28 0004 movel %a0@(4),%d6 4adbe: 2850 moveal %a0@,%a4 4adc0: 6034 bras 4adf6 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) { 4adc2: 2214 movel %a4@,%d1 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; 4adc4: 200c movel %a4,%d0 if (current->name != NULL) { 4adc6: 4a81 tstl %d1 4adc8: 671c beqs 4ade6 if ( 4adca: b6ac 0004 cmpl %a4@(4),%d3 4adce: 6614 bnes 4ade4 current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 4add0: 2f03 movel %d3,%sp@- 4add2: 2f05 movel %d5,%sp@- 4add4: 2f01 movel %d1,%sp@- 4add6: 4e95 jsr %a5@ 4add8: 4fef 000c lea %sp@(12),%sp 4addc: 4a80 tstl %d0 4adde: 6702 beqs 4ade2 4ade0: 6002 bras 4ade4 4ade2: 240c movel %a4,%d2 4ade4: 200b movel %a3,%d0 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) { 4ade6: 5284 addql #1,%d4 4ade8: 4a80 tstl %d0 4adea: 6704 beqs 4adf0 4adec: 4a82 tstl %d2 4adee: 660c bnes 4adfc 4adf0: 49ec 0014 lea %a4@(20),%a4 4adf4: 2640 moveal %d0,%a3 4adf6: bc84 cmpl %d4,%d6 4adf8: 66c8 bnes 4adc2 4adfa: 6002 bras 4adfe 4adfc: 2640 moveal %d0,%a3 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } 4adfe: 202a 0010 movel %a2@(16),%d0 rtems_filesystem_eval_path_get_pathlen(ctx), &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { 4ae02: 4a82 tstl %d2 4ae04: 6712 beqs 4ae18 if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { 4ae06: 0800 0006 btst #6,%d0 4ae0a: 6606 bnes 4ae12 currentloc->node_access = node; 4ae0c: 2542 0020 movel %d2,%a2@(32) 4ae10: 6026 bras 4ae38 rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); 4ae12: 4878 0011 pea 11 4ae16: 6030 bras 4ae48 } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { 4ae18: 0800 0005 btst #5,%d0 4ae1c: 6726 beqs 4ae44 <== NEVER TAKEN if (free_node != NULL) { 4ae1e: 4a8b tstl %a3 4ae20: 671c beqs 4ae3e free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; 4ae22: 203c 0000 01ff movel #511,%d0 4ae28: 2740 0010 movel %d0,%a3@(16) currentloc->node_access = free_node; 4ae2c: 254b 0020 movel %a3,%a2@(32) rtems_filesystem_eval_path_context_t *ctx, const char *token, size_t tokenlen ) { ctx->token = token; 4ae30: 2545 0008 movel %d5,%a2@(8) ctx->tokenlen = tokenlen; 4ae34: 2543 000c movel %d3,%a2@(12) static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; 4ae38: 42aa 0004 clrl %a2@(4) 4ae3c: 6014 bras 4ae52 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); 4ae3e: 4878 001c pea 1c 4ae42: 6004 bras 4ae48 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); 4ae44: 4878 0002 pea 2 <== NOT EXECUTED 4ae48: 2f0a movel %a2,%sp@- 4ae4a: 4eb9 0004 4bda jsr 44bda 4ae50: 508f addql #8,%sp } } } 4ae52: 4cee 3c7c ffdc moveml %fp@(-36),%d2-%d6/%a2-%a5 4ae58: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00043984 : dev_t dev ) { int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { 43984: 7003 moveq #3,%d0 const char *name, size_t namelen, mode_t mode, dev_t dev ) { 43986: 4e56 ffec linkw %fp,#-20 4398a: 48d7 043c moveml %d2-%d5/%a2,%sp@ 4398e: 246e 000c moveal %fp@(12),%a2 43992: 242e 0010 movel %fp@(16),%d2 43996: 262e 0014 movel %fp@(20),%d3 4399a: 2a2e 0018 movel %fp@(24),%d5 4399e: 282e 001c movel %fp@(28),%d4 int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { 439a2: b082 cmpl %d2,%d0 439a4: 6626 bnes 439cc 439a6: 7264 moveq #100,%d1 439a8: 1012 moveb %a2@,%d0 439aa: 49c0 extbl %d0 439ac: b280 cmpl %d0,%d1 439ae: 661c bnes 439cc <== NEVER TAKEN 439b0: 123c 0065 moveb #101,%d1 439b4: 102a 0001 moveb %a2@(1),%d0 439b8: 49c0 extbl %d0 439ba: b280 cmpl %d0,%d1 439bc: 660e bnes 439cc <== NEVER TAKEN 439be: 123c 0076 moveb #118,%d1 439c2: 102a 0002 moveb %a2@(2),%d0 439c6: 49c0 extbl %d0 439c8: b280 cmpl %d0,%d1 439ca: 6762 beqs 43a2e <== ALWAYS TAKEN if (S_ISBLK(mode) || S_ISCHR(mode)) { 439cc: 2003 movel %d3,%d0 439ce: 0280 0000 f000 andil #61440,%d0 439d4: 0c80 0000 6000 cmpil #24576,%d0 439da: 6708 beqs 439e4 439dc: 0c80 0000 2000 cmpil #8192,%d0 439e2: 665a bnes 43a3e char *dupname = malloc(namelen); 439e4: 2f02 movel %d2,%sp@- 439e6: 4eb9 0004 3f5c jsr 43f5c if (dupname != NULL) { 439ec: 588f addql #4,%sp 439ee: 4a80 tstl %d0 439f0: 672e beqs 43a20 devFS_node *node = parentloc->node_access; 439f2: 206e 0008 moveal %fp@(8),%a0 439f6: 2068 0008 moveal %a0@(8),%a0 node->name = dupname; 439fa: 2080 movel %d0,%a0@ node->namelen = namelen; 439fc: 2142 0004 movel %d2,%a0@(4) node->major = rtems_filesystem_dev_major_t(dev); 43a00: 2145 0008 movel %d5,%a0@(8) node->minor = rtems_filesystem_dev_minor_t(dev); 43a04: 2144 000c movel %d4,%a0@(12) node->mode = mode; 43a08: 2143 0010 movel %d3,%a0@(16) memcpy(dupname, name, namelen); 43a0c: 2f02 movel %d2,%sp@- 43a0e: 2f0a movel %a2,%sp@- 43a10: 2f00 movel %d0,%sp@- 43a12: 4eb9 0004 dd18 jsr 4dd18 43a18: 4fef 000c lea %sp@(12),%sp size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; 43a1c: 4280 clrl %d0 43a1e: 602e bras 43a4e 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; 43a20: 4eb9 0004 ceec jsr 4ceec <__errno> 43a26: 2040 moveal %d0,%a0 43a28: 700c moveq #12,%d0 43a2a: 2080 movel %d0,%a0@ 43a2c: 601e bras 43a4c size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; 43a2e: 4280 clrl %d0 } else { errno = ENOTSUP; rv = -1; } } else { if (!S_ISDIR(mode)) { 43a30: 0283 0000 f000 andil #61440,%d3 43a36: 0c83 0000 4000 cmpil #16384,%d3 43a3c: 6710 beqs 43a4e <== ALWAYS TAKEN errno = ENOTSUP; 43a3e: 4eb9 0004 ceec jsr 4ceec <__errno> 43a44: 2040 moveal %d0,%a0 43a46: 20bc 0000 0086 movel #134,%a0@ rv = -1; 43a4c: 70ff moveq #-1,%d0 } } return rv; } 43a4e: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 43a54: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000427e6 : */ static volatile bool diskdevs_protected; static rtems_status_code disk_lock(void) { 427e6: 4e56 0000 linkw %fp,#0 rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 427ea: 42a7 clrl %sp@- 427ec: 42a7 clrl %sp@- 427ee: 2f39 0006 1e4e movel 61e4e ,%sp@- 427f4: 4eb9 0004 73a4 jsr 473a4 if (sc == RTEMS_SUCCESSFUL) { 427fa: 4fef 000c lea %sp@(12),%sp 427fe: 4a80 tstl %d0 42800: 660c bnes 4280e <== NEVER TAKEN diskdevs_protected = true; 42802: 7001 moveq #1,%d0 42804: 13c0 0006 1e4c moveb %d0,61e4c return RTEMS_SUCCESSFUL; 4280a: 4280 clrl %d0 4280c: 6002 bras 42810 } else { return RTEMS_NOT_CONFIGURED; 4280e: 7016 moveq #22,%d0 <== NOT EXECUTED } } 42810: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00042814 : static void disk_unlock(void) { 42814: 4e56 0000 linkw %fp,#0 rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; 42818: 4200 clrb %d0 sc = rtems_semaphore_release(diskdevs_mutex); 4281a: 2f39 0006 1e4e movel 61e4e ,%sp@- static void disk_unlock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; 42820: 13c0 0006 1e4c moveb %d0,61e4c sc = rtems_semaphore_release(diskdevs_mutex); 42826: 4eb9 0004 74ac jsr 474ac if (sc != RTEMS_SUCCESSFUL) { 4282c: 588f addql #4,%sp 4282e: 4a80 tstl %d0 42830: 670c beqs 4283e <== ALWAYS TAKEN /* FIXME: Error number */ rtems_fatal_error_occurred(0xdeadbeef); 42832: 2f3c dead beef movel #-559038737,%sp@- <== NOT EXECUTED 42838: 4eb9 0004 7a84 jsr 47a84 <== NOT EXECUTED } } 4283e: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004434e : { rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); 4434e: 307c 0700 moveaw #1792,%a0 44352: 2208 movel %a0,%d1 /* * Drain output queue */ static void drainOutput (struct rtems_termios_tty *tty) 44354: 4e56 fff4 linkw %fp,#-12 44358: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 4435c: 246e 0008 moveal %fp@(8),%a2 { rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); 44360: 40c0 movew %sr,%d0 44362: 8280 orl %d0,%d1 44364: 46c1 movew %d1,%sr while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { tty->rawOutBufState = rob_wait; rtems_interrupt_enable (level); sc = rtems_semaphore_obtain( 44366: 47f9 0004 62c4 lea 462c4 ,%a3 tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); 4436c: 2408 movel %a0,%d2 4436e: 602a bras 4439a rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { tty->rawOutBufState = rob_wait; 44370: 7202 moveq #2,%d1 44372: 2541 0094 movel %d1,%a2@(148) rtems_interrupt_enable (level); 44376: 46c0 movew %d0,%sr sc = rtems_semaphore_obtain( 44378: 42a7 clrl %sp@- 4437a: 42a7 clrl %sp@- 4437c: 2f2a 008c movel %a2@(140),%sp@- 44380: 4e93 jsr %a3@ tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 44382: 4fef 000c lea %sp@(12),%sp 44386: 4a80 tstl %d0 44388: 6708 beqs 44392 <== ALWAYS TAKEN rtems_fatal_error_occurred (sc); 4438a: 2f00 movel %d0,%sp@- <== NOT EXECUTED 4438c: 4eb9 0004 69f0 jsr 469f0 <== NOT EXECUTED rtems_interrupt_disable (level); 44392: 2202 movel %d2,%d1 44394: 40c0 movew %sr,%d0 44396: 8280 orl %d0,%d1 44398: 46c1 movew %d1,%sr 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) { 4439a: 206a 0084 moveal %a2@(132),%a0 4439e: 222a 0080 movel %a2@(128),%d1 443a2: b288 cmpl %a0,%d1 443a4: 66ca bnes 44370 tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } rtems_interrupt_enable (level); 443a6: 46c0 movew %d0,%sr } } 443a8: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 443ae: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00042f58 : */ int dup2( int fildes, int fildes2 ) { 42f58: 4e56 ffa8 linkw %fp,#-88 42f5c: 48d7 041c moveml %d2-%d4/%a2,%sp@ /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 42f60: 280e movel %fp,%d4 42f62: 0684 ffff ffba addil #-70,%d4 42f68: 45f9 0004 3538 lea 43538 ,%a2 42f6e: 2f04 movel %d4,%sp@- */ int dup2( int fildes, int fildes2 ) { 42f70: 242e 0008 movel %fp@(8),%d2 42f74: 262e 000c movel %fp@(12),%d3 /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 42f78: 2f02 movel %d2,%sp@- 42f7a: 4e92 jsr %a2@ if ( status == -1 ) 42f7c: 508f addql #8,%sp 42f7e: 72ff moveq #-1,%d1 42f80: b280 cmpl %d0,%d1 42f82: 6604 bnes 42f88 return -1; 42f84: 70ff moveq #-1,%d0 42f86: 601e bras 42fa6 /* * If fildes2 is not valid, then we should not do anything either. */ status = fstat( fildes2, &buf ); 42f88: 2f04 movel %d4,%sp@- 42f8a: 2f03 movel %d3,%sp@- 42f8c: 4e92 jsr %a2@ if ( status == -1 ) 42f8e: 508f addql #8,%sp 42f90: 72ff moveq #-1,%d1 42f92: b280 cmpl %d0,%d1 42f94: 67ee beqs 42f84 <== NEVER TAKEN /* * This fcntl handles everything else. */ return fcntl( fildes, F_DUPFD, fildes2 ); 42f96: 2f03 movel %d3,%sp@- 42f98: 42a7 clrl %sp@- 42f9a: 2f02 movel %d2,%sp@- 42f9c: 4eb9 0004 31c4 jsr 431c4 42fa2: 4fef 000c lea %sp@(12),%sp } 42fa6: 4cee 041c ffa8 moveml %fp@(-88),%d2-%d4/%a2 42fac: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00044efe : /* * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { 44efe: 4e56 ffec linkw %fp,#-20 44f02: 48d7 041c moveml %d2-%d4/%a2,%sp@ 44f06: 246e 000c moveal %fp@(12),%a2 if ((tty->termios.c_lflag & ECHOCTL) && 44f0a: 202a 003c movel %a2@(60),%d0 /* * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { 44f0e: 242e 0008 movel %fp@(8),%d2 if ((tty->termios.c_lflag & ECHOCTL) && 44f12: 0280 0000 0200 andil #512,%d0 /* * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { 44f18: 1202 moveb %d2,%d1 if ((tty->termios.c_lflag & ECHOCTL) && 44f1a: 4a80 tstl %d0 44f1c: 674e beqs 44f6c <== NEVER TAKEN iscntrl(c) && (c != '\t') && (c != '\n')) { 44f1e: 4280 clrl %d0 44f20: 1002 moveb %d2,%d0 * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { if ((tty->termios.c_lflag & ECHOCTL) && 44f22: 7820 moveq #32,%d4 iscntrl(c) && (c != '\t') && (c != '\n')) { 44f24: 2079 0005 d858 moveal 5d858 <__ctype_ptr__>,%a0 44f2a: 1630 0801 moveb %a0@(00000001,%d0:l),%d3 * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { if ((tty->termios.c_lflag & ECHOCTL) && 44f2e: c684 andl %d4,%d3 44f30: 4a03 tstb %d3 44f32: 6738 beqs 44f6c iscntrl(c) && (c != '\t') && (c != '\n')) { 44f34: 7609 moveq #9,%d3 44f36: b680 cmpl %d0,%d3 44f38: 6732 beqs 44f6c 44f3a: 183c 000a moveb #10,%d4 44f3e: b880 cmpl %d0,%d4 44f40: 672a beqs 44f6c char echobuf[2]; echobuf[0] = '^'; echobuf[1] = c ^ 0x40; rtems_termios_puts (echobuf, 2, tty); 44f42: 2f0a movel %a2,%sp@- 44f44: 4878 0002 pea 2 if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { char echobuf[2]; echobuf[0] = '^'; echobuf[1] = c ^ 0x40; 44f48: 163c 0040 moveb #64,%d3 rtems_termios_puts (echobuf, 2, tty); 44f4c: 486e fffe pea %fp@(-2) { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { char echobuf[2]; echobuf[0] = '^'; 44f50: 705e moveq #94,%d0 echobuf[1] = c ^ 0x40; 44f52: b782 eorl %d3,%d2 { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { char echobuf[2]; echobuf[0] = '^'; 44f54: 1d40 fffe moveb %d0,%fp@(-2) echobuf[1] = c ^ 0x40; 44f58: 1d42 ffff moveb %d2,%fp@(-1) rtems_termios_puts (echobuf, 2, tty); 44f5c: 4eb9 0004 4cd4 jsr 44cd4 44f62: 4fef 000c lea %sp@(12),%sp tty->column += 2; 44f66: 54aa 0028 addql #2,%a2@(40) 44f6a: 6010 bras 44f7c } else { oproc (c, tty); 44f6c: 2f0a movel %a2,%sp@- 44f6e: 0281 0000 00ff andil #255,%d1 44f74: 2f01 movel %d1,%sp@- 44f76: 4eba fe4a jsr %pc@(44dc2 ) 44f7a: 508f addql #8,%sp } } 44f7c: 4cee 041c ffec moveml %fp@(-20),%d2-%d4/%a2 44f82: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005edb0 : void endgrent(void) { 5edb0: 4e56 0000 linkw %fp,#0 if (group_fp != NULL) 5edb4: 2039 0009 6ac8 movel 96ac8 ,%d0 5edba: 670a beqs 5edc6 <== NEVER TAKEN fclose(group_fp); 5edbc: 2f00 movel %d0,%sp@- 5edbe: 4eb9 0006 e7b0 jsr 6e7b0 5edc4: 588f addql #4,%sp } 5edc6: 4e5e unlk %fp ... =============================================================================== 0005ec6c : void endpwent(void) { 5ec6c: 4e56 0000 linkw %fp,#0 if (passwd_fp != NULL) 5ec70: 2039 0009 69ee movel 969ee ,%d0 5ec76: 670a beqs 5ec82 <== NEVER TAKEN fclose(passwd_fp); 5ec78: 2f00 movel %d0,%sp@- 5ec7a: 4eb9 0006 e7b0 jsr 6e7b0 5ec80: 588f addql #4,%sp } 5ec82: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00044f86 : * 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) 44f86: 4e56 ffe4 linkw %fp,#-28 44f8a: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 44f8e: 246e 0008 moveal %fp@(8),%a2 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); 44f92: 47f9 0004 4cd4 lea 44cd4 ,%a3 * 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) 44f98: 262e 000c movel %fp@(12),%d3 44f9c: 6000 011e braw 450bc return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 44fa0: 5381 subql #1,%d1 44fa2: 206a 001c moveal %a2@(28),%a0 if (tty->termios.c_lflag & ECHO) { 44fa6: 202a 003c movel %a2@(60),%d0 return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 44faa: 2541 0020 movel %d1,%a2@(32) 44fae: 1430 1800 moveb %a0@(00000000,%d1:l),%d2 if (tty->termios.c_lflag & ECHO) { 44fb2: 44c0 movew %d0,%ccr 44fb4: 6a00 0102 bplw 450b8 if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { 44fb8: 4a83 tstl %d3 44fba: 6620 bnes 44fdc 44fbc: 0800 0004 btst #4,%d0 44fc0: 661a bnes 44fdc <== ALWAYS TAKEN echo (tty->termios.c_cc[VERASE], tty); 44fc2: 2d4a 000c movel %a2,%fp@(12) <== NOT EXECUTED 44fc6: 4280 clrl %d0 <== NOT EXECUTED 44fc8: 102a 0043 moveb %a2@(67),%d0 <== NOT EXECUTED } } if (!lineFlag) break; } } 44fcc: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 <== 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); 44fd2: 2d40 0008 movel %d0,%fp@(8) <== NOT EXECUTED } } if (!lineFlag) break; } } 44fd6: 4e5e unlk %fp <== 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); 44fd8: 6000 ff24 braw 44efe <== NOT EXECUTED 44fdc: 2879 0005 d858 moveal 5d858 <__ctype_ptr__>,%a4 } else if (c == '\t') { 44fe2: 7809 moveq #9,%d4 44fe4: 0282 0000 00ff andil #255,%d2 44fea: b882 cmpl %d2,%d4 44fec: 665c bnes 4504a int col = tty->read_start_column; 44fee: 242a 002c movel %a2@(44),%d2 */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { 44ff2: 2248 moveal %a0,%a1 if (tty->termios.c_lflag & ECHOCTL) 44ff4: 0280 0000 0200 andil #512,%d0 44ffa: 6026 bras 45022 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { 44ffc: 4284 clrl %d4 44ffe: 1819 moveb %a1@+,%d4 45000: 7a09 moveq #9,%d5 45002: ba84 cmpl %d4,%d5 45004: 6606 bnes 4500c col = (col | 7) + 1; 45006: 7807 moveq #7,%d4 45008: 8484 orl %d4,%d2 4500a: 6014 bras 45020 } else if (iscntrl (c)) { 4500c: 7a20 moveq #32,%d5 4500e: 1834 4801 moveb %a4@(00000001,%d4:l),%d4 45012: c885 andl %d5,%d4 45014: 4a04 tstb %d4 45016: 6708 beqs 45020 <== ALWAYS TAKEN if (tty->termios.c_lflag & ECHOCTL) 45018: 4a80 tstl %d0 <== NOT EXECUTED 4501a: 6706 beqs 45022 <== NOT EXECUTED col += 2; 4501c: 5482 addql #2,%d2 <== NOT EXECUTED 4501e: 6002 bras 45022 <== NOT EXECUTED } else { col++; 45020: 5282 addql #1,%d2 * 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) 45022: 2809 movel %a1,%d4 45024: 9888 subl %a0,%d4 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 45026: b284 cmpl %d4,%d1 45028: 66d2 bnes 44ffc 4502a: 6016 bras 45042 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 4502c: 2f0a movel %a2,%sp@- 4502e: 4878 0001 pea 1 45032: 4879 0005 c68d pea 5c68d 45038: 4e93 jsr %a3@ tty->column--; 4503a: 4fef 000c lea %sp@(12),%sp 4503e: 53aa 0028 subql #1,%a2@(40) } /* * Back up over the tab */ while (tty->column > col) { 45042: b4aa 0028 cmpl %a2@(40),%d2 45046: 6de4 blts 4502c 45048: 606e bras 450b8 rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 4504a: 5282 addql #1,%d2 4504c: 7820 moveq #32,%d4 4504e: 1234 2800 moveb %a4@(00000000,%d2:l),%d1 45052: c284 andl %d4,%d1 45054: 4a01 tstb %d1 45056: 6724 beqs 4507c <== ALWAYS TAKEN 45058: 0800 0009 btst #9,%d0 <== NOT EXECUTED 4505c: 671e beqs 4507c <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 4505e: 2f0a movel %a2,%sp@- <== NOT EXECUTED 45060: 4878 0003 pea 3 <== NOT EXECUTED 45064: 4879 0005 c68b pea 5c68b <== NOT EXECUTED 4506a: 4e93 jsr %a3@ <== NOT EXECUTED if (tty->column) 4506c: 202a 0028 movel %a2@(40),%d0 <== NOT EXECUTED 45070: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED 45074: 6706 beqs 4507c <== NOT EXECUTED tty->column--; 45076: 5380 subql #1,%d0 <== NOT EXECUTED 45078: 2540 0028 movel %d0,%a2@(40) <== NOT EXECUTED } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { 4507c: 2079 0005 d858 moveal 5d858 <__ctype_ptr__>,%a0 45082: 7a20 moveq #32,%d5 45084: 1030 2800 moveb %a0@(00000000,%d2:l),%d0 45088: c085 andl %d5,%d0 4508a: 4a00 tstb %d0 4508c: 670c beqs 4509a <== ALWAYS TAKEN 4508e: 202a 003c movel %a2@(60),%d0 <== NOT EXECUTED 45092: 0280 0000 0200 andil #512,%d0 <== NOT EXECUTED 45098: 671e beqs 450b8 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 4509a: 2f0a movel %a2,%sp@- 4509c: 4878 0003 pea 3 450a0: 4879 0005 c68b pea 5c68b 450a6: 4e93 jsr %a3@ if (tty->column) 450a8: 202a 0028 movel %a2@(40),%d0 450ac: 4fef 000c lea %sp@(12),%sp 450b0: 6706 beqs 450b8 <== NEVER TAKEN tty->column--; 450b2: 5380 subql #1,%d0 450b4: 2540 0028 movel %d0,%a2@(40) } } } if (!lineFlag) 450b8: 4a83 tstl %d3 450ba: 6708 beqs 450c4 echo ('\n', tty); return; } } while (tty->ccount) { 450bc: 222a 0020 movel %a2@(32),%d1 450c0: 6600 fede bnew 44fa0 } } if (!lineFlag) break; } } 450c4: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 450ca: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004fd48 : 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); 4fd48: 4281 clrl %d1 4fd4a: 4280 clrl %d0 int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { 4fd4c: 4e56 fff0 linkw %fp,#-16 4fd50: 48d7 041c moveml %d2-%d4/%a2,%sp@ 4fd54: 246e 0008 moveal %fp@(8),%a2 4fd58: 122a 0002 moveb %a2@(2),%d1 4fd5c: 102a 000c moveb %a2@(12),%d0 4fd60: 9081 subl %d1,%d0 4fd62: 242e 000c movel %fp@(12),%d2 4fd66: 2802 movel %d2,%d4 4fd68: e0ac lsrl %d0,%d4 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); 4fd6a: 2604 movel %d4,%d3 4fd6c: e1ab lsll %d0,%d3 4fd6e: 2003 movel %d3,%d0 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 - 4fd70: 2602 movel %d2,%d3 4fd72: 9680 subl %d0,%d3 fat_block_num_to_sector_num (fs_info, fat_sector_num_to_block_num (fs_info, sector))) << fs_info->vol.sec_log2); 4fd74: e3ab lsll %d1,%d3 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) 4fd76: 4a2a 007f tstb %a2@(127) 4fd7a: 6706 beqs 4fd82 4fd7c: b4aa 007a cmpl %a2@(122),%d2 4fd80: 6760 beqs 4fde2 { fat_buf_release(fs_info); 4fd82: 2f0a movel %a2,%sp@- 4fd84: 4eb9 0004 fbaa jsr 4fbaa if (op_type == FAT_OP_TYPE_READ) 4fd8a: 588f addql #4,%sp 4fd8c: 200a movel %a2,%d0 4fd8e: 0680 0000 0080 addil #128,%d0 4fd94: 7201 moveq #1,%d1 4fd96: b2ae 0010 cmpl %fp@(16),%d1 4fd9a: 6610 bnes 4fdac sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 4fd9c: 2f00 movel %d0,%sp@- 4fd9e: 2f04 movel %d4,%sp@- 4fda0: 2f2a 005a movel %a2@(90),%sp@- 4fda4: 4eb9 0004 e088 jsr 4e088 4fdaa: 600e bras 4fdba else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); 4fdac: 2f00 movel %d0,%sp@- 4fdae: 2f04 movel %d4,%sp@- 4fdb0: 2f2a 005a movel %a2@(90),%sp@- 4fdb4: 4eb9 0004 dfca jsr 4dfca 4fdba: 4fef 000c lea %sp@(12),%sp if (sc != RTEMS_SUCCESSFUL) 4fdbe: 4a80 tstl %d0 4fdc0: 6710 beqs 4fdd2 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EIO); 4fdc2: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 4fdc8: 7405 moveq #5,%d2 <== NOT EXECUTED 4fdca: 2040 moveal %d0,%a0 <== NOT EXECUTED 4fdcc: 70ff moveq #-1,%d0 <== NOT EXECUTED 4fdce: 2082 movel %d2,%a0@ <== NOT EXECUTED 4fdd0: 6020 bras 4fdf2 <== NOT EXECUTED fs_info->c.blk_num = sec_num; 4fdd2: 2542 007a movel %d2,%a2@(122) fs_info->c.modified = 0; 4fdd6: 4200 clrb %d0 fs_info->c.state = FAT_CACHE_ACTUAL; 4fdd8: 7201 moveq #1,%d1 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; fs_info->c.modified = 0; 4fdda: 1540 007e moveb %d0,%a2@(126) fs_info->c.state = FAT_CACHE_ACTUAL; 4fdde: 1541 007f moveb %d1,%a2@(127) } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; 4fde2: 226a 0080 moveal %a2@(128),%a1 4fde6: d6a9 001a addl %a1@(26),%d3 return RC_OK; 4fdea: 4280 clrl %d0 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]; 4fdec: 206e 0014 moveal %fp@(20),%a0 4fdf0: 2083 movel %d3,%a0@ return RC_OK; } 4fdf2: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 4fdf8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004fbaa : return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 4fbaa: 4e56 ffd4 linkw %fp,#-44 4fbae: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4fbb2: 246e 0008 moveal %fp@(8),%a2 rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 4fbb6: 4a2a 007f tstb %a2@(127) 4fbba: 6700 0180 beqw 4fd3c return RC_OK; if (fs_info->c.modified) 4fbbe: 4a2a 007e tstb %a2@(126) 4fbc2: 6700 0152 beqw 4fd16 { uint32_t sec_num = fs_info->c.blk_num; bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 4fbc6: 4281 clrl %d1 4fbc8: 322a 0018 movew %a2@(24),%d1 if (fs_info->c.state == FAT_CACHE_EMPTY) return RC_OK; if (fs_info->c.modified) { uint32_t sec_num = fs_info->c.blk_num; 4fbcc: 202a 007a movel %a2@(122),%d0 bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 4fbd0: b280 cmpl %d0,%d1 4fbd2: 620c bhis 4fbe0 <== NEVER TAKEN 4fbd4: b0aa 001e cmpl %a2@(30),%d0 4fbd8: 55c1 scs %d1 4fbda: 49c1 extbl %d1 4fbdc: 4481 negl %d1 4fbde: 6002 bras 4fbe2 4fbe0: 4281 clrl %d1 <== NOT EXECUTED 4fbe2: 7601 moveq #1,%d3 4fbe4: c681 andl %d1,%d3 uint32_t ino ) { return (ino >= fs_info->uino_base); } 4fbe6: 182a 0002 moveb %a2@(2),%d4 4fbea: 122a 000c moveb %a2@(12),%d1 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) 4fbee: 4a03 tstb %d3 4fbf0: 673c beqs 4fc2e 4fbf2: 4a2a 004e tstb %a2@(78) 4fbf6: 6636 bnes 4fc2e <== NEVER TAKEN 4fbf8: 2400 movel %d0,%d2 memcpy(fs_info->sec_buf, 4fbfa: 4285 clrl %d5 4fbfc: 0284 0000 00ff andil #255,%d4 4fc02: 0281 0000 00ff andil #255,%d1 fs_info->c.buf->buffer + blk_ofs, 4fc08: 206a 0080 moveal %a2@(128),%a0 4fc0c: 9284 subl %d4,%d1 4fc0e: e2aa lsrl %d1,%d2 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); 4fc10: e3aa lsll %d1,%d2 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, 4fc12: 3a12 movew %a2@,%d5 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 - 4fc14: 9082 subl %d2,%d0 fat_block_num_to_sector_num (fs_info, fat_sector_num_to_block_num (fs_info, sector))) << fs_info->vol.sec_log2); 4fc16: e9a8 lsll %d4,%d0 4fc18: 2f05 movel %d5,%sp@- 4fc1a: d0a8 001a addl %a0@(26),%d0 4fc1e: 2f00 movel %d0,%sp@- 4fc20: 2f2a 0084 movel %a2@(132),%sp@- 4fc24: 4eb9 0005 7dd0 jsr 57dd0 4fc2a: 4fef 000c lea %sp@(12),%sp fs_info->c.buf->buffer + blk_ofs, fs_info->vol.bps); sc = rtems_bdbuf_release_modified(fs_info->c.buf); 4fc2e: 2f2a 0080 movel %a2@(128),%sp@- 4fc32: 2a3c 0004 e2b6 movel #320182,%d5 4fc38: 2045 moveal %d5,%a0 4fc3a: 4e90 jsr %a0@ if (sc != RTEMS_SUCCESSFUL) 4fc3c: 588f addql #4,%sp 4fc3e: 4a80 tstl %d0 4fc40: 6704 beqs 4fc46 <== ALWAYS TAKEN 4fc42: 6000 00e2 braw 4fd26 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); fs_info->c.modified = 0; 4fc46: 4200 clrb %d0 4fc48: 1540 007e moveb %d0,%a2@(126) if (sec_of_fat && !fs_info->vol.mirror) 4fc4c: 4a03 tstb %d3 4fc4e: 6700 00e6 beqw 4fd36 4fc52: 4a2a 004e tstb %a2@(78) 4fc56: 6700 0094 beqw 4fcec 4fc5a: 6000 00da braw 4fd36 <== 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, 4fc5e: 41ea 001a lea %a2@(26),%a0 4fc62: 4c10 2800 mulsl %a0@,%d2 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); 4fc66: 4286 clrl %d6 4fc68: 4280 clrl %d0 4fc6a: 1c2a 0002 moveb %a2@(2),%d6 4fc6e: 102a 000c moveb %a2@(12),%d0 4fc72: d4aa 007a addl %a2@(122),%d2 4fc76: 9086 subl %d6,%d0 4fc78: 2202 movel %d2,%d1 4fc7a: e0a9 lsrl %d0,%d1 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); 4fc7c: 2e01 movel %d1,%d7 4fc7e: e1af lsll %d0,%d7 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 - 4fc80: 9487 subl %d7,%d2 fat_block_num_to_sector_num (fs_info, fat_sector_num_to_block_num (fs_info, sector))) << fs_info->vol.sec_log2); 4fc82: edaa lsll %d6,%d2 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 4fc84: 661a bnes 4fca0 <== ALWAYS TAKEN && fs_info->vol.bps == fs_info->vol.bytes_per_block) 4fc86: 4286 clrl %d6 <== NOT EXECUTED 4fc88: 4280 clrl %d0 <== NOT EXECUTED 4fc8a: 3c12 movew %a2@,%d6 <== NOT EXECUTED 4fc8c: 302a 000a movew %a2@(10),%d0 <== NOT EXECUTED 4fc90: b086 cmpl %d6,%d0 <== NOT EXECUTED 4fc92: 660c bnes 4fca0 <== NOT EXECUTED { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); 4fc94: 2f04 movel %d4,%sp@- <== NOT EXECUTED 4fc96: 2f01 movel %d1,%sp@- <== NOT EXECUTED 4fc98: 2f2a 005a movel %a2@(90),%sp@- <== NOT EXECUTED 4fc9c: 4e94 jsr %a4@ <== NOT EXECUTED 4fc9e: 600a bras 4fcaa <== NOT EXECUTED } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); 4fca0: 2f04 movel %d4,%sp@- 4fca2: 2f01 movel %d1,%sp@- 4fca4: 2f2a 005a movel %a2@(90),%sp@- 4fca8: 4e93 jsr %a3@ 4fcaa: 4fef 000c lea %sp@(12),%sp } if ( sc != RTEMS_SUCCESSFUL) 4fcae: 4a80 tstl %d0 4fcb0: 6702 beqs 4fcb4 <== ALWAYS TAKEN 4fcb2: 6026 bras 4fcda <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); 4fcb4: 4280 clrl %d0 4fcb6: 3012 movew %a2@,%d0 4fcb8: 206e fffc moveal %fp@(-4),%a0 4fcbc: 2f00 movel %d0,%sp@- 4fcbe: 2f2a 0084 movel %a2@(132),%sp@- 4fcc2: d4a8 001a addl %a0@(26),%d2 4fcc6: 2f02 movel %d2,%sp@- 4fcc8: 4e95 jsr %a5@ sc = rtems_bdbuf_release_modified(bd); 4fcca: 2f2e fffc movel %fp@(-4),%sp@- 4fcce: 2045 moveal %d5,%a0 4fcd0: 4e90 jsr %a0@ if ( sc != RTEMS_SUCCESSFUL) 4fcd2: 4fef 0010 lea %sp@(16),%sp 4fcd6: 4a80 tstl %d0 4fcd8: 670e beqs 4fce8 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(ENOMEM); 4fcda: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 4fce0: 720c moveq #12,%d1 <== NOT EXECUTED 4fce2: 2040 moveal %d0,%a0 <== NOT EXECUTED 4fce4: 2081 movel %d1,%a0@ <== NOT EXECUTED 4fce6: 604a bras 4fd32 <== NOT EXECUTED if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 4fce8: 5283 addql #1,%d3 4fcea: 6018 bras 4fd04 { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); 4fcec: 280e movel %fp,%d4 4fcee: 5984 subql #4,%d4 4fcf0: 47f9 0004 e088 lea 4e088 ,%a3 0); if (blk_ofs == 0 && fs_info->vol.bps == fs_info->vol.bytes_per_block) { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); 4fcf6: 49f9 0004 dfca lea 4dfca ,%a4 { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); } if ( sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); 4fcfc: 4bf9 0005 7dd0 lea 57dd0 ,%a5 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) 4fd02: 7601 moveq #1,%d3 { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 4fd04: 4280 clrl %d0 4fd06: 102a 000d moveb %a2@(13),%d0 4fd0a: 4282 clrl %d2 4fd0c: 1403 moveb %d3,%d2 4fd0e: b082 cmpl %d2,%d0 4fd10: 6200 ff4c bhiw 4fc5e 4fd14: 6020 bras 4fd36 } } } else { sc = rtems_bdbuf_release(fs_info->c.buf); 4fd16: 2f2a 0080 movel %a2@(128),%sp@- 4fd1a: 4eb9 0004 e214 jsr 4e214 if (sc != RTEMS_SUCCESSFUL) 4fd20: 588f addql #4,%sp 4fd22: 4a80 tstl %d0 4fd24: 6710 beqs 4fd36 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EIO); 4fd26: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 4fd2c: 2040 moveal %d0,%a0 <== NOT EXECUTED 4fd2e: 7005 moveq #5,%d0 <== NOT EXECUTED 4fd30: 2080 movel %d0,%a0@ <== NOT EXECUTED 4fd32: 70ff moveq #-1,%d0 <== NOT EXECUTED 4fd34: 6008 bras 4fd3e <== NOT EXECUTED } fs_info->c.state = FAT_CACHE_EMPTY; 4fd36: 4200 clrb %d0 4fd38: 1540 007f moveb %d0,%a2@(127) 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; 4fd3c: 4280 clrl %d0 if (sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(EIO); } fs_info->c.state = FAT_CACHE_EMPTY; return RC_OK; } 4fd3e: 4cee 3cfc ffd4 moveml %fp@(-44),%d2-%d7/%a2-%a5 4fd44: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004fb50 : void *buff); static inline uint32_t fat_cluster_num_to_block_num (const fat_fs_info_t *fs_info, uint32_t cln) { 4fb50: 4e56 0000 linkw %fp,#0 4fb54: 206e 0008 moveal %fp@(8),%a0 4fb58: 2f03 movel %d3,%sp@- 4fb5a: 202e 000c movel %fp@(12),%d0 4fb5e: 2f02 movel %d2,%sp@- 4fb60: 4282 clrl %d2 4fb62: 1428 0002 moveb %a0@(2),%d2 uint32_t blk; if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 4fb66: 4a80 tstl %d0 4fb68: 661c bnes 4fb86 4fb6a: 7603 moveq #3,%d3 4fb6c: 1228 000e moveb %a0@(14),%d1 4fb70: c283 andl %d3,%d1 4fb72: 4a01 tstb %d1 4fb74: 6710 beqs 4fb86 <== 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); 4fb76: 4281 clrl %d1 4fb78: 1228 000c moveb %a0@(12),%d1 4fb7c: 9282 subl %d2,%d1 4fb7e: 2028 001e movel %a0@(30),%d0 4fb82: e2a8 lsrl %d1,%d0 4fb84: 601c bras 4fba2 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); 4fb86: 4283 clrl %d3 4fb88: 4281 clrl %d1 4fb8a: 1628 000c moveb %a0@(12),%d3 4fb8e: 1228 0008 moveb %a0@(8),%d1 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; 4fb92: 5580 subql #2,%d0 blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); 4fb94: 9283 subl %d3,%d1 4fb96: 9682 subl %d2,%d3 4fb98: e3a8 lsll %d1,%d0 4fb9a: 2228 0030 movel %a0@(48),%d1 4fb9e: e6a9 lsrl %d3,%d1 blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); 4fba0: d081 addl %d1,%d0 } return blk; } 4fba2: 241f movel %sp@+,%d2 4fba4: 261f movel %sp@+,%d3 4fba6: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004f05c : static inline uint32_t fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { 4f05c: 4e56 0000 linkw %fp,#0 4f060: 206e 0008 moveal %fp@(8),%a0 4f064: 202e 000c movel %fp@(12),%d0 4f068: 2f02 movel %d2,%sp@- if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 4f06a: 4a80 tstl %d0 4f06c: 6612 bnes 4f080 <== NEVER TAKEN 4f06e: 7403 moveq #3,%d2 4f070: 1228 000e moveb %a0@(14),%d1 4f074: c282 andl %d2,%d1 4f076: 4a01 tstb %d1 4f078: 6706 beqs 4f080 <== NEVER TAKEN return fs_info->vol.rdir_loc; 4f07a: 2028 001e movel %a0@(30),%d0 4f07e: 600e bras 4f08e return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 4f080: 4281 clrl %d1 <== NOT EXECUTED 4f082: 1228 0005 moveb %a0@(5),%d1 <== NOT EXECUTED 4f086: 5580 subql #2,%d0 <== NOT EXECUTED 4f088: e3a8 lsll %d1,%d0 <== NOT EXECUTED 4f08a: d0a8 0030 addl %a0@(48),%d0 <== NOT EXECUTED fs_info->vol.data_fsec); } 4f08e: 241f movel %sp@+,%d2 4f090: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004ff10 : const uint32_t offset, const uint32_t count, const uint8_t pattern) { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 4ff10: 4280 clrl %d0 <== NOT EXECUTED fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 4ff12: 4e56 ffd0 linkw %fp,#-48 <== NOT EXECUTED 4ff16: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ <== NOT EXECUTED 4ff1a: 246e 0008 moveal %fp@(8),%a2 <== NOT EXECUTED ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 4ff1e: 302a 0006 movew %a2@(6),%d0 <== NOT EXECUTED fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 4ff22: 2e2e 0010 movel %fp@(16),%d7 <== NOT EXECUTED ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 4ff26: 9087 subl %d7,%d0 <== NOT EXECUTED 4ff28: 242e 0014 movel %fp@(20),%d2 <== NOT EXECUTED fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 4ff2c: 162e 001b moveb %fp@(27),%d3 <== NOT EXECUTED ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 4ff30: b082 cmpl %d2,%d0 <== NOT EXECUTED 4ff32: 6402 bccs 4ff36 <== NOT EXECUTED 4ff34: 2400 movel %d0,%d2 <== NOT EXECUTED uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); 4ff36: 2f2e 000c movel %fp@(12),%sp@- <== NOT EXECUTED uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; 4ff3a: 2a07 movel %d7,%d5 <== NOT EXECUTED uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ssize_t bytes_written = 0; 4ff3c: 4286 clrl %d6 <== NOT EXECUTED 4ff3e: 47ee fffc lea %fp@(-4),%a3 <== NOT EXECUTED else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); if (RC_OK == rc) { memset(blk_buf + offset, pattern, bytes_to_write); 4ff42: 4bf9 0005 7e40 lea 57e40 ,%a5 <== NOT EXECUTED if (bytes_to_write == fs_info->vol.bytes_per_block) { 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); 4ff48: 49f9 0004 fd48 lea 4fd48 ,%a4 <== NOT EXECUTED const uint32_t count, 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); 4ff4e: 2f0a movel %a2,%sp@- <== NOT EXECUTED else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); if (RC_OK == rc) { memset(blk_buf + offset, pattern, bytes_to_write); 4ff50: 0283 0000 00ff andil #255,%d3 <== NOT EXECUTED const uint32_t count, 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); 4ff56: 4eba fbf8 jsr %pc@(4fb50 )<== NOT EXECUTED 4ff5a: 508f addql #8,%sp <== NOT EXECUTED uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; 4ff5c: 4281 clrl %d1 <== NOT EXECUTED 4ff5e: 122a 000c moveb %a2@(12),%d1 <== NOT EXECUTED 4ff62: e2ad lsrl %d1,%d5 <== NOT EXECUTED uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 4ff64: 2805 movel %d5,%d4 <== NOT EXECUTED ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; 4ff66: da80 addl %d0,%d5 <== NOT EXECUTED { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 4ff68: e3ac lsll %d1,%d4 <== NOT EXECUTED else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); if (RC_OK == rc) { memset(blk_buf + offset, pattern, bytes_to_write); 4ff6a: 2d43 fff8 movel %d3,%fp@(-8) <== NOT EXECUTED { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 4ff6e: 9e84 subl %d4,%d7 <== NOT EXECUTED 4ff70: 6000 0082 braw 4fff4 <== NOT EXECUTED cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) { uint32_t c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 4ff74: 4280 clrl %d0 <== NOT EXECUTED 4ff76: 302a 000a movew %a2@(10),%d0 <== NOT EXECUTED 4ff7a: 2240 moveal %d0,%a1 <== NOT EXECUTED 4ff7c: 9087 subl %d7,%d0 <== NOT EXECUTED 4ff7e: 2600 movel %d0,%d3 <== NOT EXECUTED 4ff80: b480 cmpl %d0,%d2 <== NOT EXECUTED 4ff82: 6402 bccs 4ff86 <== NOT EXECUTED 4ff84: 2602 movel %d2,%d3 <== 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)); 4ff86: 2803 movel %d3,%d4 <== NOT EXECUTED 4ff88: b083 cmpl %d3,%d0 <== NOT EXECUTED 4ff8a: 6402 bccs 4ff8e <== NOT EXECUTED 4ff8c: 2800 movel %d0,%d4 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 4ff8e: 122a 0002 moveb %a2@(2),%d1 <== NOT EXECUTED 4ff92: 102a 000c moveb %a2@(12),%d0 <== NOT EXECUTED 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) 4ff96: 4a84 tstl %d4 <== NOT EXECUTED 4ff98: 6768 beqs 50002 <== NOT EXECUTED 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); 4ff9a: 0281 0000 00ff andil #255,%d1 <== NOT EXECUTED 4ffa0: 0280 0000 00ff andil #255,%d0 <== NOT EXECUTED 4ffa6: 9081 subl %d1,%d0 <== NOT EXECUTED 4ffa8: 2205 movel %d5,%d1 <== NOT EXECUTED 4ffaa: e1a9 lsll %d0,%d1 <== NOT EXECUTED 4ffac: 2001 movel %d1,%d0 <== NOT EXECUTED { if (bytes_to_write == fs_info->vol.bytes_per_block) 4ffae: b3c4 cmpal %d4,%a1 <== NOT EXECUTED 4ffb0: 6608 bnes 4ffba <== NOT EXECUTED { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 4ffb2: 2f0b movel %a3,%sp@- <== NOT EXECUTED 4ffb4: 4878 0002 pea 2 <== NOT EXECUTED 4ffb8: 6006 bras 4ffc0 <== NOT EXECUTED } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); 4ffba: 2f0b movel %a3,%sp@- <== NOT EXECUTED 4ffbc: 4878 0001 pea 1 <== NOT EXECUTED 4ffc0: 2f00 movel %d0,%sp@- <== NOT EXECUTED 4ffc2: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4ffc4: 4e94 jsr %a4@ <== NOT EXECUTED 4ffc6: 4fef 0010 lea %sp@(16),%sp <== NOT EXECUTED if (RC_OK == rc) 4ffca: 4a80 tstl %d0 <== NOT EXECUTED 4ffcc: 661a bnes 4ffe8 <== NOT EXECUTED { memset(blk_buf + offset, pattern, bytes_to_write); 4ffce: 2f04 movel %d4,%sp@- <== NOT EXECUTED 4ffd0: 2f2e fff8 movel %fp@(-8),%sp@- <== NOT EXECUTED 4ffd4: deae fffc addl %fp@(-4),%d7 <== NOT EXECUTED 4ffd8: 2f07 movel %d7,%sp@- <== NOT EXECUTED 4ffda: 4e95 jsr %a5@ <== NOT EXECUTED } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 4ffdc: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED 4ffe0: 7001 moveq #1,%d0 <== NOT EXECUTED 4ffe2: 1540 007e moveb %d0,%a2@(126) <== NOT EXECUTED 4ffe6: 601a bras 50002 <== NOT EXECUTED fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) 4ffe8: b083 cmpl %d3,%d0 <== NOT EXECUTED 4ffea: 6612 bnes 4fffe <== NOT EXECUTED rc = -1; else { bytes_to_write -= ret; 4ffec: 9483 subl %d3,%d2 <== NOT EXECUTED bytes_written += ret; 4ffee: dc83 addl %d3,%d6 <== NOT EXECUTED ++cur_blk; 4fff0: 5285 addql #1,%d5 <== NOT EXECUTED 4fff2: 4287 clrl %d7 <== NOT EXECUTED ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) 4fff4: 4a82 tstl %d2 <== NOT EXECUTED 4fff6: 6600 ff7c bnew 4ff74 <== NOT EXECUTED 4fffa: 2006 movel %d6,%d0 <== NOT EXECUTED 4fffc: 6008 bras 50006 <== NOT EXECUTED fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) 4fffe: 70ff moveq #-1,%d0 <== NOT EXECUTED 50000: 6004 bras 50006 <== NOT EXECUTED } } if (RC_OK != rc) return rc; else return bytes_to_write; 50002: 2004 movel %d4,%d0 <== NOT EXECUTED 50004: 60e2 bras 4ffe8 <== NOT EXECUTED } if (RC_OK != rc) return rc; else return bytes_written; } 50006: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5 <== NOT EXECUTED 5000c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00050010 : const uint32_t count, const void *buff, const bool overwrite_cluster) { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 50010: 4280 clrl %d0 const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 50012: 4e56 ffd0 linkw %fp,#-48 50016: 122e 001f moveb %fp@(31),%d1 5001a: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 5001e: 246e 0008 moveal %fp@(8),%a2 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 50022: 302a 0006 movew %a2@(6),%d0 const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 50026: 2e2e 0010 movel %fp@(16),%d7 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 5002a: 9087 subl %d7,%d0 const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 5002c: 1d41 fffb moveb %d1,%fp@(-5) ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 50030: 242e 0014 movel %fp@(20),%d2 50034: b082 cmpl %d2,%d0 50036: 6402 bccs 5003a <== ALWAYS TAKEN 50038: 2400 movel %d0,%d2 <== NOT EXECUTED uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); 5003a: 2f2e 000c movel %fp@(12),%sp@- uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); 5003e: 2c07 movel %d7,%d6 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ssize_t bytes_written = 0; 50040: 4285 clrl %d5 50042: 47ee fffc lea %fp@(-4),%a3 else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); if (RC_OK == rc) { memcpy(blk_buf + offset, buf, bytes_to_write); 50046: 4bf9 0005 7dd0 lea 57dd0 ,%a5 if (0 < bytes_to_write) { if ( overwrite_block || (bytes_to_write == fs_info->vol.bytes_per_block)) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 5004c: 49f9 0004 fd48 lea 4fd48 ,%a4 const void *buff, 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); 50052: 2f0a movel %a2,%sp@- 50054: 4eba fafa jsr %pc@(4fb50 ) 50058: 508f addql #8,%sp uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); 5005a: 4281 clrl %d1 5005c: 122a 000c moveb %a2@(12),%d1 50060: e2ae lsrl %d1,%d6 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 50062: 2606 movel %d6,%d3 ssize_t bytes_written = 0; uint8_t *buffer = (uint8_t*)buff; ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; 50064: dc80 addl %d0,%d6 { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 50066: e3ab lsll %d1,%d3 50068: 9e83 subl %d3,%d7 5006a: 6000 008c braw 500f8 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)); 5006e: 4280 clrl %d0 50070: 302a 000a movew %a2@(10),%d0 50074: 2240 moveal %d0,%a1 50076: 9087 subl %d7,%d0 50078: 2600 movel %d0,%d3 5007a: b480 cmpl %d0,%d2 5007c: 6402 bccs 50080 5007e: 2602 movel %d2,%d3 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)); 50080: 2803 movel %d3,%d4 50082: b083 cmpl %d3,%d0 50084: 6402 bccs 50088 <== ALWAYS TAKEN 50086: 2800 movel %d0,%d4 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 50088: 122a 0002 moveb %a2@(2),%d1 5008c: 102a 000c moveb %a2@(12),%d0 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) 50090: 4a84 tstl %d4 50092: 6772 beqs 50106 <== 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); 50094: 0281 0000 00ff andil #255,%d1 5009a: 0280 0000 00ff andil #255,%d0 500a0: 9081 subl %d1,%d0 500a2: 2206 movel %d6,%d1 500a4: e1a9 lsll %d0,%d1 500a6: 2001 movel %d1,%d0 { if ( overwrite_block 500a8: 4a2e fffb tstb %fp@(-5) 500ac: 6604 bnes 500b2 || (bytes_to_write == fs_info->vol.bytes_per_block)) 500ae: b3c4 cmpal %d4,%a1 500b0: 6608 bnes 500ba { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 500b2: 2f0b movel %a3,%sp@- 500b4: 4878 0002 pea 2 500b8: 6006 bras 500c0 } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); 500ba: 2f0b movel %a3,%sp@- 500bc: 4878 0001 pea 1 500c0: 2f00 movel %d0,%sp@- 500c2: 2f0a movel %a2,%sp@- 500c4: 4e94 jsr %a4@ 500c6: 4fef 0010 lea %sp@(16),%sp if (RC_OK == rc) 500ca: 4a80 tstl %d0 500cc: 661e bnes 500ec <== NEVER TAKEN { memcpy(blk_buf + offset, buf, bytes_to_write); 500ce: 206e 0018 moveal %fp@(24),%a0 500d2: deae fffc addl %fp@(-4),%d7 500d6: 2f04 movel %d4,%sp@- 500d8: 4870 5800 pea %a0@(00000000,%d5:l) 500dc: 2f07 movel %d7,%sp@- 500de: 4e95 jsr %a5@ } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 500e0: 4fef 000c lea %sp@(12),%sp 500e4: 7001 moveq #1,%d0 500e6: 1540 007e moveb %d0,%a2@(126) 500ea: 601a bras 50106 cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) 500ec: b083 cmpl %d3,%d0 500ee: 6612 bnes 50102 <== NEVER TAKEN rc = -1; else { bytes_to_write -= ret; 500f0: 9483 subl %d3,%d2 bytes_written += ret; 500f2: da83 addl %d3,%d5 ++cur_blk; 500f4: 5286 addql #1,%d6 500f6: 4287 clrl %d7 uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) 500f8: 4a82 tstl %d2 500fa: 6600 ff72 bnew 5006e 500fe: 2005 movel %d5,%d0 50100: 6008 bras 5010a cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) 50102: 70ff moveq #-1,%d0 <== NOT EXECUTED 50104: 6004 bras 5010a <== NOT EXECUTED } } if (RC_OK != rc) return rc; else return bytes_to_write; 50106: 2004 movel %d4,%d0 50108: 60e2 bras 500ec } if (RC_OK != rc) return rc; else return bytes_written; } 5010a: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5 50110: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004f51e : /* * 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) 4f51e: 7201 moveq #1,%d1 int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 4f520: 4e56 0000 linkw %fp,#0 4f524: 2f0a movel %a2,%sp@- 4f526: 246e 000c moveal %fp@(12),%a2 4f52a: 2f02 movel %d2,%sp@- 4f52c: 242e 0008 movel %fp@(8),%d2 /* * 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) 4f530: 202a 0008 movel %a2@(8),%d0 4f534: b280 cmpl %d0,%d1 4f536: 640c bccs 4f544 { fat_fd->links_num--; 4f538: 5380 subql #1,%d0 4f53a: 2540 0008 movel %d0,%a2@(8) return rc; 4f53e: 4280 clrl %d0 4f540: 6000 0094 braw 4f5d6 } key = fat_construct_key(fs_info, &fat_fd->dir_pos.sname); if (fat_fd->flags & FAT_FILE_REMOVED) 4f544: 102a 0030 moveb %a2@(48),%d0 4f548: 0800 0000 btst #0,%d0 4f54c: 674a beqs 4f598 <== ALWAYS TAKEN { rc = fat_file_truncate(fs_info, fat_fd, 0); 4f54e: 42a7 clrl %sp@- <== NOT EXECUTED 4f550: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4f552: 2f02 movel %d2,%sp@- <== NOT EXECUTED 4f554: 4eb9 0004 f432 jsr 4f432 <== NOT EXECUTED if ( rc != RC_OK ) 4f55a: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED 4f55e: 4a80 tstl %d0 <== NOT EXECUTED 4f560: 6674 bnes 4f5d6 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 4f562: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4f564: 4eb9 0005 2b90 jsr 52b90 <_Chain_Extract> <== NOT EXECUTED return rc; _hash_delete(fs_info->rhash, key, fat_fd->ino, fat_fd); if ( fat_ino_is_unique(fs_info, fat_fd->ino) ) 4f56a: 2f2a 000c movel %a2@(12),%sp@- <== NOT EXECUTED 4f56e: 2f02 movel %d2,%sp@- <== NOT EXECUTED 4f570: 4eb9 0005 0b78 jsr 50b78 <== NOT EXECUTED 4f576: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED 4f57a: 4a00 tstb %d0 <== NOT EXECUTED 4f57c: 670e beqs 4f58c <== NOT EXECUTED fat_free_unique_ino(fs_info, fat_fd->ino); 4f57e: 2f2a 000c movel %a2@(12),%sp@- <== NOT EXECUTED 4f582: 2f02 movel %d2,%sp@- <== NOT EXECUTED 4f584: 4eb9 0005 0b4a jsr 50b4a <== NOT EXECUTED 4f58a: 508f addql #8,%sp <== NOT EXECUTED free(fat_fd); 4f58c: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4f58e: 4eb9 0004 3f4c jsr 43f4c <== NOT EXECUTED 4f594: 588f addql #4,%sp <== NOT EXECUTED 4f596: 602a bras 4f5c2 <== NOT EXECUTED } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 4f598: 2f2a 000c movel %a2@(12),%sp@- 4f59c: 2f02 movel %d2,%sp@- 4f59e: 4eb9 0005 0b78 jsr 50b78 4f5a4: 508f addql #8,%sp 4f5a6: 4a00 tstb %d0 4f5a8: 6706 beqs 4f5b0 <== ALWAYS TAKEN { fat_fd->links_num = 0; 4f5aa: 42aa 0008 clrl %a2@(8) <== NOT EXECUTED 4f5ae: 6012 bras 4f5c2 <== NOT EXECUTED 4f5b0: 2f0a movel %a2,%sp@- 4f5b2: 4eb9 0005 2b90 jsr 52b90 <_Chain_Extract> } else { _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); free(fat_fd); 4f5b8: 2f0a movel %a2,%sp@- 4f5ba: 4eb9 0004 3f4c jsr 43f4c 4f5c0: 508f addql #8,%sp } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 4f5c2: 2d42 0008 movel %d2,%fp@(8) return rc; } 4f5c6: 242e fff8 movel %fp@(-8),%d2 4f5ca: 246e fffc moveal %fp@(-4),%a2 4f5ce: 4e5e unlk %fp } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 4f5d0: 4ef9 0004 fbaa jmp 4fbaa return rc; } 4f5d6: 242e fff8 movel %fp@(-8),%d2 4f5da: 246e fffc moveal %fp@(-4),%a2 4f5de: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004f678 : fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 4f678: 4e56 ffcc linkw %fp,#-52 4f67c: 48d7 1cfc moveml %d2-%d7/%a2-%a4,%sp@ 4f680: 262e 0014 movel %fp@(20),%d3 4f684: 286e 0018 moveal %fp@(24),%a4 4f688: 266e 000c moveal %fp@(12),%a3 uint32_t last_cl = 0; uint32_t bytes_remain = 0; uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; 4f68c: 2883 movel %d3,%a4@ fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 4f68e: 246e 0008 moveal %fp@(8),%a2 uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) 4f692: 202b 0018 movel %a3@(24),%d0 fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 4f696: 1e2e 0013 moveb %fp@(19),%d7 int rc = RC_OK; uint32_t chain = 0; 4f69a: 42ae fff0 clrl %fp@(-16) uint32_t bytes2add = 0; uint32_t cls2add = 0; uint32_t old_last_cl; uint32_t last_cl = 0; 4f69e: 42ae fff8 clrl %fp@(-8) uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) 4f6a2: b083 cmpl %d3,%d0 4f6a4: 6506 bcss 4f6ac return RC_OK; 4f6a6: 4282 clrl %d2 4f6a8: 6000 01a2 braw 4f84c if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 4f6ac: 7201 moveq #1,%d1 4f6ae: b2ab 0020 cmpl %a3@(32),%d1 4f6b2: 6616 bnes 4f6ca <== ALWAYS TAKEN 4f6b4: 4aab 0024 tstl %a3@(36) <== NOT EXECUTED 4f6b8: 6610 bnes 4f6ca <== NOT EXECUTED 4f6ba: 7403 moveq #3,%d2 <== NOT EXECUTED 4f6bc: 122a 000e moveb %a2@(14),%d1 <== NOT EXECUTED 4f6c0: c282 andl %d2,%d1 <== NOT EXECUTED 4f6c2: 4a01 tstb %d1 <== NOT EXECUTED 4f6c4: 6704 beqs 4f6ca <== NOT EXECUTED 4f6c6: 6000 00ac braw 4f774 <== NOT EXECUTED (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))) & 4f6ca: 4284 clrl %d4 (fs_info->vol.bpc - 1); bytes2add = new_length - fat_fd->fat_file_size; 4f6cc: 2a03 movel %d3,%d5 4f6ce: 9a80 subl %d0,%d5 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))) & 4f6d0: 382a 0006 movew %a2@(6),%d4 4f6d4: 2204 movel %d4,%d1 4f6d6: 5381 subql #1,%d1 4f6d8: 2c01 movel %d1,%d6 4f6da: cc80 andl %d0,%d6 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 - 4f6dc: 9886 subl %d6,%d4 4f6de: c881 andl %d1,%d4 (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & (fs_info->vol.bpc - 1); bytes2add = new_length - fat_fd->fat_file_size; if (bytes2add > bytes_remain) 4f6e0: b885 cmpl %d5,%d4 4f6e2: 6404 bccs 4f6e8 <== NEVER TAKEN bytes2add -= bytes_remain; 4f6e4: 9a84 subl %d4,%d5 4f6e6: 6002 bras 4f6ea else bytes2add = 0; 4f6e8: 4285 clrl %d5 <== NOT EXECUTED if (zero_fill && bytes_remain > 0) { 4f6ea: 4a07 tstb %d7 4f6ec: 6740 beqs 4f72e <== ALWAYS TAKEN 4f6ee: 4a84 tstl %d4 <== NOT EXECUTED 4f6f0: 673c beqs 4f72e <== NOT EXECUTED uint32_t start = fat_fd->fat_file_size; uint32_t cl_start = start >> fs_info->vol.bpc_log2; 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); 4f6f2: 486e fffc pea %fp@(-4) <== NOT EXECUTED else bytes2add = 0; if (zero_fill && bytes_remain > 0) { uint32_t start = fat_fd->fat_file_size; uint32_t cl_start = start >> fs_info->vol.bpc_log2; 4f6f6: 4281 clrl %d1 <== NOT EXECUTED 4f6f8: 122a 0008 moveb %a2@(8),%d1 <== NOT EXECUTED 4f6fc: e2a8 lsrl %d1,%d0 <== NOT EXECUTED 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); 4f6fe: 2f00 movel %d0,%sp@- <== NOT EXECUTED 4f700: 2f0b movel %a3,%sp@- <== NOT EXECUTED 4f702: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4f704: 4eba f9dc jsr %pc@(4f0e2 ) <== NOT EXECUTED if (rc != RC_OK) 4f708: 4fef 0010 lea %sp@(16),%sp <== NOT EXECUTED uint32_t start = fat_fd->fat_file_size; uint32_t cl_start = start >> fs_info->vol.bpc_log2; 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); 4f70c: 2401 movel %d1,%d2 <== NOT EXECUTED if (rc != RC_OK) 4f70e: 6600 013c bnew 4f84c <== NOT EXECUTED return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); 4f712: 42a7 clrl %sp@- <== NOT EXECUTED 4f714: 2f04 movel %d4,%sp@- <== NOT EXECUTED 4f716: 2f06 movel %d6,%sp@- <== NOT EXECUTED 4f718: 2f2e fffc movel %fp@(-4),%sp@- <== NOT EXECUTED 4f71c: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4f71e: 4eb9 0004 ff10 jsr 4ff10 <== NOT EXECUTED if (bytes_remain != bytes_written) 4f724: 4fef 0014 lea %sp@(20),%sp <== NOT EXECUTED 4f728: b084 cmpl %d4,%d0 <== NOT EXECUTED 4f72a: 6702 beqs 4f72e <== NOT EXECUTED 4f72c: 6052 bras 4f780 <== NOT EXECUTED /* * 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) 4f72e: 4a85 tstl %d5 4f730: 6700 ff74 beqw 4f6a6 return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 4f734: 4280 clrl %d0 4f736: 102a 0008 moveb %a2@(8),%d0 4f73a: 2c05 movel %d5,%d6 4f73c: 5386 subql #1,%d6 4f73e: e0ae lsrl %d0,%d6 4f740: 5286 addql #1,%d6 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 4f742: 0287 0000 00ff andil #255,%d7 4f748: 2f07 movel %d7,%sp@- 4f74a: 486e fff8 pea %fp@(-8) 4f74e: 486e fffc pea %fp@(-4) 4f752: 2f06 movel %d6,%sp@- 4f754: 486e fff0 pea %fp@(-16) 4f758: 2f0a movel %a2,%sp@- 4f75a: 4eb9 0005 5c40 jsr 55c40 &cls_added, &last_cl, zero_fill); /* this means that low level I/O error occured */ if (rc != RC_OK) 4f760: 4fef 0018 lea %sp@(24),%sp if (bytes2add == 0) return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 4f764: 2400 movel %d0,%d2 &cls_added, &last_cl, zero_fill); /* this means that low level I/O error occured */ if (rc != RC_OK) 4f766: 6600 00e4 bnew 4f84c return rc; /* this means that no space left on device */ if ((cls_added == 0) && (bytes_remain == 0)) 4f76a: 202e fffc movel %fp@(-4),%d0 4f76e: 6616 bnes 4f786 <== ALWAYS TAKEN 4f770: 4a84 tstl %d4 <== NOT EXECUTED 4f772: 6612 bnes 4f786 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOSPC); 4f774: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 4f77a: 721c moveq #28,%d1 <== NOT EXECUTED 4f77c: 2040 moveal %d0,%a0 <== NOT EXECUTED 4f77e: 2081 movel %d1,%a0@ <== NOT EXECUTED 4f780: 74ff moveq #-1,%d2 <== NOT EXECUTED 4f782: 6000 00c8 braw 4f84c <== NOT EXECUTED /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) 4f786: b086 cmpl %d6,%d0 4f788: 6718 beqs 4f7a2 <== ALWAYS TAKEN { new_length -= bytes2add & (fs_info->vol.bpc - 1); 4f78a: 4281 clrl %d1 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 4f78c: 9c80 subl %d0,%d6 <== NOT EXECUTED 4f78e: 4280 clrl %d0 <== NOT EXECUTED 4f790: 102a 0008 moveb %a2@(8),%d0 <== 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); 4f794: 322a 0006 movew %a2@(6),%d1 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 4f798: e1ae lsll %d0,%d6 <== 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); 4f79a: 5381 subql #1,%d1 <== NOT EXECUTED 4f79c: ca81 andl %d1,%d5 <== NOT EXECUTED 4f79e: 9685 subl %d5,%d3 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 4f7a0: 9686 subl %d6,%d3 <== NOT EXECUTED } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) 4f7a2: 206b 0018 moveal %a3@(24),%a0 4f7a6: 4a88 tstl %a0 4f7a8: 6612 bnes 4f7bc { fat_fd->map.disk_cln = fat_fd->cln = chain; 4f7aa: 202e fff0 movel %fp@(-16),%d0 fat_fd->map.file_cln = 0; 4f7ae: 42ab 0032 clrl %a3@(50) } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) { fat_fd->map.disk_cln = fat_fd->cln = chain; 4f7b2: 2740 001c movel %d0,%a3@(28) 4f7b6: 2740 0036 movel %d0,%a3@(54) 4f7ba: 6054 bras 4f810 fat_fd->map.file_cln = 0; } else { if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE) 4f7bc: 202b 003a movel %a3@(58),%d0 4f7c0: 72ff moveq #-1,%d1 4f7c2: b280 cmpl %d0,%d1 4f7c4: 6706 beqs 4f7cc <== NEVER TAKEN { old_last_cl = fat_fd->map.last_cln; 4f7c6: 2d40 fff4 movel %d0,%fp@(-12) 4f7ca: 6020 bras 4f7ec } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, 4f7cc: 486e fff4 pea %fp@(-12) <== NOT EXECUTED 4f7d0: 4868 ffff pea %a0@(-1) <== NOT EXECUTED 4f7d4: 4878 0001 pea 1 <== NOT EXECUTED 4f7d8: 2f0b movel %a3,%sp@- <== NOT EXECUTED 4f7da: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4f7dc: 4eb9 0004 f5e2 jsr 4f5e2 <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) 4f7e2: 4fef 0014 lea %sp@(20),%sp <== NOT EXECUTED { old_last_cl = fat_fd->map.last_cln; } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, 4f7e6: 2800 movel %d0,%d4 <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) 4f7e8: 6702 beqs 4f7ec <== NOT EXECUTED 4f7ea: 6048 bras 4f834 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, chain); return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); 4f7ec: 2f2e fff0 movel %fp@(-16),%sp@- 4f7f0: 2f2e fff4 movel %fp@(-12),%sp@- 4f7f4: 2f0a movel %a2,%sp@- 4f7f6: 4eb9 0005 5968 jsr 55968 if ( rc != RC_OK ) 4f7fc: 4fef 000c lea %sp@(12),%sp fat_free_fat_clusters_chain(fs_info, chain); return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); 4f800: 2800 movel %d0,%d4 if ( rc != RC_OK ) 4f802: 6702 beqs 4f806 <== ALWAYS TAKEN 4f804: 602e bras 4f834 <== NOT EXECUTED { fat_free_fat_clusters_chain(fs_info, chain); return rc; } fat_buf_release(fs_info); 4f806: 2f0a movel %a2,%sp@- 4f808: 4eb9 0004 fbaa jsr 4fbaa 4f80e: 588f addql #4,%sp } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) 4f810: 4aae fffc tstl %fp@(-4) 4f814: 6730 beqs 4f846 <== NEVER TAKEN { fat_fd->map.last_cln = last_cl; 4f816: 276e fff8 003a movel %fp@(-8),%a3@(58) if (fat_fd->fat_file_type == FAT_DIRECTORY) 4f81c: 4aab 0010 tstl %a3@(16) 4f820: 6624 bnes 4f846 <== ALWAYS TAKEN { rc = fat_init_clusters_chain(fs_info, chain); 4f822: 2f2e fff0 movel %fp@(-16),%sp@- <== NOT EXECUTED 4f826: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4f828: 4eb9 0005 0a40 jsr 50a40 <== NOT EXECUTED if ( rc != RC_OK ) 4f82e: 508f addql #8,%sp <== NOT EXECUTED if (cls_added != 0) { fat_fd->map.last_cln = last_cl; if (fat_fd->fat_file_type == FAT_DIRECTORY) { rc = fat_init_clusters_chain(fs_info, chain); 4f830: 2800 movel %d0,%d4 <== NOT EXECUTED if ( rc != RC_OK ) 4f832: 6712 beqs 4f846 <== NOT EXECUTED { fat_free_fat_clusters_chain(fs_info, chain); 4f834: 2f2e fff0 movel %fp@(-16),%sp@- <== NOT EXECUTED 4f838: 2404 movel %d4,%d2 <== NOT EXECUTED 4f83a: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4f83c: 4eb9 0005 5b9c jsr 55b9c <== NOT EXECUTED 4f842: 508f addql #8,%sp <== NOT EXECUTED 4f844: 6006 bras 4f84c <== NOT EXECUTED return rc; } } } *a_length = new_length; 4f846: 2883 movel %d3,%a4@ fat_fd->fat_file_size = new_length; 4f848: 2743 0018 movel %d3,%a3@(24) return RC_OK; } 4f84c: 2002 movel %d2,%d0 4f84e: 4cee 1cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a4 4f854: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004f5e2 : uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 4f5e2: 7001 moveq #1,%d0 fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 4f5e4: 4e56 fffc linkw %fp,#-4 4f5e8: 226e 0008 moveal %fp@(8),%a1 4f5ec: 2f0a movel %a2,%sp@- 4f5ee: 206e 000c moveal %fp@(12),%a0 4f5f2: 2f02 movel %d2,%sp@- int rc = RC_OK; uint32_t cur_cln = 0; 4f5f4: 42ae fffc clrl %fp@(-4) uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 4f5f8: b0ae 0010 cmpl %fp@(16),%d0 4f5fc: 6660 bnes 4f65e <== NEVER TAKEN { case F_CLU_NUM: pos = va_arg(ap, uint32_t); 4f5fe: 202e 0014 movel %fp@(20),%d0 ret = va_arg(ap, uint32_t *); 4f602: 246e 0018 moveal %fp@(24),%a2 /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 4f606: b0a8 0018 cmpl %a0@(24),%d0 4f60a: 650e bcss 4f61a <== ALWAYS TAKEN va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); 4f60c: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 4f612: 2040 moveal %d0,%a0 <== NOT EXECUTED 4f614: 7005 moveq #5,%d0 <== NOT EXECUTED 4f616: 2080 movel %d0,%a0@ <== NOT EXECUTED 4f618: 6050 bras 4f66a <== NOT EXECUTED } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 4f61a: 7201 moveq #1,%d1 4f61c: b2a8 0020 cmpl %a0@(32),%d1 4f620: 6618 bnes 4f63a <== NEVER TAKEN 4f622: 4aa8 0024 tstl %a0@(36) 4f626: 6612 bnes 4f63a <== NEVER TAKEN 4f628: 7403 moveq #3,%d2 4f62a: 1229 000e moveb %a1@(14),%d1 4f62e: c282 andl %d2,%d1 4f630: 4a01 tstb %d1 4f632: 6706 beqs 4f63a <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { /* cluster 0 (zero) reserved for root dir */ *ret = 0; 4f634: 4292 clrl %a2@ rc = RC_OK; 4f636: 4280 clrl %d0 break; 4f638: 6032 bras 4f66c } cl_start = pos >> fs_info->vol.bpc_log2; rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 4f63a: 486e fffc pea %fp@(-4) <== NOT EXECUTED *ret = 0; rc = RC_OK; break; } cl_start = pos >> fs_info->vol.bpc_log2; 4f63e: 4281 clrl %d1 <== NOT EXECUTED 4f640: 1229 0008 moveb %a1@(8),%d1 <== NOT EXECUTED 4f644: e2a8 lsrl %d1,%d0 <== NOT EXECUTED rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 4f646: 2f00 movel %d0,%sp@- <== NOT EXECUTED 4f648: 2f08 movel %a0,%sp@- <== NOT EXECUTED 4f64a: 2f09 movel %a1,%sp@- <== NOT EXECUTED 4f64c: 4eba fa94 jsr %pc@(4f0e2 ) <== NOT EXECUTED if ( rc != RC_OK ) 4f650: 4fef 0010 lea %sp@(16),%sp <== NOT EXECUTED break; } cl_start = pos >> fs_info->vol.bpc_log2; rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 4f654: 2001 movel %d1,%d0 <== NOT EXECUTED if ( rc != RC_OK ) 4f656: 6614 bnes 4f66c <== NOT EXECUTED break; *ret = cur_cln; 4f658: 24ae fffc movel %fp@(-4),%a2@ <== NOT EXECUTED break; 4f65c: 600e bras 4f66c <== NOT EXECUTED default: errno = EINVAL; 4f65e: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 4f664: 7416 moveq #22,%d2 <== NOT EXECUTED 4f666: 2040 moveal %d0,%a0 <== NOT EXECUTED 4f668: 2082 movel %d2,%a0@ <== NOT EXECUTED rc = -1; 4f66a: 70ff moveq #-1,%d0 <== NOT EXECUTED break; } va_end(ap); return rc; } 4f66c: 242e fff4 movel %fp@(-12),%d2 4f670: 246e fff8 moveal %fp@(-8),%a2 4f674: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004f0e2 : fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { 4f0e2: 4e56 ffe0 linkw %fp,#-32 4f0e6: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4f0ea: 246e 000c moveal %fp@(12),%a2 4f0ee: 262e 0010 movel %fp@(16),%d3 4f0f2: 266e 0014 moveal %fp@(20),%a3 int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 4f0f6: 202a 0032 movel %a2@(50),%d0 4f0fa: b083 cmpl %d3,%d0 4f0fc: 6606 bnes 4f104 *disk_cln = fat_fd->map.disk_cln; 4f0fe: 26aa 0036 movel %a2@(54),%a3@ 4f102: 6056 bras 4f15a { uint32_t cur_cln; uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) 4f104: b083 cmpl %d3,%d0 4f106: 640c bccs 4f114 <== NEVER TAKEN { cur_cln = fat_fd->map.disk_cln; count = file_cln - fat_fd->map.file_cln; 4f108: 2a03 movel %d3,%d5 4f10a: 9a80 subl %d0,%d5 uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) { cur_cln = fat_fd->map.disk_cln; 4f10c: 2d6a 0036 fffc movel %a2@(54),%fp@(-4) 4f112: 6008 bras 4f11c count = file_cln - fat_fd->map.file_cln; } else { cur_cln = fat_fd->cln; 4f114: 2a03 movel %d3,%d5 <== NOT EXECUTED 4f116: 2d6a 001c fffc movel %a2@(28),%fp@(-4) <== NOT EXECUTED } /* skip over the clusters */ for (i = 0; i < count; i++) { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 4f11c: 240e movel %fp,%d2 cur_cln = fat_fd->cln; count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 4f11e: 4284 clrl %d4 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 4f120: 5982 subql #4,%d2 4f122: 49f9 0005 57fc lea 557fc ,%a4 cur_cln = fat_fd->cln; count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 4f128: 601e bras 4f148 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 4f12a: 2f02 movel %d2,%sp@- 4f12c: 2f2e fffc movel %fp@(-4),%sp@- 4f130: 2f2e 0008 movel %fp@(8),%sp@- 4f134: 4e94 jsr %a4@ if ( rc != RC_OK ) 4f136: 4fef 000c lea %sp@(12),%sp 4f13a: 4a80 tstl %d0 4f13c: 6708 beqs 4f146 <== ALWAYS TAKEN return rc; 4f13e: 2600 movel %d0,%d3 <== NOT EXECUTED 4f140: 5bc2 smi %d2 <== NOT EXECUTED 4f142: 49c2 extbl %d2 <== NOT EXECUTED 4f144: 6018 bras 4f15e <== NOT EXECUTED cur_cln = fat_fd->cln; count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 4f146: 5284 addql #1,%d4 4f148: ba84 cmpl %d4,%d5 4f14a: 66de bnes 4f12a return rc; } /* update cache */ fat_fd->map.file_cln = file_cln; fat_fd->map.disk_cln = cur_cln; 4f14c: 202e fffc movel %fp@(-4),%d0 if ( rc != RC_OK ) return rc; } /* update cache */ fat_fd->map.file_cln = file_cln; 4f150: 2543 0032 movel %d3,%a2@(50) fat_fd->map.disk_cln = cur_cln; 4f154: 2540 0036 movel %d0,%a2@(54) *disk_cln = cur_cln; 4f158: 2680 movel %d0,%a3@ } return RC_OK; 4f15a: 4282 clrl %d2 4f15c: 4283 clrl %d3 } 4f15e: 2002 movel %d2,%d0 4f160: 2203 movel %d3,%d1 4f162: 4cee 1c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a4 4f168: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004fa38 : void fat_file_mark_removed( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 4fa38: 4e56 fff4 linkw %fp,#-12 <== NOT EXECUTED 4fa3c: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ <== NOT EXECUTED 4fa40: 246e 000c moveal %fp@(12),%a2 <== NOT EXECUTED uint32_t key = 0; key = fat_construct_key(fs_info, &fat_fd->dir_pos.sname); 4fa44: 486a 0020 pea %a2@(32) <== NOT EXECUTED void fat_file_mark_removed( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 4fa48: 266e 0008 moveal %fp@(8),%a3 <== NOT EXECUTED uint32_t key = 0; key = fat_construct_key(fs_info, &fat_fd->dir_pos.sname); 4fa4c: 2f0b movel %a3,%sp@- <== NOT EXECUTED 4fa4e: 4eba f644 jsr %pc@(4f094 ) <== NOT EXECUTED 4fa52: 508f addql #8,%sp <== NOT EXECUTED 4fa54: 2400 movel %d0,%d2 <== NOT EXECUTED 4fa56: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4fa58: 4eb9 0005 2b90 jsr 52b90 <_Chain_Extract> <== 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); 4fa5e: 7001 moveq #1,%d0 <== NOT EXECUTED 4fa60: c082 andl %d2,%d0 <== NOT EXECUTED RTEMS_INLINE_ROUTINE void rtems_chain_append( rtems_chain_control *the_chain, rtems_chain_node *the_node ) { _Chain_Append( the_chain, the_node ); 4fa62: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4fa64: 2200 movel %d0,%d1 <== NOT EXECUTED 4fa66: e988 lsll #4,%d0 <== NOT EXECUTED 4fa68: e589 lsll #2,%d1 <== NOT EXECUTED 4fa6a: 9081 subl %d1,%d0 <== NOT EXECUTED 4fa6c: d0ab 0066 addl %a3@(102),%d0 <== NOT EXECUTED 4fa70: 2f00 movel %d0,%sp@- <== NOT EXECUTED 4fa72: 4eb9 0004 8758 jsr 48758 <_Chain_Append> <== NOT EXECUTED _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); _hash_insert(fs_info->rhash, key, fat_fd->ino, fat_fd); fat_fd->flags |= FAT_FILE_REMOVED; 4fa78: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED 4fa7c: 7201 moveq #1,%d1 <== NOT EXECUTED 4fa7e: 102a 0030 moveb %a2@(48),%d0 <== NOT EXECUTED 4fa82: 8081 orl %d1,%d0 <== NOT EXECUTED 4fa84: 1540 0030 moveb %d0,%a2@(48) <== NOT EXECUTED } 4fa88: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 <== NOT EXECUTED 4fa8e: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004f16c : fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { 4f16c: 4e56 ffe0 linkw %fp,#-32 4f170: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 4f174: 2a2e 000c movel %fp@(12),%d5 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); 4f178: 283c 0004 f094 movel #323732,%d4 4f17e: 2044 moveal %d4,%a0 uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { uint32_t mod = (key1) % FAT_HASH_MODULE; 4f180: 7601 moveq #1,%d3 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); 4f182: 2f05 movel %d5,%sp@- fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { 4f184: 266e 0008 moveal %fp@(8),%a3 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); 4f188: 2f0b movel %a3,%sp@- fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { 4f18a: 286e 0010 moveal %fp@(16),%a4 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); 4f18e: 4e90 jsr %a0@ */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4f190: 2a6b 0062 moveal %a3@(98),%a5 4f194: 2400 movel %d0,%d2 4f196: 508f addql #8,%sp uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { uint32_t mod = (key1) % FAT_HASH_MODULE; 4f198: c680 andl %d0,%d3 rtems_chain_node *the_node = rtems_chain_first(hash + mod); 4f19a: 2003 movel %d3,%d0 4f19c: e98b lsll #4,%d3 4f19e: e588 lsll #2,%d0 4f1a0: 9680 subl %d0,%d3 4f1a2: dbc3 addal %d3,%a5 4f1a4: 245d moveal %a5@+,%a2 4f1a6: 601c bras 4f1c4 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); 4f1a8: 486a 0020 pea %a2@(32) 4f1ac: 2044 moveal %d4,%a0 4f1ae: 2f0b movel %a3,%sp@- 4f1b0: 4e90 jsr %a0@ 4f1b2: 508f addql #8,%sp if ( (key1) == ck) 4f1b4: b082 cmpl %d2,%d0 4f1b6: 660a bnes 4f1c2 <== ALWAYS TAKEN /* 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; 4f1b8: 288a movel %a2,%a4@ <== NOT EXECUTED lfat_fd->links_num++; 4f1ba: 52aa 0008 addql #1,%a2@(8) <== NOT EXECUTED 4f1be: 6000 00d0 braw 4f290 <== NOT EXECUTED { *ret = (void *)the_node; return 0; } } the_node = the_node->next; 4f1c2: 2452 moveal %a2@,%a2 ) { 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) ; ) 4f1c4: bbca cmpal %a2,%a5 4f1c6: 66e0 bnes 4f1a8 4f1c8: 6000 00ca braw 4f294 { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); 4f1cc: 486a 0020 pea %a2@(32) <== NOT EXECUTED 4f1d0: 2044 moveal %d4,%a0 <== NOT EXECUTED 4f1d2: 2f0b movel %a3,%sp@- <== NOT EXECUTED 4f1d4: 4e90 jsr %a0@ <== NOT EXECUTED 4f1d6: 508f addql #8,%sp <== NOT EXECUTED if ( (key1) == ck) 4f1d8: b082 cmpl %d2,%d0 <== NOT EXECUTED 4f1da: 660a bnes 4f1e6 <== NOT EXECUTED { if ( ((key2) == 0) || ((key2) == ffd->ino) ) 4f1dc: 4a82 tstl %d2 <== NOT EXECUTED 4f1de: 6710 beqs 4f1f0 <== NOT EXECUTED 4f1e0: b4aa 000c cmpl %a2@(12),%d2 <== NOT EXECUTED 4f1e4: 670a beqs 4f1f0 <== NOT EXECUTED { *ret = (void *)the_node; return 0; } } the_node = the_node->next; 4f1e6: 2452 moveal %a2@,%a2 <== 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) ; ) 4f1e8: bbca cmpal %a2,%a5 4f1ea: 66e0 bnes 4f1cc <== NEVER TAKEN return 0; } } the_node = the_node->next; } return -1; 4f1ec: 78ff moveq #-1,%d4 4f1ee: 6002 bras 4f1f2 if ( (key1) == ck) { if ( ((key2) == 0) || ((key2) == ffd->ino) ) { *ret = (void *)the_node; return 0; 4f1f0: 4284 clrl %d4 <== 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)); 4f1f2: 4878 0042 pea 42 4f1f6: 4eb9 0004 4410 jsr 44410 if ( lfat_fd == NULL ) 4f1fc: 588f addql #4,%sp } /* 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)); 4f1fe: 2440 moveal %d0,%a2 4f200: 2880 movel %d0,%a4@ if ( lfat_fd == NULL ) 4f202: 660e bnes 4f212 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOMEM ); 4f204: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 4f20a: 720c moveq #12,%d1 <== NOT EXECUTED 4f20c: 2040 moveal %d0,%a0 <== NOT EXECUTED 4f20e: 2081 movel %d1,%a0@ <== NOT EXECUTED 4f210: 606a bras 4f27c <== NOT EXECUTED memset(lfat_fd, 0, sizeof(fat_file_fd_t)); 4f212: 4878 0042 pea 42 4f216: 42a7 clrl %sp@- 4f218: 2f00 movel %d0,%sp@- 4f21a: 4eb9 0005 7e40 jsr 57e40 lfat_fd->links_num = 1; 4f220: 7001 moveq #1,%d0 lfat_fd->flags &= ~FAT_FILE_REMOVED; 4f222: 72fe moveq #-2,%d1 if ( lfat_fd == NULL ) rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); lfat_fd->links_num = 1; 4f224: 2540 0008 movel %d0,%a2@(8) lfat_fd->flags &= ~FAT_FILE_REMOVED; 4f228: 102a 0030 moveb %a2@(48),%d0 4f22c: c081 andl %d1,%d0 4f22e: 1540 0030 moveb %d0,%a2@(48) lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 4f232: 70ff moveq #-1,%d0 4f234: 2540 003a movel %d0,%a2@(58) lfat_fd->dir_pos = *dir_pos; 4f238: 4878 0010 pea 10 4f23c: 2f05 movel %d5,%sp@- 4f23e: 486a 0020 pea %a2@(32) 4f242: 4eb9 0005 7dd0 jsr 57dd0 if ( rc != RC_OK ) 4f248: 4fef 0018 lea %sp@(24),%sp 4f24c: 4a84 tstl %d4 4f24e: 6706 beqs 4f256 <== NEVER TAKEN lfat_fd->ino = key; 4f250: 2542 000c movel %d2,%a2@(12) 4f254: 602a bras 4f280 else { lfat_fd->ino = fat_get_unique_ino(fs_info); 4f256: 2f0b movel %a3,%sp@- <== NOT EXECUTED 4f258: 4eb9 0005 0ab2 jsr 50ab2 <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 4f25e: 588f addql #4,%sp <== NOT EXECUTED if ( rc != RC_OK ) lfat_fd->ino = key; else { lfat_fd->ino = fat_get_unique_ino(fs_info); 4f260: 2540 000c movel %d0,%a2@(12) <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 4f264: 661a bnes 4f280 <== NOT EXECUTED { free((*fat_fd)); 4f266: 2f14 movel %a4@,%sp@- <== NOT EXECUTED 4f268: 4eb9 0004 3f4c jsr 43f4c <== 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 ); 4f26e: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 4f274: 588f addql #4,%sp <== NOT EXECUTED 4f276: 2040 moveal %d0,%a0 <== NOT EXECUTED 4f278: 700c moveq #12,%d0 <== NOT EXECUTED 4f27a: 2080 movel %d0,%a0@ <== NOT EXECUTED 4f27c: 70ff moveq #-1,%d0 <== NOT EXECUTED 4f27e: 6026 bras 4f2a6 <== NOT EXECUTED RTEMS_INLINE_ROUTINE void rtems_chain_append( rtems_chain_control *the_chain, rtems_chain_node *the_node ) { _Chain_Append( the_chain, the_node ); 4f280: 2f0a movel %a2,%sp@- 4f282: d6ab 0062 addl %a3@(98),%d3 4f286: 2f03 movel %d3,%sp@- 4f288: 4eb9 0004 8758 jsr 48758 <_Chain_Append> 4f28e: 508f addql #8,%sp /* * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; 4f290: 4280 clrl %d0 4f292: 6012 bras 4f2a6 4f294: 2a6b 0066 moveal %a3@(102),%a5 4f298: dbc3 addal %d3,%a5 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); 4f29a: 283c 0004 f094 movel #323732,%d4 4f2a0: 245d moveal %a5@+,%a2 4f2a2: 6000 ff44 braw 4f1e8 * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; } 4f2a6: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4f2ac: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004f2c2 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 4f2c2: 4e56 ffd4 linkw %fp,#-44 4f2c6: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4f2ca: 246e 0008 moveal %fp@(8),%a2 4f2ce: 266e 000c moveal %fp@(12),%a3 4f2d2: 282e 0010 movel %fp@(16),%d4 4f2d6: 242e 0014 movel %fp@(20),%d2 int rc = RC_OK; ssize_t ret = 0; uint32_t cmpltd = 0; uint32_t cur_cln = 0; 4f2da: 42ae fffc clrl %fp@(-4) 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) 4f2de: 4a82 tstl %d2 4f2e0: 6700 013c beqw 4f41e /* * >= because start is offset and computed from 0 and file_size * computed from 1 */ if ( start >= fat_fd->fat_file_size ) 4f2e4: 202b 0018 movel %a3@(24),%d0 4f2e8: b084 cmpl %d4,%d0 4f2ea: 6300 0132 blsw 4f41e return FAT_EOF; if ((count > fat_fd->fat_file_size) || 4f2ee: b082 cmpl %d2,%d0 4f2f0: 6508 bcss 4f2fa <== NEVER TAKEN (start > fat_fd->fat_file_size - count)) 4f2f2: 2200 movel %d0,%d1 4f2f4: 9282 subl %d2,%d1 * computed from 1 */ if ( start >= fat_fd->fat_file_size ) return FAT_EOF; if ((count > fat_fd->fat_file_size) || 4f2f6: b284 cmpl %d4,%d1 4f2f8: 6404 bccs 4f2fe <== ALWAYS TAKEN (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; 4f2fa: 2400 movel %d0,%d2 <== NOT EXECUTED 4f2fc: 9484 subl %d4,%d2 <== NOT EXECUTED if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 4f2fe: 7001 moveq #1,%d0 4f300: b0ab 0020 cmpl %a3@(32),%d0 4f304: 6652 bnes 4f358 <== NEVER TAKEN 4f306: 4aab 0024 tstl %a3@(36) 4f30a: 664c bnes 4f358 <== NEVER TAKEN 4f30c: 7203 moveq #3,%d1 4f30e: 102a 000e moveb %a2@(14),%d0 4f312: c081 andl %d1,%d0 4f314: 4a00 tstb %d0 4f316: 6740 beqs 4f358 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln); 4f318: 2f2b 001c movel %a3@(28),%sp@- 4f31c: 2f0a movel %a2,%sp@- 4f31e: 4eba fd3c jsr %pc@(4f05c ) sec += (start >> fs_info->vol.sec_log2); byte = start & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, count, buf); 4f322: 588f addql #4,%sp if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln); sec += (start >> fs_info->vol.sec_log2); byte = start & (fs_info->vol.bps - 1); 4f324: 4281 clrl %d1 ret = _fat_block_read(fs_info, sec, byte, count, buf); 4f326: 2040 moveal %d0,%a0 4f328: 2eae 0018 movel %fp@(24),%sp@ 4f32c: 2f02 movel %d2,%sp@- if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln); sec += (start >> fs_info->vol.sec_log2); byte = start & (fs_info->vol.bps - 1); 4f32e: 3212 movew %a2@,%d1 4f330: 5381 subql #1,%d1 ret = _fat_block_read(fs_info, sec, byte, count, buf); 4f332: c284 andl %d4,%d1 4f334: 2f01 movel %d1,%sp@- 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); 4f336: 4281 clrl %d1 4f338: 122a 0002 moveb %a2@(2),%d1 4f33c: e2ac lsrl %d1,%d4 byte = start & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, count, buf); 4f33e: 4870 4800 pea %a0@(00000000,%d4:l) 4f342: 2f0a movel %a2,%sp@- 4f344: 4eb9 0004 fdfc jsr 4fdfc <_fat_block_read> if ( ret < 0 ) 4f34a: 4fef 0014 lea %sp@(20),%sp 4f34e: 4a80 tstl %d0 4f350: 6c00 00d6 bgew 4f428 4f354: 6000 00d0 braw 4f426 <== NOT EXECUTED return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; 4f358: 4280 clrl %d0 <== NOT EXECUTED 4f35a: 102a 0008 moveb %a2@(8),%d0 <== NOT EXECUTED save_ofs = ofs = start & (fs_info->vol.bpc - 1); rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 4f35e: 2c0e movel %fp,%d6 <== NOT EXECUTED 4f360: 5986 subql #4,%d6 <== NOT EXECUTED return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; 4f362: 2604 movel %d4,%d3 <== NOT EXECUTED 4f364: e0ab lsrl %d0,%d3 <== NOT EXECUTED save_ofs = ofs = start & (fs_info->vol.bpc - 1); 4f366: 3a2a 0006 movew %a2@(6),%d5 <== NOT EXECUTED rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 4f36a: 2f06 movel %d6,%sp@- <== NOT EXECUTED 4f36c: 2f03 movel %d3,%sp@- <== NOT EXECUTED 4f36e: 2f0b movel %a3,%sp@- <== NOT EXECUTED 4f370: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4f372: 4eba fd6e jsr %pc@(4f0e2 ) <== NOT EXECUTED if (rc != RC_OK) 4f376: 4fef 0010 lea %sp@(16),%sp <== NOT EXECUTED 4f37a: 4a81 tstl %d1 <== NOT EXECUTED 4f37c: 6600 00a4 bnew 4f422 <== NOT EXECUTED return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 4f380: 99cc subal %a4,%a4 <== NOT EXECUTED while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 4f382: 4bfa fcd8 lea %pc@(4f05c ),%a5<== NOT EXECUTED return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 4f386: 0285 0000 ffff andil #65535,%d5 <== NOT EXECUTED 4f38c: 5385 subql #1,%d5 <== NOT EXECUTED 4f38e: c885 andl %d5,%d4 <== NOT EXECUTED 4f390: 4285 clrl %d5 <== NOT EXECUTED 4f392: 2e04 movel %d4,%d7 <== NOT EXECUTED 4f394: 6068 bras 4f3fe <== NOT EXECUTED if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); 4f396: 4285 clrl %d5 <== NOT EXECUTED 4f398: 3a2a 0006 movew %a2@(6),%d5 <== NOT EXECUTED 4f39c: 9a87 subl %d7,%d5 <== NOT EXECUTED 4f39e: b485 cmpl %d5,%d2 <== NOT EXECUTED 4f3a0: 6402 bccs 4f3a4 <== NOT EXECUTED 4f3a2: 2a02 movel %d2,%d5 <== NOT EXECUTED sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 4f3a4: 2f2e fffc movel %fp@(-4),%sp@- <== NOT EXECUTED 4f3a8: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4f3aa: 4e95 jsr %a5@ <== 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); 4f3ac: 206e 0018 moveal %fp@(24),%a0 <== NOT EXECUTED while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 4f3b0: 508f addql #8,%sp <== 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); 4f3b2: 4870 c800 pea %a0@(00000000,%a4:l) <== NOT EXECUTED { 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); byte = ofs & (fs_info->vol.bps - 1); 4f3b6: 4281 clrl %d1 <== NOT EXECUTED ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); 4f3b8: 2f05 movel %d5,%sp@- <== NOT EXECUTED { 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); byte = ofs & (fs_info->vol.bps - 1); 4f3ba: 3212 movew %a2@,%d1 <== NOT EXECUTED 4f3bc: 5381 subql #1,%d1 <== NOT EXECUTED ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); 4f3be: c287 andl %d7,%d1 <== NOT EXECUTED 4f3c0: 2f01 movel %d1,%sp@- <== NOT EXECUTED 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); 4f3c2: 4281 clrl %d1 <== NOT EXECUTED 4f3c4: 122a 0002 moveb %a2@(2),%d1 <== NOT EXECUTED 4f3c8: e2af lsrl %d1,%d7 <== NOT EXECUTED 4f3ca: 2047 moveal %d7,%a0 <== NOT EXECUTED byte = ofs & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); 4f3cc: 4870 0800 pea %a0@(00000000,%d0:l) <== NOT EXECUTED 4f3d0: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4f3d2: 4eb9 0004 fdfc jsr 4fdfc <_fat_block_read> <== NOT EXECUTED if ( ret < 0 ) 4f3d8: 4fef 0014 lea %sp@(20),%sp <== NOT EXECUTED 4f3dc: 4a80 tstl %d0 <== NOT EXECUTED 4f3de: 6d46 blts 4f426 <== NOT EXECUTED return -1; count -= c; 4f3e0: 9485 subl %d5,%d2 <== NOT EXECUTED cmpltd += c; 4f3e2: d9c5 addal %d5,%a4 <== NOT EXECUTED save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) return rc; ofs = 0; 4f3e4: 4287 clrl %d7 <== NOT EXECUTED return -1; count -= c; cmpltd += c; save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 4f3e6: 2f06 movel %d6,%sp@- <== NOT EXECUTED if ( ret < 0 ) return -1; count -= c; cmpltd += c; save_cln = cur_cln; 4f3e8: 2a2e fffc movel %fp@(-4),%d5 <== NOT EXECUTED rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 4f3ec: 2f05 movel %d5,%sp@- <== NOT EXECUTED 4f3ee: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4f3f0: 4eb9 0005 57fc jsr 557fc <== NOT EXECUTED if ( rc != RC_OK ) 4f3f6: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED 4f3fa: 4a80 tstl %d0 <== NOT EXECUTED 4f3fc: 662a bnes 4f428 <== NOT EXECUTED rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) 4f3fe: 4a82 tstl %d2 <== NOT EXECUTED 4f400: 6694 bnes 4f396 <== NOT EXECUTED } /* 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); 4f402: 4282 clrl %d2 <== NOT EXECUTED 4f404: 142a 0008 moveb %a2@(8),%d2 <== NOT EXECUTED 4f408: 41f4 48ff lea %a4@(ffffffff,%d4:l),%a0 <== NOT EXECUTED fat_fd->map.disk_cln = save_cln; 4f40c: 2745 0036 movel %d5,%a3@(54) <== NOT EXECUTED } /* 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); 4f410: 2008 movel %a0,%d0 <== NOT EXECUTED 4f412: e4a8 lsrl %d2,%d0 <== NOT EXECUTED ofs = 0; } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + 4f414: d083 addl %d3,%d0 <== NOT EXECUTED 4f416: 2740 0032 movel %d0,%a3@(50) <== NOT EXECUTED ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; return cmpltd; 4f41a: 200c movel %a4,%d0 <== NOT EXECUTED 4f41c: 600a bras 4f428 <== NOT EXECUTED uint32_t byte = 0; uint32_t c = 0; /* it couldn't be removed - otherwise cache update will be broken */ if (count == 0) return cmpltd; 4f41e: 4280 clrl %d0 <== NOT EXECUTED 4f420: 6006 bras 4f428 <== NOT EXECUTED cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) 4f422: 2001 movel %d1,%d0 <== NOT EXECUTED 4f424: 6002 bras 4f428 <== 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; 4f426: 70ff moveq #-1,%d0 <== 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; } 4f428: 4cee 3cfc ffd4 moveml %fp@(-44),%d2-%d7/%a2-%a5 4f42e: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004fa92 : 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)) && 4fa92: 7001 moveq #1,%d0 <== NOT EXECUTED int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 4fa94: 4e56 ffe8 linkw %fp,#-24 <== NOT EXECUTED 4fa98: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ <== NOT EXECUTED 4fa9c: 246e 000c moveal %fp@(12),%a2 <== NOT EXECUTED 4faa0: 266e 0008 moveal %fp@(8),%a3 <== NOT EXECUTED int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; 4faa4: 2d6a 001c fffc movel %a2@(28),%fp@(-4) <== NOT EXECUTED uint32_t save_cln = 0; /* Have we requested root dir size for FAT12/16? */ if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 4faaa: b0aa 0020 cmpl %a2@(32),%d0 <== NOT EXECUTED 4faae: 661a bnes 4faca <== NOT EXECUTED 4fab0: 4aaa 0024 tstl %a2@(36) <== NOT EXECUTED 4fab4: 6614 bnes 4faca <== NOT EXECUTED 4fab6: 7203 moveq #3,%d1 <== NOT EXECUTED 4fab8: 102b 000e moveb %a3@(14),%d0 <== NOT EXECUTED 4fabc: c081 andl %d1,%d0 <== NOT EXECUTED 4fabe: 4a00 tstb %d0 <== NOT EXECUTED 4fac0: 6708 beqs 4faca <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { fat_fd->fat_file_size = fs_info->vol.rdir_size; 4fac2: 256b 0028 0018 movel %a3@(40),%a2@(24) <== NOT EXECUTED 4fac8: 6042 bras 4fb0c <== NOT EXECUTED fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 4faca: 260e movel %fp,%d3 <== NOT EXECUTED fat_file_fd_t *fat_fd ) { int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; uint32_t save_cln = 0; 4facc: 4280 clrl %d0 <== NOT EXECUTED fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 4face: 5983 subql #4,%d3 <== NOT EXECUTED 4fad0: 49f9 0005 57fc lea 557fc ,%a4 <== NOT EXECUTED { fat_fd->fat_file_size = fs_info->vol.rdir_size; return rc; } fat_fd->fat_file_size = 0; 4fad6: 42aa 0018 clrl %a2@(24) <== NOT EXECUTED while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 4fada: 601c bras 4faf8 <== NOT EXECUTED { save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 4fadc: 2f03 movel %d3,%sp@- <== NOT EXECUTED 4fade: 2f02 movel %d2,%sp@- <== NOT EXECUTED 4fae0: 2f0b movel %a3,%sp@- <== NOT EXECUTED 4fae2: 4e94 jsr %a4@ <== NOT EXECUTED if ( rc != RC_OK ) 4fae4: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED 4fae8: 4a80 tstl %d0 <== NOT EXECUTED 4faea: 6622 bnes 4fb0e <== NOT EXECUTED return rc; fat_fd->fat_file_size += fs_info->vol.bpc; 4faec: 4280 clrl %d0 <== NOT EXECUTED 4faee: 302b 0006 movew %a3@(6),%d0 <== NOT EXECUTED 4faf2: d1aa 0018 addl %d0,%a2@(24) <== NOT EXECUTED fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { save_cln = cur_cln; 4faf6: 2002 movel %d2,%d0 <== NOT EXECUTED return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 4faf8: 242e fffc movel %fp@(-4),%d2 <== NOT EXECUTED 4fafc: 2202 movel %d2,%d1 <== NOT EXECUTED 4fafe: c2ab 0010 andl %a3@(16),%d1 <== NOT EXECUTED 4fb02: b2ab 0014 cmpl %a3@(20),%d1 <== NOT EXECUTED 4fb06: 65d4 bcss 4fadc <== NOT EXECUTED if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; } fat_fd->map.last_cln = save_cln; 4fb08: 2540 003a movel %d0,%a2@(58) <== NOT EXECUTED 4fb0c: 4280 clrl %d0 <== NOT EXECUTED return rc; } 4fb0e: 4cee 1c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a4 <== NOT EXECUTED 4fb14: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004f432 : ) { int rc = RC_OK; uint32_t cur_cln = 0; uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; 4f432: 70ff moveq #-1,%d0 <== NOT EXECUTED fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 4f434: 4e56 ffe8 linkw %fp,#-24 <== NOT EXECUTED 4f438: 206e 0010 moveal %fp@(16),%a0 <== NOT EXECUTED 4f43c: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ <== NOT EXECUTED 4f440: 246e 000c moveal %fp@(12),%a2 <== NOT EXECUTED int rc = RC_OK; uint32_t cur_cln = 0; uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; 4f444: 2d40 fffc movel %d0,%fp@(-4) <== NOT EXECUTED fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 4f448: 266e 0008 moveal %fp@(8),%a3 <== NOT EXECUTED 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 ) 4f44c: 202a 0018 movel %a2@(24),%d0 <== NOT EXECUTED fat_file_fd_t *fat_fd, uint32_t new_length ) { int rc = RC_OK; uint32_t cur_cln = 0; 4f450: 42ae fff8 clrl %fp@(-8) <== NOT EXECUTED uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; if ( new_length >= fat_fd->fat_file_size ) 4f454: b088 cmpl %a0,%d0 <== NOT EXECUTED 4f456: 6206 bhis 4f45e <== NOT EXECUTED return rc; 4f458: 4280 clrl %d0 <== NOT EXECUTED 4f45a: 6000 00b8 braw 4f514 <== NOT EXECUTED assert(fat_fd->fat_file_size); 4f45e: 4a80 tstl %d0 <== NOT EXECUTED 4f460: 661c bnes 4f47e <== NOT EXECUTED 4f462: 4879 0006 6e52 pea 66e52 <== NOT EXECUTED 4f468: 4879 0006 6eb0 pea 66eb0 <__FUNCTION__.7507> <== NOT EXECUTED 4f46e: 4878 02d1 pea 2d1 <== NOT EXECUTED 4f472: 4879 0006 6e68 pea 66e68 <== NOT EXECUTED 4f478: 4eb9 0005 147c jsr 5147c <__assert_func> <== NOT EXECUTED cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; 4f47e: 4282 clrl %d2 <== NOT EXECUTED 4f480: 4281 clrl %d1 <== NOT EXECUTED 4f482: 122b 0008 moveb %a3@(8),%d1 <== NOT EXECUTED 4f486: 342b 0006 movew %a3@(6),%d2 <== NOT EXECUTED 4f48a: 41f0 28ff lea %a0@(ffffffff,%d2:l),%a0 <== NOT EXECUTED 4f48e: 2408 movel %a0,%d2 <== NOT EXECUTED 4f490: e2aa lsrl %d1,%d2 <== NOT EXECUTED if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) 4f492: 2602 movel %d2,%d3 <== NOT EXECUTED 4f494: e3ab lsll %d1,%d3 <== NOT EXECUTED 4f496: b083 cmpl %d3,%d0 <== NOT EXECUTED 4f498: 63be blss 4f458 <== NOT EXECUTED return RC_OK; if (cl_start != 0) 4f49a: 4a82 tstl %d2 <== NOT EXECUTED 4f49c: 6618 bnes 4f4b6 <== NOT EXECUTED if (rc != RC_OK) return rc; } rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 4f49e: 486e fff8 pea %fp@(-8) <== NOT EXECUTED 4f4a2: 2f02 movel %d2,%sp@- <== NOT EXECUTED 4f4a4: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4f4a6: 2f0b movel %a3,%sp@- <== NOT EXECUTED 4f4a8: 4eba fc38 jsr %pc@(4f0e2 ) <== NOT EXECUTED if (rc != RC_OK) 4f4ac: 4fef 0010 lea %sp@(16),%sp <== NOT EXECUTED if (rc != RC_OK) return rc; } rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 4f4b0: 2001 movel %d1,%d0 <== NOT EXECUTED if (rc != RC_OK) 4f4b2: 6660 bnes 4f514 <== NOT EXECUTED 4f4b4: 601c bras 4f4d2 <== NOT EXECUTED 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); 4f4b6: 486e fffc pea %fp@(-4) <== NOT EXECUTED 4f4ba: 2042 moveal %d2,%a0 <== NOT EXECUTED 4f4bc: 4868 ffff pea %a0@(-1) <== NOT EXECUTED 4f4c0: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4f4c2: 2f0b movel %a3,%sp@- <== NOT EXECUTED 4f4c4: 4eba fc1c jsr %pc@(4f0e2 ) <== NOT EXECUTED if (rc != RC_OK) 4f4c8: 4fef 0010 lea %sp@(16),%sp <== NOT EXECUTED 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); 4f4cc: 2001 movel %d1,%d0 <== NOT EXECUTED if (rc != RC_OK) 4f4ce: 67ce beqs 4f49e <== NOT EXECUTED 4f4d0: 6042 bras 4f514 <== 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); 4f4d2: 2f2e fff8 movel %fp@(-8),%sp@- <== NOT EXECUTED 4f4d6: 2f0b movel %a3,%sp@- <== NOT EXECUTED 4f4d8: 4eb9 0005 5b9c jsr 55b9c <== NOT EXECUTED if (rc != RC_OK) 4f4de: 508f addql #8,%sp <== NOT EXECUTED 4f4e0: 4a80 tstl %d0 <== NOT EXECUTED 4f4e2: 6630 bnes 4f514 <== NOT EXECUTED return rc; if (cl_start != 0) 4f4e4: 4a82 tstl %d2 <== NOT EXECUTED 4f4e6: 6700 ff70 beqw 4f458 <== NOT EXECUTED { rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC); 4f4ea: 4878 ffff pea ffffffff <== NOT EXECUTED 4f4ee: 2f2e fffc movel %fp@(-4),%sp@- <== NOT EXECUTED 4f4f2: 2f0b movel %a3,%sp@- <== NOT EXECUTED 4f4f4: 4eb9 0005 5968 jsr 55968 <== NOT EXECUTED if ( rc != RC_OK ) 4f4fa: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED 4f4fe: 4a80 tstl %d0 <== NOT EXECUTED 4f500: 6612 bnes 4f514 <== NOT EXECUTED return rc; fat_fd->map.file_cln = cl_start - 1; fat_fd->map.disk_cln = new_last_cln; 4f502: 222e fffc movel %fp@(-4),%d1 <== NOT EXECUTED 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; 4f506: 5382 subql #1,%d2 <== NOT EXECUTED fat_fd->map.disk_cln = new_last_cln; 4f508: 2541 0036 movel %d1,%a2@(54) <== NOT EXECUTED 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; 4f50c: 2542 0032 movel %d2,%a2@(50) <== NOT EXECUTED fat_fd->map.disk_cln = new_last_cln; fat_fd->map.last_cln = new_last_cln; 4f510: 2541 003a movel %d1,%a2@(58) <== NOT EXECUTED } return RC_OK; } 4f514: 4cee 0c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a3 <== NOT EXECUTED 4f51a: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004f858 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 4f858: 4e56 ffc4 linkw %fp,#-60 4f85c: 202e 0014 movel %fp@(20),%d0 4f860: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4f864: 246e 000c moveal %fp@(12),%a2 ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; bool zero_fill = start > fat_fd->fat_file_size; uint32_t file_cln_initial = fat_fd->map.file_cln; 4f868: 2a2a 0032 movel %a2@(50),%d5 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 4f86c: 266e 0008 moveal %fp@(8),%a3 4f870: 282e 0010 movel %fp@(16),%d4 int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; bool zero_fill = start > fat_fd->fat_file_size; 4f874: 222a 0018 movel %a2@(24),%d1 { int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; 4f878: 42ae fff8 clrl %fp@(-8) bool zero_fill = start > fat_fd->fat_file_size; uint32_t file_cln_initial = fat_fd->map.file_cln; 4f87c: 2d45 fff0 movel %d5,%fp@(-16) uint32_t cln; if ( count == 0 ) 4f880: 4a80 tstl %d0 4f882: 6700 0192 beqw 4fa16 return cmpltd; if (start >= fat_fd->size_limit) 4f886: 242a 0014 movel %a2@(20),%d2 4f88a: b484 cmpl %d4,%d2 4f88c: 6210 bhis 4f89e <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EFBIG); 4f88e: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 4f894: 741b moveq #27,%d2 <== NOT EXECUTED 4f896: 2040 moveal %d0,%a0 <== NOT EXECUTED 4f898: 2082 movel %d2,%a0@ <== NOT EXECUTED 4f89a: 6000 0190 braw 4fa2c <== NOT EXECUTED if (count > fat_fd->size_limit - start) 4f89e: 9484 subl %d4,%d2 4f8a0: b082 cmpl %d2,%d0 4f8a2: 6402 bccs 4f8a6 <== NEVER TAKEN 4f8a4: 2400 movel %d0,%d2 count = fat_fd->size_limit - start; rc = fat_file_extend(fs_info, fat_fd, zero_fill, start + count, &c); 4f8a6: 486e fff8 pea %fp@(-8) int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; bool zero_fill = start > fat_fd->fat_file_size; 4f8aa: b284 cmpl %d4,%d1 4f8ac: 55c0 scs %d0 rtems_set_errno_and_return_minus_one(EFBIG); if (count > fat_fd->size_limit - start) count = fat_fd->size_limit - start; rc = fat_file_extend(fs_info, fat_fd, zero_fill, start + count, &c); 4f8ae: 2602 movel %d2,%d3 4f8b0: d684 addl %d4,%d3 int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; bool zero_fill = start > fat_fd->fat_file_size; 4f8b2: 49c0 extbl %d0 rtems_set_errno_and_return_minus_one(EFBIG); if (count > fat_fd->size_limit - start) count = fat_fd->size_limit - start; rc = fat_file_extend(fs_info, fat_fd, zero_fill, start + count, &c); 4f8b4: 4480 negl %d0 4f8b6: 2f03 movel %d3,%sp@- 4f8b8: 2f00 movel %d0,%sp@- 4f8ba: 2f0a movel %a2,%sp@- 4f8bc: 2f0b movel %a3,%sp@- 4f8be: 4eb9 0004 f678 jsr 4f678 if (RC_OK == rc) 4f8c4: 4fef 0014 lea %sp@(20),%sp 4f8c8: 4a80 tstl %d0 4f8ca: 6600 0162 bnew 4fa2e { /* * check whether there was enough room on device to locate * file of 'start + count' bytes */ if (c != (start + count)) 4f8ce: 202e fff8 movel %fp@(-8),%d0 4f8d2: b680 cmpl %d0,%d3 4f8d4: 6704 beqs 4f8da <== ALWAYS TAKEN count = c - start; 4f8d6: 2400 movel %d0,%d2 <== NOT EXECUTED 4f8d8: 9484 subl %d4,%d2 <== 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)); 4f8da: 7201 moveq #1,%d1 */ 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)) 4f8dc: 102b 000e moveb %a3@(14),%d0 */ 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)); 4f8e0: b2aa 0020 cmpl %a2@(32),%d1 4f8e4: 6614 bnes 4f8fa 4f8e6: 4aaa 0024 tstl %a2@(36) 4f8ea: 660e bnes 4f8fa <== NEVER TAKEN 4f8ec: 7a03 moveq #3,%d5 4f8ee: c085 andl %d5,%d0 4f8f0: 4a00 tstb %d0 4f8f2: 56c0 sne %d0 4f8f4: 49c0 extbl %d0 4f8f6: 4480 negl %d0 4f8f8: 6002 bras 4f8fc 4f8fa: 4280 clrl %d0 4f8fc: 4285 clrl %d5 4f8fe: 1a2b 0008 moveb %a3@(8),%d5 */ 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)) 4f902: 0800 0000 btst #0,%d0 4f906: 6732 beqs 4f93a { cln = fat_fd->cln; cln += (start >> fs_info->vol.bpc_log2); byte = start & (fs_info->vol.bpc -1); ret = fat_cluster_write(fs_info, 4f908: 42a7 clrl %sp@- 4f90a: 2f2e 0018 movel %fp@(24),%sp@- /* for the root directory of FAT12 and FAT16 we need this special handling */ if (fat_is_fat12_or_fat16_root_dir(fat_fd, fs_info->vol.type)) { cln = fat_fd->cln; cln += (start >> fs_info->vol.bpc_log2); byte = start & (fs_info->vol.bpc -1); 4f90e: 4280 clrl %d0 ret = fat_cluster_write(fs_info, 4f910: 2f02 movel %d2,%sp@- /* for the root directory of FAT12 and FAT16 we need this special handling */ if (fat_is_fat12_or_fat16_root_dir(fat_fd, fs_info->vol.type)) { cln = fat_fd->cln; cln += (start >> fs_info->vol.bpc_log2); byte = start & (fs_info->vol.bpc -1); 4f912: 302b 0006 movew %a3@(6),%d0 4f916: 5380 subql #1,%d0 ret = fat_cluster_write(fs_info, 4f918: c084 andl %d4,%d0 /* 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); 4f91a: eaac lsrl %d5,%d4 byte = start & (fs_info->vol.bpc -1); ret = fat_cluster_write(fs_info, 4f91c: 2f00 movel %d0,%sp@- 4f91e: d8aa 001c addl %a2@(28),%d4 4f922: 2f04 movel %d4,%sp@- 4f924: 2f0b movel %a3,%sp@- 4f926: 4eb9 0005 0010 jsr 50010 cln, byte, count, buf, false); if (0 > ret) 4f92c: 4fef 0018 lea %sp@(24),%sp 4f930: 4a80 tstl %d0 4f932: 6d00 00f8 bltw 4fa2c 4f936: 6000 00f6 braw 4fa2e const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; 4f93a: 2e0e movel %fp,%d7 4f93c: 5987 subql #4,%d7 4f93e: 2047 moveal %d7,%a0 uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; 4f940: 2604 movel %d4,%d3 4f942: eaab lsrl %d5,%d3 const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; 4f944: 4290 clrl %a0@ 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); 4f946: 2f07 movel %d7,%sp@- 4f948: 2f03 movel %d3,%sp@- 4f94a: 2f0a movel %a2,%sp@- 4f94c: 2f0b movel %a3,%sp@- 4f94e: 4eba f792 jsr %pc@(4f0e2 ) if (RC_OK == rc) 4f952: 4fef 0010 lea %sp@(16),%sp 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); 4f956: 2a41 moveal %d1,%a5 if (RC_OK == rc) 4f958: 4a81 tstl %d1 4f95a: 6600 00b2 bnew 4fa0e { file_cln_cnt = cur_cln - fat_fd->cln; 4f95e: 222e fffc movel %fp@(-4),%d1 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); 4f962: 2003 movel %d3,%d0 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; 4f964: 92aa 001c subl %a2@(28),%d1 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); 4f968: 2844 moveal %d4,%a4 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 */ 4f96a: 4284 clrl %d4 const uint32_t count, const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; 4f96c: 4286 clrl %d6 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); 4f96e: eba8 lsll %d5,%d0 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; 4f970: 4205 clrb %d5 rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln); if (RC_OK == rc) { file_cln_cnt = cur_cln - fat_fd->cln; 4f972: 2d41 ffec movel %d1,%fp@(-20) 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); 4f976: 99c0 subal %d0,%a4 4f978: 200c movel %a4,%d0 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; 4f97a: 1d45 fff7 moveb %d5,%fp@(-9) 4f97e: 6062 bras 4f9e2 { 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)); 4f980: 4281 clrl %d1 4f982: 322b 0006 movew %a3@(6),%d1 4f986: 9280 subl %d0,%d1 4f988: b481 cmpl %d1,%d2 4f98a: 6402 bccs 4f98e 4f98c: 2202 movel %d2,%d1 if (file_cln_initial < file_cln_cnt) 4f98e: 2e2e ffec movel %fp@(-20),%d7 4f992: beae fff0 cmpl %fp@(-16),%d7 4f996: 6306 blss 4f99e overwrite_cluster = true; 4f998: 7a01 moveq #1,%d5 4f99a: 1d45 fff7 moveb %d5,%fp@(-9) ret = fat_cluster_write(fs_info, 4f99e: 7a01 moveq #1,%d5 4f9a0: 1e2e fff7 moveb %fp@(-9),%d7 4f9a4: 206e 0018 moveal %fp@(24),%a0 4f9a8: ce85 andl %d5,%d7 4f9aa: 2f07 movel %d7,%sp@- 4f9ac: 4870 6800 pea %a0@(00000000,%d6:l) 4f9b0: 2f01 movel %d1,%sp@- 4f9b2: 2f00 movel %d0,%sp@- 4f9b4: 2f2e fffc movel %fp@(-4),%sp@- 4f9b8: 2f0b movel %a3,%sp@- 4f9ba: 4eb9 0005 0010 jsr 50010 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) 4f9c0: 4fef 0018 lea %sp@(24),%sp 4f9c4: 4a80 tstl %d0 4f9c6: 6c52 bges 4fa1a <== ALWAYS TAKEN 4f9c8: 601e bras 4f9e8 <== 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); 4f9ca: 486e fffc pea %fp@(-4) <== NOT EXECUTED 4f9ce: 2f04 movel %d4,%sp@- <== NOT EXECUTED 4f9d0: 2f0b movel %a3,%sp@- <== NOT EXECUTED 4f9d2: 4eb9 0005 57fc jsr 557fc <== 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) 4f9d8: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED 4f9dc: 4a80 tstl %d0 <== NOT EXECUTED 4f9de: 660e bnes 4f9ee <== NOT EXECUTED 4f9e0: 4280 clrl %d0 && (bytes_to_write > 0)) 4f9e2: 4a82 tstl %d2 4f9e4: 669a bnes 4f980 4f9e6: 6008 bras 4f9f0 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) 4f9e8: 3a7c ffff moveaw #-1,%a5 <== NOT EXECUTED 4f9ec: 6002 bras 4f9f0 <== 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) 4f9ee: 2a40 moveal %d0,%a5 <== NOT EXECUTED } /* 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); 4f9f0: 4282 clrl %d2 4f9f2: 142b 0008 moveb %a3@(8),%d2 4f9f6: 49f4 68ff lea %a4@(ffffffff,%d6:l),%a4 fat_fd->map.disk_cln = save_cln; 4f9fa: 2544 0036 movel %d4,%a2@(54) } /* 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); 4f9fe: 200c movel %a4,%d0 4fa00: e4a8 lsrl %d2,%d0 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 4fa02: d083 addl %d3,%d0 4fa04: 2540 0032 movel %d0,%a2@(50) ((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; } if (RC_OK != rc) 4fa08: 4a8d tstl %a5 4fa0a: 6602 bnes 4fa0e <== NEVER TAKEN return rc; else return cmpltd; 4fa0c: 2a46 moveal %d6,%a5 fat_fd, start, count, buf, file_cln_initial); if (0 > ret) 4fa0e: 4a8d tstl %a5 4fa10: 6d1a blts 4fa2c <== NEVER TAKEN rc = -1; else cmpltd = ret; 4fa12: 200d movel %a5,%d0 4fa14: 6018 bras 4fa2e uint32_t file_cln_initial = fat_fd->map.file_cln; uint32_t cln; if ( count == 0 ) return cmpltd; 4fa16: 4280 clrl %d0 <== NOT EXECUTED 4fa18: 6014 bras 4fa2e <== NOT EXECUTED if (RC_OK == rc) { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; 4fa1a: 282e fffc movel %fp@(-4),%d4 if (0 > ret) rc = -1; if (RC_OK == rc) { ++file_cln_cnt; 4fa1e: 52ae ffec addql #1,%fp@(-20) bytes_to_write -= ret; 4fa22: 9480 subl %d0,%d2 cmpltd += ret; 4fa24: dc80 addl %d0,%d6 save_cln = cur_cln; if (0 < bytes_to_write) 4fa26: 4a82 tstl %d2 4fa28: 67b6 beqs 4f9e0 <== ALWAYS TAKEN 4fa2a: 609e bras 4f9ca <== NOT EXECUTED start, count, buf, file_cln_initial); if (0 > ret) rc = -1; 4fa2c: 70ff moveq #-1,%d0 <== NOT EXECUTED } if (RC_OK != rc) return rc; else return cmpltd; } 4fa2e: 4cee 3cfc ffc4 moveml %fp@(-60),%d2-%d7/%a2-%a5 4fa34: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00055b9c : int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 55b9c: 4e56 ffd8 linkw %fp,#-40 <== NOT EXECUTED 55ba0: 48d7 3c7c moveml %d2-%d6/%a2-%a5,%sp@ <== NOT EXECUTED int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 55ba4: 264e moveal %fp,%a3 <== NOT EXECUTED uint32_t freed_cls_cnt = 0; 55ba6: 4282 clrl %d2 <== NOT EXECUTED fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { int rc = RC_OK, rc1 = RC_OK; 55ba8: 4285 clrl %d5 <== NOT EXECUTED uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); 55baa: 49f9 0005 57fc lea 557fc ,%a4 <== NOT EXECUTED fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 55bb0: 4bf9 0005 5968 lea 55968 ,%a5 <== NOT EXECUTED int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 55bb6: 2c2e 000c movel %fp@(12),%d6 <== NOT EXECUTED int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; 55bba: 2606 movel %d6,%d3 <== NOT EXECUTED int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 55bbc: 246e 0008 moveal %fp@(8),%a2 <== NOT EXECUTED int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 55bc0: 42a3 clrl %a3@- <== NOT EXECUTED uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 55bc2: 6044 bras 55c08 <== NOT EXECUTED { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); 55bc4: 2f0b movel %a3,%sp@- <== NOT EXECUTED 55bc6: 2f03 movel %d3,%sp@- <== NOT EXECUTED 55bc8: 2f0a movel %a2,%sp@- <== NOT EXECUTED 55bca: 4e94 jsr %a4@ <== NOT EXECUTED if ( rc != RC_OK ) 55bcc: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); 55bd0: 2800 movel %d0,%d4 <== NOT EXECUTED if ( rc != RC_OK ) 55bd2: 671c beqs 55bf0 <== NOT EXECUTED { if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 55bd4: 202a 003e movel %a2@(62),%d0 <== NOT EXECUTED 55bd8: 72ff moveq #-1,%d1 <== NOT EXECUTED 55bda: b280 cmpl %d0,%d1 <== NOT EXECUTED 55bdc: 6706 beqs 55be4 <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; 55bde: d480 addl %d0,%d2 <== NOT EXECUTED 55be0: 2542 003e movel %d2,%a2@(62) <== NOT EXECUTED fat_buf_release(fs_info); 55be4: 2f0a movel %a2,%sp@- <== NOT EXECUTED 55be6: 4eb9 0004 fbaa jsr 4fbaa <== NOT EXECUTED 55bec: 588f addql #4,%sp <== NOT EXECUTED 55bee: 6044 bras 55c34 <== NOT EXECUTED return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 55bf0: 42a7 clrl %sp@- <== NOT EXECUTED 55bf2: 2f03 movel %d3,%sp@- <== NOT EXECUTED 55bf4: 2f0a movel %a2,%sp@- <== NOT EXECUTED 55bf6: 4e95 jsr %a5@ <== NOT EXECUTED if ( rc != RC_OK ) 55bf8: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED 55bfc: 4a80 tstl %d0 <== NOT EXECUTED 55bfe: 6702 beqs 55c02 <== NOT EXECUTED 55c00: 2a00 movel %d0,%d5 <== NOT EXECUTED rc1 = rc; freed_cls_cnt++; cur_cln = next_cln; 55c02: 262e fffc movel %fp@(-4),%d3 <== NOT EXECUTED rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); if ( rc != RC_OK ) rc1 = rc; freed_cls_cnt++; 55c06: 5282 addql #1,%d2 <== NOT EXECUTED int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 55c08: 2003 movel %d3,%d0 <== NOT EXECUTED 55c0a: c0aa 0010 andl %a2@(16),%d0 <== NOT EXECUTED 55c0e: b0aa 0014 cmpl %a2@(20),%d0 <== NOT EXECUTED 55c12: 65b0 bcss 55bc4 <== NOT EXECUTED freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 55c14: 202a 003e movel %a2@(62),%d0 <== NOT EXECUTED 55c18: 72ff moveq #-1,%d1 <== NOT EXECUTED freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; 55c1a: 2546 0046 movel %d6,%a2@(70) <== NOT EXECUTED if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 55c1e: b280 cmpl %d0,%d1 <== NOT EXECUTED 55c20: 6706 beqs 55c28 <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; 55c22: d480 addl %d0,%d2 <== NOT EXECUTED 55c24: 2542 003e movel %d2,%a2@(62) <== NOT EXECUTED fat_buf_release(fs_info); 55c28: 2f0a movel %a2,%sp@- <== NOT EXECUTED 55c2a: 2805 movel %d5,%d4 <== NOT EXECUTED 55c2c: 4eb9 0004 fbaa jsr 4fbaa <== NOT EXECUTED 55c32: 588f addql #4,%sp <== NOT EXECUTED if (rc1 != RC_OK) return rc1; return RC_OK; } 55c34: 2004 movel %d4,%d0 <== NOT EXECUTED 55c36: 4cee 3c7c ffd8 moveml %fp@(-40),%d2-%d6/%a2-%a5 <== NOT EXECUTED 55c3c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00050b4a : void fat_free_unique_ino( fat_fs_info_t *fs_info, uint32_t ino ) { 50b4a: 4e56 0000 linkw %fp,#0 <== NOT EXECUTED 50b4e: 226e 0008 moveal %fp@(8),%a1 <== NOT EXECUTED FAT_SET_UNIQ_INO_FREE((ino - fs_info->uino_base), fs_info->uino); 50b52: 202e 000c movel %fp@(12),%d0 <== NOT EXECUTED 50b56: 90a9 0076 subl %a1@(118),%d0 <== NOT EXECUTED 50b5a: 2200 movel %d0,%d1 <== NOT EXECUTED 50b5c: e689 lsrl #3,%d1 <== NOT EXECUTED 50b5e: 2069 006a moveal %a1@(106),%a0 <== NOT EXECUTED 50b62: d1c1 addal %d1,%a0 <== NOT EXECUTED 50b64: 7207 moveq #7,%d1 <== NOT EXECUTED 50b66: c280 andl %d0,%d1 <== NOT EXECUTED 50b68: 7001 moveq #1,%d0 <== NOT EXECUTED 50b6a: e3a8 lsll %d1,%d0 <== NOT EXECUTED 50b6c: 1210 moveb %a0@,%d1 <== NOT EXECUTED 50b6e: 4680 notl %d0 <== NOT EXECUTED 50b70: c081 andl %d1,%d0 <== NOT EXECUTED 50b72: 1080 moveb %d0,%a0@ <== NOT EXECUTED } 50b74: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000557fc : uint8_t *sec_buf; uint32_t sec = 0; uint32_t ofs = 0; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 557fc: 7001 moveq #1,%d0 fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 557fe: 4e56 ffd8 linkw %fp,#-40 55802: 48d7 1cfc moveml %d2-%d7/%a2-%a4,%sp@ 55806: 266e 0008 moveal %fp@(8),%a3 5580a: 242e 000c movel %fp@(12),%d2 5580e: 246e 0010 moveal %fp@(16),%a2 uint8_t *sec_buf; uint32_t sec = 0; uint32_t ofs = 0; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 55812: b082 cmpl %d2,%d0 55814: 6400 0134 bccw 5594a 55818: 202b 0034 movel %a3@(52),%d0 5581c: 5280 addql #1,%d0 5581e: b082 cmpl %d2,%d0 55820: 6404 bccs 55826 <== ALWAYS TAKEN 55822: 6000 0126 braw 5594a <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 55826: 7201 moveq #1,%d1 55828: 102b 000e moveb %a3@(14),%d0 5582c: c280 andl %d0,%d1 5582e: 4a01 tstb %d1 55830: 6708 beqs 5583a <== NEVER TAKEN 55832: 2802 movel %d2,%d4 55834: e28c lsrl #1,%d4 55836: d882 addl %d2,%d4 55838: 6010 bras 5584a 5583a: 7602 moveq #2,%d3 <== NOT EXECUTED 5583c: 2802 movel %d2,%d4 <== NOT EXECUTED 5583e: c680 andl %d0,%d3 <== NOT EXECUTED 55840: 4a03 tstb %d3 <== NOT EXECUTED 55842: 6704 beqs 55848 <== NOT EXECUTED 55844: d884 addl %d4,%d4 <== NOT EXECUTED 55846: 6002 bras 5584a <== NOT EXECUTED 55848: e58c lsll #2,%d4 <== NOT EXECUTED 5584a: 4283 clrl %d3 5584c: 162b 0002 moveb %a3@(2),%d3 55850: e6ac lsrl %d3,%d4 55852: d8ab 0050 addl %a3@(80),%d4 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 55856: 4a01 tstb %d1 55858: 6708 beqs 55862 <== NEVER TAKEN 5585a: 2a02 movel %d2,%d5 5585c: e28d lsrl #1,%d5 5585e: da82 addl %d2,%d5 55860: 6010 bras 55872 55862: 7202 moveq #2,%d1 <== NOT EXECUTED 55864: 2a02 movel %d2,%d5 <== NOT EXECUTED 55866: c081 andl %d1,%d0 <== NOT EXECUTED 55868: 4a00 tstb %d0 <== NOT EXECUTED 5586a: 6704 beqs 55870 <== NOT EXECUTED 5586c: da85 addl %d5,%d5 <== NOT EXECUTED 5586e: 6002 bras 55872 <== NOT EXECUTED 55870: e58d lsll #2,%d5 <== NOT EXECUTED rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 55872: 2c0e movel %fp,%d6 55874: 5986 subql #4,%d6 55876: 49f9 0004 fd48 lea 4fd48 ,%a4 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); 5587c: 3e13 movew %a3@,%d7 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 5587e: 2f06 movel %d6,%sp@- 55880: 4878 0001 pea 1 55884: 2f04 movel %d4,%sp@- 55886: 2f0b movel %a3,%sp@- 55888: 4e94 jsr %a4@ if (rc != RC_OK) 5588a: 4fef 0010 lea %sp@(16),%sp 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); rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 5588e: 2600 movel %d0,%d3 if (rc != RC_OK) 55890: 6600 00ca bnew 5595c 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); 55894: 4281 clrl %d1 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) 55896: 7002 moveq #2,%d0 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); 55898: 3207 movew %d7,%d1 5589a: 5381 subql #1,%d1 5589c: c285 andl %d5,%d1 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) 5589e: 4285 clrl %d5 558a0: 1a2b 000e moveb %a3@(14),%d5 558a4: b085 cmpl %d5,%d0 558a6: 6772 beqs 5591a <== NEVER TAKEN 558a8: 103c 0004 moveb #4,%d0 558ac: b085 cmpl %d5,%d0 558ae: 6700 0088 beqw 55938 558b2: 103c 0001 moveb #1,%d0 558b6: b085 cmpl %d5,%d0 558b8: 6600 0090 bnew 5594a case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); 558bc: 206e fffc moveal %fp@(-4),%a0 558c0: 4285 clrl %d5 558c2: 1a30 1800 moveb %a0@(00000000,%d1:l),%d5 if ( ofs == (fs_info->vol.bps - 1) ) 558c6: 4280 clrl %d0 558c8: 3013 movew %a3@,%d0 case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); 558ca: 2485 movel %d5,%a2@ if ( ofs == (fs_info->vol.bps - 1) ) 558cc: 5380 subql #1,%d0 558ce: b081 cmpl %d1,%d0 558d0: 6626 bnes 558f8 <== ALWAYS TAKEN { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 558d2: 2f06 movel %d6,%sp@- <== NOT EXECUTED 558d4: 4878 0001 pea 1 <== NOT EXECUTED 558d8: 2044 moveal %d4,%a0 <== NOT EXECUTED 558da: 4868 0001 pea %a0@(1) <== NOT EXECUTED 558de: 2f0b movel %a3,%sp@- <== NOT EXECUTED 558e0: 4e94 jsr %a4@ <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 558e2: 4fef 0010 lea %sp@(16),%sp <== NOT EXECUTED 558e6: 4a80 tstl %d0 <== NOT EXECUTED 558e8: 6670 bnes 5595a <== NOT EXECUTED return rc; *ret_val |= *sec_buf << 8; 558ea: 206e fffc moveal %fp@(-4),%a0 <== NOT EXECUTED 558ee: 4280 clrl %d0 <== NOT EXECUTED 558f0: 1010 moveb %a0@,%d0 <== NOT EXECUTED 558f2: e188 lsll #8,%d0 <== NOT EXECUTED 558f4: 8192 orl %d0,%a2@ <== NOT EXECUTED 558f6: 600c bras 55904 <== NOT EXECUTED } else { *ret_val |= *(sec_buf + ofs + 1) << 8; 558f8: 4280 clrl %d0 558fa: 1030 1801 moveb %a0@(00000001,%d1:l),%d0 558fe: e188 lsll #8,%d0 55900: 8085 orl %d5,%d0 55902: 2480 movel %d0,%a2@ } if ( FAT_CLUSTER_IS_ODD(cln) ) 55904: 0802 0000 btst #0,%d2 55908: 6706 beqs 55910 *ret_val = (*ret_val) >> FAT12_SHIFT; 5590a: 2012 movel %a2@,%d0 5590c: e888 lsrl #4,%d0 5590e: 6036 bras 55946 else *ret_val = (*ret_val) & FAT_FAT12_MASK; 55910: 203c 0000 0fff movel #4095,%d0 55916: c192 andl %d0,%a2@ 55918: 6042 bras 5595c static inline uint16_t m68k_swap_u16( uint16_t value ) { return (((value & 0xff) << 8) | ((value >> 8) & 0xff)); 5591a: 206e fffc moveal %fp@(-4),%a0 <== NOT EXECUTED 5591e: 3230 1800 movew %a0@(00000000,%d1:l),%d1 <== NOT EXECUTED 55922: 0281 0000 ffff andil #65535,%d1 <== NOT EXECUTED 55928: 2001 movel %d1,%d0 <== NOT EXECUTED 5592a: e089 lsrl #8,%d1 <== NOT EXECUTED 5592c: e188 lsll #8,%d0 <== NOT EXECUTED break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); *ret_val = CF_LE_W(*ret_val); 5592e: 0280 0000 ff00 andil #65280,%d0 <== NOT EXECUTED 55934: 8081 orl %d1,%d0 <== NOT EXECUTED 55936: 600e bras 55946 <== NOT EXECUTED break; case FAT_FAT32: *ret_val = *((uint32_t *)(sec_buf + ofs)); 55938: 206e fffc moveal %fp@(-4),%a0 <== NOT EXECUTED *ret_val = CF_LE_L(*ret_val); 5593c: 2f30 1800 movel %a0@(00000000,%d1:l),%sp@- <== NOT EXECUTED 55940: 4eba fe82 jsr %pc@(557c4 ) <== NOT EXECUTED 55944: 588f addql #4,%sp <== NOT EXECUTED 55946: 2480 movel %d0,%a2@ break; 55948: 6012 bras 5595c default: rtems_set_errno_and_return_minus_one(EIO); 5594a: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 55950: 76ff moveq #-1,%d3 <== NOT EXECUTED 55952: 2040 moveal %d0,%a0 <== NOT EXECUTED 55954: 7005 moveq #5,%d0 <== NOT EXECUTED 55956: 2080 movel %d0,%a0@ <== NOT EXECUTED 55958: 6002 bras 5595c <== 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) 5595a: 2600 movel %d0,%d3 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } 5595c: 2003 movel %d3,%d0 5595e: 4cee 1cfc ffd8 moveml %fp@(-40),%d2-%d7/%a2-%a4 55964: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00050ab2 : * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { 50ab2: 4e56 ffec linkw %fp,#-20 <== NOT EXECUTED 50ab6: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ <== NOT EXECUTED 50aba: 246e 0008 moveal %fp@(8),%a2 <== 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); 50abe: 47f9 0004 4e24 lea 44e24 ,%a3 <== NOT EXECUTED fat_get_unique_ino(fat_fs_info_t *fs_info) { uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) 50ac4: 6072 bras 50b38 <== NOT EXECUTED { for (j = 0; j < fs_info->uino_pool_size; j++) { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) 50ac6: 222a 006e movel %a2@(110),%d1 <== NOT EXECUTED 50aca: 2401 movel %d1,%d2 <== NOT EXECUTED 50acc: e68a lsrl #3,%d2 <== NOT EXECUTED 50ace: 7607 moveq #7,%d3 <== NOT EXECUTED 50ad0: 226a 006a moveal %a2@(106),%a1 <== NOT EXECUTED 50ad4: d3c2 addal %d2,%a1 <== NOT EXECUTED 50ad6: 1411 moveb %a1@,%d2 <== NOT EXECUTED 50ad8: c681 andl %d1,%d3 <== NOT EXECUTED 50ada: 1802 moveb %d2,%d4 <== NOT EXECUTED 50adc: 49c4 extbl %d4 <== NOT EXECUTED 50ade: 0704 btst %d3,%d4 <== NOT EXECUTED 50ae0: 6612 bnes 50af4 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); 50ae2: 7001 moveq #1,%d0 <== NOT EXECUTED 50ae4: e7a8 lsll %d3,%d0 <== NOT EXECUTED 50ae6: 8082 orl %d2,%d0 <== NOT EXECUTED 50ae8: 1280 moveb %d0,%a1@ <== NOT EXECUTED return (fs_info->uino_base + fs_info->index); 50aea: 202a 006e movel %a2@(110),%d0 <== NOT EXECUTED 50aee: d0aa 0076 addl %a2@(118),%d0 <== NOT EXECUTED 50af2: 604c bras 50b40 <== NOT EXECUTED } fs_info->index++; 50af4: 5281 addql #1,%d1 <== NOT EXECUTED if (fs_info->index >= fs_info->uino_pool_size) 50af6: b1c1 cmpal %d1,%a0 <== NOT EXECUTED 50af8: 6306 blss 50b00 <== 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++; 50afa: 2541 006e movel %d1,%a2@(110) <== NOT EXECUTED 50afe: 6004 bras 50b04 <== NOT EXECUTED if (fs_info->index >= fs_info->uino_pool_size) fs_info->index = 0; 50b00: 42aa 006e clrl %a2@(110) <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) 50b04: 5280 addql #1,%d0 <== NOT EXECUTED 50b06: b1c0 cmpal %d0,%a0 <== NOT EXECUTED 50b08: 66bc bnes 50ac6 <== 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)) 50b0a: 223c 0fff ffff movel #268435455,%d1 <== NOT EXECUTED 50b10: 92aa 0076 subl %a2@(118),%d1 <== NOT EXECUTED 50b14: d080 addl %d0,%d0 <== NOT EXECUTED 50b16: b280 cmpl %d0,%d1 <== NOT EXECUTED 50b18: 6204 bhis 50b1e <== NOT EXECUTED resrc_unsuff = true; } else resrc_unsuff = true; } return 0; 50b1a: 4280 clrl %d0 <== NOT EXECUTED 50b1c: 6022 bras 50b40 <== NOT EXECUTED fs_info->index = 0; } if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base)) { fs_info->uino_pool_size <<= 1; 50b1e: 2540 0072 movel %d0,%a2@(114) <== NOT EXECUTED fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); 50b22: 2f00 movel %d0,%sp@- <== NOT EXECUTED 50b24: 2f2a 006a movel %a2@(106),%sp@- <== NOT EXECUTED 50b28: 4e93 jsr %a3@ <== NOT EXECUTED if (fs_info->uino != NULL) 50b2a: 508f addql #8,%sp <== 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); 50b2c: 2540 006a movel %d0,%a2@(106) <== NOT EXECUTED if (fs_info->uino != NULL) 50b30: 67e8 beqs 50b1a <== NOT EXECUTED fs_info->index = fs_info->uino_pool_size; 50b32: 256a 0072 006e movel %a2@(114),%a2@(110) <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) 50b38: 206a 0072 moveal %a2@(114),%a0 <== NOT EXECUTED 50b3c: 4280 clrl %d0 <== NOT EXECUTED 50b3e: 60c6 bras 50b06 <== NOT EXECUTED } else resrc_unsuff = true; } return 0; } 50b40: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 <== NOT EXECUTED 50b46: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00050a40 : int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 50a40: 4e56 ffec linkw %fp,#-20 <== NOT EXECUTED 50a44: 48d7 3c00 moveml %a2-%a5,%sp@ <== NOT EXECUTED int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; 50a48: 264e moveal %fp,%a3 <== NOT EXECUTED while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 50a4a: 49f9 0004 ff10 lea 4ff10 ,%a4 <== NOT EXECUTED if ( ret != fs_info->vol.bpc ) { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 50a50: 4bf9 0005 57fc lea 557fc ,%a5 <== NOT EXECUTED uint32_t start_cln ) { int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; 50a56: 272e 000c movel %fp@(12),%a3@- <== NOT EXECUTED int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 50a5a: 246e 0008 moveal %fp@(8),%a2 <== NOT EXECUTED 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) 50a5e: 6032 bras 50a92 <== NOT EXECUTED { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 50a60: 4281 clrl %d1 <== NOT EXECUTED 50a62: 42a7 clrl %sp@- <== NOT EXECUTED 50a64: 322a 0006 movew %a2@(6),%d1 <== NOT EXECUTED 50a68: 2f01 movel %d1,%sp@- <== NOT EXECUTED 50a6a: 42a7 clrl %sp@- <== NOT EXECUTED 50a6c: 2f00 movel %d0,%sp@- <== NOT EXECUTED 50a6e: 2f0a movel %a2,%sp@- <== NOT EXECUTED 50a70: 4e94 jsr %a4@ <== NOT EXECUTED if ( ret != fs_info->vol.bpc ) 50a72: 4fef 0014 lea %sp@(20),%sp <== NOT EXECUTED 50a76: 4281 clrl %d1 <== NOT EXECUTED 50a78: 322a 0006 movew %a2@(6),%d1 <== NOT EXECUTED 50a7c: b280 cmpl %d0,%d1 <== NOT EXECUTED 50a7e: 6626 bnes 50aa6 <== NOT EXECUTED { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 50a80: 2f0b movel %a3,%sp@- <== NOT EXECUTED 50a82: 2f2e fffc movel %fp@(-4),%sp@- <== NOT EXECUTED 50a86: 2f0a movel %a2,%sp@- <== NOT EXECUTED 50a88: 4e95 jsr %a5@ <== NOT EXECUTED if ( rc != RC_OK ) 50a8a: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED 50a8e: 4a80 tstl %d0 <== NOT EXECUTED 50a90: 6616 bnes 50aa8 <== NOT EXECUTED { 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) 50a92: 202e fffc movel %fp@(-4),%d0 <== NOT EXECUTED 50a96: 2200 movel %d0,%d1 <== NOT EXECUTED 50a98: c2aa 0010 andl %a2@(16),%d1 <== NOT EXECUTED 50a9c: b2aa 0014 cmpl %a2@(20),%d1 <== NOT EXECUTED 50aa0: 65be bcss 50a60 <== NOT EXECUTED return rc; } } return rc; 50aa2: 4280 clrl %d0 <== NOT EXECUTED 50aa4: 6002 bras 50aa8 <== NOT EXECUTED while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); if ( ret != fs_info->vol.bpc ) { return -1; 50aa6: 70ff moveq #-1,%d0 <== NOT EXECUTED } } return rc; } 50aa8: 4cee 3c00 ffec moveml %fp@(-20),%a2-%a5 <== NOT EXECUTED 50aae: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00050114 : * 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) { 50114: 4e56 ff64 linkw %fp,#-156 50118: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ ssize_t ret = 0; struct stat stat_buf; int i = 0; rtems_bdbuf_buffer *block = NULL; vol->fd = open(device, O_RDWR); 5011c: 4878 0002 pea 2 50120: 2f2e 000c movel %fp@(12),%sp@- * 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) { 50124: 266e 0008 moveal %fp@(8),%a3 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; 50128: 42ae ffaa clrl %fp@(-86) vol->fd = open(device, O_RDWR); 5012c: 4eb9 0004 4c34 jsr 44c34 if (vol->fd < 0) 50132: 508f addql #8,%sp ssize_t ret = 0; struct stat stat_buf; int i = 0; rtems_bdbuf_buffer *block = NULL; vol->fd = open(device, O_RDWR); 50134: 2740 0056 movel %d0,%a3@(86) if (vol->fd < 0) 50138: 6c10 bges 5014a <== ALWAYS TAKEN { rtems_set_errno_and_return_minus_one(ENXIO); 5013a: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 50140: 7606 moveq #6,%d3 <== NOT EXECUTED 50142: 2040 moveal %d0,%a0 <== NOT EXECUTED 50144: 2083 movel %d3,%a0@ <== NOT EXECUTED 50146: 6000 06fc braw 50844 <== NOT EXECUTED } rc = fstat(vol->fd, &stat_buf); 5014a: 486e ffba pea %fp@(-70) 5014e: 2f00 movel %d0,%sp@- 50150: 4eb9 0004 3fd4 jsr 43fd4 if (rc != 0) 50156: 508f addql #8,%sp 50158: 4a80 tstl %d0 5015a: 6702 beqs 5015e <== ALWAYS TAKEN 5015c: 6030 bras 5018e <== NOT EXECUTED close(vol->fd); rtems_set_errno_and_return_minus_one(ENXIO); } /* Must be a block device. */ if (!S_ISBLK(stat_buf.st_mode)) 5015e: 202e ffc6 movel %fp@(-58),%d0 50162: 0280 0000 f000 andil #61440,%d0 50168: 0c80 0000 6000 cmpil #24576,%d0 5016e: 6702 beqs 50172 <== ALWAYS TAKEN 50170: 601c bras 5018e <== 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); 50172: 486b 005a pea %a3@(90) 50176: 2f3c 4004 4209 movel #1074020873,%sp@- 5017c: 2f2b 0056 movel %a3@(86),%sp@- 50180: 4eb9 0005 1750 jsr 51750 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) { 50186: 4fef 000c lea %sp@(12),%sp 5018a: 4a80 tstl %d0 5018c: 671a beqs 501a8 <== ALWAYS TAKEN close(vol->fd); 5018e: 2f2b 0056 movel %a3@(86),%sp@- <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); 50192: 7406 moveq #6,%d2 <== NOT EXECUTED } /* 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) { close(vol->fd); 50194: 4eb9 0004 3cd8 jsr 43cd8 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); 5019a: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 501a0: 2040 moveal %d0,%a0 <== NOT EXECUTED 501a2: 2082 movel %d2,%a0@ <== NOT EXECUTED 501a4: 6000 05ac braw 50752 <== NOT EXECUTED } /* Read boot record */ /* FIXME: Asserts FAT_MAX_BPB_SIZE < bdbuf block size */ sc = rtems_bdbuf_read( vol->dd, 0, &block); 501a8: 486e ffaa pea %fp@(-86) 501ac: 42a7 clrl %sp@- 501ae: 2f2b 005a movel %a3@(90),%sp@- 501b2: 4eb9 0004 e088 jsr 4e088 if (sc != RTEMS_SUCCESSFUL) 501b8: 4fef 000c lea %sp@(12),%sp 501bc: 4a80 tstl %d0 501be: 6704 beqs 501c4 <== ALWAYS TAKEN 501c0: 6000 00d6 braw 50298 <== NOT EXECUTED { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 501c4: 206e ffaa moveal %fp@(-86),%a0 501c8: 2268 001a moveal %a0@(26),%a1 501cc: 1229 000e moveb %a1@(14),%d1 501d0: 1e29 0013 moveb %a1@(19),%d7 501d4: 1829 000f moveb %a1@(15),%d4 501d8: 3441 moveaw %d1,%a2 501da: 1229 0014 moveb %a1@(20),%d1 501de: 1d47 ff95 moveb %d7,%fp@(-107) 501e2: 1e29 0016 moveb %a1@(22),%d7 501e6: 1d41 ff94 moveb %d1,%fp@(-108) 501ea: 1229 0017 moveb %a1@(23),%d1 501ee: 1d47 ff93 moveb %d7,%fp@(-109) 501f2: 1e29 0020 moveb %a1@(32),%d7 501f6: 1d41 ff92 moveb %d1,%fp@(-110) 501fa: 1229 0021 moveb %a1@(33),%d1 501fe: 1d47 ff91 moveb %d7,%fp@(-111) 50202: 1e29 0022 moveb %a1@(34),%d7 50206: 1d41 ff9c moveb %d1,%fp@(-100) 5020a: 1229 0023 moveb %a1@(35),%d1 5020e: 1d47 ff9b moveb %d7,%fp@(-101) 50212: 1e29 0024 moveb %a1@(36),%d7 50216: 1d41 ff99 moveb %d1,%fp@(-103) 5021a: 1229 0025 moveb %a1@(37),%d1 5021e: 1a29 0011 moveb %a1@(17),%d5 50222: 1d47 ff9a moveb %d7,%fp@(-102) 50226: 1e29 0026 moveb %a1@(38),%d7 5022a: 1d41 ffa2 moveb %d1,%fp@(-94) 5022e: 1229 0027 moveb %a1@(39),%d1 50232: 1d44 ff90 moveb %d4,%fp@(-112) 50236: 3845 moveaw %d5,%a4 50238: 1029 000c moveb %a1@(12),%d0 5023c: 1c29 000b moveb %a1@(11),%d6 50240: 1429 000d moveb %a1@(13),%d2 50244: 1829 0010 moveb %a1@(16),%d4 50248: 1a29 0012 moveb %a1@(18),%d5 5024c: 1d47 ff9d moveb %d7,%fp@(-99) 50250: 1d41 ff8f moveb %d1,%fp@(-113) 50254: 1e29 002c moveb %a1@(44),%d7 50258: 1229 002d moveb %a1@(45),%d1 5025c: 1d47 ffa5 moveb %d7,%fp@(-91) 50260: 1d41 ffa4 moveb %d1,%fp@(-92) 50264: 1e29 002e moveb %a1@(46),%d7 50268: 1229 002f moveb %a1@(47),%d1 5026c: 1d47 ffa3 moveb %d7,%fp@(-93) 50270: 1d41 ffa1 moveb %d1,%fp@(-95) 50274: 1e29 0030 moveb %a1@(48),%d7 50278: 1229 0031 moveb %a1@(49),%d1 5027c: 1629 0028 moveb %a1@(40),%d3 sc = rtems_bdbuf_release( block); 50280: 2f08 movel %a0,%sp@- { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 50282: 3a40 moveaw %d0,%a5 50284: 1d47 ffa7 moveb %d7,%fp@(-89) 50288: 1d41 ffa6 moveb %d1,%fp@(-90) sc = rtems_bdbuf_release( block); 5028c: 4eb9 0004 e214 jsr 4e214 if (sc != RTEMS_SUCCESSFUL) 50292: 588f addql #4,%sp 50294: 4a80 tstl %d0 50296: 671a beqs 502b2 <== ALWAYS TAKEN { close(vol->fd); 50298: 2f2b 0056 movel %a3@(86),%sp@- <== NOT EXECUTED 5029c: 4eb9 0004 3cd8 jsr 43cd8 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EIO ); 502a2: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 502a8: 7205 moveq #5,%d1 <== NOT EXECUTED 502aa: 2040 moveal %d0,%a0 <== NOT EXECUTED 502ac: 2081 movel %d1,%a0@ <== NOT EXECUTED 502ae: 6000 04a2 braw 50752 <== NOT EXECUTED } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 502b2: 4280 clrl %d0 502b4: 320d movew %a5,%d1 502b6: 1001 moveb %d1,%d0 502b8: 4281 clrl %d1 502ba: 1206 moveb %d6,%d1 502bc: e188 lsll #8,%d0 502be: 8081 orl %d1,%d0 502c0: 3240 moveaw %d0,%a1 502c2: 3680 movew %d0,%a3@ if ( (vol->bps != 512) && 502c4: 4280 clrl %d0 502c6: 3009 movew %a1,%d0 502c8: 0c80 0000 0200 cmpil #512,%d0 502ce: 671c beqs 502ec <== ALWAYS TAKEN 502d0: 0c80 0000 0400 cmpil #1024,%d0 <== NOT EXECUTED 502d6: 6714 beqs 502ec <== NOT EXECUTED (vol->bps != 1024) && 502d8: 0c80 0000 0800 cmpil #2048,%d0 <== NOT EXECUTED 502de: 670c beqs 502ec <== NOT EXECUTED (vol->bps != 2048) && 502e0: 0c80 0000 1000 cmpil #4096,%d0 <== NOT EXECUTED 502e6: 6704 beqs 502ec <== NOT EXECUTED 502e8: 6000 0296 braw 50580 <== 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; 502ec: 7209 moveq #9,%d1 502ee: 4200 clrb %d0 502f0: 1740 0003 moveb %d0,%a3@(3) 502f4: 4280 clrl %d0 502f6: 3009 movew %a1,%d0 502f8: e2a8 lsrl %d1,%d0 502fa: 600c bras 50308 i >>= 1, vol->sec_mul++); 502fc: e280 asrl #1,%d0 <== NOT EXECUTED 502fe: 122b 0003 moveb %a3@(3),%d1 <== NOT EXECUTED 50302: 5281 addql #1,%d1 <== NOT EXECUTED 50304: 1741 0003 moveb %d1,%a3@(3) <== NOT EXECUTED (vol->bps != 4096)) { close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; 50308: 0800 0000 btst #0,%d0 5030c: 67ee beqs 502fc <== NEVER TAKEN i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 5030e: 4280 clrl %d0 50310: 4206 clrb %d6 50312: 3009 movew %a1,%d0 50314: 1746 0002 moveb %d6,%a3@(2) 50318: 2c00 movel %d0,%d6 5031a: 6008 bras 50324 i >>= 1, vol->sec_log2++); 5031c: 5281 addql #1,%d1 5031e: e286 asrl #1,%d6 50320: 1741 0002 moveb %d1,%a3@(2) 50324: 122b 0002 moveb %a3@(2),%d1 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; 50328: 0806 0000 btst #0,%d6 5032c: 67ee beqs 5031c i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; vol->bytes_per_block_log2 = vol->sec_log2; vol->sectors_per_block = 1; 5032e: 7e01 moveq #1,%d7 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; 50330: 3749 000a movew %a1,%a3@(10) vol->bytes_per_block_log2 = vol->sec_log2; 50334: 1741 000c moveb %d1,%a3@(12) vol->sectors_per_block = 1; 50338: 1747 0009 moveb %d7,%a3@(9) vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); 5033c: 1742 0004 moveb %d2,%a3@(4) /* * "sectors per cluster" of zero is invalid * (and would hang the following loop) */ if (vol->spc == 0) 50340: 6604 bnes 50346 <== ALWAYS TAKEN 50342: 6000 023c braw 50580 <== NOT EXECUTED { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 50346: 4206 clrb %d6 50348: 1746 0005 moveb %d6,%a3@(5) 5034c: 4286 clrl %d6 5034e: 1c02 moveb %d2,%d6 50350: 6010 bras 50362 i >>= 1, vol->spc_log2++); 50352: e286 asrl #1,%d6 50354: 1e2b 0005 moveb %a3@(5),%d7 50358: 3a47 moveaw %d7,%a5 5035a: 528d addql #1,%a5 5035c: 3e0d movew %a5,%d7 5035e: 1747 0005 moveb %d7,%a3@(5) { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 50362: 0806 0000 btst #0,%d6 50366: 67ea beqs 50352 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) 50368: 4286 clrl %d6 5036a: 1c2b 0005 moveb %a3@(5),%d6 5036e: 2e00 movel %d0,%d7 50370: edaf lsll %d6,%d7 50372: 2c07 movel %d7,%d6 50374: 3747 0006 movew %d7,%a3@(6) 50378: 4287 clrl %d7 5037a: 3e06 movew %d6,%d7 5037c: 2a47 moveal %d7,%a5 5037e: bbfc 0000 8000 cmpal #32768,%a5 50384: 6304 blss 5038a <== ALWAYS TAKEN 50386: 6000 01f8 braw 50580 <== NOT EXECUTED { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 5038a: 4207 clrb %d7 5038c: 0286 0000 ffff andil #65535,%d6 50392: 1747 0008 moveb %d7,%a3@(8) 50396: 6010 bras 503a8 i >>= 1, vol->bpc_log2++); 50398: e286 asrl #1,%d6 5039a: 1e2b 0008 moveb %a3@(8),%d7 5039e: 3a47 moveaw %d7,%a5 503a0: 528d addql #1,%a5 503a2: 3e0d movew %a5,%d7 503a4: 1747 0008 moveb %d7,%a3@(8) { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 503a8: 0806 0000 btst #0,%d6 503ac: 67ea beqs 50398 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); 503ae: 4286 clrl %d6 503b0: 1c2e ff90 moveb %fp@(-112),%d6 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)) / 503b4: 2040 moveal %d0,%a0 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); 503b6: 3e0a movew %a2,%d7 503b8: e18e lsll #8,%d6 } 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); 503ba: 1744 000d moveb %d4,%a3@(13) vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 503be: 0287 0000 00ff andil #255,%d7 503c4: 8c87 orl %d7,%d6 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 503c6: 4287 clrl %d7 503c8: 1e05 moveb %d5,%d7 503ca: 3a0c movew %a4,%d5 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); 503cc: 3246 moveaw %d6,%a1 503ce: 3746 0018 movew %d6,%a3@(24) vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 503d2: e18f lsll #8,%d7 503d4: 4286 clrl %d6 503d6: 1c05 moveb %d5,%d6 503d8: 8e86 orl %d6,%d7 503da: 3747 0022 movew %d7,%a3@(34) /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 503de: eb8f lsll #5,%d7 503e0: 41f0 78ff lea %a0@(ffffffff,%d7:l),%a0 503e4: 2c08 movel %a0,%d6 503e6: 4c40 6806 remsl %d0,%d6,%d6 vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 503ea: 4280 clrl %d0 503ec: 1001 moveb %d1,%d0 503ee: 2206 movel %d6,%d1 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 503f0: 4287 clrl %d7 503f2: 1e2e ff93 moveb %fp@(-109),%d7 /* 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; 503f6: e1a9 lsll %d0,%d1 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 503f8: 4280 clrl %d0 503fa: 102e ff92 moveb %fp@(-110),%d0 503fe: e188 lsll #8,%d0 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)) / 50400: 2746 0024 movel %d6,%a3@(36) vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 50404: 8087 orl %d7,%d0 /* 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; 50406: 2741 0028 movel %d1,%a3@(40) if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 5040a: 4a40 tstw %d0 5040c: 6708 beqs 50416 <== NEVER TAKEN vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); 5040e: 0280 0000 ffff andil #65535,%d0 50414: 6026 bras 5043c else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); 50416: 4280 clrl %d0 <== NOT EXECUTED 50418: 4287 clrl %d7 <== NOT EXECUTED 5041a: 102e ffa2 moveb %fp@(-94),%d0 <== NOT EXECUTED 5041e: 1e2e ff9d moveb %fp@(-99),%d7 <== NOT EXECUTED 50422: e188 lsll #8,%d0 <== NOT EXECUTED 50424: 4847 swap %d7 <== NOT EXECUTED 50426: 4247 clrw %d7 <== NOT EXECUTED 50428: 1a2e ff8f moveb %fp@(-113),%d5 <== NOT EXECUTED 5042c: 8087 orl %d7,%d0 <== NOT EXECUTED 5042e: 4287 clrl %d7 <== NOT EXECUTED 50430: 1e2e ff9a moveb %fp@(-102),%d7 <== NOT EXECUTED 50434: 8087 orl %d7,%d0 <== NOT EXECUTED 50436: 7e18 moveq #24,%d7 <== NOT EXECUTED 50438: efad lsll %d7,%d5 <== NOT EXECUTED 5043a: 8085 orl %d5,%d0 <== NOT EXECUTED vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 5043c: 4281 clrl %d1 5043e: 1204 moveb %d4,%d1 50440: 41eb 001a lea %a3@(26),%a0 vol->rdir_size = vol->rdir_secs << vol->sec_log2; if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); 50444: 2740 001a movel %d0,%a3@(26) vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 50448: 4c10 1800 mulsl %a0@,%d1 5044c: 4280 clrl %d0 5044e: 3009 movew %a1,%d0 50450: d280 addl %d0,%d1 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) 50452: 4280 clrl %d0 50454: 102e ff94 moveb %fp@(-108),%d0 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 + 50458: dc81 addl %d1,%d6 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; 5045a: 2741 001e movel %d1,%a3@(30) if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 5045e: 4281 clrl %d1 50460: 122e ff95 moveb %fp@(-107),%d1 50464: e188 lsll #8,%d0 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 + 50466: 2746 0030 movel %d6,%a3@(48) 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) 5046a: 8081 orl %d1,%d0 5046c: 4a40 tstw %d0 5046e: 6708 beqs 50478 <== NEVER TAKEN vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); 50470: 0280 0000 ffff andil #65535,%d0 50476: 6026 bras 5049e else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); 50478: 4280 clrl %d0 <== NOT EXECUTED 5047a: 4281 clrl %d1 <== NOT EXECUTED 5047c: 102e ff9c moveb %fp@(-100),%d0 <== NOT EXECUTED 50480: 122e ff9b moveb %fp@(-101),%d1 <== NOT EXECUTED 50484: 7818 moveq #24,%d4 <== NOT EXECUTED 50486: 4841 swap %d1 <== NOT EXECUTED 50488: 4241 clrw %d1 <== NOT EXECUTED 5048a: e188 lsll #8,%d0 <== NOT EXECUTED 5048c: 8081 orl %d1,%d0 <== NOT EXECUTED 5048e: 4281 clrl %d1 <== NOT EXECUTED 50490: 122e ff91 moveb %fp@(-111),%d1 <== NOT EXECUTED 50494: 8081 orl %d1,%d0 <== NOT EXECUTED 50496: 122e ff99 moveb %fp@(-103),%d1 <== NOT EXECUTED 5049a: e9a9 lsll %d4,%d1 <== NOT EXECUTED 5049c: 8081 orl %d1,%d0 <== NOT EXECUTED 5049e: 2740 002c movel %d0,%a3@(44) data_secs = vol->tot_secs - vol->data_fsec; 504a2: 2a2b 002c movel %a3@(44),%d5 504a6: 9a86 subl %d6,%d5 504a8: 2c05 movel %d5,%d6 vol->data_cls = data_secs / vol->spc; 504aa: 0282 0000 00ff andil #255,%d2 504b0: 4c42 6006 remul %d2,%d6,%d6 504b4: 2746 0034 movel %d6,%a3@(52) /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) 504b8: 0c86 0000 0ff4 cmpil #4084,%d6 504be: 621a bhis 504da <== NEVER TAKEN { vol->type = FAT_FAT12; vol->mask = FAT_FAT12_MASK; 504c0: 2e3c 0000 0fff movel #4095,%d7 vol->eoc_val = FAT_FAT12_EOC; 504c6: 307c 0ff8 moveaw #4088,%a0 vol->data_cls = data_secs / vol->spc; /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) { vol->type = FAT_FAT12; 504ca: 7c01 moveq #1,%d6 vol->mask = FAT_FAT12_MASK; 504cc: 2747 0010 movel %d7,%a3@(16) vol->data_cls = data_secs / vol->spc; /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) { vol->type = FAT_FAT12; 504d0: 1746 000e moveb %d6,%a3@(14) vol->mask = FAT_FAT12_MASK; vol->eoc_val = FAT_FAT12_EOC; 504d4: 2748 0014 movel %a0,%a3@(20) 504d8: 603e bras 50518 } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) 504da: 0c86 0000 fff4 cmpil #65524,%d6 <== NOT EXECUTED 504e0: 621c bhis 504fe <== NOT EXECUTED { vol->type = FAT_FAT16; vol->mask = FAT_FAT16_MASK; 504e2: 223c 0000 ffff movel #65535,%d1 <== NOT EXECUTED vol->eoc_val = FAT_FAT16_EOC; 504e8: 243c 0000 fff8 movel #65528,%d2 <== NOT EXECUTED } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) { vol->type = FAT_FAT16; 504ee: 7002 moveq #2,%d0 <== NOT EXECUTED vol->mask = FAT_FAT16_MASK; 504f0: 2741 0010 movel %d1,%a3@(16) <== NOT EXECUTED } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) { vol->type = FAT_FAT16; 504f4: 1740 000e moveb %d0,%a3@(14) <== NOT EXECUTED vol->mask = FAT_FAT16_MASK; vol->eoc_val = FAT_FAT16_EOC; 504f8: 2742 0014 movel %d2,%a3@(20) <== NOT EXECUTED 504fc: 601a bras 50518 <== NOT EXECUTED } else { vol->type = FAT_FAT32; 504fe: 7804 moveq #4,%d4 <== NOT EXECUTED vol->mask = FAT_FAT32_MASK; 50500: 2a3c 0fff ffff movel #268435455,%d5 <== NOT EXECUTED vol->eoc_val = FAT_FAT32_EOC; 50506: 2c3c 0fff fff8 movel #268435448,%d6 <== NOT EXECUTED vol->mask = FAT_FAT16_MASK; vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; 5050c: 1744 000e moveb %d4,%a3@(14) <== NOT EXECUTED vol->mask = FAT_FAT32_MASK; 50510: 2745 0010 movel %d5,%a3@(16) <== NOT EXECUTED vol->eoc_val = FAT_FAT32_EOC; 50514: 2746 0014 movel %d6,%a3@(20) <== NOT EXECUTED } } if (vol->type == FAT_FAT32) 50518: 4280 clrl %d0 5051a: 102b 000e moveb %a3@(14),%d0 5051e: 7e04 moveq #4,%d7 50520: be80 cmpl %d0,%d7 50522: 6600 018c bnew 506b0 { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 50526: 4280 clrl %d0 <== NOT EXECUTED 50528: 4281 clrl %d1 <== NOT EXECUTED 5052a: 102e ffa4 moveb %fp@(-92),%d0 <== NOT EXECUTED 5052e: 122e ffa3 moveb %fp@(-93),%d1 <== NOT EXECUTED 50532: e188 lsll #8,%d0 <== NOT EXECUTED 50534: 4841 swap %d1 <== NOT EXECUTED 50536: 4241 clrw %d1 <== NOT EXECUTED 50538: 182e ffa1 moveb %fp@(-95),%d4 <== NOT EXECUTED 5053c: 8081 orl %d1,%d0 <== NOT EXECUTED 5053e: 4281 clrl %d1 <== NOT EXECUTED 50540: 122e ffa5 moveb %fp@(-91),%d1 <== NOT EXECUTED 50544: 8081 orl %d1,%d0 <== NOT EXECUTED 50546: 7218 moveq #24,%d1 <== NOT EXECUTED 50548: e3ac lsll %d1,%d4 <== NOT EXECUTED 5054a: 8084 orl %d4,%d0 <== NOT EXECUTED 5054c: 2740 0038 movel %d0,%a3@(56) <== NOT EXECUTED vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 50550: 7080 moveq #-128,%d0 <== NOT EXECUTED 50552: c083 andl %d3,%d0 <== NOT EXECUTED 50554: 1740 004e moveb %d0,%a3@(78) <== NOT EXECUTED if (vol->mirror) 50558: 670a beqs 50564 <== NOT EXECUTED vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; 5055a: 740f moveq #15,%d2 <== NOT EXECUTED 5055c: c682 andl %d2,%d3 <== NOT EXECUTED 5055e: 1743 0054 moveb %d3,%a3@(84) <== NOT EXECUTED 50562: 6006 bras 5056a <== NOT EXECUTED else vol->afat = 0; 50564: 4204 clrb %d4 <== NOT EXECUTED 50566: 1744 0054 moveb %d4,%a3@(84) <== NOT EXECUTED vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); 5056a: 4280 clrl %d0 <== NOT EXECUTED 5056c: 102e ffa6 moveb %fp@(-90),%d0 <== NOT EXECUTED 50570: 4281 clrl %d1 <== NOT EXECUTED 50572: 122e ffa7 moveb %fp@(-89),%d1 <== NOT EXECUTED 50576: e188 lsll #8,%d0 <== NOT EXECUTED 50578: 8081 orl %d1,%d0 <== NOT EXECUTED 5057a: 3740 003c movew %d0,%a3@(60) <== NOT EXECUTED if( vol->info_sec == 0 ) 5057e: 661a bnes 5059a <== NOT EXECUTED { close(vol->fd); 50580: 2f2b 0056 movel %a3@(86),%sp@- <== NOT EXECUTED 50584: 4eb9 0004 3cd8 jsr 43cd8 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 5058a: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 50590: 2040 moveal %d0,%a0 <== NOT EXECUTED 50592: 7016 moveq #22,%d0 <== NOT EXECUTED 50594: 2080 movel %d0,%a0@ <== NOT EXECUTED 50596: 6000 01ba braw 50752 <== NOT EXECUTED } else { ret = _fat_block_read(fs_info, vol->info_sec , 0, FAT_FSI_LEADSIG_SIZE, fs_info_sector); 5059a: 260e movel %fp,%d3 <== NOT EXECUTED 5059c: 0683 ffff ffae addil #-82,%d3 <== NOT EXECUTED close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , 0, 505a2: 45f9 0004 fdfc lea 4fdfc <_fat_block_read>,%a2 <== NOT EXECUTED 505a8: 2f03 movel %d3,%sp@- <== NOT EXECUTED 505aa: 4878 0004 pea 4 <== NOT EXECUTED 505ae: 42a7 clrl %sp@- <== NOT EXECUTED 505b0: 3f00 movew %d0,%sp@- <== NOT EXECUTED 505b2: 4267 clrw %sp@- <== NOT EXECUTED 505b4: 2f0b movel %a3,%sp@- <== NOT EXECUTED 505b6: 4e92 jsr %a2@ <== NOT EXECUTED FAT_FSI_LEADSIG_SIZE, fs_info_sector); if ( ret < 0 ) 505b8: 4fef 0014 lea %sp@(20),%sp <== NOT EXECUTED 505bc: 4a80 tstl %d0 <== NOT EXECUTED 505be: 6c0e bges 505ce <== NOT EXECUTED { close(vol->fd); 505c0: 2f2b 0056 movel %a3@(86),%sp@- <== NOT EXECUTED 505c4: 4eb9 0004 3cd8 jsr 43cd8 <== NOT EXECUTED 505ca: 6000 0186 braw 50752 <== NOT EXECUTED return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != 505ce: 4281 clrl %d1 <== NOT EXECUTED 505d0: 4282 clrl %d2 <== NOT EXECUTED 505d2: 122e ffaf moveb %fp@(-81),%d1 <== NOT EXECUTED 505d6: 142e ffb0 moveb %fp@(-80),%d2 <== NOT EXECUTED 505da: 4280 clrl %d0 <== NOT EXECUTED 505dc: 102e ffae moveb %fp@(-82),%d0 <== NOT EXECUTED 505e0: 4842 swap %d2 <== NOT EXECUTED 505e2: 4242 clrw %d2 <== NOT EXECUTED 505e4: e189 lsll #8,%d1 <== NOT EXECUTED 505e6: 8282 orl %d2,%d1 <== NOT EXECUTED 505e8: 4282 clrl %d2 <== NOT EXECUTED 505ea: 142e ffb1 moveb %fp@(-79),%d2 <== NOT EXECUTED 505ee: 8280 orl %d0,%d1 <== NOT EXECUTED 505f0: 7018 moveq #24,%d0 <== NOT EXECUTED 505f2: e1aa lsll %d0,%d2 <== NOT EXECUTED 505f4: 8282 orl %d2,%d1 <== NOT EXECUTED 505f6: 0c81 4161 5252 cmpil #1096897106,%d1 <== NOT EXECUTED 505fc: 6722 beqs 50620 <== NOT EXECUTED * 0 on success, or -1 if error occured and errno set appropriately */ int _fat_block_release(fat_fs_info_t *fs_info) { return fat_buf_release(fs_info); 505fe: 2f0b movel %a3,%sp@- <== NOT EXECUTED if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != FAT_FSINFO_LEAD_SIGNATURE_VALUE) { _fat_block_release(fs_info); close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); 50600: 7e16 moveq #22,%d7 <== NOT EXECUTED * 0 on success, or -1 if error occured and errno set appropriately */ int _fat_block_release(fat_fs_info_t *fs_info) { return fat_buf_release(fs_info); 50602: 4eb9 0004 fbaa jsr 4fbaa <== NOT EXECUTED if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != FAT_FSINFO_LEAD_SIGNATURE_VALUE) { _fat_block_release(fs_info); close(vol->fd); 50608: 2f2b 0056 movel %a3@(86),%sp@- <== NOT EXECUTED 5060c: 4eb9 0004 3cd8 jsr 43cd8 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 50612: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 50618: 2040 moveal %d0,%a0 <== NOT EXECUTED 5061a: 2087 movel %d7,%a0@ <== NOT EXECUTED 5061c: 6000 01ae braw 507cc <== NOT EXECUTED } else { ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, 50620: 2f03 movel %d3,%sp@- <== NOT EXECUTED 50622: 4878 000c pea c <== NOT EXECUTED 50626: 4280 clrl %d0 <== NOT EXECUTED 50628: 4878 01e4 pea 1e4 <== NOT EXECUTED 5062c: 302b 003c movew %a3@(60),%d0 <== NOT EXECUTED 50630: 2f00 movel %d0,%sp@- <== NOT EXECUTED 50632: 2f0b movel %a3,%sp@- <== NOT EXECUTED 50634: 4e92 jsr %a2@ <== NOT EXECUTED FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) 50636: 4fef 0014 lea %sp@(20),%sp <== NOT EXECUTED 5063a: 4a80 tstl %d0 <== NOT EXECUTED 5063c: 6c16 bges 50654 <== NOT EXECUTED * 0 on success, or -1 if error occured and errno set appropriately */ int _fat_block_release(fat_fs_info_t *fs_info) { return fat_buf_release(fs_info); 5063e: 2f0b movel %a3,%sp@- <== NOT EXECUTED 50640: 4eb9 0004 fbaa jsr 4fbaa <== 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); 50646: 2f2b 0056 movel %a3@(86),%sp@- <== NOT EXECUTED 5064a: 4eb9 0004 3cd8 jsr 43cd8 <== NOT EXECUTED 50650: 6000 017a braw 507cc <== NOT EXECUTED return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 50654: 4280 clrl %d0 <== NOT EXECUTED 50656: 4281 clrl %d1 <== NOT EXECUTED 50658: 102e ffb3 moveb %fp@(-77),%d0 <== NOT EXECUTED 5065c: 122e ffb4 moveb %fp@(-76),%d1 <== NOT EXECUTED 50660: 7418 moveq #24,%d2 <== NOT EXECUTED 50662: 4841 swap %d1 <== NOT EXECUTED 50664: 4241 clrw %d1 <== NOT EXECUTED 50666: e188 lsll #8,%d0 <== NOT EXECUTED 50668: 8081 orl %d1,%d0 <== NOT EXECUTED 5066a: 4281 clrl %d1 <== NOT EXECUTED 5066c: 122e ffb2 moveb %fp@(-78),%d1 <== NOT EXECUTED 50670: 8081 orl %d1,%d0 <== NOT EXECUTED 50672: 122e ffb5 moveb %fp@(-75),%d1 <== NOT EXECUTED 50676: e5a9 lsll %d2,%d1 <== NOT EXECUTED 50678: 8081 orl %d1,%d0 <== NOT EXECUTED vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 5067a: 4281 clrl %d1 <== NOT EXECUTED 5067c: 122e ffb8 moveb %fp@(-72),%d1 <== NOT EXECUTED _fat_block_release(fs_info); close(vol->fd); return -1; } vol->free_cls_in_fs_info = 50680: 2740 0042 movel %d0,%a3@(66) <== NOT EXECUTED 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); 50684: 4841 swap %d1 <== NOT EXECUTED 50686: 4241 clrw %d1 <== NOT EXECUTED 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; 50688: 2740 003e movel %d0,%a3@(62) <== NOT EXECUTED vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 5068c: 4280 clrl %d0 <== NOT EXECUTED 5068e: 102e ffb7 moveb %fp@(-73),%d0 <== NOT EXECUTED 50692: e188 lsll #8,%d0 <== NOT EXECUTED 50694: 8081 orl %d1,%d0 <== NOT EXECUTED 50696: 4281 clrl %d1 <== NOT EXECUTED 50698: 122e ffb6 moveb %fp@(-74),%d1 <== NOT EXECUTED 5069c: 8081 orl %d1,%d0 <== NOT EXECUTED 5069e: 122e ffb9 moveb %fp@(-71),%d1 <== NOT EXECUTED 506a2: e5a9 lsll %d2,%d1 <== NOT EXECUTED 506a4: 8081 orl %d1,%d0 <== NOT EXECUTED } 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 = 506a6: 2740 004a movel %d0,%a3@(74) <== NOT EXECUTED FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); vol->next_cl = vol->next_cl_in_fs_info; 506aa: 2740 0046 movel %d0,%a3@(70) <== NOT EXECUTED 506ae: 6018 bras 506c8 <== NOT EXECUTED else { vol->rdir_cl = 0; vol->mirror = 0; vol->afat = 0; vol->free_cls = FAT_UNDEFINED_VALUE; 506b0: 7aff moveq #-1,%d5 } } else { vol->rdir_cl = 0; vol->mirror = 0; 506b2: 4204 clrb %d4 } } } else { vol->rdir_cl = 0; 506b4: 42ab 0038 clrl %a3@(56) vol->mirror = 0; 506b8: 1744 004e moveb %d4,%a3@(78) vol->afat = 0; 506bc: 1744 0054 moveb %d4,%a3@(84) vol->free_cls = FAT_UNDEFINED_VALUE; 506c0: 2745 003e movel %d5,%a3@(62) vol->next_cl = FAT_UNDEFINED_VALUE; 506c4: 2745 0046 movel %d5,%a3@(70) * 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); 506c8: 2f0b movel %a3,%sp@- _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)); 506ca: 45f9 0004 3c8c lea 43c8c ,%a2 * 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); 506d0: 4eb9 0004 fbaa jsr 4fbaa vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; 506d6: 4280 clrl %d0 506d8: 102b 0054 moveb %a3@(84),%d0 506dc: 41eb 001a lea %a3@(26),%a0 506e0: 4c10 0800 mulsl %a0@,%d0 506e4: 4281 clrl %d1 506e6: 322b 0018 movew %a3@(24),%d1 506ea: d081 addl %d1,%d0 506ec: 2740 0050 movel %d0,%a3@(80) /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 506f0: 4878 000c pea c 506f4: 4878 0002 pea 2 506f8: 4e92 jsr %a2@ if ( fs_info->vhash == NULL ) 506fa: 4fef 000c lea %sp@(12),%sp _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)); 506fe: 2240 moveal %d0,%a1 50700: 2740 0062 movel %d0,%a3@(98) if ( fs_info->vhash == NULL ) 50704: 6736 beqs 5073c <== 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 ); 50706: 41e9 0010 lea %a1@(16),%a0 5070a: 5880 addql #4,%d0 5070c: 2348 000c movel %a0,%a1@(12) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 50710: 41e9 000c lea %a1@(12),%a0 Chain_Node *tail = _Chain_Tail( the_chain ); 50714: 2280 movel %d0,%a1@ head->next = tail; head->previous = NULL; 50716: 42a9 0004 clrl %a1@(4) tail->previous = head; 5071a: 2349 0008 movel %a1,%a1@(8) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 5071e: 42a9 0010 clrl %a1@(16) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 50722: 2348 0014 movel %a0,%a1@(20) } 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)); 50726: 4878 000c pea c 5072a: 4878 0002 pea 2 5072e: 4e92 jsr %a2@ if ( fs_info->rhash == NULL ) 50730: 508f addql #8,%sp } 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)); 50732: 2240 moveal %d0,%a1 50734: 2740 0066 movel %d0,%a3@(102) if ( fs_info->rhash == NULL ) 50738: 661e bnes 50758 <== ALWAYS TAKEN 5073a: 6070 bras 507ac <== 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); 5073c: 2f2b 0056 movel %a3@(86),%sp@- <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 50740: 7c0c moveq #12,%d6 <== 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); 50742: 4eb9 0004 3cd8 jsr 43cd8 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 50748: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 5074e: 2040 moveal %d0,%a0 <== NOT EXECUTED 50750: 2086 movel %d6,%a0@ <== NOT EXECUTED 50752: 588f addql #4,%sp <== NOT EXECUTED 50754: 6000 00ee braw 50844 <== NOT EXECUTED Chain_Node *tail = _Chain_Tail( the_chain ); 50758: 41e9 0010 lea %a1@(16),%a0 5075c: 5880 addql #4,%d0 5075e: 2348 000c movel %a0,%a1@(12) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 50762: 41e9 000c lea %a1@(12),%a0 Chain_Node *tail = _Chain_Tail( the_chain ); 50766: 2280 movel %d0,%a1@ 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; 50768: 203c 0000 0100 movel #256,%d0 head->next = tail; head->previous = NULL; 5076e: 42a9 0004 clrl %a1@(4) fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 50772: 222b 002c movel %a3@(44),%d1 tail->previous = head; 50776: 2349 0008 movel %a1,%a1@(8) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 5077a: 42a9 0010 clrl %a1@(16) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 5077e: 2348 0014 movel %a0,%a1@(20) 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; 50782: 2740 0072 movel %d0,%a3@(114) fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 50786: 4280 clrl %d0 50788: 102b 0003 moveb %a3@(3),%d0 5078c: e1a9 lsll %d0,%d1 fs_info->index = 0; 5078e: 42ab 006e clrl %a3@(110) } 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; 50792: e989 lsll #4,%d1 50794: 2741 0076 movel %d1,%a3@(118) fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 50798: 4878 0001 pea 1 5079c: 4878 0100 pea 100 507a0: 4e92 jsr %a2@ if ( fs_info->uino == NULL ) 507a2: 508f addql #8,%sp 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)); 507a4: 2740 006a movel %d0,%a3@(106) if ( fs_info->uino == NULL ) 507a8: 6654 bnes 507fe <== ALWAYS TAKEN 507aa: 6024 bras 507d0 <== 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); 507ac: 2f2b 0056 movel %a3@(86),%sp@- <== NOT EXECUTED free(fs_info->vhash); rtems_set_errno_and_return_minus_one( ENOMEM ); 507b0: 7a0c moveq #12,%d5 <== 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); 507b2: 4eb9 0004 3cd8 jsr 43cd8 <== NOT EXECUTED free(fs_info->vhash); 507b8: 2f2b 0062 movel %a3@(98),%sp@- <== NOT EXECUTED 507bc: 4eb9 0004 3f4c jsr 43f4c <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 507c2: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 507c8: 2040 moveal %d0,%a0 <== NOT EXECUTED 507ca: 2085 movel %d5,%a0@ <== NOT EXECUTED 507cc: 508f addql #8,%sp <== NOT EXECUTED 507ce: 6074 bras 50844 <== 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); 507d0: 2f2b 0056 movel %a3@(86),%sp@- <== NOT EXECUTED free(fs_info->vhash); 507d4: 45f9 0004 3f4c lea 43f4c ,%a2 <== NOT EXECUTED free(fs_info->rhash); rtems_set_errno_and_return_minus_one( ENOMEM ); 507da: 780c moveq #12,%d4 <== 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); 507dc: 4eb9 0004 3cd8 jsr 43cd8 <== NOT EXECUTED free(fs_info->vhash); 507e2: 2f2b 0062 movel %a3@(98),%sp@- <== NOT EXECUTED 507e6: 4e92 jsr %a2@ <== NOT EXECUTED free(fs_info->rhash); 507e8: 2f2b 0066 movel %a3@(102),%sp@- <== NOT EXECUTED 507ec: 4e92 jsr %a2@ <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 507ee: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 507f4: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED 507f8: 2040 moveal %d0,%a0 <== NOT EXECUTED 507fa: 2084 movel %d4,%a0@ <== NOT EXECUTED 507fc: 6046 bras 50844 <== NOT EXECUTED } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); 507fe: 4878 0001 pea 1 50802: 4280 clrl %d0 50804: 3013 movew %a3@,%d0 50806: 2f00 movel %d0,%sp@- 50808: 4e92 jsr %a2@ if (fs_info->sec_buf == NULL) 5080a: 508f addql #8,%sp 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)); 5080c: 2740 0084 movel %d0,%a3@(132) if (fs_info->sec_buf == NULL) 50810: 6636 bnes 50848 <== ALWAYS TAKEN { close(vol->fd); 50812: 2f2b 0056 movel %a3@(86),%sp@- <== NOT EXECUTED free(fs_info->vhash); 50816: 45f9 0004 3f4c lea 43f4c ,%a2 <== NOT EXECUTED free(fs_info->rhash); free(fs_info->uino); rtems_set_errno_and_return_minus_one( ENOMEM ); 5081c: 760c moveq #12,%d3 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); if (fs_info->sec_buf == NULL) { close(vol->fd); 5081e: 4eb9 0004 3cd8 jsr 43cd8 <== NOT EXECUTED free(fs_info->vhash); 50824: 2f2b 0062 movel %a3@(98),%sp@- <== NOT EXECUTED 50828: 4e92 jsr %a2@ <== NOT EXECUTED free(fs_info->rhash); 5082a: 2f2b 0066 movel %a3@(102),%sp@- <== NOT EXECUTED 5082e: 4e92 jsr %a2@ <== NOT EXECUTED free(fs_info->uino); 50830: 2f2b 006a movel %a3@(106),%sp@- <== NOT EXECUTED 50834: 4e92 jsr %a2@ <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 50836: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 5083c: 4fef 0010 lea %sp@(16),%sp <== NOT EXECUTED 50840: 2040 moveal %d0,%a0 <== NOT EXECUTED 50842: 2083 movel %d3,%a0@ <== NOT EXECUTED 50844: 70ff moveq #-1,%d0 <== NOT EXECUTED 50846: 6056 bras 5089e <== 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; 50848: 4280 clrl %d0 5084a: 102b 0004 moveb %a3@(4),%d0 5084e: 5380 subql #1,%d0 50850: 2200 movel %d0,%d1 50852: c2ab 0030 andl %a3@(48),%d1 /* * 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) 50856: 6704 beqs 5085c <== ALWAYS TAKEN vol->bytes_per_block_log2 = vol->bpc_log2; vol->sectors_per_block = vol->spc; } } return RC_OK; 50858: 4280 clrl %d0 <== NOT EXECUTED 5085a: 6042 bras 5089e <== 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))) 5085c: 4281 clrl %d1 5085e: 122b 000e moveb %a3@(14),%d1 50862: 7404 moveq #4,%d2 50864: b481 cmpl %d1,%d2 50866: 6706 beqs 5086e <== NEVER TAKEN return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 50868: c0ab 001e andl %a3@(30),%d0 * 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))) 5086c: 66ea bnes 50858 <== NEVER TAKEN { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); 5086e: 4878 0001 pea 1 50872: 4280 clrl %d0 50874: 302b 0006 movew %a3@(6),%d0 50878: 2f00 movel %d0,%sp@- 5087a: 2f2b 005a movel %a3@(90),%sp@- 5087e: 4eb9 0004 e5c2 jsr 4e5c2 if (sc == RTEMS_SUCCESSFUL) 50884: 4fef 000c lea %sp@(12),%sp 50888: 4a80 tstl %d0 5088a: 66cc bnes 50858 <== NEVER TAKEN { vol->bytes_per_block = vol->bpc; 5088c: 376b 0006 000a movew %a3@(6),%a3@(10) vol->bytes_per_block_log2 = vol->bpc_log2; 50892: 176b 0008 000c moveb %a3@(8),%a3@(12) vol->sectors_per_block = vol->spc; 50898: 176b 0004 0009 moveb %a3@(4),%a3@(9) } } return RC_OK; } 5089e: 4cee 3cfc ff64 moveml %fp@(-156),%d2-%d7/%a2-%a5 508a4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00055c40 : uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 55c40: 4e56 ffd0 linkw %fp,#-48 55c44: 122e 001f moveb %fp@(31),%d1 55c48: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 55c4c: 2a6e 0008 moveal %fp@(8),%a5 55c50: 246e 0014 moveal %fp@(20),%a2 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; 55c54: 2a2d 0034 movel %a5@(52),%d5 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 55c58: 266e 000c moveal %fp@(12),%a3 55c5c: 1d41 fffb moveb %d1,%fp@(-5) int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; 55c60: 42ae fffc clrl %fp@(-4) uint32_t save_cln = 0; uint32_t data_cls_val = fs_info->vol.data_cls + 2; uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; 55c64: 4292 clrl %a2@ if (count == 0) 55c66: 4aae 0010 tstl %fp@(16) 55c6a: 6700 0166 beqw 55dd2 return rc; if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE) 55c6e: 2e2d 0046 movel %a5@(70),%d7 55c72: 70ff moveq #-1,%d0 55c74: b087 cmpl %d7,%d0 55c76: 6602 bnes 55c7a uint32_t *last_cl, bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; 55c78: 7e02 moveq #2,%d7 uint32_t next_cln = 0; uint32_t save_cln = 0; uint32_t data_cls_val = fs_info->vol.data_cls + 2; 55c7a: 5485 addql #2,%d5 55c7c: 7802 moveq #2,%d4 55c7e: 4283 clrl %d3 } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 55c80: 49f9 0005 5968 lea 55968 ,%a4 55c86: 6000 00f6 braw 55d7e * 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); 55c8a: 486e fffc pea %fp@(-4) 55c8e: 2f07 movel %d7,%sp@- 55c90: 2f0d movel %a5,%sp@- 55c92: 4eb9 0005 57fc jsr 557fc if ( rc != RC_OK ) 55c98: 4fef 000c lea %sp@(12),%sp * 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); 55c9c: 2400 movel %d0,%d2 if ( rc != RC_OK ) 55c9e: 6716 beqs 55cb6 <== ALWAYS TAKEN { if (*cls_added != 0) 55ca0: 4a92 tstl %a2@ <== NOT EXECUTED 55ca2: 6700 0134 beqw 55dd8 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); 55ca6: 2f13 movel %a3@,%sp@- <== NOT EXECUTED 55ca8: 2f0d movel %a5,%sp@- <== NOT EXECUTED 55caa: 4eb9 0005 5b9c jsr 55b9c <== NOT EXECUTED 55cb0: 508f addql #8,%sp <== NOT EXECUTED 55cb2: 6000 0124 braw 55dd8 <== NOT EXECUTED return rc; } if (next_cln == FAT_GENFAT_FREE) 55cb6: 4aae fffc tstl %fp@(-4) 55cba: 6600 00b8 bnew 55d74 /* * 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) 55cbe: 4a92 tstl %a2@ 55cc0: 661e bnes 55ce0 <== NEVER TAKEN { *chain = cl4find; 55cc2: 2687 movel %d7,%a3@ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 55cc4: 4878 ffff pea ffffffff 55cc8: 2f07 movel %d7,%sp@- 55cca: 2f0d movel %a5,%sp@- 55ccc: 4e94 jsr %a4@ if ( rc != RC_OK ) 55cce: 4fef 000c lea %sp@(12),%sp 55cd2: 4a80 tstl %d0 55cd4: 6600 0100 bnew 55dd6 rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); if ( rc != RC_OK ) goto cleanup; } if (zero_fill) 55cd8: 4a2e fffb tstb %fp@(-5) 55cdc: 673a beqs 55d18 <== ALWAYS TAKEN 55cde: 6048 bras 55d28 <== NOT EXECUTED } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 55ce0: 4878 ffff pea ffffffff <== NOT EXECUTED 55ce4: 2f07 movel %d7,%sp@- <== NOT EXECUTED 55ce6: 2f0d movel %a5,%sp@- <== NOT EXECUTED 55ce8: 4e94 jsr %a4@ <== NOT EXECUTED if ( rc != RC_OK ) 55cea: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 55cee: 2c00 movel %d0,%d6 <== NOT EXECUTED if ( rc != RC_OK ) 55cf0: 6712 beqs 55d04 <== NOT EXECUTED { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 55cf2: 2f13 movel %a3@,%sp@- <== NOT EXECUTED } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 55cf4: 2406 movel %d6,%d2 <== NOT EXECUTED if ( rc != RC_OK ) { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 55cf6: 2f0d movel %a5,%sp@- <== NOT EXECUTED 55cf8: 4eb9 0005 5b9c jsr 55b9c <== NOT EXECUTED 55cfe: 508f addql #8,%sp <== NOT EXECUTED 55d00: 6000 00d6 braw 55dd8 <== NOT EXECUTED return rc; } rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); 55d04: 2f07 movel %d7,%sp@- <== NOT EXECUTED 55d06: 2f03 movel %d3,%sp@- <== NOT EXECUTED 55d08: 2f0d movel %a5,%sp@- <== NOT EXECUTED 55d0a: 4e94 jsr %a4@ <== NOT EXECUTED if ( rc != RC_OK ) 55d0c: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; } rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); 55d10: 2600 movel %d0,%d3 <== NOT EXECUTED if ( rc != RC_OK ) 55d12: 67c4 beqs 55cd8 <== NOT EXECUTED 55d14: 6000 0096 braw 55dac <== NOT EXECUTED goto cleanup; } } save_cln = cl4find; (*cls_added)++; 55d18: 2012 movel %a2@,%d0 55d1a: 5280 addql #1,%d0 55d1c: 2480 movel %d0,%a2@ /* have we satisfied request ? */ if (*cls_added == count) 55d1e: b0ae 0010 cmpl %fp@(16),%d0 55d22: 672a beqs 55d4e <== ALWAYS TAKEN 55d24: 2607 movel %d7,%d3 <== NOT EXECUTED 55d26: 604c bras 55d74 <== NOT EXECUTED goto cleanup; } if (zero_fill) { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); 55d28: 4280 clrl %d0 <== NOT EXECUTED if (fs_info->vol.bpc != bytes_written) 55d2a: 4283 clrl %d3 <== NOT EXECUTED goto cleanup; } if (zero_fill) { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); 55d2c: 42a7 clrl %sp@- <== NOT EXECUTED 55d2e: 302d 0006 movew %a5@(6),%d0 <== NOT EXECUTED 55d32: 2f00 movel %d0,%sp@- <== NOT EXECUTED 55d34: 42a7 clrl %sp@- <== NOT EXECUTED 55d36: 2f07 movel %d7,%sp@- <== NOT EXECUTED 55d38: 2f0d movel %a5,%sp@- <== NOT EXECUTED 55d3a: 4eb9 0004 ff10 jsr 4ff10 <== NOT EXECUTED if (fs_info->vol.bpc != bytes_written) 55d40: 4fef 0014 lea %sp@(20),%sp <== NOT EXECUTED 55d44: 362d 0006 movew %a5@(6),%d3 <== NOT EXECUTED 55d48: b083 cmpl %d3,%d0 <== NOT EXECUTED 55d4a: 67cc beqs 55d18 <== NOT EXECUTED 55d4c: 605c bras 55daa <== 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) 55d4e: 202d 003e movel %a5@(62),%d0 55d52: 72ff moveq #-1,%d1 (*cls_added)++; /* have we satisfied request ? */ if (*cls_added == count) { fs_info->vol.next_cl = save_cln; 55d54: 2b47 0046 movel %d7,%a5@(70) if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 55d58: b280 cmpl %d0,%d1 55d5a: 6706 beqs 55d62 <== ALWAYS TAKEN fs_info->vol.free_cls -= (*cls_added); 55d5c: 9092 subl %a2@,%d0 <== NOT EXECUTED 55d5e: 2b40 003e movel %d0,%a5@(62) <== NOT EXECUTED *last_cl = save_cln; 55d62: 206e 0018 moveal %fp@(24),%a0 55d66: 2087 movel %d7,%a0@ fat_buf_release(fs_info); 55d68: 2f0d movel %a5,%sp@- 55d6a: 4eb9 0004 fbaa jsr 4fbaa 55d70: 588f addql #4,%sp 55d72: 6064 bras 55dd8 return rc; } } i++; 55d74: 5284 addql #1,%d4 cl4find++; 55d76: 5287 addql #1,%d7 if (cl4find >= data_cls_val) 55d78: ba87 cmpl %d7,%d5 55d7a: 6202 bhis 55d7e <== ALWAYS TAKEN cl4find = 2; 55d7c: 7e02 moveq #2,%d7 <== 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) 55d7e: ba84 cmpl %d4,%d5 55d80: 6200 ff08 bhiw 55c8a if (cl4find >= data_cls_val) cl4find = 2; } fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 55d84: 202d 003e movel %a5@(62),%d0 <== NOT EXECUTED 55d88: 72ff moveq #-1,%d1 <== NOT EXECUTED cl4find++; if (cl4find >= data_cls_val) cl4find = 2; } fs_info->vol.next_cl = save_cln; 55d8a: 2b43 0046 movel %d3,%a5@(70) <== NOT EXECUTED if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 55d8e: b280 cmpl %d0,%d1 <== NOT EXECUTED 55d90: 6706 beqs 55d98 <== NOT EXECUTED fs_info->vol.free_cls -= (*cls_added); 55d92: 9092 subl %a2@,%d0 <== NOT EXECUTED 55d94: 2b40 003e movel %d0,%a5@(62) <== NOT EXECUTED *last_cl = save_cln; 55d98: 206e 0018 moveal %fp@(24),%a0 <== NOT EXECUTED 55d9c: 2083 movel %d3,%a0@ <== NOT EXECUTED fat_buf_release(fs_info); 55d9e: 2f0d movel %a5,%sp@- <== NOT EXECUTED 55da0: 4eb9 0004 fbaa jsr 4fbaa <== NOT EXECUTED 55da6: 588f addql #4,%sp <== NOT EXECUTED 55da8: 6028 bras 55dd2 <== 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; 55daa: 76ff moveq #-1,%d3 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 55dac: 2f13 movel %a3@,%sp@- <== 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; 55dae: 2403 movel %d3,%d2 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 55db0: 2f0d movel %a5,%sp@- <== NOT EXECUTED 55db2: 4eb9 0005 5b9c jsr 55b9c <== NOT EXECUTED /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); 55db8: 42a7 clrl %sp@- <== NOT EXECUTED 55dba: 2f07 movel %d7,%sp@- <== NOT EXECUTED 55dbc: 2f0d movel %a5,%sp@- <== NOT EXECUTED 55dbe: 4eb9 0005 5968 jsr 55968 <== NOT EXECUTED fat_buf_release(fs_info); 55dc4: 2f0d movel %a5,%sp@- <== NOT EXECUTED 55dc6: 4eb9 0004 fbaa jsr 4fbaa <== NOT EXECUTED 55dcc: 4fef 0018 lea %sp@(24),%sp <== NOT EXECUTED 55dd0: 6006 bras 55dd8 <== NOT EXECUTED ssize_t bytes_written; *cls_added = 0; if (count == 0) return rc; 55dd2: 4282 clrl %d2 <== NOT EXECUTED 55dd4: 6002 bras 55dd8 <== NOT EXECUTED * wouldn't work properly */ if (*cls_added == 0) { *chain = cl4find; rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 55dd6: 2400 movel %d0,%d2 <== 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; } 55dd8: 2002 movel %d2,%d0 55dda: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5 55de0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004fe7a : fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 4fe7a: 4e56 ffd8 linkw %fp,#-40 4fe7e: 48d7 1cfc moveml %d2-%d7/%a2-%a4,%sp@ 4fe82: 2e0e movel %fp,%d7 int rc = RC_OK; ssize_t cmpltd = 0; 4fe84: 4283 clrl %d3 4fe86: 5987 subql #4,%d7 c = MIN(count, (fs_info->vol.bps - ofs)); if (c == fs_info->vol.bytes_per_block) rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 4fe88: 47f9 0004 fd48 lea 4fd48 ,%a3 if (rc != RC_OK) return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 4fe8e: 49f9 0005 7dd0 lea 57dd0 ,%a4 fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 4fe94: 246e 0008 moveal %fp@(8),%a2 4fe98: 282e 0014 movel %fp@(20),%d4 int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; uint32_t ofs = offset; 4fe9c: 2c2e 0010 movel %fp@(16),%d6 uint32_t count, const void *buff) { int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; 4fea0: 2a2e 000c movel %fp@(12),%d5 uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 4fea4: 6056 bras 4fefc { c = MIN(count, (fs_info->vol.bps - ofs)); 4fea6: 4282 clrl %d2 4fea8: 3412 movew %a2@,%d2 4feaa: 9486 subl %d6,%d2 4feac: b882 cmpl %d2,%d4 4feae: 6402 bccs 4feb2 <== NEVER TAKEN 4feb0: 2404 movel %d4,%d2 if (c == fs_info->vol.bytes_per_block) 4feb2: 4280 clrl %d0 4feb4: 302a 000a movew %a2@(10),%d0 4feb8: b082 cmpl %d2,%d0 4feba: 6608 bnes 4fec4 <== ALWAYS TAKEN rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); 4febc: 2f07 movel %d7,%sp@- <== NOT EXECUTED 4febe: 4878 0002 pea 2 <== NOT EXECUTED 4fec2: 6006 bras 4feca <== NOT EXECUTED else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 4fec4: 2f07 movel %d7,%sp@- 4fec6: 4878 0001 pea 1 4feca: 2f05 movel %d5,%sp@- 4fecc: 2f0a movel %a2,%sp@- 4fece: 4e93 jsr %a3@ 4fed0: 4fef 0010 lea %sp@(16),%sp if (rc != RC_OK) 4fed4: 4a80 tstl %d0 4fed6: 662a bnes 4ff02 <== NEVER TAKEN return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 4fed8: 206e 0018 moveal %fp@(24),%a0 4fedc: dcae fffc addl %fp@(-4),%d6 fat_buf_mark_modified(fs_info); count -= c; 4fee0: 9882 subl %d2,%d4 cmpltd +=c; sec_num++; 4fee2: 5285 addql #1,%d5 else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 4fee4: 2f02 movel %d2,%sp@- 4fee6: 4870 3800 pea %a0@(00000000,%d3:l) fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; 4feea: d682 addl %d2,%d3 else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 4feec: 2f06 movel %d6,%sp@- fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; sec_num++; ofs = 0; 4feee: 4286 clrl %d6 else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 4fef0: 4e94 jsr %a4@ fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; sec_num++; ofs = 0; 4fef2: 4fef 000c lea %sp@(12),%sp } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 4fef6: 7001 moveq #1,%d0 4fef8: 1540 007e moveb %d0,%a2@(126) uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 4fefc: 4a84 tstl %d4 4fefe: 66a6 bnes 4fea6 4ff00: 6002 bras 4ff04 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; 4ff02: 76ff moveq #-1,%d3 <== NOT EXECUTED cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 4ff04: 2003 movel %d3,%d0 4ff06: 4cee 1cfc ffd8 moveml %fp@(-40),%d2-%d7/%a2-%a4 4ff0c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00055968 : 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)) ) 55968: 7001 moveq #1,%d0 fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 5596a: 4e56 ffd8 linkw %fp,#-40 5596e: 48d7 1cfc moveml %d2-%d7/%a2-%a4,%sp@ 55972: 246e 0008 moveal %fp@(8),%a2 55976: 242e 000c movel %fp@(12),%d2 5597a: 2a2e 0010 movel %fp@(16),%d5 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; 5597e: 42ae fffc clrl %fp@(-4) /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 55982: b082 cmpl %d2,%d0 55984: 6400 01fc bccw 55b82 55988: 202a 0034 movel %a2@(52),%d0 5598c: 5280 addql #1,%d0 5598e: b082 cmpl %d2,%d0 55990: 6404 bccs 55996 <== ALWAYS TAKEN 55992: 6000 01ee braw 55b82 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 55996: 7601 moveq #1,%d3 55998: 102a 000e moveb %a2@(14),%d0 5599c: c680 andl %d0,%d3 5599e: 4a03 tstb %d3 559a0: 6708 beqs 559aa <== NEVER TAKEN 559a2: 2202 movel %d2,%d1 559a4: e289 lsrl #1,%d1 559a6: d282 addl %d2,%d1 559a8: 6012 bras 559bc 559aa: 7202 moveq #2,%d1 <== NOT EXECUTED 559ac: c280 andl %d0,%d1 <== NOT EXECUTED 559ae: 4a01 tstb %d1 <== NOT EXECUTED 559b0: 6706 beqs 559b8 <== NOT EXECUTED 559b2: 2202 movel %d2,%d1 <== NOT EXECUTED 559b4: d281 addl %d1,%d1 <== NOT EXECUTED 559b6: 6004 bras 559bc <== NOT EXECUTED 559b8: 2202 movel %d2,%d1 <== NOT EXECUTED 559ba: e589 lsll #2,%d1 <== NOT EXECUTED 559bc: 4284 clrl %d4 559be: 182a 0002 moveb %a2@(2),%d4 559c2: e8a9 lsrl %d4,%d1 559c4: 2641 moveal %d1,%a3 559c6: d7ea 0050 addal %a2@(80),%a3 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 559ca: 4a03 tstb %d3 559cc: 6708 beqs 559d6 <== NEVER TAKEN 559ce: 2e02 movel %d2,%d7 559d0: e28f lsrl #1,%d7 559d2: de82 addl %d2,%d7 559d4: 6010 bras 559e6 559d6: 7202 moveq #2,%d1 <== NOT EXECUTED 559d8: 2e02 movel %d2,%d7 <== NOT EXECUTED 559da: c081 andl %d1,%d0 <== NOT EXECUTED 559dc: 4a00 tstb %d0 <== NOT EXECUTED 559de: 6704 beqs 559e4 <== NOT EXECUTED 559e0: de87 addl %d7,%d7 <== NOT EXECUTED 559e2: 6002 bras 559e6 <== NOT EXECUTED 559e4: e58f lsll #2,%d7 <== NOT EXECUTED rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 559e6: 2c0e movel %fp,%d6 559e8: 5986 subql #4,%d6 559ea: 49f9 0004 fd48 lea 4fd48 ,%a4 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); 559f0: 3612 movew %a2@,%d3 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 559f2: 2f06 movel %d6,%sp@- 559f4: 4878 0001 pea 1 559f8: 2f0b movel %a3,%sp@- 559fa: 2f0a movel %a2,%sp@- 559fc: 4e94 jsr %a4@ if (rc != RC_OK) 559fe: 4fef 0010 lea %sp@(16),%sp 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); rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 55a02: 2800 movel %d0,%d4 if (rc != RC_OK) 55a04: 6600 018a bnew 55b90 return rc; switch ( fs_info->vol.type ) 55a08: 4280 clrl %d0 55a0a: 102a 000e moveb %a2@(14),%d0 55a0e: 7202 moveq #2,%d1 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); 55a10: 0283 0000 ffff andil #65535,%d3 55a16: 5383 subql #1,%d3 55a18: c687 andl %d7,%d3 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) 55a1a: b280 cmpl %d0,%d1 55a1c: 6700 011e beqw 55b3c 55a20: 123c 0004 moveb #4,%d1 55a24: b280 cmpl %d0,%d1 55a26: 6700 0132 beqw 55b5a 55a2a: 123c 0001 moveb #1,%d1 55a2e: b280 cmpl %d0,%d1 55a30: 6600 0150 bnew 55b82 { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) 55a34: 0802 0000 btst #0,%d2 55a38: 677a beqs 55ab4 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; 55a3a: 206e fffc moveal %fp@(-4),%a0 55a3e: d1c3 addal %d3,%a0 55a40: 123c 000f moveb #15,%d1 55a44: 1010 moveb %a0@,%d0 switch ( fs_info->vol.type ) { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; 55a46: e98d lsll #4,%d5 *(sec_buf + ofs) &= 0x0F; 55a48: c081 andl %d1,%d0 55a4a: 1080 moveb %d0,%a0@ *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 55a4c: 206e fffc moveal %fp@(-4),%a0 55a50: d1c3 addal %d3,%a0 55a52: 1010 moveb %a0@,%d0 55a54: 8085 orl %d5,%d0 55a56: 1080 moveb %d0,%a0@ } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 55a58: 7001 moveq #1,%d0 55a5a: 1540 007e moveb %d0,%a2@(126) fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 55a5e: 4280 clrl %d0 55a60: 3012 movew %a2@,%d0 55a62: 5380 subql #1,%d0 55a64: b083 cmpl %d3,%d0 55a66: 6628 bnes 55a90 <== ALWAYS TAKEN { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 55a68: 2f06 movel %d6,%sp@- <== NOT EXECUTED 55a6a: 4878 0001 pea 1 <== NOT EXECUTED 55a6e: 486b 0001 pea %a3@(1) <== NOT EXECUTED 55a72: 2f0a movel %a2,%sp@- <== NOT EXECUTED 55a74: 4e94 jsr %a4@ <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 55a76: 4fef 0010 lea %sp@(16),%sp <== NOT EXECUTED fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 55a7a: 2800 movel %d0,%d4 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 55a7c: 6600 0112 bnew 55b90 <== NOT EXECUTED return rc; *sec_buf &= 0x00; 55a80: 206e fffc moveal %fp@(-4),%a0 <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 55a84: 4280 clrl %d0 <== 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; 55a86: 4210 clrb %a0@ <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 55a88: 3005 movew %d5,%d0 <== NOT EXECUTED 55a8a: 206e fffc moveal %fp@(-4),%a0 <== NOT EXECUTED 55a8e: 607e bras 55b0e <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 55a90: 206e fffc moveal %fp@(-4),%a0 55a94: 5283 addql #1,%d3 55a96: 4201 clrb %d1 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 55a98: 0285 0000 ffff andil #65535,%d5 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 55a9e: 1181 3800 moveb %d1,%a0@(00000000,%d3:l) *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 55aa2: e08d lsrl #8,%d5 55aa4: 206e fffc moveal %fp@(-4),%a0 55aa8: d1c3 addal %d3,%a0 55aaa: 1010 moveb %a0@,%d0 55aac: 8a80 orl %d0,%d5 55aae: 1085 moveb %d5,%a0@ 55ab0: 6000 00de braw 55b90 } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; 55ab4: 206e fffc moveal %fp@(-4),%a0 55ab8: 4201 clrb %d1 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; 55aba: 0285 0000 0fff andil #4095,%d5 *(sec_buf + ofs) &= 0x00; 55ac0: 1181 3800 moveb %d1,%a0@(00000000,%d3:l) *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; 55ac4: 3405 movew %d5,%d2 *(sec_buf + ofs) &= 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 55ac6: 206e fffc moveal %fp@(-4),%a0 55aca: d1c3 addal %d3,%a0 55acc: 1010 moveb %a0@,%d0 55ace: 7201 moveq #1,%d1 55ad0: 8a80 orl %d0,%d5 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 55ad2: 4280 clrl %d0 else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 55ad4: 1085 moveb %d5,%a0@ 55ad6: 1541 007e moveb %d1,%a2@(126) fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 55ada: 3012 movew %a2@,%d0 55adc: 5380 subql #1,%d0 55ade: b083 cmpl %d3,%d0 55ae0: 6636 bnes 55b18 <== ALWAYS TAKEN { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 55ae2: 2f06 movel %d6,%sp@- <== NOT EXECUTED 55ae4: 4878 0001 pea 1 <== NOT EXECUTED 55ae8: 486b 0001 pea %a3@(1) <== NOT EXECUTED 55aec: 2f0a movel %a2,%sp@- <== NOT EXECUTED 55aee: 4e94 jsr %a4@ <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 55af0: 4fef 0010 lea %sp@(16),%sp <== NOT EXECUTED fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 55af4: 2800 movel %d0,%d4 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 55af6: 6600 0098 bnew 55b90 <== NOT EXECUTED return rc; *sec_buf &= 0xF0; 55afa: 206e fffc moveal %fp@(-4),%a0 <== NOT EXECUTED 55afe: 72f0 moveq #-16,%d1 <== NOT EXECUTED 55b00: 1010 moveb %a0@,%d0 <== NOT EXECUTED 55b02: c081 andl %d1,%d0 <== NOT EXECUTED 55b04: 1080 moveb %d0,%a0@ <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 55b06: 4280 clrl %d0 <== NOT EXECUTED 55b08: 3002 movew %d2,%d0 <== NOT EXECUTED 55b0a: 206e fffc moveal %fp@(-4),%a0 <== NOT EXECUTED 55b0e: e088 lsrl #8,%d0 <== NOT EXECUTED 55b10: 1210 moveb %a0@,%d1 <== NOT EXECUTED 55b12: 8081 orl %d1,%d0 <== NOT EXECUTED 55b14: 1080 moveb %d0,%a0@ <== NOT EXECUTED 55b16: 603a bras 55b52 <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 55b18: 206e fffc moveal %fp@(-4),%a0 55b1c: 5283 addql #1,%d3 55b1e: d1c3 addal %d3,%a0 55b20: 72f0 moveq #-16,%d1 55b22: 1010 moveb %a0@,%d0 55b24: c081 andl %d1,%d0 55b26: 1080 moveb %d0,%a0@ *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 55b28: 4280 clrl %d0 55b2a: 206e fffc moveal %fp@(-4),%a0 55b2e: d1c3 addal %d3,%a0 55b30: 3002 movew %d2,%d0 55b32: 1210 moveb %a0@,%d1 55b34: e088 lsrl #8,%d0 55b36: 8081 orl %d1,%d0 55b38: 1080 moveb %d0,%a0@ 55b3a: 6054 bras 55b90 } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = 55b3c: 206e fffc moveal %fp@(-4),%a0 <== NOT EXECUTED break; } return RC_OK; } 55b40: 0285 0000 ffff andil #65535,%d5 <== NOT EXECUTED 55b46: 2205 movel %d5,%d1 <== NOT EXECUTED 55b48: e089 lsrl #8,%d1 <== NOT EXECUTED 55b4a: e18d lsll #8,%d5 <== NOT EXECUTED 55b4c: 8285 orl %d5,%d1 <== NOT EXECUTED } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = 55b4e: 3181 3800 movew %d1,%a0@(00000000,%d3:l) <== NOT EXECUTED 55b52: 7001 moveq #1,%d0 <== NOT EXECUTED 55b54: 1540 007e moveb %d0,%a2@(126) <== NOT EXECUTED 55b58: 6036 bras 55b90 <== NOT EXECUTED (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)); 55b5a: 0285 0fff ffff andil #268435455,%d5 <== NOT EXECUTED 55b60: 2f05 movel %d5,%sp@- <== NOT EXECUTED 55b62: 4eba fc60 jsr %pc@(557c4 ) <== NOT EXECUTED *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 55b66: 206e fffc moveal %fp@(-4),%a0 <== NOT EXECUTED 55b6a: d1c3 addal %d3,%a0 <== NOT EXECUTED (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)); 55b6c: 588f addql #4,%sp <== NOT EXECUTED *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 55b6e: 2210 movel %a0@,%d1 <== NOT EXECUTED 55b70: 0281 0000 00f0 andil #240,%d1 <== NOT EXECUTED *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; 55b76: 8081 orl %d1,%d0 <== NOT EXECUTED 55b78: 7201 moveq #1,%d1 <== NOT EXECUTED 55b7a: 2080 movel %d0,%a0@ <== NOT EXECUTED 55b7c: 1541 007e moveb %d1,%a2@(126) <== NOT EXECUTED 55b80: 600e bras 55b90 <== NOT EXECUTED fat_buf_mark_modified(fs_info); break; default: rtems_set_errno_and_return_minus_one(EIO); 55b82: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 55b88: 78ff moveq #-1,%d4 <== NOT EXECUTED 55b8a: 7205 moveq #5,%d1 <== NOT EXECUTED 55b8c: 2040 moveal %d0,%a0 <== NOT EXECUTED 55b8e: 2081 movel %d1,%a0@ <== NOT EXECUTED break; } return RC_OK; } 55b90: 2004 movel %d4,%d0 55b92: 4cee 1cfc ffd8 moveml %fp@(-40),%d2-%d7/%a2-%a4 55b98: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00050978 : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_shutdown_drive(fat_fs_info_t *fs_info) { 50978: 4e56 ffe8 linkw %fp,#-24 5097c: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 50980: 246e 0008 moveal %fp@(8),%a2 int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); 50984: 2f0a movel %a2,%sp@- 50986: 4eb9 0005 08a8 jsr 508a8 if ( rc != RC_OK ) 5098c: 588f addql #4,%sp fat_shutdown_drive(fat_fs_info_t *fs_info) { int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); 5098e: 2400 movel %d0,%d2 if ( rc != RC_OK ) 50990: 6702 beqs 50994 <== ALWAYS TAKEN rc = -1; 50992: 74ff moveq #-1,%d2 <== NOT EXECUTED 50994: 97cb subal %a3,%a3 */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 50996: 49f9 0004 8790 lea 48790 <_Chain_Get>,%a4 { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->vhash + i; while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); 5099c: 4bf9 0004 3f4c lea 43f4c ,%a5 rc = -1; for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->vhash + i; 509a2: 262a 0062 movel %a2@(98),%d3 509a6: d68b addl %a3,%d3 while ( (node = rtems_chain_get(the_chain)) != NULL ) 509a8: 6006 bras 509b0 free(node); 509aa: 2f00 movel %d0,%sp@- <== NOT EXECUTED 509ac: 4e95 jsr %a5@ <== NOT EXECUTED 509ae: 588f addql #4,%sp <== NOT EXECUTED 509b0: 2f03 movel %d3,%sp@- 509b2: 4e94 jsr %a4@ 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 ) 509b4: 588f addql #4,%sp 509b6: 4a80 tstl %d0 509b8: 66f0 bnes 509aa <== NEVER TAKEN 509ba: 47eb 000c lea %a3@(12),%a3 rc = fat_sync(fs_info); if ( rc != RC_OK ) rc = -1; for (i = 0; i < FAT_HASH_SIZE; i++) 509be: 103c 0018 moveb #24,%d0 509c2: b08b cmpl %a3,%d0 509c4: 66dc bnes 509a2 509c6: 97cb subal %a3,%a3 509c8: 49f9 0004 8790 lea 48790 <_Chain_Get>,%a4 { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); 509ce: 4bf9 0004 3f4c lea 43f4c ,%a5 } for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; 509d4: 262a 0066 movel %a2@(102),%d3 509d8: d68b addl %a3,%d3 while ( (node = rtems_chain_get(the_chain)) != NULL ) 509da: 6006 bras 509e2 free(node); 509dc: 2f00 movel %d0,%sp@- <== NOT EXECUTED 509de: 4e95 jsr %a5@ <== NOT EXECUTED 509e0: 588f addql #4,%sp <== NOT EXECUTED 509e2: 2f03 movel %d3,%sp@- 509e4: 4e94 jsr %a4@ 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 ) 509e6: 588f addql #4,%sp 509e8: 4a80 tstl %d0 509ea: 66f0 bnes 509dc <== NEVER TAKEN 509ec: 47eb 000c lea %a3@(12),%a3 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } for (i = 0; i < FAT_HASH_SIZE; i++) 509f0: 103c 0018 moveb #24,%d0 509f4: b08b cmpl %a3,%d0 509f6: 66dc bnes 509d4 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } free(fs_info->vhash); 509f8: 2f2a 0062 movel %a2@(98),%sp@- 509fc: 47f9 0004 3f4c lea 43f4c ,%a3 50a02: 4e93 jsr %a3@ free(fs_info->rhash); 50a04: 2f2a 0066 movel %a2@(102),%sp@- 50a08: 4e93 jsr %a3@ free(fs_info->uino); 50a0a: 2f2a 006a movel %a2@(106),%sp@- 50a0e: 4e93 jsr %a3@ free(fs_info->sec_buf); 50a10: 2f2a 0084 movel %a2@(132),%sp@- 50a14: 4e93 jsr %a3@ close(fs_info->vol.fd); 50a16: 2f2a 0056 movel %a2@(86),%sp@- 50a1a: 4eb9 0004 3cd8 jsr 43cd8 if (rc) 50a20: 4fef 0014 lea %sp@(20),%sp 50a24: 4a82 tstl %d2 50a26: 670c beqs 50a34 <== ALWAYS TAKEN errno = EIO; 50a28: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 50a2e: 2040 moveal %d0,%a0 <== NOT EXECUTED 50a30: 7005 moveq #5,%d0 <== NOT EXECUTED 50a32: 2080 movel %d0,%a0@ <== NOT EXECUTED return rc; } 50a34: 2002 movel %d2,%d0 50a36: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 50a3c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000508a8 : 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) 508a8: 4280 clrl %d0 508aa: 7204 moveq #4,%d1 return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 508ac: 4e56 fff0 linkw %fp,#-16 508b0: 48d7 040c moveml %d2-%d3/%a2,%sp@ 508b4: 246e 0008 moveal %fp@(8),%a2 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) 508b8: 102a 000e moveb %a2@(14),%d0 508bc: b280 cmpl %d0,%d1 508be: 6706 beqs 508c6 <== NEVER TAKEN * RC_OK on success, or -1 if error occured (errno set appropriately) */ static int fat_fat32_update_fsinfo_sector(fat_fs_info_t *fs_info) { ssize_t ret1 = 0, ret2 = 0; 508c0: 4282 clrl %d2 508c2: 6000 0084 braw 50948 if (fs_info->vol.type == FAT_FAT32) { uint32_t free_count = fs_info->vol.free_cls; 508c6: 262a 003e movel %a2@(62),%d3 <== NOT EXECUTED uint32_t next_free = fs_info->vol.next_cl; 508ca: 242a 0046 movel %a2@(70),%d2 <== NOT EXECUTED if (free_count != fs_info->vol.free_cls_in_fs_info) 508ce: b6aa 0042 cmpl %a2@(66),%d3 <== NOT EXECUTED 508d2: 6730 beqs 50904 <== NOT EXECUTED { uint32_t le_free_count = CT_LE_L(free_count); 508d4: 2f03 movel %d3,%sp@- <== NOT EXECUTED 508d6: 4eba f240 jsr %pc@(4fb18 ) <== NOT EXECUTED 508da: 204e moveal %fp,%a0 <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; 508dc: 2543 0042 movel %d3,%a2@(66) <== 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); 508e0: 2100 movel %d0,%a0@- <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; ret1 = fat_sector_write(fs_info, 508e2: 4280 clrl %d0 <== NOT EXECUTED 508e4: 2e88 movel %a0,%sp@ <== NOT EXECUTED 508e6: 4878 0004 pea 4 <== NOT EXECUTED 508ea: 4878 01e8 pea 1e8 <== NOT EXECUTED 508ee: 302a 003c movew %a2@(60),%d0 <== NOT EXECUTED 508f2: 2f00 movel %d0,%sp@- <== NOT EXECUTED 508f4: 2f0a movel %a2,%sp@- <== NOT EXECUTED 508f6: 4eb9 0004 fe7a jsr 4fe7a <== NOT EXECUTED 508fc: 4fef 0014 lea %sp@(20),%sp <== NOT EXECUTED 50900: 2600 movel %d0,%d3 <== NOT EXECUTED 50902: 6002 bras 50906 <== NOT EXECUTED * 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; 50904: 4283 clrl %d3 <== 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) 50906: b4aa 004a cmpl %a2@(74),%d2 <== NOT EXECUTED 5090a: 6758 beqs 50964 <== NOT EXECUTED { uint32_t le_next_free = CT_LE_L(next_free); 5090c: 2f02 movel %d2,%sp@- <== NOT EXECUTED 5090e: 4eba f208 jsr %pc@(4fb18 ) <== NOT EXECUTED 50912: 204e moveal %fp,%a0 <== NOT EXECUTED fs_info->vol.next_cl_in_fs_info = next_free; 50914: 2542 004a movel %d2,%a2@(74) <== NOT EXECUTED &le_free_count); } if (next_free != fs_info->vol.next_cl_in_fs_info) { uint32_t le_next_free = CT_LE_L(next_free); 50918: 2100 movel %d0,%a0@- <== NOT EXECUTED fs_info->vol.next_cl_in_fs_info = next_free; ret2 = fat_sector_write(fs_info, 5091a: 4280 clrl %d0 <== NOT EXECUTED 5091c: 2e88 movel %a0,%sp@ <== NOT EXECUTED 5091e: 4878 0004 pea 4 <== NOT EXECUTED 50922: 4878 01ec pea 1ec <== NOT EXECUTED 50926: 302a 003c movew %a2@(60),%d0 <== NOT EXECUTED 5092a: 2f00 movel %d0,%sp@- <== NOT EXECUTED 5092c: 2f0a movel %a2,%sp@- <== NOT EXECUTED 5092e: 4eb9 0004 fe7a jsr 4fe7a <== NOT EXECUTED sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) 50934: 4fef 0014 lea %sp@(20),%sp <== NOT EXECUTED 50938: 4a83 tstl %d3 <== NOT EXECUTED 5093a: 6c04 bges 50940 <== NOT EXECUTED { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; 5093c: 74ff moveq #-1,%d2 <== NOT EXECUTED 5093e: 6008 bras 50948 <== NOT EXECUTED sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) 50940: 4a80 tstl %d0 <== NOT EXECUTED 50942: 6c00 ff7c bgew 508c0 <== NOT EXECUTED 50946: 60f4 bras 5093c <== NOT EXECUTED rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; fat_buf_release(fs_info); 50948: 2f0a movel %a2,%sp@- 5094a: 4eb9 0004 fbaa jsr 4fbaa if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) 50950: 2f2a 005a movel %a2@(90),%sp@- 50954: 4eb9 0004 e402 jsr 4e402 5095a: 508f addql #8,%sp 5095c: 4a80 tstl %d0 5095e: 670c beqs 5096c <== ALWAYS TAKEN rc = -1; 50960: 74ff moveq #-1,%d2 <== NOT EXECUTED 50962: 6008 bras 5096c <== NOT EXECUTED sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) 50964: 4a83 tstl %d3 <== NOT EXECUTED 50966: 6c00 ff58 bgew 508c0 <== NOT EXECUTED 5096a: 60d0 bras 5093c <== NOT EXECUTED if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) rc = -1; return rc; } 5096c: 2002 movel %d2,%d0 5096e: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2 50974: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0006accc : /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { 6accc: 4e56 ff94 linkw %fp,#-108 rtems_libio_t *iop; struct stat st; rtems_filesystem_location_info_t loc; st.st_mode = 0; st.st_uid = 0; 6acd0: 4241 clrw %d1 /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { 6acd2: 202e 0008 movel %fp@(8),%d0 6acd6: 48d7 040c moveml %d2-%d3/%a2,%sp@ int rv = 0; rtems_libio_t *iop; struct stat st; rtems_filesystem_location_info_t loc; st.st_mode = 0; 6acda: 42ae ffc6 clrl %fp@(-58) st.st_uid = 0; 6acde: 3d41 ffcc movew %d1,%fp@(-52) st.st_gid = 0; 6ace2: 3d41 ffce movew %d1,%fp@(-50) rtems_libio_check_fd( fd ); 6ace6: b0b9 0009 282c cmpl 9282c ,%d0 6acec: 6502 bcss 6acf0 6acee: 601c bras 6ad0c iop = rtems_libio_iop( fd ); 6acf0: 2200 movel %d0,%d1 6acf2: ed88 lsll #6,%d0 6acf4: e989 lsll #4,%d1 6acf6: 2479 0009 7454 moveal 97454 ,%a2 6acfc: 9081 subl %d1,%d0 6acfe: d5c0 addal %d0,%a2 rtems_libio_check_is_open( iop ); 6ad00: 202a 000c movel %a2@(12),%d0 6ad04: 0280 0000 0100 andil #256,%d0 6ad0a: 6612 bnes 6ad1e 6ad0c: 4eb9 0006 e674 jsr 6e674 <__errno> 6ad12: 74ff moveq #-1,%d2 6ad14: 7209 moveq #9,%d1 6ad16: 2040 moveal %d0,%a0 6ad18: 2081 movel %d1,%a0@ 6ad1a: 6000 0096 braw 6adb2 if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } 6ad1e: 206a 0024 moveal %a2@(36),%a0 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 ); 6ad22: 260a movel %a2,%d3 6ad24: 0683 0000 0010 addil #16,%d3 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 ); 6ad2a: 2268 000c moveal %a0@(12),%a1 6ad2e: 2f08 movel %a0,%sp@- 6ad30: 2051 moveal %a1@,%a0 6ad32: 4e90 jsr %a0@ 6ad34: 206a 0020 moveal %a2@(32),%a0 6ad38: 486e ffba pea %fp@(-70) 6ad3c: 2f03 movel %d3,%sp@- 6ad3e: 2068 0018 moveal %a0@(24),%a0 6ad42: 4e90 jsr %a0@ if ( rv == 0 ) { 6ad44: 4fef 000c lea %sp@(12),%sp 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 ); 6ad48: 2400 movel %d0,%d2 if ( rv == 0 ) { 6ad4a: 6642 bnes 6ad8e <== NEVER TAKEN bool access_ok = rtems_filesystem_check_access( 6ad4c: 4280 clrl %d0 6ad4e: 302e ffce movew %fp@(-50),%d0 6ad52: 2f00 movel %d0,%sp@- 6ad54: 302e ffcc movew %fp@(-52),%d0 6ad58: 2f00 movel %d0,%sp@- 6ad5a: 2f2e ffc6 movel %fp@(-58),%sp@- 6ad5e: 4878 0001 pea 1 6ad62: 4eb9 0004 c334 jsr 4c334 st.st_mode, st.st_uid, st.st_gid ); if ( access_ok ) { 6ad68: 4fef 0010 lea %sp@(16),%sp 6ad6c: 4a00 tstb %d0 6ad6e: 6710 beqs 6ad80 rtems_filesystem_location_clone( &loc, &iop->pathinfo ); 6ad70: 2f03 movel %d3,%sp@- 6ad72: 486e ffa2 pea %fp@(-94) 6ad76: 4eb9 0004 bd64 jsr 4bd64 6ad7c: 508f addql #8,%sp 6ad7e: 600e bras 6ad8e } else { errno = EACCES; 6ad80: 4eb9 0006 e674 jsr 6e674 <__errno> rv = -1; 6ad86: 74ff moveq #-1,%d2 ); if ( access_ok ) { rtems_filesystem_location_clone( &loc, &iop->pathinfo ); } else { errno = EACCES; 6ad88: 2040 moveal %d0,%a0 6ad8a: 700d moveq #13,%d0 6ad8c: 2080 movel %d0,%a0@ if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } 6ad8e: 206a 0024 moveal %a2@(36),%a0 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 ); 6ad92: 2268 000c moveal %a0@(12),%a1 6ad96: 2f08 movel %a0,%sp@- 6ad98: 2069 0004 moveal %a1@(4),%a0 6ad9c: 4e90 jsr %a0@ rv = -1; } } rtems_filesystem_instance_unlock( &iop->pathinfo ); if ( rv == 0 ) { 6ad9e: 588f addql #4,%sp 6ada0: 4a82 tstl %d2 6ada2: 660e bnes 6adb2 rv = rtems_filesystem_chdir( &loc ); 6ada4: 486e ffa2 pea %fp@(-94) 6ada8: 4eb9 0005 e06c jsr 5e06c 6adae: 588f addql #4,%sp 6adb0: 2400 movel %d0,%d2 } return rv; } 6adb2: 2002 movel %d2,%d0 6adb4: 4cee 040c ff94 moveml %fp@(-108),%d2-%d3/%a2 6adba: 4e5e unlk %fp ... =============================================================================== 0005e378 : /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { 5e378: 4e56 fffc linkw %fp,#-4 5e37c: 202e 0008 movel %fp@(8),%d0 5e380: 2f0a movel %a2,%sp@- int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 5e382: b0b9 0009 282c cmpl 9282c ,%d0 5e388: 6502 bcss 5e38c 5e38a: 601c bras 5e3a8 iop = rtems_libio_iop( fd ); 5e38c: 2200 movel %d0,%d1 5e38e: ed88 lsll #6,%d0 5e390: e989 lsll #4,%d1 5e392: 2479 0009 7454 moveal 97454 ,%a2 5e398: 9081 subl %d1,%d0 5e39a: d5c0 addal %d0,%a2 rtems_libio_check_is_open(iop); 5e39c: 202a 000c movel %a2@(12),%d0 5e3a0: 0280 0000 0100 andil #256,%d0 5e3a6: 660e bnes 5e3b6 5e3a8: 4eb9 0006 e674 jsr 6e674 <__errno> 5e3ae: 7209 moveq #9,%d1 5e3b0: 2040 moveal %d0,%a0 5e3b2: 2081 movel %d1,%a0@ 5e3b4: 6054 bras 5e40a if (iop->pathinfo.mt_entry->writeable) { 5e3b6: 206a 0024 moveal %a2@(36),%a0 5e3ba: 4a28 0029 tstb %a0@(41) 5e3be: 673e beqs 5e3fe <== 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 ); 5e3c0: 2268 000c moveal %a0@(12),%a1 5e3c4: 2f08 movel %a0,%sp@- 5e3c6: 2051 moveal %a1@,%a0 5e3c8: 4e90 jsr %a0@ rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); 5e3ca: 206a 0024 moveal %a2@(36),%a0 5e3ce: 2068 000c moveal %a0@(12),%a0 5e3d2: 2f2e 000c movel %fp@(12),%sp@- 5e3d6: 486a 0010 pea %a2@(16) 5e3da: 2068 0020 moveal %a0@(32),%a0 5e3de: 4e90 jsr %a0@ errno = EROFS; rv = -1; } return rv; } 5e3e0: 206a 0024 moveal %a2@(36),%a0 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 ); 5e3e4: 2268 000c moveal %a0@(12),%a1 5e3e8: 2f08 movel %a0,%sp@- 5e3ea: 2069 0004 moveal %a1@(4),%a0 5e3ee: 2d40 fffc movel %d0,%fp@(-4) 5e3f2: 4e90 jsr %a0@ 5e3f4: 202e fffc movel %fp@(-4),%d0 5e3f8: 4fef 0010 lea %sp@(16),%sp 5e3fc: 600e bras 5e40c 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; 5e3fe: 4eb9 0006 e674 jsr 6e674 <__errno> <== NOT EXECUTED 5e404: 2040 moveal %d0,%a0 <== NOT EXECUTED 5e406: 701e moveq #30,%d0 <== NOT EXECUTED 5e408: 2080 movel %d0,%a0@ <== NOT EXECUTED rv = -1; 5e40a: 70ff moveq #-1,%d0 } return rv; } 5e40c: 246e fff8 moveal %fp@(-8),%a2 5e410: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005e414 : /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { 5e414: 4e56 fff0 linkw %fp,#-16 5e418: 202e 0008 movel %fp@(8),%d0 5e41c: 48d7 040c moveml %d2-%d3/%a2,%sp@ 5e420: 342e 000e movew %fp@(14),%d2 5e424: 362e 0012 movew %fp@(18),%d3 int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 5e428: b0b9 0009 282c cmpl 9282c ,%d0 5e42e: 6502 bcss 5e432 5e430: 601c bras 5e44e iop = rtems_libio_iop( fd ); 5e432: 2200 movel %d0,%d1 5e434: ed88 lsll #6,%d0 5e436: e989 lsll #4,%d1 5e438: 2479 0009 7454 moveal 97454 ,%a2 5e43e: 9081 subl %d1,%d0 5e440: d5c0 addal %d0,%a2 rtems_libio_check_is_open(iop); 5e442: 202a 000c movel %a2@(12),%d0 5e446: 0280 0000 0100 andil #256,%d0 5e44c: 660e bnes 5e45c 5e44e: 4eb9 0006 e674 jsr 6e674 <__errno> 5e454: 7209 moveq #9,%d1 5e456: 2040 moveal %d0,%a0 5e458: 2081 movel %d1,%a0@ 5e45a: 6058 bras 5e4b4 if (iop->pathinfo.mt_entry->writeable) { 5e45c: 206a 0024 moveal %a2@(36),%a0 5e460: 4a28 0029 tstb %a0@(41) 5e464: 6742 beqs 5e4a8 <== 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 ); 5e466: 2268 000c moveal %a0@(12),%a1 5e46a: 2f08 movel %a0,%sp@- 5e46c: 2051 moveal %a1@,%a0 5e46e: 4e90 jsr %a0@ rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->chown_h)( 5e470: 206a 0024 moveal %a2@(36),%a0 5e474: 2068 000c moveal %a0@(12),%a0 5e478: 3f03 movew %d3,%sp@- 5e47a: 4267 clrw %sp@- 5e47c: 3f02 movew %d2,%sp@- 5e47e: 4267 clrw %sp@- 5e480: 486a 0010 pea %a2@(16) 5e484: 2068 0024 moveal %a0@(36),%a0 5e488: 4e90 jsr %a0@ errno = EROFS; rv = -1; } return rv; } 5e48a: 206a 0024 moveal %a2@(36),%a0 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 ); 5e48e: 2268 000c moveal %a0@(12),%a1 5e492: 2f08 movel %a0,%sp@- 5e494: 2069 0004 moveal %a1@(4),%a0 5e498: 2d40 fffc movel %d0,%fp@(-4) 5e49c: 4e90 jsr %a0@ 5e49e: 202e fffc movel %fp@(-4),%d0 5e4a2: 4fef 0014 lea %sp@(20),%sp 5e4a6: 600e bras 5e4b6 owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 5e4a8: 4eb9 0006 e674 jsr 6e674 <__errno> <== NOT EXECUTED 5e4ae: 2040 moveal %d0,%a0 <== NOT EXECUTED 5e4b0: 701e moveq #30,%d0 <== NOT EXECUTED 5e4b2: 2080 movel %d0,%a0@ <== NOT EXECUTED rv = -1; 5e4b4: 70ff moveq #-1,%d0 } return rv; } 5e4b6: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2 5e4bc: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0006a51c : int fcntl( int fd, int cmd, ... ) { 6a51c: 4e56 ffec linkw %fp,#-20 6a520: 202e 0008 movel %fp@(8),%d0 6a524: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 6a528: 262e 000c movel %fp@(12),%d3 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 6a52c: b0b9 0007 0018 cmpl 70018 ,%d0 6a532: 6502 bcss 6a536 6a534: 601a bras 6a550 iop = rtems_libio_iop( fd ); 6a536: 2200 movel %d0,%d1 6a538: ed88 lsll #6,%d0 6a53a: e989 lsll #4,%d1 6a53c: 2479 0008 1890 moveal 81890 ,%a2 6a542: 9081 subl %d1,%d0 6a544: d5c0 addal %d0,%a2 rtems_libio_check_is_open(iop); 6a546: 242a 000c movel %a2@(12),%d2 6a54a: 0802 0008 btst #8,%d2 6a54e: 6610 bnes 6a560 6a550: 4eb9 0005 bd98 jsr 5bd98 <__errno> 6a556: 7209 moveq #9,%d1 6a558: 2040 moveal %d0,%a0 6a55a: 2081 movel %d1,%a0@ 6a55c: 6000 0152 braw 6a6b0 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 6a560: 7009 moveq #9,%d0 6a562: b083 cmpl %d3,%d0 6a564: 6500 011a bcsw 6a680 6a568: 303b 3a08 movew %pc@(6a572 ,%d3:l:2),%d0 6a56c: 48c0 extl %d0 6a56e: 4efb 0802 jmp %pc@(6a572 ,%d0:l) 6a572: 0014 .short 0x0014 <== NOT EXECUTED 6a574: 00a8 00b4 00ca oril #11796682,%d0 <== NOT EXECUTED 6a57a: 00d8 .short 0x00d8 <== NOT EXECUTED 6a57c: 00fe .short 0x00fe <== NOT EXECUTED 6a57e: 00fe .short 0x00fe <== NOT EXECUTED 6a580: 00fe .short 0x00fe <== NOT EXECUTED 6a582: 00fe .short 0x00fe <== NOT EXECUTED 6a584: 00fe .short 0x00fe <== 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(); 6a586: 4eb9 0004 66b0 jsr 466b0 6a58c: 2640 moveal %d0,%a3 if (diop != NULL) { 6a58e: 4a80 tstl %d0 6a590: 6700 011e beqw 6a6b0 int oflag = rtems_libio_to_fcntl_flags( iop->flags ); 6a594: 2f2a 000c movel %a2@(12),%sp@- 6a598: 4eb9 0004 6660 jsr 46660 oflag &= ~O_CREAT; diop->flags |= rtems_libio_fcntl_flags( oflag ); 6a59e: 282b 000c movel %a3@(12),%d4 rtems_libio_t *diop = rtems_libio_allocate(); if (diop != NULL) { int oflag = rtems_libio_to_fcntl_flags( iop->flags ); oflag &= ~O_CREAT; 6a5a2: 2400 movel %d0,%d2 6a5a4: 0882 0009 bclr #9,%d2 diop->flags |= rtems_libio_fcntl_flags( oflag ); 6a5a8: 2f02 movel %d2,%sp@- 6a5aa: 4eb9 0004 6620 jsr 46620 int cmd, int arg ) { return fcntl( fd, cmd, arg ); } 6a5b0: 206a 0024 moveal %a2@(36),%a0 if (diop != NULL) { int oflag = rtems_libio_to_fcntl_flags( iop->flags ); oflag &= ~O_CREAT; diop->flags |= rtems_libio_fcntl_flags( oflag ); 6a5b4: 8084 orl %d4,%d0 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 ); 6a5b6: 2268 000c moveal %a0@(12),%a1 6a5ba: 2740 000c movel %d0,%a3@(12) 6a5be: 2f08 movel %a0,%sp@- 6a5c0: 2051 moveal %a1@,%a0 6a5c2: 4e90 jsr %a0@ rtems_filesystem_instance_lock( &iop->pathinfo ); rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo ); 6a5c4: 486a 0010 pea %a2@(16) 6a5c8: 486b 0010 pea %a3@(16) 6a5cc: 4eb9 0005 329c jsr 5329c int cmd, int arg ) { return fcntl( fd, cmd, arg ); } 6a5d2: 206a 0024 moveal %a2@(36),%a0 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 ); 6a5d6: 2268 000c moveal %a0@(12),%a1 6a5da: 2f08 movel %a0,%sp@- 6a5dc: 2069 0004 moveal %a1@(4),%a0 6a5e0: 4e90 jsr %a0@ /* * 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 ); 6a5e2: 206b 0020 moveal %a3@(32),%a0 6a5e6: 42a7 clrl %sp@- 6a5e8: 2f02 movel %d2,%sp@- 6a5ea: 42a7 clrl %sp@- 6a5ec: 2f0b movel %a3,%sp@- 6a5ee: 2050 moveal %a0@,%a0 6a5f0: 4e90 jsr %a0@ if ( rv == 0 ) { 6a5f2: 4fef 0028 lea %sp@(40),%sp /* * 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 ); 6a5f6: 2400 movel %d0,%d2 if ( rv == 0 ) { 6a5f8: 6616 bnes 6a610 <== NEVER TAKEN rv = diop - rtems_libio_iops; 6a5fa: 240b movel %a3,%d2 6a5fc: 94b9 0008 1890 subl 81890 ,%d2 6a602: 203c aaaa aaab movel #-1431655765,%d0 6a608: e882 asrl #4,%d2 6a60a: 4c00 2800 mulsl %d0,%d2 6a60e: 607e bras 6a68e } else { rtems_libio_free( diop ); 6a610: 2f0b movel %a3,%sp@- <== NOT EXECUTED 6a612: 4eb9 0004 6710 jsr 46710 <== NOT EXECUTED 6a618: 602c bras 6a646 <== 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); 6a61a: 700b moveq #11,%d0 6a61c: e0aa lsrl %d0,%d2 6a61e: 103c 0001 moveb #1,%d0 6a622: c480 andl %d0,%d2 6a624: 606c bras 6a692 * 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 ) ) 6a626: 4aae 0010 tstl %fp@(16) 6a62a: 6706 beqs 6a632 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 6a62c: 08c2 000b bset #11,%d2 6a630: 6004 bras 6a636 else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 6a632: 0882 000b bclr #11,%d2 6a636: 2542 000c movel %d2,%a2@(12) 6a63a: 6030 bras 6a66c break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); 6a63c: 2f02 movel %d2,%sp@- 6a63e: 4eb9 0004 6660 jsr 46660 6a644: 2400 movel %d0,%d2 6a646: 588f addql #4,%sp 6a648: 6044 bras 6a68e break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 6a64a: 2f2e 0010 movel %fp@(16),%sp@- 6a64e: 4eb9 0004 6620 jsr 46620 /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); 6a654: 222a 000c movel %a2@(12),%d1 6a658: 588f addql #4,%sp 6a65a: 0280 0000 0201 andil #513,%d0 6a660: 0281 ffff fdfe andil #-514,%d1 6a666: 8081 orl %d1,%d0 6a668: 2540 000c movel %d0,%a2@(12) { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 6a66c: 4282 clrl %d2 6a66e: 6022 bras 6a692 errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 6a670: 4eb9 0005 bd98 jsr 5bd98 <__errno> 6a676: 2040 moveal %d0,%a0 6a678: 20bc 0000 0086 movel #134,%a0@ 6a67e: 6030 bras 6a6b0 ret = -1; break; default: errno = EINVAL; 6a680: 4eb9 0005 bd98 jsr 5bd98 <__errno> 6a686: 2040 moveal %d0,%a0 6a688: 7016 moveq #22,%d0 6a68a: 2080 movel %d0,%a0@ 6a68c: 6022 bras 6a6b0 /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 6a68e: 4a82 tstl %d2 6a690: 6d20 blts 6a6b2 <== NEVER TAKEN int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); 6a692: 206a 0020 moveal %a2@(32),%a0 6a696: 2f03 movel %d3,%sp@- 6a698: 2f0a movel %a2,%sp@- 6a69a: 2068 0028 moveal %a0@(40),%a0 6a69e: 4e90 jsr %a0@ if (err) { 6a6a0: 508f addql #8,%sp * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); 6a6a2: 2600 movel %d0,%d3 if (err) { 6a6a4: 670c beqs 6a6b2 <== ALWAYS TAKEN errno = err; 6a6a6: 4eb9 0005 bd98 jsr 5bd98 <__errno> <== NOT EXECUTED 6a6ac: 2040 moveal %d0,%a0 <== NOT EXECUTED 6a6ae: 2083 movel %d3,%a0@ <== NOT EXECUTED int mask; int ret = 0; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); 6a6b0: 74ff moveq #-1,%d2 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 6a6b2: 2002 movel %d2,%d0 6a6b4: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 6a6ba: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004bb2c : int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 4bb2c: 4e56 ffd8 linkw %fp,#-40 4bb30: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 4bb34: 266e 0008 moveal %fp@(8),%a3 4bb38: 286e 000c moveal %fp@(12),%a4 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 4bb3c: 4ab9 0006 07d4 tstl 607d4 4bb42: 671c beqs 4bb60 rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 4bb44: 42a7 clrl %sp@- 4bb46: 42a7 clrl %sp@- 4bb48: 2f39 0006 07d4 movel 607d4 ,%sp@- 4bb4e: 4eb9 0004 79c0 jsr 479c0 } if (sc == RTEMS_SUCCESSFUL) { 4bb54: 4fef 000c lea %sp@(12),%sp 4bb58: 4a80 tstl %d0 4bb5a: 6700 0392 beqw 4beee 4bb5e: 6054 bras 4bbb4 <== NOT EXECUTED */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 4bb60: 42a7 clrl %sp@- 4bb62: 42a7 clrl %sp@- 4bb64: 2f39 0006 0ecc movel 60ecc ,%sp@- 4bb6a: 4eb9 0004 79c0 jsr 479c0 rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { 4bb70: 4fef 000c lea %sp@(12),%sp 4bb74: 4ab9 0006 07d4 tstl 607d4 4bb7a: 6624 bnes 4bba0 <== NEVER TAKEN sc = rtems_semaphore_create( 4bb7c: 4879 0006 07d4 pea 607d4 4bb82: 42a7 clrl %sp@- 4bb84: 4878 0054 pea 54 4bb88: 4878 0001 pea 1 4bb8c: 2f3c 5049 5045 movel #1346981957,%sp@- 4bb92: 4eb9 0004 7784 jsr 47784 4bb98: 4fef 0014 lea %sp@(20),%sp 4bb9c: 2400 movel %d0,%d2 4bb9e: 6002 bras 4bba2 free(pipe); } static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; 4bba0: 4282 clrl %d2 <== NOT EXECUTED } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 4bba2: 2f39 0006 0ecc movel 60ecc ,%sp@- 4bba8: 4eb9 0004 7ac8 jsr 47ac8 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { 4bbae: 588f addql #4,%sp 4bbb0: 4a82 tstl %d2 4bbb2: 6790 beqs 4bb44 } if (sc == RTEMS_SUCCESSFUL) { return 0; } else { return -ENOMEM; 4bbb4: 74f4 moveq #-12,%d2 4bbb6: 6000 0354 braw 4bf0c { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); 4bbba: 4878 0034 pea 34 4bbbe: 4bf9 0004 3fa8 lea 43fa8 ,%a5 4bbc4: 4e95 jsr %a5@ if (pipe == NULL) 4bbc6: 588f addql #4,%sp { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); 4bbc8: 2440 moveal %d0,%a2 if (pipe == NULL) 4bbca: 4a80 tstl %d0 4bbcc: 6700 032c beqw 4befa return err; memset(pipe, 0, sizeof(pipe_control_t)); 4bbd0: 4878 0034 pea 34 4bbd4: 42a7 clrl %sp@- 4bbd6: 2f00 movel %d0,%sp@- 4bbd8: 4eb9 0004 fcd4 jsr 4fcd4 pipe->Size = PIPE_BUF; 4bbde: 203c 0000 0200 movel #512,%d0 4bbe4: 2540 0004 movel %d0,%a2@(4) pipe->Buffer = malloc(pipe->Size); 4bbe8: 4878 0200 pea 200 4bbec: 4e95 jsr %a5@ if (! pipe->Buffer) 4bbee: 4fef 0010 lea %sp@(16),%sp if (pipe == NULL) return err; memset(pipe, 0, sizeof(pipe_control_t)); pipe->Size = PIPE_BUF; pipe->Buffer = malloc(pipe->Size); 4bbf2: 2480 movel %d0,%a2@ if (! pipe->Buffer) 4bbf4: 6700 0106 beqw 4bcfc goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 4bbf8: 486a 002c pea %a2@(44) 4bbfc: 4bf9 0004 d30c lea 4d30c ,%a5 rtems_build_name ('P', 'I', 'r', c), 4bc02: 1039 0005 f888 moveb 5f888 ,%d0 if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 4bc08: 42a7 clrl %sp@- rtems_build_name ('P', 'I', 'r', c), 4bc0a: 49c0 extbl %d0 if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 4bc0c: 42a7 clrl %sp@- 4bc0e: 0080 5049 7200 oril #1346990592,%d0 4bc14: 2f00 movel %d0,%sp@- 4bc16: 4e95 jsr %a5@ 4bc18: 4fef 0010 lea %sp@(16),%sp 4bc1c: 4a80 tstl %d0 4bc1e: 6600 00d2 bnew 4bcf2 rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( 4bc22: 486a 0030 pea %a2@(48) rtems_build_name ('P', 'I', 'w', c), 4bc26: 1039 0005 f888 moveb 5f888 ,%d0 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( 4bc2c: 42a7 clrl %sp@- rtems_build_name ('P', 'I', 'w', c), 4bc2e: 49c0 extbl %d0 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( 4bc30: 42a7 clrl %sp@- 4bc32: 0080 5049 7700 oril #1346991872,%d0 4bc38: 2f00 movel %d0,%sp@- 4bc3a: 4e95 jsr %a5@ 4bc3c: 4fef 0010 lea %sp@(16),%sp 4bc40: 4a80 tstl %d0 4bc42: 6600 00a2 bnew 4bce6 rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( 4bc46: 486a 0028 pea %a2@(40) rtems_build_name ('P', 'I', 's', c), 1, 4bc4a: 1039 0005 f888 moveb 5f888 ,%d0 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( 4bc50: 42a7 clrl %sp@- 4bc52: 4878 0010 pea 10 rtems_build_name ('P', 'I', 's', c), 1, 4bc56: 49c0 extbl %d0 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( 4bc58: 4878 0001 pea 1 4bc5c: 0080 5049 7300 oril #1346990848,%d0 4bc62: 2f00 movel %d0,%sp@- 4bc64: 4eb9 0004 7784 jsr 47784 4bc6a: 4fef 0014 lea %sp@(20),%sp 4bc6e: 4a80 tstl %d0 4bc70: 6668 bnes 4bcda <== NEVER TAKEN /* Set barriers to be interruptible by signals. */ static void pipe_interruptible(pipe_control_t *pipe) { Objects_Locations location; _Barrier_Get(pipe->readBarrier, &location)->Barrier.Wait_queue.state 4bc72: 260e movel %fp,%d3 4bc74: 5983 subql #4,%d3 RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get ( Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) 4bc76: 243c 0004 9218 movel #299544,%d2 4bc7c: 2042 moveal %d2,%a0 |= STATES_INTERRUPTIBLE_BY_SIGNAL; _Thread_Enable_dispatch(); 4bc7e: 4bf9 0004 9e14 lea 49e14 <_Thread_Enable_dispatch>,%a5 4bc84: 2f03 movel %d3,%sp@- 4bc86: 2f2a 002c movel %a2@(44),%sp@- 4bc8a: 4879 0006 17fc pea 617fc <_Barrier_Information> 4bc90: 4e90 jsr %a0@ static void pipe_interruptible(pipe_control_t *pipe) { Objects_Locations location; _Barrier_Get(pipe->readBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; 4bc92: 223c 1000 0000 movel #268435456,%d1 4bc98: 2040 moveal %d0,%a0 4bc9a: 83a8 004c orl %d1,%a0@(76) _Thread_Enable_dispatch(); 4bc9e: 4e95 jsr %a5@ 4bca0: 2042 moveal %d2,%a0 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 4bca2: 747a moveq #122,%d2 4bca4: 2f03 movel %d3,%sp@- 4bca6: 2f2a 0030 movel %a2@(48),%sp@- 4bcaa: 4879 0006 17fc pea 617fc <_Barrier_Information> 4bcb0: 4e90 jsr %a0@ _Barrier_Get(pipe->readBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; _Thread_Enable_dispatch(); _Barrier_Get(pipe->writeBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; 4bcb2: 223c 1000 0000 movel #268435456,%d1 4bcb8: 2040 moveal %d0,%a0 4bcba: 83a8 004c orl %d1,%a0@(76) _Thread_Enable_dispatch(); 4bcbe: 4e95 jsr %a5@ #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 4bcc0: 4fef 0018 lea %sp@(24),%sp 4bcc4: 1039 0005 f888 moveb 5f888 ,%d0 4bcca: 1200 moveb %d0,%d1 4bccc: 49c1 extbl %d1 4bcce: b481 cmpl %d1,%d2 4bcd0: 6600 022e bnew 4bf00 c = 'a'; 4bcd4: 7061 moveq #97,%d0 4bcd6: 6000 022a braw 4bf02 return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); 4bcda: 2f2a 0030 movel %a2@(48),%sp@- 4bcde: 4eb9 0004 d3c4 jsr 4d3c4 4bce4: 588f addql #4,%sp err_wbar: rtems_barrier_delete(pipe->readBarrier); 4bce6: 2f2a 002c movel %a2@(44),%sp@- 4bcea: 4eb9 0004 d3c4 jsr 4d3c4 4bcf0: 588f addql #4,%sp err_rbar: free(pipe->Buffer); 4bcf2: 2f12 movel %a2@,%sp@- 4bcf4: 4eb9 0004 3ba8 jsr 43ba8 4bcfa: 588f addql #4,%sp err_buf: free(pipe); 4bcfc: 2f0a movel %a2,%sp@- 4bcfe: 4eb9 0004 3ba8 jsr 43ba8 4bd04: 588f addql #4,%sp 4bd06: 6000 01f2 braw 4befa err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 4bd0a: 42a7 clrl %sp@- 4bd0c: 42a7 clrl %sp@- 4bd0e: 2f2a 0028 movel %a2@(40),%sp@- 4bd12: 4eb9 0004 79c0 jsr 479c0 4bd18: 4fef 000c lea %sp@(12),%sp 4bd1c: 4a80 tstl %d0 4bd1e: 6604 bnes 4bd24 <== NEVER TAKEN 4bd20: 4282 clrl %d2 4bd22: 6002 bras 4bd26 err = -EINTR; 4bd24: 74fc moveq #-4,%d2 <== NOT EXECUTED if (*pipep == NULL) { 4bd26: 4a93 tstl %a3@ 4bd28: 6610 bnes 4bd3a if (err) 4bd2a: 4a82 tstl %d2 4bd2c: 670a beqs 4bd38 <== ALWAYS TAKEN pipe_free(pipe); 4bd2e: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4bd30: 4eba fd1e jsr %pc@(4ba50 ) <== NOT EXECUTED 4bd34: 588f addql #4,%sp <== NOT EXECUTED 4bd36: 6002 bras 4bd3a <== NOT EXECUTED else *pipep = pipe; 4bd38: 268a movel %a2,%a3@ #ifdef RTEMS_DEBUG rtems_status_code sc = RTEMS_SUCCESSFUL; sc = #endif rtems_semaphore_release(pipe_semaphore); 4bd3a: 2f39 0006 07d4 movel 607d4 ,%sp@- 4bd40: 4eb9 0004 7ac8 jsr 47ac8 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) 4bd46: 588f addql #4,%sp 4bd48: 4a82 tstl %d2 4bd4a: 6600 01c0 bnew 4bf0c return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { 4bd4e: 7006 moveq #6,%d0 4bd50: 7204 moveq #4,%d1 4bd52: c0ac 000c andl %a4@(12),%d0 int err; err = pipe_new(pipep); if (err) return err; pipe = *pipep; 4bd56: 2453 moveal %a3@,%a2 switch (LIBIO_ACCMODE(iop)) { 4bd58: b280 cmpl %d0,%d1 4bd5a: 6700 009c beqw 4bdf8 4bd5e: 123c 0006 moveb #6,%d1 4bd62: b280 cmpl %d0,%d1 4bd64: 6700 0122 beqw 4be88 4bd68: 123c 0002 moveb #2,%d1 4bd6c: b280 cmpl %d0,%d1 4bd6e: 6600 0160 bnew 4bed0 case LIBIO_FLAGS_READ: pipe->readerCounter ++; if (pipe->Readers ++ == 0) 4bd72: 202a 0010 movel %a2@(16),%d0 4bd76: 2040 moveal %d0,%a0 4bd78: 5288 addql #1,%a0 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; 4bd7a: 52aa 0020 addql #1,%a2@(32) if (pipe->Readers ++ == 0) 4bd7e: 2548 0010 movel %a0,%a2@(16) 4bd82: 4a80 tstl %d0 4bd84: 6610 bnes 4bd96 <== NEVER TAKEN PIPE_WAKEUPWRITERS(pipe); 4bd86: 486e fff8 pea %fp@(-8) 4bd8a: 2f2a 0030 movel %a2@(48),%sp@- 4bd8e: 4eb9 0004 d460 jsr 4d460 4bd94: 508f addql #8,%sp if (pipe->Writers == 0) { 4bd96: 4aaa 0014 tstl %a2@(20) 4bd9a: 6600 0134 bnew 4bed0 /* Not an error */ if (LIBIO_NODELAY(iop)) 4bd9e: 7001 moveq #1,%d0 4bda0: c0ac 000c andl %a4@(12),%d0 4bda4: 6600 012a bnew 4bed0 break; prevCounter = pipe->writerCounter; 4bda8: 262a 0024 movel %a2@(36),%d3 err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); 4bdac: 4bf9 0004 7ac8 lea 47ac8 ,%a5 if (! PIPE_READWAIT(pipe)) 4bdb2: 283c 0004 d4c4 movel #316612,%d4 goto out_error; if (! PIPE_LOCK(pipe)) 4bdb8: 2a3c 0004 79c0 movel #293312,%d5 prevCounter = pipe->writerCounter; err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); 4bdbe: 2f2a 0028 movel %a2@(40),%sp@- 4bdc2: 4e95 jsr %a5@ if (! PIPE_READWAIT(pipe)) 4bdc4: 2044 moveal %d4,%a0 4bdc6: 42a7 clrl %sp@- 4bdc8: 2f2a 002c movel %a2@(44),%sp@- 4bdcc: 4e90 jsr %a0@ 4bdce: 4fef 000c lea %sp@(12),%sp 4bdd2: 4a80 tstl %d0 4bdd4: 6600 0108 bnew 4bede goto out_error; if (! PIPE_LOCK(pipe)) 4bdd8: 42a7 clrl %sp@- 4bdda: 2045 moveal %d5,%a0 4bddc: 42a7 clrl %sp@- 4bdde: 2f2a 0028 movel %a2@(40),%sp@- 4bde2: 4e90 jsr %a0@ 4bde4: 4fef 000c lea %sp@(12),%sp 4bde8: 4a80 tstl %d0 4bdea: 6600 00f2 bnew 4bede goto out_error; } while (prevCounter == pipe->writerCounter); 4bdee: b6aa 0024 cmpl %a2@(36),%d3 4bdf2: 67ca beqs 4bdbe <== NEVER TAKEN 4bdf4: 6000 00da braw 4bed0 break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; if (pipe->Writers ++ == 0) 4bdf8: 202a 0014 movel %a2@(20),%d0 4bdfc: 2200 movel %d0,%d1 4bdfe: 5281 addql #1,%d1 } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 4be00: 52aa 0024 addql #1,%a2@(36) if (pipe->Writers ++ == 0) 4be04: 2541 0014 movel %d1,%a2@(20) 4be08: 4a80 tstl %d0 4be0a: 6610 bnes 4be1c <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); 4be0c: 486e fff8 pea %fp@(-8) 4be10: 2f2a 002c movel %a2@(44),%sp@- 4be14: 4eb9 0004 d460 jsr 4d460 4be1a: 508f addql #8,%sp if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { 4be1c: 4aaa 0010 tstl %a2@(16) 4be20: 6600 00ae bnew 4bed0 4be24: 7001 moveq #1,%d0 4be26: c0ac 000c andl %a4@(12),%d0 4be2a: 6712 beqs 4be3e PIPE_UNLOCK(pipe); 4be2c: 2f2a 0028 movel %a2@(40),%sp@- err = -ENXIO; 4be30: 74fa moveq #-6,%d2 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { PIPE_UNLOCK(pipe); 4be32: 4eb9 0004 7ac8 jsr 47ac8 err = -ENXIO; goto out_error; 4be38: 588f addql #4,%sp 4be3a: 6000 00a4 braw 4bee0 } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; 4be3e: 262a 0020 movel %a2@(32),%d3 err = -EINTR; do { PIPE_UNLOCK(pipe); 4be42: 4bf9 0004 7ac8 lea 47ac8 ,%a5 if (! PIPE_WRITEWAIT(pipe)) 4be48: 283c 0004 d4c4 movel #316612,%d4 goto out_error; if (! PIPE_LOCK(pipe)) 4be4e: 2a3c 0004 79c0 movel #293312,%d5 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); 4be54: 2f2a 0028 movel %a2@(40),%sp@- 4be58: 4e95 jsr %a5@ if (! PIPE_WRITEWAIT(pipe)) 4be5a: 2044 moveal %d4,%a0 4be5c: 42a7 clrl %sp@- 4be5e: 2f2a 0030 movel %a2@(48),%sp@- 4be62: 4e90 jsr %a0@ 4be64: 4fef 000c lea %sp@(12),%sp 4be68: 4a80 tstl %d0 4be6a: 6672 bnes 4bede <== NEVER TAKEN goto out_error; if (! PIPE_LOCK(pipe)) 4be6c: 42a7 clrl %sp@- 4be6e: 2045 moveal %d5,%a0 4be70: 42a7 clrl %sp@- 4be72: 2f2a 0028 movel %a2@(40),%sp@- 4be76: 4e90 jsr %a0@ 4be78: 4fef 000c lea %sp@(12),%sp 4be7c: 4a80 tstl %d0 4be7e: 665e bnes 4bede <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->readerCounter); 4be80: b6aa 0020 cmpl %a2@(32),%d3 4be84: 67ce beqs 4be54 <== NEVER TAKEN 4be86: 6048 bras 4bed0 } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) 4be88: 202a 0010 movel %a2@(16),%d0 4be8c: 2200 movel %d0,%d1 4be8e: 5281 addql #1,%d1 } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 4be90: 52aa 0020 addql #1,%a2@(32) if (pipe->Readers ++ == 0) 4be94: 2541 0010 movel %d1,%a2@(16) 4be98: 4a80 tstl %d0 4be9a: 6610 bnes 4beac <== NEVER TAKEN PIPE_WAKEUPWRITERS(pipe); 4be9c: 486e fff8 pea %fp@(-8) 4bea0: 2f2a 0030 movel %a2@(48),%sp@- 4bea4: 4eb9 0004 d460 jsr 4d460 4beaa: 508f addql #8,%sp pipe->writerCounter ++; if (pipe->Writers ++ == 0) 4beac: 202a 0014 movel %a2@(20),%d0 4beb0: 2040 moveal %d0,%a0 4beb2: 5288 addql #1,%a0 case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; 4beb4: 52aa 0024 addql #1,%a2@(36) if (pipe->Writers ++ == 0) 4beb8: 2548 0014 movel %a0,%a2@(20) 4bebc: 4a80 tstl %d0 4bebe: 6610 bnes 4bed0 <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); 4bec0: 486e fff8 pea %fp@(-8) 4bec4: 2f2a 002c movel %a2@(44),%sp@- 4bec8: 4eb9 0004 d460 jsr 4d460 4bece: 508f addql #8,%sp break; } PIPE_UNLOCK(pipe); 4bed0: 2f2a 0028 movel %a2@(40),%sp@- 4bed4: 4eb9 0004 7ac8 jsr 47ac8 return 0; 4beda: 588f addql #4,%sp 4bedc: 602e bras 4bf0c /* Not an error */ if (LIBIO_NODELAY(iop)) break; prevCounter = pipe->writerCounter; err = -EINTR; 4bede: 74fc moveq #-4,%d2 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); 4bee0: 2f0c movel %a4,%sp@- 4bee2: 2f0b movel %a3,%sp@- 4bee4: 4eb9 0004 ba98 jsr 4ba98 return err; 4beea: 508f addql #8,%sp 4beec: 601e bras 4bf0c err = pipe_lock(); if (err) return err; pipe = *pipep; 4beee: 2453 moveal %a3@,%a2 if (pipe == NULL) { 4bef0: 4a8a tstl %a2 4bef2: 6600 fe16 bnew 4bd0a 4bef6: 6000 fcc2 braw 4bbba if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; 4befa: 74f4 moveq #-12,%d2 4befc: 6000 fe3c braw 4bd3a #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 4bf00: 5280 addql #1,%d0 4bf02: 13c0 0005 f888 moveb %d0,5f888 4bf08: 6000 fe00 braw 4bd0a return 0; out_error: pipe_release(pipep, iop); return err; } 4bf0c: 2002 movel %d2,%d0 4bf0e: 4cee 3c3c ffd8 moveml %fp@(-40),%d2-%d5/%a2-%a5 4bf14: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000475ec : */ long fpathconf( int fd, int name ) { 475ec: 4e56 0000 linkw %fp,#0 475f0: 202e 0008 movel %fp@(8),%d0 475f4: 222e 000c movel %fp@(12),%d1 475f8: 2f02 movel %d2,%sp@- long return_value; rtems_libio_t *iop; const rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); 475fa: b0b9 0005 c584 cmpl 5c584 ,%d0 47600: 6502 bcss 47604 <== NEVER TAKEN 47602: 601c bras 47620 iop = rtems_libio_iop(fd); 47604: 2400 movel %d0,%d2 <== NOT EXECUTED 47606: ed88 lsll #6,%d0 <== NOT EXECUTED 47608: e98a lsll #4,%d2 <== NOT EXECUTED 4760a: 2079 0005 d608 moveal 5d608 ,%a0 <== NOT EXECUTED 47610: 9082 subl %d2,%d0 <== NOT EXECUTED 47612: d1c0 addal %d0,%a0 <== NOT EXECUTED rtems_libio_check_is_open(iop); 47614: 2028 000c movel %a0@(12),%d0 <== NOT EXECUTED 47618: 0280 0000 0100 andil #256,%d0 <== NOT EXECUTED 4761e: 6610 bnes 47630 <== NOT EXECUTED 47620: 4eb9 0004 995c jsr 4995c <__errno> 47626: 7209 moveq #9,%d1 47628: 2040 moveal %d0,%a0 4762a: 2081 movel %d1,%a0@ 4762c: 6000 0084 braw 476b2 /* * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; 47630: 2068 0024 moveal %a0@(36),%a0 <== NOT EXECUTED switch ( name ) { 47634: 700b moveq #11,%d0 <== NOT EXECUTED /* * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; 47636: 2068 002a moveal %a0@(42),%a0 <== NOT EXECUTED switch ( name ) { 4763a: b081 cmpl %d1,%d0 <== NOT EXECUTED 4763c: 6568 bcss 476a6 <== NOT EXECUTED 4763e: 303b 1a08 movew %pc@(47648 ,%d1:l:2),%d0<== NOT EXECUTED 47642: 48c0 extl %d0 <== NOT EXECUTED 47644: 4efb 0802 jmp %pc@(47648 ,%d0:l) <== NOT EXECUTED 47648: 0018 .short 0x0018 <== NOT EXECUTED 4764a: 001c .short 0x001c <== NOT EXECUTED 4764c: 0022 .short 0x0022 <== NOT EXECUTED 4764e: 0028 .short 0x0028 <== NOT EXECUTED 47650: 002e .short 0x002e <== NOT EXECUTED 47652: 0034 .short 0x0034 <== NOT EXECUTED 47654: 003a .short 0x003a <== NOT EXECUTED 47656: 0040 .short 0x0040 <== NOT EXECUTED 47658: 0046 .short 0x0046 <== NOT EXECUTED 4765a: 004c .short 0x004c <== NOT EXECUTED 4765c: 0052 .short 0x0052 <== NOT EXECUTED 4765e: 0058 .short 0x0058 <== NOT EXECUTED case _PC_LINK_MAX: return_value = the_limits->link_max; 47660: 2010 movel %a0@,%d0 <== NOT EXECUTED break; 47662: 6050 bras 476b4 <== NOT EXECUTED case _PC_MAX_CANON: return_value = the_limits->max_canon; 47664: 2028 0004 movel %a0@(4),%d0 <== NOT EXECUTED break; 47668: 604a bras 476b4 <== NOT EXECUTED case _PC_MAX_INPUT: return_value = the_limits->max_input; 4766a: 2028 0008 movel %a0@(8),%d0 <== NOT EXECUTED break; 4766e: 6044 bras 476b4 <== NOT EXECUTED case _PC_NAME_MAX: return_value = the_limits->name_max; 47670: 2028 000c movel %a0@(12),%d0 <== NOT EXECUTED break; 47674: 603e bras 476b4 <== NOT EXECUTED case _PC_PATH_MAX: return_value = the_limits->path_max; 47676: 2028 0010 movel %a0@(16),%d0 <== NOT EXECUTED break; 4767a: 6038 bras 476b4 <== NOT EXECUTED case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 4767c: 2028 0014 movel %a0@(20),%d0 <== NOT EXECUTED break; 47680: 6032 bras 476b4 <== NOT EXECUTED case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 47682: 2028 001c movel %a0@(28),%d0 <== NOT EXECUTED break; 47686: 602c bras 476b4 <== NOT EXECUTED case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 47688: 2028 0020 movel %a0@(32),%d0 <== NOT EXECUTED break; 4768c: 6026 bras 476b4 <== NOT EXECUTED case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 4768e: 2028 002c movel %a0@(44),%d0 <== NOT EXECUTED break; 47692: 6020 bras 476b4 <== NOT EXECUTED case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 47694: 2028 0018 movel %a0@(24),%d0 <== NOT EXECUTED break; 47698: 601a bras 476b4 <== NOT EXECUTED case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 4769a: 2028 0024 movel %a0@(36),%d0 <== NOT EXECUTED break; 4769e: 6014 bras 476b4 <== NOT EXECUTED case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 476a0: 2028 0028 movel %a0@(40),%d0 <== NOT EXECUTED break; 476a4: 600e bras 476b4 <== NOT EXECUTED default: rtems_set_errno_and_return_minus_one( EINVAL ); 476a6: 4eb9 0004 995c jsr 4995c <__errno> <== NOT EXECUTED 476ac: 2040 moveal %d0,%a0 <== NOT EXECUTED 476ae: 7016 moveq #22,%d0 <== NOT EXECUTED 476b0: 2080 movel %d0,%a0@ <== NOT EXECUTED 476b2: 70ff moveq #-1,%d0 break; } return return_value; } 476b4: 242e fffc movel %fp@(-4),%d2 476b8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00042a60 : #include void free( void *ptr ) { 42a60: 4e56 0000 linkw %fp,#0 MSBUMP(free_calls, 1); 42a64: 52b9 0005 edd8 addql #1,5edd8 #include void free( void *ptr ) { 42a6a: 2f02 movel %d2,%sp@- 42a6c: 242e 0008 movel %fp@(8),%d2 MSBUMP(free_calls, 1); if ( !ptr ) 42a70: 676c beqs 42ade return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 42a72: 7003 moveq #3,%d0 42a74: b0b9 0005 f30a cmpl 5f30a <_System_state_Current>,%d0 42a7a: 661a bnes 42a96 <== NEVER TAKEN !malloc_is_system_state_OK() ) { 42a7c: 4eb9 0004 2c30 jsr 42c30 return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 42a82: 4a00 tstb %d0 42a84: 6610 bnes 42a96 !malloc_is_system_state_OK() ) { malloc_deferred_free(ptr); 42a86: 2d42 0008 movel %d2,%fp@(8) RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } 42a8a: 242e fffc movel %fp@(-4),%d2 42a8e: 4e5e unlk %fp /* * 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); 42a90: 4ef9 0004 2c84 jmp 42c84 } /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 42a96: 2079 0005 dd90 moveal 5dd90 ,%a0 42a9c: 4a88 tstl %a0 42a9e: 670a beqs 42aaa (*rtems_malloc_statistics_helpers->at_free)(ptr); 42aa0: 2f02 movel %d2,%sp@- 42aa2: 2068 0008 moveal %a0@(8),%a0 42aa6: 4e90 jsr %a0@ 42aa8: 588f addql #4,%sp if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { 42aaa: 2f02 movel %d2,%sp@- 42aac: 2f39 0005 d65c movel 5d65c ,%sp@- 42ab2: 4eb9 0004 7d64 jsr 47d64 <_Protected_heap_Free> 42ab8: 508f addql #8,%sp 42aba: 4a00 tstb %d0 42abc: 6620 bnes 42ade printk( "Program heap: free of bad pointer %p -- range %p - %p \n", ptr, RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end 42abe: 2079 0005 d65c moveal 5d65c ,%a0 */ 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", 42ac4: 2f28 001c movel %a0@(28),%sp@- 42ac8: 2f28 0018 movel %a0@(24),%sp@- 42acc: 2f02 movel %d2,%sp@- 42ace: 4879 0005 c4a4 pea 5c4a4 42ad4: 4eb9 0004 372c jsr 4372c 42ada: 4fef 0010 lea %sp@(16),%sp RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } 42ade: 242e fffc movel %fp@(-4),%d2 42ae2: 4e5e unlk %fp ... =============================================================================== 0005ab5c : int fstat( int fd, struct stat *sbuf ) { 5ab5c: 4e56 0000 linkw %fp,#0 5ab60: 202e 0008 movel %fp@(8),%d0 5ab64: 2f0a movel %a2,%sp@- 5ab66: 2f02 movel %d2,%sp@- 5ab68: 242e 000c movel %fp@(12),%d2 rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) 5ab6c: 660e bnes 5ab7c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); 5ab6e: 4eb9 0004 cf98 jsr 4cf98 <__errno> <== NOT EXECUTED 5ab74: 720e moveq #14,%d1 <== NOT EXECUTED 5ab76: 2040 moveal %d0,%a0 <== NOT EXECUTED 5ab78: 2081 movel %d1,%a0@ <== NOT EXECUTED 5ab7a: 6064 bras 5abe0 <== NOT EXECUTED /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); 5ab7c: b0b9 0005 d6a0 cmpl 5d6a0 ,%d0 5ab82: 641c bccs 5aba0 5ab84: 2200 movel %d0,%d1 5ab86: ed88 lsll #6,%d0 5ab88: e989 lsll #4,%d1 5ab8a: 2479 0005 edc0 moveal 5edc0 ,%a2 5ab90: 9081 subl %d1,%d0 5ab92: d5c0 addal %d0,%a2 rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); 5ab94: 202a 000c movel %a2@(12),%d0 5ab98: 0280 0000 0100 andil #256,%d0 5ab9e: 660e bnes 5abae 5aba0: 4eb9 0004 cf98 jsr 4cf98 <__errno> 5aba6: 2040 moveal %d0,%a0 5aba8: 7009 moveq #9,%d0 5abaa: 2080 movel %d0,%a0@ 5abac: 6032 bras 5abe0 /* * Zero out the stat structure so the various support * versions of stat don't have to. */ memset( sbuf, 0, sizeof(struct stat) ); 5abae: 4878 0046 pea 46 5abb2: 42a7 clrl %sp@- 5abb4: 2f02 movel %d2,%sp@- 5abb6: 4eb9 0004 d828 jsr 4d828 return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); 5abbc: 206a 0020 moveal %a2@(32),%a0 5abc0: 45ea 0010 lea %a2@(16),%a2 5abc4: 4fef 000c lea %sp@(12),%sp 5abc8: 2d42 000c movel %d2,%fp@(12) } 5abcc: 242e fff8 movel %fp@(-8),%d2 * 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 ); 5abd0: 2d4a 0008 movel %a2,%fp@(8) } 5abd4: 246e fffc moveal %fp@(-4),%a2 5abd8: 4e5e unlk %fp * 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 ); 5abda: 2268 0018 moveal %a0@(24),%a1 5abde: 4ed1 jmp %a1@ } 5abe0: 242e fff8 movel %fp@(-8),%d2 5abe4: 70ff moveq #-1,%d0 5abe6: 246e fffc moveal %fp@(-4),%a2 5abea: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00042734 : } } static rtems_disk_device * get_disk_entry(dev_t dev, bool lookup_only) { 42734: 4e56 0000 linkw %fp,#0 42738: 202e 000c movel %fp@(12),%d0 4273c: 2f03 movel %d3,%sp@- 4273e: 162e 0013 moveb %fp@(19),%d3 42742: 2f02 movel %d2,%sp@- 42744: 242e 0008 movel %fp@(8),%d2 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) { 42748: b4b9 0006 1e52 cmpl 61e52 ,%d2 4274e: 6432 bccs 42782 <== NEVER TAKEN 42750: 2239 0006 1e56 movel 61e56 ,%d1 42756: 672a beqs 42782 <== NEVER TAKEN rtems_disk_device_table *dtab = disktab + major; 42758: 2041 moveal %d1,%a0 4275a: e78a lsll #3,%d2 4275c: d1c2 addal %d2,%a0 if (minor < dtab->size && dtab->minor != NULL) { 4275e: b0a8 0004 cmpl %a0@(4),%d0 42762: 641e bccs 42782 <== NEVER TAKEN 42764: 2050 moveal %a0@,%a0 42766: 4a88 tstl %a0 42768: 6718 beqs 42782 <== NEVER TAKEN rtems_disk_device *dd = dtab->minor [minor]; 4276a: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 if (dd != NULL && !lookup_only) { 4276e: 4a88 tstl %a0 42770: 6712 beqs 42784 42772: 4a03 tstb %d3 42774: 660e bnes 42784 if (!dd->deleted) { 42776: 4a28 0040 tstb %a0@(64) 4277a: 6606 bnes 42782 ++dd->uses; 4277c: 52a8 0014 addql #1,%a0@(20) 42780: 6002 bras 42784 return dd; } } return NULL; 42782: 91c8 subal %a0,%a0 } 42784: 241f movel %sp@+,%d2 42786: 2008 movel %a0,%d0 42788: 261f movel %sp@+,%d3 4278a: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000438f8 : * 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, 438f8: 4e56 0000 linkw %fp,#0 438fc: 2f0a movel %a2,%sp@- new_off = lseek(fd, off, SEEK_SET); if (new_off != off) { return RTEMS_IO_ERROR; } s = (rtems_sector_data_t *) malloc(sizeof(rtems_sector_data_t) + RTEMS_IDE_SECTOR_SIZE); 438fe: 4878 0204 pea 204 43902: 4eb9 0004 4e0c jsr 44e0c if (s == NULL) 43908: 588f addql #4,%sp new_off = lseek(fd, off, SEEK_SET); if (new_off != off) { return RTEMS_IO_ERROR; } s = (rtems_sector_data_t *) malloc(sizeof(rtems_sector_data_t) + RTEMS_IDE_SECTOR_SIZE); 4390a: 2440 moveal %d0,%a2 if (s == NULL) 4390c: 4a80 tstl %d0 4390e: 673a beqs 4394a <== NEVER TAKEN { return RTEMS_NO_MEMORY; } n = read(fd, s->data, RTEMS_IDE_SECTOR_SIZE); 43910: 4878 0200 pea 200 43914: 486a 0004 pea %a2@(4) 43918: 2f2e 0008 movel %fp@(8),%sp@- 4391c: 4eb9 0004 5820 jsr 45820 if (n != RTEMS_IDE_SECTOR_SIZE) 43922: 4fef 000c lea %sp@(12),%sp 43926: 0c80 0000 0200 cmpil #512,%d0 4392c: 670e beqs 4393c <== ALWAYS TAKEN { free(s); 4392e: 2f0a movel %a2,%sp@- <== NOT EXECUTED 43930: 4eb9 0004 4844 jsr 44844 <== NOT EXECUTED 43936: 588f addql #4,%sp <== NOT EXECUTED return RTEMS_IO_ERROR; 43938: 701b moveq #27,%d0 <== NOT EXECUTED 4393a: 6010 bras 4394c <== NOT EXECUTED } s->sector_num = sector_num; 4393c: 24ae 000c movel %fp@(12),%a2@ *sector = s; return RTEMS_SUCCESSFUL; 43940: 4280 clrl %d0 return RTEMS_IO_ERROR; } s->sector_num = sector_num; *sector = s; 43942: 206e 0010 moveal %fp@(16),%a0 43946: 208a movel %a2,%a0@ 43948: 6002 bras 4394c } s = (rtems_sector_data_t *) malloc(sizeof(rtems_sector_data_t) + RTEMS_IDE_SECTOR_SIZE); if (s == NULL) { return RTEMS_NO_MEMORY; 4394a: 701a moveq #26,%d0 <== NOT EXECUTED s->sector_num = sector_num; *sector = s; return RTEMS_SUCCESSFUL; } 4394c: 246e fffc moveal %fp@(-4),%a2 43950: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0006a6f4 : int getdents( int dd_fd, char *dd_buf, int dd_len ) { 6a6f4: 4e56 fff4 linkw %fp,#-12 6a6f8: 202e 0008 movel %fp@(8),%d0 6a6fc: 48d7 040c moveml %d2-%d3/%a2,%sp@ 6a700: 242e 000c movel %fp@(12),%d2 6a704: 262e 0010 movel %fp@(16),%d3 rtems_filesystem_node_types_t type; /* * Get the file control block structure associated with the file descriptor */ iop = rtems_libio_iop( dd_fd ); 6a708: b0b9 0007 0018 cmpl 70018 ,%d0 6a70e: 6412 bccs 6a722 <== NEVER TAKEN 6a710: 2200 movel %d0,%d1 6a712: ed88 lsll #6,%d0 6a714: e989 lsll #4,%d1 6a716: 2479 0008 1890 moveal 81890 ,%a2 6a71c: 9081 subl %d1,%d0 6a71e: d5c0 addal %d0,%a2 6a720: 6002 bras 6a724 6a722: 95ca subal %a2,%a2 <== NOT EXECUTED /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); 6a724: 486a 0010 pea %a2@(16) 6a728: 4eb9 0004 80d4 jsr 480d4 if ( type != RTEMS_FILESYSTEM_DIRECTORY ) 6a72e: 588f addql #4,%sp 6a730: 4a80 tstl %d0 6a732: 661e bnes 6a752 /* * 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 ); 6a734: 206a 0020 moveal %a2@(32),%a0 6a738: 2d43 0010 movel %d3,%fp@(16) 6a73c: 2d42 000c movel %d2,%fp@(12) 6a740: 2d4a 0008 movel %a2,%fp@(8) 6a744: 2268 0008 moveal %a0@(8),%a1 } 6a748: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 6a74e: 4e5e unlk %fp /* * 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 ); 6a750: 4ed1 jmp %a1@ /* * 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 ); 6a752: 4eb9 0005 bd98 jsr 5bd98 <__errno> 6a758: 2040 moveal %d0,%a0 6a75a: 7014 moveq #20,%d0 /* * 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 ); } 6a75c: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 /* * 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 ); 6a762: 2080 movel %d0,%a0@ /* * 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 ); } 6a764: 70ff moveq #-1,%d0 6a766: 4e5e unlk %fp ... =============================================================================== 0005e8f6 : /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { 5e8f6: 4e56 0000 linkw %fp,#0 5e8fa: 2f0a movel %a2,%sp@- 5e8fc: 2f02 movel %d2,%sp@- FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) 5e8fe: 4a39 0009 6908 tstb 96908 5e904: 6600 00c4 bnew 5e9ca return; etc_passwd_initted = 1; mkdir("/etc", 0777); 5e908: 4878 01ff pea 1ff /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { 5e90c: 45f9 0006 f04e lea 6f04e ,%a2 static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; mkdir("/etc", 0777); 5e912: 4879 0008 e454 pea 8e454 FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; 5e918: 7001 moveq #1,%d0 5e91a: 13c0 0009 6908 moveb %d0,96908 mkdir("/etc", 0777); 5e920: 4eb9 0004 2c14 jsr 42c14 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { 5e926: 4879 0008 ac8f pea 8ac8f 5e92c: 4879 0008 e459 pea 8e459 5e932: 4e92 jsr %a2@ 5e934: 4fef 0010 lea %sp@(16),%sp 5e938: 4a80 tstl %d0 5e93a: 670c beqs 5e948 fclose(fp); 5e93c: 2f00 movel %d0,%sp@- 5e93e: 4eb9 0006 e7b0 jsr 6e7b0 5e944: 588f addql #4,%sp 5e946: 602e bras 5e976 } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { 5e948: 4879 0008 ac8c pea 8ac8c 5e94e: 4879 0008 e459 pea 8e459 5e954: 4e92 jsr %a2@ 5e956: 508f addql #8,%sp 5e958: 2400 movel %d0,%d2 5e95a: 671a beqs 5e976 <== NEVER TAKEN fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" 5e95c: 2f00 movel %d0,%sp@- 5e95e: 4879 0008 e465 pea 8e465 5e964: 4eb9 0006 f1de jsr 6f1de "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); 5e96a: 2f02 movel %d2,%sp@- 5e96c: 4eb9 0006 e7b0 jsr 6e7b0 5e972: 4fef 000c lea %sp@(12),%sp } /* * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { 5e976: 4879 0008 ac8f pea 8ac8f 5e97c: 45f9 0006 f04e lea 6f04e ,%a2 5e982: 4879 0008 e4cc pea 8e4cc 5e988: 4e92 jsr %a2@ 5e98a: 508f addql #8,%sp 5e98c: 4a80 tstl %d0 5e98e: 670c beqs 5e99c fclose(fp); 5e990: 2f00 movel %d0,%sp@- 5e992: 4eb9 0006 e7b0 jsr 6e7b0 5e998: 588f addql #4,%sp 5e99a: 602e bras 5e9ca } else if ((fp = fopen("/etc/group", "w")) != NULL) { 5e99c: 4879 0008 ac8c pea 8ac8c 5e9a2: 4879 0008 e4cc pea 8e4cc 5e9a8: 4e92 jsr %a2@ 5e9aa: 508f addql #8,%sp 5e9ac: 2400 movel %d0,%d2 5e9ae: 671a beqs 5e9ca <== NEVER TAKEN fprintf( fp, "root:x:0:root\n" 5e9b0: 2f00 movel %d0,%sp@- 5e9b2: 4879 0008 e4d7 pea 8e4d7 5e9b8: 4eb9 0006 f1de jsr 6f1de "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); 5e9be: 2f02 movel %d2,%sp@- 5e9c0: 4eb9 0006 e7b0 jsr 6e7b0 5e9c6: 4fef 000c lea %sp@(12),%sp } } 5e9ca: 242e fff8 movel %fp@(-8),%d2 5e9ce: 246e fffc moveal %fp@(-4),%a2 5e9d2: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000450ce : /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 450ce: 4e56 fff0 linkw %fp,#-16 450d2: 222e 0008 movel %fp@(8),%d1 450d6: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 450da: 246e 000c moveal %fp@(12),%a2 if (tty->termios.c_iflag & ISTRIP) 450de: 202a 0030 movel %a2@(48),%d0 /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 450e2: 1401 moveb %d1,%d2 if (tty->termios.c_iflag & ISTRIP) 450e4: 0800 0005 btst #5,%d0 450e8: 6704 beqs 450ee <== ALWAYS TAKEN c &= 0x7f; 450ea: 747f moveq #127,%d2 <== NOT EXECUTED 450ec: c481 andl %d1,%d2 <== NOT EXECUTED if (tty->termios.c_iflag & IUCLC) 450ee: 0800 0009 btst #9,%d0 450f2: 6722 beqs 45116 c = tolower (c); 450f4: 2079 0005 d858 moveal 5d858 <__ctype_ptr__>,%a0 450fa: 7603 moveq #3,%d3 450fc: 0282 0000 00ff andil #255,%d2 45102: 1230 2801 moveb %a0@(00000001,%d2:l),%d1 45106: c283 andl %d3,%d1 45108: 163c 0001 moveb #1,%d3 4510c: b681 cmpl %d1,%d3 4510e: 6606 bnes 45116 45110: 0682 0000 0020 addil #32,%d2 if (c == '\r') { 45116: 4281 clrl %d1 45118: 1202 moveb %d2,%d1 4511a: 760d moveq #13,%d3 4511c: b681 cmpl %d1,%d3 4511e: 6612 bnes 45132 if (tty->termios.c_iflag & IGNCR) 45120: 4a00 tstb %d0 45122: 6c04 bges 45128 <== ALWAYS TAKEN 45124: 6000 0144 braw 4526a <== NOT EXECUTED return 0; if (tty->termios.c_iflag & ICRNL) 45128: 0800 0008 btst #8,%d0 4512c: 671a beqs 45148 <== NEVER TAKEN c = '\n'; 4512e: 740a moveq #10,%d2 45130: 6016 bras 45148 } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { 45132: 760a moveq #10,%d3 45134: b681 cmpl %d1,%d3 45136: 660a bnes 45142 45138: 0800 0006 btst #6,%d0 4513c: 670a beqs 45148 <== ALWAYS TAKEN c = '\r'; 4513e: 740d moveq #13,%d2 <== NOT EXECUTED 45140: 6006 bras 45148 <== NOT EXECUTED } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 45142: 4a02 tstb %d2 45144: 6700 00ee beqw 45234 45148: 222a 003c movel %a2@(60),%d1 4514c: 0801 0001 btst #1,%d1 45150: 6700 00e2 beqw 45234 if (c == tty->termios.c_cc[VERASE]) { 45154: 4283 clrl %d3 45156: 162a 0043 moveb %a2@(67),%d3 4515a: 4280 clrl %d0 4515c: 1002 moveb %d2,%d0 4515e: b680 cmpl %d0,%d3 45160: 660c bnes 4516e * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) 45162: 4aaa 0020 tstl %a2@(32) 45166: 6700 0102 beqw 4526a 4516a: 42a7 clrl %sp@- 4516c: 604c bras 451ba 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]) { 4516e: 4283 clrl %d3 45170: 162a 0044 moveb %a2@(68),%d3 45174: b680 cmpl %d0,%d3 45176: 664e bnes 451c6 * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) 45178: 4aaa 0020 tstl %a2@(32) 4517c: 6700 00ec beqw 4526a return; if (lineFlag) { if (!(tty->termios.c_lflag & ECHO)) { 45180: 44c1 movew %d1,%ccr 45182: 6b08 bmis 4518c <== ALWAYS TAKEN tty->ccount = 0; 45184: 42aa 0020 clrl %a2@(32) <== NOT EXECUTED 45188: 6000 00e0 braw 4526a <== NOT EXECUTED return; } if (!(tty->termios.c_lflag & ECHOE)) { 4518c: 0801 0004 btst #4,%d1 45190: 6624 bnes 451b6 <== ALWAYS TAKEN tty->ccount = 0; 45192: 42aa 0020 clrl %a2@(32) <== NOT EXECUTED echo (tty->termios.c_cc[VKILL], tty); 45196: 47fa fd66 lea %pc@(44efe ),%a3 <== NOT EXECUTED 4519a: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4519c: 2f00 movel %d0,%sp@- <== NOT EXECUTED 4519e: 4e93 jsr %a3@ <== NOT EXECUTED if (tty->termios.c_lflag & ECHOK) 451a0: 508f addql #8,%sp <== NOT EXECUTED 451a2: 7020 moveq #32,%d0 <== NOT EXECUTED 451a4: c0aa 003c andl %a2@(60),%d0 <== NOT EXECUTED 451a8: 6700 00c0 beqw 4526a <== NOT EXECUTED echo ('\n', tty); 451ac: 2f0a movel %a2,%sp@- <== NOT EXECUTED 451ae: 4878 000a pea a <== NOT EXECUTED 451b2: 4e93 jsr %a3@ <== NOT EXECUTED 451b4: 600a bras 451c0 <== NOT EXECUTED 451b6: 4878 0001 pea 1 451ba: 2f0a movel %a2,%sp@- 451bc: 4eba fdc8 jsr %pc@(44f86 ) 451c0: 508f addql #8,%sp 451c2: 6000 00a6 braw 4526a } else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { 451c6: 4283 clrl %d3 451c8: 162a 0045 moveb %a2@(69),%d3 451cc: b680 cmpl %d0,%d3 451ce: 6700 009e beqw 4526e return 1; } else if (c == '\n') { 451d2: 760a moveq #10,%d3 451d4: b680 cmpl %d0,%d3 451d6: 6622 bnes 451fa if (tty->termios.c_lflag & (ECHO | ECHONL)) 451d8: 7048 moveq #72,%d0 451da: c280 andl %d0,%d1 451dc: 670c beqs 451ea <== NEVER TAKEN echo (c, tty); 451de: 2f0a movel %a2,%sp@- 451e0: 4878 000a pea a 451e4: 4eba fd18 jsr %pc@(44efe ) 451e8: 508f addql #8,%sp tty->cbuf[tty->ccount++] = c; 451ea: 202a 0020 movel %a2@(32),%d0 451ee: 206a 001c moveal %a2@(28),%a0 451f2: 720a moveq #10,%d1 451f4: 1181 0800 moveb %d1,%a0@(00000000,%d0:l) 451f8: 6032 bras 4522c return 1; } else if ((c == tty->termios.c_cc[VEOL]) || 451fa: 4283 clrl %d3 451fc: 162a 004c moveb %a2@(76),%d3 45200: b680 cmpl %d0,%d3 45202: 670a beqs 4520e <== NEVER TAKEN 45204: 4283 clrl %d3 45206: 162a 0051 moveb %a2@(81),%d3 4520a: b680 cmpl %d0,%d3 4520c: 6626 bnes 45234 <== ALWAYS TAKEN (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) 4520e: 44c1 movew %d1,%ccr <== NOT EXECUTED 45210: 6a0e bpls 45220 <== NOT EXECUTED echo (c, tty); 45212: 2f0a movel %a2,%sp@- <== NOT EXECUTED 45214: 4280 clrl %d0 <== NOT EXECUTED 45216: 1002 moveb %d2,%d0 <== NOT EXECUTED 45218: 2f00 movel %d0,%sp@- <== NOT EXECUTED 4521a: 4eba fce2 jsr %pc@(44efe ) <== NOT EXECUTED 4521e: 508f addql #8,%sp <== NOT EXECUTED tty->cbuf[tty->ccount++] = c; 45220: 202a 0020 movel %a2@(32),%d0 <== NOT EXECUTED 45224: 206a 001c moveal %a2@(28),%a0 <== NOT EXECUTED 45228: 1182 0800 moveb %d2,%a0@(00000000,%d0:l) <== NOT EXECUTED 4522c: 5280 addql #1,%d0 4522e: 2540 0020 movel %d0,%a2@(32) 45232: 603a bras 4526e } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 45234: 2039 0005 d6e4 movel 5d6e4 ,%d0 4523a: 5380 subql #1,%d0 4523c: b0aa 0020 cmpl %a2@(32),%d0 45240: 6328 blss 4526a <== NEVER TAKEN if (tty->termios.c_lflag & ECHO) 45242: 7008 moveq #8,%d0 45244: c0aa 003c andl %a2@(60),%d0 45248: 670e beqs 45258 <== NEVER TAKEN echo (c, tty); 4524a: 2f0a movel %a2,%sp@- 4524c: 4280 clrl %d0 4524e: 1002 moveb %d2,%d0 45250: 2f00 movel %d0,%sp@- 45252: 4eba fcaa jsr %pc@(44efe ) 45256: 508f addql #8,%sp tty->cbuf[tty->ccount++] = c; 45258: 202a 0020 movel %a2@(32),%d0 4525c: 206a 001c moveal %a2@(28),%a0 45260: 1182 0800 moveb %d2,%a0@(00000000,%d0:l) 45264: 5280 addql #1,%d0 45266: 2540 0020 movel %d0,%a2@(32) } return 0; 4526a: 4280 clrl %d0 4526c: 6002 bras 45270 else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { return 1; 4526e: 7001 moveq #1,%d0 if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; } 45270: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 45276: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005af80 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 5af80: 4e56 ffcc linkw %fp,#-52 5af84: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 5af88: 242e 000c movel %fp@(12),%d2 5af8c: 246e 0010 moveal %fp@(16),%a2 POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 5af90: 4eb9 0005 ac08 jsr 5ac08 5af96: b0ae 0008 cmpl %fp@(8),%d0 5af9a: 6710 beqs 5afac rtems_set_errno_and_return_minus_one( ESRCH ); 5af9c: 4eb9 0004 cf98 jsr 4cf98 <__errno> 5afa2: 7603 moveq #3,%d3 5afa4: 2040 moveal %d0,%a0 5afa6: 2083 movel %d3,%a0@ 5afa8: 6000 01ce braw 5b178 /* * Validate the signal passed. */ if ( !sig ) 5afac: 4a82 tstl %d2 5afae: 6610 bnes 5afc0 rtems_set_errno_and_return_minus_one( EINVAL ); 5afb0: 4eb9 0004 cf98 jsr 4cf98 <__errno> 5afb6: 7416 moveq #22,%d2 5afb8: 2a40 moveal %d0,%a5 5afba: 2a82 movel %d2,%a5@ 5afbc: 6000 01ba braw 5b178 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 5afc0: 2002 movel %d2,%d0 5afc2: 5380 subql #1,%d0 if ( !is_valid_signo(sig) ) 5afc4: 721f moveq #31,%d1 5afc6: b280 cmpl %d0,%d1 5afc8: 6410 bccs 5afda rtems_set_errno_and_return_minus_one( EINVAL ); 5afca: 4eb9 0004 cf98 jsr 4cf98 <__errno> 5afd0: 7216 moveq #22,%d1 5afd2: 2040 moveal %d0,%a0 5afd4: 2081 movel %d1,%a0@ 5afd6: 6000 01a0 braw 5b178 /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 5afda: 2202 movel %d2,%d1 5afdc: 2802 movel %d2,%d4 5afde: e589 lsll #2,%d1 5afe0: e98c lsll #4,%d4 5afe2: 9881 subl %d1,%d4 5afe4: 2044 moveal %d4,%a0 5afe6: d1fc 0005 f360 addal #389984,%a0 5afec: 7201 moveq #1,%d1 5afee: b290 cmpl %a0@,%d1 5aff0: 6700 01b2 beqw 5b1a4 /* * 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 ) ) 5aff4: 123c 0008 moveb #8,%d1 5aff8: b282 cmpl %d2,%d1 5affa: 6710 beqs 5b00c 5affc: 123c 0004 moveb #4,%d1 5b000: b282 cmpl %d2,%d1 5b002: 6708 beqs 5b00c 5b004: 123c 000b moveb #11,%d1 5b008: b282 cmpl %d2,%d1 5b00a: 6616 bnes 5b022 return pthread_kill( pthread_self(), sig ); 5b00c: 4eb9 0005 b38c jsr 5b38c 5b012: 2f02 movel %d2,%sp@- 5b014: 2f00 movel %d0,%sp@- 5b016: 4eb9 0005 b2cc jsr 5b2cc 5b01c: 508f addql #8,%sp 5b01e: 6000 0186 braw 5b1a6 static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 5b022: 7601 moveq #1,%d3 5b024: e1ab lsll %d0,%d3 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; 5b026: 7001 moveq #1,%d0 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 5b028: 2d42 fff4 movel %d2,%fp@(-12) siginfo->si_code = SI_USER; 5b02c: 2d40 fff8 movel %d0,%fp@(-8) if ( !value ) { 5b030: 4a8a tstl %a2 5b032: 6606 bnes 5b03a siginfo->si_value.sival_int = 0; 5b034: 42ae fffc clrl %fp@(-4) 5b038: 6004 bras 5b03e } else { siginfo->si_value = *value; 5b03a: 2d52 fffc movel %a2@,%fp@(-4) * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 5b03e: 2039 0005 eed6 movel 5eed6 <_Thread_Dispatch_disable_level>,%d0 ++level; 5b044: 5280 addql #1,%d0 _Thread_Dispatch_disable_level = level; 5b046: 23c0 0005 eed6 movel %d0,5eed6 <_Thread_Dispatch_disable_level> */ 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 ); 5b04c: 4879 0005 d7a4 pea 5d7a4 <_POSIX_signals_Post_switch> 5b052: 4eb9 0004 6bc6 jsr 46bc6 <_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; 5b058: 2079 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a0 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 5b05e: 588f addql #4,%sp 5b060: 2268 00fe moveal %a0@(254),%a1 5b064: 2029 00d0 movel %a1@(208),%d0 5b068: 4680 notl %d0 5b06a: c083 andl %d3,%d0 5b06c: 6600 00ae bnew 5b11c */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 5b070: 2079 0005 f4e4 moveal 5f4e4 <_POSIX_signals_Wait_queue>,%a0 /* 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 ); 5b076: 601c bras 5b094 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 5b078: 2003 movel %d3,%d0 5b07a: c0a8 0030 andl %a0@(48),%d0 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 ]; 5b07e: 2268 00fe moveal %a0@(254),%a1 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 5b082: 6600 0098 bnew 5b11c /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 5b086: 2029 00d0 movel %a1@(208),%d0 5b08a: 4680 notl %d0 5b08c: c083 andl %d3,%d0 5b08e: 6600 008c bnew 5b11c 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 ) { 5b092: 2050 moveal %a0@,%a0 /* 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 ); 5b094: b1fc 0005 f4e8 cmpal #390376,%a0 5b09a: 66dc bnes 5b078 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 5b09c: 4280 clrl %d0 5b09e: 1039 0005 d5dc moveb 5d5dc ,%d0 5b0a4: 45f9 0005 ee9a lea 5ee9a <_Objects_Information_table+0x8>,%a2 5b0aa: 5280 addql #1,%d0 * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 5b0ac: 91c8 subal %a0,%a0 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 ] ) 5b0ae: 225a moveal %a2@+,%a1 5b0b0: 4a89 tstl %a1 5b0b2: 675c beqs 5b110 <== NEVER TAKEN continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 5b0b4: 2269 0004 moveal %a1@(4),%a1 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 5b0b8: 4281 clrl %d1 object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 5b0ba: 7a01 moveq #1,%d5 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 5b0bc: 3229 000e movew %a1@(14),%d1 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 5b0c0: 2669 0018 moveal %a1@(24),%a3 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 5b0c4: 2841 moveal %d1,%a4 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 5b0c6: 588b addql #4,%a3 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 5b0c8: 6042 bras 5b10c the_thread = (Thread_Control *) object_table[ index ]; 5b0ca: 225b moveal %a3@+,%a1 if ( !the_thread ) 5b0cc: 4a89 tstl %a1 5b0ce: 673a beqs 5b10a /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 5b0d0: 2229 0014 movel %a1@(20),%d1 5b0d4: b081 cmpl %d1,%d0 5b0d6: 6532 bcss 5b10a #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 5b0d8: 2a69 00fe moveal %a1@(254),%a5 5b0dc: 2c2d 00d0 movel %a5@(208),%d6 5b0e0: 4686 notl %d6 5b0e2: cc83 andl %d3,%d6 5b0e4: 6724 beqs 5b10a * * 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 ) { 5b0e6: b081 cmpl %d1,%d0 5b0e8: 621c bhis 5b106 * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( interested && !_States_Is_ready( interested->current_state ) ) { 5b0ea: 4a88 tstl %a0 5b0ec: 671c beqs 5b10a <== NEVER TAKEN 5b0ee: 2e28 0010 movel %a0@(16),%d7 5b0f2: 6716 beqs 5b10a <== NEVER TAKEN /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 5b0f4: 2c29 0010 movel %a1@(16),%d6 5b0f8: 670c beqs 5b106 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 5b0fa: 0807 001c btst #28,%d7 5b0fe: 660a bnes 5b10a DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 5b100: 0806 001c btst #28,%d6 5b104: 6704 beqs 5b10a */ if ( interested && !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 5b106: 2001 movel %d1,%d0 5b108: 2049 moveal %a1,%a0 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 5b10a: 5285 addql #1,%d5 5b10c: b9c5 cmpal %d5,%a4 5b10e: 64ba bccs 5b0ca * + 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++) { 5b110: b5fc 0005 eea2 cmpal #388770,%a2 5b116: 6696 bnes 5b0ae } } } } if ( interested ) { 5b118: 4a88 tstl %a0 5b11a: 671e beqs 5b13a /* * 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 ) ) { 5b11c: 486e fff4 pea %fp@(-12) 5b120: 2f02 movel %d2,%sp@- 5b122: 2f08 movel %a0,%sp@- 5b124: 4eb9 0005 b1d0 jsr 5b1d0 <_POSIX_signals_Unblock_thread> 5b12a: 4fef 000c lea %sp@(12),%sp 5b12e: 4a00 tstb %d0 5b130: 6708 beqs 5b13a _Thread_Enable_dispatch(); 5b132: 4eb9 0004 86fc jsr 486fc <_Thread_Enable_dispatch> 5b138: 606a bras 5b1a4 /* * 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 ); 5b13a: 2f03 movel %d3,%sp@- 5b13c: 4eb9 0005 b1b0 jsr 5b1b0 <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 5b142: 588f addql #4,%sp 5b144: 41f9 0005 f358 lea 5f358 <_POSIX_signals_Vectors>,%a0 5b14a: 7002 moveq #2,%d0 5b14c: b0b0 4800 cmpl %a0@(00000000,%d4:l),%d0 5b150: 66e0 bnes 5b132 psiginfo = (POSIX_signals_Siginfo_node *) 5b152: 4879 0005 f4d8 pea 5f4d8 <_POSIX_signals_Inactive_siginfo> 5b158: 4eb9 0004 6d5c jsr 46d5c <_Chain_Get> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 5b15e: 588f addql #4,%sp */ _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) 5b160: 2440 moveal %d0,%a2 _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 5b162: 4a80 tstl %d0 5b164: 6616 bnes 5b17c _Thread_Enable_dispatch(); 5b166: 4eb9 0004 86fc jsr 486fc <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 5b16c: 4eb9 0004 cf98 jsr 4cf98 <__errno> 5b172: 2040 moveal %d0,%a0 5b174: 700b moveq #11,%d0 5b176: 2080 movel %d0,%a0@ 5b178: 70ff moveq #-1,%d0 5b17a: 602a bras 5b1a6 } psiginfo->Info = *siginfo; 5b17c: 4878 000c pea c _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 5b180: 0684 0005 f550 addil #390480,%d4 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 5b186: 486e fff4 pea %fp@(-12) 5b18a: 486a 0008 pea %a2@(8) 5b18e: 4eb9 0004 d7b8 jsr 4d7b8 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 5b194: 2f0a movel %a2,%sp@- 5b196: 2f04 movel %d4,%sp@- 5b198: 4eb9 0004 6d24 jsr 46d24 <_Chain_Append> 5b19e: 4fef 0014 lea %sp@(20),%sp 5b1a2: 608e bras 5b132 /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) return 0; 5b1a4: 4280 clrl %d0 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 5b1a6: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 5b1ac: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004320c : /* * In case RTEMS is already down, don't do this. It could be * dangerous. */ if (!_System_state_Is_up(_System_state_Get())) 4320c: 7003 moveq #3,%d0 extern void _wrapup_reent(struct _reent *); extern void _reclaim_reent(struct _reent *); void libc_wrapup(void) { 4320e: 4e56 0000 linkw %fp,#0 43212: 2f0a movel %a2,%sp@- /* * In case RTEMS is already down, don't do this. It could be * dangerous. */ if (!_System_state_Is_up(_System_state_Get())) 43214: b0b9 0005 f30a cmpl 5f30a <_System_state_Current>,%d0 4321a: 664c bnes 43268 <== NEVER TAKEN /* * This was already done if the user called exit() directly . _wrapup_reent(0); */ if (_REENT != _global_impure_ptr) { 4321c: 2479 0005 ce0e moveal 5ce0e <_global_impure_ptr>,%a2 43222: b5f9 0005 d85c cmpal 5d85c <_impure_ptr>,%a2 43228: 6710 beqs 4323a _wrapup_reent(_global_impure_ptr); 4322a: 2f0a movel %a2,%sp@- 4322c: 4eb9 0004 d9e6 jsr 4d9e6 <_wrapup_reent> /* Don't reclaim this one, just in case we do printfs * on the way out to ROM. */ _reclaim_reent(&libc_global_reent); #endif _REENT = _global_impure_ptr; 43232: 588f addql #4,%sp 43234: 23ca 0005 d85c movel %a2,5d85c <_impure_ptr> * * Should this be changed to do *all* file streams? * _fwalk (_REENT, fclose); */ fclose (stdin); 4323a: 2079 0005 d85c moveal 5d85c <_impure_ptr>,%a0 43240: 45f9 0004 d0d4 lea 4d0d4 ,%a2 43246: 2f28 0004 movel %a0@(4),%sp@- 4324a: 4e92 jsr %a2@ fclose (stdout); 4324c: 2079 0005 d85c moveal 5d85c <_impure_ptr>,%a0 43252: 2f28 0008 movel %a0@(8),%sp@- 43256: 4e92 jsr %a2@ fclose (stderr); 43258: 2079 0005 d85c moveal 5d85c <_impure_ptr>,%a0 4325e: 2f28 000c movel %a0@(12),%sp@- 43262: 4e92 jsr %a2@ 43264: 4fef 000c lea %sp@(12),%sp } 43268: 246e fffc moveal %fp@(-4),%a2 4326c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00042d30 : #include "malloc_p.h" void *malloc( size_t size ) { 42d30: 4e56 0000 linkw %fp,#0 void *return_this; MSBUMP(malloc_calls, 1); 42d34: 52b9 0005 edd0 addql #1,5edd0 #include "malloc_p.h" void *malloc( size_t size ) { 42d3a: 2f03 movel %d3,%sp@- 42d3c: 262e 0008 movel %fp@(8),%d3 42d40: 2f02 movel %d2,%sp@- MSBUMP(malloc_calls, 1); /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); 42d42: 4eb9 0004 2c4e jsr 42c4e /* * Validate the parameters */ if ( !size ) 42d48: 4a83 tstl %d3 42d4a: 6604 bnes 42d50 return (void *) 0; 42d4c: 4282 clrl %d2 42d4e: 607c bras 42dcc /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 42d50: 7003 moveq #3,%d0 42d52: b0b9 0005 f30a cmpl 5f30a <_System_state_Current>,%d0 42d58: 671c beqs 42d76 RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 42d5a: 42a7 clrl %sp@- 42d5c: 42a7 clrl %sp@- 42d5e: 2f03 movel %d3,%sp@- 42d60: 2f39 0005 d65c movel 5d65c ,%sp@- 42d66: 4eb9 0004 7d24 jsr 47d24 <_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 ) { 42d6c: 4fef 0010 lea %sp@(16),%sp 42d70: 2400 movel %d0,%d2 42d72: 6632 bnes 42da6 42d74: 600c bras 42d82 /* * 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() ) 42d76: 4eb9 0004 2c30 jsr 42c30 return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 42d7c: 4a00 tstb %d0 42d7e: 66da bnes 42d5a <== ALWAYS TAKEN 42d80: 60ca bras 42d4c <== NOT EXECUTED */ return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); if ( !return_this ) { return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); 42d82: 2f03 movel %d3,%sp@- 42d84: 2f39 0005 d65c movel 5d65c ,%sp@- 42d8a: 2079 0005 b89c moveal 5b89c ,%a0 42d90: 4e90 jsr %a0@ if ( !return_this ) { 42d92: 508f addql #8,%sp */ return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); if ( !return_this ) { return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); 42d94: 2400 movel %d0,%d2 if ( !return_this ) { 42d96: 660e bnes 42da6 <== NEVER TAKEN errno = ENOMEM; 42d98: 4eb9 0004 cf98 jsr 4cf98 <__errno> 42d9e: 2040 moveal %d0,%a0 42da0: 700c moveq #12,%d0 42da2: 2080 movel %d0,%a0@ return (void *) 0; 42da4: 6026 bras 42dcc } /* * If the user wants us to dirty the allocated memory, then do it. */ if ( rtems_malloc_dirty_helper ) 42da6: 2079 0005 dd8c moveal 5dd8c ,%a0 42dac: 4a88 tstl %a0 42dae: 6708 beqs 42db8 (*rtems_malloc_dirty_helper)( return_this, size ); 42db0: 2f03 movel %d3,%sp@- 42db2: 2f02 movel %d2,%sp@- 42db4: 4e90 jsr %a0@ 42db6: 508f addql #8,%sp /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 42db8: 2079 0005 dd90 moveal 5dd90 ,%a0 42dbe: 4a88 tstl %a0 42dc0: 670a beqs 42dcc (*rtems_malloc_statistics_helpers->at_malloc)(return_this); 42dc2: 2f02 movel %d2,%sp@- 42dc4: 2068 0004 moveal %a0@(4),%a0 42dc8: 4e90 jsr %a0@ 42dca: 588f addql #4,%sp return return_this; } 42dcc: 2002 movel %d2,%d0 42dce: 242e fff8 movel %fp@(-8),%d2 42dd2: 262e fffc movel %fp@(-4),%d3 42dd6: 4e5e unlk %fp ... =============================================================================== 0004ba48 : * Allocate a block for an in-memory file. */ int memfile_blocks_allocated = 0; void *memfile_alloc_block(void) { 4ba48: 4e56 0000 linkw %fp,#0 void *memory; memory = (void *)calloc(1, IMFS_MEMFILE_BYTES_PER_BLOCK); 4ba4c: 2f39 0005 e5bc movel 5e5bc ,%sp@- 4ba52: 4878 0001 pea 1 4ba56: 4eb9 0004 2818 jsr 42818 if ( memory ) 4ba5c: 508f addql #8,%sp 4ba5e: 4a80 tstl %d0 4ba60: 6706 beqs 4ba68 <== NEVER TAKEN memfile_blocks_allocated++; 4ba62: 52b9 0005 e6d0 addql #1,5e6d0 return memory; } 4ba68: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004c290 : the_jnode = iop->pathinfo.node_access; /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) 4c290: 7004 moveq #4,%d0 rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { 4c292: 4e56 0000 linkw %fp,#0 4c296: 226e 0008 moveal %fp@(8),%a1 4c29a: 2f03 movel %d3,%sp@- IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 4c29c: 2069 0018 moveal %a1@(24),%a0 /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) 4c2a0: c0a9 000c andl %a1@(12),%d0 rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { 4c2a4: 2f02 movel %d2,%sp@- the_jnode = iop->pathinfo.node_access; /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) 4c2a6: 4a80 tstl %d0 4c2a8: 6604 bnes 4c2ae if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; 4c2aa: 4280 clrl %d0 4c2ac: 6054 bras 4c302 4c2ae: 2268 004a moveal %a0@(74),%a1 /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { 4c2b2: 7005 moveq #5,%d0 4c2b4: b091 cmpl %a1@,%d0 4c2b6: 66f2 bnes 4c2aa <== ALWAYS TAKEN uint32_t count = the_jnode->info.linearfile.size; 4c2b8: 2028 0052 movel %a0@(82),%d0 <== NOT EXECUTED const unsigned char *buffer = the_jnode->info.linearfile.direct; the_jnode->control = &IMFS_node_control_memfile; 4c2bc: 243c 0005 c9ea movel #379370,%d2 <== NOT EXECUTED 4c2c2: 2142 004a movel %d2,%a0@(74) <== 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; 4c2c6: 2228 0056 movel %a0@(86),%d1 <== NOT EXECUTED the_jnode->control = &IMFS_node_control_memfile; the_jnode->info.file.size = 0; 4c2ca: 4282 clrl %d2 <== NOT EXECUTED 4c2cc: 4283 clrl %d3 <== NOT EXECUTED the_jnode->info.file.indirect = 0; 4c2ce: 42a8 0056 clrl %a0@(86) <== 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; 4c2d2: 2142 004e movel %d2,%a0@(78) <== NOT EXECUTED 4c2d6: 2143 0052 movel %d3,%a0@(82) <== NOT EXECUTED the_jnode->info.file.indirect = 0; the_jnode->info.file.doubly_indirect = 0; 4c2da: 42a8 005a clrl %a0@(90) <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; 4c2de: 42a8 005e clrl %a0@(94) <== NOT EXECUTED if ((count != 0) 4c2e2: 4a80 tstl %d0 <== NOT EXECUTED 4c2e4: 67c4 beqs 4c2aa <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) 4c2e6: 2f00 movel %d0,%sp@- <== NOT EXECUTED return -1; 4c2e8: 76ff moveq #-1,%d3 <== 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)) 4c2ea: 2f01 movel %d1,%sp@- <== NOT EXECUTED 4c2ec: 42a7 clrl %sp@- <== NOT EXECUTED 4c2ee: 42a7 clrl %sp@- <== NOT EXECUTED 4c2f0: 2f08 movel %a0,%sp@- <== NOT EXECUTED 4c2f2: 4eb9 0004 c0ac jsr 4c0ac <== NOT EXECUTED 4c2f8: 4fef 0014 lea %sp@(20),%sp <== NOT EXECUTED return -1; 4c2fc: b680 cmpl %d0,%d3 <== NOT EXECUTED 4c2fe: 57c0 seq %d0 <== NOT EXECUTED 4c300: 49c0 extbl %d0 <== NOT EXECUTED } return 0; } 4c302: 242e fff8 movel %fp@(-8),%d2 4c306: 262e fffc movel %fp@(-4),%d3 4c30a: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00042f18 : const void *data ) { int rv = 0; if ( 42f18: 7001 moveq #1,%d0 const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 42f1a: 4e56 ff84 linkw %fp,#-124 42f1e: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 42f22: 262e 0008 movel %fp@(8),%d3 42f26: 242e 000c movel %fp@(12),%d2 42f2a: 2a2e 0010 movel %fp@(16),%d5 int rv = 0; if ( 42f2e: b0ae 0014 cmpl %fp@(20),%d0 42f32: 6500 02a2 bcsw 431d6 options == RTEMS_FILESYSTEM_READ_ONLY || options == RTEMS_FILESYSTEM_READ_WRITE ) { rtems_filesystem_fsmount_me_t fsmount_me_h = 42f36: 2f05 movel %d5,%sp@- 42f38: 4eb9 0004 a3d8 jsr 4a3d8 rtems_filesystem_get_mount_handler( filesystemtype ); if ( fsmount_me_h != NULL ) { 42f3e: 588f addql #4,%sp if ( options == RTEMS_FILESYSTEM_READ_ONLY || options == RTEMS_FILESYSTEM_READ_WRITE ) { rtems_filesystem_fsmount_me_t fsmount_me_h = 42f40: 2840 moveal %d0,%a4 rtems_filesystem_get_mount_handler( filesystemtype ); if ( fsmount_me_h != NULL ) { 42f42: 4a80 tstl %d0 42f44: 6700 0282 beqw 431c8 const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; 42f48: 283c 0005 c4dc movel #378076,%d4 42f4e: 4a82 tstl %d2 42f50: 6702 beqs 42f54 42f52: 2802 movel %d2,%d4 size_t filesystemtype_size = strlen( filesystemtype ) + 1; 42f54: 2f05 movel %d5,%sp@- 42f56: 47f9 0004 e2f8 lea 4e2f8 ,%a3 42f5c: 4e93 jsr %a3@ 42f5e: 588f addql #4,%sp 42f60: 2e00 movel %d0,%d7 42f62: 2440 moveal %d0,%a2 42f64: 5287 addql #1,%d7 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 42f66: 4a83 tstl %d3 42f68: 670c beqs 42f76 42f6a: 2f03 movel %d3,%sp@- 42f6c: 4e93 jsr %a3@ 42f6e: 588f addql #4,%sp 42f70: 2640 moveal %d0,%a3 42f72: 528b addql #1,%a3 42f74: 6002 bras 42f78 42f76: 97cb subal %a3,%a3 size_t target_size = strlen( target ) + 1; 42f78: 2f04 movel %d4,%sp@- 42f7a: 4eb9 0004 e2f8 jsr 4e2f8 42f80: 588f addql #4,%sp 42f82: 2a40 moveal %d0,%a5 42f84: 528d addql #1,%a5 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size 42f86: 41f2 b863 lea %a2@(00000063,%a3:l),%a0 + sizeof( rtems_filesystem_global_location_t ); rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); 42f8a: 4870 d800 pea %a0@(00000000,%a5:l) 42f8e: 4878 0001 pea 1 42f92: 4eb9 0004 2818 jsr 42818 if ( mt_entry != NULL ) { 42f98: 508f addql #8,%sp strlen( source_or_null ) + 1 : 0; size_t target_size = strlen( target ) + 1; size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size + sizeof( rtems_filesystem_global_location_t ); rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); 42f9a: 2440 moveal %d0,%a2 if ( mt_entry != NULL ) { 42f9c: 4a80 tstl %d0 42f9e: 6700 0250 beqw 431f0 rtems_filesystem_global_location_t *mt_fs_root = (rtems_filesystem_global_location_t *) ((char *) mt_entry + sizeof( *mt_entry )); char *str = (char *) mt_fs_root + sizeof( *mt_fs_root ); memcpy( str, filesystemtype, filesystemtype_size ); 42fa2: 2f07 movel %d7,%sp@- if ( mt_entry != NULL ) { 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 ); 42fa4: 2200 movel %d0,%d1 42fa6: 0681 0000 0062 addil #98,%d1 + 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 = 42fac: 2c00 movel %d0,%d6 42fae: 0686 0000 003e addil #62,%d6 (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 ); 42fb4: 2f05 movel %d5,%sp@- 42fb6: 2a3c 0004 d7b8 movel #317368,%d5 42fbc: 2045 moveal %d5,%a0 42fbe: 2f01 movel %d1,%sp@- 42fc0: 2d41 ffac movel %d1,%fp@(-84) 42fc4: 4e90 jsr %a0@ mt_entry->type = str; 42fc6: 222e ffac movel %fp@(-84),%d1 str += filesystemtype_size; if ( source_or_null != NULL ) { 42fca: 4fef 000c lea %sp@(12),%sp ((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; 42fce: de81 addl %d1,%d7 (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; 42fd0: 2541 0032 movel %d1,%a2@(50) str += filesystemtype_size; if ( source_or_null != NULL ) { 42fd4: 4a83 tstl %d3 42fd6: 6714 beqs 42fec memcpy( str, source_or_null, source_size ); 42fd8: 2f0b movel %a3,%sp@- 42fda: 2245 moveal %d5,%a1 42fdc: 2f03 movel %d3,%sp@- 42fde: 2f07 movel %d7,%sp@- 42fe0: 4e91 jsr %a1@ mt_entry->dev = str; str += source_size; 42fe2: 4fef 000c lea %sp@(12),%sp mt_entry->type = str; str += filesystemtype_size; if ( source_or_null != NULL ) { memcpy( str, source_or_null, source_size ); mt_entry->dev = str; 42fe6: 2547 0036 movel %d7,%a2@(54) str += source_size; 42fea: de8b addl %a3,%d7 } memcpy( str, target, target_size ); 42fec: 2f0d movel %a5,%sp@- 42fee: 2f04 movel %d4,%sp@- 42ff0: 2f07 movel %d7,%sp@- 42ff2: 4eb9 0004 d7b8 jsr 4d7b8 mt_entry->target = str; str += target_size; mt_entry->mounted = true; 42ff8: 7001 moveq #1,%d0 mt_entry->mt_fs_root = mt_fs_root; mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; 42ffa: 41f9 0005 c4de lea 5c4de ,%a0 memcpy( str, target, target_size ); mt_entry->target = str; str += target_size; mt_entry->mounted = true; 43000: 1540 0028 moveb %d0,%a2@(40) 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; 43004: 7001 moveq #1,%d0 mt_entry->target = str; str += target_size; mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; 43006: 2548 002a movel %a0,%a2@(42) mt_fs_root->location.mt_entry = mt_entry; mt_fs_root->reference_count = 1; 4300a: 2540 0056 movel %d0,%a2@(86) mt_entry->dev = str; str += source_size; } memcpy( str, target, target_size ); mt_entry->target = str; 4300e: 2547 002e movel %d7,%a2@(46) str += target_size; mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; 43012: 2546 0024 movel %d6,%a2@(36) mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; mt_fs_root->location.mt_entry = mt_entry; 43016: 254a 0052 movel %a2,%a2@(82) void *starting_address, size_t number_nodes, size_t node_size ) { _Chain_Initialize( the_chain, starting_address, number_nodes, node_size ); 4301a: 4878 0024 pea 24 4301e: 4878 0001 pea 1 43022: 2f06 movel %d6,%sp@- 43024: 486a 0014 pea %a2@(20) 43028: 4eb9 0004 6d90 jsr 46d90 <_Chain_Initialize> filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; 4302e: 7001 moveq #1,%d0 43030: c0ae 0014 andl %fp@(20),%d0 43034: 1540 0029 moveb %d0,%a2@(41) rv = (*fsmount_me_h)( mt_entry, data ); 43038: 2f2e 0018 movel %fp@(24),%sp@- 4303c: 2f0a movel %a2,%sp@- 4303e: 4e94 jsr %a4@ if ( rv == 0 ) { 43040: 4fef 0024 lea %sp@(36),%sp ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; rv = (*fsmount_me_h)( mt_entry, data ); 43044: 2600 movel %d0,%d3 if ( rv == 0 ) { 43046: 6600 019c bnew 431e4 if ( target != NULL ) { 4304a: 4a82 tstl %d2 4304c: 6700 00d4 beqw 43122 { 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 = 43050: 4878 001f pea 1f 43054: 2f02 movel %d2,%sp@- rtems_filesystem_eval_path_start( &ctx, target, eval_flags ); 43056: 240e movel %fp,%d2 43058: 0682 ffff ffc8 addil #-56,%d2 { 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 = 4305e: 2f02 movel %d2,%sp@- 43060: 4eb9 0004 3a7a jsr 43a7a 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; 43066: 2240 moveal %d0,%a1 43068: 2069 0014 moveal %a1@(20),%a0 return (*mt_entry->ops->are_nodes_equal_h)( 4306c: 2268 000c moveal %a0@(12),%a1 43070: 2f28 0024 movel %a0@(36),%sp@- 43074: 2f00 movel %d0,%sp@- 43076: 2069 0010 moveal %a1@(16),%a0 4307a: 4e90 jsr %a0@ rtems_filesystem_eval_path_start( &ctx, target, eval_flags ); if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) { 4307c: 4fef 0014 lea %sp@(20),%sp 43080: 4a00 tstb %d0 43082: 667e bnes 43102 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( 43084: 486e ffe0 pea %fp@(-32) rtems_filesystem_location_info_t targetloc; rtems_filesystem_global_location_t *mt_point_node; rtems_filesystem_eval_path_extract_currentloc( &ctx, &targetloc ); 43088: 0682 ffff ffe8 addil #-24,%d2 4308e: 2f02 movel %d2,%sp@- 43090: 4eb9 0004 3ea0 jsr 43ea0 mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc ); 43096: 2f02 movel %d2,%sp@- 43098: 4eb9 0004 4060 jsr 44060 4309e: 2640 moveal %d0,%a3 mt_entry->mt_point_node = mt_point_node; rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); 430a0: 206b 0014 moveal %a3@(20),%a0 rtems_filesystem_location_info_t targetloc; rtems_filesystem_global_location_t *mt_point_node; rtems_filesystem_eval_path_extract_currentloc( &ctx, &targetloc ); mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc ); mt_entry->mt_point_node = mt_point_node; 430a4: 2540 0020 movel %d0,%a2@(32) rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); 430a8: 2068 000c moveal %a0@(12),%a0 430ac: 2f0a movel %a2,%sp@- 430ae: 2068 0030 moveal %a0@(48),%a0 430b2: 4e90 jsr %a0@ if ( rv == 0 ) { 430b4: 4fef 0010 lea %sp@(16),%sp rtems_filesystem_global_location_t *mt_point_node; rtems_filesystem_eval_path_extract_currentloc( &ctx, &targetloc ); mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc ); mt_entry->mt_point_node = mt_point_node; rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); 430b8: 2600 movel %d0,%d3 if ( rv == 0 ) { 430ba: 663a bnes 430f6 */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 430bc: 42a7 clrl %sp@- 430be: 42a7 clrl %sp@- 430c0: 2f39 0005 edc8 movel 5edc8 ,%sp@- 430c6: 4eb9 0004 62c4 jsr 462c4 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 430cc: 2079 0005 d6d4 moveal 5d6d4 ,%a0 the_node->next = tail; 430d2: 24bc 0005 d6d0 movel #382672,%a2@ tail->previous = the_node; old_last->next = the_node; the_node->previous = old_last; 430d8: 2548 0004 movel %a0,%a2@(4) Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; old_last->next = the_node; 430dc: 208a movel %a2,%a0@ } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 430de: 2f39 0005 edc8 movel 5edc8 ,%sp@- { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 430e4: 23ca 0005 d6d4 movel %a2,5d6d4 430ea: 4eb9 0004 63cc jsr 463cc 430f0: 4fef 0010 lea %sp@(16),%sp 430f4: 601c bras 43112 &rtems_filesystem_mount_table, &mt_entry->mt_node ); rtems_filesystem_mt_unlock(); } else { rtems_filesystem_global_location_release( mt_point_node ); 430f6: 2f0b movel %a3,%sp@- 430f8: 4eb9 0004 3f4a jsr 43f4a 430fe: 588f addql #4,%sp 43100: 6010 bras 43112 } } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); 43102: 4878 0010 pea 10 rv = -1; 43106: 76ff moveq #-1,%d3 rtems_filesystem_mt_unlock(); } else { rtems_filesystem_global_location_release( mt_point_node ); } } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); 43108: 2f02 movel %d2,%sp@- 4310a: 4eb9 0004 380a jsr 4380a 43110: 508f addql #8,%sp rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 43112: 486e ffc8 pea %fp@(-56) 43116: 4eb9 0004 3b6c jsr 43b6c 4311c: 588f addql #4,%sp 4311e: 6000 0094 braw 431b4 */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 43122: 42a7 clrl %sp@- 43124: 42a7 clrl %sp@- 43126: 2f39 0005 edc8 movel 5edc8 ,%sp@- 4312c: 4eb9 0004 62c4 jsr 462c4 ) { int rv = 0; rtems_filesystem_mt_lock(); if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) { 43132: 4fef 000c lea %sp@(12),%sp 43136: 203c 0005 d6d0 movel #382672,%d0 4313c: b0b9 0005 d6cc cmpl 5d6cc ,%d0 43142: 6616 bnes 4315a <== NEVER TAKEN Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 43144: 2079 0005 d6d4 moveal 5d6d4 ,%a0 the_node->next = tail; 4314a: 2480 movel %d0,%a2@ tail->previous = the_node; 4314c: 23ca 0005 d6d4 movel %a2,5d6d4 old_last->next = the_node; 43152: 208a movel %a2,%a0@ the_node->previous = old_last; 43154: 2548 0004 movel %a0,%a2@(4) 43158: 600e bras 43168 rtems_chain_append_unprotected( &rtems_filesystem_mount_table, &mt_entry->mt_node ); } else { errno = EINVAL; 4315a: 4eb9 0004 cf98 jsr 4cf98 <__errno> <== NOT EXECUTED 43160: 7616 moveq #22,%d3 <== NOT EXECUTED 43162: 2040 moveal %d0,%a0 <== NOT EXECUTED 43164: 2083 movel %d3,%a0@ <== NOT EXECUTED rv = -1; 43166: 76ff moveq #-1,%d3 <== NOT EXECUTED } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 43168: 2f39 0005 edc8 movel 5edc8 ,%sp@- 4316e: 4eb9 0004 63cc jsr 463cc } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { 43174: 588f addql #4,%sp 43176: 4a83 tstl %d3 43178: 663a bnes 431b4 <== NEVER TAKEN rtems_filesystem_global_location_t *new_fs_root = rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); 4317a: 45ea 0024 lea %a2@(36),%a2 rv = -1; } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { rtems_filesystem_global_location_t *new_fs_root = 4317e: 47f9 0004 3fc0 lea 43fc0 ,%a3 43184: 2f0a movel %a2,%sp@- 43186: 4e93 jsr %a3@ 43188: 2400 movel %d0,%d2 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_t *new_fs_current = 4318a: 2f0a movel %a2,%sp@- rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 4318c: 45f9 0004 3f96 lea 43f96 ,%a2 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 = 43192: 4e93 jsr %a3@ rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 43194: 2279 0005 d6ec moveal 5d6ec ,%a1 4319a: 5889 addql #4,%a1 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 = 4319c: 2800 movel %d0,%d4 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 4319e: 2f02 movel %d2,%sp@- 431a0: 2f09 movel %a1,%sp@- 431a2: 4e92 jsr %a2@ &rtems_filesystem_root, new_fs_root ); rtems_filesystem_global_location_assign( 431a4: 2f04 movel %d4,%sp@- 431a6: 2f39 0005 d6ec movel 5d6ec ,%sp@- 431ac: 4e92 jsr %a2@ 431ae: 4fef 0018 lea %sp@(24),%sp 431b2: 604a bras 431fe rv = register_subordinate_file_system( mt_entry, target ); } else { rv = register_root_file_system( mt_entry ); } if ( rv != 0 ) { 431b4: 4a83 tstl %d3 431b6: 6746 beqs 431fe (*mt_entry->ops->fsunmount_me_h)( mt_entry ); 431b8: 206a 000c moveal %a2@(12),%a0 431bc: 2f0a movel %a2,%sp@- 431be: 2068 003c moveal %a0@(60),%a0 431c2: 4e90 jsr %a0@ 431c4: 588f addql #4,%sp 431c6: 601c bras 431e4 } else { errno = ENOMEM; rv = -1; } } else { errno = EINVAL; 431c8: 4eb9 0004 cf98 jsr 4cf98 <__errno> 431ce: 7416 moveq #22,%d2 431d0: 2040 moveal %d0,%a0 431d2: 2082 movel %d2,%a0@ 431d4: 6026 bras 431fc rv = -1; } } else { errno = EINVAL; 431d6: 4eb9 0004 cf98 jsr 4cf98 <__errno> 431dc: 7216 moveq #22,%d1 431de: 2240 moveal %d0,%a1 431e0: 2281 movel %d1,%a1@ 431e2: 6018 bras 431fc (*mt_entry->ops->fsunmount_me_h)( mt_entry ); } } if ( rv != 0 ) { free( mt_entry ); 431e4: 2f0a movel %a2,%sp@- 431e6: 4eb9 0004 2a60 jsr 42a60 431ec: 588f addql #4,%sp 431ee: 600e bras 431fe } } else { errno = ENOMEM; 431f0: 4eb9 0004 cf98 jsr 4cf98 <__errno> 431f6: 2040 moveal %d0,%a0 431f8: 700c moveq #12,%d0 431fa: 2080 movel %d0,%a0@ rv = -1; 431fc: 76ff moveq #-1,%d3 errno = EINVAL; rv = -1; } return rv; } 431fe: 2003 movel %d3,%d0 43200: 4cee 3cfc ff84 moveml %fp@(-124),%d2-%d7/%a2-%a5 43206: 4e5e unlk %fp ... =============================================================================== 00046af8 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 46af8: 4e56 ffec linkw %fp,#-20 46afc: 48d7 007c moveml %d2-%d6,%sp@ 46b00: 262e 0008 movel %fp@(8),%d3 46b04: 242e 000c movel %fp@(12),%d2 46b08: 282e 0010 movel %fp@(16),%d4 46b0c: 2a2e 0014 movel %fp@(20),%d5 46b10: 2c2e 0018 movel %fp@(24),%d6 int rv = -1; if (target != NULL) { 46b14: 4a82 tstl %d2 46b16: 6734 beqs 46b4c rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); 46b18: 4878 01ff pea 1ff 46b1c: 2f02 movel %d2,%sp@- 46b1e: 4eb9 0004 75e4 jsr 475e4 if (rv == 0) { 46b24: 508f addql #8,%sp 46b26: 4a80 tstl %d0 46b28: 6630 bnes 46b5a <== NEVER TAKEN rv = mount( 46b2a: 2d46 0018 movel %d6,%fp@(24) 46b2e: 2d45 0014 movel %d5,%fp@(20) 46b32: 2d44 0010 movel %d4,%fp@(16) 46b36: 2d42 000c movel %d2,%fp@(12) 46b3a: 2d43 0008 movel %d3,%fp@(8) } else { errno = EINVAL; } return rv; } 46b3e: 4cee 007c ffec moveml %fp@(-20),%d2-%d6 46b44: 4e5e unlk %fp int rv = -1; if (target != NULL) { rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); if (rv == 0) { rv = mount( 46b46: 4ef9 0004 6b64 jmp 46b64 options, data ); } } else { errno = EINVAL; 46b4c: 4eb9 0005 bd98 jsr 5bd98 <__errno> 46b52: 2040 moveal %d0,%a0 46b54: 7016 moveq #22,%d0 46b56: 2080 movel %d0,%a0@ const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { int rv = -1; 46b58: 70ff moveq #-1,%d0 } else { errno = EINVAL; } return rv; } 46b5a: 4cee 007c ffec moveml %fp@(-20),%d2-%d6 46b60: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00053d7c : fat_dir_pos_t *dir_pos ) { dir_pos->sname.cln = 0; dir_pos->sname.ofs = 0; dir_pos->lname.cln = FAT_FILE_SHORT_NAME; 53d7c: 72ff moveq #-1,%d1 msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 53d7e: 4e56 ff40 linkw %fp,#-192 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; 53d82: 4240 clrw %d0 msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 53d84: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 53d88: 266e 0008 moveal %fp@(8),%a3 uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 53d8c: 2c0e movel %fp,%d6 53d8e: 0686 ffff ff80 addil #-128,%d6 53d94: 2a3c 0005 7e40 movel #360000,%d5 mode_t mode, const fat_file_fd_t *link_fd) { int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; 53d9a: 206b 0014 moveal %a3@(20),%a0 fat_file_fd_t *parent_fat_fd = parent_loc->node_access; 53d9e: 262b 0008 movel %a3@(8),%d3 mode_t mode, const fat_file_fd_t *link_fd) { int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; 53da2: 2468 0008 moveal %a0@(8),%a2 uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 53da6: 4878 0020 pea 20 53daa: 2045 moveal %d5,%a0 msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 53dac: 286e 000c moveal %fp@(12),%a4 uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 53db0: 42a7 clrl %sp@- msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 53db2: 2e2e 0010 movel %fp@(16),%d7 uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 53db6: 2f06 movel %d6,%sp@- msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 53db8: 242e 0014 movel %fp@(20),%d2 53dbc: 2d41 ff78 movel %d1,%fp@(-136) 53dc0: 2a6e 001c moveal %fp@(28),%a5 dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; 53dc4: 2d41 ff7c movel %d1,%fp@(-132) 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; 53dc8: 3d40 ff68 movew %d0,%fp@(-152) { 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; 53dcc: 42ae ff6c clrl %fp@(-148) time_t time_ret = 0; uint16_t time_val = 0; uint16_t date = 0; 53dd0: 3d40 ff6a movew %d0,%fp@(-150) static inline void fat_dir_pos_init( fat_dir_pos_t *dir_pos ) { dir_pos->sname.cln = 0; 53dd4: 42ae ff70 clrl %fp@(-144) dir_pos->sname.ofs = 0; 53dd8: 42ae ff74 clrl %fp@(-140) uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 53ddc: 4e90 jsr %a0@ memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 53dde: 4878 0040 pea 40 53de2: 2045 moveal %d5,%a0 53de4: 42a7 clrl %sp@- 53de6: 486e ffc0 pea %fp@(-64) 53dea: 4e90 jsr %a0@ if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { 53dec: 4fef 0018 lea %sp@(24),%sp 53df0: 0c82 0000 0104 cmpil #260,%d2 53df6: 6f0e bles 53e06 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(ENAMETOOLONG); 53df8: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 53dfe: 725b moveq #91,%d1 <== NOT EXECUTED 53e00: 2040 moveal %d0,%a0 <== NOT EXECUTED 53e02: 2081 movel %d1,%a0@ <== NOT EXECUTED 53e04: 6024 bras 53e2a <== NOT EXECUTED } name_type = msdos_long_to_short (name, name_len, 53e06: 4878 000b pea b 53e0a: 2f06 movel %d6,%sp@- 53e0c: 2f02 movel %d2,%sp@- 53e0e: 2f07 movel %d7,%sp@- 53e10: 4eb9 0005 42cc jsr 542cc MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { 53e16: 4fef 0010 lea %sp@(16),%sp if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { rtems_set_errno_and_return_minus_one(ENAMETOOLONG); } name_type = msdos_long_to_short (name, name_len, 53e1a: 2a00 movel %d0,%d5 MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { 53e1c: 6612 bnes 53e30 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EINVAL); 53e1e: 4eb9 0005 7428 jsr 57428 <__errno> <== NOT EXECUTED 53e24: 2040 moveal %d0,%a0 <== NOT EXECUTED 53e26: 7016 moveq #22,%d0 <== NOT EXECUTED 53e28: 2080 movel %d0,%a0@ <== NOT EXECUTED 53e2a: 74ff moveq #-1,%d2 <== NOT EXECUTED 53e2c: 6000 02cc braw 540fa <== NOT EXECUTED /* fill reserved field */ *MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE; /* set up last write date and time */ time_ret = time(NULL); 53e30: 42a7 clrl %sp@- 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; 53e32: 4200 clrb %d0 53e34: 1d40 ff8c moveb %d0,%fp@(-116) /* set up last write date and time */ time_ret = time(NULL); 53e38: 4eb9 0005 b71c jsr 5b71c