RTEMS 4.11Annotated Report
Sat Oct 16 12:55:19 2010
00008848 <IMFS_Set_handlers>:
{
IMFS_jnode_t *node = loc->node_access;
IMFS_fs_info_t *fs_info;
fs_info = loc->mt_entry->fs_info;
switch( node->type ) {
8848: e5902000 ldr r2, [r0]
884c: 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;
8850: e5903010 ldr r3, [r0, #16]
switch( node->type ) {
8854: 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;
8858: e5933034 ldr r3, [r3, #52] ; 0x34
switch( node->type ) {
885c: e3520006 cmp r2, #6
8860: 979ff102 ldrls pc, [pc, r2, lsl #2]
8864: ea000010 b 88ac <IMFS_Set_handlers+0x64> <== NOT EXECUTED
8868: 00008884 .word 0x00008884 <== NOT EXECUTED
886c: 0000888c .word 0x0000888c <== NOT EXECUTED
8870: 00008894 .word 0x00008894 <== NOT EXECUTED
8874: 00008894 .word 0x00008894 <== NOT EXECUTED
8878: 0000889c .word 0x0000889c <== NOT EXECUTED
887c: 0000889c .word 0x0000889c <== NOT EXECUTED
8880: 000088a4 .word 0x000088a4 <== NOT EXECUTED
case IMFS_DIRECTORY:
loc->handlers = fs_info->directory_handlers;
8884: e593300c ldr r3, [r3, #12]
8888: ea000006 b 88a8 <IMFS_Set_handlers+0x60>
break;
case IMFS_DEVICE:
loc->handlers = &IMFS_device_handlers;
888c: e59f3020 ldr r3, [pc, #32] ; 88b4 <IMFS_Set_handlers+0x6c>
8890: ea000004 b 88a8 <IMFS_Set_handlers+0x60>
break;
case IMFS_SYM_LINK:
case IMFS_HARD_LINK:
loc->handlers = &IMFS_link_handlers;
8894: e59f301c ldr r3, [pc, #28] ; 88b8 <IMFS_Set_handlers+0x70>
8898: ea000002 b 88a8 <IMFS_Set_handlers+0x60>
break;
case IMFS_LINEAR_FILE:
loc->handlers = fs_info->memfile_handlers;
break;
case IMFS_MEMORY_FILE:
loc->handlers = fs_info->memfile_handlers;
889c: e5933008 ldr r3, [r3, #8]
88a0: ea000000 b 88a8 <IMFS_Set_handlers+0x60>
break;
case IMFS_FIFO:
loc->handlers = fs_info->fifo_handlers;
88a4: e5933010 ldr r3, [r3, #16]
88a8: e5803008 str r3, [r0, #8]
break;
}
return 0;
}
88ac: e3a00000 mov r0, #0
88b0: e12fff1e bx lr
00008970 <IMFS_eval_path>:
const char *pathname, /* IN */
size_t pathnamelen, /* IN */
int flags, /* IN */
rtems_filesystem_location_info_t *pathloc /* IN/OUT */
)
{
8970: 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 ) ) {
8974: e3d27007 bics r7, r2, #7
const char *pathname, /* IN */
size_t pathnamelen, /* IN */
int flags, /* IN */
rtems_filesystem_location_info_t *pathloc /* IN/OUT */
)
{
8978: e24dd040 sub sp, sp, #64 ; 0x40
897c: e58d0000 str r0, [sp]
8980: e1a06001 mov r6, r1
8984: e1a08002 mov r8, r2
8988: e1a04003 mov r4, r3
/*
* This was filled in by the caller and is valid in the
* mount table.
*/
node = pathloc->node_access;
898c: 05935000 ldreq r5, [r3]
rtems_filesystem_location_info_t *pathloc /* IN/OUT */
)
{
int i = 0;
int len;
IMFS_token_types type = IMFS_CURRENT_DIR;
8990: 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 );
8994: 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 ) ) {
8998: 0a000057 beq 8afc <IMFS_eval_path+0x18c>
rtems_set_errno_and_return_minus_one( EIO );
899c: eb000fff bl c9a0 <__errno> <== NOT EXECUTED
89a0: e3a03005 mov r3, #5 <== NOT EXECUTED
89a4: ea00007e b 8ba4 <IMFS_eval_path+0x234> <== 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 );
89a8: e59d2000 ldr r2, [sp]
89ac: e28d303c add r3, sp, #60 ; 0x3c
89b0: e0820007 add r0, r2, r7
89b4: e1a01006 mov r1, r6
89b8: e1a0200a mov r2, sl
89bc: eb0001ae bl 907c <IMFS_get_token>
pathnamelen -= len;
i += len;
if ( !pathloc->node_access )
89c0: e5943000 ldr r3, [r4]
89c4: 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 );
89c8: e1a09000 mov r9, r0
pathnamelen -= len;
89cc: e59db03c ldr fp, [sp, #60] ; 0x3c
i += len;
if ( !pathloc->node_access )
89d0: 0a000041 beq 8adc <IMFS_eval_path+0x16c>
rtems_set_errno_and_return_minus_one( ENOENT );
/*
* I cannot move out of this directory without execute permission.
*/
if ( type != IMFS_NO_MORE_PATH )
89d4: e3500000 cmp r0, #0
89d8: 0a000006 beq 89f8 <IMFS_eval_path+0x88>
if ( node->type == IMFS_DIRECTORY )
89dc: e595104c ldr r1, [r5, #76] ; 0x4c
89e0: e3510001 cmp r1, #1
89e4: 1a000003 bne 89f8 <IMFS_eval_path+0x88>
if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) )
89e8: e1a00004 mov r0, r4
89ec: ebffffb2 bl 88bc <IMFS_evaluate_permission>
89f0: e3500000 cmp r0, #0
89f4: 0a000068 beq 8b9c <IMFS_eval_path+0x22c>
rtems_set_errno_and_return_minus_one( EACCES );
node = pathloc->node_access;
switch( type ) {
89f8: 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;
89fc: e06b6006 rsb r6, fp, r6
i += len;
8a00: 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;
8a04: e5945000 ldr r5, [r4]
switch( type ) {
8a08: 0a000014 beq 8a60 <IMFS_eval_path+0xf0>
8a0c: e3590004 cmp r9, #4
8a10: 0a000036 beq 8af0 <IMFS_eval_path+0x180>
8a14: e3590002 cmp r9, #2
8a18: 1a000037 bne 8afc <IMFS_eval_path+0x18c>
case IMFS_UP_DIR:
/*
* Am I at the root of all filesystems? (chroot'ed?)
*/
if ( pathloc->node_access == rtems_filesystem_root.node_access )
8a1c: e59fc194 ldr ip, [pc, #404] ; 8bb8 <IMFS_eval_path+0x248>
8a20: e59c3000 ldr r3, [ip]
8a24: e5933018 ldr r3, [r3, #24]
8a28: e1550003 cmp r5, r3
8a2c: 0a000032 beq 8afc <IMFS_eval_path+0x18c>
/*
* Am I at the root of this mounted filesystem?
*/
if (pathloc->node_access ==
pathloc->mt_entry->mt_fs_root.node_access) {
8a30: e594e010 ldr lr, [r4, #16]
/*
* Am I at the root of this mounted filesystem?
*/
if (pathloc->node_access ==
8a34: e59e301c ldr r3, [lr, #28]
8a38: 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;
8a3c: 028dc028 addeq ip, sp, #40 ; 0x28
8a40: 028ee008 addeq lr, lr, #8
8a44: 0a000037 beq 8b28 <IMFS_eval_path+0x1b8>
pathnamelen+len,
flags,pathloc);
}
} else {
if ( !node->Parent )
8a48: e5955008 ldr r5, [r5, #8]
8a4c: e3550000 cmp r5, #0
8a50: 1a000024 bne 8ae8 <IMFS_eval_path+0x178>
rtems_set_errno_and_return_minus_one( ENOENT );
8a54: eb000fd1 bl c9a0 <__errno>
8a58: e5809000 str r9, [r0]
8a5c: ea000051 b 8ba8 <IMFS_eval_path+0x238>
case IMFS_NAME:
/*
* If we are at a link follow it.
*/
if ( node->type == IMFS_HARD_LINK ) {
8a60: e595304c ldr r3, [r5, #76] ; 0x4c
8a64: e3530003 cmp r3, #3
8a68: 1a000004 bne 8a80 <IMFS_eval_path+0x110>
IMFS_evaluate_hard_link( pathloc, 0 );
8a6c: e1a00004 mov r0, r4
8a70: e3a01000 mov r1, #0
8a74: ebffffaa bl 8924 <IMFS_evaluate_hard_link>
node = pathloc->node_access;
8a78: e5945000 ldr r5, [r4]
8a7c: ea000008 b 8aa4 <IMFS_eval_path+0x134>
* It would be a design error if we evaluated the link and
* was broken.
*/
IMFS_assert( node );
} else if ( node->type == IMFS_SYM_LINK ) {
8a80: e3530004 cmp r3, #4
8a84: 1a000006 bne 8aa4 <IMFS_eval_path+0x134>
result = IMFS_evaluate_sym_link( pathloc, 0 );
8a88: e1a00004 mov r0, r4
8a8c: e3a01000 mov r1, #0
8a90: eb000049 bl 8bbc <IMFS_evaluate_sym_link>
/*
* In contrast to a hard link, it is possible to have a broken
* symbolic link.
*/
node = pathloc->node_access;
if ( result == -1 )
8a94: e3700001 cmn r0, #1
* was broken.
*/
IMFS_assert( node );
} else if ( node->type == IMFS_SYM_LINK ) {
result = IMFS_evaluate_sym_link( pathloc, 0 );
8a98: e1a0b000 mov fp, r0
/*
* In contrast to a hard link, it is possible to have a broken
* symbolic link.
*/
node = pathloc->node_access;
8a9c: e5945000 ldr r5, [r4]
if ( result == -1 )
8aa0: 0a000041 beq 8bac <IMFS_eval_path+0x23c>
}
/*
* Only a directory can be decended into.
*/
if ( node->type != IMFS_DIRECTORY )
8aa4: e595304c ldr r3, [r5, #76] ; 0x4c
8aa8: e3530001 cmp r3, #1
8aac: 0a000002 beq 8abc <IMFS_eval_path+0x14c>
rtems_set_errno_and_return_minus_one( ENOTDIR );
8ab0: eb000fba bl c9a0 <__errno>
8ab4: e3a03014 mov r3, #20
8ab8: ea000039 b 8ba4 <IMFS_eval_path+0x234>
/*
* 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 ) {
8abc: e595e05c ldr lr, [r5, #92] ; 0x5c
8ac0: e35e0000 cmp lr, #0
8ac4: 1a000015 bne 8b20 <IMFS_eval_path+0x1b0>
}
/*
* Otherwise find the token name in the present location.
*/
node = IMFS_find_match_in_dir( node, token );
8ac8: e1a00005 mov r0, r5
8acc: e1a0100a mov r1, sl
8ad0: eb000149 bl 8ffc <IMFS_find_match_in_dir>
if ( !node )
8ad4: e2505000 subs r5, r0, #0
8ad8: 1a000002 bne 8ae8 <IMFS_eval_path+0x178>
rtems_set_errno_and_return_minus_one( ENOENT );
8adc: eb000faf bl c9a0 <__errno>
8ae0: e3a03002 mov r3, #2
8ae4: ea00002e b 8ba4 <IMFS_eval_path+0x234>
/*
* Set the node access to the point we have found.
*/
pathloc->node_access = node;
8ae8: e5845000 str r5, [r4]
8aec: ea000002 b 8afc <IMFS_eval_path+0x18c>
case IMFS_NO_MORE_PATH:
case IMFS_CURRENT_DIR:
break;
case IMFS_INVALID_TOKEN:
rtems_set_errno_and_return_minus_one( ENAMETOOLONG );
8af0: eb000faa bl c9a0 <__errno>
8af4: e3a0305b mov r3, #91 ; 0x5b
8af8: ea000029 b 8ba4 <IMFS_eval_path+0x234>
/*
* Evaluate all tokens until we are done or an error occurs.
*/
while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) {
8afc: e3590004 cmp r9, #4
8b00: 13590000 cmpne r9, #0
8b04: 1affffa7 bne 89a8 <IMFS_eval_path+0x38>
* 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 ) {
8b08: e595304c ldr r3, [r5, #76] ; 0x4c
8b0c: e3530001 cmp r3, #1
8b10: 1a000019 bne 8b7c <IMFS_eval_path+0x20c>
if ( node->info.directory.mt_fs != NULL ) {
8b14: e595e05c ldr lr, [r5, #92] ; 0x5c
8b18: e35e0000 cmp lr, #0
8b1c: 0a000016 beq 8b7c <IMFS_eval_path+0x20c>
newloc = node->info.directory.mt_fs->mt_fs_root;
8b20: e28dc028 add ip, sp, #40 ; 0x28
8b24: e28ee01c add lr, lr, #28
8b28: e8be000f ldm lr!, {r0, r1, r2, r3}
8b2c: e8ac000f stmia ip!, {r0, r1, r2, r3}
8b30: e59ee000 ldr lr, [lr]
8b34: e58ce000 str lr, [ip]
*pathloc = newloc;
8b38: e28dc028 add ip, sp, #40 ; 0x28
8b3c: e8bc000f ldm ip!, {r0, r1, r2, r3}
8b40: e1a0c004 mov ip, r4
8b44: e8ac000f stmia ip!, {r0, r1, r2, r3}
return (*pathloc->ops->evalpath_h)( &pathname[i-len],
8b48: e59d103c ldr r1, [sp, #60] ; 0x3c
8b4c: 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;
8b50: e58ce000 str lr, [ip]
return (*pathloc->ops->evalpath_h)( &pathname[i-len],
8b54: e0610007 rsb r0, r1, r7
8b58: e0820000 add r0, r2, r0
8b5c: e594c00c ldr ip, [r4, #12]
8b60: e0861001 add r1, r6, r1
8b64: e1a02008 mov r2, r8
8b68: e1a03004 mov r3, r4
8b6c: e1a0e00f mov lr, pc
8b70: e59cf000 ldr pc, [ip]
8b74: e1a0b000 mov fp, r0
8b78: ea00000b b 8bac <IMFS_eval_path+0x23c>
flags, pathloc );
} else {
result = IMFS_Set_handlers( pathloc );
}
} else {
result = IMFS_Set_handlers( pathloc );
8b7c: e1a00004 mov r0, r4
8b80: ebffff30 bl 8848 <IMFS_Set_handlers>
/*
* Verify we have the correct permissions for this node.
*/
if ( !IMFS_evaluate_permission( pathloc, flags ) )
8b84: e1a01008 mov r1, r8
flags, pathloc );
} else {
result = IMFS_Set_handlers( pathloc );
}
} else {
result = IMFS_Set_handlers( pathloc );
8b88: e1a0b000 mov fp, r0
/*
* Verify we have the correct permissions for this node.
*/
if ( !IMFS_evaluate_permission( pathloc, flags ) )
8b8c: e1a00004 mov r0, r4
8b90: ebffff49 bl 88bc <IMFS_evaluate_permission>
8b94: e3500000 cmp r0, #0
8b98: 1a000003 bne 8bac <IMFS_eval_path+0x23c>
rtems_set_errno_and_return_minus_one( EACCES );
8b9c: eb000f7f bl c9a0 <__errno>
8ba0: e3a0300d mov r3, #13
8ba4: e5803000 str r3, [r0]
8ba8: e3e0b000 mvn fp, #0
return result;
}
8bac: e1a0000b mov r0, fp
8bb0: e28dd040 add sp, sp, #64 ; 0x40
8bb4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
00008cf8 <IMFS_evaluate_for_make>:
int IMFS_evaluate_for_make(
const char *path, /* IN */
rtems_filesystem_location_info_t *pathloc, /* IN/OUT */
const char **name /* OUT */
)
{
8cf8: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
8cfc: e24dd03c sub sp, sp, #60 ; 0x3c
8d00: e1a07000 mov r7, r0
8d04: e1a04001 mov r4, r1
8d08: e1a0a002 mov sl, r2
/*
* This was filled in by the caller and is valid in the
* mount table.
*/
node = pathloc->node_access;
8d0c: e5916000 ldr r6, [r1]
/*
* Get the path length.
*/
pathlen = strlen( path );
8d10: eb00130c bl d948 <strlen>
const char *path, /* IN */
rtems_filesystem_location_info_t *pathloc, /* IN/OUT */
const char **name /* OUT */
)
{
int i = 0;
8d14: e3a05000 mov r5, #0
node = pathloc->node_access;
/*
* Get the path length.
*/
pathlen = strlen( path );
8d18: 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 );
8d1c: e1a01008 mov r1, r8
8d20: e28d3038 add r3, sp, #56 ; 0x38
8d24: e0870005 add r0, r7, r5
8d28: e1a0200d mov r2, sp
8d2c: eb0000d2 bl 907c <IMFS_get_token>
pathlen -= len;
i += len;
if ( !pathloc->node_access )
8d30: e5943000 ldr r3, [r4]
*/
while( !done ) {
type = IMFS_get_token( &path[i], pathlen, token, &len );
pathlen -= len;
8d34: e59db038 ldr fp, [sp, #56] ; 0x38
i += len;
if ( !pathloc->node_access )
8d38: 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 );
8d3c: e1a09000 mov r9, r0
pathlen -= len;
8d40: e06b8008 rsb r8, fp, r8
i += len;
if ( !pathloc->node_access )
8d44: 0a000060 beq 8ecc <IMFS_evaluate_for_make+0x1d4>
/*
* I cannot move out of this directory without execute permission.
*/
if ( type != IMFS_NO_MORE_PATH )
8d48: e3500000 cmp r0, #0
8d4c: 0a000006 beq 8d6c <IMFS_evaluate_for_make+0x74>
if ( node->type == IMFS_DIRECTORY )
8d50: e596104c ldr r1, [r6, #76] ; 0x4c
8d54: e3510001 cmp r1, #1
8d58: 1a000003 bne 8d6c <IMFS_evaluate_for_make+0x74>
if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) )
8d5c: e1a00004 mov r0, r4
8d60: ebfffed5 bl 88bc <IMFS_evaluate_permission>
8d64: e3500000 cmp r0, #0
8d68: 0a00006c beq 8f20 <IMFS_evaluate_for_make+0x228>
rtems_set_errno_and_return_minus_one( EACCES );
node = pathloc->node_access;
8d6c: e5943000 ldr r3, [r4]
while( !done ) {
type = IMFS_get_token( &path[i], pathlen, token, &len );
pathlen -= len;
i += len;
8d70: 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;
8d74: e1a06003 mov r6, r3
switch( type ) {
8d78: e3590004 cmp r9, #4
8d7c: 979ff109 ldrls pc, [pc, r9, lsl #2]
8d80: eaffffe5 b 8d1c <IMFS_evaluate_for_make+0x24> <== NOT EXECUTED
8d84: 00008e90 .word 0x00008e90 <== NOT EXECUTED
8d88: 00008d1c .word 0x00008d1c <== NOT EXECUTED
8d8c: 00008d98 .word 0x00008d98 <== NOT EXECUTED
8d90: 00008dd4 .word 0x00008dd4 <== NOT EXECUTED
8d94: 00008e9c .word 0x00008e9c <== 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 )
8d98: e59f119c ldr r1, [pc, #412] ; 8f3c <IMFS_evaluate_for_make+0x244>
8d9c: e5912000 ldr r2, [r1]
8da0: e5922018 ldr r2, [r2, #24]
8da4: e1530002 cmp r3, r2
8da8: 0affffdb beq 8d1c <IMFS_evaluate_for_make+0x24>
/*
* Am I at the root of this mounted filesystem?
*/
if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access){
8dac: e594e010 ldr lr, [r4, #16]
8db0: e59e201c ldr r2, [lr, #28]
8db4: e1530002 cmp r3, r2
if ( pathloc->node_access == rtems_filesystem_root.node_access ) {
break;
} else {
newloc = pathloc->mt_entry->mt_point_node;
8db8: 028dc024 addeq ip, sp, #36 ; 0x24
8dbc: 028ee008 addeq lr, lr, #8
8dc0: 0a000019 beq 8e2c <IMFS_evaluate_for_make+0x134>
*pathloc = newloc;
return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name );
}
} else {
if ( !node->Parent )
8dc4: e5936008 ldr r6, [r3, #8]
8dc8: e3560000 cmp r6, #0
8dcc: 1a00002d bne 8e88 <IMFS_evaluate_for_make+0x190>
8dd0: ea00003d b 8ecc <IMFS_evaluate_for_make+0x1d4>
pathloc->node_access = node;
break;
case IMFS_NAME:
if ( node->type == IMFS_HARD_LINK ) {
8dd4: e593304c ldr r3, [r3, #76] ; 0x4c
8dd8: e3530003 cmp r3, #3
8ddc: 0a000001 beq 8de8 <IMFS_evaluate_for_make+0xf0>
result = IMFS_evaluate_link( pathloc, 0 );
if ( result == -1 )
return -1;
} else if ( node->type == IMFS_SYM_LINK ) {
8de0: e3530004 cmp r3, #4
8de4: 1a000005 bne 8e00 <IMFS_evaluate_for_make+0x108>
result = IMFS_evaluate_link( pathloc, 0 );
8de8: e1a00004 mov r0, r4
8dec: e3a01000 mov r1, #0
8df0: ebffff93 bl 8c44 <IMFS_evaluate_link>
if ( result == -1 )
8df4: e3700001 cmn r0, #1
if ( result == -1 )
return -1;
} else if ( node->type == IMFS_SYM_LINK ) {
result = IMFS_evaluate_link( pathloc, 0 );
8df8: e1a06000 mov r6, r0
if ( result == -1 )
8dfc: 0a00004b beq 8f30 <IMFS_evaluate_for_make+0x238>
return -1;
}
node = pathloc->node_access;
8e00: e5940000 ldr r0, [r4]
if ( !node )
8e04: e3500000 cmp r0, #0
8e08: 0a00003c beq 8f00 <IMFS_evaluate_for_make+0x208>
/*
* Only a directory can be decended into.
*/
if ( node->type != IMFS_DIRECTORY )
8e0c: e590304c ldr r3, [r0, #76] ; 0x4c
8e10: e3530001 cmp r3, #1
8e14: 1a000039 bne 8f00 <IMFS_evaluate_for_make+0x208>
/*
* 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 ) {
8e18: e590e05c ldr lr, [r0, #92] ; 0x5c
8e1c: e35e0000 cmp lr, #0
8e20: 0a000014 beq 8e78 <IMFS_evaluate_for_make+0x180>
newloc = node->info.directory.mt_fs->mt_fs_root;
8e24: e28dc024 add ip, sp, #36 ; 0x24
8e28: e28ee01c add lr, lr, #28
8e2c: e8be000f ldm lr!, {r0, r1, r2, r3}
8e30: e8ac000f stmia ip!, {r0, r1, r2, r3}
8e34: e59ee000 ldr lr, [lr]
8e38: e58ce000 str lr, [ip]
*pathloc = newloc;
8e3c: e28dc024 add ip, sp, #36 ; 0x24
8e40: e8bc000f ldm ip!, {r0, r1, r2, r3}
8e44: e1a0c004 mov ip, r4
8e48: e8ac000f stmia ip!, {r0, r1, r2, r3}
return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name );
8e4c: 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;
8e50: e58ce000 str lr, [ip]
return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name );
8e54: e0625005 rsb r5, r2, r5
8e58: e594300c ldr r3, [r4, #12]
8e5c: e0870005 add r0, r7, r5
8e60: e1a01004 mov r1, r4
8e64: e1a0200a mov r2, sl
8e68: e1a0e00f mov lr, pc
8e6c: e593f004 ldr pc, [r3, #4]
8e70: e1a06000 mov r6, r0
8e74: ea00002d b 8f30 <IMFS_evaluate_for_make+0x238>
/*
* Otherwise find the token name in the present location.
*/
node = IMFS_find_match_in_dir( node, token );
8e78: e1a0100d mov r1, sp
8e7c: eb00005e bl 8ffc <IMFS_find_match_in_dir>
/*
* If there is no node we have found the name of the node we
* wish to create.
*/
if ( ! node )
8e80: e2506000 subs r6, r0, #0
8e84: 0a000007 beq 8ea8 <IMFS_evaluate_for_make+0x1b0>
done = true;
else
pathloc->node_access = node;
8e88: e5846000 str r6, [r4]
8e8c: eaffffa2 b 8d1c <IMFS_evaluate_for_make+0x24>
break;
case IMFS_NO_MORE_PATH:
rtems_set_errno_and_return_minus_one( EEXIST );
8e90: eb000ec2 bl c9a0 <__errno>
8e94: e3a03011 mov r3, #17
8e98: ea000022 b 8f28 <IMFS_evaluate_for_make+0x230>
break;
case IMFS_INVALID_TOKEN:
rtems_set_errno_and_return_minus_one( ENAMETOOLONG );
8e9c: eb000ebf bl c9a0 <__errno>
8ea0: e3a0305b mov r3, #91 ; 0x5b
8ea4: ea00001f b 8f28 <IMFS_evaluate_for_make+0x230>
case IMFS_CURRENT_DIR:
break;
}
}
*name = &path[ i - len ];
8ea8: e59d3038 ldr r3, [sp, #56] ; 0x38
8eac: e0633005 rsb r3, r3, r5
8eb0: e0873003 add r3, r7, r3
8eb4: 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(
8eb8: 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++) {
8ebc: ea000005 b 8ed8 <IMFS_evaluate_for_make+0x1e0>
if ( !IMFS_is_separator( path[ i ] ) )
8ec0: ebffe6f6 bl 2aa0 <rtems_filesystem_is_separator>
8ec4: e3500000 cmp r0, #0
8ec8: 1a000002 bne 8ed8 <IMFS_evaluate_for_make+0x1e0>
rtems_set_errno_and_return_minus_one( ENOENT );
8ecc: eb000eb3 bl c9a0 <__errno>
8ed0: e3a03002 mov r3, #2
8ed4: ea000013 b 8f28 <IMFS_evaluate_for_make+0x230>
/*
* 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++) {
8ed8: e4d50001 ldrb r0, [r5], #1
8edc: e3500000 cmp r0, #0
8ee0: 1afffff6 bne 8ec0 <IMFS_evaluate_for_make+0x1c8>
/*
* Verify we can execute and write to this directory.
*/
result = IMFS_Set_handlers( pathloc );
8ee4: e1a00004 mov r0, r4
8ee8: ebfffe56 bl 8848 <IMFS_Set_handlers>
/*
* The returned node must be a directory
*/
node = pathloc->node_access;
if ( node->type != IMFS_DIRECTORY )
8eec: e5943000 ldr r3, [r4]
8ef0: e593304c ldr r3, [r3, #76] ; 0x4c
8ef4: e3530001 cmp r3, #1
/*
* Verify we can execute and write to this directory.
*/
result = IMFS_Set_handlers( pathloc );
8ef8: e1a06000 mov r6, r0
/*
* The returned node must be a directory
*/
node = pathloc->node_access;
if ( node->type != IMFS_DIRECTORY )
8efc: 0a000002 beq 8f0c <IMFS_evaluate_for_make+0x214>
rtems_set_errno_and_return_minus_one( ENOTDIR );
8f00: eb000ea6 bl c9a0 <__errno>
8f04: e3a03014 mov r3, #20
8f08: ea000006 b 8f28 <IMFS_evaluate_for_make+0x230>
/*
* We must have Write and execute permission on the returned node.
*/
if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) )
8f0c: e1a00004 mov r0, r4
8f10: e3a01003 mov r1, #3
8f14: ebfffe68 bl 88bc <IMFS_evaluate_permission>
8f18: e3500000 cmp r0, #0
8f1c: 1a000003 bne 8f30 <IMFS_evaluate_for_make+0x238>
rtems_set_errno_and_return_minus_one( EACCES );
8f20: eb000e9e bl c9a0 <__errno>
8f24: e3a0300d mov r3, #13
8f28: e5803000 str r3, [r0]
8f2c: e3e06000 mvn r6, #0
return result;
}
8f30: e1a00006 mov r0, r6
8f34: e28dd03c add sp, sp, #60 ; 0x3c
8f38: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
000088bc <IMFS_evaluate_permission>:
uid_t st_uid;
gid_t st_gid;
IMFS_jnode_t *jnode;
int flags_to_test;
if ( !rtems_libio_is_valid_perms( flags ) )
88bc: e3d13007 bics r3, r1, #7
*/
int IMFS_evaluate_permission(
rtems_filesystem_location_info_t *node,
int flags
)
{
88c0: e92d4070 push {r4, r5, r6, lr}
88c4: e1a04001 mov r4, r1
uid_t st_uid;
gid_t st_gid;
IMFS_jnode_t *jnode;
int flags_to_test;
if ( !rtems_libio_is_valid_perms( flags ) )
88c8: 0a000004 beq 88e0 <IMFS_evaluate_permission+0x24>
rtems_set_errno_and_return_minus_one( EPERM );
88cc: eb001033 bl c9a0 <__errno> <== NOT EXECUTED
88d0: e3a03001 mov r3, #1 <== NOT EXECUTED
88d4: e5803000 str r3, [r0] <== NOT EXECUTED
88d8: e3e00000 mvn r0, #0 <== NOT EXECUTED
88dc: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
jnode = node->node_access;
88e0: e5905000 ldr r5, [r0]
#if defined(RTEMS_POSIX_API)
st_uid = geteuid();
88e4: eb0002de bl 9464 <geteuid>
88e8: e1a06000 mov r6, r0
st_gid = getegid();
88ec: eb0002d7 bl 9450 <getegid>
* Check if I am owner or a group member or someone else.
*/
flags_to_test = flags;
if ( st_uid == jnode->st_uid )
88f0: e1d533bc ldrh r3, [r5, #60] ; 0x3c
88f4: e1530006 cmp r3, r6
flags_to_test <<= 6;
88f8: 01a04304 lsleq r4, r4, #6
* Check if I am owner or a group member or someone else.
*/
flags_to_test = flags;
if ( st_uid == jnode->st_uid )
88fc: 0a000002 beq 890c <IMFS_evaluate_permission+0x50>
flags_to_test <<= 6;
else if ( st_gid == jnode->st_gid )
8900: e1d533be ldrh r3, [r5, #62] ; 0x3e
8904: e1530000 cmp r3, r0
flags_to_test <<= 3;
8908: 01a04184 lsleq r4, r4, #3
/*
* If all of the flags are set we have permission
* to do this.
*/
if ( ( flags_to_test & jnode->st_mode) == flags_to_test )
890c: e5950030 ldr r0, [r5, #48] ; 0x30
8910: e0040000 and r0, r4, r0
gid_t st_gid;
IMFS_jnode_t *jnode;
int flags_to_test;
if ( !rtems_libio_is_valid_perms( flags ) )
rtems_set_errno_and_return_minus_one( EPERM );
8914: e1500004 cmp r0, r4
8918: 13a00000 movne r0, #0
891c: 03a00001 moveq r0, #1
*/
if ( ( flags_to_test & jnode->st_mode) == flags_to_test )
return 1;
return 0;
}
8920: e8bd8070 pop {r4, r5, r6, pc}
00008f40 <IMFS_fsunmount>:
((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next))
int IMFS_fsunmount(
rtems_filesystem_mount_table_entry_t *temp_mt_entry
)
{
8f40: 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;
8f44: e1a0c000 mov ip, r0
8f48: 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
)
{
8f4c: e1a05000 mov r5, r0
8f50: 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;
8f54: e8bc000f ldm ip!, {r0, r1, r2, r3}
8f58: e1a0e00d mov lr, sp
8f5c: e8ae000f stmia lr!, {r0, r1, r2, r3}
8f60: e59c3000 ldr r3, [ip]
8f64: e58e3000 str r3, [lr]
/*
* Set this to null to indicate that it is being unmounted.
*/
temp_mt_entry->mt_fs_root.node_access = NULL;
8f68: e3a03000 mov r3, #0
8f6c: e585301c str r3, [r5, #28]
do {
next = jnode->Parent;
loc.node_access = (void *)jnode;
IMFS_Set_handlers( &loc );
8f70: e1a0500d mov r5, sp
8f74: e1a0000d mov r0, sp
*/
temp_mt_entry->mt_fs_root.node_access = NULL;
do {
next = jnode->Parent;
8f78: e5946008 ldr r6, [r4, #8]
loc.node_access = (void *)jnode;
8f7c: e58d4000 str r4, [sp]
IMFS_Set_handlers( &loc );
8f80: ebfffe30 bl 8848 <IMFS_Set_handlers>
if ( jnode->type != IMFS_DIRECTORY ) {
8f84: e594304c ldr r3, [r4, #76] ; 0x4c
8f88: e3530001 cmp r3, #1
8f8c: 1a000003 bne 8fa0 <IMFS_fsunmount+0x60>
result = IMFS_unlink( NULL, &loc );
if (result != 0)
return -1;
jnode = next;
} else if ( jnode_has_no_children( jnode ) ) {
8f90: e5942050 ldr r2, [r4, #80] ; 0x50
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
8f94: e2843054 add r3, r4, #84 ; 0x54
8f98: e1520003 cmp r2, r3
8f9c: 1a000005 bne 8fb8 <IMFS_fsunmount+0x78>
result = IMFS_unlink( NULL, &loc );
8fa0: e3a00000 mov r0, #0
8fa4: e1a0100d mov r1, sp
8fa8: ebffe211 bl 17f4 <IMFS_unlink>
if (result != 0)
8fac: e3500000 cmp r0, #0
8fb0: 1a00000c bne 8fe8 <IMFS_fsunmount+0xa8>
return -1;
jnode = next;
8fb4: e1a04006 mov r4, r6
}
if ( jnode != NULL ) {
8fb8: e3540000 cmp r4, #0
8fbc: 0a00000b beq 8ff0 <IMFS_fsunmount+0xb0>
if ( jnode->type == IMFS_DIRECTORY ) {
8fc0: e594304c ldr r3, [r4, #76] ; 0x4c
8fc4: e3530001 cmp r3, #1
8fc8: 1affffe9 bne 8f74 <IMFS_fsunmount+0x34>
if ( jnode_has_children( jnode ) )
8fcc: e5943050 ldr r3, [r4, #80] ; 0x50
8fd0: e2842054 add r2, r4, #84 ; 0x54
8fd4: e1530002 cmp r3, r2
8fd8: 0affffe5 beq 8f74 <IMFS_fsunmount+0x34>
jnode = jnode_get_first_child( jnode );
}
}
} while (jnode != NULL);
8fdc: e2534000 subs r4, r3, #0
8fe0: 1affffe3 bne 8f74 <IMFS_fsunmount+0x34>
8fe4: ea000001 b 8ff0 <IMFS_fsunmount+0xb0> <== NOT EXECUTED
return -1;
jnode = next;
} else if ( jnode_has_no_children( jnode ) ) {
result = IMFS_unlink( NULL, &loc );
if (result != 0)
return -1;
8fe8: e3e00000 mvn r0, #0 <== NOT EXECUTED
8fec: ea000000 b 8ff4 <IMFS_fsunmount+0xb4> <== NOT EXECUTED
jnode = jnode_get_first_child( jnode );
}
}
} while (jnode != NULL);
return 0;
8ff0: e1a00004 mov r0, r4
}
8ff4: e28dd014 add sp, sp, #20
8ff8: e8bd8070 pop {r4, r5, r6, pc}
0000b100 <IMFS_memfile_get_block_pointer>:
my_block = block;
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
b100: e59f31e4 ldr r3, [pc, #484] ; b2ec <IMFS_memfile_get_block_pointer+0x1ec>
#endif
IMFS_jnode_t *the_jnode,
unsigned int block,
int malloc_it
)
{
b104: 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 ) {
b108: e5935000 ldr r5, [r3]
b10c: e1a05125 lsr r5, r5, #2
b110: e2453001 sub r3, r5, #1
b114: e1510003 cmp r1, r3
#endif
IMFS_jnode_t *the_jnode,
unsigned int block,
int malloc_it
)
{
b118: e1a04000 mov r4, r0
b11c: e1a06001 mov r6, r1
b120: e1a08002 mov r8, r2
my_block = block;
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
b124: 8a00000e bhi b164 <IMFS_memfile_get_block_pointer+0x64>
p = info->indirect;
if ( malloc_it ) {
b128: e3520000 cmp r2, #0
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
p = info->indirect;
b12c: e5900058 ldr r0, [r0, #88] ; 0x58
if ( malloc_it ) {
b130: 0a000007 beq b154 <IMFS_memfile_get_block_pointer+0x54>
if ( !p ) {
b134: e3500000 cmp r0, #0
b138: 1a000003 bne b14c <IMFS_memfile_get_block_pointer+0x4c>
p = memfile_alloc_block();
b13c: ebffffe2 bl b0cc <memfile_alloc_block>
if ( !p )
b140: e3500000 cmp r0, #0
b144: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
return 0;
info->indirect = p;
b148: e5840058 str r0, [r4, #88] ; 0x58
}
return &info->indirect[ my_block ];
b14c: e5940058 ldr r0, [r4, #88] ; 0x58
b150: ea000001 b b15c <IMFS_memfile_get_block_pointer+0x5c>
}
if ( !p )
b154: e3500000 cmp r0, #0
b158: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
return 0;
return &info->indirect[ my_block ];
b15c: e0800106 add r0, r0, r6, lsl #2
b160: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
/*
* Is the block number in the doubly indirect portion?
*/
if ( my_block <= LAST_DOUBLY_INDIRECT ) {
b164: e2853001 add r3, r5, #1
b168: e0030395 mul r3, r5, r3
b16c: e2432001 sub r2, r3, #1
b170: e1510002 cmp r1, r2
b174: 8a000021 bhi b200 <IMFS_memfile_get_block_pointer+0x100>
my_block -= FIRST_DOUBLY_INDIRECT;
b178: e0656001 rsb r6, r5, r1
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
b17c: e1a00006 mov r0, r6
b180: e1a01005 mov r1, r5
b184: eb00143c bl 1027c <__umodsi3>
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
b188: e1a01005 mov r1, r5
*/
if ( my_block <= LAST_DOUBLY_INDIRECT ) {
my_block -= FIRST_DOUBLY_INDIRECT;
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
b18c: e1a07000 mov r7, r0
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
b190: e1a00006 mov r0, r6
b194: eb0013a0 bl 1001c <__aeabi_uidiv>
p = info->doubly_indirect;
if ( malloc_it ) {
b198: 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;
b19c: e1a05000 mov r5, r0
p = info->doubly_indirect;
b1a0: e594005c ldr r0, [r4, #92] ; 0x5c
if ( malloc_it ) {
b1a4: 0a00000e beq b1e4 <IMFS_memfile_get_block_pointer+0xe4>
if ( !p ) {
b1a8: e3500000 cmp r0, #0
b1ac: 1a000003 bne b1c0 <IMFS_memfile_get_block_pointer+0xc0>
p = memfile_alloc_block();
b1b0: ebffffc5 bl b0cc <memfile_alloc_block>
if ( !p )
b1b4: e3500000 cmp r0, #0
b1b8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
return 0;
info->doubly_indirect = p;
b1bc: e584005c str r0, [r4, #92] ; 0x5c
}
p1 = (block_p *)p[ doubly ];
b1c0: e0804105 add r4, r0, r5, lsl #2
b1c4: e7900105 ldr r0, [r0, r5, lsl #2]
if ( !p1 ) {
b1c8: e3500000 cmp r0, #0
b1cc: 1a000009 bne b1f8 <IMFS_memfile_get_block_pointer+0xf8>
p1 = memfile_alloc_block();
b1d0: ebffffbd bl b0cc <memfile_alloc_block>
if ( !p1 )
b1d4: e3500000 cmp r0, #0
return 0;
p[ doubly ] = (block_p) p1;
b1d8: 15840000 strne r0, [r4]
}
p1 = (block_p *)p[ doubly ];
if ( !p1 ) {
p1 = memfile_alloc_block();
if ( !p1 )
b1dc: 1a000005 bne b1f8 <IMFS_memfile_get_block_pointer+0xf8>
b1e0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
}
return (block_p *)&p1[ singly ];
}
if ( !p )
b1e4: e3500000 cmp r0, #0
b1e8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
return 0;
p = (block_p *)p[ doubly ];
b1ec: e7900105 ldr r0, [r0, r5, lsl #2]
if ( !p )
b1f0: e3500000 cmp r0, #0
b1f4: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
return 0;
return (block_p *)&p[ singly ];
b1f8: e0800107 add r0, r0, r7, lsl #2
b1fc: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
}
/*
* Is the block number in the triply indirect portion?
*/
if ( my_block <= LAST_TRIPLY_INDIRECT ) {
b200: e2832001 add r2, r3, #1
b204: e0020295 mul r2, r5, r2
b208: e2422001 sub r2, r2, #1
b20c: e1510002 cmp r1, r2
b210: 8a000033 bhi b2e4 <IMFS_memfile_get_block_pointer+0x1e4>
my_block -= FIRST_TRIPLY_INDIRECT;
b214: e0636001 rsb r6, r3, r1
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
b218: e1a00006 mov r0, r6
b21c: e1a01005 mov r1, r5
b220: eb001415 bl 1027c <__umodsi3>
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
b224: 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;
b228: e1a0a000 mov sl, r0
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
b22c: e1a00006 mov r0, r6
b230: eb001379 bl 1001c <__aeabi_uidiv>
triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS;
b234: 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;
b238: e1a06000 mov r6, r0
triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS;
b23c: eb001376 bl 1001c <__aeabi_uidiv>
doubly %= IMFS_MEMFILE_BLOCK_SLOTS;
b240: 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;
b244: e1a07000 mov r7, r0
doubly %= IMFS_MEMFILE_BLOCK_SLOTS;
b248: e1a00006 mov r0, r6
b24c: eb00140a bl 1027c <__umodsi3>
p = info->triply_indirect;
if ( malloc_it ) {
b250: 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;
b254: e1a05000 mov r5, r0
p = info->triply_indirect;
b258: e5940060 ldr r0, [r4, #96] ; 0x60
if ( malloc_it ) {
b25c: 0a000016 beq b2bc <IMFS_memfile_get_block_pointer+0x1bc>
if ( !p ) {
b260: e3500000 cmp r0, #0
b264: 1a000003 bne b278 <IMFS_memfile_get_block_pointer+0x178>
p = memfile_alloc_block();
b268: ebffff97 bl b0cc <memfile_alloc_block>
if ( !p )
b26c: e3500000 cmp r0, #0
b270: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
return 0;
info->triply_indirect = p;
b274: e5840060 str r0, [r4, #96] ; 0x60
}
p1 = (block_p *) p[ triply ];
b278: e0804107 add r4, r0, r7, lsl #2
b27c: e7900107 ldr r0, [r0, r7, lsl #2]
if ( !p1 ) {
b280: e3500000 cmp r0, #0
b284: 1a000003 bne b298 <IMFS_memfile_get_block_pointer+0x198>
p1 = memfile_alloc_block();
b288: ebffff8f bl b0cc <memfile_alloc_block>
if ( !p1 )
b28c: e3500000 cmp r0, #0
b290: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
return 0;
p[ triply ] = (block_p) p1;
b294: e5840000 str r0, [r4]
}
p2 = (block_p *)p1[ doubly ];
b298: e0804105 add r4, r0, r5, lsl #2
b29c: e7900105 ldr r0, [r0, r5, lsl #2]
if ( !p2 ) {
b2a0: e3500000 cmp r0, #0
b2a4: 1a00000c bne b2dc <IMFS_memfile_get_block_pointer+0x1dc>
p2 = memfile_alloc_block();
b2a8: ebffff87 bl b0cc <memfile_alloc_block>
if ( !p2 )
b2ac: e3500000 cmp r0, #0
return 0;
p1[ doubly ] = (block_p) p2;
b2b0: 15840000 strne r0, [r4]
}
p2 = (block_p *)p1[ doubly ];
if ( !p2 ) {
p2 = memfile_alloc_block();
if ( !p2 )
b2b4: 1a000008 bne b2dc <IMFS_memfile_get_block_pointer+0x1dc>
b2b8: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
p1[ doubly ] = (block_p) p2;
}
return (block_p *)&p2[ singly ];
}
if ( !p )
b2bc: e3500000 cmp r0, #0
b2c0: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
return 0;
p1 = (block_p *) p[ triply ];
b2c4: e7900107 ldr r0, [r0, r7, lsl #2]
if ( !p1 )
b2c8: e3500000 cmp r0, #0
b2cc: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
return 0;
p2 = (block_p *)p1[ doubly ];
b2d0: e7900105 ldr r0, [r0, r5, lsl #2]
if ( !p2 )
b2d4: e3500000 cmp r0, #0
b2d8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
return 0;
return (block_p *)&p2[ singly ];
b2dc: e080010a add r0, r0, sl, lsl #2
b2e0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
}
/*
* This means the requested block number is out of range.
*/
return 0;
b2e4: e3a00000 mov r0, #0 <== NOT EXECUTED
}
b2e8: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
00001694 <IMFS_mount>:
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 <rtems/seterr.h>
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 <IMFS_mount+0x28>
rtems_set_errno_and_return_minus_one( ENOTDIR );
16a8: eb002cbc bl c9a0 <__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 <IMFS_print_jnode>:
* 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 <IMFS_print_jnode+0xec>
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: eb003433 bl 11104 <fputs>
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 <IMFS_print_jnode+0xcc> <== NOT EXECUTED
4048: 00004064 .word 0x00004064 <== NOT EXECUTED
404c: 00004078 .word 0x00004078 <== NOT EXECUTED
4050: 000040c4 .word 0x000040c4 <== NOT EXECUTED
4054: 000040c4 .word 0x000040c4 <== NOT EXECUTED
4058: 000040ac .word 0x000040ac <== NOT EXECUTED
405c: 00004090 .word 0x00004090 <== NOT EXECUTED
4060: 000040d0 .word 0x000040d0 <== NOT EXECUTED
case IMFS_DIRECTORY:
fprintf(stdout, "/" );
4064: e5953000 ldr r3, [r5]
4068: e3a0002f mov r0, #47 ; 0x2f
406c: e5931008 ldr r1, [r3, #8]
4070: eb0033ee bl 11030 <fputc>
break;
4074: ea00001f b 40f8 <IMFS_print_jnode+0xe0>
case IMFS_DEVICE:
fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")",
4078: e5953000 ldr r3, [r5]
407c: e59f1084 ldr r1, [pc, #132] ; 4108 <IMFS_print_jnode+0xf0>
4080: e5930008 ldr r0, [r3, #8]
4084: e2842050 add r2, r4, #80 ; 0x50
4088: e892000c ldm r2, {r2, r3}
408c: ea000004 b 40a4 <IMFS_print_jnode+0x8c>
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 <IMFS_print_jnode+0xf4>
4098: e5930008 ldr r0, [r3, #8]
409c: e5942050 ldr r2, [r4, #80] ; 0x50
40a0: e5943058 ldr r3, [r4, #88] ; 0x58
40a4: eb0033c1 bl 10fb0 <fprintf>
(uint32_t)the_jnode->info.linearfile.size,
the_jnode->info.linearfile.direct
);
break;
40a8: ea000012 b 40f8 <IMFS_print_jnode+0xe0>
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 <IMFS_print_jnode+0xf8>
40b4: e5930008 ldr r0, [r3, #8]
40b8: e5942050 ldr r2, [r4, #80] ; 0x50
40bc: eb0033bb bl 10fb0 <fprintf>
(uint32_t)the_jnode->info.file.size );
#endif
break;
40c0: ea00000c b 40f8 <IMFS_print_jnode+0xe0>
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 <IMFS_print_jnode+0xfc>
40cc: ea000001 b 40d8 <IMFS_print_jnode+0xc0>
return;
case IMFS_FIFO:
fprintf(stdout, " FIFO not printed\n" );
40d0: e5953000 ldr r3, [r5]
40d4: e59f003c ldr r0, [pc, #60] ; 4118 <IMFS_print_jnode+0x100>
40d8: e5931008 ldr r1, [r3, #8]
default:
fprintf(stdout, " bad type %d\n", the_jnode->type );
return;
}
puts("");
}
40dc: e8bd4030 pop {r4, r5, lr}
case IMFS_SYM_LINK:
fprintf(stdout, " links not printed\n" );
return;
case IMFS_FIFO:
fprintf(stdout, " FIFO not printed\n" );
40e0: ea003407 b 11104 <fputs>
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 <IMFS_print_jnode+0x104> <== 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: ea0033ad b 10fb0 <fprintf> <== NOT EXECUTED
return;
}
puts("");
40f8: e59f0020 ldr r0, [pc, #32] ; 4120 <IMFS_print_jnode+0x108>
}
40fc: e8bd4030 pop {r4, r5, lr}
default:
fprintf(stdout, " bad type %d\n", the_jnode->type );
return;
}
puts("");
4100: ea003ad9 b 12c6c <puts>
00009224 <IMFS_stat>:
{
IMFS_fs_info_t *fs_info;
IMFS_jnode_t *the_jnode;
IMFS_device_t *io;
the_jnode = loc->node_access;
9224: e5903000 ldr r3, [r0]
switch ( the_jnode->type ) {
9228: e593204c ldr r2, [r3, #76] ; 0x4c
922c: e2422002 sub r2, r2, #2
int IMFS_stat(
rtems_filesystem_location_info_t *loc,
struct stat *buf
)
{
9230: e92d4800 push {fp, lr}
IMFS_device_t *io;
the_jnode = loc->node_access;
switch ( the_jnode->type ) {
9234: e3520005 cmp r2, #5
9238: 979ff102 ldrls pc, [pc, r2, lsl #2]
923c: ea000012 b 928c <IMFS_stat+0x68> <== NOT EXECUTED
9240: 00009258 .word 0x00009258 <== NOT EXECUTED
9244: 0000928c .word 0x0000928c <== NOT EXECUTED
9248: 00009278 .word 0x00009278 <== NOT EXECUTED
924c: 0000926c .word 0x0000926c <== NOT EXECUTED
9250: 0000926c .word 0x0000926c <== NOT EXECUTED
9254: 00009278 .word 0x00009278 <== NOT EXECUTED
case IMFS_DEVICE:
io = &the_jnode->info.device;
buf->st_rdev = rtems_filesystem_make_dev_t( io->major, io->minor );
9258: e5932054 ldr r2, [r3, #84] ; 0x54
rtems_device_minor_number _minor
)
{
union __rtems_dev_t temp;
temp.__overlay.major = _major;
925c: e593c050 ldr ip, [r3, #80] ; 0x50
9260: e581201c str r2, [r1, #28]
9264: e581c018 str ip, [r1, #24]
break;
9268: ea00000c b 92a0 <IMFS_stat+0x7c>
case IMFS_LINEAR_FILE:
case IMFS_MEMORY_FILE:
buf->st_size = the_jnode->info.file.size;
926c: e283c050 add ip, r3, #80 ; 0x50
9270: e89c1800 ldm ip, {fp, ip}
9274: ea000001 b 9280 <IMFS_stat+0x5c>
case IMFS_SYM_LINK:
buf->st_size = 0;
break;
case IMFS_FIFO:
buf->st_size = 0;
9278: e3a0b000 mov fp, #0
927c: e3a0c000 mov ip, #0
9280: e581b020 str fp, [r1, #32]
9284: e581c024 str ip, [r1, #36] ; 0x24
break;
9288: ea000004 b 92a0 <IMFS_stat+0x7c>
default:
rtems_set_errno_and_return_minus_one( ENOTSUP );
928c: eb000dc3 bl c9a0 <__errno>
9290: e3a03086 mov r3, #134 ; 0x86
9294: e5803000 str r3, [r0]
9298: e3e00000 mvn r0, #0
929c: 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;
92a0: e5902010 ldr r2, [r0, #16]
buf->st_dev =
rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance );
92a4: e5922034 ldr r2, [r2, #52] ; 0x34
92a8: 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 =
92ac: e5812004 str r2, [r1, #4]
rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance );
buf->st_mode = the_jnode->st_mode;
92b0: e5932030 ldr r2, [r3, #48] ; 0x30
92b4: e581200c str r2, [r1, #12]
buf->st_nlink = the_jnode->st_nlink;
92b8: e1d323b4 ldrh r2, [r3, #52] ; 0x34
92bc: e1c121b0 strh r2, [r1, #16]
buf->st_ino = the_jnode->st_ino;
92c0: e5932038 ldr r2, [r3, #56] ; 0x38
92c4: e5812008 str r2, [r1, #8]
buf->st_uid = the_jnode->st_uid;
92c8: e1d323bc ldrh r2, [r3, #60] ; 0x3c
92cc: e1c121b2 strh r2, [r1, #18]
buf->st_gid = the_jnode->st_gid;
92d0: e1d323be ldrh r2, [r3, #62] ; 0x3e
92d4: e1c121b4 strh r2, [r1, #20]
buf->st_atime = the_jnode->stat_atime;
92d8: e5932040 ldr r2, [r3, #64] ; 0x40
92dc: e59f001c ldr r0, [pc, #28] ; 9300 <IMFS_stat+0xdc>
92e0: e5812028 str r2, [r1, #40] ; 0x28
buf->st_mtime = the_jnode->stat_mtime;
92e4: e2832044 add r2, r3, #68 ; 0x44
92e8: 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 =
92ec: 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;
92f0: e5812030 str r2, [r1, #48] ; 0x30
buf->st_ctime = the_jnode->stat_ctime;
92f4: e5813038 str r3, [r1, #56] ; 0x38
return 0;
92f8: e3a00000 mov r0, #0
}
92fc: e8bd8800 pop {fp, pc}
000017f4 <IMFS_unlink>:
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 <IMFS_unlink+0xb4>
if ( !node->info.hard_link.link_node )
1814: e595e050 ldr lr, [r5, #80] ; 0x50
1818: e35e0000 cmp lr, #0
181c: 1a000003 bne 1830 <IMFS_unlink+0x3c>
rtems_set_errno_and_return_minus_one( EINVAL );
1820: eb002c5e bl c9a0 <__errno> <== NOT EXECUTED
1824: e3a03016 mov r3, #22 <== NOT EXECUTED
1828: e5803000 str r3, [r0] <== NOT EXECUTED
182c: ea000023 b 18c0 <IMFS_unlink+0xcc> <== 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: eb001bfb bl 8848 <IMFS_Set_handlers>
/*
* 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 <IMFS_unlink+0x94>
{
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 <IMFS_unlink+0xb4>
1884: ea00000d b 18c0 <IMFS_unlink+0xcc>
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 <gettimeofday>
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 <IMFS_unlink+0xd0>
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 <IMFS_unmount>:
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 <rtems/seterr.h>
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 <IMFS_unmount+0x20>
rtems_set_errno_and_return_minus_one( ENOTDIR );
18e0: eb002c2e bl c9a0 <__errno> <== NOT EXECUTED
18e4: e3a03014 mov r3, #20 <== NOT EXECUTED
18e8: ea000004 b 1900 <IMFS_unmount+0x34> <== 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 <IMFS_unmount+0x40>
rtems_set_errno_and_return_minus_one( EINVAL ); /* XXX */
18f8: eb002c28 bl c9a0 <__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)
00001860 <Stack_check_Dump_threads_usage>:
static rtems_printk_plugin_t print_handler;
void Stack_check_Dump_threads_usage(
Thread_Control *the_thread
)
{
1860: 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);
1864: e59030c8 ldr r3, [r0, #200] ; 0xc8
size = Stack_check_usable_stack_size(stack);
1868: e59070c4 ldr r7, [r0, #196] ; 0xc4
{
stack = &the_thread->Start.Initial_stack;
current = (void *)_CPU_Context_Get_SP( &the_thread->Registers );
}
low = Stack_check_usable_stack_start(stack);
186c: e2832010 add r2, r3, #16
size = Stack_check_usable_stack_size(stack);
1870: 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++)
1874: e3c71003 bic r1, r7, #3
static rtems_printk_plugin_t print_handler;
void Stack_check_Dump_threads_usage(
Thread_Control *the_thread
)
{
1878: e1a05000 mov r5, r0
current = 0;
} else
#endif
{
stack = &the_thread->Start.Initial_stack;
current = (void *)_CPU_Context_Get_SP( &the_thread->Registers );
187c: e590b0f4 ldr fp, [r0, #244] ; 0xf4
/*
* start at lower memory and find first word that does not
* match pattern
*/
base += PATTERN_SIZE_WORDS;
1880: e2820010 add r0, r2, #16
for (ebase = base + length; base < ebase; base++)
1884: 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(
1888: e2833020 add r3, r3, #32
* match pattern
*/
base += PATTERN_SIZE_WORDS;
for (ebase = base + length; base < ebase; base++)
if (*base != U32_PATTERN)
188c: e59f10c0 ldr r1, [pc, #192] ; 1954 <Stack_check_Dump_threads_usage+0xf4>
1890: ea000002 b 18a0 <Stack_check_Dump_threads_usage+0x40>
1894: e493c004 ldr ip, [r3], #4
1898: e15c0001 cmp ip, r1
189c: 1a000004 bne 18b4 <Stack_check_Dump_threads_usage+0x54>
* start at lower memory and find first word that does not
* match pattern
*/
base += PATTERN_SIZE_WORDS;
for (ebase = base + length; base < ebase; base++)
18a0: e1530000 cmp r3, r0
if (*base != U32_PATTERN)
18a4: 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++)
18a8: 3afffff9 bcc 1894 <Stack_check_Dump_threads_usage+0x34>
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;
18ac: e3a06000 mov r6, #0 <== NOT EXECUTED
18b0: ea000002 b 18c0 <Stack_check_Dump_threads_usage+0x60> <== 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 )
18b4: e3560000 cmp r6, #0
used = Stack_check_Calculate_used( low, size, high_water_mark );
18b8: 10822007 addne r2, r2, r7
18bc: 10666002 rsbne r6, r6, r2
#if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
if ( the_thread )
#endif
{
(*print_handler)(
18c0: e5958008 ldr r8, [r5, #8]
18c4: e59f408c ldr r4, [pc, #140] ; 1958 <Stack_check_Dump_threads_usage+0xf8>
18c8: e3a01005 mov r1, #5
18cc: e28d2008 add r2, sp, #8
18d0: e1a00008 mov r0, r8
18d4: e8940600 ldm r4, {r9, sl}
18d8: eb00156f bl 6e9c <rtems_object_get_name>
18dc: e59f1078 ldr r1, [pc, #120] ; 195c <Stack_check_Dump_threads_usage+0xfc>
18e0: e1a03000 mov r3, r0
18e4: e1a02008 mov r2, r8
18e8: e1a0000a mov r0, sl
18ec: e1a0e00f mov lr, pc
18f0: e12fff19 bx r9
(*print_handler)(
print_context,
" %010p - %010p %010p %8" PRId32 " ",
stack->area,
stack->area + stack->size - 1,
18f4: e59530c4 ldr r3, [r5, #196] ; 0xc4
18f8: e59520c8 ldr r2, [r5, #200] ; 0xc8
18fc: e2433001 sub r3, r3, #1
else {
(*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 );
}
#endif
(*print_handler)(
1900: e0823003 add r3, r2, r3
1904: e58db000 str fp, [sp]
1908: e58d7004 str r7, [sp, #4]
190c: e5940004 ldr r0, [r4, #4]
1910: e59f1048 ldr r1, [pc, #72] ; 1960 <Stack_check_Dump_threads_usage+0x100>
1914: e1a0e00f mov lr, pc
1918: e594f000 ldr pc, [r4]
stack->area + stack->size - 1,
current,
size
);
if (Stack_check_Initialized == 0) {
191c: e5943008 ldr r3, [r4, #8]
1920: e3530000 cmp r3, #0
1924: 1a000004 bne 193c <Stack_check_Dump_threads_usage+0xdc>
(*print_handler)( print_context, "Unavailable\n" );
1928: e5940004 ldr r0, [r4, #4] <== NOT EXECUTED
192c: e59f1030 ldr r1, [pc, #48] ; 1964 <Stack_check_Dump_threads_usage+0x104><== NOT EXECUTED
1930: e1a0e00f mov lr, pc <== NOT EXECUTED
1934: e594f000 ldr pc, [r4] <== NOT EXECUTED
1938: ea000004 b 1950 <Stack_check_Dump_threads_usage+0xf0> <== NOT EXECUTED
} else {
(*print_handler)( print_context, "%8" PRId32 "\n", used );
193c: e5940004 ldr r0, [r4, #4]
1940: e59f1020 ldr r1, [pc, #32] ; 1968 <Stack_check_Dump_threads_usage+0x108>
1944: e1a02006 mov r2, r6
1948: e1a0e00f mov lr, pc
194c: e594f000 ldr pc, [r4]
}
}
1950: e8bd8fff pop {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
00014b3c <_CORE_message_queue_Broadcast>:
{
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
14b3c: 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
)
{
14b40: 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 ) {
14b44: 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
)
{
14b48: e1a06000 mov r6, r0
14b4c: e1a0a001 mov sl, r1
14b50: e1a07002 mov r7, r2
14b54: 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 ) {
14b58: 8a000013 bhi 14bac <_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 ) {
14b5c: e5905048 ldr r5, [r0, #72] ; 0x48
14b60: e3550000 cmp r5, #0
*count = 0;
14b64: 13a00000 movne r0, #0
14b68: 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 ) {
14b6c: 0a000007 beq 14b90 <_CORE_message_queue_Broadcast+0x54>
14b70: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
14b74: e594002c ldr r0, [r4, #44] ; 0x2c
14b78: e1a0100a mov r1, sl
14b7c: e1a02007 mov r2, r7
14b80: eb00222b bl 1d434 <memcpy>
buffer,
waitp->return_argument_second.mutable_object,
size
);
*(size_t *) the_thread->Wait.return_argument = size;
14b84: e5943028 ldr r3, [r4, #40] ; 0x28
14b88: 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;
14b8c: 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 =
14b90: e1a00006 mov r0, r6
14b94: eb0009df bl 17318 <_Thread_queue_Dequeue>
14b98: e2504000 subs r4, r0, #0
14b9c: 1afffff4 bne 14b74 <_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;
14ba0: e5885000 str r5, [r8]
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
14ba4: e1a00004 mov r0, r4
14ba8: 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;
14bac: e3a00001 mov r0, #1 <== NOT EXECUTED
#endif
}
*count = number_broadcasted;
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
}
14bb0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
00006c9c <_Heap_Walk>:
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
6c9c: 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;
6ca0: e5903014 ldr r3, [r0, #20]
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
6ca4: e24dd030 sub sp, sp, #48 ; 0x30
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
6ca8: e58d3024 str r3, [sp, #36] ; 0x24
Heap_Block *const first_block = heap->first_block;
Heap_Block *const last_block = heap->last_block;
6cac: e5903024 ldr r3, [r0, #36] ; 0x24
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
6cb0: e59f4500 ldr r4, [pc, #1280] ; 71b8 <_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;
6cb4: e58d3028 str r3, [sp, #40] ; 0x28
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
6cb8: e59f34fc ldr r3, [pc, #1276] ; 71bc <_Heap_Walk+0x520>
6cbc: e31200ff tst r2, #255 ; 0xff
6cc0: 11a04003 movne r4, r3
if ( !_System_state_Is_up( _System_state_Get() ) ) {
6cc4: e59f34f4 ldr r3, [pc, #1268] ; 71c0 <_Heap_Walk+0x524>
6cc8: 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;
6ccc: 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() ) ) {
6cd0: e3530003 cmp r3, #3
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
6cd4: e1a06000 mov r6, r0
6cd8: e1a05001 mov r5, r1
uintptr_t const page_size = heap->page_size;
6cdc: e5909010 ldr r9, [r0, #16]
uintptr_t const min_block_size = heap->min_block_size;
Heap_Block *const first_block = heap->first_block;
6ce0: 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() ) ) {
6ce4: 1a000127 bne 7188 <_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)(
6ce8: e59dc024 ldr ip, [sp, #36] ; 0x24
6cec: e58dc000 str ip, [sp]
6cf0: e5903018 ldr r3, [r0, #24]
6cf4: e58d3004 str r3, [sp, #4]
6cf8: e590301c ldr r3, [r0, #28]
6cfc: e59d2020 ldr r2, [sp, #32]
6d00: e58d3008 str r3, [sp, #8]
6d04: e59d3028 ldr r3, [sp, #40] ; 0x28
6d08: e58d200c str r2, [sp, #12]
6d0c: e58d3010 str r3, [sp, #16]
6d10: e5903008 ldr r3, [r0, #8]
6d14: e58d3014 str r3, [sp, #20]
6d18: e590300c ldr r3, [r0, #12]
6d1c: e59f24a0 ldr r2, [pc, #1184] ; 71c4 <_Heap_Walk+0x528>
6d20: e58d3018 str r3, [sp, #24]
6d24: e1a00001 mov r0, r1
6d28: e1a03009 mov r3, r9
6d2c: e3a01000 mov r1, #0
6d30: e1a0e00f mov lr, pc
6d34: e12fff14 bx r4
heap->area_begin, heap->area_end,
first_block, last_block,
first_free_block, last_free_block
);
if ( page_size == 0 ) {
6d38: e3590000 cmp r9, #0
6d3c: 1a000006 bne 6d5c <_Heap_Walk+0xc0>
(*printer)( source, true, "page size is zero\n" );
6d40: e1a00005 mov r0, r5
6d44: e3a01001 mov r1, #1
6d48: e59f2478 ldr r2, [pc, #1144] ; 71c8 <_Heap_Walk+0x52c>
6d4c: e1a0e00f mov lr, pc
6d50: e12fff14 bx r4
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
6d54: e1a08009 mov r8, r9
6d58: ea00010b b 718c <_Heap_Walk+0x4f0>
(*printer)( source, true, "page size is zero\n" );
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
6d5c: e2198003 ands r8, r9, #3
(*printer)(
6d60: 11a00005 movne r0, r5
6d64: 13a01001 movne r1, #1
6d68: 159f245c ldrne r2, [pc, #1116] ; 71cc <_Heap_Walk+0x530>
6d6c: 11a03009 movne r3, r9
6d70: 1a00010c bne 71a8 <_Heap_Walk+0x50c>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
6d74: e59d0024 ldr r0, [sp, #36] ; 0x24
6d78: e1a01009 mov r1, r9
6d7c: ebffe788 bl ba4 <__umodsi3>
);
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
6d80: e250b000 subs fp, r0, #0
6d84: 0a000006 beq 6da4 <_Heap_Walk+0x108>
(*printer)(
6d88: e1a00005 mov r0, r5
6d8c: e3a01001 mov r1, #1
6d90: e59f2438 ldr r2, [pc, #1080] ; 71d0 <_Heap_Walk+0x534>
6d94: e59d3024 ldr r3, [sp, #36] ; 0x24
6d98: e1a0e00f mov lr, pc
6d9c: e12fff14 bx r4
6da0: ea0000f9 b 718c <_Heap_Walk+0x4f0>
6da4: e59dc020 ldr ip, [sp, #32]
6da8: e1a01009 mov r1, r9
6dac: e28c0008 add r0, ip, #8
6db0: ebffe77b bl ba4 <__umodsi3>
);
return false;
}
if (
6db4: e250a000 subs sl, r0, #0
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size )
) {
(*printer)(
6db8: 11a00005 movne r0, r5
6dbc: 13a01001 movne r1, #1
6dc0: 159f240c ldrne r2, [pc, #1036] ; 71d4 <_Heap_Walk+0x538>
6dc4: 159d3020 ldrne r3, [sp, #32]
6dc8: 1a0000cc bne 7100 <_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;
6dcc: e59d2020 ldr r2, [sp, #32]
6dd0: e5928004 ldr r8, [r2, #4]
);
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
6dd4: e2188001 ands r8, r8, #1
(*printer)(
6dd8: 01a00005 moveq r0, r5
6ddc: 03a01001 moveq r1, #1
6de0: 059f23f0 ldreq r2, [pc, #1008] ; 71d8 <_Heap_Walk+0x53c>
6de4: 0a000009 beq 6e10 <_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;
6de8: e59d3028 ldr r3, [sp, #40] ; 0x28
6dec: e5937004 ldr r7, [r3, #4]
6df0: 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);
6df4: 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;
6df8: e5978004 ldr r8, [r7, #4]
);
return false;
}
if ( _Heap_Is_free( last_block ) ) {
6dfc: e2188001 ands r8, r8, #1
6e00: 1a000005 bne 6e1c <_Heap_Walk+0x180>
(*printer)(
6e04: e59f23d0 ldr r2, [pc, #976] ; 71dc <_Heap_Walk+0x540>
6e08: e1a00005 mov r0, r5
6e0c: e3a01001 mov r1, #1
6e10: e1a0e00f mov lr, pc
6e14: e12fff14 bx r4
6e18: ea0000db b 718c <_Heap_Walk+0x4f0>
);
return false;
}
if (
6e1c: e59dc020 ldr ip, [sp, #32]
6e20: e157000c cmp r7, ip
6e24: 0a000006 beq 6e44 <_Heap_Walk+0x1a8>
_Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block
) {
(*printer)(
6e28: e1a00005 mov r0, r5 <== NOT EXECUTED
6e2c: e3a01001 mov r1, #1 <== NOT EXECUTED
6e30: e59f23a8 ldr r2, [pc, #936] ; 71e0 <_Heap_Walk+0x544> <== NOT EXECUTED
6e34: e1a0e00f mov lr, pc <== NOT EXECUTED
6e38: 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;
6e3c: e1a0800a mov r8, sl <== NOT EXECUTED
6e40: ea0000d1 b 718c <_Heap_Walk+0x4f0> <== NOT EXECUTED
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
6e44: e596b010 ldr fp, [r6, #16]
block = next_block;
} while ( block != first_block );
return true;
}
6e48: 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 );
6e4c: e1a0a006 mov sl, r6
6e50: ea000034 b 6f28 <_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;
6e54: e5963020 ldr r3, [r6, #32]
6e58: e1530008 cmp r3, r8
6e5c: 83a0c000 movhi ip, #0
6e60: 8a000003 bhi 6e74 <_Heap_Walk+0x1d8>
6e64: e596c024 ldr ip, [r6, #36] ; 0x24
6e68: e15c0008 cmp ip, r8
6e6c: 33a0c000 movcc ip, #0
6e70: 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 ) ) {
6e74: e21cc0ff ands ip, ip, #255 ; 0xff
(*printer)(
6e78: 01a00005 moveq r0, r5
6e7c: 03a01001 moveq r1, #1
6e80: 059f235c ldreq r2, [pc, #860] ; 71e4 <_Heap_Walk+0x548>
6e84: 0a000012 beq 6ed4 <_Heap_Walk+0x238>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
6e88: e2880008 add r0, r8, #8
6e8c: e1a0100b mov r1, fp
6e90: ebffe743 bl ba4 <__umodsi3>
);
return false;
}
if (
6e94: e250c000 subs ip, r0, #0
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size )
) {
(*printer)(
6e98: 11a00005 movne r0, r5
6e9c: 13a01001 movne r1, #1
6ea0: 159f2340 ldrne r2, [pc, #832] ; 71e8 <_Heap_Walk+0x54c>
6ea4: 11a03008 movne r3, r8
6ea8: 1a0000be bne 71a8 <_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;
6eac: e5983004 ldr r3, [r8, #4]
6eb0: e3c33001 bic r3, r3, #1
block = next_block;
} while ( block != first_block );
return true;
}
6eb4: 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;
6eb8: e5933004 ldr r3, [r3, #4]
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
6ebc: e2133001 ands r3, r3, #1
6ec0: e58d302c str r3, [sp, #44] ; 0x2c
6ec4: 0a000009 beq 6ef0 <_Heap_Walk+0x254>
(*printer)(
6ec8: e59f231c ldr r2, [pc, #796] ; 71ec <_Heap_Walk+0x550>
6ecc: e1a00005 mov r0, r5
6ed0: e3a01001 mov r1, #1
6ed4: e1a03008 mov r3, r8
6ed8: e58dc01c str ip, [sp, #28]
6edc: e1a0e00f mov lr, pc
6ee0: e12fff14 bx r4
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
6ee4: e59dc01c ldr ip, [sp, #28]
6ee8: e1a0800c mov r8, ip
6eec: ea0000a6 b 718c <_Heap_Walk+0x4f0>
);
return false;
}
if ( free_block->prev != prev_block ) {
6ef0: e598300c ldr r3, [r8, #12]
6ef4: e153000a cmp r3, sl
6ef8: 0a000008 beq 6f20 <_Heap_Walk+0x284>
(*printer)(
6efc: e58d3000 str r3, [sp]
6f00: e1a00005 mov r0, r5
6f04: e1a03008 mov r3, r8
6f08: e3a01001 mov r1, #1
6f0c: e59f22dc ldr r2, [pc, #732] ; 71f0 <_Heap_Walk+0x554>
6f10: e1a0e00f mov lr, pc
6f14: e12fff14 bx r4
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
6f18: e59d802c ldr r8, [sp, #44] ; 0x2c
6f1c: ea00009a b 718c <_Heap_Walk+0x4f0>
return false;
}
prev_block = free_block;
free_block = free_block->next;
6f20: e1a0a008 mov sl, r8
6f24: 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 ) {
6f28: e1580006 cmp r8, r6
6f2c: 1affffc8 bne 6e54 <_Heap_Walk+0x1b8>
6f30: ea000000 b 6f38 <_Heap_Walk+0x29c>
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
6f34: e1a07008 mov r7, r8
return true;
}
6f38: 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;
6f3c: 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;
6f40: 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);
6f44: 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;
6f48: e1520008 cmp r2, r8
6f4c: 83a0b000 movhi fp, #0
6f50: 8a000003 bhi 6f64 <_Heap_Walk+0x2c8>
6f54: e596b024 ldr fp, [r6, #36] ; 0x24
6f58: e15b0008 cmp fp, r8
6f5c: 33a0b000 movcc fp, #0
6f60: 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 ) ) {
6f64: e21bb0ff ands fp, fp, #255 ; 0xff
6f68: 1a000007 bne 6f8c <_Heap_Walk+0x2f0>
(*printer)(
6f6c: e58d8000 str r8, [sp]
6f70: e1a00005 mov r0, r5
6f74: e3a01001 mov r1, #1
6f78: e59f2274 ldr r2, [pc, #628] ; 71f4 <_Heap_Walk+0x558>
6f7c: e1a03007 mov r3, r7
6f80: e1a0e00f mov lr, pc
6f84: e12fff14 bx r4
6f88: ea00005e b 7108 <_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;
6f8c: e59d2028 ldr r2, [sp, #40] ; 0x28
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
6f90: e1a0000a mov r0, sl
6f94: e1a01009 mov r1, r9
6f98: e057b002 subs fp, r7, r2
6f9c: 13a0b001 movne fp, #1
6fa0: e58d301c str r3, [sp, #28]
6fa4: ebffe6fe bl ba4 <__umodsi3>
);
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
6fa8: e3500000 cmp r0, #0
6fac: e59d301c ldr r3, [sp, #28]
6fb0: 0a000005 beq 6fcc <_Heap_Walk+0x330>
6fb4: e35b0000 cmp fp, #0
(*printer)(
6fb8: 158da000 strne sl, [sp]
6fbc: 11a00005 movne r0, r5
6fc0: 13a01001 movne r1, #1
6fc4: 159f222c ldrne r2, [pc, #556] ; 71f8 <_Heap_Walk+0x55c>
6fc8: 1a000014 bne 7020 <_Heap_Walk+0x384>
);
return false;
}
if ( block_size < min_block_size && is_not_last_block ) {
6fcc: e59dc024 ldr ip, [sp, #36] ; 0x24
6fd0: e15a000c cmp sl, ip
6fd4: 2a000009 bcs 7000 <_Heap_Walk+0x364>
6fd8: e35b0000 cmp fp, #0
6fdc: 0a000007 beq 7000 <_Heap_Walk+0x364>
(*printer)(
6fe0: e88d1400 stm sp, {sl, ip}
6fe4: e1a00005 mov r0, r5
6fe8: e3a01001 mov r1, #1
6fec: e59f2208 ldr r2, [pc, #520] ; 71fc <_Heap_Walk+0x560>
6ff0: e1a03007 mov r3, r7
6ff4: e1a0e00f mov lr, pc
6ff8: e12fff14 bx r4
6ffc: ea00006b b 71b0 <_Heap_Walk+0x514>
);
return false;
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
7000: e1580007 cmp r8, r7
7004: 8a000009 bhi 7030 <_Heap_Walk+0x394>
7008: e35b0000 cmp fp, #0
700c: 0a000007 beq 7030 <_Heap_Walk+0x394>
(*printer)(
7010: e58d8000 str r8, [sp]
7014: e59f21e4 ldr r2, [pc, #484] ; 7200 <_Heap_Walk+0x564>
7018: e1a00005 mov r0, r5
701c: e3a01001 mov r1, #1
7020: e1a03007 mov r3, r7
7024: e1a0e00f mov lr, pc
7028: e12fff14 bx r4
702c: ea00005f b 71b0 <_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;
7030: e203b001 and fp, r3, #1
7034: e5983004 ldr r3, [r8, #4]
);
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
7038: e3130001 tst r3, #1
703c: 1a00003b bne 7130 <_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 ?
7040: 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)(
7044: e5963008 ldr r3, [r6, #8]
7048: e1520003 cmp r2, r3
block = next_block;
} while ( block != first_block );
return true;
}
704c: 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)(
7050: 059f01ac ldreq r0, [pc, #428] ; 7204 <_Heap_Walk+0x568>
7054: 0a000003 beq 7068 <_Heap_Walk+0x3cc>
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
7058: e59f31a8 ldr r3, [pc, #424] ; 7208 <_Heap_Walk+0x56c>
705c: e1520006 cmp r2, r6
7060: e59f01a4 ldr r0, [pc, #420] ; 720c <_Heap_Walk+0x570>
7064: 01a00003 moveq r0, r3
block->next,
block->next == last_free_block ?
7068: 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)(
706c: e1530001 cmp r3, r1
7070: 059f1198 ldreq r1, [pc, #408] ; 7210 <_Heap_Walk+0x574>
7074: 0a000003 beq 7088 <_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)" : "")
7078: e59fc194 ldr ip, [pc, #404] ; 7214 <_Heap_Walk+0x578>
707c: e1530006 cmp r3, r6
7080: e59f1184 ldr r1, [pc, #388] ; 720c <_Heap_Walk+0x570>
7084: 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)(
7088: e58d2004 str r2, [sp, #4]
708c: e58d0008 str r0, [sp, #8]
7090: e58d300c str r3, [sp, #12]
7094: e58d1010 str r1, [sp, #16]
7098: e1a03007 mov r3, r7
709c: e58da000 str sl, [sp]
70a0: e1a00005 mov r0, r5
70a4: e3a01000 mov r1, #0
70a8: e59f2168 ldr r2, [pc, #360] ; 7218 <_Heap_Walk+0x57c>
70ac: e1a0e00f mov lr, pc
70b0: e12fff14 bx r4
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
70b4: e5983000 ldr r3, [r8]
70b8: e15a0003 cmp sl, r3
70bc: 0a000009 beq 70e8 <_Heap_Walk+0x44c>
(*printer)(
70c0: e58d3004 str r3, [sp, #4]
70c4: e58da000 str sl, [sp]
70c8: e58d8008 str r8, [sp, #8]
70cc: e1a00005 mov r0, r5
70d0: e3a01001 mov r1, #1
70d4: e59f2140 ldr r2, [pc, #320] ; 721c <_Heap_Walk+0x580>
70d8: e1a03007 mov r3, r7
70dc: e1a0e00f mov lr, pc
70e0: e12fff14 bx r4
70e4: ea000031 b 71b0 <_Heap_Walk+0x514>
);
return false;
}
if ( !prev_used ) {
70e8: e35b0000 cmp fp, #0
70ec: 1a000007 bne 7110 <_Heap_Walk+0x474>
(*printer)(
70f0: e59f2128 ldr r2, [pc, #296] ; 7220 <_Heap_Walk+0x584>
70f4: e1a00005 mov r0, r5
70f8: e3a01001 mov r1, #1
70fc: e1a03007 mov r3, r7
7100: e1a0e00f mov lr, pc
7104: e12fff14 bx r4
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
7108: e1a0800b mov r8, fp
710c: ea00001e b 718c <_Heap_Walk+0x4f0>
block = next_block;
} while ( block != first_block );
return true;
}
7110: e5963008 ldr r3, [r6, #8]
7114: ea000002 b 7124 <_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 ) {
7118: e1530007 cmp r3, r7
711c: 0a000016 beq 717c <_Heap_Walk+0x4e0>
return true;
}
free_block = free_block->next;
7120: 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 ) {
7124: e1530006 cmp r3, r6
7128: 1afffffa bne 7118 <_Heap_Walk+0x47c>
712c: ea000019 b 7198 <_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) {
7130: e35b0000 cmp fp, #0
7134: 0a000007 beq 7158 <_Heap_Walk+0x4bc>
(*printer)(
7138: e58da000 str sl, [sp]
713c: e1a00005 mov r0, r5
7140: e3a01000 mov r1, #0
7144: e59f20d8 ldr r2, [pc, #216] ; 7224 <_Heap_Walk+0x588>
7148: e1a03007 mov r3, r7
714c: e1a0e00f mov lr, pc
7150: e12fff14 bx r4
7154: ea000008 b 717c <_Heap_Walk+0x4e0>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
7158: e58da000 str sl, [sp]
715c: e5973000 ldr r3, [r7]
7160: e1a00005 mov r0, r5
7164: e58d3004 str r3, [sp, #4]
7168: e1a0100b mov r1, fp
716c: e59f20b4 ldr r2, [pc, #180] ; 7228 <_Heap_Walk+0x58c>
7170: e1a03007 mov r3, r7
7174: e1a0e00f mov lr, pc
7178: e12fff14 bx r4
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
717c: e59d2020 ldr r2, [sp, #32]
7180: e1580002 cmp r8, r2
7184: 1affff6a bne 6f34 <_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;
7188: e3a08001 mov r8, #1
block = next_block;
} while ( block != first_block );
return true;
}
718c: e1a00008 mov r0, r8
7190: e28dd030 add sp, sp, #48 ; 0x30
7194: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
7198: e59f208c ldr r2, [pc, #140] ; 722c <_Heap_Walk+0x590>
719c: e1a00005 mov r0, r5
71a0: e3a01001 mov r1, #1
71a4: e1a03007 mov r3, r7
71a8: e1a0e00f mov lr, pc
71ac: e12fff14 bx r4
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
71b0: e3a08000 mov r8, #0
71b4: eafffff4 b 718c <_Heap_Walk+0x4f0>
00020824 <_POSIX_signals_Unblock_thread>:
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
20824: e92d41f0 push {r4, r5, r6, r7, r8, lr}
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
20828: e5903010 ldr r3, [r0, #16]
2082c: e59f50f8 ldr r5, [pc, #248] ; 2092c <_POSIX_signals_Unblock_thread+0x108>
20830: e59f80f4 ldr r8, [pc, #244] ; 2092c <_POSIX_signals_Unblock_thread+0x108>
20834: e0035005 and r5, r3, r5
20838: e241c001 sub ip, r1, #1
2083c: e3a06001 mov r6, #1
20840: e1550008 cmp r5, r8
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
20844: e1a04000 mov r4, r0
POSIX_API_Control *api;
sigset_t mask;
siginfo_t *the_info = NULL;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
20848: e5907108 ldr r7, [r0, #264] ; 0x108
2084c: e1a0cc16 lsl ip, r6, ip
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
20850: 1a000013 bne 208a4 <_POSIX_signals_Unblock_thread+0x80>
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
20854: e5903030 ldr r3, [r0, #48] ; 0x30
20858: e11c0003 tst ip, r3
2085c: 1a000002 bne 2086c <_POSIX_signals_Unblock_thread+0x48>
20860: e59750d0 ldr r5, [r7, #208] ; 0xd0
20864: e1dc5005 bics r5, ip, r5
20868: 0a00002d beq 20924 <_POSIX_signals_Unblock_thread+0x100>
the_thread->Wait.return_code = EINTR;
2086c: e3a03004 mov r3, #4
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
20870: e3520000 cmp r2, #0
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
the_thread->Wait.return_code = EINTR;
20874: e5843034 str r3, [r4, #52] ; 0x34
the_info = (siginfo_t *) the_thread->Wait.return_argument;
20878: e5943028 ldr r3, [r4, #40] ; 0x28
if ( !info ) {
the_info->si_signo = signo;
the_info->si_code = SI_USER;
the_info->si_value.sival_int = 0;
} else {
*the_info = *info;
2087c: 18920007 ldmne r2, {r0, r1, r2}
the_thread->Wait.return_code = EINTR;
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
the_info->si_signo = signo;
20880: 05831000 streq r1, [r3]
the_info->si_code = SI_USER;
20884: 03a01001 moveq r1, #1
the_info->si_value.sival_int = 0;
} else {
*the_info = *info;
20888: 18830007 stmne r3, {r0, r1, r2}
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
the_info->si_signo = signo;
the_info->si_code = SI_USER;
2088c: 05831004 streq r1, [r3, #4]
the_info->si_value.sival_int = 0;
20890: 05832008 streq r2, [r3, #8]
} else {
*the_info = *info;
}
_Thread_queue_Extract_with_proxy( the_thread );
20894: e1a00004 mov r0, r4
20898: ebffaf1c bl c510 <_Thread_queue_Extract_with_proxy>
return true;
2089c: e3a05001 mov r5, #1
208a0: ea00001f b 20924 <_POSIX_signals_Unblock_thread+0x100>
}
/*
* Thread is not waiting due to a sigwait.
*/
if ( ~api->signals_blocked & mask ) {
208a4: e59750d0 ldr r5, [r7, #208] ; 0xd0
208a8: e1dc5005 bics r5, ip, r5
208ac: 0a00001c beq 20924 <_POSIX_signals_Unblock_thread+0x100>
* it is not blocked, THEN
* we need to dispatch at the end of this ISR.
* + Any other combination, do nothing.
*/
if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) {
208b0: e2135201 ands r5, r3, #268435456 ; 0x10000000
208b4: 0a000010 beq 208fc <_POSIX_signals_Unblock_thread+0xd8>
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
208b8: e59f5070 ldr r5, [pc, #112] ; 20930 <_POSIX_signals_Unblock_thread+0x10c>
208bc: e0035005 and r5, r3, r5
the_thread->Wait.return_code = EINTR;
208c0: e3a02004 mov r2, #4
/*
* In pthread_cond_wait, a thread will be blocking on a thread
* queue, but is also interruptible by a POSIX signal.
*/
if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
208c4: e3550000 cmp r5, #0
* we need to dispatch at the end of this ISR.
* + Any other combination, do nothing.
*/
if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) {
the_thread->Wait.return_code = EINTR;
208c8: e5802034 str r2, [r0, #52] ; 0x34
/*
* In pthread_cond_wait, a thread will be blocking on a thread
* queue, but is also interruptible by a POSIX signal.
*/
if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
208cc: 0a000002 beq 208dc <_POSIX_signals_Unblock_thread+0xb8>
_Thread_queue_Extract_with_proxy( the_thread );
208d0: ebffaf0e bl c510 <_Thread_queue_Extract_with_proxy> <== NOT EXECUTED
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
}
return false;
208d4: e3a05000 mov r5, #0 <== NOT EXECUTED
208d8: ea000011 b 20924 <_POSIX_signals_Unblock_thread+0x100> <== NOT EXECUTED
* In pthread_cond_wait, a thread will be blocking on a thread
* queue, but is also interruptible by a POSIX signal.
*/
if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
_Thread_queue_Extract_with_proxy( the_thread );
else if ( _States_Is_delaying(the_thread->current_state) ) {
208dc: e2133008 ands r3, r3, #8
208e0: 0a00000e beq 20920 <_POSIX_signals_Unblock_thread+0xfc>
(void) _Watchdog_Remove( &the_thread->Timer );
208e4: e2800048 add r0, r0, #72 ; 0x48
208e8: ebffb1a3 bl cf7c <_Watchdog_Remove>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
208ec: e1a00004 mov r0, r4
208f0: e59f103c ldr r1, [pc, #60] ; 20934 <_POSIX_signals_Unblock_thread+0x110>
208f4: ebffac64 bl ba8c <_Thread_Clear_state>
208f8: ea000009 b 20924 <_POSIX_signals_Unblock_thread+0x100>
_Thread_Unblock( the_thread );
}
} else if ( the_thread->current_state == STATES_READY ) {
208fc: e3530000 cmp r3, #0
20900: 1a000007 bne 20924 <_POSIX_signals_Unblock_thread+0x100>
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
20904: e59f202c ldr r2, [pc, #44] ; 20938 <_POSIX_signals_Unblock_thread+0x114>
20908: e5925000 ldr r5, [r2]
2090c: e3550000 cmp r5, #0
20910: 0a000003 beq 20924 <_POSIX_signals_Unblock_thread+0x100>
20914: e5921004 ldr r1, [r2, #4]
20918: e1500001 cmp r0, r1
_Thread_Dispatch_necessary = true;
2091c: 05c26010 strbeq r6, [r2, #16]
}
}
return false;
20920: e1a05003 mov r5, r3
}
20924: e1a00005 mov r0, r5
20928: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
00007384 <_Thread_queue_Enqueue_priority>:
7384: 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;
7388: e591c014 ldr ip, [r1, #20]
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
738c: e5813038 str r3, [r1, #56] ; 0x38
the_chain->permanent_null = NULL;
7390: e3a03000 mov r3, #0
7394: e581303c str r3, [r1, #60] ; 0x3c
Chain_Node *previous_node;
Chain_Node *search_node;
Priority_Control priority;
States_Control block_state;
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
7398: 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
)
{
739c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
the_chain->last = _Chain_Head(the_chain);
73a0: 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 ];
73a4: e3a0400c mov r4, #12
RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number (
Priority_Control the_priority
)
{
return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER);
73a8: e1a0332c lsr r3, ip, #6
73ac: e0030394 mul r3, r4, r3
block_state = the_thread_queue->state;
if ( _Thread_queue_Is_reverse_search( priority ) )
73b0: e31c0020 tst ip, #32
_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 ];
73b4: e0807003 add r7, r0, r3
block_state = the_thread_queue->state;
73b8: e5908038 ldr r8, [r0, #56] ; 0x38
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
73bc: 159fa15c ldrne sl, [pc, #348] ; 7520 <_Thread_queue_Enqueue_priority+0x19c>
_ISR_Disable( level );
search_thread = (Thread_Control *) header->last;
73c0: 11a0b007 movne fp, r7
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;
if ( _Thread_queue_Is_reverse_search( priority ) )
73c4: 1a000024 bne 745c <_Thread_queue_Enqueue_priority+0xd8>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
73c8: e2833004 add r3, r3, #4
73cc: e080a003 add sl, r0, r3
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
73d0: e10f4000 mrs r4, CPSR
73d4: e3843080 orr r3, r4, #128 ; 0x80
73d8: e129f003 msr CPSR_fc, r3
73dc: e1a05004 mov r5, r4
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
73e0: e3e06000 mvn r6, #0
_ISR_Disable( level );
search_thread = (Thread_Control *) header->first;
73e4: e5973000 ldr r3, [r7]
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
73e8: ea00000b b 741c <_Thread_queue_Enqueue_priority+0x98>
search_priority = search_thread->current_priority;
73ec: e5936014 ldr r6, [r3, #20]
if ( priority <= search_priority )
73f0: e15c0006 cmp ip, r6
73f4: 9a00000a bls 7424 <_Thread_queue_Enqueue_priority+0xa0>
static inline void arm_interrupt_flash( uint32_t level )
{
uint32_t arm_switch_reg;
asm volatile (
73f8: e10f9000 mrs r9, CPSR
73fc: e129f004 msr CPSR_fc, r4
7400: 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);
7404: 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) ) {
7408: e1180009 tst r8, r9
740c: 1a000001 bne 7418 <_Thread_queue_Enqueue_priority+0x94>
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
7410: e129f004 msr CPSR_fc, r4 <== NOT EXECUTED
7414: eaffffed b 73d0 <_Thread_queue_Enqueue_priority+0x4c> <== NOT EXECUTED
_ISR_Enable( level );
goto restart_forward_search;
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
7418: e5933000 ldr r3, [r3]
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) header->first;
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
741c: e153000a cmp r3, sl
7420: 1afffff1 bne 73ec <_Thread_queue_Enqueue_priority+0x68>
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
7424: e5907030 ldr r7, [r0, #48] ; 0x30
7428: e3570001 cmp r7, #1
742c: 1a000038 bne 7514 <_Thread_queue_Enqueue_priority+0x190>
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
7430: e3a02000 mov r2, #0
if ( priority == search_priority )
7434: 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;
7438: e5802030 str r2, [r0, #48] ; 0x30
if ( priority == search_priority )
743c: 0a00002a beq 74ec <_Thread_queue_Enqueue_priority+0x168>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
previous_node = search_node->previous;
7440: e5932004 ldr r2, [r3, #4]
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
7444: e5813000 str r3, [r1]
the_node->previous = previous_node;
7448: e5812004 str r2, [r1, #4]
previous_node->next = the_node;
744c: e5821000 str r1, [r2]
search_node->previous = the_node;
7450: e5831004 str r1, [r3, #4]
the_thread->Wait.queue = the_thread_queue;
7454: e5810044 str r0, [r1, #68] ; 0x44
_ISR_Enable( level );
7458: ea000021 b 74e4 <_Thread_queue_Enqueue_priority+0x160>
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
745c: e5da6000 ldrb r6, [sl]
7460: e2866001 add r6, r6, #1
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
7464: e10f4000 mrs r4, CPSR
7468: e3843080 orr r3, r4, #128 ; 0x80
746c: e129f003 msr CPSR_fc, r3
7470: e1a05004 mov r5, r4
_ISR_Disable( level );
search_thread = (Thread_Control *) header->last;
7474: e59b3008 ldr r3, [fp, #8]
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
7478: ea00000b b 74ac <_Thread_queue_Enqueue_priority+0x128>
search_priority = search_thread->current_priority;
747c: e5936014 ldr r6, [r3, #20]
if ( priority >= search_priority )
7480: e15c0006 cmp ip, r6
7484: 2a00000a bcs 74b4 <_Thread_queue_Enqueue_priority+0x130>
static inline void arm_interrupt_flash( uint32_t level )
{
uint32_t arm_switch_reg;
asm volatile (
7488: e10f9000 mrs r9, CPSR
748c: e129f004 msr CPSR_fc, r4
7490: e129f009 msr CPSR_fc, r9
7494: 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) ) {
7498: e1180009 tst r8, r9
749c: 1a000001 bne 74a8 <_Thread_queue_Enqueue_priority+0x124>
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
74a0: e129f004 msr CPSR_fc, r4
74a4: eaffffec b 745c <_Thread_queue_Enqueue_priority+0xd8>
_ISR_Enable( level );
goto restart_reverse_search;
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
74a8: e5933004 ldr r3, [r3, #4]
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) header->last;
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
74ac: e1530007 cmp r3, r7
74b0: 1afffff1 bne 747c <_Thread_queue_Enqueue_priority+0xf8>
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
74b4: e5907030 ldr r7, [r0, #48] ; 0x30
74b8: e3570001 cmp r7, #1
74bc: 1a000014 bne 7514 <_Thread_queue_Enqueue_priority+0x190>
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
74c0: e3a02000 mov r2, #0
if ( priority == search_priority )
74c4: 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;
74c8: e5802030 str r2, [r0, #48] ; 0x30
if ( priority == search_priority )
74cc: 0a000006 beq 74ec <_Thread_queue_Enqueue_priority+0x168>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
74d0: e5932000 ldr r2, [r3]
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
74d4: e881000c stm r1, {r2, r3}
search_node->next = the_node;
next_node->previous = the_node;
74d8: 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;
74dc: e5831000 str r1, [r3]
next_node->previous = the_node;
the_thread->Wait.queue = the_thread_queue;
74e0: e5810044 str r0, [r1, #68] ; 0x44
74e4: e129f004 msr CPSR_fc, r4
74e8: ea000007 b 750c <_Thread_queue_Enqueue_priority+0x188>
74ec: e283303c add r3, r3, #60 ; 0x3c
_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;
74f0: e5932004 ldr r2, [r3, #4]
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
74f4: e5813000 str r3, [r1]
the_node->previous = previous_node;
74f8: e5812004 str r2, [r1, #4]
previous_node->next = the_node;
74fc: e5821000 str r1, [r2]
search_node->previous = the_node;
7500: e5831004 str r1, [r3, #4]
the_thread->Wait.queue = the_thread_queue;
7504: e5810044 str r0, [r1, #68] ; 0x44
7508: e129f005 msr CPSR_fc, r5
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
750c: e3a00001 mov r0, #1
7510: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, 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;
7514: e5825000 str r5, [r2]
return the_thread_queue->sync_state;
7518: e5900030 ldr r0, [r0, #48] ; 0x30
}
751c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
00013fc0 <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
13fc0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
13fc4: e24dd018 sub sp, sp, #24
13fc8: e28db00c add fp, sp, #12
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
the_chain->permanent_null = NULL;
13fcc: e3a03000 mov r3, #0
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
13fd0: e28ba004 add sl, fp, #4
13fd4: e28d7004 add r7, sp, #4
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
13fd8: e58da00c str sl, [sp, #12]
the_chain->permanent_null = NULL;
13fdc: e58d3010 str r3, [sp, #16]
the_chain->last = _Chain_Head(the_chain);
13fe0: e58db014 str fp, [sp, #20]
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
13fe4: e58d7000 str r7, [sp]
the_chain->permanent_null = NULL;
13fe8: e98d2008 stmib sp, {r3, sp}
13fec: e1a04000 mov r4, r0
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
13ff0: e1a0500d mov r5, sp
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
13ff4: e2809030 add r9, r0, #48 ; 0x30
{
/*
* Afterwards all timer inserts are directed to this chain and the interval
* and TOD chains will be no more modified by other parties.
*/
ts->insert_chain = insert_chain;
13ff8: e584b078 str fp, [r4, #120] ; 0x78
/*
* The current TOD is before the last TOD which indicates that
* TOD has been set backwards.
*/
delta = last_snapshot - snapshot;
_Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
13ffc: e2848068 add r8, r4, #104 ; 0x68
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
14000: e59f2150 ldr r2, [pc, #336] ; 14158 <_Timer_server_Body+0x198>
14004: e5923000 ldr r3, [r2]
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
14008: e594103c ldr r1, [r4, #60] ; 0x3c
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
1400c: e1a02005 mov r2, r5
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
14010: e584303c str r3, [r4, #60] ; 0x3c
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
14014: e0611003 rsb r1, r1, r3
14018: e1a00009 mov r0, r9
1401c: eb0010dd bl 18398 <_Watchdog_Adjust_to_chain>
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
14020: e59f3134 ldr r3, [pc, #308] ; 1415c <_Timer_server_Body+0x19c>
Watchdog_Interval last_snapshot = watchdogs->last_snapshot;
14024: e5942074 ldr r2, [r4, #116] ; 0x74
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
14028: e5936000 ldr r6, [r3]
/*
* Process the seconds chain. Start by checking that the Time
* of Day (TOD) has not been set backwards. If it has then
* we want to adjust the watchdogs->Chain to indicate this.
*/
if ( snapshot > last_snapshot ) {
1402c: e1560002 cmp r6, r2
14030: 9a000004 bls 14048 <_Timer_server_Body+0x88>
/*
* This path is for normal forward movement and cases where the
* TOD has been set forward.
*/
delta = snapshot - last_snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
14034: e0621006 rsb r1, r2, r6
14038: e1a00008 mov r0, r8
1403c: e1a02005 mov r2, r5
14040: eb0010d4 bl 18398 <_Watchdog_Adjust_to_chain>
14044: ea000003 b 14058 <_Timer_server_Body+0x98>
/*
* The current TOD is before the last TOD which indicates that
* TOD has been set backwards.
*/
delta = last_snapshot - snapshot;
_Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
14048: 31a00008 movcc r0, r8
1404c: 33a01001 movcc r1, #1
14050: 30662002 rsbcc r2, r6, r2
14054: 3b0010a7 blcc 182f8 <_Watchdog_Adjust>
}
watchdogs->last_snapshot = snapshot;
14058: e5846074 str r6, [r4, #116] ; 0x74
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
1405c: e5940078 ldr r0, [r4, #120] ; 0x78
14060: eb000298 bl 14ac8 <_Chain_Get>
if ( timer == NULL ) {
14064: e2506000 subs r6, r0, #0
14068: 0a000009 beq 14094 <_Timer_server_Body+0xd4>
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
1406c: e5963038 ldr r3, [r6, #56] ; 0x38
14070: e3530001 cmp r3, #1
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
14074: 01a00009 moveq r0, r9
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
14078: 0a000002 beq 14088 <_Timer_server_Body+0xc8>
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
1407c: e3530003 cmp r3, #3
14080: 1afffff5 bne 1405c <_Timer_server_Body+0x9c>
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
14084: e1a00008 mov r0, r8
14088: e2861010 add r1, r6, #16
1408c: eb0010ec bl 18444 <_Watchdog_Insert>
14090: eafffff1 b 1405c <_Timer_server_Body+0x9c>
* of zero it will be processed in the next iteration of the timer server
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
14094: ebffff97 bl 13ef8 <arm_interrupt_disable>
if ( _Chain_Is_empty( insert_chain ) ) {
14098: e59d300c ldr r3, [sp, #12]
1409c: e153000a cmp r3, sl
140a0: 1a000006 bne 140c0 <_Timer_server_Body+0x100>
ts->insert_chain = NULL;
140a4: e5846078 str r6, [r4, #120] ; 0x78
140a8: e129f000 msr CPSR_fc, r0
_Chain_Initialize_empty( &fire_chain );
while ( true ) {
_Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain );
if ( !_Chain_Is_empty( &fire_chain ) ) {
140ac: e59d3000 ldr r3, [sp]
140b0: e1530007 cmp r3, r7
)
{
if ( !_Chain_Is_empty(the_chain))
return _Chain_Get_first_unprotected(the_chain);
else
return NULL;
140b4: 13a06000 movne r6, #0
140b8: 1a000002 bne 140c8 <_Timer_server_Body+0x108>
140bc: ea000013 b 14110 <_Timer_server_Body+0x150>
140c0: e129f000 msr CPSR_fc, r0 <== NOT EXECUTED
140c4: eaffffcd b 14000 <_Timer_server_Body+0x40> <== NOT EXECUTED
/*
* It is essential that interrupts are disable here since an interrupt
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
140c8: ebffff8a bl 13ef8 <arm_interrupt_disable>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
140cc: e59d3000 ldr r3, [sp]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
140d0: e1530007 cmp r3, r7
140d4: 0a00000b beq 14108 <_Timer_server_Body+0x148>
{
Chain_Node *return_node;
Chain_Node *new_first;
return_node = the_chain->first;
new_first = return_node->next;
140d8: e5932000 ldr r2, [r3]
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
140dc: e3530000 cmp r3, #0
the_chain->first = new_first;
140e0: e58d2000 str r2, [sp]
new_first->previous = _Chain_Head(the_chain);
140e4: e5825004 str r5, [r2, #4]
140e8: 0a000006 beq 14108 <_Timer_server_Body+0x148>
watchdog->state = WATCHDOG_INACTIVE;
140ec: e5836008 str r6, [r3, #8]
140f0: e129f000 msr CPSR_fc, r0
/*
* The timer server may block here and wait for resources or time.
* The system watchdogs are inactive and will remain inactive since
* the active flag of the timer server is true.
*/
(*watchdog->routine)( watchdog->id, watchdog->user_data );
140f4: e2830020 add r0, r3, #32
140f8: e8900003 ldm r0, {r0, r1}
140fc: e1a0e00f mov lr, pc
14100: e593f01c ldr pc, [r3, #28]
}
14104: eaffffef b 140c8 <_Timer_server_Body+0x108>
14108: e129f000 msr CPSR_fc, r0
1410c: eaffffb9 b 13ff8 <_Timer_server_Body+0x38>
} else {
ts->active = false;
14110: e3a03000 mov r3, #0
14114: e5c4307c strb r3, [r4, #124] ; 0x7c
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
14118: ebffff7a bl 13f08 <_Thread_Disable_dispatch>
_Thread_Set_state( ts->thread, STATES_DELAYING );
1411c: e3a01008 mov r1, #8
14120: e5940000 ldr r0, [r4]
14124: eb000e22 bl 179b4 <_Thread_Set_state>
_Timer_server_Reset_interval_system_watchdog( ts );
14128: e1a00004 mov r0, r4
1412c: ebffff7b bl 13f20 <_Timer_server_Reset_interval_system_watchdog>
_Timer_server_Reset_tod_system_watchdog( ts );
14130: e1a00004 mov r0, r4
14134: ebffff8d bl 13f70 <_Timer_server_Reset_tod_system_watchdog>
_Thread_Enable_dispatch();
14138: eb000ba1 bl 16fc4 <_Thread_Enable_dispatch>
ts->active = true;
1413c: e3a03001 mov r3, #1
14140: e5c4307c strb r3, [r4, #124] ; 0x7c
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
14144: e2840008 add r0, r4, #8
14148: eb001113 bl 1859c <_Watchdog_Remove>
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
1414c: e2840040 add r0, r4, #64 ; 0x40
14150: eb001111 bl 1859c <_Watchdog_Remove>
14154: eaffffa7 b 13ff8 <_Timer_server_Body+0x38>
00005224 <aio_cancel>:
* operation(s) cannot be canceled
*/
int aio_cancel(int fildes, struct aiocb *aiocbp)
{
5224: e92d40f0 push {r4, r5, r6, r7, lr}
rtems_aio_request_chain *r_chain;
int result;
pthread_mutex_lock (&aio_request_queue.mutex);
5228: e59f41a4 ldr r4, [pc, #420] ; 53d4 <aio_cancel+0x1b0>
* operation(s) cannot be canceled
*/
int aio_cancel(int fildes, struct aiocb *aiocbp)
{
522c: e1a05001 mov r5, r1
5230: e1a07000 mov r7, r0
rtems_aio_request_chain *r_chain;
int result;
pthread_mutex_lock (&aio_request_queue.mutex);
5234: e1a00004 mov r0, r4
5238: eb0003bf bl 613c <pthread_mutex_lock>
if (aiocbp == NULL)
523c: e3550000 cmp r5, #0
5240: 1a000036 bne 5320 <aio_cancel+0xfc>
{
if (fcntl (fildes, F_GETFL) < 0) {
5244: e1a00007 mov r0, r7 <== NOT EXECUTED
5248: e3a01003 mov r1, #3 <== NOT EXECUTED
524c: eb001968 bl b7f4 <fcntl> <== NOT EXECUTED
5250: e3500000 cmp r0, #0 <== NOT EXECUTED
5254: aa000004 bge 526c <aio_cancel+0x48> <== NOT EXECUTED
pthread_mutex_unlock(&aio_request_queue.mutex);
5258: e1a00004 mov r0, r4 <== NOT EXECUTED
525c: eb0003d5 bl 61b8 <pthread_mutex_unlock> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one (EBADF);
5260: eb00272d bl ef1c <__errno> <== NOT EXECUTED
5264: e3a03009 mov r3, #9 <== NOT EXECUTED
5268: ea000033 b 533c <aio_cancel+0x118> <== NOT EXECUTED
}
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req,
526c: e2840048 add r0, r4, #72 ; 0x48 <== NOT EXECUTED
5270: e1a01007 mov r1, r7 <== NOT EXECUTED
5274: e1a02005 mov r2, r5 <== NOT EXECUTED
5278: eb000088 bl 54a0 <rtems_aio_search_fd> <== NOT EXECUTED
fildes,
0);
if (r_chain == NULL)
527c: e2506000 subs r6, r0, #0 <== NOT EXECUTED
5280: 1a00001c bne 52f8 <aio_cancel+0xd4> <== NOT EXECUTED
{
if (!rtems_chain_is_empty (&aio_request_queue.idle_req))
5284: e5942054 ldr r2, [r4, #84] ; 0x54 <== NOT EXECUTED
5288: e2843058 add r3, r4, #88 ; 0x58 <== NOT EXECUTED
528c: e1520003 cmp r2, r3 <== NOT EXECUTED
5290: 0a000014 beq 52e8 <aio_cancel+0xc4> <== NOT EXECUTED
{
r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req,
5294: e2840054 add r0, r4, #84 ; 0x54 <== NOT EXECUTED
5298: e1a01007 mov r1, r7 <== NOT EXECUTED
529c: e1a02006 mov r2, r6 <== NOT EXECUTED
52a0: eb00007e bl 54a0 <rtems_aio_search_fd> <== NOT EXECUTED
fildes,
0);
if (r_chain == NULL) {
52a4: e2505000 subs r5, r0, #0 <== NOT EXECUTED
52a8: 0a00000e beq 52e8 <aio_cancel+0xc4> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
52ac: e2850008 add r0, r5, #8 <== NOT EXECUTED
return AIO_ALLDONE;
}
rtems_chain_extract (&r_chain->next_fd);
rtems_aio_remove_fd (r_chain);
pthread_mutex_destroy (&r_chain->mutex);
52b0: e285701c add r7, r5, #28 <== NOT EXECUTED
52b4: eb0009b2 bl 7984 <_Chain_Extract> <== NOT EXECUTED
pthread_mutex_unlock(&aio_request_queue.mutex);
return AIO_ALLDONE;
}
rtems_chain_extract (&r_chain->next_fd);
rtems_aio_remove_fd (r_chain);
52b8: e1a00005 mov r0, r5 <== NOT EXECUTED
52bc: eb00014a bl 57ec <rtems_aio_remove_fd> <== NOT EXECUTED
pthread_mutex_destroy (&r_chain->mutex);
52c0: e1a00007 mov r0, r7 <== NOT EXECUTED
52c4: eb0002fe bl 5ec4 <pthread_mutex_destroy> <== NOT EXECUTED
pthread_cond_destroy (&r_chain->mutex);
52c8: e1a00007 mov r0, r7 <== NOT EXECUTED
52cc: eb000230 bl 5b94 <pthread_cond_destroy> <== NOT EXECUTED
free (r_chain);
52d0: e1a00005 mov r0, r5 <== NOT EXECUTED
52d4: ebfff478 bl 24bc <free> <== NOT EXECUTED
pthread_mutex_unlock (&aio_request_queue.mutex);
52d8: e1a00004 mov r0, r4 <== NOT EXECUTED
52dc: eb0003b5 bl 61b8 <pthread_mutex_unlock> <== NOT EXECUTED
return AIO_CANCELED;
52e0: e1a05006 mov r5, r6 <== NOT EXECUTED
52e4: ea000038 b 53cc <aio_cancel+0x1a8> <== NOT EXECUTED
}
pthread_mutex_unlock (&aio_request_queue.mutex);
52e8: e1a00004 mov r0, r4 <== NOT EXECUTED
52ec: eb0003b1 bl 61b8 <pthread_mutex_unlock> <== NOT EXECUTED
return AIO_ALLDONE;
52f0: e3a05002 mov r5, #2 <== NOT EXECUTED
52f4: ea000034 b 53cc <aio_cancel+0x1a8> <== NOT EXECUTED
}
pthread_mutex_lock (&r_chain->mutex);
52f8: e286701c add r7, r6, #28 <== NOT EXECUTED
52fc: e1a00007 mov r0, r7 <== NOT EXECUTED
5300: eb00038d bl 613c <pthread_mutex_lock> <== NOT EXECUTED
5304: e2860008 add r0, r6, #8 <== NOT EXECUTED
5308: eb00099d bl 7984 <_Chain_Extract> <== NOT EXECUTED
rtems_chain_extract (&r_chain->next_fd);
rtems_aio_remove_fd (r_chain);
530c: e1a00006 mov r0, r6 <== NOT EXECUTED
5310: eb000135 bl 57ec <rtems_aio_remove_fd> <== NOT EXECUTED
pthread_mutex_unlock (&r_chain->mutex);
5314: e1a00007 mov r0, r7 <== NOT EXECUTED
5318: eb0003a6 bl 61b8 <pthread_mutex_unlock> <== NOT EXECUTED
531c: ea00001d b 5398 <aio_cancel+0x174> <== NOT EXECUTED
pthread_mutex_unlock (&aio_request_queue.mutex);
return AIO_CANCELED;
}
else
{
if (aiocbp->aio_fildes != fildes) {
5320: e5956000 ldr r6, [r5]
5324: e1560007 cmp r6, r7
5328: 0a000006 beq 5348 <aio_cancel+0x124>
pthread_mutex_unlock (&aio_request_queue.mutex);
532c: e1a00004 mov r0, r4
5330: eb0003a0 bl 61b8 <pthread_mutex_unlock>
rtems_set_errno_and_return_minus_one (EINVAL);
5334: eb0026f8 bl ef1c <__errno>
5338: e3a03016 mov r3, #22
533c: e5803000 str r3, [r0]
5340: e3e05000 mvn r5, #0
5344: ea000020 b 53cc <aio_cancel+0x1a8>
}
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req,
5348: e2840048 add r0, r4, #72 ; 0x48
534c: e1a01006 mov r1, r6
5350: e3a02000 mov r2, #0
5354: eb000051 bl 54a0 <rtems_aio_search_fd>
fildes,
0);
if (r_chain == NULL)
5358: e2507000 subs r7, r0, #0
535c: 1a00000f bne 53a0 <aio_cancel+0x17c>
if (!rtems_chain_is_empty (&aio_request_queue.idle_req))
5360: e5942054 ldr r2, [r4, #84] ; 0x54
5364: e2843058 add r3, r4, #88 ; 0x58
5368: e1520003 cmp r2, r3
536c: 0a00000b beq 53a0 <aio_cancel+0x17c>
{
r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req,
5370: e2840054 add r0, r4, #84 ; 0x54
5374: e1a01006 mov r1, r6
5378: e1a02007 mov r2, r7
537c: eb000047 bl 54a0 <rtems_aio_search_fd>
fildes,
0);
if (r_chain == NULL)
5380: e3500000 cmp r0, #0
5384: 0affffe8 beq 532c <aio_cancel+0x108>
{
pthread_mutex_unlock (&aio_request_queue.mutex);
rtems_set_errno_and_return_minus_one (EINVAL);
}
result = rtems_aio_remove_req (&r_chain->next_fd, aiocbp);
5388: e1a01005 mov r1, r5 <== NOT EXECUTED
538c: e2800008 add r0, r0, #8 <== NOT EXECUTED
5390: eb000125 bl 582c <rtems_aio_remove_req> <== NOT EXECUTED
5394: e1a05000 mov r5, r0 <== NOT EXECUTED
pthread_mutex_unlock (&aio_request_queue.mutex);
5398: e1a00004 mov r0, r4 <== NOT EXECUTED
539c: ea000009 b 53c8 <aio_cancel+0x1a4> <== NOT EXECUTED
return result;
}
pthread_mutex_lock (&r_chain->mutex);
53a0: e287401c add r4, r7, #28 <== NOT EXECUTED
53a4: e1a00004 mov r0, r4 <== NOT EXECUTED
53a8: eb000363 bl 613c <pthread_mutex_lock> <== NOT EXECUTED
result = rtems_aio_remove_req (&r_chain->next_fd, aiocbp);
53ac: e1a01005 mov r1, r5 <== NOT EXECUTED
53b0: e2870008 add r0, r7, #8 <== NOT EXECUTED
53b4: eb00011c bl 582c <rtems_aio_remove_req> <== NOT EXECUTED
53b8: e1a05000 mov r5, r0 <== NOT EXECUTED
pthread_mutex_unlock (&r_chain->mutex);
53bc: e1a00004 mov r0, r4 <== NOT EXECUTED
53c0: eb00037c bl 61b8 <pthread_mutex_unlock> <== NOT EXECUTED
pthread_mutex_unlock (&aio_request_queue.mutex);
53c4: e59f0008 ldr r0, [pc, #8] ; 53d4 <aio_cancel+0x1b0> <== NOT EXECUTED
53c8: eb00037a bl 61b8 <pthread_mutex_unlock> <== NOT EXECUTED
return result;
}
return AIO_ALLDONE;
}
53cc: e1a00005 mov r0, r5
53d0: e8bd80f0 pop {r4, r5, r6, r7, pc}
00005a74 <aio_read>:
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
5a74: e92d4030 push {r4, r5, lr}
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
5a78: e3a01003 mov r1, #3
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
5a7c: e1a04000 mov r4, r0
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
5a80: e5900000 ldr r0, [r0]
5a84: eb001756 bl b7e4 <fcntl>
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
5a88: e2000003 and r0, r0, #3
5a8c: e3500002 cmp r0, #2
5a90: 13500000 cmpne r0, #0
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
5a94: 13a05009 movne r5, #9
{
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
5a98: 1a00000d bne 5ad4 <aio_read+0x60>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
5a9c: e5943014 ldr r3, [r4, #20]
5aa0: e3530000 cmp r3, #0
5aa4: 1a000007 bne 5ac8 <aio_read+0x54>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
5aa8: e5943008 ldr r3, [r4, #8]
5aac: e3530000 cmp r3, #0
5ab0: ba000004 blt 5ac8 <aio_read+0x54>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
5ab4: e3a00018 mov r0, #24
5ab8: ebfff388 bl 28e0 <malloc>
if (req == NULL)
5abc: e2503000 subs r3, r0, #0
5ac0: 1a00000a bne 5af0 <aio_read+0x7c>
5ac4: ea000001 b 5ad0 <aio_read+0x5c> <== NOT EXECUTED
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
5ac8: e3a05016 mov r5, #22 <== NOT EXECUTED
5acc: ea000000 b 5ad4 <aio_read+0x60> <== NOT EXECUTED
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
5ad0: e3a0500b mov r5, #11 <== NOT EXECUTED
5ad4: e3e03000 mvn r3, #0
5ad8: e5845030 str r5, [r4, #48] ; 0x30
5adc: e5843034 str r3, [r4, #52] ; 0x34
5ae0: eb002509 bl ef0c <__errno>
5ae4: e5805000 str r5, [r0]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
}
5ae8: e3e00000 mvn r0, #0
5aec: e8bd8030 pop {r4, r5, pc}
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
5af0: e5834014 str r4, [r3, #20]
req->aiocbp->aio_lio_opcode = LIO_READ;
5af4: e3a03001 mov r3, #1
5af8: e584302c str r3, [r4, #44] ; 0x2c
return rtems_aio_enqueue (req);
}
5afc: e8bd4030 pop {r4, r5, lr}
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
5b00: eaffff5b b 5874 <rtems_aio_enqueue>
00005a8c <aio_write>:
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
5a8c: e92d4030 push {r4, r5, lr}
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
5a90: e3a01003 mov r1, #3
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
5a94: e1a04000 mov r4, r0
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
5a98: e5900000 ldr r0, [r0]
5a9c: eb001754 bl b7f4 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
5aa0: e2000003 and r0, r0, #3
5aa4: e2400001 sub r0, r0, #1
5aa8: e3500001 cmp r0, #1
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
5aac: 83a05009 movhi r5, #9
{
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
5ab0: 8a00000d bhi 5aec <aio_write+0x60>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
5ab4: e5943014 ldr r3, [r4, #20]
5ab8: e3530000 cmp r3, #0
5abc: 1a000007 bne 5ae0 <aio_write+0x54>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
5ac0: e5943008 ldr r3, [r4, #8]
5ac4: e3530000 cmp r3, #0
5ac8: ba000004 blt 5ae0 <aio_write+0x54>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
5acc: e3a00018 mov r0, #24
5ad0: ebfff386 bl 28f0 <malloc>
if (req == NULL)
5ad4: e2503000 subs r3, r0, #0
5ad8: 1a00000a bne 5b08 <aio_write+0x7c>
5adc: ea000001 b 5ae8 <aio_write+0x5c> <== NOT EXECUTED
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
5ae0: e3a05016 mov r5, #22 <== NOT EXECUTED
5ae4: ea000000 b 5aec <aio_write+0x60> <== NOT EXECUTED
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
5ae8: e3a0500b mov r5, #11 <== NOT EXECUTED
5aec: e3e03000 mvn r3, #0
5af0: e5845030 str r5, [r4, #48] ; 0x30
5af4: e5843034 str r3, [r4, #52] ; 0x34
5af8: eb002507 bl ef1c <__errno>
5afc: e5805000 str r5, [r0]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
}
5b00: e3e00000 mvn r0, #0
5b04: e8bd8030 pop {r4, r5, pc}
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
5b08: e5834014 str r4, [r3, #20]
req->aiocbp->aio_lio_opcode = LIO_WRITE;
5b0c: e3a03002 mov r3, #2
5b10: e584302c str r3, [r4, #44] ; 0x2c
return rtems_aio_enqueue (req);
}
5b14: e8bd4030 pop {r4, r5, lr}
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
5b18: eaffff59 b 5884 <rtems_aio_enqueue>
00008520 <devFS_evaluate_path>:
const char *pathname,
size_t pathnamelen,
int flags,
rtems_filesystem_location_info_t *pathloc
)
{
8520: 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 ) )
8524: e3d27007 bics r7, r2, #7
const char *pathname,
size_t pathnamelen,
int flags,
rtems_filesystem_location_info_t *pathloc
)
{
8528: e1a09000 mov r9, r0
852c: e1a04001 mov r4, r1
8530: 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 ) )
8534: 0a000002 beq 8544 <devFS_evaluate_path+0x24>
rtems_set_errno_and_return_minus_one( EPERM );
8538: eb000984 bl ab50 <__errno> <== NOT EXECUTED
853c: e3a03001 mov r3, #1 <== NOT EXECUTED
8540: ea000005 b 855c <devFS_evaluate_path+0x3c> <== NOT EXECUTED
/* get the device name table */
device_name_table = (rtems_device_name_t *)pathloc->node_access;
8544: e5936000 ldr r6, [r3]
if (!device_name_table)
8548: e3560000 cmp r6, #0
rtems_set_errno_and_return_minus_one( EFAULT );
for (i = 0; i < rtems_device_table_size; i++) {
854c: 159fa094 ldrne sl, [pc, #148] ; 85e8 <devFS_evaluate_path+0xc8>
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)
8550: 1a00001c bne 85c8 <devFS_evaluate_path+0xa8>
rtems_set_errno_and_return_minus_one( EFAULT );
8554: eb00097d bl ab50 <__errno>
8558: e3a0300e mov r3, #14
855c: e5803000 str r3, [r0]
8560: e3e00000 mvn r0, #0
8564: 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)
8568: e5968000 ldr r8, [r6]
856c: e3580000 cmp r8, #0
8570: 0a000012 beq 85c0 <devFS_evaluate_path+0xa0>
continue;
if (strncmp(pathname, device_name_table[i].device_name, pathnamelen) != 0)
8574: e1a00009 mov r0, r9
8578: e1a01008 mov r1, r8
857c: e1a02004 mov r2, r4
8580: eb000cf9 bl b96c <strncmp>
8584: e3500000 cmp r0, #0
8588: 1a00000c bne 85c0 <devFS_evaluate_path+0xa0>
continue;
if (device_name_table[i].device_name[pathnamelen] != '\0')
858c: e7d80004 ldrb r0, [r8, r4]
8590: e3500000 cmp r0, #0
8594: 1a000009 bne 85c0 <devFS_evaluate_path+0xa0>
continue;
/* find the device, set proper values */
pathloc->node_access = (void *)&device_name_table[i];
pathloc->handlers = &devFS_file_handlers;
8598: e59f304c ldr r3, [pc, #76] ; 85ec <devFS_evaluate_path+0xcc>
859c: e5853008 str r3, [r5, #8]
pathloc->ops = &devFS_ops;
85a0: e59f3048 ldr r3, [pc, #72] ; 85f0 <devFS_evaluate_path+0xd0>
85a4: e585300c str r3, [r5, #12]
pathloc->mt_entry = rtems_filesystem_root.mt_entry;
85a8: e59f3044 ldr r3, [pc, #68] ; 85f4 <devFS_evaluate_path+0xd4>
85ac: e5933000 ldr r3, [r3]
85b0: 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];
85b4: e5856000 str r6, [r5]
pathloc->handlers = &devFS_file_handlers;
pathloc->ops = &devFS_ops;
pathloc->mt_entry = rtems_filesystem_root.mt_entry;
85b8: e5853010 str r3, [r5, #16]
return 0;
85bc: 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++) {
85c0: e2877001 add r7, r7, #1
85c4: e2866014 add r6, r6, #20
85c8: e59a3000 ldr r3, [sl]
85cc: e1570003 cmp r7, r3
85d0: 3affffe4 bcc 8568 <devFS_evaluate_path+0x48>
pathloc->mt_entry = rtems_filesystem_root.mt_entry;
return 0;
}
/* no such file or directory */
rtems_set_errno_and_return_minus_one( ENOENT );
85d4: eb00095d bl ab50 <__errno>
85d8: e3a03002 mov r3, #2
85dc: e5803000 str r3, [r0]
85e0: e3e00000 mvn r0, #0
}
85e4: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
00002b10 <drainOutput>:
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 <arm_interrupt_disable>
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 <drainOutput+0x44>
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 <rtems_semaphore_obtain> <== 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: 1b000a61 blne 54d8 <rtems_fatal_error_occurred> <== NOT EXECUTED
rtems_interrupt_disable (level);
2b50: ebffffea bl 2b00 <arm_interrupt_disable> <== 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 <drainOutput+0x20>
2b64: e129f000 msr CPSR_fc, r0
2b68: e8bd8030 pop {r4, r5, pc}
000037f0 <erase>:
* 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 <erase+0x1a4>
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 <erase+0x1a4>
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 <echo> <== 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 <erase+0x8c> <== 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 <erase+0x198>
if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) {
3868: e3570000 cmp r7, #0
386c: 1a000005 bne 3888 <erase+0x98>
3870: e3130010 tst r3, #16
3874: 1a000003 bne 3888 <erase+0x98>
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 <echo> <== NOT EXECUTED
} else if (c == '\t') {
3888: e3550009 cmp r5, #9
388c: 1a00001f bne 3910 <erase+0x120>
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 <erase+0xe8>
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 <erase+0xe4>
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 <erase+0xe4>
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 <erase+0xe8> <== 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 <erase+0xb4>
38e0: ea000006 b 3900 <erase+0x110>
/*
* Back up over the tab
*/
while (tty->column > col) {
rtems_termios_puts ("\b", 1, tty);
38e4: e59f00bc ldr r0, [pc, #188] ; 39a8 <erase+0x1b8>
38e8: e3a01001 mov r1, #1
38ec: e1a02004 mov r2, r4
38f0: ebffff07 bl 3514 <rtems_termios_puts>
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 <erase+0xf4>
390c: ea00001d b 3988 <erase+0x198>
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 <erase+0x15c>
3924: e3130c02 tst r3, #512 ; 0x200 <== NOT EXECUTED
3928: 0a000007 beq 394c <erase+0x15c> <== NOT EXECUTED
rtems_termios_puts ("\b \b", 3, tty);
392c: e59f0078 ldr r0, [pc, #120] ; 39ac <erase+0x1bc> <== NOT EXECUTED
3930: e3a01003 mov r1, #3 <== NOT EXECUTED
3934: e1a02004 mov r2, r4 <== NOT EXECUTED
3938: ebfffef5 bl 3514 <rtems_termios_puts> <== 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 <erase+0x178>
395c: e594303c ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED
3960: e3130c02 tst r3, #512 ; 0x200 <== NOT EXECUTED
3964: 0a000007 beq 3988 <erase+0x198> <== NOT EXECUTED
rtems_termios_puts ("\b \b", 3, tty);
3968: e59f003c ldr r0, [pc, #60] ; 39ac <erase+0x1bc>
396c: e3a01003 mov r1, #3
3970: e1a02004 mov r2, r4
3974: ebfffee6 bl 3514 <rtems_termios_puts>
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 <erase+0x1a8>
3990: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
3994: e59f6014 ldr r6, [pc, #20] ; 39b0 <erase+0x1c0>
echo ('\n', tty);
return;
}
}
while (tty->ccount) {
3998: e5941020 ldr r1, [r4, #32]
399c: e3510000 cmp r1, #0
39a0: 1affffa9 bne 384c <erase+0x5c>
39a4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
000025ac <fcntl>:
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 <fcntl+0x1b4>
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 <fcntl+0x40>
iop = rtems_libio_iop( fd );
25d0: e59f218c ldr r2, [pc, #396] ; 2764 <fcntl+0x1b8>
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 <fcntl+0x4c>
25ec: eb002ccc bl d924 <__errno>
25f0: e3a03009 mov r3, #9
25f4: ea000047 b 2718 <fcntl+0x16c>
/*
* 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 <fcntl+0x164>
2604: 0000262c .word 0x0000262c <== NOT EXECUTED
2608: 0000269c .word 0x0000269c <== NOT EXECUTED
260c: 000026ac .word 0x000026ac <== NOT EXECUTED
2610: 000026cc .word 0x000026cc <== NOT EXECUTED
2614: 000026d8 .word 0x000026d8 <== NOT EXECUTED
2618: 00002704 .word 0x00002704 <== NOT EXECUTED
261c: 00002704 .word 0x00002704 <== NOT EXECUTED
2620: 00002704 .word 0x00002704 <== NOT EXECUTED
2624: 00002704 .word 0x00002704 <== NOT EXECUTED
2628: 00002704 .word 0x00002704 <== NOT EXECUTED
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 <fcntl+0xa0>
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 <fcntl+0xb4>
2648: ea000003 b 265c <fcntl+0xb0> <== NOT EXECUTED
else {
/* allocate a file control block */
diop = rtems_libio_allocate();
264c: eb000190 bl 2c94 <rtems_libio_allocate>
if ( diop == 0 ) {
2650: e2506000 subs r6, r0, #0
2654: 1a000001 bne 2660 <fcntl+0xb4>
2658: ea00003b b 274c <fcntl+0x1a0> <== 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 <fcntl+0x1b8>
2684: e5933000 ldr r3, [r3]
2688: e0636006 rsb r6, r3, r6
268c: e59f30d4 ldr r3, [pc, #212] ; 2768 <fcntl+0x1bc>
2690: e1a061c6 asr r6, r6, #3
2694: e0060693 mul r6, r3, r6
2698: ea000020 b 2720 <fcntl+0x174>
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 <fcntl+0x17c>
* 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 <fcntl+0x17c>
26c8: ea00000b b 26fc <fcntl+0x150>
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 <rtems_libio_to_fcntl_flags>
26d0: e1a06000 mov r6, r0
26d4: ea000011 b 2720 <fcntl+0x174>
break;
case F_SETFL:
flags = rtems_libio_fcntl_flags( va_arg( ap, int ) );
26d8: e5930000 ldr r0, [r3]
26dc: eb00014d bl 2c18 <rtems_libio_fcntl_flags>
/*
* 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 <fcntl+0x1c0>
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 <fcntl+0x17c>
errno = ENOTSUP;
ret = -1;
break;
case F_GETOWN: /* for sockets. */
errno = ENOTSUP;
2704: eb002c86 bl d924 <__errno>
2708: e3a03086 mov r3, #134 ; 0x86
270c: ea000001 b 2718 <fcntl+0x16c>
ret = -1;
break;
default:
errno = EINVAL;
2710: eb002c83 bl d924 <__errno>
2714: e3a03016 mov r3, #22
2718: e5803000 str r3, [r0]
271c: ea00000a b 274c <fcntl+0x1a0>
/*
* 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 <fcntl+0x1a4>
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 <fcntl+0x1a4>
errno = err;
2744: eb002c76 bl d924 <__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
0000b2d4 <fifo_open>:
*/
int fifo_open(
pipe_control_t **pipep,
rtems_libio_t *iop
)
{
b2d4: e92d45f7 push {r0, r1, r2, r4, r5, r6, r7, r8, sl, lr}
static rtems_status_code pipe_lock(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (pipe_semaphore == RTEMS_ID_NONE) {
b2d8: e59f53bc ldr r5, [pc, #956] ; b69c <fifo_open+0x3c8>
b2dc: e5954000 ldr r4, [r5]
b2e0: e3540000 cmp r4, #0
*/
int fifo_open(
pipe_control_t **pipep,
rtems_libio_t *iop
)
{
b2e4: e1a08000 mov r8, r0
b2e8: e1a07001 mov r7, r1
static rtems_status_code pipe_lock(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (pipe_semaphore == RTEMS_ID_NONE) {
b2ec: 1a000012 bne b33c <fifo_open+0x68>
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 );
b2f0: e59f33a8 ldr r3, [pc, #936] ; b6a0 <fifo_open+0x3cc>
b2f4: e1a01004 mov r1, r4
b2f8: e5930000 ldr r0, [r3]
b2fc: e1a02004 mov r2, r4
b300: ebffeee6 bl 6ea0 <rtems_semaphore_obtain>
rtems_libio_lock();
if (pipe_semaphore == RTEMS_ID_NONE) {
b304: e5953000 ldr r3, [r5]
b308: e3530000 cmp r3, #0
b30c: 1a000005 bne b328 <fifo_open+0x54>
sc = rtems_semaphore_create(
b310: e59f038c ldr r0, [pc, #908] ; b6a4 <fifo_open+0x3d0>
b314: e3a01001 mov r1, #1
b318: e3a02054 mov r2, #84 ; 0x54
b31c: e58d5000 str r5, [sp]
b320: ebffee4c bl 6c58 <rtems_semaphore_create>
b324: e1a04000 mov r4, r0
}
static inline void rtems_libio_unlock( void )
{
rtems_semaphore_release( rtems_libio_semaphore );
b328: e59f3370 ldr r3, [pc, #880] ; b6a0 <fifo_open+0x3cc>
b32c: e5930000 ldr r0, [r3]
b330: ebffef20 bl 6fb8 <rtems_semaphore_release>
}
rtems_libio_unlock();
}
if (sc == RTEMS_SUCCESSFUL) {
b334: e3540000 cmp r4, #0
b338: 1a000006 bne b358 <fifo_open+0x84>
sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
b33c: e59f3358 ldr r3, [pc, #856] ; b69c <fifo_open+0x3c8>
b340: e3a01000 mov r1, #0
b344: e5930000 ldr r0, [r3]
b348: e1a02001 mov r2, r1
b34c: ebffeed3 bl 6ea0 <rtems_semaphore_obtain>
}
if (sc == RTEMS_SUCCESSFUL) {
b350: e2505000 subs r5, r0, #0
b354: 0a000000 beq b35c <fifo_open+0x88>
return 0;
} else {
return -ENOMEM;
b358: e3e0500b mvn r5, #11
{
pipe_control_t *pipe;
int err = 0;
err = pipe_lock();
if (err)
b35c: e2556000 subs r6, r5, #0
b360: 1a0000cb bne b694 <fifo_open+0x3c0>
return err;
pipe = *pipep;
b364: e5984000 ldr r4, [r8]
if (pipe == NULL) {
b368: e3540000 cmp r4, #0
b36c: 1a00004d bne b4a8 <fifo_open+0x1d4>
{
static char c = 'a';
pipe_control_t *pipe;
int err = -ENOMEM;
pipe = malloc(sizeof(pipe_control_t));
b370: e3a00034 mov r0, #52 ; 0x34
b374: ebffe2e8 bl 3f1c <malloc>
if (pipe == NULL)
b378: e250a000 subs sl, r0, #0
{
static char c = 'a';
pipe_control_t *pipe;
int err = -ENOMEM;
pipe = malloc(sizeof(pipe_control_t));
b37c: e1a04000 mov r4, r0
if (pipe == NULL)
b380: 0a000046 beq b4a0 <fifo_open+0x1cc>
return err;
memset(pipe, 0, sizeof(pipe_control_t));
b384: e1a01005 mov r1, r5
b388: e3a02034 mov r2, #52 ; 0x34
b38c: eb00126f bl fd50 <memset>
pipe->Size = PIPE_BUF;
b390: e3a00c02 mov r0, #512 ; 0x200
b394: e5840004 str r0, [r4, #4]
pipe->Buffer = malloc(pipe->Size);
b398: ebffe2df bl 3f1c <malloc>
if (! pipe->Buffer)
b39c: 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);
b3a0: e5840000 str r0, [r4]
if (! pipe->Buffer)
b3a4: 0a00003b beq b498 <fifo_open+0x1c4>
goto err_buf;
err = -ENOMEM;
if (rtems_barrier_create(
rtems_build_name ('P', 'I', 'r', c),
b3a8: e59f62f8 ldr r6, [pc, #760] ; b6a8 <fifo_open+0x3d4>
if (! pipe->Buffer)
goto err_buf;
err = -ENOMEM;
if (rtems_barrier_create(
b3ac: e59f02f8 ldr r0, [pc, #760] ; b6ac <fifo_open+0x3d8>
rtems_build_name ('P', 'I', 'r', c),
b3b0: e5d63000 ldrb r3, [r6]
if (! pipe->Buffer)
goto err_buf;
err = -ENOMEM;
if (rtems_barrier_create(
b3b4: e1a01005 mov r1, r5
b3b8: e1830000 orr r0, r3, r0
b3bc: e1a02005 mov r2, r5
b3c0: e284302c add r3, r4, #44 ; 0x2c
b3c4: eb00061c bl cc3c <rtems_barrier_create>
b3c8: e3500000 cmp r0, #0
b3cc: 1a00002f bne b490 <fifo_open+0x1bc>
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),
b3d0: 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(
b3d4: e59f02d4 ldr r0, [pc, #724] ; b6b0 <fifo_open+0x3dc>
b3d8: e1a01005 mov r1, r5
b3dc: e1830000 orr r0, r3, r0
b3e0: e1a02005 mov r2, r5
b3e4: e2843030 add r3, r4, #48 ; 0x30
b3e8: eb000613 bl cc3c <rtems_barrier_create>
b3ec: e3500000 cmp r0, #0
b3f0: 1a000024 bne b488 <fifo_open+0x1b4>
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,
b3f4: 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(
b3f8: e59f02b4 ldr r0, [pc, #692] ; b6b4 <fifo_open+0x3e0>
b3fc: e2842028 add r2, r4, #40 ; 0x28
b400: e58d2000 str r2, [sp]
b404: e1830000 orr r0, r3, r0
b408: e3a01001 mov r1, #1
b40c: e3a02010 mov r2, #16
b410: e1a03005 mov r3, r5
b414: ebffee0f bl 6c58 <rtems_semaphore_create>
b418: e3500000 cmp r0, #0
b41c: 1a000017 bne b480 <fifo_open+0x1ac>
/* Set barriers to be interruptible by signals. */
static void pipe_interruptible(pipe_control_t *pipe)
{
Objects_Locations location;
_Barrier_Get(pipe->readBarrier, &location)->Barrier.Wait_queue.state
b420: e28d5004 add r5, sp, #4
Objects_Id id,
Objects_Locations *location
)
{
return (Barrier_Control *)
_Objects_Get( &_Barrier_Information, id, location );
b424: e594102c ldr r1, [r4, #44] ; 0x2c
b428: e1a02005 mov r2, r5
b42c: e59f0284 ldr r0, [pc, #644] ; b6b8 <fifo_open+0x3e4>
b430: ebfff446 bl 8550 <_Objects_Get>
|= STATES_INTERRUPTIBLE_BY_SIGNAL;
b434: e590304c ldr r3, [r0, #76] ; 0x4c
b438: e3833201 orr r3, r3, #268435456 ; 0x10000000
b43c: e580304c str r3, [r0, #76] ; 0x4c
_Thread_Enable_dispatch();
b440: ebfff656 bl 8da0 <_Thread_Enable_dispatch>
b444: e1a02005 mov r2, r5
b448: e5941030 ldr r1, [r4, #48] ; 0x30
b44c: e59f0264 ldr r0, [pc, #612] ; b6b8 <fifo_open+0x3e4>
b450: ebfff43e bl 8550 <_Objects_Get>
_Barrier_Get(pipe->writeBarrier, &location)->Barrier.Wait_queue.state
|= STATES_INTERRUPTIBLE_BY_SIGNAL;
b454: e590304c ldr r3, [r0, #76] ; 0x4c
b458: e3833201 orr r3, r3, #268435456 ; 0x10000000
b45c: e580304c str r3, [r0, #76] ; 0x4c
_Thread_Enable_dispatch();
b460: ebfff64e bl 8da0 <_Thread_Enable_dispatch>
#ifdef RTEMS_POSIX_API
pipe_interruptible(pipe);
#endif
*pipep = pipe;
if (c ++ == 'z')
b464: e5d63000 ldrb r3, [r6]
b468: e353007a cmp r3, #122 ; 0x7a
b46c: e2832001 add r2, r3, #1
c = 'a';
b470: 03a03061 moveq r3, #97 ; 0x61
#ifdef RTEMS_POSIX_API
pipe_interruptible(pipe);
#endif
*pipep = pipe;
if (c ++ == 'z')
b474: e5c62000 strb r2, [r6]
c = 'a';
b478: 05c63000 strbeq r3, [r6]
b47c: ea000009 b b4a8 <fifo_open+0x1d4>
return 0;
err_sem:
rtems_barrier_delete(pipe->writeBarrier);
b480: e59a0030 ldr r0, [sl, #48] ; 0x30
b484: eb00061c bl ccfc <rtems_barrier_delete>
err_wbar:
rtems_barrier_delete(pipe->readBarrier);
b488: e59a002c ldr r0, [sl, #44] ; 0x2c
b48c: eb00061a bl ccfc <rtems_barrier_delete>
err_rbar:
free(pipe->Buffer);
b490: e59a0000 ldr r0, [sl]
b494: ebffe0c3 bl 37a8 <free>
err_buf:
free(pipe);
b498: e1a0000a mov r0, sl
b49c: ebffe0c1 bl 37a8 <free>
if (err)
goto out;
}
if (! PIPE_LOCK(pipe))
err = -EINTR;
b4a0: e3e0600b mvn r6, #11
b4a4: ea00000d b b4e0 <fifo_open+0x20c>
err = pipe_alloc(&pipe);
if (err)
goto out;
}
if (! PIPE_LOCK(pipe))
b4a8: e3a01000 mov r1, #0
b4ac: e5940028 ldr r0, [r4, #40] ; 0x28
b4b0: e1a02001 mov r2, r1
b4b4: ebffee79 bl 6ea0 <rtems_semaphore_obtain>
err = -EINTR;
if (*pipep == NULL) {
b4b8: e5983000 ldr r3, [r8]
if (err)
goto out;
}
if (! PIPE_LOCK(pipe))
err = -EINTR;
b4bc: e3500000 cmp r0, #0
b4c0: 03a06000 moveq r6, #0
b4c4: 13e06003 mvnne r6, #3
if (*pipep == NULL) {
b4c8: e3530000 cmp r3, #0
b4cc: 1a000003 bne b4e0 <fifo_open+0x20c>
if (err)
b4d0: e3560000 cmp r6, #0
pipe_free(pipe);
else
*pipep = pipe;
b4d4: 05884000 streq r4, [r8]
if (! PIPE_LOCK(pipe))
err = -EINTR;
if (*pipep == NULL) {
if (err)
pipe_free(pipe);
b4d8: 11a00004 movne r0, r4
b4dc: 1bffff43 blne b1f0 <pipe_free>
else
*pipep = pipe;
}
out:
pipe_unlock();
b4e0: ebffff3e bl b1e0 <pipe_unlock>
pipe_control_t *pipe;
unsigned int prevCounter;
int err;
err = pipe_new(pipep);
if (err)
b4e4: e3560000 cmp r6, #0
b4e8: 1a000069 bne b694 <fifo_open+0x3c0>
return err;
pipe = *pipep;
switch (LIBIO_ACCMODE(iop)) {
b4ec: e5973014 ldr r3, [r7, #20]
b4f0: e2033006 and r3, r3, #6
b4f4: e3530004 cmp r3, #4
int err;
err = pipe_new(pipep);
if (err)
return err;
pipe = *pipep;
b4f8: e5984000 ldr r4, [r8]
switch (LIBIO_ACCMODE(iop)) {
b4fc: 0a000024 beq b594 <fifo_open+0x2c0>
b500: e3530006 cmp r3, #6
b504: 0a000047 beq b628 <fifo_open+0x354>
b508: e3530002 cmp r3, #2
b50c: 1a000059 bne b678 <fifo_open+0x3a4>
case LIBIO_FLAGS_READ:
pipe->readerCounter ++;
b510: e5943020 ldr r3, [r4, #32]
b514: e2833001 add r3, r3, #1
b518: e5843020 str r3, [r4, #32]
if (pipe->Readers ++ == 0)
b51c: e5943010 ldr r3, [r4, #16]
b520: e2832001 add r2, r3, #1
b524: e3530000 cmp r3, #0
b528: e5842010 str r2, [r4, #16]
PIPE_WAKEUPWRITERS(pipe);
b52c: 05940030 ldreq r0, [r4, #48] ; 0x30
b530: 028d1008 addeq r1, sp, #8
b534: 0b000618 bleq cd9c <rtems_barrier_release>
if (pipe->Writers == 0) {
b538: e5943014 ldr r3, [r4, #20]
b53c: e3530000 cmp r3, #0
b540: 1a00004c bne b678 <fifo_open+0x3a4>
/* Not an error */
if (LIBIO_NODELAY(iop))
b544: e5973014 ldr r3, [r7, #20]
b548: e3130001 tst r3, #1
b54c: 1a000049 bne b678 <fifo_open+0x3a4>
break;
prevCounter = pipe->writerCounter;
b550: e5945024 ldr r5, [r4, #36] ; 0x24
err = -EINTR;
/* Wait until a writer opens the pipe */
do {
PIPE_UNLOCK(pipe);
b554: e5940028 ldr r0, [r4, #40] ; 0x28
b558: ebffee96 bl 6fb8 <rtems_semaphore_release>
if (! PIPE_READWAIT(pipe))
b55c: e3a01000 mov r1, #0
b560: e594002c ldr r0, [r4, #44] ; 0x2c
b564: eb000622 bl cdf4 <rtems_barrier_wait>
b568: e2501000 subs r1, r0, #0
b56c: 1a000044 bne b684 <fifo_open+0x3b0>
goto out_error;
if (! PIPE_LOCK(pipe))
b570: e5940028 ldr r0, [r4, #40] ; 0x28
b574: e1a02001 mov r2, r1
b578: ebffee48 bl 6ea0 <rtems_semaphore_obtain>
b57c: e3500000 cmp r0, #0
b580: 1a00003f bne b684 <fifo_open+0x3b0>
goto out_error;
} while (prevCounter == pipe->writerCounter);
b584: e5943024 ldr r3, [r4, #36] ; 0x24
b588: e1550003 cmp r5, r3
b58c: 0afffff0 beq b554 <fifo_open+0x280>
b590: ea000038 b b678 <fifo_open+0x3a4>
}
break;
case LIBIO_FLAGS_WRITE:
pipe->writerCounter ++;
b594: e5943024 ldr r3, [r4, #36] ; 0x24
b598: e2833001 add r3, r3, #1
b59c: e5843024 str r3, [r4, #36] ; 0x24
if (pipe->Writers ++ == 0)
b5a0: e5943014 ldr r3, [r4, #20]
b5a4: e2832001 add r2, r3, #1
b5a8: e3530000 cmp r3, #0
b5ac: e5842014 str r2, [r4, #20]
PIPE_WAKEUPREADERS(pipe);
b5b0: 0594002c ldreq r0, [r4, #44] ; 0x2c
b5b4: 028d1008 addeq r1, sp, #8
b5b8: 0b0005f7 bleq cd9c <rtems_barrier_release>
if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) {
b5bc: e5943010 ldr r3, [r4, #16]
b5c0: e3530000 cmp r3, #0
b5c4: 1a00002b bne b678 <fifo_open+0x3a4>
b5c8: e5973014 ldr r3, [r7, #20]
b5cc: e3130001 tst r3, #1
err = -ENXIO;
goto out_error;
}
if (pipe->Readers == 0) {
prevCounter = pipe->readerCounter;
b5d0: 05945020 ldreq r5, [r4, #32]
pipe->writerCounter ++;
if (pipe->Writers ++ == 0)
PIPE_WAKEUPREADERS(pipe);
if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) {
b5d4: 0a000003 beq b5e8 <fifo_open+0x314>
PIPE_UNLOCK(pipe);
b5d8: e5940028 ldr r0, [r4, #40] ; 0x28
b5dc: ebffee75 bl 6fb8 <rtems_semaphore_release>
err = -ENXIO;
b5e0: e3e06005 mvn r6, #5
goto out_error;
b5e4: ea000027 b b688 <fifo_open+0x3b4>
if (pipe->Readers == 0) {
prevCounter = pipe->readerCounter;
err = -EINTR;
do {
PIPE_UNLOCK(pipe);
b5e8: e5940028 ldr r0, [r4, #40] ; 0x28
b5ec: ebffee71 bl 6fb8 <rtems_semaphore_release>
if (! PIPE_WRITEWAIT(pipe))
b5f0: e3a01000 mov r1, #0
b5f4: e5940030 ldr r0, [r4, #48] ; 0x30
b5f8: eb0005fd bl cdf4 <rtems_barrier_wait>
b5fc: e2501000 subs r1, r0, #0
b600: 1a00001f bne b684 <fifo_open+0x3b0>
goto out_error;
if (! PIPE_LOCK(pipe))
b604: e5940028 ldr r0, [r4, #40] ; 0x28
b608: e1a02001 mov r2, r1
b60c: ebffee23 bl 6ea0 <rtems_semaphore_obtain>
b610: e3500000 cmp r0, #0
b614: 1a00001a bne b684 <fifo_open+0x3b0>
goto out_error;
} while (prevCounter == pipe->readerCounter);
b618: e5943020 ldr r3, [r4, #32]
b61c: e1550003 cmp r5, r3
b620: 0afffff0 beq b5e8 <fifo_open+0x314>
b624: ea000013 b b678 <fifo_open+0x3a4>
}
break;
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
b628: e5943020 ldr r3, [r4, #32]
b62c: e2833001 add r3, r3, #1
b630: e5843020 str r3, [r4, #32]
if (pipe->Readers ++ == 0)
b634: e5943010 ldr r3, [r4, #16]
b638: e2832001 add r2, r3, #1
b63c: e3530000 cmp r3, #0
b640: e5842010 str r2, [r4, #16]
PIPE_WAKEUPWRITERS(pipe);
b644: 05940030 ldreq r0, [r4, #48] ; 0x30
b648: 028d1008 addeq r1, sp, #8
b64c: 0b0005d2 bleq cd9c <rtems_barrier_release>
pipe->writerCounter ++;
b650: e5943024 ldr r3, [r4, #36] ; 0x24
b654: e2833001 add r3, r3, #1
b658: e5843024 str r3, [r4, #36] ; 0x24
if (pipe->Writers ++ == 0)
b65c: e5943014 ldr r3, [r4, #20]
b660: e2832001 add r2, r3, #1
b664: e3530000 cmp r3, #0
b668: e5842014 str r2, [r4, #20]
PIPE_WAKEUPREADERS(pipe);
b66c: 0594002c ldreq r0, [r4, #44] ; 0x2c
b670: 028d1008 addeq r1, sp, #8
b674: 0b0005c8 bleq cd9c <rtems_barrier_release>
break;
}
PIPE_UNLOCK(pipe);
b678: e5940028 ldr r0, [r4, #40] ; 0x28
b67c: ebffee4d bl 6fb8 <rtems_semaphore_release>
return 0;
b680: ea000003 b b694 <fifo_open+0x3c0>
goto out_error;
}
if (pipe->Readers == 0) {
prevCounter = pipe->readerCounter;
err = -EINTR;
b684: e3e06003 mvn r6, #3 <== NOT EXECUTED
PIPE_UNLOCK(pipe);
return 0;
out_error:
pipe_release(pipep, iop);
b688: e1a00008 mov r0, r8
b68c: e1a01007 mov r1, r7
b690: ebfffee3 bl b224 <pipe_release>
return err;
}
b694: e1a00006 mov r0, r6
b698: e8bd85fe pop {r1, r2, r3, r4, r5, r6, r7, r8, sl, pc}
000027f0 <fpathconf>:
{
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 <fpathconf+0x10c>
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 <fpathconf+0x30>
iop = rtems_libio_iop(fd);
2804: e59f30f4 ldr r3, [pc, #244] ; 2900 <fpathconf+0x110>
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 <fpathconf+0x3c>
2820: eb002c3f bl d924 <__errno>
2824: e3a03009 mov r3, #9
2828: ea000003 b 283c <fpathconf+0x4c>
rtems_libio_check_permissions(iop, LIBIO_FLAGS_READ);
282c: e3130002 tst r3, #2
2830: 1a000004 bne 2848 <fpathconf+0x58>
2834: eb002c3a bl d924 <__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 <fpathconf+0xf8>
2858: 00002888 .word 0x00002888 <== NOT EXECUTED
285c: 00002890 .word 0x00002890 <== NOT EXECUTED
2860: 00002898 .word 0x00002898 <== NOT EXECUTED
2864: 000028a0 .word 0x000028a0 <== NOT EXECUTED
2868: 000028a8 .word 0x000028a8 <== NOT EXECUTED
286c: 000028b0 .word 0x000028b0 <== NOT EXECUTED
2870: 000028b8 .word 0x000028b8 <== NOT EXECUTED
2874: 000028c0 .word 0x000028c0 <== NOT EXECUTED
2878: 000028c8 .word 0x000028c8 <== NOT EXECUTED
287c: 000028d0 .word 0x000028d0 <== NOT EXECUTED
2880: 000028d8 .word 0x000028d8 <== NOT EXECUTED
2884: 000028e0 .word 0x000028e0 <== NOT EXECUTED
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: eb002c0d bl d924 <__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)
0000bd4c <imfs_dir_open>:
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 )
bd4c: e5903018 ldr r3, [r0, #24]
bd50: e593304c ldr r3, [r3, #76] ; 0x4c
bd54: e3530001 cmp r3, #1
rtems_libio_t *iop,
const char *pathname,
uint32_t flag,
uint32_t mode
)
{
bd58: 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 )
bd5c: 1a000005 bne bd78 <imfs_dir_open+0x2c>
return -1; /* It wasn't a directory --> return error */
iop->offset = 0;
bd60: e3a03000 mov r3, #0
bd64: e3a04000 mov r4, #0
bd68: e580300c str r3, [r0, #12]
bd6c: e5804010 str r4, [r0, #16]
return 0;
bd70: e3a00000 mov r0, #0
bd74: 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 */
bd78: e3e00000 mvn r0, #0 <== NOT EXECUTED
iop->offset = 0;
return 0;
}
bd7c: e8bd8010 pop {r4, pc} <== NOT EXECUTED
000039b4 <iproc>:
* 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 <iproc+0x40>
c = tolower (c);
39d4: e59f2164 ldr r2, [pc, #356] ; 3b40 <iproc+0x18c>
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 <iproc+0x60>
if (tty->termios.c_iflag & IGNCR)
39fc: e3130080 tst r3, #128 ; 0x80
3a00: 1a000048 bne 3b28 <iproc+0x174>
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 <iproc+0x80>
} else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) {
3a14: e355000a cmp r5, #10
3a18: 1a000003 bne 3a2c <iproc+0x78>
c = '\r';
3a1c: e3130040 tst r3, #64 ; 0x40
3a20: 03a0500a moveq r5, #10
3a24: 13a0500d movne r5, #13
3a28: ea000001 b 3a34 <iproc+0x80>
}
if ((c != '\0') && (tty->termios.c_lflag & ICANON)) {
3a2c: e3550000 cmp r5, #0
3a30: 0a00002c beq 3ae8 <iproc+0x134>
3a34: e594303c ldr r3, [r4, #60] ; 0x3c
3a38: e3130002 tst r3, #2
3a3c: 0a000029 beq 3ae8 <iproc+0x134>
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 <iproc+0xb4>
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 <iproc+0xbc>
erase (tty, 1);
3a60: e1a00004 mov r0, r4
3a64: e3a01001 mov r1, #1
3a68: ebffff60 bl 37f0 <erase>
3a6c: ea00002d b 3b28 <iproc+0x174>
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 <iproc+0x17c>
return 1;
} else if (c == '\n') {
3a7c: e355000a cmp r5, #10
3a80: 1a000008 bne 3aa8 <iproc+0xf4>
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 <echo>
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 <iproc+0x128>
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 <iproc+0x10c>
3ab4: e5d42051 ldrb r2, [r4, #81] ; 0x51
3ab8: e1520005 cmp r2, r5
3abc: 1a000009 bne 3ae8 <iproc+0x134>
(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 <echo> <== 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 <iproc+0x17c>
}
/*
* FIXME: Should do IMAXBEL handling somehow
*/
if (tty->ccount < (CBUFSIZE-1)) {
3ae8: e59f3054 ldr r3, [pc, #84] ; 3b44 <iproc+0x190>
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 <iproc+0x184>
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 <echo>
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
0000babc <memfile_lseek>:
rtems_off64_t memfile_lseek(
rtems_libio_t *iop,
rtems_off64_t offset,
int whence
)
{
babc: e92d4030 push {r4, r5, lr}
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
bac0: e5905018 ldr r5, [r0, #24]
if (the_jnode->type == IMFS_LINEAR_FILE) {
bac4: e595304c ldr r3, [r5, #76] ; 0x4c
bac8: e3530006 cmp r3, #6
rtems_off64_t memfile_lseek(
rtems_libio_t *iop,
rtems_off64_t offset,
int whence
)
{
bacc: e1a04000 mov r4, r0
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
if (the_jnode->type == IMFS_LINEAR_FILE) {
bad0: 1a00000b bne bb04 <memfile_lseek+0x48>
if (iop->offset > the_jnode->info.linearfile.size)
bad4: e5953054 ldr r3, [r5, #84] ; 0x54
bad8: e5901010 ldr r1, [r0, #16]
badc: e1510003 cmp r1, r3
bae0: e5952050 ldr r2, [r5, #80] ; 0x50
bae4: ca000003 bgt baf8 <memfile_lseek+0x3c>
bae8: 1a000014 bne bb40 <memfile_lseek+0x84>
baec: e590100c ldr r1, [r0, #12]
baf0: e1510002 cmp r1, r2
baf4: 9a000011 bls bb40 <memfile_lseek+0x84>
iop->offset = the_jnode->info.linearfile.size;
baf8: e584200c str r2, [r4, #12] <== NOT EXECUTED
bafc: e5843010 str r3, [r4, #16] <== NOT EXECUTED
bb00: ea00000e b bb40 <memfile_lseek+0x84> <== NOT EXECUTED
}
else { /* Must be a block file (IMFS_MEMORY_FILE). */
if (IMFS_memfile_extend( the_jnode, iop->offset ))
bb04: e1a00005 mov r0, r5
bb08: e284200c add r2, r4, #12
bb0c: e8920006 ldm r2, {r1, r2}
bb10: ebfffeed bl b6cc <IMFS_memfile_extend>
bb14: e3500000 cmp r0, #0
bb18: 0a000005 beq bb34 <memfile_lseek+0x78>
rtems_set_errno_and_return_minus_one( ENOSPC );
bb1c: eb00039f bl c9a0 <__errno>
bb20: e3a0301c mov r3, #28
bb24: e5803000 str r3, [r0]
bb28: e3e04000 mvn r4, #0
bb2c: e3e03000 mvn r3, #0
bb30: ea000004 b bb48 <memfile_lseek+0x8c>
iop->size = the_jnode->info.file.size;
bb34: e2853050 add r3, r5, #80 ; 0x50
bb38: e893000c ldm r3, {r2, r3}
bb3c: e984000c stmib r4, {r2, r3}
}
return iop->offset;
bb40: e284400c add r4, r4, #12
bb44: e8940018 ldm r4, {r3, r4}
}
bb48: e1a00003 mov r0, r3
bb4c: e1a01004 mov r1, r4
bb50: e8bd8030 pop {r4, r5, pc}
0000b9c8 <memfile_open>:
the_jnode = iop->pathinfo.node_access;
/*
* Perform 'copy on write' for linear files
*/
if ((iop->flags & (LIBIO_FLAGS_WRITE | LIBIO_FLAGS_APPEND))
b9c8: e5903014 ldr r3, [r0, #20]
b9cc: e3130f81 tst r3, #516 ; 0x204
rtems_libio_t *iop,
const char *pathname,
uint32_t flag,
uint32_t mode
)
{
b9d0: e92d4031 push {r0, r4, r5, lr}
b9d4: e1a05000 mov r5, r0
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
b9d8: e5904018 ldr r4, [r0, #24]
/*
* Perform 'copy on write' for linear files
*/
if ((iop->flags & (LIBIO_FLAGS_WRITE | LIBIO_FLAGS_APPEND))
b9dc: 0a000015 beq ba38 <memfile_open+0x70>
&& (the_jnode->type == IMFS_LINEAR_FILE)) {
b9e0: e594304c ldr r3, [r4, #76] ; 0x4c
b9e4: e3530006 cmp r3, #6
b9e8: 1a000012 bne ba38 <memfile_open+0x70>
uint32_t count = the_jnode->info.linearfile.size;
b9ec: 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;
b9f0: 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;
b9f4: e3a02005 mov r2, #5 <== NOT EXECUTED
b9f8: e584204c str r2, [r4, #76] ; 0x4c <== NOT EXECUTED
the_jnode->info.file.size = 0;
b9fc: e3a01000 mov r1, #0 <== NOT EXECUTED
ba00: 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)
ba04: 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;
ba08: e5943058 ldr r3, [r4, #88] ; 0x58 <== NOT EXECUTED
the_jnode->type = IMFS_MEMORY_FILE;
the_jnode->info.file.size = 0;
ba0c: e5841050 str r1, [r4, #80] ; 0x50 <== NOT EXECUTED
ba10: e5842054 str r2, [r4, #84] ; 0x54 <== NOT EXECUTED
the_jnode->info.file.indirect = 0;
ba14: e5840058 str r0, [r4, #88] ; 0x58 <== NOT EXECUTED
the_jnode->info.file.doubly_indirect = 0;
ba18: e584005c str r0, [r4, #92] ; 0x5c <== NOT EXECUTED
the_jnode->info.file.triply_indirect = 0;
ba1c: e5840060 str r0, [r4, #96] ; 0x60 <== NOT EXECUTED
if ((count != 0)
ba20: 0a000004 beq ba38 <memfile_open+0x70> <== NOT EXECUTED
&& (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1))
ba24: e1a00004 mov r0, r4 <== NOT EXECUTED
ba28: e58dc000 str ip, [sp] <== NOT EXECUTED
ba2c: ebffff6d bl b7e8 <IMFS_memfile_write> <== NOT EXECUTED
ba30: e3700001 cmn r0, #1 <== NOT EXECUTED
ba34: 0a000009 beq ba60 <memfile_open+0x98> <== NOT EXECUTED
return -1;
}
if (iop->flags & LIBIO_FLAGS_APPEND)
ba38: e5953014 ldr r3, [r5, #20]
ba3c: e3130c02 tst r3, #512 ; 0x200
iop->offset = the_jnode->info.file.size;
ba40: 12843050 addne r3, r4, #80 ; 0x50
ba44: 1893000c ldmne r3, {r2, r3}
ba48: 1585200c strne r2, [r5, #12]
ba4c: 15853010 strne r3, [r5, #16]
iop->size = the_jnode->info.file.size;
ba50: e2844050 add r4, r4, #80 ; 0x50
ba54: e8940018 ldm r4, {r3, r4}
ba58: e9850018 stmib r5, {r3, r4}
return 0;
ba5c: e3a00000 mov r0, #0
}
ba60: e8bd8038 pop {r3, r4, r5, pc}
00002220 <mount>:
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 <mount+0x34>
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: eb001d5e bl 97c4 <rtems_filesystem_get_mount_handler>
if ( !mount_h )
2248: e3500000 cmp r0, #0
224c: e58d0014 str r0, [sp, #20]
2250: 1a000002 bne 2260 <mount+0x40>
rtems_set_errno_and_return_minus_one( EINVAL );
2254: eb0029d1 bl c9a0 <__errno>
2258: e3a03016 mov r3, #22
225c: ea00003b b 2350 <mount+0x130>
{
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 <mount+0x2a8>
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: eb002db1 bl d948 <strlen>
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 <mount+0x7c>
2290: e1a00006 mov r0, r6
2294: eb002dab bl d948 <strlen>
2298: e2807001 add r7, r0, #1
size_t target_size = strlen( target ) + 1;
229c: e59d0004 ldr r0, [sp, #4]
22a0: eb002da8 bl d948 <strlen>
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 <calloc>
if ( mt_entry != NULL ) {
22c4: e2504000 subs r4, r0, #0
22c8: 0a00001e beq 2348 <mount+0x128>
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: eb002bdd bl d258 <memcpy>
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: eb002bd7 bl d258 <memcpy>
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: eb002bd2 bl d258 <memcpy>
);
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 <mount+0x2ac>
);
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 <mount+0x1e0>
2344: ea000003 b 2358 <mount+0x138>
target,
filesystemtype,
&target_length
);
if ( !mt_entry )
rtems_set_errno_and_return_minus_one( ENOMEM );
2348: eb002994 bl c9a0 <__errno> <== NOT EXECUTED
234c: e3a0300c mov r3, #12 <== NOT EXECUTED
2350: e5803000 str r3, [r0]
2354: ea000058 b 24bc <mount+0x29c>
* 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 <rtems_filesystem_evaluate_path>
2378: e3700001 cmn r0, #1
237c: 0a000048 beq 24a4 <mount+0x284>
/*
* 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 <mount+0x184>
errno = ENOTDIR;
2398: eb002980 bl c9a0 <__errno>
239c: e3a03014 mov r3, #20
23a0: ea000006 b 23c0 <mount+0x1a0>
/*
* 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 <mount+0x2b0>
23a8: e59d1018 ldr r1, [sp, #24]
23ac: ebffff85 bl 21c8 <rtems_filesystem_mount_iterate>
23b0: e3500000 cmp r0, #0
23b4: 0a000003 beq 23c8 <mount+0x1a8>
errno = EBUSY;
23b8: eb002978 bl c9a0 <__errno>
23bc: e3a03010 mov r3, #16
23c0: e5803000 str r3, [r0]
goto cleanup_and_bail;
23c4: ea000037 b 24a8 <mount+0x288>
* 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 <mount+0x20c>
23fc: ea000029 b 24a8 <mount+0x288> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
2400: e59f30cc ldr r3, [pc, #204] ; 24d4 <mount+0x2b4>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
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 <mount+0x20c>
errno = EINVAL;
2418: eb002960 bl c9a0 <__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 <mount+0x288> <== 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 <mount+0x23c>
/*
* 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 <mount+0x288>
}
/*
* Add the mount table entry to the mount table chain
*/
rtems_libio_lock();
245c: ebffff4f bl 21a0 <rtems_libio_lock>
2460: e59f006c ldr r0, [pc, #108] ; 24d4 <mount+0x2b4>
2464: e1a01004 mov r1, r4
2468: eb000cd7 bl 57cc <_Chain_Append>
rtems_chain_append( &mount_chain, &mt_entry->Node );
rtems_libio_unlock();
246c: ebffff51 bl 21b8 <rtems_libio_unlock>
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 <mount+0x2a0>
rtems_filesystem_root = mt_entry->mt_fs_root;
247c: e59f3054 ldr r3, [pc, #84] ; 24d8 <mount+0x2b8>
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 <mount+0x2a0>
)
{
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 <free>
if ( loc_to_free )
24b0: e3560000 cmp r6, #0
rtems_filesystem_freenode( loc_to_free );
24b4: 11a00006 movne r0, r6
24b8: 1bfffdf6 blne 1c98 <rtems_filesystem_freenode>
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 <newlib_free_buffers>:
*/
int newlib_free_buffers(
FILE *fp
)
{
24e0: e92d4010 push {r4, lr}
24e4: e1a04000 mov r4, r0
switch ( fileno(fp) ) {
24e8: eb002a2f bl cdac <fileno>
24ec: e3500002 cmp r0, #2
24f0: 8a00000b bhi 2524 <newlib_free_buffers+0x44>
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 <newlib_free_buffers+0x4c>
free( fp->_bf._base );
2500: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
2504: ebfffde8 bl 1cac <free> <== 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 <newlib_free_buffers+0x4c> <== NOT EXECUTED
}
break;
default:
fclose(fp);
2524: e1a00004 mov r0, r4 <== NOT EXECUTED
2528: eb00296a bl cad8 <fclose> <== NOT EXECUTED
}
return 0;
}
252c: e3a00000 mov r0, #0
2530: e8bd8010 pop {r4, pc}
00003614 <oproc>:
/*
* 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 <oproc+0x130>
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 <oproc+0xe0>
3640: 000036e0 .word 0x000036e0 <== NOT EXECUTED
3644: 000036b8 .word 0x000036b8 <== NOT EXECUTED
3648: 00003658 .word 0x00003658 <== NOT EXECUTED
364c: 000036f4 .word 0x000036f4 <== NOT EXECUTED
3650: 000036f4 .word 0x000036f4 <== NOT EXECUTED
3654: 00003680 .word 0x00003680 <== NOT EXECUTED
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 <oproc+0x130>
rtems_termios_puts ("\r", 1, tty);
366c: e59f00e4 ldr r0, [pc, #228] ; 3758 <oproc+0x144>
3670: e3a01001 mov r1, #1
3674: e1a02004 mov r2, r4
3678: ebffffa5 bl 3514 <rtems_termios_puts>
367c: ea00000b b 36b0 <oproc+0x9c>
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 <oproc+0x80> <== NOT EXECUTED
3688: e5942028 ldr r2, [r4, #40] ; 0x28 <== NOT EXECUTED
368c: e3520000 cmp r2, #0 <== NOT EXECUTED
3690: 0a00002f beq 3754 <oproc+0x140> <== 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 <oproc+0x130> <== 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 <oproc+0x130> <== NOT EXECUTED
tty->column = 0;
36b0: e3a03000 mov r3, #0
36b4: ea000021 b 3740 <oproc+0x12c>
}
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 <oproc+0x148>
tty->column = 0;
break;
case '\t':
i = 8 - (tty->column & 7);
if ((tty->termios.c_oflag & TABDLY) == XTABS) {
36d8: 1a000018 bne 3740 <oproc+0x12c>
36dc: ea00001a b 374c <oproc+0x138>
}
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 <oproc+0x12c> <== NOT EXECUTED
36f0: ea000013 b 3744 <oproc+0x130> <== NOT EXECUTED
tty->column--;
break;
default:
if (tty->termios.c_oflag & OLCUC)
36f4: e3130002 tst r3, #2
36f8: 0a000007 beq 371c <oproc+0x108>
c = toupper(c);
36fc: e59f305c ldr r3, [pc, #92] ; 3760 <oproc+0x14c> <== 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 <oproc+0x14c>
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 <oproc+0x130>
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 <rtems_termios_puts>
}
3754: e8bd8018 pop {r3, r4, pc}
0000b9e8 <pipe_ioctl>:
uint32_t cmd,
void *buffer,
rtems_libio_t *iop
)
{
if (cmd == FIONREAD) {
b9e8: e59f3058 ldr r3, [pc, #88] ; ba48 <pipe_ioctl+0x60>
b9ec: e1510003 cmp r1, r3
pipe_control_t *pipe,
uint32_t cmd,
void *buffer,
rtems_libio_t *iop
)
{
b9f0: e92d4070 push {r4, r5, r6, lr}
b9f4: e1a04000 mov r4, r0
b9f8: e1a05002 mov r5, r2
*(unsigned int *)buffer = pipe->Length;
PIPE_UNLOCK(pipe);
return 0;
}
return -EINVAL;
b9fc: 13e00015 mvnne r0, #21
uint32_t cmd,
void *buffer,
rtems_libio_t *iop
)
{
if (cmd == FIONREAD) {
ba00: 18bd8070 popne {r4, r5, r6, pc}
if (buffer == NULL)
ba04: e3520000 cmp r2, #0
return -EFAULT;
ba08: 03e0000d mvneq r0, #13
void *buffer,
rtems_libio_t *iop
)
{
if (cmd == FIONREAD) {
if (buffer == NULL)
ba0c: 08bd8070 popeq {r4, r5, r6, pc}
return -EFAULT;
if (! PIPE_LOCK(pipe))
ba10: e3a01000 mov r1, #0
ba14: e5940028 ldr r0, [r4, #40] ; 0x28
ba18: e1a02001 mov r2, r1
ba1c: ebffed1f bl 6ea0 <rtems_semaphore_obtain>
ba20: e2506000 subs r6, r0, #0
ba24: 1a000005 bne ba40 <pipe_ioctl+0x58>
return -EINTR;
/* Return length of pipe */
*(unsigned int *)buffer = pipe->Length;
ba28: e594300c ldr r3, [r4, #12]
PIPE_UNLOCK(pipe);
ba2c: e5940028 ldr r0, [r4, #40] ; 0x28
if (! PIPE_LOCK(pipe))
return -EINTR;
/* Return length of pipe */
*(unsigned int *)buffer = pipe->Length;
ba30: e5853000 str r3, [r5]
PIPE_UNLOCK(pipe);
ba34: ebffed5f bl 6fb8 <rtems_semaphore_release>
return 0;
ba38: e1a00006 mov r0, r6
ba3c: e8bd8070 pop {r4, r5, r6, pc}
if (cmd == FIONREAD) {
if (buffer == NULL)
return -EFAULT;
if (! PIPE_LOCK(pipe))
return -EINTR;
ba40: e3e00003 mvn r0, #3 <== NOT EXECUTED
PIPE_UNLOCK(pipe);
return 0;
}
return -EINVAL;
}
ba44: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
0000b6bc <pipe_read>:
pipe_control_t *pipe,
void *buffer,
size_t count,
rtems_libio_t *iop
)
{
b6bc: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr}
b6c0: e1a09001 mov r9, r1
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
b6c4: e3a01000 mov r1, #0
pipe_control_t *pipe,
void *buffer,
size_t count,
rtems_libio_t *iop
)
{
b6c8: e1a04000 mov r4, r0
b6cc: e1a05002 mov r5, r2
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
b6d0: e5900028 ldr r0, [r0, #40] ; 0x28
b6d4: e1a02001 mov r2, r1
pipe_control_t *pipe,
void *buffer,
size_t count,
rtems_libio_t *iop
)
{
b6d8: e1a0a003 mov sl, r3
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
b6dc: ebffedef bl 6ea0 <rtems_semaphore_obtain>
b6e0: e2506000 subs r6, r0, #0
/* For buffering optimization */
if (PIPE_EMPTY(pipe))
pipe->Start = 0;
if (pipe->waitingWriters > 0)
PIPE_WAKEUPWRITERS(pipe);
b6e4: 01a0b00d moveq fp, sp
rtems_libio_t *iop
)
{
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
b6e8: 0a000043 beq b7fc <pipe_read+0x140>
b6ec: ea00004e b b82c <pipe_read+0x170> <== NOT EXECUTED
return -EINTR;
while (read < count) {
while (PIPE_EMPTY(pipe)) {
/* Not an error */
if (pipe->Writers == 0)
b6f0: e5947014 ldr r7, [r4, #20]
b6f4: e3570000 cmp r7, #0
b6f8: 0a000044 beq b810 <pipe_read+0x154>
goto out_locked;
if (LIBIO_NODELAY(iop)) {
b6fc: e59a8014 ldr r8, [sl, #20]
b700: e2188001 ands r8, r8, #1
b704: 1a000040 bne b80c <pipe_read+0x150>
ret = -EAGAIN;
goto out_locked;
}
/* Wait until pipe is no more empty or no writer exists */
pipe->waitingReaders ++;
b708: e5943018 ldr r3, [r4, #24]
b70c: e2833001 add r3, r3, #1
b710: e5843018 str r3, [r4, #24]
PIPE_UNLOCK(pipe);
b714: e5940028 ldr r0, [r4, #40] ; 0x28
b718: ebffee26 bl 6fb8 <rtems_semaphore_release>
if (! PIPE_READWAIT(pipe))
b71c: e1a01008 mov r1, r8
b720: e594002c ldr r0, [r4, #44] ; 0x2c
b724: eb0005b2 bl cdf4 <rtems_barrier_wait>
b728: e3500000 cmp r0, #0
b72c: 01a07000 moveq r7, r0
b730: 13e07003 mvnne r7, #3
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
b734: e1a01008 mov r1, r8
b738: e5940028 ldr r0, [r4, #40] ; 0x28
b73c: e1a02008 mov r2, r8
b740: ebffedd6 bl 6ea0 <rtems_semaphore_obtain>
b744: e3500000 cmp r0, #0
b748: 1a000033 bne b81c <pipe_read+0x160>
/* WARN waitingReaders not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingReaders --;
b74c: e5943018 ldr r3, [r4, #24]
if (ret != 0)
b750: e3570000 cmp r7, #0
if (! PIPE_LOCK(pipe)) {
/* WARN waitingReaders not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingReaders --;
b754: e2433001 sub r3, r3, #1
b758: e5843018 str r3, [r4, #24]
if (ret != 0)
b75c: 1a00002b bne b810 <pipe_read+0x154>
if (! PIPE_LOCK(pipe))
return -EINTR;
while (read < count) {
while (PIPE_EMPTY(pipe)) {
b760: e594300c ldr r3, [r4, #12]
b764: e3530000 cmp r3, #0
b768: 0affffe0 beq b6f0 <pipe_read+0x34>
if (ret != 0)
goto out_locked;
}
/* Read chunk bytes */
chunk = MIN(count - read, pipe->Length);
b76c: e0667005 rsb r7, r6, r5
b770: e1530007 cmp r3, r7
b774: 31a07003 movcc r7, r3
chunk1 = pipe->Size - pipe->Start;
b778: e5948004 ldr r8, [r4, #4]
b77c: e5943008 ldr r3, [r4, #8]
b780: e5941000 ldr r1, [r4]
b784: e0638008 rsb r8, r3, r8
if (chunk > chunk1) {
b788: e1570008 cmp r7, r8
b78c: 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);
b790: d0811003 addle r1, r1, r3
b794: d1a02007 movle r2, r7
}
/* Read chunk bytes */
chunk = MIN(count - read, pipe->Length);
chunk1 = pipe->Size - pipe->Start;
if (chunk > chunk1) {
b798: da000006 ble b7b8 <pipe_read+0xfc>
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk1);
b79c: e0811003 add r1, r1, r3
b7a0: e1a02008 mov r2, r8
b7a4: eb0010ed bl fb60 <memcpy>
memcpy(buffer + read + chunk1, pipe->Buffer, chunk - chunk1);
b7a8: e0860008 add r0, r6, r8
b7ac: e5941000 ldr r1, [r4]
b7b0: e0890000 add r0, r9, r0
b7b4: e0682007 rsb r2, r8, r7
}
else
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk);
b7b8: eb0010e8 bl fb60 <memcpy>
pipe->Start += chunk;
b7bc: e5940008 ldr r0, [r4, #8]
pipe->Start %= pipe->Size;
b7c0: e5941004 ldr r1, [r4, #4]
b7c4: e0870000 add r0, r7, r0
b7c8: eb003d2f bl 1ac8c <__umodsi3>
pipe->Length -= chunk;
b7cc: e594300c ldr r3, [r4, #12]
b7d0: e0673003 rsb r3, r7, r3
/* For buffering optimization */
if (PIPE_EMPTY(pipe))
b7d4: e3530000 cmp r3, #0
}
else
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk);
pipe->Start += chunk;
pipe->Start %= pipe->Size;
b7d8: e5840008 str r0, [r4, #8]
pipe->Length -= chunk;
b7dc: e584300c str r3, [r4, #12]
/* For buffering optimization */
if (PIPE_EMPTY(pipe))
pipe->Start = 0;
b7e0: 05843008 streq r3, [r4, #8]
if (pipe->waitingWriters > 0)
b7e4: e594301c ldr r3, [r4, #28]
b7e8: e3530000 cmp r3, #0
PIPE_WAKEUPWRITERS(pipe);
b7ec: 15940030 ldrne r0, [r4, #48] ; 0x30
b7f0: 11a0100d movne r1, sp
b7f4: 1b000568 blne cd9c <rtems_barrier_release>
read += chunk;
b7f8: e0866007 add r6, r6, r7
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
return -EINTR;
while (read < count) {
b7fc: e1560005 cmp r6, r5
b800: 3affffd6 bcc b760 <pipe_read+0xa4>
b804: e3a07000 mov r7, #0
b808: ea000000 b b810 <pipe_read+0x154>
/* Not an error */
if (pipe->Writers == 0)
goto out_locked;
if (LIBIO_NODELAY(iop)) {
ret = -EAGAIN;
b80c: e3e0700a mvn r7, #10
PIPE_WAKEUPWRITERS(pipe);
read += chunk;
}
out_locked:
PIPE_UNLOCK(pipe);
b810: e5940028 ldr r0, [r4, #40] ; 0x28
b814: ebffede7 bl 6fb8 <rtems_semaphore_release>
b818: ea000000 b b820 <pipe_read+0x164>
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
/* WARN waitingReaders not restored! */
ret = -EINTR;
b81c: e3e07003 mvn r7, #3 <== NOT EXECUTED
PIPE_UNLOCK(pipe);
out_nolock:
if (read > 0)
return read;
return ret;
b820: e3560000 cmp r6, #0
b824: d1a06007 movle r6, r7
b828: ea000000 b b830 <pipe_read+0x174>
)
{
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
return -EINTR;
b82c: e3e06003 mvn r6, #3 <== NOT EXECUTED
out_nolock:
if (read > 0)
return read;
return ret;
}
b830: e1a00006 mov r0, r6
b834: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000b838 <pipe_write>:
pipe_control_t *pipe,
const void *buffer,
size_t count,
rtems_libio_t *iop
)
{
b838: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr}
int chunk, chunk1, written = 0, ret = 0;
/* Write nothing */
if (count == 0)
b83c: e2527000 subs r7, r2, #0
pipe_control_t *pipe,
const void *buffer,
size_t count,
rtems_libio_t *iop
)
{
b840: e1a04000 mov r4, r0
b844: e1a0b001 mov fp, r1
b848: e1a08003 mov r8, r3
int chunk, chunk1, written = 0, ret = 0;
/* Write nothing */
if (count == 0)
return 0;
b84c: 01a05007 moveq r5, r7
)
{
int chunk, chunk1, written = 0, ret = 0;
/* Write nothing */
if (count == 0)
b850: 0a000062 beq b9e0 <pipe_write+0x1a8>
return 0;
if (! PIPE_LOCK(pipe))
b854: e3a01000 mov r1, #0
b858: e5900028 ldr r0, [r0, #40] ; 0x28
b85c: e1a02001 mov r2, r1
b860: ebffed8e bl 6ea0 <rtems_semaphore_obtain>
b864: e3500000 cmp r0, #0
return -EINTR;
b868: 13e05003 mvnne r5, #3
/* Write nothing */
if (count == 0)
return 0;
if (! PIPE_LOCK(pipe))
b86c: 1a00005b bne b9e0 <pipe_write+0x1a8>
return -EINTR;
if (pipe->Readers == 0) {
b870: e5945010 ldr r5, [r4, #16]
b874: e3550000 cmp r5, #0
b878: 0a00004c beq b9b0 <pipe_write+0x178>
ret = -EPIPE;
goto out_locked;
}
/* Write of PIPE_BUF bytes or less shall not be interleaved */
chunk = count <= pipe->Size ? count : 1;
b87c: e5949004 ldr r9, [r4, #4]
b880: e1570009 cmp r7, r9
b884: 91a09007 movls r9, r7
b888: 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;
b88c: e1a05000 mov r5, r0
b890: ea000040 b b998 <pipe_write+0x160>
/* 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)) {
b894: e598a014 ldr sl, [r8, #20]
b898: e21aa001 ands sl, sl, #1
b89c: 1a000041 bne b9a8 <pipe_write+0x170>
ret = -EAGAIN;
goto out_locked;
}
/* Wait until there is chunk bytes space or no reader exists */
pipe->waitingWriters ++;
b8a0: e594301c ldr r3, [r4, #28]
b8a4: e2833001 add r3, r3, #1
b8a8: e584301c str r3, [r4, #28]
PIPE_UNLOCK(pipe);
b8ac: e5940028 ldr r0, [r4, #40] ; 0x28
b8b0: ebffedc0 bl 6fb8 <rtems_semaphore_release>
if (! PIPE_WRITEWAIT(pipe))
b8b4: e1a0100a mov r1, sl
b8b8: e5940030 ldr r0, [r4, #48] ; 0x30
b8bc: eb00054c bl cdf4 <rtems_barrier_wait>
b8c0: e3500000 cmp r0, #0
b8c4: 01a06000 moveq r6, r0
b8c8: 13e06003 mvnne r6, #3
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
b8cc: e1a0100a mov r1, sl
b8d0: e5940028 ldr r0, [r4, #40] ; 0x28
b8d4: e1a0200a mov r2, sl
b8d8: ebffed70 bl 6ea0 <rtems_semaphore_obtain>
b8dc: e3500000 cmp r0, #0
b8e0: 1a00003b bne b9d4 <pipe_write+0x19c>
/* WARN waitingWriters not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingWriters --;
b8e4: e594301c ldr r3, [r4, #28]
if (ret != 0)
b8e8: e3560000 cmp r6, #0
if (! PIPE_LOCK(pipe)) {
/* WARN waitingWriters not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingWriters --;
b8ec: e2433001 sub r3, r3, #1
b8f0: e584301c str r3, [r4, #28]
if (ret != 0)
b8f4: 1a00002e bne b9b4 <pipe_write+0x17c>
goto out_locked;
if (pipe->Readers == 0) {
b8f8: e5943010 ldr r3, [r4, #16]
b8fc: e3530000 cmp r3, #0
b900: 0a00002a beq b9b0 <pipe_write+0x178>
/* 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) {
b904: e594a004 ldr sl, [r4, #4]
b908: e594300c ldr r3, [r4, #12]
b90c: e063200a rsb r2, r3, sl
b910: e1520009 cmp r2, r9
b914: 3affffde bcc b894 <pipe_write+0x5c>
goto out_locked;
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
chunk1 = pipe->Size - PIPE_WSTART(pipe);
b918: e5940008 ldr r0, [r4, #8]
b91c: e1a0100a mov r1, sl
b920: e0830000 add r0, r3, r0
ret = -EPIPE;
goto out_locked;
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
b924: e0656007 rsb r6, r5, r7
b928: e1520006 cmp r2, r6
b92c: 31a06002 movcc r6, r2
chunk1 = pipe->Size - PIPE_WSTART(pipe);
b930: eb003cd5 bl 1ac8c <__umodsi3>
b934: e5943000 ldr r3, [r4]
b938: e060a00a rsb sl, r0, sl
if (chunk > chunk1) {
b93c: e156000a cmp r6, sl
b940: 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);
b944: d0830000 addle r0, r3, r0
b948: d1a02006 movle r2, r6
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
chunk1 = pipe->Size - PIPE_WSTART(pipe);
if (chunk > chunk1) {
b94c: da000006 ble b96c <pipe_write+0x134>
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk1);
b950: e1a0200a mov r2, sl
b954: e0830000 add r0, r3, r0
b958: eb001080 bl fb60 <memcpy>
memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1);
b95c: e08a1005 add r1, sl, r5
b960: e5940000 ldr r0, [r4]
b964: e08b1001 add r1, fp, r1
b968: e06a2006 rsb r2, sl, r6
}
else
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk);
b96c: eb00107b bl fb60 <memcpy>
pipe->Length += chunk;
b970: e594300c ldr r3, [r4, #12]
b974: e0833006 add r3, r3, r6
b978: e584300c str r3, [r4, #12]
if (pipe->waitingReaders > 0)
b97c: e5943018 ldr r3, [r4, #24]
b980: e3530000 cmp r3, #0
PIPE_WAKEUPREADERS(pipe);
b984: 1594002c ldrne r0, [r4, #44] ; 0x2c
b988: 11a0100d movne r1, sp
b98c: 1b000502 blne cd9c <rtems_barrier_release>
written += chunk;
b990: e0855006 add r5, r5, r6
/* Write of more than PIPE_BUF bytes can be interleaved */
chunk = 1;
b994: e3a09001 mov r9, #1
}
/* Write of PIPE_BUF bytes or less shall not be interleaved */
chunk = count <= pipe->Size ? count : 1;
while (written < count) {
b998: e1550007 cmp r5, r7
b99c: 3affffd8 bcc b904 <pipe_write+0xcc>
b9a0: e3a06000 mov r6, #0
b9a4: ea000002 b b9b4 <pipe_write+0x17c>
while (PIPE_SPACE(pipe) < chunk) {
if (LIBIO_NODELAY(iop)) {
ret = -EAGAIN;
b9a8: e3e0600a mvn r6, #10
b9ac: ea000000 b b9b4 <pipe_write+0x17c>
pipe->waitingWriters --;
if (ret != 0)
goto out_locked;
if (pipe->Readers == 0) {
ret = -EPIPE;
b9b0: e3e0601f mvn r6, #31
/* Write of more than PIPE_BUF bytes can be interleaved */
chunk = 1;
}
out_locked:
PIPE_UNLOCK(pipe);
b9b4: e5940028 ldr r0, [r4, #40] ; 0x28
b9b8: ebffed7e bl 6fb8 <rtems_semaphore_release>
out_nolock:
#ifdef RTEMS_POSIX_API
/* Signal SIGPIPE */
if (ret == -EPIPE)
b9bc: e3760020 cmn r6, #32
b9c0: 1a000004 bne b9d8 <pipe_write+0x1a0>
kill(getpid(), SIGPIPE);
b9c4: eb0001f1 bl c190 <getpid>
b9c8: e3a0100d mov r1, #13
b9cc: eb0002a4 bl c464 <kill>
b9d0: ea000000 b b9d8 <pipe_write+0x1a0>
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
/* WARN waitingWriters not restored! */
ret = -EINTR;
b9d4: e3e06003 mvn r6, #3 <== NOT EXECUTED
/* Signal SIGPIPE */
if (ret == -EPIPE)
kill(getpid(), SIGPIPE);
#endif
if (written > 0)
b9d8: e3550000 cmp r5, #0
b9dc: d1a05006 movle r5, r6
return written;
return ret;
}
b9e0: e1a00005 mov r0, r5
b9e4: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000a1fc <pthread_attr_setschedpolicy>:
int pthread_attr_setschedpolicy(
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
a1fc: e3500000 cmp r0, #0
a200: 0a00000b beq a234 <pthread_attr_setschedpolicy+0x38>
a204: e5903000 ldr r3, [r0]
a208: e3530000 cmp r3, #0
a20c: 0a000008 beq a234 <pthread_attr_setschedpolicy+0x38>
return EINVAL;
switch ( policy ) {
a210: e3510004 cmp r1, #4
a214: 8a000008 bhi a23c <pthread_attr_setschedpolicy+0x40>
a218: e3a03001 mov r3, #1
a21c: e1a03113 lsl r3, r3, r1
a220: e3130017 tst r3, #23
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
case SCHED_SPORADIC:
attr->schedpolicy = policy;
a224: 15801014 strne r1, [r0, #20]
return 0;
a228: 13a00000 movne r0, #0
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( policy ) {
a22c: 112fff1e bxne lr
a230: ea000001 b a23c <pthread_attr_setschedpolicy+0x40> <== NOT EXECUTED
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
a234: e3a00016 mov r0, #22
a238: e12fff1e bx lr
case SCHED_SPORADIC:
attr->schedpolicy = policy;
return 0;
default:
return ENOTSUP;
a23c: e3a00086 mov r0, #134 ; 0x86
}
}
a240: e12fff1e bx lr
00007040 <pthread_mutexattr_setpshared>:
int pthread_mutexattr_setpshared(
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
7040: e3500000 cmp r0, #0
7044: 0a000007 beq 7068 <pthread_mutexattr_setpshared+0x28>
7048: e5903000 ldr r3, [r0]
704c: e3530000 cmp r3, #0
7050: 0a000004 beq 7068 <pthread_mutexattr_setpshared+0x28>
return EINVAL;
switch ( pshared ) {
7054: e3510001 cmp r1, #1
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
7058: 95801004 strls r1, [r0, #4]
return 0;
705c: 93a00000 movls r0, #0
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( pshared ) {
7060: 912fff1e bxls lr
7064: ea000001 b 7070 <pthread_mutexattr_setpshared+0x30> <== NOT EXECUTED
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
7068: e3a00016 mov r0, #22
706c: e12fff1e bx lr
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
return 0;
default:
return EINVAL;
7070: e3a00016 mov r0, #22 <== NOT EXECUTED
}
}
7074: e12fff1e bx lr <== NOT EXECUTED
00006aac <pthread_rwlockattr_setpshared>:
int pthread_rwlockattr_setpshared(
pthread_rwlockattr_t *attr,
int pshared
)
{
if ( !attr )
6aac: e3500000 cmp r0, #0
6ab0: 0a000007 beq 6ad4 <pthread_rwlockattr_setpshared+0x28>
return EINVAL;
if ( !attr->is_initialized )
6ab4: e5903000 ldr r3, [r0]
6ab8: e3530000 cmp r3, #0
6abc: 0a000004 beq 6ad4 <pthread_rwlockattr_setpshared+0x28>
return EINVAL;
switch ( pshared ) {
6ac0: e3510001 cmp r1, #1
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
6ac4: 95801004 strls r1, [r0, #4]
return 0;
6ac8: 93a00000 movls r0, #0
return EINVAL;
if ( !attr->is_initialized )
return EINVAL;
switch ( pshared ) {
6acc: 912fff1e bxls lr
6ad0: ea000001 b 6adc <pthread_rwlockattr_setpshared+0x30> <== NOT EXECUTED
{
if ( !attr )
return EINVAL;
if ( !attr->is_initialized )
return EINVAL;
6ad4: e3a00016 mov r0, #22
6ad8: e12fff1e bx lr
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
return 0;
default:
return EINVAL;
6adc: e3a00016 mov r0, #22 <== NOT EXECUTED
}
}
6ae0: e12fff1e bx lr <== NOT EXECUTED
00011c6c <realloc>:
)
{
uintptr_t old_size;
char *new_area;
MSBUMP(realloc_calls, 1);
11c6c: e59f310c ldr r3, [pc, #268] ; 11d80 <realloc+0x114>
11c70: e5932010 ldr r2, [r3, #16]
11c74: e2822001 add r2, r2, #1
void *realloc(
void *ptr,
size_t size
)
{
11c78: e92d40f1 push {r0, r4, r5, r6, r7, lr}
uintptr_t old_size;
char *new_area;
MSBUMP(realloc_calls, 1);
11c7c: 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())) {
11c80: e59f30fc ldr r3, [pc, #252] ; 11d84 <realloc+0x118>
11c84: e5933000 ldr r3, [r3]
11c88: e3530003 cmp r3, #3
void *realloc(
void *ptr,
size_t size
)
{
11c8c: e1a04000 mov r4, r0
11c90: 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())) {
11c94: 1a000009 bne 11cc0 <realloc+0x54>
if (_Thread_Dispatch_disable_level > 0)
11c98: e59f30e8 ldr r3, [pc, #232] ; 11d88 <realloc+0x11c>
11c9c: e5933000 ldr r3, [r3]
11ca0: e3530000 cmp r3, #0
return (void *) 0;
11ca4: 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)
11ca8: 1a000032 bne 11d78 <realloc+0x10c>
return (void *) 0;
if (_ISR_Nest_level > 0)
11cac: e59f20d8 ldr r2, [pc, #216] ; 11d8c <realloc+0x120>
11cb0: e5922000 ldr r2, [r2]
11cb4: e3520000 cmp r2, #0
return (void *) 0;
11cb8: 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)
11cbc: 1a00002d bne 11d78 <realloc+0x10c>
}
/*
* Continue with realloc().
*/
if ( !ptr )
11cc0: e3540000 cmp r4, #0
11cc4: 1a000003 bne 11cd8 <realloc+0x6c>
return malloc( size );
11cc8: e1a00005 mov r0, r5
11ccc: ebffc0c5 bl 1fe8 <malloc>
11cd0: e1a04000 mov r4, r0
11cd4: ea000027 b 11d78 <realloc+0x10c>
if ( !size ) {
11cd8: e3550000 cmp r5, #0
11cdc: 1a000003 bne 11cf0 <realloc+0x84>
free( ptr );
11ce0: e1a00004 mov r0, r4 <== NOT EXECUTED
11ce4: ebffbff0 bl 1cac <free> <== NOT EXECUTED
return (void *) 0;
11ce8: e1a04005 mov r4, r5 <== NOT EXECUTED
11cec: ea000021 b 11d78 <realloc+0x10c> <== NOT EXECUTED
}
if ( !_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, ptr, &old_size) ) {
11cf0: e59f6098 ldr r6, [pc, #152] ; 11d90 <realloc+0x124>
11cf4: e1a01004 mov r1, r4
11cf8: e5960000 ldr r0, [r6]
11cfc: e1a0200d mov r2, sp
11d00: eb00004e bl 11e40 <_Protected_heap_Get_block_size>
11d04: e2507000 subs r7, r0, #0
11d08: 1a000004 bne 11d20 <realloc+0xb4>
errno = EINVAL;
11d0c: ebffeb23 bl c9a0 <__errno>
11d10: e3a03016 mov r3, #22
11d14: e5803000 str r3, [r0]
return (void *) 0;
11d18: e1a04007 mov r4, r7
11d1c: ea000015 b 11d78 <realloc+0x10c>
}
/*
* Now resize it.
*/
if ( _Protected_heap_Resize_block( RTEMS_Malloc_Heap, ptr, size ) ) {
11d20: e5960000 ldr r0, [r6]
11d24: e1a01004 mov r1, r4
11d28: e1a02005 mov r2, r5
11d2c: eb000054 bl 11e84 <_Protected_heap_Resize_block>
11d30: e3500000 cmp r0, #0
11d34: 1a00000f bne 11d78 <realloc+0x10c>
* 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 );
11d38: e1a00005 mov r0, r5
11d3c: ebffc0a9 bl 1fe8 <malloc>
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
11d40: e59f3038 ldr r3, [pc, #56] ; 11d80 <realloc+0x114>
11d44: e5932004 ldr r2, [r3, #4]
if ( !new_area ) {
11d48: e2506000 subs r6, r0, #0
* and the C Standard.
*/
new_area = malloc( size );
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
11d4c: e2422001 sub r2, r2, #1
11d50: e5832004 str r2, [r3, #4]
if ( !new_area ) {
11d54: 0a000006 beq 11d74 <realloc+0x108>
return (void *) 0;
}
memcpy( new_area, ptr, (size < old_size) ? size : old_size );
11d58: e59d2000 ldr r2, [sp]
11d5c: e1a01004 mov r1, r4
11d60: e1550002 cmp r5, r2
11d64: 31a02005 movcc r2, r5
11d68: ebffed3a bl d258 <memcpy>
free( ptr );
11d6c: e1a00004 mov r0, r4
11d70: ebffbfcd bl 1cac <free>
new_area = malloc( size );
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
if ( !new_area ) {
return (void *) 0;
11d74: e1a04006 mov r4, r6
memcpy( new_area, ptr, (size < old_size) ? size : old_size );
free( ptr );
return new_area;
}
11d78: e1a00004 mov r0, r4
11d7c: e8bd80f8 pop {r3, r4, r5, r6, r7, pc}
00005884 <rtems_aio_enqueue>:
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
5884: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
struct sched_param param;
/* The queue should be initialized */
AIO_assert (aio_request_queue.initialized != AIO_QUEUE_INITIALIZED);
result = pthread_mutex_lock (&aio_request_queue.mutex);
5888: e59f41e0 ldr r4, [pc, #480] ; 5a70 <rtems_aio_enqueue+0x1ec>
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
588c: e24dd024 sub sp, sp, #36 ; 0x24
5890: e1a06000 mov r6, r0
struct sched_param param;
/* The queue should be initialized */
AIO_assert (aio_request_queue.initialized != AIO_QUEUE_INITIALIZED);
result = pthread_mutex_lock (&aio_request_queue.mutex);
5894: e1a00004 mov r0, r4
5898: eb000227 bl 613c <pthread_mutex_lock>
if (result != 0) {
589c: e2505000 subs r5, r0, #0
58a0: 0a000002 beq 58b0 <rtems_aio_enqueue+0x2c>
free (req);
58a4: e1a00006 mov r0, r6
58a8: ebfff303 bl 24bc <free>
return result;
58ac: ea00006c b 5a64 <rtems_aio_enqueue+0x1e0>
}
/* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined,
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
58b0: eb00042e bl 6970 <pthread_self> <== NOT EXECUTED
58b4: e28d101c add r1, sp, #28 <== NOT EXECUTED
58b8: e1a0200d mov r2, sp <== NOT EXECUTED
58bc: eb000333 bl 6590 <pthread_getschedparam> <== NOT EXECUTED
req->caller_thread = pthread_self ();
58c0: eb00042a bl 6970 <pthread_self> <== NOT EXECUTED
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
58c4: e5963014 ldr r3, [r6, #20] <== NOT EXECUTED
58c8: e59d1000 ldr r1, [sp] <== NOT EXECUTED
58cc: e5932014 ldr r2, [r3, #20] <== NOT EXECUTED
58d0: e0622001 rsb r2, r2, r1 <== NOT EXECUTED
58d4: e5862004 str r2, [r6, #4] <== NOT EXECUTED
req->policy = policy;
58d8: e59d201c ldr r2, [sp, #28] <== NOT EXECUTED
58dc: e5862000 str r2, [r6] <== NOT EXECUTED
req->aiocbp->error_code = EINPROGRESS;
58e0: e3a02077 mov r2, #119 ; 0x77 <== NOT EXECUTED
/* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined,
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
req->caller_thread = pthread_self ();
58e4: e5860010 str r0, [r6, #16] <== NOT EXECUTED
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
req->policy = policy;
req->aiocbp->error_code = EINPROGRESS;
58e8: e5832030 str r2, [r3, #48] ; 0x30 <== NOT EXECUTED
req->aiocbp->return_value = 0;
if ((aio_request_queue.idle_threads == 0) &&
58ec: e5942068 ldr r2, [r4, #104] ; 0x68 <== NOT EXECUTED
58f0: e3520000 cmp r2, #0 <== NOT EXECUTED
req->caller_thread = pthread_self ();
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
req->policy = policy;
req->aiocbp->error_code = EINPROGRESS;
req->aiocbp->return_value = 0;
58f4: e5835034 str r5, [r3, #52] ; 0x34 <== NOT EXECUTED
if ((aio_request_queue.idle_threads == 0) &&
58f8: 1a00002e bne 59b8 <rtems_aio_enqueue+0x134> <== NOT EXECUTED
58fc: e5942064 ldr r2, [r4, #100] ; 0x64 <== NOT EXECUTED
5900: e3520004 cmp r2, #4 <== NOT EXECUTED
5904: ca00002b bgt 59b8 <rtems_aio_enqueue+0x134> <== NOT EXECUTED
aio_request_queue.active_threads < AIO_MAX_THREADS)
/* we still have empty places on the active_threads chain */
{
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
5908: e5931000 ldr r1, [r3] <== NOT EXECUTED
590c: e2840048 add r0, r4, #72 ; 0x48 <== NOT EXECUTED
5910: e3a02001 mov r2, #1 <== NOT EXECUTED
5914: ebfffee1 bl 54a0 <rtems_aio_search_fd> <== NOT EXECUTED
if (r_chain->new_fd == 1) {
5918: e5903004 ldr r3, [r0, #4] <== NOT EXECUTED
591c: e3530001 cmp r3, #1 <== NOT EXECUTED
if ((aio_request_queue.idle_threads == 0) &&
aio_request_queue.active_threads < AIO_MAX_THREADS)
/* we still have empty places on the active_threads chain */
{
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
5920: e1a07000 mov r7, r0 <== NOT EXECUTED
5924: e2809010 add r9, r0, #16 <== NOT EXECUTED
5928: e280801c add r8, r0, #28 <== NOT EXECUTED
592c: e280a020 add sl, r0, #32 <== NOT EXECUTED
if (r_chain->new_fd == 1) {
5930: 1a000017 bne 5994 <rtems_aio_enqueue+0x110> <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void _Chain_Prepend(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert(_Chain_Head(the_chain), the_node);
5934: e2861008 add r1, r6, #8 <== NOT EXECUTED
5938: e1a00009 mov r0, r9 <== NOT EXECUTED
593c: eb000825 bl 79d8 <_Chain_Insert> <== NOT EXECUTED
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
5940: e1a01005 mov r1, r5 <== NOT EXECUTED
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
if (r_chain->new_fd == 1) {
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
5944: e5875004 str r5, [r7, #4] <== NOT EXECUTED
pthread_mutex_init (&r_chain->mutex, NULL);
5948: e1a00008 mov r0, r8 <== NOT EXECUTED
594c: eb0001a8 bl 5ff4 <pthread_mutex_init> <== NOT EXECUTED
pthread_cond_init (&r_chain->cond, NULL);
5950: e1a01005 mov r1, r5 <== NOT EXECUTED
5954: e1a0000a mov r0, sl <== NOT EXECUTED
5958: eb0000bd bl 5c54 <pthread_cond_init> <== NOT EXECUTED
AIO_printf ("New thread");
result = pthread_create (&thid, &aio_request_queue.attr,
595c: e1a03007 mov r3, r7 <== NOT EXECUTED
5960: e28d0020 add r0, sp, #32 <== NOT EXECUTED
5964: e2841008 add r1, r4, #8 <== NOT EXECUTED
5968: e59f2104 ldr r2, [pc, #260] ; 5a74 <rtems_aio_enqueue+0x1f0><== NOT EXECUTED
596c: eb000273 bl 6340 <pthread_create> <== NOT EXECUTED
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
5970: e2506000 subs r6, r0, #0 <== NOT EXECUTED
pthread_mutex_unlock (&aio_request_queue.mutex);
return result;
}
++aio_request_queue.active_threads;
5974: 05943064 ldreq r3, [r4, #100] ; 0x64 <== NOT EXECUTED
5978: 02833001 addeq r3, r3, #1 <== NOT EXECUTED
597c: 05843064 streq r3, [r4, #100] ; 0x64 <== NOT EXECUTED
pthread_cond_init (&r_chain->cond, NULL);
AIO_printf ("New thread");
result = pthread_create (&thid, &aio_request_queue.attr,
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
5980: 0a000035 beq 5a5c <rtems_aio_enqueue+0x1d8> <== NOT EXECUTED
pthread_mutex_unlock (&aio_request_queue.mutex);
5984: e1a00004 mov r0, r4 <== NOT EXECUTED
5988: eb00020a bl 61b8 <pthread_mutex_unlock> <== NOT EXECUTED
return result;
598c: e1a05006 mov r5, r6 <== NOT EXECUTED
5990: ea000033 b 5a64 <rtems_aio_enqueue+0x1e0> <== NOT EXECUTED
}
++aio_request_queue.active_threads;
}
else {
/* put request in the fd chain it belongs to */
pthread_mutex_lock (&r_chain->mutex);
5994: e1a00008 mov r0, r8 <== NOT EXECUTED
5998: eb0001e7 bl 613c <pthread_mutex_lock> <== NOT EXECUTED
rtems_aio_insert_prio (&r_chain->perfd, req);
599c: e1a00009 mov r0, r9 <== NOT EXECUTED
59a0: e1a01006 mov r1, r6 <== NOT EXECUTED
59a4: ebffff7d bl 57a0 <rtems_aio_insert_prio> <== NOT EXECUTED
pthread_cond_signal (&r_chain->cond);
59a8: e1a0000a mov r0, sl <== NOT EXECUTED
59ac: eb0000d8 bl 5d14 <pthread_cond_signal> <== NOT EXECUTED
pthread_mutex_unlock (&r_chain->mutex);
59b0: e1a00008 mov r0, r8 <== NOT EXECUTED
59b4: ea00000e b 59f4 <rtems_aio_enqueue+0x170> <== NOT EXECUTED
else
{
/* the maximum number of threads has been already created
even though some of them might be idle.
The request belongs to one of the active fd chain */
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req,
59b8: e59f00b8 ldr r0, [pc, #184] ; 5a78 <rtems_aio_enqueue+0x1f4><== NOT EXECUTED
59bc: e5931000 ldr r1, [r3] <== NOT EXECUTED
59c0: e3a02000 mov r2, #0 <== NOT EXECUTED
59c4: ebfffeb5 bl 54a0 <rtems_aio_search_fd> <== NOT EXECUTED
req->aiocbp->aio_fildes, 0);
if (r_chain != NULL)
59c8: e2504000 subs r4, r0, #0 <== NOT EXECUTED
59cc: 0a00000a beq 59fc <rtems_aio_enqueue+0x178> <== NOT EXECUTED
{
pthread_mutex_lock (&r_chain->mutex);
59d0: e284701c add r7, r4, #28 <== NOT EXECUTED
59d4: e1a00007 mov r0, r7 <== NOT EXECUTED
59d8: eb0001d7 bl 613c <pthread_mutex_lock> <== NOT EXECUTED
rtems_aio_insert_prio (&r_chain->perfd, req);
59dc: e2840010 add r0, r4, #16 <== NOT EXECUTED
59e0: e1a01006 mov r1, r6 <== NOT EXECUTED
59e4: ebffff6d bl 57a0 <rtems_aio_insert_prio> <== NOT EXECUTED
pthread_cond_signal (&r_chain->cond);
59e8: e2840020 add r0, r4, #32 <== NOT EXECUTED
59ec: eb0000c8 bl 5d14 <pthread_cond_signal> <== NOT EXECUTED
pthread_mutex_unlock (&r_chain->mutex);
59f0: e1a00007 mov r0, r7 <== NOT EXECUTED
59f4: eb0001ef bl 61b8 <pthread_mutex_unlock> <== NOT EXECUTED
59f8: ea000017 b 5a5c <rtems_aio_enqueue+0x1d8> <== NOT EXECUTED
} else {
/* or to the idle chain */
chain = &aio_request_queue.idle_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
59fc: e5963014 ldr r3, [r6, #20] <== NOT EXECUTED
5a00: e59f0074 ldr r0, [pc, #116] ; 5a7c <rtems_aio_enqueue+0x1f8><== NOT EXECUTED
5a04: e5931000 ldr r1, [r3] <== NOT EXECUTED
5a08: e3a02001 mov r2, #1 <== NOT EXECUTED
5a0c: ebfffea3 bl 54a0 <rtems_aio_search_fd> <== NOT EXECUTED
if (r_chain->new_fd == 1) {
5a10: e5903004 ldr r3, [r0, #4] <== NOT EXECUTED
5a14: e3530001 cmp r3, #1 <== NOT EXECUTED
} else {
/* or to the idle chain */
chain = &aio_request_queue.idle_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
5a18: e1a07000 mov r7, r0 <== NOT EXECUTED
5a1c: e2800010 add r0, r0, #16 <== NOT EXECUTED
if (r_chain->new_fd == 1) {
5a20: 1a00000b bne 5a54 <rtems_aio_enqueue+0x1d0> <== NOT EXECUTED
5a24: e2861008 add r1, r6, #8 <== NOT EXECUTED
5a28: eb0007ea bl 79d8 <_Chain_Insert> <== NOT EXECUTED
/* If this is a new fd chain we signal the idle threads that
might be waiting for requests */
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
5a2c: e1a01004 mov r1, r4 <== NOT EXECUTED
if (r_chain->new_fd == 1) {
/* If this is a new fd chain we signal the idle threads that
might be waiting for requests */
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
5a30: e5874004 str r4, [r7, #4] <== NOT EXECUTED
pthread_mutex_init (&r_chain->mutex, NULL);
5a34: e287001c add r0, r7, #28 <== NOT EXECUTED
5a38: eb00016d bl 5ff4 <pthread_mutex_init> <== NOT EXECUTED
pthread_cond_init (&r_chain->cond, NULL);
5a3c: e2870020 add r0, r7, #32 <== NOT EXECUTED
5a40: e1a01004 mov r1, r4 <== NOT EXECUTED
5a44: eb000082 bl 5c54 <pthread_cond_init> <== NOT EXECUTED
pthread_cond_signal (&aio_request_queue.new_req);
5a48: e59f0030 ldr r0, [pc, #48] ; 5a80 <rtems_aio_enqueue+0x1fc><== NOT EXECUTED
5a4c: eb0000b0 bl 5d14 <pthread_cond_signal> <== NOT EXECUTED
5a50: ea000001 b 5a5c <rtems_aio_enqueue+0x1d8> <== NOT EXECUTED
} else
/* just insert the request in the existing fd chain */
rtems_aio_insert_prio (&r_chain->perfd, req);
5a54: e1a01006 mov r1, r6 <== NOT EXECUTED
5a58: ebffff50 bl 57a0 <rtems_aio_insert_prio> <== NOT EXECUTED
}
}
pthread_mutex_unlock (&aio_request_queue.mutex);
5a5c: e59f000c ldr r0, [pc, #12] ; 5a70 <rtems_aio_enqueue+0x1ec><== NOT EXECUTED
5a60: eb0001d4 bl 61b8 <pthread_mutex_unlock> <== NOT EXECUTED
return 0;
}
5a64: e1a00005 mov r0, r5
5a68: e28dd024 add sp, sp, #36 ; 0x24
5a6c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
00005540 <rtems_aio_handle>:
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
5540: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} <== NOT EXECUTED
The fd chain is already unlocked */
struct timespec timeout;
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
5544: e59f6248 ldr r6, [pc, #584] ; 5794 <rtems_aio_handle+0x254><== NOT EXECUTED
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
5548: e24dd02c sub sp, sp, #44 ; 0x2c <== NOT EXECUTED
554c: e1a04000 mov r4, r0 <== NOT EXECUTED
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
5550: e28d7020 add r7, sp, #32 <== NOT EXECUTED
pthread_cond_destroy (&r_chain->cond);
free (r_chain);
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
5554: e286b058 add fp, r6, #88 ; 0x58 <== NOT EXECUTED
node = chain->first;
req = (rtems_aio_request *) node;
/* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING
discussion in rtems_aio_enqueue () */
pthread_getschedparam (pthread_self(), &policy, ¶m);
5558: e28d9004 add r9, sp, #4 <== NOT EXECUTED
/* acquire the mutex of the current fd chain.
we don't need to lock the queue mutex since we can
add requests to idle fd chains or even active ones
if the working request has been extracted from the
chain */
result = pthread_mutex_lock (&r_chain->mutex);
555c: e284a01c add sl, r4, #28 <== NOT EXECUTED
5560: e1a0000a mov r0, sl <== NOT EXECUTED
5564: eb0002f4 bl 613c <pthread_mutex_lock> <== NOT EXECUTED
if (result != 0)
5568: e2508000 subs r8, r0, #0 <== NOT EXECUTED
556c: 1a000085 bne 5788 <rtems_aio_handle+0x248> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
5570: e5945010 ldr r5, [r4, #16] <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
5574: e2843014 add r3, r4, #20 <== NOT EXECUTED
/* If the locked chain is not empty, take the first
request extract it, unlock the chain and process
the request, in this way the user can supply more
requests to this fd chain */
if (!rtems_chain_is_empty (chain)) {
5578: e1550003 cmp r5, r3 <== NOT EXECUTED
557c: 0a000035 beq 5658 <rtems_aio_handle+0x118> <== NOT EXECUTED
node = chain->first;
req = (rtems_aio_request *) node;
/* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING
discussion in rtems_aio_enqueue () */
pthread_getschedparam (pthread_self(), &policy, ¶m);
5580: eb0004fa bl 6970 <pthread_self> <== NOT EXECUTED
5584: e28d1028 add r1, sp, #40 ; 0x28 <== NOT EXECUTED
5588: e1a02009 mov r2, r9 <== NOT EXECUTED
558c: eb0003ff bl 6590 <pthread_getschedparam> <== NOT EXECUTED
param.sched_priority = req->priority;
5590: e5953004 ldr r3, [r5, #4] <== NOT EXECUTED
5594: e58d3004 str r3, [sp, #4] <== NOT EXECUTED
pthread_setschedparam (pthread_self(), req->policy, ¶m);
5598: eb0004f4 bl 6970 <pthread_self> <== NOT EXECUTED
559c: e1a02009 mov r2, r9 <== NOT EXECUTED
55a0: e5951000 ldr r1, [r5] <== NOT EXECUTED
55a4: eb0004f6 bl 6984 <pthread_setschedparam> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
55a8: e1a00005 mov r0, r5 <== NOT EXECUTED
55ac: eb0008f4 bl 7984 <_Chain_Extract> <== NOT EXECUTED
rtems_chain_extract (node);
pthread_mutex_unlock (&r_chain->mutex);
55b0: e1a0000a mov r0, sl <== NOT EXECUTED
55b4: eb0002ff bl 61b8 <pthread_mutex_unlock> <== NOT EXECUTED
switch (req->aiocbp->aio_lio_opcode) {
55b8: e5952014 ldr r2, [r5, #20] <== NOT EXECUTED
55bc: e592302c ldr r3, [r2, #44] ; 0x2c <== NOT EXECUTED
55c0: e3530002 cmp r3, #2 <== NOT EXECUTED
55c4: 0a00000b beq 55f8 <rtems_aio_handle+0xb8> <== NOT EXECUTED
55c8: e3530003 cmp r3, #3 <== NOT EXECUTED
55cc: 0a000011 beq 5618 <rtems_aio_handle+0xd8> <== NOT EXECUTED
55d0: e3530001 cmp r3, #1 <== NOT EXECUTED
55d4: 1a000013 bne 5628 <rtems_aio_handle+0xe8> <== NOT EXECUTED
case LIO_READ:
result = pread (req->aiocbp->aio_fildes,
55d8: e5921008 ldr r1, [r2, #8] <== NOT EXECUTED
55dc: e5923004 ldr r3, [r2, #4] <== NOT EXECUTED
55e0: e58d1000 str r1, [sp] <== NOT EXECUTED
55e4: e592100c ldr r1, [r2, #12] <== NOT EXECUTED
55e8: e5920000 ldr r0, [r2] <== NOT EXECUTED
55ec: e5922010 ldr r2, [r2, #16] <== NOT EXECUTED
55f0: eb00294b bl fb24 <pread> <== NOT EXECUTED
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
55f4: ea000009 b 5620 <rtems_aio_handle+0xe0> <== NOT EXECUTED
case LIO_WRITE:
result = pwrite (req->aiocbp->aio_fildes,
55f8: e5921008 ldr r1, [r2, #8] <== NOT EXECUTED
55fc: e5923004 ldr r3, [r2, #4] <== NOT EXECUTED
5600: e58d1000 str r1, [sp] <== NOT EXECUTED
5604: e592100c ldr r1, [r2, #12] <== NOT EXECUTED
5608: e5920000 ldr r0, [r2] <== NOT EXECUTED
560c: e5922010 ldr r2, [r2, #16] <== NOT EXECUTED
5610: eb00298b bl fc44 <pwrite> <== NOT EXECUTED
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
5614: ea000001 b 5620 <rtems_aio_handle+0xe0> <== NOT EXECUTED
case LIO_SYNC:
result = fsync (req->aiocbp->aio_fildes);
5618: e5920000 ldr r0, [r2] <== NOT EXECUTED
561c: eb0018e9 bl b9c8 <fsync> <== NOT EXECUTED
break;
default:
result = -1;
}
if (result == -1) {
5620: e3700001 cmn r0, #1 <== NOT EXECUTED
5624: 1a000006 bne 5644 <rtems_aio_handle+0x104> <== NOT EXECUTED
req->aiocbp->return_value = -1;
5628: e5955014 ldr r5, [r5, #20] <== NOT EXECUTED
562c: e3e02000 mvn r2, #0 <== NOT EXECUTED
5630: e5852034 str r2, [r5, #52] ; 0x34 <== NOT EXECUTED
req->aiocbp->error_code = errno;
5634: eb002638 bl ef1c <__errno> <== NOT EXECUTED
5638: e5903000 ldr r3, [r0] <== NOT EXECUTED
563c: e5853030 str r3, [r5, #48] ; 0x30 <== NOT EXECUTED
5640: eaffffc5 b 555c <rtems_aio_handle+0x1c> <== NOT EXECUTED
} else {
req->aiocbp->return_value = result;
5644: e5953014 ldr r3, [r5, #20] <== NOT EXECUTED
req->aiocbp->error_code = 0;
5648: e3a02000 mov r2, #0 <== NOT EXECUTED
}
if (result == -1) {
req->aiocbp->return_value = -1;
req->aiocbp->error_code = errno;
} else {
req->aiocbp->return_value = result;
564c: e5830034 str r0, [r3, #52] ; 0x34 <== NOT EXECUTED
req->aiocbp->error_code = 0;
5650: e5832030 str r2, [r3, #48] ; 0x30 <== NOT EXECUTED
5654: eaffffc0 b 555c <rtems_aio_handle+0x1c> <== NOT EXECUTED
wait for a signal on chain, this will unlock the queue.
The fd chain is already unlocked */
struct timespec timeout;
pthread_mutex_unlock (&r_chain->mutex);
5658: e1a0000a mov r0, sl <== NOT EXECUTED
565c: eb0002d5 bl 61b8 <pthread_mutex_unlock> <== NOT EXECUTED
pthread_mutex_lock (&aio_request_queue.mutex);
5660: e59f012c ldr r0, [pc, #300] ; 5794 <rtems_aio_handle+0x254><== NOT EXECUTED
5664: eb0002b4 bl 613c <pthread_mutex_lock> <== NOT EXECUTED
if (rtems_chain_is_empty (chain))
5668: e5943010 ldr r3, [r4, #16] <== NOT EXECUTED
566c: e1530005 cmp r3, r5 <== NOT EXECUTED
5670: 1affffb9 bne 555c <rtems_aio_handle+0x1c> <== NOT EXECUTED
{
clock_gettime (CLOCK_REALTIME, &timeout);
5674: e1a01007 mov r1, r7 <== NOT EXECUTED
5678: e3a00001 mov r0, #1 <== NOT EXECUTED
567c: eb000126 bl 5b1c <clock_gettime> <== NOT EXECUTED
timeout.tv_sec += 3;
5680: e59d3020 ldr r3, [sp, #32] <== NOT EXECUTED
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
5684: e2845020 add r5, r4, #32 <== NOT EXECUTED
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
5688: e2833003 add r3, r3, #3 <== NOT EXECUTED
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
568c: e1a00005 mov r0, r5 <== NOT EXECUTED
5690: e59f10fc ldr r1, [pc, #252] ; 5794 <rtems_aio_handle+0x254><== NOT EXECUTED
5694: e1a02007 mov r2, r7 <== NOT EXECUTED
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
5698: e58d3020 str r3, [sp, #32] <== NOT EXECUTED
timeout.tv_nsec = 0;
569c: e58d8024 str r8, [sp, #36] ; 0x24 <== NOT EXECUTED
result = pthread_cond_timedwait (&r_chain->cond,
56a0: eb0001b2 bl 5d70 <pthread_cond_timedwait> <== NOT EXECUTED
&aio_request_queue.mutex, &timeout);
/* If no requests were added to the chain we delete the fd chain from
the queue and start working with idle fd chains */
if (result == ETIMEDOUT) {
56a4: e3500074 cmp r0, #116 ; 0x74 <== NOT EXECUTED
56a8: 1affffab bne 555c <rtems_aio_handle+0x1c> <== NOT EXECUTED
56ac: e2840008 add r0, r4, #8 <== NOT EXECUTED
56b0: eb0008b3 bl 7984 <_Chain_Extract> <== NOT EXECUTED
rtems_chain_extract (&r_chain->next_fd);
pthread_mutex_destroy (&r_chain->mutex);
56b4: e1a0000a mov r0, sl <== NOT EXECUTED
56b8: eb000201 bl 5ec4 <pthread_mutex_destroy> <== NOT EXECUTED
pthread_cond_destroy (&r_chain->cond);
56bc: e1a00005 mov r0, r5 <== NOT EXECUTED
56c0: eb000133 bl 5b94 <pthread_cond_destroy> <== NOT EXECUTED
free (r_chain);
56c4: e1a00004 mov r0, r4 <== NOT EXECUTED
56c8: ebfff37b bl 24bc <free> <== NOT EXECUTED
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
56cc: e5963054 ldr r3, [r6, #84] ; 0x54 <== NOT EXECUTED
56d0: e153000b cmp r3, fp <== NOT EXECUTED
56d4: 1a000028 bne 577c <rtems_aio_handle+0x23c> <== NOT EXECUTED
++aio_request_queue.idle_threads;
56d8: e5963068 ldr r3, [r6, #104] ; 0x68 <== NOT EXECUTED
clock_gettime (CLOCK_REALTIME, &timeout);
56dc: e1a01007 mov r1, r7 <== NOT EXECUTED
free (r_chain);
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
++aio_request_queue.idle_threads;
56e0: e2833001 add r3, r3, #1 <== NOT EXECUTED
clock_gettime (CLOCK_REALTIME, &timeout);
56e4: e3a00001 mov r0, #1 <== NOT EXECUTED
free (r_chain);
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
++aio_request_queue.idle_threads;
56e8: e5863068 str r3, [r6, #104] ; 0x68 <== NOT EXECUTED
clock_gettime (CLOCK_REALTIME, &timeout);
56ec: eb00010a bl 5b1c <clock_gettime> <== NOT EXECUTED
timeout.tv_sec += 3;
56f0: e59d3020 ldr r3, [sp, #32] <== NOT EXECUTED
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
56f4: e59f009c ldr r0, [pc, #156] ; 5798 <rtems_aio_handle+0x258><== NOT EXECUTED
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
++aio_request_queue.idle_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
56f8: e2833003 add r3, r3, #3 <== NOT EXECUTED
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
56fc: e59f1090 ldr r1, [pc, #144] ; 5794 <rtems_aio_handle+0x254><== NOT EXECUTED
5700: e1a02007 mov r2, r7 <== NOT EXECUTED
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
++aio_request_queue.idle_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
5704: e58d3020 str r3, [sp, #32] <== NOT EXECUTED
timeout.tv_nsec = 0;
5708: e58d8024 str r8, [sp, #36] ; 0x24 <== NOT EXECUTED
result = pthread_cond_timedwait (&aio_request_queue.new_req,
570c: eb000197 bl 5d70 <pthread_cond_timedwait> <== NOT EXECUTED
&aio_request_queue.mutex,
&timeout);
/* If no new fd chain was added in the idle requests
then this thread is finished */
if (result == ETIMEDOUT) {
5710: e3500074 cmp r0, #116 ; 0x74 <== NOT EXECUTED
5714: 1a000002 bne 5724 <rtems_aio_handle+0x1e4> <== NOT EXECUTED
pthread_mutex_unlock (&aio_request_queue.mutex);
5718: e59f0074 ldr r0, [pc, #116] ; 5794 <rtems_aio_handle+0x254><== NOT EXECUTED
571c: eb0002a5 bl 61b8 <pthread_mutex_unlock> <== NOT EXECUTED
return NULL;
5720: ea000018 b 5788 <rtems_aio_handle+0x248> <== NOT EXECUTED
}
/* Otherwise move this chain to the working chain and
start the loop all over again */
--aio_request_queue.idle_threads;
node = aio_request_queue.idle_req.first;
5724: e5965054 ldr r5, [r6, #84] ; 0x54 <== NOT EXECUTED
return NULL;
}
/* Otherwise move this chain to the working chain and
start the loop all over again */
--aio_request_queue.idle_threads;
5728: e5963068 ldr r3, [r6, #104] ; 0x68 <== NOT EXECUTED
572c: e1a00005 mov r0, r5 <== NOT EXECUTED
5730: e2433001 sub r3, r3, #1 <== NOT EXECUTED
5734: e5863068 str r3, [r6, #104] ; 0x68 <== NOT EXECUTED
5738: eb000891 bl 7984 <_Chain_Extract> <== NOT EXECUTED
node = aio_request_queue.idle_req.first;
rtems_chain_extract (node);
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req,
573c: e3a02001 mov r2, #1 <== NOT EXECUTED
5740: e4951010 ldr r1, [r5], #16 <== NOT EXECUTED
5744: e59f0050 ldr r0, [pc, #80] ; 579c <rtems_aio_handle+0x25c> <== NOT EXECUTED
5748: ebffff54 bl 54a0 <rtems_aio_search_fd> <== NOT EXECUTED
((rtems_aio_request_chain *)node)->fildes,
1);
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
574c: e1a01008 mov r1, r8 <== NOT EXECUTED
/* Otherwise move this chain to the working chain and
start the loop all over again */
--aio_request_queue.idle_threads;
node = aio_request_queue.idle_req.first;
rtems_chain_extract (node);
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req,
5750: e1a04000 mov r4, r0 <== NOT EXECUTED
((rtems_aio_request_chain *)node)->fildes,
1);
r_chain->new_fd = 0;
5754: e5808004 str r8, [r0, #4] <== NOT EXECUTED
pthread_mutex_init (&r_chain->mutex, NULL);
5758: e280001c add r0, r0, #28 <== NOT EXECUTED
575c: eb000224 bl 5ff4 <pthread_mutex_init> <== NOT EXECUTED
pthread_cond_init (&r_chain->cond, NULL);
5760: e1a01008 mov r1, r8 <== NOT EXECUTED
5764: e2840020 add r0, r4, #32 <== NOT EXECUTED
5768: eb000139 bl 5c54 <pthread_cond_init> <== NOT EXECUTED
r_chain->perfd = ((rtems_aio_request_chain *)node)->perfd;
576c: e8950007 ldm r5, {r0, r1, r2} <== NOT EXECUTED
5770: e2843010 add r3, r4, #16 <== NOT EXECUTED
5774: e8830007 stm r3, {r0, r1, r2} <== NOT EXECUTED
5778: eaffff77 b 555c <rtems_aio_handle+0x1c> <== NOT EXECUTED
}
else
/* If there was a request added in the initial fd chain then release
the mutex and process it */
pthread_mutex_unlock (&aio_request_queue.mutex);
577c: e59f0010 ldr r0, [pc, #16] ; 5794 <rtems_aio_handle+0x254> <== NOT EXECUTED
5780: eb00028c bl 61b8 <pthread_mutex_unlock> <== NOT EXECUTED
5784: eaffff74 b 555c <rtems_aio_handle+0x1c> <== NOT EXECUTED
}
AIO_printf ("Thread finished\n");
return NULL;
}
5788: e3a00000 mov r0, #0 <== NOT EXECUTED
578c: e28dd02c add sp, sp, #44 ; 0x2c <== NOT EXECUTED
5790: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
000053e0 <rtems_aio_init>:
* 0 - if initialization succeeded
*/
int
rtems_aio_init (void)
{
53e0: e92d4010 push {r4, lr} <== NOT EXECUTED
int result = 0;
result = pthread_attr_init (&aio_request_queue.attr);
53e4: e59f00a4 ldr r0, [pc, #164] ; 5490 <rtems_aio_init+0xb0> <== NOT EXECUTED
53e8: eb0003b4 bl 62c0 <pthread_attr_init> <== NOT EXECUTED
if (result != 0)
53ec: e2504000 subs r4, r0, #0 <== NOT EXECUTED
53f0: 1a000024 bne 5488 <rtems_aio_init+0xa8> <== NOT EXECUTED
return result;
result =
53f4: e59f0094 ldr r0, [pc, #148] ; 5490 <rtems_aio_init+0xb0> <== NOT EXECUTED
53f8: e1a01004 mov r1, r4 <== NOT EXECUTED
53fc: eb0003c1 bl 6308 <pthread_attr_setdetachstate> <== NOT EXECUTED
pthread_attr_setdetachstate (&aio_request_queue.attr,
PTHREAD_CREATE_DETACHED);
if (result != 0)
5400: e3500000 cmp r0, #0 <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
5404: 159f0084 ldrne r0, [pc, #132] ; 5490 <rtems_aio_init+0xb0> <== NOT EXECUTED
5408: 1b0003a3 blne 629c <pthread_attr_destroy> <== NOT EXECUTED
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
540c: e59f0080 ldr r0, [pc, #128] ; 5494 <rtems_aio_init+0xb4> <== NOT EXECUTED
5410: e3a01000 mov r1, #0 <== NOT EXECUTED
5414: eb0002f6 bl 5ff4 <pthread_mutex_init> <== NOT EXECUTED
if (result != 0)
5418: e3500000 cmp r0, #0 <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
541c: 159f006c ldrne r0, [pc, #108] ; 5490 <rtems_aio_init+0xb0> <== NOT EXECUTED
5420: 1b00039d blne 629c <pthread_attr_destroy> <== NOT EXECUTED
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
5424: e59f006c ldr r0, [pc, #108] ; 5498 <rtems_aio_init+0xb8> <== NOT EXECUTED
5428: e3a01000 mov r1, #0 <== NOT EXECUTED
542c: eb000208 bl 5c54 <pthread_cond_init> <== NOT EXECUTED
if (result != 0) {
5430: e2504000 subs r4, r0, #0 <== NOT EXECUTED
5434: 0a000003 beq 5448 <rtems_aio_init+0x68> <== NOT EXECUTED
pthread_mutex_destroy (&aio_request_queue.mutex);
5438: e59f0054 ldr r0, [pc, #84] ; 5494 <rtems_aio_init+0xb4> <== NOT EXECUTED
543c: eb0002a0 bl 5ec4 <pthread_mutex_destroy> <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
5440: e59f0048 ldr r0, [pc, #72] ; 5490 <rtems_aio_init+0xb0> <== NOT EXECUTED
5444: eb000394 bl 629c <pthread_attr_destroy> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
5448: e59f3044 ldr r3, [pc, #68] ; 5494 <rtems_aio_init+0xb4> <== NOT EXECUTED
544c: e283204c add r2, r3, #76 ; 0x4c <== NOT EXECUTED
the_chain->permanent_null = NULL;
the_chain->last = _Chain_Head(the_chain);
5450: e2831048 add r1, r3, #72 ; 0x48 <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
5454: e5832048 str r2, [r3, #72] ; 0x48 <== NOT EXECUTED
the_chain->permanent_null = NULL;
5458: e3a02000 mov r2, #0 <== NOT EXECUTED
545c: e583204c str r2, [r3, #76] ; 0x4c <== NOT EXECUTED
the_chain->last = _Chain_Head(the_chain);
5460: e5831050 str r1, [r3, #80] ; 0x50 <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
the_chain->permanent_null = NULL;
5464: e5832058 str r2, [r3, #88] ; 0x58 <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
5468: e2831058 add r1, r3, #88 ; 0x58 <== NOT EXECUTED
}
rtems_chain_initialize_empty (&aio_request_queue.work_req);
rtems_chain_initialize_empty (&aio_request_queue.idle_req);
aio_request_queue.active_threads = 0;
546c: e5832064 str r2, [r3, #100] ; 0x64 <== NOT EXECUTED
aio_request_queue.idle_threads = 0;
5470: e5832068 str r2, [r3, #104] ; 0x68 <== NOT EXECUTED
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
5474: e59f2020 ldr r2, [pc, #32] ; 549c <rtems_aio_init+0xbc> <== NOT EXECUTED
5478: e5831054 str r1, [r3, #84] ; 0x54 <== NOT EXECUTED
the_chain->permanent_null = NULL;
the_chain->last = _Chain_Head(the_chain);
547c: e2831054 add r1, r3, #84 ; 0x54 <== NOT EXECUTED
5480: e583105c str r1, [r3, #92] ; 0x5c <== NOT EXECUTED
5484: e5832060 str r2, [r3, #96] ; 0x60 <== NOT EXECUTED
return result;
}
5488: e1a00004 mov r0, r4 <== NOT EXECUTED
548c: e8bd8010 pop {r4, pc} <== NOT EXECUTED
000057a0 <rtems_aio_insert_prio>:
rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req)
{
rtems_chain_node *node;
AIO_printf ("FD exists \n");
node = chain->first;
57a0: e1a02000 mov r2, r0 <== NOT EXECUTED
57a4: e4923004 ldr r3, [r2], #4 <== NOT EXECUTED
if (rtems_chain_is_empty (chain)) {
57a8: e1530002 cmp r3, r2 <== NOT EXECUTED
57ac: 0a00000c beq 57e4 <rtems_aio_insert_prio+0x44> <== NOT EXECUTED
AIO_printf ("First in chain \n");
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
57b0: e5930014 ldr r0, [r3, #20] <== NOT EXECUTED
while (req->aiocbp->aio_reqprio > prio &&
57b4: e591c014 ldr ip, [r1, #20] <== NOT EXECUTED
if (rtems_chain_is_empty (chain)) {
AIO_printf ("First in chain \n");
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
57b8: e5900014 ldr r0, [r0, #20] <== NOT EXECUTED
while (req->aiocbp->aio_reqprio > prio &&
57bc: e59cc014 ldr ip, [ip, #20] <== NOT EXECUTED
57c0: ea000002 b 57d0 <rtems_aio_insert_prio+0x30> <== NOT EXECUTED
!rtems_chain_is_tail (chain, node)) {
node = node->next;
57c4: e5933000 ldr r3, [r3] <== NOT EXECUTED
prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
57c8: e5930014 ldr r0, [r3, #20] <== NOT EXECUTED
57cc: e5900014 ldr r0, [r0, #20] <== NOT EXECUTED
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
while (req->aiocbp->aio_reqprio > prio &&
57d0: e15c0000 cmp ip, r0 <== NOT EXECUTED
57d4: da000001 ble 57e0 <rtems_aio_insert_prio+0x40> <== NOT EXECUTED
57d8: e1530002 cmp r3, r2 <== NOT EXECUTED
57dc: 1afffff8 bne 57c4 <rtems_aio_insert_prio+0x24> <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void rtems_chain_insert(
rtems_chain_node *after_node,
rtems_chain_node *the_node
)
{
_Chain_Insert( after_node, the_node );
57e0: e5930004 ldr r0, [r3, #4] <== NOT EXECUTED
57e4: e2811008 add r1, r1, #8 <== NOT EXECUTED
57e8: ea00087a b 79d8 <_Chain_Insert> <== NOT EXECUTED
000057ec <rtems_aio_remove_fd>:
* Output parameters:
* NONE
*/
void rtems_aio_remove_fd (rtems_aio_request_chain *r_chain)
{
57ec: e92d40f0 push {r4, r5, r6, r7, lr} <== NOT EXECUTED
rtems_chain_control *chain;
rtems_chain_node *node;
chain = &r_chain->perfd;
node = chain->first;
57f0: e5904010 ldr r4, [r0, #16] <== NOT EXECUTED
57f4: e2807014 add r7, r0, #20 <== NOT EXECUTED
while (!rtems_chain_is_tail (chain, node))
{
rtems_chain_extract (node);
rtems_aio_request *req = (rtems_aio_request *) node;
req->aiocbp->error_code = ECANCELED;
57f8: e3a0608c mov r6, #140 ; 0x8c <== NOT EXECUTED
req->aiocbp->return_value = -1;
57fc: e3e05000 mvn r5, #0 <== NOT EXECUTED
rtems_chain_node *node;
chain = &r_chain->perfd;
node = chain->first;
while (!rtems_chain_is_tail (chain, node))
5800: ea000006 b 5820 <rtems_aio_remove_fd+0x34> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
5804: e1a00004 mov r0, r4 <== NOT EXECUTED
5808: eb00085d bl 7984 <_Chain_Extract> <== NOT EXECUTED
{
rtems_chain_extract (node);
rtems_aio_request *req = (rtems_aio_request *) node;
req->aiocbp->error_code = ECANCELED;
580c: e5943014 ldr r3, [r4, #20] <== NOT EXECUTED
req->aiocbp->return_value = -1;
free (req);
5810: e1a00004 mov r0, r4 <== NOT EXECUTED
while (!rtems_chain_is_tail (chain, node))
{
rtems_chain_extract (node);
rtems_aio_request *req = (rtems_aio_request *) node;
req->aiocbp->error_code = ECANCELED;
5814: e5836030 str r6, [r3, #48] ; 0x30 <== NOT EXECUTED
req->aiocbp->return_value = -1;
5818: e5835034 str r5, [r3, #52] ; 0x34 <== NOT EXECUTED
free (req);
581c: ebfff326 bl 24bc <free> <== NOT EXECUTED
rtems_chain_node *node;
chain = &r_chain->perfd;
node = chain->first;
while (!rtems_chain_is_tail (chain, node))
5820: e1540007 cmp r4, r7 <== NOT EXECUTED
5824: 1afffff6 bne 5804 <rtems_aio_remove_fd+0x18> <== NOT EXECUTED
rtems_aio_request *req = (rtems_aio_request *) node;
req->aiocbp->error_code = ECANCELED;
req->aiocbp->return_value = -1;
free (req);
}
}
5828: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
0000582c <rtems_aio_remove_req>:
* AIO_NOTCANCELED - if request was not canceled
* AIO_CANCELED - if request was canceled
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
582c: e92d4010 push {r4, lr} <== NOT EXECUTED
rtems_chain_node *node = chain->first;
5830: e4904004 ldr r4, [r0], #4 <== NOT EXECUTED
rtems_aio_request *current;
current = (rtems_aio_request *) node;
while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) {
5834: ea000000 b 583c <rtems_aio_remove_req+0x10> <== NOT EXECUTED
node = node->next;
5838: e5944000 ldr r4, [r4] <== NOT EXECUTED
rtems_chain_node *node = chain->first;
rtems_aio_request *current;
current = (rtems_aio_request *) node;
while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) {
583c: e1540000 cmp r4, r0 <== NOT EXECUTED
5840: 0a00000d beq 587c <rtems_aio_remove_req+0x50> <== NOT EXECUTED
5844: e5943014 ldr r3, [r4, #20] <== NOT EXECUTED
5848: e1530001 cmp r3, r1 <== NOT EXECUTED
584c: 1afffff9 bne 5838 <rtems_aio_remove_req+0xc> <== NOT EXECUTED
5850: e1a00004 mov r0, r4 <== NOT EXECUTED
5854: eb00084a bl 7984 <_Chain_Extract> <== NOT EXECUTED
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
else
{
rtems_chain_extract (node);
current->aiocbp->error_code = ECANCELED;
5858: e5943014 ldr r3, [r4, #20] <== NOT EXECUTED
585c: e3a0208c mov r2, #140 ; 0x8c <== NOT EXECUTED
5860: e5832030 str r2, [r3, #48] ; 0x30 <== NOT EXECUTED
current->aiocbp->return_value = -1;
5864: e3e02000 mvn r2, #0 <== NOT EXECUTED
free (current);
5868: e1a00004 mov r0, r4 <== NOT EXECUTED
return AIO_NOTCANCELED;
else
{
rtems_chain_extract (node);
current->aiocbp->error_code = ECANCELED;
current->aiocbp->return_value = -1;
586c: e5832034 str r2, [r3, #52] ; 0x34 <== NOT EXECUTED
free (current);
5870: ebfff311 bl 24bc <free> <== NOT EXECUTED
}
return AIO_CANCELED;
5874: e3a00000 mov r0, #0 <== NOT EXECUTED
5878: e8bd8010 pop {r4, pc} <== NOT EXECUTED
node = node->next;
current = (rtems_aio_request *) node;
}
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
587c: e3a00001 mov r0, #1 <== NOT EXECUTED
current->aiocbp->return_value = -1;
free (current);
}
return AIO_CANCELED;
}
5880: e8bd8010 pop {r4, pc} <== NOT EXECUTED
000054a0 <rtems_aio_search_fd>:
rtems_aio_search_fd (rtems_chain_control *chain, int fildes, int create)
{
rtems_aio_request_chain *r_chain;
rtems_chain_node *node;
node = chain->first;
54a0: e1a03000 mov r3, r0
*
*/
rtems_aio_request_chain *
rtems_aio_search_fd (rtems_chain_control *chain, int fildes, int create)
{
54a4: e92d40f0 push {r4, r5, r6, r7, lr}
54a8: e1a04000 mov r4, r0
rtems_aio_request_chain *r_chain;
rtems_chain_node *node;
node = chain->first;
54ac: e4937004 ldr r7, [r3], #4
54b0: ea000000 b 54b8 <rtems_aio_search_fd+0x18>
r_chain = (rtems_aio_request_chain *) node;
while (r_chain->fildes < fildes && !rtems_chain_is_tail (chain, node)) {
node = node->next;
54b4: e1a07000 mov r7, r0
rtems_chain_node *node;
node = chain->first;
r_chain = (rtems_aio_request_chain *) node;
while (r_chain->fildes < fildes && !rtems_chain_is_tail (chain, node)) {
54b8: e5970000 ldr r0, [r7]
54bc: e1500001 cmp r0, r1
node = node->next;
r_chain = (rtems_aio_request_chain *) node;
54c0: e1a06007 mov r6, r7
rtems_chain_node *node;
node = chain->first;
r_chain = (rtems_aio_request_chain *) node;
while (r_chain->fildes < fildes && !rtems_chain_is_tail (chain, node)) {
54c4: ba000003 blt 54d8 <rtems_aio_search_fd+0x38>
node = node->next;
r_chain = (rtems_aio_request_chain *) node;
}
if (r_chain->fildes == fildes)
r_chain->new_fd = 0;
54c8: 03a03000 moveq r3, #0
54cc: 05873004 streq r3, [r7, #4]
while (r_chain->fildes < fildes && !rtems_chain_is_tail (chain, node)) {
node = node->next;
r_chain = (rtems_aio_request_chain *) node;
}
if (r_chain->fildes == fildes)
54d0: 0a000018 beq 5538 <rtems_aio_search_fd+0x98>
54d4: ea000001 b 54e0 <rtems_aio_search_fd+0x40>
rtems_chain_node *node;
node = chain->first;
r_chain = (rtems_aio_request_chain *) node;
while (r_chain->fildes < fildes && !rtems_chain_is_tail (chain, node)) {
54d8: e1570003 cmp r7, r3
54dc: 1afffff4 bne 54b4 <rtems_aio_search_fd+0x14>
}
if (r_chain->fildes == fildes)
r_chain->new_fd = 0;
else {
if (create == 0)
54e0: e3520000 cmp r2, #0
r_chain = NULL;
54e4: 01a06002 moveq r6, r2
}
if (r_chain->fildes == fildes)
r_chain->new_fd = 0;
else {
if (create == 0)
54e8: 0a000012 beq 5538 <rtems_aio_search_fd+0x98>
r_chain = NULL;
else {
r_chain = malloc (sizeof (rtems_aio_request_chain));
54ec: e3a00024 mov r0, #36 ; 0x24 <== NOT EXECUTED
54f0: ebfff4fe bl 28f0 <malloc> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
54f4: e2803014 add r3, r0, #20 <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
54f8: e5803010 str r3, [r0, #16] <== NOT EXECUTED
the_chain->permanent_null = NULL;
54fc: e3a03000 mov r3, #0 <== NOT EXECUTED
5500: e5803014 str r3, [r0, #20] <== NOT EXECUTED
rtems_chain_initialize_empty (&r_chain->perfd);
if (rtems_chain_is_empty (chain))
5504: e5942000 ldr r2, [r4] <== NOT EXECUTED
else {
if (create == 0)
r_chain = NULL;
else {
r_chain = malloc (sizeof (rtems_aio_request_chain));
rtems_chain_initialize_empty (&r_chain->perfd);
5508: e2803010 add r3, r0, #16 <== NOT EXECUTED
the_chain->last = _Chain_Head(the_chain);
550c: e5803018 str r3, [r0, #24] <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
5510: e2843004 add r3, r4, #4 <== NOT EXECUTED
if (rtems_chain_is_empty (chain))
5514: e1520003 cmp r2, r3 <== NOT EXECUTED
r_chain->new_fd = 0;
else {
if (create == 0)
r_chain = NULL;
else {
r_chain = malloc (sizeof (rtems_aio_request_chain));
5518: e1a05000 mov r5, r0 <== NOT EXECUTED
551c: e1a06000 mov r6, r0 <== NOT EXECUTED
5520: e2801008 add r1, r0, #8 <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void _Chain_Prepend(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert(_Chain_Head(the_chain), the_node);
5524: 01a00004 moveq r0, r4 <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void rtems_chain_insert(
rtems_chain_node *after_node,
rtems_chain_node *the_node
)
{
_Chain_Insert( after_node, the_node );
5528: 15970004 ldrne r0, [r7, #4] <== NOT EXECUTED
552c: eb000929 bl 79d8 <_Chain_Insert> <== NOT EXECUTED
if (rtems_chain_is_empty (chain))
rtems_chain_prepend (chain, &r_chain->next_fd);
else
rtems_chain_insert (node->previous, &r_chain->next_fd);
r_chain->new_fd = 1;
5530: e3a03001 mov r3, #1 <== NOT EXECUTED
5534: e5853004 str r3, [r5, #4] <== NOT EXECUTED
}
}
return r_chain;
}
5538: e1a00006 mov r0, r6
553c: e8bd80f0 pop {r4, r5, r6, r7, pc}
000022f8 <rtems_cpu_usage_report_with_plugin>:
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: 0a000055 beq 2464 <rtems_cpu_usage_report_with_plugin+0x16c>
* 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: eb00147a bl 7508 <_TOD_Get_uptime>
_Timestamp_Subtract( &CPU_usage_Uptime_at_last_reset, &uptime, &total );
231c: e1a01005 mov r1, r5
2320: e59f0144 ldr r0, [pc, #324] ; 246c <rtems_cpu_usage_report_with_plugin+0x174>
2324: e1a02004 mov r2, r4
2328: eb001d59 bl 9894 <_Timespec_Subtract>
}
}
}
#endif
(*print)(
232c: e1a00008 mov r0, r8
2330: e59f1138 ldr r1, [pc, #312] ; 2470 <rtems_cpu_usage_report_with_plugin+0x178>
2334: e1a0e00f mov lr, pc
2338: e12fff1a bx sl
233c: e59f5130 ldr r5, [pc, #304] ; 2474 <rtems_cpu_usage_report_with_plugin+0x17c>
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
#if defined(RTEMS_DEBUG)
if ( !_Objects_Information_table[ api_index ] )
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
2344: e5b53004 ldr r3, [r5, #4]!
2348: e5936004 ldr r6, [r3, #4]
if ( information ) {
234c: e3560000 cmp r6, #0
2350: 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(
2354: 128d9018 addne r9, sp, #24
if ( !_Objects_Information_table[ api_index ] )
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
if ( information ) {
2358: 1a000032 bne 2428 <rtems_cpu_usage_report_with_plugin+0x130>
235c: ea000034 b 2434 <rtems_cpu_usage_report_with_plugin+0x13c> <== NOT EXECUTED
for ( i=1 ; i <= information->maximum ; i++ ) {
the_thread = (Thread_Control *)information->local_table[ i ];
2360: e596301c ldr r3, [r6, #28]
2364: e7934107 ldr r4, [r3, r7, lsl #2]
if ( !the_thread )
2368: e3540000 cmp r4, #0
236c: 0a00002c beq 2424 <rtems_cpu_usage_report_with_plugin+0x12c>
continue;
rtems_object_get_name( the_thread->Object.id, sizeof(name), name );
2370: e3a0100d mov r1, #13
2374: e1a0200b mov r2, fp
2378: e5940008 ldr r0, [r4, #8]
237c: eb000fc5 bl 6298 <rtems_object_get_name>
(*print)(
2380: e5942008 ldr r2, [r4, #8]
2384: e1a0300b mov r3, fp
2388: e1a00008 mov r0, r8
238c: e59f10e4 ldr r1, [pc, #228] ; 2478 <rtems_cpu_usage_report_with_plugin+0x180>
2390: e1a0e00f mov lr, pc
2394: 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;
2398: e2843084 add r3, r4, #132 ; 0x84
239c: e893000c ldm r3, {r2, r3}
23a0: e58d2020 str r2, [sp, #32]
23a4: e58d3024 str r3, [sp, #36] ; 0x24
if ( _Thread_Executing->Object.id == the_thread->Object.id ) {
23a8: e59f20cc ldr r2, [pc, #204] ; 247c <rtems_cpu_usage_report_with_plugin+0x184>
23ac: e5923004 ldr r3, [r2, #4]
23b0: e5932008 ldr r2, [r3, #8]
23b4: e5943008 ldr r3, [r4, #8]
23b8: e1520003 cmp r2, r3
23bc: 1a000006 bne 23dc <rtems_cpu_usage_report_with_plugin+0xe4>
Timestamp_Control used;
_Timestamp_Subtract(
23c0: e59f00b8 ldr r0, [pc, #184] ; 2480 <rtems_cpu_usage_report_with_plugin+0x188>
23c4: e28d1030 add r1, sp, #48 ; 0x30
23c8: e1a02009 mov r2, r9
23cc: eb001d30 bl 9894 <_Timespec_Subtract>
&_Thread_Time_of_last_context_switch, &uptime, &used
);
_Timestamp_Add_to( &ran, &used );
23d0: e28d0020 add r0, sp, #32
23d4: e1a01009 mov r1, r9
23d8: eb001cf2 bl 97a8 <_Timespec_Add_to>
};
_Timestamp_Divide( &ran, &total, &ival, &fval );
23dc: e28d203c add r2, sp, #60 ; 0x3c
23e0: e28d3038 add r3, sp, #56 ; 0x38
23e4: e28d0020 add r0, sp, #32
23e8: e28d1028 add r1, sp, #40 ; 0x28
23ec: eb001d05 bl 9808 <_Timespec_Divide>
/*
* Print the information
*/
(*print)( context,
23f0: e3a01ffa mov r1, #1000 ; 0x3e8
23f4: e59d0024 ldr r0, [sp, #36] ; 0x24
23f8: eb0054f7 bl 177dc <__aeabi_uidiv>
23fc: e59d203c ldr r2, [sp, #60] ; 0x3c
2400: e58d2000 str r2, [sp]
2404: e59d2038 ldr r2, [sp, #56] ; 0x38
2408: e1a03000 mov r3, r0
240c: e58d2004 str r2, [sp, #4]
2410: e1a00008 mov r0, r8
2414: e59f1068 ldr r1, [pc, #104] ; 2484 <rtems_cpu_usage_report_with_plugin+0x18c>
2418: e59d2020 ldr r2, [sp, #32]
241c: e1a0e00f mov lr, pc
2420: e12fff1a bx sl
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
if ( information ) {
for ( i=1 ; i <= information->maximum ; i++ ) {
2424: e2877001 add r7, r7, #1
2428: e1d631b0 ldrh r3, [r6, #16]
242c: e1570003 cmp r7, r3
2430: 9affffca bls 2360 <rtems_cpu_usage_report_with_plugin+0x68>
" ID | NAME | TICKS | PERCENT\n"
#endif
"------------+----------------------------------------+---------------+---------\n"
);
for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
2434: e59f304c ldr r3, [pc, #76] ; 2488 <rtems_cpu_usage_report_with_plugin+0x190>
2438: e1550003 cmp r5, r3
243c: 1affffc0 bne 2344 <rtems_cpu_usage_report_with_plugin+0x4c>
}
}
}
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
(*print)(
2440: e3a01ffa mov r1, #1000 ; 0x3e8
2444: e59d002c ldr r0, [sp, #44] ; 0x2c
2448: eb0054e3 bl 177dc <__aeabi_uidiv>
244c: e59f1038 ldr r1, [pc, #56] ; 248c <rtems_cpu_usage_report_with_plugin+0x194>
2450: e1a03000 mov r3, r0
2454: e59d2028 ldr r2, [sp, #40] ; 0x28
2458: e1a00008 mov r0, r8
245c: e1a0e00f mov lr, pc
2460: e12fff1a bx sl
"-------------------------------------------------------------------------------\n",
_Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset,
total_units
);
#endif
}
2464: e28dd040 add sp, sp, #64 ; 0x40
2468: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
00001a0c <rtems_filesystem_initialize>:
* 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 <rtems_filesystem_initialize+0xec>
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 <rtems_filesystem_initialize+0xf0>
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_initialize+0xf4>
rtems_filesystem_umask = 022;
/*
* mount the first filesystem.
*/
if ( rtems_filesystem_mount_table_size == 0 )
1a34: 0a00000a beq 1a64 <rtems_filesystem_initialize+0x58>
rtems_fatal_error_occurred( 0xABCD0001 );
mt = &rtems_filesystem_mount_table[0];
1a38: e59f30c4 ldr r3, [pc, #196] ; 1b04 <rtems_filesystem_initialize+0xf8>
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 <mount>
if ( status == -1 )
1a58: e3700001 cmn r0, #1
1a5c: 1a000001 bne 1a68 <rtems_filesystem_initialize+0x5c>
rtems_fatal_error_occurred( 0xABCD0002 );
1a60: e59f00a0 ldr r0, [pc, #160] ; 1b08 <rtems_filesystem_initialize+0xfc><== NOT EXECUTED
1a64: eb000e9b bl 54d8 <rtems_fatal_error_occurred> <== 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_initialize+0x100>
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_evaluate_path>
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 <rtems_filesystem_initialize+0x100>
1ab8: e58d5000 str r5, [sp]
1abc: eb000045 bl 1bd8 <rtems_filesystem_evaluate_path>
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 <rtems_filesystem_initialize+0x104>
/* 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 <rtems_filesystem_initialize+0x108>
1ae0: eb00017c bl 20d8 <mkdir>
if ( status != 0 )
1ae4: e3500000 cmp r0, #0
rtems_fatal_error_occurred( 0xABCD0003 );
1ae8: 159f0028 ldrne r0, [pc, #40] ; 1b18 <rtems_filesystem_initialize+0x10c>
* 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 <rtems_filesystem_initialize+0x58>
* 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}
000094d4 <rtems_libio_to_fcntl_flags>:
uint32_t flags
)
{
uint32_t fcntl_flags = 0;
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
94d4: e2003006 and r3, r0, #6
94d8: e3530006 cmp r3, #6
fcntl_flags |= O_RDWR;
94dc: 03a03002 moveq r3, #2
uint32_t flags
)
{
uint32_t fcntl_flags = 0;
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
94e0: 0a000005 beq 94fc <rtems_libio_to_fcntl_flags+0x28>
fcntl_flags |= O_RDWR;
} else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) {
94e4: e3100002 tst r0, #2
fcntl_flags |= O_RDONLY;
94e8: 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) {
94ec: 1a000002 bne 94fc <rtems_libio_to_fcntl_flags+0x28>
)
{
uint32_t fcntl_flags = 0;
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
fcntl_flags |= O_RDWR;
94f0: e3100004 tst r0, #4 <== NOT EXECUTED
94f4: 03a03000 moveq r3, #0 <== NOT EXECUTED
94f8: 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 ) {
94fc: e3100001 tst r0, #1
fcntl_flags |= O_NONBLOCK;
9500: 13833901 orrne r3, r3, #16384 ; 0x4000
}
if ( (flags & LIBIO_FLAGS_APPEND) == LIBIO_FLAGS_APPEND ) {
9504: e3100c02 tst r0, #512 ; 0x200
fcntl_flags |= O_APPEND;
9508: 13833008 orrne r3, r3, #8
}
if ( (flags & LIBIO_FLAGS_CREATE) == LIBIO_FLAGS_CREATE ) {
950c: e3100b01 tst r0, #1024 ; 0x400
fcntl_flags |= O_CREAT;
9510: 13833c02 orrne r3, r3, #512 ; 0x200
}
return fcntl_flags;
}
9514: e1a00003 mov r0, r3
9518: e12fff1e bx lr
00001b1c <rtems_stack_checker_is_blown>:
/*
* Check if blown
*/
bool rtems_stack_checker_is_blown( void )
{
1b1c: e92d4810 push {r4, fp, lr}
Stack_Control *the_stack = &_Thread_Executing->Start.Initial_stack;
1b20: e59f3078 ldr r3, [pc, #120] ; 1ba0 <rtems_stack_checker_is_blown+0x84>
1b24: e5933004 ldr r3, [r3, #4]
)
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
1b28: e59300c8 ldr r0, [r3, #200] ; 0xc8
/*
* Check if blown
*/
bool rtems_stack_checker_is_blown( void )
{
1b2c: e28db008 add fp, sp, #8
)
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
1b30: e15b0000 cmp fp, r0
return false;
1b34: 33a04000 movcc r4, #0
)
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
1b38: 3a000004 bcc 1b50 <rtems_stack_checker_is_blown+0x34>
return false;
}
if ( sp > (the_stack->area + the_stack->size) ) {
1b3c: e59340c4 ldr r4, [r3, #196] ; 0xc4
1b40: e0804004 add r4, r0, r4
}
/*
* Check if blown
*/
bool rtems_stack_checker_is_blown( void )
1b44: e15b0004 cmp fp, r4
1b48: 83a04000 movhi r4, #0
1b4c: 93a04001 movls r4, #1
/*
* The stack checker must be initialized before the pattern is there
* to check.
*/
if ( Stack_check_Initialized ) {
1b50: e59f304c ldr r3, [pc, #76] ; 1ba4 <rtems_stack_checker_is_blown+0x88>
1b54: e5933008 ldr r3, [r3, #8]
1b58: 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;
1b5c: 03a01001 moveq r1, #1
/*
* The stack checker must be initialized before the pattern is there
* to check.
*/
if ( Stack_check_Initialized ) {
1b60: 0a000005 beq 1b7c <rtems_stack_checker_is_blown+0x60>
pattern_ok = (!memcmp(
1b64: e59f103c ldr r1, [pc, #60] ; 1ba8 <rtems_stack_checker_is_blown+0x8c>
1b68: e2800008 add r0, r0, #8
1b6c: e3a02010 mov r2, #16
1b70: eb003717 bl f7d4 <memcmp>
1b74: e2701001 rsbs r1, r0, #1
1b78: 33a01000 movcc r1, #0
/*
* Let's report as much as we can.
*/
if ( !sp_ok || !pattern_ok ) {
1b7c: e3540000 cmp r4, #0
1b80: 0a000001 beq 1b8c <rtems_stack_checker_is_blown+0x70>
1b84: e3510000 cmp r1, #0
1b88: 1a000002 bne 1b98 <rtems_stack_checker_is_blown+0x7c>
Stack_check_report_blown_task( _Thread_Executing, pattern_ok );
1b8c: e59f300c ldr r3, [pc, #12] ; 1ba0 <rtems_stack_checker_is_blown+0x84><== NOT EXECUTED
1b90: e5930004 ldr r0, [r3, #4] <== NOT EXECUTED
1b94: ebffff9d bl 1a10 <Stack_check_report_blown_task> <== NOT EXECUTED
/*
* The Stack Pointer and the Pattern Area are OK so return false.
*/
return false;
}
1b98: e3a00000 mov r0, #0
1b9c: e8bd8810 pop {r4, fp, pc}
0000b060 <rtems_string_to_pointer>:
#if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER)
,
int base
#endif
)
{
b060: e92d40f1 push {r0, r4, r5, r6, r7, lr}
STRING_TO_INPUT_TYPE result;
char *end;
if ( !n )
b064: e2514000 subs r4, r1, #0
#if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER)
,
int base
#endif
)
{
b068: e1a05000 mov r5, r0
b06c: e1a06002 mov r6, r2
STRING_TO_INPUT_TYPE result;
char *end;
if ( !n )
return RTEMS_INVALID_ADDRESS;
b070: 03a00009 moveq r0, #9
)
{
STRING_TO_INPUT_TYPE result;
char *end;
if ( !n )
b074: 0a000018 beq b0dc <rtems_string_to_pointer+0x7c>
return RTEMS_INVALID_ADDRESS;
errno = 0;
b078: eb000abf bl db7c <__errno>
b07c: e3a03000 mov r3, #0
b080: 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 );
b084: e1a0100d mov r1, sp
if ( !n )
return RTEMS_INVALID_ADDRESS;
errno = 0;
*n = 0;
b088: 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 );
b08c: e1a00005 mov r0, r5
b090: e3a02010 mov r2, #16
b094: eb0017e7 bl 11038 <strtoul>
#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 )
b098: e3560000 cmp r6, #0
*endptr = end;
b09c: 159d3000 ldrne r3, [sp]
b0a0: 15863000 strne r3, [r6]
/* nothing was converted */
if ( end == s )
b0a4: e59d3000 ldr r3, [sp]
b0a8: 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 );
b0ac: e1a07000 mov r7, r0
if ( endptr )
*endptr = end;
/* nothing was converted */
if ( end == s )
return RTEMS_NOT_DEFINED;
b0b0: 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 )
b0b4: 0a000008 beq b0dc <rtems_string_to_pointer+0x7c>
return RTEMS_INVALID_NUMBER;
#endif
#ifdef STRING_TO_MAX
/* there was an overflow */
if ( (result == STRING_TO_MAX) && (errno == ERANGE))
b0b8: e3770001 cmn r7, #1
b0bc: 1a000004 bne b0d4 <rtems_string_to_pointer+0x74>
b0c0: eb000aad bl db7c <__errno> <== NOT EXECUTED
b0c4: e5903000 ldr r3, [r0] <== NOT EXECUTED
b0c8: e3530022 cmp r3, #34 ; 0x22 <== NOT EXECUTED
return RTEMS_INVALID_NUMBER;
b0cc: 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))
b0d0: 0a000001 beq b0dc <rtems_string_to_pointer+0x7c> <== 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;
b0d4: e5847000 str r7, [r4]
#else
*n = (STRING_TO_TYPE) result;
#endif
return RTEMS_SUCCESSFUL;
b0d8: e3a00000 mov r0, #0
}
b0dc: e8bd80f8 pop {r3, r4, r5, r6, r7, pc}
00001884 <rtems_tarfs_load>:
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: eb003eff bl 1149c <strlen>
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 <rtems_filesystem_evaluate_path>
strlen(mountpoint),
0,
&root_loc,
0
);
if (status != 0)
18b4: e2504000 subs r4, r0, #0
18b8: 1a00006c bne 1a70 <rtems_tarfs_load+0x1ec>
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 <rtems_tarfs_load+0x204>
18c4: e1530002 cmp r3, r2
18c8: 0a000005 beq 18e4 <rtems_tarfs_load+0x60>
18cc: e59f21b8 ldr r2, [pc, #440] ; 1a8c <rtems_tarfs_load+0x208>
18d0: e1530002 cmp r3, r2
18d4: 1a000065 bne 1a70 <rtems_tarfs_load+0x1ec>
18d8: ea000001 b 18e4 <rtems_tarfs_load+0x60> <== NOT EXECUTED
18dc: e1a08004 mov r8, r4
18e0: ea000006 b 1900 <rtems_tarfs_load+0x7c>
* 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 <rtems_tarfs_load+0x1f4>
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 <rtems_tarfs_load+0x20c>
1924: e3a02005 mov r2, #5
1928: eb003ef3 bl 114fc <strncmp>
192c: e2506000 subs r6, r0, #0
1930: 1a000050 bne 1a78 <rtems_tarfs_load+0x1f4>
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: eb003f49 bl 1166c <strncpy>
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: eb001d43 bl 8e68 <_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: eb001d3f bl 8e68 <_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: eb001d3b bl 8e68 <_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: eb001d45 bl 8ea0 <_rtems_tar_header_checksum>
1988: e59d3008 ldr r3, [sp, #8]
198c: e1500003 cmp r0, r3
1990: 1a000038 bne 1a78 <rtems_tarfs_load+0x1f4>
* 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 <rtems_tarfs_load+0x164>
strcpy(full_filename, mountpoint);
199c: e59d100c ldr r1, [sp, #12]
19a0: e1a00005 mov r0, r5
19a4: eb003cf8 bl 10d8c <strcpy>
if (full_filename[strlen(full_filename)-1] != '/')
19a8: e1a00005 mov r0, r5
19ac: eb003eba bl 1149c <strlen>
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 <rtems_tarfs_load+0x210>
19c8: 1b003c38 blne 10ab0 <strcat>
strcat(full_filename, filename);
19cc: e1a01007 mov r1, r7
19d0: e1a00005 mov r0, r5
19d4: eb003c35 bl 10ab0 <strcat>
mkdir(full_filename, S_IRWXU | S_IRWXG | S_IRWXO);
19d8: e1a00005 mov r0, r5
19dc: e59f10b4 ldr r1, [pc, #180] ; 1a98 <rtems_tarfs_load+0x214>
19e0: eb000464 bl 2b78 <mkdir>
19e4: eaffffbc b 18dc <rtems_tarfs_load+0x58>
* 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 <rtems_tarfs_load+0x58>
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: eb002007 bl 9a38 <IMFS_evaluate_for_make>
1a18: e2506000 subs r6, r0, #0
1a1c: 1a00000d bne 1a58 <rtems_tarfs_load+0x1d4>
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: eb001e70 bl 9408 <IMFS_create_node>
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 <rtems_tarfs_load+0x58>
);
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 <rtems_tarfs_load+0x1f8>
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}
0000c4c4 <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
c4c4: 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 )
c4c8: e252a000 subs sl, r2, #0
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
c4cc: e1a04000 mov r4, r0
c4d0: 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;
c4d4: 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 )
c4d8: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
c4dc: e59f313c ldr r3, [pc, #316] ; c620 <rtems_task_mode+0x15c>
c4e0: 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;
c4e4: e5d78074 ldrb r8, [r7, #116] ; 0x74
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
c4e8: e5976104 ldr r6, [r7, #260] ; 0x104
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
c4ec: 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;
c4f0: 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;
c4f4: 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;
c4f8: 03a08c01 moveq r8, #256 ; 0x100
c4fc: 13a08000 movne r8, #0
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
c500: e3530000 cmp r3, #0
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
c504: 13888c02 orrne r8, r8, #512 ; 0x200
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
c508: e3590000 cmp r9, #0
c50c: 03a09b01 moveq r9, #1024 ; 0x400
c510: 13a09000 movne r9, #0
old_mode |= _ISR_Get_level();
c514: ebffeff9 bl 8500 <_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;
c518: e1899000 orr r9, r9, r0
old_mode |= _ISR_Get_level();
c51c: e1898008 orr r8, r9, r8
*previous_mode_set = old_mode;
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
c520: 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;
c524: e58a8000 str r8, [sl]
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
c528: 0a000003 beq c53c <rtems_task_mode+0x78>
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
c52c: e3140c01 tst r4, #256 ; 0x100
c530: 13a03000 movne r3, #0
c534: 03a03001 moveq r3, #1
c538: e5c73074 strb r3, [r7, #116] ; 0x74
if ( mask & RTEMS_TIMESLICE_MASK ) {
c53c: e3150c02 tst r5, #512 ; 0x200
c540: 0a000006 beq c560 <rtems_task_mode+0x9c>
if ( _Modes_Is_timeslice(mode_set) ) {
c544: e2143c02 ands r3, r4, #512 ; 0x200
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
c548: 13a03001 movne r3, #1
c54c: 1587307c strne r3, [r7, #124] ; 0x7c
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
c550: 159f30cc ldrne r3, [pc, #204] ; c624 <rtems_task_mode+0x160>
c554: 15933000 ldrne r3, [r3]
} else
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
c558: 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;
c55c: 15873078 strne r3, [r7, #120] ; 0x78
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
c560: e3150080 tst r5, #128 ; 0x80
c564: 0a000001 beq c570 <rtems_task_mode+0xac>
*/
RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
Modes_Control mode_set
)
{
_ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
c568: e2040080 and r0, r4, #128 ; 0x80
c56c: ebffefde bl 84ec <_CPU_ISR_Set_level>
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
c570: e2150b01 ands r0, r5, #1024 ; 0x400
c574: 0a000013 beq c5c8 <rtems_task_mode+0x104>
* Output:
* *previous_mode_set - previous mode set
* always return RTEMS_SUCCESSFUL;
*/
rtems_status_code rtems_task_mode(
c578: 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 ) {
c57c: e5d62008 ldrb r2, [r6, #8]
* Output:
* *previous_mode_set - previous mode set
* always return RTEMS_SUCCESSFUL;
*/
rtems_status_code rtems_task_mode(
c580: 13a03000 movne r3, #0
c584: 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 ) {
c588: e1520003 cmp r2, r3
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
c58c: 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 ) {
c590: 0a00000c beq c5c8 <rtems_task_mode+0x104>
asr->is_enabled = is_asr_enabled;
c594: e5c63008 strb r3, [r6, #8]
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
c598: e10f3000 mrs r3, CPSR
c59c: e3832080 orr r2, r3, #128 ; 0x80
c5a0: e129f002 msr CPSR_fc, r2
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
_signals = information->signals_pending;
c5a4: e2861014 add r1, r6, #20
c5a8: e8910006 ldm r1, {r1, r2}
information->signals_pending = information->signals_posted;
information->signals_posted = _signals;
c5ac: 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;
c5b0: e5861018 str r1, [r6, #24]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
c5b4: e129f003 msr CPSR_fc, r3
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
c5b8: e5960014 ldr r0, [r6, #20]
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
c5bc: e3500000 cmp r0, #0
c5c0: 13a00001 movne r0, #1
c5c4: 03a00000 moveq r0, #0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
c5c8: e59f3058 ldr r3, [pc, #88] ; c628 <rtems_task_mode+0x164>
c5cc: e5933000 ldr r3, [r3]
c5d0: e3530003 cmp r3, #3
c5d4: 1a00000f bne c618 <rtems_task_mode+0x154>
bool are_signals_pending
)
{
Thread_Control *executing;
executing = _Thread_Executing;
c5d8: e59f2040 ldr r2, [pc, #64] ; c620 <rtems_task_mode+0x15c>
if ( are_signals_pending ||
c5dc: e3500000 cmp r0, #0
bool are_signals_pending
)
{
Thread_Control *executing;
executing = _Thread_Executing;
c5e0: e5923004 ldr r3, [r2, #4]
if ( are_signals_pending ||
c5e4: 1a000005 bne c600 <rtems_task_mode+0x13c>
c5e8: e5922008 ldr r2, [r2, #8]
c5ec: e1530002 cmp r3, r2
c5f0: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
(!_Thread_Is_heir( executing ) && executing->is_preemptible) ) {
c5f4: e5d33074 ldrb r3, [r3, #116] ; 0x74
c5f8: e3530000 cmp r3, #0
c5fc: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
_Thread_Dispatch_necessary = true;
c600: e59f3018 ldr r3, [pc, #24] ; c620 <rtems_task_mode+0x15c>
c604: e3a02001 mov r2, #1
c608: e5c32010 strb r2, [r3, #16]
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
c60c: ebffe9c2 bl 6d1c <_Thread_Dispatch>
}
return RTEMS_SUCCESSFUL;
c610: e3a00000 mov r0, #0
c614: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
c618: e3a00000 mov r0, #0 <== NOT EXECUTED
}
c61c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED
00002fc0 <rtems_termios_close>:
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 <rtems_termios_close+0x190>
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_semaphore_obtain>
rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
2fe4: e3500000 cmp r0, #0
2fe8: 1a000024 bne 3080 <rtems_termios_close+0xc0>
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 <rtems_termios_close+0x17c>
if (rtems_termios_linesw[tty->t_line].l_close != NULL) {
3000: e59420cc ldr r2, [r4, #204] ; 0xcc
3004: e59f3148 ldr r3, [pc, #328] ; 3154 <rtems_termios_close+0x194>
3008: e0833282 add r3, r3, r2, lsl #5
300c: e5931004 ldr r1, [r3, #4]
3010: e3510000 cmp r1, #0
3014: 0a000003 beq 3028 <rtems_termios_close+0x68>
/*
* 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 <rtems_termios_close+0x8c>
} 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 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL) {
3034: e3500000 cmp r0, #0
3038: 1a000010 bne 3080 <rtems_termios_close+0xc0>
rtems_fatal_error_occurred (sc);
}
drainOutput (tty);
303c: e1a00004 mov r0, r4
3040: ebfffeb2 bl 2b10 <drainOutput>
rtems_semaphore_release (tty->osem);
3044: e5940018 ldr r0, [r4, #24]
3048: eb0007d1 bl 4f94 <rtems_semaphore_release>
}
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
304c: e59430b4 ldr r3, [r4, #180] ; 0xb4
3050: e3530002 cmp r3, #2
3054: 1a00000a bne 3084 <rtems_termios_close+0xc4>
/*
* 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 <rtems_event_send>
if (sc != RTEMS_SUCCESSFUL)
3064: e3500000 cmp r0, #0
3068: 1a000004 bne 3080 <rtems_termios_close+0xc0>
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 <rtems_event_send>
if (sc != RTEMS_SUCCESSFUL)
3078: e3500000 cmp r0, #0
307c: 0a000000 beq 3084 <rtems_termios_close+0xc4>
rtems_fatal_error_occurred (sc);
3080: eb000914 bl 54d8 <rtems_fatal_error_occurred> <== 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_close+0x100>
rtems_termios_ttyTail = tty->back;
30b0: e59f10a0 ldr r1, [pc, #160] ; 3158 <rtems_termios_close+0x198>
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_close+0x124>
rtems_termios_ttyHead = tty->forw;
30d4: e59f1080 ldr r1, [pc, #128] ; 315c <rtems_termios_close+0x19c>
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>
rtems_semaphore_delete (tty->osem);
30ec: e5940018 ldr r0, [r4, #24]
30f0: eb00073a bl 4de0 <rtems_semaphore_delete>
rtems_semaphore_delete (tty->rawOutBuf.Semaphore);
30f4: e594008c ldr r0, [r4, #140] ; 0x8c
30f8: eb000738 bl 4de0 <rtems_semaphore_delete>
if ((tty->device.pollRead == NULL) ||
30fc: e59430a0 ldr r3, [r4, #160] ; 0xa0
3100: e3530000 cmp r3, #0
3104: 0a000002 beq 3114 <rtems_termios_close+0x154>
3108: e59430b4 ldr r3, [r4, #180] ; 0xb4
310c: e3530002 cmp r3, #2
3110: 1a000001 bne 311c <rtems_termios_close+0x15c>
(tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN))
rtems_semaphore_delete (tty->rawInBuf.Semaphore);
3114: e5940068 ldr r0, [r4, #104] ; 0x68
3118: eb000730 bl 4de0 <rtems_semaphore_delete>
free (tty->rawInBuf.theBuf);
311c: e5940058 ldr r0, [r4, #88] ; 0x58
3120: ebfffae1 bl 1cac <free>
free (tty->rawOutBuf.theBuf);
3124: e594007c ldr r0, [r4, #124] ; 0x7c
3128: ebfffadf bl 1cac <free>
free (tty->cbuf);
312c: e594001c ldr r0, [r4, #28]
3130: ebfffadd bl 1cac <free>
free (tty);
3134: e1a00004 mov r0, r4
3138: ebfffadb bl 1cac <free>
}
rtems_semaphore_release (rtems_termios_ttyMutex);
313c: e59f300c ldr r3, [pc, #12] ; 3150 <rtems_termios_close+0x190>
3140: e5930000 ldr r0, [r3]
3144: eb000792 bl 4f94 <rtems_semaphore_release>
return RTEMS_SUCCESSFUL;
}
3148: e3a00000 mov r0, #0
314c: e8bd8030 pop {r4, r5, pc}
000044dc <rtems_termios_dequeue_characters>:
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 <rtems_termios_dequeue_characters+0x30>
/*
* 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 <rtems_event_send>
if (sc != RTEMS_SUCCESSFUL)
4500: e2503000 subs r3, r0, #0
4504: 0a00000d beq 4540 <rtems_termios_dequeue_characters+0x64>
rtems_fatal_error_occurred (sc);
4508: eb0003f2 bl 54d8 <rtems_fatal_error_occurred> <== 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 <rtems_termios_dequeue_characters+0x5c>
/*
* call any line discipline start function
*/
if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
4518: e59f3028 ldr r3, [pc, #40] ; 4548 <rtems_termios_dequeue_characters+0x6c>
451c: e59330b4 ldr r3, [r3, #180] ; 0xb4
4520: e3530000 cmp r3, #0
4524: 0a000005 beq 4540 <rtems_termios_dequeue_characters+0x64>
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 <rtems_termios_dequeue_characters+0x64>
}
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 <rtems_termios_refill_transmitter>
}
4540: e1a00003 mov r0, r3
4544: e49df004 pop {pc} ; (ldr pc, [sp], #4)
00003fa8 <rtems_termios_enqueue_raw_characters>:
* 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 <rtems_termios_enqueue_raw_characters+0x298>
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 <rtems_termios_enqueue_raw_characters+0x60>
/*
* 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_termios_enqueue_raw_characters+0x274>
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 <rtems_termios_enqueue_raw_characters+0x44>
}
/*
* 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 <rtems_termios_enqueue_raw_characters+0x290>
401c: e59430dc ldr r3, [r4, #220] ; 0xdc
4020: e3530000 cmp r3, #0
4024: 0a000083 beq 4238 <rtems_termios_enqueue_raw_characters+0x290>
(*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 <rtems_termios_enqueue_raw_characters+0x290>
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 <rtems_termios_enqueue_raw_characters+0xec>
/* 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 <rtems_termios_enqueue_raw_characters+0xdc>
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 <rtems_termios_enqueue_raw_characters+0xf4>
/* 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 <rtems_termios_enqueue_raw_characters+0xd0>
/* restart output */
tty->flow_ctrl &= ~FL_ORCVXOF;
flow_rcv = true;
}
}
if (flow_rcv) {
4094: e3590000 cmp r9, #0
4098: 0a000014 beq 40f0 <rtems_termios_enqueue_raw_characters+0x148>
/* 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 <rtems_termios_enqueue_raw_characters+0x270>
/* disable interrupts */
rtems_interrupt_disable(level);
40ac: ebfffa93 bl 2b00 <arm_interrupt_disable> <== 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 <rtems_termios_enqueue_raw_characters+0x140><== 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 <rtems_termios_enqueue_raw_characters+0x270><== 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: eb00305e bl 1027c <__umodsi3>
4100: e1a07000 mov r7, r0
/* if chars_in_buffer > highwater */
rtems_interrupt_disable(level);
4104: ebfffa7d bl 2b00 <arm_interrupt_disable>
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: eb003055 bl 1027c <__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 <rtems_termios_enqueue_raw_characters+0x220>
% 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 <rtems_termios_enqueue_raw_characters+0x220><== 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 <rtems_termios_enqueue_raw_characters+0x29c><== 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 <rtems_termios_enqueue_raw_characters+0x1f0><== 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 <rtems_termios_enqueue_raw_characters+0x1cc><== NOT EXECUTED
4168: e5943094 ldr r3, [r4, #148] ; 0x94 <== NOT EXECUTED
416c: e3530000 cmp r3, #0 <== NOT EXECUTED
4170: 1a000014 bne 41c8 <rtems_termios_enqueue_raw_characters+0x220><== 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 <rtems_termios_enqueue_raw_characters+0x220><== 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 <rtems_termios_enqueue_raw_characters+0x220><== 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 <rtems_termios_enqueue_raw_characters+0x270>
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 <rtems_termios_enqueue_raw_characters+0x270>
41f4: e59430dc ldr r3, [r4, #220] ; 0xdc
41f8: e3530000 cmp r3, #0
41fc: 0a000005 beq 4218 <rtems_termios_enqueue_raw_characters+0x270>
(*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 <rtems_termios_enqueue_raw_characters+0x9c>
}
}
}
}
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 <rtems_semaphore_release>
return dropped;
}
4238: e1a00005 mov r0, r5
423c: e8bd8ffc pop {r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
00003178 <rtems_termios_ioctl>:
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 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL) {
31a0: e2506000 subs r6, r0, #0
31a4: 1a0000d4 bne 34fc <rtems_termios_ioctl+0x384>
args->ioctl_return = sc;
return sc;
}
switch (args->command) {
31a8: e5953004 ldr r3, [r5, #4]
31ac: e3530004 cmp r3, #4
31b0: 0a0000a8 beq 3458 <rtems_termios_ioctl+0x2e0>
31b4: 8a000005 bhi 31d0 <rtems_termios_ioctl+0x58>
31b8: e3530002 cmp r3, #2
31bc: 0a000029 beq 3268 <rtems_termios_ioctl+0xf0>
31c0: 8a00009d bhi 343c <rtems_termios_ioctl+0x2c4>
31c4: e3530001 cmp r3, #1
31c8: 1a000010 bne 3210 <rtems_termios_ioctl+0x98>
31cc: ea00001b b 3240 <rtems_termios_ioctl+0xc8>
31d0: e59f2330 ldr r2, [pc, #816] ; 3508 <rtems_termios_ioctl+0x390>
31d4: e1530002 cmp r3, r2
31d8: 0a0000ba beq 34c8 <rtems_termios_ioctl+0x350>
31dc: 8a000002 bhi 31ec <rtems_termios_ioctl+0x74>
31e0: e3530005 cmp r3, #5
31e4: 1a000009 bne 3210 <rtems_termios_ioctl+0x98>
31e8: ea000096 b 3448 <rtems_termios_ioctl+0x2d0>
31ec: e59f2318 ldr r2, [pc, #792] ; 350c <rtems_termios_ioctl+0x394>
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 <rtems_termios_ioctl+0x37c>
3204: e2822105 add r2, r2, #1073741825 ; 0x40000001
3208: e1530002 cmp r3, r2
320c: 0a000095 beq 3468 <rtems_termios_ioctl+0x2f0>
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 <rtems_termios_ioctl+0x398>
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 <rtems_termios_ioctl+0x37c>
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 <rtems_termios_ioctl+0x348>
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 <rtems_termios_ioctl+0x37c>
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 <rtems_termios_ioctl+0x180>
!(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 <rtems_termios_ioctl+0x180>
!(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 <rtems_termios_ioctl+0x180> <== NOT EXECUTED
/* disable interrupts */
rtems_interrupt_disable(level);
32b8: ebfffe10 bl 2b00 <arm_interrupt_disable> <== 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 <rtems_termios_ioctl+0x17c> <== 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 <rtems_termios_ioctl+0x1b0>
3304: e5943030 ldr r3, [r4, #48] ; 0x30
3308: e3130a01 tst r3, #4096 ; 0x1000
330c: 1a000005 bne 3328 <rtems_termios_ioctl+0x1b0>
/* 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 <rtems_termios_ioctl+0x200>
3334: e5943038 ldr r3, [r4, #56] ; 0x38 <== NOT EXECUTED
3338: e3530000 cmp r3, #0 <== NOT EXECUTED
333c: ba00000d blt 3378 <rtems_termios_ioctl+0x200> <== 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 <rtems_termios_ioctl+0x1f4> <== 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 <rtems_termios_ioctl+0x298>
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 <rtems_clock_get_ticks_per_second>
33c8: e3a0100a mov r1, #10
33cc: e0000098 mul r0, r8, r0
33d0: eb003311 bl 1001c <__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 <rtems_termios_ioctl+0x288>
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 <rtems_termios_ioctl+0x2a4>
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 <rtems_termios_ioctl+0x2a4>
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 <rtems_termios_ioctl+0x37c>
(*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 <rtems_termios_ioctl+0x37c>
break;
case RTEMS_IO_TCDRAIN:
drainOutput (tty);
343c: e1a00004 mov r0, r4
3440: ebfffdb2 bl 2b10 <drainOutput>
break;
3444: ea00002a b 34f4 <rtems_termios_ioctl+0x37c>
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 <rtems_termios_ioctl+0x37c>
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 <rtems_termios_ioctl+0x37c>
#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 <rtems_termios_ioctl+0x398>
3470: e0833282 add r3, r3, r2, lsl #5
3474: e5933004 ldr r3, [r3, #4]
3478: e3530000 cmp r3, #0
347c: 0a000003 beq 3490 <rtems_termios_ioctl+0x318>
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 <rtems_termios_ioctl+0x398>
* 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 <rtems_termios_ioctl+0x37c>
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 <rtems_termios_ioctl+0x37c>
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 <rtems_semaphore_release>
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}
00003c5c <rtems_termios_read>:
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 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
3c84: e2507000 subs r7, r0, #0
3c88: 1a0000be bne 3f88 <rtems_termios_read+0x32c>
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 <rtems_termios_read+0x334>
3c94: e0833282 add r3, r3, r2, lsl #5
3c98: e5933008 ldr r3, [r3, #8]
3c9c: e3530000 cmp r3, #0
3ca0: 0a000005 beq 3cbc <rtems_termios_read+0x60>
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 <rtems_termios_read+0x31c>
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 <rtems_termios_read+0x2f8>
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 <rtems_termios_read+0x17c>
3ce8: e59430b4 ldr r3, [r4, #180] ; 0xb4
3cec: e3530000 cmp r3, #0
3cf0: 1a000038 bne 3dd8 <rtems_termios_read+0x17c>
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 <rtems_termios_read+0xdc>
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_termios_read+0xc4>
rtems_task_wake_after (1);
3d14: e3a00001 mov r0, #1
3d18: eb000584 bl 5330 <rtems_task_wake_after>
3d1c: eafffff7 b 3d00 <rtems_termios_read+0xa4>
} else {
if (siproc (n, tty))
3d20: e20000ff and r0, r0, #255 ; 0xff
3d24: e1a01004 mov r1, r4
3d28: ebffff86 bl 3b48 <siproc>
3d2c: e3500000 cmp r0, #0
3d30: 0afffff2 beq 3d00 <rtems_termios_read+0xa4>
3d34: ea000086 b 3f54 <rtems_termios_read+0x2f8>
}
}
} else {
rtems_interval then, now;
then = rtems_clock_get_ticks_since_boot();
3d38: eb0002c4 bl 4850 <rtems_clock_get_ticks_since_boot>
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 <rtems_termios_read+0x148>
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 <rtems_termios_read+0x120>
if (tty->termios.c_cc[VTIME] && tty->ccount) {
3d64: e3530000 cmp r3, #0
3d68: 0a00000a beq 3d98 <rtems_termios_read+0x13c>
3d6c: e5943020 ldr r3, [r4, #32]
3d70: e3530000 cmp r3, #0
3d74: 0a000007 beq 3d98 <rtems_termios_read+0x13c>
3d78: ea000001 b 3d84 <rtems_termios_read+0x128>
if ((now - then) > tty->vtimeTicks) {
break;
}
}
} else {
if (!tty->termios.c_cc[VTIME])
3d7c: e3530000 cmp r3, #0 <== NOT EXECUTED
3d80: 0a000073 beq 3f54 <rtems_termios_read+0x2f8> <== NOT EXECUTED
break;
now = rtems_clock_get_ticks_since_boot();
3d84: eb0002b1 bl 4850 <rtems_clock_get_ticks_since_boot>
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 <rtems_termios_read+0x2f8>
break;
}
}
rtems_task_wake_after (1);
3d98: e3a00001 mov r0, #1
3d9c: eb000563 bl 5330 <rtems_task_wake_after>
3da0: eaffffe6 b 3d40 <rtems_termios_read+0xe4>
} else {
siproc (n, tty);
3da4: e20000ff and r0, r0, #255 ; 0xff
3da8: e1a01004 mov r1, r4
3dac: ebffff65 bl 3b48 <siproc>
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 <rtems_termios_read+0x2f8>
break;
if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
3dc0: e3530000 cmp r3, #0
3dc4: 0affffdd beq 3d40 <rtems_termios_read+0xe4>
3dc8: e5d43046 ldrb r3, [r4, #70] ; 0x46
3dcc: e3530000 cmp r3, #0
3dd0: 0affffda beq 3d40 <rtems_termios_read+0xe4>
3dd4: eaffffd7 b 3d38 <rtems_termios_read+0xdc>
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 <rtems_termios_read+0x338>
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 <rtems_termios_read+0x298>
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: eb00311e bl 1027c <__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: eb003115 bl 1027c <__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 <rtems_termios_read+0x254>
% 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 <rtems_termios_read+0x33c>
3e40: e59420b8 ldr r2, [r4, #184] ; 0xb8
3e44: e0023003 and r3, r2, r3
3e48: e59f2148 ldr r2, [pc, #328] ; 3f98 <rtems_termios_read+0x33c>
3e4c: e1530002 cmp r3, r2
3e50: 1a00000b bne 3e84 <rtems_termios_read+0x228>
== (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 <rtems_termios_read+0x210> <== 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 <rtems_termios_read+0x228> <== 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 <rtems_termios_read+0x254> <== 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 <rtems_termios_read+0x254>
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 <rtems_termios_read+0x278>
if (siproc (c, tty))
3ebc: e1a0000a mov r0, sl
3ec0: e1a01004 mov r1, r4
3ec4: ebffff1f bl 3b48 <siproc>
wait = 0;
3ec8: e3500000 cmp r0, #0
3ecc: 13a06000 movne r6, #0
3ed0: ea000006 b 3ef0 <rtems_termios_read+0x294>
} else {
siproc (c, tty);
3ed4: e1a0000a mov r0, sl <== NOT EXECUTED
3ed8: e1a01004 mov r1, r4 <== NOT EXECUTED
3edc: ebffff19 bl 3b48 <siproc> <== 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 <rtems_termios_read+0x2bc>
(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 <rtems_termios_read+0x194>
}
/*
* Wait for characters
*/
if ( wait ) {
3f18: e3560000 cmp r6, #0
3f1c: 0a00000c beq 3f54 <rtems_termios_read+0x2f8>
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 <rtems_semaphore_obtain>
tty->rawInBuf.Semaphore, tty->rawInBufSemaphoreOptions, timeout);
if (sc != RTEMS_SUCCESSFUL)
3f30: e3500000 cmp r0, #0
3f34: 0affffee beq 3ef4 <rtems_termios_read+0x298>
3f38: ea000005 b 3f54 <rtems_termios_read+0x2f8> <== 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 <rtems_termios_read+0x310>
3f5c: e2842020 add r2, r4, #32
3f60: e892000c ldm r2, {r2, r3}
3f64: e1530002 cmp r3, r2
3f68: bafffff3 blt 3f3c <rtems_termios_read+0x2e0>
*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 <rtems_semaphore_release>
return sc;
}
3f88: e1a00007 mov r0, r7
3f8c: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
000042ac <rtems_termios_refill_transmitter>:
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 <rtems_termios_refill_transmitter+0x1c4>
42b4: e0023003 and r3, r2, r3
42b8: e59f21b4 ldr r2, [pc, #436] ; 4474 <rtems_termios_refill_transmitter+0x1c8>
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 <rtems_termios_refill_transmitter+0x54>
== (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 <arm_interrupt_disable> <== 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 <rtems_termios_refill_transmitter+0x94> <== 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 <rtems_termios_refill_transmitter+0xa0>
* 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 <arm_interrupt_disable> <== 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 <rtems_termios_refill_transmitter+0x1bc> <== 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 <rtems_termios_refill_transmitter+0xc8>
/*
* buffer was empty
*/
if (tty->rawOutBufState == rob_wait) {
435c: e5903094 ldr r3, [r0, #148] ; 0x94
4360: e3530002 cmp r3, #2
4364: 1a00003e bne 4464 <rtems_termios_refill_transmitter+0x1b8>
/*
* this should never happen...
*/
rtems_semaphore_release (tty->rawOutBuf.Semaphore);
4368: e590008c ldr r0, [r0, #140] ; 0x8c <== NOT EXECUTED
436c: eb000308 bl 4f94 <rtems_semaphore_release> <== NOT EXECUTED
4370: ea00003b b 4464 <rtems_termios_refill_transmitter+0x1b8> <== NOT EXECUTED
}
return 0;
}
rtems_interrupt_disable(level);
4374: ebfff9e1 bl 2b00 <arm_interrupt_disable>
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: eb002fb8 bl 1027c <__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 <rtems_semaphore_release>
}
if (newTail == tty->rawOutBuf.Head) {
43b0: e5943080 ldr r3, [r4, #128] ; 0x80
43b4: e1560003 cmp r6, r3
43b8: 1a00000a bne 43e8 <rtems_termios_refill_transmitter+0x13c>
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 <rtems_termios_refill_transmitter+0x1b0>
(*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 <rtems_termios_refill_transmitter+0x1b0> <== 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 <rtems_termios_refill_transmitter+0x170>
== (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 <arm_interrupt_disable> <== 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 <rtems_termios_refill_transmitter+0x1b0> <== 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 <rtems_termios_refill_transmitter+0x1bc>
/*
* 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_termios_write>:
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 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
3bc4: e2506000 subs r6, r0, #0
3bc8: 1a000020 bne 3c50 <rtems_termios_write+0xac>
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 <rtems_termios_write+0xb4>
3bd4: e0833282 add r3, r3, r2, lsl #5
3bd8: e593300c ldr r3, [r3, #12]
3bdc: e3530000 cmp r3, #0
3be0: 0a000005 beq 3bfc <rtems_termios_write+0x58>
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_termios_write+0xa4>
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 <rtems_termios_write+0x80>
3c10: ea000006 b 3c30 <rtems_termios_write+0x8c> <== 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 <oproc>
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 <rtems_termios_write+0x70>
3c2c: ea000003 b 3c40 <rtems_termios_write+0x9c>
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 <rtems_termios_puts> <== 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 <rtems_semaphore_release>
return sc;
}
3c50: e1a00006 mov r0, r6
3c54: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
000061a0 <rtems_verror>:
{
int local_errno = 0;
int chars_written = 0;
rtems_status_code status;
if (error_flag & RTEMS_ERROR_PANIC) {
61a0: e3100202 tst r0, #536870912 ; 0x20000000
static int rtems_verror(
rtems_error_code_t error_flag,
const char *printf_format,
va_list arglist
)
{
61a4: e92d41f0 push {r4, r5, r6, r7, r8, lr}
61a8: e1a05000 mov r5, r0
61ac: e1a08001 mov r8, r1
61b0: e1a04002 mov r4, r2
int local_errno = 0;
int chars_written = 0;
rtems_status_code status;
if (error_flag & RTEMS_ERROR_PANIC) {
61b4: 0a00000e beq 61f4 <rtems_verror+0x54>
if (rtems_panic_in_progress++)
61b8: e59f212c ldr r2, [pc, #300] ; 62ec <rtems_verror+0x14c>
61bc: e5923000 ldr r3, [r2]
61c0: e2831001 add r1, r3, #1
61c4: e3530000 cmp r3, #0
61c8: e5821000 str r1, [r2]
61cc: 0a000003 beq 61e0 <rtems_verror+0x40>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
61d0: e59f3118 ldr r3, [pc, #280] ; 62f0 <rtems_verror+0x150> <== NOT EXECUTED
61d4: e5932000 ldr r2, [r3] <== NOT EXECUTED
61d8: e2822001 add r2, r2, #1 <== NOT EXECUTED
61dc: e5832000 str r2, [r3] <== NOT EXECUTED
_Thread_Disable_dispatch(); /* disable task switches */
/* don't aggravate things */
if (rtems_panic_in_progress > 2)
61e0: e59f3104 ldr r3, [pc, #260] ; 62ec <rtems_verror+0x14c>
61e4: e5933000 ldr r3, [r3]
61e8: e3530002 cmp r3, #2
return 0;
61ec: 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)
61f0: ca00003b bgt 62e4 <rtems_verror+0x144>
return 0;
}
(void) fflush(stdout); /* in case stdout/stderr same */
61f4: e59f30f8 ldr r3, [pc, #248] ; 62f4 <rtems_verror+0x154>
61f8: e5933000 ldr r3, [r3]
61fc: e5930008 ldr r0, [r3, #8]
6200: eb002f1b bl 11e74 <fflush>
status = error_flag & ~RTEMS_ERROR_MASK;
6204: e3c56207 bic r6, r5, #1879048192 ; 0x70000000
if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
6208: e2155101 ands r5, r5, #1073741824 ; 0x40000000
620c: 0a000001 beq 6218 <rtems_verror+0x78>
local_errno = errno;
6210: eb002e20 bl 11a98 <__errno>
6214: 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);
6218: e59f70d4 ldr r7, [pc, #212] ; 62f4 <rtems_verror+0x154>
621c: e5973000 ldr r3, [r7]
6220: e1a02004 mov r2, r4
6224: e593000c ldr r0, [r3, #12]
6228: e1a01008 mov r1, r8
622c: eb004782 bl 1803c <vfprintf>
if (status)
6230: 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);
6234: e1a04000 mov r4, r0
if (status)
6238: 0a000008 beq 6260 <rtems_verror+0xc0>
chars_written +=
fprintf(stderr, " (status: %s)", rtems_status_text(status));
623c: e5973000 ldr r3, [r7]
6240: e1a00006 mov r0, r6
6244: e593700c ldr r7, [r3, #12]
6248: ebffffd0 bl 6190 <rtems_status_text>
624c: e59f10a4 ldr r1, [pc, #164] ; 62f8 <rtems_verror+0x158>
6250: e1a02000 mov r2, r0
6254: e1a00007 mov r0, r7
6258: eb002feb bl 1220c <fprintf>
#endif
chars_written += vfprintf(stderr, printf_format, arglist);
if (status)
chars_written +=
625c: e0844000 add r4, r4, r0
fprintf(stderr, " (status: %s)", rtems_status_text(status));
if (local_errno) {
6260: e3550000 cmp r5, #0
6264: 0a000015 beq 62c0 <rtems_verror+0x120>
if ((local_errno > 0) && *strerror(local_errno))
6268: da00000d ble 62a4 <rtems_verror+0x104>
626c: e1a00005 mov r0, r5
6270: eb0032e8 bl 12e18 <strerror>
6274: e5d03000 ldrb r3, [r0]
6278: e3530000 cmp r3, #0
627c: 0a000008 beq 62a4 <rtems_verror+0x104>
chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
6280: e59f306c ldr r3, [pc, #108] ; 62f4 <rtems_verror+0x154>
6284: e5933000 ldr r3, [r3]
6288: e1a00005 mov r0, r5
628c: e593600c ldr r6, [r3, #12]
6290: eb0032e0 bl 12e18 <strerror>
6294: e59f1060 ldr r1, [pc, #96] ; 62fc <rtems_verror+0x15c>
6298: e1a02000 mov r2, r0
629c: e1a00006 mov r0, r6
62a0: ea000004 b 62b8 <rtems_verror+0x118>
else
chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
62a4: e59f3048 ldr r3, [pc, #72] ; 62f4 <rtems_verror+0x154>
62a8: e5933000 ldr r3, [r3]
62ac: e59f104c ldr r1, [pc, #76] ; 6300 <rtems_verror+0x160>
62b0: e593000c ldr r0, [r3, #12]
62b4: e1a02005 mov r2, r5
62b8: eb002fd3 bl 1220c <fprintf>
62bc: e0844000 add r4, r4, r0
}
chars_written += fprintf(stderr, "\n");
62c0: e59f502c ldr r5, [pc, #44] ; 62f4 <rtems_verror+0x154>
62c4: e5953000 ldr r3, [r5]
62c8: e59f1034 ldr r1, [pc, #52] ; 6304 <rtems_verror+0x164>
62cc: e593000c ldr r0, [r3, #12]
62d0: eb002fcd bl 1220c <fprintf>
(void) fflush(stderr);
62d4: 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");
62d8: e0804004 add r4, r0, r4
(void) fflush(stderr);
62dc: e593000c ldr r0, [r3, #12]
62e0: eb002ee3 bl 11e74 <fflush>
return chars_written;
}
62e4: e1a00004 mov r0, r4
62e8: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
000023a8 <scanInt>:
/*
* 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 <scanInt+0xe8>
limit++;
continue;
}
sign = 1;
}
if (!isdigit(c))
23b8: e59f90d4 ldr r9, [pc, #212] ; 2494 <scanInt+0xec>
/*
* 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 <scanInt+0x54>
23ec: e59b0000 ldr r0, [fp] <== NOT EXECUTED
23f0: e1a01005 mov r1, r5 <== NOT EXECUTED
23f4: eb003446 bl f514 <__srget_r> <== NOT EXECUTED
23f8: e1a06000 mov r6, r0 <== NOT EXECUTED
if (c == ':')
23fc: e356003a cmp r6, #58 ; 0x3a
2400: 0a000019 beq 246c <scanInt+0xc4>
break;
if (sign == 0) {
2404: e3540000 cmp r4, #0
2408: 1a000004 bne 2420 <scanInt+0x78>
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 <scanInt+0x24>
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 <scanInt+0xe4>
return 0;
d = c - '0';
if ((i > (limit / 10))
2434: e1a00008 mov r0, r8
2438: e3a0100a mov r1, #10
243c: eb003d3e bl 1193c <__aeabi_uidiv>
2440: e1570000 cmp r7, r0
2444: 8a00000f bhi 2488 <scanInt+0xe0>
}
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 <scanInt+0xbc>
2450: e1a00008 mov r0, r8
2454: e3a0100a mov r1, #10
2458: eb003dcf bl 11b9c <__umodsi3>
245c: e1560000 cmp r6, r0
2460: 8a000008 bhi 2488 <scanInt+0xe0>
return 0;
i = i * 10 + d;
2464: e027679a mla r7, sl, r7, r6
2468: eaffffd7 b 23cc <scanInt+0x24>
}
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 <scanInt+0xe4>
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}
00005734 <sigaction>:
struct sigaction *oact
)
{
ISR_Level level;
if ( oact )
5734: e2523000 subs r3, r2, #0
*oact = _POSIX_signals_Vectors[ sig ];
5738: 159f20b8 ldrne r2, [pc, #184] ; 57f8 <sigaction+0xc4>
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
573c: e92d40f0 push {r4, r5, r6, r7, lr}
5740: e1a05001 mov r5, r1
ISR_Level level;
if ( oact )
*oact = _POSIX_signals_Vectors[ sig ];
5744: 13a0100c movne r1, #12
5748: 10222091 mlane r2, r1, r0, r2
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
574c: e1a04000 mov r4, r0
ISR_Level level;
if ( oact )
*oact = _POSIX_signals_Vectors[ sig ];
5750: 18920007 ldmne r2, {r0, r1, r2}
5754: 18830007 stmne r3, {r0, r1, r2}
if ( !sig )
5758: e3540000 cmp r4, #0
575c: 0a000004 beq 5774 <sigaction+0x40>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
5760: e2443001 sub r3, r4, #1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
5764: e353001f cmp r3, #31
5768: 8a000001 bhi 5774 <sigaction+0x40>
*
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
576c: e3540009 cmp r4, #9
5770: 1a000004 bne 5788 <sigaction+0x54>
rtems_set_errno_and_return_minus_one( EINVAL );
5774: eb002104 bl db8c <__errno>
5778: e3a03016 mov r3, #22
577c: e5803000 str r3, [r0]
5780: e3e00000 mvn r0, #0
5784: e8bd80f0 pop {r4, r5, r6, r7, pc}
/*
* Evaluate the new action structure and set the global signal vector
* appropriately.
*/
if ( act ) {
5788: e3550000 cmp r5, #0
578c: 0a000017 beq 57f0 <sigaction+0xbc>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
5790: e10f6000 mrs r6, CPSR
5794: e3863080 orr r3, r6, #128 ; 0x80
5798: e129f003 msr CPSR_fc, r3
* Unless the user is installing the default signal actions, then
* we can just copy the provided sigaction structure into the vectors.
*/
_ISR_Disable( level );
if ( act->sa_handler == SIG_DFL ) {
579c: e5953008 ldr r3, [r5, #8]
57a0: e3530000 cmp r3, #0
57a4: e59f704c ldr r7, [pc, #76] ; 57f8 <sigaction+0xc4>
57a8: 1a000007 bne 57cc <sigaction+0x98>
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
57ac: e283300c add r3, r3, #12
57b0: e0040493 mul r4, r3, r4
57b4: e59f2040 ldr r2, [pc, #64] ; 57fc <sigaction+0xc8>
57b8: e0873004 add r3, r7, r4
57bc: e0824004 add r4, r2, r4
57c0: e8940007 ldm r4, {r0, r1, r2}
57c4: e8830007 stm r3, {r0, r1, r2}
57c8: ea000005 b 57e4 <sigaction+0xb0>
} else {
_POSIX_signals_Clear_process_signals( sig );
57cc: e1a00004 mov r0, r4
57d0: eb001575 bl adac <_POSIX_signals_Clear_process_signals>
_POSIX_signals_Vectors[ sig ] = *act;
57d4: e3a0300c mov r3, #12
57d8: e0247493 mla r4, r3, r4, r7
57dc: e8950007 ldm r5, {r0, r1, r2}
57e0: e8840007 stm r4, {r0, r1, r2}
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
57e4: e129f006 msr CPSR_fc, r6
* now (signals not posted when SIG_IGN).
* + If we are now ignoring a signal that was previously pending,
* we clear the pending signal indicator.
*/
return 0;
57e8: e3a00000 mov r0, #0
57ec: e8bd80f0 pop {r4, r5, r6, r7, pc}
57f0: e1a00005 mov r0, r5 <== NOT EXECUTED
}
57f4: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
00007dac <sigwait>:
int sigwait(
const sigset_t *set,
int *sig
)
{
7dac: e92d4010 push {r4, lr}
7db0: e1a04001 mov r4, r1
int status;
status = sigtimedwait( set, NULL, NULL );
7db4: e3a01000 mov r1, #0
7db8: e1a02001 mov r2, r1
7dbc: ebffff84 bl 7bd4 <sigtimedwait>
if ( status != -1 ) {
7dc0: e3700001 cmn r0, #1
7dc4: 0a000004 beq 7ddc <sigwait+0x30>
if ( sig )
7dc8: e3540000 cmp r4, #0
*sig = status;
7dcc: 15840000 strne r0, [r4]
return 0;
7dd0: 13a00000 movne r0, #0
int status;
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
7dd4: 18bd8010 popne {r4, pc}
7dd8: ea000002 b 7de8 <sigwait+0x3c> <== NOT EXECUTED
*sig = status;
return 0;
}
return errno;
7ddc: eb002032 bl feac <__errno>
7de0: e5900000 ldr r0, [r0]
7de4: e8bd8010 pop {r4, pc}
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
*sig = status;
return 0;
7de8: e1a00004 mov r0, r4 <== NOT EXECUTED
}
return errno;
}
7dec: e8bd8010 pop {r4, pc} <== NOT EXECUTED
00003b48 <siproc>:
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 <siproc+0x58>
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 <siproc+0x50>
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 <rtems_semaphore_obtain>
i = iproc (c, tty);
3b78: e1a01004 mov r1, r4
3b7c: e1a00005 mov r0, r5
3b80: ebffff8b bl 39b4 <iproc>
3b84: e1a05000 mov r5, r0
rtems_semaphore_release (tty->osem);
3b88: e5940018 ldr r0, [r4, #24]
3b8c: eb000500 bl 4f94 <rtems_semaphore_release>
}
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 <iproc> <== NOT EXECUTED
00005824 <unmount>:
*/
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: eb00257d bl ee2c <strlen>
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 <rtems_filesystem_evaluate_path>
5854: e3500000 cmp r0, #0
5858: 1a000040 bne 5960 <unmount+0x13c>
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 <unmount+0x60>
rtems_filesystem_freenode( &loc );
5870: e1a00004 mov r0, r4
5874: ebfff49c bl 2aec <rtems_filesystem_freenode>
rtems_set_errno_and_return_minus_one( EACCES );
5878: eb001ff3 bl d84c <__errno>
587c: e3a0300d mov r3, #13
5880: ea000011 b 58cc <unmount+0xa8>
/*
* 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 <rtems_filesystem_freenode>
* 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 <unmount+0x148>
5890: e5933000 ldr r3, [r3]
5894: e5933014 ldr r3, [r3, #20]
5898: e1530005 cmp r3, r5
589c: 0a000008 beq 58c4 <unmount+0xa0>
/*
* 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 <unmount+0x14c>
58a4: e595102c ldr r1, [r5, #44] ; 0x2c
58a8: ebfff6b1 bl 3374 <rtems_filesystem_mount_iterate>
58ac: e3500000 cmp r0, #0
58b0: 1a000003 bne 58c4 <unmount+0xa0>
* 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 <rtems_libio_is_open_files_in_fs>
58bc: e3500001 cmp r0, #1
58c0: 1a000003 bne 58d4 <unmount+0xb0>
rtems_set_errno_and_return_minus_one( EBUSY );
58c4: eb001fe0 bl d84c <__errno>
58c8: e3a03010 mov r3, #16
58cc: e5803000 str r3, [r0]
58d0: ea000022 b 5960 <unmount+0x13c>
* 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 <unmount+0x13c>
* 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 <unmount+0x100>
if (( fs_mount_loc->ops->mount_h )( mt_entry ) != 0 )
5904: e5953014 ldr r3, [r5, #20] <== NOT EXECUTED
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 <unmount+0x13c> <== NOT EXECUTED
rtems_fatal_error_occurred( 0 );
591c: e1a00006 mov r0, r6 <== NOT EXECUTED
5920: eb0003c6 bl 6840 <rtems_fatal_error_occurred> <== 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 <unmount+0x150>
5928: e1a01004 mov r1, r4
592c: e1a02004 mov r2, r4
5930: e5960000 ldr r0, [r6]
5934: eb000242 bl 6244 <rtems_semaphore_obtain>
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
5938: e1a00005 mov r0, r5
593c: eb000487 bl 6b60 <_Chain_Extract>
}
static inline void rtems_libio_unlock( void )
{
rtems_semaphore_release( rtems_libio_semaphore );
5940: e5960000 ldr r0, [r6]
5944: eb000284 bl 635c <rtems_semaphore_release>
/*
* 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 <rtems_filesystem_freenode>
free( mt_entry );
5950: e1a00005 mov r0, r5
5954: ebfff469 bl 2b00 <free>
return 0;
5958: e1a00004 mov r0, r4
595c: ea000000 b 5964 <unmount+0x140>
*/
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}