RTEMS 4.11Annotated Report
Fri Jul 16 16:19:29 2010
00009204 <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 ) {
9204: e5903000 ldr r3, [r0]
9208: e593304c ldr r3, [r3, #76] ; 0x4c
)
{
IMFS_jnode_t *node = loc->node_access;
IMFS_fs_info_t *fs_info;
fs_info = loc->mt_entry->fs_info;
920c: e5902010 ldr r2, [r0, #16]
switch( node->type ) {
9210: e2433001 sub r3, r3, #1
)
{
IMFS_jnode_t *node = loc->node_access;
IMFS_fs_info_t *fs_info;
fs_info = loc->mt_entry->fs_info;
9214: e5922034 ldr r2, [r2, #52] ; 0x34
switch( node->type ) {
9218: e3530006 cmp r3, #6
921c: 979ff103 ldrls pc, [pc, r3, lsl #2]
9220: ea000008 b 9248 <IMFS_Set_handlers+0x44> <== NOT EXECUTED
9224: 00009270 .word 0x00009270 <== NOT EXECUTED
9228: 00009280 .word 0x00009280 <== NOT EXECUTED
922c: 00009260 .word 0x00009260 <== NOT EXECUTED
9230: 00009260 .word 0x00009260 <== NOT EXECUTED
9234: 00009250 .word 0x00009250 <== NOT EXECUTED
9238: 00009250 .word 0x00009250 <== NOT EXECUTED
923c: 00009240 .word 0x00009240 <== NOT EXECUTED
break;
case IMFS_MEMORY_FILE:
loc->handlers = fs_info->memfile_handlers;
break;
case IMFS_FIFO:
loc->handlers = fs_info->fifo_handlers;
9240: e5923010 ldr r3, [r2, #16]
9244: e5803008 str r3, [r0, #8]
break;
}
return 0;
}
9248: e3a00000 mov r0, #0
924c: e12fff1e bx lr
break;
case IMFS_LINEAR_FILE:
loc->handlers = fs_info->memfile_handlers;
break;
case IMFS_MEMORY_FILE:
loc->handlers = fs_info->memfile_handlers;
9250: e5923008 ldr r3, [r2, #8]
9254: e5803008 str r3, [r0, #8]
loc->handlers = fs_info->fifo_handlers;
break;
}
return 0;
}
9258: e3a00000 mov r0, #0
925c: e12fff1e bx lr
case IMFS_DEVICE:
loc->handlers = &IMFS_device_handlers;
break;
case IMFS_SYM_LINK:
case IMFS_HARD_LINK:
loc->handlers = &IMFS_link_handlers;
9260: e59f3028 ldr r3, [pc, #40] ; 9290 <IMFS_Set_handlers+0x8c>
9264: e5803008 str r3, [r0, #8]
loc->handlers = fs_info->fifo_handlers;
break;
}
return 0;
}
9268: e3a00000 mov r0, #0
926c: e12fff1e bx lr
IMFS_fs_info_t *fs_info;
fs_info = loc->mt_entry->fs_info;
switch( node->type ) {
case IMFS_DIRECTORY:
loc->handlers = fs_info->directory_handlers;
9270: e592300c ldr r3, [r2, #12]
9274: e5803008 str r3, [r0, #8]
loc->handlers = fs_info->fifo_handlers;
break;
}
return 0;
}
9278: e3a00000 mov r0, #0
927c: e12fff1e bx lr
switch( node->type ) {
case IMFS_DIRECTORY:
loc->handlers = fs_info->directory_handlers;
break;
case IMFS_DEVICE:
loc->handlers = &IMFS_device_handlers;
9280: e59f300c ldr r3, [pc, #12] ; 9294 <IMFS_Set_handlers+0x90>
9284: e5803008 str r3, [r0, #8]
loc->handlers = fs_info->fifo_handlers;
break;
}
return 0;
}
9288: e3a00000 mov r0, #0
928c: e12fff1e bx lr
00009080 <IMFS_create_node>:
IMFS_jnode_types_t type,
const char *name,
mode_t mode,
const IMFS_types_union *info
)
{
9080: e92d41f0 push {r4, r5, r6, r7, r8, lr}
IMFS_fs_info_t *fs_info;
/*
* MUST have a parent node to call this routine.
*/
if ( parent_loc == NULL )
9084: e3500000 cmp r0, #0
IMFS_jnode_types_t type,
const char *name,
mode_t mode,
const IMFS_types_union *info
)
{
9088: e1a04001 mov r4, r1
908c: e59d7018 ldr r7, [sp, #24]
/*
* MUST have a parent node to call this routine.
*/
if ( parent_loc == NULL )
return NULL;
9090: 01a08000 moveq r8, r0
IMFS_fs_info_t *fs_info;
/*
* MUST have a parent node to call this routine.
*/
if ( parent_loc == NULL )
9094: 0a000026 beq 9134 <IMFS_create_node+0xb4>
return NULL;
parent = parent_loc->node_access;
fs_info = parent_loc->mt_entry->fs_info;
9098: e5901010 ldr r1, [r0, #16]
/*
* Reject creation of FIFOs if support is disabled.
*/
if ( type == IMFS_FIFO &&
909c: e3540007 cmp r4, #7
* MUST have a parent node to call this routine.
*/
if ( parent_loc == NULL )
return NULL;
parent = parent_loc->node_access;
90a0: e5906000 ldr r6, [r0]
fs_info = parent_loc->mt_entry->fs_info;
90a4: e5915034 ldr r5, [r1, #52] ; 0x34
/*
* Reject creation of FIFOs if support is disabled.
*/
if ( type == IMFS_FIFO &&
90a8: 0a000023 beq 913c <IMFS_create_node+0xbc>
return NULL;
/*
* Allocate filesystem node and fill in basic information
*/
node = IMFS_allocate_node( type, name, mode & ~rtems_filesystem_umask );
90ac: e59f1108 ldr r1, [pc, #264] ; 91bc <IMFS_create_node+0x13c>
90b0: e5911000 ldr r1, [r1]
90b4: e591c02c ldr ip, [r1, #44] ; 0x2c
90b8: e1a00004 mov r0, r4
90bc: e1a01002 mov r1, r2
90c0: e1c3200c bic r2, r3, ip
90c4: ebffffce bl 9004 <IMFS_allocate_node>
if ( !node )
90c8: e2508000 subs r8, r0, #0
90cc: 0a000018 beq 9134 <IMFS_create_node+0xb4>
return NULL;
/*
* Set the type specific information
*/
switch (type) {
90d0: e2444001 sub r4, r4, #1
90d4: e3540006 cmp r4, #6
90d8: 979ff104 ldrls pc, [pc, r4, lsl #2]
90dc: ea00000c b 9114 <IMFS_create_node+0x94> <== NOT EXECUTED
90e0: 000090fc .word 0x000090fc <== NOT EXECUTED
90e4: 000091ac .word 0x000091ac <== NOT EXECUTED
90e8: 00009158 .word 0x00009158 <== NOT EXECUTED
90ec: 00009158 .word 0x00009158 <== NOT EXECUTED
90f0: 0000917c .word 0x0000917c <== NOT EXECUTED
90f4: 00009164 .word 0x00009164 <== NOT EXECUTED
90f8: 000091a0 .word 0x000091a0 <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
90fc: e2882054 add r2, r8, #84 ; 0x54
case IMFS_DIRECTORY:
rtems_chain_initialize_empty(&node->info.directory.Entries);
9100: e2883050 add r3, r8, #80 ; 0x50
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
9104: e5882050 str r2, [r8, #80] ; 0x50
the_chain->permanent_null = NULL;
9108: e3a02000 mov r2, #0
910c: e5882054 str r2, [r8, #84] ; 0x54
the_chain->last = _Chain_Head(the_chain);
9110: e5883058 str r3, [r8, #88] ; 0x58
/*
* This node MUST have a parent, so put it in that directory list.
*/
node->Parent = parent;
node->st_ino = ++fs_info->ino_count;
9114: e5953004 ldr r3, [r5, #4]
9118: e2833001 add r3, r3, #1
/*
* This node MUST have a parent, so put it in that directory list.
*/
node->Parent = parent;
911c: e5886008 str r6, [r8, #8]
9120: e2860050 add r0, r6, #80 ; 0x50
node->st_ino = ++fs_info->ino_count;
9124: e5853004 str r3, [r5, #4]
9128: e1a01008 mov r1, r8
912c: e5883038 str r3, [r8, #56] ; 0x38
9130: ebfff3a2 bl 5fc0 <_Chain_Append>
rtems_chain_append( &parent->info.directory.Entries, &node->Node );
return node;
}
9134: e1a00008 mov r0, r8
9138: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
fs_info = parent_loc->mt_entry->fs_info;
/*
* Reject creation of FIFOs if support is disabled.
*/
if ( type == IMFS_FIFO &&
913c: e5950010 ldr r0, [r5, #16]
9140: e59f1078 ldr r1, [pc, #120] ; 91c0 <IMFS_create_node+0x140>
9144: e1500001 cmp r0, r1
fs_info->fifo_handlers == &rtems_filesystem_handlers_default )
return NULL;
9148: 03a08000 moveq r8, #0
fs_info = parent_loc->mt_entry->fs_info;
/*
* Reject creation of FIFOs if support is disabled.
*/
if ( type == IMFS_FIFO &&
914c: 1affffd6 bne 90ac <IMFS_create_node+0x2c>
node->st_ino = ++fs_info->ino_count;
rtems_chain_append( &parent->info.directory.Entries, &node->Node );
return node;
}
9150: e1a00008 mov r0, r8
9154: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
case IMFS_HARD_LINK:
node->info.hard_link.link_node = info->hard_link.link_node;
break;
case IMFS_SYM_LINK:
node->info.sym_link.name = info->sym_link.name;
9158: e5973000 ldr r3, [r7]
915c: e5883050 str r3, [r8, #80] ; 0x50
break;
9160: eaffffeb b 9114 <IMFS_create_node+0x94>
node->info.device.major = info->device.major;
node->info.device.minor = info->device.minor;
break;
case IMFS_LINEAR_FILE:
node->info.linearfile.size = 0;
9164: e3a03000 mov r3, #0
9168: e3a04000 mov r4, #0
916c: e5883050 str r3, [r8, #80] ; 0x50
9170: e5884054 str r4, [r8, #84] ; 0x54
node->info.linearfile.direct = 0;
9174: e3a03000 mov r3, #0
9178: e5883058 str r3, [r8, #88] ; 0x58
case IMFS_MEMORY_FILE:
node->info.file.size = 0;
node->info.file.indirect = 0;
917c: e3a03000 mov r3, #0
case IMFS_LINEAR_FILE:
node->info.linearfile.size = 0;
node->info.linearfile.direct = 0;
case IMFS_MEMORY_FILE:
node->info.file.size = 0;
9180: e3a01000 mov r1, #0
9184: e3a02000 mov r2, #0
9188: e5881050 str r1, [r8, #80] ; 0x50
918c: e5882054 str r2, [r8, #84] ; 0x54
node->info.file.indirect = 0;
9190: e5883058 str r3, [r8, #88] ; 0x58
node->info.file.doubly_indirect = 0;
9194: e588305c str r3, [r8, #92] ; 0x5c
node->info.file.triply_indirect = 0;
9198: e5883060 str r3, [r8, #96] ; 0x60
break;
919c: eaffffdc b 9114 <IMFS_create_node+0x94>
case IMFS_FIFO:
node->info.fifo.pipe = NULL;
91a0: e3a03000 mov r3, #0
91a4: e5883050 str r3, [r8, #80] ; 0x50
break;
91a8: eaffffd9 b 9114 <IMFS_create_node+0x94>
case IMFS_SYM_LINK:
node->info.sym_link.name = info->sym_link.name;
break;
case IMFS_DEVICE:
node->info.device.major = info->device.major;
91ac: e897000c ldm r7, {r2, r3}
91b0: e5882050 str r2, [r8, #80] ; 0x50
node->info.device.minor = info->device.minor;
91b4: e5883054 str r3, [r8, #84] ; 0x54
break;
91b8: eaffffd5 b 9114 <IMFS_create_node+0x94>
0000931c <IMFS_eval_path>:
const char *pathname, /* IN */
size_t pathnamelen, /* IN */
int flags, /* IN */
rtems_filesystem_location_info_t *pathloc /* IN/OUT */
)
{
931c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
9320: e24dd044 sub sp, sp, #68 ; 0x44
/*
* This was filled in by the caller and is valid in the
* mount table.
*/
node = pathloc->node_access;
9324: e5937000 ldr r7, [r3]
const char *pathname, /* IN */
size_t pathnamelen, /* IN */
int flags, /* IN */
rtems_filesystem_location_info_t *pathloc /* IN/OUT */
)
{
9328: e88d0005 stm sp, {r0, r2}
932c: e1a08003 mov r8, r3
9330: e1a04001 mov r4, r1
int i = 0;
9334: e3a05000 mov r5, #0
9338: e28da008 add sl, sp, #8
* 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 );
933c: e59d2000 ldr r2, [sp]
9340: e1a01004 mov r1, r4
9344: e0820005 add r0, r2, r5
9348: e28d3040 add r3, sp, #64 ; 0x40
934c: e1a0200a mov r2, sl
9350: eb00020d bl 9b8c <IMFS_get_token>
pathnamelen -= len;
i += len;
if ( !pathloc->node_access )
9354: e5989000 ldr r9, [r8]
9358: e3590000 cmp r9, #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 );
935c: e1a0b000 mov fp, r0
pathnamelen -= len;
9360: e59d6040 ldr r6, [sp, #64] ; 0x40
i += len;
if ( !pathloc->node_access )
9364: 0a00004d beq 94a0 <IMFS_eval_path+0x184>
rtems_set_errno_and_return_minus_one( ENOENT );
/*
* I cannot move out of this directory without execute permission.
*/
if ( type != IMFS_NO_MORE_PATH )
9368: e3500000 cmp r0, #0
*/
while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) {
type = IMFS_get_token( &pathname[i], pathnamelen, token, &len );
pathnamelen -= len;
936c: e0664004 rsb r4, r6, r4
i += len;
9370: e0855006 add r5, r5, r6
rtems_set_errno_and_return_minus_one( ENOENT );
/*
* I cannot move out of this directory without execute permission.
*/
if ( type != IMFS_NO_MORE_PATH )
9374: 1a00000f bne 93b8 <IMFS_eval_path+0x9c>
* 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 ) {
9378: e599304c ldr r3, [r9, #76] ; 0x4c
937c: e3530001 cmp r3, #1
9380: 0a000069 beq 952c <IMFS_eval_path+0x210>
flags, pathloc );
} else {
result = IMFS_Set_handlers( pathloc );
}
} else {
result = IMFS_Set_handlers( pathloc );
9384: e1a00008 mov r0, r8
9388: ebffff9d bl 9204 <IMFS_Set_handlers>
/*
* Verify we have the correct permissions for this node.
*/
if ( !IMFS_evaluate_permission( pathloc, flags ) )
938c: e59d1004 ldr r1, [sp, #4]
flags, pathloc );
} else {
result = IMFS_Set_handlers( pathloc );
}
} else {
result = IMFS_Set_handlers( pathloc );
9390: e1a06000 mov r6, r0
/*
* Verify we have the correct permissions for this node.
*/
if ( !IMFS_evaluate_permission( pathloc, flags ) )
9394: e1a00008 mov r0, r8
9398: ebffffbe bl 9298 <IMFS_evaluate_permission>
939c: e3500000 cmp r0, #0
93a0: 1a000036 bne 9480 <IMFS_eval_path+0x164>
rtems_set_errno_and_return_minus_one( EACCES );
93a4: eb000e28 bl cc4c <__errno>
93a8: e3a0300d mov r3, #13
93ac: e5803000 str r3, [r0]
93b0: e3e06000 mvn r6, #0
93b4: ea000031 b 9480 <IMFS_eval_path+0x164>
/*
* I cannot move out of this directory without execute permission.
*/
if ( type != IMFS_NO_MORE_PATH )
if ( node->type == IMFS_DIRECTORY )
93b8: e597104c ldr r1, [r7, #76] ; 0x4c
93bc: e3510001 cmp r1, #1
93c0: 0a000031 beq 948c <IMFS_eval_path+0x170>
if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) )
rtems_set_errno_and_return_minus_one( EACCES );
node = pathloc->node_access;
switch( type ) {
93c4: e35b0003 cmp fp, #3
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;
93c8: e1a07009 mov r7, r9
switch( type ) {
93cc: 0a000006 beq 93ec <IMFS_eval_path+0xd0>
93d0: e35b0004 cmp fp, #4
93d4: 0a000025 beq 9470 <IMFS_eval_path+0x154>
93d8: e35b0002 cmp fp, #2
93dc: 0a000013 beq 9430 <IMFS_eval_path+0x114>
/*
* Evaluate all tokens until we are done or an error occurs.
*/
while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) {
93e0: e35b0004 cmp fp, #4
93e4: 1affffd4 bne 933c <IMFS_eval_path+0x20>
93e8: eaffffe2 b 9378 <IMFS_eval_path+0x5c> <== NOT EXECUTED
case IMFS_NAME:
/*
* If we are at a link follow it.
*/
if ( node->type == IMFS_HARD_LINK ) {
93ec: e599304c ldr r3, [r9, #76] ; 0x4c
93f0: e3530003 cmp r3, #3
93f4: 0a00002e beq 94b4 <IMFS_eval_path+0x198>
node = pathloc->node_access;
if ( !node )
rtems_set_errno_and_return_minus_one( ENOTDIR );
} else if ( node->type == IMFS_SYM_LINK ) {
93f8: e3530004 cmp r3, #4
93fc: 0a00006b beq 95b0 <IMFS_eval_path+0x294>
/*
* Only a directory can be decended into.
*/
if ( node->type != IMFS_DIRECTORY )
9400: e3530001 cmp r3, #1
9404: 1a00004d bne 9540 <IMFS_eval_path+0x224>
/*
* 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 ) {
9408: e597e05c ldr lr, [r7, #92] ; 0x5c
940c: e35e0000 cmp lr, #0
9410: 1a00004f bne 9554 <IMFS_eval_path+0x238>
/*
* Otherwise find the token name in the present location.
*/
node = IMFS_find_match_in_dir( node, token );
9414: e1a00007 mov r0, r7
9418: e1a0100a mov r1, sl
941c: eb0001b3 bl 9af0 <IMFS_find_match_in_dir>
if ( !node )
9420: e2507000 subs r7, r0, #0
9424: 0a00001d beq 94a0 <IMFS_eval_path+0x184>
/*
* Set the node access to the point we have found.
*/
pathloc->node_access = node;
9428: e5887000 str r7, [r8]
942c: eaffffc2 b 933c <IMFS_eval_path+0x20>
case IMFS_UP_DIR:
/*
* Am I at the root of all filesystems? (chroot'ed?)
*/
if ( pathloc->node_access == rtems_filesystem_root.node_access )
9430: e59fe19c ldr lr, [pc, #412] ; 95d4 <IMFS_eval_path+0x2b8>
9434: e59e3000 ldr r3, [lr]
9438: e5933018 ldr r3, [r3, #24]
943c: e1590003 cmp r9, r3
9440: 0affffbd beq 933c <IMFS_eval_path+0x20>
/*
* Am I at the root of this mounted filesystem?
*/
if (pathloc->node_access ==
pathloc->mt_entry->mt_fs_root.node_access) {
9444: e598e010 ldr lr, [r8, #16]
/*
* Am I at the root of this mounted filesystem?
*/
if (pathloc->node_access ==
9448: e59e301c ldr r3, [lr, #28]
944c: e1590003 cmp r9, r3
9450: 0a00001f beq 94d4 <IMFS_eval_path+0x1b8>
pathnamelen+len,
flags,pathloc);
}
} else {
if ( !node->Parent )
9454: e5997008 ldr r7, [r9, #8]
9458: e3570000 cmp r7, #0
945c: 1afffff1 bne 9428 <IMFS_eval_path+0x10c>
rtems_set_errno_and_return_minus_one( ENOENT );
9460: eb000df9 bl cc4c <__errno>
9464: e3e06000 mvn r6, #0
9468: e580b000 str fp, [r0]
946c: ea000003 b 9480 <IMFS_eval_path+0x164>
case IMFS_NO_MORE_PATH:
case IMFS_CURRENT_DIR:
break;
case IMFS_INVALID_TOKEN:
rtems_set_errno_and_return_minus_one( ENAMETOOLONG );
9470: eb000df5 bl cc4c <__errno>
9474: e3a0305b mov r3, #91 ; 0x5b
9478: e5803000 str r3, [r0]
947c: e3e06000 mvn r6, #0
if ( !IMFS_evaluate_permission( pathloc, flags ) )
rtems_set_errno_and_return_minus_one( EACCES );
return result;
}
9480: e1a00006 mov r0, r6
9484: e28dd044 add sp, sp, #68 ; 0x44
9488: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/*
* I cannot move out of this directory without execute permission.
*/
if ( type != IMFS_NO_MORE_PATH )
if ( node->type == IMFS_DIRECTORY )
if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) )
948c: e1a00008 mov r0, r8
9490: ebffff80 bl 9298 <IMFS_evaluate_permission>
9494: e3500000 cmp r0, #0
9498: 1affffc9 bne 93c4 <IMFS_eval_path+0xa8>
949c: eaffffc0 b 93a4 <IMFS_eval_path+0x88>
* Otherwise find the token name in the present location.
*/
node = IMFS_find_match_in_dir( node, token );
if ( !node )
rtems_set_errno_and_return_minus_one( ENOENT );
94a0: eb000de9 bl cc4c <__errno>
94a4: e3a03002 mov r3, #2
94a8: e5803000 str r3, [r0]
94ac: e3e06000 mvn r6, #0
94b0: eafffff2 b 9480 <IMFS_eval_path+0x164>
* If we are at a link follow it.
*/
if ( node->type == IMFS_HARD_LINK ) {
IMFS_evaluate_hard_link( pathloc, 0 );
94b4: e1a00008 mov r0, r8
94b8: e3a01000 mov r1, #0
94bc: ebffff7d bl 92b8 <IMFS_evaluate_hard_link>
node = pathloc->node_access;
94c0: e5987000 ldr r7, [r8]
if ( !node )
94c4: e3570000 cmp r7, #0
94c8: 0a00001c beq 9540 <IMFS_eval_path+0x224>
} else if ( node->type == IMFS_SYM_LINK ) {
result = IMFS_evaluate_sym_link( pathloc, 0 );
node = pathloc->node_access;
94cc: e597304c ldr r3, [r7, #76] ; 0x4c
94d0: eaffffca b 9400 <IMFS_eval_path+0xe4>
*/
if ( pathloc->node_access == rtems_filesystem_root.node_access ) {
break; /* Throw out the .. in this case */
} else {
newloc = pathloc->mt_entry->mt_point_node;
94d4: e28ee008 add lr, lr, #8
* NOTE: The behavior of stat() on a mount point appears to be questionable.
*/
if ( node->type == IMFS_DIRECTORY ) {
if ( node->info.directory.mt_fs != NULL ) {
newloc = node->info.directory.mt_fs->mt_fs_root;
94d8: e8be000f ldm lr!, {r0, r1, r2, r3}
94dc: e28d702c add r7, sp, #44 ; 0x2c
94e0: e8a7000f stmia r7!, {r0, r1, r2, r3}
*pathloc = newloc;
94e4: e28dc02c add ip, sp, #44 ; 0x2c
94e8: e8bc000f ldm ip!, {r0, r1, r2, r3}
* NOTE: The behavior of stat() on a mount point appears to be questionable.
*/
if ( node->type == IMFS_DIRECTORY ) {
if ( node->info.directory.mt_fs != NULL ) {
newloc = node->info.directory.mt_fs->mt_fs_root;
94ec: e59ec000 ldr ip, [lr]
*pathloc = newloc;
94f0: e1a0e008 mov lr, r8
94f4: e8ae000f stmia lr!, {r0, r1, r2, r3}
return (*pathloc->ops->evalpath_h)( &pathname[i-len],
94f8: 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;
94fc: e58ec000 str ip, [lr]
return (*pathloc->ops->evalpath_h)( &pathname[i-len],
9500: e0660005 rsb r0, r6, r5
* NOTE: The behavior of stat() on a mount point appears to be questionable.
*/
if ( node->type == IMFS_DIRECTORY ) {
if ( node->info.directory.mt_fs != NULL ) {
newloc = node->info.directory.mt_fs->mt_fs_root;
9504: e587c000 str ip, [r7]
*pathloc = newloc;
return (*pathloc->ops->evalpath_h)( &pathname[i-len],
9508: e0820000 add r0, r2, r0
950c: e0841006 add r1, r4, r6
9510: e598c00c ldr ip, [r8, #12]
9514: e59d2004 ldr r2, [sp, #4]
9518: e1a03008 mov r3, r8
951c: e1a0e00f mov lr, pc
9520: e59cf000 ldr pc, [ip]
9524: e1a06000 mov r6, r0
9528: eaffffd4 b 9480 <IMFS_eval_path+0x164>
*
* NOTE: The behavior of stat() on a mount point appears to be questionable.
*/
if ( node->type == IMFS_DIRECTORY ) {
if ( node->info.directory.mt_fs != NULL ) {
952c: e599e05c ldr lr, [r9, #92] ; 0x5c
9530: e35e0000 cmp lr, #0
9534: 0affff92 beq 9384 <IMFS_eval_path+0x68>
newloc = node->info.directory.mt_fs->mt_fs_root;
9538: e28ee01c add lr, lr, #28
953c: eaffffe5 b 94d8 <IMFS_eval_path+0x1bc>
/*
* Only a directory can be decended into.
*/
if ( node->type != IMFS_DIRECTORY )
rtems_set_errno_and_return_minus_one( ENOTDIR );
9540: eb000dc1 bl cc4c <__errno>
9544: e3a03014 mov r3, #20
9548: e5803000 str r3, [r0]
954c: e3e06000 mvn r6, #0
9550: eaffffca b 9480 <IMFS_eval_path+0x164>
* 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 ) {
newloc = node->info.directory.mt_fs->mt_fs_root;
9554: e28ee01c add lr, lr, #28
9558: e8be000f ldm lr!, {r0, r1, r2, r3}
955c: e28d602c add r6, sp, #44 ; 0x2c
9560: e8a6000f stmia r6!, {r0, r1, r2, r3}
*pathloc = newloc;
9564: e28dc02c add ip, sp, #44 ; 0x2c
9568: e8bc000f ldm ip!, {r0, r1, r2, r3}
* 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 ) {
newloc = node->info.directory.mt_fs->mt_fs_root;
956c: e59ec000 ldr ip, [lr]
*pathloc = newloc;
9570: e1a0e008 mov lr, r8
9574: e8ae000f stmia lr!, {r0, r1, r2, r3}
return (*pathloc->ops->evalpath_h)( &pathname[i-len],
9578: e59d1040 ldr r1, [sp, #64] ; 0x40
957c: e59d2000 ldr r2, [sp]
* 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;
9580: e58ec000 str ip, [lr]
return (*pathloc->ops->evalpath_h)( &pathname[i-len],
9584: e0610005 rsb r0, r1, r5
* 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 ) {
newloc = node->info.directory.mt_fs->mt_fs_root;
9588: e586c000 str ip, [r6]
*pathloc = newloc;
return (*pathloc->ops->evalpath_h)( &pathname[i-len],
958c: e0820000 add r0, r2, r0
9590: e598c00c ldr ip, [r8, #12]
9594: e0841001 add r1, r4, r1
9598: e59d2004 ldr r2, [sp, #4]
959c: e1a03008 mov r3, r8
95a0: e1a0e00f mov lr, pc
95a4: e59cf000 ldr pc, [ip]
95a8: e1a06000 mov r6, r0
95ac: eaffffb3 b 9480 <IMFS_eval_path+0x164>
if ( !node )
rtems_set_errno_and_return_minus_one( ENOTDIR );
} else if ( node->type == IMFS_SYM_LINK ) {
result = IMFS_evaluate_sym_link( pathloc, 0 );
95b0: e1a00008 mov r0, r8
95b4: e3a01000 mov r1, #0
95b8: eb000006 bl 95d8 <IMFS_evaluate_sym_link>
node = pathloc->node_access;
if ( result == -1 )
95bc: e3700001 cmn r0, #1
if ( !node )
rtems_set_errno_and_return_minus_one( ENOTDIR );
} else if ( node->type == IMFS_SYM_LINK ) {
result = IMFS_evaluate_sym_link( pathloc, 0 );
95c0: e1a06000 mov r6, r0
node = pathloc->node_access;
95c4: e5987000 ldr r7, [r8]
if ( result == -1 )
95c8: 0affffac beq 9480 <IMFS_eval_path+0x164>
} else if ( node->type == IMFS_SYM_LINK ) {
result = IMFS_evaluate_sym_link( pathloc, 0 );
node = pathloc->node_access;
95cc: e597304c ldr r3, [r7, #76] ; 0x4c
95d0: eaffff8a b 9400 <IMFS_eval_path+0xe4>
0000976c <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 */
)
{
976c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
9770: e24dd044 sub sp, sp, #68 ; 0x44
9774: e1a06001 mov r6, r1
/*
* This was filled in by the caller and is valid in the
* mount table.
*/
node = pathloc->node_access;
9778: e5915000 ldr r5, [r1]
int IMFS_evaluate_for_make(
const char *path, /* IN */
rtems_filesystem_location_info_t *pathloc, /* IN/OUT */
const char **name /* OUT */
)
{
977c: e88d0005 stm sp, {r0, r2}
node = pathloc->node_access;
/*
* Get the path length.
*/
pathlen = strlen( path );
9780: eb001121 bl dc0c <strlen>
const char *path, /* IN */
rtems_filesystem_location_info_t *pathloc, /* IN/OUT */
const char **name /* OUT */
)
{
int i = 0;
9784: e3a07000 mov r7, #0
node = pathloc->node_access;
/*
* Get the path length.
*/
pathlen = strlen( path );
9788: e1a04000 mov r4, r0
978c: e28da008 add sl, sp, #8
* Evaluate all tokens until we are done or an error occurs.
*/
while( !done ) {
type = IMFS_get_token( &path[i], pathlen, token, &len );
9790: e59d2000 ldr r2, [sp]
9794: e1a01004 mov r1, r4
9798: e0820007 add r0, r2, r7
979c: e28d3040 add r3, sp, #64 ; 0x40
97a0: e1a0200a mov r2, sl
97a4: eb0000f8 bl 9b8c <IMFS_get_token>
pathlen -= len;
i += len;
if ( !pathloc->node_access )
97a8: e5969000 ldr r9, [r6]
*/
while( !done ) {
type = IMFS_get_token( &path[i], pathlen, token, &len );
pathlen -= len;
97ac: e59d8040 ldr r8, [sp, #64] ; 0x40
i += len;
if ( !pathloc->node_access )
97b0: e3590000 cmp r9, #0
* Evaluate all tokens until we are done or an error occurs.
*/
while( !done ) {
type = IMFS_get_token( &path[i], pathlen, token, &len );
97b4: e1a0b000 mov fp, r0
pathlen -= len;
97b8: e0684004 rsb r4, r8, r4
i += len;
if ( !pathloc->node_access )
97bc: 0a000035 beq 9898 <IMFS_evaluate_for_make+0x12c>
/*
* I cannot move out of this directory without execute permission.
*/
if ( type != IMFS_NO_MORE_PATH )
97c0: e3500000 cmp r0, #0
97c4: 1a000006 bne 97e4 <IMFS_evaluate_for_make+0x78>
pathloc->node_access = node;
break;
case IMFS_NO_MORE_PATH:
rtems_set_errno_and_return_minus_one( EEXIST );
97c8: eb000d1f bl cc4c <__errno>
97cc: e3a03011 mov r3, #17
97d0: e5803000 str r3, [r0]
97d4: e3e05000 mvn r5, #0
if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) )
rtems_set_errno_and_return_minus_one( EACCES );
return result;
}
97d8: e1a00005 mov r0, r5
97dc: e28dd044 add sp, sp, #68 ; 0x44
97e0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/*
* I cannot move out of this directory without execute permission.
*/
if ( type != IMFS_NO_MORE_PATH )
if ( node->type == IMFS_DIRECTORY )
97e4: e595104c ldr r1, [r5, #76] ; 0x4c
97e8: e3510001 cmp r1, #1
97ec: 0a000033 beq 98c0 <IMFS_evaluate_for_make+0x154>
while( !done ) {
type = IMFS_get_token( &path[i], pathlen, token, &len );
pathlen -= len;
i += len;
97f0: e0877008 add r7, r7, r8
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;
97f4: e1a05009 mov r5, r9
switch( type ) {
97f8: e35b0004 cmp fp, #4
97fc: 979ff10b ldrls pc, [pc, fp, lsl #2]
9800: eaffffe2 b 9790 <IMFS_evaluate_for_make+0x24> <== NOT EXECUTED
9804: 000097c8 .word 0x000097c8 <== NOT EXECUTED
9808: 00009790 .word 0x00009790 <== NOT EXECUTED
980c: 00009868 .word 0x00009868 <== NOT EXECUTED
9810: 00009818 .word 0x00009818 <== NOT EXECUTED
9814: 000098ac .word 0x000098ac <== NOT EXECUTED
pathloc->node_access = node;
break;
case IMFS_NAME:
if ( node->type == IMFS_HARD_LINK ) {
9818: e599304c ldr r3, [r9, #76] ; 0x4c
981c: e3530003 cmp r3, #3
9820: 0a000075 beq 99fc <IMFS_evaluate_for_make+0x290>
result = IMFS_evaluate_link( pathloc, 0 );
if ( result == -1 )
return -1;
} else if ( node->type == IMFS_SYM_LINK ) {
9824: e3530004 cmp r3, #4
9828: 0a000073 beq 99fc <IMFS_evaluate_for_make+0x290>
if ( result == -1 )
return -1;
}
node = pathloc->node_access;
if ( !node )
982c: e3550000 cmp r5, #0
9830: 0a00005f beq 99b4 <IMFS_evaluate_for_make+0x248>
/*
* Only a directory can be decended into.
*/
if ( node->type != IMFS_DIRECTORY )
9834: e595304c ldr r3, [r5, #76] ; 0x4c
9838: e3530001 cmp r3, #1
983c: 1a00005c bne 99b4 <IMFS_evaluate_for_make+0x248>
/*
* 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 ) {
9840: e595c05c ldr ip, [r5, #92] ; 0x5c
9844: e35c0000 cmp ip, #0
9848: 1a00005e bne 99c8 <IMFS_evaluate_for_make+0x25c>
/*
* Otherwise find the token name in the present location.
*/
node = IMFS_find_match_in_dir( node, token );
984c: e1a00005 mov r0, r5
9850: e1a0100a mov r1, sl
9854: eb0000a5 bl 9af0 <IMFS_find_match_in_dir>
/*
* If there is no node we have found the name of the node we
* wish to create.
*/
if ( ! node )
9858: e2505000 subs r5, r0, #0
985c: 0a000020 beq 98e4 <IMFS_evaluate_for_make+0x178>
done = true;
else
pathloc->node_access = node;
9860: e5865000 str r5, [r6]
9864: eaffffc9 b 9790 <IMFS_evaluate_for_make+0x24>
case IMFS_UP_DIR:
/*
* Am I at the root of all filesystems? (chroot'ed?)
*/
if ( pathloc->node_access == rtems_filesystem_root.node_access )
9868: e59fe1ac ldr lr, [pc, #428] ; 9a1c <IMFS_evaluate_for_make+0x2b0>
986c: e59e3000 ldr r3, [lr]
9870: e5933018 ldr r3, [r3, #24]
9874: e1590003 cmp r9, r3
9878: 0affffc4 beq 9790 <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){
987c: e596e010 ldr lr, [r6, #16]
9880: e59e301c ldr r3, [lr, #28]
9884: e1590003 cmp r9, r3
9888: 0a000027 beq 992c <IMFS_evaluate_for_make+0x1c0>
*pathloc = newloc;
return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name );
}
} else {
if ( !node->Parent )
988c: e5995008 ldr r5, [r9, #8]
9890: e3550000 cmp r5, #0
9894: 1afffff1 bne 9860 <IMFS_evaluate_for_make+0xf4>
* Verify there is not any invalid stuff at the end of the name.
*/
for( ; path[i] != '\0'; i++) {
if ( !IMFS_is_separator( path[ i ] ) )
rtems_set_errno_and_return_minus_one( ENOENT );
9898: eb000ceb bl cc4c <__errno>
989c: e3a03002 mov r3, #2
98a0: e5803000 str r3, [r0]
98a4: e3e05000 mvn r5, #0
98a8: eaffffca b 97d8 <IMFS_evaluate_for_make+0x6c>
case IMFS_NO_MORE_PATH:
rtems_set_errno_and_return_minus_one( EEXIST );
break;
case IMFS_INVALID_TOKEN:
rtems_set_errno_and_return_minus_one( ENAMETOOLONG );
98ac: eb000ce6 bl cc4c <__errno>
98b0: e3a0305b mov r3, #91 ; 0x5b
98b4: e5803000 str r3, [r0]
98b8: e3e05000 mvn r5, #0
98bc: eaffffc5 b 97d8 <IMFS_evaluate_for_make+0x6c>
* I cannot move out of this directory without execute permission.
*/
if ( type != IMFS_NO_MORE_PATH )
if ( node->type == IMFS_DIRECTORY )
if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) )
98c0: e1a00006 mov r0, r6
98c4: ebfffe73 bl 9298 <IMFS_evaluate_permission>
98c8: e3500000 cmp r0, #0
98cc: 1affffc7 bne 97f0 <IMFS_evaluate_for_make+0x84>
/*
* We must have Write and execute permission on the returned node.
*/
if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) )
rtems_set_errno_and_return_minus_one( EACCES );
98d0: eb000cdd bl cc4c <__errno>
98d4: e3a0300d mov r3, #13
98d8: e5803000 str r3, [r0]
98dc: e3e05000 mvn r5, #0
98e0: eaffffbc b 97d8 <IMFS_evaluate_for_make+0x6c>
case IMFS_CURRENT_DIR:
break;
}
}
*name = &path[ i - len ];
98e4: e59d3040 ldr r3, [sp, #64] ; 0x40
98e8: e59de000 ldr lr, [sp]
98ec: e0633007 rsb r3, r3, r7
98f0: e59d2004 ldr r2, [sp, #4]
98f4: e08e3003 add r3, lr, r3
98f8: e5823000 str r3, [r2]
/*
* 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++) {
98fc: e7de0007 ldrb r0, [lr, r7]
9900: e3500000 cmp r0, #0
9904: e08e7007 add r7, lr, r7
9908: 1a000003 bne 991c <IMFS_evaluate_for_make+0x1b0>
990c: ea00001b b 9980 <IMFS_evaluate_for_make+0x214>
9910: e5f70001 ldrb r0, [r7, #1]!
9914: e3500000 cmp r0, #0
9918: 0a000018 beq 9980 <IMFS_evaluate_for_make+0x214>
if ( !IMFS_is_separator( path[ i ] ) )
991c: ebffe556 bl 2e7c <rtems_filesystem_is_separator>
9920: e3500000 cmp r0, #0
9924: 1afffff9 bne 9910 <IMFS_evaluate_for_make+0x1a4>
9928: eaffffda b 9898 <IMFS_evaluate_for_make+0x12c>
if ( pathloc->node_access == rtems_filesystem_root.node_access ) {
break;
} else {
newloc = pathloc->mt_entry->mt_point_node;
992c: e28ee008 add lr, lr, #8
9930: e8be000f ldm lr!, {r0, r1, r2, r3}
9934: e28d402c add r4, sp, #44 ; 0x2c
9938: e8a4000f stmia r4!, {r0, r1, r2, r3}
*pathloc = newloc;
993c: e28dc02c add ip, sp, #44 ; 0x2c
9940: e8bc000f ldm ip!, {r0, r1, r2, r3}
if ( pathloc->node_access == rtems_filesystem_root.node_access ) {
break;
} else {
newloc = pathloc->mt_entry->mt_point_node;
9944: e59ec000 ldr ip, [lr]
*pathloc = newloc;
9948: e1a0e006 mov lr, r6
994c: e8ae000f stmia lr!, {r0, r1, r2, r3}
9950: e58ec000 str ip, [lr]
return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name );
9954: e0680007 rsb r0, r8, r7
*/
if ( node->info.directory.mt_fs != NULL ) {
newloc = node->info.directory.mt_fs->mt_fs_root;
*pathloc = newloc;
return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name );
9958: e59d2000 ldr r2, [sp]
* 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 ) {
newloc = node->info.directory.mt_fs->mt_fs_root;
995c: e584c000 str ip, [r4]
*pathloc = newloc;
return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name );
9960: e0820000 add r0, r2, r0
9964: e596300c ldr r3, [r6, #12]
9968: e1a01006 mov r1, r6
996c: e59d2004 ldr r2, [sp, #4]
9970: e1a0e00f mov lr, pc
9974: e593f004 ldr pc, [r3, #4]
9978: e1a05000 mov r5, r0
997c: eaffff95 b 97d8 <IMFS_evaluate_for_make+0x6c>
/*
* Verify we can execute and write to this directory.
*/
result = IMFS_Set_handlers( pathloc );
9980: e1a00006 mov r0, r6
9984: ebfffe1e bl 9204 <IMFS_Set_handlers>
/*
* The returned node must be a directory
*/
node = pathloc->node_access;
if ( node->type != IMFS_DIRECTORY )
9988: e5963000 ldr r3, [r6]
998c: e593304c ldr r3, [r3, #76] ; 0x4c
9990: e3530001 cmp r3, #1
/*
* Verify we can execute and write to this directory.
*/
result = IMFS_Set_handlers( pathloc );
9994: e1a05000 mov r5, r0
/*
* The returned node must be a directory
*/
node = pathloc->node_access;
if ( node->type != IMFS_DIRECTORY )
9998: 1a000005 bne 99b4 <IMFS_evaluate_for_make+0x248>
/*
* We must have Write and execute permission on the returned node.
*/
if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) )
999c: e1a00006 mov r0, r6
99a0: e3a01003 mov r1, #3
99a4: ebfffe3b bl 9298 <IMFS_evaluate_permission>
99a8: e3500000 cmp r0, #0
99ac: 1affff89 bne 97d8 <IMFS_evaluate_for_make+0x6c>
99b0: eaffffc6 b 98d0 <IMFS_evaluate_for_make+0x164>
/*
* The returned node must be a directory
*/
node = pathloc->node_access;
if ( node->type != IMFS_DIRECTORY )
rtems_set_errno_and_return_minus_one( ENOTDIR );
99b4: eb000ca4 bl cc4c <__errno>
99b8: e3a03014 mov r3, #20
99bc: e5803000 str r3, [r0]
99c0: e3e05000 mvn r5, #0
99c4: eaffff83 b 97d8 <IMFS_evaluate_for_make+0x6c>
* 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 ) {
newloc = node->info.directory.mt_fs->mt_fs_root;
99c8: e28cc01c add ip, ip, #28
99cc: e8bc000f ldm ip!, {r0, r1, r2, r3}
99d0: e28d402c add r4, sp, #44 ; 0x2c
99d4: e8a4000f stmia r4!, {r0, r1, r2, r3}
*pathloc = newloc;
99d8: e28de02c add lr, sp, #44 ; 0x2c
99dc: e8be000f ldm lr!, {r0, r1, r2, r3}
99e0: e1a0e006 mov lr, r6
* 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 ) {
newloc = node->info.directory.mt_fs->mt_fs_root;
99e4: e59cc000 ldr ip, [ip]
*pathloc = newloc;
99e8: e8ae000f stmia lr!, {r0, r1, r2, r3}
return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name );
99ec: e59d0040 ldr r0, [sp, #64] ; 0x40
* 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;
99f0: e58ec000 str ip, [lr]
return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name );
99f4: e0600007 rsb r0, r0, r7
99f8: eaffffd6 b 9958 <IMFS_evaluate_for_make+0x1ec>
if ( result == -1 )
return -1;
} else if ( node->type == IMFS_SYM_LINK ) {
result = IMFS_evaluate_link( pathloc, 0 );
99fc: e1a00006 mov r0, r6
9a00: e3a01000 mov r1, #0
9a04: ebffff23 bl 9698 <IMFS_evaluate_link>
if ( result == -1 )
9a08: e3700001 cmn r0, #1
if ( result == -1 )
return -1;
} else if ( node->type == IMFS_SYM_LINK ) {
result = IMFS_evaluate_link( pathloc, 0 );
9a0c: e1a05000 mov r5, r0
if ( result == -1 )
9a10: 0affff70 beq 97d8 <IMFS_evaluate_for_make+0x6c>
9a14: e5965000 ldr r5, [r6]
9a18: eaffff83 b 982c <IMFS_evaluate_for_make+0xc0>
000092b8 <IMFS_evaluate_hard_link>:
int IMFS_evaluate_hard_link(
rtems_filesystem_location_info_t *node, /* IN/OUT */
int flags /* IN */
)
{
IMFS_jnode_t *jnode = node->node_access;
92b8: e5903000 ldr r3, [r0]
/*
* Check for things that should never happen.
*/
if ( jnode->type != IMFS_HARD_LINK )
92bc: e593204c ldr r2, [r3, #76] ; 0x4c
92c0: e3520003 cmp r2, #3
int IMFS_evaluate_hard_link(
rtems_filesystem_location_info_t *node, /* IN/OUT */
int flags /* IN */
)
{
92c4: e92d4030 push {r4, r5, lr}
92c8: e1a04000 mov r4, r0
92cc: e1a05001 mov r5, r1
/*
* Check for things that should never happen.
*/
if ( jnode->type != IMFS_HARD_LINK )
92d0: 1a00000e bne 9310 <IMFS_evaluate_hard_link+0x58>
/*
* Set the hard link value and the handlers.
*/
node->node_access = jnode->info.hard_link.link_node;
92d4: e5933050 ldr r3, [r3, #80] ; 0x50
92d8: e5803000 str r3, [r0]
IMFS_Set_handlers( node );
92dc: ebffffc8 bl 9204 <IMFS_Set_handlers>
/*
* Verify we have the correct permissions for this node.
*/
if ( !IMFS_evaluate_permission( node, flags ) )
92e0: e1a00004 mov r0, r4
92e4: e1a01005 mov r1, r5
92e8: ebffffea bl 9298 <IMFS_evaluate_permission>
92ec: e3500000 cmp r0, #0
92f0: 0a000001 beq 92fc <IMFS_evaluate_hard_link+0x44>
rtems_set_errno_and_return_minus_one( EACCES );
return result;
92f4: e3a00000 mov r0, #0
}
92f8: e8bd8030 pop {r4, r5, pc}
/*
* Verify we have the correct permissions for this node.
*/
if ( !IMFS_evaluate_permission( node, flags ) )
rtems_set_errno_and_return_minus_one( EACCES );
92fc: eb000e52 bl cc4c <__errno> <== NOT EXECUTED
9300: e3a0300d mov r3, #13 <== NOT EXECUTED
9304: e5803000 str r3, [r0] <== NOT EXECUTED
9308: e3e00000 mvn r0, #0 <== NOT EXECUTED
930c: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
/*
* Check for things that should never happen.
*/
if ( jnode->type != IMFS_HARD_LINK )
rtems_fatal_error_occurred (0xABCD0000);
9310: e3a0032b mov r0, #-1409286144 ; 0xac000000 <== NOT EXECUTED
9314: e2400833 sub r0, r0, #3342336 ; 0x330000 <== NOT EXECUTED
9318: ebfff26f bl 5cdc <rtems_fatal_error_occurred> <== NOT EXECUTED
000095d8 <IMFS_evaluate_sym_link>:
int IMFS_evaluate_sym_link(
rtems_filesystem_location_info_t *node, /* IN/OUT */
int flags /* IN */
)
{
95d8: e92d4070 push {r4, r5, r6, lr}
IMFS_jnode_t *jnode = node->node_access;
95dc: e5906000 ldr r6, [r0]
/*
* Check for things that should never happen.
*/
if ( jnode->type != IMFS_SYM_LINK )
95e0: e596304c ldr r3, [r6, #76] ; 0x4c
95e4: e3530004 cmp r3, #4
int IMFS_evaluate_sym_link(
rtems_filesystem_location_info_t *node, /* IN/OUT */
int flags /* IN */
)
{
95e8: e24dd004 sub sp, sp, #4
95ec: e1a04000 mov r4, r0
95f0: e1a05001 mov r5, r1
/*
* Check for things that should never happen.
*/
if ( jnode->type != IMFS_SYM_LINK )
95f4: 1a000024 bne 968c <IMFS_evaluate_sym_link+0xb4>
rtems_fatal_error_occurred (0xABCD0000);
if ( !jnode->Parent )
95f8: e5963008 ldr r3, [r6, #8]
95fc: e3530000 cmp r3, #0
9600: 0a00001e beq 9680 <IMFS_evaluate_sym_link+0xa8>
* root depending on the symbolic links path.
*/
node->node_access = jnode->Parent;
rtems_filesystem_get_sym_start_loc(
9604: e5960050 ldr r0, [r6, #80] ; 0x50
9608: e1a0100d mov r1, sp
960c: e1a02004 mov r2, r4
/*
* Move the node_access to either the symbolic links parent or
* root depending on the symbolic links path.
*/
node->node_access = jnode->Parent;
9610: e5843000 str r3, [r4]
rtems_filesystem_get_sym_start_loc(
9614: eb0003bf bl a518 <rtems_filesystem_get_sym_start_loc>
/*
* Use eval path to evaluate the path of the symbolic link.
*/
result = IMFS_eval_path(
9618: e59d3000 ldr r3, [sp]
961c: e5966050 ldr r6, [r6, #80] ; 0x50
9620: e0866003 add r6, r6, r3
9624: e1a00006 mov r0, r6
9628: eb001177 bl dc0c <strlen>
962c: e1a02005 mov r2, r5
9630: e1a01000 mov r1, r0
9634: e1a03004 mov r3, r4
9638: e1a00006 mov r0, r6
963c: ebffff36 bl 931c <IMFS_eval_path>
9640: e1a06000 mov r6, r0
strlen( &jnode->info.sym_link.name[i] ),
flags,
node
);
IMFS_Set_handlers( node );
9644: e1a00004 mov r0, r4
9648: ebfffeed bl 9204 <IMFS_Set_handlers>
/*
* Verify we have the correct permissions for this node.
*/
if ( !IMFS_evaluate_permission( node, flags ) )
964c: e1a00004 mov r0, r4
9650: e1a01005 mov r1, r5
9654: ebffff0f bl 9298 <IMFS_evaluate_permission>
9658: e3500000 cmp r0, #0
965c: 0a000002 beq 966c <IMFS_evaluate_sym_link+0x94>
rtems_set_errno_and_return_minus_one( EACCES );
return result;
}
9660: e1a00006 mov r0, r6
9664: e28dd004 add sp, sp, #4
9668: e8bd8070 pop {r4, r5, r6, pc}
/*
* Verify we have the correct permissions for this node.
*/
if ( !IMFS_evaluate_permission( node, flags ) )
rtems_set_errno_and_return_minus_one( EACCES );
966c: eb000d76 bl cc4c <__errno> <== NOT EXECUTED
9670: e3a0300d mov r3, #13 <== NOT EXECUTED
9674: e5803000 str r3, [r0] <== NOT EXECUTED
9678: e3e06000 mvn r6, #0 <== NOT EXECUTED
967c: eafffff7 b 9660 <IMFS_evaluate_sym_link+0x88> <== NOT EXECUTED
if ( jnode->type != IMFS_SYM_LINK )
rtems_fatal_error_occurred (0xABCD0000);
if ( !jnode->Parent )
rtems_fatal_error_occurred( 0xBAD00000 );
9680: e3a004ba mov r0, #-1174405120 ; 0xba000000 <== NOT EXECUTED
9684: e280060d add r0, r0, #13631488 ; 0xd00000 <== NOT EXECUTED
9688: ebfff193 bl 5cdc <rtems_fatal_error_occurred> <== NOT EXECUTED
/*
* Check for things that should never happen.
*/
if ( jnode->type != IMFS_SYM_LINK )
rtems_fatal_error_occurred (0xABCD0000);
968c: e3a0032b mov r0, #-1409286144 ; 0xac000000 <== NOT EXECUTED
9690: e2400833 sub r0, r0, #3342336 ; 0x330000 <== NOT EXECUTED
9694: ebfff190 bl 5cdc <rtems_fatal_error_occurred> <== NOT EXECUTED
0000242c <IMFS_fifo_close>:
}
int IMFS_fifo_close(
rtems_libio_t *iop
)
{
242c: e92d4070 push {r4, r5, r6, lr}
IMFS_jnode_t *jnode = iop->pathinfo.node_access;
2430: e5905018 ldr r5, [r0, #24]
int err = pipe_release(&JNODE2PIPE(jnode), iop);
2434: e1a01000 mov r1, r0
}
int IMFS_fifo_close(
rtems_libio_t *iop
)
{
2438: e1a04000 mov r4, r0
IMFS_jnode_t *jnode = iop->pathinfo.node_access;
int err = pipe_release(&JNODE2PIPE(jnode), iop);
243c: e2850050 add r0, r5, #80 ; 0x50
2440: eb0024e3 bl b7d4 <pipe_release>
if (err == 0) {
2444: e2506000 subs r6, r0, #0
2448: 0a000002 beq 2458 <IMFS_fifo_close+0x2c>
iop->flags &= ~LIBIO_FLAGS_OPEN;
IMFS_check_node_remove(jnode);
}
IMFS_FIFO_RETURN(err);
244c: ba000008 blt 2474 <IMFS_fifo_close+0x48> <== NOT EXECUTED
}
2450: e1a00006 mov r0, r6 <== NOT EXECUTED
2454: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
IMFS_jnode_t *jnode = iop->pathinfo.node_access;
int err = pipe_release(&JNODE2PIPE(jnode), iop);
if (err == 0) {
iop->flags &= ~LIBIO_FLAGS_OPEN;
2458: e5943014 ldr r3, [r4, #20]
245c: e3c33c01 bic r3, r3, #256 ; 0x100
IMFS_check_node_remove(jnode);
2460: e1a00005 mov r0, r5
IMFS_jnode_t *jnode = iop->pathinfo.node_access;
int err = pipe_release(&JNODE2PIPE(jnode), iop);
if (err == 0) {
iop->flags &= ~LIBIO_FLAGS_OPEN;
2464: e5843014 str r3, [r4, #20]
IMFS_check_node_remove(jnode);
2468: eb0001a0 bl 2af0 <IMFS_check_node_remove>
}
IMFS_FIFO_RETURN(err);
}
246c: e1a00006 mov r0, r6
2470: e8bd8070 pop {r4, r5, r6, pc}
if (err == 0) {
iop->flags &= ~LIBIO_FLAGS_OPEN;
IMFS_check_node_remove(jnode);
}
IMFS_FIFO_RETURN(err);
2474: eb002ff2 bl e444 <__errno> <== NOT EXECUTED
2478: e2666000 rsb r6, r6, #0 <== NOT EXECUTED
247c: e5806000 str r6, [r0] <== NOT EXECUTED
2480: e3e06000 mvn r6, #0 <== NOT EXECUTED
2484: eafffff1 b 2450 <IMFS_fifo_close+0x24> <== NOT EXECUTED
00009a20 <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
)
{
9a20: 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;
9a24: e1a0c000 mov ip, r0
9a28: 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
)
{
9a2c: e24dd014 sub sp, sp, #20
9a30: e1a0e000 mov lr, r0
* 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;
9a34: e8bc000f ldm ip!, {r0, r1, r2, r3}
9a38: e1a0600d mov r6, sp
9a3c: e8a6000f stmia r6!, {r0, r1, r2, r3}
9a40: e59c2000 ldr r2, [ip]
/*
* Set this to null to indicate that it is being unmounted.
*/
temp_mt_entry->mt_fs_root.node_access = NULL;
9a44: e3a03000 mov r3, #0
* 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;
9a48: e5862000 str r2, [r6]
/*
* Set this to null to indicate that it is being unmounted.
*/
temp_mt_entry->mt_fs_root.node_access = NULL;
9a4c: e58e301c str r3, [lr, #28]
* 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;
9a50: e1a0500d mov r5, sp
temp_mt_entry->mt_fs_root.node_access = NULL;
do {
next = jnode->Parent;
loc.node_access = (void *)jnode;
IMFS_Set_handlers( &loc );
9a54: e1a0000d mov r0, sp
*/
temp_mt_entry->mt_fs_root.node_access = NULL;
do {
next = jnode->Parent;
9a58: e5946008 ldr r6, [r4, #8]
loc.node_access = (void *)jnode;
9a5c: e58d4000 str r4, [sp]
IMFS_Set_handlers( &loc );
9a60: ebfffde7 bl 9204 <IMFS_Set_handlers>
if ( jnode->type != IMFS_DIRECTORY ) {
9a64: e594304c ldr r3, [r4, #76] ; 0x4c
9a68: e3530001 cmp r3, #1
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
9a6c: e2842054 add r2, r4, #84 ; 0x54
9a70: 1a000010 bne 9ab8 <IMFS_fsunmount+0x98>
result = IMFS_unlink( NULL, &loc );
if (result != 0)
return -1;
jnode = next;
} else if ( jnode_has_no_children( jnode ) ) {
9a74: e5943050 ldr r3, [r4, #80] ; 0x50
9a78: e1530002 cmp r3, r2
9a7c: 0a000014 beq 9ad4 <IMFS_fsunmount+0xb4>
result = IMFS_unlink( NULL, &loc );
if (result != 0)
return -1;
jnode = next;
}
if ( jnode != NULL ) {
9a80: e3540000 cmp r4, #0
9a84: 0a000008 beq 9aac <IMFS_fsunmount+0x8c>
if ( jnode->type == IMFS_DIRECTORY ) {
9a88: e594304c ldr r3, [r4, #76] ; 0x4c
9a8c: e3530001 cmp r3, #1
9a90: 1affffef bne 9a54 <IMFS_fsunmount+0x34>
if ( jnode_has_children( jnode ) )
9a94: e5943050 ldr r3, [r4, #80] ; 0x50
9a98: e2842054 add r2, r4, #84 ; 0x54
9a9c: e1530002 cmp r3, r2
9aa0: 0affffeb beq 9a54 <IMFS_fsunmount+0x34>
jnode = jnode_get_first_child( jnode );
}
}
} while (jnode != NULL);
9aa4: e2534000 subs r4, r3, #0
9aa8: 1affffe9 bne 9a54 <IMFS_fsunmount+0x34>
return 0;
9aac: e1a00004 mov r0, r4
}
9ab0: e28dd014 add sp, sp, #20
9ab4: e8bd8070 pop {r4, r5, r6, pc}
next = jnode->Parent;
loc.node_access = (void *)jnode;
IMFS_Set_handlers( &loc );
if ( jnode->type != IMFS_DIRECTORY ) {
result = IMFS_unlink( NULL, &loc );
9ab8: e1a0100d mov r1, sp
9abc: e3a00000 mov r0, #0
9ac0: ebffdfe2 bl 1a50 <IMFS_unlink>
if (result != 0)
9ac4: e3500000 cmp r0, #0
9ac8: 1a000006 bne 9ae8 <IMFS_fsunmount+0xc8>
jnode = next;
} else if ( jnode_has_no_children( jnode ) ) {
result = IMFS_unlink( NULL, &loc );
if (result != 0)
return -1;
jnode = next;
9acc: e1a04006 mov r4, r6
9ad0: eaffffea b 9a80 <IMFS_fsunmount+0x60>
result = IMFS_unlink( NULL, &loc );
if (result != 0)
return -1;
jnode = next;
} else if ( jnode_has_no_children( jnode ) ) {
result = IMFS_unlink( NULL, &loc );
9ad4: e3a00000 mov r0, #0
9ad8: e1a0100d mov r1, sp
9adc: ebffdfdb bl 1a50 <IMFS_unlink>
if (result != 0)
9ae0: e3500000 cmp r0, #0
9ae4: 0afffff8 beq 9acc <IMFS_fsunmount+0xac>
return -1;
9ae8: e3e00000 mvn r0, #0 <== NOT EXECUTED
9aec: eaffffef b 9ab0 <IMFS_fsunmount+0x90> <== NOT EXECUTED
00001610 <IMFS_initialize_support>:
IMFS_jnode_t *jnode;
/*
* determine/check value for imfs_memfile_bytes_per_block
*/
IMFS_determine_bytes_per_block(&imfs_memfile_bytes_per_block,
1610: e59fc0dc ldr ip, [pc, #220] ; 16f4 <IMFS_initialize_support+0xe4>
1614: e59cc000 ldr ip, [ip]
int bit_mask;
/*
* check, whether requested bytes per block is valid
*/
for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) {
1618: e35c0010 cmp ip, #16
const rtems_filesystem_operations_table *op_table,
const rtems_filesystem_file_handlers_r *memfile_handlers,
const rtems_filesystem_file_handlers_r *directory_handlers,
const rtems_filesystem_file_handlers_r *fifo_handlers
)
{
161c: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
1620: e1a04000 mov r4, r0
1624: e1a08001 mov r8, r1
1628: e1a0a002 mov sl, r2
162c: e1a07003 mov r7, r3
int bit_mask;
/*
* check, whether requested bytes per block is valid
*/
for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) {
1630: 0a000007 beq 1654 <IMFS_initialize_support+0x44>
1634: e3a02005 mov r2, #5
1638: e3a03020 mov r3, #32
163c: e15c0003 cmp ip, r3
1640: 0a000003 beq 1654 <IMFS_initialize_support+0x44>
1644: e2522001 subs r2, r2, #1
1648: e1a03083 lsl r3, r3, #1
164c: 1afffffa bne 163c <IMFS_initialize_support+0x2c>
is_valid = true;
}
}
*dest_bytes_per_block = ((is_valid)
? requested_bytes_per_block
: default_bytes_per_block);
1650: e3a0c080 mov ip, #128 ; 0x80 <== NOT EXECUTED
for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) {
if (bit_mask == requested_bytes_per_block) {
is_valid = true;
}
}
*dest_bytes_per_block = ((is_valid)
1654: e59f509c ldr r5, [pc, #156] ; 16f8 <IMFS_initialize_support+0xe8>
1658: e585c000 str ip, [r5]
/*
* Create the root node
*
* NOTE: UNIX root is 755 and owned by root/root (0/0).
*/
temp_mt_entry->mt_fs_root.node_access = IMFS_create_root_node();
165c: eb001ed8 bl 91c4 <IMFS_create_root_node>
temp_mt_entry->mt_fs_root.handlers = directory_handlers;
temp_mt_entry->mt_fs_root.ops = op_table;
temp_mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS;
1660: e59fe094 ldr lr, [pc, #148] ; 16fc <IMFS_initialize_support+0xec>
/*
* Create the root node
*
* NOTE: UNIX root is 755 and owned by root/root (0/0).
*/
temp_mt_entry->mt_fs_root.node_access = IMFS_create_root_node();
1664: e1a06000 mov r6, r0
temp_mt_entry->mt_fs_root.handlers = directory_handlers;
temp_mt_entry->mt_fs_root.ops = op_table;
temp_mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS;
1668: e8be000f ldm lr!, {r0, r1, r2, r3}
166c: e284c038 add ip, r4, #56 ; 0x38
1670: e8ac000f stmia ip!, {r0, r1, r2, r3}
1674: e8be000f ldm lr!, {r0, r1, r2, r3}
1678: e8ac000f stmia ip!, {r0, r1, r2, r3}
167c: e89e000f ldm lr, {r0, r1, r2, r3}
/*
* Create the root node
*
* NOTE: UNIX root is 755 and owned by root/root (0/0).
*/
temp_mt_entry->mt_fs_root.node_access = IMFS_create_root_node();
1680: e584601c str r6, [r4, #28]
temp_mt_entry->mt_fs_root.handlers = directory_handlers;
temp_mt_entry->mt_fs_root.ops = op_table;
temp_mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS;
1684: e88c000f stm ip, {r0, r1, r2, r3}
* Create the root node
*
* NOTE: UNIX root is 755 and owned by root/root (0/0).
*/
temp_mt_entry->mt_fs_root.node_access = IMFS_create_root_node();
temp_mt_entry->mt_fs_root.handlers = directory_handlers;
1688: e5847024 str r7, [r4, #36] ; 0x24
temp_mt_entry->mt_fs_root.ops = op_table;
168c: e5848028 str r8, [r4, #40] ; 0x28
temp_mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS;
/*
* Create custom file system data.
*/
fs_info = calloc( 1, sizeof( IMFS_fs_info_t ) );
1690: e3a00001 mov r0, #1
1694: e3a01014 mov r1, #20
1698: eb0001bd bl 1d94 <calloc>
if ( !fs_info ) {
169c: e3500000 cmp r0, #0
16a0: 0a00000c beq 16d8 <IMFS_initialize_support+0xc8>
/*
* Set st_ino for the root to 1.
*/
fs_info->instance = imfs_instance++;
16a4: e5952004 ldr r2, [r5, #4]
fs_info->ino_count = 1;
16a8: e3a03001 mov r3, #1
fs_info = calloc( 1, sizeof( IMFS_fs_info_t ) );
if ( !fs_info ) {
free(temp_mt_entry->mt_fs_root.node_access);
rtems_set_errno_and_return_minus_one(ENOMEM);
}
temp_mt_entry->fs_info = fs_info;
16ac: e5840034 str r0, [r4, #52] ; 0x34
/*
* Set st_ino for the root to 1.
*/
fs_info->instance = imfs_instance++;
16b0: e0821003 add r1, r2, r3
16b4: e5802000 str r2, [r0]
fs_info->ino_count = 1;
fs_info->memfile_handlers = memfile_handlers;
fs_info->directory_handlers = directory_handlers;
fs_info->fifo_handlers = fifo_handlers;
16b8: e59d201c ldr r2, [sp, #28]
/*
* Set st_ino for the root to 1.
*/
fs_info->instance = imfs_instance++;
fs_info->ino_count = 1;
16bc: e9800408 stmib r0, {r3, sl}
fs_info->memfile_handlers = memfile_handlers;
fs_info->directory_handlers = directory_handlers;
16c0: e580700c str r7, [r0, #12]
fs_info->fifo_handlers = fifo_handlers;
16c4: e5802010 str r2, [r0, #16]
/*
* Set st_ino for the root to 1.
*/
fs_info->instance = imfs_instance++;
16c8: e5851004 str r1, [r5, #4]
fs_info->memfile_handlers = memfile_handlers;
fs_info->directory_handlers = directory_handlers;
fs_info->fifo_handlers = fifo_handlers;
jnode = temp_mt_entry->mt_fs_root.node_access;
jnode->st_ino = fs_info->ino_count;
16cc: e5863038 str r3, [r6, #56] ; 0x38
return 0;
16d0: e3a00000 mov r0, #0
}
16d4: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
/*
* Create custom file system data.
*/
fs_info = calloc( 1, sizeof( IMFS_fs_info_t ) );
if ( !fs_info ) {
free(temp_mt_entry->mt_fs_root.node_access);
16d8: e1a00006 mov r0, r6 <== NOT EXECUTED
16dc: eb000238 bl 1fc4 <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENOMEM);
16e0: eb002d59 bl cc4c <__errno> <== NOT EXECUTED
16e4: e3a0300c mov r3, #12 <== NOT EXECUTED
16e8: e5803000 str r3, [r0] <== NOT EXECUTED
16ec: e3e00000 mvn r0, #0 <== NOT EXECUTED
16f0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
00001700 <IMFS_link>:
int IMFS_link(
rtems_filesystem_location_info_t *to_loc, /* IN */
rtems_filesystem_location_info_t *parent_loc, /* IN */
const char *token /* IN */
)
{
1700: e92d4070 push {r4, r5, r6, lr}
int i;
/*
* Verify this node can be linked to.
*/
info.hard_link.link_node = to_loc->node_access;
1704: e5903000 ldr r3, [r0]
if ( info.hard_link.link_node->st_nlink >= LINK_MAX )
1708: e1d303b4 ldrh r0, [r3, #52] ; 0x34
int IMFS_link(
rtems_filesystem_location_info_t *to_loc, /* IN */
rtems_filesystem_location_info_t *parent_loc, /* IN */
const char *token /* IN */
)
{
170c: e24dd048 sub sp, sp, #72 ; 0x48
/*
* Verify this node can be linked to.
*/
info.hard_link.link_node = to_loc->node_access;
if ( info.hard_link.link_node->st_nlink >= LINK_MAX )
1710: e3500007 cmp r0, #7
int IMFS_link(
rtems_filesystem_location_info_t *to_loc, /* IN */
rtems_filesystem_location_info_t *parent_loc, /* IN */
const char *token /* IN */
)
{
1714: e1a05001 mov r5, r1
1718: e1a06002 mov r6, r2
int i;
/*
* Verify this node can be linked to.
*/
info.hard_link.link_node = to_loc->node_access;
171c: e58d3028 str r3, [sp, #40] ; 0x28
if ( info.hard_link.link_node->st_nlink >= LINK_MAX )
1720: 8a00001e bhi 17a0 <IMFS_link+0xa0>
rtems_set_errno_and_return_minus_one( EMLINK );
/*
* Remove any separators at the end of the string.
*/
IMFS_get_token( token, strlen( token ), new_name, &i );
1724: e1a00002 mov r0, r2
1728: eb003137 bl dc0c <strlen>
172c: e28d4004 add r4, sp, #4
1730: e1a01000 mov r1, r0
1734: e1a02004 mov r2, r4
1738: e28d3044 add r3, sp, #68 ; 0x44
173c: e1a00006 mov r0, r6
1740: eb002111 bl 9b8c <IMFS_get_token>
* 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.
*/
new_node = IMFS_create_node(
1744: e28d2028 add r2, sp, #40 ; 0x28
1748: e3a03ca2 mov r3, #41472 ; 0xa200
174c: e58d2000 str r2, [sp]
1750: e3a01003 mov r1, #3
1754: e1a00005 mov r0, r5
1758: e1a02004 mov r2, r4
175c: e2433001 sub r3, r3, #1
1760: eb001e46 bl 9080 <IMFS_create_node>
new_name,
( S_IFLNK | ( S_IRWXU | S_IRWXG | S_IRWXO )),
&info
);
if ( !new_node )
1764: e3500000 cmp r0, #0
1768: 0a000011 beq 17b4 <IMFS_link+0xb4>
rtems_set_errno_and_return_minus_one( ENOMEM );
/*
* Increment the link count of the node being pointed to.
*/
info.hard_link.link_node->st_nlink++;
176c: e59d3028 ldr r3, [sp, #40] ; 0x28
1770: e1d323b4 ldrh r2, [r3, #52] ; 0x34
1774: e2822001 add r2, r2, #1
1778: e1c323b4 strh r2, [r3, #52] ; 0x34
IMFS_update_ctime( info.hard_link.link_node );
177c: e28d003c add r0, sp, #60 ; 0x3c
1780: e3a01000 mov r1, #0
1784: eb000237 bl 2068 <gettimeofday>
1788: e59d203c ldr r2, [sp, #60] ; 0x3c
178c: e59d3028 ldr r3, [sp, #40] ; 0x28
1790: e5832048 str r2, [r3, #72] ; 0x48
return 0;
1794: e3a00000 mov r0, #0
}
1798: e28dd048 add sp, sp, #72 ; 0x48
179c: e8bd8070 pop {r4, r5, r6, pc}
/*
* Verify this node can be linked to.
*/
info.hard_link.link_node = to_loc->node_access;
if ( info.hard_link.link_node->st_nlink >= LINK_MAX )
rtems_set_errno_and_return_minus_one( EMLINK );
17a0: eb002d29 bl cc4c <__errno>
17a4: e3a0301f mov r3, #31
17a8: e5803000 str r3, [r0]
17ac: e3e00000 mvn r0, #0
17b0: eafffff8 b 1798 <IMFS_link+0x98>
( S_IFLNK | ( S_IRWXU | S_IRWXG | S_IRWXO )),
&info
);
if ( !new_node )
rtems_set_errno_and_return_minus_one( ENOMEM );
17b4: eb002d24 bl cc4c <__errno> <== NOT EXECUTED
17b8: e3a0300c mov r3, #12 <== NOT EXECUTED
17bc: e5803000 str r3, [r0] <== NOT EXECUTED
17c0: e3e00000 mvn r0, #0 <== NOT EXECUTED
17c4: eafffff3 b 1798 <IMFS_link+0x98> <== NOT EXECUTED
0000bc0c <IMFS_memfile_extend>:
#if defined(RTEMS_DEBUG)
assert( the_jnode );
assert( the_jnode->type == IMFS_MEMORY_FILE );
#endif
if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE )
bc0c: e59f3128 ldr r3, [pc, #296] ; bd3c <IMFS_memfile_extend+0x130>
MEMFILE_STATIC int IMFS_memfile_extend(
IMFS_jnode_t *the_jnode,
off_t new_length
)
{
bc10: e92d4df0 push {r4, r5, r6, r7, r8, sl, fp, lr}
#if defined(RTEMS_DEBUG)
assert( the_jnode );
assert( the_jnode->type == IMFS_MEMORY_FILE );
#endif
if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE )
bc14: e593b000 ldr fp, [r3]
bc18: e1a0312b lsr r3, fp, #2
bc1c: e02c3393 mla ip, r3, r3, r3
bc20: e023339c mla r3, ip, r3, r3
MEMFILE_STATIC int IMFS_memfile_extend(
IMFS_jnode_t *the_jnode,
off_t new_length
)
{
bc24: e1a06002 mov r6, r2
#if defined(RTEMS_DEBUG)
assert( the_jnode );
assert( the_jnode->type == IMFS_MEMORY_FILE );
#endif
if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE )
bc28: e3a02000 mov r2, #0
bc2c: e2433001 sub r3, r3, #1
bc30: e1520006 cmp r2, r6
MEMFILE_STATIC int IMFS_memfile_extend(
IMFS_jnode_t *the_jnode,
off_t new_length
)
{
bc34: e24dd004 sub sp, sp, #4
bc38: e1a04000 mov r4, r0
bc3c: e1a08001 mov r8, r1
#if defined(RTEMS_DEBUG)
assert( the_jnode );
assert( the_jnode->type == IMFS_MEMORY_FILE );
#endif
if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE )
bc40: e003039b mul r3, fp, r3
bc44: da000034 ble bd1c <IMFS_memfile_extend+0x110>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( new_length <= the_jnode->info.file.size )
bc48: e5947054 ldr r7, [r4, #84] ; 0x54
bc4c: e1560007 cmp r6, r7
bc50: e594a050 ldr sl, [r4, #80] ; 0x50
bc54: da000027 ble bcf8 <IMFS_memfile_extend+0xec>
/*
* Calculate the number of range of blocks to allocate
*/
new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK;
bc58: e1a0cfcb asr ip, fp, #31
bc5c: e1a0300c mov r3, ip
bc60: e1a0200b mov r2, fp
bc64: e1a00008 mov r0, r8
bc68: e1a01006 mov r1, r6
bc6c: e58dc000 str ip, [sp]
bc70: eb00121e bl 104f0 <__divdi3>
old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK;
bc74: e59dc000 ldr ip, [sp]
/*
* Calculate the number of range of blocks to allocate
*/
new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK;
bc78: e1a05000 mov r5, r0
old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK;
bc7c: e1a01007 mov r1, r7
bc80: e1a0000a mov r0, sl
bc84: e1a0200b mov r2, fp
bc88: e1a0300c mov r3, ip
bc8c: eb001217 bl 104f0 <__divdi3>
/*
* Now allocate each of those blocks.
*/
for ( block=old_blocks ; block<=new_blocks ; block++ ) {
bc90: e1550000 cmp r5, r0
/*
* Calculate the number of range of blocks to allocate
*/
new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK;
old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK;
bc94: e1a0a000 mov sl, r0
/*
* Now allocate each of those blocks.
*/
for ( block=old_blocks ; block<=new_blocks ; block++ ) {
bc98: 3a00001b bcc bd0c <IMFS_memfile_extend+0x100>
bc9c: e1a07000 mov r7, r0
bca0: ea000002 b bcb0 <IMFS_memfile_extend+0xa4>
bca4: e2877001 add r7, r7, #1
bca8: e1550007 cmp r5, r7
bcac: 3a000016 bcc bd0c <IMFS_memfile_extend+0x100>
if ( IMFS_memfile_addblock( the_jnode, block ) ) {
bcb0: e1a01007 mov r1, r7
bcb4: e1a00004 mov r0, r4
bcb8: ebffff4c bl b9f0 <IMFS_memfile_addblock>
bcbc: e3500000 cmp r0, #0
bcc0: 0afffff7 beq bca4 <IMFS_memfile_extend+0x98>
bcc4: ea000003 b bcd8 <IMFS_memfile_extend+0xcc> <== NOT EXECUTED
for ( ; block>=old_blocks ; block-- ) {
IMFS_memfile_remove_block( the_jnode, block );
bcc8: e1a01007 mov r1, r7 <== NOT EXECUTED
bccc: e1a00004 mov r0, r4 <== NOT EXECUTED
* Now allocate each of those blocks.
*/
for ( block=old_blocks ; block<=new_blocks ; block++ ) {
if ( IMFS_memfile_addblock( the_jnode, block ) ) {
for ( ; block>=old_blocks ; block-- ) {
bcd0: e2477001 sub r7, r7, #1 <== NOT EXECUTED
IMFS_memfile_remove_block( the_jnode, block );
bcd4: ebffffc2 bl bbe4 <IMFS_memfile_remove_block> <== NOT EXECUTED
* Now allocate each of those blocks.
*/
for ( block=old_blocks ; block<=new_blocks ; block++ ) {
if ( IMFS_memfile_addblock( the_jnode, block ) ) {
for ( ; block>=old_blocks ; block-- ) {
bcd8: e15a0007 cmp sl, r7 <== NOT EXECUTED
bcdc: 9afffff9 bls bcc8 <IMFS_memfile_extend+0xbc> <== NOT EXECUTED
IMFS_memfile_remove_block( the_jnode, block );
}
rtems_set_errno_and_return_minus_one( ENOSPC );
bce0: eb0003d9 bl cc4c <__errno> <== NOT EXECUTED
bce4: e3a0301c mov r3, #28 <== NOT EXECUTED
bce8: e5803000 str r3, [r0] <== NOT EXECUTED
bcec: e3e00000 mvn r0, #0 <== NOT EXECUTED
* Set the new length of the file.
*/
the_jnode->info.file.size = new_length;
return 0;
}
bcf0: e28dd004 add sp, sp, #4
bcf4: e8bd8df0 pop {r4, r5, r6, r7, r8, sl, fp, pc}
#endif
if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( new_length <= the_jnode->info.file.size )
bcf8: 1a000001 bne bd04 <IMFS_memfile_extend+0xf8>
bcfc: e158000a cmp r8, sl
bd00: 8affffd4 bhi bc58 <IMFS_memfile_extend+0x4c>
return 0;
bd04: e3a00000 mov r0, #0
bd08: eafffff8 b bcf0 <IMFS_memfile_extend+0xe4>
/*
* Set the new length of the file.
*/
the_jnode->info.file.size = new_length;
bd0c: e5848050 str r8, [r4, #80] ; 0x50
bd10: e5846054 str r6, [r4, #84] ; 0x54
return 0;
bd14: e3a00000 mov r0, #0
bd18: eafffff4 b bcf0 <IMFS_memfile_extend+0xe4>
#if defined(RTEMS_DEBUG)
assert( the_jnode );
assert( the_jnode->type == IMFS_MEMORY_FILE );
#endif
if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE )
bd1c: 1a000001 bne bd28 <IMFS_memfile_extend+0x11c>
bd20: e1530001 cmp r3, r1
bd24: 8affffc7 bhi bc48 <IMFS_memfile_extend+0x3c>
rtems_set_errno_and_return_minus_one( EINVAL );
bd28: eb0003c7 bl cc4c <__errno>
bd2c: e3a03016 mov r3, #22
bd30: e5803000 str r3, [r0]
bd34: e3e00000 mvn r0, #0
bd38: eaffffec b bcf0 <IMFS_memfile_extend+0xe4>
0000b58c <IMFS_memfile_get_block_pointer>:
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
b58c: e59f31f8 ldr r3, [pc, #504] ; b78c <IMFS_memfile_get_block_pointer+0x200>
#endif
IMFS_jnode_t *the_jnode,
unsigned int block,
int malloc_it
)
{
b590: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
b594: e5934000 ldr r4, [r3]
b598: e1a04124 lsr r4, r4, #2
b59c: e2443001 sub r3, r4, #1
b5a0: e1510003 cmp r1, r3
#endif
IMFS_jnode_t *the_jnode,
unsigned int block,
int malloc_it
)
{
b5a4: e24dd004 sub sp, sp, #4
b5a8: e1a05000 mov r5, r0
b5ac: e1a06002 mov r6, r2
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
b5b0: 8a000007 bhi b5d4 <IMFS_memfile_get_block_pointer+0x48>
p = info->indirect;
if ( malloc_it ) {
b5b4: e3520000 cmp r2, #0
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
p = info->indirect;
b5b8: e5900058 ldr r0, [r0, #88] ; 0x58
if ( malloc_it ) {
b5bc: 0a00001c beq b634 <IMFS_memfile_get_block_pointer+0xa8>
if ( !p ) {
b5c0: e3500000 cmp r0, #0
b5c4: 0a000041 beq b6d0 <IMFS_memfile_get_block_pointer+0x144>
}
if ( !p )
return 0;
return &info->indirect[ my_block ];
b5c8: e0800101 add r0, r0, r1, lsl #2
/*
* This means the requested block number is out of range.
*/
return 0;
}
b5cc: e28dd004 add sp, sp, #4
b5d0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
/*
* Is the block number in the doubly indirect portion?
*/
if ( my_block <= LAST_DOUBLY_INDIRECT ) {
b5d4: e0274494 mla r7, r4, r4, r4
b5d8: e2473001 sub r3, r7, #1
b5dc: e1510003 cmp r1, r3
b5e0: 8a000016 bhi b640 <IMFS_memfile_get_block_pointer+0xb4>
#if 0
fprintf(stdout, "(d %d) ", block );
fflush(stdout);
#endif
my_block -= FIRST_DOUBLY_INDIRECT;
b5e4: e0647001 rsb r7, r4, r1
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
b5e8: e1a00007 mov r0, r7
b5ec: e1a01004 mov r1, r4
b5f0: eb00138a bl 10420 <__umodsi3>
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
b5f4: e1a01004 mov r1, r4
fflush(stdout);
#endif
my_block -= FIRST_DOUBLY_INDIRECT;
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
b5f8: e1a08000 mov r8, r0
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
b5fc: e1a00007 mov r0, r7
b600: eb001340 bl 10308 <__aeabi_uidiv>
p = info->doubly_indirect;
if ( malloc_it ) {
b604: e3560000 cmp r6, #0
#endif
my_block -= FIRST_DOUBLY_INDIRECT;
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
b608: e1a04000 mov r4, r0
p = info->doubly_indirect;
b60c: e595305c ldr r3, [r5, #92] ; 0x5c
if ( malloc_it ) {
b610: 0a00003f beq b714 <IMFS_memfile_get_block_pointer+0x188>
if ( !p ) {
b614: e3530000 cmp r3, #0
b618: 0a000045 beq b734 <IMFS_memfile_get_block_pointer+0x1a8>
if ( !p )
return 0;
info->doubly_indirect = p;
}
p1 = (block_p *)p[ doubly ];
b61c: e7930104 ldr r0, [r3, r4, lsl #2]
if ( !p1 ) {
b620: e3500000 cmp r0, #0
if ( !p )
return 0;
info->doubly_indirect = p;
}
p1 = (block_p *)p[ doubly ];
b624: e0834104 add r4, r3, r4, lsl #2
if ( !p1 ) {
b628: 0a00002f beq b6ec <IMFS_memfile_get_block_pointer+0x160>
#if 0
fprintf(stdout, "(d %d %d %d %d %p %p) ", block, my_block, doubly,
singly, p, &p[singly] );
fflush(stdout);
#endif
return (block_p *)&p[ singly ];
b62c: e0800108 add r0, r0, r8, lsl #2
b630: eaffffe5 b b5cc <IMFS_memfile_get_block_pointer+0x40>
info->indirect = p;
}
return &info->indirect[ my_block ];
}
if ( !p )
b634: e3500000 cmp r0, #0
b638: 1affffe2 bne b5c8 <IMFS_memfile_get_block_pointer+0x3c>
b63c: eaffffe2 b b5cc <IMFS_memfile_get_block_pointer+0x40> <== NOT EXECUTED
#endif
/*
* Is the block number in the triply indirect portion?
*/
if ( my_block <= LAST_TRIPLY_INDIRECT ) {
b640: e0234497 mla r3, r7, r4, r4
b644: e2433001 sub r3, r3, #1
b648: e1510003 cmp r1, r3
/*
* This means the requested block number is out of range.
*/
return 0;
b64c: 83a00000 movhi r0, #0
#endif
/*
* Is the block number in the triply indirect portion?
*/
if ( my_block <= LAST_TRIPLY_INDIRECT ) {
b650: 8affffdd bhi b5cc <IMFS_memfile_get_block_pointer+0x40>
my_block -= FIRST_TRIPLY_INDIRECT;
b654: e0677001 rsb r7, r7, r1
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
b658: e1a00007 mov r0, r7
b65c: e1a01004 mov r1, r4
b660: eb00136e bl 10420 <__umodsi3>
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
b664: e1a01004 mov r1, r4
*/
if ( my_block <= LAST_TRIPLY_INDIRECT ) {
my_block -= FIRST_TRIPLY_INDIRECT;
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
b668: e1a0a000 mov sl, r0
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
b66c: e1a00007 mov r0, r7
b670: eb001324 bl 10308 <__aeabi_uidiv>
triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS;
b674: e1a01004 mov r1, r4
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;
b678: e1a08000 mov r8, r0
triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS;
b67c: eb001321 bl 10308 <__aeabi_uidiv>
doubly %= IMFS_MEMFILE_BLOCK_SLOTS;
b680: e1a01004 mov r1, r4
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;
b684: e1a07000 mov r7, r0
doubly %= IMFS_MEMFILE_BLOCK_SLOTS;
b688: e1a00008 mov r0, r8
b68c: eb001363 bl 10420 <__umodsi3>
p = info->triply_indirect;
if ( malloc_it ) {
b690: e3560000 cmp r6, #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;
b694: e1a04000 mov r4, r0
p = info->triply_indirect;
b698: e5950060 ldr r0, [r5, #96] ; 0x60
if ( malloc_it ) {
b69c: 0a000029 beq b748 <IMFS_memfile_get_block_pointer+0x1bc>
if ( !p ) {
b6a0: e3500000 cmp r0, #0
b6a4: 0a000033 beq b778 <IMFS_memfile_get_block_pointer+0x1ec>
if ( !p )
return 0;
info->triply_indirect = p;
}
p1 = (block_p *) p[ triply ];
b6a8: e7903107 ldr r3, [r0, r7, lsl #2]
if ( !p1 ) {
b6ac: e3530000 cmp r3, #0
if ( !p )
return 0;
info->triply_indirect = p;
}
p1 = (block_p *) p[ triply ];
b6b0: e0807107 add r7, r0, r7, lsl #2
if ( !p1 ) {
b6b4: 0a00002a beq b764 <IMFS_memfile_get_block_pointer+0x1d8>
if ( !p1 )
return 0;
p[ triply ] = (block_p) p1;
}
p2 = (block_p *)p1[ doubly ];
b6b8: e7930104 ldr r0, [r3, r4, lsl #2]
if ( !p2 ) {
b6bc: e3500000 cmp r0, #0
if ( !p1 )
return 0;
p[ triply ] = (block_p) p1;
}
p2 = (block_p *)p1[ doubly ];
b6c0: e0834104 add r4, r3, r4, lsl #2
if ( !p2 ) {
b6c4: 0a00000d beq b700 <IMFS_memfile_get_block_pointer+0x174>
p2 = (block_p *)p1[ doubly ];
if ( !p )
return 0;
return (block_p *)&p2[ singly ];
b6c8: e080010a add r0, r0, sl, lsl #2
b6cc: eaffffbe b b5cc <IMFS_memfile_get_block_pointer+0x40>
p = info->indirect;
if ( malloc_it ) {
if ( !p ) {
p = memfile_alloc_block();
b6d0: e58d1000 str r1, [sp]
b6d4: ebffff9f bl b558 <memfile_alloc_block>
if ( !p )
b6d8: e3500000 cmp r0, #0
b6dc: e59d1000 ldr r1, [sp]
return 0;
info->indirect = p;
b6e0: 15850058 strne r0, [r5, #88] ; 0x58
if ( malloc_it ) {
if ( !p ) {
p = memfile_alloc_block();
if ( !p )
b6e4: 1affffb7 bne b5c8 <IMFS_memfile_get_block_pointer+0x3c>
b6e8: eaffffb7 b b5cc <IMFS_memfile_get_block_pointer+0x40> <== NOT EXECUTED
info->doubly_indirect = p;
}
p1 = (block_p *)p[ doubly ];
if ( !p1 ) {
p1 = memfile_alloc_block();
b6ec: ebffff99 bl b558 <memfile_alloc_block>
if ( !p1 )
b6f0: e3500000 cmp r0, #0
return 0;
p[ doubly ] = (block_p) p1;
b6f4: 15840000 strne r0, [r4]
#if 0
fprintf(stdout, "(d %d %d %d %d %p %p) ", block, my_block, doubly,
singly, p, &p[singly] );
fflush(stdout);
#endif
return (block_p *)&p[ singly ];
b6f8: 10800108 addne r0, r0, r8, lsl #2
b6fc: eaffffb2 b b5cc <IMFS_memfile_get_block_pointer+0x40>
p[ triply ] = (block_p) p1;
}
p2 = (block_p *)p1[ doubly ];
if ( !p2 ) {
p2 = memfile_alloc_block();
b700: ebffff94 bl b558 <memfile_alloc_block>
if ( !p2 )
b704: e3500000 cmp r0, #0
return 0;
p1[ doubly ] = (block_p) p2;
b708: 15840000 strne r0, [r4]
p2 = (block_p *)p1[ doubly ];
if ( !p )
return 0;
return (block_p *)&p2[ singly ];
b70c: 1080010a addne r0, r0, sl, lsl #2
b710: eaffffad b b5cc <IMFS_memfile_get_block_pointer+0x40>
}
return (block_p *)&p1[ singly ];
}
if ( !p )
b714: e3530000 cmp r3, #0
b718: 1a000001 bne b724 <IMFS_memfile_get_block_pointer+0x198>
p1 = (block_p *) p[ triply ];
if ( !p1 ) {
p1 = memfile_alloc_block();
if ( !p1 )
return 0;
b71c: e1a00003 mov r0, r3 <== NOT EXECUTED
b720: eaffffa9 b b5cc <IMFS_memfile_get_block_pointer+0x40> <== NOT EXECUTED
}
if ( !p )
return 0;
p = (block_p *)p[ doubly ];
b724: e7930100 ldr r0, [r3, r0, lsl #2]
if ( !p )
b728: e3500000 cmp r0, #0
#if 0
fprintf(stdout, "(d %d %d %d %d %p %p) ", block, my_block, doubly,
singly, p, &p[singly] );
fflush(stdout);
#endif
return (block_p *)&p[ singly ];
b72c: 10800108 addne r0, r0, r8, lsl #2
b730: eaffffa5 b b5cc <IMFS_memfile_get_block_pointer+0x40>
p = info->doubly_indirect;
if ( malloc_it ) {
if ( !p ) {
p = memfile_alloc_block();
b734: ebffff87 bl b558 <memfile_alloc_block>
if ( !p )
b738: e2503000 subs r3, r0, #0
b73c: 0afffff6 beq b71c <IMFS_memfile_get_block_pointer+0x190>
return 0;
info->doubly_indirect = p;
b740: e585305c str r3, [r5, #92] ; 0x5c
b744: eaffffb4 b b61c <IMFS_memfile_get_block_pointer+0x90>
p1[ doubly ] = (block_p) p2;
}
return (block_p *)&p2[ singly ];
}
if ( !p )
b748: e3500000 cmp r0, #0
b74c: 0affff9e beq b5cc <IMFS_memfile_get_block_pointer+0x40>
#if 0
fprintf(stdout, "(t %d %d %d %d %d) ", block, my_block, triply, doubly, singly );
fflush(stdout);
#endif
p1 = (block_p *) p[ triply ];
b750: e7900107 ldr r0, [r0, r7, lsl #2]
if ( !p1 )
b754: e3500000 cmp r0, #0
p2 = (block_p *)p1[ doubly ];
if ( !p )
return 0;
return (block_p *)&p2[ singly ];
b758: 17900104 ldrne r0, [r0, r4, lsl #2]
b75c: 1080010a addne r0, r0, sl, lsl #2
b760: eaffff99 b b5cc <IMFS_memfile_get_block_pointer+0x40>
info->triply_indirect = p;
}
p1 = (block_p *) p[ triply ];
if ( !p1 ) {
p1 = memfile_alloc_block();
b764: ebffff7b bl b558 <memfile_alloc_block>
if ( !p1 )
b768: e2503000 subs r3, r0, #0
b76c: 0affffea beq b71c <IMFS_memfile_get_block_pointer+0x190>
return 0;
p[ triply ] = (block_p) p1;
b770: e5873000 str r3, [r7]
b774: eaffffcf b b6b8 <IMFS_memfile_get_block_pointer+0x12c>
p = info->triply_indirect;
if ( malloc_it ) {
if ( !p ) {
p = memfile_alloc_block();
b778: ebffff76 bl b558 <memfile_alloc_block>
if ( !p )
b77c: e3500000 cmp r0, #0
b780: 0affff91 beq b5cc <IMFS_memfile_get_block_pointer+0x40>
return 0;
info->triply_indirect = p;
b784: e5850060 str r0, [r5, #96] ; 0x60
b788: eaffffc6 b b6a8 <IMFS_memfile_get_block_pointer+0x11c>
0000b790 <IMFS_memfile_read>:
IMFS_jnode_t *the_jnode,
off_t start,
unsigned char *destination,
unsigned int length
)
{
b790: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
/*
* Error checks on arguments
*/
if ( !dest )
b794: e253b000 subs fp, r3, #0
IMFS_jnode_t *the_jnode,
off_t start,
unsigned char *destination,
unsigned int length
)
{
b798: e24dd014 sub sp, sp, #20
b79c: e1a09000 mov r9, r0
b7a0: e1a07001 mov r7, r1
b7a4: e1a08002 mov r8, r2
b7a8: e59d5038 ldr r5, [sp, #56] ; 0x38
/*
* Error checks on arguments
*/
if ( !dest )
b7ac: 0a00007c beq b9a4 <IMFS_memfile_read+0x214>
/*
* If there is nothing to read, then quick exit.
*/
my_length = length;
if ( !my_length )
b7b0: e3550000 cmp r5, #0
b7b4: 0a00007a beq b9a4 <IMFS_memfile_read+0x214>
/*
* Linear files (as created from a tar file are easier to handle
* than block files).
*/
if (the_jnode->type == IMFS_LINEAR_FILE) {
b7b8: e590304c ldr r3, [r0, #76] ; 0x4c
b7bc: e3530006 cmp r3, #6
b7c0: 0a00005c beq b938 <IMFS_memfile_read+0x1a8>
* If the last byte we are supposed to read is past the end of this
* in memory file, then shorten the length to read.
*/
last_byte = start + length;
if ( last_byte > the_jnode->info.file.size )
b7c4: e5902054 ldr r2, [r0, #84] ; 0x54
/*
* If the last byte we are supposed to read is past the end of this
* in memory file, then shorten the length to read.
*/
last_byte = start + length;
b7c8: e1a03001 mov r3, r1
if ( last_byte > the_jnode->info.file.size )
b7cc: e3a01000 mov r1, #0
b7d0: e1510002 cmp r1, r2
b7d4: e5902050 ldr r2, [r0, #80] ; 0x50
/*
* If the last byte we are supposed to read is past the end of this
* in memory file, then shorten the length to read.
*/
last_byte = start + length;
b7d8: e0851007 add r1, r5, r7
if ( last_byte > the_jnode->info.file.size )
b7dc: da00003d ble b8d8 <IMFS_memfile_read+0x148>
my_length = the_jnode->info.file.size - start;
b7e0: e0635002 rsb r5, r3, r2
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
b7e4: e59f61cc ldr r6, [pc, #460] ; b9b8 <IMFS_memfile_read+0x228>
b7e8: e5964000 ldr r4, [r6]
b7ec: e1a00007 mov r0, r7
b7f0: e1a02004 mov r2, r4
b7f4: e1a03fc2 asr r3, r2, #31
b7f8: e1a01008 mov r1, r8
b7fc: e98d000c stmib sp, {r2, r3}
b800: eb001474 bl 109d8 <__moddi3>
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
b804: e1a01008 mov r1, r8
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
b808: e1a0a000 mov sl, r0
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
b80c: e99d000c ldmib sp, {r2, r3}
b810: e1a00007 mov r0, r7
b814: eb001335 bl 104f0 <__divdi3>
if ( start_offset ) {
b818: e35a0000 cmp sl, #0
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
b81c: e1a07000 mov r7, r0
if ( start_offset ) {
b820: 01a0800b moveq r8, fp
b824: 0a000014 beq b87c <IMFS_memfile_read+0xec>
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset;
if ( to_copy > my_length )
to_copy = my_length;
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
b828: e1a00009 mov r0, r9
b82c: e1a01007 mov r1, r7
b830: e3a02000 mov r2, #0
b834: ebffff54 bl b58c <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
b838: e3500000 cmp r0, #0
b83c: 0a000023 beq b8d0 <IMFS_memfile_read+0x140>
return copied;
memcpy( dest, &(*block_ptr)[ start_offset ], to_copy );
b840: e5901000 ldr r1, [r0]
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
if ( start_offset ) {
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset;
b844: e06a3004 rsb r3, sl, r4
b848: e1550003 cmp r5, r3
b84c: 31a03005 movcc r3, r5
if ( to_copy > my_length )
to_copy = my_length;
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
return copied;
memcpy( dest, &(*block_ptr)[ start_offset ], to_copy );
b850: e081100a add r1, r1, sl
b854: e1a02003 mov r2, r3
b858: e1a0000b mov r0, fp
b85c: e58d3000 str r3, [sp]
b860: eb000727 bl d504 <memcpy>
dest += to_copy;
b864: e59d3000 ldr r3, [sp]
block++;
my_length -= to_copy;
b868: e5964000 ldr r4, [r6]
to_copy = my_length;
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
return copied;
memcpy( dest, &(*block_ptr)[ start_offset ], to_copy );
dest += to_copy;
b86c: e08b8003 add r8, fp, r3
block++;
b870: e2877001 add r7, r7, #1
my_length -= to_copy;
b874: e0635005 rsb r5, r3, r5
copied += to_copy;
b878: e1a0a003 mov sl, r3
/*
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
b87c: e1550004 cmp r5, r4
b880: 2a000008 bcs b8a8 <IMFS_memfile_read+0x118>
b884: ea000017 b b8e8 <IMFS_memfile_read+0x158>
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], to_copy );
b888: e5931000 ldr r1, [r3]
b88c: eb00071c bl d504 <memcpy>
/*
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
b890: e5963000 ldr r3, [r6]
b894: e1530005 cmp r3, r5
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], to_copy );
dest += to_copy;
b898: e0888004 add r8, r8, r4
block++;
b89c: e2877001 add r7, r7, #1
my_length -= to_copy;
copied += to_copy;
b8a0: e08aa004 add sl, sl, r4
/*
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
b8a4: 8a00000f bhi b8e8 <IMFS_memfile_read+0x158>
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
b8a8: e3a02000 mov r2, #0
b8ac: e1a01007 mov r1, r7
b8b0: e1a00009 mov r0, r9
b8b4: ebffff34 bl b58c <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
b8b8: e2503000 subs r3, r0, #0
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], to_copy );
b8bc: e1a02004 mov r2, r4
dest += to_copy;
block++;
my_length -= to_copy;
b8c0: e0645005 rsb r5, r4, r5
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], to_copy );
b8c4: e1a00008 mov r0, r8
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
b8c8: 1affffee bne b888 <IMFS_memfile_read+0xf8>
#endif
if ( my_length ) {
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
return copied;
b8cc: e1a0000a mov r0, sl <== NOT EXECUTED
}
IMFS_update_atime( the_jnode );
return copied;
}
b8d0: e28dd014 add sp, sp, #20
b8d4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* If the last byte we are supposed to read is past the end of this
* in memory file, then shorten the length to read.
*/
last_byte = start + length;
if ( last_byte > the_jnode->info.file.size )
b8d8: 1affffc1 bne b7e4 <IMFS_memfile_read+0x54>
b8dc: e1510002 cmp r1, r2
b8e0: 9affffbf bls b7e4 <IMFS_memfile_read+0x54>
b8e4: eaffffbd b b7e0 <IMFS_memfile_read+0x50>
#if defined(RTEMS_DEBUG)
assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK );
#endif
if ( my_length ) {
b8e8: e3550000 cmp r5, #0
b8ec: 0a00000a beq b91c <IMFS_memfile_read+0x18c>
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
b8f0: e1a00009 mov r0, r9
b8f4: e1a01007 mov r1, r7
b8f8: e3a02000 mov r2, #0
b8fc: ebffff22 bl b58c <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
b900: e2503000 subs r3, r0, #0
b904: 0afffff0 beq b8cc <IMFS_memfile_read+0x13c>
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], my_length );
b908: e1a00008 mov r0, r8
b90c: e5931000 ldr r1, [r3]
b910: e1a02005 mov r2, r5
b914: eb0006fa bl d504 <memcpy>
copied += my_length;
b918: e08aa005 add sl, sl, r5
}
IMFS_update_atime( the_jnode );
b91c: e28d000c add r0, sp, #12
b920: e3a01000 mov r1, #0
b924: ebffd9cf bl 2068 <gettimeofday>
b928: e59d300c ldr r3, [sp, #12]
return copied;
b92c: e1a0000a mov r0, sl
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], my_length );
copied += my_length;
}
IMFS_update_atime( the_jnode );
b930: e5893040 str r3, [r9, #64] ; 0x40
return copied;
b934: eaffffe5 b b8d0 <IMFS_memfile_read+0x140>
if (the_jnode->type == IMFS_LINEAR_FILE) {
unsigned char *file_ptr;
file_ptr = (unsigned char *)the_jnode->info.linearfile.direct;
if (my_length > (the_jnode->info.linearfile.size - start))
b938: e2804050 add r4, r0, #80 ; 0x50
b93c: e8940018 ldm r4, {r3, r4}
b940: e1a00003 mov r0, r3
b944: e1a01004 mov r1, r4
b948: e3a02000 mov r2, #0
b94c: e0500007 subs r0, r0, r7
b950: e0c11008 sbc r1, r1, r8
b954: e1520001 cmp r2, r1
* than block files).
*/
if (the_jnode->type == IMFS_LINEAR_FILE) {
unsigned char *file_ptr;
file_ptr = (unsigned char *)the_jnode->info.linearfile.direct;
b958: e5992058 ldr r2, [r9, #88] ; 0x58
if (my_length > (the_jnode->info.linearfile.size - start))
b95c: da00000b ble b990 <IMFS_memfile_read+0x200>
my_length = the_jnode->info.linearfile.size - start;
b960: e067a003 rsb sl, r7, r3
memcpy(dest, &file_ptr[start], my_length);
b964: e0821007 add r1, r2, r7
b968: e1a0000b mov r0, fp
b96c: e1a0200a mov r2, sl
b970: eb0006e3 bl d504 <memcpy>
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], my_length );
copied += my_length;
}
IMFS_update_atime( the_jnode );
b974: e28d000c add r0, sp, #12
b978: e3a01000 mov r1, #0
b97c: ebffd9b9 bl 2068 <gettimeofday>
b980: e59d300c ldr r3, [sp, #12]
return copied;
b984: e1a0000a mov r0, sl
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], my_length );
copied += my_length;
}
IMFS_update_atime( the_jnode );
b988: e5893040 str r3, [r9, #64] ; 0x40
b98c: eaffffcf b b8d0 <IMFS_memfile_read+0x140>
if (the_jnode->type == IMFS_LINEAR_FILE) {
unsigned char *file_ptr;
file_ptr = (unsigned char *)the_jnode->info.linearfile.direct;
if (my_length > (the_jnode->info.linearfile.size - start))
b990: 1a000001 bne b99c <IMFS_memfile_read+0x20c>
b994: e1550000 cmp r5, r0
b998: 8afffff0 bhi b960 <IMFS_memfile_read+0x1d0>
b99c: e1a0a005 mov sl, r5 <== NOT EXECUTED
b9a0: eaffffef b b964 <IMFS_memfile_read+0x1d4> <== NOT EXECUTED
* If there is nothing to read, then quick exit.
*/
my_length = length;
if ( !my_length )
rtems_set_errno_and_return_minus_one( EINVAL );
b9a4: eb0004a8 bl cc4c <__errno> <== NOT EXECUTED
b9a8: e3a03016 mov r3, #22 <== NOT EXECUTED
b9ac: e5803000 str r3, [r0] <== NOT EXECUTED
b9b0: e3e00000 mvn r0, #0 <== NOT EXECUTED
b9b4: eaffffc5 b b8d0 <IMFS_memfile_read+0x140> <== NOT EXECUTED
0000baa4 <IMFS_memfile_remove>:
*/
int IMFS_memfile_remove(
IMFS_jnode_t *the_jnode
)
{
baa4: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
/*
* Eventually this could be set smarter at each call to
* memfile_free_blocks_in_table to greatly speed this up.
*/
to_free = IMFS_MEMFILE_BLOCK_SLOTS;
baa8: e59f6130 ldr r6, [pc, #304] ; bbe0 <IMFS_memfile_remove+0x13c>
* + triply indirect
*/
info = &the_jnode->info.file;
if ( info->indirect ) {
baac: e5903058 ldr r3, [r0, #88] ; 0x58
/*
* Eventually this could be set smarter at each call to
* memfile_free_blocks_in_table to greatly speed this up.
*/
to_free = IMFS_MEMFILE_BLOCK_SLOTS;
bab0: e5967000 ldr r7, [r6]
* + triply indirect
*/
info = &the_jnode->info.file;
if ( info->indirect ) {
bab4: e3530000 cmp r3, #0
*/
int IMFS_memfile_remove(
IMFS_jnode_t *the_jnode
)
{
bab8: e1a0a000 mov sl, r0
/*
* Eventually this could be set smarter at each call to
* memfile_free_blocks_in_table to greatly speed this up.
*/
to_free = IMFS_MEMFILE_BLOCK_SLOTS;
babc: e1a07127 lsr r7, r7, #2
*/
info = &the_jnode->info.file;
if ( info->indirect ) {
memfile_free_blocks_in_table( &info->indirect, to_free );
bac0: 12800058 addne r0, r0, #88 ; 0x58
bac4: 11a01007 movne r1, r7
bac8: 1bffffde blne ba48 <memfile_free_blocks_in_table>
}
if ( info->doubly_indirect ) {
bacc: e59a305c ldr r3, [sl, #92] ; 0x5c
bad0: e3530000 cmp r3, #0
bad4: 0a000014 beq bb2c <IMFS_memfile_remove+0x88>
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
bad8: e5962000 ldr r2, [r6] <== NOT EXECUTED
badc: e1b02122 lsrs r2, r2, #2 <== NOT EXECUTED
bae0: 0a00000e beq bb20 <IMFS_memfile_remove+0x7c> <== NOT EXECUTED
bae4: e3a02000 mov r2, #0 <== NOT EXECUTED
bae8: e1a04002 mov r4, r2 <== NOT EXECUTED
baec: ea000000 b baf4 <IMFS_memfile_remove+0x50> <== NOT EXECUTED
baf0: e59a305c ldr r3, [sl, #92] ; 0x5c <== NOT EXECUTED
if ( info->doubly_indirect[i] ) {
baf4: e7931102 ldr r1, [r3, r2, lsl #2] <== NOT EXECUTED
baf8: e1a02102 lsl r2, r2, #2 <== NOT EXECUTED
bafc: e3510000 cmp r1, #0 <== NOT EXECUTED
memfile_free_blocks_in_table( &info->indirect, to_free );
}
if ( info->doubly_indirect ) {
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
bb00: e2844001 add r4, r4, #1 <== NOT EXECUTED
if ( info->doubly_indirect[i] ) {
memfile_free_blocks_in_table(
bb04: e1a01007 mov r1, r7 <== NOT EXECUTED
bb08: e0830002 add r0, r3, r2 <== NOT EXECUTED
bb0c: 1bffffcd blne ba48 <memfile_free_blocks_in_table> <== NOT EXECUTED
memfile_free_blocks_in_table( &info->indirect, to_free );
}
if ( info->doubly_indirect ) {
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
bb10: e5963000 ldr r3, [r6] <== NOT EXECUTED
bb14: e1540123 cmp r4, r3, lsr #2 <== NOT EXECUTED
bb18: e1a02004 mov r2, r4 <== NOT EXECUTED
bb1c: 3afffff3 bcc baf0 <IMFS_memfile_remove+0x4c> <== NOT EXECUTED
if ( info->doubly_indirect[i] ) {
memfile_free_blocks_in_table(
(block_p **)&info->doubly_indirect[i], to_free );
}
}
memfile_free_blocks_in_table( &info->doubly_indirect, to_free );
bb20: e28a005c add r0, sl, #92 ; 0x5c <== NOT EXECUTED
bb24: e1a01007 mov r1, r7 <== NOT EXECUTED
bb28: ebffffc6 bl ba48 <memfile_free_blocks_in_table> <== NOT EXECUTED
}
if ( info->triply_indirect ) {
bb2c: e59a0060 ldr r0, [sl, #96] ; 0x60
bb30: e3500000 cmp r0, #0
bb34: 0a000027 beq bbd8 <IMFS_memfile_remove+0x134>
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
bb38: e5963000 ldr r3, [r6] <== NOT EXECUTED
bb3c: e1b03123 lsrs r3, r3, #2 <== NOT EXECUTED
bb40: 0a000021 beq bbcc <IMFS_memfile_remove+0x128> <== NOT EXECUTED
p = (block_p *) info->triply_indirect[i];
bb44: e5905000 ldr r5, [r0] <== NOT EXECUTED
if ( !p ) /* ensure we have a valid pointer */
bb48: e3550000 cmp r5, #0 <== NOT EXECUTED
}
if ( info->triply_indirect ) {
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
p = (block_p *) info->triply_indirect[i];
bb4c: 13a09000 movne r9, #0 <== NOT EXECUTED
if ( !p ) /* ensure we have a valid pointer */
bb50: 11a08009 movne r8, r9 <== NOT EXECUTED
bb54: 0a00001c beq bbcc <IMFS_memfile_remove+0x128> <== NOT EXECUTED
break;
for ( j=0 ; j<IMFS_MEMFILE_BLOCK_SLOTS ; j++ ) {
bb58: e3530000 cmp r3, #0 <== NOT EXECUTED
bb5c: 0a00000d beq bb98 <IMFS_memfile_remove+0xf4> <== NOT EXECUTED
bb60: e3a00000 mov r0, #0 <== NOT EXECUTED
bb64: e1a04000 mov r4, r0 <== NOT EXECUTED
if ( p[j] ) {
bb68: e7953100 ldr r3, [r5, r0, lsl #2] <== NOT EXECUTED
bb6c: e1a00100 lsl r0, r0, #2 <== NOT EXECUTED
bb70: e3530000 cmp r3, #0 <== NOT EXECUTED
if ( info->triply_indirect ) {
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
p = (block_p *) info->triply_indirect[i];
if ( !p ) /* ensure we have a valid pointer */
break;
for ( j=0 ; j<IMFS_MEMFILE_BLOCK_SLOTS ; j++ ) {
bb74: e2844001 add r4, r4, #1 <== NOT EXECUTED
if ( p[j] ) {
memfile_free_blocks_in_table( (block_p **)&p[j], to_free);
bb78: e1a01007 mov r1, r7 <== NOT EXECUTED
bb7c: e0850000 add r0, r5, r0 <== NOT EXECUTED
bb80: 1bffffb0 blne ba48 <memfile_free_blocks_in_table> <== NOT EXECUTED
if ( info->triply_indirect ) {
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
p = (block_p *) info->triply_indirect[i];
if ( !p ) /* ensure we have a valid pointer */
break;
for ( j=0 ; j<IMFS_MEMFILE_BLOCK_SLOTS ; j++ ) {
bb84: e5963000 ldr r3, [r6] <== NOT EXECUTED
bb88: e1540123 cmp r4, r3, lsr #2 <== NOT EXECUTED
bb8c: e1a00004 mov r0, r4 <== NOT EXECUTED
bb90: 3afffff4 bcc bb68 <IMFS_memfile_remove+0xc4> <== NOT EXECUTED
bb94: e59a0060 ldr r0, [sl, #96] ; 0x60 <== NOT EXECUTED
if ( p[j] ) {
memfile_free_blocks_in_table( (block_p **)&p[j], to_free);
}
}
memfile_free_blocks_in_table(
bb98: e0800009 add r0, r0, r9 <== NOT EXECUTED
bb9c: e1a01007 mov r1, r7 <== NOT EXECUTED
bba0: ebffffa8 bl ba48 <memfile_free_blocks_in_table> <== NOT EXECUTED
memfile_free_blocks_in_table( &info->doubly_indirect, to_free );
}
if ( info->triply_indirect ) {
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
bba4: e5963000 ldr r3, [r6] <== NOT EXECUTED
bba8: e2888001 add r8, r8, #1 <== NOT EXECUTED
bbac: e1a03123 lsr r3, r3, #2 <== NOT EXECUTED
bbb0: e1530008 cmp r3, r8 <== NOT EXECUTED
bbb4: 9a000004 bls bbcc <IMFS_memfile_remove+0x128> <== NOT EXECUTED
p = (block_p *) info->triply_indirect[i];
bbb8: e59a0060 ldr r0, [sl, #96] ; 0x60 <== NOT EXECUTED
bbbc: e7905108 ldr r5, [r0, r8, lsl #2] <== NOT EXECUTED
if ( !p ) /* ensure we have a valid pointer */
bbc0: e3550000 cmp r5, #0 <== NOT EXECUTED
bbc4: e1a09108 lsl r9, r8, #2 <== NOT EXECUTED
bbc8: 1affffe2 bne bb58 <IMFS_memfile_remove+0xb4> <== NOT EXECUTED
}
}
memfile_free_blocks_in_table(
(block_p **)&info->triply_indirect[i], to_free );
}
memfile_free_blocks_in_table(
bbcc: e28a0060 add r0, sl, #96 ; 0x60 <== NOT EXECUTED
bbd0: e1a01007 mov r1, r7 <== NOT EXECUTED
bbd4: ebffff9b bl ba48 <memfile_free_blocks_in_table> <== NOT EXECUTED
(block_p **)&info->triply_indirect, to_free );
}
return 0;
}
bbd8: e3a00000 mov r0, #0
bbdc: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
0000bbe4 <IMFS_memfile_remove_block>:
MEMFILE_STATIC int IMFS_memfile_remove_block(
IMFS_jnode_t *the_jnode,
unsigned int block
)
{
bbe4: e52de004 push {lr} ; (str lr, [sp, #-4]!) <== NOT EXECUTED
block_p *block_ptr;
block_p ptr;
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
bbe8: e3a02000 mov r2, #0 <== NOT EXECUTED
bbec: ebfffe66 bl b58c <IMFS_memfile_get_block_pointer> <== NOT EXECUTED
#if defined(RTEMS_DEBUG)
assert( block_ptr );
#endif
if ( block_ptr ) {
bbf0: e2503000 subs r3, r0, #0 <== NOT EXECUTED
ptr = *block_ptr;
*block_ptr = 0;
bbf4: 13a02000 movne r2, #0 <== NOT EXECUTED
#if defined(RTEMS_DEBUG)
assert( block_ptr );
#endif
if ( block_ptr ) {
ptr = *block_ptr;
bbf8: 15930000 ldrne r0, [r3] <== NOT EXECUTED
*block_ptr = 0;
bbfc: 15832000 strne r2, [r3] <== NOT EXECUTED
memfile_free_block( ptr );
bc00: 1bffff88 blne ba28 <memfile_free_block> <== NOT EXECUTED
}
return 1;
}
bc04: e3a00001 mov r0, #1 <== NOT EXECUTED
bc08: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
0000bd40 <IMFS_memfile_write>:
IMFS_jnode_t *the_jnode,
off_t start,
const unsigned char *source,
unsigned int length
)
{
bd40: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
/*
* Error check arguments
*/
if ( !source )
bd44: e2538000 subs r8, r3, #0
IMFS_jnode_t *the_jnode,
off_t start,
const unsigned char *source,
unsigned int length
)
{
bd48: e24dd010 sub sp, sp, #16
bd4c: e1a09000 mov r9, r0
bd50: e1a06001 mov r6, r1
bd54: e1a07002 mov r7, r2
bd58: e59db034 ldr fp, [sp, #52] ; 0x34
/*
* Error check arguments
*/
if ( !source )
bd5c: 0a000064 beq bef4 <IMFS_memfile_write+0x1b4>
/*
* If there is nothing to write, then quick exit.
*/
my_length = length;
if ( !my_length )
bd60: e35b0000 cmp fp, #0
bd64: 0a000062 beq bef4 <IMFS_memfile_write+0x1b4>
* If the last byte we are supposed to write is past the end of this
* in memory file, then extend the length.
*/
last_byte = start + length;
if ( last_byte > the_jnode->info.file.size ) {
bd68: e5903054 ldr r3, [r0, #84] ; 0x54
bd6c: e3530000 cmp r3, #0
/*
* If the last byte we are supposed to write is past the end of this
* in memory file, then extend the length.
*/
last_byte = start + length;
bd70: e08b1001 add r1, fp, r1
if ( last_byte > the_jnode->info.file.size ) {
bd74: ba000040 blt be7c <IMFS_memfile_write+0x13c>
bd78: 0a00003c beq be70 <IMFS_memfile_write+0x130>
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
bd7c: e59f5184 ldr r5, [pc, #388] ; bf08 <IMFS_memfile_write+0x1c8>
bd80: e5954000 ldr r4, [r5]
bd84: e1a00006 mov r0, r6
bd88: e1a02004 mov r2, r4
bd8c: e1a03fc2 asr r3, r2, #31
bd90: e1a01007 mov r1, r7
bd94: e88d000c stm sp, {r2, r3}
bd98: eb00130e bl 109d8 <__moddi3>
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
bd9c: e1a01007 mov r1, r7
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
bda0: e1a0a000 mov sl, r0
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
bda4: e89d000c ldm sp, {r2, r3}
bda8: e1a00006 mov r0, r6
bdac: eb0011cf bl 104f0 <__divdi3>
if ( start_offset ) {
bdb0: e35a0000 cmp sl, #0
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
bdb4: e1a07000 mov r7, r0
if ( start_offset ) {
bdb8: 01a0600b moveq r6, fp
bdbc: 1a000016 bne be1c <IMFS_memfile_write+0xdc>
/*
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
bdc0: e1560004 cmp r6, r4
bdc4: 2a000008 bcs bdec <IMFS_memfile_write+0xac>
bdc8: ea000035 b bea4 <IMFS_memfile_write+0x164>
if ( !block_ptr )
return copied;
#if 0
fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src );
#endif
memcpy( &(*block_ptr)[ 0 ], src, to_copy );
bdcc: e5900000 ldr r0, [r0]
bdd0: eb0005cb bl d504 <memcpy>
/*
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
bdd4: e5953000 ldr r3, [r5]
bdd8: e1530006 cmp r3, r6
return copied;
#if 0
fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src );
#endif
memcpy( &(*block_ptr)[ 0 ], src, to_copy );
src += to_copy;
bddc: e0888004 add r8, r8, r4
block++;
bde0: e2877001 add r7, r7, #1
*
* This routine writes the specified data buffer into the in memory
* file pointed to by the_jnode. The file is extended as needed.
*/
MEMFILE_STATIC ssize_t IMFS_memfile_write(
bde4: e08aa004 add sl, sl, r4
/*
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
bde8: 8a00002d bhi bea4 <IMFS_memfile_write+0x164>
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
bdec: e1a01007 mov r1, r7
bdf0: e3a02000 mov r2, #0
bdf4: e1a00009 mov r0, r9
bdf8: ebfffde3 bl b58c <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
bdfc: e3500000 cmp r0, #0
return copied;
#if 0
fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src );
#endif
memcpy( &(*block_ptr)[ 0 ], src, to_copy );
be00: e1a01008 mov r1, r8
be04: e1a02004 mov r2, r4
src += to_copy;
block++;
my_length -= to_copy;
be08: e0646006 rsb r6, r4, r6
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
be0c: 1affffee bne bdcc <IMFS_memfile_write+0x8c>
}
IMFS_mtime_ctime_update( the_jnode );
return copied;
}
be10: e1a0000a mov r0, sl
be14: e28dd010 add sp, sp, #16
be18: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
if ( start_offset ) {
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset;
if ( to_copy > my_length )
to_copy = my_length;
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
be1c: e1a00009 mov r0, r9
be20: e1a01007 mov r1, r7
be24: e3a02000 mov r2, #0
be28: ebfffdd7 bl b58c <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
be2c: e3500000 cmp r0, #0
return copied;
be30: 01a0a000 moveq sl, r0
if ( start_offset ) {
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset;
if ( to_copy > my_length )
to_copy = my_length;
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
be34: 0afffff5 beq be10 <IMFS_memfile_write+0xd0>
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
if ( start_offset ) {
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset;
be38: e06a4004 rsb r4, sl, r4
block,
to_copy,
src
);
#endif
memcpy( &(*block_ptr)[ start_offset ], src, to_copy );
be3c: e5900000 ldr r0, [r0]
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
if ( start_offset ) {
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset;
be40: e154000b cmp r4, fp
be44: 21a0400b movcs r4, fp
block,
to_copy,
src
);
#endif
memcpy( &(*block_ptr)[ start_offset ], src, to_copy );
be48: e080000a add r0, r0, sl
be4c: e1a01008 mov r1, r8
be50: e1a02004 mov r2, r4
be54: eb0005aa bl d504 <memcpy>
src += to_copy;
be58: e0888004 add r8, r8, r4
block++;
my_length -= to_copy;
be5c: e064600b rsb r6, r4, fp
copied += to_copy;
be60: e1a0a004 mov sl, r4
src
);
#endif
memcpy( &(*block_ptr)[ start_offset ], src, to_copy );
src += to_copy;
block++;
be64: e2877001 add r7, r7, #1
my_length -= to_copy;
copied += to_copy;
be68: e5954000 ldr r4, [r5]
be6c: eaffffd3 b bdc0 <IMFS_memfile_write+0x80>
* If the last byte we are supposed to write is past the end of this
* in memory file, then extend the length.
*/
last_byte = start + length;
if ( last_byte > the_jnode->info.file.size ) {
be70: e5903050 ldr r3, [r0, #80] ; 0x50
be74: e1530001 cmp r3, r1
be78: 2affffbf bcs bd7c <IMFS_memfile_write+0x3c>
status = IMFS_memfile_extend( the_jnode, last_byte );
be7c: e1a00009 mov r0, r9
be80: e3a02000 mov r2, #0
be84: ebffff60 bl bc0c <IMFS_memfile_extend>
if ( status )
be88: e3500000 cmp r0, #0
be8c: 0affffba beq bd7c <IMFS_memfile_write+0x3c>
rtems_set_errno_and_return_minus_one( ENOSPC );
be90: eb00036d bl cc4c <__errno>
be94: e3a0301c mov r3, #28
be98: e5803000 str r3, [r0]
be9c: e3e0a000 mvn sl, #0
bea0: eaffffda b be10 <IMFS_memfile_write+0xd0>
#if defined(RTEMS_DEBUG)
assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK );
#endif
to_copy = my_length;
if ( my_length ) {
bea4: e3560000 cmp r6, #0
bea8: 0a00000a beq bed8 <IMFS_memfile_write+0x198>
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
beac: e1a00009 mov r0, r9
beb0: e1a01007 mov r1, r7
beb4: e3a02000 mov r2, #0
beb8: ebfffdb3 bl b58c <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
bebc: e3500000 cmp r0, #0
bec0: 0affffd2 beq be10 <IMFS_memfile_write+0xd0>
return copied;
#if 0
fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src );
#endif
memcpy( &(*block_ptr)[ 0 ], src, my_length );
bec4: e5900000 ldr r0, [r0]
bec8: e1a01008 mov r1, r8
becc: e1a02006 mov r2, r6
bed0: eb00058b bl d504 <memcpy>
my_length = 0;
copied += to_copy;
bed4: e08aa006 add sl, sl, r6
}
IMFS_mtime_ctime_update( the_jnode );
bed8: e28d0008 add r0, sp, #8
bedc: e3a01000 mov r1, #0
bee0: ebffd860 bl 2068 <gettimeofday>
bee4: e59d3008 ldr r3, [sp, #8]
bee8: e5893044 str r3, [r9, #68] ; 0x44
beec: e5893048 str r3, [r9, #72] ; 0x48
return copied;
bef0: eaffffc6 b be10 <IMFS_memfile_write+0xd0>
* If there is nothing to write, then quick exit.
*/
my_length = length;
if ( !my_length )
rtems_set_errno_and_return_minus_one( EINVAL );
bef4: eb000354 bl cc4c <__errno> <== NOT EXECUTED
bef8: e3a03016 mov r3, #22 <== NOT EXECUTED
befc: e5803000 str r3, [r0] <== NOT EXECUTED
bf00: e3e0a000 mvn sl, #0 <== NOT EXECUTED
bf04: eaffffc1 b be10 <IMFS_memfile_write+0xd0> <== NOT EXECUTED
000017c8 <IMFS_mknod>:
const char *token, /* IN */
mode_t mode, /* IN */
dev_t dev, /* IN */
rtems_filesystem_location_info_t *pathloc /* IN/OUT */
)
{
17c8: e92d41f0 push {r4, r5, r6, r7, r8, lr}
17cc: e24dd040 sub sp, sp, #64 ; 0x40
17d0: e1a04001 mov r4, r1
17d4: e1a08000 mov r8, r0
17d8: e1a07002 mov r7, r2
17dc: e1a06003 mov r6, r3
IMFS_jnode_t *new_node;
int result;
char new_name[ IMFS_NAME_MAX + 1 ];
IMFS_types_union info;
IMFS_get_token( token, strlen( token ), new_name, &result );
17e0: eb003109 bl dc0c <strlen>
17e4: e28d5004 add r5, sp, #4
17e8: e1a01000 mov r1, r0
17ec: e28d303c add r3, sp, #60 ; 0x3c
17f0: e1a00008 mov r0, r8
17f4: e1a02005 mov r2, r5
17f8: eb0020e3 bl 9b8c <IMFS_get_token>
/*
* Figure out what type of IMFS node this is.
*/
if ( S_ISDIR(mode) )
17fc: e2043a0f and r3, r4, #61440 ; 0xf000
1800: e3530901 cmp r3, #16384 ; 0x4000
1804: 0a00001c beq 187c <IMFS_mknod+0xb4>
type = IMFS_DIRECTORY;
else if ( S_ISREG(mode) )
1808: e3530902 cmp r3, #32768 ; 0x8000
180c: 0a000018 beq 1874 <IMFS_mknod+0xac>
type = IMFS_MEMORY_FILE;
else if ( S_ISBLK(mode) || S_ISCHR(mode) ) {
1810: e3530a06 cmp r3, #24576 ; 0x6000
1814: 13530a02 cmpne r3, #8192 ; 0x2000
type = IMFS_DEVICE;
rtems_filesystem_split_dev_t( dev, info.device.major, info.device.minor );
1818: 058d7028 streq r7, [sp, #40] ; 0x28
181c: 058d602c streq r6, [sp, #44] ; 0x2c
if ( S_ISDIR(mode) )
type = IMFS_DIRECTORY;
else if ( S_ISREG(mode) )
type = IMFS_MEMORY_FILE;
else if ( S_ISBLK(mode) || S_ISCHR(mode) ) {
type = IMFS_DEVICE;
1820: 03a01002 moveq r1, #2
*/
if ( S_ISDIR(mode) )
type = IMFS_DIRECTORY;
else if ( S_ISREG(mode) )
type = IMFS_MEMORY_FILE;
else if ( S_ISBLK(mode) || S_ISCHR(mode) ) {
1824: 1a00000a bne 1854 <IMFS_mknod+0x8c>
new_node = IMFS_create_node(
pathloc,
type,
new_name,
mode,
&info
1828: e28d3028 add r3, sp, #40 ; 0x28
* 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.
*/
new_node = IMFS_create_node(
182c: e58d3000 str r3, [sp]
1830: e59d0058 ldr r0, [sp, #88] ; 0x58
1834: e1a02005 mov r2, r5
1838: e1a03004 mov r3, r4
183c: eb001e0f bl 9080 <IMFS_create_node>
new_name,
mode,
&info
);
if ( !new_node )
1840: e3500000 cmp r0, #0
rtems_set_errno_and_return_minus_one( ENOMEM );
return 0;
1844: 13a00000 movne r0, #0
new_name,
mode,
&info
);
if ( !new_node )
1848: 0a00000d beq 1884 <IMFS_mknod+0xbc>
rtems_set_errno_and_return_minus_one( ENOMEM );
return 0;
}
184c: e28dd040 add sp, sp, #64 ; 0x40
1850: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
type = IMFS_MEMORY_FILE;
else if ( S_ISBLK(mode) || S_ISCHR(mode) ) {
type = IMFS_DEVICE;
rtems_filesystem_split_dev_t( dev, info.device.major, info.device.minor );
}
else if (S_ISFIFO(mode))
1854: e3530a01 cmp r3, #4096 ; 0x1000
type = IMFS_FIFO;
1858: 03a01007 moveq r1, #7
type = IMFS_MEMORY_FILE;
else if ( S_ISBLK(mode) || S_ISCHR(mode) ) {
type = IMFS_DEVICE;
rtems_filesystem_split_dev_t( dev, info.device.major, info.device.minor );
}
else if (S_ISFIFO(mode))
185c: 0afffff1 beq 1828 <IMFS_mknod+0x60>
type = IMFS_FIFO;
else {
rtems_set_errno_and_return_minus_one( EINVAL );
1860: eb002cf9 bl cc4c <__errno> <== NOT EXECUTED
1864: e3a03016 mov r3, #22 <== NOT EXECUTED
1868: e5803000 str r3, [r0] <== NOT EXECUTED
186c: e3e00000 mvn r0, #0 <== NOT EXECUTED
1870: eafffff5 b 184c <IMFS_mknod+0x84> <== NOT EXECUTED
* Figure out what type of IMFS node this is.
*/
if ( S_ISDIR(mode) )
type = IMFS_DIRECTORY;
else if ( S_ISREG(mode) )
type = IMFS_MEMORY_FILE;
1874: e3a01005 mov r1, #5
1878: eaffffea b 1828 <IMFS_mknod+0x60>
/*
* Figure out what type of IMFS node this is.
*/
if ( S_ISDIR(mode) )
type = IMFS_DIRECTORY;
187c: e3a01001 mov r1, #1
1880: eaffffe8 b 1828 <IMFS_mknod+0x60>
mode,
&info
);
if ( !new_node )
rtems_set_errno_and_return_minus_one( ENOMEM );
1884: eb002cf0 bl cc4c <__errno>
1888: e3a0300c mov r3, #12
188c: e5803000 str r3, [r0]
1890: e3e00000 mvn r0, #0
1894: eaffffec b 184c <IMFS_mknod+0x84>
00001898 <IMFS_mount>:
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
IMFS_jnode_t *node;
node = mt_entry->mt_point_node.node_access;
1898: e5903008 ldr r3, [r0, #8]
/*
* Is the node that we are mounting onto a directory node ?
*/
if ( node->type != IMFS_DIRECTORY )
189c: e593204c ldr r2, [r3, #76] ; 0x4c
18a0: e3520001 cmp r2, #1
#include <rtems/seterr.h>
int IMFS_mount(
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
18a4: e52de004 push {lr} ; (str lr, [sp, #-4]!)
/*
* Is the node that we are mounting onto a directory node ?
*/
if ( node->type != IMFS_DIRECTORY )
18a8: 1a000002 bne 18b8 <IMFS_mount+0x20>
/*
* Set mt_fs pointer to point to the mount table entry for
* the mounted file system.
*/
node->info.directory.mt_fs = mt_entry;
18ac: e583005c str r0, [r3, #92] ; 0x5c
return 0;
18b0: e3a00000 mov r0, #0
}
18b4: e49df004 pop {pc} ; (ldr pc, [sp], #4)
/*
* Is the node that we are mounting onto a directory node ?
*/
if ( node->type != IMFS_DIRECTORY )
rtems_set_errno_and_return_minus_one( ENOTDIR );
18b8: eb002ce3 bl cc4c <__errno> <== NOT EXECUTED
18bc: e3a03014 mov r3, #20 <== NOT EXECUTED
18c0: e5803000 str r3, [r0] <== NOT EXECUTED
18c4: e3e00000 mvn r0, #0 <== NOT EXECUTED
18c8: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
00003914 <IMFS_print_jnode>:
*/
void IMFS_print_jnode(
IMFS_jnode_t *the_jnode
)
{
3914: e92d4030 push {r4, r5, lr}
#if defined(RTEMS_DEBUG)
assert( the_jnode );
#endif
fprintf(stdout, "%s", the_jnode->name );
3918: e59f50f8 ldr r5, [pc, #248] ; 3a18 <IMFS_print_jnode+0x104>
391c: e5953000 ldr r3, [r5]
*/
void IMFS_print_jnode(
IMFS_jnode_t *the_jnode
)
{
3920: e1a04000 mov r4, r0
#if defined(RTEMS_DEBUG)
assert( the_jnode );
#endif
fprintf(stdout, "%s", the_jnode->name );
3924: e5931008 ldr r1, [r3, #8]
3928: e280000c add r0, r0, #12
392c: eb00343c bl 10a24 <fputs>
switch( the_jnode->type ) {
3930: e594204c ldr r2, [r4, #76] ; 0x4c
3934: e2423001 sub r3, r2, #1
3938: e3530006 cmp r3, #6
393c: 979ff103 ldrls pc, [pc, r3, lsl #2]
3940: ea000023 b 39d4 <IMFS_print_jnode+0xc0> <== NOT EXECUTED
3944: 000039e8 .word 0x000039e8 <== NOT EXECUTED
3948: 000039fc .word 0x000039fc <== NOT EXECUTED
394c: 00003960 .word 0x00003960 <== NOT EXECUTED
3950: 00003960 .word 0x00003960 <== NOT EXECUTED
3954: 00003998 .word 0x00003998 <== NOT EXECUTED
3958: 000039b8 .word 0x000039b8 <== NOT EXECUTED
395c: 0000397c .word 0x0000397c <== NOT EXECUTED
case IMFS_HARD_LINK:
fprintf(stdout, " links not printed\n" );
return;
case IMFS_SYM_LINK:
fprintf(stdout, " links not printed\n" );
3960: e5953000 ldr r3, [r5] <== NOT EXECUTED
3964: e59f00b0 ldr r0, [pc, #176] ; 3a1c <IMFS_print_jnode+0x108><== NOT EXECUTED
3968: e5933008 ldr r3, [r3, #8] <== NOT EXECUTED
396c: e3a01001 mov r1, #1 <== NOT EXECUTED
3970: e3a02013 mov r2, #19 <== NOT EXECUTED
default:
fprintf(stdout, " bad type %d\n", the_jnode->type );
return;
}
puts("");
}
3974: e8bd4030 pop {r4, r5, lr} <== NOT EXECUTED
case IMFS_HARD_LINK:
fprintf(stdout, " links not printed\n" );
return;
case IMFS_SYM_LINK:
fprintf(stdout, " links not printed\n" );
3978: ea00375a b 116e8 <fwrite> <== NOT EXECUTED
return;
case IMFS_FIFO:
fprintf(stdout, " FIFO not printed\n" );
397c: e5953000 ldr r3, [r5] <== NOT EXECUTED
3980: e59f0098 ldr r0, [pc, #152] ; 3a20 <IMFS_print_jnode+0x10c><== NOT EXECUTED
3984: e5933008 ldr r3, [r3, #8] <== NOT EXECUTED
3988: e3a01001 mov r1, #1 <== NOT EXECUTED
398c: e3a02012 mov r2, #18 <== NOT EXECUTED
default:
fprintf(stdout, " bad type %d\n", the_jnode->type );
return;
}
puts("");
}
3990: e8bd4030 pop {r4, r5, lr} <== NOT EXECUTED
case IMFS_SYM_LINK:
fprintf(stdout, " links not printed\n" );
return;
case IMFS_FIFO:
fprintf(stdout, " FIFO not printed\n" );
3994: ea003753 b 116e8 <fwrite> <== NOT EXECUTED
the_jnode->info.file.indirect,
the_jnode->info.file.doubly_indirect,
the_jnode->info.file.triply_indirect
);
#else
fprintf(stdout, " (file %" PRId32 ")",
3998: e5953000 ldr r3, [r5]
399c: e59f1080 ldr r1, [pc, #128] ; 3a24 <IMFS_print_jnode+0x110>
39a0: e5930008 ldr r0, [r3, #8]
39a4: e5942050 ldr r2, [r4, #80] ; 0x50
39a8: eb0033c8 bl 108d0 <fprintf>
default:
fprintf(stdout, " bad type %d\n", the_jnode->type );
return;
}
puts("");
39ac: e59f0074 ldr r0, [pc, #116] ; 3a28 <IMFS_print_jnode+0x114>
}
39b0: e8bd4030 pop {r4, r5, lr}
default:
fprintf(stdout, " bad type %d\n", the_jnode->type );
return;
}
puts("");
39b4: ea003b46 b 126d4 <puts>
fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")",
the_jnode->info.device.major, the_jnode->info.device.minor );
break;
case IMFS_LINEAR_FILE:
fprintf(stdout, " (file %" PRId32 " %p)",
39b8: e5953000 ldr r3, [r5] <== NOT EXECUTED
39bc: e59f1068 ldr r1, [pc, #104] ; 3a2c <IMFS_print_jnode+0x118><== NOT EXECUTED
39c0: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
39c4: e5942050 ldr r2, [r4, #80] ; 0x50 <== NOT EXECUTED
39c8: e5943058 ldr r3, [r4, #88] ; 0x58 <== NOT EXECUTED
39cc: eb0033bf bl 108d0 <fprintf> <== NOT EXECUTED
(uint32_t)the_jnode->info.linearfile.size,
the_jnode->info.linearfile.direct
);
break;
39d0: eafffff5 b 39ac <IMFS_print_jnode+0x98> <== NOT EXECUTED
case IMFS_FIFO:
fprintf(stdout, " FIFO not printed\n" );
return;
default:
fprintf(stdout, " bad type %d\n", the_jnode->type );
39d4: e5953000 ldr r3, [r5] <== NOT EXECUTED
39d8: e59f1050 ldr r1, [pc, #80] ; 3a30 <IMFS_print_jnode+0x11c> <== NOT EXECUTED
39dc: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
return;
}
puts("");
}
39e0: 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 );
39e4: ea0033b9 b 108d0 <fprintf> <== NOT EXECUTED
#endif
fprintf(stdout, "%s", the_jnode->name );
switch( the_jnode->type ) {
case IMFS_DIRECTORY:
fprintf(stdout, "/" );
39e8: e5953000 ldr r3, [r5]
39ec: e3a0002f mov r0, #47 ; 0x2f
39f0: e5931008 ldr r1, [r3, #8]
39f4: eb0033d5 bl 10950 <fputc>
break;
39f8: eaffffeb b 39ac <IMFS_print_jnode+0x98>
case IMFS_DEVICE:
fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")",
39fc: e5953000 ldr r3, [r5]
3a00: e59f102c ldr r1, [pc, #44] ; 3a34 <IMFS_print_jnode+0x120>
3a04: e5930008 ldr r0, [r3, #8]
3a08: e2842050 add r2, r4, #80 ; 0x50
3a0c: e892000c ldm r2, {r2, r3}
3a10: eb0033ae bl 108d0 <fprintf>
the_jnode->info.device.major, the_jnode->info.device.minor );
break;
3a14: eaffffe4 b 39ac <IMFS_print_jnode+0x98>
000018d8 <IMFS_readlink>:
)
{
IMFS_jnode_t *node;
int i;
node = loc->node_access;
18d8: e5903000 ldr r3, [r0]
if ( node->type != IMFS_SYM_LINK )
18dc: e593004c ldr r0, [r3, #76] ; 0x4c
18e0: e3500004 cmp r0, #4
int IMFS_readlink(
rtems_filesystem_location_info_t *loc,
char *buf, /* OUT */
size_t bufsize
)
{
18e4: e92d4010 push {r4, lr}
IMFS_jnode_t *node;
int i;
node = loc->node_access;
if ( node->type != IMFS_SYM_LINK )
18e8: 1a000014 bne 1940 <IMFS_readlink+0x68>
rtems_set_errno_and_return_minus_one( EINVAL );
for( i=0; ((i<bufsize) && (node->info.sym_link.name[i] != '\0')); i++ )
18ec: e3520000 cmp r2, #0
18f0: 0a000010 beq 1938 <IMFS_readlink+0x60>
18f4: e5930050 ldr r0, [r3, #80] ; 0x50
18f8: e5d0c000 ldrb ip, [r0]
18fc: e35c0000 cmp ip, #0
1900: 01a0000c moveq r0, ip
1904: 08bd8010 popeq {r4, pc}
1908: e3a04000 mov r4, #0
190c: e1a00004 mov r0, r4
1910: e2800001 add r0, r0, #1
1914: e1520000 cmp r2, r0
buf[i] = node->info.sym_link.name[i];
1918: e7c1c004 strb ip, [r1, r4]
node = loc->node_access;
if ( node->type != IMFS_SYM_LINK )
rtems_set_errno_and_return_minus_one( EINVAL );
for( i=0; ((i<bufsize) && (node->info.sym_link.name[i] != '\0')); i++ )
191c: e1a04000 mov r4, r0
1920: 98bd8010 popls {r4, pc}
1924: e593c050 ldr ip, [r3, #80] ; 0x50
1928: e7dcc000 ldrb ip, [ip, r0]
192c: e35c0000 cmp ip, #0
1930: 1afffff6 bne 1910 <IMFS_readlink+0x38>
1934: e8bd8010 pop {r4, pc}
1938: e1a00002 mov r0, r2 <== NOT EXECUTED
buf[i] = node->info.sym_link.name[i];
return i;
}
193c: e8bd8010 pop {r4, pc} <== NOT EXECUTED
int i;
node = loc->node_access;
if ( node->type != IMFS_SYM_LINK )
rtems_set_errno_and_return_minus_one( EINVAL );
1940: eb002cc1 bl cc4c <__errno> <== NOT EXECUTED
1944: e3a03016 mov r3, #22 <== NOT EXECUTED
1948: e5803000 str r3, [r0] <== NOT EXECUTED
194c: e3e00000 mvn r0, #0 <== NOT EXECUTED
1950: e8bd8010 pop {r4, pc} <== NOT EXECUTED
00009d38 <IMFS_stat>:
{
IMFS_fs_info_t *fs_info;
IMFS_jnode_t *the_jnode;
IMFS_device_t *io;
the_jnode = loc->node_access;
9d38: e5903000 ldr r3, [r0]
switch ( the_jnode->type ) {
9d3c: e593204c ldr r2, [r3, #76] ; 0x4c
9d40: e2422002 sub r2, r2, #2
int IMFS_stat(
rtems_filesystem_location_info_t *loc,
struct stat *buf
)
{
9d44: e92d41f0 push {r4, r5, r6, r7, r8, lr}
IMFS_device_t *io;
the_jnode = loc->node_access;
switch ( the_jnode->type ) {
9d48: e3520005 cmp r2, #5
9d4c: 979ff102 ldrls pc, [pc, r2, lsl #2]
9d50: ea000027 b 9df4 <IMFS_stat+0xbc> <== NOT EXECUTED
9d54: 00009de0 .word 0x00009de0 <== NOT EXECUTED
9d58: 00009df4 .word 0x00009df4 <== NOT EXECUTED
9d5c: 00009d6c .word 0x00009d6c <== NOT EXECUTED
9d60: 00009e08 .word 0x00009e08 <== NOT EXECUTED
9d64: 00009e08 .word 0x00009e08 <== NOT EXECUTED
9d68: 00009d6c .word 0x00009d6c <== NOT EXECUTED
case IMFS_SYM_LINK:
buf->st_size = 0;
break;
case IMFS_FIFO:
buf->st_size = 0;
9d6c: e3a04000 mov r4, #0
9d70: e3a05000 mov r5, #0
9d74: e5814020 str r4, [r1, #32]
9d78: e5815024 str r5, [r1, #36] ; 0x24
/*
* The device number of the IMFS is the major number and the minor is the
* instance.
*/
fs_info = loc->mt_entry->fs_info;
9d7c: e5902010 ldr r2, [r0, #16]
buf->st_dev =
rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance );
9d80: e5922034 ldr r2, [r2, #52] ; 0x34
9d84: e5927000 ldr r7, [r2]
rtems_device_minor_number _minor
)
{
union __rtems_dev_t temp;
temp.__overlay.major = _major;
9d88: e3a02cff mov r2, #65280 ; 0xff00
9d8c: e28220fe add r2, r2, #254 ; 0xfe
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;
buf->st_ctime = the_jnode->stat_ctime;
9d90: e5930048 ldr r0, [r3, #72] ; 0x48
*/
fs_info = loc->mt_entry->fs_info;
buf->st_dev =
rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance );
buf->st_mode = the_jnode->st_mode;
9d94: e5936030 ldr r6, [r3, #48] ; 0x30
buf->st_nlink = the_jnode->st_nlink;
buf->st_ino = the_jnode->st_ino;
9d98: e5935038 ldr r5, [r3, #56] ; 0x38
buf->st_uid = the_jnode->st_uid;
buf->st_gid = the_jnode->st_gid;
buf->st_atime = the_jnode->stat_atime;
9d9c: e2834040 add r4, r3, #64 ; 0x40
9da0: e8941010 ldm r4, {r4, ip}
fs_info = loc->mt_entry->fs_info;
buf->st_dev =
rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance );
buf->st_mode = the_jnode->st_mode;
buf->st_nlink = the_jnode->st_nlink;
9da4: e1d383b4 ldrh r8, [r3, #52] ; 0x34
/*
* 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 =
9da8: e5812000 str r2, [r1]
rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance );
buf->st_mode = the_jnode->st_mode;
buf->st_nlink = the_jnode->st_nlink;
buf->st_ino = the_jnode->st_ino;
buf->st_uid = the_jnode->st_uid;
9dac: e1d323bc ldrh r2, [r3, #60] ; 0x3c
buf->st_gid = the_jnode->st_gid;
9db0: e1d333be ldrh r3, [r3, #62] ; 0x3e
fs_info = loc->mt_entry->fs_info;
buf->st_dev =
rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance );
buf->st_mode = the_jnode->st_mode;
buf->st_nlink = the_jnode->st_nlink;
9db4: e1c181b0 strh r8, [r1, #16]
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;
buf->st_ctime = the_jnode->stat_ctime;
9db8: e5810038 str r0, [r1, #56] ; 0x38
rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance );
buf->st_mode = the_jnode->st_mode;
buf->st_nlink = the_jnode->st_nlink;
buf->st_ino = the_jnode->st_ino;
buf->st_uid = the_jnode->st_uid;
9dbc: e1c121b2 strh r2, [r1, #18]
/*
* 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 =
9dc0: e5817004 str r7, [r1, #4]
buf->st_mode = the_jnode->st_mode;
buf->st_nlink = the_jnode->st_nlink;
buf->st_ino = the_jnode->st_ino;
buf->st_uid = the_jnode->st_uid;
buf->st_gid = the_jnode->st_gid;
9dc4: e1c131b4 strh r3, [r1, #20]
*/
fs_info = loc->mt_entry->fs_info;
buf->st_dev =
rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance );
buf->st_mode = the_jnode->st_mode;
9dc8: e581600c str r6, [r1, #12]
buf->st_nlink = the_jnode->st_nlink;
buf->st_ino = the_jnode->st_ino;
9dcc: e5815008 str r5, [r1, #8]
buf->st_uid = the_jnode->st_uid;
buf->st_gid = the_jnode->st_gid;
buf->st_atime = the_jnode->stat_atime;
9dd0: e5814028 str r4, [r1, #40] ; 0x28
buf->st_mtime = the_jnode->stat_mtime;
9dd4: e581c030 str ip, [r1, #48] ; 0x30
buf->st_ctime = the_jnode->stat_ctime;
return 0;
9dd8: e3a00000 mov r0, #0
}
9ddc: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
switch ( the_jnode->type ) {
case IMFS_DEVICE:
io = &the_jnode->info.device;
buf->st_rdev = rtems_filesystem_make_dev_t( io->major, io->minor );
9de0: e2832050 add r2, r3, #80 ; 0x50
9de4: e8921004 ldm r2, {r2, ip}
9de8: e581c01c str ip, [r1, #28]
9dec: e5812018 str r2, [r1, #24]
break;
9df0: eaffffe1 b 9d7c <IMFS_stat+0x44>
case IMFS_FIFO:
buf->st_size = 0;
break;
default:
rtems_set_errno_and_return_minus_one( ENOTSUP );
9df4: eb000b94 bl cc4c <__errno> <== NOT EXECUTED
9df8: e3a03086 mov r3, #134 ; 0x86 <== NOT EXECUTED
9dfc: e5803000 str r3, [r0] <== NOT EXECUTED
9e00: e3e00000 mvn r0, #0 <== NOT EXECUTED
9e04: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
buf->st_rdev = rtems_filesystem_make_dev_t( io->major, io->minor );
break;
case IMFS_LINEAR_FILE:
case IMFS_MEMORY_FILE:
buf->st_size = the_jnode->info.file.size;
9e08: e2835050 add r5, r3, #80 ; 0x50
9e0c: e8950030 ldm r5, {r4, r5}
9e10: e5814020 str r4, [r1, #32]
9e14: e5815024 str r5, [r1, #36] ; 0x24
break;
9e18: eaffffd7 b 9d7c <IMFS_stat+0x44>
000019b8 <IMFS_symlink>:
int IMFS_symlink(
rtems_filesystem_location_info_t *parent_loc,
const char *link_name,
const char *node_name
)
{
19b8: e92d40f0 push {r4, r5, r6, r7, lr}
19bc: e1a06000 mov r6, r0
19c0: e24dd040 sub sp, sp, #64 ; 0x40
int i;
/*
* Remove any separators at the end of the string.
*/
IMFS_get_token( node_name, strlen( node_name ), new_name, &i );
19c4: e1a00002 mov r0, r2
int IMFS_symlink(
rtems_filesystem_location_info_t *parent_loc,
const char *link_name,
const char *node_name
)
{
19c8: e1a07002 mov r7, r2
19cc: e1a05001 mov r5, r1
int i;
/*
* Remove any separators at the end of the string.
*/
IMFS_get_token( node_name, strlen( node_name ), new_name, &i );
19d0: eb00308d bl dc0c <strlen>
19d4: e28d4004 add r4, sp, #4
19d8: e1a01000 mov r1, r0
19dc: e1a02004 mov r2, r4
19e0: e28d303c add r3, sp, #60 ; 0x3c
19e4: e1a00007 mov r0, r7
19e8: eb002067 bl 9b8c <IMFS_get_token>
/*
* Duplicate link name
*/
info.sym_link.name = strdup(link_name);
19ec: e1a00005 mov r0, r5
19f0: eb003071 bl dbbc <strdup>
if (info.sym_link.name == NULL) {
19f4: e3500000 cmp r0, #0
IMFS_get_token( node_name, strlen( node_name ), new_name, &i );
/*
* Duplicate link name
*/
info.sym_link.name = strdup(link_name);
19f8: e58d0028 str r0, [sp, #40] ; 0x28
if (info.sym_link.name == NULL) {
19fc: 0a00000e beq 1a3c <IMFS_symlink+0x84>
* 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.
*/
new_node = IMFS_create_node(
1a00: e28d2028 add r2, sp, #40 ; 0x28
1a04: e3a03ca2 mov r3, #41472 ; 0xa200
1a08: e58d2000 str r2, [sp]
1a0c: e3a01004 mov r1, #4
1a10: e1a00006 mov r0, r6
1a14: e1a02004 mov r2, r4
1a18: e2433001 sub r3, r3, #1
1a1c: eb001d97 bl 9080 <IMFS_create_node>
new_name,
( S_IFLNK | ( S_IRWXU | S_IRWXG | S_IRWXO )),
&info
);
if (new_node == NULL) {
1a20: e3500000 cmp r0, #0
free(info.sym_link.name);
rtems_set_errno_and_return_minus_one(ENOMEM);
}
return 0;
1a24: 13a00000 movne r0, #0
new_name,
( S_IFLNK | ( S_IRWXU | S_IRWXG | S_IRWXO )),
&info
);
if (new_node == NULL) {
1a28: 0a000001 beq 1a34 <IMFS_symlink+0x7c>
free(info.sym_link.name);
rtems_set_errno_and_return_minus_one(ENOMEM);
}
return 0;
}
1a2c: e28dd040 add sp, sp, #64 ; 0x40
1a30: e8bd80f0 pop {r4, r5, r6, r7, pc}
( S_IFLNK | ( S_IRWXU | S_IRWXG | S_IRWXO )),
&info
);
if (new_node == NULL) {
free(info.sym_link.name);
1a34: e59d0028 ldr r0, [sp, #40] ; 0x28 <== NOT EXECUTED
1a38: eb000161 bl 1fc4 <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENOMEM);
1a3c: eb002c82 bl cc4c <__errno> <== NOT EXECUTED
1a40: e3a0300c mov r3, #12 <== NOT EXECUTED
1a44: e5803000 str r3, [r0] <== NOT EXECUTED
1a48: e3e00000 mvn r0, #0 <== NOT EXECUTED
1a4c: eafffff6 b 1a2c <IMFS_symlink+0x74> <== NOT EXECUTED
00001a50 <IMFS_unlink>:
int IMFS_unlink(
rtems_filesystem_location_info_t *parentloc, /* IN */
rtems_filesystem_location_info_t *loc /* IN */
)
{
1a50: e92d41f0 push {r4, r5, r6, r7, r8, lr}
IMFS_jnode_t *node;
rtems_filesystem_location_info_t the_link;
int result = 0;
node = loc->node_access;
1a54: e5915000 ldr r5, [r1]
/*
* If this is the last last pointer to the node
* free the node.
*/
if ( node->type == IMFS_HARD_LINK ) {
1a58: e595304c ldr r3, [r5, #76] ; 0x4c
1a5c: e3530003 cmp r3, #3
int IMFS_unlink(
rtems_filesystem_location_info_t *parentloc, /* IN */
rtems_filesystem_location_info_t *loc /* IN */
)
{
1a60: e24dd01c sub sp, sp, #28
1a64: e1a04001 mov r4, r1
1a68: e1a06000 mov r6, r0
/*
* If this is the last last pointer to the node
* free the node.
*/
if ( node->type == IMFS_HARD_LINK ) {
1a6c: 0a000006 beq 1a8c <IMFS_unlink+0x3c>
/*
* Now actually free the node we were asked to free.
*/
result = (*loc->handlers->rmnod_h)( parentloc, loc );
1a70: e5943008 ldr r3, [r4, #8]
1a74: e1a00006 mov r0, r6
1a78: e1a01004 mov r1, r4
1a7c: e1a0e00f mov lr, pc
1a80: e593f034 ldr pc, [r3, #52] ; 0x34
return result;
}
1a84: e28dd01c add sp, sp, #28
1a88: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
* free the node.
*/
if ( node->type == IMFS_HARD_LINK ) {
if ( !node->info.hard_link.link_node )
1a8c: e595e050 ldr lr, [r5, #80] ; 0x50
1a90: e35e0000 cmp lr, #0
1a94: 0a00001f beq 1b18 <IMFS_unlink+0xc8>
rtems_set_errno_and_return_minus_one( EINVAL );
the_link = *loc;
1a98: e1a07001 mov r7, r1
1a9c: e8b7000f ldm r7!, {r0, r1, r2, r3}
1aa0: e1a0c00d mov ip, sp
1aa4: e8ac000f stmia ip!, {r0, r1, r2, r3}
the_link.node_access = node->info.hard_link.link_node;
1aa8: e28d801c add r8, sp, #28
1aac: e528e01c str lr, [r8, #-28]!
if ( node->type == IMFS_HARD_LINK ) {
if ( !node->info.hard_link.link_node )
rtems_set_errno_and_return_minus_one( EINVAL );
the_link = *loc;
1ab0: e5973000 ldr r3, [r7]
the_link.node_access = node->info.hard_link.link_node;
IMFS_Set_handlers( &the_link );
1ab4: 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;
1ab8: e58c3000 str r3, [ip]
the_link.node_access = node->info.hard_link.link_node;
IMFS_Set_handlers( &the_link );
1abc: eb001dd0 bl 9204 <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)
1ac0: e5953050 ldr r3, [r5, #80] ; 0x50
1ac4: e1d323b4 ldrh r2, [r3, #52] ; 0x34
1ac8: e3520001 cmp r2, #1
1acc: 0a000008 beq 1af4 <IMFS_unlink+0xa4>
if ( result != 0 )
return -1;
}
else
{
node->info.hard_link.link_node->st_nlink --;
1ad0: e2422001 sub r2, r2, #1
1ad4: e1c323b4 strh r2, [r3, #52] ; 0x34
IMFS_update_ctime( node->info.hard_link.link_node );
1ad8: e28d0014 add r0, sp, #20
1adc: e3a01000 mov r1, #0
1ae0: eb000160 bl 2068 <gettimeofday>
1ae4: e5953050 ldr r3, [r5, #80] ; 0x50
1ae8: e59d2014 ldr r2, [sp, #20]
1aec: e5832048 str r2, [r3, #72] ; 0x48
1af0: eaffffde b 1a70 <IMFS_unlink+0x20>
* to remove the node that is a link and the node itself.
*/
if ( node->info.hard_link.link_node->st_nlink == 1)
{
result = (*the_link.handlers->rmnod_h)( parentloc, &the_link );
1af4: e1a00006 mov r0, r6
1af8: e1a0100d mov r1, sp
1afc: e59d3008 ldr r3, [sp, #8]
1b00: e1a0e00f mov lr, pc
1b04: e593f034 ldr pc, [r3, #52] ; 0x34
if ( result != 0 )
1b08: e3500000 cmp r0, #0
1b0c: 0affffd7 beq 1a70 <IMFS_unlink+0x20>
return -1;
1b10: e3e00000 mvn r0, #0
1b14: eaffffda b 1a84 <IMFS_unlink+0x34>
*/
if ( node->type == IMFS_HARD_LINK ) {
if ( !node->info.hard_link.link_node )
rtems_set_errno_and_return_minus_one( EINVAL );
1b18: eb002c4b bl cc4c <__errno> <== NOT EXECUTED
1b1c: e3a03016 mov r3, #22 <== NOT EXECUTED
1b20: e5803000 str r3, [r0] <== NOT EXECUTED
1b24: e3e00000 mvn r0, #0 <== NOT EXECUTED
1b28: eaffffd5 b 1a84 <IMFS_unlink+0x34> <== NOT EXECUTED
00001b2c <IMFS_unmount>:
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
IMFS_jnode_t *node;
node = mt_entry->mt_point_node.node_access;
1b2c: e5903008 ldr r3, [r0, #8]
/*
* Is the node that we are mounting onto a directory node ?
*/
if ( node->type != IMFS_DIRECTORY )
1b30: e593204c ldr r2, [r3, #76] ; 0x4c
1b34: e3520001 cmp r2, #1
#include <rtems/seterr.h>
int IMFS_unmount(
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
1b38: e52de004 push {lr} ; (str lr, [sp, #-4]!)
/*
* Is the node that we are mounting onto a directory node ?
*/
if ( node->type != IMFS_DIRECTORY )
1b3c: 1a000005 bne 1b58 <IMFS_unmount+0x2c>
/*
* Did the node indicate that there was a directory mounted here?
*/
if ( node->info.directory.mt_fs == NULL )
1b40: e593205c ldr r2, [r3, #92] ; 0x5c
1b44: e3520000 cmp r2, #0
1b48: 0a000007 beq 1b6c <IMFS_unmount+0x40>
/*
* 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;
1b4c: e3a00000 mov r0, #0
1b50: e583005c str r0, [r3, #92] ; 0x5c
return 0;
}
1b54: e49df004 pop {pc} ; (ldr pc, [sp], #4)
/*
* Is the node that we are mounting onto a directory node ?
*/
if ( node->type != IMFS_DIRECTORY )
rtems_set_errno_and_return_minus_one( ENOTDIR );
1b58: eb002c3b bl cc4c <__errno> <== NOT EXECUTED
1b5c: e3a03014 mov r3, #20 <== NOT EXECUTED
1b60: e5803000 str r3, [r0] <== NOT EXECUTED
1b64: e3e00000 mvn r0, #0 <== NOT EXECUTED
1b68: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
/*
* Did the node indicate that there was a directory mounted here?
*/
if ( node->info.directory.mt_fs == NULL )
rtems_set_errno_and_return_minus_one( EINVAL ); /* XXX */
1b6c: eb002c36 bl cc4c <__errno> <== NOT EXECUTED
1b70: e3a03016 mov r3, #22 <== NOT EXECUTED
1b74: e5803000 str r3, [r0] <== NOT EXECUTED
1b78: e3e00000 mvn r0, #0 <== NOT EXECUTED
1b7c: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
0000141c <Stack_check_Initialize>:
Stack_check_Dope_stack(&Stack_check_Interrupt_stack);
}
#endif
Stack_check_Initialized = 1;
}
141c: e12fff1e bx lr <== NOT EXECUTED
00016bc4 <_CORE_message_queue_Broadcast>:
{
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
16bc4: 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
)
{
16bc8: 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 ) {
16bcc: e1530002 cmp r3, r2
Objects_Id id __attribute__((unused)),
CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)),
#endif
uint32_t *count
)
{
16bd0: e1a07000 mov r7, r0
16bd4: e1a05002 mov r5, r2
16bd8: e1a08001 mov r8, r1
16bdc: e59da020 ldr sl, [sp, #32]
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
16be0: 3a000016 bcc 16c40 <_CORE_message_queue_Broadcast+0x7c>
* 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 ) {
16be4: e5906048 ldr r6, [r0, #72] ; 0x48
16be8: e3560000 cmp r6, #0
*count = 0;
16bec: 13a00000 movne r0, #0
16bf0: 158a0000 strne r0, [sl]
* 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 ) {
16bf4: 18bd85f0 popne {r4, r5, r6, r7, r8, sl, pc}
/*
* There must be no pending messages if there is a thread waiting to
* receive a message.
*/
number_broadcasted = 0;
while ((the_thread =
16bf8: e1a00007 mov r0, r7
16bfc: eb000a0e bl 1943c <_Thread_queue_Dequeue>
16c00: e2504000 subs r4, r0, #0
16c04: 0a00000a beq 16c34 <_CORE_message_queue_Broadcast+0x70>
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
16c08: e594002c ldr r0, [r4, #44] ; 0x2c
16c0c: e1a01008 mov r1, r8
16c10: e1a02005 mov r2, r5
16c14: eb002084 bl 1ee2c <memcpy>
buffer,
waitp->return_argument_second.mutable_object,
size
);
*(size_t *) the_thread->Wait.return_argument = size;
16c18: e5943028 ldr r3, [r4, #40] ; 0x28
/*
* There must be no pending messages if there is a thread waiting to
* receive a message.
*/
number_broadcasted = 0;
while ((the_thread =
16c1c: e1a00007 mov r0, r7
buffer,
waitp->return_argument_second.mutable_object,
size
);
*(size_t *) the_thread->Wait.return_argument = size;
16c20: e5835000 str r5, [r3]
/*
* There must be no pending messages if there is a thread waiting to
* receive a message.
*/
number_broadcasted = 0;
while ((the_thread =
16c24: eb000a04 bl 1943c <_Thread_queue_Dequeue>
16c28: e2504000 subs r4, r0, #0
_Thread_queue_Dequeue(&the_message_queue->Wait_queue))) {
waitp = &the_thread->Wait;
number_broadcasted += 1;
16c2c: e2866001 add r6, r6, #1
/*
* There must be no pending messages if there is a thread waiting to
* receive a message.
*/
number_broadcasted = 0;
while ((the_thread =
16c30: 1afffff4 bne 16c08 <_CORE_message_queue_Broadcast+0x44>
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
(*api_message_queue_mp_support) ( the_thread, id );
#endif
}
*count = number_broadcasted;
16c34: e58a6000 str r6, [sl]
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
16c38: e1a00004 mov r0, r4
16c3c: 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;
16c40: e3a00001 mov r0, #1 <== NOT EXECUTED
#endif
}
*count = number_broadcasted;
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
}
16c44: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
0000ab6c <_CORE_mutex_Seize_interrupt_trylock>:
{
Thread_Control *executing;
/* disabled when you get here */
executing = _Thread_Executing;
ab6c: e59f215c ldr r2, [pc, #348] ; acd0 <_CORE_mutex_Seize_interrupt_trylock+0x164>
executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL;
if ( !_CORE_mutex_Is_locked( the_mutex ) ) {
ab70: e590c050 ldr ip, [r0, #80] ; 0x50
#if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__)
int _CORE_mutex_Seize_interrupt_trylock(
CORE_mutex_Control *the_mutex,
ISR_Level *level_p
)
{
ab74: e1a03000 mov r3, r0
{
Thread_Control *executing;
/* disabled when you get here */
executing = _Thread_Executing;
ab78: e5922004 ldr r2, [r2, #4]
executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL;
ab7c: e3a00000 mov r0, #0
if ( !_CORE_mutex_Is_locked( the_mutex ) ) {
ab80: e15c0000 cmp ip, r0
ab84: e92d40f0 push {r4, r5, r6, r7, lr}
Thread_Control *executing;
/* disabled when you get here */
executing = _Thread_Executing;
executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL;
ab88: e5820034 str r0, [r2, #52] ; 0x34
if ( !_CORE_mutex_Is_locked( the_mutex ) ) {
ab8c: 0a00000e beq abcc <_CORE_mutex_Seize_interrupt_trylock+0x60>
return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p );
}
ab90: e593c048 ldr ip, [r3, #72] ; 0x48
the_mutex->lock = CORE_MUTEX_LOCKED;
the_mutex->holder = executing;
the_mutex->holder_id = executing->Object.id;
ab94: e5925008 ldr r5, [r2, #8]
the_mutex->nest_count = 1;
ab98: e3a04001 mov r4, #1
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
ab9c: e35c0002 cmp ip, #2
/* disabled when you get here */
executing = _Thread_Executing;
executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL;
if ( !_CORE_mutex_Is_locked( the_mutex ) ) {
the_mutex->lock = CORE_MUTEX_LOCKED;
aba0: e5830050 str r0, [r3, #80] ; 0x50
the_mutex->holder = executing;
aba4: e583205c str r2, [r3, #92] ; 0x5c
the_mutex->holder_id = executing->Object.id;
aba8: e5835060 str r5, [r3, #96] ; 0x60
the_mutex->nest_count = 1;
abac: e5834054 str r4, [r3, #84] ; 0x54
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
abb0: 0a000013 beq ac04 <_CORE_mutex_Seize_interrupt_trylock+0x98>
abb4: e35c0003 cmp ip, #3
abb8: 0a000018 beq ac20 <_CORE_mutex_Seize_interrupt_trylock+0xb4>
abbc: e5913000 ldr r3, [r1]
abc0: e129f003 msr CPSR_fc, r3
executing->resource_count++;
}
if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
_ISR_Enable( *level_p );
return 0;
abc4: e3a00000 mov r0, #0
abc8: e8bd80f0 pop {r4, r5, r6, r7, pc}
/*
* At this point, we know the mutex was not available. If this thread
* is the thread that has locked the mutex, let's see if we are allowed
* to nest access.
*/
if ( _Thread_Is_executing( the_mutex->holder ) ) {
abcc: e593005c ldr r0, [r3, #92] ; 0x5c
abd0: e1520000 cmp r2, r0
/*
* The mutex is not available and the caller must deal with the possibility
* of blocking.
*/
return 1;
abd4: 13a00001 movne r0, #1
/*
* At this point, we know the mutex was not available. If this thread
* is the thread that has locked the mutex, let's see if we are allowed
* to nest access.
*/
if ( _Thread_Is_executing( the_mutex->holder ) ) {
abd8: 18bd80f0 popne {r4, r5, r6, r7, pc}
switch ( the_mutex->Attributes.lock_nesting_behavior ) {
abdc: e5930040 ldr r0, [r3, #64] ; 0x40
abe0: e3500000 cmp r0, #0
abe4: 1a00001e bne ac64 <_CORE_mutex_Seize_interrupt_trylock+0xf8>
case CORE_MUTEX_NESTING_ACQUIRES:
the_mutex->nest_count++;
abe8: e5932054 ldr r2, [r3, #84] ; 0x54
abec: e2822001 add r2, r2, #1
abf0: e5832054 str r2, [r3, #84] ; 0x54
abf4: e5913000 ldr r3, [r1]
abf8: e129f003 msr CPSR_fc, r3
_ISR_Enable( *level_p );
return 0;
abfc: e3a00000 mov r0, #0
ac00: e8bd80f0 pop {r4, r5, r6, r7, pc}
_Chain_Prepend_unprotected( &executing->lock_mutex,
&the_mutex->queue.lock_queue );
the_mutex->queue.priority_before = executing->current_priority;
#endif
executing->resource_count++;
ac04: e592301c ldr r3, [r2, #28]
ac08: e2833001 add r3, r3, #1
ac0c: e582301c str r3, [r2, #28]
ac10: e5913000 ldr r3, [r1]
ac14: e129f003 msr CPSR_fc, r3
}
if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
_ISR_Enable( *level_p );
return 0;
ac18: e3a00000 mov r0, #0
ac1c: e8bd80f0 pop {r4, r5, r6, r7, pc}
_Chain_Prepend_unprotected( &executing->lock_mutex,
&the_mutex->queue.lock_queue );
the_mutex->queue.priority_before = executing->current_priority;
#endif
executing->resource_count++;
ac20: e592c01c ldr ip, [r2, #28]
*/
{
Priority_Control ceiling;
Priority_Control current;
ceiling = the_mutex->Attributes.priority_ceiling;
ac24: e593704c ldr r7, [r3, #76] ; 0x4c
current = executing->current_priority;
ac28: e5926014 ldr r6, [r2, #20]
_Chain_Prepend_unprotected( &executing->lock_mutex,
&the_mutex->queue.lock_queue );
the_mutex->queue.priority_before = executing->current_priority;
#endif
executing->resource_count++;
ac2c: e08c5004 add r5, ip, r4
Priority_Control ceiling;
Priority_Control current;
ceiling = the_mutex->Attributes.priority_ceiling;
current = executing->current_priority;
if ( current == ceiling ) {
ac30: e1570006 cmp r7, r6
_Chain_Prepend_unprotected( &executing->lock_mutex,
&the_mutex->queue.lock_queue );
the_mutex->queue.priority_before = executing->current_priority;
#endif
executing->resource_count++;
ac34: e582501c str r5, [r2, #28]
Priority_Control ceiling;
Priority_Control current;
ceiling = the_mutex->Attributes.priority_ceiling;
current = executing->current_priority;
if ( current == ceiling ) {
ac38: 0a000020 beq acc0 <_CORE_mutex_Seize_interrupt_trylock+0x154>
_ISR_Enable( *level_p );
return 0;
}
if ( current > ceiling ) {
ac3c: 3a000012 bcc ac8c <_CORE_mutex_Seize_interrupt_trylock+0x120>
);
_Thread_Enable_dispatch();
return 0;
}
/* if ( current < ceiling ) */ {
executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED;
ac40: e3a05006 mov r5, #6
ac44: e5825034 str r5, [r2, #52] ; 0x34
the_mutex->lock = CORE_MUTEX_UNLOCKED;
ac48: e5834050 str r4, [r3, #80] ; 0x50
the_mutex->nest_count = 0; /* undo locking above */
ac4c: e5830054 str r0, [r3, #84] ; 0x54
executing->resource_count--; /* undo locking above */
ac50: e582c01c str ip, [r2, #28]
ac54: e5913000 ldr r3, [r1]
ac58: e129f003 msr CPSR_fc, r3
_ISR_Enable( *level_p );
return 0;
ac5c: e3a00000 mov r0, #0
ac60: e8bd80f0 pop {r4, r5, r6, r7, pc}
* At this point, we know the mutex was not available. If this thread
* is the thread that has locked the mutex, let's see if we are allowed
* to nest access.
*/
if ( _Thread_Is_executing( the_mutex->holder ) ) {
switch ( the_mutex->Attributes.lock_nesting_behavior ) {
ac64: e3500001 cmp r0, #1
ac68: 0a000001 beq ac74 <_CORE_mutex_Seize_interrupt_trylock+0x108>
/*
* The mutex is not available and the caller must deal with the possibility
* of blocking.
*/
return 1;
ac6c: e3a00001 mov r0, #1
ac70: e8bd80f0 pop {r4, r5, r6, r7, pc}
case CORE_MUTEX_NESTING_ACQUIRES:
the_mutex->nest_count++;
_ISR_Enable( *level_p );
return 0;
case CORE_MUTEX_NESTING_IS_ERROR:
executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED;
ac74: e3a03002 mov r3, #2 <== NOT EXECUTED
ac78: e5823034 str r3, [r2, #52] ; 0x34 <== NOT EXECUTED
ac7c: e5913000 ldr r3, [r1] <== NOT EXECUTED
ac80: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED
_ISR_Enable( *level_p );
return 0;
ac84: e3a00000 mov r0, #0 <== NOT EXECUTED
ac88: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
ac8c: e59f2040 ldr r2, [pc, #64] ; acd4 <_CORE_mutex_Seize_interrupt_trylock+0x168>
ac90: e5920000 ldr r0, [r2]
ac94: e2800001 add r0, r0, #1
ac98: e5820000 str r0, [r2]
ac9c: e5912000 ldr r2, [r1]
aca0: e129f002 msr CPSR_fc, r2
}
if ( current > ceiling ) {
_Thread_Disable_dispatch();
_ISR_Enable( *level_p );
_Thread_Change_priority(
aca4: e3a02000 mov r2, #0
aca8: e593005c ldr r0, [r3, #92] ; 0x5c
acac: e593104c ldr r1, [r3, #76] ; 0x4c
acb0: ebfff14d bl 71ec <_Thread_Change_priority>
the_mutex->holder,
the_mutex->Attributes.priority_ceiling,
false
);
_Thread_Enable_dispatch();
acb4: ebfff2a8 bl 775c <_Thread_Enable_dispatch>
return 0;
acb8: e3a00000 mov r0, #0
acbc: e8bd80f0 pop {r4, r5, r6, r7, pc}
acc0: e5913000 ldr r3, [r1]
acc4: e129f003 msr CPSR_fc, r3
ceiling = the_mutex->Attributes.priority_ceiling;
current = executing->current_priority;
if ( current == ceiling ) {
_ISR_Enable( *level_p );
return 0;
acc8: e3a00000 mov r0, #0
accc: e8bd80f0 pop {r4, r5, r6, r7, pc}
0000ab10 <_Chain_Initialize>:
count = number_nodes;
current = _Chain_Head( the_chain );
the_chain->permanent_null = NULL;
next = starting_address;
while ( count-- ) {
ab10: e3520000 cmp r2, #0
Chain_Node *current;
Chain_Node *next;
count = number_nodes;
current = _Chain_Head( the_chain );
the_chain->permanent_null = NULL;
ab14: e3a0c000 mov ip, #0
Chain_Control *the_chain,
void *starting_address,
size_t number_nodes,
size_t node_size
)
{
ab18: e92d0070 push {r4, r5, r6}
Chain_Node *current;
Chain_Node *next;
count = number_nodes;
current = _Chain_Head( the_chain );
the_chain->permanent_null = NULL;
ab1c: e580c004 str ip, [r0, #4]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head(
Chain_Control *the_chain
)
{
return (Chain_Node *) the_chain;
ab20: e1a04000 mov r4, r0
next = starting_address;
ab24: 11a05002 movne r5, r2
ab28: 11a0c001 movne ip, r1
while ( count-- ) {
ab2c: 1a000002 bne ab3c <_Chain_Initialize+0x2c>
ab30: ea000008 b ab58 <_Chain_Initialize+0x48> <== NOT EXECUTED
ab34: e1a0400c mov r4, ip
current->next = next;
next->previous = current;
current = next;
next = (Chain_Node *)
ab38: e1a0c006 mov ip, r6
count = number_nodes;
current = _Chain_Head( the_chain );
the_chain->permanent_null = NULL;
next = starting_address;
while ( count-- ) {
ab3c: e2555001 subs r5, r5, #1
current->next = next;
ab40: e584c000 str ip, [r4]
next->previous = current;
ab44: e58c4004 str r4, [ip, #4]
* node_size - size of node in bytes
*
* Output parameters: NONE
*/
void _Chain_Initialize(
ab48: e08c6003 add r6, ip, r3
count = number_nodes;
current = _Chain_Head( the_chain );
the_chain->permanent_null = NULL;
next = starting_address;
while ( count-- ) {
ab4c: 1afffff8 bne ab34 <_Chain_Initialize+0x24>
* node_size - size of node in bytes
*
* Output parameters: NONE
*/
void _Chain_Initialize(
ab50: e2422001 sub r2, r2, #1
count = number_nodes;
current = _Chain_Head( the_chain );
the_chain->permanent_null = NULL;
next = starting_address;
while ( count-- ) {
ab54: e0241293 mla r4, r3, r2, r1
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
ab58: e2803004 add r3, r0, #4
next->previous = current;
current = next;
next = (Chain_Node *)
_Addresses_Add_offset( (void *) next, node_size );
}
current->next = _Chain_Tail( the_chain );
ab5c: e5843000 str r3, [r4]
the_chain->last = current;
ab60: e5804008 str r4, [r0, #8]
}
ab64: e8bd0070 pop {r4, r5, r6}
ab68: e12fff1e bx lr
0000ad4c <_Heap_Allocate_aligned_with_boundary>:
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
ad4c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
ad50: e1a08002 mov r8, r2
Heap_Statistics *const stats = &heap->stats;
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
Heap_Block *block = _Heap_Free_list_first( heap );
uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE
- HEAP_BLOCK_SIZE_OFFSET;
uintptr_t const page_size = heap->page_size;
ad54: e5902010 ldr r2, [r0, #16]
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
ad58: e24dd01c sub sp, sp, #28
ad5c: e1a05001 mov r5, r1
- HEAP_BLOCK_SIZE_OFFSET;
uintptr_t const page_size = heap->page_size;
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
if ( block_size_floor < alloc_size ) {
ad60: e2911004 adds r1, r1, #4
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
ad64: e1a07000 mov r7, r0
- HEAP_BLOCK_SIZE_OFFSET;
uintptr_t const page_size = heap->page_size;
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
if ( block_size_floor < alloc_size ) {
ad68: e58d1000 str r1, [sp]
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
ad6c: e1a0b003 mov fp, r3
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
ad70: e5909008 ldr r9, [r0, #8]
Heap_Statistics *const stats = &heap->stats;
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
Heap_Block *block = _Heap_Free_list_first( heap );
uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE
- HEAP_BLOCK_SIZE_OFFSET;
uintptr_t const page_size = heap->page_size;
ad74: e58d200c str r2, [sp, #12]
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
if ( block_size_floor < alloc_size ) {
ad78: 2a000075 bcs af54 <_Heap_Allocate_aligned_with_boundary+0x208>
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
ad7c: e3530000 cmp r3, #0
ad80: 1a000071 bne af4c <_Heap_Allocate_aligned_with_boundary+0x200>
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
ad84: e1570009 cmp r7, r9
ad88: 0a000071 beq af54 <_Heap_Allocate_aligned_with_boundary+0x208>
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
ad8c: e59d300c ldr r3, [sp, #12]
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET;
ad90: e2651004 rsb r1, r5, #4
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
ad94: e2833007 add r3, r3, #7
ad98: e58d3010 str r3, [sp, #16]
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET;
ad9c: e58d1014 str r1, [sp, #20]
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
ada0: e3a06000 mov r6, #0
/*
* The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag
* field. Thus the value is about one unit larger than the real block
* size. The greater than operator takes this into account.
*/
if ( block->size_and_flag > block_size_floor ) {
ada4: e599a004 ldr sl, [r9, #4]
ada8: e59d2000 ldr r2, [sp]
adac: e152000a cmp r2, sl
while ( block != free_list_tail ) {
_HAssert( _Heap_Is_prev_used( block ) );
/* Statistics */
++search_count;
adb0: e2866001 add r6, r6, #1
/*
* The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag
* field. Thus the value is about one unit larger than the real block
* size. The greater than operator takes this into account.
*/
if ( block->size_and_flag > block_size_floor ) {
adb4: 2a000051 bcs af00 <_Heap_Allocate_aligned_with_boundary+0x1b4>
if ( alignment == 0 ) {
adb8: e3580000 cmp r8, #0
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
const Heap_Block *block
)
{
return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE;
adbc: 02894008 addeq r4, r9, #8
adc0: 0a00004c beq aef8 <_Heap_Allocate_aligned_with_boundary+0x1ac>
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
adc4: e5973014 ldr r3, [r7, #20]
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET;
uintptr_t alloc_begin = alloc_end - alloc_size;
adc8: e59d1014 ldr r1, [sp, #20]
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
adcc: e59d2010 ldr r2, [sp, #16]
- 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;
add0: e3caa001 bic sl, sl, #1
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
add4: e089a00a add sl, r9, sl
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET;
uintptr_t alloc_begin = alloc_end - alloc_size;
add8: e081400a add r4, r1, sl
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
addc: e58d3004 str r3, [sp, #4]
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
ade0: e0633002 rsb r3, r3, r2
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
ade4: e1a00004 mov r0, r4
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
ade8: e083a00a add sl, r3, sl
adec: e1a01008 mov r1, r8
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
const Heap_Block *block
)
{
return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE;
adf0: e2893008 add r3, r9, #8
adf4: e58d3008 str r3, [sp, #8]
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
adf8: eb001588 bl 10420 <__umodsi3>
adfc: e0604004 rsb r4, r0, r4
uintptr_t alloc_begin = alloc_end - alloc_size;
alloc_begin = _Heap_Align_down( alloc_begin, alignment );
/* Ensure that the we have a valid new block at the end */
if ( alloc_begin > alloc_begin_ceiling ) {
ae00: e15a0004 cmp sl, r4
ae04: 2a000003 bcs ae18 <_Heap_Allocate_aligned_with_boundary+0xcc>
ae08: e1a0000a mov r0, sl
ae0c: e1a01008 mov r1, r8
ae10: eb001582 bl 10420 <__umodsi3>
ae14: e060400a rsb r4, r0, sl
}
alloc_end = alloc_begin + alloc_size;
/* Ensure boundary constaint */
if ( boundary != 0 ) {
ae18: e35b0000 cmp fp, #0
ae1c: 0a000025 beq aeb8 <_Heap_Allocate_aligned_with_boundary+0x16c>
/* Ensure that the we have a valid new block at the end */
if ( alloc_begin > alloc_begin_ceiling ) {
alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment );
}
alloc_end = alloc_begin + alloc_size;
ae20: e084a005 add sl, r4, r5
ae24: e1a0000a mov r0, sl
ae28: e1a0100b mov r1, fp
ae2c: eb00157b bl 10420 <__umodsi3>
ae30: e060000a rsb r0, r0, sl
/* Ensure boundary constaint */
if ( boundary != 0 ) {
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
ae34: e1540000 cmp r4, r0
ae38: 23a03000 movcs r3, #0
ae3c: 33a03001 movcc r3, #1
ae40: e15a0000 cmp sl, r0
ae44: 93a03000 movls r3, #0
ae48: e3530000 cmp r3, #0
ae4c: 0a000019 beq aeb8 <_Heap_Allocate_aligned_with_boundary+0x16c>
alloc_end = alloc_begin + alloc_size;
/* Ensure boundary constaint */
if ( boundary != 0 ) {
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
ae50: e59d1008 ldr r1, [sp, #8]
ae54: e081a005 add sl, r1, r5
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
if ( boundary_line < boundary_floor ) {
ae58: e15a0000 cmp sl, r0
ae5c: 958d6018 strls r6, [sp, #24]
ae60: 9a000002 bls ae70 <_Heap_Allocate_aligned_with_boundary+0x124>
ae64: ea000025 b af00 <_Heap_Allocate_aligned_with_boundary+0x1b4>
ae68: e15a0000 cmp sl, r0
ae6c: 8a00003a bhi af5c <_Heap_Allocate_aligned_with_boundary+0x210>
return 0;
}
alloc_begin = boundary_line - alloc_size;
ae70: e0654000 rsb r4, r5, r0
ae74: e1a01008 mov r1, r8
ae78: e1a00004 mov r0, r4
ae7c: eb001567 bl 10420 <__umodsi3>
ae80: e0604004 rsb r4, r0, r4
alloc_begin = _Heap_Align_down( alloc_begin, alignment );
alloc_end = alloc_begin + alloc_size;
ae84: e0846005 add r6, r4, r5
ae88: e1a00006 mov r0, r6
ae8c: e1a0100b mov r1, fp
ae90: eb001562 bl 10420 <__umodsi3>
ae94: e0600006 rsb r0, r0, r6
/* Ensure boundary constaint */
if ( boundary != 0 ) {
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
ae98: e1560000 cmp r6, r0
ae9c: 93a06000 movls r6, #0
aea0: 83a06001 movhi r6, #1
aea4: e1540000 cmp r4, r0
aea8: 23a06000 movcs r6, #0
aeac: e3560000 cmp r6, #0
aeb0: 1affffec bne ae68 <_Heap_Allocate_aligned_with_boundary+0x11c>
aeb4: e59d6018 ldr r6, [sp, #24]
boundary_line = _Heap_Align_down( alloc_end, boundary );
}
}
/* Ensure that the we have a valid new block at the beginning */
if ( alloc_begin >= alloc_begin_floor ) {
aeb8: e59d2008 ldr r2, [sp, #8]
aebc: e1520004 cmp r2, r4
aec0: 8a00000e bhi af00 <_Heap_Allocate_aligned_with_boundary+0x1b4>
aec4: e59d100c ldr r1, [sp, #12]
aec8: e1a00004 mov r0, r4
aecc: eb001553 bl 10420 <__umodsi3>
aed0: e269a4ff rsb sl, r9, #-16777216 ; 0xff000000
aed4: e28aa8ff add sl, sl, #16711680 ; 0xff0000
aed8: e28aacff add sl, sl, #65280 ; 0xff00
aedc: e28aa0f8 add sl, sl, #248 ; 0xf8
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
aee0: e08aa004 add sl, sl, r4
uintptr_t const alloc_block_begin =
(uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size );
uintptr_t const free_size = alloc_block_begin - block_begin;
if ( free_size >= min_block_size || free_size == 0 ) {
aee4: e59d1004 ldr r1, [sp, #4]
aee8: e060300a rsb r3, r0, sl
aeec: e15a0000 cmp sl, r0
aef0: 11510003 cmpne r1, r3
aef4: 8a000001 bhi af00 <_Heap_Allocate_aligned_with_boundary+0x1b4>
boundary
);
}
}
if ( alloc_begin != 0 ) {
aef8: e3540000 cmp r4, #0
aefc: 1a000004 bne af14 <_Heap_Allocate_aligned_with_boundary+0x1c8>
break;
}
block = block->next;
af00: e5999008 ldr r9, [r9, #8]
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
af04: e1570009 cmp r7, r9
af08: 1affffa5 bne ada4 <_Heap_Allocate_aligned_with_boundary+0x58>
af0c: e3a00000 mov r0, #0
af10: ea000008 b af38 <_Heap_Allocate_aligned_with_boundary+0x1ec>
block = block->next;
}
if ( alloc_begin != 0 ) {
/* Statistics */
stats->searches += search_count;
af14: e597304c ldr r3, [r7, #76] ; 0x4c
af18: e0833006 add r3, r3, r6
af1c: e587304c str r3, [r7, #76] ; 0x4c
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
af20: e1a00007 mov r0, r7
af24: e1a01009 mov r1, r9
af28: e1a02004 mov r2, r4
af2c: e1a03005 mov r3, r5
af30: ebffee2d bl 67ec <_Heap_Block_allocate>
af34: e1a00004 mov r0, r4
boundary
);
}
/* Statistics */
if ( stats->max_search < search_count ) {
af38: e5973044 ldr r3, [r7, #68] ; 0x44
af3c: e1530006 cmp r3, r6
stats->max_search = search_count;
af40: 35876044 strcc r6, [r7, #68] ; 0x44
}
return (void *) alloc_begin;
}
af44: e28dd01c add sp, sp, #28
af48: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
if ( boundary < alloc_size ) {
af4c: e1550003 cmp r5, r3
af50: 9a000006 bls af70 <_Heap_Allocate_aligned_with_boundary+0x224>
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
af54: e3a00000 mov r0, #0
af58: eafffff9 b af44 <_Heap_Allocate_aligned_with_boundary+0x1f8>
if ( alloc_begin != 0 ) {
break;
}
block = block->next;
af5c: e5999008 ldr r9, [r9, #8] <== NOT EXECUTED
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
af60: e1570009 cmp r7, r9 <== NOT EXECUTED
af64: e59d6018 ldr r6, [sp, #24] <== NOT EXECUTED
af68: 1affff8d bne ada4 <_Heap_Allocate_aligned_with_boundary+0x58><== NOT EXECUTED
af6c: eaffffe6 b af0c <_Heap_Allocate_aligned_with_boundary+0x1c0><== NOT EXECUTED
if ( boundary < alloc_size ) {
return NULL;
}
if ( alignment == 0 ) {
alignment = page_size;
af70: e3580000 cmp r8, #0
af74: 01a08002 moveq r8, r2
af78: eaffff81 b ad84 <_Heap_Allocate_aligned_with_boundary+0x38>
0000af7c <_Heap_Free>:
#include <rtems/system.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/heap.h>
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
af7c: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
af80: e1a04000 mov r4, r0
af84: e1a05001 mov r5, r1
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
af88: e1a00001 mov r0, r1
af8c: e5941010 ldr r1, [r4, #16]
af90: eb001522 bl 10420 <__umodsi3>
af94: e2455008 sub r5, r5, #8
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap(
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
af98: e5943020 ldr r3, [r4, #32]
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
af9c: e0605005 rsb r5, r0, r5
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;
afa0: e1550003 cmp r5, r3
afa4: 3a00002f bcc b068 <_Heap_Free+0xec>
afa8: e5941024 ldr r1, [r4, #36] ; 0x24
afac: e1550001 cmp r5, r1
afb0: 8a00002c bhi b068 <_Heap_Free+0xec>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
afb4: e595c004 ldr ip, [r5, #4]
- 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;
afb8: e3cc6001 bic r6, ip, #1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
afbc: e0852006 add r2, r5, r6
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;
afc0: e1530002 cmp r3, r2
afc4: 8a000027 bhi b068 <_Heap_Free+0xec>
afc8: e1510002 cmp r1, r2
afcc: 3a000027 bcc b070 <_Heap_Free+0xf4>
afd0: e5927004 ldr r7, [r2, #4]
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
_HAssert( false );
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
afd4: e2170001 ands r0, r7, #1
afd8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
return false;
}
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
afdc: e1510002 cmp r1, r2
- 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;
afe0: e3c77001 bic r7, r7, #1
afe4: 03a08000 moveq r8, #0
afe8: 0a000004 beq b000 <_Heap_Free+0x84>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
afec: e0820007 add r0, r2, 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;
aff0: e5900004 ldr r0, [r0, #4]
#include <rtems/system.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/heap.h>
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
aff4: e3100001 tst r0, #1
aff8: 13a08000 movne r8, #0
affc: 03a08001 moveq r8, #1
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
if ( !_Heap_Is_prev_used( block ) ) {
b000: e21c0001 ands r0, ip, #1
b004: 1a00001b bne b078 <_Heap_Free+0xfc>
uintptr_t const prev_size = block->prev_size;
b008: e595c000 ldr ip, [r5]
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
b00c: e06ca005 rsb sl, ip, r5
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;
b010: e153000a cmp r3, sl
b014: 88bd85f0 pophi {r4, r5, r6, r7, r8, sl, pc}
b018: e151000a cmp r1, sl
b01c: 38bd85f0 popcc {r4, r5, r6, r7, r8, sl, pc}
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;
b020: e59a0004 ldr r0, [sl, #4]
return( false );
}
/* As we always coalesce free blocks, the block that preceedes prev_block
must have been used. */
if ( !_Heap_Is_prev_used ( prev_block) ) {
b024: e2100001 ands r0, r0, #1
b028: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
b02c: e3580000 cmp r8, #0
b030: 0a000039 beq b11c <_Heap_Free+0x1a0>
uintptr_t const size = block_size + prev_size + next_block_size;
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
b034: e5940038 ldr r0, [r4, #56] ; 0x38
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
b038: e0867007 add r7, r6, r7
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b03c: e5923008 ldr r3, [r2, #8]
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
b040: e087c00c add ip, r7, ip
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b044: e592200c ldr r2, [r2, #12]
}
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
b048: e2400001 sub r0, r0, #1
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
b04c: e38c1001 orr r1, ip, #1
RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
{
Heap_Block *next = block->next;
Heap_Block *prev = block->prev;
prev->next = next;
b050: e5823008 str r3, [r2, #8]
next->prev = prev;
b054: e583200c str r2, [r3, #12]
}
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
b058: e5840038 str r0, [r4, #56] ; 0x38
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
b05c: e58a1004 str r1, [sl, #4]
next_block = _Heap_Block_at( prev_block, size );
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
b060: e78ac00c str ip, [sl, ip]
b064: ea00000f b b0a8 <_Heap_Free+0x12c>
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
_HAssert( false );
return false;
b068: e3a00000 mov r0, #0
b06c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
b070: e3a00000 mov r0, #0 <== NOT EXECUTED
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b074: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
uintptr_t const size = block_size + prev_size;
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
b078: e3580000 cmp r8, #0
b07c: 0a000014 beq b0d4 <_Heap_Free+0x158>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b080: e5923008 ldr r3, [r2, #8]
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
uintptr_t const size = block_size + next_block_size;
b084: e0877006 add r7, r7, r6
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b088: e592200c ldr r2, [r2, #12]
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
uintptr_t const size = block_size + next_block_size;
_Heap_Free_list_replace( next_block, block );
block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
b08c: e3871001 orr r1, r7, #1
)
{
Heap_Block *next = old_block->next;
Heap_Block *prev = old_block->prev;
new_block->next = next;
b090: e5853008 str r3, [r5, #8]
new_block->prev = prev;
b094: e585200c str r2, [r5, #12]
next->prev = new_block;
prev->next = new_block;
b098: e5825008 str r5, [r2, #8]
Heap_Block *prev = old_block->prev;
new_block->next = next;
new_block->prev = prev;
next->prev = new_block;
b09c: e583500c str r5, [r3, #12]
b0a0: e5851004 str r1, [r5, #4]
next_block = _Heap_Block_at( block, size );
next_block->prev_size = size;
b0a4: e7857007 str r7, [r5, r7]
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
b0a8: e5942040 ldr r2, [r4, #64] ; 0x40
++stats->frees;
b0ac: e5943050 ldr r3, [r4, #80] ; 0x50
stats->free_size += block_size;
b0b0: e5941030 ldr r1, [r4, #48] ; 0x30
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
b0b4: e2422001 sub r2, r2, #1
++stats->frees;
b0b8: e2833001 add r3, r3, #1
stats->free_size += block_size;
b0bc: e0816006 add r6, r1, r6
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
b0c0: e5842040 str r2, [r4, #64] ; 0x40
++stats->frees;
b0c4: e5843050 str r3, [r4, #80] ; 0x50
stats->free_size += block_size;
b0c8: e5846030 str r6, [r4, #48] ; 0x30
return( true );
b0cc: e3a00001 mov r0, #1
b0d0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
next_block->prev_size = size;
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
b0d4: e3863001 orr r3, r6, #1
b0d8: e5853004 str r3, [r5, #4]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
b0dc: e2843038 add r3, r4, #56 ; 0x38
b0e0: e8931008 ldm r3, {r3, ip}
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
b0e4: e5920004 ldr r0, [r2, #4]
RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after(
Heap_Block *block_before,
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
b0e8: e5941008 ldr r1, [r4, #8]
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
b0ec: e2833001 add r3, r3, #1
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
b0f0: e3c00001 bic r0, r0, #1
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
if ( stats->max_free_blocks < stats->free_blocks ) {
b0f4: e153000c cmp r3, ip
new_block->next = next;
b0f8: e5851008 str r1, [r5, #8]
new_block->prev = block_before;
b0fc: e585400c str r4, [r5, #12]
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
b100: e5820004 str r0, [r2, #4]
block_before->next = new_block;
next->prev = new_block;
b104: e581500c str r5, [r1, #12]
next_block->prev_size = block_size;
b108: e7856006 str r6, [r5, r6]
{
Heap_Block *next = block_before->next;
new_block->next = next;
new_block->prev = block_before;
block_before->next = new_block;
b10c: e5845008 str r5, [r4, #8]
/* Statistics */
++stats->free_blocks;
b110: e5843038 str r3, [r4, #56] ; 0x38
if ( stats->max_free_blocks < stats->free_blocks ) {
stats->max_free_blocks = stats->free_blocks;
b114: 8584303c strhi r3, [r4, #60] ; 0x3c
b118: eaffffe2 b b0a8 <_Heap_Free+0x12c>
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
next_block = _Heap_Block_at( prev_block, size );
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
} else { /* coalesce prev */
uintptr_t const size = block_size + prev_size;
b11c: e086c00c add ip, r6, ip
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
b120: e38c3001 orr r3, ip, #1
b124: e58a3004 str r3, [sl, #4]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
b128: e5923004 ldr r3, [r2, #4]
b12c: e3c33001 bic r3, r3, #1
b130: e5823004 str r3, [r2, #4]
next_block->prev_size = size;
b134: e785c006 str ip, [r5, r6]
b138: eaffffda b b0a8 <_Heap_Free+0x12c>
000122a8 <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
122a8: e92d40f0 push {r4, r5, r6, r7, lr}
122ac: e1a04000 mov r4, r0
122b0: e1a05001 mov r5, r1
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
122b4: e1a00001 mov r0, r1
122b8: e5941010 ldr r1, [r4, #16]
122bc: e1a07002 mov r7, r2
122c0: ebfff856 bl 10420 <__umodsi3>
122c4: e2456008 sub r6, r5, #8
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap(
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
122c8: e5943020 ldr r3, [r4, #32]
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
122cc: e0600006 rsb r0, r0, r6
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;
122d0: e1500003 cmp r0, r3
122d4: 3a000010 bcc 1231c <_Heap_Size_of_alloc_area+0x74>
122d8: e5942024 ldr r2, [r4, #36] ; 0x24
122dc: e1500002 cmp r0, r2
122e0: 8a00000d bhi 1231c <_Heap_Size_of_alloc_area+0x74>
- HEAP_BLOCK_HEADER_SIZE);
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
122e4: e5906004 ldr r6, [r0, #4]
122e8: e3c66001 bic r6, r6, #1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
122ec: e0806006 add r6, r0, r6
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;
122f0: e1530006 cmp r3, r6
122f4: 8a000008 bhi 1231c <_Heap_Size_of_alloc_area+0x74>
122f8: e1520006 cmp r2, r6
122fc: 3a000008 bcc 12324 <_Heap_Size_of_alloc_area+0x7c>
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;
12300: e5960004 ldr r0, [r6, #4]
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
12304: e2100001 ands r0, r0, #1
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin;
12308: 12655004 rsbne r5, r5, #4
1230c: 10856006 addne r6, r5, r6
12310: 15876000 strne r6, [r7]
return true;
12314: 13a00001 movne r0, #1
12318: e8bd80f0 pop {r4, r5, r6, r7, pc}
if (
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
) {
return false;
1231c: e3a00000 mov r0, #0
12320: e8bd80f0 pop {r4, r5, r6, r7, pc}
12324: e3a00000 mov r0, #0 <== NOT EXECUTED
}
*alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin;
return true;
}
12328: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
00007544 <_Heap_Walk>:
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
7544: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
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() ) ) {
7548: e59f35cc ldr r3, [pc, #1484] ; 7b1c <_Heap_Walk+0x5d8>
uintptr_t const min_block_size = heap->min_block_size;
Heap_Block *const first_block = heap->first_block;
Heap_Block *const last_block = heap->last_block;
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
754c: e31200ff tst r2, #255 ; 0xff
if ( !_System_state_Is_up( _System_state_Get() ) ) {
7550: e5933000 ldr r3, [r3]
uintptr_t const min_block_size = heap->min_block_size;
Heap_Block *const first_block = heap->first_block;
Heap_Block *const last_block = heap->last_block;
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
7554: e59f25c4 ldr r2, [pc, #1476] ; 7b20 <_Heap_Walk+0x5dc>
7558: e59f95c4 ldr r9, [pc, #1476] ; 7b24 <_Heap_Walk+0x5e0>
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
755c: e1a0a001 mov sl, r1
uintptr_t const min_block_size = heap->min_block_size;
Heap_Block *const first_block = heap->first_block;
Heap_Block *const last_block = heap->last_block;
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
7560: 11a09002 movne r9, r2
Heap_Control *heap,
int source,
bool dump
)
{
uintptr_t const page_size = heap->page_size;
7564: e5901010 ldr r1, [r0, #16]
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() ) ) {
7568: e3530003 cmp r3, #3
int source,
bool dump
)
{
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
756c: e5902014 ldr r2, [r0, #20]
Heap_Block *const first_block = heap->first_block;
Heap_Block *const last_block = heap->last_block;
7570: e5903024 ldr r3, [r0, #36] ; 0x24
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
7574: e24dd038 sub sp, sp, #56 ; 0x38
7578: e1a04000 mov r4, r0
uintptr_t const page_size = heap->page_size;
757c: e58d1024 str r1, [sp, #36] ; 0x24
uintptr_t const min_block_size = heap->min_block_size;
7580: e58d2028 str r2, [sp, #40] ; 0x28
Heap_Block *const first_block = heap->first_block;
7584: e5908020 ldr r8, [r0, #32]
Heap_Block *const last_block = heap->last_block;
7588: e58d302c str r3, [sp, #44] ; 0x2c
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() ) ) {
758c: 0a000002 beq 759c <_Heap_Walk+0x58>
}
block = next_block;
} while ( block != first_block );
return true;
7590: e3a00001 mov r0, #1
}
7594: e28dd038 add sp, sp, #56 ; 0x38
7598: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
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)(
759c: e594101c ldr r1, [r4, #28]
75a0: e5900018 ldr r0, [r0, #24]
75a4: e2842008 add r2, r4, #8
75a8: e892000c ldm r2, {r2, r3}
75ac: e59dc028 ldr ip, [sp, #40] ; 0x28
75b0: e58d1008 str r1, [sp, #8]
75b4: e59d102c ldr r1, [sp, #44] ; 0x2c
75b8: e58d0004 str r0, [sp, #4]
75bc: e58d1010 str r1, [sp, #16]
75c0: e58d2014 str r2, [sp, #20]
75c4: e58d3018 str r3, [sp, #24]
75c8: e59f2558 ldr r2, [pc, #1368] ; 7b28 <_Heap_Walk+0x5e4>
75cc: e58dc000 str ip, [sp]
75d0: e58d800c str r8, [sp, #12]
75d4: e1a0000a mov r0, sl
75d8: e3a01000 mov r1, #0
75dc: e59d3024 ldr r3, [sp, #36] ; 0x24
75e0: e1a0e00f mov lr, pc
75e4: e12fff19 bx r9
heap->area_begin, heap->area_end,
first_block, last_block,
first_free_block, last_free_block
);
if ( page_size == 0 ) {
75e8: e59d2024 ldr r2, [sp, #36] ; 0x24
75ec: e3520000 cmp r2, #0
75f0: 0a000026 beq 7690 <_Heap_Walk+0x14c>
(*printer)( source, true, "page size is zero\n" );
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
75f4: e59d3024 ldr r3, [sp, #36] ; 0x24
75f8: e2135003 ands r5, r3, #3
75fc: 1a00002a bne 76ac <_Heap_Walk+0x168>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
7600: e59d0028 ldr r0, [sp, #40] ; 0x28
7604: e59d1024 ldr r1, [sp, #36] ; 0x24
7608: ebffe564 bl ba0 <__umodsi3>
);
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
760c: e250b000 subs fp, r0, #0
7610: 1a00002c bne 76c8 <_Heap_Walk+0x184>
7614: e2880008 add r0, r8, #8
7618: e59d1024 ldr r1, [sp, #36] ; 0x24
761c: ebffe55f bl ba0 <__umodsi3>
);
return false;
}
if (
7620: e2506000 subs r6, r0, #0
7624: 1a00002f bne 76e8 <_Heap_Walk+0x1a4>
block = next_block;
} while ( block != first_block );
return true;
}
7628: e598b004 ldr fp, [r8, #4]
);
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
762c: e21b5001 ands r5, fp, #1
7630: 0a0000cd beq 796c <_Heap_Walk+0x428>
- 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;
7634: e59dc02c ldr ip, [sp, #44] ; 0x2c
7638: e59c3004 ldr r3, [ip, #4]
763c: e3c33001 bic r3, r3, #1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
7640: e08c3003 add r3, ip, 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;
7644: e5935004 ldr r5, [r3, #4]
);
return false;
}
if ( _Heap_Is_free( last_block ) ) {
7648: e2155001 ands r5, r5, #1
764c: 0a000008 beq 7674 <_Heap_Walk+0x130>
);
return false;
}
if (
7650: e1580003 cmp r8, r3
7654: 0a00002b beq 7708 <_Heap_Walk+0x1c4>
_Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block
) {
(*printer)(
7658: e1a0000a mov r0, sl <== NOT EXECUTED
765c: e3a01001 mov r1, #1 <== NOT EXECUTED
7660: e59f24c4 ldr r2, [pc, #1220] ; 7b2c <_Heap_Walk+0x5e8> <== NOT EXECUTED
7664: e1a0e00f mov lr, pc <== NOT EXECUTED
7668: e12fff19 bx r9 <== NOT EXECUTED
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
766c: e1a00006 mov r0, r6 <== NOT EXECUTED
7670: eaffffc7 b 7594 <_Heap_Walk+0x50> <== NOT EXECUTED
return false;
}
if ( _Heap_Is_free( last_block ) ) {
(*printer)(
7674: e1a0000a mov r0, sl
7678: e3a01001 mov r1, #1
767c: e59f24ac ldr r2, [pc, #1196] ; 7b30 <_Heap_Walk+0x5ec>
7680: e1a0e00f mov lr, pc
7684: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7688: e1a00005 mov r0, r5
768c: eaffffc0 b 7594 <_Heap_Walk+0x50>
first_block, last_block,
first_free_block, last_free_block
);
if ( page_size == 0 ) {
(*printer)( source, true, "page size is zero\n" );
7690: e1a0000a mov r0, sl
7694: e3a01001 mov r1, #1
7698: e59f2494 ldr r2, [pc, #1172] ; 7b34 <_Heap_Walk+0x5f0>
769c: e1a0e00f mov lr, pc
76a0: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
76a4: e59d0024 ldr r0, [sp, #36] ; 0x24
76a8: eaffffb9 b 7594 <_Heap_Walk+0x50>
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
(*printer)(
76ac: e1a0000a mov r0, sl
76b0: e3a01001 mov r1, #1
76b4: e59f247c ldr r2, [pc, #1148] ; 7b38 <_Heap_Walk+0x5f4>
76b8: e1a0e00f mov lr, pc
76bc: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
76c0: e3a00000 mov r0, #0
76c4: eaffffb2 b 7594 <_Heap_Walk+0x50>
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
(*printer)(
76c8: e1a0000a mov r0, sl
76cc: e3a01001 mov r1, #1
76d0: e59f2464 ldr r2, [pc, #1124] ; 7b3c <_Heap_Walk+0x5f8>
76d4: e59d3028 ldr r3, [sp, #40] ; 0x28
76d8: e1a0e00f mov lr, pc
76dc: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
76e0: e1a00005 mov r0, r5
76e4: eaffffaa b 7594 <_Heap_Walk+0x50>
}
if (
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size )
) {
(*printer)(
76e8: e1a0000a mov r0, sl
76ec: e3a01001 mov r1, #1
76f0: e59f2448 ldr r2, [pc, #1096] ; 7b40 <_Heap_Walk+0x5fc>
76f4: e1a03008 mov r3, r8
76f8: e1a0e00f mov lr, pc
76fc: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7700: e1a0000b mov r0, fp
7704: eaffffa2 b 7594 <_Heap_Walk+0x50>
block = next_block;
} while ( block != first_block );
return true;
}
7708: e5945008 ldr r5, [r4, #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 ) {
770c: e1540005 cmp r4, r5
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
7710: e5947010 ldr r7, [r4, #16]
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 ) {
7714: 05943020 ldreq r3, [r4, #32]
7718: 0a00000d beq 7754 <_Heap_Walk+0x210>
block = next_block;
} while ( block != first_block );
return true;
}
771c: e5943020 ldr r3, [r4, #32]
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;
7720: e1530005 cmp r3, r5
7724: 9a000097 bls 7988 <_Heap_Walk+0x444>
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 ) ) {
(*printer)(
7728: e1a0000a mov r0, sl
772c: e3a01001 mov r1, #1
7730: e59f240c ldr r2, [pc, #1036] ; 7b44 <_Heap_Walk+0x600>
7734: e1a03005 mov r3, r5
7738: e1a0e00f mov lr, pc
773c: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7740: e3a00000 mov r0, #0
7744: eaffff92 b 7594 <_Heap_Walk+0x50>
7748: e1a03008 mov r3, r8
774c: e28d8030 add r8, sp, #48 ; 0x30
7750: e8980900 ldm r8, {r8, fp}
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
7754: e1a06008 mov r6, r8
- 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;
7758: e3cb7001 bic r7, fp, #1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
775c: e0875006 add r5, r7, r6
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;
7760: e1530005 cmp r3, r5
7764: 9a000008 bls 778c <_Heap_Walk+0x248>
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 ) ) {
(*printer)(
7768: e1a0000a mov r0, sl
776c: e58d5000 str r5, [sp]
7770: e3a01001 mov r1, #1
7774: e59f23cc ldr r2, [pc, #972] ; 7b48 <_Heap_Walk+0x604>
7778: e1a03006 mov r3, r6
777c: e1a0e00f mov lr, pc
7780: e12fff19 bx r9
"block 0x%08x: next block 0x%08x not in heap\n",
block,
next_block
);
return false;
7784: e3a00000 mov r0, #0
7788: eaffff81 b 7594 <_Heap_Walk+0x50>
778c: e5943024 ldr r3, [r4, #36] ; 0x24
7790: e1530005 cmp r3, r5
7794: 3afffff3 bcc 7768 <_Heap_Walk+0x224>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
7798: e59d1024 ldr r1, [sp, #36] ; 0x24
779c: e1a00007 mov r0, r7
77a0: ebffe4fe bl ba0 <__umodsi3>
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;
77a4: e59d102c ldr r1, [sp, #44] ; 0x2c
77a8: e0563001 subs r3, r6, r1
77ac: 13a03001 movne r3, #1
);
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
77b0: e3500000 cmp r0, #0
77b4: 0a000001 beq 77c0 <_Heap_Walk+0x27c>
77b8: e3530000 cmp r3, #0
77bc: 1a0000aa bne 7a6c <_Heap_Walk+0x528>
);
return false;
}
if ( block_size < min_block_size && is_not_last_block ) {
77c0: e59d2028 ldr r2, [sp, #40] ; 0x28
77c4: e1520007 cmp r2, r7
77c8: 9a000001 bls 77d4 <_Heap_Walk+0x290>
77cc: e3530000 cmp r3, #0
77d0: 1a0000ae bne 7a90 <_Heap_Walk+0x54c>
);
return false;
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
77d4: e1560005 cmp r6, r5
77d8: 3a000001 bcc 77e4 <_Heap_Walk+0x2a0>
77dc: e3530000 cmp r3, #0
77e0: 1a0000b4 bne 7ab8 <_Heap_Walk+0x574>
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;
77e4: e5953004 ldr r3, [r5, #4]
);
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
77e8: e3130001 tst r3, #1
77ec: e20bb001 and fp, fp, #1
77f0: 0a000018 beq 7858 <_Heap_Walk+0x314>
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
}
} else if (prev_used) {
77f4: e35b0000 cmp fp, #0
77f8: 0a00000c beq 7830 <_Heap_Walk+0x2ec>
(*printer)(
77fc: e58d7000 str r7, [sp]
7800: e1a0000a mov r0, sl
7804: e3a01000 mov r1, #0
7808: e59f233c ldr r2, [pc, #828] ; 7b4c <_Heap_Walk+0x608>
780c: e1a03006 mov r3, r6
7810: e1a0e00f mov lr, pc
7814: e12fff19 bx r9
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
7818: e1580005 cmp r8, r5
781c: 0affff5b beq 7590 <_Heap_Walk+0x4c>
7820: e595b004 ldr fp, [r5, #4]
7824: e5943020 ldr r3, [r4, #32]
7828: e1a06005 mov r6, r5
782c: eaffffc9 b 7758 <_Heap_Walk+0x214>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
7830: e58d7000 str r7, [sp]
7834: e5963000 ldr r3, [r6]
7838: e1a0000a mov r0, sl
783c: e58d3004 str r3, [sp, #4]
7840: e1a0100b mov r1, fp
7844: e59f2304 ldr r2, [pc, #772] ; 7b50 <_Heap_Walk+0x60c>
7848: e1a03006 mov r3, r6
784c: e1a0e00f mov lr, pc
7850: e12fff19 bx r9
7854: eaffffef b 7818 <_Heap_Walk+0x2d4>
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 ?
7858: e596200c ldr r2, [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)(
785c: e5943008 ldr r3, [r4, #8]
7860: e1530002 cmp r3, r2
block = next_block;
} while ( block != first_block );
return true;
}
7864: e594100c ldr r1, [r4, #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)(
7868: 059f02e4 ldreq r0, [pc, #740] ; 7b54 <_Heap_Walk+0x610>
786c: 0a000003 beq 7880 <_Heap_Walk+0x33c>
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
7870: e59f32e0 ldr r3, [pc, #736] ; 7b58 <_Heap_Walk+0x614>
7874: e1540002 cmp r4, r2
7878: e59f02dc ldr r0, [pc, #732] ; 7b5c <_Heap_Walk+0x618>
787c: 01a00003 moveq r0, r3
block->next,
block->next == last_free_block ?
7880: e5963008 ldr r3, [r6, #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)(
7884: e1510003 cmp r1, r3
7888: 059f12d0 ldreq r1, [pc, #720] ; 7b60 <_Heap_Walk+0x61c>
788c: 0a000003 beq 78a0 <_Heap_Walk+0x35c>
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
7890: e59fc2cc ldr ip, [pc, #716] ; 7b64 <_Heap_Walk+0x620>
7894: e1540003 cmp r4, r3
7898: e59f12bc ldr r1, [pc, #700] ; 7b5c <_Heap_Walk+0x618>
789c: 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)(
78a0: e58d2004 str r2, [sp, #4]
78a4: e58d0008 str r0, [sp, #8]
78a8: e58d300c str r3, [sp, #12]
78ac: e58d1010 str r1, [sp, #16]
78b0: e1a03006 mov r3, r6
78b4: e58d7000 str r7, [sp]
78b8: e1a0000a mov r0, sl
78bc: e3a01000 mov r1, #0
78c0: e59f22a0 ldr r2, [pc, #672] ; 7b68 <_Heap_Walk+0x624>
78c4: e1a0e00f mov lr, pc
78c8: e12fff19 bx r9
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
78cc: e5953000 ldr r3, [r5]
78d0: e1570003 cmp r7, r3
78d4: 1a000011 bne 7920 <_Heap_Walk+0x3dc>
);
return false;
}
if ( !prev_used ) {
78d8: e35b0000 cmp fp, #0
78dc: 0a00001a beq 794c <_Heap_Walk+0x408>
block = next_block;
} while ( block != first_block );
return true;
}
78e0: e5943008 ldr r3, [r4, #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 ) {
78e4: e1540003 cmp r4, r3
78e8: 0a000004 beq 7900 <_Heap_Walk+0x3bc>
if ( free_block == block ) {
78ec: e1560003 cmp r6, r3
78f0: 0affffc8 beq 7818 <_Heap_Walk+0x2d4>
return true;
}
free_block = free_block->next;
78f4: 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 ) {
78f8: e1540003 cmp r4, r3
78fc: 1afffffa bne 78ec <_Heap_Walk+0x3a8>
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
7900: e1a0000a mov r0, sl
7904: e3a01001 mov r1, #1
7908: e59f225c ldr r2, [pc, #604] ; 7b6c <_Heap_Walk+0x628>
790c: e1a03006 mov r3, r6
7910: e1a0e00f mov lr, pc
7914: e12fff19 bx r9
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
7918: e3a00000 mov r0, #0
791c: eaffff1c b 7594 <_Heap_Walk+0x50>
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
(*printer)(
7920: e58d3004 str r3, [sp, #4]
7924: e1a0000a mov r0, sl
7928: e58d7000 str r7, [sp]
792c: e58d5008 str r5, [sp, #8]
7930: e3a01001 mov r1, #1
7934: e59f2234 ldr r2, [pc, #564] ; 7b70 <_Heap_Walk+0x62c>
7938: e1a03006 mov r3, r6
793c: e1a0e00f mov lr, pc
7940: e12fff19 bx r9
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
7944: e3a00000 mov r0, #0
7948: eaffff11 b 7594 <_Heap_Walk+0x50>
return false;
}
if ( !prev_used ) {
(*printer)(
794c: e1a0000a mov r0, sl
7950: e3a01001 mov r1, #1
7954: e59f2218 ldr r2, [pc, #536] ; 7b74 <_Heap_Walk+0x630>
7958: e1a03006 mov r3, r6
795c: e1a0e00f mov lr, pc
7960: e12fff19 bx r9
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
7964: e1a0000b mov r0, fp
7968: eaffff09 b 7594 <_Heap_Walk+0x50>
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
(*printer)(
796c: e1a0000a mov r0, sl
7970: e3a01001 mov r1, #1
7974: e59f21fc ldr r2, [pc, #508] ; 7b78 <_Heap_Walk+0x634>
7978: e1a0e00f mov lr, pc
797c: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7980: e1a00005 mov r0, r5
7984: eaffff02 b 7594 <_Heap_Walk+0x50>
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;
7988: e594c024 ldr ip, [r4, #36] ; 0x24
798c: e15c0005 cmp ip, r5
7990: 3affff64 bcc 7728 <_Heap_Walk+0x1e4>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
7994: e2850008 add r0, r5, #8
7998: e1a01007 mov r1, r7
799c: e58d301c str r3, [sp, #28]
79a0: e58dc020 str ip, [sp, #32]
79a4: ebffe47d bl ba0 <__umodsi3>
);
return false;
}
if (
79a8: e3500000 cmp r0, #0
79ac: e28d301c add r3, sp, #28
79b0: e8931008 ldm r3, {r3, ip}
79b4: 1a000048 bne 7adc <_Heap_Walk+0x598>
- 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;
79b8: e5952004 ldr r2, [r5, #4]
79bc: e3c22001 bic r2, r2, #1
block = next_block;
} while ( block != first_block );
return true;
}
79c0: e0852002 add r2, r5, r2
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;
79c4: e5922004 ldr r2, [r2, #4]
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
79c8: e3120001 tst r2, #1
79cc: 1a00004a bne 7afc <_Heap_Walk+0x5b8>
79d0: e58d8030 str r8, [sp, #48] ; 0x30
79d4: e58db034 str fp, [sp, #52] ; 0x34
79d8: e1a01004 mov r1, r4
79dc: e1a06005 mov r6, r5
79e0: e1a0b00c mov fp, ip
79e4: e1a08003 mov r8, r3
79e8: ea000013 b 7a3c <_Heap_Walk+0x4f8>
return false;
}
prev_block = free_block;
free_block = free_block->next;
79ec: e5955008 ldr r5, [r5, #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 ) {
79f0: e1540005 cmp r4, r5
79f4: 0affff53 beq 7748 <_Heap_Walk+0x204>
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;
79f8: e1580005 cmp r8, r5
79fc: 8affff49 bhi 7728 <_Heap_Walk+0x1e4>
7a00: e155000b cmp r5, fp
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
7a04: e2850008 add r0, r5, #8
7a08: e1a01007 mov r1, r7
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;
7a0c: 8affff45 bhi 7728 <_Heap_Walk+0x1e4>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
7a10: ebffe462 bl ba0 <__umodsi3>
);
return false;
}
if (
7a14: e3500000 cmp r0, #0
7a18: 1a00002f bne 7adc <_Heap_Walk+0x598>
- 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;
7a1c: e5953004 ldr r3, [r5, #4]
7a20: e3c33001 bic r3, r3, #1
block = next_block;
} while ( block != first_block );
return true;
}
7a24: e0833005 add r3, r3, r5
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;
7a28: e5933004 ldr r3, [r3, #4]
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
7a2c: e3130001 tst r3, #1
7a30: 1a000031 bne 7afc <_Heap_Walk+0x5b8>
7a34: e1a01006 mov r1, r6
7a38: e1a06005 mov r6, r5
);
return false;
}
if ( free_block->prev != prev_block ) {
7a3c: e595200c ldr r2, [r5, #12]
7a40: e1520001 cmp r2, r1
7a44: 0affffe8 beq 79ec <_Heap_Walk+0x4a8>
(*printer)(
7a48: e58d2000 str r2, [sp]
7a4c: e1a0000a mov r0, sl
7a50: e3a01001 mov r1, #1
7a54: e59f2120 ldr r2, [pc, #288] ; 7b7c <_Heap_Walk+0x638>
7a58: e1a03005 mov r3, r5
7a5c: e1a0e00f mov lr, pc
7a60: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7a64: e3a00000 mov r0, #0
7a68: eafffec9 b 7594 <_Heap_Walk+0x50>
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
(*printer)(
7a6c: e1a0000a mov r0, sl
7a70: e58d7000 str r7, [sp]
7a74: e3a01001 mov r1, #1
7a78: e59f2100 ldr r2, [pc, #256] ; 7b80 <_Heap_Walk+0x63c>
7a7c: e1a03006 mov r3, r6
7a80: e1a0e00f mov lr, pc
7a84: e12fff19 bx r9
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
7a88: e3a00000 mov r0, #0
7a8c: eafffec0 b 7594 <_Heap_Walk+0x50>
}
if ( block_size < min_block_size && is_not_last_block ) {
(*printer)(
7a90: e58d2004 str r2, [sp, #4]
7a94: e1a0000a mov r0, sl
7a98: e58d7000 str r7, [sp]
7a9c: e3a01001 mov r1, #1
7aa0: e59f20dc ldr r2, [pc, #220] ; 7b84 <_Heap_Walk+0x640>
7aa4: e1a03006 mov r3, r6
7aa8: e1a0e00f mov lr, pc
7aac: e12fff19 bx r9
block,
block_size,
min_block_size
);
return false;
7ab0: e3a00000 mov r0, #0
7ab4: eafffeb6 b 7594 <_Heap_Walk+0x50>
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
(*printer)(
7ab8: e1a0000a mov r0, sl
7abc: e58d5000 str r5, [sp]
7ac0: e3a01001 mov r1, #1
7ac4: e59f20bc ldr r2, [pc, #188] ; 7b88 <_Heap_Walk+0x644>
7ac8: e1a03006 mov r3, r6
7acc: e1a0e00f mov lr, pc
7ad0: e12fff19 bx r9
"block 0x%08x: next block 0x%08x is not a successor\n",
block,
next_block
);
return false;
7ad4: e3a00000 mov r0, #0
7ad8: eafffead b 7594 <_Heap_Walk+0x50>
}
if (
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size )
) {
(*printer)(
7adc: e1a0000a mov r0, sl
7ae0: e3a01001 mov r1, #1
7ae4: e59f20a0 ldr r2, [pc, #160] ; 7b8c <_Heap_Walk+0x648>
7ae8: e1a03005 mov r3, r5
7aec: e1a0e00f mov lr, pc
7af0: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7af4: e3a00000 mov r0, #0
7af8: eafffea5 b 7594 <_Heap_Walk+0x50>
return false;
}
if ( _Heap_Is_used( free_block ) ) {
(*printer)(
7afc: e1a0000a mov r0, sl
7b00: e3a01001 mov r1, #1
7b04: e59f2084 ldr r2, [pc, #132] ; 7b90 <_Heap_Walk+0x64c>
7b08: e1a03005 mov r3, r5
7b0c: e1a0e00f mov lr, pc
7b10: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7b14: e3a00000 mov r0, #0
7b18: eafffe9d b 7594 <_Heap_Walk+0x50>
00006a38 <_Objects_Extend_information>:
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
6a38: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
minimum_index = _Objects_Get_index( information->minimum_id );
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
6a3c: e5904034 ldr r4, [r0, #52] ; 0x34
6a40: e3540000 cmp r4, #0
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
6a44: e24dd014 sub sp, sp, #20
6a48: e1a05000 mov r5, r0
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
6a4c: e1d070b8 ldrh r7, [r0, #8]
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
6a50: 0a00009b beq 6cc4 <_Objects_Extend_information+0x28c>
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
6a54: e1d081b4 ldrh r8, [r0, #20]
6a58: e1d0a1b0 ldrh sl, [r0, #16]
6a5c: e1a01008 mov r1, r8
6a60: e1a0000a mov r0, sl
6a64: eb002627 bl 10308 <__aeabi_uidiv>
6a68: e1a03800 lsl r3, r0, #16
for ( ; block < block_count; block++ ) {
6a6c: e1b03823 lsrs r3, r3, #16
6a70: 0a000099 beq 6cdc <_Objects_Extend_information+0x2a4>
if ( information->object_blocks[ block ] == NULL ) {
6a74: e5949000 ldr r9, [r4]
6a78: e3590000 cmp r9, #0
6a7c: 01a01008 moveq r1, r8
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
6a80: 01a06007 moveq r6, r7
index_base = minimum_index;
block = 0;
6a84: 01a04009 moveq r4, r9
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
if ( information->object_blocks[ block ] == NULL ) {
6a88: 0a00000c beq 6ac0 <_Objects_Extend_information+0x88>
6a8c: e1a02004 mov r2, r4
6a90: e1a01008 mov r1, r8
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
6a94: e1a06007 mov r6, r7
index_base = minimum_index;
block = 0;
6a98: e3a04000 mov r4, #0
6a9c: ea000002 b 6aac <_Objects_Extend_information+0x74>
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
if ( information->object_blocks[ block ] == NULL ) {
6aa0: e5b29004 ldr r9, [r2, #4]!
6aa4: e3590000 cmp r9, #0
6aa8: 0a000004 beq 6ac0 <_Objects_Extend_information+0x88>
if ( information->object_blocks == NULL )
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
6aac: e2844001 add r4, r4, #1
6ab0: e1530004 cmp r3, r4
if ( information->object_blocks[ block ] == NULL ) {
do_extend = false;
break;
} else
index_base += information->allocation_size;
6ab4: e0866008 add r6, r6, r8
if ( information->object_blocks == NULL )
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
6ab8: 8afffff8 bhi 6aa0 <_Objects_Extend_information+0x68>
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
6abc: e3a09001 mov r9, #1
} else
index_base += information->allocation_size;
}
}
maximum = (uint32_t) information->maximum + information->allocation_size;
6ac0: e08aa001 add sl, sl, r1
/*
* We need to limit the number of objects to the maximum number
* representable in the index portion of the object Id. In the
* case of 16-bit Ids, this is only 256 object instances.
*/
if ( maximum > OBJECTS_ID_FINAL_INDEX ) {
6ac4: e35a0801 cmp sl, #65536 ; 0x10000
6ac8: 2a000063 bcs 6c5c <_Objects_Extend_information+0x224>
/*
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
block_size = information->allocation_size * information->size;
if ( information->auto_extend ) {
6acc: e5d52012 ldrb r2, [r5, #18]
/*
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
block_size = information->allocation_size * information->size;
6ad0: e5950018 ldr r0, [r5, #24]
if ( information->auto_extend ) {
6ad4: e3520000 cmp r2, #0
/*
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
block_size = information->allocation_size * information->size;
6ad8: e0000091 mul r0, r1, r0
if ( information->auto_extend ) {
6adc: 1a000060 bne 6c64 <_Objects_Extend_information+0x22c>
new_object_block = _Workspace_Allocate( block_size );
if ( !new_object_block )
return;
} else {
new_object_block = _Workspace_Allocate_or_fatal_error( block_size );
6ae0: e58d3000 str r3, [sp]
6ae4: eb00080e bl 8b24 <_Workspace_Allocate_or_fatal_error>
6ae8: e59d3000 ldr r3, [sp]
6aec: e1a08000 mov r8, r0
}
/*
* Do we need to grow the tables?
*/
if ( do_extend ) {
6af0: e3590000 cmp r9, #0
6af4: 0a000039 beq 6be0 <_Objects_Extend_information+0x1a8>
*/
/*
* Up the block count and maximum
*/
block_count++;
6af8: e283b001 add fp, r3, #1
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
6afc: e08b008b add r0, fp, fp, lsl #1
((maximum + minimum_index) * sizeof(Objects_Control *));
6b00: e08a0000 add r0, sl, r0
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
6b04: e0800007 add r0, r0, r7
((maximum + minimum_index) * sizeof(Objects_Control *));
object_blocks = (void**) _Workspace_Allocate( block_size );
6b08: e1a00100 lsl r0, r0, #2
6b0c: e58d3000 str r3, [sp]
6b10: eb0007f9 bl 8afc <_Workspace_Allocate>
if ( !object_blocks ) {
6b14: e2509000 subs r9, r0, #0
6b18: e59d3000 ldr r3, [sp]
6b1c: 0a000073 beq 6cf0 <_Objects_Extend_information+0x2b8>
* Take the block count down. Saves all the (block_count - 1)
* in the copies.
*/
block_count--;
if ( information->maximum > minimum_index ) {
6b20: e1d521b0 ldrh r2, [r5, #16]
6b24: e1570002 cmp r7, r2
RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
const void *base,
uintptr_t offset
)
{
return (void *)((uintptr_t)base + offset);
6b28: e089c10b add ip, r9, fp, lsl #2
6b2c: e089b18b add fp, r9, fp, lsl #3
6b30: 3a000051 bcc 6c7c <_Objects_Extend_information+0x244>
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
6b34: e3570000 cmp r7, #0
6b38: 13a02000 movne r2, #0
6b3c: 11a0100b movne r1, fp
local_table[ index ] = NULL;
6b40: 11a00002 movne r0, r2
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
6b44: 0a000003 beq 6b58 <_Objects_Extend_information+0x120>
6b48: e2822001 add r2, r2, #1
6b4c: e1570002 cmp r7, r2
local_table[ index ] = NULL;
6b50: e4810004 str r0, [r1], #4
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
6b54: 8afffffb bhi 6b48 <_Objects_Extend_information+0x110>
6b58: e1a03103 lsl r3, r3, #2
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
index < ( information->allocation_size + index_base );
6b5c: e1d511b4 ldrh r1, [r5, #20]
6b60: e0861001 add r1, r6, r1
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
6b64: e3a00000 mov r0, #0
inactive_per_block[block_count] = 0;
for ( index=index_base ;
6b68: e1560001 cmp r6, r1
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
6b6c: e7890003 str r0, [r9, r3]
inactive_per_block[block_count] = 0;
6b70: e78c0003 str r0, [ip, r3]
for ( index=index_base ;
6b74: 2a000005 bcs 6b90 <_Objects_Extend_information+0x158>
6b78: e08b2106 add r2, fp, r6, lsl #2
* information - object information table
*
* Output parameters: NONE
*/
void _Objects_Extend_information(
6b7c: e1a03006 mov r3, r6
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
index < ( information->allocation_size + index_base );
index++ ) {
6b80: e2833001 add r3, r3, #1
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
6b84: e1530001 cmp r3, r1
index < ( information->allocation_size + index_base );
index++ ) {
local_table[ index ] = NULL;
6b88: e4820004 str r0, [r2], #4
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
6b8c: 3afffffb bcc 6b80 <_Objects_Extend_information+0x148>
6b90: e10f3000 mrs r3, CPSR
6b94: e3832080 orr r2, r3, #128 ; 0x80
6b98: e129f002 msr CPSR_fc, r2
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
6b9c: e5952000 ldr r2, [r5]
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
information->maximum = (Objects_Maximum) maximum;
information->maximum_id = _Objects_Build_id(
6ba0: e1d510b4 ldrh r1, [r5, #4]
6ba4: e1a02c02 lsl r2, r2, #24
old_tables = information->object_blocks;
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
information->maximum = (Objects_Maximum) maximum;
6ba8: e1a0a80a lsl sl, sl, #16
6bac: e3822801 orr r2, r2, #65536 ; 0x10000
6bb0: e1a0a82a lsr sl, sl, #16
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
6bb4: e1822d81 orr r2, r2, r1, lsl #27
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
6bb8: e182200a orr r2, r2, sl
local_table[ index ] = NULL;
}
_ISR_Disable( level );
old_tables = information->object_blocks;
6bbc: e5950034 ldr r0, [r5, #52] ; 0x34
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
6bc0: e585c030 str ip, [r5, #48] ; 0x30
_ISR_Disable( level );
old_tables = information->object_blocks;
information->object_blocks = object_blocks;
6bc4: e5859034 str r9, [r5, #52] ; 0x34
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
6bc8: e585b01c str fp, [r5, #28]
information->maximum = (Objects_Maximum) maximum;
6bcc: e1c5a1b0 strh sl, [r5, #16]
information->maximum_id = _Objects_Build_id(
6bd0: e585200c str r2, [r5, #12]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
6bd4: e129f003 msr CPSR_fc, r3
information->maximum
);
_ISR_Enable( level );
if ( old_tables )
6bd8: e3500000 cmp r0, #0
_Workspace_Free( old_tables );
6bdc: 1b0007cc blne 8b14 <_Workspace_Free>
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
6be0: e5953034 ldr r3, [r5, #52] ; 0x34
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
6be4: e28d7008 add r7, sp, #8
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
6be8: e7838104 str r8, [r3, r4, lsl #2]
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
6bec: e1a01008 mov r1, r8
6bf0: e1a00007 mov r0, r7
6bf4: e1d521b4 ldrh r2, [r5, #20]
6bf8: e5953018 ldr r3, [r5, #24]
6bfc: eb000fc3 bl ab10 <_Chain_Initialize>
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
6c00: e1a04104 lsl r4, r4, #2
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
6c04: e2858020 add r8, r5, #32
/*
* Move from the local chain, initialise, then append to the inactive chain
*/
index = index_base;
while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) {
6c08: ea000009 b 6c34 <_Objects_Extend_information+0x1fc>
6c0c: e5953000 ldr r3, [r5]
the_object->id = _Objects_Build_id(
6c10: e1d520b4 ldrh r2, [r5, #4]
6c14: e1a03c03 lsl r3, r3, #24
6c18: e3833801 orr r3, r3, #65536 ; 0x10000
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
6c1c: e1833d82 orr r3, r3, r2, lsl #27
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
6c20: e1833006 orr r3, r3, r6
6c24: e5813008 str r3, [r1, #8]
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
6c28: e1a00008 mov r0, r8
6c2c: ebfffce3 bl 5fc0 <_Chain_Append>
index++;
6c30: e2866001 add r6, r6, #1
/*
* Move from the local chain, initialise, then append to the inactive chain
*/
index = index_base;
while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) {
6c34: e1a00007 mov r0, r7
6c38: ebfffcf3 bl 600c <_Chain_Get>
6c3c: e2501000 subs r1, r0, #0
6c40: 1afffff1 bne 6c0c <_Objects_Extend_information+0x1d4>
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
information->inactive =
(Objects_Maximum)(information->inactive + information->allocation_size);
6c44: e1d522bc ldrh r2, [r5, #44] ; 0x2c
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
6c48: e1d531b4 ldrh r3, [r5, #20]
6c4c: e5951030 ldr r1, [r5, #48] ; 0x30
information->inactive =
(Objects_Maximum)(information->inactive + information->allocation_size);
6c50: e0832002 add r2, r3, r2
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
6c54: e7813004 str r3, [r1, r4]
information->inactive =
6c58: e1c522bc strh r2, [r5, #44] ; 0x2c
(Objects_Maximum)(information->inactive + information->allocation_size);
}
6c5c: e28dd014 add sp, sp, #20
6c60: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
block_size = information->allocation_size * information->size;
if ( information->auto_extend ) {
new_object_block = _Workspace_Allocate( block_size );
6c64: e58d3000 str r3, [sp]
6c68: eb0007a3 bl 8afc <_Workspace_Allocate>
if ( !new_object_block )
6c6c: e2508000 subs r8, r0, #0
6c70: e59d3000 ldr r3, [sp]
6c74: 1affff9d bne 6af0 <_Objects_Extend_information+0xb8>
6c78: eafffff7 b 6c5c <_Objects_Extend_information+0x224>
/*
* Copy each section of the table over. This has to be performed as
* separate parts as size of each block has changed.
*/
memcpy( object_blocks,
6c7c: e1a03103 lsl r3, r3, #2
6c80: e5951034 ldr r1, [r5, #52] ; 0x34
6c84: e1a02003 mov r2, r3
6c88: e88d1008 stm sp, {r3, ip}
6c8c: eb001a1c bl d504 <memcpy>
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
6c90: e89d1008 ldm sp, {r3, ip}
6c94: e1a0000c mov r0, ip
6c98: e1a02003 mov r2, r3
6c9c: e5951030 ldr r1, [r5, #48] ; 0x30
6ca0: eb001a17 bl d504 <memcpy>
information->inactive_per_block,
block_count * sizeof(uint32_t) );
memcpy( local_table,
information->local_table,
(information->maximum + minimum_index) * sizeof(Objects_Control *) );
6ca4: e1d521b0 ldrh r2, [r5, #16]
6ca8: e0872002 add r2, r7, r2
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
information->inactive_per_block,
block_count * sizeof(uint32_t) );
memcpy( local_table,
6cac: e1a0000b mov r0, fp
6cb0: e595101c ldr r1, [r5, #28]
6cb4: e1a02102 lsl r2, r2, #2
6cb8: eb001a11 bl d504 <memcpy>
6cbc: e89d1008 ldm sp, {r3, ip}
6cc0: eaffffa5 b 6b5c <_Objects_Extend_information+0x124>
minimum_index = _Objects_Get_index( information->minimum_id );
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
6cc4: e1d0a1b0 ldrh sl, [r0, #16]
6cc8: e1d011b4 ldrh r1, [r0, #20]
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
6ccc: e1a06007 mov r6, r7
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
6cd0: e3a09001 mov r9, #1
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
block_count = 0;
6cd4: e1a03004 mov r3, r4
6cd8: eaffff78 b 6ac0 <_Objects_Extend_information+0x88>
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
6cdc: e1a01008 mov r1, r8 <== NOT EXECUTED
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
6ce0: e1a06007 mov r6, r7 <== NOT EXECUTED
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
6ce4: e3a09001 mov r9, #1 <== NOT EXECUTED
minimum_index = _Objects_Get_index( information->minimum_id );
index_base = minimum_index;
block = 0;
6ce8: e1a04003 mov r4, r3 <== NOT EXECUTED
6cec: eaffff73 b 6ac0 <_Objects_Extend_information+0x88> <== NOT EXECUTED
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
((maximum + minimum_index) * sizeof(Objects_Control *));
object_blocks = (void**) _Workspace_Allocate( block_size );
if ( !object_blocks ) {
_Workspace_Free( new_object_block );
6cf0: e1a00008 mov r0, r8
6cf4: eb000786 bl 8b14 <_Workspace_Free>
return;
6cf8: eaffffd7 b 6c5c <_Objects_Extend_information+0x224>
00007034 <_Objects_Shrink_information>:
*/
void _Objects_Shrink_information(
Objects_Information *information
)
{
7034: e92d40f0 push {r4, r5, r6, r7, lr}
/*
* Search the list to find block or chunk with all objects inactive.
*/
index_base = _Objects_Get_index( information->minimum_id );
7038: e1d040b8 ldrh r4, [r0, #8]
block_count = (information->maximum - index_base) /
703c: e1d051b4 ldrh r5, [r0, #20]
*/
void _Objects_Shrink_information(
Objects_Information *information
)
{
7040: e1a06000 mov r6, r0
/*
* Search the list to find block or chunk with all objects inactive.
*/
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
7044: e1d001b0 ldrh r0, [r0, #16]
7048: e1a01005 mov r1, r5
704c: e0640000 rsb r0, r4, r0
7050: eb0024ac bl 10308 <__aeabi_uidiv>
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
7054: e3500000 cmp r0, #0
7058: 08bd80f0 popeq {r4, r5, r6, r7, pc}
if ( information->inactive_per_block[ block ] ==
705c: e5962030 ldr r2, [r6, #48] ; 0x30
7060: e5923000 ldr r3, [r2]
7064: e1550003 cmp r5, r3
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
7068: 13a03000 movne r3, #0
if ( information->inactive_per_block[ block ] ==
706c: 1a000005 bne 7088 <_Objects_Shrink_information+0x54>
7070: ea000008 b 7098 <_Objects_Shrink_information+0x64> <== NOT EXECUTED
7074: e5b21004 ldr r1, [r2, #4]!
7078: e1550001 cmp r5, r1
information->inactive -= information->allocation_size;
return;
}
index_base += information->allocation_size;
707c: e0844005 add r4, r4, r5
7080: e1a07103 lsl r7, r3, #2
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
if ( information->inactive_per_block[ block ] ==
7084: 0a000004 beq 709c <_Objects_Shrink_information+0x68>
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
7088: e2833001 add r3, r3, #1
708c: e1500003 cmp r0, r3
7090: 8afffff7 bhi 7074 <_Objects_Shrink_information+0x40>
7094: e8bd80f0 pop {r4, r5, r6, r7, pc}
if ( information->inactive_per_block[ block ] ==
7098: e3a07000 mov r7, #0 <== NOT EXECUTED
information->allocation_size ) {
/*
* Assume the Inactive chain is never empty at this point
*/
the_object = (Objects_Control *) information->Inactive.first;
709c: e5960020 ldr r0, [r6, #32]
70a0: ea000002 b 70b0 <_Objects_Shrink_information+0x7c>
if ((index >= index_base) &&
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
}
}
while ( the_object );
70a4: e3550000 cmp r5, #0
70a8: 0a00000b beq 70dc <_Objects_Shrink_information+0xa8>
index = _Objects_Get_index( the_object->id );
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
70ac: e1a00005 mov r0, r5
* Assume the Inactive chain is never empty at this point
*/
the_object = (Objects_Control *) information->Inactive.first;
do {
index = _Objects_Get_index( the_object->id );
70b0: e1d030b8 ldrh r3, [r0, #8]
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
if ((index >= index_base) &&
70b4: e1530004 cmp r3, r4
index = _Objects_Get_index( the_object->id );
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
70b8: e5905000 ldr r5, [r0]
if ((index >= index_base) &&
70bc: 3afffff8 bcc 70a4 <_Objects_Shrink_information+0x70>
(index < (index_base + information->allocation_size))) {
70c0: e1d621b4 ldrh r2, [r6, #20]
70c4: e0842002 add r2, r4, r2
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
if ((index >= index_base) &&
70c8: e1530002 cmp r3, r2
70cc: 2afffff4 bcs 70a4 <_Objects_Shrink_information+0x70>
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
70d0: ebfffbc5 bl 5fec <_Chain_Extract>
}
}
while ( the_object );
70d4: e3550000 cmp r5, #0
70d8: 1afffff3 bne 70ac <_Objects_Shrink_information+0x78>
/*
* Free the memory and reset the structures in the object' information
*/
_Workspace_Free( information->object_blocks[ block ] );
70dc: e5963034 ldr r3, [r6, #52] ; 0x34
70e0: e7930007 ldr r0, [r3, r7]
70e4: eb00068a bl 8b14 <_Workspace_Free>
information->object_blocks[ block ] = NULL;
information->inactive_per_block[ block ] = 0;
information->inactive -= information->allocation_size;
70e8: e1d602bc ldrh r0, [r6, #44] ; 0x2c
70ec: e1d631b4 ldrh r3, [r6, #20]
/*
* Free the memory and reset the structures in the object' information
*/
_Workspace_Free( information->object_blocks[ block ] );
information->object_blocks[ block ] = NULL;
70f0: e5961034 ldr r1, [r6, #52] ; 0x34
information->inactive_per_block[ block ] = 0;
70f4: e5962030 ldr r2, [r6, #48] ; 0x30
information->inactive -= information->allocation_size;
70f8: e0633000 rsb r3, r3, r0
/*
* Free the memory and reset the structures in the object' information
*/
_Workspace_Free( information->object_blocks[ block ] );
information->object_blocks[ block ] = NULL;
70fc: e7815007 str r5, [r1, r7]
information->inactive_per_block[ block ] = 0;
7100: e7825007 str r5, [r2, r7]
information->inactive -= information->allocation_size;
7104: e1c632bc strh r3, [r6, #44] ; 0x2c
return;
7108: e8bd80f0 pop {r4, r5, r6, r7, pc}
000066a8 <_TOD_Validate>:
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick();
66a8: e59f30b8 ldr r3, [pc, #184] ; 6768 <_TOD_Validate+0xc0>
*/
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
66ac: e92d4010 push {r4, lr}
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
66b0: e2504000 subs r4, r0, #0
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick();
66b4: e593100c ldr r1, [r3, #12]
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
return false;
66b8: 01a00004 moveq r0, r4
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
66bc: 08bd8010 popeq {r4, pc}
)
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
66c0: e3a0093d mov r0, #999424 ; 0xf4000
66c4: e2800d09 add r0, r0, #576 ; 0x240
66c8: eb00454f bl 17c0c <__aeabi_uidiv>
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
66cc: e5943018 ldr r3, [r4, #24]
66d0: e1500003 cmp r0, r3
66d4: 9a00001f bls 6758 <_TOD_Validate+0xb0>
(the_tod->ticks >= ticks_per_second) ||
66d8: e5943014 ldr r3, [r4, #20]
66dc: e353003b cmp r3, #59 ; 0x3b
66e0: 8a00001c bhi 6758 <_TOD_Validate+0xb0>
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
66e4: e5943010 ldr r3, [r4, #16]
66e8: e353003b cmp r3, #59 ; 0x3b
66ec: 8a000019 bhi 6758 <_TOD_Validate+0xb0>
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
66f0: e594300c ldr r3, [r4, #12]
66f4: e3530017 cmp r3, #23
66f8: 8a000016 bhi 6758 <_TOD_Validate+0xb0>
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
66fc: e5940004 ldr r0, [r4, #4]
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
(the_tod->ticks >= ticks_per_second) ||
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
6700: e3500000 cmp r0, #0
6704: 08bd8010 popeq {r4, pc}
(the_tod->month == 0) ||
6708: e350000c cmp r0, #12
670c: 8a000011 bhi 6758 <_TOD_Validate+0xb0>
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
6710: e5942000 ldr r2, [r4]
(the_tod->ticks >= ticks_per_second) ||
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
6714: e3a03d1f mov r3, #1984 ; 0x7c0
6718: e2833003 add r3, r3, #3
671c: e1520003 cmp r2, r3
6720: 9a00000c bls 6758 <_TOD_Validate+0xb0>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
6724: e5944008 ldr r4, [r4, #8]
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
6728: e3540000 cmp r4, #0
672c: 0a00000b beq 6760 <_TOD_Validate+0xb8>
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
6730: e3120003 tst r2, #3
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
6734: 059f3030 ldreq r3, [pc, #48] ; 676c <_TOD_Validate+0xc4>
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
6738: 159f302c ldrne r3, [pc, #44] ; 676c <_TOD_Validate+0xc4>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
673c: 0280000d addeq r0, r0, #13
6740: 07930100 ldreq r0, [r3, r0, lsl #2]
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
6744: 17930100 ldrne r0, [r3, r0, lsl #2]
* false - if the the_tod is invalid
*
* NOTE: This routine only works for leap-years through 2099.
*/
bool _TOD_Validate(
6748: e1500004 cmp r0, r4
674c: 33a00000 movcc r0, #0
6750: 23a00001 movcs r0, #1
6754: e8bd8010 pop {r4, pc}
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
return false;
6758: e3a00000 mov r0, #0
675c: e8bd8010 pop {r4, pc}
6760: e1a00004 mov r0, r4 <== NOT EXECUTED
if ( the_tod->day > days_in_month )
return false;
return true;
}
6764: e8bd8010 pop {r4, pc} <== NOT EXECUTED
00007ca8 <_Thread_queue_Enqueue_priority>:
Priority_Control priority;
States_Control block_state;
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
7ca8: e5913014 ldr r3, [r1, #20]
Thread_blocking_operation_States _Thread_queue_Enqueue_priority (
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread,
ISR_Level *level_p
)
{
7cac: e92d0ff0 push {r4, r5, r6, r7, r8, r9, sl, fp}
7cb0: e281403c add r4, 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 );
7cb4: e281c038 add ip, r1, #56 ; 0x38
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
7cb8: e5814038 str r4, [r1, #56] ; 0x38
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 ) )
7cbc: e3130020 tst r3, #32
the_chain->permanent_null = NULL;
7cc0: e3a04000 mov r4, #0
7cc4: e581403c str r4, [r1, #60] ; 0x3c
the_chain->last = _Chain_Head(the_chain);
7cc8: e581c040 str ip, [r1, #64] ; 0x40
RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number (
Priority_Control the_priority
)
{
return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER);
7ccc: e1a08323 lsr r8, r3, #6
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
header_index = _Thread_queue_Header_number( priority );
header = &the_thread_queue->Queues.Priority[ header_index ];
block_state = the_thread_queue->state;
7cd0: e5905038 ldr r5, [r0, #56] ; 0x38
if ( _Thread_queue_Is_reverse_search( priority ) )
7cd4: 1a00001f bne 7d58 <_Thread_queue_Enqueue_priority+0xb0>
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) header->first;
7cd8: e0888088 add r8, r8, r8, lsl #1
7cdc: e1a09108 lsl r9, r8, #2
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
7ce0: e2898004 add r8, r9, #4
7ce4: e0808008 add r8, r0, r8
7ce8: e0809009 add r9, r0, r9
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
7cec: e10f7000 mrs r7, CPSR
7cf0: e387c080 orr ip, r7, #128 ; 0x80
7cf4: e129f00c msr CPSR_fc, ip
7cf8: e1a0a007 mov sl, r7
7cfc: e599c000 ldr ip, [r9]
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
7d00: e15c0008 cmp ip, r8
7d04: 1a000009 bne 7d30 <_Thread_queue_Enqueue_priority+0x88>
7d08: ea000054 b 7e60 <_Thread_queue_Enqueue_priority+0x1b8>
static inline void arm_interrupt_flash( uint32_t level )
{
uint32_t arm_switch_reg;
asm volatile (
7d0c: e10f6000 mrs r6, CPSR
7d10: e129f007 msr CPSR_fc, r7
7d14: e129f006 msr CPSR_fc, r6
RTEMS_INLINE_ROUTINE bool _States_Are_set (
States_Control the_states,
States_Control mask
)
{
return ( (the_states & mask) != STATES_READY);
7d18: e59c6010 ldr r6, [ip, #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) ) {
7d1c: e1150006 tst r5, r6
7d20: 0a000036 beq 7e00 <_Thread_queue_Enqueue_priority+0x158>
_ISR_Enable( level );
goto restart_forward_search;
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
7d24: e59cc000 ldr ip, [ip]
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 ) ) {
7d28: e15c0008 cmp ip, r8
7d2c: 0a000002 beq 7d3c <_Thread_queue_Enqueue_priority+0x94>
search_priority = search_thread->current_priority;
7d30: e59c4014 ldr r4, [ip, #20]
if ( priority <= search_priority )
7d34: e1530004 cmp r3, r4
7d38: 8afffff3 bhi 7d0c <_Thread_queue_Enqueue_priority+0x64>
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
7d3c: e5905030 ldr r5, [r0, #48] ; 0x30
7d40: e3550001 cmp r5, #1
7d44: 0a00002f beq 7e08 <_Thread_queue_Enqueue_priority+0x160>
* 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;
7d48: e582a000 str sl, [r2]
return the_thread_queue->sync_state;
}
7d4c: e1a00005 mov r0, r5
7d50: e8bd0ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp}
7d54: e12fff1e bx lr
_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 ];
7d58: e0888088 add r8, r8, r8, lsl #1
7d5c: e0808108 add r8, r0, r8, lsl #2
7d60: e59f9100 ldr r9, [pc, #256] ; 7e68 <_Thread_queue_Enqueue_priority+0x1c0>
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) header->last;
7d64: e1a0b008 mov fp, r8
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
7d68: e5d94000 ldrb r4, [r9]
7d6c: e2844001 add r4, r4, #1
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
7d70: e10f7000 mrs r7, CPSR
7d74: e387c080 orr ip, r7, #128 ; 0x80
7d78: e129f00c msr CPSR_fc, ip
7d7c: e1a0a007 mov sl, r7
_ISR_Disable( level );
search_thread = (Thread_Control *) header->last;
7d80: e59bc008 ldr ip, [fp, #8]
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
7d84: e15c0008 cmp ip, r8
7d88: 1a000009 bne 7db4 <_Thread_queue_Enqueue_priority+0x10c>
7d8c: ea00000b b 7dc0 <_Thread_queue_Enqueue_priority+0x118>
static inline void arm_interrupt_flash( uint32_t level )
{
uint32_t arm_switch_reg;
asm volatile (
7d90: e10f6000 mrs r6, CPSR
7d94: e129f007 msr CPSR_fc, r7
7d98: e129f006 msr CPSR_fc, r6
7d9c: e59c6010 ldr r6, [ip, #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) ) {
7da0: e1150006 tst r5, r6
7da4: 0a000013 beq 7df8 <_Thread_queue_Enqueue_priority+0x150>
_ISR_Enable( level );
goto restart_reverse_search;
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
7da8: e59cc004 ldr ip, [ip, #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 ) ) {
7dac: e15c0008 cmp ip, r8
7db0: 0a000002 beq 7dc0 <_Thread_queue_Enqueue_priority+0x118>
search_priority = search_thread->current_priority;
7db4: e59c4014 ldr r4, [ip, #20]
if ( priority >= search_priority )
7db8: e1530004 cmp r3, r4
7dbc: 3afffff3 bcc 7d90 <_Thread_queue_Enqueue_priority+0xe8>
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
7dc0: e5905030 ldr r5, [r0, #48] ; 0x30
7dc4: e3550001 cmp r5, #1
7dc8: 1affffde bne 7d48 <_Thread_queue_Enqueue_priority+0xa0>
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
if ( priority == search_priority )
7dcc: e1530004 cmp r3, r4
if ( the_thread_queue->sync_state !=
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
7dd0: e3a03000 mov r3, #0
7dd4: e5803030 str r3, [r0, #48] ; 0x30
if ( priority == search_priority )
7dd8: 0a000016 beq 7e38 <_Thread_queue_Enqueue_priority+0x190>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
7ddc: e59c3000 ldr r3, [ip]
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
7de0: e8811008 stm r1, {r3, ip}
search_node->next = the_node;
next_node->previous = the_node;
7de4: e5831004 str r1, [r3, #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;
7de8: e58c1000 str r1, [ip]
next_node->previous = the_node;
the_thread->Wait.queue = the_thread_queue;
7dec: e5810044 str r0, [r1, #68] ; 0x44
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
7df0: e129f007 msr CPSR_fc, r7
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
7df4: eaffffd4 b 7d4c <_Thread_queue_Enqueue_priority+0xa4>
7df8: e129f007 msr CPSR_fc, r7 <== NOT EXECUTED
7dfc: eaffffd9 b 7d68 <_Thread_queue_Enqueue_priority+0xc0> <== NOT EXECUTED
7e00: e129f007 msr CPSR_fc, r7 <== NOT EXECUTED
7e04: eaffffb8 b 7cec <_Thread_queue_Enqueue_priority+0x44> <== NOT EXECUTED
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
if ( priority == search_priority )
7e08: e1530004 cmp r3, r4
if ( the_thread_queue->sync_state !=
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
7e0c: e3a03000 mov r3, #0
7e10: e5803030 str r3, [r0, #48] ; 0x30
if ( priority == search_priority )
7e14: 0a000007 beq 7e38 <_Thread_queue_Enqueue_priority+0x190>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
previous_node = search_node->previous;
7e18: e59c3004 ldr r3, [ip, #4]
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
7e1c: e581c000 str ip, [r1]
the_node->previous = previous_node;
7e20: e5813004 str r3, [r1, #4]
previous_node->next = the_node;
7e24: e5831000 str r1, [r3]
search_node->previous = the_node;
7e28: e58c1004 str r1, [ip, #4]
the_thread->Wait.queue = the_thread_queue;
7e2c: e5810044 str r0, [r1, #68] ; 0x44
7e30: e129f007 msr CPSR_fc, r7
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
7e34: eaffffc4 b 7d4c <_Thread_queue_Enqueue_priority+0xa4>
7e38: e28cc03c add ip, ip, #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;
7e3c: e59c3004 ldr r3, [ip, #4]
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
7e40: e581c000 str ip, [r1]
the_node->previous = previous_node;
7e44: e5813004 str r3, [r1, #4]
previous_node->next = the_node;
7e48: e5831000 str r1, [r3]
search_node->previous = the_node;
7e4c: e58c1004 str r1, [ip, #4]
the_thread->Wait.queue = the_thread_queue;
7e50: e5810044 str r0, [r1, #68] ; 0x44
7e54: e129f00a msr CPSR_fc, sl
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
7e58: e3a05001 mov r5, #1
7e5c: eaffffba b 7d4c <_Thread_queue_Enqueue_priority+0xa4>
if ( _Thread_queue_Is_reverse_search( priority ) )
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
7e60: e3e04000 mvn r4, #0
7e64: eaffffb4 b 7d3c <_Thread_queue_Enqueue_priority+0x94>
0000b2b8 <_Thread_queue_Extract_priority_helper>:
void _Thread_queue_Extract_priority_helper(
Thread_queue_Control *the_thread_queue __attribute__((unused)),
Thread_Control *the_thread,
bool requeuing
)
{
b2b8: e92d4070 push {r4, r5, r6, lr}
b2bc: e20220ff and r2, r2, #255 ; 0xff
b2c0: e1a04001 mov r4, r1
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
b2c4: e10f1000 mrs r1, CPSR
b2c8: e3813080 orr r3, r1, #128 ; 0x80
b2cc: e129f003 msr CPSR_fc, r3
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
b2d0: e5943010 ldr r3, [r4, #16]
b2d4: e3c334ff bic r3, r3, #-16777216 ; 0xff000000
b2d8: e3c3373f bic r3, r3, #16515072 ; 0xfc0000
b2dc: e3c33c41 bic r3, r3, #16640 ; 0x4100
b2e0: e3c3301f bic r3, r3, #31
Chain_Node *new_second_node;
Chain_Node *last_node;
the_node = (Chain_Node *) the_thread;
_ISR_Disable( level );
if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
b2e4: e3530000 cmp r3, #0
b2e8: 0a000023 beq b37c <_Thread_queue_Extract_priority_helper+0xc4>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
b2ec: e5943038 ldr r3, [r4, #56] ; 0x38
/*
* The thread was actually waiting on a thread queue so let's remove it.
*/
next_node = the_node->next;
b2f0: e594c000 ldr ip, [r4]
previous_node = the_node->previous;
b2f4: e5945004 ldr r5, [r4, #4]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
b2f8: e284003c add r0, r4, #60 ; 0x3c
if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
b2fc: e1530000 cmp r3, r0
new_first_thread->Wait.Block2n.last = last_node;
last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n );
}
} else {
previous_node->next = next_node;
b300: 0585c000 streq ip, [r5]
next_node->previous = previous_node;
b304: 058c5004 streq r5, [ip, #4]
*/
next_node = the_node->next;
previous_node = the_node->previous;
if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
b308: 0a00000d beq b344 <_Thread_queue_Extract_priority_helper+0x8c>
new_first_node = the_thread->Wait.Block2n.first;
new_first_thread = (Thread_Control *) new_first_node;
last_node = the_thread->Wait.Block2n.last;
b30c: e5940040 ldr r0, [r4, #64] ; 0x40
previous_node->next = new_first_node;
next_node->previous = new_first_node;
new_first_node->next = next_node;
new_first_node->previous = previous_node;
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
b310: e1500003 cmp r0, r3
if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
new_first_node = the_thread->Wait.Block2n.first;
new_first_thread = (Thread_Control *) new_first_node;
last_node = the_thread->Wait.Block2n.last;
new_second_node = new_first_node->next;
b314: e5936000 ldr r6, [r3]
previous_node->next = new_first_node;
next_node->previous = new_first_node;
b318: e58c3004 str r3, [ip, #4]
new_first_node = the_thread->Wait.Block2n.first;
new_first_thread = (Thread_Control *) new_first_node;
last_node = the_thread->Wait.Block2n.last;
new_second_node = new_first_node->next;
previous_node->next = new_first_node;
b31c: e5853000 str r3, [r5]
next_node->previous = new_first_node;
new_first_node->next = next_node;
new_first_node->previous = previous_node;
b320: e5835004 str r5, [r3, #4]
last_node = the_thread->Wait.Block2n.last;
new_second_node = new_first_node->next;
previous_node->next = new_first_node;
next_node->previous = new_first_node;
new_first_node->next = next_node;
b324: e583c000 str ip, [r3]
new_first_node->previous = previous_node;
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
b328: 0a000005 beq b344 <_Thread_queue_Extract_priority_helper+0x8c>
/* > two threads on 2-n */
new_second_node->previous =
_Chain_Head( &new_first_thread->Wait.Block2n );
b32c: e2835038 add r5, r3, #56 ; 0x38
b330: e283c03c add ip, r3, #60 ; 0x3c
new_first_node->next = next_node;
new_first_node->previous = previous_node;
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
/* > two threads on 2-n */
new_second_node->previous =
b334: e5865004 str r5, [r6, #4]
_Chain_Head( &new_first_thread->Wait.Block2n );
new_first_thread->Wait.Block2n.first = new_second_node;
b338: e5836038 str r6, [r3, #56] ; 0x38
new_first_thread->Wait.Block2n.last = last_node;
b33c: e5830040 str r0, [r3, #64] ; 0x40
last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n );
b340: e580c000 str ip, [r0]
/*
* If we are not supposed to touch timers or the thread's state, return.
*/
if ( requeuing ) {
b344: e3520000 cmp r2, #0
b348: 1a000009 bne b374 <_Thread_queue_Extract_priority_helper+0xbc>
_ISR_Enable( level );
return;
}
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
b34c: e5943050 ldr r3, [r4, #80] ; 0x50
b350: e3530002 cmp r3, #2
b354: 0a00000a beq b384 <_Thread_queue_Extract_priority_helper+0xcc>
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
b358: e129f001 msr CPSR_fc, r1
b35c: e3a01201 mov r1, #268435456 ; 0x10000000
b360: e2811bff add r1, r1, #261120 ; 0x3fc00
b364: e1a00004 mov r0, r4
b368: e2811ffe add r1, r1, #1016 ; 0x3f8
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
}
b36c: e8bd4070 pop {r4, r5, r6, lr}
b370: eafff002 b 7380 <_Thread_Clear_state>
b374: e129f001 msr CPSR_fc, r1
b378: e8bd8070 pop {r4, r5, r6, pc}
b37c: e129f001 msr CPSR_fc, r1
b380: e8bd8070 pop {r4, r5, r6, pc}
b384: e3a03003 mov r3, #3 <== NOT EXECUTED
b388: e5843050 str r3, [r4, #80] ; 0x50 <== NOT EXECUTED
b38c: e129f001 msr CPSR_fc, r1 <== NOT EXECUTED
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
_ISR_Enable( level );
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
(void) _Watchdog_Remove( &the_thread->Timer );
b390: e2840048 add r0, r4, #72 ; 0x48 <== NOT EXECUTED
b394: ebfff56f bl 8958 <_Watchdog_Remove> <== NOT EXECUTED
b398: eaffffef b b35c <_Thread_queue_Extract_priority_helper+0xa4><== NOT EXECUTED
00015f94 <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
15f94: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
15f98: e24dd024 sub sp, sp, #36 ; 0x24
15f9c: e28d700c add r7, sp, #12
15fa0: e28d2018 add r2, sp, #24
15fa4: e282a004 add sl, r2, #4
15fa8: e2872004 add r2, r7, #4
15fac: e58d2000 str r2, [sp]
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
the_chain->permanent_null = NULL;
the_chain->last = _Chain_Head(the_chain);
15fb0: e28d2018 add r2, sp, #24
15fb4: e58d2020 str r2, [sp, #32]
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
15fb8: e59d2000 ldr r2, [sp]
15fbc: e58d200c str r2, [sp, #12]
15fc0: e2802008 add r2, r0, #8
the_chain->permanent_null = NULL;
15fc4: e3a03000 mov r3, #0
15fc8: e58d2004 str r2, [sp, #4]
15fcc: e2802040 add r2, r0, #64 ; 0x40
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
15fd0: e58da018 str sl, [sp, #24]
the_chain->permanent_null = NULL;
15fd4: e58d301c str r3, [sp, #28]
15fd8: e58d3010 str r3, [sp, #16]
the_chain->last = _Chain_Head(the_chain);
15fdc: e58d7014 str r7, [sp, #20]
15fe0: e59f91a8 ldr r9, [pc, #424] ; 16190 <_Timer_server_Body+0x1fc>
15fe4: e59fb1a8 ldr fp, [pc, #424] ; 16194 <_Timer_server_Body+0x200>
15fe8: e58d2008 str r2, [sp, #8]
15fec: e1a04000 mov r4, r0
15ff0: e2806030 add r6, r0, #48 ; 0x30
15ff4: e2808068 add r8, r0, #104 ; 0x68
{
/*
* 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;
15ff8: e28d3018 add r3, sp, #24
15ffc: e5843078 str r3, [r4, #120] ; 0x78
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
16000: e5993000 ldr r3, [r9]
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
16004: e594103c ldr r1, [r4, #60] ; 0x3c
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
16008: e1a02007 mov r2, r7
1600c: e1a00006 mov r0, r6
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
16010: e584303c str r3, [r4, #60] ; 0x3c
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
16014: e0611003 rsb r1, r1, r3
16018: eb001158 bl 1a580 <_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();
1601c: e59b5000 ldr r5, [fp]
Watchdog_Interval last_snapshot = watchdogs->last_snapshot;
16020: e5942074 ldr r2, [r4, #116] ; 0x74
/*
* 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 ) {
16024: e1550002 cmp r5, r2
16028: 8a000022 bhi 160b8 <_Timer_server_Body+0x124>
* TOD has been set forward.
*/
delta = snapshot - last_snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
} else if ( snapshot < last_snapshot ) {
1602c: 3a000018 bcc 16094 <_Timer_server_Body+0x100>
*/
delta = last_snapshot - snapshot;
_Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
}
watchdogs->last_snapshot = snapshot;
16030: e5845074 str r5, [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 );
16034: e5940078 ldr r0, [r4, #120] ; 0x78
16038: eb0002bd bl 16b34 <_Chain_Get>
if ( timer == NULL ) {
1603c: e2501000 subs r1, r0, #0
16040: 0a00000b beq 16074 <_Timer_server_Body+0xe0>
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
16044: e5913038 ldr r3, [r1, #56] ; 0x38
16048: e3530001 cmp r3, #1
1604c: 0a000015 beq 160a8 <_Timer_server_Body+0x114>
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
16050: e3530003 cmp r3, #3
16054: 1afffff6 bne 16034 <_Timer_server_Body+0xa0>
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
16058: e2811010 add r1, r1, #16
1605c: e1a00008 mov r0, r8
16060: eb001170 bl 1a628 <_Watchdog_Insert>
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
16064: e5940078 ldr r0, [r4, #120] ; 0x78
16068: eb0002b1 bl 16b34 <_Chain_Get>
if ( timer == NULL ) {
1606c: e2501000 subs r1, r0, #0
16070: 1afffff3 bne 16044 <_Timer_server_Body+0xb0>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
16074: e10f2000 mrs r2, CPSR
16078: e3823080 orr r3, r2, #128 ; 0x80
1607c: e129f003 msr CPSR_fc, r3
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
if ( _Chain_Is_empty( insert_chain ) ) {
16080: e59d3018 ldr r3, [sp, #24]
16084: e15a0003 cmp sl, r3
16088: 0a00000f beq 160cc <_Timer_server_Body+0x138>
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
1608c: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED
16090: eaffffda b 16000 <_Timer_server_Body+0x6c> <== NOT EXECUTED
/*
* 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 );
16094: e1a00008 mov r0, r8
16098: e3a01001 mov r1, #1
1609c: e0652002 rsb r2, r5, r2
160a0: eb001107 bl 1a4c4 <_Watchdog_Adjust>
160a4: eaffffe1 b 16030 <_Timer_server_Body+0x9c>
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
160a8: e1a00006 mov r0, r6
160ac: e2811010 add r1, r1, #16
160b0: eb00115c bl 1a628 <_Watchdog_Insert>
160b4: eaffffde b 16034 <_Timer_server_Body+0xa0>
/*
* 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 );
160b8: e0621005 rsb r1, r2, r5
160bc: e1a00008 mov r0, r8
160c0: e1a02007 mov r2, r7
160c4: eb00112d bl 1a580 <_Watchdog_Adjust_to_chain>
160c8: eaffffd8 b 16030 <_Timer_server_Body+0x9c>
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
if ( _Chain_Is_empty( insert_chain ) ) {
ts->insert_chain = NULL;
160cc: e5841078 str r1, [r4, #120] ; 0x78
160d0: e129f002 msr CPSR_fc, r2
_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 ) ) {
160d4: e59d300c ldr r3, [sp, #12]
160d8: e59d2000 ldr r2, [sp]
160dc: e1520003 cmp r2, r3
160e0: 0a000015 beq 1613c <_Timer_server_Body+0x1a8>
160e4: e1a05004 mov r5, r4
160e8: e59d4000 ldr r4, [sp]
160ec: ea000009 b 16118 <_Timer_server_Body+0x184>
{
Chain_Node *return_node;
Chain_Node *new_first;
return_node = the_chain->first;
new_first = return_node->next;
160f0: e5932000 ldr r2, [r3]
the_chain->first = new_first;
new_first->previous = _Chain_Head(the_chain);
160f4: e5827004 str r7, [r2, #4]
Chain_Node *return_node;
Chain_Node *new_first;
return_node = the_chain->first;
new_first = return_node->next;
the_chain->first = new_first;
160f8: e58d200c str r2, [sp, #12]
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
160fc: e3a02000 mov r2, #0
16100: e5832008 str r2, [r3, #8]
16104: e129f001 msr CPSR_fc, r1
/*
* 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 );
16108: e2830020 add r0, r3, #32
1610c: e8900003 ldm r0, {r0, r1}
16110: e1a0e00f mov lr, pc
16114: e593f01c ldr pc, [r3, #28]
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
16118: e10f1000 mrs r1, CPSR
1611c: e3813080 orr r3, r1, #128 ; 0x80
16120: e129f003 msr CPSR_fc, r3
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
16124: e59d300c ldr r3, [sp, #12]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
16128: e1540003 cmp r4, r3
1612c: 1affffef bne 160f0 <_Timer_server_Body+0x15c>
16130: e1a04005 mov r4, r5
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
16134: e129f001 msr CPSR_fc, r1
16138: eaffffae b 15ff8 <_Timer_server_Body+0x64>
}
} else {
ts->active = false;
1613c: e3a03000 mov r3, #0
16140: e5c4307c strb r3, [r4, #124] ; 0x7c
16144: e59f204c ldr r2, [pc, #76] ; 16198 <_Timer_server_Body+0x204>
16148: e5923000 ldr r3, [r2]
1614c: e2833001 add r3, r3, #1
16150: e5823000 str r3, [r2]
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
_Thread_Set_state( ts->thread, STATES_DELAYING );
16154: e3a01008 mov r1, #8
16158: e5940000 ldr r0, [r4]
1615c: eb000e7e bl 19b5c <_Thread_Set_state>
_Timer_server_Reset_interval_system_watchdog( ts );
16160: e1a00004 mov r0, r4
16164: ebffff5e bl 15ee4 <_Timer_server_Reset_interval_system_watchdog>
_Timer_server_Reset_tod_system_watchdog( ts );
16168: e1a00004 mov r0, r4
1616c: ebffff72 bl 15f3c <_Timer_server_Reset_tod_system_watchdog>
_Thread_Enable_dispatch();
16170: eb000be8 bl 19118 <_Thread_Enable_dispatch>
ts->active = true;
16174: e3a03001 mov r3, #1
16178: 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 );
1617c: e59d0004 ldr r0, [sp, #4]
16180: eb00118b bl 1a7b4 <_Watchdog_Remove>
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
16184: e59d0008 ldr r0, [sp, #8]
16188: eb001189 bl 1a7b4 <_Watchdog_Remove>
1618c: eaffff99 b 15ff8 <_Timer_server_Body+0x64>
0000a2cc <_Timespec_Greater_than>:
bool _Timespec_Greater_than(
const struct timespec *lhs,
const struct timespec *rhs
)
{
if ( lhs->tv_sec > rhs->tv_sec )
a2cc: e5902000 ldr r2, [r0]
a2d0: e5913000 ldr r3, [r1]
a2d4: e1520003 cmp r2, r3
return true;
a2d8: c3a00001 movgt r0, #1
bool _Timespec_Greater_than(
const struct timespec *lhs,
const struct timespec *rhs
)
{
if ( lhs->tv_sec > rhs->tv_sec )
a2dc: c12fff1e bxgt lr
return true;
if ( lhs->tv_sec < rhs->tv_sec )
a2e0: ba000005 blt a2fc <_Timespec_Greater_than+0x30>
#include <rtems/system.h>
#include <rtems/score/timespec.h>
#include <rtems/score/tod.h>
bool _Timespec_Greater_than(
a2e4: e5900004 ldr r0, [r0, #4]
a2e8: e5913004 ldr r3, [r1, #4]
a2ec: e1500003 cmp r0, r3
a2f0: d3a00000 movle r0, #0
a2f4: c3a00001 movgt r0, #1
a2f8: e12fff1e bx lr
{
if ( lhs->tv_sec > rhs->tv_sec )
return true;
if ( lhs->tv_sec < rhs->tv_sec )
return false;
a2fc: e3a00000 mov r0, #0 <== NOT EXECUTED
/* ASSERT: lhs->tv_sec == rhs->tv_sec */
if ( lhs->tv_nsec > rhs->tv_nsec )
return true;
return false;
}
a300: e12fff1e bx lr <== NOT EXECUTED
00008690 <_User_extensions_Thread_create>:
#include <rtems/score/userext.h>
bool _User_extensions_Thread_create (
Thread_Control *the_thread
)
{
8690: e92d40f0 push {r4, r5, r6, r7, lr}
Chain_Node *the_node;
User_extensions_Control *the_extension;
bool status;
for ( the_node = _User_extensions_List.first ;
8694: e59f5050 ldr r5, [pc, #80] ; 86ec <_User_extensions_Thread_create+0x5c>
8698: e4954004 ldr r4, [r5], #4
869c: e1540005 cmp r4, r5
#include <rtems/score/userext.h>
bool _User_extensions_Thread_create (
Thread_Control *the_thread
)
{
86a0: e1a06000 mov r6, r0
Chain_Node *the_node;
User_extensions_Control *the_extension;
bool status;
for ( the_node = _User_extensions_List.first ;
86a4: 0a00000e beq 86e4 <_User_extensions_Thread_create+0x54>
the_node = the_node->next ) {
the_extension = (User_extensions_Control *) the_node;
if ( the_extension->Callouts.thread_create != NULL ) {
status = (*the_extension->Callouts.thread_create)(
86a8: e59f7040 ldr r7, [pc, #64] ; 86f0 <_User_extensions_Thread_create+0x60>
!_Chain_Is_tail( &_User_extensions_List, the_node ) ;
the_node = the_node->next ) {
the_extension = (User_extensions_Control *) the_node;
if ( the_extension->Callouts.thread_create != NULL ) {
86ac: e5943014 ldr r3, [r4, #20]
86b0: e3530000 cmp r3, #0
status = (*the_extension->Callouts.thread_create)(
86b4: e1a01006 mov r1, r6
!_Chain_Is_tail( &_User_extensions_List, the_node ) ;
the_node = the_node->next ) {
the_extension = (User_extensions_Control *) the_node;
if ( the_extension->Callouts.thread_create != NULL ) {
86b8: 0a000004 beq 86d0 <_User_extensions_Thread_create+0x40>
status = (*the_extension->Callouts.thread_create)(
86bc: e5970004 ldr r0, [r7, #4]
86c0: e1a0e00f mov lr, pc
86c4: e12fff13 bx r3
_Thread_Executing,
the_thread
);
if ( !status )
86c8: e3500000 cmp r0, #0
86cc: 08bd80f0 popeq {r4, r5, r6, r7, pc}
User_extensions_Control *the_extension;
bool status;
for ( the_node = _User_extensions_List.first ;
!_Chain_Is_tail( &_User_extensions_List, the_node ) ;
the_node = the_node->next ) {
86d0: e5944000 ldr r4, [r4]
{
Chain_Node *the_node;
User_extensions_Control *the_extension;
bool status;
for ( the_node = _User_extensions_List.first ;
86d4: e1540005 cmp r4, r5
86d8: 1afffff3 bne 86ac <_User_extensions_Thread_create+0x1c>
if ( !status )
return false;
}
}
return true;
86dc: e3a00001 mov r0, #1
86e0: e8bd80f0 pop {r4, r5, r6, r7, pc}
86e4: e3a00001 mov r0, #1 <== NOT EXECUTED
}
86e8: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
0000a660 <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
a660: e92d41f0 push {r4, r5, r6, r7, r8, lr}
a664: e1a04000 mov r4, r0
a668: e1a05002 mov r5, r2
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
a66c: e10f3000 mrs r3, CPSR
a670: e3832080 orr r2, r3, #128 ; 0x80
a674: e129f002 msr CPSR_fc, r2
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
a678: e1a07000 mov r7, r0
a67c: e4972004 ldr r2, [r7], #4
* hence the compiler must not assume *header to remain
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
a680: e1520007 cmp r2, r7
a684: 0a000018 beq a6ec <_Watchdog_Adjust+0x8c>
switch ( direction ) {
a688: e3510000 cmp r1, #0
a68c: 1a000018 bne a6f4 <_Watchdog_Adjust+0x94>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
a690: e3550000 cmp r5, #0
a694: 0a000014 beq a6ec <_Watchdog_Adjust+0x8c>
if ( units < _Watchdog_First( header )->delta_interval ) {
a698: e5926010 ldr r6, [r2, #16]
a69c: e1550006 cmp r5, r6
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
a6a0: 23a08001 movcs r8, #1
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
a6a4: 2a000005 bcs a6c0 <_Watchdog_Adjust+0x60>
a6a8: ea000018 b a710 <_Watchdog_Adjust+0xb0> <== NOT EXECUTED
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
a6ac: e0555006 subs r5, r5, r6
a6b0: 0a00000d beq a6ec <_Watchdog_Adjust+0x8c>
if ( units < _Watchdog_First( header )->delta_interval ) {
a6b4: e5926010 ldr r6, [r2, #16]
a6b8: e1560005 cmp r6, r5
a6bc: 8a000013 bhi a710 <_Watchdog_Adjust+0xb0>
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
a6c0: e5828010 str r8, [r2, #16]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
a6c4: e129f003 msr CPSR_fc, r3
_ISR_Enable( level );
_Watchdog_Tickle( header );
a6c8: e1a00004 mov r0, r4
a6cc: eb0000a0 bl a954 <_Watchdog_Tickle>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
a6d0: e10f3000 mrs r3, CPSR
a6d4: e3832080 orr r2, r3, #128 ; 0x80
a6d8: e129f002 msr CPSR_fc, r2
a6dc: e5941000 ldr r1, [r4]
_ISR_Disable( level );
if ( _Chain_Is_empty( header ) )
a6e0: e1570001 cmp r7, r1
RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First(
Chain_Control *header
)
{
return ( (Watchdog_Control *) header->first );
a6e4: e1a02001 mov r2, r1
a6e8: 1affffef bne a6ac <_Watchdog_Adjust+0x4c>
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
a6ec: e129f003 msr CPSR_fc, r3
}
}
_ISR_Enable( level );
}
a6f0: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
switch ( direction ) {
a6f4: e3510001 cmp r1, #1
a6f8: 1afffffb bne a6ec <_Watchdog_Adjust+0x8c>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
a6fc: e5921010 ldr r1, [r2, #16]
a700: e0815005 add r5, r1, r5
a704: e5825010 str r5, [r2, #16]
a708: e129f003 msr CPSR_fc, r3
}
}
_ISR_Enable( level );
}
a70c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
_Watchdog_First( header )->delta_interval -= units;
a710: e0655006 rsb r5, r5, r6
a714: e5825010 str r5, [r2, #16]
break;
a718: eafffff3 b a6ec <_Watchdog_Adjust+0x8c>
00020b78 <__kill>:
#endif
int __kill( pid_t pid, int sig )
{
return 0;
}
20b78: e3a00000 mov r0, #0 <== NOT EXECUTED
20b7c: e12fff1e bx lr <== NOT EXECUTED
00011dbc <_exit>:
extern void FINI_SYMBOL( void );
#endif
void EXIT_SYMBOL(int status)
{
11dbc: e52de004 push {lr} ; (str lr, [sp, #-4]!)
11dc0: e24dd004 sub sp, sp, #4
/*
* If the toolset uses init/fini sections, then we need to
* run the global destructors now.
*/
#if defined(__USE_INIT_FINI__)
FINI_SYMBOL();
11dc4: e58d0000 str r0, [sp]
11dc8: eb0001ec bl 12580 <___DTOR_END__>
* We need to do the exit processing on the global reentrancy structure.
* This has already been done on the per task reentrancy structure
* associated with this task.
*/
libc_wrapup();
11dcc: ebffffe0 bl 11d54 <libc_wrapup>
rtems_shutdown_executive(status);
11dd0: e59d0000 ldr r0, [sp]
11dd4: eb000038 bl 11ebc <rtems_shutdown_executive>
11dd8: eafffffe b 11dd8 <_exit+0x1c> <== NOT EXECUTED
000020dc <_gettimeofday>:
int _gettimeofday(
struct timeval *tp,
struct timezone *tzp
)
{
return gettimeofday( tp, tzp );
20dc: eaffffe1 b 2068 <gettimeofday> <== NOT EXECUTED
00005ae8 <_rename_r>:
int _rename_r(
struct _reent *ptr __attribute__((unused)),
const char *old,
const char *new
)
{
5ae8: e92d41f0 push {r4, r5, r6, r7, r8, lr}
/*
* Get the parent node of the old path to be renamed. Find the parent path.
*/
old_parent_pathlen = rtems_filesystem_dirname ( old );
5aec: e1a00001 mov r0, r1
int _rename_r(
struct _reent *ptr __attribute__((unused)),
const char *old,
const char *new
)
{
5af0: e24dd048 sub sp, sp, #72 ; 0x48
5af4: e1a05001 mov r5, r1
5af8: e1a06002 mov r6, r2
/*
* Get the parent node of the old path to be renamed. Find the parent path.
*/
old_parent_pathlen = rtems_filesystem_dirname ( old );
5afc: ebfffab5 bl 45d8 <rtems_filesystem_dirname>
if ( old_parent_pathlen == 0 )
5b00: e2507000 subs r7, r0, #0
5b04: 1a000059 bne 5c70 <_rename_r+0x188>
rtems_filesystem_get_start_loc( old, &i, &old_parent_loc );
5b08: e28d4018 add r4, sp, #24
5b0c: e1a00005 mov r0, r5
5b10: e28d1044 add r1, sp, #68 ; 0x44
5b14: e1a02004 mov r2, r4
5b18: eb0000e8 bl 5ec0 <rtems_filesystem_get_start_loc>
rtems_filesystem_location_info_t old_parent_loc;
rtems_filesystem_location_info_t new_parent_loc;
int i;
int result;
const char *name;
bool free_old_parentloc = false;
5b1c: e1a08007 mov r8, r7
/*
* Start from the parent to find the node that should be under it.
*/
old_loc = old_parent_loc;
5b20: e1a0e004 mov lr, r4
5b24: e8be000f ldm lr!, {r0, r1, r2, r3}
5b28: e28dc02c add ip, sp, #44 ; 0x2c
5b2c: e8ac000f stmia ip!, {r0, r1, r2, r3}
5b30: e59e3000 ldr r3, [lr]
name = old + old_parent_pathlen;
5b34: e0855007 add r5, r5, r7
/*
* Start from the parent to find the node that should be under it.
*/
old_loc = old_parent_loc;
5b38: e58c3000 str r3, [ip]
name = old + old_parent_pathlen;
name += rtems_filesystem_prefix_separators( name, strlen( name ) );
5b3c: e1a00005 mov r0, r5
/*
* Start from the parent to find the node that should be under it.
*/
old_loc = old_parent_loc;
name = old + old_parent_pathlen;
5b40: e58d5040 str r5, [sp, #64] ; 0x40
name += rtems_filesystem_prefix_separators( name, strlen( name ) );
5b44: eb0035f3 bl 13318 <strlen>
5b48: e1a01000 mov r1, r0
5b4c: e1a00005 mov r0, r5
5b50: ebfffaaf bl 4614 <rtems_filesystem_prefix_separators>
5b54: e0855000 add r5, r5, r0
result = rtems_filesystem_evaluate_relative_path( name , strlen( name ),
5b58: e1a00005 mov r0, r5
* Start from the parent to find the node that should be under it.
*/
old_loc = old_parent_loc;
name = old + old_parent_pathlen;
name += rtems_filesystem_prefix_separators( name, strlen( name ) );
5b5c: e58d5040 str r5, [sp, #64] ; 0x40
result = rtems_filesystem_evaluate_relative_path( name , strlen( name ),
5b60: eb0035ec bl 13318 <strlen>
5b64: e28d702c add r7, sp, #44 ; 0x2c
5b68: e1a01000 mov r1, r0
5b6c: e3a02000 mov r2, #0
5b70: e1a00005 mov r0, r5
5b74: e1a03007 mov r3, r7
5b78: e58d2000 str r2, [sp]
5b7c: ebfffa49 bl 44a8 <rtems_filesystem_evaluate_relative_path>
0, &old_loc, false );
if ( result != 0 ) {
5b80: e3500000 cmp r0, #0
5b84: 1a000031 bne 5c50 <_rename_r+0x168>
/*
* Get the parent of the new node we are renaming to.
*/
rtems_filesystem_get_start_loc( new, &i, &new_parent_loc );
5b88: e28d5004 add r5, sp, #4
5b8c: e1a00006 mov r0, r6
5b90: e1a02005 mov r2, r5
5b94: e28d1044 add r1, sp, #68 ; 0x44
5b98: eb0000c8 bl 5ec0 <rtems_filesystem_get_start_loc>
result = (*new_parent_loc.ops->evalformake_h)( &new[i], &new_parent_loc, &name );
5b9c: e59d0044 ldr r0, [sp, #68] ; 0x44
5ba0: e1a01005 mov r1, r5
5ba4: e0860000 add r0, r6, r0
5ba8: e28d2040 add r2, sp, #64 ; 0x40
5bac: e59d3010 ldr r3, [sp, #16]
5bb0: e1a0e00f mov lr, pc
5bb4: e593f004 ldr pc, [r3, #4]
if ( result != 0 ) {
5bb8: e3500000 cmp r0, #0
5bbc: 1a000037 bne 5ca0 <_rename_r+0x1b8>
/*
* Check to see if the caller is trying to rename across file system
* boundaries.
*/
if ( old_parent_loc.mt_entry != new_parent_loc.mt_entry ) {
5bc0: e59d3014 ldr r3, [sp, #20]
5bc4: e59d2028 ldr r2, [sp, #40] ; 0x28
5bc8: e1520003 cmp r2, r3
5bcc: 1a000013 bne 5c20 <_rename_r+0x138>
rtems_filesystem_freenode( &old_parent_loc );
rtems_filesystem_freenode( &old_loc );
rtems_set_errno_and_return_minus_one( EXDEV );
}
result = (*new_parent_loc.ops->rename_h)( &old_parent_loc, &old_loc, &new_parent_loc, name );
5bd0: e1a01007 mov r1, r7
5bd4: e1a02005 mov r2, r5
5bd8: e59d3040 ldr r3, [sp, #64] ; 0x40
5bdc: e59dc010 ldr ip, [sp, #16]
5be0: e1a00004 mov r0, r4
5be4: e1a0e00f mov lr, pc
5be8: e59cf040 ldr pc, [ip, #64] ; 0x40
5bec: e1a06000 mov r6, r0
rtems_filesystem_freenode( &new_parent_loc );
5bf0: e1a00005 mov r0, r5
5bf4: ebfffaa0 bl 467c <rtems_filesystem_freenode>
if ( free_old_parentloc )
5bf8: e3580000 cmp r8, #0
5bfc: 1a000004 bne 5c14 <_rename_r+0x12c>
rtems_filesystem_freenode( &old_parent_loc );
rtems_filesystem_freenode( &old_loc );
5c00: e1a00007 mov r0, r7
5c04: ebfffa9c bl 467c <rtems_filesystem_freenode>
return result;
}
5c08: e1a00006 mov r0, r6
5c0c: e28dd048 add sp, sp, #72 ; 0x48
5c10: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
result = (*new_parent_loc.ops->rename_h)( &old_parent_loc, &old_loc, &new_parent_loc, name );
rtems_filesystem_freenode( &new_parent_loc );
if ( free_old_parentloc )
rtems_filesystem_freenode( &old_parent_loc );
5c14: e1a00004 mov r0, r4
5c18: ebfffa97 bl 467c <rtems_filesystem_freenode>
5c1c: eafffff7 b 5c00 <_rename_r+0x118>
* Check to see if the caller is trying to rename across file system
* boundaries.
*/
if ( old_parent_loc.mt_entry != new_parent_loc.mt_entry ) {
rtems_filesystem_freenode( &new_parent_loc );
5c20: e1a00005 mov r0, r5
5c24: ebfffa94 bl 467c <rtems_filesystem_freenode>
if ( free_old_parentloc )
5c28: e3580000 cmp r8, #0
rtems_filesystem_freenode( &old_parent_loc );
5c2c: 11a00004 movne r0, r4
5c30: 1bfffa91 blne 467c <rtems_filesystem_freenode>
rtems_filesystem_freenode( &old_loc );
5c34: e1a00007 mov r0, r7
5c38: ebfffa8f bl 467c <rtems_filesystem_freenode>
rtems_set_errno_and_return_minus_one( EXDEV );
5c3c: eb002898 bl fea4 <__errno>
5c40: e3a03012 mov r3, #18
5c44: e5803000 str r3, [r0]
5c48: e3e06000 mvn r6, #0
5c4c: eaffffed b 5c08 <_rename_r+0x120>
name += rtems_filesystem_prefix_separators( name, strlen( name ) );
result = rtems_filesystem_evaluate_relative_path( name , strlen( name ),
0, &old_loc, false );
if ( result != 0 ) {
if ( free_old_parentloc )
5c50: e3580000 cmp r8, #0
5c54: 1a000001 bne 5c60 <_rename_r+0x178>
rtems_filesystem_freenode( &old_parent_loc );
return -1;
5c58: e3e06000 mvn r6, #0 <== NOT EXECUTED
5c5c: eaffffe9 b 5c08 <_rename_r+0x120> <== NOT EXECUTED
result = rtems_filesystem_evaluate_relative_path( name , strlen( name ),
0, &old_loc, false );
if ( result != 0 ) {
if ( free_old_parentloc )
rtems_filesystem_freenode( &old_parent_loc );
5c60: e1a00004 mov r0, r4
5c64: ebfffa84 bl 467c <rtems_filesystem_freenode>
return -1;
5c68: e3e06000 mvn r6, #0
5c6c: eaffffe5 b 5c08 <_rename_r+0x120>
old_parent_pathlen = rtems_filesystem_dirname ( old );
if ( old_parent_pathlen == 0 )
rtems_filesystem_get_start_loc( old, &i, &old_parent_loc );
else {
result = rtems_filesystem_evaluate_path( old, old_parent_pathlen,
5c70: e3a03000 mov r3, #0
5c74: e28d4018 add r4, sp, #24
5c78: e58d3000 str r3, [sp]
5c7c: e3a02002 mov r2, #2
5c80: e1a00005 mov r0, r5
5c84: e1a01007 mov r1, r7
5c88: e1a03004 mov r3, r4
5c8c: ebfffa2f bl 4550 <rtems_filesystem_evaluate_path>
RTEMS_LIBIO_PERMS_WRITE,
&old_parent_loc,
false );
if ( result != 0 )
5c90: e3500000 cmp r0, #0
5c94: 1affffef bne 5c58 <_rename_r+0x170>
return -1;
free_old_parentloc = true;
5c98: e3a08001 mov r8, #1
5c9c: eaffff9f b 5b20 <_rename_r+0x38>
rtems_filesystem_get_start_loc( new, &i, &new_parent_loc );
result = (*new_parent_loc.ops->evalformake_h)( &new[i], &new_parent_loc, &name );
if ( result != 0 ) {
rtems_filesystem_freenode( &new_parent_loc );
5ca0: e1a00005 mov r0, r5
5ca4: ebfffa74 bl 467c <rtems_filesystem_freenode>
if ( free_old_parentloc )
5ca8: e3580000 cmp r8, #0
rtems_filesystem_freenode( &old_parent_loc );
5cac: 11a00004 movne r0, r4
5cb0: 1bfffa71 blne 467c <rtems_filesystem_freenode>
rtems_filesystem_freenode( &old_loc );
5cb4: e1a00007 mov r0, r7
5cb8: ebfffa6f bl 467c <rtems_filesystem_freenode>
return -1;
5cbc: e3e06000 mvn r6, #0
5cc0: eaffffd0 b 5c08 <_rename_r+0x120>
00001e1c <chroot>:
#include <rtems/seterr.h>
int chroot(
const char *pathname
)
{
1e1c: e92d4070 push {r4, r5, r6, lr}
int result;
rtems_filesystem_location_info_t loc;
/* an automatic call to new private env the first time */
if (rtems_current_user_env == &rtems_global_user_env) {
1e20: e59f50b4 ldr r5, [pc, #180] ; 1edc <chroot+0xc0>
1e24: e59f30b4 ldr r3, [pc, #180] ; 1ee0 <chroot+0xc4>
1e28: e5954000 ldr r4, [r5]
1e2c: e1540003 cmp r4, r3
#include <rtems/seterr.h>
int chroot(
const char *pathname
)
{
1e30: e24dd018 sub sp, sp, #24
1e34: e1a06000 mov r6, r0
int result;
rtems_filesystem_location_info_t loc;
/* an automatic call to new private env the first time */
if (rtems_current_user_env == &rtems_global_user_env) {
1e38: 0a000017 beq 1e9c <chroot+0x80>
rtems_libio_set_private_env(); /* try to set a new private env*/
if (rtems_current_user_env == &rtems_global_user_env) /* not ok */
rtems_set_errno_and_return_minus_one( ENOTSUP );
}
result = chdir(pathname);
1e3c: e1a00006 mov r0, r6
1e40: eb002208 bl a668 <chdir>
if (result) {
1e44: e2502000 subs r2, r0, #0
1e48: 1a00001c bne 1ec0 <chroot+0xa4>
rtems_set_errno_and_return_minus_one( errno );
}
/* clone the new root location */
if (rtems_filesystem_evaluate_path(".", 1, 0, &loc, 0)) {
1e4c: e28d4004 add r4, sp, #4
1e50: e59f008c ldr r0, [pc, #140] ; 1ee4 <chroot+0xc8>
1e54: e3a01001 mov r1, #1
1e58: e1a03004 mov r3, r4
1e5c: e58d2000 str r2, [sp]
1e60: eb00006a bl 2010 <rtems_filesystem_evaluate_path>
1e64: e2506000 subs r6, r0, #0
1e68: 1a000014 bne 1ec0 <chroot+0xa4>
/* our cwd has changed, though - but there is no easy way of return :-( */
rtems_set_errno_and_return_minus_one( errno );
}
rtems_filesystem_freenode(&rtems_filesystem_root);
1e6c: e5950000 ldr r0, [r5]
1e70: e2800018 add r0, r0, #24
1e74: eb0000b0 bl 213c <rtems_filesystem_freenode>
rtems_filesystem_root = loc;
1e78: e595c000 ldr ip, [r5]
1e7c: e8b4000f ldm r4!, {r0, r1, r2, r3}
1e80: e28cc018 add ip, ip, #24
1e84: e8ac000f stmia ip!, {r0, r1, r2, r3}
1e88: e5943000 ldr r3, [r4]
1e8c: e58c3000 str r3, [ip]
return 0;
1e90: e1a00006 mov r0, r6
}
1e94: e28dd018 add sp, sp, #24
1e98: e8bd8070 pop {r4, r5, r6, pc}
int result;
rtems_filesystem_location_info_t loc;
/* an automatic call to new private env the first time */
if (rtems_current_user_env == &rtems_global_user_env) {
rtems_libio_set_private_env(); /* try to set a new private env*/
1e9c: eb000510 bl 32e4 <rtems_libio_set_private_env>
if (rtems_current_user_env == &rtems_global_user_env) /* not ok */
1ea0: e5953000 ldr r3, [r5]
1ea4: e1530004 cmp r3, r4
1ea8: 1affffe3 bne 1e3c <chroot+0x20>
rtems_set_errno_and_return_minus_one( ENOTSUP );
1eac: eb002c74 bl d084 <__errno> <== NOT EXECUTED
1eb0: e3a03086 mov r3, #134 ; 0x86 <== NOT EXECUTED
1eb4: e5803000 str r3, [r0] <== NOT EXECUTED
1eb8: e3e00000 mvn r0, #0 <== NOT EXECUTED
1ebc: eafffff4 b 1e94 <chroot+0x78> <== NOT EXECUTED
}
/* clone the new root location */
if (rtems_filesystem_evaluate_path(".", 1, 0, &loc, 0)) {
/* our cwd has changed, though - but there is no easy way of return :-( */
rtems_set_errno_and_return_minus_one( errno );
1ec0: eb002c6f bl d084 <__errno> <== NOT EXECUTED
1ec4: e1a04000 mov r4, r0 <== NOT EXECUTED
1ec8: eb002c6d bl d084 <__errno> <== NOT EXECUTED
1ecc: e5903000 ldr r3, [r0] <== NOT EXECUTED
1ed0: e3e00000 mvn r0, #0 <== NOT EXECUTED
1ed4: e5843000 str r3, [r4] <== NOT EXECUTED
1ed8: eaffffed b 1e94 <chroot+0x78> <== NOT EXECUTED
00008f2c <devFS_evaluate_path>:
const char *pathname,
size_t pathnamelen,
int flags,
rtems_filesystem_location_info_t *pathloc
)
{
8f2c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
assert( 0 );
rtems_set_errno_and_return_minus_one( EIO );
}
/* get the device name table */
device_name_table = (rtems_device_name_t *)pathloc->node_access;
8f30: e5936000 ldr r6, [r3]
if (!device_name_table)
8f34: e3560000 cmp r6, #0
const char *pathname,
size_t pathnamelen,
int flags,
rtems_filesystem_location_info_t *pathloc
)
{
8f38: e1a0b003 mov fp, r3
8f3c: e1a0a000 mov sl, r0
8f40: e1a07001 mov r7, r1
rtems_set_errno_and_return_minus_one( EIO );
}
/* get the device name table */
device_name_table = (rtems_device_name_t *)pathloc->node_access;
if (!device_name_table)
8f44: 0a000025 beq 8fe0 <devFS_evaluate_path+0xb4>
rtems_set_errno_and_return_minus_one( EFAULT );
for (i = 0; i < rtems_device_table_size; i++) {
8f48: e59f30a4 ldr r3, [pc, #164] ; 8ff4 <devFS_evaluate_path+0xc8>
8f4c: e5938000 ldr r8, [r3]
8f50: e3580000 cmp r8, #0
8f54: 13a09000 movne r9, #0
8f58: 11a04009 movne r4, r9
8f5c: 0a000010 beq 8fa4 <devFS_evaluate_path+0x78>
if (!device_name_table[i].device_name)
8f60: e0899109 add r9, r9, r9, lsl #2
8f64: e7965109 ldr r5, [r6, r9, lsl #2]
8f68: e2551000 subs r1, r5, #0
continue;
if (strncmp(pathname, device_name_table[i].device_name, pathnamelen) != 0)
8f6c: e1a0000a mov r0, sl
8f70: e1a02007 mov r2, r7
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++) {
if (!device_name_table[i].device_name)
8f74: e0869109 add r9, r6, r9, lsl #2
8f78: 0a000005 beq 8f94 <devFS_evaluate_path+0x68>
continue;
if (strncmp(pathname, device_name_table[i].device_name, pathnamelen) != 0)
8f7c: eb000aba bl ba6c <strncmp>
8f80: e3500000 cmp r0, #0
8f84: 1a000002 bne 8f94 <devFS_evaluate_path+0x68>
continue;
if (device_name_table[i].device_name[pathnamelen] != '\0')
8f88: e7d50007 ldrb r0, [r5, r7]
8f8c: e3500000 cmp r0, #0
8f90: 0a000008 beq 8fb8 <devFS_evaluate_path+0x8c>
/* 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++) {
8f94: e2844001 add r4, r4, #1
8f98: e1580004 cmp r8, r4
8f9c: e1a09004 mov r9, r4
8fa0: 8affffee bhi 8f60 <devFS_evaluate_path+0x34>
pathloc->mt_entry = rtems_filesystem_root.mt_entry;
return 0;
}
/* no such file or directory */
rtems_set_errno_and_return_minus_one( ENOENT );
8fa4: eb0006e7 bl ab48 <__errno>
8fa8: e3a03002 mov r3, #2
8fac: e5803000 str r3, [r0]
8fb0: e3e00000 mvn r0, #0
}
8fb4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/* find the device, set proper values */
pathloc->node_access = (void *)&device_name_table[i];
pathloc->handlers = &devFS_file_handlers;
pathloc->ops = &devFS_ops;
pathloc->mt_entry = rtems_filesystem_root.mt_entry;
8fb8: e59f3038 ldr r3, [pc, #56] ; 8ff8 <devFS_evaluate_path+0xcc>
if (device_name_table[i].device_name[pathnamelen] != '\0')
continue;
/* find the device, set proper values */
pathloc->node_access = (void *)&device_name_table[i];
pathloc->handlers = &devFS_file_handlers;
8fbc: e59f2038 ldr r2, [pc, #56] ; 8ffc <devFS_evaluate_path+0xd0>
pathloc->ops = &devFS_ops;
pathloc->mt_entry = rtems_filesystem_root.mt_entry;
8fc0: e5933000 ldr r3, [r3]
if (device_name_table[i].device_name[pathnamelen] != '\0')
continue;
/* find the device, set proper values */
pathloc->node_access = (void *)&device_name_table[i];
pathloc->handlers = &devFS_file_handlers;
8fc4: e58b2008 str r2, [fp, #8]
pathloc->ops = &devFS_ops;
pathloc->mt_entry = rtems_filesystem_root.mt_entry;
8fc8: e5933028 ldr r3, [r3, #40] ; 0x28
continue;
/* find the device, set proper values */
pathloc->node_access = (void *)&device_name_table[i];
pathloc->handlers = &devFS_file_handlers;
pathloc->ops = &devFS_ops;
8fcc: e59f202c ldr r2, [pc, #44] ; 9000 <devFS_evaluate_path+0xd4>
if (device_name_table[i].device_name[pathnamelen] != '\0')
continue;
/* find the device, set proper values */
pathloc->node_access = (void *)&device_name_table[i];
8fd0: e58b9000 str r9, [fp]
pathloc->handlers = &devFS_file_handlers;
pathloc->ops = &devFS_ops;
8fd4: e58b200c str r2, [fp, #12]
pathloc->mt_entry = rtems_filesystem_root.mt_entry;
8fd8: e58b3010 str r3, [fp, #16]
return 0;
8fdc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, 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 );
8fe0: eb0006d8 bl ab48 <__errno> <== NOT EXECUTED
8fe4: e3a0300e mov r3, #14 <== NOT EXECUTED
8fe8: e5803000 str r3, [r0] <== NOT EXECUTED
8fec: e3e00000 mvn r0, #0 <== NOT EXECUTED
8ff0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
000016bc <devFS_initialize>:
int devFS_initialize(
rtems_filesystem_mount_table_entry_t *temp_mt_entry,
const void *data
)
{
16bc: e92d4070 push {r4, r5, r6, lr}
rtems_device_name_t *device_name_table;
/* allocate device only filesystem name table */
device_name_table = (rtems_device_name_t *)_Workspace_Allocate(
16c0: e59f605c ldr r6, [pc, #92] ; 1724 <devFS_initialize+0x68>
16c4: e5963000 ldr r3, [r6]
16c8: e0833103 add r3, r3, r3, lsl #2
int devFS_initialize(
rtems_filesystem_mount_table_entry_t *temp_mt_entry,
const void *data
)
{
16cc: e1a04000 mov r4, r0
rtems_device_name_t *device_name_table;
/* allocate device only filesystem name table */
device_name_table = (rtems_device_name_t *)_Workspace_Allocate(
16d0: e1a00103 lsl r0, r3, #2
16d4: eb001c8e bl 8914 <_Workspace_Allocate>
sizeof( rtems_device_name_t ) * ( rtems_device_table_size )
);
/* no memory for device filesystem */
if (!device_name_table)
16d8: e2505000 subs r5, r0, #0
16dc: 0a00000b beq 1710 <devFS_initialize+0x54>
rtems_set_errno_and_return_minus_one( ENOMEM );
memset(
16e0: e5962000 ldr r2, [r6]
16e4: e0822102 add r2, r2, r2, lsl #2
16e8: e3a01000 mov r1, #0
16ec: e1a02102 lsl r2, r2, #2
16f0: eb002781 bl b4fc <memset>
device_name_table, 0,
sizeof( rtems_device_name_t ) * ( rtems_device_table_size )
);
/* set file handlers */
temp_mt_entry->mt_fs_root.handlers = &devFS_file_handlers;
16f4: e59f302c ldr r3, [pc, #44] ; 1728 <devFS_initialize+0x6c>
temp_mt_entry->mt_fs_root.ops = &devFS_ops;
16f8: e2832038 add r2, r3, #56 ; 0x38
device_name_table, 0,
sizeof( rtems_device_name_t ) * ( rtems_device_table_size )
);
/* set file handlers */
temp_mt_entry->mt_fs_root.handlers = &devFS_file_handlers;
16fc: e5843024 str r3, [r4, #36] ; 0x24
temp_mt_entry->mt_fs_root.ops = &devFS_ops;
1700: e5842028 str r2, [r4, #40] ; 0x28
/* Set the node_access to device name table */
temp_mt_entry->mt_fs_root.node_access = (void *)device_name_table;
1704: e584501c str r5, [r4, #28]
return 0;
1708: e3a00000 mov r0, #0
}
170c: e8bd8070 pop {r4, r5, r6, pc}
sizeof( rtems_device_name_t ) * ( rtems_device_table_size )
);
/* no memory for device filesystem */
if (!device_name_table)
rtems_set_errno_and_return_minus_one( ENOMEM );
1710: eb00250c bl ab48 <__errno> <== NOT EXECUTED
1714: e3a0300c mov r3, #12 <== NOT EXECUTED
1718: e5803000 str r3, [r0] <== NOT EXECUTED
171c: e3e00000 mvn r0, #0 <== NOT EXECUTED
1720: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
00001920 <devFS_ioctl>:
int devFS_ioctl(
rtems_libio_t *iop,
uint32_t command,
void *buffer
)
{
1920: e52de004 push {lr} ; (str lr, [sp, #-4]!)
rtems_libio_ioctl_args_t args;
rtems_status_code status;
rtems_device_name_t *np;
np = (rtems_device_name_t *)iop->pathinfo.node_access;
1924: e590c018 ldr ip, [r0, #24]
int devFS_ioctl(
rtems_libio_t *iop,
uint32_t command,
void *buffer
)
{
1928: e24dd010 sub sp, sp, #16
192c: e1a03000 mov r3, r0
rtems_device_name_t *np;
np = (rtems_device_name_t *)iop->pathinfo.node_access;
args.iop = iop;
args.command = command;
1930: e98d0006 stmib sp, {r1, r2}
args.buffer = buffer;
status = rtems_io_control(
1934: e28c0008 add r0, ip, #8
1938: e8900003 ldm r0, {r0, r1}
193c: e1a0200d mov r2, sp
rtems_status_code status;
rtems_device_name_t *np;
np = (rtems_device_name_t *)iop->pathinfo.node_access;
args.iop = iop;
1940: e58d3000 str r3, [sp]
args.command = command;
args.buffer = buffer;
status = rtems_io_control(
1944: eb001062 bl 5ad4 <rtems_io_control>
np->major,
np->minor,
(void *) &args
);
if ( status )
1948: e3500000 cmp r0, #0
return rtems_deviceio_errno(status);
return args.ioctl_return;
194c: 059d000c ldreq r0, [sp, #12]
np->major,
np->minor,
(void *) &args
);
if ( status )
1950: 1a000001 bne 195c <devFS_ioctl+0x3c>
return rtems_deviceio_errno(status);
return args.ioctl_return;
}
1954: e28dd010 add sp, sp, #16
1958: e8bd8000 pop {pc}
np->minor,
(void *) &args
);
if ( status )
return rtems_deviceio_errno(status);
195c: eb001dab bl 9010 <rtems_deviceio_errno> <== NOT EXECUTED
1960: eafffffb b 1954 <devFS_ioctl+0x34> <== NOT EXECUTED
0000172c <devFS_mknod>:
const char *path,
mode_t mode,
dev_t dev,
rtems_filesystem_location_info_t *pathloc
)
{
172c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1730: e1a04000 mov r4, r0
* condition and do not create the '/dev' and the 'path'
* actually passed in is 'dev', not '/dev'. Just return 0 to
* indicate we are OK.
*/
if ((path[0] == 'd') && (path[1] == 'e') &&
1734: e5d00000 ldrb r0, [r0]
1738: e3500064 cmp r0, #100 ; 0x64
const char *path,
mode_t mode,
dev_t dev,
rtems_filesystem_location_info_t *pathloc
)
{
173c: e1a05001 mov r5, r1
1740: e1a06002 mov r6, r2
1744: e1a0b003 mov fp, r3
* condition and do not create the '/dev' and the 'path'
* actually passed in is 'dev', not '/dev'. Just return 0 to
* indicate we are OK.
*/
if ((path[0] == 'd') && (path[1] == 'e') &&
1748: 0a000035 beq 1824 <devFS_mknod+0xf8>
(path[2] == 'v') && (path[3] == '\0'))
return 0;
/* must be a character device or a block device */
if (!S_ISBLK(mode) && !S_ISCHR(mode))
174c: e2053a0f and r3, r5, #61440 ; 0xf000
1750: e3530a02 cmp r3, #8192 ; 0x2000
1754: 13530a06 cmpne r3, #24576 ; 0x6000
1758: 03a03000 moveq r3, #0
175c: 13a03001 movne r3, #1
1760: 1a000039 bne 184c <devFS_mknod+0x120>
rtems_set_errno_and_return_minus_one( EINVAL );
else
rtems_filesystem_split_dev_t(dev, major, minor);
/* Find an empty slot in device name table */
device_name_table = (rtems_device_name_t *)pathloc->node_access;
1764: e59d2024 ldr r2, [sp, #36] ; 0x24
1768: e5928000 ldr r8, [r2]
if (!device_name_table)
176c: e3580000 cmp r8, #0
1770: 0a00003f beq 1874 <devFS_mknod+0x148>
rtems_set_errno_and_return_minus_one( EFAULT );
for (slot = -1, i = 0; i < rtems_device_table_size; i++){
1774: e59f210c ldr r2, [pc, #268] ; 1888 <devFS_mknod+0x15c>
1778: e592a000 ldr sl, [r2]
177c: e35a0000 cmp sl, #0
1780: 13e09000 mvnne r9, #0
1784: 11a07003 movne r7, r3
1788: 1a000007 bne 17ac <devFS_mknod+0x80>
178c: ea000033 b 1860 <devFS_mknod+0x134> <== NOT EXECUTED
if (device_name_table[i].device_name == NULL)
slot = i;
else
if (strcmp(path, device_name_table[i].device_name) == 0)
1790: eb0027d5 bl b6ec <strcmp> <== NOT EXECUTED
1794: e3500000 cmp r0, #0 <== NOT EXECUTED
1798: 0a00001c beq 1810 <devFS_mknod+0xe4> <== NOT EXECUTED
/* Find an empty slot in 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 (slot = -1, i = 0; i < rtems_device_table_size; i++){
179c: e2877001 add r7, r7, #1 <== NOT EXECUTED
17a0: e157000a cmp r7, sl <== NOT EXECUTED
17a4: e1a03007 mov r3, r7 <== NOT EXECUTED
17a8: 2a000009 bcs 17d4 <devFS_mknod+0xa8> <== NOT EXECUTED
if (device_name_table[i].device_name == NULL)
17ac: e0833103 add r3, r3, r3, lsl #2
17b0: e7983103 ldr r3, [r8, r3, lsl #2]
17b4: e2531000 subs r1, r3, #0
slot = i;
else
if (strcmp(path, device_name_table[i].device_name) == 0)
17b8: e1a00004 mov r0, r4
device_name_table = (rtems_device_name_t *)pathloc->node_access;
if (!device_name_table)
rtems_set_errno_and_return_minus_one( EFAULT );
for (slot = -1, i = 0; i < rtems_device_table_size; i++){
if (device_name_table[i].device_name == NULL)
17bc: 1afffff3 bne 1790 <devFS_mknod+0x64>
17c0: e1a09007 mov r9, r7
/* Find an empty slot in 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 (slot = -1, i = 0; i < rtems_device_table_size; i++){
17c4: e2877001 add r7, r7, #1
17c8: e157000a cmp r7, sl
17cc: e1a03007 mov r3, r7
17d0: 3afffff5 bcc 17ac <devFS_mknod+0x80>
else
if (strcmp(path, device_name_table[i].device_name) == 0)
rtems_set_errno_and_return_minus_one( EEXIST );
}
if (slot == -1)
17d4: e3790001 cmn r9, #1
17d8: 0a000020 beq 1860 <devFS_mknod+0x134>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
17dc: e10f7000 mrs r7, CPSR
17e0: e3873080 orr r3, r7, #128 ; 0x80
17e4: e129f003 msr CPSR_fc, r3
rtems_set_errno_and_return_minus_one( ENOMEM );
_ISR_Disable(level);
device_name_table[slot].device_name = (char *)path;
17e8: e0899109 add r9, r9, r9, lsl #2
17ec: e7884109 str r4, [r8, r9, lsl #2]
device_name_table[slot].device_name_length = strlen(path);
17f0: e1a00004 mov r0, r4
17f4: eb002884 bl ba0c <strlen>
if (slot == -1)
rtems_set_errno_and_return_minus_one( ENOMEM );
_ISR_Disable(level);
device_name_table[slot].device_name = (char *)path;
17f8: e0888109 add r8, r8, r9, lsl #2
device_name_table[slot].device_name_length = strlen(path);
device_name_table[slot].major = major;
17fc: e9880841 stmib r8, {r0, r6, fp}
device_name_table[slot].minor = minor;
device_name_table[slot].mode = mode;
1800: e5885010 str r5, [r8, #16]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
1804: e129f007 msr CPSR_fc, r7
_ISR_Enable(level);
return 0;
1808: e3a00000 mov r0, #0
}
180c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
for (slot = -1, i = 0; i < rtems_device_table_size; i++){
if (device_name_table[i].device_name == NULL)
slot = i;
else
if (strcmp(path, device_name_table[i].device_name) == 0)
rtems_set_errno_and_return_minus_one( EEXIST );
1810: eb0024cc bl ab48 <__errno> <== NOT EXECUTED
1814: e3a03011 mov r3, #17 <== NOT EXECUTED
1818: e5803000 str r3, [r0] <== NOT EXECUTED
181c: e3e00000 mvn r0, #0 <== NOT EXECUTED
1820: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
* condition and do not create the '/dev' and the 'path'
* actually passed in is 'dev', not '/dev'. Just return 0 to
* indicate we are OK.
*/
if ((path[0] == 'd') && (path[1] == 'e') &&
1824: e5d43001 ldrb r3, [r4, #1]
1828: e3530065 cmp r3, #101 ; 0x65
182c: 1affffc6 bne 174c <devFS_mknod+0x20>
1830: e5d43002 ldrb r3, [r4, #2]
1834: e3530076 cmp r3, #118 ; 0x76
1838: 1affffc3 bne 174c <devFS_mknod+0x20>
(path[2] == 'v') && (path[3] == '\0'))
183c: e5d40003 ldrb r0, [r4, #3]
1840: e3500000 cmp r0, #0
1844: 1affffc0 bne 174c <devFS_mknod+0x20>
1848: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
return 0;
/* must be a character device or a block device */
if (!S_ISBLK(mode) && !S_ISCHR(mode))
rtems_set_errno_and_return_minus_one( EINVAL );
184c: eb0024bd bl ab48 <__errno> <== NOT EXECUTED
1850: e3a03016 mov r3, #22 <== NOT EXECUTED
1854: e5803000 str r3, [r0] <== NOT EXECUTED
1858: e3e00000 mvn r0, #0 <== NOT EXECUTED
185c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
if (strcmp(path, device_name_table[i].device_name) == 0)
rtems_set_errno_and_return_minus_one( EEXIST );
}
if (slot == -1)
rtems_set_errno_and_return_minus_one( ENOMEM );
1860: eb0024b8 bl ab48 <__errno> <== NOT EXECUTED
1864: e3a0300c mov r3, #12 <== NOT EXECUTED
1868: e5803000 str r3, [r0] <== NOT EXECUTED
186c: e3e00000 mvn r0, #0 <== NOT EXECUTED
1870: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
rtems_filesystem_split_dev_t(dev, major, minor);
/* Find an empty slot in 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 );
1874: eb0024b3 bl ab48 <__errno> <== NOT EXECUTED
1878: e3a0300e mov r3, #14 <== NOT EXECUTED
187c: e5803000 str r3, [r0] <== NOT EXECUTED
1880: e3e00000 mvn r0, #0 <== NOT EXECUTED
1884: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
0000199c <devFS_read>:
ssize_t devFS_read(
rtems_libio_t *iop,
void *buffer,
size_t count
)
{
199c: e92d4030 push {r4, r5, lr} <== NOT EXECUTED
rtems_libio_rw_args_t args;
rtems_status_code status;
rtems_device_name_t *np;
np = (rtems_device_name_t *)iop->pathinfo.node_access;
19a0: e590c018 ldr ip, [r0, #24] <== NOT EXECUTED
ssize_t devFS_read(
rtems_libio_t *iop,
void *buffer,
size_t count
)
{
19a4: e24dd01c sub sp, sp, #28 <== NOT EXECUTED
19a8: e1a03000 mov r3, r0 <== NOT EXECUTED
rtems_device_name_t *np;
np = (rtems_device_name_t *)iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
19ac: e280500c add r5, r0, #12 <== NOT EXECUTED
19b0: e8950030 ldm r5, {r4, r5} <== NOT EXECUTED
args.buffer = buffer;
args.count = count;
args.flags = iop->flags;
19b4: e590e014 ldr lr, [r0, #20] <== NOT EXECUTED
np = (rtems_device_name_t *)iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
args.buffer = buffer;
19b8: e58d100c str r1, [sp, #12] <== NOT EXECUTED
args.count = count;
args.flags = iop->flags;
args.bytes_moved = 0;
status = rtems_io_read(
19bc: e28c0008 add r0, ip, #8 <== NOT EXECUTED
19c0: e8900003 ldm r0, {r0, r1} <== NOT EXECUTED
np = (rtems_device_name_t *)iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
args.buffer = buffer;
args.count = count;
19c4: e58d2010 str r2, [sp, #16] <== NOT EXECUTED
rtems_status_code status;
rtems_device_name_t *np;
np = (rtems_device_name_t *)iop->pathinfo.node_access;
args.iop = iop;
19c8: e58d3000 str r3, [sp] <== NOT EXECUTED
args.buffer = buffer;
args.count = count;
args.flags = iop->flags;
args.bytes_moved = 0;
status = rtems_io_read(
19cc: e1a0200d mov r2, sp <== NOT EXECUTED
args.iop = iop;
args.offset = iop->offset;
args.buffer = buffer;
args.count = count;
args.flags = iop->flags;
args.bytes_moved = 0;
19d0: e3a03000 mov r3, #0 <== NOT EXECUTED
rtems_device_name_t *np;
np = (rtems_device_name_t *)iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
19d4: e98d0030 stmib sp, {r4, r5} <== NOT EXECUTED
args.buffer = buffer;
args.count = count;
args.flags = iop->flags;
19d8: e58de014 str lr, [sp, #20] <== NOT EXECUTED
args.bytes_moved = 0;
19dc: e58d3018 str r3, [sp, #24] <== NOT EXECUTED
status = rtems_io_read(
19e0: eb00109f bl 5c64 <rtems_io_read> <== NOT EXECUTED
np->major,
np->minor,
(void *) &args
);
if ( status )
19e4: e3500000 cmp r0, #0 <== NOT EXECUTED
return rtems_deviceio_errno(status);
return (ssize_t) args.bytes_moved;
19e8: 059d0018 ldreq r0, [sp, #24] <== NOT EXECUTED
np->major,
np->minor,
(void *) &args
);
if ( status )
19ec: 1a000001 bne 19f8 <devFS_read+0x5c> <== NOT EXECUTED
return rtems_deviceio_errno(status);
return (ssize_t) args.bytes_moved;
}
19f0: e28dd01c add sp, sp, #28 <== NOT EXECUTED
19f4: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
np->minor,
(void *) &args
);
if ( status )
return rtems_deviceio_errno(status);
19f8: eb001d84 bl 9010 <rtems_deviceio_errno> <== NOT EXECUTED
19fc: eafffffb b 19f0 <devFS_read+0x54> <== NOT EXECUTED
00001a00 <devFS_stat>:
struct stat *buf
)
{
rtems_device_name_t *the_dev;
the_dev = (rtems_device_name_t *)loc->node_access;
1a00: e5903000 ldr r3, [r0]
if (!the_dev)
1a04: e3530000 cmp r3, #0
int devFS_stat(
rtems_filesystem_location_info_t *loc,
struct stat *buf
)
{
1a08: e52de004 push {lr} ; (str lr, [sp, #-4]!)
rtems_device_name_t *the_dev;
the_dev = (rtems_device_name_t *)loc->node_access;
if (!the_dev)
1a0c: 0a000006 beq 1a2c <devFS_stat+0x2c>
rtems_device_minor_number _minor
)
{
union __rtems_dev_t temp;
temp.__overlay.major = _major;
1a10: e2830008 add r0, r3, #8
1a14: e890000d ldm r0, {r0, r2, r3}
rtems_set_errno_and_return_minus_one( EFAULT );
buf->st_rdev = rtems_filesystem_make_dev_t( the_dev->major, the_dev->minor );
1a18: e5810018 str r0, [r1, #24]
1a1c: e581201c str r2, [r1, #28]
buf->st_mode = the_dev->mode;
1a20: e581300c str r3, [r1, #12]
return 0;
1a24: e3a00000 mov r0, #0
}
1a28: e49df004 pop {pc} ; (ldr pc, [sp], #4)
{
rtems_device_name_t *the_dev;
the_dev = (rtems_device_name_t *)loc->node_access;
if (!the_dev)
rtems_set_errno_and_return_minus_one( EFAULT );
1a2c: eb002445 bl ab48 <__errno> <== NOT EXECUTED
1a30: e3a0300e mov r3, #14 <== NOT EXECUTED
1a34: e5803000 str r3, [r0] <== NOT EXECUTED
1a38: e3e00000 mvn r0, #0 <== NOT EXECUTED
1a3c: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
00001a40 <devFS_write>:
ssize_t devFS_write(
rtems_libio_t *iop,
const void *buffer,
size_t count
)
{
1a40: e92d4030 push {r4, r5, lr}
rtems_libio_rw_args_t args;
rtems_status_code status;
rtems_device_name_t *np;
np = (rtems_device_name_t *)iop->pathinfo.node_access;
1a44: e590c018 ldr ip, [r0, #24]
ssize_t devFS_write(
rtems_libio_t *iop,
const void *buffer,
size_t count
)
{
1a48: e24dd01c sub sp, sp, #28
1a4c: e1a03000 mov r3, r0
rtems_device_name_t *np;
np = (rtems_device_name_t *)iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
1a50: e280500c add r5, r0, #12
1a54: e8950030 ldm r5, {r4, r5}
args.buffer = (void *) buffer;
args.count = count;
args.flags = iop->flags;
1a58: e590e014 ldr lr, [r0, #20]
np = (rtems_device_name_t *)iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
args.buffer = (void *) buffer;
1a5c: e58d100c str r1, [sp, #12]
args.count = count;
args.flags = iop->flags;
args.bytes_moved = 0;
status = rtems_io_write(
1a60: e28c0008 add r0, ip, #8
1a64: e8900003 ldm r0, {r0, r1}
np = (rtems_device_name_t *)iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
args.buffer = (void *) buffer;
args.count = count;
1a68: e58d2010 str r2, [sp, #16]
rtems_status_code status;
rtems_device_name_t *np;
np = (rtems_device_name_t *)iop->pathinfo.node_access;
args.iop = iop;
1a6c: e58d3000 str r3, [sp]
args.buffer = (void *) buffer;
args.count = count;
args.flags = iop->flags;
args.bytes_moved = 0;
status = rtems_io_write(
1a70: e1a0200d mov r2, sp
args.iop = iop;
args.offset = iop->offset;
args.buffer = (void *) buffer;
args.count = count;
args.flags = iop->flags;
args.bytes_moved = 0;
1a74: e3a03000 mov r3, #0
rtems_device_name_t *np;
np = (rtems_device_name_t *)iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
1a78: e98d0030 stmib sp, {r4, r5}
args.buffer = (void *) buffer;
args.count = count;
args.flags = iop->flags;
1a7c: e58de014 str lr, [sp, #20]
args.bytes_moved = 0;
1a80: e58d3018 str r3, [sp, #24]
status = rtems_io_write(
1a84: eb00108b bl 5cb8 <rtems_io_write>
np->major,
np->minor,
(void *) &args
);
if ( status )
1a88: e3500000 cmp r0, #0
return rtems_deviceio_errno(status);
return (ssize_t) args.bytes_moved;
1a8c: 059d0018 ldreq r0, [sp, #24]
np->major,
np->minor,
(void *) &args
);
if ( status )
1a90: 1a000001 bne 1a9c <devFS_write+0x5c>
return rtems_deviceio_errno(status);
return (ssize_t) args.bytes_moved;
}
1a94: e28dd01c add sp, sp, #28
1a98: e8bd8030 pop {r4, r5, pc}
np->minor,
(void *) &args
);
if ( status )
return rtems_deviceio_errno(status);
1a9c: eb001d5b bl 9010 <rtems_deviceio_errno> <== NOT EXECUTED
1aa0: eafffffb b 1a94 <devFS_write+0x54> <== NOT EXECUTED
0000c31c <device_ioctl>:
int device_ioctl(
rtems_libio_t *iop,
uint32_t command,
void *buffer
)
{
c31c: e52de004 push {lr} ; (str lr, [sp, #-4]!)
args.iop = iop;
args.command = command;
args.buffer = buffer;
the_jnode = iop->pathinfo.node_access;
c320: e590c018 ldr ip, [r0, #24]
int device_ioctl(
rtems_libio_t *iop,
uint32_t command,
void *buffer
)
{
c324: e24dd010 sub sp, sp, #16
c328: e1a03000 mov r3, r0
rtems_libio_ioctl_args_t args;
rtems_status_code status;
IMFS_jnode_t *the_jnode;
args.iop = iop;
args.command = command;
c32c: e98d0006 stmib sp, {r1, r2}
args.buffer = buffer;
the_jnode = iop->pathinfo.node_access;
status = rtems_io_control(
c330: e28c0050 add r0, ip, #80 ; 0x50
c334: e8900003 ldm r0, {r0, r1}
c338: e1a0200d mov r2, sp
{
rtems_libio_ioctl_args_t args;
rtems_status_code status;
IMFS_jnode_t *the_jnode;
args.iop = iop;
c33c: e58d3000 str r3, [sp]
args.command = command;
args.buffer = buffer;
the_jnode = iop->pathinfo.node_access;
status = rtems_io_control(
c340: eb000194 bl c998 <rtems_io_control>
the_jnode->info.device.major,
the_jnode->info.device.minor,
(void *) &args
);
if ( status )
c344: e3500000 cmp r0, #0
return rtems_deviceio_errno(status);
return args.ioctl_return;
c348: 059d000c ldreq r0, [sp, #12]
the_jnode->info.device.major,
the_jnode->info.device.minor,
(void *) &args
);
if ( status )
c34c: 1a000001 bne c358 <device_ioctl+0x3c>
return rtems_deviceio_errno(status);
return args.ioctl_return;
}
c350: e28dd010 add sp, sp, #16
c354: e8bd8000 pop {pc}
the_jnode->info.device.minor,
(void *) &args
);
if ( status )
return rtems_deviceio_errno(status);
c358: eb000228 bl cc00 <rtems_deviceio_errno> <== NOT EXECUTED
c35c: eafffffb b c350 <device_ioctl+0x34> <== NOT EXECUTED
0000c254 <device_read>:
ssize_t device_read(
rtems_libio_t *iop,
void *buffer,
size_t count
)
{
c254: e92d4030 push {r4, r5, lr}
rtems_libio_rw_args_t args;
rtems_status_code status;
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
c258: e590c018 ldr ip, [r0, #24]
ssize_t device_read(
rtems_libio_t *iop,
void *buffer,
size_t count
)
{
c25c: e24dd01c sub sp, sp, #28
c260: e1a03000 mov r3, r0
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
c264: e280500c add r5, r0, #12
c268: e8950030 ldm r5, {r4, r5}
args.buffer = buffer;
args.count = count;
args.flags = iop->flags;
c26c: e590e014 ldr lr, [r0, #20]
the_jnode = iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
args.buffer = buffer;
c270: e58d100c str r1, [sp, #12]
args.count = count;
c274: e58d2010 str r2, [sp, #16]
rtems_status_code status;
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
args.iop = iop;
c278: e58d3000 str r3, [sp]
args.buffer = buffer;
args.count = count;
args.flags = iop->flags;
args.bytes_moved = 0;
status = rtems_io_read(
c27c: e59c0050 ldr r0, [ip, #80] ; 0x50
args.iop = iop;
args.offset = iop->offset;
args.buffer = buffer;
args.count = count;
args.flags = iop->flags;
args.bytes_moved = 0;
c280: e3a03000 mov r3, #0
status = rtems_io_read(
c284: e59c1054 ldr r1, [ip, #84] ; 0x54
c288: e1a0200d mov r2, sp
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
c28c: e98d0030 stmib sp, {r4, r5}
args.buffer = buffer;
args.count = count;
args.flags = iop->flags;
c290: e58de014 str lr, [sp, #20]
args.bytes_moved = 0;
c294: e58d3018 str r3, [sp, #24]
status = rtems_io_read(
c298: eb0001e8 bl ca40 <rtems_io_read>
the_jnode->info.device.major,
the_jnode->info.device.minor,
(void *) &args
);
if ( status )
c29c: e3500000 cmp r0, #0
return rtems_deviceio_errno(status);
return (ssize_t) args.bytes_moved;
c2a0: 059d0018 ldreq r0, [sp, #24]
the_jnode->info.device.major,
the_jnode->info.device.minor,
(void *) &args
);
if ( status )
c2a4: 1a000001 bne c2b0 <device_read+0x5c>
return rtems_deviceio_errno(status);
return (ssize_t) args.bytes_moved;
}
c2a8: e28dd01c add sp, sp, #28
c2ac: e8bd8030 pop {r4, r5, pc}
the_jnode->info.device.minor,
(void *) &args
);
if ( status )
return rtems_deviceio_errno(status);
c2b0: eb000252 bl cc00 <rtems_deviceio_errno> <== NOT EXECUTED
c2b4: eafffffb b c2a8 <device_read+0x54> <== NOT EXECUTED
0000c2b8 <device_write>:
ssize_t device_write(
rtems_libio_t *iop,
const void *buffer,
size_t count
)
{
c2b8: e92d4030 push {r4, r5, lr}
rtems_libio_rw_args_t args;
rtems_status_code status;
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
c2bc: e590c018 ldr ip, [r0, #24]
ssize_t device_write(
rtems_libio_t *iop,
const void *buffer,
size_t count
)
{
c2c0: e24dd01c sub sp, sp, #28
c2c4: e1a03000 mov r3, r0
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
c2c8: e280500c add r5, r0, #12
c2cc: e8950030 ldm r5, {r4, r5}
args.buffer = (void *) buffer;
args.count = count;
args.flags = iop->flags;
c2d0: e590e014 ldr lr, [r0, #20]
the_jnode = iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
args.buffer = (void *) buffer;
c2d4: e58d100c str r1, [sp, #12]
args.count = count;
c2d8: e58d2010 str r2, [sp, #16]
rtems_status_code status;
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
args.iop = iop;
c2dc: e58d3000 str r3, [sp]
args.buffer = (void *) buffer;
args.count = count;
args.flags = iop->flags;
args.bytes_moved = 0;
status = rtems_io_write(
c2e0: e59c0050 ldr r0, [ip, #80] ; 0x50
args.iop = iop;
args.offset = iop->offset;
args.buffer = (void *) buffer;
args.count = count;
args.flags = iop->flags;
args.bytes_moved = 0;
c2e4: e3a03000 mov r3, #0
status = rtems_io_write(
c2e8: e59c1054 ldr r1, [ip, #84] ; 0x54
c2ec: e1a0200d mov r2, sp
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
c2f0: e98d0030 stmib sp, {r4, r5}
args.buffer = (void *) buffer;
args.count = count;
args.flags = iop->flags;
c2f4: e58de014 str lr, [sp, #20]
args.bytes_moved = 0;
c2f8: e58d3018 str r3, [sp, #24]
status = rtems_io_write(
c2fc: eb0001e4 bl ca94 <rtems_io_write>
the_jnode->info.device.major,
the_jnode->info.device.minor,
(void *) &args
);
if ( status )
c300: e3500000 cmp r0, #0
return rtems_deviceio_errno(status);
return (ssize_t) args.bytes_moved;
c304: 059d0018 ldreq r0, [sp, #24]
the_jnode->info.device.major,
the_jnode->info.device.minor,
(void *) &args
);
if ( status )
c308: 1a000001 bne c314 <device_write+0x5c>
return rtems_deviceio_errno(status);
return (ssize_t) args.bytes_moved;
}
c30c: e28dd01c add sp, sp, #28
c310: e8bd8030 pop {r4, r5, pc}
the_jnode->info.device.minor,
(void *) &args
);
if ( status )
return rtems_deviceio_errno(status);
c314: eb000239 bl cc00 <rtems_deviceio_errno> <== NOT EXECUTED
c318: eafffffb b c30c <device_write+0x54> <== NOT EXECUTED
00002ee8 <drainOutput>:
drainOutput (struct rtems_termios_tty *tty)
{
rtems_interrupt_level level;
rtems_status_code sc;
if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) {
2ee8: e59030b4 ldr r3, [r0, #180] ; 0xb4
2eec: e3530000 cmp r3, #0
/*
* Drain output queue
*/
static void
drainOutput (struct rtems_termios_tty *tty)
{
2ef0: e92d4030 push {r4, r5, lr}
2ef4: e1a04000 mov r4, r0
rtems_interrupt_level level;
rtems_status_code sc;
if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) {
2ef8: 08bd8030 popeq {r4, r5, pc}
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
2efc: e10f3000 mrs r3, CPSR
2f00: e3832080 orr r2, r3, #128 ; 0x80
2f04: e129f002 msr CPSR_fc, r2
rtems_interrupt_disable (level);
while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) {
2f08: e5901084 ldr r1, [r0, #132] ; 0x84
2f0c: e5902080 ldr r2, [r0, #128] ; 0x80
2f10: e1510002 cmp r1, r2
2f14: 0a00000f beq 2f58 <drainOutput+0x70>
tty->rawOutBufState = rob_wait;
2f18: e3a05002 mov r5, #2 <== NOT EXECUTED
2f1c: e5845094 str r5, [r4, #148] ; 0x94 <== NOT EXECUTED
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
2f20: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED
rtems_interrupt_enable (level);
sc = rtems_semaphore_obtain(
2f24: e3a01000 mov r1, #0 <== NOT EXECUTED
2f28: e594008c ldr r0, [r4, #140] ; 0x8c <== NOT EXECUTED
2f2c: e1a02001 mov r2, r1 <== NOT EXECUTED
2f30: eb0009c6 bl 5650 <rtems_semaphore_obtain> <== NOT EXECUTED
tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
2f34: e3500000 cmp r0, #0 <== NOT EXECUTED
2f38: 1a000008 bne 2f60 <drainOutput+0x78> <== NOT EXECUTED
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
2f3c: e10f3000 mrs r3, CPSR <== NOT EXECUTED
2f40: e3832080 orr r2, r3, #128 ; 0x80 <== NOT EXECUTED
2f44: e129f002 msr CPSR_fc, r2 <== 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) {
2f48: e5941084 ldr r1, [r4, #132] ; 0x84 <== NOT EXECUTED
2f4c: e5942080 ldr r2, [r4, #128] ; 0x80 <== NOT EXECUTED
2f50: e1510002 cmp r1, r2 <== NOT EXECUTED
2f54: 1afffff0 bne 2f1c <drainOutput+0x34> <== NOT EXECUTED
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
2f58: e129f003 msr CPSR_fc, r3
2f5c: e8bd8030 pop {r4, r5, pc}
tty->rawOutBufState = rob_wait;
rtems_interrupt_enable (level);
sc = rtems_semaphore_obtain(
tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
2f60: eb000b5d bl 5cdc <rtems_fatal_error_occurred> <== NOT EXECUTED
000026b8 <dup2>:
int dup2(
int fildes,
int fildes2
)
{
26b8: e92d4070 push {r4, r5, r6, lr}
26bc: e24dd048 sub sp, sp, #72 ; 0x48
26c0: e1a05001 mov r5, r1
/*
* If fildes is not valid, then fildes2 should not be closed.
*/
status = fstat( fildes, &buf );
26c4: e1a0100d mov r1, sp
int dup2(
int fildes,
int fildes2
)
{
26c8: e1a06000 mov r6, r0
/*
* If fildes is not valid, then fildes2 should not be closed.
*/
status = fstat( fildes, &buf );
26cc: eb000197 bl 2d30 <fstat>
if ( status == -1 )
26d0: e3700001 cmn r0, #1
/*
* If fildes is not valid, then fildes2 should not be closed.
*/
status = fstat( fildes, &buf );
26d4: e1a0400d mov r4, sp
if ( status == -1 )
26d8: 1a000001 bne 26e4 <dup2+0x2c>
/*
* This fcntl handles everything else.
*/
return fcntl( fildes, F_DUPFD, fildes2 );
}
26dc: e28dd048 add sp, sp, #72 ; 0x48
26e0: e8bd8070 pop {r4, r5, r6, pc}
/*
* If fildes2 is not valid, then we should not do anything either.
*/
status = fstat( fildes2, &buf );
26e4: e1a00005 mov r0, r5
26e8: e1a0100d mov r1, sp
26ec: eb00018f bl 2d30 <fstat>
if ( status == -1 )
26f0: e3700001 cmn r0, #1
26f4: 0afffff8 beq 26dc <dup2+0x24>
/*
* This fcntl handles everything else.
*/
return fcntl( fildes, F_DUPFD, fildes2 );
26f8: e1a00006 mov r0, r6 <== NOT EXECUTED
26fc: e3a01000 mov r1, #0 <== NOT EXECUTED
2700: e1a02005 mov r2, r5 <== NOT EXECUTED
2704: eb000078 bl 28ec <fcntl> <== NOT EXECUTED
2708: eafffff3 b 26dc <dup2+0x24> <== NOT EXECUTED
00003d0c <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)
3d0c: e5903020 ldr r3, [r0, #32]
3d10: 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)
{
3d14: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
3d18: e1a04000 mov r4, r0
3d1c: e1a06001 mov r6, r1
if (tty->ccount == 0)
3d20: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
return;
if (lineFlag) {
3d24: e3510000 cmp r1, #0
3d28: 0a000010 beq 3d70 <erase+0x64>
if (!(tty->termios.c_lflag & ECHO)) {
3d2c: e590103c ldr r1, [r0, #60] ; 0x3c
3d30: e2112008 ands r2, r1, #8
tty->ccount = 0;
3d34: 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)) {
3d38: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
tty->ccount = 0;
return;
}
if (!(tty->termios.c_lflag & ECHOE)) {
3d3c: e2110010 ands r0, r1, #16
3d40: 1a00000c bne 3d78 <erase+0x6c>
tty->ccount = 0;
3d44: e5840020 str r0, [r4, #32] <== NOT EXECUTED
echo (tty->termios.c_cc[VKILL], tty);
3d48: e1a01004 mov r1, r4 <== NOT EXECUTED
3d4c: e5d40044 ldrb r0, [r4, #68] ; 0x44 <== NOT EXECUTED
3d50: ebffffc8 bl 3c78 <echo> <== NOT EXECUTED
if (tty->termios.c_lflag & ECHOK)
3d54: e594303c ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED
3d58: e3130020 tst r3, #32 <== NOT EXECUTED
3d5c: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
echo ('\n', tty);
3d60: e3a0000a mov r0, #10 <== NOT EXECUTED
3d64: e1a01004 mov r1, r4 <== NOT EXECUTED
}
}
if (!lineFlag)
break;
}
}
3d68: e8bd45f0 pop {r4, r5, r6, r7, r8, sl, lr} <== NOT EXECUTED
}
if (!(tty->termios.c_lflag & ECHOE)) {
tty->ccount = 0;
echo (tty->termios.c_cc[VKILL], tty);
if (tty->termios.c_lflag & ECHOK)
echo ('\n', tty);
3d6c: eaffffc1 b 3c78 <echo> <== NOT EXECUTED
return;
}
}
while (tty->ccount) {
3d70: e590103c ldr r1, [r0, #60] ; 0x3c
3d74: e2012008 and r2, r1, #8
rtems_termios_puts ("\b", 1, tty);
tty->column--;
}
}
else {
if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) {
3d78: e59f7198 ldr r7, [pc, #408] ; 3f18 <erase+0x20c>
3d7c: ea000008 b 3da4 <erase+0x98>
3d80: e3110c02 tst r1, #512 ; 0x200 <== NOT EXECUTED
3d84: 1a00004b bne 3eb8 <erase+0x1ac> <== NOT EXECUTED
if (tty->column)
tty->column--;
}
}
}
if (!lineFlag)
3d88: e3560000 cmp r6, #0 <== NOT EXECUTED
3d8c: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
echo ('\n', tty);
return;
}
}
while (tty->ccount) {
3d90: e5943020 ldr r3, [r4, #32]
3d94: e3530000 cmp r3, #0
3d98: 0a000045 beq 3eb4 <erase+0x1a8>
}
if (!(tty->termios.c_lflag & ECHOE)) {
tty->ccount = 0;
echo (tty->termios.c_cc[VKILL], tty);
if (tty->termios.c_lflag & ECHOK)
echo ('\n', tty);
3d9c: e594103c ldr r1, [r4, #60] ; 0x3c
3da0: e2012008 and r2, r1, #8
return;
}
}
while (tty->ccount) {
unsigned char c = tty->cbuf[--tty->ccount];
3da4: e2433001 sub r3, r3, #1
3da8: e594001c ldr r0, [r4, #28]
3dac: e5843020 str r3, [r4, #32]
if (tty->termios.c_lflag & ECHO) {
3db0: e3520000 cmp r2, #0
return;
}
}
while (tty->ccount) {
unsigned char c = tty->cbuf[--tty->ccount];
3db4: e7d05003 ldrb r5, [r0, r3]
if (tty->termios.c_lflag & ECHO) {
3db8: 0afffff2 beq 3d88 <erase+0x7c>
if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) {
3dbc: e3560000 cmp r6, #0
3dc0: 1a000001 bne 3dcc <erase+0xc0>
3dc4: e3110010 tst r1, #16
3dc8: 0a000035 beq 3ea4 <erase+0x198>
echo (tty->termios.c_cc[VERASE], tty);
} else if (c == '\t') {
3dcc: e3550009 cmp r5, #9
3dd0: 0a00000f beq 3e14 <erase+0x108>
rtems_termios_puts ("\b", 1, tty);
tty->column--;
}
}
else {
if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) {
3dd4: e5973000 ldr r3, [r7]
3dd8: e2855001 add r5, r5, #1
3ddc: e7d33005 ldrb r3, [r3, r5]
3de0: e3130020 tst r3, #32
3de4: 1affffe5 bne 3d80 <erase+0x74>
rtems_termios_puts ("\b \b", 3, tty);
if (tty->column)
tty->column--;
}
if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) {
rtems_termios_puts ("\b \b", 3, tty);
3de8: e59f012c ldr r0, [pc, #300] ; 3f1c <erase+0x210>
3dec: e3a01003 mov r1, #3
3df0: e1a02004 mov r2, r4
3df4: ebfffefd bl 39f0 <rtems_termios_puts>
if (tty->column)
3df8: e5943028 ldr r3, [r4, #40] ; 0x28
3dfc: e3530000 cmp r3, #0
tty->column--;
3e00: 12433001 subne r3, r3, #1
3e04: 15843028 strne r3, [r4, #40] ; 0x28
}
}
}
if (!lineFlag)
3e08: e3560000 cmp r6, #0
3e0c: 1affffdf bne 3d90 <erase+0x84>
3e10: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
int i = 0;
/*
* Find the character before the tab
*/
while (i != tty->ccount) {
3e14: e3530000 cmp r3, #0
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;
3e18: e594502c ldr r5, [r4, #44] ; 0x2c
int i = 0;
/*
* Find the character before the tab
*/
while (i != tty->ccount) {
3e1c: 0a000011 beq 3e68 <erase+0x15c>
c = tty->cbuf[i++];
if (c == '\t') {
col = (col | 7) + 1;
} else if (iscntrl (c)) {
3e20: e5978000 ldr r8, [r7]
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;
3e24: 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)
3e28: e201ac02 and sl, r1, #512 ; 0x200
/*
* Find the character before the tab
*/
while (i != tty->ccount) {
c = tty->cbuf[i++];
3e2c: e7d01002 ldrb r1, [r0, r2]
if (c == '\t') {
3e30: e3510009 cmp r1, #9
col = (col | 7) + 1;
3e34: 03855007 orreq r5, r5, #7
} else if (iscntrl (c)) {
3e38: e088c001 add ip, r8, r1
/*
* Find the character before the tab
*/
while (i != tty->ccount) {
c = tty->cbuf[i++];
3e3c: e2822001 add r2, r2, #1
if (c == '\t') {
col = (col | 7) + 1;
3e40: 02855001 addeq r5, r5, #1
/*
* Find the character before the tab
*/
while (i != tty->ccount) {
c = tty->cbuf[i++];
if (c == '\t') {
3e44: 0a000005 beq 3e60 <erase+0x154>
col = (col | 7) + 1;
} else if (iscntrl (c)) {
3e48: e5dcc001 ldrb ip, [ip, #1]
3e4c: e31c0020 tst ip, #32
if (tty->termios.c_lflag & ECHOCTL)
col += 2;
} else {
col++;
3e50: 02855001 addeq r5, r5, #1
*/
while (i != tty->ccount) {
c = tty->cbuf[i++];
if (c == '\t') {
col = (col | 7) + 1;
} else if (iscntrl (c)) {
3e54: 0a000001 beq 3e60 <erase+0x154>
if (tty->termios.c_lflag & ECHOCTL)
3e58: e35a0000 cmp sl, #0 <== NOT EXECUTED
col += 2;
3e5c: 12855002 addne r5, r5, #2 <== NOT EXECUTED
int i = 0;
/*
* Find the character before the tab
*/
while (i != tty->ccount) {
3e60: e1530002 cmp r3, r2
3e64: 1afffff0 bne 3e2c <erase+0x120>
}
/*
* Back up over the tab
*/
while (tty->column > col) {
3e68: e5943028 ldr r3, [r4, #40] ; 0x28
3e6c: e1550003 cmp r5, r3
3e70: aaffffc4 bge 3d88 <erase+0x7c>
rtems_termios_puts ("\b", 1, tty);
3e74: e59f00a4 ldr r0, [pc, #164] ; 3f20 <erase+0x214>
3e78: e3a01001 mov r1, #1
3e7c: e1a02004 mov r2, r4
3e80: ebfffeda bl 39f0 <rtems_termios_puts>
tty->column--;
3e84: e5943028 ldr r3, [r4, #40] ; 0x28
3e88: e2433001 sub r3, r3, #1
}
/*
* Back up over the tab
*/
while (tty->column > col) {
3e8c: e1530005 cmp r3, r5
rtems_termios_puts ("\b", 1, tty);
tty->column--;
3e90: e5843028 str r3, [r4, #40] ; 0x28
}
/*
* Back up over the tab
*/
while (tty->column > col) {
3e94: cafffff6 bgt 3e74 <erase+0x168>
if (tty->column)
tty->column--;
}
}
}
if (!lineFlag)
3e98: e3560000 cmp r6, #0
3e9c: 1affffbb bne 3d90 <erase+0x84>
3ea0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== 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);
3ea4: e5d40043 ldrb r0, [r4, #67] ; 0x43 <== NOT EXECUTED
3ea8: e1a01004 mov r1, r4 <== NOT EXECUTED
}
}
if (!lineFlag)
break;
}
}
3eac: e8bd45f0 pop {r4, r5, r6, r7, r8, sl, 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);
3eb0: eaffff70 b 3c78 <echo> <== NOT EXECUTED
3eb4: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
tty->column--;
}
}
else {
if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) {
rtems_termios_puts ("\b \b", 3, tty);
3eb8: e59f005c ldr r0, [pc, #92] ; 3f1c <erase+0x210> <== NOT EXECUTED
3ebc: e3a01003 mov r1, #3 <== NOT EXECUTED
3ec0: e1a02004 mov r2, r4 <== NOT EXECUTED
3ec4: ebfffec9 bl 39f0 <rtems_termios_puts> <== NOT EXECUTED
if (tty->column)
3ec8: e5943028 ldr r3, [r4, #40] ; 0x28 <== NOT EXECUTED
3ecc: e3530000 cmp r3, #0 <== NOT EXECUTED
tty->column--;
3ed0: 12433001 subne r3, r3, #1 <== NOT EXECUTED
3ed4: 15843028 strne r3, [r4, #40] ; 0x28 <== NOT EXECUTED
}
if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) {
3ed8: e5973000 ldr r3, [r7] <== NOT EXECUTED
3edc: e7d33005 ldrb r3, [r3, r5] <== NOT EXECUTED
3ee0: e3130020 tst r3, #32 <== NOT EXECUTED
3ee4: 0affffbf beq 3de8 <erase+0xdc> <== NOT EXECUTED
3ee8: e594303c ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED
3eec: e3130c02 tst r3, #512 ; 0x200 <== NOT EXECUTED
3ef0: 0affffa4 beq 3d88 <erase+0x7c> <== NOT EXECUTED
rtems_termios_puts ("\b \b", 3, tty);
3ef4: e59f0020 ldr r0, [pc, #32] ; 3f1c <erase+0x210> <== NOT EXECUTED
3ef8: e3a01003 mov r1, #3 <== NOT EXECUTED
3efc: e1a02004 mov r2, r4 <== NOT EXECUTED
3f00: ebfffeba bl 39f0 <rtems_termios_puts> <== NOT EXECUTED
if (tty->column)
3f04: e5943028 ldr r3, [r4, #40] ; 0x28 <== NOT EXECUTED
3f08: e3530000 cmp r3, #0 <== NOT EXECUTED
tty->column--;
3f0c: 12433001 subne r3, r3, #1 <== NOT EXECUTED
3f10: 15843028 strne r3, [r4, #40] ; 0x28 <== NOT EXECUTED
3f14: eaffffbb b 3e08 <erase+0xfc> <== NOT EXECUTED
000028ec <fcntl>:
int fcntl(
int fd,
int cmd,
...
)
{
28ec: e92d000e push {r1, r2, r3}
28f0: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
int fd2;
int flags;
int mask;
int ret = 0;
rtems_libio_check_fd( fd );
28f4: e59f31d0 ldr r3, [pc, #464] ; 2acc <fcntl+0x1e0>
28f8: e5933000 ldr r3, [r3]
int fcntl(
int fd,
int cmd,
...
)
{
28fc: e24dd004 sub sp, sp, #4
int ret;
va_list ap;
va_start( ap, cmd );
2900: e28d2028 add r2, sp, #40 ; 0x28
int fd2;
int flags;
int mask;
int ret = 0;
rtems_libio_check_fd( fd );
2904: e1500003 cmp r0, r3
int fcntl(
int fd,
int cmd,
...
)
{
2908: e59d4024 ldr r4, [sp, #36] ; 0x24
int ret;
va_list ap;
va_start( ap, cmd );
290c: e58d2000 str r2, [sp]
int fd2;
int flags;
int mask;
int ret = 0;
rtems_libio_check_fd( fd );
2910: 2a000061 bcs 2a9c <fcntl+0x1b0>
iop = rtems_libio_iop( fd );
2914: e59f71b4 ldr r7, [pc, #436] ; 2ad0 <fcntl+0x1e4>
2918: e5976000 ldr r6, [r7]
291c: e0600180 rsb r0, r0, r0, lsl #3
2920: e0865180 add r5, r6, r0, lsl #3
rtems_libio_check_is_open(iop);
2924: e595c014 ldr ip, [r5, #20]
2928: e31c0c01 tst ip, #256 ; 0x100
292c: 0a00005a beq 2a9c <fcntl+0x1b0>
/*
* This switch should contain all the cases from POSIX.
*/
switch ( cmd ) {
2930: e3540009 cmp r4, #9
2934: 979ff104 ldrls pc, [pc, r4, lsl #2]
2938: ea000028 b 29e0 <fcntl+0xf4>
293c: 000029f0 .word 0x000029f0 <== NOT EXECUTED
2940: 00002a54 .word 0x00002a54 <== NOT EXECUTED
2944: 00002a64 .word 0x00002a64 <== NOT EXECUTED
2948: 00002a84 .word 0x00002a84 <== NOT EXECUTED
294c: 00002988 .word 0x00002988 <== NOT EXECUTED
2950: 00002964 .word 0x00002964 <== NOT EXECUTED
2954: 00002964 .word 0x00002964 <== NOT EXECUTED
2958: 00002964 .word 0x00002964 <== NOT EXECUTED
295c: 00002964 .word 0x00002964 <== NOT EXECUTED
2960: 00002964 .word 0x00002964 <== NOT EXECUTED
errno = ENOTSUP;
ret = -1;
break;
case F_GETOWN: /* for sockets. */
errno = ENOTSUP;
2964: eb002cc6 bl dc84 <__errno>
2968: e3a03086 mov r3, #134 ; 0x86
296c: e5803000 str r3, [r0]
if (ret >= 0) {
int err = (*iop->pathinfo.handlers->fcntl_h)( cmd, iop );
if (err) {
errno = err;
ret = -1;
2970: e3e06000 mvn r6, #0
va_list ap;
va_start( ap, cmd );
ret = vfcntl(fd,cmd,ap);
va_end(ap);
return ret;
}
2974: e1a00006 mov r0, r6
2978: e28dd004 add sp, sp, #4
297c: e8bd47f0 pop {r4, r5, r6, r7, r8, r9, sl, lr}
2980: e28dd00c add sp, sp, #12
2984: e12fff1e bx lr
case F_GETFL: /* more flags (cloexec) */
ret = rtems_libio_to_fcntl_flags( iop->flags );
break;
case F_SETFL:
flags = rtems_libio_fcntl_flags( va_arg( ap, int ) );
2988: e5920000 ldr r0, [r2]
298c: eb000181 bl 2f98 <rtems_libio_fcntl_flags>
/*
* XXX If we are turning on append, should we seek to the end?
*/
iop->flags = (iop->flags & ~mask) | (flags & mask);
2990: e5953014 ldr r3, [r5, #20]
2994: e3c00f7f bic r0, r0, #508 ; 0x1fc
2998: e3c00002 bic r0, r0, #2
299c: e1a00b00 lsl r0, r0, #22
29a0: e3c33c02 bic r3, r3, #512 ; 0x200
29a4: e1a00b20 lsr r0, r0, #22
29a8: e3c33001 bic r3, r3, #1
29ac: e1800003 orr r0, r0, r3
29b0: e5850014 str r0, [r5, #20]
rtems_libio_t *iop;
rtems_libio_t *diop;
int fd2;
int flags;
int mask;
int ret = 0;
29b4: e3a06000 mov r6, #0
* If we got this far successfully, then we give the optional
* filesystem specific handler a chance to process this.
*/
if (ret >= 0) {
int err = (*iop->pathinfo.handlers->fcntl_h)( cmd, iop );
29b8: e1a00004 mov r0, r4
29bc: e5953020 ldr r3, [r5, #32]
29c0: e1a01005 mov r1, r5
29c4: e1a0e00f mov lr, pc
29c8: e593f030 ldr pc, [r3, #48] ; 0x30
if (err) {
29cc: e2504000 subs r4, r0, #0
29d0: 0affffe7 beq 2974 <fcntl+0x88>
errno = err;
29d4: eb002caa bl dc84 <__errno> <== NOT EXECUTED
29d8: e5804000 str r4, [r0] <== NOT EXECUTED
29dc: eaffffe3 b 2970 <fcntl+0x84> <== NOT EXECUTED
errno = ENOTSUP;
ret = -1;
break;
default:
errno = EINVAL;
29e0: eb002ca7 bl dc84 <__errno>
29e4: e3a03016 mov r3, #22
29e8: e5803000 str r3, [r0]
29ec: eaffffdf b 2970 <fcntl+0x84>
* This switch should contain all the cases from POSIX.
*/
switch ( cmd ) {
case F_DUPFD: /* dup */
fd2 = va_arg( ap, int );
29f0: e592a000 ldr sl, [r2]
if ( fd2 )
29f4: e35a0000 cmp sl, #0
29f8: 0a00002c beq 2ab0 <fcntl+0x1c4>
diop = rtems_libio_iop( fd2 );
29fc: e153000a cmp r3, sl <== NOT EXECUTED
2a00: 806aa18a rsbhi sl, sl, sl, lsl #3 <== NOT EXECUTED
2a04: 8086a18a addhi sl, r6, sl, lsl #3 <== NOT EXECUTED
2a08: 81a0900a movhi r9, sl <== NOT EXECUTED
2a0c: 93a09000 movls r9, #0 <== NOT EXECUTED
2a10: 91a0a009 movls sl, r9 <== NOT EXECUTED
break;
}
}
diop->flags = iop->flags;
diop->pathinfo = iop->pathinfo;
2a14: e2857018 add r7, r5, #24
2a18: e8b7000f ldm r7!, {r0, r1, r2, r3}
2a1c: e28a8018 add r8, sl, #24
2a20: e8a8000f stmia r8!, {r0, r1, r2, r3}
ret = (int) (diop - rtems_libio_iops);
2a24: e0669009 rsb r9, r6, r9
2a28: e1a091c9 asr r9, r9, #3
2a2c: e0896189 add r6, r9, r9, lsl #3
2a30: e0866306 add r6, r6, r6, lsl #6
2a34: e0896186 add r6, r9, r6, lsl #3
break;
}
}
diop->flags = iop->flags;
diop->pathinfo = iop->pathinfo;
2a38: e5973000 ldr r3, [r7]
ret = (int) (diop - rtems_libio_iops);
2a3c: e0866786 add r6, r6, r6, lsl #15
2a40: e0896186 add r6, r9, r6, lsl #3
ret = -1;
break;
}
}
diop->flags = iop->flags;
2a44: e58ac014 str ip, [sl, #20]
diop->pathinfo = iop->pathinfo;
2a48: e5883000 str r3, [r8]
ret = (int) (diop - rtems_libio_iops);
2a4c: e2666000 rsb r6, r6, #0
2a50: ea00000e b 2a90 <fcntl+0x1a4>
break;
case F_GETFD: /* get f_flags */
ret = ((iop->flags & LIBIO_FLAGS_CLOSE_ON_EXEC) != 0);
2a54: e31c0b02 tst ip, #2048 ; 0x800
2a58: 03a06000 moveq r6, #0
2a5c: 13a06001 movne r6, #1
2a60: eaffffd4 b 29b8 <fcntl+0xcc>
* 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 ) )
2a64: e5926000 ldr r6, [r2]
2a68: e3560000 cmp r6, #0
iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC;
2a6c: 138ccb02 orrne ip, ip, #2048 ; 0x800
else
iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC;
2a70: 03cccb02 biceq ip, ip, #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;
2a74: 1585c014 strne ip, [r5, #20]
rtems_libio_t *iop;
rtems_libio_t *diop;
int fd2;
int flags;
int mask;
int ret = 0;
2a78: 13a06000 movne r6, #0
*/
if ( va_arg( ap, int ) )
iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC;
else
iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC;
2a7c: 0585c014 streq ip, [r5, #20]
2a80: eaffffcc b 29b8 <fcntl+0xcc>
break;
case F_GETFL: /* more flags (cloexec) */
ret = rtems_libio_to_fcntl_flags( iop->flags );
2a84: e1a0000c mov r0, ip
2a88: eb00014f bl 2fcc <rtems_libio_to_fcntl_flags>
2a8c: e1a06000 mov r6, r0
/*
* If we got this far successfully, then we give the optional
* filesystem specific handler a chance to process this.
*/
if (ret >= 0) {
2a90: e3560000 cmp r6, #0
2a94: aaffffc7 bge 29b8 <fcntl+0xcc>
2a98: eaffffb5 b 2974 <fcntl+0x88> <== NOT EXECUTED
int mask;
int ret = 0;
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open(iop);
2a9c: eb002c78 bl dc84 <__errno>
2aa0: e3a03009 mov r3, #9
2aa4: e5803000 str r3, [r0]
2aa8: e3e06000 mvn r6, #0
2aac: eaffffb0 b 2974 <fcntl+0x88>
fd2 = va_arg( ap, int );
if ( fd2 )
diop = rtems_libio_iop( fd2 );
else {
/* allocate a file control block */
diop = rtems_libio_allocate();
2ab0: eb000158 bl 3018 <rtems_libio_allocate>
if ( diop == 0 ) {
2ab4: e250a000 subs sl, r0, #0
2ab8: 0affffac beq 2970 <fcntl+0x84>
2abc: e595c014 ldr ip, [r5, #20]
2ac0: e1a0900a mov r9, sl
2ac4: e5976000 ldr r6, [r7]
2ac8: eaffffd1 b 2a14 <fcntl+0x128>
0000b8dc <fifo_open>:
*/
int fifo_open(
pipe_control_t **pipep,
rtems_libio_t *iop
)
{
b8dc: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
b8e0: e24dd008 sub sp, sp, #8
b8e4: e1a05000 mov r5, r0
b8e8: e1a07001 mov r7, r1
)
{
pipe_control_t *pipe;
int err = 0;
err = pipe_lock();
b8ec: ebffff82 bl b6fc <pipe_lock>
if (err)
b8f0: e2504000 subs r4, r0, #0
b8f4: 1a00001b bne b968 <fifo_open+0x8c>
return err;
pipe = *pipep;
b8f8: e5956000 ldr r6, [r5]
if (pipe == NULL) {
b8fc: e3560000 cmp r6, #0
b900: 0a00001b beq b974 <fifo_open+0x98>
err = pipe_alloc(&pipe);
if (err)
goto out;
}
if (! PIPE_LOCK(pipe))
b904: e3a01000 mov r1, #0
b908: e5960028 ldr r0, [r6, #40] ; 0x28
b90c: e1a02001 mov r2, r1
b910: ebffed53 bl 6e64 <rtems_semaphore_obtain>
err = -EINTR;
if (*pipep == NULL) {
b914: e5953000 ldr r3, [r5]
err = pipe_alloc(&pipe);
if (err)
goto out;
}
if (! PIPE_LOCK(pipe))
b918: e3500000 cmp r0, #0
b91c: 13e08003 mvnne r8, #3
b920: 03a08000 moveq r8, #0
err = -EINTR;
if (*pipep == NULL) {
b924: e3530000 cmp r3, #0
b928: 0a0000ac beq bbe0 <fifo_open+0x304>
else
*pipep = pipe;
}
out:
pipe_unlock();
b92c: ebffff9d bl b7a8 <pipe_unlock>
pipe_control_t *pipe;
unsigned int prevCounter;
int err;
err = pipe_new(pipep);
if (err)
b930: e3580000 cmp r8, #0
b934: 11a04008 movne r4, r8
b938: 1a00000a bne b968 <fifo_open+0x8c>
return err;
pipe = *pipep;
switch (LIBIO_ACCMODE(iop)) {
b93c: e5973014 ldr r3, [r7, #20]
b940: e2033006 and r3, r3, #6
b944: e3530004 cmp r3, #4
int err;
err = pipe_new(pipep);
if (err)
return err;
pipe = *pipep;
b948: e5956000 ldr r6, [r5]
switch (LIBIO_ACCMODE(iop)) {
b94c: 0a000083 beq bb60 <fifo_open+0x284>
b950: e3530006 cmp r3, #6
b954: 0a00006d beq bb10 <fifo_open+0x234>
b958: e3530002 cmp r3, #2
b95c: 0a000047 beq ba80 <fifo_open+0x1a4>
if (pipe->Writers ++ == 0)
PIPE_WAKEUPREADERS(pipe);
break;
}
PIPE_UNLOCK(pipe);
b960: e5960028 ldr r0, [r6, #40] ; 0x28
b964: ebffed87 bl 6f88 <rtems_semaphore_release>
return 0;
out_error:
pipe_release(pipep, iop);
return err;
}
b968: e1a00004 mov r0, r4
b96c: e28dd008 add sp, sp, #8
b970: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
{
static char c = 'a';
pipe_control_t *pipe;
int err = -ENOMEM;
pipe = malloc(sizeof(pipe_control_t));
b974: e3a00034 mov r0, #52 ; 0x34
b978: ebffdffb bl 396c <malloc>
if (pipe == NULL)
b97c: e3500000 cmp r0, #0
{
static char c = 'a';
pipe_control_t *pipe;
int err = -ENOMEM;
pipe = malloc(sizeof(pipe_control_t));
b980: e1a06000 mov r6, r0
b984: e1a0a000 mov sl, r0
if (pipe == NULL)
b988: 0a0000be beq bc88 <fifo_open+0x3ac>
return err;
memset(pipe, 0, sizeof(pipe_control_t));
b98c: e1a02000 mov r2, r0
b990: e4824004 str r4, [r2], #4
b994: e2822004 add r2, r2, #4
b998: e4824004 str r4, [r2], #4
b99c: e4824004 str r4, [r2], #4
b9a0: e4824004 str r4, [r2], #4
b9a4: e4824004 str r4, [r2], #4
b9a8: e4824004 str r4, [r2], #4
b9ac: e4824004 str r4, [r2], #4
b9b0: e4824004 str r4, [r2], #4
b9b4: e4824004 str r4, [r2], #4
b9b8: e4824004 str r4, [r2], #4
b9bc: e4824004 str r4, [r2], #4
pipe->Size = PIPE_BUF;
b9c0: e3a03c02 mov r3, #512 ; 0x200
int err = -ENOMEM;
pipe = malloc(sizeof(pipe_control_t));
if (pipe == NULL)
return err;
memset(pipe, 0, sizeof(pipe_control_t));
b9c4: e5824000 str r4, [r2]
pipe->Size = PIPE_BUF;
pipe->Buffer = malloc(pipe->Size);
b9c8: e1a00003 mov r0, r3
pipe = malloc(sizeof(pipe_control_t));
if (pipe == NULL)
return err;
memset(pipe, 0, sizeof(pipe_control_t));
pipe->Size = PIPE_BUF;
b9cc: e5863004 str r3, [r6, #4]
pipe->Buffer = malloc(pipe->Size);
b9d0: ebffdfe5 bl 396c <malloc>
if (! pipe->Buffer)
b9d4: 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);
b9d8: e5860000 str r0, [r6]
if (! pipe->Buffer)
b9dc: 0a0000a7 beq bc80 <fifo_open+0x3a4>
goto err_buf;
err = -ENOMEM;
if (rtems_barrier_create(
rtems_build_name ('P', 'I', 'r', c),
b9e0: e59f82ac ldr r8, [pc, #684] ; bc94 <fifo_open+0x3b8>
b9e4: e5d80000 ldrb r0, [r8]
if (! pipe->Buffer)
goto err_buf;
err = -ENOMEM;
if (rtems_barrier_create(
b9e8: e3800205 orr r0, r0, #1342177280 ; 0x50000000
b9ec: e3800849 orr r0, r0, #4784128 ; 0x490000
b9f0: e3800c72 orr r0, r0, #29184 ; 0x7200
b9f4: e1a01004 mov r1, r4
b9f8: e1a02004 mov r2, r4
b9fc: e286302c add r3, r6, #44 ; 0x2c
ba00: eb0004b8 bl cce8 <rtems_barrier_create>
ba04: e3500000 cmp r0, #0
ba08: 1a00009a bne bc78 <fifo_open+0x39c>
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),
ba0c: e5d80000 ldrb r0, [r8]
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(
ba10: e3800205 orr r0, r0, #1342177280 ; 0x50000000
ba14: e3800849 orr r0, r0, #4784128 ; 0x490000
ba18: e3800c77 orr r0, r0, #30464 ; 0x7700
ba1c: e1a01004 mov r1, r4
ba20: e1a02004 mov r2, r4
ba24: e2863030 add r3, r6, #48 ; 0x30
ba28: eb0004ae bl cce8 <rtems_barrier_create>
ba2c: e3500000 cmp r0, #0
ba30: 1a00008e bne bc70 <fifo_open+0x394>
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,
ba34: e5d80000 ldrb r0, [r8]
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(
ba38: e3800205 orr r0, r0, #1342177280 ; 0x50000000
ba3c: e3800849 orr r0, r0, #4784128 ; 0x490000
ba40: e286c028 add ip, r6, #40 ; 0x28
ba44: e3800c73 orr r0, r0, #29440 ; 0x7300
ba48: e3a01001 mov r1, #1
ba4c: e3a02010 mov r2, #16
ba50: e1a03004 mov r3, r4
ba54: e58dc000 str ip, [sp]
ba58: ebffec67 bl 6bfc <rtems_semaphore_create>
ba5c: e3500000 cmp r0, #0
ba60: 1a000080 bne bc68 <fifo_open+0x38c>
#ifdef RTEMS_POSIX_API
pipe_interruptible(pipe);
#endif
*pipep = pipe;
if (c ++ == 'z')
ba64: e5d83000 ldrb r3, [r8]
ba68: e353007a cmp r3, #122 ; 0x7a
ba6c: e2832001 add r2, r3, #1
c = 'a';
ba70: 03a03061 moveq r3, #97 ; 0x61
#ifdef RTEMS_POSIX_API
pipe_interruptible(pipe);
#endif
*pipep = pipe;
if (c ++ == 'z')
ba74: e5c82000 strb r2, [r8]
c = 'a';
ba78: 05c83000 strbeq r3, [r8]
ba7c: eaffffa0 b b904 <fifo_open+0x28>
pipe = *pipep;
switch (LIBIO_ACCMODE(iop)) {
case LIBIO_FLAGS_READ:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
ba80: e5963010 ldr r3, [r6, #16]
return err;
pipe = *pipep;
switch (LIBIO_ACCMODE(iop)) {
case LIBIO_FLAGS_READ:
pipe->readerCounter ++;
ba84: e5961020 ldr r1, [r6, #32]
if (pipe->Readers ++ == 0)
ba88: e2832001 add r2, r3, #1
return err;
pipe = *pipep;
switch (LIBIO_ACCMODE(iop)) {
case LIBIO_FLAGS_READ:
pipe->readerCounter ++;
ba8c: e2811001 add r1, r1, #1
if (pipe->Readers ++ == 0)
ba90: e3530000 cmp r3, #0
return err;
pipe = *pipep;
switch (LIBIO_ACCMODE(iop)) {
case LIBIO_FLAGS_READ:
pipe->readerCounter ++;
ba94: e5861020 str r1, [r6, #32]
if (pipe->Readers ++ == 0)
ba98: e5862010 str r2, [r6, #16]
ba9c: 0a000069 beq bc48 <fifo_open+0x36c>
PIPE_WAKEUPWRITERS(pipe);
if (pipe->Writers == 0) {
baa0: e5963014 ldr r3, [r6, #20]
baa4: e3530000 cmp r3, #0
baa8: 1affffac bne b960 <fifo_open+0x84>
/* Not an error */
if (LIBIO_NODELAY(iop))
baac: e5973014 ldr r3, [r7, #20]
bab0: e3130001 tst r3, #1
bab4: 1affffa9 bne b960 <fifo_open+0x84>
break;
prevCounter = pipe->writerCounter;
bab8: e5968024 ldr r8, [r6, #36] ; 0x24
babc: ea000006 b badc <fifo_open+0x200>
/* Wait until a writer opens the pipe */
do {
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
goto out_error;
if (! PIPE_LOCK(pipe))
bac0: e5960028 ldr r0, [r6, #40] ; 0x28
bac4: ebffece6 bl 6e64 <rtems_semaphore_obtain>
bac8: e3500000 cmp r0, #0
bacc: 1a00000a bne bafc <fifo_open+0x220>
goto out_error;
} while (prevCounter == pipe->writerCounter);
bad0: e5963024 ldr r3, [r6, #36] ; 0x24
bad4: e1530008 cmp r3, r8
bad8: 1affffa0 bne b960 <fifo_open+0x84>
prevCounter = pipe->writerCounter;
err = -EINTR;
/* Wait until a writer opens the pipe */
do {
PIPE_UNLOCK(pipe);
badc: e5960028 ldr r0, [r6, #40] ; 0x28
bae0: ebffed28 bl 6f88 <rtems_semaphore_release>
if (! PIPE_READWAIT(pipe))
bae4: e3a01000 mov r1, #0
bae8: e596002c ldr r0, [r6, #44] ; 0x2c
baec: eb0004f3 bl cec0 <rtems_barrier_wait>
baf0: e2501000 subs r1, r0, #0
goto out_error;
if (! PIPE_LOCK(pipe))
baf4: e1a02001 mov r2, r1
prevCounter = pipe->writerCounter;
err = -EINTR;
/* Wait until a writer opens the pipe */
do {
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
baf8: 0afffff0 beq bac0 <fifo_open+0x1e4>
goto out_error;
}
if (pipe->Readers == 0) {
prevCounter = pipe->readerCounter;
err = -EINTR;
bafc: e3e04003 mvn r4, #3 <== NOT EXECUTED
PIPE_UNLOCK(pipe);
return 0;
out_error:
pipe_release(pipep, iop);
bb00: e1a00005 mov r0, r5
bb04: e1a01007 mov r1, r7
bb08: ebffff31 bl b7d4 <pipe_release>
return err;
bb0c: eaffff95 b b968 <fifo_open+0x8c>
}
break;
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
bb10: e5963010 ldr r3, [r6, #16]
} while (prevCounter == pipe->readerCounter);
}
break;
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
bb14: e5961020 ldr r1, [r6, #32]
if (pipe->Readers ++ == 0)
bb18: e2832001 add r2, r3, #1
} while (prevCounter == pipe->readerCounter);
}
break;
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
bb1c: e2811001 add r1, r1, #1
if (pipe->Readers ++ == 0)
bb20: e3530000 cmp r3, #0
} while (prevCounter == pipe->readerCounter);
}
break;
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
bb24: e5861020 str r1, [r6, #32]
if (pipe->Readers ++ == 0)
bb28: e5862010 str r2, [r6, #16]
bb2c: 0a00003d beq bc28 <fifo_open+0x34c>
PIPE_WAKEUPWRITERS(pipe);
pipe->writerCounter ++;
if (pipe->Writers ++ == 0)
bb30: e5963014 ldr r3, [r6, #20]
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
PIPE_WAKEUPWRITERS(pipe);
pipe->writerCounter ++;
bb34: e5961024 ldr r1, [r6, #36] ; 0x24
if (pipe->Writers ++ == 0)
bb38: e2832001 add r2, r3, #1
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
PIPE_WAKEUPWRITERS(pipe);
pipe->writerCounter ++;
bb3c: e2811001 add r1, r1, #1
if (pipe->Writers ++ == 0)
bb40: e3530000 cmp r3, #0
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
PIPE_WAKEUPWRITERS(pipe);
pipe->writerCounter ++;
bb44: e5861024 str r1, [r6, #36] ; 0x24
if (pipe->Writers ++ == 0)
bb48: e5862014 str r2, [r6, #20]
bb4c: 1affff83 bne b960 <fifo_open+0x84>
PIPE_WAKEUPREADERS(pipe);
bb50: e596002c ldr r0, [r6, #44] ; 0x2c
bb54: e28d1004 add r1, sp, #4
bb58: eb0004c0 bl ce60 <rtems_barrier_release>
bb5c: eaffff7f b b960 <fifo_open+0x84>
break;
case LIBIO_FLAGS_WRITE:
pipe->writerCounter ++;
if (pipe->Writers ++ == 0)
bb60: e5963014 ldr r3, [r6, #20]
} while (prevCounter == pipe->writerCounter);
}
break;
case LIBIO_FLAGS_WRITE:
pipe->writerCounter ++;
bb64: e5961024 ldr r1, [r6, #36] ; 0x24
if (pipe->Writers ++ == 0)
bb68: e2832001 add r2, r3, #1
} while (prevCounter == pipe->writerCounter);
}
break;
case LIBIO_FLAGS_WRITE:
pipe->writerCounter ++;
bb6c: e2811001 add r1, r1, #1
if (pipe->Writers ++ == 0)
bb70: e3530000 cmp r3, #0
} while (prevCounter == pipe->writerCounter);
}
break;
case LIBIO_FLAGS_WRITE:
pipe->writerCounter ++;
bb74: e5861024 str r1, [r6, #36] ; 0x24
if (pipe->Writers ++ == 0)
bb78: e5862014 str r2, [r6, #20]
bb7c: 0a00002d beq bc38 <fifo_open+0x35c>
PIPE_WAKEUPREADERS(pipe);
if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) {
bb80: e5963010 ldr r3, [r6, #16]
bb84: e3530000 cmp r3, #0
bb88: 1affff74 bne b960 <fifo_open+0x84>
bb8c: e5973014 ldr r3, [r7, #20]
bb90: e3130001 tst r3, #1
err = -ENXIO;
goto out_error;
}
if (pipe->Readers == 0) {
prevCounter = pipe->readerCounter;
bb94: 05968020 ldreq r8, [r6, #32]
pipe->writerCounter ++;
if (pipe->Writers ++ == 0)
PIPE_WAKEUPREADERS(pipe);
if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) {
bb98: 0a000007 beq bbbc <fifo_open+0x2e0>
bb9c: ea00002d b bc58 <fifo_open+0x37c>
err = -EINTR;
do {
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
goto out_error;
if (! PIPE_LOCK(pipe))
bba0: e5960028 ldr r0, [r6, #40] ; 0x28
bba4: ebffecae bl 6e64 <rtems_semaphore_obtain>
bba8: e3500000 cmp r0, #0
bbac: 1affffd2 bne bafc <fifo_open+0x220>
goto out_error;
} while (prevCounter == pipe->readerCounter);
bbb0: e5963020 ldr r3, [r6, #32]
bbb4: e1530008 cmp r3, r8
bbb8: 1affff68 bne b960 <fifo_open+0x84>
if (pipe->Readers == 0) {
prevCounter = pipe->readerCounter;
err = -EINTR;
do {
PIPE_UNLOCK(pipe);
bbbc: e5960028 ldr r0, [r6, #40] ; 0x28
bbc0: ebffecf0 bl 6f88 <rtems_semaphore_release>
if (! PIPE_WRITEWAIT(pipe))
bbc4: e3a01000 mov r1, #0
bbc8: e5960030 ldr r0, [r6, #48] ; 0x30
bbcc: eb0004bb bl cec0 <rtems_barrier_wait>
bbd0: e2501000 subs r1, r0, #0
goto out_error;
if (! PIPE_LOCK(pipe))
bbd4: e1a02001 mov r2, r1
if (pipe->Readers == 0) {
prevCounter = pipe->readerCounter;
err = -EINTR;
do {
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
bbd8: 0afffff0 beq bba0 <fifo_open+0x2c4>
bbdc: eaffffc6 b bafc <fifo_open+0x220> <== NOT EXECUTED
if (! PIPE_LOCK(pipe))
err = -EINTR;
if (*pipep == NULL) {
if (err)
bbe0: e3580000 cmp r8, #0
bbe4: 1a000002 bne bbf4 <fifo_open+0x318>
pipe_free(pipe);
else
*pipep = pipe;
bbe8: e5856000 str r6, [r5]
}
out:
pipe_unlock();
bbec: ebfffeed bl b7a8 <pipe_unlock>
bbf0: eaffff51 b b93c <fifo_open+0x60>
/* Called with pipe_semaphore held. */
static inline void pipe_free(
pipe_control_t *pipe
)
{
rtems_barrier_delete(pipe->readBarrier);
bbf4: e596002c ldr r0, [r6, #44] ; 0x2c <== NOT EXECUTED
bbf8: eb00046c bl cdb0 <rtems_barrier_delete> <== NOT EXECUTED
rtems_barrier_delete(pipe->writeBarrier);
bbfc: e5960030 ldr r0, [r6, #48] ; 0x30 <== NOT EXECUTED
bc00: eb00046a bl cdb0 <rtems_barrier_delete> <== NOT EXECUTED
rtems_semaphore_delete(pipe->Semaphore);
bc04: e5960028 ldr r0, [r6, #40] ; 0x28 <== NOT EXECUTED
bc08: ebffec6c bl 6dc0 <rtems_semaphore_delete> <== NOT EXECUTED
free(pipe->Buffer);
bc0c: e5960000 ldr r0, [r6] <== NOT EXECUTED
bc10: ebffddb6 bl 32f0 <free> <== NOT EXECUTED
free(pipe);
bc14: e1a00006 mov r0, r6 <== NOT EXECUTED
bc18: ebffddb4 bl 32f0 <free> <== NOT EXECUTED
bc1c: e1a04008 mov r4, r8 <== NOT EXECUTED
else
*pipep = pipe;
}
out:
pipe_unlock();
bc20: ebfffee0 bl b7a8 <pipe_unlock> <== NOT EXECUTED
bc24: eaffff4f b b968 <fifo_open+0x8c> <== NOT EXECUTED
break;
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
PIPE_WAKEUPWRITERS(pipe);
bc28: e5960030 ldr r0, [r6, #48] ; 0x30
bc2c: e28d1004 add r1, sp, #4
bc30: eb00048a bl ce60 <rtems_barrier_release>
bc34: eaffffbd b bb30 <fifo_open+0x254>
case LIBIO_FLAGS_WRITE:
pipe->writerCounter ++;
if (pipe->Writers ++ == 0)
PIPE_WAKEUPREADERS(pipe);
bc38: e596002c ldr r0, [r6, #44] ; 0x2c
bc3c: e28d1004 add r1, sp, #4
bc40: eb000486 bl ce60 <rtems_barrier_release>
bc44: eaffffcd b bb80 <fifo_open+0x2a4>
switch (LIBIO_ACCMODE(iop)) {
case LIBIO_FLAGS_READ:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
PIPE_WAKEUPWRITERS(pipe);
bc48: e5960030 ldr r0, [r6, #48] ; 0x30
bc4c: e28d1004 add r1, sp, #4
bc50: eb000482 bl ce60 <rtems_barrier_release>
bc54: eaffff91 b baa0 <fifo_open+0x1c4>
if (pipe->Writers ++ == 0)
PIPE_WAKEUPREADERS(pipe);
if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) {
PIPE_UNLOCK(pipe);
bc58: e5960028 ldr r0, [r6, #40] ; 0x28
bc5c: ebffecc9 bl 6f88 <rtems_semaphore_release>
err = -ENXIO;
bc60: e3e04005 mvn r4, #5
goto out_error;
bc64: eaffffa5 b bb00 <fifo_open+0x224>
if (c ++ == 'z')
c = 'a';
return 0;
err_sem:
rtems_barrier_delete(pipe->writeBarrier);
bc68: e5960030 ldr r0, [r6, #48] ; 0x30
bc6c: eb00044f bl cdb0 <rtems_barrier_delete>
err_wbar:
rtems_barrier_delete(pipe->readBarrier);
bc70: e59a002c ldr r0, [sl, #44] ; 0x2c
bc74: eb00044d bl cdb0 <rtems_barrier_delete>
err_rbar:
free(pipe->Buffer);
bc78: e59a0000 ldr r0, [sl]
bc7c: ebffdd9b bl 32f0 <free>
err_buf:
free(pipe);
bc80: e1a0000a mov r0, sl
bc84: ebffdd99 bl 32f0 <free>
{
rtems_barrier_delete(pipe->readBarrier);
rtems_barrier_delete(pipe->writeBarrier);
rtems_semaphore_delete(pipe->Semaphore);
free(pipe->Buffer);
free(pipe);
bc88: e3e0400b mvn r4, #11
else
*pipep = pipe;
}
out:
pipe_unlock();
bc8c: ebfffec5 bl b7a8 <pipe_unlock>
bc90: eaffff34 b b968 <fifo_open+0x8c>
00002b5c <fpathconf>:
{
long return_value;
rtems_libio_t *iop;
rtems_filesystem_limits_and_options_t *the_limits;
rtems_libio_check_fd(fd);
2b5c: e59f310c ldr r3, [pc, #268] ; 2c70 <fpathconf+0x114>
2b60: e5933000 ldr r3, [r3]
2b64: e1500003 cmp r0, r3
long fpathconf(
int fd,
int name
)
{
2b68: 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);
2b6c: 2a000035 bcs 2c48 <fpathconf+0xec>
iop = rtems_libio_iop(fd);
2b70: e59f30fc ldr r3, [pc, #252] ; 2c74 <fpathconf+0x118>
2b74: e5933000 ldr r3, [r3]
2b78: e0600180 rsb r0, r0, r0, lsl #3
2b7c: e0830180 add r0, r3, r0, lsl #3
rtems_libio_check_is_open(iop);
2b80: e5903014 ldr r3, [r0, #20]
2b84: e3130c01 tst r3, #256 ; 0x100
2b88: 0a00002e beq 2c48 <fpathconf+0xec>
rtems_libio_check_permissions(iop, LIBIO_FLAGS_READ);
2b8c: e3130002 tst r3, #2
2b90: 0a000031 beq 2c5c <fpathconf+0x100>
/*
* Now process the information request.
*/
the_limits = &iop->pathinfo.mt_entry->pathconf_limits_and_options;
2b94: e5903028 ldr r3, [r0, #40] ; 0x28
switch ( name ) {
2b98: e351000b cmp r1, #11
2b9c: 979ff101 ldrls pc, [pc, r1, lsl #2]
2ba0: ea00000d b 2bdc <fpathconf+0x80>
2ba4: 00002bf0 .word 0x00002bf0 <== NOT EXECUTED
2ba8: 00002bf8 .word 0x00002bf8 <== NOT EXECUTED
2bac: 00002c00 .word 0x00002c00 <== NOT EXECUTED
2bb0: 00002c08 .word 0x00002c08 <== NOT EXECUTED
2bb4: 00002c10 .word 0x00002c10 <== NOT EXECUTED
2bb8: 00002c18 .word 0x00002c18 <== NOT EXECUTED
2bbc: 00002c20 .word 0x00002c20 <== NOT EXECUTED
2bc0: 00002c28 .word 0x00002c28 <== NOT EXECUTED
2bc4: 00002c30 .word 0x00002c30 <== NOT EXECUTED
2bc8: 00002c38 .word 0x00002c38 <== NOT EXECUTED
2bcc: 00002c40 .word 0x00002c40 <== NOT EXECUTED
2bd0: 00002bd4 .word 0x00002bd4 <== NOT EXECUTED
break;
case _PC_PRIO_IO:
return_value = the_limits->posix_prio_io;
break;
case _PC_SYNC_IO:
return_value = the_limits->posix_sync_io;
2bd4: e5930060 ldr r0, [r3, #96] ; 0x60
break;
2bd8: e49df004 pop {pc} ; (ldr pc, [sp], #4)
default:
rtems_set_errno_and_return_minus_one( EINVAL );
2bdc: eb002c28 bl dc84 <__errno>
2be0: e3a03016 mov r3, #22
2be4: e5803000 str r3, [r0]
2be8: e3e00000 mvn r0, #0
break;
}
return return_value;
}
2bec: e49df004 pop {pc} ; (ldr pc, [sp], #4)
the_limits = &iop->pathinfo.mt_entry->pathconf_limits_and_options;
switch ( name ) {
case _PC_LINK_MAX:
return_value = the_limits->link_max;
2bf0: e5930038 ldr r0, [r3, #56] ; 0x38
break;
2bf4: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_MAX_CANON:
return_value = the_limits->max_canon;
2bf8: e593003c ldr r0, [r3, #60] ; 0x3c
break;
2bfc: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_MAX_INPUT:
return_value = the_limits->max_input;
2c00: e5930040 ldr r0, [r3, #64] ; 0x40
break;
2c04: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_NAME_MAX:
return_value = the_limits->name_max;
2c08: e5930044 ldr r0, [r3, #68] ; 0x44
break;
2c0c: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_PATH_MAX:
return_value = the_limits->path_max;
2c10: e5930048 ldr r0, [r3, #72] ; 0x48
break;
2c14: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_PIPE_BUF:
return_value = the_limits->pipe_buf;
2c18: e593004c ldr r0, [r3, #76] ; 0x4c
break;
2c1c: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_CHOWN_RESTRICTED:
return_value = the_limits->posix_chown_restrictions;
2c20: e5930054 ldr r0, [r3, #84] ; 0x54
break;
2c24: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_NO_TRUNC:
return_value = the_limits->posix_no_trunc;
2c28: e5930058 ldr r0, [r3, #88] ; 0x58
break;
2c2c: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_VDISABLE:
return_value = the_limits->posix_vdisable;
2c30: e5930064 ldr r0, [r3, #100] ; 0x64
break;
2c34: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_ASYNC_IO:
return_value = the_limits->posix_async_io;
2c38: e5930050 ldr r0, [r3, #80] ; 0x50
break;
2c3c: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_PRIO_IO:
return_value = the_limits->posix_prio_io;
2c40: e593005c ldr r0, [r3, #92] ; 0x5c
break;
2c44: e49df004 pop {pc} ; (ldr pc, [sp], #4)
rtems_libio_t *iop;
rtems_filesystem_limits_and_options_t *the_limits;
rtems_libio_check_fd(fd);
iop = rtems_libio_iop(fd);
rtems_libio_check_is_open(iop);
2c48: eb002c0d bl dc84 <__errno>
2c4c: e3a03009 mov r3, #9
2c50: e5803000 str r3, [r0]
2c54: e3e00000 mvn r0, #0
2c58: e49df004 pop {pc} ; (ldr pc, [sp], #4)
rtems_libio_check_permissions(iop, LIBIO_FLAGS_READ);
2c5c: eb002c08 bl dc84 <__errno> <== NOT EXECUTED
2c60: e3a03016 mov r3, #22 <== NOT EXECUTED
2c64: e5803000 str r3, [r0] <== NOT EXECUTED
2c68: e3e00000 mvn r0, #0 <== NOT EXECUTED
2c6c: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
000032b0 <free_user_env>:
static void
free_user_env(void *venv)
{
rtems_user_env_t *env = (rtems_user_env_t*) venv ;
if (env != &rtems_global_user_env
32b0: e59f3028 ldr r3, [pc, #40] ; 32e0 <free_user_env+0x30> <== NOT EXECUTED
32b4: e1500003 cmp r0, r3 <== NOT EXECUTED
* NOTE: this must be called with
* thread dispatching disabled!
*/
static void
free_user_env(void *venv)
{
32b8: e92d4010 push {r4, lr} <== NOT EXECUTED
32bc: e1a04000 mov r4, r0 <== NOT EXECUTED
rtems_user_env_t *env = (rtems_user_env_t*) venv ;
if (env != &rtems_global_user_env
32c0: 08bd8010 popeq {r4, pc} <== NOT EXECUTED
#ifdef HAVE_USERENV_REFCNT
&& --env->refcnt <= 0
#endif
) {
rtems_filesystem_freenode( &env->current_directory);
32c4: e2800004 add r0, r0, #4 <== NOT EXECUTED
32c8: ebfffb9b bl 213c <rtems_filesystem_freenode> <== NOT EXECUTED
rtems_filesystem_freenode( &env->root_directory);
32cc: e2840018 add r0, r4, #24 <== NOT EXECUTED
32d0: ebfffb99 bl 213c <rtems_filesystem_freenode> <== NOT EXECUTED
free(env);
32d4: e1a00004 mov r0, r4 <== NOT EXECUTED
}
}
32d8: e8bd4010 pop {r4, lr} <== NOT EXECUTED
&& --env->refcnt <= 0
#endif
) {
rtems_filesystem_freenode( &env->current_directory);
rtems_filesystem_freenode( &env->root_directory);
free(env);
32dc: eafffb9b b 2150 <free> <== NOT EXECUTED
00002068 <gettimeofday>:
*/
int gettimeofday(
struct timeval *tp,
void * __tz __attribute__((unused))
)
{
2068: e92d4030 push {r4, r5, lr}
/* struct timezone* tzp = (struct timezone*) __tz; */
if ( !tp )
206c: e2504000 subs r4, r0, #0
*/
int gettimeofday(
struct timeval *tp,
void * __tz __attribute__((unused))
)
{
2070: e24dd008 sub sp, sp, #8
/* struct timezone* tzp = (struct timezone*) __tz; */
if ( !tp )
2074: 0a00000f beq 20b8 <gettimeofday+0x50>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
2078: e10f5000 mrs r5, CPSR
207c: e3853080 orr r3, r5, #128 ; 0x80
2080: e129f003 msr CPSR_fc, r3
ISR_Level level;
struct timespec now;
suseconds_t useconds;
_ISR_Disable(level);
_TOD_Get( &now );
2084: e1a0000d mov r0, sp
2088: eb0010d6 bl 63e8 <_TOD_Get>
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
208c: e129f005 msr CPSR_fc, r5
_ISR_Enable(level);
useconds = (suseconds_t)now.tv_nsec;
useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND;
2090: e59f2034 ldr r2, [pc, #52] ; 20cc <gettimeofday+0x64>
_ISR_Disable(level);
_TOD_Get( &now );
_ISR_Enable(level);
useconds = (suseconds_t)now.tv_nsec;
2094: e59d3004 ldr r3, [sp, #4]
useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND;
2098: e0c21293 smull r1, r2, r3, r2
209c: e1a03fc3 asr r3, r3, #31
20a0: e0633342 rsb r3, r3, r2, asr #6
time->tv_sec = now.tv_sec;
20a4: e59d2000 ldr r2, [sp]
time->tv_usec = useconds;
20a8: e884000c stm r4, {r2, r3}
* Timezone information ignored by the OS proper. Per email
* with Eric Norum, this is how GNU/Linux, Solaris, and MacOS X
* do it. This puts us in good company.
*/
return 0;
20ac: e3a00000 mov r0, #0
}
20b0: e28dd008 add sp, sp, #8
20b4: e8bd8030 pop {r4, r5, pc}
void * __tz __attribute__((unused))
)
{
/* struct timezone* tzp = (struct timezone*) __tz; */
if ( !tp )
rtems_set_errno_and_return_minus_one( EFAULT );
20b8: eb002ae3 bl cc4c <__errno> <== NOT EXECUTED
20bc: e3a0300e mov r3, #14 <== NOT EXECUTED
20c0: e5803000 str r3, [r0] <== NOT EXECUTED
20c4: e3e00000 mvn r0, #0 <== NOT EXECUTED
20c8: eafffff8 b 20b0 <gettimeofday+0x48> <== NOT EXECUTED
00003f24 <iproc>:
* Process a single input character
*/
static int
iproc (unsigned char c, struct rtems_termios_tty *tty)
{
if (tty->termios.c_iflag & ISTRIP)
3f24: e5913030 ldr r3, [r1, #48] ; 0x30
3f28: e3130020 tst r3, #32
/*
* Process a single input character
*/
static int
iproc (unsigned char c, struct rtems_termios_tty *tty)
{
3f2c: e92d4030 push {r4, r5, lr}
3f30: e20040ff and r4, r0, #255 ; 0xff
if (tty->termios.c_iflag & ISTRIP)
c &= 0x7f;
3f34: 1200407f andne r4, r0, #127 ; 0x7f
if (tty->termios.c_iflag & IUCLC)
3f38: e3130c02 tst r3, #512 ; 0x200
/*
* Process a single input character
*/
static int
iproc (unsigned char c, struct rtems_termios_tty *tty)
{
3f3c: e1a05001 mov r5, r1
if (tty->termios.c_iflag & ISTRIP)
c &= 0x7f;
if (tty->termios.c_iflag & IUCLC)
3f40: 0a000007 beq 3f64 <iproc+0x40>
c = tolower (c);
3f44: e59f21a0 ldr r2, [pc, #416] ; 40ec <iproc+0x1c8>
3f48: e5922000 ldr r2, [r2]
3f4c: e0822004 add r2, r2, r4
3f50: e5d22001 ldrb r2, [r2, #1]
3f54: e2022003 and r2, r2, #3
3f58: e3520001 cmp r2, #1
3f5c: 02844020 addeq r4, r4, #32
3f60: e20440ff and r4, r4, #255 ; 0xff
if (c == '\r') {
3f64: e354000d cmp r4, #13
3f68: 0a000014 beq 3fc0 <iproc+0x9c>
if (tty->termios.c_iflag & IGNCR)
return 0;
if (tty->termios.c_iflag & ICRNL)
c = '\n';
} else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) {
3f6c: e354000a cmp r4, #10
3f70: 0a000036 beq 4050 <iproc+0x12c>
c = '\r';
}
if ((c != '\0') && (tty->termios.c_lflag & ICANON)) {
3f74: e3540000 cmp r4, #0
3f78: 1a000016 bne 3fd8 <iproc+0xb4>
}
/*
* FIXME: Should do IMAXBEL handling somehow
*/
if (tty->ccount < (CBUFSIZE-1)) {
3f7c: e59f316c ldr r3, [pc, #364] ; 40f0 <iproc+0x1cc>
3f80: e5932008 ldr r2, [r3, #8]
3f84: e5953020 ldr r3, [r5, #32]
3f88: e2422001 sub r2, r2, #1
3f8c: e1530002 cmp r3, r2
3f90: aa000008 bge 3fb8 <iproc+0x94>
if (tty->termios.c_lflag & ECHO)
3f94: e595203c ldr r2, [r5, #60] ; 0x3c
3f98: e3120008 tst r2, #8
3f9c: 1a00002e bne 405c <iproc+0x138>
echo (c, tty);
tty->cbuf[tty->ccount++] = c;
3fa0: e595101c ldr r1, [r5, #28] <== NOT EXECUTED
3fa4: e2832001 add r2, r3, #1 <== NOT EXECUTED
3fa8: e7c14003 strb r4, [r1, r3] <== NOT EXECUTED
}
return 0;
3fac: e3a00000 mov r0, #0 <== NOT EXECUTED
* FIXME: Should do IMAXBEL handling somehow
*/
if (tty->ccount < (CBUFSIZE-1)) {
if (tty->termios.c_lflag & ECHO)
echo (c, tty);
tty->cbuf[tty->ccount++] = c;
3fb0: e5852020 str r2, [r5, #32] <== NOT EXECUTED
3fb4: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
}
return 0;
3fb8: e3a00000 mov r0, #0 <== NOT EXECUTED
}
3fbc: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
if (tty->termios.c_iflag & IUCLC)
c = tolower (c);
if (c == '\r') {
if (tty->termios.c_iflag & IGNCR)
3fc0: e3130080 tst r3, #128 ; 0x80
return 0;
3fc4: 13a00000 movne r0, #0
if (tty->termios.c_iflag & IUCLC)
c = tolower (c);
if (c == '\r') {
if (tty->termios.c_iflag & IGNCR)
3fc8: 18bd8030 popne {r4, r5, pc}
return 0;
if (tty->termios.c_iflag & ICRNL)
c = '\n';
3fcc: e3130c01 tst r3, #256 ; 0x100
3fd0: 03a0400d moveq r4, #13
3fd4: 13a0400a movne r4, #10
} else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) {
c = '\r';
}
if ((c != '\0') && (tty->termios.c_lflag & ICANON)) {
3fd8: e595303c ldr r3, [r5, #60] ; 0x3c
3fdc: e3130002 tst r3, #2
3fe0: 0affffe5 beq 3f7c <iproc+0x58>
if (c == tty->termios.c_cc[VERASE]) {
3fe4: e5d52043 ldrb r2, [r5, #67] ; 0x43
3fe8: e1520004 cmp r2, r4
3fec: 0a000039 beq 40d8 <iproc+0x1b4>
erase (tty, 0);
return 0;
}
else if (c == tty->termios.c_cc[VKILL]) {
3ff0: e5d52044 ldrb r2, [r5, #68] ; 0x44
3ff4: e1520004 cmp r2, r4
3ff8: 0a000025 beq 4094 <iproc+0x170>
erase (tty, 1);
return 0;
}
else if (c == tty->termios.c_cc[VEOF]) {
3ffc: e5d52045 ldrb r2, [r5, #69] ; 0x45
4000: e1520004 cmp r2, r4
return 1;
4004: 03a00001 moveq r0, #1
}
else if (c == tty->termios.c_cc[VKILL]) {
erase (tty, 1);
return 0;
}
else if (c == tty->termios.c_cc[VEOF]) {
4008: 08bd8030 popeq {r4, r5, pc}
return 1;
} else if (c == '\n') {
400c: e354000a cmp r4, #10
4010: 0a000024 beq 40a8 <iproc+0x184>
if (tty->termios.c_lflag & (ECHO | ECHONL))
echo (c, tty);
tty->cbuf[tty->ccount++] = c;
return 1;
} else if ((c == tty->termios.c_cc[VEOL]) ||
4014: e5d5204c ldrb r2, [r5, #76] ; 0x4c
4018: e1520004 cmp r2, r4
401c: 0a000002 beq 402c <iproc+0x108>
4020: e5d52051 ldrb r2, [r5, #81] ; 0x51
4024: e1520004 cmp r2, r4
4028: 1affffd3 bne 3f7c <iproc+0x58>
(c == tty->termios.c_cc[VEOL2])) {
if (tty->termios.c_lflag & ECHO)
402c: e3130008 tst r3, #8 <== NOT EXECUTED
4030: 1a000013 bne 4084 <iproc+0x160> <== NOT EXECUTED
echo (c, tty);
tty->cbuf[tty->ccount++] = c;
4034: e285101c add r1, r5, #28 <== NOT EXECUTED
4038: e891000a ldm r1, {r1, r3} <== NOT EXECUTED
403c: e2832001 add r2, r3, #1 <== NOT EXECUTED
4040: e7c14003 strb r4, [r1, r3] <== NOT EXECUTED
return 1;
4044: e3a00001 mov r0, #1 <== NOT EXECUTED
return 1;
} else if ((c == tty->termios.c_cc[VEOL]) ||
(c == tty->termios.c_cc[VEOL2])) {
if (tty->termios.c_lflag & ECHO)
echo (c, tty);
tty->cbuf[tty->ccount++] = c;
4048: e5852020 str r2, [r5, #32] <== NOT EXECUTED
return 1;
404c: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
if (tty->termios.c_iflag & IGNCR)
return 0;
if (tty->termios.c_iflag & ICRNL)
c = '\n';
} else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) {
c = '\r';
4050: e3130040 tst r3, #64 ; 0x40
4054: 13a0400d movne r4, #13
4058: eaffffde b 3fd8 <iproc+0xb4>
/*
* FIXME: Should do IMAXBEL handling somehow
*/
if (tty->ccount < (CBUFSIZE-1)) {
if (tty->termios.c_lflag & ECHO)
echo (c, tty);
405c: e1a00004 mov r0, r4
4060: e1a01005 mov r1, r5
4064: ebffff03 bl 3c78 <echo>
4068: e285101c add r1, r5, #28
406c: e891000a ldm r1, {r1, r3}
tty->cbuf[tty->ccount++] = c;
4070: e2832001 add r2, r3, #1
4074: e7c14003 strb r4, [r1, r3]
}
return 0;
4078: e3a00000 mov r0, #0
* FIXME: Should do IMAXBEL handling somehow
*/
if (tty->ccount < (CBUFSIZE-1)) {
if (tty->termios.c_lflag & ECHO)
echo (c, tty);
tty->cbuf[tty->ccount++] = c;
407c: e5852020 str r2, [r5, #32]
4080: e8bd8030 pop {r4, r5, pc}
tty->cbuf[tty->ccount++] = c;
return 1;
} else if ((c == tty->termios.c_cc[VEOL]) ||
(c == tty->termios.c_cc[VEOL2])) {
if (tty->termios.c_lflag & ECHO)
echo (c, tty);
4084: e1a00004 mov r0, r4 <== NOT EXECUTED
4088: e1a01005 mov r1, r5 <== NOT EXECUTED
408c: ebfffef9 bl 3c78 <echo> <== NOT EXECUTED
4090: eaffffe7 b 4034 <iproc+0x110> <== NOT EXECUTED
if (c == tty->termios.c_cc[VERASE]) {
erase (tty, 0);
return 0;
}
else if (c == tty->termios.c_cc[VKILL]) {
erase (tty, 1);
4094: e1a00005 mov r0, r5
4098: e3a01001 mov r1, #1
409c: ebffff1a bl 3d0c <erase>
return 0;
40a0: e3a00000 mov r0, #0
40a4: e8bd8030 pop {r4, r5, pc}
}
else if (c == tty->termios.c_cc[VEOF]) {
return 1;
} else if (c == '\n') {
if (tty->termios.c_lflag & (ECHO | ECHONL))
40a8: e3130048 tst r3, #72 ; 0x48
echo (c, tty);
40ac: 11a00004 movne r0, r4
40b0: 11a01005 movne r1, r5
40b4: 1bfffeef blne 3c78 <echo>
tty->cbuf[tty->ccount++] = c;
40b8: e285101c add r1, r5, #28
40bc: e891000a ldm r1, {r1, r3}
40c0: e3a0000a mov r0, #10
40c4: e2832001 add r2, r3, #1
40c8: e7c10003 strb r0, [r1, r3]
return 1;
40cc: e3a00001 mov r0, #1
else if (c == tty->termios.c_cc[VEOF]) {
return 1;
} else if (c == '\n') {
if (tty->termios.c_lflag & (ECHO | ECHONL))
echo (c, tty);
tty->cbuf[tty->ccount++] = c;
40d0: e5852020 str r2, [r5, #32]
return 1;
40d4: e8bd8030 pop {r4, r5, pc}
c = '\r';
}
if ((c != '\0') && (tty->termios.c_lflag & ICANON)) {
if (c == tty->termios.c_cc[VERASE]) {
erase (tty, 0);
40d8: e1a00005 mov r0, r5
40dc: e3a01000 mov r1, #0
40e0: ebffff09 bl 3d0c <erase>
return 0;
40e4: e3a00000 mov r0, #0
40e8: e8bd8030 pop {r4, r5, pc}
00020b68 <kill>:
#if !defined(RTEMS_POSIX_API)
int kill( pid_t pid, int sig )
{
return 0;
}
20b68: e3a00000 mov r0, #0 <== NOT EXECUTED
20b6c: e12fff1e bx lr <== NOT EXECUTED
0000232c <malloc>:
size_t size
)
{
void *return_this;
MSBUMP(malloc_calls, 1);
232c: e59f30d4 ldr r3, [pc, #212] ; 2408 <malloc+0xdc>
2330: e5932004 ldr r2, [r3, #4]
2334: e2822001 add r2, r2, #1
#include "malloc_p.h"
void *malloc(
size_t size
)
{
2338: e92d4030 push {r4, r5, lr}
233c: e1a04000 mov r4, r0
void *return_this;
MSBUMP(malloc_calls, 1);
2340: e5832004 str r2, [r3, #4]
/*
* If some free's have been deferred, then do them now.
*/
malloc_deferred_frees_process();
2344: ebffffb0 bl 220c <malloc_deferred_frees_process>
/*
* Validate the parameters
*/
if ( !size )
2348: e3540000 cmp r4, #0
return (void *) 0;
234c: 01a05004 moveq r5, r4
malloc_deferred_frees_process();
/*
* Validate the parameters
*/
if ( !size )
2350: 0a000018 beq 23b8 <malloc+0x8c>
return (void *) 0;
/*
* Do not attempt to allocate memory if not in correct system state.
*/
if ( _System_state_Is_up(_System_state_Get()) &&
2354: e59f30b0 ldr r3, [pc, #176] ; 240c <malloc+0xe0>
2358: e5933000 ldr r3, [r3]
235c: e3530003 cmp r3, #3
2360: 0a000024 beq 23f8 <malloc+0xcc>
RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate(
Heap_Control *heap,
uintptr_t size
)
{
return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 );
2364: e59f30a4 ldr r3, [pc, #164] ; 2410 <malloc+0xe4>
2368: e3a02000 mov r2, #0
236c: e5930000 ldr r0, [r3]
2370: e1a01004 mov r1, r4
2374: e1a03002 mov r3, r2
2378: eb001363 bl 710c <_Protected_heap_Allocate_aligned_with_boundary>
* If this fails then return a NULL pointer.
*/
return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size );
if ( !return_this ) {
237c: e2505000 subs r5, r0, #0
2380: 0a00000e beq 23c0 <malloc+0x94>
}
/*
* If the user wants us to dirty the allocated memory, then do it.
*/
if ( rtems_malloc_dirty_helper )
2384: e59f3088 ldr r3, [pc, #136] ; 2414 <malloc+0xe8>
2388: e5933000 ldr r3, [r3]
238c: e3530000 cmp r3, #0
(*rtems_malloc_dirty_helper)( return_this, size );
2390: 11a00005 movne r0, r5
2394: 11a01004 movne r1, r4
2398: 11a0e00f movne lr, pc
239c: 112fff13 bxne r3
/*
* If configured, update the statistics
*/
if ( rtems_malloc_statistics_helpers )
23a0: e59f3070 ldr r3, [pc, #112] ; 2418 <malloc+0xec>
23a4: e5933000 ldr r3, [r3]
23a8: e3530000 cmp r3, #0
(*rtems_malloc_statistics_helpers->at_malloc)(return_this);
23ac: 11a00005 movne r0, r5
23b0: 11a0e00f movne lr, pc
23b4: 1593f004 ldrne pc, [r3, #4]
return return_this;
}
23b8: e1a00005 mov r0, r5
23bc: e8bd8030 pop {r4, r5, pc}
*/
return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size );
if ( !return_this ) {
if (rtems_malloc_sbrk_helpers)
23c0: e59f3054 ldr r3, [pc, #84] ; 241c <malloc+0xf0>
23c4: e5933000 ldr r3, [r3]
23c8: e3530000 cmp r3, #0
23cc: 0a000005 beq 23e8 <malloc+0xbc>
return_this = (*rtems_malloc_sbrk_helpers->extend)( size );
23d0: e1a00004 mov r0, r4
23d4: e1a0e00f mov lr, pc
23d8: e593f004 ldr pc, [r3, #4]
if ( !return_this ) {
23dc: e3500000 cmp r0, #0
23e0: 11a05000 movne r5, r0
23e4: 1affffe6 bne 2384 <malloc+0x58>
errno = ENOMEM;
23e8: eb002a17 bl cc4c <__errno>
23ec: e3a0300c mov r3, #12
23f0: e5803000 str r3, [r0]
return (void *) 0;
23f4: eaffffef b 23b8 <malloc+0x8c>
/*
* Do not attempt to allocate memory if not in correct system state.
*/
if ( _System_state_Is_up(_System_state_Get()) &&
!malloc_is_system_state_OK() )
23f8: ebffff6f bl 21bc <malloc_is_system_state_OK>
return (void *) 0;
/*
* Do not attempt to allocate memory if not in correct system state.
*/
if ( _System_state_Is_up(_System_state_Get()) &&
23fc: e2505000 subs r5, r0, #0
2400: 1affffd7 bne 2364 <malloc+0x38>
2404: eaffffeb b 23b8 <malloc+0x8c> <== NOT EXECUTED
0000c000 <memfile_ftruncate>:
int memfile_ftruncate(
rtems_libio_t *iop,
rtems_off64_t length
)
{
c000: e92d4010 push {r4, lr}
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
c004: e5904018 ldr r4, [r0, #24]
int memfile_ftruncate(
rtems_libio_t *iop,
rtems_off64_t length
)
{
c008: e1a03000 mov r3, r0
* POSIX 1003.1b does not specify what happens if you truncate a file
* and the new length is greater than the current size. We treat this
* as an extend operation.
*/
if ( length > the_jnode->info.file.size )
c00c: e5940054 ldr r0, [r4, #84] ; 0x54
c010: e1500002 cmp r0, r2
int memfile_ftruncate(
rtems_libio_t *iop,
rtems_off64_t length
)
{
c014: e24dd008 sub sp, sp, #8
* POSIX 1003.1b does not specify what happens if you truncate a file
* and the new length is greater than the current size. We treat this
* as an extend operation.
*/
if ( length > the_jnode->info.file.size )
c018: ba00000e blt c058 <memfile_ftruncate+0x58>
c01c: 0a00000a beq c04c <memfile_ftruncate+0x4c>
* The in-memory files do not currently reclaim memory until the file is
* deleted. So we leave the previously allocated blocks in place for
* future use and just set the length.
*/
the_jnode->info.file.size = length;
c020: e5841050 str r1, [r4, #80] ; 0x50
c024: e5842054 str r2, [r4, #84] ; 0x54
iop->size = the_jnode->info.file.size;
IMFS_update_atime( the_jnode );
c028: e1a0000d mov r0, sp
* deleted. So we leave the previously allocated blocks in place for
* future use and just set the length.
*/
the_jnode->info.file.size = length;
iop->size = the_jnode->info.file.size;
c02c: e9830006 stmib r3, {r1, r2}
IMFS_update_atime( the_jnode );
c030: e3a01000 mov r1, #0
c034: ebffd80b bl 2068 <gettimeofday>
c038: e59d3000 ldr r3, [sp]
c03c: e5843040 str r3, [r4, #64] ; 0x40
return 0;
c040: e3a00000 mov r0, #0
}
c044: e28dd008 add sp, sp, #8
c048: e8bd8010 pop {r4, pc}
* POSIX 1003.1b does not specify what happens if you truncate a file
* and the new length is greater than the current size. We treat this
* as an extend operation.
*/
if ( length > the_jnode->info.file.size )
c04c: e5940050 ldr r0, [r4, #80] ; 0x50
c050: e1500001 cmp r0, r1
c054: 2afffff1 bcs c020 <memfile_ftruncate+0x20>
return IMFS_memfile_extend( the_jnode, length );
c058: e1a00004 mov r0, r4 <== NOT EXECUTED
c05c: ebfffeea bl bc0c <IMFS_memfile_extend> <== NOT EXECUTED
c060: eafffff7 b c044 <memfile_ftruncate+0x44> <== NOT EXECUTED
0000c064 <memfile_lseek>:
rtems_off64_t memfile_lseek(
rtems_libio_t *iop,
rtems_off64_t offset,
int whence
)
{
c064: e92d4030 push {r4, r5, lr}
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
c068: e5905018 ldr r5, [r0, #24]
if (the_jnode->type == IMFS_LINEAR_FILE) {
c06c: e595304c ldr r3, [r5, #76] ; 0x4c
c070: e3530006 cmp r3, #6
rtems_off64_t memfile_lseek(
rtems_libio_t *iop,
rtems_off64_t offset,
int whence
)
{
c074: e1a04000 mov r4, r0
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
if (the_jnode->type == IMFS_LINEAR_FILE) {
c078: 0a00000d beq c0b4 <memfile_lseek+0x50>
if (iop->offset > the_jnode->info.linearfile.size)
iop->offset = the_jnode->info.linearfile.size;
}
else { /* Must be a block file (IMFS_MEMORY_FILE). */
if (IMFS_memfile_extend( the_jnode, iop->offset ))
c07c: e1a00005 mov r0, r5
c080: e284200c add r2, r4, #12
c084: e8920006 ldm r2, {r1, r2}
c088: ebfffedf bl bc0c <IMFS_memfile_extend>
c08c: e3500000 cmp r0, #0
c090: 1a000018 bne c0f8 <memfile_lseek+0x94>
rtems_set_errno_and_return_minus_one( ENOSPC );
iop->size = the_jnode->info.file.size;
c094: e2853050 add r3, r5, #80 ; 0x50
c098: e893000c ldm r3, {r2, r3}
c09c: e984000c stmib r4, {r2, r3}
c0a0: e284300c add r3, r4, #12
c0a4: e893000c ldm r3, {r2, r3}
}
return iop->offset;
}
c0a8: e1a00002 mov r0, r2
c0ac: e1a01003 mov r1, r3
c0b0: e8bd8030 pop {r4, r5, pc}
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
if (the_jnode->type == IMFS_LINEAR_FILE) {
if (iop->offset > the_jnode->info.linearfile.size)
c0b4: e280300c add r3, r0, #12
c0b8: e893000c ldm r3, {r2, r3}
c0bc: e5951054 ldr r1, [r5, #84] ; 0x54
c0c0: e1530001 cmp r3, r1
c0c4: e5950050 ldr r0, [r5, #80] ; 0x50
c0c8: ca000002 bgt c0d8 <memfile_lseek+0x74>
c0cc: 1afffff5 bne c0a8 <memfile_lseek+0x44>
c0d0: e1520000 cmp r2, r0
c0d4: 9afffff3 bls c0a8 <memfile_lseek+0x44>
iop->offset = the_jnode->info.linearfile.size;
c0d8: e1a02000 mov r2, r0 <== NOT EXECUTED
c0dc: e1a03001 mov r3, r1 <== NOT EXECUTED
c0e0: e1a05000 mov r5, r0 <== NOT EXECUTED
c0e4: e584000c str r0, [r4, #12] <== NOT EXECUTED
c0e8: e5841010 str r1, [r4, #16] <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOSPC );
iop->size = the_jnode->info.file.size;
}
return iop->offset;
}
c0ec: e1a00002 mov r0, r2 <== NOT EXECUTED
c0f0: e1a01003 mov r1, r3 <== NOT EXECUTED
c0f4: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
if (iop->offset > the_jnode->info.linearfile.size)
iop->offset = the_jnode->info.linearfile.size;
}
else { /* Must be a block file (IMFS_MEMORY_FILE). */
if (IMFS_memfile_extend( the_jnode, iop->offset ))
rtems_set_errno_and_return_minus_one( ENOSPC );
c0f8: eb0002d3 bl cc4c <__errno> <== NOT EXECUTED
c0fc: e3a0301c mov r3, #28 <== NOT EXECUTED
c100: e5803000 str r3, [r0] <== NOT EXECUTED
c104: e3e02000 mvn r2, #0 <== NOT EXECUTED
c108: e3e03000 mvn r3, #0 <== NOT EXECUTED
c10c: eaffffe5 b c0a8 <memfile_lseek+0x44> <== NOT EXECUTED
0000bf50 <memfile_open>:
rtems_libio_t *iop,
const char *pathname,
uint32_t flag,
uint32_t mode
)
{
bf50: e92d40f0 push {r4, r5, r6, r7, lr}
bf54: e1a04000 mov r4, r0
the_jnode = iop->pathinfo.node_access;
/*
* Perform 'copy on write' for linear files
*/
if ((iop->flags & (LIBIO_FLAGS_WRITE | LIBIO_FLAGS_APPEND))
bf58: e5900014 ldr r0, [r0, #20]
bf5c: e3100f81 tst r0, #516 ; 0x204
rtems_libio_t *iop,
const char *pathname,
uint32_t flag,
uint32_t mode
)
{
bf60: e24dd004 sub sp, sp, #4
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
bf64: e5945018 ldr r5, [r4, #24]
/*
* Perform 'copy on write' for linear files
*/
if ((iop->flags & (LIBIO_FLAGS_WRITE | LIBIO_FLAGS_APPEND))
bf68: 0a000002 beq bf78 <memfile_open+0x28>
&& (the_jnode->type == IMFS_LINEAR_FILE)) {
bf6c: e595304c ldr r3, [r5, #76] ; 0x4c
bf70: e3530006 cmp r3, #6
bf74: 0a00000c beq bfac <memfile_open+0x5c>
the_jnode->info.file.triply_indirect = 0;
if ((count != 0)
&& (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1))
return -1;
}
if (iop->flags & LIBIO_FLAGS_APPEND)
bf78: e3100c02 tst r0, #512 ; 0x200
bf7c: 1a000005 bne bf98 <memfile_open+0x48>
bf80: e2853050 add r3, r5, #80 ; 0x50
bf84: e893000c ldm r3, {r2, r3}
iop->offset = the_jnode->info.file.size;
iop->size = the_jnode->info.file.size;
bf88: e984000c stmib r4, {r2, r3}
return 0;
bf8c: e3a00000 mov r0, #0
}
bf90: e28dd004 add sp, sp, #4
bf94: e8bd80f0 pop {r4, r5, r6, r7, pc}
if ((count != 0)
&& (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1))
return -1;
}
if (iop->flags & LIBIO_FLAGS_APPEND)
iop->offset = the_jnode->info.file.size;
bf98: e2853050 add r3, r5, #80 ; 0x50
bf9c: e893000c ldm r3, {r2, r3}
bfa0: e584200c str r2, [r4, #12]
bfa4: e5843010 str r3, [r4, #16]
bfa8: eafffff6 b bf88 <memfile_open+0x38>
/*
* 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;
bfac: e595c050 ldr ip, [r5, #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;
bfb0: e3a06000 mov r6, #0 <== NOT EXECUTED
&& (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;
the_jnode->info.file.size = 0;
bfb4: e3a01000 mov r1, #0 <== NOT EXECUTED
bfb8: e3a02000 mov r2, #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;
bfbc: e3a07005 mov r7, #5 <== NOT EXECUTED
the_jnode->info.file.size = 0;
the_jnode->info.file.indirect = 0;
the_jnode->info.file.doubly_indirect = 0;
the_jnode->info.file.triply_indirect = 0;
if ((count != 0)
bfc0: e15c0006 cmp ip, r6 <== 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;
bfc4: e5953058 ldr r3, [r5, #88] ; 0x58 <== NOT EXECUTED
the_jnode->type = IMFS_MEMORY_FILE;
bfc8: e585704c str r7, [r5, #76] ; 0x4c <== NOT EXECUTED
the_jnode->info.file.size = 0;
bfcc: e5851050 str r1, [r5, #80] ; 0x50 <== NOT EXECUTED
bfd0: e5852054 str r2, [r5, #84] ; 0x54 <== NOT EXECUTED
the_jnode->info.file.indirect = 0;
bfd4: e5856058 str r6, [r5, #88] ; 0x58 <== NOT EXECUTED
the_jnode->info.file.doubly_indirect = 0;
bfd8: e585605c str r6, [r5, #92] ; 0x5c <== NOT EXECUTED
the_jnode->info.file.triply_indirect = 0;
bfdc: e5856060 str r6, [r5, #96] ; 0x60 <== NOT EXECUTED
if ((count != 0)
bfe0: 0affffe4 beq bf78 <memfile_open+0x28> <== NOT EXECUTED
&& (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1))
bfe4: e1a00005 mov r0, r5 <== NOT EXECUTED
bfe8: e58dc000 str ip, [sp] <== NOT EXECUTED
bfec: ebffff53 bl bd40 <IMFS_memfile_write> <== NOT EXECUTED
bff0: e3700001 cmn r0, #1 <== NOT EXECUTED
bff4: 0affffe5 beq bf90 <memfile_open+0x40> <== NOT EXECUTED
bff8: e5940014 ldr r0, [r4, #20] <== NOT EXECUTED
bffc: eaffffdd b bf78 <memfile_open+0x28> <== NOT EXECUTED
00002430 <mknod>:
int mknod(
const char *pathname,
mode_t mode,
dev_t dev
)
{
2430: e92d41f0 push {r4, r5, r6, r7, r8, lr}
rtems_filesystem_location_info_t temp_loc;
int i;
const char *name_start;
int result;
if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) )
2434: e3110a0f tst r1, #61440 ; 0xf000
int mknod(
const char *pathname,
mode_t mode,
dev_t dev
)
{
2438: e24dd020 sub sp, sp, #32
243c: e1a04001 mov r4, r1
2440: e1a06000 mov r6, r0
2444: e1a07002 mov r7, r2
2448: e1a08003 mov r8, r3
rtems_filesystem_location_info_t temp_loc;
int i;
const char *name_start;
int result;
if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) )
244c: 1a000006 bne 246c <mknod+0x3c>
rtems_set_errno_and_return_minus_one( EINVAL );
2450: eb0029fd bl cc4c <__errno> <== NOT EXECUTED
2454: e3a03016 mov r3, #22 <== NOT EXECUTED
2458: e5803000 str r3, [r0] <== NOT EXECUTED
245c: e3e04000 mvn r4, #0 <== NOT EXECUTED
result = (*temp_loc.ops->mknod_h)( name_start, mode, dev, &temp_loc );
rtems_filesystem_freenode( &temp_loc );
return result;
}
2460: e1a00004 mov r0, r4
2464: e28dd020 add sp, sp, #32
2468: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
int result;
if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) )
rtems_set_errno_and_return_minus_one( EINVAL );
rtems_filesystem_get_start_loc( pathname, &i, &temp_loc );
246c: e28d5004 add r5, sp, #4
2470: e1a02005 mov r2, r5
2474: e28d101c add r1, sp, #28
2478: eb000264 bl 2e10 <rtems_filesystem_get_start_loc>
result = (*temp_loc.ops->evalformake_h)(
247c: e59d001c ldr r0, [sp, #28]
2480: e1a01005 mov r1, r5
2484: e0860000 add r0, r6, r0
2488: e28d2018 add r2, sp, #24
248c: e59d3010 ldr r3, [sp, #16]
2490: e1a0e00f mov lr, pc
2494: e593f004 ldr pc, [r3, #4]
&pathname[i],
&temp_loc,
&name_start
);
if ( result != 0 )
2498: e3500000 cmp r0, #0
return -1;
249c: 13e04000 mvnne r4, #0
result = (*temp_loc.ops->evalformake_h)(
&pathname[i],
&temp_loc,
&name_start
);
if ( result != 0 )
24a0: 1affffee bne 2460 <mknod+0x30>
return -1;
result = (*temp_loc.ops->mknod_h)( name_start, mode, dev, &temp_loc );
24a4: e1a01004 mov r1, r4
24a8: e1a02007 mov r2, r7
24ac: e1a03008 mov r3, r8
24b0: e58d5000 str r5, [sp]
24b4: e59d0018 ldr r0, [sp, #24]
24b8: e59dc010 ldr ip, [sp, #16]
24bc: e1a0e00f mov lr, pc
24c0: e59cf014 ldr pc, [ip, #20]
24c4: e1a04000 mov r4, r0
rtems_filesystem_freenode( &temp_loc );
24c8: e1a00005 mov r0, r5
24cc: ebfffeb7 bl 1fb0 <rtems_filesystem_freenode>
return result;
24d0: eaffffe2 b 2460 <mknod+0x30>
00002560 <mount>:
const char *target,
const char *filesystemtype,
rtems_filesystem_options_t options,
const void *data
)
{
2560: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
/*
* Are the file system options valid?
*/
if ( options != RTEMS_FILESYSTEM_READ_ONLY &&
2564: e3530001 cmp r3, #1
const char *target,
const char *filesystemtype,
rtems_filesystem_options_t options,
const void *data
)
{
2568: e24dd028 sub sp, sp, #40 ; 0x28
256c: e58d3004 str r3, [sp, #4]
2570: e1a08000 mov r8, r0
2574: e1a06001 mov r6, r1
2578: e1a0a002 mov sl, r2
/*
* Are the file system options valid?
*/
if ( options != RTEMS_FILESYSTEM_READ_ONLY &&
257c: 8a000092 bhi 27cc <mount+0x26c>
rtems_set_errno_and_return_minus_one( EINVAL );
/*
* Get mount handler
*/
mount_h = rtems_filesystem_get_mount_handler( filesystemtype );
2580: e1a00002 mov r0, r2
2584: eb001f7d bl a380 <rtems_filesystem_get_mount_handler>
if ( !mount_h )
2588: e3500000 cmp r0, #0
258c: e58d000c str r0, [sp, #12]
2590: 0a00008d beq 27cc <mount+0x26c>
{
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;
2594: e2565000 subs r5, r6, #0
2598: 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 : "/";
259c: e3550000 cmp r5, #0
25a0: 0a000084 beq 27b8 <mount+0x258>
* 4) The mount point exists with the proper permissions to allow mounting
* 5) The selected mount point already has a file system mounted to it
*
*/
int mount(
25a4: e1a00006 mov r0, r6
25a8: eb002d97 bl dc0c <strlen>
25ac: e58d6010 str r6, [sp, #16]
25b0: e58d0008 str r0, [sp, #8]
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;
25b4: e1a0000a mov r0, sl
25b8: eb002d93 bl dc0c <strlen>
size_t source_size = source_or_null != NULL ?
strlen( source_or_null ) + 1 : 0;
25bc: e3580000 cmp r8, #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;
25c0: e280b001 add fp, r0, #1
size_t source_size = source_or_null != NULL ?
strlen( source_or_null ) + 1 : 0;
25c4: 01a09008 moveq r9, r8
25c8: 0a000002 beq 25d8 <mount+0x78>
25cc: e1a00008 mov r0, r8
25d0: eb002d8d bl dc0c <strlen>
25d4: e2809001 add r9, r0, #1
size_t target_length = strlen( target );
size_t size = sizeof( rtems_filesystem_mount_table_entry_t )
+ filesystemtype_size + source_size + target_length + 1;
25d8: e59d3008 ldr r3, [sp, #8]
25dc: e2831075 add r1, r3, #117 ; 0x75
25e0: e081100b add r1, r1, fp
rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size );
25e4: e3a00001 mov r0, #1
25e8: e0811009 add r1, r1, r9
25ec: ebfffde8 bl 1d94 <calloc>
if ( mt_entry != NULL ) {
25f0: e2504000 subs r4, r0, #0
25f4: 0a00006a beq 27a4 <mount+0x244>
char *str = (char *) mt_entry + sizeof( *mt_entry );
25f8: e2847074 add r7, r4, #116 ; 0x74
strcpy( str, filesystemtype );
25fc: e1a00007 mov r0, r7
2600: e1a0100a mov r1, sl
2604: eb002d30 bl dacc <strcpy>
mt_entry->type = str;
str += filesystemtype_size;
if ( source_or_null != NULL ) {
2608: e3580000 cmp r8, #0
if ( mt_entry != NULL ) {
char *str = (char *) mt_entry + sizeof( *mt_entry );
strcpy( str, filesystemtype );
mt_entry->type = str;
260c: e584706c str r7, [r4, #108] ; 0x6c
str += filesystemtype_size;
2610: e087700b add r7, r7, fp
if ( source_or_null != NULL ) {
2614: 0a000004 beq 262c <mount+0xcc>
strcpy( str, source_or_null );
2618: e1a00007 mov r0, r7
261c: e1a01008 mov r1, r8
2620: eb002d29 bl dacc <strcpy>
mt_entry->dev = str;
2624: e5847070 str r7, [r4, #112] ; 0x70
str += source_size;
2628: e0877009 add r7, r7, r9
}
strcpy( str, target );
262c: e59d1010 ldr r1, [sp, #16]
2630: e1a00007 mov r0, r7
2634: eb002d24 bl dacc <strcpy>
if ( !mt_entry )
rtems_set_errno_and_return_minus_one( ENOMEM );
mt_entry->mt_fs_root.mt_entry = mt_entry;
mt_entry->options = options;
mt_entry->pathconf_limits_and_options = rtems_filesystem_default_pathconf;
2638: e59fe204 ldr lr, [pc, #516] ; 2844 <mount+0x2e4>
263c: e8be000f ldm lr!, {r0, r1, r2, r3}
2640: e284c038 add ip, r4, #56 ; 0x38
2644: e8ac000f stmia ip!, {r0, r1, r2, r3}
2648: e8be000f ldm lr!, {r0, r1, r2, r3}
264c: e8ac000f stmia ip!, {r0, r1, r2, r3}
2650: e89e000f ldm lr, {r0, r1, r2, r3}
);
if ( !mt_entry )
rtems_set_errno_and_return_minus_one( ENOMEM );
mt_entry->mt_fs_root.mt_entry = mt_entry;
mt_entry->options = options;
2654: e59de004 ldr lr, [sp, #4]
/*
* The mount_point should be a directory with read/write/execute
* permissions in the existing tree.
*/
if ( has_target ) {
2658: e3550000 cmp r5, #0
mt_entry->dev = str;
str += source_size;
}
strcpy( str, target );
mt_entry->target = str;
265c: e5847068 str r7, [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;
2660: e584402c str r4, [r4, #44] ; 0x2c
mt_entry->options = options;
2664: e584e030 str lr, [r4, #48] ; 0x30
mt_entry->pathconf_limits_and_options = rtems_filesystem_default_pathconf;
2668: 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 ) {
266c: 1a000024 bne 2704 <mount+0x1a4>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
2670: e59f31d0 ldr r3, [pc, #464] ; 2848 <mount+0x2e8>
}
} else {
/*
* Do we already have a base file system ?
*/
if ( !rtems_chain_is_empty( &mount_chain ) ) {
2674: e5932000 ldr r2, [r3]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
2678: e2833004 add r3, r3, #4
267c: e1520003 cmp r2, r3
)
{
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;
2680: 01a07005 moveq r7, r5
}
} else {
/*
* Do we already have a base file system ?
*/
if ( !rtems_chain_is_empty( &mount_chain ) ) {
2684: 1a000055 bne 27e0 <mount+0x280>
* 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 ) ) {
2688: e1a00004 mov r0, r4
268c: e59d104c ldr r1, [sp, #76] ; 0x4c
2690: e59d300c ldr r3, [sp, #12]
2694: e1a0e00f mov lr, pc
2698: e12fff13 bx r3
269c: e2506000 subs r6, r0, #0
26a0: 1a000055 bne 27fc <mount+0x29c>
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 );
26a4: e59f71a0 ldr r7, [pc, #416] ; 284c <mount+0x2ec>
26a8: e1a02006 mov r2, r6
26ac: e1a01006 mov r1, r6
26b0: e5970000 ldr r0, [r7]
26b4: eb000be5 bl 5650 <rtems_semaphore_obtain>
26b8: e59f0188 ldr r0, [pc, #392] ; 2848 <mount+0x2e8>
26bc: e1a01004 mov r1, r4
26c0: eb000e3e bl 5fc0 <_Chain_Append>
}
static inline void rtems_libio_unlock( void )
{
rtems_semaphore_release( rtems_libio_semaphore );
26c4: e5970000 ldr r0, [r7]
26c8: eb000c29 bl 5774 <rtems_semaphore_release>
*/
rtems_libio_lock();
rtems_chain_append( &mount_chain, &mt_entry->Node );
rtems_libio_unlock();
if ( !has_target )
26cc: e3550000 cmp r5, #0
rtems_filesystem_root = mt_entry->mt_fs_root;
return 0;
26d0: 11a00006 movne r0, r6
*/
rtems_libio_lock();
rtems_chain_append( &mount_chain, &mt_entry->Node );
rtems_libio_unlock();
if ( !has_target )
26d4: 1a000008 bne 26fc <mount+0x19c>
rtems_filesystem_root = mt_entry->mt_fs_root;
26d8: e59f3170 ldr r3, [pc, #368] ; 2850 <mount+0x2f0>
26dc: e284401c add r4, r4, #28
26e0: e593c000 ldr ip, [r3]
26e4: e8b4000f ldm r4!, {r0, r1, r2, r3}
26e8: e28cc018 add ip, ip, #24
26ec: e8ac000f stmia ip!, {r0, r1, r2, r3}
26f0: e5943000 ldr r3, [r4]
26f4: e58c3000 str r3, [ip]
return 0;
26f8: e1a00005 mov r0, r5
if ( loc_to_free )
rtems_filesystem_freenode( loc_to_free );
return -1;
}
26fc: e28dd028 add sp, sp, #40 ; 0x28
2700: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* The mount_point should be a directory with read/write/execute
* permissions in the existing tree.
*/
if ( has_target ) {
if ( rtems_filesystem_evaluate_path(
2704: e28d7014 add r7, sp, #20
2708: e3a0c001 mov ip, #1
270c: e1a00006 mov r0, r6
2710: e59d1008 ldr r1, [sp, #8]
2714: e3a02007 mov r2, #7
2718: e1a03007 mov r3, r7
271c: e58dc000 str ip, [sp]
2720: ebfffdd7 bl 1e84 <rtems_filesystem_evaluate_path>
2724: e3700001 cmn r0, #1
2728: 0a00002f beq 27ec <mount+0x28c>
/*
* Test to see if it is a directory
*/
if ( loc.ops->node_type_h( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {
272c: e1a00007 mov r0, r7
2730: e59d3020 ldr r3, [sp, #32]
2734: e1a0e00f mov lr, pc
2738: e593f010 ldr pc, [r3, #16]
273c: e3500001 cmp r0, #1
2740: 1a000037 bne 2824 <mount+0x2c4>
/*
* You can only mount one file system onto a single mount point.
*/
if ( rtems_filesystem_mount_iterate( is_node_fs_root, loc.node_access ) ) {
2744: e59f0108 ldr r0, [pc, #264] ; 2854 <mount+0x2f4>
2748: e59d1014 ldr r1, [sp, #20]
274c: ebffff65 bl 24e8 <rtems_filesystem_mount_iterate>
2750: e3500000 cmp r0, #0
2754: 1a000036 bne 2834 <mount+0x2d4>
* 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;
2758: e59d2014 ldr r2, [sp, #20]
275c: e5842008 str r2, [r4, #8]
mt_entry->mt_point_node.handlers = loc.handlers;
2760: e28d201c add r2, sp, #28
2764: e892000c ldm r2, {r2, r3}
2768: e5842010 str r2, [r4, #16]
mt_entry->mt_point_node.ops = loc.ops;
mt_entry->mt_point_node.mt_entry = loc.mt_entry;
276c: e59d2024 ldr r2, [sp, #36] ; 0x24
* 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;
2770: e5843014 str r3, [r4, #20]
mt_entry->mt_point_node.mt_entry = loc.mt_entry;
2774: e5842018 str r2, [r4, #24]
/*
* 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 ) ) {
2778: e1a00004 mov r0, r4
277c: e1a0e00f mov lr, pc
2780: e593f020 ldr pc, [r3, #32]
2784: e3500000 cmp r0, #0
2788: 0affffbe beq 2688 <mount+0x128>
return 0;
cleanup_and_bail:
free( mt_entry );
278c: e1a00004 mov r0, r4
2790: ebfffe0b bl 1fc4 <free>
if ( loc_to_free )
rtems_filesystem_freenode( loc_to_free );
2794: e1a00007 mov r0, r7
2798: ebfffe04 bl 1fb0 <rtems_filesystem_freenode>
return -1;
279c: e3e00000 mvn r0, #0
27a0: eaffffd5 b 26fc <mount+0x19c>
target,
filesystemtype,
&target_length
);
if ( !mt_entry )
rtems_set_errno_and_return_minus_one( ENOMEM );
27a4: eb002928 bl cc4c <__errno> <== NOT EXECUTED
27a8: e3a0300c mov r3, #12 <== NOT EXECUTED
27ac: e5803000 str r3, [r0] <== NOT EXECUTED
27b0: e3e00000 mvn r0, #0 <== NOT EXECUTED
27b4: eaffffd0 b 26fc <mount+0x19c> <== NOT EXECUTED
const char *target_or_null,
const char *filesystemtype,
size_t *target_length_ptr
)
{
const char *target = target_or_null != NULL ? target_or_null : "/";
27b8: e59f3098 ldr r3, [pc, #152] ; 2858 <mount+0x2f8>
27bc: e3a0e001 mov lr, #1
27c0: e58d3010 str r3, [sp, #16]
27c4: e58de008 str lr, [sp, #8]
27c8: eaffff79 b 25b4 <mount+0x54>
/*
* Get mount handler
*/
mount_h = rtems_filesystem_get_mount_handler( filesystemtype );
if ( !mount_h )
rtems_set_errno_and_return_minus_one( EINVAL );
27cc: eb00291e bl cc4c <__errno>
27d0: e3a03016 mov r3, #22
27d4: e5803000 str r3, [r0]
27d8: e3e00000 mvn r0, #0
27dc: eaffffc6 b 26fc <mount+0x19c>
} else {
/*
* Do we already have a base file system ?
*/
if ( !rtems_chain_is_empty( &mount_chain ) ) {
errno = EINVAL;
27e0: eb002919 bl cc4c <__errno> <== NOT EXECUTED
27e4: e3a03016 mov r3, #22 <== NOT EXECUTED
27e8: e5803000 str r3, [r0] <== NOT EXECUTED
return 0;
cleanup_and_bail:
free( mt_entry );
27ec: e1a00004 mov r0, r4 <== NOT EXECUTED
27f0: ebfffdf3 bl 1fc4 <free> <== NOT EXECUTED
if ( loc_to_free )
rtems_filesystem_freenode( loc_to_free );
return -1;
27f4: e3e00000 mvn r0, #0 <== NOT EXECUTED
27f8: eaffffbf b 26fc <mount+0x19c> <== NOT EXECUTED
if ( (*mount_h)( mt_entry, data ) ) {
/*
* Try to undo the mount operation
*/
loc.ops->unmount_h( mt_entry );
27fc: e59d3020 ldr r3, [sp, #32] <== NOT EXECUTED
2800: e1a00004 mov r0, r4 <== NOT EXECUTED
2804: e1a0e00f mov lr, pc <== NOT EXECUTED
2808: e593f028 ldr pc, [r3, #40] ; 0x28 <== NOT EXECUTED
return 0;
cleanup_and_bail:
free( mt_entry );
280c: e1a00004 mov r0, r4 <== NOT EXECUTED
2810: ebfffdeb bl 1fc4 <free> <== NOT EXECUTED
if ( loc_to_free )
2814: e3570000 cmp r7, #0 <== NOT EXECUTED
rtems_filesystem_freenode( loc_to_free );
return -1;
2818: 03e00000 mvneq r0, #0 <== NOT EXECUTED
cleanup_and_bail:
free( mt_entry );
if ( loc_to_free )
281c: 0affffb6 beq 26fc <mount+0x19c> <== NOT EXECUTED
2820: eaffffdb b 2794 <mount+0x234> <== NOT EXECUTED
/*
* Test to see if it is a directory
*/
if ( loc.ops->node_type_h( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {
errno = ENOTDIR;
2824: eb002908 bl cc4c <__errno>
2828: e3a03014 mov r3, #20
282c: e5803000 str r3, [r0]
goto cleanup_and_bail;
2830: eaffffd5 b 278c <mount+0x22c>
/*
* You can only mount one file system onto a single mount point.
*/
if ( rtems_filesystem_mount_iterate( is_node_fs_root, loc.node_access ) ) {
errno = EBUSY;
2834: eb002904 bl cc4c <__errno>
2838: e3a03010 mov r3, #16
283c: e5803000 str r3, [r0]
goto cleanup_and_bail;
2840: eaffffd1 b 278c <mount+0x22c>
00002860 <newlib_free_buffers>:
*/
int newlib_free_buffers(
FILE *fp
)
{
2860: e92d4010 push {r4, lr}
2864: e1a04000 mov r4, r0
switch ( fileno(fp) ) {
2868: eb0029fa bl d058 <fileno>
286c: e3500002 cmp r0, #2
2870: 9a000003 bls 2884 <newlib_free_buffers+0x24>
fp->_flags &= ~__SMBF;
fp->_bf._base = fp->_p = (unsigned char *) NULL;
}
break;
default:
fclose(fp);
2874: e1a00004 mov r0, r4 <== NOT EXECUTED
2878: eb002941 bl cd84 <fclose> <== NOT EXECUTED
}
return 0;
}
287c: e3a00000 mov r0, #0
2880: e8bd8010 pop {r4, pc}
{
switch ( fileno(fp) ) {
case 0:
case 1:
case 2:
if (fp->_flags & __SMBF) {
2884: e1d430bc ldrh r3, [r4, #12]
2888: e3130080 tst r3, #128 ; 0x80
288c: 0afffffa beq 287c <newlib_free_buffers+0x1c>
free( fp->_bf._base );
2890: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
2894: ebfffdca bl 1fc4 <free> <== NOT EXECUTED
fp->_flags &= ~__SMBF;
2898: e1d420bc ldrh r2, [r4, #12] <== NOT EXECUTED
fp->_bf._base = fp->_p = (unsigned char *) NULL;
289c: e3a03000 mov r3, #0 <== NOT EXECUTED
case 0:
case 1:
case 2:
if (fp->_flags & __SMBF) {
free( fp->_bf._base );
fp->_flags &= ~__SMBF;
28a0: e3c22080 bic r2, r2, #128 ; 0x80 <== NOT EXECUTED
28a4: e1c420bc strh r2, [r4, #12] <== NOT EXECUTED
fp->_bf._base = fp->_p = (unsigned char *) NULL;
28a8: e5843000 str r3, [r4] <== NOT EXECUTED
28ac: e5843010 str r3, [r4, #16] <== NOT EXECUTED
break;
default:
fclose(fp);
}
return 0;
}
28b0: e3a00000 mov r0, #0 <== NOT EXECUTED
28b4: e8bd8010 pop {r4, pc} <== NOT EXECUTED
00002504 <null_initialize>:
rtems_device_driver null_initialize(
rtems_device_major_number major,
rtems_device_minor_number minor __attribute__((unused)),
void *pargp __attribute__((unused))
)
{
2504: e92d4010 push {r4, lr}
rtems_device_driver status;
if ( !initialized ) {
2508: e59f3044 ldr r3, [pc, #68] ; 2554 <null_initialize+0x50>
250c: e5d32000 ldrb r2, [r3]
2510: e3520000 cmp r2, #0
rtems_device_driver null_initialize(
rtems_device_major_number major,
rtems_device_minor_number minor __attribute__((unused)),
void *pargp __attribute__((unused))
)
{
2514: e1a04000 mov r4, r0
rtems_device_driver status;
if ( !initialized ) {
2518: 0a000001 beq 2524 <null_initialize+0x20>
NULL_major = major;
}
return RTEMS_SUCCESSFUL;
}
251c: e3a00000 mov r0, #0
2520: e8bd8010 pop {r4, pc}
)
{
rtems_device_driver status;
if ( !initialized ) {
initialized = 1;
2524: e3a0c001 mov ip, #1
status = rtems_io_register_name(
2528: e59f0028 ldr r0, [pc, #40] ; 2558 <null_initialize+0x54>
252c: e1a01004 mov r1, r4
)
{
rtems_device_driver status;
if ( !initialized ) {
initialized = 1;
2530: e5c3c000 strb ip, [r3]
status = rtems_io_register_name(
2534: eb000189 bl 2b60 <rtems_io_register_name>
"/dev/null",
major,
(rtems_device_minor_number) 0
);
if (status != RTEMS_SUCCESSFUL)
2538: e3500000 cmp r0, #0
253c: 1a000003 bne 2550 <null_initialize+0x4c>
rtems_fatal_error_occurred(status);
NULL_major = major;
2540: e59f3014 ldr r3, [pc, #20] ; 255c <null_initialize+0x58>
}
return RTEMS_SUCCESSFUL;
}
2544: e3a00000 mov r0, #0
);
if (status != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred(status);
NULL_major = major;
2548: e5834000 str r4, [r3]
}
return RTEMS_SUCCESSFUL;
}
254c: e8bd8010 pop {r4, pc}
major,
(rtems_device_minor_number) 0
);
if (status != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred(status);
2550: eb001271 bl 6f1c <rtems_fatal_error_occurred> <== NOT EXECUTED
00003b08 <oproc>:
/*
* Handle output processing
*/
static void
oproc (unsigned char c, struct rtems_termios_tty *tty)
{
3b08: e92d4010 push {r4, lr}
int i;
if (tty->termios.c_oflag & OPOST) {
3b0c: e5913034 ldr r3, [r1, #52] ; 0x34
/*
* Handle output processing
*/
static void
oproc (unsigned char c, struct rtems_termios_tty *tty)
{
3b10: e24dd004 sub sp, sp, #4
int i;
if (tty->termios.c_oflag & OPOST) {
3b14: e3130001 tst r3, #1
/*
* Handle output processing
*/
static void
oproc (unsigned char c, struct rtems_termios_tty *tty)
{
3b18: e1a04001 mov r4, r1
3b1c: e5cd0000 strb r0, [sp]
int i;
if (tty->termios.c_oflag & OPOST) {
3b20: 0a000014 beq 3b78 <oproc+0x70>
switch (c) {
3b24: e5dd1000 ldrb r1, [sp]
3b28: e2412008 sub r2, r1, #8
3b2c: e3520005 cmp r2, #5
3b30: 979ff102 ldrls pc, [pc, r2, lsl #2]
3b34: ea000005 b 3b50 <oproc+0x48>
3b38: 00003c00 .word 0x00003c00 <== NOT EXECUTED
3b3c: 00003bc8 .word 0x00003bc8 <== NOT EXECUTED
3b40: 00003c14 .word 0x00003c14 <== NOT EXECUTED
3b44: 00003b50 .word 0x00003b50 <== NOT EXECUTED
3b48: 00003b50 .word 0x00003b50 <== NOT EXECUTED
3b4c: 00003b90 .word 0x00003b90 <== NOT EXECUTED
if (tty->column > 0)
tty->column--;
break;
default:
if (tty->termios.c_oflag & OLCUC)
3b50: e3130002 tst r3, #2
3b54: 1a00003a bne 3c44 <oproc+0x13c>
3b58: e59f310c ldr r3, [pc, #268] ; 3c6c <oproc+0x164>
3b5c: e5933000 ldr r3, [r3]
c = toupper(c);
if (!iscntrl(c))
3b60: e0831001 add r1, r3, r1
3b64: e5d13001 ldrb r3, [r1, #1]
3b68: e3130020 tst r3, #32
tty->column++;
3b6c: 05943028 ldreq r3, [r4, #40] ; 0x28
3b70: 02833001 addeq r3, r3, #1
3b74: 05843028 streq r3, [r4, #40] ; 0x28
break;
}
}
rtems_termios_puts (&c, 1, tty);
3b78: e1a0000d mov r0, sp
3b7c: e3a01001 mov r1, #1
3b80: e1a02004 mov r2, r4
3b84: ebffff99 bl 39f0 <rtems_termios_puts>
}
3b88: e28dd004 add sp, sp, #4
3b8c: e8bd8010 pop {r4, pc}
tty->column = 0;
}
break;
case '\r':
if ((tty->termios.c_oflag & ONOCR) && (tty->column == 0))
3b90: e3130010 tst r3, #16 <== NOT EXECUTED
3b94: 0a000002 beq 3ba4 <oproc+0x9c> <== NOT EXECUTED
3b98: e5942028 ldr r2, [r4, #40] ; 0x28 <== NOT EXECUTED
3b9c: e3520000 cmp r2, #0 <== NOT EXECUTED
3ba0: 0afffff8 beq 3b88 <oproc+0x80> <== NOT EXECUTED
return;
if (tty->termios.c_oflag & OCRNL) {
3ba4: e2132008 ands r2, r3, #8 <== NOT EXECUTED
c = '\n';
if (tty->termios.c_oflag & ONLRET)
tty->column = 0;
break;
}
tty->column = 0;
3ba8: 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) {
3bac: 0afffff1 beq 3b78 <oproc+0x70> <== NOT EXECUTED
c = '\n';
if (tty->termios.c_oflag & ONLRET)
3bb0: 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';
3bb4: e3a0300a mov r3, #10 <== NOT EXECUTED
3bb8: e5cd3000 strb r3, [sp] <== NOT EXECUTED
if (tty->termios.c_oflag & ONLRET)
tty->column = 0;
3bbc: 13a03000 movne r3, #0 <== NOT EXECUTED
3bc0: 15843028 strne r3, [r4, #40] ; 0x28 <== NOT EXECUTED
3bc4: eaffffeb b 3b78 <oproc+0x70> <== NOT EXECUTED
}
tty->column = 0;
break;
case '\t':
i = 8 - (tty->column & 7);
3bc8: e5942028 ldr r2, [r4, #40] ; 0x28
if ((tty->termios.c_oflag & TABDLY) == XTABS) {
3bcc: e2033b06 and r3, r3, #6144 ; 0x1800
}
tty->column = 0;
break;
case '\t':
i = 8 - (tty->column & 7);
3bd0: e2021007 and r1, r2, #7
if ((tty->termios.c_oflag & TABDLY) == XTABS) {
3bd4: e3530b06 cmp r3, #6144 ; 0x1800
}
tty->column = 0;
break;
case '\t':
i = 8 - (tty->column & 7);
3bd8: e2611008 rsb r1, r1, #8
if ((tty->termios.c_oflag & TABDLY) == XTABS) {
tty->column += i;
rtems_termios_puts ( " ", i, tty);
return;
}
tty->column += i;
3bdc: 10811002 addne r1, r1, r2
3be0: 15841028 strne r1, [r4, #40] ; 0x28
tty->column = 0;
break;
case '\t':
i = 8 - (tty->column & 7);
if ((tty->termios.c_oflag & TABDLY) == XTABS) {
3be4: 1affffe3 bne 3b78 <oproc+0x70>
tty->column += i;
3be8: e0812002 add r2, r1, r2
3bec: e5842028 str r2, [r4, #40] ; 0x28
rtems_termios_puts ( " ", i, tty);
3bf0: e59f0078 ldr r0, [pc, #120] ; 3c70 <oproc+0x168>
3bf4: e1a02004 mov r2, r4
3bf8: ebffff7c bl 39f0 <rtems_termios_puts>
return;
3bfc: eaffffe1 b 3b88 <oproc+0x80>
}
tty->column += i;
break;
case '\b':
if (tty->column > 0)
3c00: e5943028 ldr r3, [r4, #40] ; 0x28 <== NOT EXECUTED
3c04: e3530000 cmp r3, #0 <== NOT EXECUTED
tty->column--;
3c08: c2433001 subgt r3, r3, #1 <== NOT EXECUTED
3c0c: c5843028 strgt r3, [r4, #40] ; 0x28 <== NOT EXECUTED
3c10: eaffffd8 b 3b78 <oproc+0x70> <== NOT EXECUTED
int i;
if (tty->termios.c_oflag & OPOST) {
switch (c) {
case '\n':
if (tty->termios.c_oflag & ONLRET)
3c14: e3130020 tst r3, #32
tty->column = 0;
3c18: 13a02000 movne r2, #0
3c1c: 15842028 strne r2, [r4, #40] ; 0x28
if (tty->termios.c_oflag & ONLCR) {
3c20: e3130004 tst r3, #4
3c24: 0affffd3 beq 3b78 <oproc+0x70>
rtems_termios_puts ("\r", 1, tty);
3c28: e59f0044 ldr r0, [pc, #68] ; 3c74 <oproc+0x16c>
3c2c: e3a01001 mov r1, #1
3c30: e1a02004 mov r2, r4
3c34: ebffff6d bl 39f0 <rtems_termios_puts>
tty->column = 0;
3c38: e3a03000 mov r3, #0
3c3c: e5843028 str r3, [r4, #40] ; 0x28
3c40: eaffffcc b 3b78 <oproc+0x70>
tty->column--;
break;
default:
if (tty->termios.c_oflag & OLCUC)
c = toupper(c);
3c44: e59f3020 ldr r3, [pc, #32] ; 3c6c <oproc+0x164> <== NOT EXECUTED
3c48: e5933000 ldr r3, [r3] <== NOT EXECUTED
3c4c: e0832001 add r2, r3, r1 <== NOT EXECUTED
3c50: e5d22001 ldrb r2, [r2, #1] <== NOT EXECUTED
3c54: e2022003 and r2, r2, #3 <== NOT EXECUTED
3c58: e3520002 cmp r2, #2 <== NOT EXECUTED
3c5c: 02411020 subeq r1, r1, #32 <== NOT EXECUTED
3c60: e20110ff and r1, r1, #255 ; 0xff <== NOT EXECUTED
3c64: e5cd1000 strb r1, [sp] <== NOT EXECUTED
3c68: eaffffbc b 3b60 <oproc+0x58> <== NOT EXECUTED
0000c04c <pipe_ioctl>:
uint32_t cmd,
void *buffer,
rtems_libio_t *iop
)
{
if (cmd == FIONREAD) {
c04c: e3a03a46 mov r3, #286720 ; 0x46000
c050: e2833e67 add r3, r3, #1648 ; 0x670
c054: e283313d add r3, r3, #1073741839 ; 0x4000000f
c058: e1510003 cmp r1, r3
pipe_control_t *pipe,
uint32_t cmd,
void *buffer,
rtems_libio_t *iop
)
{
c05c: e92d4070 push {r4, r5, r6, lr}
c060: e1a05000 mov r5, r0
c064: e1a04002 mov r4, r2
*(unsigned int *)buffer = pipe->Length;
PIPE_UNLOCK(pipe);
return 0;
}
return -EINVAL;
c068: 13e00015 mvnne r0, #21
uint32_t cmd,
void *buffer,
rtems_libio_t *iop
)
{
if (cmd == FIONREAD) {
c06c: 18bd8070 popne {r4, r5, r6, pc}
if (buffer == NULL)
c070: e3520000 cmp r2, #0
return -EFAULT;
c074: 03e0000d mvneq r0, #13
void *buffer,
rtems_libio_t *iop
)
{
if (cmd == FIONREAD) {
if (buffer == NULL)
c078: 08bd8070 popeq {r4, r5, r6, pc}
return -EFAULT;
if (! PIPE_LOCK(pipe))
c07c: e3a01000 mov r1, #0
c080: e5950028 ldr r0, [r5, #40] ; 0x28
c084: e1a02001 mov r2, r1
c088: ebffeb75 bl 6e64 <rtems_semaphore_obtain>
c08c: e2506000 subs r6, r0, #0
c090: 0a000001 beq c09c <pipe_ioctl+0x50>
return -EINTR;
c094: e3e00003 mvn r0, #3 <== NOT EXECUTED
PIPE_UNLOCK(pipe);
return 0;
}
return -EINVAL;
}
c098: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
if (! PIPE_LOCK(pipe))
return -EINTR;
/* Return length of pipe */
*(unsigned int *)buffer = pipe->Length;
c09c: e595300c ldr r3, [r5, #12]
PIPE_UNLOCK(pipe);
c0a0: e5950028 ldr r0, [r5, #40] ; 0x28
if (! PIPE_LOCK(pipe))
return -EINTR;
/* Return length of pipe */
*(unsigned int *)buffer = pipe->Length;
c0a4: e5843000 str r3, [r4]
PIPE_UNLOCK(pipe);
c0a8: ebffebb6 bl 6f88 <rtems_semaphore_release>
return 0;
c0ac: e1a00006 mov r0, r6
c0b0: e8bd8070 pop {r4, r5, r6, pc}
0000b6fc <pipe_lock>:
free(pipe->Buffer);
free(pipe);
}
static rtems_status_code pipe_lock(void)
{
b6fc: e92d4070 push {r4, r5, r6, lr}
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (pipe_semaphore == RTEMS_ID_NONE) {
b700: e59f4094 ldr r4, [pc, #148] ; b79c <pipe_lock+0xa0>
b704: e5946000 ldr r6, [r4]
b708: e3560000 cmp r6, #0
free(pipe->Buffer);
free(pipe);
}
static rtems_status_code pipe_lock(void)
{
b70c: e24dd004 sub sp, sp, #4
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (pipe_semaphore == RTEMS_ID_NONE) {
b710: 0a000007 beq b734 <pipe_lock+0x38>
rtems_libio_unlock();
}
if (sc == RTEMS_SUCCESSFUL) {
sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
b714: e3a01000 mov r1, #0
b718: e1a00006 mov r0, r6
b71c: e1a02001 mov r2, r1
b720: ebffedcf bl 6e64 <rtems_semaphore_obtain>
}
if (sc == RTEMS_SUCCESSFUL) {
return 0;
} else {
return -ENOMEM;
b724: e3500000 cmp r0, #0
b728: 13e0000b mvnne r0, #11
}
}
b72c: e28dd004 add sp, sp, #4
b730: e8bd8070 pop {r4, r5, r6, pc}
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 );
b734: e59f5064 ldr r5, [pc, #100] ; b7a0 <pipe_lock+0xa4>
b738: e1a01006 mov r1, r6
b73c: e5950000 ldr r0, [r5]
b740: e1a02006 mov r2, r6
b744: ebffedc6 bl 6e64 <rtems_semaphore_obtain>
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (pipe_semaphore == RTEMS_ID_NONE) {
rtems_libio_lock();
if (pipe_semaphore == RTEMS_ID_NONE) {
b748: e5943000 ldr r3, [r4]
b74c: e3530000 cmp r3, #0
b750: 0a000003 beq b764 <pipe_lock+0x68>
}
static inline void rtems_libio_unlock( void )
{
rtems_semaphore_release( rtems_libio_semaphore );
b754: e5950000 ldr r0, [r5] <== NOT EXECUTED
b758: ebffee0a bl 6f88 <rtems_semaphore_release> <== NOT EXECUTED
b75c: e5946000 ldr r6, [r4] <== NOT EXECUTED
b760: eaffffeb b b714 <pipe_lock+0x18> <== NOT EXECUTED
sc = rtems_semaphore_create(
b764: e1a03006 mov r3, r6
b768: e3a01001 mov r1, #1
b76c: e3a02054 mov r2, #84 ; 0x54
b770: e59f002c ldr r0, [pc, #44] ; b7a4 <pipe_lock+0xa8>
b774: e58d4000 str r4, [sp]
b778: ebffed1f bl 6bfc <rtems_semaphore_create>
b77c: e1a06000 mov r6, r0
b780: e5950000 ldr r0, [r5]
b784: ebffedff bl 6f88 <rtems_semaphore_release>
}
rtems_libio_unlock();
}
if (sc == RTEMS_SUCCESSFUL) {
b788: e3560000 cmp r6, #0
}
if (sc == RTEMS_SUCCESSFUL) {
return 0;
} else {
return -ENOMEM;
b78c: 13e0000b mvnne r0, #11
}
rtems_libio_unlock();
}
if (sc == RTEMS_SUCCESSFUL) {
b790: 1affffe5 bne b72c <pipe_lock+0x30>
b794: e5946000 ldr r6, [r4]
b798: eaffffdd b b714 <pipe_lock+0x18>
0000bc98 <pipe_read>:
pipe_control_t *pipe,
void *buffer,
size_t count,
rtems_libio_t *iop
)
{
bc98: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
bc9c: e1a09001 mov r9, r1
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
bca0: e3a01000 mov r1, #0
pipe_control_t *pipe,
void *buffer,
size_t count,
rtems_libio_t *iop
)
{
bca4: e24dd008 sub sp, sp, #8
bca8: e1a04000 mov r4, r0
bcac: e1a05002 mov r5, r2
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
bcb0: e5900028 ldr r0, [r0, #40] ; 0x28
bcb4: e1a02001 mov r2, r1
pipe_control_t *pipe,
void *buffer,
size_t count,
rtems_libio_t *iop
)
{
bcb8: e1a08003 mov r8, r3
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
bcbc: ebffec68 bl 6e64 <rtems_semaphore_obtain>
bcc0: e250a000 subs sl, r0, #0
return -EINTR;
bcc4: 13e07003 mvnne r7, #3
rtems_libio_t *iop
)
{
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
bcc8: 1a000027 bne bd6c <pipe_read+0xd4>
return -EINTR;
while (read < count) {
bccc: e3550000 cmp r5, #0
bcd0: 01a07005 moveq r7, r5
bcd4: 01a06007 moveq r6, r7
bcd8: 0a00001f beq bd5c <pipe_read+0xc4>
bcdc: e1a0700a mov r7, sl
/* For buffering optimization */
if (PIPE_EMPTY(pipe))
pipe->Start = 0;
if (pipe->waitingWriters > 0)
PIPE_WAKEUPWRITERS(pipe);
bce0: e28db004 add fp, sp, #4
if (! PIPE_LOCK(pipe))
return -EINTR;
while (read < count) {
while (PIPE_EMPTY(pipe)) {
bce4: e594200c ldr r2, [r4, #12]
bce8: e3520000 cmp r2, #0
bcec: 1a000021 bne bd78 <pipe_read+0xe0>
/* Not an error */
if (pipe->Writers == 0)
bcf0: e5946014 ldr r6, [r4, #20]
bcf4: e3560000 cmp r6, #0
bcf8: 0a000017 beq bd5c <pipe_read+0xc4>
goto out_locked;
if (LIBIO_NODELAY(iop)) {
bcfc: e5986014 ldr r6, [r8, #20]
bd00: e2166001 ands r6, r6, #1
bd04: 1a00003b bne bdf8 <pipe_read+0x160>
ret = -EAGAIN;
goto out_locked;
}
/* Wait until pipe is no more empty or no writer exists */
pipe->waitingReaders ++;
bd08: e5943018 ldr r3, [r4, #24]
bd0c: e2833001 add r3, r3, #1
bd10: e5843018 str r3, [r4, #24]
PIPE_UNLOCK(pipe);
bd14: e5940028 ldr r0, [r4, #40] ; 0x28
bd18: ebffec9a bl 6f88 <rtems_semaphore_release>
if (! PIPE_READWAIT(pipe))
bd1c: e1a01006 mov r1, r6
bd20: e594002c ldr r0, [r4, #44] ; 0x2c
bd24: eb000465 bl cec0 <rtems_barrier_wait>
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
bd28: e1a01006 mov r1, r6
bd2c: e1a02001 mov r2, r1
}
/* Wait until pipe is no more empty or no writer exists */
pipe->waitingReaders ++;
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
bd30: e2506000 subs r6, r0, #0
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
bd34: e5940028 ldr r0, [r4, #40] ; 0x28
}
/* Wait until pipe is no more empty or no writer exists */
pipe->waitingReaders ++;
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
bd38: 13e06003 mvnne r6, #3
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
bd3c: ebffec48 bl 6e64 <rtems_semaphore_obtain>
bd40: e3500000 cmp r0, #0
bd44: 1a00002d bne be00 <pipe_read+0x168>
/* WARN waitingReaders not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingReaders --;
bd48: e5943018 ldr r3, [r4, #24]
if (ret != 0)
bd4c: e3560000 cmp r6, #0
if (! PIPE_LOCK(pipe)) {
/* WARN waitingReaders not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingReaders --;
bd50: e2433001 sub r3, r3, #1
bd54: e5843018 str r3, [r4, #24]
if (ret != 0)
bd58: 0affffe1 beq bce4 <pipe_read+0x4c>
PIPE_WAKEUPWRITERS(pipe);
read += chunk;
}
out_locked:
PIPE_UNLOCK(pipe);
bd5c: e5940028 ldr r0, [r4, #40] ; 0x28
bd60: ebffec88 bl 6f88 <rtems_semaphore_release>
out_nolock:
if (read > 0)
return read;
return ret;
bd64: e3570000 cmp r7, #0
bd68: d1a07006 movle r7, r6
}
bd6c: e1a00007 mov r0, r7
bd70: e28dd008 add sp, sp, #8
bd74: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
goto out_locked;
}
/* Read chunk bytes */
chunk = MIN(count - read, pipe->Length);
chunk1 = pipe->Size - pipe->Start;
bd78: e5941008 ldr r1, [r4, #8]
bd7c: e5943004 ldr r3, [r4, #4]
if (ret != 0)
goto out_locked;
}
/* Read chunk bytes */
chunk = MIN(count - read, pipe->Length);
bd80: e06a6005 rsb r6, sl, r5
bd84: e1520006 cmp r2, r6
bd88: 31a06002 movcc r6, r2
chunk1 = pipe->Size - pipe->Start;
bd8c: e0613003 rsb r3, r1, r3
if (chunk > chunk1) {
bd90: e1560003 cmp r6, r3
bd94: ca00001b bgt be08 <pipe_read+0x170>
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);
bd98: e5943000 ldr r3, [r4]
bd9c: e089000a add r0, r9, sl
bda0: e0831001 add r1, r3, r1
bda4: e1a02006 mov r2, r6
bda8: eb000bd3 bl ecfc <memcpy>
pipe->Start += chunk;
bdac: e5940008 ldr r0, [r4, #8]
pipe->Start %= pipe->Size;
bdb0: e5941004 ldr r1, [r4, #4]
bdb4: e0860000 add r0, r6, r0
bdb8: eb002f2f bl 17a7c <__umodsi3>
pipe->Length -= chunk;
bdbc: e594300c ldr r3, [r4, #12]
bdc0: e0663003 rsb r3, r6, r3
/* For buffering optimization */
if (PIPE_EMPTY(pipe))
bdc4: e3530000 cmp r3, #0
}
else
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk);
pipe->Start += chunk;
pipe->Start %= pipe->Size;
bdc8: e5840008 str r0, [r4, #8]
pipe->Length -= chunk;
bdcc: e584300c str r3, [r4, #12]
/* For buffering optimization */
if (PIPE_EMPTY(pipe))
pipe->Start = 0;
bdd0: 05843008 streq r3, [r4, #8]
if (pipe->waitingWriters > 0)
bdd4: e594301c ldr r3, [r4, #28]
bdd8: e3530000 cmp r3, #0
bddc: 1a000016 bne be3c <pipe_read+0x1a4>
PIPE_WAKEUPWRITERS(pipe);
read += chunk;
bde0: e0877006 add r7, r7, r6
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
return -EINTR;
while (read < count) {
bde4: e1570005 cmp r7, r5
bde8: e1a0a007 mov sl, r7
bdec: 3affffbc bcc bce4 <pipe_read+0x4c>
bdf0: e3a06000 mov r6, #0
bdf4: eaffffd8 b bd5c <pipe_read+0xc4>
/* Not an error */
if (pipe->Writers == 0)
goto out_locked;
if (LIBIO_NODELAY(iop)) {
ret = -EAGAIN;
bdf8: e3e0600a mvn r6, #10
bdfc: eaffffd6 b bd5c <pipe_read+0xc4>
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
/* WARN waitingReaders not restored! */
ret = -EINTR;
be00: e3e06003 mvn r6, #3 <== NOT EXECUTED
be04: eaffffd6 b bd64 <pipe_read+0xcc> <== NOT EXECUTED
/* Read chunk bytes */
chunk = MIN(count - read, pipe->Length);
chunk1 = pipe->Size - pipe->Start;
if (chunk > chunk1) {
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk1);
be08: e5940000 ldr r0, [r4]
be0c: e1a02003 mov r2, r3
be10: e0801001 add r1, r0, r1
be14: e089000a add r0, r9, sl
be18: e58d3000 str r3, [sp]
be1c: eb000bb6 bl ecfc <memcpy>
memcpy(buffer + read + chunk1, pipe->Buffer, chunk - chunk1);
be20: e59d3000 ldr r3, [sp]
be24: e08a0003 add r0, sl, r3
be28: e0890000 add r0, r9, r0
be2c: e5941000 ldr r1, [r4]
be30: e0632006 rsb r2, r3, r6
be34: eb000bb0 bl ecfc <memcpy>
be38: eaffffdb b bdac <pipe_read+0x114>
/* For buffering optimization */
if (PIPE_EMPTY(pipe))
pipe->Start = 0;
if (pipe->waitingWriters > 0)
PIPE_WAKEUPWRITERS(pipe);
be3c: e5940030 ldr r0, [r4, #48] ; 0x30
be40: e1a0100b mov r1, fp
be44: eb000405 bl ce60 <rtems_barrier_release>
be48: eaffffe4 b bde0 <pipe_read+0x148>
0000b7d4 <pipe_release>:
*/
int pipe_release(
pipe_control_t **pipep,
rtems_libio_t *iop
)
{
b7d4: e92d40f0 push {r4, r5, r6, r7, lr}
b7d8: e24dd004 sub sp, sp, #4
b7dc: e1a06001 mov r6, r1
b7e0: e1a05000 mov r5, r0
pipe_control_t *pipe = *pipep;
b7e4: e5904000 ldr r4, [r0]
uint32_t mode;
if (pipe_lock())
b7e8: ebffffc3 bl b6fc <pipe_lock>
b7ec: e2501000 subs r1, r0, #0
b7f0: 1a000035 bne b8cc <pipe_release+0xf8>
/* WARN pipe not freed and pipep not set to NULL! */
/* FIXME */
rtems_fatal_error_occurred(0xdeadbeef);
if (!PIPE_LOCK(pipe))
b7f4: e5940028 ldr r0, [r4, #40] ; 0x28
b7f8: e1a02001 mov r2, r1
b7fc: ebffed98 bl 6e64 <rtems_semaphore_obtain>
b800: e3500000 cmp r0, #0
b804: 1a000030 bne b8cc <pipe_release+0xf8>
/* WARN pipe not released! */
/* FIXME */
rtems_fatal_error_occurred(0xdeadbeef);
mode = LIBIO_ACCMODE(iop);
b808: e5966014 ldr r6, [r6, #20]
if (mode & LIBIO_FLAGS_READ)
b80c: e3160002 tst r6, #2
pipe->Readers --;
b810: 15943010 ldrne r3, [r4, #16]
if (!PIPE_LOCK(pipe))
/* WARN pipe not released! */
/* FIXME */
rtems_fatal_error_occurred(0xdeadbeef);
mode = LIBIO_ACCMODE(iop);
b814: e2066006 and r6, r6, #6
if (mode & LIBIO_FLAGS_READ)
pipe->Readers --;
b818: 12433001 subne r3, r3, #1
b81c: 15843010 strne r3, [r4, #16]
if (mode & LIBIO_FLAGS_WRITE)
b820: e3160004 tst r6, #4
pipe->Writers --;
b824: 15943014 ldrne r3, [r4, #20]
b828: 12433001 subne r3, r3, #1
b82c: 15843014 strne r3, [r4, #20]
PIPE_UNLOCK(pipe);
b830: e5940028 ldr r0, [r4, #40] ; 0x28
b834: ebffedd3 bl 6f88 <rtems_semaphore_release>
if (pipe->Readers == 0 && pipe->Writers == 0) {
b838: e5943010 ldr r3, [r4, #16]
b83c: e3530000 cmp r3, #0
b840: 0a00000c beq b878 <pipe_release+0xa4>
*pipep = NULL;
}
else if (pipe->Readers == 0 && mode != LIBIO_FLAGS_WRITE)
/* Notify waiting Writers that all their partners left */
PIPE_WAKEUPWRITERS(pipe);
else if (pipe->Writers == 0 && mode != LIBIO_FLAGS_READ)
b844: e5943014 ldr r3, [r4, #20]
b848: e2733001 rsbs r3, r3, #1
b84c: 33a03000 movcc r3, #0
b850: e3560002 cmp r6, #2
b854: 03a03000 moveq r3, #0
b858: e3530000 cmp r3, #0
PIPE_WAKEUPREADERS(pipe);
b85c: 1594002c ldrne r0, [r4, #44] ; 0x2c
b860: 11a0100d movne r1, sp
b864: 1b00057d blne ce60 <rtems_barrier_release>
pipe_unlock();
b868: ebffffce bl b7a8 <pipe_unlock>
if(iop->pathinfo.ops->unlink_h(&iop->pathinfo))
return -errno;
#endif
return 0;
}
b86c: e3a00000 mov r0, #0
b870: e28dd004 add sp, sp, #4
b874: e8bd80f0 pop {r4, r5, r6, r7, pc}
if (mode & LIBIO_FLAGS_WRITE)
pipe->Writers --;
PIPE_UNLOCK(pipe);
if (pipe->Readers == 0 && pipe->Writers == 0) {
b878: e5947014 ldr r7, [r4, #20]
b87c: e3570000 cmp r7, #0
b880: 0a000005 beq b89c <pipe_release+0xc8>
delfile = TRUE;
#endif
pipe_free(pipe);
*pipep = NULL;
}
else if (pipe->Readers == 0 && mode != LIBIO_FLAGS_WRITE)
b884: e3560004 cmp r6, #4
b888: 0afffff6 beq b868 <pipe_release+0x94>
/* Notify waiting Writers that all their partners left */
PIPE_WAKEUPWRITERS(pipe);
b88c: e5940030 ldr r0, [r4, #48] ; 0x30
b890: e1a0100d mov r1, sp
b894: eb000571 bl ce60 <rtems_barrier_release>
b898: eafffff2 b b868 <pipe_release+0x94>
/* Called with pipe_semaphore held. */
static inline void pipe_free(
pipe_control_t *pipe
)
{
rtems_barrier_delete(pipe->readBarrier);
b89c: e594002c ldr r0, [r4, #44] ; 0x2c
b8a0: eb000542 bl cdb0 <rtems_barrier_delete>
rtems_barrier_delete(pipe->writeBarrier);
b8a4: e5940030 ldr r0, [r4, #48] ; 0x30
b8a8: eb000540 bl cdb0 <rtems_barrier_delete>
rtems_semaphore_delete(pipe->Semaphore);
b8ac: e5940028 ldr r0, [r4, #40] ; 0x28
b8b0: ebffed42 bl 6dc0 <rtems_semaphore_delete>
free(pipe->Buffer);
b8b4: e5940000 ldr r0, [r4]
b8b8: ebffde8c bl 32f0 <free>
free(pipe);
b8bc: e1a00004 mov r0, r4
b8c0: ebffde8a bl 32f0 <free>
/* To delete an anonymous pipe file when all users closed it */
if (pipe->Anonymous)
delfile = TRUE;
#endif
pipe_free(pipe);
*pipep = NULL;
b8c4: e5857000 str r7, [r5]
b8c8: eaffffe6 b b868 <pipe_release+0x94>
rtems_fatal_error_occurred(0xdeadbeef);
if (!PIPE_LOCK(pipe))
/* WARN pipe not released! */
/* FIXME */
rtems_fatal_error_occurred(0xdeadbeef);
b8cc: e3e00585 mvn r0, #557842432 ; 0x21400000 <== NOT EXECUTED
b8d0: e2400949 sub r0, r0, #1196032 ; 0x124000 <== NOT EXECUTED
b8d4: e2400e11 sub r0, r0, #272 ; 0x110 <== NOT EXECUTED
b8d8: ebffeeed bl 7494 <rtems_fatal_error_occurred> <== NOT EXECUTED
0000b7a8 <pipe_unlock>:
static void pipe_unlock(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
sc = rtems_semaphore_release(pipe_semaphore);
b7a8: e59f3020 ldr r3, [pc, #32] ; b7d0 <pipe_unlock+0x28>
return -ENOMEM;
}
}
static void pipe_unlock(void)
{
b7ac: e52de004 push {lr} ; (str lr, [sp, #-4]!)
rtems_status_code sc = RTEMS_SUCCESSFUL;
sc = rtems_semaphore_release(pipe_semaphore);
b7b0: e5930000 ldr r0, [r3]
b7b4: ebffedf3 bl 6f88 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL) {
b7b8: e3500000 cmp r0, #0
b7bc: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
/* FIXME */
rtems_fatal_error_occurred(0xdeadbeef);
b7c0: e3e00585 mvn r0, #557842432 ; 0x21400000 <== NOT EXECUTED
b7c4: e2400949 sub r0, r0, #1196032 ; 0x124000 <== NOT EXECUTED
b7c8: e2400e11 sub r0, r0, #272 ; 0x110 <== NOT EXECUTED
b7cc: ebffef30 bl 7494 <rtems_fatal_error_occurred> <== NOT EXECUTED
0000be4c <pipe_write>:
pipe_control_t *pipe,
const void *buffer,
size_t count,
rtems_libio_t *iop
)
{
be4c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
int chunk, chunk1, written = 0, ret = 0;
/* Write nothing */
if (count == 0)
be50: e2524000 subs r4, r2, #0
pipe_control_t *pipe,
const void *buffer,
size_t count,
rtems_libio_t *iop
)
{
be54: e24dd008 sub sp, sp, #8
be58: e1a05000 mov r5, r0
be5c: e1a06001 mov r6, r1
int chunk, chunk1, written = 0, ret = 0;
/* Write nothing */
if (count == 0)
return 0;
be60: 01a07004 moveq r7, r4
)
{
int chunk, chunk1, written = 0, ret = 0;
/* Write nothing */
if (count == 0)
be64: 1a000002 bne be74 <pipe_write+0x28>
#endif
if (written > 0)
return written;
return ret;
}
be68: e1a00007 mov r0, r7
be6c: e28dd008 add sp, sp, #8
be70: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/* Write nothing */
if (count == 0)
return 0;
if (! PIPE_LOCK(pipe))
be74: e3a01000 mov r1, #0
be78: e5900028 ldr r0, [r0, #40] ; 0x28
be7c: e1a02001 mov r2, r1
be80: e58d3000 str r3, [sp]
be84: ebffebf6 bl 6e64 <rtems_semaphore_obtain>
be88: e2509000 subs r9, r0, #0
be8c: e59d3000 ldr r3, [sp]
return -EINTR;
be90: 13e07003 mvnne r7, #3
/* Write nothing */
if (count == 0)
return 0;
if (! PIPE_LOCK(pipe))
be94: 1afffff3 bne be68 <pipe_write+0x1c>
return -EINTR;
if (pipe->Readers == 0) {
be98: e5957010 ldr r7, [r5, #16]
be9c: e3570000 cmp r7, #0
bea0: 0a000055 beq bffc <pipe_write+0x1b0>
ret = -EPIPE;
goto out_locked;
}
/* Write of PIPE_BUF bytes or less shall not be interleaved */
chunk = count <= pipe->Size ? count : 1;
bea4: e5958004 ldr r8, [r5, #4]
bea8: e1540008 cmp r4, r8
beac: 91a0a004 movls sl, r4
beb0: 83a0a001 movhi sl, #1
beb4: e1a07009 mov r7, r9
else
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk);
pipe->Length += chunk;
if (pipe->waitingReaders > 0)
PIPE_WAKEUPREADERS(pipe);
beb8: e28db004 add fp, sp, #4
/* 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) {
bebc: e595100c ldr r1, [r5, #12]
bec0: e0612008 rsb r2, r1, r8
bec4: e152000a cmp r2, sl
bec8: 2a000021 bcs bf54 <pipe_write+0x108>
if (LIBIO_NODELAY(iop)) {
becc: e5938014 ldr r8, [r3, #20]
bed0: e2188001 ands r8, r8, #1
bed4: 1a00004c bne c00c <pipe_write+0x1c0>
ret = -EAGAIN;
goto out_locked;
}
/* Wait until there is chunk bytes space or no reader exists */
pipe->waitingWriters ++;
bed8: e595201c ldr r2, [r5, #28]
bedc: e2822001 add r2, r2, #1
bee0: e585201c str r2, [r5, #28]
PIPE_UNLOCK(pipe);
bee4: e5950028 ldr r0, [r5, #40] ; 0x28
bee8: e58d3000 str r3, [sp]
beec: ebffec25 bl 6f88 <rtems_semaphore_release>
if (! PIPE_WRITEWAIT(pipe))
bef0: e1a01008 mov r1, r8
bef4: e5950030 ldr r0, [r5, #48] ; 0x30
bef8: eb0003f0 bl cec0 <rtems_barrier_wait>
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
befc: e1a01008 mov r1, r8
bf00: e1a02001 mov r2, r1
}
/* Wait until there is chunk bytes space or no reader exists */
pipe->waitingWriters ++;
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
bf04: e2508000 subs r8, r0, #0
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
bf08: e5950028 ldr r0, [r5, #40] ; 0x28
}
/* Wait until there is chunk bytes space or no reader exists */
pipe->waitingWriters ++;
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
bf0c: 13e08003 mvnne r8, #3
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
bf10: ebffebd3 bl 6e64 <rtems_semaphore_obtain>
bf14: e3500000 cmp r0, #0
bf18: e59d3000 ldr r3, [sp]
bf1c: 1a000038 bne c004 <pipe_write+0x1b8>
/* WARN waitingWriters not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingWriters --;
bf20: e595201c ldr r2, [r5, #28]
if (ret != 0)
bf24: e3580000 cmp r8, #0
if (! PIPE_LOCK(pipe)) {
/* WARN waitingWriters not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingWriters --;
bf28: e2422001 sub r2, r2, #1
bf2c: e585201c str r2, [r5, #28]
if (ret != 0)
bf30: 1a00002c bne bfe8 <pipe_write+0x19c>
goto out_locked;
if (pipe->Readers == 0) {
bf34: e5952010 ldr r2, [r5, #16]
bf38: e3520000 cmp r2, #0
bf3c: 0a00002e beq bffc <pipe_write+0x1b0>
bf40: e5958004 ldr r8, [r5, #4]
/* 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) {
bf44: e595100c ldr r1, [r5, #12]
bf48: e0612008 rsb r2, r1, r8
bf4c: e152000a cmp r2, sl
bf50: 3affffdd bcc becc <pipe_write+0x80>
goto out_locked;
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
chunk1 = pipe->Size - PIPE_WSTART(pipe);
bf54: e5950008 ldr r0, [r5, #8]
ret = -EPIPE;
goto out_locked;
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
bf58: e069a004 rsb sl, r9, r4
chunk1 = pipe->Size - PIPE_WSTART(pipe);
bf5c: e0810000 add r0, r1, r0
bf60: e1a01008 mov r1, r8
ret = -EPIPE;
goto out_locked;
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
bf64: e152000a cmp r2, sl
bf68: 31a0a002 movcc sl, r2
chunk1 = pipe->Size - PIPE_WSTART(pipe);
bf6c: e58d3000 str r3, [sp]
bf70: eb002ec1 bl 17a7c <__umodsi3>
bf74: e0608008 rsb r8, r0, r8
if (chunk > chunk1) {
bf78: e15a0008 cmp sl, r8
goto out_locked;
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
chunk1 = pipe->Size - PIPE_WSTART(pipe);
bf7c: e1a0c000 mov ip, r0
if (chunk > chunk1) {
bf80: e59d3000 ldr r3, [sp]
bf84: da000022 ble c014 <pipe_write+0x1c8>
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk1);
bf88: e5950000 ldr r0, [r5]
bf8c: e0861009 add r1, r6, r9
bf90: e1a02008 mov r2, r8
bf94: e080000c add r0, r0, ip
bf98: eb000b57 bl ecfc <memcpy>
memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1);
bf9c: e0881009 add r1, r8, r9
bfa0: e5950000 ldr r0, [r5]
bfa4: e0861001 add r1, r6, r1
bfa8: e068200a rsb r2, r8, sl
bfac: eb000b52 bl ecfc <memcpy>
bfb0: e59d3000 ldr r3, [sp]
}
else
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk);
pipe->Length += chunk;
bfb4: e595200c ldr r2, [r5, #12]
if (pipe->waitingReaders > 0)
bfb8: e5951018 ldr r1, [r5, #24]
memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1);
}
else
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk);
pipe->Length += chunk;
bfbc: e082200a add r2, r2, sl
if (pipe->waitingReaders > 0)
bfc0: e3510000 cmp r1, #0
memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1);
}
else
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk);
pipe->Length += chunk;
bfc4: e585200c str r2, [r5, #12]
if (pipe->waitingReaders > 0)
bfc8: 1a000019 bne c034 <pipe_write+0x1e8>
PIPE_WAKEUPREADERS(pipe);
written += chunk;
bfcc: e087700a add r7, r7, sl
}
/* Write of PIPE_BUF bytes or less shall not be interleaved */
chunk = count <= pipe->Size ? count : 1;
while (written < count) {
bfd0: e1540007 cmp r4, r7
bfd4: e1a09007 mov r9, r7
bfd8: 85958004 ldrhi r8, [r5, #4]
pipe->Length += chunk;
if (pipe->waitingReaders > 0)
PIPE_WAKEUPREADERS(pipe);
written += chunk;
/* Write of more than PIPE_BUF bytes can be interleaved */
chunk = 1;
bfdc: 83a0a001 movhi sl, #1
bfe0: 8affffb5 bhi bebc <pipe_write+0x70>
}
/* Write of PIPE_BUF bytes or less shall not be interleaved */
chunk = count <= pipe->Size ? count : 1;
while (written < count) {
bfe4: e3a08000 mov r8, #0
/* Write of more than PIPE_BUF bytes can be interleaved */
chunk = 1;
}
out_locked:
PIPE_UNLOCK(pipe);
bfe8: e5950028 ldr r0, [r5, #40] ; 0x28
bfec: ebffebe5 bl 6f88 <rtems_semaphore_release>
kill(getpid(), SIGPIPE);
#endif
if (written > 0)
return written;
return ret;
bff0: e3570000 cmp r7, #0
bff4: d1a07008 movle r7, r8
bff8: eaffff9a b be68 <pipe_write+0x1c>
pipe->waitingWriters --;
if (ret != 0)
goto out_locked;
if (pipe->Readers == 0) {
ret = -EPIPE;
bffc: e3e0801f mvn r8, #31
c000: eafffff8 b bfe8 <pipe_write+0x19c>
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
/* WARN waitingWriters not restored! */
ret = -EINTR;
c004: e3e08003 mvn r8, #3 <== NOT EXECUTED
c008: eafffff8 b bff0 <pipe_write+0x1a4> <== NOT EXECUTED
chunk = count <= pipe->Size ? count : 1;
while (written < count) {
while (PIPE_SPACE(pipe) < chunk) {
if (LIBIO_NODELAY(iop)) {
ret = -EAGAIN;
c00c: e3e0800a mvn r8, #10
c010: eafffff4 b bfe8 <pipe_write+0x19c>
if (chunk > chunk1) {
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);
c014: e5950000 ldr r0, [r5]
c018: e0861009 add r1, r6, r9
c01c: e080000c add r0, r0, ip
c020: e1a0200a mov r2, sl
c024: e58d3000 str r3, [sp]
c028: eb000b33 bl ecfc <memcpy>
c02c: e59d3000 ldr r3, [sp]
c030: eaffffdf b bfb4 <pipe_write+0x168>
pipe->Length += chunk;
if (pipe->waitingReaders > 0)
PIPE_WAKEUPREADERS(pipe);
c034: e595002c ldr r0, [r5, #44] ; 0x2c
c038: e1a0100b mov r1, fp
c03c: e58d3000 str r3, [sp]
c040: eb000386 bl ce60 <rtems_barrier_release>
c044: e59d3000 ldr r3, [sp]
c048: eaffffdf b bfcc <pipe_write+0x180>
00011ddc <read>:
)
{
ssize_t rc;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
11ddc: e59f30a4 ldr r3, [pc, #164] ; 11e88 <read+0xac>
11de0: e5933000 ldr r3, [r3]
11de4: e1500003 cmp r0, r3
ssize_t read(
int fd,
void *buffer,
size_t count
)
{
11de8: e92d4010 push {r4, lr}
ssize_t rc;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
11dec: 2a00001b bcs 11e60 <read+0x84>
iop = rtems_libio_iop( fd );
11df0: e59f4094 ldr r4, [pc, #148] ; 11e8c <read+0xb0>
11df4: e5944000 ldr r4, [r4]
11df8: e0600180 rsb r0, r0, r0, lsl #3
11dfc: e0844180 add r4, r4, r0, lsl #3
rtems_libio_check_is_open( iop );
11e00: e5940014 ldr r0, [r4, #20]
11e04: e3100c01 tst r0, #256 ; 0x100
11e08: 0a000014 beq 11e60 <read+0x84>
rtems_libio_check_buffer( buffer );
11e0c: e3510000 cmp r1, #0
11e10: 0a000017 beq 11e74 <read+0x98>
rtems_libio_check_count( count );
11e14: e3520000 cmp r2, #0
11e18: 0a00000e beq 11e58 <read+0x7c>
rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ );
11e1c: e3100002 tst r0, #2
11e20: 0a000013 beq 11e74 <read+0x98>
return 0;
/*
* Now process the read().
*/
rc = (*iop->pathinfo.handlers->read_h)( iop, buffer, count );
11e24: e5943020 ldr r3, [r4, #32]
11e28: e1a00004 mov r0, r4
11e2c: e1a0e00f mov lr, pc
11e30: e593f008 ldr pc, [r3, #8]
if ( rc > 0 )
11e34: e3500000 cmp r0, #0
11e38: d8bd8010 pople {r4, pc}
iop->offset += rc;
11e3c: e284300c add r3, r4, #12
11e40: e893000c ldm r3, {r2, r3}
11e44: e0922000 adds r2, r2, r0
11e48: e0a33fc0 adc r3, r3, r0, asr #31
11e4c: e584200c str r2, [r4, #12]
11e50: e5843010 str r3, [r4, #16]
11e54: e8bd8010 pop {r4, pc}
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open( iop );
rtems_libio_check_buffer( buffer );
rtems_libio_check_count( count );
11e58: e1a00002 mov r0, r2 <== NOT EXECUTED
if ( rc > 0 )
iop->offset += rc;
return rc;
}
11e5c: e8bd8010 pop {r4, pc} <== NOT EXECUTED
ssize_t rc;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open( iop );
11e60: ebffeb79 bl cc4c <__errno>
11e64: e3a03009 mov r3, #9
11e68: e5803000 str r3, [r0]
11e6c: e3e00000 mvn r0, #0
11e70: e8bd8010 pop {r4, pc}
rtems_libio_check_buffer( buffer );
rtems_libio_check_count( count );
rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ );
11e74: ebffeb74 bl cc4c <__errno> <== NOT EXECUTED
11e78: e3a03016 mov r3, #22 <== NOT EXECUTED
11e7c: e5803000 str r3, [r0] <== NOT EXECUTED
11e80: e3e00000 mvn r0, #0 <== NOT EXECUTED
11e84: e8bd8010 pop {r4, pc} <== NOT EXECUTED
000054c0 <readlink>:
ssize_t readlink(
const char *pathname,
char *buf,
size_t bufsize
)
{
54c0: e92d40f0 push {r4, r5, r6, r7, lr}
rtems_filesystem_location_info_t loc;
int result;
if (!buf)
54c4: e2516000 subs r6, r1, #0
ssize_t readlink(
const char *pathname,
char *buf,
size_t bufsize
)
{
54c8: e24dd018 sub sp, sp, #24
54cc: e1a07000 mov r7, r0
54d0: e1a05002 mov r5, r2
rtems_filesystem_location_info_t loc;
int result;
if (!buf)
54d4: 0a00001d beq 5550 <readlink+0x90>
rtems_set_errno_and_return_minus_one( EFAULT );
result = rtems_filesystem_evaluate_path( pathname, strlen( pathname ),
54d8: eb00315c bl 11a50 <strlen>
54dc: e28d4004 add r4, sp, #4
54e0: e1a01000 mov r1, r0
54e4: e3a02000 mov r2, #0
54e8: e1a00007 mov r0, r7
54ec: e1a03004 mov r3, r4
54f0: e58d2000 str r2, [sp]
54f4: ebfffb70 bl 42bc <rtems_filesystem_evaluate_path>
0, &loc, false );
if ( result != 0 )
54f8: e3500000 cmp r0, #0
return -1;
54fc: 13e05000 mvnne r5, #0
if (!buf)
rtems_set_errno_and_return_minus_one( EFAULT );
result = rtems_filesystem_evaluate_path( pathname, strlen( pathname ),
0, &loc, false );
if ( result != 0 )
5500: 0a000002 beq 5510 <readlink+0x50>
result = (*loc.ops->readlink_h)( &loc, buf, bufsize );
rtems_filesystem_freenode( &loc );
return result;
}
5504: e1a00005 mov r0, r5
5508: e28dd018 add sp, sp, #24
550c: e8bd80f0 pop {r4, r5, r6, r7, pc}
result = rtems_filesystem_evaluate_path( pathname, strlen( pathname ),
0, &loc, false );
if ( result != 0 )
return -1;
if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){
5510: e1a00004 mov r0, r4
5514: e59d3010 ldr r3, [sp, #16]
5518: e1a0e00f mov lr, pc
551c: e593f010 ldr pc, [r3, #16]
5520: e3500004 cmp r0, #4
5524: 1a00000e bne 5564 <readlink+0xa4>
rtems_filesystem_freenode( &loc );
rtems_set_errno_and_return_minus_one( EINVAL );
}
result = (*loc.ops->readlink_h)( &loc, buf, bufsize );
5528: e1a02005 mov r2, r5
552c: e1a00004 mov r0, r4
5530: e1a01006 mov r1, r6
5534: e59d3010 ldr r3, [sp, #16]
5538: e1a0e00f mov lr, pc
553c: e593f03c ldr pc, [r3, #60] ; 0x3c
5540: e1a05000 mov r5, r0
rtems_filesystem_freenode( &loc );
5544: e1a00004 mov r0, r4
5548: ebfffba6 bl 43e8 <rtems_filesystem_freenode>
return result;
554c: eaffffec b 5504 <readlink+0x44>
{
rtems_filesystem_location_info_t loc;
int result;
if (!buf)
rtems_set_errno_and_return_minus_one( EFAULT );
5550: eb0029e4 bl fce8 <__errno> <== NOT EXECUTED
5554: e3a0300e mov r3, #14 <== NOT EXECUTED
5558: e5803000 str r3, [r0] <== NOT EXECUTED
555c: e3e05000 mvn r5, #0 <== NOT EXECUTED
5560: eaffffe7 b 5504 <readlink+0x44> <== NOT EXECUTED
0, &loc, false );
if ( result != 0 )
return -1;
if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){
rtems_filesystem_freenode( &loc );
5564: e1a00004 mov r0, r4
5568: ebfffb9e bl 43e8 <rtems_filesystem_freenode>
rtems_set_errno_and_return_minus_one( EINVAL );
556c: eb0029dd bl fce8 <__errno>
5570: e3a03016 mov r3, #22
5574: e5803000 str r3, [r0]
5578: e3e05000 mvn r5, #0
557c: eaffffe0 b 5504 <readlink+0x44>
000040a4 <readv>:
int v;
int bytes;
rtems_libio_t *iop;
bool all_zeros;
rtems_libio_check_fd( fd );
40a4: e59f313c ldr r3, [pc, #316] ; 41e8 <readv+0x144>
40a8: e5933000 ldr r3, [r3]
40ac: e1500003 cmp r0, r3
ssize_t readv(
int fd,
const struct iovec *iov,
int iovcnt
)
{
40b0: e92d41f0 push {r4, r5, r6, r7, r8, lr}
40b4: e1a04002 mov r4, r2
int v;
int bytes;
rtems_libio_t *iop;
bool all_zeros;
rtems_libio_check_fd( fd );
40b8: 2a000045 bcs 41d4 <readv+0x130>
iop = rtems_libio_iop( fd );
40bc: e59f3128 ldr r3, [pc, #296] ; 41ec <readv+0x148>
40c0: e5933000 ldr r3, [r3]
40c4: e0600180 rsb r0, r0, r0, lsl #3
40c8: e0836180 add r6, r3, r0, lsl #3
rtems_libio_check_is_open( iop );
40cc: e5963014 ldr r3, [r6, #20]
40d0: e3130c01 tst r3, #256 ; 0x100
40d4: 0a00003e beq 41d4 <readv+0x130>
rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ );
40d8: e3130002 tst r3, #2
40dc: 0a000036 beq 41bc <readv+0x118>
/*
* Argument validation on IO vector
*/
if ( !iov )
40e0: e3510000 cmp r1, #0
40e4: 0a000034 beq 41bc <readv+0x118>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt <= 0 )
40e8: e3520000 cmp r2, #0
40ec: da000032 ble 41bc <readv+0x118>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt > IOV_MAX )
40f0: e3520b01 cmp r2, #1024 ; 0x400
40f4: ca000030 bgt 41bc <readv+0x118>
40f8: e3a02000 mov r2, #0
rtems_set_errno_and_return_minus_one( EINVAL );
40fc: e1a05001 mov r5, r1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt <= 0 )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt > IOV_MAX )
4100: e1a03001 mov r3, r1
4104: e3a07001 mov r7, #1
4108: e1a01002 mov r1, r2
410c: ea000000 b 4114 <readv+0x70>
if ( iov[v].iov_len < 0 )
rtems_set_errno_and_return_minus_one( EINVAL );
/* check for wrap */
old = total;
total += iov[v].iov_len;
4110: e1a0100c mov r1, ip
all_zeros = true;
for ( total=0, v=0 ; v < iovcnt ; v++ ) {
ssize_t old;
if ( !iov[v].iov_base )
4114: e5930000 ldr r0, [r3]
4118: e3500000 cmp r0, #0
* are obvious errors in the iovec. So this extra loop ensures
* that we do not do anything if there is an argument error.
*/
all_zeros = true;
for ( total=0, v=0 ; v < iovcnt ; v++ ) {
411c: e2822001 add r2, r2, #1
ssize_t old;
if ( !iov[v].iov_base )
4120: 0a000025 beq 41bc <readv+0x118>
if ( iov[v].iov_len < 0 )
rtems_set_errno_and_return_minus_one( EINVAL );
/* check for wrap */
old = total;
total += iov[v].iov_len;
4124: e5930004 ldr r0, [r3, #4]
4128: e081c000 add ip, r1, r0
if ( total < old )
412c: e151000c cmp r1, ip
4130: ca000021 bgt 41bc <readv+0x118>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iov[v].iov_len )
all_zeros = false;
4134: e3500000 cmp r0, #0
4138: 13a07000 movne r7, #0
* are obvious errors in the iovec. So this extra loop ensures
* that we do not do anything if there is an argument error.
*/
all_zeros = true;
for ( total=0, v=0 ; v < iovcnt ; v++ ) {
413c: e1540002 cmp r4, r2
4140: e2833008 add r3, r3, #8
4144: cafffff1 bgt 4110 <readv+0x6c>
/*
* A readv with all zeros logically has no effect. Even though
* OpenGroup didn't address this case as they did with writev(),
* we will handle it the same way for symmetry.
*/
if ( all_zeros == true ) {
4148: e3570000 cmp r7, #0
return 0;
414c: 13a08000 movne r8, #0
/*
* A readv with all zeros logically has no effect. Even though
* OpenGroup didn't address this case as they did with writev(),
* we will handle it the same way for symmetry.
*/
if ( all_zeros == true ) {
4150: 1a00001d bne 41cc <readv+0x128>
4154: e1a08007 mov r8, r7
4158: ea00000d b 4194 <readv+0xf0>
);
if ( bytes < 0 )
return -1;
if ( bytes > 0 ) {
415c: 0a000006 beq 417c <readv+0xd8>
iop->offset += bytes;
4160: e286300c add r3, r6, #12
4164: e893000c ldm r3, {r2, r3}
4168: e0922000 adds r2, r2, r0
416c: e0a33fc0 adc r3, r3, r0, asr #31
4170: e586200c str r2, [r6, #12]
4174: e5863010 str r3, [r6, #16]
total += bytes;
4178: e0888000 add r8, r8, r0
}
if (bytes != iov[ v ].iov_len)
417c: e5953004 ldr r3, [r5, #4]
4180: e1500003 cmp r0, r3
4184: 1a000010 bne 41cc <readv+0x128>
}
/*
* Now process the readv().
*/
for ( total=0, v=0 ; v < iovcnt ; v++ ) {
4188: e1540007 cmp r4, r7
418c: e2855008 add r5, r5, #8
4190: da00000d ble 41cc <readv+0x128>
bytes = (*iop->pathinfo.handlers->read_h)(
4194: e8950006 ldm r5, {r1, r2}
4198: e5963020 ldr r3, [r6, #32]
419c: e1a00006 mov r0, r6
41a0: e1a0e00f mov lr, pc
41a4: e593f008 ldr pc, [r3, #8]
iop,
iov[v].iov_base,
iov[v].iov_len
);
if ( bytes < 0 )
41a8: e3500000 cmp r0, #0
}
/*
* Now process the readv().
*/
for ( total=0, v=0 ; v < iovcnt ; v++ ) {
41ac: e2877001 add r7, r7, #1
iop,
iov[v].iov_base,
iov[v].iov_len
);
if ( bytes < 0 )
41b0: aaffffe9 bge 415c <readv+0xb8>
return -1;
41b4: e3e08000 mvn r8, #0 <== NOT EXECUTED
41b8: ea000003 b 41cc <readv+0x128> <== NOT EXECUTED
/* check for wrap */
old = total;
total += iov[v].iov_len;
if ( total < old )
rtems_set_errno_and_return_minus_one( EINVAL );
41bc: eb0026cd bl dcf8 <__errno>
41c0: e3a03016 mov r3, #22
41c4: e5803000 str r3, [r0]
41c8: e3e08000 mvn r8, #0
if (bytes != iov[ v ].iov_len)
break;
}
return total;
}
41cc: e1a00008 mov r0, r8
41d0: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
rtems_libio_t *iop;
bool all_zeros;
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open( iop );
41d4: eb0026c7 bl dcf8 <__errno>
41d8: e3a03009 mov r3, #9
41dc: e5803000 str r3, [r0]
41e0: e3e08000 mvn r8, #0
41e4: eafffff8 b 41cc <readv+0x128>
00011ee8 <realloc>:
void *realloc(
void *ptr,
size_t size
)
{
11ee8: e92d41f0 push {r4, r5, r6, r7, r8, lr}
/*
* Do not attempt to allocate memory if in a critical section or ISR.
*/
if (_System_state_Is_up(_System_state_Get())) {
11eec: e59f2118 ldr r2, [pc, #280] ; 1200c <realloc+0x124>
)
{
uintptr_t old_size;
char *new_area;
MSBUMP(realloc_calls, 1);
11ef0: e59f5118 ldr r5, [pc, #280] ; 12010 <realloc+0x128>
/*
* Do not attempt to allocate memory if in a critical section or ISR.
*/
if (_System_state_Is_up(_System_state_Get())) {
11ef4: e5922000 ldr r2, [r2]
)
{
uintptr_t old_size;
char *new_area;
MSBUMP(realloc_calls, 1);
11ef8: e5953010 ldr r3, [r5, #16]
/*
* Do not attempt to allocate memory if in a critical section or ISR.
*/
if (_System_state_Is_up(_System_state_Get())) {
11efc: e3520003 cmp r2, #3
)
{
uintptr_t old_size;
char *new_area;
MSBUMP(realloc_calls, 1);
11f00: e2833001 add r3, r3, #1
void *realloc(
void *ptr,
size_t size
)
{
11f04: e24dd004 sub sp, sp, #4
11f08: e1a04000 mov r4, r0
11f0c: e1a06001 mov r6, r1
uintptr_t old_size;
char *new_area;
MSBUMP(realloc_calls, 1);
11f10: e5853010 str r3, [r5, #16]
/*
* Do not attempt to allocate memory if in a critical section or ISR.
*/
if (_System_state_Is_up(_System_state_Get())) {
11f14: 0a000020 beq 11f9c <realloc+0xb4>
}
/*
* Continue with realloc().
*/
if ( !ptr )
11f18: e3540000 cmp r4, #0
11f1c: 0a00001a beq 11f8c <realloc+0xa4>
return malloc( size );
if ( !size ) {
11f20: e3560000 cmp r6, #0
11f24: 0a00000f beq 11f68 <realloc+0x80>
free( ptr );
return (void *) 0;
}
if ( !_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, ptr, &old_size) ) {
11f28: e59f70e4 ldr r7, [pc, #228] ; 12014 <realloc+0x12c>
11f2c: e1a01004 mov r1, r4
11f30: e5970000 ldr r0, [r7]
11f34: e1a0200d mov r2, sp
11f38: eb000065 bl 120d4 <_Protected_heap_Get_block_size>
11f3c: e2508000 subs r8, r0, #0
11f40: 0a00000c beq 11f78 <realloc+0x90>
}
/*
* Now resize it.
*/
if ( _Protected_heap_Resize_block( RTEMS_Malloc_Heap, ptr, size ) ) {
11f44: e5970000 ldr r0, [r7]
11f48: e1a01004 mov r1, r4
11f4c: e1a02006 mov r2, r6
11f50: eb000070 bl 12118 <_Protected_heap_Resize_block>
11f54: e3500000 cmp r0, #0
11f58: 0a00001a beq 11fc8 <realloc+0xe0>
memcpy( new_area, ptr, (size < old_size) ? size : old_size );
free( ptr );
return new_area;
}
11f5c: e1a00004 mov r0, r4
11f60: e28dd004 add sp, sp, #4
11f64: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
*/
if ( !ptr )
return malloc( size );
if ( !size ) {
free( ptr );
11f68: e1a00004 mov r0, r4 <== NOT EXECUTED
11f6c: ebffc014 bl 1fc4 <free> <== NOT EXECUTED
return (void *) 0;
11f70: e1a04006 mov r4, r6 <== NOT EXECUTED
11f74: eafffff8 b 11f5c <realloc+0x74> <== NOT EXECUTED
}
if ( !_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, ptr, &old_size) ) {
errno = EINVAL;
11f78: ebffeb33 bl cc4c <__errno>
11f7c: e3a03016 mov r3, #22
11f80: e5803000 str r3, [r0]
return (void *) 0;
11f84: e1a04008 mov r4, r8
11f88: eafffff3 b 11f5c <realloc+0x74>
/*
* Continue with realloc().
*/
if ( !ptr )
return malloc( size );
11f8c: e1a00006 mov r0, r6
11f90: ebffc0e5 bl 232c <malloc>
11f94: e1a04000 mov r4, r0
11f98: eaffffef b 11f5c <realloc+0x74>
/*
* 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)
11f9c: e59f3074 ldr r3, [pc, #116] ; 12018 <realloc+0x130>
11fa0: e5933000 ldr r3, [r3]
11fa4: e3530000 cmp r3, #0
return (void *) 0;
11fa8: 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)
11fac: 1affffea bne 11f5c <realloc+0x74>
return (void *) 0;
if (_ISR_Nest_level > 0)
11fb0: e59f2064 ldr r2, [pc, #100] ; 1201c <realloc+0x134>
11fb4: e5922000 ldr r2, [r2]
11fb8: e3520000 cmp r2, #0
return (void *) 0;
11fbc: 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)
11fc0: 0affffd4 beq 11f18 <realloc+0x30>
11fc4: eaffffe4 b 11f5c <realloc+0x74> <== NOT EXECUTED
* 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 );
11fc8: e1a00006 mov r0, r6
11fcc: ebffc0d6 bl 232c <malloc>
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
11fd0: e5953004 ldr r3, [r5, #4]
if ( !new_area ) {
11fd4: e2507000 subs r7, r0, #0
* and the C Standard.
*/
new_area = malloc( size );
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
11fd8: e2433001 sub r3, r3, #1
11fdc: e5853004 str r3, [r5, #4]
if ( !new_area ) {
return (void *) 0;
11fe0: 01a04007 moveq r4, r7
new_area = malloc( size );
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
if ( !new_area ) {
11fe4: 0affffdc beq 11f5c <realloc+0x74>
return (void *) 0;
}
memcpy( new_area, ptr, (size < old_size) ? size : old_size );
11fe8: e59d2000 ldr r2, [sp]
11fec: e1a01004 mov r1, r4
11ff0: e1560002 cmp r6, r2
11ff4: 31a02006 movcc r2, r6
11ff8: ebffed41 bl d504 <memcpy>
free( ptr );
11ffc: e1a00004 mov r0, r4
12000: ebffbfef bl 1fc4 <free>
return new_area;
12004: e1a04007 mov r4, r7
12008: eaffffd3 b 11f5c <realloc+0x74>
00004234 <rmdir>:
#include <rtems/seterr.h>
int rmdir(
const char *pathname
)
{
4234: e92d40f0 push {r4, r5, r6, r7, lr}
4238: e24dd030 sub sp, sp, #48 ; 0x30
423c: e1a07000 mov r7, r0
/*
* Get the parent node of the node we wish to remove. Find the parent path.
*/
parentpathlen = rtems_filesystem_dirname ( pathname );
4240: ebfffade bl 2dc0 <rtems_filesystem_dirname>
if ( parentpathlen == 0 )
4244: e2505000 subs r5, r0, #0
4248: 1a000045 bne 4364 <rmdir+0x130>
rtems_filesystem_get_start_loc( pathname, &i, &parentloc );
424c: e28d4018 add r4, sp, #24
4250: e1a00007 mov r0, r7
4254: e28d102c add r1, sp, #44 ; 0x2c
4258: e1a02004 mov r2, r4
425c: eb00004c bl 4394 <rtems_filesystem_get_start_loc>
const char *name;
rtems_filesystem_location_info_t parentloc;
rtems_filesystem_location_info_t loc;
int i;
int result;
bool free_parentloc = false;
4260: e1a06005 mov r6, r5
/*
* Start from the parent to find the node that should be under it.
*/
loc = parentloc;
4264: e1a0e004 mov lr, r4
4268: e8be000f ldm lr!, {r0, r1, r2, r3}
426c: e28dc004 add ip, sp, #4
4270: e8ac000f stmia ip!, {r0, r1, r2, r3}
name = pathname + parentpathlen;
4274: e0875005 add r5, r7, r5
/*
* Start from the parent to find the node that should be under it.
*/
loc = parentloc;
4278: e59e3000 ldr r3, [lr]
name = pathname + parentpathlen;
name += rtems_filesystem_prefix_separators( name, strlen( name ) );
427c: e1a00005 mov r0, r5
/*
* Start from the parent to find the node that should be under it.
*/
loc = parentloc;
4280: e58c3000 str r3, [ip]
name = pathname + parentpathlen;
name += rtems_filesystem_prefix_separators( name, strlen( name ) );
4284: eb002ad0 bl edcc <strlen>
4288: e1a01000 mov r1, r0
428c: e1a00005 mov r0, r5
4290: ebfffad9 bl 2dfc <rtems_filesystem_prefix_separators>
4294: e0857000 add r7, r5, r0
result = rtems_filesystem_evaluate_relative_path( name , strlen( name ),
4298: e1a00007 mov r0, r7
429c: eb002aca bl edcc <strlen>
42a0: e28d5004 add r5, sp, #4
42a4: e1a01000 mov r1, r0
42a8: e3a02000 mov r2, #0
42ac: e1a00007 mov r0, r7
42b0: e1a03005 mov r3, r5
42b4: e58d2000 str r2, [sp]
42b8: ebfffa74 bl 2c90 <rtems_filesystem_evaluate_relative_path>
0, &loc, false );
if ( result != 0 ) {
42bc: e3500000 cmp r0, #0
42c0: 1a000015 bne 431c <rmdir+0xe8>
}
/*
* Verify you can remove this node as a directory.
*/
if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ){
42c4: e1a00005 mov r0, r5
42c8: e59d3010 ldr r3, [sp, #16]
42cc: e1a0e00f mov lr, pc
42d0: e593f010 ldr pc, [r3, #16]
42d4: e3500001 cmp r0, #1
42d8: 1a000013 bne 432c <rmdir+0xf8>
/*
* Use the filesystems rmnod to remove the node.
*/
result = (*loc.handlers->rmnod_h)( &parentloc, &loc );
42dc: e1a01005 mov r1, r5
42e0: e59d300c ldr r3, [sp, #12]
42e4: e1a00004 mov r0, r4
42e8: e1a0e00f mov lr, pc
42ec: e593f034 ldr pc, [r3, #52] ; 0x34
42f0: e1a07000 mov r7, r0
rtems_filesystem_freenode( &loc );
42f4: e1a00005 mov r0, r5
42f8: ebfffb70 bl 30c0 <rtems_filesystem_freenode>
if ( free_parentloc )
42fc: e3560000 cmp r6, #0
4300: 1a000002 bne 4310 <rmdir+0xdc>
rtems_filesystem_freenode( &parentloc );
return result;
}
4304: e1a00007 mov r0, r7
4308: e28dd030 add sp, sp, #48 ; 0x30
430c: e8bd80f0 pop {r4, r5, r6, r7, pc}
result = (*loc.handlers->rmnod_h)( &parentloc, &loc );
rtems_filesystem_freenode( &loc );
if ( free_parentloc )
rtems_filesystem_freenode( &parentloc );
4310: e1a00004 mov r0, r4
4314: ebfffb69 bl 30c0 <rtems_filesystem_freenode>
4318: eafffff9 b 4304 <rmdir+0xd0>
name += rtems_filesystem_prefix_separators( name, strlen( name ) );
result = rtems_filesystem_evaluate_relative_path( name , strlen( name ),
0, &loc, false );
if ( result != 0 ) {
if ( free_parentloc )
431c: e3560000 cmp r6, #0
4320: 1a00000b bne 4354 <rmdir+0x120>
rtems_filesystem_freenode( &parentloc );
return -1;
4324: e3e07000 mvn r7, #0
4328: eafffff5 b 4304 <rmdir+0xd0>
/*
* Verify you can remove this node as a directory.
*/
if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ){
rtems_filesystem_freenode( &loc );
432c: e1a00005 mov r0, r5
4330: ebfffb62 bl 30c0 <rtems_filesystem_freenode>
if ( free_parentloc )
4334: e3560000 cmp r6, #0
rtems_filesystem_freenode( &parentloc );
4338: 11a00004 movne r0, r4
433c: 1bfffb5f blne 30c0 <rtems_filesystem_freenode>
rtems_set_errno_and_return_minus_one( ENOTDIR );
4340: eb0026dc bl deb8 <__errno>
4344: e3a03014 mov r3, #20
4348: e5803000 str r3, [r0]
434c: e3e07000 mvn r7, #0
4350: eaffffeb b 4304 <rmdir+0xd0>
result = rtems_filesystem_evaluate_relative_path( name , strlen( name ),
0, &loc, false );
if ( result != 0 ) {
if ( free_parentloc )
rtems_filesystem_freenode( &parentloc );
4354: e1a00004 mov r0, r4 <== NOT EXECUTED
4358: ebfffb58 bl 30c0 <rtems_filesystem_freenode> <== NOT EXECUTED
return -1;
435c: e3e07000 mvn r7, #0 <== NOT EXECUTED
4360: eaffffe7 b 4304 <rmdir+0xd0> <== NOT EXECUTED
parentpathlen = rtems_filesystem_dirname ( pathname );
if ( parentpathlen == 0 )
rtems_filesystem_get_start_loc( pathname, &i, &parentloc );
else {
result = rtems_filesystem_evaluate_path(pathname, parentpathlen,
4364: e3a03000 mov r3, #0
4368: e28d4018 add r4, sp, #24
436c: e58d3000 str r3, [sp]
4370: e3a02002 mov r2, #2
4374: e1a00007 mov r0, r7
4378: e1a01005 mov r1, r5
437c: e1a03004 mov r3, r4
4380: ebfffa6c bl 2d38 <rtems_filesystem_evaluate_path>
RTEMS_LIBIO_PERMS_WRITE,
&parentloc,
false );
if ( result != 0 )
4384: e3500000 cmp r0, #0
4388: 1affffe5 bne 4324 <rmdir+0xf0>
return -1;
free_parentloc = true;
438c: e3a06001 mov r6, #1
4390: eaffffb3 b 4264 <rmdir+0x30>
00002b34 <rtems_assoc_ptr_by_name>:
const rtems_assoc_t *rtems_assoc_ptr_by_name(
const rtems_assoc_t *ap,
const char *name
)
{
2b34: e92d41f0 push {r4, r5, r6, r7, r8, lr}
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
2b38: e5904000 ldr r4, [r0]
2b3c: e3540000 cmp r4, #0
const rtems_assoc_t *rtems_assoc_ptr_by_name(
const rtems_assoc_t *ap,
const char *name
)
{
2b40: e1a06000 mov r6, r0
2b44: e1a07001 mov r7, r1
const rtems_assoc_t *default_ap = 0;
2b48: 01a06004 moveq r6, r4
if (rtems_assoc_is_default(ap))
2b4c: 0a000011 beq 2b98 <rtems_assoc_ptr_by_name+0x64>
2b50: e1a00004 mov r0, r4
2b54: e59f106c ldr r1, [pc, #108] ; 2bc8 <rtems_assoc_ptr_by_name+0x94>
2b58: eb002ef5 bl e734 <strcmp>
2b5c: e3500000 cmp r0, #0
const rtems_assoc_t *rtems_assoc_ptr_by_name(
const rtems_assoc_t *ap,
const char *name
)
{
const rtems_assoc_t *default_ap = 0;
2b60: 13a08000 movne r8, #0
if (rtems_assoc_is_default(ap))
2b64: 0a00000d beq 2ba0 <rtems_assoc_ptr_by_name+0x6c>
default_ap = ap++;
for ( ; ap->name; ap++)
2b68: e1a05006 mov r5, r6
2b6c: ea000003 b 2b80 <rtems_assoc_ptr_by_name+0x4c>
2b70: e595400c ldr r4, [r5, #12]
2b74: e3540000 cmp r4, #0
2b78: e285500c add r5, r5, #12
2b7c: 0a00000e beq 2bbc <rtems_assoc_ptr_by_name+0x88>
if (strcmp(ap->name, name) == 0)
2b80: e1a00004 mov r0, r4
2b84: e1a01007 mov r1, r7
2b88: eb002ee9 bl e734 <strcmp>
2b8c: e3500000 cmp r0, #0
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
default_ap = ap++;
for ( ; ap->name; ap++)
2b90: e1a06005 mov r6, r5
if (strcmp(ap->name, name) == 0)
2b94: 1afffff5 bne 2b70 <rtems_assoc_ptr_by_name+0x3c>
return ap;
return default_ap;
}
2b98: e1a00006 mov r0, r6
2b9c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
default_ap = ap++;
for ( ; ap->name; ap++)
2ba0: e596400c ldr r4, [r6, #12]
)
{
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
default_ap = ap++;
2ba4: e286300c add r3, r6, #12
for ( ; ap->name; ap++)
2ba8: e3540000 cmp r4, #0
2bac: 11a08006 movne r8, r6
2bb0: 11a06003 movne r6, r3
2bb4: 1affffeb bne 2b68 <rtems_assoc_ptr_by_name+0x34>
2bb8: eafffff6 b 2b98 <rtems_assoc_ptr_by_name+0x64> <== NOT EXECUTED
2bbc: e1a06008 mov r6, r8
if (strcmp(ap->name, name) == 0)
return ap;
return default_ap;
}
2bc0: e1a00006 mov r0, r6
2bc4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
0000cc00 <rtems_deviceio_errno>:
[RTEMS_PROXY_BLOCKING] = EIO
};
int rtems_deviceio_errno(rtems_status_code sc)
{
if (sc == RTEMS_SUCCESSFUL) {
cc00: e2503000 subs r3, r0, #0
[RTEMS_IO_ERROR] = EIO,
[RTEMS_PROXY_BLOCKING] = EIO
};
int rtems_deviceio_errno(rtems_status_code sc)
{
cc04: e92d4010 push {r4, lr}
if (sc == RTEMS_SUCCESSFUL) {
cc08: 1a000001 bne cc14 <rtems_deviceio_errno+0x14>
errno = eno;
return -1;
}
}
cc0c: e1a00003 mov r0, r3
cc10: e8bd8010 pop {r4, pc}
if (sc == RTEMS_SUCCESSFUL) {
return 0;
} else {
int eno = EINVAL;
if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) {
cc14: e353001c cmp r3, #28 <== NOT EXECUTED
eno = status_code_to_errno [sc];
cc18: 959f2014 ldrls r2, [pc, #20] ; cc34 <rtems_deviceio_errno+0x34><== NOT EXECUTED
int rtems_deviceio_errno(rtems_status_code sc)
{
if (sc == RTEMS_SUCCESSFUL) {
return 0;
} else {
int eno = EINVAL;
cc1c: 83a04016 movhi r4, #22 <== NOT EXECUTED
if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) {
eno = status_code_to_errno [sc];
cc20: 97924103 ldrls r4, [r2, r3, lsl #2] <== NOT EXECUTED
}
errno = eno;
cc24: eb000008 bl cc4c <__errno> <== NOT EXECUTED
return -1;
cc28: e3e03000 mvn r3, #0 <== NOT EXECUTED
if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) {
eno = status_code_to_errno [sc];
}
errno = eno;
cc2c: e5804000 str r4, [r0] <== NOT EXECUTED
return -1;
cc30: eafffff5 b cc0c <rtems_deviceio_errno+0xc> <== NOT EXECUTED
00001f0c <rtems_filesystem_dirname>:
}
int rtems_filesystem_dirname(
const char *pathname
)
{
1f0c: e92d4030 push {r4, r5, lr}
1f10: e1a05000 mov r5, r0
int len = strlen( pathname );
1f14: eb002f3c bl dc0c <strlen>
while ( len ) {
1f18: e2504000 subs r4, r0, #0
1f1c: 1a000002 bne 1f2c <rtems_filesystem_dirname+0x20>
1f20: ea000006 b 1f40 <rtems_filesystem_dirname+0x34> <== NOT EXECUTED
1f24: e3540000 cmp r4, #0
1f28: 0a000004 beq 1f40 <rtems_filesystem_dirname+0x34>
len--;
1f2c: e2444001 sub r4, r4, #1
if ( rtems_filesystem_is_separator( pathname[len] ) )
1f30: e7d50004 ldrb r0, [r5, r4]
1f34: eb0003d0 bl 2e7c <rtems_filesystem_is_separator>
1f38: e3500000 cmp r0, #0
1f3c: 0afffff8 beq 1f24 <rtems_filesystem_dirname+0x18>
break;
}
return len;
}
1f40: e1a00004 mov r0, r4
1f44: e8bd8030 pop {r4, r5, pc}
00001e84 <rtems_filesystem_evaluate_path>:
size_t pathnamelen,
int flags,
rtems_filesystem_location_info_t *pathloc,
int follow_link
)
{
1e84: e92d40f0 push {r4, r5, r6, r7, lr}
1e88: e1a07003 mov r7, r3
1e8c: e24dd008 sub sp, sp, #8
int i = 0;
1e90: e3a03000 mov r3, #0
/*
* Verify Input parameters.
*/
if ( !pathname )
1e94: e2505000 subs r5, r0, #0
size_t pathnamelen,
int flags,
rtems_filesystem_location_info_t *pathloc,
int follow_link
)
{
1e98: e1a04001 mov r4, r1
1e9c: e1a06002 mov r6, r2
int i = 0;
1ea0: e58d3004 str r3, [sp, #4]
/*
* Verify Input parameters.
*/
if ( !pathname )
1ea4: 0a000013 beq 1ef8 <rtems_filesystem_evaluate_path+0x74>
rtems_set_errno_and_return_minus_one( EFAULT );
if ( !pathloc )
1ea8: e3570000 cmp r7, #0
1eac: 0a00000c beq 1ee4 <rtems_filesystem_evaluate_path+0x60>
/*
* Evaluate the path using the optable evalpath.
*/
rtems_filesystem_get_start_loc( pathname, &i, pathloc );
1eb0: e28d1004 add r1, sp, #4
1eb4: e1a02007 mov r2, r7
1eb8: eb0003d4 bl 2e10 <rtems_filesystem_get_start_loc>
/*
* We evaluation the path relative to the start location we get got.
*/
return rtems_filesystem_evaluate_relative_path( &pathname[i],
1ebc: e59d1004 ldr r1, [sp, #4]
1ec0: e59dc01c ldr ip, [sp, #28]
1ec4: e0850001 add r0, r5, r1
1ec8: e1a02006 mov r2, r6
1ecc: e0611004 rsb r1, r1, r4
1ed0: e1a03007 mov r3, r7
1ed4: e58dc000 str ip, [sp]
1ed8: ebffffbf bl 1ddc <rtems_filesystem_evaluate_relative_path>
pathnamelen - i,
flags,
pathloc,
follow_link );
}
1edc: e28dd008 add sp, sp, #8
1ee0: e8bd80f0 pop {r4, r5, r6, r7, pc}
if ( !pathname )
rtems_set_errno_and_return_minus_one( EFAULT );
if ( !pathloc )
rtems_set_errno_and_return_minus_one( EIO ); /* should never happen */
1ee4: eb002b58 bl cc4c <__errno> <== NOT EXECUTED
1ee8: e3a03005 mov r3, #5 <== NOT EXECUTED
1eec: e5803000 str r3, [r0] <== NOT EXECUTED
1ef0: e3e00000 mvn r0, #0 <== NOT EXECUTED
1ef4: eafffff8 b 1edc <rtems_filesystem_evaluate_path+0x58> <== NOT EXECUTED
/*
* Verify Input parameters.
*/
if ( !pathname )
rtems_set_errno_and_return_minus_one( EFAULT );
1ef8: eb002b53 bl cc4c <__errno> <== NOT EXECUTED
1efc: e3a0300e mov r3, #14 <== NOT EXECUTED
1f00: e5803000 str r3, [r0] <== NOT EXECUTED
1f04: e3e00000 mvn r0, #0 <== NOT EXECUTED
1f08: eafffff3 b 1edc <rtems_filesystem_evaluate_path+0x58> <== NOT EXECUTED
00001ddc <rtems_filesystem_evaluate_relative_path>:
/*
* Verify Input parameters.
*/
if ( !pathname )
1ddc: e3500000 cmp r0, #0
size_t pathnamelen,
int flags,
rtems_filesystem_location_info_t *pathloc,
int follow_link
)
{
1de0: e92d4030 push {r4, r5, lr}
1de4: e1a05002 mov r5, r2
1de8: e1a04003 mov r4, r3
/*
* Verify Input parameters.
*/
if ( !pathname )
1dec: 0a00001f beq 1e70 <rtems_filesystem_evaluate_relative_path+0x94>
rtems_set_errno_and_return_minus_one( EFAULT );
if ( !pathloc )
1df0: e3530000 cmp r3, #0
1df4: 0a000018 beq 1e5c <rtems_filesystem_evaluate_relative_path+0x80>
rtems_set_errno_and_return_minus_one( EIO ); /* should never happen */
result = (*pathloc->ops->evalpath_h)( pathname, pathnamelen, flags, pathloc );
1df8: e593c00c ldr ip, [r3, #12]
1dfc: e1a0e00f mov lr, pc
1e00: e59cf000 ldr pc, [ip]
/*
* Get the Node type and determine if you need to follow the link or
* not.
*/
if ( (result == 0) && follow_link ) {
1e04: e59d200c ldr r2, [sp, #12]
1e08: e2703001 rsbs r3, r0, #1
1e0c: 33a03000 movcc r3, #0
1e10: e3520000 cmp r2, #0
1e14: 03a03000 moveq r3, #0
1e18: e3530000 cmp r3, #0
1e1c: 08bd8030 popeq {r4, r5, pc}
type = (*pathloc->ops->node_type_h)( pathloc );
1e20: e594300c ldr r3, [r4, #12]
1e24: e1a00004 mov r0, r4
1e28: e1a0e00f mov lr, pc
1e2c: e593f010 ldr pc, [r3, #16]
if ( ( type == RTEMS_FILESYSTEM_HARD_LINK ) ||
1e30: e2400003 sub r0, r0, #3
1e34: e3500001 cmp r0, #1
1e38: 9a000001 bls 1e44 <rtems_filesystem_evaluate_relative_path+0x68>
1e3c: e3a00000 mov r0, #0
result = (*pathloc->ops->eval_link_h)( pathloc, flags );
}
}
return result;
}
1e40: e8bd8030 pop {r4, r5, pc}
* pathloc will be passed up (and eventually released).
* Hence, the (valid) originial node that we submit to
* eval_link_h() should be released by the handler.
*/
result = (*pathloc->ops->eval_link_h)( pathloc, flags );
1e44: e594300c ldr r3, [r4, #12]
1e48: e1a00004 mov r0, r4
1e4c: e1a01005 mov r1, r5
1e50: e1a0e00f mov lr, pc
1e54: e593f034 ldr pc, [r3, #52] ; 0x34
1e58: e8bd8030 pop {r4, r5, pc}
if ( !pathname )
rtems_set_errno_and_return_minus_one( EFAULT );
if ( !pathloc )
rtems_set_errno_and_return_minus_one( EIO ); /* should never happen */
1e5c: eb002b7a bl cc4c <__errno> <== NOT EXECUTED
1e60: e3a03005 mov r3, #5 <== NOT EXECUTED
1e64: e5803000 str r3, [r0] <== NOT EXECUTED
1e68: e3e00000 mvn r0, #0 <== NOT EXECUTED
1e6c: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
/*
* Verify Input parameters.
*/
if ( !pathname )
rtems_set_errno_and_return_minus_one( EFAULT );
1e70: eb002b75 bl cc4c <__errno> <== NOT EXECUTED
1e74: e3a0300e mov r3, #14 <== NOT EXECUTED
1e78: e5803000 str r3, [r0] <== NOT EXECUTED
1e7c: e3e00000 mvn r0, #0 <== NOT EXECUTED
1e80: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
00001c70 <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 )
{
1c70: e92d40f0 push {r4, r5, r6, r7, lr}
/*
* mount the first filesystem.
*/
if ( rtems_filesystem_mount_table_size == 0 )
1c74: e59f2104 ldr r2, [pc, #260] ; 1d80 <rtems_filesystem_initialize+0x110>
/*
* Set the default umask to "022".
*/
rtems_filesystem_umask = 022;
1c78: e59f6104 ldr r6, [pc, #260] ; 1d84 <rtems_filesystem_initialize+0x114>
/*
* mount the first filesystem.
*/
if ( rtems_filesystem_mount_table_size == 0 )
1c7c: e5922000 ldr r2, [r2]
/*
* Set the default umask to "022".
*/
rtems_filesystem_umask = 022;
1c80: e5963000 ldr r3, [r6]
/*
* mount the first filesystem.
*/
if ( rtems_filesystem_mount_table_size == 0 )
1c84: e3520000 cmp r2, #0
/*
* Set the default umask to "022".
*/
rtems_filesystem_umask = 022;
1c88: e3a02012 mov r2, #18
* configuration is a single instantiation of the IMFS or miniIMFS with
* a single "/dev" directory in it.
*/
void rtems_filesystem_initialize( void )
{
1c8c: e24dd018 sub sp, sp, #24
/*
* Set the default umask to "022".
*/
rtems_filesystem_umask = 022;
1c90: e583202c str r2, [r3, #44] ; 0x2c
/*
* mount the first filesystem.
*/
if ( rtems_filesystem_mount_table_size == 0 )
1c94: 0a00002d beq 1d50 <rtems_filesystem_initialize+0xe0>
rtems_fatal_error_occurred( 0xABCD0001 );
mt = &rtems_filesystem_mount_table[0];
1c98: e59f30e8 ldr r3, [pc, #232] ; 1d88 <rtems_filesystem_initialize+0x118>
1c9c: e5933000 ldr r3, [r3]
status = mount( mt->device, mt->mount_point, mt->type, mt->fsoptions, NULL );
1ca0: e3a05000 mov r5, #0
1ca4: e2830008 add r0, r3, #8
1ca8: e8900003 ldm r0, {r0, r1}
1cac: e893000c ldm r3, {r2, r3}
1cb0: e58d5000 str r5, [sp]
1cb4: eb000229 bl 2560 <mount>
if ( status == -1 )
1cb8: e3700001 cmn r0, #1
1cbc: 0a00002b beq 1d70 <rtems_filesystem_initialize+0x100>
rtems_fatal_error_occurred( 0xABCD0002 );
rtems_filesystem_link_counts = 0;
1cc0: e5963000 ldr r3, [r6]
* gonna hit performance.
*
* Till Straumann, 10/25/2002
*/
/* Clone the root pathloc */
rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0);
1cc4: 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;
1cc8: 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);
1ccc: e3a01001 mov r1, #1
1cd0: e1a03004 mov r3, r4
1cd4: e1a02005 mov r2, r5
1cd8: e59f00ac ldr r0, [pc, #172] ; 1d8c <rtems_filesystem_initialize+0x11c>
rtems_filesystem_root = loc;
1cdc: e1a07004 mov r7, r4
* gonna hit performance.
*
* Till Straumann, 10/25/2002
*/
/* Clone the root pathloc */
rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0);
1ce0: e58d5000 str r5, [sp]
1ce4: eb000066 bl 1e84 <rtems_filesystem_evaluate_path>
rtems_filesystem_root = loc;
1ce8: e596c000 ldr ip, [r6]
1cec: e8b7000f ldm r7!, {r0, r1, r2, r3}
1cf0: e28cc018 add ip, ip, #24
1cf4: e8ac000f stmia ip!, {r0, r1, r2, r3}
1cf8: e5973000 ldr r3, [r7]
/* One more clone for the current node */
rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0);
1cfc: 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;
1d00: e58c3000 str r3, [ip]
/* One more clone for the current node */
rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0);
1d04: e1a02005 mov r2, r5
1d08: e1a03004 mov r3, r4
1d0c: e59f0078 ldr r0, [pc, #120] ; 1d8c <rtems_filesystem_initialize+0x11c>
1d10: e58d5000 str r5, [sp]
1d14: eb00005a bl 1e84 <rtems_filesystem_evaluate_path>
rtems_filesystem_current = loc;
1d18: e596c000 ldr ip, [r6]
1d1c: e8b4000f ldm r4!, {r0, r1, r2, r3}
1d20: e28cc004 add ip, ip, #4
1d24: e8ac000f stmia ip!, {r0, r1, r2, r3}
1d28: 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);
1d2c: e3a01f7f mov r1, #508 ; 0x1fc
/* 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;
1d30: 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);
1d34: e59f0054 ldr r0, [pc, #84] ; 1d90 <rtems_filesystem_initialize+0x120>
1d38: e2811003 add r1, r1, #3
1d3c: eb0001b7 bl 2420 <mkdir>
if ( status != 0 )
1d40: e3500000 cmp r0, #0
1d44: 1a000005 bne 1d60 <rtems_filesystem_initialize+0xf0>
* 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.
*/
}
1d48: e28dd018 add sp, sp, #24
1d4c: e8bd80f0 pop {r4, r5, r6, r7, pc}
/*
* mount the first filesystem.
*/
if ( rtems_filesystem_mount_table_size == 0 )
rtems_fatal_error_occurred( 0xABCD0001 );
1d50: e3a004ab mov r0, #-1426063360 ; 0xab000000 <== NOT EXECUTED
1d54: e28008cd add r0, r0, #13434880 ; 0xcd0000 <== NOT EXECUTED
1d58: e2800001 add r0, r0, #1 <== NOT EXECUTED
1d5c: eb000fde bl 5cdc <rtems_fatal_error_occurred> <== NOT EXECUTED
* created that way by the IMFS.
*/
status = mkdir( "/dev", 0777);
if ( status != 0 )
rtems_fatal_error_occurred( 0xABCD0003 );
1d60: e3a004ab mov r0, #-1426063360 ; 0xab000000 <== NOT EXECUTED
1d64: e28008cd add r0, r0, #13434880 ; 0xcd0000 <== NOT EXECUTED
1d68: e2800003 add r0, r0, #3 <== NOT EXECUTED
1d6c: eb000fda bl 5cdc <rtems_fatal_error_occurred> <== NOT EXECUTED
mt = &rtems_filesystem_mount_table[0];
status = mount( mt->device, mt->mount_point, mt->type, mt->fsoptions, NULL );
if ( status == -1 )
rtems_fatal_error_occurred( 0xABCD0002 );
1d70: e3a004ab mov r0, #-1426063360 ; 0xab000000 <== NOT EXECUTED
1d74: e28008cd add r0, r0, #13434880 ; 0xcd0000 <== NOT EXECUTED
1d78: e2800002 add r0, r0, #2 <== NOT EXECUTED
1d7c: eb000fd6 bl 5cdc <rtems_fatal_error_occurred> <== NOT EXECUTED
0000a2bc <rtems_filesystem_iterate>:
bool rtems_filesystem_iterate(
rtems_per_filesystem_routine routine,
void *routine_arg
)
{
a2bc: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0];
rtems_chain_node *node = NULL;
bool stop = false;
while ( table_entry->type && !stop ) {
a2c0: e59f60ac ldr r6, [pc, #172] ; a374 <rtems_filesystem_iterate+0xb8>
a2c4: e5963000 ldr r3, [r6]
a2c8: e3530000 cmp r3, #0
bool rtems_filesystem_iterate(
rtems_per_filesystem_routine routine,
void *routine_arg
)
{
a2cc: e1a04000 mov r4, r0
a2d0: e1a05001 mov r5, r1
const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0];
rtems_chain_node *node = NULL;
bool stop = false;
while ( table_entry->type && !stop ) {
a2d4: 1a000003 bne a2e8 <rtems_filesystem_iterate+0x2c>
a2d8: ea00000c b a310 <rtems_filesystem_iterate+0x54> <== NOT EXECUTED
a2dc: e3500000 cmp r0, #0 <== NOT EXECUTED
a2e0: e2866008 add r6, r6, #8 <== NOT EXECUTED
a2e4: 1a000020 bne a36c <rtems_filesystem_iterate+0xb0> <== NOT EXECUTED
stop = (*routine)( table_entry, routine_arg );
a2e8: e1a00006 mov r0, r6
a2ec: e1a01005 mov r1, r5
a2f0: e1a0e00f mov lr, pc
a2f4: e12fff14 bx r4
{
const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0];
rtems_chain_node *node = NULL;
bool stop = false;
while ( table_entry->type && !stop ) {
a2f8: e5963008 ldr r3, [r6, #8]
a2fc: e3530000 cmp r3, #0
stop = (*routine)( table_entry, routine_arg );
a300: e1a0a000 mov sl, r0
{
const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0];
rtems_chain_node *node = NULL;
bool stop = false;
while ( table_entry->type && !stop ) {
a304: 1afffff4 bne a2dc <rtems_filesystem_iterate+0x20>
stop = (*routine)( table_entry, routine_arg );
++table_entry;
}
if ( !stop ) {
a308: e3500000 cmp r0, #0
a30c: 1a000016 bne a36c <rtems_filesystem_iterate+0xb0>
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 );
a310: e59f7060 ldr r7, [pc, #96] ; a378 <rtems_filesystem_iterate+0xbc>
a314: e3a01000 mov r1, #0
}
}
rtems_libio_unlock();
rtems_set_errno_and_return_minus_one( ENOENT );
}
a318: e59f605c ldr r6, [pc, #92] ; a37c <rtems_filesystem_iterate+0xc0>
a31c: e5970000 ldr r0, [r7]
a320: e1a02001 mov r2, r1
a324: ebffecc9 bl 5650 <rtems_semaphore_obtain>
a328: e4968004 ldr r8, [r6], #4
++table_entry;
}
if ( !stop ) {
rtems_libio_lock();
for (
a32c: e1580006 cmp r8, r6
a330: 03a0a000 moveq sl, #0
a334: 1a000002 bne a344 <rtems_filesystem_iterate+0x88>
a338: ea000009 b a364 <rtems_filesystem_iterate+0xa8>
node = rtems_chain_first( &filesystem_chain );
!rtems_chain_is_tail( &filesystem_chain, node ) && !stop;
a33c: e3500000 cmp r0, #0
a340: 1a000007 bne a364 <rtems_filesystem_iterate+0xa8>
node = rtems_chain_next( node )
) {
const filesystem_node *fsn = (filesystem_node *) node;
stop = (*routine)( &fsn->entry, routine_arg );
a344: e2880008 add r0, r8, #8
a348: e1a01005 mov r1, r5
a34c: e1a0e00f mov lr, pc
a350: e12fff14 bx r4
}
}
rtems_libio_unlock();
rtems_set_errno_and_return_minus_one( ENOENT );
}
a354: e5988000 ldr r8, [r8]
++table_entry;
}
if ( !stop ) {
rtems_libio_lock();
for (
a358: e1580006 cmp r8, r6
!rtems_chain_is_tail( &filesystem_chain, node ) && !stop;
node = rtems_chain_next( node )
) {
const filesystem_node *fsn = (filesystem_node *) node;
stop = (*routine)( &fsn->entry, routine_arg );
a35c: e1a0a000 mov sl, r0
++table_entry;
}
if ( !stop ) {
rtems_libio_lock();
for (
a360: 1afffff5 bne a33c <rtems_filesystem_iterate+0x80>
}
static inline void rtems_libio_unlock( void )
{
rtems_semaphore_release( rtems_libio_semaphore );
a364: e5970000 ldr r0, [r7]
a368: ebffed01 bl 5774 <rtems_semaphore_release>
}
rtems_libio_unlock();
}
return stop;
}
a36c: e1a0000a mov r0, sl
a370: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
000024e8 <rtems_filesystem_mount_iterate>:
bool rtems_filesystem_mount_iterate(
rtems_per_filesystem_mount_routine routine,
void *routine_arg
)
{
24e8: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
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 );
24ec: e59f7064 ldr r7, [pc, #100] ; 2558 <rtems_filesystem_mount_iterate+0x70>
stop = (*routine)( mt_entry, routine_arg );
}
rtems_libio_unlock();
return stop;
}
24f0: e59f4064 ldr r4, [pc, #100] ; 255c <rtems_filesystem_mount_iterate+0x74>
bool rtems_filesystem_mount_iterate(
rtems_per_filesystem_mount_routine routine,
void *routine_arg
)
{
24f4: e1a06001 mov r6, r1
24f8: e3a01000 mov r1, #0
24fc: e1a05000 mov r5, r0
2500: e1a02001 mov r2, r1
2504: e5970000 ldr r0, [r7]
2508: eb000c50 bl 5650 <rtems_semaphore_obtain>
stop = (*routine)( mt_entry, routine_arg );
}
rtems_libio_unlock();
return stop;
}
250c: e4948004 ldr r8, [r4], #4
{
rtems_chain_node *node = NULL;
bool stop = false;
rtems_libio_lock();
for (
2510: e1580004 cmp r8, r4
rtems_per_filesystem_mount_routine routine,
void *routine_arg
)
{
rtems_chain_node *node = NULL;
bool stop = false;
2514: 03a0a000 moveq sl, #0
rtems_libio_lock();
for (
2518: 1a000002 bne 2528 <rtems_filesystem_mount_iterate+0x40>
251c: ea000009 b 2548 <rtems_filesystem_mount_iterate+0x60> <== NOT EXECUTED
node = rtems_chain_first( &mount_chain );
!rtems_chain_is_tail( &mount_chain, node ) && !stop;
2520: e3500000 cmp r0, #0
2524: 1a000007 bne 2548 <rtems_filesystem_mount_iterate+0x60>
node = rtems_chain_next( node )
) {
const rtems_filesystem_mount_table_entry_t *mt_entry =
(rtems_filesystem_mount_table_entry_t *) node;
stop = (*routine)( mt_entry, routine_arg );
2528: e1a00008 mov r0, r8
252c: e1a01006 mov r1, r6
2530: e1a0e00f mov lr, pc
2534: e12fff15 bx r5
}
rtems_libio_unlock();
return stop;
}
2538: e5988000 ldr r8, [r8]
{
rtems_chain_node *node = NULL;
bool stop = false;
rtems_libio_lock();
for (
253c: e1580004 cmp r8, r4
node = rtems_chain_next( node )
) {
const rtems_filesystem_mount_table_entry_t *mt_entry =
(rtems_filesystem_mount_table_entry_t *) node;
stop = (*routine)( mt_entry, routine_arg );
2540: e1a0a000 mov sl, r0
{
rtems_chain_node *node = NULL;
bool stop = false;
rtems_libio_lock();
for (
2544: 1afffff5 bne 2520 <rtems_filesystem_mount_iterate+0x38>
}
static inline void rtems_libio_unlock( void )
{
rtems_semaphore_release( rtems_libio_semaphore );
2548: e5970000 ldr r0, [r7]
254c: eb000c88 bl 5774 <rtems_semaphore_release>
stop = (*routine)( mt_entry, routine_arg );
}
rtems_libio_unlock();
return stop;
}
2550: e1a0000a mov r0, sl
2554: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
00001f48 <rtems_filesystem_prefix_separators>:
int rtems_filesystem_prefix_separators(
const char *pathname,
int pathnamelen
)
{
1f48: e92d4070 push {r4, r5, r6, lr}
1f4c: e1a06000 mov r6, r0
/*
* Eat any separators at start of the path.
*/
int stripped = 0;
while ( *pathname && pathnamelen && rtems_filesystem_is_separator( *pathname ) )
1f50: e5d00000 ldrb r0, [r0]
1f54: e3510000 cmp r1, #0
1f58: 13500000 cmpne r0, #0
1f5c: 03a05000 moveq r5, #0
1f60: 13a05001 movne r5, #1
1f64: e1a04001 mov r4, r1
)
{
/*
* Eat any separators at start of the path.
*/
int stripped = 0;
1f68: 13a05000 movne r5, #0
while ( *pathname && pathnamelen && rtems_filesystem_is_separator( *pathname ) )
1f6c: 1a00000a bne 1f9c <rtems_filesystem_prefix_separators+0x54>
1f70: ea00000c b 1fa8 <rtems_filesystem_prefix_separators+0x60> <== NOT EXECUTED
1f74: e2544001 subs r4, r4, #1
1f78: e5f60001 ldrb r0, [r6, #1]!
1f7c: 03a03000 moveq r3, #0
1f80: 13a03001 movne r3, #1
1f84: e3500000 cmp r0, #0
1f88: 03a03000 moveq r3, #0
1f8c: 12033001 andne r3, r3, #1
1f90: e3530000 cmp r3, #0
{
pathname++;
pathnamelen--;
stripped++;
1f94: e2855001 add r5, r5, #1
{
/*
* Eat any separators at start of the path.
*/
int stripped = 0;
while ( *pathname && pathnamelen && rtems_filesystem_is_separator( *pathname ) )
1f98: 0a000002 beq 1fa8 <rtems_filesystem_prefix_separators+0x60>
1f9c: eb0003b6 bl 2e7c <rtems_filesystem_is_separator>
1fa0: e3500000 cmp r0, #0
1fa4: 1afffff2 bne 1f74 <rtems_filesystem_prefix_separators+0x2c>
pathname++;
pathnamelen--;
stripped++;
}
return stripped;
}
1fa8: e1a00005 mov r0, r5
1fac: e8bd8070 pop {r4, r5, r6, pc}
0000296c <rtems_gxx_getspecific>:
void *rtems_gxx_getspecific(__gthread_key_t key)
{
296c: e92d4030 push {r4, r5, lr}
2970: e24dd004 sub sp, sp, #4
rtems_status_code status;
void *p= 0;
2974: e3a05000 mov r5, #0
2978: e28d2004 add r2, sp, #4
297c: e5225004 str r5, [r2, #-4]!
}
return 0;
}
void *rtems_gxx_getspecific(__gthread_key_t key)
{
2980: e1a04000 mov r4, r0
rtems_status_code status;
void *p= 0;
/* register with RTEMS the buffer that will hold the key values */
status = rtems_task_variable_get( RTEMS_SELF, (void **)key, &p );
2984: e1a01000 mov r1, r0
2988: e1a0200d mov r2, sp
298c: e1a00005 mov r0, r5
2990: eb000f78 bl 6778 <rtems_task_variable_get>
if ( status == RTEMS_SUCCESSFUL ) {
2994: e1500005 cmp r0, r5
/* We do not have to do this, but what the heck ! */
p= key->val;
2998: 05940000 ldreq r0, [r4]
rtems_status_code status;
void *p= 0;
/* register with RTEMS the buffer that will hold the key values */
status = rtems_task_variable_get( RTEMS_SELF, (void **)key, &p );
if ( status == RTEMS_SUCCESSFUL ) {
299c: 1a000001 bne 29a8 <rtems_gxx_getspecific+0x3c>
p,
rtems_task_self()
);
#endif
return p;
}
29a0: e28dd004 add sp, sp, #4
29a4: e8bd8030 pop {r4, r5, pc}
p= key->val;
} else {
/* fisrt time, always set to zero, it is unknown the value that the others
* threads are using at the moment of this call
*/
status = rtems_task_variable_add( RTEMS_SELF, (void **)key, key->dtor );
29a8: e1a00005 mov r0, r5 <== NOT EXECUTED
29ac: e1a01004 mov r1, r4 <== NOT EXECUTED
29b0: e5942004 ldr r2, [r4, #4] <== NOT EXECUTED
29b4: eb000f1c bl 662c <rtems_task_variable_add> <== NOT EXECUTED
if ( status != RTEMS_SUCCESSFUL ) {
29b8: e3500000 cmp r0, #0 <== NOT EXECUTED
rtems_panic ("rtems_gxx_getspecific");
}
key->val = (void *)0;
29bc: 05840000 streq r0, [r4] <== NOT EXECUTED
29c0: 059d0000 ldreq r0, [sp] <== NOT EXECUTED
29c4: 0afffff5 beq 29a0 <rtems_gxx_getspecific+0x34> <== NOT EXECUTED
/* fisrt time, always set to zero, it is unknown the value that the others
* threads are using at the moment of this call
*/
status = rtems_task_variable_add( RTEMS_SELF, (void **)key, key->dtor );
if ( status != RTEMS_SUCCESSFUL ) {
rtems_panic ("rtems_gxx_getspecific");
29c8: e59f0000 ldr r0, [pc, #0] ; 29d0 <rtems_gxx_getspecific+0x64><== NOT EXECUTED
29cc: eb0020d2 bl ad1c <rtems_panic> <== NOT EXECUTED
0000292c <rtems_gxx_key_dtor>:
{
#ifdef DEBUG_GXX_WRAPPERS
printk( "gxx_wrappers: dtor key=%x, ptr=%x\n", key, ptr );
#endif
key->val = 0;
292c: e3a03000 mov r3, #0 <== NOT EXECUTED
2930: e5803000 str r3, [r0] <== NOT EXECUTED
return 0;
}
2934: e1a00003 mov r0, r3 <== NOT EXECUTED
2938: e12fff1e bx lr <== NOT EXECUTED
00002a60 <rtems_gxx_mutex_destroy>:
int rtems_gxx_mutex_destroy (__gthread_mutex_t *mutex)
{
2a60: e52de004 push {lr} ; (str lr, [sp, #-4]!) <== NOT EXECUTED
#ifdef DEBUG_GXX_WRAPPERS
printk( "gxx_wrappers: destroy mutex=%X\n", *mutex );
#endif
status = rtems_semaphore_delete(*(rtems_id *)mutex);
2a64: e5900000 ldr r0, [r0] <== NOT EXECUTED
2a68: eb000d47 bl 5f8c <rtems_semaphore_delete> <== NOT EXECUTED
if ( status == RTEMS_SUCCESSFUL )
2a6c: e3500000 cmp r0, #0 <== NOT EXECUTED
return 0;
return -1;
}
2a70: 13e00000 mvnne r0, #0 <== NOT EXECUTED
2a74: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
00002a00 <rtems_gxx_mutex_init>:
/*
* MUTEX support
*/
void rtems_gxx_mutex_init (__gthread_mutex_t *mutex)
{
2a00: e52de004 push {lr} ; (str lr, [sp, #-4]!)
2a04: e24dd004 sub sp, sp, #4
#ifdef DEBUG_GXX_WRAPPERS
printk( "gxx_wrappers: mutex init =%X\n", *mutex );
#endif
status = rtems_semaphore_create(
2a08: e58d0000 str r0, [sp]
2a0c: e3a01001 mov r1, #1
2a10: e59f0020 ldr r0, [pc, #32] ; 2a38 <rtems_gxx_mutex_init+0x38>
2a14: e3a02054 mov r2, #84 ; 0x54
2a18: e3a03000 mov r3, #0
2a1c: eb000ce9 bl 5dc8 <rtems_semaphore_create>
RTEMS_PRIORITY|RTEMS_BINARY_SEMAPHORE|
RTEMS_INHERIT_PRIORITY|RTEMS_NO_PRIORITY_CEILING|RTEMS_LOCAL,
0,
(rtems_id *)mutex
);
if ( status != RTEMS_SUCCESSFUL ) {
2a20: e3500000 cmp r0, #0
2a24: 1a000001 bne 2a30 <rtems_gxx_mutex_init+0x30>
rtems_panic ("rtems_gxx_mutex_init");
}
#ifdef DEBUG_GXX_WRAPPERS
printk( "gxx_wrappers: mutex init complete =%X\n", *mutex );
#endif
}
2a28: e28dd004 add sp, sp, #4
2a2c: e8bd8000 pop {pc}
"gxx_wrappers: mutex init failed %s (%d)\n",
rtems_status_text(status),
status
);
#endif
rtems_panic ("rtems_gxx_mutex_init");
2a30: e59f0004 ldr r0, [pc, #4] ; 2a3c <rtems_gxx_mutex_init+0x3c><== NOT EXECUTED
2a34: eb0020b8 bl ad1c <rtems_panic> <== NOT EXECUTED
00002868 <rtems_gxx_once>:
typedef int __gthread_once_t;
typedef void *__gthread_mutex_t;
typedef void *__gthread_recursive_mutex_t;
int rtems_gxx_once(__gthread_once_t *once, void (*func) (void))
{
2868: e92d4070 push {r4, r5, r6, lr}
#ifdef DEBUG_GXX_WRAPPERS
printk( "gxx_wrappers: once=%x, func=%x\n", *once, func );
#endif
if ( *(volatile __gthread_once_t *)once == 0 ) {
286c: e5903000 ldr r3, [r0]
2870: e3530000 cmp r3, #0
typedef int __gthread_once_t;
typedef void *__gthread_mutex_t;
typedef void *__gthread_recursive_mutex_t;
int rtems_gxx_once(__gthread_once_t *once, void (*func) (void))
{
2874: e24dd004 sub sp, sp, #4
2878: e1a04000 mov r4, r0
287c: e1a05001 mov r5, r1
#ifdef DEBUG_GXX_WRAPPERS
printk( "gxx_wrappers: once=%x, func=%x\n", *once, func );
#endif
if ( *(volatile __gthread_once_t *)once == 0 ) {
2880: 0a000002 beq 2890 <rtems_gxx_once+0x28>
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
if ( o == 0 )
(*func)();
}
return 0;
}
2884: e3a00000 mov r0, #0
2888: e28dd004 add sp, sp, #4
288c: e8bd8070 pop {r4, r5, r6, pc}
if ( *(volatile __gthread_once_t *)once == 0 ) {
rtems_mode saveMode;
__gthread_once_t o;
rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode);
2890: e3a00c01 mov r0, #256 ; 0x100
2894: e1a01000 mov r1, r0
2898: e1a0200d mov r2, sp
289c: eb000ee9 bl 6448 <rtems_task_mode>
if ( (o = *(volatile __gthread_once_t *)once) == 0 ) {
28a0: e5943000 ldr r3, [r4]
28a4: e3530000 cmp r3, #0
if ( *(volatile __gthread_once_t *)once == 0 ) {
rtems_mode saveMode;
__gthread_once_t o;
rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode);
28a8: e1a0600d mov r6, sp
if ( (o = *(volatile __gthread_once_t *)once) == 0 ) {
28ac: 1a000008 bne 28d4 <rtems_gxx_once+0x6c>
*(volatile __gthread_once_t *)once = 1;
28b0: e3a03001 mov r3, #1
28b4: e5843000 str r3, [r4]
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
28b8: e3a01c01 mov r1, #256 ; 0x100
28bc: e1a0200d mov r2, sp
28c0: e59d0000 ldr r0, [sp]
28c4: eb000edf bl 6448 <rtems_task_mode>
if ( o == 0 )
(*func)();
28c8: e1a0e00f mov lr, pc
28cc: e12fff15 bx r5
28d0: eaffffeb b 2884 <rtems_gxx_once+0x1c>
rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode);
if ( (o = *(volatile __gthread_once_t *)once) == 0 ) {
*(volatile __gthread_once_t *)once = 1;
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
28d4: e59d0000 ldr r0, [sp] <== NOT EXECUTED
28d8: e3a01c01 mov r1, #256 ; 0x100 <== NOT EXECUTED
28dc: e1a0200d mov r2, sp <== NOT EXECUTED
28e0: eb000ed8 bl 6448 <rtems_task_mode> <== NOT EXECUTED
28e4: eaffffe6 b 2884 <rtems_gxx_once+0x1c> <== NOT EXECUTED
00007000 <rtems_io_register_driver>:
rtems_device_major_number *registered_major
)
{
rtems_device_major_number major_limit = _IO_Number_of_drivers;
if ( rtems_interrupt_is_in_progress() )
7000: e59f3150 ldr r3, [pc, #336] ; 7158 <rtems_io_register_driver+0x158>
7004: e593c000 ldr ip, [r3]
rtems_device_major_number major,
const rtems_driver_address_table *driver_table,
rtems_device_major_number *registered_major
)
{
rtems_device_major_number major_limit = _IO_Number_of_drivers;
7008: e59f314c ldr r3, [pc, #332] ; 715c <rtems_io_register_driver+0x15c>
if ( rtems_interrupt_is_in_progress() )
700c: e35c0000 cmp ip, #0
rtems_status_code rtems_io_register_driver(
rtems_device_major_number major,
const rtems_driver_address_table *driver_table,
rtems_device_major_number *registered_major
)
{
7010: e92d4030 push {r4, r5, lr}
7014: e1a04000 mov r4, r0
rtems_device_major_number major_limit = _IO_Number_of_drivers;
7018: e5930000 ldr r0, [r3]
if ( rtems_interrupt_is_in_progress() )
return RTEMS_CALLED_FROM_ISR;
701c: 13a00012 movne r0, #18
rtems_device_major_number *registered_major
)
{
rtems_device_major_number major_limit = _IO_Number_of_drivers;
if ( rtems_interrupt_is_in_progress() )
7020: 18bd8030 popne {r4, r5, pc}
return RTEMS_CALLED_FROM_ISR;
if ( registered_major == NULL )
7024: e3520000 cmp r2, #0
7028: 0a00003f beq 712c <rtems_io_register_driver+0x12c>
return RTEMS_INVALID_ADDRESS;
/* Set it to an invalid value */
*registered_major = major_limit;
if ( driver_table == NULL )
702c: e3510000 cmp r1, #0
if ( registered_major == NULL )
return RTEMS_INVALID_ADDRESS;
/* Set it to an invalid value */
*registered_major = major_limit;
7030: e5820000 str r0, [r2]
if ( driver_table == NULL )
7034: 0a00003c beq 712c <rtems_io_register_driver+0x12c>
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
7038: e591c000 ldr ip, [r1]
703c: e35c0000 cmp ip, #0
7040: 0a000036 beq 7120 <rtems_io_register_driver+0x120>
return RTEMS_INVALID_ADDRESS;
if ( rtems_io_is_empty_table( driver_table ) )
return RTEMS_INVALID_ADDRESS;
if ( major >= major_limit )
7044: e1500004 cmp r0, r4
7048: 9a000027 bls 70ec <rtems_io_register_driver+0xec>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
704c: e59f010c ldr r0, [pc, #268] ; 7160 <rtems_io_register_driver+0x160>
7050: e590c000 ldr ip, [r0]
7054: e28cc001 add ip, ip, #1
7058: e580c000 str ip, [r0]
return RTEMS_INVALID_NUMBER;
_Thread_Disable_dispatch();
if ( major == 0 ) {
705c: e3540000 cmp r4, #0
7060: 1a000023 bne 70f4 <rtems_io_register_driver+0xf4>
static rtems_status_code rtems_io_obtain_major_number(
rtems_device_major_number *major
)
{
rtems_device_major_number n = _IO_Number_of_drivers;
7064: e593c000 ldr ip, [r3]
rtems_device_major_number m = 0;
/* major is error checked by caller */
for ( m = 0; m < n; ++m ) {
7068: e35c0000 cmp ip, #0
706c: 0a000030 beq 7134 <rtems_io_register_driver+0x134>
7070: e59fe0ec ldr lr, [pc, #236] ; 7164 <rtems_io_register_driver+0x164>
7074: e59e3000 ldr r3, [lr]
7078: ea000003 b 708c <rtems_io_register_driver+0x8c>
707c: e2844001 add r4, r4, #1
7080: e15c0004 cmp ip, r4
7084: e2833018 add r3, r3, #24
7088: 9a000005 bls 70a4 <rtems_io_register_driver+0xa4>
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
708c: e5930000 ldr r0, [r3]
7090: e3500000 cmp r0, #0
7094: 1afffff8 bne 707c <rtems_io_register_driver+0x7c>
7098: e5930004 ldr r0, [r3, #4]
709c: e3500000 cmp r0, #0
70a0: 1afffff5 bne 707c <rtems_io_register_driver+0x7c>
}
/* Assigns invalid value in case of failure */
*major = m;
if ( m != n )
70a4: e15c0004 cmp ip, r4
70a8: 1084c084 addne ip, r4, r4, lsl #1
if ( rtems_io_is_empty_table( table ) )
break;
}
/* Assigns invalid value in case of failure */
*major = m;
70ac: e5824000 str r4, [r2]
if ( m != n )
70b0: 11a0c18c lslne ip, ip, #3
70b4: 0a00001f beq 7138 <rtems_io_register_driver+0x138>
}
*registered_major = major;
}
_IO_Driver_address_table [major] = *driver_table;
70b8: e59e5000 ldr r5, [lr]
70bc: e1a0e001 mov lr, r1
70c0: e8be000f ldm lr!, {r0, r1, r2, r3}
70c4: e085c00c add ip, r5, ip
70c8: e8ac000f stmia ip!, {r0, r1, r2, r3}
70cc: e89e0003 ldm lr, {r0, r1}
70d0: e88c0003 stm ip, {r0, r1}
_Thread_Enable_dispatch();
70d4: eb000687 bl 8af8 <_Thread_Enable_dispatch>
return rtems_io_initialize( major, 0, NULL );
70d8: e3a01000 mov r1, #0
70dc: e1a00004 mov r0, r4
70e0: e1a02001 mov r2, r1
}
70e4: e8bd4030 pop {r4, r5, lr}
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
70e8: ea001eb0 b ebb0 <rtems_io_initialize>
if ( rtems_io_is_empty_table( driver_table ) )
return RTEMS_INVALID_ADDRESS;
if ( major >= major_limit )
return RTEMS_INVALID_NUMBER;
70ec: e3a0000a mov r0, #10
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
}
70f0: e8bd8030 pop {r4, r5, pc}
_Thread_Enable_dispatch();
return sc;
}
major = *registered_major;
} else {
rtems_driver_address_table *const table = _IO_Driver_address_table + major;
70f4: e59fe068 ldr lr, [pc, #104] ; 7164 <rtems_io_register_driver+0x164>
70f8: e59e3000 ldr r3, [lr]
70fc: e084c084 add ip, r4, r4, lsl #1
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
7100: e793018c ldr r0, [r3, ip, lsl #3]
_Thread_Enable_dispatch();
return sc;
}
major = *registered_major;
} else {
rtems_driver_address_table *const table = _IO_Driver_address_table + major;
7104: e1a0c18c lsl ip, ip, #3
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
7108: e3500000 cmp r0, #0
_Thread_Enable_dispatch();
return sc;
}
major = *registered_major;
} else {
rtems_driver_address_table *const table = _IO_Driver_address_table + major;
710c: e083300c add r3, r3, ip
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
7110: 0a00000b beq 7144 <rtems_io_register_driver+0x144>
major = *registered_major;
} else {
rtems_driver_address_table *const table = _IO_Driver_address_table + major;
if ( !rtems_io_is_empty_table( table ) ) {
_Thread_Enable_dispatch();
7114: eb000677 bl 8af8 <_Thread_Enable_dispatch>
return RTEMS_RESOURCE_IN_USE;
7118: e3a0000c mov r0, #12
711c: e8bd8030 pop {r4, r5, pc}
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
7120: e591c004 ldr ip, [r1, #4]
7124: e35c0000 cmp ip, #0
7128: 1affffc5 bne 7044 <rtems_io_register_driver+0x44>
if ( driver_table == NULL )
return RTEMS_INVALID_ADDRESS;
if ( rtems_io_is_empty_table( driver_table ) )
return RTEMS_INVALID_ADDRESS;
712c: e3a00009 mov r0, #9
7130: e8bd8030 pop {r4, r5, pc}
if ( rtems_io_is_empty_table( table ) )
break;
}
/* Assigns invalid value in case of failure */
*major = m;
7134: e5824000 str r4, [r2] <== NOT EXECUTED
if ( major == 0 ) {
rtems_status_code sc = rtems_io_obtain_major_number( registered_major );
if ( sc != RTEMS_SUCCESSFUL ) {
_Thread_Enable_dispatch();
7138: eb00066e bl 8af8 <_Thread_Enable_dispatch>
*major = m;
if ( m != n )
return RTEMS_SUCCESSFUL;
return RTEMS_TOO_MANY;
713c: e3a00005 mov r0, #5
if ( major == 0 ) {
rtems_status_code sc = rtems_io_obtain_major_number( registered_major );
if ( sc != RTEMS_SUCCESSFUL ) {
_Thread_Enable_dispatch();
return sc;
7140: e8bd8030 pop {r4, r5, pc}
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
7144: e5933004 ldr r3, [r3, #4]
7148: e3530000 cmp r3, #0
714c: 1afffff0 bne 7114 <rtems_io_register_driver+0x114>
if ( !rtems_io_is_empty_table( table ) ) {
_Thread_Enable_dispatch();
return RTEMS_RESOURCE_IN_USE;
}
*registered_major = major;
7150: e5824000 str r4, [r2]
7154: eaffffd7 b 70b8 <rtems_io_register_driver+0xb8>
000020e0 <rtems_libio_init>:
*
* Called by BSP startup code to initialize the libio subsystem.
*/
void rtems_libio_init( void )
{
20e0: e92d4010 push {r4, lr}
rtems_status_code rc;
uint32_t i;
rtems_libio_t *iop;
if (rtems_libio_number_iops > 0)
20e4: e59f30b8 ldr r3, [pc, #184] ; 21a4 <rtems_libio_init+0xc4>
20e8: e5934000 ldr r4, [r3]
20ec: e3540000 cmp r4, #0
*
* Called by BSP startup code to initialize the libio subsystem.
*/
void rtems_libio_init( void )
{
20f0: e24dd004 sub sp, sp, #4
rtems_status_code rc;
uint32_t i;
rtems_libio_t *iop;
if (rtems_libio_number_iops > 0)
20f4: 0a000017 beq 2158 <rtems_libio_init+0x78>
{
rtems_libio_iops = (rtems_libio_t *) calloc(rtems_libio_number_iops,
20f8: e1a00004 mov r0, r4
20fc: e3a01038 mov r1, #56 ; 0x38
2100: ebffff23 bl 1d94 <calloc>
2104: e59f309c ldr r3, [pc, #156] ; 21a8 <rtems_libio_init+0xc8>
sizeof(rtems_libio_t));
if (rtems_libio_iops == NULL)
2108: e3500000 cmp r0, #0
uint32_t i;
rtems_libio_t *iop;
if (rtems_libio_number_iops > 0)
{
rtems_libio_iops = (rtems_libio_t *) calloc(rtems_libio_number_iops,
210c: e1a02000 mov r2, r0
2110: e5830000 str r0, [r3]
sizeof(rtems_libio_t));
if (rtems_libio_iops == NULL)
2114: 0a000020 beq 219c <rtems_libio_init+0xbc>
rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
iop = rtems_libio_iop_freelist = rtems_libio_iops;
2118: e59f308c ldr r3, [pc, #140] ; 21ac <rtems_libio_init+0xcc>
for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++)
211c: e3540001 cmp r4, #1
rtems_libio_iops = (rtems_libio_t *) calloc(rtems_libio_number_iops,
sizeof(rtems_libio_t));
if (rtems_libio_iops == NULL)
rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
iop = rtems_libio_iop_freelist = rtems_libio_iops;
2120: e5830000 str r0, [r3]
for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++)
2124: 9a000009 bls 2150 <rtems_libio_init+0x70>
* rtems_libio_init
*
* Called by BSP startup code to initialize the libio subsystem.
*/
void rtems_libio_init( void )
2128: e2803038 add r3, r0, #56 ; 0x38
212c: e3a02001 mov r2, #1
if (rtems_libio_iops == NULL)
rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
iop = rtems_libio_iop_freelist = rtems_libio_iops;
for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++)
iop->data1 = iop + 1;
2130: e2822001 add r2, r2, #1
sizeof(rtems_libio_t));
if (rtems_libio_iops == NULL)
rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
iop = rtems_libio_iop_freelist = rtems_libio_iops;
for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++)
2134: e1520004 cmp r2, r4
iop->data1 = iop + 1;
2138: e5033004 str r3, [r3, #-4]
213c: e2833038 add r3, r3, #56 ; 0x38
sizeof(rtems_libio_t));
if (rtems_libio_iops == NULL)
rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
iop = rtems_libio_iop_freelist = rtems_libio_iops;
for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++)
2140: 1afffffa bne 2130 <rtems_libio_init+0x50>
* rtems_libio_init
*
* Called by BSP startup code to initialize the libio subsystem.
*/
void rtems_libio_init( void )
2144: e2422001 sub r2, r2, #1
2148: e0622182 rsb r2, r2, r2, lsl #3
sizeof(rtems_libio_t));
if (rtems_libio_iops == NULL)
rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
iop = rtems_libio_iop_freelist = rtems_libio_iops;
for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++)
214c: e0802182 add r2, r0, r2, lsl #3
iop->data1 = iop + 1;
iop->data1 = NULL;
2150: e3a03000 mov r3, #0
2154: e5823034 str r3, [r2, #52] ; 0x34
/*
* Create the binary semaphore used to provide mutual exclusion
* on the IOP Table.
*/
rc = rtems_semaphore_create(
2158: e59fc050 ldr ip, [pc, #80] ; 21b0 <rtems_libio_init+0xd0>
215c: e59f0050 ldr r0, [pc, #80] ; 21b4 <rtems_libio_init+0xd4>
2160: e3a01001 mov r1, #1
2164: e3a02054 mov r2, #84 ; 0x54
2168: e3a03000 mov r3, #0
216c: e58dc000 str ip, [sp]
2170: eb000c9c bl 53e8 <rtems_semaphore_create>
1,
RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&rtems_libio_semaphore
);
if ( rc != RTEMS_SUCCESSFUL )
2174: e3500000 cmp r0, #0
2178: 1a000006 bne 2198 <rtems_libio_init+0xb8>
/*
* Initialize the base file system infrastructure.
*/
if (rtems_fs_init_helper)
217c: e59f3034 ldr r3, [pc, #52] ; 21b8 <rtems_libio_init+0xd8>
2180: e5933000 ldr r3, [r3]
2184: e3530000 cmp r3, #0
(* rtems_fs_init_helper)();
2188: 11a0e00f movne lr, pc
218c: 112fff13 bxne r3
}
2190: e28dd004 add sp, sp, #4
2194: e8bd8010 pop {r4, pc}
RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&rtems_libio_semaphore
);
if ( rc != RTEMS_SUCCESSFUL )
rtems_fatal_error_occurred( rc );
2198: eb000ecf bl 5cdc <rtems_fatal_error_occurred> <== NOT EXECUTED
if (rtems_libio_number_iops > 0)
{
rtems_libio_iops = (rtems_libio_t *) calloc(rtems_libio_number_iops,
sizeof(rtems_libio_t));
if (rtems_libio_iops == NULL)
rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
219c: e280001a add r0, r0, #26
21a0: eb000ecd bl 5cdc <rtems_fatal_error_occurred>
000032e4 <rtems_libio_set_private_env>:
}
}
rtems_status_code rtems_libio_set_private_env(void)
{
32e4: e92d41f0 push {r4, r5, r6, r7, r8, lr}
rtems_status_code sc;
rtems_id task_id;
rtems_filesystem_location_info_t loc;
sc=rtems_task_ident(RTEMS_SELF,0,&task_id);
32e8: e3a00000 mov r0, #0
free(env);
}
}
rtems_status_code rtems_libio_set_private_env(void)
{
32ec: e24dd01c sub sp, sp, #28
rtems_status_code sc;
rtems_id task_id;
rtems_filesystem_location_info_t loc;
sc=rtems_task_ident(RTEMS_SELF,0,&task_id);
32f0: e1a01000 mov r1, r0
32f4: e28d2018 add r2, sp, #24
32f8: eb000b68 bl 60a0 <rtems_task_ident>
if (sc != RTEMS_SUCCESSFUL) return sc;
32fc: e2508000 subs r8, r0, #0
3300: 1a000025 bne 339c <rtems_libio_set_private_env+0xb8>
/* Only for the first time a malloc is necesary */
if (rtems_current_user_env==&rtems_global_user_env) {
3304: e59f60dc ldr r6, [pc, #220] ; 33e8 <rtems_libio_set_private_env+0x104>
3308: e59f30dc ldr r3, [pc, #220] ; 33ec <rtems_libio_set_private_env+0x108>
330c: e5967000 ldr r7, [r6]
3310: e1570003 cmp r7, r3
3314: 0a000023 beq 33a8 <rtems_libio_set_private_env+0xc4>
return sc;
}
rtems_current_user_env = tmp;
}
*rtems_current_user_env = rtems_global_user_env; /* get the global values*/
3318: e59f10cc ldr r1, [pc, #204] ; 33ec <rtems_libio_set_private_env+0x108>
331c: e3a02048 mov r2, #72 ; 0x48
3320: e1a00007 mov r0, r7
3324: eb002984 bl d93c <memcpy>
rtems_current_user_env->task_id=task_id; /* mark the local values*/
3328: e59d3018 ldr r3, [sp, #24]
* what we are trying to do here is forking off
* clones. The reason is a pathloc can be allocated by the
* file system and needs to be freed when deleting the environment.
*/
rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0);
332c: e28d4004 add r4, sp, #4
3330: e3a05000 mov r5, #0
}
rtems_current_user_env = tmp;
}
*rtems_current_user_env = rtems_global_user_env; /* get the global values*/
rtems_current_user_env->task_id=task_id; /* mark the local values*/
3334: e5873000 str r3, [r7]
* what we are trying to do here is forking off
* clones. The reason is a pathloc can be allocated by the
* file system and needs to be freed when deleting the environment.
*/
rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0);
3338: e3a01001 mov r1, #1
333c: e1a03004 mov r3, r4
3340: e1a02005 mov r2, r5
3344: e59f00a4 ldr r0, [pc, #164] ; 33f0 <rtems_libio_set_private_env+0x10c>
rtems_filesystem_root = loc;
3348: e1a07004 mov r7, r4
* what we are trying to do here is forking off
* clones. The reason is a pathloc can be allocated by the
* file system and needs to be freed when deleting the environment.
*/
rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0);
334c: e58d5000 str r5, [sp]
3350: ebfffb2e bl 2010 <rtems_filesystem_evaluate_path>
rtems_filesystem_root = loc;
3354: e596c000 ldr ip, [r6]
3358: e8b7000f ldm r7!, {r0, r1, r2, r3}
335c: e28cc018 add ip, ip, #24
3360: e8ac000f stmia ip!, {r0, r1, r2, r3}
3364: e5973000 ldr r3, [r7]
rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0);
3368: e3a01001 mov r1, #1
* clones. The reason is a pathloc can be allocated by the
* file system and needs to be freed when deleting the environment.
*/
rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0);
rtems_filesystem_root = loc;
336c: e58c3000 str r3, [ip]
rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0);
3370: e1a02005 mov r2, r5
3374: e1a03004 mov r3, r4
3378: e59f0070 ldr r0, [pc, #112] ; 33f0 <rtems_libio_set_private_env+0x10c>
337c: e58d5000 str r5, [sp]
3380: ebfffb22 bl 2010 <rtems_filesystem_evaluate_path>
rtems_filesystem_current = loc;
3384: e596c000 ldr ip, [r6]
3388: e8b4000f ldm r4!, {r0, r1, r2, r3}
338c: e28cc004 add ip, ip, #4
3390: e8ac000f stmia ip!, {r0, r1, r2, r3}
3394: e5973000 ldr r3, [r7]
3398: e58c3000 str r3, [ip]
return RTEMS_SUCCESSFUL;
}
339c: e1a00008 mov r0, r8
33a0: e28dd01c add sp, sp, #28
33a4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
sc=rtems_task_ident(RTEMS_SELF,0,&task_id);
if (sc != RTEMS_SUCCESSFUL) return sc;
/* Only for the first time a malloc is necesary */
if (rtems_current_user_env==&rtems_global_user_env) {
rtems_user_env_t *tmp = malloc(sizeof(rtems_user_env_t));
33a8: e3a00048 mov r0, #72 ; 0x48
33ac: ebfffd06 bl 27cc <malloc>
if (!tmp)
33b0: e2507000 subs r7, r0, #0
return RTEMS_NO_MEMORY;
33b4: 03a0801a moveq r8, #26
if (sc != RTEMS_SUCCESSFUL) return sc;
/* Only for the first time a malloc is necesary */
if (rtems_current_user_env==&rtems_global_user_env) {
rtems_user_env_t *tmp = malloc(sizeof(rtems_user_env_t));
if (!tmp)
33b8: 0afffff7 beq 339c <rtems_libio_set_private_env+0xb8>
#ifdef HAVE_USERENV_REFCNT
tmp->refcnt = 1;
#endif
sc = rtems_task_variable_add(
33bc: e1a00008 mov r0, r8
33c0: e1a01006 mov r1, r6
33c4: e59f2028 ldr r2, [pc, #40] ; 33f4 <rtems_libio_set_private_env+0x110>
33c8: eb000b89 bl 61f4 <rtems_task_variable_add>
RTEMS_SELF,
(void*)&rtems_current_user_env,
(void(*)(void *))free_user_env
);
if (sc != RTEMS_SUCCESSFUL) {
33cc: e2504000 subs r4, r0, #0
* not initialized yet
*/
free(tmp);
return sc;
}
rtems_current_user_env = tmp;
33d0: 05867000 streq r7, [r6]
sc = rtems_task_variable_add(
RTEMS_SELF,
(void*)&rtems_current_user_env,
(void(*)(void *))free_user_env
);
if (sc != RTEMS_SUCCESSFUL) {
33d4: 0affffcf beq 3318 <rtems_libio_set_private_env+0x34>
/* don't use free_user_env because the pathlocs are
* not initialized yet
*/
free(tmp);
33d8: e1a00007 mov r0, r7 <== NOT EXECUTED
33dc: ebfffb5b bl 2150 <free> <== NOT EXECUTED
return sc;
33e0: e1a08004 mov r8, r4 <== NOT EXECUTED
33e4: eaffffec b 339c <rtems_libio_set_private_env+0xb8> <== NOT EXECUTED
000033f8 <rtems_libio_share_private_env>:
* while changing any of those (chdir(), chroot()).
*/
#ifndef HAVE_USERENV_REFCNT
rtems_status_code rtems_libio_share_private_env(rtems_id task_id)
{
33f8: e92d4070 push {r4, r5, r6, lr} <== NOT EXECUTED
33fc: e1a05000 mov r5, r0 <== NOT EXECUTED
3400: e24dd008 sub sp, sp, #8 <== NOT EXECUTED
rtems_status_code sc;
rtems_user_env_t * shared_user_env;
rtems_id current_task_id;
sc=rtems_task_ident(RTEMS_SELF,0,¤t_task_id);
3404: e3a00000 mov r0, #0 <== NOT EXECUTED
3408: e1a01000 mov r1, r0 <== NOT EXECUTED
340c: e1a0200d mov r2, sp <== NOT EXECUTED
3410: eb000b22 bl 60a0 <rtems_task_ident> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL) return sc;
3414: e2503000 subs r3, r0, #0 <== NOT EXECUTED
3418: 1a000013 bne 346c <rtems_libio_share_private_env+0x74> <== NOT EXECUTED
if (rtems_current_user_env->task_id==current_task_id) {
341c: e59f407c ldr r4, [pc, #124] ; 34a0 <rtems_libio_share_private_env+0xa8><== NOT EXECUTED
3420: e5946000 ldr r6, [r4] <== NOT EXECUTED
3424: e59d3000 ldr r3, [sp] <== NOT EXECUTED
3428: e5962000 ldr r2, [r6] <== NOT EXECUTED
342c: e1520003 cmp r2, r3 <== NOT EXECUTED
3430: 0a000010 beq 3478 <rtems_libio_share_private_env+0x80> <== NOT EXECUTED
rtems_user_env_t *tmp = rtems_current_user_env;
sc = rtems_task_variable_delete(RTEMS_SELF,(void*)&rtems_current_user_env);
if (sc != RTEMS_SUCCESSFUL) return sc;
free_user_env(tmp);
} else {
sc = rtems_task_variable_get(
3434: e1a00005 mov r0, r5 <== NOT EXECUTED
3438: e1a01004 mov r1, r4 <== NOT EXECUTED
343c: e28d2004 add r2, sp, #4 <== NOT EXECUTED
3440: eb000bbe bl 6340 <rtems_task_variable_get> <== NOT EXECUTED
task_id,(void*)&rtems_current_user_env, (void*)&shared_user_env );
if (sc != RTEMS_SUCCESSFUL)
3444: e2503000 subs r3, r0, #0 <== NOT EXECUTED
3448: 1a000005 bne 3464 <rtems_libio_share_private_env+0x6c> <== NOT EXECUTED
goto bailout;
}
/* AT THIS POINT, rtems_current_user_env is DANGLING */
sc = rtems_task_variable_add(
344c: e3a00000 mov r0, #0 <== NOT EXECUTED
3450: e59f1048 ldr r1, [pc, #72] ; 34a0 <rtems_libio_share_private_env+0xa8><== NOT EXECUTED
3454: e59f2048 ldr r2, [pc, #72] ; 34a4 <rtems_libio_share_private_env+0xac><== NOT EXECUTED
3458: eb000b65 bl 61f4 <rtems_task_variable_add> <== NOT EXECUTED
RTEMS_SELF,(void*)&rtems_current_user_env,free_user_env);
if (sc != RTEMS_SUCCESSFUL)
345c: e2503000 subs r3, r0, #0 <== NOT EXECUTED
3460: 0a00000b beq 3494 <rtems_libio_share_private_env+0x9c> <== NOT EXECUTED
return RTEMS_SUCCESSFUL;
bailout:
/* fallback to the global env */
rtems_current_user_env = &rtems_global_user_env;
3464: e59f203c ldr r2, [pc, #60] ; 34a8 <rtems_libio_share_private_env+0xb0><== NOT EXECUTED
3468: e5842000 str r2, [r4] <== NOT EXECUTED
return sc;
}
346c: e1a00003 mov r0, r3 <== NOT EXECUTED
3470: e28dd008 add sp, sp, #8 <== NOT EXECUTED
3474: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL) return sc;
if (rtems_current_user_env->task_id==current_task_id) {
/* kill the current user env & task_var*/
rtems_user_env_t *tmp = rtems_current_user_env;
sc = rtems_task_variable_delete(RTEMS_SELF,(void*)&rtems_current_user_env);
3478: e1a01004 mov r1, r4 <== NOT EXECUTED
347c: eb000b88 bl 62a4 <rtems_task_variable_delete> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL) return sc;
3480: e2503000 subs r3, r0, #0 <== NOT EXECUTED
3484: 1afffff8 bne 346c <rtems_libio_share_private_env+0x74> <== NOT EXECUTED
free_user_env(tmp);
3488: e1a00006 mov r0, r6 <== NOT EXECUTED
348c: ebffff87 bl 32b0 <free_user_env> <== NOT EXECUTED
3490: eaffffed b 344c <rtems_libio_share_private_env+0x54> <== NOT EXECUTED
RTEMS_SELF,(void*)&rtems_current_user_env,free_user_env);
if (sc != RTEMS_SUCCESSFUL)
goto bailout;
/* the current_user_env is the same pointer that remote env */
rtems_current_user_env = shared_user_env;
3494: e59d2004 ldr r2, [sp, #4] <== NOT EXECUTED
3498: e5842000 str r2, [r4] <== NOT EXECUTED
/* increase the reference count */
#ifdef HAVE_USERENV_REFCNT
rtems_current_user_env->refcnt++;
#endif
return RTEMS_SUCCESSFUL;
349c: eafffff2 b 346c <rtems_libio_share_private_env+0x74> <== NOT EXECUTED
00009fac <rtems_libio_to_fcntl_flags>:
uint32_t flags
)
{
uint32_t fcntl_flags = 0;
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
9fac: e2002006 and r2, r0, #6
9fb0: e3520006 cmp r2, #6
*/
uint32_t rtems_libio_to_fcntl_flags(
uint32_t flags
)
{
9fb4: e1a03000 mov r3, r0
uint32_t fcntl_flags = 0;
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
fcntl_flags |= O_RDWR;
9fb8: 03a00002 moveq r0, #2
uint32_t flags
)
{
uint32_t fcntl_flags = 0;
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
9fbc: 0a000002 beq 9fcc <rtems_libio_to_fcntl_flags+0x20>
fcntl_flags |= O_RDWR;
} else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) {
9fc0: e3130002 tst r3, #2
fcntl_flags |= O_RDONLY;
9fc4: 13a00000 movne r0, #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) {
9fc8: 0a000006 beq 9fe8 <rtems_libio_to_fcntl_flags+0x3c>
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 ) {
9fcc: e3130001 tst r3, #1
fcntl_flags |= O_NONBLOCK;
9fd0: 13800901 orrne r0, r0, #16384 ; 0x4000
}
if ( (flags & LIBIO_FLAGS_APPEND) == LIBIO_FLAGS_APPEND ) {
9fd4: e3130c02 tst r3, #512 ; 0x200
fcntl_flags |= O_APPEND;
9fd8: 13800008 orrne r0, r0, #8
}
if ( (flags & LIBIO_FLAGS_CREATE) == LIBIO_FLAGS_CREATE ) {
9fdc: e3130b01 tst r3, #1024 ; 0x400
fcntl_flags |= O_CREAT;
9fe0: 13800c02 orrne r0, r0, #512 ; 0x200
}
return fcntl_flags;
}
9fe4: e12fff1e bx lr
)
{
uint32_t fcntl_flags = 0;
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
fcntl_flags |= O_RDWR;
9fe8: e3130004 tst r3, #4 <== NOT EXECUTED
9fec: 03a00000 moveq r0, #0 <== NOT EXECUTED
9ff0: 13a00001 movne r0, #1 <== NOT EXECUTED
9ff4: eafffff4 b 9fcc <rtems_libio_to_fcntl_flags+0x20> <== NOT EXECUTED
0000ca88 <rtems_mkdir>:
return (retval);
}
int
rtems_mkdir(const char *path, mode_t mode)
{
ca88: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
ca8c: e24dd048 sub sp, sp, #72 ; 0x48
ca90: e1a0a001 mov sl, r1
int success = 0;
char *dup_path = strdup(path);
ca94: eb000a52 bl f3e4 <strdup>
if (dup_path != NULL) {
ca98: e2506000 subs r6, r0, #0
ca9c: 0a000055 beq cbf8 <rtems_mkdir+0x170>
char *p;
p = path;
oumask = 0;
retval = 1;
if (p[0] == '/') /* Skip leading '/'. */
caa0: e5d63000 ldrb r3, [r6]
caa4: e353002f cmp r3, #47 ; 0x2f
caa8: e3a07000 mov r7, #0
++p;
caac: 05d63001 ldrbeq r3, [r6, #1]
cab0: 02865001 addeq r5, r6, #1
char *p;
p = path;
oumask = 0;
retval = 1;
if (p[0] == '/') /* Skip leading '/'. */
cab4: 11a05006 movne r5, r6
cab8: e3a02001 mov r2, #1
retval = 0;
break;
}
}
if (!last)
*p = '/';
cabc: e3a0802f mov r8, #47 ; 0x2f
cac0: e1a09007 mov r9, r7
}
if (last)
(void)umask(oumask);
if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
if (errno == EEXIST || errno == EISDIR) {
if (stat(path, &sb) < 0) {
cac4: e1a0b00d mov fp, sp
oumask = 0;
retval = 1;
if (p[0] == '/') /* Skip leading '/'. */
++p;
for (first = 1, last = 0; !last ; ++p) {
if (p[0] == '\0')
cac8: e3530000 cmp r3, #0
last = 1;
else if (p[0] != '/')
continue;
*p = '\0';
cacc: 05c53000 strbeq r3, [r5]
cad0: 03a04001 moveq r4, #1
oumask = 0;
retval = 1;
if (p[0] == '/') /* Skip leading '/'. */
++p;
for (first = 1, last = 0; !last ; ++p) {
if (p[0] == '\0')
cad4: 0a000006 beq caf4 <rtems_mkdir+0x6c>
last = 1;
else if (p[0] != '/')
cad8: e353002f cmp r3, #47 ; 0x2f
retval = 0;
break;
}
}
if (!last)
*p = '/';
cadc: 15f53001 ldrbne r3, [r5, #1]!
cae0: 1afffff8 bne cac8 <rtems_mkdir+0x40>
if (p[0] == '\0')
last = 1;
else if (p[0] != '/')
continue;
*p = '\0';
if (!last && p[1] == '\0')
cae4: e5d54001 ldrb r4, [r5, #1]
for (first = 1, last = 0; !last ; ++p) {
if (p[0] == '\0')
last = 1;
else if (p[0] != '/')
continue;
*p = '\0';
cae8: e5c59000 strb r9, [r5]
if (!last && p[1] == '\0')
caec: e2744001 rsbs r4, r4, #1
caf0: 33a04000 movcc r4, #0
last = 1;
if (first) {
caf4: e3520000 cmp r2, #0
caf8: 1a000031 bne cbc4 <rtems_mkdir+0x13c>
oumask = umask(0);
numask = oumask & ~(S_IWUSR | S_IXUSR);
(void)umask(numask);
first = 0;
}
if (last)
cafc: e3540000 cmp r4, #0
(void)umask(oumask);
if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
cb00: 03a01f7f moveq r1, #508 ; 0x1fc
cb04: 02811003 addeq r1, r1, #3
oumask = umask(0);
numask = oumask & ~(S_IWUSR | S_IXUSR);
(void)umask(numask);
first = 0;
}
if (last)
cb08: 1a000011 bne cb54 <rtems_mkdir+0xcc>
(void)umask(oumask);
if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
cb0c: e1a00006 mov r0, r6
cb10: ebffdbd2 bl 3a60 <mkdir>
cb14: e3500000 cmp r0, #0
cb18: ba000014 blt cb70 <rtems_mkdir+0xe8>
} else {
retval = 0;
break;
}
}
if (!last)
cb1c: e3540000 cmp r4, #0
cb20: 0a000007 beq cb44 <rtems_mkdir+0xbc>
cb24: e3a04001 mov r4, #1
int success = 0;
char *dup_path = strdup(path);
if (dup_path != NULL) {
success = build(dup_path, mode);
free(dup_path);
cb28: e1a00006 mov r0, r6
cb2c: ebffd9ef bl 32f0 <free>
}
return success != 0 ? 0 : -1;
cb30: e3540000 cmp r4, #0
cb34: 13a00000 movne r0, #0
cb38: 0a00002e beq cbf8 <rtems_mkdir+0x170>
}
cb3c: e28dd048 add sp, sp, #72 ; 0x48
cb40: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
retval = 0;
break;
}
}
if (!last)
*p = '/';
cb44: e5c58000 strb r8, [r5]
cb48: e3a02000 mov r2, #0
cb4c: e5f53001 ldrb r3, [r5, #1]!
cb50: eaffffdc b cac8 <rtems_mkdir+0x40>
numask = oumask & ~(S_IWUSR | S_IXUSR);
(void)umask(numask);
first = 0;
}
if (last)
(void)umask(oumask);
cb54: e1a00007 mov r0, r7
cb58: eb00005b bl cccc <umask>
if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
cb5c: e1a0100a mov r1, sl
cb60: e1a00006 mov r0, r6
cb64: ebffdbbd bl 3a60 <mkdir>
cb68: e3500000 cmp r0, #0
cb6c: aaffffea bge cb1c <rtems_mkdir+0x94>
if (errno == EEXIST || errno == EISDIR) {
cb70: eb000633 bl e444 <__errno>
cb74: e5903000 ldr r3, [r0]
cb78: e3530011 cmp r3, #17
cb7c: 0a000003 beq cb90 <rtems_mkdir+0x108>
cb80: eb00062f bl e444 <__errno> <== NOT EXECUTED
cb84: e5903000 ldr r3, [r0] <== NOT EXECUTED
cb88: e3530015 cmp r3, #21 <== NOT EXECUTED
cb8c: 1a000024 bne cc24 <rtems_mkdir+0x19c> <== NOT EXECUTED
if (stat(path, &sb) < 0) {
cb90: e1a00006 mov r0, r6
cb94: e1a0100d mov r1, sp
cb98: eb000024 bl cc30 <stat>
cb9c: e3500000 cmp r0, #0
cba0: ba00001f blt cc24 <rtems_mkdir+0x19c>
retval = 0;
break;
} else if (!S_ISDIR(sb.st_mode)) {
cba4: e59d300c ldr r3, [sp, #12]
cba8: e2033a0f and r3, r3, #61440 ; 0xf000
cbac: e3530901 cmp r3, #16384 ; 0x4000
cbb0: 1a000012 bne cc00 <rtems_mkdir+0x178>
else
errno = ENOTDIR;
retval = 0;
break;
}
if (last)
cbb4: e3540000 cmp r4, #0
cbb8: 0affffe1 beq cb44 <rtems_mkdir+0xbc>
retval = 2;
cbbc: e3a04002 mov r4, #2
cbc0: eaffffd8 b cb28 <rtems_mkdir+0xa0>
* mkdir [-m mode] dir
*
* We change the user's umask and then restore it,
* instead of doing chmod's.
*/
oumask = umask(0);
cbc4: e3a00000 mov r0, #0
cbc8: eb00003f bl cccc <umask>
cbcc: e1a07000 mov r7, r0
numask = oumask & ~(S_IWUSR | S_IXUSR);
(void)umask(numask);
cbd0: e3c000c0 bic r0, r0, #192 ; 0xc0
cbd4: eb00003c bl cccc <umask>
cbd8: eaffffc7 b cafc <rtems_mkdir+0x74>
break;
} else if (!S_ISDIR(sb.st_mode)) {
if (last)
errno = EEXIST;
else
errno = ENOTDIR;
cbdc: eb000618 bl e444 <__errno> <== NOT EXECUTED
cbe0: e3a03014 mov r3, #20 <== NOT EXECUTED
cbe4: e5803000 str r3, [r0] <== NOT EXECUTED
}
if (!last)
*p = '/';
}
if (!first && !last)
(void)umask(oumask);
cbe8: e1a00007 mov r0, r7 <== NOT EXECUTED
cbec: eb000036 bl cccc <umask> <== NOT EXECUTED
int success = 0;
char *dup_path = strdup(path);
if (dup_path != NULL) {
success = build(dup_path, mode);
free(dup_path);
cbf0: e1a00006 mov r0, r6 <== NOT EXECUTED
cbf4: ebffd9bd bl 32f0 <free> <== NOT EXECUTED
}
return success != 0 ? 0 : -1;
cbf8: e3e00000 mvn r0, #0 <== NOT EXECUTED
cbfc: eaffffce b cb3c <rtems_mkdir+0xb4> <== NOT EXECUTED
if (errno == EEXIST || errno == EISDIR) {
if (stat(path, &sb) < 0) {
retval = 0;
break;
} else if (!S_ISDIR(sb.st_mode)) {
if (last)
cc00: e3540000 cmp r4, #0
cc04: 0afffff4 beq cbdc <rtems_mkdir+0x154>
errno = EEXIST;
cc08: eb00060d bl e444 <__errno>
cc0c: e3a03011 mov r3, #17
cc10: e5803000 str r3, [r0]
int success = 0;
char *dup_path = strdup(path);
if (dup_path != NULL) {
success = build(dup_path, mode);
free(dup_path);
cc14: e1a00006 mov r0, r6
cc18: ebffd9b4 bl 32f0 <free>
}
return success != 0 ? 0 : -1;
cc1c: e3e00000 mvn r0, #0
cc20: eaffffc5 b cb3c <rtems_mkdir+0xb4>
}
}
if (!last)
*p = '/';
}
if (!first && !last)
cc24: e3540000 cmp r4, #0 <== NOT EXECUTED
cc28: 0affffee beq cbe8 <rtems_mkdir+0x160> <== NOT EXECUTED
cc2c: eaffffef b cbf0 <rtems_mkdir+0x168> <== NOT EXECUTED
00001b80 <rtems_print_buffer>:
void rtems_print_buffer(
const unsigned char *buffer,
int length
)
{
1b80: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
int i, mod, max;
if ( !length ) return;
1b84: e3510000 cmp r1, #0
void rtems_print_buffer(
const unsigned char *buffer,
int length
)
{
1b88: e24dd078 sub sp, sp, #120 ; 0x78
1b8c: e1a0b000 mov fp, r0
int i, mod, max;
if ( !length ) return;
1b90: 0a000037 beq 1c74 <rtems_print_buffer+0xf4>
mod = length % 16;
1b94: e1a03fc1 asr r3, r1, #31
1b98: e1a03e23 lsr r3, r3, #28
1b9c: e081a003 add sl, r1, r3
1ba0: e20aa00f and sl, sl, #15
1ba4: e063a00a rsb sl, r3, sl
max = length - mod;
1ba8: e06a9001 rsb r9, sl, r1
for ( i=0 ; i<max ; i+=16 )
1bac: e3590000 cmp r9, #0
1bb0: da00002d ble 1c6c <rtems_print_buffer+0xec>
1bb4: e59f71f4 ldr r7, [pc, #500] ; 1db0 <rtems_print_buffer+0x230>
1bb8: e3a08000 mov r8, #0
1bbc: e1a0400d mov r4, sp
{
int i;
char line_buffer[120];
line_buffer[0] = '\0';
1bc0: e3a03000 mov r3, #0
1bc4: e5cd3000 strb r3, [sp]
static inline void Dump_Line(
const unsigned char *buffer,
int length
);
void rtems_print_buffer(
1bc8: e08b6008 add r6, fp, r8
int i;
char line_buffer[120];
line_buffer[0] = '\0';
for( i=0 ; i<length ; i++ )
1bcc: e3a05000 mov r5, #0
sprintf( line_buffer, "%s%02x ", line_buffer, buffer[ i ] );
1bd0: e7d63005 ldrb r3, [r6, r5]
1bd4: e1a0000d mov r0, sp
1bd8: e59f11d4 ldr r1, [pc, #468] ; 1db4 <rtems_print_buffer+0x234>
1bdc: e1a0200d mov r2, sp
int i;
char line_buffer[120];
line_buffer[0] = '\0';
for( i=0 ; i<length ; i++ )
1be0: e2855001 add r5, r5, #1
sprintf( line_buffer, "%s%02x ", line_buffer, buffer[ i ] );
1be4: eb003138 bl e0cc <sprintf>
int i;
char line_buffer[120];
line_buffer[0] = '\0';
for( i=0 ; i<length ; i++ )
1be8: e3550010 cmp r5, #16
1bec: 1afffff7 bne 1bd0 <rtems_print_buffer+0x50>
sprintf( line_buffer, "%s%02x ", line_buffer, buffer[ i ] );
for( ; i<16 ; i++ )
strcat( line_buffer, " " );
strcat( line_buffer, "|" );
1bf0: e1a0000d mov r0, sp
1bf4: eb00326b bl e5a8 <strlen>
1bf8: e59f11b8 ldr r1, [pc, #440] ; 1db8 <rtems_print_buffer+0x238>
1bfc: e0840000 add r0, r4, r0
1c00: e3a02002 mov r2, #2
1c04: eb003099 bl de70 <memcpy>
for( i=0 ; i<length ; i++ )
1c08: e3a05000 mov r5, #0
sprintf( line_buffer, "%s%c", line_buffer,
isprint( buffer[ i ] ) ? buffer[ i ] : '.' );
1c0c: e7d63005 ldrb r3, [r6, r5]
1c10: e5972000 ldr r2, [r7]
1c14: e0822003 add r2, r2, r3
1c18: e5d22001 ldrb r2, [r2, #1]
for( ; i<16 ; i++ )
strcat( line_buffer, " " );
strcat( line_buffer, "|" );
for( i=0 ; i<length ; i++ )
sprintf( line_buffer, "%s%c", line_buffer,
1c1c: e3120097 tst r2, #151 ; 0x97
1c20: 03a0302e moveq r3, #46 ; 0x2e
1c24: e1a0000d mov r0, sp
1c28: e59f118c ldr r1, [pc, #396] ; 1dbc <rtems_print_buffer+0x23c>
1c2c: e1a0200d mov r2, sp
for( ; i<16 ; i++ )
strcat( line_buffer, " " );
strcat( line_buffer, "|" );
for( i=0 ; i<length ; i++ )
1c30: e2855001 add r5, r5, #1
sprintf( line_buffer, "%s%c", line_buffer,
1c34: eb003124 bl e0cc <sprintf>
for( ; i<16 ; i++ )
strcat( line_buffer, " " );
strcat( line_buffer, "|" );
for( i=0 ; i<length ; i++ )
1c38: e3550010 cmp r5, #16
1c3c: 1afffff2 bne 1c0c <rtems_print_buffer+0x8c>
isprint( buffer[ i ] ) ? buffer[ i ] : '.' );
for( ; i<16 ; i++ )
strcat( line_buffer, " " );
strcat( line_buffer, "|\n" );
1c40: e1a0000d mov r0, sp
1c44: eb003257 bl e5a8 <strlen>
1c48: e59f1170 ldr r1, [pc, #368] ; 1dc0 <rtems_print_buffer+0x240>
1c4c: e3a02003 mov r2, #3
1c50: e0840000 add r0, r4, r0
1c54: eb003085 bl de70 <memcpy>
mod = length % 16;
max = length - mod;
for ( i=0 ; i<max ; i+=16 )
1c58: e2888010 add r8, r8, #16
for( ; i<16 ; i++ )
strcat( line_buffer, " " );
strcat( line_buffer, "|\n" );
printk( line_buffer );
1c5c: e1a0000d mov r0, sp
1c60: eb000740 bl 3968 <printk>
mod = length % 16;
max = length - mod;
for ( i=0 ; i<max ; i+=16 )
1c64: e1590008 cmp r9, r8
1c68: caffffd4 bgt 1bc0 <rtems_print_buffer+0x40>
Dump_Line( &buffer[ i ], 16 );
if ( mod )
1c6c: e35a0000 cmp sl, #0
1c70: 1a000001 bne 1c7c <rtems_print_buffer+0xfc>
Dump_Line( &buffer[ max ], mod );
}
1c74: e28dd078 add sp, sp, #120 ; 0x78
1c78: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
{
int i;
char line_buffer[120];
line_buffer[0] = '\0';
1c7c: e3a05000 mov r5, #0
for ( i=0 ; i<max ; i+=16 )
Dump_Line( &buffer[ i ], 16 );
if ( mod )
Dump_Line( &buffer[ max ], mod );
1c80: e08b9009 add r9, fp, r9
{
int i;
char line_buffer[120];
line_buffer[0] = '\0';
1c84: e5cd5000 strb r5, [sp]
1c88: d1a0400d movle r4, sp
for( i=0 ; i<length ; i++ )
1c8c: da00000b ble 1cc0 <rtems_print_buffer+0x140>
1c90: e1a0400d mov r4, sp
sprintf( line_buffer, "%s%02x ", line_buffer, buffer[ i ] );
1c94: e7d93005 ldrb r3, [r9, r5]
1c98: e1a0000d mov r0, sp
1c9c: e59f1110 ldr r1, [pc, #272] ; 1db4 <rtems_print_buffer+0x234>
1ca0: e1a0200d mov r2, sp
int i;
char line_buffer[120];
line_buffer[0] = '\0';
for( i=0 ; i<length ; i++ )
1ca4: e2855001 add r5, r5, #1
sprintf( line_buffer, "%s%02x ", line_buffer, buffer[ i ] );
1ca8: eb003107 bl e0cc <sprintf>
int i;
char line_buffer[120];
line_buffer[0] = '\0';
for( i=0 ; i<length ; i++ )
1cac: e15a0005 cmp sl, r5
1cb0: cafffff7 bgt 1c94 <rtems_print_buffer+0x114>
sprintf( line_buffer, "%s%02x ", line_buffer, buffer[ i ] );
for( ; i<16 ; i++ )
1cb4: e35a000f cmp sl, #15
1cb8: d1a0500a movle r5, sl
1cbc: ca000034 bgt 1d94 <rtems_print_buffer+0x214>
strcat( line_buffer, " " );
1cc0: e1a0000d mov r0, sp
1cc4: eb003237 bl e5a8 <strlen>
line_buffer[0] = '\0';
for( i=0 ; i<length ; i++ )
sprintf( line_buffer, "%s%02x ", line_buffer, buffer[ i ] );
for( ; i<16 ; i++ )
1cc8: e2855001 add r5, r5, #1
strcat( line_buffer, " " );
1ccc: e59f10f0 ldr r1, [pc, #240] ; 1dc4 <rtems_print_buffer+0x244>
1cd0: e0840000 add r0, r4, r0
1cd4: e3a02004 mov r2, #4
1cd8: eb003064 bl de70 <memcpy>
line_buffer[0] = '\0';
for( i=0 ; i<length ; i++ )
sprintf( line_buffer, "%s%02x ", line_buffer, buffer[ i ] );
for( ; i<16 ; i++ )
1cdc: e355000f cmp r5, #15
1ce0: dafffff6 ble 1cc0 <rtems_print_buffer+0x140>
strcat( line_buffer, " " );
strcat( line_buffer, "|" );
1ce4: e1a0000d mov r0, sp
1ce8: eb00322e bl e5a8 <strlen>
1cec: e59f10c4 ldr r1, [pc, #196] ; 1db8 <rtems_print_buffer+0x238>
1cf0: e0840000 add r0, r4, r0
1cf4: e3a02002 mov r2, #2
1cf8: eb00305c bl de70 <memcpy>
for( i=0 ; i<length ; i++ )
1cfc: e35a0000 cmp sl, #0
1d00: d3a0a000 movle sl, #0
1d04: da000010 ble 1d4c <rtems_print_buffer+0x1cc>
1d08: e59f70a0 ldr r7, [pc, #160] ; 1db0 <rtems_print_buffer+0x230>
1d0c: e3a05000 mov r5, #0
sprintf( line_buffer, "%s%c", line_buffer,
isprint( buffer[ i ] ) ? buffer[ i ] : '.' );
1d10: e7d93005 ldrb r3, [r9, r5]
1d14: e5972000 ldr r2, [r7]
1d18: e0822003 add r2, r2, r3
1d1c: e5d22001 ldrb r2, [r2, #1]
for( ; i<16 ; i++ )
strcat( line_buffer, " " );
strcat( line_buffer, "|" );
for( i=0 ; i<length ; i++ )
sprintf( line_buffer, "%s%c", line_buffer,
1d20: e3120097 tst r2, #151 ; 0x97
1d24: 03a0302e moveq r3, #46 ; 0x2e
1d28: e1a0000d mov r0, sp
1d2c: e59f1088 ldr r1, [pc, #136] ; 1dbc <rtems_print_buffer+0x23c>
1d30: e1a0200d mov r2, sp
for( ; i<16 ; i++ )
strcat( line_buffer, " " );
strcat( line_buffer, "|" );
for( i=0 ; i<length ; i++ )
1d34: e2855001 add r5, r5, #1
sprintf( line_buffer, "%s%c", line_buffer,
1d38: eb0030e3 bl e0cc <sprintf>
for( ; i<16 ; i++ )
strcat( line_buffer, " " );
strcat( line_buffer, "|" );
for( i=0 ; i<length ; i++ )
1d3c: e15a0005 cmp sl, r5
1d40: cafffff2 bgt 1d10 <rtems_print_buffer+0x190>
sprintf( line_buffer, "%s%c", line_buffer,
isprint( buffer[ i ] ) ? buffer[ i ] : '.' );
for( ; i<16 ; i++ )
1d44: e35a000f cmp sl, #15
1d48: ca000008 bgt 1d70 <rtems_print_buffer+0x1f0>
strcat( line_buffer, " " );
1d4c: e1a0000d mov r0, sp
1d50: eb003214 bl e5a8 <strlen>
strcat( line_buffer, "|" );
for( i=0 ; i<length ; i++ )
sprintf( line_buffer, "%s%c", line_buffer,
isprint( buffer[ i ] ) ? buffer[ i ] : '.' );
for( ; i<16 ; i++ )
1d54: e28aa001 add sl, sl, #1
strcat( line_buffer, " " );
1d58: e59f1068 ldr r1, [pc, #104] ; 1dc8 <rtems_print_buffer+0x248>
1d5c: e0840000 add r0, r4, r0
1d60: e3a02002 mov r2, #2
1d64: eb003041 bl de70 <memcpy>
strcat( line_buffer, "|" );
for( i=0 ; i<length ; i++ )
sprintf( line_buffer, "%s%c", line_buffer,
isprint( buffer[ i ] ) ? buffer[ i ] : '.' );
for( ; i<16 ; i++ )
1d68: e35a000f cmp sl, #15
1d6c: dafffff6 ble 1d4c <rtems_print_buffer+0x1cc>
strcat( line_buffer, " " );
strcat( line_buffer, "|\n" );
1d70: e1a0000d mov r0, sp
1d74: eb00320b bl e5a8 <strlen>
1d78: e59f1040 ldr r1, [pc, #64] ; 1dc0 <rtems_print_buffer+0x240>
1d7c: e0840000 add r0, r4, r0
1d80: e3a02003 mov r2, #3
1d84: eb003039 bl de70 <memcpy>
printk( line_buffer );
1d88: e1a0000d mov r0, sp
1d8c: eb0006f5 bl 3968 <printk>
1d90: eaffffb7 b 1c74 <rtems_print_buffer+0xf4>
sprintf( line_buffer, "%s%02x ", line_buffer, buffer[ i ] );
for( ; i<16 ; i++ )
strcat( line_buffer, " " );
strcat( line_buffer, "|" );
1d94: e1a0000d mov r0, sp <== NOT EXECUTED
1d98: eb003202 bl e5a8 <strlen> <== NOT EXECUTED
1d9c: e59f1014 ldr r1, [pc, #20] ; 1db8 <rtems_print_buffer+0x238><== NOT EXECUTED
1da0: e0840000 add r0, r4, r0 <== NOT EXECUTED
1da4: e3a02002 mov r2, #2 <== NOT EXECUTED
1da8: eb003030 bl de70 <memcpy> <== NOT EXECUTED
1dac: eaffffd5 b 1d08 <rtems_print_buffer+0x188> <== NOT EXECUTED
00001580 <rtems_stack_checker_is_blown>:
/*
* Check if blown
*/
bool rtems_stack_checker_is_blown( void )
{
1580: e92d4800 push {fp, lr}
Stack_Control *the_stack = &_Thread_Executing->Start.Initial_stack;
1584: e59f3034 ldr r3, [pc, #52] ; 15c0 <rtems_stack_checker_is_blown+0x40>
1588: e5931004 ldr r1, [r3, #4]
)
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
158c: e59120c4 ldr r2, [r1, #196] ; 0xc4
/*
* Check if blown
*/
bool rtems_stack_checker_is_blown( void )
{
1590: e28db004 add fp, sp, #4
)
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
1594: e15b0002 cmp fp, r2
1598: 3a000003 bcc 15ac <rtems_stack_checker_is_blown+0x2c>
return false;
}
if ( sp > (the_stack->area + the_stack->size) ) {
159c: e59110c0 ldr r1, [r1, #192] ; 0xc0
15a0: e0822001 add r2, r2, r1
15a4: e15b0002 cmp fp, r2
15a8: 9a000002 bls 15b8 <rtems_stack_checker_is_blown+0x38>
/*
* Let's report as much as we can.
*/
if ( !sp_ok || !pattern_ok ) {
Stack_check_report_blown_task( _Thread_Executing, pattern_ok );
15ac: e5930004 ldr r0, [r3, #4] <== NOT EXECUTED
15b0: e3a01001 mov r1, #1 <== NOT EXECUTED
15b4: ebffffaa bl 1464 <Stack_check_report_blown_task> <== NOT EXECUTED
/*
* The Stack Pointer and the Pattern Area are OK so return false.
*/
return false;
}
15b8: e3a00000 mov r0, #0
15bc: e8bd8800 pop {fp, pc}
00001518 <rtems_stack_checker_switch_extension>:
*/
void rtems_stack_checker_switch_extension(
Thread_Control *running __attribute__((unused)),
Thread_Control *heir __attribute__((unused))
)
{
1518: e92d4810 push {r4, fp, lr}
Stack_Control *the_stack = &running->Start.Initial_stack;
void *pattern;
bool sp_ok;
bool pattern_ok = true;
pattern = (void *) Stack_check_Get_pattern_area(the_stack)->pattern;
151c: e59030c4 ldr r3, [r0, #196] ; 0xc4
*/
void rtems_stack_checker_switch_extension(
Thread_Control *running __attribute__((unused)),
Thread_Control *heir __attribute__((unused))
)
{
1520: e28db008 add fp, sp, #8
)
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
1524: e15b0003 cmp fp, r3
*/
void rtems_stack_checker_switch_extension(
Thread_Control *running __attribute__((unused)),
Thread_Control *heir __attribute__((unused))
)
{
1528: e1a04000 mov r4, r0
Stack_Control *the_stack = &running->Start.Initial_stack;
void *pattern;
bool sp_ok;
bool pattern_ok = true;
pattern = (void *) Stack_check_Get_pattern_area(the_stack)->pattern;
152c: e2830008 add r0, r3, #8
)
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
1530: 3a000003 bcc 1544 <rtems_stack_checker_switch_extension+0x2c>
return false;
}
if ( sp > (the_stack->area + the_stack->size) ) {
1534: e59420c0 ldr r2, [r4, #192] ; 0xc0
1538: e0833002 add r3, r3, r2
153c: e15b0003 cmp fp, r3
1540: 9a000006 bls 1560 <rtems_stack_checker_switch_extension+0x48>
/*
* Check for an out of bounds stack pointer or an overwrite
*/
sp_ok = Stack_check_Frame_pointer_in_range( the_stack );
pattern_ok = (!memcmp( pattern,
1544: e59f1030 ldr r1, [pc, #48] ; 157c <rtems_stack_checker_switch_extension+0x64><== NOT EXECUTED
1548: e3a02010 mov r2, #16 <== NOT EXECUTED
154c: eb002fb6 bl d42c <memcmp> <== NOT EXECUTED
1550: e2701001 rsbs r1, r0, #1 <== NOT EXECUTED
1554: 33a01000 movcc r1, #0 <== NOT EXECUTED
(void *) Stack_check_Pattern.pattern, PATTERN_SIZE_BYTES));
if ( !sp_ok || !pattern_ok ) {
Stack_check_report_blown_task( running, pattern_ok );
1558: e1a00004 mov r0, r4
155c: ebffffc0 bl 1464 <Stack_check_report_blown_task>
/*
* Check for an out of bounds stack pointer or an overwrite
*/
sp_ok = Stack_check_Frame_pointer_in_range( the_stack );
pattern_ok = (!memcmp( pattern,
1560: e59f1014 ldr r1, [pc, #20] ; 157c <rtems_stack_checker_switch_extension+0x64>
1564: e3a02010 mov r2, #16
1568: eb002faf bl d42c <memcmp>
(void *) Stack_check_Pattern.pattern, PATTERN_SIZE_BYTES));
if ( !sp_ok || !pattern_ok ) {
156c: e3500000 cmp r0, #0
1570: 08bd8810 popeq {r4, fp, pc}
1574: e3a01000 mov r1, #0
1578: eafffff6 b 1558 <rtems_stack_checker_switch_extension+0x40>
0000bab4 <rtems_string_to_pointer>:
#if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER)
,
int base
#endif
)
{
bab4: e92d40f0 push {r4, r5, r6, r7, lr}
STRING_TO_INPUT_TYPE result;
char *end;
if ( !n )
bab8: e2515000 subs r5, r1, #0
#if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER)
,
int base
#endif
)
{
babc: e1a04000 mov r4, r0
bac0: e24dd004 sub sp, sp, #4
bac4: e1a06002 mov r6, r2
STRING_TO_INPUT_TYPE result;
char *end;
if ( !n )
return RTEMS_INVALID_ADDRESS;
bac8: 03a00009 moveq r0, #9
)
{
STRING_TO_INPUT_TYPE result;
char *end;
if ( !n )
bacc: 0a000013 beq bb20 <rtems_string_to_pointer+0x6c>
return RTEMS_INVALID_ADDRESS;
errno = 0;
bad0: eb000856 bl dc30 <__errno>
bad4: e3a03000 mov r3, #0
bad8: 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 );
badc: e1a0100d mov r1, sp
if ( !n )
return RTEMS_INVALID_ADDRESS;
errno = 0;
*n = 0;
bae0: e5853000 str r3, [r5]
#ifdef STRING_TO_FLOAT
result = STRING_TO_METHOD( s, &end );
#elif defined(STRING_TO_POINTER)
result = STRING_TO_METHOD( s, &end, 16 );
bae4: e1a00004 mov r0, r4
bae8: e3a02010 mov r2, #16
baec: eb0015dc bl 11264 <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 )
baf0: e3560000 cmp r6, #0
*endptr = end;
baf4: 159d3000 ldrne r3, [sp]
#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 )
baf8: 059d3000 ldreq r3, [sp]
*endptr = end;
bafc: 15863000 strne r3, [r6]
/* nothing was converted */
if ( end == s )
bb00: e1540003 cmp r4, r3
*n = 0;
#ifdef STRING_TO_FLOAT
result = STRING_TO_METHOD( s, &end );
#elif defined(STRING_TO_POINTER)
result = STRING_TO_METHOD( s, &end, 16 );
bb04: e1a07000 mov r7, r0
if ( endptr )
*endptr = end;
/* nothing was converted */
if ( end == s )
return RTEMS_NOT_DEFINED;
bb08: 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 )
bb0c: 0a000003 beq bb20 <rtems_string_to_pointer+0x6c>
return RTEMS_INVALID_NUMBER;
#endif
#ifdef STRING_TO_MAX
/* there was an overflow */
if ( (result == STRING_TO_MAX) && (errno == ERANGE))
bb10: e3770001 cmn r7, #1
bb14: 0a000003 beq bb28 <rtems_string_to_pointer+0x74>
if ( (result == STRING_TO_MIN) && (errno == ERANGE))
return RTEMS_INVALID_NUMBER;
#endif
#if defined(STRING_TO_POINTER)
*n = (STRING_TO_TYPE) (uintptr_t)result;
bb18: e5857000 str r7, [r5]
#else
*n = (STRING_TO_TYPE) result;
#endif
return RTEMS_SUCCESSFUL;
bb1c: e3a00000 mov r0, #0
}
bb20: e28dd004 add sp, sp, #4
bb24: e8bd80f0 pop {r4, r5, r6, r7, pc}
return RTEMS_INVALID_NUMBER;
#endif
#ifdef STRING_TO_MAX
/* there was an overflow */
if ( (result == STRING_TO_MAX) && (errno == ERANGE))
bb28: eb000840 bl dc30 <__errno> <== NOT EXECUTED
bb2c: e5903000 ldr r3, [r0] <== NOT EXECUTED
bb30: e3530022 cmp r3, #34 ; 0x22 <== NOT EXECUTED
return RTEMS_INVALID_NUMBER;
bb34: 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))
bb38: 1afffff6 bne bb18 <rtems_string_to_pointer+0x64> <== NOT EXECUTED
bb3c: eafffff7 b bb20 <rtems_string_to_pointer+0x6c> <== NOT EXECUTED
0000182c <rtems_tarfs_load>:
int rtems_tarfs_load(
char *mountpoint,
uint8_t *tar_image,
size_t tar_size
)
{
182c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1830: e24ddf6a sub sp, sp, #424 ; 0x1a8
1834: e1a06001 mov r6, r1
1838: e1a07002 mov r7, r2
183c: e58d0014 str r0, [sp, #20]
int offset;
unsigned long nblocks;
IMFS_jnode_t *node;
int status;
status = rtems_filesystem_evaluate_path(
1840: eb003c49 bl 1096c <strlen>
1844: e28d2e19 add r2, sp, #400 ; 0x190
1848: e1a01000 mov r1, r0
184c: e58d2008 str r2, [sp, #8]
1850: e59d0014 ldr r0, [sp, #20]
1854: e3a02000 mov r2, #0
1858: e28d3e19 add r3, sp, #400 ; 0x190
185c: e58d2000 str r2, [sp]
1860: eb0002da bl 23d0 <rtems_filesystem_evaluate_path>
strlen(mountpoint),
0,
&root_loc,
0
);
if (status != 0)
1864: e3500000 cmp r0, #0
return -1;
1868: 13e02000 mvnne r2, #0
strlen(mountpoint),
0,
&root_loc,
0
);
if (status != 0)
186c: e58d0010 str r0, [sp, #16]
return -1;
1870: 158d2010 strne r2, [sp, #16]
strlen(mountpoint),
0,
&root_loc,
0
);
if (status != 0)
1874: 1a000032 bne 1944 <rtems_tarfs_load+0x118>
return -1;
if (root_loc.ops != &IMFS_ops
1878: e59d319c ldr r3, [sp, #412] ; 0x19c
187c: e59f21d4 ldr r2, [pc, #468] ; 1a58 <rtems_tarfs_load+0x22c>
1880: e1530002 cmp r3, r2
1884: 059da010 ldreq sl, [sp, #16]
1888: 1a00006b bne 1a3c <rtems_tarfs_load+0x210>
/*
* Create an IMFS node structure pointing to tar image memory.
*/
offset = 0;
while (1) {
if (offset + 512 > tar_size)
188c: e28a4c02 add r4, sl, #512 ; 0x200
* should not have this path.
*/
else if (linkflag == REGTYPE) {
const char *name;
loc = root_loc;
1890: e28d3f5f add r3, sp, #380 ; 0x17c
/*
* Create an IMFS node structure pointing to tar image memory.
*/
offset = 0;
while (1) {
if (offset + 512 > tar_size)
1894: e1540007 cmp r4, r7
hdr_ptr = (char *) &tar_image[offset];
offset += 512;
if (strncmp(&hdr_ptr[257], "ustar ", 7))
break;
strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE);
1898: e28d5f46 add r5, sp, #280 ; 0x118
* should not have this path.
*/
else if (linkflag == REGTYPE) {
const char *name;
loc = root_loc;
189c: e58d3004 str r3, [sp, #4]
/*
* Create an IMFS node structure pointing to tar image memory.
*/
offset = 0;
while (1) {
if (offset + 512 > tar_size)
18a0: 8a000027 bhi 1944 <rtems_tarfs_load+0x118>
break;
/*
* Read a header.
*/
hdr_ptr = (char *) &tar_image[offset];
18a4: e086a00a add sl, r6, sl
offset += 512;
if (strncmp(&hdr_ptr[257], "ustar ", 7))
18a8: e28a0c01 add r0, sl, #256 ; 0x100
18ac: e2800001 add r0, r0, #1
18b0: e59f11a4 ldr r1, [pc, #420] ; 1a5c <rtems_tarfs_load+0x230>
18b4: e3a02007 mov r2, #7
18b8: eb003c43 bl 109cc <strncmp>
18bc: e2508000 subs r8, r0, #0
18c0: 1a00001f bne 1944 <rtems_tarfs_load+0x118>
break;
strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE);
18c4: e3a02063 mov r2, #99 ; 0x63
18c8: e1a0100a mov r1, sl
18cc: e1a00005 mov r0, r5
18d0: eb003c99 bl 10b3c <strncpy>
filename[MAX_NAME_FIELD_SIZE] = '\0';
18d4: e5cd817b strb r8, [sp, #379] ; 0x17b
linkflag = hdr_ptr[156];
file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8);
18d8: e3a01008 mov r1, #8
18dc: e28a0064 add r0, sl, #100 ; 0x64
break;
strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE);
filename[MAX_NAME_FIELD_SIZE] = '\0';
linkflag = hdr_ptr[156];
18e0: e5dab09c ldrb fp, [sl, #156] ; 0x9c
file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8);
18e4: eb001f96 bl 9744 <_rtems_octal2ulong>
file_size = _rtems_octal2ulong(&hdr_ptr[124], 12);
18e8: 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);
18ec: e1a09000 mov r9, r0
file_size = _rtems_octal2ulong(&hdr_ptr[124], 12);
18f0: e28a007c add r0, sl, #124 ; 0x7c
18f4: eb001f92 bl 9744 <_rtems_octal2ulong>
hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8);
18f8: 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);
18fc: e1a08000 mov r8, r0
hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8);
1900: e28a0094 add r0, sl, #148 ; 0x94
1904: eb001f8e bl 9744 <_rtems_octal2ulong>
1908: e1a03000 mov r3, r0
if (_rtems_tar_header_checksum(hdr_ptr) != hdr_chksum)
190c: e1a0000a mov r0, sl
1910: e58d300c str r3, [sp, #12]
1914: eb002097 bl 9b78 <_rtems_tar_header_checksum>
1918: e59d300c ldr r3, [sp, #12]
191c: e1500003 cmp r0, r3
1920: 1a000007 bne 1944 <rtems_tarfs_load+0x118>
* 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) {
1924: e35b0035 cmp fp, #53 ; 0x35
1928: 0a00001a beq 1998 <rtems_tarfs_load+0x16c>
* 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) {
192c: e35b0030 cmp fp, #48 ; 0x30
1930: 0a000006 beq 1950 <rtems_tarfs_load+0x124>
);
if (status != 0)
return -1;
if (root_loc.ops != &IMFS_ops
&& root_loc.ops != &fifoIMFS_ops)
1934: e1a0a004 mov sl, r4
/*
* Create an IMFS node structure pointing to tar image memory.
*/
offset = 0;
while (1) {
if (offset + 512 > tar_size)
1938: e28a4c02 add r4, sl, #512 ; 0x200
193c: e1540007 cmp r4, r7
1940: 9affffd7 bls 18a4 <rtems_tarfs_load+0x78>
nblocks = (((file_size) + 511) & ~511) / 512;
offset += 512 * nblocks;
}
}
return status;
}
1944: e59d0010 ldr r0, [sp, #16]
1948: e28ddf6a add sp, sp, #424 ; 0x1a8
194c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* should not have this path.
*/
else if (linkflag == REGTYPE) {
const char *name;
loc = root_loc;
1950: e59dc008 ldr ip, [sp, #8]
1954: e59de004 ldr lr, [sp, #4]
1958: e8bc000f ldm ip!, {r0, r1, r2, r3}
195c: e8ae000f stmia lr!, {r0, r1, r2, r3}
1960: e59cc000 ldr ip, [ip]
if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) {
1964: e1a00005 mov r0, r5
1968: e28d1f5f add r1, sp, #380 ; 0x17c
196c: e28d2f69 add r2, sp, #420 ; 0x1a4
* should not have this path.
*/
else if (linkflag == REGTYPE) {
const char *name;
loc = root_loc;
1970: e58ec000 str ip, [lr]
if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) {
1974: eb0022ad bl a430 <IMFS_evaluate_for_make>
1978: e250a000 subs sl, r0, #0
197c: 0a00001d beq 19f8 <rtems_tarfs_load+0x1cc>
);
node->info.linearfile.size = file_size;
node->info.linearfile.direct = &tar_image[offset];
}
nblocks = (((file_size) + 511) & ~511) / 512;
1980: e2888f7f add r8, r8, #508 ; 0x1fc <== NOT EXECUTED
1984: e2888003 add r8, r8, #3 <== NOT EXECUTED
1988: e1a084a8 lsr r8, r8, #9 <== NOT EXECUTED
offset += 512 * nblocks;
198c: e0844488 add r4, r4, r8, lsl #9 <== NOT EXECUTED
);
if (status != 0)
return -1;
if (root_loc.ops != &IMFS_ops
&& root_loc.ops != &fifoIMFS_ops)
1990: e1a0a004 mov sl, r4
1994: eaffffe7 b 1938 <rtems_tarfs_load+0x10c>
* - 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);
1998: e59d1014 ldr r1, [sp, #20]
199c: e28d0018 add r0, sp, #24
19a0: eb003a2d bl 1025c <strcpy>
if (full_filename[strlen(full_filename)-1] != '/')
19a4: e28d0018 add r0, sp, #24
19a8: eb003bef bl 1096c <strlen>
19ac: e28def6a add lr, sp, #424 ; 0x1a8
19b0: e08e3000 add r3, lr, r0
19b4: e5533191 ldrb r3, [r3, #-401] ; 0x191
19b8: e353002f cmp r3, #47 ; 0x2f
19bc: 0a000004 beq 19d4 <rtems_tarfs_load+0x1a8>
strcat(full_filename, "/");
19c0: e28d2018 add r2, sp, #24 <== NOT EXECUTED
19c4: e0820000 add r0, r2, r0 <== NOT EXECUTED
19c8: e59f1090 ldr r1, [pc, #144] ; 1a60 <rtems_tarfs_load+0x234><== NOT EXECUTED
19cc: e3a02002 mov r2, #2 <== NOT EXECUTED
19d0: eb0037cc bl f908 <memcpy> <== NOT EXECUTED
strcat(full_filename, filename);
19d4: e1a01005 mov r1, r5
19d8: e28d0018 add r0, sp, #24
19dc: eb003967 bl ff80 <strcat>
mkdir(full_filename, S_IRWXU | S_IRWXG | S_IRWXO);
19e0: e3a01f7f mov r1, #508 ; 0x1fc
19e4: e28d0018 add r0, sp, #24
19e8: e2811003 add r1, r1, #3
19ec: eb0004eb bl 2da0 <mkdir>
);
if (status != 0)
return -1;
if (root_loc.ops != &IMFS_ops
&& root_loc.ops != &fifoIMFS_ops)
19f0: e1a0a004 mov sl, r4
19f4: eaffffcf b 1938 <rtems_tarfs_load+0x10c>
loc = root_loc;
if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) {
node = IMFS_create_node(
&loc,
IMFS_LINEAR_FILE, (char *)name,
(file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG,
19f8: e1a03b89 lsl r3, r9, #23
19fc: 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(
1a00: e3833902 orr r3, r3, #32768 ; 0x8000
1a04: e3a01006 mov r1, #6
1a08: e28d0f5f add r0, sp, #380 ; 0x17c
1a0c: e59d21a4 ldr r2, [sp, #420] ; 0x1a4
1a10: e58da000 str sl, [sp]
1a14: eb0020ca bl 9d44 <IMFS_create_node>
&loc,
IMFS_LINEAR_FILE, (char *)name,
(file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG,
NULL
);
node->info.linearfile.size = file_size;
1a18: e5808050 str r8, [r0, #80] ; 0x50
node->info.linearfile.direct = &tar_image[offset];
}
nblocks = (((file_size) + 511) & ~511) / 512;
1a1c: e2888f7f add r8, r8, #508 ; 0x1fc
1a20: e2888003 add r8, r8, #3
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];
1a24: e0863004 add r3, r6, r4
}
nblocks = (((file_size) + 511) & ~511) / 512;
1a28: e1a084a8 lsr r8, r8, #9
&loc,
IMFS_LINEAR_FILE, (char *)name,
(file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG,
NULL
);
node->info.linearfile.size = file_size;
1a2c: e580a054 str sl, [r0, #84] ; 0x54
node->info.linearfile.direct = &tar_image[offset];
1a30: e5803058 str r3, [r0, #88] ; 0x58
}
nblocks = (((file_size) + 511) & ~511) / 512;
offset += 512 * nblocks;
1a34: e0844488 add r4, r4, r8, lsl #9
1a38: eaffffd4 b 1990 <rtems_tarfs_load+0x164>
);
if (status != 0)
return -1;
if (root_loc.ops != &IMFS_ops
&& root_loc.ops != &fifoIMFS_ops)
1a3c: e59f2020 ldr r2, [pc, #32] ; 1a64 <rtems_tarfs_load+0x238> <== NOT EXECUTED
1a40: e1530002 cmp r3, r2 <== NOT EXECUTED
1a44: 01a0a000 moveq sl, r0 <== NOT EXECUTED
1a48: 0affff8f beq 188c <rtems_tarfs_load+0x60> <== NOT EXECUTED
return -1;
1a4c: e3e03000 mvn r3, #0 <== NOT EXECUTED
1a50: e58d3010 str r3, [sp, #16] <== NOT EXECUTED
1a54: eaffffba b 1944 <rtems_tarfs_load+0x118> <== NOT EXECUTED
000035f4 <rtems_termios_bufsize>:
int cbufsize,
int raw_input,
int raw_output
)
{
rtems_termios_cbufsize = cbufsize;
35f4: e59f300c ldr r3, [pc, #12] ; 3608 <rtems_termios_bufsize+0x14><== NOT EXECUTED
35f8: e5830008 str r0, [r3, #8] <== NOT EXECUTED
rtems_termios_raw_input_size = raw_input;
35fc: e8830006 stm r3, {r1, r2} <== NOT EXECUTED
rtems_termios_raw_output_size = raw_output;
return RTEMS_SUCCESSFUL;
}
3600: e3a00000 mov r0, #0 <== NOT EXECUTED
3604: e12fff1e bx lr <== NOT EXECUTED
0000343c <rtems_termios_close>:
}
}
rtems_status_code
rtems_termios_close (void *arg)
{
343c: e92d4070 push {r4, r5, r6, lr}
rtems_libio_open_close_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
rtems_status_code sc;
sc = rtems_semaphore_obtain(
3440: e59f519c ldr r5, [pc, #412] ; 35e4 <rtems_termios_close+0x1a8>
rtems_status_code
rtems_termios_close (void *arg)
{
rtems_libio_open_close_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
3444: e5903000 ldr r3, [r0]
rtems_status_code sc;
sc = rtems_semaphore_obtain(
3448: e3a01000 mov r1, #0
}
}
rtems_status_code
rtems_termios_close (void *arg)
{
344c: e1a06000 mov r6, 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(
3450: e1a02001 mov r2, r1
3454: e5950000 ldr r0, [r5]
rtems_status_code
rtems_termios_close (void *arg)
{
rtems_libio_open_close_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
3458: e5934034 ldr r4, [r3, #52] ; 0x34
rtems_status_code sc;
sc = rtems_semaphore_obtain(
345c: eb00087b bl 5650 <rtems_semaphore_obtain>
rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
3460: e3500000 cmp r0, #0
3464: 1a00005d bne 35e0 <rtems_termios_close+0x1a4>
rtems_fatal_error_occurred (sc);
if (--tty->refcount == 0) {
3468: e5943008 ldr r3, [r4, #8]
346c: e2433001 sub r3, r3, #1
3470: e3530000 cmp r3, #0
3474: e5843008 str r3, [r4, #8]
3478: 1a00002f bne 353c <rtems_termios_close+0x100>
if (rtems_termios_linesw[tty->t_line].l_close != NULL) {
347c: e59420cc ldr r2, [r4, #204] ; 0xcc
3480: e59f3160 ldr r3, [pc, #352] ; 35e8 <rtems_termios_close+0x1ac>
3484: e0833282 add r3, r3, r2, lsl #5
3488: e5931004 ldr r1, [r3, #4]
348c: e3510000 cmp r1, #0
3490: 0a00003e beq 3590 <rtems_termios_close+0x154>
/*
* call discipline-specific close
*/
sc = rtems_termios_linesw[tty->t_line].l_close(tty);
3494: e1a00004 mov r0, r4
3498: e1a0e00f mov lr, pc
349c: e12fff11 bx r1
rtems_fatal_error_occurred (sc);
}
drainOutput (tty);
}
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
34a0: e59430b4 ldr r3, [r4, #180] ; 0xb4
34a4: e3530002 cmp r3, #2
34a8: 0a000042 beq 35b8 <rtems_termios_close+0x17c>
rtems_fatal_error_occurred (sc);
sc = rtems_event_send( tty->txTaskId, TERMIOS_TX_TERMINATE_EVENT );
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
}
if (tty->device.lastClose)
34ac: e594309c ldr r3, [r4, #156] ; 0x9c
34b0: e3530000 cmp r3, #0
(*tty->device.lastClose)(tty->major, tty->minor, arg);
34b4: 1284000c addne r0, r4, #12
34b8: 18900003 ldmne r0, {r0, r1}
34bc: 11a02006 movne r2, r6
34c0: 11a0e00f movne lr, pc
34c4: 112fff13 bxne r3
if (tty->forw == NULL) {
34c8: e5943000 ldr r3, [r4]
34cc: e3530000 cmp r3, #0
34d0: 0a000026 beq 3570 <rtems_termios_close+0x134>
rtems_termios_ttyTail = tty->back;
if ( rtems_termios_ttyTail != NULL ) {
rtems_termios_ttyTail->forw = NULL;
}
} else {
tty->forw->back = tty->back;
34d4: e5942004 ldr r2, [r4, #4]
34d8: e5832004 str r2, [r3, #4]
34dc: e5942004 ldr r2, [r4, #4]
}
if (tty->back == NULL) {
34e0: e3520000 cmp r2, #0
34e4: 0a00001b beq 3558 <rtems_termios_close+0x11c>
rtems_termios_ttyHead = tty->forw;
if ( rtems_termios_ttyHead != NULL ) {
rtems_termios_ttyHead->back = NULL;
}
} else {
tty->back->forw = tty->forw;
34e8: e5823000 str r3, [r2] <== NOT EXECUTED
}
rtems_semaphore_delete (tty->isem);
34ec: e5940014 ldr r0, [r4, #20]
34f0: eb00082d bl 55ac <rtems_semaphore_delete>
rtems_semaphore_delete (tty->osem);
34f4: e5940018 ldr r0, [r4, #24]
34f8: eb00082b bl 55ac <rtems_semaphore_delete>
rtems_semaphore_delete (tty->rawOutBuf.Semaphore);
34fc: e594008c ldr r0, [r4, #140] ; 0x8c
3500: eb000829 bl 55ac <rtems_semaphore_delete>
if ((tty->device.pollRead == NULL) ||
3504: e59430a0 ldr r3, [r4, #160] ; 0xa0
3508: e3530000 cmp r3, #0
350c: 0a00000e beq 354c <rtems_termios_close+0x110>
3510: e59430b4 ldr r3, [r4, #180] ; 0xb4
3514: e3530002 cmp r3, #2
3518: 0a00000b beq 354c <rtems_termios_close+0x110>
(tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN))
rtems_semaphore_delete (tty->rawInBuf.Semaphore);
free (tty->rawInBuf.theBuf);
351c: e5940058 ldr r0, [r4, #88] ; 0x58
3520: ebfffaa7 bl 1fc4 <free>
free (tty->rawOutBuf.theBuf);
3524: e594007c ldr r0, [r4, #124] ; 0x7c
3528: ebfffaa5 bl 1fc4 <free>
free (tty->cbuf);
352c: e594001c ldr r0, [r4, #28]
3530: ebfffaa3 bl 1fc4 <free>
free (tty);
3534: e1a00004 mov r0, r4
3538: ebfffaa1 bl 1fc4 <free>
}
rtems_semaphore_release (rtems_termios_ttyMutex);
353c: e5950000 ldr r0, [r5]
3540: eb00088b bl 5774 <rtems_semaphore_release>
return RTEMS_SUCCESSFUL;
}
3544: e3a00000 mov r0, #0
3548: e8bd8070 pop {r4, r5, r6, pc}
rtems_semaphore_delete (tty->isem);
rtems_semaphore_delete (tty->osem);
rtems_semaphore_delete (tty->rawOutBuf.Semaphore);
if ((tty->device.pollRead == NULL) ||
(tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN))
rtems_semaphore_delete (tty->rawInBuf.Semaphore);
354c: e5940068 ldr r0, [r4, #104] ; 0x68
3550: eb000815 bl 55ac <rtems_semaphore_delete>
3554: eafffff0 b 351c <rtems_termios_close+0xe0>
} else {
tty->forw->back = tty->back;
}
if (tty->back == NULL) {
rtems_termios_ttyHead = tty->forw;
3558: e59f208c ldr r2, [pc, #140] ; 35ec <rtems_termios_close+0x1b0>
if ( rtems_termios_ttyHead != NULL ) {
355c: e3530000 cmp r3, #0
} else {
tty->forw->back = tty->back;
}
if (tty->back == NULL) {
rtems_termios_ttyHead = tty->forw;
3560: e5823000 str r3, [r2]
if ( rtems_termios_ttyHead != NULL ) {
rtems_termios_ttyHead->back = NULL;
3564: 13a02000 movne r2, #0
3568: 15832004 strne r2, [r3, #4]
356c: eaffffde b 34ec <rtems_termios_close+0xb0>
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;
3570: e5942004 ldr r2, [r4, #4]
3574: e59f1074 ldr r1, [pc, #116] ; 35f0 <rtems_termios_close+0x1b4>
if ( rtems_termios_ttyTail != NULL ) {
3578: e3520000 cmp r2, #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;
357c: e5812000 str r2, [r1]
if ( rtems_termios_ttyTail != NULL ) {
3580: 0afffff4 beq 3558 <rtems_termios_close+0x11c>
rtems_termios_ttyTail->forw = NULL;
3584: e5823000 str r3, [r2] <== NOT EXECUTED
3588: e5943000 ldr r3, [r4] <== NOT EXECUTED
358c: eaffffd5 b 34e8 <rtems_termios_close+0xac> <== NOT EXECUTED
sc = rtems_termios_linesw[tty->t_line].l_close(tty);
} else {
/*
* default: just flush output buffer
*/
sc = rtems_semaphore_obtain(tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
3590: e5940018 ldr r0, [r4, #24]
3594: e1a02001 mov r2, r1
3598: eb00082c bl 5650 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL) {
359c: e3500000 cmp r0, #0
35a0: 1a00000e bne 35e0 <rtems_termios_close+0x1a4>
rtems_fatal_error_occurred (sc);
}
drainOutput (tty);
35a4: e1a00004 mov r0, r4
35a8: ebfffe4e bl 2ee8 <drainOutput>
}
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
35ac: e59430b4 ldr r3, [r4, #180] ; 0xb4
35b0: e3530002 cmp r3, #2
35b4: 1affffbc bne 34ac <rtems_termios_close+0x70>
/*
* send "terminate" to I/O tasks
*/
sc = rtems_event_send( tty->rxTaskId, TERMIOS_RX_TERMINATE_EVENT );
35b8: e59400c4 ldr r0, [r4, #196] ; 0xc4
35bc: e3a01001 mov r1, #1
35c0: eb0006fb bl 51b4 <rtems_event_send>
if (sc != RTEMS_SUCCESSFUL)
35c4: e3500000 cmp r0, #0
35c8: 1a000004 bne 35e0 <rtems_termios_close+0x1a4>
rtems_fatal_error_occurred (sc);
sc = rtems_event_send( tty->txTaskId, TERMIOS_TX_TERMINATE_EVENT );
35cc: e59400c8 ldr r0, [r4, #200] ; 0xc8
35d0: e3a01001 mov r1, #1
35d4: eb0006f6 bl 51b4 <rtems_event_send>
if (sc != RTEMS_SUCCESSFUL)
35d8: e3500000 cmp r0, #0
35dc: 0affffb2 beq 34ac <rtems_termios_close+0x70>
rtems_fatal_error_occurred (sc);
35e0: eb0009bd bl 5cdc <rtems_fatal_error_occurred> <== NOT EXECUTED
00004bc4 <rtems_termios_dequeue_characters>:
rtems_status_code sc;
/*
* sum up character count already sent
*/
tty->t_dqlen += len;
4bc4: e590c090 ldr ip, [r0, #144] ; 0x90
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
4bc8: e59020b4 ldr r2, [r0, #180] ; 0xb4
rtems_status_code sc;
/*
* sum up character count already sent
*/
tty->t_dqlen += len;
4bcc: e08c1001 add r1, ip, r1
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
4bd0: e3520002 cmp r2, #2
* for each transmitted character.
* It returns number of characters left to transmit
*/
int
rtems_termios_dequeue_characters (void *ttyp, int len)
{
4bd4: e52de004 push {lr} ; (str lr, [sp, #-4]!)
rtems_status_code sc;
/*
* sum up character count already sent
*/
tty->t_dqlen += len;
4bd8: e5801090 str r1, [r0, #144] ; 0x90
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
4bdc: 0a00000c beq 4c14 <rtems_termios_dequeue_characters+0x50>
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
return 0; /* nothing to output in IRQ... */
}
if (tty->t_line == PPPDISC ) {
4be0: e59030cc ldr r3, [r0, #204] ; 0xcc
4be4: e3530005 cmp r3, #5
4be8: 0a000001 beq 4bf4 <rtems_termios_dequeue_characters+0x30>
}
return 0; /* nothing to output in IRQ... */
}
return rtems_termios_refill_transmitter(tty);
}
4bec: 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);
4bf0: eaffff55 b 494c <rtems_termios_refill_transmitter>
if (tty->t_line == PPPDISC ) {
/*
* call any line discipline start function
*/
if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
4bf4: e59f303c ldr r3, [pc, #60] ; 4c38 <rtems_termios_dequeue_characters+0x74>
4bf8: e59330b4 ldr r3, [r3, #180] ; 0xb4
4bfc: e3530000 cmp r3, #0
4c00: 0a00000a beq 4c30 <rtems_termios_dequeue_characters+0x6c>
rtems_termios_linesw[tty->t_line].l_start(tty);
4c04: e1a0e00f mov lr, pc
4c08: e12fff13 bx r3
}
return 0; /* nothing to output in IRQ... */
4c0c: e3a00000 mov r0, #0
4c10: e49df004 pop {pc} ; (ldr pc, [sp], #4)
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
/*
* send wake up to transmitter task
*/
sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT);
4c14: e59000c8 ldr r0, [r0, #200] ; 0xc8
4c18: e1a01002 mov r1, r2
4c1c: eb000164 bl 51b4 <rtems_event_send>
if (sc != RTEMS_SUCCESSFUL)
4c20: e2503000 subs r3, r0, #0
rtems_fatal_error_occurred (sc);
return 0; /* nothing to output in IRQ... */
4c24: 01a00003 moveq r0, r3
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
/*
* send wake up to transmitter task
*/
sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT);
if (sc != RTEMS_SUCCESSFUL)
4c28: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
rtems_fatal_error_occurred (sc);
4c2c: eb00042a bl 5cdc <rtems_fatal_error_occurred> <== NOT EXECUTED
* call any line discipline start function
*/
if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
rtems_termios_linesw[tty->t_line].l_start(tty);
}
return 0; /* nothing to output in IRQ... */
4c30: e1a00003 mov r0, r3 <== NOT EXECUTED
}
return rtems_termios_refill_transmitter(tty);
}
4c34: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
000045d0 <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)
{
45d0: e92d4ff0 push {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) {
45d4: e59030cc ldr r3, [r0, #204] ; 0xcc
45d8: e59f72dc ldr r7, [pc, #732] ; 48bc <rtems_termios_enqueue_raw_characters+0x2ec>
45dc: e0873283 add r3, r7, r3, lsl #5
45e0: e5939010 ldr r9, [r3, #16]
45e4: 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)
{
45e8: e24dd008 sub sp, sp, #8
45ec: e1a04000 mov r4, r0
45f0: e1a05001 mov r5, 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) {
45f4: 0a00001d beq 4670 <rtems_termios_enqueue_raw_characters+0xa0>
while (len--) {
45f8: e3520000 cmp r2, #0
45fc: 0a00000a beq 462c <rtems_termios_enqueue_raw_characters+0x5c>
4600: e1a06002 mov r6, r2
4604: ea000002 b 4614 <rtems_termios_enqueue_raw_characters+0x44>
4608: e59430cc ldr r3, [r4, #204] ; 0xcc
460c: e0873283 add r3, r7, r3, lsl #5
4610: e5939010 ldr r9, [r3, #16]
c = *buf++;
rtems_termios_linesw[tty->t_line].l_rint(c,tty);
4614: e4d50001 ldrb r0, [r5], #1
4618: e1a01004 mov r1, r4
461c: e1a0e00f mov lr, pc
4620: e12fff19 bx r9
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--) {
4624: e2566001 subs r6, r6, #1
4628: 1afffff6 bne 4608 <rtems_termios_enqueue_raw_characters+0x38>
}
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
462c: e594a0e4 ldr sl, [r4, #228] ; 0xe4
4630: e35a0000 cmp sl, #0
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
tty->tty_rcvwakeup = 1;
}
return 0;
4634: 13a0a000 movne sl, #0
}
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
4638: 1a000009 bne 4664 <rtems_termios_enqueue_raw_characters+0x94>
463c: e59430dc ldr r3, [r4, #220] ; 0xdc
4640: e3530000 cmp r3, #0
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
tty->tty_rcvwakeup = 1;
}
return 0;
4644: 01a0a003 moveq sl, r3
}
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
4648: 0a000005 beq 4664 <rtems_termios_enqueue_raw_characters+0x94>
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
464c: e2840030 add r0, r4, #48 ; 0x30 <== NOT EXECUTED
4650: e59410e0 ldr r1, [r4, #224] ; 0xe0 <== NOT EXECUTED
4654: e1a0e00f mov lr, pc <== NOT EXECUTED
4658: e12fff13 bx r3 <== NOT EXECUTED
tty->tty_rcvwakeup = 1;
465c: e3a03001 mov r3, #1 <== NOT EXECUTED
4660: e58430e4 str r3, [r4, #228] ; 0xe4 <== NOT EXECUTED
}
tty->rawInBufDropped += dropped;
rtems_semaphore_release (tty->rawInBuf.Semaphore);
return dropped;
}
4664: e1a0000a mov r0, sl
4668: e28dd008 add sp, sp, #8
466c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/*
* 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);
4670: e2803030 add r3, r0, #48 ; 0x30
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) {
4674: e1a06002 mov r6, r2
/*
* 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);
4678: e58d3000 str r3, [sp]
tty->tty_rcvwakeup = 1;
}
return 0;
}
while (len--) {
467c: e3560000 cmp r6, #0
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,
4680: e280304a add r3, r0, #74 ; 0x4a
4684: e58d3004 str r3, [sp, #4]
4688: e1a0b009 mov fp, r9
tty->tty_rcvwakeup = 1;
}
return 0;
}
while (len--) {
468c: 0a000044 beq 47a4 <rtems_termios_enqueue_raw_characters+0x1d4>
c = *buf++;
/* FIXME: implement IXANY: any character restarts output */
/* if incoming XON/XOFF controls outgoing stream: */
if (tty->flow_ctrl & FL_MDXON) {
4690: e59430b8 ldr r3, [r4, #184] ; 0xb8
4694: e3130c02 tst r3, #512 ; 0x200
}
return 0;
}
while (len--) {
c = *buf++;
4698: e4d58001 ldrb r8, [r5], #1
/* FIXME: implement IXANY: any character restarts output */
/* if incoming XON/XOFF controls outgoing stream: */
if (tty->flow_ctrl & FL_MDXON) {
469c: 0a000005 beq 46b8 <rtems_termios_enqueue_raw_characters+0xe8>
/* if received char is V_STOP and V_START (both are equal value) */
if (c == tty->termios.c_cc[VSTOP]) {
46a0: e5d4304a ldrb r3, [r4, #74] ; 0x4a
46a4: e1530008 cmp r3, r8
46a8: 0a000058 beq 4810 <rtems_termios_enqueue_raw_characters+0x240>
/* stop output */
tty->flow_ctrl |= FL_ORCVXOF;
}
flow_rcv = true;
}
else if (c == tty->termios.c_cc[VSTART]) {
46ac: e5d43049 ldrb r3, [r4, #73] ; 0x49
46b0: e1530008 cmp r3, r8
46b4: 0a000041 beq 47c0 <rtems_termios_enqueue_raw_characters+0x1f0>
/* restart output */
tty->flow_ctrl &= ~FL_ORCVXOF;
flow_rcv = true;
}
}
if (flow_rcv) {
46b8: e3590000 cmp r9, #0
46bc: 1a000043 bne 47d0 <rtems_termios_enqueue_raw_characters+0x200>
}
/* reenable interrupts */
rtems_interrupt_enable(level);
}
} else {
newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size;
46c0: e5940060 ldr r0, [r4, #96] ; 0x60
46c4: e5941064 ldr r1, [r4, #100] ; 0x64
46c8: e2800001 add r0, r0, #1
46cc: eb002f53 bl 10420 <__umodsi3>
46d0: e1a07000 mov r7, r0
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
46d4: e10fa000 mrs sl, CPSR
46d8: e38a3080 orr r3, sl, #128 ; 0x80
46dc: e129f003 msr CPSR_fc, r3
/* if chars_in_buffer > highwater */
rtems_interrupt_disable(level);
if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size)
46e0: e594305c ldr r3, [r4, #92] ; 0x5c
46e4: e5940064 ldr r0, [r4, #100] ; 0x64
46e8: e0630000 rsb r0, r3, r0
% tty->rawInBuf.Size) > tty->highwater) &&
46ec: e5941064 ldr r1, [r4, #100] ; 0x64
46f0: e0800007 add r0, r0, r7
46f4: eb002f49 bl 10420 <__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)
46f8: e59430c0 ldr r3, [r4, #192] ; 0xc0
46fc: e1500003 cmp r0, r3
4700: 9a000010 bls 4748 <rtems_termios_enqueue_raw_characters+0x178>
% tty->rawInBuf.Size) > tty->highwater) &&
!(tty->flow_ctrl & FL_IREQXOF)) {
4704: 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) &&
4708: e3130001 tst r3, #1 <== NOT EXECUTED
470c: 1a00000d bne 4748 <rtems_termios_enqueue_raw_characters+0x178><== NOT EXECUTED
!(tty->flow_ctrl & FL_IREQXOF)) {
/* incoming data stream should be stopped */
tty->flow_ctrl |= FL_IREQXOF;
4710: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
4714: e3833001 orr r3, r3, #1 <== NOT EXECUTED
4718: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF))
471c: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
4720: e3c33fff bic r3, r3, #1020 ; 0x3fc <== NOT EXECUTED
4724: e3c33001 bic r3, r3, #1 <== NOT EXECUTED
4728: e1a03a83 lsl r3, r3, #21 <== NOT EXECUTED
472c: e1a03aa3 lsr r3, r3, #21 <== NOT EXECUTED
4730: e3530b01 cmp r3, #1024 ; 0x400 <== NOT EXECUTED
4734: 0a000047 beq 4858 <rtems_termios_enqueue_raw_characters+0x288><== NOT EXECUTED
/* call write function here */
tty->flow_ctrl |= FL_ISNTXOF;
(*tty->device.write)(tty->minor,
(void *)&(tty->termios.c_cc[VSTOP]), 1);
}
} else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
4738: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
473c: e2033f41 and r3, r3, #260 ; 0x104 <== NOT EXECUTED
4740: e3530c01 cmp r3, #256 ; 0x100 <== NOT EXECUTED
4744: 0a000052 beq 4894 <rtems_termios_enqueue_raw_characters+0x2c4><== NOT EXECUTED
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
4748: e129f00a msr CPSR_fc, sl
}
/* reenable interrupts */
rtems_interrupt_enable(level);
if (newTail == tty->rawInBuf.Head) {
474c: e594305c ldr r3, [r4, #92] ; 0x5c
4750: e1530007 cmp r3, r7
dropped++;
4754: 028bb001 addeq fp, fp, #1
}
/* reenable interrupts */
rtems_interrupt_enable(level);
if (newTail == tty->rawInBuf.Head) {
4758: 0a00000e beq 4798 <rtems_termios_enqueue_raw_characters+0x1c8>
dropped++;
} else {
tty->rawInBuf.theBuf[newTail] = c;
475c: e5943058 ldr r3, [r4, #88] ; 0x58
4760: e7c38007 strb r8, [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 )) {
4764: e59430e4 ldr r3, [r4, #228] ; 0xe4
4768: e3530000 cmp r3, #0
if (newTail == tty->rawInBuf.Head) {
dropped++;
} else {
tty->rawInBuf.theBuf[newTail] = c;
tty->rawInBuf.Tail = newTail;
476c: 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 )) {
4770: 1a000008 bne 4798 <rtems_termios_enqueue_raw_characters+0x1c8>
4774: e59430dc ldr r3, [r4, #220] ; 0xdc
4778: e3530000 cmp r3, #0
477c: 0a000005 beq 4798 <rtems_termios_enqueue_raw_characters+0x1c8>
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
4780: e59d0000 ldr r0, [sp] <== NOT EXECUTED
4784: e59410e0 ldr r1, [r4, #224] ; 0xe0 <== NOT EXECUTED
4788: e1a0e00f mov lr, pc <== NOT EXECUTED
478c: e12fff13 bx r3 <== NOT EXECUTED
tty->tty_rcvwakeup = 1;
4790: e3a03001 mov r3, #1 <== NOT EXECUTED
4794: e58430e4 str r3, [r4, #228] ; 0xe4 <== NOT EXECUTED
4798: e2466001 sub r6, r6, #1
tty->tty_rcvwakeup = 1;
}
return 0;
}
while (len--) {
479c: e3560000 cmp r6, #0
47a0: 1affffba bne 4690 <rtems_termios_enqueue_raw_characters+0xc0>
}
}
}
}
tty->rawInBufDropped += dropped;
47a4: e5943078 ldr r3, [r4, #120] ; 0x78
47a8: e083300b add r3, r3, fp
47ac: e5843078 str r3, [r4, #120] ; 0x78
rtems_semaphore_release (tty->rawInBuf.Semaphore);
47b0: e5940068 ldr r0, [r4, #104] ; 0x68
47b4: e1a0a00b mov sl, fp
47b8: eb0003ed bl 5774 <rtems_semaphore_release>
return dropped;
47bc: eaffffa8 b 4664 <rtems_termios_enqueue_raw_characters+0x94>
flow_rcv = true;
}
else if (c == tty->termios.c_cc[VSTART]) {
/* VSTART received */
/* restart output */
tty->flow_ctrl &= ~FL_ORCVXOF;
47c0: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
47c4: e3c33010 bic r3, r3, #16 <== NOT EXECUTED
47c8: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
* 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)
{
47cc: e3a09001 mov r9, #1 <== NOT EXECUTED
flow_rcv = true;
}
}
if (flow_rcv) {
/* restart output according to FL_ORCVXOF flag */
if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) {
47d0: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
47d4: e2033030 and r3, r3, #48 ; 0x30 <== NOT EXECUTED
47d8: e3530020 cmp r3, #32 <== NOT EXECUTED
47dc: 1affffed bne 4798 <rtems_termios_enqueue_raw_characters+0x1c8><== NOT EXECUTED
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
47e0: e10f7000 mrs r7, CPSR <== NOT EXECUTED
47e4: e3873080 orr r3, r7, #128 ; 0x80 <== NOT EXECUTED
47e8: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED
/* disable interrupts */
rtems_interrupt_disable(level);
tty->flow_ctrl &= ~FL_OSTOP;
47ec: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
47f0: e5942094 ldr r2, [r4, #148] ; 0x94 <== NOT EXECUTED
if (flow_rcv) {
/* restart output according to FL_ORCVXOF flag */
if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) {
/* disable interrupts */
rtems_interrupt_disable(level);
tty->flow_ctrl &= ~FL_OSTOP;
47f4: e3c33020 bic r3, r3, #32 <== NOT EXECUTED
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
47f8: e3520000 cmp r2, #0 <== NOT EXECUTED
if (flow_rcv) {
/* restart output according to FL_ORCVXOF flag */
if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) {
/* disable interrupts */
rtems_interrupt_disable(level);
tty->flow_ctrl &= ~FL_OSTOP;
47fc: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
4800: 1a00000c bne 4838 <rtems_termios_enqueue_raw_characters+0x268><== NOT EXECUTED
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
4804: e129f007 msr CPSR_fc, r7 <== NOT EXECUTED
/*
* 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);
tty->tty_rcvwakeup = 1;
4808: e2466001 sub r6, r6, #1 <== NOT EXECUTED
480c: eaffffe2 b 479c <rtems_termios_enqueue_raw_characters+0x1cc><== NOT EXECUTED
/* FIXME: implement IXANY: any character restarts output */
/* if incoming XON/XOFF controls outgoing stream: */
if (tty->flow_ctrl & FL_MDXON) {
/* 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]) {
4810: e5d42049 ldrb r2, [r4, #73] ; 0x49 <== NOT EXECUTED
4814: e1520003 cmp r2, r3 <== NOT EXECUTED
/* received VSTOP and VSTART==VSTOP? */
/* then toggle "stop output" status */
tty->flow_ctrl = tty->flow_ctrl ^ FL_ORCVXOF;
4818: 059430b8 ldreq r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
}
else {
/* VSTOP received (other code than VSTART) */
/* stop output */
tty->flow_ctrl |= FL_ORCVXOF;
481c: 159430b8 ldrne r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* 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;
4820: 02233010 eoreq r3, r3, #16 <== NOT EXECUTED
}
else {
/* VSTOP received (other code than VSTART) */
/* stop output */
tty->flow_ctrl |= FL_ORCVXOF;
4824: 13833010 orrne r3, r3, #16 <== NOT EXECUTED
/* 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;
4828: 058430b8 streq r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
}
else {
/* VSTOP received (other code than VSTART) */
/* stop output */
tty->flow_ctrl |= FL_ORCVXOF;
482c: 158430b8 strne r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
* 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)
{
4830: e3a09001 mov r9, #1 <== NOT EXECUTED
4834: eaffffe5 b 47d0 <rtems_termios_enqueue_raw_characters+0x200><== NOT EXECUTED
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)(
tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1);
4838: 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)(
483c: e594107c ldr r1, [r4, #124] ; 0x7c <== NOT EXECUTED
4840: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
4844: e0811003 add r1, r1, r3 <== NOT EXECUTED
4848: e3a02001 mov r2, #1 <== NOT EXECUTED
484c: e1a0e00f mov lr, pc <== NOT EXECUTED
4850: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED
4854: eaffffea b 4804 <rtems_termios_enqueue_raw_characters+0x234><== NOT EXECUTED
!(tty->flow_ctrl & FL_IREQXOF)) {
/* incoming data stream should be stopped */
tty->flow_ctrl |= FL_IREQXOF;
if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF))
== (FL_MDXOF ) ) {
if ((tty->flow_ctrl & FL_OSTOP) ||
4858: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
485c: e3130020 tst r3, #32 <== NOT EXECUTED
4860: 1a000002 bne 4870 <rtems_termios_enqueue_raw_characters+0x2a0><== NOT EXECUTED
4864: e5943094 ldr r3, [r4, #148] ; 0x94 <== NOT EXECUTED
4868: e3530000 cmp r3, #0 <== NOT EXECUTED
486c: 1affffb5 bne 4748 <rtems_termios_enqueue_raw_characters+0x178><== 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;
4870: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
4874: e3833002 orr r3, r3, #2 <== NOT EXECUTED
4878: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
(*tty->device.write)(tty->minor,
487c: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
4880: e59d1004 ldr r1, [sp, #4] <== NOT EXECUTED
4884: e3a02001 mov r2, #1 <== NOT EXECUTED
4888: e1a0e00f mov lr, pc <== NOT EXECUTED
488c: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED
4890: eaffffac b 4748 <rtems_termios_enqueue_raw_characters+0x178><== NOT EXECUTED
(void *)&(tty->termios.c_cc[VSTOP]), 1);
}
} else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
tty->flow_ctrl |= FL_IRTSOFF;
4894: e59420b8 ldr r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* deactivate RTS line */
if (tty->device.stopRemoteTx != NULL) {
4898: e59430ac ldr r3, [r4, #172] ; 0xac <== NOT EXECUTED
tty->flow_ctrl |= FL_ISNTXOF;
(*tty->device.write)(tty->minor,
(void *)&(tty->termios.c_cc[VSTOP]), 1);
}
} else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
tty->flow_ctrl |= FL_IRTSOFF;
489c: e3822004 orr r2, r2, #4 <== NOT EXECUTED
/* deactivate RTS line */
if (tty->device.stopRemoteTx != NULL) {
48a0: e3530000 cmp r3, #0 <== NOT EXECUTED
tty->flow_ctrl |= FL_ISNTXOF;
(*tty->device.write)(tty->minor,
(void *)&(tty->termios.c_cc[VSTOP]), 1);
}
} else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
tty->flow_ctrl |= FL_IRTSOFF;
48a4: e58420b8 str r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* deactivate RTS line */
if (tty->device.stopRemoteTx != NULL) {
48a8: 0affffa6 beq 4748 <rtems_termios_enqueue_raw_characters+0x178><== NOT EXECUTED
tty->device.stopRemoteTx(tty->minor);
48ac: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
48b0: e1a0e00f mov lr, pc <== NOT EXECUTED
48b4: e12fff13 bx r3 <== NOT EXECUTED
48b8: eaffffa2 b 4748 <rtems_termios_enqueue_raw_characters+0x178><== NOT EXECUTED
0000360c <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;
360c: e5902000 ldr r2, [r0]
}
}
rtems_status_code
rtems_termios_ioctl (void *arg)
{
3610: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
rtems_libio_ioctl_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
3614: e5925034 ldr r5, [r2, #52] ; 0x34
struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer;
rtems_status_code sc;
args->ioctl_return = 0;
3618: e3a03000 mov r3, #0
}
}
rtems_status_code
rtems_termios_ioctl (void *arg)
{
361c: e1a04000 mov r4, r0
rtems_libio_ioctl_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer;
rtems_status_code sc;
args->ioctl_return = 0;
3620: e580300c str r3, [r0, #12]
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
3624: e1a01003 mov r1, r3
3628: e5950018 ldr r0, [r5, #24]
362c: e1a02003 mov r2, r3
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;
3630: e5947008 ldr r7, [r4, #8]
rtems_status_code sc;
args->ioctl_return = 0;
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
3634: eb000805 bl 5650 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL) {
3638: e2506000 subs r6, r0, #0
363c: 1a00000e bne 367c <rtems_termios_ioctl+0x70>
args->ioctl_return = sc;
return sc;
}
switch (args->command) {
3640: e5943004 ldr r3, [r4, #4]
3644: e3530004 cmp r3, #4
3648: 0a000006 beq 3668 <rtems_termios_ioctl+0x5c>
364c: 8a00000d bhi 3688 <rtems_termios_ioctl+0x7c>
3650: e3530002 cmp r3, #2
3654: 0a000020 beq 36dc <rtems_termios_ioctl+0xd0>
3658: 9a000087 bls 387c <rtems_termios_ioctl+0x270>
if (tty->device.setAttributes)
(*tty->device.setAttributes)(tty->minor, &tty->termios);
break;
case RTEMS_IO_TCDRAIN:
drainOutput (tty);
365c: e1a00005 mov r0, r5
3660: ebfffe20 bl 2ee8 <drainOutput>
break;
3664: ea000002 b 3674 <rtems_termios_ioctl+0x68>
case RTEMS_IO_SNDWAKEUP:
tty->tty_snd = *wakeup;
break;
case RTEMS_IO_RCVWAKEUP:
tty->tty_rcv = *wakeup;
3668: e897000c ldm r7, {r2, r3} <== NOT EXECUTED
366c: e58520dc str r2, [r5, #220] ; 0xdc <== NOT EXECUTED
3670: e58530e0 str r3, [r5, #224] ; 0xe0 <== NOT EXECUTED
*(int *)args->buffer = tty->ccount - tty->cindex + rawnc;
}
break;
}
rtems_semaphore_release (tty->osem);
3674: e5950018 ldr r0, [r5, #24]
3678: eb00083d bl 5774 <rtems_semaphore_release>
args->ioctl_return = sc;
367c: e584600c str r6, [r4, #12]
return sc;
}
3680: e1a00006 mov r0, r6
3684: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL) {
args->ioctl_return = sc;
return sc;
}
switch (args->command) {
3688: e3a02a46 mov r2, #286720 ; 0x46000
368c: e2822e67 add r2, r2, #1648 ; 0x670
3690: e282213d add r2, r2, #1073741839 ; 0x4000000f
3694: e1530002 cmp r3, r2
3698: 0a00006b beq 384c <rtems_termios_ioctl+0x240>
369c: 8a000082 bhi 38ac <rtems_termios_ioctl+0x2a0>
36a0: e3530005 cmp r3, #5
36a4: 0a0000a5 beq 3940 <rtems_termios_ioctl+0x334>
default:
if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) {
36a8: e59520cc ldr r2, [r5, #204] ; 0xcc
36ac: e59f3334 ldr r3, [pc, #820] ; 39e8 <rtems_termios_ioctl+0x3dc>
36b0: e0833282 add r3, r3, r2, lsl #5
36b4: e5933018 ldr r3, [r3, #24]
36b8: e3530000 cmp r3, #0
sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args);
}
else {
sc = RTEMS_INVALID_NUMBER;
36bc: 03a0600a moveq r6, #10
args->ioctl_return = sc;
return sc;
}
switch (args->command) {
default:
if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) {
36c0: 0affffeb beq 3674 <rtems_termios_ioctl+0x68>
sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args);
36c4: e1a00005 mov r0, r5
36c8: e1a01004 mov r1, r4
36cc: e1a0e00f mov lr, pc
36d0: e12fff13 bx r3
36d4: e1a06000 mov r6, r0
36d8: eaffffe5 b 3674 <rtems_termios_ioctl+0x68>
case RTEMS_IO_GET_ATTRIBUTES:
*(struct termios *)args->buffer = tty->termios;
break;
case RTEMS_IO_SET_ATTRIBUTES:
tty->termios = *(struct termios *)args->buffer;
36dc: e594e008 ldr lr, [r4, #8]
36e0: e2857030 add r7, r5, #48 ; 0x30
36e4: e8be000f ldm lr!, {r0, r1, r2, r3}
36e8: e1a0c007 mov ip, r7
36ec: e8ac000f stmia ip!, {r0, r1, r2, r3}
36f0: e8be000f ldm lr!, {r0, r1, r2, r3}
36f4: e8ac000f stmia ip!, {r0, r1, r2, r3}
/*
* check for flow control options to be switched off
*/
/* check for outgoing XON/XOFF flow control switched off */
if (( tty->flow_ctrl & FL_MDXON) &&
36f8: e59520b8 ldr r2, [r5, #184] ; 0xb8
case RTEMS_IO_GET_ATTRIBUTES:
*(struct termios *)args->buffer = tty->termios;
break;
case RTEMS_IO_SET_ATTRIBUTES:
tty->termios = *(struct termios *)args->buffer;
36fc: e59e3000 ldr r3, [lr]
/*
* check for flow control options to be switched off
*/
/* check for outgoing XON/XOFF flow control switched off */
if (( tty->flow_ctrl & FL_MDXON) &&
3700: e3120c02 tst r2, #512 ; 0x200
case RTEMS_IO_GET_ATTRIBUTES:
*(struct termios *)args->buffer = tty->termios;
break;
case RTEMS_IO_SET_ATTRIBUTES:
tty->termios = *(struct termios *)args->buffer;
3704: 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) &&
3708: 0a000012 beq 3758 <rtems_termios_ioctl+0x14c>
!(tty->termios.c_iflag & IXON)) {
370c: e5953030 ldr r3, [r5, #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) &&
3710: e3130b01 tst r3, #1024 ; 0x400
3714: 1a00000f bne 3758 <rtems_termios_ioctl+0x14c>
!(tty->termios.c_iflag & IXON)) {
/* clear related flags in flow_ctrl */
tty->flow_ctrl &= ~(FL_MDXON | FL_ORCVXOF);
3718: e59530b8 ldr r3, [r5, #184] ; 0xb8 <== NOT EXECUTED
371c: e3c33e21 bic r3, r3, #528 ; 0x210 <== NOT EXECUTED
3720: e58530b8 str r3, [r5, #184] ; 0xb8 <== NOT EXECUTED
/* has output been stopped due to received XOFF? */
if (tty->flow_ctrl & FL_OSTOP) {
3724: e59530b8 ldr r3, [r5, #184] ; 0xb8 <== NOT EXECUTED
3728: e3130020 tst r3, #32 <== NOT EXECUTED
372c: 0a000009 beq 3758 <rtems_termios_ioctl+0x14c> <== NOT EXECUTED
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
3730: e10f8000 mrs r8, CPSR <== NOT EXECUTED
3734: e3883080 orr r3, r8, #128 ; 0x80 <== NOT EXECUTED
3738: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED
/* disable interrupts */
rtems_interrupt_disable(level);
tty->flow_ctrl &= ~FL_OSTOP;
373c: e59530b8 ldr r3, [r5, #184] ; 0xb8 <== NOT EXECUTED
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
3740: e5952094 ldr r2, [r5, #148] ; 0x94 <== NOT EXECUTED
/* has output been stopped due to received XOFF? */
if (tty->flow_ctrl & FL_OSTOP) {
/* disable interrupts */
rtems_interrupt_disable(level);
tty->flow_ctrl &= ~FL_OSTOP;
3744: e3c33020 bic r3, r3, #32 <== NOT EXECUTED
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
3748: e3520000 cmp r2, #0 <== NOT EXECUTED
/* has output been stopped due to received XOFF? */
if (tty->flow_ctrl & FL_OSTOP) {
/* disable interrupts */
rtems_interrupt_disable(level);
tty->flow_ctrl &= ~FL_OSTOP;
374c: e58530b8 str r3, [r5, #184] ; 0xb8 <== NOT EXECUTED
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
3750: 1a00009c bne 39c8 <rtems_termios_ioctl+0x3bc> <== NOT EXECUTED
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
3754: e129f008 msr CPSR_fc, r8 <== 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)) {
3758: e59530b8 ldr r3, [r5, #184] ; 0xb8
375c: e3130b01 tst r3, #1024 ; 0x400
3760: 0a000008 beq 3788 <rtems_termios_ioctl+0x17c>
3764: e5953030 ldr r3, [r5, #48] ; 0x30 <== NOT EXECUTED
3768: e3130a01 tst r3, #4096 ; 0x1000 <== NOT EXECUTED
376c: 1a000005 bne 3788 <rtems_termios_ioctl+0x17c> <== NOT EXECUTED
/* clear related flags in flow_ctrl */
tty->flow_ctrl &= ~(FL_MDXOF);
3770: e59530b8 ldr r3, [r5, #184] ; 0xb8 <== NOT EXECUTED
3774: e3c33b01 bic r3, r3, #1024 ; 0x400 <== NOT EXECUTED
3778: e58530b8 str r3, [r5, #184] ; 0xb8 <== NOT EXECUTED
/* FIXME: what happens, if we had sent XOFF but not yet XON? */
tty->flow_ctrl &= ~(FL_ISNTXOF);
377c: e59530b8 ldr r3, [r5, #184] ; 0xb8 <== NOT EXECUTED
3780: e3c33002 bic r3, r3, #2 <== NOT EXECUTED
3784: e58530b8 str r3, [r5, #184] ; 0xb8 <== NOT EXECUTED
}
/* check for incoming RTS/CTS flow control switched off */
if (( tty->flow_ctrl & FL_MDRTS) && !(tty->termios.c_cflag & CRTSCTS)) {
3788: e59530b8 ldr r3, [r5, #184] ; 0xb8
378c: e3130c01 tst r3, #256 ; 0x100
3790: 05952038 ldreq r2, [r5, #56] ; 0x38
3794: 0a000012 beq 37e4 <rtems_termios_ioctl+0x1d8>
3798: e5952038 ldr r2, [r5, #56] ; 0x38 <== NOT EXECUTED
379c: e3520000 cmp r2, #0 <== NOT EXECUTED
37a0: ba00007c blt 3998 <rtems_termios_ioctl+0x38c> <== NOT EXECUTED
/* clear related flags in flow_ctrl */
tty->flow_ctrl &= ~(FL_MDRTS);
37a4: e59530b8 ldr r3, [r5, #184] ; 0xb8 <== NOT EXECUTED
37a8: e3c33c01 bic r3, r3, #256 ; 0x100 <== NOT EXECUTED
37ac: e58530b8 str r3, [r5, #184] ; 0xb8 <== NOT EXECUTED
/* restart remote Tx, if it was stopped */
if ((tty->flow_ctrl & FL_IRTSOFF) && (tty->device.startRemoteTx != NULL)) {
37b0: e59530b8 ldr r3, [r5, #184] ; 0xb8 <== NOT EXECUTED
37b4: e3130004 tst r3, #4 <== NOT EXECUTED
37b8: 0a000006 beq 37d8 <rtems_termios_ioctl+0x1cc> <== NOT EXECUTED
37bc: e59530b0 ldr r3, [r5, #176] ; 0xb0 <== NOT EXECUTED
37c0: e3530000 cmp r3, #0 <== NOT EXECUTED
37c4: 0a000003 beq 37d8 <rtems_termios_ioctl+0x1cc> <== NOT EXECUTED
tty->device.startRemoteTx(tty->minor);
37c8: e5950010 ldr r0, [r5, #16] <== NOT EXECUTED
37cc: e1a0e00f mov lr, pc <== NOT EXECUTED
37d0: e12fff13 bx r3 <== NOT EXECUTED
37d4: e5952038 ldr r2, [r5, #56] ; 0x38 <== NOT EXECUTED
}
tty->flow_ctrl &= ~(FL_IRTSOFF);
37d8: e59530b8 ldr r3, [r5, #184] ; 0xb8 <== NOT EXECUTED
37dc: e3c33004 bic r3, r3, #4 <== NOT EXECUTED
37e0: e58530b8 str r3, [r5, #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) {
37e4: e3520000 cmp r2, #0
37e8: ba00006a blt 3998 <rtems_termios_ioctl+0x38c>
tty->flow_ctrl |= FL_MDRTS;
}
/* check for incoming XON/XOF flow control switched on */
if (tty->termios.c_iflag & IXOFF) {
37ec: e5953030 ldr r3, [r5, #48] ; 0x30
37f0: e3130a01 tst r3, #4096 ; 0x1000
tty->flow_ctrl |= FL_MDXOF;
37f4: 159520b8 ldrne r2, [r5, #184] ; 0xb8
37f8: 13822b01 orrne r2, r2, #1024 ; 0x400
37fc: 158520b8 strne r2, [r5, #184] ; 0xb8
}
/* check for outgoing XON/XOF flow control switched on */
if (tty->termios.c_iflag & IXON) {
3800: e3130b01 tst r3, #1024 ; 0x400
tty->flow_ctrl |= FL_MDXON;
3804: 159530b8 ldrne r3, [r5, #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) {
3808: e595803c ldr r8, [r5, #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;
380c: 13833c02 orrne r3, r3, #512 ; 0x200
3810: 158530b8 strne r3, [r5, #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) {
3814: e2188002 ands r8, r8, #2
3818: 0a00004c beq 3950 <rtems_termios_ioctl+0x344>
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
381c: e3a03000 mov r3, #0
3820: e585306c str r3, [r5, #108] ; 0x6c
tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
3824: e5853070 str r3, [r5, #112] ; 0x70
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
3828: e5853074 str r3, [r5, #116] ; 0x74
} else {
tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT;
}
}
}
if (tty->device.setAttributes)
382c: e59530a8 ldr r3, [r5, #168] ; 0xa8
3830: e3530000 cmp r3, #0
3834: 0affff8e beq 3674 <rtems_termios_ioctl+0x68>
(*tty->device.setAttributes)(tty->minor, &tty->termios);
3838: e5950010 ldr r0, [r5, #16]
383c: e1a01007 mov r1, r7
3840: e1a0e00f mov lr, pc
3844: e12fff13 bx r3
3848: eaffff89 b 3674 <rtems_termios_ioctl+0x68>
case TIOCGETD:
*(int*)(args->buffer)=tty->t_line;
break;
#endif
case FIONREAD: {
int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head;
384c: e5952060 ldr r2, [r5, #96] ; 0x60 <== NOT EXECUTED
3850: e595305c ldr r3, [r5, #92] ; 0x5c <== NOT EXECUTED
if ( rawnc < 0 )
3854: e0523003 subs r3, r2, r3 <== NOT EXECUTED
rawnc += tty->rawInBuf.Size;
3858: 45952064 ldrmi r2, [r5, #100] ; 0x64 <== NOT EXECUTED
385c: 40833002 addmi r3, r3, r2 <== NOT EXECUTED
/* Half guess that this is the right operation */
*(int *)args->buffer = tty->ccount - tty->cindex + rawnc;
3860: e2851020 add r1, r5, #32 <== NOT EXECUTED
3864: e8910006 ldm r1, {r1, r2} <== NOT EXECUTED
3868: e0412002 sub r2, r1, r2 <== NOT EXECUTED
386c: e5941008 ldr r1, [r4, #8] <== NOT EXECUTED
3870: e0823003 add r3, r2, r3 <== NOT EXECUTED
3874: e5813000 str r3, [r1] <== NOT EXECUTED
}
break;
3878: eaffff7d b 3674 <rtems_termios_ioctl+0x68> <== NOT EXECUTED
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL) {
args->ioctl_return = sc;
return sc;
}
switch (args->command) {
387c: e3530001 cmp r3, #1
3880: 1affff88 bne 36a8 <rtems_termios_ioctl+0x9c>
sc = RTEMS_INVALID_NUMBER;
}
break;
case RTEMS_IO_GET_ATTRIBUTES:
*(struct termios *)args->buffer = tty->termios;
3884: e5947008 ldr r7, [r4, #8]
3888: e285c030 add ip, r5, #48 ; 0x30
388c: e8bc000f ldm ip!, {r0, r1, r2, r3}
3890: e1a0e007 mov lr, r7
3894: e8ae000f stmia lr!, {r0, r1, r2, r3}
3898: e8bc000f ldm ip!, {r0, r1, r2, r3}
389c: e8ae000f stmia lr!, {r0, r1, r2, r3}
38a0: e59c3000 ldr r3, [ip]
38a4: e58e3000 str r3, [lr]
break;
38a8: eaffff71 b 3674 <rtems_termios_ioctl+0x68>
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL) {
args->ioctl_return = sc;
return sc;
}
switch (args->command) {
38ac: e3a02a47 mov r2, #290816 ; 0x47000
38b0: e2822e41 add r2, r2, #1040 ; 0x410
38b4: e2822129 add r2, r2, #1073741834 ; 0x4000000a
38b8: e1530002 cmp r3, r2
38bc: 0a00001b beq 3930 <rtems_termios_ioctl+0x324>
38c0: e3a02a47 mov r2, #290816 ; 0x47000
38c4: e2822e41 add r2, r2, #1040 ; 0x410
38c8: e282212e add r2, r2, #-2147483637 ; 0x8000000b
38cc: e1530002 cmp r3, r2
38d0: 1affff74 bne 36a8 <rtems_termios_ioctl+0x9c>
#if 1 /* FIXME */
case TIOCSETD:
/*
* close old line discipline
*/
if (rtems_termios_linesw[tty->t_line].l_close != NULL) {
38d4: e59f710c ldr r7, [pc, #268] ; 39e8 <rtems_termios_ioctl+0x3dc>
38d8: e59530cc ldr r3, [r5, #204] ; 0xcc
38dc: e0873283 add r3, r7, r3, lsl #5
38e0: e5933004 ldr r3, [r3, #4]
38e4: e3530000 cmp r3, #0
38e8: 0a000003 beq 38fc <rtems_termios_ioctl+0x2f0>
sc = rtems_termios_linesw[tty->t_line].l_close(tty);
38ec: e1a00005 mov r0, r5
38f0: e1a0e00f mov lr, pc
38f4: e12fff13 bx r3
38f8: e1a06000 mov r6, r0
}
tty->t_line=*(int*)(args->buffer);
38fc: e5943008 ldr r3, [r4, #8]
3900: e5932000 ldr r2, [r3]
tty->t_sc = NULL; /* ensure that no more valid data */
/*
* open new line discipline
*/
if (rtems_termios_linesw[tty->t_line].l_open != NULL) {
3904: e7973282 ldr r3, [r7, r2, lsl #5]
* 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);
3908: e58520cc str r2, [r5, #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) {
390c: e3530000 cmp r3, #0
*/
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);
tty->t_sc = NULL; /* ensure that no more valid data */
3910: e3a02000 mov r2, #0
3914: e58520d0 str r2, [r5, #208] ; 0xd0
/*
* open new line discipline
*/
if (rtems_termios_linesw[tty->t_line].l_open != NULL) {
3918: 0affff55 beq 3674 <rtems_termios_ioctl+0x68>
sc = rtems_termios_linesw[tty->t_line].l_open(tty);
391c: e1a00005 mov r0, r5
3920: e1a0e00f mov lr, pc
3924: e12fff13 bx r3
3928: e1a06000 mov r6, r0
392c: eaffff50 b 3674 <rtems_termios_ioctl+0x68>
}
break;
case TIOCGETD:
*(int*)(args->buffer)=tty->t_line;
3930: e5943008 ldr r3, [r4, #8]
3934: e59520cc ldr r2, [r5, #204] ; 0xcc
3938: e5832000 str r2, [r3]
break;
393c: eaffff4c b 3674 <rtems_termios_ioctl+0x68>
case RTEMS_IO_TCDRAIN:
drainOutput (tty);
break;
case RTEMS_IO_SNDWAKEUP:
tty->tty_snd = *wakeup;
3940: e897000c ldm r7, {r2, r3} <== NOT EXECUTED
3944: e58520d4 str r2, [r5, #212] ; 0xd4 <== NOT EXECUTED
3948: e58530d8 str r3, [r5, #216] ; 0xd8 <== NOT EXECUTED
break;
394c: eaffff48 b 3674 <rtems_termios_ioctl+0x68> <== NOT EXECUTED
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] *
3950: e5d5a046 ldrb sl, [r5, #70] ; 0x46 <== NOT EXECUTED
rtems_clock_get_ticks_per_second() / 10;
3954: eb000591 bl 4fa0 <rtems_clock_get_ticks_per_second> <== NOT EXECUTED
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] *
3958: e000009a mul r0, sl, r0 <== NOT EXECUTED
rtems_clock_get_ticks_per_second() / 10;
395c: e59f3088 ldr r3, [pc, #136] ; 39ec <rtems_termios_ioctl+0x3e0><== NOT EXECUTED
3960: e0831390 umull r1, r3, r0, r3 <== NOT EXECUTED
if (tty->termios.c_cc[VTIME]) {
3964: e5d52046 ldrb r2, [r5, #70] ; 0x46 <== NOT EXECUTED
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
} else {
tty->vtimeTicks = tty->termios.c_cc[VTIME] *
rtems_clock_get_ticks_per_second() / 10;
3968: e1a031a3 lsr r3, r3, #3 <== NOT EXECUTED
if (tty->termios.c_cc[VTIME]) {
396c: e3520000 cmp r2, #0 <== NOT EXECUTED
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] *
3970: e5853054 str r3, [r5, #84] ; 0x54 <== NOT EXECUTED
rtems_clock_get_ticks_per_second() / 10;
if (tty->termios.c_cc[VTIME]) {
3974: 0a00000b beq 39a8 <rtems_termios_ioctl+0x39c> <== NOT EXECUTED
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
tty->rawInBufSemaphoreTimeout = tty->vtimeTicks;
if (tty->termios.c_cc[VMIN])
3978: e5d52047 ldrb r2, [r5, #71] ; 0x47 <== NOT EXECUTED
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
397c: e3520000 cmp r2, #0 <== NOT EXECUTED
3980: 01a02003 moveq r2, r3 <== NOT EXECUTED
3984: 13a02000 movne r2, #0 <== NOT EXECUTED
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;
3988: e585806c str r8, [r5, #108] ; 0x6c <== NOT EXECUTED
tty->rawInBufSemaphoreTimeout = tty->vtimeTicks;
398c: e5853070 str r3, [r5, #112] ; 0x70 <== NOT EXECUTED
if (tty->termios.c_cc[VMIN])
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
3990: e5852074 str r2, [r5, #116] ; 0x74 <== NOT EXECUTED
3994: eaffffa4 b 382c <rtems_termios_ioctl+0x220> <== 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) {
tty->flow_ctrl |= FL_MDRTS;
3998: e59530b8 ldr r3, [r5, #184] ; 0xb8 <== NOT EXECUTED
399c: e3833c01 orr r3, r3, #256 ; 0x100 <== NOT EXECUTED
39a0: e58530b8 str r3, [r5, #184] ; 0xb8 <== NOT EXECUTED
39a4: eaffff90 b 37ec <rtems_termios_ioctl+0x1e0> <== NOT EXECUTED
if (tty->termios.c_cc[VMIN])
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
else
tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks;
} else {
if (tty->termios.c_cc[VMIN]) {
39a8: e5d53047 ldrb r3, [r5, #71] ; 0x47 <== NOT EXECUTED
39ac: e3530000 cmp r3, #0 <== NOT EXECUTED
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
} else {
tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT;
39b0: 03a03001 moveq r3, #1 <== NOT EXECUTED
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
else
tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks;
} else {
if (tty->termios.c_cc[VMIN]) {
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
39b4: 1585206c strne r2, [r5, #108] ; 0x6c <== NOT EXECUTED
tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
39b8: 15852070 strne r2, [r5, #112] ; 0x70 <== NOT EXECUTED
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
39bc: 15852074 strne r2, [r5, #116] ; 0x74 <== NOT EXECUTED
} else {
tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT;
39c0: 0585306c streq r3, [r5, #108] ; 0x6c <== NOT EXECUTED
39c4: eaffff98 b 382c <rtems_termios_ioctl+0x220> <== NOT EXECUTED
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)(
tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
39c8: e5953084 ldr r3, [r5, #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)(
39cc: e595107c ldr r1, [r5, #124] ; 0x7c <== NOT EXECUTED
39d0: e5950010 ldr r0, [r5, #16] <== NOT EXECUTED
39d4: e0811003 add r1, r1, r3 <== NOT EXECUTED
39d8: e3a02001 mov r2, #1 <== NOT EXECUTED
39dc: e1a0e00f mov lr, pc <== NOT EXECUTED
39e0: e595f0a4 ldr pc, [r5, #164] ; 0xa4 <== NOT EXECUTED
39e4: eaffff5a b 3754 <rtems_termios_ioctl+0x148> <== NOT EXECUTED
00002f64 <rtems_termios_open>:
rtems_device_major_number major,
rtems_device_minor_number minor,
void *arg,
const rtems_termios_callbacks *callbacks
)
{
2f64: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
struct rtems_termios_tty *tty;
/*
* See if the device has already been opened
*/
sc = rtems_semaphore_obtain(
2f68: e59f74b4 ldr r7, [pc, #1204] ; 3424 <rtems_termios_open+0x4c0>
rtems_device_major_number major,
rtems_device_minor_number minor,
void *arg,
const rtems_termios_callbacks *callbacks
)
{
2f6c: e1a06001 mov r6, r1
struct rtems_termios_tty *tty;
/*
* See if the device has already been opened
*/
sc = rtems_semaphore_obtain(
2f70: e3a01000 mov r1, #0
rtems_device_major_number major,
rtems_device_minor_number minor,
void *arg,
const rtems_termios_callbacks *callbacks
)
{
2f74: e24dd01c sub sp, sp, #28
2f78: e1a05000 mov r5, r0
2f7c: e1a08002 mov r8, r2
struct rtems_termios_tty *tty;
/*
* See if the device has already been opened
*/
sc = rtems_semaphore_obtain(
2f80: e5970000 ldr r0, [r7]
2f84: e1a02001 mov r2, r1
rtems_device_major_number major,
rtems_device_minor_number minor,
void *arg,
const rtems_termios_callbacks *callbacks
)
{
2f88: e58d3014 str r3, [sp, #20]
struct rtems_termios_tty *tty;
/*
* See if the device has already been opened
*/
sc = rtems_semaphore_obtain(
2f8c: eb0009af bl 5650 <rtems_semaphore_obtain>
rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
2f90: e250a000 subs sl, r0, #0
2f94: 1a000021 bne 3020 <rtems_termios_open+0xbc>
return sc;
for (tty = rtems_termios_ttyHead ; tty != NULL ; tty = tty->forw) {
2f98: e59fb488 ldr fp, [pc, #1160] ; 3428 <rtems_termios_open+0x4c4>
2f9c: e59b9000 ldr r9, [fp]
2fa0: e3590000 cmp r9, #0
2fa4: 0a00002d beq 3060 <rtems_termios_open+0xfc>
2fa8: e1a04009 mov r4, r9
2fac: ea000002 b 2fbc <rtems_termios_open+0x58>
2fb0: e5944000 ldr r4, [r4]
2fb4: e3540000 cmp r4, #0
2fb8: 0a000028 beq 3060 <rtems_termios_open+0xfc>
if ((tty->major == major) && (tty->minor == minor))
2fbc: e594300c ldr r3, [r4, #12]
2fc0: e1530005 cmp r3, r5
2fc4: 1afffff9 bne 2fb0 <rtems_termios_open+0x4c>
2fc8: e5943010 ldr r3, [r4, #16]
2fcc: e1530006 cmp r3, r6
2fd0: 1afffff6 bne 2fb0 <rtems_termios_open+0x4c>
if (c++ == 'z')
c = 'a';
}
args->iop->data1 = tty;
if (!tty->refcount++) {
2fd4: e5943008 ldr r3, [r4, #8]
*/
if (c++ == 'z')
c = 'a';
}
args->iop->data1 = tty;
2fd8: e5981000 ldr r1, [r8]
if (!tty->refcount++) {
2fdc: e2832001 add r2, r3, #1
2fe0: e3530000 cmp r3, #0
*/
if (c++ == 'z')
c = 'a';
}
args->iop->data1 = tty;
2fe4: e5814034 str r4, [r1, #52] ; 0x34
if (!tty->refcount++) {
2fe8: e5842008 str r2, [r4, #8]
2fec: 1a000009 bne 3018 <rtems_termios_open+0xb4>
if (tty->device.firstOpen)
2ff0: e5943098 ldr r3, [r4, #152] ; 0x98
2ff4: e3530000 cmp r3, #0
(*tty->device.firstOpen)(major, minor, arg);
2ff8: 11a00005 movne r0, r5
2ffc: 11a01006 movne r1, r6
3000: 11a02008 movne r2, r8
3004: 11a0e00f movne lr, pc
3008: 112fff13 bxne r3
/*
* start I/O tasks, if needed
*/
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
300c: e59430b4 ldr r3, [r4, #180] ; 0xb4
3010: e3530002 cmp r3, #2
3014: 0a000004 beq 302c <rtems_termios_open+0xc8>
tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
}
}
rtems_semaphore_release (rtems_termios_ttyMutex);
3018: e5970000 ldr r0, [r7]
301c: eb0009d4 bl 5774 <rtems_semaphore_release>
return RTEMS_SUCCESSFUL;
}
3020: e1a0000a mov r0, sl
3024: e28dd01c add sp, sp, #28
3028: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/*
* start I/O tasks, if needed
*/
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
sc = rtems_task_start(
302c: e59400c4 ldr r0, [r4, #196] ; 0xc4
3030: e59f13f4 ldr r1, [pc, #1012] ; 342c <rtems_termios_open+0x4c8>
3034: e1a02004 mov r2, r4
3038: eb000aa1 bl 5ac4 <rtems_task_start>
tty->rxTaskId, rtems_termios_rxdaemon, (rtems_task_argument)tty);
if (sc != RTEMS_SUCCESSFUL)
303c: e3500000 cmp r0, #0
3040: 1a0000da bne 33b0 <rtems_termios_open+0x44c>
rtems_fatal_error_occurred (sc);
sc = rtems_task_start(
3044: e59400c8 ldr r0, [r4, #200] ; 0xc8
3048: e59f13e0 ldr r1, [pc, #992] ; 3430 <rtems_termios_open+0x4cc>
304c: e1a02004 mov r2, r4
3050: eb000a9b bl 5ac4 <rtems_task_start>
tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty);
if (sc != RTEMS_SUCCESSFUL)
3054: e3500000 cmp r0, #0
3058: 0affffee beq 3018 <rtems_termios_open+0xb4>
305c: ea0000d3 b 33b0 <rtems_termios_open+0x44c> <== NOT EXECUTED
static char c = 'a';
/*
* Create a new device
*/
tty = calloc (1, sizeof (struct rtems_termios_tty));
3060: e3a00001 mov r0, #1
3064: e3a010e8 mov r1, #232 ; 0xe8
3068: ebfffb49 bl 1d94 <calloc>
if (tty == NULL) {
306c: e3500000 cmp r0, #0
static char c = 'a';
/*
* Create a new device
*/
tty = calloc (1, sizeof (struct rtems_termios_tty));
3070: e58d0018 str r0, [sp, #24]
3074: e1a04000 mov r4, r0
if (tty == NULL) {
3078: 0a0000b7 beq 335c <rtems_termios_open+0x3f8>
return RTEMS_NO_MEMORY;
}
/*
* allocate raw input buffer
*/
tty->rawInBuf.Size = RAW_INPUT_BUFFER_SIZE;
307c: e59f03b0 ldr r0, [pc, #944] ; 3434 <rtems_termios_open+0x4d0>
3080: e59d1018 ldr r1, [sp, #24]
3084: e5903000 ldr r3, [r0]
3088: e5813064 str r3, [r1, #100] ; 0x64
tty->rawInBuf.theBuf = malloc (tty->rawInBuf.Size);
308c: e5910064 ldr r0, [r1, #100] ; 0x64
3090: ebfffca5 bl 232c <malloc>
3094: e59d2018 ldr r2, [sp, #24]
if (tty->rawInBuf.theBuf == NULL) {
3098: e3500000 cmp r0, #0
}
/*
* allocate raw input buffer
*/
tty->rawInBuf.Size = RAW_INPUT_BUFFER_SIZE;
tty->rawInBuf.theBuf = malloc (tty->rawInBuf.Size);
309c: e1a03000 mov r3, r0
30a0: e5820058 str r0, [r2, #88] ; 0x58
if (tty->rawInBuf.theBuf == NULL) {
30a4: 0a0000b0 beq 336c <rtems_termios_open+0x408>
return RTEMS_NO_MEMORY;
}
/*
* allocate raw output buffer
*/
tty->rawOutBuf.Size = RAW_OUTPUT_BUFFER_SIZE;
30a8: e59fc384 ldr ip, [pc, #900] ; 3434 <rtems_termios_open+0x4d0>
30ac: e59de018 ldr lr, [sp, #24]
30b0: e59c2004 ldr r2, [ip, #4]
30b4: e58e2088 str r2, [lr, #136] ; 0x88
tty->rawOutBuf.theBuf = malloc (tty->rawOutBuf.Size);
30b8: e59e0088 ldr r0, [lr, #136] ; 0x88
30bc: e58d300c str r3, [sp, #12]
30c0: ebfffc99 bl 232c <malloc>
30c4: e1a02000 mov r2, r0
if (tty->rawOutBuf.theBuf == NULL) {
30c8: e3500000 cmp r0, #0
}
/*
* allocate raw output buffer
*/
tty->rawOutBuf.Size = RAW_OUTPUT_BUFFER_SIZE;
tty->rawOutBuf.theBuf = malloc (tty->rawOutBuf.Size);
30cc: e59d0018 ldr r0, [sp, #24]
if (tty->rawOutBuf.theBuf == NULL) {
30d0: e59d300c ldr r3, [sp, #12]
}
/*
* allocate raw output buffer
*/
tty->rawOutBuf.Size = RAW_OUTPUT_BUFFER_SIZE;
tty->rawOutBuf.theBuf = malloc (tty->rawOutBuf.Size);
30d4: e580207c str r2, [r0, #124] ; 0x7c
if (tty->rawOutBuf.theBuf == NULL) {
30d8: 0a00009b beq 334c <rtems_termios_open+0x3e8>
return RTEMS_NO_MEMORY;
}
/*
* allocate cooked buffer
*/
tty->cbuf = malloc (CBUFSIZE);
30dc: e59f1350 ldr r1, [pc, #848] ; 3434 <rtems_termios_open+0x4d0>
30e0: e5910008 ldr r0, [r1, #8]
30e4: e58d2010 str r2, [sp, #16]
30e8: e58d300c str r3, [sp, #12]
30ec: ebfffc8e bl 232c <malloc>
30f0: e59dc018 ldr ip, [sp, #24]
if (tty->cbuf == NULL) {
30f4: e3500000 cmp r0, #0
return RTEMS_NO_MEMORY;
}
/*
* allocate cooked buffer
*/
tty->cbuf = malloc (CBUFSIZE);
30f8: e58c001c str r0, [ip, #28]
if (tty->cbuf == NULL) {
30fc: e59d2010 ldr r2, [sp, #16]
3100: 0a00008e beq 3340 <rtems_termios_open+0x3dc>
return RTEMS_NO_MEMORY;
}
/*
* Initialize wakeup callbacks
*/
tty->tty_snd.sw_pfn = NULL;
3104: e59de018 ldr lr, [sp, #24]
3108: e3a03000 mov r3, #0
/*
* link tty
*/
tty->forw = rtems_termios_ttyHead;
tty->back = NULL;
if (rtems_termios_ttyHead != NULL)
310c: e1590003 cmp r9, r3
/*
* link tty
*/
tty->forw = rtems_termios_ttyHead;
tty->back = NULL;
3110: e58e3004 str r3, [lr, #4]
return RTEMS_NO_MEMORY;
}
/*
* Initialize wakeup callbacks
*/
tty->tty_snd.sw_pfn = NULL;
3114: e58e30d4 str r3, [lr, #212] ; 0xd4
tty->tty_snd.sw_arg = NULL;
3118: e58e30d8 str r3, [lr, #216] ; 0xd8
tty->tty_rcv.sw_pfn = NULL;
311c: e58e30dc str r3, [lr, #220] ; 0xdc
tty->tty_rcv.sw_arg = NULL;
3120: e58e30e0 str r3, [lr, #224] ; 0xe0
tty->tty_rcvwakeup = 0;
3124: e58e30e4 str r3, [lr, #228] ; 0xe4
tty->forw = rtems_termios_ttyHead;
tty->back = NULL;
if (rtems_termios_ttyHead != NULL)
rtems_termios_ttyHead->back = tty;
rtems_termios_ttyHead = tty;
if (rtems_termios_ttyTail == NULL)
3128: e59f3308 ldr r3, [pc, #776] ; 3438 <rtems_termios_open+0x4d4>
312c: e5932000 ldr r2, [r3]
*/
tty->forw = rtems_termios_ttyHead;
tty->back = NULL;
if (rtems_termios_ttyHead != NULL)
rtems_termios_ttyHead->back = tty;
rtems_termios_ttyHead = tty;
3130: e59d0018 ldr r0, [sp, #24]
/*
* Set up mutex semaphores
*/
sc = rtems_semaphore_create (
rtems_build_name ('T', 'R', 'i', c),
3134: e59f12f8 ldr r1, [pc, #760] ; 3434 <rtems_termios_open+0x4d0>
* link tty
*/
tty->forw = rtems_termios_ttyHead;
tty->back = NULL;
if (rtems_termios_ttyHead != NULL)
rtems_termios_ttyHead->back = tty;
3138: 1589e004 strne lr, [r9, #4]
rtems_termios_ttyHead = tty;
if (rtems_termios_ttyTail == NULL)
313c: e3520000 cmp r2, #0
rtems_termios_ttyTail = tty;
3140: 05830000 streq r0, [r3]
*/
tty->forw = rtems_termios_ttyHead;
tty->back = NULL;
if (rtems_termios_ttyHead != NULL)
rtems_termios_ttyHead->back = tty;
rtems_termios_ttyHead = tty;
3144: e58b0000 str r0, [fp]
/*
* Set up mutex semaphores
*/
sc = rtems_semaphore_create (
rtems_build_name ('T', 'R', 'i', c),
3148: e5d1000c ldrb r0, [r1, #12]
tty->tty_rcvwakeup = 0;
/*
* link tty
*/
tty->forw = rtems_termios_ttyHead;
314c: e58e9000 str r9, [lr]
tty->major = major;
/*
* Set up mutex semaphores
*/
sc = rtems_semaphore_create (
3150: e59d2018 ldr r2, [sp, #24]
rtems_termios_ttyHead->back = tty;
rtems_termios_ttyHead = tty;
if (rtems_termios_ttyTail == NULL)
rtems_termios_ttyTail = tty;
tty->minor = minor;
3154: e59d9018 ldr r9, [sp, #24]
tty->major = major;
/*
* Set up mutex semaphores
*/
sc = rtems_semaphore_create (
3158: e3800315 orr r0, r0, #1409286144 ; 0x54000000
315c: e3800852 orr r0, r0, #5373952 ; 0x520000
3160: e282c014 add ip, r2, #20
rtems_termios_ttyHead->back = tty;
rtems_termios_ttyHead = tty;
if (rtems_termios_ttyTail == NULL)
rtems_termios_ttyTail = tty;
tty->minor = minor;
3164: e5896010 str r6, [r9, #16]
tty->major = major;
3168: e589500c str r5, [r9, #12]
/*
* Set up mutex semaphores
*/
sc = rtems_semaphore_create (
316c: e3a03000 mov r3, #0
3170: e3800c69 orr r0, r0, #26880 ; 0x6900
3174: e3a01001 mov r1, #1
3178: e3a02054 mov r2, #84 ; 0x54
317c: e58dc000 str ip, [sp]
3180: eb000898 bl 53e8 <rtems_semaphore_create>
rtems_build_name ('T', 'R', 'i', c),
1,
RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&tty->isem);
if (sc != RTEMS_SUCCESSFUL)
3184: e2503000 subs r3, r0, #0
/*
* Set up mutex semaphores
*/
sc = rtems_semaphore_create (
rtems_build_name ('T', 'R', 'i', c),
3188: e59f92a4 ldr r9, [pc, #676] ; 3434 <rtems_termios_open+0x4d0>
1,
RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&tty->isem);
if (sc != RTEMS_SUCCESSFUL)
318c: 1a000087 bne 33b0 <rtems_termios_open+0x44c>
rtems_fatal_error_occurred (sc);
sc = rtems_semaphore_create (
rtems_build_name ('T', 'R', 'o', c),
3190: e5d9000c ldrb r0, [r9, #12]
RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&tty->isem);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
sc = rtems_semaphore_create (
3194: e59db018 ldr fp, [sp, #24]
3198: e3800315 orr r0, r0, #1409286144 ; 0x54000000
319c: e3800852 orr r0, r0, #5373952 ; 0x520000
31a0: e28bc018 add ip, fp, #24
31a4: e3a01001 mov r1, #1
31a8: e3800c6f orr r0, r0, #28416 ; 0x6f00
31ac: e3a02054 mov r2, #84 ; 0x54
31b0: e58dc000 str ip, [sp]
31b4: eb00088b bl 53e8 <rtems_semaphore_create>
rtems_build_name ('T', 'R', 'o', c),
1,
RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&tty->osem);
if (sc != RTEMS_SUCCESSFUL)
31b8: e2501000 subs r1, r0, #0
31bc: 1a00007b bne 33b0 <rtems_termios_open+0x44c>
rtems_fatal_error_occurred (sc);
sc = rtems_semaphore_create (
rtems_build_name ('T', 'R', 'x', c),
31c0: e5d9000c ldrb r0, [r9, #12]
RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&tty->osem);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
sc = rtems_semaphore_create (
31c4: e59de018 ldr lr, [sp, #24]
31c8: e3800315 orr r0, r0, #1409286144 ; 0x54000000
31cc: e3800852 orr r0, r0, #5373952 ; 0x520000
31d0: e28ec08c add ip, lr, #140 ; 0x8c
31d4: e3800b1e orr r0, r0, #30720 ; 0x7800
31d8: e3a02020 mov r2, #32
31dc: e1a03001 mov r3, r1
31e0: e58dc000 str ip, [sp]
31e4: eb00087f bl 53e8 <rtems_semaphore_create>
rtems_build_name ('T', 'R', 'x', c),
0,
RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_FIFO,
RTEMS_NO_PRIORITY,
&tty->rawOutBuf.Semaphore);
if (sc != RTEMS_SUCCESSFUL)
31e8: e250e000 subs lr, r0, #0
31ec: 1a00006f bne 33b0 <rtems_termios_open+0x44c>
tty->rawOutBufState = rob_idle;
/*
* Set callbacks
*/
tty->device = *callbacks;
31f0: e59db014 ldr fp, [sp, #20]
31f4: e8bb000f ldm fp!, {r0, r1, r2, r3}
31f8: e58db014 str fp, [sp, #20]
31fc: e59db018 ldr fp, [sp, #24]
3200: e28bc098 add ip, fp, #152 ; 0x98
3204: e8ac000f stmia ip!, {r0, r1, r2, r3}
3208: e59db014 ldr fp, [sp, #20]
320c: e89b000f ldm fp, {r0, r1, r2, r3}
3210: e88c000f stm ip, {r0, r1, r2, r3}
/*
* Create I/O tasks
*/
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
3214: e59dc018 ldr ip, [sp, #24]
3218: e59c30b4 ldr r3, [ip, #180] ; 0xb4
321c: e3530002 cmp r3, #2
RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_FIFO,
RTEMS_NO_PRIORITY,
&tty->rawOutBuf.Semaphore);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
tty->rawOutBufState = rob_idle;
3220: e58ce094 str lr, [ip, #148] ; 0x94
tty->device = *callbacks;
/*
* Create I/O tasks
*/
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
3224: 0a000062 beq 33b4 <rtems_termios_open+0x450>
&tty->rxTaskId);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
}
if ((tty->device.pollRead == NULL) ||
3228: e59d9018 ldr r9, [sp, #24]
322c: e59930a0 ldr r3, [r9, #160] ; 0xa0
3230: e3530000 cmp r3, #0
3234: 0a00004f beq 3378 <rtems_termios_open+0x414>
3238: e59930b4 ldr r3, [r9, #180] ; 0xb4
323c: e3530002 cmp r3, #2
3240: 0a00004c beq 3378 <rtems_termios_open+0x414>
tty->termios.c_cc[VDISCARD] = '\017';
tty->termios.c_cc[VWERASE] = '\027';
tty->termios.c_cc[VLNEXT] = '\026';
/* start with no flow control, clear flow control flags */
tty->flow_ctrl = 0;
3244: e59d0018 ldr r0, [sp, #24]
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
tty->termios.c_cc[VERASE] = '\177';
tty->termios.c_cc[VKILL] = '\025';
tty->termios.c_cc[VEOF] = '\004';
tty->termios.c_cc[VEOL] = '\000';
3248: e3a03000 mov r3, #0
tty->termios.c_cc[VDISCARD] = '\017';
tty->termios.c_cc[VWERASE] = '\027';
tty->termios.c_cc[VLNEXT] = '\026';
/* start with no flow control, clear flow control flags */
tty->flow_ctrl = 0;
324c: e58030b8 str r3, [r0, #184] ; 0xb8
tty->lowwater = tty->rawInBuf.Size * 1/2;
tty->highwater = tty->rawInBuf.Size * 3/4;
/*
* Bump name characer
*/
if (c++ == 'z')
3250: e59f11dc ldr r1, [pc, #476] ; 3434 <rtems_termios_open+0x4d0>
/* start with no flow control, clear flow control flags */
tty->flow_ctrl = 0;
/*
* set low/highwater mark for XON/XOFF support
*/
tty->lowwater = tty->rawInBuf.Size * 1/2;
3254: e590b064 ldr fp, [r0, #100] ; 0x64
tty->highwater = tty->rawInBuf.Size * 3/4;
/*
* Bump name characer
*/
if (c++ == 'z')
3258: e5d1900c ldrb r9, [r1, #12]
/* start with no flow control, clear flow control flags */
tty->flow_ctrl = 0;
/*
* set low/highwater mark for XON/XOFF support
*/
tty->lowwater = tty->rawInBuf.Size * 1/2;
325c: e1a0b0ab lsr fp, fp, #1
tty->highwater = tty->rawInBuf.Size * 3/4;
/*
* Bump name characer
*/
if (c++ == 'z')
3260: e359007a cmp r9, #122 ; 0x7a
/* start with no flow control, clear flow control flags */
tty->flow_ctrl = 0;
/*
* set low/highwater mark for XON/XOFF support
*/
tty->lowwater = tty->rawInBuf.Size * 1/2;
3264: e58db008 str fp, [sp, #8]
tty->highwater = tty->rawInBuf.Size * 3/4;
/*
* Bump name characer
*/
if (c++ == 'z')
3268: e289b001 add fp, r9, #1
}
/*
* Set default parameters
*/
tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
326c: e59d9018 ldr r9, [sp, #24]
tty->termios.c_oflag = OPOST | ONLCR | XTABS;
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
tty->termios.c_lflag =
3270: e3a02c82 mov r2, #33280 ; 0x8200
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
tty->termios.c_cc[VERASE] = '\177';
tty->termios.c_cc[VKILL] = '\025';
tty->termios.c_cc[VEOF] = '\004';
tty->termios.c_cc[VEOL] = '\000';
3274: e5c9304c strb r3, [r9, #76] ; 0x4c
tty->termios.c_cc[VEOL2] = '\000';
3278: e5c93051 strb r3, [r9, #81] ; 0x51
tty->termios.c_cc[VSTART] = '\021';
327c: e3a03011 mov r3, #17
3280: e5c93049 strb r3, [r9, #73] ; 0x49
* Set default parameters
*/
tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
tty->termios.c_oflag = OPOST | ONLCR | XTABS;
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
tty->termios.c_lflag =
3284: e282203b add r2, r2, #59 ; 0x3b
tty->termios.c_cc[VKILL] = '\025';
tty->termios.c_cc[VEOF] = '\004';
tty->termios.c_cc[VEOL] = '\000';
tty->termios.c_cc[VEOL2] = '\000';
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
3288: e3a03013 mov r3, #19
328c: e5c9304a strb r3, [r9, #74] ; 0x4a
* Set default parameters
*/
tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
tty->termios.c_oflag = OPOST | ONLCR | XTABS;
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
tty->termios.c_lflag =
3290: e589203c str r2, [r9, #60] ; 0x3c
tty->termios.c_cc[VEOF] = '\004';
tty->termios.c_cc[VEOL] = '\000';
tty->termios.c_cc[VEOL2] = '\000';
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
3294: e3a0301a mov r3, #26
tty->termios.c_oflag = OPOST | ONLCR | XTABS;
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
tty->termios.c_lflag =
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
tty->termios.c_cc[VINTR] = '\003';
3298: e3a02003 mov r2, #3
329c: e5c92041 strb r2, [r9, #65] ; 0x41
tty->termios.c_cc[VEOF] = '\004';
tty->termios.c_cc[VEOL] = '\000';
tty->termios.c_cc[VEOL2] = '\000';
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
32a0: e5c9304b strb r3, [r9, #75] ; 0x4b
tty->flow_ctrl = 0;
/*
* set low/highwater mark for XON/XOFF support
*/
tty->lowwater = tty->rawInBuf.Size * 1/2;
tty->highwater = tty->rawInBuf.Size * 3/4;
32a4: e590e064 ldr lr, [r0, #100] ; 0x64
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
tty->termios.c_lflag =
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
32a8: e3a0201c mov r2, #28
tty->termios.c_cc[VEOL] = '\000';
tty->termios.c_cc[VEOL2] = '\000';
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
tty->termios.c_cc[VREPRINT] = '\022';
32ac: e3a03012 mov r3, #18
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
tty->termios.c_lflag =
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
32b0: e5c92042 strb r2, [r9, #66] ; 0x42
tty->termios.c_cc[VEOL] = '\000';
tty->termios.c_cc[VEOL2] = '\000';
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
tty->termios.c_cc[VREPRINT] = '\022';
32b4: e5c9304d strb r3, [r9, #77] ; 0x4d
tty->termios.c_lflag =
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
tty->termios.c_cc[VERASE] = '\177';
32b8: e3a0207f mov r2, #127 ; 0x7f
tty->termios.c_cc[VEOL2] = '\000';
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
tty->termios.c_cc[VREPRINT] = '\022';
tty->termios.c_cc[VDISCARD] = '\017';
32bc: e3a0300f mov r3, #15
tty->termios.c_lflag =
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
tty->termios.c_cc[VERASE] = '\177';
32c0: e5c92043 strb r2, [r9, #67] ; 0x43
tty->termios.c_cc[VEOL2] = '\000';
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
tty->termios.c_cc[VREPRINT] = '\022';
tty->termios.c_cc[VDISCARD] = '\017';
32c4: e5c9304e strb r3, [r9, #78] ; 0x4e
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
tty->termios.c_cc[VERASE] = '\177';
tty->termios.c_cc[VKILL] = '\025';
32c8: e3a02015 mov r2, #21
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
tty->termios.c_cc[VREPRINT] = '\022';
tty->termios.c_cc[VDISCARD] = '\017';
tty->termios.c_cc[VWERASE] = '\027';
32cc: e3a03017 mov r3, #23
tty->flow_ctrl = 0;
/*
* set low/highwater mark for XON/XOFF support
*/
tty->lowwater = tty->rawInBuf.Size * 1/2;
tty->highwater = tty->rawInBuf.Size * 3/4;
32d0: e08ee08e add lr, lr, lr, lsl #1
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
tty->termios.c_cc[VERASE] = '\177';
tty->termios.c_cc[VKILL] = '\025';
32d4: e5c92044 strb r2, [r9, #68] ; 0x44
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
tty->termios.c_cc[VREPRINT] = '\022';
tty->termios.c_cc[VDISCARD] = '\017';
tty->termios.c_cc[VWERASE] = '\027';
32d8: e5c9304f strb r3, [r9, #79] ; 0x4f
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
tty->termios.c_cc[VERASE] = '\177';
tty->termios.c_cc[VKILL] = '\025';
tty->termios.c_cc[VEOF] = '\004';
32dc: e3a02004 mov r2, #4
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
tty->termios.c_cc[VREPRINT] = '\022';
tty->termios.c_cc[VDISCARD] = '\017';
tty->termios.c_cc[VWERASE] = '\027';
tty->termios.c_cc[VLNEXT] = '\026';
32e0: e3a03016 mov r3, #22
tty->flow_ctrl = 0;
/*
* set low/highwater mark for XON/XOFF support
*/
tty->lowwater = tty->rawInBuf.Size * 1/2;
tty->highwater = tty->rawInBuf.Size * 3/4;
32e4: e1a0e12e lsr lr, lr, #2
}
/*
* Set default parameters
*/
tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
32e8: e3a0cc25 mov ip, #9472 ; 0x2500
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
tty->termios.c_cc[VERASE] = '\177';
tty->termios.c_cc[VKILL] = '\025';
tty->termios.c_cc[VEOF] = '\004';
32ec: e5c92045 strb r2, [r9, #69] ; 0x45
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
tty->termios.c_cc[VREPRINT] = '\022';
tty->termios.c_cc[VDISCARD] = '\017';
tty->termios.c_cc[VWERASE] = '\027';
tty->termios.c_cc[VLNEXT] = '\026';
32f0: e5c93050 strb r3, [r9, #80] ; 0x50
}
/*
* Set default parameters
*/
tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
32f4: e28cc002 add ip, ip, #2
tty->lowwater = tty->rawInBuf.Size * 1/2;
tty->highwater = tty->rawInBuf.Size * 3/4;
/*
* Bump name characer
*/
if (c++ == 'z')
32f8: e58db014 str fp, [sp, #20]
tty->flow_ctrl = 0;
/*
* set low/highwater mark for XON/XOFF support
*/
tty->lowwater = tty->rawInBuf.Size * 1/2;
tty->highwater = tty->rawInBuf.Size * 3/4;
32fc: e589e0c0 str lr, [r9, #192] ; 0xc0
/*
* Bump name characer
*/
if (c++ == 'z')
3300: e59fe12c ldr lr, [pc, #300] ; 3434 <rtems_termios_open+0x4d0>
/*
* Set default parameters
*/
tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
tty->termios.c_oflag = OPOST | ONLCR | XTABS;
3304: e3a00b06 mov r0, #6144 ; 0x1800
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
3308: e3a01e8b mov r1, #2224 ; 0x8b0
}
/*
* Set default parameters
*/
tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
330c: e589c030 str ip, [r9, #48] ; 0x30
/* start with no flow control, clear flow control flags */
tty->flow_ctrl = 0;
/*
* set low/highwater mark for XON/XOFF support
*/
tty->lowwater = tty->rawInBuf.Size * 1/2;
3310: e59db008 ldr fp, [sp, #8]
tty->highwater = tty->rawInBuf.Size * 3/4;
/*
* Bump name characer
*/
if (c++ == 'z')
3314: e59dc014 ldr ip, [sp, #20]
/*
* Set default parameters
*/
tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
tty->termios.c_oflag = OPOST | ONLCR | XTABS;
3318: e2800005 add r0, r0, #5
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
331c: e281100d add r1, r1, #13
tty->highwater = tty->rawInBuf.Size * 3/4;
/*
* Bump name characer
*/
if (c++ == 'z')
c = 'a';
3320: 0282205d addeq r2, r2, #93 ; 0x5d
3324: 01a0300e moveq r3, lr
tty->lowwater = tty->rawInBuf.Size * 1/2;
tty->highwater = tty->rawInBuf.Size * 3/4;
/*
* Bump name characer
*/
if (c++ == 'z')
3328: e5cec00c strb ip, [lr, #12]
/*
* Set default parameters
*/
tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
tty->termios.c_oflag = OPOST | ONLCR | XTABS;
332c: e5890034 str r0, [r9, #52] ; 0x34
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
3330: e5891038 str r1, [r9, #56] ; 0x38
/* start with no flow control, clear flow control flags */
tty->flow_ctrl = 0;
/*
* set low/highwater mark for XON/XOFF support
*/
tty->lowwater = tty->rawInBuf.Size * 1/2;
3334: e589b0bc str fp, [r9, #188] ; 0xbc
tty->highwater = tty->rawInBuf.Size * 3/4;
/*
* Bump name characer
*/
if (c++ == 'z')
c = 'a';
3338: 05c3200c strbeq r2, [r3, #12]
333c: eaffff24 b 2fd4 <rtems_termios_open+0x70>
/*
* allocate cooked buffer
*/
tty->cbuf = malloc (CBUFSIZE);
if (tty->cbuf == NULL) {
free((void *)(tty->rawOutBuf.theBuf));
3340: e1a00002 mov r0, r2 <== NOT EXECUTED
3344: ebfffb1e bl 1fc4 <free> <== NOT EXECUTED
free((void *)(tty->rawInBuf.theBuf));
3348: e59d300c ldr r3, [sp, #12] <== NOT EXECUTED
334c: e1a00003 mov r0, r3 <== NOT EXECUTED
3350: ebfffb1b bl 1fc4 <free> <== NOT EXECUTED
free(tty);
3354: e59d0018 ldr r0, [sp, #24] <== NOT EXECUTED
3358: ebfffb19 bl 1fc4 <free> <== NOT EXECUTED
rtems_semaphore_release (rtems_termios_ttyMutex);
335c: e5970000 ldr r0, [r7] <== NOT EXECUTED
3360: eb000903 bl 5774 <rtems_semaphore_release> <== NOT EXECUTED
return RTEMS_NO_MEMORY;
3364: e3a0a01a mov sl, #26 <== NOT EXECUTED
3368: eaffff2c b 3020 <rtems_termios_open+0xbc> <== NOT EXECUTED
* allocate raw input buffer
*/
tty->rawInBuf.Size = RAW_INPUT_BUFFER_SIZE;
tty->rawInBuf.theBuf = malloc (tty->rawInBuf.Size);
if (tty->rawInBuf.theBuf == NULL) {
free(tty);
336c: e1a00002 mov r0, r2 <== NOT EXECUTED
3370: ebfffb13 bl 1fc4 <free> <== NOT EXECUTED
3374: eafffff8 b 335c <rtems_termios_open+0x3f8> <== NOT EXECUTED
}
if ((tty->device.pollRead == NULL) ||
(tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){
sc = rtems_semaphore_create (
rtems_build_name ('T', 'R', 'r', c),
3378: e59fb0b4 ldr fp, [pc, #180] ; 3434 <rtems_termios_open+0x4d0>
337c: e5db000c ldrb r0, [fp, #12]
rtems_fatal_error_occurred (sc);
}
if ((tty->device.pollRead == NULL) ||
(tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){
sc = rtems_semaphore_create (
3380: e59de018 ldr lr, [sp, #24]
3384: e3800315 orr r0, r0, #1409286144 ; 0x54000000
3388: e3a01000 mov r1, #0
338c: e3800852 orr r0, r0, #5373952 ; 0x520000
3390: e28ec068 add ip, lr, #104 ; 0x68
3394: e3800c72 orr r0, r0, #29184 ; 0x7200
3398: e3a02024 mov r2, #36 ; 0x24
339c: e1a03001 mov r3, r1
33a0: e58dc000 str ip, [sp]
33a4: eb00080f bl 53e8 <rtems_semaphore_create>
rtems_build_name ('T', 'R', 'r', c),
0,
RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&tty->rawInBuf.Semaphore);
if (sc != RTEMS_SUCCESSFUL)
33a8: e3500000 cmp r0, #0
33ac: 0affffa4 beq 3244 <rtems_termios_open+0x2e0>
rtems_fatal_error_occurred (sc);
sc = rtems_task_start(
tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
33b0: eb000a49 bl 5cdc <rtems_fatal_error_occurred>
/*
* Create I/O tasks
*/
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
sc = rtems_task_create (
rtems_build_name ('T', 'x', 'T', c),
33b4: e5d9000c ldrb r0, [r9, #12]
/*
* Create I/O tasks
*/
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
sc = rtems_task_create (
33b8: e3800315 orr r0, r0, #1409286144 ; 0x54000000
33bc: e380071e orr r0, r0, #7864320 ; 0x780000
33c0: e28cc0c8 add ip, ip, #200 ; 0xc8
33c4: e3800b15 orr r0, r0, #21504 ; 0x5400
33c8: e3a0100a mov r1, #10
33cc: e3a02b01 mov r2, #1024 ; 0x400
33d0: e3a03c05 mov r3, #1280 ; 0x500
33d4: e58de000 str lr, [sp]
33d8: e58dc004 str ip, [sp, #4]
33dc: eb00090e bl 581c <rtems_task_create>
TERMIOS_TXTASK_STACKSIZE,
RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE |
RTEMS_NO_ASR,
RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
&tty->txTaskId);
if (sc != RTEMS_SUCCESSFUL)
33e0: e250e000 subs lr, r0, #0
33e4: 1afffff1 bne 33b0 <rtems_termios_open+0x44c>
rtems_fatal_error_occurred (sc);
sc = rtems_task_create (
rtems_build_name ('R', 'x', 'T', c),
33e8: e5d9000c ldrb r0, [r9, #12]
RTEMS_NO_ASR,
RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
&tty->txTaskId);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
sc = rtems_task_create (
33ec: e59d2018 ldr r2, [sp, #24]
33f0: e3800452 orr r0, r0, #1375731712 ; 0x52000000
33f4: e380071e orr r0, r0, #7864320 ; 0x780000
33f8: e282c0c4 add ip, r2, #196 ; 0xc4
33fc: e3800b15 orr r0, r0, #21504 ; 0x5400
3400: e3a01009 mov r1, #9
3404: e3a02b01 mov r2, #1024 ; 0x400
3408: e3a03c05 mov r3, #1280 ; 0x500
340c: e58de000 str lr, [sp]
3410: e58dc004 str ip, [sp, #4]
3414: eb000900 bl 581c <rtems_task_create>
TERMIOS_RXTASK_STACKSIZE,
RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE |
RTEMS_NO_ASR,
RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
&tty->rxTaskId);
if (sc != RTEMS_SUCCESSFUL)
3418: e3500000 cmp r0, #0
341c: 0affff81 beq 3228 <rtems_termios_open+0x2c4>
3420: eaffffe2 b 33b0 <rtems_termios_open+0x44c> <== NOT EXECUTED
000039f0 <rtems_termios_puts>:
const unsigned char *buf = _buf;
unsigned int newHead;
rtems_interrupt_level level;
rtems_status_code sc;
if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) {
39f0: e59230b4 ldr r3, [r2, #180] ; 0xb4
39f4: e3530000 cmp r3, #0
* Send characters to device-specific code
*/
void
rtems_termios_puts (
const void *_buf, int len, struct rtems_termios_tty *tty)
{
39f8: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
39fc: e1a04002 mov r4, r2
3a00: e1a09000 mov r9, r0
3a04: e1a0a001 mov sl, r1
const unsigned char *buf = _buf;
unsigned int newHead;
rtems_interrupt_level level;
rtems_status_code sc;
if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) {
3a08: 0a000037 beq 3aec <rtems_termios_puts+0xfc>
(*tty->device.write)(tty->minor, (void *)buf, len);
return;
}
newHead = tty->rawOutBuf.Head;
while (len) {
3a0c: e3510000 cmp r1, #0
if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) {
(*tty->device.write)(tty->minor, (void *)buf, len);
return;
}
newHead = tty->rawOutBuf.Head;
3a10: e5928080 ldr r8, [r2, #128] ; 0x80
while (len) {
3a14: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* with interrupts enabled.
*/
newHead = (newHead + 1) % tty->rawOutBuf.Size;
rtems_interrupt_disable (level);
while (newHead == tty->rawOutBuf.Tail) {
tty->rawOutBufState = rob_wait;
3a18: e3a07002 mov r7, #2
(char *)&tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
} else {
/* remember that output has been stopped due to flow ctrl*/
tty->flow_ctrl |= FL_OSTOP;
}
tty->rawOutBufState = rob_busy;
3a1c: e3a0b001 mov fp, #1
* len -= ncopy
*
* To minimize latency, the memcpy should be done
* with interrupts enabled.
*/
newHead = (newHead + 1) % tty->rawOutBuf.Size;
3a20: e5941088 ldr r1, [r4, #136] ; 0x88
3a24: e2880001 add r0, r8, #1
3a28: eb00327c bl 10420 <__umodsi3>
3a2c: e1a08000 mov r8, r0
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
3a30: e10f5000 mrs r5, CPSR
3a34: e3853080 orr r3, r5, #128 ; 0x80
3a38: e129f003 msr CPSR_fc, r3
rtems_interrupt_disable (level);
while (newHead == tty->rawOutBuf.Tail) {
3a3c: e5946084 ldr r6, [r4, #132] ; 0x84
3a40: e1560000 cmp r6, r0
3a44: 1a00000d bne 3a80 <rtems_termios_puts+0x90>
tty->rawOutBufState = rob_wait;
3a48: e5847094 str r7, [r4, #148] ; 0x94
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
3a4c: e129f005 msr CPSR_fc, r5
rtems_interrupt_enable (level);
sc = rtems_semaphore_obtain(
3a50: e3a01000 mov r1, #0
3a54: e594008c ldr r0, [r4, #140] ; 0x8c
3a58: e1a02001 mov r2, r1
3a5c: eb0006fb bl 5650 <rtems_semaphore_obtain>
tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
3a60: e3500000 cmp r0, #0
3a64: 1a000026 bne 3b04 <rtems_termios_puts+0x114>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
3a68: e10f5000 mrs r5, CPSR
3a6c: e3853080 orr r3, r5, #128 ; 0x80
3a70: e129f003 msr CPSR_fc, r3
* To minimize latency, the memcpy should be done
* with interrupts enabled.
*/
newHead = (newHead + 1) % tty->rawOutBuf.Size;
rtems_interrupt_disable (level);
while (newHead == tty->rawOutBuf.Tail) {
3a74: e5943084 ldr r3, [r4, #132] ; 0x84
3a78: e1530006 cmp r3, r6
3a7c: 0afffff1 beq 3a48 <rtems_termios_puts+0x58>
tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
rtems_interrupt_disable (level);
}
tty->rawOutBuf.theBuf[tty->rawOutBuf.Head] = *buf++;
3a80: e5943080 ldr r3, [r4, #128] ; 0x80
3a84: e4d91001 ldrb r1, [r9], #1
3a88: e594207c ldr r2, [r4, #124] ; 0x7c
3a8c: e7c21003 strb r1, [r2, r3]
tty->rawOutBuf.Head = newHead;
if (tty->rawOutBufState == rob_idle) {
3a90: e5943094 ldr r3, [r4, #148] ; 0x94
3a94: e3530000 cmp r3, #0
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
rtems_interrupt_disable (level);
}
tty->rawOutBuf.theBuf[tty->rawOutBuf.Head] = *buf++;
tty->rawOutBuf.Head = newHead;
3a98: e5848080 str r8, [r4, #128] ; 0x80
if (tty->rawOutBufState == rob_idle) {
3a9c: 1a000006 bne 3abc <rtems_termios_puts+0xcc>
/* check, whether XOFF has been received */
if (!(tty->flow_ctrl & FL_ORCVXOF)) {
3aa0: e59430b8 ldr r3, [r4, #184] ; 0xb8
3aa4: e3130010 tst r3, #16
3aa8: 0a000007 beq 3acc <rtems_termios_puts+0xdc>
(*tty->device.write)(tty->minor,
(char *)&tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
} else {
/* remember that output has been stopped due to flow ctrl*/
tty->flow_ctrl |= FL_OSTOP;
3aac: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
3ab0: e3833020 orr r3, r3, #32 <== NOT EXECUTED
3ab4: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
}
tty->rawOutBufState = rob_busy;
3ab8: e584b094 str fp, [r4, #148] ; 0x94
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
3abc: e129f005 msr CPSR_fc, r5
if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) {
(*tty->device.write)(tty->minor, (void *)buf, len);
return;
}
newHead = tty->rawOutBuf.Head;
while (len) {
3ac0: e25aa001 subs sl, sl, #1
3ac4: 1affffd5 bne 3a20 <rtems_termios_puts+0x30>
3ac8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
tty->rawOutBuf.Head = newHead;
if (tty->rawOutBufState == rob_idle) {
/* check, whether XOFF has been received */
if (!(tty->flow_ctrl & FL_ORCVXOF)) {
(*tty->device.write)(tty->minor,
(char *)&tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
3acc: e5943084 ldr r3, [r4, #132] ; 0x84
tty->rawOutBuf.theBuf[tty->rawOutBuf.Head] = *buf++;
tty->rawOutBuf.Head = newHead;
if (tty->rawOutBufState == rob_idle) {
/* check, whether XOFF has been received */
if (!(tty->flow_ctrl & FL_ORCVXOF)) {
(*tty->device.write)(tty->minor,
3ad0: e594107c ldr r1, [r4, #124] ; 0x7c
3ad4: e5940010 ldr r0, [r4, #16]
3ad8: e0811003 add r1, r1, r3
3adc: e3a02001 mov r2, #1
3ae0: e1a0e00f mov lr, pc
3ae4: e594f0a4 ldr pc, [r4, #164] ; 0xa4
3ae8: eafffff2 b 3ab8 <rtems_termios_puts+0xc8>
unsigned int newHead;
rtems_interrupt_level level;
rtems_status_code sc;
if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) {
(*tty->device.write)(tty->minor, (void *)buf, len);
3aec: e5920010 ldr r0, [r2, #16]
3af0: e1a01009 mov r1, r9
3af4: e1a0200a mov r2, sl
3af8: e1a0e00f mov lr, pc
3afc: e594f0a4 ldr pc, [r4, #164] ; 0xa4
return;
3b00: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
tty->rawOutBufState = rob_wait;
rtems_interrupt_enable (level);
sc = rtems_semaphore_obtain(
tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
3b04: eb000874 bl 5cdc <rtems_fatal_error_occurred> <== NOT EXECUTED
0000421c <rtems_termios_read>:
return RTEMS_SUCCESSFUL;
}
rtems_status_code
rtems_termios_read (void *arg)
{
421c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_libio_rw_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
4220: e5903000 ldr r3, [r0]
4224: 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);
4228: e3a01000 mov r1, #0
return RTEMS_SUCCESSFUL;
}
rtems_status_code
rtems_termios_read (void *arg)
{
422c: e1a09000 mov r9, r0
4230: e24dd008 sub sp, sp, #8
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);
4234: e5940014 ldr r0, [r4, #20]
4238: e1a02001 mov r2, r1
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;
423c: e5998010 ldr r8, [r9, #16]
char *buffer = args->buffer;
4240: e599a00c ldr sl, [r9, #12]
rtems_status_code sc;
sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
4244: eb000501 bl 5650 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
4248: e3500000 cmp r0, #0
424c: e58d0000 str r0, [sp]
4250: 1a00000e bne 4290 <rtems_termios_read+0x74>
return sc;
if (rtems_termios_linesw[tty->t_line].l_read != NULL) {
4254: e59420cc ldr r2, [r4, #204] ; 0xcc
4258: e59f335c ldr r3, [pc, #860] ; 45bc <rtems_termios_read+0x3a0>
425c: e0833282 add r3, r3, r2, lsl #5
4260: e5933008 ldr r3, [r3, #8]
4264: e3530000 cmp r3, #0
4268: 0a00000b beq 429c <rtems_termios_read+0x80>
sc = rtems_termios_linesw[tty->t_line].l_read(tty,args);
426c: e1a00004 mov r0, r4
4270: e1a01009 mov r1, r9
4274: e1a0e00f mov lr, pc
4278: e12fff13 bx r3
tty->tty_rcvwakeup = 0;
427c: e3a03000 mov r3, #0
sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
return sc;
if (rtems_termios_linesw[tty->t_line].l_read != NULL) {
sc = rtems_termios_linesw[tty->t_line].l_read(tty,args);
4280: e58d0000 str r0, [sp]
tty->tty_rcvwakeup = 0;
4284: e58430e4 str r3, [r4, #228] ; 0xe4
rtems_semaphore_release (tty->isem);
4288: e5940014 ldr r0, [r4, #20]
428c: eb000538 bl 5774 <rtems_semaphore_release>
}
args->bytes_moved = args->count - count;
tty->tty_rcvwakeup = 0;
rtems_semaphore_release (tty->isem);
return sc;
}
4290: e59d0000 ldr r0, [sp]
4294: e28dd008 add sp, sp, #8
4298: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
tty->tty_rcvwakeup = 0;
rtems_semaphore_release (tty->isem);
return sc;
}
if (tty->cindex == tty->ccount) {
429c: e5942024 ldr r2, [r4, #36] ; 0x24
42a0: e5943020 ldr r3, [r4, #32]
42a4: e1520003 cmp r2, r3
42a8: 0a000018 beq 4310 <rtems_termios_read+0xf4>
sc = fillBufferQueue (tty);
if (sc != RTEMS_SUCCESSFUL)
tty->cindex = tty->ccount = 0;
}
while (count && (tty->cindex < tty->ccount)) {
42ac: e3580000 cmp r8, #0
42b0: 0a00000e beq 42f0 <rtems_termios_read+0xd4>
42b4: e2842020 add r2, r4, #32
42b8: e892000c ldm r2, {r2, r3}
42bc: e1530002 cmp r3, r2
42c0: ba000003 blt 42d4 <rtems_termios_read+0xb8>
42c4: ea000009 b 42f0 <rtems_termios_read+0xd4> <== NOT EXECUTED
42c8: e5942020 ldr r2, [r4, #32]
42cc: e1520003 cmp r2, r3
42d0: da000006 ble 42f0 <rtems_termios_read+0xd4>
*buffer++ = tty->cbuf[tty->cindex++];
42d4: e594201c ldr r2, [r4, #28]
42d8: e7d22003 ldrb r2, [r2, r3]
sc = fillBufferQueue (tty);
if (sc != RTEMS_SUCCESSFUL)
tty->cindex = tty->ccount = 0;
}
while (count && (tty->cindex < tty->ccount)) {
42dc: e2588001 subs r8, r8, #1
*buffer++ = tty->cbuf[tty->cindex++];
42e0: e2833001 add r3, r3, #1
42e4: e4ca2001 strb r2, [sl], #1
42e8: e5843024 str r3, [r4, #36] ; 0x24
sc = fillBufferQueue (tty);
if (sc != RTEMS_SUCCESSFUL)
tty->cindex = tty->ccount = 0;
}
while (count && (tty->cindex < tty->ccount)) {
42ec: 1afffff5 bne 42c8 <rtems_termios_read+0xac>
*buffer++ = tty->cbuf[tty->cindex++];
count--;
}
args->bytes_moved = args->count - count;
42f0: e5993010 ldr r3, [r9, #16]
42f4: e0688003 rsb r8, r8, r3
tty->tty_rcvwakeup = 0;
42f8: e3a03000 mov r3, #0
}
while (count && (tty->cindex < tty->ccount)) {
*buffer++ = tty->cbuf[tty->cindex++];
count--;
}
args->bytes_moved = args->count - count;
42fc: e5898018 str r8, [r9, #24]
tty->tty_rcvwakeup = 0;
rtems_semaphore_release (tty->isem);
4300: e5940014 ldr r0, [r4, #20]
while (count && (tty->cindex < tty->ccount)) {
*buffer++ = tty->cbuf[tty->cindex++];
count--;
}
args->bytes_moved = args->count - count;
tty->tty_rcvwakeup = 0;
4304: e58430e4 str r3, [r4, #228] ; 0xe4
rtems_semaphore_release (tty->isem);
4308: eb000519 bl 5774 <rtems_semaphore_release>
return sc;
430c: eaffffdf b 4290 <rtems_termios_read+0x74>
}
if (tty->cindex == tty->ccount) {
tty->cindex = tty->ccount = 0;
tty->read_start_column = tty->column;
if (tty->device.pollRead != NULL &&
4310: e59430a0 ldr r3, [r4, #160] ; 0xa0
rtems_semaphore_release (tty->isem);
return sc;
}
if (tty->cindex == tty->ccount) {
tty->cindex = tty->ccount = 0;
4314: e59d1000 ldr r1, [sp]
tty->read_start_column = tty->column;
4318: e5942028 ldr r2, [r4, #40] ; 0x28
if (tty->device.pollRead != NULL &&
431c: e3530000 cmp r3, #0
rtems_semaphore_release (tty->isem);
return sc;
}
if (tty->cindex == tty->ccount) {
tty->cindex = tty->ccount = 0;
4320: e5841020 str r1, [r4, #32]
4324: e5841024 str r1, [r4, #36] ; 0x24
tty->read_start_column = tty->column;
4328: e584202c str r2, [r4, #44] ; 0x2c
if (tty->device.pollRead != NULL &&
432c: 0a000002 beq 433c <rtems_termios_read+0x120>
4330: e59420b4 ldr r2, [r4, #180] ; 0xb4
4334: e3520000 cmp r2, #0
4338: 0a000063 beq 44cc <rtems_termios_read+0x2b0>
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)(
433c: e2843049 add r3, r4, #73 ; 0x49
if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size)
% tty->rawInBuf.Size)
< tty->lowwater) {
tty->flow_ctrl &= ~FL_IREQXOF;
/* if tx stopped and XON should be sent... */
if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF))
4340: e3a0bc02 mov fp, #512 ; 0x200
* Fill the input buffer from the raw input queue
*/
static rtems_status_code
fillBufferQueue (struct rtems_termios_tty *tty)
{
rtems_interval timeout = tty->rawInBufSemaphoreFirstTimeout;
4344: e5946074 ldr r6, [r4, #116] ; 0x74
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
(tty->ccount < (CBUFSIZE-1))) {
4348: e59f7270 ldr r7, [pc, #624] ; 45c0 <rtems_termios_read+0x3a4>
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)(
434c: e58d3004 str r3, [sp, #4]
static rtems_status_code
fillBufferQueue (struct rtems_termios_tty *tty)
{
rtems_interval timeout = tty->rawInBufSemaphoreFirstTimeout;
rtems_status_code sc;
int wait = (int)1;
4350: e3a05001 mov r5, #1
if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size)
% tty->rawInBuf.Size)
< tty->lowwater) {
tty->flow_ctrl &= ~FL_IREQXOF;
/* if tx stopped and XON should be sent... */
if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF))
4354: e28bb002 add fp, fp, #2
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
4358: e594205c ldr r2, [r4, #92] ; 0x5c
435c: e5943060 ldr r3, [r4, #96] ; 0x60
4360: e1520003 cmp r2, r3
4364: 1a00000a bne 4394 <rtems_termios_read+0x178>
4368: ea000042 b 4478 <rtems_termios_read+0x25c>
}
}
/* continue processing new character */
if (tty->termios.c_lflag & ICANON) {
if (siproc (c, tty))
436c: e1a00006 mov r0, r6
4370: e1a01004 mov r1, r4
4374: ebffff5e bl 40f4 <siproc>
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
4378: e594205c ldr r2, [r4, #92] ; 0x5c
437c: e5943060 ldr r3, [r4, #96] ; 0x60
}
/* continue processing new character */
if (tty->termios.c_lflag & ICANON) {
if (siproc (c, tty))
wait = 0;
4380: e3500000 cmp r0, #0
4384: 13a05000 movne r5, #0
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
4388: e1520003 cmp r2, r3
} else {
siproc (c, tty);
if (tty->ccount >= tty->termios.c_cc[VMIN])
wait = 0;
}
timeout = tty->rawInBufSemaphoreTimeout;
438c: e5946070 ldr r6, [r4, #112] ; 0x70
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
4390: 0a000038 beq 4478 <rtems_termios_read+0x25c>
(tty->ccount < (CBUFSIZE-1))) {
4394: e5973008 ldr r3, [r7, #8]
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
4398: e5942020 ldr r2, [r4, #32]
(tty->ccount < (CBUFSIZE-1))) {
439c: e2433001 sub r3, r3, #1
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
43a0: e1520003 cmp r2, r3
43a4: aa000033 bge 4478 <rtems_termios_read+0x25c>
(tty->ccount < (CBUFSIZE-1))) {
unsigned char c;
unsigned int newHead;
newHead = (tty->rawInBuf.Head + 1) % tty->rawInBuf.Size;
43a8: e594005c ldr r0, [r4, #92] ; 0x5c
43ac: e5941064 ldr r1, [r4, #100] ; 0x64
43b0: e2800001 add r0, r0, #1
43b4: eb003019 bl 10420 <__umodsi3>
c = tty->rawInBuf.theBuf[newHead];
43b8: e5943058 ldr r3, [r4, #88] ; 0x58
43bc: e7d36000 ldrb r6, [r3, r0]
tty->rawInBuf.Head = newHead;
43c0: e584005c str r0, [r4, #92] ; 0x5c
if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size)
43c4: e5943060 ldr r3, [r4, #96] ; 0x60
43c8: e5942064 ldr r2, [r4, #100] ; 0x64
43cc: e0823003 add r3, r2, r3
% tty->rawInBuf.Size)
43d0: e0600003 rsb r0, r0, r3
43d4: e5941064 ldr r1, [r4, #100] ; 0x64
43d8: eb003010 bl 10420 <__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)
43dc: e59430bc ldr r3, [r4, #188] ; 0xbc
43e0: e1500003 cmp r0, r3
43e4: 2a000014 bcs 443c <rtems_termios_read+0x220>
% tty->rawInBuf.Size)
< tty->lowwater) {
tty->flow_ctrl &= ~FL_IREQXOF;
43e8: e59430b8 ldr r3, [r4, #184] ; 0xb8
43ec: e3c33001 bic r3, r3, #1
43f0: e58430b8 str r3, [r4, #184] ; 0xb8
/* if tx stopped and XON should be sent... */
if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF))
43f4: e59430b8 ldr r3, [r4, #184] ; 0xb8
43f8: e3c33f7f bic r3, r3, #508 ; 0x1fc
43fc: e3c33001 bic r3, r3, #1
4400: e1a03b03 lsl r3, r3, #22
4404: e1a03b23 lsr r3, r3, #22
4408: e153000b cmp r3, fp
440c: 0a000022 beq 449c <rtems_termios_read+0x280>
&& ((tty->rawOutBufState == rob_idle)
|| (tty->flow_ctrl & FL_OSTOP))) {
/* XON should be sent now... */
(*tty->device.write)(
tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
} else if (tty->flow_ctrl & FL_MDRTS) {
4410: e59430b8 ldr r3, [r4, #184] ; 0xb8
4414: e3130c01 tst r3, #256 ; 0x100
4418: 0a000007 beq 443c <rtems_termios_read+0x220>
tty->flow_ctrl &= ~FL_IRTSOFF;
441c: e59420b8 ldr r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* activate RTS line */
if (tty->device.startRemoteTx != NULL) {
4420: e59430b0 ldr r3, [r4, #176] ; 0xb0 <== NOT EXECUTED
|| (tty->flow_ctrl & FL_OSTOP))) {
/* XON should be sent now... */
(*tty->device.write)(
tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
} else if (tty->flow_ctrl & FL_MDRTS) {
tty->flow_ctrl &= ~FL_IRTSOFF;
4424: e3c22004 bic r2, r2, #4 <== NOT EXECUTED
/* activate RTS line */
if (tty->device.startRemoteTx != NULL) {
4428: e3530000 cmp r3, #0 <== NOT EXECUTED
|| (tty->flow_ctrl & FL_OSTOP))) {
/* XON should be sent now... */
(*tty->device.write)(
tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
} else if (tty->flow_ctrl & FL_MDRTS) {
tty->flow_ctrl &= ~FL_IRTSOFF;
442c: e58420b8 str r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* activate RTS line */
if (tty->device.startRemoteTx != NULL) {
tty->device.startRemoteTx(tty->minor);
4430: 15940010 ldrne r0, [r4, #16] <== NOT EXECUTED
4434: 11a0e00f movne lr, pc <== NOT EXECUTED
4438: 112fff13 bxne r3 <== NOT EXECUTED
}
}
}
/* continue processing new character */
if (tty->termios.c_lflag & ICANON) {
443c: e594303c ldr r3, [r4, #60] ; 0x3c
4440: e3130002 tst r3, #2
4444: 1affffc8 bne 436c <rtems_termios_read+0x150>
if (siproc (c, tty))
wait = 0;
} else {
siproc (c, tty);
4448: e1a00006 mov r0, r6 <== NOT EXECUTED
444c: e1a01004 mov r1, r4 <== NOT EXECUTED
4450: ebffff27 bl 40f4 <siproc> <== NOT EXECUTED
if (tty->ccount >= tty->termios.c_cc[VMIN])
4454: e5d43047 ldrb r3, [r4, #71] ; 0x47 <== NOT EXECUTED
4458: e5942020 ldr r2, [r4, #32] <== NOT EXECUTED
wait = 0;
445c: e1520003 cmp r2, r3 <== NOT EXECUTED
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
4460: e594205c ldr r2, [r4, #92] ; 0x5c <== NOT EXECUTED
4464: e5943060 ldr r3, [r4, #96] ; 0x60 <== NOT EXECUTED
if (siproc (c, tty))
wait = 0;
} else {
siproc (c, tty);
if (tty->ccount >= tty->termios.c_cc[VMIN])
wait = 0;
4468: a3a05000 movge r5, #0 <== NOT EXECUTED
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
446c: e1520003 cmp r2, r3 <== NOT EXECUTED
} else {
siproc (c, tty);
if (tty->ccount >= tty->termios.c_cc[VMIN])
wait = 0;
}
timeout = tty->rawInBufSemaphoreTimeout;
4470: e5946070 ldr r6, [r4, #112] ; 0x70 <== NOT EXECUTED
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
4474: 1affffc6 bne 4394 <rtems_termios_read+0x178> <== NOT EXECUTED
}
/*
* Wait for characters
*/
if ( wait ) {
4478: e3550000 cmp r5, #0
447c: 0affff8a beq 42ac <rtems_termios_read+0x90>
sc = rtems_semaphore_obtain(
4480: e2840068 add r0, r4, #104 ; 0x68
4484: e8900003 ldm r0, {r0, r1}
4488: e1a02006 mov r2, r6
448c: eb00046f bl 5650 <rtems_semaphore_obtain>
tty->rawInBuf.Semaphore, tty->rawInBufSemaphoreOptions, timeout);
if (sc != RTEMS_SUCCESSFUL)
4490: e3500000 cmp r0, #0
4494: 0affffaf beq 4358 <rtems_termios_read+0x13c>
4498: eaffff83 b 42ac <rtems_termios_read+0x90> <== NOT EXECUTED
< tty->lowwater) {
tty->flow_ctrl &= ~FL_IREQXOF;
/* if tx stopped and XON should be sent... */
if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF))
== (FL_MDXON | FL_ISNTXOF))
&& ((tty->rawOutBufState == rob_idle)
449c: e5943094 ldr r3, [r4, #148] ; 0x94 <== NOT EXECUTED
44a0: e3530000 cmp r3, #0 <== NOT EXECUTED
44a4: 0a000002 beq 44b4 <rtems_termios_read+0x298> <== NOT EXECUTED
|| (tty->flow_ctrl & FL_OSTOP))) {
44a8: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
44ac: e3130020 tst r3, #32 <== NOT EXECUTED
44b0: 0affffd6 beq 4410 <rtems_termios_read+0x1f4> <== NOT EXECUTED
/* XON should be sent now... */
(*tty->device.write)(
44b4: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
44b8: e59d1004 ldr r1, [sp, #4] <== NOT EXECUTED
44bc: e3a02001 mov r2, #1 <== NOT EXECUTED
44c0: e1a0e00f mov lr, pc <== NOT EXECUTED
44c4: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED
44c8: eaffffdb b 443c <rtems_termios_read+0x220> <== NOT EXECUTED
static rtems_status_code
fillBufferPoll (struct rtems_termios_tty *tty)
{
int n;
if (tty->termios.c_lflag & ICANON) {
44cc: e594203c ldr r2, [r4, #60] ; 0x3c
44d0: e3120002 tst r2, #2
44d4: 0a00000b beq 4508 <rtems_termios_read+0x2ec>
for (;;) {
n = (*tty->device.pollRead)(tty->minor);
44d8: e5940010 ldr r0, [r4, #16]
44dc: e1a0e00f mov lr, pc
44e0: e12fff13 bx r3
if (n < 0) {
44e4: e3500000 cmp r0, #0
rtems_task_wake_after (1);
} else {
if (siproc (n, tty))
44e8: e1a01004 mov r1, r4
44ec: e20000ff and r0, r0, #255 ; 0xff
int n;
if (tty->termios.c_lflag & ICANON) {
for (;;) {
n = (*tty->device.pollRead)(tty->minor);
if (n < 0) {
44f0: ba00002d blt 45ac <rtems_termios_read+0x390>
rtems_task_wake_after (1);
} else {
if (siproc (n, tty))
44f4: ebfffefe bl 40f4 <siproc>
44f8: e3500000 cmp r0, #0
44fc: 1affff6a bne 42ac <rtems_termios_read+0x90>
static rtems_status_code
fillBufferPoll (struct rtems_termios_tty *tty)
{
int n;
if (tty->termios.c_lflag & ICANON) {
4500: e59430a0 ldr r3, [r4, #160] ; 0xa0
4504: eafffff3 b 44d8 <rtems_termios_read+0x2bc>
}
}
} else {
rtems_interval then, now;
then = rtems_clock_get_ticks_since_boot();
4508: eb0002ac bl 4fc0 <rtems_clock_get_ticks_since_boot> <== NOT EXECUTED
450c: e1a05000 mov r5, r0 <== NOT EXECUTED
for (;;) {
n = (*tty->device.pollRead)(tty->minor);
4510: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
4514: e1a0e00f mov lr, pc <== NOT EXECUTED
4518: e594f0a0 ldr pc, [r4, #160] ; 0xa0 <== NOT EXECUTED
if (n < 0) {
451c: e3500000 cmp r0, #0 <== NOT EXECUTED
4520: ba00000c blt 4558 <rtems_termios_read+0x33c> <== NOT EXECUTED
break;
}
}
rtems_task_wake_after (1);
} else {
siproc (n, tty);
4524: e20000ff and r0, r0, #255 ; 0xff <== NOT EXECUTED
4528: e1a01004 mov r1, r4 <== NOT EXECUTED
452c: ebfffef0 bl 40f4 <siproc> <== NOT EXECUTED
if (tty->ccount >= tty->termios.c_cc[VMIN])
4530: e5d43047 ldrb r3, [r4, #71] ; 0x47 <== NOT EXECUTED
4534: e5942020 ldr r2, [r4, #32] <== NOT EXECUTED
4538: e1520003 cmp r2, r3 <== NOT EXECUTED
453c: aaffff5a bge 42ac <rtems_termios_read+0x90> <== NOT EXECUTED
break;
if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
4540: e3530000 cmp r3, #0 <== NOT EXECUTED
4544: 0afffff1 beq 4510 <rtems_termios_read+0x2f4> <== NOT EXECUTED
4548: e5d43046 ldrb r3, [r4, #70] ; 0x46 <== NOT EXECUTED
454c: e3530000 cmp r3, #0 <== NOT EXECUTED
4550: 0affffee beq 4510 <rtems_termios_read+0x2f4> <== NOT EXECUTED
4554: eaffffeb b 4508 <rtems_termios_read+0x2ec> <== NOT EXECUTED
then = rtems_clock_get_ticks_since_boot();
for (;;) {
n = (*tty->device.pollRead)(tty->minor);
if (n < 0) {
if (tty->termios.c_cc[VMIN]) {
4558: e5d43047 ldrb r3, [r4, #71] ; 0x47 <== NOT EXECUTED
455c: e3530000 cmp r3, #0 <== NOT EXECUTED
4560: 0a000008 beq 4588 <rtems_termios_read+0x36c> <== NOT EXECUTED
if (tty->termios.c_cc[VTIME] && tty->ccount) {
4564: e5d43046 ldrb r3, [r4, #70] ; 0x46 <== NOT EXECUTED
4568: e3530000 cmp r3, #0 <== NOT EXECUTED
456c: 0a000002 beq 457c <rtems_termios_read+0x360> <== NOT EXECUTED
4570: e5943020 ldr r3, [r4, #32] <== NOT EXECUTED
4574: e3530000 cmp r3, #0 <== NOT EXECUTED
4578: 1a000005 bne 4594 <rtems_termios_read+0x378> <== NOT EXECUTED
now = rtems_clock_get_ticks_since_boot();
if ((now - then) > tty->vtimeTicks) {
break;
}
}
rtems_task_wake_after (1);
457c: e3a00001 mov r0, #1 <== NOT EXECUTED
4580: eb000569 bl 5b2c <rtems_task_wake_after> <== NOT EXECUTED
4584: eaffffe1 b 4510 <rtems_termios_read+0x2f4> <== NOT EXECUTED
if ((now - then) > tty->vtimeTicks) {
break;
}
}
} else {
if (!tty->termios.c_cc[VTIME])
4588: e5d43046 ldrb r3, [r4, #70] ; 0x46 <== NOT EXECUTED
458c: e3530000 cmp r3, #0 <== NOT EXECUTED
4590: 0affff45 beq 42ac <rtems_termios_read+0x90> <== NOT EXECUTED
break;
now = rtems_clock_get_ticks_since_boot();
4594: eb000289 bl 4fc0 <rtems_clock_get_ticks_since_boot> <== NOT EXECUTED
if ((now - then) > tty->vtimeTicks) {
4598: e5943054 ldr r3, [r4, #84] ; 0x54 <== NOT EXECUTED
459c: e0650000 rsb r0, r5, r0 <== NOT EXECUTED
45a0: e1500003 cmp r0, r3 <== NOT EXECUTED
45a4: 9afffff4 bls 457c <rtems_termios_read+0x360> <== NOT EXECUTED
45a8: eaffff3f b 42ac <rtems_termios_read+0x90> <== NOT EXECUTED
if (tty->termios.c_lflag & ICANON) {
for (;;) {
n = (*tty->device.pollRead)(tty->minor);
if (n < 0) {
rtems_task_wake_after (1);
45ac: e3a00001 mov r0, #1
45b0: eb00055d bl 5b2c <rtems_task_wake_after>
static rtems_status_code
fillBufferPoll (struct rtems_termios_tty *tty)
{
int n;
if (tty->termios.c_lflag & ICANON) {
45b4: e59430a0 ldr r3, [r4, #160] ; 0xa0
45b8: eaffffc6 b 44d8 <rtems_termios_read+0x2bc>
0000494c <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))
494c: e59030b8 ldr r3, [r0, #184] ; 0xb8
4950: e3c33fff bic r3, r3, #1020 ; 0x3fc
4954: e1a03a83 lsl r3, r3, #21
4958: e3a02b01 mov r2, #1024 ; 0x400
495c: e1a03aa3 lsr r3, r3, #21
4960: e2822001 add r2, r2, #1
4964: 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)
{
4968: e92d4070 push {r4, r5, r6, lr}
496c: 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))
4970: 0a000048 beq 4a98 <rtems_termios_refill_transmitter+0x14c>
tty->flow_ctrl |= FL_ISNTXOF;
rtems_interrupt_enable(level);
nToSend = 1;
} else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) {
4974: e59030b8 ldr r3, [r0, #184] ; 0xb8
4978: e2033003 and r3, r3, #3
497c: e3530002 cmp r3, #2
4980: 0a000056 beq 4ae0 <rtems_termios_refill_transmitter+0x194>
tty->flow_ctrl &= ~FL_ISNTXOF;
rtems_interrupt_enable(level);
nToSend = 1;
} else {
if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) {
4984: e5902080 ldr r2, [r0, #128] ; 0x80
4988: e5903084 ldr r3, [r0, #132] ; 0x84
498c: e1520003 cmp r2, r3
4990: 0a00002a beq 4a40 <rtems_termios_refill_transmitter+0xf4>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
4994: e10f3000 mrs r3, CPSR
4998: e3832080 orr r2, r3, #128 ; 0x80
499c: e129f002 msr CPSR_fc, r2
return 0;
}
rtems_interrupt_disable(level);
len = tty->t_dqlen;
tty->t_dqlen = 0;
49a0: e3a02000 mov r2, #0
}
return 0;
}
rtems_interrupt_disable(level);
len = tty->t_dqlen;
49a4: e5900090 ldr r0, [r0, #144] ; 0x90
tty->t_dqlen = 0;
49a8: e5842090 str r2, [r4, #144] ; 0x90
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
49ac: e129f003 msr CPSR_fc, r3
rtems_interrupt_enable(level);
newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size;
49b0: e5943084 ldr r3, [r4, #132] ; 0x84
49b4: e5941088 ldr r1, [r4, #136] ; 0x88
49b8: e0800003 add r0, r0, r3
49bc: eb002e97 bl 10420 <__umodsi3>
tty->rawOutBuf.Tail = newTail;
if (tty->rawOutBufState == rob_wait) {
49c0: e5943094 ldr r3, [r4, #148] ; 0x94
49c4: 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;
49c8: e1a05000 mov r5, r0
tty->rawOutBuf.Tail = newTail;
49cc: e5840084 str r0, [r4, #132] ; 0x84
if (tty->rawOutBufState == rob_wait) {
49d0: 0a00002d beq 4a8c <rtems_termios_refill_transmitter+0x140>
* wake up any pending writer task
*/
rtems_semaphore_release (tty->rawOutBuf.Semaphore);
}
if (newTail == tty->rawOutBuf.Head) {
49d4: e5943080 ldr r3, [r4, #128] ; 0x80
49d8: e1530005 cmp r3, r5
49dc: 0a00001f beq 4a60 <rtems_termios_refill_transmitter+0x114>
if ( tty->tty_snd.sw_pfn != NULL) {
(*tty->tty_snd.sw_pfn)(&tty->termios, tty->tty_snd.sw_arg);
}
}
/* check, whether output should stop due to received XOFF */
else if ((tty->flow_ctrl & (FL_MDXON | FL_ORCVXOF))
49e0: e59430b8 ldr r3, [r4, #184] ; 0xb8
49e4: e2033e21 and r3, r3, #528 ; 0x210
49e8: e3530e21 cmp r3, #528 ; 0x210
49ec: 0a00004d beq 4b28 <rtems_termios_refill_transmitter+0x1dc>
nToSend = 0;
} else {
/*
* Buffer not empty, start tranmitter
*/
if (newTail > tty->rawOutBuf.Head)
49f0: e5943080 ldr r3, [r4, #128] ; 0x80
49f4: e1550003 cmp r5, r3
nToSend = tty->rawOutBuf.Size - newTail;
49f8: 85946088 ldrhi r6, [r4, #136] ; 0x88
else
nToSend = tty->rawOutBuf.Head - newTail;
49fc: 95946080 ldrls r6, [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)) {
4a00: e59430b8 ldr r3, [r4, #184] ; 0xb8
} else {
/*
* Buffer not empty, start tranmitter
*/
if (newTail > tty->rawOutBuf.Head)
nToSend = tty->rawOutBuf.Size - newTail;
4a04: 80656006 rsbhi r6, r5, r6
else
nToSend = tty->rawOutBuf.Head - newTail;
4a08: 90656006 rsbls r6, r5, r6
/* for outgoing flow control */
if (tty->flow_ctrl & (FL_MDXON | FL_MDXOF)) {
nToSend = 1;
}
tty->rawOutBufState = rob_busy; /*apm*/
(*tty->device.write)(
4a0c: e594107c ldr r1, [r4, #124] ; 0x7c
else
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)) {
4a10: e3130c06 tst r3, #1536 ; 0x600
4a14: 13a06001 movne r6, #1
nToSend = 1;
}
tty->rawOutBufState = rob_busy; /*apm*/
4a18: e3a03001 mov r3, #1
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;
4a1c: e1a02006 mov r2, r6
}
tty->rawOutBufState = rob_busy; /*apm*/
4a20: e5843094 str r3, [r4, #148] ; 0x94
(*tty->device.write)(
4a24: e5940010 ldr r0, [r4, #16]
4a28: e0811005 add r1, r1, r5
4a2c: e1a0e00f mov lr, pc
4a30: e594f0a4 ldr pc, [r4, #164] ; 0xa4
tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend);
}
tty->rawOutBuf.Tail = newTail; /*apm*/
4a34: e5845084 str r5, [r4, #132] ; 0x84
}
return nToSend;
}
4a38: e1a00006 mov r0, r6
4a3c: e8bd8070 pop {r4, r5, r6, pc}
} else {
if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) {
/*
* buffer was empty
*/
if (tty->rawOutBufState == rob_wait) {
4a40: e5903094 ldr r3, [r0, #148] ; 0x94
4a44: e3530002 cmp r3, #2
/*
* this should never happen...
*/
rtems_semaphore_release (tty->rawOutBuf.Semaphore);
}
return 0;
4a48: 13a06000 movne r6, #0
} else {
if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) {
/*
* buffer was empty
*/
if (tty->rawOutBufState == rob_wait) {
4a4c: 1afffff9 bne 4a38 <rtems_termios_refill_transmitter+0xec>
/*
* this should never happen...
*/
rtems_semaphore_release (tty->rawOutBuf.Semaphore);
4a50: e590008c ldr r0, [r0, #140] ; 0x8c <== NOT EXECUTED
4a54: eb000346 bl 5774 <rtems_semaphore_release> <== NOT EXECUTED
}
return 0;
4a58: e3a06000 mov r6, #0 <== NOT EXECUTED
4a5c: eafffff5 b 4a38 <rtems_termios_refill_transmitter+0xec> <== NOT EXECUTED
nToSend = 0;
/*
* check to see if snd wakeup callback was set
*/
if ( tty->tty_snd.sw_pfn != NULL) {
4a60: e59430d4 ldr r3, [r4, #212] ; 0xd4
if (newTail == tty->rawOutBuf.Head) {
/*
* Buffer has become empty
*/
tty->rawOutBufState = rob_idle;
4a64: e3a06000 mov r6, #0
nToSend = 0;
/*
* check to see if snd wakeup callback was set
*/
if ( tty->tty_snd.sw_pfn != NULL) {
4a68: e1530006 cmp r3, r6
if (newTail == tty->rawOutBuf.Head) {
/*
* Buffer has become empty
*/
tty->rawOutBufState = rob_idle;
4a6c: e5846094 str r6, [r4, #148] ; 0x94
nToSend = 0;
4a70: 01a06003 moveq r6, r3
/*
* check to see if snd wakeup callback was set
*/
if ( tty->tty_snd.sw_pfn != NULL) {
4a74: 0affffee beq 4a34 <rtems_termios_refill_transmitter+0xe8>
(*tty->tty_snd.sw_pfn)(&tty->termios, tty->tty_snd.sw_arg);
4a78: e2840030 add r0, r4, #48 ; 0x30 <== NOT EXECUTED
4a7c: e59410d8 ldr r1, [r4, #216] ; 0xd8 <== NOT EXECUTED
4a80: e1a0e00f mov lr, pc <== NOT EXECUTED
4a84: e12fff13 bx r3 <== NOT EXECUTED
4a88: eaffffe9 b 4a34 <rtems_termios_refill_transmitter+0xe8> <== NOT EXECUTED
tty->rawOutBuf.Tail = newTail;
if (tty->rawOutBufState == rob_wait) {
/*
* wake up any pending writer task
*/
rtems_semaphore_release (tty->rawOutBuf.Semaphore);
4a8c: e594008c ldr r0, [r4, #140] ; 0x8c
4a90: eb000337 bl 5774 <rtems_semaphore_release>
4a94: eaffffce b 49d4 <rtems_termios_refill_transmitter+0x88>
/* check for XOF/XON to send */
if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF))
== (FL_MDXOF | FL_IREQXOF)) {
/* XOFF should be sent now... */
(*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1);
4a98: e284104a add r1, r4, #74 ; 0x4a <== NOT EXECUTED
4a9c: e3a02001 mov r2, #1 <== NOT EXECUTED
4aa0: e5900010 ldr r0, [r0, #16] <== NOT EXECUTED
4aa4: e1a0e00f mov lr, pc <== NOT EXECUTED
4aa8: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
4aac: e10f3000 mrs r3, CPSR <== NOT EXECUTED
4ab0: e3832080 orr r2, r3, #128 ; 0x80 <== NOT EXECUTED
4ab4: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED
rtems_interrupt_disable(level);
tty->t_dqlen--;
4ab8: e5941090 ldr r1, [r4, #144] ; 0x90 <== NOT EXECUTED
tty->flow_ctrl |= FL_ISNTXOF;
4abc: e59420b8 ldr r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
== (FL_MDXOF | FL_IREQXOF)) {
/* XOFF should be sent now... */
(*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1);
rtems_interrupt_disable(level);
tty->t_dqlen--;
4ac0: e2411001 sub r1, r1, #1 <== NOT EXECUTED
tty->flow_ctrl |= FL_ISNTXOF;
4ac4: e3822002 orr r2, r2, #2 <== NOT EXECUTED
== (FL_MDXOF | FL_IREQXOF)) {
/* XOFF should be sent now... */
(*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1);
rtems_interrupt_disable(level);
tty->t_dqlen--;
4ac8: e5841090 str r1, [r4, #144] ; 0x90 <== NOT EXECUTED
tty->flow_ctrl |= FL_ISNTXOF;
4acc: e58420b8 str r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
4ad0: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED
rtems_interrupt_enable(level);
nToSend = 1;
4ad4: e3a06001 mov r6, #1 <== NOT EXECUTED
tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend);
}
tty->rawOutBuf.Tail = newTail; /*apm*/
}
return nToSend;
}
4ad8: e1a00006 mov r0, r6 <== NOT EXECUTED
4adc: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
* 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);
4ae0: e2841049 add r1, r4, #73 ; 0x49 <== NOT EXECUTED
4ae4: e3a02001 mov r2, #1 <== NOT EXECUTED
4ae8: e5900010 ldr r0, [r0, #16] <== NOT EXECUTED
4aec: e1a0e00f mov lr, pc <== NOT EXECUTED
4af0: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
4af4: e10f3000 mrs r3, CPSR <== NOT EXECUTED
4af8: e3832080 orr r2, r3, #128 ; 0x80 <== NOT EXECUTED
4afc: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED
rtems_interrupt_disable(level);
tty->t_dqlen--;
4b00: e5941090 ldr r1, [r4, #144] ; 0x90 <== NOT EXECUTED
tty->flow_ctrl &= ~FL_ISNTXOF;
4b04: e59420b8 ldr r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
* Therefore the dequeue "length" should be reduced by 1
*/
(*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
rtems_interrupt_disable(level);
tty->t_dqlen--;
4b08: e2411001 sub r1, r1, #1 <== NOT EXECUTED
tty->flow_ctrl &= ~FL_ISNTXOF;
4b0c: e3c22002 bic r2, r2, #2 <== NOT EXECUTED
* Therefore the dequeue "length" should be reduced by 1
*/
(*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
rtems_interrupt_disable(level);
tty->t_dqlen--;
4b10: e5841090 str r1, [r4, #144] ; 0x90 <== NOT EXECUTED
tty->flow_ctrl &= ~FL_ISNTXOF;
4b14: e58420b8 str r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
4b18: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED
rtems_interrupt_enable(level);
nToSend = 1;
4b1c: e3a06001 mov r6, #1 <== NOT EXECUTED
tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend);
}
tty->rawOutBuf.Tail = newTail; /*apm*/
}
return nToSend;
}
4b20: e1a00006 mov r0, r6 <== NOT EXECUTED
4b24: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
4b28: e10f3000 mrs r3, CPSR <== NOT EXECUTED
4b2c: e3832080 orr r2, r3, #128 ; 0x80 <== NOT EXECUTED
4b30: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED
else if ((tty->flow_ctrl & (FL_MDXON | FL_ORCVXOF))
== (FL_MDXON | FL_ORCVXOF)) {
/* Buffer not empty, but output stops due to XOFF */
/* set flag, that output has been stopped */
rtems_interrupt_disable(level);
tty->flow_ctrl |= FL_OSTOP;
4b34: e59420b8 ldr r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
4b38: e3822020 orr r2, r2, #32 <== NOT EXECUTED
4b3c: e58420b8 str r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
tty->rawOutBufState = rob_busy; /*apm*/
4b40: e3a02001 mov r2, #1 <== NOT EXECUTED
4b44: e5842094 str r2, [r4, #148] ; 0x94 <== NOT EXECUTED
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
4b48: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED
rtems_interrupt_enable(level);
nToSend = 0;
4b4c: e3a06000 mov r6, #0 <== NOT EXECUTED
4b50: eaffffb7 b 4a34 <rtems_termios_refill_transmitter+0xe8> <== NOT EXECUTED
000048c0 <rtems_termios_rxdaemon>:
/*
* this task actually processes any receive events
*/
static rtems_task rtems_termios_rxdaemon(rtems_task_argument argument)
{
48c0: e92d40f0 push {r4, r5, r6, r7, lr}
48c4: e24dd008 sub sp, sp, #8
48c8: e1a04000 mov r4, r0
48cc: e28d7007 add r7, sp, #7
while (1) {
/*
* wait for rtems event
*/
rtems_event_receive(
48d0: e3a06000 mov r6, #0
48d4: ea000005 b 48f0 <rtems_termios_rxdaemon+0x30>
}
/*
* do something
*/
c = tty->device.pollRead(tty->minor);
48d8: e5940010 ldr r0, [r4, #16]
48dc: e1a0e00f mov lr, pc
48e0: e594f0a0 ldr pc, [r4, #160] ; 0xa0
if (c != EOF) {
48e4: e3700001 cmn r0, #1
}
/*
* do something
*/
c = tty->device.pollRead(tty->minor);
48e8: e1a03000 mov r3, r0
if (c != EOF) {
48ec: 1a000010 bne 4934 <rtems_termios_rxdaemon+0x74>
while (1) {
/*
* wait for rtems event
*/
rtems_event_receive(
48f0: e1a0300d mov r3, sp
48f4: e3a01002 mov r1, #2
48f8: e3a02000 mov r2, #0
48fc: e3a00003 mov r0, #3
4900: eb0001ce bl 5040 <rtems_event_receive>
(TERMIOS_RX_PROC_EVENT | TERMIOS_RX_TERMINATE_EVENT),
RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_NO_TIMEOUT,
&the_event
);
if ((the_event & TERMIOS_RX_TERMINATE_EVENT) != 0) {
4904: e59d3000 ldr r3, [sp]
4908: e3130001 tst r3, #1
490c: 0afffff1 beq 48d8 <rtems_termios_rxdaemon+0x18>
tty->rxTaskId = 0;
4910: e58460c4 str r6, [r4, #196] ; 0xc4 <== NOT EXECUTED
rtems_task_delete(RTEMS_SELF);
4914: e1a00006 mov r0, r6 <== NOT EXECUTED
4918: eb00040e bl 5958 <rtems_task_delete> <== NOT EXECUTED
}
/*
* do something
*/
c = tty->device.pollRead(tty->minor);
491c: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
4920: e1a0e00f mov lr, pc <== NOT EXECUTED
4924: e594f0a0 ldr pc, [r4, #160] ; 0xa0 <== NOT EXECUTED
if (c != EOF) {
4928: e3700001 cmn r0, #1 <== NOT EXECUTED
}
/*
* do something
*/
c = tty->device.pollRead(tty->minor);
492c: e1a03000 mov r3, r0 <== NOT EXECUTED
if (c != EOF) {
4930: 0affffee beq 48f0 <rtems_termios_rxdaemon+0x30> <== NOT EXECUTED
/*
* pollRead did call enqueue on its own
*/
c_buf = c;
rtems_termios_enqueue_raw_characters ( tty,&c_buf,1);
4934: e1a00004 mov r0, r4
4938: e1a01007 mov r1, r7
493c: e3a02001 mov r2, #1
c = tty->device.pollRead(tty->minor);
if (c != EOF) {
/*
* pollRead did call enqueue on its own
*/
c_buf = c;
4940: e5cd3007 strb r3, [sp, #7]
rtems_termios_enqueue_raw_characters ( tty,&c_buf,1);
4944: ebffff21 bl 45d0 <rtems_termios_enqueue_raw_characters>
4948: eaffffe8 b 48f0 <rtems_termios_rxdaemon+0x30>
00004b54 <rtems_termios_txdaemon>:
/*
* this task actually processes any transmit events
*/
static rtems_task rtems_termios_txdaemon(rtems_task_argument argument)
{
4b54: e92d40f0 push {r4, r5, r6, r7, lr}
4b58: e59f6060 ldr r6, [pc, #96] ; 4bc0 <rtems_termios_txdaemon+0x6c>
4b5c: e24dd004 sub sp, sp, #4
4b60: e1a04000 mov r4, r0
while (1) {
/*
* wait for rtems event
*/
rtems_event_receive(
4b64: e3a07000 mov r7, #0
4b68: ea000008 b 4b90 <rtems_termios_txdaemon+0x3c>
}
/*
* call any line discipline start function
*/
if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
4b6c: e59430cc ldr r3, [r4, #204] ; 0xcc
4b70: e0863283 add r3, r6, r3, lsl #5
4b74: e5933014 ldr r3, [r3, #20]
4b78: e3530000 cmp r3, #0
rtems_termios_linesw[tty->t_line].l_start(tty);
4b7c: e1a00004 mov r0, r4
4b80: 11a0e00f movne lr, pc
4b84: 112fff13 bxne r3
}
/*
* try to push further characters to device
*/
rtems_termios_refill_transmitter(tty);
4b88: e1a00004 mov r0, r4
4b8c: ebffff6e bl 494c <rtems_termios_refill_transmitter>
while (1) {
/*
* wait for rtems event
*/
rtems_event_receive(
4b90: e1a0300d mov r3, sp
4b94: e3a01002 mov r1, #2
4b98: e3a02000 mov r2, #0
4b9c: e3a00003 mov r0, #3
4ba0: eb000126 bl 5040 <rtems_event_receive>
(TERMIOS_TX_START_EVENT | TERMIOS_TX_TERMINATE_EVENT),
RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_NO_TIMEOUT,
&the_event
);
if ((the_event & TERMIOS_TX_TERMINATE_EVENT) != 0) {
4ba4: e59d3000 ldr r3, [sp]
4ba8: e3130001 tst r3, #1
4bac: 0affffee beq 4b6c <rtems_termios_txdaemon+0x18>
tty->txTaskId = 0;
4bb0: e58470c8 str r7, [r4, #200] ; 0xc8 <== NOT EXECUTED
rtems_task_delete(RTEMS_SELF);
4bb4: e1a00007 mov r0, r7 <== NOT EXECUTED
4bb8: eb000366 bl 5958 <rtems_task_delete> <== NOT EXECUTED
4bbc: eaffffea b 4b6c <rtems_termios_txdaemon+0x18> <== NOT EXECUTED
00006a18 <rtems_verror>:
{
int local_errno = 0;
int chars_written = 0;
rtems_status_code status;
if (error_flag & RTEMS_ERROR_PANIC) {
6a18: e3100202 tst r0, #536870912 ; 0x20000000
static int rtems_verror(
rtems_error_code_t error_flag,
const char *printf_format,
va_list arglist
)
{
6a1c: e92d41f0 push {r4, r5, r6, r7, r8, lr}
6a20: e1a04000 mov r4, r0
6a24: e1a08001 mov r8, r1
6a28: e1a06002 mov r6, r2
int local_errno = 0;
int chars_written = 0;
rtems_status_code status;
if (error_flag & RTEMS_ERROR_PANIC) {
6a2c: 0a00000d beq 6a68 <rtems_verror+0x50>
if (rtems_panic_in_progress++)
6a30: e59f212c ldr r2, [pc, #300] ; 6b64 <rtems_verror+0x14c>
6a34: e5921000 ldr r1, [r2]
6a38: e2813001 add r3, r1, #1
6a3c: e3510000 cmp r1, #0
6a40: e5823000 str r3, [r2]
6a44: 0a000004 beq 6a5c <rtems_verror+0x44>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
6a48: e59f3118 ldr r3, [pc, #280] ; 6b68 <rtems_verror+0x150> <== NOT EXECUTED
6a4c: e5931000 ldr r1, [r3] <== NOT EXECUTED
6a50: e2811001 add r1, r1, #1 <== NOT EXECUTED
6a54: e5831000 str r1, [r3] <== NOT EXECUTED
RTEMS_COMPILER_MEMORY_BARRIER();
6a58: e5923000 ldr r3, [r2] <== NOT EXECUTED
_Thread_Disable_dispatch(); /* disable task switches */
/* don't aggravate things */
if (rtems_panic_in_progress > 2)
6a5c: e3530002 cmp r3, #2
return 0;
6a60: c3a06000 movgt r6, #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)
6a64: ca000024 bgt 6afc <rtems_verror+0xe4>
return 0;
}
(void) fflush(stdout); /* in case stdout/stderr same */
6a68: e59f50fc ldr r5, [pc, #252] ; 6b6c <rtems_verror+0x154>
6a6c: e5953000 ldr r3, [r5]
6a70: e5930008 ldr r0, [r3, #8]
6a74: eb002f38 bl 1275c <fflush>
status = error_flag & ~RTEMS_ERROR_MASK;
if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
6a78: e2147101 ands r7, r4, #1073741824 ; 0x40000000
return 0;
}
(void) fflush(stdout); /* in case stdout/stderr same */
status = error_flag & ~RTEMS_ERROR_MASK;
6a7c: e3c44207 bic r4, r4, #1879048192 ; 0x70000000
if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
6a80: 1a00002a bne 6b30 <rtems_verror+0x118>
#if defined(RTEMS_MULTIPROCESSING)
if (_System_state_Is_multiprocessing)
fprintf(stderr, "[%" PRIu32 "] ", _Configuration_MP_table->node);
#endif
chars_written += vfprintf(stderr, printf_format, arglist);
6a84: e5953000 ldr r3, [r5]
6a88: e1a02006 mov r2, r6
6a8c: e1a01008 mov r1, r8
6a90: e593000c ldr r0, [r3, #12]
6a94: eb0047a7 bl 18938 <vfprintf>
if (status)
6a98: e3540000 cmp r4, #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);
6a9c: e1a06000 mov r6, r0
if (status)
6aa0: 1a000017 bne 6b04 <rtems_verror+0xec>
chars_written +=
fprintf(stderr, " (status: %s)", rtems_status_text(status));
if (local_errno) {
6aa4: e3570000 cmp r7, #0
6aa8: 0a00000b beq 6adc <rtems_verror+0xc4>
if ((local_errno > 0) && *strerror(local_errno))
6aac: da000004 ble 6ac4 <rtems_verror+0xac>
6ab0: e1a00007 mov r0, r7
6ab4: eb003317 bl 13718 <strerror>
6ab8: e5d03000 ldrb r3, [r0]
6abc: e3530000 cmp r3, #0
6ac0: 1a00001d bne 6b3c <rtems_verror+0x124>
chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
else
chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
6ac4: e5953000 ldr r3, [r5]
6ac8: e59f10a0 ldr r1, [pc, #160] ; 6b70 <rtems_verror+0x158>
6acc: e593000c ldr r0, [r3, #12]
6ad0: e1a02007 mov r2, r7
6ad4: eb003006 bl 12af4 <fprintf>
6ad8: e0866000 add r6, r6, r0
}
chars_written += fprintf(stderr, "\n");
6adc: e5953000 ldr r3, [r5]
6ae0: e59f108c ldr r1, [pc, #140] ; 6b74 <rtems_verror+0x15c>
6ae4: e593000c ldr r0, [r3, #12]
6ae8: eb003001 bl 12af4 <fprintf>
(void) fflush(stderr);
6aec: 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");
6af0: e0806006 add r6, r0, r6
(void) fflush(stderr);
6af4: e593000c ldr r0, [r3, #12]
6af8: eb002f17 bl 1275c <fflush>
return chars_written;
}
6afc: e1a00006 mov r0, r6
6b00: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
chars_written += vfprintf(stderr, printf_format, arglist);
if (status)
chars_written +=
fprintf(stderr, " (status: %s)", rtems_status_text(status));
6b04: e59f3060 ldr r3, [pc, #96] ; 6b6c <rtems_verror+0x154>
6b08: e5933000 ldr r3, [r3]
6b0c: e1a00004 mov r0, r4
6b10: e593400c ldr r4, [r3, #12]
6b14: ebffffbb bl 6a08 <rtems_status_text>
6b18: e59f1058 ldr r1, [pc, #88] ; 6b78 <rtems_verror+0x160>
6b1c: e1a02000 mov r2, r0
6b20: e1a00004 mov r0, r4
6b24: eb002ff2 bl 12af4 <fprintf>
#endif
chars_written += vfprintf(stderr, printf_format, arglist);
if (status)
chars_written +=
6b28: e0866000 add r6, r6, r0
6b2c: eaffffdc b 6aa4 <rtems_verror+0x8c>
(void) fflush(stdout); /* in case stdout/stderr same */
status = error_flag & ~RTEMS_ERROR_MASK;
if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
local_errno = errno;
6b30: eb002e12 bl 12380 <__errno>
6b34: e5907000 ldr r7, [r0]
6b38: eaffffd1 b 6a84 <rtems_verror+0x6c>
chars_written +=
fprintf(stderr, " (status: %s)", rtems_status_text(status));
if (local_errno) {
if ((local_errno > 0) && *strerror(local_errno))
chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
6b3c: e5953000 ldr r3, [r5]
6b40: e1a00007 mov r0, r7
6b44: e593400c ldr r4, [r3, #12]
6b48: eb0032f2 bl 13718 <strerror>
6b4c: e59f1028 ldr r1, [pc, #40] ; 6b7c <rtems_verror+0x164>
6b50: e1a02000 mov r2, r0
6b54: e1a00004 mov r0, r4
6b58: eb002fe5 bl 12af4 <fprintf>
6b5c: e0866000 add r6, r6, r0
6b60: eaffffdd b 6adc <rtems_verror+0xc4>
00002710 <scanInt>:
/*
* Extract an integer value from the database
*/
static int
scanInt(FILE *fp, int *val)
{
2710: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
int c;
unsigned int i = 0;
unsigned int limit = INT_MAX;
int sign = 0;
2714: e3a06000 mov r6, #0
int d;
for (;;) {
c = getc(fp);
2718: e59f90f8 ldr r9, [pc, #248] ; 2818 <scanInt+0x108>
limit++;
continue;
}
sign = 1;
}
if (!isdigit(c))
271c: e59f80f8 ldr r8, [pc, #248] ; 281c <scanInt+0x10c>
return 0;
d = c - '0';
if ((i > (limit / 10))
2720: e59fa0f8 ldr sl, [pc, #248] ; 2820 <scanInt+0x110>
/*
* Extract an integer value from the database
*/
static int
scanInt(FILE *fp, int *val)
{
2724: e1a04000 mov r4, r0
2728: e1a0b001 mov fp, r1
int c;
unsigned int i = 0;
unsigned int limit = INT_MAX;
272c: e3e07102 mvn r7, #-2147483648 ; 0x80000000
*/
static int
scanInt(FILE *fp, int *val)
{
int c;
unsigned int i = 0;
2730: e1a05006 mov r5, r6
unsigned int limit = INT_MAX;
int sign = 0;
int d;
for (;;) {
c = getc(fp);
2734: e5943004 ldr r3, [r4, #4]
2738: e2433001 sub r3, r3, #1
273c: e3530000 cmp r3, #0
2740: e5843004 str r3, [r4, #4]
2744: ba00001d blt 27c0 <scanInt+0xb0>
2748: e5943000 ldr r3, [r4]
274c: e4d30001 ldrb r0, [r3], #1
if (c == ':')
2750: e350003a cmp r0, #58 ; 0x3a
unsigned int limit = INT_MAX;
int sign = 0;
int d;
for (;;) {
c = getc(fp);
2754: e5843000 str r3, [r4]
if (c == ':')
2758: 0a00001d beq 27d4 <scanInt+0xc4>
break;
if (sign == 0) {
275c: e3560000 cmp r6, #0
2760: 1a000004 bne 2778 <scanInt+0x68>
if (c == '-') {
2764: e350002d cmp r0, #45 ; 0x2d
sign = -1;
limit++;
2768: 02877001 addeq r7, r7, #1
c = getc(fp);
if (c == ':')
break;
if (sign == 0) {
if (c == '-') {
sign = -1;
276c: 03e06000 mvneq r6, #0
for (;;) {
c = getc(fp);
if (c == ':')
break;
if (sign == 0) {
if (c == '-') {
2770: 0affffef beq 2734 <scanInt+0x24>
sign = -1;
limit++;
continue;
}
sign = 1;
2774: e3a06001 mov r6, #1
}
if (!isdigit(c))
2778: e5983000 ldr r3, [r8]
277c: e0833000 add r3, r3, r0
2780: e5d33001 ldrb r3, [r3, #1]
2784: e2133004 ands r3, r3, #4
2788: 0a00001e beq 2808 <scanInt+0xf8>
return 0;
d = c - '0';
if ((i > (limit / 10))
278c: e083279a umull r2, r3, sl, r7
2790: e15501a3 cmp r5, r3, lsr #3
2794: 8a000019 bhi 2800 <scanInt+0xf0>
}
sign = 1;
}
if (!isdigit(c))
return 0;
d = c - '0';
2798: e2400030 sub r0, r0, #48 ; 0x30
279c: 11a03105 lslne r3, r5, #2
if ((i > (limit / 10))
|| ((i == (limit / 10)) && (d > (limit % 10))))
27a0: 0a000011 beq 27ec <scanInt+0xdc>
return 0;
i = i * 10 + d;
27a4: e0835005 add r5, r3, r5
unsigned int limit = INT_MAX;
int sign = 0;
int d;
for (;;) {
c = getc(fp);
27a8: e5943004 ldr r3, [r4, #4]
27ac: e2433001 sub r3, r3, #1
27b0: e3530000 cmp r3, #0
return 0;
d = c - '0';
if ((i > (limit / 10))
|| ((i == (limit / 10)) && (d > (limit % 10))))
return 0;
i = i * 10 + d;
27b4: e0805085 add r5, r0, r5, lsl #1
unsigned int limit = INT_MAX;
int sign = 0;
int d;
for (;;) {
c = getc(fp);
27b8: e5843004 str r3, [r4, #4]
27bc: aaffffe1 bge 2748 <scanInt+0x38>
27c0: e5990000 ldr r0, [r9] <== NOT EXECUTED
27c4: e1a01004 mov r1, r4 <== NOT EXECUTED
27c8: eb0032aa bl f278 <__srget_r> <== NOT EXECUTED
if (c == ':')
27cc: e350003a cmp r0, #58 ; 0x3a <== NOT EXECUTED
27d0: 1affffe1 bne 275c <scanInt+0x4c> <== NOT EXECUTED
if ((i > (limit / 10))
|| ((i == (limit / 10)) && (d > (limit % 10))))
return 0;
i = i * 10 + d;
}
if (sign == 0)
27d4: e3560000 cmp r6, #0
27d8: 0a00000c beq 2810 <scanInt+0x100>
return 0;
*val = i * sign;
27dc: e0050596 mul r5, r6, r5
return 1;
27e0: e3a00001 mov r0, #1
return 0;
i = i * 10 + d;
}
if (sign == 0)
return 0;
*val = i * sign;
27e4: e58b5000 str r5, [fp]
return 1;
27e8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
}
if (!isdigit(c))
return 0;
d = c - '0';
if ((i > (limit / 10))
|| ((i == (limit / 10)) && (d > (limit % 10))))
27ec: e1a03105 lsl r3, r5, #2 <== NOT EXECUTED
27f0: e0832005 add r2, r3, r5 <== NOT EXECUTED
27f4: e0472082 sub r2, r7, r2, lsl #1 <== NOT EXECUTED
27f8: e1500002 cmp r0, r2 <== NOT EXECUTED
27fc: 9affffe8 bls 27a4 <scanInt+0x94> <== NOT EXECUTED
return 0;
2800: e3a00000 mov r0, #0 <== NOT EXECUTED
2804: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
continue;
}
sign = 1;
}
if (!isdigit(c))
return 0;
2808: e1a00003 mov r0, r3
280c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
|| ((i == (limit / 10)) && (d > (limit % 10))))
return 0;
i = i * 10 + d;
}
if (sign == 0)
return 0;
2810: e1a00006 mov r0, r6 <== NOT EXECUTED
*val = i * sign;
return 1;
}
2814: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
00002824 <scanString>:
/*
* Extract a string value from the database
*/
static int
scanString(FILE *fp, char **name, char **bufp, size_t *nleft, int nlFlag)
{
2824: e92d41f0 push {r4, r5, r6, r7, r8, lr}
2828: e1a05002 mov r5, r2
int c;
*name = *bufp;
282c: e5922000 ldr r2, [r2]
/*
* Extract a string value from the database
*/
static int
scanString(FILE *fp, char **name, char **bufp, size_t *nleft, int nlFlag)
{
2830: e59d7018 ldr r7, [sp, #24]
int c;
*name = *bufp;
for (;;) {
c = getc(fp);
2834: e59f60d8 ldr r6, [pc, #216] ; 2914 <scanString+0xf0>
static int
scanString(FILE *fp, char **name, char **bufp, size_t *nleft, int nlFlag)
{
int c;
*name = *bufp;
2838: e5812000 str r2, [r1]
/*
* Extract a string value from the database
*/
static int
scanString(FILE *fp, char **name, char **bufp, size_t *nleft, int nlFlag)
{
283c: e1a04000 mov r4, r0
2840: e1a08003 mov r8, r3
2844: ea000013 b 2898 <scanString+0x74>
int c;
*name = *bufp;
for (;;) {
c = getc(fp);
2848: e5943000 ldr r3, [r4]
284c: e4d30001 ldrb r0, [r3], #1
if (c == ':') {
2850: e350003a cmp r0, #58 ; 0x3a
{
int c;
*name = *bufp;
for (;;) {
c = getc(fp);
2854: e5843000 str r3, [r4]
if (c == ':') {
2858: 0a000018 beq 28c0 <scanString+0x9c>
if (nlFlag)
return 0;
break;
}
if (c == '\n') {
285c: e350000a cmp r0, #10
2860: 0a000025 beq 28fc <scanString+0xd8>
if (!nlFlag)
return 0;
break;
}
if (c == EOF)
2864: e3700001 cmn r0, #1
2868: 0a000021 beq 28f4 <scanString+0xd0>
return 0;
if (*nleft < 2)
286c: e5983000 ldr r3, [r8]
2870: e3530001 cmp r3, #1
2874: 9a000024 bls 290c <scanString+0xe8>
return 0;
**bufp = c;
2878: e5953000 ldr r3, [r5]
287c: e5c30000 strb r0, [r3]
++(*bufp);
2880: e5952000 ldr r2, [r5]
--(*nleft);
2884: e5983000 ldr r3, [r8]
if (c == EOF)
return 0;
if (*nleft < 2)
return 0;
**bufp = c;
++(*bufp);
2888: e2822001 add r2, r2, #1
--(*nleft);
288c: e2433001 sub r3, r3, #1
if (c == EOF)
return 0;
if (*nleft < 2)
return 0;
**bufp = c;
++(*bufp);
2890: e5852000 str r2, [r5]
--(*nleft);
2894: e5883000 str r3, [r8]
{
int c;
*name = *bufp;
for (;;) {
c = getc(fp);
2898: e5943004 ldr r3, [r4, #4]
289c: e2433001 sub r3, r3, #1
28a0: e3530000 cmp r3, #0
28a4: e5843004 str r3, [r4, #4]
28a8: aaffffe6 bge 2848 <scanString+0x24>
28ac: e5960000 ldr r0, [r6]
28b0: e1a01004 mov r1, r4
28b4: eb00326f bl f278 <__srget_r>
if (c == ':') {
28b8: e350003a cmp r0, #58 ; 0x3a
28bc: 1affffe6 bne 285c <scanString+0x38>
if (nlFlag)
28c0: e3570000 cmp r7, #0
28c4: 1a00000a bne 28f4 <scanString+0xd0>
return 0;
**bufp = c;
++(*bufp);
--(*nleft);
}
**bufp = '\0';
28c8: e5953000 ldr r3, [r5]
28cc: e3a02000 mov r2, #0
28d0: e5c32000 strb r2, [r3]
++(*bufp);
28d4: e5952000 ldr r2, [r5]
--(*nleft);
28d8: e5983000 ldr r3, [r8]
**bufp = c;
++(*bufp);
--(*nleft);
}
**bufp = '\0';
++(*bufp);
28dc: e2822001 add r2, r2, #1
--(*nleft);
28e0: e2433001 sub r3, r3, #1
**bufp = c;
++(*bufp);
--(*nleft);
}
**bufp = '\0';
++(*bufp);
28e4: e5852000 str r2, [r5]
--(*nleft);
return 1;
28e8: e3a00001 mov r0, #1
++(*bufp);
--(*nleft);
}
**bufp = '\0';
++(*bufp);
--(*nleft);
28ec: e5883000 str r3, [r8]
return 1;
28f0: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
if (!nlFlag)
return 0;
break;
}
if (c == EOF)
return 0;
28f4: e3a00000 mov r0, #0
28f8: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
if (nlFlag)
return 0;
break;
}
if (c == '\n') {
if (!nlFlag)
28fc: e3570000 cmp r7, #0
2900: 1afffff0 bne 28c8 <scanString+0xa4>
return 0;
2904: e1a00007 mov r0, r7
2908: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
break;
}
if (c == EOF)
return 0;
if (*nleft < 2)
return 0;
290c: e3a00000 mov r0, #0 <== NOT EXECUTED
}
**bufp = '\0';
++(*bufp);
--(*nleft);
return 1;
}
2910: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
00002918 <scangr>:
FILE *fp,
struct group *grp,
char *buffer,
size_t bufsize
)
{
2918: e92d41f0 push {r4, r5, r6, r7, r8, lr}
291c: e24dd014 sub sp, sp, #20
int grgid;
char *grmem, *cp;
int memcount;
if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0)
2920: e28d5008 add r5, sp, #8
2924: e28d4004 add r4, sp, #4
FILE *fp,
struct group *grp,
char *buffer,
size_t bufsize
)
{
2928: e58d2008 str r2, [sp, #8]
292c: e58d3004 str r3, [sp, #4]
int grgid;
char *grmem, *cp;
int memcount;
if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0)
2930: e3a06000 mov r6, #0
2934: e1a02005 mov r2, r5
2938: e1a03004 mov r3, r4
FILE *fp,
struct group *grp,
char *buffer,
size_t bufsize
)
{
293c: e1a07000 mov r7, r0
2940: e1a08001 mov r8, r1
int grgid;
char *grmem, *cp;
int memcount;
if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0)
2944: e58d6000 str r6, [sp]
2948: ebffffb5 bl 2824 <scanString>
294c: e3500000 cmp r0, #0
2950: 1a000001 bne 295c <scangr+0x44>
grp->gr_mem[memcount++] = cp + 1;
}
}
grp->gr_mem[memcount] = NULL;
return 1;
}
2954: e28dd014 add sp, sp, #20
2958: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
int grgid;
char *grmem, *cp;
int memcount;
if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0)
|| !scanString(fp, &grp->gr_passwd, &buffer, &bufsize, 0)
295c: e1a00007 mov r0, r7
2960: e2881004 add r1, r8, #4
2964: e1a02005 mov r2, r5
2968: e1a03004 mov r3, r4
296c: e58d6000 str r6, [sp]
2970: ebffffab bl 2824 <scanString>
2974: e3500000 cmp r0, #0
2978: 0afffff5 beq 2954 <scangr+0x3c>
|| !scanInt(fp, &grgid)
297c: e1a00007 mov r0, r7
2980: e28d1010 add r1, sp, #16
2984: ebffff61 bl 2710 <scanInt>
2988: e3500000 cmp r0, #0
298c: 0afffff0 beq 2954 <scangr+0x3c>
|| !scanString(fp, &grmem, &buffer, &bufsize, 1))
2990: e3a06001 mov r6, #1
2994: e1a00007 mov r0, r7
2998: e28d100c add r1, sp, #12
299c: e1a02005 mov r2, r5
29a0: e1a03004 mov r3, r4
29a4: e58d6000 str r6, [sp]
29a8: ebffff9d bl 2824 <scanString>
29ac: e3500000 cmp r0, #0
29b0: 0affffe7 beq 2954 <scangr+0x3c>
return 0;
grp->gr_gid = grgid;
29b4: e1dd31b0 ldrh r3, [sp, #16]
/*
* Determine number of members
*/
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
29b8: e59d100c ldr r1, [sp, #12]
if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0)
|| !scanString(fp, &grp->gr_passwd, &buffer, &bufsize, 0)
|| !scanInt(fp, &grgid)
|| !scanString(fp, &grmem, &buffer, &bufsize, 1))
return 0;
grp->gr_gid = grgid;
29bc: e1c830b8 strh r3, [r8, #8]
/*
* Determine number of members
*/
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
29c0: e5d13000 ldrb r3, [r1]
29c4: e3530000 cmp r3, #0
29c8: 03a06017 moveq r6, #23
29cc: 0a000007 beq 29f0 <scangr+0xd8>
29d0: e1a02001 mov r2, r1
if(*cp == ',')
29d4: e353002c cmp r3, #44 ; 0x2c
grp->gr_gid = grgid;
/*
* Determine number of members
*/
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
29d8: e5f23001 ldrb r3, [r2, #1]!
if(*cp == ',')
memcount++;
29dc: 02866001 addeq r6, r6, #1
grp->gr_gid = grgid;
/*
* Determine number of members
*/
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
29e0: e3530000 cmp r3, #0
29e4: 1afffffa bne 29d4 <scangr+0xbc>
29e8: e1a06106 lsl r6, r6, #2
29ec: e2866013 add r6, r6, #19
}
/*
* Hack to produce (hopefully) a suitably-aligned array of pointers
*/
if (bufsize < (((memcount+1)*sizeof(char *)) + 15))
29f0: e59d3004 ldr r3, [sp, #4]
29f4: e1530006 cmp r3, r6
return 0;
29f8: 33a00000 movcc r0, #0
}
/*
* Hack to produce (hopefully) a suitably-aligned array of pointers
*/
if (bufsize < (((memcount+1)*sizeof(char *)) + 15))
29fc: 3affffd4 bcc 2954 <scangr+0x3c>
return 0;
grp->gr_mem = (char **)(((uintptr_t)buffer + 15) & ~15);
2a00: e59d0008 ldr r0, [sp, #8]
2a04: e280000f add r0, r0, #15
2a08: e3c0000f bic r0, r0, #15
2a0c: e588000c str r0, [r8, #12]
/*
* Fill in pointer array
*/
grp->gr_mem[0] = grmem;
2a10: e5801000 str r1, [r0]
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
2a14: e59d200c ldr r2, [sp, #12]
2a18: e5d23000 ldrb r3, [r2]
2a1c: e3530000 cmp r3, #0
2a20: 0a000010 beq 2a68 <scangr+0x150>
}
/*
* Extract a single group record from the database
*/
static int scangr(
2a24: e2822001 add r2, r2, #1
/*
* Fill in pointer array
*/
grp->gr_mem[0] = grmem;
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
2a28: e3a01001 mov r1, #1
if(*cp == ',') {
*cp = '\0';
2a2c: e3a00000 mov r0, #0
/*
* Fill in pointer array
*/
grp->gr_mem[0] = grmem;
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
if(*cp == ',') {
2a30: e353002c cmp r3, #44 ; 0x2c
*cp = '\0';
2a34: 05420001 strbeq r0, [r2, #-1]
grp->gr_mem[memcount++] = cp + 1;
2a38: 0598300c ldreq r3, [r8, #12]
2a3c: 07832101 streq r2, [r3, r1, lsl #2]
/*
* Fill in pointer array
*/
grp->gr_mem[0] = grmem;
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
2a40: e4d23001 ldrb r3, [r2], #1
if(*cp == ',') {
*cp = '\0';
grp->gr_mem[memcount++] = cp + 1;
2a44: 02811001 addeq r1, r1, #1
/*
* Fill in pointer array
*/
grp->gr_mem[0] = grmem;
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
2a48: e3530000 cmp r3, #0
2a4c: 1afffff7 bne 2a30 <scangr+0x118>
2a50: e598000c ldr r0, [r8, #12]
2a54: e1a01101 lsl r1, r1, #2
if(*cp == ',') {
*cp = '\0';
grp->gr_mem[memcount++] = cp + 1;
}
}
grp->gr_mem[memcount] = NULL;
2a58: e3a03000 mov r3, #0
2a5c: e7803001 str r3, [r0, r1]
return 1;
2a60: e3a00001 mov r0, #1
2a64: eaffffba b 2954 <scangr+0x3c>
/*
* Fill in pointer array
*/
grp->gr_mem[0] = grmem;
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
2a68: e3a01004 mov r1, #4 <== NOT EXECUTED
2a6c: eafffff9 b 2a58 <scangr+0x140> <== NOT EXECUTED
000040f4 <siproc>:
int i;
/*
* Obtain output semaphore if character will be echoed
*/
if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) {
40f4: e591303c ldr r3, [r1, #60] ; 0x3c
40f8: e3c33f61 bic r3, r3, #388 ; 0x184
40fc: e3c33003 bic r3, r3, #3
4100: e1a03a03 lsl r3, r3, #20
4104: e1a03a23 lsr r3, r3, #20
4108: e3530000 cmp r3, #0
/*
* Process input character, with semaphore.
*/
static int
siproc (unsigned char c, struct rtems_termios_tty *tty)
{
410c: e92d4030 push {r4, r5, lr}
4110: e1a04001 mov r4, r1
4114: 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)) {
4118: 1a000001 bne 4124 <siproc+0x30>
}
else {
i = iproc (c, tty);
}
return i;
}
411c: 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);
4120: eaffff7f b 3f24 <iproc> <== NOT EXECUTED
/*
* Obtain output semaphore if character will be echoed
*/
if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) {
rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
4124: e3a01000 mov r1, #0
4128: e1a02001 mov r2, r1
412c: e5940018 ldr r0, [r4, #24]
4130: eb000546 bl 5650 <rtems_semaphore_obtain>
i = iproc (c, tty);
4134: e1a01004 mov r1, r4
4138: e1a00005 mov r0, r5
413c: ebffff78 bl 3f24 <iproc>
4140: e1a05000 mov r5, r0
rtems_semaphore_release (tty->osem);
4144: e5940018 ldr r0, [r4, #24]
4148: eb000589 bl 5774 <rtems_semaphore_release>
}
else {
i = iproc (c, tty);
}
return i;
}
414c: e1a00005 mov r0, r5
4150: e8bd8030 pop {r4, r5, pc}
00005dd0 <unlink>:
#include <rtems/seterr.h>
int unlink(
const char *path
)
{
5dd0: e92d40f0 push {r4, r5, r6, r7, lr}
5dd4: e24dd030 sub sp, sp, #48 ; 0x30
5dd8: e1a07000 mov r7, r0
/*
* Get the node to be unlinked. Find the parent path first.
*/
parentpathlen = rtems_filesystem_dirname ( path );
5ddc: ebfff461 bl 2f68 <rtems_filesystem_dirname>
if ( parentpathlen == 0 )
5de0: e2505000 subs r5, r0, #0
5de4: 1a000039 bne 5ed0 <unlink+0x100>
rtems_filesystem_get_start_loc( path, &i, &parentloc );
5de8: e28d4018 add r4, sp, #24
5dec: e1a00007 mov r0, r7
5df0: e28d102c add r1, sp, #44 ; 0x2c
5df4: e1a02004 mov r2, r4
5df8: ebfff869 bl 3fa4 <rtems_filesystem_get_start_loc>
const char *name;
rtems_filesystem_location_info_t parentloc;
rtems_filesystem_location_info_t loc;
int i;
int result;
bool free_parentloc = false;
5dfc: e1a06005 mov r6, r5
/*
* Start from the parent to find the node that should be under it.
*/
loc = parentloc;
5e00: e1a0e004 mov lr, r4
5e04: e8be000f ldm lr!, {r0, r1, r2, r3}
5e08: e28dc004 add ip, sp, #4
5e0c: e8ac000f stmia ip!, {r0, r1, r2, r3}
name = path + parentpathlen;
5e10: e0875005 add r5, r7, r5
/*
* Start from the parent to find the node that should be under it.
*/
loc = parentloc;
5e14: e59e3000 ldr r3, [lr]
name = path + parentpathlen;
name += rtems_filesystem_prefix_separators( name, strlen( name ) );
5e18: e1a00005 mov r0, r5
/*
* Start from the parent to find the node that should be under it.
*/
loc = parentloc;
5e1c: e58c3000 str r3, [ip]
name = path + parentpathlen;
name += rtems_filesystem_prefix_separators( name, strlen( name ) );
5e20: eb002f9e bl 11ca0 <strlen>
5e24: e1a01000 mov r1, r0
5e28: e1a00005 mov r0, r5
5e2c: ebfff45c bl 2fa4 <rtems_filesystem_prefix_separators>
5e30: e0857000 add r7, r5, r0
result = rtems_filesystem_evaluate_relative_path( name , strlen( name ),
5e34: e1a00007 mov r0, r7
5e38: eb002f98 bl 11ca0 <strlen>
5e3c: e28d5004 add r5, sp, #4
5e40: e1a01000 mov r1, r0
5e44: e3a02000 mov r2, #0
5e48: e1a00007 mov r0, r7
5e4c: e1a03005 mov r3, r5
5e50: e58d2000 str r2, [sp]
5e54: ebfff3f7 bl 2e38 <rtems_filesystem_evaluate_relative_path>
0, &loc, false );
if ( result != 0 ) {
5e58: e3500000 cmp r0, #0
5e5c: 1a000013 bne 5eb0 <unlink+0xe0>
if ( free_parentloc )
rtems_filesystem_freenode( &parentloc );
return -1;
}
if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) {
5e60: e1a00005 mov r0, r5
5e64: e59d3010 ldr r3, [sp, #16]
5e68: e1a0e00f mov lr, pc
5e6c: e593f010 ldr pc, [r3, #16]
5e70: e3500001 cmp r0, #1
5e74: 0a000021 beq 5f00 <unlink+0x130>
if ( free_parentloc )
rtems_filesystem_freenode( &parentloc );
rtems_set_errno_and_return_minus_one( EISDIR );
}
result = (*loc.ops->unlink_h)( &parentloc, &loc );
5e78: e1a01005 mov r1, r5
5e7c: e59d3010 ldr r3, [sp, #16]
5e80: e1a00004 mov r0, r4
5e84: e1a0e00f mov lr, pc
5e88: e593f00c ldr pc, [r3, #12]
5e8c: e1a07000 mov r7, r0
rtems_filesystem_freenode( &loc );
5e90: e1a00005 mov r0, r5
5e94: ebfff45c bl 300c <rtems_filesystem_freenode>
if ( free_parentloc )
5e98: e3560000 cmp r6, #0
rtems_filesystem_freenode( &parentloc );
5e9c: 11a00004 movne r0, r4
5ea0: 1bfff459 blne 300c <rtems_filesystem_freenode>
return result;
}
5ea4: e1a00007 mov r0, r7
5ea8: e28dd030 add sp, sp, #48 ; 0x30
5eac: e8bd80f0 pop {r4, r5, r6, r7, pc}
name += rtems_filesystem_prefix_separators( name, strlen( name ) );
result = rtems_filesystem_evaluate_relative_path( name , strlen( name ),
0, &loc, false );
if ( result != 0 ) {
if ( free_parentloc )
5eb0: e3560000 cmp r6, #0
5eb4: 1a000001 bne 5ec0 <unlink+0xf0>
rtems_filesystem_freenode( &parentloc );
return -1;
5eb8: e3e07000 mvn r7, #0 <== NOT EXECUTED
5ebc: eafffff8 b 5ea4 <unlink+0xd4> <== NOT EXECUTED
result = rtems_filesystem_evaluate_relative_path( name , strlen( name ),
0, &loc, false );
if ( result != 0 ) {
if ( free_parentloc )
rtems_filesystem_freenode( &parentloc );
5ec0: e1a00004 mov r0, r4
5ec4: ebfff450 bl 300c <rtems_filesystem_freenode>
return -1;
5ec8: e3e07000 mvn r7, #0
5ecc: eafffff4 b 5ea4 <unlink+0xd4>
parentpathlen = rtems_filesystem_dirname ( path );
if ( parentpathlen == 0 )
rtems_filesystem_get_start_loc( path, &i, &parentloc );
else {
result = rtems_filesystem_evaluate_path( path, parentpathlen,
5ed0: e3a03000 mov r3, #0
5ed4: e28d4018 add r4, sp, #24
5ed8: e58d3000 str r3, [sp]
5edc: e3a02002 mov r2, #2
5ee0: e1a00007 mov r0, r7
5ee4: e1a01005 mov r1, r5
5ee8: e1a03004 mov r3, r4
5eec: ebfff3fb bl 2ee0 <rtems_filesystem_evaluate_path>
RTEMS_LIBIO_PERMS_WRITE,
&parentloc,
false );
if ( result != 0 )
5ef0: e3500000 cmp r0, #0
5ef4: 1affffef bne 5eb8 <unlink+0xe8>
return -1;
free_parentloc = true;
5ef8: e3a06001 mov r6, #1
5efc: eaffffbf b 5e00 <unlink+0x30>
rtems_filesystem_freenode( &parentloc );
return -1;
}
if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) {
rtems_filesystem_freenode( &loc );
5f00: e1a00005 mov r0, r5
5f04: ebfff440 bl 300c <rtems_filesystem_freenode>
if ( free_parentloc )
5f08: e3560000 cmp r6, #0
rtems_filesystem_freenode( &parentloc );
5f0c: 11a00004 movne r0, r4
5f10: 1bfff43d blne 300c <rtems_filesystem_freenode>
rtems_set_errno_and_return_minus_one( EISDIR );
5f14: eb002b9c bl 10d8c <__errno>
5f18: e3a03015 mov r3, #21
5f1c: e5803000 str r3, [r0]
5f20: e3e07000 mvn r7, #0
5f24: eaffffde b 5ea4 <unlink+0xd4>
00005f98 <unmount>:
*/
int unmount(
const char *path
)
{
5f98: e92d4070 push {r4, r5, r6, lr}
5f9c: e24dd018 sub sp, sp, #24
5fa0: 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 ) )
5fa4: eb00244a bl f0d4 <strlen>
5fa8: e28d4004 add r4, sp, #4
5fac: e1a01000 mov r1, r0
5fb0: e3a0c001 mov ip, #1
5fb4: e1a00005 mov r0, r5
5fb8: e3a02000 mov r2, #0
5fbc: e1a03004 mov r3, r4
5fc0: e58dc000 str ip, [sp]
5fc4: ebfff334 bl 2c9c <rtems_filesystem_evaluate_path>
5fc8: e3500000 cmp r0, #0
5fcc: 1a00001a bne 603c <unmount+0xa4>
return -1;
mt_entry = loc.mt_entry;
5fd0: 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 ){
5fd4: e59d3004 ldr r3, [sp, #4]
5fd8: e595201c ldr r2, [r5, #28]
5fdc: e1520003 cmp r2, r3
5fe0: 1a00002d bne 609c <unmount+0x104>
/*
* Free the loc node and just use the nodes from the mt_entry .
*/
rtems_filesystem_freenode( &loc );
5fe4: e1a00004 mov r0, r4
5fe8: ebfff376 bl 2dc8 <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 )
5fec: e59f30f8 ldr r3, [pc, #248] ; 60ec <unmount+0x154>
5ff0: e5933000 ldr r3, [r3]
5ff4: e5933014 ldr r3, [r3, #20]
5ff8: e1530005 cmp r3, r5
5ffc: 0a00002d beq 60b8 <unmount+0x120>
/*
* Verify there are no file systems below the path specified
*/
if ( rtems_filesystem_mount_iterate( is_fs_below_mount_point,
6000: e59f00e8 ldr r0, [pc, #232] ; 60f0 <unmount+0x158>
6004: e595102c ldr r1, [r5, #44] ; 0x2c
6008: ebfff5c2 bl 3718 <rtems_filesystem_mount_iterate>
600c: e3500000 cmp r0, #0
6010: 1a000028 bne 60b8 <unmount+0x120>
* 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 )
6014: e1a00005 mov r0, r5
6018: ebfff464 bl 31b0 <rtems_libio_is_open_files_in_fs>
601c: e3500001 cmp r0, #1
6020: 0a000024 beq 60b8 <unmount+0x120>
* 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 )
6024: e5953014 ldr r3, [r5, #20]
6028: e1a00005 mov r0, r5
602c: e1a0e00f mov lr, pc
6030: e593f028 ldr pc, [r3, #40] ; 0x28
6034: e2506000 subs r6, r0, #0
6038: 0a000002 beq 6048 <unmount+0xb0>
*/
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;
603c: e3e00000 mvn r0, #0
rtems_filesystem_freenode( fs_mount_loc );
free( mt_entry );
return 0;
}
6040: e28dd018 add sp, sp, #24
6044: e8bd8070 pop {r4, r5, r6, pc}
* 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){
6048: e5953028 ldr r3, [r5, #40] ; 0x28
604c: e1a00005 mov r0, r5
6050: e1a0e00f mov lr, pc
6054: e593f02c ldr pc, [r3, #44] ; 0x2c
6058: e2504000 subs r4, r0, #0
605c: 1a00001a bne 60cc <unmount+0x134>
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 );
6060: e59f608c ldr r6, [pc, #140] ; 60f4 <unmount+0x15c>
6064: e1a01004 mov r1, r4
6068: e1a02004 mov r2, r4
606c: e5960000 ldr r0, [r6]
6070: eb000289 bl 6a9c <rtems_semaphore_obtain>
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
6074: e1a00005 mov r0, r5
6078: eb0004d7 bl 73dc <_Chain_Extract>
}
static inline void rtems_libio_unlock( void )
{
rtems_semaphore_release( rtems_libio_semaphore );
607c: e5960000 ldr r0, [r6]
6080: eb0002ce bl 6bc0 <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 );
6084: e2850008 add r0, r5, #8
6088: ebfff34e bl 2dc8 <rtems_filesystem_freenode>
free( mt_entry );
608c: e1a00005 mov r0, r5
6090: ebfff351 bl 2ddc <free>
return 0;
6094: e1a00004 mov r0, r4
6098: eaffffe8 b 6040 <unmount+0xa8>
/*
* Verify this is the root node for the file system to be unmounted.
*/
if ( fs_root_loc->node_access != loc.node_access ){
rtems_filesystem_freenode( &loc );
609c: e1a00004 mov r0, r4
60a0: ebfff348 bl 2dc8 <rtems_filesystem_freenode>
rtems_set_errno_and_return_minus_one( EACCES );
60a4: eb001e8e bl dae4 <__errno>
60a8: e3a0300d mov r3, #13
60ac: e5803000 str r3, [r0]
60b0: e3e00000 mvn r0, #0
60b4: eaffffe1 b 6040 <unmount+0xa8>
* 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 )
rtems_set_errno_and_return_minus_one( EBUSY );
60b8: eb001e89 bl dae4 <__errno>
60bc: e3a03010 mov r3, #16
60c0: e5803000 str r3, [r0]
60c4: e3e00000 mvn r0, #0
60c8: eaffffdc b 6040 <unmount+0xa8>
* This was response was questionable but the best we could
* come up with.
*/
if ((fs_root_loc->ops->fsunmount_me_h )( mt_entry ) != 0){
if (( fs_mount_loc->ops->mount_h )( mt_entry ) != 0 )
60cc: e5953014 ldr r3, [r5, #20] <== NOT EXECUTED
60d0: e1a00005 mov r0, r5 <== NOT EXECUTED
60d4: e1a0e00f mov lr, pc <== NOT EXECUTED
60d8: e593f020 ldr pc, [r3, #32] <== NOT EXECUTED
60dc: e3500000 cmp r0, #0 <== NOT EXECUTED
60e0: 0affffd5 beq 603c <unmount+0xa4> <== NOT EXECUTED
rtems_fatal_error_occurred( 0 );
60e4: e1a00006 mov r0, r6 <== NOT EXECUTED
60e8: eb0003f7 bl 70cc <rtems_fatal_error_occurred> <== NOT EXECUTED
00005fc8 <utime>:
int utime(
const char *path,
const struct utimbuf *times
)
{
5fc8: e92d4070 push {r4, r5, r6, lr}
5fcc: e24dd018 sub sp, sp, #24
5fd0: e1a05001 mov r5, r1
5fd4: e1a06000 mov r6, r0
rtems_filesystem_location_info_t temp_loc;
int result;
struct utimbuf now;
if ( rtems_filesystem_evaluate_path( path, strlen( path ), 0x00, &temp_loc, true ) )
5fd8: eb002642 bl f8e8 <strlen>
5fdc: e28d4004 add r4, sp, #4
5fe0: e3a03001 mov r3, #1
5fe4: e1a01000 mov r1, r0
5fe8: e58d3000 str r3, [sp]
5fec: e3a02000 mov r2, #0
5ff0: e1a00006 mov r0, r6
5ff4: e1a03004 mov r3, r4
5ff8: ebfff1f0 bl 27c0 <rtems_filesystem_evaluate_path>
5ffc: e3500000 cmp r0, #0
return -1;
6000: 13e05000 mvnne r5, #0
{
rtems_filesystem_location_info_t temp_loc;
int result;
struct utimbuf now;
if ( rtems_filesystem_evaluate_path( path, strlen( path ), 0x00, &temp_loc, true ) )
6004: 1a000009 bne 6030 <utime+0x68>
return -1;
if ( times == NULL ) {
6008: e3550000 cmp r5, #0
600c: 0a00000a beq 603c <utime+0x74>
6010: e8950006 ldm r5, {r1, r2}
now.actime = now.modtime = time( NULL );
times = &now;
}
result = (*temp_loc.ops->utime_h)( &temp_loc, times->actime, times->modtime );
6014: e1a00004 mov r0, r4
6018: e59d3010 ldr r3, [sp, #16]
601c: e1a0e00f mov lr, pc
6020: e593f030 ldr pc, [r3, #48] ; 0x30
6024: e1a05000 mov r5, r0
rtems_filesystem_freenode( &temp_loc );
6028: e1a00004 mov r0, r4
602c: ebfff311 bl 2c78 <rtems_filesystem_freenode>
return result;
}
6030: e1a00005 mov r0, r5
6034: e28dd018 add sp, sp, #24
6038: e8bd8070 pop {r4, r5, r6, pc}
if ( rtems_filesystem_evaluate_path( path, strlen( path ), 0x00, &temp_loc, true ) )
return -1;
if ( times == NULL ) {
now.actime = now.modtime = time( NULL );
603c: eb00267c bl fa34 <time> <== NOT EXECUTED
6040: e1a01000 mov r1, r0 <== NOT EXECUTED
6044: e1a02000 mov r2, r0 <== NOT EXECUTED
6048: eafffff1 b 6014 <utime+0x4c> <== NOT EXECUTED
00004c3c <vprintk>:
*/
void vprintk(
const char *fmt,
va_list ap
)
{
4c3c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
4c40: e1a0a000 mov sl, r0
for (; *fmt != '\0'; fmt++) {
4c44: e5d00000 ldrb r0, [r0]
*/
void vprintk(
const char *fmt,
va_list ap
)
{
4c48: e24dd01c sub sp, sp, #28
for (; *fmt != '\0'; fmt++) {
4c4c: e3500000 cmp r0, #0
*/
void vprintk(
const char *fmt,
va_list ap
)
{
4c50: e58d1000 str r1, [sp]
for (; *fmt != '\0'; fmt++) {
4c54: 0a00006e beq 4e14 <vprintk+0x1d8>
bool sign = false;
char lead = ' ';
char c;
if (*fmt != '%') {
BSP_output_char(*fmt);
4c58: e59f8334 ldr r8, [pc, #820] ; 4f94 <vprintk+0x358>
* console is not yet initialized or in ISR's.
*
* Arguments:
* as in printf: fmt - format string, ... - unnamed arguments.
*/
void vprintk(
4c5c: e28db008 add fp, sp, #8
bool minus = false;
bool sign = false;
char lead = ' ';
char c;
if (*fmt != '%') {
4c60: e3500025 cmp r0, #37 ; 0x25
4c64: 1a00006c bne 4e1c <vprintk+0x1e0>
BSP_output_char(*fmt);
continue;
}
fmt++;
if (*fmt == '0' ) {
4c68: e5fa0001 ldrb r0, [sl, #1]!
4c6c: e3500030 cmp r0, #48 ; 0x30
lead = '0';
fmt++;
4c70: 05fa0001 ldrbeq r0, [sl, #1]!
unsigned base = 0;
unsigned width = 0;
bool lflag = false;
bool minus = false;
bool sign = false;
char lead = ' ';
4c74: 13a03020 movne r3, #32
BSP_output_char(*fmt);
continue;
}
fmt++;
if (*fmt == '0' ) {
lead = '0';
4c78: 03a02030 moveq r2, #48 ; 0x30
unsigned base = 0;
unsigned width = 0;
bool lflag = false;
bool minus = false;
bool sign = false;
char lead = ' ';
4c7c: 158d3004 strne r3, [sp, #4]
BSP_output_char(*fmt);
continue;
}
fmt++;
if (*fmt == '0' ) {
lead = '0';
4c80: 058d2004 streq r2, [sp, #4]
fmt++;
}
if (*fmt == '-' ) {
4c84: e350002d cmp r0, #45 ; 0x2d
minus = true;
fmt++;
4c88: 05fa0001 ldrbeq r0, [sl, #1]!
}
while (*fmt >= '0' && *fmt <= '9' ) {
4c8c: e2403030 sub r3, r0, #48 ; 0x30
if (*fmt == '0' ) {
lead = '0';
fmt++;
}
if (*fmt == '-' ) {
minus = true;
4c90: 03a09001 moveq r9, #1
{
for (; *fmt != '\0'; fmt++) {
unsigned base = 0;
unsigned width = 0;
bool lflag = false;
bool minus = false;
4c94: 13a09000 movne r9, #0
}
if (*fmt == '-' ) {
minus = true;
fmt++;
}
while (*fmt >= '0' && *fmt <= '9' ) {
4c98: e3530009 cmp r3, #9
4c9c: 83a04000 movhi r4, #0
4ca0: 8a000009 bhi 4ccc <vprintk+0x90>
* console is not yet initialized or in ISR's.
*
* Arguments:
* as in printf: fmt - format string, ... - unnamed arguments.
*/
void vprintk(
4ca4: e28a3001 add r3, sl, #1
4ca8: e3a04000 mov r4, #0
if (*fmt == '-' ) {
minus = true;
fmt++;
}
while (*fmt >= '0' && *fmt <= '9' ) {
width *= 10;
4cac: e0844104 add r4, r4, r4, lsl #2
width += ((unsigned) *fmt - '0');
4cb0: e0804084 add r4, r0, r4, lsl #1
4cb4: e1a0a003 mov sl, r3
}
if (*fmt == '-' ) {
minus = true;
fmt++;
}
while (*fmt >= '0' && *fmt <= '9' ) {
4cb8: e4d30001 ldrb r0, [r3], #1
4cbc: e2402030 sub r2, r0, #48 ; 0x30
4cc0: e3520009 cmp r2, #9
width *= 10;
width += ((unsigned) *fmt - '0');
4cc4: e2444030 sub r4, r4, #48 ; 0x30
}
if (*fmt == '-' ) {
minus = true;
fmt++;
}
while (*fmt >= '0' && *fmt <= '9' ) {
4cc8: 9afffff7 bls 4cac <vprintk+0x70>
width *= 10;
width += ((unsigned) *fmt - '0');
fmt++;
}
if ((c = *fmt) == 'l') {
4ccc: e350006c cmp r0, #108 ; 0x6c
lflag = true;
c = *++fmt;
4cd0: 05fa0001 ldrbeq r0, [sl, #1]!
}
if ( c == 'c' ) {
4cd4: e3500063 cmp r0, #99 ; 0x63
4cd8: 0a00008b beq 4f0c <vprintk+0x2d0>
/* need a cast here since va_arg() only takes fully promoted types */
char chr = (char) va_arg(ap, int);
BSP_output_char(chr);
continue;
}
if ( c == 's' ) {
4cdc: e3500073 cmp r0, #115 ; 0x73
4ce0: 0a000053 beq 4e34 <vprintk+0x1f8>
continue;
}
/* must be a numeric format or something unsupported */
if ( c == 'o' || c == 'O' ) {
4ce4: e350006f cmp r0, #111 ; 0x6f
4ce8: 1350004f cmpne r0, #79 ; 0x4f
base = 8; sign = false;
4cec: 03a02000 moveq r2, #0
4cf0: 03a09008 moveq r9, #8
continue;
}
/* must be a numeric format or something unsupported */
if ( c == 'o' || c == 'O' ) {
4cf4: 0a000009 beq 4d20 <vprintk+0xe4>
base = 8; sign = false;
} else if ( c == 'i' || c == 'I' ||
4cf8: e3500069 cmp r0, #105 ; 0x69
4cfc: 13500049 cmpne r0, #73 ; 0x49
4d00: 0a000004 beq 4d18 <vprintk+0xdc>
c == 'd' || c == 'D' ) {
4d04: e3500064 cmp r0, #100 ; 0x64
4d08: 13500044 cmpne r0, #68 ; 0x44
4d0c: 13a02000 movne r2, #0
4d10: 03a02001 moveq r2, #1
4d14: 1a000086 bne 4f34 <vprintk+0x2f8>
base = 10; sign = true;
4d18: e3a02001 mov r2, #1
4d1c: e3a0900a mov r9, #10
} else {
BSP_output_char(c);
continue;
}
printNum(
4d20: e59d3000 ldr r3, [sp]
unsigned long unsigned_num;
unsigned long n;
unsigned count;
char toPrint[20];
if ( sign && (num < 0) ) {
4d24: e3520000 cmp r2, #0
} else {
BSP_output_char(c);
continue;
}
printNum(
4d28: e5937000 ldr r7, [r3]
lflag ? va_arg(ap, long) : (long) va_arg(ap, int),
4d2c: e2833004 add r3, r3, #4
4d30: e58d3000 str r3, [sp]
unsigned long unsigned_num;
unsigned long n;
unsigned count;
char toPrint[20];
if ( sign && (num < 0) ) {
4d34: 0a000001 beq 4d40 <vprintk+0x104>
4d38: e3570000 cmp r7, #0
4d3c: ba00008d blt 4f78 <vprintk+0x33c>
} else {
unsigned_num = (unsigned long) num;
}
count = 0;
while ((n = unsigned_num / base) > 0) {
4d40: e1a00007 mov r0, r7
4d44: e1a01009 mov r1, r9
4d48: eb002d6e bl 10308 <__aeabi_uidiv>
4d4c: e3500000 cmp r0, #0
4d50: e1a05000 mov r5, r0
4d54: e1a06000 mov r6, r0
4d58: 01a05007 moveq r5, r7
4d5c: 03a07001 moveq r7, #1
4d60: 0a000010 beq 4da8 <vprintk+0x16c>
4d64: e20930ff and r3, r9, #255 ; 0xff
4d68: e1a02007 mov r2, r7
if (maxwidth) maxwidth--;
} else {
unsigned_num = (unsigned long) num;
}
count = 0;
4d6c: e3a06000 mov r6, #0
4d70: e1a07003 mov r7, r3
4d74: ea000001 b 4d80 <vprintk+0x144>
while ((n = unsigned_num / base) > 0) {
4d78: e1a02005 mov r2, r5
4d7c: e1a05000 mov r5, r0
toPrint[count++] = (char) (unsigned_num - (n * base));
4d80: e0030795 mul r3, r5, r7
4d84: e0633002 rsb r3, r3, r2
4d88: e7cb3006 strb r3, [fp, r6]
} else {
unsigned_num = (unsigned long) num;
}
count = 0;
while ((n = unsigned_num / base) > 0) {
4d8c: e1a00005 mov r0, r5
4d90: e1a01009 mov r1, r9
4d94: eb002d5b bl 10308 <__aeabi_uidiv>
4d98: e3500000 cmp r0, #0
toPrint[count++] = (char) (unsigned_num - (n * base));
4d9c: e2866001 add r6, r6, #1
} else {
unsigned_num = (unsigned long) num;
}
count = 0;
while ((n = unsigned_num / base) > 0) {
4da0: 1afffff4 bne 4d78 <vprintk+0x13c>
4da4: e2867001 add r7, r6, #1
toPrint[count++] = (char) (unsigned_num - (n * base));
unsigned_num = n;
}
toPrint[count++] = (char) unsigned_num;
4da8: e28d201c add r2, sp, #28
4dac: e0826006 add r6, r2, r6
for (n=maxwidth ; n > count; n-- )
4db0: e1570004 cmp r7, r4
count = 0;
while ((n = unsigned_num / base) > 0) {
toPrint[count++] = (char) (unsigned_num - (n * base));
unsigned_num = n;
}
toPrint[count++] = (char) unsigned_num;
4db4: e5465014 strb r5, [r6, #-20]
for (n=maxwidth ; n > count; n-- )
4db8: 2a000006 bcs 4dd8 <vprintk+0x19c>
4dbc: e59d5004 ldr r5, [sp, #4]
BSP_output_char(lead);
4dc0: e1a00005 mov r0, r5
toPrint[count++] = (char) (unsigned_num - (n * base));
unsigned_num = n;
}
toPrint[count++] = (char) unsigned_num;
for (n=maxwidth ; n > count; n-- )
4dc4: e2444001 sub r4, r4, #1
BSP_output_char(lead);
4dc8: e1a0e00f mov lr, pc
4dcc: e598f000 ldr pc, [r8]
toPrint[count++] = (char) (unsigned_num - (n * base));
unsigned_num = n;
}
toPrint[count++] = (char) unsigned_num;
for (n=maxwidth ; n > count; n-- )
4dd0: e1570004 cmp r7, r4
4dd4: 3afffff9 bcc 4dc0 <vprintk+0x184>
BSP_output_char(lead);
for (n = 0; n < count; n++) {
4dd8: e3570000 cmp r7, #0
4ddc: 0a000009 beq 4e08 <vprintk+0x1cc>
* console is not yet initialized or in ISR's.
*
* Arguments:
* as in printf: fmt - format string, ... - unnamed arguments.
*/
void vprintk(
4de0: e08b5007 add r5, fp, r7
4de4: e3a04000 mov r4, #0
for (n=maxwidth ; n > count; n-- )
BSP_output_char(lead);
for (n = 0; n < count; n++) {
BSP_output_char("0123456789ABCDEF"[(int)(toPrint[count-(n+1)])]);
4de8: e5753001 ldrb r3, [r5, #-1]!
4dec: e59f21a4 ldr r2, [pc, #420] ; 4f98 <vprintk+0x35c>
toPrint[count++] = (char) unsigned_num;
for (n=maxwidth ; n > count; n-- )
BSP_output_char(lead);
for (n = 0; n < count; n++) {
4df0: e2844001 add r4, r4, #1
BSP_output_char("0123456789ABCDEF"[(int)(toPrint[count-(n+1)])]);
4df4: e7d20003 ldrb r0, [r2, r3]
4df8: e1a0e00f mov lr, pc
4dfc: e598f000 ldr pc, [r8]
toPrint[count++] = (char) unsigned_num;
for (n=maxwidth ; n > count; n-- )
BSP_output_char(lead);
for (n = 0; n < count; n++) {
4e00: e1570004 cmp r7, r4
4e04: 8afffff7 bhi 4de8 <vprintk+0x1ac>
void vprintk(
const char *fmt,
va_list ap
)
{
for (; *fmt != '\0'; fmt++) {
4e08: e5fa0001 ldrb r0, [sl, #1]!
4e0c: e3500000 cmp r0, #0
4e10: 1affff92 bne 4c60 <vprintk+0x24>
sign,
width,
lead
);
}
}
4e14: e28dd01c add sp, sp, #28
4e18: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
} else if ( c == 'x' || c == 'X' ) {
base = 16; sign = false;
} else if ( c == 'p' ) {
base = 16; sign = false; lflag = true;
} else {
BSP_output_char(c);
4e1c: e1a0e00f mov lr, pc
4e20: e598f000 ldr pc, [r8]
void vprintk(
const char *fmt,
va_list ap
)
{
for (; *fmt != '\0'; fmt++) {
4e24: e5fa0001 ldrb r0, [sl, #1]!
4e28: e3500000 cmp r0, #0
4e2c: 1affff8b bne 4c60 <vprintk+0x24>
4e30: eafffff7 b 4e14 <vprintk+0x1d8>
}
if ( c == 's' ) {
unsigned i, len;
char *s, *str;
str = va_arg(ap, char *);
4e34: e59d3000 ldr r3, [sp]
4e38: e5936000 ldr r6, [r3]
if ( str == NULL ) {
str = "";
4e3c: e59f2158 ldr r2, [pc, #344] ; 4f9c <vprintk+0x360>
4e40: e3560000 cmp r6, #0
4e44: 01a06002 moveq r6, r2
}
/* calculate length of string */
for ( len=0, s=str ; *s ; len++, s++ )
4e48: e5d65000 ldrb r5, [r6]
}
if ( c == 's' ) {
unsigned i, len;
char *s, *str;
str = va_arg(ap, char *);
4e4c: e2833004 add r3, r3, #4
if ( str == NULL ) {
str = "";
}
/* calculate length of string */
for ( len=0, s=str ; *s ; len++, s++ )
4e50: e3550000 cmp r5, #0
}
if ( c == 's' ) {
unsigned i, len;
char *s, *str;
str = va_arg(ap, char *);
4e54: e58d3000 str r3, [sp]
if ( str == NULL ) {
str = "";
}
/* calculate length of string */
for ( len=0, s=str ; *s ; len++, s++ )
4e58: 0a000005 beq 4e74 <vprintk+0x238>
4e5c: e1a03006 mov r3, r6
4e60: e3a05000 mov r5, #0
4e64: e5f32001 ldrb r2, [r3, #1]!
4e68: e3520000 cmp r2, #0
4e6c: e2855001 add r5, r5, #1
4e70: 1afffffb bne 4e64 <vprintk+0x228>
;
/* leading spaces */
if ( !minus )
4e74: e3590000 cmp r9, #0
4e78: 1a000008 bne 4ea0 <vprintk+0x264>
for ( i=len ; i<width ; i++ )
4e7c: e1550004 cmp r5, r4
4e80: 2a000006 bcs 4ea0 <vprintk+0x264>
4e84: e1a07005 mov r7, r5
BSP_output_char(' ');
4e88: e3a00020 mov r0, #32
for ( len=0, s=str ; *s ; len++, s++ )
;
/* leading spaces */
if ( !minus )
for ( i=len ; i<width ; i++ )
4e8c: e2877001 add r7, r7, #1
BSP_output_char(' ');
4e90: e1a0e00f mov lr, pc
4e94: e598f000 ldr pc, [r8]
for ( len=0, s=str ; *s ; len++, s++ )
;
/* leading spaces */
if ( !minus )
for ( i=len ; i<width ; i++ )
4e98: e1570004 cmp r7, r4
4e9c: 3afffff9 bcc 4e88 <vprintk+0x24c>
BSP_output_char(' ');
/* no width option */
if (width == 0) {
4ea0: e3540000 cmp r4, #0
4ea4: 1a000002 bne 4eb4 <vprintk+0x278>
width = len;
}
/* output the string */
for ( i=0 ; i<width && *str ; str++ )
4ea8: e3550000 cmp r5, #0
4eac: 0a000008 beq 4ed4 <vprintk+0x298>
4eb0: e1a04005 mov r4, r5
4eb4: e5d60000 ldrb r0, [r6]
4eb8: e3500000 cmp r0, #0
4ebc: 0a000004 beq 4ed4 <vprintk+0x298>
BSP_output_char(*str);
4ec0: e1a0e00f mov lr, pc
4ec4: e598f000 ldr pc, [r8]
if (width == 0) {
width = len;
}
/* output the string */
for ( i=0 ; i<width && *str ; str++ )
4ec8: e5f60001 ldrb r0, [r6, #1]!
4ecc: e3500000 cmp r0, #0
4ed0: 1afffffa bne 4ec0 <vprintk+0x284>
BSP_output_char(*str);
/* trailing spaces */
if ( minus )
4ed4: e3590000 cmp r9, #0
4ed8: 0affffca beq 4e08 <vprintk+0x1cc>
for ( i=len ; i<width ; i++ )
4edc: e1550004 cmp r5, r4
4ee0: 2affffc8 bcs 4e08 <vprintk+0x1cc>
BSP_output_char(' ');
4ee4: e3a00020 mov r0, #32
for ( i=0 ; i<width && *str ; str++ )
BSP_output_char(*str);
/* trailing spaces */
if ( minus )
for ( i=len ; i<width ; i++ )
4ee8: e2855001 add r5, r5, #1
BSP_output_char(' ');
4eec: e1a0e00f mov lr, pc
4ef0: e598f000 ldr pc, [r8]
for ( i=0 ; i<width && *str ; str++ )
BSP_output_char(*str);
/* trailing spaces */
if ( minus )
for ( i=len ; i<width ; i++ )
4ef4: e1550004 cmp r5, r4
4ef8: 3afffff9 bcc 4ee4 <vprintk+0x2a8>
void vprintk(
const char *fmt,
va_list ap
)
{
for (; *fmt != '\0'; fmt++) {
4efc: e5fa0001 ldrb r0, [sl, #1]!
4f00: e3500000 cmp r0, #0
4f04: 1affff55 bne 4c60 <vprintk+0x24>
4f08: eaffffc1 b 4e14 <vprintk+0x1d8> <== NOT EXECUTED
lflag = true;
c = *++fmt;
}
if ( c == 'c' ) {
/* need a cast here since va_arg() only takes fully promoted types */
char chr = (char) va_arg(ap, int);
4f0c: e59d2000 ldr r2, [sp]
4f10: e2824004 add r4, r2, #4
BSP_output_char(chr);
4f14: e5d20000 ldrb r0, [r2]
4f18: e1a0e00f mov lr, pc
4f1c: e598f000 ldr pc, [r8]
lflag = true;
c = *++fmt;
}
if ( c == 'c' ) {
/* need a cast here since va_arg() only takes fully promoted types */
char chr = (char) va_arg(ap, int);
4f20: e58d4000 str r4, [sp]
void vprintk(
const char *fmt,
va_list ap
)
{
for (; *fmt != '\0'; fmt++) {
4f24: e5fa0001 ldrb r0, [sl, #1]!
4f28: e3500000 cmp r0, #0
4f2c: 1affff4b bne 4c60 <vprintk+0x24>
4f30: eaffffb7 b 4e14 <vprintk+0x1d8> <== NOT EXECUTED
if ( c == 'o' || c == 'O' ) {
base = 8; sign = false;
} else if ( c == 'i' || c == 'I' ||
c == 'd' || c == 'D' ) {
base = 10; sign = true;
} else if ( c == 'u' || c == 'U' ) {
4f34: e3500075 cmp r0, #117 ; 0x75
4f38: 13500055 cmpne r0, #85 ; 0x55
4f3c: 13a01000 movne r1, #0
4f40: 03a01001 moveq r1, #1
base = 10; sign = false;
4f44: 03a0900a moveq r9, #10
if ( c == 'o' || c == 'O' ) {
base = 8; sign = false;
} else if ( c == 'i' || c == 'I' ||
c == 'd' || c == 'D' ) {
base = 10; sign = true;
} else if ( c == 'u' || c == 'U' ) {
4f48: 0affff74 beq 4d20 <vprintk+0xe4>
base = 10; sign = false;
} else if ( c == 'x' || c == 'X' ) {
4f4c: e3500078 cmp r0, #120 ; 0x78
4f50: 13500058 cmpne r0, #88 ; 0x58
4f54: 13a02000 movne r2, #0
4f58: 03a02001 moveq r2, #1
base = 16; sign = false;
4f5c: 03a09010 moveq r9, #16
4f60: 01a02001 moveq r2, r1
} else if ( c == 'i' || c == 'I' ||
c == 'd' || c == 'D' ) {
base = 10; sign = true;
} else if ( c == 'u' || c == 'U' ) {
base = 10; sign = false;
} else if ( c == 'x' || c == 'X' ) {
4f64: 0affff6d beq 4d20 <vprintk+0xe4>
base = 16; sign = false;
} else if ( c == 'p' ) {
4f68: e3500070 cmp r0, #112 ; 0x70
4f6c: 1affffaa bne 4e1c <vprintk+0x1e0>
base = 16; sign = false; lflag = true;
4f70: e3a09010 mov r9, #16
4f74: eaffff69 b 4d20 <vprintk+0xe4>
unsigned long n;
unsigned count;
char toPrint[20];
if ( sign && (num < 0) ) {
BSP_output_char('-');
4f78: e3a0002d mov r0, #45 ; 0x2d
4f7c: e1a0e00f mov lr, pc
4f80: e598f000 ldr pc, [r8]
unsigned_num = (unsigned long) -num;
if (maxwidth) maxwidth--;
4f84: e3540000 cmp r4, #0
unsigned count;
char toPrint[20];
if ( sign && (num < 0) ) {
BSP_output_char('-');
unsigned_num = (unsigned long) -num;
4f88: e2677000 rsb r7, r7, #0
if (maxwidth) maxwidth--;
4f8c: 12444001 subne r4, r4, #1
4f90: eaffff6a b 4d40 <vprintk+0x104>
00012020 <write>:
)
{
ssize_t rc;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
12020: e59f30a4 ldr r3, [pc, #164] ; 120cc <write+0xac>
12024: e5933000 ldr r3, [r3]
12028: e1500003 cmp r0, r3
ssize_t write(
int fd,
const void *buffer,
size_t count
)
{
1202c: e92d4010 push {r4, lr}
ssize_t rc;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
12030: 2a00001b bcs 120a4 <write+0x84>
iop = rtems_libio_iop( fd );
12034: e59f4094 ldr r4, [pc, #148] ; 120d0 <write+0xb0>
12038: e5944000 ldr r4, [r4]
1203c: e0600180 rsb r0, r0, r0, lsl #3
12040: e0844180 add r4, r4, r0, lsl #3
rtems_libio_check_is_open( iop );
12044: e5940014 ldr r0, [r4, #20]
12048: e3100c01 tst r0, #256 ; 0x100
1204c: 0a000014 beq 120a4 <write+0x84>
rtems_libio_check_buffer( buffer );
12050: e3510000 cmp r1, #0
12054: 0a000017 beq 120b8 <write+0x98>
rtems_libio_check_count( count );
12058: e3520000 cmp r2, #0
1205c: 0a00000e beq 1209c <write+0x7c>
rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
12060: e3100004 tst r0, #4
12064: 0a000013 beq 120b8 <write+0x98>
return 0;
/*
* Now process the write() request.
*/
rc = (*iop->pathinfo.handlers->write_h)( iop, buffer, count );
12068: e5943020 ldr r3, [r4, #32]
1206c: e1a00004 mov r0, r4
12070: e1a0e00f mov lr, pc
12074: e593f00c ldr pc, [r3, #12]
if ( rc > 0 )
12078: e3500000 cmp r0, #0
1207c: d8bd8010 pople {r4, pc}
iop->offset += rc;
12080: e284300c add r3, r4, #12
12084: e893000c ldm r3, {r2, r3}
12088: e0922000 adds r2, r2, r0
1208c: e0a33fc0 adc r3, r3, r0, asr #31
12090: e584200c str r2, [r4, #12]
12094: e5843010 str r3, [r4, #16]
12098: e8bd8010 pop {r4, pc}
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open( iop );
rtems_libio_check_buffer( buffer );
rtems_libio_check_count( count );
1209c: e1a00002 mov r0, r2
if ( rc > 0 )
iop->offset += rc;
return rc;
}
120a0: e8bd8010 pop {r4, pc}
ssize_t rc;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open( iop );
120a4: ebffeae8 bl cc4c <__errno>
120a8: e3a03009 mov r3, #9
120ac: e5803000 str r3, [r0]
120b0: e3e00000 mvn r0, #0
120b4: e8bd8010 pop {r4, pc}
rtems_libio_check_buffer( buffer );
rtems_libio_check_count( count );
rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
120b8: ebffeae3 bl cc4c <__errno> <== NOT EXECUTED
120bc: e3a03016 mov r3, #22 <== NOT EXECUTED
120c0: e5803000 str r3, [r0] <== NOT EXECUTED
120c4: e3e00000 mvn r0, #0 <== NOT EXECUTED
120c8: e8bd8010 pop {r4, pc} <== NOT EXECUTED
00006434 <writev>:
int bytes;
rtems_libio_t *iop;
ssize_t old;
bool all_zeros;
rtems_libio_check_fd( fd );
6434: e59f315c ldr r3, [pc, #348] ; 6598 <writev+0x164>
6438: e5933000 ldr r3, [r3]
643c: e1500003 cmp r0, r3
ssize_t writev(
int fd,
const struct iovec *iov,
int iovcnt
)
{
6440: e92d41f0 push {r4, r5, r6, r7, r8, lr}
6444: e1a05002 mov r5, r2
int bytes;
rtems_libio_t *iop;
ssize_t old;
bool all_zeros;
rtems_libio_check_fd( fd );
6448: 2a00004b bcs 657c <writev+0x148>
iop = rtems_libio_iop( fd );
644c: e59f3148 ldr r3, [pc, #328] ; 659c <writev+0x168>
6450: e5933000 ldr r3, [r3]
6454: e0600180 rsb r0, r0, r0, lsl #3
6458: e0838180 add r8, r3, r0, lsl #3
rtems_libio_check_is_open( iop );
645c: e5983014 ldr r3, [r8, #20]
6460: e3130c01 tst r3, #256 ; 0x100
6464: 0a000044 beq 657c <writev+0x148>
rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
6468: e3130004 tst r3, #4
646c: 0a00003c beq 6564 <writev+0x130>
/*
* Argument validation on IO vector
*/
if ( !iov )
6470: e3510000 cmp r1, #0
6474: 0a00003a beq 6564 <writev+0x130>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt <= 0 )
6478: e3520000 cmp r2, #0
647c: da000038 ble 6564 <writev+0x130>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt > IOV_MAX )
6480: e3520b01 cmp r2, #1024 ; 0x400
6484: ca000036 bgt 6564 <writev+0x130>
rtems_set_errno_and_return_minus_one( EINVAL );
6488: e1a04001 mov r4, r1
all_zeros = false;
/* check for wrap */
old = total;
total += iov[v].iov_len;
if ( total < old || total > SSIZE_MAX )
648c: e3a0cc7f mov ip, #32512 ; 0x7f00
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt <= 0 )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt > IOV_MAX )
6490: e3a01000 mov r1, #0
6494: e1a02004 mov r2, r4
6498: e3a06001 mov r6, #1
649c: e1a07001 mov r7, r1
all_zeros = false;
/* check for wrap */
old = total;
total += iov[v].iov_len;
if ( total < old || total > SSIZE_MAX )
64a0: e28cc0ff add ip, ip, #255 ; 0xff
64a4: ea000000 b 64ac <writev+0x78>
if ( iov[v].iov_len )
all_zeros = false;
/* check for wrap */
old = total;
total += iov[v].iov_len;
64a8: e1a07003 mov r7, r3
* entering the write loop.
*/
all_zeros = true;
for ( old=0, total=0, v=0 ; v < iovcnt ; v++ ) {
if ( !iov[v].iov_base )
64ac: e5923000 ldr r3, [r2]
64b0: e3530000 cmp r3, #0
* this loop does that check as well and sets "all-zero" appropriately.
* The variable "all_zero" is used as an early exit point before
* entering the write loop.
*/
all_zeros = true;
for ( old=0, total=0, v=0 ; v < iovcnt ; v++ ) {
64b4: e2811001 add r1, r1, #1
if ( !iov[v].iov_base )
64b8: 0a000029 beq 6564 <writev+0x130>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iov[v].iov_len < 0 )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iov[v].iov_len )
64bc: e5920004 ldr r0, [r2, #4]
all_zeros = false;
/* check for wrap */
old = total;
total += iov[v].iov_len;
64c0: e0873000 add r3, r7, r0
if ( iov[v].iov_len < 0 )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iov[v].iov_len )
all_zeros = false;
64c4: e3500000 cmp r0, #0
64c8: 13a06000 movne r6, #0
/* check for wrap */
old = total;
total += iov[v].iov_len;
if ( total < old || total > SSIZE_MAX )
64cc: e1570003 cmp r7, r3
64d0: d153000c cmple r3, ip
64d4: d3a07000 movle r7, #0
64d8: c3a07001 movgt r7, #1
64dc: ca000020 bgt 6564 <writev+0x130>
* this loop does that check as well and sets "all-zero" appropriately.
* The variable "all_zero" is used as an early exit point before
* entering the write loop.
*/
all_zeros = true;
for ( old=0, total=0, v=0 ; v < iovcnt ; v++ ) {
64e0: e1550001 cmp r5, r1
64e4: e2822008 add r2, r2, #8
64e8: caffffee bgt 64a8 <writev+0x74>
}
/*
* A writev with all zeros is supposed to have no effect per OpenGroup.
*/
if ( all_zeros == true ) {
64ec: e3560000 cmp r6, #0
64f0: 1a00001f bne 6574 <writev+0x140>
64f4: e1a07006 mov r7, r6
64f8: ea000003 b 650c <writev+0xd8>
}
/*
* Now process the writev().
*/
for ( total=0, v=0 ; v < iovcnt ; v++ ) {
64fc: e2866001 add r6, r6, #1
6500: e1550006 cmp r5, r6
6504: e2844008 add r4, r4, #8
6508: da000019 ble 6574 <writev+0x140>
/* all zero lengths has no effect */
if ( iov[v].iov_len == 0 )
650c: e5942004 ldr r2, [r4, #4]
6510: e3520000 cmp r2, #0
6514: 0afffff8 beq 64fc <writev+0xc8>
continue;
bytes = (*iop->pathinfo.handlers->write_h)(
6518: e5941000 ldr r1, [r4]
651c: e5983020 ldr r3, [r8, #32]
6520: e1a00008 mov r0, r8
6524: e1a0e00f mov lr, pc
6528: e593f00c ldr pc, [r3, #12]
iop,
iov[v].iov_base,
iov[v].iov_len
);
if ( bytes < 0 )
652c: e3500000 cmp r0, #0
6530: ba000016 blt 6590 <writev+0x15c>
return -1;
if ( bytes > 0 ) {
6534: 0a000006 beq 6554 <writev+0x120>
iop->offset += bytes;
6538: e288300c add r3, r8, #12
653c: e893000c ldm r3, {r2, r3}
6540: e0922000 adds r2, r2, r0
6544: e0a33fc0 adc r3, r3, r0, asr #31
6548: e588200c str r2, [r8, #12]
654c: e5883010 str r3, [r8, #16]
total += bytes;
6550: e0877000 add r7, r7, r0
}
if (bytes != iov[ v ].iov_len)
6554: e5943004 ldr r3, [r4, #4]
6558: e1500003 cmp r0, r3
655c: 0affffe6 beq 64fc <writev+0xc8>
6560: ea000003 b 6574 <writev+0x140> <== NOT EXECUTED
/* check for wrap */
old = total;
total += iov[v].iov_len;
if ( total < old || total > SSIZE_MAX )
rtems_set_errno_and_return_minus_one( EINVAL );
6564: eb001de3 bl dcf8 <__errno>
6568: e3a03016 mov r3, #22
656c: e5803000 str r3, [r0]
6570: e3e07000 mvn r7, #0
if (bytes != iov[ v ].iov_len)
break;
}
return total;
}
6574: e1a00007 mov r0, r7
6578: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
ssize_t old;
bool all_zeros;
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open( iop );
657c: eb001ddd bl dcf8 <__errno>
6580: e3a03009 mov r3, #9
6584: e5803000 str r3, [r0]
6588: e3e07000 mvn r7, #0
658c: eafffff8 b 6574 <writev+0x140>
iov[v].iov_base,
iov[v].iov_len
);
if ( bytes < 0 )
return -1;
6590: e3e07000 mvn r7, #0 <== NOT EXECUTED
6594: eafffff6 b 6574 <writev+0x140> <== NOT EXECUTED