=============================================================================== 00008828 : { IMFS_jnode_t *node = loc->node_access; IMFS_fs_info_t *fs_info; fs_info = loc->mt_entry->fs_info; switch( node->type ) { 8828: e5902000 ldr r2, [r0] 882c: 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; 8830: e5903010 ldr r3, [r0, #16] switch( node->type ) { 8834: 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; 8838: e5933034 ldr r3, [r3, #52] ; 0x34 switch( node->type ) { 883c: e3520006 cmp r2, #6 8840: 979ff102 ldrls pc, [pc, r2, lsl #2] 8844: ea000010 b 888c <== NOT EXECUTED 8848: 00008864 .word 0x00008864 <== NOT EXECUTED 884c: 0000886c .word 0x0000886c <== NOT EXECUTED 8850: 00008874 .word 0x00008874 <== NOT EXECUTED 8854: 00008874 .word 0x00008874 <== NOT EXECUTED 8858: 0000887c .word 0x0000887c <== NOT EXECUTED 885c: 0000887c .word 0x0000887c <== NOT EXECUTED 8860: 00008884 .word 0x00008884 <== NOT EXECUTED case IMFS_DIRECTORY: loc->handlers = fs_info->directory_handlers; 8864: e593300c ldr r3, [r3, #12] 8868: ea000006 b 8888 break; case IMFS_DEVICE: loc->handlers = &IMFS_device_handlers; 886c: e59f3020 ldr r3, [pc, #32] ; 8894 8870: ea000004 b 8888 break; case IMFS_SYM_LINK: case IMFS_HARD_LINK: loc->handlers = &IMFS_link_handlers; 8874: e59f301c ldr r3, [pc, #28] ; 8898 8878: ea000002 b 8888 break; case IMFS_LINEAR_FILE: loc->handlers = fs_info->memfile_handlers; break; case IMFS_MEMORY_FILE: loc->handlers = fs_info->memfile_handlers; 887c: e5933008 ldr r3, [r3, #8] 8880: ea000000 b 8888 break; case IMFS_FIFO: loc->handlers = fs_info->fifo_handlers; 8884: e5933010 ldr r3, [r3, #16] 8888: e5803008 str r3, [r0, #8] break; } return 0; } 888c: e3a00000 mov r0, #0 8890: e12fff1e bx lr =============================================================================== 00008928 : const char *pathname, /* IN */ size_t pathnamelen, /* IN */ int flags, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { 8928: 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 ) ) { 892c: e3d27007 bics r7, r2, #7 const char *pathname, /* IN */ size_t pathnamelen, /* IN */ int flags, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { 8930: e24dd040 sub sp, sp, #64 ; 0x40 8934: e58d0000 str r0, [sp] 8938: e1a06001 mov r6, r1 893c: e1a08002 mov r8, r2 8940: e1a04003 mov r4, r3 /* * This was filled in by the caller and is valid in the * mount table. */ node = pathloc->node_access; 8944: 05935000 ldreq r5, [r3] rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { int i = 0; int len; IMFS_token_types type = IMFS_CURRENT_DIR; 8948: 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 ); 894c: 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 ) ) { 8950: 0a000057 beq 8ab4 rtems_set_errno_and_return_minus_one( EIO ); 8954: eb000cd1 bl bca0 <__errno> <== NOT EXECUTED 8958: e3a03005 mov r3, #5 <== NOT EXECUTED 895c: ea00007e b 8b5c <== 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 ); 8960: e59d2000 ldr r2, [sp] 8964: e28d303c add r3, sp, #60 ; 0x3c 8968: e0820007 add r0, r2, r7 896c: e1a01006 mov r1, r6 8970: e1a0200a mov r2, sl 8974: eb0001ae bl 9034 pathnamelen -= len; i += len; if ( !pathloc->node_access ) 8978: e5943000 ldr r3, [r4] 897c: 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 ); 8980: e1a09000 mov r9, r0 pathnamelen -= len; 8984: e59db03c ldr fp, [sp, #60] ; 0x3c i += len; if ( !pathloc->node_access ) 8988: 0a000041 beq 8a94 rtems_set_errno_and_return_minus_one( ENOENT ); /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) 898c: e3500000 cmp r0, #0 8990: 0a000006 beq 89b0 if ( node->type == IMFS_DIRECTORY ) 8994: e595104c ldr r1, [r5, #76] ; 0x4c 8998: e3510001 cmp r1, #1 899c: 1a000003 bne 89b0 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 89a0: e1a00004 mov r0, r4 89a4: ebffffbc bl 889c 89a8: e3500000 cmp r0, #0 89ac: 0a000068 beq 8b54 rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; switch( type ) { 89b0: 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; 89b4: e06b6006 rsb r6, fp, r6 i += len; 89b8: 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; 89bc: e5945000 ldr r5, [r4] switch( type ) { 89c0: 0a000014 beq 8a18 89c4: e3590004 cmp r9, #4 89c8: 0a000036 beq 8aa8 89cc: e3590002 cmp r9, #2 89d0: 1a000037 bne 8ab4 case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 89d4: e59fc194 ldr ip, [pc, #404] ; 8b70 89d8: e59c3000 ldr r3, [ip] 89dc: e5933018 ldr r3, [r3, #24] 89e0: e1550003 cmp r5, r3 89e4: 0a000032 beq 8ab4 /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access) { 89e8: e594e010 ldr lr, [r4, #16] /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == 89ec: e59e301c ldr r3, [lr, #28] 89f0: 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; 89f4: 028dc028 addeq ip, sp, #40 ; 0x28 89f8: 028ee008 addeq lr, lr, #8 89fc: 0a000037 beq 8ae0 pathnamelen+len, flags,pathloc); } } else { if ( !node->Parent ) 8a00: e5955008 ldr r5, [r5, #8] 8a04: e3550000 cmp r5, #0 8a08: 1a000024 bne 8aa0 rtems_set_errno_and_return_minus_one( ENOENT ); 8a0c: eb000ca3 bl bca0 <__errno> 8a10: e5809000 str r9, [r0] 8a14: ea000051 b 8b60 case IMFS_NAME: /* * If we are at a link follow it. */ if ( node->type == IMFS_HARD_LINK ) { 8a18: e595304c ldr r3, [r5, #76] ; 0x4c 8a1c: e3530003 cmp r3, #3 8a20: 1a000004 bne 8a38 IMFS_evaluate_hard_link( pathloc, 0 ); 8a24: e1a00004 mov r0, r4 8a28: e3a01000 mov r1, #0 8a2c: ebffffaa bl 88dc node = pathloc->node_access; 8a30: e5945000 ldr r5, [r4] 8a34: ea000008 b 8a5c * It would be a design error if we evaluated the link and * was broken. */ IMFS_assert( node ); } else if ( node->type == IMFS_SYM_LINK ) { 8a38: e3530004 cmp r3, #4 8a3c: 1a000006 bne 8a5c result = IMFS_evaluate_sym_link( pathloc, 0 ); 8a40: e1a00004 mov r0, r4 8a44: e3a01000 mov r1, #0 8a48: eb000049 bl 8b74 /* * In contrast to a hard link, it is possible to have a broken * symbolic link. */ node = pathloc->node_access; if ( result == -1 ) 8a4c: e3700001 cmn r0, #1 * was broken. */ IMFS_assert( node ); } else if ( node->type == IMFS_SYM_LINK ) { result = IMFS_evaluate_sym_link( pathloc, 0 ); 8a50: e1a0b000 mov fp, r0 /* * In contrast to a hard link, it is possible to have a broken * symbolic link. */ node = pathloc->node_access; 8a54: e5945000 ldr r5, [r4] if ( result == -1 ) 8a58: 0a000041 beq 8b64 } /* * Only a directory can be decended into. */ if ( node->type != IMFS_DIRECTORY ) 8a5c: e595304c ldr r3, [r5, #76] ; 0x4c 8a60: e3530001 cmp r3, #1 8a64: 0a000002 beq 8a74 rtems_set_errno_and_return_minus_one( ENOTDIR ); 8a68: eb000c8c bl bca0 <__errno> 8a6c: e3a03014 mov r3, #20 8a70: ea000039 b 8b5c /* * 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 ) { 8a74: e595e05c ldr lr, [r5, #92] ; 0x5c 8a78: e35e0000 cmp lr, #0 8a7c: 1a000015 bne 8ad8 } /* * Otherwise find the token name in the present location. */ node = IMFS_find_match_in_dir( node, token ); 8a80: e1a00005 mov r0, r5 8a84: e1a0100a mov r1, sl 8a88: eb000149 bl 8fb4 if ( !node ) 8a8c: e2505000 subs r5, r0, #0 8a90: 1a000002 bne 8aa0 rtems_set_errno_and_return_minus_one( ENOENT ); 8a94: eb000c81 bl bca0 <__errno> 8a98: e3a03002 mov r3, #2 8a9c: ea00002e b 8b5c /* * Set the node access to the point we have found. */ pathloc->node_access = node; 8aa0: e5845000 str r5, [r4] 8aa4: ea000002 b 8ab4 case IMFS_NO_MORE_PATH: case IMFS_CURRENT_DIR: break; case IMFS_INVALID_TOKEN: rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); 8aa8: eb000c7c bl bca0 <__errno> 8aac: e3a0305b mov r3, #91 ; 0x5b 8ab0: ea000029 b 8b5c /* * Evaluate all tokens until we are done or an error occurs. */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { 8ab4: e3590004 cmp r9, #4 8ab8: 13590000 cmpne r9, #0 8abc: 1affffa7 bne 8960 * 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 ) { 8ac0: e595304c ldr r3, [r5, #76] ; 0x4c 8ac4: e3530001 cmp r3, #1 8ac8: 1a000019 bne 8b34 if ( node->info.directory.mt_fs != NULL ) { 8acc: e595e05c ldr lr, [r5, #92] ; 0x5c 8ad0: e35e0000 cmp lr, #0 8ad4: 0a000016 beq 8b34 newloc = node->info.directory.mt_fs->mt_fs_root; 8ad8: e28dc028 add ip, sp, #40 ; 0x28 8adc: e28ee01c add lr, lr, #28 8ae0: e8be000f ldm lr!, {r0, r1, r2, r3} 8ae4: e8ac000f stmia ip!, {r0, r1, r2, r3} 8ae8: e59ee000 ldr lr, [lr] 8aec: e58ce000 str lr, [ip] *pathloc = newloc; 8af0: e28dc028 add ip, sp, #40 ; 0x28 8af4: e8bc000f ldm ip!, {r0, r1, r2, r3} 8af8: e1a0c004 mov ip, r4 8afc: e8ac000f stmia ip!, {r0, r1, r2, r3} return (*pathloc->ops->evalpath_h)( &pathname[i-len], 8b00: e59d103c ldr r1, [sp, #60] ; 0x3c 8b04: 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; 8b08: e58ce000 str lr, [ip] return (*pathloc->ops->evalpath_h)( &pathname[i-len], 8b0c: e0610007 rsb r0, r1, r7 8b10: e0820000 add r0, r2, r0 8b14: e594c00c ldr ip, [r4, #12] 8b18: e0861001 add r1, r6, r1 8b1c: e1a02008 mov r2, r8 8b20: e1a03004 mov r3, r4 8b24: e1a0e00f mov lr, pc 8b28: e59cf000 ldr pc, [ip] 8b2c: e1a0b000 mov fp, r0 8b30: ea00000b b 8b64 flags, pathloc ); } else { result = IMFS_Set_handlers( pathloc ); } } else { result = IMFS_Set_handlers( pathloc ); 8b34: e1a00004 mov r0, r4 8b38: ebffff3a bl 8828 /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( pathloc, flags ) ) 8b3c: e1a01008 mov r1, r8 flags, pathloc ); } else { result = IMFS_Set_handlers( pathloc ); } } else { result = IMFS_Set_handlers( pathloc ); 8b40: e1a0b000 mov fp, r0 /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( pathloc, flags ) ) 8b44: e1a00004 mov r0, r4 8b48: ebffff53 bl 889c 8b4c: e3500000 cmp r0, #0 8b50: 1a000003 bne 8b64 rtems_set_errno_and_return_minus_one( EACCES ); 8b54: eb000c51 bl bca0 <__errno> 8b58: e3a0300d mov r3, #13 8b5c: e5803000 str r3, [r0] 8b60: e3e0b000 mvn fp, #0 return result; } 8b64: e1a0000b mov r0, fp 8b68: e28dd040 add sp, sp, #64 ; 0x40 8b6c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00008cb0 : int IMFS_evaluate_for_make( const char *path, /* IN */ rtems_filesystem_location_info_t *pathloc, /* IN/OUT */ const char **name /* OUT */ ) { 8cb0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 8cb4: e24dd03c sub sp, sp, #60 ; 0x3c 8cb8: e1a07000 mov r7, r0 8cbc: e1a04001 mov r4, r1 8cc0: e1a0a002 mov sl, r2 /* * This was filled in by the caller and is valid in the * mount table. */ node = pathloc->node_access; 8cc4: e5916000 ldr r6, [r1] /* * Get the path length. */ pathlen = strlen( path ); 8cc8: eb000fde bl cc48 const char *path, /* IN */ rtems_filesystem_location_info_t *pathloc, /* IN/OUT */ const char **name /* OUT */ ) { int i = 0; 8ccc: e3a05000 mov r5, #0 node = pathloc->node_access; /* * Get the path length. */ pathlen = strlen( path ); 8cd0: 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 ); 8cd4: e1a01008 mov r1, r8 8cd8: e28d3038 add r3, sp, #56 ; 0x38 8cdc: e0870005 add r0, r7, r5 8ce0: e1a0200d mov r2, sp 8ce4: eb0000d2 bl 9034 pathlen -= len; i += len; if ( !pathloc->node_access ) 8ce8: e5943000 ldr r3, [r4] */ while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); pathlen -= len; 8cec: e59db038 ldr fp, [sp, #56] ; 0x38 i += len; if ( !pathloc->node_access ) 8cf0: 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 ); 8cf4: e1a09000 mov r9, r0 pathlen -= len; 8cf8: e06b8008 rsb r8, fp, r8 i += len; if ( !pathloc->node_access ) 8cfc: 0a000060 beq 8e84 /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) 8d00: e3500000 cmp r0, #0 8d04: 0a000006 beq 8d24 if ( node->type == IMFS_DIRECTORY ) 8d08: e596104c ldr r1, [r6, #76] ; 0x4c 8d0c: e3510001 cmp r1, #1 8d10: 1a000003 bne 8d24 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 8d14: e1a00004 mov r0, r4 8d18: ebfffedf bl 889c 8d1c: e3500000 cmp r0, #0 8d20: 0a00006c beq 8ed8 rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; 8d24: e5943000 ldr r3, [r4] while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); pathlen -= len; i += len; 8d28: 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; 8d2c: e1a06003 mov r6, r3 switch( type ) { 8d30: e3590004 cmp r9, #4 8d34: 979ff109 ldrls pc, [pc, r9, lsl #2] 8d38: eaffffe5 b 8cd4 <== NOT EXECUTED 8d3c: 00008e48 .word 0x00008e48 <== NOT EXECUTED 8d40: 00008cd4 .word 0x00008cd4 <== NOT EXECUTED 8d44: 00008d50 .word 0x00008d50 <== NOT EXECUTED 8d48: 00008d8c .word 0x00008d8c <== NOT EXECUTED 8d4c: 00008e54 .word 0x00008e54 <== 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 ) 8d50: e59f119c ldr r1, [pc, #412] ; 8ef4 8d54: e5912000 ldr r2, [r1] 8d58: e5922018 ldr r2, [r2, #24] 8d5c: e1530002 cmp r3, r2 8d60: 0affffdb beq 8cd4 /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access){ 8d64: e594e010 ldr lr, [r4, #16] 8d68: e59e201c ldr r2, [lr, #28] 8d6c: e1530002 cmp r3, r2 if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; } else { newloc = pathloc->mt_entry->mt_point_node; 8d70: 028dc024 addeq ip, sp, #36 ; 0x24 8d74: 028ee008 addeq lr, lr, #8 8d78: 0a000019 beq 8de4 *pathloc = newloc; return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); } } else { if ( !node->Parent ) 8d7c: e5936008 ldr r6, [r3, #8] 8d80: e3560000 cmp r6, #0 8d84: 1a00002d bne 8e40 8d88: ea00003d b 8e84 pathloc->node_access = node; break; case IMFS_NAME: if ( node->type == IMFS_HARD_LINK ) { 8d8c: e593304c ldr r3, [r3, #76] ; 0x4c 8d90: e3530003 cmp r3, #3 8d94: 0a000001 beq 8da0 result = IMFS_evaluate_link( pathloc, 0 ); if ( result == -1 ) return -1; } else if ( node->type == IMFS_SYM_LINK ) { 8d98: e3530004 cmp r3, #4 8d9c: 1a000005 bne 8db8 result = IMFS_evaluate_link( pathloc, 0 ); 8da0: e1a00004 mov r0, r4 8da4: e3a01000 mov r1, #0 8da8: ebffff93 bl 8bfc if ( result == -1 ) 8dac: e3700001 cmn r0, #1 if ( result == -1 ) return -1; } else if ( node->type == IMFS_SYM_LINK ) { result = IMFS_evaluate_link( pathloc, 0 ); 8db0: e1a06000 mov r6, r0 if ( result == -1 ) 8db4: 0a00004b beq 8ee8 return -1; } node = pathloc->node_access; 8db8: e5940000 ldr r0, [r4] if ( !node ) 8dbc: e3500000 cmp r0, #0 8dc0: 0a00003c beq 8eb8 /* * Only a directory can be decended into. */ if ( node->type != IMFS_DIRECTORY ) 8dc4: e590304c ldr r3, [r0, #76] ; 0x4c 8dc8: e3530001 cmp r3, #1 8dcc: 1a000039 bne 8eb8 /* * 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 ) { 8dd0: e590e05c ldr lr, [r0, #92] ; 0x5c 8dd4: e35e0000 cmp lr, #0 8dd8: 0a000014 beq 8e30 newloc = node->info.directory.mt_fs->mt_fs_root; 8ddc: e28dc024 add ip, sp, #36 ; 0x24 8de0: e28ee01c add lr, lr, #28 8de4: e8be000f ldm lr!, {r0, r1, r2, r3} 8de8: e8ac000f stmia ip!, {r0, r1, r2, r3} 8dec: e59ee000 ldr lr, [lr] 8df0: e58ce000 str lr, [ip] *pathloc = newloc; 8df4: e28dc024 add ip, sp, #36 ; 0x24 8df8: e8bc000f ldm ip!, {r0, r1, r2, r3} 8dfc: e1a0c004 mov ip, r4 8e00: e8ac000f stmia ip!, {r0, r1, r2, r3} return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); 8e04: 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; 8e08: e58ce000 str lr, [ip] return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); 8e0c: e0625005 rsb r5, r2, r5 8e10: e594300c ldr r3, [r4, #12] 8e14: e0870005 add r0, r7, r5 8e18: e1a01004 mov r1, r4 8e1c: e1a0200a mov r2, sl 8e20: e1a0e00f mov lr, pc 8e24: e593f004 ldr pc, [r3, #4] 8e28: e1a06000 mov r6, r0 8e2c: ea00002d b 8ee8 /* * Otherwise find the token name in the present location. */ node = IMFS_find_match_in_dir( node, token ); 8e30: e1a0100d mov r1, sp 8e34: eb00005e bl 8fb4 /* * If there is no node we have found the name of the node we * wish to create. */ if ( ! node ) 8e38: e2506000 subs r6, r0, #0 8e3c: 0a000007 beq 8e60 done = true; else pathloc->node_access = node; 8e40: e5846000 str r6, [r4] 8e44: eaffffa2 b 8cd4 break; case IMFS_NO_MORE_PATH: rtems_set_errno_and_return_minus_one( EEXIST ); 8e48: eb000b94 bl bca0 <__errno> 8e4c: e3a03011 mov r3, #17 8e50: ea000022 b 8ee0 break; case IMFS_INVALID_TOKEN: rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); 8e54: eb000b91 bl bca0 <__errno> 8e58: e3a0305b mov r3, #91 ; 0x5b 8e5c: ea00001f b 8ee0 case IMFS_CURRENT_DIR: break; } } *name = &path[ i - len ]; 8e60: e59d3038 ldr r3, [sp, #56] ; 0x38 8e64: e0633005 rsb r3, r3, r5 8e68: e0873003 add r3, r7, r3 8e6c: 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( 8e70: 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++) { 8e74: ea000005 b 8e90 if ( !IMFS_is_separator( path[ i ] ) ) 8e78: ebffe708 bl 2aa0 8e7c: e3500000 cmp r0, #0 8e80: 1a000002 bne 8e90 rtems_set_errno_and_return_minus_one( ENOENT ); 8e84: eb000b85 bl bca0 <__errno> 8e88: e3a03002 mov r3, #2 8e8c: ea000013 b 8ee0 /* * 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++) { 8e90: e4d50001 ldrb r0, [r5], #1 8e94: e3500000 cmp r0, #0 8e98: 1afffff6 bne 8e78 /* * Verify we can execute and write to this directory. */ result = IMFS_Set_handlers( pathloc ); 8e9c: e1a00004 mov r0, r4 8ea0: ebfffe60 bl 8828 /* * The returned node must be a directory */ node = pathloc->node_access; if ( node->type != IMFS_DIRECTORY ) 8ea4: e5943000 ldr r3, [r4] 8ea8: e593304c ldr r3, [r3, #76] ; 0x4c 8eac: e3530001 cmp r3, #1 /* * Verify we can execute and write to this directory. */ result = IMFS_Set_handlers( pathloc ); 8eb0: e1a06000 mov r6, r0 /* * The returned node must be a directory */ node = pathloc->node_access; if ( node->type != IMFS_DIRECTORY ) 8eb4: 0a000002 beq 8ec4 rtems_set_errno_and_return_minus_one( ENOTDIR ); 8eb8: eb000b78 bl bca0 <__errno> 8ebc: e3a03014 mov r3, #20 8ec0: ea000006 b 8ee0 /* * We must have Write and execute permission on the returned node. */ if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) ) 8ec4: e1a00004 mov r0, r4 8ec8: e3a01003 mov r1, #3 8ecc: ebfffe72 bl 889c 8ed0: e3500000 cmp r0, #0 8ed4: 1a000003 bne 8ee8 rtems_set_errno_and_return_minus_one( EACCES ); 8ed8: eb000b70 bl bca0 <__errno> 8edc: e3a0300d mov r3, #13 8ee0: e5803000 str r3, [r0] 8ee4: e3e06000 mvn r6, #0 return result; } 8ee8: e1a00006 mov r0, r6 8eec: e28dd03c add sp, sp, #60 ; 0x3c 8ef0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 0000889c : uid_t st_uid; gid_t st_gid; IMFS_jnode_t *jnode; int flags_to_test; if ( !rtems_libio_is_valid_perms( flags ) ) 889c: e3d13007 bics r3, r1, #7 */ int IMFS_evaluate_permission( rtems_filesystem_location_info_t *node, int flags ) { 88a0: e52de004 push {lr} ; (str lr, [sp, #-4]!) uid_t st_uid; gid_t st_gid; IMFS_jnode_t *jnode; int flags_to_test; if ( !rtems_libio_is_valid_perms( flags ) ) 88a4: 0a000004 beq 88bc rtems_set_errno_and_return_minus_one( EPERM ); 88a8: eb000cfc bl bca0 <__errno> <== NOT EXECUTED 88ac: e3a03001 mov r3, #1 <== NOT EXECUTED 88b0: e5803000 str r3, [r0] <== NOT EXECUTED 88b4: e3e00000 mvn r0, #0 <== NOT EXECUTED 88b8: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED /* * If all of the flags are set we have permission * to do this. */ if ( ( flags_to_test & jnode->st_mode) == flags_to_test ) 88bc: e5903000 ldr r3, [r0] 88c0: e5930030 ldr r0, [r3, #48] ; 0x30 */ flags_to_test = flags; if ( st_uid == jnode->st_uid ) flags_to_test <<= 6; 88c4: e1a01301 lsl r1, r1, #6 /* * If all of the flags are set we have permission * to do this. */ if ( ( flags_to_test & jnode->st_mode) == flags_to_test ) 88c8: e0010000 and r0, r1, 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 ); 88cc: e1500001 cmp r0, r1 88d0: 13a00000 movne r0, #0 88d4: 03a00001 moveq r0, #1 */ if ( ( flags_to_test & jnode->st_mode) == flags_to_test ) return 1; return 0; } 88d8: e49df004 pop {pc} ; (ldr pc, [sp], #4) =============================================================================== 00008ef8 : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) int IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 8ef8: 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; 8efc: e1a0c000 mov ip, r0 8f00: 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 ) { 8f04: e1a05000 mov r5, r0 8f08: 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; 8f0c: e8bc000f ldm ip!, {r0, r1, r2, r3} 8f10: e1a0e00d mov lr, sp 8f14: e8ae000f stmia lr!, {r0, r1, r2, r3} 8f18: e59c3000 ldr r3, [ip] 8f1c: e58e3000 str r3, [lr] /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root.node_access = NULL; 8f20: e3a03000 mov r3, #0 8f24: e585301c str r3, [r5, #28] do { next = jnode->Parent; loc.node_access = (void *)jnode; IMFS_Set_handlers( &loc ); 8f28: e1a0500d mov r5, sp 8f2c: e1a0000d mov r0, sp */ temp_mt_entry->mt_fs_root.node_access = NULL; do { next = jnode->Parent; 8f30: e5946008 ldr r6, [r4, #8] loc.node_access = (void *)jnode; 8f34: e58d4000 str r4, [sp] IMFS_Set_handlers( &loc ); 8f38: ebfffe3a bl 8828 if ( jnode->type != IMFS_DIRECTORY ) { 8f3c: e594304c ldr r3, [r4, #76] ; 0x4c 8f40: e3530001 cmp r3, #1 8f44: 1a000003 bne 8f58 result = IMFS_unlink( NULL, &loc ); if (result != 0) return -1; jnode = next; } else if ( jnode_has_no_children( jnode ) ) { 8f48: 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 ); 8f4c: e2843054 add r3, r4, #84 ; 0x54 8f50: e1520003 cmp r2, r3 8f54: 1a000005 bne 8f70 result = IMFS_unlink( NULL, &loc ); 8f58: e3a00000 mov r0, #0 8f5c: e1a0100d mov r1, sp 8f60: ebffe223 bl 17f4 if (result != 0) 8f64: e3500000 cmp r0, #0 8f68: 1a00000c bne 8fa0 return -1; jnode = next; 8f6c: e1a04006 mov r4, r6 } if ( jnode != NULL ) { 8f70: e3540000 cmp r4, #0 8f74: 0a00000b beq 8fa8 if ( jnode->type == IMFS_DIRECTORY ) { 8f78: e594304c ldr r3, [r4, #76] ; 0x4c 8f7c: e3530001 cmp r3, #1 8f80: 1affffe9 bne 8f2c } } } while (jnode != NULL); return 0; } 8f84: e5943050 ldr r3, [r4, #80] ; 0x50 8f88: e2842054 add r2, r4, #84 ; 0x54 return -1; jnode = next; } if ( jnode != NULL ) { if ( jnode->type == IMFS_DIRECTORY ) { if ( jnode_has_children( jnode ) ) 8f8c: e1530002 cmp r3, r2 8f90: 0affffe5 beq 8f2c jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); 8f94: e2534000 subs r4, r3, #0 8f98: 1affffe3 bne 8f2c 8f9c: ea000001 b 8fa8 <== NOT EXECUTED return -1; jnode = next; } else if ( jnode_has_no_children( jnode ) ) { result = IMFS_unlink( NULL, &loc ); if (result != 0) return -1; 8fa0: e3e00000 mvn r0, #0 <== NOT EXECUTED 8fa4: ea000000 b 8fac <== NOT EXECUTED jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); return 0; 8fa8: e1a00004 mov r0, r4 } 8fac: e28dd014 add sp, sp, #20 8fb0: e8bd8070 pop {r4, r5, r6, pc} =============================================================================== 0000a848 : my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { a848: e59f31e4 ldr r3, [pc, #484] ; aa34 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { a84c: 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 ) { a850: e5935000 ldr r5, [r3] a854: e1a05125 lsr r5, r5, #2 a858: e2453001 sub r3, r5, #1 a85c: e1510003 cmp r1, r3 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { a860: e1a04000 mov r4, r0 a864: e1a06001 mov r6, r1 a868: e1a08002 mov r8, r2 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { a86c: 8a00000e bhi a8ac p = info->indirect; if ( malloc_it ) { a870: e3520000 cmp r2, #0 /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { p = info->indirect; a874: e5900058 ldr r0, [r0, #88] ; 0x58 if ( malloc_it ) { a878: 0a000007 beq a89c if ( !p ) { a87c: e3500000 cmp r0, #0 a880: 1a000003 bne a894 p = memfile_alloc_block(); a884: ebffffe2 bl a814 if ( !p ) a888: e3500000 cmp r0, #0 a88c: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; info->indirect = p; a890: e5840058 str r0, [r4, #88] ; 0x58 } return &info->indirect[ my_block ]; a894: e5940058 ldr r0, [r4, #88] ; 0x58 a898: ea000001 b a8a4 } if ( !p ) a89c: e3500000 cmp r0, #0 a8a0: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; return &info->indirect[ my_block ]; a8a4: e0800106 add r0, r0, r6, lsl #2 a8a8: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { a8ac: e2853001 add r3, r5, #1 a8b0: e0030395 mul r3, r5, r3 a8b4: e2432001 sub r2, r3, #1 a8b8: e1510002 cmp r1, r2 a8bc: 8a000021 bhi a948 my_block -= FIRST_DOUBLY_INDIRECT; a8c0: e0656001 rsb r6, r5, r1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; a8c4: e1a00006 mov r0, r6 a8c8: e1a01005 mov r1, r5 a8cc: eb00132a bl f57c <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; a8d0: e1a01005 mov r1, r5 */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; a8d4: e1a07000 mov r7, r0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; a8d8: e1a00006 mov r0, r6 a8dc: eb00128e bl f31c <__aeabi_uidiv> p = info->doubly_indirect; if ( malloc_it ) { a8e0: 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; a8e4: e1a05000 mov r5, r0 p = info->doubly_indirect; a8e8: e594005c ldr r0, [r4, #92] ; 0x5c if ( malloc_it ) { a8ec: 0a00000e beq a92c if ( !p ) { a8f0: e3500000 cmp r0, #0 a8f4: 1a000003 bne a908 p = memfile_alloc_block(); a8f8: ebffffc5 bl a814 if ( !p ) a8fc: e3500000 cmp r0, #0 a900: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; info->doubly_indirect = p; a904: e584005c str r0, [r4, #92] ; 0x5c } p1 = (block_p *)p[ doubly ]; a908: e0804105 add r4, r0, r5, lsl #2 a90c: e7900105 ldr r0, [r0, r5, lsl #2] if ( !p1 ) { a910: e3500000 cmp r0, #0 a914: 1a000009 bne a940 p1 = memfile_alloc_block(); a918: ebffffbd bl a814 if ( !p1 ) a91c: e3500000 cmp r0, #0 return 0; p[ doubly ] = (block_p) p1; a920: 15840000 strne r0, [r4] } p1 = (block_p *)p[ doubly ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) a924: 1a000005 bne a940 a928: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED } return (block_p *)&p1[ singly ]; } if ( !p ) a92c: e3500000 cmp r0, #0 a930: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; p = (block_p *)p[ doubly ]; a934: e7900105 ldr r0, [r0, r5, lsl #2] if ( !p ) a938: e3500000 cmp r0, #0 a93c: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; return (block_p *)&p[ singly ]; a940: e0800107 add r0, r0, r7, lsl #2 a944: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { a948: e2832001 add r2, r3, #1 a94c: e0020295 mul r2, r5, r2 a950: e2422001 sub r2, r2, #1 a954: e1510002 cmp r1, r2 a958: 8a000033 bhi aa2c my_block -= FIRST_TRIPLY_INDIRECT; a95c: e0636001 rsb r6, r3, r1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; a960: e1a00006 mov r0, r6 a964: e1a01005 mov r1, r5 a968: eb001303 bl f57c <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; a96c: 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; a970: e1a0a000 mov sl, r0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; a974: e1a00006 mov r0, r6 a978: eb001267 bl f31c <__aeabi_uidiv> triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; a97c: 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; a980: e1a06000 mov r6, r0 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; a984: eb001264 bl f31c <__aeabi_uidiv> doubly %= IMFS_MEMFILE_BLOCK_SLOTS; a988: 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; a98c: e1a07000 mov r7, r0 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; a990: e1a00006 mov r0, r6 a994: eb0012f8 bl f57c <__umodsi3> p = info->triply_indirect; if ( malloc_it ) { a998: 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; a99c: e1a05000 mov r5, r0 p = info->triply_indirect; a9a0: e5940060 ldr r0, [r4, #96] ; 0x60 if ( malloc_it ) { a9a4: 0a000016 beq aa04 if ( !p ) { a9a8: e3500000 cmp r0, #0 a9ac: 1a000003 bne a9c0 p = memfile_alloc_block(); a9b0: ebffff97 bl a814 if ( !p ) a9b4: e3500000 cmp r0, #0 a9b8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; info->triply_indirect = p; a9bc: e5840060 str r0, [r4, #96] ; 0x60 } p1 = (block_p *) p[ triply ]; a9c0: e0804107 add r4, r0, r7, lsl #2 a9c4: e7900107 ldr r0, [r0, r7, lsl #2] if ( !p1 ) { a9c8: e3500000 cmp r0, #0 a9cc: 1a000003 bne a9e0 p1 = memfile_alloc_block(); a9d0: ebffff8f bl a814 if ( !p1 ) a9d4: e3500000 cmp r0, #0 a9d8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; p[ triply ] = (block_p) p1; a9dc: e5840000 str r0, [r4] } p2 = (block_p *)p1[ doubly ]; a9e0: e0804105 add r4, r0, r5, lsl #2 a9e4: e7900105 ldr r0, [r0, r5, lsl #2] if ( !p2 ) { a9e8: e3500000 cmp r0, #0 a9ec: 1a00000c bne aa24 p2 = memfile_alloc_block(); a9f0: ebffff87 bl a814 if ( !p2 ) a9f4: e3500000 cmp r0, #0 return 0; p1[ doubly ] = (block_p) p2; a9f8: 15840000 strne r0, [r4] } p2 = (block_p *)p1[ doubly ]; if ( !p2 ) { p2 = memfile_alloc_block(); if ( !p2 ) a9fc: 1a000008 bne aa24 aa00: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED p1[ doubly ] = (block_p) p2; } return (block_p *)&p2[ singly ]; } if ( !p ) aa04: e3500000 cmp r0, #0 aa08: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; p1 = (block_p *) p[ triply ]; aa0c: e7900107 ldr r0, [r0, r7, lsl #2] if ( !p1 ) aa10: e3500000 cmp r0, #0 aa14: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; p2 = (block_p *)p1[ doubly ]; aa18: e7900105 ldr r0, [r0, r5, lsl #2] if ( !p2 ) aa1c: e3500000 cmp r0, #0 aa20: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; return (block_p *)&p2[ singly ]; aa24: e080010a add r0, r0, sl, lsl #2 aa28: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} } /* * This means the requested block number is out of range. */ return 0; aa2c: e3a00000 mov r0, #0 <== NOT EXECUTED } aa30: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED =============================================================================== 00001694 : rtems_filesystem_mount_table_entry_t *mt_entry ) { IMFS_jnode_t *node; node = mt_entry->mt_point_node.node_access; 1694: e5903008 ldr r3, [r0, #8] /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) 1698: e593204c ldr r2, [r3, #76] ; 0x4c 169c: e3520001 cmp r2, #1 #include int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 16a0: e52de004 push {lr} ; (str lr, [sp, #-4]!) /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) 16a4: 0a000004 beq 16bc rtems_set_errno_and_return_minus_one( ENOTDIR ); 16a8: eb00297c bl bca0 <__errno> <== NOT EXECUTED 16ac: e3a03014 mov r3, #20 <== NOT EXECUTED 16b0: e5803000 str r3, [r0] <== NOT EXECUTED 16b4: e3e00000 mvn r0, #0 <== NOT EXECUTED 16b8: 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; 16bc: e583005c str r0, [r3, #92] ; 0x5c return 0; 16c0: e3a00000 mov r0, #0 } 16c4: e49df004 pop {pc} ; (ldr pc, [sp], #4) =============================================================================== 00004018 : * This routine prints the contents of the specified jnode. */ void IMFS_print_jnode( IMFS_jnode_t *the_jnode ) { 4018: e92d4030 push {r4, r5, lr} IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); 401c: e59f50e0 ldr r5, [pc, #224] ; 4104 4020: e5953000 ldr r3, [r5] * This routine prints the contents of the specified jnode. */ void IMFS_print_jnode( IMFS_jnode_t *the_jnode ) { 4024: e1a04000 mov r4, r0 IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); 4028: e5931008 ldr r1, [r3, #8] 402c: e280000c add r0, r0, #12 4030: eb0030f3 bl 10404 switch( the_jnode->type ) { 4034: e594204c ldr r2, [r4, #76] ; 0x4c 4038: e2423001 sub r3, r2, #1 403c: e3530006 cmp r3, #6 4040: 979ff103 ldrls pc, [pc, r3, lsl #2] 4044: ea000026 b 40e4 4048: 00004064 .word 0x00004064 404c: 00004078 .word 0x00004078 4050: 000040c4 .word 0x000040c4 4054: 000040c4 .word 0x000040c4 4058: 000040ac .word 0x000040ac 405c: 00004090 .word 0x00004090 4060: 000040d0 .word 0x000040d0 case IMFS_DIRECTORY: fprintf(stdout, "/" ); 4064: e5953000 ldr r3, [r5] 4068: e3a0002f mov r0, #47 ; 0x2f 406c: e5931008 ldr r1, [r3, #8] 4070: eb0030ae bl 10330 break; 4074: ea00001f b 40f8 case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 4078: e5953000 ldr r3, [r5] 407c: e59f1084 ldr r1, [pc, #132] ; 4108 4080: e5930008 ldr r0, [r3, #8] 4084: e2842050 add r2, r4, #80 ; 0x50 4088: e892000c ldm r2, {r2, r3} 408c: ea000004 b 40a4 the_jnode->info.device.major, the_jnode->info.device.minor ); break; case IMFS_LINEAR_FILE: fprintf(stdout, " (file %" PRId32 " %p)", 4090: e5953000 ldr r3, [r5] 4094: e59f1070 ldr r1, [pc, #112] ; 410c 4098: e5930008 ldr r0, [r3, #8] 409c: e5942050 ldr r2, [r4, #80] ; 0x50 40a0: e5943058 ldr r3, [r4, #88] ; 0x58 40a4: eb003081 bl 102b0 (uint32_t)the_jnode->info.linearfile.size, the_jnode->info.linearfile.direct ); break; 40a8: ea000012 b 40f8 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 40ac: e5953000 ldr r3, [r5] 40b0: e59f1058 ldr r1, [pc, #88] ; 4110 40b4: e5930008 ldr r0, [r3, #8] 40b8: e5942050 ldr r2, [r4, #80] ; 0x50 40bc: eb00307b bl 102b0 (uint32_t)the_jnode->info.file.size ); #endif break; 40c0: ea00000c b 40f8 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 40c4: e5953000 ldr r3, [r5] 40c8: e59f0044 ldr r0, [pc, #68] ; 4114 <== NOT EXECUTED 40cc: ea000001 b 40d8 <== NOT EXECUTED return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 40d0: e5953000 ldr r3, [r5] <== NOT EXECUTED 40d4: e59f003c ldr r0, [pc, #60] ; 4118 <== NOT EXECUTED 40d8: e5931008 ldr r1, [r3, #8] <== NOT EXECUTED default: fprintf(stdout, " bad type %d\n", the_jnode->type ); return; } puts(""); } 40dc: e8bd4030 pop {r4, r5, lr} <== NOT EXECUTED case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 40e0: ea0030c7 b 10404 <== NOT EXECUTED return; default: fprintf(stdout, " bad type %d\n", the_jnode->type ); 40e4: e5953000 ldr r3, [r5] <== NOT EXECUTED 40e8: e59f102c ldr r1, [pc, #44] ; 411c <== NOT EXECUTED 40ec: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED return; } puts(""); } 40f0: 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 ); 40f4: ea00306d b 102b0 <== NOT EXECUTED return; } puts(""); 40f8: e59f0020 ldr r0, [pc, #32] ; 4120 } 40fc: e8bd4030 pop {r4, r5, lr} default: fprintf(stdout, " bad type %d\n", the_jnode->type ); return; } puts(""); 4100: ea003799 b 11f6c =============================================================================== 000091dc : { IMFS_fs_info_t *fs_info; IMFS_jnode_t *the_jnode; IMFS_device_t *io; the_jnode = loc->node_access; 91dc: e5903000 ldr r3, [r0] switch ( the_jnode->type ) { 91e0: e593204c ldr r2, [r3, #76] ; 0x4c 91e4: e2422002 sub r2, r2, #2 int IMFS_stat( rtems_filesystem_location_info_t *loc, struct stat *buf ) { 91e8: e92d4800 push {fp, lr} IMFS_device_t *io; the_jnode = loc->node_access; switch ( the_jnode->type ) { 91ec: e3520005 cmp r2, #5 91f0: 979ff102 ldrls pc, [pc, r2, lsl #2] 91f4: ea000012 b 9244 <== NOT EXECUTED 91f8: 00009210 .word 0x00009210 <== NOT EXECUTED 91fc: 00009244 .word 0x00009244 <== NOT EXECUTED 9200: 00009230 .word 0x00009230 <== NOT EXECUTED 9204: 00009224 .word 0x00009224 <== NOT EXECUTED 9208: 00009224 .word 0x00009224 <== NOT EXECUTED 920c: 00009230 .word 0x00009230 <== NOT EXECUTED case IMFS_DEVICE: io = &the_jnode->info.device; buf->st_rdev = rtems_filesystem_make_dev_t( io->major, io->minor ); 9210: e5932054 ldr r2, [r3, #84] ; 0x54 rtems_device_minor_number _minor ) { union __rtems_dev_t temp; temp.__overlay.major = _major; 9214: e593c050 ldr ip, [r3, #80] ; 0x50 9218: e581201c str r2, [r1, #28] 921c: e581c018 str ip, [r1, #24] break; 9220: ea00000c b 9258 case IMFS_LINEAR_FILE: case IMFS_MEMORY_FILE: buf->st_size = the_jnode->info.file.size; 9224: e283c050 add ip, r3, #80 ; 0x50 9228: e89c1800 ldm ip, {fp, ip} 922c: ea000001 b 9238 case IMFS_SYM_LINK: buf->st_size = 0; break; case IMFS_FIFO: buf->st_size = 0; 9230: e3a0b000 mov fp, #0 9234: e3a0c000 mov ip, #0 9238: e581b020 str fp, [r1, #32] 923c: e581c024 str ip, [r1, #36] ; 0x24 break; 9240: ea000004 b 9258 default: rtems_set_errno_and_return_minus_one( ENOTSUP ); 9244: eb000a95 bl bca0 <__errno> 9248: e3a03086 mov r3, #134 ; 0x86 924c: e5803000 str r3, [r0] 9250: e3e00000 mvn r0, #0 9254: 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; 9258: e5902010 ldr r2, [r0, #16] buf->st_dev = rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); 925c: e5922034 ldr r2, [r2, #52] ; 0x34 9260: 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 = 9264: e5812004 str r2, [r1, #4] rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); buf->st_mode = the_jnode->st_mode; 9268: e5932030 ldr r2, [r3, #48] ; 0x30 926c: e581200c str r2, [r1, #12] buf->st_nlink = the_jnode->st_nlink; 9270: e1d323b4 ldrh r2, [r3, #52] ; 0x34 9274: e1c121b0 strh r2, [r1, #16] buf->st_ino = the_jnode->st_ino; 9278: e5932038 ldr r2, [r3, #56] ; 0x38 927c: e5812008 str r2, [r1, #8] buf->st_uid = the_jnode->st_uid; 9280: e1d323bc ldrh r2, [r3, #60] ; 0x3c 9284: e1c121b2 strh r2, [r1, #18] buf->st_gid = the_jnode->st_gid; 9288: e1d323be ldrh r2, [r3, #62] ; 0x3e 928c: e1c121b4 strh r2, [r1, #20] buf->st_atime = the_jnode->stat_atime; 9290: e5932040 ldr r2, [r3, #64] ; 0x40 9294: e59f001c ldr r0, [pc, #28] ; 92b8 9298: e5812028 str r2, [r1, #40] ; 0x28 buf->st_mtime = the_jnode->stat_mtime; 929c: e2832044 add r2, r3, #68 ; 0x44 92a0: 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 = 92a4: 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; 92a8: e5812030 str r2, [r1, #48] ; 0x30 buf->st_ctime = the_jnode->stat_ctime; 92ac: e5813038 str r3, [r1, #56] ; 0x38 return 0; 92b0: e3a00000 mov r0, #0 } 92b4: e8bd8800 pop {fp, pc} =============================================================================== 000017f4 : int IMFS_unlink( rtems_filesystem_location_info_t *parentloc, /* IN */ rtems_filesystem_location_info_t *loc /* IN */ ) { 17f4: 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; 17f8: e5915000 ldr r5, [r1] /* * If this is the last last pointer to the node * free the node. */ if ( node->type == IMFS_HARD_LINK ) { 17fc: e595304c ldr r3, [r5, #76] ; 0x4c 1800: e3530003 cmp r3, #3 int IMFS_unlink( rtems_filesystem_location_info_t *parentloc, /* IN */ rtems_filesystem_location_info_t *loc /* IN */ ) { 1804: e24dd01c sub sp, sp, #28 1808: e1a06000 mov r6, r0 180c: e1a04001 mov r4, r1 /* * If this is the last last pointer to the node * free the node. */ if ( node->type == IMFS_HARD_LINK ) { 1810: 1a000024 bne 18a8 if ( !node->info.hard_link.link_node ) 1814: e595e050 ldr lr, [r5, #80] ; 0x50 1818: e35e0000 cmp lr, #0 181c: 1a000003 bne 1830 rtems_set_errno_and_return_minus_one( EINVAL ); 1820: eb00291e bl bca0 <__errno> <== NOT EXECUTED 1824: e3a03016 mov r3, #22 <== NOT EXECUTED 1828: e5803000 str r3, [r0] <== NOT EXECUTED 182c: ea000023 b 18c0 <== NOT EXECUTED the_link = *loc; 1830: e1a07001 mov r7, r1 1834: e8b7000f ldm r7!, {r0, r1, r2, r3} 1838: e1a0c00d mov ip, sp 183c: e8ac000f stmia ip!, {r0, r1, r2, r3} 1840: e5973000 ldr r3, [r7] the_link.node_access = node->info.hard_link.link_node; 1844: e28d701c add r7, sp, #28 1848: e527e01c str lr, [r7, #-28]! IMFS_Set_handlers( &the_link ); 184c: 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; 1850: e58c3000 str r3, [ip] the_link.node_access = node->info.hard_link.link_node; IMFS_Set_handlers( &the_link ); 1854: eb001bf3 bl 8828 /* * 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) 1858: e5953050 ldr r3, [r5, #80] ; 0x50 185c: e1d323b4 ldrh r2, [r3, #52] ; 0x34 1860: e3520001 cmp r2, #1 1864: 1a000007 bne 1888 { result = (*the_link.handlers->rmnod_h)( parentloc, &the_link ); 1868: e1a00006 mov r0, r6 186c: e1a0100d mov r1, sp 1870: e59d3008 ldr r3, [sp, #8] 1874: e1a0e00f mov lr, pc 1878: e593f034 ldr pc, [r3, #52] ; 0x34 if ( result != 0 ) 187c: e3500000 cmp r0, #0 1880: 0a000008 beq 18a8 1884: ea00000d b 18c0 return -1; } else { node->info.hard_link.link_node->st_nlink --; 1888: e2422001 sub r2, r2, #1 188c: e1c323b4 strh r2, [r3, #52] ; 0x34 IMFS_update_ctime( node->info.hard_link.link_node ); 1890: e28d0014 add r0, sp, #20 1894: e3a01000 mov r1, #0 1898: eb00012c bl 1d50 189c: e5953050 ldr r3, [r5, #80] ; 0x50 18a0: e59d2014 ldr r2, [sp, #20] 18a4: e5832048 str r2, [r3, #72] ; 0x48 /* * Now actually free the node we were asked to free. */ result = (*loc->handlers->rmnod_h)( parentloc, loc ); 18a8: e5943008 ldr r3, [r4, #8] 18ac: e1a00006 mov r0, r6 18b0: e1a01004 mov r1, r4 18b4: e1a0e00f mov lr, pc 18b8: e593f034 ldr pc, [r3, #52] ; 0x34 return result; 18bc: ea000000 b 18c4 if ( node->info.hard_link.link_node->st_nlink == 1) { result = (*the_link.handlers->rmnod_h)( parentloc, &the_link ); if ( result != 0 ) return -1; 18c0: e3e00000 mvn r0, #0 */ result = (*loc->handlers->rmnod_h)( parentloc, loc ); return result; } 18c4: e28dd01c add sp, sp, #28 18c8: e8bd80f0 pop {r4, r5, r6, r7, pc} =============================================================================== 000018cc : rtems_filesystem_mount_table_entry_t *mt_entry ) { IMFS_jnode_t *node; node = mt_entry->mt_point_node.node_access; 18cc: e5903008 ldr r3, [r0, #8] /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) 18d0: e593204c ldr r2, [r3, #76] ; 0x4c 18d4: e3520001 cmp r2, #1 #include int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 18d8: e52de004 push {lr} ; (str lr, [sp, #-4]!) /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) 18dc: 0a000002 beq 18ec rtems_set_errno_and_return_minus_one( ENOTDIR ); 18e0: eb0028ee bl bca0 <__errno> <== NOT EXECUTED 18e4: e3a03014 mov r3, #20 <== NOT EXECUTED 18e8: ea000004 b 1900 <== NOT EXECUTED /* * Did the node indicate that there was a directory mounted here? */ if ( node->info.directory.mt_fs == NULL ) 18ec: e593205c ldr r2, [r3, #92] ; 0x5c 18f0: e3520000 cmp r2, #0 18f4: 1a000004 bne 190c rtems_set_errno_and_return_minus_one( EINVAL ); /* XXX */ 18f8: eb0028e8 bl bca0 <__errno> <== NOT EXECUTED 18fc: e3a03016 mov r3, #22 <== NOT EXECUTED 1900: e5803000 str r3, [r0] <== NOT EXECUTED 1904: e3e00000 mvn r0, #0 <== NOT EXECUTED 1908: 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; 190c: e3a00000 mov r0, #0 1910: e583005c str r0, [r3, #92] ; 0x5c return 0; } 1914: e49df004 pop {pc} ; (ldr pc, [sp], #4) =============================================================================== 00001204 : static rtems_printk_plugin_t print_handler; void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 1204: 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); 1208: e59030b8 ldr r3, [r0, #184] ; 0xb8 size = Stack_check_usable_stack_size(stack); 120c: e59070b4 ldr r7, [r0, #180] ; 0xb4 { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 1210: e2832010 add r2, r3, #16 size = Stack_check_usable_stack_size(stack); 1214: 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++) 1218: e3c71003 bic r1, r7, #3 static rtems_printk_plugin_t print_handler; void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 121c: e1a05000 mov r5, r0 current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); 1220: e590b0e4 ldr fp, [r0, #228] ; 0xe4 /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; 1224: e2820010 add r0, r2, #16 for (ebase = base + length; base < ebase; base++) 1228: 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( 122c: e2833020 add r3, r3, #32 * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) if (*base != U32_PATTERN) 1230: e59f10c0 ldr r1, [pc, #192] ; 12f8 1234: ea000002 b 1244 1238: e493c004 ldr ip, [r3], #4 123c: e15c0001 cmp ip, r1 1240: 1a000004 bne 1258 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 1244: e1530000 cmp r3, r0 if (*base != U32_PATTERN) 1248: 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++) 124c: 3afffff9 bcc 1238 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; 1250: e3a06000 mov r6, #0 <== NOT EXECUTED 1254: ea000002 b 1264 <== 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 ) 1258: e3560000 cmp r6, #0 used = Stack_check_Calculate_used( low, size, high_water_mark ); 125c: 10822007 addne r2, r2, r7 1260: 10666002 rsbne r6, r6, r2 #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) #endif { (*print_handler)( 1264: e5958008 ldr r8, [r5, #8] 1268: e59f408c ldr r4, [pc, #140] ; 12fc 126c: e3a01005 mov r1, #5 1270: e28d2008 add r2, sp, #8 1274: e1a00008 mov r0, r8 1278: e8940600 ldm r4, {r9, sl} 127c: eb000eca bl 4dac 1280: e59f1078 ldr r1, [pc, #120] ; 1300 1284: e1a03000 mov r3, r0 1288: e1a02008 mov r2, r8 128c: e1a0000a mov r0, sl 1290: e1a0e00f mov lr, pc 1294: e12fff19 bx r9 (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 1298: e59530b4 ldr r3, [r5, #180] ; 0xb4 129c: e59520b8 ldr r2, [r5, #184] ; 0xb8 12a0: e2433001 sub r3, r3, #1 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 12a4: e0823003 add r3, r2, r3 12a8: e58db000 str fp, [sp] 12ac: e58d7004 str r7, [sp, #4] 12b0: e5940004 ldr r0, [r4, #4] 12b4: e59f1048 ldr r1, [pc, #72] ; 1304 12b8: e1a0e00f mov lr, pc 12bc: e594f000 ldr pc, [r4] stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 12c0: e5943008 ldr r3, [r4, #8] 12c4: e3530000 cmp r3, #0 12c8: 1a000004 bne 12e0 (*print_handler)( print_context, "Unavailable\n" ); 12cc: e5940004 ldr r0, [r4, #4] <== NOT EXECUTED 12d0: e59f1030 ldr r1, [pc, #48] ; 1308 <== NOT EXECUTED 12d4: e1a0e00f mov lr, pc <== NOT EXECUTED 12d8: e594f000 ldr pc, [r4] <== NOT EXECUTED 12dc: ea000004 b 12f4 <== NOT EXECUTED } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 12e0: e5940004 ldr r0, [r4, #4] 12e4: e59f1020 ldr r1, [pc, #32] ; 130c 12e8: e1a02006 mov r2, r6 12ec: e1a0e00f mov lr, pc 12f0: e594f000 ldr pc, [r4] } } 12f4: e8bd8fff pop {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00014b0c <_CORE_message_queue_Broadcast>: { Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 14b0c: 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 ) { 14b10: 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 ) { 14b14: 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 ) { 14b18: e1a06000 mov r6, r0 14b1c: e1a0a001 mov sl, r1 14b20: e1a07002 mov r7, r2 14b24: 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 ) { 14b28: 8a000013 bhi 14b7c <_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 ) { 14b2c: e5905048 ldr r5, [r0, #72] ; 0x48 14b30: e3550000 cmp r5, #0 *count = 0; 14b34: 13a00000 movne r0, #0 14b38: 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 ) { 14b3c: 0a000007 beq 14b60 <_CORE_message_queue_Broadcast+0x54> 14b40: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 14b44: e594002c ldr r0, [r4, #44] ; 0x2c 14b48: e1a0100a mov r1, sl 14b4c: e1a02007 mov r2, r7 14b50: eb001e40 bl 1c458 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 14b54: e5943028 ldr r3, [r4, #40] ; 0x28 14b58: 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; 14b5c: 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 = 14b60: e1a00006 mov r0, r6 14b64: eb000a41 bl 17470 <_Thread_queue_Dequeue> 14b68: e2504000 subs r4, r0, #0 14b6c: 1afffff4 bne 14b44 <_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; 14b70: e5885000 str r5, [r8] return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 14b74: e1a00004 mov r0, r4 14b78: 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; 14b7c: e3a00001 mov r0, #1 <== NOT EXECUTED #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 14b80: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED =============================================================================== 00009e78 <_CORE_mutex_Seize_interrupt_trylock>: #if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__) int _CORE_mutex_Seize_interrupt_trylock( CORE_mutex_Control *the_mutex, ISR_Level *level_p ) { 9e78: e1a03000 mov r3, r0 { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 9e7c: e59f2124 ldr r2, [pc, #292] ; 9fa8 <_CORE_mutex_Seize_interrupt_trylock+0x130> executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 9e80: e593c050 ldr ip, [r3, #80] ; 0x50 Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; 9e84: e3a00000 mov r0, #0 { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 9e88: e5922004 ldr r2, [r2, #4] executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 9e8c: e15c0000 cmp ip, r0 9e90: e92d4010 push {r4, lr} Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; 9e94: e5820034 str r0, [r2, #52] ; 0x34 if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 9e98: 0a00002c beq 9f50 <_CORE_mutex_Seize_interrupt_trylock+0xd8> the_mutex->lock = CORE_MUTEX_LOCKED; 9e9c: e5830050 str r0, [r3, #80] ; 0x50 the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; 9ea0: e5920008 ldr r0, [r2, #8] 9ea4: e5830060 str r0, [r3, #96] ; 0x60 the_mutex->nest_count = 1; 9ea8: e3a00001 mov r0, #1 9eac: e5830054 str r0, [r3, #84] ; 0x54 return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); } 9eb0: e5930048 ldr r0, [r3, #72] ; 0x48 if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 9eb4: e3500002 cmp r0, #2 executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; 9eb8: e583205c str r2, [r3, #92] ; 0x5c the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 9ebc: 0a000001 beq 9ec8 <_CORE_mutex_Seize_interrupt_trylock+0x50> 9ec0: e3500003 cmp r0, #3 9ec4: 1a000004 bne 9edc <_CORE_mutex_Seize_interrupt_trylock+0x64> _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 9ec8: e592c01c ldr ip, [r2, #28] } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { 9ecc: e3500003 cmp r0, #3 _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 9ed0: e28c4001 add r4, ip, #1 9ed4: e582401c str r4, [r2, #28] } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { 9ed8: 0a000000 beq 9ee0 <_CORE_mutex_Seize_interrupt_trylock+0x68> _ISR_Enable( *level_p ); 9edc: ea00002b b 9f90 <_CORE_mutex_Seize_interrupt_trylock+0x118> */ { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; 9ee0: e593004c ldr r0, [r3, #76] ; 0x4c current = executing->current_priority; 9ee4: e5924014 ldr r4, [r2, #20] if ( current == ceiling ) { 9ee8: e1540000 cmp r4, r0 9eec: 1a000000 bne 9ef4 <_CORE_mutex_Seize_interrupt_trylock+0x7c> _ISR_Enable( *level_p ); 9ef0: ea000026 b 9f90 <_CORE_mutex_Seize_interrupt_trylock+0x118> return 0; } if ( current > ceiling ) { 9ef4: 9a00000b bls 9f28 <_CORE_mutex_Seize_interrupt_trylock+0xb0> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 9ef8: e59f20ac ldr r2, [pc, #172] ; 9fac <_CORE_mutex_Seize_interrupt_trylock+0x134> 9efc: e5920000 ldr r0, [r2] 9f00: e2800001 add r0, r0, #1 9f04: e5820000 str r0, [r2] 9f08: e5912000 ldr r2, [r1] 9f0c: e129f002 msr CPSR_fc, r2 _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); _Thread_Change_priority( 9f10: e3a02000 mov r2, #0 9f14: e593005c ldr r0, [r3, #92] ; 0x5c 9f18: e593104c ldr r1, [r3, #76] ; 0x4c 9f1c: ebfff333 bl 6bf0 <_Thread_Change_priority> the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch(); 9f20: ebfff457 bl 7084 <_Thread_Enable_dispatch> 9f24: ea00001b b 9f98 <_CORE_mutex_Seize_interrupt_trylock+0x120> return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 9f28: e3a00006 mov r0, #6 9f2c: e5820034 str r0, [r2, #52] ; 0x34 the_mutex->lock = CORE_MUTEX_UNLOCKED; 9f30: e3a00001 mov r0, #1 9f34: e5830050 str r0, [r3, #80] ; 0x50 the_mutex->nest_count = 0; /* undo locking above */ 9f38: e3a00000 mov r0, #0 9f3c: e5830054 str r0, [r3, #84] ; 0x54 executing->resource_count--; /* undo locking above */ 9f40: e582c01c str ip, [r2, #28] 9f44: e5913000 ldr r3, [r1] 9f48: e129f003 msr CPSR_fc, r3 9f4c: e8bd8010 pop {r4, pc} /* * At this point, we know the mutex was not available. If this thread * is the thread that has locked the mutex, let's see if we are allowed * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { 9f50: e593005c ldr r0, [r3, #92] ; 0x5c 9f54: e1500002 cmp r0, r2 /* * The mutex is not available and the caller must deal with the possibility * of blocking. */ return 1; 9f58: 13a00001 movne r0, #1 /* * At this point, we know the mutex was not available. If this thread * is the thread that has locked the mutex, let's see if we are allowed * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { 9f5c: 18bd8010 popne {r4, pc} switch ( the_mutex->Attributes.lock_nesting_behavior ) { 9f60: e5932040 ldr r2, [r3, #64] ; 0x40 9f64: e3520000 cmp r2, #0 9f68: 0a000002 beq 9f78 <_CORE_mutex_Seize_interrupt_trylock+0x100> 9f6c: e3520001 cmp r2, #1 9f70: 1a00000a bne 9fa0 <_CORE_mutex_Seize_interrupt_trylock+0x128> 9f74: ea000003 b 9f88 <_CORE_mutex_Seize_interrupt_trylock+0x110><== NOT EXECUTED case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; 9f78: e5932054 ldr r2, [r3, #84] ; 0x54 9f7c: e2822001 add r2, r2, #1 9f80: e5832054 str r2, [r3, #84] ; 0x54 _ISR_Enable( *level_p ); 9f84: ea000001 b 9f90 <_CORE_mutex_Seize_interrupt_trylock+0x118> return 0; case CORE_MUTEX_NESTING_IS_ERROR: executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; 9f88: e3a03002 mov r3, #2 <== NOT EXECUTED 9f8c: e5803034 str r3, [r0, #52] ; 0x34 <== NOT EXECUTED 9f90: e5913000 ldr r3, [r1] 9f94: e129f003 msr CPSR_fc, r3 _ISR_Enable( *level_p ); return 0; 9f98: e3a00000 mov r0, #0 9f9c: e8bd8010 pop {r4, pc} /* * The mutex is not available and the caller must deal with the possibility * of blocking. */ return 1; 9fa0: e3a00001 mov r0, #1 9fa4: e8bd8010 pop {r4, pc} =============================================================================== 0000a530 <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { a530: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} a534: e1a05001 mov r5, r1 Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; a538: e5901020 ldr r1, [r0, #32] Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { a53c: e24dd028 sub sp, sp, #40 ; 0x28 a540: e58d3018 str r3, [sp, #24] Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; a544: e58d1010 str r1, [sp, #16] Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; a548: e5903010 ldr r3, [r0, #16] uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; uintptr_t const free_size = stats->free_size; a54c: e5901030 ldr r1, [r0, #48] ; 0x30 Heap_Block *start_block = first_block; Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; a550: e3a08000 mov r8, #0 uintptr_t const free_size = stats->free_size; uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { a554: e0956002 adds r6, r5, r2 Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { a558: e1a04000 mov r4, r0 Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; a55c: e58d3014 str r3, [sp, #20] Heap_Block *start_block = first_block; Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; a560: e58d8024 str r8, [sp, #36] ; 0x24 Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; a564: e5903014 ldr r3, [r0, #20] Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; a568: e58d8020 str r8, [sp, #32] uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; uintptr_t const free_size = stats->free_size; a56c: e58d101c str r1, [sp, #28] uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { return false; a570: 21a00008 movcs r0, r8 uintptr_t const free_size = stats->free_size; uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { a574: 2a00009d bcs a7f0 <_Heap_Extend+0x2c0> return false; } extend_area_ok = _Heap_Get_first_and_last_block( a578: e28d1024 add r1, sp, #36 ; 0x24 a57c: e58d1000 str r1, [sp] a580: e28d1020 add r1, sp, #32 a584: e58d1004 str r1, [sp, #4] a588: e1a00005 mov r0, r5 a58c: e1a01002 mov r1, r2 a590: e59d2014 ldr r2, [sp, #20] a594: ebffeeda bl 6104 <_Heap_Get_first_and_last_block> page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { a598: e3500000 cmp r0, #0 a59c: 0a000093 beq a7f0 <_Heap_Extend+0x2c0> a5a0: e59da010 ldr sl, [sp, #16] a5a4: e1a07008 mov r7, r8 a5a8: e1a09008 mov r9, r8 return false; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; a5ac: e5941018 ldr r1, [r4, #24] a5b0: e1a03008 mov r3, r8 a5b4: e1a0c004 mov ip, r4 a5b8: ea000000 b a5c0 <_Heap_Extend+0x90> a5bc: e1a0100a mov r1, sl uintptr_t const sub_area_end = start_block->prev_size; a5c0: e59a4000 ldr r4, [sl] Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( a5c4: e1560001 cmp r6, r1 a5c8: 93a00000 movls r0, #0 a5cc: 83a00001 movhi r0, #1 a5d0: e1550004 cmp r5, r4 a5d4: 23a00000 movcs r0, #0 a5d8: e3500000 cmp r0, #0 a5dc: 1a000082 bne a7ec <_Heap_Extend+0x2bc> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { a5e0: e1560001 cmp r6, r1 a5e4: 01a0300a moveq r3, sl a5e8: 0a000001 beq a5f4 <_Heap_Extend+0xc4> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { a5ec: e1560004 cmp r6, r4 a5f0: 31a0900a movcc r9, sl RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); a5f4: e1a00004 mov r0, r4 a5f8: e59d1014 ldr r1, [sp, #20] a5fc: e58d300c str r3, [sp, #12] a600: e58dc008 str ip, [sp, #8] a604: eb001531 bl fad0 <__umodsi3> a608: e244b008 sub fp, r4, #8 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { a60c: e1540005 cmp r4, r5 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); a610: e060000b rsb r0, r0, fp a614: e59d300c ldr r3, [sp, #12] a618: e59dc008 ldr ip, [sp, #8] RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) a61c: 01a07000 moveq r7, r0 start_block->prev_size = extend_area_end; a620: 058a6000 streq r6, [sl] merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { a624: 0a000000 beq a62c <_Heap_Extend+0xfc> a628: 31a08000 movcc r8, r0 - 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; a62c: e590a004 ldr sl, [r0, #4] } else if ( sub_area_end < extend_area_begin ) { link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); a630: e59d2010 ldr r2, [sp, #16] a634: e3caa001 bic sl, sl, #1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); a638: e080a00a add sl, r0, sl a63c: e15a0002 cmp sl, r2 a640: 1affffdd bne a5bc <_Heap_Extend+0x8c> a644: e1a02009 mov r2, r9 a648: e1a09003 mov r9, r3 if ( extend_area_begin < heap->area_begin ) { a64c: e59c3018 ldr r3, [ip, #24] a650: e1550003 cmp r5, r3 a654: e1a0400c mov r4, ip heap->area_begin = extend_area_begin; a658: 358c5018 strcc r5, [ip, #24] } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); if ( extend_area_begin < heap->area_begin ) { a65c: 3a000002 bcc a66c <_Heap_Extend+0x13c> heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { a660: e59c301c ldr r3, [ip, #28] a664: e1530006 cmp r3, r6 heap->area_end = extend_area_end; a668: 358c601c strcc r6, [ip, #28] } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; a66c: e59d1024 ldr r1, [sp, #36] ; 0x24 a670: e59d3020 ldr r3, [sp, #32] heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = a674: e0610003 rsb r0, r1, r3 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; a678: e5816000 str r6, [r1] extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; a67c: e380c001 orr ip, r0, #1 _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; a680: e5830000 str r0, [r3] extend_last_block->size_and_flag = 0; a684: e3a00000 mov r0, #0 extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = a688: e581c004 str ip, [r1, #4] extend_first_block_size | HEAP_PREV_BLOCK_USED; _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; a68c: e5830004 str r0, [r3, #4] _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { a690: e5940020 ldr r0, [r4, #32] a694: e1500001 cmp r0, r1 heap->first_block = extend_first_block; a698: 85841020 strhi r1, [r4, #32] extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { a69c: 8a000002 bhi a6ac <_Heap_Extend+0x17c> heap->first_block = extend_first_block; } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { a6a0: e5941024 ldr r1, [r4, #36] ; 0x24 a6a4: e1510003 cmp r1, r3 heap->last_block = extend_last_block; a6a8: 35843024 strcc r3, [r4, #36] ; 0x24 } if ( merge_below_block != NULL ) { a6ac: e3590000 cmp r9, #0 a6b0: 0a000010 beq a6f8 <_Heap_Extend+0x1c8> Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; a6b4: e594a010 ldr sl, [r4, #16] <== NOT EXECUTED uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); a6b8: e2855008 add r5, r5, #8 <== NOT EXECUTED RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; a6bc: e1a00005 mov r0, r5 <== NOT EXECUTED a6c0: e1a0100a mov r1, sl <== NOT EXECUTED a6c4: eb001501 bl fad0 <__umodsi3> <== NOT EXECUTED if ( remainder != 0 ) { a6c8: e3500000 cmp r0, #0 <== NOT EXECUTED return value - remainder + alignment; a6cc: 1085500a addne r5, r5, sl <== NOT EXECUTED a6d0: 10605005 rsbne r5, r0, r5 <== NOT EXECUTED uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; a6d4: e5993000 ldr r3, [r9] <== NOT EXECUTED ) { uintptr_t const page_size = heap->page_size; uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = a6d8: e2451008 sub r1, r5, #8 <== NOT EXECUTED uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; a6dc: e5053008 str r3, [r5, #-8] <== NOT EXECUTED uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE; uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = a6e0: e0613009 rsb r3, r1, r9 <== NOT EXECUTED first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; a6e4: e3833001 orr r3, r3, #1 <== NOT EXECUTED a6e8: e5053004 str r3, [r5, #-4] <== NOT EXECUTED _Heap_Free_block( heap, new_first_block ); a6ec: e1a00004 mov r0, r4 <== NOT EXECUTED a6f0: ebffff86 bl a510 <_Heap_Free_block> <== NOT EXECUTED a6f4: ea000004 b a70c <_Heap_Extend+0x1dc> <== NOT EXECUTED heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { _Heap_Merge_below( heap, extend_area_begin, merge_below_block ); } else if ( link_below_block != NULL ) { a6f8: e3520000 cmp r2, #0 _Heap_Link_below( a6fc: 159d3020 ldrne r3, [sp, #32] { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = (link_begin - last_block_begin) | HEAP_PREV_BLOCK_USED; a700: 10632002 rsbne r2, r3, r2 a704: 13822001 orrne r2, r2, #1 ) { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = a708: 15832004 strne r2, [r3, #4] link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { a70c: e3570000 cmp r7, #0 a710: 0a000012 beq a760 <_Heap_Extend+0x230> ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( extend_area_end - last_block_begin - HEAP_BLOCK_HEADER_SIZE, a714: e2466008 sub r6, r6, #8 uintptr_t extend_area_end ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( a718: e0676006 rsb r6, r7, r6 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); a71c: e5941010 ldr r1, [r4, #16] a720: e1a00006 mov r0, r6 a724: eb0014e9 bl fad0 <__umodsi3> ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) a728: e5972004 ldr r2, [r7, #4] a72c: e0606006 rsb r6, r0, r6 a730: e0662002 rsb r2, r6, r2 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = a734: e0863007 add r3, r6, r7 (last_block->size_and_flag - last_block_new_size) | HEAP_PREV_BLOCK_USED; a738: e3822001 orr r2, r2, #1 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = a73c: e5832004 str r2, [r3, #4] RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; a740: e5973004 ldr r3, [r7, #4] a744: e2033001 and r3, r3, #1 block->size_and_flag = size | flag; a748: e1866003 orr r6, r6, r3 a74c: e5876004 str r6, [r7, #4] (last_block->size_and_flag - last_block_new_size) | HEAP_PREV_BLOCK_USED; _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); a750: e1a00004 mov r0, r4 a754: e1a01007 mov r1, r7 a758: ebffff6c bl a510 <_Heap_Free_block> a75c: ea00000b b a790 <_Heap_Extend+0x260> ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { a760: e3580000 cmp r8, #0 a764: 0a000009 beq a790 <_Heap_Extend+0x260> RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; a768: e5982004 ldr r2, [r8, #4] ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); a76c: e59d1024 ldr r1, [sp, #36] ; 0x24 a770: e2022001 and r2, r2, #1 a774: e0681001 rsb r1, r8, r1 block->size_and_flag = size | flag; a778: e1812002 orr r2, r1, r2 } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { _Heap_Link_above( a77c: e59d3020 ldr r3, [sp, #32] a780: e5882004 str r2, [r8, #4] uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; a784: e5932004 ldr r2, [r3, #4] a788: e3822001 orr r2, r2, #1 a78c: e5832004 str r2, [r3, #4] extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { a790: e3570000 cmp r7, #0 a794: 03590000 cmpeq r9, #0 _Heap_Free_block( heap, extend_first_block ); a798: 01a00004 moveq r0, r4 a79c: 059d1024 ldreq r1, [sp, #36] ; 0x24 a7a0: 0bffff5a bleq a510 <_Heap_Free_block> */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( heap->last_block, (uintptr_t) heap->first_block - (uintptr_t) heap->last_block a7a4: e2841020 add r1, r4, #32 a7a8: e891000a ldm r1, {r1, r3} RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; a7ac: e5932004 ldr r2, [r3, #4] * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( a7b0: e0631001 rsb r1, r3, r1 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; a7b4: e2022001 and r2, r2, #1 block->size_and_flag = size | flag; a7b8: e1812002 orr r2, r1, r2 a7bc: e5832004 str r2, [r3, #4] } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; a7c0: e59d101c ldr r1, [sp, #28] a7c4: e284202c add r2, r4, #44 ; 0x2c a7c8: e892000c ldm r2, {r2, r3} a7cc: e0613003 rsb r3, r1, r3 /* Statistics */ stats->size += extended_size; a7d0: e0822003 add r2, r2, r3 a7d4: e584202c str r2, [r4, #44] ; 0x2c if ( extended_size_ptr != NULL ) a7d8: e59d2018 ldr r2, [sp, #24] a7dc: e3520000 cmp r2, #0 *extended_size_ptr = extended_size; a7e0: 15823000 strne r3, [r2] return true; a7e4: e3a00001 mov r0, #1 a7e8: ea000000 b a7f0 <_Heap_Extend+0x2c0> _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; a7ec: e3a00000 mov r0, #0 if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; } a7f0: e28dd028 add sp, sp, #40 ; 0x28 a7f4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00006c64 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 6c64: 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; 6c68: e5903014 ldr r3, [r0, #20] bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 6c6c: e24dd030 sub sp, sp, #48 ; 0x30 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 6c70: e58d3024 str r3, [sp, #36] ; 0x24 Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; 6c74: e5903024 ldr r3, [r0, #36] ; 0x24 Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 6c78: e59f4500 ldr r4, [pc, #1280] ; 7180 <_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; 6c7c: e58d3028 str r3, [sp, #40] ; 0x28 Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 6c80: e59f34fc ldr r3, [pc, #1276] ; 7184 <_Heap_Walk+0x520> 6c84: e31200ff tst r2, #255 ; 0xff 6c88: 11a04003 movne r4, r3 if ( !_System_state_Is_up( _System_state_Get() ) ) { 6c8c: e59f34f4 ldr r3, [pc, #1268] ; 7188 <_Heap_Walk+0x524> 6c90: 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; 6c94: 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() ) ) { 6c98: e3530003 cmp r3, #3 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 6c9c: e1a06000 mov r6, r0 6ca0: e1a05001 mov r5, r1 uintptr_t const page_size = heap->page_size; 6ca4: e5909010 ldr r9, [r0, #16] uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; 6ca8: 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() ) ) { 6cac: 1a000127 bne 7150 <_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)( 6cb0: e59dc024 ldr ip, [sp, #36] ; 0x24 6cb4: e58dc000 str ip, [sp] 6cb8: e5903018 ldr r3, [r0, #24] 6cbc: e58d3004 str r3, [sp, #4] 6cc0: e590301c ldr r3, [r0, #28] 6cc4: e59d2020 ldr r2, [sp, #32] 6cc8: e58d3008 str r3, [sp, #8] 6ccc: e59d3028 ldr r3, [sp, #40] ; 0x28 6cd0: e58d200c str r2, [sp, #12] 6cd4: e58d3010 str r3, [sp, #16] 6cd8: e5903008 ldr r3, [r0, #8] 6cdc: e58d3014 str r3, [sp, #20] 6ce0: e590300c ldr r3, [r0, #12] 6ce4: e59f24a0 ldr r2, [pc, #1184] ; 718c <_Heap_Walk+0x528> 6ce8: e58d3018 str r3, [sp, #24] 6cec: e1a00001 mov r0, r1 6cf0: e1a03009 mov r3, r9 6cf4: e3a01000 mov r1, #0 6cf8: e1a0e00f mov lr, pc 6cfc: e12fff14 bx r4 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 6d00: e3590000 cmp r9, #0 6d04: 1a000006 bne 6d24 <_Heap_Walk+0xc0> (*printer)( source, true, "page size is zero\n" ); 6d08: e1a00005 mov r0, r5 6d0c: e3a01001 mov r1, #1 6d10: e59f2478 ldr r2, [pc, #1144] ; 7190 <_Heap_Walk+0x52c> 6d14: e1a0e00f mov lr, pc 6d18: e12fff14 bx r4 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 6d1c: e1a08009 mov r8, r9 6d20: ea00010b b 7154 <_Heap_Walk+0x4f0> (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 6d24: e2198007 ands r8, r9, #7 (*printer)( 6d28: 11a00005 movne r0, r5 6d2c: 13a01001 movne r1, #1 6d30: 159f245c ldrne r2, [pc, #1116] ; 7194 <_Heap_Walk+0x530> 6d34: 11a03009 movne r3, r9 6d38: 1a00010c bne 7170 <_Heap_Walk+0x50c> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 6d3c: e59d0024 ldr r0, [sp, #36] ; 0x24 6d40: e1a01009 mov r1, r9 6d44: ebffe796 bl ba4 <__umodsi3> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 6d48: e250b000 subs fp, r0, #0 6d4c: 0a000006 beq 6d6c <_Heap_Walk+0x108> (*printer)( 6d50: e1a00005 mov r0, r5 6d54: e3a01001 mov r1, #1 6d58: e59f2438 ldr r2, [pc, #1080] ; 7198 <_Heap_Walk+0x534> 6d5c: e59d3024 ldr r3, [sp, #36] ; 0x24 6d60: e1a0e00f mov lr, pc 6d64: e12fff14 bx r4 6d68: ea0000f9 b 7154 <_Heap_Walk+0x4f0> 6d6c: e59dc020 ldr ip, [sp, #32] 6d70: e1a01009 mov r1, r9 6d74: e28c0008 add r0, ip, #8 6d78: ebffe789 bl ba4 <__umodsi3> ); return false; } if ( 6d7c: e250a000 subs sl, r0, #0 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 6d80: 11a00005 movne r0, r5 6d84: 13a01001 movne r1, #1 6d88: 159f240c ldrne r2, [pc, #1036] ; 719c <_Heap_Walk+0x538> 6d8c: 159d3020 ldrne r3, [sp, #32] 6d90: 1a0000cc bne 70c8 <_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; 6d94: e59d2020 ldr r2, [sp, #32] 6d98: e5928004 ldr r8, [r2, #4] ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 6d9c: e2188001 ands r8, r8, #1 (*printer)( 6da0: 01a00005 moveq r0, r5 6da4: 03a01001 moveq r1, #1 6da8: 059f23f0 ldreq r2, [pc, #1008] ; 71a0 <_Heap_Walk+0x53c> 6dac: 0a000009 beq 6dd8 <_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; 6db0: e59d3028 ldr r3, [sp, #40] ; 0x28 6db4: e5937004 ldr r7, [r3, #4] 6db8: 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); 6dbc: 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; 6dc0: e5978004 ldr r8, [r7, #4] ); return false; } if ( _Heap_Is_free( last_block ) ) { 6dc4: e2188001 ands r8, r8, #1 6dc8: 1a000005 bne 6de4 <_Heap_Walk+0x180> (*printer)( 6dcc: e59f23d0 ldr r2, [pc, #976] ; 71a4 <_Heap_Walk+0x540> 6dd0: e1a00005 mov r0, r5 6dd4: e3a01001 mov r1, #1 6dd8: e1a0e00f mov lr, pc 6ddc: e12fff14 bx r4 6de0: ea0000db b 7154 <_Heap_Walk+0x4f0> ); return false; } if ( 6de4: e59dc020 ldr ip, [sp, #32] 6de8: e157000c cmp r7, ip 6dec: 0a000006 beq 6e0c <_Heap_Walk+0x1a8> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 6df0: e1a00005 mov r0, r5 <== NOT EXECUTED 6df4: e3a01001 mov r1, #1 <== NOT EXECUTED 6df8: e59f23a8 ldr r2, [pc, #936] ; 71a8 <_Heap_Walk+0x544> <== NOT EXECUTED 6dfc: e1a0e00f mov lr, pc <== NOT EXECUTED 6e00: 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; 6e04: e1a0800a mov r8, sl <== NOT EXECUTED 6e08: ea0000d1 b 7154 <_Heap_Walk+0x4f0> <== NOT EXECUTED int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 6e0c: e596b010 ldr fp, [r6, #16] block = next_block; } while ( block != first_block ); return true; } 6e10: 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 ); 6e14: e1a0a006 mov sl, r6 6e18: ea000034 b 6ef0 <_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; 6e1c: e5963020 ldr r3, [r6, #32] 6e20: e1530008 cmp r3, r8 6e24: 83a0c000 movhi ip, #0 6e28: 8a000003 bhi 6e3c <_Heap_Walk+0x1d8> 6e2c: e596c024 ldr ip, [r6, #36] ; 0x24 6e30: e15c0008 cmp ip, r8 6e34: 33a0c000 movcc ip, #0 6e38: 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 ) ) { 6e3c: e21cc0ff ands ip, ip, #255 ; 0xff (*printer)( 6e40: 01a00005 moveq r0, r5 6e44: 03a01001 moveq r1, #1 6e48: 059f235c ldreq r2, [pc, #860] ; 71ac <_Heap_Walk+0x548> 6e4c: 0a000012 beq 6e9c <_Heap_Walk+0x238> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 6e50: e2880008 add r0, r8, #8 6e54: e1a0100b mov r1, fp 6e58: ebffe751 bl ba4 <__umodsi3> ); return false; } if ( 6e5c: e250c000 subs ip, r0, #0 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 6e60: 11a00005 movne r0, r5 6e64: 13a01001 movne r1, #1 6e68: 159f2340 ldrne r2, [pc, #832] ; 71b0 <_Heap_Walk+0x54c> 6e6c: 11a03008 movne r3, r8 6e70: 1a0000be bne 7170 <_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; 6e74: e5983004 ldr r3, [r8, #4] 6e78: e3c33001 bic r3, r3, #1 block = next_block; } while ( block != first_block ); return true; } 6e7c: 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; 6e80: e5933004 ldr r3, [r3, #4] ); return false; } if ( _Heap_Is_used( free_block ) ) { 6e84: e2133001 ands r3, r3, #1 6e88: e58d302c str r3, [sp, #44] ; 0x2c 6e8c: 0a000009 beq 6eb8 <_Heap_Walk+0x254> (*printer)( 6e90: e59f231c ldr r2, [pc, #796] ; 71b4 <_Heap_Walk+0x550> 6e94: e1a00005 mov r0, r5 6e98: e3a01001 mov r1, #1 6e9c: e1a03008 mov r3, r8 6ea0: e58dc01c str ip, [sp, #28] 6ea4: e1a0e00f mov lr, pc 6ea8: e12fff14 bx r4 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 6eac: e59dc01c ldr ip, [sp, #28] 6eb0: e1a0800c mov r8, ip 6eb4: ea0000a6 b 7154 <_Heap_Walk+0x4f0> ); return false; } if ( free_block->prev != prev_block ) { 6eb8: e598300c ldr r3, [r8, #12] 6ebc: e153000a cmp r3, sl 6ec0: 0a000008 beq 6ee8 <_Heap_Walk+0x284> (*printer)( 6ec4: e58d3000 str r3, [sp] 6ec8: e1a00005 mov r0, r5 6ecc: e1a03008 mov r3, r8 6ed0: e3a01001 mov r1, #1 6ed4: e59f22dc ldr r2, [pc, #732] ; 71b8 <_Heap_Walk+0x554> 6ed8: e1a0e00f mov lr, pc 6edc: e12fff14 bx r4 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 6ee0: e59d802c ldr r8, [sp, #44] ; 0x2c 6ee4: ea00009a b 7154 <_Heap_Walk+0x4f0> return false; } prev_block = free_block; free_block = free_block->next; 6ee8: e1a0a008 mov sl, r8 6eec: 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 ) { 6ef0: e1580006 cmp r8, r6 6ef4: 1affffc8 bne 6e1c <_Heap_Walk+0x1b8> 6ef8: ea000000 b 6f00 <_Heap_Walk+0x29c> block->prev_size ); } block = next_block; } while ( block != first_block ); 6efc: e1a07008 mov r7, r8 return true; } 6f00: 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; 6f04: 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; 6f08: 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); 6f0c: 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; 6f10: e1520008 cmp r2, r8 6f14: 83a0b000 movhi fp, #0 6f18: 8a000003 bhi 6f2c <_Heap_Walk+0x2c8> 6f1c: e596b024 ldr fp, [r6, #36] ; 0x24 6f20: e15b0008 cmp fp, r8 6f24: 33a0b000 movcc fp, #0 6f28: 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 ) ) { 6f2c: e21bb0ff ands fp, fp, #255 ; 0xff 6f30: 1a000007 bne 6f54 <_Heap_Walk+0x2f0> (*printer)( 6f34: e58d8000 str r8, [sp] 6f38: e1a00005 mov r0, r5 6f3c: e3a01001 mov r1, #1 6f40: e59f2274 ldr r2, [pc, #628] ; 71bc <_Heap_Walk+0x558> 6f44: e1a03007 mov r3, r7 6f48: e1a0e00f mov lr, pc 6f4c: e12fff14 bx r4 6f50: ea00005e b 70d0 <_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; 6f54: e59d2028 ldr r2, [sp, #40] ; 0x28 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 6f58: e1a0000a mov r0, sl 6f5c: e1a01009 mov r1, r9 6f60: e057b002 subs fp, r7, r2 6f64: 13a0b001 movne fp, #1 6f68: e58d301c str r3, [sp, #28] 6f6c: ebffe70c bl ba4 <__umodsi3> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 6f70: e3500000 cmp r0, #0 6f74: e59d301c ldr r3, [sp, #28] 6f78: 0a000005 beq 6f94 <_Heap_Walk+0x330> 6f7c: e35b0000 cmp fp, #0 (*printer)( 6f80: 158da000 strne sl, [sp] 6f84: 11a00005 movne r0, r5 6f88: 13a01001 movne r1, #1 6f8c: 159f222c ldrne r2, [pc, #556] ; 71c0 <_Heap_Walk+0x55c> 6f90: 1a000014 bne 6fe8 <_Heap_Walk+0x384> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 6f94: e59dc024 ldr ip, [sp, #36] ; 0x24 6f98: e15a000c cmp sl, ip 6f9c: 2a000009 bcs 6fc8 <_Heap_Walk+0x364> 6fa0: e35b0000 cmp fp, #0 6fa4: 0a000007 beq 6fc8 <_Heap_Walk+0x364> (*printer)( 6fa8: e88d1400 stm sp, {sl, ip} 6fac: e1a00005 mov r0, r5 6fb0: e3a01001 mov r1, #1 6fb4: e59f2208 ldr r2, [pc, #520] ; 71c4 <_Heap_Walk+0x560> 6fb8: e1a03007 mov r3, r7 6fbc: e1a0e00f mov lr, pc 6fc0: e12fff14 bx r4 6fc4: ea00006b b 7178 <_Heap_Walk+0x514> ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 6fc8: e1580007 cmp r8, r7 6fcc: 8a000009 bhi 6ff8 <_Heap_Walk+0x394> 6fd0: e35b0000 cmp fp, #0 6fd4: 0a000007 beq 6ff8 <_Heap_Walk+0x394> (*printer)( 6fd8: e58d8000 str r8, [sp] 6fdc: e59f21e4 ldr r2, [pc, #484] ; 71c8 <_Heap_Walk+0x564> 6fe0: e1a00005 mov r0, r5 6fe4: e3a01001 mov r1, #1 6fe8: e1a03007 mov r3, r7 6fec: e1a0e00f mov lr, pc 6ff0: e12fff14 bx r4 6ff4: ea00005f b 7178 <_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; 6ff8: e203b001 and fp, r3, #1 6ffc: e5983004 ldr r3, [r8, #4] ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 7000: e3130001 tst r3, #1 7004: 1a00003b bne 70f8 <_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 ? 7008: 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)( 700c: e5963008 ldr r3, [r6, #8] 7010: e1520003 cmp r2, r3 block = next_block; } while ( block != first_block ); return true; } 7014: 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)( 7018: 059f01ac ldreq r0, [pc, #428] ; 71cc <_Heap_Walk+0x568> 701c: 0a000003 beq 7030 <_Heap_Walk+0x3cc> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 7020: e59f31a8 ldr r3, [pc, #424] ; 71d0 <_Heap_Walk+0x56c> 7024: e1520006 cmp r2, r6 7028: e59f01a4 ldr r0, [pc, #420] ; 71d4 <_Heap_Walk+0x570> 702c: 01a00003 moveq r0, r3 block->next, block->next == last_free_block ? 7030: 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)( 7034: e1530001 cmp r3, r1 7038: 059f1198 ldreq r1, [pc, #408] ; 71d8 <_Heap_Walk+0x574> 703c: 0a000003 beq 7050 <_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)" : "") 7040: e59fc194 ldr ip, [pc, #404] ; 71dc <_Heap_Walk+0x578> 7044: e1530006 cmp r3, r6 7048: e59f1184 ldr r1, [pc, #388] ; 71d4 <_Heap_Walk+0x570> 704c: 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)( 7050: e58d2004 str r2, [sp, #4] 7054: e58d0008 str r0, [sp, #8] 7058: e58d300c str r3, [sp, #12] 705c: e58d1010 str r1, [sp, #16] 7060: e1a03007 mov r3, r7 7064: e58da000 str sl, [sp] 7068: e1a00005 mov r0, r5 706c: e3a01000 mov r1, #0 7070: e59f2168 ldr r2, [pc, #360] ; 71e0 <_Heap_Walk+0x57c> 7074: e1a0e00f mov lr, pc 7078: e12fff14 bx r4 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 707c: e5983000 ldr r3, [r8] 7080: e15a0003 cmp sl, r3 7084: 0a000009 beq 70b0 <_Heap_Walk+0x44c> (*printer)( 7088: e58d3004 str r3, [sp, #4] 708c: e58da000 str sl, [sp] 7090: e58d8008 str r8, [sp, #8] 7094: e1a00005 mov r0, r5 7098: e3a01001 mov r1, #1 709c: e59f2140 ldr r2, [pc, #320] ; 71e4 <_Heap_Walk+0x580> 70a0: e1a03007 mov r3, r7 70a4: e1a0e00f mov lr, pc 70a8: e12fff14 bx r4 70ac: ea000031 b 7178 <_Heap_Walk+0x514> ); return false; } if ( !prev_used ) { 70b0: e35b0000 cmp fp, #0 70b4: 1a000007 bne 70d8 <_Heap_Walk+0x474> (*printer)( 70b8: e59f2128 ldr r2, [pc, #296] ; 71e8 <_Heap_Walk+0x584> 70bc: e1a00005 mov r0, r5 70c0: e3a01001 mov r1, #1 70c4: e1a03007 mov r3, r7 70c8: e1a0e00f mov lr, pc 70cc: e12fff14 bx r4 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 70d0: e1a0800b mov r8, fp 70d4: ea00001e b 7154 <_Heap_Walk+0x4f0> block = next_block; } while ( block != first_block ); return true; } 70d8: e5963008 ldr r3, [r6, #8] 70dc: ea000002 b 70ec <_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 ) { 70e0: e1530007 cmp r3, r7 70e4: 0a000016 beq 7144 <_Heap_Walk+0x4e0> return true; } free_block = free_block->next; 70e8: 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 ) { 70ec: e1530006 cmp r3, r6 70f0: 1afffffa bne 70e0 <_Heap_Walk+0x47c> 70f4: ea000019 b 7160 <_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) { 70f8: e35b0000 cmp fp, #0 70fc: 0a000007 beq 7120 <_Heap_Walk+0x4bc> (*printer)( 7100: e58da000 str sl, [sp] 7104: e1a00005 mov r0, r5 7108: e3a01000 mov r1, #0 710c: e59f20d8 ldr r2, [pc, #216] ; 71ec <_Heap_Walk+0x588> 7110: e1a03007 mov r3, r7 7114: e1a0e00f mov lr, pc 7118: e12fff14 bx r4 711c: ea000008 b 7144 <_Heap_Walk+0x4e0> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 7120: e58da000 str sl, [sp] 7124: e5973000 ldr r3, [r7] 7128: e1a00005 mov r0, r5 712c: e58d3004 str r3, [sp, #4] 7130: e1a0100b mov r1, fp 7134: e59f20b4 ldr r2, [pc, #180] ; 71f0 <_Heap_Walk+0x58c> 7138: e1a03007 mov r3, r7 713c: e1a0e00f mov lr, pc 7140: e12fff14 bx r4 block->prev_size ); } block = next_block; } while ( block != first_block ); 7144: e59d2020 ldr r2, [sp, #32] 7148: e1580002 cmp r8, r2 714c: 1affff6a bne 6efc <_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; 7150: e3a08001 mov r8, #1 block = next_block; } while ( block != first_block ); return true; } 7154: e1a00008 mov r0, r8 7158: e28dd030 add sp, sp, #48 ; 0x30 715c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 7160: e59f208c ldr r2, [pc, #140] ; 71f4 <_Heap_Walk+0x590> 7164: e1a00005 mov r0, r5 7168: e3a01001 mov r1, #1 716c: e1a03007 mov r3, r7 7170: e1a0e00f mov lr, pc 7174: e12fff14 bx r4 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 7178: e3a08000 mov r8, #0 717c: eafffff4 b 7154 <_Heap_Walk+0x4f0> =============================================================================== 000075a0 <_Thread_queue_Enqueue_priority>: RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 75a0: e281303c add r3, r1, #60 ; 0x3c Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 75a4: e591c014 ldr ip, [r1, #20] head->next = tail; 75a8: e5813038 str r3, [r1, #56] ; 0x38 head->previous = NULL; 75ac: e3a03000 mov r3, #0 75b0: e581303c str r3, [r1, #60] ; 0x3c header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 75b4: e31c0020 tst ip, #32 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 75b8: e2813038 add r3, r1, #56 ; 0x38 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 75bc: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; tail->previous = head; 75c0: e5813040 str r3, [r1, #64] ; 0x40 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; block_state = the_thread_queue->state; 75c4: e5908038 ldr r8, [r0, #56] ; 0x38 RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number ( Priority_Control the_priority ) { return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER); 75c8: e1a0332c lsr r3, ip, #6 if ( _Thread_queue_Is_reverse_search( priority ) ) 75cc: 1a000027 bne 7670 <_Thread_queue_Enqueue_priority+0xd0> * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 75d0: e3a0700c mov r7, #12 75d4: e0030397 mul r3, r7, r3 75d8: e080a003 add sl, r0, r3 RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Tail(the_chain)); 75dc: e2833004 add r3, r3, #4 75e0: e0807003 add r7, r0, r3 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 75e4: e10f4000 mrs r4, CPSR 75e8: e3843080 orr r3, r4, #128 ; 0x80 75ec: e129f003 msr CPSR_fc, r3 75f0: e1a05004 mov r5, r4 if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; 75f4: e3e06000 mvn r6, #0 _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); 75f8: e59a3000 ldr r3, [sl] while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 75fc: ea00000b b 7630 <_Thread_queue_Enqueue_priority+0x90> search_priority = search_thread->current_priority; 7600: e5936014 ldr r6, [r3, #20] if ( priority <= search_priority ) 7604: e15c0006 cmp ip, r6 7608: 9a00000a bls 7638 <_Thread_queue_Enqueue_priority+0x98> static inline void arm_interrupt_flash( uint32_t level ) { uint32_t arm_switch_reg; asm volatile ( 760c: e10f9000 mrs r9, CPSR 7610: e129f004 msr CPSR_fc, r4 7614: e129f009 msr CPSR_fc, r9 RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 7618: e5939010 ldr r9, [r3, #16] search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { 761c: e1180009 tst r8, r9 7620: 1a000001 bne 762c <_Thread_queue_Enqueue_priority+0x8c> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 7624: e129f004 msr CPSR_fc, r4 7628: eaffffed b 75e4 <_Thread_queue_Enqueue_priority+0x44> _ISR_Enable( level ); goto restart_forward_search; } search_thread = (Thread_Control *)search_thread->Object.Node.next; 762c: e5933000 ldr r3, [r3] restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 7630: e1530007 cmp r3, r7 7634: 1afffff1 bne 7600 <_Thread_queue_Enqueue_priority+0x60> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 7638: e5907030 ldr r7, [r0, #48] ; 0x30 763c: e3570001 cmp r7, #1 7640: 1a00003b bne 7734 <_Thread_queue_Enqueue_priority+0x194> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 7644: e3a02000 mov r2, #0 if ( priority == search_priority ) 7648: e15c0006 cmp ip, r6 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 764c: e5802030 str r2, [r0, #48] ; 0x30 if ( priority == search_priority ) 7650: 0a00002d beq 770c <_Thread_queue_Enqueue_priority+0x16c> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 7654: e5932004 ldr r2, [r3, #4] the_node = (Chain_Node *) the_thread; the_node->next = search_node; 7658: e5813000 str r3, [r1] the_node->previous = previous_node; 765c: e5812004 str r2, [r1, #4] previous_node->next = the_node; 7660: e5821000 str r1, [r2] search_node->previous = the_node; 7664: e5831004 str r1, [r3, #4] the_thread->Wait.queue = the_thread_queue; 7668: e5810044 str r0, [r1, #68] ; 0x44 _ISR_Enable( level ); 766c: ea000024 b 7704 <_Thread_queue_Enqueue_priority+0x164> * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 7670: e3a0700c mov r7, #12 7674: e0270793 mla r7, r3, r7, r0 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 7678: e59fa0c0 ldr sl, [pc, #192] ; 7740 <_Thread_queue_Enqueue_priority+0x1a0> 767c: e5da6000 ldrb r6, [sl] 7680: e2866001 add r6, r6, #1 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 7684: e10f4000 mrs r4, CPSR 7688: e3843080 orr r3, r4, #128 ; 0x80 768c: e129f003 msr CPSR_fc, r3 7690: e1a05004 mov r5, r4 _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); 7694: e5973008 ldr r3, [r7, #8] while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 7698: ea00000b b 76cc <_Thread_queue_Enqueue_priority+0x12c> search_priority = search_thread->current_priority; 769c: e5936014 ldr r6, [r3, #20] if ( priority >= search_priority ) 76a0: e15c0006 cmp ip, r6 76a4: 2a00000a bcs 76d4 <_Thread_queue_Enqueue_priority+0x134> static inline void arm_interrupt_flash( uint32_t level ) { uint32_t arm_switch_reg; asm volatile ( 76a8: e10f9000 mrs r9, CPSR 76ac: e129f004 msr CPSR_fc, r4 76b0: e129f009 msr CPSR_fc, r9 76b4: e5939010 ldr r9, [r3, #16] search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { 76b8: e1180009 tst r8, r9 76bc: 1a000001 bne 76c8 <_Thread_queue_Enqueue_priority+0x128> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 76c0: e129f004 msr CPSR_fc, r4 <== NOT EXECUTED 76c4: eaffffec b 767c <_Thread_queue_Enqueue_priority+0xdc> <== NOT EXECUTED _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) search_thread->Object.Node.previous; 76c8: e5933004 ldr r3, [r3, #4] restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 76cc: e1530007 cmp r3, r7 76d0: 1afffff1 bne 769c <_Thread_queue_Enqueue_priority+0xfc> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 76d4: e5907030 ldr r7, [r0, #48] ; 0x30 76d8: e3570001 cmp r7, #1 76dc: 1a000014 bne 7734 <_Thread_queue_Enqueue_priority+0x194> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 76e0: e3a02000 mov r2, #0 if ( priority == search_priority ) 76e4: e15c0006 cmp ip, r6 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 76e8: e5802030 str r2, [r0, #48] ; 0x30 if ( priority == search_priority ) 76ec: 0a000006 beq 770c <_Thread_queue_Enqueue_priority+0x16c> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 76f0: e5932000 ldr r2, [r3] the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 76f4: e881000c stm r1, {r2, r3} search_node->next = the_node; next_node->previous = the_node; 76f8: e5821004 str r1, [r2, #4] next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; search_node->next = the_node; 76fc: e5831000 str r1, [r3] next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 7700: e5810044 str r0, [r1, #68] ; 0x44 7704: e129f004 msr CPSR_fc, r4 7708: ea000007 b 772c <_Thread_queue_Enqueue_priority+0x18c> _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 770c: e5932040 ldr r2, [r3, #64] ; 0x40 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); 7710: e283c03c add ip, r3, #60 ; 0x3c previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; 7714: e581c000 str ip, [r1] the_node->previous = previous_node; 7718: e5812004 str r2, [r1, #4] previous_node->next = the_node; 771c: e5821000 str r1, [r2] search_node->previous = the_node; 7720: e5831040 str r1, [r3, #64] ; 0x40 the_thread->Wait.queue = the_thread_queue; 7724: e5810044 str r0, [r1, #68] ; 0x44 7728: e129f005 msr CPSR_fc, r5 _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 772c: e3a00001 mov r0, #1 7730: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 7734: e5825000 str r5, [r2] return the_thread_queue->sync_state; 7738: e5900030 ldr r0, [r0, #48] ; 0x30 } 773c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} =============================================================================== 00009708 <_Timespec_Greater_than>: bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { if ( lhs->tv_sec > rhs->tv_sec ) 9708: e5902000 ldr r2, [r0] 970c: e5913000 ldr r3, [r1] 9710: e1520003 cmp r2, r3 return true; 9714: c3a00001 movgt r0, #1 bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { if ( lhs->tv_sec > rhs->tv_sec ) 9718: c12fff1e bxgt lr return true; if ( lhs->tv_sec < rhs->tv_sec ) 971c: ba000005 blt 9738 <_Timespec_Greater_than+0x30> #include #include #include bool _Timespec_Greater_than( 9720: e5900004 ldr r0, [r0, #4] 9724: e5913004 ldr r3, [r1, #4] 9728: e1500003 cmp r0, r3 972c: d3a00000 movle r0, #0 9730: c3a00001 movgt r0, #1 9734: e12fff1e bx lr { if ( lhs->tv_sec > rhs->tv_sec ) return true; if ( lhs->tv_sec < rhs->tv_sec ) return false; 9738: e3a00000 mov r0, #0 /* ASSERT: lhs->tv_sec == rhs->tv_sec */ if ( lhs->tv_nsec > rhs->tv_nsec ) return true; return false; } 973c: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 0001f648 <__kill>: #endif int __kill( pid_t pid, int sig ) { return 0; } 1f648: e3a00000 mov r0, #0 <== NOT EXECUTED 1f64c: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 00001db4 <_gettimeofday>: int _gettimeofday( struct timeval *tp, struct timezone *tzp ) { return gettimeofday( tp, tzp ); 1db4: eaffffe5 b 1d50 <== NOT EXECUTED =============================================================================== 00008544 : const char *pathname, size_t pathnamelen, int flags, rtems_filesystem_location_info_t *pathloc ) { 8544: 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 ) ) 8548: e3d27007 bics r7, r2, #7 const char *pathname, size_t pathnamelen, int flags, rtems_filesystem_location_info_t *pathloc ) { 854c: e1a09000 mov r9, r0 8550: e1a04001 mov r4, r1 8554: 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 ) ) 8558: 0a000002 beq 8568 rtems_set_errno_and_return_minus_one( EPERM ); 855c: eb00066d bl 9f18 <__errno> <== NOT EXECUTED 8560: e3a03001 mov r3, #1 <== NOT EXECUTED 8564: ea000005 b 8580 <== NOT EXECUTED /* get the device name table */ device_name_table = (rtems_device_name_t *)pathloc->node_access; 8568: e5936000 ldr r6, [r3] if (!device_name_table) 856c: e3560000 cmp r6, #0 rtems_set_errno_and_return_minus_one( EFAULT ); for (i = 0; i < rtems_device_table_size; i++) { 8570: 159fa094 ldrne sl, [pc, #148] ; 860c 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) 8574: 1a00001c bne 85ec rtems_set_errno_and_return_minus_one( EFAULT ); 8578: eb000666 bl 9f18 <__errno> 857c: e3a0300e mov r3, #14 8580: e5803000 str r3, [r0] 8584: e3e00000 mvn r0, #0 8588: 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) 858c: e5968000 ldr r8, [r6] 8590: e3580000 cmp r8, #0 8594: 0a000012 beq 85e4 continue; if (strncmp(pathname, device_name_table[i].device_name, pathnamelen) != 0) 8598: e1a00009 mov r0, r9 859c: e1a01008 mov r1, r8 85a0: e1a02004 mov r2, r4 85a4: eb0009e2 bl ad34 85a8: e3500000 cmp r0, #0 85ac: 1a00000c bne 85e4 continue; if (device_name_table[i].device_name[pathnamelen] != '\0') 85b0: e7d80004 ldrb r0, [r8, r4] 85b4: e3500000 cmp r0, #0 85b8: 1a000009 bne 85e4 continue; /* find the device, set proper values */ pathloc->node_access = (void *)&device_name_table[i]; pathloc->handlers = &devFS_file_handlers; 85bc: e59f304c ldr r3, [pc, #76] ; 8610 85c0: e5853008 str r3, [r5, #8] pathloc->ops = &devFS_ops; 85c4: e59f3048 ldr r3, [pc, #72] ; 8614 85c8: e585300c str r3, [r5, #12] pathloc->mt_entry = rtems_filesystem_root.mt_entry; 85cc: e59f3044 ldr r3, [pc, #68] ; 8618 85d0: e5933000 ldr r3, [r3] 85d4: 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]; 85d8: e5856000 str r6, [r5] pathloc->handlers = &devFS_file_handlers; pathloc->ops = &devFS_ops; pathloc->mt_entry = rtems_filesystem_root.mt_entry; 85dc: e5853010 str r3, [r5, #16] return 0; 85e0: 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++) { 85e4: e2877001 add r7, r7, #1 85e8: e2866014 add r6, r6, #20 85ec: e59a3000 ldr r3, [sl] 85f0: e1570003 cmp r7, r3 85f4: 3affffe4 bcc 858c pathloc->mt_entry = rtems_filesystem_root.mt_entry; return 0; } /* no such file or directory */ rtems_set_errno_and_return_minus_one( ENOENT ); 85f8: eb000646 bl 9f18 <__errno> 85fc: e3a03002 mov r3, #2 8600: e5803000 str r3, [r0] 8604: e3e00000 mvn r0, #0 } 8608: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} =============================================================================== 00002b10 : drainOutput (struct rtems_termios_tty *tty) { rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { 2b10: e59030b4 ldr r3, [r0, #180] ; 0xb4 2b14: e3530000 cmp r3, #0 /* * Drain output queue */ static void drainOutput (struct rtems_termios_tty *tty) { 2b18: e92d4030 push {r4, r5, lr} 2b1c: e1a04000 mov r4, r0 rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { 2b20: 08bd8030 popeq {r4, r5, pc} rtems_interrupt_disable (level); 2b24: ebfffff5 bl 2b00 while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { tty->rawOutBufState = rob_wait; 2b28: 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) { 2b2c: ea000008 b 2b54 tty->rawOutBufState = rob_wait; 2b30: e5845094 str r5, [r4, #148] ; 0x94 <== NOT EXECUTED static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 2b34: e129f000 msr CPSR_fc, r0 <== NOT EXECUTED rtems_interrupt_enable (level); sc = rtems_semaphore_obtain( 2b38: e3a01000 mov r1, #0 <== NOT EXECUTED 2b3c: e594008c ldr r0, [r4, #140] ; 0x8c <== NOT EXECUTED 2b40: e1a02001 mov r2, r1 <== NOT EXECUTED 2b44: eb0008cc bl 4e7c <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 2b48: e3500000 cmp r0, #0 <== NOT EXECUTED rtems_fatal_error_occurred (sc); 2b4c: 1b000a65 blne 54e8 <== NOT EXECUTED rtems_interrupt_disable (level); 2b50: ebffffea bl 2b00 <== 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) { 2b54: e5942084 ldr r2, [r4, #132] ; 0x84 2b58: e5943080 ldr r3, [r4, #128] ; 0x80 2b5c: e1520003 cmp r2, r3 2b60: 1afffff2 bne 2b30 2b64: e129f000 msr CPSR_fc, r0 2b68: e8bd8030 pop {r4, r5, pc} =============================================================================== 000037f0 : * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) 37f0: e5903020 ldr r3, [r0, #32] 37f4: 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) { 37f8: e92d41f0 push {r4, r5, r6, r7, r8, lr} 37fc: e1a04000 mov r4, r0 3800: e1a07001 mov r7, r1 if (tty->ccount == 0) 3804: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc} return; if (lineFlag) { 3808: e3510000 cmp r1, #0 380c: 0a000060 beq 3994 if (!(tty->termios.c_lflag & ECHO)) { 3810: e590303c ldr r3, [r0, #60] ; 0x3c 3814: e2132008 ands r2, r3, #8 tty->ccount = 0; 3818: 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)) { 381c: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc} tty->ccount = 0; return; } if (!(tty->termios.c_lflag & ECHOE)) { 3820: e2133010 ands r3, r3, #16 3824: 1a00005a bne 3994 tty->ccount = 0; 3828: e5803020 str r3, [r0, #32] <== NOT EXECUTED echo (tty->termios.c_cc[VKILL], tty); 382c: e1a01004 mov r1, r4 <== NOT EXECUTED 3830: e5d00044 ldrb r0, [r0, #68] ; 0x44 <== NOT EXECUTED 3834: ebffffca bl 3764 <== NOT EXECUTED if (tty->termios.c_lflag & ECHOK) 3838: e594303c ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED 383c: e3130020 tst r3, #32 <== NOT EXECUTED echo ('\n', tty); 3840: 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) 3844: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED 3848: ea00000b b 387c <== NOT EXECUTED return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 384c: e2411001 sub r1, r1, #1 if (tty->termios.c_lflag & ECHO) { 3850: e594303c ldr r3, [r4, #60] ; 0x3c return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 3854: e594001c ldr r0, [r4, #28] 3858: e5841020 str r1, [r4, #32] if (tty->termios.c_lflag & ECHO) { 385c: e3130008 tst r3, #8 return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 3860: e7d05001 ldrb r5, [r0, r1] if (tty->termios.c_lflag & ECHO) { 3864: 0a000047 beq 3988 if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { 3868: e3570000 cmp r7, #0 386c: 1a000005 bne 3888 3870: e3130010 tst r3, #16 3874: 1a000003 bne 3888 echo (tty->termios.c_cc[VERASE], tty); 3878: e5d40043 ldrb r0, [r4, #67] ; 0x43 <== NOT EXECUTED 387c: e1a01004 mov r1, r4 <== NOT EXECUTED } } if (!lineFlag) break; } } 3880: 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); 3884: eaffffb6 b 3764 <== NOT EXECUTED } else if (c == '\t') { 3888: e3550009 cmp r5, #9 388c: 1a00001f bne 3910 int col = tty->read_start_column; 3890: 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)) { 3894: 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; 3898: 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) 389c: e2033c02 and r3, r3, #512 ; 0x200 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 38a0: ea00000c b 38d8 c = tty->cbuf[i++]; 38a4: e7d0c002 ldrb ip, [r0, r2] if (c == '\t') { 38a8: e35c0009 cmp ip, #9 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; 38ac: e2822001 add r2, r2, #1 if (c == '\t') { col = (col | 7) + 1; 38b0: 03855007 orreq r5, r5, #7 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { 38b4: 0a000006 beq 38d4 col = (col | 7) + 1; } else if (iscntrl (c)) { 38b8: e088c00c add ip, r8, ip 38bc: e5dcc001 ldrb ip, [ip, #1] 38c0: e31c0020 tst ip, #32 38c4: 0a000002 beq 38d4 if (tty->termios.c_lflag & ECHOCTL) 38c8: e3530000 cmp r3, #0 <== NOT EXECUTED col += 2; 38cc: 12855002 addne r5, r5, #2 <== NOT EXECUTED 38d0: ea000000 b 38d8 <== NOT EXECUTED } else { col++; 38d4: e2855001 add r5, r5, #1 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 38d8: e1520001 cmp r2, r1 38dc: 1afffff0 bne 38a4 38e0: ea000006 b 3900 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 38e4: e59f00bc ldr r0, [pc, #188] ; 39a8 38e8: e3a01001 mov r1, #1 38ec: e1a02004 mov r2, r4 38f0: ebffff07 bl 3514 tty->column--; 38f4: e5943028 ldr r3, [r4, #40] ; 0x28 38f8: e2433001 sub r3, r3, #1 38fc: e5843028 str r3, [r4, #40] ; 0x28 } /* * Back up over the tab */ while (tty->column > col) { 3900: e5943028 ldr r3, [r4, #40] ; 0x28 3904: e1530005 cmp r3, r5 3908: cafffff5 bgt 38e4 390c: ea00001d b 3988 rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 3910: e5962000 ldr r2, [r6] 3914: e2855001 add r5, r5, #1 3918: e7d22005 ldrb r2, [r2, r5] 391c: e3120020 tst r2, #32 3920: 0a000009 beq 394c 3924: e3130c02 tst r3, #512 ; 0x200 <== NOT EXECUTED 3928: 0a000007 beq 394c <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 392c: e59f0078 ldr r0, [pc, #120] ; 39ac <== NOT EXECUTED 3930: e3a01003 mov r1, #3 <== NOT EXECUTED 3934: e1a02004 mov r2, r4 <== NOT EXECUTED 3938: ebfffef5 bl 3514 <== NOT EXECUTED if (tty->column) 393c: e5943028 ldr r3, [r4, #40] ; 0x28 <== NOT EXECUTED 3940: e3530000 cmp r3, #0 <== NOT EXECUTED tty->column--; 3944: 12433001 subne r3, r3, #1 <== NOT EXECUTED 3948: 15843028 strne r3, [r4, #40] ; 0x28 <== NOT EXECUTED } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { 394c: e5963000 ldr r3, [r6] 3950: e7d33005 ldrb r3, [r3, r5] 3954: e3130020 tst r3, #32 3958: 0a000002 beq 3968 395c: e594303c ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED 3960: e3130c02 tst r3, #512 ; 0x200 <== NOT EXECUTED 3964: 0a000007 beq 3988 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 3968: e59f003c ldr r0, [pc, #60] ; 39ac 396c: e3a01003 mov r1, #3 3970: e1a02004 mov r2, r4 3974: ebfffee6 bl 3514 if (tty->column) 3978: e5943028 ldr r3, [r4, #40] ; 0x28 397c: e3530000 cmp r3, #0 tty->column--; 3980: 12433001 subne r3, r3, #1 3984: 15843028 strne r3, [r4, #40] ; 0x28 } } } if (!lineFlag) 3988: e3570000 cmp r7, #0 398c: 1a000001 bne 3998 3990: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} 3994: e59f6014 ldr r6, [pc, #20] ; 39b0 echo ('\n', tty); return; } } while (tty->ccount) { 3998: e5941020 ldr r1, [r4, #32] 399c: e3510000 cmp r1, #0 39a0: 1affffa9 bne 384c 39a4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} =============================================================================== 000025ac : int fcntl( int fd, int cmd, ... ) { 25ac: e92d000e push {r1, r2, r3} 25b0: e92d40f1 push {r0, r4, r5, r6, r7, lr} int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 25b4: e59f21a4 ldr r2, [pc, #420] ; 2760 25b8: e5921000 ldr r1, [r2] ... ) { int ret; va_list ap; va_start( ap, cmd ); 25bc: e28d301c add r3, sp, #28 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 25c0: e1500001 cmp r0, r1 int fcntl( int fd, int cmd, ... ) { 25c4: e59d7018 ldr r7, [sp, #24] int ret; va_list ap; va_start( ap, cmd ); 25c8: e58d3000 str r3, [sp] int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 25cc: 2a000006 bcs 25ec iop = rtems_libio_iop( fd ); 25d0: e59f218c ldr r2, [pc, #396] ; 2764 25d4: e5922000 ldr r2, [r2] 25d8: e3a04038 mov r4, #56 ; 0x38 25dc: e0242490 mla r4, r0, r4, r2 rtems_libio_check_is_open(iop); 25e0: e5940014 ldr r0, [r4, #20] 25e4: e3100c01 tst r0, #256 ; 0x100 25e8: 1a000002 bne 25f8 25ec: eb00298e bl cc2c <__errno> 25f0: e3a03009 mov r3, #9 25f4: ea000047 b 2718 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 25f8: e3570009 cmp r7, #9 25fc: 979ff107 ldrls pc, [pc, r7, lsl #2] 2600: ea000042 b 2710 2604: 0000262c .word 0x0000262c 2608: 0000269c .word 0x0000269c 260c: 000026ac .word 0x000026ac 2610: 000026cc .word 0x000026cc 2614: 000026d8 .word 0x000026d8 2618: 00002704 .word 0x00002704 261c: 00002704 .word 0x00002704 2620: 00002704 .word 0x00002704 2624: 00002704 .word 0x00002704 2628: 00002704 .word 0x00002704 case F_DUPFD: /* dup */ fd2 = va_arg( ap, int ); 262c: e5933000 ldr r3, [r3] if ( fd2 ) 2630: e3530000 cmp r3, #0 2634: 0a000004 beq 264c diop = rtems_libio_iop( fd2 ); 2638: e1530001 cmp r3, r1 263c: 33a06038 movcc r6, #56 ; 0x38 2640: 30262693 mlacc r6, r3, r6, r2 2644: 3a000005 bcc 2660 2648: ea000003 b 265c <== NOT EXECUTED else { /* allocate a file control block */ diop = rtems_libio_allocate(); 264c: eb000190 bl 2c94 if ( diop == 0 ) { 2650: e2506000 subs r6, r0, #0 2654: 1a000001 bne 2660 2658: ea00003b b 274c <== NOT EXECUTED switch ( cmd ) { case F_DUPFD: /* dup */ fd2 = va_arg( ap, int ); if ( fd2 ) diop = rtems_libio_iop( fd2 ); 265c: e3a06000 mov r6, #0 <== NOT EXECUTED ret = -1; break; } } diop->flags = iop->flags; 2660: e5943014 ldr r3, [r4, #20] diop->pathinfo = iop->pathinfo; 2664: e2845018 add r5, r4, #24 ret = -1; break; } } diop->flags = iop->flags; 2668: e5863014 str r3, [r6, #20] diop->pathinfo = iop->pathinfo; 266c: e8b5000f ldm r5!, {r0, r1, r2, r3} 2670: e286c018 add ip, r6, #24 2674: e8ac000f stmia ip!, {r0, r1, r2, r3} 2678: e5953000 ldr r3, [r5] 267c: e58c3000 str r3, [ip] ret = (int) (diop - rtems_libio_iops); 2680: e59f30dc ldr r3, [pc, #220] ; 2764 2684: e5933000 ldr r3, [r3] 2688: e0636006 rsb r6, r3, r6 268c: e59f30d4 ldr r3, [pc, #212] ; 2768 2690: e1a061c6 asr r6, r6, #3 2694: e0060693 mul r6, r3, r6 2698: ea000020 b 2720 break; case F_GETFD: /* get f_flags */ ret = ((iop->flags & LIBIO_FLAGS_CLOSE_ON_EXEC) != 0); 269c: e3100b02 tst r0, #2048 ; 0x800 26a0: 03a06000 moveq r6, #0 26a4: 13a06001 movne r6, #1 26a8: ea00001e b 2728 * 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 ) ) 26ac: e5936000 ldr r6, [r3] 26b0: e3560000 cmp r6, #0 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 26b4: 13800b02 orrne r0, r0, #2048 ; 0x800 else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 26b8: 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; 26bc: 15840014 strne r0, [r4, #20] else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 26c0: 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 ) ) 26c4: 0a000017 beq 2728 26c8: ea00000b b 26fc else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); 26cc: eb00015e bl 2c4c 26d0: e1a06000 mov r6, r0 26d4: ea000011 b 2720 break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 26d8: e5930000 ldr r0, [r3] 26dc: eb00014d bl 2c18 /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); 26e0: e5942014 ldr r2, [r4, #20] 26e4: e59f3080 ldr r3, [pc, #128] ; 276c 26e8: e3c22c02 bic r2, r2, #512 ; 0x200 26ec: e0003003 and r3, r0, r3 26f0: e3c22001 bic r2, r2, #1 26f4: e1833002 orr r3, r3, r2 26f8: e5843014 str r3, [r4, #20] rtems_libio_t *iop; rtems_libio_t *diop; int fd2; int flags; int mask; int ret = 0; 26fc: e3a06000 mov r6, #0 2700: ea000008 b 2728 errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 2704: eb002948 bl cc2c <__errno> 2708: e3a03086 mov r3, #134 ; 0x86 270c: ea000001 b 2718 ret = -1; break; default: errno = EINVAL; 2710: eb002945 bl cc2c <__errno> 2714: e3a03016 mov r3, #22 2718: e5803000 str r3, [r0] 271c: ea00000a b 274c /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 2720: e3560000 cmp r6, #0 2724: ba000009 blt 2750 int err = (*iop->pathinfo.handlers->fcntl_h)( cmd, iop ); 2728: e5943020 ldr r3, [r4, #32] 272c: e1a01004 mov r1, r4 2730: e1a00007 mov r0, r7 2734: e1a0e00f mov lr, pc 2738: e593f030 ldr pc, [r3, #48] ; 0x30 if (err) { 273c: e2504000 subs r4, r0, #0 2740: 0a000002 beq 2750 errno = err; 2744: eb002938 bl cc2c <__errno> <== NOT EXECUTED 2748: e5804000 str r4, [r0] <== NOT EXECUTED ret = -1; 274c: e3e06000 mvn r6, #0 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 2750: e1a00006 mov r0, r6 2754: e8bd40f8 pop {r3, r4, r5, r6, r7, lr} 2758: e28dd00c add sp, sp, #12 275c: e12fff1e bx lr =============================================================================== 0000b268 : */ int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { b268: e92d45f3 push {r0, r1, 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) { b26c: e59f5378 ldr r5, [pc, #888] ; b5ec b270: e5954000 ldr r4, [r5] b274: e3540000 cmp r4, #0 */ int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { b278: e1a08000 mov r8, r0 b27c: e1a07001 mov r7, r1 static rtems_status_code pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { b280: 1a000012 bne b2d0 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 ); b284: e59f3364 ldr r3, [pc, #868] ; b5f0 b288: e1a01004 mov r1, r4 b28c: e5930000 ldr r0, [r3] b290: e1a02004 mov r2, r4 b294: ebffeedd bl 6e10 rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { b298: e5953000 ldr r3, [r5] b29c: e3530000 cmp r3, #0 b2a0: 1a000005 bne b2bc sc = rtems_semaphore_create( b2a4: e59f0348 ldr r0, [pc, #840] ; b5f4 b2a8: e3a01001 mov r1, #1 b2ac: e3a02054 mov r2, #84 ; 0x54 b2b0: e58d5000 str r5, [sp] b2b4: ebffee43 bl 6bc8 b2b8: e1a04000 mov r4, r0 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); b2bc: e59f332c ldr r3, [pc, #812] ; b5f0 b2c0: e5930000 ldr r0, [r3] b2c4: ebffef17 bl 6f28 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { b2c8: e3540000 cmp r4, #0 b2cc: 1a000006 bne b2ec sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); b2d0: e59f3314 ldr r3, [pc, #788] ; b5ec b2d4: e3a01000 mov r1, #0 b2d8: e5930000 ldr r0, [r3] b2dc: e1a02001 mov r2, r1 b2e0: ebffeeca bl 6e10 } if (sc == RTEMS_SUCCESSFUL) { b2e4: e2505000 subs r5, r0, #0 b2e8: 0a000000 beq b2f0 return 0; } else { return -ENOMEM; b2ec: e3e0500b mvn r5, #11 { pipe_control_t *pipe; int err = 0; err = pipe_lock(); if (err) b2f0: e2556000 subs r6, r5, #0 b2f4: 1a0000ba bne b5e4 return err; pipe = *pipep; b2f8: e5984000 ldr r4, [r8] if (pipe == NULL) { b2fc: e3540000 cmp r4, #0 b300: 1a00003c bne b3f8 { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); b304: e3a00034 mov r0, #52 ; 0x34 b308: ebffe2df bl 3e8c if (pipe == NULL) b30c: e250a000 subs sl, r0, #0 { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); b310: e1a04000 mov r4, r0 if (pipe == NULL) b314: 0a000035 beq b3f0 return err; memset(pipe, 0, sizeof(pipe_control_t)); b318: e1a01005 mov r1, r5 b31c: e3a02034 mov r2, #52 ; 0x34 b320: eb000e06 bl eb40 pipe->Size = PIPE_BUF; b324: e3a00c02 mov r0, #512 ; 0x200 b328: e5840004 str r0, [r4, #4] pipe->Buffer = malloc(pipe->Size); b32c: ebffe2d6 bl 3e8c if (! pipe->Buffer) b330: 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); b334: e5840000 str r0, [r4] if (! pipe->Buffer) b338: 0a00002a beq b3e8 goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), b33c: e59f62b4 ldr r6, [pc, #692] ; b5f8 if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( b340: e59f02b4 ldr r0, [pc, #692] ; b5fc rtems_build_name ('P', 'I', 'r', c), b344: e5d63000 ldrb r3, [r6] if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( b348: e1a01005 mov r1, r5 b34c: e1830000 orr r0, r3, r0 b350: e1a02005 mov r2, r5 b354: e284302c add r3, r4, #44 ; 0x2c b358: eb0003dd bl c2d4 b35c: e3500000 cmp r0, #0 b360: 1a00001e bne b3e0 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), b364: 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( b368: e59f0290 ldr r0, [pc, #656] ; b600 b36c: e1a01005 mov r1, r5 b370: e1830000 orr r0, r3, r0 b374: e1a02005 mov r2, r5 b378: e2843030 add r3, r4, #48 ; 0x30 b37c: eb0003d4 bl c2d4 b380: e3500000 cmp r0, #0 b384: 1a000013 bne b3d8 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, b388: 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( b38c: e59f0270 ldr r0, [pc, #624] ; b604 b390: e2842028 add r2, r4, #40 ; 0x28 b394: e58d2000 str r2, [sp] b398: e1830000 orr r0, r3, r0 b39c: e3a01001 mov r1, #1 b3a0: e3a02010 mov r2, #16 b3a4: e1a03005 mov r3, r5 b3a8: ebffee06 bl 6bc8 b3ac: e3500000 cmp r0, #0 b3b0: 1a000006 bne b3d0 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') b3b4: e5d63000 ldrb r3, [r6] b3b8: e353007a cmp r3, #122 ; 0x7a b3bc: e2832001 add r2, r3, #1 c = 'a'; b3c0: 03a03061 moveq r3, #97 ; 0x61 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') b3c4: e5c62000 strb r2, [r6] c = 'a'; b3c8: 05c63000 strbeq r3, [r6] b3cc: ea000009 b b3f8 return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); b3d0: e59a0030 ldr r0, [sl, #48] ; 0x30 b3d4: eb0003ee bl c394 err_wbar: rtems_barrier_delete(pipe->readBarrier); b3d8: e59a002c ldr r0, [sl, #44] ; 0x2c b3dc: eb0003ec bl c394 err_rbar: free(pipe->Buffer); b3e0: e59a0000 ldr r0, [sl] b3e4: ebffe0d5 bl 3740 err_buf: free(pipe); b3e8: e1a0000a mov r0, sl b3ec: ebffe0d3 bl 3740 if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; b3f0: e3e0600b mvn r6, #11 b3f4: ea00000d b b430 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) b3f8: e3a01000 mov r1, #0 b3fc: e5940028 ldr r0, [r4, #40] ; 0x28 b400: e1a02001 mov r2, r1 b404: ebffee81 bl 6e10 err = -EINTR; if (*pipep == NULL) { b408: e5983000 ldr r3, [r8] if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; b40c: e3500000 cmp r0, #0 b410: 03a06000 moveq r6, #0 b414: 13e06003 mvnne r6, #3 if (*pipep == NULL) { b418: e3530000 cmp r3, #0 b41c: 1a000003 bne b430 if (err) b420: e3560000 cmp r6, #0 pipe_free(pipe); else *pipep = pipe; b424: 05884000 streq r4, [r8] if (! PIPE_LOCK(pipe)) err = -EINTR; if (*pipep == NULL) { if (err) pipe_free(pipe); b428: 11a00004 movne r0, r4 b42c: 1bffff54 blne b184 else *pipep = pipe; } out: pipe_unlock(); b430: ebffff4f bl b174 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) b434: e3560000 cmp r6, #0 b438: 1a000069 bne b5e4 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { b43c: e5973014 ldr r3, [r7, #20] b440: e2033006 and r3, r3, #6 b444: e3530004 cmp r3, #4 int err; err = pipe_new(pipep); if (err) return err; pipe = *pipep; b448: e5984000 ldr r4, [r8] switch (LIBIO_ACCMODE(iop)) { b44c: 0a000024 beq b4e4 b450: e3530006 cmp r3, #6 b454: 0a000047 beq b578 b458: e3530002 cmp r3, #2 b45c: 1a000059 bne b5c8 case LIBIO_FLAGS_READ: pipe->readerCounter ++; b460: e5943020 ldr r3, [r4, #32] b464: e2833001 add r3, r3, #1 b468: e5843020 str r3, [r4, #32] if (pipe->Readers ++ == 0) b46c: e5943010 ldr r3, [r4, #16] b470: e2832001 add r2, r3, #1 b474: e3530000 cmp r3, #0 b478: e5842010 str r2, [r4, #16] PIPE_WAKEUPWRITERS(pipe); b47c: 05940030 ldreq r0, [r4, #48] ; 0x30 b480: 028d1004 addeq r1, sp, #4 b484: 0b0003ea bleq c434 if (pipe->Writers == 0) { b488: e5943014 ldr r3, [r4, #20] b48c: e3530000 cmp r3, #0 b490: 1a00004c bne b5c8 /* Not an error */ if (LIBIO_NODELAY(iop)) b494: e5973014 ldr r3, [r7, #20] b498: e3130001 tst r3, #1 b49c: 1a000049 bne b5c8 break; prevCounter = pipe->writerCounter; b4a0: e5945024 ldr r5, [r4, #36] ; 0x24 err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); b4a4: e5940028 ldr r0, [r4, #40] ; 0x28 b4a8: ebffee9e bl 6f28 if (! PIPE_READWAIT(pipe)) b4ac: e3a01000 mov r1, #0 b4b0: e594002c ldr r0, [r4, #44] ; 0x2c b4b4: eb0003f4 bl c48c b4b8: e2501000 subs r1, r0, #0 b4bc: 1a000044 bne b5d4 goto out_error; if (! PIPE_LOCK(pipe)) b4c0: e5940028 ldr r0, [r4, #40] ; 0x28 b4c4: e1a02001 mov r2, r1 b4c8: ebffee50 bl 6e10 b4cc: e3500000 cmp r0, #0 b4d0: 1a00003f bne b5d4 goto out_error; } while (prevCounter == pipe->writerCounter); b4d4: e5943024 ldr r3, [r4, #36] ; 0x24 b4d8: e1550003 cmp r5, r3 b4dc: 0afffff0 beq b4a4 b4e0: ea000038 b b5c8 } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; b4e4: e5943024 ldr r3, [r4, #36] ; 0x24 b4e8: e2833001 add r3, r3, #1 b4ec: e5843024 str r3, [r4, #36] ; 0x24 if (pipe->Writers ++ == 0) b4f0: e5943014 ldr r3, [r4, #20] b4f4: e2832001 add r2, r3, #1 b4f8: e3530000 cmp r3, #0 b4fc: e5842014 str r2, [r4, #20] PIPE_WAKEUPREADERS(pipe); b500: 0594002c ldreq r0, [r4, #44] ; 0x2c b504: 028d1004 addeq r1, sp, #4 b508: 0b0003c9 bleq c434 if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { b50c: e5943010 ldr r3, [r4, #16] b510: e3530000 cmp r3, #0 b514: 1a00002b bne b5c8 b518: e5973014 ldr r3, [r7, #20] b51c: e3130001 tst r3, #1 err = -ENXIO; goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; b520: 05945020 ldreq r5, [r4, #32] pipe->writerCounter ++; if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { b524: 0a000003 beq b538 PIPE_UNLOCK(pipe); b528: e5940028 ldr r0, [r4, #40] ; 0x28 b52c: ebffee7d bl 6f28 err = -ENXIO; b530: e3e06005 mvn r6, #5 goto out_error; b534: ea000027 b b5d8 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); b538: e5940028 ldr r0, [r4, #40] ; 0x28 b53c: ebffee79 bl 6f28 if (! PIPE_WRITEWAIT(pipe)) b540: e3a01000 mov r1, #0 b544: e5940030 ldr r0, [r4, #48] ; 0x30 b548: eb0003cf bl c48c b54c: e2501000 subs r1, r0, #0 b550: 1a00001f bne b5d4 goto out_error; if (! PIPE_LOCK(pipe)) b554: e5940028 ldr r0, [r4, #40] ; 0x28 b558: e1a02001 mov r2, r1 b55c: ebffee2b bl 6e10 b560: e3500000 cmp r0, #0 b564: 1a00001a bne b5d4 goto out_error; } while (prevCounter == pipe->readerCounter); b568: e5943020 ldr r3, [r4, #32] b56c: e1550003 cmp r5, r3 b570: 0afffff0 beq b538 b574: ea000013 b b5c8 } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; b578: e5943020 ldr r3, [r4, #32] b57c: e2833001 add r3, r3, #1 b580: e5843020 str r3, [r4, #32] if (pipe->Readers ++ == 0) b584: e5943010 ldr r3, [r4, #16] b588: e2832001 add r2, r3, #1 b58c: e3530000 cmp r3, #0 b590: e5842010 str r2, [r4, #16] PIPE_WAKEUPWRITERS(pipe); b594: 05940030 ldreq r0, [r4, #48] ; 0x30 b598: 028d1004 addeq r1, sp, #4 b59c: 0b0003a4 bleq c434 pipe->writerCounter ++; b5a0: e5943024 ldr r3, [r4, #36] ; 0x24 b5a4: e2833001 add r3, r3, #1 b5a8: e5843024 str r3, [r4, #36] ; 0x24 if (pipe->Writers ++ == 0) b5ac: e5943014 ldr r3, [r4, #20] b5b0: e2832001 add r2, r3, #1 b5b4: e3530000 cmp r3, #0 b5b8: e5842014 str r2, [r4, #20] PIPE_WAKEUPREADERS(pipe); b5bc: 0594002c ldreq r0, [r4, #44] ; 0x2c b5c0: 028d1004 addeq r1, sp, #4 b5c4: 0b00039a bleq c434 break; } PIPE_UNLOCK(pipe); b5c8: e5940028 ldr r0, [r4, #40] ; 0x28 b5cc: ebffee55 bl 6f28 return 0; b5d0: ea000003 b b5e4 goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; b5d4: e3e06003 mvn r6, #3 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); b5d8: e1a00008 mov r0, r8 b5dc: e1a01007 mov r1, r7 b5e0: ebfffef4 bl b1b8 return err; } b5e4: e1a00006 mov r0, r6 b5e8: e8bd85fc pop {r2, r3, r4, r5, r6, r7, r8, sl, pc} =============================================================================== 000027f0 : { long return_value; rtems_libio_t *iop; rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); 27f0: e59f3104 ldr r3, [pc, #260] ; 28fc 27f4: e5933000 ldr r3, [r3] 27f8: e1500003 cmp r0, r3 long fpathconf( int fd, int name ) { 27fc: 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); 2800: 2a000006 bcs 2820 iop = rtems_libio_iop(fd); 2804: e59f30f4 ldr r3, [pc, #244] ; 2900 2808: e5933000 ldr r3, [r3] 280c: e3a02038 mov r2, #56 ; 0x38 2810: e0203092 mla r0, r2, r0, r3 rtems_libio_check_is_open(iop); 2814: e5903014 ldr r3, [r0, #20] 2818: e3130c01 tst r3, #256 ; 0x100 281c: 1a000002 bne 282c 2820: eb002901 bl cc2c <__errno> 2824: e3a03009 mov r3, #9 2828: ea000003 b 283c rtems_libio_check_permissions(iop, LIBIO_FLAGS_READ); 282c: e3130002 tst r3, #2 2830: 1a000004 bne 2848 2834: eb0028fc bl cc2c <__errno> 2838: e3a03016 mov r3, #22 283c: e5803000 str r3, [r0] 2840: e3e00000 mvn r0, #0 2844: e49df004 pop {pc} ; (ldr pc, [sp], #4) /* * Now process the information request. */ the_limits = &iop->pathinfo.mt_entry->pathconf_limits_and_options; 2848: e5903028 ldr r3, [r0, #40] ; 0x28 switch ( name ) { 284c: e351000b cmp r1, #11 2850: 979ff101 ldrls pc, [pc, r1, lsl #2] 2854: ea000023 b 28e8 2858: 00002888 .word 0x00002888 285c: 00002890 .word 0x00002890 2860: 00002898 .word 0x00002898 2864: 000028a0 .word 0x000028a0 2868: 000028a8 .word 0x000028a8 286c: 000028b0 .word 0x000028b0 2870: 000028b8 .word 0x000028b8 2874: 000028c0 .word 0x000028c0 2878: 000028c8 .word 0x000028c8 287c: 000028d0 .word 0x000028d0 2880: 000028d8 .word 0x000028d8 2884: 000028e0 .word 0x000028e0 case _PC_LINK_MAX: return_value = the_limits->link_max; 2888: e5930038 ldr r0, [r3, #56] ; 0x38 break; 288c: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_MAX_CANON: return_value = the_limits->max_canon; 2890: e593003c ldr r0, [r3, #60] ; 0x3c break; 2894: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_MAX_INPUT: return_value = the_limits->max_input; 2898: e5930040 ldr r0, [r3, #64] ; 0x40 break; 289c: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_NAME_MAX: return_value = the_limits->name_max; 28a0: e5930044 ldr r0, [r3, #68] ; 0x44 break; 28a4: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_PATH_MAX: return_value = the_limits->path_max; 28a8: e5930048 ldr r0, [r3, #72] ; 0x48 break; 28ac: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 28b0: e593004c ldr r0, [r3, #76] ; 0x4c break; 28b4: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 28b8: e5930054 ldr r0, [r3, #84] ; 0x54 break; 28bc: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 28c0: e5930058 ldr r0, [r3, #88] ; 0x58 break; 28c4: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 28c8: e5930064 ldr r0, [r3, #100] ; 0x64 break; 28cc: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 28d0: e5930050 ldr r0, [r3, #80] ; 0x50 break; 28d4: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 28d8: e593005c ldr r0, [r3, #92] ; 0x5c break; 28dc: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 28e0: e5930060 ldr r0, [r3, #96] ; 0x60 break; 28e4: e49df004 pop {pc} ; (ldr pc, [sp], #4) default: rtems_set_errno_and_return_minus_one( EINVAL ); 28e8: eb0028cf bl cc2c <__errno> 28ec: e3a03016 mov r3, #22 28f0: e5803000 str r3, [r0] 28f4: e3e00000 mvn r0, #0 break; } return return_value; } 28f8: e49df004 pop {pc} ; (ldr pc, [sp], #4) =============================================================================== 00001d50 : */ int gettimeofday( struct timeval *tp, void * __tz __attribute__((unused)) ) { 1d50: e92d4033 push {r0, r1, r4, r5, lr} /* struct timezone* tzp = (struct timezone*) __tz; */ if ( !tp ) 1d54: e2504000 subs r4, r0, #0 1d58: 1a000004 bne 1d70 rtems_set_errno_and_return_minus_one( EFAULT ); 1d5c: eb0027cf bl bca0 <__errno> <== NOT EXECUTED 1d60: e3a0300e mov r3, #14 <== NOT EXECUTED 1d64: e5803000 str r3, [r0] <== NOT EXECUTED 1d68: e3e00000 mvn r0, #0 <== NOT EXECUTED 1d6c: ea00000c b 1da4 <== NOT EXECUTED static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 1d70: e10f5000 mrs r5, CPSR 1d74: e3853080 orr r3, r5, #128 ; 0x80 1d78: e129f003 msr CPSR_fc, r3 ISR_Level level; struct timespec now; suseconds_t useconds; _ISR_Disable(level); _TOD_Get( &now ); 1d7c: e1a0000d mov r0, sp 1d80: eb000f81 bl 5b8c <_TOD_Get> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 1d84: e129f005 msr CPSR_fc, r5 _ISR_Enable(level); useconds = (suseconds_t)now.tv_nsec; useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; time->tv_sec = now.tv_sec; 1d88: e59d3000 ldr r3, [sp] _ISR_Disable(level); _TOD_Get( &now ); _ISR_Enable(level); useconds = (suseconds_t)now.tv_nsec; useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; 1d8c: e59d0004 ldr r0, [sp, #4] time->tv_sec = now.tv_sec; 1d90: e5843000 str r3, [r4] _ISR_Disable(level); _TOD_Get( &now ); _ISR_Enable(level); useconds = (suseconds_t)now.tv_nsec; useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; 1d94: e3a01ffa mov r1, #1000 ; 0x3e8 1d98: eb0035a5 bl f434 <__aeabi_idiv> time->tv_sec = now.tv_sec; time->tv_usec = useconds; 1d9c: e5840004 str r0, [r4, #4] * Timezone information ignored by the OS proper. Per email * with Eric Norum, this is how GNU/Linux, Solaris, and MacOS X * do it. This puts us in good company. */ return 0; 1da0: e3a00000 mov r0, #0 } 1da4: e8bd803c pop {r2, r3, r4, r5, pc} =============================================================================== 0000b494 : 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 ) b494: e5903018 ldr r3, [r0, #24] b498: e593304c ldr r3, [r3, #76] ; 0x4c b49c: e3530001 cmp r3, #1 rtems_libio_t *iop, const char *pathname, uint32_t flag, uint32_t mode ) { b4a0: 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 ) b4a4: 1a000005 bne b4c0 return -1; /* It wasn't a directory --> return error */ iop->offset = 0; b4a8: e3a03000 mov r3, #0 b4ac: e3a04000 mov r4, #0 b4b0: e580300c str r3, [r0, #12] b4b4: e5804010 str r4, [r0, #16] return 0; b4b8: e3a00000 mov r0, #0 b4bc: 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 */ b4c0: e3e00000 mvn r0, #0 <== NOT EXECUTED iop->offset = 0; return 0; } b4c4: e8bd8010 pop {r4, pc} <== NOT EXECUTED =============================================================================== 000039b4 : * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { if (tty->termios.c_iflag & ISTRIP) 39b4: e5913030 ldr r3, [r1, #48] ; 0x30 39b8: e3130020 tst r3, #32 /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 39bc: e92d4030 push {r4, r5, lr} 39c0: e20050ff and r5, r0, #255 ; 0xff if (tty->termios.c_iflag & ISTRIP) c &= 0x7f; 39c4: 1200507f andne r5, r0, #127 ; 0x7f if (tty->termios.c_iflag & IUCLC) 39c8: e3130c02 tst r3, #512 ; 0x200 /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 39cc: e1a04001 mov r4, r1 if (tty->termios.c_iflag & ISTRIP) c &= 0x7f; if (tty->termios.c_iflag & IUCLC) 39d0: 0a000007 beq 39f4 c = tolower (c); 39d4: e59f2164 ldr r2, [pc, #356] ; 3b40 39d8: e5922000 ldr r2, [r2] 39dc: e0822005 add r2, r2, r5 39e0: e5d22001 ldrb r2, [r2, #1] 39e4: e2022003 and r2, r2, #3 39e8: e3520001 cmp r2, #1 39ec: 02855020 addeq r5, r5, #32 39f0: e20550ff and r5, r5, #255 ; 0xff if (c == '\r') { 39f4: e355000d cmp r5, #13 39f8: 1a000005 bne 3a14 if (tty->termios.c_iflag & IGNCR) 39fc: e3130080 tst r3, #128 ; 0x80 3a00: 1a000048 bne 3b28 return 0; if (tty->termios.c_iflag & ICRNL) c = '\n'; 3a04: e3130c01 tst r3, #256 ; 0x100 3a08: 03a0500d moveq r5, #13 3a0c: 13a0500a movne r5, #10 3a10: ea000007 b 3a34 } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { 3a14: e355000a cmp r5, #10 3a18: 1a000003 bne 3a2c c = '\r'; 3a1c: e3130040 tst r3, #64 ; 0x40 3a20: 03a0500a moveq r5, #10 3a24: 13a0500d movne r5, #13 3a28: ea000001 b 3a34 } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 3a2c: e3550000 cmp r5, #0 3a30: 0a00002c beq 3ae8 3a34: e594303c ldr r3, [r4, #60] ; 0x3c 3a38: e3130002 tst r3, #2 3a3c: 0a000029 beq 3ae8 if (c == tty->termios.c_cc[VERASE]) { 3a40: e5d42043 ldrb r2, [r4, #67] ; 0x43 3a44: e1520005 cmp r2, r5 erase (tty, 0); 3a48: 01a00004 moveq r0, r4 3a4c: 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]) { 3a50: 0a000004 beq 3a68 erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { 3a54: e5d42044 ldrb r2, [r4, #68] ; 0x44 3a58: e1520005 cmp r2, r5 3a5c: 1a000003 bne 3a70 erase (tty, 1); 3a60: e1a00004 mov r0, r4 3a64: e3a01001 mov r1, #1 3a68: ebffff60 bl 37f0 3a6c: ea00002d b 3b28 return 0; } else if (c == tty->termios.c_cc[VEOF]) { 3a70: e5d42045 ldrb r2, [r4, #69] ; 0x45 3a74: e1520005 cmp r2, r5 3a78: 0a00002c beq 3b30 return 1; } else if (c == '\n') { 3a7c: e355000a cmp r5, #10 3a80: 1a000008 bne 3aa8 if (tty->termios.c_lflag & (ECHO | ECHONL)) 3a84: e3130048 tst r3, #72 ; 0x48 echo (c, tty); 3a88: 11a00005 movne r0, r5 3a8c: 11a01004 movne r1, r4 3a90: 1bffff33 blne 3764 tty->cbuf[tty->ccount++] = c; 3a94: e284201c add r2, r4, #28 3a98: e892000c ldm r2, {r2, r3} 3a9c: e3a0100a mov r1, #10 3aa0: e7c21003 strb r1, [r2, r3] 3aa4: ea00000c b 3adc return 1; } else if ((c == tty->termios.c_cc[VEOL]) || 3aa8: e5d4204c ldrb r2, [r4, #76] ; 0x4c 3aac: e1520005 cmp r2, r5 3ab0: 0a000002 beq 3ac0 3ab4: e5d42051 ldrb r2, [r4, #81] ; 0x51 3ab8: e1520005 cmp r2, r5 3abc: 1a000009 bne 3ae8 (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) 3ac0: e3130008 tst r3, #8 <== NOT EXECUTED echo (c, tty); 3ac4: 11a00005 movne r0, r5 <== NOT EXECUTED 3ac8: 11a01004 movne r1, r4 <== NOT EXECUTED 3acc: 1bffff24 blne 3764 <== NOT EXECUTED tty->cbuf[tty->ccount++] = c; 3ad0: e284201c add r2, r4, #28 <== NOT EXECUTED 3ad4: e892000c ldm r2, {r2, r3} <== NOT EXECUTED 3ad8: e7c25003 strb r5, [r2, r3] <== NOT EXECUTED 3adc: e2833001 add r3, r3, #1 3ae0: e5843020 str r3, [r4, #32] 3ae4: ea000011 b 3b30 } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 3ae8: e59f3054 ldr r3, [pc, #84] ; 3b44 3aec: e5933008 ldr r3, [r3, #8] 3af0: e5942020 ldr r2, [r4, #32] 3af4: e2433001 sub r3, r3, #1 3af8: e1520003 cmp r2, r3 3afc: aa00000d bge 3b38 if (tty->termios.c_lflag & ECHO) 3b00: e594303c ldr r3, [r4, #60] ; 0x3c 3b04: e3130008 tst r3, #8 echo (c, tty); 3b08: 11a00005 movne r0, r5 3b0c: 11a01004 movne r1, r4 3b10: 1bffff13 blne 3764 tty->cbuf[tty->ccount++] = c; 3b14: e284201c add r2, r4, #28 3b18: e892000c ldm r2, {r2, r3} 3b1c: e7c25003 strb r5, [r2, r3] 3b20: e2833001 add r3, r3, #1 3b24: 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; 3b28: e3a00000 mov r0, #0 3b2c: 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; 3b30: e3a00001 mov r0, #1 3b34: 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; 3b38: e3a00000 mov r0, #0 <== NOT EXECUTED } 3b3c: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED =============================================================================== 0001f638 : #if !defined(RTEMS_POSIX_API) int kill( pid_t pid, int sig ) { return 0; } 1f638: e3a00000 mov r0, #0 <== NOT EXECUTED 1f63c: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 0000b204 : rtems_off64_t memfile_lseek( rtems_libio_t *iop, rtems_off64_t offset, int whence ) { b204: e92d4030 push {r4, r5, lr} IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; b208: e5905018 ldr r5, [r0, #24] if (the_jnode->type == IMFS_LINEAR_FILE) { b20c: e595304c ldr r3, [r5, #76] ; 0x4c b210: e3530006 cmp r3, #6 rtems_off64_t memfile_lseek( rtems_libio_t *iop, rtems_off64_t offset, int whence ) { b214: e1a04000 mov r4, r0 IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; if (the_jnode->type == IMFS_LINEAR_FILE) { b218: 1a00000b bne b24c if (iop->offset > the_jnode->info.linearfile.size) b21c: e5953054 ldr r3, [r5, #84] ; 0x54 b220: e5901010 ldr r1, [r0, #16] b224: e1510003 cmp r1, r3 b228: e5952050 ldr r2, [r5, #80] ; 0x50 b22c: ca000003 bgt b240 b230: 1a000014 bne b288 b234: e590100c ldr r1, [r0, #12] b238: e1510002 cmp r1, r2 b23c: 9a000011 bls b288 iop->offset = the_jnode->info.linearfile.size; b240: e584200c str r2, [r4, #12] <== NOT EXECUTED b244: e5843010 str r3, [r4, #16] <== NOT EXECUTED b248: ea00000e b b288 <== NOT EXECUTED } else { /* Must be a block file (IMFS_MEMORY_FILE). */ if (IMFS_memfile_extend( the_jnode, iop->offset )) b24c: e1a00005 mov r0, r5 b250: e284200c add r2, r4, #12 b254: e8920006 ldm r2, {r1, r2} b258: ebfffeed bl ae14 b25c: e3500000 cmp r0, #0 b260: 0a000005 beq b27c rtems_set_errno_and_return_minus_one( ENOSPC ); b264: eb00028d bl bca0 <__errno> b268: e3a0301c mov r3, #28 b26c: e5803000 str r3, [r0] b270: e3e04000 mvn r4, #0 b274: e3e03000 mvn r3, #0 b278: ea000004 b b290 iop->size = the_jnode->info.file.size; b27c: e2853050 add r3, r5, #80 ; 0x50 b280: e893000c ldm r3, {r2, r3} b284: e984000c stmib r4, {r2, r3} } return iop->offset; b288: e284400c add r4, r4, #12 b28c: e8940018 ldm r4, {r3, r4} } b290: e1a00003 mov r0, r3 b294: e1a01004 mov r1, r4 b298: e8bd8030 pop {r4, r5, pc} =============================================================================== 0000b110 : the_jnode = iop->pathinfo.node_access; /* * Perform 'copy on write' for linear files */ if ((iop->flags & (LIBIO_FLAGS_WRITE | LIBIO_FLAGS_APPEND)) b110: e5903014 ldr r3, [r0, #20] b114: e3130f81 tst r3, #516 ; 0x204 rtems_libio_t *iop, const char *pathname, uint32_t flag, uint32_t mode ) { b118: e92d4031 push {r0, r4, r5, lr} b11c: e1a05000 mov r5, r0 IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; b120: e5904018 ldr r4, [r0, #24] /* * Perform 'copy on write' for linear files */ if ((iop->flags & (LIBIO_FLAGS_WRITE | LIBIO_FLAGS_APPEND)) b124: 0a000015 beq b180 && (the_jnode->type == IMFS_LINEAR_FILE)) { b128: e594304c ldr r3, [r4, #76] ; 0x4c b12c: e3530006 cmp r3, #6 b130: 1a000012 bne b180 uint32_t count = the_jnode->info.linearfile.size; b134: 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; b138: 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; b13c: e3a02005 mov r2, #5 <== NOT EXECUTED b140: e584204c str r2, [r4, #76] ; 0x4c <== NOT EXECUTED the_jnode->info.file.size = 0; b144: e3a01000 mov r1, #0 <== NOT EXECUTED b148: 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) b14c: 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; b150: e5943058 ldr r3, [r4, #88] ; 0x58 <== NOT EXECUTED the_jnode->type = IMFS_MEMORY_FILE; the_jnode->info.file.size = 0; b154: e5841050 str r1, [r4, #80] ; 0x50 <== NOT EXECUTED b158: e5842054 str r2, [r4, #84] ; 0x54 <== NOT EXECUTED the_jnode->info.file.indirect = 0; b15c: e5840058 str r0, [r4, #88] ; 0x58 <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; b160: e584005c str r0, [r4, #92] ; 0x5c <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; b164: e5840060 str r0, [r4, #96] ; 0x60 <== NOT EXECUTED if ((count != 0) b168: 0a000004 beq b180 <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) b16c: e1a00004 mov r0, r4 <== NOT EXECUTED b170: e58dc000 str ip, [sp] <== NOT EXECUTED b174: ebffff6d bl af30 <== NOT EXECUTED b178: e3700001 cmn r0, #1 <== NOT EXECUTED b17c: 0a000009 beq b1a8 <== NOT EXECUTED return -1; } if (iop->flags & LIBIO_FLAGS_APPEND) b180: e5953014 ldr r3, [r5, #20] b184: e3130c02 tst r3, #512 ; 0x200 iop->offset = the_jnode->info.file.size; b188: 12843050 addne r3, r4, #80 ; 0x50 b18c: 1893000c ldmne r3, {r2, r3} b190: 1585200c strne r2, [r5, #12] b194: 15853010 strne r3, [r5, #16] iop->size = the_jnode->info.file.size; b198: e2844050 add r4, r4, #80 ; 0x50 b19c: e8940018 ldm r4, {r3, r4} b1a0: e9850018 stmib r5, {r3, r4} return 0; b1a4: e3a00000 mov r0, #0 } b1a8: e8bd8038 pop {r3, r4, r5, pc} =============================================================================== 00002220 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 2220: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} /* * Are the file system options valid? */ if ( options != RTEMS_FILESYSTEM_READ_ONLY && 2224: e3530001 cmp r3, #1 const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 2228: e24dd02c sub sp, sp, #44 ; 0x2c 222c: e1a06000 mov r6, r0 2230: e1a0b001 mov fp, r1 2234: e1a0a002 mov sl, r2 2238: e58d300c str r3, [sp, #12] /* * Are the file system options valid? */ if ( options != RTEMS_FILESYSTEM_READ_ONLY && 223c: 8a000004 bhi 2254 rtems_set_errno_and_return_minus_one( EINVAL ); /* * Get mount handler */ mount_h = rtems_filesystem_get_mount_handler( filesystemtype ); 2240: e1a00002 mov r0, r2 2244: eb001d42 bl 9754 if ( !mount_h ) 2248: e3500000 cmp r0, #0 224c: e58d0014 str r0, [sp, #20] 2250: 1a000002 bne 2260 rtems_set_errno_and_return_minus_one( EINVAL ); 2254: eb002691 bl bca0 <__errno> 2258: e3a03016 mov r3, #22 225c: ea00003b b 2350 { 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; 2260: e25b5000 subs r5, fp, #0 2264: 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 : "/"; 2268: e59f3258 ldr r3, [pc, #600] ; 24c8 226c: e3550000 cmp r5, #0 2270: 11a0300b movne r3, fp size_t filesystemtype_size = strlen( filesystemtype ) + 1; 2274: 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 : "/"; 2278: e58d3004 str r3, [sp, #4] size_t filesystemtype_size = strlen( filesystemtype ) + 1; 227c: eb002a71 bl cc48 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 2280: 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; 2284: e2809001 add r9, r0, #1 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 2288: 01a07006 moveq r7, r6 228c: 0a000002 beq 229c 2290: e1a00006 mov r0, r6 2294: eb002a6b bl cc48 2298: e2807001 add r7, r0, #1 size_t target_size = strlen( target ) + 1; 229c: e59d0004 ldr r0, [sp, #4] 22a0: eb002a68 bl cc48 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size; 22a4: 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; 22a8: e2803001 add r3, r0, #1 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size; 22ac: 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; 22b0: 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 ); 22b4: e0811003 add r1, r1, r3 22b8: 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; 22bc: 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 ); 22c0: ebfffe15 bl 1b1c if ( mt_entry != NULL ) { 22c4: e2504000 subs r4, r0, #0 22c8: 0a00001e beq 2348 char *str = (char *) mt_entry + sizeof( *mt_entry ); 22cc: e2848074 add r8, r4, #116 ; 0x74 memcpy( str, filesystemtype, filesystemtype_size ); 22d0: e1a00008 mov r0, r8 22d4: e1a0100a mov r1, sl 22d8: e1a02009 mov r2, r9 22dc: eb00289d bl c558 mt_entry->type = str; 22e0: e584806c str r8, [r4, #108] ; 0x6c str += filesystemtype_size; 22e4: e0888009 add r8, r8, r9 memcpy( str, source_or_null, source_size ); 22e8: e1a00008 mov r0, r8 22ec: e1a01006 mov r1, r6 22f0: e1a02007 mov r2, r7 22f4: eb002897 bl c558 mt_entry->dev = str; 22f8: e5848070 str r8, [r4, #112] ; 0x70 str += source_size; 22fc: e0888007 add r8, r8, r7 memcpy( str, target, target_size ); 2300: e99d0006 ldmib sp, {r1, r2} 2304: e1a00008 mov r0, r8 2308: eb002892 bl c558 ); if ( !mt_entry ) rtems_set_errno_and_return_minus_one( ENOMEM ); mt_entry->mt_fs_root.mt_entry = mt_entry; mt_entry->options = options; 230c: e59d300c ldr r3, [sp, #12] mt_entry->pathconf_limits_and_options = rtems_filesystem_default_pathconf; 2310: e59fe1b4 ldr lr, [pc, #436] ; 24cc ); if ( !mt_entry ) rtems_set_errno_and_return_minus_one( ENOMEM ); mt_entry->mt_fs_root.mt_entry = mt_entry; mt_entry->options = options; 2314: e5843030 str r3, [r4, #48] ; 0x30 mt_entry->pathconf_limits_and_options = rtems_filesystem_default_pathconf; 2318: e8be000f ldm lr!, {r0, r1, r2, r3} 231c: e284c038 add ip, r4, #56 ; 0x38 2320: e8ac000f stmia ip!, {r0, r1, r2, r3} 2324: e8be000f ldm lr!, {r0, r1, r2, r3} 2328: e8ac000f stmia ip!, {r0, r1, r2, r3} 232c: 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 ) { 2330: 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; 2334: 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; 2338: e584402c str r4, [r4, #44] ; 0x2c mt_entry->options = options; mt_entry->pathconf_limits_and_options = rtems_filesystem_default_pathconf; 233c: 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 ) { 2340: 0a00002e beq 2400 2344: ea000003 b 2358 target, filesystemtype, &target_length ); if ( !mt_entry ) rtems_set_errno_and_return_minus_one( ENOMEM ); 2348: eb002654 bl bca0 <__errno> <== NOT EXECUTED 234c: e3a0300c mov r3, #12 <== NOT EXECUTED 2350: e5803000 str r3, [r0] 2354: ea000058 b 24bc * The mount_point should be a directory with read/write/execute * permissions in the existing tree. */ if ( has_target ) { if ( rtems_filesystem_evaluate_path( 2358: e3a03001 mov r3, #1 235c: e28d6018 add r6, sp, #24 2360: e58d3000 str r3, [sp] 2364: e1a0000b mov r0, fp 2368: e59d1010 ldr r1, [sp, #16] 236c: e3a02007 mov r2, #7 2370: e1a03006 mov r3, r6 2374: ebfffe17 bl 1bd8 2378: e3700001 cmn r0, #1 237c: 0a000048 beq 24a4 /* * Test to see if it is a directory */ if ( loc.ops->node_type_h( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 2380: e1a00006 mov r0, r6 2384: e59d3024 ldr r3, [sp, #36] ; 0x24 2388: e1a0e00f mov lr, pc 238c: e593f010 ldr pc, [r3, #16] 2390: e3500001 cmp r0, #1 2394: 0a000002 beq 23a4 errno = ENOTDIR; 2398: eb002640 bl bca0 <__errno> 239c: e3a03014 mov r3, #20 23a0: ea000006 b 23c0 /* * You can only mount one file system onto a single mount point. */ if ( rtems_filesystem_mount_iterate( is_node_fs_root, loc.node_access ) ) { 23a4: e59f0124 ldr r0, [pc, #292] ; 24d0 23a8: e59d1018 ldr r1, [sp, #24] 23ac: ebffff85 bl 21c8 23b0: e3500000 cmp r0, #0 23b4: 0a000003 beq 23c8 errno = EBUSY; 23b8: eb002638 bl bca0 <__errno> 23bc: e3a03010 mov r3, #16 23c0: e5803000 str r3, [r0] goto cleanup_and_bail; 23c4: ea000037 b 24a8 * 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; 23c8: e59d3018 ldr r3, [sp, #24] 23cc: e5843008 str r3, [r4, #8] mt_entry->mt_point_node.handlers = loc.handlers; 23d0: e59d3020 ldr r3, [sp, #32] mt_entry->mt_point_node.ops = loc.ops; mt_entry->mt_point_node.mt_entry = loc.mt_entry; 23d4: 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; 23d8: e5843010 str r3, [r4, #16] mt_entry->mt_point_node.ops = loc.ops; 23dc: e59d3024 ldr r3, [sp, #36] ; 0x24 mt_entry->mt_point_node.mt_entry = loc.mt_entry; 23e0: 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; 23e4: 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 ) ) { 23e8: e1a00004 mov r0, r4 23ec: e1a0e00f mov lr, pc 23f0: e593f020 ldr pc, [r3, #32] 23f4: e3500000 cmp r0, #0 23f8: 0a00000b beq 242c 23fc: ea000029 b 24a8 <== NOT EXECUTED stop = (*routine)( mt_entry, routine_arg ); } rtems_libio_unlock(); return stop; } 2400: e59f30cc ldr r3, [pc, #204] ; 24d4 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail( const Chain_Control *the_chain ) { return &the_chain->Tail.Node; 2404: e2832004 add r2, r3, #4 } } else { /* * Do we already have a base file system ? */ if ( !rtems_chain_is_empty( &mount_chain ) ) { 2408: e5933000 ldr r3, [r3] 240c: 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; 2410: 01a06005 moveq r6, r5 } } else { /* * Do we already have a base file system ? */ if ( !rtems_chain_is_empty( &mount_chain ) ) { 2414: 0a000004 beq 242c errno = EINVAL; 2418: eb002620 bl bca0 <__errno> <== NOT EXECUTED 241c: e3a03016 mov r3, #22 <== NOT EXECUTED 2420: e5803000 str r3, [r0] <== NOT EXECUTED ) { 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; 2424: e1a06005 mov r6, r5 <== NOT EXECUTED /* * Do we already have a base file system ? */ if ( !rtems_chain_is_empty( &mount_chain ) ) { errno = EINVAL; goto cleanup_and_bail; 2428: ea00001e b 24a8 <== NOT EXECUTED * 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 ) ) { 242c: e1a00004 mov r0, r4 2430: e59d1050 ldr r1, [sp, #80] ; 0x50 2434: e59d3014 ldr r3, [sp, #20] 2438: e1a0e00f mov lr, pc 243c: e12fff13 bx r3 2440: e2507000 subs r7, r0, #0 2444: 0a000004 beq 245c /* * Try to undo the mount operation */ loc.ops->unmount_h( mt_entry ); 2448: e1a00004 mov r0, r4 244c: e59d3024 ldr r3, [sp, #36] ; 0x24 2450: e1a0e00f mov lr, pc 2454: e593f028 ldr pc, [r3, #40] ; 0x28 goto cleanup_and_bail; 2458: ea000012 b 24a8 } /* * Add the mount table entry to the mount table chain */ rtems_libio_lock(); 245c: ebffff4f bl 21a0 2460: e59f006c ldr r0, [pc, #108] ; 24d4 2464: e1a01004 mov r1, r4 2468: eb000cc9 bl 5794 <_Chain_Append> rtems_chain_append( &mount_chain, &mt_entry->Node ); rtems_libio_unlock(); 246c: ebffff51 bl 21b8 if ( !has_target ) 2470: e3550000 cmp r5, #0 rtems_filesystem_root = mt_entry->mt_fs_root; return 0; 2474: 11a00007 movne r0, r7 */ rtems_libio_lock(); rtems_chain_append( &mount_chain, &mt_entry->Node ); rtems_libio_unlock(); if ( !has_target ) 2478: 1a000010 bne 24c0 rtems_filesystem_root = mt_entry->mt_fs_root; 247c: e59f3054 ldr r3, [pc, #84] ; 24d8 2480: e284401c add r4, r4, #28 2484: e593c000 ldr ip, [r3] 2488: e8b4000f ldm r4!, {r0, r1, r2, r3} 248c: e28cc018 add ip, ip, #24 2490: e8ac000f stmia ip!, {r0, r1, r2, r3} 2494: e5943000 ldr r3, [r4] return 0; 2498: 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; 249c: e58c3000 str r3, [ip] 24a0: ea000006 b 24c0 ) { 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; 24a4: e3a06000 mov r6, #0 <== NOT EXECUTED return 0; cleanup_and_bail: free( mt_entry ); 24a8: e1a00004 mov r0, r4 24ac: ebfffdfe bl 1cac if ( loc_to_free ) 24b0: e3560000 cmp r6, #0 rtems_filesystem_freenode( loc_to_free ); 24b4: 11a00006 movne r0, r6 24b8: 1bfffdf6 blne 1c98 return -1; 24bc: e3e00000 mvn r0, #0 } 24c0: e28dd02c add sp, sp, #44 ; 0x2c 24c4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 000024e0 : */ int newlib_free_buffers( FILE *fp ) { 24e0: e92d4010 push {r4, lr} 24e4: e1a04000 mov r4, r0 switch ( fileno(fp) ) { 24e8: eb0026ef bl c0ac 24ec: e3500002 cmp r0, #2 24f0: 8a00000b bhi 2524 case 0: case 1: case 2: if (fp->_flags & __SMBF) { 24f4: e1d430bc ldrh r3, [r4, #12] 24f8: e3130080 tst r3, #128 ; 0x80 24fc: 0a00000a beq 252c free( fp->_bf._base ); 2500: e5940010 ldr r0, [r4, #16] 2504: ebfffde8 bl 1cac <== NOT EXECUTED fp->_flags &= ~__SMBF; 2508: e1d430bc ldrh r3, [r4, #12] <== NOT EXECUTED 250c: e3c33080 bic r3, r3, #128 ; 0x80 <== NOT EXECUTED 2510: e1c430bc strh r3, [r4, #12] <== NOT EXECUTED fp->_bf._base = fp->_p = (unsigned char *) NULL; 2514: e3a03000 mov r3, #0 <== NOT EXECUTED 2518: e5843000 str r3, [r4] <== NOT EXECUTED 251c: e5843010 str r3, [r4, #16] <== NOT EXECUTED 2520: ea000001 b 252c <== NOT EXECUTED } break; default: fclose(fp); 2524: e1a00004 mov r0, r4 <== NOT EXECUTED 2528: eb00262a bl bdd8 <== NOT EXECUTED } return 0; } 252c: e3a00000 mov r0, #0 2530: e8bd8010 pop {r4, pc} =============================================================================== 00003614 : /* * Handle output processing */ static void oproc (unsigned char c, struct rtems_termios_tty *tty) { 3614: e92d4011 push {r0, r4, lr} 3618: e5cd0000 strb r0, [sp] int i; if (tty->termios.c_oflag & OPOST) { 361c: e5913034 ldr r3, [r1, #52] ; 0x34 3620: e3130001 tst r3, #1 /* * Handle output processing */ static void oproc (unsigned char c, struct rtems_termios_tty *tty) { 3624: e1a04001 mov r4, r1 int i; if (tty->termios.c_oflag & OPOST) { 3628: 0a000045 beq 3744 switch (c) { 362c: e5dd2000 ldrb r2, [sp] 3630: e2421008 sub r1, r2, #8 3634: e3510005 cmp r1, #5 3638: 979ff101 ldrls pc, [pc, r1, lsl #2] 363c: ea00002c b 36f4 3640: 000036e0 .word 0x000036e0 3644: 000036b8 .word 0x000036b8 3648: 00003658 .word 0x00003658 364c: 000036f4 .word 0x000036f4 3650: 000036f4 .word 0x000036f4 3654: 00003680 .word 0x00003680 case '\n': if (tty->termios.c_oflag & ONLRET) 3658: e3130020 tst r3, #32 tty->column = 0; 365c: 13a02000 movne r2, #0 3660: 15842028 strne r2, [r4, #40] ; 0x28 if (tty->termios.c_oflag & ONLCR) { 3664: e3130004 tst r3, #4 3668: 0a000035 beq 3744 rtems_termios_puts ("\r", 1, tty); 366c: e59f00e4 ldr r0, [pc, #228] ; 3758 3670: e3a01001 mov r1, #1 3674: e1a02004 mov r2, r4 3678: ebffffa5 bl 3514 367c: ea00000b b 36b0 tty->column = 0; } break; case '\r': if ((tty->termios.c_oflag & ONOCR) && (tty->column == 0)) 3680: e3130010 tst r3, #16 <== NOT EXECUTED 3684: 0a000002 beq 3694 <== NOT EXECUTED 3688: e5942028 ldr r2, [r4, #40] ; 0x28 <== NOT EXECUTED 368c: e3520000 cmp r2, #0 <== NOT EXECUTED 3690: 0a00002f beq 3754 <== NOT EXECUTED return; if (tty->termios.c_oflag & OCRNL) { 3694: e2132008 ands r2, r3, #8 <== NOT EXECUTED c = '\n'; if (tty->termios.c_oflag & ONLRET) tty->column = 0; break; } tty->column = 0; 3698: 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) { 369c: 0a000028 beq 3744 <== NOT EXECUTED c = '\n'; 36a0: e3a0200a mov r2, #10 <== NOT EXECUTED if (tty->termios.c_oflag & ONLRET) 36a4: 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'; 36a8: e5cd2000 strb r2, [sp] <== NOT EXECUTED if (tty->termios.c_oflag & ONLRET) 36ac: 0a000024 beq 3744 <== NOT EXECUTED tty->column = 0; 36b0: e3a03000 mov r3, #0 36b4: ea000021 b 3740 } tty->column = 0; break; case '\t': i = 8 - (tty->column & 7); 36b8: e5942028 ldr r2, [r4, #40] ; 0x28 36bc: e2021007 and r1, r2, #7 if ((tty->termios.c_oflag & TABDLY) == XTABS) { 36c0: e2033b06 and r3, r3, #6144 ; 0x1800 } tty->column = 0; break; case '\t': i = 8 - (tty->column & 7); 36c4: e2611008 rsb r1, r1, #8 if ((tty->termios.c_oflag & TABDLY) == XTABS) { 36c8: e3530b06 cmp r3, #6144 ; 0x1800 36cc: e0813002 add r3, r1, r2 tty->column += i; 36d0: 05843028 streq r3, [r4, #40] ; 0x28 rtems_termios_puts ( " ", i, tty); 36d4: 059f0080 ldreq r0, [pc, #128] ; 375c tty->column = 0; break; case '\t': i = 8 - (tty->column & 7); if ((tty->termios.c_oflag & TABDLY) == XTABS) { 36d8: 1a000018 bne 3740 36dc: ea00001a b 374c } tty->column += i; break; case '\b': if (tty->column > 0) 36e0: e5943028 ldr r3, [r4, #40] ; 0x28 <== NOT EXECUTED 36e4: e3530000 cmp r3, #0 <== NOT EXECUTED tty->column--; 36e8: c2433001 subgt r3, r3, #1 <== NOT EXECUTED } tty->column += i; break; case '\b': if (tty->column > 0) 36ec: ca000013 bgt 3740 <== NOT EXECUTED 36f0: ea000013 b 3744 <== NOT EXECUTED tty->column--; break; default: if (tty->termios.c_oflag & OLCUC) 36f4: e3130002 tst r3, #2 36f8: 0a000007 beq 371c c = toupper(c); 36fc: e59f305c ldr r3, [pc, #92] ; 3760 <== NOT EXECUTED 3700: e5933000 ldr r3, [r3] <== NOT EXECUTED 3704: e0833002 add r3, r3, r2 <== NOT EXECUTED 3708: e5d33001 ldrb r3, [r3, #1] <== NOT EXECUTED 370c: e2033003 and r3, r3, #3 <== NOT EXECUTED 3710: e3530002 cmp r3, #2 <== NOT EXECUTED 3714: 02422020 subeq r2, r2, #32 <== NOT EXECUTED 3718: e5cd2000 strb r2, [sp] <== NOT EXECUTED if (!iscntrl(c)) 371c: e59f203c ldr r2, [pc, #60] ; 3760 3720: e5dd3000 ldrb r3, [sp] 3724: e5922000 ldr r2, [r2] 3728: e0823003 add r3, r2, r3 372c: e5d33001 ldrb r3, [r3, #1] 3730: e3130020 tst r3, #32 3734: 1a000002 bne 3744 tty->column++; 3738: e5943028 ldr r3, [r4, #40] ; 0x28 373c: e2833001 add r3, r3, #1 3740: e5843028 str r3, [r4, #40] ; 0x28 break; } } rtems_termios_puts (&c, 1, tty); 3744: e1a0000d mov r0, sp 3748: e3a01001 mov r1, #1 374c: e1a02004 mov r2, r4 3750: ebffff6f bl 3514 } 3754: e8bd8018 pop {r3, r4, pc} =============================================================================== 0000b920 : uint32_t cmd, void *buffer, rtems_libio_t *iop ) { if (cmd == FIONREAD) { b920: e59f3058 ldr r3, [pc, #88] ; b980 b924: e1510003 cmp r1, r3 pipe_control_t *pipe, uint32_t cmd, void *buffer, rtems_libio_t *iop ) { b928: e92d4070 push {r4, r5, r6, lr} b92c: e1a04000 mov r4, r0 b930: e1a05002 mov r5, r2 *(unsigned int *)buffer = pipe->Length; PIPE_UNLOCK(pipe); return 0; } return -EINVAL; b934: 13e00015 mvnne r0, #21 uint32_t cmd, void *buffer, rtems_libio_t *iop ) { if (cmd == FIONREAD) { b938: 18bd8070 popne {r4, r5, r6, pc} if (buffer == NULL) b93c: e3520000 cmp r2, #0 return -EFAULT; b940: 03e0000d mvneq r0, #13 void *buffer, rtems_libio_t *iop ) { if (cmd == FIONREAD) { if (buffer == NULL) b944: 08bd8070 popeq {r4, r5, r6, pc} return -EFAULT; if (! PIPE_LOCK(pipe)) b948: e3a01000 mov r1, #0 b94c: e5940028 ldr r0, [r4, #40] ; 0x28 b950: e1a02001 mov r2, r1 b954: ebffed2d bl 6e10 b958: e2506000 subs r6, r0, #0 b95c: 1a000005 bne b978 return -EINTR; /* Return length of pipe */ *(unsigned int *)buffer = pipe->Length; b960: e594300c ldr r3, [r4, #12] PIPE_UNLOCK(pipe); b964: e5940028 ldr r0, [r4, #40] ; 0x28 if (! PIPE_LOCK(pipe)) return -EINTR; /* Return length of pipe */ *(unsigned int *)buffer = pipe->Length; b968: e5853000 str r3, [r5] PIPE_UNLOCK(pipe); b96c: ebffed6d bl 6f28 return 0; b970: e1a00006 mov r0, r6 b974: e8bd8070 pop {r4, r5, r6, pc} if (cmd == FIONREAD) { if (buffer == NULL) return -EFAULT; if (! PIPE_LOCK(pipe)) return -EINTR; b978: e3e00003 mvn r0, #3 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; } return -EINVAL; } b97c: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED =============================================================================== 0000b608 : pipe_control_t *pipe, void *buffer, size_t count, rtems_libio_t *iop ) { b608: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr} b60c: e1a09001 mov r9, r1 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) b610: e3a01000 mov r1, #0 pipe_control_t *pipe, void *buffer, size_t count, rtems_libio_t *iop ) { b614: e1a04000 mov r4, r0 b618: e1a05002 mov r5, r2 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) b61c: e5900028 ldr r0, [r0, #40] ; 0x28 b620: e1a02001 mov r2, r1 pipe_control_t *pipe, void *buffer, size_t count, rtems_libio_t *iop ) { b624: e1a0a003 mov sl, r3 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) b628: ebffedf8 bl 6e10 b62c: e2506000 subs r6, r0, #0 /* For buffering optimization */ if (PIPE_EMPTY(pipe)) pipe->Start = 0; if (pipe->waitingWriters > 0) PIPE_WAKEUPWRITERS(pipe); b630: 01a0b00d moveq fp, sp rtems_libio_t *iop ) { int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) b634: 0a000043 beq b748 b638: ea00004e b b778 <== NOT EXECUTED return -EINTR; while (read < count) { while (PIPE_EMPTY(pipe)) { /* Not an error */ if (pipe->Writers == 0) b63c: e5947014 ldr r7, [r4, #20] b640: e3570000 cmp r7, #0 b644: 0a000044 beq b75c goto out_locked; if (LIBIO_NODELAY(iop)) { b648: e59a8014 ldr r8, [sl, #20] b64c: e2188001 ands r8, r8, #1 b650: 1a000040 bne b758 ret = -EAGAIN; goto out_locked; } /* Wait until pipe is no more empty or no writer exists */ pipe->waitingReaders ++; b654: e5943018 ldr r3, [r4, #24] b658: e2833001 add r3, r3, #1 b65c: e5843018 str r3, [r4, #24] PIPE_UNLOCK(pipe); b660: e5940028 ldr r0, [r4, #40] ; 0x28 b664: ebffee2f bl 6f28 if (! PIPE_READWAIT(pipe)) b668: e1a01008 mov r1, r8 b66c: e594002c ldr r0, [r4, #44] ; 0x2c b670: eb000385 bl c48c b674: e3500000 cmp r0, #0 b678: 01a07000 moveq r7, r0 b67c: 13e07003 mvnne r7, #3 ret = -EINTR; if (! PIPE_LOCK(pipe)) { b680: e1a01008 mov r1, r8 b684: e5940028 ldr r0, [r4, #40] ; 0x28 b688: e1a02008 mov r2, r8 b68c: ebffeddf bl 6e10 b690: e3500000 cmp r0, #0 b694: 1a000033 bne b768 /* WARN waitingReaders not restored! */ ret = -EINTR; goto out_nolock; } pipe->waitingReaders --; b698: e5943018 ldr r3, [r4, #24] if (ret != 0) b69c: e3570000 cmp r7, #0 if (! PIPE_LOCK(pipe)) { /* WARN waitingReaders not restored! */ ret = -EINTR; goto out_nolock; } pipe->waitingReaders --; b6a0: e2433001 sub r3, r3, #1 b6a4: e5843018 str r3, [r4, #24] if (ret != 0) b6a8: 1a00002b bne b75c if (! PIPE_LOCK(pipe)) return -EINTR; while (read < count) { while (PIPE_EMPTY(pipe)) { b6ac: e594300c ldr r3, [r4, #12] b6b0: e3530000 cmp r3, #0 b6b4: 0affffe0 beq b63c if (ret != 0) goto out_locked; } /* Read chunk bytes */ chunk = MIN(count - read, pipe->Length); b6b8: e0667005 rsb r7, r6, r5 b6bc: e1530007 cmp r3, r7 b6c0: 31a07003 movcc r7, r3 chunk1 = pipe->Size - pipe->Start; b6c4: e5948004 ldr r8, [r4, #4] b6c8: e5943008 ldr r3, [r4, #8] b6cc: e5941000 ldr r1, [r4] b6d0: e0638008 rsb r8, r3, r8 if (chunk > chunk1) { b6d4: e1570008 cmp r7, r8 b6d8: 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); b6dc: d0811003 addle r1, r1, r3 b6e0: d1a02007 movle r2, r7 } /* Read chunk bytes */ chunk = MIN(count - read, pipe->Length); chunk1 = pipe->Size - pipe->Start; if (chunk > chunk1) { b6e4: da000006 ble b704 memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk1); b6e8: e0811003 add r1, r1, r3 b6ec: e1a02008 mov r2, r8 b6f0: eb000c96 bl e950 memcpy(buffer + read + chunk1, pipe->Buffer, chunk - chunk1); b6f4: e0860008 add r0, r6, r8 b6f8: e5941000 ldr r1, [r4] b6fc: e0890000 add r0, r9, r0 b700: e0682007 rsb r2, r8, r7 } else memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk); b704: eb000c91 bl e950 pipe->Start += chunk; b708: e5940008 ldr r0, [r4, #8] pipe->Start %= pipe->Size; b70c: e5941004 ldr r1, [r4, #4] b710: e0870000 add r0, r7, r0 b714: eb0038d8 bl 19a7c <__umodsi3> pipe->Length -= chunk; b718: e594300c ldr r3, [r4, #12] b71c: e0673003 rsb r3, r7, r3 /* For buffering optimization */ if (PIPE_EMPTY(pipe)) b720: e3530000 cmp r3, #0 } else memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk); pipe->Start += chunk; pipe->Start %= pipe->Size; b724: e5840008 str r0, [r4, #8] pipe->Length -= chunk; b728: e584300c str r3, [r4, #12] /* For buffering optimization */ if (PIPE_EMPTY(pipe)) pipe->Start = 0; b72c: 05843008 streq r3, [r4, #8] if (pipe->waitingWriters > 0) b730: e594301c ldr r3, [r4, #28] b734: e3530000 cmp r3, #0 PIPE_WAKEUPWRITERS(pipe); b738: 15940030 ldrne r0, [r4, #48] ; 0x30 b73c: 11a0100d movne r1, sp b740: 1b00033b blne c434 read += chunk; b744: e0866007 add r6, r6, r7 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) return -EINTR; while (read < count) { b748: e1560005 cmp r6, r5 b74c: 3affffd6 bcc b6ac b750: e3a07000 mov r7, #0 b754: ea000000 b b75c /* Not an error */ if (pipe->Writers == 0) goto out_locked; if (LIBIO_NODELAY(iop)) { ret = -EAGAIN; b758: e3e0700a mvn r7, #10 PIPE_WAKEUPWRITERS(pipe); read += chunk; } out_locked: PIPE_UNLOCK(pipe); b75c: e5940028 ldr r0, [r4, #40] ; 0x28 b760: ebffedf0 bl 6f28 b764: ea000000 b b76c PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) ret = -EINTR; if (! PIPE_LOCK(pipe)) { /* WARN waitingReaders not restored! */ ret = -EINTR; b768: e3e07003 mvn r7, #3 <== NOT EXECUTED PIPE_UNLOCK(pipe); out_nolock: if (read > 0) return read; return ret; b76c: e3560000 cmp r6, #0 b770: d1a06007 movle r6, r7 b774: ea000000 b b77c ) { int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) return -EINTR; b778: e3e06003 mvn r6, #3 <== NOT EXECUTED out_nolock: if (read > 0) return read; return ret; } b77c: e1a00006 mov r0, r6 b780: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 0000b784 : pipe_control_t *pipe, const void *buffer, size_t count, rtems_libio_t *iop ) { b784: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr} int chunk, chunk1, written = 0, ret = 0; /* Write nothing */ if (count == 0) b788: e2527000 subs r7, r2, #0 pipe_control_t *pipe, const void *buffer, size_t count, rtems_libio_t *iop ) { b78c: e1a04000 mov r4, r0 b790: e1a0b001 mov fp, r1 b794: e1a08003 mov r8, r3 int chunk, chunk1, written = 0, ret = 0; /* Write nothing */ if (count == 0) return 0; b798: 01a05007 moveq r5, r7 ) { int chunk, chunk1, written = 0, ret = 0; /* Write nothing */ if (count == 0) b79c: 0a00005d beq b918 return 0; if (! PIPE_LOCK(pipe)) b7a0: e3a01000 mov r1, #0 b7a4: e5900028 ldr r0, [r0, #40] ; 0x28 b7a8: e1a02001 mov r2, r1 b7ac: ebffed97 bl 6e10 b7b0: e3500000 cmp r0, #0 return -EINTR; b7b4: 13e05003 mvnne r5, #3 /* Write nothing */ if (count == 0) return 0; if (! PIPE_LOCK(pipe)) b7b8: 1a000056 bne b918 return -EINTR; if (pipe->Readers == 0) { b7bc: e5945010 ldr r5, [r4, #16] b7c0: e3550000 cmp r5, #0 b7c4: 0a00004c beq b8fc ret = -EPIPE; goto out_locked; } /* Write of PIPE_BUF bytes or less shall not be interleaved */ chunk = count <= pipe->Size ? count : 1; b7c8: e5949004 ldr r9, [r4, #4] b7cc: e1570009 cmp r7, r9 b7d0: 91a09007 movls r9, r7 b7d4: 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; b7d8: e1a05000 mov r5, r0 b7dc: ea000040 b b8e4 /* 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)) { b7e0: e598a014 ldr sl, [r8, #20] b7e4: e21aa001 ands sl, sl, #1 b7e8: 1a000041 bne b8f4 ret = -EAGAIN; goto out_locked; } /* Wait until there is chunk bytes space or no reader exists */ pipe->waitingWriters ++; b7ec: e594301c ldr r3, [r4, #28] b7f0: e2833001 add r3, r3, #1 b7f4: e584301c str r3, [r4, #28] PIPE_UNLOCK(pipe); b7f8: e5940028 ldr r0, [r4, #40] ; 0x28 b7fc: ebffedc9 bl 6f28 if (! PIPE_WRITEWAIT(pipe)) b800: e1a0100a mov r1, sl b804: e5940030 ldr r0, [r4, #48] ; 0x30 b808: eb00031f bl c48c b80c: e3500000 cmp r0, #0 b810: 01a06000 moveq r6, r0 b814: 13e06003 mvnne r6, #3 ret = -EINTR; if (! PIPE_LOCK(pipe)) { b818: e1a0100a mov r1, sl b81c: e5940028 ldr r0, [r4, #40] ; 0x28 b820: e1a0200a mov r2, sl b824: ebffed79 bl 6e10 b828: e3500000 cmp r0, #0 b82c: 1a000036 bne b90c /* WARN waitingWriters not restored! */ ret = -EINTR; goto out_nolock; } pipe->waitingWriters --; b830: e594301c ldr r3, [r4, #28] if (ret != 0) b834: e3560000 cmp r6, #0 if (! PIPE_LOCK(pipe)) { /* WARN waitingWriters not restored! */ ret = -EINTR; goto out_nolock; } pipe->waitingWriters --; b838: e2433001 sub r3, r3, #1 b83c: e584301c str r3, [r4, #28] if (ret != 0) b840: 1a00002e bne b900 goto out_locked; if (pipe->Readers == 0) { b844: e5943010 ldr r3, [r4, #16] b848: e3530000 cmp r3, #0 b84c: 0a00002a beq b8fc /* 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) { b850: e594a004 ldr sl, [r4, #4] b854: e594300c ldr r3, [r4, #12] b858: e063200a rsb r2, r3, sl b85c: e1520009 cmp r2, r9 b860: 3affffde bcc b7e0 goto out_locked; } } chunk = MIN(count - written, PIPE_SPACE(pipe)); chunk1 = pipe->Size - PIPE_WSTART(pipe); b864: e5940008 ldr r0, [r4, #8] b868: e1a0100a mov r1, sl b86c: e0830000 add r0, r3, r0 ret = -EPIPE; goto out_locked; } } chunk = MIN(count - written, PIPE_SPACE(pipe)); b870: e0656007 rsb r6, r5, r7 b874: e1520006 cmp r2, r6 b878: 31a06002 movcc r6, r2 chunk1 = pipe->Size - PIPE_WSTART(pipe); b87c: eb00387e bl 19a7c <__umodsi3> b880: e5943000 ldr r3, [r4] b884: e060a00a rsb sl, r0, sl if (chunk > chunk1) { b888: e156000a cmp r6, sl b88c: 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); b890: d0830000 addle r0, r3, r0 b894: d1a02006 movle r2, r6 } } chunk = MIN(count - written, PIPE_SPACE(pipe)); chunk1 = pipe->Size - PIPE_WSTART(pipe); if (chunk > chunk1) { b898: da000006 ble b8b8 memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk1); b89c: e1a0200a mov r2, sl b8a0: e0830000 add r0, r3, r0 b8a4: eb000c29 bl e950 memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1); b8a8: e08a1005 add r1, sl, r5 b8ac: e5940000 ldr r0, [r4] b8b0: e08b1001 add r1, fp, r1 b8b4: e06a2006 rsb r2, sl, r6 } else memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk); b8b8: eb000c24 bl e950 pipe->Length += chunk; b8bc: e594300c ldr r3, [r4, #12] b8c0: e0833006 add r3, r3, r6 b8c4: e584300c str r3, [r4, #12] if (pipe->waitingReaders > 0) b8c8: e5943018 ldr r3, [r4, #24] b8cc: e3530000 cmp r3, #0 PIPE_WAKEUPREADERS(pipe); b8d0: 1594002c ldrne r0, [r4, #44] ; 0x2c b8d4: 11a0100d movne r1, sp b8d8: 1b0002d5 blne c434 written += chunk; b8dc: e0855006 add r5, r5, r6 /* Write of more than PIPE_BUF bytes can be interleaved */ chunk = 1; b8e0: e3a09001 mov r9, #1 } /* Write of PIPE_BUF bytes or less shall not be interleaved */ chunk = count <= pipe->Size ? count : 1; while (written < count) { b8e4: e1550007 cmp r5, r7 b8e8: 3affffd8 bcc b850 b8ec: e3a06000 mov r6, #0 b8f0: ea000002 b b900 while (PIPE_SPACE(pipe) < chunk) { if (LIBIO_NODELAY(iop)) { ret = -EAGAIN; b8f4: e3e0600a mvn r6, #10 b8f8: ea000000 b b900 pipe->waitingWriters --; if (ret != 0) goto out_locked; if (pipe->Readers == 0) { ret = -EPIPE; b8fc: e3e0601f mvn r6, #31 /* Write of more than PIPE_BUF bytes can be interleaved */ chunk = 1; } out_locked: PIPE_UNLOCK(pipe); b900: e5940028 ldr r0, [r4, #40] ; 0x28 b904: ebffed87 bl 6f28 b908: ea000000 b b910 PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) ret = -EINTR; if (! PIPE_LOCK(pipe)) { /* WARN waitingWriters not restored! */ ret = -EINTR; b90c: e3e06003 mvn r6, #3 <== NOT EXECUTED kill(getpid(), SIGPIPE); #endif if (written > 0) return written; return ret; b910: e3550000 cmp r5, #0 b914: d1a05006 movle r5, r6 } b918: e1a00005 mov r0, r5 b91c: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00010f6c : ) { uintptr_t old_size; char *new_area; MSBUMP(realloc_calls, 1); 10f6c: e59f310c ldr r3, [pc, #268] ; 11080 10f70: e5932010 ldr r2, [r3, #16] 10f74: e2822001 add r2, r2, #1 void *realloc( void *ptr, size_t size ) { 10f78: e92d40f1 push {r0, r4, r5, r6, r7, lr} uintptr_t old_size; char *new_area; MSBUMP(realloc_calls, 1); 10f7c: 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())) { 10f80: e59f30fc ldr r3, [pc, #252] ; 11084 10f84: e5933000 ldr r3, [r3] 10f88: e3530003 cmp r3, #3 void *realloc( void *ptr, size_t size ) { 10f8c: e1a04000 mov r4, r0 10f90: 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())) { 10f94: 1a000009 bne 10fc0 if (_Thread_Dispatch_disable_level > 0) 10f98: e59f30e8 ldr r3, [pc, #232] ; 11088 10f9c: e5933000 ldr r3, [r3] 10fa0: e3530000 cmp r3, #0 return (void *) 0; 10fa4: 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) 10fa8: 1a000032 bne 11078 return (void *) 0; if (_ISR_Nest_level > 0) 10fac: e59f20d8 ldr r2, [pc, #216] ; 1108c 10fb0: e5922000 ldr r2, [r2] 10fb4: e3520000 cmp r2, #0 return (void *) 0; 10fb8: 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) 10fbc: 1a00002d bne 11078 } /* * Continue with realloc(). */ if ( !ptr ) 10fc0: e3540000 cmp r4, #0 10fc4: 1a000003 bne 10fd8 return malloc( size ); 10fc8: e1a00005 mov r0, r5 10fcc: ebffc405 bl 1fe8 10fd0: e1a04000 mov r4, r0 10fd4: ea000027 b 11078 if ( !size ) { 10fd8: e3550000 cmp r5, #0 10fdc: 1a000003 bne 10ff0 free( ptr ); 10fe0: e1a00004 mov r0, r4 <== NOT EXECUTED 10fe4: ebffc330 bl 1cac <== NOT EXECUTED return (void *) 0; 10fe8: e1a04005 mov r4, r5 <== NOT EXECUTED 10fec: ea000021 b 11078 <== NOT EXECUTED } if ( !_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, ptr, &old_size) ) { 10ff0: e59f6098 ldr r6, [pc, #152] ; 11090 10ff4: e1a01004 mov r1, r4 10ff8: e5960000 ldr r0, [r6] 10ffc: e1a0200d mov r2, sp 11000: eb00004e bl 11140 <_Protected_heap_Get_block_size> 11004: e2507000 subs r7, r0, #0 11008: 1a000004 bne 11020 errno = EINVAL; 1100c: ebffeb23 bl bca0 <__errno> 11010: e3a03016 mov r3, #22 11014: e5803000 str r3, [r0] return (void *) 0; 11018: e1a04007 mov r4, r7 1101c: ea000015 b 11078 } /* * Now resize it. */ if ( _Protected_heap_Resize_block( RTEMS_Malloc_Heap, ptr, size ) ) { 11020: e5960000 ldr r0, [r6] 11024: e1a01004 mov r1, r4 11028: e1a02005 mov r2, r5 1102c: eb000054 bl 11184 <_Protected_heap_Resize_block> 11030: e3500000 cmp r0, #0 11034: 1a00000f bne 11078 * 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 ); 11038: e1a00005 mov r0, r5 1103c: ebffc3e9 bl 1fe8 MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */ 11040: e59f3038 ldr r3, [pc, #56] ; 11080 11044: e5932004 ldr r2, [r3, #4] if ( !new_area ) { 11048: e2506000 subs r6, r0, #0 * and the C Standard. */ new_area = malloc( size ); MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */ 1104c: e2422001 sub r2, r2, #1 11050: e5832004 str r2, [r3, #4] if ( !new_area ) { 11054: 0a000006 beq 11074 return (void *) 0; } memcpy( new_area, ptr, (size < old_size) ? size : old_size ); 11058: e59d2000 ldr r2, [sp] 1105c: e1a01004 mov r1, r4 11060: e1550002 cmp r5, r2 11064: 31a02005 movcc r2, r5 11068: ebffed3a bl c558 free( ptr ); 1106c: e1a00004 mov r0, r4 11070: ebffc30d bl 1cac new_area = malloc( size ); MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */ if ( !new_area ) { return (void *) 0; 11074: e1a04006 mov r4, r6 memcpy( new_area, ptr, (size < old_size) ? size : old_size ); free( ptr ); return new_area; } 11078: e1a00004 mov r0, r4 1107c: e8bd80f8 pop {r3, r4, r5, r6, r7, pc} =============================================================================== 000022f8 : void rtems_cpu_usage_report_with_plugin( void *context, rtems_printk_plugin_t print ) { 22f8: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} Timestamp_Control uptime, total, ran; #else uint32_t total_units = 0; #endif if ( !print ) 22fc: e251a000 subs sl, r1, #0 void rtems_cpu_usage_report_with_plugin( void *context, rtems_printk_plugin_t print ) { 2300: e24dd040 sub sp, sp, #64 ; 0x40 2304: e1a08000 mov r8, r0 Timestamp_Control uptime, total, ran; #else uint32_t total_units = 0; #endif if ( !print ) 2308: 0a000057 beq 246c * 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__ _TOD_Get_uptime( &uptime ); 230c: e28d5030 add r5, sp, #48 ; 0x30 2310: e1a00005 mov r0, r5 _Timestamp_Subtract( &CPU_usage_Uptime_at_last_reset, &uptime, &total ); 2314: e28d4028 add r4, sp, #40 ; 0x28 * 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__ _TOD_Get_uptime( &uptime ); 2318: eb00146e bl 74d8 <_TOD_Get_uptime> _Timestamp_Subtract( &CPU_usage_Uptime_at_last_reset, &uptime, &total ); 231c: e1a01005 mov r1, r5 2320: e59f014c ldr r0, [pc, #332] ; 2474 2324: e1a02004 mov r2, r4 2328: eb001d01 bl 9734 <_Timespec_Subtract> } } } #endif (*print)( 232c: e1a00008 mov r0, r8 2330: e59f1140 ldr r1, [pc, #320] ; 2478 2334: e1a0e00f mov lr, pc 2338: e12fff1a bx sl 233c: e59f5138 ldr r5, [pc, #312] ; 247c the_thread = (Thread_Control *)information->local_table[ i ]; if ( !the_thread ) continue; rtems_object_get_name( the_thread->Object.id, sizeof(name), name ); 2340: e28db008 add fp, sp, #8 "------------+----------------------------------------+---------------+---------\n" ); for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) 2344: e5b53004 ldr r3, [r5, #4]! 2348: e3530000 cmp r3, #0 234c: 0a00003a beq 243c continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 2350: e5936004 ldr r6, [r3, #4] if ( information ) { 2354: e3560000 cmp r6, #0 2358: 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( 235c: 128d9018 addne r9, sp, #24 if ( !_Objects_Information_table[ api_index ] ) continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; if ( information ) { 2360: 1a000032 bne 2430 2364: ea000034 b 243c <== NOT EXECUTED for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 2368: e596301c ldr r3, [r6, #28] 236c: e7934107 ldr r4, [r3, r7, lsl #2] if ( !the_thread ) 2370: e3540000 cmp r4, #0 2374: 0a00002c beq 242c continue; rtems_object_get_name( the_thread->Object.id, sizeof(name), name ); 2378: e3a0100d mov r1, #13 237c: e1a0200b mov r2, fp 2380: e5940008 ldr r0, [r4, #8] 2384: eb000fc5 bl 62a0 (*print)( 2388: e5942008 ldr r2, [r4, #8] 238c: e1a0300b mov r3, fp 2390: e1a00008 mov r0, r8 2394: e59f10e4 ldr r1, [pc, #228] ; 2480 2398: e1a0e00f mov lr, pc 239c: 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; 23a0: e2843084 add r3, r4, #132 ; 0x84 23a4: e893000c ldm r3, {r2, r3} 23a8: e58d2020 str r2, [sp, #32] 23ac: e58d3024 str r3, [sp, #36] ; 0x24 if ( _Thread_Executing->Object.id == the_thread->Object.id ) { 23b0: e59f20cc ldr r2, [pc, #204] ; 2484 23b4: e5923004 ldr r3, [r2, #4] 23b8: e5932008 ldr r2, [r3, #8] 23bc: e5943008 ldr r3, [r4, #8] 23c0: e1520003 cmp r2, r3 23c4: 1a000006 bne 23e4 Timestamp_Control used; _Timestamp_Subtract( 23c8: e59f00b8 ldr r0, [pc, #184] ; 2488 23cc: e28d1030 add r1, sp, #48 ; 0x30 23d0: e1a02009 mov r2, r9 23d4: eb001cd6 bl 9734 <_Timespec_Subtract> &_Thread_Time_of_last_context_switch, &uptime, &used ); _Timestamp_Add_to( &ran, &used ); 23d8: e28d0020 add r0, sp, #32 23dc: e1a01009 mov r1, r9 23e0: eb001c98 bl 9648 <_Timespec_Add_to> }; _Timestamp_Divide( &ran, &total, &ival, &fval ); 23e4: e28d203c add r2, sp, #60 ; 0x3c 23e8: e28d3038 add r3, sp, #56 ; 0x38 23ec: e28d0020 add r0, sp, #32 23f0: e28d1028 add r1, sp, #40 ; 0x28 23f4: eb001cab bl 96a8 <_Timespec_Divide> /* * Print the information */ (*print)( context, 23f8: e3a01ffa mov r1, #1000 ; 0x3e8 23fc: e59d0024 ldr r0, [sp, #36] ; 0x24 2400: eb005154 bl 16958 <__aeabi_uidiv> 2404: e59d203c ldr r2, [sp, #60] ; 0x3c 2408: e58d2000 str r2, [sp] 240c: e59d2038 ldr r2, [sp, #56] ; 0x38 2410: e1a03000 mov r3, r0 2414: e58d2004 str r2, [sp, #4] 2418: e1a00008 mov r0, r8 241c: e59f1068 ldr r1, [pc, #104] ; 248c 2420: e59d2020 ldr r2, [sp, #32] 2424: e1a0e00f mov lr, pc 2428: e12fff1a bx sl continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; if ( information ) { for ( i=1 ; i <= information->maximum ; i++ ) { 242c: e2877001 add r7, r7, #1 2430: e1d631b0 ldrh r3, [r6, #16] 2434: e1570003 cmp r7, r3 2438: 9affffca bls 2368 " ID | NAME | TICKS | PERCENT\n" #endif "------------+----------------------------------------+---------------+---------\n" ); for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 243c: e59f304c ldr r3, [pc, #76] ; 2490 2440: e1550003 cmp r5, r3 2444: 1affffbe bne 2344 } } } #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( 2448: e3a01ffa mov r1, #1000 ; 0x3e8 244c: e59d002c ldr r0, [sp, #44] ; 0x2c 2450: eb005140 bl 16958 <__aeabi_uidiv> 2454: e59f1038 ldr r1, [pc, #56] ; 2494 2458: e1a03000 mov r3, r0 245c: e59d2028 ldr r2, [sp, #40] ; 0x28 2460: e1a00008 mov r0, r8 2464: e1a0e00f mov lr, pc 2468: e12fff1a bx sl "-------------------------------------------------------------------------------\n", _Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset, total_units ); #endif } 246c: e28dd040 add sp, sp, #64 ; 0x40 2470: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00001a0c : * configuration is a single instantiation of the IMFS or miniIMFS with * a single "/dev" directory in it. */ void rtems_filesystem_initialize( void ) { 1a0c: e92d40f0 push {r4, r5, r6, r7, lr} /* * Set the default umask to "022". */ rtems_filesystem_umask = 022; 1a10: e59f60e0 ldr r6, [pc, #224] ; 1af8 1a14: e5963000 ldr r3, [r6] 1a18: e3a02012 mov r2, #18 1a1c: e583202c str r2, [r3, #44] ; 0x2c /* * mount the first filesystem. */ if ( rtems_filesystem_mount_table_size == 0 ) 1a20: e59f30d4 ldr r3, [pc, #212] ; 1afc 1a24: e5933000 ldr r3, [r3] 1a28: e3530000 cmp r3, #0 * configuration is a single instantiation of the IMFS or miniIMFS with * a single "/dev" directory in it. */ void rtems_filesystem_initialize( void ) { 1a2c: e24dd018 sub sp, sp, #24 /* * mount the first filesystem. */ if ( rtems_filesystem_mount_table_size == 0 ) rtems_fatal_error_occurred( 0xABCD0001 ); 1a30: 059f00c8 ldreq r0, [pc, #200] ; 1b00 rtems_filesystem_umask = 022; /* * mount the first filesystem. */ if ( rtems_filesystem_mount_table_size == 0 ) 1a34: 0a00000a beq 1a64 rtems_fatal_error_occurred( 0xABCD0001 ); mt = &rtems_filesystem_mount_table[0]; 1a38: e59f30c4 ldr r3, [pc, #196] ; 1b04 status = mount( mt->device, mt->mount_point, mt->type, mt->fsoptions, NULL ); 1a3c: e3a05000 mov r5, #0 * mount the first filesystem. */ if ( rtems_filesystem_mount_table_size == 0 ) rtems_fatal_error_occurred( 0xABCD0001 ); mt = &rtems_filesystem_mount_table[0]; 1a40: e5933000 ldr r3, [r3] status = mount( mt->device, mt->mount_point, mt->type, mt->fsoptions, NULL ); 1a44: e58d5000 str r5, [sp] 1a48: e2830008 add r0, r3, #8 1a4c: e8900003 ldm r0, {r0, r1} 1a50: e893000c ldm r3, {r2, r3} 1a54: eb0001f1 bl 2220 if ( status == -1 ) 1a58: e3700001 cmn r0, #1 1a5c: 1a000001 bne 1a68 rtems_fatal_error_occurred( 0xABCD0002 ); 1a60: e59f00a0 ldr r0, [pc, #160] ; 1b08 <== NOT EXECUTED 1a64: eb000e9f bl 54e8 <== NOT EXECUTED rtems_filesystem_link_counts = 0; 1a68: e5963000 ldr r3, [r6] * gonna hit performance. * * Till Straumann, 10/25/2002 */ /* Clone the root pathloc */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 1a6c: e28d4004 add r4, sp, #4 status = mount( mt->device, mt->mount_point, mt->type, mt->fsoptions, NULL ); if ( status == -1 ) rtems_fatal_error_occurred( 0xABCD0002 ); rtems_filesystem_link_counts = 0; 1a70: e1c353b0 strh r5, [r3, #48] ; 0x30 * gonna hit performance. * * Till Straumann, 10/25/2002 */ /* Clone the root pathloc */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 1a74: e3a01001 mov r1, #1 1a78: e1a03004 mov r3, r4 1a7c: e1a02005 mov r2, r5 1a80: e59f0084 ldr r0, [pc, #132] ; 1b0c rtems_filesystem_root = loc; 1a84: e1a07004 mov r7, r4 * gonna hit performance. * * Till Straumann, 10/25/2002 */ /* Clone the root pathloc */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 1a88: e58d5000 str r5, [sp] 1a8c: eb000051 bl 1bd8 rtems_filesystem_root = loc; 1a90: e596c000 ldr ip, [r6] 1a94: e8b7000f ldm r7!, {r0, r1, r2, r3} 1a98: e28cc018 add ip, ip, #24 1a9c: e8ac000f stmia ip!, {r0, r1, r2, r3} 1aa0: e5973000 ldr r3, [r7] /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 1aa4: e3a01001 mov r1, #1 * * Till Straumann, 10/25/2002 */ /* Clone the root pathloc */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_root = loc; 1aa8: e58c3000 str r3, [ip] /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 1aac: e1a02005 mov r2, r5 1ab0: e1a03004 mov r3, r4 1ab4: e59f0050 ldr r0, [pc, #80] ; 1b0c 1ab8: e58d5000 str r5, [sp] 1abc: eb000045 bl 1bd8 rtems_filesystem_current = loc; 1ac0: e596c000 ldr ip, [r6] 1ac4: e8b4000f ldm r4!, {r0, r1, r2, r3} 1ac8: e28cc004 add ip, ip, #4 1acc: e8ac000f stmia ip!, {r0, r1, r2, r3} 1ad0: e5973000 ldr r3, [r7] * * NOTE: UNIX root is 755 and owned by root/root (0/0). It is actually * created that way by the IMFS. */ status = mkdir( "/dev", 0777); 1ad4: e59f0034 ldr r0, [pc, #52] ; 1b10 /* Clone the root pathloc */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_root = loc; /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_current = loc; 1ad8: e58c3000 str r3, [ip] * * NOTE: UNIX root is 755 and owned by root/root (0/0). It is actually * created that way by the IMFS. */ status = mkdir( "/dev", 0777); 1adc: e59f1030 ldr r1, [pc, #48] ; 1b14 1ae0: eb00017c bl 20d8 if ( status != 0 ) 1ae4: e3500000 cmp r0, #0 rtems_fatal_error_occurred( 0xABCD0003 ); 1ae8: 159f0028 ldrne r0, [pc, #40] ; 1b18 * NOTE: UNIX root is 755 and owned by root/root (0/0). It is actually * created that way by the IMFS. */ status = mkdir( "/dev", 0777); if ( status != 0 ) 1aec: 1affffdc bne 1a64 * it will be mounted onto is created. Moreover, if it is going to * use a device, then it is REALLY unfair to attempt this * before device drivers are initialized. So we return via a base * filesystem image and nothing auto-mounted at this point. */ } 1af0: e28dd018 add sp, sp, #24 1af4: e8bd80f0 pop {r4, r5, r6, r7, pc} =============================================================================== 0000278c : int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *)) { 278c: e92d4070 push {r4, r5, r6, lr} 2790: 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 ) ); 2794: e3a00008 mov r0, #8 } return 0; } int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *)) { 2798: 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 ) ); 279c: eb0000fa bl 2b8c 27a0: e1a04000 mov r4, r0 *key = new_key; 27a4: 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 ); 27a8: 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; 27ac: 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 ); 27b0: 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; 27b4: 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 ); 27b8: eb000e07 bl 5fdc if ( status == RTEMS_SUCCESSFUL ) 27bc: e3500000 cmp r0, #0 27c0: 08bd8070 popeq {r4, r5, r6, pc} return 0; free( new_key ); 27c4: e1a00004 mov r0, r4 <== NOT EXECUTED 27c8: ebffff95 bl 2624 <== NOT EXECUTED return -1; 27cc: e3e00000 mvn r0, #0 <== NOT EXECUTED } 27d0: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED =============================================================================== 00009464 : uint32_t flags ) { uint32_t fcntl_flags = 0; if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) { 9464: e2003006 and r3, r0, #6 9468: e3530006 cmp r3, #6 fcntl_flags |= O_RDWR; 946c: 03a03002 moveq r3, #2 uint32_t flags ) { uint32_t fcntl_flags = 0; if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) { 9470: 0a000005 beq 948c fcntl_flags |= O_RDWR; } else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) { 9474: e3100002 tst r0, #2 fcntl_flags |= O_RDONLY; 9478: 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) { 947c: 1a000002 bne 948c ) { uint32_t fcntl_flags = 0; if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) { fcntl_flags |= O_RDWR; 9480: e3100004 tst r0, #4 <== NOT EXECUTED 9484: 03a03000 moveq r3, #0 <== NOT EXECUTED 9488: 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 ) { 948c: e3100001 tst r0, #1 fcntl_flags |= O_NONBLOCK; 9490: 13833901 orrne r3, r3, #16384 ; 0x4000 } if ( (flags & LIBIO_FLAGS_APPEND) == LIBIO_FLAGS_APPEND ) { 9494: e3100c02 tst r0, #512 ; 0x200 fcntl_flags |= O_APPEND; 9498: 13833008 orrne r3, r3, #8 } if ( (flags & LIBIO_FLAGS_CREATE) == LIBIO_FLAGS_CREATE ) { 949c: e3100b01 tst r0, #1024 ; 0x400 fcntl_flags |= O_CREAT; 94a0: 13833c02 orrne r3, r3, #512 ; 0x200 } return fcntl_flags; } 94a4: e1a00003 mov r0, r3 94a8: e12fff1e bx lr =============================================================================== 000014c0 : /* * Check if blown */ bool rtems_stack_checker_is_blown( void ) { 14c0: e92d4810 push {r4, fp, lr} Stack_Control *the_stack = &_Thread_Executing->Start.Initial_stack; 14c4: e59f3078 ldr r3, [pc, #120] ; 1544 14c8: e5933004 ldr r3, [r3, #4] ) { #if defined(__GNUC__) void *sp = __builtin_frame_address(0); if ( sp < the_stack->area ) { 14cc: e59300b8 ldr r0, [r3, #184] ; 0xb8 /* * Check if blown */ bool rtems_stack_checker_is_blown( void ) { 14d0: e28db008 add fp, sp, #8 ) { #if defined(__GNUC__) void *sp = __builtin_frame_address(0); if ( sp < the_stack->area ) { 14d4: e15b0000 cmp fp, r0 return false; 14d8: 33a04000 movcc r4, #0 ) { #if defined(__GNUC__) void *sp = __builtin_frame_address(0); if ( sp < the_stack->area ) { 14dc: 3a000004 bcc 14f4 return false; } if ( sp > (the_stack->area + the_stack->size) ) { 14e0: e59340b4 ldr r4, [r3, #180] ; 0xb4 14e4: e0804004 add r4, r0, r4 } /* * Check if blown */ bool rtems_stack_checker_is_blown( void ) 14e8: e15b0004 cmp fp, r4 14ec: 83a04000 movhi r4, #0 14f0: 93a04001 movls r4, #1 /* * The stack checker must be initialized before the pattern is there * to check. */ if ( Stack_check_Initialized ) { 14f4: e59f304c ldr r3, [pc, #76] ; 1548 14f8: e5933008 ldr r3, [r3, #8] 14fc: 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; 1500: 03a01001 moveq r1, #1 /* * The stack checker must be initialized before the pattern is there * to check. */ if ( Stack_check_Initialized ) { 1504: 0a000005 beq 1520 pattern_ok = (!memcmp( 1508: e59f103c ldr r1, [pc, #60] ; 154c 150c: e2800008 add r0, r0, #8 1510: e3a02010 mov r2, #16 1514: eb002c25 bl c5b0 1518: e2701001 rsbs r1, r0, #1 151c: 33a01000 movcc r1, #0 /* * Let's report as much as we can. */ if ( !sp_ok || !pattern_ok ) { 1520: e3540000 cmp r4, #0 1524: 0a000001 beq 1530 1528: e3510000 cmp r1, #0 152c: 1a000002 bne 153c Stack_check_report_blown_task( _Thread_Executing, pattern_ok ); 1530: e59f300c ldr r3, [pc, #12] ; 1544 <== NOT EXECUTED 1534: e5930004 ldr r0, [r3, #4] <== NOT EXECUTED 1538: ebffff9d bl 13b4 <== NOT EXECUTED /* * The Stack Pointer and the Pattern Area are OK so return false. */ return false; } 153c: e3a00000 mov r0, #0 1540: e8bd8810 pop {r4, fp, pc} =============================================================================== 0000b0ac : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { b0ac: e92d40f1 push {r0, r4, r5, r6, r7, lr} STRING_TO_INPUT_TYPE result; char *end; if ( !n ) b0b0: e2514000 subs r4, r1, #0 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { b0b4: e1a05000 mov r5, r0 b0b8: e1a06002 mov r6, r2 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; b0bc: 03a00009 moveq r0, #9 ) { STRING_TO_INPUT_TYPE result; char *end; if ( !n ) b0c0: 0a000018 beq b128 return RTEMS_INVALID_ADDRESS; errno = 0; b0c4: eb0007a8 bl cf6c <__errno> b0c8: e3a03000 mov r3, #0 b0cc: 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 ); b0d0: e1a0100d mov r1, sp if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; b0d4: 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 ); b0d8: e1a00005 mov r0, r5 b0dc: e3a02010 mov r2, #16 b0e0: eb0014d0 bl 10428 #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 ) b0e4: e3560000 cmp r6, #0 *endptr = end; b0e8: 159d3000 ldrne r3, [sp] b0ec: 15863000 strne r3, [r6] /* nothing was converted */ if ( end == s ) b0f0: e59d3000 ldr r3, [sp] b0f4: 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 ); b0f8: e1a07000 mov r7, r0 if ( endptr ) *endptr = end; /* nothing was converted */ if ( end == s ) return RTEMS_NOT_DEFINED; b0fc: 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 ) b100: 0a000008 beq b128 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) b104: e3770001 cmn r7, #1 b108: 1a000004 bne b120 b10c: eb000796 bl cf6c <__errno> <== NOT EXECUTED b110: e5903000 ldr r3, [r0] <== NOT EXECUTED b114: e3530022 cmp r3, #34 ; 0x22 <== NOT EXECUTED return RTEMS_INVALID_NUMBER; b118: 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)) b11c: 0a000001 beq b128 <== 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; b120: e5847000 str r7, [r4] #else *n = (STRING_TO_TYPE) result; #endif return RTEMS_SUCCESSFUL; b124: e3a00000 mov r0, #0 } b128: e8bd80f8 pop {r3, r4, r5, r6, r7, pc} =============================================================================== 00001884 : int rtems_tarfs_load( char *mountpoint, uint8_t *tar_image, size_t tar_size ) { 1884: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 1888: e24ddf6b sub sp, sp, #428 ; 0x1ac 188c: e58d1010 str r1, [sp, #16] 1890: e58d2018 str r2, [sp, #24] 1894: e58d000c str r0, [sp, #12] int offset; unsigned long nblocks; IMFS_jnode_t *node; int status; status = rtems_filesystem_evaluate_path( 1898: eb003a85 bl 102b4 189c: e3a02000 mov r2, #0 18a0: e1a01000 mov r1, r0 18a4: e28d3f65 add r3, sp, #404 ; 0x194 18a8: e59d000c ldr r0, [sp, #12] 18ac: e58d2000 str r2, [sp] 18b0: eb00029b bl 2324 strlen(mountpoint), 0, &root_loc, 0 ); if (status != 0) 18b4: e2504000 subs r4, r0, #0 18b8: 1a00006c bne 1a70 return -1; if (root_loc.ops != &IMFS_ops && root_loc.ops != &fifoIMFS_ops) 18bc: e59d31a0 ldr r3, [sp, #416] ; 0x1a0 18c0: e59f21c0 ldr r2, [pc, #448] ; 1a88 18c4: e1530002 cmp r3, r2 18c8: 0a000005 beq 18e4 18cc: e59f21b8 ldr r2, [pc, #440] ; 1a8c 18d0: e1530002 cmp r3, r2 18d4: 1a000065 bne 1a70 18d8: ea000001 b 18e4 <== NOT EXECUTED 18dc: e1a08004 mov r8, r4 18e0: ea000006 b 1900 * should not have this path. */ else if (linkflag == REGTYPE) { const char *name; loc = root_loc; 18e4: e28d2f65 add r2, sp, #404 ; 0x194 18e8: e58d2004 str r2, [sp, #4] 0 ); if (status != 0) return -1; if (root_loc.ops != &IMFS_ops && root_loc.ops != &fifoIMFS_ops) 18ec: 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); 18f0: e28d7f47 add r7, sp, #284 ; 0x11c * should not have this path. */ else if (linkflag == REGTYPE) { const char *name; loc = root_loc; 18f4: 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); 18f8: e28d501c add r5, sp, #28 18fc: e1a0a004 mov sl, r4 /* * Create an IMFS node structure pointing to tar image memory. */ offset = 0; while (1) { if (offset + 512 > tar_size) 1900: e59d3018 ldr r3, [sp, #24] 1904: e2884c02 add r4, r8, #512 ; 0x200 1908: e1540003 cmp r4, r3 190c: 8a000059 bhi 1a78 break; /* * Read a header. */ hdr_ptr = (char *) &tar_image[offset]; 1910: e59de010 ldr lr, [sp, #16] 1914: e08e8008 add r8, lr, r8 offset += 512; if (strncmp(&hdr_ptr[257], "ustar", 5)) 1918: e2880c01 add r0, r8, #256 ; 0x100 191c: e2800001 add r0, r0, #1 1920: e59f1168 ldr r1, [pc, #360] ; 1a90 1924: e3a02005 mov r2, #5 1928: eb003a79 bl 10314 192c: e2506000 subs r6, r0, #0 1930: 1a000050 bne 1a78 break; strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); 1934: e3a02063 mov r2, #99 ; 0x63 1938: e1a01008 mov r1, r8 193c: e1a00007 mov r0, r7 1940: eb003acf bl 10484 filename[MAX_NAME_FIELD_SIZE] = '\0'; 1944: e5cd617f strb r6, [sp, #383] ; 0x17f linkflag = hdr_ptr[156]; file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8); 1948: e3a01008 mov r1, #8 194c: 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]; 1950: e5d8609c ldrb r6, [r8, #156] ; 0x9c file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8); 1954: eb001d56 bl 8eb4 <_rtems_octal2ulong> file_size = _rtems_octal2ulong(&hdr_ptr[124], 12); 1958: 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); 195c: e58d0014 str r0, [sp, #20] file_size = _rtems_octal2ulong(&hdr_ptr[124], 12); 1960: e288007c add r0, r8, #124 ; 0x7c 1964: eb001d52 bl 8eb4 <_rtems_octal2ulong> hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8); 1968: 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); 196c: e1a0b000 mov fp, r0 hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8); 1970: e2880094 add r0, r8, #148 ; 0x94 1974: eb001d4e bl 8eb4 <_rtems_octal2ulong> 1978: e1a03000 mov r3, r0 if (_rtems_tar_header_checksum(hdr_ptr) != hdr_chksum) 197c: e1a00008 mov r0, r8 1980: e58d3008 str r3, [sp, #8] 1984: eb001d58 bl 8eec <_rtems_tar_header_checksum> 1988: e59d3008 ldr r3, [sp, #8] 198c: e1500003 cmp r0, r3 1990: 1a000038 bne 1a78 * 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) { 1994: e3560035 cmp r6, #53 ; 0x35 1998: 1a000012 bne 19e8 strcpy(full_filename, mountpoint); 199c: e59d100c ldr r1, [sp, #12] 19a0: e1a00005 mov r0, r5 19a4: eb00387e bl fba4 if (full_filename[strlen(full_filename)-1] != '/') 19a8: e1a00005 mov r0, r5 19ac: eb003a40 bl 102b4 19b0: e28d2f6b add r2, sp, #428 ; 0x1ac 19b4: e0820000 add r0, r2, r0 19b8: e5503191 ldrb r3, [r0, #-401] ; 0x191 19bc: e353002f cmp r3, #47 ; 0x2f strcat(full_filename, "/"); 19c0: 11a00005 movne r0, r5 19c4: 159f10c8 ldrne r1, [pc, #200] ; 1a94 19c8: 1b0037be blne f8c8 strcat(full_filename, filename); 19cc: e1a01007 mov r1, r7 19d0: e1a00005 mov r0, r5 19d4: eb0037bb bl f8c8 mkdir(full_filename, S_IRWXU | S_IRWXG | S_IRWXO); 19d8: e1a00005 mov r0, r5 19dc: e59f10b4 ldr r1, [pc, #180] ; 1a98 19e0: eb000464 bl 2b78 19e4: eaffffbc b 18dc * 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) { 19e8: e3560030 cmp r6, #48 ; 0x30 19ec: 1affffba bne 18dc const char *name; loc = root_loc; 19f0: e59dc004 ldr ip, [sp, #4] 19f4: e8bc000f ldm ip!, {r0, r1, r2, r3} 19f8: e1a0e009 mov lr, r9 19fc: e8ae000f stmia lr!, {r0, r1, r2, r3} 1a00: e59c2000 ldr r2, [ip] if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { 1a04: e1a00007 mov r0, r7 * should not have this path. */ else if (linkflag == REGTYPE) { const char *name; loc = root_loc; 1a08: e58e2000 str r2, [lr] if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { 1a0c: e1a01009 mov r1, r9 1a10: e28d2f6a add r2, sp, #424 ; 0x1a8 1a14: eb001fff bl 9a18 1a18: e2506000 subs r6, r0, #0 1a1c: 1a00000d bne 1a58 node = IMFS_create_node( &loc, IMFS_LINEAR_FILE, (char *)name, (file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG, 1a20: e59d2014 ldr r2, [sp, #20] 1a24: e1a03b82 lsl r3, r2, #23 1a28: 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( 1a2c: e59d21a8 ldr r2, [sp, #424] ; 0x1a8 1a30: e3833902 orr r3, r3, #32768 ; 0x8000 1a34: e1a00009 mov r0, r9 1a38: e3a01006 mov r1, #6 1a3c: e58d6000 str r6, [sp] 1a40: eb001e72 bl 9410 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]; 1a44: e59d2010 ldr r2, [sp, #16] 1a48: 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; 1a4c: e580b050 str fp, [r0, #80] ; 0x50 1a50: e5806054 str r6, [r0, #84] ; 0x54 node->info.linearfile.direct = &tar_image[offset]; 1a54: e5803058 str r3, [r0, #88] ; 0x58 } nblocks = (((file_size) + 511) & ~511) / 512; 1a58: e28bbf7f add fp, fp, #508 ; 0x1fc 1a5c: e28bb003 add fp, fp, #3 offset += 512 * nblocks; 1a60: e3cbbf7f bic fp, fp, #508 ; 0x1fc 1a64: e3cbb003 bic fp, fp, #3 1a68: e08b4004 add r4, fp, r4 1a6c: eaffff9a b 18dc ); if (status != 0) return -1; if (root_loc.ops != &IMFS_ops && root_loc.ops != &fifoIMFS_ops) return -1; 1a70: e3e04000 mvn r4, #0 1a74: ea000000 b 1a7c 1a78: e1a0400a mov r4, sl nblocks = (((file_size) + 511) & ~511) / 512; offset += 512 * nblocks; } } return status; } 1a7c: e1a00004 mov r0, r4 1a80: e28ddf6b add sp, sp, #428 ; 0x1ac 1a84: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 0000b858 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { b858: 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 ) b85c: e252a000 subs sl, r2, #0 rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { b860: e1a04000 mov r4, r0 b864: 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; b868: 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 ) b86c: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc} return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; b870: e59f313c ldr r3, [pc, #316] ; b9b4 b874: 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; b878: e5d78074 ldrb r8, [r7, #116] ; 0x74 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; b87c: e59760f4 ldr r6, [r7, #244] ; 0xf4 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) b880: 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; b884: 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; b888: 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; b88c: 03a08c01 moveq r8, #256 ; 0x100 b890: 13a08000 movne r8, #0 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) b894: e3530000 cmp r3, #0 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; b898: 13888c02 orrne r8, r8, #512 ; 0x200 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; b89c: e3590000 cmp r9, #0 b8a0: 03a09b01 moveq r9, #1024 ; 0x400 b8a4: 13a09000 movne r9, #0 old_mode |= _ISR_Get_level(); b8a8: ebfff31d bl 8524 <_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; b8ac: e1899000 orr r9, r9, r0 old_mode |= _ISR_Get_level(); b8b0: e1898008 orr r8, r9, r8 *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) b8b4: 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; b8b8: e58a8000 str r8, [sl] /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) b8bc: 0a000003 beq b8d0 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; b8c0: e3140c01 tst r4, #256 ; 0x100 b8c4: 13a03000 movne r3, #0 b8c8: 03a03001 moveq r3, #1 b8cc: e5c73074 strb r3, [r7, #116] ; 0x74 if ( mask & RTEMS_TIMESLICE_MASK ) { b8d0: e3150c02 tst r5, #512 ; 0x200 b8d4: 0a000006 beq b8f4 if ( _Modes_Is_timeslice(mode_set) ) { b8d8: e2143c02 ands r3, r4, #512 ; 0x200 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; b8dc: 13a03001 movne r3, #1 b8e0: 1587307c strne r3, [r7, #124] ; 0x7c executing->cpu_time_budget = _Thread_Ticks_per_timeslice; b8e4: 159f30cc ldrne r3, [pc, #204] ; b9b8 b8e8: 15933000 ldrne r3, [r3] } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; b8ec: 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; b8f0: 15873078 strne r3, [r7, #120] ; 0x78 } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) b8f4: e3150080 tst r5, #128 ; 0x80 b8f8: 0a000001 beq b904 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); b8fc: e2040080 and r0, r4, #128 ; 0x80 b900: ebfff302 bl 8510 <_CPU_ISR_Set_level> * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { b904: e2150b01 ands r0, r5, #1024 ; 0x400 b908: 0a000013 beq b95c * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( b90c: 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 ) { b910: e5d62008 ldrb r2, [r6, #8] * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( b914: 13a03000 movne r3, #0 b918: 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 ) { b91c: e1520003 cmp r2, r3 /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; b920: 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 ) { b924: 0a00000c beq b95c asr->is_enabled = is_asr_enabled; b928: e5c63008 strb r3, [r6, #8] static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( b92c: e10f3000 mrs r3, CPSR b930: e3832080 orr r2, r3, #128 ; 0x80 b934: e129f002 msr CPSR_fc, r2 { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); _signals = information->signals_pending; b938: e2861014 add r1, r6, #20 b93c: e8910006 ldm r1, {r1, r2} information->signals_pending = information->signals_posted; information->signals_posted = _signals; b940: 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; b944: e5861018 str r1, [r6, #24] static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( b948: e129f003 msr CPSR_fc, r3 _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { b94c: e5960014 ldr r0, [r6, #20] /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; b950: e3500000 cmp r0, #0 b954: 13a00001 movne r0, #1 b958: 03a00000 moveq r0, #0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { b95c: e59f3058 ldr r3, [pc, #88] ; b9bc b960: e5933000 ldr r3, [r3] b964: e3530003 cmp r3, #3 b968: 1a00000f bne b9ac bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; b96c: e59f2040 ldr r2, [pc, #64] ; b9b4 if ( are_signals_pending || b970: e3500000 cmp r0, #0 bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; b974: e5923004 ldr r3, [r2, #4] if ( are_signals_pending || b978: 1a000005 bne b994 b97c: e5922008 ldr r2, [r2, #8] b980: e1530002 cmp r3, r2 b984: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc} (!_Thread_Is_heir( executing ) && executing->is_preemptible) ) { b988: e5d33074 ldrb r3, [r3, #116] ; 0x74 b98c: e3530000 cmp r3, #0 b990: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc} _Thread_Dispatch_necessary = true; b994: e59f3018 ldr r3, [pc, #24] ; b9b4 b998: e3a02001 mov r2, #1 b99c: e5c32010 strb r2, [r3, #16] if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); b9a0: ebffed73 bl 6f74 <_Thread_Dispatch> } return RTEMS_SUCCESSFUL; b9a4: e3a00000 mov r0, #0 b9a8: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} b9ac: e3a00000 mov r0, #0 <== NOT EXECUTED } b9b0: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED =============================================================================== 00002fc0 : rtems_status_code rtems_termios_close (void *arg) { rtems_libio_open_close_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 2fc0: e5903000 ldr r3, [r0] } } rtems_status_code rtems_termios_close (void *arg) { 2fc4: e92d4030 push {r4, r5, lr} rtems_libio_open_close_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 2fc8: e5934034 ldr r4, [r3, #52] ; 0x34 rtems_status_code sc; sc = rtems_semaphore_obtain( 2fcc: e59f317c ldr r3, [pc, #380] ; 3150 2fd0: e3a01000 mov r1, #0 } } rtems_status_code rtems_termios_close (void *arg) { 2fd4: 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( 2fd8: e1a02001 mov r2, r1 2fdc: e5930000 ldr r0, [r3] 2fe0: eb0007a5 bl 4e7c rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 2fe4: e3500000 cmp r0, #0 2fe8: 1a000024 bne 3080 rtems_fatal_error_occurred (sc); if (--tty->refcount == 0) { 2fec: e5943008 ldr r3, [r4, #8] 2ff0: e2433001 sub r3, r3, #1 2ff4: e3530000 cmp r3, #0 2ff8: e5843008 str r3, [r4, #8] 2ffc: 1a00004e bne 313c if (rtems_termios_linesw[tty->t_line].l_close != NULL) { 3000: e59420cc ldr r2, [r4, #204] ; 0xcc 3004: e59f3148 ldr r3, [pc, #328] ; 3154 3008: e0833282 add r3, r3, r2, lsl #5 300c: e5931004 ldr r1, [r3, #4] 3010: e3510000 cmp r1, #0 3014: 0a000003 beq 3028 /* * call discipline-specific close */ sc = rtems_termios_linesw[tty->t_line].l_close(tty); 3018: e1a00004 mov r0, r4 301c: e1a0e00f mov lr, pc 3020: e12fff11 bx r1 3024: ea000008 b 304c } else { /* * default: just flush output buffer */ sc = rtems_semaphore_obtain(tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 3028: e5940018 ldr r0, [r4, #24] 302c: e1a02001 mov r2, r1 3030: eb000791 bl 4e7c if (sc != RTEMS_SUCCESSFUL) { 3034: e3500000 cmp r0, #0 3038: 1a000010 bne 3080 rtems_fatal_error_occurred (sc); } drainOutput (tty); 303c: e1a00004 mov r0, r4 3040: ebfffeb2 bl 2b10 rtems_semaphore_release (tty->osem); 3044: e5940018 ldr r0, [r4, #24] 3048: eb0007d1 bl 4f94 } if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 304c: e59430b4 ldr r3, [r4, #180] ; 0xb4 3050: e3530002 cmp r3, #2 3054: 1a00000a bne 3084 /* * send "terminate" to I/O tasks */ sc = rtems_event_send( tty->rxTaskId, TERMIOS_RX_TERMINATE_EVENT ); 3058: e59400c4 ldr r0, [r4, #196] ; 0xc4 305c: e3a01001 mov r1, #1 3060: eb000673 bl 4a34 if (sc != RTEMS_SUCCESSFUL) 3064: e3500000 cmp r0, #0 3068: 1a000004 bne 3080 rtems_fatal_error_occurred (sc); sc = rtems_event_send( tty->txTaskId, TERMIOS_TX_TERMINATE_EVENT ); 306c: e59400c8 ldr r0, [r4, #200] ; 0xc8 3070: e3a01001 mov r1, #1 3074: eb00066e bl 4a34 if (sc != RTEMS_SUCCESSFUL) 3078: e3500000 cmp r0, #0 307c: 0a000000 beq 3084 rtems_fatal_error_occurred (sc); 3080: eb000918 bl 54e8 <== NOT EXECUTED } if (tty->device.lastClose) 3084: e594309c ldr r3, [r4, #156] ; 0x9c 3088: e3530000 cmp r3, #0 (*tty->device.lastClose)(tty->major, tty->minor, arg); 308c: 1284000c addne r0, r4, #12 3090: 18900003 ldmne r0, {r0, r1} 3094: 11a02005 movne r2, r5 3098: 11a0e00f movne lr, pc 309c: 112fff13 bxne r3 if (tty->forw == NULL) { 30a0: e894000c ldm r4, {r2, r3} 30a4: 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; 30a8: 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) { 30ac: 1a000003 bne 30c0 rtems_termios_ttyTail = tty->back; 30b0: e59f10a0 ldr r1, [pc, #160] ; 3158 if ( rtems_termios_ttyTail != NULL ) { 30b4: 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; 30b8: e5813000 str r3, [r1] if ( rtems_termios_ttyTail != NULL ) { rtems_termios_ttyTail->forw = NULL; 30bc: 15832000 strne r2, [r3] } } else { tty->forw->back = tty->back; } if (tty->back == NULL) { 30c0: e5942004 ldr r2, [r4, #4] 30c4: e5943000 ldr r3, [r4] 30c8: 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; 30cc: 15823000 strne r3, [r2] } } else { tty->forw->back = tty->back; } if (tty->back == NULL) { 30d0: 1a000003 bne 30e4 rtems_termios_ttyHead = tty->forw; 30d4: e59f1080 ldr r1, [pc, #128] ; 315c if ( rtems_termios_ttyHead != NULL ) { 30d8: e3530000 cmp r3, #0 } else { tty->forw->back = tty->back; } if (tty->back == NULL) { rtems_termios_ttyHead = tty->forw; 30dc: e5813000 str r3, [r1] if ( rtems_termios_ttyHead != NULL ) { rtems_termios_ttyHead->back = NULL; 30e0: 15832004 strne r2, [r3, #4] } } else { tty->back->forw = tty->forw; } rtems_semaphore_delete (tty->isem); 30e4: e5940014 ldr r0, [r4, #20] 30e8: eb00073c bl 4de0 rtems_semaphore_delete (tty->osem); 30ec: e5940018 ldr r0, [r4, #24] 30f0: eb00073a bl 4de0 rtems_semaphore_delete (tty->rawOutBuf.Semaphore); 30f4: e594008c ldr r0, [r4, #140] ; 0x8c 30f8: eb000738 bl 4de0 if ((tty->device.pollRead == NULL) || 30fc: e59430a0 ldr r3, [r4, #160] ; 0xa0 3100: e3530000 cmp r3, #0 3104: 0a000002 beq 3114 3108: e59430b4 ldr r3, [r4, #180] ; 0xb4 310c: e3530002 cmp r3, #2 3110: 1a000001 bne 311c (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)) rtems_semaphore_delete (tty->rawInBuf.Semaphore); 3114: e5940068 ldr r0, [r4, #104] ; 0x68 3118: eb000730 bl 4de0 free (tty->rawInBuf.theBuf); 311c: e5940058 ldr r0, [r4, #88] ; 0x58 3120: ebfffae1 bl 1cac free (tty->rawOutBuf.theBuf); 3124: e594007c ldr r0, [r4, #124] ; 0x7c 3128: ebfffadf bl 1cac free (tty->cbuf); 312c: e594001c ldr r0, [r4, #28] 3130: ebfffadd bl 1cac free (tty); 3134: e1a00004 mov r0, r4 3138: ebfffadb bl 1cac } rtems_semaphore_release (rtems_termios_ttyMutex); 313c: e59f300c ldr r3, [pc, #12] ; 3150 3140: e5930000 ldr r0, [r3] 3144: eb000792 bl 4f94 return RTEMS_SUCCESSFUL; } 3148: e3a00000 mov r0, #0 314c: e8bd8030 pop {r4, r5, pc} =============================================================================== 000044dc : rtems_status_code sc; /* * sum up character count already sent */ tty->t_dqlen += len; 44dc: e5902090 ldr r2, [r0, #144] ; 0x90 44e0: e0822001 add r2, r2, r1 if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 44e4: e59010b4 ldr r1, [r0, #180] ; 0xb4 44e8: 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) { 44ec: e52de004 push {lr} ; (str lr, [sp, #-4]!) rtems_status_code sc; /* * sum up character count already sent */ tty->t_dqlen += len; 44f0: e5802090 str r2, [r0, #144] ; 0x90 if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 44f4: 1a000004 bne 450c /* * send wake up to transmitter task */ sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT); 44f8: e59000c8 ldr r0, [r0, #200] ; 0xc8 44fc: eb00014c bl 4a34 if (sc != RTEMS_SUCCESSFUL) 4500: e2503000 subs r3, r0, #0 4504: 0a00000d beq 4540 rtems_fatal_error_occurred (sc); 4508: eb0003f6 bl 54e8 <== NOT EXECUTED return 0; /* nothing to output in IRQ... */ } if (tty->t_line == PPPDISC ) { 450c: e59030cc ldr r3, [r0, #204] ; 0xcc 4510: e3530005 cmp r3, #5 4514: 1a000007 bne 4538 /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 4518: e59f3028 ldr r3, [pc, #40] ; 4548 451c: e59330b4 ldr r3, [r3, #180] ; 0xb4 4520: e3530000 cmp r3, #0 4524: 0a000005 beq 4540 rtems_termios_linesw[tty->t_line].l_start(tty); 4528: e1a0e00f mov lr, pc 452c: e12fff13 bx r3 } return 0; /* nothing to output in IRQ... */ 4530: e3a03000 mov r3, #0 4534: ea000001 b 4540 } return rtems_termios_refill_transmitter(tty); } 4538: 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); 453c: eaffff5a b 42ac } 4540: e1a00003 mov r0, r3 4544: e49df004 pop {pc} ; (ldr pc, [sp], #4) =============================================================================== 00003fa8 : * 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) { 3fa8: 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) { 3fac: e59030cc ldr r3, [r0, #204] ; 0xcc 3fb0: e59f7288 ldr r7, [pc, #648] ; 4240 3fb4: e0873283 add r3, r7, r3, lsl #5 3fb8: e5939010 ldr r9, [r3, #16] 3fbc: 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) { 3fc0: e1a04000 mov r4, r0 3fc4: 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) { 3fc8: 11a05002 movne r5, r2 3fcc: 1a00000d bne 4008 /* * 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); 3fd0: e2803030 add r3, r0, #48 ; 0x30 3fd4: 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, 3fd8: 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) { 3fdc: e1a08002 mov r8, r2 3fe0: 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, 3fe4: e58d3004 str r3, [sp, #4] 3fe8: ea00008b b 421c 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); 3fec: e59430cc ldr r3, [r4, #204] ; 0xcc 3ff0: e4d60001 ldrb r0, [r6], #1 3ff4: e0873283 add r3, r7, r3, lsl #5 3ff8: e1a01004 mov r1, r4 3ffc: e1a0e00f mov lr, pc 4000: e593f010 ldr pc, [r3, #16] 4004: 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--) { 4008: e3550000 cmp r5, #0 400c: 1afffff6 bne 3fec } /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { 4010: e59430e4 ldr r3, [r4, #228] ; 0xe4 4014: e3530000 cmp r3, #0 4018: 1a000086 bne 4238 401c: e59430dc ldr r3, [r4, #220] ; 0xdc 4020: e3530000 cmp r3, #0 4024: 0a000083 beq 4238 (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); 4028: e2840030 add r0, r4, #48 ; 0x30 402c: e59410e0 ldr r1, [r4, #224] ; 0xe0 4030: e1a0e00f mov lr, pc 4034: e12fff13 bx r3 tty->tty_rcvwakeup = 1; 4038: e3a03001 mov r3, #1 403c: e58430e4 str r3, [r4, #228] ; 0xe4 4040: ea00007c b 4238 while (len--) { c = *buf++; /* FIXME: implement IXANY: any character restarts output */ /* if incoming XON/XOFF controls outgoing stream: */ if (tty->flow_ctrl & FL_MDXON) { 4044: e59430b8 ldr r3, [r4, #184] ; 0xb8 4048: e3130c02 tst r3, #512 ; 0x200 } return 0; } while (len--) { c = *buf++; 404c: 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) { 4050: 0a00000f beq 4094 /* if received char is V_STOP and V_START (both are equal value) */ if (c == tty->termios.c_cc[VSTOP]) { 4054: e5d4204a ldrb r2, [r4, #74] ; 0x4a 4058: e152000a cmp r2, sl 405c: e5d43049 ldrb r3, [r4, #73] ; 0x49 4060: 1a000007 bne 4084 if (c == tty->termios.c_cc[VSTART]) { 4064: e1530002 cmp r3, r2 /* received VSTOP and VSTART==VSTOP? */ /* then toggle "stop output" status */ tty->flow_ctrl = tty->flow_ctrl ^ FL_ORCVXOF; 4068: 059430b8 ldreq r3, [r4, #184] ; 0xb8 } else { /* VSTOP received (other code than VSTART) */ /* stop output */ tty->flow_ctrl |= FL_ORCVXOF; 406c: 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; 4070: 02233010 eoreq r3, r3, #16 } else { /* VSTOP received (other code than VSTART) */ /* stop output */ tty->flow_ctrl |= FL_ORCVXOF; 4074: 13833010 orrne r3, r3, #16 4078: 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) { 407c: e3a09001 mov r9, #1 4080: ea000005 b 409c /* stop output */ tty->flow_ctrl |= FL_ORCVXOF; } flow_rcv = true; } else if (c == tty->termios.c_cc[VSTART]) { 4084: e153000a cmp r3, sl /* VSTART received */ /* restart output */ tty->flow_ctrl &= ~FL_ORCVXOF; 4088: 059430b8 ldreq r3, [r4, #184] ; 0xb8 408c: 03c33010 biceq r3, r3, #16 /* stop output */ tty->flow_ctrl |= FL_ORCVXOF; } flow_rcv = true; } else if (c == tty->termios.c_cc[VSTART]) { 4090: 0afffff8 beq 4078 /* restart output */ tty->flow_ctrl &= ~FL_ORCVXOF; flow_rcv = true; } } if (flow_rcv) { 4094: e3590000 cmp r9, #0 4098: 0a000014 beq 40f0 /* restart output according to FL_ORCVXOF flag */ if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) { 409c: e59430b8 ldr r3, [r4, #184] ; 0xb8 40a0: e2033030 and r3, r3, #48 ; 0x30 40a4: e3530020 cmp r3, #32 40a8: 1a00005a bne 4218 /* disable interrupts */ rtems_interrupt_disable(level); 40ac: ebfffa93 bl 2b00 <== NOT EXECUTED 40b0: e1a07000 mov r7, r0 <== NOT EXECUTED tty->flow_ctrl &= ~FL_OSTOP; 40b4: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 40b8: e3c33020 bic r3, r3, #32 <== NOT EXECUTED 40bc: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { 40c0: e5943094 ldr r3, [r4, #148] ; 0x94 <== NOT EXECUTED 40c4: e3530000 cmp r3, #0 <== NOT EXECUTED 40c8: 0a000006 beq 40e8 <== NOT EXECUTED /* if chars available, call write function... */ (*tty->device.write)( tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1); 40cc: 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)( 40d0: e594107c ldr r1, [r4, #124] ; 0x7c <== NOT EXECUTED 40d4: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED 40d8: e0811003 add r1, r1, r3 <== NOT EXECUTED 40dc: e3a02001 mov r2, #1 <== NOT EXECUTED 40e0: e1a0e00f mov lr, pc <== NOT EXECUTED 40e4: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED 40e8: e129f007 msr CPSR_fc, r7 <== NOT EXECUTED 40ec: ea000049 b 4218 <== NOT EXECUTED } /* reenable interrupts */ rtems_interrupt_enable(level); } } else { newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size; 40f0: e5940060 ldr r0, [r4, #96] ; 0x60 40f4: e5941064 ldr r1, [r4, #100] ; 0x64 40f8: e2800001 add r0, r0, #1 40fc: eb002d1e bl f57c <__umodsi3> 4100: e1a07000 mov r7, r0 /* if chars_in_buffer > highwater */ rtems_interrupt_disable(level); 4104: ebfffa7d bl 2b00 4108: e1a0b000 mov fp, r0 if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size) 410c: e594305c ldr r3, [r4, #92] ; 0x5c 4110: e5940064 ldr r0, [r4, #100] ; 0x64 4114: e0630000 rsb r0, r3, r0 % tty->rawInBuf.Size) > tty->highwater) && 4118: e5941064 ldr r1, [r4, #100] ; 0x64 411c: e0800007 add r0, r0, r7 4120: eb002d15 bl f57c <__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) 4124: e59430c0 ldr r3, [r4, #192] ; 0xc0 4128: e1500003 cmp r0, r3 412c: 9a000025 bls 41c8 % tty->rawInBuf.Size) > tty->highwater) && !(tty->flow_ctrl & FL_IREQXOF)) { 4130: 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) && 4134: e3130001 tst r3, #1 <== NOT EXECUTED 4138: 1a000022 bne 41c8 <== NOT EXECUTED !(tty->flow_ctrl & FL_IREQXOF)) { /* incoming data stream should be stopped */ tty->flow_ctrl |= FL_IREQXOF; 413c: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 4140: e3833001 orr r3, r3, #1 <== NOT EXECUTED 4144: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF)) 4148: e59f30f4 ldr r3, [pc, #244] ; 4244 <== NOT EXECUTED 414c: e59420b8 ldr r2, [r4, #184] ; 0xb8 <== NOT EXECUTED 4150: e0023003 and r3, r2, r3 <== NOT EXECUTED 4154: e3530b01 cmp r3, #1024 ; 0x400 <== NOT EXECUTED 4158: 1a00000e bne 4198 <== NOT EXECUTED == (FL_MDXOF ) ) { if ((tty->flow_ctrl & FL_OSTOP) || 415c: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 4160: e3130020 tst r3, #32 <== NOT EXECUTED 4164: 1a000002 bne 4174 <== NOT EXECUTED 4168: e5943094 ldr r3, [r4, #148] ; 0x94 <== NOT EXECUTED 416c: e3530000 cmp r3, #0 <== NOT EXECUTED 4170: 1a000014 bne 41c8 <== 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; 4174: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 4178: e3833002 orr r3, r3, #2 <== NOT EXECUTED 417c: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED (*tty->device.write)(tty->minor, 4180: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED 4184: e59d1004 ldr r1, [sp, #4] <== NOT EXECUTED 4188: e3a02001 mov r2, #1 <== NOT EXECUTED 418c: e1a0e00f mov lr, pc <== NOT EXECUTED 4190: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED 4194: ea00000b b 41c8 <== NOT EXECUTED (void *)&(tty->termios.c_cc[VSTOP]), 1); } } else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) { 4198: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 419c: e2033f41 and r3, r3, #260 ; 0x104 <== NOT EXECUTED 41a0: e3530c01 cmp r3, #256 ; 0x100 <== NOT EXECUTED 41a4: 1a000007 bne 41c8 <== NOT EXECUTED tty->flow_ctrl |= FL_IRTSOFF; 41a8: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 41ac: e3833004 orr r3, r3, #4 <== NOT EXECUTED 41b0: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED /* deactivate RTS line */ if (tty->device.stopRemoteTx != NULL) { 41b4: e59430ac ldr r3, [r4, #172] ; 0xac <== NOT EXECUTED 41b8: e3530000 cmp r3, #0 <== NOT EXECUTED tty->device.stopRemoteTx(tty->minor); 41bc: 15940010 ldrne r0, [r4, #16] <== NOT EXECUTED 41c0: 11a0e00f movne lr, pc <== NOT EXECUTED 41c4: 112fff13 bxne r3 <== NOT EXECUTED 41c8: e129f00b msr CPSR_fc, fp } /* reenable interrupts */ rtems_interrupt_enable(level); if (newTail == tty->rawInBuf.Head) { 41cc: e594305c ldr r3, [r4, #92] ; 0x5c 41d0: e1570003 cmp r7, r3 dropped++; 41d4: 02855001 addeq r5, r5, #1 } /* reenable interrupts */ rtems_interrupt_enable(level); if (newTail == tty->rawInBuf.Head) { 41d8: 0a00000e beq 4218 dropped++; } else { tty->rawInBuf.theBuf[newTail] = c; 41dc: e5943058 ldr r3, [r4, #88] ; 0x58 41e0: 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 )) { 41e4: e59430e4 ldr r3, [r4, #228] ; 0xe4 41e8: e3530000 cmp r3, #0 if (newTail == tty->rawInBuf.Head) { dropped++; } else { tty->rawInBuf.theBuf[newTail] = c; tty->rawInBuf.Tail = newTail; 41ec: 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 )) { 41f0: 1a000008 bne 4218 41f4: e59430dc ldr r3, [r4, #220] ; 0xdc 41f8: e3530000 cmp r3, #0 41fc: 0a000005 beq 4218 (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); 4200: e59d0000 ldr r0, [sp] <== NOT EXECUTED 4204: e59410e0 ldr r1, [r4, #224] ; 0xe0 <== NOT EXECUTED 4208: e1a0e00f mov lr, pc <== NOT EXECUTED 420c: e12fff13 bx r3 <== NOT EXECUTED tty->tty_rcvwakeup = 1; 4210: e3a03001 mov r3, #1 <== NOT EXECUTED 4214: e58430e4 str r3, [r4, #228] ; 0xe4 <== NOT EXECUTED 4218: e2488001 sub r8, r8, #1 tty->tty_rcvwakeup = 1; } return 0; } while (len--) { 421c: e3580000 cmp r8, #0 4220: 1affff87 bne 4044 } } } } tty->rawInBufDropped += dropped; 4224: e5943078 ldr r3, [r4, #120] ; 0x78 4228: e0833005 add r3, r3, r5 422c: e5843078 str r3, [r4, #120] ; 0x78 rtems_semaphore_release (tty->rawInBuf.Semaphore); 4230: e5940068 ldr r0, [r4, #104] ; 0x68 4234: eb000356 bl 4f94 return dropped; } 4238: e1a00005 mov r0, r5 423c: e8bd8ffc pop {r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00003178 : rtems_status_code rtems_termios_ioctl (void *arg) { rtems_libio_ioctl_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 3178: e5903000 ldr r3, [r0] } } rtems_status_code rtems_termios_ioctl (void *arg) { 317c: e92d41f0 push {r4, r5, r6, r7, r8, lr} rtems_libio_ioctl_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 3180: e5934034 ldr r4, [r3, #52] ; 0x34 struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer; rtems_status_code sc; args->ioctl_return = 0; 3184: 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; 3188: e5907008 ldr r7, [r0, #8] rtems_status_code sc; args->ioctl_return = 0; 318c: e580100c str r1, [r0, #12] } } rtems_status_code rtems_termios_ioctl (void *arg) { 3190: 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); 3194: e1a02001 mov r2, r1 3198: e5940018 ldr r0, [r4, #24] 319c: eb000736 bl 4e7c if (sc != RTEMS_SUCCESSFUL) { 31a0: e2506000 subs r6, r0, #0 31a4: 1a0000d4 bne 34fc args->ioctl_return = sc; return sc; } switch (args->command) { 31a8: e5953004 ldr r3, [r5, #4] 31ac: e3530004 cmp r3, #4 31b0: 0a0000a8 beq 3458 31b4: 8a000005 bhi 31d0 31b8: e3530002 cmp r3, #2 31bc: 0a000029 beq 3268 31c0: 8a00009d bhi 343c 31c4: e3530001 cmp r3, #1 31c8: 1a000010 bne 3210 31cc: ea00001b b 3240 31d0: e59f2330 ldr r2, [pc, #816] ; 3508 31d4: e1530002 cmp r3, r2 31d8: 0a0000ba beq 34c8 31dc: 8a000002 bhi 31ec 31e0: e3530005 cmp r3, #5 31e4: 1a000009 bne 3210 31e8: ea000096 b 3448 31ec: e59f2318 ldr r2, [pc, #792] ; 350c 31f0: 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; 31f4: 05953008 ldreq r3, [r5, #8] 31f8: 059420cc ldreq r2, [r4, #204] ; 0xcc 31fc: 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) { 3200: 0a0000bb beq 34f4 3204: e2822105 add r2, r2, #1073741825 ; 0x40000001 3208: e1530002 cmp r3, r2 320c: 0a000095 beq 3468 default: if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) { 3210: e59420cc ldr r2, [r4, #204] ; 0xcc 3214: e59f32f4 ldr r3, [pc, #756] ; 3510 3218: e0833282 add r3, r3, r2, lsl #5 321c: e5933018 ldr r3, [r3, #24] 3220: e3530000 cmp r3, #0 sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args); } else { sc = RTEMS_INVALID_NUMBER; 3224: 03a0600a moveq r6, #10 args->ioctl_return = sc; return sc; } switch (args->command) { default: if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) { 3228: 0a0000b1 beq 34f4 sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args); 322c: e1a00004 mov r0, r4 3230: e1a01005 mov r1, r5 3234: e1a0e00f mov lr, pc 3238: e12fff13 bx r3 323c: ea00009f b 34c0 sc = RTEMS_INVALID_NUMBER; } break; case RTEMS_IO_GET_ATTRIBUTES: *(struct termios *)args->buffer = tty->termios; 3240: e5957008 ldr r7, [r5, #8] 3244: e284c030 add ip, r4, #48 ; 0x30 3248: e8bc000f ldm ip!, {r0, r1, r2, r3} 324c: e1a0e007 mov lr, r7 3250: e8ae000f stmia lr!, {r0, r1, r2, r3} 3254: e8bc000f ldm ip!, {r0, r1, r2, r3} 3258: e8ae000f stmia lr!, {r0, r1, r2, r3} 325c: e59c3000 ldr r3, [ip] 3260: e58e3000 str r3, [lr] break; 3264: ea0000a2 b 34f4 case RTEMS_IO_SET_ATTRIBUTES: tty->termios = *(struct termios *)args->buffer; 3268: e595e008 ldr lr, [r5, #8] 326c: e8be000f ldm lr!, {r0, r1, r2, r3} 3270: e284c030 add ip, r4, #48 ; 0x30 3274: e8ac000f stmia ip!, {r0, r1, r2, r3} 3278: e8be000f ldm lr!, {r0, r1, r2, r3} 327c: e8ac000f stmia ip!, {r0, r1, r2, r3} 3280: e59e3000 ldr r3, [lr] 3284: 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) && 3288: e59430b8 ldr r3, [r4, #184] ; 0xb8 328c: e3130c02 tst r3, #512 ; 0x200 3290: 0a000018 beq 32f8 !(tty->termios.c_iflag & IXON)) { 3294: 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) && 3298: e3130b01 tst r3, #1024 ; 0x400 329c: 1a000015 bne 32f8 !(tty->termios.c_iflag & IXON)) { /* clear related flags in flow_ctrl */ tty->flow_ctrl &= ~(FL_MDXON | FL_ORCVXOF); 32a0: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 32a4: e3c33e21 bic r3, r3, #528 ; 0x210 <== NOT EXECUTED 32a8: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED /* has output been stopped due to received XOFF? */ if (tty->flow_ctrl & FL_OSTOP) { 32ac: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 32b0: e3130020 tst r3, #32 <== NOT EXECUTED 32b4: 0a00000f beq 32f8 <== NOT EXECUTED /* disable interrupts */ rtems_interrupt_disable(level); 32b8: ebfffe10 bl 2b00 <== NOT EXECUTED 32bc: e1a07000 mov r7, r0 <== NOT EXECUTED tty->flow_ctrl &= ~FL_OSTOP; 32c0: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 32c4: e3c33020 bic r3, r3, #32 <== NOT EXECUTED 32c8: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { 32cc: e5943094 ldr r3, [r4, #148] ; 0x94 <== NOT EXECUTED 32d0: e3530000 cmp r3, #0 <== NOT EXECUTED 32d4: 0a000006 beq 32f4 <== NOT EXECUTED /* if chars available, call write function... */ (*tty->device.write)( tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); 32d8: 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)( 32dc: e594107c ldr r1, [r4, #124] ; 0x7c <== NOT EXECUTED 32e0: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED 32e4: e0811003 add r1, r1, r3 <== NOT EXECUTED 32e8: e3a02001 mov r2, #1 <== NOT EXECUTED 32ec: e1a0e00f mov lr, pc <== NOT EXECUTED 32f0: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED 32f4: 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)) { 32f8: e59430b8 ldr r3, [r4, #184] ; 0xb8 32fc: e3130b01 tst r3, #1024 ; 0x400 3300: 0a000008 beq 3328 3304: e5943030 ldr r3, [r4, #48] ; 0x30 <== NOT EXECUTED 3308: e3130a01 tst r3, #4096 ; 0x1000 <== NOT EXECUTED 330c: 1a000005 bne 3328 <== NOT EXECUTED /* clear related flags in flow_ctrl */ tty->flow_ctrl &= ~(FL_MDXOF); 3310: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 3314: e3c33b01 bic r3, r3, #1024 ; 0x400 <== NOT EXECUTED 3318: 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); 331c: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 3320: e3c33002 bic r3, r3, #2 <== NOT EXECUTED 3324: 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)) { 3328: e59430b8 ldr r3, [r4, #184] ; 0xb8 332c: e3130c01 tst r3, #256 ; 0x100 3330: 0a000010 beq 3378 3334: e5943038 ldr r3, [r4, #56] ; 0x38 <== NOT EXECUTED 3338: e3530000 cmp r3, #0 <== NOT EXECUTED 333c: ba00000d blt 3378 <== NOT EXECUTED /* clear related flags in flow_ctrl */ tty->flow_ctrl &= ~(FL_MDRTS); 3340: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 3344: e3c33c01 bic r3, r3, #256 ; 0x100 <== NOT EXECUTED 3348: 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)) { 334c: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 3350: e3130004 tst r3, #4 <== NOT EXECUTED 3354: 0a000004 beq 336c <== NOT EXECUTED 3358: e59430b0 ldr r3, [r4, #176] ; 0xb0 <== NOT EXECUTED 335c: e3530000 cmp r3, #0 <== NOT EXECUTED tty->device.startRemoteTx(tty->minor); 3360: 15940010 ldrne r0, [r4, #16] <== NOT EXECUTED 3364: 11a0e00f movne lr, pc <== NOT EXECUTED 3368: 112fff13 bxne r3 <== NOT EXECUTED } tty->flow_ctrl &= ~(FL_IRTSOFF); 336c: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 3370: e3c33004 bic r3, r3, #4 <== NOT EXECUTED 3374: 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) { 3378: e5943038 ldr r3, [r4, #56] ; 0x38 337c: e3530000 cmp r3, #0 tty->flow_ctrl |= FL_MDRTS; 3380: b59430b8 ldrlt r3, [r4, #184] ; 0xb8 3384: b3833c01 orrlt r3, r3, #256 ; 0x100 3388: b58430b8 strlt r3, [r4, #184] ; 0xb8 } /* check for incoming XON/XOF flow control switched on */ if (tty->termios.c_iflag & IXOFF) { 338c: e5943030 ldr r3, [r4, #48] ; 0x30 3390: e3130a01 tst r3, #4096 ; 0x1000 tty->flow_ctrl |= FL_MDXOF; 3394: 159420b8 ldrne r2, [r4, #184] ; 0xb8 3398: 13822b01 orrne r2, r2, #1024 ; 0x400 339c: 158420b8 strne r2, [r4, #184] ; 0xb8 } /* check for outgoing XON/XOF flow control switched on */ if (tty->termios.c_iflag & IXON) { 33a0: e3130b01 tst r3, #1024 ; 0x400 tty->flow_ctrl |= FL_MDXON; 33a4: 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) { 33a8: 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; 33ac: 13833c02 orrne r3, r3, #512 ; 0x200 33b0: 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) { 33b4: e2177002 ands r7, r7, #2 tty->rawInBufSemaphoreOptions = RTEMS_WAIT; 33b8: 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) { 33bc: 1a000013 bne 3410 tty->rawInBufSemaphoreOptions = RTEMS_WAIT; tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT; tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; } else { tty->vtimeTicks = tty->termios.c_cc[VTIME] * 33c0: e5d48046 ldrb r8, [r4, #70] ; 0x46 rtems_clock_get_ticks_per_second() / 10; 33c4: eb000519 bl 4830 33c8: e3a0100a mov r1, #10 33cc: e0000098 mul r0, r8, r0 33d0: eb002fd1 bl f31c <__aeabi_uidiv> if (tty->termios.c_cc[VTIME]) { 33d4: e5d43046 ldrb r3, [r4, #70] ; 0x46 33d8: 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] * 33dc: e5840054 str r0, [r4, #84] ; 0x54 33e0: e5d42047 ldrb r2, [r4, #71] ; 0x47 rtems_clock_get_ticks_per_second() / 10; if (tty->termios.c_cc[VTIME]) { 33e4: 0a000005 beq 3400 tty->rawInBufSemaphoreOptions = RTEMS_WAIT; tty->rawInBufSemaphoreTimeout = tty->vtimeTicks; if (tty->termios.c_cc[VMIN]) tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; 33e8: 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; 33ec: e5840070 str r0, [r4, #112] ; 0x70 if (tty->termios.c_cc[VMIN]) tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; 33f0: 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; 33f4: e584706c str r7, [r4, #108] ; 0x6c tty->rawInBufSemaphoreTimeout = tty->vtimeTicks; if (tty->termios.c_cc[VMIN]) tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; 33f8: e5840074 str r0, [r4, #116] ; 0x74 33fc: ea000006 b 341c else tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks; } else { if (tty->termios.c_cc[VMIN]) { 3400: e3520000 cmp r2, #0 tty->rawInBufSemaphoreOptions = RTEMS_WAIT; tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT; tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; } else { tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT; 3404: 03a03001 moveq r3, #1 3408: 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]) { 340c: 0a000002 beq 341c tty->rawInBufSemaphoreOptions = RTEMS_WAIT; 3410: e584306c str r3, [r4, #108] ; 0x6c tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT; 3414: e5843070 str r3, [r4, #112] ; 0x70 tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; 3418: e5843074 str r3, [r4, #116] ; 0x74 } else { tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT; } } } if (tty->device.setAttributes) 341c: e59430a8 ldr r3, [r4, #168] ; 0xa8 3420: e3530000 cmp r3, #0 3424: 0a000032 beq 34f4 (*tty->device.setAttributes)(tty->minor, &tty->termios); 3428: e5940010 ldr r0, [r4, #16] 342c: e2841030 add r1, r4, #48 ; 0x30 3430: e1a0e00f mov lr, pc 3434: e12fff13 bx r3 3438: ea00002d b 34f4 break; case RTEMS_IO_TCDRAIN: drainOutput (tty); 343c: e1a00004 mov r0, r4 3440: ebfffdb2 bl 2b10 break; 3444: ea00002a b 34f4 case RTEMS_IO_SNDWAKEUP: tty->tty_snd = *wakeup; 3448: e897000c ldm r7, {r2, r3} 344c: e58420d4 str r2, [r4, #212] ; 0xd4 3450: e58430d8 str r3, [r4, #216] ; 0xd8 break; 3454: ea000026 b 34f4 case RTEMS_IO_RCVWAKEUP: tty->tty_rcv = *wakeup; 3458: e897000c ldm r7, {r2, r3} 345c: e58420dc str r2, [r4, #220] ; 0xdc 3460: e58430e0 str r3, [r4, #224] ; 0xe0 break; 3464: ea000022 b 34f4 #if 1 /* FIXME */ case TIOCSETD: /* * close old line discipline */ if (rtems_termios_linesw[tty->t_line].l_close != NULL) { 3468: e59420cc ldr r2, [r4, #204] ; 0xcc 346c: e59f309c ldr r3, [pc, #156] ; 3510 3470: e0833282 add r3, r3, r2, lsl #5 3474: e5933004 ldr r3, [r3, #4] 3478: e3530000 cmp r3, #0 347c: 0a000003 beq 3490 sc = rtems_termios_linesw[tty->t_line].l_close(tty); 3480: e1a00004 mov r0, r4 3484: e1a0e00f mov lr, pc 3488: e12fff13 bx r3 348c: e1a06000 mov r6, r0 } tty->t_line=*(int*)(args->buffer); 3490: e5953008 ldr r3, [r5, #8] tty->t_sc = NULL; /* ensure that no more valid data */ 3494: 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); 3498: e5933000 ldr r3, [r3] tty->t_sc = NULL; /* ensure that no more valid data */ 349c: e58420d0 str r2, [r4, #208] ; 0xd0 /* * open new line discipline */ if (rtems_termios_linesw[tty->t_line].l_open != NULL) { 34a0: e59f2068 ldr r2, [pc, #104] ; 3510 * 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); 34a4: 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) { 34a8: e7923283 ldr r3, [r2, r3, lsl #5] 34ac: e3530000 cmp r3, #0 34b0: 0a00000f beq 34f4 sc = rtems_termios_linesw[tty->t_line].l_open(tty); 34b4: e1a00004 mov r0, r4 34b8: e1a0e00f mov lr, pc 34bc: e12fff13 bx r3 34c0: e1a06000 mov r6, r0 34c4: ea00000a b 34f4 case TIOCGETD: *(int*)(args->buffer)=tty->t_line; break; #endif case FIONREAD: { int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head; 34c8: e5942060 ldr r2, [r4, #96] ; 0x60 <== NOT EXECUTED 34cc: e594305c ldr r3, [r4, #92] ; 0x5c <== NOT EXECUTED if ( rawnc < 0 ) 34d0: e0523003 subs r3, r2, r3 <== NOT EXECUTED rawnc += tty->rawInBuf.Size; 34d4: 45942064 ldrmi r2, [r4, #100] ; 0x64 <== NOT EXECUTED /* Half guess that this is the right operation */ *(int *)args->buffer = tty->ccount - tty->cindex + rawnc; 34d8: e2840020 add r0, r4, #32 <== NOT EXECUTED 34dc: e8900003 ldm r0, {r0, r1} <== NOT EXECUTED 34e0: 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; 34e4: 40833002 addmi r3, r3, r2 <== NOT EXECUTED /* Half guess that this is the right operation */ *(int *)args->buffer = tty->ccount - tty->cindex + rawnc; 34e8: e5952008 ldr r2, [r5, #8] <== NOT EXECUTED 34ec: e0813003 add r3, r1, r3 <== NOT EXECUTED 34f0: e5823000 str r3, [r2] <== NOT EXECUTED } break; } rtems_semaphore_release (tty->osem); 34f4: e5940018 ldr r0, [r4, #24] 34f8: eb0006a5 bl 4f94 args->ioctl_return = sc; 34fc: e585600c str r6, [r5, #12] return sc; } 3500: e1a00006 mov r0, r6 3504: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} =============================================================================== 00002b6c : rtems_device_major_number major, rtems_device_minor_number minor, void *arg, const rtems_termios_callbacks *callbacks ) { 2b6c: e92d4fff push {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, lr} 2b70: e58d300c str r3, [sp, #12] struct rtems_termios_tty *tty; /* * See if the device has already been opened */ sc = rtems_semaphore_obtain( 2b74: e59f3404 ldr r3, [pc, #1028] ; 2f80 rtems_device_major_number major, rtems_device_minor_number minor, void *arg, const rtems_termios_callbacks *callbacks ) { 2b78: e1a0a001 mov sl, r1 struct rtems_termios_tty *tty; /* * See if the device has already been opened */ sc = rtems_semaphore_obtain( 2b7c: e3a01000 mov r1, #0 rtems_device_major_number major, rtems_device_minor_number minor, void *arg, const rtems_termios_callbacks *callbacks ) { 2b80: e1a09000 mov r9, r0 2b84: e1a08002 mov r8, r2 struct rtems_termios_tty *tty; /* * See if the device has already been opened */ sc = rtems_semaphore_obtain( 2b88: e5930000 ldr r0, [r3] 2b8c: e1a02001 mov r2, r1 2b90: eb0008b9 bl 4e7c rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 2b94: e2506000 subs r6, r0, #0 2b98: 1a0000ee bne 2f58 return sc; for (tty = rtems_termios_ttyHead ; tty != NULL ; tty = tty->forw) { 2b9c: e59f33e0 ldr r3, [pc, #992] ; 2f84 2ba0: e5937000 ldr r7, [r3] 2ba4: e1a05007 mov r5, r7 2ba8: ea000006 b 2bc8 if ((tty->major == major) && (tty->minor == minor)) 2bac: e595300c ldr r3, [r5, #12] 2bb0: e1530009 cmp r3, r9 2bb4: 1a000002 bne 2bc4 2bb8: e5953010 ldr r3, [r5, #16] 2bbc: e153000a cmp r3, sl 2bc0: 0a0000c3 beq 2ed4 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) { 2bc4: e5955000 ldr r5, [r5] 2bc8: e3550000 cmp r5, #0 2bcc: 1afffff6 bne 2bac 2bd0: ea0000e3 b 2f64 return RTEMS_NO_MEMORY; } /* * allocate raw input buffer */ tty->rawInBuf.Size = RAW_INPUT_BUFFER_SIZE; 2bd4: e59f23ac ldr r2, [pc, #940] ; 2f88 2bd8: e5923000 ldr r3, [r2] 2bdc: e5853064 str r3, [r5, #100] ; 0x64 tty->rawInBuf.theBuf = malloc (tty->rawInBuf.Size); 2be0: e5950064 ldr r0, [r5, #100] ; 0x64 2be4: e58d2008 str r2, [sp, #8] 2be8: ebfffcfe bl 1fe8 if (tty->rawInBuf.theBuf == NULL) { 2bec: e3500000 cmp r0, #0 } /* * allocate raw input buffer */ tty->rawInBuf.Size = RAW_INPUT_BUFFER_SIZE; tty->rawInBuf.theBuf = malloc (tty->rawInBuf.Size); 2bf0: e1a0b000 mov fp, r0 2bf4: e5850058 str r0, [r5, #88] ; 0x58 if (tty->rawInBuf.theBuf == NULL) { 2bf8: e59d2008 ldr r2, [sp, #8] 2bfc: 1a000006 bne 2c1c free(tty); 2c00: e1a00005 mov r0, r5 2c04: ebfffc28 bl 1cac rtems_semaphore_release (rtems_termios_ttyMutex); 2c08: e59f3370 ldr r3, [pc, #880] ; 2f80 2c0c: e5930000 ldr r0, [r3] 2c10: eb0008df bl 4f94 return RTEMS_NO_MEMORY; 2c14: e3a0601a mov r6, #26 2c18: ea0000ce b 2f58 } /* * allocate raw output buffer */ tty->rawOutBuf.Size = RAW_OUTPUT_BUFFER_SIZE; 2c1c: e5923004 ldr r3, [r2, #4] 2c20: e5853088 str r3, [r5, #136] ; 0x88 tty->rawOutBuf.theBuf = malloc (tty->rawOutBuf.Size); 2c24: e5950088 ldr r0, [r5, #136] ; 0x88 2c28: e58d2008 str r2, [sp, #8] 2c2c: ebfffced bl 1fe8 if (tty->rawOutBuf.theBuf == NULL) { 2c30: e3500000 cmp r0, #0 } /* * allocate raw output buffer */ tty->rawOutBuf.Size = RAW_OUTPUT_BUFFER_SIZE; tty->rawOutBuf.theBuf = malloc (tty->rawOutBuf.Size); 2c34: e1a03000 mov r3, r0 2c38: e585007c str r0, [r5, #124] ; 0x7c if (tty->rawOutBuf.theBuf == NULL) { 2c3c: e59d2008 ldr r2, [sp, #8] 2c40: 0a000008 beq 2c68 return RTEMS_NO_MEMORY; } /* * allocate cooked buffer */ tty->cbuf = malloc (CBUFSIZE); 2c44: e5920008 ldr r0, [r2, #8] 2c48: e58d3008 str r3, [sp, #8] 2c4c: ebfffce5 bl 1fe8 if (tty->cbuf == NULL) { 2c50: e3500000 cmp r0, #0 return RTEMS_NO_MEMORY; } /* * allocate cooked buffer */ tty->cbuf = malloc (CBUFSIZE); 2c54: e585001c str r0, [r5, #28] if (tty->cbuf == NULL) { 2c58: e59d3008 ldr r3, [sp, #8] 2c5c: 1a000004 bne 2c74 free((void *)(tty->rawOutBuf.theBuf)); 2c60: e1a00003 mov r0, r3 <== NOT EXECUTED 2c64: ebfffc10 bl 1cac <== NOT EXECUTED free((void *)(tty->rawInBuf.theBuf)); 2c68: e1a0000b mov r0, fp 2c6c: ebfffc0e bl 1cac 2c70: eaffffe2 b 2c00 return RTEMS_NO_MEMORY; } /* * Initialize wakeup callbacks */ tty->tty_snd.sw_pfn = NULL; 2c74: e3a03000 mov r3, #0 /* * link tty */ tty->forw = rtems_termios_ttyHead; tty->back = NULL; 2c78: e5853004 str r3, [r5, #4] if (rtems_termios_ttyHead != NULL) 2c7c: e1570003 cmp r7, r3 return RTEMS_NO_MEMORY; } /* * Initialize wakeup callbacks */ tty->tty_snd.sw_pfn = NULL; 2c80: e58530d4 str r3, [r5, #212] ; 0xd4 tty->tty_snd.sw_arg = NULL; 2c84: e58530d8 str r3, [r5, #216] ; 0xd8 tty->tty_rcv.sw_pfn = NULL; 2c88: e58530dc str r3, [r5, #220] ; 0xdc tty->tty_rcv.sw_arg = NULL; 2c8c: e58530e0 str r3, [r5, #224] ; 0xe0 tty->tty_rcvwakeup = 0; 2c90: 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; 2c94: e59f32e8 ldr r3, [pc, #744] ; 2f84 2c98: e5834000 str r4, [r3] if (rtems_termios_ttyTail == NULL) 2c9c: e59f32e8 ldr r3, [pc, #744] ; 2f8c 2ca0: e5932000 ldr r2, [r3] * link tty */ tty->forw = rtems_termios_ttyHead; tty->back = NULL; if (rtems_termios_ttyHead != NULL) rtems_termios_ttyHead->back = tty; 2ca4: 15875004 strne r5, [r7, #4] tty->tty_rcvwakeup = 0; /* * link tty */ tty->forw = rtems_termios_ttyHead; 2ca8: e5857000 str r7, [r5] /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( rtems_build_name ('T', 'R', 'i', c), 2cac: e59f72d4 ldr r7, [pc, #724] ; 2f88 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) 2cb0: e3520000 cmp r2, #0 rtems_termios_ttyTail = tty; 2cb4: 05834000 streq r4, [r3] tty->major = major; /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( 2cb8: e59f02d0 ldr r0, [pc, #720] ; 2f90 rtems_build_name ('T', 'R', 'i', c), 2cbc: e5d7300c ldrb r3, [r7, #12] tty->major = major; /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( 2cc0: 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; 2cc4: e584a010 str sl, [r4, #16] tty->major = major; 2cc8: e584900c str r9, [r4, #12] /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( 2ccc: e1830000 orr r0, r3, r0 2cd0: e58d2000 str r2, [sp] 2cd4: e3a03000 mov r3, #0 2cd8: e3a01001 mov r1, #1 2cdc: e3a02054 mov r2, #84 ; 0x54 2ce0: eb0007d3 bl 4c34 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) 2ce4: e2503000 subs r3, r0, #0 2ce8: 1a000096 bne 2f48 rtems_fatal_error_occurred (sc); sc = rtems_semaphore_create ( rtems_build_name ('T', 'R', 'o', c), 2cec: 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 ( 2cf0: e59f029c ldr r0, [pc, #668] ; 2f94 2cf4: e2841018 add r1, r4, #24 2cf8: e58d1000 str r1, [sp] 2cfc: e1820000 orr r0, r2, r0 2d00: e3a01001 mov r1, #1 2d04: e3a02054 mov r2, #84 ; 0x54 2d08: eb0007c9 bl 4c34 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) 2d0c: e2501000 subs r1, r0, #0 2d10: 1a00008c bne 2f48 rtems_fatal_error_occurred (sc); sc = rtems_semaphore_create ( rtems_build_name ('T', 'R', 'x', c), 2d14: 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 ( 2d18: e59f0278 ldr r0, [pc, #632] ; 2f98 2d1c: e284208c add r2, r4, #140 ; 0x8c 2d20: e58d2000 str r2, [sp] 2d24: e1830000 orr r0, r3, r0 2d28: e3a02020 mov r2, #32 2d2c: e1a03001 mov r3, r1 2d30: eb0007bf bl 4c34 rtems_build_name ('T', 'R', 'x', c), 0, RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_FIFO, RTEMS_NO_PRIORITY, &tty->rawOutBuf.Semaphore); if (sc != RTEMS_SUCCESSFUL) 2d34: e250b000 subs fp, r0, #0 2d38: 1a000082 bne 2f48 tty->rawOutBufState = rob_idle; /* * Set callbacks */ tty->device = *callbacks; 2d3c: e59de00c ldr lr, [sp, #12] 2d40: e8be000f ldm lr!, {r0, r1, r2, r3} 2d44: e284c098 add ip, r4, #152 ; 0x98 2d48: e8ac000f stmia ip!, {r0, r1, r2, r3} 2d4c: e89e000f ldm lr, {r0, r1, r2, r3} 2d50: e88c000f stm ip, {r0, r1, r2, r3} /* * Create I/O tasks */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 2d54: e59430b4 ldr r3, [r4, #180] ; 0xb4 2d58: 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; 2d5c: e584b094 str fp, [r4, #148] ; 0x94 tty->device = *callbacks; /* * Create I/O tasks */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 2d60: 1a000017 bne 2dc4 sc = rtems_task_create ( rtems_build_name ('T', 'x', 'T', c), 2d64: e5d7300c ldrb r3, [r7, #12] /* * Create I/O tasks */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { sc = rtems_task_create ( 2d68: e59f022c ldr r0, [pc, #556] ; 2f9c 2d6c: e28420c8 add r2, r4, #200 ; 0xc8 2d70: e58d2004 str r2, [sp, #4] 2d74: e1830000 orr r0, r3, r0 2d78: e3a02b01 mov r2, #1024 ; 0x400 2d7c: e3a0100a mov r1, #10 2d80: e3a03c05 mov r3, #1280 ; 0x500 2d84: e58db000 str fp, [sp] 2d88: eb0008a8 bl 5030 TERMIOS_TXTASK_STACKSIZE, RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, &tty->txTaskId); if (sc != RTEMS_SUCCESSFUL) 2d8c: e2502000 subs r2, r0, #0 2d90: 1a00006c bne 2f48 rtems_fatal_error_occurred (sc); sc = rtems_task_create ( rtems_build_name ('R', 'x', 'T', c), 2d94: 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 ( 2d98: e59f0200 ldr r0, [pc, #512] ; 2fa0 2d9c: e58d2000 str r2, [sp] 2da0: e28420c4 add r2, r4, #196 ; 0xc4 2da4: e58d2004 str r2, [sp, #4] 2da8: e1830000 orr r0, r3, r0 2dac: e3a01009 mov r1, #9 2db0: e3a02b01 mov r2, #1024 ; 0x400 2db4: e3a03c05 mov r3, #1280 ; 0x500 2db8: eb00089c bl 5030 TERMIOS_RXTASK_STACKSIZE, RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, &tty->rxTaskId); if (sc != RTEMS_SUCCESSFUL) 2dbc: e3500000 cmp r0, #0 2dc0: 1a000060 bne 2f48 rtems_fatal_error_occurred (sc); } if ((tty->device.pollRead == NULL) || 2dc4: e59430a0 ldr r3, [r4, #160] ; 0xa0 2dc8: e3530000 cmp r3, #0 2dcc: 0a000002 beq 2ddc 2dd0: e59430b4 ldr r3, [r4, #180] ; 0xb4 2dd4: e3530002 cmp r3, #2 2dd8: 1a00000b bne 2e0c (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){ sc = rtems_semaphore_create ( rtems_build_name ('T', 'R', 'r', c), 2ddc: e59f31a4 ldr r3, [pc, #420] ; 2f88 rtems_fatal_error_occurred (sc); } if ((tty->device.pollRead == NULL) || (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){ sc = rtems_semaphore_create ( 2de0: e59f01bc ldr r0, [pc, #444] ; 2fa4 rtems_build_name ('T', 'R', 'r', c), 2de4: 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 ( 2de8: e2842068 add r2, r4, #104 ; 0x68 2dec: e3a01000 mov r1, #0 2df0: e58d2000 str r2, [sp] 2df4: e1830000 orr r0, r3, r0 2df8: e3a02024 mov r2, #36 ; 0x24 2dfc: e1a03001 mov r3, r1 2e00: eb00078b bl 4c34 rtems_build_name ('T', 'R', 'r', c), 0, RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &tty->rawInBuf.Semaphore); if (sc != RTEMS_SUCCESSFUL) 2e04: e3500000 cmp r0, #0 2e08: 1a00004e bne 2f48 } /* * Set default parameters */ tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL; 2e0c: e59f3194 ldr r3, [pc, #404] ; 2fa8 2e10: e5843030 str r3, [r4, #48] ; 0x30 tty->termios.c_oflag = OPOST | ONLCR | XTABS; 2e14: e59f3190 ldr r3, [pc, #400] ; 2fac 2e18: e5843034 str r3, [r4, #52] ; 0x34 tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL; 2e1c: e59f318c ldr r3, [pc, #396] ; 2fb0 2e20: e5843038 str r3, [r4, #56] ; 0x38 tty->termios.c_lflag = 2e24: e59f3188 ldr r3, [pc, #392] ; 2fb4 2e28: e584303c str r3, [r4, #60] ; 0x3c ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL; tty->termios.c_cc[VINTR] = '\003'; 2e2c: e3a03003 mov r3, #3 2e30: e5c43041 strb r3, [r4, #65] ; 0x41 tty->termios.c_cc[VQUIT] = '\034'; 2e34: e2833019 add r3, r3, #25 2e38: e5c43042 strb r3, [r4, #66] ; 0x42 tty->termios.c_cc[VERASE] = '\177'; 2e3c: e2833063 add r3, r3, #99 ; 0x63 2e40: e5c43043 strb r3, [r4, #67] ; 0x43 tty->termios.c_cc[VKILL] = '\025'; 2e44: e3a03015 mov r3, #21 2e48: e5c43044 strb r3, [r4, #68] ; 0x44 tty->termios.c_cc[VEOF] = '\004'; 2e4c: e3a03004 mov r3, #4 2e50: e5c43045 strb r3, [r4, #69] ; 0x45 tty->termios.c_cc[VEOL] = '\000'; 2e54: 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; 2e58: 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'; 2e5c: e5c4304c strb r3, [r4, #76] ; 0x4c tty->termios.c_cc[VEOL2] = '\000'; 2e60: e5c43051 strb r3, [r4, #81] ; 0x51 tty->termios.c_cc[VSTART] = '\021'; 2e64: 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; 2e68: 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'; 2e6c: e5c42049 strb r2, [r4, #73] ; 0x49 tty->termios.c_cc[VSTOP] = '\023'; 2e70: e2822002 add r2, r2, #2 2e74: 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; 2e78: 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'; 2e7c: e2822007 add r2, r2, #7 2e80: 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; 2e84: 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'; 2e88: 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; 2e8c: 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'; 2e90: e5c4204d strb r2, [r4, #77] ; 0x4d tty->termios.c_cc[VDISCARD] = '\017'; 2e94: e3a0200f mov r2, #15 2e98: 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; 2e9c: 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'; 2ea0: e2822008 add r2, r2, #8 2ea4: 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; 2ea8: 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'; 2eac: e3a02016 mov r2, #22 2eb0: 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; 2eb4: e58430c0 str r3, [r4, #192] ; 0xc0 /* * Bump name characer */ if (c++ == 'z') 2eb8: e59f30c8 ldr r3, [pc, #200] ; 2f88 2ebc: e5d3200c ldrb r2, [r3, #12] 2ec0: e352007a cmp r2, #122 ; 0x7a 2ec4: e2821001 add r1, r2, #1 c = 'a'; 2ec8: 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') 2ecc: e5c3100c strb r1, [r3, #12] c = 'a'; 2ed0: 05c3200c strbeq r2, [r3, #12] } args->iop->data1 = tty; 2ed4: e5983000 ldr r3, [r8] 2ed8: e5835034 str r5, [r3, #52] ; 0x34 if (!tty->refcount++) { 2edc: e5953008 ldr r3, [r5, #8] 2ee0: e2832001 add r2, r3, #1 2ee4: e3530000 cmp r3, #0 2ee8: e5852008 str r2, [r5, #8] 2eec: 1a000016 bne 2f4c if (tty->device.firstOpen) 2ef0: e5953098 ldr r3, [r5, #152] ; 0x98 2ef4: e3530000 cmp r3, #0 (*tty->device.firstOpen)(major, minor, arg); 2ef8: 11a00009 movne r0, r9 2efc: 11a0100a movne r1, sl 2f00: 11a02008 movne r2, r8 2f04: 11a0e00f movne lr, pc 2f08: 112fff13 bxne r3 /* * start I/O tasks, if needed */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 2f0c: e59530b4 ldr r3, [r5, #180] ; 0xb4 2f10: e3530002 cmp r3, #2 2f14: 1a00000c bne 2f4c sc = rtems_task_start( 2f18: e59500c4 ldr r0, [r5, #196] ; 0xc4 2f1c: e59f1094 ldr r1, [pc, #148] ; 2fb8 2f20: e1a02005 mov r2, r5 2f24: eb0008e9 bl 52d0 tty->rxTaskId, rtems_termios_rxdaemon, (rtems_task_argument)tty); if (sc != RTEMS_SUCCESSFUL) 2f28: e3500000 cmp r0, #0 2f2c: 1a000005 bne 2f48 rtems_fatal_error_occurred (sc); sc = rtems_task_start( 2f30: e59500c8 ldr r0, [r5, #200] ; 0xc8 2f34: e59f1080 ldr r1, [pc, #128] ; 2fbc 2f38: e1a02005 mov r2, r5 2f3c: eb0008e3 bl 52d0 tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty); if (sc != RTEMS_SUCCESSFUL) 2f40: e3500000 cmp r0, #0 2f44: 0a000000 beq 2f4c rtems_fatal_error_occurred (sc); 2f48: eb000966 bl 54e8 } } rtems_semaphore_release (rtems_termios_ttyMutex); 2f4c: e59f302c ldr r3, [pc, #44] ; 2f80 2f50: e5930000 ldr r0, [r3] 2f54: eb00080e bl 4f94 return RTEMS_SUCCESSFUL; } 2f58: e1a00006 mov r0, r6 2f5c: e28dd010 add sp, sp, #16 2f60: 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)); 2f64: e3a00001 mov r0, #1 2f68: e3a010e8 mov r1, #232 ; 0xe8 2f6c: ebfffaea bl 1b1c if (tty == NULL) { 2f70: e2504000 subs r4, r0, #0 static char c = 'a'; /* * Create a new device */ tty = calloc (1, sizeof (struct rtems_termios_tty)); 2f74: e1a05000 mov r5, r0 if (tty == NULL) { 2f78: 1affff15 bne 2bd4 2f7c: eaffff21 b 2c08 =============================================================================== 00003c5c : rtems_status_code rtems_termios_read (void *arg) { rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 3c5c: e5903000 ldr r3, [r0] return RTEMS_SUCCESSFUL; } rtems_status_code rtems_termios_read (void *arg) { 3c60: 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; 3c64: 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); 3c68: 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; 3c6c: e5908010 ldr r8, [r0, #16] char *buffer = args->buffer; 3c70: e590b00c ldr fp, [r0, #12] return RTEMS_SUCCESSFUL; } rtems_status_code rtems_termios_read (void *arg) { 3c74: 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); 3c78: e1a02001 mov r2, r1 3c7c: e5940014 ldr r0, [r4, #20] 3c80: eb00047d bl 4e7c if (sc != RTEMS_SUCCESSFUL) 3c84: e2507000 subs r7, r0, #0 3c88: 1a0000be bne 3f88 return sc; if (rtems_termios_linesw[tty->t_line].l_read != NULL) { 3c8c: e59420cc ldr r2, [r4, #204] ; 0xcc 3c90: e59f32f8 ldr r3, [pc, #760] ; 3f90 3c94: e0833282 add r3, r3, r2, lsl #5 3c98: e5933008 ldr r3, [r3, #8] 3c9c: e3530000 cmp r3, #0 3ca0: 0a000005 beq 3cbc sc = rtems_termios_linesw[tty->t_line].l_read(tty,args); 3ca4: e1a00004 mov r0, r4 3ca8: e1a01005 mov r1, r5 3cac: e1a0e00f mov lr, pc 3cb0: e12fff13 bx r3 3cb4: e1a07000 mov r7, r0 3cb8: ea0000ae b 3f78 tty->tty_rcvwakeup = 0; rtems_semaphore_release (tty->isem); return sc; } if (tty->cindex == tty->ccount) { 3cbc: e5942024 ldr r2, [r4, #36] ; 0x24 3cc0: e5943020 ldr r3, [r4, #32] 3cc4: e1520003 cmp r2, r3 3cc8: 1a0000a1 bne 3f54 tty->cindex = tty->ccount = 0; tty->read_start_column = tty->column; 3ccc: e5943028 ldr r3, [r4, #40] ; 0x28 3cd0: e584302c str r3, [r4, #44] ; 0x2c if (tty->device.pollRead != NULL && 3cd4: e59430a0 ldr r3, [r4, #160] ; 0xa0 3cd8: e3530000 cmp r3, #0 rtems_semaphore_release (tty->isem); return sc; } if (tty->cindex == tty->ccount) { tty->cindex = tty->ccount = 0; 3cdc: e5847020 str r7, [r4, #32] 3ce0: e5847024 str r7, [r4, #36] ; 0x24 tty->read_start_column = tty->column; if (tty->device.pollRead != NULL && 3ce4: 0a00003b beq 3dd8 3ce8: e59430b4 ldr r3, [r4, #180] ; 0xb4 3cec: e3530000 cmp r3, #0 3cf0: 1a000038 bne 3dd8 static rtems_status_code fillBufferPoll (struct rtems_termios_tty *tty) { int n; if (tty->termios.c_lflag & ICANON) { 3cf4: e594303c ldr r3, [r4, #60] ; 0x3c 3cf8: e3130002 tst r3, #2 3cfc: 0a00000d beq 3d38 for (;;) { n = (*tty->device.pollRead)(tty->minor); 3d00: e5940010 ldr r0, [r4, #16] 3d04: e1a0e00f mov lr, pc 3d08: e594f0a0 ldr pc, [r4, #160] ; 0xa0 if (n < 0) { 3d0c: e3500000 cmp r0, #0 3d10: aa000002 bge 3d20 rtems_task_wake_after (1); 3d14: e3a00001 mov r0, #1 3d18: eb000584 bl 5330 3d1c: eafffff7 b 3d00 } else { if (siproc (n, tty)) 3d20: e20000ff and r0, r0, #255 ; 0xff 3d24: e1a01004 mov r1, r4 3d28: ebffff86 bl 3b48 3d2c: e3500000 cmp r0, #0 3d30: 0afffff2 beq 3d00 3d34: ea000086 b 3f54 } } } else { rtems_interval then, now; then = rtems_clock_get_ticks_since_boot(); 3d38: eb0002c4 bl 4850 3d3c: e1a06000 mov r6, r0 for (;;) { n = (*tty->device.pollRead)(tty->minor); 3d40: e5940010 ldr r0, [r4, #16] 3d44: e1a0e00f mov lr, pc 3d48: e594f0a0 ldr pc, [r4, #160] ; 0xa0 if (n < 0) { 3d4c: e3500000 cmp r0, #0 3d50: aa000013 bge 3da4 if (tty->termios.c_cc[VMIN]) { 3d54: e5d43047 ldrb r3, [r4, #71] ; 0x47 3d58: e3530000 cmp r3, #0 3d5c: e5d43046 ldrb r3, [r4, #70] ; 0x46 3d60: 0a000005 beq 3d7c if (tty->termios.c_cc[VTIME] && tty->ccount) { 3d64: e3530000 cmp r3, #0 3d68: 0a00000a beq 3d98 3d6c: e5943020 ldr r3, [r4, #32] 3d70: e3530000 cmp r3, #0 3d74: 0a000007 beq 3d98 3d78: ea000001 b 3d84 if ((now - then) > tty->vtimeTicks) { break; } } } else { if (!tty->termios.c_cc[VTIME]) 3d7c: e3530000 cmp r3, #0 <== NOT EXECUTED 3d80: 0a000073 beq 3f54 <== NOT EXECUTED break; now = rtems_clock_get_ticks_since_boot(); 3d84: eb0002b1 bl 4850 if ((now - then) > tty->vtimeTicks) { 3d88: e5943054 ldr r3, [r4, #84] ; 0x54 3d8c: e0660000 rsb r0, r6, r0 3d90: e1500003 cmp r0, r3 3d94: 8a00006e bhi 3f54 break; } } rtems_task_wake_after (1); 3d98: e3a00001 mov r0, #1 3d9c: eb000563 bl 5330 3da0: eaffffe6 b 3d40 } else { siproc (n, tty); 3da4: e20000ff and r0, r0, #255 ; 0xff 3da8: e1a01004 mov r1, r4 3dac: ebffff65 bl 3b48 if (tty->ccount >= tty->termios.c_cc[VMIN]) 3db0: e5d43047 ldrb r3, [r4, #71] ; 0x47 3db4: e5942020 ldr r2, [r4, #32] 3db8: e1520003 cmp r2, r3 3dbc: aa000064 bge 3f54 break; if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME]) 3dc0: e3530000 cmp r3, #0 3dc4: 0affffdd beq 3d40 3dc8: e5d43046 ldrb r3, [r4, #70] ; 0x46 3dcc: e3530000 cmp r3, #0 3dd0: 0affffda beq 3d40 3dd4: eaffffd7 b 3d38 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)( 3dd8: 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; 3ddc: e594a074 ldr sl, [r4, #116] ; 0x74 rtems_status_code sc; int wait = (int)1; 3de0: e3a06001 mov r6, #1 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && (tty->ccount < (CBUFSIZE-1))) { 3de4: e59f91a8 ldr r9, [pc, #424] ; 3f94 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)( 3de8: e58d2000 str r2, [sp] 3dec: ea000040 b 3ef4 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; 3df0: e594005c ldr r0, [r4, #92] ; 0x5c 3df4: e5941064 ldr r1, [r4, #100] ; 0x64 3df8: e2800001 add r0, r0, #1 3dfc: eb002dde bl f57c <__umodsi3> c = tty->rawInBuf.theBuf[newHead]; 3e00: e5943058 ldr r3, [r4, #88] ; 0x58 3e04: e7d3a000 ldrb sl, [r3, r0] tty->rawInBuf.Head = newHead; 3e08: e584005c str r0, [r4, #92] ; 0x5c if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size) 3e0c: e5943060 ldr r3, [r4, #96] ; 0x60 3e10: e5942064 ldr r2, [r4, #100] ; 0x64 3e14: e0823003 add r3, r2, r3 % tty->rawInBuf.Size) 3e18: e0600003 rsb r0, r0, r3 3e1c: e5941064 ldr r1, [r4, #100] ; 0x64 3e20: eb002dd5 bl f57c <__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) 3e24: e59430bc ldr r3, [r4, #188] ; 0xbc 3e28: e1500003 cmp r0, r3 3e2c: 2a00001f bcs 3eb0 % tty->rawInBuf.Size) < tty->lowwater) { tty->flow_ctrl &= ~FL_IREQXOF; 3e30: e59430b8 ldr r3, [r4, #184] ; 0xb8 3e34: e3c33001 bic r3, r3, #1 3e38: e58430b8 str r3, [r4, #184] ; 0xb8 /* if tx stopped and XON should be sent... */ if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF)) 3e3c: e59f3154 ldr r3, [pc, #340] ; 3f98 3e40: e59420b8 ldr r2, [r4, #184] ; 0xb8 3e44: e0023003 and r3, r2, r3 3e48: e59f2148 ldr r2, [pc, #328] ; 3f98 3e4c: e1530002 cmp r3, r2 3e50: 1a00000b bne 3e84 == (FL_MDXON | FL_ISNTXOF)) && ((tty->rawOutBufState == rob_idle) 3e54: e5943094 ldr r3, [r4, #148] ; 0x94 <== NOT EXECUTED 3e58: e3530000 cmp r3, #0 <== NOT EXECUTED 3e5c: 0a000002 beq 3e6c <== NOT EXECUTED || (tty->flow_ctrl & FL_OSTOP))) { 3e60: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 3e64: e3130020 tst r3, #32 <== NOT EXECUTED 3e68: 0a000005 beq 3e84 <== NOT EXECUTED /* XON should be sent now... */ (*tty->device.write)( 3e6c: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED 3e70: e59d1000 ldr r1, [sp] <== NOT EXECUTED 3e74: e3a02001 mov r2, #1 <== NOT EXECUTED 3e78: e1a0e00f mov lr, pc <== NOT EXECUTED 3e7c: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED 3e80: ea00000a b 3eb0 <== NOT EXECUTED tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1); } else if (tty->flow_ctrl & FL_MDRTS) { 3e84: e59430b8 ldr r3, [r4, #184] ; 0xb8 3e88: e3130c01 tst r3, #256 ; 0x100 3e8c: 0a000007 beq 3eb0 tty->flow_ctrl &= ~FL_IRTSOFF; 3e90: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 3e94: e3c33004 bic r3, r3, #4 <== NOT EXECUTED 3e98: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED /* activate RTS line */ if (tty->device.startRemoteTx != NULL) { 3e9c: e59430b0 ldr r3, [r4, #176] ; 0xb0 <== NOT EXECUTED 3ea0: e3530000 cmp r3, #0 <== NOT EXECUTED tty->device.startRemoteTx(tty->minor); 3ea4: 15940010 ldrne r0, [r4, #16] <== NOT EXECUTED 3ea8: 11a0e00f movne lr, pc <== NOT EXECUTED 3eac: 112fff13 bxne r3 <== NOT EXECUTED } } } /* continue processing new character */ if (tty->termios.c_lflag & ICANON) { 3eb0: e594303c ldr r3, [r4, #60] ; 0x3c 3eb4: e3130002 tst r3, #2 3eb8: 0a000005 beq 3ed4 if (siproc (c, tty)) 3ebc: e1a0000a mov r0, sl 3ec0: e1a01004 mov r1, r4 3ec4: ebffff1f bl 3b48 wait = 0; 3ec8: e3500000 cmp r0, #0 3ecc: 13a06000 movne r6, #0 3ed0: ea000006 b 3ef0 } else { siproc (c, tty); 3ed4: e1a0000a mov r0, sl <== NOT EXECUTED 3ed8: e1a01004 mov r1, r4 <== NOT EXECUTED 3edc: ebffff19 bl 3b48 <== NOT EXECUTED if (tty->ccount >= tty->termios.c_cc[VMIN]) 3ee0: e5d43047 ldrb r3, [r4, #71] ; 0x47 <== NOT EXECUTED 3ee4: e5942020 ldr r2, [r4, #32] <== NOT EXECUTED wait = 0; 3ee8: e1520003 cmp r2, r3 <== NOT EXECUTED 3eec: a3a06000 movge r6, #0 <== NOT EXECUTED } timeout = tty->rawInBufSemaphoreTimeout; 3ef0: e594a070 ldr sl, [r4, #112] ; 0x70 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 3ef4: e594205c ldr r2, [r4, #92] ; 0x5c 3ef8: e5943060 ldr r3, [r4, #96] ; 0x60 3efc: e1520003 cmp r2, r3 3f00: 0a000004 beq 3f18 (tty->ccount < (CBUFSIZE-1))) { 3f04: e5993008 ldr r3, [r9, #8] while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 3f08: e5942020 ldr r2, [r4, #32] (tty->ccount < (CBUFSIZE-1))) { 3f0c: e2433001 sub r3, r3, #1 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 3f10: e1520003 cmp r2, r3 3f14: baffffb5 blt 3df0 } /* * Wait for characters */ if ( wait ) { 3f18: e3560000 cmp r6, #0 3f1c: 0a00000c beq 3f54 sc = rtems_semaphore_obtain( 3f20: e2840068 add r0, r4, #104 ; 0x68 3f24: e8900003 ldm r0, {r0, r1} 3f28: e1a0200a mov r2, sl 3f2c: eb0003d2 bl 4e7c tty->rawInBuf.Semaphore, tty->rawInBufSemaphoreOptions, timeout); if (sc != RTEMS_SUCCESSFUL) 3f30: e3500000 cmp r0, #0 3f34: 0affffee beq 3ef4 3f38: ea000005 b 3f54 <== NOT EXECUTED if (sc != RTEMS_SUCCESSFUL) tty->cindex = tty->ccount = 0; } while (count && (tty->cindex < tty->ccount)) { *buffer++ = tty->cbuf[tty->cindex++]; 3f3c: e594201c ldr r2, [r4, #28] 3f40: e7d22003 ldrb r2, [r2, r3] 3f44: e2833001 add r3, r3, #1 3f48: e4cb2001 strb r2, [fp], #1 3f4c: e5843024 str r3, [r4, #36] ; 0x24 count--; 3f50: e2488001 sub r8, r8, #1 sc = fillBufferQueue (tty); if (sc != RTEMS_SUCCESSFUL) tty->cindex = tty->ccount = 0; } while (count && (tty->cindex < tty->ccount)) { 3f54: e3580000 cmp r8, #0 3f58: 0a000003 beq 3f6c 3f5c: e2842020 add r2, r4, #32 3f60: e892000c ldm r2, {r2, r3} 3f64: e1530002 cmp r3, r2 3f68: bafffff3 blt 3f3c *buffer++ = tty->cbuf[tty->cindex++]; count--; } args->bytes_moved = args->count - count; 3f6c: e5953010 ldr r3, [r5, #16] 3f70: e0688003 rsb r8, r8, r3 3f74: e5858018 str r8, [r5, #24] tty->tty_rcvwakeup = 0; 3f78: e3a03000 mov r3, #0 3f7c: e58430e4 str r3, [r4, #228] ; 0xe4 rtems_semaphore_release (tty->isem); 3f80: e5940014 ldr r0, [r4, #20] 3f84: eb000402 bl 4f94 return sc; } 3f88: e1a00007 mov r0, r7 3f8c: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 000042ac : int nToSend; rtems_interrupt_level level; int len; /* check for XOF/XON to send */ if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF)) 42ac: e59020b8 ldr r2, [r0, #184] ; 0xb8 42b0: e59f31b8 ldr r3, [pc, #440] ; 4470 42b4: e0023003 and r3, r2, r3 42b8: e59f21b4 ldr r2, [pc, #436] ; 4474 42bc: 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) { 42c0: e92d4070 push {r4, r5, r6, lr} 42c4: 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)) 42c8: 1a00000c bne 4300 == (FL_MDXOF | FL_IREQXOF)) { /* XOFF should be sent now... */ (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1); 42cc: e284104a add r1, r4, #74 ; 0x4a <== NOT EXECUTED 42d0: e2422b01 sub r2, r2, #1024 ; 0x400 <== NOT EXECUTED 42d4: e5900010 ldr r0, [r0, #16] <== NOT EXECUTED 42d8: e1a0e00f mov lr, pc <== NOT EXECUTED 42dc: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED rtems_interrupt_disable(level); 42e0: ebfffa06 bl 2b00 <== NOT EXECUTED tty->t_dqlen--; 42e4: e5943090 ldr r3, [r4, #144] ; 0x90 <== NOT EXECUTED 42e8: e2433001 sub r3, r3, #1 <== NOT EXECUTED 42ec: e5843090 str r3, [r4, #144] ; 0x90 <== NOT EXECUTED tty->flow_ctrl |= FL_ISNTXOF; 42f0: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 42f4: e3833002 orr r3, r3, #2 <== NOT EXECUTED 42f8: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED rtems_interrupt_enable(level); 42fc: ea00000f b 4340 <== NOT EXECUTED nToSend = 1; } else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) { 4300: e59030b8 ldr r3, [r0, #184] ; 0xb8 4304: e2033003 and r3, r3, #3 4308: e3530002 cmp r3, #2 430c: 1a00000e bne 434c * 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); 4310: e2841049 add r1, r4, #73 ; 0x49 <== NOT EXECUTED 4314: e3a02001 mov r2, #1 <== NOT EXECUTED 4318: e5900010 ldr r0, [r0, #16] <== NOT EXECUTED 431c: e1a0e00f mov lr, pc <== NOT EXECUTED 4320: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED rtems_interrupt_disable(level); 4324: ebfff9f5 bl 2b00 <== NOT EXECUTED tty->t_dqlen--; 4328: e5943090 ldr r3, [r4, #144] ; 0x90 <== NOT EXECUTED 432c: e2433001 sub r3, r3, #1 <== NOT EXECUTED 4330: e5843090 str r3, [r4, #144] ; 0x90 <== NOT EXECUTED tty->flow_ctrl &= ~FL_ISNTXOF; 4334: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 4338: e3c33002 bic r3, r3, #2 <== NOT EXECUTED 433c: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 4340: e129f000 msr CPSR_fc, r0 <== NOT EXECUTED rtems_interrupt_enable(level); nToSend = 1; 4344: e3a05001 mov r5, #1 <== NOT EXECUTED 4348: ea000046 b 4468 <== NOT EXECUTED } else { if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) { 434c: e5902080 ldr r2, [r0, #128] ; 0x80 4350: e5903084 ldr r3, [r0, #132] ; 0x84 4354: e1520003 cmp r2, r3 4358: 1a000005 bne 4374 /* * buffer was empty */ if (tty->rawOutBufState == rob_wait) { 435c: e5903094 ldr r3, [r0, #148] ; 0x94 4360: e3530002 cmp r3, #2 4364: 1a00003e bne 4464 /* * this should never happen... */ rtems_semaphore_release (tty->rawOutBuf.Semaphore); 4368: e590008c ldr r0, [r0, #140] ; 0x8c <== NOT EXECUTED 436c: eb000308 bl 4f94 <== NOT EXECUTED 4370: ea00003b b 4464 <== NOT EXECUTED } return 0; } rtems_interrupt_disable(level); 4374: ebfff9e1 bl 2b00 len = tty->t_dqlen; tty->t_dqlen = 0; 4378: e3a03000 mov r3, #0 } return 0; } rtems_interrupt_disable(level); len = tty->t_dqlen; 437c: e5942090 ldr r2, [r4, #144] ; 0x90 tty->t_dqlen = 0; 4380: e5843090 str r3, [r4, #144] ; 0x90 4384: e129f000 msr CPSR_fc, r0 rtems_interrupt_enable(level); newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size; 4388: e5943084 ldr r3, [r4, #132] ; 0x84 438c: e5941088 ldr r1, [r4, #136] ; 0x88 4390: e0820003 add r0, r2, r3 4394: eb002c78 bl f57c <__umodsi3> tty->rawOutBuf.Tail = newTail; if (tty->rawOutBufState == rob_wait) { 4398: e5943094 ldr r3, [r4, #148] ; 0x94 439c: 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; 43a0: e1a06000 mov r6, r0 tty->rawOutBuf.Tail = newTail; 43a4: e5840084 str r0, [r4, #132] ; 0x84 if (tty->rawOutBufState == rob_wait) { /* * wake up any pending writer task */ rtems_semaphore_release (tty->rawOutBuf.Semaphore); 43a8: 0594008c ldreq r0, [r4, #140] ; 0x8c 43ac: 0b0002f8 bleq 4f94 } if (newTail == tty->rawOutBuf.Head) { 43b0: e5943080 ldr r3, [r4, #128] ; 0x80 43b4: e1560003 cmp r6, r3 43b8: 1a00000a bne 43e8 nToSend = 0; /* * check to see if snd wakeup callback was set */ if ( tty->tty_snd.sw_pfn != NULL) { 43bc: e59430d4 ldr r3, [r4, #212] ; 0xd4 if (newTail == tty->rawOutBuf.Head) { /* * Buffer has become empty */ tty->rawOutBufState = rob_idle; 43c0: e3a05000 mov r5, #0 nToSend = 0; /* * check to see if snd wakeup callback was set */ if ( tty->tty_snd.sw_pfn != NULL) { 43c4: e1530005 cmp r3, r5 if (newTail == tty->rawOutBuf.Head) { /* * Buffer has become empty */ tty->rawOutBufState = rob_idle; 43c8: e5845094 str r5, [r4, #148] ; 0x94 nToSend = 0; 43cc: 01a05003 moveq r5, r3 /* * check to see if snd wakeup callback was set */ if ( tty->tty_snd.sw_pfn != NULL) { 43d0: 0a000021 beq 445c (*tty->tty_snd.sw_pfn)(&tty->termios, tty->tty_snd.sw_arg); 43d4: e2840030 add r0, r4, #48 ; 0x30 <== NOT EXECUTED 43d8: e59410d8 ldr r1, [r4, #216] ; 0xd8 <== NOT EXECUTED 43dc: e1a0e00f mov lr, pc <== NOT EXECUTED 43e0: e12fff13 bx r3 <== NOT EXECUTED 43e4: ea00001c b 445c <== NOT EXECUTED } } /* check, whether output should stop due to received XOFF */ else if ((tty->flow_ctrl & (FL_MDXON | FL_ORCVXOF)) 43e8: e59430b8 ldr r3, [r4, #184] ; 0xb8 43ec: e2033e21 and r3, r3, #528 ; 0x210 43f0: e3530e21 cmp r3, #528 ; 0x210 43f4: 1a000008 bne 441c == (FL_MDXON | FL_ORCVXOF)) { /* Buffer not empty, but output stops due to XOFF */ /* set flag, that output has been stopped */ rtems_interrupt_disable(level); 43f8: ebfff9c0 bl 2b00 <== NOT EXECUTED tty->flow_ctrl |= FL_OSTOP; 43fc: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED 4400: e3833020 orr r3, r3, #32 <== NOT EXECUTED 4404: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED tty->rawOutBufState = rob_busy; /*apm*/ 4408: e3a03001 mov r3, #1 <== NOT EXECUTED 440c: e5843094 str r3, [r4, #148] ; 0x94 <== NOT EXECUTED 4410: e129f000 msr CPSR_fc, r0 <== NOT EXECUTED rtems_interrupt_enable(level); nToSend = 0; 4414: e3a05000 mov r5, #0 <== NOT EXECUTED 4418: ea00000f b 445c <== NOT EXECUTED } else { /* * Buffer not empty, start tranmitter */ if (newTail > tty->rawOutBuf.Head) 441c: e5943080 ldr r3, [r4, #128] ; 0x80 4420: e1560003 cmp r6, r3 nToSend = tty->rawOutBuf.Size - newTail; 4424: 85945088 ldrhi r5, [r4, #136] ; 0x88 else nToSend = tty->rawOutBuf.Head - newTail; 4428: 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)) { 442c: 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; 4430: 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)) { 4434: e3130c06 tst r3, #1536 ; 0x600 nToSend = 1; } tty->rawOutBufState = rob_busy; /*apm*/ (*tty->device.write)( 4438: 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; 443c: 13a05001 movne r5, #1 } tty->rawOutBufState = rob_busy; /*apm*/ 4440: e3a03001 mov r3, #1 4444: e5843094 str r3, [r4, #148] ; 0x94 (*tty->device.write)( 4448: e5940010 ldr r0, [r4, #16] 444c: e0811006 add r1, r1, r6 4450: e1a02005 mov r2, r5 4454: e1a0e00f mov lr, pc 4458: e594f0a4 ldr pc, [r4, #164] ; 0xa4 tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend); } tty->rawOutBuf.Tail = newTail; /*apm*/ 445c: e5846084 str r6, [r4, #132] ; 0x84 4460: ea000000 b 4468 /* * this should never happen... */ rtems_semaphore_release (tty->rawOutBuf.Semaphore); } return 0; 4464: e3a05000 mov r5, #0 tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend); } tty->rawOutBuf.Tail = newTail; /*apm*/ } return nToSend; } 4468: e1a00005 mov r0, r5 446c: e8bd8070 pop {r4, r5, r6, pc} =============================================================================== 00003ba4 : rtems_status_code rtems_termios_write (void *arg) { rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 3ba4: e5903000 ldr r3, [r0] rtems_termios_puts (&c, 1, tty); } rtems_status_code rtems_termios_write (void *arg) { 3ba8: e92d41f0 push {r4, r5, r6, r7, r8, lr} rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 3bac: e5935034 ldr r5, [r3, #52] ; 0x34 rtems_status_code sc; sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 3bb0: e3a01000 mov r1, #0 rtems_termios_puts (&c, 1, tty); } rtems_status_code rtems_termios_write (void *arg) { 3bb4: 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); 3bb8: e1a02001 mov r2, r1 3bbc: e5950018 ldr r0, [r5, #24] 3bc0: eb0004ad bl 4e7c if (sc != RTEMS_SUCCESSFUL) 3bc4: e2506000 subs r6, r0, #0 3bc8: 1a000020 bne 3c50 return sc; if (rtems_termios_linesw[tty->t_line].l_write != NULL) { 3bcc: e59520cc ldr r2, [r5, #204] ; 0xcc 3bd0: e59f3080 ldr r3, [pc, #128] ; 3c58 3bd4: e0833282 add r3, r3, r2, lsl #5 3bd8: e593300c ldr r3, [r3, #12] 3bdc: e3530000 cmp r3, #0 3be0: 0a000005 beq 3bfc sc = rtems_termios_linesw[tty->t_line].l_write(tty,args); 3be4: e1a00005 mov r0, r5 3be8: e1a01004 mov r1, r4 3bec: e1a0e00f mov lr, pc 3bf0: e12fff13 bx r3 3bf4: e1a06000 mov r6, r0 3bf8: ea000012 b 3c48 rtems_semaphore_release (tty->osem); return sc; } if (tty->termios.c_oflag & OPOST) { 3bfc: e5953034 ldr r3, [r5, #52] ; 0x34 3c00: e3130001 tst r3, #1 uint32_t count = args->count; 3c04: 15947010 ldrne r7, [r4, #16] char *buffer = args->buffer; 3c08: 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) { 3c0c: 1a000004 bne 3c24 3c10: ea000006 b 3c30 <== NOT EXECUTED uint32_t count = args->count; char *buffer = args->buffer; while (count--) oproc (*buffer++, tty); 3c14: e4d80001 ldrb r0, [r8], #1 3c18: e1a01005 mov r1, r5 3c1c: ebfffe7c bl 3614 3c20: e2477001 sub r7, r7, #1 return sc; } if (tty->termios.c_oflag & OPOST) { uint32_t count = args->count; char *buffer = args->buffer; while (count--) 3c24: e3570000 cmp r7, #0 3c28: 1afffff9 bne 3c14 3c2c: ea000003 b 3c40 oproc (*buffer++, tty); args->bytes_moved = args->count; } else { rtems_termios_puts (args->buffer, args->count, tty); 3c30: e284000c add r0, r4, #12 <== NOT EXECUTED 3c34: e8900003 ldm r0, {r0, r1} <== NOT EXECUTED 3c38: e1a02005 mov r2, r5 <== NOT EXECUTED 3c3c: ebfffe34 bl 3514 <== NOT EXECUTED args->bytes_moved = args->count; 3c40: e5943010 ldr r3, [r4, #16] 3c44: e5843018 str r3, [r4, #24] } rtems_semaphore_release (tty->osem); 3c48: e5950018 ldr r0, [r5, #24] 3c4c: eb0004d0 bl 4f94 return sc; } 3c50: e1a00006 mov r0, r6 3c54: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} =============================================================================== 000061e4 : { int local_errno = 0; int chars_written = 0; rtems_status_code status; if (error_flag & RTEMS_ERROR_PANIC) { 61e4: e3100202 tst r0, #536870912 ; 0x20000000 static int rtems_verror( rtems_error_code_t error_flag, const char *printf_format, va_list arglist ) { 61e8: e92d41f0 push {r4, r5, r6, r7, r8, lr} 61ec: e1a05000 mov r5, r0 61f0: e1a08001 mov r8, r1 61f4: e1a04002 mov r4, r2 int local_errno = 0; int chars_written = 0; rtems_status_code status; if (error_flag & RTEMS_ERROR_PANIC) { 61f8: 0a00000e beq 6238 if (rtems_panic_in_progress++) 61fc: e59f212c ldr r2, [pc, #300] ; 6330 6200: e5923000 ldr r3, [r2] 6204: e2831001 add r1, r3, #1 6208: e3530000 cmp r3, #0 620c: e5821000 str r1, [r2] 6210: 0a000003 beq 6224 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 6214: e59f3118 ldr r3, [pc, #280] ; 6334 <== NOT EXECUTED 6218: e5932000 ldr r2, [r3] <== NOT EXECUTED 621c: e2822001 add r2, r2, #1 <== NOT EXECUTED 6220: e5832000 str r2, [r3] <== NOT EXECUTED _Thread_Disable_dispatch(); /* disable task switches */ /* don't aggravate things */ if (rtems_panic_in_progress > 2) 6224: e59f3104 ldr r3, [pc, #260] ; 6330 6228: e5933000 ldr r3, [r3] 622c: e3530002 cmp r3, #2 return 0; 6230: 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) 6234: ca00003b bgt 6328 return 0; } (void) fflush(stdout); /* in case stdout/stderr same */ 6238: e59f30f8 ldr r3, [pc, #248] ; 6338 623c: e5933000 ldr r3, [r3] 6240: e5930008 ldr r0, [r3, #8] 6244: eb002bdb bl 111b8 status = error_flag & ~RTEMS_ERROR_MASK; 6248: e3c56207 bic r6, r5, #1879048192 ; 0x70000000 if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */ 624c: e2155101 ands r5, r5, #1073741824 ; 0x40000000 6250: 0a000001 beq 625c local_errno = errno; 6254: eb002ae0 bl 10ddc <__errno> 6258: 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); 625c: e59f70d4 ldr r7, [pc, #212] ; 6338 6260: e5973000 ldr r3, [r7] 6264: e1a02004 mov r2, r4 6268: e593000c ldr r0, [r3, #12] 626c: e1a01008 mov r1, r8 6270: eb004442 bl 17380 if (status) 6274: 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); 6278: e1a04000 mov r4, r0 if (status) 627c: 0a000008 beq 62a4 chars_written += fprintf(stderr, " (status: %s)", rtems_status_text(status)); 6280: e5973000 ldr r3, [r7] 6284: e1a00006 mov r0, r6 6288: e593700c ldr r7, [r3, #12] 628c: ebffffd0 bl 61d4 6290: e59f10a4 ldr r1, [pc, #164] ; 633c 6294: e1a02000 mov r2, r0 6298: e1a00007 mov r0, r7 629c: eb002cab bl 11550 #endif chars_written += vfprintf(stderr, printf_format, arglist); if (status) chars_written += 62a0: e0844000 add r4, r4, r0 fprintf(stderr, " (status: %s)", rtems_status_text(status)); if (local_errno) { 62a4: e3550000 cmp r5, #0 62a8: 0a000015 beq 6304 if ((local_errno > 0) && *strerror(local_errno)) 62ac: da00000d ble 62e8 62b0: e1a00005 mov r0, r5 62b4: eb002fa8 bl 1215c 62b8: e5d03000 ldrb r3, [r0] 62bc: e3530000 cmp r3, #0 62c0: 0a000008 beq 62e8 chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno)); 62c4: e59f306c ldr r3, [pc, #108] ; 6338 62c8: e5933000 ldr r3, [r3] 62cc: e1a00005 mov r0, r5 62d0: e593600c ldr r6, [r3, #12] 62d4: eb002fa0 bl 1215c 62d8: e59f1060 ldr r1, [pc, #96] ; 6340 62dc: e1a02000 mov r2, r0 62e0: e1a00006 mov r0, r6 62e4: ea000004 b 62fc else chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno); 62e8: e59f3048 ldr r3, [pc, #72] ; 6338 62ec: e5933000 ldr r3, [r3] 62f0: e59f104c ldr r1, [pc, #76] ; 6344 62f4: e593000c ldr r0, [r3, #12] 62f8: e1a02005 mov r2, r5 62fc: eb002c93 bl 11550 6300: e0844000 add r4, r4, r0 } chars_written += fprintf(stderr, "\n"); 6304: e59f502c ldr r5, [pc, #44] ; 6338 6308: e5953000 ldr r3, [r5] 630c: e59f1034 ldr r1, [pc, #52] ; 6348 6310: e593000c ldr r0, [r3, #12] 6314: eb002c8d bl 11550 (void) fflush(stderr); 6318: 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"); 631c: e0804004 add r4, r0, r4 (void) fflush(stderr); 6320: e593000c ldr r0, [r3, #12] 6324: eb002ba3 bl 111b8 return chars_written; } 6328: e1a00004 mov r0, r4 632c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} =============================================================================== 000023a8 : /* * Extract an integer value from the database */ static int scanInt(FILE *fp, int *val) { 23a8: 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; 23ac: e3a04000 mov r4, #0 /* * Extract an integer value from the database */ static int scanInt(FILE *fp, int *val) { 23b0: e58d1000 str r1, [sp] unsigned int limit = INT_MAX; int sign = 0; int d; for (;;) { c = getc(fp); 23b4: e59fb0d4 ldr fp, [pc, #212] ; 2490 limit++; continue; } sign = 1; } if (!isdigit(c)) 23b8: e59f90d4 ldr r9, [pc, #212] ; 2494 /* * Extract an integer value from the database */ static int scanInt(FILE *fp, int *val) { 23bc: e1a05000 mov r5, r0 int c; unsigned int i = 0; unsigned int limit = INT_MAX; 23c0: e3e08102 mvn r8, #-2147483648 ; 0x80000000 */ static int scanInt(FILE *fp, int *val) { int c; unsigned int i = 0; 23c4: e1a07004 mov r7, r4 sign = 1; } if (!isdigit(c)) return 0; d = c - '0'; if ((i > (limit / 10)) 23c8: e3a0a00a mov sl, #10 unsigned int limit = INT_MAX; int sign = 0; int d; for (;;) { c = getc(fp); 23cc: e5953004 ldr r3, [r5, #4] 23d0: e2433001 sub r3, r3, #1 23d4: e3530000 cmp r3, #0 23d8: e5853004 str r3, [r5, #4] 23dc: a5953000 ldrge r3, [r5] 23e0: a4d36001 ldrbge r6, [r3], #1 23e4: a5853000 strge r3, [r5] 23e8: aa000003 bge 23fc 23ec: e59b0000 ldr r0, [fp] <== NOT EXECUTED 23f0: e1a01005 mov r1, r5 <== NOT EXECUTED 23f4: eb003110 bl e83c <__srget_r> <== NOT EXECUTED 23f8: e1a06000 mov r6, r0 <== NOT EXECUTED if (c == ':') 23fc: e356003a cmp r6, #58 ; 0x3a 2400: 0a000019 beq 246c break; if (sign == 0) { 2404: e3540000 cmp r4, #0 2408: 1a000004 bne 2420 if (c == '-') { 240c: e356002d cmp r6, #45 ; 0x2d sign = -1; limit++; 2410: 02888001 addeq r8, r8, #1 c = getc(fp); if (c == ':') break; if (sign == 0) { if (c == '-') { sign = -1; 2414: 03e04000 mvneq r4, #0 for (;;) { c = getc(fp); if (c == ':') break; if (sign == 0) { if (c == '-') { 2418: 0affffeb beq 23cc sign = -1; limit++; continue; } sign = 1; 241c: e3a04001 mov r4, #1 } if (!isdigit(c)) 2420: e5993000 ldr r3, [r9] 2424: e0833006 add r3, r3, r6 2428: e5d30001 ldrb r0, [r3, #1] 242c: e2100004 ands r0, r0, #4 2430: 0a000015 beq 248c return 0; d = c - '0'; if ((i > (limit / 10)) 2434: e1a00008 mov r0, r8 2438: e3a0100a mov r1, #10 243c: eb003a08 bl 10c64 <__aeabi_uidiv> 2440: e1570000 cmp r7, r0 2444: 8a00000f bhi 2488 } sign = 1; } if (!isdigit(c)) return 0; d = c - '0'; 2448: e2466030 sub r6, r6, #48 ; 0x30 if ((i > (limit / 10)) || ((i == (limit / 10)) && (d > (limit % 10)))) 244c: 1a000004 bne 2464 2450: e1a00008 mov r0, r8 2454: e3a0100a mov r1, #10 2458: eb003a99 bl 10ec4 <__umodsi3> 245c: e1560000 cmp r6, r0 2460: 8a000008 bhi 2488 return 0; i = i * 10 + d; 2464: e027679a mla r7, sl, r7, r6 2468: eaffffd7 b 23cc } if (sign == 0) 246c: e3540000 cmp r4, #0 return 0; 2470: 01a00004 moveq r0, r4 *val = i * sign; 2474: 10040497 mulne r4, r7, r4 2478: 159d3000 ldrne r3, [sp] return 1; 247c: 13a00001 movne r0, #1 return 0; i = i * 10 + d; } if (sign == 0) return 0; *val = i * sign; 2480: 15834000 strne r4, [r3] return 1; 2484: ea000000 b 248c if (!isdigit(c)) return 0; d = c - '0'; if ((i > (limit / 10)) || ((i == (limit / 10)) && (d > (limit % 10)))) return 0; 2488: e3a00000 mov r0, #0 } if (sign == 0) return 0; *val = i * sign; return 1; } 248c: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00003b48 : int i; /* * Obtain output semaphore if character will be echoed */ if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) { 3b48: e591203c ldr r2, [r1, #60] ; 0x3c 3b4c: e59f304c ldr r3, [pc, #76] ; 3ba0 3b50: e0023003 and r3, r2, r3 3b54: e3530000 cmp r3, #0 /* * Process input character, with semaphore. */ static int siproc (unsigned char c, struct rtems_termios_tty *tty) { 3b58: e92d4030 push {r4, r5, lr} 3b5c: e1a04001 mov r4, r1 3b60: 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)) { 3b64: 0a00000b beq 3b98 rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 3b68: e5910018 ldr r0, [r1, #24] 3b6c: e3a01000 mov r1, #0 3b70: e1a02001 mov r2, r1 3b74: eb0004c0 bl 4e7c i = iproc (c, tty); 3b78: e1a01004 mov r1, r4 3b7c: e1a00005 mov r0, r5 3b80: ebffff8b bl 39b4 3b84: e1a05000 mov r5, r0 rtems_semaphore_release (tty->osem); 3b88: e5940018 ldr r0, [r4, #24] 3b8c: eb000500 bl 4f94 } else { i = iproc (c, tty); } return i; } 3b90: e1a00005 mov r0, r5 3b94: e8bd8030 pop {r4, r5, pc} 3b98: 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); 3b9c: eaffff84 b 39b4 <== NOT EXECUTED =============================================================================== 00005824 : */ int unmount( const char *path ) { 5824: e92d4070 push {r4, r5, r6, lr} 5828: e24dd018 sub sp, sp, #24 582c: 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 ) ) 5830: eb002247 bl e154 5834: e28d4004 add r4, sp, #4 5838: e3a03001 mov r3, #1 583c: e1a01000 mov r1, r0 5840: e58d3000 str r3, [sp] 5844: e1a00005 mov r0, r5 5848: e3a02000 mov r2, #0 584c: e1a03004 mov r3, r4 5850: ebfff475 bl 2a2c 5854: e3500000 cmp r0, #0 5858: 1a000040 bne 5960 return -1; mt_entry = loc.mt_entry; 585c: 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 ){ 5860: e59d3004 ldr r3, [sp, #4] 5864: e595201c ldr r2, [r5, #28] 5868: e1520003 cmp r2, r3 586c: 0a000004 beq 5884 rtems_filesystem_freenode( &loc ); 5870: e1a00004 mov r0, r4 5874: ebfff49c bl 2aec rtems_set_errno_and_return_minus_one( EACCES ); 5878: eb001cbd bl cb74 <__errno> 587c: e3a0300d mov r3, #13 5880: ea000011 b 58cc /* * Free the loc node and just use the nodes from the mt_entry . */ rtems_filesystem_freenode( &loc ); 5884: e1a00004 mov r0, r4 5888: ebfff497 bl 2aec * 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 ) 588c: e59f30d8 ldr r3, [pc, #216] ; 596c 5890: e5933000 ldr r3, [r3] 5894: e5933014 ldr r3, [r3, #20] 5898: e1530005 cmp r3, r5 589c: 0a000008 beq 58c4 /* * Verify there are no file systems below the path specified */ if ( rtems_filesystem_mount_iterate( is_fs_below_mount_point, 58a0: e59f00c8 ldr r0, [pc, #200] ; 5970 58a4: e595102c ldr r1, [r5, #44] ; 0x2c 58a8: ebfff6b1 bl 3374 58ac: e3500000 cmp r0, #0 58b0: 1a000003 bne 58c4 * 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 ) 58b4: e1a00005 mov r0, r5 58b8: ebfff566 bl 2e58 58bc: e3500001 cmp r0, #1 58c0: 1a000003 bne 58d4 rtems_set_errno_and_return_minus_one( EBUSY ); 58c4: eb001caa bl cb74 <__errno> 58c8: e3a03010 mov r3, #16 58cc: e5803000 str r3, [r0] 58d0: ea000022 b 5960 * 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 ) 58d4: e5953014 ldr r3, [r5, #20] 58d8: e1a00005 mov r0, r5 58dc: e1a0e00f mov lr, pc 58e0: e593f028 ldr pc, [r3, #40] ; 0x28 58e4: e2506000 subs r6, r0, #0 58e8: 1a00001c bne 5960 * 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){ 58ec: e5953028 ldr r3, [r5, #40] ; 0x28 58f0: e1a00005 mov r0, r5 58f4: e1a0e00f mov lr, pc 58f8: e593f02c ldr pc, [r3, #44] ; 0x2c 58fc: e2504000 subs r4, r0, #0 5900: 0a000007 beq 5924 if (( fs_mount_loc->ops->mount_h )( mt_entry ) != 0 ) 5904: e5953014 ldr r3, [r5, #20] 5908: e1a00005 mov r0, r5 <== NOT EXECUTED 590c: e1a0e00f mov lr, pc <== NOT EXECUTED 5910: e593f020 ldr pc, [r3, #32] <== NOT EXECUTED 5914: e3500000 cmp r0, #0 <== NOT EXECUTED 5918: 0a000010 beq 5960 <== NOT EXECUTED rtems_fatal_error_occurred( 0 ); 591c: e1a00006 mov r0, r6 <== NOT EXECUTED 5920: eb0003ca bl 6850 <== 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 ); 5924: e59f6048 ldr r6, [pc, #72] ; 5974 5928: e1a01004 mov r1, r4 592c: e1a02004 mov r2, r4 5930: e5960000 ldr r0, [r6] 5934: eb000242 bl 6244 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 5938: e1a00005 mov r0, r5 593c: eb000479 bl 6b28 <_Chain_Extract> } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 5940: e5960000 ldr r0, [r6] 5944: eb000284 bl 635c /* * 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 ); 5948: e2850008 add r0, r5, #8 594c: ebfff466 bl 2aec free( mt_entry ); 5950: e1a00005 mov r0, r5 5954: ebfff469 bl 2b00 return 0; 5958: e1a00004 mov r0, r4 595c: ea000000 b 5964 */ 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; 5960: e3e00000 mvn r0, #0 rtems_filesystem_freenode( fs_mount_loc ); free( mt_entry ); return 0; } 5964: e28dd018 add sp, sp, #24 5968: e8bd8070 pop {r4, r5, r6, pc}