=============================================================================== 00008d7c : { IMFS_jnode_t *node = loc->node_access; IMFS_fs_info_t *fs_info; fs_info = loc->mt_entry->fs_info; switch( node->type ) { 8d7c: e5902000 ldr r2, [r0] 8d80: e592204c ldr r2, [r2, #76] ; 0x4c ) { IMFS_jnode_t *node = loc->node_access; IMFS_fs_info_t *fs_info; fs_info = loc->mt_entry->fs_info; 8d84: e5903010 ldr r3, [r0, #16] switch( node->type ) { 8d88: e2422001 sub r2, r2, #1 ) { IMFS_jnode_t *node = loc->node_access; IMFS_fs_info_t *fs_info; fs_info = loc->mt_entry->fs_info; 8d8c: e5933034 ldr r3, [r3, #52] ; 0x34 switch( node->type ) { 8d90: e3520006 cmp r2, #6 8d94: 979ff102 ldrls pc, [pc, r2, lsl #2] 8d98: ea000010 b 8de0 <== NOT EXECUTED 8d9c: 00008db8 .word 0x00008db8 <== NOT EXECUTED 8da0: 00008dc0 .word 0x00008dc0 <== NOT EXECUTED 8da4: 00008dc8 .word 0x00008dc8 <== NOT EXECUTED 8da8: 00008dc8 .word 0x00008dc8 <== NOT EXECUTED 8dac: 00008dd0 .word 0x00008dd0 <== NOT EXECUTED 8db0: 00008dd0 .word 0x00008dd0 <== NOT EXECUTED 8db4: 00008dd8 .word 0x00008dd8 <== NOT EXECUTED case IMFS_DIRECTORY: loc->handlers = fs_info->directory_handlers; 8db8: e593300c ldr r3, [r3, #12] 8dbc: ea000006 b 8ddc break; case IMFS_DEVICE: loc->handlers = &IMFS_device_handlers; 8dc0: e59f3020 ldr r3, [pc, #32] ; 8de8 8dc4: ea000004 b 8ddc break; case IMFS_SYM_LINK: case IMFS_HARD_LINK: loc->handlers = &IMFS_link_handlers; 8dc8: e59f301c ldr r3, [pc, #28] ; 8dec 8dcc: ea000002 b 8ddc break; case IMFS_LINEAR_FILE: loc->handlers = fs_info->memfile_handlers; break; case IMFS_MEMORY_FILE: loc->handlers = fs_info->memfile_handlers; 8dd0: e5933008 ldr r3, [r3, #8] 8dd4: ea000000 b 8ddc break; case IMFS_FIFO: loc->handlers = fs_info->fifo_handlers; 8dd8: e5933010 ldr r3, [r3, #16] 8ddc: e5803008 str r3, [r0, #8] break; } return 0; } 8de0: e3a00000 mov r0, #0 8de4: e12fff1e bx lr =============================================================================== 00008ea4 : const char *pathname, /* IN */ size_t pathnamelen, /* IN */ int flags, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { 8ea4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} char token[ IMFS_NAME_MAX + 1 ]; rtems_filesystem_location_info_t newloc; IMFS_jnode_t *node; int result; if ( !rtems_libio_is_valid_perms( flags ) ) { 8ea8: e3d27007 bics r7, r2, #7 const char *pathname, /* IN */ size_t pathnamelen, /* IN */ int flags, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { 8eac: e24dd040 sub sp, sp, #64 ; 0x40 8eb0: e58d0000 str r0, [sp] 8eb4: e1a06001 mov r6, r1 8eb8: e1a08002 mov r8, r2 8ebc: e1a04003 mov r4, r3 /* * This was filled in by the caller and is valid in the * mount table. */ node = pathloc->node_access; 8ec0: 05935000 ldreq r5, [r3] rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { int i = 0; int len; IMFS_token_types type = IMFS_CURRENT_DIR; 8ec4: 03a09001 moveq r9, #1 * Evaluate all tokens until we are done or an error occurs. */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { type = IMFS_get_token( &pathname[i], pathnamelen, token, &len ); 8ec8: 028da004 addeq sl, sp, #4 char token[ IMFS_NAME_MAX + 1 ]; rtems_filesystem_location_info_t newloc; IMFS_jnode_t *node; int result; if ( !rtems_libio_is_valid_perms( flags ) ) { 8ecc: 0a000057 beq 9030 rtems_set_errno_and_return_minus_one( EIO ); 8ed0: eb001012 bl cf20 <__errno> <== NOT EXECUTED 8ed4: e3a03005 mov r3, #5 <== NOT EXECUTED 8ed8: ea00007e b 90d8 <== NOT EXECUTED * Evaluate all tokens until we are done or an error occurs. */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { type = IMFS_get_token( &pathname[i], pathnamelen, token, &len ); 8edc: e59d2000 ldr r2, [sp] 8ee0: e28d303c add r3, sp, #60 ; 0x3c 8ee4: e0820007 add r0, r2, r7 8ee8: e1a01006 mov r1, r6 8eec: e1a0200a mov r2, sl 8ef0: eb0001ae bl 95b0 pathnamelen -= len; i += len; if ( !pathloc->node_access ) 8ef4: e5943000 ldr r3, [r4] 8ef8: e3530000 cmp r3, #0 * Evaluate all tokens until we are done or an error occurs. */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { type = IMFS_get_token( &pathname[i], pathnamelen, token, &len ); 8efc: e1a09000 mov r9, r0 pathnamelen -= len; 8f00: e59db03c ldr fp, [sp, #60] ; 0x3c i += len; if ( !pathloc->node_access ) 8f04: 0a000041 beq 9010 rtems_set_errno_and_return_minus_one( ENOENT ); /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) 8f08: e3500000 cmp r0, #0 8f0c: 0a000006 beq 8f2c if ( node->type == IMFS_DIRECTORY ) 8f10: e595104c ldr r1, [r5, #76] ; 0x4c 8f14: e3510001 cmp r1, #1 8f18: 1a000003 bne 8f2c if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 8f1c: e1a00004 mov r0, r4 8f20: ebffffb2 bl 8df0 8f24: e3500000 cmp r0, #0 8f28: 0a000068 beq 90d0 rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; switch( type ) { 8f2c: e3590003 cmp r9, #3 */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { type = IMFS_get_token( &pathname[i], pathnamelen, token, &len ); pathnamelen -= len; 8f30: e06b6006 rsb r6, fp, r6 i += len; 8f34: e087700b add r7, r7, fp if ( type != IMFS_NO_MORE_PATH ) if ( node->type == IMFS_DIRECTORY ) if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; 8f38: e5945000 ldr r5, [r4] switch( type ) { 8f3c: 0a000014 beq 8f94 8f40: e3590004 cmp r9, #4 8f44: 0a000036 beq 9024 8f48: e3590002 cmp r9, #2 8f4c: 1a000037 bne 9030 case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 8f50: e59fc194 ldr ip, [pc, #404] ; 90ec 8f54: e59c3000 ldr r3, [ip] 8f58: e5933018 ldr r3, [r3, #24] 8f5c: e1550003 cmp r5, r3 8f60: 0a000032 beq 9030 /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access) { 8f64: e594e010 ldr lr, [r4, #16] /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == 8f68: e59e301c ldr r3, [lr, #28] 8f6c: e1550003 cmp r5, r3 */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; /* Throw out the .. in this case */ } else { newloc = pathloc->mt_entry->mt_point_node; 8f70: 028dc028 addeq ip, sp, #40 ; 0x28 8f74: 028ee008 addeq lr, lr, #8 8f78: 0a000037 beq 905c pathnamelen+len, flags,pathloc); } } else { if ( !node->Parent ) 8f7c: e5955008 ldr r5, [r5, #8] 8f80: e3550000 cmp r5, #0 8f84: 1a000024 bne 901c rtems_set_errno_and_return_minus_one( ENOENT ); 8f88: eb000fe4 bl cf20 <__errno> 8f8c: e5809000 str r9, [r0] 8f90: ea000051 b 90dc case IMFS_NAME: /* * If we are at a link follow it. */ if ( node->type == IMFS_HARD_LINK ) { 8f94: e595304c ldr r3, [r5, #76] ; 0x4c 8f98: e3530003 cmp r3, #3 8f9c: 1a000004 bne 8fb4 IMFS_evaluate_hard_link( pathloc, 0 ); 8fa0: e1a00004 mov r0, r4 8fa4: e3a01000 mov r1, #0 8fa8: ebffffaa bl 8e58 node = pathloc->node_access; 8fac: e5945000 ldr r5, [r4] 8fb0: ea000008 b 8fd8 * It would be a design error if we evaluated the link and * was broken. */ IMFS_assert( node ); } else if ( node->type == IMFS_SYM_LINK ) { 8fb4: e3530004 cmp r3, #4 8fb8: 1a000006 bne 8fd8 result = IMFS_evaluate_sym_link( pathloc, 0 ); 8fbc: e1a00004 mov r0, r4 8fc0: e3a01000 mov r1, #0 8fc4: eb000049 bl 90f0 /* * In contrast to a hard link, it is possible to have a broken * symbolic link. */ node = pathloc->node_access; if ( result == -1 ) 8fc8: e3700001 cmn r0, #1 * was broken. */ IMFS_assert( node ); } else if ( node->type == IMFS_SYM_LINK ) { result = IMFS_evaluate_sym_link( pathloc, 0 ); 8fcc: e1a0b000 mov fp, r0 /* * In contrast to a hard link, it is possible to have a broken * symbolic link. */ node = pathloc->node_access; 8fd0: e5945000 ldr r5, [r4] if ( result == -1 ) 8fd4: 0a000041 beq 90e0 } /* * Only a directory can be decended into. */ if ( node->type != IMFS_DIRECTORY ) 8fd8: e595304c ldr r3, [r5, #76] ; 0x4c 8fdc: e3530001 cmp r3, #1 8fe0: 0a000002 beq 8ff0 rtems_set_errno_and_return_minus_one( ENOTDIR ); 8fe4: eb000fcd bl cf20 <__errno> 8fe8: e3a03014 mov r3, #20 8fec: ea000039 b 90d8 /* * If we are at a node that is a mount point. Set loc to the * new fs root node and let them finish evaluating the path. */ if ( node->info.directory.mt_fs != NULL ) { 8ff0: e595e05c ldr lr, [r5, #92] ; 0x5c 8ff4: e35e0000 cmp lr, #0 8ff8: 1a000015 bne 9054 } /* * Otherwise find the token name in the present location. */ node = IMFS_find_match_in_dir( node, token ); 8ffc: e1a00005 mov r0, r5 9000: e1a0100a mov r1, sl 9004: eb000149 bl 9530 if ( !node ) 9008: e2505000 subs r5, r0, #0 900c: 1a000002 bne 901c rtems_set_errno_and_return_minus_one( ENOENT ); 9010: eb000fc2 bl cf20 <__errno> 9014: e3a03002 mov r3, #2 9018: ea00002e b 90d8 /* * Set the node access to the point we have found. */ pathloc->node_access = node; 901c: e5845000 str r5, [r4] 9020: ea000002 b 9030 case IMFS_NO_MORE_PATH: case IMFS_CURRENT_DIR: break; case IMFS_INVALID_TOKEN: rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); 9024: eb000fbd bl cf20 <__errno> 9028: e3a0305b mov r3, #91 ; 0x5b 902c: ea000029 b 90d8 /* * Evaluate all tokens until we are done or an error occurs. */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { 9030: e3590004 cmp r9, #4 9034: 13590000 cmpne r9, #0 9038: 1affffa7 bne 8edc * new fs root node and let let the mounted filesystem set the handlers. * * NOTE: The behavior of stat() on a mount point appears to be questionable. */ if ( node->type == IMFS_DIRECTORY ) { 903c: e595304c ldr r3, [r5, #76] ; 0x4c 9040: e3530001 cmp r3, #1 9044: 1a000019 bne 90b0 if ( node->info.directory.mt_fs != NULL ) { 9048: e595e05c ldr lr, [r5, #92] ; 0x5c 904c: e35e0000 cmp lr, #0 9050: 0a000016 beq 90b0 newloc = node->info.directory.mt_fs->mt_fs_root; 9054: e28dc028 add ip, sp, #40 ; 0x28 9058: e28ee01c add lr, lr, #28 905c: e8be000f ldm lr!, {r0, r1, r2, r3} 9060: e8ac000f stmia ip!, {r0, r1, r2, r3} 9064: e59ee000 ldr lr, [lr] 9068: e58ce000 str lr, [ip] *pathloc = newloc; 906c: e28dc028 add ip, sp, #40 ; 0x28 9070: e8bc000f ldm ip!, {r0, r1, r2, r3} 9074: e1a0c004 mov ip, r4 9078: e8ac000f stmia ip!, {r0, r1, r2, r3} return (*pathloc->ops->evalpath_h)( &pathname[i-len], 907c: e59d103c ldr r1, [sp, #60] ; 0x3c 9080: e59d2000 ldr r2, [sp] */ if ( node->type == IMFS_DIRECTORY ) { if ( node->info.directory.mt_fs != NULL ) { newloc = node->info.directory.mt_fs->mt_fs_root; *pathloc = newloc; 9084: e58ce000 str lr, [ip] return (*pathloc->ops->evalpath_h)( &pathname[i-len], 9088: e0610007 rsb r0, r1, r7 908c: e0820000 add r0, r2, r0 9090: e594c00c ldr ip, [r4, #12] 9094: e0861001 add r1, r6, r1 9098: e1a02008 mov r2, r8 909c: e1a03004 mov r3, r4 90a0: e1a0e00f mov lr, pc 90a4: e59cf000 ldr pc, [ip] 90a8: e1a0b000 mov fp, r0 90ac: ea00000b b 90e0 flags, pathloc ); } else { result = IMFS_Set_handlers( pathloc ); } } else { result = IMFS_Set_handlers( pathloc ); 90b0: e1a00004 mov r0, r4 90b4: ebffff30 bl 8d7c /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( pathloc, flags ) ) 90b8: e1a01008 mov r1, r8 flags, pathloc ); } else { result = IMFS_Set_handlers( pathloc ); } } else { result = IMFS_Set_handlers( pathloc ); 90bc: e1a0b000 mov fp, r0 /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( pathloc, flags ) ) 90c0: e1a00004 mov r0, r4 90c4: ebffff49 bl 8df0 90c8: e3500000 cmp r0, #0 90cc: 1a000003 bne 90e0 rtems_set_errno_and_return_minus_one( EACCES ); 90d0: eb000f92 bl cf20 <__errno> 90d4: e3a0300d mov r3, #13 90d8: e5803000 str r3, [r0] 90dc: e3e0b000 mvn fp, #0 return result; } 90e0: e1a0000b mov r0, fp 90e4: e28dd040 add sp, sp, #64 ; 0x40 90e8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 0000922c : int IMFS_evaluate_for_make( const char *path, /* IN */ rtems_filesystem_location_info_t *pathloc, /* IN/OUT */ const char **name /* OUT */ ) { 922c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 9230: e24dd03c sub sp, sp, #60 ; 0x3c 9234: e1a07000 mov r7, r0 9238: e1a04001 mov r4, r1 923c: e1a0a002 mov sl, r2 /* * This was filled in by the caller and is valid in the * mount table. */ node = pathloc->node_access; 9240: e5916000 ldr r6, [r1] /* * Get the path length. */ pathlen = strlen( path ); 9244: eb00131f bl dec8 const char *path, /* IN */ rtems_filesystem_location_info_t *pathloc, /* IN/OUT */ const char **name /* OUT */ ) { int i = 0; 9248: e3a05000 mov r5, #0 node = pathloc->node_access; /* * Get the path length. */ pathlen = strlen( path ); 924c: e1a08000 mov r8, r0 * Evaluate all tokens until we are done or an error occurs. */ while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); 9250: e1a01008 mov r1, r8 9254: e28d3038 add r3, sp, #56 ; 0x38 9258: e0870005 add r0, r7, r5 925c: e1a0200d mov r2, sp 9260: eb0000d2 bl 95b0 pathlen -= len; i += len; if ( !pathloc->node_access ) 9264: e5943000 ldr r3, [r4] */ while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); pathlen -= len; 9268: e59db038 ldr fp, [sp, #56] ; 0x38 i += len; if ( !pathloc->node_access ) 926c: e3530000 cmp r3, #0 * Evaluate all tokens until we are done or an error occurs. */ while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); 9270: e1a09000 mov r9, r0 pathlen -= len; 9274: e06b8008 rsb r8, fp, r8 i += len; if ( !pathloc->node_access ) 9278: 0a000060 beq 9400 /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) 927c: e3500000 cmp r0, #0 9280: 0a000006 beq 92a0 if ( node->type == IMFS_DIRECTORY ) 9284: e596104c ldr r1, [r6, #76] ; 0x4c 9288: e3510001 cmp r1, #1 928c: 1a000003 bne 92a0 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 9290: e1a00004 mov r0, r4 9294: ebfffed5 bl 8df0 9298: e3500000 cmp r0, #0 929c: 0a00006c beq 9454 rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; 92a0: e5943000 ldr r3, [r4] while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); pathlen -= len; i += len; 92a4: e085500b add r5, r5, fp if ( type != IMFS_NO_MORE_PATH ) if ( node->type == IMFS_DIRECTORY ) if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; 92a8: e1a06003 mov r6, r3 switch( type ) { 92ac: e3590004 cmp r9, #4 92b0: 979ff109 ldrls pc, [pc, r9, lsl #2] 92b4: eaffffe5 b 9250 <== NOT EXECUTED 92b8: 000093c4 .word 0x000093c4 <== NOT EXECUTED 92bc: 00009250 .word 0x00009250 <== NOT EXECUTED 92c0: 000092cc .word 0x000092cc <== NOT EXECUTED 92c4: 00009308 .word 0x00009308 <== NOT EXECUTED 92c8: 000093d0 .word 0x000093d0 <== NOT EXECUTED case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 92cc: e59f119c ldr r1, [pc, #412] ; 9470 92d0: e5912000 ldr r2, [r1] 92d4: e5922018 ldr r2, [r2, #24] 92d8: e1530002 cmp r3, r2 92dc: 0affffdb beq 9250 /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access){ 92e0: e594e010 ldr lr, [r4, #16] 92e4: e59e201c ldr r2, [lr, #28] 92e8: e1530002 cmp r3, r2 if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; } else { newloc = pathloc->mt_entry->mt_point_node; 92ec: 028dc024 addeq ip, sp, #36 ; 0x24 92f0: 028ee008 addeq lr, lr, #8 92f4: 0a000019 beq 9360 *pathloc = newloc; return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); } } else { if ( !node->Parent ) 92f8: e5936008 ldr r6, [r3, #8] 92fc: e3560000 cmp r6, #0 9300: 1a00002d bne 93bc 9304: ea00003d b 9400 pathloc->node_access = node; break; case IMFS_NAME: if ( node->type == IMFS_HARD_LINK ) { 9308: e593304c ldr r3, [r3, #76] ; 0x4c 930c: e3530003 cmp r3, #3 9310: 0a000001 beq 931c result = IMFS_evaluate_link( pathloc, 0 ); if ( result == -1 ) return -1; } else if ( node->type == IMFS_SYM_LINK ) { 9314: e3530004 cmp r3, #4 9318: 1a000005 bne 9334 result = IMFS_evaluate_link( pathloc, 0 ); 931c: e1a00004 mov r0, r4 9320: e3a01000 mov r1, #0 9324: ebffff93 bl 9178 if ( result == -1 ) 9328: e3700001 cmn r0, #1 if ( result == -1 ) return -1; } else if ( node->type == IMFS_SYM_LINK ) { result = IMFS_evaluate_link( pathloc, 0 ); 932c: e1a06000 mov r6, r0 if ( result == -1 ) 9330: 0a00004b beq 9464 return -1; } node = pathloc->node_access; 9334: e5940000 ldr r0, [r4] if ( !node ) 9338: e3500000 cmp r0, #0 933c: 0a00003c beq 9434 /* * Only a directory can be decended into. */ if ( node->type != IMFS_DIRECTORY ) 9340: e590304c ldr r3, [r0, #76] ; 0x4c 9344: e3530001 cmp r3, #1 9348: 1a000039 bne 9434 /* * If we are at a node that is a mount point. Set loc to the * new fs root node and let them finish evaluating the path. */ if ( node->info.directory.mt_fs != NULL ) { 934c: e590e05c ldr lr, [r0, #92] ; 0x5c 9350: e35e0000 cmp lr, #0 9354: 0a000014 beq 93ac newloc = node->info.directory.mt_fs->mt_fs_root; 9358: e28dc024 add ip, sp, #36 ; 0x24 935c: e28ee01c add lr, lr, #28 9360: e8be000f ldm lr!, {r0, r1, r2, r3} 9364: e8ac000f stmia ip!, {r0, r1, r2, r3} 9368: e59ee000 ldr lr, [lr] 936c: e58ce000 str lr, [ip] *pathloc = newloc; 9370: e28dc024 add ip, sp, #36 ; 0x24 9374: e8bc000f ldm ip!, {r0, r1, r2, r3} 9378: e1a0c004 mov ip, r4 937c: e8ac000f stmia ip!, {r0, r1, r2, r3} return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); 9380: e59d2038 ldr r2, [sp, #56] ; 0x38 * new fs root node and let them finish evaluating the path. */ if ( node->info.directory.mt_fs != NULL ) { newloc = node->info.directory.mt_fs->mt_fs_root; *pathloc = newloc; 9384: e58ce000 str lr, [ip] return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); 9388: e0625005 rsb r5, r2, r5 938c: e594300c ldr r3, [r4, #12] 9390: e0870005 add r0, r7, r5 9394: e1a01004 mov r1, r4 9398: e1a0200a mov r2, sl 939c: e1a0e00f mov lr, pc 93a0: e593f004 ldr pc, [r3, #4] 93a4: e1a06000 mov r6, r0 93a8: ea00002d b 9464 /* * Otherwise find the token name in the present location. */ node = IMFS_find_match_in_dir( node, token ); 93ac: e1a0100d mov r1, sp 93b0: eb00005e bl 9530 /* * If there is no node we have found the name of the node we * wish to create. */ if ( ! node ) 93b4: e2506000 subs r6, r0, #0 93b8: 0a000007 beq 93dc done = true; else pathloc->node_access = node; 93bc: e5846000 str r6, [r4] 93c0: eaffffa2 b 9250 break; case IMFS_NO_MORE_PATH: rtems_set_errno_and_return_minus_one( EEXIST ); 93c4: eb000ed5 bl cf20 <__errno> 93c8: e3a03011 mov r3, #17 93cc: ea000022 b 945c break; case IMFS_INVALID_TOKEN: rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); 93d0: eb000ed2 bl cf20 <__errno> 93d4: e3a0305b mov r3, #91 ; 0x5b 93d8: ea00001f b 945c case IMFS_CURRENT_DIR: break; } } *name = &path[ i - len ]; 93dc: e59d3038 ldr r3, [sp, #56] ; 0x38 93e0: e0633005 rsb r3, r3, r5 93e4: e0873003 add r3, r7, r3 93e8: e58a3000 str r3, [sl] * pathloc is returned with a pointer to the parent of the new node. * name is returned with a pointer to the first character in the * new node name. The parent node is verified to be a directory. */ int IMFS_evaluate_for_make( 93ec: e0875005 add r5, r7, r5 /* * We have evaluated the path as far as we can. * Verify there is not any invalid stuff at the end of the name. */ for( ; path[i] != '\0'; i++) { 93f0: ea000005 b 940c if ( !IMFS_is_separator( path[ i ] ) ) 93f4: ebffe6b9 bl 2ee0 93f8: e3500000 cmp r0, #0 93fc: 1a000002 bne 940c rtems_set_errno_and_return_minus_one( ENOENT ); 9400: eb000ec6 bl cf20 <__errno> 9404: e3a03002 mov r3, #2 9408: ea000013 b 945c /* * We have evaluated the path as far as we can. * Verify there is not any invalid stuff at the end of the name. */ for( ; path[i] != '\0'; i++) { 940c: e4d50001 ldrb r0, [r5], #1 9410: e3500000 cmp r0, #0 9414: 1afffff6 bne 93f4 /* * Verify we can execute and write to this directory. */ result = IMFS_Set_handlers( pathloc ); 9418: e1a00004 mov r0, r4 941c: ebfffe56 bl 8d7c /* * The returned node must be a directory */ node = pathloc->node_access; if ( node->type != IMFS_DIRECTORY ) 9420: e5943000 ldr r3, [r4] 9424: e593304c ldr r3, [r3, #76] ; 0x4c 9428: e3530001 cmp r3, #1 /* * Verify we can execute and write to this directory. */ result = IMFS_Set_handlers( pathloc ); 942c: e1a06000 mov r6, r0 /* * The returned node must be a directory */ node = pathloc->node_access; if ( node->type != IMFS_DIRECTORY ) 9430: 0a000002 beq 9440 rtems_set_errno_and_return_minus_one( ENOTDIR ); 9434: eb000eb9 bl cf20 <__errno> 9438: e3a03014 mov r3, #20 943c: ea000006 b 945c /* * We must have Write and execute permission on the returned node. */ if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) ) 9440: e1a00004 mov r0, r4 9444: e3a01003 mov r1, #3 9448: ebfffe68 bl 8df0 944c: e3500000 cmp r0, #0 9450: 1a000003 bne 9464 rtems_set_errno_and_return_minus_one( EACCES ); 9454: eb000eb1 bl cf20 <__errno> 9458: e3a0300d mov r3, #13 945c: e5803000 str r3, [r0] 9460: e3e06000 mvn r6, #0 return result; } 9464: e1a00006 mov r0, r6 9468: e28dd03c add sp, sp, #60 ; 0x3c 946c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00008df0 : uid_t st_uid; gid_t st_gid; IMFS_jnode_t *jnode; int flags_to_test; if ( !rtems_libio_is_valid_perms( flags ) ) 8df0: e3d13007 bics r3, r1, #7 */ int IMFS_evaluate_permission( rtems_filesystem_location_info_t *node, int flags ) { 8df4: e92d4070 push {r4, r5, r6, lr} 8df8: e1a04001 mov r4, r1 uid_t st_uid; gid_t st_gid; IMFS_jnode_t *jnode; int flags_to_test; if ( !rtems_libio_is_valid_perms( flags ) ) 8dfc: 0a000004 beq 8e14 rtems_set_errno_and_return_minus_one( EPERM ); 8e00: eb001046 bl cf20 <__errno> <== NOT EXECUTED 8e04: e3a03001 mov r3, #1 <== NOT EXECUTED 8e08: e5803000 str r3, [r0] <== NOT EXECUTED 8e0c: e3e00000 mvn r0, #0 <== NOT EXECUTED 8e10: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED jnode = node->node_access; 8e14: e5905000 ldr r5, [r0] #if defined(RTEMS_POSIX_API) st_uid = geteuid(); 8e18: eb0002de bl 9998 8e1c: e1a06000 mov r6, r0 st_gid = getegid(); 8e20: eb0002d7 bl 9984 * Check if I am owner or a group member or someone else. */ flags_to_test = flags; if ( st_uid == jnode->st_uid ) 8e24: e1d533bc ldrh r3, [r5, #60] ; 0x3c 8e28: e1530006 cmp r3, r6 flags_to_test <<= 6; 8e2c: 01a04304 lsleq r4, r4, #6 * Check if I am owner or a group member or someone else. */ flags_to_test = flags; if ( st_uid == jnode->st_uid ) 8e30: 0a000002 beq 8e40 flags_to_test <<= 6; else if ( st_gid == jnode->st_gid ) 8e34: e1d533be ldrh r3, [r5, #62] ; 0x3e 8e38: e1530000 cmp r3, r0 flags_to_test <<= 3; 8e3c: 01a04184 lsleq r4, r4, #3 /* * If all of the flags are set we have permission * to do this. */ if ( ( flags_to_test & jnode->st_mode) == flags_to_test ) 8e40: e5950030 ldr r0, [r5, #48] ; 0x30 8e44: e0040000 and r0, r4, r0 gid_t st_gid; IMFS_jnode_t *jnode; int flags_to_test; if ( !rtems_libio_is_valid_perms( flags ) ) rtems_set_errno_and_return_minus_one( EPERM ); 8e48: e1500004 cmp r0, r4 8e4c: 13a00000 movne r0, #0 8e50: 03a00001 moveq r0, #1 */ if ( ( flags_to_test & jnode->st_mode) == flags_to_test ) return 1; return 0; } 8e54: e8bd8070 pop {r4, r5, r6, pc} =============================================================================== 00009474 : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) int IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 9474: e92d4070 push {r4, r5, r6, lr} /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ jnode = (IMFS_jnode_t *)temp_mt_entry->mt_fs_root.node_access; 9478: e1a0c000 mov ip, r0 947c: e5bc401c ldr r4, [ip, #28]! ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) int IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 9480: e1a05000 mov r5, r0 9484: e24dd014 sub sp, sp, #20 * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ jnode = (IMFS_jnode_t *)temp_mt_entry->mt_fs_root.node_access; loc = temp_mt_entry->mt_fs_root; 9488: e8bc000f ldm ip!, {r0, r1, r2, r3} 948c: e1a0e00d mov lr, sp 9490: e8ae000f stmia lr!, {r0, r1, r2, r3} 9494: e59c3000 ldr r3, [ip] 9498: e58e3000 str r3, [lr] /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root.node_access = NULL; 949c: e3a03000 mov r3, #0 94a0: e585301c str r3, [r5, #28] do { next = jnode->Parent; loc.node_access = (void *)jnode; IMFS_Set_handlers( &loc ); 94a4: e1a0500d mov r5, sp 94a8: e1a0000d mov r0, sp */ temp_mt_entry->mt_fs_root.node_access = NULL; do { next = jnode->Parent; 94ac: e5946008 ldr r6, [r4, #8] loc.node_access = (void *)jnode; 94b0: e58d4000 str r4, [sp] IMFS_Set_handlers( &loc ); 94b4: ebfffe30 bl 8d7c if ( jnode->type != IMFS_DIRECTORY ) { 94b8: e594304c ldr r3, [r4, #76] ; 0x4c 94bc: e3530001 cmp r3, #1 94c0: 1a000003 bne 94d4 result = IMFS_unlink( NULL, &loc ); if (result != 0) return -1; jnode = next; } else if ( jnode_has_no_children( jnode ) ) { 94c4: e5942050 ldr r2, [r4, #80] ; 0x50 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 94c8: e2843054 add r3, r4, #84 ; 0x54 94cc: e1520003 cmp r2, r3 94d0: 1a000005 bne 94ec result = IMFS_unlink( NULL, &loc ); 94d4: e3a00000 mov r0, #0 94d8: e1a0100d mov r1, sp 94dc: ebffe1d4 bl 1c34 if (result != 0) 94e0: e3500000 cmp r0, #0 94e4: 1a00000c bne 951c return -1; jnode = next; 94e8: e1a04006 mov r4, r6 } if ( jnode != NULL ) { 94ec: e3540000 cmp r4, #0 94f0: 0a00000b beq 9524 if ( jnode->type == IMFS_DIRECTORY ) { 94f4: e594304c ldr r3, [r4, #76] ; 0x4c 94f8: e3530001 cmp r3, #1 94fc: 1affffe9 bne 94a8 } } } while (jnode != NULL); return 0; } 9500: e5943050 ldr r3, [r4, #80] ; 0x50 9504: e2842054 add r2, r4, #84 ; 0x54 return -1; jnode = next; } if ( jnode != NULL ) { if ( jnode->type == IMFS_DIRECTORY ) { if ( jnode_has_children( jnode ) ) 9508: e1530002 cmp r3, r2 950c: 0affffe5 beq 94a8 jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); 9510: e2534000 subs r4, r3, #0 9514: 1affffe3 bne 94a8 9518: ea000001 b 9524 <== NOT EXECUTED return -1; jnode = next; } else if ( jnode_has_no_children( jnode ) ) { result = IMFS_unlink( NULL, &loc ); if (result != 0) return -1; 951c: e3e00000 mvn r0, #0 <== NOT EXECUTED 9520: ea000000 b 9528 <== NOT EXECUTED jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); return 0; 9524: e1a00004 mov r0, r4 } 9528: e28dd014 add sp, sp, #20 952c: e8bd8070 pop {r4, r5, r6, pc} =============================================================================== 0000b684 : my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { b684: e59f31e4 ldr r3, [pc, #484] ; b870 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { b688: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { b68c: e5935000 ldr r5, [r3] b690: e1a05125 lsr r5, r5, #2 b694: e2453001 sub r3, r5, #1 b698: e1510003 cmp r1, r3 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { b69c: e1a04000 mov r4, r0 b6a0: e1a06001 mov r6, r1 b6a4: e1a08002 mov r8, r2 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { b6a8: 8a00000e bhi b6e8 p = info->indirect; if ( malloc_it ) { b6ac: e3520000 cmp r2, #0 /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { p = info->indirect; b6b0: e5900058 ldr r0, [r0, #88] ; 0x58 if ( malloc_it ) { b6b4: 0a000007 beq b6d8 if ( !p ) { b6b8: e3500000 cmp r0, #0 b6bc: 1a000003 bne b6d0 p = memfile_alloc_block(); b6c0: ebffffe2 bl b650 if ( !p ) b6c4: e3500000 cmp r0, #0 b6c8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; info->indirect = p; b6cc: e5840058 str r0, [r4, #88] ; 0x58 } return &info->indirect[ my_block ]; b6d0: e5940058 ldr r0, [r4, #88] ; 0x58 b6d4: ea000001 b b6e0 } if ( !p ) b6d8: e3500000 cmp r0, #0 b6dc: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; return &info->indirect[ my_block ]; b6e0: e0800106 add r0, r0, r6, lsl #2 b6e4: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { b6e8: e2853001 add r3, r5, #1 b6ec: e0030395 mul r3, r5, r3 b6f0: e2432001 sub r2, r3, #1 b6f4: e1510002 cmp r1, r2 b6f8: 8a000021 bhi b784 my_block -= FIRST_DOUBLY_INDIRECT; b6fc: e0656001 rsb r6, r5, r1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; b700: e1a00006 mov r0, r6 b704: e1a01005 mov r1, r5 b708: eb00145f bl 1088c <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; b70c: e1a01005 mov r1, r5 */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; b710: e1a07000 mov r7, r0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; b714: e1a00006 mov r0, r6 b718: eb0013c3 bl 1062c <__aeabi_uidiv> p = info->doubly_indirect; if ( malloc_it ) { b71c: e3580000 cmp r8, #0 if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; b720: e1a05000 mov r5, r0 p = info->doubly_indirect; b724: e594005c ldr r0, [r4, #92] ; 0x5c if ( malloc_it ) { b728: 0a00000e beq b768 if ( !p ) { b72c: e3500000 cmp r0, #0 b730: 1a000003 bne b744 p = memfile_alloc_block(); b734: ebffffc5 bl b650 if ( !p ) b738: e3500000 cmp r0, #0 b73c: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; info->doubly_indirect = p; b740: e584005c str r0, [r4, #92] ; 0x5c } p1 = (block_p *)p[ doubly ]; b744: e0804105 add r4, r0, r5, lsl #2 b748: e7900105 ldr r0, [r0, r5, lsl #2] if ( !p1 ) { b74c: e3500000 cmp r0, #0 b750: 1a000009 bne b77c p1 = memfile_alloc_block(); b754: ebffffbd bl b650 if ( !p1 ) b758: e3500000 cmp r0, #0 return 0; p[ doubly ] = (block_p) p1; b75c: 15840000 strne r0, [r4] } p1 = (block_p *)p[ doubly ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) b760: 1a000005 bne b77c b764: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED } return (block_p *)&p1[ singly ]; } if ( !p ) b768: e3500000 cmp r0, #0 b76c: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; p = (block_p *)p[ doubly ]; b770: e7900105 ldr r0, [r0, r5, lsl #2] if ( !p ) b774: e3500000 cmp r0, #0 b778: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; return (block_p *)&p[ singly ]; b77c: e0800107 add r0, r0, r7, lsl #2 b780: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { b784: e2832001 add r2, r3, #1 b788: e0020295 mul r2, r5, r2 b78c: e2422001 sub r2, r2, #1 b790: e1510002 cmp r1, r2 b794: 8a000033 bhi b868 my_block -= FIRST_TRIPLY_INDIRECT; b798: e0636001 rsb r6, r3, r1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; b79c: e1a00006 mov r0, r6 b7a0: e1a01005 mov r1, r5 b7a4: eb001438 bl 1088c <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; b7a8: e1a01005 mov r1, r5 * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; b7ac: e1a0a000 mov sl, r0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; b7b0: e1a00006 mov r0, r6 b7b4: eb00139c bl 1062c <__aeabi_uidiv> triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; b7b8: e1a01005 mov r1, r5 */ 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; b7bc: e1a06000 mov r6, r0 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; b7c0: eb001399 bl 1062c <__aeabi_uidiv> doubly %= IMFS_MEMFILE_BLOCK_SLOTS; b7c4: e1a01005 mov r1, r5 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; b7c8: e1a07000 mov r7, r0 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; b7cc: e1a00006 mov r0, r6 b7d0: eb00142d bl 1088c <__umodsi3> p = info->triply_indirect; if ( malloc_it ) { b7d4: e3580000 cmp r8, #0 my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; doubly %= IMFS_MEMFILE_BLOCK_SLOTS; b7d8: e1a05000 mov r5, r0 p = info->triply_indirect; b7dc: e5940060 ldr r0, [r4, #96] ; 0x60 if ( malloc_it ) { b7e0: 0a000016 beq b840 if ( !p ) { b7e4: e3500000 cmp r0, #0 b7e8: 1a000003 bne b7fc p = memfile_alloc_block(); b7ec: ebffff97 bl b650 if ( !p ) b7f0: e3500000 cmp r0, #0 b7f4: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; info->triply_indirect = p; b7f8: e5840060 str r0, [r4, #96] ; 0x60 } p1 = (block_p *) p[ triply ]; b7fc: e0804107 add r4, r0, r7, lsl #2 b800: e7900107 ldr r0, [r0, r7, lsl #2] if ( !p1 ) { b804: e3500000 cmp r0, #0 b808: 1a000003 bne b81c p1 = memfile_alloc_block(); b80c: ebffff8f bl b650 if ( !p1 ) b810: e3500000 cmp r0, #0 b814: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; p[ triply ] = (block_p) p1; b818: e5840000 str r0, [r4] } p2 = (block_p *)p1[ doubly ]; b81c: e0804105 add r4, r0, r5, lsl #2 b820: e7900105 ldr r0, [r0, r5, lsl #2] if ( !p2 ) { b824: e3500000 cmp r0, #0 b828: 1a00000c bne b860 p2 = memfile_alloc_block(); b82c: ebffff87 bl b650 if ( !p2 ) b830: e3500000 cmp r0, #0 return 0; p1[ doubly ] = (block_p) p2; b834: 15840000 strne r0, [r4] } p2 = (block_p *)p1[ doubly ]; if ( !p2 ) { p2 = memfile_alloc_block(); if ( !p2 ) b838: 1a000008 bne b860 b83c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED p1[ doubly ] = (block_p) p2; } return (block_p *)&p2[ singly ]; } if ( !p ) b840: e3500000 cmp r0, #0 b844: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; p1 = (block_p *) p[ triply ]; b848: e7900107 ldr r0, [r0, r7, lsl #2] if ( !p1 ) b84c: e3500000 cmp r0, #0 b850: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; p2 = (block_p *)p1[ doubly ]; b854: e7900105 ldr r0, [r0, r5, lsl #2] if ( !p2 ) b858: e3500000 cmp r0, #0 b85c: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; return (block_p *)&p2[ singly ]; b860: e080010a add r0, r0, sl, lsl #2 b864: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} } /* * This means the requested block number is out of range. */ return 0; b868: e3a00000 mov r0, #0 <== NOT EXECUTED } b86c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED =============================================================================== 00001ad4 : rtems_filesystem_mount_table_entry_t *mt_entry ) { IMFS_jnode_t *node; node = mt_entry->mt_point_node.node_access; 1ad4: e5903008 ldr r3, [r0, #8] /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) 1ad8: e593204c ldr r2, [r3, #76] ; 0x4c 1adc: e3520001 cmp r2, #1 #include int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 1ae0: e52de004 push {lr} ; (str lr, [sp, #-4]!) /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) 1ae4: 0a000004 beq 1afc rtems_set_errno_and_return_minus_one( ENOTDIR ); 1ae8: eb002d0c bl cf20 <__errno> <== NOT EXECUTED 1aec: e3a03014 mov r3, #20 <== NOT EXECUTED 1af0: e5803000 str r3, [r0] <== NOT EXECUTED 1af4: e3e00000 mvn r0, #0 <== NOT EXECUTED 1af8: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED /* * Set mt_fs pointer to point to the mount table entry for * the mounted file system. */ node->info.directory.mt_fs = mt_entry; 1afc: e583005c str r0, [r3, #92] ; 0x5c return 0; 1b00: e3a00000 mov r0, #0 } 1b04: e49df004 pop {pc} ; (ldr pc, [sp], #4) =============================================================================== 00004458 : * This routine prints the contents of the specified jnode. */ void IMFS_print_jnode( IMFS_jnode_t *the_jnode ) { 4458: e92d4030 push {r4, r5, lr} IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); 445c: e59f50e0 ldr r5, [pc, #224] ; 4544 4460: e5953000 ldr r3, [r5] * This routine prints the contents of the specified jnode. */ void IMFS_print_jnode( IMFS_jnode_t *the_jnode ) { 4464: e1a04000 mov r4, r0 IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); 4468: e5931008 ldr r1, [r3, #8] 446c: e280000c add r0, r0, #12 4470: eb003483 bl 11684 switch( the_jnode->type ) { 4474: e594204c ldr r2, [r4, #76] ; 0x4c 4478: e2423001 sub r3, r2, #1 447c: e3530006 cmp r3, #6 4480: 979ff103 ldrls pc, [pc, r3, lsl #2] 4484: ea000026 b 4524 <== NOT EXECUTED 4488: 000044a4 .word 0x000044a4 <== NOT EXECUTED 448c: 000044b8 .word 0x000044b8 <== NOT EXECUTED 4490: 00004504 .word 0x00004504 <== NOT EXECUTED 4494: 00004504 .word 0x00004504 <== NOT EXECUTED 4498: 000044ec .word 0x000044ec <== NOT EXECUTED 449c: 000044d0 .word 0x000044d0 <== NOT EXECUTED 44a0: 00004510 .word 0x00004510 <== NOT EXECUTED case IMFS_DIRECTORY: fprintf(stdout, "/" ); 44a4: e5953000 ldr r3, [r5] 44a8: e3a0002f mov r0, #47 ; 0x2f 44ac: e5931008 ldr r1, [r3, #8] 44b0: eb00343e bl 115b0 break; 44b4: ea00001f b 4538 case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 44b8: e5953000 ldr r3, [r5] 44bc: e59f1084 ldr r1, [pc, #132] ; 4548 44c0: e5930008 ldr r0, [r3, #8] 44c4: e2842050 add r2, r4, #80 ; 0x50 44c8: e892000c ldm r2, {r2, r3} 44cc: ea000004 b 44e4 the_jnode->info.device.major, the_jnode->info.device.minor ); break; case IMFS_LINEAR_FILE: fprintf(stdout, " (file %" PRId32 " %p)", 44d0: e5953000 ldr r3, [r5] 44d4: e59f1070 ldr r1, [pc, #112] ; 454c 44d8: e5930008 ldr r0, [r3, #8] 44dc: e5942050 ldr r2, [r4, #80] ; 0x50 44e0: e5943058 ldr r3, [r4, #88] ; 0x58 44e4: eb003411 bl 11530 (uint32_t)the_jnode->info.linearfile.size, the_jnode->info.linearfile.direct ); break; 44e8: ea000012 b 4538 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 44ec: e5953000 ldr r3, [r5] 44f0: e59f1058 ldr r1, [pc, #88] ; 4550 44f4: e5930008 ldr r0, [r3, #8] 44f8: e5942050 ldr r2, [r4, #80] ; 0x50 44fc: eb00340b bl 11530 (uint32_t)the_jnode->info.file.size ); #endif break; 4500: ea00000c b 4538 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 4504: e5953000 ldr r3, [r5] 4508: e59f0044 ldr r0, [pc, #68] ; 4554 450c: ea000001 b 4518 return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 4510: e5953000 ldr r3, [r5] 4514: e59f003c ldr r0, [pc, #60] ; 4558 4518: e5931008 ldr r1, [r3, #8] default: fprintf(stdout, " bad type %d\n", the_jnode->type ); return; } puts(""); } 451c: e8bd4030 pop {r4, r5, lr} case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 4520: ea003457 b 11684 return; default: fprintf(stdout, " bad type %d\n", the_jnode->type ); 4524: e5953000 ldr r3, [r5] <== NOT EXECUTED 4528: e59f102c ldr r1, [pc, #44] ; 455c <== NOT EXECUTED 452c: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED return; } puts(""); } 4530: e8bd4030 pop {r4, r5, lr} <== NOT EXECUTED case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", the_jnode->type ); 4534: ea0033fd b 11530 <== NOT EXECUTED return; } puts(""); 4538: e59f0020 ldr r0, [pc, #32] ; 4560 } 453c: e8bd4030 pop {r4, r5, lr} default: fprintf(stdout, " bad type %d\n", the_jnode->type ); return; } puts(""); 4540: ea003b29 b 131ec =============================================================================== 00009758 : { IMFS_fs_info_t *fs_info; IMFS_jnode_t *the_jnode; IMFS_device_t *io; the_jnode = loc->node_access; 9758: e5903000 ldr r3, [r0] switch ( the_jnode->type ) { 975c: e593204c ldr r2, [r3, #76] ; 0x4c 9760: e2422002 sub r2, r2, #2 int IMFS_stat( rtems_filesystem_location_info_t *loc, struct stat *buf ) { 9764: e92d4800 push {fp, lr} IMFS_device_t *io; the_jnode = loc->node_access; switch ( the_jnode->type ) { 9768: e3520005 cmp r2, #5 976c: 979ff102 ldrls pc, [pc, r2, lsl #2] 9770: ea000012 b 97c0 <== NOT EXECUTED 9774: 0000978c .word 0x0000978c <== NOT EXECUTED 9778: 000097c0 .word 0x000097c0 <== NOT EXECUTED 977c: 000097ac .word 0x000097ac <== NOT EXECUTED 9780: 000097a0 .word 0x000097a0 <== NOT EXECUTED 9784: 000097a0 .word 0x000097a0 <== NOT EXECUTED 9788: 000097ac .word 0x000097ac <== NOT EXECUTED case IMFS_DEVICE: io = &the_jnode->info.device; buf->st_rdev = rtems_filesystem_make_dev_t( io->major, io->minor ); 978c: e5932054 ldr r2, [r3, #84] ; 0x54 rtems_device_minor_number _minor ) { union __rtems_dev_t temp; temp.__overlay.major = _major; 9790: e593c050 ldr ip, [r3, #80] ; 0x50 9794: e581201c str r2, [r1, #28] 9798: e581c018 str ip, [r1, #24] break; 979c: ea00000c b 97d4 case IMFS_LINEAR_FILE: case IMFS_MEMORY_FILE: buf->st_size = the_jnode->info.file.size; 97a0: e283c050 add ip, r3, #80 ; 0x50 97a4: e89c1800 ldm ip, {fp, ip} 97a8: ea000001 b 97b4 case IMFS_SYM_LINK: buf->st_size = 0; break; case IMFS_FIFO: buf->st_size = 0; 97ac: e3a0b000 mov fp, #0 97b0: e3a0c000 mov ip, #0 97b4: e581b020 str fp, [r1, #32] 97b8: e581c024 str ip, [r1, #36] ; 0x24 break; 97bc: ea000004 b 97d4 default: rtems_set_errno_and_return_minus_one( ENOTSUP ); 97c0: eb000dd6 bl cf20 <__errno> 97c4: e3a03086 mov r3, #134 ; 0x86 97c8: e5803000 str r3, [r0] 97cc: e3e00000 mvn r0, #0 97d0: e8bd8800 pop {fp, pc} /* * The device number of the IMFS is the major number and the minor is the * instance. */ fs_info = loc->mt_entry->fs_info; 97d4: e5902010 ldr r2, [r0, #16] buf->st_dev = rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); 97d8: e5922034 ldr r2, [r2, #52] ; 0x34 97dc: e5922000 ldr r2, [r2] /* * The device number of the IMFS is the major number and the minor is the * instance. */ fs_info = loc->mt_entry->fs_info; buf->st_dev = 97e0: e5812004 str r2, [r1, #4] rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); buf->st_mode = the_jnode->st_mode; 97e4: e5932030 ldr r2, [r3, #48] ; 0x30 97e8: e581200c str r2, [r1, #12] buf->st_nlink = the_jnode->st_nlink; 97ec: e1d323b4 ldrh r2, [r3, #52] ; 0x34 97f0: e1c121b0 strh r2, [r1, #16] buf->st_ino = the_jnode->st_ino; 97f4: e5932038 ldr r2, [r3, #56] ; 0x38 97f8: e5812008 str r2, [r1, #8] buf->st_uid = the_jnode->st_uid; 97fc: e1d323bc ldrh r2, [r3, #60] ; 0x3c 9800: e1c121b2 strh r2, [r1, #18] buf->st_gid = the_jnode->st_gid; 9804: e1d323be ldrh r2, [r3, #62] ; 0x3e 9808: e1c121b4 strh r2, [r1, #20] buf->st_atime = the_jnode->stat_atime; 980c: e5932040 ldr r2, [r3, #64] ; 0x40 9810: e59f001c ldr r0, [pc, #28] ; 9834 9814: e5812028 str r2, [r1, #40] ; 0x28 buf->st_mtime = the_jnode->stat_mtime; 9818: e2832044 add r2, r3, #68 ; 0x44 981c: e892000c ldm r2, {r2, r3} /* * The device number of the IMFS is the major number and the minor is the * instance. */ fs_info = loc->mt_entry->fs_info; buf->st_dev = 9820: e5810000 str r0, [r1] buf->st_ino = the_jnode->st_ino; buf->st_uid = the_jnode->st_uid; buf->st_gid = the_jnode->st_gid; buf->st_atime = the_jnode->stat_atime; buf->st_mtime = the_jnode->stat_mtime; 9824: e5812030 str r2, [r1, #48] ; 0x30 buf->st_ctime = the_jnode->stat_ctime; 9828: e5813038 str r3, [r1, #56] ; 0x38 return 0; 982c: e3a00000 mov r0, #0 } 9830: e8bd8800 pop {fp, pc} =============================================================================== 00001c34 : int IMFS_unlink( rtems_filesystem_location_info_t *parentloc, /* IN */ rtems_filesystem_location_info_t *loc /* IN */ ) { 1c34: e92d40f0 push {r4, r5, r6, r7, lr} IMFS_jnode_t *node; rtems_filesystem_location_info_t the_link; int result = 0; node = loc->node_access; 1c38: e5915000 ldr r5, [r1] /* * If this is the last last pointer to the node * free the node. */ if ( node->type == IMFS_HARD_LINK ) { 1c3c: e595304c ldr r3, [r5, #76] ; 0x4c 1c40: e3530003 cmp r3, #3 int IMFS_unlink( rtems_filesystem_location_info_t *parentloc, /* IN */ rtems_filesystem_location_info_t *loc /* IN */ ) { 1c44: e24dd01c sub sp, sp, #28 1c48: e1a06000 mov r6, r0 1c4c: e1a04001 mov r4, r1 /* * If this is the last last pointer to the node * free the node. */ if ( node->type == IMFS_HARD_LINK ) { 1c50: 1a000024 bne 1ce8 if ( !node->info.hard_link.link_node ) 1c54: e595e050 ldr lr, [r5, #80] ; 0x50 1c58: e35e0000 cmp lr, #0 1c5c: 1a000003 bne 1c70 rtems_set_errno_and_return_minus_one( EINVAL ); 1c60: eb002cae bl cf20 <__errno> <== NOT EXECUTED 1c64: e3a03016 mov r3, #22 <== NOT EXECUTED 1c68: e5803000 str r3, [r0] <== NOT EXECUTED 1c6c: ea000023 b 1d00 <== NOT EXECUTED the_link = *loc; 1c70: e1a07001 mov r7, r1 1c74: e8b7000f ldm r7!, {r0, r1, r2, r3} 1c78: e1a0c00d mov ip, sp 1c7c: e8ac000f stmia ip!, {r0, r1, r2, r3} 1c80: e5973000 ldr r3, [r7] the_link.node_access = node->info.hard_link.link_node; 1c84: e28d701c add r7, sp, #28 1c88: e527e01c str lr, [r7, #-28]! IMFS_Set_handlers( &the_link ); 1c8c: e1a0000d mov r0, sp if ( node->type == IMFS_HARD_LINK ) { if ( !node->info.hard_link.link_node ) rtems_set_errno_and_return_minus_one( EINVAL ); the_link = *loc; 1c90: e58c3000 str r3, [ip] the_link.node_access = node->info.hard_link.link_node; IMFS_Set_handlers( &the_link ); 1c94: eb001c38 bl 8d7c /* * If removing the last hard link to a node, then we need * to remove the node that is a link and the node itself. */ if ( node->info.hard_link.link_node->st_nlink == 1) 1c98: e5953050 ldr r3, [r5, #80] ; 0x50 1c9c: e1d323b4 ldrh r2, [r3, #52] ; 0x34 1ca0: e3520001 cmp r2, #1 1ca4: 1a000007 bne 1cc8 { result = (*the_link.handlers->rmnod_h)( parentloc, &the_link ); 1ca8: e1a00006 mov r0, r6 1cac: e1a0100d mov r1, sp 1cb0: e59d3008 ldr r3, [sp, #8] 1cb4: e1a0e00f mov lr, pc 1cb8: e593f034 ldr pc, [r3, #52] ; 0x34 if ( result != 0 ) 1cbc: e3500000 cmp r0, #0 1cc0: 0a000008 beq 1ce8 1cc4: ea00000d b 1d00 return -1; } else { node->info.hard_link.link_node->st_nlink --; 1cc8: e2422001 sub r2, r2, #1 1ccc: e1c323b4 strh r2, [r3, #52] ; 0x34 IMFS_update_ctime( node->info.hard_link.link_node ); 1cd0: e28d0014 add r0, sp, #20 1cd4: e3a01000 mov r1, #0 1cd8: eb00012c bl 2190 1cdc: e5953050 ldr r3, [r5, #80] ; 0x50 1ce0: e59d2014 ldr r2, [sp, #20] 1ce4: e5832048 str r2, [r3, #72] ; 0x48 /* * Now actually free the node we were asked to free. */ result = (*loc->handlers->rmnod_h)( parentloc, loc ); 1ce8: e5943008 ldr r3, [r4, #8] 1cec: e1a00006 mov r0, r6 1cf0: e1a01004 mov r1, r4 1cf4: e1a0e00f mov lr, pc 1cf8: e593f034 ldr pc, [r3, #52] ; 0x34 return result; 1cfc: ea000000 b 1d04 if ( node->info.hard_link.link_node->st_nlink == 1) { result = (*the_link.handlers->rmnod_h)( parentloc, &the_link ); if ( result != 0 ) return -1; 1d00: e3e00000 mvn r0, #0 */ result = (*loc->handlers->rmnod_h)( parentloc, loc ); return result; } 1d04: e28dd01c add sp, sp, #28 1d08: e8bd80f0 pop {r4, r5, r6, r7, pc} =============================================================================== 00001d0c : rtems_filesystem_mount_table_entry_t *mt_entry ) { IMFS_jnode_t *node; node = mt_entry->mt_point_node.node_access; 1d0c: e5903008 ldr r3, [r0, #8] /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) 1d10: e593204c ldr r2, [r3, #76] ; 0x4c 1d14: e3520001 cmp r2, #1 #include int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 1d18: e52de004 push {lr} ; (str lr, [sp, #-4]!) /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) 1d1c: 0a000002 beq 1d2c rtems_set_errno_and_return_minus_one( ENOTDIR ); 1d20: eb002c7e bl cf20 <__errno> <== NOT EXECUTED 1d24: e3a03014 mov r3, #20 <== NOT EXECUTED 1d28: ea000004 b 1d40 <== NOT EXECUTED /* * Did the node indicate that there was a directory mounted here? */ if ( node->info.directory.mt_fs == NULL ) 1d2c: e593205c ldr r2, [r3, #92] ; 0x5c 1d30: e3520000 cmp r2, #0 1d34: 1a000004 bne 1d4c rtems_set_errno_and_return_minus_one( EINVAL ); /* XXX */ 1d38: eb002c78 bl cf20 <__errno> <== NOT EXECUTED 1d3c: e3a03016 mov r3, #22 <== NOT EXECUTED 1d40: e5803000 str r3, [r0] <== NOT EXECUTED 1d44: e3e00000 mvn r0, #0 <== NOT EXECUTED 1d48: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED /* * Set the mt_fs pointer to indicate that there is no longer * a file system mounted to this point. */ node->info.directory.mt_fs = NULL; 1d4c: e3a00000 mov r0, #0 1d50: e583005c str r0, [r3, #92] ; 0x5c return 0; } 1d54: e49df004 pop {pc} ; (ldr pc, [sp], #4) =============================================================================== 00002020 : static rtems_printk_plugin_t print_handler; void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 2020: e92d4fff push {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, lr} { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 2024: e59030bc ldr r3, [r0, #188] ; 0xbc size = Stack_check_usable_stack_size(stack); 2028: e59070b8 ldr r7, [r0, #184] ; 0xb8 { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 202c: e2832010 add r2, r3, #16 size = Stack_check_usable_stack_size(stack); 2030: e2477010 sub r7, r7, #16 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 2034: e3c71003 bic r1, r7, #3 static rtems_printk_plugin_t print_handler; void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 2038: e1a05000 mov r5, r0 current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); 203c: e590b0e8 ldr fp, [r0, #232] ; 0xe8 /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; 2040: e2820010 add r0, r2, #16 for (ebase = base + length; base < ebase; base++) 2044: e0800001 add r0, r0, r1 * Try to print out how much stack was actually used by the task. */ static void *print_context; static rtems_printk_plugin_t print_handler; void Stack_check_Dump_threads_usage( 2048: e2833020 add r3, r3, #32 * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) if (*base != U32_PATTERN) 204c: e59f10c0 ldr r1, [pc, #192] ; 2114 2050: ea000002 b 2060 2054: e493c004 ldr ip, [r3], #4 2058: e15c0001 cmp ip, r1 205c: 1a000004 bne 2074 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 2060: e1530000 cmp r3, r0 if (*base != U32_PATTERN) 2064: e1a06003 mov r6, r3 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 2068: 3afffff9 bcc 2054 high_water_mark = Stack_check_find_high_water_mark(low, size); if ( high_water_mark ) used = Stack_check_Calculate_used( low, size, high_water_mark ); else used = 0; 206c: e3a06000 mov r6, #0 <== NOT EXECUTED 2070: ea000002 b 2080 <== 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 ) 2074: e3560000 cmp r6, #0 used = Stack_check_Calculate_used( low, size, high_water_mark ); 2078: 10822007 addne r2, r2, r7 207c: 10666002 rsbne r6, r6, r2 #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) #endif { (*print_handler)( 2080: e5958008 ldr r8, [r5, #8] 2084: e59f408c ldr r4, [pc, #140] ; 2118 2088: e3a01005 mov r1, #5 208c: e28d2008 add r2, sp, #8 2090: e1a00008 mov r0, r8 2094: e8940600 ldm r4, {r9, sl} 2098: eb00163c bl 7990 209c: e59f1078 ldr r1, [pc, #120] ; 211c 20a0: e1a03000 mov r3, r0 20a4: e1a02008 mov r2, r8 20a8: e1a0000a mov r0, sl 20ac: e1a0e00f mov lr, pc 20b0: e12fff19 bx r9 (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 20b4: e59530b8 ldr r3, [r5, #184] ; 0xb8 20b8: e59520bc ldr r2, [r5, #188] ; 0xbc 20bc: e2433001 sub r3, r3, #1 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 20c0: e0823003 add r3, r2, r3 20c4: e58db000 str fp, [sp] 20c8: e58d7004 str r7, [sp, #4] 20cc: e5940004 ldr r0, [r4, #4] 20d0: e59f1048 ldr r1, [pc, #72] ; 2120 20d4: e1a0e00f mov lr, pc 20d8: e594f000 ldr pc, [r4] stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 20dc: e5943008 ldr r3, [r4, #8] 20e0: e3530000 cmp r3, #0 20e4: 1a000004 bne 20fc (*print_handler)( print_context, "Unavailable\n" ); 20e8: e5940004 ldr r0, [r4, #4] <== NOT EXECUTED 20ec: e59f1030 ldr r1, [pc, #48] ; 2124 <== NOT EXECUTED 20f0: e1a0e00f mov lr, pc <== NOT EXECUTED 20f4: e594f000 ldr pc, [r4] <== NOT EXECUTED 20f8: ea000004 b 2110 <== NOT EXECUTED } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 20fc: e5940004 ldr r0, [r4, #4] 2100: e59f1020 ldr r1, [pc, #32] ; 2128 2104: e1a02006 mov r2, r6 2108: e1a0e00f mov lr, pc 210c: e594f000 ldr pc, [r4] } } 2110: e8bd8fff pop {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00014f98 <_CORE_message_queue_Broadcast>: { Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 14f98: e590304c ldr r3, [r0, #76] ; 0x4c Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { 14f9c: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 14fa0: e1520003 cmp r2, r3 Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { 14fa4: e1a06000 mov r6, r0 14fa8: e1a0a001 mov sl, r1 14fac: e1a07002 mov r7, r2 14fb0: e59d8020 ldr r8, [sp, #32] Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 14fb4: 8a000013 bhi 15008 <_CORE_message_queue_Broadcast+0x70> * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 14fb8: e5905048 ldr r5, [r0, #72] ; 0x48 14fbc: e3550000 cmp r5, #0 *count = 0; 14fc0: 13a00000 movne r0, #0 14fc4: 15880000 strne r0, [r8] * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 14fc8: 0a000007 beq 14fec <_CORE_message_queue_Broadcast+0x54> 14fcc: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 14fd0: e594002c ldr r0, [r4, #44] ; 0x2c 14fd4: e1a0100a mov r1, sl 14fd8: e1a02007 mov r2, r7 14fdc: eb00221b bl 1d850 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 14fe0: e5943028 ldr r3, [r4, #40] ; 0x28 14fe4: e5837000 str r7, [r3] */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; 14fe8: e2855001 add r5, r5, #1 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 14fec: e1a00006 mov r0, r6 14ff0: eb000a7e bl 179f0 <_Thread_queue_Dequeue> 14ff4: e2504000 subs r4, r0, #0 14ff8: 1afffff4 bne 14fd0 <_CORE_message_queue_Broadcast+0x38> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 14ffc: e5885000 str r5, [r8] return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 15000: e1a00004 mov r0, r4 15004: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { return CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE; 15008: e3a00001 mov r0, #1 <== NOT EXECUTED #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 1500c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED =============================================================================== 000070e8 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 70e8: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 70ec: e5903014 ldr r3, [r0, #20] bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 70f0: e24dd030 sub sp, sp, #48 ; 0x30 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 70f4: e58d3024 str r3, [sp, #36] ; 0x24 Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; 70f8: e5903024 ldr r3, [r0, #36] ; 0x24 Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 70fc: e59f4500 ldr r4, [pc, #1280] ; 7604 <_Heap_Walk+0x51c> ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; 7100: e58d3028 str r3, [sp, #40] ; 0x28 Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 7104: e59f34fc ldr r3, [pc, #1276] ; 7608 <_Heap_Walk+0x520> 7108: e31200ff tst r2, #255 ; 0xff 710c: 11a04003 movne r4, r3 if ( !_System_state_Is_up( _System_state_Get() ) ) { 7110: e59f34f4 ldr r3, [pc, #1268] ; 760c <_Heap_Walk+0x524> 7114: e5933000 ldr r3, [r3] bool dump ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; 7118: e590c020 ldr ip, [r0, #32] Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { 711c: e3530003 cmp r3, #3 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 7120: e1a06000 mov r6, r0 7124: e1a05001 mov r5, r1 uintptr_t const page_size = heap->page_size; 7128: e5909010 ldr r9, [r0, #16] uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; 712c: e58dc020 str ip, [sp, #32] Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { 7130: 1a000127 bne 75d4 <_Heap_Walk+0x4ec> 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)( 7134: e59dc024 ldr ip, [sp, #36] ; 0x24 7138: e58dc000 str ip, [sp] 713c: e5903018 ldr r3, [r0, #24] 7140: e58d3004 str r3, [sp, #4] 7144: e590301c ldr r3, [r0, #28] 7148: e59d2020 ldr r2, [sp, #32] 714c: e58d3008 str r3, [sp, #8] 7150: e59d3028 ldr r3, [sp, #40] ; 0x28 7154: e58d200c str r2, [sp, #12] 7158: e58d3010 str r3, [sp, #16] 715c: e5903008 ldr r3, [r0, #8] 7160: e58d3014 str r3, [sp, #20] 7164: e590300c ldr r3, [r0, #12] 7168: e59f24a0 ldr r2, [pc, #1184] ; 7610 <_Heap_Walk+0x528> 716c: e58d3018 str r3, [sp, #24] 7170: e1a00001 mov r0, r1 7174: e1a03009 mov r3, r9 7178: e3a01000 mov r1, #0 717c: e1a0e00f mov lr, pc 7180: e12fff14 bx r4 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 7184: e3590000 cmp r9, #0 7188: 1a000006 bne 71a8 <_Heap_Walk+0xc0> (*printer)( source, true, "page size is zero\n" ); 718c: e1a00005 mov r0, r5 7190: e3a01001 mov r1, #1 7194: e59f2478 ldr r2, [pc, #1144] ; 7614 <_Heap_Walk+0x52c> 7198: e1a0e00f mov lr, pc 719c: e12fff14 bx r4 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 71a0: e1a08009 mov r8, r9 71a4: ea00010b b 75d8 <_Heap_Walk+0x4f0> (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 71a8: e2198007 ands r8, r9, #7 (*printer)( 71ac: 11a00005 movne r0, r5 71b0: 13a01001 movne r1, #1 71b4: 159f245c ldrne r2, [pc, #1116] ; 7618 <_Heap_Walk+0x530> 71b8: 11a03009 movne r3, r9 71bc: 1a00010c bne 75f4 <_Heap_Walk+0x50c> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 71c0: e59d0024 ldr r0, [sp, #36] ; 0x24 71c4: e1a01009 mov r1, r9 71c8: ebffe785 bl fe4 <__umodsi3> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 71cc: e250b000 subs fp, r0, #0 71d0: 0a000006 beq 71f0 <_Heap_Walk+0x108> (*printer)( 71d4: e1a00005 mov r0, r5 71d8: e3a01001 mov r1, #1 71dc: e59f2438 ldr r2, [pc, #1080] ; 761c <_Heap_Walk+0x534> 71e0: e59d3024 ldr r3, [sp, #36] ; 0x24 71e4: e1a0e00f mov lr, pc 71e8: e12fff14 bx r4 71ec: ea0000f9 b 75d8 <_Heap_Walk+0x4f0> 71f0: e59dc020 ldr ip, [sp, #32] 71f4: e1a01009 mov r1, r9 71f8: e28c0008 add r0, ip, #8 71fc: ebffe778 bl fe4 <__umodsi3> ); return false; } if ( 7200: e250a000 subs sl, r0, #0 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 7204: 11a00005 movne r0, r5 7208: 13a01001 movne r1, #1 720c: 159f240c ldrne r2, [pc, #1036] ; 7620 <_Heap_Walk+0x538> 7210: 159d3020 ldrne r3, [sp, #32] 7214: 1a0000cc bne 754c <_Heap_Walk+0x464> 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; 7218: e59d2020 ldr r2, [sp, #32] 721c: e5928004 ldr r8, [r2, #4] ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 7220: e2188001 ands r8, r8, #1 (*printer)( 7224: 01a00005 moveq r0, r5 7228: 03a01001 moveq r1, #1 722c: 059f23f0 ldreq r2, [pc, #1008] ; 7624 <_Heap_Walk+0x53c> 7230: 0a000009 beq 725c <_Heap_Walk+0x174> - 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; 7234: e59d3028 ldr r3, [sp, #40] ; 0x28 7238: e5937004 ldr r7, [r3, #4] 723c: e3c77001 bic r7, r7, #1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 7240: e0837007 add r7, r3, r7 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; 7244: e5978004 ldr r8, [r7, #4] ); return false; } if ( _Heap_Is_free( last_block ) ) { 7248: e2188001 ands r8, r8, #1 724c: 1a000005 bne 7268 <_Heap_Walk+0x180> (*printer)( 7250: e59f23d0 ldr r2, [pc, #976] ; 7628 <_Heap_Walk+0x540> 7254: e1a00005 mov r0, r5 7258: e3a01001 mov r1, #1 725c: e1a0e00f mov lr, pc 7260: e12fff14 bx r4 7264: ea0000db b 75d8 <_Heap_Walk+0x4f0> ); return false; } if ( 7268: e59dc020 ldr ip, [sp, #32] 726c: e157000c cmp r7, ip 7270: 0a000006 beq 7290 <_Heap_Walk+0x1a8> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 7274: e1a00005 mov r0, r5 <== NOT EXECUTED 7278: e3a01001 mov r1, #1 <== NOT EXECUTED 727c: e59f23a8 ldr r2, [pc, #936] ; 762c <_Heap_Walk+0x544> <== NOT EXECUTED 7280: e1a0e00f mov lr, pc <== NOT EXECUTED 7284: e12fff14 bx r4 <== NOT EXECUTED if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 7288: e1a0800a mov r8, sl <== NOT EXECUTED 728c: ea0000d1 b 75d8 <_Heap_Walk+0x4f0> <== NOT EXECUTED int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 7290: e596b010 ldr fp, [r6, #16] block = next_block; } while ( block != first_block ); return true; } 7294: e5968008 ldr r8, [r6, #8] Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 7298: e1a0a006 mov sl, r6 729c: ea000034 b 7374 <_Heap_Walk+0x28c> 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; 72a0: e5963020 ldr r3, [r6, #32] 72a4: e1530008 cmp r3, r8 72a8: 83a0c000 movhi ip, #0 72ac: 8a000003 bhi 72c0 <_Heap_Walk+0x1d8> 72b0: e596c024 ldr ip, [r6, #36] ; 0x24 72b4: e15c0008 cmp ip, r8 72b8: 33a0c000 movcc ip, #0 72bc: 23a0c001 movcs ip, #1 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 ) ) { 72c0: e21cc0ff ands ip, ip, #255 ; 0xff (*printer)( 72c4: 01a00005 moveq r0, r5 72c8: 03a01001 moveq r1, #1 72cc: 059f235c ldreq r2, [pc, #860] ; 7630 <_Heap_Walk+0x548> 72d0: 0a000012 beq 7320 <_Heap_Walk+0x238> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 72d4: e2880008 add r0, r8, #8 72d8: e1a0100b mov r1, fp 72dc: ebffe740 bl fe4 <__umodsi3> ); return false; } if ( 72e0: e250c000 subs ip, r0, #0 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 72e4: 11a00005 movne r0, r5 72e8: 13a01001 movne r1, #1 72ec: 159f2340 ldrne r2, [pc, #832] ; 7634 <_Heap_Walk+0x54c> 72f0: 11a03008 movne r3, r8 72f4: 1a0000be bne 75f4 <_Heap_Walk+0x50c> - 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; 72f8: e5983004 ldr r3, [r8, #4] 72fc: e3c33001 bic r3, r3, #1 block = next_block; } while ( block != first_block ); return true; } 7300: e0883003 add r3, r8, r3 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; 7304: e5933004 ldr r3, [r3, #4] ); return false; } if ( _Heap_Is_used( free_block ) ) { 7308: e2133001 ands r3, r3, #1 730c: e58d302c str r3, [sp, #44] ; 0x2c 7310: 0a000009 beq 733c <_Heap_Walk+0x254> (*printer)( 7314: e59f231c ldr r2, [pc, #796] ; 7638 <_Heap_Walk+0x550> 7318: e1a00005 mov r0, r5 731c: e3a01001 mov r1, #1 7320: e1a03008 mov r3, r8 7324: e58dc01c str ip, [sp, #28] 7328: e1a0e00f mov lr, pc 732c: e12fff14 bx r4 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 7330: e59dc01c ldr ip, [sp, #28] 7334: e1a0800c mov r8, ip 7338: ea0000a6 b 75d8 <_Heap_Walk+0x4f0> ); return false; } if ( free_block->prev != prev_block ) { 733c: e598300c ldr r3, [r8, #12] 7340: e153000a cmp r3, sl 7344: 0a000008 beq 736c <_Heap_Walk+0x284> (*printer)( 7348: e58d3000 str r3, [sp] 734c: e1a00005 mov r0, r5 7350: e1a03008 mov r3, r8 7354: e3a01001 mov r1, #1 7358: e59f22dc ldr r2, [pc, #732] ; 763c <_Heap_Walk+0x554> 735c: e1a0e00f mov lr, pc 7360: e12fff14 bx r4 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 7364: e59d802c ldr r8, [sp, #44] ; 0x2c 7368: ea00009a b 75d8 <_Heap_Walk+0x4f0> return false; } prev_block = free_block; free_block = free_block->next; 736c: e1a0a008 mov sl, r8 7370: e5988008 ldr r8, [r8, #8] 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 ) { 7374: e1580006 cmp r8, r6 7378: 1affffc8 bne 72a0 <_Heap_Walk+0x1b8> 737c: ea000000 b 7384 <_Heap_Walk+0x29c> block->prev_size ); } block = next_block; } while ( block != first_block ); 7380: e1a07008 mov r7, r8 return true; } 7384: e5973004 ldr r3, [r7, #4] 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; 7388: e5962020 ldr r2, [r6, #32] - 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; 738c: e3c3a001 bic sl, r3, #1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 7390: e087800a add r8, r7, sl 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; 7394: e1520008 cmp r2, r8 7398: 83a0b000 movhi fp, #0 739c: 8a000003 bhi 73b0 <_Heap_Walk+0x2c8> 73a0: e596b024 ldr fp, [r6, #36] ; 0x24 73a4: e15b0008 cmp fp, r8 73a8: 33a0b000 movcc fp, #0 73ac: 23a0b001 movcs fp, #1 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; if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 73b0: e21bb0ff ands fp, fp, #255 ; 0xff 73b4: 1a000007 bne 73d8 <_Heap_Walk+0x2f0> (*printer)( 73b8: e58d8000 str r8, [sp] 73bc: e1a00005 mov r0, r5 73c0: e3a01001 mov r1, #1 73c4: e59f2274 ldr r2, [pc, #628] ; 7640 <_Heap_Walk+0x558> 73c8: e1a03007 mov r3, r7 73cc: e1a0e00f mov lr, pc 73d0: e12fff14 bx r4 73d4: ea00005e b 7554 <_Heap_Walk+0x46c> 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; 73d8: e59d2028 ldr r2, [sp, #40] ; 0x28 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 73dc: e1a0000a mov r0, sl 73e0: e1a01009 mov r1, r9 73e4: e057b002 subs fp, r7, r2 73e8: 13a0b001 movne fp, #1 73ec: e58d301c str r3, [sp, #28] 73f0: ebffe6fb bl fe4 <__umodsi3> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 73f4: e3500000 cmp r0, #0 73f8: e59d301c ldr r3, [sp, #28] 73fc: 0a000005 beq 7418 <_Heap_Walk+0x330> 7400: e35b0000 cmp fp, #0 (*printer)( 7404: 158da000 strne sl, [sp] 7408: 11a00005 movne r0, r5 740c: 13a01001 movne r1, #1 7410: 159f222c ldrne r2, [pc, #556] ; 7644 <_Heap_Walk+0x55c> 7414: 1a000014 bne 746c <_Heap_Walk+0x384> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 7418: e59dc024 ldr ip, [sp, #36] ; 0x24 741c: e15a000c cmp sl, ip 7420: 2a000009 bcs 744c <_Heap_Walk+0x364> 7424: e35b0000 cmp fp, #0 7428: 0a000007 beq 744c <_Heap_Walk+0x364> (*printer)( 742c: e88d1400 stm sp, {sl, ip} 7430: e1a00005 mov r0, r5 7434: e3a01001 mov r1, #1 7438: e59f2208 ldr r2, [pc, #520] ; 7648 <_Heap_Walk+0x560> 743c: e1a03007 mov r3, r7 7440: e1a0e00f mov lr, pc 7444: e12fff14 bx r4 7448: ea00006b b 75fc <_Heap_Walk+0x514> ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 744c: e1580007 cmp r8, r7 7450: 8a000009 bhi 747c <_Heap_Walk+0x394> 7454: e35b0000 cmp fp, #0 7458: 0a000007 beq 747c <_Heap_Walk+0x394> (*printer)( 745c: e58d8000 str r8, [sp] 7460: e59f21e4 ldr r2, [pc, #484] ; 764c <_Heap_Walk+0x564> 7464: e1a00005 mov r0, r5 7468: e3a01001 mov r1, #1 746c: e1a03007 mov r3, r7 7470: e1a0e00f mov lr, pc 7474: e12fff14 bx r4 7478: ea00005f b 75fc <_Heap_Walk+0x514> 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; 747c: e203b001 and fp, r3, #1 7480: e5983004 ldr r3, [r8, #4] ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 7484: e3130001 tst r3, #1 7488: 1a00003b bne 757c <_Heap_Walk+0x494> 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 ? 748c: e597200c ldr r2, [r7, #12] 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)( 7490: e5963008 ldr r3, [r6, #8] 7494: e1520003 cmp r2, r3 block = next_block; } while ( block != first_block ); return true; } 7498: e596100c ldr r1, [r6, #12] 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)( 749c: 059f01ac ldreq r0, [pc, #428] ; 7650 <_Heap_Walk+0x568> 74a0: 0a000003 beq 74b4 <_Heap_Walk+0x3cc> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 74a4: e59f31a8 ldr r3, [pc, #424] ; 7654 <_Heap_Walk+0x56c> 74a8: e1520006 cmp r2, r6 74ac: e59f01a4 ldr r0, [pc, #420] ; 7658 <_Heap_Walk+0x570> 74b0: 01a00003 moveq r0, r3 block->next, block->next == last_free_block ? 74b4: e5973008 ldr r3, [r7, #8] 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)( 74b8: e1530001 cmp r3, r1 74bc: 059f1198 ldreq r1, [pc, #408] ; 765c <_Heap_Walk+0x574> 74c0: 0a000003 beq 74d4 <_Heap_Walk+0x3ec> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 74c4: e59fc194 ldr ip, [pc, #404] ; 7660 <_Heap_Walk+0x578> 74c8: e1530006 cmp r3, r6 74cc: e59f1184 ldr r1, [pc, #388] ; 7658 <_Heap_Walk+0x570> 74d0: 01a0100c moveq r1, ip 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)( 74d4: e58d2004 str r2, [sp, #4] 74d8: e58d0008 str r0, [sp, #8] 74dc: e58d300c str r3, [sp, #12] 74e0: e58d1010 str r1, [sp, #16] 74e4: e1a03007 mov r3, r7 74e8: e58da000 str sl, [sp] 74ec: e1a00005 mov r0, r5 74f0: e3a01000 mov r1, #0 74f4: e59f2168 ldr r2, [pc, #360] ; 7664 <_Heap_Walk+0x57c> 74f8: e1a0e00f mov lr, pc 74fc: e12fff14 bx r4 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 7500: e5983000 ldr r3, [r8] 7504: e15a0003 cmp sl, r3 7508: 0a000009 beq 7534 <_Heap_Walk+0x44c> (*printer)( 750c: e58d3004 str r3, [sp, #4] 7510: e58da000 str sl, [sp] 7514: e58d8008 str r8, [sp, #8] 7518: e1a00005 mov r0, r5 751c: e3a01001 mov r1, #1 7520: e59f2140 ldr r2, [pc, #320] ; 7668 <_Heap_Walk+0x580> 7524: e1a03007 mov r3, r7 7528: e1a0e00f mov lr, pc 752c: e12fff14 bx r4 7530: ea000031 b 75fc <_Heap_Walk+0x514> ); return false; } if ( !prev_used ) { 7534: e35b0000 cmp fp, #0 7538: 1a000007 bne 755c <_Heap_Walk+0x474> (*printer)( 753c: e59f2128 ldr r2, [pc, #296] ; 766c <_Heap_Walk+0x584> 7540: e1a00005 mov r0, r5 7544: e3a01001 mov r1, #1 7548: e1a03007 mov r3, r7 754c: e1a0e00f mov lr, pc 7550: e12fff14 bx r4 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 7554: e1a0800b mov r8, fp 7558: ea00001e b 75d8 <_Heap_Walk+0x4f0> block = next_block; } while ( block != first_block ); return true; } 755c: e5963008 ldr r3, [r6, #8] 7560: ea000002 b 7570 <_Heap_Walk+0x488> { 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 ) { 7564: e1530007 cmp r3, r7 7568: 0a000016 beq 75c8 <_Heap_Walk+0x4e0> return true; } free_block = free_block->next; 756c: e5933008 ldr r3, [r3, #8] ) { 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 ) { 7570: e1530006 cmp r3, r6 7574: 1afffffa bne 7564 <_Heap_Walk+0x47c> 7578: ea000019 b 75e4 <_Heap_Walk+0x4fc> if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 757c: e35b0000 cmp fp, #0 7580: 0a000007 beq 75a4 <_Heap_Walk+0x4bc> (*printer)( 7584: e58da000 str sl, [sp] 7588: e1a00005 mov r0, r5 758c: e3a01000 mov r1, #0 7590: e59f20d8 ldr r2, [pc, #216] ; 7670 <_Heap_Walk+0x588> 7594: e1a03007 mov r3, r7 7598: e1a0e00f mov lr, pc 759c: e12fff14 bx r4 75a0: ea000008 b 75c8 <_Heap_Walk+0x4e0> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 75a4: e58da000 str sl, [sp] 75a8: e5973000 ldr r3, [r7] 75ac: e1a00005 mov r0, r5 75b0: e58d3004 str r3, [sp, #4] 75b4: e1a0100b mov r1, fp 75b8: e59f20b4 ldr r2, [pc, #180] ; 7674 <_Heap_Walk+0x58c> 75bc: e1a03007 mov r3, r7 75c0: e1a0e00f mov lr, pc 75c4: e12fff14 bx r4 block->prev_size ); } block = next_block; } while ( block != first_block ); 75c8: e59d2020 ldr r2, [sp, #32] 75cc: e1580002 cmp r8, r2 75d0: 1affff6a bne 7380 <_Heap_Walk+0x298> Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; 75d4: e3a08001 mov r8, #1 block = next_block; } while ( block != first_block ); return true; } 75d8: e1a00008 mov r0, r8 75dc: e28dd030 add sp, sp, #48 ; 0x30 75e0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 75e4: e59f208c ldr r2, [pc, #140] ; 7678 <_Heap_Walk+0x590> 75e8: e1a00005 mov r0, r5 75ec: e3a01001 mov r1, #1 75f0: e1a03007 mov r3, r7 75f4: e1a0e00f mov lr, pc 75f8: e12fff14 bx r4 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 75fc: e3a08000 mov r8, #0 7600: eafffff4 b 75d8 <_Heap_Walk+0x4f0> =============================================================================== 00005d78 : ) { rtems_aio_request *req; int mode; if (op != O_SYNC) 5d78: e3500a02 cmp r0, #8192 ; 0x2000 int aio_fsync( int op, struct aiocb *aiocbp ) { 5d7c: e92d4030 push {r4, r5, lr} 5d80: e1a04001 mov r4, r1 rtems_aio_request *req; int mode; if (op != O_SYNC) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 5d84: 13a05016 movne r5, #22 ) { rtems_aio_request *req; int mode; if (op != O_SYNC) 5d88: 1a00000c bne 5dc0 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); 5d8c: e5910000 ldr r0, [r1] 5d90: e3a01003 mov r1, #3 5d94: eb00199e bl c414 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 5d98: e2000003 and r0, r0, #3 5d9c: e2400001 sub r0, r0, #1 5da0: e3500001 cmp r0, #1 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 5da4: 83a05009 movhi r5, #9 if (op != O_SYNC) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 5da8: 8a000004 bhi 5dc0 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); 5dac: e3a00018 mov r0, #24 5db0: ebfff537 bl 3294 if (req == NULL) 5db4: e2503000 subs r3, r0, #0 5db8: 1a000007 bne 5ddc rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 5dbc: e3a0500b mov r5, #11 <== NOT EXECUTED 5dc0: e3e03000 mvn r3, #0 5dc4: e5845030 str r5, [r4, #48] ; 0x30 5dc8: e5843034 str r3, [r4, #52] ; 0x34 5dcc: eb0026a8 bl f874 <__errno> 5dd0: e5805000 str r5, [r0] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); } 5dd4: e3e00000 mvn r0, #0 5dd8: e8bd8030 pop {r4, r5, pc} req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 5ddc: e5834014 str r4, [r3, #20] req->aiocbp->aio_lio_opcode = LIO_SYNC; 5de0: e3a03003 mov r3, #3 5de4: e584302c str r3, [r4, #44] ; 0x2c return rtems_aio_enqueue (req); } 5de8: e8bd4030 pop {r4, r5, lr} rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); 5dec: ea00013b b 62e0 =============================================================================== 000064e8 : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 64e8: e92d4030 push {r4, r5, lr} rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 64ec: e3a01003 mov r1, #3 * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 64f0: e1a04000 mov r4, r0 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 64f4: e5900000 ldr r0, [r0] 64f8: eb0017c5 bl c414 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 64fc: e2000003 and r0, r0, #3 6500: e3500002 cmp r0, #2 6504: 13500000 cmpne r0, #0 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 6508: 13a05009 movne r5, #9 { rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 650c: 1a00000d bne 6548 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 6510: e5943014 ldr r3, [r4, #20] 6514: e3530000 cmp r3, #0 6518: 1a000007 bne 653c rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 651c: e5943008 ldr r3, [r4, #8] 6520: e3530000 cmp r3, #0 6524: ba000004 blt 653c rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 6528: e3a00018 mov r0, #24 652c: ebfff358 bl 3294 if (req == NULL) 6530: e2503000 subs r3, r0, #0 6534: 1a00000a bne 6564 6538: ea000001 b 6544 <== NOT EXECUTED if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 653c: e3a05016 mov r5, #22 6540: ea000000 b 6548 req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 6544: e3a0500b mov r5, #11 <== NOT EXECUTED 6548: e3e03000 mvn r3, #0 654c: e5845030 str r5, [r4, #48] ; 0x30 6550: e5843034 str r3, [r4, #52] ; 0x34 6554: eb0024c6 bl f874 <__errno> 6558: e5805000 str r5, [r0] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); } 655c: e3e00000 mvn r0, #0 6560: e8bd8030 pop {r4, r5, pc} req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 6564: e5834014 str r4, [r3, #20] req->aiocbp->aio_lio_opcode = LIO_READ; 6568: e3a03001 mov r3, #1 656c: e584302c str r3, [r4, #44] ; 0x2c return rtems_aio_enqueue (req); } 6570: e8bd4030 pop {r4, r5, lr} rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); 6574: eaffff59 b 62e0 =============================================================================== 00006580 : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 6580: e92d4030 push {r4, r5, lr} rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 6584: e3a01003 mov r1, #3 * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 6588: e1a04000 mov r4, r0 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 658c: e5900000 ldr r0, [r0] 6590: eb00179f bl c414 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 6594: e2000003 and r0, r0, #3 6598: e2400001 sub r0, r0, #1 659c: e3500001 cmp r0, #1 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 65a0: 83a05009 movhi r5, #9 { rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 65a4: 8a00000d bhi 65e0 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 65a8: e5943014 ldr r3, [r4, #20] 65ac: e3530000 cmp r3, #0 65b0: 1a000007 bne 65d4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 65b4: e5943008 ldr r3, [r4, #8] 65b8: e3530000 cmp r3, #0 65bc: ba000004 blt 65d4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 65c0: e3a00018 mov r0, #24 65c4: ebfff332 bl 3294 if (req == NULL) 65c8: e2503000 subs r3, r0, #0 65cc: 1a00000a bne 65fc 65d0: ea000001 b 65dc <== NOT EXECUTED if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 65d4: e3a05016 mov r5, #22 65d8: ea000000 b 65e0 req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 65dc: e3a0500b mov r5, #11 <== NOT EXECUTED 65e0: e3e03000 mvn r3, #0 65e4: e5845030 str r5, [r4, #48] ; 0x30 65e8: e5843034 str r3, [r4, #52] ; 0x34 65ec: eb0024a0 bl f874 <__errno> 65f0: e5805000 str r5, [r0] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); } 65f4: e3e00000 mvn r0, #0 65f8: e8bd8030 pop {r4, r5, pc} req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 65fc: e5834014 str r4, [r3, #20] req->aiocbp->aio_lio_opcode = LIO_WRITE; 6600: e3a03002 mov r3, #2 6604: e584302c str r3, [r4, #44] ; 0x2c return rtems_aio_enqueue (req); } 6608: e8bd4030 pop {r4, r5, lr} rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); 660c: eaffff33 b 62e0 =============================================================================== 00008a5c : const char *pathname, size_t pathnamelen, int flags, rtems_filesystem_location_info_t *pathloc ) { 8a5c: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} int i; rtems_device_name_t *device_name_table; /* see if 'flags' is valid */ if ( !rtems_libio_is_valid_perms( flags ) ) 8a60: e3d27007 bics r7, r2, #7 const char *pathname, size_t pathnamelen, int flags, rtems_filesystem_location_info_t *pathloc ) { 8a64: e1a09000 mov r9, r0 8a68: e1a04001 mov r4, r1 8a6c: e1a05003 mov r5, r3 int i; rtems_device_name_t *device_name_table; /* see if 'flags' is valid */ if ( !rtems_libio_is_valid_perms( flags ) ) 8a70: 0a000002 beq 8a80 rtems_set_errno_and_return_minus_one( EPERM ); 8a74: eb000997 bl b0d8 <__errno> <== NOT EXECUTED 8a78: e3a03001 mov r3, #1 <== NOT EXECUTED 8a7c: ea000005 b 8a98 <== NOT EXECUTED /* get the device name table */ device_name_table = (rtems_device_name_t *)pathloc->node_access; 8a80: e5936000 ldr r6, [r3] if (!device_name_table) 8a84: e3560000 cmp r6, #0 rtems_set_errno_and_return_minus_one( EFAULT ); for (i = 0; i < rtems_device_table_size; i++) { 8a88: 159fa094 ldrne sl, [pc, #148] ; 8b24 if ( !rtems_libio_is_valid_perms( flags ) ) rtems_set_errno_and_return_minus_one( EPERM ); /* get the device name table */ device_name_table = (rtems_device_name_t *)pathloc->node_access; if (!device_name_table) 8a8c: 1a00001c bne 8b04 rtems_set_errno_and_return_minus_one( EFAULT ); 8a90: eb000990 bl b0d8 <__errno> 8a94: e3a0300e mov r3, #14 8a98: e5803000 str r3, [r0] 8a9c: e3e00000 mvn r0, #0 8aa0: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} for (i = 0; i < rtems_device_table_size; i++) { if (!device_name_table[i].device_name) 8aa4: e5968000 ldr r8, [r6] 8aa8: e3580000 cmp r8, #0 8aac: 0a000012 beq 8afc continue; if (strncmp(pathname, device_name_table[i].device_name, pathnamelen) != 0) 8ab0: e1a00009 mov r0, r9 8ab4: e1a01008 mov r1, r8 8ab8: e1a02004 mov r2, r4 8abc: eb000d0c bl bef4 8ac0: e3500000 cmp r0, #0 8ac4: 1a00000c bne 8afc continue; if (device_name_table[i].device_name[pathnamelen] != '\0') 8ac8: e7d80004 ldrb r0, [r8, r4] 8acc: e3500000 cmp r0, #0 8ad0: 1a000009 bne 8afc continue; /* find the device, set proper values */ pathloc->node_access = (void *)&device_name_table[i]; pathloc->handlers = &devFS_file_handlers; 8ad4: e59f304c ldr r3, [pc, #76] ; 8b28 8ad8: e5853008 str r3, [r5, #8] pathloc->ops = &devFS_ops; 8adc: e59f3048 ldr r3, [pc, #72] ; 8b2c 8ae0: e585300c str r3, [r5, #12] pathloc->mt_entry = rtems_filesystem_root.mt_entry; 8ae4: e59f3044 ldr r3, [pc, #68] ; 8b30 8ae8: e5933000 ldr r3, [r3] 8aec: e5933028 ldr r3, [r3, #40] ; 0x28 if (device_name_table[i].device_name[pathnamelen] != '\0') continue; /* find the device, set proper values */ pathloc->node_access = (void *)&device_name_table[i]; 8af0: e5856000 str r6, [r5] pathloc->handlers = &devFS_file_handlers; pathloc->ops = &devFS_ops; pathloc->mt_entry = rtems_filesystem_root.mt_entry; 8af4: e5853010 str r3, [r5, #16] return 0; 8af8: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} /* get the device name table */ device_name_table = (rtems_device_name_t *)pathloc->node_access; if (!device_name_table) rtems_set_errno_and_return_minus_one( EFAULT ); for (i = 0; i < rtems_device_table_size; i++) { 8afc: e2877001 add r7, r7, #1 8b00: e2866014 add r6, r6, #20 8b04: e59a3000 ldr r3, [sl] 8b08: e1570003 cmp r7, r3 8b0c: 3affffe4 bcc 8aa4 pathloc->mt_entry = rtems_filesystem_root.mt_entry; return 0; } /* no such file or directory */ rtems_set_errno_and_return_minus_one( ENOENT ); 8b10: eb000970 bl b0d8 <__errno> 8b14: e3a03002 mov r3, #2 8b18: e5803000 str r3, [r0] 8b1c: e3e00000 mvn r0, #0 } 8b20: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} =============================================================================== 00002f50 : drainOutput (struct rtems_termios_tty *tty) { rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { 2f50: e59030b4 ldr r3, [r0, #180] ; 0xb4 2f54: e3530000 cmp r3, #0 /* * Drain output queue */ static void drainOutput (struct rtems_termios_tty *tty) { 2f58: e92d4030 push {r4, r5, lr} 2f5c: e1a04000 mov r4, r0 rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { 2f60: 08bd8030 popeq {r4, r5, pc} rtems_interrupt_disable (level); 2f64: ebfffff5 bl 2f40 while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { tty->rawOutBufState = rob_wait; 2f68: e3a05002 mov r5, #2 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) { 2f6c: ea000008 b 2f94 tty->rawOutBufState = rob_wait; 2f70: e5845094 str r5, [r4, #148] ; 0x94 <== NOT EXECUTED static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 2f74: e129f000 msr CPSR_fc, r0 <== NOT EXECUTED rtems_interrupt_enable (level); sc = rtems_semaphore_obtain( 2f78: e3a01000 mov r1, #0 <== NOT EXECUTED 2f7c: e594008c ldr r0, [r4, #140] ; 0x8c <== NOT EXECUTED 2f80: e1a02001 mov r2, r1 <== NOT EXECUTED 2f84: eb0008cc bl 52bc <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 2f88: e3500000 cmp r0, #0 <== NOT EXECUTED rtems_fatal_error_occurred (sc); 2f8c: 1b000a66 blne 592c <== NOT EXECUTED rtems_interrupt_disable (level); 2f90: ebffffea bl 2f40 <== NOT EXECUTED rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { 2f94: e5942084 ldr r2, [r4, #132] ; 0x84 2f98: e5943080 ldr r3, [r4, #128] ; 0x80 2f9c: e1520003 cmp r2, r3 2fa0: 1afffff2 bne 2f70 2fa4: e129f000 msr CPSR_fc, r0 2fa8: e8bd8030 pop {r4, r5, pc} =============================================================================== 00003c30 : * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) 3c30: e5903020 ldr r3, [r0, #32] 3c34: e3530000 cmp r3, #0 * 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) { 3c38: e92d41f0 push {r4, r5, r6, r7, r8, lr} 3c3c: e1a04000 mov r4, r0 3c40: e1a07001 mov r7, r1 if (tty->ccount == 0) 3c44: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc} return; if (lineFlag) { 3c48: e3510000 cmp r1, #0 3c4c: 0a000060 beq 3dd4 if (!(tty->termios.c_lflag & ECHO)) { 3c50: e590303c ldr r3, [r0, #60] ; 0x3c 3c54: e2132008 ands r2, r3, #8 tty->ccount = 0; 3c58: 05802020 streq r2, [r0, #32] erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) return; if (lineFlag) { if (!(tty->termios.c_lflag & ECHO)) { 3c5c: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc} tty->ccount = 0; return; } if (!(tty->termios.c_lflag & ECHOE)) { 3c60: e2133010 ands r3, r3, #16 3c64: 1a00005a bne 3dd4 tty->ccount = 0; 3c68: e5803020 str r3, [r0, #32] <== NOT EXECUTED echo (tty->termios.c_cc[VKILL], tty); 3c6c: e1a01004 mov r1, r4 <== NOT EXECUTED 3c70: e5d00044 ldrb r0, [r0, #68] ; 0x44 <== NOT EXECUTED 3c74: ebffffca bl 3ba4 <== NOT EXECUTED if (tty->termios.c_lflag & ECHOK) 3c78: e594303c ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED 3c7c: e3130020 tst r3, #32 <== NOT EXECUTED echo ('\n', tty); 3c80: 13a0000a movne r0, #10 <== NOT EXECUTED return; } if (!(tty->termios.c_lflag & ECHOE)) { tty->ccount = 0; echo (tty->termios.c_cc[VKILL], tty); if (tty->termios.c_lflag & ECHOK) 3c84: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED 3c88: ea00000b b 3cbc <== NOT EXECUTED return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 3c8c: e2411001 sub r1, r1, #1 if (tty->termios.c_lflag & ECHO) { 3c90: e594303c ldr r3, [r4, #60] ; 0x3c return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 3c94: e594001c ldr r0, [r4, #28] 3c98: e5841020 str r1, [r4, #32] if (tty->termios.c_lflag & ECHO) { 3c9c: e3130008 tst r3, #8 return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 3ca0: e7d05001 ldrb r5, [r0, r1] if (tty->termios.c_lflag & ECHO) { 3ca4: 0a000047 beq 3dc8 if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { 3ca8: e3570000 cmp r7, #0 3cac: 1a000005 bne 3cc8 3cb0: e3130010 tst r3, #16 3cb4: 1a000003 bne 3cc8 echo (tty->termios.c_cc[VERASE], tty); 3cb8: e5d40043 ldrb r0, [r4, #67] ; 0x43 <== NOT EXECUTED 3cbc: e1a01004 mov r1, r4 <== NOT EXECUTED } } if (!lineFlag) break; } } 3cc0: e8bd41f0 pop {r4, r5, r6, r7, r8, lr} <== 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); 3cc4: eaffffb6 b 3ba4 <== NOT EXECUTED } else if (c == '\t') { 3cc8: e3550009 cmp r5, #9 3ccc: 1a00001f bne 3d50 int col = tty->read_start_column; 3cd0: e594502c ldr r5, [r4, #44] ; 0x2c */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { 3cd4: e5968000 ldr r8, [r6] if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { echo (tty->termios.c_cc[VERASE], tty); } else if (c == '\t') { int col = tty->read_start_column; int i = 0; 3cd8: e3a02000 mov r2, #0 while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { if (tty->termios.c_lflag & ECHOCTL) 3cdc: e2033c02 and r3, r3, #512 ; 0x200 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 3ce0: ea00000c b 3d18 c = tty->cbuf[i++]; 3ce4: e7d0c002 ldrb ip, [r0, r2] if (c == '\t') { 3ce8: e35c0009 cmp ip, #9 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; 3cec: e2822001 add r2, r2, #1 if (c == '\t') { col = (col | 7) + 1; 3cf0: 03855007 orreq r5, r5, #7 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { 3cf4: 0a000006 beq 3d14 col = (col | 7) + 1; } else if (iscntrl (c)) { 3cf8: e088c00c add ip, r8, ip 3cfc: e5dcc001 ldrb ip, [ip, #1] 3d00: e31c0020 tst ip, #32 3d04: 0a000002 beq 3d14 if (tty->termios.c_lflag & ECHOCTL) 3d08: e3530000 cmp r3, #0 <== NOT EXECUTED col += 2; 3d0c: 12855002 addne r5, r5, #2 <== NOT EXECUTED 3d10: ea000000 b 3d18 <== NOT EXECUTED } else { col++; 3d14: e2855001 add r5, r5, #1 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 3d18: e1520001 cmp r2, r1 3d1c: 1afffff0 bne 3ce4 3d20: ea000006 b 3d40 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 3d24: e59f00bc ldr r0, [pc, #188] ; 3de8 3d28: e3a01001 mov r1, #1 3d2c: e1a02004 mov r2, r4 3d30: ebffff07 bl 3954 tty->column--; 3d34: e5943028 ldr r3, [r4, #40] ; 0x28 3d38: e2433001 sub r3, r3, #1 3d3c: e5843028 str r3, [r4, #40] ; 0x28 } /* * Back up over the tab */ while (tty->column > col) { 3d40: e5943028 ldr r3, [r4, #40] ; 0x28 3d44: e1530005 cmp r3, r5 3d48: cafffff5 bgt 3d24 3d4c: ea00001d b 3dc8 rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 3d50: e5962000 ldr r2, [r6] 3d54: e2855001 add r5, r5, #1 3d58: e7d22005 ldrb r2, [r2, r5] 3d5c: e3120020 tst r2, #32 3d60: 0a000009 beq 3d8c 3d64: e3130c02 tst r3, #512 ; 0x200 <== NOT EXECUTED 3d68: 0a000007 beq 3d8c <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 3d6c: e59f0078 ldr r0, [pc, #120] ; 3dec <== NOT EXECUTED 3d70: e3a01003 mov r1, #3 <== NOT EXECUTED 3d74: e1a02004 mov r2, r4 <== NOT EXECUTED 3d78: ebfffef5 bl 3954 <== NOT EXECUTED if (tty->column) 3d7c: e5943028 ldr r3, [r4, #40] ; 0x28 <== NOT EXECUTED 3d80: e3530000 cmp r3, #0 <== NOT EXECUTED tty->column--; 3d84: 12433001 subne r3, r3, #1 <== NOT EXECUTED 3d88: 15843028 strne r3, [r4, #40] ; 0x28 <== NOT EXECUTED } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { 3d8c: e5963000 ldr r3, [r6] 3d90: e7d33005 ldrb r3, [r3, r5] 3d94: e3130020 tst r3, #32 3d98: 0a000002 beq 3da8 3d9c: e594303c ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED 3da0: e3130c02 tst r3, #512 ; 0x200 <== NOT EXECUTED 3da4: 0a000007 beq 3dc8 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 3da8: e59f003c ldr r0, [pc, #60] ; 3dec 3dac: e3a01003 mov r1, #3 3db0: e1a02004 mov r2, r4 3db4: ebfffee6 bl 3954 if (tty->column) 3db8: e5943028 ldr r3, [r4, #40] ; 0x28 3dbc: e3530000 cmp r3, #0 tty->column--; 3dc0: 12433001 subne r3, r3, #1 3dc4: 15843028 strne r3, [r4, #40] ; 0x28 } } } if (!lineFlag) 3dc8: e3570000 cmp r7, #0 3dcc: 1a000001 bne 3dd8 3dd0: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} 3dd4: e59f6014 ldr r6, [pc, #20] ; 3df0 echo ('\n', tty); return; } } while (tty->ccount) { 3dd8: e5941020 ldr r1, [r4, #32] 3ddc: e3510000 cmp r1, #0 3de0: 1affffa9 bne 3c8c 3de4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} =============================================================================== 000029ec : int fcntl( int fd, int cmd, ... ) { 29ec: e92d000e push {r1, r2, r3} 29f0: e92d40f1 push {r0, r4, r5, r6, r7, lr} int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 29f4: e59f21a4 ldr r2, [pc, #420] ; 2ba0 29f8: e5921000 ldr r1, [r2] ... ) { int ret; va_list ap; va_start( ap, cmd ); 29fc: e28d301c add r3, sp, #28 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 2a00: e1500001 cmp r0, r1 int fcntl( int fd, int cmd, ... ) { 2a04: e59d7018 ldr r7, [sp, #24] int ret; va_list ap; va_start( ap, cmd ); 2a08: e58d3000 str r3, [sp] int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 2a0c: 2a000006 bcs 2a2c iop = rtems_libio_iop( fd ); 2a10: e59f218c ldr r2, [pc, #396] ; 2ba4 2a14: e5922000 ldr r2, [r2] 2a18: e3a04038 mov r4, #56 ; 0x38 2a1c: e0242490 mla r4, r0, r4, r2 rtems_libio_check_is_open(iop); 2a20: e5940014 ldr r0, [r4, #20] 2a24: e3100c01 tst r0, #256 ; 0x100 2a28: 1a000002 bne 2a38 2a2c: eb002d1c bl dea4 <__errno> 2a30: e3a03009 mov r3, #9 2a34: ea000047 b 2b58 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 2a38: e3570009 cmp r7, #9 2a3c: 979ff107 ldrls pc, [pc, r7, lsl #2] 2a40: ea000042 b 2b50 2a44: 00002a6c .word 0x00002a6c 2a48: 00002adc .word 0x00002adc 2a4c: 00002aec .word 0x00002aec 2a50: 00002b0c .word 0x00002b0c 2a54: 00002b18 .word 0x00002b18 2a58: 00002b44 .word 0x00002b44 2a5c: 00002b44 .word 0x00002b44 2a60: 00002b44 .word 0x00002b44 2a64: 00002b44 .word 0x00002b44 2a68: 00002b44 .word 0x00002b44 case F_DUPFD: /* dup */ fd2 = va_arg( ap, int ); 2a6c: e5933000 ldr r3, [r3] if ( fd2 ) 2a70: e3530000 cmp r3, #0 2a74: 0a000004 beq 2a8c diop = rtems_libio_iop( fd2 ); 2a78: e1530001 cmp r3, r1 2a7c: 33a06038 movcc r6, #56 ; 0x38 2a80: 30262693 mlacc r6, r3, r6, r2 2a84: 3a000005 bcc 2aa0 2a88: ea000003 b 2a9c <== NOT EXECUTED else { /* allocate a file control block */ diop = rtems_libio_allocate(); 2a8c: eb000190 bl 30d4 if ( diop == 0 ) { 2a90: e2506000 subs r6, r0, #0 2a94: 1a000001 bne 2aa0 2a98: ea00003b b 2b8c <== NOT EXECUTED switch ( cmd ) { case F_DUPFD: /* dup */ fd2 = va_arg( ap, int ); if ( fd2 ) diop = rtems_libio_iop( fd2 ); 2a9c: e3a06000 mov r6, #0 <== NOT EXECUTED ret = -1; break; } } diop->flags = iop->flags; 2aa0: e5943014 ldr r3, [r4, #20] diop->pathinfo = iop->pathinfo; 2aa4: e2845018 add r5, r4, #24 ret = -1; break; } } diop->flags = iop->flags; 2aa8: e5863014 str r3, [r6, #20] diop->pathinfo = iop->pathinfo; 2aac: e8b5000f ldm r5!, {r0, r1, r2, r3} 2ab0: e286c018 add ip, r6, #24 2ab4: e8ac000f stmia ip!, {r0, r1, r2, r3} 2ab8: e5953000 ldr r3, [r5] 2abc: e58c3000 str r3, [ip] ret = (int) (diop - rtems_libio_iops); 2ac0: e59f30dc ldr r3, [pc, #220] ; 2ba4 2ac4: e5933000 ldr r3, [r3] 2ac8: e0636006 rsb r6, r3, r6 2acc: e59f30d4 ldr r3, [pc, #212] ; 2ba8 2ad0: e1a061c6 asr r6, r6, #3 2ad4: e0060693 mul r6, r3, r6 2ad8: ea000020 b 2b60 break; case F_GETFD: /* get f_flags */ ret = ((iop->flags & LIBIO_FLAGS_CLOSE_ON_EXEC) != 0); 2adc: e3100b02 tst r0, #2048 ; 0x800 2ae0: 03a06000 moveq r6, #0 2ae4: 13a06001 movne r6, #1 2ae8: ea00001e b 2b68 * 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 ) ) 2aec: e5936000 ldr r6, [r3] 2af0: e3560000 cmp r6, #0 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 2af4: 13800b02 orrne r0, r0, #2048 ; 0x800 else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 2af8: 03c00b02 biceq r0, r0, #2048 ; 0x800 * processes, then we can ignore this one except to make * F_GETFD work. */ if ( va_arg( ap, int ) ) iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 2afc: 15840014 strne r0, [r4, #20] else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 2b00: 05840014 streq r0, [r4, #20] * 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 ) ) 2b04: 0a000017 beq 2b68 2b08: ea00000b b 2b3c else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); 2b0c: eb00015e bl 308c 2b10: e1a06000 mov r6, r0 2b14: ea000011 b 2b60 break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 2b18: e5930000 ldr r0, [r3] 2b1c: eb00014d bl 3058 /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); 2b20: e5942014 ldr r2, [r4, #20] 2b24: e59f3080 ldr r3, [pc, #128] ; 2bac 2b28: e3c22c02 bic r2, r2, #512 ; 0x200 2b2c: e0003003 and r3, r0, r3 2b30: e3c22001 bic r2, r2, #1 2b34: e1833002 orr r3, r3, r2 2b38: e5843014 str r3, [r4, #20] rtems_libio_t *iop; rtems_libio_t *diop; int fd2; int flags; int mask; int ret = 0; 2b3c: e3a06000 mov r6, #0 2b40: ea000008 b 2b68 errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 2b44: eb002cd6 bl dea4 <__errno> 2b48: e3a03086 mov r3, #134 ; 0x86 2b4c: ea000001 b 2b58 ret = -1; break; default: errno = EINVAL; 2b50: eb002cd3 bl dea4 <__errno> 2b54: e3a03016 mov r3, #22 2b58: e5803000 str r3, [r0] 2b5c: ea00000a b 2b8c /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 2b60: e3560000 cmp r6, #0 2b64: ba000009 blt 2b90 int err = (*iop->pathinfo.handlers->fcntl_h)( cmd, iop ); 2b68: e5943020 ldr r3, [r4, #32] 2b6c: e1a01004 mov r1, r4 2b70: e1a00007 mov r0, r7 2b74: e1a0e00f mov lr, pc 2b78: e593f030 ldr pc, [r3, #48] ; 0x30 if (err) { 2b7c: e2504000 subs r4, r0, #0 2b80: 0a000002 beq 2b90 errno = err; 2b84: eb002cc6 bl dea4 <__errno> <== NOT EXECUTED 2b88: e5804000 str r4, [r0] <== NOT EXECUTED ret = -1; 2b8c: e3e06000 mvn r6, #0 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 2b90: e1a00006 mov r0, r6 2b94: e8bd40f8 pop {r3, r4, r5, r6, r7, lr} 2b98: e28dd00c add sp, sp, #12 2b9c: e12fff1e bx lr =============================================================================== 0000b818 : */ int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { b818: e92d45f7 push {r0, r1, r2, r4, r5, r6, r7, r8, sl, lr} static rtems_status_code pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { b81c: e59f53bc ldr r5, [pc, #956] ; bbe0 b820: e5954000 ldr r4, [r5] b824: e3540000 cmp r4, #0 */ int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { b828: e1a08000 mov r8, r0 b82c: e1a07001 mov r7, r1 static rtems_status_code pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { b830: 1a000012 bne b880 rtems_status_code rtems_libio_set_private_env(void); rtems_status_code rtems_libio_share_private_env(rtems_id task_id) ; static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); b834: e59f33a8 ldr r3, [pc, #936] ; bbe4 b838: e1a01004 mov r1, r4 b83c: e5930000 ldr r0, [r3] b840: e1a02004 mov r2, r4 b844: ebffeea9 bl 72f0 rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { b848: e5953000 ldr r3, [r5] b84c: e3530000 cmp r3, #0 b850: 1a000005 bne b86c sc = rtems_semaphore_create( b854: e59f038c ldr r0, [pc, #908] ; bbe8 b858: e3a01001 mov r1, #1 b85c: e3a02054 mov r2, #84 ; 0x54 b860: e58d5000 str r5, [sp] b864: ebffee0f bl 70a8 b868: e1a04000 mov r4, r0 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); b86c: e59f3370 ldr r3, [pc, #880] ; bbe4 b870: e5930000 ldr r0, [r3] b874: ebffeee3 bl 7408 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { b878: e3540000 cmp r4, #0 b87c: 1a000006 bne b89c sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); b880: e59f3358 ldr r3, [pc, #856] ; bbe0 b884: e3a01000 mov r1, #0 b888: e5930000 ldr r0, [r3] b88c: e1a02001 mov r2, r1 b890: ebffee96 bl 72f0 } if (sc == RTEMS_SUCCESSFUL) { b894: e2505000 subs r5, r0, #0 b898: 0a000000 beq b8a0 return 0; } else { return -ENOMEM; b89c: e3e0500b mvn r5, #11 { pipe_control_t *pipe; int err = 0; err = pipe_lock(); if (err) b8a0: e2556000 subs r6, r5, #0 b8a4: 1a0000cb bne bbd8 return err; pipe = *pipep; b8a8: e5984000 ldr r4, [r8] if (pipe == NULL) { b8ac: e3540000 cmp r4, #0 b8b0: 1a00004d bne b9ec { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); b8b4: e3a00034 mov r0, #52 ; 0x34 b8b8: ebffe2ab bl 436c if (pipe == NULL) b8bc: e250a000 subs sl, r0, #0 { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); b8c0: e1a04000 mov r4, r0 if (pipe == NULL) b8c4: 0a000046 beq b9e4 return err; memset(pipe, 0, sizeof(pipe_control_t)); b8c8: e1a01005 mov r1, r5 b8cc: e3a02034 mov r2, #52 ; 0x34 b8d0: eb001281 bl 102dc pipe->Size = PIPE_BUF; b8d4: e3a00c02 mov r0, #512 ; 0x200 b8d8: e5840004 str r0, [r4, #4] pipe->Buffer = malloc(pipe->Size); b8dc: ebffe2a2 bl 436c if (! pipe->Buffer) b8e0: e3500000 cmp r0, #0 if (pipe == NULL) return err; memset(pipe, 0, sizeof(pipe_control_t)); pipe->Size = PIPE_BUF; pipe->Buffer = malloc(pipe->Size); b8e4: e5840000 str r0, [r4] if (! pipe->Buffer) b8e8: 0a00003b beq b9dc goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), b8ec: e59f62f8 ldr r6, [pc, #760] ; bbec if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( b8f0: e59f02f8 ldr r0, [pc, #760] ; bbf0 rtems_build_name ('P', 'I', 'r', c), b8f4: e5d63000 ldrb r3, [r6] if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( b8f8: e1a01005 mov r1, r5 b8fc: e1830000 orr r0, r3, r0 b900: e1a02005 mov r2, r5 b904: e284302c add r3, r4, #44 ; 0x2c b908: eb00061c bl d180 b90c: e3500000 cmp r0, #0 b910: 1a00002f bne b9d4 rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'w', c), b914: e5d63000 ldrb r3, [r6] 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( b918: e59f02d4 ldr r0, [pc, #724] ; bbf4 b91c: e1a01005 mov r1, r5 b920: e1830000 orr r0, r3, r0 b924: e1a02005 mov r2, r5 b928: e2843030 add r3, r4, #48 ; 0x30 b92c: eb000613 bl d180 b930: e3500000 cmp r0, #0 b934: 1a000024 bne b9cc rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( rtems_build_name ('P', 'I', 's', c), 1, b938: e5d63000 ldrb r3, [r6] 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( b93c: e59f02b4 ldr r0, [pc, #692] ; bbf8 b940: e2842028 add r2, r4, #40 ; 0x28 b944: e58d2000 str r2, [sp] b948: e1830000 orr r0, r3, r0 b94c: e3a01001 mov r1, #1 b950: e3a02010 mov r2, #16 b954: e1a03005 mov r3, r5 b958: ebffedd2 bl 70a8 b95c: e3500000 cmp r0, #0 b960: 1a000017 bne b9c4 /* 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 b964: e28d5004 add r5, sp, #4 Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) _Objects_Get( &_Barrier_Information, id, location ); b968: e594102c ldr r1, [r4, #44] ; 0x2c b96c: e1a02005 mov r2, r5 b970: e59f0284 ldr r0, [pc, #644] ; bbfc b974: ebfff40c bl 89ac <_Objects_Get> |= STATES_INTERRUPTIBLE_BY_SIGNAL; b978: e590304c ldr r3, [r0, #76] ; 0x4c b97c: e3833201 orr r3, r3, #268435456 ; 0x10000000 b980: e580304c str r3, [r0, #76] ; 0x4c _Thread_Enable_dispatch(); b984: ebfff6ca bl 94b4 <_Thread_Enable_dispatch> b988: e1a02005 mov r2, r5 b98c: e5941030 ldr r1, [r4, #48] ; 0x30 b990: e59f0264 ldr r0, [pc, #612] ; bbfc b994: ebfff404 bl 89ac <_Objects_Get> _Barrier_Get(pipe->writeBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; b998: e590304c ldr r3, [r0, #76] ; 0x4c b99c: e3833201 orr r3, r3, #268435456 ; 0x10000000 b9a0: e580304c str r3, [r0, #76] ; 0x4c _Thread_Enable_dispatch(); b9a4: ebfff6c2 bl 94b4 <_Thread_Enable_dispatch> #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') b9a8: e5d63000 ldrb r3, [r6] b9ac: e353007a cmp r3, #122 ; 0x7a b9b0: e2832001 add r2, r3, #1 c = 'a'; b9b4: 03a03061 moveq r3, #97 ; 0x61 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') b9b8: e5c62000 strb r2, [r6] c = 'a'; b9bc: 05c63000 strbeq r3, [r6] b9c0: ea000009 b b9ec return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); b9c4: e59a0030 ldr r0, [sl, #48] ; 0x30 b9c8: eb00061c bl d240 err_wbar: rtems_barrier_delete(pipe->readBarrier); b9cc: e59a002c ldr r0, [sl, #44] ; 0x2c b9d0: eb00061a bl d240 err_rbar: free(pipe->Buffer); b9d4: e59a0000 ldr r0, [sl] b9d8: ebffe086 bl 3bf8 err_buf: free(pipe); b9dc: e1a0000a mov r0, sl b9e0: ebffe084 bl 3bf8 if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; b9e4: e3e0600b mvn r6, #11 b9e8: ea00000d b ba24 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) b9ec: e3a01000 mov r1, #0 b9f0: e5940028 ldr r0, [r4, #40] ; 0x28 b9f4: e1a02001 mov r2, r1 b9f8: ebffee3c bl 72f0 err = -EINTR; if (*pipep == NULL) { b9fc: e5983000 ldr r3, [r8] if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; ba00: e3500000 cmp r0, #0 ba04: 03a06000 moveq r6, #0 ba08: 13e06003 mvnne r6, #3 if (*pipep == NULL) { ba0c: e3530000 cmp r3, #0 ba10: 1a000003 bne ba24 if (err) ba14: e3560000 cmp r6, #0 pipe_free(pipe); else *pipep = pipe; ba18: 05884000 streq r4, [r8] if (! PIPE_LOCK(pipe)) err = -EINTR; if (*pipep == NULL) { if (err) pipe_free(pipe); ba1c: 11a00004 movne r0, r4 ba20: 1bffff43 blne b734 else *pipep = pipe; } out: pipe_unlock(); ba24: ebffff3e bl b724 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) ba28: e3560000 cmp r6, #0 ba2c: 1a000069 bne bbd8 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { ba30: e5973014 ldr r3, [r7, #20] ba34: e2033006 and r3, r3, #6 ba38: e3530004 cmp r3, #4 int err; err = pipe_new(pipep); if (err) return err; pipe = *pipep; ba3c: e5984000 ldr r4, [r8] switch (LIBIO_ACCMODE(iop)) { ba40: 0a000024 beq bad8 ba44: e3530006 cmp r3, #6 ba48: 0a000047 beq bb6c ba4c: e3530002 cmp r3, #2 ba50: 1a000059 bne bbbc case LIBIO_FLAGS_READ: pipe->readerCounter ++; ba54: e5943020 ldr r3, [r4, #32] ba58: e2833001 add r3, r3, #1 ba5c: e5843020 str r3, [r4, #32] if (pipe->Readers ++ == 0) ba60: e5943010 ldr r3, [r4, #16] ba64: e2832001 add r2, r3, #1 ba68: e3530000 cmp r3, #0 ba6c: e5842010 str r2, [r4, #16] PIPE_WAKEUPWRITERS(pipe); ba70: 05940030 ldreq r0, [r4, #48] ; 0x30 ba74: 028d1008 addeq r1, sp, #8 ba78: 0b000618 bleq d2e0 if (pipe->Writers == 0) { ba7c: e5943014 ldr r3, [r4, #20] ba80: e3530000 cmp r3, #0 ba84: 1a00004c bne bbbc /* Not an error */ if (LIBIO_NODELAY(iop)) ba88: e5973014 ldr r3, [r7, #20] ba8c: e3130001 tst r3, #1 ba90: 1a000049 bne bbbc break; prevCounter = pipe->writerCounter; ba94: e5945024 ldr r5, [r4, #36] ; 0x24 err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); ba98: e5940028 ldr r0, [r4, #40] ; 0x28 ba9c: ebffee59 bl 7408 if (! PIPE_READWAIT(pipe)) baa0: e3a01000 mov r1, #0 baa4: e594002c ldr r0, [r4, #44] ; 0x2c baa8: eb000622 bl d338 baac: e2501000 subs r1, r0, #0 bab0: 1a000044 bne bbc8 goto out_error; if (! PIPE_LOCK(pipe)) bab4: e5940028 ldr r0, [r4, #40] ; 0x28 bab8: e1a02001 mov r2, r1 babc: ebffee0b bl 72f0 bac0: e3500000 cmp r0, #0 bac4: 1a00003f bne bbc8 goto out_error; } while (prevCounter == pipe->writerCounter); bac8: e5943024 ldr r3, [r4, #36] ; 0x24 bacc: e1550003 cmp r5, r3 bad0: 0afffff0 beq ba98 bad4: ea000038 b bbbc } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; bad8: e5943024 ldr r3, [r4, #36] ; 0x24 badc: e2833001 add r3, r3, #1 bae0: e5843024 str r3, [r4, #36] ; 0x24 if (pipe->Writers ++ == 0) bae4: e5943014 ldr r3, [r4, #20] bae8: e2832001 add r2, r3, #1 baec: e3530000 cmp r3, #0 baf0: e5842014 str r2, [r4, #20] PIPE_WAKEUPREADERS(pipe); baf4: 0594002c ldreq r0, [r4, #44] ; 0x2c baf8: 028d1008 addeq r1, sp, #8 bafc: 0b0005f7 bleq d2e0 if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { bb00: e5943010 ldr r3, [r4, #16] bb04: e3530000 cmp r3, #0 bb08: 1a00002b bne bbbc bb0c: e5973014 ldr r3, [r7, #20] bb10: e3130001 tst r3, #1 err = -ENXIO; goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; bb14: 05945020 ldreq r5, [r4, #32] pipe->writerCounter ++; if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { bb18: 0a000003 beq bb2c PIPE_UNLOCK(pipe); bb1c: e5940028 ldr r0, [r4, #40] ; 0x28 bb20: ebffee38 bl 7408 err = -ENXIO; bb24: e3e06005 mvn r6, #5 goto out_error; bb28: ea000027 b bbcc if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); bb2c: e5940028 ldr r0, [r4, #40] ; 0x28 bb30: ebffee34 bl 7408 if (! PIPE_WRITEWAIT(pipe)) bb34: e3a01000 mov r1, #0 bb38: e5940030 ldr r0, [r4, #48] ; 0x30 bb3c: eb0005fd bl d338 bb40: e2501000 subs r1, r0, #0 bb44: 1a00001f bne bbc8 goto out_error; if (! PIPE_LOCK(pipe)) bb48: e5940028 ldr r0, [r4, #40] ; 0x28 bb4c: e1a02001 mov r2, r1 bb50: ebffede6 bl 72f0 bb54: e3500000 cmp r0, #0 bb58: 1a00001a bne bbc8 goto out_error; } while (prevCounter == pipe->readerCounter); bb5c: e5943020 ldr r3, [r4, #32] bb60: e1550003 cmp r5, r3 bb64: 0afffff0 beq bb2c bb68: ea000013 b bbbc } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; bb6c: e5943020 ldr r3, [r4, #32] bb70: e2833001 add r3, r3, #1 bb74: e5843020 str r3, [r4, #32] if (pipe->Readers ++ == 0) bb78: e5943010 ldr r3, [r4, #16] bb7c: e2832001 add r2, r3, #1 bb80: e3530000 cmp r3, #0 bb84: e5842010 str r2, [r4, #16] PIPE_WAKEUPWRITERS(pipe); bb88: 05940030 ldreq r0, [r4, #48] ; 0x30 bb8c: 028d1008 addeq r1, sp, #8 bb90: 0b0005d2 bleq d2e0 pipe->writerCounter ++; bb94: e5943024 ldr r3, [r4, #36] ; 0x24 bb98: e2833001 add r3, r3, #1 bb9c: e5843024 str r3, [r4, #36] ; 0x24 if (pipe->Writers ++ == 0) bba0: e5943014 ldr r3, [r4, #20] bba4: e2832001 add r2, r3, #1 bba8: e3530000 cmp r3, #0 bbac: e5842014 str r2, [r4, #20] PIPE_WAKEUPREADERS(pipe); bbb0: 0594002c ldreq r0, [r4, #44] ; 0x2c bbb4: 028d1008 addeq r1, sp, #8 bbb8: 0b0005c8 bleq d2e0 break; } PIPE_UNLOCK(pipe); bbbc: e5940028 ldr r0, [r4, #40] ; 0x28 bbc0: ebffee10 bl 7408 return 0; bbc4: ea000003 b bbd8 goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; bbc8: e3e06003 mvn r6, #3 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); bbcc: e1a00008 mov r0, r8 bbd0: e1a01007 mov r1, r7 bbd4: ebfffee3 bl b768 return err; } bbd8: e1a00006 mov r0, r6 bbdc: e8bd85fe pop {r1, r2, r3, r4, r5, r6, r7, r8, sl, pc} =============================================================================== 00002c30 : { long return_value; rtems_libio_t *iop; rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); 2c30: e59f3104 ldr r3, [pc, #260] ; 2d3c 2c34: e5933000 ldr r3, [r3] 2c38: e1500003 cmp r0, r3 long fpathconf( int fd, int name ) { 2c3c: e52de004 push {lr} ; (str lr, [sp, #-4]!) long return_value; rtems_libio_t *iop; rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); 2c40: 2a000006 bcs 2c60 iop = rtems_libio_iop(fd); 2c44: e59f30f4 ldr r3, [pc, #244] ; 2d40 2c48: e5933000 ldr r3, [r3] 2c4c: e3a02038 mov r2, #56 ; 0x38 2c50: e0203092 mla r0, r2, r0, r3 rtems_libio_check_is_open(iop); 2c54: e5903014 ldr r3, [r0, #20] 2c58: e3130c01 tst r3, #256 ; 0x100 2c5c: 1a000002 bne 2c6c 2c60: eb002c8f bl dea4 <__errno> 2c64: e3a03009 mov r3, #9 2c68: ea000003 b 2c7c rtems_libio_check_permissions(iop, LIBIO_FLAGS_READ); 2c6c: e3130002 tst r3, #2 2c70: 1a000004 bne 2c88 2c74: eb002c8a bl dea4 <__errno> 2c78: e3a03016 mov r3, #22 2c7c: e5803000 str r3, [r0] 2c80: e3e00000 mvn r0, #0 2c84: e49df004 pop {pc} ; (ldr pc, [sp], #4) /* * Now process the information request. */ the_limits = &iop->pathinfo.mt_entry->pathconf_limits_and_options; 2c88: e5903028 ldr r3, [r0, #40] ; 0x28 switch ( name ) { 2c8c: e351000b cmp r1, #11 2c90: 979ff101 ldrls pc, [pc, r1, lsl #2] 2c94: ea000023 b 2d28 2c98: 00002cc8 .word 0x00002cc8 2c9c: 00002cd0 .word 0x00002cd0 2ca0: 00002cd8 .word 0x00002cd8 2ca4: 00002ce0 .word 0x00002ce0 2ca8: 00002ce8 .word 0x00002ce8 2cac: 00002cf0 .word 0x00002cf0 2cb0: 00002cf8 .word 0x00002cf8 2cb4: 00002d00 .word 0x00002d00 2cb8: 00002d08 .word 0x00002d08 2cbc: 00002d10 .word 0x00002d10 2cc0: 00002d18 .word 0x00002d18 2cc4: 00002d20 .word 0x00002d20 case _PC_LINK_MAX: return_value = the_limits->link_max; 2cc8: e5930038 ldr r0, [r3, #56] ; 0x38 break; 2ccc: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_MAX_CANON: return_value = the_limits->max_canon; 2cd0: e593003c ldr r0, [r3, #60] ; 0x3c break; 2cd4: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_MAX_INPUT: return_value = the_limits->max_input; 2cd8: e5930040 ldr r0, [r3, #64] ; 0x40 break; 2cdc: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_NAME_MAX: return_value = the_limits->name_max; 2ce0: e5930044 ldr r0, [r3, #68] ; 0x44 break; 2ce4: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_PATH_MAX: return_value = the_limits->path_max; 2ce8: e5930048 ldr r0, [r3, #72] ; 0x48 break; 2cec: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 2cf0: e593004c ldr r0, [r3, #76] ; 0x4c break; 2cf4: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 2cf8: e5930054 ldr r0, [r3, #84] ; 0x54 break; 2cfc: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 2d00: e5930058 ldr r0, [r3, #88] ; 0x58 break; 2d04: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 2d08: e5930064 ldr r0, [r3, #100] ; 0x64 break; 2d0c: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 2d10: e5930050 ldr r0, [r3, #80] ; 0x50 break; 2d14: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 2d18: e593005c ldr r0, [r3, #92] ; 0x5c break; 2d1c: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 2d20: e5930060 ldr r0, [r3, #96] ; 0x60 break; 2d24: e49df004 pop {pc} ; (ldr pc, [sp], #4) default: rtems_set_errno_and_return_minus_one( EINVAL ); 2d28: eb002c5d bl dea4 <__errno> 2d2c: e3a03016 mov r3, #22 2d30: e5803000 str r3, [r0] 2d34: e3e00000 mvn r0, #0 break; } return return_value; } 2d38: e49df004 pop {pc} ; (ldr pc, [sp], #4) =============================================================================== 0000c2d0 : IMFS_jnode_t *the_jnode; /* Is the node a directory ? */ the_jnode = (IMFS_jnode_t *) iop->pathinfo.node_access; if ( the_jnode->type != IMFS_DIRECTORY ) c2d0: e5903018 ldr r3, [r0, #24] c2d4: e593304c ldr r3, [r3, #76] ; 0x4c c2d8: e3530001 cmp r3, #1 rtems_libio_t *iop, const char *pathname, uint32_t flag, uint32_t mode ) { c2dc: e92d4010 push {r4, lr} IMFS_jnode_t *the_jnode; /* Is the node a directory ? */ the_jnode = (IMFS_jnode_t *) iop->pathinfo.node_access; if ( the_jnode->type != IMFS_DIRECTORY ) c2e0: 1a000005 bne c2fc return -1; /* It wasn't a directory --> return error */ iop->offset = 0; c2e4: e3a03000 mov r3, #0 c2e8: e3a04000 mov r4, #0 c2ec: e580300c str r3, [r0, #12] c2f0: e5804010 str r4, [r0, #16] return 0; c2f4: e3a00000 mov r0, #0 c2f8: e8bd8010 pop {r4, pc} /* Is the node a directory ? */ the_jnode = (IMFS_jnode_t *) iop->pathinfo.node_access; if ( the_jnode->type != IMFS_DIRECTORY ) return -1; /* It wasn't a directory --> return error */ c2fc: e3e00000 mvn r0, #0 <== NOT EXECUTED iop->offset = 0; return 0; } c300: e8bd8010 pop {r4, pc} <== NOT EXECUTED =============================================================================== 00003df4 : * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { if (tty->termios.c_iflag & ISTRIP) 3df4: e5913030 ldr r3, [r1, #48] ; 0x30 3df8: e3130020 tst r3, #32 /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 3dfc: e92d4030 push {r4, r5, lr} 3e00: e20050ff and r5, r0, #255 ; 0xff if (tty->termios.c_iflag & ISTRIP) c &= 0x7f; 3e04: 1200507f andne r5, r0, #127 ; 0x7f if (tty->termios.c_iflag & IUCLC) 3e08: e3130c02 tst r3, #512 ; 0x200 /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 3e0c: e1a04001 mov r4, r1 if (tty->termios.c_iflag & ISTRIP) c &= 0x7f; if (tty->termios.c_iflag & IUCLC) 3e10: 0a000007 beq 3e34 c = tolower (c); 3e14: e59f2164 ldr r2, [pc, #356] ; 3f80 3e18: e5922000 ldr r2, [r2] 3e1c: e0822005 add r2, r2, r5 3e20: e5d22001 ldrb r2, [r2, #1] 3e24: e2022003 and r2, r2, #3 3e28: e3520001 cmp r2, #1 3e2c: 02855020 addeq r5, r5, #32 3e30: e20550ff and r5, r5, #255 ; 0xff if (c == '\r') { 3e34: e355000d cmp r5, #13 3e38: 1a000005 bne 3e54 if (tty->termios.c_iflag & IGNCR) 3e3c: e3130080 tst r3, #128 ; 0x80 3e40: 1a000048 bne 3f68 return 0; if (tty->termios.c_iflag & ICRNL) c = '\n'; 3e44: e3130c01 tst r3, #256 ; 0x100 3e48: 03a0500d moveq r5, #13 3e4c: 13a0500a movne r5, #10 3e50: ea000007 b 3e74 } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { 3e54: e355000a cmp r5, #10 3e58: 1a000003 bne 3e6c c = '\r'; 3e5c: e3130040 tst r3, #64 ; 0x40 3e60: 03a0500a moveq r5, #10 3e64: 13a0500d movne r5, #13 3e68: ea000001 b 3e74 } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 3e6c: e3550000 cmp r5, #0 3e70: 0a00002c beq 3f28 3e74: e594303c ldr r3, [r4, #60] ; 0x3c 3e78: e3130002 tst r3, #2 3e7c: 0a000029 beq 3f28 if (c == tty->termios.c_cc[VERASE]) { 3e80: e5d42043 ldrb r2, [r4, #67] ; 0x43 3e84: e1520005 cmp r2, r5 erase (tty, 0); 3e88: 01a00004 moveq r0, r4 3e8c: 03a01000 moveq r1, #0 } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { if (c == tty->termios.c_cc[VERASE]) { 3e90: 0a000004 beq 3ea8 erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { 3e94: e5d42044 ldrb r2, [r4, #68] ; 0x44 3e98: e1520005 cmp r2, r5 3e9c: 1a000003 bne 3eb0 erase (tty, 1); 3ea0: e1a00004 mov r0, r4 3ea4: e3a01001 mov r1, #1 3ea8: ebffff60 bl 3c30 3eac: ea00002d b 3f68 return 0; } else if (c == tty->termios.c_cc[VEOF]) { 3eb0: e5d42045 ldrb r2, [r4, #69] ; 0x45 3eb4: e1520005 cmp r2, r5 3eb8: 0a00002c beq 3f70 return 1; } else if (c == '\n') { 3ebc: e355000a cmp r5, #10 3ec0: 1a000008 bne 3ee8 if (tty->termios.c_lflag & (ECHO | ECHONL)) 3ec4: e3130048 tst r3, #72 ; 0x48 echo (c, tty); 3ec8: 11a00005 movne r0, r5 3ecc: 11a01004 movne r1, r4 3ed0: 1bffff33 blne 3ba4 tty->cbuf[tty->ccount++] = c; 3ed4: e284201c add r2, r4, #28 3ed8: e892000c ldm r2, {r2, r3} 3edc: e3a0100a mov r1, #10 3ee0: e7c21003 strb r1, [r2, r3] 3ee4: ea00000c b 3f1c return 1; } else if ((c == tty->termios.c_cc[VEOL]) || 3ee8: e5d4204c ldrb r2, [r4, #76] ; 0x4c 3eec: e1520005 cmp r2, r5 3ef0: 0a000002 beq 3f00 3ef4: e5d42051 ldrb r2, [r4, #81] ; 0x51 3ef8: e1520005 cmp r2, r5 3efc: 1a000009 bne 3f28 (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) 3f00: e3130008 tst r3, #8 <== NOT EXECUTED echo (c, tty); 3f04: 11a00005 movne r0, r5 <== NOT EXECUTED 3f08: 11a01004 movne r1, r4 <== NOT EXECUTED 3f0c: 1bffff24 blne 3ba4 <== NOT EXECUTED tty->cbuf[tty->ccount++] = c; 3f10: e284201c add r2, r4, #28 <== NOT EXECUTED 3f14: e892000c ldm r2, {r2, r3} <== NOT EXECUTED 3f18: e7c25003 strb r5, [r2, r3] <== NOT EXECUTED 3f1c: e2833001 add r3, r3, #1 3f20: e5843020 str r3, [r4, #32] 3f24: ea000011 b 3f70 } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 3f28: e59f3054 ldr r3, [pc, #84] ; 3f84 3f2c: e5933008 ldr r3, [r3, #8] 3f30: e5942020 ldr r2, [r4, #32] 3f34: e2433001 sub r3, r3, #1 3f38: e1520003 cmp r2, r3 3f3c: aa00000d bge 3f78 if (tty->termios.c_lflag & ECHO) 3f40: e594303c ldr r3, [r4, #60] ; 0x3c 3f44: e3130008 tst r3, #8 echo (c, tty); 3f48: 11a00005 movne r0, r5 3f4c: 11a01004 movne r1, r4 3f50: 1bffff13 blne 3ba4 tty->cbuf[tty->ccount++] = c; 3f54: e284201c add r2, r4, #28 3f58: e892000c ldm r2, {r2, r3} 3f5c: e7c25003 strb r5, [r2, r3] 3f60: e2833001 add r3, r3, #1 3f64: e5843020 str r3, [r4, #32] if (tty->termios.c_iflag & IUCLC) c = tolower (c); if (c == '\r') { if (tty->termios.c_iflag & IGNCR) return 0; 3f68: e3a00000 mov r0, #0 3f6c: e8bd8030 pop {r4, r5, pc} else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { return 1; 3f70: e3a00001 mov r0, #1 3f74: e8bd8030 pop {r4, r5, pc} if (tty->ccount < (CBUFSIZE-1)) { if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; 3f78: e3a00000 mov r0, #0 <== NOT EXECUTED } 3f7c: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED =============================================================================== 0000c040 : rtems_off64_t memfile_lseek( rtems_libio_t *iop, rtems_off64_t offset, int whence ) { c040: e92d4030 push {r4, r5, lr} IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; c044: e5905018 ldr r5, [r0, #24] if (the_jnode->type == IMFS_LINEAR_FILE) { c048: e595304c ldr r3, [r5, #76] ; 0x4c c04c: e3530006 cmp r3, #6 rtems_off64_t memfile_lseek( rtems_libio_t *iop, rtems_off64_t offset, int whence ) { c050: e1a04000 mov r4, r0 IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; if (the_jnode->type == IMFS_LINEAR_FILE) { c054: 1a00000b bne c088 if (iop->offset > the_jnode->info.linearfile.size) c058: e5953054 ldr r3, [r5, #84] ; 0x54 c05c: e5901010 ldr r1, [r0, #16] c060: e1510003 cmp r1, r3 c064: e5952050 ldr r2, [r5, #80] ; 0x50 c068: ca000003 bgt c07c c06c: 1a000014 bne c0c4 c070: e590100c ldr r1, [r0, #12] c074: e1510002 cmp r1, r2 c078: 9a000011 bls c0c4 iop->offset = the_jnode->info.linearfile.size; c07c: e584200c str r2, [r4, #12] <== NOT EXECUTED c080: e5843010 str r3, [r4, #16] <== NOT EXECUTED c084: ea00000e b c0c4 <== NOT EXECUTED } else { /* Must be a block file (IMFS_MEMORY_FILE). */ if (IMFS_memfile_extend( the_jnode, iop->offset )) c088: e1a00005 mov r0, r5 c08c: e284200c add r2, r4, #12 c090: e8920006 ldm r2, {r1, r2} c094: ebfffeed bl bc50 c098: e3500000 cmp r0, #0 c09c: 0a000005 beq c0b8 rtems_set_errno_and_return_minus_one( ENOSPC ); c0a0: eb00039e bl cf20 <__errno> c0a4: e3a0301c mov r3, #28 c0a8: e5803000 str r3, [r0] c0ac: e3e04000 mvn r4, #0 c0b0: e3e03000 mvn r3, #0 c0b4: ea000004 b c0cc iop->size = the_jnode->info.file.size; c0b8: e2853050 add r3, r5, #80 ; 0x50 c0bc: e893000c ldm r3, {r2, r3} c0c0: e984000c stmib r4, {r2, r3} } return iop->offset; c0c4: e284400c add r4, r4, #12 c0c8: e8940018 ldm r4, {r3, r4} } c0cc: e1a00003 mov r0, r3 c0d0: e1a01004 mov r1, r4 c0d4: e8bd8030 pop {r4, r5, pc} =============================================================================== 0000bf4c : the_jnode = iop->pathinfo.node_access; /* * Perform 'copy on write' for linear files */ if ((iop->flags & (LIBIO_FLAGS_WRITE | LIBIO_FLAGS_APPEND)) bf4c: e5903014 ldr r3, [r0, #20] bf50: e3130f81 tst r3, #516 ; 0x204 rtems_libio_t *iop, const char *pathname, uint32_t flag, uint32_t mode ) { bf54: e92d4031 push {r0, r4, r5, lr} bf58: e1a05000 mov r5, r0 IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; bf5c: e5904018 ldr r4, [r0, #24] /* * Perform 'copy on write' for linear files */ if ((iop->flags & (LIBIO_FLAGS_WRITE | LIBIO_FLAGS_APPEND)) bf60: 0a000015 beq bfbc && (the_jnode->type == IMFS_LINEAR_FILE)) { bf64: e594304c ldr r3, [r4, #76] ; 0x4c bf68: e3530006 cmp r3, #6 bf6c: 1a000012 bne bfbc uint32_t count = the_jnode->info.linearfile.size; bf70: e594c050 ldr ip, [r4, #80] ; 0x50 <== NOT EXECUTED const unsigned char *buffer = the_jnode->info.linearfile.direct; the_jnode->type = IMFS_MEMORY_FILE; the_jnode->info.file.size = 0; the_jnode->info.file.indirect = 0; bf74: e3a00000 mov r0, #0 <== NOT EXECUTED if ((iop->flags & (LIBIO_FLAGS_WRITE | LIBIO_FLAGS_APPEND)) && (the_jnode->type == IMFS_LINEAR_FILE)) { uint32_t count = the_jnode->info.linearfile.size; const unsigned char *buffer = the_jnode->info.linearfile.direct; the_jnode->type = IMFS_MEMORY_FILE; bf78: e3a02005 mov r2, #5 <== NOT EXECUTED bf7c: e584204c str r2, [r4, #76] ; 0x4c <== NOT EXECUTED the_jnode->info.file.size = 0; bf80: e3a01000 mov r1, #0 <== NOT EXECUTED bf84: e3a02000 mov r2, #0 <== NOT EXECUTED the_jnode->info.file.indirect = 0; the_jnode->info.file.doubly_indirect = 0; the_jnode->info.file.triply_indirect = 0; if ((count != 0) bf88: e15c0000 cmp ip, r0 <== NOT EXECUTED * Perform 'copy on write' for linear files */ if ((iop->flags & (LIBIO_FLAGS_WRITE | LIBIO_FLAGS_APPEND)) && (the_jnode->type == IMFS_LINEAR_FILE)) { uint32_t count = the_jnode->info.linearfile.size; const unsigned char *buffer = the_jnode->info.linearfile.direct; bf8c: e5943058 ldr r3, [r4, #88] ; 0x58 <== NOT EXECUTED the_jnode->type = IMFS_MEMORY_FILE; the_jnode->info.file.size = 0; bf90: e5841050 str r1, [r4, #80] ; 0x50 <== NOT EXECUTED bf94: e5842054 str r2, [r4, #84] ; 0x54 <== NOT EXECUTED the_jnode->info.file.indirect = 0; bf98: e5840058 str r0, [r4, #88] ; 0x58 <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; bf9c: e584005c str r0, [r4, #92] ; 0x5c <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; bfa0: e5840060 str r0, [r4, #96] ; 0x60 <== NOT EXECUTED if ((count != 0) bfa4: 0a000004 beq bfbc <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) bfa8: e1a00004 mov r0, r4 <== NOT EXECUTED bfac: e58dc000 str ip, [sp] <== NOT EXECUTED bfb0: ebffff6d bl bd6c <== NOT EXECUTED bfb4: e3700001 cmn r0, #1 <== NOT EXECUTED bfb8: 0a000009 beq bfe4 <== NOT EXECUTED return -1; } if (iop->flags & LIBIO_FLAGS_APPEND) bfbc: e5953014 ldr r3, [r5, #20] bfc0: e3130c02 tst r3, #512 ; 0x200 iop->offset = the_jnode->info.file.size; bfc4: 12843050 addne r3, r4, #80 ; 0x50 bfc8: 1893000c ldmne r3, {r2, r3} bfcc: 1585200c strne r2, [r5, #12] bfd0: 15853010 strne r3, [r5, #16] iop->size = the_jnode->info.file.size; bfd4: e2844050 add r4, r4, #80 ; 0x50 bfd8: e8940018 ldm r4, {r3, r4} bfdc: e9850018 stmib r5, {r3, r4} return 0; bfe0: e3a00000 mov r0, #0 } bfe4: e8bd8038 pop {r3, r4, r5, pc} =============================================================================== 00002660 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 2660: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} /* * Are the file system options valid? */ if ( options != RTEMS_FILESYSTEM_READ_ONLY && 2664: e3530001 cmp r3, #1 const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 2668: e24dd02c sub sp, sp, #44 ; 0x2c 266c: e1a06000 mov r6, r0 2670: e1a0b001 mov fp, r1 2674: e1a0a002 mov sl, r2 2678: e58d300c str r3, [sp, #12] /* * Are the file system options valid? */ if ( options != RTEMS_FILESYSTEM_READ_ONLY && 267c: 8a000004 bhi 2694 rtems_set_errno_and_return_minus_one( EINVAL ); /* * Get mount handler */ mount_h = rtems_filesystem_get_mount_handler( filesystemtype ); 2680: e1a00002 mov r0, r2 2684: eb001d9b bl 9cf8 if ( !mount_h ) 2688: e3500000 cmp r0, #0 268c: e58d0014 str r0, [sp, #20] 2690: 1a000002 bne 26a0 rtems_set_errno_and_return_minus_one( EINVAL ); 2694: eb002a21 bl cf20 <__errno> 2698: e3a03016 mov r3, #22 269c: ea00003b b 2790 { rtems_filesystem_fsmount_me_t mount_h = NULL; rtems_filesystem_location_info_t loc; rtems_filesystem_mount_table_entry_t *mt_entry = NULL; rtems_filesystem_location_info_t *loc_to_free = NULL; bool has_target = target != NULL; 26a0: e25b5000 subs r5, fp, #0 26a4: 13a05001 movne r5, #1 const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; 26a8: e59f3258 ldr r3, [pc, #600] ; 2908 26ac: e3550000 cmp r5, #0 26b0: 11a0300b movne r3, fp size_t filesystemtype_size = strlen( filesystemtype ) + 1; 26b4: e1a0000a mov r0, sl const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; 26b8: e58d3004 str r3, [sp, #4] size_t filesystemtype_size = strlen( filesystemtype ) + 1; 26bc: eb002e01 bl dec8 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 26c0: e3560000 cmp r6, #0 const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; size_t filesystemtype_size = strlen( filesystemtype ) + 1; 26c4: e2809001 add r9, r0, #1 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 26c8: 01a07006 moveq r7, r6 26cc: 0a000002 beq 26dc 26d0: e1a00006 mov r0, r6 26d4: eb002dfb bl dec8 26d8: e2807001 add r7, r0, #1 size_t target_size = strlen( target ) + 1; 26dc: e59d0004 ldr r0, [sp, #4] 26e0: eb002df8 bl dec8 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size; 26e4: e2891074 add r1, r9, #116 ; 0x74 { const char *target = target_or_null != NULL ? target_or_null : "/"; size_t filesystemtype_size = strlen( filesystemtype ) + 1; size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; size_t target_size = strlen( target ) + 1; 26e8: e2803001 add r3, r0, #1 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size; 26ec: e0811007 add r1, r1, r7 { const char *target = target_or_null != NULL ? target_or_null : "/"; size_t filesystemtype_size = strlen( filesystemtype ) + 1; size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; size_t target_size = strlen( target ) + 1; 26f0: e58d0010 str r0, [sp, #16] size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size; rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); 26f4: e0811003 add r1, r1, r3 26f8: e3a00001 mov r0, #1 { const char *target = target_or_null != NULL ? target_or_null : "/"; size_t filesystemtype_size = strlen( filesystemtype ) + 1; size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; size_t target_size = strlen( target ) + 1; 26fc: e58d3008 str r3, [sp, #8] size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size; rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); 2700: ebfffe15 bl 1f5c if ( mt_entry != NULL ) { 2704: e2504000 subs r4, r0, #0 2708: 0a00001e beq 2788 char *str = (char *) mt_entry + sizeof( *mt_entry ); 270c: e2848074 add r8, r4, #116 ; 0x74 memcpy( str, filesystemtype, filesystemtype_size ); 2710: e1a00008 mov r0, r8 2714: e1a0100a mov r1, sl 2718: e1a02009 mov r2, r9 271c: eb002c2d bl d7d8 mt_entry->type = str; 2720: e584806c str r8, [r4, #108] ; 0x6c str += filesystemtype_size; 2724: e0888009 add r8, r8, r9 memcpy( str, source_or_null, source_size ); 2728: e1a00008 mov r0, r8 272c: e1a01006 mov r1, r6 2730: e1a02007 mov r2, r7 2734: eb002c27 bl d7d8 mt_entry->dev = str; 2738: e5848070 str r8, [r4, #112] ; 0x70 str += source_size; 273c: e0888007 add r8, r8, r7 memcpy( str, target, target_size ); 2740: e99d0006 ldmib sp, {r1, r2} 2744: e1a00008 mov r0, r8 2748: eb002c22 bl d7d8 ); if ( !mt_entry ) rtems_set_errno_and_return_minus_one( ENOMEM ); mt_entry->mt_fs_root.mt_entry = mt_entry; mt_entry->options = options; 274c: e59d300c ldr r3, [sp, #12] mt_entry->pathconf_limits_and_options = rtems_filesystem_default_pathconf; 2750: e59fe1b4 ldr lr, [pc, #436] ; 290c ); if ( !mt_entry ) rtems_set_errno_and_return_minus_one( ENOMEM ); mt_entry->mt_fs_root.mt_entry = mt_entry; mt_entry->options = options; 2754: e5843030 str r3, [r4, #48] ; 0x30 mt_entry->pathconf_limits_and_options = rtems_filesystem_default_pathconf; 2758: e8be000f ldm lr!, {r0, r1, r2, r3} 275c: e284c038 add ip, r4, #56 ; 0x38 2760: e8ac000f stmia ip!, {r0, r1, r2, r3} 2764: e8be000f ldm lr!, {r0, r1, r2, r3} 2768: e8ac000f stmia ip!, {r0, r1, r2, r3} 276c: e89e000f ldm lr, {r0, r1, r2, r3} /* * The mount_point should be a directory with read/write/execute * permissions in the existing tree. */ if ( has_target ) { 2770: e3550000 cmp r5, #0 memcpy( str, source_or_null, source_size ); mt_entry->dev = str; str += source_size; memcpy( str, target, target_size ); mt_entry->target = str; 2774: e5848068 str r8, [r4, #104] ; 0x68 &target_length ); if ( !mt_entry ) rtems_set_errno_and_return_minus_one( ENOMEM ); mt_entry->mt_fs_root.mt_entry = mt_entry; 2778: e584402c str r4, [r4, #44] ; 0x2c mt_entry->options = options; mt_entry->pathconf_limits_and_options = rtems_filesystem_default_pathconf; 277c: e88c000f stm ip, {r0, r1, r2, r3} /* * The mount_point should be a directory with read/write/execute * permissions in the existing tree. */ if ( has_target ) { 2780: 0a00002e beq 2840 2784: ea000003 b 2798 target, filesystemtype, &target_length ); if ( !mt_entry ) rtems_set_errno_and_return_minus_one( ENOMEM ); 2788: eb0029e4 bl cf20 <__errno> <== NOT EXECUTED 278c: e3a0300c mov r3, #12 <== NOT EXECUTED 2790: e5803000 str r3, [r0] 2794: ea000058 b 28fc * The mount_point should be a directory with read/write/execute * permissions in the existing tree. */ if ( has_target ) { if ( rtems_filesystem_evaluate_path( 2798: e3a03001 mov r3, #1 279c: e28d6018 add r6, sp, #24 27a0: e58d3000 str r3, [sp] 27a4: e1a0000b mov r0, fp 27a8: e59d1010 ldr r1, [sp, #16] 27ac: e3a02007 mov r2, #7 27b0: e1a03006 mov r3, r6 27b4: ebfffe17 bl 2018 27b8: e3700001 cmn r0, #1 27bc: 0a000048 beq 28e4 /* * Test to see if it is a directory */ if ( loc.ops->node_type_h( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 27c0: e1a00006 mov r0, r6 27c4: e59d3024 ldr r3, [sp, #36] ; 0x24 27c8: e1a0e00f mov lr, pc 27cc: e593f010 ldr pc, [r3, #16] 27d0: e3500001 cmp r0, #1 27d4: 0a000002 beq 27e4 errno = ENOTDIR; 27d8: eb0029d0 bl cf20 <__errno> 27dc: e3a03014 mov r3, #20 27e0: ea000006 b 2800 /* * You can only mount one file system onto a single mount point. */ if ( rtems_filesystem_mount_iterate( is_node_fs_root, loc.node_access ) ) { 27e4: e59f0124 ldr r0, [pc, #292] ; 2910 27e8: e59d1018 ldr r1, [sp, #24] 27ec: ebffff85 bl 2608 27f0: e3500000 cmp r0, #0 27f4: 0a000003 beq 2808 errno = EBUSY; 27f8: eb0029c8 bl cf20 <__errno> 27fc: e3a03010 mov r3, #16 2800: e5803000 str r3, [r0] goto cleanup_and_bail; 2804: ea000037 b 28e8 * may have been allocated in loc should not be sent to freenode * until the system is unmounted. It may be needed to correctly * traverse the tree. */ mt_entry->mt_point_node.node_access = loc.node_access; 2808: e59d3018 ldr r3, [sp, #24] 280c: e5843008 str r3, [r4, #8] mt_entry->mt_point_node.handlers = loc.handlers; 2810: e59d3020 ldr r3, [sp, #32] mt_entry->mt_point_node.ops = loc.ops; mt_entry->mt_point_node.mt_entry = loc.mt_entry; 2814: e59d2028 ldr r2, [sp, #40] ; 0x28 * until the system is unmounted. It may be needed to correctly * traverse the tree. */ mt_entry->mt_point_node.node_access = loc.node_access; mt_entry->mt_point_node.handlers = loc.handlers; 2818: e5843010 str r3, [r4, #16] mt_entry->mt_point_node.ops = loc.ops; 281c: e59d3024 ldr r3, [sp, #36] ; 0x24 mt_entry->mt_point_node.mt_entry = loc.mt_entry; 2820: e5842018 str r2, [r4, #24] * traverse the tree. */ mt_entry->mt_point_node.node_access = loc.node_access; mt_entry->mt_point_node.handlers = loc.handlers; mt_entry->mt_point_node.ops = loc.ops; 2824: e5843014 str r3, [r4, #20] /* * This link to the parent is only done when we are dealing with system * below the base file system */ if ( loc.ops->mount_h( mt_entry ) ) { 2828: e1a00004 mov r0, r4 282c: e1a0e00f mov lr, pc 2830: e593f020 ldr pc, [r3, #32] 2834: e3500000 cmp r0, #0 2838: 0a00000b beq 286c 283c: ea000029 b 28e8 <== NOT EXECUTED stop = (*routine)( mt_entry, routine_arg ); } rtems_libio_unlock(); return stop; } 2840: e59f30cc ldr r3, [pc, #204] ; 2914 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail( const Chain_Control *the_chain ) { return &the_chain->Tail.Node; 2844: e2832004 add r2, r3, #4 } } else { /* * Do we already have a base file system ? */ if ( !rtems_chain_is_empty( &mount_chain ) ) { 2848: e5933000 ldr r3, [r3] 284c: e1530002 cmp r3, r2 ) { rtems_filesystem_fsmount_me_t mount_h = NULL; rtems_filesystem_location_info_t loc; rtems_filesystem_mount_table_entry_t *mt_entry = NULL; rtems_filesystem_location_info_t *loc_to_free = NULL; 2850: 01a06005 moveq r6, r5 } } else { /* * Do we already have a base file system ? */ if ( !rtems_chain_is_empty( &mount_chain ) ) { 2854: 0a000004 beq 286c errno = EINVAL; 2858: eb0029b0 bl cf20 <__errno> 285c: e3a03016 mov r3, #22 2860: e5803000 str r3, [r0] ) { rtems_filesystem_fsmount_me_t mount_h = NULL; rtems_filesystem_location_info_t loc; rtems_filesystem_mount_table_entry_t *mt_entry = NULL; rtems_filesystem_location_info_t *loc_to_free = NULL; 2864: e1a06005 mov r6, r5 /* * Do we already have a base file system ? */ if ( !rtems_chain_is_empty( &mount_chain ) ) { errno = EINVAL; goto cleanup_and_bail; 2868: ea00001e b 28e8 * mt_point_node.node_access will be left to null to indicate that this * is the root of the entire file system. */ } if ( (*mount_h)( mt_entry, data ) ) { 286c: e1a00004 mov r0, r4 2870: e59d1050 ldr r1, [sp, #80] ; 0x50 2874: e59d3014 ldr r3, [sp, #20] 2878: e1a0e00f mov lr, pc 287c: e12fff13 bx r3 2880: e2507000 subs r7, r0, #0 2884: 0a000004 beq 289c /* * Try to undo the mount operation */ loc.ops->unmount_h( mt_entry ); 2888: e1a00004 mov r0, r4 288c: e59d3024 ldr r3, [sp, #36] ; 0x24 2890: e1a0e00f mov lr, pc 2894: e593f028 ldr pc, [r3, #40] ; 0x28 goto cleanup_and_bail; 2898: ea000012 b 28e8 } /* * Add the mount table entry to the mount table chain */ rtems_libio_lock(); 289c: ebffff4f bl 25e0 28a0: e59f006c ldr r0, [pc, #108] ; 2914 28a4: e1a01004 mov r1, r4 28a8: eb000cdc bl 5c20 <_Chain_Append> rtems_chain_append( &mount_chain, &mt_entry->Node ); rtems_libio_unlock(); 28ac: ebffff51 bl 25f8 if ( !has_target ) 28b0: e3550000 cmp r5, #0 rtems_filesystem_root = mt_entry->mt_fs_root; return 0; 28b4: 11a00007 movne r0, r7 */ rtems_libio_lock(); rtems_chain_append( &mount_chain, &mt_entry->Node ); rtems_libio_unlock(); if ( !has_target ) 28b8: 1a000010 bne 2900 rtems_filesystem_root = mt_entry->mt_fs_root; 28bc: e59f3054 ldr r3, [pc, #84] ; 2918 28c0: e284401c add r4, r4, #28 28c4: e593c000 ldr ip, [r3] 28c8: e8b4000f ldm r4!, {r0, r1, r2, r3} 28cc: e28cc018 add ip, ip, #24 28d0: e8ac000f stmia ip!, {r0, r1, r2, r3} 28d4: e5943000 ldr r3, [r4] return 0; 28d8: e1a00005 mov r0, r5 rtems_libio_lock(); rtems_chain_append( &mount_chain, &mt_entry->Node ); rtems_libio_unlock(); if ( !has_target ) rtems_filesystem_root = mt_entry->mt_fs_root; 28dc: e58c3000 str r3, [ip] 28e0: ea000006 b 2900 ) { rtems_filesystem_fsmount_me_t mount_h = NULL; rtems_filesystem_location_info_t loc; rtems_filesystem_mount_table_entry_t *mt_entry = NULL; rtems_filesystem_location_info_t *loc_to_free = NULL; 28e4: e3a06000 mov r6, #0 <== NOT EXECUTED return 0; cleanup_and_bail: free( mt_entry ); 28e8: e1a00004 mov r0, r4 28ec: ebfffdfe bl 20ec if ( loc_to_free ) 28f0: e3560000 cmp r6, #0 rtems_filesystem_freenode( loc_to_free ); 28f4: 11a00006 movne r0, r6 28f8: 1bfffdf6 blne 20d8 return -1; 28fc: e3e00000 mvn r0, #0 } 2900: e28dd02c add sp, sp, #44 ; 0x2c 2904: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00002920 : */ int newlib_free_buffers( FILE *fp ) { 2920: e92d4010 push {r4, lr} 2924: e1a04000 mov r4, r0 switch ( fileno(fp) ) { 2928: eb002a7f bl d32c 292c: e3500002 cmp r0, #2 2930: 8a00000b bhi 2964 case 0: case 1: case 2: if (fp->_flags & __SMBF) { 2934: e1d430bc ldrh r3, [r4, #12] 2938: e3130080 tst r3, #128 ; 0x80 293c: 0a00000a beq 296c free( fp->_bf._base ); 2940: e5940010 ldr r0, [r4, #16] 2944: ebfffde8 bl 20ec <== NOT EXECUTED fp->_flags &= ~__SMBF; 2948: e1d430bc ldrh r3, [r4, #12] <== NOT EXECUTED 294c: e3c33080 bic r3, r3, #128 ; 0x80 <== NOT EXECUTED 2950: e1c430bc strh r3, [r4, #12] <== NOT EXECUTED fp->_bf._base = fp->_p = (unsigned char *) NULL; 2954: e3a03000 mov r3, #0 <== NOT EXECUTED 2958: e5843000 str r3, [r4] <== NOT EXECUTED 295c: e5843010 str r3, [r4, #16] <== NOT EXECUTED 2960: ea000001 b 296c <== NOT EXECUTED } break; default: fclose(fp); 2964: e1a00004 mov r0, r4 <== NOT EXECUTED 2968: eb0029ba bl d058 <== NOT EXECUTED } return 0; } 296c: e3a00000 mov r0, #0 2970: e8bd8010 pop {r4, pc} =============================================================================== 00003a54 : /* * Handle output processing */ static void oproc (unsigned char c, struct rtems_termios_tty *tty) { 3a54: e92d4011 push {r0, r4, lr} 3a58: e5cd0000 strb r0, [sp] int i; if (tty->termios.c_oflag & OPOST) { 3a5c: e5913034 ldr r3, [r1, #52] ; 0x34 3a60: e3130001 tst r3, #1 /* * Handle output processing */ static void oproc (unsigned char c, struct rtems_termios_tty *tty) { 3a64: e1a04001 mov r4, r1 int i; if (tty->termios.c_oflag & OPOST) { 3a68: 0a000045 beq 3b84 switch (c) { 3a6c: e5dd2000 ldrb r2, [sp] 3a70: e2421008 sub r1, r2, #8 3a74: e3510005 cmp r1, #5 3a78: 979ff101 ldrls pc, [pc, r1, lsl #2] 3a7c: ea00002c b 3b34 3a80: 00003b20 .word 0x00003b20 3a84: 00003af8 .word 0x00003af8 3a88: 00003a98 .word 0x00003a98 3a8c: 00003b34 .word 0x00003b34 3a90: 00003b34 .word 0x00003b34 3a94: 00003ac0 .word 0x00003ac0 case '\n': if (tty->termios.c_oflag & ONLRET) 3a98: e3130020 tst r3, #32 tty->column = 0; 3a9c: 13a02000 movne r2, #0 3aa0: 15842028 strne r2, [r4, #40] ; 0x28 if (tty->termios.c_oflag & ONLCR) { 3aa4: e3130004 tst r3, #4 3aa8: 0a000035 beq 3b84 rtems_termios_puts ("\r", 1, tty); 3aac: e59f00e4 ldr r0, [pc, #228] ; 3b98 3ab0: e3a01001 mov r1, #1 3ab4: e1a02004 mov r2, r4 3ab8: ebffffa5 bl 3954 3abc: ea00000b b 3af0 tty->column = 0; } break; case '\r': if ((tty->termios.c_oflag & ONOCR) && (tty->column == 0)) 3ac0: e3130010 tst r3, #16 <== NOT EXECUTED 3ac4: 0a000002 beq 3ad4 <== NOT EXECUTED 3ac8: e5942028 ldr r2, [r4, #40] ; 0x28 <== NOT EXECUTED 3acc: e3520000 cmp r2, #0 <== NOT EXECUTED 3ad0: 0a00002f beq 3b94 <== NOT EXECUTED return; if (tty->termios.c_oflag & OCRNL) { 3ad4: e2132008 ands r2, r3, #8 <== NOT EXECUTED c = '\n'; if (tty->termios.c_oflag & ONLRET) tty->column = 0; break; } tty->column = 0; 3ad8: 05842028 streq r2, [r4, #40] ; 0x28 <== NOT EXECUTED break; case '\r': if ((tty->termios.c_oflag & ONOCR) && (tty->column == 0)) return; if (tty->termios.c_oflag & OCRNL) { 3adc: 0a000028 beq 3b84 <== NOT EXECUTED c = '\n'; 3ae0: e3a0200a mov r2, #10 <== NOT EXECUTED if (tty->termios.c_oflag & ONLRET) 3ae4: e3130020 tst r3, #32 <== NOT EXECUTED case '\r': if ((tty->termios.c_oflag & ONOCR) && (tty->column == 0)) return; if (tty->termios.c_oflag & OCRNL) { c = '\n'; 3ae8: e5cd2000 strb r2, [sp] <== NOT EXECUTED if (tty->termios.c_oflag & ONLRET) 3aec: 0a000024 beq 3b84 <== NOT EXECUTED tty->column = 0; 3af0: e3a03000 mov r3, #0 3af4: ea000021 b 3b80 } tty->column = 0; break; case '\t': i = 8 - (tty->column & 7); 3af8: e5942028 ldr r2, [r4, #40] ; 0x28 3afc: e2021007 and r1, r2, #7 if ((tty->termios.c_oflag & TABDLY) == XTABS) { 3b00: e2033b06 and r3, r3, #6144 ; 0x1800 } tty->column = 0; break; case '\t': i = 8 - (tty->column & 7); 3b04: e2611008 rsb r1, r1, #8 if ((tty->termios.c_oflag & TABDLY) == XTABS) { 3b08: e3530b06 cmp r3, #6144 ; 0x1800 3b0c: e0813002 add r3, r1, r2 tty->column += i; 3b10: 05843028 streq r3, [r4, #40] ; 0x28 rtems_termios_puts ( " ", i, tty); 3b14: 059f0080 ldreq r0, [pc, #128] ; 3b9c tty->column = 0; break; case '\t': i = 8 - (tty->column & 7); if ((tty->termios.c_oflag & TABDLY) == XTABS) { 3b18: 1a000018 bne 3b80 3b1c: ea00001a b 3b8c } tty->column += i; break; case '\b': if (tty->column > 0) 3b20: e5943028 ldr r3, [r4, #40] ; 0x28 <== NOT EXECUTED 3b24: e3530000 cmp r3, #0 <== NOT EXECUTED tty->column--; 3b28: c2433001 subgt r3, r3, #1 <== NOT EXECUTED } tty->column += i; break; case '\b': if (tty->column > 0) 3b2c: ca000013 bgt 3b80 <== NOT EXECUTED 3b30: ea000013 b 3b84 <== NOT EXECUTED tty->column--; break; default: if (tty->termios.c_oflag & OLCUC) 3b34: e3130002 tst r3, #2 3b38: 0a000007 beq 3b5c c = toupper(c); 3b3c: e59f305c ldr r3, [pc, #92] ; 3ba0 <== NOT EXECUTED 3b40: e5933000 ldr r3, [r3] <== NOT EXECUTED 3b44: e0833002 add r3, r3, r2 <== NOT EXECUTED 3b48: e5d33001 ldrb r3, [r3, #1] <== NOT EXECUTED 3b4c: e2033003 and r3, r3, #3 <== NOT EXECUTED 3b50: e3530002 cmp r3, #2 <== NOT EXECUTED 3b54: 02422020 subeq r2, r2, #32 <== NOT EXECUTED 3b58: e5cd2000 strb r2, [sp] <== NOT EXECUTED if (!iscntrl(c)) 3b5c: e59f203c ldr r2, [pc, #60] ; 3ba0 3b60: e5dd3000 ldrb r3, [sp] 3b64: e5922000 ldr r2, [r2] 3b68: e0823003 add r3, r2, r3 3b6c: e5d33001 ldrb r3, [r3, #1] 3b70: e3130020 tst r3, #32 3b74: 1a000002 bne 3b84 tty->column++; 3b78: e5943028 ldr r3, [r4, #40] ; 0x28 3b7c: e2833001 add r3, r3, #1 3b80: e5843028 str r3, [r4, #40] ; 0x28 break; } } rtems_termios_puts (&c, 1, tty); 3b84: e1a0000d mov r0, sp 3b88: e3a01001 mov r1, #1 3b8c: e1a02004 mov r2, r4 3b90: ebffff6f bl 3954 } 3b94: e8bd8018 pop {r3, r4, pc} =============================================================================== 0000bf2c : uint32_t cmd, void *buffer, rtems_libio_t *iop ) { if (cmd == FIONREAD) { bf2c: e59f3058 ldr r3, [pc, #88] ; bf8c bf30: e1510003 cmp r1, r3 pipe_control_t *pipe, uint32_t cmd, void *buffer, rtems_libio_t *iop ) { bf34: e92d4070 push {r4, r5, r6, lr} bf38: e1a04000 mov r4, r0 bf3c: e1a05002 mov r5, r2 *(unsigned int *)buffer = pipe->Length; PIPE_UNLOCK(pipe); return 0; } return -EINVAL; bf40: 13e00015 mvnne r0, #21 uint32_t cmd, void *buffer, rtems_libio_t *iop ) { if (cmd == FIONREAD) { bf44: 18bd8070 popne {r4, r5, r6, pc} if (buffer == NULL) bf48: e3520000 cmp r2, #0 return -EFAULT; bf4c: 03e0000d mvneq r0, #13 void *buffer, rtems_libio_t *iop ) { if (cmd == FIONREAD) { if (buffer == NULL) bf50: 08bd8070 popeq {r4, r5, r6, pc} return -EFAULT; if (! PIPE_LOCK(pipe)) bf54: e3a01000 mov r1, #0 bf58: e5940028 ldr r0, [r4, #40] ; 0x28 bf5c: e1a02001 mov r2, r1 bf60: ebffece2 bl 72f0 bf64: e2506000 subs r6, r0, #0 bf68: 1a000005 bne bf84 return -EINTR; /* Return length of pipe */ *(unsigned int *)buffer = pipe->Length; bf6c: e594300c ldr r3, [r4, #12] PIPE_UNLOCK(pipe); bf70: e5940028 ldr r0, [r4, #40] ; 0x28 if (! PIPE_LOCK(pipe)) return -EINTR; /* Return length of pipe */ *(unsigned int *)buffer = pipe->Length; bf74: e5853000 str r3, [r5] PIPE_UNLOCK(pipe); bf78: ebffed22 bl 7408 return 0; bf7c: e1a00006 mov r0, r6 bf80: e8bd8070 pop {r4, r5, r6, pc} if (cmd == FIONREAD) { if (buffer == NULL) return -EFAULT; if (! PIPE_LOCK(pipe)) return -EINTR; bf84: e3e00003 mvn r0, #3 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; } return -EINVAL; } bf88: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED =============================================================================== 0000bc00 : pipe_control_t *pipe, void *buffer, size_t count, rtems_libio_t *iop ) { bc00: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr} bc04: e1a09001 mov r9, r1 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) bc08: e3a01000 mov r1, #0 pipe_control_t *pipe, void *buffer, size_t count, rtems_libio_t *iop ) { bc0c: e1a04000 mov r4, r0 bc10: e1a05002 mov r5, r2 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) bc14: e5900028 ldr r0, [r0, #40] ; 0x28 bc18: e1a02001 mov r2, r1 pipe_control_t *pipe, void *buffer, size_t count, rtems_libio_t *iop ) { bc1c: e1a0a003 mov sl, r3 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) bc20: ebffedb2 bl 72f0 bc24: e2506000 subs r6, r0, #0 /* For buffering optimization */ if (PIPE_EMPTY(pipe)) pipe->Start = 0; if (pipe->waitingWriters > 0) PIPE_WAKEUPWRITERS(pipe); bc28: 01a0b00d moveq fp, sp rtems_libio_t *iop ) { int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) bc2c: 0a000043 beq bd40 bc30: ea00004f b bd74 <== NOT EXECUTED return -EINTR; while (read < count) { while (PIPE_EMPTY(pipe)) { /* Not an error */ if (pipe->Writers == 0) bc34: e5947014 ldr r7, [r4, #20] bc38: e3570000 cmp r7, #0 bc3c: 0a000044 beq bd54 goto out_locked; if (LIBIO_NODELAY(iop)) { bc40: e59a8014 ldr r8, [sl, #20] bc44: e2188001 ands r8, r8, #1 bc48: 1a000040 bne bd50 ret = -EAGAIN; goto out_locked; } /* Wait until pipe is no more empty or no writer exists */ pipe->waitingReaders ++; bc4c: e5943018 ldr r3, [r4, #24] bc50: e2833001 add r3, r3, #1 bc54: e5843018 str r3, [r4, #24] PIPE_UNLOCK(pipe); bc58: e5940028 ldr r0, [r4, #40] ; 0x28 bc5c: ebffede9 bl 7408 if (! PIPE_READWAIT(pipe)) bc60: e1a01008 mov r1, r8 bc64: e594002c ldr r0, [r4, #44] ; 0x2c bc68: eb0005b2 bl d338 bc6c: e3500000 cmp r0, #0 bc70: 01a07000 moveq r7, r0 bc74: 13e07003 mvnne r7, #3 ret = -EINTR; if (! PIPE_LOCK(pipe)) { bc78: e1a01008 mov r1, r8 bc7c: e5940028 ldr r0, [r4, #40] ; 0x28 bc80: e1a02008 mov r2, r8 bc84: ebffed99 bl 72f0 bc88: e3500000 cmp r0, #0 bc8c: 1a000033 bne bd60 /* WARN waitingReaders not restored! */ ret = -EINTR; goto out_nolock; } pipe->waitingReaders --; bc90: e5943018 ldr r3, [r4, #24] if (ret != 0) bc94: e3570000 cmp r7, #0 if (! PIPE_LOCK(pipe)) { /* WARN waitingReaders not restored! */ ret = -EINTR; goto out_nolock; } pipe->waitingReaders --; bc98: e2433001 sub r3, r3, #1 bc9c: e5843018 str r3, [r4, #24] if (ret != 0) bca0: 1a00002b bne bd54 if (! PIPE_LOCK(pipe)) return -EINTR; while (read < count) { while (PIPE_EMPTY(pipe)) { bca4: e594300c ldr r3, [r4, #12] bca8: e3530000 cmp r3, #0 bcac: 0affffe0 beq bc34 if (ret != 0) goto out_locked; } /* Read chunk bytes */ chunk = MIN(count - read, pipe->Length); bcb0: e0667005 rsb r7, r6, r5 bcb4: e1530007 cmp r3, r7 bcb8: 31a07003 movcc r7, r3 chunk1 = pipe->Size - pipe->Start; bcbc: e5948004 ldr r8, [r4, #4] bcc0: e5943008 ldr r3, [r4, #8] bcc4: e5941000 ldr r1, [r4] bcc8: e0638008 rsb r8, r3, r8 if (chunk > chunk1) { bccc: e1570008 cmp r7, r8 bcd0: e0890006 add r0, r9, r6 memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk1); memcpy(buffer + read + chunk1, pipe->Buffer, chunk - chunk1); } else memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk); bcd4: d0811003 addle r1, r1, r3 bcd8: d1a02007 movle r2, r7 } /* Read chunk bytes */ chunk = MIN(count - read, pipe->Length); chunk1 = pipe->Size - pipe->Start; if (chunk > chunk1) { bcdc: da000006 ble bcfc memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk1); bce0: e0811003 add r1, r1, r3 bce4: e1a02008 mov r2, r8 bce8: eb0010ff bl 100ec memcpy(buffer + read + chunk1, pipe->Buffer, chunk - chunk1); bcec: e0860008 add r0, r6, r8 bcf0: e5941000 ldr r1, [r4] bcf4: e0890000 add r0, r9, r0 bcf8: e0682007 rsb r2, r8, r7 } else memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk); bcfc: eb0010fa bl 100ec pipe->Start += chunk; bd00: e5940008 ldr r0, [r4, #8] pipe->Start %= pipe->Size; bd04: e5941004 ldr r1, [r4, #4] bd08: e0870000 add r0, r7, r0 bd0c: eb004057 bl 1be70 <__umodsi3> pipe->Length -= chunk; bd10: e594300c ldr r3, [r4, #12] bd14: e0673003 rsb r3, r7, r3 /* For buffering optimization */ if (PIPE_EMPTY(pipe)) bd18: e3530000 cmp r3, #0 } else memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk); pipe->Start += chunk; pipe->Start %= pipe->Size; bd1c: e5840008 str r0, [r4, #8] pipe->Length -= chunk; bd20: e584300c str r3, [r4, #12] /* For buffering optimization */ if (PIPE_EMPTY(pipe)) pipe->Start = 0; bd24: 05843008 streq r3, [r4, #8] if (pipe->waitingWriters > 0) bd28: e594301c ldr r3, [r4, #28] bd2c: e3530000 cmp r3, #0 PIPE_WAKEUPWRITERS(pipe); bd30: 15940030 ldrne r0, [r4, #48] ; 0x30 bd34: 11a0100d movne r1, sp bd38: 1b000568 blne d2e0 read += chunk; bd3c: e0866007 add r6, r6, r7 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) return -EINTR; while (read < count) { bd40: e1560005 cmp r6, r5 bd44: 3affffd6 bcc bca4 bd48: e3a07000 mov r7, #0 bd4c: ea000000 b bd54 /* Not an error */ if (pipe->Writers == 0) goto out_locked; if (LIBIO_NODELAY(iop)) { ret = -EAGAIN; bd50: e3e0700a mvn r7, #10 PIPE_WAKEUPWRITERS(pipe); read += chunk; } out_locked: PIPE_UNLOCK(pipe); bd54: e5940028 ldr r0, [r4, #40] ; 0x28 bd58: ebffedaa bl 7408 bd5c: ea000000 b bd64 PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) ret = -EINTR; if (! PIPE_LOCK(pipe)) { /* WARN waitingReaders not restored! */ ret = -EINTR; bd60: e3e07003 mvn r7, #3 <== NOT EXECUTED out_locked: PIPE_UNLOCK(pipe); out_nolock: if (read > 0) bd64: e3560000 cmp r6, #0 bd68: c1a00006 movgt r0, r6 bd6c: d1a00007 movle r0, r7 bd70: ea000000 b bd78 ) { int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) return -EINTR; bd74: e3e00003 mvn r0, #3 <== NOT EXECUTED out_nolock: if (read > 0) return read; return ret; } bd78: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 0000bd7c : pipe_control_t *pipe, const void *buffer, size_t count, rtems_libio_t *iop ) { bd7c: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr} int chunk, chunk1, written = 0, ret = 0; /* Write nothing */ if (count == 0) bd80: e2527000 subs r7, r2, #0 pipe_control_t *pipe, const void *buffer, size_t count, rtems_libio_t *iop ) { bd84: e1a04000 mov r4, r0 bd88: e1a0b001 mov fp, r1 bd8c: e1a08003 mov r8, r3 int chunk, chunk1, written = 0, ret = 0; /* Write nothing */ if (count == 0) return 0; bd90: 01a00007 moveq r0, r7 ) { int chunk, chunk1, written = 0, ret = 0; /* Write nothing */ if (count == 0) bd94: 0a000063 beq bf28 return 0; if (! PIPE_LOCK(pipe)) bd98: e3a01000 mov r1, #0 bd9c: e5940028 ldr r0, [r4, #40] ; 0x28 bda0: e1a02001 mov r2, r1 bda4: ebffed51 bl 72f0 bda8: e3500000 cmp r0, #0 return -EINTR; bdac: 13e00003 mvnne r0, #3 /* Write nothing */ if (count == 0) return 0; if (! PIPE_LOCK(pipe)) bdb0: 1a00005c bne bf28 return -EINTR; if (pipe->Readers == 0) { bdb4: e5945010 ldr r5, [r4, #16] bdb8: e3550000 cmp r5, #0 bdbc: 0a00004c beq bef4 ret = -EPIPE; goto out_locked; } /* Write of PIPE_BUF bytes or less shall not be interleaved */ chunk = count <= pipe->Size ? count : 1; bdc0: e5949004 ldr r9, [r4, #4] bdc4: e1570009 cmp r7, r9 bdc8: 91a09007 movls r9, r7 bdcc: 83a09001 movhi r9, #1 /* Wait until there is chunk bytes space or no reader exists */ pipe->waitingWriters ++; PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) ret = -EINTR; bdd0: e1a05000 mov r5, r0 bdd4: ea000040 b bedc /* Write of PIPE_BUF bytes or less shall not be interleaved */ chunk = count <= pipe->Size ? count : 1; while (written < count) { while (PIPE_SPACE(pipe) < chunk) { if (LIBIO_NODELAY(iop)) { bdd8: e598a014 ldr sl, [r8, #20] bddc: e21aa001 ands sl, sl, #1 bde0: 1a000041 bne beec ret = -EAGAIN; goto out_locked; } /* Wait until there is chunk bytes space or no reader exists */ pipe->waitingWriters ++; bde4: e594301c ldr r3, [r4, #28] bde8: e2833001 add r3, r3, #1 bdec: e584301c str r3, [r4, #28] PIPE_UNLOCK(pipe); bdf0: e5940028 ldr r0, [r4, #40] ; 0x28 bdf4: ebffed83 bl 7408 if (! PIPE_WRITEWAIT(pipe)) bdf8: e1a0100a mov r1, sl bdfc: e5940030 ldr r0, [r4, #48] ; 0x30 be00: eb00054c bl d338 be04: e3500000 cmp r0, #0 be08: 01a06000 moveq r6, r0 be0c: 13e06003 mvnne r6, #3 ret = -EINTR; if (! PIPE_LOCK(pipe)) { be10: e1a0100a mov r1, sl be14: e5940028 ldr r0, [r4, #40] ; 0x28 be18: e1a0200a mov r2, sl be1c: ebffed33 bl 72f0 be20: e3500000 cmp r0, #0 be24: 1a00003b bne bf18 /* WARN waitingWriters not restored! */ ret = -EINTR; goto out_nolock; } pipe->waitingWriters --; be28: e594301c ldr r3, [r4, #28] if (ret != 0) be2c: e3560000 cmp r6, #0 if (! PIPE_LOCK(pipe)) { /* WARN waitingWriters not restored! */ ret = -EINTR; goto out_nolock; } pipe->waitingWriters --; be30: e2433001 sub r3, r3, #1 be34: e584301c str r3, [r4, #28] if (ret != 0) be38: 1a00002e bne bef8 goto out_locked; if (pipe->Readers == 0) { be3c: e5943010 ldr r3, [r4, #16] be40: e3530000 cmp r3, #0 be44: 0a00002a beq bef4 /* Write of PIPE_BUF bytes or less shall not be interleaved */ chunk = count <= pipe->Size ? count : 1; while (written < count) { while (PIPE_SPACE(pipe) < chunk) { be48: e594a004 ldr sl, [r4, #4] be4c: e594300c ldr r3, [r4, #12] be50: e063200a rsb r2, r3, sl be54: e1520009 cmp r2, r9 be58: 3affffde bcc bdd8 goto out_locked; } } chunk = MIN(count - written, PIPE_SPACE(pipe)); chunk1 = pipe->Size - PIPE_WSTART(pipe); be5c: e5940008 ldr r0, [r4, #8] be60: e1a0100a mov r1, sl be64: e0830000 add r0, r3, r0 ret = -EPIPE; goto out_locked; } } chunk = MIN(count - written, PIPE_SPACE(pipe)); be68: e0656007 rsb r6, r5, r7 be6c: e1520006 cmp r2, r6 be70: 31a06002 movcc r6, r2 chunk1 = pipe->Size - PIPE_WSTART(pipe); be74: eb003ffd bl 1be70 <__umodsi3> be78: e5943000 ldr r3, [r4] be7c: e060a00a rsb sl, r0, sl if (chunk > chunk1) { be80: e156000a cmp r6, sl be84: e08b1005 add r1, fp, r5 memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk1); memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1); } else memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk); be88: d0830000 addle r0, r3, r0 be8c: d1a02006 movle r2, r6 } } chunk = MIN(count - written, PIPE_SPACE(pipe)); chunk1 = pipe->Size - PIPE_WSTART(pipe); if (chunk > chunk1) { be90: da000006 ble beb0 memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk1); be94: e1a0200a mov r2, sl be98: e0830000 add r0, r3, r0 be9c: eb001092 bl 100ec memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1); bea0: e08a1005 add r1, sl, r5 bea4: e5940000 ldr r0, [r4] bea8: e08b1001 add r1, fp, r1 beac: e06a2006 rsb r2, sl, r6 } else memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk); beb0: eb00108d bl 100ec pipe->Length += chunk; beb4: e594300c ldr r3, [r4, #12] beb8: e0833006 add r3, r3, r6 bebc: e584300c str r3, [r4, #12] if (pipe->waitingReaders > 0) bec0: e5943018 ldr r3, [r4, #24] bec4: e3530000 cmp r3, #0 PIPE_WAKEUPREADERS(pipe); bec8: 1594002c ldrne r0, [r4, #44] ; 0x2c becc: 11a0100d movne r1, sp bed0: 1b000502 blne d2e0 written += chunk; bed4: e0855006 add r5, r5, r6 /* Write of more than PIPE_BUF bytes can be interleaved */ chunk = 1; bed8: e3a09001 mov r9, #1 } /* Write of PIPE_BUF bytes or less shall not be interleaved */ chunk = count <= pipe->Size ? count : 1; while (written < count) { bedc: e1550007 cmp r5, r7 bee0: 3affffd8 bcc be48 bee4: e3a06000 mov r6, #0 bee8: ea000002 b bef8 while (PIPE_SPACE(pipe) < chunk) { if (LIBIO_NODELAY(iop)) { ret = -EAGAIN; beec: e3e0600a mvn r6, #10 bef0: ea000000 b bef8 pipe->waitingWriters --; if (ret != 0) goto out_locked; if (pipe->Readers == 0) { ret = -EPIPE; bef4: e3e0601f mvn r6, #31 /* Write of more than PIPE_BUF bytes can be interleaved */ chunk = 1; } out_locked: PIPE_UNLOCK(pipe); bef8: e5940028 ldr r0, [r4, #40] ; 0x28 befc: ebffed41 bl 7408 out_nolock: #ifdef RTEMS_POSIX_API /* Signal SIGPIPE */ if (ret == -EPIPE) bf00: e3760020 cmn r6, #32 bf04: 1a000004 bne bf1c kill(getpid(), SIGPIPE); bf08: eb0001f1 bl c6d4 bf0c: e3a0100d mov r1, #13 bf10: eb0002a4 bl c9a8 bf14: ea000000 b bf1c PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) ret = -EINTR; if (! PIPE_LOCK(pipe)) { /* WARN waitingWriters not restored! */ ret = -EINTR; bf18: e3e06003 mvn r6, #3 <== NOT EXECUTED /* Signal SIGPIPE */ if (ret == -EPIPE) kill(getpid(), SIGPIPE); #endif if (written > 0) bf1c: e3550000 cmp r5, #0 bf20: c1a00005 movgt r0, r5 bf24: d1a00006 movle r0, r6 return written; return ret; } bf28: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 0000a63c : int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { if ( !attr || !attr->is_initialized ) a63c: e3500000 cmp r0, #0 a640: 0a00000b beq a674 a644: e5903000 ldr r3, [r0] a648: e3530000 cmp r3, #0 a64c: 0a000008 beq a674 return EINVAL; switch ( policy ) { a650: e3510004 cmp r1, #4 a654: 8a000008 bhi a67c a658: e3a03001 mov r3, #1 a65c: e1a03113 lsl r3, r3, r1 a660: e3130017 tst r3, #23 case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; a664: 15801014 strne r1, [r0, #20] return 0; a668: 13a00000 movne r0, #0 ) { if ( !attr || !attr->is_initialized ) return EINVAL; switch ( policy ) { a66c: 112fff1e bxne lr a670: ea000001 b a67c <== NOT EXECUTED pthread_attr_t *attr, int policy ) { if ( !attr || !attr->is_initialized ) return EINVAL; a674: e3a00016 mov r0, #22 a678: e12fff1e bx lr case SCHED_SPORADIC: attr->schedpolicy = policy; return 0; default: return ENOTSUP; a67c: e3a00086 mov r0, #134 ; 0x86 } } a680: e12fff1e bx lr =============================================================================== 00007480 : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { if ( !attr || !attr->is_initialized ) 7480: e3500000 cmp r0, #0 7484: 0a000007 beq 74a8 7488: e5903000 ldr r3, [r0] 748c: e3530000 cmp r3, #0 7490: 0a000004 beq 74a8 return EINVAL; switch ( pshared ) { 7494: e3510001 cmp r1, #1 case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 7498: 95801004 strls r1, [r0, #4] return 0; 749c: 93a00000 movls r0, #0 ) { if ( !attr || !attr->is_initialized ) return EINVAL; switch ( pshared ) { 74a0: 912fff1e bxls lr 74a4: ea000001 b 74b0 pthread_mutexattr_t *attr, int pshared ) { if ( !attr || !attr->is_initialized ) return EINVAL; 74a8: e3a00016 mov r0, #22 74ac: e12fff1e bx lr case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; return 0; default: return EINVAL; 74b0: e3a00016 mov r0, #22 <== NOT EXECUTED } } 74b4: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 000070ec : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { if ( !attr ) 70ec: e3500000 cmp r0, #0 70f0: 0a000007 beq 7114 return EINVAL; if ( !attr->is_initialized ) 70f4: e5903000 ldr r3, [r0] 70f8: e3530000 cmp r3, #0 70fc: 0a000004 beq 7114 return EINVAL; switch ( pshared ) { 7100: e3510001 cmp r1, #1 case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 7104: 95801004 strls r1, [r0, #4] return 0; 7108: 93a00000 movls r0, #0 return EINVAL; if ( !attr->is_initialized ) return EINVAL; switch ( pshared ) { 710c: 912fff1e bxls lr 7110: ea000001 b 711c { if ( !attr ) return EINVAL; if ( !attr->is_initialized ) return EINVAL; 7114: e3a00016 mov r0, #22 7118: e12fff1e bx lr case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; return 0; default: return EINVAL; 711c: e3a00016 mov r0, #22 <== NOT EXECUTED } } 7120: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 0001227c : ) { uintptr_t old_size; char *new_area; MSBUMP(realloc_calls, 1); 1227c: e59f310c ldr r3, [pc, #268] ; 12390 12280: e5932010 ldr r2, [r3, #16] 12284: e2822001 add r2, r2, #1 void *realloc( void *ptr, size_t size ) { 12288: e92d40f1 push {r0, r4, r5, r6, r7, lr} uintptr_t old_size; char *new_area; MSBUMP(realloc_calls, 1); 1228c: e5832010 str r2, [r3, #16] /* * Do not attempt to allocate memory if in a critical section or ISR. */ if (_System_state_Is_up(_System_state_Get())) { 12290: e59f30fc ldr r3, [pc, #252] ; 12394 12294: e5933000 ldr r3, [r3] 12298: e3530003 cmp r3, #3 void *realloc( void *ptr, size_t size ) { 1229c: e1a04000 mov r4, r0 122a0: e1a05001 mov r5, r1 /* * Do not attempt to allocate memory if in a critical section or ISR. */ if (_System_state_Is_up(_System_state_Get())) { 122a4: 1a000009 bne 122d0 if (_Thread_Dispatch_disable_level > 0) 122a8: e59f30e8 ldr r3, [pc, #232] ; 12398 122ac: e5933000 ldr r3, [r3] 122b0: e3530000 cmp r3, #0 return (void *) 0; 122b4: 13a04000 movne r4, #0 /* * Do not attempt to allocate memory if in a critical section or ISR. */ if (_System_state_Is_up(_System_state_Get())) { if (_Thread_Dispatch_disable_level > 0) 122b8: 1a000032 bne 12388 return (void *) 0; if (_ISR_Nest_level > 0) 122bc: e59f20d8 ldr r2, [pc, #216] ; 1239c 122c0: e5922000 ldr r2, [r2] 122c4: e3520000 cmp r2, #0 return (void *) 0; 122c8: 11a04003 movne r4, r3 if (_System_state_Is_up(_System_state_Get())) { if (_Thread_Dispatch_disable_level > 0) return (void *) 0; if (_ISR_Nest_level > 0) 122cc: 1a00002d bne 12388 } /* * Continue with realloc(). */ if ( !ptr ) 122d0: e3540000 cmp r4, #0 122d4: 1a000003 bne 122e8 return malloc( size ); 122d8: e1a00005 mov r0, r5 122dc: ebffc051 bl 2428 122e0: e1a04000 mov r4, r0 122e4: ea000027 b 12388 if ( !size ) { 122e8: e3550000 cmp r5, #0 122ec: 1a000003 bne 12300 free( ptr ); 122f0: e1a00004 mov r0, r4 <== NOT EXECUTED 122f4: ebffbf7c bl 20ec <== NOT EXECUTED return (void *) 0; 122f8: e1a04005 mov r4, r5 <== NOT EXECUTED 122fc: ea000021 b 12388 <== NOT EXECUTED } if ( !_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, ptr, &old_size) ) { 12300: e59f6098 ldr r6, [pc, #152] ; 123a0 12304: e1a01004 mov r1, r4 12308: e5960000 ldr r0, [r6] 1230c: e1a0200d mov r2, sp 12310: eb00004e bl 12450 <_Protected_heap_Get_block_size> 12314: e2507000 subs r7, r0, #0 12318: 1a000004 bne 12330 errno = EINVAL; 1231c: ebffeaff bl cf20 <__errno> 12320: e3a03016 mov r3, #22 12324: e5803000 str r3, [r0] return (void *) 0; 12328: e1a04007 mov r4, r7 1232c: ea000015 b 12388 } /* * Now resize it. */ if ( _Protected_heap_Resize_block( RTEMS_Malloc_Heap, ptr, size ) ) { 12330: e5960000 ldr r0, [r6] 12334: e1a01004 mov r1, r4 12338: e1a02005 mov r2, r5 1233c: eb000054 bl 12494 <_Protected_heap_Resize_block> 12340: e3500000 cmp r0, #0 12344: 1a00000f bne 12388 * There used to be a free on this error case but it is wrong to * free the memory per OpenGroup Single UNIX Specification V2 * and the C Standard. */ new_area = malloc( size ); 12348: e1a00005 mov r0, r5 1234c: ebffc035 bl 2428 MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */ 12350: e59f3038 ldr r3, [pc, #56] ; 12390 12354: e5932004 ldr r2, [r3, #4] if ( !new_area ) { 12358: e2506000 subs r6, r0, #0 * and the C Standard. */ new_area = malloc( size ); MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */ 1235c: e2422001 sub r2, r2, #1 12360: e5832004 str r2, [r3, #4] if ( !new_area ) { 12364: 0a000006 beq 12384 return (void *) 0; } memcpy( new_area, ptr, (size < old_size) ? size : old_size ); 12368: e59d2000 ldr r2, [sp] 1236c: e1a01004 mov r1, r4 12370: e1550002 cmp r5, r2 12374: 31a02005 movcc r2, r5 12378: ebffed16 bl d7d8 free( ptr ); 1237c: e1a00004 mov r0, r4 12380: ebffbf59 bl 20ec new_area = malloc( size ); MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */ if ( !new_area ) { return (void *) 0; 12384: e1a04006 mov r4, r6 memcpy( new_area, ptr, (size < old_size) ? size : old_size ); free( ptr ); return new_area; } 12388: e1a00004 mov r0, r4 1238c: e8bd80f8 pop {r3, r4, r5, r6, r7, pc} =============================================================================== 000062e0 : * errno - otherwise */ int rtems_aio_enqueue (rtems_aio_request *req) { 62e0: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} struct sched_param param; /* The queue should be initialized */ AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED); result = pthread_mutex_lock (&aio_request_queue.mutex); 62e4: e59f41ec ldr r4, [pc, #492] ; 64d8 * errno - otherwise */ int rtems_aio_enqueue (rtems_aio_request *req) { 62e8: e24dd024 sub sp, sp, #36 ; 0x24 62ec: e1a06000 mov r6, r0 struct sched_param param; /* The queue should be initialized */ AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED); result = pthread_mutex_lock (&aio_request_queue.mutex); 62f0: e1a00004 mov r0, r4 62f4: eb00024d bl 6c30 if (result != 0) { 62f8: e2505000 subs r5, r0, #0 62fc: 0a000002 beq 630c free (req); 6300: e1a00006 mov r0, r6 <== NOT EXECUTED 6304: ebfff27c bl 2cfc <== NOT EXECUTED return result; 6308: ea00006f b 64cc <== NOT EXECUTED } /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); 630c: eb000454 bl 7464 6310: e28d101c add r1, sp, #28 6314: e1a0200d mov r2, sp 6318: eb000359 bl 7084 req->caller_thread = pthread_self (); 631c: eb000450 bl 7464 req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 6320: e5963014 ldr r3, [r6, #20] 6324: e59d1000 ldr r1, [sp] 6328: e5932014 ldr r2, [r3, #20] 632c: e0622001 rsb r2, r2, r1 6330: e586200c str r2, [r6, #12] req->policy = policy; 6334: e59d201c ldr r2, [sp, #28] 6338: e5862008 str r2, [r6, #8] req->aiocbp->error_code = EINPROGRESS; 633c: e3a02077 mov r2, #119 ; 0x77 /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); req->caller_thread = pthread_self (); 6340: e5860010 str r0, [r6, #16] req->priority = param.sched_priority - req->aiocbp->aio_reqprio; req->policy = policy; req->aiocbp->error_code = EINPROGRESS; 6344: e5832030 str r2, [r3, #48] ; 0x30 req->aiocbp->return_value = 0; if ((aio_request_queue.idle_threads == 0) && 6348: e5942068 ldr r2, [r4, #104] ; 0x68 634c: e3520000 cmp r2, #0 req->caller_thread = pthread_self (); req->priority = param.sched_priority - req->aiocbp->aio_reqprio; req->policy = policy; req->aiocbp->error_code = EINPROGRESS; req->aiocbp->return_value = 0; 6350: e5835034 str r5, [r3, #52] ; 0x34 if ((aio_request_queue.idle_threads == 0) && 6354: 1a00002e bne 6414 6358: e5942064 ldr r2, [r4, #100] ; 0x64 635c: e3520004 cmp r2, #4 6360: ca00002b bgt 6414 aio_request_queue.active_threads < AIO_MAX_THREADS) /* we still have empty places on the active_threads chain */ { chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 6364: e5931000 ldr r1, [r3] 6368: e2840048 add r0, r4, #72 ; 0x48 636c: e3a02001 mov r2, #1 6370: ebfffece bl 5eb0 if (r_chain->new_fd == 1) { 6374: e5903018 ldr r3, [r0, #24] 6378: e3530001 cmp r3, #1 if ((aio_request_queue.idle_threads == 0) && aio_request_queue.active_threads < AIO_MAX_THREADS) /* we still have empty places on the active_threads chain */ { chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 637c: e1a07000 mov r7, r0 6380: e2809008 add r9, r0, #8 6384: e280801c add r8, r0, #28 6388: e280a020 add sl, r0, #32 if (r_chain->new_fd == 1) { 638c: 1a000017 bne 63f0 RTEMS_INLINE_ROUTINE void _Chain_Prepend( Chain_Control *the_chain, Chain_Node *the_node ) { _Chain_Insert(_Chain_Head(the_chain), the_node); 6390: e1a01006 mov r1, r6 6394: e1a00009 mov r0, r9 6398: eb000850 bl 84e0 <_Chain_Insert> rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; pthread_mutex_init (&r_chain->mutex, NULL); 639c: e1a01005 mov r1, r5 chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); if (r_chain->new_fd == 1) { rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; 63a0: e5875018 str r5, [r7, #24] pthread_mutex_init (&r_chain->mutex, NULL); 63a4: e1a00008 mov r0, r8 63a8: eb0001ce bl 6ae8 pthread_cond_init (&r_chain->cond, NULL); 63ac: e1a01005 mov r1, r5 63b0: e1a0000a mov r0, sl 63b4: eb0000e3 bl 6748 AIO_printf ("New thread \n"); result = pthread_create (&thid, &aio_request_queue.attr, 63b8: e1a03007 mov r3, r7 63bc: e28d0020 add r0, sp, #32 63c0: e2841008 add r1, r4, #8 63c4: e59f2110 ldr r2, [pc, #272] ; 64dc 63c8: eb000299 bl 6e34 rtems_aio_handle, (void *) r_chain); if (result != 0) { 63cc: e2506000 subs r6, r0, #0 pthread_mutex_unlock (&aio_request_queue.mutex); return result; } ++aio_request_queue.active_threads; 63d0: 05943064 ldreq r3, [r4, #100] ; 0x64 63d4: 02833001 addeq r3, r3, #1 63d8: 05843064 streq r3, [r4, #100] ; 0x64 pthread_cond_init (&r_chain->cond, NULL); AIO_printf ("New thread \n"); result = pthread_create (&thid, &aio_request_queue.attr, rtems_aio_handle, (void *) r_chain); if (result != 0) { 63dc: 0a000038 beq 64c4 pthread_mutex_unlock (&aio_request_queue.mutex); 63e0: e1a00004 mov r0, r4 <== NOT EXECUTED 63e4: eb000230 bl 6cac <== NOT EXECUTED return result; 63e8: e1a05006 mov r5, r6 <== NOT EXECUTED 63ec: ea000036 b 64cc <== NOT EXECUTED } ++aio_request_queue.active_threads; } else { /* put request in the fd chain it belongs to */ pthread_mutex_lock (&r_chain->mutex); 63f0: e1a00008 mov r0, r8 63f4: eb00020d bl 6c30 rtems_aio_insert_prio (&r_chain->perfd, req); 63f8: e1a00009 mov r0, r9 63fc: e1a01006 mov r1, r6 6400: ebffff76 bl 61e0 pthread_cond_signal (&r_chain->cond); 6404: e1a0000a mov r0, sl 6408: eb0000fe bl 6808 pthread_mutex_unlock (&r_chain->mutex); 640c: e1a00008 mov r0, r8 6410: ea00000e b 6450 else { /* the maximum number of threads has been already created even though some of them might be idle. The request belongs to one of the active fd chain */ r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, 6414: e59f00c4 ldr r0, [pc, #196] ; 64e0 6418: e5931000 ldr r1, [r3] 641c: e3a02000 mov r2, #0 6420: ebfffea2 bl 5eb0 req->aiocbp->aio_fildes, 0); if (r_chain != NULL) 6424: e2504000 subs r4, r0, #0 6428: 0a00000a beq 6458 { pthread_mutex_lock (&r_chain->mutex); 642c: e284701c add r7, r4, #28 6430: e1a00007 mov r0, r7 6434: eb0001fd bl 6c30 rtems_aio_insert_prio (&r_chain->perfd, req); 6438: e2840008 add r0, r4, #8 643c: e1a01006 mov r1, r6 6440: ebffff66 bl 61e0 pthread_cond_signal (&r_chain->cond); 6444: e2840020 add r0, r4, #32 6448: eb0000ee bl 6808 pthread_mutex_unlock (&r_chain->mutex); 644c: e1a00007 mov r0, r7 6450: eb000215 bl 6cac 6454: ea00001a b 64c4 } else { /* or to the idle chain */ chain = &aio_request_queue.idle_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 6458: e5963014 ldr r3, [r6, #20] 645c: e59f0080 ldr r0, [pc, #128] ; 64e4 6460: e5931000 ldr r1, [r3] 6464: e3a02001 mov r2, #1 6468: ebfffe90 bl 5eb0 if (r_chain->new_fd == 1) { 646c: e5903018 ldr r3, [r0, #24] 6470: e3530001 cmp r3, #1 } else { /* or to the idle chain */ chain = &aio_request_queue.idle_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 6474: e1a07000 mov r7, r0 6478: e2800008 add r0, r0, #8 if (r_chain->new_fd == 1) { 647c: 1a000009 bne 64a8 6480: e1a01006 mov r1, r6 6484: eb000815 bl 84e0 <_Chain_Insert> /* If this is a new fd chain we signal the idle threads that might be waiting for requests */ AIO_printf (" New chain on waiting queue \n "); rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; pthread_mutex_init (&r_chain->mutex, NULL); 6488: e1a01004 mov r1, r4 if (r_chain->new_fd == 1) { /* If this is a new fd chain we signal the idle threads that might be waiting for requests */ AIO_printf (" New chain on waiting queue \n "); rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; 648c: e5874018 str r4, [r7, #24] pthread_mutex_init (&r_chain->mutex, NULL); 6490: e287001c add r0, r7, #28 6494: eb000193 bl 6ae8 pthread_cond_init (&r_chain->cond, NULL); 6498: e2870020 add r0, r7, #32 649c: e1a01004 mov r1, r4 64a0: eb0000a8 bl 6748 64a4: ea000001 b 64b0 } else /* just insert the request in the existing fd chain */ rtems_aio_insert_prio (&r_chain->perfd, req); 64a8: e1a01006 mov r1, r6 64ac: ebffff4b bl 61e0 if (aio_request_queue.idle_threads > 0) 64b0: e59f0020 ldr r0, [pc, #32] ; 64d8 64b4: e5903068 ldr r3, [r0, #104] ; 0x68 64b8: e3530000 cmp r3, #0 pthread_cond_signal (&aio_request_queue.new_req); 64bc: c2800004 addgt r0, r0, #4 64c0: cb0000d0 blgt 6808 } } pthread_mutex_unlock (&aio_request_queue.mutex); 64c4: e59f000c ldr r0, [pc, #12] ; 64d8 64c8: eb0001f7 bl 6cac return 0; } 64cc: e1a00005 mov r0, r5 64d0: e28dd024 add sp, sp, #36 ; 0x24 64d4: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} =============================================================================== 00005f94 : * NULL - if error */ static void * rtems_aio_handle (void *arg) { 5f94: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} struct timespec timeout; AIO_printf ("Chain is empty [WQ], wait for work\n"); pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_lock (&aio_request_queue.mutex); 5f98: e59f4238 ldr r4, [pc, #568] ; 61d8 * NULL - if error */ static void * rtems_aio_handle (void *arg) { 5f9c: e24dd02c sub sp, sp, #44 ; 0x2c 5fa0: e1a05000 mov r5, r0 pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); 5fa4: e28d7020 add r7, sp, #32 node = rtems_chain_first (chain); req = (rtems_aio_request *) node; /* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING discussion in rtems_aio_enqueue () */ pthread_getschedparam (pthread_self(), &policy, ¶m); 5fa8: e28db004 add fp, sp, #4 /* acquire the mutex of the current fd chain. we don't need to lock the queue mutex since we can add requests to idle fd chains or even active ones if the working request has been extracted from the chain */ result = pthread_mutex_lock (&r_chain->mutex); 5fac: e285a01c add sl, r5, #28 5fb0: e1a0000a mov r0, sl 5fb4: eb00031d bl 6c30 if (result != 0) 5fb8: e2509000 subs r9, r0, #0 5fbc: 1a000082 bne 61cc } } AIO_printf ("Thread finished\n"); return NULL; } 5fc0: e5956008 ldr r6, [r5, #8] RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 5fc4: e285300c add r3, r5, #12 /* If the locked chain is not empty, take the first request extract it, unlock the chain and process the request, in this way the user can supply more requests to this fd chain */ if (!rtems_chain_is_empty (chain)) { 5fc8: e1560003 cmp r6, r3 5fcc: 0a000035 beq 60a8 node = rtems_chain_first (chain); req = (rtems_aio_request *) node; /* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING discussion in rtems_aio_enqueue () */ pthread_getschedparam (pthread_self(), &policy, ¶m); 5fd0: eb000523 bl 7464 5fd4: e28d1028 add r1, sp, #40 ; 0x28 5fd8: e1a0200b mov r2, fp 5fdc: eb000428 bl 7084 param.sched_priority = req->priority; 5fe0: e596300c ldr r3, [r6, #12] 5fe4: e58d3004 str r3, [sp, #4] pthread_setschedparam (pthread_self(), req->policy, ¶m); 5fe8: eb00051d bl 7464 5fec: e1a0200b mov r2, fp 5ff0: e5961008 ldr r1, [r6, #8] 5ff4: eb00051f bl 7478 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 5ff8: e1a00006 mov r0, r6 5ffc: eb000922 bl 848c <_Chain_Extract> rtems_chain_extract (node); pthread_mutex_unlock (&r_chain->mutex); 6000: e1a0000a mov r0, sl 6004: eb000328 bl 6cac switch (req->aiocbp->aio_lio_opcode) { 6008: e5962014 ldr r2, [r6, #20] 600c: e592302c ldr r3, [r2, #44] ; 0x2c 6010: e3530002 cmp r3, #2 6014: 0a00000b beq 6048 6018: e3530003 cmp r3, #3 601c: 0a000011 beq 6068 6020: e3530001 cmp r3, #1 6024: 1a000013 bne 6078 case LIO_READ: AIO_printf ("read\n"); result = pread (req->aiocbp->aio_fildes, 6028: e5921008 ldr r1, [r2, #8] 602c: e5923004 ldr r3, [r2, #4] 6030: e58d1000 str r1, [sp] 6034: e592100c ldr r1, [r2, #12] 6038: e5920000 ldr r0, [r2] 603c: e5922010 ldr r2, [r2, #16] 6040: eb00290f bl 10484 (void *) req->aiocbp->aio_buf, req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; 6044: ea000009 b 6070 case LIO_WRITE: AIO_printf ("write\n"); result = pwrite (req->aiocbp->aio_fildes, 6048: e5921008 ldr r1, [r2, #8] 604c: e5923004 ldr r3, [r2, #4] 6050: e58d1000 str r1, [sp] 6054: e592100c ldr r1, [r2, #12] 6058: e5920000 ldr r0, [r2] 605c: e5922010 ldr r2, [r2, #16] 6060: eb002951 bl 105ac (void *) req->aiocbp->aio_buf, req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; 6064: ea000001 b 6070 case LIO_SYNC: AIO_printf ("sync\n"); result = fsync (req->aiocbp->aio_fildes); 6068: e5920000 ldr r0, [r2] <== NOT EXECUTED 606c: eb00195d bl c5e8 <== NOT EXECUTED break; default: result = -1; } if (result == -1) { 6070: e3700001 cmn r0, #1 6074: 1a000006 bne 6094 req->aiocbp->return_value = -1; 6078: e5966014 ldr r6, [r6, #20] <== NOT EXECUTED 607c: e3e02000 mvn r2, #0 <== NOT EXECUTED 6080: e5862034 str r2, [r6, #52] ; 0x34 <== NOT EXECUTED req->aiocbp->error_code = errno; 6084: eb0025fa bl f874 <__errno> <== NOT EXECUTED 6088: e5903000 ldr r3, [r0] <== NOT EXECUTED 608c: e5863030 str r3, [r6, #48] ; 0x30 <== NOT EXECUTED 6090: eaffffc5 b 5fac <== NOT EXECUTED } else { req->aiocbp->return_value = result; 6094: e5963014 ldr r3, [r6, #20] req->aiocbp->error_code = 0; 6098: e3a02000 mov r2, #0 } if (result == -1) { req->aiocbp->return_value = -1; req->aiocbp->error_code = errno; } else { req->aiocbp->return_value = result; 609c: e5830034 str r0, [r3, #52] ; 0x34 req->aiocbp->error_code = 0; 60a0: e5832030 str r2, [r3, #48] ; 0x30 60a4: eaffffc0 b 5fac struct timespec timeout; AIO_printf ("Chain is empty [WQ], wait for work\n"); pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_lock (&aio_request_queue.mutex); 60a8: e59f8128 ldr r8, [pc, #296] ; 61d8 struct timespec timeout; AIO_printf ("Chain is empty [WQ], wait for work\n"); pthread_mutex_unlock (&r_chain->mutex); 60ac: e1a0000a mov r0, sl 60b0: eb0002fd bl 6cac pthread_mutex_lock (&aio_request_queue.mutex); 60b4: e1a00008 mov r0, r8 60b8: eb0002dc bl 6c30 if (rtems_chain_is_empty (chain)) 60bc: e5953008 ldr r3, [r5, #8] 60c0: e1530006 cmp r3, r6 60c4: 1a00003d bne 61c0 { clock_gettime (CLOCK_REALTIME, &timeout); 60c8: e1a01007 mov r1, r7 60cc: e3a00001 mov r0, #1 60d0: eb00014e bl 6610 timeout.tv_sec += 3; 60d4: e59d3020 ldr r3, [sp, #32] timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 60d8: e2856020 add r6, r5, #32 pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 60dc: e2833003 add r3, r3, #3 timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 60e0: e1a00006 mov r0, r6 60e4: e1a01008 mov r1, r8 60e8: e1a02007 mov r2, r7 pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 60ec: e58d3020 str r3, [sp, #32] timeout.tv_nsec = 0; 60f0: e58d9024 str r9, [sp, #36] ; 0x24 result = pthread_cond_timedwait (&r_chain->cond, 60f4: eb0001da bl 6864 &aio_request_queue.mutex, &timeout); /* If no requests were added to the chain we delete the fd chain from the queue and start working with idle fd chains */ if (result == ETIMEDOUT) { 60f8: e3500074 cmp r0, #116 ; 0x74 60fc: 1a00002f bne 61c0 6100: e1a00005 mov r0, r5 6104: eb0008e0 bl 848c <_Chain_Extract> rtems_chain_extract (&r_chain->next_fd); pthread_mutex_destroy (&r_chain->mutex); 6108: e1a0000a mov r0, sl 610c: eb000229 bl 69b8 pthread_cond_destroy (&r_chain->cond); 6110: e1a00006 mov r0, r6 6114: eb00015b bl 6688 free (r_chain); 6118: e1a00005 mov r0, r5 611c: ebfff2f6 bl 2cfc /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { 6120: e5943054 ldr r3, [r4, #84] ; 0x54 6124: e59f20b0 ldr r2, [pc, #176] ; 61dc 6128: e1530002 cmp r3, r2 612c: 1a000018 bne 6194 AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; 6130: e5943068 ldr r3, [r4, #104] ; 0x68 6134: e2833001 add r3, r3, #1 6138: e5843068 str r3, [r4, #104] ; 0x68 --aio_request_queue.active_threads; 613c: e5943064 ldr r3, [r4, #100] ; 0x64 clock_gettime (CLOCK_REALTIME, &timeout); 6140: e1a01007 mov r1, r7 signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; 6144: e2433001 sub r3, r3, #1 clock_gettime (CLOCK_REALTIME, &timeout); 6148: e3a00001 mov r0, #1 signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; 614c: e5843064 str r3, [r4, #100] ; 0x64 clock_gettime (CLOCK_REALTIME, &timeout); 6150: eb00012e bl 6610 timeout.tv_sec += 3; 6154: e59d3020 ldr r3, [sp, #32] timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 6158: e2880004 add r0, r8, #4 AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 615c: e2833003 add r3, r3, #3 timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 6160: e1a01008 mov r1, r8 6164: e1a02007 mov r2, r7 AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 6168: e58d3020 str r3, [sp, #32] timeout.tv_nsec = 0; 616c: e58d9024 str r9, [sp, #36] ; 0x24 result = pthread_cond_timedwait (&aio_request_queue.new_req, 6170: eb0001bb bl 6864 &aio_request_queue.mutex, &timeout); /* If no new fd chain was added in the idle requests then this thread is finished */ if (result == ETIMEDOUT) { 6174: e3500074 cmp r0, #116 ; 0x74 6178: 1a000005 bne 6194 AIO_printf ("Etimeout\n"); --aio_request_queue.idle_threads; 617c: e5983068 ldr r3, [r8, #104] ; 0x68 pthread_mutex_unlock (&aio_request_queue.mutex); 6180: e1a00008 mov r0, r8 /* If no new fd chain was added in the idle requests then this thread is finished */ if (result == ETIMEDOUT) { AIO_printf ("Etimeout\n"); --aio_request_queue.idle_threads; 6184: e2433001 sub r3, r3, #1 6188: e5883068 str r3, [r8, #104] ; 0x68 pthread_mutex_unlock (&aio_request_queue.mutex); 618c: eb0002c6 bl 6cac return NULL; 6190: ea00000d b 61cc } } /* Otherwise move this chain to the working chain and start the loop all over again */ AIO_printf ("Work on idle\n"); --aio_request_queue.idle_threads; 6194: e5943068 ldr r3, [r4, #104] ; 0x68 6198: e2433001 sub r3, r3, #1 } } AIO_printf ("Thread finished\n"); return NULL; } 619c: e5945054 ldr r5, [r4, #84] ; 0x54 } } /* Otherwise move this chain to the working chain and start the loop all over again */ AIO_printf ("Work on idle\n"); --aio_request_queue.idle_threads; 61a0: e5843068 str r3, [r4, #104] ; 0x68 ++aio_request_queue.active_threads; 61a4: e5943064 ldr r3, [r4, #100] ; 0x64 61a8: e1a00005 mov r0, r5 61ac: e2833001 add r3, r3, #1 61b0: e5843064 str r3, [r4, #100] ; 0x64 61b4: eb0008b4 bl 848c <_Chain_Extract> node = rtems_chain_first (&aio_request_queue.idle_req); rtems_chain_extract (node); r_chain = (rtems_aio_request_chain *) node; rtems_aio_move_to_work (r_chain); 61b8: e1a00005 mov r0, r5 61bc: ebffff65 bl 5f58 } } /* If there was a request added in the initial fd chain then release the mutex and process it */ pthread_mutex_unlock (&aio_request_queue.mutex); 61c0: e59f0010 ldr r0, [pc, #16] ; 61d8 61c4: eb0002b8 bl 6cac 61c8: eaffff77 b 5fac } } AIO_printf ("Thread finished\n"); return NULL; } 61cc: e3a00000 mov r0, #0 61d0: e28dd02c add sp, sp, #44 ; 0x2c 61d4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00005df0 : * 0 - if initialization succeeded */ int rtems_aio_init (void) { 5df0: e92d4010 push {r4, lr} int result = 0; result = pthread_attr_init (&aio_request_queue.attr); 5df4: e59f00a4 ldr r0, [pc, #164] ; 5ea0 5df8: eb0003ed bl 6db4 if (result != 0) 5dfc: e2504000 subs r4, r0, #0 5e00: 1a000024 bne 5e98 return result; result = 5e04: e59f0094 ldr r0, [pc, #148] ; 5ea0 5e08: e1a01004 mov r1, r4 5e0c: eb0003fa bl 6dfc pthread_attr_setdetachstate (&aio_request_queue.attr, PTHREAD_CREATE_DETACHED); if (result != 0) 5e10: e3500000 cmp r0, #0 pthread_attr_destroy (&aio_request_queue.attr); 5e14: 159f0084 ldrne r0, [pc, #132] ; 5ea0 5e18: 1b0003dc blne 6d90 result = pthread_mutex_init (&aio_request_queue.mutex, NULL); 5e1c: e59f0080 ldr r0, [pc, #128] ; 5ea4 5e20: e3a01000 mov r1, #0 5e24: eb00032f bl 6ae8 if (result != 0) 5e28: e3500000 cmp r0, #0 pthread_attr_destroy (&aio_request_queue.attr); 5e2c: 159f006c ldrne r0, [pc, #108] ; 5ea0 5e30: 1b0003d6 blne 6d90 result = pthread_cond_init (&aio_request_queue.new_req, NULL); 5e34: e59f006c ldr r0, [pc, #108] ; 5ea8 5e38: e3a01000 mov r1, #0 5e3c: eb000241 bl 6748 if (result != 0) { 5e40: e2504000 subs r4, r0, #0 5e44: 0a000003 beq 5e58 pthread_mutex_destroy (&aio_request_queue.mutex); 5e48: e59f0054 ldr r0, [pc, #84] ; 5ea4 <== NOT EXECUTED 5e4c: eb0002d9 bl 69b8 <== NOT EXECUTED pthread_attr_destroy (&aio_request_queue.attr); 5e50: e59f0048 ldr r0, [pc, #72] ; 5ea0 <== NOT EXECUTED 5e54: eb0003cd bl 6d90 <== NOT EXECUTED ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 5e58: e59f3044 ldr r3, [pc, #68] ; 5ea4 5e5c: e283204c add r2, r3, #76 ; 0x4c head->previous = NULL; tail->previous = head; 5e60: e2831048 add r1, r3, #72 ; 0x48 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 5e64: e5832048 str r2, [r3, #72] ; 0x48 head->previous = NULL; 5e68: e3a02000 mov r2, #0 5e6c: e583204c str r2, [r3, #76] ; 0x4c tail->previous = head; 5e70: e5831050 str r1, [r3, #80] ; 0x50 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 5e74: e5832058 str r2, [r3, #88] ; 0x58 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 5e78: e2831058 add r1, r3, #88 ; 0x58 } rtems_chain_initialize_empty (&aio_request_queue.work_req); rtems_chain_initialize_empty (&aio_request_queue.idle_req); aio_request_queue.active_threads = 0; 5e7c: e5832064 str r2, [r3, #100] ; 0x64 aio_request_queue.idle_threads = 0; 5e80: e5832068 str r2, [r3, #104] ; 0x68 aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 5e84: e59f2020 ldr r2, [pc, #32] ; 5eac 5e88: e5831054 str r1, [r3, #84] ; 0x54 head->previous = NULL; tail->previous = head; 5e8c: e2831054 add r1, r3, #84 ; 0x54 5e90: e583105c str r1, [r3, #92] ; 0x5c 5e94: e5832060 str r2, [r3, #96] ; 0x60 return result; } 5e98: e1a00004 mov r0, r4 5e9c: e8bd8010 pop {r4, pc} =============================================================================== 000061e0 : 61e0: e1a03000 mov r3, r0 61e4: e4932004 ldr r2, [r3], #4 rtems_chain_node *node; AIO_printf ("FD exists \n"); node = rtems_chain_first (chain); if (rtems_chain_is_empty (chain)) { 61e8: e1520003 cmp r2, r3 * NONE */ void rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req) { 61ec: e1a0c001 mov ip, r1 rtems_chain_node *node; AIO_printf ("FD exists \n"); node = rtems_chain_first (chain); if (rtems_chain_is_empty (chain)) { 61f0: 0a00000d beq 622c AIO_printf ("First in chain \n"); rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 61f4: e5921014 ldr r1, [r2, #20] while (req->aiocbp->aio_reqprio > prio && 61f8: e59c0014 ldr r0, [ip, #20] if (rtems_chain_is_empty (chain)) { AIO_printf ("First in chain \n"); rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 61fc: e5911014 ldr r1, [r1, #20] while (req->aiocbp->aio_reqprio > prio && 6200: e5900014 ldr r0, [r0, #20] 6204: ea000002 b 6214 } } AIO_printf ("Thread finished\n"); return NULL; } 6208: e5922000 ldr r2, [r2] <== NOT EXECUTED int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; while (req->aiocbp->aio_reqprio > prio && !rtems_chain_is_tail (chain, node)) { node = rtems_chain_next (node); prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 620c: e5921014 ldr r1, [r2, #20] <== NOT EXECUTED 6210: e5911014 ldr r1, [r1, #20] <== NOT EXECUTED rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; while (req->aiocbp->aio_reqprio > prio && 6214: e1500001 cmp r0, r1 6218: da000001 ble 6224 621c: e1520003 cmp r2, r3 <== NOT EXECUTED 6220: 1afffff8 bne 6208 <== NOT EXECUTED RTEMS_INLINE_ROUTINE void rtems_chain_insert( rtems_chain_node *after_node, rtems_chain_node *the_node ) { _Chain_Insert( after_node, the_node ); 6224: e5920004 ldr r0, [r2, #4] 6228: e1a0100c mov r1, ip 622c: ea0008ab b 84e0 <_Chain_Insert> =============================================================================== 00006278 : * AIO_NOTCANCELED - if request was not canceled * AIO_CANCELED - if request was canceled */ int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp) { 6278: e92d4010 push {r4, lr} } } AIO_printf ("Thread finished\n"); return NULL; } 627c: e1a03000 mov r3, r0 6280: e4934004 ldr r4, [r3], #4 * AIO_CANCELED - if request was canceled */ int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp) { if (rtems_chain_is_empty (chain)) 6284: e1540003 cmp r4, r3 return AIO_ALLDONE; 6288: 03a00002 moveq r0, #2 * AIO_CANCELED - if request was canceled */ int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp) { if (rtems_chain_is_empty (chain)) 628c: 1a000003 bne 62a0 6290: e8bd8010 pop {r4, pc} } } AIO_printf ("Thread finished\n"); return NULL; } 6294: e5904000 ldr r4, [r0] <== NOT EXECUTED rtems_chain_node *node = rtems_chain_first (chain); rtems_aio_request *current; current = (rtems_aio_request *) node; while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) { 6298: e1540003 cmp r4, r3 <== NOT EXECUTED 629c: 0a00000d beq 62d8 <== NOT EXECUTED 62a0: e5942014 ldr r2, [r4, #20] 62a4: e1520001 cmp r2, r1 node = rtems_chain_next (node); current = (rtems_aio_request *) node; 62a8: e1a00004 mov r0, r4 rtems_chain_node *node = rtems_chain_first (chain); rtems_aio_request *current; current = (rtems_aio_request *) node; while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) { 62ac: 1afffff8 bne 6294 62b0: eb000875 bl 848c <_Chain_Extract> if (rtems_chain_is_tail (chain, node)) return AIO_NOTCANCELED; else { rtems_chain_extract (node); current->aiocbp->error_code = ECANCELED; 62b4: e5943014 ldr r3, [r4, #20] 62b8: e3a0208c mov r2, #140 ; 0x8c 62bc: e5832030 str r2, [r3, #48] ; 0x30 current->aiocbp->return_value = -1; 62c0: e3e02000 mvn r2, #0 free (current); 62c4: e1a00004 mov r0, r4 return AIO_NOTCANCELED; else { rtems_chain_extract (node); current->aiocbp->error_code = ECANCELED; current->aiocbp->return_value = -1; 62c8: e5832034 str r2, [r3, #52] ; 0x34 free (current); 62cc: ebfff28a bl 2cfc } return AIO_CANCELED; 62d0: e3a00000 mov r0, #0 62d4: e8bd8010 pop {r4, pc} node = rtems_chain_next (node); current = (rtems_aio_request *) node; } if (rtems_chain_is_tail (chain, node)) return AIO_NOTCANCELED; 62d8: e3a00001 mov r0, #1 <== NOT EXECUTED current->aiocbp->return_value = -1; free (current); } return AIO_CANCELED; } 62dc: e8bd8010 pop {r4, pc} <== NOT EXECUTED =============================================================================== 00002738 : void rtems_cpu_usage_report_with_plugin( void *context, rtems_printk_plugin_t print ) { 2738: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} Timestamp_Control uptime, total, ran, last_context_switch; #else uint32_t total_units = 0; #endif if ( !print ) 273c: e251a000 subs sl, r1, #0 void rtems_cpu_usage_report_with_plugin( void *context, rtems_printk_plugin_t print ) { 2740: e24dd048 sub sp, sp, #72 ; 0x48 2744: e1a08000 mov r8, r0 Timestamp_Control uptime, total, ran, last_context_switch; #else uint32_t total_units = 0; #endif if ( !print ) 2748: 0a000059 beq 28b4 * When not using nanosecond CPU usage resolution, we have to count * the number of "ticks" we gave credit for to give the user a rough * guideline as to what each number means proportionally. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ last_context_switch = _Thread_Time_of_last_context_switch; 274c: e59f3168 ldr r3, [pc, #360] ; 28bc 2750: e8930018 ldm r3, {r3, r4} _TOD_Get_uptime( &uptime ); 2754: e28d5038 add r5, sp, #56 ; 0x38 * When not using nanosecond CPU usage resolution, we have to count * the number of "ticks" we gave credit for to give the user a rough * guideline as to what each number means proportionally. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ last_context_switch = _Thread_Time_of_last_context_switch; 2758: e58d3020 str r3, [sp, #32] 275c: e58d4024 str r4, [sp, #36] ; 0x24 _TOD_Get_uptime( &uptime ); 2760: e1a00005 mov r0, r5 _Timestamp_Subtract( &CPU_usage_Uptime_at_last_reset, &uptime, &total ); 2764: e28d4030 add r4, sp, #48 ; 0x30 * the number of "ticks" we gave credit for to give the user a rough * guideline as to what each number means proportionally. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ last_context_switch = _Thread_Time_of_last_context_switch; _TOD_Get_uptime( &uptime ); 2768: eb00147d bl 7964 <_TOD_Get_uptime> _Timestamp_Subtract( &CPU_usage_Uptime_at_last_reset, &uptime, &total ); 276c: e1a01005 mov r1, r5 2770: e59f0148 ldr r0, [pc, #328] ; 28c0 2774: e1a02004 mov r2, r4 2778: eb001d34 bl 9c50 <_Timespec_Subtract> } } } #endif (*print)( 277c: e1a00008 mov r0, r8 2780: e59f113c ldr r1, [pc, #316] ; 28c4 2784: e1a0e00f mov lr, pc 2788: e12fff1a bx sl 278c: e59f5134 ldr r5, [pc, #308] ; 28c8 the_thread = (Thread_Control *)information->local_table[ i ]; if ( !the_thread ) continue; rtems_object_get_name( the_thread->Object.id, sizeof(name), name ); 2790: e28db008 add fp, sp, #8 #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 2794: e5b53004 ldr r3, [r5, #4]! 2798: e5936004 ldr r6, [r3, #4] if ( information ) { 279c: e3560000 cmp r6, #0 27a0: 13a07001 movne r7, #1 * since the last context switch. */ ran = the_thread->cpu_time_used; if ( _Thread_Executing->Object.id == the_thread->Object.id ) { Timestamp_Control used; _Timestamp_Subtract( &last_context_switch, &uptime, &used ); 27a4: 128d9018 addne r9, sp, #24 if ( !_Objects_Information_table[ api_index ] ) continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; if ( information ) { 27a8: 1a000032 bne 2878 27ac: ea000034 b 2884 <== NOT EXECUTED for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 27b0: e596301c ldr r3, [r6, #28] 27b4: e7934107 ldr r4, [r3, r7, lsl #2] if ( !the_thread ) 27b8: e3540000 cmp r4, #0 27bc: 0a00002c beq 2874 continue; rtems_object_get_name( the_thread->Object.id, sizeof(name), name ); 27c0: e3a0100d mov r1, #13 27c4: e1a0200b mov r2, fp 27c8: e5940008 ldr r0, [r4, #8] 27cc: eb000fc5 bl 66e8 (*print)( 27d0: e5942008 ldr r2, [r4, #8] 27d4: e1a0300b mov r3, fp 27d8: e1a00008 mov r0, r8 27dc: e59f10e8 ldr r1, [pc, #232] ; 28cc 27e0: e1a0e00f mov lr, pc 27e4: e12fff1a bx sl #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ /* * If this is the currently executing thread, account for time * since the last context switch. */ ran = the_thread->cpu_time_used; 27e8: e2843084 add r3, r4, #132 ; 0x84 27ec: e893000c ldm r3, {r2, r3} 27f0: e58d2028 str r2, [sp, #40] ; 0x28 27f4: e58d302c str r3, [sp, #44] ; 0x2c if ( _Thread_Executing->Object.id == the_thread->Object.id ) { 27f8: e59f20d0 ldr r2, [pc, #208] ; 28d0 27fc: e5923004 ldr r3, [r2, #4] 2800: e5932008 ldr r2, [r3, #8] 2804: e5943008 ldr r3, [r4, #8] 2808: e1520003 cmp r2, r3 280c: 1a000006 bne 282c Timestamp_Control used; _Timestamp_Subtract( &last_context_switch, &uptime, &used ); 2810: e28d0020 add r0, sp, #32 2814: e28d1038 add r1, sp, #56 ; 0x38 2818: e1a02009 mov r2, r9 281c: eb001d0b bl 9c50 <_Timespec_Subtract> _Timestamp_Add_to( &ran, &used ); 2820: e28d0028 add r0, sp, #40 ; 0x28 2824: e1a01009 mov r1, r9 2828: eb001ccd bl 9b64 <_Timespec_Add_to> }; _Timestamp_Divide( &ran, &total, &ival, &fval ); 282c: e28d2044 add r2, sp, #68 ; 0x44 2830: e28d3040 add r3, sp, #64 ; 0x40 2834: e28d0028 add r0, sp, #40 ; 0x28 2838: e28d1030 add r1, sp, #48 ; 0x30 283c: eb001ce0 bl 9bc4 <_Timespec_Divide> /* * Print the information */ (*print)( context, 2840: e3a01ffa mov r1, #1000 ; 0x3e8 2844: e59d002c ldr r0, [sp, #44] ; 0x2c 2848: eb00568d bl 18284 <__aeabi_uidiv> 284c: e59d2044 ldr r2, [sp, #68] ; 0x44 2850: e58d2000 str r2, [sp] 2854: e59d2040 ldr r2, [sp, #64] ; 0x40 2858: e1a03000 mov r3, r0 285c: e58d2004 str r2, [sp, #4] 2860: e1a00008 mov r0, r8 2864: e59f1068 ldr r1, [pc, #104] ; 28d4 2868: e59d2028 ldr r2, [sp, #40] ; 0x28 286c: e1a0e00f mov lr, pc 2870: e12fff1a bx sl continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; if ( information ) { for ( i=1 ; i <= information->maximum ; i++ ) { 2874: e2877001 add r7, r7, #1 2878: e1d631b0 ldrh r3, [r6, #16] 287c: e1570003 cmp r7, r3 2880: 9affffca bls 27b0 " ID | NAME | TICKS | PERCENT\n" #endif "------------+----------------------------------------+---------------+---------\n" ); for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 2884: e59f304c ldr r3, [pc, #76] ; 28d8 2888: e1550003 cmp r5, r3 288c: 1affffc0 bne 2794 } } } #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( 2890: e3a01ffa mov r1, #1000 ; 0x3e8 2894: e59d0034 ldr r0, [sp, #52] ; 0x34 2898: eb005679 bl 18284 <__aeabi_uidiv> 289c: e59f1038 ldr r1, [pc, #56] ; 28dc 28a0: e1a03000 mov r3, r0 28a4: e59d2030 ldr r2, [sp, #48] ; 0x30 28a8: e1a00008 mov r0, r8 28ac: e1a0e00f mov lr, pc 28b0: e12fff1a bx sl "-------------------------------------------------------------------------------\n", _Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset, total_units ); #endif } 28b4: e28dd048 add sp, sp, #72 ; 0x48 28b8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00002bcc : int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *)) { 2bcc: e92d4070 push {r4, r5, r6, lr} 2bd0: e1a06000 mov r6, r0 * pointer to the buffer that will hold the value of the key itself. * We have to to this, because the others functions on this interface * deal with the value of the key, as used with the POSIX API. */ /* Do not pull your hair, trust me this works. :-) */ __gthread_key_t new_key = (__gthread_key_t) malloc( sizeof( *new_key ) ); 2bd4: e3a00008 mov r0, #8 } return 0; } int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *)) { 2bd8: e1a05001 mov r5, r1 * pointer to the buffer that will hold the value of the key itself. * We have to to this, because the others functions on this interface * deal with the value of the key, as used with the POSIX API. */ /* Do not pull your hair, trust me this works. :-) */ __gthread_key_t new_key = (__gthread_key_t) malloc( sizeof( *new_key ) ); 2bdc: eb0000fa bl 2fcc 2be0: e1a04000 mov r4, r0 *key = new_key; 2be4: e5860000 str r0, [r6] "gxx_wrappers: create key=%x, dtor=%x, new_key=%x\n", key, dtor, new_key ); #endif /* register with RTEMS the buffer that will hold the key values */ status = rtems_task_variable_add( RTEMS_SELF, (void **)new_key, dtor ); 2be8: e1a01004 mov r1, r4 * deal with the value of the key, as used with the POSIX API. */ /* Do not pull your hair, trust me this works. :-) */ __gthread_key_t new_key = (__gthread_key_t) malloc( sizeof( *new_key ) ); *key = new_key; new_key->val = NULL; 2bec: e3a00000 mov r0, #0 "gxx_wrappers: create key=%x, dtor=%x, new_key=%x\n", key, dtor, new_key ); #endif /* register with RTEMS the buffer that will hold the key values */ status = rtems_task_variable_add( RTEMS_SELF, (void **)new_key, dtor ); 2bf0: e1a02005 mov r2, r5 * deal with the value of the key, as used with the POSIX API. */ /* Do not pull your hair, trust me this works. :-) */ __gthread_key_t new_key = (__gthread_key_t) malloc( sizeof( *new_key ) ); *key = new_key; new_key->val = NULL; 2bf4: e8840021 stm r4, {r0, r5} "gxx_wrappers: create key=%x, dtor=%x, new_key=%x\n", key, dtor, new_key ); #endif /* register with RTEMS the buffer that will hold the key values */ status = rtems_task_variable_add( RTEMS_SELF, (void **)new_key, dtor ); 2bf8: eb000e07 bl 641c if ( status == RTEMS_SUCCESSFUL ) 2bfc: e3500000 cmp r0, #0 2c00: 08bd8070 popeq {r4, r5, r6, pc} return 0; free( new_key ); 2c04: e1a00004 mov r0, r4 <== NOT EXECUTED 2c08: ebffff95 bl 2a64 <== NOT EXECUTED return -1; 2c0c: e3e00000 mvn r0, #0 <== NOT EXECUTED } 2c10: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED =============================================================================== 00009a08 : uint32_t flags ) { uint32_t fcntl_flags = 0; if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) { 9a08: e2003006 and r3, r0, #6 9a0c: e3530006 cmp r3, #6 fcntl_flags |= O_RDWR; 9a10: 03a03002 moveq r3, #2 uint32_t flags ) { uint32_t fcntl_flags = 0; if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) { 9a14: 0a000005 beq 9a30 fcntl_flags |= O_RDWR; } else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) { 9a18: e3100002 tst r0, #2 fcntl_flags |= O_RDONLY; 9a1c: 13a03000 movne r3, #0 { uint32_t fcntl_flags = 0; if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) { fcntl_flags |= O_RDWR; } else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) { 9a20: 1a000002 bne 9a30 ) { uint32_t fcntl_flags = 0; if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) { fcntl_flags |= O_RDWR; 9a24: e3100004 tst r0, #4 <== NOT EXECUTED 9a28: 03a03000 moveq r3, #0 <== NOT EXECUTED 9a2c: 13a03001 movne r3, #1 <== NOT EXECUTED fcntl_flags |= O_RDONLY; } else if ( (flags & LIBIO_FLAGS_WRITE) == LIBIO_FLAGS_WRITE) { fcntl_flags |= O_WRONLY; } if ( (flags & LIBIO_FLAGS_NO_DELAY) == LIBIO_FLAGS_NO_DELAY ) { 9a30: e3100001 tst r0, #1 fcntl_flags |= O_NONBLOCK; 9a34: 13833901 orrne r3, r3, #16384 ; 0x4000 } if ( (flags & LIBIO_FLAGS_APPEND) == LIBIO_FLAGS_APPEND ) { 9a38: e3100c02 tst r0, #512 ; 0x200 fcntl_flags |= O_APPEND; 9a3c: 13833008 orrne r3, r3, #8 } if ( (flags & LIBIO_FLAGS_CREATE) == LIBIO_FLAGS_CREATE ) { 9a40: e3100b01 tst r0, #1024 ; 0x400 fcntl_flags |= O_CREAT; 9a44: 13833c02 orrne r3, r3, #512 ; 0x200 } return fcntl_flags; } 9a48: e1a00003 mov r0, r3 9a4c: e12fff1e bx lr =============================================================================== 000022dc : /* * Check if blown */ bool rtems_stack_checker_is_blown( void ) { 22dc: e92d4810 push {r4, fp, lr} Stack_Control *the_stack = &_Thread_Executing->Start.Initial_stack; 22e0: e59f3078 ldr r3, [pc, #120] ; 2360 22e4: e5933004 ldr r3, [r3, #4] ) { #if defined(__GNUC__) void *sp = __builtin_frame_address(0); if ( sp < the_stack->area ) { 22e8: e59300bc ldr r0, [r3, #188] ; 0xbc /* * Check if blown */ bool rtems_stack_checker_is_blown( void ) { 22ec: e28db008 add fp, sp, #8 ) { #if defined(__GNUC__) void *sp = __builtin_frame_address(0); if ( sp < the_stack->area ) { 22f0: e15b0000 cmp fp, r0 return false; 22f4: 33a04000 movcc r4, #0 ) { #if defined(__GNUC__) void *sp = __builtin_frame_address(0); if ( sp < the_stack->area ) { 22f8: 3a000004 bcc 2310 return false; } if ( sp > (the_stack->area + the_stack->size) ) { 22fc: e59340b8 ldr r4, [r3, #184] ; 0xb8 2300: e0804004 add r4, r0, r4 } /* * Check if blown */ bool rtems_stack_checker_is_blown( void ) 2304: e15b0004 cmp fp, r4 2308: 83a04000 movhi r4, #0 230c: 93a04001 movls r4, #1 /* * The stack checker must be initialized before the pattern is there * to check. */ if ( Stack_check_Initialized ) { 2310: e59f304c ldr r3, [pc, #76] ; 2364 2314: e5933008 ldr r3, [r3, #8] 2318: e3530000 cmp r3, #0 */ bool rtems_stack_checker_is_blown( void ) { Stack_Control *the_stack = &_Thread_Executing->Start.Initial_stack; bool sp_ok; bool pattern_ok = true; 231c: 03a01001 moveq r1, #1 /* * The stack checker must be initialized before the pattern is there * to check. */ if ( Stack_check_Initialized ) { 2320: 0a000005 beq 233c pattern_ok = (!memcmp( 2324: e59f103c ldr r1, [pc, #60] ; 2368 2328: e2800008 add r0, r0, #8 232c: e3a02010 mov r2, #16 2330: eb00377d bl 1012c 2334: e2701001 rsbs r1, r0, #1 2338: 33a01000 movcc r1, #0 /* * Let's report as much as we can. */ if ( !sp_ok || !pattern_ok ) { 233c: e3540000 cmp r4, #0 2340: 0a000001 beq 234c 2344: e3510000 cmp r1, #0 2348: 1a000002 bne 2358 Stack_check_report_blown_task( _Thread_Executing, pattern_ok ); 234c: e59f300c ldr r3, [pc, #12] ; 2360 <== NOT EXECUTED 2350: e5930004 ldr r0, [r3, #4] <== NOT EXECUTED 2354: ebffff9d bl 21d0 <== NOT EXECUTED /* * The Stack Pointer and the Pattern Area are OK so return false. */ return false; } 2358: e3a00000 mov r0, #0 235c: e8bd8810 pop {r4, fp, pc} =============================================================================== 0000b578 : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { b578: e92d40f1 push {r0, r4, r5, r6, r7, lr} STRING_TO_INPUT_TYPE result; char *end; if ( !n ) b57c: e2514000 subs r4, r1, #0 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { b580: e1a05000 mov r5, r0 b584: e1a06002 mov r6, r2 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; b588: 03a00009 moveq r0, #9 ) { STRING_TO_INPUT_TYPE result; char *end; if ( !n ) b58c: 0a000018 beq b5f4 return RTEMS_INVALID_ADDRESS; errno = 0; b590: eb000ad4 bl e0e8 <__errno> b594: e3a03000 mov r3, #0 b598: e5803000 str r3, [r0] *n = 0; #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); #elif defined(STRING_TO_POINTER) result = STRING_TO_METHOD( s, &end, 16 ); b59c: e1a0100d mov r1, sp if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; b5a0: e5843000 str r3, [r4] #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); #elif defined(STRING_TO_POINTER) result = STRING_TO_METHOD( s, &end, 16 ); b5a4: e1a00005 mov r0, r5 b5a8: e3a02010 mov r2, #16 b5ac: eb0017fc bl 115a4 #elif defined(STRING_TO_INTEGER) result = STRING_TO_METHOD( s, &end, base ); #endif /* If the user wants the end pointer back, then return it. */ if ( endptr ) b5b0: e3560000 cmp r6, #0 *endptr = end; b5b4: 159d3000 ldrne r3, [sp] b5b8: 15863000 strne r3, [r6] /* nothing was converted */ if ( end == s ) b5bc: e59d3000 ldr r3, [sp] b5c0: e1530005 cmp r3, r5 *n = 0; #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); #elif defined(STRING_TO_POINTER) result = STRING_TO_METHOD( s, &end, 16 ); b5c4: e1a07000 mov r7, r0 if ( endptr ) *endptr = end; /* nothing was converted */ if ( end == s ) return RTEMS_NOT_DEFINED; b5c8: 03a0000b moveq r0, #11 /* If the user wants the end pointer back, then return it. */ if ( endptr ) *endptr = end; /* nothing was converted */ if ( end == s ) b5cc: 0a000008 beq b5f4 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) b5d0: e3770001 cmn r7, #1 b5d4: 1a000004 bne b5ec b5d8: eb000ac2 bl e0e8 <__errno> <== NOT EXECUTED b5dc: e5903000 ldr r3, [r0] <== NOT EXECUTED b5e0: e3530022 cmp r3, #34 ; 0x22 <== NOT EXECUTED return RTEMS_INVALID_NUMBER; b5e4: 03a0000a moveq r0, #10 <== NOT EXECUTED return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) b5e8: 0a000001 beq b5f4 <== NOT EXECUTED if ( (result == STRING_TO_MIN) && (errno == ERANGE)) return RTEMS_INVALID_NUMBER; #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; b5ec: e5847000 str r7, [r4] #else *n = (STRING_TO_TYPE) result; #endif return RTEMS_SUCCESSFUL; b5f0: e3a00000 mov r0, #0 } b5f4: e8bd80f8 pop {r3, r4, r5, r6, r7, pc} =============================================================================== 00001cc4 : int rtems_tarfs_load( char *mountpoint, uint8_t *tar_image, size_t tar_size ) { 1cc4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 1cc8: e24ddf6b sub sp, sp, #428 ; 0x1ac 1ccc: e58d1010 str r1, [sp, #16] 1cd0: e58d2018 str r2, [sp, #24] 1cd4: e58d000c str r0, [sp, #12] int offset; unsigned long nblocks; IMFS_jnode_t *node; int status; status = rtems_filesystem_evaluate_path( 1cd8: eb003f4b bl 11a0c 1cdc: e3a02000 mov r2, #0 1ce0: e1a01000 mov r1, r0 1ce4: e28d3f65 add r3, sp, #404 ; 0x194 1ce8: e59d000c ldr r0, [sp, #12] 1cec: e58d2000 str r2, [sp] 1cf0: eb00029b bl 2764 strlen(mountpoint), 0, &root_loc, 0 ); if (status != 0) 1cf4: e2504000 subs r4, r0, #0 1cf8: 1a00006c bne 1eb0 return -1; if (root_loc.ops != &IMFS_ops && root_loc.ops != &fifoIMFS_ops) 1cfc: e59d31a0 ldr r3, [sp, #416] ; 0x1a0 1d00: e59f21c0 ldr r2, [pc, #448] ; 1ec8 1d04: e1530002 cmp r3, r2 1d08: 0a000005 beq 1d24 1d0c: e59f21b8 ldr r2, [pc, #440] ; 1ecc 1d10: e1530002 cmp r3, r2 1d14: 1a000065 bne 1eb0 1d18: ea000001 b 1d24 <== NOT EXECUTED 1d1c: e1a08004 mov r8, r4 1d20: ea000006 b 1d40 * should not have this path. */ else if (linkflag == REGTYPE) { const char *name; loc = root_loc; 1d24: e28d2f65 add r2, sp, #404 ; 0x194 1d28: e58d2004 str r2, [sp, #4] 0 ); if (status != 0) return -1; if (root_loc.ops != &IMFS_ops && root_loc.ops != &fifoIMFS_ops) 1d2c: e1a08004 mov r8, r4 hdr_ptr = (char *) &tar_image[offset]; offset += 512; if (strncmp(&hdr_ptr[257], "ustar", 5)) break; strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); 1d30: e28d7f47 add r7, sp, #284 ; 0x11c * should not have this path. */ else if (linkflag == REGTYPE) { const char *name; loc = root_loc; 1d34: e28d9d06 add r9, sp, #384 ; 0x180 * - For directories, just create directories as usual. IMFS * will take care of the rest. * - For files, create a file node with special tarfs properties. */ if (linkflag == DIRTYPE) { strcpy(full_filename, mountpoint); 1d38: e28d501c add r5, sp, #28 1d3c: e1a0a004 mov sl, r4 /* * Create an IMFS node structure pointing to tar image memory. */ offset = 0; while (1) { if (offset + 512 > tar_size) 1d40: e59d3018 ldr r3, [sp, #24] 1d44: e2884c02 add r4, r8, #512 ; 0x200 1d48: e1540003 cmp r4, r3 1d4c: 8a000059 bhi 1eb8 break; /* * Read a header. */ hdr_ptr = (char *) &tar_image[offset]; 1d50: e59de010 ldr lr, [sp, #16] 1d54: e08e8008 add r8, lr, r8 offset += 512; if (strncmp(&hdr_ptr[257], "ustar", 5)) 1d58: e2880c01 add r0, r8, #256 ; 0x100 1d5c: e2800001 add r0, r0, #1 1d60: e59f1168 ldr r1, [pc, #360] ; 1ed0 1d64: e3a02005 mov r2, #5 1d68: eb003f3f bl 11a6c 1d6c: e2506000 subs r6, r0, #0 1d70: 1a000050 bne 1eb8 break; strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); 1d74: e3a02063 mov r2, #99 ; 0x63 1d78: e1a01008 mov r1, r8 1d7c: e1a00007 mov r0, r7 1d80: eb003f9a bl 11bf0 filename[MAX_NAME_FIELD_SIZE] = '\0'; 1d84: e5cd617f strb r6, [sp, #383] ; 0x17f linkflag = hdr_ptr[156]; file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8); 1d88: e3a01008 mov r1, #8 1d8c: e2880064 add r0, r8, #100 ; 0x64 break; strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); filename[MAX_NAME_FIELD_SIZE] = '\0'; linkflag = hdr_ptr[156]; 1d90: e5d8609c ldrb r6, [r8, #156] ; 0x9c file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8); 1d94: eb001d79 bl 9380 <_rtems_octal2ulong> file_size = _rtems_octal2ulong(&hdr_ptr[124], 12); 1d98: e3a0100c mov r1, #12 strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); filename[MAX_NAME_FIELD_SIZE] = '\0'; linkflag = hdr_ptr[156]; file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8); 1d9c: e58d0014 str r0, [sp, #20] file_size = _rtems_octal2ulong(&hdr_ptr[124], 12); 1da0: e288007c add r0, r8, #124 ; 0x7c 1da4: eb001d75 bl 9380 <_rtems_octal2ulong> hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8); 1da8: e3a01008 mov r1, #8 strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); filename[MAX_NAME_FIELD_SIZE] = '\0'; linkflag = hdr_ptr[156]; file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8); file_size = _rtems_octal2ulong(&hdr_ptr[124], 12); 1dac: e1a0b000 mov fp, r0 hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8); 1db0: e2880094 add r0, r8, #148 ; 0x94 1db4: eb001d71 bl 9380 <_rtems_octal2ulong> 1db8: e1a03000 mov r3, r0 if (_rtems_tar_header_checksum(hdr_ptr) != hdr_chksum) 1dbc: e1a00008 mov r0, r8 1dc0: e58d3008 str r3, [sp, #8] 1dc4: eb001d7b bl 93b8 <_rtems_tar_header_checksum> 1dc8: e59d3008 ldr r3, [sp, #8] 1dcc: e1500003 cmp r0, r3 1dd0: 1a000038 bne 1eb8 * Generate an IMFS node depending on the file type. * - For directories, just create directories as usual. IMFS * will take care of the rest. * - For files, create a file node with special tarfs properties. */ if (linkflag == DIRTYPE) { 1dd4: e3560035 cmp r6, #53 ; 0x35 1dd8: 1a000012 bne 1e28 strcpy(full_filename, mountpoint); 1ddc: e59d100c ldr r1, [sp, #12] 1de0: e1a00005 mov r0, r5 1de4: eb003d44 bl 112fc if (full_filename[strlen(full_filename)-1] != '/') 1de8: e1a00005 mov r0, r5 1dec: eb003f06 bl 11a0c 1df0: e28d2f6b add r2, sp, #428 ; 0x1ac 1df4: e0820000 add r0, r2, r0 1df8: e5503191 ldrb r3, [r0, #-401] ; 0x191 1dfc: e353002f cmp r3, #47 ; 0x2f strcat(full_filename, "/"); 1e00: 11a00005 movne r0, r5 1e04: 159f10c8 ldrne r1, [pc, #200] ; 1ed4 1e08: 1b003c84 blne 11020 strcat(full_filename, filename); 1e0c: e1a01007 mov r1, r7 1e10: e1a00005 mov r0, r5 1e14: eb003c81 bl 11020 mkdir(full_filename, S_IRWXU | S_IRWXG | S_IRWXO); 1e18: e1a00005 mov r0, r5 1e1c: e59f10b4 ldr r1, [pc, #180] ; 1ed8 1e20: eb000464 bl 2fb8 1e24: eaffffbc b 1d1c * IMFS_create_node was ONLY passed a NULL when we created the * root node. We added a new IMFS_create_root_node() so this * path no longer existed. The result was simpler code which * should not have this path. */ else if (linkflag == REGTYPE) { 1e28: e3560030 cmp r6, #48 ; 0x30 1e2c: 1affffba bne 1d1c const char *name; loc = root_loc; 1e30: e59dc004 ldr ip, [sp, #4] 1e34: e8bc000f ldm ip!, {r0, r1, r2, r3} 1e38: e1a0e009 mov lr, r9 1e3c: e8ae000f stmia lr!, {r0, r1, r2, r3} 1e40: e59c2000 ldr r2, [ip] if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { 1e44: e1a00007 mov r0, r7 * should not have this path. */ else if (linkflag == REGTYPE) { const char *name; loc = root_loc; 1e48: e58e2000 str r2, [lr] if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { 1e4c: e1a01009 mov r1, r9 1e50: e28d2f6a add r2, sp, #424 ; 0x1a8 1e54: eb00203d bl 9f50 1e58: e2506000 subs r6, r0, #0 1e5c: 1a00000d bne 1e98 node = IMFS_create_node( &loc, IMFS_LINEAR_FILE, (char *)name, (file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG, 1e60: e59d2014 ldr r2, [sp, #20] 1e64: e1a03b82 lsl r3, r2, #23 1e68: e1a03ba3 lsr r3, r3, #23 else if (linkflag == REGTYPE) { const char *name; loc = root_loc; if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { node = IMFS_create_node( 1e6c: e59d21a8 ldr r2, [sp, #424] ; 0x1a8 1e70: e3833902 orr r3, r3, #32768 ; 0x8000 1e74: e1a00009 mov r0, r9 1e78: e3a01006 mov r1, #6 1e7c: e58d6000 str r6, [sp] 1e80: eb001ea6 bl 9920 IMFS_LINEAR_FILE, (char *)name, (file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG, NULL ); node->info.linearfile.size = file_size; node->info.linearfile.direct = &tar_image[offset]; 1e84: e59d2010 ldr r2, [sp, #16] 1e88: e0823004 add r3, r2, r4 &loc, IMFS_LINEAR_FILE, (char *)name, (file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG, NULL ); node->info.linearfile.size = file_size; 1e8c: e580b050 str fp, [r0, #80] ; 0x50 1e90: e5806054 str r6, [r0, #84] ; 0x54 node->info.linearfile.direct = &tar_image[offset]; 1e94: e5803058 str r3, [r0, #88] ; 0x58 } nblocks = (((file_size) + 511) & ~511) / 512; 1e98: e28bbf7f add fp, fp, #508 ; 0x1fc 1e9c: e28bb003 add fp, fp, #3 offset += 512 * nblocks; 1ea0: e3cbbf7f bic fp, fp, #508 ; 0x1fc 1ea4: e3cbb003 bic fp, fp, #3 1ea8: e08b4004 add r4, fp, r4 1eac: eaffff9a b 1d1c ); if (status != 0) return -1; if (root_loc.ops != &IMFS_ops && root_loc.ops != &fifoIMFS_ops) return -1; 1eb0: e3e04000 mvn r4, #0 1eb4: ea000000 b 1ebc 1eb8: e1a0400a mov r4, sl nblocks = (((file_size) + 511) & ~511) / 512; offset += 512 * nblocks; } } return status; } 1ebc: e1a00004 mov r0, r4 1ec0: e28ddf6b add sp, sp, #428 ; 0x1ac 1ec4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 0000ca44 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { ca44: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) ca48: e252a000 subs sl, r2, #0 rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { ca4c: e1a04000 mov r4, r0 ca50: e1a05001 mov r5, r1 bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; ca54: 03a00009 moveq r0, #9 ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) ca58: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc} return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; ca5c: e59f313c ldr r3, [pc, #316] ; cba0 ca60: e5937004 ldr r7, [r3, #4] api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; ca64: e5d78074 ldrb r8, [r7, #116] ; 0x74 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; ca68: e59760f8 ldr r6, [r7, #248] ; 0xf8 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) ca6c: e597307c ldr r3, [r7, #124] ; 0x7c executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; ca70: e3580000 cmp r8, #0 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; ca74: e5d69008 ldrb r9, [r6, #8] executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; ca78: 03a08c01 moveq r8, #256 ; 0x100 ca7c: 13a08000 movne r8, #0 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) ca80: e3530000 cmp r3, #0 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; ca84: 13888c02 orrne r8, r8, #512 ; 0x200 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; ca88: e3590000 cmp r9, #0 ca8c: 03a09b01 moveq r9, #1024 ; 0x400 ca90: 13a09000 movne r9, #0 old_mode |= _ISR_Get_level(); ca94: ebffefe6 bl 8a34 <_CPU_ISR_Get_level> if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; ca98: e1899000 orr r9, r9, r0 old_mode |= _ISR_Get_level(); ca9c: e1898008 orr r8, r9, r8 *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) caa0: e3150c01 tst r5, #256 ; 0x100 old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; old_mode |= _ISR_Get_level(); *previous_mode_set = old_mode; caa4: e58a8000 str r8, [sl] /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) caa8: 0a000003 beq cabc executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; caac: e3140c01 tst r4, #256 ; 0x100 cab0: 13a03000 movne r3, #0 cab4: 03a03001 moveq r3, #1 cab8: e5c73074 strb r3, [r7, #116] ; 0x74 if ( mask & RTEMS_TIMESLICE_MASK ) { cabc: e3150c02 tst r5, #512 ; 0x200 cac0: 0a000006 beq cae0 if ( _Modes_Is_timeslice(mode_set) ) { cac4: e2143c02 ands r3, r4, #512 ; 0x200 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; cac8: 13a03001 movne r3, #1 cacc: 1587307c strne r3, [r7, #124] ; 0x7c executing->cpu_time_budget = _Thread_Ticks_per_timeslice; cad0: 159f30cc ldrne r3, [pc, #204] ; cba4 cad4: 15933000 ldrne r3, [r3] } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; cad8: 0587307c streq r3, [r7, #124] ; 0x7c executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; cadc: 15873078 strne r3, [r7, #120] ; 0x78 } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) cae0: e3150080 tst r5, #128 ; 0x80 cae4: 0a000001 beq caf0 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); cae8: e2040080 and r0, r4, #128 ; 0x80 caec: ebffefcb bl 8a20 <_CPU_ISR_Set_level> * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { caf0: e2150b01 ands r0, r5, #1024 ; 0x400 caf4: 0a000013 beq cb48 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( caf8: e3140b01 tst r4, #1024 ; 0x400 is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { cafc: e5d62008 ldrb r2, [r6, #8] * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( cb00: 13a03000 movne r3, #0 cb04: 03a03001 moveq r3, #1 is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { cb08: e1520003 cmp r2, r3 /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; cb0c: 03a00000 moveq r0, #0 if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { cb10: 0a00000c beq cb48 asr->is_enabled = is_asr_enabled; cb14: e5c63008 strb r3, [r6, #8] static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( cb18: e10f3000 mrs r3, CPSR cb1c: e3832080 orr r2, r3, #128 ; 0x80 cb20: e129f002 msr CPSR_fc, r2 { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); _signals = information->signals_pending; cb24: e2861014 add r1, r6, #20 cb28: e8910006 ldm r1, {r1, r2} information->signals_pending = information->signals_posted; information->signals_posted = _signals; cb2c: e5862014 str r2, [r6, #20] rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); _signals = information->signals_pending; information->signals_pending = information->signals_posted; cb30: e5861018 str r1, [r6, #24] static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( cb34: e129f003 msr CPSR_fc, r3 _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { cb38: e5960014 ldr r0, [r6, #20] /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; cb3c: e3500000 cmp r0, #0 cb40: 13a00001 movne r0, #1 cb44: 03a00000 moveq r0, #0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { cb48: e59f3058 ldr r3, [pc, #88] ; cba8 cb4c: e5933000 ldr r3, [r3] cb50: e3530003 cmp r3, #3 cb54: 1a00000f bne cb98 bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; cb58: e59f2040 ldr r2, [pc, #64] ; cba0 if ( are_signals_pending || cb5c: e3500000 cmp r0, #0 bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; cb60: e5923004 ldr r3, [r2, #4] if ( are_signals_pending || cb64: 1a000005 bne cb80 cb68: e5922008 ldr r2, [r2, #8] cb6c: e1530002 cmp r3, r2 cb70: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc} (!_Thread_Is_heir( executing ) && executing->is_preemptible) ) { cb74: e5d33074 ldrb r3, [r3, #116] ; 0x74 cb78: e3530000 cmp r3, #0 cb7c: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc} _Thread_Dispatch_necessary = true; cb80: e59f3018 ldr r3, [pc, #24] ; cba0 cb84: e3a02001 mov r2, #1 cb88: e5c32010 strb r2, [r3, #16] if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); cb8c: ebffea23 bl 7420 <_Thread_Dispatch> } return RTEMS_SUCCESSFUL; cb90: e3a00000 mov r0, #0 cb94: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} cb98: e3a00000 mov r0, #0 <== NOT EXECUTED } cb9c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED =============================================================================== 00003400 : rtems_status_code rtems_termios_close (void *arg) { rtems_libio_open_close_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 3400: e5903000 ldr r3, [r0] } } rtems_status_code rtems_termios_close (void *arg) { 3404: e92d4030 push {r4, r5, lr} rtems_libio_open_close_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 3408: e5934034 ldr r4, [r3, #52] ; 0x34 rtems_status_code sc; sc = rtems_semaphore_obtain( 340c: e59f317c ldr r3, [pc, #380] ; 3590 3410: e3a01000 mov r1, #0 } } rtems_status_code rtems_termios_close (void *arg) { 3414: e1a05000 mov r5, r0 rtems_libio_open_close_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; rtems_status_code sc; sc = rtems_semaphore_obtain( 3418: e1a02001 mov r2, r1 341c: e5930000 ldr r0, [r3] 3420: eb0007a5 bl 52bc rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 3424: e3500000 cmp r0, #0 3428: 1a000024 bne 34c0 rtems_fatal_error_occurred (sc); if (--tty->refcount == 0) { 342c: e5943008 ldr r3, [r4, #8] 3430: e2433001 sub r3, r3, #1 3434: e3530000 cmp r3, #0 3438: e5843008 str r3, [r4, #8] 343c: 1a00004e bne 357c if (rtems_termios_linesw[tty->t_line].l_close != NULL) { 3440: e59420cc ldr r2, [r4, #204] ; 0xcc 3444: e59f3148 ldr r3, [pc, #328] ; 3594 3448: e0833282 add r3, r3, r2, lsl #5 344c: e5931004 ldr r1, [r3, #4] 3450: e3510000 cmp r1, #0 3454: 0a000003 beq 3468 /* * call discipline-specific close */ sc = rtems_termios_linesw[tty->t_line].l_close(tty); 3458: e1a00004 mov r0, r4 345c: e1a0e00f mov lr, pc 3460: e12fff11 bx r1 3464: ea000008 b 348c } else { /* * default: just flush output buffer */ sc = rtems_semaphore_obtain(tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 3468: e5940018 ldr r0, [r4, #24] 346c: e1a02001 mov r2, r1 3470: eb000791 bl 52bc if (sc != RTEMS_SUCCESSFUL) { 3474: e3500000 cmp r0, #0 3478: 1a000010 bne 34c0 rtems_fatal_error_occurred (sc); } drainOutput (tty); 347c: e1a00004 mov r0, r4 3480: ebfffeb2 bl 2f50 rtems_semaphore_release (tty->osem); 3484: e5940018 ldr r0, [r4, #24] 3488: eb0007d1 bl 53d4 } if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 348c: e59430b4 ldr r3, [r4, #180] ; 0xb4 3490: e3530002 cmp r3, #2 3494: 1a00000a bne 34c4 /* * send "terminate" to I/O tasks */ sc = rtems_event_send( tty->rxTaskId, TERMIOS_RX_TERMINATE_EVENT ); 3498: e59400c4 ldr r0, [r4, #196] ; 0xc4 349c: e3a01001 mov r1, #1 34a0: eb000673 bl 4e74 if (sc != RTEMS_SUCCESSFUL) 34a4: e3500000 cmp r0, #0 34a8: 1a000004 bne 34c0 rtems_fatal_error_occurred (sc); sc = rtems_event_send( tty->txTaskId, TERMIOS_TX_TERMINATE_EVENT ); 34ac: e59400c8 ldr r0, [r4, #200] ; 0xc8 34b0: e3a01001 mov r1, #1 34b4: eb00066e bl 4e74 if (sc != RTEMS_SUCCESSFUL) 34b8: e3500000 cmp r0, #0 34bc: 0a000000 beq 34c4 rtems_fatal_error_occurred (sc); 34c0: eb000919 bl 592c <== NOT EXECUTED } if (tty->device.lastClose) 34c4: e594309c ldr r3, [r4, #156] ; 0x9c 34c8: e3530000 cmp r3, #0 (*tty->device.lastClose)(tty->major, tty->minor, arg); 34cc: 1284000c addne r0, r4, #12 34d0: 18900003 ldmne r0, {r0, r1} 34d4: 11a02005 movne r2, r5 34d8: 11a0e00f movne lr, pc 34dc: 112fff13 bxne r3 if (tty->forw == NULL) { 34e0: e894000c ldm r4, {r2, r3} 34e4: e3520000 cmp r2, #0 rtems_termios_ttyTail = tty->back; if ( rtems_termios_ttyTail != NULL ) { rtems_termios_ttyTail->forw = NULL; } } else { tty->forw->back = tty->back; 34e8: 15823004 strne r3, [r2, #4] if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); } if (tty->device.lastClose) (*tty->device.lastClose)(tty->major, tty->minor, arg); if (tty->forw == NULL) { 34ec: 1a000003 bne 3500 rtems_termios_ttyTail = tty->back; 34f0: e59f10a0 ldr r1, [pc, #160] ; 3598 if ( rtems_termios_ttyTail != NULL ) { 34f4: e3530000 cmp r3, #0 rtems_fatal_error_occurred (sc); } if (tty->device.lastClose) (*tty->device.lastClose)(tty->major, tty->minor, arg); if (tty->forw == NULL) { rtems_termios_ttyTail = tty->back; 34f8: e5813000 str r3, [r1] if ( rtems_termios_ttyTail != NULL ) { rtems_termios_ttyTail->forw = NULL; 34fc: 15832000 strne r2, [r3] } } else { tty->forw->back = tty->back; } if (tty->back == NULL) { 3500: e5942004 ldr r2, [r4, #4] 3504: e5943000 ldr r3, [r4] 3508: e3520000 cmp r2, #0 rtems_termios_ttyHead = tty->forw; if ( rtems_termios_ttyHead != NULL ) { rtems_termios_ttyHead->back = NULL; } } else { tty->back->forw = tty->forw; 350c: 15823000 strne r3, [r2] } } else { tty->forw->back = tty->back; } if (tty->back == NULL) { 3510: 1a000003 bne 3524 rtems_termios_ttyHead = tty->forw; 3514: e59f1080 ldr r1, [pc, #128] ; 359c if ( rtems_termios_ttyHead != NULL ) { 3518: e3530000 cmp r3, #0 } else { tty->forw->back = tty->back; } if (tty->back == NULL) { rtems_termios_ttyHead = tty->forw; 351c: e5813000 str r3, [r1] if ( rtems_termios_ttyHead != NULL ) { rtems_termios_ttyHead->back = NULL; 3520: 15832004 strne r2, [r3, #4] } } else { tty->back->forw = tty->forw; } rtems_semaphore_delete (tty->isem); 3524: e5940014 ldr r0, [r4, #20] 3528: eb00073c bl 5220 rtems_semaphore_delete (tty->osem); 352c: e5940018 ldr r0, [r4, #24] 3530: eb00073a bl 5220 rtems_semaphore_delete (tty->rawOutBuf.Semaphore); 3534: e594008c ldr r0, [r4, #140] ; 0x8c 3538: eb000738 bl 5220 if ((tty->device.pollRead == NULL) || 353c: e59430a0 ldr r3, [r4, #160] ; 0xa0 3540: e3530000 cmp r3, #0 3544: 0a000002 beq 3554 3548: e59430b4 ldr r3, [r4, #180] ; 0xb4 354c: e3530002 cmp r3, #2 3550: 1a000001 bne 355c (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)) rtems_semaphore_delete (tty->rawInBuf.Semaphore); 3554: e5940068 ldr r0, [r4, #104] ; 0x68 3558: eb000730 bl 5220 free (tty->rawInBuf.theBuf); 355c: e5940058 ldr r0, [r4, #88] ; 0x58 3560: ebfffae1 bl 20ec free (tty->rawOutBuf.theBuf); 3564: e594007c ldr r0, [r4, #124] ; 0x7c 3568: ebfffadf bl 20ec free (tty->cbuf); 356c: e594001c ldr r0, [r4, #28] 3570: ebfffadd bl 20ec free (tty); 3574: e1a00004 mov r0, r4 3578: ebfffadb bl 20ec } rtems_semaphore_release (rtems_termios_ttyMutex); 357c: e59f300c ldr r3, [pc, #12] ; 3590 3580: e5930000 ldr r0, [r3] 3584: eb000792 bl 53d4 return RTEMS_SUCCESSFUL; } 3588: e3a00000 mov r0, #0 358c: e8bd8030 pop {r4, r5, pc} =============================================================================== 0000491c : rtems_status_code sc; /* * sum up character count already sent */ tty->t_dqlen += len; 491c: e5902090 ldr r2, [r0, #144] ; 0x90 4920: e0822001 add r2, r2, r1 if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 4924: e59010b4 ldr r1, [r0, #180] ; 0xb4 4928: e3510002 cmp r1, #2 * for each transmitted character. * It returns number of characters left to transmit */ int rtems_termios_dequeue_characters (void *ttyp, int len) { 492c: e52de004 push {lr} ; (str lr, [sp, #-4]!) rtems_status_code sc; /* * sum up character count already sent */ tty->t_dqlen += len; 4930: e5802090 str r2, [r0, #144] ; 0x90 if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 4934: 1a000004 bne 494c /* * send wake up to transmitter task */ sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT); 4938: e59000c8 ldr r0, [r0, #200] ; 0xc8 493c: eb00014c bl 4e74 if (sc != RTEMS_SUCCESSFUL) 4940: e2503000 subs r3, r0, #0 4944: 0a00000d beq 4980 rtems_fatal_error_occurred (sc); 4948: eb0003f7 bl 592c <== NOT EXECUTED return 0; /* nothing to output in IRQ... */ } if (tty->t_line == PPPDISC ) { 494c: e59030cc ldr r3, [r0, #204] ; 0xcc 4950: e3530005 cmp r3, #5 4954: 1a000007 bne 4978 /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 4958: e59f3028 ldr r3, [pc, #40] ; 4988 495c: e59330b4 ldr r3, [r3, #180] ; 0xb4 4960: e3530000 cmp r3, #0 4964: 0a000005 beq 4980 rtems_termios_linesw[tty->t_line].l_start(tty); 4968: e1a0e00f mov lr, pc 496c: e12fff13 bx r3 } return 0; /* nothing to output in IRQ... */ 4970: e3a03000 mov r3, #0 4974: ea000001 b 4980 } return rtems_termios_refill_transmitter(tty); } 4978: e49de004 pop {lr} ; (ldr lr, [sp], #4) rtems_termios_linesw[tty->t_line].l_start(tty); } return 0; /* nothing to output in IRQ... */ } return rtems_termios_refill_transmitter(tty); 497c: eaffff5a b 46ec } 4980: e1a00003 mov r0, r3 4984: e49df004 pop {pc} ; (ldr pc, [sp], #4) =============================================================================== 000043e8 : * device receive interrupt handler. * Returns the number of characters dropped because of overflow. */ int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len) { 43e8: e92d4ff3 push {r0, r1, r4, r5, r6, r7, r8, r9, sl, fp, lr} char c; int dropped = 0; bool flow_rcv = false; /* true, if flow control char received */ rtems_interrupt_level level; if (rtems_termios_linesw[tty->t_line].l_rint != NULL) { 43ec: e59030cc ldr r3, [r0, #204] ; 0xcc 43f0: e59f7288 ldr r7, [pc, #648] ; 4680 43f4: e0873283 add r3, r7, r3, lsl #5 43f8: e5939010 ldr r9, [r3, #16] 43fc: e3590000 cmp r9, #0 * device receive interrupt handler. * Returns the number of characters dropped because of overflow. */ int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len) { 4400: e1a04000 mov r4, r0 4404: e1a06001 mov r6, r1 char c; int dropped = 0; bool flow_rcv = false; /* true, if flow control char received */ rtems_interrupt_level level; if (rtems_termios_linesw[tty->t_line].l_rint != NULL) { 4408: 11a05002 movne r5, r2 440c: 1a00000d bne 4448 /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); 4410: e2803030 add r3, r0, #48 ; 0x30 4414: e58d3000 str r3, [sp] if ((tty->flow_ctrl & FL_OSTOP) || (tty->rawOutBufState == rob_idle)) { /* if tx is stopped due to XOFF or out of data */ /* call write function here */ tty->flow_ctrl |= FL_ISNTXOF; (*tty->device.write)(tty->minor, 4418: e280304a add r3, r0, #74 ; 0x4a char c; int dropped = 0; bool flow_rcv = false; /* true, if flow control char received */ rtems_interrupt_level level; if (rtems_termios_linesw[tty->t_line].l_rint != NULL) { 441c: e1a08002 mov r8, r2 4420: e1a05009 mov r5, r9 if ((tty->flow_ctrl & FL_OSTOP) || (tty->rawOutBufState == rob_idle)) { /* if tx is stopped due to XOFF or out of data */ /* call write function here */ tty->flow_ctrl |= FL_ISNTXOF; (*tty->device.write)(tty->minor, 4424: e58d3004 str r3, [sp, #4] 4428: ea00008b b 465c rtems_interrupt_level level; if (rtems_termios_linesw[tty->t_line].l_rint != NULL) { while (len--) { c = *buf++; rtems_termios_linesw[tty->t_line].l_rint(c,tty); 442c: e59430cc ldr r3, [r4, #204] ; 0xcc 4430: e4d60001 ldrb r0, [r6], #1 4434: e0873283 add r3, r7, r3, lsl #5 4438: e1a01004 mov r1, r4 443c: e1a0e00f mov lr, pc 4440: e593f010 ldr pc, [r3, #16] 4444: e2455001 sub r5, r5, #1 int dropped = 0; bool flow_rcv = false; /* true, if flow control char received */ rtems_interrupt_level level; if (rtems_termios_linesw[tty->t_line].l_rint != NULL) { while (len--) { 4448: e3550000 cmp r5, #0 444c: 1afffff6 bne 442c } /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { 4450: e59430e4 ldr r3, [r4, #228] ; 0xe4 4454: e3530000 cmp r3, #0 4458: 1a000086 bne 4678 445c: e59430dc ldr r3, [r4, #220] ; 0xdc 4460: e3530000 cmp r3, #0 4464: 0a000083 beq 4678 (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); 4468: e2840030 add r0, r4, #48 ; 0x30 446c: e59410e0 ldr r1, [r4, #224] ; 0xe0 4470: e1a0e00f mov lr, pc 4474: e12fff13 bx r3 tty->tty_rcvwakeup = 1; 4478: e3a03001 mov r3, #1 447c: e58430e4 str r3, [r4, #228] ; 0xe4 4480: ea00007c b 4678 while (len--) { c = *buf++; /* FIXME: implement IXANY: any character restarts output */ /* if incoming XON/XOFF controls outgoing stream: */ if (tty->flow_ctrl & FL_MDXON) { 4484: e59430b8 ldr r3, [r4, #184] ; 0xb8 4488: e3130c02 tst r3, #512 ; 0x200 } return 0; } while (len--) { c = *buf++; 448c: e4d6a001 ldrb sl, [r6], #1 /* FIXME: implement IXANY: any character restarts output */ /* if incoming XON/XOFF controls outgoing stream: */ if (tty->flow_ctrl & FL_MDXON) { 4490: 0a00000f beq 44d4 /* if received char is V_STOP and V_START (both are equal value) */ if (c == tty->termios.c_cc[VSTOP]) { 4494: e5d4204a ldrb r2, [r4, #74] ; 0x4a 4498: e152000a cmp r2, sl 449c: e5d43049 ldrb r3, [r4, #73] ; 0x49 44a0: 1a000007 bne 44c4 if (c == tty->termios.c_cc[VSTART]) { 44a4: e1530002 cmp r3, r2 /* received VSTOP and VSTART==VSTOP? */ /* then toggle "stop output" status */ tty->flow_ctrl = tty->flow_ctrl ^ FL_ORCVXOF; 44a8: 059430b8 ldreq r3, [r4, #184] ; 0xb8 } else { /* VSTOP received (other code than VSTART) */ /* stop output */ tty->flow_ctrl |= FL_ORCVXOF; 44ac: 159430b8 ldrne r3, [r4, #184] ; 0xb8 /* if received char is V_STOP and V_START (both are equal value) */ if (c == tty->termios.c_cc[VSTOP]) { if (c == tty->termios.c_cc[VSTART]) { /* received VSTOP and VSTART==VSTOP? */ /* then toggle "stop output" status */ tty->flow_ctrl = tty->flow_ctrl ^ FL_ORCVXOF; 44b0: 02233010 eoreq r3, r3, #16 } else { /* VSTOP received (other code than VSTART) */ /* stop output */ tty->flow_ctrl |= FL_ORCVXOF; 44b4: 13833010 orrne r3, r3, #16 44b8: e58430b8 str r3, [r4, #184] ; 0xb8 * device receive interrupt handler. * Returns the number of characters dropped because of overflow. */ int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len) { 44bc: e3a09001 mov r9, #1 44c0: ea000005 b 44dc /* stop output */ tty->flow_ctrl |= FL_ORCVXOF; } flow_rcv = true; } else if (c == tty->termios.c_cc[VSTART]) { 44c4: e153000a cmp r3, sl /* VSTART received */ /* restart output */ tty->flow_ctrl &= ~FL_ORCVXOF; 44c8: 059430b8 ldreq r3, [r4, #184] ; 0xb8 44cc: 03c33010 biceq r3, r3, #16 /* stop output */ tty->flow_ctrl |= FL_ORCVXOF; } flow_rcv = true; } else if (c == tty->termios.c_cc[VSTART]) { 44d0: 0afffff8 beq 44b8 /* restart output */ tty->flow_ctrl &= ~FL_ORCVXOF; flow_rcv = true; } } if (flow_rcv) { 44d4: e3590000 cmp r9, #0 44d8: 0a000014 beq 4530 /* restart output according to FL_ORCVXOF flag */ if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) { 44dc: e59430b8 ldr r3, [r4, #184] ; 0xb8 44e0: e2033030 and r3, r3, #48 ; 0x30 44e4: e3530020 cmp r3, #32 44e8: 1a00005a bne 4658 /* disable interrupts */ rtems_interrupt_disable(level); 44ec: ebfffa93 bl 2f40 <== NOT EXECUTED 44f0: e1a07000 mov r7, r0 <== NOT EXECUTED tty->flow_ctrl &= ~FL_OSTOP; 44f4: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 44f8: e3c33020 bic r3, r3, #32 <== NOT EXECUTED 44fc: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { 4500: e5943094 ldr r3, [r4, #148] ; 0x94 <== NOT EXECUTED 4504: e3530000 cmp r3, #0 <== NOT EXECUTED 4508: 0a000006 beq 4528 <== NOT EXECUTED /* if chars available, call write function... */ (*tty->device.write)( tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1); 450c: e5943084 ldr r3, [r4, #132] ; 0x84 <== NOT EXECUTED rtems_interrupt_disable(level); tty->flow_ctrl &= ~FL_OSTOP; /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { /* if chars available, call write function... */ (*tty->device.write)( 4510: e594107c ldr r1, [r4, #124] ; 0x7c <== NOT EXECUTED 4514: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED 4518: e0811003 add r1, r1, r3 <== NOT EXECUTED 451c: e3a02001 mov r2, #1 <== NOT EXECUTED 4520: e1a0e00f mov lr, pc <== NOT EXECUTED 4524: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED 4528: e129f007 msr CPSR_fc, r7 <== NOT EXECUTED 452c: ea000049 b 4658 <== NOT EXECUTED } /* reenable interrupts */ rtems_interrupt_enable(level); } } else { newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size; 4530: e5940060 ldr r0, [r4, #96] ; 0x60 4534: e5941064 ldr r1, [r4, #100] ; 0x64 4538: e2800001 add r0, r0, #1 453c: eb0030d2 bl 1088c <__umodsi3> 4540: e1a07000 mov r7, r0 /* if chars_in_buffer > highwater */ rtems_interrupt_disable(level); 4544: ebfffa7d bl 2f40 4548: e1a0b000 mov fp, r0 if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size) 454c: e594305c ldr r3, [r4, #92] ; 0x5c 4550: e5940064 ldr r0, [r4, #100] ; 0x64 4554: e0630000 rsb r0, r3, r0 % tty->rawInBuf.Size) > tty->highwater) && 4558: e5941064 ldr r1, [r4, #100] ; 0x64 455c: e0800007 add r0, r0, r7 4560: eb0030c9 bl 1088c <__umodsi3> } } else { newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size; /* if chars_in_buffer > highwater */ rtems_interrupt_disable(level); if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size) 4564: e59430c0 ldr r3, [r4, #192] ; 0xc0 4568: e1500003 cmp r0, r3 456c: 9a000025 bls 4608 % tty->rawInBuf.Size) > tty->highwater) && !(tty->flow_ctrl & FL_IREQXOF)) { 4570: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED } else { newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size; /* if chars_in_buffer > highwater */ rtems_interrupt_disable(level); if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size) % tty->rawInBuf.Size) > tty->highwater) && 4574: e3130001 tst r3, #1 <== NOT EXECUTED 4578: 1a000022 bne 4608 <== NOT EXECUTED !(tty->flow_ctrl & FL_IREQXOF)) { /* incoming data stream should be stopped */ tty->flow_ctrl |= FL_IREQXOF; 457c: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 4580: e3833001 orr r3, r3, #1 <== NOT EXECUTED 4584: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF)) 4588: e59f30f4 ldr r3, [pc, #244] ; 4684 <== NOT EXECUTED 458c: e59420b8 ldr r2, [r4, #184] ; 0xb8 <== NOT EXECUTED 4590: e0023003 and r3, r2, r3 <== NOT EXECUTED 4594: e3530b01 cmp r3, #1024 ; 0x400 <== NOT EXECUTED 4598: 1a00000e bne 45d8 <== NOT EXECUTED == (FL_MDXOF ) ) { if ((tty->flow_ctrl & FL_OSTOP) || 459c: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 45a0: e3130020 tst r3, #32 <== NOT EXECUTED 45a4: 1a000002 bne 45b4 <== NOT EXECUTED 45a8: e5943094 ldr r3, [r4, #148] ; 0x94 <== NOT EXECUTED 45ac: e3530000 cmp r3, #0 <== NOT EXECUTED 45b0: 1a000014 bne 4608 <== NOT EXECUTED (tty->rawOutBufState == rob_idle)) { /* if tx is stopped due to XOFF or out of data */ /* call write function here */ tty->flow_ctrl |= FL_ISNTXOF; 45b4: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 45b8: e3833002 orr r3, r3, #2 <== NOT EXECUTED 45bc: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED (*tty->device.write)(tty->minor, 45c0: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED 45c4: e59d1004 ldr r1, [sp, #4] <== NOT EXECUTED 45c8: e3a02001 mov r2, #1 <== NOT EXECUTED 45cc: e1a0e00f mov lr, pc <== NOT EXECUTED 45d0: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED 45d4: ea00000b b 4608 <== NOT EXECUTED (void *)&(tty->termios.c_cc[VSTOP]), 1); } } else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) { 45d8: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 45dc: e2033f41 and r3, r3, #260 ; 0x104 <== NOT EXECUTED 45e0: e3530c01 cmp r3, #256 ; 0x100 <== NOT EXECUTED 45e4: 1a000007 bne 4608 <== NOT EXECUTED tty->flow_ctrl |= FL_IRTSOFF; 45e8: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 45ec: e3833004 orr r3, r3, #4 <== NOT EXECUTED 45f0: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED /* deactivate RTS line */ if (tty->device.stopRemoteTx != NULL) { 45f4: e59430ac ldr r3, [r4, #172] ; 0xac <== NOT EXECUTED 45f8: e3530000 cmp r3, #0 <== NOT EXECUTED tty->device.stopRemoteTx(tty->minor); 45fc: 15940010 ldrne r0, [r4, #16] <== NOT EXECUTED 4600: 11a0e00f movne lr, pc <== NOT EXECUTED 4604: 112fff13 bxne r3 <== NOT EXECUTED 4608: e129f00b msr CPSR_fc, fp } /* reenable interrupts */ rtems_interrupt_enable(level); if (newTail == tty->rawInBuf.Head) { 460c: e594305c ldr r3, [r4, #92] ; 0x5c 4610: e1570003 cmp r7, r3 dropped++; 4614: 02855001 addeq r5, r5, #1 } /* reenable interrupts */ rtems_interrupt_enable(level); if (newTail == tty->rawInBuf.Head) { 4618: 0a00000e beq 4658 dropped++; } else { tty->rawInBuf.theBuf[newTail] = c; 461c: e5943058 ldr r3, [r4, #88] ; 0x58 4620: e7c3a007 strb sl, [r3, r7] tty->rawInBuf.Tail = newTail; /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { 4624: e59430e4 ldr r3, [r4, #228] ; 0xe4 4628: e3530000 cmp r3, #0 if (newTail == tty->rawInBuf.Head) { dropped++; } else { tty->rawInBuf.theBuf[newTail] = c; tty->rawInBuf.Tail = newTail; 462c: e5847060 str r7, [r4, #96] ; 0x60 /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { 4630: 1a000008 bne 4658 4634: e59430dc ldr r3, [r4, #220] ; 0xdc 4638: e3530000 cmp r3, #0 463c: 0a000005 beq 4658 (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); 4640: e59d0000 ldr r0, [sp] <== NOT EXECUTED 4644: e59410e0 ldr r1, [r4, #224] ; 0xe0 <== NOT EXECUTED 4648: e1a0e00f mov lr, pc <== NOT EXECUTED 464c: e12fff13 bx r3 <== NOT EXECUTED tty->tty_rcvwakeup = 1; 4650: e3a03001 mov r3, #1 <== NOT EXECUTED 4654: e58430e4 str r3, [r4, #228] ; 0xe4 <== NOT EXECUTED 4658: e2488001 sub r8, r8, #1 tty->tty_rcvwakeup = 1; } return 0; } while (len--) { 465c: e3580000 cmp r8, #0 4660: 1affff87 bne 4484 } } } } tty->rawInBufDropped += dropped; 4664: e5943078 ldr r3, [r4, #120] ; 0x78 4668: e0833005 add r3, r3, r5 466c: e5843078 str r3, [r4, #120] ; 0x78 rtems_semaphore_release (tty->rawInBuf.Semaphore); 4670: e5940068 ldr r0, [r4, #104] ; 0x68 4674: eb000356 bl 53d4 return dropped; } 4678: e1a00005 mov r0, r5 467c: e8bd8ffc pop {r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 000035b8 : rtems_status_code rtems_termios_ioctl (void *arg) { rtems_libio_ioctl_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 35b8: e5903000 ldr r3, [r0] } } rtems_status_code rtems_termios_ioctl (void *arg) { 35bc: e92d41f0 push {r4, r5, r6, r7, r8, lr} rtems_libio_ioctl_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 35c0: e5934034 ldr r4, [r3, #52] ; 0x34 struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer; rtems_status_code sc; args->ioctl_return = 0; 35c4: e3a01000 mov r1, #0 rtems_status_code rtems_termios_ioctl (void *arg) { rtems_libio_ioctl_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer; 35c8: e5907008 ldr r7, [r0, #8] rtems_status_code sc; args->ioctl_return = 0; 35cc: e580100c str r1, [r0, #12] } } rtems_status_code rtems_termios_ioctl (void *arg) { 35d0: e1a05000 mov r5, r0 struct rtems_termios_tty *tty = args->iop->data1; struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer; rtems_status_code sc; args->ioctl_return = 0; sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 35d4: e1a02001 mov r2, r1 35d8: e5940018 ldr r0, [r4, #24] 35dc: eb000736 bl 52bc if (sc != RTEMS_SUCCESSFUL) { 35e0: e2506000 subs r6, r0, #0 35e4: 1a0000d4 bne 393c args->ioctl_return = sc; return sc; } switch (args->command) { 35e8: e5953004 ldr r3, [r5, #4] 35ec: e3530004 cmp r3, #4 35f0: 0a0000a8 beq 3898 35f4: 8a000005 bhi 3610 35f8: e3530002 cmp r3, #2 35fc: 0a000029 beq 36a8 3600: 8a00009d bhi 387c 3604: e3530001 cmp r3, #1 3608: 1a000010 bne 3650 360c: ea00001b b 3680 3610: e59f2330 ldr r2, [pc, #816] ; 3948 3614: e1530002 cmp r3, r2 3618: 0a0000ba beq 3908 361c: 8a000002 bhi 362c 3620: e3530005 cmp r3, #5 3624: 1a000009 bne 3650 3628: ea000096 b 3888 362c: e59f2318 ldr r2, [pc, #792] ; 394c 3630: e1530002 cmp r3, r2 if (rtems_termios_linesw[tty->t_line].l_open != NULL) { sc = rtems_termios_linesw[tty->t_line].l_open(tty); } break; case TIOCGETD: *(int*)(args->buffer)=tty->t_line; 3634: 05953008 ldreq r3, [r5, #8] 3638: 059420cc ldreq r2, [r4, #204] ; 0xcc 363c: 05832000 streq r2, [r3] sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) { args->ioctl_return = sc; return sc; } switch (args->command) { 3640: 0a0000bb beq 3934 3644: e2822105 add r2, r2, #1073741825 ; 0x40000001 3648: e1530002 cmp r3, r2 364c: 0a000095 beq 38a8 default: if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) { 3650: e59420cc ldr r2, [r4, #204] ; 0xcc 3654: e59f32f4 ldr r3, [pc, #756] ; 3950 3658: e0833282 add r3, r3, r2, lsl #5 365c: e5933018 ldr r3, [r3, #24] 3660: e3530000 cmp r3, #0 sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args); } else { sc = RTEMS_INVALID_NUMBER; 3664: 03a0600a moveq r6, #10 args->ioctl_return = sc; return sc; } switch (args->command) { default: if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) { 3668: 0a0000b1 beq 3934 sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args); 366c: e1a00004 mov r0, r4 3670: e1a01005 mov r1, r5 3674: e1a0e00f mov lr, pc 3678: e12fff13 bx r3 367c: ea00009f b 3900 sc = RTEMS_INVALID_NUMBER; } break; case RTEMS_IO_GET_ATTRIBUTES: *(struct termios *)args->buffer = tty->termios; 3680: e5957008 ldr r7, [r5, #8] 3684: e284c030 add ip, r4, #48 ; 0x30 3688: e8bc000f ldm ip!, {r0, r1, r2, r3} 368c: e1a0e007 mov lr, r7 3690: e8ae000f stmia lr!, {r0, r1, r2, r3} 3694: e8bc000f ldm ip!, {r0, r1, r2, r3} 3698: e8ae000f stmia lr!, {r0, r1, r2, r3} 369c: e59c3000 ldr r3, [ip] 36a0: e58e3000 str r3, [lr] break; 36a4: ea0000a2 b 3934 case RTEMS_IO_SET_ATTRIBUTES: tty->termios = *(struct termios *)args->buffer; 36a8: e595e008 ldr lr, [r5, #8] 36ac: e8be000f ldm lr!, {r0, r1, r2, r3} 36b0: e284c030 add ip, r4, #48 ; 0x30 36b4: e8ac000f stmia ip!, {r0, r1, r2, r3} 36b8: e8be000f ldm lr!, {r0, r1, r2, r3} 36bc: e8ac000f stmia ip!, {r0, r1, r2, r3} 36c0: e59e3000 ldr r3, [lr] 36c4: e58c3000 str r3, [ip] /* * check for flow control options to be switched off */ /* check for outgoing XON/XOFF flow control switched off */ if (( tty->flow_ctrl & FL_MDXON) && 36c8: e59430b8 ldr r3, [r4, #184] ; 0xb8 36cc: e3130c02 tst r3, #512 ; 0x200 36d0: 0a000018 beq 3738 !(tty->termios.c_iflag & IXON)) { 36d4: e5943030 ldr r3, [r4, #48] ; 0x30 /* * check for flow control options to be switched off */ /* check for outgoing XON/XOFF flow control switched off */ if (( tty->flow_ctrl & FL_MDXON) && 36d8: e3130b01 tst r3, #1024 ; 0x400 36dc: 1a000015 bne 3738 !(tty->termios.c_iflag & IXON)) { /* clear related flags in flow_ctrl */ tty->flow_ctrl &= ~(FL_MDXON | FL_ORCVXOF); 36e0: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 36e4: e3c33e21 bic r3, r3, #528 ; 0x210 <== NOT EXECUTED 36e8: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED /* has output been stopped due to received XOFF? */ if (tty->flow_ctrl & FL_OSTOP) { 36ec: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 36f0: e3130020 tst r3, #32 <== NOT EXECUTED 36f4: 0a00000f beq 3738 <== NOT EXECUTED /* disable interrupts */ rtems_interrupt_disable(level); 36f8: ebfffe10 bl 2f40 <== NOT EXECUTED 36fc: e1a07000 mov r7, r0 <== NOT EXECUTED tty->flow_ctrl &= ~FL_OSTOP; 3700: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 3704: e3c33020 bic r3, r3, #32 <== NOT EXECUTED 3708: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { 370c: e5943094 ldr r3, [r4, #148] ; 0x94 <== NOT EXECUTED 3710: e3530000 cmp r3, #0 <== NOT EXECUTED 3714: 0a000006 beq 3734 <== NOT EXECUTED /* if chars available, call write function... */ (*tty->device.write)( tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); 3718: e5943084 ldr r3, [r4, #132] ; 0x84 <== NOT EXECUTED rtems_interrupt_disable(level); tty->flow_ctrl &= ~FL_OSTOP; /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { /* if chars available, call write function... */ (*tty->device.write)( 371c: e594107c ldr r1, [r4, #124] ; 0x7c <== NOT EXECUTED 3720: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED 3724: e0811003 add r1, r1, r3 <== NOT EXECUTED 3728: e3a02001 mov r2, #1 <== NOT EXECUTED 372c: e1a0e00f mov lr, pc <== NOT EXECUTED 3730: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED 3734: e129f007 msr CPSR_fc, r7 <== NOT EXECUTED /* reenable interrupts */ rtems_interrupt_enable(level); } } /* check for incoming XON/XOFF flow control switched off */ if (( tty->flow_ctrl & FL_MDXOF) && !(tty->termios.c_iflag & IXOFF)) { 3738: e59430b8 ldr r3, [r4, #184] ; 0xb8 373c: e3130b01 tst r3, #1024 ; 0x400 3740: 0a000008 beq 3768 3744: e5943030 ldr r3, [r4, #48] ; 0x30 <== NOT EXECUTED 3748: e3130a01 tst r3, #4096 ; 0x1000 <== NOT EXECUTED 374c: 1a000005 bne 3768 <== NOT EXECUTED /* clear related flags in flow_ctrl */ tty->flow_ctrl &= ~(FL_MDXOF); 3750: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 3754: e3c33b01 bic r3, r3, #1024 ; 0x400 <== NOT EXECUTED 3758: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED /* FIXME: what happens, if we had sent XOFF but not yet XON? */ tty->flow_ctrl &= ~(FL_ISNTXOF); 375c: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 3760: e3c33002 bic r3, r3, #2 <== NOT EXECUTED 3764: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED } /* check for incoming RTS/CTS flow control switched off */ if (( tty->flow_ctrl & FL_MDRTS) && !(tty->termios.c_cflag & CRTSCTS)) { 3768: e59430b8 ldr r3, [r4, #184] ; 0xb8 376c: e3130c01 tst r3, #256 ; 0x100 3770: 0a000010 beq 37b8 3774: e5943038 ldr r3, [r4, #56] ; 0x38 <== NOT EXECUTED 3778: e3530000 cmp r3, #0 <== NOT EXECUTED 377c: ba00000d blt 37b8 <== NOT EXECUTED /* clear related flags in flow_ctrl */ tty->flow_ctrl &= ~(FL_MDRTS); 3780: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 3784: e3c33c01 bic r3, r3, #256 ; 0x100 <== NOT EXECUTED 3788: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED /* restart remote Tx, if it was stopped */ if ((tty->flow_ctrl & FL_IRTSOFF) && (tty->device.startRemoteTx != NULL)) { 378c: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 3790: e3130004 tst r3, #4 <== NOT EXECUTED 3794: 0a000004 beq 37ac <== NOT EXECUTED 3798: e59430b0 ldr r3, [r4, #176] ; 0xb0 <== NOT EXECUTED 379c: e3530000 cmp r3, #0 <== NOT EXECUTED tty->device.startRemoteTx(tty->minor); 37a0: 15940010 ldrne r0, [r4, #16] <== NOT EXECUTED 37a4: 11a0e00f movne lr, pc <== NOT EXECUTED 37a8: 112fff13 bxne r3 <== NOT EXECUTED } tty->flow_ctrl &= ~(FL_IRTSOFF); 37ac: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 37b0: e3c33004 bic r3, r3, #4 <== NOT EXECUTED 37b4: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED /* * check for flow control options to be switched on */ /* check for incoming RTS/CTS flow control switched on */ if (tty->termios.c_cflag & CRTSCTS) { 37b8: e5943038 ldr r3, [r4, #56] ; 0x38 37bc: e3530000 cmp r3, #0 tty->flow_ctrl |= FL_MDRTS; 37c0: b59430b8 ldrlt r3, [r4, #184] ; 0xb8 37c4: b3833c01 orrlt r3, r3, #256 ; 0x100 37c8: b58430b8 strlt r3, [r4, #184] ; 0xb8 } /* check for incoming XON/XOF flow control switched on */ if (tty->termios.c_iflag & IXOFF) { 37cc: e5943030 ldr r3, [r4, #48] ; 0x30 37d0: e3130a01 tst r3, #4096 ; 0x1000 tty->flow_ctrl |= FL_MDXOF; 37d4: 159420b8 ldrne r2, [r4, #184] ; 0xb8 37d8: 13822b01 orrne r2, r2, #1024 ; 0x400 37dc: 158420b8 strne r2, [r4, #184] ; 0xb8 } /* check for outgoing XON/XOF flow control switched on */ if (tty->termios.c_iflag & IXON) { 37e0: e3130b01 tst r3, #1024 ; 0x400 tty->flow_ctrl |= FL_MDXON; 37e4: 159430b8 ldrne r3, [r4, #184] ; 0xb8 tty->termios = *(struct termios *)args->buffer; /* check for and process change in flow control options */ termios_set_flowctrl(tty); if (tty->termios.c_lflag & ICANON) { 37e8: e594703c ldr r7, [r4, #60] ; 0x3c if (tty->termios.c_iflag & IXOFF) { tty->flow_ctrl |= FL_MDXOF; } /* check for outgoing XON/XOF flow control switched on */ if (tty->termios.c_iflag & IXON) { tty->flow_ctrl |= FL_MDXON; 37ec: 13833c02 orrne r3, r3, #512 ; 0x200 37f0: 158430b8 strne r3, [r4, #184] ; 0xb8 tty->termios = *(struct termios *)args->buffer; /* check for and process change in flow control options */ termios_set_flowctrl(tty); if (tty->termios.c_lflag & ICANON) { 37f4: e2177002 ands r7, r7, #2 tty->rawInBufSemaphoreOptions = RTEMS_WAIT; 37f8: 13a03000 movne r3, #0 tty->termios = *(struct termios *)args->buffer; /* check for and process change in flow control options */ termios_set_flowctrl(tty); if (tty->termios.c_lflag & ICANON) { 37fc: 1a000013 bne 3850 tty->rawInBufSemaphoreOptions = RTEMS_WAIT; tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT; tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; } else { tty->vtimeTicks = tty->termios.c_cc[VTIME] * 3800: e5d48046 ldrb r8, [r4, #70] ; 0x46 rtems_clock_get_ticks_per_second() / 10; 3804: eb000519 bl 4c70 3808: e3a0100a mov r1, #10 380c: e0000098 mul r0, r8, r0 3810: eb003385 bl 1062c <__aeabi_uidiv> if (tty->termios.c_cc[VTIME]) { 3814: e5d43046 ldrb r3, [r4, #70] ; 0x46 3818: e3530000 cmp r3, #0 if (tty->termios.c_lflag & ICANON) { tty->rawInBufSemaphoreOptions = RTEMS_WAIT; tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT; tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; } else { tty->vtimeTicks = tty->termios.c_cc[VTIME] * 381c: e5840054 str r0, [r4, #84] ; 0x54 3820: e5d42047 ldrb r2, [r4, #71] ; 0x47 rtems_clock_get_ticks_per_second() / 10; if (tty->termios.c_cc[VTIME]) { 3824: 0a000005 beq 3840 tty->rawInBufSemaphoreOptions = RTEMS_WAIT; tty->rawInBufSemaphoreTimeout = tty->vtimeTicks; if (tty->termios.c_cc[VMIN]) tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; 3828: e3520000 cmp r2, #0 } else { tty->vtimeTicks = tty->termios.c_cc[VTIME] * rtems_clock_get_ticks_per_second() / 10; if (tty->termios.c_cc[VTIME]) { tty->rawInBufSemaphoreOptions = RTEMS_WAIT; tty->rawInBufSemaphoreTimeout = tty->vtimeTicks; 382c: e5840070 str r0, [r4, #112] ; 0x70 if (tty->termios.c_cc[VMIN]) tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; 3830: 13a00000 movne r0, #0 tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; } else { tty->vtimeTicks = tty->termios.c_cc[VTIME] * rtems_clock_get_ticks_per_second() / 10; if (tty->termios.c_cc[VTIME]) { tty->rawInBufSemaphoreOptions = RTEMS_WAIT; 3834: e584706c str r7, [r4, #108] ; 0x6c tty->rawInBufSemaphoreTimeout = tty->vtimeTicks; if (tty->termios.c_cc[VMIN]) tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; 3838: e5840074 str r0, [r4, #116] ; 0x74 383c: ea000006 b 385c else tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks; } else { if (tty->termios.c_cc[VMIN]) { 3840: e3520000 cmp r2, #0 tty->rawInBufSemaphoreOptions = RTEMS_WAIT; tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT; tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; } else { tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT; 3844: 03a03001 moveq r3, #1 3848: 0584306c streq r3, [r4, #108] ; 0x6c if (tty->termios.c_cc[VMIN]) tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; else tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks; } else { if (tty->termios.c_cc[VMIN]) { 384c: 0a000002 beq 385c tty->rawInBufSemaphoreOptions = RTEMS_WAIT; 3850: e584306c str r3, [r4, #108] ; 0x6c tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT; 3854: e5843070 str r3, [r4, #112] ; 0x70 tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; 3858: e5843074 str r3, [r4, #116] ; 0x74 } else { tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT; } } } if (tty->device.setAttributes) 385c: e59430a8 ldr r3, [r4, #168] ; 0xa8 3860: e3530000 cmp r3, #0 3864: 0a000032 beq 3934 (*tty->device.setAttributes)(tty->minor, &tty->termios); 3868: e5940010 ldr r0, [r4, #16] 386c: e2841030 add r1, r4, #48 ; 0x30 3870: e1a0e00f mov lr, pc 3874: e12fff13 bx r3 3878: ea00002d b 3934 break; case RTEMS_IO_TCDRAIN: drainOutput (tty); 387c: e1a00004 mov r0, r4 3880: ebfffdb2 bl 2f50 break; 3884: ea00002a b 3934 case RTEMS_IO_SNDWAKEUP: tty->tty_snd = *wakeup; 3888: e897000c ldm r7, {r2, r3} 388c: e58420d4 str r2, [r4, #212] ; 0xd4 3890: e58430d8 str r3, [r4, #216] ; 0xd8 break; 3894: ea000026 b 3934 case RTEMS_IO_RCVWAKEUP: tty->tty_rcv = *wakeup; 3898: e897000c ldm r7, {r2, r3} 389c: e58420dc str r2, [r4, #220] ; 0xdc 38a0: e58430e0 str r3, [r4, #224] ; 0xe0 break; 38a4: ea000022 b 3934 #if 1 /* FIXME */ case TIOCSETD: /* * close old line discipline */ if (rtems_termios_linesw[tty->t_line].l_close != NULL) { 38a8: e59420cc ldr r2, [r4, #204] ; 0xcc 38ac: e59f309c ldr r3, [pc, #156] ; 3950 38b0: e0833282 add r3, r3, r2, lsl #5 38b4: e5933004 ldr r3, [r3, #4] 38b8: e3530000 cmp r3, #0 38bc: 0a000003 beq 38d0 sc = rtems_termios_linesw[tty->t_line].l_close(tty); 38c0: e1a00004 mov r0, r4 38c4: e1a0e00f mov lr, pc 38c8: e12fff13 bx r3 38cc: e1a06000 mov r6, r0 } tty->t_line=*(int*)(args->buffer); 38d0: e5953008 ldr r3, [r5, #8] tty->t_sc = NULL; /* ensure that no more valid data */ 38d4: e3a02000 mov r2, #0 * close old line discipline */ if (rtems_termios_linesw[tty->t_line].l_close != NULL) { sc = rtems_termios_linesw[tty->t_line].l_close(tty); } tty->t_line=*(int*)(args->buffer); 38d8: e5933000 ldr r3, [r3] tty->t_sc = NULL; /* ensure that no more valid data */ 38dc: e58420d0 str r2, [r4, #208] ; 0xd0 /* * open new line discipline */ if (rtems_termios_linesw[tty->t_line].l_open != NULL) { 38e0: e59f2068 ldr r2, [pc, #104] ; 3950 * close old line discipline */ if (rtems_termios_linesw[tty->t_line].l_close != NULL) { sc = rtems_termios_linesw[tty->t_line].l_close(tty); } tty->t_line=*(int*)(args->buffer); 38e4: e58430cc str r3, [r4, #204] ; 0xcc tty->t_sc = NULL; /* ensure that no more valid data */ /* * open new line discipline */ if (rtems_termios_linesw[tty->t_line].l_open != NULL) { 38e8: e7923283 ldr r3, [r2, r3, lsl #5] 38ec: e3530000 cmp r3, #0 38f0: 0a00000f beq 3934 sc = rtems_termios_linesw[tty->t_line].l_open(tty); 38f4: e1a00004 mov r0, r4 38f8: e1a0e00f mov lr, pc 38fc: e12fff13 bx r3 3900: e1a06000 mov r6, r0 3904: ea00000a b 3934 case TIOCGETD: *(int*)(args->buffer)=tty->t_line; break; #endif case FIONREAD: { int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head; 3908: e5942060 ldr r2, [r4, #96] ; 0x60 <== NOT EXECUTED 390c: e594305c ldr r3, [r4, #92] ; 0x5c <== NOT EXECUTED if ( rawnc < 0 ) 3910: e0523003 subs r3, r2, r3 <== NOT EXECUTED rawnc += tty->rawInBuf.Size; 3914: 45942064 ldrmi r2, [r4, #100] ; 0x64 <== NOT EXECUTED /* Half guess that this is the right operation */ *(int *)args->buffer = tty->ccount - tty->cindex + rawnc; 3918: e2840020 add r0, r4, #32 <== NOT EXECUTED 391c: e8900003 ldm r0, {r0, r1} <== NOT EXECUTED 3920: e0401001 sub r1, r0, r1 <== NOT EXECUTED break; #endif case FIONREAD: { int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head; if ( rawnc < 0 ) rawnc += tty->rawInBuf.Size; 3924: 40833002 addmi r3, r3, r2 <== NOT EXECUTED /* Half guess that this is the right operation */ *(int *)args->buffer = tty->ccount - tty->cindex + rawnc; 3928: e5952008 ldr r2, [r5, #8] <== NOT EXECUTED 392c: e0813003 add r3, r1, r3 <== NOT EXECUTED 3930: e5823000 str r3, [r2] <== NOT EXECUTED } break; } rtems_semaphore_release (tty->osem); 3934: e5940018 ldr r0, [r4, #24] 3938: eb0006a5 bl 53d4 args->ioctl_return = sc; 393c: e585600c str r6, [r5, #12] return sc; } 3940: e1a00006 mov r0, r6 3944: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} =============================================================================== 00002fac : rtems_device_major_number major, rtems_device_minor_number minor, void *arg, const rtems_termios_callbacks *callbacks ) { 2fac: e92d4fff push {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, lr} 2fb0: e58d300c str r3, [sp, #12] struct rtems_termios_tty *tty; /* * See if the device has already been opened */ sc = rtems_semaphore_obtain( 2fb4: e59f3404 ldr r3, [pc, #1028] ; 33c0 rtems_device_major_number major, rtems_device_minor_number minor, void *arg, const rtems_termios_callbacks *callbacks ) { 2fb8: e1a0a001 mov sl, r1 struct rtems_termios_tty *tty; /* * See if the device has already been opened */ sc = rtems_semaphore_obtain( 2fbc: e3a01000 mov r1, #0 rtems_device_major_number major, rtems_device_minor_number minor, void *arg, const rtems_termios_callbacks *callbacks ) { 2fc0: e1a09000 mov r9, r0 2fc4: e1a08002 mov r8, r2 struct rtems_termios_tty *tty; /* * See if the device has already been opened */ sc = rtems_semaphore_obtain( 2fc8: e5930000 ldr r0, [r3] 2fcc: e1a02001 mov r2, r1 2fd0: eb0008b9 bl 52bc rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 2fd4: e2506000 subs r6, r0, #0 2fd8: 1a0000ee bne 3398 return sc; for (tty = rtems_termios_ttyHead ; tty != NULL ; tty = tty->forw) { 2fdc: e59f33e0 ldr r3, [pc, #992] ; 33c4 2fe0: e5937000 ldr r7, [r3] 2fe4: e1a05007 mov r5, r7 2fe8: ea000006 b 3008 if ((tty->major == major) && (tty->minor == minor)) 2fec: e595300c ldr r3, [r5, #12] 2ff0: e1530009 cmp r3, r9 2ff4: 1a000002 bne 3004 2ff8: e5953010 ldr r3, [r5, #16] 2ffc: e153000a cmp r3, sl 3000: 0a0000c3 beq 3314 sc = rtems_semaphore_obtain( rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) return sc; for (tty = rtems_termios_ttyHead ; tty != NULL ; tty = tty->forw) { 3004: e5955000 ldr r5, [r5] 3008: e3550000 cmp r5, #0 300c: 1afffff6 bne 2fec 3010: ea0000e3 b 33a4 return RTEMS_NO_MEMORY; } /* * allocate raw input buffer */ tty->rawInBuf.Size = RAW_INPUT_BUFFER_SIZE; 3014: e59f23ac ldr r2, [pc, #940] ; 33c8 3018: e5923000 ldr r3, [r2] 301c: e5853064 str r3, [r5, #100] ; 0x64 tty->rawInBuf.theBuf = malloc (tty->rawInBuf.Size); 3020: e5950064 ldr r0, [r5, #100] ; 0x64 3024: e58d2008 str r2, [sp, #8] 3028: ebfffcfe bl 2428 if (tty->rawInBuf.theBuf == NULL) { 302c: e3500000 cmp r0, #0 } /* * allocate raw input buffer */ tty->rawInBuf.Size = RAW_INPUT_BUFFER_SIZE; tty->rawInBuf.theBuf = malloc (tty->rawInBuf.Size); 3030: e1a0b000 mov fp, r0 3034: e5850058 str r0, [r5, #88] ; 0x58 if (tty->rawInBuf.theBuf == NULL) { 3038: e59d2008 ldr r2, [sp, #8] 303c: 1a000006 bne 305c free(tty); 3040: e1a00005 mov r0, r5 3044: ebfffc28 bl 20ec rtems_semaphore_release (rtems_termios_ttyMutex); 3048: e59f3370 ldr r3, [pc, #880] ; 33c0 304c: e5930000 ldr r0, [r3] 3050: eb0008df bl 53d4 return RTEMS_NO_MEMORY; 3054: e3a0601a mov r6, #26 3058: ea0000ce b 3398 } /* * allocate raw output buffer */ tty->rawOutBuf.Size = RAW_OUTPUT_BUFFER_SIZE; 305c: e5923004 ldr r3, [r2, #4] 3060: e5853088 str r3, [r5, #136] ; 0x88 tty->rawOutBuf.theBuf = malloc (tty->rawOutBuf.Size); 3064: e5950088 ldr r0, [r5, #136] ; 0x88 3068: e58d2008 str r2, [sp, #8] 306c: ebfffced bl 2428 if (tty->rawOutBuf.theBuf == NULL) { 3070: e3500000 cmp r0, #0 } /* * allocate raw output buffer */ tty->rawOutBuf.Size = RAW_OUTPUT_BUFFER_SIZE; tty->rawOutBuf.theBuf = malloc (tty->rawOutBuf.Size); 3074: e1a03000 mov r3, r0 3078: e585007c str r0, [r5, #124] ; 0x7c if (tty->rawOutBuf.theBuf == NULL) { 307c: e59d2008 ldr r2, [sp, #8] 3080: 0a000008 beq 30a8 return RTEMS_NO_MEMORY; } /* * allocate cooked buffer */ tty->cbuf = malloc (CBUFSIZE); 3084: e5920008 ldr r0, [r2, #8] 3088: e58d3008 str r3, [sp, #8] 308c: ebfffce5 bl 2428 if (tty->cbuf == NULL) { 3090: e3500000 cmp r0, #0 return RTEMS_NO_MEMORY; } /* * allocate cooked buffer */ tty->cbuf = malloc (CBUFSIZE); 3094: e585001c str r0, [r5, #28] if (tty->cbuf == NULL) { 3098: e59d3008 ldr r3, [sp, #8] 309c: 1a000004 bne 30b4 free((void *)(tty->rawOutBuf.theBuf)); 30a0: e1a00003 mov r0, r3 <== NOT EXECUTED 30a4: ebfffc10 bl 20ec <== NOT EXECUTED free((void *)(tty->rawInBuf.theBuf)); 30a8: e1a0000b mov r0, fp 30ac: ebfffc0e bl 20ec 30b0: eaffffe2 b 3040 return RTEMS_NO_MEMORY; } /* * Initialize wakeup callbacks */ tty->tty_snd.sw_pfn = NULL; 30b4: e3a03000 mov r3, #0 /* * link tty */ tty->forw = rtems_termios_ttyHead; tty->back = NULL; 30b8: e5853004 str r3, [r5, #4] if (rtems_termios_ttyHead != NULL) 30bc: e1570003 cmp r7, r3 return RTEMS_NO_MEMORY; } /* * Initialize wakeup callbacks */ tty->tty_snd.sw_pfn = NULL; 30c0: e58530d4 str r3, [r5, #212] ; 0xd4 tty->tty_snd.sw_arg = NULL; 30c4: e58530d8 str r3, [r5, #216] ; 0xd8 tty->tty_rcv.sw_pfn = NULL; 30c8: e58530dc str r3, [r5, #220] ; 0xdc tty->tty_rcv.sw_arg = NULL; 30cc: e58530e0 str r3, [r5, #224] ; 0xe0 tty->tty_rcvwakeup = 0; 30d0: e58530e4 str r3, [r5, #228] ; 0xe4 */ tty->forw = rtems_termios_ttyHead; tty->back = NULL; if (rtems_termios_ttyHead != NULL) rtems_termios_ttyHead->back = tty; rtems_termios_ttyHead = tty; 30d4: e59f32e8 ldr r3, [pc, #744] ; 33c4 30d8: e5834000 str r4, [r3] if (rtems_termios_ttyTail == NULL) 30dc: e59f32e8 ldr r3, [pc, #744] ; 33cc 30e0: e5932000 ldr r2, [r3] * link tty */ tty->forw = rtems_termios_ttyHead; tty->back = NULL; if (rtems_termios_ttyHead != NULL) rtems_termios_ttyHead->back = tty; 30e4: 15875004 strne r5, [r7, #4] tty->tty_rcvwakeup = 0; /* * link tty */ tty->forw = rtems_termios_ttyHead; 30e8: e5857000 str r7, [r5] /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( rtems_build_name ('T', 'R', 'i', c), 30ec: e59f72d4 ldr r7, [pc, #724] ; 33c8 tty->forw = rtems_termios_ttyHead; tty->back = NULL; if (rtems_termios_ttyHead != NULL) rtems_termios_ttyHead->back = tty; rtems_termios_ttyHead = tty; if (rtems_termios_ttyTail == NULL) 30f0: e3520000 cmp r2, #0 rtems_termios_ttyTail = tty; 30f4: 05834000 streq r4, [r3] tty->major = major; /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( 30f8: e59f02d0 ldr r0, [pc, #720] ; 33d0 rtems_build_name ('T', 'R', 'i', c), 30fc: e5d7300c ldrb r3, [r7, #12] tty->major = major; /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( 3100: e2842014 add r2, r4, #20 rtems_termios_ttyHead->back = tty; rtems_termios_ttyHead = tty; if (rtems_termios_ttyTail == NULL) rtems_termios_ttyTail = tty; tty->minor = minor; 3104: e584a010 str sl, [r4, #16] tty->major = major; 3108: e584900c str r9, [r4, #12] /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( 310c: e1830000 orr r0, r3, r0 3110: e58d2000 str r2, [sp] 3114: e3a03000 mov r3, #0 3118: e3a01001 mov r1, #1 311c: e3a02054 mov r2, #84 ; 0x54 3120: eb0007d3 bl 5074 rtems_build_name ('T', 'R', 'i', c), 1, RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &tty->isem); if (sc != RTEMS_SUCCESSFUL) 3124: e2503000 subs r3, r0, #0 3128: 1a000096 bne 3388 rtems_fatal_error_occurred (sc); sc = rtems_semaphore_create ( rtems_build_name ('T', 'R', 'o', c), 312c: e5d7200c ldrb r2, [r7, #12] RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &tty->isem); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); sc = rtems_semaphore_create ( 3130: e59f029c ldr r0, [pc, #668] ; 33d4 3134: e2841018 add r1, r4, #24 3138: e58d1000 str r1, [sp] 313c: e1820000 orr r0, r2, r0 3140: e3a01001 mov r1, #1 3144: e3a02054 mov r2, #84 ; 0x54 3148: eb0007c9 bl 5074 rtems_build_name ('T', 'R', 'o', c), 1, RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &tty->osem); if (sc != RTEMS_SUCCESSFUL) 314c: e2501000 subs r1, r0, #0 3150: 1a00008c bne 3388 rtems_fatal_error_occurred (sc); sc = rtems_semaphore_create ( rtems_build_name ('T', 'R', 'x', c), 3154: e5d7300c ldrb r3, [r7, #12] RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &tty->osem); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); sc = rtems_semaphore_create ( 3158: e59f0278 ldr r0, [pc, #632] ; 33d8 315c: e284208c add r2, r4, #140 ; 0x8c 3160: e58d2000 str r2, [sp] 3164: e1830000 orr r0, r3, r0 3168: e3a02020 mov r2, #32 316c: e1a03001 mov r3, r1 3170: eb0007bf bl 5074 rtems_build_name ('T', 'R', 'x', c), 0, RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_FIFO, RTEMS_NO_PRIORITY, &tty->rawOutBuf.Semaphore); if (sc != RTEMS_SUCCESSFUL) 3174: e250b000 subs fp, r0, #0 3178: 1a000082 bne 3388 tty->rawOutBufState = rob_idle; /* * Set callbacks */ tty->device = *callbacks; 317c: e59de00c ldr lr, [sp, #12] 3180: e8be000f ldm lr!, {r0, r1, r2, r3} 3184: e284c098 add ip, r4, #152 ; 0x98 3188: e8ac000f stmia ip!, {r0, r1, r2, r3} 318c: e89e000f ldm lr, {r0, r1, r2, r3} 3190: e88c000f stm ip, {r0, r1, r2, r3} /* * Create I/O tasks */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 3194: e59430b4 ldr r3, [r4, #180] ; 0xb4 3198: e3530002 cmp r3, #2 RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_FIFO, RTEMS_NO_PRIORITY, &tty->rawOutBuf.Semaphore); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); tty->rawOutBufState = rob_idle; 319c: e584b094 str fp, [r4, #148] ; 0x94 tty->device = *callbacks; /* * Create I/O tasks */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 31a0: 1a000017 bne 3204 sc = rtems_task_create ( rtems_build_name ('T', 'x', 'T', c), 31a4: e5d7300c ldrb r3, [r7, #12] /* * Create I/O tasks */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { sc = rtems_task_create ( 31a8: e59f022c ldr r0, [pc, #556] ; 33dc 31ac: e28420c8 add r2, r4, #200 ; 0xc8 31b0: e58d2004 str r2, [sp, #4] 31b4: e1830000 orr r0, r3, r0 31b8: e3a02b01 mov r2, #1024 ; 0x400 31bc: e3a0100a mov r1, #10 31c0: e3a03c05 mov r3, #1280 ; 0x500 31c4: e58db000 str fp, [sp] 31c8: eb0008a8 bl 5470 TERMIOS_TXTASK_STACKSIZE, RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, &tty->txTaskId); if (sc != RTEMS_SUCCESSFUL) 31cc: e2502000 subs r2, r0, #0 31d0: 1a00006c bne 3388 rtems_fatal_error_occurred (sc); sc = rtems_task_create ( rtems_build_name ('R', 'x', 'T', c), 31d4: e5d7300c ldrb r3, [r7, #12] RTEMS_NO_ASR, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, &tty->txTaskId); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); sc = rtems_task_create ( 31d8: e59f0200 ldr r0, [pc, #512] ; 33e0 31dc: e58d2000 str r2, [sp] 31e0: e28420c4 add r2, r4, #196 ; 0xc4 31e4: e58d2004 str r2, [sp, #4] 31e8: e1830000 orr r0, r3, r0 31ec: e3a01009 mov r1, #9 31f0: e3a02b01 mov r2, #1024 ; 0x400 31f4: e3a03c05 mov r3, #1280 ; 0x500 31f8: eb00089c bl 5470 TERMIOS_RXTASK_STACKSIZE, RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, &tty->rxTaskId); if (sc != RTEMS_SUCCESSFUL) 31fc: e3500000 cmp r0, #0 3200: 1a000060 bne 3388 rtems_fatal_error_occurred (sc); } if ((tty->device.pollRead == NULL) || 3204: e59430a0 ldr r3, [r4, #160] ; 0xa0 3208: e3530000 cmp r3, #0 320c: 0a000002 beq 321c 3210: e59430b4 ldr r3, [r4, #180] ; 0xb4 3214: e3530002 cmp r3, #2 3218: 1a00000b bne 324c (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){ sc = rtems_semaphore_create ( rtems_build_name ('T', 'R', 'r', c), 321c: e59f31a4 ldr r3, [pc, #420] ; 33c8 rtems_fatal_error_occurred (sc); } if ((tty->device.pollRead == NULL) || (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){ sc = rtems_semaphore_create ( 3220: e59f01bc ldr r0, [pc, #444] ; 33e4 rtems_build_name ('T', 'R', 'r', c), 3224: e5d3300c ldrb r3, [r3, #12] rtems_fatal_error_occurred (sc); } if ((tty->device.pollRead == NULL) || (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){ sc = rtems_semaphore_create ( 3228: e2842068 add r2, r4, #104 ; 0x68 322c: e3a01000 mov r1, #0 3230: e58d2000 str r2, [sp] 3234: e1830000 orr r0, r3, r0 3238: e3a02024 mov r2, #36 ; 0x24 323c: e1a03001 mov r3, r1 3240: eb00078b bl 5074 rtems_build_name ('T', 'R', 'r', c), 0, RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &tty->rawInBuf.Semaphore); if (sc != RTEMS_SUCCESSFUL) 3244: e3500000 cmp r0, #0 3248: 1a00004e bne 3388 } /* * Set default parameters */ tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL; 324c: e59f3194 ldr r3, [pc, #404] ; 33e8 3250: e5843030 str r3, [r4, #48] ; 0x30 tty->termios.c_oflag = OPOST | ONLCR | XTABS; 3254: e59f3190 ldr r3, [pc, #400] ; 33ec 3258: e5843034 str r3, [r4, #52] ; 0x34 tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL; 325c: e59f318c ldr r3, [pc, #396] ; 33f0 3260: e5843038 str r3, [r4, #56] ; 0x38 tty->termios.c_lflag = 3264: e59f3188 ldr r3, [pc, #392] ; 33f4 3268: e584303c str r3, [r4, #60] ; 0x3c ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL; tty->termios.c_cc[VINTR] = '\003'; 326c: e3a03003 mov r3, #3 3270: e5c43041 strb r3, [r4, #65] ; 0x41 tty->termios.c_cc[VQUIT] = '\034'; 3274: e2833019 add r3, r3, #25 3278: e5c43042 strb r3, [r4, #66] ; 0x42 tty->termios.c_cc[VERASE] = '\177'; 327c: e2833063 add r3, r3, #99 ; 0x63 3280: e5c43043 strb r3, [r4, #67] ; 0x43 tty->termios.c_cc[VKILL] = '\025'; 3284: e3a03015 mov r3, #21 3288: e5c43044 strb r3, [r4, #68] ; 0x44 tty->termios.c_cc[VEOF] = '\004'; 328c: e3a03004 mov r3, #4 3290: e5c43045 strb r3, [r4, #69] ; 0x45 tty->termios.c_cc[VEOL] = '\000'; 3294: e3a03000 mov r3, #0 tty->termios.c_cc[VDISCARD] = '\017'; tty->termios.c_cc[VWERASE] = '\027'; tty->termios.c_cc[VLNEXT] = '\026'; /* start with no flow control, clear flow control flags */ tty->flow_ctrl = 0; 3298: e58430b8 str r3, [r4, #184] ; 0xb8 tty->termios.c_cc[VINTR] = '\003'; tty->termios.c_cc[VQUIT] = '\034'; tty->termios.c_cc[VERASE] = '\177'; tty->termios.c_cc[VKILL] = '\025'; tty->termios.c_cc[VEOF] = '\004'; tty->termios.c_cc[VEOL] = '\000'; 329c: e5c4304c strb r3, [r4, #76] ; 0x4c tty->termios.c_cc[VEOL2] = '\000'; 32a0: e5c43051 strb r3, [r4, #81] ; 0x51 tty->termios.c_cc[VSTART] = '\021'; 32a4: e3a02011 mov r2, #17 /* start with no flow control, clear flow control flags */ tty->flow_ctrl = 0; /* * set low/highwater mark for XON/XOFF support */ tty->lowwater = tty->rawInBuf.Size * 1/2; 32a8: e5943064 ldr r3, [r4, #100] ; 0x64 tty->termios.c_cc[VERASE] = '\177'; tty->termios.c_cc[VKILL] = '\025'; tty->termios.c_cc[VEOF] = '\004'; tty->termios.c_cc[VEOL] = '\000'; tty->termios.c_cc[VEOL2] = '\000'; tty->termios.c_cc[VSTART] = '\021'; 32ac: e5c42049 strb r2, [r4, #73] ; 0x49 tty->termios.c_cc[VSTOP] = '\023'; 32b0: e2822002 add r2, r2, #2 32b4: e5c4204a strb r2, [r4, #74] ; 0x4a /* start with no flow control, clear flow control flags */ tty->flow_ctrl = 0; /* * set low/highwater mark for XON/XOFF support */ tty->lowwater = tty->rawInBuf.Size * 1/2; 32b8: e1a030a3 lsr r3, r3, #1 tty->termios.c_cc[VEOF] = '\004'; tty->termios.c_cc[VEOL] = '\000'; tty->termios.c_cc[VEOL2] = '\000'; tty->termios.c_cc[VSTART] = '\021'; tty->termios.c_cc[VSTOP] = '\023'; tty->termios.c_cc[VSUSP] = '\032'; 32bc: e2822007 add r2, r2, #7 32c0: e5c4204b strb r2, [r4, #75] ; 0x4b /* start with no flow control, clear flow control flags */ tty->flow_ctrl = 0; /* * set low/highwater mark for XON/XOFF support */ tty->lowwater = tty->rawInBuf.Size * 1/2; 32c4: e58430bc str r3, [r4, #188] ; 0xbc tty->termios.c_cc[VEOL] = '\000'; tty->termios.c_cc[VEOL2] = '\000'; tty->termios.c_cc[VSTART] = '\021'; tty->termios.c_cc[VSTOP] = '\023'; tty->termios.c_cc[VSUSP] = '\032'; tty->termios.c_cc[VREPRINT] = '\022'; 32c8: e3a02012 mov r2, #18 tty->flow_ctrl = 0; /* * set low/highwater mark for XON/XOFF support */ tty->lowwater = tty->rawInBuf.Size * 1/2; tty->highwater = tty->rawInBuf.Size * 3/4; 32cc: e5943064 ldr r3, [r4, #100] ; 0x64 tty->termios.c_cc[VEOL] = '\000'; tty->termios.c_cc[VEOL2] = '\000'; tty->termios.c_cc[VSTART] = '\021'; tty->termios.c_cc[VSTOP] = '\023'; tty->termios.c_cc[VSUSP] = '\032'; tty->termios.c_cc[VREPRINT] = '\022'; 32d0: e5c4204d strb r2, [r4, #77] ; 0x4d tty->termios.c_cc[VDISCARD] = '\017'; 32d4: e3a0200f mov r2, #15 32d8: e5c4204e strb r2, [r4, #78] ; 0x4e tty->flow_ctrl = 0; /* * set low/highwater mark for XON/XOFF support */ tty->lowwater = tty->rawInBuf.Size * 1/2; tty->highwater = tty->rawInBuf.Size * 3/4; 32dc: e0833083 add r3, r3, r3, lsl #1 tty->termios.c_cc[VSTART] = '\021'; tty->termios.c_cc[VSTOP] = '\023'; tty->termios.c_cc[VSUSP] = '\032'; tty->termios.c_cc[VREPRINT] = '\022'; tty->termios.c_cc[VDISCARD] = '\017'; tty->termios.c_cc[VWERASE] = '\027'; 32e0: e2822008 add r2, r2, #8 32e4: e5c4204f strb r2, [r4, #79] ; 0x4f tty->flow_ctrl = 0; /* * set low/highwater mark for XON/XOFF support */ tty->lowwater = tty->rawInBuf.Size * 1/2; tty->highwater = tty->rawInBuf.Size * 3/4; 32e8: e1a03123 lsr r3, r3, #2 tty->termios.c_cc[VSTOP] = '\023'; tty->termios.c_cc[VSUSP] = '\032'; tty->termios.c_cc[VREPRINT] = '\022'; tty->termios.c_cc[VDISCARD] = '\017'; tty->termios.c_cc[VWERASE] = '\027'; tty->termios.c_cc[VLNEXT] = '\026'; 32ec: e3a02016 mov r2, #22 32f0: e5c42050 strb r2, [r4, #80] ; 0x50 tty->flow_ctrl = 0; /* * set low/highwater mark for XON/XOFF support */ tty->lowwater = tty->rawInBuf.Size * 1/2; tty->highwater = tty->rawInBuf.Size * 3/4; 32f4: e58430c0 str r3, [r4, #192] ; 0xc0 /* * Bump name characer */ if (c++ == 'z') 32f8: e59f30c8 ldr r3, [pc, #200] ; 33c8 32fc: e5d3200c ldrb r2, [r3, #12] 3300: e352007a cmp r2, #122 ; 0x7a 3304: e2821001 add r1, r2, #1 c = 'a'; 3308: 03a02061 moveq r2, #97 ; 0x61 tty->lowwater = tty->rawInBuf.Size * 1/2; tty->highwater = tty->rawInBuf.Size * 3/4; /* * Bump name characer */ if (c++ == 'z') 330c: e5c3100c strb r1, [r3, #12] c = 'a'; 3310: 05c3200c strbeq r2, [r3, #12] } args->iop->data1 = tty; 3314: e5983000 ldr r3, [r8] 3318: e5835034 str r5, [r3, #52] ; 0x34 if (!tty->refcount++) { 331c: e5953008 ldr r3, [r5, #8] 3320: e2832001 add r2, r3, #1 3324: e3530000 cmp r3, #0 3328: e5852008 str r2, [r5, #8] 332c: 1a000016 bne 338c if (tty->device.firstOpen) 3330: e5953098 ldr r3, [r5, #152] ; 0x98 3334: e3530000 cmp r3, #0 (*tty->device.firstOpen)(major, minor, arg); 3338: 11a00009 movne r0, r9 333c: 11a0100a movne r1, sl 3340: 11a02008 movne r2, r8 3344: 11a0e00f movne lr, pc 3348: 112fff13 bxne r3 /* * start I/O tasks, if needed */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 334c: e59530b4 ldr r3, [r5, #180] ; 0xb4 3350: e3530002 cmp r3, #2 3354: 1a00000c bne 338c sc = rtems_task_start( 3358: e59500c4 ldr r0, [r5, #196] ; 0xc4 335c: e59f1094 ldr r1, [pc, #148] ; 33f8 3360: e1a02005 mov r2, r5 3364: eb0008e9 bl 5710 tty->rxTaskId, rtems_termios_rxdaemon, (rtems_task_argument)tty); if (sc != RTEMS_SUCCESSFUL) 3368: e3500000 cmp r0, #0 336c: 1a000005 bne 3388 rtems_fatal_error_occurred (sc); sc = rtems_task_start( 3370: e59500c8 ldr r0, [r5, #200] ; 0xc8 3374: e59f1080 ldr r1, [pc, #128] ; 33fc 3378: e1a02005 mov r2, r5 337c: eb0008e3 bl 5710 tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty); if (sc != RTEMS_SUCCESSFUL) 3380: e3500000 cmp r0, #0 3384: 0a000000 beq 338c rtems_fatal_error_occurred (sc); 3388: eb000967 bl 592c } } rtems_semaphore_release (rtems_termios_ttyMutex); 338c: e59f302c ldr r3, [pc, #44] ; 33c0 3390: e5930000 ldr r0, [r3] 3394: eb00080e bl 53d4 return RTEMS_SUCCESSFUL; } 3398: e1a00006 mov r0, r6 339c: e28dd010 add sp, sp, #16 33a0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} static char c = 'a'; /* * Create a new device */ tty = calloc (1, sizeof (struct rtems_termios_tty)); 33a4: e3a00001 mov r0, #1 33a8: e3a010e8 mov r1, #232 ; 0xe8 33ac: ebfffaea bl 1f5c if (tty == NULL) { 33b0: e2504000 subs r4, r0, #0 static char c = 'a'; /* * Create a new device */ tty = calloc (1, sizeof (struct rtems_termios_tty)); 33b4: e1a05000 mov r5, r0 if (tty == NULL) { 33b8: 1affff15 bne 3014 33bc: eaffff21 b 3048 =============================================================================== 0000409c : rtems_status_code rtems_termios_read (void *arg) { rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 409c: e5903000 ldr r3, [r0] return RTEMS_SUCCESSFUL; } rtems_status_code rtems_termios_read (void *arg) { 40a0: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr} rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 40a4: e5934034 ldr r4, [r3, #52] ; 0x34 uint32_t count = args->count; char *buffer = args->buffer; rtems_status_code sc; sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 40a8: e3a01000 mov r1, #0 rtems_status_code rtems_termios_read (void *arg) { rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; uint32_t count = args->count; 40ac: e5908010 ldr r8, [r0, #16] char *buffer = args->buffer; 40b0: e590b00c ldr fp, [r0, #12] return RTEMS_SUCCESSFUL; } rtems_status_code rtems_termios_read (void *arg) { 40b4: e1a05000 mov r5, r0 struct rtems_termios_tty *tty = args->iop->data1; uint32_t count = args->count; char *buffer = args->buffer; rtems_status_code sc; sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 40b8: e1a02001 mov r2, r1 40bc: e5940014 ldr r0, [r4, #20] 40c0: eb00047d bl 52bc if (sc != RTEMS_SUCCESSFUL) 40c4: e2507000 subs r7, r0, #0 40c8: 1a0000be bne 43c8 return sc; if (rtems_termios_linesw[tty->t_line].l_read != NULL) { 40cc: e59420cc ldr r2, [r4, #204] ; 0xcc 40d0: e59f32f8 ldr r3, [pc, #760] ; 43d0 40d4: e0833282 add r3, r3, r2, lsl #5 40d8: e5933008 ldr r3, [r3, #8] 40dc: e3530000 cmp r3, #0 40e0: 0a000005 beq 40fc sc = rtems_termios_linesw[tty->t_line].l_read(tty,args); 40e4: e1a00004 mov r0, r4 40e8: e1a01005 mov r1, r5 40ec: e1a0e00f mov lr, pc 40f0: e12fff13 bx r3 40f4: e1a07000 mov r7, r0 40f8: ea0000ae b 43b8 tty->tty_rcvwakeup = 0; rtems_semaphore_release (tty->isem); return sc; } if (tty->cindex == tty->ccount) { 40fc: e5942024 ldr r2, [r4, #36] ; 0x24 4100: e5943020 ldr r3, [r4, #32] 4104: e1520003 cmp r2, r3 4108: 1a0000a1 bne 4394 tty->cindex = tty->ccount = 0; tty->read_start_column = tty->column; 410c: e5943028 ldr r3, [r4, #40] ; 0x28 4110: e584302c str r3, [r4, #44] ; 0x2c if (tty->device.pollRead != NULL && 4114: e59430a0 ldr r3, [r4, #160] ; 0xa0 4118: e3530000 cmp r3, #0 rtems_semaphore_release (tty->isem); return sc; } if (tty->cindex == tty->ccount) { tty->cindex = tty->ccount = 0; 411c: e5847020 str r7, [r4, #32] 4120: e5847024 str r7, [r4, #36] ; 0x24 tty->read_start_column = tty->column; if (tty->device.pollRead != NULL && 4124: 0a00003b beq 4218 4128: e59430b4 ldr r3, [r4, #180] ; 0xb4 412c: e3530000 cmp r3, #0 4130: 1a000038 bne 4218 static rtems_status_code fillBufferPoll (struct rtems_termios_tty *tty) { int n; if (tty->termios.c_lflag & ICANON) { 4134: e594303c ldr r3, [r4, #60] ; 0x3c 4138: e3130002 tst r3, #2 413c: 0a00000d beq 4178 for (;;) { n = (*tty->device.pollRead)(tty->minor); 4140: e5940010 ldr r0, [r4, #16] 4144: e1a0e00f mov lr, pc 4148: e594f0a0 ldr pc, [r4, #160] ; 0xa0 if (n < 0) { 414c: e3500000 cmp r0, #0 4150: aa000002 bge 4160 rtems_task_wake_after (1); 4154: e3a00001 mov r0, #1 4158: eb000584 bl 5770 415c: eafffff7 b 4140 } else { if (siproc (n, tty)) 4160: e20000ff and r0, r0, #255 ; 0xff 4164: e1a01004 mov r1, r4 4168: ebffff86 bl 3f88 416c: e3500000 cmp r0, #0 4170: 0afffff2 beq 4140 4174: ea000086 b 4394 } } } else { rtems_interval then, now; then = rtems_clock_get_ticks_since_boot(); 4178: eb0002c4 bl 4c90 417c: e1a06000 mov r6, r0 for (;;) { n = (*tty->device.pollRead)(tty->minor); 4180: e5940010 ldr r0, [r4, #16] 4184: e1a0e00f mov lr, pc 4188: e594f0a0 ldr pc, [r4, #160] ; 0xa0 if (n < 0) { 418c: e3500000 cmp r0, #0 4190: aa000013 bge 41e4 if (tty->termios.c_cc[VMIN]) { 4194: e5d43047 ldrb r3, [r4, #71] ; 0x47 4198: e3530000 cmp r3, #0 419c: e5d43046 ldrb r3, [r4, #70] ; 0x46 41a0: 0a000005 beq 41bc if (tty->termios.c_cc[VTIME] && tty->ccount) { 41a4: e3530000 cmp r3, #0 41a8: 0a00000a beq 41d8 41ac: e5943020 ldr r3, [r4, #32] 41b0: e3530000 cmp r3, #0 41b4: 0a000007 beq 41d8 41b8: ea000001 b 41c4 if ((now - then) > tty->vtimeTicks) { break; } } } else { if (!tty->termios.c_cc[VTIME]) 41bc: e3530000 cmp r3, #0 <== NOT EXECUTED 41c0: 0a000073 beq 4394 <== NOT EXECUTED break; now = rtems_clock_get_ticks_since_boot(); 41c4: eb0002b1 bl 4c90 if ((now - then) > tty->vtimeTicks) { 41c8: e5943054 ldr r3, [r4, #84] ; 0x54 41cc: e0660000 rsb r0, r6, r0 41d0: e1500003 cmp r0, r3 41d4: 8a00006e bhi 4394 break; } } rtems_task_wake_after (1); 41d8: e3a00001 mov r0, #1 41dc: eb000563 bl 5770 41e0: eaffffe6 b 4180 } else { siproc (n, tty); 41e4: e20000ff and r0, r0, #255 ; 0xff 41e8: e1a01004 mov r1, r4 41ec: ebffff65 bl 3f88 if (tty->ccount >= tty->termios.c_cc[VMIN]) 41f0: e5d43047 ldrb r3, [r4, #71] ; 0x47 41f4: e5942020 ldr r2, [r4, #32] 41f8: e1520003 cmp r2, r3 41fc: aa000064 bge 4394 break; if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME]) 4200: e3530000 cmp r3, #0 4204: 0affffdd beq 4180 4208: e5d43046 ldrb r3, [r4, #70] ; 0x46 420c: e3530000 cmp r3, #0 4210: 0affffda beq 4180 4214: eaffffd7 b 4178 if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF)) == (FL_MDXON | FL_ISNTXOF)) && ((tty->rawOutBufState == rob_idle) || (tty->flow_ctrl & FL_OSTOP))) { /* XON should be sent now... */ (*tty->device.write)( 4218: e2842049 add r2, r4, #73 ; 0x49 * Fill the input buffer from the raw input queue */ static rtems_status_code fillBufferQueue (struct rtems_termios_tty *tty) { rtems_interval timeout = tty->rawInBufSemaphoreFirstTimeout; 421c: e594a074 ldr sl, [r4, #116] ; 0x74 rtems_status_code sc; int wait = (int)1; 4220: e3a06001 mov r6, #1 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && (tty->ccount < (CBUFSIZE-1))) { 4224: e59f91a8 ldr r9, [pc, #424] ; 43d4 if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF)) == (FL_MDXON | FL_ISNTXOF)) && ((tty->rawOutBufState == rob_idle) || (tty->flow_ctrl & FL_OSTOP))) { /* XON should be sent now... */ (*tty->device.write)( 4228: e58d2000 str r2, [sp] 422c: ea000040 b 4334 while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && (tty->ccount < (CBUFSIZE-1))) { unsigned char c; unsigned int newHead; newHead = (tty->rawInBuf.Head + 1) % tty->rawInBuf.Size; 4230: e594005c ldr r0, [r4, #92] ; 0x5c 4234: e5941064 ldr r1, [r4, #100] ; 0x64 4238: e2800001 add r0, r0, #1 423c: eb003192 bl 1088c <__umodsi3> c = tty->rawInBuf.theBuf[newHead]; 4240: e5943058 ldr r3, [r4, #88] ; 0x58 4244: e7d3a000 ldrb sl, [r3, r0] tty->rawInBuf.Head = newHead; 4248: e584005c str r0, [r4, #92] ; 0x5c if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size) 424c: e5943060 ldr r3, [r4, #96] ; 0x60 4250: e5942064 ldr r2, [r4, #100] ; 0x64 4254: e0823003 add r3, r2, r3 % tty->rawInBuf.Size) 4258: e0600003 rsb r0, r0, r3 425c: e5941064 ldr r1, [r4, #100] ; 0x64 4260: eb003189 bl 1088c <__umodsi3> unsigned int newHead; newHead = (tty->rawInBuf.Head + 1) % tty->rawInBuf.Size; c = tty->rawInBuf.theBuf[newHead]; tty->rawInBuf.Head = newHead; if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size) 4264: e59430bc ldr r3, [r4, #188] ; 0xbc 4268: e1500003 cmp r0, r3 426c: 2a00001f bcs 42f0 % tty->rawInBuf.Size) < tty->lowwater) { tty->flow_ctrl &= ~FL_IREQXOF; 4270: e59430b8 ldr r3, [r4, #184] ; 0xb8 4274: e3c33001 bic r3, r3, #1 4278: e58430b8 str r3, [r4, #184] ; 0xb8 /* if tx stopped and XON should be sent... */ if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF)) 427c: e59f3154 ldr r3, [pc, #340] ; 43d8 4280: e59420b8 ldr r2, [r4, #184] ; 0xb8 4284: e0023003 and r3, r2, r3 4288: e59f2148 ldr r2, [pc, #328] ; 43d8 428c: e1530002 cmp r3, r2 4290: 1a00000b bne 42c4 == (FL_MDXON | FL_ISNTXOF)) && ((tty->rawOutBufState == rob_idle) 4294: e5943094 ldr r3, [r4, #148] ; 0x94 <== NOT EXECUTED 4298: e3530000 cmp r3, #0 <== NOT EXECUTED 429c: 0a000002 beq 42ac <== NOT EXECUTED || (tty->flow_ctrl & FL_OSTOP))) { 42a0: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 42a4: e3130020 tst r3, #32 <== NOT EXECUTED 42a8: 0a000005 beq 42c4 <== NOT EXECUTED /* XON should be sent now... */ (*tty->device.write)( 42ac: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED 42b0: e59d1000 ldr r1, [sp] <== NOT EXECUTED 42b4: e3a02001 mov r2, #1 <== NOT EXECUTED 42b8: e1a0e00f mov lr, pc <== NOT EXECUTED 42bc: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED 42c0: ea00000a b 42f0 <== NOT EXECUTED tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1); } else if (tty->flow_ctrl & FL_MDRTS) { 42c4: e59430b8 ldr r3, [r4, #184] ; 0xb8 42c8: e3130c01 tst r3, #256 ; 0x100 42cc: 0a000007 beq 42f0 tty->flow_ctrl &= ~FL_IRTSOFF; 42d0: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 42d4: e3c33004 bic r3, r3, #4 <== NOT EXECUTED 42d8: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED /* activate RTS line */ if (tty->device.startRemoteTx != NULL) { 42dc: e59430b0 ldr r3, [r4, #176] ; 0xb0 <== NOT EXECUTED 42e0: e3530000 cmp r3, #0 <== NOT EXECUTED tty->device.startRemoteTx(tty->minor); 42e4: 15940010 ldrne r0, [r4, #16] <== NOT EXECUTED 42e8: 11a0e00f movne lr, pc <== NOT EXECUTED 42ec: 112fff13 bxne r3 <== NOT EXECUTED } } } /* continue processing new character */ if (tty->termios.c_lflag & ICANON) { 42f0: e594303c ldr r3, [r4, #60] ; 0x3c 42f4: e3130002 tst r3, #2 42f8: 0a000005 beq 4314 if (siproc (c, tty)) 42fc: e1a0000a mov r0, sl 4300: e1a01004 mov r1, r4 4304: ebffff1f bl 3f88 wait = 0; 4308: e3500000 cmp r0, #0 430c: 13a06000 movne r6, #0 4310: ea000006 b 4330 } else { siproc (c, tty); 4314: e1a0000a mov r0, sl <== NOT EXECUTED 4318: e1a01004 mov r1, r4 <== NOT EXECUTED 431c: ebffff19 bl 3f88 <== NOT EXECUTED if (tty->ccount >= tty->termios.c_cc[VMIN]) 4320: e5d43047 ldrb r3, [r4, #71] ; 0x47 <== NOT EXECUTED 4324: e5942020 ldr r2, [r4, #32] <== NOT EXECUTED wait = 0; 4328: e1520003 cmp r2, r3 <== NOT EXECUTED 432c: a3a06000 movge r6, #0 <== NOT EXECUTED } timeout = tty->rawInBufSemaphoreTimeout; 4330: e594a070 ldr sl, [r4, #112] ; 0x70 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 4334: e594205c ldr r2, [r4, #92] ; 0x5c 4338: e5943060 ldr r3, [r4, #96] ; 0x60 433c: e1520003 cmp r2, r3 4340: 0a000004 beq 4358 (tty->ccount < (CBUFSIZE-1))) { 4344: e5993008 ldr r3, [r9, #8] while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 4348: e5942020 ldr r2, [r4, #32] (tty->ccount < (CBUFSIZE-1))) { 434c: e2433001 sub r3, r3, #1 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 4350: e1520003 cmp r2, r3 4354: baffffb5 blt 4230 } /* * Wait for characters */ if ( wait ) { 4358: e3560000 cmp r6, #0 435c: 0a00000c beq 4394 sc = rtems_semaphore_obtain( 4360: e2840068 add r0, r4, #104 ; 0x68 4364: e8900003 ldm r0, {r0, r1} 4368: e1a0200a mov r2, sl 436c: eb0003d2 bl 52bc tty->rawInBuf.Semaphore, tty->rawInBufSemaphoreOptions, timeout); if (sc != RTEMS_SUCCESSFUL) 4370: e3500000 cmp r0, #0 4374: 0affffee beq 4334 4378: ea000005 b 4394 <== NOT EXECUTED if (sc != RTEMS_SUCCESSFUL) tty->cindex = tty->ccount = 0; } while (count && (tty->cindex < tty->ccount)) { *buffer++ = tty->cbuf[tty->cindex++]; 437c: e594201c ldr r2, [r4, #28] 4380: e7d22003 ldrb r2, [r2, r3] 4384: e2833001 add r3, r3, #1 4388: e4cb2001 strb r2, [fp], #1 438c: e5843024 str r3, [r4, #36] ; 0x24 count--; 4390: e2488001 sub r8, r8, #1 sc = fillBufferQueue (tty); if (sc != RTEMS_SUCCESSFUL) tty->cindex = tty->ccount = 0; } while (count && (tty->cindex < tty->ccount)) { 4394: e3580000 cmp r8, #0 4398: 0a000003 beq 43ac 439c: e2842020 add r2, r4, #32 43a0: e892000c ldm r2, {r2, r3} 43a4: e1530002 cmp r3, r2 43a8: bafffff3 blt 437c *buffer++ = tty->cbuf[tty->cindex++]; count--; } args->bytes_moved = args->count - count; 43ac: e5953010 ldr r3, [r5, #16] 43b0: e0688003 rsb r8, r8, r3 43b4: e5858018 str r8, [r5, #24] tty->tty_rcvwakeup = 0; 43b8: e3a03000 mov r3, #0 43bc: e58430e4 str r3, [r4, #228] ; 0xe4 rtems_semaphore_release (tty->isem); 43c0: e5940014 ldr r0, [r4, #20] 43c4: eb000402 bl 53d4 return sc; } 43c8: e1a00007 mov r0, r7 43cc: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 000046ec : int nToSend; rtems_interrupt_level level; int len; /* check for XOF/XON to send */ if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF)) 46ec: e59020b8 ldr r2, [r0, #184] ; 0xb8 46f0: e59f31b8 ldr r3, [pc, #440] ; 48b0 46f4: e0023003 and r3, r2, r3 46f8: e59f21b4 ldr r2, [pc, #436] ; 48b4 46fc: e1530002 cmp r3, r2 * in task-driven mode, this function is called in Tx task context * in interrupt-driven mode, this function is called in TxIRQ context */ int rtems_termios_refill_transmitter (struct rtems_termios_tty *tty) { 4700: e92d4070 push {r4, r5, r6, lr} 4704: e1a04000 mov r4, r0 int nToSend; rtems_interrupt_level level; int len; /* check for XOF/XON to send */ if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF)) 4708: 1a00000c bne 4740 == (FL_MDXOF | FL_IREQXOF)) { /* XOFF should be sent now... */ (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1); 470c: e284104a add r1, r4, #74 ; 0x4a <== NOT EXECUTED 4710: e2422b01 sub r2, r2, #1024 ; 0x400 <== NOT EXECUTED 4714: e5900010 ldr r0, [r0, #16] <== NOT EXECUTED 4718: e1a0e00f mov lr, pc <== NOT EXECUTED 471c: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED rtems_interrupt_disable(level); 4720: ebfffa06 bl 2f40 <== NOT EXECUTED tty->t_dqlen--; 4724: e5943090 ldr r3, [r4, #144] ; 0x90 <== NOT EXECUTED 4728: e2433001 sub r3, r3, #1 <== NOT EXECUTED 472c: e5843090 str r3, [r4, #144] ; 0x90 <== NOT EXECUTED tty->flow_ctrl |= FL_ISNTXOF; 4730: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 4734: e3833002 orr r3, r3, #2 <== NOT EXECUTED 4738: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED rtems_interrupt_enable(level); 473c: ea00000f b 4780 <== NOT EXECUTED nToSend = 1; } else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) { 4740: e59030b8 ldr r3, [r0, #184] ; 0xb8 4744: e2033003 and r3, r3, #3 4748: e3530002 cmp r3, #2 474c: 1a00000e bne 478c * FIXME: this .write call will generate another * dequeue callback. This will advance the "Tail" in the data * buffer, although the corresponding data is not yet out! * Therefore the dequeue "length" should be reduced by 1 */ (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1); 4750: e2841049 add r1, r4, #73 ; 0x49 <== NOT EXECUTED 4754: e3a02001 mov r2, #1 <== NOT EXECUTED 4758: e5900010 ldr r0, [r0, #16] <== NOT EXECUTED 475c: e1a0e00f mov lr, pc <== NOT EXECUTED 4760: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED rtems_interrupt_disable(level); 4764: ebfff9f5 bl 2f40 <== NOT EXECUTED tty->t_dqlen--; 4768: e5943090 ldr r3, [r4, #144] ; 0x90 <== NOT EXECUTED 476c: e2433001 sub r3, r3, #1 <== NOT EXECUTED 4770: e5843090 str r3, [r4, #144] ; 0x90 <== NOT EXECUTED tty->flow_ctrl &= ~FL_ISNTXOF; 4774: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 4778: e3c33002 bic r3, r3, #2 <== NOT EXECUTED 477c: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 4780: e129f000 msr CPSR_fc, r0 <== NOT EXECUTED rtems_interrupt_enable(level); nToSend = 1; 4784: e3a05001 mov r5, #1 <== NOT EXECUTED 4788: ea000046 b 48a8 <== NOT EXECUTED } else { if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) { 478c: e5902080 ldr r2, [r0, #128] ; 0x80 4790: e5903084 ldr r3, [r0, #132] ; 0x84 4794: e1520003 cmp r2, r3 4798: 1a000005 bne 47b4 /* * buffer was empty */ if (tty->rawOutBufState == rob_wait) { 479c: e5903094 ldr r3, [r0, #148] ; 0x94 47a0: e3530002 cmp r3, #2 47a4: 1a00003e bne 48a4 /* * this should never happen... */ rtems_semaphore_release (tty->rawOutBuf.Semaphore); 47a8: e590008c ldr r0, [r0, #140] ; 0x8c <== NOT EXECUTED 47ac: eb000308 bl 53d4 <== NOT EXECUTED 47b0: ea00003b b 48a4 <== NOT EXECUTED } return 0; } rtems_interrupt_disable(level); 47b4: ebfff9e1 bl 2f40 len = tty->t_dqlen; tty->t_dqlen = 0; 47b8: e3a03000 mov r3, #0 } return 0; } rtems_interrupt_disable(level); len = tty->t_dqlen; 47bc: e5942090 ldr r2, [r4, #144] ; 0x90 tty->t_dqlen = 0; 47c0: e5843090 str r3, [r4, #144] ; 0x90 47c4: e129f000 msr CPSR_fc, r0 rtems_interrupt_enable(level); newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size; 47c8: e5943084 ldr r3, [r4, #132] ; 0x84 47cc: e5941088 ldr r1, [r4, #136] ; 0x88 47d0: e0820003 add r0, r2, r3 47d4: eb00302c bl 1088c <__umodsi3> tty->rawOutBuf.Tail = newTail; if (tty->rawOutBufState == rob_wait) { 47d8: e5943094 ldr r3, [r4, #148] ; 0x94 47dc: e3530002 cmp r3, #2 rtems_interrupt_disable(level); len = tty->t_dqlen; tty->t_dqlen = 0; rtems_interrupt_enable(level); newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size; 47e0: e1a06000 mov r6, r0 tty->rawOutBuf.Tail = newTail; 47e4: e5840084 str r0, [r4, #132] ; 0x84 if (tty->rawOutBufState == rob_wait) { /* * wake up any pending writer task */ rtems_semaphore_release (tty->rawOutBuf.Semaphore); 47e8: 0594008c ldreq r0, [r4, #140] ; 0x8c 47ec: 0b0002f8 bleq 53d4 } if (newTail == tty->rawOutBuf.Head) { 47f0: e5943080 ldr r3, [r4, #128] ; 0x80 47f4: e1560003 cmp r6, r3 47f8: 1a00000a bne 4828 nToSend = 0; /* * check to see if snd wakeup callback was set */ if ( tty->tty_snd.sw_pfn != NULL) { 47fc: e59430d4 ldr r3, [r4, #212] ; 0xd4 if (newTail == tty->rawOutBuf.Head) { /* * Buffer has become empty */ tty->rawOutBufState = rob_idle; 4800: e3a05000 mov r5, #0 nToSend = 0; /* * check to see if snd wakeup callback was set */ if ( tty->tty_snd.sw_pfn != NULL) { 4804: e1530005 cmp r3, r5 if (newTail == tty->rawOutBuf.Head) { /* * Buffer has become empty */ tty->rawOutBufState = rob_idle; 4808: e5845094 str r5, [r4, #148] ; 0x94 nToSend = 0; 480c: 01a05003 moveq r5, r3 /* * check to see if snd wakeup callback was set */ if ( tty->tty_snd.sw_pfn != NULL) { 4810: 0a000021 beq 489c (*tty->tty_snd.sw_pfn)(&tty->termios, tty->tty_snd.sw_arg); 4814: e2840030 add r0, r4, #48 ; 0x30 <== NOT EXECUTED 4818: e59410d8 ldr r1, [r4, #216] ; 0xd8 <== NOT EXECUTED 481c: e1a0e00f mov lr, pc <== NOT EXECUTED 4820: e12fff13 bx r3 <== NOT EXECUTED 4824: ea00001c b 489c <== NOT EXECUTED } } /* check, whether output should stop due to received XOFF */ else if ((tty->flow_ctrl & (FL_MDXON | FL_ORCVXOF)) 4828: e59430b8 ldr r3, [r4, #184] ; 0xb8 482c: e2033e21 and r3, r3, #528 ; 0x210 4830: e3530e21 cmp r3, #528 ; 0x210 4834: 1a000008 bne 485c == (FL_MDXON | FL_ORCVXOF)) { /* Buffer not empty, but output stops due to XOFF */ /* set flag, that output has been stopped */ rtems_interrupt_disable(level); 4838: ebfff9c0 bl 2f40 <== NOT EXECUTED tty->flow_ctrl |= FL_OSTOP; 483c: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 4840: e3833020 orr r3, r3, #32 <== NOT EXECUTED 4844: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED tty->rawOutBufState = rob_busy; /*apm*/ 4848: e3a03001 mov r3, #1 <== NOT EXECUTED 484c: e5843094 str r3, [r4, #148] ; 0x94 <== NOT EXECUTED 4850: e129f000 msr CPSR_fc, r0 <== NOT EXECUTED rtems_interrupt_enable(level); nToSend = 0; 4854: e3a05000 mov r5, #0 <== NOT EXECUTED 4858: ea00000f b 489c <== NOT EXECUTED } else { /* * Buffer not empty, start tranmitter */ if (newTail > tty->rawOutBuf.Head) 485c: e5943080 ldr r3, [r4, #128] ; 0x80 4860: e1560003 cmp r6, r3 nToSend = tty->rawOutBuf.Size - newTail; 4864: 85945088 ldrhi r5, [r4, #136] ; 0x88 else nToSend = tty->rawOutBuf.Head - newTail; 4868: 95945080 ldrls r5, [r4, #128] ; 0x80 /* when flow control XON or XOF, don't send blocks of data */ /* to allow fast reaction on incoming flow ctrl and low latency*/ /* for outgoing flow control */ if (tty->flow_ctrl & (FL_MDXON | FL_MDXOF)) { 486c: e59430b8 ldr r3, [r4, #184] ; 0xb8 * Buffer not empty, start tranmitter */ if (newTail > tty->rawOutBuf.Head) nToSend = tty->rawOutBuf.Size - newTail; else nToSend = tty->rawOutBuf.Head - newTail; 4870: e0665005 rsb r5, r6, r5 /* when flow control XON or XOF, don't send blocks of data */ /* to allow fast reaction on incoming flow ctrl and low latency*/ /* for outgoing flow control */ if (tty->flow_ctrl & (FL_MDXON | FL_MDXOF)) { 4874: e3130c06 tst r3, #1536 ; 0x600 nToSend = 1; } tty->rawOutBufState = rob_busy; /*apm*/ (*tty->device.write)( 4878: e594107c ldr r1, [r4, #124] ; 0x7c nToSend = tty->rawOutBuf.Head - newTail; /* when flow control XON or XOF, don't send blocks of data */ /* to allow fast reaction on incoming flow ctrl and low latency*/ /* for outgoing flow control */ if (tty->flow_ctrl & (FL_MDXON | FL_MDXOF)) { nToSend = 1; 487c: 13a05001 movne r5, #1 } tty->rawOutBufState = rob_busy; /*apm*/ 4880: e3a03001 mov r3, #1 4884: e5843094 str r3, [r4, #148] ; 0x94 (*tty->device.write)( 4888: e5940010 ldr r0, [r4, #16] 488c: e0811006 add r1, r1, r6 4890: e1a02005 mov r2, r5 4894: e1a0e00f mov lr, pc 4898: e594f0a4 ldr pc, [r4, #164] ; 0xa4 tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend); } tty->rawOutBuf.Tail = newTail; /*apm*/ 489c: e5846084 str r6, [r4, #132] ; 0x84 48a0: ea000000 b 48a8 /* * this should never happen... */ rtems_semaphore_release (tty->rawOutBuf.Semaphore); } return 0; 48a4: e3a05000 mov r5, #0 tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend); } tty->rawOutBuf.Tail = newTail; /*apm*/ } return nToSend; } 48a8: e1a00005 mov r0, r5 48ac: e8bd8070 pop {r4, r5, r6, pc} =============================================================================== 00003fe4 : rtems_status_code rtems_termios_write (void *arg) { rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 3fe4: e5903000 ldr r3, [r0] rtems_termios_puts (&c, 1, tty); } rtems_status_code rtems_termios_write (void *arg) { 3fe8: e92d41f0 push {r4, r5, r6, r7, r8, lr} rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 3fec: e5935034 ldr r5, [r3, #52] ; 0x34 rtems_status_code sc; sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 3ff0: e3a01000 mov r1, #0 rtems_termios_puts (&c, 1, tty); } rtems_status_code rtems_termios_write (void *arg) { 3ff4: e1a04000 mov r4, r0 rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; rtems_status_code sc; sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 3ff8: e1a02001 mov r2, r1 3ffc: e5950018 ldr r0, [r5, #24] 4000: eb0004ad bl 52bc if (sc != RTEMS_SUCCESSFUL) 4004: e2506000 subs r6, r0, #0 4008: 1a000020 bne 4090 return sc; if (rtems_termios_linesw[tty->t_line].l_write != NULL) { 400c: e59520cc ldr r2, [r5, #204] ; 0xcc 4010: e59f3080 ldr r3, [pc, #128] ; 4098 4014: e0833282 add r3, r3, r2, lsl #5 4018: e593300c ldr r3, [r3, #12] 401c: e3530000 cmp r3, #0 4020: 0a000005 beq 403c sc = rtems_termios_linesw[tty->t_line].l_write(tty,args); 4024: e1a00005 mov r0, r5 4028: e1a01004 mov r1, r4 402c: e1a0e00f mov lr, pc 4030: e12fff13 bx r3 4034: e1a06000 mov r6, r0 4038: ea000012 b 4088 rtems_semaphore_release (tty->osem); return sc; } if (tty->termios.c_oflag & OPOST) { 403c: e5953034 ldr r3, [r5, #52] ; 0x34 4040: e3130001 tst r3, #1 uint32_t count = args->count; 4044: 15947010 ldrne r7, [r4, #16] char *buffer = args->buffer; 4048: 1594800c ldrne r8, [r4, #12] if (rtems_termios_linesw[tty->t_line].l_write != NULL) { sc = rtems_termios_linesw[tty->t_line].l_write(tty,args); rtems_semaphore_release (tty->osem); return sc; } if (tty->termios.c_oflag & OPOST) { 404c: 1a000004 bne 4064 4050: ea000006 b 4070 <== NOT EXECUTED uint32_t count = args->count; char *buffer = args->buffer; while (count--) oproc (*buffer++, tty); 4054: e4d80001 ldrb r0, [r8], #1 4058: e1a01005 mov r1, r5 405c: ebfffe7c bl 3a54 4060: e2477001 sub r7, r7, #1 return sc; } if (tty->termios.c_oflag & OPOST) { uint32_t count = args->count; char *buffer = args->buffer; while (count--) 4064: e3570000 cmp r7, #0 4068: 1afffff9 bne 4054 406c: ea000003 b 4080 oproc (*buffer++, tty); args->bytes_moved = args->count; } else { rtems_termios_puts (args->buffer, args->count, tty); 4070: e284000c add r0, r4, #12 <== NOT EXECUTED 4074: e8900003 ldm r0, {r0, r1} <== NOT EXECUTED 4078: e1a02005 mov r2, r5 <== NOT EXECUTED 407c: ebfffe34 bl 3954 <== NOT EXECUTED args->bytes_moved = args->count; 4080: e5943010 ldr r3, [r4, #16] 4084: e5843018 str r3, [r4, #24] } rtems_semaphore_release (tty->osem); 4088: e5950018 ldr r0, [r5, #24] 408c: eb0004d0 bl 53d4 return sc; } 4090: e1a00006 mov r0, r6 4094: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} =============================================================================== 0000661c : { int local_errno = 0; int chars_written = 0; rtems_status_code status; if (error_flag & RTEMS_ERROR_PANIC) { 661c: e3100202 tst r0, #536870912 ; 0x20000000 static int rtems_verror( rtems_error_code_t error_flag, const char *printf_format, va_list arglist ) { 6620: e92d41f0 push {r4, r5, r6, r7, r8, lr} 6624: e1a05000 mov r5, r0 6628: e1a08001 mov r8, r1 662c: e1a04002 mov r4, r2 int local_errno = 0; int chars_written = 0; rtems_status_code status; if (error_flag & RTEMS_ERROR_PANIC) { 6630: 0a00000e beq 6670 if (rtems_panic_in_progress++) 6634: e59f212c ldr r2, [pc, #300] ; 6768 6638: e5923000 ldr r3, [r2] 663c: e2831001 add r1, r3, #1 6640: e3530000 cmp r3, #0 6644: e5821000 str r1, [r2] 6648: 0a000003 beq 665c rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 664c: e59f3118 ldr r3, [pc, #280] ; 676c <== NOT EXECUTED 6650: e5932000 ldr r2, [r3] <== NOT EXECUTED 6654: e2822001 add r2, r2, #1 <== NOT EXECUTED 6658: e5832000 str r2, [r3] <== NOT EXECUTED _Thread_Disable_dispatch(); /* disable task switches */ /* don't aggravate things */ if (rtems_panic_in_progress > 2) 665c: e59f3104 ldr r3, [pc, #260] ; 6768 6660: e5933000 ldr r3, [r3] 6664: e3530002 cmp r3, #2 return 0; 6668: c3a04000 movgt r4, #0 if (error_flag & RTEMS_ERROR_PANIC) { if (rtems_panic_in_progress++) _Thread_Disable_dispatch(); /* disable task switches */ /* don't aggravate things */ if (rtems_panic_in_progress > 2) 666c: ca00003b bgt 6760 return 0; } (void) fflush(stdout); /* in case stdout/stderr same */ 6670: e59f30f8 ldr r3, [pc, #248] ; 6770 6674: e5933000 ldr r3, [r3] 6678: e5930008 ldr r0, [r3, #8] 667c: eb002f6b bl 12430 status = error_flag & ~RTEMS_ERROR_MASK; 6680: e3c56207 bic r6, r5, #1879048192 ; 0x70000000 if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */ 6684: e2155101 ands r5, r5, #1073741824 ; 0x40000000 6688: 0a000001 beq 6694 local_errno = errno; 668c: eb002e70 bl 12054 <__errno> 6690: e5905000 ldr r5, [r0] #if defined(RTEMS_MULTIPROCESSING) if (_System_state_Is_multiprocessing) fprintf(stderr, "[%" PRIu32 "] ", _Configuration_MP_table->node); #endif chars_written += vfprintf(stderr, printf_format, arglist); 6694: e59f70d4 ldr r7, [pc, #212] ; 6770 6698: e5973000 ldr r3, [r7] 669c: e1a02004 mov r2, r4 66a0: e593000c ldr r0, [r3, #12] 66a4: e1a01008 mov r1, r8 66a8: eb004a9d bl 19124 if (status) 66ac: e3560000 cmp r6, #0 #if defined(RTEMS_MULTIPROCESSING) if (_System_state_Is_multiprocessing) fprintf(stderr, "[%" PRIu32 "] ", _Configuration_MP_table->node); #endif chars_written += vfprintf(stderr, printf_format, arglist); 66b0: e1a04000 mov r4, r0 if (status) 66b4: 0a000008 beq 66dc chars_written += fprintf(stderr, " (status: %s)", rtems_status_text(status)); 66b8: e5973000 ldr r3, [r7] 66bc: e1a00006 mov r0, r6 66c0: e593700c ldr r7, [r3, #12] 66c4: ebffffd0 bl 660c 66c8: e59f10a4 ldr r1, [pc, #164] ; 6774 66cc: e1a02000 mov r2, r0 66d0: e1a00007 mov r0, r7 66d4: eb00303b bl 127c8 #endif chars_written += vfprintf(stderr, printf_format, arglist); if (status) chars_written += 66d8: e0844000 add r4, r4, r0 fprintf(stderr, " (status: %s)", rtems_status_text(status)); if (local_errno) { 66dc: e3550000 cmp r5, #0 66e0: 0a000015 beq 673c if ((local_errno > 0) && *strerror(local_errno)) 66e4: da00000d ble 6720 66e8: e1a00005 mov r0, r5 66ec: eb003338 bl 133d4 66f0: e5d03000 ldrb r3, [r0] 66f4: e3530000 cmp r3, #0 66f8: 0a000008 beq 6720 chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno)); 66fc: e59f306c ldr r3, [pc, #108] ; 6770 6700: e5933000 ldr r3, [r3] 6704: e1a00005 mov r0, r5 6708: e593600c ldr r6, [r3, #12] 670c: eb003330 bl 133d4 6710: e59f1060 ldr r1, [pc, #96] ; 6778 6714: e1a02000 mov r2, r0 6718: e1a00006 mov r0, r6 671c: ea000004 b 6734 else chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno); 6720: e59f3048 ldr r3, [pc, #72] ; 6770 6724: e5933000 ldr r3, [r3] 6728: e59f104c ldr r1, [pc, #76] ; 677c 672c: e593000c ldr r0, [r3, #12] 6730: e1a02005 mov r2, r5 6734: eb003023 bl 127c8 6738: e0844000 add r4, r4, r0 } chars_written += fprintf(stderr, "\n"); 673c: e59f502c ldr r5, [pc, #44] ; 6770 6740: e5953000 ldr r3, [r5] 6744: e59f1034 ldr r1, [pc, #52] ; 6780 6748: e593000c ldr r0, [r3, #12] 674c: eb00301d bl 127c8 (void) fflush(stderr); 6750: e5953000 ldr r3, [r5] chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno)); else chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno); } chars_written += fprintf(stderr, "\n"); 6754: e0804004 add r4, r0, r4 (void) fflush(stderr); 6758: e593000c ldr r0, [r3, #12] 675c: eb002f33 bl 12430 return chars_written; } 6760: e1a00004 mov r0, r4 6764: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} =============================================================================== 000027e8 : /* * Extract an integer value from the database */ static int scanInt(FILE *fp, int *val) { 27e8: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr} int c; unsigned int i = 0; unsigned int limit = INT_MAX; int sign = 0; 27ec: e3a04000 mov r4, #0 /* * Extract an integer value from the database */ static int scanInt(FILE *fp, int *val) { 27f0: e58d1000 str r1, [sp] unsigned int limit = INT_MAX; int sign = 0; int d; for (;;) { c = getc(fp); 27f4: e59fb0d4 ldr fp, [pc, #212] ; 28d0 limit++; continue; } sign = 1; } if (!isdigit(c)) 27f8: e59f90d4 ldr r9, [pc, #212] ; 28d4 /* * Extract an integer value from the database */ static int scanInt(FILE *fp, int *val) { 27fc: e1a05000 mov r5, r0 int c; unsigned int i = 0; unsigned int limit = INT_MAX; 2800: e3e08102 mvn r8, #-2147483648 ; 0x80000000 */ static int scanInt(FILE *fp, int *val) { int c; unsigned int i = 0; 2804: e1a07004 mov r7, r4 sign = 1; } if (!isdigit(c)) return 0; d = c - '0'; if ((i > (limit / 10)) 2808: e3a0a00a mov sl, #10 unsigned int limit = INT_MAX; int sign = 0; int d; for (;;) { c = getc(fp); 280c: e5953004 ldr r3, [r5, #4] 2810: e2433001 sub r3, r3, #1 2814: e3530000 cmp r3, #0 2818: e5853004 str r3, [r5, #4] 281c: a5953000 ldrge r3, [r5] 2820: a4d36001 ldrbge r6, [r3], #1 2824: a5853000 strge r3, [r5] 2828: aa000003 bge 283c 282c: e59b0000 ldr r0, [fp] <== NOT EXECUTED 2830: e1a01005 mov r1, r5 <== NOT EXECUTED 2834: eb003495 bl fa90 <__srget_r> <== NOT EXECUTED 2838: e1a06000 mov r6, r0 <== NOT EXECUTED if (c == ':') 283c: e356003a cmp r6, #58 ; 0x3a 2840: 0a000019 beq 28ac break; if (sign == 0) { 2844: e3540000 cmp r4, #0 2848: 1a000004 bne 2860 if (c == '-') { 284c: e356002d cmp r6, #45 ; 0x2d sign = -1; limit++; 2850: 02888001 addeq r8, r8, #1 c = getc(fp); if (c == ':') break; if (sign == 0) { if (c == '-') { sign = -1; 2854: 03e04000 mvneq r4, #0 for (;;) { c = getc(fp); if (c == ':') break; if (sign == 0) { if (c == '-') { 2858: 0affffeb beq 280c sign = -1; limit++; continue; } sign = 1; 285c: e3a04001 mov r4, #1 } if (!isdigit(c)) 2860: e5993000 ldr r3, [r9] 2864: e0833006 add r3, r3, r6 2868: e5d30001 ldrb r0, [r3, #1] 286c: e2100004 ands r0, r0, #4 2870: 0a000015 beq 28cc return 0; d = c - '0'; if ((i > (limit / 10)) 2874: e1a00008 mov r0, r8 2878: e3a0100a mov r1, #10 287c: eb003db2 bl 11f4c <__aeabi_uidiv> 2880: e1570000 cmp r7, r0 2884: 8a00000f bhi 28c8 } sign = 1; } if (!isdigit(c)) return 0; d = c - '0'; 2888: e2466030 sub r6, r6, #48 ; 0x30 if ((i > (limit / 10)) || ((i == (limit / 10)) && (d > (limit % 10)))) 288c: 1a000004 bne 28a4 2890: e1a00008 mov r0, r8 2894: e3a0100a mov r1, #10 2898: eb003e43 bl 121ac <__umodsi3> 289c: e1560000 cmp r6, r0 28a0: 8a000008 bhi 28c8 return 0; i = i * 10 + d; 28a4: e027679a mla r7, sl, r7, r6 28a8: eaffffd7 b 280c } if (sign == 0) 28ac: e3540000 cmp r4, #0 return 0; 28b0: 01a00004 moveq r0, r4 *val = i * sign; 28b4: 10040497 mulne r4, r7, r4 28b8: 159d3000 ldrne r3, [sp] return 1; 28bc: 13a00001 movne r0, #1 return 0; i = i * 10 + d; } if (sign == 0) return 0; *val = i * sign; 28c0: 15834000 strne r4, [r3] return 1; 28c4: ea000000 b 28cc if (!isdigit(c)) return 0; d = c - '0'; if ((i > (limit / 10)) || ((i == (limit / 10)) && (d > (limit % 10)))) return 0; 28c8: e3a00000 mov r0, #0 } if (sign == 0) return 0; *val = i * sign; return 1; } 28cc: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00005b84 : struct sigaction *oact ) { ISR_Level level; if ( oact ) 5b84: e2523000 subs r3, r2, #0 *oact = _POSIX_signals_Vectors[ sig ]; 5b88: 159f20b8 ldrne r2, [pc, #184] ; 5c48 int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 5b8c: e92d40f0 push {r4, r5, r6, r7, lr} 5b90: e1a05001 mov r5, r1 ISR_Level level; if ( oact ) *oact = _POSIX_signals_Vectors[ sig ]; 5b94: 13a0100c movne r1, #12 5b98: 10222091 mlane r2, r1, r0, r2 int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 5b9c: e1a04000 mov r4, r0 ISR_Level level; if ( oact ) *oact = _POSIX_signals_Vectors[ sig ]; 5ba0: 18920007 ldmne r2, {r0, r1, r2} 5ba4: 18830007 stmne r3, {r0, r1, r2} if ( !sig ) 5ba8: e3540000 cmp r4, #0 5bac: 0a000004 beq 5bc4 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 5bb0: e2443001 sub r3, r4, #1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 5bb4: e353001f cmp r3, #31 5bb8: 8a000001 bhi 5bc4 * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 5bbc: e3540009 cmp r4, #9 5bc0: 1a000004 bne 5bd8 rtems_set_errno_and_return_minus_one( EINVAL ); 5bc4: eb002154 bl e11c <__errno> 5bc8: e3a03016 mov r3, #22 5bcc: e5803000 str r3, [r0] 5bd0: e3e00000 mvn r0, #0 5bd4: e8bd80f0 pop {r4, r5, r6, r7, pc} /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 5bd8: e3550000 cmp r5, #0 5bdc: 0a000017 beq 5c40 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 5be0: e10f6000 mrs r6, CPSR 5be4: e3863080 orr r3, r6, #128 ; 0x80 5be8: e129f003 msr CPSR_fc, r3 * Unless the user is installing the default signal actions, then * we can just copy the provided sigaction structure into the vectors. */ _ISR_Disable( level ); if ( act->sa_handler == SIG_DFL ) { 5bec: e5953008 ldr r3, [r5, #8] 5bf0: e3530000 cmp r3, #0 5bf4: e59f704c ldr r7, [pc, #76] ; 5c48 5bf8: 1a000007 bne 5c1c _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; 5bfc: e283300c add r3, r3, #12 5c00: e0040493 mul r4, r3, r4 5c04: e59f2040 ldr r2, [pc, #64] ; 5c4c 5c08: e0873004 add r3, r7, r4 5c0c: e0824004 add r4, r2, r4 5c10: e8940007 ldm r4, {r0, r1, r2} 5c14: e8830007 stm r3, {r0, r1, r2} 5c18: ea000005 b 5c34 } else { _POSIX_signals_Clear_process_signals( sig ); 5c1c: e1a00004 mov r0, r4 5c20: eb0015b2 bl b2f0 <_POSIX_signals_Clear_process_signals> _POSIX_signals_Vectors[ sig ] = *act; 5c24: e3a0300c mov r3, #12 5c28: e0247493 mla r4, r3, r4, r7 5c2c: e8950007 ldm r5, {r0, r1, r2} 5c30: e8840007 stm r4, {r0, r1, r2} static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 5c34: e129f006 msr CPSR_fc, r6 * now (signals not posted when SIG_IGN). * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; 5c38: e3a00000 mov r0, #0 5c3c: e8bd80f0 pop {r4, r5, r6, r7, pc} 5c40: e1a00005 mov r0, r5 <== NOT EXECUTED } 5c44: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED =============================================================================== 000081ec : int sigwait( const sigset_t *set, int *sig ) { 81ec: e92d4010 push {r4, lr} 81f0: e1a04001 mov r4, r1 int status; status = sigtimedwait( set, NULL, NULL ); 81f4: e3a01000 mov r1, #0 81f8: e1a02001 mov r2, r1 81fc: ebffff84 bl 8014 if ( status != -1 ) { 8200: e3700001 cmn r0, #1 8204: 0a000004 beq 821c if ( sig ) 8208: e3540000 cmp r4, #0 *sig = status; 820c: 15840000 strne r0, [r4] return 0; 8210: 13a00000 movne r0, #0 int status; status = sigtimedwait( set, NULL, NULL ); if ( status != -1 ) { if ( sig ) 8214: 18bd8010 popne {r4, pc} 8218: ea000002 b 8228 <== NOT EXECUTED *sig = status; return 0; } return errno; 821c: eb002082 bl 1042c <__errno> 8220: e5900000 ldr r0, [r0] 8224: e8bd8010 pop {r4, pc} status = sigtimedwait( set, NULL, NULL ); if ( status != -1 ) { if ( sig ) *sig = status; return 0; 8228: e1a00004 mov r0, r4 <== NOT EXECUTED } return errno; } 822c: e8bd8010 pop {r4, pc} <== NOT EXECUTED =============================================================================== 00003f88 : int i; /* * Obtain output semaphore if character will be echoed */ if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) { 3f88: e591203c ldr r2, [r1, #60] ; 0x3c 3f8c: e59f304c ldr r3, [pc, #76] ; 3fe0 3f90: e0023003 and r3, r2, r3 3f94: e3530000 cmp r3, #0 /* * Process input character, with semaphore. */ static int siproc (unsigned char c, struct rtems_termios_tty *tty) { 3f98: e92d4030 push {r4, r5, lr} 3f9c: e1a04001 mov r4, r1 3fa0: e1a05000 mov r5, r0 int i; /* * Obtain output semaphore if character will be echoed */ if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) { 3fa4: 0a00000b beq 3fd8 rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 3fa8: e5910018 ldr r0, [r1, #24] 3fac: e3a01000 mov r1, #0 3fb0: e1a02001 mov r2, r1 3fb4: eb0004c0 bl 52bc i = iproc (c, tty); 3fb8: e1a01004 mov r1, r4 3fbc: e1a00005 mov r0, r5 3fc0: ebffff8b bl 3df4 3fc4: e1a05000 mov r5, r0 rtems_semaphore_release (tty->osem); 3fc8: e5940018 ldr r0, [r4, #24] 3fcc: eb000500 bl 53d4 } else { i = iproc (c, tty); } return i; } 3fd0: e1a00005 mov r0, r5 3fd4: e8bd8030 pop {r4, r5, pc} 3fd8: e8bd4030 pop {r4, r5, lr} <== NOT EXECUTED rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); i = iproc (c, tty); rtems_semaphore_release (tty->osem); } else { i = iproc (c, tty); 3fdc: eaffff84 b 3df4 <== NOT EXECUTED =============================================================================== 00005c64 : */ int unmount( const char *path ) { 5c64: e92d4070 push {r4, r5, r6, lr} 5c68: e24dd018 sub sp, sp, #24 5c6c: e1a05000 mov r5, r0 * The root node of the mounted filesytem. * The node for the directory that the fileystem is mounted on. * The mount entry that is being refered to. */ if ( rtems_filesystem_evaluate_path( path, strlen( path ), 0x0, &loc, true ) ) 5c70: eb0025c6 bl f390 5c74: e28d4004 add r4, sp, #4 5c78: e3a03001 mov r3, #1 5c7c: e1a01000 mov r1, r0 5c80: e58d3000 str r3, [sp] 5c84: e1a00005 mov r0, r5 5c88: e3a02000 mov r2, #0 5c8c: e1a03004 mov r3, r4 5c90: ebfff475 bl 2e6c 5c94: e3500000 cmp r0, #0 5c98: 1a000040 bne 5da0 return -1; mt_entry = loc.mt_entry; 5c9c: e59d5014 ldr r5, [sp, #20] /* * Verify this is the root node for the file system to be unmounted. */ if ( fs_root_loc->node_access != loc.node_access ){ 5ca0: e59d3004 ldr r3, [sp, #4] 5ca4: e595201c ldr r2, [r5, #28] 5ca8: e1520003 cmp r2, r3 5cac: 0a000004 beq 5cc4 rtems_filesystem_freenode( &loc ); 5cb0: e1a00004 mov r0, r4 5cb4: ebfff49c bl 2f2c rtems_set_errno_and_return_minus_one( EACCES ); 5cb8: eb00203c bl ddb0 <__errno> 5cbc: e3a0300d mov r3, #13 5cc0: ea000011 b 5d0c /* * Free the loc node and just use the nodes from the mt_entry . */ rtems_filesystem_freenode( &loc ); 5cc4: e1a00004 mov r0, r4 5cc8: ebfff497 bl 2f2c * that made the current node thread based instead * of system based? I thought it was but it doesn't * look like it in this version. */ if ( rtems_filesystem_current.mt_entry == mt_entry ) 5ccc: e59f30d8 ldr r3, [pc, #216] ; 5dac 5cd0: e5933000 ldr r3, [r3] 5cd4: e5933014 ldr r3, [r3, #20] 5cd8: e1530005 cmp r3, r5 5cdc: 0a000008 beq 5d04 /* * Verify there are no file systems below the path specified */ if ( rtems_filesystem_mount_iterate( is_fs_below_mount_point, 5ce0: e59f00c8 ldr r0, [pc, #200] ; 5db0 5ce4: e595102c ldr r1, [r5, #44] ; 0x2c 5ce8: ebfff6b1 bl 37b4 5cec: e3500000 cmp r0, #0 5cf0: 1a000003 bne 5d04 * Run the file descriptor table to determine if there are any file * descriptors that are currently active and reference nodes in the * file system that we are trying to unmount */ if ( rtems_libio_is_open_files_in_fs( mt_entry ) == 1 ) 5cf4: e1a00005 mov r0, r5 5cf8: ebfff566 bl 3298 5cfc: e3500001 cmp r0, #1 5d00: 1a000003 bne 5d14 rtems_set_errno_and_return_minus_one( EBUSY ); 5d04: eb002029 bl ddb0 <__errno> 5d08: e3a03010 mov r3, #16 5d0c: e5803000 str r3, [r0] 5d10: ea000022 b 5da0 * Allow the file system being unmounted on to do its cleanup. * If it fails it will set the errno to the approprate value * and the fileystem will not be modified. */ if (( fs_mount_loc->ops->unmount_h )( mt_entry ) != 0 ) 5d14: e5953014 ldr r3, [r5, #20] 5d18: e1a00005 mov r0, r5 5d1c: e1a0e00f mov lr, pc 5d20: e593f028 ldr pc, [r3, #40] ; 0x28 5d24: e2506000 subs r6, r0, #0 5d28: 1a00001c bne 5da0 * NOTE: Fatal error is called in a case which should never happen * This was response was questionable but the best we could * come up with. */ if ((fs_root_loc->ops->fsunmount_me_h )( mt_entry ) != 0){ 5d2c: e5953028 ldr r3, [r5, #40] ; 0x28 5d30: e1a00005 mov r0, r5 5d34: e1a0e00f mov lr, pc 5d38: e593f02c ldr pc, [r3, #44] ; 0x2c 5d3c: e2504000 subs r4, r0, #0 5d40: 0a000007 beq 5d64 if (( fs_mount_loc->ops->mount_h )( mt_entry ) != 0 ) 5d44: e5953014 ldr r3, [r5, #20] <== NOT EXECUTED 5d48: e1a00005 mov r0, r5 <== NOT EXECUTED 5d4c: e1a0e00f mov lr, pc <== NOT EXECUTED 5d50: e593f020 ldr pc, [r3, #32] <== NOT EXECUTED 5d54: e3500000 cmp r0, #0 <== NOT EXECUTED 5d58: 0a000010 beq 5da0 <== NOT EXECUTED rtems_fatal_error_occurred( 0 ); 5d5c: e1a00006 mov r0, r6 <== NOT EXECUTED 5d60: eb0003cb bl 6c94 <== NOT EXECUTED rtems_status_code rtems_libio_set_private_env(void); rtems_status_code rtems_libio_share_private_env(rtems_id task_id) ; static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 5d64: e59f6048 ldr r6, [pc, #72] ; 5db4 5d68: e1a01004 mov r1, r4 5d6c: e1a02004 mov r2, r4 5d70: e5960000 ldr r0, [r6] 5d74: eb000242 bl 6684 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 5d78: e1a00005 mov r0, r5 5d7c: eb00048c bl 6fb4 <_Chain_Extract> } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 5d80: e5960000 ldr r0, [r6] 5d84: eb000284 bl 679c /* * Free the memory node that was allocated in mount * Free the memory associated with the extracted mount table entry. */ rtems_filesystem_freenode( fs_mount_loc ); 5d88: e2850008 add r0, r5, #8 5d8c: ebfff466 bl 2f2c free( mt_entry ); 5d90: e1a00005 mov r0, r5 5d94: ebfff469 bl 2f40 return 0; 5d98: e1a00004 mov r0, r4 5d9c: ea000000 b 5da4 */ if ((fs_root_loc->ops->fsunmount_me_h )( mt_entry ) != 0){ if (( fs_mount_loc->ops->mount_h )( mt_entry ) != 0 ) rtems_fatal_error_occurred( 0 ); return -1; 5da0: e3e00000 mvn r0, #0 rtems_filesystem_freenode( fs_mount_loc ); free( mt_entry ); return 0; } 5da4: e28dd018 add sp, sp, #24 5da8: e8bd8070 pop {r4, r5, r6, pc}