RTEMS 4.11Annotated Report
Fri Jul 16 16:11:31 2010
0000933c <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 ) {
933c: e5903000 ldr r3, [r0]
9340: 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;
9344: e5902010 ldr r2, [r0, #16]
switch( node->type ) {
9348: 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;
934c: e5922034 ldr r2, [r2, #52] ; 0x34
switch( node->type ) {
9350: e3530006 cmp r3, #6
9354: 979ff103 ldrls pc, [pc, r3, lsl #2]
9358: ea000008 b 9380 <IMFS_Set_handlers+0x44> <== NOT EXECUTED
935c: 000093a8 .word 0x000093a8 <== NOT EXECUTED
9360: 000093b8 .word 0x000093b8 <== NOT EXECUTED
9364: 00009398 .word 0x00009398 <== NOT EXECUTED
9368: 00009398 .word 0x00009398 <== NOT EXECUTED
936c: 00009388 .word 0x00009388 <== NOT EXECUTED
9370: 00009388 .word 0x00009388 <== NOT EXECUTED
9374: 00009378 .word 0x00009378 <== NOT EXECUTED
break;
case IMFS_MEMORY_FILE:
loc->handlers = fs_info->memfile_handlers;
break;
case IMFS_FIFO:
loc->handlers = fs_info->fifo_handlers;
9378: e5923010 ldr r3, [r2, #16]
937c: e5803008 str r3, [r0, #8]
break;
}
return 0;
}
9380: e3a00000 mov r0, #0
9384: 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;
9388: e5923008 ldr r3, [r2, #8]
938c: e5803008 str r3, [r0, #8]
loc->handlers = fs_info->fifo_handlers;
break;
}
return 0;
}
9390: e3a00000 mov r0, #0
9394: 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;
9398: e59f3028 ldr r3, [pc, #40] ; 93c8 <IMFS_Set_handlers+0x8c>
939c: e5803008 str r3, [r0, #8]
loc->handlers = fs_info->fifo_handlers;
break;
}
return 0;
}
93a0: e3a00000 mov r0, #0
93a4: 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;
93a8: e592300c ldr r3, [r2, #12]
93ac: e5803008 str r3, [r0, #8]
loc->handlers = fs_info->fifo_handlers;
break;
}
return 0;
}
93b0: e3a00000 mov r0, #0
93b4: e12fff1e bx lr
switch( node->type ) {
case IMFS_DIRECTORY:
loc->handlers = fs_info->directory_handlers;
break;
case IMFS_DEVICE:
loc->handlers = &IMFS_device_handlers;
93b8: e59f300c ldr r3, [pc, #12] ; 93cc <IMFS_Set_handlers+0x90>
93bc: e5803008 str r3, [r0, #8]
loc->handlers = fs_info->fifo_handlers;
break;
}
return 0;
}
93c0: e3a00000 mov r0, #0
93c4: e12fff1e bx lr
000090c4 <IMFS_chown>:
int IMFS_chown(
rtems_filesystem_location_info_t *pathloc, /* IN */
uid_t owner, /* IN */
gid_t group /* IN */
)
{
90c4: e92d40f0 push {r4, r5, r6, r7, lr}
90c8: e1a01801 lsl r1, r1, #16
90cc: e1a02802 lsl r2, r2, #16
90d0: e24dd008 sub sp, sp, #8
IMFS_jnode_t *jnode;
#if defined(RTEMS_POSIX_API)
uid_t st_uid;
#endif
jnode = (IMFS_jnode_t *) pathloc->node_access;
90d4: e5904000 ldr r4, [r0]
int IMFS_chown(
rtems_filesystem_location_info_t *pathloc, /* IN */
uid_t owner, /* IN */
gid_t group /* IN */
)
{
90d8: e1a07821 lsr r7, r1, #16
90dc: e1a06822 lsr r6, r2, #16
/*
* Verify I am the owner of the node or the super user.
*/
#if defined(RTEMS_POSIX_API)
st_uid = geteuid();
90e0: eb0003e3 bl a074 <geteuid>
if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) )
90e4: e1d453bc ldrh r5, [r4, #60] ; 0x3c
90e8: e3500000 cmp r0, #0
90ec: 11550000 cmpne r5, r0
90f0: 03a05000 moveq r5, #0
90f4: 13a05001 movne r5, #1
90f8: 1a000009 bne 9124 <IMFS_chown+0x60>
rtems_set_errno_and_return_minus_one( EPERM );
#endif
jnode->st_uid = owner;
90fc: e1c473bc strh r7, [r4, #60] ; 0x3c
jnode->st_gid = group;
9100: e1c463be strh r6, [r4, #62] ; 0x3e
IMFS_update_ctime( jnode );
9104: e1a0000d mov r0, sp
9108: e1a01005 mov r1, r5
910c: ebffe3d5 bl 2068 <gettimeofday>
9110: e59d3000 ldr r3, [sp]
9114: e5843048 str r3, [r4, #72] ; 0x48
return 0;
9118: e1a00005 mov r0, r5
}
911c: e28dd008 add sp, sp, #8
9120: e8bd80f0 pop {r4, r5, r6, r7, pc}
#if defined(RTEMS_POSIX_API)
st_uid = geteuid();
if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) )
rtems_set_errno_and_return_minus_one( EPERM );
9124: eb00125a bl da94 <__errno> <== NOT EXECUTED
9128: e3a03001 mov r3, #1 <== NOT EXECUTED
912c: e5803000 str r3, [r0] <== NOT EXECUTED
9130: e3e00000 mvn r0, #0 <== NOT EXECUTED
9134: eafffff8 b 911c <IMFS_chown+0x58> <== NOT EXECUTED
000091b8 <IMFS_create_node>:
IMFS_jnode_types_t type,
const char *name,
mode_t mode,
const IMFS_types_union *info
)
{
91b8: 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 )
91bc: e3500000 cmp r0, #0
IMFS_jnode_types_t type,
const char *name,
mode_t mode,
const IMFS_types_union *info
)
{
91c0: e1a04001 mov r4, r1
91c4: e59d7018 ldr r7, [sp, #24]
/*
* MUST have a parent node to call this routine.
*/
if ( parent_loc == NULL )
return NULL;
91c8: 01a08000 moveq r8, r0
IMFS_fs_info_t *fs_info;
/*
* MUST have a parent node to call this routine.
*/
if ( parent_loc == NULL )
91cc: 0a000026 beq 926c <IMFS_create_node+0xb4>
return NULL;
parent = parent_loc->node_access;
fs_info = parent_loc->mt_entry->fs_info;
91d0: e5901010 ldr r1, [r0, #16]
/*
* Reject creation of FIFOs if support is disabled.
*/
if ( type == IMFS_FIFO &&
91d4: e3540007 cmp r4, #7
* MUST have a parent node to call this routine.
*/
if ( parent_loc == NULL )
return NULL;
parent = parent_loc->node_access;
91d8: e5906000 ldr r6, [r0]
fs_info = parent_loc->mt_entry->fs_info;
91dc: e5915034 ldr r5, [r1, #52] ; 0x34
/*
* Reject creation of FIFOs if support is disabled.
*/
if ( type == IMFS_FIFO &&
91e0: 0a000023 beq 9274 <IMFS_create_node+0xbc>
return NULL;
/*
* Allocate filesystem node and fill in basic information
*/
node = IMFS_allocate_node( type, name, mode & ~rtems_filesystem_umask );
91e4: e59f1108 ldr r1, [pc, #264] ; 92f4 <IMFS_create_node+0x13c>
91e8: e5911000 ldr r1, [r1]
91ec: e591c02c ldr ip, [r1, #44] ; 0x2c
91f0: e1a00004 mov r0, r4
91f4: e1a01002 mov r1, r2
91f8: e1c3200c bic r2, r3, ip
91fc: ebffffcd bl 9138 <IMFS_allocate_node>
if ( !node )
9200: e2508000 subs r8, r0, #0
9204: 0a000018 beq 926c <IMFS_create_node+0xb4>
return NULL;
/*
* Set the type specific information
*/
switch (type) {
9208: e2444001 sub r4, r4, #1
920c: e3540006 cmp r4, #6
9210: 979ff104 ldrls pc, [pc, r4, lsl #2]
9214: ea00000c b 924c <IMFS_create_node+0x94> <== NOT EXECUTED
9218: 00009234 .word 0x00009234 <== NOT EXECUTED
921c: 000092e4 .word 0x000092e4 <== NOT EXECUTED
9220: 00009290 .word 0x00009290 <== NOT EXECUTED
9224: 00009290 .word 0x00009290 <== NOT EXECUTED
9228: 000092b4 .word 0x000092b4 <== NOT EXECUTED
922c: 0000929c .word 0x0000929c <== NOT EXECUTED
9230: 000092d8 .word 0x000092d8 <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
9234: e2882054 add r2, r8, #84 ; 0x54
case IMFS_DIRECTORY:
rtems_chain_initialize_empty(&node->info.directory.Entries);
9238: e2883050 add r3, r8, #80 ; 0x50
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
923c: e5882050 str r2, [r8, #80] ; 0x50
the_chain->permanent_null = NULL;
9240: e3a02000 mov r2, #0
9244: e5882054 str r2, [r8, #84] ; 0x54
the_chain->last = _Chain_Head(the_chain);
9248: 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;
924c: e5953004 ldr r3, [r5, #4]
9250: e2833001 add r3, r3, #1
/*
* This node MUST have a parent, so put it in that directory list.
*/
node->Parent = parent;
9254: e5886008 str r6, [r8, #8]
9258: e2860050 add r0, r6, #80 ; 0x50
node->st_ino = ++fs_info->ino_count;
925c: e5853004 str r3, [r5, #4]
9260: e1a01008 mov r1, r8
9264: e5883038 str r3, [r8, #56] ; 0x38
9268: ebfff367 bl 600c <_Chain_Append>
rtems_chain_append( &parent->info.directory.Entries, &node->Node );
return node;
}
926c: e1a00008 mov r0, r8
9270: 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 &&
9274: e5950010 ldr r0, [r5, #16]
9278: e59f1078 ldr r1, [pc, #120] ; 92f8 <IMFS_create_node+0x140>
927c: e1500001 cmp r0, r1
fs_info->fifo_handlers == &rtems_filesystem_handlers_default )
return NULL;
9280: 03a08000 moveq r8, #0
fs_info = parent_loc->mt_entry->fs_info;
/*
* Reject creation of FIFOs if support is disabled.
*/
if ( type == IMFS_FIFO &&
9284: 1affffd6 bne 91e4 <IMFS_create_node+0x2c>
node->st_ino = ++fs_info->ino_count;
rtems_chain_append( &parent->info.directory.Entries, &node->Node );
return node;
}
9288: e1a00008 mov r0, r8
928c: 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;
9290: e5973000 ldr r3, [r7]
9294: e5883050 str r3, [r8, #80] ; 0x50
break;
9298: eaffffeb b 924c <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;
929c: e3a03000 mov r3, #0
92a0: e3a04000 mov r4, #0
92a4: e5883050 str r3, [r8, #80] ; 0x50
92a8: e5884054 str r4, [r8, #84] ; 0x54
node->info.linearfile.direct = 0;
92ac: e3a03000 mov r3, #0
92b0: e5883058 str r3, [r8, #88] ; 0x58
case IMFS_MEMORY_FILE:
node->info.file.size = 0;
node->info.file.indirect = 0;
92b4: 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;
92b8: e3a01000 mov r1, #0
92bc: e3a02000 mov r2, #0
92c0: e5881050 str r1, [r8, #80] ; 0x50
92c4: e5882054 str r2, [r8, #84] ; 0x54
node->info.file.indirect = 0;
92c8: e5883058 str r3, [r8, #88] ; 0x58
node->info.file.doubly_indirect = 0;
92cc: e588305c str r3, [r8, #92] ; 0x5c
node->info.file.triply_indirect = 0;
92d0: e5883060 str r3, [r8, #96] ; 0x60
break;
92d4: eaffffdc b 924c <IMFS_create_node+0x94>
case IMFS_FIFO:
node->info.fifo.pipe = NULL;
92d8: e3a03000 mov r3, #0
92dc: e5883050 str r3, [r8, #80] ; 0x50
break;
92e0: eaffffd9 b 924c <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;
92e4: e897000c ldm r7, {r2, r3}
92e8: e5882050 str r2, [r8, #80] ; 0x50
node->info.device.minor = info->device.minor;
92ec: e5883054 str r3, [r8, #84] ; 0x54
break;
92f0: eaffffd5 b 924c <IMFS_create_node+0x94>
00009480 <IMFS_eval_path>:
const char *pathname, /* IN */
size_t pathnamelen, /* IN */
int flags, /* IN */
rtems_filesystem_location_info_t *pathloc /* IN/OUT */
)
{
9480: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
9484: e24dd040 sub sp, sp, #64 ; 0x40
/*
* This was filled in by the caller and is valid in the
* mount table.
*/
node = pathloc->node_access;
9488: e5936000 ldr r6, [r3]
const char *pathname, /* IN */
size_t pathnamelen, /* IN */
int flags, /* IN */
rtems_filesystem_location_info_t *pathloc /* IN/OUT */
)
{
948c: e58d2000 str r2, [sp]
9490: e1a07003 mov r7, r3
9494: e1a0a000 mov sl, r0
9498: e1a04001 mov r4, r1
int i = 0;
949c: e3a05000 mov r5, #0
94a0: e28d8004 add r8, sp, #4
94a4: e28d903c add r9, sp, #60 ; 0x3c
* 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 );
94a8: e1a02008 mov r2, r8
94ac: e1a03009 mov r3, r9
94b0: e08a0005 add r0, sl, r5
94b4: e1a01004 mov r1, r4
94b8: eb0001ed bl 9c74 <IMFS_get_token>
pathnamelen -= len;
i += len;
if ( !pathloc->node_access )
94bc: e5973000 ldr r3, [r7]
94c0: e3530000 cmp r3, #0
* Evaluate all tokens until we are done or an error occurs.
*/
while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) {
type = IMFS_get_token( &pathname[i], pathnamelen, token, &len );
94c4: e1a0b000 mov fp, r0
pathnamelen -= len;
94c8: e59d203c ldr r2, [sp, #60] ; 0x3c
i += len;
if ( !pathloc->node_access )
94cc: 0a00004e beq 960c <IMFS_eval_path+0x18c>
rtems_set_errno_and_return_minus_one( ENOENT );
/*
* I cannot move out of this directory without execute permission.
*/
if ( type != IMFS_NO_MORE_PATH )
94d0: 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;
94d4: e0624004 rsb r4, r2, r4
i += len;
94d8: e0855002 add r5, r5, r2
rtems_set_errno_and_return_minus_one( ENOENT );
/*
* I cannot move out of this directory without execute permission.
*/
if ( type != IMFS_NO_MORE_PATH )
94dc: 1a00000f bne 9520 <IMFS_eval_path+0xa0>
* 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 ) {
94e0: e593204c ldr r2, [r3, #76] ; 0x4c
94e4: e3520001 cmp r2, #1
94e8: 0a00006a beq 9698 <IMFS_eval_path+0x218>
flags, pathloc );
} else {
result = IMFS_Set_handlers( pathloc );
}
} else {
result = IMFS_Set_handlers( pathloc );
94ec: e1a00007 mov r0, r7
94f0: ebffff91 bl 933c <IMFS_Set_handlers>
/*
* Verify we have the correct permissions for this node.
*/
if ( !IMFS_evaluate_permission( pathloc, flags ) )
94f4: e59d1000 ldr r1, [sp]
flags, pathloc );
} else {
result = IMFS_Set_handlers( pathloc );
}
} else {
result = IMFS_Set_handlers( pathloc );
94f8: e1a06000 mov r6, r0
/*
* Verify we have the correct permissions for this node.
*/
if ( !IMFS_evaluate_permission( pathloc, flags ) )
94fc: e1a00007 mov r0, r7
9500: ebffffb2 bl 93d0 <IMFS_evaluate_permission>
9504: e3500000 cmp r0, #0
9508: 1a000036 bne 95e8 <IMFS_eval_path+0x168>
rtems_set_errno_and_return_minus_one( EACCES );
950c: eb001160 bl da94 <__errno>
9510: e3a0300d mov r3, #13
9514: e5803000 str r3, [r0]
9518: e3e06000 mvn r6, #0
951c: ea000031 b 95e8 <IMFS_eval_path+0x168>
/*
* I cannot move out of this directory without execute permission.
*/
if ( type != IMFS_NO_MORE_PATH )
if ( node->type == IMFS_DIRECTORY )
9520: e596104c ldr r1, [r6, #76] ; 0x4c
9524: e3510001 cmp r1, #1
9528: 0a000031 beq 95f4 <IMFS_eval_path+0x174>
if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) )
rtems_set_errno_and_return_minus_one( EACCES );
node = pathloc->node_access;
switch( type ) {
952c: 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;
9530: e1a06003 mov r6, r3
switch( type ) {
9534: 0a000006 beq 9554 <IMFS_eval_path+0xd4>
9538: e35b0004 cmp fp, #4
953c: 0a000025 beq 95d8 <IMFS_eval_path+0x158>
9540: e35b0002 cmp fp, #2
9544: 0a000013 beq 9598 <IMFS_eval_path+0x118>
/*
* Evaluate all tokens until we are done or an error occurs.
*/
while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) {
9548: e35b0004 cmp fp, #4
954c: 1affffd5 bne 94a8 <IMFS_eval_path+0x28>
9550: eaffffe2 b 94e0 <IMFS_eval_path+0x60> <== NOT EXECUTED
case IMFS_NAME:
/*
* If we are at a link follow it.
*/
if ( node->type == IMFS_HARD_LINK ) {
9554: e593304c ldr r3, [r3, #76] ; 0x4c
9558: e3530003 cmp r3, #3
955c: 0a00002f beq 9620 <IMFS_eval_path+0x1a0>
node = pathloc->node_access;
if ( !node )
rtems_set_errno_and_return_minus_one( ENOTDIR );
} else if ( node->type == IMFS_SYM_LINK ) {
9560: e3530004 cmp r3, #4
9564: 0a000055 beq 96c0 <IMFS_eval_path+0x240>
/*
* Only a directory can be decended into.
*/
if ( node->type != IMFS_DIRECTORY )
9568: e3530001 cmp r3, #1
956c: 1a00004e bne 96ac <IMFS_eval_path+0x22c>
/*
* 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 ) {
9570: e596e05c ldr lr, [r6, #92] ; 0x5c
9574: e35e0000 cmp lr, #0
9578: 1a000049 bne 96a4 <IMFS_eval_path+0x224>
/*
* Otherwise find the token name in the present location.
*/
node = IMFS_find_match_in_dir( node, token );
957c: e1a00006 mov r0, r6
9580: e1a01008 mov r1, r8
9584: eb000193 bl 9bd8 <IMFS_find_match_in_dir>
if ( !node )
9588: e2506000 subs r6, r0, #0
958c: 0a00001e beq 960c <IMFS_eval_path+0x18c>
/*
* Set the node access to the point we have found.
*/
pathloc->node_access = node;
9590: e5876000 str r6, [r7]
9594: eaffffc3 b 94a8 <IMFS_eval_path+0x28>
case IMFS_UP_DIR:
/*
* Am I at the root of all filesystems? (chroot'ed?)
*/
if ( pathloc->node_access == rtems_filesystem_root.node_access )
9598: e59f1148 ldr r1, [pc, #328] ; 96e8 <IMFS_eval_path+0x268>
959c: e5912000 ldr r2, [r1]
95a0: e5922018 ldr r2, [r2, #24]
95a4: e1520003 cmp r2, r3
95a8: 0affffbe beq 94a8 <IMFS_eval_path+0x28>
/*
* Am I at the root of this mounted filesystem?
*/
if (pathloc->node_access ==
pathloc->mt_entry->mt_fs_root.node_access) {
95ac: e597e010 ldr lr, [r7, #16]
/*
* Am I at the root of this mounted filesystem?
*/
if (pathloc->node_access ==
95b0: e59e201c ldr r2, [lr, #28]
95b4: e1520003 cmp r2, r3
95b8: 0a000020 beq 9640 <IMFS_eval_path+0x1c0>
pathnamelen+len,
flags,pathloc);
}
} else {
if ( !node->Parent )
95bc: e5936008 ldr r6, [r3, #8]
95c0: e3560000 cmp r6, #0
95c4: 1afffff1 bne 9590 <IMFS_eval_path+0x110>
rtems_set_errno_and_return_minus_one( ENOENT );
95c8: eb001131 bl da94 <__errno>
95cc: e3e06000 mvn r6, #0
95d0: e580b000 str fp, [r0]
95d4: ea000003 b 95e8 <IMFS_eval_path+0x168>
case IMFS_NO_MORE_PATH:
case IMFS_CURRENT_DIR:
break;
case IMFS_INVALID_TOKEN:
rtems_set_errno_and_return_minus_one( ENAMETOOLONG );
95d8: eb00112d bl da94 <__errno>
95dc: e3a0305b mov r3, #91 ; 0x5b
95e0: e5803000 str r3, [r0]
95e4: e3e06000 mvn r6, #0
if ( !IMFS_evaluate_permission( pathloc, flags ) )
rtems_set_errno_and_return_minus_one( EACCES );
return result;
}
95e8: e1a00006 mov r0, r6
95ec: e28dd040 add sp, sp, #64 ; 0x40
95f0: 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 ) )
95f4: e1a00007 mov r0, r7
95f8: ebffff74 bl 93d0 <IMFS_evaluate_permission>
95fc: e3500000 cmp r0, #0
9600: 0affffc1 beq 950c <IMFS_eval_path+0x8c>
9604: e5973000 ldr r3, [r7]
9608: eaffffc7 b 952c <IMFS_eval_path+0xac>
* 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 );
960c: eb001120 bl da94 <__errno>
9610: e3a03002 mov r3, #2
9614: e5803000 str r3, [r0]
9618: e3e06000 mvn r6, #0
961c: eafffff1 b 95e8 <IMFS_eval_path+0x168>
* If we are at a link follow it.
*/
if ( node->type == IMFS_HARD_LINK ) {
IMFS_evaluate_hard_link( pathloc, 0 );
9620: e1a00007 mov r0, r7
9624: e3a01000 mov r1, #0
9628: ebffff7b bl 941c <IMFS_evaluate_hard_link>
node = pathloc->node_access;
962c: e5976000 ldr r6, [r7]
if ( !node )
9630: e3560000 cmp r6, #0
9634: 0a00001c beq 96ac <IMFS_eval_path+0x22c>
} else if ( node->type == IMFS_SYM_LINK ) {
result = IMFS_evaluate_sym_link( pathloc, 0 );
node = pathloc->node_access;
9638: e596304c ldr r3, [r6, #76] ; 0x4c
963c: eaffffc9 b 9568 <IMFS_eval_path+0xe8>
*/
if ( pathloc->node_access == rtems_filesystem_root.node_access ) {
break; /* Throw out the .. in this case */
} else {
newloc = pathloc->mt_entry->mt_point_node;
9640: 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;
9644: e8be000f ldm lr!, {r0, r1, r2, r3}
9648: e28d6028 add r6, sp, #40 ; 0x28
964c: e8a6000f stmia r6!, {r0, r1, r2, r3}
*pathloc = newloc;
9650: e28dc028 add ip, sp, #40 ; 0x28
9654: 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;
9658: e59ec000 ldr ip, [lr]
*pathloc = newloc;
965c: e1a0e007 mov lr, r7
9660: e8ae000f stmia lr!, {r0, r1, r2, r3}
return (*pathloc->ops->evalpath_h)( &pathname[i-len],
9664: e59d103c ldr r1, [sp, #60] ; 0x3c
*/
if ( node->type == IMFS_DIRECTORY ) {
if ( node->info.directory.mt_fs != NULL ) {
newloc = node->info.directory.mt_fs->mt_fs_root;
*pathloc = newloc;
9668: e58ec000 str ip, [lr]
return (*pathloc->ops->evalpath_h)( &pathname[i-len],
966c: e0610005 rsb r0, r1, 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;
9670: e586c000 str ip, [r6]
*pathloc = newloc;
return (*pathloc->ops->evalpath_h)( &pathname[i-len],
9674: e08a0000 add r0, sl, r0
9678: e597c00c ldr ip, [r7, #12]
967c: e0841001 add r1, r4, r1
9680: e59d2000 ldr r2, [sp]
9684: e1a03007 mov r3, r7
9688: e1a0e00f mov lr, pc
968c: e59cf000 ldr pc, [ip]
9690: e1a06000 mov r6, r0
9694: eaffffd3 b 95e8 <IMFS_eval_path+0x168>
*
* 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 ) {
9698: e593e05c ldr lr, [r3, #92] ; 0x5c
969c: e35e0000 cmp lr, #0
96a0: 0affff91 beq 94ec <IMFS_eval_path+0x6c>
newloc = node->info.directory.mt_fs->mt_fs_root;
96a4: e28ee01c add lr, lr, #28
96a8: eaffffe5 b 9644 <IMFS_eval_path+0x1c4>
/*
* Only a directory can be decended into.
*/
if ( node->type != IMFS_DIRECTORY )
rtems_set_errno_and_return_minus_one( ENOTDIR );
96ac: eb0010f8 bl da94 <__errno>
96b0: e3a03014 mov r3, #20
96b4: e5803000 str r3, [r0]
96b8: e3e06000 mvn r6, #0
96bc: eaffffc9 b 95e8 <IMFS_eval_path+0x168>
if ( !node )
rtems_set_errno_and_return_minus_one( ENOTDIR );
} else if ( node->type == IMFS_SYM_LINK ) {
result = IMFS_evaluate_sym_link( pathloc, 0 );
96c0: e1a00007 mov r0, r7
96c4: e3a01000 mov r1, #0
96c8: eb000007 bl 96ec <IMFS_evaluate_sym_link>
node = pathloc->node_access;
if ( result == -1 )
96cc: 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 );
96d0: e1a06000 mov r6, r0
node = pathloc->node_access;
96d4: e5973000 ldr r3, [r7]
if ( result == -1 )
96d8: 0affffc2 beq 95e8 <IMFS_eval_path+0x168>
} else if ( node->type == IMFS_SYM_LINK ) {
result = IMFS_evaluate_sym_link( pathloc, 0 );
node = pathloc->node_access;
96dc: e1a06003 mov r6, r3
96e0: e596304c ldr r3, [r6, #76] ; 0x4c
96e4: eaffff9f b 9568 <IMFS_eval_path+0xe8>
00009880 <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 */
)
{
9880: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
9884: e24dd040 sub sp, sp, #64 ; 0x40
9888: e1a06001 mov r6, r1
/*
* This was filled in by the caller and is valid in the
* mount table.
*/
node = pathloc->node_access;
988c: 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 */
)
{
9890: e1a0a000 mov sl, r0
9894: e58d2000 str r2, [sp]
node = pathloc->node_access;
/*
* Get the path length.
*/
pathlen = strlen( path );
9898: eb00146d bl ea54 <strlen>
const char *path, /* IN */
rtems_filesystem_location_info_t *pathloc, /* IN/OUT */
const char **name /* OUT */
)
{
int i = 0;
989c: e3a07000 mov r7, #0
node = pathloc->node_access;
/*
* Get the path length.
*/
pathlen = strlen( path );
98a0: e1a04000 mov r4, r0
98a4: e28d8004 add r8, sp, #4
* Evaluate all tokens until we are done or an error occurs.
*/
while( !done ) {
type = IMFS_get_token( &path[i], pathlen, token, &len );
98a8: e1a01004 mov r1, r4
98ac: e28d303c add r3, sp, #60 ; 0x3c
98b0: e08a0007 add r0, sl, r7
98b4: e1a02008 mov r2, r8
98b8: eb0000ed bl 9c74 <IMFS_get_token>
pathlen -= len;
i += len;
if ( !pathloc->node_access )
98bc: e5963000 ldr r3, [r6]
*/
while( !done ) {
type = IMFS_get_token( &path[i], pathlen, token, &len );
pathlen -= len;
98c0: e59db03c ldr fp, [sp, #60] ; 0x3c
i += len;
if ( !pathloc->node_access )
98c4: e3530000 cmp r3, #0
* Evaluate all tokens until we are done or an error occurs.
*/
while( !done ) {
type = IMFS_get_token( &path[i], pathlen, token, &len );
98c8: e1a09000 mov r9, r0
pathlen -= len;
98cc: e06b4004 rsb r4, fp, r4
i += len;
if ( !pathloc->node_access )
98d0: 0a000035 beq 99ac <IMFS_evaluate_for_make+0x12c>
/*
* I cannot move out of this directory without execute permission.
*/
if ( type != IMFS_NO_MORE_PATH )
98d4: e3500000 cmp r0, #0
98d8: 1a000006 bne 98f8 <IMFS_evaluate_for_make+0x78>
pathloc->node_access = node;
break;
case IMFS_NO_MORE_PATH:
rtems_set_errno_and_return_minus_one( EEXIST );
98dc: eb00106c bl da94 <__errno>
98e0: e3a03011 mov r3, #17
98e4: e5803000 str r3, [r0]
98e8: e3e05000 mvn r5, #0
if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) )
rtems_set_errno_and_return_minus_one( EACCES );
return result;
}
98ec: e1a00005 mov r0, r5
98f0: e28dd040 add sp, sp, #64 ; 0x40
98f4: 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 )
98f8: e595104c ldr r1, [r5, #76] ; 0x4c
98fc: e3510001 cmp r1, #1
9900: 0a000044 beq 9a18 <IMFS_evaluate_for_make+0x198>
while( !done ) {
type = IMFS_get_token( &path[i], pathlen, token, &len );
pathlen -= len;
i += len;
9904: e087700b add r7, r7, fp
if ( type != IMFS_NO_MORE_PATH )
if ( node->type == IMFS_DIRECTORY )
if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) )
rtems_set_errno_and_return_minus_one( EACCES );
node = pathloc->node_access;
9908: e1a05003 mov r5, r3
switch( type ) {
990c: e3590004 cmp r9, #4
9910: 979ff109 ldrls pc, [pc, r9, lsl #2]
9914: eaffffe3 b 98a8 <IMFS_evaluate_for_make+0x28> <== NOT EXECUTED
9918: 000098dc .word 0x000098dc <== NOT EXECUTED
991c: 000098a8 .word 0x000098a8 <== NOT EXECUTED
9920: 0000997c .word 0x0000997c <== NOT EXECUTED
9924: 0000992c .word 0x0000992c <== NOT EXECUTED
9928: 000099c0 .word 0x000099c0 <== NOT EXECUTED
pathloc->node_access = node;
break;
case IMFS_NAME:
if ( node->type == IMFS_HARD_LINK ) {
992c: e593304c ldr r3, [r3, #76] ; 0x4c
9930: e3530003 cmp r3, #3
9934: 0a00006a beq 9ae4 <IMFS_evaluate_for_make+0x264>
result = IMFS_evaluate_link( pathloc, 0 );
if ( result == -1 )
return -1;
} else if ( node->type == IMFS_SYM_LINK ) {
9938: e3530004 cmp r3, #4
993c: 0a000068 beq 9ae4 <IMFS_evaluate_for_make+0x264>
if ( result == -1 )
return -1;
}
node = pathloc->node_access;
if ( !node )
9940: e3550000 cmp r5, #0
9944: 0a00005f beq 9ac8 <IMFS_evaluate_for_make+0x248>
/*
* Only a directory can be decended into.
*/
if ( node->type != IMFS_DIRECTORY )
9948: e595304c ldr r3, [r5, #76] ; 0x4c
994c: e3530001 cmp r3, #1
9950: 1a00005c bne 9ac8 <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 ) {
9954: e595c05c ldr ip, [r5, #92] ; 0x5c
9958: e35c0000 cmp ip, #0
995c: 1a00005e bne 9adc <IMFS_evaluate_for_make+0x25c>
/*
* Otherwise find the token name in the present location.
*/
node = IMFS_find_match_in_dir( node, token );
9960: e1a00005 mov r0, r5
9964: e1a01008 mov r1, r8
9968: eb00009a bl 9bd8 <IMFS_find_match_in_dir>
/*
* If there is no node we have found the name of the node we
* wish to create.
*/
if ( ! node )
996c: e2505000 subs r5, r0, #0
9970: 0a000017 beq 99d4 <IMFS_evaluate_for_make+0x154>
done = true;
else
pathloc->node_access = node;
9974: e5865000 str r5, [r6]
9978: eaffffca b 98a8 <IMFS_evaluate_for_make+0x28>
case IMFS_UP_DIR:
/*
* Am I at the root of all filesystems? (chroot'ed?)
*/
if ( pathloc->node_access == rtems_filesystem_root.node_access )
997c: e59f1180 ldr r1, [pc, #384] ; 9b04 <IMFS_evaluate_for_make+0x284>
9980: e5912000 ldr r2, [r1]
9984: e5922018 ldr r2, [r2, #24]
9988: e1530002 cmp r3, r2
998c: 0affffc5 beq 98a8 <IMFS_evaluate_for_make+0x28>
/*
* Am I at the root of this mounted filesystem?
*/
if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access){
9990: e596c010 ldr ip, [r6, #16]
9994: e59c201c ldr r2, [ip, #28]
9998: e1530002 cmp r3, r2
999c: 0a000023 beq 9a30 <IMFS_evaluate_for_make+0x1b0>
*pathloc = newloc;
return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name );
}
} else {
if ( !node->Parent )
99a0: e5935008 ldr r5, [r3, #8]
99a4: e3550000 cmp r5, #0
99a8: 1afffff1 bne 9974 <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 );
99ac: eb001038 bl da94 <__errno>
99b0: e3a03002 mov r3, #2
99b4: e5803000 str r3, [r0]
99b8: e3e05000 mvn r5, #0
99bc: eaffffca b 98ec <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 );
99c0: eb001033 bl da94 <__errno>
99c4: e3a0305b mov r3, #91 ; 0x5b
99c8: e5803000 str r3, [r0]
99cc: e3e05000 mvn r5, #0
99d0: eaffffc5 b 98ec <IMFS_evaluate_for_make+0x6c>
case IMFS_CURRENT_DIR:
break;
}
}
*name = &path[ i - len ];
99d4: e59d303c ldr r3, [sp, #60] ; 0x3c
99d8: e59d1000 ldr r1, [sp]
99dc: e0633007 rsb r3, r3, r7
99e0: e08a3003 add r3, sl, r3
99e4: e5813000 str r3, [r1]
/*
* 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++) {
99e8: e7da0007 ldrb r0, [sl, r7]
99ec: e3500000 cmp r0, #0
99f0: e08a7007 add r7, sl, r7
99f4: 1a000003 bne 9a08 <IMFS_evaluate_for_make+0x188>
99f8: ea000021 b 9a84 <IMFS_evaluate_for_make+0x204>
99fc: e5f70001 ldrb r0, [r7, #1]!
9a00: e3500000 cmp r0, #0
9a04: 0a00001e beq 9a84 <IMFS_evaluate_for_make+0x204>
if ( !IMFS_is_separator( path[ i ] ) )
9a08: ebffe51b bl 2e7c <rtems_filesystem_is_separator>
9a0c: e3500000 cmp r0, #0
9a10: 1afffff9 bne 99fc <IMFS_evaluate_for_make+0x17c>
9a14: eaffffe4 b 99ac <IMFS_evaluate_for_make+0x12c>
* 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 ) )
9a18: e1a00006 mov r0, r6
9a1c: ebfffe6b bl 93d0 <IMFS_evaluate_permission>
9a20: e3500000 cmp r0, #0
9a24: 0a000022 beq 9ab4 <IMFS_evaluate_for_make+0x234>
9a28: e5963000 ldr r3, [r6]
9a2c: eaffffb4 b 9904 <IMFS_evaluate_for_make+0x84>
if ( pathloc->node_access == rtems_filesystem_root.node_access ) {
break;
} else {
newloc = pathloc->mt_entry->mt_point_node;
9a30: e28cc008 add ip, ip, #8
* 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;
9a34: e8bc000f ldm ip!, {r0, r1, r2, r3}
9a38: e28d4028 add r4, sp, #40 ; 0x28
9a3c: e8a4000f stmia r4!, {r0, r1, r2, r3}
*pathloc = newloc;
9a40: e28de028 add lr, sp, #40 ; 0x28
9a44: e8be000f ldm lr!, {r0, r1, r2, r3}
9a48: 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;
9a4c: e59cc000 ldr ip, [ip]
*pathloc = newloc;
9a50: e8ae000f stmia lr!, {r0, r1, r2, r3}
return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name );
9a54: e59d003c ldr r0, [sp, #60] ; 0x3c
* 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;
9a58: e58ec000 str ip, [lr]
return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name );
9a5c: e0600007 rsb r0, r0, r7
* 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;
9a60: e584c000 str ip, [r4]
*pathloc = newloc;
return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name );
9a64: e596300c ldr r3, [r6, #12]
9a68: e08a0000 add r0, sl, r0
9a6c: e1a01006 mov r1, r6
9a70: e59d2000 ldr r2, [sp]
9a74: e1a0e00f mov lr, pc
9a78: e593f004 ldr pc, [r3, #4]
9a7c: e1a05000 mov r5, r0
9a80: eaffff99 b 98ec <IMFS_evaluate_for_make+0x6c>
/*
* Verify we can execute and write to this directory.
*/
result = IMFS_Set_handlers( pathloc );
9a84: e1a00006 mov r0, r6
9a88: ebfffe2b bl 933c <IMFS_Set_handlers>
/*
* The returned node must be a directory
*/
node = pathloc->node_access;
if ( node->type != IMFS_DIRECTORY )
9a8c: e5963000 ldr r3, [r6]
9a90: e593304c ldr r3, [r3, #76] ; 0x4c
9a94: e3530001 cmp r3, #1
/*
* Verify we can execute and write to this directory.
*/
result = IMFS_Set_handlers( pathloc );
9a98: e1a05000 mov r5, r0
/*
* The returned node must be a directory
*/
node = pathloc->node_access;
if ( node->type != IMFS_DIRECTORY )
9a9c: 1a000009 bne 9ac8 <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 ) )
9aa0: e1a00006 mov r0, r6
9aa4: e3a01003 mov r1, #3
9aa8: ebfffe48 bl 93d0 <IMFS_evaluate_permission>
9aac: e3500000 cmp r0, #0
9ab0: 1affff8d bne 98ec <IMFS_evaluate_for_make+0x6c>
rtems_set_errno_and_return_minus_one( EACCES );
9ab4: eb000ff6 bl da94 <__errno>
9ab8: e3a0300d mov r3, #13
9abc: e5803000 str r3, [r0]
9ac0: e3e05000 mvn r5, #0
9ac4: eaffff88 b 98ec <IMFS_evaluate_for_make+0x6c>
/*
* The returned node must be a directory
*/
node = pathloc->node_access;
if ( node->type != IMFS_DIRECTORY )
rtems_set_errno_and_return_minus_one( ENOTDIR );
9ac8: eb000ff1 bl da94 <__errno>
9acc: e3a03014 mov r3, #20
9ad0: e5803000 str r3, [r0]
9ad4: e3e05000 mvn r5, #0
9ad8: eaffff83 b 98ec <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;
9adc: e28cc01c add ip, ip, #28
9ae0: eaffffd3 b 9a34 <IMFS_evaluate_for_make+0x1b4>
if ( result == -1 )
return -1;
} else if ( node->type == IMFS_SYM_LINK ) {
result = IMFS_evaluate_link( pathloc, 0 );
9ae4: e1a00006 mov r0, r6
9ae8: e3a01000 mov r1, #0
9aec: ebffff2e bl 97ac <IMFS_evaluate_link>
if ( result == -1 )
9af0: e3700001 cmn r0, #1
if ( result == -1 )
return -1;
} else if ( node->type == IMFS_SYM_LINK ) {
result = IMFS_evaluate_link( pathloc, 0 );
9af4: e1a05000 mov r5, r0
if ( result == -1 )
9af8: 0affff7b beq 98ec <IMFS_evaluate_for_make+0x6c>
9afc: e5965000 ldr r5, [r6]
9b00: eaffff8e b 9940 <IMFS_evaluate_for_make+0xc0>
0000941c <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;
941c: e5903000 ldr r3, [r0]
/*
* Check for things that should never happen.
*/
if ( jnode->type != IMFS_HARD_LINK )
9420: e593204c ldr r2, [r3, #76] ; 0x4c
9424: e3520003 cmp r2, #3
int IMFS_evaluate_hard_link(
rtems_filesystem_location_info_t *node, /* IN/OUT */
int flags /* IN */
)
{
9428: e92d4030 push {r4, r5, lr}
942c: e1a04000 mov r4, r0
9430: e1a05001 mov r5, r1
/*
* Check for things that should never happen.
*/
if ( jnode->type != IMFS_HARD_LINK )
9434: 1a00000e bne 9474 <IMFS_evaluate_hard_link+0x58>
/*
* Set the hard link value and the handlers.
*/
node->node_access = jnode->info.hard_link.link_node;
9438: e5933050 ldr r3, [r3, #80] ; 0x50
943c: e5803000 str r3, [r0]
IMFS_Set_handlers( node );
9440: ebffffbd bl 933c <IMFS_Set_handlers>
/*
* Verify we have the correct permissions for this node.
*/
if ( !IMFS_evaluate_permission( node, flags ) )
9444: e1a00004 mov r0, r4
9448: e1a01005 mov r1, r5
944c: ebffffdf bl 93d0 <IMFS_evaluate_permission>
9450: e3500000 cmp r0, #0
9454: 0a000001 beq 9460 <IMFS_evaluate_hard_link+0x44>
rtems_set_errno_and_return_minus_one( EACCES );
return result;
9458: e3a00000 mov r0, #0
}
945c: 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 );
9460: eb00118b bl da94 <__errno> <== NOT EXECUTED
9464: e3a0300d mov r3, #13 <== NOT EXECUTED
9468: e5803000 str r3, [r0] <== NOT EXECUTED
946c: e3e00000 mvn r0, #0 <== NOT EXECUTED
9470: 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);
9474: e3a0032b mov r0, #-1409286144 ; 0xac000000 <== NOT EXECUTED
9478: e2400833 sub r0, r0, #3342336 ; 0x330000 <== NOT EXECUTED
947c: ebfff217 bl 5ce0 <rtems_fatal_error_occurred> <== NOT EXECUTED
000096ec <IMFS_evaluate_sym_link>:
int IMFS_evaluate_sym_link(
rtems_filesystem_location_info_t *node, /* IN/OUT */
int flags /* IN */
)
{
96ec: e92d4070 push {r4, r5, r6, lr}
IMFS_jnode_t *jnode = node->node_access;
96f0: e5906000 ldr r6, [r0]
/*
* Check for things that should never happen.
*/
if ( jnode->type != IMFS_SYM_LINK )
96f4: e596304c ldr r3, [r6, #76] ; 0x4c
96f8: e3530004 cmp r3, #4
int IMFS_evaluate_sym_link(
rtems_filesystem_location_info_t *node, /* IN/OUT */
int flags /* IN */
)
{
96fc: e24dd004 sub sp, sp, #4
9700: e1a04000 mov r4, r0
9704: e1a05001 mov r5, r1
/*
* Check for things that should never happen.
*/
if ( jnode->type != IMFS_SYM_LINK )
9708: 1a000024 bne 97a0 <IMFS_evaluate_sym_link+0xb4>
rtems_fatal_error_occurred (0xABCD0000);
if ( !jnode->Parent )
970c: e5963008 ldr r3, [r6, #8]
9710: e3530000 cmp r3, #0
9714: 0a00001e beq 9794 <IMFS_evaluate_sym_link+0xa8>
* root depending on the symbolic links path.
*/
node->node_access = jnode->Parent;
rtems_filesystem_get_sym_start_loc(
9718: e5960050 ldr r0, [r6, #80] ; 0x50
971c: e1a0100d mov r1, sp
9720: 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;
9724: e5843000 str r3, [r4]
rtems_filesystem_get_sym_start_loc(
9728: eb0003be bl a628 <rtems_filesystem_get_sym_start_loc>
/*
* Use eval path to evaluate the path of the symbolic link.
*/
result = IMFS_eval_path(
972c: e59d3000 ldr r3, [sp]
9730: e5966050 ldr r6, [r6, #80] ; 0x50
9734: e0866003 add r6, r6, r3
9738: e1a00006 mov r0, r6
973c: eb0014c4 bl ea54 <strlen>
9740: e1a02005 mov r2, r5
9744: e1a01000 mov r1, r0
9748: e1a03004 mov r3, r4
974c: e1a00006 mov r0, r6
9750: ebffff4a bl 9480 <IMFS_eval_path>
9754: e1a06000 mov r6, r0
strlen( &jnode->info.sym_link.name[i] ),
flags,
node
);
IMFS_Set_handlers( node );
9758: e1a00004 mov r0, r4
975c: ebfffef6 bl 933c <IMFS_Set_handlers>
/*
* Verify we have the correct permissions for this node.
*/
if ( !IMFS_evaluate_permission( node, flags ) )
9760: e1a00004 mov r0, r4
9764: e1a01005 mov r1, r5
9768: ebffff18 bl 93d0 <IMFS_evaluate_permission>
976c: e3500000 cmp r0, #0
9770: 0a000002 beq 9780 <IMFS_evaluate_sym_link+0x94>
rtems_set_errno_and_return_minus_one( EACCES );
return result;
}
9774: e1a00006 mov r0, r6
9778: e28dd004 add sp, sp, #4
977c: 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 );
9780: eb0010c3 bl da94 <__errno> <== NOT EXECUTED
9784: e3a0300d mov r3, #13 <== NOT EXECUTED
9788: e5803000 str r3, [r0] <== NOT EXECUTED
978c: e3e06000 mvn r6, #0 <== NOT EXECUTED
9790: eafffff7 b 9774 <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 );
9794: e3a004ba mov r0, #-1174405120 ; 0xba000000 <== NOT EXECUTED
9798: e280060d add r0, r0, #13631488 ; 0xd00000 <== NOT EXECUTED
979c: ebfff14f bl 5ce0 <rtems_fatal_error_occurred> <== NOT EXECUTED
/*
* Check for things that should never happen.
*/
if ( jnode->type != IMFS_SYM_LINK )
rtems_fatal_error_occurred (0xABCD0000);
97a0: e3a0032b mov r0, #-1409286144 ; 0xac000000 <== NOT EXECUTED
97a4: e2400833 sub r0, r0, #3342336 ; 0x330000 <== NOT EXECUTED
97a8: ebfff14c bl 5ce0 <rtems_fatal_error_occurred> <== NOT EXECUTED
0000d0ac <IMFS_fchmod>:
int IMFS_fchmod(
rtems_filesystem_location_info_t *loc,
mode_t mode
)
{
d0ac: e92d4070 push {r4, r5, r6, lr}
d0b0: e24dd008 sub sp, sp, #8
IMFS_jnode_t *jnode;
#if defined(RTEMS_POSIX_API)
uid_t st_uid;
#endif
jnode = loc->node_access;
d0b4: e5904000 ldr r4, [r0]
int IMFS_fchmod(
rtems_filesystem_location_info_t *loc,
mode_t mode
)
{
d0b8: e1a06001 mov r6, r1
/*
* Verify I am the owner of the node or the super user.
*/
#if defined(RTEMS_POSIX_API)
st_uid = geteuid();
d0bc: ebfff3ec bl a074 <geteuid>
if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) )
d0c0: e1d453bc ldrh r5, [r4, #60] ; 0x3c
d0c4: e3500000 cmp r0, #0
d0c8: 11550000 cmpne r5, r0
d0cc: 03a05000 moveq r5, #0
d0d0: 13a05001 movne r5, #1
d0d4: 1a00000d bne d110 <IMFS_fchmod+0x64>
/*
* Change only the RWX permissions on the jnode to mode.
*/
jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX);
d0d8: e5943030 ldr r3, [r4, #48] ; 0x30
d0dc: e3c33eff bic r3, r3, #4080 ; 0xff0
d0e0: e3c3300f bic r3, r3, #15
jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX);
d0e4: e1a06a06 lsl r6, r6, #20
d0e8: e1836a26 orr r6, r3, r6, lsr #20
d0ec: e5846030 str r6, [r4, #48] ; 0x30
IMFS_update_ctime( jnode );
d0f0: e1a0000d mov r0, sp
d0f4: e1a01005 mov r1, r5
d0f8: ebffd3da bl 2068 <gettimeofday>
d0fc: e59d3000 ldr r3, [sp]
d100: e5843048 str r3, [r4, #72] ; 0x48
return 0;
d104: e1a00005 mov r0, r5
}
d108: e28dd008 add sp, sp, #8
d10c: e8bd8070 pop {r4, r5, r6, pc}
*/
#if defined(RTEMS_POSIX_API)
st_uid = geteuid();
if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) )
rtems_set_errno_and_return_minus_one( EPERM );
d110: eb00025f bl da94 <__errno> <== NOT EXECUTED
d114: e3a03001 mov r3, #1 <== NOT EXECUTED
d118: e5803000 str r3, [r0] <== NOT EXECUTED
d11c: e3e00000 mvn r0, #0 <== NOT EXECUTED
d120: eafffff8 b d108 <IMFS_fchmod+0x5c> <== NOT EXECUTED
0000241c <IMFS_fifo_close>:
}
int IMFS_fifo_close(
rtems_libio_t *iop
)
{
241c: e92d4070 push {r4, r5, r6, lr}
IMFS_jnode_t *jnode = iop->pathinfo.node_access;
2420: e5905018 ldr r5, [r0, #24]
int err = pipe_release(&JNODE2PIPE(jnode), iop);
2424: e1a01000 mov r1, r0
}
int IMFS_fifo_close(
rtems_libio_t *iop
)
{
2428: e1a04000 mov r4, r0
IMFS_jnode_t *jnode = iop->pathinfo.node_access;
int err = pipe_release(&JNODE2PIPE(jnode), iop);
242c: e2850050 add r0, r5, #80 ; 0x50
2430: eb00252a bl b8e0 <pipe_release>
if (err == 0) {
2434: e2506000 subs r6, r0, #0
2438: 0a000002 beq 2448 <IMFS_fifo_close+0x2c>
iop->flags &= ~LIBIO_FLAGS_OPEN;
IMFS_check_node_remove(jnode);
}
IMFS_FIFO_RETURN(err);
243c: ba000008 blt 2464 <IMFS_fifo_close+0x48> <== NOT EXECUTED
}
2440: e1a00006 mov r0, r6 <== NOT EXECUTED
2444: 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;
2448: e5943014 ldr r3, [r4, #20]
244c: e3c33c01 bic r3, r3, #256 ; 0x100
IMFS_check_node_remove(jnode);
2450: 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;
2454: e5843014 str r3, [r4, #20]
IMFS_check_node_remove(jnode);
2458: eb0001a0 bl 2ae0 <IMFS_check_node_remove>
}
IMFS_FIFO_RETURN(err);
}
245c: e1a00006 mov r0, r6
2460: e8bd8070 pop {r4, r5, r6, pc}
if (err == 0) {
iop->flags &= ~LIBIO_FLAGS_OPEN;
IMFS_check_node_remove(jnode);
}
IMFS_FIFO_RETURN(err);
2464: eb0034ea bl f814 <__errno> <== NOT EXECUTED
2468: e2666000 rsb r6, r6, #0 <== NOT EXECUTED
246c: e5806000 str r6, [r0] <== NOT EXECUTED
2470: e3e06000 mvn r6, #0 <== NOT EXECUTED
2474: eafffff1 b 2440 <IMFS_fifo_close+0x24> <== NOT EXECUTED
00009b08 <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
)
{
9b08: 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;
9b0c: e1a0c000 mov ip, r0
9b10: 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
)
{
9b14: e24dd014 sub sp, sp, #20
9b18: 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;
9b1c: e8bc000f ldm ip!, {r0, r1, r2, r3}
9b20: e1a0600d mov r6, sp
9b24: e8a6000f stmia r6!, {r0, r1, r2, r3}
9b28: e59c2000 ldr r2, [ip]
/*
* Set this to null to indicate that it is being unmounted.
*/
temp_mt_entry->mt_fs_root.node_access = NULL;
9b2c: 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;
9b30: e5862000 str r2, [r6]
/*
* Set this to null to indicate that it is being unmounted.
*/
temp_mt_entry->mt_fs_root.node_access = NULL;
9b34: 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;
9b38: 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 );
9b3c: e1a0000d mov r0, sp
*/
temp_mt_entry->mt_fs_root.node_access = NULL;
do {
next = jnode->Parent;
9b40: e5946008 ldr r6, [r4, #8]
loc.node_access = (void *)jnode;
9b44: e58d4000 str r4, [sp]
IMFS_Set_handlers( &loc );
9b48: ebfffdfb bl 933c <IMFS_Set_handlers>
if ( jnode->type != IMFS_DIRECTORY ) {
9b4c: e594304c ldr r3, [r4, #76] ; 0x4c
9b50: e3530001 cmp r3, #1
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
9b54: e2842054 add r2, r4, #84 ; 0x54
9b58: 1a000010 bne 9ba0 <IMFS_fsunmount+0x98>
result = IMFS_unlink( NULL, &loc );
if (result != 0)
return -1;
jnode = next;
} else if ( jnode_has_no_children( jnode ) ) {
9b5c: e5943050 ldr r3, [r4, #80] ; 0x50
9b60: e1530002 cmp r3, r2
9b64: 0a000014 beq 9bbc <IMFS_fsunmount+0xb4>
result = IMFS_unlink( NULL, &loc );
if (result != 0)
return -1;
jnode = next;
}
if ( jnode != NULL ) {
9b68: e3540000 cmp r4, #0
9b6c: 0a000008 beq 9b94 <IMFS_fsunmount+0x8c>
if ( jnode->type == IMFS_DIRECTORY ) {
9b70: e594304c ldr r3, [r4, #76] ; 0x4c
9b74: e3530001 cmp r3, #1
9b78: 1affffef bne 9b3c <IMFS_fsunmount+0x34>
if ( jnode_has_children( jnode ) )
9b7c: e5943050 ldr r3, [r4, #80] ; 0x50
9b80: e2842054 add r2, r4, #84 ; 0x54
9b84: e1530002 cmp r3, r2
9b88: 0affffeb beq 9b3c <IMFS_fsunmount+0x34>
jnode = jnode_get_first_child( jnode );
}
}
} while (jnode != NULL);
9b8c: e2534000 subs r4, r3, #0
9b90: 1affffe9 bne 9b3c <IMFS_fsunmount+0x34>
return 0;
9b94: e1a00004 mov r0, r4
}
9b98: e28dd014 add sp, sp, #20
9b9c: 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 );
9ba0: e1a0100d mov r1, sp
9ba4: e3a00000 mov r0, #0
9ba8: ebffdfa8 bl 1a50 <IMFS_unlink>
if (result != 0)
9bac: e3500000 cmp r0, #0
9bb0: 1a000006 bne 9bd0 <IMFS_fsunmount+0xc8>
jnode = next;
} else if ( jnode_has_no_children( jnode ) ) {
result = IMFS_unlink( NULL, &loc );
if (result != 0)
return -1;
jnode = next;
9bb4: e1a04006 mov r4, r6
9bb8: eaffffea b 9b68 <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 );
9bbc: e3a00000 mov r0, #0
9bc0: e1a0100d mov r1, sp
9bc4: ebffdfa1 bl 1a50 <IMFS_unlink>
if (result != 0)
9bc8: e3500000 cmp r0, #0
9bcc: 0afffff8 beq 9bb4 <IMFS_fsunmount+0xac>
return -1;
9bd0: e3e00000 mvn r0, #0 <== NOT EXECUTED
9bd4: eaffffef b 9b98 <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: eb001f26 bl 92fc <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: eb0030eb bl da94 <__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: eb0034c9 bl ea54 <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: eb00214b bl 9c74 <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: eb001e94 bl 91b8 <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: eb0030bb bl da94 <__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: eb0030b6 bl da94 <__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
0000c628 <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 )
c628: e59f3128 ldr r3, [pc, #296] ; c758 <IMFS_memfile_extend+0x130>
MEMFILE_STATIC int IMFS_memfile_extend(
IMFS_jnode_t *the_jnode,
off_t new_length
)
{
c62c: 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 )
c630: e593b000 ldr fp, [r3]
c634: e1a0312b lsr r3, fp, #2
c638: e02c3393 mla ip, r3, r3, r3
c63c: e023339c mla r3, ip, r3, r3
MEMFILE_STATIC int IMFS_memfile_extend(
IMFS_jnode_t *the_jnode,
off_t new_length
)
{
c640: 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 )
c644: e3a02000 mov r2, #0
c648: e2433001 sub r3, r3, #1
c64c: e1520006 cmp r2, r6
MEMFILE_STATIC int IMFS_memfile_extend(
IMFS_jnode_t *the_jnode,
off_t new_length
)
{
c650: e24dd004 sub sp, sp, #4
c654: e1a04000 mov r4, r0
c658: 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 )
c65c: e003039b mul r3, fp, r3
c660: da000034 ble c738 <IMFS_memfile_extend+0x110>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( new_length <= the_jnode->info.file.size )
c664: e5947054 ldr r7, [r4, #84] ; 0x54
c668: e1560007 cmp r6, r7
c66c: e594a050 ldr sl, [r4, #80] ; 0x50
c670: da000027 ble c714 <IMFS_memfile_extend+0xec>
/*
* Calculate the number of range of blocks to allocate
*/
new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK;
c674: e1a0cfcb asr ip, fp, #31
c678: e1a0300c mov r3, ip
c67c: e1a0200b mov r2, fp
c680: e1a00008 mov r0, r8
c684: e1a01006 mov r1, r6
c688: e58dc000 str ip, [sp]
c68c: eb001329 bl 11338 <__divdi3>
old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK;
c690: e59dc000 ldr ip, [sp]
/*
* Calculate the number of range of blocks to allocate
*/
new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK;
c694: e1a05000 mov r5, r0
old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK;
c698: e1a01007 mov r1, r7
c69c: e1a0000a mov r0, sl
c6a0: e1a0200b mov r2, fp
c6a4: e1a0300c mov r3, ip
c6a8: eb001322 bl 11338 <__divdi3>
/*
* Now allocate each of those blocks.
*/
for ( block=old_blocks ; block<=new_blocks ; block++ ) {
c6ac: 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;
c6b0: e1a0a000 mov sl, r0
/*
* Now allocate each of those blocks.
*/
for ( block=old_blocks ; block<=new_blocks ; block++ ) {
c6b4: 3a00001b bcc c728 <IMFS_memfile_extend+0x100>
c6b8: e1a07000 mov r7, r0
c6bc: ea000002 b c6cc <IMFS_memfile_extend+0xa4>
c6c0: e2877001 add r7, r7, #1
c6c4: e1550007 cmp r5, r7
c6c8: 3a000016 bcc c728 <IMFS_memfile_extend+0x100>
if ( IMFS_memfile_addblock( the_jnode, block ) ) {
c6cc: e1a01007 mov r1, r7
c6d0: e1a00004 mov r0, r4
c6d4: ebffff4c bl c40c <IMFS_memfile_addblock>
c6d8: e3500000 cmp r0, #0
c6dc: 0afffff7 beq c6c0 <IMFS_memfile_extend+0x98>
c6e0: ea000003 b c6f4 <IMFS_memfile_extend+0xcc> <== NOT EXECUTED
for ( ; block>=old_blocks ; block-- ) {
IMFS_memfile_remove_block( the_jnode, block );
c6e4: e1a01007 mov r1, r7 <== NOT EXECUTED
c6e8: 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-- ) {
c6ec: e2477001 sub r7, r7, #1 <== NOT EXECUTED
IMFS_memfile_remove_block( the_jnode, block );
c6f0: ebffffc2 bl c600 <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-- ) {
c6f4: e15a0007 cmp sl, r7 <== NOT EXECUTED
c6f8: 9afffff9 bls c6e4 <IMFS_memfile_extend+0xbc> <== NOT EXECUTED
IMFS_memfile_remove_block( the_jnode, block );
}
rtems_set_errno_and_return_minus_one( ENOSPC );
c6fc: eb0004e4 bl da94 <__errno> <== NOT EXECUTED
c700: e3a0301c mov r3, #28 <== NOT EXECUTED
c704: e5803000 str r3, [r0] <== NOT EXECUTED
c708: e3e00000 mvn r0, #0 <== NOT EXECUTED
* Set the new length of the file.
*/
the_jnode->info.file.size = new_length;
return 0;
}
c70c: e28dd004 add sp, sp, #4
c710: 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 )
c714: 1a000001 bne c720 <IMFS_memfile_extend+0xf8>
c718: e158000a cmp r8, sl
c71c: 8affffd4 bhi c674 <IMFS_memfile_extend+0x4c>
return 0;
c720: e3a00000 mov r0, #0
c724: eafffff8 b c70c <IMFS_memfile_extend+0xe4>
/*
* Set the new length of the file.
*/
the_jnode->info.file.size = new_length;
c728: e5848050 str r8, [r4, #80] ; 0x50
c72c: e5846054 str r6, [r4, #84] ; 0x54
return 0;
c730: e3a00000 mov r0, #0
c734: eafffff4 b c70c <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 )
c738: 1a000001 bne c744 <IMFS_memfile_extend+0x11c>
c73c: e1530001 cmp r3, r1
c740: 8affffc7 bhi c664 <IMFS_memfile_extend+0x3c>
rtems_set_errno_and_return_minus_one( EINVAL );
c744: eb0004d2 bl da94 <__errno>
c748: e3a03016 mov r3, #22
c74c: e5803000 str r3, [r0]
c750: e3e00000 mvn r0, #0
c754: eaffffec b c70c <IMFS_memfile_extend+0xe4>
0000bfa8 <IMFS_memfile_get_block_pointer>:
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
bfa8: e59f31f8 ldr r3, [pc, #504] ; c1a8 <IMFS_memfile_get_block_pointer+0x200>
#endif
IMFS_jnode_t *the_jnode,
unsigned int block,
int malloc_it
)
{
bfac: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
bfb0: e5934000 ldr r4, [r3]
bfb4: e1a04124 lsr r4, r4, #2
bfb8: e2443001 sub r3, r4, #1
bfbc: e1510003 cmp r1, r3
#endif
IMFS_jnode_t *the_jnode,
unsigned int block,
int malloc_it
)
{
bfc0: e24dd004 sub sp, sp, #4
bfc4: e1a05000 mov r5, r0
bfc8: e1a06002 mov r6, r2
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
bfcc: 8a000007 bhi bff0 <IMFS_memfile_get_block_pointer+0x48>
p = info->indirect;
if ( malloc_it ) {
bfd0: e3520000 cmp r2, #0
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
p = info->indirect;
bfd4: e5900058 ldr r0, [r0, #88] ; 0x58
if ( malloc_it ) {
bfd8: 0a00001c beq c050 <IMFS_memfile_get_block_pointer+0xa8>
if ( !p ) {
bfdc: e3500000 cmp r0, #0
bfe0: 0a000041 beq c0ec <IMFS_memfile_get_block_pointer+0x144>
}
if ( !p )
return 0;
return &info->indirect[ my_block ];
bfe4: e0800101 add r0, r0, r1, lsl #2
/*
* This means the requested block number is out of range.
*/
return 0;
}
bfe8: e28dd004 add sp, sp, #4
bfec: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
/*
* Is the block number in the doubly indirect portion?
*/
if ( my_block <= LAST_DOUBLY_INDIRECT ) {
bff0: e0274494 mla r7, r4, r4, r4
bff4: e2473001 sub r3, r7, #1
bff8: e1510003 cmp r1, r3
bffc: 8a000016 bhi c05c <IMFS_memfile_get_block_pointer+0xb4>
#if 0
fprintf(stdout, "(d %d) ", block );
fflush(stdout);
#endif
my_block -= FIRST_DOUBLY_INDIRECT;
c000: e0647001 rsb r7, r4, r1
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
c004: e1a00007 mov r0, r7
c008: e1a01004 mov r1, r4
c00c: eb001495 bl 11268 <__umodsi3>
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
c010: e1a01004 mov r1, r4
fflush(stdout);
#endif
my_block -= FIRST_DOUBLY_INDIRECT;
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
c014: e1a08000 mov r8, r0
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
c018: e1a00007 mov r0, r7
c01c: eb00144b bl 11150 <__aeabi_uidiv>
p = info->doubly_indirect;
if ( malloc_it ) {
c020: e3560000 cmp r6, #0
#endif
my_block -= FIRST_DOUBLY_INDIRECT;
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
c024: e1a04000 mov r4, r0
p = info->doubly_indirect;
c028: e595305c ldr r3, [r5, #92] ; 0x5c
if ( malloc_it ) {
c02c: 0a00003f beq c130 <IMFS_memfile_get_block_pointer+0x188>
if ( !p ) {
c030: e3530000 cmp r3, #0
c034: 0a000045 beq c150 <IMFS_memfile_get_block_pointer+0x1a8>
if ( !p )
return 0;
info->doubly_indirect = p;
}
p1 = (block_p *)p[ doubly ];
c038: e7930104 ldr r0, [r3, r4, lsl #2]
if ( !p1 ) {
c03c: e3500000 cmp r0, #0
if ( !p )
return 0;
info->doubly_indirect = p;
}
p1 = (block_p *)p[ doubly ];
c040: e0834104 add r4, r3, r4, lsl #2
if ( !p1 ) {
c044: 0a00002f beq c108 <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 ];
c048: e0800108 add r0, r0, r8, lsl #2
c04c: eaffffe5 b bfe8 <IMFS_memfile_get_block_pointer+0x40>
info->indirect = p;
}
return &info->indirect[ my_block ];
}
if ( !p )
c050: e3500000 cmp r0, #0
c054: 1affffe2 bne bfe4 <IMFS_memfile_get_block_pointer+0x3c>
c058: eaffffe2 b bfe8 <IMFS_memfile_get_block_pointer+0x40> <== NOT EXECUTED
#endif
/*
* Is the block number in the triply indirect portion?
*/
if ( my_block <= LAST_TRIPLY_INDIRECT ) {
c05c: e0234497 mla r3, r7, r4, r4
c060: e2433001 sub r3, r3, #1
c064: e1510003 cmp r1, r3
/*
* This means the requested block number is out of range.
*/
return 0;
c068: 83a00000 movhi r0, #0
#endif
/*
* Is the block number in the triply indirect portion?
*/
if ( my_block <= LAST_TRIPLY_INDIRECT ) {
c06c: 8affffdd bhi bfe8 <IMFS_memfile_get_block_pointer+0x40>
my_block -= FIRST_TRIPLY_INDIRECT;
c070: e0677001 rsb r7, r7, r1
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
c074: e1a00007 mov r0, r7
c078: e1a01004 mov r1, r4
c07c: eb001479 bl 11268 <__umodsi3>
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
c080: e1a01004 mov r1, r4
*/
if ( my_block <= LAST_TRIPLY_INDIRECT ) {
my_block -= FIRST_TRIPLY_INDIRECT;
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
c084: e1a0a000 mov sl, r0
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
c088: e1a00007 mov r0, r7
c08c: eb00142f bl 11150 <__aeabi_uidiv>
triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS;
c090: 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;
c094: e1a08000 mov r8, r0
triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS;
c098: eb00142c bl 11150 <__aeabi_uidiv>
doubly %= IMFS_MEMFILE_BLOCK_SLOTS;
c09c: 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;
c0a0: e1a07000 mov r7, r0
doubly %= IMFS_MEMFILE_BLOCK_SLOTS;
c0a4: e1a00008 mov r0, r8
c0a8: eb00146e bl 11268 <__umodsi3>
p = info->triply_indirect;
if ( malloc_it ) {
c0ac: 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;
c0b0: e1a04000 mov r4, r0
p = info->triply_indirect;
c0b4: e5950060 ldr r0, [r5, #96] ; 0x60
if ( malloc_it ) {
c0b8: 0a000029 beq c164 <IMFS_memfile_get_block_pointer+0x1bc>
if ( !p ) {
c0bc: e3500000 cmp r0, #0
c0c0: 0a000033 beq c194 <IMFS_memfile_get_block_pointer+0x1ec>
if ( !p )
return 0;
info->triply_indirect = p;
}
p1 = (block_p *) p[ triply ];
c0c4: e7903107 ldr r3, [r0, r7, lsl #2]
if ( !p1 ) {
c0c8: e3530000 cmp r3, #0
if ( !p )
return 0;
info->triply_indirect = p;
}
p1 = (block_p *) p[ triply ];
c0cc: e0807107 add r7, r0, r7, lsl #2
if ( !p1 ) {
c0d0: 0a00002a beq c180 <IMFS_memfile_get_block_pointer+0x1d8>
if ( !p1 )
return 0;
p[ triply ] = (block_p) p1;
}
p2 = (block_p *)p1[ doubly ];
c0d4: e7930104 ldr r0, [r3, r4, lsl #2]
if ( !p2 ) {
c0d8: e3500000 cmp r0, #0
if ( !p1 )
return 0;
p[ triply ] = (block_p) p1;
}
p2 = (block_p *)p1[ doubly ];
c0dc: e0834104 add r4, r3, r4, lsl #2
if ( !p2 ) {
c0e0: 0a00000d beq c11c <IMFS_memfile_get_block_pointer+0x174>
p2 = (block_p *)p1[ doubly ];
if ( !p )
return 0;
return (block_p *)&p2[ singly ];
c0e4: e080010a add r0, r0, sl, lsl #2
c0e8: eaffffbe b bfe8 <IMFS_memfile_get_block_pointer+0x40>
p = info->indirect;
if ( malloc_it ) {
if ( !p ) {
p = memfile_alloc_block();
c0ec: e58d1000 str r1, [sp]
c0f0: ebffff9f bl bf74 <memfile_alloc_block>
if ( !p )
c0f4: e3500000 cmp r0, #0
c0f8: e59d1000 ldr r1, [sp]
return 0;
info->indirect = p;
c0fc: 15850058 strne r0, [r5, #88] ; 0x58
if ( malloc_it ) {
if ( !p ) {
p = memfile_alloc_block();
if ( !p )
c100: 1affffb7 bne bfe4 <IMFS_memfile_get_block_pointer+0x3c>
c104: eaffffb7 b bfe8 <IMFS_memfile_get_block_pointer+0x40> <== NOT EXECUTED
info->doubly_indirect = p;
}
p1 = (block_p *)p[ doubly ];
if ( !p1 ) {
p1 = memfile_alloc_block();
c108: ebffff99 bl bf74 <memfile_alloc_block>
if ( !p1 )
c10c: e3500000 cmp r0, #0
return 0;
p[ doubly ] = (block_p) p1;
c110: 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 ];
c114: 10800108 addne r0, r0, r8, lsl #2
c118: eaffffb2 b bfe8 <IMFS_memfile_get_block_pointer+0x40>
p[ triply ] = (block_p) p1;
}
p2 = (block_p *)p1[ doubly ];
if ( !p2 ) {
p2 = memfile_alloc_block();
c11c: ebffff94 bl bf74 <memfile_alloc_block>
if ( !p2 )
c120: e3500000 cmp r0, #0
return 0;
p1[ doubly ] = (block_p) p2;
c124: 15840000 strne r0, [r4]
p2 = (block_p *)p1[ doubly ];
if ( !p )
return 0;
return (block_p *)&p2[ singly ];
c128: 1080010a addne r0, r0, sl, lsl #2
c12c: eaffffad b bfe8 <IMFS_memfile_get_block_pointer+0x40>
}
return (block_p *)&p1[ singly ];
}
if ( !p )
c130: e3530000 cmp r3, #0
c134: 1a000001 bne c140 <IMFS_memfile_get_block_pointer+0x198>
p1 = (block_p *) p[ triply ];
if ( !p1 ) {
p1 = memfile_alloc_block();
if ( !p1 )
return 0;
c138: e1a00003 mov r0, r3 <== NOT EXECUTED
c13c: eaffffa9 b bfe8 <IMFS_memfile_get_block_pointer+0x40> <== NOT EXECUTED
}
if ( !p )
return 0;
p = (block_p *)p[ doubly ];
c140: e7930100 ldr r0, [r3, r0, lsl #2]
if ( !p )
c144: 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 ];
c148: 10800108 addne r0, r0, r8, lsl #2
c14c: eaffffa5 b bfe8 <IMFS_memfile_get_block_pointer+0x40>
p = info->doubly_indirect;
if ( malloc_it ) {
if ( !p ) {
p = memfile_alloc_block();
c150: ebffff87 bl bf74 <memfile_alloc_block>
if ( !p )
c154: e2503000 subs r3, r0, #0
c158: 0afffff6 beq c138 <IMFS_memfile_get_block_pointer+0x190>
return 0;
info->doubly_indirect = p;
c15c: e585305c str r3, [r5, #92] ; 0x5c
c160: eaffffb4 b c038 <IMFS_memfile_get_block_pointer+0x90>
p1[ doubly ] = (block_p) p2;
}
return (block_p *)&p2[ singly ];
}
if ( !p )
c164: e3500000 cmp r0, #0
c168: 0affff9e beq bfe8 <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 ];
c16c: e7900107 ldr r0, [r0, r7, lsl #2]
if ( !p1 )
c170: e3500000 cmp r0, #0
p2 = (block_p *)p1[ doubly ];
if ( !p )
return 0;
return (block_p *)&p2[ singly ];
c174: 17900104 ldrne r0, [r0, r4, lsl #2]
c178: 1080010a addne r0, r0, sl, lsl #2
c17c: eaffff99 b bfe8 <IMFS_memfile_get_block_pointer+0x40>
info->triply_indirect = p;
}
p1 = (block_p *) p[ triply ];
if ( !p1 ) {
p1 = memfile_alloc_block();
c180: ebffff7b bl bf74 <memfile_alloc_block>
if ( !p1 )
c184: e2503000 subs r3, r0, #0
c188: 0affffea beq c138 <IMFS_memfile_get_block_pointer+0x190>
return 0;
p[ triply ] = (block_p) p1;
c18c: e5873000 str r3, [r7]
c190: eaffffcf b c0d4 <IMFS_memfile_get_block_pointer+0x12c>
p = info->triply_indirect;
if ( malloc_it ) {
if ( !p ) {
p = memfile_alloc_block();
c194: ebffff76 bl bf74 <memfile_alloc_block>
if ( !p )
c198: e3500000 cmp r0, #0
c19c: 0affff91 beq bfe8 <IMFS_memfile_get_block_pointer+0x40>
return 0;
info->triply_indirect = p;
c1a0: e5850060 str r0, [r5, #96] ; 0x60
c1a4: eaffffc6 b c0c4 <IMFS_memfile_get_block_pointer+0x11c>
0000c1ac <IMFS_memfile_read>:
IMFS_jnode_t *the_jnode,
off_t start,
unsigned char *destination,
unsigned int length
)
{
c1ac: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
/*
* Error checks on arguments
*/
if ( !dest )
c1b0: e253b000 subs fp, r3, #0
IMFS_jnode_t *the_jnode,
off_t start,
unsigned char *destination,
unsigned int length
)
{
c1b4: e24dd014 sub sp, sp, #20
c1b8: e1a09000 mov r9, r0
c1bc: e1a07001 mov r7, r1
c1c0: e1a08002 mov r8, r2
c1c4: e59d5038 ldr r5, [sp, #56] ; 0x38
/*
* Error checks on arguments
*/
if ( !dest )
c1c8: 0a00007c beq c3c0 <IMFS_memfile_read+0x214>
/*
* If there is nothing to read, then quick exit.
*/
my_length = length;
if ( !my_length )
c1cc: e3550000 cmp r5, #0
c1d0: 0a00007a beq c3c0 <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) {
c1d4: e590304c ldr r3, [r0, #76] ; 0x4c
c1d8: e3530006 cmp r3, #6
c1dc: 0a00005c beq c354 <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 )
c1e0: 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;
c1e4: e1a03001 mov r3, r1
if ( last_byte > the_jnode->info.file.size )
c1e8: e3a01000 mov r1, #0
c1ec: e1510002 cmp r1, r2
c1f0: 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;
c1f4: e0851007 add r1, r5, r7
if ( last_byte > the_jnode->info.file.size )
c1f8: da00003d ble c2f4 <IMFS_memfile_read+0x148>
my_length = the_jnode->info.file.size - start;
c1fc: e0635002 rsb r5, r3, r2
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
c200: e59f61cc ldr r6, [pc, #460] ; c3d4 <IMFS_memfile_read+0x228>
c204: e5964000 ldr r4, [r6]
c208: e1a00007 mov r0, r7
c20c: e1a02004 mov r2, r4
c210: e1a03fc2 asr r3, r2, #31
c214: e1a01008 mov r1, r8
c218: e98d000c stmib sp, {r2, r3}
c21c: eb00157f bl 11820 <__moddi3>
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
c220: e1a01008 mov r1, r8
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
c224: e1a0a000 mov sl, r0
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
c228: e99d000c ldmib sp, {r2, r3}
c22c: e1a00007 mov r0, r7
c230: eb001440 bl 11338 <__divdi3>
if ( start_offset ) {
c234: 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;
c238: e1a07000 mov r7, r0
if ( start_offset ) {
c23c: 01a0800b moveq r8, fp
c240: 0a000014 beq c298 <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 );
c244: e1a00009 mov r0, r9
c248: e1a01007 mov r1, r7
c24c: e3a02000 mov r2, #0
c250: ebffff54 bl bfa8 <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
c254: e3500000 cmp r0, #0
c258: 0a000023 beq c2ec <IMFS_memfile_read+0x140>
return copied;
memcpy( dest, &(*block_ptr)[ start_offset ], to_copy );
c25c: 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;
c260: e06a3004 rsb r3, sl, r4
c264: e1550003 cmp r5, r3
c268: 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 );
c26c: e081100a add r1, r1, sl
c270: e1a02003 mov r2, r3
c274: e1a0000b mov r0, fp
c278: e58d3000 str r3, [sp]
c27c: eb000832 bl e34c <memcpy>
dest += to_copy;
c280: e59d3000 ldr r3, [sp]
block++;
my_length -= to_copy;
c284: 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;
c288: e08b8003 add r8, fp, r3
block++;
c28c: e2877001 add r7, r7, #1
my_length -= to_copy;
c290: e0635005 rsb r5, r3, r5
copied += to_copy;
c294: 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 ) {
c298: e1550004 cmp r5, r4
c29c: 2a000008 bcs c2c4 <IMFS_memfile_read+0x118>
c2a0: ea000017 b c304 <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 );
c2a4: e5931000 ldr r1, [r3]
c2a8: eb000827 bl e34c <memcpy>
/*
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
c2ac: e5963000 ldr r3, [r6]
c2b0: 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;
c2b4: e0888004 add r8, r8, r4
block++;
c2b8: e2877001 add r7, r7, #1
my_length -= to_copy;
copied += to_copy;
c2bc: 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 ) {
c2c0: 8a00000f bhi c304 <IMFS_memfile_read+0x158>
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
c2c4: e3a02000 mov r2, #0
c2c8: e1a01007 mov r1, r7
c2cc: e1a00009 mov r0, r9
c2d0: ebffff34 bl bfa8 <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
c2d4: e2503000 subs r3, r0, #0
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], to_copy );
c2d8: e1a02004 mov r2, r4
dest += to_copy;
block++;
my_length -= to_copy;
c2dc: 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 );
c2e0: 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 )
c2e4: 1affffee bne c2a4 <IMFS_memfile_read+0xf8>
#endif
if ( my_length ) {
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
return copied;
c2e8: e1a0000a mov r0, sl <== NOT EXECUTED
}
IMFS_update_atime( the_jnode );
return copied;
}
c2ec: e28dd014 add sp, sp, #20
c2f0: 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 )
c2f4: 1affffc1 bne c200 <IMFS_memfile_read+0x54>
c2f8: e1510002 cmp r1, r2
c2fc: 9affffbf bls c200 <IMFS_memfile_read+0x54>
c300: eaffffbd b c1fc <IMFS_memfile_read+0x50>
#if defined(RTEMS_DEBUG)
assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK );
#endif
if ( my_length ) {
c304: e3550000 cmp r5, #0
c308: 0a00000a beq c338 <IMFS_memfile_read+0x18c>
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
c30c: e1a00009 mov r0, r9
c310: e1a01007 mov r1, r7
c314: e3a02000 mov r2, #0
c318: ebffff22 bl bfa8 <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
c31c: e2503000 subs r3, r0, #0
c320: 0afffff0 beq c2e8 <IMFS_memfile_read+0x13c>
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], my_length );
c324: e1a00008 mov r0, r8
c328: e5931000 ldr r1, [r3]
c32c: e1a02005 mov r2, r5
c330: eb000805 bl e34c <memcpy>
copied += my_length;
c334: e08aa005 add sl, sl, r5
}
IMFS_update_atime( the_jnode );
c338: e28d000c add r0, sp, #12
c33c: e3a01000 mov r1, #0
c340: ebffd748 bl 2068 <gettimeofday>
c344: e59d300c ldr r3, [sp, #12]
return copied;
c348: e1a0000a mov r0, sl
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], my_length );
copied += my_length;
}
IMFS_update_atime( the_jnode );
c34c: e5893040 str r3, [r9, #64] ; 0x40
return copied;
c350: eaffffe5 b c2ec <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))
c354: e2804050 add r4, r0, #80 ; 0x50
c358: e8940018 ldm r4, {r3, r4}
c35c: e1a00003 mov r0, r3
c360: e1a01004 mov r1, r4
c364: e3a02000 mov r2, #0
c368: e0500007 subs r0, r0, r7
c36c: e0c11008 sbc r1, r1, r8
c370: 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;
c374: e5992058 ldr r2, [r9, #88] ; 0x58
if (my_length > (the_jnode->info.linearfile.size - start))
c378: da00000b ble c3ac <IMFS_memfile_read+0x200>
my_length = the_jnode->info.linearfile.size - start;
c37c: e067a003 rsb sl, r7, r3
memcpy(dest, &file_ptr[start], my_length);
c380: e0821007 add r1, r2, r7
c384: e1a0000b mov r0, fp
c388: e1a0200a mov r2, sl
c38c: eb0007ee bl e34c <memcpy>
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], my_length );
copied += my_length;
}
IMFS_update_atime( the_jnode );
c390: e28d000c add r0, sp, #12
c394: e3a01000 mov r1, #0
c398: ebffd732 bl 2068 <gettimeofday>
c39c: e59d300c ldr r3, [sp, #12]
return copied;
c3a0: e1a0000a mov r0, sl
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], my_length );
copied += my_length;
}
IMFS_update_atime( the_jnode );
c3a4: e5893040 str r3, [r9, #64] ; 0x40
c3a8: eaffffcf b c2ec <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))
c3ac: 1a000001 bne c3b8 <IMFS_memfile_read+0x20c>
c3b0: e1550000 cmp r5, r0
c3b4: 8afffff0 bhi c37c <IMFS_memfile_read+0x1d0>
c3b8: e1a0a005 mov sl, r5 <== NOT EXECUTED
c3bc: eaffffef b c380 <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 );
c3c0: eb0005b3 bl da94 <__errno> <== NOT EXECUTED
c3c4: e3a03016 mov r3, #22 <== NOT EXECUTED
c3c8: e5803000 str r3, [r0] <== NOT EXECUTED
c3cc: e3e00000 mvn r0, #0 <== NOT EXECUTED
c3d0: eaffffc5 b c2ec <IMFS_memfile_read+0x140> <== NOT EXECUTED
0000c4c0 <IMFS_memfile_remove>:
*/
int IMFS_memfile_remove(
IMFS_jnode_t *the_jnode
)
{
c4c0: 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;
c4c4: e59f6130 ldr r6, [pc, #304] ; c5fc <IMFS_memfile_remove+0x13c>
* + triply indirect
*/
info = &the_jnode->info.file;
if ( info->indirect ) {
c4c8: 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;
c4cc: e5967000 ldr r7, [r6]
* + triply indirect
*/
info = &the_jnode->info.file;
if ( info->indirect ) {
c4d0: e3530000 cmp r3, #0
*/
int IMFS_memfile_remove(
IMFS_jnode_t *the_jnode
)
{
c4d4: 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;
c4d8: e1a07127 lsr r7, r7, #2
*/
info = &the_jnode->info.file;
if ( info->indirect ) {
memfile_free_blocks_in_table( &info->indirect, to_free );
c4dc: 12800058 addne r0, r0, #88 ; 0x58
c4e0: 11a01007 movne r1, r7
c4e4: 1bffffde blne c464 <memfile_free_blocks_in_table>
}
if ( info->doubly_indirect ) {
c4e8: e59a305c ldr r3, [sl, #92] ; 0x5c
c4ec: e3530000 cmp r3, #0
c4f0: 0a000014 beq c548 <IMFS_memfile_remove+0x88>
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
c4f4: e5962000 ldr r2, [r6] <== NOT EXECUTED
c4f8: e1b02122 lsrs r2, r2, #2 <== NOT EXECUTED
c4fc: 0a00000e beq c53c <IMFS_memfile_remove+0x7c> <== NOT EXECUTED
c500: e3a02000 mov r2, #0 <== NOT EXECUTED
c504: e1a04002 mov r4, r2 <== NOT EXECUTED
c508: ea000000 b c510 <IMFS_memfile_remove+0x50> <== NOT EXECUTED
c50c: e59a305c ldr r3, [sl, #92] ; 0x5c <== NOT EXECUTED
if ( info->doubly_indirect[i] ) {
c510: e7931102 ldr r1, [r3, r2, lsl #2] <== NOT EXECUTED
c514: e1a02102 lsl r2, r2, #2 <== NOT EXECUTED
c518: 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++ ) {
c51c: e2844001 add r4, r4, #1 <== NOT EXECUTED
if ( info->doubly_indirect[i] ) {
memfile_free_blocks_in_table(
c520: e1a01007 mov r1, r7 <== NOT EXECUTED
c524: e0830002 add r0, r3, r2 <== NOT EXECUTED
c528: 1bffffcd blne c464 <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++ ) {
c52c: e5963000 ldr r3, [r6] <== NOT EXECUTED
c530: e1540123 cmp r4, r3, lsr #2 <== NOT EXECUTED
c534: e1a02004 mov r2, r4 <== NOT EXECUTED
c538: 3afffff3 bcc c50c <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 );
c53c: e28a005c add r0, sl, #92 ; 0x5c <== NOT EXECUTED
c540: e1a01007 mov r1, r7 <== NOT EXECUTED
c544: ebffffc6 bl c464 <memfile_free_blocks_in_table> <== NOT EXECUTED
}
if ( info->triply_indirect ) {
c548: e59a0060 ldr r0, [sl, #96] ; 0x60
c54c: e3500000 cmp r0, #0
c550: 0a000027 beq c5f4 <IMFS_memfile_remove+0x134>
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
c554: e5963000 ldr r3, [r6] <== NOT EXECUTED
c558: e1b03123 lsrs r3, r3, #2 <== NOT EXECUTED
c55c: 0a000021 beq c5e8 <IMFS_memfile_remove+0x128> <== NOT EXECUTED
p = (block_p *) info->triply_indirect[i];
c560: e5905000 ldr r5, [r0] <== NOT EXECUTED
if ( !p ) /* ensure we have a valid pointer */
c564: 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];
c568: 13a09000 movne r9, #0 <== NOT EXECUTED
if ( !p ) /* ensure we have a valid pointer */
c56c: 11a08009 movne r8, r9 <== NOT EXECUTED
c570: 0a00001c beq c5e8 <IMFS_memfile_remove+0x128> <== NOT EXECUTED
break;
for ( j=0 ; j<IMFS_MEMFILE_BLOCK_SLOTS ; j++ ) {
c574: e3530000 cmp r3, #0 <== NOT EXECUTED
c578: 0a00000d beq c5b4 <IMFS_memfile_remove+0xf4> <== NOT EXECUTED
c57c: e3a00000 mov r0, #0 <== NOT EXECUTED
c580: e1a04000 mov r4, r0 <== NOT EXECUTED
if ( p[j] ) {
c584: e7953100 ldr r3, [r5, r0, lsl #2] <== NOT EXECUTED
c588: e1a00100 lsl r0, r0, #2 <== NOT EXECUTED
c58c: 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++ ) {
c590: e2844001 add r4, r4, #1 <== NOT EXECUTED
if ( p[j] ) {
memfile_free_blocks_in_table( (block_p **)&p[j], to_free);
c594: e1a01007 mov r1, r7 <== NOT EXECUTED
c598: e0850000 add r0, r5, r0 <== NOT EXECUTED
c59c: 1bffffb0 blne c464 <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++ ) {
c5a0: e5963000 ldr r3, [r6] <== NOT EXECUTED
c5a4: e1540123 cmp r4, r3, lsr #2 <== NOT EXECUTED
c5a8: e1a00004 mov r0, r4 <== NOT EXECUTED
c5ac: 3afffff4 bcc c584 <IMFS_memfile_remove+0xc4> <== NOT EXECUTED
c5b0: 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(
c5b4: e0800009 add r0, r0, r9 <== NOT EXECUTED
c5b8: e1a01007 mov r1, r7 <== NOT EXECUTED
c5bc: ebffffa8 bl c464 <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++ ) {
c5c0: e5963000 ldr r3, [r6] <== NOT EXECUTED
c5c4: e2888001 add r8, r8, #1 <== NOT EXECUTED
c5c8: e1a03123 lsr r3, r3, #2 <== NOT EXECUTED
c5cc: e1530008 cmp r3, r8 <== NOT EXECUTED
c5d0: 9a000004 bls c5e8 <IMFS_memfile_remove+0x128> <== NOT EXECUTED
p = (block_p *) info->triply_indirect[i];
c5d4: e59a0060 ldr r0, [sl, #96] ; 0x60 <== NOT EXECUTED
c5d8: e7905108 ldr r5, [r0, r8, lsl #2] <== NOT EXECUTED
if ( !p ) /* ensure we have a valid pointer */
c5dc: e3550000 cmp r5, #0 <== NOT EXECUTED
c5e0: e1a09108 lsl r9, r8, #2 <== NOT EXECUTED
c5e4: 1affffe2 bne c574 <IMFS_memfile_remove+0xb4> <== NOT EXECUTED
}
}
memfile_free_blocks_in_table(
(block_p **)&info->triply_indirect[i], to_free );
}
memfile_free_blocks_in_table(
c5e8: e28a0060 add r0, sl, #96 ; 0x60 <== NOT EXECUTED
c5ec: e1a01007 mov r1, r7 <== NOT EXECUTED
c5f0: ebffff9b bl c464 <memfile_free_blocks_in_table> <== NOT EXECUTED
(block_p **)&info->triply_indirect, to_free );
}
return 0;
}
c5f4: e3a00000 mov r0, #0
c5f8: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
0000c600 <IMFS_memfile_remove_block>:
MEMFILE_STATIC int IMFS_memfile_remove_block(
IMFS_jnode_t *the_jnode,
unsigned int block
)
{
c600: 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 );
c604: e3a02000 mov r2, #0 <== NOT EXECUTED
c608: ebfffe66 bl bfa8 <IMFS_memfile_get_block_pointer> <== NOT EXECUTED
#if defined(RTEMS_DEBUG)
assert( block_ptr );
#endif
if ( block_ptr ) {
c60c: e2503000 subs r3, r0, #0 <== NOT EXECUTED
ptr = *block_ptr;
*block_ptr = 0;
c610: 13a02000 movne r2, #0 <== NOT EXECUTED
#if defined(RTEMS_DEBUG)
assert( block_ptr );
#endif
if ( block_ptr ) {
ptr = *block_ptr;
c614: 15930000 ldrne r0, [r3] <== NOT EXECUTED
*block_ptr = 0;
c618: 15832000 strne r2, [r3] <== NOT EXECUTED
memfile_free_block( ptr );
c61c: 1bffff88 blne c444 <memfile_free_block> <== NOT EXECUTED
}
return 1;
}
c620: e3a00001 mov r0, #1 <== NOT EXECUTED
c624: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
0000c75c <IMFS_memfile_write>:
IMFS_jnode_t *the_jnode,
off_t start,
const unsigned char *source,
unsigned int length
)
{
c75c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
/*
* Error check arguments
*/
if ( !source )
c760: e2538000 subs r8, r3, #0
IMFS_jnode_t *the_jnode,
off_t start,
const unsigned char *source,
unsigned int length
)
{
c764: e24dd010 sub sp, sp, #16
c768: e1a09000 mov r9, r0
c76c: e1a06001 mov r6, r1
c770: e1a07002 mov r7, r2
c774: e59db034 ldr fp, [sp, #52] ; 0x34
/*
* Error check arguments
*/
if ( !source )
c778: 0a000064 beq c910 <IMFS_memfile_write+0x1b4>
/*
* If there is nothing to write, then quick exit.
*/
my_length = length;
if ( !my_length )
c77c: e35b0000 cmp fp, #0
c780: 0a000062 beq c910 <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 ) {
c784: e5903054 ldr r3, [r0, #84] ; 0x54
c788: 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;
c78c: e08b1001 add r1, fp, r1
if ( last_byte > the_jnode->info.file.size ) {
c790: ba000040 blt c898 <IMFS_memfile_write+0x13c>
c794: 0a00003c beq c88c <IMFS_memfile_write+0x130>
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
c798: e59f5184 ldr r5, [pc, #388] ; c924 <IMFS_memfile_write+0x1c8>
c79c: e5954000 ldr r4, [r5]
c7a0: e1a00006 mov r0, r6
c7a4: e1a02004 mov r2, r4
c7a8: e1a03fc2 asr r3, r2, #31
c7ac: e1a01007 mov r1, r7
c7b0: e88d000c stm sp, {r2, r3}
c7b4: eb001419 bl 11820 <__moddi3>
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
c7b8: e1a01007 mov r1, r7
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
c7bc: e1a0a000 mov sl, r0
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
c7c0: e89d000c ldm sp, {r2, r3}
c7c4: e1a00006 mov r0, r6
c7c8: eb0012da bl 11338 <__divdi3>
if ( start_offset ) {
c7cc: 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;
c7d0: e1a07000 mov r7, r0
if ( start_offset ) {
c7d4: 01a0600b moveq r6, fp
c7d8: 1a000016 bne c838 <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 ) {
c7dc: e1560004 cmp r6, r4
c7e0: 2a000008 bcs c808 <IMFS_memfile_write+0xac>
c7e4: ea000035 b c8c0 <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 );
c7e8: e5900000 ldr r0, [r0]
c7ec: eb0006d6 bl e34c <memcpy>
/*
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
c7f0: e5953000 ldr r3, [r5]
c7f4: 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;
c7f8: e0888004 add r8, r8, r4
block++;
c7fc: 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(
c800: 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 ) {
c804: 8a00002d bhi c8c0 <IMFS_memfile_write+0x164>
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
c808: e1a01007 mov r1, r7
c80c: e3a02000 mov r2, #0
c810: e1a00009 mov r0, r9
c814: ebfffde3 bl bfa8 <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
c818: 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 );
c81c: e1a01008 mov r1, r8
c820: e1a02004 mov r2, r4
src += to_copy;
block++;
my_length -= to_copy;
c824: 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 )
c828: 1affffee bne c7e8 <IMFS_memfile_write+0x8c>
}
IMFS_mtime_ctime_update( the_jnode );
return copied;
}
c82c: e1a0000a mov r0, sl
c830: e28dd010 add sp, sp, #16
c834: 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 );
c838: e1a00009 mov r0, r9
c83c: e1a01007 mov r1, r7
c840: e3a02000 mov r2, #0
c844: ebfffdd7 bl bfa8 <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
c848: e3500000 cmp r0, #0
return copied;
c84c: 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 )
c850: 0afffff5 beq c82c <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;
c854: e06a4004 rsb r4, sl, r4
block,
to_copy,
src
);
#endif
memcpy( &(*block_ptr)[ start_offset ], src, to_copy );
c858: 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;
c85c: e154000b cmp r4, fp
c860: 21a0400b movcs r4, fp
block,
to_copy,
src
);
#endif
memcpy( &(*block_ptr)[ start_offset ], src, to_copy );
c864: e080000a add r0, r0, sl
c868: e1a01008 mov r1, r8
c86c: e1a02004 mov r2, r4
c870: eb0006b5 bl e34c <memcpy>
src += to_copy;
c874: e0888004 add r8, r8, r4
block++;
my_length -= to_copy;
c878: e064600b rsb r6, r4, fp
copied += to_copy;
c87c: e1a0a004 mov sl, r4
src
);
#endif
memcpy( &(*block_ptr)[ start_offset ], src, to_copy );
src += to_copy;
block++;
c880: e2877001 add r7, r7, #1
my_length -= to_copy;
copied += to_copy;
c884: e5954000 ldr r4, [r5]
c888: eaffffd3 b c7dc <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 ) {
c88c: e5903050 ldr r3, [r0, #80] ; 0x50
c890: e1530001 cmp r3, r1
c894: 2affffbf bcs c798 <IMFS_memfile_write+0x3c>
status = IMFS_memfile_extend( the_jnode, last_byte );
c898: e1a00009 mov r0, r9
c89c: e3a02000 mov r2, #0
c8a0: ebffff60 bl c628 <IMFS_memfile_extend>
if ( status )
c8a4: e3500000 cmp r0, #0
c8a8: 0affffba beq c798 <IMFS_memfile_write+0x3c>
rtems_set_errno_and_return_minus_one( ENOSPC );
c8ac: eb000478 bl da94 <__errno>
c8b0: e3a0301c mov r3, #28
c8b4: e5803000 str r3, [r0]
c8b8: e3e0a000 mvn sl, #0
c8bc: eaffffda b c82c <IMFS_memfile_write+0xd0>
#if defined(RTEMS_DEBUG)
assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK );
#endif
to_copy = my_length;
if ( my_length ) {
c8c0: e3560000 cmp r6, #0
c8c4: 0a00000a beq c8f4 <IMFS_memfile_write+0x198>
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
c8c8: e1a00009 mov r0, r9
c8cc: e1a01007 mov r1, r7
c8d0: e3a02000 mov r2, #0
c8d4: ebfffdb3 bl bfa8 <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
c8d8: e3500000 cmp r0, #0
c8dc: 0affffd2 beq c82c <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 );
c8e0: e5900000 ldr r0, [r0]
c8e4: e1a01008 mov r1, r8
c8e8: e1a02006 mov r2, r6
c8ec: eb000696 bl e34c <memcpy>
my_length = 0;
copied += to_copy;
c8f0: e08aa006 add sl, sl, r6
}
IMFS_mtime_ctime_update( the_jnode );
c8f4: e28d0008 add r0, sp, #8
c8f8: e3a01000 mov r1, #0
c8fc: ebffd5d9 bl 2068 <gettimeofday>
c900: e59d3008 ldr r3, [sp, #8]
c904: e5893044 str r3, [r9, #68] ; 0x44
c908: e5893048 str r3, [r9, #72] ; 0x48
return copied;
c90c: eaffffc6 b c82c <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 );
c910: eb00045f bl da94 <__errno> <== NOT EXECUTED
c914: e3a03016 mov r3, #22 <== NOT EXECUTED
c918: e5803000 str r3, [r0] <== NOT EXECUTED
c91c: e3e0a000 mvn sl, #0 <== NOT EXECUTED
c920: eaffffc1 b c82c <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: eb00349b bl ea54 <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: eb00211d bl 9c74 <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: eb001e5d bl 91b8 <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: eb00308b bl da94 <__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: eb003082 bl da94 <__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: eb003075 bl da94 <__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: eb0037ce bl 1186c <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: ea003aec b 12530 <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: ea003ae5 b 12530 <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: eb00375a bl 11718 <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: ea003ed8 b 1351c <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: eb003751 bl 11718 <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: ea00374b b 11718 <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: eb003767 bl 11798 <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: eb003740 bl 11718 <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: eb003053 bl da94 <__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
00009e20 <IMFS_stat>:
{
IMFS_fs_info_t *fs_info;
IMFS_jnode_t *the_jnode;
IMFS_device_t *io;
the_jnode = loc->node_access;
9e20: e5903000 ldr r3, [r0]
switch ( the_jnode->type ) {
9e24: e593204c ldr r2, [r3, #76] ; 0x4c
9e28: e2422002 sub r2, r2, #2
int IMFS_stat(
rtems_filesystem_location_info_t *loc,
struct stat *buf
)
{
9e2c: e92d41f0 push {r4, r5, r6, r7, r8, lr}
IMFS_device_t *io;
the_jnode = loc->node_access;
switch ( the_jnode->type ) {
9e30: e3520005 cmp r2, #5
9e34: 979ff102 ldrls pc, [pc, r2, lsl #2]
9e38: ea000027 b 9edc <IMFS_stat+0xbc> <== NOT EXECUTED
9e3c: 00009ec8 .word 0x00009ec8 <== NOT EXECUTED
9e40: 00009edc .word 0x00009edc <== NOT EXECUTED
9e44: 00009e54 .word 0x00009e54 <== NOT EXECUTED
9e48: 00009ef0 .word 0x00009ef0 <== NOT EXECUTED
9e4c: 00009ef0 .word 0x00009ef0 <== NOT EXECUTED
9e50: 00009e54 .word 0x00009e54 <== NOT EXECUTED
case IMFS_SYM_LINK:
buf->st_size = 0;
break;
case IMFS_FIFO:
buf->st_size = 0;
9e54: e3a04000 mov r4, #0
9e58: e3a05000 mov r5, #0
9e5c: e5814020 str r4, [r1, #32]
9e60: 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;
9e64: e5902010 ldr r2, [r0, #16]
buf->st_dev =
rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance );
9e68: e5922034 ldr r2, [r2, #52] ; 0x34
9e6c: e5927000 ldr r7, [r2]
rtems_device_minor_number _minor
)
{
union __rtems_dev_t temp;
temp.__overlay.major = _major;
9e70: e3a02cff mov r2, #65280 ; 0xff00
9e74: 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;
9e78: 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;
9e7c: e5936030 ldr r6, [r3, #48] ; 0x30
buf->st_nlink = the_jnode->st_nlink;
buf->st_ino = the_jnode->st_ino;
9e80: 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;
9e84: e2834040 add r4, r3, #64 ; 0x40
9e88: 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;
9e8c: 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 =
9e90: 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;
9e94: e1d323bc ldrh r2, [r3, #60] ; 0x3c
buf->st_gid = the_jnode->st_gid;
9e98: 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;
9e9c: 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;
9ea0: 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;
9ea4: 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 =
9ea8: 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;
9eac: 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;
9eb0: e581600c str r6, [r1, #12]
buf->st_nlink = the_jnode->st_nlink;
buf->st_ino = the_jnode->st_ino;
9eb4: 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;
9eb8: e5814028 str r4, [r1, #40] ; 0x28
buf->st_mtime = the_jnode->stat_mtime;
9ebc: e581c030 str ip, [r1, #48] ; 0x30
buf->st_ctime = the_jnode->stat_ctime;
return 0;
9ec0: e3a00000 mov r0, #0
}
9ec4: 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 );
9ec8: e2832050 add r2, r3, #80 ; 0x50
9ecc: e8921004 ldm r2, {r2, ip}
9ed0: e581c01c str ip, [r1, #28]
9ed4: e5812018 str r2, [r1, #24]
break;
9ed8: eaffffe1 b 9e64 <IMFS_stat+0x44>
case IMFS_FIFO:
buf->st_size = 0;
break;
default:
rtems_set_errno_and_return_minus_one( ENOTSUP );
9edc: eb000eec bl da94 <__errno> <== NOT EXECUTED
9ee0: e3a03086 mov r3, #134 ; 0x86 <== NOT EXECUTED
9ee4: e5803000 str r3, [r0] <== NOT EXECUTED
9ee8: e3e00000 mvn r0, #0 <== NOT EXECUTED
9eec: 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;
9ef0: e2835050 add r5, r3, #80 ; 0x50
9ef4: e8950030 ldm r5, {r4, r5}
9ef8: e5814020 str r4, [r1, #32]
9efc: e5815024 str r5, [r1, #36] ; 0x24
break;
9f00: eaffffd7 b 9e64 <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: eb00341f bl ea54 <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: eb0020a1 bl 9c74 <IMFS_get_token>
/*
* Duplicate link name
*/
info.sym_link.name = strdup(link_name);
19ec: e1a00005 mov r0, r5
19f0: eb003403 bl ea04 <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: eb001de5 bl 91b8 <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: eb003014 bl da94 <__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: eb001e1e bl 933c <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: eb002fdd bl da94 <__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: eb002fcd bl da94 <__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: eb002fc8 bl da94 <__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
00016c10 <_CORE_message_queue_Broadcast>:
{
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
16c10: 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
)
{
16c14: 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 ) {
16c18: 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
)
{
16c1c: e1a07000 mov r7, r0
16c20: e1a05002 mov r5, r2
16c24: e1a08001 mov r8, r1
16c28: 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 ) {
16c2c: 3a000016 bcc 16c8c <_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 ) {
16c30: e5906048 ldr r6, [r0, #72] ; 0x48
16c34: e3560000 cmp r6, #0
*count = 0;
16c38: 13a00000 movne r0, #0
16c3c: 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 ) {
16c40: 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 =
16c44: e1a00007 mov r0, r7
16c48: eb000a5d bl 195c4 <_Thread_queue_Dequeue>
16c4c: e2504000 subs r4, r0, #0
16c50: 0a00000a beq 16c80 <_CORE_message_queue_Broadcast+0x70>
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
16c54: e594002c ldr r0, [r4, #44] ; 0x2c
16c58: e1a01008 mov r1, r8
16c5c: e1a02005 mov r2, r5
16c60: eb002469 bl 1fe0c <memcpy>
buffer,
waitp->return_argument_second.mutable_object,
size
);
*(size_t *) the_thread->Wait.return_argument = size;
16c64: 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 =
16c68: e1a00007 mov r0, r7
buffer,
waitp->return_argument_second.mutable_object,
size
);
*(size_t *) the_thread->Wait.return_argument = size;
16c6c: 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 =
16c70: eb000a53 bl 195c4 <_Thread_queue_Dequeue>
16c74: e2504000 subs r4, r0, #0
_Thread_queue_Dequeue(&the_message_queue->Wait_queue))) {
waitp = &the_thread->Wait;
number_broadcasted += 1;
16c78: 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 =
16c7c: 1afffff4 bne 16c54 <_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;
16c80: e58a6000 str r6, [sl]
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
16c84: e1a00004 mov r0, r4
16c88: 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;
16c8c: e3a00001 mov r0, #1 <== NOT EXECUTED
#endif
}
*count = number_broadcasted;
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
}
16c90: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
0000b4d8 <_Chain_Initialize>:
count = number_nodes;
current = _Chain_Head( the_chain );
the_chain->permanent_null = NULL;
next = starting_address;
while ( count-- ) {
b4d8: e3520000 cmp r2, #0
Chain_Node *current;
Chain_Node *next;
count = number_nodes;
current = _Chain_Head( the_chain );
the_chain->permanent_null = NULL;
b4dc: e3a0c000 mov ip, #0
Chain_Control *the_chain,
void *starting_address,
size_t number_nodes,
size_t node_size
)
{
b4e0: e92d0070 push {r4, r5, r6}
Chain_Node *current;
Chain_Node *next;
count = number_nodes;
current = _Chain_Head( the_chain );
the_chain->permanent_null = NULL;
b4e4: e580c004 str ip, [r0, #4]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head(
Chain_Control *the_chain
)
{
return (Chain_Node *) the_chain;
b4e8: e1a04000 mov r4, r0
next = starting_address;
b4ec: 11a05002 movne r5, r2
b4f0: 11a0c001 movne ip, r1
while ( count-- ) {
b4f4: 1a000002 bne b504 <_Chain_Initialize+0x2c>
b4f8: ea000008 b b520 <_Chain_Initialize+0x48> <== NOT EXECUTED
b4fc: e1a0400c mov r4, ip
current->next = next;
next->previous = current;
current = next;
next = (Chain_Node *)
b500: e1a0c006 mov ip, r6
count = number_nodes;
current = _Chain_Head( the_chain );
the_chain->permanent_null = NULL;
next = starting_address;
while ( count-- ) {
b504: e2555001 subs r5, r5, #1
current->next = next;
b508: e584c000 str ip, [r4]
next->previous = current;
b50c: e58c4004 str r4, [ip, #4]
* node_size - size of node in bytes
*
* Output parameters: NONE
*/
void _Chain_Initialize(
b510: e08c6003 add r6, ip, r3
count = number_nodes;
current = _Chain_Head( the_chain );
the_chain->permanent_null = NULL;
next = starting_address;
while ( count-- ) {
b514: 1afffff8 bne b4fc <_Chain_Initialize+0x24>
* node_size - size of node in bytes
*
* Output parameters: NONE
*/
void _Chain_Initialize(
b518: e2422001 sub r2, r2, #1
count = number_nodes;
current = _Chain_Head( the_chain );
the_chain->permanent_null = NULL;
next = starting_address;
while ( count-- ) {
b51c: e0241293 mla r4, r3, r2, r1
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
b520: 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 );
b524: e5843000 str r3, [r4]
the_chain->last = current;
b528: e5804008 str r4, [r0, #8]
}
b52c: e8bd0070 pop {r4, r5, r6}
b530: e12fff1e bx lr
0000b714 <_Heap_Allocate_aligned_with_boundary>:
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
b714: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
b718: 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;
b71c: e5902010 ldr r2, [r0, #16]
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
b720: e24dd01c sub sp, sp, #28
b724: 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 ) {
b728: e2911004 adds r1, r1, #4
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
b72c: 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 ) {
b730: e58d1000 str r1, [sp]
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
b734: e1a0b003 mov fp, r3
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
b738: 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;
b73c: e58d200c str r2, [sp, #12]
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
if ( block_size_floor < alloc_size ) {
b740: 2a000075 bcs b91c <_Heap_Allocate_aligned_with_boundary+0x208>
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
b744: e3530000 cmp r3, #0
b748: 1a000071 bne b914 <_Heap_Allocate_aligned_with_boundary+0x200>
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
b74c: e1570009 cmp r7, r9
b750: 0a000071 beq b91c <_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
b754: e59d300c ldr r3, [sp, #12]
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET;
b758: 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
b75c: e2833007 add r3, r3, #7
b760: e58d3010 str r3, [sp, #16]
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET;
b764: e58d1014 str r1, [sp, #20]
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
b768: 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 ) {
b76c: e599a004 ldr sl, [r9, #4]
b770: e59d2000 ldr r2, [sp]
b774: e152000a cmp r2, sl
while ( block != free_list_tail ) {
_HAssert( _Heap_Is_prev_used( block ) );
/* Statistics */
++search_count;
b778: 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 ) {
b77c: 2a000051 bcs b8c8 <_Heap_Allocate_aligned_with_boundary+0x1b4>
if ( alignment == 0 ) {
b780: 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;
b784: 02894008 addeq r4, r9, #8
b788: 0a00004c beq b8c0 <_Heap_Allocate_aligned_with_boundary+0x1ac>
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
b78c: 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;
b790: 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;
b794: 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;
b798: 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;
b79c: 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;
b7a0: e081400a add r4, r1, sl
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
b7a4: 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;
b7a8: e0633002 rsb r3, r3, r2
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
b7ac: 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
b7b0: e083a00a add sl, r3, sl
b7b4: 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;
b7b8: e2893008 add r3, r9, #8
b7bc: e58d3008 str r3, [sp, #8]
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
b7c0: eb0016a8 bl 11268 <__umodsi3>
b7c4: 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 ) {
b7c8: e15a0004 cmp sl, r4
b7cc: 2a000003 bcs b7e0 <_Heap_Allocate_aligned_with_boundary+0xcc>
b7d0: e1a0000a mov r0, sl
b7d4: e1a01008 mov r1, r8
b7d8: eb0016a2 bl 11268 <__umodsi3>
b7dc: e060400a rsb r4, r0, sl
}
alloc_end = alloc_begin + alloc_size;
/* Ensure boundary constaint */
if ( boundary != 0 ) {
b7e0: e35b0000 cmp fp, #0
b7e4: 0a000025 beq b880 <_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;
b7e8: e084a005 add sl, r4, r5
b7ec: e1a0000a mov r0, sl
b7f0: e1a0100b mov r1, fp
b7f4: eb00169b bl 11268 <__umodsi3>
b7f8: 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 ) {
b7fc: e1540000 cmp r4, r0
b800: 23a03000 movcs r3, #0
b804: 33a03001 movcc r3, #1
b808: e15a0000 cmp sl, r0
b80c: 93a03000 movls r3, #0
b810: e3530000 cmp r3, #0
b814: 0a000019 beq b880 <_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;
b818: e59d1008 ldr r1, [sp, #8]
b81c: 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 ) {
b820: e15a0000 cmp sl, r0
b824: 958d6018 strls r6, [sp, #24]
b828: 9a000002 bls b838 <_Heap_Allocate_aligned_with_boundary+0x124>
b82c: ea000025 b b8c8 <_Heap_Allocate_aligned_with_boundary+0x1b4>
b830: e15a0000 cmp sl, r0
b834: 8a00003a bhi b924 <_Heap_Allocate_aligned_with_boundary+0x210>
return 0;
}
alloc_begin = boundary_line - alloc_size;
b838: e0654000 rsb r4, r5, r0
b83c: e1a01008 mov r1, r8
b840: e1a00004 mov r0, r4
b844: eb001687 bl 11268 <__umodsi3>
b848: e0604004 rsb r4, r0, r4
alloc_begin = _Heap_Align_down( alloc_begin, alignment );
alloc_end = alloc_begin + alloc_size;
b84c: e0846005 add r6, r4, r5
b850: e1a00006 mov r0, r6
b854: e1a0100b mov r1, fp
b858: eb001682 bl 11268 <__umodsi3>
b85c: 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 ) {
b860: e1560000 cmp r6, r0
b864: 93a06000 movls r6, #0
b868: 83a06001 movhi r6, #1
b86c: e1540000 cmp r4, r0
b870: 23a06000 movcs r6, #0
b874: e3560000 cmp r6, #0
b878: 1affffec bne b830 <_Heap_Allocate_aligned_with_boundary+0x11c>
b87c: 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 ) {
b880: e59d2008 ldr r2, [sp, #8]
b884: e1520004 cmp r2, r4
b888: 8a00000e bhi b8c8 <_Heap_Allocate_aligned_with_boundary+0x1b4>
b88c: e59d100c ldr r1, [sp, #12]
b890: e1a00004 mov r0, r4
b894: eb001673 bl 11268 <__umodsi3>
b898: e269a4ff rsb sl, r9, #-16777216 ; 0xff000000
b89c: e28aa8ff add sl, sl, #16711680 ; 0xff0000
b8a0: e28aacff add sl, sl, #65280 ; 0xff00
b8a4: 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);
b8a8: 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 ) {
b8ac: e59d1004 ldr r1, [sp, #4]
b8b0: e060300a rsb r3, r0, sl
b8b4: e15a0000 cmp sl, r0
b8b8: 11510003 cmpne r1, r3
b8bc: 8a000001 bhi b8c8 <_Heap_Allocate_aligned_with_boundary+0x1b4>
boundary
);
}
}
if ( alloc_begin != 0 ) {
b8c0: e3540000 cmp r4, #0
b8c4: 1a000004 bne b8dc <_Heap_Allocate_aligned_with_boundary+0x1c8>
break;
}
block = block->next;
b8c8: e5999008 ldr r9, [r9, #8]
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
b8cc: e1570009 cmp r7, r9
b8d0: 1affffa5 bne b76c <_Heap_Allocate_aligned_with_boundary+0x58>
b8d4: e3a00000 mov r0, #0
b8d8: ea000008 b b900 <_Heap_Allocate_aligned_with_boundary+0x1ec>
block = block->next;
}
if ( alloc_begin != 0 ) {
/* Statistics */
stats->searches += search_count;
b8dc: e597304c ldr r3, [r7, #76] ; 0x4c
b8e0: e0833006 add r3, r3, r6
b8e4: e587304c str r3, [r7, #76] ; 0x4c
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
b8e8: e1a00007 mov r0, r7
b8ec: e1a01009 mov r1, r9
b8f0: e1a02004 mov r2, r4
b8f4: e1a03005 mov r3, r5
b8f8: ebffebce bl 6838 <_Heap_Block_allocate>
b8fc: e1a00004 mov r0, r4
boundary
);
}
/* Statistics */
if ( stats->max_search < search_count ) {
b900: e5973044 ldr r3, [r7, #68] ; 0x44
b904: e1530006 cmp r3, r6
stats->max_search = search_count;
b908: 35876044 strcc r6, [r7, #68] ; 0x44
}
return (void *) alloc_begin;
}
b90c: e28dd01c add sp, sp, #28
b910: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
if ( boundary < alloc_size ) {
b914: e1550003 cmp r5, r3
b918: 9a000006 bls b938 <_Heap_Allocate_aligned_with_boundary+0x224>
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
b91c: e3a00000 mov r0, #0
b920: eafffff9 b b90c <_Heap_Allocate_aligned_with_boundary+0x1f8>
if ( alloc_begin != 0 ) {
break;
}
block = block->next;
b924: e5999008 ldr r9, [r9, #8] <== NOT EXECUTED
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
b928: e1570009 cmp r7, r9 <== NOT EXECUTED
b92c: e59d6018 ldr r6, [sp, #24] <== NOT EXECUTED
b930: 1affff8d bne b76c <_Heap_Allocate_aligned_with_boundary+0x58><== NOT EXECUTED
b934: eaffffe6 b b8d4 <_Heap_Allocate_aligned_with_boundary+0x1c0><== NOT EXECUTED
if ( boundary < alloc_size ) {
return NULL;
}
if ( alignment == 0 ) {
alignment = page_size;
b938: e3580000 cmp r8, #0
b93c: 01a08002 moveq r8, r2
b940: eaffff81 b b74c <_Heap_Allocate_aligned_with_boundary+0x38>
0000b944 <_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 )
{
b944: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
b948: e1a04000 mov r4, r0
b94c: e1a05001 mov r5, r1
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
b950: e1a00001 mov r0, r1
b954: e5941010 ldr r1, [r4, #16]
b958: eb001642 bl 11268 <__umodsi3>
b95c: 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
b960: 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);
b964: 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;
b968: e1550003 cmp r5, r3
b96c: 3a00002f bcc ba30 <_Heap_Free+0xec>
b970: e5941024 ldr r1, [r4, #36] ; 0x24
b974: e1550001 cmp r5, r1
b978: 8a00002c bhi ba30 <_Heap_Free+0xec>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b97c: 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;
b980: 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);
b984: 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;
b988: e1530002 cmp r3, r2
b98c: 8a000027 bhi ba30 <_Heap_Free+0xec>
b990: e1510002 cmp r1, r2
b994: 3a000027 bcc ba38 <_Heap_Free+0xf4>
b998: 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 ) ) {
b99c: e2170001 ands r0, r7, #1
b9a0: 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 ));
b9a4: 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;
b9a8: e3c77001 bic r7, r7, #1
b9ac: 03a08000 moveq r8, #0
b9b0: 0a000004 beq b9c8 <_Heap_Free+0x84>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b9b4: 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;
b9b8: 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 )
b9bc: e3100001 tst r0, #1
b9c0: 13a08000 movne r8, #0
b9c4: 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 ) ) {
b9c8: e21c0001 ands r0, ip, #1
b9cc: 1a00001b bne ba40 <_Heap_Free+0xfc>
uintptr_t const prev_size = block->prev_size;
b9d0: 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);
b9d4: 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;
b9d8: e153000a cmp r3, sl
b9dc: 88bd85f0 pophi {r4, r5, r6, r7, r8, sl, pc}
b9e0: e151000a cmp r1, sl
b9e4: 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;
b9e8: 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) ) {
b9ec: e2100001 ands r0, r0, #1
b9f0: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
b9f4: e3580000 cmp r8, #0
b9f8: 0a000039 beq bae4 <_Heap_Free+0x1a0>
uintptr_t const size = block_size + prev_size + next_block_size;
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
b9fc: 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;
ba00: e0867007 add r7, r6, r7
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
ba04: 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;
ba08: e087c00c add ip, r7, ip
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
ba0c: 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;
ba10: e2400001 sub r0, r0, #1
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
ba14: 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;
ba18: e5823008 str r3, [r2, #8]
next->prev = prev;
ba1c: 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;
ba20: e5840038 str r0, [r4, #56] ; 0x38
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
ba24: 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;
ba28: e78ac00c str ip, [sl, ip]
ba2c: ea00000f b ba70 <_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;
ba30: e3a00000 mov r0, #0
ba34: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
ba38: e3a00000 mov r0, #0 <== NOT EXECUTED
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
ba3c: 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 */
ba40: e3580000 cmp r8, #0
ba44: 0a000014 beq ba9c <_Heap_Free+0x158>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
ba48: 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;
ba4c: e0877006 add r7, r7, r6
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
ba50: 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;
ba54: e3871001 orr r1, r7, #1
)
{
Heap_Block *next = old_block->next;
Heap_Block *prev = old_block->prev;
new_block->next = next;
ba58: e5853008 str r3, [r5, #8]
new_block->prev = prev;
ba5c: e585200c str r2, [r5, #12]
next->prev = new_block;
prev->next = new_block;
ba60: e5825008 str r5, [r2, #8]
Heap_Block *prev = old_block->prev;
new_block->next = next;
new_block->prev = prev;
next->prev = new_block;
ba64: e583500c str r5, [r3, #12]
ba68: e5851004 str r1, [r5, #4]
next_block = _Heap_Block_at( block, size );
next_block->prev_size = size;
ba6c: e7857007 str r7, [r5, r7]
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
ba70: e5942040 ldr r2, [r4, #64] ; 0x40
++stats->frees;
ba74: e5943050 ldr r3, [r4, #80] ; 0x50
stats->free_size += block_size;
ba78: e5941030 ldr r1, [r4, #48] ; 0x30
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
ba7c: e2422001 sub r2, r2, #1
++stats->frees;
ba80: e2833001 add r3, r3, #1
stats->free_size += block_size;
ba84: e0816006 add r6, r1, r6
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
ba88: e5842040 str r2, [r4, #64] ; 0x40
++stats->frees;
ba8c: e5843050 str r3, [r4, #80] ; 0x50
stats->free_size += block_size;
ba90: e5846030 str r6, [r4, #48] ; 0x30
return( true );
ba94: e3a00001 mov r0, #1
ba98: 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;
ba9c: e3863001 orr r3, r6, #1
baa0: e5853004 str r3, [r5, #4]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
baa4: e2843038 add r3, r4, #56 ; 0x38
baa8: 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;
baac: 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;
bab0: e5941008 ldr r1, [r4, #8]
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
bab4: 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;
bab8: e3c00001 bic r0, r0, #1
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
if ( stats->max_free_blocks < stats->free_blocks ) {
babc: e153000c cmp r3, ip
new_block->next = next;
bac0: e5851008 str r1, [r5, #8]
new_block->prev = block_before;
bac4: 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;
bac8: e5820004 str r0, [r2, #4]
block_before->next = new_block;
next->prev = new_block;
bacc: e581500c str r5, [r1, #12]
next_block->prev_size = block_size;
bad0: 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;
bad4: e5845008 str r5, [r4, #8]
/* Statistics */
++stats->free_blocks;
bad8: e5843038 str r3, [r4, #56] ; 0x38
if ( stats->max_free_blocks < stats->free_blocks ) {
stats->max_free_blocks = stats->free_blocks;
badc: 8584303c strhi r3, [r4, #60] ; 0x3c
bae0: eaffffe2 b ba70 <_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;
bae4: e086c00c add ip, r6, ip
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
bae8: e38c3001 orr r3, ip, #1
baec: e58a3004 str r3, [sl, #4]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
baf0: e5923004 ldr r3, [r2, #4]
baf4: e3c33001 bic r3, r3, #1
baf8: e5823004 str r3, [r2, #4]
next_block->prev_size = size;
bafc: e785c006 str ip, [r5, r6]
bb00: eaffffda b ba70 <_Heap_Free+0x12c>
000130f0 <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
130f0: e92d40f0 push {r4, r5, r6, r7, lr}
130f4: e1a04000 mov r4, r0
130f8: e1a05001 mov r5, r1
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
130fc: e1a00001 mov r0, r1
13100: e5941010 ldr r1, [r4, #16]
13104: e1a07002 mov r7, r2
13108: ebfff856 bl 11268 <__umodsi3>
1310c: 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
13110: 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);
13114: 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;
13118: e1500003 cmp r0, r3
1311c: 3a000010 bcc 13164 <_Heap_Size_of_alloc_area+0x74>
13120: e5942024 ldr r2, [r4, #36] ; 0x24
13124: e1500002 cmp r0, r2
13128: 8a00000d bhi 13164 <_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;
1312c: e5906004 ldr r6, [r0, #4]
13130: 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);
13134: 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;
13138: e1530006 cmp r3, r6
1313c: 8a000008 bhi 13164 <_Heap_Size_of_alloc_area+0x74>
13140: e1520006 cmp r2, r6
13144: 3a000008 bcc 1316c <_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;
13148: 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 )
1314c: e2100001 ands r0, r0, #1
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin;
13150: 12655004 rsbne r5, r5, #4
13154: 10856006 addne r6, r5, r6
13158: 15876000 strne r6, [r7]
return true;
1315c: 13a00001 movne r0, #1
13160: e8bd80f0 pop {r4, r5, r6, r7, pc}
if (
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
) {
return false;
13164: e3a00000 mov r0, #0
13168: e8bd80f0 pop {r4, r5, r6, r7, pc}
1316c: e3a00000 mov r0, #0 <== NOT EXECUTED
}
*alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin;
return true;
}
13170: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
00007590 <_Heap_Walk>:
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
7590: 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() ) ) {
7594: e59f35cc ldr r3, [pc, #1484] ; 7b68 <_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;
7598: e31200ff tst r2, #255 ; 0xff
if ( !_System_state_Is_up( _System_state_Get() ) ) {
759c: 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;
75a0: e59f25c4 ldr r2, [pc, #1476] ; 7b6c <_Heap_Walk+0x5dc>
75a4: e59f95c4 ldr r9, [pc, #1476] ; 7b70 <_Heap_Walk+0x5e0>
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
75a8: 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;
75ac: 11a09002 movne r9, r2
Heap_Control *heap,
int source,
bool dump
)
{
uintptr_t const page_size = heap->page_size;
75b0: 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() ) ) {
75b4: 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;
75b8: e5902014 ldr r2, [r0, #20]
Heap_Block *const first_block = heap->first_block;
Heap_Block *const last_block = heap->last_block;
75bc: e5903024 ldr r3, [r0, #36] ; 0x24
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
75c0: e24dd038 sub sp, sp, #56 ; 0x38
75c4: e1a04000 mov r4, r0
uintptr_t const page_size = heap->page_size;
75c8: e58d1024 str r1, [sp, #36] ; 0x24
uintptr_t const min_block_size = heap->min_block_size;
75cc: e58d2028 str r2, [sp, #40] ; 0x28
Heap_Block *const first_block = heap->first_block;
75d0: e5908020 ldr r8, [r0, #32]
Heap_Block *const last_block = heap->last_block;
75d4: 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() ) ) {
75d8: 0a000002 beq 75e8 <_Heap_Walk+0x58>
}
block = next_block;
} while ( block != first_block );
return true;
75dc: e3a00001 mov r0, #1
}
75e0: e28dd038 add sp, sp, #56 ; 0x38
75e4: 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)(
75e8: e594101c ldr r1, [r4, #28]
75ec: e5900018 ldr r0, [r0, #24]
75f0: e2842008 add r2, r4, #8
75f4: e892000c ldm r2, {r2, r3}
75f8: e59dc028 ldr ip, [sp, #40] ; 0x28
75fc: e58d1008 str r1, [sp, #8]
7600: e59d102c ldr r1, [sp, #44] ; 0x2c
7604: e58d0004 str r0, [sp, #4]
7608: e58d1010 str r1, [sp, #16]
760c: e58d2014 str r2, [sp, #20]
7610: e58d3018 str r3, [sp, #24]
7614: e59f2558 ldr r2, [pc, #1368] ; 7b74 <_Heap_Walk+0x5e4>
7618: e58dc000 str ip, [sp]
761c: e58d800c str r8, [sp, #12]
7620: e1a0000a mov r0, sl
7624: e3a01000 mov r1, #0
7628: e59d3024 ldr r3, [sp, #36] ; 0x24
762c: e1a0e00f mov lr, pc
7630: e12fff19 bx r9
heap->area_begin, heap->area_end,
first_block, last_block,
first_free_block, last_free_block
);
if ( page_size == 0 ) {
7634: e59d2024 ldr r2, [sp, #36] ; 0x24
7638: e3520000 cmp r2, #0
763c: 0a000026 beq 76dc <_Heap_Walk+0x14c>
(*printer)( source, true, "page size is zero\n" );
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
7640: e59d3024 ldr r3, [sp, #36] ; 0x24
7644: e2135003 ands r5, r3, #3
7648: 1a00002a bne 76f8 <_Heap_Walk+0x168>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
764c: e59d0028 ldr r0, [sp, #40] ; 0x28
7650: e59d1024 ldr r1, [sp, #36] ; 0x24
7654: ebffe551 bl ba0 <__umodsi3>
);
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
7658: e250b000 subs fp, r0, #0
765c: 1a00002c bne 7714 <_Heap_Walk+0x184>
7660: e2880008 add r0, r8, #8
7664: e59d1024 ldr r1, [sp, #36] ; 0x24
7668: ebffe54c bl ba0 <__umodsi3>
);
return false;
}
if (
766c: e2506000 subs r6, r0, #0
7670: 1a00002f bne 7734 <_Heap_Walk+0x1a4>
block = next_block;
} while ( block != first_block );
return true;
}
7674: e598b004 ldr fp, [r8, #4]
);
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
7678: e21b5001 ands r5, fp, #1
767c: 0a0000cd beq 79b8 <_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;
7680: e59dc02c ldr ip, [sp, #44] ; 0x2c
7684: e59c3004 ldr r3, [ip, #4]
7688: 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);
768c: 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;
7690: e5935004 ldr r5, [r3, #4]
);
return false;
}
if ( _Heap_Is_free( last_block ) ) {
7694: e2155001 ands r5, r5, #1
7698: 0a000008 beq 76c0 <_Heap_Walk+0x130>
);
return false;
}
if (
769c: e1580003 cmp r8, r3
76a0: 0a00002b beq 7754 <_Heap_Walk+0x1c4>
_Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block
) {
(*printer)(
76a4: e1a0000a mov r0, sl <== NOT EXECUTED
76a8: e3a01001 mov r1, #1 <== NOT EXECUTED
76ac: e59f24c4 ldr r2, [pc, #1220] ; 7b78 <_Heap_Walk+0x5e8> <== NOT EXECUTED
76b0: e1a0e00f mov lr, pc <== NOT EXECUTED
76b4: 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;
76b8: e1a00006 mov r0, r6 <== NOT EXECUTED
76bc: eaffffc7 b 75e0 <_Heap_Walk+0x50> <== NOT EXECUTED
return false;
}
if ( _Heap_Is_free( last_block ) ) {
(*printer)(
76c0: e1a0000a mov r0, sl
76c4: e3a01001 mov r1, #1
76c8: e59f24ac ldr r2, [pc, #1196] ; 7b7c <_Heap_Walk+0x5ec>
76cc: e1a0e00f mov lr, pc
76d0: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
76d4: e1a00005 mov r0, r5
76d8: eaffffc0 b 75e0 <_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" );
76dc: e1a0000a mov r0, sl
76e0: e3a01001 mov r1, #1
76e4: e59f2494 ldr r2, [pc, #1172] ; 7b80 <_Heap_Walk+0x5f0>
76e8: e1a0e00f mov lr, pc
76ec: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
76f0: e59d0024 ldr r0, [sp, #36] ; 0x24
76f4: eaffffb9 b 75e0 <_Heap_Walk+0x50>
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
(*printer)(
76f8: e1a0000a mov r0, sl
76fc: e3a01001 mov r1, #1
7700: e59f247c ldr r2, [pc, #1148] ; 7b84 <_Heap_Walk+0x5f4>
7704: e1a0e00f mov lr, pc
7708: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
770c: e3a00000 mov r0, #0
7710: eaffffb2 b 75e0 <_Heap_Walk+0x50>
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
(*printer)(
7714: e1a0000a mov r0, sl
7718: e3a01001 mov r1, #1
771c: e59f2464 ldr r2, [pc, #1124] ; 7b88 <_Heap_Walk+0x5f8>
7720: e59d3028 ldr r3, [sp, #40] ; 0x28
7724: e1a0e00f mov lr, pc
7728: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
772c: e1a00005 mov r0, r5
7730: eaffffaa b 75e0 <_Heap_Walk+0x50>
}
if (
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size )
) {
(*printer)(
7734: e1a0000a mov r0, sl
7738: e3a01001 mov r1, #1
773c: e59f2448 ldr r2, [pc, #1096] ; 7b8c <_Heap_Walk+0x5fc>
7740: e1a03008 mov r3, r8
7744: e1a0e00f mov lr, pc
7748: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
774c: e1a0000b mov r0, fp
7750: eaffffa2 b 75e0 <_Heap_Walk+0x50>
block = next_block;
} while ( block != first_block );
return true;
}
7754: 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 ) {
7758: e1540005 cmp r4, r5
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
775c: 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 ) {
7760: 05943020 ldreq r3, [r4, #32]
7764: 0a00000d beq 77a0 <_Heap_Walk+0x210>
block = next_block;
} while ( block != first_block );
return true;
}
7768: 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;
776c: e1530005 cmp r3, r5
7770: 9a000097 bls 79d4 <_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)(
7774: e1a0000a mov r0, sl
7778: e3a01001 mov r1, #1
777c: e59f240c ldr r2, [pc, #1036] ; 7b90 <_Heap_Walk+0x600>
7780: e1a03005 mov r3, r5
7784: e1a0e00f mov lr, pc
7788: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
778c: e3a00000 mov r0, #0
7790: eaffff92 b 75e0 <_Heap_Walk+0x50>
7794: e1a03008 mov r3, r8
7798: e28d8030 add r8, sp, #48 ; 0x30
779c: e8980900 ldm r8, {r8, fp}
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
77a0: 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;
77a4: 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);
77a8: 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;
77ac: e1530005 cmp r3, r5
77b0: 9a000008 bls 77d8 <_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)(
77b4: e1a0000a mov r0, sl
77b8: e58d5000 str r5, [sp]
77bc: e3a01001 mov r1, #1
77c0: e59f23cc ldr r2, [pc, #972] ; 7b94 <_Heap_Walk+0x604>
77c4: e1a03006 mov r3, r6
77c8: e1a0e00f mov lr, pc
77cc: e12fff19 bx r9
"block 0x%08x: next block 0x%08x not in heap\n",
block,
next_block
);
return false;
77d0: e3a00000 mov r0, #0
77d4: eaffff81 b 75e0 <_Heap_Walk+0x50>
77d8: e5943024 ldr r3, [r4, #36] ; 0x24
77dc: e1530005 cmp r3, r5
77e0: 3afffff3 bcc 77b4 <_Heap_Walk+0x224>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
77e4: e59d1024 ldr r1, [sp, #36] ; 0x24
77e8: e1a00007 mov r0, r7
77ec: ebffe4eb 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;
77f0: e59d102c ldr r1, [sp, #44] ; 0x2c
77f4: e0563001 subs r3, r6, r1
77f8: 13a03001 movne r3, #1
);
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
77fc: e3500000 cmp r0, #0
7800: 0a000001 beq 780c <_Heap_Walk+0x27c>
7804: e3530000 cmp r3, #0
7808: 1a0000aa bne 7ab8 <_Heap_Walk+0x528>
);
return false;
}
if ( block_size < min_block_size && is_not_last_block ) {
780c: e59d2028 ldr r2, [sp, #40] ; 0x28
7810: e1520007 cmp r2, r7
7814: 9a000001 bls 7820 <_Heap_Walk+0x290>
7818: e3530000 cmp r3, #0
781c: 1a0000ae bne 7adc <_Heap_Walk+0x54c>
);
return false;
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
7820: e1560005 cmp r6, r5
7824: 3a000001 bcc 7830 <_Heap_Walk+0x2a0>
7828: e3530000 cmp r3, #0
782c: 1a0000b4 bne 7b04 <_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;
7830: e5953004 ldr r3, [r5, #4]
);
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
7834: e3130001 tst r3, #1
7838: e20bb001 and fp, fp, #1
783c: 0a000018 beq 78a4 <_Heap_Walk+0x314>
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
}
} else if (prev_used) {
7840: e35b0000 cmp fp, #0
7844: 0a00000c beq 787c <_Heap_Walk+0x2ec>
(*printer)(
7848: e58d7000 str r7, [sp]
784c: e1a0000a mov r0, sl
7850: e3a01000 mov r1, #0
7854: e59f233c ldr r2, [pc, #828] ; 7b98 <_Heap_Walk+0x608>
7858: e1a03006 mov r3, r6
785c: e1a0e00f mov lr, pc
7860: e12fff19 bx r9
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
7864: e1580005 cmp r8, r5
7868: 0affff5b beq 75dc <_Heap_Walk+0x4c>
786c: e595b004 ldr fp, [r5, #4]
7870: e5943020 ldr r3, [r4, #32]
7874: e1a06005 mov r6, r5
7878: eaffffc9 b 77a4 <_Heap_Walk+0x214>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
787c: e58d7000 str r7, [sp]
7880: e5963000 ldr r3, [r6]
7884: e1a0000a mov r0, sl
7888: e58d3004 str r3, [sp, #4]
788c: e1a0100b mov r1, fp
7890: e59f2304 ldr r2, [pc, #772] ; 7b9c <_Heap_Walk+0x60c>
7894: e1a03006 mov r3, r6
7898: e1a0e00f mov lr, pc
789c: e12fff19 bx r9
78a0: eaffffef b 7864 <_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 ?
78a4: 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)(
78a8: e5943008 ldr r3, [r4, #8]
78ac: e1530002 cmp r3, r2
block = next_block;
} while ( block != first_block );
return true;
}
78b0: 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)(
78b4: 059f02e4 ldreq r0, [pc, #740] ; 7ba0 <_Heap_Walk+0x610>
78b8: 0a000003 beq 78cc <_Heap_Walk+0x33c>
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
78bc: e59f32e0 ldr r3, [pc, #736] ; 7ba4 <_Heap_Walk+0x614>
78c0: e1540002 cmp r4, r2
78c4: e59f02dc ldr r0, [pc, #732] ; 7ba8 <_Heap_Walk+0x618>
78c8: 01a00003 moveq r0, r3
block->next,
block->next == last_free_block ?
78cc: 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)(
78d0: e1510003 cmp r1, r3
78d4: 059f12d0 ldreq r1, [pc, #720] ; 7bac <_Heap_Walk+0x61c>
78d8: 0a000003 beq 78ec <_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)" : "")
78dc: e59fc2cc ldr ip, [pc, #716] ; 7bb0 <_Heap_Walk+0x620>
78e0: e1540003 cmp r4, r3
78e4: e59f12bc ldr r1, [pc, #700] ; 7ba8 <_Heap_Walk+0x618>
78e8: 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)(
78ec: e58d2004 str r2, [sp, #4]
78f0: e58d0008 str r0, [sp, #8]
78f4: e58d300c str r3, [sp, #12]
78f8: e58d1010 str r1, [sp, #16]
78fc: e1a03006 mov r3, r6
7900: e58d7000 str r7, [sp]
7904: e1a0000a mov r0, sl
7908: e3a01000 mov r1, #0
790c: e59f22a0 ldr r2, [pc, #672] ; 7bb4 <_Heap_Walk+0x624>
7910: e1a0e00f mov lr, pc
7914: e12fff19 bx r9
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
7918: e5953000 ldr r3, [r5]
791c: e1570003 cmp r7, r3
7920: 1a000011 bne 796c <_Heap_Walk+0x3dc>
);
return false;
}
if ( !prev_used ) {
7924: e35b0000 cmp fp, #0
7928: 0a00001a beq 7998 <_Heap_Walk+0x408>
block = next_block;
} while ( block != first_block );
return true;
}
792c: 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 ) {
7930: e1540003 cmp r4, r3
7934: 0a000004 beq 794c <_Heap_Walk+0x3bc>
if ( free_block == block ) {
7938: e1560003 cmp r6, r3
793c: 0affffc8 beq 7864 <_Heap_Walk+0x2d4>
return true;
}
free_block = free_block->next;
7940: 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 ) {
7944: e1540003 cmp r4, r3
7948: 1afffffa bne 7938 <_Heap_Walk+0x3a8>
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
794c: e1a0000a mov r0, sl
7950: e3a01001 mov r1, #1
7954: e59f225c ldr r2, [pc, #604] ; 7bb8 <_Heap_Walk+0x628>
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: e3a00000 mov r0, #0
7968: eaffff1c b 75e0 <_Heap_Walk+0x50>
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
(*printer)(
796c: e58d3004 str r3, [sp, #4]
7970: e1a0000a mov r0, sl
7974: e58d7000 str r7, [sp]
7978: e58d5008 str r5, [sp, #8]
797c: e3a01001 mov r1, #1
7980: e59f2234 ldr r2, [pc, #564] ; 7bbc <_Heap_Walk+0x62c>
7984: e1a03006 mov r3, r6
7988: e1a0e00f mov lr, pc
798c: e12fff19 bx r9
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
7990: e3a00000 mov r0, #0
7994: eaffff11 b 75e0 <_Heap_Walk+0x50>
return false;
}
if ( !prev_used ) {
(*printer)(
7998: e1a0000a mov r0, sl
799c: e3a01001 mov r1, #1
79a0: e59f2218 ldr r2, [pc, #536] ; 7bc0 <_Heap_Walk+0x630>
79a4: e1a03006 mov r3, r6
79a8: e1a0e00f mov lr, pc
79ac: e12fff19 bx r9
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
79b0: e1a0000b mov r0, fp
79b4: eaffff09 b 75e0 <_Heap_Walk+0x50>
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
(*printer)(
79b8: e1a0000a mov r0, sl
79bc: e3a01001 mov r1, #1
79c0: e59f21fc ldr r2, [pc, #508] ; 7bc4 <_Heap_Walk+0x634>
79c4: e1a0e00f mov lr, pc
79c8: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
79cc: e1a00005 mov r0, r5
79d0: eaffff02 b 75e0 <_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;
79d4: e594c024 ldr ip, [r4, #36] ; 0x24
79d8: e15c0005 cmp ip, r5
79dc: 3affff64 bcc 7774 <_Heap_Walk+0x1e4>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
79e0: e2850008 add r0, r5, #8
79e4: e1a01007 mov r1, r7
79e8: e58d301c str r3, [sp, #28]
79ec: e58dc020 str ip, [sp, #32]
79f0: ebffe46a bl ba0 <__umodsi3>
);
return false;
}
if (
79f4: e3500000 cmp r0, #0
79f8: e28d301c add r3, sp, #28
79fc: e8931008 ldm r3, {r3, ip}
7a00: 1a000048 bne 7b28 <_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;
7a04: e5952004 ldr r2, [r5, #4]
7a08: e3c22001 bic r2, r2, #1
block = next_block;
} while ( block != first_block );
return true;
}
7a0c: 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;
7a10: e5922004 ldr r2, [r2, #4]
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
7a14: e3120001 tst r2, #1
7a18: 1a00004a bne 7b48 <_Heap_Walk+0x5b8>
7a1c: e58d8030 str r8, [sp, #48] ; 0x30
7a20: e58db034 str fp, [sp, #52] ; 0x34
7a24: e1a01004 mov r1, r4
7a28: e1a06005 mov r6, r5
7a2c: e1a0b00c mov fp, ip
7a30: e1a08003 mov r8, r3
7a34: ea000013 b 7a88 <_Heap_Walk+0x4f8>
return false;
}
prev_block = free_block;
free_block = free_block->next;
7a38: 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 ) {
7a3c: e1540005 cmp r4, r5
7a40: 0affff53 beq 7794 <_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;
7a44: e1580005 cmp r8, r5
7a48: 8affff49 bhi 7774 <_Heap_Walk+0x1e4>
7a4c: e155000b cmp r5, fp
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
7a50: e2850008 add r0, r5, #8
7a54: 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;
7a58: 8affff45 bhi 7774 <_Heap_Walk+0x1e4>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
7a5c: ebffe44f bl ba0 <__umodsi3>
);
return false;
}
if (
7a60: e3500000 cmp r0, #0
7a64: 1a00002f bne 7b28 <_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;
7a68: e5953004 ldr r3, [r5, #4]
7a6c: e3c33001 bic r3, r3, #1
block = next_block;
} while ( block != first_block );
return true;
}
7a70: 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;
7a74: e5933004 ldr r3, [r3, #4]
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
7a78: e3130001 tst r3, #1
7a7c: 1a000031 bne 7b48 <_Heap_Walk+0x5b8>
7a80: e1a01006 mov r1, r6
7a84: e1a06005 mov r6, r5
);
return false;
}
if ( free_block->prev != prev_block ) {
7a88: e595200c ldr r2, [r5, #12]
7a8c: e1520001 cmp r2, r1
7a90: 0affffe8 beq 7a38 <_Heap_Walk+0x4a8>
(*printer)(
7a94: e58d2000 str r2, [sp]
7a98: e1a0000a mov r0, sl
7a9c: e3a01001 mov r1, #1
7aa0: e59f2120 ldr r2, [pc, #288] ; 7bc8 <_Heap_Walk+0x638>
7aa4: e1a03005 mov r3, r5
7aa8: e1a0e00f mov lr, pc
7aac: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7ab0: e3a00000 mov r0, #0
7ab4: eafffec9 b 75e0 <_Heap_Walk+0x50>
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
(*printer)(
7ab8: e1a0000a mov r0, sl
7abc: e58d7000 str r7, [sp]
7ac0: e3a01001 mov r1, #1
7ac4: e59f2100 ldr r2, [pc, #256] ; 7bcc <_Heap_Walk+0x63c>
7ac8: e1a03006 mov r3, r6
7acc: e1a0e00f mov lr, pc
7ad0: e12fff19 bx r9
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
7ad4: e3a00000 mov r0, #0
7ad8: eafffec0 b 75e0 <_Heap_Walk+0x50>
}
if ( block_size < min_block_size && is_not_last_block ) {
(*printer)(
7adc: e58d2004 str r2, [sp, #4]
7ae0: e1a0000a mov r0, sl
7ae4: e58d7000 str r7, [sp]
7ae8: e3a01001 mov r1, #1
7aec: e59f20dc ldr r2, [pc, #220] ; 7bd0 <_Heap_Walk+0x640>
7af0: e1a03006 mov r3, r6
7af4: e1a0e00f mov lr, pc
7af8: e12fff19 bx r9
block,
block_size,
min_block_size
);
return false;
7afc: e3a00000 mov r0, #0
7b00: eafffeb6 b 75e0 <_Heap_Walk+0x50>
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
(*printer)(
7b04: e1a0000a mov r0, sl
7b08: e58d5000 str r5, [sp]
7b0c: e3a01001 mov r1, #1
7b10: e59f20bc ldr r2, [pc, #188] ; 7bd4 <_Heap_Walk+0x644>
7b14: e1a03006 mov r3, r6
7b18: e1a0e00f mov lr, pc
7b1c: e12fff19 bx r9
"block 0x%08x: next block 0x%08x is not a successor\n",
block,
next_block
);
return false;
7b20: e3a00000 mov r0, #0
7b24: eafffead b 75e0 <_Heap_Walk+0x50>
}
if (
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size )
) {
(*printer)(
7b28: e1a0000a mov r0, sl
7b2c: e3a01001 mov r1, #1
7b30: e59f20a0 ldr r2, [pc, #160] ; 7bd8 <_Heap_Walk+0x648>
7b34: e1a03005 mov r3, r5
7b38: e1a0e00f mov lr, pc
7b3c: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7b40: e3a00000 mov r0, #0
7b44: eafffea5 b 75e0 <_Heap_Walk+0x50>
return false;
}
if ( _Heap_Is_used( free_block ) ) {
(*printer)(
7b48: e1a0000a mov r0, sl
7b4c: e3a01001 mov r1, #1
7b50: e59f2084 ldr r2, [pc, #132] ; 7bdc <_Heap_Walk+0x64c>
7b54: e1a03005 mov r3, r5
7b58: e1a0e00f mov lr, pc
7b5c: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7b60: e3a00000 mov r0, #0
7b64: eafffe9d b 75e0 <_Heap_Walk+0x50>
00006a84 <_Objects_Extend_information>:
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
6a84: 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 )
6a88: e5904034 ldr r4, [r0, #52] ; 0x34
6a8c: e3540000 cmp r4, #0
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
6a90: e24dd014 sub sp, sp, #20
6a94: 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 );
6a98: e1d070b8 ldrh r7, [r0, #8]
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
6a9c: 0a00009b beq 6d10 <_Objects_Extend_information+0x28c>
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
6aa0: e1d081b4 ldrh r8, [r0, #20]
6aa4: e1d0a1b0 ldrh sl, [r0, #16]
6aa8: e1a01008 mov r1, r8
6aac: e1a0000a mov r0, sl
6ab0: eb0029a6 bl 11150 <__aeabi_uidiv>
6ab4: e1a03800 lsl r3, r0, #16
for ( ; block < block_count; block++ ) {
6ab8: e1b03823 lsrs r3, r3, #16
6abc: 0a000099 beq 6d28 <_Objects_Extend_information+0x2a4>
if ( information->object_blocks[ block ] == NULL ) {
6ac0: e5949000 ldr r9, [r4]
6ac4: e3590000 cmp r9, #0
6ac8: 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 );
6acc: 01a06007 moveq r6, r7
index_base = minimum_index;
block = 0;
6ad0: 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 ) {
6ad4: 0a00000c beq 6b0c <_Objects_Extend_information+0x88>
6ad8: e1a02004 mov r2, r4
6adc: 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 );
6ae0: e1a06007 mov r6, r7
index_base = minimum_index;
block = 0;
6ae4: e3a04000 mov r4, #0
6ae8: ea000002 b 6af8 <_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 ) {
6aec: e5b29004 ldr r9, [r2, #4]!
6af0: e3590000 cmp r9, #0
6af4: 0a000004 beq 6b0c <_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++ ) {
6af8: e2844001 add r4, r4, #1
6afc: e1530004 cmp r3, r4
if ( information->object_blocks[ block ] == NULL ) {
do_extend = false;
break;
} else
index_base += information->allocation_size;
6b00: 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++ ) {
6b04: 8afffff8 bhi 6aec <_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;
6b08: e3a09001 mov r9, #1
} else
index_base += information->allocation_size;
}
}
maximum = (uint32_t) information->maximum + information->allocation_size;
6b0c: 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 ) {
6b10: e35a0801 cmp sl, #65536 ; 0x10000
6b14: 2a000063 bcs 6ca8 <_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 ) {
6b18: 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;
6b1c: e5950018 ldr r0, [r5, #24]
if ( information->auto_extend ) {
6b20: 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;
6b24: e0000091 mul r0, r1, r0
if ( information->auto_extend ) {
6b28: 1a000060 bne 6cb0 <_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 );
6b2c: e58d3000 str r3, [sp]
6b30: eb000838 bl 8c18 <_Workspace_Allocate_or_fatal_error>
6b34: e59d3000 ldr r3, [sp]
6b38: e1a08000 mov r8, r0
}
/*
* Do we need to grow the tables?
*/
if ( do_extend ) {
6b3c: e3590000 cmp r9, #0
6b40: 0a000039 beq 6c2c <_Objects_Extend_information+0x1a8>
*/
/*
* Up the block count and maximum
*/
block_count++;
6b44: e283b001 add fp, r3, #1
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
6b48: e08b008b add r0, fp, fp, lsl #1
((maximum + minimum_index) * sizeof(Objects_Control *));
6b4c: e08a0000 add r0, sl, r0
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
6b50: e0800007 add r0, r0, r7
((maximum + minimum_index) * sizeof(Objects_Control *));
object_blocks = (void**) _Workspace_Allocate( block_size );
6b54: e1a00100 lsl r0, r0, #2
6b58: e58d3000 str r3, [sp]
6b5c: eb000823 bl 8bf0 <_Workspace_Allocate>
if ( !object_blocks ) {
6b60: e2509000 subs r9, r0, #0
6b64: e59d3000 ldr r3, [sp]
6b68: 0a000073 beq 6d3c <_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 ) {
6b6c: e1d521b0 ldrh r2, [r5, #16]
6b70: e1570002 cmp r7, r2
RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
const void *base,
uintptr_t offset
)
{
return (void *)((uintptr_t)base + offset);
6b74: e089c10b add ip, r9, fp, lsl #2
6b78: e089b18b add fp, r9, fp, lsl #3
6b7c: 3a000051 bcc 6cc8 <_Objects_Extend_information+0x244>
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
6b80: e3570000 cmp r7, #0
6b84: 13a02000 movne r2, #0
6b88: 11a0100b movne r1, fp
local_table[ index ] = NULL;
6b8c: 11a00002 movne r0, r2
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
6b90: 0a000003 beq 6ba4 <_Objects_Extend_information+0x120>
6b94: e2822001 add r2, r2, #1
6b98: e1570002 cmp r7, r2
local_table[ index ] = NULL;
6b9c: e4810004 str r0, [r1], #4
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
6ba0: 8afffffb bhi 6b94 <_Objects_Extend_information+0x110>
6ba4: 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 );
6ba8: e1d511b4 ldrh r1, [r5, #20]
6bac: e0861001 add r1, r6, r1
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
6bb0: e3a00000 mov r0, #0
inactive_per_block[block_count] = 0;
for ( index=index_base ;
6bb4: e1560001 cmp r6, r1
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
6bb8: e7890003 str r0, [r9, r3]
inactive_per_block[block_count] = 0;
6bbc: e78c0003 str r0, [ip, r3]
for ( index=index_base ;
6bc0: 2a000005 bcs 6bdc <_Objects_Extend_information+0x158>
6bc4: e08b2106 add r2, fp, r6, lsl #2
* information - object information table
*
* Output parameters: NONE
*/
void _Objects_Extend_information(
6bc8: 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++ ) {
6bcc: 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 ;
6bd0: e1530001 cmp r3, r1
index < ( information->allocation_size + index_base );
index++ ) {
local_table[ index ] = NULL;
6bd4: 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 ;
6bd8: 3afffffb bcc 6bcc <_Objects_Extend_information+0x148>
6bdc: e10f3000 mrs r3, CPSR
6be0: e3832080 orr r2, r3, #128 ; 0x80
6be4: e129f002 msr CPSR_fc, r2
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
6be8: 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(
6bec: e1d510b4 ldrh r1, [r5, #4]
6bf0: 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;
6bf4: e1a0a80a lsl sl, sl, #16
6bf8: e3822801 orr r2, r2, #65536 ; 0x10000
6bfc: e1a0a82a lsr sl, sl, #16
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
6c00: 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) |
6c04: e182200a orr r2, r2, sl
local_table[ index ] = NULL;
}
_ISR_Disable( level );
old_tables = information->object_blocks;
6c08: e5950034 ldr r0, [r5, #52] ; 0x34
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
6c0c: e585c030 str ip, [r5, #48] ; 0x30
_ISR_Disable( level );
old_tables = information->object_blocks;
information->object_blocks = object_blocks;
6c10: e5859034 str r9, [r5, #52] ; 0x34
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
6c14: e585b01c str fp, [r5, #28]
information->maximum = (Objects_Maximum) maximum;
6c18: e1c5a1b0 strh sl, [r5, #16]
information->maximum_id = _Objects_Build_id(
6c1c: e585200c str r2, [r5, #12]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
6c20: e129f003 msr CPSR_fc, r3
information->maximum
);
_ISR_Enable( level );
if ( old_tables )
6c24: e3500000 cmp r0, #0
_Workspace_Free( old_tables );
6c28: 1b0007f6 blne 8c08 <_Workspace_Free>
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
6c2c: e5953034 ldr r3, [r5, #52] ; 0x34
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
6c30: e28d7008 add r7, sp, #8
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
6c34: e7838104 str r8, [r3, r4, lsl #2]
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
6c38: e1a01008 mov r1, r8
6c3c: e1a00007 mov r0, r7
6c40: e1d521b4 ldrh r2, [r5, #20]
6c44: e5953018 ldr r3, [r5, #24]
6c48: eb001222 bl b4d8 <_Chain_Initialize>
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
6c4c: e1a04104 lsl r4, r4, #2
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
6c50: 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 ) {
6c54: ea000009 b 6c80 <_Objects_Extend_information+0x1fc>
6c58: e5953000 ldr r3, [r5]
the_object->id = _Objects_Build_id(
6c5c: e1d520b4 ldrh r2, [r5, #4]
6c60: e1a03c03 lsl r3, r3, #24
6c64: e3833801 orr r3, r3, #65536 ; 0x10000
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
6c68: 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) |
6c6c: e1833006 orr r3, r3, r6
6c70: e5813008 str r3, [r1, #8]
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
6c74: e1a00008 mov r0, r8
6c78: ebfffce3 bl 600c <_Chain_Append>
index++;
6c7c: 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 ) {
6c80: e1a00007 mov r0, r7
6c84: ebfffcf3 bl 6058 <_Chain_Get>
6c88: e2501000 subs r1, r0, #0
6c8c: 1afffff1 bne 6c58 <_Objects_Extend_information+0x1d4>
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
information->inactive =
(Objects_Maximum)(information->inactive + information->allocation_size);
6c90: e1d522bc ldrh r2, [r5, #44] ; 0x2c
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
6c94: e1d531b4 ldrh r3, [r5, #20]
6c98: e5951030 ldr r1, [r5, #48] ; 0x30
information->inactive =
(Objects_Maximum)(information->inactive + information->allocation_size);
6c9c: e0832002 add r2, r3, r2
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
6ca0: e7813004 str r3, [r1, r4]
information->inactive =
6ca4: e1c522bc strh r2, [r5, #44] ; 0x2c
(Objects_Maximum)(information->inactive + information->allocation_size);
}
6ca8: e28dd014 add sp, sp, #20
6cac: 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 );
6cb0: e58d3000 str r3, [sp]
6cb4: eb0007cd bl 8bf0 <_Workspace_Allocate>
if ( !new_object_block )
6cb8: e2508000 subs r8, r0, #0
6cbc: e59d3000 ldr r3, [sp]
6cc0: 1affff9d bne 6b3c <_Objects_Extend_information+0xb8>
6cc4: eafffff7 b 6ca8 <_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,
6cc8: e1a03103 lsl r3, r3, #2
6ccc: e5951034 ldr r1, [r5, #52] ; 0x34
6cd0: e1a02003 mov r2, r3
6cd4: e88d1008 stm sp, {r3, ip}
6cd8: eb001d9b bl e34c <memcpy>
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
6cdc: e89d1008 ldm sp, {r3, ip}
6ce0: e1a0000c mov r0, ip
6ce4: e1a02003 mov r2, r3
6ce8: e5951030 ldr r1, [r5, #48] ; 0x30
6cec: eb001d96 bl e34c <memcpy>
information->inactive_per_block,
block_count * sizeof(uint32_t) );
memcpy( local_table,
information->local_table,
(information->maximum + minimum_index) * sizeof(Objects_Control *) );
6cf0: e1d521b0 ldrh r2, [r5, #16]
6cf4: 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,
6cf8: e1a0000b mov r0, fp
6cfc: e595101c ldr r1, [r5, #28]
6d00: e1a02102 lsl r2, r2, #2
6d04: eb001d90 bl e34c <memcpy>
6d08: e89d1008 ldm sp, {r3, ip}
6d0c: eaffffa5 b 6ba8 <_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 )
6d10: e1d0a1b0 ldrh sl, [r0, #16]
6d14: 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 );
6d18: 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;
6d1c: e3a09001 mov r9, #1
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
block_count = 0;
6d20: e1a03004 mov r3, r4
6d24: eaffff78 b 6b0c <_Objects_Extend_information+0x88>
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
6d28: 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 );
6d2c: 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;
6d30: e3a09001 mov r9, #1 <== NOT EXECUTED
minimum_index = _Objects_Get_index( information->minimum_id );
index_base = minimum_index;
block = 0;
6d34: e1a04003 mov r4, r3 <== NOT EXECUTED
6d38: eaffff73 b 6b0c <_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 );
6d3c: e1a00008 mov r0, r8
6d40: eb0007b0 bl 8c08 <_Workspace_Free>
return;
6d44: eaffffd7 b 6ca8 <_Objects_Extend_information+0x224>
00007734 <_Objects_Set_name>:
bool _Objects_Set_name(
Objects_Information *information,
Objects_Control *the_object,
const char *name
)
{
7734: e92d40f0 push {r4, r5, r6, r7, lr}
7738: e1a05000 mov r5, r0
773c: e1a06001 mov r6, r1
size_t length;
const char *s;
s = name;
length = strnlen( name, information->name_length );
7740: e1a00002 mov r0, r2
7744: e1d513ba ldrh r1, [r5, #58] ; 0x3a
bool _Objects_Set_name(
Objects_Information *information,
Objects_Control *the_object,
const char *name
)
{
7748: e1a07002 mov r7, r2
size_t length;
const char *s;
s = name;
length = strnlen( name, information->name_length );
774c: eb002211 bl ff98 <strnlen>
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string ) {
7750: e5d53038 ldrb r3, [r5, #56] ; 0x38
7754: e3530000 cmp r3, #0
{
size_t length;
const char *s;
s = name;
length = strnlen( name, information->name_length );
7758: e1a04000 mov r4, r0
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string ) {
775c: 1a000017 bne 77c0 <_Objects_Set_name+0x8c>
d[length] = '\0';
the_object->name.name_p = d;
} else
#endif
{
the_object->name.name_u32 = _Objects_Build_name(
7760: e5d72000 ldrb r2, [r7]
7764: e3500001 cmp r0, #1
7768: e1a02c02 lsl r2, r2, #24
776c: 9a00000c bls 77a4 <_Objects_Set_name+0x70>
7770: e5d73001 ldrb r3, [r7, #1]
7774: e3500002 cmp r0, #2
7778: e1822803 orr r2, r2, r3, lsl #16
777c: 0a000009 beq 77a8 <_Objects_Set_name+0x74>
7780: e5d73002 ldrb r3, [r7, #2]
7784: e3500003 cmp r0, #3
7788: e1822403 orr r2, r2, r3, lsl #8
778c: 15d73003 ldrbne r3, [r7, #3]
7790: 03a03020 moveq r3, #32
7794: e1823003 orr r3, r2, r3
7798: e586300c str r3, [r6, #12]
((3 < length) ? s[ 3 ] : ' ')
);
}
return true;
779c: e3a00001 mov r0, #1
77a0: e8bd80f0 pop {r4, r5, r6, r7, pc}
d[length] = '\0';
the_object->name.name_p = d;
} else
#endif
{
the_object->name.name_u32 = _Objects_Build_name(
77a4: e3822602 orr r2, r2, #2097152 ; 0x200000
77a8: e3822a02 orr r2, r2, #8192 ; 0x2000
77ac: e3a03020 mov r3, #32
77b0: e1823003 orr r3, r2, r3
77b4: e586300c str r3, [r6, #12]
((3 < length) ? s[ 3 ] : ' ')
);
}
return true;
77b8: e3a00001 mov r0, #1
77bc: e8bd80f0 pop {r4, r5, r6, r7, pc}
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string ) {
char *d;
d = _Workspace_Allocate( length + 1 );
77c0: e2800001 add r0, r0, #1
77c4: eb0006e4 bl 935c <_Workspace_Allocate>
if ( !d )
77c8: e2505000 subs r5, r0, #0
77cc: 0a00000e beq 780c <_Objects_Set_name+0xd8>
return false;
if ( the_object->name.name_p ) {
77d0: e596000c ldr r0, [r6, #12]
77d4: e3500000 cmp r0, #0
77d8: 0a000002 beq 77e8 <_Objects_Set_name+0xb4>
_Workspace_Free( (void *)the_object->name.name_p );
77dc: eb0006e4 bl 9374 <_Workspace_Free>
the_object->name.name_p = NULL;
77e0: e3a03000 mov r3, #0
77e4: e586300c str r3, [r6, #12]
}
strncpy( d, name, length );
77e8: e1a00005 mov r0, r5
77ec: e1a01007 mov r1, r7
77f0: e1a02004 mov r2, r4
77f4: eb0021ac bl feac <strncpy>
d[length] = '\0';
77f8: e3a03000 mov r3, #0
77fc: e7c53004 strb r3, [r5, r4]
((3 < length) ? s[ 3 ] : ' ')
);
}
return true;
7800: e3a00001 mov r0, #1
the_object->name.name_p = NULL;
}
strncpy( d, name, length );
d[length] = '\0';
the_object->name.name_p = d;
7804: e586500c str r5, [r6, #12]
7808: e8bd80f0 pop {r4, r5, r6, r7, pc}
if ( information->is_string ) {
char *d;
d = _Workspace_Allocate( length + 1 );
if ( !d )
return false;
780c: e1a00005 mov r0, r5 <== NOT EXECUTED
);
}
return true;
}
7810: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
000070a8 <_Objects_Shrink_information>:
*/
void _Objects_Shrink_information(
Objects_Information *information
)
{
70a8: 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 );
70ac: e1d040b8 ldrh r4, [r0, #8]
block_count = (information->maximum - index_base) /
70b0: e1d051b4 ldrh r5, [r0, #20]
*/
void _Objects_Shrink_information(
Objects_Information *information
)
{
70b4: 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) /
70b8: e1d001b0 ldrh r0, [r0, #16]
70bc: e1a01005 mov r1, r5
70c0: e0640000 rsb r0, r4, r0
70c4: eb002821 bl 11150 <__aeabi_uidiv>
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
70c8: e3500000 cmp r0, #0
70cc: 08bd80f0 popeq {r4, r5, r6, r7, pc}
if ( information->inactive_per_block[ block ] ==
70d0: e5962030 ldr r2, [r6, #48] ; 0x30
70d4: e5923000 ldr r3, [r2]
70d8: 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++ ) {
70dc: 13a03000 movne r3, #0
if ( information->inactive_per_block[ block ] ==
70e0: 1a000005 bne 70fc <_Objects_Shrink_information+0x54>
70e4: ea000008 b 710c <_Objects_Shrink_information+0x64> <== NOT EXECUTED
70e8: e5b21004 ldr r1, [r2, #4]!
70ec: e1550001 cmp r5, r1
information->inactive -= information->allocation_size;
return;
}
index_base += information->allocation_size;
70f0: e0844005 add r4, r4, r5
70f4: 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 ] ==
70f8: 0a000004 beq 7110 <_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++ ) {
70fc: e2833001 add r3, r3, #1
7100: e1500003 cmp r0, r3
7104: 8afffff7 bhi 70e8 <_Objects_Shrink_information+0x40>
7108: e8bd80f0 pop {r4, r5, r6, r7, pc}
if ( information->inactive_per_block[ block ] ==
710c: 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;
7110: e5960020 ldr r0, [r6, #32]
7114: ea000002 b 7124 <_Objects_Shrink_information+0x7c>
if ((index >= index_base) &&
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
}
}
while ( the_object );
7118: e3550000 cmp r5, #0
711c: 0a00000b beq 7150 <_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;
7120: 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 );
7124: 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) &&
7128: 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;
712c: e5905000 ldr r5, [r0]
if ((index >= index_base) &&
7130: 3afffff8 bcc 7118 <_Objects_Shrink_information+0x70>
(index < (index_base + information->allocation_size))) {
7134: e1d621b4 ldrh r2, [r6, #20]
7138: 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) &&
713c: e1530002 cmp r3, r2
7140: 2afffff4 bcs 7118 <_Objects_Shrink_information+0x70>
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
7144: ebfffbbb bl 6038 <_Chain_Extract>
}
}
while ( the_object );
7148: e3550000 cmp r5, #0
714c: 1afffff3 bne 7120 <_Objects_Shrink_information+0x78>
/*
* Free the memory and reset the structures in the object' information
*/
_Workspace_Free( information->object_blocks[ block ] );
7150: e5963034 ldr r3, [r6, #52] ; 0x34
7154: e7930007 ldr r0, [r3, r7]
7158: eb0006aa bl 8c08 <_Workspace_Free>
information->object_blocks[ block ] = NULL;
information->inactive_per_block[ block ] = 0;
information->inactive -= information->allocation_size;
715c: e1d602bc ldrh r0, [r6, #44] ; 0x2c
7160: 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;
7164: e5961034 ldr r1, [r6, #52] ; 0x34
information->inactive_per_block[ block ] = 0;
7168: e5962030 ldr r2, [r6, #48] ; 0x30
information->inactive -= information->allocation_size;
716c: 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;
7170: e7815007 str r5, [r1, r7]
information->inactive_per_block[ block ] = 0;
7174: e7825007 str r5, [r2, r7]
information->inactive -= information->allocation_size;
7178: e1c632bc strh r3, [r6, #44] ; 0x2c
return;
717c: e8bd80f0 pop {r4, r5, r6, r7, pc}
00006784 <_POSIX_Condition_variables_Wait_support>:
pthread_cond_t *cond,
pthread_mutex_t *mutex,
Watchdog_Interval timeout,
bool already_timedout
)
{
6784: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
6788: e24dd004 sub sp, sp, #4
678c: e1a04001 mov r4, r1
6790: e1a06000 mov r6, r0
register POSIX_Condition_variables_Control *the_cond;
Objects_Locations location;
int status;
int mutex_status;
if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
6794: e1a00001 mov r0, r1
6798: e1a0100d mov r1, sp
pthread_cond_t *cond,
pthread_mutex_t *mutex,
Watchdog_Interval timeout,
bool already_timedout
)
{
679c: e1a08002 mov r8, r2
67a0: e20370ff and r7, r3, #255 ; 0xff
register POSIX_Condition_variables_Control *the_cond;
Objects_Locations location;
int status;
int mutex_status;
if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
67a4: eb00005a bl 6914 <_POSIX_Mutex_Get>
67a8: e3500000 cmp r0, #0
67ac: 0a00000a beq 67dc <_POSIX_Condition_variables_Wait_support+0x58>
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
67b0: e59f30d8 ldr r3, [pc, #216] ; 6890 <_POSIX_Condition_variables_Wait_support+0x10c>
67b4: e5932000 ldr r2, [r3]
67b8: e2422001 sub r2, r2, #1
67bc: e5832000 str r2, [r3]
return EINVAL;
}
_Thread_Unnest_dispatch();
the_cond = _POSIX_Condition_variables_Get( cond, &location );
67c0: e1a00006 mov r0, r6
67c4: e1a0100d mov r1, sp
67c8: ebffff75 bl 65a4 <_POSIX_Condition_variables_Get>
switch ( location ) {
67cc: e59d3000 ldr r3, [sp]
67d0: e3530000 cmp r3, #0
return EINVAL;
}
_Thread_Unnest_dispatch();
the_cond = _POSIX_Condition_variables_Get( cond, &location );
67d4: e1a0a000 mov sl, r0
switch ( location ) {
67d8: 0a000003 beq 67ec <_POSIX_Condition_variables_Wait_support+0x68>
#endif
case OBJECTS_ERROR:
break;
}
return EINVAL;
67dc: e3a05016 mov r5, #22
}
67e0: e1a00005 mov r0, r5
67e4: e28dd004 add sp, sp, #4
67e8: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
the_cond = _POSIX_Condition_variables_Get( cond, &location );
switch ( location ) {
case OBJECTS_LOCAL:
if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) {
67ec: e5903014 ldr r3, [r0, #20]
67f0: e3530000 cmp r3, #0
67f4: 0a000005 beq 6810 <_POSIX_Condition_variables_Wait_support+0x8c>
67f8: e5942000 ldr r2, [r4]
67fc: e1530002 cmp r3, r2
6800: 0a000002 beq 6810 <_POSIX_Condition_variables_Wait_support+0x8c>
_Thread_Enable_dispatch();
6804: eb000c88 bl 9a2c <_Thread_Enable_dispatch>
return EINVAL;
6808: e3a05016 mov r5, #22
680c: eafffff3 b 67e0 <_POSIX_Condition_variables_Wait_support+0x5c>
}
(void) pthread_mutex_unlock( mutex );
6810: e1a00004 mov r0, r4
6814: eb0000e4 bl 6bac <pthread_mutex_unlock>
_Thread_Enable_dispatch();
return EINVAL;
}
*/
if ( !already_timedout ) {
6818: e3570000 cmp r7, #0
681c: 0a000006 beq 683c <_POSIX_Condition_variables_Wait_support+0xb8>
status = _Thread_Executing->Wait.return_code;
if ( status && status != ETIMEDOUT )
return status;
} else {
_Thread_Enable_dispatch();
6820: eb000c81 bl 9a2c <_Thread_Enable_dispatch>
status = ETIMEDOUT;
6824: e3a05074 mov r5, #116 ; 0x74
/*
* When we get here the dispatch disable level is 0.
*/
mutex_status = pthread_mutex_lock( mutex );
6828: e1a00004 mov r0, r4
682c: eb0000bd bl 6b28 <pthread_mutex_lock>
if ( mutex_status )
return EINVAL;
6830: e3500000 cmp r0, #0
6834: 13a05016 movne r5, #22
6838: eaffffe8 b 67e0 <_POSIX_Condition_variables_Wait_support+0x5c>
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
683c: e59f5050 ldr r5, [pc, #80] ; 6894 <_POSIX_Condition_variables_Wait_support+0x110>
return EINVAL;
}
*/
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
6840: e5942000 ldr r2, [r4]
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
6844: e5953004 ldr r3, [r5, #4]
return EINVAL;
}
*/
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
6848: e58a2014 str r2, [sl, #20]
RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section (
Thread_queue_Control *the_thread_queue
)
{
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
684c: e3a02001 mov r2, #1
6850: e58a2048 str r2, [sl, #72] ; 0x48
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
6854: e5837034 str r7, [r3, #52] ; 0x34
_Thread_Executing->Wait.queue = &the_cond->Wait_queue;
_Thread_Executing->Wait.id = *cond;
6858: e5962000 ldr r2, [r6]
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
_Thread_Executing->Wait.queue = &the_cond->Wait_queue;
685c: e28a0018 add r0, sl, #24
_Thread_Executing->Wait.id = *cond;
6860: e5832020 str r2, [r3, #32]
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
_Thread_Executing->Wait.queue = &the_cond->Wait_queue;
6864: e5830044 str r0, [r3, #68] ; 0x44
_Thread_Executing->Wait.id = *cond;
_Thread_queue_Enqueue( &the_cond->Wait_queue, timeout );
6868: e1a01008 mov r1, r8
686c: e59f2024 ldr r2, [pc, #36] ; 6898 <_POSIX_Condition_variables_Wait_support+0x114>
6870: eb000da5 bl 9f0c <_Thread_queue_Enqueue_with_handler>
_Thread_Enable_dispatch();
6874: eb000c6c bl 9a2c <_Thread_Enable_dispatch>
/*
* Switch ourself out because we blocked as a result of the
* _Thread_queue_Enqueue.
*/
status = _Thread_Executing->Wait.return_code;
6878: e5953004 ldr r3, [r5, #4]
687c: e5935034 ldr r5, [r3, #52] ; 0x34
if ( status && status != ETIMEDOUT )
6880: e3550074 cmp r5, #116 ; 0x74
6884: 13550000 cmpne r5, #0
6888: 0affffe6 beq 6828 <_POSIX_Condition_variables_Wait_support+0xa4>
688c: eaffffd3 b 67e0 <_POSIX_Condition_variables_Wait_support+0x5c><== NOT EXECUTED
0000da10 <_POSIX_signals_Clear_process_signals>:
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
da10: e10f2000 mrs r2, CPSR
da14: e3823080 orr r3, r2, #128 ; 0x80
da18: e129f003 msr CPSR_fc, r3
mask = signo_to_mask( signo );
ISR_Level level;
_ISR_Disable( level );
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
da1c: e59f1050 ldr r1, [pc, #80] ; da74 <_POSIX_signals_Clear_process_signals+0x64>
da20: e0803080 add r3, r0, r0, lsl #1
da24: e7911103 ldr r1, [r1, r3, lsl #2]
da28: e3510002 cmp r1, #2
da2c: e1a01103 lsl r1, r3, #2
da30: 0a000007 beq da54 <_POSIX_signals_Clear_process_signals+0x44>
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
clear_signal = false;
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
da34: e59f303c ldr r3, [pc, #60] ; da78 <_POSIX_signals_Clear_process_signals+0x68>
da38: e5931000 ldr r1, [r3]
da3c: e3a0c001 mov ip, #1
da40: e2400001 sub r0, r0, #1
da44: e1c1001c bic r0, r1, ip, lsl r0
da48: e5830000 str r0, [r3]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
da4c: e129f002 msr CPSR_fc, r2
}
_ISR_Enable( level );
}
da50: e12fff1e bx lr
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
da54: e59fc020 ldr ip, [pc, #32] ; da7c <_POSIX_signals_Clear_process_signals+0x6c>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
da58: e2811004 add r1, r1, #4
ISR_Level level;
_ISR_Disable( level );
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
da5c: e79c3103 ldr r3, [ip, r3, lsl #2]
da60: e081c00c add ip, r1, ip
da64: e153000c cmp r3, ip
da68: 0afffff1 beq da34 <_POSIX_signals_Clear_process_signals+0x24>
da6c: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
}
_ISR_Enable( level );
}
da70: e12fff1e bx lr <== NOT EXECUTED
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: eb0048eb bl 18a7c <__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
00007d5c <_Thread_queue_Enqueue_priority>:
Priority_Control priority;
States_Control block_state;
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
7d5c: 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
)
{
7d60: e92d0ff0 push {r4, r5, r6, r7, r8, r9, sl, fp}
7d64: 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 );
7d68: e281c038 add ip, r1, #56 ; 0x38
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
7d6c: 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 ) )
7d70: e3130020 tst r3, #32
the_chain->permanent_null = NULL;
7d74: e3a04000 mov r4, #0
7d78: e581403c str r4, [r1, #60] ; 0x3c
the_chain->last = _Chain_Head(the_chain);
7d7c: 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);
7d80: 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;
7d84: e5905038 ldr r5, [r0, #56] ; 0x38
if ( _Thread_queue_Is_reverse_search( priority ) )
7d88: 1a00001f bne 7e0c <_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;
7d8c: e0888088 add r8, r8, r8, lsl #1
7d90: e1a09108 lsl r9, r8, #2
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
7d94: e2898004 add r8, r9, #4
7d98: e0808008 add r8, r0, r8
7d9c: e0809009 add r9, r0, r9
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
7da0: e10f7000 mrs r7, CPSR
7da4: e387c080 orr ip, r7, #128 ; 0x80
7da8: e129f00c msr CPSR_fc, ip
7dac: e1a0a007 mov sl, r7
7db0: e599c000 ldr ip, [r9]
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
7db4: e15c0008 cmp ip, r8
7db8: 1a000009 bne 7de4 <_Thread_queue_Enqueue_priority+0x88>
7dbc: ea000054 b 7f14 <_Thread_queue_Enqueue_priority+0x1b8>
static inline void arm_interrupt_flash( uint32_t level )
{
uint32_t arm_switch_reg;
asm volatile (
7dc0: e10f6000 mrs r6, CPSR
7dc4: e129f007 msr CPSR_fc, r7
7dc8: 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);
7dcc: 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) ) {
7dd0: e1150006 tst r5, r6
7dd4: 0a000036 beq 7eb4 <_Thread_queue_Enqueue_priority+0x158>
_ISR_Enable( level );
goto restart_forward_search;
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
7dd8: 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 ) ) {
7ddc: e15c0008 cmp ip, r8
7de0: 0a000002 beq 7df0 <_Thread_queue_Enqueue_priority+0x94>
search_priority = search_thread->current_priority;
7de4: e59c4014 ldr r4, [ip, #20]
if ( priority <= search_priority )
7de8: e1530004 cmp r3, r4
7dec: 8afffff3 bhi 7dc0 <_Thread_queue_Enqueue_priority+0x64>
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
7df0: e5905030 ldr r5, [r0, #48] ; 0x30
7df4: e3550001 cmp r5, #1
7df8: 0a00002f beq 7ebc <_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;
7dfc: e582a000 str sl, [r2]
return the_thread_queue->sync_state;
}
7e00: e1a00005 mov r0, r5
7e04: e8bd0ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp}
7e08: 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 ];
7e0c: e0888088 add r8, r8, r8, lsl #1
7e10: e0808108 add r8, r0, r8, lsl #2
7e14: e59f9100 ldr r9, [pc, #256] ; 7f1c <_Thread_queue_Enqueue_priority+0x1c0>
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) header->last;
7e18: 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;
7e1c: e5d94000 ldrb r4, [r9]
7e20: e2844001 add r4, r4, #1
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
7e24: e10f7000 mrs r7, CPSR
7e28: e387c080 orr ip, r7, #128 ; 0x80
7e2c: e129f00c msr CPSR_fc, ip
7e30: e1a0a007 mov sl, r7
_ISR_Disable( level );
search_thread = (Thread_Control *) header->last;
7e34: e59bc008 ldr ip, [fp, #8]
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
7e38: e15c0008 cmp ip, r8
7e3c: 1a000009 bne 7e68 <_Thread_queue_Enqueue_priority+0x10c>
7e40: ea00000b b 7e74 <_Thread_queue_Enqueue_priority+0x118>
static inline void arm_interrupt_flash( uint32_t level )
{
uint32_t arm_switch_reg;
asm volatile (
7e44: e10f6000 mrs r6, CPSR
7e48: e129f007 msr CPSR_fc, r7
7e4c: e129f006 msr CPSR_fc, r6
7e50: 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) ) {
7e54: e1150006 tst r5, r6
7e58: 0a000013 beq 7eac <_Thread_queue_Enqueue_priority+0x150>
_ISR_Enable( level );
goto restart_reverse_search;
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
7e5c: 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 ) ) {
7e60: e15c0008 cmp ip, r8
7e64: 0a000002 beq 7e74 <_Thread_queue_Enqueue_priority+0x118>
search_priority = search_thread->current_priority;
7e68: e59c4014 ldr r4, [ip, #20]
if ( priority >= search_priority )
7e6c: e1530004 cmp r3, r4
7e70: 3afffff3 bcc 7e44 <_Thread_queue_Enqueue_priority+0xe8>
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
7e74: e5905030 ldr r5, [r0, #48] ; 0x30
7e78: e3550001 cmp r5, #1
7e7c: 1affffde bne 7dfc <_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 )
7e80: 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;
7e84: e3a03000 mov r3, #0
7e88: e5803030 str r3, [r0, #48] ; 0x30
if ( priority == search_priority )
7e8c: 0a000016 beq 7eec <_Thread_queue_Enqueue_priority+0x190>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
7e90: e59c3000 ldr r3, [ip]
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
7e94: e8811008 stm r1, {r3, ip}
search_node->next = the_node;
next_node->previous = the_node;
7e98: 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;
7e9c: e58c1000 str r1, [ip]
next_node->previous = the_node;
the_thread->Wait.queue = the_thread_queue;
7ea0: e5810044 str r0, [r1, #68] ; 0x44
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
7ea4: e129f007 msr CPSR_fc, r7
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
7ea8: eaffffd4 b 7e00 <_Thread_queue_Enqueue_priority+0xa4>
7eac: e129f007 msr CPSR_fc, r7 <== NOT EXECUTED
7eb0: eaffffd9 b 7e1c <_Thread_queue_Enqueue_priority+0xc0> <== NOT EXECUTED
7eb4: e129f007 msr CPSR_fc, r7
7eb8: eaffffb8 b 7da0 <_Thread_queue_Enqueue_priority+0x44>
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
if ( priority == search_priority )
7ebc: 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;
7ec0: e3a03000 mov r3, #0
7ec4: e5803030 str r3, [r0, #48] ; 0x30
if ( priority == search_priority )
7ec8: 0a000007 beq 7eec <_Thread_queue_Enqueue_priority+0x190>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
previous_node = search_node->previous;
7ecc: e59c3004 ldr r3, [ip, #4]
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
7ed0: e581c000 str ip, [r1]
the_node->previous = previous_node;
7ed4: e5813004 str r3, [r1, #4]
previous_node->next = the_node;
7ed8: e5831000 str r1, [r3]
search_node->previous = the_node;
7edc: e58c1004 str r1, [ip, #4]
the_thread->Wait.queue = the_thread_queue;
7ee0: e5810044 str r0, [r1, #68] ; 0x44
7ee4: e129f007 msr CPSR_fc, r7
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
7ee8: eaffffc4 b 7e00 <_Thread_queue_Enqueue_priority+0xa4>
7eec: 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;
7ef0: e59c3004 ldr r3, [ip, #4]
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
7ef4: e581c000 str ip, [r1]
the_node->previous = previous_node;
7ef8: e5813004 str r3, [r1, #4]
previous_node->next = the_node;
7efc: e5831000 str r1, [r3]
search_node->previous = the_node;
7f00: e58c1004 str r1, [ip, #4]
the_thread->Wait.queue = the_thread_queue;
7f04: e5810044 str r0, [r1, #68] ; 0x44
7f08: e129f00a msr CPSR_fc, sl
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
7f0c: e3a05001 mov r5, #1
7f10: eaffffba b 7e00 <_Thread_queue_Enqueue_priority+0xa4>
if ( _Thread_queue_Is_reverse_search( priority ) )
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
7f14: e3e04000 mvn r4, #0
7f18: eaffffb4 b 7df0 <_Thread_queue_Enqueue_priority+0x94>
0000bc80 <_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
)
{
bc80: e92d4070 push {r4, r5, r6, lr}
bc84: e20220ff and r2, r2, #255 ; 0xff
bc88: e1a04001 mov r4, r1
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
bc8c: e10f1000 mrs r1, CPSR
bc90: e3813080 orr r3, r1, #128 ; 0x80
bc94: 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);
bc98: e5943010 ldr r3, [r4, #16]
bc9c: e3c334ff bic r3, r3, #-16777216 ; 0xff000000
bca0: e3c3373f bic r3, r3, #16515072 ; 0xfc0000
bca4: e3c33c41 bic r3, r3, #16640 ; 0x4100
bca8: 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 ) ) {
bcac: e3530000 cmp r3, #0
bcb0: 0a000023 beq bd44 <_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));
bcb4: 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;
bcb8: e594c000 ldr ip, [r4]
previous_node = the_node->previous;
bcbc: e5945004 ldr r5, [r4, #4]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
bcc0: e284003c add r0, r4, #60 ; 0x3c
if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
bcc4: 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;
bcc8: 0585c000 streq ip, [r5]
next_node->previous = previous_node;
bccc: 058c5004 streq r5, [ip, #4]
*/
next_node = the_node->next;
previous_node = the_node->previous;
if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
bcd0: 0a00000d beq bd0c <_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;
bcd4: 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 ) ) {
bcd8: 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;
bcdc: e5936000 ldr r6, [r3]
previous_node->next = new_first_node;
next_node->previous = new_first_node;
bce0: 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;
bce4: e5853000 str r3, [r5]
next_node->previous = new_first_node;
new_first_node->next = next_node;
new_first_node->previous = previous_node;
bce8: 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;
bcec: e583c000 str ip, [r3]
new_first_node->previous = previous_node;
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
bcf0: 0a000005 beq bd0c <_Thread_queue_Extract_priority_helper+0x8c>
/* > two threads on 2-n */
new_second_node->previous =
_Chain_Head( &new_first_thread->Wait.Block2n );
bcf4: e2835038 add r5, r3, #56 ; 0x38
bcf8: 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 =
bcfc: e5865004 str r5, [r6, #4]
_Chain_Head( &new_first_thread->Wait.Block2n );
new_first_thread->Wait.Block2n.first = new_second_node;
bd00: e5836038 str r6, [r3, #56] ; 0x38
new_first_thread->Wait.Block2n.last = last_node;
bd04: e5830040 str r0, [r3, #64] ; 0x40
last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n );
bd08: e580c000 str ip, [r0]
/*
* If we are not supposed to touch timers or the thread's state, return.
*/
if ( requeuing ) {
bd0c: e3520000 cmp r2, #0
bd10: 1a000009 bne bd3c <_Thread_queue_Extract_priority_helper+0xbc>
_ISR_Enable( level );
return;
}
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
bd14: e5943050 ldr r3, [r4, #80] ; 0x50
bd18: e3530002 cmp r3, #2
bd1c: 0a00000a beq bd4c <_Thread_queue_Extract_priority_helper+0xcc>
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
bd20: e129f001 msr CPSR_fc, r1
bd24: e3a01201 mov r1, #268435456 ; 0x10000000
bd28: e2811bff add r1, r1, #261120 ; 0x3fc00
bd2c: e1a00004 mov r0, r4
bd30: 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
}
bd34: e8bd4070 pop {r4, r5, r6, lr}
bd38: eaffedad b 73f4 <_Thread_Clear_state>
bd3c: e129f001 msr CPSR_fc, r1
bd40: e8bd8070 pop {r4, r5, r6, pc}
bd44: e129f001 msr CPSR_fc, r1
bd48: e8bd8070 pop {r4, r5, r6, pc}
bd4c: e3a03003 mov r3, #3 <== NOT EXECUTED
bd50: e5843050 str r3, [r4, #80] ; 0x50 <== NOT EXECUTED
bd54: 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 );
bd58: e2840048 add r0, r4, #72 ; 0x48 <== NOT EXECUTED
bd5c: ebfff33a bl 8a4c <_Watchdog_Remove> <== NOT EXECUTED
bd60: eaffffef b bd24 <_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: eb0011ca bl 1a748 <_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: eb0002d0 bl 16b80 <_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: eb0011e2 bl 1a7f0 <_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: eb0002c4 bl 16b80 <_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: eb001179 bl 1a68c <_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: eb0011ce bl 1a7f0 <_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: eb00119f bl 1a748 <_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: eb000ee0 bl 19ce4 <_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: eb000c3a bl 19260 <_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: eb0011fd bl 1a97c <_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: eb0011fb bl 1a97c <_Watchdog_Remove>
1618c: eaffff99 b 15ff8 <_Timer_server_Body+0x64>
00008784 <_User_extensions_Thread_create>:
#include <rtems/score/userext.h>
bool _User_extensions_Thread_create (
Thread_Control *the_thread
)
{
8784: 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 ;
8788: e59f5050 ldr r5, [pc, #80] ; 87e0 <_User_extensions_Thread_create+0x5c>
878c: e4954004 ldr r4, [r5], #4
8790: e1540005 cmp r4, r5
#include <rtems/score/userext.h>
bool _User_extensions_Thread_create (
Thread_Control *the_thread
)
{
8794: e1a06000 mov r6, r0
Chain_Node *the_node;
User_extensions_Control *the_extension;
bool status;
for ( the_node = _User_extensions_List.first ;
8798: 0a00000e beq 87d8 <_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)(
879c: e59f7040 ldr r7, [pc, #64] ; 87e4 <_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 ) {
87a0: e5943014 ldr r3, [r4, #20]
87a4: e3530000 cmp r3, #0
status = (*the_extension->Callouts.thread_create)(
87a8: 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 ) {
87ac: 0a000004 beq 87c4 <_User_extensions_Thread_create+0x40>
status = (*the_extension->Callouts.thread_create)(
87b0: e5970004 ldr r0, [r7, #4]
87b4: e1a0e00f mov lr, pc
87b8: e12fff13 bx r3
_Thread_Executing,
the_thread
);
if ( !status )
87bc: e3500000 cmp r0, #0
87c0: 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 ) {
87c4: e5944000 ldr r4, [r4]
{
Chain_Node *the_node;
User_extensions_Control *the_extension;
bool status;
for ( the_node = _User_extensions_List.first ;
87c8: e1540005 cmp r4, r5
87cc: 1afffff3 bne 87a0 <_User_extensions_Thread_create+0x1c>
if ( !status )
return false;
}
}
return true;
87d0: e3a00001 mov r0, #1
87d4: e8bd80f0 pop {r4, r5, r6, r7, pc}
87d8: e3a00001 mov r0, #1 <== NOT EXECUTED
}
87dc: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
0000a77c <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
a77c: e92d41f0 push {r4, r5, r6, r7, r8, lr}
a780: e1a04000 mov r4, r0
a784: e1a05002 mov r5, r2
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
a788: e10f3000 mrs r3, CPSR
a78c: e3832080 orr r2, r3, #128 ; 0x80
a790: e129f002 msr CPSR_fc, r2
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
a794: e1a07000 mov r7, r0
a798: 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 ) ) {
a79c: e1520007 cmp r2, r7
a7a0: 0a000018 beq a808 <_Watchdog_Adjust+0x8c>
switch ( direction ) {
a7a4: e3510000 cmp r1, #0
a7a8: 1a000018 bne a810 <_Watchdog_Adjust+0x94>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
a7ac: e3550000 cmp r5, #0
a7b0: 0a000014 beq a808 <_Watchdog_Adjust+0x8c>
if ( units < _Watchdog_First( header )->delta_interval ) {
a7b4: e5926010 ldr r6, [r2, #16]
a7b8: e1550006 cmp r5, r6
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
a7bc: 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 ) {
a7c0: 2a000005 bcs a7dc <_Watchdog_Adjust+0x60>
a7c4: ea000018 b a82c <_Watchdog_Adjust+0xb0> <== NOT EXECUTED
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
a7c8: e0555006 subs r5, r5, r6
a7cc: 0a00000d beq a808 <_Watchdog_Adjust+0x8c>
if ( units < _Watchdog_First( header )->delta_interval ) {
a7d0: e5926010 ldr r6, [r2, #16]
a7d4: e1560005 cmp r6, r5
a7d8: 8a000013 bhi a82c <_Watchdog_Adjust+0xb0>
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
a7dc: e5828010 str r8, [r2, #16]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
a7e0: e129f003 msr CPSR_fc, r3
_ISR_Enable( level );
_Watchdog_Tickle( header );
a7e4: e1a00004 mov r0, r4
a7e8: eb0000a0 bl aa70 <_Watchdog_Tickle>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
a7ec: e10f3000 mrs r3, CPSR
a7f0: e3832080 orr r2, r3, #128 ; 0x80
a7f4: e129f002 msr CPSR_fc, r2
a7f8: e5941000 ldr r1, [r4]
_ISR_Disable( level );
if ( _Chain_Is_empty( header ) )
a7fc: e1570001 cmp r7, r1
RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First(
Chain_Control *header
)
{
return ( (Watchdog_Control *) header->first );
a800: e1a02001 mov r2, r1
a804: 1affffef bne a7c8 <_Watchdog_Adjust+0x4c>
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
a808: e129f003 msr CPSR_fc, r3
}
}
_ISR_Enable( level );
}
a80c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
switch ( direction ) {
a810: e3510001 cmp r1, #1
a814: 1afffffb bne a808 <_Watchdog_Adjust+0x8c>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
a818: e5921010 ldr r1, [r2, #16]
a81c: e0815005 add r5, r1, r5
a820: e5825010 str r5, [r2, #16]
a824: e129f003 msr CPSR_fc, r3
}
}
_ISR_Enable( level );
}
a828: 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;
a82c: e0655006 rsb r5, r5, r6
a830: e5825010 str r5, [r2, #16]
break;
a834: eafffff3 b a808 <_Watchdog_Adjust+0x8c>
00012c04 <_exit>:
extern void FINI_SYMBOL( void );
#endif
void EXIT_SYMBOL(int status)
{
12c04: e52de004 push {lr} ; (str lr, [sp, #-4]!)
12c08: 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();
12c0c: e58d0000 str r0, [sp]
12c10: eb0001ea bl 133c0 <___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();
12c14: ebffffe0 bl 12b9c <libc_wrapup>
rtems_shutdown_executive(status);
12c18: e59d0000 ldr r0, [sp]
12c1c: eb000038 bl 12d04 <rtems_shutdown_executive>
12c20: eafffffe b 12c20 <_exit+0x1c> <== 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: eb003985 bl 14160 <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: eb00397e bl 14160 <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: eb002c2a bl 10cec <__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: eb002235 bl a71c <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: eb002ff9 bl de98 <__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: eb002ff4 bl de98 <__errno> <== NOT EXECUTED
1ec4: e1a04000 mov r4, r0 <== NOT EXECUTED
1ec8: eb002ff2 bl de98 <__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
00009020 <devFS_evaluate_path>:
const char *pathname,
size_t pathnamelen,
int flags,
rtems_filesystem_location_info_t *pathloc
)
{
9020: 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;
9024: e5936000 ldr r6, [r3]
if (!device_name_table)
9028: e3560000 cmp r6, #0
const char *pathname,
size_t pathnamelen,
int flags,
rtems_filesystem_location_info_t *pathloc
)
{
902c: e1a0b003 mov fp, r3
9030: e1a0a000 mov sl, r0
9034: 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)
9038: 0a000025 beq 90d4 <devFS_evaluate_path+0xb4>
rtems_set_errno_and_return_minus_one( EFAULT );
for (i = 0; i < rtems_device_table_size; i++) {
903c: e59f30a4 ldr r3, [pc, #164] ; 90e8 <devFS_evaluate_path+0xc8>
9040: e5938000 ldr r8, [r3]
9044: e3580000 cmp r8, #0
9048: 13a09000 movne r9, #0
904c: 11a04009 movne r4, r9
9050: 0a000010 beq 9098 <devFS_evaluate_path+0x78>
if (!device_name_table[i].device_name)
9054: e0899109 add r9, r9, r9, lsl #2
9058: e7965109 ldr r5, [r6, r9, lsl #2]
905c: e2551000 subs r1, r5, #0
continue;
if (strncmp(pathname, device_name_table[i].device_name, pathnamelen) != 0)
9060: e1a0000a mov r0, sl
9064: 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)
9068: e0869109 add r9, r6, r9, lsl #2
906c: 0a000005 beq 9088 <devFS_evaluate_path+0x68>
continue;
if (strncmp(pathname, device_name_table[i].device_name, pathnamelen) != 0)
9070: eb000dfb bl c864 <strncmp>
9074: e3500000 cmp r0, #0
9078: 1a000002 bne 9088 <devFS_evaluate_path+0x68>
continue;
if (device_name_table[i].device_name[pathnamelen] != '\0')
907c: e7d50007 ldrb r0, [r5, r7]
9080: e3500000 cmp r0, #0
9084: 0a000008 beq 90ac <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++) {
9088: e2844001 add r4, r4, #1
908c: e1580004 cmp r8, r4
9090: e1a09004 mov r9, r4
9094: 8affffee bhi 9054 <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 );
9098: eb000a28 bl b940 <__errno>
909c: e3a03002 mov r3, #2
90a0: e5803000 str r3, [r0]
90a4: e3e00000 mvn r0, #0
}
90a8: 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;
90ac: e59f3038 ldr r3, [pc, #56] ; 90ec <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;
90b0: e59f2038 ldr r2, [pc, #56] ; 90f0 <devFS_evaluate_path+0xd0>
pathloc->ops = &devFS_ops;
pathloc->mt_entry = rtems_filesystem_root.mt_entry;
90b4: 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;
90b8: e58b2008 str r2, [fp, #8]
pathloc->ops = &devFS_ops;
pathloc->mt_entry = rtems_filesystem_root.mt_entry;
90bc: 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;
90c0: e59f202c ldr r2, [pc, #44] ; 90f4 <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];
90c4: e58b9000 str r9, [fp]
pathloc->handlers = &devFS_file_handlers;
pathloc->ops = &devFS_ops;
90c8: e58b200c str r2, [fp, #12]
pathloc->mt_entry = rtems_filesystem_root.mt_entry;
90cc: e58b3010 str r3, [fp, #16]
return 0;
90d0: 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 );
90d4: eb000a19 bl b940 <__errno> <== NOT EXECUTED
90d8: e3a0300e mov r3, #14 <== NOT EXECUTED
90dc: e5803000 str r3, [r0] <== NOT EXECUTED
90e0: e3e00000 mvn r0, #0 <== NOT EXECUTED
90e4: 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: eb001ccb bl 8a08 <_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: eb002aff bl c2f4 <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: eb00288a bl b940 <__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: eb001063 bl 5ad8 <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: eb001de8 bl 9104 <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: eb002b53 bl c4e4 <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: eb002c02 bl c804 <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: eb00284a bl b940 <__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: eb00283b bl b940 <__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: eb002836 bl b940 <__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: eb002831 bl b940 <__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: eb0010a0 bl 5c68 <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: eb001dc1 bl 9104 <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: eb0027c3 bl b940 <__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: eb00108c bl 5cbc <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: eb001d98 bl 9104 <rtems_deviceio_errno> <== NOT EXECUTED
1aa0: eafffffb b 1a94 <devFS_write+0x54> <== NOT EXECUTED
0000cd38 <device_ioctl>:
int device_ioctl(
rtems_libio_t *iop,
uint32_t command,
void *buffer
)
{
cd38: e52de004 push {lr} ; (str lr, [sp, #-4]!)
args.iop = iop;
args.command = command;
args.buffer = buffer;
the_jnode = iop->pathinfo.node_access;
cd3c: e590c018 ldr ip, [r0, #24]
int device_ioctl(
rtems_libio_t *iop,
uint32_t command,
void *buffer
)
{
cd40: e24dd010 sub sp, sp, #16
cd44: 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;
cd48: e98d0006 stmib sp, {r1, r2}
args.buffer = buffer;
the_jnode = iop->pathinfo.node_access;
status = rtems_io_control(
cd4c: e28c0050 add r0, ip, #80 ; 0x50
cd50: e8900003 ldm r0, {r0, r1}
cd54: e1a0200d mov r2, sp
{
rtems_libio_ioctl_args_t args;
rtems_status_code status;
IMFS_jnode_t *the_jnode;
args.iop = iop;
cd58: e58d3000 str r3, [sp]
args.command = command;
args.buffer = buffer;
the_jnode = iop->pathinfo.node_access;
status = rtems_io_control(
cd5c: eb000274 bl d734 <rtems_io_control>
the_jnode->info.device.major,
the_jnode->info.device.minor,
(void *) &args
);
if ( status )
cd60: e3500000 cmp r0, #0
return rtems_deviceio_errno(status);
return args.ioctl_return;
cd64: 059d000c ldreq r0, [sp, #12]
the_jnode->info.device.major,
the_jnode->info.device.minor,
(void *) &args
);
if ( status )
cd68: 1a000001 bne cd74 <device_ioctl+0x3c>
return rtems_deviceio_errno(status);
return args.ioctl_return;
}
cd6c: e28dd010 add sp, sp, #16
cd70: e8bd8000 pop {pc}
the_jnode->info.device.minor,
(void *) &args
);
if ( status )
return rtems_deviceio_errno(status);
cd74: eb000317 bl d9d8 <rtems_deviceio_errno> <== NOT EXECUTED
cd78: eafffffb b cd6c <device_ioctl+0x34> <== NOT EXECUTED
0000cc70 <device_read>:
ssize_t device_read(
rtems_libio_t *iop,
void *buffer,
size_t count
)
{
cc70: 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;
cc74: e590c018 ldr ip, [r0, #24]
ssize_t device_read(
rtems_libio_t *iop,
void *buffer,
size_t count
)
{
cc78: e24dd01c sub sp, sp, #28
cc7c: e1a03000 mov r3, r0
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
cc80: e280500c add r5, r0, #12
cc84: e8950030 ldm r5, {r4, r5}
args.buffer = buffer;
args.count = count;
args.flags = iop->flags;
cc88: e590e014 ldr lr, [r0, #20]
the_jnode = iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
args.buffer = buffer;
cc8c: e58d100c str r1, [sp, #12]
args.count = count;
cc90: e58d2010 str r2, [sp, #16]
rtems_status_code status;
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
args.iop = iop;
cc94: e58d3000 str r3, [sp]
args.buffer = buffer;
args.count = count;
args.flags = iop->flags;
args.bytes_moved = 0;
status = rtems_io_read(
cc98: 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;
cc9c: e3a03000 mov r3, #0
status = rtems_io_read(
cca0: e59c1054 ldr r1, [ip, #84] ; 0x54
cca4: e1a0200d mov r2, sp
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
cca8: e98d0030 stmib sp, {r4, r5}
args.buffer = buffer;
args.count = count;
args.flags = iop->flags;
ccac: e58de014 str lr, [sp, #20]
args.bytes_moved = 0;
ccb0: e58d3018 str r3, [sp, #24]
status = rtems_io_read(
ccb4: eb0002c8 bl d7dc <rtems_io_read>
the_jnode->info.device.major,
the_jnode->info.device.minor,
(void *) &args
);
if ( status )
ccb8: e3500000 cmp r0, #0
return rtems_deviceio_errno(status);
return (ssize_t) args.bytes_moved;
ccbc: 059d0018 ldreq r0, [sp, #24]
the_jnode->info.device.major,
the_jnode->info.device.minor,
(void *) &args
);
if ( status )
ccc0: 1a000001 bne cccc <device_read+0x5c>
return rtems_deviceio_errno(status);
return (ssize_t) args.bytes_moved;
}
ccc4: e28dd01c add sp, sp, #28
ccc8: e8bd8030 pop {r4, r5, pc}
the_jnode->info.device.minor,
(void *) &args
);
if ( status )
return rtems_deviceio_errno(status);
cccc: eb000341 bl d9d8 <rtems_deviceio_errno> <== NOT EXECUTED
ccd0: eafffffb b ccc4 <device_read+0x54> <== NOT EXECUTED
0000ccd4 <device_write>:
ssize_t device_write(
rtems_libio_t *iop,
const void *buffer,
size_t count
)
{
ccd4: 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;
ccd8: e590c018 ldr ip, [r0, #24]
ssize_t device_write(
rtems_libio_t *iop,
const void *buffer,
size_t count
)
{
ccdc: e24dd01c sub sp, sp, #28
cce0: e1a03000 mov r3, r0
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
cce4: e280500c add r5, r0, #12
cce8: e8950030 ldm r5, {r4, r5}
args.buffer = (void *) buffer;
args.count = count;
args.flags = iop->flags;
ccec: e590e014 ldr lr, [r0, #20]
the_jnode = iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
args.buffer = (void *) buffer;
ccf0: e58d100c str r1, [sp, #12]
args.count = count;
ccf4: e58d2010 str r2, [sp, #16]
rtems_status_code status;
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
args.iop = iop;
ccf8: e58d3000 str r3, [sp]
args.buffer = (void *) buffer;
args.count = count;
args.flags = iop->flags;
args.bytes_moved = 0;
status = rtems_io_write(
ccfc: 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;
cd00: e3a03000 mov r3, #0
status = rtems_io_write(
cd04: e59c1054 ldr r1, [ip, #84] ; 0x54
cd08: e1a0200d mov r2, sp
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
args.iop = iop;
args.offset = iop->offset;
cd0c: e98d0030 stmib sp, {r4, r5}
args.buffer = (void *) buffer;
args.count = count;
args.flags = iop->flags;
cd10: e58de014 str lr, [sp, #20]
args.bytes_moved = 0;
cd14: e58d3018 str r3, [sp, #24]
status = rtems_io_write(
cd18: eb0002c4 bl d830 <rtems_io_write>
the_jnode->info.device.major,
the_jnode->info.device.minor,
(void *) &args
);
if ( status )
cd1c: e3500000 cmp r0, #0
return rtems_deviceio_errno(status);
return (ssize_t) args.bytes_moved;
cd20: 059d0018 ldreq r0, [sp, #24]
the_jnode->info.device.major,
the_jnode->info.device.minor,
(void *) &args
);
if ( status )
cd24: 1a000001 bne cd30 <device_write+0x5c>
return rtems_deviceio_errno(status);
return (ssize_t) args.bytes_moved;
}
cd28: e28dd01c add sp, sp, #28
cd2c: e8bd8030 pop {r4, r5, pc}
the_jnode->info.device.minor,
(void *) &args
);
if ( status )
return rtems_deviceio_errno(status);
cd30: eb000328 bl d9d8 <rtems_deviceio_errno> <== NOT EXECUTED
cd34: eafffffb b cd28 <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: eb000b5e bl 5ce0 <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: eb003058 bl eacc <__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: eb00303c bl eacc <__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: eb003039 bl eacc <__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: eb00300a bl eacc <__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>
0000b9e8 <fifo_open>:
*/
int fifo_open(
pipe_control_t **pipep,
rtems_libio_t *iop
)
{
b9e8: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
b9ec: e24dd00c sub sp, sp, #12
b9f0: e1a05000 mov r5, r0
b9f4: e1a07001 mov r7, r1
)
{
pipe_control_t *pipe;
int err = 0;
err = pipe_lock();
b9f8: ebffff82 bl b808 <pipe_lock>
if (err)
b9fc: e2504000 subs r4, r0, #0
ba00: 1a00001b bne ba74 <fifo_open+0x8c>
return err;
pipe = *pipep;
ba04: e5956000 ldr r6, [r5]
if (pipe == NULL) {
ba08: e3560000 cmp r6, #0
ba0c: 0a00001b beq ba80 <fifo_open+0x98>
err = pipe_alloc(&pipe);
if (err)
goto out;
}
if (! PIPE_LOCK(pipe))
ba10: e3a01000 mov r1, #0
ba14: e5960028 ldr r0, [r6, #40] ; 0x28
ba18: e1a02001 mov r2, r1
ba1c: ebffed16 bl 6e7c <rtems_semaphore_obtain>
err = -EINTR;
if (*pipep == NULL) {
ba20: e5953000 ldr r3, [r5]
err = pipe_alloc(&pipe);
if (err)
goto out;
}
if (! PIPE_LOCK(pipe))
ba24: e3500000 cmp r0, #0
ba28: 13e08003 mvnne r8, #3
ba2c: 03a08000 moveq r8, #0
err = -EINTR;
if (*pipep == NULL) {
ba30: e3530000 cmp r3, #0
ba34: 0a0000bd beq bd30 <fifo_open+0x348>
else
*pipep = pipe;
}
out:
pipe_unlock();
ba38: ebffff9d bl b8b4 <pipe_unlock>
pipe_control_t *pipe;
unsigned int prevCounter;
int err;
err = pipe_new(pipep);
if (err)
ba3c: e3580000 cmp r8, #0
ba40: 11a04008 movne r4, r8
ba44: 1a00000a bne ba74 <fifo_open+0x8c>
return err;
pipe = *pipep;
switch (LIBIO_ACCMODE(iop)) {
ba48: e5973014 ldr r3, [r7, #20]
ba4c: e2033006 and r3, r3, #6
ba50: e3530004 cmp r3, #4
int err;
err = pipe_new(pipep);
if (err)
return err;
pipe = *pipep;
ba54: e5956000 ldr r6, [r5]
switch (LIBIO_ACCMODE(iop)) {
ba58: 0a000094 beq bcb0 <fifo_open+0x2c8>
ba5c: e3530006 cmp r3, #6
ba60: 0a00007e beq bc60 <fifo_open+0x278>
ba64: e3530002 cmp r3, #2
ba68: 0a000058 beq bbd0 <fifo_open+0x1e8>
if (pipe->Writers ++ == 0)
PIPE_WAKEUPREADERS(pipe);
break;
}
PIPE_UNLOCK(pipe);
ba6c: e5960028 ldr r0, [r6, #40] ; 0x28
ba70: ebffed4a bl 6fa0 <rtems_semaphore_release>
return 0;
out_error:
pipe_release(pipep, iop);
return err;
}
ba74: e1a00004 mov r0, r4
ba78: e28dd00c add sp, sp, #12
ba7c: 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));
ba80: e3a00034 mov r0, #52 ; 0x34
ba84: ebffdfbe bl 3984 <malloc>
if (pipe == NULL)
ba88: e3500000 cmp r0, #0
{
static char c = 'a';
pipe_control_t *pipe;
int err = -ENOMEM;
pipe = malloc(sizeof(pipe_control_t));
ba8c: e1a06000 mov r6, r0
ba90: e1a0a000 mov sl, r0
if (pipe == NULL)
ba94: 0a0000cf beq bdd8 <fifo_open+0x3f0>
return err;
memset(pipe, 0, sizeof(pipe_control_t));
ba98: e1a02000 mov r2, r0
ba9c: e4824004 str r4, [r2], #4
baa0: e2822004 add r2, r2, #4
baa4: e4824004 str r4, [r2], #4
baa8: e4824004 str r4, [r2], #4
baac: e4824004 str r4, [r2], #4
bab0: e4824004 str r4, [r2], #4
bab4: e4824004 str r4, [r2], #4
bab8: e4824004 str r4, [r2], #4
babc: e4824004 str r4, [r2], #4
bac0: e4824004 str r4, [r2], #4
bac4: e4824004 str r4, [r2], #4
bac8: e4824004 str r4, [r2], #4
pipe->Size = PIPE_BUF;
bacc: 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));
bad0: e5824000 str r4, [r2]
pipe->Size = PIPE_BUF;
pipe->Buffer = malloc(pipe->Size);
bad4: 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;
bad8: e5863004 str r3, [r6, #4]
pipe->Buffer = malloc(pipe->Size);
badc: ebffdfa8 bl 3984 <malloc>
if (! pipe->Buffer)
bae0: 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);
bae4: e5860000 str r0, [r6]
if (! pipe->Buffer)
bae8: 0a0000b8 beq bdd0 <fifo_open+0x3e8>
goto err_buf;
err = -ENOMEM;
if (rtems_barrier_create(
rtems_build_name ('P', 'I', 'r', c),
baec: e59f82f0 ldr r8, [pc, #752] ; bde4 <fifo_open+0x3fc>
baf0: e5d80000 ldrb r0, [r8]
if (! pipe->Buffer)
goto err_buf;
err = -ENOMEM;
if (rtems_barrier_create(
baf4: e3800205 orr r0, r0, #1342177280 ; 0x50000000
baf8: e3800849 orr r0, r0, #4784128 ; 0x490000
bafc: e3800c72 orr r0, r0, #29184 ; 0x7200
bb00: e1a01004 mov r1, r4
bb04: e1a02004 mov r2, r4
bb08: e286302c add r3, r6, #44 ; 0x2c
bb0c: eb000712 bl d75c <rtems_barrier_create>
bb10: e3500000 cmp r0, #0
bb14: 1a0000ab bne bdc8 <fifo_open+0x3e0>
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),
bb18: 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(
bb1c: e3800205 orr r0, r0, #1342177280 ; 0x50000000
bb20: e3800849 orr r0, r0, #4784128 ; 0x490000
bb24: e3800c77 orr r0, r0, #30464 ; 0x7700
bb28: e1a01004 mov r1, r4
bb2c: e1a02004 mov r2, r4
bb30: e2863030 add r3, r6, #48 ; 0x30
bb34: eb000708 bl d75c <rtems_barrier_create>
bb38: e3500000 cmp r0, #0
bb3c: 1a00009f bne bdc0 <fifo_open+0x3d8>
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,
bb40: 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(
bb44: e3800205 orr r0, r0, #1342177280 ; 0x50000000
bb48: e3800849 orr r0, r0, #4784128 ; 0x490000
bb4c: e286c028 add ip, r6, #40 ; 0x28
bb50: e3800c73 orr r0, r0, #29440 ; 0x7300
bb54: e3a01001 mov r1, #1
bb58: e3a02010 mov r2, #16
bb5c: e1a03004 mov r3, r4
bb60: e58dc000 str ip, [sp]
bb64: ebffec2a bl 6c14 <rtems_semaphore_create>
bb68: e3500000 cmp r0, #0
bb6c: 1a000091 bne bdb8 <fifo_open+0x3d0>
/* Set barriers to be interruptible by signals. */
static void pipe_interruptible(pipe_control_t *pipe)
{
Objects_Locations location;
_Barrier_Get(pipe->readBarrier, &location)->Barrier.Wait_queue.state
bb70: e28da004 add sl, sp, #4
Objects_Id id,
Objects_Locations *location
)
{
return (Barrier_Control *)
_Objects_Get( &_Barrier_Information, id, location );
bb74: e596102c ldr r1, [r6, #44] ; 0x2c
bb78: e1a0200a mov r2, sl
bb7c: e59f0264 ldr r0, [pc, #612] ; bde8 <fifo_open+0x400>
bb80: ebfff2dc bl 86f8 <_Objects_Get>
|= STATES_INTERRUPTIBLE_BY_SIGNAL;
bb84: e590304c ldr r3, [r0, #76] ; 0x4c
bb88: e3833201 orr r3, r3, #268435456 ; 0x10000000
bb8c: e580304c str r3, [r0, #76] ; 0x4c
_Thread_Enable_dispatch();
bb90: ebfff502 bl 8fa0 <_Thread_Enable_dispatch>
bb94: e1a0200a mov r2, sl
bb98: e5961030 ldr r1, [r6, #48] ; 0x30
bb9c: e59f0244 ldr r0, [pc, #580] ; bde8 <fifo_open+0x400>
bba0: ebfff2d4 bl 86f8 <_Objects_Get>
_Barrier_Get(pipe->writeBarrier, &location)->Barrier.Wait_queue.state
|= STATES_INTERRUPTIBLE_BY_SIGNAL;
bba4: e590304c ldr r3, [r0, #76] ; 0x4c
bba8: e3833201 orr r3, r3, #268435456 ; 0x10000000
bbac: e580304c str r3, [r0, #76] ; 0x4c
_Thread_Enable_dispatch();
bbb0: ebfff4fa bl 8fa0 <_Thread_Enable_dispatch>
#ifdef RTEMS_POSIX_API
pipe_interruptible(pipe);
#endif
*pipep = pipe;
if (c ++ == 'z')
bbb4: e5d83000 ldrb r3, [r8]
bbb8: e353007a cmp r3, #122 ; 0x7a
bbbc: e2832001 add r2, r3, #1
c = 'a';
bbc0: 03a03061 moveq r3, #97 ; 0x61
#ifdef RTEMS_POSIX_API
pipe_interruptible(pipe);
#endif
*pipep = pipe;
if (c ++ == 'z')
bbc4: e5c82000 strb r2, [r8]
c = 'a';
bbc8: 05c83000 strbeq r3, [r8]
bbcc: eaffff8f b ba10 <fifo_open+0x28>
pipe = *pipep;
switch (LIBIO_ACCMODE(iop)) {
case LIBIO_FLAGS_READ:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
bbd0: e5963010 ldr r3, [r6, #16]
return err;
pipe = *pipep;
switch (LIBIO_ACCMODE(iop)) {
case LIBIO_FLAGS_READ:
pipe->readerCounter ++;
bbd4: e5961020 ldr r1, [r6, #32]
if (pipe->Readers ++ == 0)
bbd8: e2832001 add r2, r3, #1
return err;
pipe = *pipep;
switch (LIBIO_ACCMODE(iop)) {
case LIBIO_FLAGS_READ:
pipe->readerCounter ++;
bbdc: e2811001 add r1, r1, #1
if (pipe->Readers ++ == 0)
bbe0: e3530000 cmp r3, #0
return err;
pipe = *pipep;
switch (LIBIO_ACCMODE(iop)) {
case LIBIO_FLAGS_READ:
pipe->readerCounter ++;
bbe4: e5861020 str r1, [r6, #32]
if (pipe->Readers ++ == 0)
bbe8: e5862010 str r2, [r6, #16]
bbec: 0a000069 beq bd98 <fifo_open+0x3b0>
PIPE_WAKEUPWRITERS(pipe);
if (pipe->Writers == 0) {
bbf0: e5963014 ldr r3, [r6, #20]
bbf4: e3530000 cmp r3, #0
bbf8: 1affff9b bne ba6c <fifo_open+0x84>
/* Not an error */
if (LIBIO_NODELAY(iop))
bbfc: e5973014 ldr r3, [r7, #20]
bc00: e3130001 tst r3, #1
bc04: 1affff98 bne ba6c <fifo_open+0x84>
break;
prevCounter = pipe->writerCounter;
bc08: e5968024 ldr r8, [r6, #36] ; 0x24
bc0c: ea000006 b bc2c <fifo_open+0x244>
/* Wait until a writer opens the pipe */
do {
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
goto out_error;
if (! PIPE_LOCK(pipe))
bc10: e5960028 ldr r0, [r6, #40] ; 0x28
bc14: ebffec98 bl 6e7c <rtems_semaphore_obtain>
bc18: e3500000 cmp r0, #0
bc1c: 1a00000a bne bc4c <fifo_open+0x264>
goto out_error;
} while (prevCounter == pipe->writerCounter);
bc20: e5963024 ldr r3, [r6, #36] ; 0x24
bc24: e1530008 cmp r3, r8
bc28: 1affff8f bne ba6c <fifo_open+0x84>
prevCounter = pipe->writerCounter;
err = -EINTR;
/* Wait until a writer opens the pipe */
do {
PIPE_UNLOCK(pipe);
bc2c: e5960028 ldr r0, [r6, #40] ; 0x28
bc30: ebffecda bl 6fa0 <rtems_semaphore_release>
if (! PIPE_READWAIT(pipe))
bc34: e3a01000 mov r1, #0
bc38: e596002c ldr r0, [r6, #44] ; 0x2c
bc3c: eb00073c bl d934 <rtems_barrier_wait>
bc40: e2501000 subs r1, r0, #0
goto out_error;
if (! PIPE_LOCK(pipe))
bc44: e1a02001 mov r2, r1
prevCounter = pipe->writerCounter;
err = -EINTR;
/* Wait until a writer opens the pipe */
do {
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
bc48: 0afffff0 beq bc10 <fifo_open+0x228>
goto out_error;
}
if (pipe->Readers == 0) {
prevCounter = pipe->readerCounter;
err = -EINTR;
bc4c: e3e04003 mvn r4, #3 <== NOT EXECUTED
PIPE_UNLOCK(pipe);
return 0;
out_error:
pipe_release(pipep, iop);
bc50: e1a00005 mov r0, r5
bc54: e1a01007 mov r1, r7
bc58: ebffff20 bl b8e0 <pipe_release>
return err;
bc5c: eaffff84 b ba74 <fifo_open+0x8c>
}
break;
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
bc60: e5963010 ldr r3, [r6, #16]
} while (prevCounter == pipe->readerCounter);
}
break;
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
bc64: e5961020 ldr r1, [r6, #32]
if (pipe->Readers ++ == 0)
bc68: e2832001 add r2, r3, #1
} while (prevCounter == pipe->readerCounter);
}
break;
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
bc6c: e2811001 add r1, r1, #1
if (pipe->Readers ++ == 0)
bc70: e3530000 cmp r3, #0
} while (prevCounter == pipe->readerCounter);
}
break;
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
bc74: e5861020 str r1, [r6, #32]
if (pipe->Readers ++ == 0)
bc78: e5862010 str r2, [r6, #16]
bc7c: 0a00003d beq bd78 <fifo_open+0x390>
PIPE_WAKEUPWRITERS(pipe);
pipe->writerCounter ++;
if (pipe->Writers ++ == 0)
bc80: e5963014 ldr r3, [r6, #20]
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
PIPE_WAKEUPWRITERS(pipe);
pipe->writerCounter ++;
bc84: e5961024 ldr r1, [r6, #36] ; 0x24
if (pipe->Writers ++ == 0)
bc88: e2832001 add r2, r3, #1
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
PIPE_WAKEUPWRITERS(pipe);
pipe->writerCounter ++;
bc8c: e2811001 add r1, r1, #1
if (pipe->Writers ++ == 0)
bc90: e3530000 cmp r3, #0
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
PIPE_WAKEUPWRITERS(pipe);
pipe->writerCounter ++;
bc94: e5861024 str r1, [r6, #36] ; 0x24
if (pipe->Writers ++ == 0)
bc98: e5862014 str r2, [r6, #20]
bc9c: 1affff72 bne ba6c <fifo_open+0x84>
PIPE_WAKEUPREADERS(pipe);
bca0: e596002c ldr r0, [r6, #44] ; 0x2c
bca4: e28d1008 add r1, sp, #8
bca8: eb000709 bl d8d4 <rtems_barrier_release>
bcac: eaffff6e b ba6c <fifo_open+0x84>
break;
case LIBIO_FLAGS_WRITE:
pipe->writerCounter ++;
if (pipe->Writers ++ == 0)
bcb0: e5963014 ldr r3, [r6, #20]
} while (prevCounter == pipe->writerCounter);
}
break;
case LIBIO_FLAGS_WRITE:
pipe->writerCounter ++;
bcb4: e5961024 ldr r1, [r6, #36] ; 0x24
if (pipe->Writers ++ == 0)
bcb8: e2832001 add r2, r3, #1
} while (prevCounter == pipe->writerCounter);
}
break;
case LIBIO_FLAGS_WRITE:
pipe->writerCounter ++;
bcbc: e2811001 add r1, r1, #1
if (pipe->Writers ++ == 0)
bcc0: e3530000 cmp r3, #0
} while (prevCounter == pipe->writerCounter);
}
break;
case LIBIO_FLAGS_WRITE:
pipe->writerCounter ++;
bcc4: e5861024 str r1, [r6, #36] ; 0x24
if (pipe->Writers ++ == 0)
bcc8: e5862014 str r2, [r6, #20]
bccc: 0a00002d beq bd88 <fifo_open+0x3a0>
PIPE_WAKEUPREADERS(pipe);
if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) {
bcd0: e5963010 ldr r3, [r6, #16]
bcd4: e3530000 cmp r3, #0
bcd8: 1affff63 bne ba6c <fifo_open+0x84>
bcdc: e5973014 ldr r3, [r7, #20]
bce0: e3130001 tst r3, #1
err = -ENXIO;
goto out_error;
}
if (pipe->Readers == 0) {
prevCounter = pipe->readerCounter;
bce4: 05968020 ldreq r8, [r6, #32]
pipe->writerCounter ++;
if (pipe->Writers ++ == 0)
PIPE_WAKEUPREADERS(pipe);
if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) {
bce8: 0a000007 beq bd0c <fifo_open+0x324>
bcec: ea00002d b bda8 <fifo_open+0x3c0>
err = -EINTR;
do {
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
goto out_error;
if (! PIPE_LOCK(pipe))
bcf0: e5960028 ldr r0, [r6, #40] ; 0x28
bcf4: ebffec60 bl 6e7c <rtems_semaphore_obtain>
bcf8: e3500000 cmp r0, #0
bcfc: 1affffd2 bne bc4c <fifo_open+0x264>
goto out_error;
} while (prevCounter == pipe->readerCounter);
bd00: e5963020 ldr r3, [r6, #32]
bd04: e1530008 cmp r3, r8
bd08: 1affff57 bne ba6c <fifo_open+0x84>
if (pipe->Readers == 0) {
prevCounter = pipe->readerCounter;
err = -EINTR;
do {
PIPE_UNLOCK(pipe);
bd0c: e5960028 ldr r0, [r6, #40] ; 0x28
bd10: ebffeca2 bl 6fa0 <rtems_semaphore_release>
if (! PIPE_WRITEWAIT(pipe))
bd14: e3a01000 mov r1, #0
bd18: e5960030 ldr r0, [r6, #48] ; 0x30
bd1c: eb000704 bl d934 <rtems_barrier_wait>
bd20: e2501000 subs r1, r0, #0
goto out_error;
if (! PIPE_LOCK(pipe))
bd24: e1a02001 mov r2, r1
if (pipe->Readers == 0) {
prevCounter = pipe->readerCounter;
err = -EINTR;
do {
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
bd28: 0afffff0 beq bcf0 <fifo_open+0x308>
bd2c: eaffffc6 b bc4c <fifo_open+0x264> <== NOT EXECUTED
if (! PIPE_LOCK(pipe))
err = -EINTR;
if (*pipep == NULL) {
if (err)
bd30: e3580000 cmp r8, #0
bd34: 1a000002 bne bd44 <fifo_open+0x35c>
pipe_free(pipe);
else
*pipep = pipe;
bd38: e5856000 str r6, [r5]
}
out:
pipe_unlock();
bd3c: ebfffedc bl b8b4 <pipe_unlock>
bd40: eaffff40 b ba48 <fifo_open+0x60>
/* Called with pipe_semaphore held. */
static inline void pipe_free(
pipe_control_t *pipe
)
{
rtems_barrier_delete(pipe->readBarrier);
bd44: e596002c ldr r0, [r6, #44] ; 0x2c <== NOT EXECUTED
bd48: eb0006b5 bl d824 <rtems_barrier_delete> <== NOT EXECUTED
rtems_barrier_delete(pipe->writeBarrier);
bd4c: e5960030 ldr r0, [r6, #48] ; 0x30 <== NOT EXECUTED
bd50: eb0006b3 bl d824 <rtems_barrier_delete> <== NOT EXECUTED
rtems_semaphore_delete(pipe->Semaphore);
bd54: e5960028 ldr r0, [r6, #40] ; 0x28 <== NOT EXECUTED
bd58: ebffec1e bl 6dd8 <rtems_semaphore_delete> <== NOT EXECUTED
free(pipe->Buffer);
bd5c: e5960000 ldr r0, [r6] <== NOT EXECUTED
bd60: ebffdd5e bl 32e0 <free> <== NOT EXECUTED
free(pipe);
bd64: e1a00006 mov r0, r6 <== NOT EXECUTED
bd68: ebffdd5c bl 32e0 <free> <== NOT EXECUTED
bd6c: e1a04008 mov r4, r8 <== NOT EXECUTED
else
*pipep = pipe;
}
out:
pipe_unlock();
bd70: ebfffecf bl b8b4 <pipe_unlock> <== NOT EXECUTED
bd74: eaffff3e b ba74 <fifo_open+0x8c> <== NOT EXECUTED
break;
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
PIPE_WAKEUPWRITERS(pipe);
bd78: e5960030 ldr r0, [r6, #48] ; 0x30
bd7c: e28d1008 add r1, sp, #8
bd80: eb0006d3 bl d8d4 <rtems_barrier_release>
bd84: eaffffbd b bc80 <fifo_open+0x298>
case LIBIO_FLAGS_WRITE:
pipe->writerCounter ++;
if (pipe->Writers ++ == 0)
PIPE_WAKEUPREADERS(pipe);
bd88: e596002c ldr r0, [r6, #44] ; 0x2c
bd8c: e28d1008 add r1, sp, #8
bd90: eb0006cf bl d8d4 <rtems_barrier_release>
bd94: eaffffcd b bcd0 <fifo_open+0x2e8>
switch (LIBIO_ACCMODE(iop)) {
case LIBIO_FLAGS_READ:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
PIPE_WAKEUPWRITERS(pipe);
bd98: e5960030 ldr r0, [r6, #48] ; 0x30
bd9c: e28d1008 add r1, sp, #8
bda0: eb0006cb bl d8d4 <rtems_barrier_release>
bda4: eaffff91 b bbf0 <fifo_open+0x208>
if (pipe->Writers ++ == 0)
PIPE_WAKEUPREADERS(pipe);
if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) {
PIPE_UNLOCK(pipe);
bda8: e5960028 ldr r0, [r6, #40] ; 0x28
bdac: ebffec7b bl 6fa0 <rtems_semaphore_release>
err = -ENXIO;
bdb0: e3e04005 mvn r4, #5
goto out_error;
bdb4: eaffffa5 b bc50 <fifo_open+0x268>
if (c ++ == 'z')
c = 'a';
return 0;
err_sem:
rtems_barrier_delete(pipe->writeBarrier);
bdb8: e5960030 ldr r0, [r6, #48] ; 0x30
bdbc: eb000698 bl d824 <rtems_barrier_delete>
err_wbar:
rtems_barrier_delete(pipe->readBarrier);
bdc0: e59a002c ldr r0, [sl, #44] ; 0x2c
bdc4: eb000696 bl d824 <rtems_barrier_delete>
err_rbar:
free(pipe->Buffer);
bdc8: e59a0000 ldr r0, [sl]
bdcc: ebffdd43 bl 32e0 <free>
err_buf:
free(pipe);
bdd0: e1a0000a mov r0, sl
bdd4: ebffdd41 bl 32e0 <free>
{
rtems_barrier_delete(pipe->readBarrier);
rtems_barrier_delete(pipe->writeBarrier);
rtems_semaphore_delete(pipe->Semaphore);
free(pipe->Buffer);
free(pipe);
bdd8: e3e0400b mvn r4, #11
else
*pipep = pipe;
}
out:
pipe_unlock();
bddc: ebfffeb4 bl b8b4 <pipe_unlock>
bde0: eaffff23 b ba74 <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: eb002fba bl eacc <__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: eb002f9f bl eacc <__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: eb002f9a bl eacc <__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
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}
00021c7c <killinfo>:
int killinfo(
pid_t pid,
int sig,
const union sigval *value
)
{
21c7c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
21c80: e24dd00c sub sp, sp, #12
21c84: e1a04000 mov r4, r0
21c88: e1a05001 mov r5, r1
21c8c: e1a08002 mov r8, r2
POSIX_signals_Siginfo_node *psiginfo;
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid != getpid() )
21c90: ebffff40 bl 21998 <getpid>
21c94: e1500004 cmp r0, r4
21c98: 1a000093 bne 21eec <killinfo+0x270>
rtems_set_errno_and_return_minus_one( ESRCH );
/*
* Validate the signal passed.
*/
if ( !sig )
21c9c: e3550000 cmp r5, #0
21ca0: 0a000096 beq 21f00 <killinfo+0x284>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
21ca4: e2454001 sub r4, r5, #1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
21ca8: e354001f cmp r4, #31
21cac: 8a000093 bhi 21f00 <killinfo+0x284>
rtems_set_errno_and_return_minus_one( EINVAL );
/*
* If the signal is being ignored, then we are out of here.
*/
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
21cb0: e59f6274 ldr r6, [pc, #628] ; 21f2c <killinfo+0x2b0>
21cb4: e1a07085 lsl r7, r5, #1
21cb8: e0873005 add r3, r7, r5
21cbc: e0863103 add r3, r6, r3, lsl #2
21cc0: e5933008 ldr r3, [r3, #8]
21cc4: e3530001 cmp r3, #1
return 0;
21cc8: 03a00000 moveq r0, #0
rtems_set_errno_and_return_minus_one( EINVAL );
/*
* If the signal is being ignored, then we are out of here.
*/
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
21ccc: 0a000038 beq 21db4 <killinfo+0x138>
/*
* P1003.1c/Draft 10, p. 33 says that certain signals should always
* be directed to the executing thread such as those caused by hardware
* faults.
*/
if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) )
21cd0: e3550008 cmp r5, #8
21cd4: 13550004 cmpne r5, #4
21cd8: 0a000037 beq 21dbc <killinfo+0x140>
21cdc: e355000b cmp r5, #11
21ce0: 0a000035 beq 21dbc <killinfo+0x140>
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
21ce4: e3a03001 mov r3, #1
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
siginfo->si_code = SI_USER;
21ce8: e58d3004 str r3, [sp, #4]
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
21cec: e58d5000 str r5, [sp]
siginfo->si_code = SI_USER;
if ( !value ) {
21cf0: e3580000 cmp r8, #0
21cf4: e1a04413 lsl r4, r3, r4
siginfo->si_value.sival_int = 0;
} else {
siginfo->si_value = *value;
21cf8: 15983000 ldrne r3, [r8]
21cfc: 158d3008 strne r3, [sp, #8]
21d00: e59f3228 ldr r3, [pc, #552] ; 21f30 <killinfo+0x2b4>
21d04: e5932000 ldr r2, [r3]
21d08: e2822001 add r2, r2, #1
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
siginfo->si_code = SI_USER;
if ( !value ) {
siginfo->si_value.sival_int = 0;
21d0c: 058d8008 streq r8, [sp, #8]
21d10: e5832000 str r2, [r3]
/*
* Is the currently executing thread interested? If so then it will
* get it an execute it as soon as the dispatcher executes.
*/
the_thread = _Thread_Executing;
21d14: e59f3218 ldr r3, [pc, #536] ; 21f34 <killinfo+0x2b8>
21d18: e5930004 ldr r0, [r3, #4]
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( _POSIX_signals_Is_interested( api, mask ) ) {
21d1c: e5903108 ldr r3, [r0, #264] ; 0x108
21d20: e59330cc ldr r3, [r3, #204] ; 0xcc
21d24: e1d43003 bics r3, r4, r3
21d28: 1a000014 bne 21d80 <killinfo+0x104>
/* XXX violation of visibility -- need to define thread queue support */
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = the_chain->first ;
21d2c: e59f1204 ldr r1, [pc, #516] ; 21f38 <killinfo+0x2bc>
21d30: e4913004 ldr r3, [r1], #4
21d34: e1530001 cmp r3, r1
21d38: 0a000030 beq 21e00 <killinfo+0x184>
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
21d3c: e5932030 ldr r2, [r3, #48] ; 0x30
21d40: e1140002 tst r4, r2
for ( the_node = the_chain->first ;
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
the_thread = (Thread_Control *)the_node;
21d44: e1a00003 mov r0, r3
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
21d48: e5932108 ldr r2, [r3, #264] ; 0x108
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
21d4c: 0a000008 beq 21d74 <killinfo+0xf8>
21d50: ea00000a b 21d80 <killinfo+0x104>
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = the_chain->first ;
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
21d54: e5933000 ldr r3, [r3]
/* XXX violation of visibility -- need to define thread queue support */
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = the_chain->first ;
21d58: e1530001 cmp r3, r1
21d5c: 0a000027 beq 21e00 <killinfo+0x184>
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
21d60: e5932030 ldr r2, [r3, #48] ; 0x30 <== NOT EXECUTED
21d64: e1140002 tst r4, r2 <== NOT EXECUTED
for ( the_node = the_chain->first ;
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
the_thread = (Thread_Control *)the_node;
21d68: e1a00003 mov r0, r3 <== NOT EXECUTED
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
21d6c: e5932108 ldr r2, [r3, #264] ; 0x108 <== NOT EXECUTED
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
21d70: 1a000002 bne 21d80 <killinfo+0x104> <== NOT EXECUTED
/*
* Is this thread is blocked waiting for another signal but has
* not blocked this one?
*/
if (~api->signals_blocked & mask)
21d74: e59220cc ldr r2, [r2, #204] ; 0xcc
21d78: e1d42002 bics r2, r4, r2
21d7c: 0afffff4 beq 21d54 <killinfo+0xd8>
/*
* Returns true if the signal was synchronously given to a thread
* blocked waiting for the signal.
*/
if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) {
21d80: e1a01005 mov r1, r5
21d84: e1a0200d mov r2, sp
21d88: eb00007a bl 21f78 <_POSIX_signals_Unblock_thread>
21d8c: e3500000 cmp r0, #0
21d90: 1a000005 bne 21dac <killinfo+0x130>
/*
* We may have woken up a thread but we definitely need to post the
* signal to the process wide information set.
*/
_POSIX_signals_Set_process_signals( mask );
21d94: e1a00004 mov r0, r4
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
21d98: e0875005 add r5, r7, r5
/*
* We may have woken up a thread but we definitely need to post the
* signal to the process wide information set.
*/
_POSIX_signals_Set_process_signals( mask );
21d9c: eb00006b bl 21f50 <_POSIX_signals_Set_process_signals>
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
21da0: e7963105 ldr r3, [r6, r5, lsl #2]
21da4: e3530002 cmp r3, #2
21da8: 0a000007 beq 21dcc <killinfo+0x150>
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
21dac: ebffac14 bl ce04 <_Thread_Enable_dispatch>
return 0;
21db0: e3a00000 mov r0, #0
}
21db4: e28dd00c add sp, sp, #12
21db8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* P1003.1c/Draft 10, p. 33 says that certain signals should always
* be directed to the executing thread such as those caused by hardware
* faults.
*/
if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) )
return pthread_kill( pthread_self(), sig );
21dbc: eb0000ed bl 22178 <pthread_self>
21dc0: e1a01005 mov r1, r5
21dc4: eb0000b2 bl 22094 <pthread_kill>
21dc8: eafffff9 b 21db4 <killinfo+0x138>
_POSIX_signals_Set_process_signals( mask );
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
psiginfo = (POSIX_signals_Siginfo_node *)
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
21dcc: e59f0168 ldr r0, [pc, #360] ; 21f3c <killinfo+0x2c0>
21dd0: ebffa617 bl b634 <_Chain_Get>
if ( !psiginfo ) {
21dd4: e250c000 subs ip, r0, #0
21dd8: 0a00004d beq 21f14 <killinfo+0x298>
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EAGAIN );
}
psiginfo->Info = *siginfo;
21ddc: e1a0300d mov r3, sp
21de0: e8930007 ldm r3, {r0, r1, r2}
21de4: e28c3008 add r3, ip, #8
21de8: e8830007 stm r3, {r0, r1, r2}
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
21dec: e59f014c ldr r0, [pc, #332] ; 21f40 <killinfo+0x2c4>
21df0: e1a0100c mov r1, ip
21df4: e0800105 add r0, r0, r5, lsl #2
21df8: ebffa5fa bl b5e8 <_Chain_Append>
21dfc: eaffffea b 21dac <killinfo+0x130>
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
21e00: e59f313c ldr r3, [pc, #316] ; 21f44 <killinfo+0x2c8>
21e04: e5d3e000 ldrb lr, [r3]
21e08: e59f8138 ldr r8, [pc, #312] ; 21f48 <killinfo+0x2cc>
21e0c: e28ee001 add lr, lr, #1
*
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
21e10: e3a0a000 mov sl, #0
for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
/*
* This can occur when no one is interested and an API is not configured.
*/
if ( !_Objects_Information_table[ the_api ] )
21e14: e5b83004 ldr r3, [r8, #4]!
21e18: e3530000 cmp r3, #0
21e1c: 0a000020 beq 21ea4 <killinfo+0x228>
continue;
the_info = _Objects_Information_table[ the_api ][ 1 ];
21e20: e5933004 ldr r3, [r3, #4]
*/
if ( !the_info )
continue;
#endif
maximum = the_info->maximum;
21e24: e1d3c1b0 ldrh ip, [r3, #16]
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
21e28: e35c0000 cmp ip, #0
if ( !the_info )
continue;
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
21e2c: e593101c ldr r1, [r3, #28]
for ( index = 1 ; index <= maximum ; index++ ) {
21e30: 0a00001b beq 21ea4 <killinfo+0x228>
21e34: e3a02001 mov r2, #1
the_thread = (Thread_Control *) object_table[ index ];
21e38: e5b13004 ldr r3, [r1, #4]!
if ( !the_thread )
21e3c: e3530000 cmp r3, #0
21e40: 0a000014 beq 21e98 <killinfo+0x21c>
/*
* If this thread is of lower priority than the interested thread,
* go on to the next thread.
*/
if ( the_thread->current_priority > interested_priority )
21e44: e5930014 ldr r0, [r3, #20]
21e48: e150000e cmp r0, lr
21e4c: 8a000011 bhi 21e98 <killinfo+0x21c>
#if defined(RTEMS_DEBUG)
if ( !api )
continue;
#endif
if ( !_POSIX_signals_Is_interested( api, mask ) )
21e50: e5939108 ldr r9, [r3, #264] ; 0x108
21e54: e59990cc ldr r9, [r9, #204] ; 0xcc
21e58: e1d49009 bics r9, r4, r9
21e5c: 0a00000d beq 21e98 <killinfo+0x21c>
*
* NOTE: We initialized interested_priority to PRIORITY_MAXIMUM + 1
* so we never have to worry about deferencing a NULL
* interested thread.
*/
if ( the_thread->current_priority < interested_priority ) {
21e60: e150000e cmp r0, lr
21e64: 3a00001a bcc 21ed4 <killinfo+0x258>
* and blocking interruptibutable by signal.
*
* If the interested thread is ready, don't think about changing.
*/
if ( !_States_Is_ready( interested->current_state ) ) {
21e68: e59a9010 ldr r9, [sl, #16]
21e6c: e3590000 cmp r9, #0
21e70: 0a000008 beq 21e98 <killinfo+0x21c>
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
21e74: e593b010 ldr fp, [r3, #16]
21e78: e35b0000 cmp fp, #0
21e7c: 0a000014 beq 21ed4 <killinfo+0x258>
continue;
}
DEBUG_STEP("6");
/* prefer blocked/interruptible over blocked/not interruptible */
if ( !_States_Is_interruptible_by_signal(interested->current_state) ) {
21e80: e3190201 tst r9, #268435456 ; 0x10000000
21e84: 1a000003 bne 21e98 <killinfo+0x21c>
*/
RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal (
States_Control the_states
)
{
return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL);
21e88: e20bb201 and fp, fp, #268435456 ; 0x10000000
DEBUG_STEP("7");
if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) {
21e8c: e35b0000 cmp fp, #0
21e90: 11a0e000 movne lr, r0
21e94: 11a0a003 movne sl, r3
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
21e98: e2822001 add r2, r2, #1
21e9c: e15c0002 cmp ip, r2
21ea0: 2affffe4 bcs 21e38 <killinfo+0x1bc>
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
21ea4: e59f30a0 ldr r3, [pc, #160] ; 21f4c <killinfo+0x2d0>
21ea8: e1580003 cmp r8, r3
21eac: 1affffd8 bne 21e14 <killinfo+0x198>
}
}
}
}
if ( interested ) {
21eb0: e35a0000 cmp sl, #0
21eb4: 0affffb6 beq 21d94 <killinfo+0x118>
21eb8: e1a0000a mov r0, sl
/*
* Returns true if the signal was synchronously given to a thread
* blocked waiting for the signal.
*/
if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) {
21ebc: e1a01005 mov r1, r5
21ec0: e1a0200d mov r2, sp
21ec4: eb00002b bl 21f78 <_POSIX_signals_Unblock_thread>
21ec8: e3500000 cmp r0, #0
21ecc: 0affffb0 beq 21d94 <killinfo+0x118>
21ed0: eaffffb5 b 21dac <killinfo+0x130> <== NOT EXECUTED
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
21ed4: e2822001 add r2, r2, #1
21ed8: e15c0002 cmp ip, r2
*/
if ( !_States_Is_ready( interested->current_state ) ) {
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
21edc: e1a0e000 mov lr, r0
21ee0: e1a0a003 mov sl, r3
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
21ee4: 2affffd3 bcs 21e38 <killinfo+0x1bc>
21ee8: eaffffed b 21ea4 <killinfo+0x228>
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid != getpid() )
rtems_set_errno_and_return_minus_one( ESRCH );
21eec: ebffc4b5 bl 131c8 <__errno>
21ef0: e3a03003 mov r3, #3
21ef4: e5803000 str r3, [r0]
21ef8: e3e00000 mvn r0, #0
21efc: eaffffac b 21db4 <killinfo+0x138>
*/
if ( !sig )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
rtems_set_errno_and_return_minus_one( EINVAL );
21f00: ebffc4b0 bl 131c8 <__errno>
21f04: e3a03016 mov r3, #22
21f08: e5803000 str r3, [r0]
21f0c: e3e00000 mvn r0, #0
21f10: eaffffa7 b 21db4 <killinfo+0x138>
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
psiginfo = (POSIX_signals_Siginfo_node *)
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
if ( !psiginfo ) {
_Thread_Enable_dispatch();
21f14: ebffabba bl ce04 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EAGAIN );
21f18: ebffc4aa bl 131c8 <__errno>
21f1c: e3a0300b mov r3, #11
21f20: e5803000 str r3, [r0]
21f24: e3e00000 mvn r0, #0
21f28: eaffffa1 b 21db4 <killinfo+0x138>
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: eb001380 bl 7180 <_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: eb002da9 bl da94 <__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
0000ca1c <memfile_ftruncate>:
int memfile_ftruncate(
rtems_libio_t *iop,
rtems_off64_t length
)
{
ca1c: e92d4010 push {r4, lr}
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
ca20: e5904018 ldr r4, [r0, #24]
int memfile_ftruncate(
rtems_libio_t *iop,
rtems_off64_t length
)
{
ca24: 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 )
ca28: e5940054 ldr r0, [r4, #84] ; 0x54
ca2c: e1500002 cmp r0, r2
int memfile_ftruncate(
rtems_libio_t *iop,
rtems_off64_t length
)
{
ca30: 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 )
ca34: ba00000e blt ca74 <memfile_ftruncate+0x58>
ca38: 0a00000a beq ca68 <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;
ca3c: e5841050 str r1, [r4, #80] ; 0x50
ca40: e5842054 str r2, [r4, #84] ; 0x54
iop->size = the_jnode->info.file.size;
IMFS_update_atime( the_jnode );
ca44: 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;
ca48: e9830006 stmib r3, {r1, r2}
IMFS_update_atime( the_jnode );
ca4c: e3a01000 mov r1, #0
ca50: ebffd584 bl 2068 <gettimeofday>
ca54: e59d3000 ldr r3, [sp]
ca58: e5843040 str r3, [r4, #64] ; 0x40
return 0;
ca5c: e3a00000 mov r0, #0
}
ca60: e28dd008 add sp, sp, #8
ca64: 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 )
ca68: e5940050 ldr r0, [r4, #80] ; 0x50
ca6c: e1500001 cmp r0, r1
ca70: 2afffff1 bcs ca3c <memfile_ftruncate+0x20>
return IMFS_memfile_extend( the_jnode, length );
ca74: e1a00004 mov r0, r4 <== NOT EXECUTED
ca78: ebfffeea bl c628 <IMFS_memfile_extend> <== NOT EXECUTED
ca7c: eafffff7 b ca60 <memfile_ftruncate+0x44> <== NOT EXECUTED
0000ca80 <memfile_lseek>:
rtems_off64_t memfile_lseek(
rtems_libio_t *iop,
rtems_off64_t offset,
int whence
)
{
ca80: e92d4030 push {r4, r5, lr}
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
ca84: e5905018 ldr r5, [r0, #24]
if (the_jnode->type == IMFS_LINEAR_FILE) {
ca88: e595304c ldr r3, [r5, #76] ; 0x4c
ca8c: e3530006 cmp r3, #6
rtems_off64_t memfile_lseek(
rtems_libio_t *iop,
rtems_off64_t offset,
int whence
)
{
ca90: e1a04000 mov r4, r0
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
if (the_jnode->type == IMFS_LINEAR_FILE) {
ca94: 0a00000d beq cad0 <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 ))
ca98: e1a00005 mov r0, r5
ca9c: e284200c add r2, r4, #12
caa0: e8920006 ldm r2, {r1, r2}
caa4: ebfffedf bl c628 <IMFS_memfile_extend>
caa8: e3500000 cmp r0, #0
caac: 1a000018 bne cb14 <memfile_lseek+0x94>
rtems_set_errno_and_return_minus_one( ENOSPC );
iop->size = the_jnode->info.file.size;
cab0: e2853050 add r3, r5, #80 ; 0x50
cab4: e893000c ldm r3, {r2, r3}
cab8: e984000c stmib r4, {r2, r3}
cabc: e284300c add r3, r4, #12
cac0: e893000c ldm r3, {r2, r3}
}
return iop->offset;
}
cac4: e1a00002 mov r0, r2
cac8: e1a01003 mov r1, r3
cacc: 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)
cad0: e280300c add r3, r0, #12
cad4: e893000c ldm r3, {r2, r3}
cad8: e5951054 ldr r1, [r5, #84] ; 0x54
cadc: e1530001 cmp r3, r1
cae0: e5950050 ldr r0, [r5, #80] ; 0x50
cae4: ca000002 bgt caf4 <memfile_lseek+0x74>
cae8: 1afffff5 bne cac4 <memfile_lseek+0x44>
caec: e1520000 cmp r2, r0
caf0: 9afffff3 bls cac4 <memfile_lseek+0x44>
iop->offset = the_jnode->info.linearfile.size;
caf4: e1a02000 mov r2, r0 <== NOT EXECUTED
caf8: e1a03001 mov r3, r1 <== NOT EXECUTED
cafc: e1a05000 mov r5, r0 <== NOT EXECUTED
cb00: e584000c str r0, [r4, #12] <== NOT EXECUTED
cb04: 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;
}
cb08: e1a00002 mov r0, r2 <== NOT EXECUTED
cb0c: e1a01003 mov r1, r3 <== NOT EXECUTED
cb10: 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 );
cb14: eb0003de bl da94 <__errno> <== NOT EXECUTED
cb18: e3a0301c mov r3, #28 <== NOT EXECUTED
cb1c: e5803000 str r3, [r0] <== NOT EXECUTED
cb20: e3e02000 mvn r2, #0 <== NOT EXECUTED
cb24: e3e03000 mvn r3, #0 <== NOT EXECUTED
cb28: eaffffe5 b cac4 <memfile_lseek+0x44> <== NOT EXECUTED
0000c96c <memfile_open>:
rtems_libio_t *iop,
const char *pathname,
uint32_t flag,
uint32_t mode
)
{
c96c: e92d40f0 push {r4, r5, r6, r7, lr}
c970: 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))
c974: e5900014 ldr r0, [r0, #20]
c978: e3100f81 tst r0, #516 ; 0x204
rtems_libio_t *iop,
const char *pathname,
uint32_t flag,
uint32_t mode
)
{
c97c: e24dd004 sub sp, sp, #4
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
c980: e5945018 ldr r5, [r4, #24]
/*
* Perform 'copy on write' for linear files
*/
if ((iop->flags & (LIBIO_FLAGS_WRITE | LIBIO_FLAGS_APPEND))
c984: 0a000002 beq c994 <memfile_open+0x28>
&& (the_jnode->type == IMFS_LINEAR_FILE)) {
c988: e595304c ldr r3, [r5, #76] ; 0x4c
c98c: e3530006 cmp r3, #6
c990: 0a00000c beq c9c8 <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)
c994: e3100c02 tst r0, #512 ; 0x200
c998: 1a000005 bne c9b4 <memfile_open+0x48>
c99c: e2853050 add r3, r5, #80 ; 0x50
c9a0: e893000c ldm r3, {r2, r3}
iop->offset = the_jnode->info.file.size;
iop->size = the_jnode->info.file.size;
c9a4: e984000c stmib r4, {r2, r3}
return 0;
c9a8: e3a00000 mov r0, #0
}
c9ac: e28dd004 add sp, sp, #4
c9b0: 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;
c9b4: e2853050 add r3, r5, #80 ; 0x50
c9b8: e893000c ldm r3, {r2, r3}
c9bc: e584200c str r2, [r4, #12]
c9c0: e5843010 str r3, [r4, #16]
c9c4: eafffff6 b c9a4 <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;
c9c8: 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;
c9cc: 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;
c9d0: e3a01000 mov r1, #0 <== NOT EXECUTED
c9d4: 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;
c9d8: 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)
c9dc: 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;
c9e0: e5953058 ldr r3, [r5, #88] ; 0x58 <== NOT EXECUTED
the_jnode->type = IMFS_MEMORY_FILE;
c9e4: e585704c str r7, [r5, #76] ; 0x4c <== NOT EXECUTED
the_jnode->info.file.size = 0;
c9e8: e5851050 str r1, [r5, #80] ; 0x50 <== NOT EXECUTED
c9ec: e5852054 str r2, [r5, #84] ; 0x54 <== NOT EXECUTED
the_jnode->info.file.indirect = 0;
c9f0: e5856058 str r6, [r5, #88] ; 0x58 <== NOT EXECUTED
the_jnode->info.file.doubly_indirect = 0;
c9f4: e585605c str r6, [r5, #92] ; 0x5c <== NOT EXECUTED
the_jnode->info.file.triply_indirect = 0;
c9f8: e5856060 str r6, [r5, #96] ; 0x60 <== NOT EXECUTED
if ((count != 0)
c9fc: 0affffe4 beq c994 <memfile_open+0x28> <== NOT EXECUTED
&& (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1))
ca00: e1a00005 mov r0, r5 <== NOT EXECUTED
ca04: e58dc000 str ip, [sp] <== NOT EXECUTED
ca08: ebffff53 bl c75c <IMFS_memfile_write> <== NOT EXECUTED
ca0c: e3700001 cmn r0, #1 <== NOT EXECUTED
ca10: 0affffe5 beq c9ac <memfile_open+0x40> <== NOT EXECUTED
ca14: e5940014 ldr r0, [r4, #20] <== NOT EXECUTED
ca18: eaffffdd b c994 <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: eb002d8f bl da94 <__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: eb001fc1 bl a490 <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: eb003129 bl ea54 <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: eb003125 bl ea54 <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: eb00311f bl ea54 <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: eb0030c2 bl e914 <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: eb0030bb bl e914 <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: eb0030b6 bl e914 <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: eb000e51 bl 600c <_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: eb002cba bl da94 <__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: eb002cb0 bl da94 <__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: eb002cab bl da94 <__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: eb002c9a bl da94 <__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: eb002c96 bl da94 <__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: eb002d8c bl dea0 <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: eb002cd3 bl dbcc <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: eb001272 bl 6f20 <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
0000c1b8 <pipe_ioctl>:
uint32_t cmd,
void *buffer,
rtems_libio_t *iop
)
{
if (cmd == FIONREAD) {
c1b8: e3a03a46 mov r3, #286720 ; 0x46000
c1bc: e2833e67 add r3, r3, #1648 ; 0x670
c1c0: e283313d add r3, r3, #1073741839 ; 0x4000000f
c1c4: e1510003 cmp r1, r3
pipe_control_t *pipe,
uint32_t cmd,
void *buffer,
rtems_libio_t *iop
)
{
c1c8: e92d4070 push {r4, r5, r6, lr}
c1cc: e1a05000 mov r5, r0
c1d0: e1a04002 mov r4, r2
*(unsigned int *)buffer = pipe->Length;
PIPE_UNLOCK(pipe);
return 0;
}
return -EINVAL;
c1d4: 13e00015 mvnne r0, #21
uint32_t cmd,
void *buffer,
rtems_libio_t *iop
)
{
if (cmd == FIONREAD) {
c1d8: 18bd8070 popne {r4, r5, r6, pc}
if (buffer == NULL)
c1dc: e3520000 cmp r2, #0
return -EFAULT;
c1e0: 03e0000d mvneq r0, #13
void *buffer,
rtems_libio_t *iop
)
{
if (cmd == FIONREAD) {
if (buffer == NULL)
c1e4: 08bd8070 popeq {r4, r5, r6, pc}
return -EFAULT;
if (! PIPE_LOCK(pipe))
c1e8: e3a01000 mov r1, #0
c1ec: e5950028 ldr r0, [r5, #40] ; 0x28
c1f0: e1a02001 mov r2, r1
c1f4: ebffeb20 bl 6e7c <rtems_semaphore_obtain>
c1f8: e2506000 subs r6, r0, #0
c1fc: 0a000001 beq c208 <pipe_ioctl+0x50>
return -EINTR;
c200: e3e00003 mvn r0, #3 <== NOT EXECUTED
PIPE_UNLOCK(pipe);
return 0;
}
return -EINVAL;
}
c204: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
if (! PIPE_LOCK(pipe))
return -EINTR;
/* Return length of pipe */
*(unsigned int *)buffer = pipe->Length;
c208: e595300c ldr r3, [r5, #12]
PIPE_UNLOCK(pipe);
c20c: e5950028 ldr r0, [r5, #40] ; 0x28
if (! PIPE_LOCK(pipe))
return -EINTR;
/* Return length of pipe */
*(unsigned int *)buffer = pipe->Length;
c210: e5843000 str r3, [r4]
PIPE_UNLOCK(pipe);
c214: ebffeb61 bl 6fa0 <rtems_semaphore_release>
return 0;
c218: e1a00006 mov r0, r6
c21c: e8bd8070 pop {r4, r5, r6, pc}
0000b808 <pipe_lock>:
free(pipe->Buffer);
free(pipe);
}
static rtems_status_code pipe_lock(void)
{
b808: e92d4070 push {r4, r5, r6, lr}
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (pipe_semaphore == RTEMS_ID_NONE) {
b80c: e59f4094 ldr r4, [pc, #148] ; b8a8 <pipe_lock+0xa0>
b810: e5946000 ldr r6, [r4]
b814: e3560000 cmp r6, #0
free(pipe->Buffer);
free(pipe);
}
static rtems_status_code pipe_lock(void)
{
b818: e24dd004 sub sp, sp, #4
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (pipe_semaphore == RTEMS_ID_NONE) {
b81c: 0a000007 beq b840 <pipe_lock+0x38>
rtems_libio_unlock();
}
if (sc == RTEMS_SUCCESSFUL) {
sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
b820: e3a01000 mov r1, #0
b824: e1a00006 mov r0, r6
b828: e1a02001 mov r2, r1
b82c: ebffed92 bl 6e7c <rtems_semaphore_obtain>
}
if (sc == RTEMS_SUCCESSFUL) {
return 0;
} else {
return -ENOMEM;
b830: e3500000 cmp r0, #0
b834: 13e0000b mvnne r0, #11
}
}
b838: e28dd004 add sp, sp, #4
b83c: 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 );
b840: e59f5064 ldr r5, [pc, #100] ; b8ac <pipe_lock+0xa4>
b844: e1a01006 mov r1, r6
b848: e5950000 ldr r0, [r5]
b84c: e1a02006 mov r2, r6
b850: ebffed89 bl 6e7c <rtems_semaphore_obtain>
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (pipe_semaphore == RTEMS_ID_NONE) {
rtems_libio_lock();
if (pipe_semaphore == RTEMS_ID_NONE) {
b854: e5943000 ldr r3, [r4]
b858: e3530000 cmp r3, #0
b85c: 0a000003 beq b870 <pipe_lock+0x68>
}
static inline void rtems_libio_unlock( void )
{
rtems_semaphore_release( rtems_libio_semaphore );
b860: e5950000 ldr r0, [r5] <== NOT EXECUTED
b864: ebffedcd bl 6fa0 <rtems_semaphore_release> <== NOT EXECUTED
b868: e5946000 ldr r6, [r4] <== NOT EXECUTED
b86c: eaffffeb b b820 <pipe_lock+0x18> <== NOT EXECUTED
sc = rtems_semaphore_create(
b870: e1a03006 mov r3, r6
b874: e3a01001 mov r1, #1
b878: e3a02054 mov r2, #84 ; 0x54
b87c: e59f002c ldr r0, [pc, #44] ; b8b0 <pipe_lock+0xa8>
b880: e58d4000 str r4, [sp]
b884: ebffece2 bl 6c14 <rtems_semaphore_create>
b888: e1a06000 mov r6, r0
b88c: e5950000 ldr r0, [r5]
b890: ebffedc2 bl 6fa0 <rtems_semaphore_release>
}
rtems_libio_unlock();
}
if (sc == RTEMS_SUCCESSFUL) {
b894: e3560000 cmp r6, #0
}
if (sc == RTEMS_SUCCESSFUL) {
return 0;
} else {
return -ENOMEM;
b898: 13e0000b mvnne r0, #11
}
rtems_libio_unlock();
}
if (sc == RTEMS_SUCCESSFUL) {
b89c: 1affffe5 bne b838 <pipe_lock+0x30>
b8a0: e5946000 ldr r6, [r4]
b8a4: eaffffdd b b820 <pipe_lock+0x18>
0000bdec <pipe_read>:
pipe_control_t *pipe,
void *buffer,
size_t count,
rtems_libio_t *iop
)
{
bdec: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
bdf0: e1a09001 mov r9, r1
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
bdf4: e3a01000 mov r1, #0
pipe_control_t *pipe,
void *buffer,
size_t count,
rtems_libio_t *iop
)
{
bdf8: e24dd008 sub sp, sp, #8
bdfc: e1a04000 mov r4, r0
be00: e1a05002 mov r5, r2
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
be04: e5900028 ldr r0, [r0, #40] ; 0x28
be08: e1a02001 mov r2, r1
pipe_control_t *pipe,
void *buffer,
size_t count,
rtems_libio_t *iop
)
{
be0c: e1a08003 mov r8, r3
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
be10: ebffec19 bl 6e7c <rtems_semaphore_obtain>
be14: e250a000 subs sl, r0, #0
return -EINTR;
be18: 13e07003 mvnne r7, #3
rtems_libio_t *iop
)
{
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
be1c: 1a000027 bne bec0 <pipe_read+0xd4>
return -EINTR;
while (read < count) {
be20: e3550000 cmp r5, #0
be24: 01a07005 moveq r7, r5
be28: 01a06007 moveq r6, r7
be2c: 0a00001f beq beb0 <pipe_read+0xc4>
be30: e1a0700a mov r7, sl
/* For buffering optimization */
if (PIPE_EMPTY(pipe))
pipe->Start = 0;
if (pipe->waitingWriters > 0)
PIPE_WAKEUPWRITERS(pipe);
be34: e28db004 add fp, sp, #4
if (! PIPE_LOCK(pipe))
return -EINTR;
while (read < count) {
while (PIPE_EMPTY(pipe)) {
be38: e594200c ldr r2, [r4, #12]
be3c: e3520000 cmp r2, #0
be40: 1a000021 bne becc <pipe_read+0xe0>
/* Not an error */
if (pipe->Writers == 0)
be44: e5946014 ldr r6, [r4, #20]
be48: e3560000 cmp r6, #0
be4c: 0a000017 beq beb0 <pipe_read+0xc4>
goto out_locked;
if (LIBIO_NODELAY(iop)) {
be50: e5986014 ldr r6, [r8, #20]
be54: e2166001 ands r6, r6, #1
be58: 1a00003b bne bf4c <pipe_read+0x160>
ret = -EAGAIN;
goto out_locked;
}
/* Wait until pipe is no more empty or no writer exists */
pipe->waitingReaders ++;
be5c: e5943018 ldr r3, [r4, #24]
be60: e2833001 add r3, r3, #1
be64: e5843018 str r3, [r4, #24]
PIPE_UNLOCK(pipe);
be68: e5940028 ldr r0, [r4, #40] ; 0x28
be6c: ebffec4b bl 6fa0 <rtems_semaphore_release>
if (! PIPE_READWAIT(pipe))
be70: e1a01006 mov r1, r6
be74: e594002c ldr r0, [r4, #44] ; 0x2c
be78: eb0006ad bl d934 <rtems_barrier_wait>
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
be7c: e1a01006 mov r1, r6
be80: e1a02001 mov r2, r1
}
/* Wait until pipe is no more empty or no writer exists */
pipe->waitingReaders ++;
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
be84: e2506000 subs r6, r0, #0
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
be88: 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))
be8c: 13e06003 mvnne r6, #3
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
be90: ebffebf9 bl 6e7c <rtems_semaphore_obtain>
be94: e3500000 cmp r0, #0
be98: 1a00002d bne bf54 <pipe_read+0x168>
/* WARN waitingReaders not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingReaders --;
be9c: e5943018 ldr r3, [r4, #24]
if (ret != 0)
bea0: e3560000 cmp r6, #0
if (! PIPE_LOCK(pipe)) {
/* WARN waitingReaders not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingReaders --;
bea4: e2433001 sub r3, r3, #1
bea8: e5843018 str r3, [r4, #24]
if (ret != 0)
beac: 0affffe1 beq be38 <pipe_read+0x4c>
PIPE_WAKEUPWRITERS(pipe);
read += chunk;
}
out_locked:
PIPE_UNLOCK(pipe);
beb0: e5940028 ldr r0, [r4, #40] ; 0x28
beb4: ebffec39 bl 6fa0 <rtems_semaphore_release>
out_nolock:
if (read > 0)
return read;
return ret;
beb8: e3570000 cmp r7, #0
bebc: d1a07006 movle r7, r6
}
bec0: e1a00007 mov r0, r7
bec4: e28dd008 add sp, sp, #8
bec8: 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;
becc: e5941008 ldr r1, [r4, #8]
bed0: e5943004 ldr r3, [r4, #4]
if (ret != 0)
goto out_locked;
}
/* Read chunk bytes */
chunk = MIN(count - read, pipe->Length);
bed4: e06a6005 rsb r6, sl, r5
bed8: e1520006 cmp r2, r6
bedc: 31a06002 movcc r6, r2
chunk1 = pipe->Size - pipe->Start;
bee0: e0613003 rsb r3, r1, r3
if (chunk > chunk1) {
bee4: e1560003 cmp r6, r3
bee8: ca00001b bgt bf5c <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);
beec: e5943000 ldr r3, [r4]
bef0: e089000a add r0, r9, sl
bef4: e0831001 add r1, r3, r1
bef8: e1a02006 mov r2, r6
befc: eb001072 bl 100cc <memcpy>
pipe->Start += chunk;
bf00: e5940008 ldr r0, [r4, #8]
pipe->Start %= pipe->Size;
bf04: e5941004 ldr r1, [r4, #4]
bf08: e0860000 add r0, r6, r0
bf0c: eb0033ce bl 18e4c <__umodsi3>
pipe->Length -= chunk;
bf10: e594300c ldr r3, [r4, #12]
bf14: e0663003 rsb r3, r6, r3
/* For buffering optimization */
if (PIPE_EMPTY(pipe))
bf18: e3530000 cmp r3, #0
}
else
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk);
pipe->Start += chunk;
pipe->Start %= pipe->Size;
bf1c: e5840008 str r0, [r4, #8]
pipe->Length -= chunk;
bf20: e584300c str r3, [r4, #12]
/* For buffering optimization */
if (PIPE_EMPTY(pipe))
pipe->Start = 0;
bf24: 05843008 streq r3, [r4, #8]
if (pipe->waitingWriters > 0)
bf28: e594301c ldr r3, [r4, #28]
bf2c: e3530000 cmp r3, #0
bf30: 1a000016 bne bf90 <pipe_read+0x1a4>
PIPE_WAKEUPWRITERS(pipe);
read += chunk;
bf34: e0877006 add r7, r7, r6
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
return -EINTR;
while (read < count) {
bf38: e1570005 cmp r7, r5
bf3c: e1a0a007 mov sl, r7
bf40: 3affffbc bcc be38 <pipe_read+0x4c>
bf44: e3a06000 mov r6, #0
bf48: eaffffd8 b beb0 <pipe_read+0xc4>
/* Not an error */
if (pipe->Writers == 0)
goto out_locked;
if (LIBIO_NODELAY(iop)) {
ret = -EAGAIN;
bf4c: e3e0600a mvn r6, #10
bf50: eaffffd6 b beb0 <pipe_read+0xc4>
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
/* WARN waitingReaders not restored! */
ret = -EINTR;
bf54: e3e06003 mvn r6, #3 <== NOT EXECUTED
bf58: eaffffd6 b beb8 <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);
bf5c: e5940000 ldr r0, [r4]
bf60: e1a02003 mov r2, r3
bf64: e0801001 add r1, r0, r1
bf68: e089000a add r0, r9, sl
bf6c: e58d3000 str r3, [sp]
bf70: eb001055 bl 100cc <memcpy>
memcpy(buffer + read + chunk1, pipe->Buffer, chunk - chunk1);
bf74: e59d3000 ldr r3, [sp]
bf78: e08a0003 add r0, sl, r3
bf7c: e0890000 add r0, r9, r0
bf80: e5941000 ldr r1, [r4]
bf84: e0632006 rsb r2, r3, r6
bf88: eb00104f bl 100cc <memcpy>
bf8c: eaffffdb b bf00 <pipe_read+0x114>
/* For buffering optimization */
if (PIPE_EMPTY(pipe))
pipe->Start = 0;
if (pipe->waitingWriters > 0)
PIPE_WAKEUPWRITERS(pipe);
bf90: e5940030 ldr r0, [r4, #48] ; 0x30
bf94: e1a0100b mov r1, fp
bf98: eb00064d bl d8d4 <rtems_barrier_release>
bf9c: eaffffe4 b bf34 <pipe_read+0x148>
0000b8e0 <pipe_release>:
*/
int pipe_release(
pipe_control_t **pipep,
rtems_libio_t *iop
)
{
b8e0: e92d40f0 push {r4, r5, r6, r7, lr}
b8e4: e24dd004 sub sp, sp, #4
b8e8: e1a06001 mov r6, r1
b8ec: e1a05000 mov r5, r0
pipe_control_t *pipe = *pipep;
b8f0: e5904000 ldr r4, [r0]
uint32_t mode;
if (pipe_lock())
b8f4: ebffffc3 bl b808 <pipe_lock>
b8f8: e2501000 subs r1, r0, #0
b8fc: 1a000035 bne b9d8 <pipe_release+0xf8>
/* WARN pipe not freed and pipep not set to NULL! */
/* FIXME */
rtems_fatal_error_occurred(0xdeadbeef);
if (!PIPE_LOCK(pipe))
b900: e5940028 ldr r0, [r4, #40] ; 0x28
b904: e1a02001 mov r2, r1
b908: ebffed5b bl 6e7c <rtems_semaphore_obtain>
b90c: e3500000 cmp r0, #0
b910: 1a000030 bne b9d8 <pipe_release+0xf8>
/* WARN pipe not released! */
/* FIXME */
rtems_fatal_error_occurred(0xdeadbeef);
mode = LIBIO_ACCMODE(iop);
b914: e5966014 ldr r6, [r6, #20]
if (mode & LIBIO_FLAGS_READ)
b918: e3160002 tst r6, #2
pipe->Readers --;
b91c: 15943010 ldrne r3, [r4, #16]
if (!PIPE_LOCK(pipe))
/* WARN pipe not released! */
/* FIXME */
rtems_fatal_error_occurred(0xdeadbeef);
mode = LIBIO_ACCMODE(iop);
b920: e2066006 and r6, r6, #6
if (mode & LIBIO_FLAGS_READ)
pipe->Readers --;
b924: 12433001 subne r3, r3, #1
b928: 15843010 strne r3, [r4, #16]
if (mode & LIBIO_FLAGS_WRITE)
b92c: e3160004 tst r6, #4
pipe->Writers --;
b930: 15943014 ldrne r3, [r4, #20]
b934: 12433001 subne r3, r3, #1
b938: 15843014 strne r3, [r4, #20]
PIPE_UNLOCK(pipe);
b93c: e5940028 ldr r0, [r4, #40] ; 0x28
b940: ebffed96 bl 6fa0 <rtems_semaphore_release>
if (pipe->Readers == 0 && pipe->Writers == 0) {
b944: e5943010 ldr r3, [r4, #16]
b948: e3530000 cmp r3, #0
b94c: 0a00000c beq b984 <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)
b950: e5943014 ldr r3, [r4, #20]
b954: e2733001 rsbs r3, r3, #1
b958: 33a03000 movcc r3, #0
b95c: e3560002 cmp r6, #2
b960: 03a03000 moveq r3, #0
b964: e3530000 cmp r3, #0
PIPE_WAKEUPREADERS(pipe);
b968: 1594002c ldrne r0, [r4, #44] ; 0x2c
b96c: 11a0100d movne r1, sp
b970: 1b0007d7 blne d8d4 <rtems_barrier_release>
pipe_unlock();
b974: ebffffce bl b8b4 <pipe_unlock>
if(iop->pathinfo.ops->unlink_h(&iop->pathinfo))
return -errno;
#endif
return 0;
}
b978: e3a00000 mov r0, #0
b97c: e28dd004 add sp, sp, #4
b980: e8bd80f0 pop {r4, r5, r6, r7, pc}
if (mode & LIBIO_FLAGS_WRITE)
pipe->Writers --;
PIPE_UNLOCK(pipe);
if (pipe->Readers == 0 && pipe->Writers == 0) {
b984: e5947014 ldr r7, [r4, #20]
b988: e3570000 cmp r7, #0
b98c: 0a000005 beq b9a8 <pipe_release+0xc8>
delfile = TRUE;
#endif
pipe_free(pipe);
*pipep = NULL;
}
else if (pipe->Readers == 0 && mode != LIBIO_FLAGS_WRITE)
b990: e3560004 cmp r6, #4
b994: 0afffff6 beq b974 <pipe_release+0x94>
/* Notify waiting Writers that all their partners left */
PIPE_WAKEUPWRITERS(pipe);
b998: e5940030 ldr r0, [r4, #48] ; 0x30
b99c: e1a0100d mov r1, sp
b9a0: eb0007cb bl d8d4 <rtems_barrier_release>
b9a4: eafffff2 b b974 <pipe_release+0x94>
/* Called with pipe_semaphore held. */
static inline void pipe_free(
pipe_control_t *pipe
)
{
rtems_barrier_delete(pipe->readBarrier);
b9a8: e594002c ldr r0, [r4, #44] ; 0x2c
b9ac: eb00079c bl d824 <rtems_barrier_delete>
rtems_barrier_delete(pipe->writeBarrier);
b9b0: e5940030 ldr r0, [r4, #48] ; 0x30
b9b4: eb00079a bl d824 <rtems_barrier_delete>
rtems_semaphore_delete(pipe->Semaphore);
b9b8: e5940028 ldr r0, [r4, #40] ; 0x28
b9bc: ebffed05 bl 6dd8 <rtems_semaphore_delete>
free(pipe->Buffer);
b9c0: e5940000 ldr r0, [r4]
b9c4: ebffde45 bl 32e0 <free>
free(pipe);
b9c8: e1a00004 mov r0, r4
b9cc: ebffde43 bl 32e0 <free>
/* To delete an anonymous pipe file when all users closed it */
if (pipe->Anonymous)
delfile = TRUE;
#endif
pipe_free(pipe);
*pipep = NULL;
b9d0: e5857000 str r7, [r5]
b9d4: eaffffe6 b b974 <pipe_release+0x94>
rtems_fatal_error_occurred(0xdeadbeef);
if (!PIPE_LOCK(pipe))
/* WARN pipe not released! */
/* FIXME */
rtems_fatal_error_occurred(0xdeadbeef);
b9d8: e3e00585 mvn r0, #557842432 ; 0x21400000 <== NOT EXECUTED
b9dc: e2400949 sub r0, r0, #1196032 ; 0x124000 <== NOT EXECUTED
b9e0: e2400e11 sub r0, r0, #272 ; 0x110 <== NOT EXECUTED
b9e4: ebffeeb1 bl 74b0 <rtems_fatal_error_occurred> <== NOT EXECUTED
0000b8b4 <pipe_unlock>:
static void pipe_unlock(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
sc = rtems_semaphore_release(pipe_semaphore);
b8b4: e59f3020 ldr r3, [pc, #32] ; b8dc <pipe_unlock+0x28>
return -ENOMEM;
}
}
static void pipe_unlock(void)
{
b8b8: e52de004 push {lr} ; (str lr, [sp, #-4]!)
rtems_status_code sc = RTEMS_SUCCESSFUL;
sc = rtems_semaphore_release(pipe_semaphore);
b8bc: e5930000 ldr r0, [r3]
b8c0: ebffedb6 bl 6fa0 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL) {
b8c4: e3500000 cmp r0, #0
b8c8: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
/* 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: ebffeef4 bl 74b0 <rtems_fatal_error_occurred> <== NOT EXECUTED
0000bfa0 <pipe_write>:
pipe_control_t *pipe,
const void *buffer,
size_t count,
rtems_libio_t *iop
)
{
bfa0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
int chunk, chunk1, written = 0, ret = 0;
/* Write nothing */
if (count == 0)
bfa4: e2524000 subs r4, r2, #0
pipe_control_t *pipe,
const void *buffer,
size_t count,
rtems_libio_t *iop
)
{
bfa8: e24dd008 sub sp, sp, #8
bfac: e1a05000 mov r5, r0
bfb0: e1a06001 mov r6, r1
int chunk, chunk1, written = 0, ret = 0;
/* Write nothing */
if (count == 0)
return 0;
bfb4: 01a07004 moveq r7, r4
)
{
int chunk, chunk1, written = 0, ret = 0;
/* Write nothing */
if (count == 0)
bfb8: 1a000002 bne bfc8 <pipe_write+0x28>
#endif
if (written > 0)
return written;
return ret;
}
bfbc: e1a00007 mov r0, r7
bfc0: e28dd008 add sp, sp, #8
bfc4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/* Write nothing */
if (count == 0)
return 0;
if (! PIPE_LOCK(pipe))
bfc8: e3a01000 mov r1, #0
bfcc: e5900028 ldr r0, [r0, #40] ; 0x28
bfd0: e1a02001 mov r2, r1
bfd4: e58d3000 str r3, [sp]
bfd8: ebffeba7 bl 6e7c <rtems_semaphore_obtain>
bfdc: e2509000 subs r9, r0, #0
bfe0: e59d3000 ldr r3, [sp]
return -EINTR;
bfe4: 13e07003 mvnne r7, #3
/* Write nothing */
if (count == 0)
return 0;
if (! PIPE_LOCK(pipe))
bfe8: 1afffff3 bne bfbc <pipe_write+0x1c>
return -EINTR;
if (pipe->Readers == 0) {
bfec: e5957010 ldr r7, [r5, #16]
bff0: e3570000 cmp r7, #0
bff4: 0a000057 beq c158 <pipe_write+0x1b8>
ret = -EPIPE;
goto out_locked;
}
/* Write of PIPE_BUF bytes or less shall not be interleaved */
chunk = count <= pipe->Size ? count : 1;
bff8: e5958004 ldr r8, [r5, #4]
bffc: e1540008 cmp r4, r8
c000: 91a0a004 movls sl, r4
c004: 83a0a001 movhi sl, #1
c008: e1a07009 mov r7, r9
else
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk);
pipe->Length += chunk;
if (pipe->waitingReaders > 0)
PIPE_WAKEUPREADERS(pipe);
c00c: 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) {
c010: e595100c ldr r1, [r5, #12]
c014: e0612008 rsb r2, r1, r8
c018: e152000a cmp r2, sl
c01c: 2a000021 bcs c0a8 <pipe_write+0x108>
if (LIBIO_NODELAY(iop)) {
c020: e5938014 ldr r8, [r3, #20]
c024: e2188001 ands r8, r8, #1
c028: 1a000052 bne c178 <pipe_write+0x1d8>
ret = -EAGAIN;
goto out_locked;
}
/* Wait until there is chunk bytes space or no reader exists */
pipe->waitingWriters ++;
c02c: e595201c ldr r2, [r5, #28]
c030: e2822001 add r2, r2, #1
c034: e585201c str r2, [r5, #28]
PIPE_UNLOCK(pipe);
c038: e5950028 ldr r0, [r5, #40] ; 0x28
c03c: e58d3000 str r3, [sp]
c040: ebffebd6 bl 6fa0 <rtems_semaphore_release>
if (! PIPE_WRITEWAIT(pipe))
c044: e1a01008 mov r1, r8
c048: e5950030 ldr r0, [r5, #48] ; 0x30
c04c: eb000638 bl d934 <rtems_barrier_wait>
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
c050: e1a01008 mov r1, r8
c054: e1a02001 mov r2, r1
}
/* Wait until there is chunk bytes space or no reader exists */
pipe->waitingWriters ++;
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
c058: e2508000 subs r8, r0, #0
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
c05c: 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))
c060: 13e08003 mvnne r8, #3
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
c064: ebffeb84 bl 6e7c <rtems_semaphore_obtain>
c068: e3500000 cmp r0, #0
c06c: e59d3000 ldr r3, [sp]
c070: 1a00003e bne c170 <pipe_write+0x1d0>
/* WARN waitingWriters not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingWriters --;
c074: e595201c ldr r2, [r5, #28]
if (ret != 0)
c078: e3580000 cmp r8, #0
if (! PIPE_LOCK(pipe)) {
/* WARN waitingWriters not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingWriters --;
c07c: e2422001 sub r2, r2, #1
c080: e585201c str r2, [r5, #28]
if (ret != 0)
c084: 1a00002c bne c13c <pipe_write+0x19c>
goto out_locked;
if (pipe->Readers == 0) {
c088: e5952010 ldr r2, [r5, #16]
c08c: e3520000 cmp r2, #0
c090: 0a000030 beq c158 <pipe_write+0x1b8>
c094: 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) {
c098: e595100c ldr r1, [r5, #12]
c09c: e0612008 rsb r2, r1, r8
c0a0: e152000a cmp r2, sl
c0a4: 3affffdd bcc c020 <pipe_write+0x80>
goto out_locked;
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
chunk1 = pipe->Size - PIPE_WSTART(pipe);
c0a8: e5950008 ldr r0, [r5, #8]
ret = -EPIPE;
goto out_locked;
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
c0ac: e069a004 rsb sl, r9, r4
chunk1 = pipe->Size - PIPE_WSTART(pipe);
c0b0: e0810000 add r0, r1, r0
c0b4: e1a01008 mov r1, r8
ret = -EPIPE;
goto out_locked;
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
c0b8: e152000a cmp r2, sl
c0bc: 31a0a002 movcc sl, r2
chunk1 = pipe->Size - PIPE_WSTART(pipe);
c0c0: e58d3000 str r3, [sp]
c0c4: eb003360 bl 18e4c <__umodsi3>
c0c8: e0608008 rsb r8, r0, r8
if (chunk > chunk1) {
c0cc: e15a0008 cmp sl, r8
goto out_locked;
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
chunk1 = pipe->Size - PIPE_WSTART(pipe);
c0d0: e1a0c000 mov ip, r0
if (chunk > chunk1) {
c0d4: e59d3000 ldr r3, [sp]
c0d8: da000028 ble c180 <pipe_write+0x1e0>
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk1);
c0dc: e5950000 ldr r0, [r5]
c0e0: e0861009 add r1, r6, r9
c0e4: e1a02008 mov r2, r8
c0e8: e080000c add r0, r0, ip
c0ec: eb000ff6 bl 100cc <memcpy>
memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1);
c0f0: e0881009 add r1, r8, r9
c0f4: e5950000 ldr r0, [r5]
c0f8: e0861001 add r1, r6, r1
c0fc: e068200a rsb r2, r8, sl
c100: eb000ff1 bl 100cc <memcpy>
c104: e59d3000 ldr r3, [sp]
}
else
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk);
pipe->Length += chunk;
c108: e595200c ldr r2, [r5, #12]
if (pipe->waitingReaders > 0)
c10c: 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;
c110: e082200a add r2, r2, sl
if (pipe->waitingReaders > 0)
c114: 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;
c118: e585200c str r2, [r5, #12]
if (pipe->waitingReaders > 0)
c11c: 1a00001f bne c1a0 <pipe_write+0x200>
PIPE_WAKEUPREADERS(pipe);
written += chunk;
c120: 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) {
c124: e1540007 cmp r4, r7
c128: e1a09007 mov r9, r7
c12c: 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;
c130: 83a0a001 movhi sl, #1
c134: 8affffb5 bhi c010 <pipe_write+0x70>
}
/* Write of PIPE_BUF bytes or less shall not be interleaved */
chunk = count <= pipe->Size ? count : 1;
while (written < count) {
c138: e3a08000 mov r8, #0
/* Write of more than PIPE_BUF bytes can be interleaved */
chunk = 1;
}
out_locked:
PIPE_UNLOCK(pipe);
c13c: e5950028 ldr r0, [r5, #40] ; 0x28
c140: ebffeb96 bl 6fa0 <rtems_semaphore_release>
out_nolock:
#ifdef RTEMS_POSIX_API
/* Signal SIGPIPE */
if (ret == -EPIPE)
c144: e3780020 cmn r8, #32
c148: 0a000004 beq c160 <pipe_write+0x1c0>
kill(getpid(), SIGPIPE);
#endif
if (written > 0)
c14c: e3570000 cmp r7, #0
c150: d1a07008 movle r7, r8
c154: eaffff98 b bfbc <pipe_write+0x1c>
pipe->waitingWriters --;
if (ret != 0)
goto out_locked;
if (pipe->Readers == 0) {
ret = -EPIPE;
c158: e3e0801f mvn r8, #31
c15c: eafffff6 b c13c <pipe_write+0x19c>
out_nolock:
#ifdef RTEMS_POSIX_API
/* Signal SIGPIPE */
if (ret == -EPIPE)
kill(getpid(), SIGPIPE);
c160: eb00020a bl c990 <getpid>
c164: e3a0100d mov r1, #13
c168: eb00036f bl cf2c <kill>
c16c: eafffff6 b c14c <pipe_write+0x1ac>
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
/* WARN waitingWriters not restored! */
ret = -EINTR;
c170: e3e08003 mvn r8, #3 <== NOT EXECUTED
c174: eafffff4 b c14c <pipe_write+0x1ac> <== NOT EXECUTED
chunk = count <= pipe->Size ? count : 1;
while (written < count) {
while (PIPE_SPACE(pipe) < chunk) {
if (LIBIO_NODELAY(iop)) {
ret = -EAGAIN;
c178: e3e0800a mvn r8, #10
c17c: eaffffee b c13c <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);
c180: e5950000 ldr r0, [r5]
c184: e0861009 add r1, r6, r9
c188: e080000c add r0, r0, ip
c18c: e1a0200a mov r2, sl
c190: e58d3000 str r3, [sp]
c194: eb000fcc bl 100cc <memcpy>
c198: e59d3000 ldr r3, [sp]
c19c: eaffffd9 b c108 <pipe_write+0x168>
pipe->Length += chunk;
if (pipe->waitingReaders > 0)
PIPE_WAKEUPREADERS(pipe);
c1a0: e595002c ldr r0, [r5, #44] ; 0x2c
c1a4: e1a0100b mov r1, fp
c1a8: e58d3000 str r3, [sp]
c1ac: eb0005c8 bl d8d4 <rtems_barrier_release>
c1b0: e59d3000 ldr r3, [sp]
c1b4: eaffffd9 b c120 <pipe_write+0x180>
00009d78 <pthread_attr_setschedpolicy>:
int pthread_attr_setschedpolicy(
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
9d78: e3500000 cmp r0, #0
9d7c: 0a00000e beq 9dbc <pthread_attr_setschedpolicy+0x44>
9d80: e5903000 ldr r3, [r0]
9d84: e3530000 cmp r3, #0
9d88: 0a00000b beq 9dbc <pthread_attr_setschedpolicy+0x44>
return EINVAL;
switch ( policy ) {
9d8c: e3510004 cmp r1, #4
9d90: 9a000001 bls 9d9c <pthread_attr_setschedpolicy+0x24>
case SCHED_SPORADIC:
attr->schedpolicy = policy;
return 0;
default:
return ENOTSUP;
9d94: e3a00086 mov r0, #134 ; 0x86
}
}
9d98: e12fff1e bx lr
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( policy ) {
9d9c: e3a03001 mov r3, #1
9da0: e1a03113 lsl r3, r3, r1
9da4: e3130017 tst r3, #23
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
case SCHED_SPORADIC:
attr->schedpolicy = policy;
9da8: 15801014 strne r1, [r0, #20]
return 0;
9dac: 13a00000 movne r0, #0
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( policy ) {
9db0: 112fff1e bxne lr
case SCHED_SPORADIC:
attr->schedpolicy = policy;
return 0;
default:
return ENOTSUP;
9db4: e3a00086 mov r0, #134 ; 0x86 <== NOT EXECUTED
}
}
9db8: e12fff1e bx lr <== NOT EXECUTED
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
9dbc: e3a00016 mov r0, #22
9dc0: e12fff1e bx lr
000056c8 <pthread_key_create>:
56c8: e59f30f8 ldr r3, [pc, #248] ; 57c8 <pthread_key_create+0x100>
56cc: e5932000 ldr r2, [r3]
56d0: e2822001 add r2, r2, #1
int pthread_key_create(
pthread_key_t *key,
void (*destructor)( void * )
)
{
56d4: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
56d8: e5832000 str r2, [r3]
56dc: e1a08000 mov r8, r0
56e0: e1a04001 mov r4, r1
* the inactive chain of free keys control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void )
{
return (POSIX_Keys_Control *) _Objects_Allocate( &_POSIX_Keys_Information );
56e4: e59f00e0 ldr r0, [pc, #224] ; 57cc <pthread_key_create+0x104>
56e8: eb0008a9 bl 7994 <_Objects_Allocate>
_Thread_Disable_dispatch();
the_key = _POSIX_Keys_Allocate();
if ( !the_key ) {
56ec: e2507000 subs r7, r0, #0
56f0: 0a000023 beq 5784 <pthread_key_create+0xbc>
_Thread_Enable_dispatch();
return EAGAIN;
}
the_key->destructor = destructor;
56f4: e59f60d4 ldr r6, [pc, #212] ; 57d0 <pthread_key_create+0x108>
56f8: e5874010 str r4, [r7, #16]
56fc: e1a05007 mov r5, r7
* APIs are optional.
*
* NOTE: Currently RTEMS Classic API tasks are always enabled.
*/
for ( the_api = 1;
5700: e3a04001 mov r4, #1
the_api <= OBJECTS_APIS_LAST;
the_api++ ) {
if ( _Objects_Information_table[ the_api ] ) {
5704: e5b63004 ldr r3, [r6, #4]!
5708: e3530000 cmp r3, #0
570c: 0a00001a beq 577c <pthread_key_create+0xb4>
true,
INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY
);
#endif
bytes_to_allocate = sizeof( void * ) *
(_Objects_Information_table[ the_api ][ 1 ]->maximum + 1);
5710: e5933004 ldr r3, [r3, #4]
5714: e1d3a1b0 ldrh sl, [r3, #16]
5718: e28aa001 add sl, sl, #1
INTERNAL_ERROR_CORE,
true,
INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY
);
#endif
bytes_to_allocate = sizeof( void * ) *
571c: e1a0a10a lsl sl, sl, #2
(_Objects_Information_table[ the_api ][ 1 ]->maximum + 1);
table = _Workspace_Allocate( bytes_to_allocate );
5720: e1a0000a mov r0, sl
5724: eb001150 bl 9c6c <_Workspace_Allocate>
if ( !table ) {
5728: e2503000 subs r3, r0, #0
572c: 0a000017 beq 5790 <pthread_key_create+0xc8>
_POSIX_Keys_Free( the_key );
_Thread_Enable_dispatch();
return ENOMEM;
}
the_key->Values[ the_api ] = table;
5730: e5853018 str r3, [r5, #24]
memset( table, '\0', bytes_to_allocate );
5734: e3a01000 mov r1, #0
5738: e1a0200a mov r2, sl
573c: eb0026dc bl f2b4 <memset>
* NOTE: Currently RTEMS Classic API tasks are always enabled.
*/
for ( the_api = 1;
the_api <= OBJECTS_APIS_LAST;
the_api++ ) {
5740: e2844001 add r4, r4, #1
* APIs are optional.
*
* NOTE: Currently RTEMS Classic API tasks are always enabled.
*/
for ( the_api = 1;
5744: e3540004 cmp r4, #4
the_api <= OBJECTS_APIS_LAST;
the_api++ ) {
5748: e2855004 add r5, r5, #4
* APIs are optional.
*
* NOTE: Currently RTEMS Classic API tasks are always enabled.
*/
for ( the_api = 1;
574c: 1affffec bne 5704 <pthread_key_create+0x3c>
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
5750: e59f2074 ldr r2, [pc, #116] ; 57cc <pthread_key_create+0x104>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
5754: e5973008 ldr r3, [r7, #8]
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
5758: e592201c ldr r2, [r2, #28]
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
575c: e3a04000 mov r4, #0
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
5760: e1a01803 lsl r1, r3, #16
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
5764: e7827721 str r7, [r2, r1, lsr #14]
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
5768: e587400c str r4, [r7, #12]
}
_Objects_Open_u32( &_POSIX_Keys_Information, &the_key->Object, 0 );
*key = the_key->Object.id;
576c: e5883000 str r3, [r8]
_Thread_Enable_dispatch();
5770: eb000be2 bl 8700 <_Thread_Enable_dispatch>
return 0;
5774: e1a00004 mov r0, r4
}
5778: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
}
the_key->Values[ the_api ] = table;
memset( table, '\0', bytes_to_allocate );
} else {
the_key->Values[ the_api ] = NULL;
577c: e5853018 str r3, [r5, #24] <== NOT EXECUTED
5780: eaffffee b 5740 <pthread_key_create+0x78> <== NOT EXECUTED
_Thread_Disable_dispatch();
the_key = _POSIX_Keys_Allocate();
if ( !the_key ) {
_Thread_Enable_dispatch();
5784: eb000bdd bl 8700 <_Thread_Enable_dispatch>
return EAGAIN;
5788: e3a0000b mov r0, #11
578c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
#endif
bytes_to_allocate = sizeof( void * ) *
(_Objects_Information_table[ the_api ][ 1 ]->maximum + 1);
table = _Workspace_Allocate( bytes_to_allocate );
if ( !table ) {
for ( --the_api;
5790: e2545001 subs r5, r4, #1
5794: 0a000005 beq 57b0 <pthread_key_create+0xe8>
int _EXFUN(pthread_once,
(pthread_once_t *__once_control, void (*__init_routine)(void)));
/* Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163 */
int _EXFUN(pthread_key_create,
5798: e2844005 add r4, r4, #5
579c: e0874104 add r4, r7, r4, lsl #2
the_api >= 1;
the_api-- )
_Workspace_Free( the_key->Values[ the_api ] );
57a0: e5340004 ldr r0, [r4, #-4]!
57a4: eb001136 bl 9c84 <_Workspace_Free>
#endif
bytes_to_allocate = sizeof( void * ) *
(_Objects_Information_table[ the_api ][ 1 ]->maximum + 1);
table = _Workspace_Allocate( bytes_to_allocate );
if ( !table ) {
for ( --the_api;
57a8: e2555001 subs r5, r5, #1
57ac: 1afffffb bne 57a0 <pthread_key_create+0xd8>
*/
RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
POSIX_Keys_Control *the_key
)
{
_Objects_Free( &_POSIX_Keys_Information, &the_key->Object );
57b0: e59f0014 ldr r0, [pc, #20] ; 57cc <pthread_key_create+0x104>
57b4: e1a01007 mov r1, r7
57b8: eb000950 bl 7d00 <_Objects_Free>
the_api >= 1;
the_api-- )
_Workspace_Free( the_key->Values[ the_api ] );
_POSIX_Keys_Free( the_key );
_Thread_Enable_dispatch();
57bc: eb000bcf bl 8700 <_Thread_Enable_dispatch>
return ENOMEM;
57c0: e3a0000c mov r0, #12
57c4: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
0000777c <pthread_mutexattr_setpshared>:
int pthread_mutexattr_setpshared(
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
777c: e3500000 cmp r0, #0
7780: 0a000008 beq 77a8 <pthread_mutexattr_setpshared+0x2c>
7784: e5903000 ldr r3, [r0]
7788: e3530000 cmp r3, #0
778c: 0a000005 beq 77a8 <pthread_mutexattr_setpshared+0x2c>
return EINVAL;
switch ( pshared ) {
7790: e3510001 cmp r1, #1
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
7794: 95801004 strls r1, [r0, #4]
return 0;
7798: 93a00000 movls r0, #0
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( pshared ) {
779c: 912fff1e bxls lr
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
return 0;
default:
return EINVAL;
77a0: e3a00016 mov r0, #22 <== NOT EXECUTED
}
}
77a4: e12fff1e bx lr <== NOT EXECUTED
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
77a8: e3a00016 mov r0, #22
77ac: e12fff1e bx lr
00007314 <pthread_rwlockattr_setpshared>:
int pthread_rwlockattr_setpshared(
pthread_rwlockattr_t *attr,
int pshared
)
{
if ( !attr )
7314: e3500000 cmp r0, #0
7318: 0a000008 beq 7340 <pthread_rwlockattr_setpshared+0x2c>
return EINVAL;
if ( !attr->is_initialized )
731c: e5903000 ldr r3, [r0]
7320: e3530000 cmp r3, #0
7324: 0a000005 beq 7340 <pthread_rwlockattr_setpshared+0x2c>
return EINVAL;
switch ( pshared ) {
7328: e3510001 cmp r1, #1
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
732c: 95801004 strls r1, [r0, #4]
return 0;
7330: 93a00000 movls r0, #0
return EINVAL;
if ( !attr->is_initialized )
return EINVAL;
switch ( pshared ) {
7334: 912fff1e bxls lr
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
return 0;
default:
return EINVAL;
7338: e3a00016 mov r0, #22 <== NOT EXECUTED
}
}
733c: e12fff1e bx lr <== NOT EXECUTED
{
if ( !attr )
return EINVAL;
if ( !attr->is_initialized )
return EINVAL;
7340: e3a00016 mov r0, #22
7344: e12fff1e bx lr
00012c24 <read>:
)
{
ssize_t rc;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
12c24: e59f30a4 ldr r3, [pc, #164] ; 12cd0 <read+0xac>
12c28: e5933000 ldr r3, [r3]
12c2c: e1500003 cmp r0, r3
ssize_t read(
int fd,
void *buffer,
size_t count
)
{
12c30: e92d4010 push {r4, lr}
ssize_t rc;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
12c34: 2a00001b bcs 12ca8 <read+0x84>
iop = rtems_libio_iop( fd );
12c38: e59f4094 ldr r4, [pc, #148] ; 12cd4 <read+0xb0>
12c3c: e5944000 ldr r4, [r4]
12c40: e0600180 rsb r0, r0, r0, lsl #3
12c44: e0844180 add r4, r4, r0, lsl #3
rtems_libio_check_is_open( iop );
12c48: e5940014 ldr r0, [r4, #20]
12c4c: e3100c01 tst r0, #256 ; 0x100
12c50: 0a000014 beq 12ca8 <read+0x84>
rtems_libio_check_buffer( buffer );
12c54: e3510000 cmp r1, #0
12c58: 0a000017 beq 12cbc <read+0x98>
rtems_libio_check_count( count );
12c5c: e3520000 cmp r2, #0
12c60: 0a00000e beq 12ca0 <read+0x7c>
rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ );
12c64: e3100002 tst r0, #2
12c68: 0a000013 beq 12cbc <read+0x98>
return 0;
/*
* Now process the read().
*/
rc = (*iop->pathinfo.handlers->read_h)( iop, buffer, count );
12c6c: e5943020 ldr r3, [r4, #32]
12c70: e1a00004 mov r0, r4
12c74: e1a0e00f mov lr, pc
12c78: e593f008 ldr pc, [r3, #8]
if ( rc > 0 )
12c7c: e3500000 cmp r0, #0
12c80: d8bd8010 pople {r4, pc}
iop->offset += rc;
12c84: e284300c add r3, r4, #12
12c88: e893000c ldm r3, {r2, r3}
12c8c: e0922000 adds r2, r2, r0
12c90: e0a33fc0 adc r3, r3, r0, asr #31
12c94: e584200c str r2, [r4, #12]
12c98: e5843010 str r3, [r4, #16]
12c9c: 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 );
12ca0: e1a00002 mov r0, r2 <== NOT EXECUTED
if ( rc > 0 )
iop->offset += rc;
return rc;
}
12ca4: 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 );
12ca8: ebffeb79 bl da94 <__errno>
12cac: e3a03009 mov r3, #9
12cb0: e5803000 str r3, [r0]
12cb4: e3e00000 mvn r0, #0
12cb8: e8bd8010 pop {r4, pc}
rtems_libio_check_buffer( buffer );
rtems_libio_check_count( count );
rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ );
12cbc: ebffeb74 bl da94 <__errno> <== NOT EXECUTED
12cc0: e3a03016 mov r3, #22 <== NOT EXECUTED
12cc4: e5803000 str r3, [r0] <== NOT EXECUTED
12cc8: e3e00000 mvn r0, #0 <== NOT EXECUTED
12ccc: 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: eb0034e4 bl 12870 <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: eb002d6c bl 10b08 <__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: eb002d65 bl 10b08 <__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: eb002a5f bl eb40 <__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: eb002a59 bl eb40 <__errno>
41d8: e3a03009 mov r3, #9
41dc: e5803000 str r3, [r0]
41e0: e3e08000 mvn r8, #0
41e4: eafffff8 b 41cc <readv+0x128>
00012d30 <realloc>:
void *realloc(
void *ptr,
size_t size
)
{
12d30: 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())) {
12d34: e59f2118 ldr r2, [pc, #280] ; 12e54 <realloc+0x124>
)
{
uintptr_t old_size;
char *new_area;
MSBUMP(realloc_calls, 1);
12d38: e59f5118 ldr r5, [pc, #280] ; 12e58 <realloc+0x128>
/*
* Do not attempt to allocate memory if in a critical section or ISR.
*/
if (_System_state_Is_up(_System_state_Get())) {
12d3c: e5922000 ldr r2, [r2]
)
{
uintptr_t old_size;
char *new_area;
MSBUMP(realloc_calls, 1);
12d40: 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())) {
12d44: e3520003 cmp r2, #3
)
{
uintptr_t old_size;
char *new_area;
MSBUMP(realloc_calls, 1);
12d48: e2833001 add r3, r3, #1
void *realloc(
void *ptr,
size_t size
)
{
12d4c: e24dd004 sub sp, sp, #4
12d50: e1a04000 mov r4, r0
12d54: e1a06001 mov r6, r1
uintptr_t old_size;
char *new_area;
MSBUMP(realloc_calls, 1);
12d58: 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())) {
12d5c: 0a000020 beq 12de4 <realloc+0xb4>
}
/*
* Continue with realloc().
*/
if ( !ptr )
12d60: e3540000 cmp r4, #0
12d64: 0a00001a beq 12dd4 <realloc+0xa4>
return malloc( size );
if ( !size ) {
12d68: e3560000 cmp r6, #0
12d6c: 0a00000f beq 12db0 <realloc+0x80>
free( ptr );
return (void *) 0;
}
if ( !_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, ptr, &old_size) ) {
12d70: e59f70e4 ldr r7, [pc, #228] ; 12e5c <realloc+0x12c>
12d74: e1a01004 mov r1, r4
12d78: e5970000 ldr r0, [r7]
12d7c: e1a0200d mov r2, sp
12d80: eb000065 bl 12f1c <_Protected_heap_Get_block_size>
12d84: e2508000 subs r8, r0, #0
12d88: 0a00000c beq 12dc0 <realloc+0x90>
}
/*
* Now resize it.
*/
if ( _Protected_heap_Resize_block( RTEMS_Malloc_Heap, ptr, size ) ) {
12d8c: e5970000 ldr r0, [r7]
12d90: e1a01004 mov r1, r4
12d94: e1a02006 mov r2, r6
12d98: eb000070 bl 12f60 <_Protected_heap_Resize_block>
12d9c: e3500000 cmp r0, #0
12da0: 0a00001a beq 12e10 <realloc+0xe0>
memcpy( new_area, ptr, (size < old_size) ? size : old_size );
free( ptr );
return new_area;
}
12da4: e1a00004 mov r0, r4
12da8: e28dd004 add sp, sp, #4
12dac: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
*/
if ( !ptr )
return malloc( size );
if ( !size ) {
free( ptr );
12db0: e1a00004 mov r0, r4 <== NOT EXECUTED
12db4: ebffbc82 bl 1fc4 <free> <== NOT EXECUTED
return (void *) 0;
12db8: e1a04006 mov r4, r6 <== NOT EXECUTED
12dbc: eafffff8 b 12da4 <realloc+0x74> <== NOT EXECUTED
}
if ( !_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, ptr, &old_size) ) {
errno = EINVAL;
12dc0: ebffeb33 bl da94 <__errno>
12dc4: e3a03016 mov r3, #22
12dc8: e5803000 str r3, [r0]
return (void *) 0;
12dcc: e1a04008 mov r4, r8
12dd0: eafffff3 b 12da4 <realloc+0x74>
/*
* Continue with realloc().
*/
if ( !ptr )
return malloc( size );
12dd4: e1a00006 mov r0, r6
12dd8: ebffbd53 bl 232c <malloc>
12ddc: e1a04000 mov r4, r0
12de0: eaffffef b 12da4 <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)
12de4: e59f3074 ldr r3, [pc, #116] ; 12e60 <realloc+0x130>
12de8: e5933000 ldr r3, [r3]
12dec: e3530000 cmp r3, #0
return (void *) 0;
12df0: 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)
12df4: 1affffea bne 12da4 <realloc+0x74>
return (void *) 0;
if (_ISR_Nest_level > 0)
12df8: e59f2064 ldr r2, [pc, #100] ; 12e64 <realloc+0x134>
12dfc: e5922000 ldr r2, [r2]
12e00: e3520000 cmp r2, #0
return (void *) 0;
12e04: 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)
12e08: 0affffd4 beq 12d60 <realloc+0x30>
12e0c: eaffffe4 b 12da4 <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 );
12e10: e1a00006 mov r0, r6
12e14: ebffbd44 bl 232c <malloc>
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
12e18: e5953004 ldr r3, [r5, #4]
if ( !new_area ) {
12e1c: e2507000 subs r7, r0, #0
* and the C Standard.
*/
new_area = malloc( size );
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
12e20: e2433001 sub r3, r3, #1
12e24: e5853004 str r3, [r5, #4]
if ( !new_area ) {
return (void *) 0;
12e28: 01a04007 moveq r4, r7
new_area = malloc( size );
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
if ( !new_area ) {
12e2c: 0affffdc beq 12da4 <realloc+0x74>
return (void *) 0;
}
memcpy( new_area, ptr, (size < old_size) ? size : old_size );
12e30: e59d2000 ldr r2, [sp]
12e34: e1a01004 mov r1, r4
12e38: e1560002 cmp r6, r2
12e3c: 31a02006 movcc r2, r6
12e40: ebffed41 bl e34c <memcpy>
free( ptr );
12e44: e1a00004 mov r0, r4
12e48: ebffbc5d bl 1fc4 <free>
return new_area;
12e4c: e1a04007 mov r4, r7
12e50: eaffffd3 b 12da4 <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: eb002e62 bl fc14 <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: eb002e5c bl fc14 <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: eb002a6e bl ed00 <__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: eb003287 bl f57c <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: eb00327b bl f57c <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}
0000d9d8 <rtems_deviceio_errno>:
[RTEMS_PROXY_BLOCKING] = EIO
};
int rtems_deviceio_errno(rtems_status_code sc)
{
if (sc == RTEMS_SUCCESSFUL) {
d9d8: e2503000 subs r3, r0, #0
[RTEMS_IO_ERROR] = EIO,
[RTEMS_PROXY_BLOCKING] = EIO
};
int rtems_deviceio_errno(rtems_status_code sc)
{
d9dc: e92d4010 push {r4, lr}
if (sc == RTEMS_SUCCESSFUL) {
d9e0: 1a000001 bne d9ec <rtems_deviceio_errno+0x14>
errno = eno;
return -1;
}
}
d9e4: e1a00003 mov r0, r3
d9e8: e8bd8010 pop {r4, pc}
if (sc == RTEMS_SUCCESSFUL) {
return 0;
} else {
int eno = EINVAL;
if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) {
d9ec: e353001c cmp r3, #28 <== NOT EXECUTED
eno = status_code_to_errno [sc];
d9f0: 959f2014 ldrls r2, [pc, #20] ; da0c <rtems_deviceio_errno+0x34><== NOT EXECUTED
int rtems_deviceio_errno(rtems_status_code sc)
{
if (sc == RTEMS_SUCCESSFUL) {
return 0;
} else {
int eno = EINVAL;
d9f4: 83a04016 movhi r4, #22 <== NOT EXECUTED
if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) {
eno = status_code_to_errno [sc];
d9f8: 97924103 ldrls r4, [r2, r3, lsl #2] <== NOT EXECUTED
}
errno = eno;
d9fc: eb000024 bl da94 <__errno> <== NOT EXECUTED
return -1;
da00: e3e03000 mvn r3, #0 <== NOT EXECUTED
if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) {
eno = status_code_to_errno [sc];
}
errno = eno;
da04: e5804000 str r4, [r0] <== NOT EXECUTED
return -1;
da08: eafffff5 b d9e4 <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: eb0032ce bl ea54 <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: eb002eea bl da94 <__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: eb002ee5 bl da94 <__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: eb002f0c bl da94 <__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: eb002f07 bl da94 <__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: eb000fdf bl 5ce0 <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: eb000fdb bl 5ce0 <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: eb000fd7 bl 5ce0 <rtems_fatal_error_occurred> <== NOT EXECUTED
0000a3cc <rtems_filesystem_iterate>:
bool rtems_filesystem_iterate(
rtems_per_filesystem_routine routine,
void *routine_arg
)
{
a3cc: 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 ) {
a3d0: e59f60ac ldr r6, [pc, #172] ; a484 <rtems_filesystem_iterate+0xb8>
a3d4: e5963000 ldr r3, [r6]
a3d8: e3530000 cmp r3, #0
bool rtems_filesystem_iterate(
rtems_per_filesystem_routine routine,
void *routine_arg
)
{
a3dc: e1a04000 mov r4, r0
a3e0: 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 ) {
a3e4: 1a000003 bne a3f8 <rtems_filesystem_iterate+0x2c>
a3e8: ea00000c b a420 <rtems_filesystem_iterate+0x54> <== NOT EXECUTED
a3ec: e3500000 cmp r0, #0 <== NOT EXECUTED
a3f0: e2866008 add r6, r6, #8 <== NOT EXECUTED
a3f4: 1a000020 bne a47c <rtems_filesystem_iterate+0xb0> <== NOT EXECUTED
stop = (*routine)( table_entry, routine_arg );
a3f8: e1a00006 mov r0, r6
a3fc: e1a01005 mov r1, r5
a400: e1a0e00f mov lr, pc
a404: 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 ) {
a408: e5963008 ldr r3, [r6, #8]
a40c: e3530000 cmp r3, #0
stop = (*routine)( table_entry, routine_arg );
a410: 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 ) {
a414: 1afffff4 bne a3ec <rtems_filesystem_iterate+0x20>
stop = (*routine)( table_entry, routine_arg );
++table_entry;
}
if ( !stop ) {
a418: e3500000 cmp r0, #0
a41c: 1a000016 bne a47c <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 );
a420: e59f7060 ldr r7, [pc, #96] ; a488 <rtems_filesystem_iterate+0xbc>
a424: e3a01000 mov r1, #0
}
}
rtems_libio_unlock();
rtems_set_errno_and_return_minus_one( ENOENT );
}
a428: e59f605c ldr r6, [pc, #92] ; a48c <rtems_filesystem_iterate+0xc0>
a42c: e5970000 ldr r0, [r7]
a430: e1a02001 mov r2, r1
a434: ebffec85 bl 5650 <rtems_semaphore_obtain>
a438: e4968004 ldr r8, [r6], #4
++table_entry;
}
if ( !stop ) {
rtems_libio_lock();
for (
a43c: e1580006 cmp r8, r6
a440: 03a0a000 moveq sl, #0
a444: 1a000002 bne a454 <rtems_filesystem_iterate+0x88>
a448: ea000009 b a474 <rtems_filesystem_iterate+0xa8>
node = rtems_chain_first( &filesystem_chain );
!rtems_chain_is_tail( &filesystem_chain, node ) && !stop;
a44c: e3500000 cmp r0, #0
a450: 1a000007 bne a474 <rtems_filesystem_iterate+0xa8>
node = rtems_chain_next( node )
) {
const filesystem_node *fsn = (filesystem_node *) node;
stop = (*routine)( &fsn->entry, routine_arg );
a454: e2880008 add r0, r8, #8
a458: e1a01005 mov r1, r5
a45c: e1a0e00f mov lr, pc
a460: e12fff14 bx r4
}
}
rtems_libio_unlock();
rtems_set_errno_and_return_minus_one( ENOENT );
}
a464: e5988000 ldr r8, [r8]
++table_entry;
}
if ( !stop ) {
rtems_libio_lock();
for (
a468: 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 );
a46c: e1a0a000 mov sl, r0
++table_entry;
}
if ( !stop ) {
rtems_libio_lock();
for (
a470: 1afffff5 bne a44c <rtems_filesystem_iterate+0x80>
}
static inline void rtems_libio_unlock( void )
{
rtems_semaphore_release( rtems_libio_semaphore );
a474: e5970000 ldr r0, [r7]
a478: ebffecbd bl 5774 <rtems_semaphore_release>
}
rtems_libio_unlock();
}
return stop;
}
a47c: e1a0000a mov r0, sl
a480: 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: eb00210c bl ae04 <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: eb0020f2 bl ae04 <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
00007004 <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() )
7004: e59f3150 ldr r3, [pc, #336] ; 715c <rtems_io_register_driver+0x158>
7008: 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;
700c: e59f314c ldr r3, [pc, #332] ; 7160 <rtems_io_register_driver+0x15c>
if ( rtems_interrupt_is_in_progress() )
7010: 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
)
{
7014: e92d4030 push {r4, r5, lr}
7018: e1a04000 mov r4, r0
rtems_device_major_number major_limit = _IO_Number_of_drivers;
701c: e5930000 ldr r0, [r3]
if ( rtems_interrupt_is_in_progress() )
return RTEMS_CALLED_FROM_ISR;
7020: 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() )
7024: 18bd8030 popne {r4, r5, pc}
return RTEMS_CALLED_FROM_ISR;
if ( registered_major == NULL )
7028: e3520000 cmp r2, #0
702c: 0a00003f beq 7130 <rtems_io_register_driver+0x12c>
return RTEMS_INVALID_ADDRESS;
/* Set it to an invalid value */
*registered_major = major_limit;
if ( driver_table == NULL )
7030: e3510000 cmp r1, #0
if ( registered_major == NULL )
return RTEMS_INVALID_ADDRESS;
/* Set it to an invalid value */
*registered_major = major_limit;
7034: e5820000 str r0, [r2]
if ( driver_table == NULL )
7038: 0a00003c beq 7130 <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;
703c: e591c000 ldr ip, [r1]
7040: e35c0000 cmp ip, #0
7044: 0a000036 beq 7124 <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 )
7048: e1500004 cmp r0, r4
704c: 9a000027 bls 70f0 <rtems_io_register_driver+0xec>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
7050: e59f010c ldr r0, [pc, #268] ; 7164 <rtems_io_register_driver+0x160>
7054: e590c000 ldr ip, [r0]
7058: e28cc001 add ip, ip, #1
705c: e580c000 str ip, [r0]
return RTEMS_INVALID_NUMBER;
_Thread_Disable_dispatch();
if ( major == 0 ) {
7060: e3540000 cmp r4, #0
7064: 1a000023 bne 70f8 <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;
7068: e593c000 ldr ip, [r3]
rtems_device_major_number m = 0;
/* major is error checked by caller */
for ( m = 0; m < n; ++m ) {
706c: e35c0000 cmp ip, #0
7070: 0a000030 beq 7138 <rtems_io_register_driver+0x134>
7074: e59fe0ec ldr lr, [pc, #236] ; 7168 <rtems_io_register_driver+0x164>
7078: e59e3000 ldr r3, [lr]
707c: ea000003 b 7090 <rtems_io_register_driver+0x8c>
7080: e2844001 add r4, r4, #1
7084: e15c0004 cmp ip, r4
7088: e2833018 add r3, r3, #24
708c: 9a000005 bls 70a8 <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;
7090: e5930000 ldr r0, [r3]
7094: e3500000 cmp r0, #0
7098: 1afffff8 bne 7080 <rtems_io_register_driver+0x7c>
709c: e5930004 ldr r0, [r3, #4]
70a0: e3500000 cmp r0, #0
70a4: 1afffff5 bne 7080 <rtems_io_register_driver+0x7c>
}
/* Assigns invalid value in case of failure */
*major = m;
if ( m != n )
70a8: e15c0004 cmp ip, r4
70ac: 1084c084 addne ip, r4, r4, lsl #1
if ( rtems_io_is_empty_table( table ) )
break;
}
/* Assigns invalid value in case of failure */
*major = m;
70b0: e5824000 str r4, [r2]
if ( m != n )
70b4: 11a0c18c lslne ip, ip, #3
70b8: 0a00001f beq 713c <rtems_io_register_driver+0x138>
}
*registered_major = major;
}
_IO_Driver_address_table [major] = *driver_table;
70bc: e59e5000 ldr r5, [lr]
70c0: e1a0e001 mov lr, r1
70c4: e8be000f ldm lr!, {r0, r1, r2, r3}
70c8: e085c00c add ip, r5, ip
70cc: e8ac000f stmia ip!, {r0, r1, r2, r3}
70d0: e89e0003 ldm lr, {r0, r1}
70d4: e88c0003 stm ip, {r0, r1}
_Thread_Enable_dispatch();
70d8: eb0006a3 bl 8b6c <_Thread_Enable_dispatch>
return rtems_io_initialize( major, 0, NULL );
70dc: e3a01000 mov r1, #0
70e0: e1a00004 mov r0, r4
70e4: e1a02001 mov r2, r1
}
70e8: e8bd4030 pop {r4, r5, lr}
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
70ec: ea002114 b f544 <rtems_io_initialize>
if ( rtems_io_is_empty_table( driver_table ) )
return RTEMS_INVALID_ADDRESS;
if ( major >= major_limit )
return RTEMS_INVALID_NUMBER;
70f0: e3a0000a mov r0, #10
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
}
70f4: 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;
70f8: e59fe068 ldr lr, [pc, #104] ; 7168 <rtems_io_register_driver+0x164>
70fc: e59e3000 ldr r3, [lr]
7100: 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;
7104: 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;
7108: 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;
710c: e3500000 cmp r0, #0
_Thread_Enable_dispatch();
return sc;
}
major = *registered_major;
} else {
rtems_driver_address_table *const table = _IO_Driver_address_table + major;
7110: 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;
7114: 0a00000b beq 7148 <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();
7118: eb000693 bl 8b6c <_Thread_Enable_dispatch>
return RTEMS_RESOURCE_IN_USE;
711c: e3a0000c mov r0, #12
7120: 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;
7124: e591c004 ldr ip, [r1, #4]
7128: e35c0000 cmp ip, #0
712c: 1affffc5 bne 7048 <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;
7130: e3a00009 mov r0, #9
7134: e8bd8030 pop {r4, r5, pc}
if ( rtems_io_is_empty_table( table ) )
break;
}
/* Assigns invalid value in case of failure */
*major = m;
7138: 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();
713c: eb00068a bl 8b6c <_Thread_Enable_dispatch>
*major = m;
if ( m != n )
return RTEMS_SUCCESSFUL;
return RTEMS_TOO_MANY;
7140: 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;
7144: 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;
7148: e5933004 ldr r3, [r3, #4]
714c: e3530000 cmp r3, #0
7150: 1afffff0 bne 7118 <rtems_io_register_driver+0x114>
if ( !rtems_io_is_empty_table( table ) ) {
_Thread_Enable_dispatch();
return RTEMS_RESOURCE_IN_USE;
}
*registered_major = major;
7154: e5824000 str r4, [r2]
7158: eaffffd7 b 70bc <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: eb000ed0 bl 5ce0 <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: eb000ece bl 5ce0 <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: eb002d09 bl e750 <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
0000a0bc <rtems_libio_to_fcntl_flags>:
uint32_t flags
)
{
uint32_t fcntl_flags = 0;
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
a0bc: e2002006 and r2, r0, #6
a0c0: e3520006 cmp r2, #6
*/
uint32_t rtems_libio_to_fcntl_flags(
uint32_t flags
)
{
a0c4: e1a03000 mov r3, r0
uint32_t fcntl_flags = 0;
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
fcntl_flags |= O_RDWR;
a0c8: 03a00002 moveq r0, #2
uint32_t flags
)
{
uint32_t fcntl_flags = 0;
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
a0cc: 0a000002 beq a0dc <rtems_libio_to_fcntl_flags+0x20>
fcntl_flags |= O_RDWR;
} else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) {
a0d0: e3130002 tst r3, #2
fcntl_flags |= O_RDONLY;
a0d4: 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) {
a0d8: 0a000006 beq a0f8 <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 ) {
a0dc: e3130001 tst r3, #1
fcntl_flags |= O_NONBLOCK;
a0e0: 13800901 orrne r0, r0, #16384 ; 0x4000
}
if ( (flags & LIBIO_FLAGS_APPEND) == LIBIO_FLAGS_APPEND ) {
a0e4: e3130c02 tst r3, #512 ; 0x200
fcntl_flags |= O_APPEND;
a0e8: 13800008 orrne r0, r0, #8
}
if ( (flags & LIBIO_FLAGS_CREATE) == LIBIO_FLAGS_CREATE ) {
a0ec: e3130b01 tst r3, #1024 ; 0x400
fcntl_flags |= O_CREAT;
a0f0: 13800c02 orrne r0, r0, #512 ; 0x200
}
return fcntl_flags;
}
a0f4: e12fff1e bx lr
)
{
uint32_t fcntl_flags = 0;
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
fcntl_flags |= O_RDWR;
a0f8: e3130004 tst r3, #4 <== NOT EXECUTED
a0fc: 03a00000 moveq r0, #0 <== NOT EXECUTED
a100: 13a00001 movne r0, #1 <== NOT EXECUTED
a104: eafffff4 b a0dc <rtems_libio_to_fcntl_flags+0x20> <== NOT EXECUTED
0000cc3c <rtems_mkdir>:
return (retval);
}
int
rtems_mkdir(const char *path, mode_t mode)
{
cc3c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
cc40: e24dd048 sub sp, sp, #72 ; 0x48
cc44: e1a0a001 mov sl, r1
int success = 0;
char *dup_path = strdup(path);
cc48: eb000ed9 bl 107b4 <strdup>
if (dup_path != NULL) {
cc4c: e2506000 subs r6, r0, #0
cc50: 0a000055 beq cdac <rtems_mkdir+0x170>
char *p;
p = path;
oumask = 0;
retval = 1;
if (p[0] == '/') /* Skip leading '/'. */
cc54: e5d63000 ldrb r3, [r6]
cc58: e353002f cmp r3, #47 ; 0x2f
cc5c: e3a07000 mov r7, #0
++p;
cc60: 05d63001 ldrbeq r3, [r6, #1]
cc64: 02865001 addeq r5, r6, #1
char *p;
p = path;
oumask = 0;
retval = 1;
if (p[0] == '/') /* Skip leading '/'. */
cc68: 11a05006 movne r5, r6
cc6c: e3a02001 mov r2, #1
retval = 0;
break;
}
}
if (!last)
*p = '/';
cc70: e3a0802f mov r8, #47 ; 0x2f
cc74: 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) {
cc78: 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')
cc7c: e3530000 cmp r3, #0
last = 1;
else if (p[0] != '/')
continue;
*p = '\0';
cc80: 05c53000 strbeq r3, [r5]
cc84: 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')
cc88: 0a000006 beq cca8 <rtems_mkdir+0x6c>
last = 1;
else if (p[0] != '/')
cc8c: e353002f cmp r3, #47 ; 0x2f
retval = 0;
break;
}
}
if (!last)
*p = '/';
cc90: 15f53001 ldrbne r3, [r5, #1]!
cc94: 1afffff8 bne cc7c <rtems_mkdir+0x40>
if (p[0] == '\0')
last = 1;
else if (p[0] != '/')
continue;
*p = '\0';
if (!last && p[1] == '\0')
cc98: 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';
cc9c: e5c59000 strb r9, [r5]
if (!last && p[1] == '\0')
cca0: e2744001 rsbs r4, r4, #1
cca4: 33a04000 movcc r4, #0
last = 1;
if (first) {
cca8: e3520000 cmp r2, #0
ccac: 1a000031 bne cd78 <rtems_mkdir+0x13c>
oumask = umask(0);
numask = oumask & ~(S_IWUSR | S_IXUSR);
(void)umask(numask);
first = 0;
}
if (last)
ccb0: e3540000 cmp r4, #0
(void)umask(oumask);
if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
ccb4: 03a01f7f moveq r1, #508 ; 0x1fc
ccb8: 02811003 addeq r1, r1, #3
oumask = umask(0);
numask = oumask & ~(S_IWUSR | S_IXUSR);
(void)umask(numask);
first = 0;
}
if (last)
ccbc: 1a000011 bne cd08 <rtems_mkdir+0xcc>
(void)umask(oumask);
if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
ccc0: e1a00006 mov r0, r6
ccc4: ebffdb6b bl 3a78 <mkdir>
ccc8: e3500000 cmp r0, #0
cccc: ba000014 blt cd24 <rtems_mkdir+0xe8>
} else {
retval = 0;
break;
}
}
if (!last)
ccd0: e3540000 cmp r4, #0
ccd4: 0a000007 beq ccf8 <rtems_mkdir+0xbc>
ccd8: e3a04001 mov r4, #1
int success = 0;
char *dup_path = strdup(path);
if (dup_path != NULL) {
success = build(dup_path, mode);
free(dup_path);
ccdc: e1a00006 mov r0, r6
cce0: ebffd97e bl 32e0 <free>
}
return success != 0 ? 0 : -1;
cce4: e3540000 cmp r4, #0
cce8: 13a00000 movne r0, #0
ccec: 0a00002e beq cdac <rtems_mkdir+0x170>
}
ccf0: e28dd048 add sp, sp, #72 ; 0x48
ccf4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
retval = 0;
break;
}
}
if (!last)
*p = '/';
ccf8: e5c58000 strb r8, [r5]
ccfc: e3a02000 mov r2, #0
cd00: e5f53001 ldrb r3, [r5, #1]!
cd04: eaffffdc b cc7c <rtems_mkdir+0x40>
numask = oumask & ~(S_IWUSR | S_IXUSR);
(void)umask(numask);
first = 0;
}
if (last)
(void)umask(oumask);
cd08: e1a00007 mov r0, r7
cd0c: eb00005b bl ce80 <umask>
if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
cd10: e1a0100a mov r1, sl
cd14: e1a00006 mov r0, r6
cd18: ebffdb56 bl 3a78 <mkdir>
cd1c: e3500000 cmp r0, #0
cd20: aaffffea bge ccd0 <rtems_mkdir+0x94>
if (errno == EEXIST || errno == EISDIR) {
cd24: eb000aba bl f814 <__errno>
cd28: e5903000 ldr r3, [r0]
cd2c: e3530011 cmp r3, #17
cd30: 0a000003 beq cd44 <rtems_mkdir+0x108>
cd34: eb000ab6 bl f814 <__errno> <== NOT EXECUTED
cd38: e5903000 ldr r3, [r0] <== NOT EXECUTED
cd3c: e3530015 cmp r3, #21 <== NOT EXECUTED
cd40: 1a000024 bne cdd8 <rtems_mkdir+0x19c> <== NOT EXECUTED
if (stat(path, &sb) < 0) {
cd44: e1a00006 mov r0, r6
cd48: e1a0100d mov r1, sp
cd4c: eb000024 bl cde4 <stat>
cd50: e3500000 cmp r0, #0
cd54: ba00001f blt cdd8 <rtems_mkdir+0x19c>
retval = 0;
break;
} else if (!S_ISDIR(sb.st_mode)) {
cd58: e59d300c ldr r3, [sp, #12]
cd5c: e2033a0f and r3, r3, #61440 ; 0xf000
cd60: e3530901 cmp r3, #16384 ; 0x4000
cd64: 1a000012 bne cdb4 <rtems_mkdir+0x178>
else
errno = ENOTDIR;
retval = 0;
break;
}
if (last)
cd68: e3540000 cmp r4, #0
cd6c: 0affffe1 beq ccf8 <rtems_mkdir+0xbc>
retval = 2;
cd70: e3a04002 mov r4, #2
cd74: eaffffd8 b ccdc <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);
cd78: e3a00000 mov r0, #0
cd7c: eb00003f bl ce80 <umask>
cd80: e1a07000 mov r7, r0
numask = oumask & ~(S_IWUSR | S_IXUSR);
(void)umask(numask);
cd84: e3c000c0 bic r0, r0, #192 ; 0xc0
cd88: eb00003c bl ce80 <umask>
cd8c: eaffffc7 b ccb0 <rtems_mkdir+0x74>
break;
} else if (!S_ISDIR(sb.st_mode)) {
if (last)
errno = EEXIST;
else
errno = ENOTDIR;
cd90: eb000a9f bl f814 <__errno> <== NOT EXECUTED
cd94: e3a03014 mov r3, #20 <== NOT EXECUTED
cd98: e5803000 str r3, [r0] <== NOT EXECUTED
}
if (!last)
*p = '/';
}
if (!first && !last)
(void)umask(oumask);
cd9c: e1a00007 mov r0, r7 <== NOT EXECUTED
cda0: eb000036 bl ce80 <umask> <== NOT EXECUTED
int success = 0;
char *dup_path = strdup(path);
if (dup_path != NULL) {
success = build(dup_path, mode);
free(dup_path);
cda4: e1a00006 mov r0, r6 <== NOT EXECUTED
cda8: ebffd94c bl 32e0 <free> <== NOT EXECUTED
}
return success != 0 ? 0 : -1;
cdac: e3e00000 mvn r0, #0 <== NOT EXECUTED
cdb0: eaffffce b ccf0 <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)
cdb4: e3540000 cmp r4, #0
cdb8: 0afffff4 beq cd90 <rtems_mkdir+0x154>
errno = EEXIST;
cdbc: eb000a94 bl f814 <__errno>
cdc0: e3a03011 mov r3, #17
cdc4: e5803000 str r3, [r0]
int success = 0;
char *dup_path = strdup(path);
if (dup_path != NULL) {
success = build(dup_path, mode);
free(dup_path);
cdc8: e1a00006 mov r0, r6
cdcc: ebffd943 bl 32e0 <free>
}
return success != 0 ? 0 : -1;
cdd0: e3e00000 mvn r0, #0
cdd4: eaffffc5 b ccf0 <rtems_mkdir+0xb4>
}
}
if (!last)
*p = '/';
}
if (!first && !last)
cdd8: e3540000 cmp r4, #0 <== NOT EXECUTED
cddc: 0affffee beq cd9c <rtems_mkdir+0x160> <== NOT EXECUTED
cde0: eaffffef b cda4 <rtems_mkdir+0x168> <== NOT EXECUTED
0000595c <rtems_object_get_api_class_name>:
)
{
const rtems_assoc_t *api_assoc;
const rtems_assoc_t *class_assoc;
if ( the_api == OBJECTS_INTERNAL_API )
595c: e3500001 cmp r0, #1
const char *rtems_object_get_api_class_name(
int the_api,
int the_class
)
{
5960: e52de004 push {lr} ; (str lr, [sp, #-4]!)
const rtems_assoc_t *api_assoc;
const rtems_assoc_t *class_assoc;
if ( the_api == OBJECTS_INTERNAL_API )
5964: 0a00000d beq 59a0 <rtems_object_get_api_class_name+0x44>
api_assoc = rtems_object_api_internal_assoc;
else if ( the_api == OBJECTS_CLASSIC_API )
5968: e3500002 cmp r0, #2
596c: 0a000004 beq 5984 <rtems_object_get_api_class_name+0x28>
api_assoc = rtems_object_api_classic_assoc;
#ifdef RTEMS_POSIX_API
else if ( the_api == OBJECTS_POSIX_API )
5970: e3500003 cmp r0, #3
api_assoc = rtems_object_api_posix_assoc;
5974: 059f003c ldreq r0, [pc, #60] ; 59b8 <rtems_object_get_api_class_name+0x5c>
if ( the_api == OBJECTS_INTERNAL_API )
api_assoc = rtems_object_api_internal_assoc;
else if ( the_api == OBJECTS_CLASSIC_API )
api_assoc = rtems_object_api_classic_assoc;
#ifdef RTEMS_POSIX_API
else if ( the_api == OBJECTS_POSIX_API )
5978: 0a000002 beq 5988 <rtems_object_get_api_class_name+0x2c>
api_assoc = rtems_object_api_posix_assoc;
#endif
else
return "BAD API";
597c: e59f0038 ldr r0, [pc, #56] ; 59bc <rtems_object_get_api_class_name+0x60>
5980: e49df004 pop {pc} ; (ldr pc, [sp], #4)
const rtems_assoc_t *class_assoc;
if ( the_api == OBJECTS_INTERNAL_API )
api_assoc = rtems_object_api_internal_assoc;
else if ( the_api == OBJECTS_CLASSIC_API )
api_assoc = rtems_object_api_classic_assoc;
5984: e59f0034 ldr r0, [pc, #52] ; 59c0 <rtems_object_get_api_class_name+0x64>
else if ( the_api == OBJECTS_POSIX_API )
api_assoc = rtems_object_api_posix_assoc;
#endif
else
return "BAD API";
class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class );
5988: eb001342 bl a698 <rtems_assoc_ptr_by_local>
if ( class_assoc )
598c: e3500000 cmp r0, #0
return class_assoc->name;
5990: 15900000 ldrne r0, [r0]
api_assoc = rtems_object_api_posix_assoc;
#endif
else
return "BAD API";
class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class );
if ( class_assoc )
5994: 149df004 popne {pc} ; (ldrne pc, [sp], #4)
return class_assoc->name;
return "BAD CLASS";
5998: e59f0024 ldr r0, [pc, #36] ; 59c4 <rtems_object_get_api_class_name+0x68>
}
599c: e49df004 pop {pc} ; (ldr pc, [sp], #4)
{
const rtems_assoc_t *api_assoc;
const rtems_assoc_t *class_assoc;
if ( the_api == OBJECTS_INTERNAL_API )
api_assoc = rtems_object_api_internal_assoc;
59a0: e59f0020 ldr r0, [pc, #32] ; 59c8 <rtems_object_get_api_class_name+0x6c>
else if ( the_api == OBJECTS_POSIX_API )
api_assoc = rtems_object_api_posix_assoc;
#endif
else
return "BAD API";
class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class );
59a4: eb00133b bl a698 <rtems_assoc_ptr_by_local>
if ( class_assoc )
59a8: e3500000 cmp r0, #0
return class_assoc->name;
59ac: 15900000 ldrne r0, [r0]
api_assoc = rtems_object_api_posix_assoc;
#endif
else
return "BAD API";
class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class );
if ( class_assoc )
59b0: 149df004 popne {pc} ; (ldrne pc, [sp], #4)
59b4: eafffff7 b 5998 <rtems_object_get_api_class_name+0x3c> <== 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: eb0034ca bl ef14 <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: eb0035fd bl f3f0 <strlen>
1bf8: e59f11b8 ldr r1, [pc, #440] ; 1db8 <rtems_print_buffer+0x238>
1bfc: e0840000 add r0, r4, r0
1c00: e3a02002 mov r2, #2
1c04: eb00342b bl ecb8 <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: eb0034b6 bl ef14 <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: eb0035e9 bl f3f0 <strlen>
1c48: e59f1170 ldr r1, [pc, #368] ; 1dc0 <rtems_print_buffer+0x240>
1c4c: e3a02003 mov r2, #3
1c50: e0840000 add r0, r4, r0
1c54: eb003417 bl ecb8 <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: eb003499 bl ef14 <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: eb0035c9 bl f3f0 <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: eb0033f6 bl ecb8 <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: eb0035c0 bl f3f0 <strlen>
1cec: e59f10c4 ldr r1, [pc, #196] ; 1db8 <rtems_print_buffer+0x238>
1cf0: e0840000 add r0, r4, r0
1cf4: e3a02002 mov r2, #2
1cf8: eb0033ee bl ecb8 <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: eb003475 bl ef14 <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: eb0035a6 bl f3f0 <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: eb0033d3 bl ecb8 <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: eb00359d bl f3f0 <strlen>
1d78: e59f1040 ldr r1, [pc, #64] ; 1dc0 <rtems_print_buffer+0x240>
1d7c: e0840000 add r0, r4, r0
1d80: e3a02003 mov r2, #3
1d84: eb0033cb bl ecb8 <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: eb003594 bl f3f0 <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: eb0033c2 bl ecb8 <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: e59120c8 ldr r2, [r1, #200] ; 0xc8
/*
* 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: e59110c4 ldr r1, [r1, #196] ; 0xc4
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: e59030c8 ldr r3, [r0, #200] ; 0xc8
*/
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: e59420c4 ldr r2, [r4, #196] ; 0xc4
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: eb003345 bl e268 <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: eb00333e bl e268 <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>
0000bb74 <rtems_string_to_pointer>:
#if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER)
,
int base
#endif
)
{
bb74: e92d40f0 push {r4, r5, r6, r7, lr}
STRING_TO_INPUT_TYPE result;
char *end;
if ( !n )
bb78: e2515000 subs r5, r1, #0
#if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER)
,
int base
#endif
)
{
bb7c: e1a04000 mov r4, r0
bb80: e24dd004 sub sp, sp, #4
bb84: e1a06002 mov r6, r2
STRING_TO_INPUT_TYPE result;
char *end;
if ( !n )
return RTEMS_INVALID_ADDRESS;
bb88: 03a00009 moveq r0, #9
)
{
STRING_TO_INPUT_TYPE result;
char *end;
if ( !n )
bb8c: 0a000013 beq bbe0 <rtems_string_to_pointer+0x6c>
return RTEMS_INVALID_ADDRESS;
errno = 0;
bb90: eb000b97 bl e9f4 <__errno>
bb94: e3a03000 mov r3, #0
bb98: 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 );
bb9c: e1a0100d mov r1, sp
if ( !n )
return RTEMS_INVALID_ADDRESS;
errno = 0;
*n = 0;
bba0: 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 );
bba4: e1a00004 mov r0, r4
bba8: e3a02010 mov r2, #16
bbac: eb00191d bl 12028 <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 )
bbb0: e3560000 cmp r6, #0
*endptr = end;
bbb4: 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 )
bbb8: 059d3000 ldreq r3, [sp]
*endptr = end;
bbbc: 15863000 strne r3, [r6]
/* nothing was converted */
if ( end == s )
bbc0: 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 );
bbc4: e1a07000 mov r7, r0
if ( endptr )
*endptr = end;
/* nothing was converted */
if ( end == s )
return RTEMS_NOT_DEFINED;
bbc8: 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 )
bbcc: 0a000003 beq bbe0 <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))
bbd0: e3770001 cmn r7, #1
bbd4: 0a000003 beq bbe8 <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;
bbd8: e5857000 str r7, [r5]
#else
*n = (STRING_TO_TYPE) result;
#endif
return RTEMS_SUCCESSFUL;
bbdc: e3a00000 mov r0, #0
}
bbe0: e28dd004 add sp, sp, #4
bbe4: 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))
bbe8: eb000b81 bl e9f4 <__errno> <== NOT EXECUTED
bbec: e5903000 ldr r3, [r0] <== NOT EXECUTED
bbf0: e3530022 cmp r3, #34 ; 0x22 <== NOT EXECUTED
return RTEMS_INVALID_NUMBER;
bbf4: 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))
bbf8: 1afffff6 bne bbd8 <rtems_string_to_pointer+0x64> <== NOT EXECUTED
bbfc: eafffff7 b bbe0 <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: eb004130 bl 11d08 <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: eb00412a bl 11d68 <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: eb004180 bl 11ed8 <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: eb001fc6 bl 9804 <_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: eb001fc2 bl 9804 <_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: eb001fbe bl 9804 <_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: eb0020c7 bl 9c38 <_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: eb0022e5 bl a510 <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: eb003f14 bl 115f8 <strcpy>
if (full_filename[strlen(full_filename)-1] != '/')
19a4: e28d0018 add r0, sp, #24
19a8: eb0040d6 bl 11d08 <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: eb003cb3 bl 10ca4 <memcpy> <== NOT EXECUTED
strcat(full_filename, filename);
19d4: e1a01005 mov r1, r5
19d8: e28d0018 add r0, sp, #24
19dc: eb003e4e bl 1131c <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: eb00210b bl 9e48 <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: eb0009be bl 5ce0 <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: eb00042b bl 5ce0 <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: eb0032e5 bl 11268 <__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: eb0032db bl 11268 <__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: eb000a4a bl 5ce0 <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: eb00360e bl 11268 <__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: eb000875 bl 5ce0 <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: eb0033ab bl 11268 <__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: eb0033a2 bl 11268 <__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: eb003229 bl 11268 <__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: eb0032ca bl 135a4 <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: eb004b39 bl 19780 <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: eb0036a9 bl 14560 <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: eb003398 bl 1393c <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: eb003393 bl 1393c <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: eb0032a9 bl 135a4 <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: eb003384 bl 1393c <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: eb0031a4 bl 131c8 <__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: eb003684 bl 14560 <strerror>
6b4c: e59f1028 ldr r1, [pc, #40] ; 6b7c <rtems_verror+0x164>
6b50: e1a02000 mov r2, r0
6b54: e1a00004 mov r0, r4
6b58: eb003377 bl 1393c <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: eb003632 bl 10098 <__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: eb0035f7 bl 10098 <__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
0000874c <sem_timedwait>:
int sem_timedwait(
sem_t *sem,
const struct timespec *abstime
)
{
874c: e92d4010 push {r4, lr}
8750: e24dd004 sub sp, sp, #4
8754: e1a04000 mov r4, r0
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
8758: e1a00001 mov r0, r1
875c: e1a0100d mov r1, sp
8760: eb001636 bl e040 <_POSIX_Absolute_timeout_to_ticks>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
8764: e3500003 cmp r0, #3
8768: 0a000005 beq 8784 <sem_timedwait+0x38>
do_wait = false;
lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks );
876c: e1a00004 mov r0, r4 <== NOT EXECUTED
8770: e3a01000 mov r1, #0 <== NOT EXECUTED
8774: e59d2000 ldr r2, [sp] <== NOT EXECUTED
8778: eb00194a bl eca8 <_POSIX_Semaphore_Wait_support> <== NOT EXECUTED
break;
}
}
return lock_status;
}
877c: e28dd004 add sp, sp, #4
8780: e8bd8010 pop {r4, pc}
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks );
8784: e1a00004 mov r0, r4
8788: e3a01001 mov r1, #1
878c: e59d2000 ldr r2, [sp]
8790: eb001944 bl eca8 <_POSIX_Semaphore_Wait_support>
8794: eafffff8 b 877c <sem_timedwait+0x30>
00005f94 <sigaction>:
struct sigaction *oact
)
{
ISR_Level level;
if ( oact )
5f94: e2523000 subs r3, r2, #0
*oact = _POSIX_signals_Vectors[ sig ];
5f98: 159f20c4 ldrne r2, [pc, #196] ; 6064 <sigaction+0xd0>
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
5f9c: e92d4070 push {r4, r5, r6, lr}
5fa0: e1a05001 mov r5, r1
ISR_Level level;
if ( oact )
*oact = _POSIX_signals_Vectors[ sig ];
5fa4: 10801080 addne r1, r0, r0, lsl #1
5fa8: 10822101 addne r2, r2, r1, lsl #2
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
5fac: e1a04000 mov r4, r0
ISR_Level level;
if ( oact )
*oact = _POSIX_signals_Vectors[ sig ];
5fb0: 18920007 ldmne r2, {r0, r1, r2}
5fb4: 18830007 stmne r3, {r0, r1, r2}
if ( !sig )
5fb8: e3540000 cmp r4, #0
5fbc: 0a000023 beq 6050 <sigaction+0xbc>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
5fc0: e2443001 sub r3, r4, #1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
5fc4: e353001f cmp r3, #31
5fc8: 8a000020 bhi 6050 <sigaction+0xbc>
*
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
5fcc: e3540009 cmp r4, #9
5fd0: 0a00001e beq 6050 <sigaction+0xbc>
/*
* Evaluate the new action structure and set the global signal vector
* appropriately.
*/
if ( act ) {
5fd4: e3550000 cmp r5, #0
5fd8: 0a00001a beq 6048 <sigaction+0xb4>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
5fdc: e10f6000 mrs r6, CPSR
5fe0: e3863080 orr r3, r6, #128 ; 0x80
5fe4: e129f003 msr CPSR_fc, r3
* Unless the user is installing the default signal actions, then
* we can just copy the provided sigaction structure into the vectors.
*/
_ISR_Disable( level );
if ( act->sa_handler == SIG_DFL ) {
5fe8: e5953008 ldr r3, [r5, #8]
5fec: e3530000 cmp r3, #0
5ff0: 0a000009 beq 601c <sigaction+0x88>
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
} else {
_POSIX_signals_Clear_process_signals( sig );
5ff4: e1a00004 mov r0, r4
5ff8: eb00170a bl bc28 <_POSIX_signals_Clear_process_signals>
_POSIX_signals_Vectors[ sig ] = *act;
5ffc: e59f3060 ldr r3, [pc, #96] ; 6064 <sigaction+0xd0>
6000: e8950007 ldm r5, {r0, r1, r2}
6004: e0844084 add r4, r4, r4, lsl #1
6008: e0834104 add r4, r3, r4, lsl #2
600c: e8840007 stm r4, {r0, r1, r2}
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
6010: e129f006 msr CPSR_fc, r6
* now (signals not posted when SIG_IGN).
* + If we are now ignoring a signal that was previously pending,
* we clear the pending signal indicator.
*/
return 0;
6014: e3a00000 mov r0, #0
6018: e8bd8070 pop {r4, r5, r6, pc}
* we can just copy the provided sigaction structure into the vectors.
*/
_ISR_Disable( level );
if ( act->sa_handler == SIG_DFL ) {
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
601c: e0844084 add r4, r4, r4, lsl #1
6020: e59f3040 ldr r3, [pc, #64] ; 6068 <sigaction+0xd4>
6024: e1a04104 lsl r4, r4, #2
6028: e0833004 add r3, r3, r4
602c: e8930007 ldm r3, {r0, r1, r2}
6030: e59f302c ldr r3, [pc, #44] ; 6064 <sigaction+0xd0>
6034: e0834004 add r4, r3, r4
6038: e8840007 stm r4, {r0, r1, r2}
603c: e129f006 msr CPSR_fc, r6
* now (signals not posted when SIG_IGN).
* + If we are now ignoring a signal that was previously pending,
* we clear the pending signal indicator.
*/
return 0;
6040: e3a00000 mov r0, #0
6044: e8bd8070 pop {r4, r5, r6, pc}
6048: e1a00005 mov r0, r5 <== NOT EXECUTED
}
604c: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
rtems_set_errno_and_return_minus_one( EINVAL );
6050: eb00234b bl ed84 <__errno>
6054: e3a03016 mov r3, #22
6058: e5803000 str r3, [r0]
605c: e3e00000 mvn r0, #0
6060: e8bd8070 pop {r4, r5, r6, pc}
0000851c <sigwait>:
int sigwait(
const sigset_t *set,
int *sig
)
{
851c: e92d4010 push {r4, lr}
8520: e1a04001 mov r4, r1
int status;
status = sigtimedwait( set, NULL, NULL );
8524: e3a01000 mov r1, #0
8528: e1a02001 mov r2, r1
852c: ebffff8a bl 835c <sigtimedwait>
if ( status != -1 ) {
8530: e3700001 cmn r0, #1
8534: 0a000005 beq 8550 <sigwait+0x34>
if ( sig )
8538: e3540000 cmp r4, #0
*sig = status;
853c: 15840000 strne r0, [r4]
return 0;
8540: 13a00000 movne r0, #0
int status;
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
8544: 18bd8010 popne {r4, pc}
*sig = status;
return 0;
8548: e1a00004 mov r0, r4 <== NOT EXECUTED
}
return errno;
}
854c: e8bd8010 pop {r4, pc} <== NOT EXECUTED
if ( sig )
*sig = status;
return 0;
}
return errno;
8550: eb0022aa bl 11000 <__errno>
8554: e5900000 ldr r0, [r0]
8558: e8bd8010 pop {r4, pc}
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: eb003323 bl 12ab4 <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: eb00331d bl 12ab4 <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: eb002f21 bl 11ba0 <__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: eb0027cf bl fee8 <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: eb0004ea bl 7428 <_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: eb002213 bl e8f8 <__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: eb00220e bl e8f8 <__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: eb0003f8 bl 70d0 <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: eb0029d4 bl 10730 <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: eb002a0e bl 1087c <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: eb003100 bl 11150 <__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: eb0030ed bl 11150 <__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>
00012e68 <write>:
)
{
ssize_t rc;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
12e68: e59f30a4 ldr r3, [pc, #164] ; 12f14 <write+0xac>
12e6c: e5933000 ldr r3, [r3]
12e70: e1500003 cmp r0, r3
ssize_t write(
int fd,
const void *buffer,
size_t count
)
{
12e74: e92d4010 push {r4, lr}
ssize_t rc;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
12e78: 2a00001b bcs 12eec <write+0x84>
iop = rtems_libio_iop( fd );
12e7c: e59f4094 ldr r4, [pc, #148] ; 12f18 <write+0xb0>
12e80: e5944000 ldr r4, [r4]
12e84: e0600180 rsb r0, r0, r0, lsl #3
12e88: e0844180 add r4, r4, r0, lsl #3
rtems_libio_check_is_open( iop );
12e8c: e5940014 ldr r0, [r4, #20]
12e90: e3100c01 tst r0, #256 ; 0x100
12e94: 0a000014 beq 12eec <write+0x84>
rtems_libio_check_buffer( buffer );
12e98: e3510000 cmp r1, #0
12e9c: 0a000017 beq 12f00 <write+0x98>
rtems_libio_check_count( count );
12ea0: e3520000 cmp r2, #0
12ea4: 0a00000e beq 12ee4 <write+0x7c>
rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
12ea8: e3100004 tst r0, #4
12eac: 0a000013 beq 12f00 <write+0x98>
return 0;
/*
* Now process the write() request.
*/
rc = (*iop->pathinfo.handlers->write_h)( iop, buffer, count );
12eb0: e5943020 ldr r3, [r4, #32]
12eb4: e1a00004 mov r0, r4
12eb8: e1a0e00f mov lr, pc
12ebc: e593f00c ldr pc, [r3, #12]
if ( rc > 0 )
12ec0: e3500000 cmp r0, #0
12ec4: d8bd8010 pople {r4, pc}
iop->offset += rc;
12ec8: e284300c add r3, r4, #12
12ecc: e893000c ldm r3, {r2, r3}
12ed0: e0922000 adds r2, r2, r0
12ed4: e0a33fc0 adc r3, r3, r0, asr #31
12ed8: e584200c str r2, [r4, #12]
12edc: e5843010 str r3, [r4, #16]
12ee0: 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 );
12ee4: e1a00002 mov r0, r2
if ( rc > 0 )
iop->offset += rc;
return rc;
}
12ee8: 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 );
12eec: ebffeae8 bl da94 <__errno>
12ef0: e3a03009 mov r3, #9
12ef4: e5803000 str r3, [r0]
12ef8: e3e00000 mvn r0, #0
12efc: e8bd8010 pop {r4, pc}
rtems_libio_check_buffer( buffer );
rtems_libio_check_count( count );
rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
12f00: ebffeae3 bl da94 <__errno> <== NOT EXECUTED
12f04: e3a03016 mov r3, #22 <== NOT EXECUTED
12f08: e5803000 str r3, [r0] <== NOT EXECUTED
12f0c: e3e00000 mvn r0, #0 <== NOT EXECUTED
12f10: 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: eb002175 bl eb40 <__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: eb00216f bl eb40 <__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