=============================================================================== 0800b530 : #define MAXSYMLINK 5 int IMFS_Set_handlers( rtems_filesystem_location_info_t *loc ) { 800b530: 37 9c ff f0 addi sp,sp,-16 800b534: 5b 8b 00 10 sw (sp+16),r11 800b538: 5b 8c 00 0c sw (sp+12),r12 800b53c: 5b 8d 00 08 sw (sp+8),r13 800b540: 5b 9d 00 04 sw (sp+4),ra 800b544: b8 20 58 00 mv r11,r1 IMFS_jnode_t *node = loc->node_access; IMFS_fs_info_t *fs_info; fs_info = loc->mt_entry->fs_info; 800b548: 28 21 00 10 lw r1,(r1+16) switch( node->type ) { 800b54c: 34 02 00 06 mvi r2,6 ) { IMFS_jnode_t *node = loc->node_access; IMFS_fs_info_t *fs_info; fs_info = loc->mt_entry->fs_info; 800b550: 28 2c 00 34 lw r12,(r1+52) switch( node->type ) { 800b554: 29 61 00 00 lw r1,(r11+0) 800b558: 28 21 00 4c lw r1,(r1+76) 800b55c: 34 21 ff ff addi r1,r1,-1 800b560: 54 22 00 14 bgu r1,r2,800b5b0 <== NEVER TAKEN 800b564: 78 0d 08 01 mvhi r13,0x801 800b568: 34 02 00 02 mvi r2,2 800b56c: f8 00 2e 59 calli 8016ed0 <__ashlsi3> 800b570: 39 ad 83 18 ori r13,r13,0x8318 800b574: b5 a1 08 00 add r1,r13,r1 800b578: 28 21 00 00 lw r1,(r1+0) 800b57c: c0 20 00 00 b r1 case IMFS_DIRECTORY: loc->handlers = fs_info->directory_handlers; 800b580: 29 81 00 0c lw r1,(r12+12) 800b584: e0 00 00 0a bi 800b5ac break; case IMFS_DEVICE: loc->handlers = &IMFS_device_handlers; 800b588: 78 01 08 01 mvhi r1,0x801 800b58c: 38 21 83 44 ori r1,r1,0x8344 800b590: e0 00 00 07 bi 800b5ac break; case IMFS_SYM_LINK: case IMFS_HARD_LINK: loc->handlers = &IMFS_link_handlers; 800b594: 78 01 08 01 mvhi r1,0x801 800b598: 38 21 83 b4 ori r1,r1,0x83b4 800b59c: e0 00 00 04 bi 800b5ac break; case IMFS_LINEAR_FILE: loc->handlers = fs_info->memfile_handlers; break; case IMFS_MEMORY_FILE: loc->handlers = fs_info->memfile_handlers; 800b5a0: 29 81 00 08 lw r1,(r12+8) 800b5a4: e0 00 00 02 bi 800b5ac break; case IMFS_FIFO: loc->handlers = fs_info->fifo_handlers; 800b5a8: 29 81 00 10 lw r1,(r12+16) 800b5ac: 59 61 00 08 sw (r11+8),r1 break; } return 0; } 800b5b0: 34 01 00 00 mvi r1,0 800b5b4: 2b 9d 00 04 lw ra,(sp+4) 800b5b8: 2b 8b 00 10 lw r11,(sp+16) 800b5bc: 2b 8c 00 0c lw r12,(sp+12) 800b5c0: 2b 8d 00 08 lw r13,(sp+8) 800b5c4: 37 9c 00 10 addi sp,sp,16 800b5c8: c3 a0 00 00 ret =============================================================================== 0800b280 : int IMFS_chown( rtems_filesystem_location_info_t *pathloc, /* IN */ uid_t owner, /* IN */ gid_t group /* IN */ ) { 800b280: 37 9c ff e8 addi sp,sp,-24 800b284: 5b 8b 00 10 sw (sp+16),r11 800b288: 5b 8c 00 0c sw (sp+12),r12 800b28c: 5b 8d 00 08 sw (sp+8),r13 800b290: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *jnode; #if defined(RTEMS_POSIX_API) uid_t st_uid; #endif jnode = (IMFS_jnode_t *) pathloc->node_access; 800b294: 28 2b 00 00 lw r11,(r1+0) int IMFS_chown( rtems_filesystem_location_info_t *pathloc, /* IN */ uid_t owner, /* IN */ gid_t group /* IN */ ) { 800b298: 20 4d ff ff andi r13,r2,0xffff 800b29c: 20 6c ff ff andi r12,r3,0xffff /* * Verify I am the owner of the node or the super user. */ #if defined(RTEMS_POSIX_API) st_uid = geteuid(); 800b2a0: f8 00 04 82 calli 800c4a8 if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) 800b2a4: 2d 63 00 3c lhu r3,(r11+60) 800b2a8: 7c 22 00 00 cmpnei r2,r1,0 800b2ac: fc 61 08 00 cmpne r1,r3,r1 800b2b0: a0 41 08 00 and r1,r2,r1 800b2b4: 44 20 00 06 be r1,r0,800b2cc <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EPERM ); 800b2b8: f8 00 18 85 calli 80114cc <__errno> <== NOT EXECUTED 800b2bc: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 800b2c0: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 800b2c4: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800b2c8: e0 00 00 09 bi 800b2ec <== NOT EXECUTED #endif jnode->st_uid = owner; 800b2cc: 0d 6d 00 3c sh (r11+60),r13 jnode->st_gid = group; 800b2d0: 0d 6c 00 3e sh (r11+62),r12 IMFS_update_ctime( jnode ); 800b2d4: 37 81 00 14 addi r1,sp,20 800b2d8: 34 02 00 00 mvi r2,0 800b2dc: fb ff dd 4a calli 8002804 800b2e0: 2b 81 00 14 lw r1,(sp+20) 800b2e4: 59 61 00 48 sw (r11+72),r1 return 0; 800b2e8: 34 01 00 00 mvi r1,0 } 800b2ec: 2b 9d 00 04 lw ra,(sp+4) 800b2f0: 2b 8b 00 10 lw r11,(sp+16) 800b2f4: 2b 8c 00 0c lw r12,(sp+12) 800b2f8: 2b 8d 00 08 lw r13,(sp+8) 800b2fc: 37 9c 00 18 addi sp,sp,24 800b300: c3 a0 00 00 ret =============================================================================== 0800b3a8 : IMFS_jnode_types_t type, const char *name, mode_t mode, const IMFS_types_union *info ) { 800b3a8: 37 9c ff e8 addi sp,sp,-24 800b3ac: 5b 8b 00 18 sw (sp+24),r11 800b3b0: 5b 8c 00 14 sw (sp+20),r12 800b3b4: 5b 8d 00 10 sw (sp+16),r13 800b3b8: 5b 8e 00 0c sw (sp+12),r14 800b3bc: 5b 8f 00 08 sw (sp+8),r15 800b3c0: 5b 9d 00 04 sw (sp+4),ra /* * MUST have a parent node to call this routine. */ if ( parent_loc == NULL ) return NULL; 800b3c4: 34 0b 00 00 mvi r11,0 IMFS_jnode_types_t type, const char *name, mode_t mode, const IMFS_types_union *info ) { 800b3c8: b8 40 70 00 mv r14,r2 800b3cc: b8 a0 60 00 mv r12,r5 800b3d0: b8 60 10 00 mv r2,r3 IMFS_fs_info_t *fs_info; /* * MUST have a parent node to call this routine. */ if ( parent_loc == NULL ) 800b3d4: 44 20 00 3e be r1,r0,800b4cc <== NEVER TAKEN return NULL; parent = parent_loc->node_access; 800b3d8: 28 2f 00 00 lw r15,(r1+0) fs_info = parent_loc->mt_entry->fs_info; 800b3dc: 28 21 00 10 lw r1,(r1+16) 800b3e0: 28 2d 00 34 lw r13,(r1+52) /* * Reject creation of FIFOs if support is disabled. */ if ( type == IMFS_FIFO && 800b3e4: 34 01 00 07 mvi r1,7 800b3e8: 5d c1 00 05 bne r14,r1,800b3fc 800b3ec: 29 a1 00 10 lw r1,(r13+16) 800b3f0: 78 05 08 01 mvhi r5,0x801 800b3f4: 38 a5 82 94 ori r5,r5,0x8294 800b3f8: 44 25 00 35 be r1,r5,800b4cc return NULL; /* * Allocate filesystem node and fill in basic information */ node = IMFS_allocate_node( type, name, mode & ~rtems_filesystem_umask ); 800b3fc: 78 05 08 01 mvhi r5,0x801 800b400: 38 a5 91 04 ori r5,r5,0x9104 800b404: 28 a1 00 00 lw r1,(r5+0) 800b408: 28 23 00 2c lw r3,(r1+44) 800b40c: b9 c0 08 00 mv r1,r14 800b410: a4 60 18 00 not r3,r3 800b414: a0 83 18 00 and r3,r4,r3 800b418: fb ff ff bb calli 800b304 800b41c: b8 20 58 00 mv r11,r1 if ( !node ) 800b420: 44 20 00 2b be r1,r0,800b4cc return NULL; /* * Set the type specific information */ switch (type) { 800b424: 35 c1 ff ff addi r1,r14,-1 800b428: 34 02 00 06 mvi r2,6 800b42c: 54 22 00 20 bgu r1,r2,800b4ac <== NEVER TAKEN 800b430: 78 0e 08 01 mvhi r14,0x801 800b434: 34 02 00 02 mvi r2,2 800b438: f8 00 2e a6 calli 8016ed0 <__ashlsi3> 800b43c: 39 ce 82 fc ori r14,r14,0x82fc 800b440: b5 c1 08 00 add r1,r14,r1 800b444: 28 21 00 00 lw r1,(r1+0) 800b448: c0 20 00 00 b r1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 800b44c: 35 61 00 54 addi r1,r11,84 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 800b450: 59 61 00 50 sw (r11+80),r1 case IMFS_DIRECTORY: rtems_chain_initialize_empty(&node->info.directory.Entries); 800b454: 35 61 00 50 addi r1,r11,80 the_chain->permanent_null = NULL; 800b458: 59 60 00 54 sw (r11+84),r0 the_chain->last = _Chain_Head(the_chain); 800b45c: 59 61 00 58 sw (r11+88),r1 800b460: e0 00 00 13 bi 800b4ac 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; 800b464: 29 81 00 00 lw r1,(r12+0) 800b468: 59 61 00 50 sw (r11+80),r1 break; 800b46c: e0 00 00 10 bi 800b4ac case IMFS_DEVICE: node->info.device.major = info->device.major; 800b470: 29 81 00 00 lw r1,(r12+0) 800b474: 59 61 00 50 sw (r11+80),r1 node->info.device.minor = info->device.minor; 800b478: 29 81 00 04 lw r1,(r12+4) 800b47c: 59 61 00 54 sw (r11+84),r1 break; 800b480: e0 00 00 0b bi 800b4ac case IMFS_LINEAR_FILE: node->info.linearfile.size = 0; 800b484: 59 60 00 50 sw (r11+80),r0 800b488: 59 60 00 54 sw (r11+84),r0 node->info.linearfile.direct = 0; 800b48c: 59 60 00 58 sw (r11+88),r0 case IMFS_MEMORY_FILE: node->info.file.size = 0; 800b490: 59 60 00 50 sw (r11+80),r0 800b494: 59 60 00 54 sw (r11+84),r0 node->info.file.indirect = 0; 800b498: 59 60 00 58 sw (r11+88),r0 node->info.file.doubly_indirect = 0; 800b49c: 59 60 00 5c sw (r11+92),r0 node->info.file.triply_indirect = 0; 800b4a0: 59 60 00 60 sw (r11+96),r0 break; 800b4a4: e0 00 00 02 bi 800b4ac case IMFS_FIFO: node->info.fifo.pipe = NULL; 800b4a8: 59 60 00 50 sw (r11+80),r0 /* * This node MUST have a parent, so put it in that directory list. */ node->Parent = parent; node->st_ino = ++fs_info->ino_count; 800b4ac: 29 a1 00 04 lw r1,(r13+4) /* * This node MUST have a parent, so put it in that directory list. */ node->Parent = parent; 800b4b0: 59 6f 00 08 sw (r11+8),r15 800b4b4: b9 60 10 00 mv r2,r11 node->st_ino = ++fs_info->ino_count; 800b4b8: 34 21 00 01 addi r1,r1,1 800b4bc: 59 a1 00 04 sw (r13+4),r1 800b4c0: 59 61 00 38 sw (r11+56),r1 800b4c4: 35 e1 00 50 addi r1,r15,80 800b4c8: fb ff e5 b5 calli 8004b9c <_Chain_Append> rtems_chain_append( &parent->info.directory.Entries, &node->Node ); return node; } 800b4cc: b9 60 08 00 mv r1,r11 800b4d0: 2b 9d 00 04 lw ra,(sp+4) 800b4d4: 2b 8b 00 18 lw r11,(sp+24) 800b4d8: 2b 8c 00 14 lw r12,(sp+20) 800b4dc: 2b 8d 00 10 lw r13,(sp+16) 800b4e0: 2b 8e 00 0c lw r14,(sp+12) 800b4e4: 2b 8f 00 08 lw r15,(sp+8) 800b4e8: 37 9c 00 18 addi sp,sp,24 800b4ec: c3 a0 00 00 ret =============================================================================== 0800b4f0 : return node; } IMFS_jnode_t *IMFS_create_root_node(void) { 800b4f0: 37 9c ff fc addi sp,sp,-4 800b4f4: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *node; /* * Allocate filesystem node and fill in basic information */ node = IMFS_allocate_node( IMFS_DIRECTORY, "", (S_IFDIR | 0755) ); 800b4f8: 78 02 08 01 mvhi r2,0x801 800b4fc: 34 01 00 01 mvi r1,1 800b500: 38 42 7e 50 ori r2,r2,0x7e50 800b504: 34 03 41 ed mvi r3,16877 800b508: fb ff ff 7f calli 800b304 if ( !node ) 800b50c: 44 20 00 06 be r1,r0,800b524 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 800b510: 34 22 00 54 addi r2,r1,84 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 800b514: 58 22 00 50 sw (r1+80),r2 /* * Set the type specific information * * NOTE: Root node is always a directory. */ rtems_chain_initialize_empty(&node->info.directory.Entries); 800b518: 34 22 00 50 addi r2,r1,80 the_chain->permanent_null = NULL; 800b51c: 58 20 00 54 sw (r1+84),r0 the_chain->last = _Chain_Head(the_chain); 800b520: 58 22 00 58 sw (r1+88),r2 return node; } 800b524: 2b 9d 00 04 lw ra,(sp+4) 800b528: 37 9c 00 04 addi sp,sp,4 800b52c: c3 a0 00 00 ret =============================================================================== 0800b6b4 : const char *pathname, /* IN */ size_t pathnamelen, /* IN */ int flags, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { 800b6b4: 37 9c ff 84 addi sp,sp,-124 800b6b8: 5b 8b 00 40 sw (sp+64),r11 800b6bc: 5b 8c 00 3c sw (sp+60),r12 800b6c0: 5b 8d 00 38 sw (sp+56),r13 800b6c4: 5b 8e 00 34 sw (sp+52),r14 800b6c8: 5b 8f 00 30 sw (sp+48),r15 800b6cc: 5b 90 00 2c sw (sp+44),r16 800b6d0: 5b 91 00 28 sw (sp+40),r17 800b6d4: 5b 92 00 24 sw (sp+36),r18 800b6d8: 5b 93 00 20 sw (sp+32),r19 800b6dc: 5b 94 00 1c sw (sp+28),r20 800b6e0: 5b 95 00 18 sw (sp+24),r21 800b6e4: 5b 96 00 14 sw (sp+20),r22 800b6e8: 5b 97 00 10 sw (sp+16),r23 800b6ec: 5b 98 00 0c sw (sp+12),r24 800b6f0: 5b 99 00 08 sw (sp+8),r25 800b6f4: 5b 9d 00 04 sw (sp+4),ra case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 800b6f8: 78 13 08 01 mvhi r19,0x801 const char *pathname, /* IN */ size_t pathnamelen, /* IN */ int flags, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { 800b6fc: b8 20 90 00 mv r18,r1 800b700: b8 40 78 00 mv r15,r2 800b704: b8 60 88 00 mv r17,r3 800b708: b8 80 58 00 mv r11,r4 /* * This was filled in by the caller and is valid in the * mount table. */ node = pathloc->node_access; 800b70c: 28 8c 00 00 lw r12,(r4+0) rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { int i = 0; int len; IMFS_token_types type = IMFS_CURRENT_DIR; 800b710: 34 0e 00 01 mvi r14,1 size_t pathnamelen, /* IN */ int flags, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { int i = 0; 800b714: 34 10 00 00 mvi r16,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 ); 800b718: 37 96 00 44 addi r22,sp,68 /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) if ( node->type == IMFS_DIRECTORY ) 800b71c: 34 15 00 01 mvi r21,1 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; switch( type ) { 800b720: 34 19 00 03 mvi r25,3 node = pathloc->node_access; if ( !node ) rtems_set_errno_and_return_minus_one( ENOTDIR ); } else if ( node->type == IMFS_SYM_LINK ) { 800b724: 34 14 00 04 mvi r20,4 result = IMFS_evaluate_sym_link( pathloc, 0 ); node = pathloc->node_access; if ( result == -1 ) 800b728: 34 18 ff ff mvi r24,-1 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; switch( type ) { 800b72c: 34 17 00 02 mvi r23,2 case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 800b730: 3a 73 91 04 ori r19,r19,0x9104 /* * Evaluate all tokens until we are done or an error occurs. */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { 800b734: e0 00 00 5b bi 800b8a0 type = IMFS_get_token( &pathname[i], pathnamelen, token, &len ); 800b738: b6 50 08 00 add r1,r18,r16 800b73c: b9 e0 10 00 mv r2,r15 800b740: ba c0 18 00 mv r3,r22 800b744: 37 84 00 7c addi r4,sp,124 800b748: f8 00 02 1c calli 800bfb8 800b74c: b8 20 70 00 mv r14,r1 pathnamelen -= len; i += len; if ( !pathloc->node_access ) 800b750: 29 61 00 00 lw r1,(r11+0) */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { type = IMFS_get_token( &pathname[i], pathnamelen, token, &len ); pathnamelen -= len; 800b754: 2b 8d 00 7c lw r13,(sp+124) i += len; if ( !pathloc->node_access ) 800b758: 44 20 00 4a be r1,r0,800b880 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( ENOENT ); /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) 800b75c: 45 c0 00 07 be r14,r0,800b778 if ( node->type == IMFS_DIRECTORY ) 800b760: 29 81 00 4c lw r1,(r12+76) 800b764: 5c 35 00 05 bne r1,r21,800b778 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 800b768: b9 60 08 00 mv r1,r11 800b76c: 34 02 00 01 mvi r2,1 800b770: fb ff ff 97 calli 800b5cc 800b774: 44 20 00 74 be r1,r0,800b944 */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { type = IMFS_get_token( &pathname[i], pathnamelen, token, &len ); pathnamelen -= len; 800b778: c9 ed 78 00 sub r15,r15,r13 i += len; 800b77c: b6 0d 80 00 add r16,r16,r13 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; 800b780: 29 6c 00 00 lw r12,(r11+0) switch( type ) { 800b784: 45 d9 00 14 be r14,r25,800b7d4 800b788: 45 d4 00 43 be r14,r20,800b894 800b78c: 5d d7 00 45 bne r14,r23,800b8a0 case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 800b790: 2a 61 00 00 lw r1,(r19+0) 800b794: 28 21 00 18 lw r1,(r1+24) 800b798: 45 81 00 42 be r12,r1,800b8a0 /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access) { 800b79c: 29 64 00 10 lw r4,(r11+16) /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == 800b7a0: 28 81 00 1c lw r1,(r4+28) 800b7a4: 5d 81 00 07 bne r12,r1,800b7c0 */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; /* Throw out the .. in this case */ } else { newloc = pathloc->mt_entry->mt_point_node; 800b7a8: 28 85 00 08 lw r5,(r4+8) 800b7ac: 28 82 00 0c lw r2,(r4+12) 800b7b0: 28 81 00 10 lw r1,(r4+16) 800b7b4: 28 83 00 14 lw r3,(r4+20) 800b7b8: 28 84 00 18 lw r4,(r4+24) 800b7bc: e0 00 00 47 bi 800b8d8 pathnamelen+len, flags,pathloc); } } else { if ( !node->Parent ) 800b7c0: 29 8c 00 08 lw r12,(r12+8) 800b7c4: 5d 80 00 32 bne r12,r0,800b88c rtems_set_errno_and_return_minus_one( ENOENT ); 800b7c8: f8 00 17 41 calli 80114cc <__errno> 800b7cc: 58 2e 00 00 sw (r1+0),r14 800b7d0: e0 00 00 60 bi 800b950 case IMFS_NAME: /* * If we are at a link follow it. */ if ( node->type == IMFS_HARD_LINK ) { 800b7d4: 29 81 00 4c lw r1,(r12+76) 800b7d8: 5c 2e 00 07 bne r1,r14,800b7f4 IMFS_evaluate_hard_link( pathloc, 0 ); 800b7dc: b9 60 08 00 mv r1,r11 800b7e0: 34 02 00 00 mvi r2,0 800b7e4: fb ff ff 98 calli 800b644 node = pathloc->node_access; 800b7e8: 29 6c 00 00 lw r12,(r11+0) if ( !node ) 800b7ec: 5d 80 00 09 bne r12,r0,800b810 <== ALWAYS TAKEN 800b7f0: e0 00 00 0a bi 800b818 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOTDIR ); } else if ( node->type == IMFS_SYM_LINK ) { 800b7f4: 5c 34 00 07 bne r1,r20,800b810 result = IMFS_evaluate_sym_link( pathloc, 0 ); 800b7f8: b9 60 08 00 mv r1,r11 800b7fc: 34 02 00 00 mvi r2,0 800b800: f8 00 00 68 calli 800b9a0 800b804: b8 20 68 00 mv r13,r1 node = pathloc->node_access; 800b808: 29 6c 00 00 lw r12,(r11+0) if ( result == -1 ) 800b80c: 44 38 00 52 be r1,r24,800b954 <== NEVER TAKEN /* * Only a directory can be decended into. */ if ( node->type != IMFS_DIRECTORY ) 800b810: 29 81 00 4c lw r1,(r12+76) 800b814: 44 35 00 04 be r1,r21,800b824 rtems_set_errno_and_return_minus_one( ENOTDIR ); 800b818: f8 00 17 2d calli 80114cc <__errno> 800b81c: 34 02 00 14 mvi r2,20 800b820: e0 00 00 4b bi 800b94c /* * 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 ) { 800b824: 29 8d 00 5c lw r13,(r12+92) 800b828: 45 a0 00 11 be r13,r0,800b86c newloc = node->info.directory.mt_fs->mt_fs_root; 800b82c: 29 a4 00 1c lw r4,(r13+28) 800b830: 29 a2 00 20 lw r2,(r13+32) 800b834: 29 a1 00 24 lw r1,(r13+36) 800b838: 29 a3 00 28 lw r3,(r13+40) 800b83c: 29 a5 00 2c lw r5,(r13+44) 800b840: 5b 84 00 68 sw (sp+104),r4 800b844: 5b 82 00 6c sw (sp+108),r2 800b848: 5b 81 00 70 sw (sp+112),r1 800b84c: 5b 83 00 74 sw (sp+116),r3 800b850: 5b 85 00 78 sw (sp+120),r5 *pathloc = newloc; 800b854: 59 64 00 00 sw (r11+0),r4 800b858: 59 62 00 04 sw (r11+4),r2 800b85c: 59 61 00 08 sw (r11+8),r1 800b860: 59 63 00 0c sw (r11+12),r3 800b864: 59 65 00 10 sw (r11+16),r5 800b868: e0 00 00 26 bi 800b900 /* * Otherwise find the token name in the present location. */ node = IMFS_find_match_in_dir( node, token ); 800b86c: b9 80 08 00 mv r1,r12 800b870: ba c0 10 00 mv r2,r22 800b874: f8 00 01 a9 calli 800bf18 800b878: b8 20 60 00 mv r12,r1 if ( !node ) 800b87c: 5c 2d 00 04 bne r1,r13,800b88c rtems_set_errno_and_return_minus_one( ENOENT ); 800b880: f8 00 17 13 calli 80114cc <__errno> 800b884: 34 02 00 02 mvi r2,2 800b888: e0 00 00 31 bi 800b94c /* * Set the node access to the point we have found. */ pathloc->node_access = node; 800b88c: 59 6c 00 00 sw (r11+0),r12 800b890: e0 00 00 04 bi 800b8a0 case IMFS_NO_MORE_PATH: case IMFS_CURRENT_DIR: break; case IMFS_INVALID_TOKEN: rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); 800b894: f8 00 17 0e calli 80114cc <__errno> 800b898: 34 02 00 5b mvi r2,91 800b89c: e0 00 00 2c bi 800b94c /* * Evaluate all tokens until we are done or an error occurs. */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { 800b8a0: 7d c1 00 04 cmpnei r1,r14,4 800b8a4: 7d ce 00 00 cmpnei r14,r14,0 800b8a8: a0 2e 70 00 and r14,r1,r14 800b8ac: 5d c0 ff a3 bne r14,r0,800b738 * 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 ) { 800b8b0: 29 82 00 4c lw r2,(r12+76) 800b8b4: 34 01 00 01 mvi r1,1 800b8b8: 5c 41 00 1c bne r2,r1,800b928 if ( node->info.directory.mt_fs != NULL ) { 800b8bc: 29 84 00 5c lw r4,(r12+92) 800b8c0: 44 80 00 1a be r4,r0,800b928 newloc = node->info.directory.mt_fs->mt_fs_root; 800b8c4: 28 85 00 1c lw r5,(r4+28) 800b8c8: 28 82 00 20 lw r2,(r4+32) 800b8cc: 28 81 00 24 lw r1,(r4+36) 800b8d0: 28 83 00 28 lw r3,(r4+40) 800b8d4: 28 84 00 2c lw r4,(r4+44) 800b8d8: 5b 85 00 68 sw (sp+104),r5 800b8dc: 5b 82 00 6c sw (sp+108),r2 800b8e0: 5b 81 00 70 sw (sp+112),r1 800b8e4: 5b 83 00 74 sw (sp+116),r3 800b8e8: 5b 84 00 78 sw (sp+120),r4 *pathloc = newloc; 800b8ec: 59 65 00 00 sw (r11+0),r5 800b8f0: 59 62 00 04 sw (r11+4),r2 800b8f4: 59 61 00 08 sw (r11+8),r1 800b8f8: 59 63 00 0c sw (r11+12),r3 800b8fc: 59 64 00 10 sw (r11+16),r4 return (*pathloc->ops->evalpath_h)( &pathname[i-len], 800b900: 2b 82 00 7c lw r2,(sp+124) 800b904: 28 65 00 00 lw r5,(r3+0) 800b908: b9 60 20 00 mv r4,r11 800b90c: ca 02 08 00 sub r1,r16,r2 800b910: b6 41 08 00 add r1,r18,r1 800b914: b5 e2 10 00 add r2,r15,r2 800b918: ba 20 18 00 mv r3,r17 800b91c: d8 a0 00 00 call r5 800b920: b8 20 68 00 mv r13,r1 800b924: e0 00 00 0c bi 800b954 flags, pathloc ); } else { result = IMFS_Set_handlers( pathloc ); } } else { result = IMFS_Set_handlers( pathloc ); 800b928: b9 60 08 00 mv r1,r11 800b92c: fb ff ff 01 calli 800b530 800b930: b8 20 68 00 mv r13,r1 /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( pathloc, flags ) ) 800b934: ba 20 10 00 mv r2,r17 800b938: b9 60 08 00 mv r1,r11 800b93c: fb ff ff 24 calli 800b5cc 800b940: 5c 20 00 05 bne r1,r0,800b954 rtems_set_errno_and_return_minus_one( EACCES ); 800b944: f8 00 16 e2 calli 80114cc <__errno> 800b948: 34 02 00 0d mvi r2,13 800b94c: 58 22 00 00 sw (r1+0),r2 800b950: 34 0d ff ff mvi r13,-1 return result; } 800b954: b9 a0 08 00 mv r1,r13 800b958: 2b 9d 00 04 lw ra,(sp+4) 800b95c: 2b 8b 00 40 lw r11,(sp+64) 800b960: 2b 8c 00 3c lw r12,(sp+60) 800b964: 2b 8d 00 38 lw r13,(sp+56) 800b968: 2b 8e 00 34 lw r14,(sp+52) 800b96c: 2b 8f 00 30 lw r15,(sp+48) 800b970: 2b 90 00 2c lw r16,(sp+44) 800b974: 2b 91 00 28 lw r17,(sp+40) 800b978: 2b 92 00 24 lw r18,(sp+36) 800b97c: 2b 93 00 20 lw r19,(sp+32) 800b980: 2b 94 00 1c lw r20,(sp+28) 800b984: 2b 95 00 18 lw r21,(sp+24) 800b988: 2b 96 00 14 lw r22,(sp+20) 800b98c: 2b 97 00 10 lw r23,(sp+16) 800b990: 2b 98 00 0c lw r24,(sp+12) 800b994: 2b 99 00 08 lw r25,(sp+8) 800b998: 37 9c 00 7c addi sp,sp,124 800b99c: c3 a0 00 00 ret =============================================================================== 0800bb5c : int IMFS_evaluate_for_make( const char *path, /* IN */ rtems_filesystem_location_info_t *pathloc, /* IN/OUT */ const char **name /* OUT */ ) { 800bb5c: 37 9c ff 84 addi sp,sp,-124 800bb60: 5b 8b 00 40 sw (sp+64),r11 800bb64: 5b 8c 00 3c sw (sp+60),r12 800bb68: 5b 8d 00 38 sw (sp+56),r13 800bb6c: 5b 8e 00 34 sw (sp+52),r14 800bb70: 5b 8f 00 30 sw (sp+48),r15 800bb74: 5b 90 00 2c sw (sp+44),r16 800bb78: 5b 91 00 28 sw (sp+40),r17 800bb7c: 5b 92 00 24 sw (sp+36),r18 800bb80: 5b 93 00 20 sw (sp+32),r19 800bb84: 5b 94 00 1c sw (sp+28),r20 800bb88: 5b 95 00 18 sw (sp+24),r21 800bb8c: 5b 96 00 14 sw (sp+20),r22 800bb90: 5b 97 00 10 sw (sp+16),r23 800bb94: 5b 98 00 0c sw (sp+12),r24 800bb98: 5b 99 00 08 sw (sp+8),r25 800bb9c: 5b 9d 00 04 sw (sp+4),ra case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 800bba0: 78 10 08 01 mvhi r16,0x801 int IMFS_evaluate_for_make( const char *path, /* IN */ rtems_filesystem_location_info_t *pathloc, /* IN/OUT */ const char **name /* OUT */ ) { 800bba4: b8 20 78 00 mv r15,r1 800bba8: b8 40 58 00 mv r11,r2 800bbac: b8 60 88 00 mv r17,r3 /* * This was filled in by the caller and is valid in the * mount table. */ node = pathloc->node_access; 800bbb0: 28 4c 00 00 lw r12,(r2+0) /* * Get the path length. */ pathlen = strlen( path ); 800bbb4: f8 00 1a b2 calli 801267c 800bbb8: b8 20 90 00 mv r18,r1 const char *path, /* IN */ rtems_filesystem_location_info_t *pathloc, /* IN/OUT */ const char **name /* OUT */ ) { int i = 0; 800bbbc: 34 0e 00 00 mvi r14,0 * Evaluate all tokens until we are done or an error occurs. */ while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); 800bbc0: 37 98 00 44 addi r24,sp,68 /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) if ( node->type == IMFS_DIRECTORY ) 800bbc4: 34 17 00 01 mvi r23,1 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; switch( type ) { 800bbc8: 34 16 00 02 mvi r22,2 case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 800bbcc: 3a 10 91 04 ori r16,r16,0x9104 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; switch( type ) { 800bbd0: 34 15 00 03 mvi r21,3 result = IMFS_evaluate_link( pathloc, 0 ); if ( result == -1 ) return -1; } else if ( node->type == IMFS_SYM_LINK ) { 800bbd4: 34 14 00 04 mvi r20,4 result = IMFS_evaluate_link( pathloc, 0 ); if ( result == -1 ) 800bbd8: 34 13 ff ff mvi r19,-1 * Evaluate all tokens until we are done or an error occurs. */ while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); 800bbdc: ba 40 10 00 mv r2,r18 800bbe0: b5 ee 08 00 add r1,r15,r14 800bbe4: bb 00 18 00 mv r3,r24 800bbe8: 37 84 00 7c addi r4,sp,124 800bbec: f8 00 00 f3 calli 800bfb8 800bbf0: b8 20 68 00 mv r13,r1 pathlen -= len; 800bbf4: 2b 99 00 7c lw r25,(sp+124) i += len; if ( !pathloc->node_access ) 800bbf8: 29 61 00 00 lw r1,(r11+0) */ while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); pathlen -= len; 800bbfc: ca 59 90 00 sub r18,r18,r25 i += len; if ( !pathloc->node_access ) 800bc00: 44 20 00 68 be r1,r0,800bda0 <== NEVER TAKEN /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) 800bc04: 45 a0 00 07 be r13,r0,800bc20 if ( node->type == IMFS_DIRECTORY ) 800bc08: 29 81 00 4c lw r1,(r12+76) 800bc0c: 5c 37 00 05 bne r1,r23,800bc20 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 800bc10: b9 60 08 00 mv r1,r11 800bc14: 34 02 00 01 mvi r2,1 800bc18: fb ff fe 6d calli 800b5cc 800bc1c: 44 20 00 74 be r1,r0,800bdec while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); pathlen -= len; i += len; 800bc20: b5 d9 70 00 add r14,r14,r25 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; 800bc24: 29 6c 00 00 lw r12,(r11+0) switch( type ) { 800bc28: 45 b6 00 07 be r13,r22,800bc44 800bc2c: 55 b6 00 03 bgu r13,r22,800bc38 800bc30: 5d a0 ff eb bne r13,r0,800bbdc 800bc34: e0 00 00 4c bi 800bd64 800bc38: 45 b5 00 1e be r13,r21,800bcb0 800bc3c: 5d b4 ff e8 bne r13,r20,800bbdc <== NEVER TAKEN 800bc40: e0 00 00 4c bi 800bd70 case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 800bc44: 2a 01 00 00 lw r1,(r16+0) 800bc48: 28 21 00 18 lw r1,(r1+24) 800bc4c: 45 81 ff e4 be r12,r1,800bbdc /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access){ 800bc50: 29 64 00 10 lw r4,(r11+16) 800bc54: 28 81 00 1c lw r1,(r4+28) 800bc58: 5d 81 00 11 bne r12,r1,800bc9c if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; } else { newloc = pathloc->mt_entry->mt_point_node; 800bc5c: 28 85 00 08 lw r5,(r4+8) 800bc60: 28 83 00 0c lw r3,(r4+12) 800bc64: 28 81 00 10 lw r1,(r4+16) 800bc68: 28 82 00 14 lw r2,(r4+20) 800bc6c: 28 84 00 18 lw r4,(r4+24) 800bc70: 5b 85 00 68 sw (sp+104),r5 800bc74: 5b 83 00 6c sw (sp+108),r3 800bc78: 5b 81 00 70 sw (sp+112),r1 800bc7c: 5b 82 00 74 sw (sp+116),r2 800bc80: 5b 84 00 78 sw (sp+120),r4 *pathloc = newloc; 800bc84: 59 65 00 00 sw (r11+0),r5 800bc88: 59 63 00 04 sw (r11+4),r3 800bc8c: 59 61 00 08 sw (r11+8),r1 800bc90: 59 62 00 0c sw (r11+12),r2 800bc94: 59 64 00 10 sw (r11+16),r4 800bc98: e0 00 00 23 bi 800bd24 return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); } } else { if ( !node->Parent ) 800bc9c: 29 8c 00 08 lw r12,(r12+8) 800bca0: 5d 80 00 2f bne r12,r0,800bd5c rtems_set_errno_and_return_minus_one( ENOENT ); 800bca4: f8 00 16 0a calli 80114cc <__errno> 800bca8: 58 2d 00 00 sw (r1+0),r13 800bcac: e0 00 00 53 bi 800bdf8 pathloc->node_access = node; break; case IMFS_NAME: if ( node->type == IMFS_HARD_LINK ) { 800bcb0: 29 81 00 4c lw r1,(r12+76) 800bcb4: 44 35 00 02 be r1,r21,800bcbc result = IMFS_evaluate_link( pathloc, 0 ); if ( result == -1 ) return -1; } else if ( node->type == IMFS_SYM_LINK ) { 800bcb8: 5c 34 00 06 bne r1,r20,800bcd0 result = IMFS_evaluate_link( pathloc, 0 ); 800bcbc: b9 60 08 00 mv r1,r11 800bcc0: 34 02 00 00 mvi r2,0 800bcc4: fb ff ff 69 calli 800ba68 800bcc8: b8 20 60 00 mv r12,r1 if ( result == -1 ) 800bccc: 44 33 00 4c be r1,r19,800bdfc <== NEVER TAKEN return -1; } node = pathloc->node_access; 800bcd0: 29 64 00 00 lw r4,(r11+0) if ( !node ) 800bcd4: 44 80 00 3f be r4,r0,800bdd0 <== NEVER TAKEN /* * Only a directory can be decended into. */ if ( node->type != IMFS_DIRECTORY ) 800bcd8: 28 81 00 4c lw r1,(r4+76) 800bcdc: 5c 37 00 3d bne r1,r23,800bdd0 /* * 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 ) { 800bce0: 28 8d 00 5c lw r13,(r4+92) 800bce4: 45 a0 00 19 be r13,r0,800bd48 newloc = node->info.directory.mt_fs->mt_fs_root; 800bce8: 29 a4 00 1c lw r4,(r13+28) 800bcec: 29 a3 00 20 lw r3,(r13+32) 800bcf0: 29 a1 00 24 lw r1,(r13+36) 800bcf4: 29 a2 00 28 lw r2,(r13+40) 800bcf8: 29 a5 00 2c lw r5,(r13+44) 800bcfc: 5b 84 00 68 sw (sp+104),r4 800bd00: 5b 83 00 6c sw (sp+108),r3 800bd04: 5b 81 00 70 sw (sp+112),r1 800bd08: 5b 82 00 74 sw (sp+116),r2 800bd0c: 5b 85 00 78 sw (sp+120),r5 *pathloc = newloc; 800bd10: 59 64 00 00 sw (r11+0),r4 800bd14: 59 63 00 04 sw (r11+4),r3 800bd18: 59 61 00 08 sw (r11+8),r1 800bd1c: 59 62 00 0c sw (r11+12),r2 800bd20: 59 65 00 10 sw (r11+16),r5 return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); 800bd24: 2b 81 00 7c lw r1,(sp+124) 800bd28: 28 44 00 04 lw r4,(r2+4) 800bd2c: ba 20 18 00 mv r3,r17 800bd30: c9 c1 70 00 sub r14,r14,r1 800bd34: b5 ee 08 00 add r1,r15,r14 800bd38: b9 60 10 00 mv r2,r11 800bd3c: d8 80 00 00 call r4 800bd40: b8 20 60 00 mv r12,r1 800bd44: e0 00 00 2e bi 800bdfc /* * Otherwise find the token name in the present location. */ node = IMFS_find_match_in_dir( node, token ); 800bd48: b8 80 08 00 mv r1,r4 800bd4c: bb 00 10 00 mv r2,r24 800bd50: f8 00 00 72 calli 800bf18 800bd54: b8 20 60 00 mv r12,r1 /* * If there is no node we have found the name of the node we * wish to create. */ if ( ! node ) 800bd58: 44 2d 00 09 be r1,r13,800bd7c done = true; else pathloc->node_access = node; 800bd5c: 59 6c 00 00 sw (r11+0),r12 800bd60: e3 ff ff 9f bi 800bbdc break; case IMFS_NO_MORE_PATH: rtems_set_errno_and_return_minus_one( EEXIST ); 800bd64: f8 00 15 da calli 80114cc <__errno> 800bd68: 34 02 00 11 mvi r2,17 800bd6c: e0 00 00 22 bi 800bdf4 break; case IMFS_INVALID_TOKEN: rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); 800bd70: f8 00 15 d7 calli 80114cc <__errno> 800bd74: 34 02 00 5b mvi r2,91 800bd78: e0 00 00 1f bi 800bdf4 case IMFS_CURRENT_DIR: break; } } *name = &path[ i - len ]; 800bd7c: 2b 81 00 7c lw r1,(sp+124) 800bd80: c9 c1 08 00 sub r1,r14,r1 800bd84: b5 e1 08 00 add r1,r15,r1 800bd88: 5a 21 00 00 sw (r17+0),r1 * pathloc is returned with a pointer to the parent of the new node. * name is returned with a pointer to the first character in the * new node name. The parent node is verified to be a directory. */ int IMFS_evaluate_for_make( 800bd8c: b5 ee 70 00 add r14,r15,r14 /* * 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++) { 800bd90: e0 00 00 07 bi 800bdac if ( !IMFS_is_separator( path[ i ] ) ) 800bd94: fb ff de d6 calli 80038ec 800bd98: 35 ce 00 01 addi r14,r14,1 800bd9c: 5c 20 00 04 bne r1,r0,800bdac rtems_set_errno_and_return_minus_one( ENOENT ); 800bda0: f8 00 15 cb calli 80114cc <__errno> 800bda4: 34 02 00 02 mvi r2,2 800bda8: e0 00 00 13 bi 800bdf4 /* * 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++) { 800bdac: 41 c1 00 00 lbu r1,(r14+0) 800bdb0: 5c 20 ff f9 bne r1,r0,800bd94 /* * Verify we can execute and write to this directory. */ result = IMFS_Set_handlers( pathloc ); 800bdb4: b9 60 08 00 mv r1,r11 800bdb8: fb ff fd de calli 800b530 800bdbc: b8 20 60 00 mv r12,r1 /* * The returned node must be a directory */ node = pathloc->node_access; if ( node->type != IMFS_DIRECTORY ) 800bdc0: 29 61 00 00 lw r1,(r11+0) 800bdc4: 28 22 00 4c lw r2,(r1+76) 800bdc8: 34 01 00 01 mvi r1,1 800bdcc: 44 41 00 04 be r2,r1,800bddc <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOTDIR ); 800bdd0: f8 00 15 bf calli 80114cc <__errno> 800bdd4: 34 02 00 14 mvi r2,20 800bdd8: e0 00 00 07 bi 800bdf4 /* * We must have Write and execute permission on the returned node. */ if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) ) 800bddc: b9 60 08 00 mv r1,r11 800bde0: 34 02 00 03 mvi r2,3 800bde4: fb ff fd fa calli 800b5cc 800bde8: 5c 20 00 05 bne r1,r0,800bdfc rtems_set_errno_and_return_minus_one( EACCES ); 800bdec: f8 00 15 b8 calli 80114cc <__errno> 800bdf0: 34 02 00 0d mvi r2,13 800bdf4: 58 22 00 00 sw (r1+0),r2 800bdf8: 34 0c ff ff mvi r12,-1 return result; } 800bdfc: b9 80 08 00 mv r1,r12 800be00: 2b 9d 00 04 lw ra,(sp+4) 800be04: 2b 8b 00 40 lw r11,(sp+64) 800be08: 2b 8c 00 3c lw r12,(sp+60) 800be0c: 2b 8d 00 38 lw r13,(sp+56) 800be10: 2b 8e 00 34 lw r14,(sp+52) 800be14: 2b 8f 00 30 lw r15,(sp+48) 800be18: 2b 90 00 2c lw r16,(sp+44) 800be1c: 2b 91 00 28 lw r17,(sp+40) 800be20: 2b 92 00 24 lw r18,(sp+36) 800be24: 2b 93 00 20 lw r19,(sp+32) 800be28: 2b 94 00 1c lw r20,(sp+28) 800be2c: 2b 95 00 18 lw r21,(sp+24) 800be30: 2b 96 00 14 lw r22,(sp+20) 800be34: 2b 97 00 10 lw r23,(sp+16) 800be38: 2b 98 00 0c lw r24,(sp+12) 800be3c: 2b 99 00 08 lw r25,(sp+8) 800be40: 37 9c 00 7c addi sp,sp,124 800be44: c3 a0 00 00 ret =============================================================================== 0800b644 : int IMFS_evaluate_hard_link( rtems_filesystem_location_info_t *node, /* IN/OUT */ int flags /* IN */ ) { 800b644: 37 9c ff f4 addi sp,sp,-12 800b648: 5b 8b 00 08 sw (sp+8),r11 800b64c: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *jnode = node->node_access; 800b650: 28 23 00 00 lw r3,(r1+0) /* * Check for things that should never happen. */ if ( jnode->type != IMFS_HARD_LINK ) 800b654: 34 04 00 03 mvi r4,3 int IMFS_evaluate_hard_link( rtems_filesystem_location_info_t *node, /* IN/OUT */ int flags /* IN */ ) { 800b658: b8 20 58 00 mv r11,r1 /* * Check for things that should never happen. */ if ( jnode->type != IMFS_HARD_LINK ) 800b65c: 28 65 00 4c lw r5,(r3+76) 800b660: 44 a4 00 03 be r5,r4,800b66c <== ALWAYS TAKEN rtems_fatal_error_occurred (0xABCD0000); 800b664: 78 01 ab cd mvhi r1,0xabcd <== NOT EXECUTED 800b668: fb ff e3 bd calli 800455c <== NOT EXECUTED /* * Set the hard link value and the handlers. */ node->node_access = jnode->info.hard_link.link_node; 800b66c: 28 63 00 50 lw r3,(r3+80) 800b670: 58 23 00 00 sw (r1+0),r3 IMFS_Set_handlers( node ); 800b674: 5b 82 00 0c sw (sp+12),r2 800b678: fb ff ff ae calli 800b530 /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( node, flags ) ) 800b67c: 2b 82 00 0c lw r2,(sp+12) 800b680: b9 60 08 00 mv r1,r11 800b684: fb ff ff d2 calli 800b5cc rtems_set_errno_and_return_minus_one( EACCES ); return result; 800b688: 34 02 00 00 mvi r2,0 /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( node, flags ) ) 800b68c: 5c 20 00 05 bne r1,r0,800b6a0 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EACCES ); 800b690: f8 00 17 8f calli 80114cc <__errno> <== NOT EXECUTED 800b694: 34 02 00 0d mvi r2,13 <== NOT EXECUTED 800b698: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 800b69c: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED return result; } 800b6a0: b8 40 08 00 mv r1,r2 800b6a4: 2b 9d 00 04 lw ra,(sp+4) 800b6a8: 2b 8b 00 08 lw r11,(sp+8) 800b6ac: 37 9c 00 0c addi sp,sp,12 800b6b0: c3 a0 00 00 ret =============================================================================== 0800b5cc : int IMFS_evaluate_permission( rtems_filesystem_location_info_t *node, int flags ) { 800b5cc: 37 9c ff f0 addi sp,sp,-16 800b5d0: 5b 8b 00 10 sw (sp+16),r11 800b5d4: 5b 8c 00 0c sw (sp+12),r12 800b5d8: 5b 8d 00 08 sw (sp+8),r13 800b5dc: 5b 9d 00 04 sw (sp+4),ra if ( !rtems_libio_is_valid_perms( flags ) ) { rtems_set_errno_and_return_minus_one( EIO ); } jnode = node->node_access; 800b5e0: 28 2b 00 00 lw r11,(r1+0) int IMFS_evaluate_permission( rtems_filesystem_location_info_t *node, int flags ) { 800b5e4: b8 40 60 00 mv r12,r2 } jnode = node->node_access; #if defined(RTEMS_POSIX_API) st_uid = geteuid(); 800b5e8: f8 00 03 b0 calli 800c4a8 800b5ec: b8 20 68 00 mv r13,r1 st_gid = getegid(); 800b5f0: f8 00 03 a9 calli 800c494 800b5f4: b8 20 18 00 mv r3,r1 * Check if I am owner or a group member or someone else. */ flags_to_test = flags; if ( st_uid == jnode->st_uid ) 800b5f8: 2d 61 00 3c lhu r1,(r11+60) 800b5fc: 5c 2d 00 04 bne r1,r13,800b60c flags_to_test <<= 6; 800b600: b9 80 08 00 mv r1,r12 800b604: 34 02 00 06 mvi r2,6 800b608: e0 00 00 05 bi 800b61c else if ( st_gid == jnode->st_gid ) 800b60c: 2d 62 00 3e lhu r2,(r11+62) /* * Check if I am owner or a group member or someone else. */ flags_to_test = flags; 800b610: b9 80 08 00 mv r1,r12 if ( st_uid == jnode->st_uid ) flags_to_test <<= 6; else if ( st_gid == jnode->st_gid ) 800b614: 5c 43 00 03 bne r2,r3,800b620 <== NEVER TAKEN flags_to_test <<= 3; 800b618: 34 02 00 03 mvi r2,3 800b61c: f8 00 2e 2d calli 8016ed0 <__ashlsi3> /* * If all of the flags are set we have permission * to do this. */ if ( ( flags_to_test & jnode->st_mode) == flags_to_test ) 800b620: 29 62 00 30 lw r2,(r11+48) 800b624: a0 22 10 00 and r2,r1,r2 return 1; return 0; } 800b628: e4 41 08 00 cmpe r1,r2,r1 800b62c: 2b 9d 00 04 lw ra,(sp+4) 800b630: 2b 8b 00 10 lw r11,(sp+16) 800b634: 2b 8c 00 0c lw r12,(sp+12) 800b638: 2b 8d 00 08 lw r13,(sp+8) 800b63c: 37 9c 00 10 addi sp,sp,16 800b640: c3 a0 00 00 ret =============================================================================== 0800b9a0 : int IMFS_evaluate_sym_link( rtems_filesystem_location_info_t *node, /* IN/OUT */ int flags /* IN */ ) { 800b9a0: 37 9c ff ec addi sp,sp,-20 800b9a4: 5b 8b 00 10 sw (sp+16),r11 800b9a8: 5b 8c 00 0c sw (sp+12),r12 800b9ac: 5b 8d 00 08 sw (sp+8),r13 800b9b0: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *jnode = node->node_access; 800b9b4: 28 2c 00 00 lw r12,(r1+0) int IMFS_evaluate_sym_link( rtems_filesystem_location_info_t *node, /* IN/OUT */ int flags /* IN */ ) { 800b9b8: b8 40 68 00 mv r13,r2 800b9bc: b8 20 58 00 mv r11,r1 /* * Check for things that should never happen. */ if ( jnode->type != IMFS_SYM_LINK ) 800b9c0: 29 82 00 4c lw r2,(r12+76) 800b9c4: 34 01 00 04 mvi r1,4 800b9c8: 44 41 00 03 be r2,r1,800b9d4 <== ALWAYS TAKEN rtems_fatal_error_occurred (0xABCD0000); 800b9cc: 78 01 ab cd mvhi r1,0xabcd <== NOT EXECUTED 800b9d0: e0 00 00 04 bi 800b9e0 <== NOT EXECUTED if ( !jnode->Parent ) 800b9d4: 29 81 00 08 lw r1,(r12+8) 800b9d8: 5c 20 00 03 bne r1,r0,800b9e4 <== ALWAYS TAKEN rtems_fatal_error_occurred( 0xBAD00000 ); 800b9dc: 78 01 ba d0 mvhi r1,0xbad0 <== NOT EXECUTED 800b9e0: fb ff e2 df calli 800455c <== NOT EXECUTED /* * Move the node_access to either the symbolic links parent or * root depending on the symbolic links path. */ node->node_access = jnode->Parent; 800b9e4: 59 61 00 00 sw (r11+0),r1 rtems_filesystem_get_sym_start_loc( 800b9e8: 29 81 00 50 lw r1,(r12+80) 800b9ec: 37 82 00 14 addi r2,sp,20 800b9f0: b9 60 18 00 mv r3,r11 800b9f4: f8 00 04 5d calli 800cb68 /* * Use eval path to evaluate the path of the symbolic link. */ result = IMFS_eval_path( 800b9f8: 29 81 00 50 lw r1,(r12+80) 800b9fc: 2b 8c 00 14 lw r12,(sp+20) 800ba00: b4 2c 60 00 add r12,r1,r12 800ba04: b9 80 08 00 mv r1,r12 800ba08: f8 00 1b 1d calli 801267c 800ba0c: b8 20 10 00 mv r2,r1 800ba10: b9 a0 18 00 mv r3,r13 800ba14: b9 80 08 00 mv r1,r12 800ba18: b9 60 20 00 mv r4,r11 800ba1c: fb ff ff 26 calli 800b6b4 800ba20: b8 20 60 00 mv r12,r1 strlen( &jnode->info.sym_link.name[i] ), flags, node ); IMFS_Set_handlers( node ); 800ba24: b9 60 08 00 mv r1,r11 800ba28: fb ff fe c2 calli 800b530 /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( node, flags ) ) 800ba2c: b9 60 08 00 mv r1,r11 800ba30: b9 a0 10 00 mv r2,r13 800ba34: fb ff fe e6 calli 800b5cc 800ba38: 5c 20 00 05 bne r1,r0,800ba4c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EACCES ); 800ba3c: f8 00 16 a4 calli 80114cc <__errno> <== NOT EXECUTED 800ba40: 34 02 00 0d mvi r2,13 <== NOT EXECUTED 800ba44: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 800ba48: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED return result; } 800ba4c: b9 80 08 00 mv r1,r12 800ba50: 2b 9d 00 04 lw ra,(sp+4) 800ba54: 2b 8b 00 10 lw r11,(sp+16) 800ba58: 2b 8c 00 0c lw r12,(sp+12) 800ba5c: 2b 8d 00 08 lw r13,(sp+8) 800ba60: 37 9c 00 14 addi sp,sp,20 800ba64: c3 a0 00 00 ret =============================================================================== 0801078c : int IMFS_fchmod( rtems_filesystem_location_info_t *loc, mode_t mode ) { 801078c: 37 9c ff ec addi sp,sp,-20 8010790: 5b 8b 00 0c sw (sp+12),r11 8010794: 5b 8c 00 08 sw (sp+8),r12 8010798: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *jnode; #if defined(RTEMS_POSIX_API) uid_t st_uid; #endif jnode = loc->node_access; 801079c: 28 2b 00 00 lw r11,(r1+0) int IMFS_fchmod( rtems_filesystem_location_info_t *loc, mode_t mode ) { 80107a0: b8 40 60 00 mv r12,r2 /* * Verify I am the owner of the node or the super user. */ #if defined(RTEMS_POSIX_API) st_uid = geteuid(); 80107a4: fb ff ef 41 calli 800c4a8 if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) 80107a8: 2d 63 00 3c lhu r3,(r11+60) 80107ac: 7c 22 00 00 cmpnei r2,r1,0 80107b0: fc 61 08 00 cmpne r1,r3,r1 80107b4: a0 41 08 00 and r1,r2,r1 80107b8: 44 20 00 06 be r1,r0,80107d0 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EPERM ); 80107bc: f8 00 03 44 calli 80114cc <__errno> <== NOT EXECUTED 80107c0: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 80107c4: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 80107c8: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 80107cc: e0 00 00 0d bi 8010800 <== NOT EXECUTED /* * 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); 80107d0: 29 63 00 30 lw r3,(r11+48) 80107d4: 34 01 f0 00 mvi r1,-4096 jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); 80107d8: 21 82 0f ff andi r2,r12,0xfff /* * 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); 80107dc: a0 23 08 00 and r1,r1,r3 jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); 80107e0: b8 41 10 00 or r2,r2,r1 80107e4: 59 62 00 30 sw (r11+48),r2 IMFS_update_ctime( jnode ); 80107e8: 37 81 00 10 addi r1,sp,16 80107ec: 34 02 00 00 mvi r2,0 80107f0: fb ff c8 05 calli 8002804 80107f4: 2b 81 00 10 lw r1,(sp+16) 80107f8: 59 61 00 48 sw (r11+72),r1 return 0; 80107fc: 34 01 00 00 mvi r1,0 } 8010800: 2b 9d 00 04 lw ra,(sp+4) 8010804: 2b 8b 00 0c lw r11,(sp+12) 8010808: 2b 8c 00 08 lw r12,(sp+8) 801080c: 37 9c 00 14 addi sp,sp,20 8010810: c3 a0 00 00 ret =============================================================================== 080017f8 : } int IMFS_fifo_close( rtems_libio_t *iop ) { 80017f8: 37 9c ff f0 addi sp,sp,-16 80017fc: 5b 8b 00 10 sw (sp+16),r11 8001800: 5b 8c 00 0c sw (sp+12),r12 8001804: 5b 8d 00 08 sw (sp+8),r13 8001808: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *jnode = iop->pathinfo.node_access; 800180c: 28 2d 00 1c lw r13,(r1+28) } int IMFS_fifo_close( rtems_libio_t *iop ) { 8001810: b8 20 60 00 mv r12,r1 IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = pipe_release(&JNODE2PIPE(jnode), iop); 8001814: b9 80 10 00 mv r2,r12 8001818: 35 a1 00 50 addi r1,r13,80 800181c: f8 00 20 14 calli 800986c 8001820: b8 20 58 00 mv r11,r1 if (err == 0) { 8001824: 5c 20 00 08 bne r1,r0,8001844 <== NEVER TAKEN iop->flags &= ~LIBIO_FLAGS_OPEN; 8001828: 29 82 00 18 lw r2,(r12+24) 800182c: 34 01 fe ff mvi r1,-257 8001830: a0 41 08 00 and r1,r2,r1 8001834: 59 81 00 18 sw (r12+24),r1 IMFS_check_node_remove(jnode); 8001838: b9 a0 08 00 mv r1,r13 800183c: f8 00 01 dd calli 8001fb0 8001840: e0 00 00 06 bi 8001858 } IMFS_FIFO_RETURN(err); 8001844: 4c 20 00 05 bge r1,r0,8001858 <== NOT EXECUTED 8001848: c8 0b 58 00 sub r11,r0,r11 <== NOT EXECUTED 800184c: f8 00 33 5b calli 800e5b8 <__errno> <== NOT EXECUTED 8001850: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED 8001854: 34 0b ff ff mvi r11,-1 <== NOT EXECUTED } 8001858: b9 60 08 00 mv r1,r11 800185c: 2b 9d 00 04 lw ra,(sp+4) 8001860: 2b 8b 00 10 lw r11,(sp+16) 8001864: 2b 8c 00 0c lw r12,(sp+12) 8001868: 2b 8d 00 08 lw r13,(sp+8) 800186c: 37 9c 00 10 addi sp,sp,16 8001870: c3 a0 00 00 ret =============================================================================== 0800162c : rtems_off64_t IMFS_fifo_lseek( rtems_libio_t *iop, rtems_off64_t offset, int whence ) { 800162c: 37 9c ff f8 addi sp,sp,-8 8001630: 5b 8b 00 08 sw (sp+8),r11 8001634: 5b 9d 00 04 sw (sp+4),ra 8001638: b8 20 28 00 mv r5,r1 off_t err = pipe_lseek(LIBIO2PIPE(iop), offset, whence, iop); 800163c: 28 21 00 1c lw r1,(r1+28) 8001640: b8 60 10 00 mv r2,r3 8001644: b8 80 18 00 mv r3,r4 8001648: 28 21 00 50 lw r1,(r1+80) 800164c: b8 a0 20 00 mv r4,r5 8001650: f8 00 22 b9 calli 800a134 8001654: b8 20 58 00 mv r11,r1 IMFS_FIFO_RETURN(err); 8001658: 4c 20 00 07 bge r1,r0,8001674 <== NEVER TAKEN 800165c: f8 00 33 d7 calli 800e5b8 <__errno> 8001660: c8 0b 58 00 sub r11,r0,r11 8001664: 58 2b 00 00 sw (r1+0),r11 8001668: 34 01 ff ff mvi r1,-1 800166c: 34 0b ff ff mvi r11,-1 8001670: e0 00 00 03 bi 800167c 8001674: 34 02 00 1f mvi r2,31 <== NOT EXECUTED 8001678: f8 00 6d 3f calli 801cb74 <__ashrsi3> <== NOT EXECUTED } 800167c: b9 60 10 00 mv r2,r11 8001680: 2b 9d 00 04 lw ra,(sp+4) 8001684: 2b 8b 00 08 lw r11,(sp+8) 8001688: 37 9c 00 08 addi sp,sp,8 800168c: c3 a0 00 00 ret =============================================================================== 0800171c : ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 800171c: 37 9c ff ec addi sp,sp,-20 8001720: 5b 8b 00 0c sw (sp+12),r11 8001724: 5b 8c 00 08 sw (sp+8),r12 8001728: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *jnode = iop->pathinfo.node_access; 800172c: 28 2c 00 1c lw r12,(r1+28) ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 8001730: b8 20 20 00 mv r4,r1 IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); 8001734: 29 81 00 50 lw r1,(r12+80) 8001738: f8 00 21 e2 calli 8009ec0 800173c: b8 20 58 00 mv r11,r1 if (err > 0) { 8001740: 4c 01 00 08 bge r0,r1,8001760 IMFS_mtime_ctime_update(jnode); 8001744: 37 81 00 10 addi r1,sp,16 8001748: 34 02 00 00 mvi r2,0 800174c: f8 00 04 b0 calli 8002a0c 8001750: 2b 81 00 10 lw r1,(sp+16) 8001754: 59 81 00 44 sw (r12+68),r1 8001758: 59 81 00 48 sw (r12+72),r1 800175c: e0 00 00 06 bi 8001774 } IMFS_FIFO_RETURN(err); 8001760: 44 20 00 05 be r1,r0,8001774 <== NEVER TAKEN 8001764: c8 0b 58 00 sub r11,r0,r11 8001768: f8 00 33 94 calli 800e5b8 <__errno> 800176c: 58 2b 00 00 sw (r1+0),r11 8001770: 34 0b ff ff mvi r11,-1 } 8001774: b9 60 08 00 mv r1,r11 8001778: 2b 9d 00 04 lw ra,(sp+4) 800177c: 2b 8b 00 0c lw r11,(sp+12) 8001780: 2b 8c 00 08 lw r12,(sp+8) 8001784: 37 9c 00 14 addi sp,sp,20 8001788: c3 a0 00 00 ret =============================================================================== 0800bf18 : IMFS_jnode_t *IMFS_find_match_in_dir( IMFS_jnode_t *directory, char *name ) { 800bf18: 37 9c ff f0 addi sp,sp,-16 800bf1c: 5b 8b 00 10 sw (sp+16),r11 800bf20: 5b 8c 00 0c sw (sp+12),r12 800bf24: 5b 8d 00 08 sw (sp+8),r13 800bf28: 5b 9d 00 04 sw (sp+4),ra 800bf2c: b8 20 58 00 mv r11,r1 800bf30: b8 40 68 00 mv r13,r2 #if defined(RTEMS_DEBUG) assert( directory ); assert( name ); #endif if ( !name ) 800bf34: 44 40 00 17 be r2,r0,800bf90 <== NEVER TAKEN return 0; if ( !directory ) 800bf38: 44 20 00 19 be r1,r0,800bf9c <== NEVER TAKEN /* * Check for "." and ".." */ if ( !strcmp( name, dotname ) ) 800bf3c: b8 40 08 00 mv r1,r2 800bf40: 78 02 08 01 mvhi r2,0x801 800bf44: 38 42 83 34 ori r2,r2,0x8334 800bf48: f8 00 19 56 calli 80124a0 800bf4c: 44 20 00 14 be r1,r0,800bf9c <== NEVER TAKEN return directory; if ( !strcmp( name, dotdotname ) ) 800bf50: 78 02 08 01 mvhi r2,0x801 800bf54: b9 a0 08 00 mv r1,r13 800bf58: 38 42 83 38 ori r2,r2,0x8338 800bf5c: f8 00 19 51 calli 80124a0 800bf60: 5c 20 00 03 bne r1,r0,800bf6c <== ALWAYS TAKEN return directory->Parent; 800bf64: 29 6b 00 08 lw r11,(r11+8) <== NOT EXECUTED 800bf68: e0 00 00 0d bi 800bf9c <== NOT EXECUTED the_chain = &directory->info.directory.Entries; for ( the_node = the_chain->first; 800bf6c: 29 6c 00 50 lw r12,(r11+80) 800bf70: 35 6b 00 54 addi r11,r11,84 800bf74: e0 00 00 06 bi 800bf8c !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; if ( !strcmp( name, the_jnode->name ) ) 800bf78: b9 a0 08 00 mv r1,r13 800bf7c: 35 82 00 0c addi r2,r12,12 800bf80: f8 00 19 48 calli 80124a0 800bf84: 44 20 00 05 be r1,r0,800bf98 the_chain = &directory->info.directory.Entries; for ( the_node = the_chain->first; !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { 800bf88: 29 8c 00 00 lw r12,(r12+0) if ( !strcmp( name, dotdotname ) ) return directory->Parent; the_chain = &directory->info.directory.Entries; for ( the_node = the_chain->first; 800bf8c: 5d 8b ff fb bne r12,r11,800bf78 #if defined(RTEMS_DEBUG) assert( directory ); assert( name ); #endif if ( !name ) return 0; 800bf90: 34 0b 00 00 mvi r11,0 800bf94: e0 00 00 02 bi 800bf9c for ( the_node = the_chain->first; !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; 800bf98: b9 80 58 00 mv r11,r12 if ( !strcmp( name, the_jnode->name ) ) return the_jnode; } return 0; } 800bf9c: b9 60 08 00 mv r1,r11 800bfa0: 2b 9d 00 04 lw ra,(sp+4) 800bfa4: 2b 8b 00 10 lw r11,(sp+16) 800bfa8: 2b 8c 00 0c lw r12,(sp+12) 800bfac: 2b 8d 00 08 lw r13,(sp+8) 800bfb0: 37 9c 00 10 addi sp,sp,16 800bfb4: c3 a0 00 00 ret =============================================================================== 0800be48 : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) int IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 800be48: 37 9c ff d8 addi sp,sp,-40 800be4c: 5b 8b 00 14 sw (sp+20),r11 800be50: 5b 8c 00 10 sw (sp+16),r12 800be54: 5b 8d 00 0c sw (sp+12),r13 800be58: 5b 8e 00 08 sw (sp+8),r14 800be5c: 5b 9d 00 04 sw (sp+4),ra /* * 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; 800be60: 28 2b 00 1c lw r11,(r1+28) loc = temp_mt_entry->mt_fs_root; 800be64: 28 25 00 20 lw r5,(r1+32) 800be68: 28 24 00 24 lw r4,(r1+36) 800be6c: 28 23 00 28 lw r3,(r1+40) 800be70: 28 22 00 2c lw r2,(r1+44) 800be74: 5b 8b 00 18 sw (sp+24),r11 800be78: 5b 85 00 1c sw (sp+28),r5 800be7c: 5b 84 00 20 sw (sp+32),r4 800be80: 5b 83 00 24 sw (sp+36),r3 800be84: 5b 82 00 28 sw (sp+40),r2 /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root.node_access = NULL; 800be88: 58 20 00 1c sw (r1+28),r0 do { next = jnode->Parent; loc.node_access = (void *)jnode; IMFS_Set_handlers( &loc ); 800be8c: 37 8c 00 18 addi r12,sp,24 if ( jnode->type != IMFS_DIRECTORY ) { 800be90: 34 0d 00 01 mvi r13,1 temp_mt_entry->mt_fs_root.node_access = NULL; do { next = jnode->Parent; loc.node_access = (void *)jnode; IMFS_Set_handlers( &loc ); 800be94: b9 80 08 00 mv r1,r12 */ temp_mt_entry->mt_fs_root.node_access = NULL; do { next = jnode->Parent; 800be98: 29 6e 00 08 lw r14,(r11+8) loc.node_access = (void *)jnode; 800be9c: 5b 8b 00 18 sw (sp+24),r11 IMFS_Set_handlers( &loc ); 800bea0: fb ff fd a4 calli 800b530 if ( jnode->type != IMFS_DIRECTORY ) { 800bea4: 29 61 00 4c lw r1,(r11+76) 800bea8: 5c 2d 00 04 bne r1,r13,800beb8 result = IMFS_unlink( NULL, &loc ); if (result != 0) return -1; jnode = next; } else if ( jnode_has_no_children( jnode ) ) { 800beac: 29 62 00 50 lw r2,(r11+80) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 800beb0: 35 61 00 54 addi r1,r11,84 800beb4: 5c 41 00 06 bne r2,r1,800becc result = IMFS_unlink( NULL, &loc ); 800beb8: 34 01 00 00 mvi r1,0 800bebc: b9 80 10 00 mv r2,r12 800bec0: fb ff d8 88 calli 80020e0 if (result != 0) 800bec4: 5c 20 00 0b bne r1,r0,800bef0 <== NEVER TAKEN return -1; jnode = next; 800bec8: b9 c0 58 00 mv r11,r14 } if ( jnode != NULL ) { 800becc: 45 60 00 0b be r11,r0,800bef8 if ( jnode->type == IMFS_DIRECTORY ) { 800bed0: 29 61 00 4c lw r1,(r11+76) 800bed4: 5c 2d ff f0 bne r1,r13,800be94 <== NEVER TAKEN if ( jnode_has_children( jnode ) ) 800bed8: 29 61 00 50 lw r1,(r11+80) 800bedc: 35 62 00 54 addi r2,r11,84 800bee0: 44 22 ff ed be r1,r2,800be94 jnode = jnode_get_first_child( jnode ); 800bee4: b8 20 58 00 mv r11,r1 } } } while (jnode != NULL); 800bee8: 5c 20 ff eb bne r1,r0,800be94 <== ALWAYS TAKEN 800beec: e0 00 00 03 bi 800bef8 <== NOT EXECUTED return -1; jnode = next; } else if ( jnode_has_no_children( jnode ) ) { result = IMFS_unlink( NULL, &loc ); if (result != 0) return -1; 800bef0: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800bef4: e0 00 00 02 bi 800befc <== NOT EXECUTED jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); return 0; 800bef8: 34 01 00 00 mvi r1,0 } 800befc: 2b 9d 00 04 lw ra,(sp+4) 800bf00: 2b 8b 00 14 lw r11,(sp+20) 800bf04: 2b 8c 00 10 lw r12,(sp+16) 800bf08: 2b 8d 00 0c lw r13,(sp+12) 800bf0c: 2b 8e 00 08 lw r14,(sp+8) 800bf10: 37 9c 00 28 addi sp,sp,40 800bf14: c3 a0 00 00 ret =============================================================================== 0800bfb8 : const char *path, int pathlen, char *token, int *token_len ) { 800bfb8: 37 9c ff e0 addi sp,sp,-32 800bfbc: 5b 8b 00 20 sw (sp+32),r11 800bfc0: 5b 8c 00 1c sw (sp+28),r12 800bfc4: 5b 8d 00 18 sw (sp+24),r13 800bfc8: 5b 8e 00 14 sw (sp+20),r14 800bfcc: 5b 8f 00 10 sw (sp+16),r15 800bfd0: 5b 90 00 0c sw (sp+12),r16 800bfd4: 5b 91 00 08 sw (sp+8),r17 800bfd8: 5b 9d 00 04 sw (sp+4),ra register int i = 0; 800bfdc: 34 0b 00 00 mvi r11,0 const char *path, int pathlen, char *token, int *token_len ) { 800bfe0: b8 20 78 00 mv r15,r1 800bfe4: b8 40 70 00 mv r14,r2 800bfe8: b8 60 68 00 mv r13,r3 800bfec: b8 80 80 00 mv r16,r4 register char c; /* * Copy a name into token. (Remember NULL is a token.) */ c = path[i]; 800bff0: 40 2c 00 00 lbu r12,(r1+0) while ( (!IMFS_is_separator(c)) && (i < pathlen) && (i <= IMFS_NAME_MAX) ) { token[i] = c; if ( i == IMFS_NAME_MAX ) 800bff4: 34 11 00 20 mvi r17,32 /* * Copy a name into token. (Remember NULL is a token.) */ c = path[i]; while ( (!IMFS_is_separator(c)) && (i < pathlen) && (i <= IMFS_NAME_MAX) ) { 800bff8: e0 00 00 07 bi 800c014 #include #include "imfs.h" #include IMFS_token_types IMFS_get_token( 800bffc: b5 ab 08 00 add r1,r13,r11 * Copy a name into token. (Remember NULL is a token.) */ c = path[i]; while ( (!IMFS_is_separator(c)) && (i < pathlen) && (i <= IMFS_NAME_MAX) ) { token[i] = c; 800c000: 30 2c 00 00 sb (r1+0),r12 if ( i == IMFS_NAME_MAX ) 800c004: 45 71 00 27 be r11,r17,800c0a0 return IMFS_INVALID_TOKEN; if ( !IMFS_is_valid_name_char(c) ) type = IMFS_INVALID_TOKEN; c = path [++i]; 800c008: 35 6b 00 01 addi r11,r11,1 #include #include "imfs.h" #include IMFS_token_types IMFS_get_token( 800c00c: b5 eb 08 00 add r1,r15,r11 return IMFS_INVALID_TOKEN; if ( !IMFS_is_valid_name_char(c) ) type = IMFS_INVALID_TOKEN; c = path [++i]; 800c010: 40 2c 00 00 lbu r12,(r1+0) /* * Copy a name into token. (Remember NULL is a token.) */ c = path[i]; while ( (!IMFS_is_separator(c)) && (i < pathlen) && (i <= IMFS_NAME_MAX) ) { 800c014: b9 80 08 00 mv r1,r12 800c018: fb ff de 35 calli 80038ec 800c01c: 5c 20 00 03 bne r1,r0,800c028 800c020: e9 cb 10 00 cmpg r2,r14,r11 800c024: 5c 41 ff f6 bne r2,r1,800bffc <== ALWAYS TAKEN /* * Copy a seperator into token. */ if ( i == 0 ) { 800c028: 5d 60 00 08 bne r11,r0,800c048 token[i] = c; 800c02c: 31 ac 00 00 sb (r13+0),r12 if ( (token[i] != '\0') && pathlen ) { 800c030: 7d ce 00 00 cmpnei r14,r14,0 800c034: 7d 8c 00 00 cmpnei r12,r12,0 800c038: a1 8e 60 00 and r12,r12,r14 800c03c: 5d 8b 00 09 bne r12,r11,800c060 i++; type = IMFS_CURRENT_DIR; } else { type = IMFS_NO_MORE_PATH; 800c040: 34 0c 00 00 mvi r12,0 800c044: e0 00 00 09 bi 800c068 } } else if (token[ i-1 ] != '\0') { 800c048: b5 ab 08 00 add r1,r13,r11 800c04c: 40 22 ff ff lbu r2,(r1+-1) char *token, int *token_len ) { register int i = 0; IMFS_token_types type = IMFS_NAME; 800c050: 34 0c 00 03 mvi r12,3 i++; type = IMFS_CURRENT_DIR; } else { type = IMFS_NO_MORE_PATH; } } else if (token[ i-1 ] != '\0') { 800c054: 44 40 00 05 be r2,r0,800c068 <== NEVER TAKEN token[i] = '\0'; 800c058: 30 20 00 00 sb (r1+0),r0 800c05c: e0 00 00 03 bi 800c068 if ( i == 0 ) { token[i] = c; if ( (token[i] != '\0') && pathlen ) { i++; type = IMFS_CURRENT_DIR; 800c060: 34 0c 00 01 mvi r12,1 if ( i == 0 ) { token[i] = c; if ( (token[i] != '\0') && pathlen ) { i++; 800c064: 34 0b 00 01 mvi r11,1 /* * Set token_len to the number of characters copied. */ *token_len = i; 800c068: 5a 0b 00 00 sw (r16+0),r11 /* * If we copied something that was not a seperator see if * it was a special name. */ if ( type == IMFS_NAME ) { 800c06c: 34 01 00 03 mvi r1,3 800c070: 5d 81 00 11 bne r12,r1,800c0b4 if ( strcmp( token, "..") == 0 ) 800c074: 78 02 08 01 mvhi r2,0x801 800c078: b9 a0 08 00 mv r1,r13 800c07c: 38 42 83 3c ori r2,r2,0x833c 800c080: f8 00 19 08 calli 80124a0 800c084: 44 20 00 09 be r1,r0,800c0a8 type = IMFS_UP_DIR; else if ( strcmp( token, "." ) == 0 ) 800c088: 78 02 08 01 mvhi r2,0x801 800c08c: b9 a0 08 00 mv r1,r13 800c090: 38 42 83 40 ori r2,r2,0x8340 800c094: f8 00 19 03 calli 80124a0 800c098: 44 20 00 06 be r1,r0,800c0b0 800c09c: e0 00 00 06 bi 800c0b4 while ( (!IMFS_is_separator(c)) && (i < pathlen) && (i <= IMFS_NAME_MAX) ) { token[i] = c; if ( i == IMFS_NAME_MAX ) return IMFS_INVALID_TOKEN; 800c0a0: 34 0c 00 04 mvi r12,4 800c0a4: e0 00 00 04 bi 800c0b4 * it was a special name. */ if ( type == IMFS_NAME ) { if ( strcmp( token, "..") == 0 ) type = IMFS_UP_DIR; 800c0a8: 34 0c 00 02 mvi r12,2 800c0ac: e0 00 00 02 bi 800c0b4 else if ( strcmp( token, "." ) == 0 ) type = IMFS_CURRENT_DIR; 800c0b0: 34 0c 00 01 mvi r12,1 } return type; } 800c0b4: b9 80 08 00 mv r1,r12 800c0b8: 2b 9d 00 04 lw ra,(sp+4) 800c0bc: 2b 8b 00 20 lw r11,(sp+32) 800c0c0: 2b 8c 00 1c lw r12,(sp+28) 800c0c4: 2b 8d 00 18 lw r13,(sp+24) 800c0c8: 2b 8e 00 14 lw r14,(sp+20) 800c0cc: 2b 8f 00 10 lw r15,(sp+16) 800c0d0: 2b 90 00 0c lw r16,(sp+12) 800c0d4: 2b 91 00 08 lw r17,(sp+8) 800c0d8: 37 9c 00 20 addi sp,sp,32 800c0dc: c3 a0 00 00 ret =============================================================================== 08001c28 : 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 ) { 8001c28: 37 9c ff e0 addi sp,sp,-32 8001c2c: 5b 8b 00 20 sw (sp+32),r11 8001c30: 5b 8c 00 1c sw (sp+28),r12 8001c34: 5b 8d 00 18 sw (sp+24),r13 8001c38: 5b 8e 00 14 sw (sp+20),r14 8001c3c: 5b 8f 00 10 sw (sp+16),r15 8001c40: 5b 90 00 0c sw (sp+12),r16 8001c44: 5b 91 00 08 sw (sp+8),r17 8001c48: 5b 9d 00 04 sw (sp+4),ra 8001c4c: b8 20 58 00 mv r11,r1 IMFS_jnode_t *jnode; /* * determine/check value for imfs_memfile_bytes_per_block */ IMFS_determine_bytes_per_block(&imfs_memfile_bytes_per_block, 8001c50: 78 01 08 01 mvhi r1,0x801 8001c54: 38 21 90 14 ori r1,r1,0x9014 8001c58: 28 2c 00 00 lw r12,(r1+0) 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 ) { 8001c5c: b8 40 88 00 mv r17,r2 8001c60: b8 60 80 00 mv r16,r3 8001c64: b8 80 70 00 mv r14,r4 8001c68: b8 a0 78 00 mv r15,r5 IMFS_jnode_t *jnode; /* * determine/check value for imfs_memfile_bytes_per_block */ IMFS_determine_bytes_per_block(&imfs_memfile_bytes_per_block, 8001c6c: 34 0d 00 06 mvi r13,6 int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 8001c70: 34 01 00 10 mvi r1,16 8001c74: 44 2c 00 06 be r1,r12,8001c8c 8001c78: 34 02 00 01 mvi r2,1 8001c7c: 35 ad ff ff addi r13,r13,-1 8001c80: f8 00 54 94 calli 8016ed0 <__ashlsi3> 8001c84: 5d a0 ff fc bne r13,r0,8001c74 <== ALWAYS TAKEN is_valid = true; } } *dest_bytes_per_block = ((is_valid) ? requested_bytes_per_block : default_bytes_per_block); 8001c88: 34 0c 00 80 mvi r12,128 <== 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) 8001c8c: 78 01 08 01 mvhi r1,0x801 8001c90: 38 21 96 d8 ori r1,r1,0x96d8 8001c94: 58 2c 00 00 sw (r1+0),r12 /* * 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(); 8001c98: f8 00 26 16 calli 800b4f0 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; 8001c9c: 78 02 08 01 mvhi r2,0x801 /* * 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(); 8001ca0: 59 61 00 1c sw (r11+28),r1 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; 8001ca4: 38 42 82 cc ori r2,r2,0x82cc 8001ca8: 34 03 00 30 mvi r3,48 /* * 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(); 8001cac: b8 20 60 00 mv r12,r1 temp_mt_entry->mt_fs_root.handlers = directory_handlers; 8001cb0: 59 6e 00 24 sw (r11+36),r14 temp_mt_entry->mt_fs_root.ops = op_table; 8001cb4: 59 71 00 28 sw (r11+40),r17 temp_mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS; 8001cb8: 35 61 00 38 addi r1,r11,56 8001cbc: f8 00 40 ba calli 8011fa4 /* * Create custom file system data. */ fs_info = calloc( 1, sizeof( IMFS_fs_info_t ) ); 8001cc0: 34 02 00 14 mvi r2,20 8001cc4: 34 01 00 01 mvi r1,1 8001cc8: f8 00 01 fc calli 80024b8 8001ccc: b8 20 10 00 mv r2,r1 if ( !fs_info ) { 8001cd0: 5c 20 00 08 bne r1,r0,8001cf0 <== ALWAYS TAKEN free(temp_mt_entry->mt_fs_root.node_access); 8001cd4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8001cd8: f8 00 02 9d calli 800274c <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOMEM); 8001cdc: f8 00 3d fc calli 80114cc <__errno> <== NOT EXECUTED 8001ce0: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8001ce4: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8001ce8: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8001cec: e0 00 00 0f bi 8001d28 <== NOT EXECUTED /* * Set st_ino for the root to 1. */ fs_info->instance = imfs_instance++; 8001cf0: 78 06 08 01 mvhi r6,0x801 8001cf4: 38 c6 96 dc ori r6,r6,0x96dc 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; 8001cf8: 59 61 00 34 sw (r11+52),r1 /* * Set st_ino for the root to 1. */ fs_info->instance = imfs_instance++; 8001cfc: 28 c1 00 00 lw r1,(r6+0) fs_info->ino_count = 1; fs_info->memfile_handlers = memfile_handlers; 8001d00: 58 50 00 08 sw (r2+8),r16 fs_info->directory_handlers = directory_handlers; 8001d04: 58 4e 00 0c sw (r2+12),r14 /* * Set st_ino for the root to 1. */ fs_info->instance = imfs_instance++; 8001d08: 58 41 00 00 sw (r2+0),r1 8001d0c: 34 21 00 01 addi r1,r1,1 8001d10: 58 c1 00 00 sw (r6+0),r1 fs_info->ino_count = 1; 8001d14: 34 01 00 01 mvi r1,1 8001d18: 58 41 00 04 sw (r2+4),r1 fs_info->memfile_handlers = memfile_handlers; fs_info->directory_handlers = directory_handlers; fs_info->fifo_handlers = fifo_handlers; 8001d1c: 58 4f 00 10 sw (r2+16),r15 jnode = temp_mt_entry->mt_fs_root.node_access; jnode->st_ino = fs_info->ino_count; 8001d20: 59 81 00 38 sw (r12+56),r1 return 0; 8001d24: 34 01 00 00 mvi r1,0 } 8001d28: 2b 9d 00 04 lw ra,(sp+4) 8001d2c: 2b 8b 00 20 lw r11,(sp+32) 8001d30: 2b 8c 00 1c lw r12,(sp+28) 8001d34: 2b 8d 00 18 lw r13,(sp+24) 8001d38: 2b 8e 00 14 lw r14,(sp+20) 8001d3c: 2b 8f 00 10 lw r15,(sp+16) 8001d40: 2b 90 00 0c lw r16,(sp+12) 8001d44: 2b 91 00 08 lw r17,(sp+8) 8001d48: 37 9c 00 20 addi sp,sp,32 8001d4c: c3 a0 00 00 ret =============================================================================== 08001d50 : int IMFS_link( rtems_filesystem_location_info_t *to_loc, /* IN */ rtems_filesystem_location_info_t *parent_loc, /* IN */ const char *token /* IN */ ) { 8001d50: 37 9c ff a8 addi sp,sp,-88 8001d54: 5b 8b 00 10 sw (sp+16),r11 8001d58: 5b 8c 00 0c sw (sp+12),r12 8001d5c: 5b 8d 00 08 sw (sp+8),r13 8001d60: 5b 9d 00 04 sw (sp+4),ra 8001d64: b8 60 60 00 mv r12,r3 int i; /* * Verify this node can be linked to. */ info.hard_link.link_node = to_loc->node_access; 8001d68: 28 23 00 00 lw r3,(r1+0) int IMFS_link( rtems_filesystem_location_info_t *to_loc, /* IN */ rtems_filesystem_location_info_t *parent_loc, /* IN */ const char *token /* IN */ ) { 8001d6c: b8 40 68 00 mv r13,r2 /* * 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 ) 8001d70: 34 02 00 07 mvi r2,7 8001d74: 2c 61 00 34 lhu r1,(r3+52) int i; /* * Verify this node can be linked to. */ info.hard_link.link_node = to_loc->node_access; 8001d78: 5b 83 00 38 sw (sp+56),r3 if ( info.hard_link.link_node->st_nlink >= LINK_MAX ) 8001d7c: 50 41 00 04 bgeu r2,r1,8001d8c rtems_set_errno_and_return_minus_one( EMLINK ); 8001d80: f8 00 3d d3 calli 80114cc <__errno> 8001d84: 34 02 00 1f mvi r2,31 8001d88: e0 00 00 12 bi 8001dd0 /* * Remove any separators at the end of the string. */ IMFS_get_token( token, strlen( token ), new_name, &i ); 8001d8c: b9 80 08 00 mv r1,r12 8001d90: f8 00 42 3b calli 801267c 8001d94: 37 8b 00 14 addi r11,sp,20 8001d98: b8 20 10 00 mv r2,r1 8001d9c: b9 60 18 00 mv r3,r11 8001da0: 37 84 00 58 addi r4,sp,88 8001da4: b9 80 08 00 mv r1,r12 8001da8: f8 00 28 84 calli 800bfb8 * 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( 8001dac: b9 a0 08 00 mv r1,r13 8001db0: 34 02 00 03 mvi r2,3 8001db4: b9 60 18 00 mv r3,r11 8001db8: 38 04 a1 ff mvu r4,0xa1ff 8001dbc: 37 85 00 38 addi r5,sp,56 8001dc0: f8 00 25 7a calli 800b3a8 new_name, ( S_IFLNK | ( S_IRWXU | S_IRWXG | S_IRWXO )), &info ); if ( !new_node ) 8001dc4: 5c 20 00 06 bne r1,r0,8001ddc <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOMEM ); 8001dc8: f8 00 3d c1 calli 80114cc <__errno> <== NOT EXECUTED 8001dcc: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8001dd0: 58 22 00 00 sw (r1+0),r2 8001dd4: 34 01 ff ff mvi r1,-1 8001dd8: e0 00 00 0c bi 8001e08 /* * Increment the link count of the node being pointed to. */ info.hard_link.link_node->st_nlink++; 8001ddc: 2b 81 00 38 lw r1,(sp+56) 8001de0: 2c 22 00 34 lhu r2,(r1+52) 8001de4: 34 42 00 01 addi r2,r2,1 8001de8: 0c 22 00 34 sh (r1+52),r2 IMFS_update_ctime( info.hard_link.link_node ); 8001dec: 34 02 00 00 mvi r2,0 8001df0: 37 81 00 50 addi r1,sp,80 8001df4: f8 00 02 84 calli 8002804 8001df8: 2b 81 00 38 lw r1,(sp+56) 8001dfc: 2b 82 00 50 lw r2,(sp+80) 8001e00: 58 22 00 48 sw (r1+72),r2 return 0; 8001e04: 34 01 00 00 mvi r1,0 } 8001e08: 2b 9d 00 04 lw ra,(sp+4) 8001e0c: 2b 8b 00 10 lw r11,(sp+16) 8001e10: 2b 8c 00 0c lw r12,(sp+12) 8001e14: 2b 8d 00 08 lw r13,(sp+8) 8001e18: 37 9c 00 58 addi sp,sp,88 8001e1c: c3 a0 00 00 ret =============================================================================== 0800fa18 : MEMFILE_STATIC int IMFS_memfile_addblock( IMFS_jnode_t *the_jnode, unsigned int block ) { 800fa18: 37 9c ff f4 addi sp,sp,-12 800fa1c: 5b 8b 00 0c sw (sp+12),r11 800fa20: 5b 8c 00 08 sw (sp+8),r12 800fa24: 5b 9d 00 04 sw (sp+4),ra #if defined(RTEMS_DEBUG) assert( the_jnode ); assert( the_jnode->type == IMFS_MEMORY_FILE ); #endif block_entry_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 1 ); 800fa28: 34 03 00 01 mvi r3,1 800fa2c: fb ff fe bd calli 800f520 if ( *block_entry_ptr ) 800fa30: 28 2c 00 00 lw r12,(r1+0) #if defined(RTEMS_DEBUG) assert( the_jnode ); assert( the_jnode->type == IMFS_MEMORY_FILE ); #endif block_entry_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 1 ); 800fa34: b8 20 58 00 mv r11,r1 if ( *block_entry_ptr ) return 0; 800fa38: 34 02 00 00 mvi r2,0 assert( the_jnode ); assert( the_jnode->type == IMFS_MEMORY_FILE ); #endif block_entry_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 1 ); if ( *block_entry_ptr ) 800fa3c: 5d 80 00 06 bne r12,r0,800fa54 #if 0 fprintf(stdout, "%d %p", block, block_entry_ptr ); fflush(stdout); #endif memory = memfile_alloc_block(); 800fa40: fb ff fe a8 calli 800f4e0 if ( !memory ) return 1; 800fa44: 34 02 00 01 mvi r2,1 fprintf(stdout, "%d %p", block, block_entry_ptr ); fflush(stdout); #endif memory = memfile_alloc_block(); if ( !memory ) 800fa48: 44 2c 00 03 be r1,r12,800fa54 <== NEVER TAKEN return 1; *block_entry_ptr = memory; 800fa4c: 59 61 00 00 sw (r11+0),r1 return 0; 800fa50: 34 02 00 00 mvi r2,0 } 800fa54: b8 40 08 00 mv r1,r2 800fa58: 2b 9d 00 04 lw ra,(sp+4) 800fa5c: 2b 8b 00 0c lw r11,(sp+12) 800fa60: 2b 8c 00 08 lw r12,(sp+8) 800fa64: 37 9c 00 0c addi sp,sp,12 800fa68: c3 a0 00 00 ret =============================================================================== 0800fcac : MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, off_t new_length ) { 800fcac: 37 9c ff e0 addi sp,sp,-32 800fcb0: 5b 8b 00 20 sw (sp+32),r11 800fcb4: 5b 8c 00 1c sw (sp+28),r12 800fcb8: 5b 8d 00 18 sw (sp+24),r13 800fcbc: 5b 8e 00 14 sw (sp+20),r14 800fcc0: 5b 8f 00 10 sw (sp+16),r15 800fcc4: 5b 90 00 0c sw (sp+12),r16 800fcc8: 5b 91 00 08 sw (sp+8),r17 800fccc: 5b 9d 00 04 sw (sp+4),ra 800fcd0: b8 20 60 00 mv r12,r1 #if defined(RTEMS_DEBUG) assert( the_jnode ); assert( the_jnode->type == IMFS_MEMORY_FILE ); #endif if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 800fcd4: 78 01 08 01 mvhi r1,0x801 800fcd8: 38 21 96 d8 ori r1,r1,0x96d8 800fcdc: 28 2b 00 00 lw r11,(r1+0) MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, off_t new_length ) { 800fce0: b8 40 68 00 mv r13,r2 #if defined(RTEMS_DEBUG) assert( the_jnode ); assert( the_jnode->type == IMFS_MEMORY_FILE ); #endif if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 800fce4: 34 02 00 02 mvi r2,2 800fce8: b9 60 08 00 mv r1,r11 800fcec: f8 00 1c c7 calli 8017008 <__lshrsi3> 800fcf0: b8 20 70 00 mv r14,r1 800fcf4: b9 c0 10 00 mv r2,r14 800fcf8: 34 21 00 01 addi r1,r1,1 800fcfc: f8 00 1c ea calli 80170a4 <__mulsi3> 800fd00: b9 c0 10 00 mv r2,r14 800fd04: 34 21 00 01 addi r1,r1,1 800fd08: f8 00 1c e7 calli 80170a4 <__mulsi3> 800fd0c: 34 21 ff ff addi r1,r1,-1 800fd10: b9 60 10 00 mv r2,r11 800fd14: f8 00 1c e4 calli 80170a4 <__mulsi3> 800fd18: 54 2d 00 04 bgu r1,r13,800fd28 rtems_set_errno_and_return_minus_one( EINVAL ); 800fd1c: f8 00 05 ec calli 80114cc <__errno> 800fd20: 34 02 00 16 mvi r2,22 800fd24: e0 00 00 26 bi 800fdbc if ( new_length <= the_jnode->info.file.size ) 800fd28: b9 a0 08 00 mv r1,r13 800fd2c: 34 02 00 1f mvi r2,31 800fd30: f8 00 1c 8f calli 8016f6c <__ashrsi3> 800fd34: 29 8f 00 50 lw r15,(r12+80) 800fd38: b8 20 70 00 mv r14,r1 800fd3c: 29 90 00 54 lw r16,(r12+84) 800fd40: 48 2f 00 04 bg r1,r15,800fd50 <== NEVER TAKEN 800fd44: 5c 2f 00 25 bne r1,r15,800fdd8 <== NEVER TAKEN 800fd48: 55 b0 00 02 bgu r13,r16,800fd50 800fd4c: e0 00 00 23 bi 800fdd8 /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; 800fd50: b9 60 10 00 mv r2,r11 800fd54: b9 a0 08 00 mv r1,r13 800fd58: f8 00 1c df calli 80170d4 <__divsi3> old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 800fd5c: 34 02 00 1f mvi r2,31 /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; 800fd60: b8 20 88 00 mv r17,r1 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 800fd64: b9 60 08 00 mv r1,r11 800fd68: f8 00 1c 81 calli 8016f6c <__ashrsi3> 800fd6c: b8 20 18 00 mv r3,r1 800fd70: b9 60 20 00 mv r4,r11 800fd74: b9 e0 08 00 mv r1,r15 800fd78: ba 00 10 00 mv r2,r16 800fd7c: f8 00 14 91 calli 8014fc0 <__divdi3> 800fd80: b8 40 78 00 mv r15,r2 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { 800fd84: b8 40 58 00 mv r11,r2 800fd88: e0 00 00 11 bi 800fdcc if ( IMFS_memfile_addblock( the_jnode, block ) ) { 800fd8c: b9 80 08 00 mv r1,r12 800fd90: b9 60 10 00 mv r2,r11 800fd94: fb ff ff 21 calli 800fa18 800fd98: 44 20 00 0c be r1,r0,800fdc8 <== ALWAYS TAKEN 800fd9c: e0 00 00 05 bi 800fdb0 <== NOT EXECUTED for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); 800fda0: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 800fda4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 800fda8: fb ff ff b4 calli 800fc78 <== 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-- ) { 800fdac: 35 6b ff ff addi r11,r11,-1 <== NOT EXECUTED 800fdb0: 51 6f ff fc bgeu r11,r15,800fda0 <== NOT EXECUTED IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); 800fdb4: f8 00 05 c6 calli 80114cc <__errno> <== NOT EXECUTED 800fdb8: 34 02 00 1c mvi r2,28 <== NOT EXECUTED 800fdbc: 58 22 00 00 sw (r1+0),r2 800fdc0: 34 01 ff ff mvi r1,-1 800fdc4: e0 00 00 06 bi 800fddc /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { 800fdc8: 35 6b 00 01 addi r11,r11,1 800fdcc: 52 2b ff f0 bgeu r17,r11,800fd8c /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; 800fdd0: 59 8e 00 50 sw (r12+80),r14 800fdd4: 59 8d 00 54 sw (r12+84),r13 if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( new_length <= the_jnode->info.file.size ) return 0; 800fdd8: 34 01 00 00 mvi r1,0 * Set the new length of the file. */ the_jnode->info.file.size = new_length; return 0; } 800fddc: 2b 9d 00 04 lw ra,(sp+4) 800fde0: 2b 8b 00 20 lw r11,(sp+32) 800fde4: 2b 8c 00 1c lw r12,(sp+28) 800fde8: 2b 8d 00 18 lw r13,(sp+24) 800fdec: 2b 8e 00 14 lw r14,(sp+20) 800fdf0: 2b 8f 00 10 lw r15,(sp+16) 800fdf4: 2b 90 00 0c lw r16,(sp+12) 800fdf8: 2b 91 00 08 lw r17,(sp+8) 800fdfc: 37 9c 00 20 addi sp,sp,32 800fe00: c3 a0 00 00 ret =============================================================================== 0800f520 : #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 800f520: 37 9c ff e0 addi sp,sp,-32 800f524: 5b 8b 00 20 sw (sp+32),r11 800f528: 5b 8c 00 1c sw (sp+28),r12 800f52c: 5b 8d 00 18 sw (sp+24),r13 800f530: 5b 8e 00 14 sw (sp+20),r14 800f534: 5b 8f 00 10 sw (sp+16),r15 800f538: 5b 90 00 0c sw (sp+12),r16 800f53c: 5b 91 00 08 sw (sp+8),r17 800f540: 5b 9d 00 04 sw (sp+4),ra 800f544: b8 20 68 00 mv r13,r1 /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 800f548: 78 01 08 01 mvhi r1,0x801 800f54c: 38 21 96 d8 ori r1,r1,0x96d8 800f550: 28 21 00 00 lw r1,(r1+0) #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 800f554: b8 40 70 00 mv r14,r2 /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 800f558: 34 02 00 02 mvi r2,2 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 800f55c: b8 60 78 00 mv r15,r3 /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 800f560: f8 00 1e aa calli 8017008 <__lshrsi3> 800f564: b8 20 60 00 mv r12,r1 800f568: 34 21 ff ff addi r1,r1,-1 800f56c: 55 c1 00 11 bgu r14,r1,800f5b0 p = info->indirect; 800f570: 29 ac 00 58 lw r12,(r13+88) if ( malloc_it ) { 800f574: 45 e0 00 0b be r15,r0,800f5a0 if ( !p ) { 800f578: 5d 80 00 05 bne r12,r0,800f58c p = memfile_alloc_block(); 800f57c: fb ff ff d9 calli 800f4e0 if ( !p ) return 0; 800f580: 34 0b 00 00 mvi r11,0 if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); if ( !p ) 800f584: 44 2c 00 83 be r1,r12,800f790 <== NEVER TAKEN return 0; info->indirect = p; 800f588: 59 a1 00 58 sw (r13+88),r1 } return &info->indirect[ my_block ]; 800f58c: b9 c0 08 00 mv r1,r14 800f590: 34 02 00 02 mvi r2,2 800f594: f8 00 1e 4f calli 8016ed0 <__ashlsi3> 800f598: 29 ab 00 58 lw r11,(r13+88) 800f59c: e0 00 00 7c bi 800f78c } if ( !p ) return 0; 800f5a0: 34 0b 00 00 mvi r11,0 return &info->indirect[ my_block ]; 800f5a4: b9 c0 08 00 mv r1,r14 info->indirect = p; } return &info->indirect[ my_block ]; } if ( !p ) 800f5a8: 5d 8b 00 66 bne r12,r11,800f740 <== ALWAYS TAKEN 800f5ac: e0 00 00 79 bi 800f790 <== NOT EXECUTED /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { 800f5b0: 35 81 00 01 addi r1,r12,1 800f5b4: b9 80 10 00 mv r2,r12 800f5b8: f8 00 1e bb calli 80170a4 <__mulsi3> 800f5bc: b8 20 80 00 mv r16,r1 800f5c0: 34 21 ff ff addi r1,r1,-1 800f5c4: 55 c1 00 2b bgu r14,r1,800f670 #if 0 fprintf(stdout, "(d %d) ", block ); fflush(stdout); #endif my_block -= FIRST_DOUBLY_INDIRECT; 800f5c8: c9 cc 70 00 sub r14,r14,r12 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 800f5cc: b9 80 10 00 mv r2,r12 800f5d0: b9 c0 08 00 mv r1,r14 800f5d4: f8 00 1f 29 calli 8017278 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 800f5d8: b9 80 10 00 mv r2,r12 fflush(stdout); #endif my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 800f5dc: b8 20 80 00 mv r16,r1 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 800f5e0: b9 c0 08 00 mv r1,r14 800f5e4: f8 00 1f 15 calli 8017238 <__udivsi3> 800f5e8: b8 20 70 00 mv r14,r1 p = info->doubly_indirect; 800f5ec: 29 ac 00 5c lw r12,(r13+92) if ( malloc_it ) { 800f5f0: 45 e0 00 17 be r15,r0,800f64c if ( !p ) { 800f5f4: 5d 80 00 06 bne r12,r0,800f60c p = memfile_alloc_block(); 800f5f8: fb ff ff ba calli 800f4e0 800f5fc: b8 20 60 00 mv r12,r1 if ( !p ) return 0; 800f600: 34 0b 00 00 mvi r11,0 p = info->doubly_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); if ( !p ) 800f604: 44 20 00 63 be r1,r0,800f790 <== NEVER TAKEN return 0; info->doubly_indirect = p; 800f608: 59 a1 00 5c sw (r13+92),r1 } p1 = (block_p *)p[ doubly ]; 800f60c: b9 c0 08 00 mv r1,r14 800f610: 34 02 00 02 mvi r2,2 800f614: f8 00 1e 2f calli 8016ed0 <__ashlsi3> 800f618: b5 81 60 00 add r12,r12,r1 800f61c: 29 8d 00 00 lw r13,(r12+0) if ( !p1 ) { 800f620: 5d a0 00 06 bne r13,r0,800f638 p1 = memfile_alloc_block(); 800f624: fb ff ff af calli 800f4e0 800f628: b8 20 68 00 mv r13,r1 if ( !p1 ) return 0; 800f62c: 34 0b 00 00 mvi r11,0 } p1 = (block_p *)p[ doubly ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) 800f630: 44 20 00 58 be r1,r0,800f790 <== NEVER TAKEN return 0; p[ doubly ] = (block_p) p1; 800f634: 59 81 00 00 sw (r12+0),r1 } return (block_p *)&p1[ singly ]; 800f638: ba 00 08 00 mv r1,r16 800f63c: 34 02 00 02 mvi r2,2 800f640: f8 00 1e 24 calli 8016ed0 <__ashlsi3> 800f644: b5 a1 58 00 add r11,r13,r1 800f648: e0 00 00 52 bi 800f790 } if ( !p ) return 0; 800f64c: 34 0b 00 00 mvi r11,0 } return (block_p *)&p1[ singly ]; } if ( !p ) 800f650: 45 8b 00 50 be r12,r11,800f790 <== NEVER TAKEN return 0; p = (block_p *)p[ doubly ]; 800f654: 34 02 00 02 mvi r2,2 800f658: f8 00 1e 1e calli 8016ed0 <__ashlsi3> 800f65c: b5 81 08 00 add r1,r12,r1 800f660: 28 2c 00 00 lw r12,(r1+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 ]; 800f664: ba 00 08 00 mv r1,r16 if ( !p ) return 0; p = (block_p *)p[ doubly ]; if ( !p ) 800f668: 5d 80 00 36 bne r12,r0,800f740 <== ALWAYS TAKEN 800f66c: e0 00 00 49 bi 800f790 <== NOT EXECUTED #endif /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 800f670: 36 01 00 01 addi r1,r16,1 800f674: b9 80 10 00 mv r2,r12 800f678: f8 00 1e 8b calli 80170a4 <__mulsi3> 800f67c: 34 21 ff ff addi r1,r1,-1 /* * This means the requested block number is out of range. */ return 0; 800f680: 34 0b 00 00 mvi r11,0 #endif /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 800f684: 55 c1 00 43 bgu r14,r1,800f790 <== NEVER TAKEN my_block -= FIRST_TRIPLY_INDIRECT; 800f688: c9 d0 70 00 sub r14,r14,r16 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 800f68c: b9 80 10 00 mv r2,r12 800f690: b9 c0 08 00 mv r1,r14 800f694: f8 00 1e f9 calli 8017278 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 800f698: b9 80 10 00 mv r2,r12 */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 800f69c: b8 20 88 00 mv r17,r1 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 800f6a0: b9 c0 08 00 mv r1,r14 800f6a4: f8 00 1e e5 calli 8017238 <__udivsi3> triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 800f6a8: b9 80 10 00 mv r2,r12 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; 800f6ac: b8 20 70 00 mv r14,r1 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 800f6b0: f8 00 1e e2 calli 8017238 <__udivsi3> doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 800f6b4: b9 80 10 00 mv r2,r12 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; 800f6b8: b8 20 80 00 mv r16,r1 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 800f6bc: b9 c0 08 00 mv r1,r14 800f6c0: f8 00 1e ee calli 8017278 <__umodsi3> 800f6c4: b8 20 70 00 mv r14,r1 p = info->triply_indirect; 800f6c8: 29 ac 00 60 lw r12,(r13+96) if ( malloc_it ) { 800f6cc: 45 e0 00 21 be r15,r0,800f750 if ( !p ) { 800f6d0: 5d 80 00 05 bne r12,r0,800f6e4 p = memfile_alloc_block(); 800f6d4: fb ff ff 83 calli 800f4e0 800f6d8: b8 20 60 00 mv r12,r1 if ( !p ) 800f6dc: 44 20 00 2d be r1,r0,800f790 <== NEVER TAKEN return 0; info->triply_indirect = p; 800f6e0: 59 a1 00 60 sw (r13+96),r1 } p1 = (block_p *) p[ triply ]; 800f6e4: ba 00 08 00 mv r1,r16 800f6e8: 34 02 00 02 mvi r2,2 800f6ec: f8 00 1d f9 calli 8016ed0 <__ashlsi3> 800f6f0: b5 81 60 00 add r12,r12,r1 800f6f4: 29 8d 00 00 lw r13,(r12+0) if ( !p1 ) { 800f6f8: 5d a0 00 06 bne r13,r0,800f710 p1 = memfile_alloc_block(); 800f6fc: fb ff ff 79 calli 800f4e0 800f700: b8 20 68 00 mv r13,r1 if ( !p1 ) return 0; 800f704: 34 0b 00 00 mvi r11,0 } p1 = (block_p *) p[ triply ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) 800f708: 44 20 00 22 be r1,r0,800f790 <== NEVER TAKEN return 0; p[ triply ] = (block_p) p1; 800f70c: 59 81 00 00 sw (r12+0),r1 } p2 = (block_p *)p1[ doubly ]; 800f710: b9 c0 08 00 mv r1,r14 800f714: 34 02 00 02 mvi r2,2 800f718: f8 00 1d ee calli 8016ed0 <__ashlsi3> 800f71c: b5 a1 68 00 add r13,r13,r1 800f720: 29 ac 00 00 lw r12,(r13+0) if ( !p2 ) { 800f724: 5d 80 00 06 bne r12,r0,800f73c p2 = memfile_alloc_block(); 800f728: fb ff ff 6e calli 800f4e0 800f72c: b8 20 60 00 mv r12,r1 if ( !p2 ) return 0; 800f730: 34 0b 00 00 mvi r11,0 } p2 = (block_p *)p1[ doubly ]; if ( !p2 ) { p2 = memfile_alloc_block(); if ( !p2 ) 800f734: 44 20 00 17 be r1,r0,800f790 <== NEVER TAKEN return 0; p1[ doubly ] = (block_p) p2; 800f738: 59 a1 00 00 sw (r13+0),r1 } return (block_p *)&p2[ singly ]; 800f73c: ba 20 08 00 mv r1,r17 800f740: 34 02 00 02 mvi r2,2 800f744: f8 00 1d e3 calli 8016ed0 <__ashlsi3> 800f748: b5 81 58 00 add r11,r12,r1 800f74c: e0 00 00 11 bi 800f790 } if ( !p ) 800f750: 45 8b 00 10 be r12,r11,800f790 <== NEVER TAKEN #if 0 fprintf(stdout, "(t %d %d %d %d %d) ", block, my_block, triply, doubly, singly ); fflush(stdout); #endif p1 = (block_p *) p[ triply ]; 800f754: ba 00 08 00 mv r1,r16 800f758: 34 02 00 02 mvi r2,2 800f75c: f8 00 1d dd calli 8016ed0 <__ashlsi3> 800f760: b5 81 08 00 add r1,r12,r1 800f764: 28 2c 00 00 lw r12,(r1+0) if ( !p1 ) 800f768: 45 80 00 0a be r12,r0,800f790 <== NEVER TAKEN return 0; p2 = (block_p *)p1[ doubly ]; 800f76c: 34 02 00 02 mvi r2,2 800f770: b9 c0 08 00 mv r1,r14 800f774: f8 00 1d d7 calli 8016ed0 <__ashlsi3> 800f778: b5 81 60 00 add r12,r12,r1 if ( !p ) return 0; return (block_p *)&p2[ singly ]; 800f77c: 34 02 00 02 mvi r2,2 800f780: ba 20 08 00 mv r1,r17 800f784: f8 00 1d d3 calli 8016ed0 <__ashlsi3> 800f788: 29 8b 00 00 lw r11,(r12+0) 800f78c: b5 61 58 00 add r11,r11,r1 /* * This means the requested block number is out of range. */ return 0; } 800f790: b9 60 08 00 mv r1,r11 800f794: 2b 9d 00 04 lw ra,(sp+4) 800f798: 2b 8b 00 20 lw r11,(sp+32) 800f79c: 2b 8c 00 1c lw r12,(sp+28) 800f7a0: 2b 8d 00 18 lw r13,(sp+24) 800f7a4: 2b 8e 00 14 lw r14,(sp+20) 800f7a8: 2b 8f 00 10 lw r15,(sp+16) 800f7ac: 2b 90 00 0c lw r16,(sp+12) 800f7b0: 2b 91 00 08 lw r17,(sp+8) 800f7b4: 37 9c 00 20 addi sp,sp,32 800f7b8: c3 a0 00 00 ret =============================================================================== 0800f7bc : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 800f7bc: 37 9c ff d4 addi sp,sp,-44 800f7c0: 5b 8b 00 24 sw (sp+36),r11 800f7c4: 5b 8c 00 20 sw (sp+32),r12 800f7c8: 5b 8d 00 1c sw (sp+28),r13 800f7cc: 5b 8e 00 18 sw (sp+24),r14 800f7d0: 5b 8f 00 14 sw (sp+20),r15 800f7d4: 5b 90 00 10 sw (sp+16),r16 800f7d8: 5b 91 00 0c sw (sp+12),r17 800f7dc: 5b 92 00 08 sw (sp+8),r18 800f7e0: 5b 9d 00 04 sw (sp+4),ra 800f7e4: b8 20 60 00 mv r12,r1 800f7e8: b8 40 68 00 mv r13,r2 800f7ec: b8 60 80 00 mv r16,r3 800f7f0: b8 80 58 00 mv r11,r4 /* * Error checks on arguments */ if ( !dest ) 800f7f4: 44 60 00 02 be r3,r0,800f7fc <== NEVER TAKEN /* * If there is nothing to read, then quick exit. */ my_length = length; if ( !my_length ) 800f7f8: 5c 80 00 06 bne r4,r0,800f810 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 800f7fc: f8 00 07 34 calli 80114cc <__errno> <== NOT EXECUTED 800f800: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 800f804: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 800f808: 34 04 ff ff mvi r4,-1 <== NOT EXECUTED 800f80c: e0 00 00 6b bi 800f9b8 <== NOT EXECUTED /* * Linear files (as created from a tar file are easier to handle * than block files). */ if (the_jnode->type == IMFS_LINEAR_FILE) { 800f810: 28 22 00 4c lw r2,(r1+76) 800f814: 28 2f 00 50 lw r15,(r1+80) 800f818: 28 2e 00 54 lw r14,(r1+84) 800f81c: 34 01 00 06 mvi r1,6 800f820: 5c 41 00 19 bne r2,r1,800f884 unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) 800f824: 34 02 00 1f mvi r2,31 800f828: b9 a0 08 00 mv r1,r13 800f82c: f8 00 1d d0 calli 8016f6c <__ashrsi3> 800f830: c9 cd 18 00 sub r3,r14,r13 800f834: f4 6e 10 00 cmpgu r2,r3,r14 800f838: c9 e1 08 00 sub r1,r15,r1 800f83c: c8 22 78 00 sub r15,r1,r2 * than block files). */ if (the_jnode->type == IMFS_LINEAR_FILE) { unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; 800f840: 29 91 00 58 lw r17,(r12+88) if (my_length > (the_jnode->info.linearfile.size - start)) 800f844: 48 0f 00 04 bg r0,r15,800f854 <== NEVER TAKEN 800f848: 5c 0f 00 04 bne r0,r15,800f858 <== NEVER TAKEN 800f84c: 55 63 00 02 bgu r11,r3,800f854 <== ALWAYS TAKEN 800f850: e0 00 00 02 bi 800f858 <== NOT EXECUTED my_length = the_jnode->info.linearfile.size - start; 800f854: c9 cd 58 00 sub r11,r14,r13 memcpy(dest, &file_ptr[start], my_length); 800f858: b6 2d 10 00 add r2,r17,r13 800f85c: b9 60 18 00 mv r3,r11 800f860: ba 00 08 00 mv r1,r16 800f864: f8 00 09 d0 calli 8011fa4 IMFS_update_atime( the_jnode ); 800f868: 37 81 00 28 addi r1,sp,40 800f86c: 34 02 00 00 mvi r2,0 800f870: fb ff cb e5 calli 8002804 800f874: 2b 81 00 28 lw r1,(sp+40) return my_length; 800f878: b9 60 20 00 mv r4,r11 if (my_length > (the_jnode->info.linearfile.size - start)) my_length = the_jnode->info.linearfile.size - start; memcpy(dest, &file_ptr[start], my_length); IMFS_update_atime( the_jnode ); 800f87c: 59 81 00 40 sw (r12+64),r1 return my_length; 800f880: e0 00 00 4e bi 800f9b8 /* * 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; 800f884: b4 8d 08 00 add r1,r4,r13 if ( last_byte > the_jnode->info.file.size ) 800f888: 48 0f 00 04 bg r0,r15,800f898 <== NEVER TAKEN 800f88c: 5d e0 00 04 bne r15,r0,800f89c <== NEVER TAKEN 800f890: 54 2e 00 02 bgu r1,r14,800f898 800f894: e0 00 00 02 bi 800f89c my_length = the_jnode->info.file.size - start; 800f898: c9 cd 58 00 sub r11,r14,r13 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800f89c: 78 01 08 01 mvhi r1,0x801 800f8a0: 38 21 96 d8 ori r1,r1,0x96d8 800f8a4: 28 32 00 00 lw r18,(r1+0) 800f8a8: b9 a0 08 00 mv r1,r13 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { 800f8ac: ba 00 78 00 mv r15,r16 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800f8b0: ba 40 10 00 mv r2,r18 800f8b4: f8 00 1e 38 calli 8017194 <__modsi3> 800f8b8: b8 20 88 00 mv r17,r1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 800f8bc: ba 40 10 00 mv r2,r18 800f8c0: b9 a0 08 00 mv r1,r13 800f8c4: f8 00 1e 04 calli 80170d4 <__divsi3> 800f8c8: b8 20 70 00 mv r14,r1 last_byte = start + length; if ( last_byte > the_jnode->info.file.size ) my_length = the_jnode->info.file.size - start; copied = 0; 800f8cc: 34 0d 00 00 mvi r13,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; if ( start_offset ) { 800f8d0: 46 20 00 13 be r17,r0,800f91c 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 ); 800f8d4: b9 80 08 00 mv r1,r12 800f8d8: b9 c0 10 00 mv r2,r14 800f8dc: 34 03 00 00 mvi r3,0 800f8e0: fb ff ff 10 calli 800f520 if ( !block_ptr ) return copied; 800f8e4: 34 04 00 00 mvi r4,0 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 ) 800f8e8: 44 20 00 34 be r1,r0,800f9b8 <== NEVER TAKEN */ 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; 800f8ec: ca 51 90 00 sub r18,r18,r17 800f8f0: b9 60 68 00 mv r13,r11 800f8f4: 52 4b 00 02 bgeu r18,r11,800f8fc 800f8f8: ba 40 68 00 mv r13,r18 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 ); 800f8fc: 28 22 00 00 lw r2,(r1+0) 800f900: b9 a0 18 00 mv r3,r13 800f904: ba 00 08 00 mv r1,r16 800f908: b4 51 10 00 add r2,r2,r17 800f90c: f8 00 09 a6 calli 8011fa4 dest += to_copy; 800f910: b6 0d 78 00 add r15,r16,r13 block++; 800f914: 35 ce 00 01 addi r14,r14,1 my_length -= to_copy; 800f918: c9 6d 58 00 sub r11,r11,r13 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 800f91c: 78 01 08 01 mvhi r1,0x801 800f920: 38 21 96 d8 ori r1,r1,0x96d8 800f924: 28 30 00 00 lw r16,(r1+0) while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800f928: b8 20 88 00 mv r17,r1 800f92c: e0 00 00 0f bi 800f968 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800f930: b9 c0 10 00 mv r2,r14 800f934: b9 80 08 00 mv r1,r12 800f938: 34 03 00 00 mvi r3,0 800f93c: fb ff fe f9 calli 800f520 800f940: b8 20 10 00 mv r2,r1 if ( !block_ptr ) 800f944: 44 20 00 1c be r1,r0,800f9b4 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 800f948: 28 42 00 00 lw r2,(r2+0) 800f94c: b9 e0 08 00 mv r1,r15 800f950: ba 00 18 00 mv r3,r16 800f954: f8 00 09 94 calli 8011fa4 dest += to_copy; 800f958: b5 f0 78 00 add r15,r15,r16 block++; 800f95c: 35 ce 00 01 addi r14,r14,1 my_length -= to_copy; 800f960: c9 70 58 00 sub r11,r11,r16 copied += to_copy; 800f964: b5 b0 68 00 add r13,r13,r16 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800f968: 2a 21 00 00 lw r1,(r17+0) 800f96c: 51 61 ff f1 bgeu r11,r1,800f930 #if defined(RTEMS_DEBUG) assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); #endif if ( my_length ) { 800f970: 45 60 00 0c be r11,r0,800f9a0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800f974: b9 c0 10 00 mv r2,r14 800f978: b9 80 08 00 mv r1,r12 800f97c: 34 03 00 00 mvi r3,0 800f980: fb ff fe e8 calli 800f520 800f984: b8 20 10 00 mv r2,r1 if ( !block_ptr ) 800f988: 44 20 00 0b be r1,r0,800f9b4 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); 800f98c: 28 42 00 00 lw r2,(r2+0) 800f990: b9 e0 08 00 mv r1,r15 800f994: b9 60 18 00 mv r3,r11 800f998: f8 00 09 83 calli 8011fa4 copied += my_length; 800f99c: b5 6d 68 00 add r13,r11,r13 } IMFS_update_atime( the_jnode ); 800f9a0: 37 81 00 28 addi r1,sp,40 800f9a4: 34 02 00 00 mvi r2,0 800f9a8: fb ff cb 97 calli 8002804 800f9ac: 2b 81 00 28 lw r1,(sp+40) 800f9b0: 59 81 00 40 sw (r12+64),r1 return copied; 800f9b4: b9 a0 20 00 mv r4,r13 } 800f9b8: b8 80 08 00 mv r1,r4 800f9bc: 2b 9d 00 04 lw ra,(sp+4) 800f9c0: 2b 8b 00 24 lw r11,(sp+36) 800f9c4: 2b 8c 00 20 lw r12,(sp+32) 800f9c8: 2b 8d 00 1c lw r13,(sp+28) 800f9cc: 2b 8e 00 18 lw r14,(sp+24) 800f9d0: 2b 8f 00 14 lw r15,(sp+20) 800f9d4: 2b 90 00 10 lw r16,(sp+16) 800f9d8: 2b 91 00 0c lw r17,(sp+12) 800f9dc: 2b 92 00 08 lw r18,(sp+8) 800f9e0: 37 9c 00 2c addi sp,sp,44 800f9e4: c3 a0 00 00 ret =============================================================================== 0800fb0c : */ int IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { 800fb0c: 37 9c ff e0 addi sp,sp,-32 800fb10: 5b 8b 00 20 sw (sp+32),r11 800fb14: 5b 8c 00 1c sw (sp+28),r12 800fb18: 5b 8d 00 18 sw (sp+24),r13 800fb1c: 5b 8e 00 14 sw (sp+20),r14 800fb20: 5b 8f 00 10 sw (sp+16),r15 800fb24: 5b 90 00 0c sw (sp+12),r16 800fb28: 5b 91 00 08 sw (sp+8),r17 800fb2c: 5b 9d 00 04 sw (sp+4),ra 800fb30: b8 20 58 00 mv r11,r1 /* * 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; 800fb34: 78 01 08 01 mvhi r1,0x801 800fb38: 38 21 96 d8 ori r1,r1,0x96d8 800fb3c: 28 21 00 00 lw r1,(r1+0) 800fb40: 34 02 00 02 mvi r2,2 800fb44: f8 00 1d 31 calli 8017008 <__lshrsi3> 800fb48: b8 20 60 00 mv r12,r1 * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 800fb4c: 29 61 00 58 lw r1,(r11+88) 800fb50: 44 20 00 04 be r1,r0,800fb60 memfile_free_blocks_in_table( &info->indirect, to_free ); 800fb54: 35 61 00 58 addi r1,r11,88 800fb58: b9 80 10 00 mv r2,r12 800fb5c: fb ff ff cf calli 800fa98 } if ( info->doubly_indirect ) { 800fb60: 29 61 00 5c lw r1,(r11+92) 800fb64: 44 20 00 15 be r1,r0,800fbb8 <== ALWAYS TAKEN for ( i=0 ; iindirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { 800fb6c: 34 0f 00 00 mvi r15,0 <== NOT EXECUTED 800fb70: 34 0e 00 00 mvi r14,0 <== NOT EXECUTED for ( i=0 ; i <== NOT EXECUTED if ( info->doubly_indirect[i] ) { 800fb7c: 29 61 00 5c lw r1,(r11+92) <== NOT EXECUTED 800fb80: b4 2f 08 00 add r1,r1,r15 <== NOT EXECUTED 800fb84: 28 22 00 00 lw r2,(r1+0) <== NOT EXECUTED 800fb88: 44 40 00 03 be r2,r0,800fb94 <== NOT EXECUTED memfile_free_blocks_in_table( 800fb8c: b9 80 10 00 mv r2,r12 <== NOT EXECUTED 800fb90: fb ff ff c2 calli 800fa98 <== NOT EXECUTED memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; i <== NOT EXECUTED 800fba8: 54 2e ff f5 bgu r1,r14,800fb7c <== 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 ); 800fbac: 35 61 00 5c addi r1,r11,92 <== NOT EXECUTED 800fbb0: b9 80 10 00 mv r2,r12 <== NOT EXECUTED 800fbb4: fb ff ff b9 calli 800fa98 <== NOT EXECUTED } if ( info->triply_indirect ) { 800fbb8: 29 61 00 60 lw r1,(r11+96) 800fbbc: 44 20 00 24 be r1,r0,800fc4c <== ALWAYS TAKEN for ( i=0 ; idoubly_indirect, to_free ); } if ( info->triply_indirect ) { 800fbc4: 34 0f 00 00 mvi r15,0 <== NOT EXECUTED 800fbc8: 34 10 00 00 mvi r16,0 <== NOT EXECUTED for ( i=0 ; i <== NOT EXECUTED p = (block_p *) info->triply_indirect[i]; 800fbd4: 29 61 00 60 lw r1,(r11+96) <== NOT EXECUTED 800fbd8: b4 2f 08 00 add r1,r1,r15 <== NOT EXECUTED 800fbdc: 28 2d 00 00 lw r13,(r1+0) <== NOT EXECUTED if ( !p ) /* ensure we have a valid pointer */ 800fbe0: 45 a0 00 18 be r13,r0,800fc40 <== NOT EXECUTED 800fbe4: 34 11 00 00 mvi r17,0 <== NOT EXECUTED 800fbe8: e0 00 00 08 bi 800fc08 <== NOT EXECUTED break; for ( j=0 ; j <== NOT EXECUTED memfile_free_blocks_in_table( (block_p **)&p[j], to_free); 800fbf4: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 800fbf8: b9 80 10 00 mv r2,r12 <== NOT EXECUTED 800fbfc: fb ff ff a7 calli 800fa98 <== NOT EXECUTED if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j <== NOT EXECUTED 800fc14: 54 31 ff f6 bgu r1,r17,800fbec <== NOT EXECUTED if ( p[j] ) { memfile_free_blocks_in_table( (block_p **)&p[j], to_free); } } memfile_free_blocks_in_table( 800fc18: 29 61 00 60 lw r1,(r11+96) <== NOT EXECUTED 800fc1c: b9 80 10 00 mv r2,r12 <== NOT EXECUTED memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i <== NOT EXECUTED memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i <== NOT EXECUTED 800fc3c: 54 30 ff e6 bgu r1,r16,800fbd4 <== NOT EXECUTED } } memfile_free_blocks_in_table( (block_p **)&info->triply_indirect[i], to_free ); } memfile_free_blocks_in_table( 800fc40: 35 61 00 60 addi r1,r11,96 <== NOT EXECUTED 800fc44: b9 80 10 00 mv r2,r12 <== NOT EXECUTED 800fc48: fb ff ff 94 calli 800fa98 <== NOT EXECUTED (block_p **)&info->triply_indirect, to_free ); } return 0; } 800fc4c: 34 01 00 00 mvi r1,0 800fc50: 2b 9d 00 04 lw ra,(sp+4) 800fc54: 2b 8b 00 20 lw r11,(sp+32) 800fc58: 2b 8c 00 1c lw r12,(sp+28) 800fc5c: 2b 8d 00 18 lw r13,(sp+24) 800fc60: 2b 8e 00 14 lw r14,(sp+20) 800fc64: 2b 8f 00 10 lw r15,(sp+16) 800fc68: 2b 90 00 0c lw r16,(sp+12) 800fc6c: 2b 91 00 08 lw r17,(sp+8) 800fc70: 37 9c 00 20 addi sp,sp,32 800fc74: c3 a0 00 00 ret =============================================================================== 0800fc78 : MEMFILE_STATIC int IMFS_memfile_remove_block( IMFS_jnode_t *the_jnode, unsigned int block ) { 800fc78: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 800fc7c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED block_p *block_ptr; block_p ptr; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800fc80: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 800fc84: fb ff fe 27 calli 800f520 <== NOT EXECUTED #if defined(RTEMS_DEBUG) assert( block_ptr ); #endif if ( block_ptr ) { 800fc88: 44 20 00 05 be r1,r0,800fc9c <== NOT EXECUTED ptr = *block_ptr; 800fc8c: 28 22 00 00 lw r2,(r1+0) <== NOT EXECUTED *block_ptr = 0; 800fc90: 58 20 00 00 sw (r1+0),r0 <== NOT EXECUTED memfile_free_block( ptr ); 800fc94: b8 40 08 00 mv r1,r2 <== NOT EXECUTED 800fc98: fb ff ff 75 calli 800fa6c <== NOT EXECUTED } return 1; } 800fc9c: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 800fca0: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800fca4: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 800fca8: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 0800fe04 : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 800fe04: 37 9c ff d0 addi sp,sp,-48 800fe08: 5b 8b 00 28 sw (sp+40),r11 800fe0c: 5b 8c 00 24 sw (sp+36),r12 800fe10: 5b 8d 00 20 sw (sp+32),r13 800fe14: 5b 8e 00 1c sw (sp+28),r14 800fe18: 5b 8f 00 18 sw (sp+24),r15 800fe1c: 5b 90 00 14 sw (sp+20),r16 800fe20: 5b 91 00 10 sw (sp+16),r17 800fe24: 5b 92 00 0c sw (sp+12),r18 800fe28: 5b 93 00 08 sw (sp+8),r19 800fe2c: 5b 9d 00 04 sw (sp+4),ra 800fe30: b8 20 60 00 mv r12,r1 800fe34: b8 40 58 00 mv r11,r2 800fe38: b8 60 88 00 mv r17,r3 800fe3c: b8 80 78 00 mv r15,r4 /* * Error check arguments */ if ( !source ) 800fe40: 44 60 00 02 be r3,r0,800fe48 <== NEVER TAKEN /* * If there is nothing to write, then quick exit. */ my_length = length; if ( !my_length ) 800fe44: 5c 80 00 04 bne r4,r0,800fe54 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 800fe48: f8 00 05 a1 calli 80114cc <__errno> <== NOT EXECUTED 800fe4c: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 800fe50: e0 00 00 0d bi 800fe84 <== NOT EXECUTED * 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 ) { 800fe54: 28 21 00 50 lw r1,(r1+80) /* * 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; 800fe58: b4 82 10 00 add r2,r4,r2 if ( last_byte > the_jnode->info.file.size ) { 800fe5c: 48 01 00 05 bg r0,r1,800fe70 <== NEVER TAKEN 800fe60: 5c 20 00 0c bne r1,r0,800fe90 <== NEVER TAKEN 800fe64: 29 81 00 54 lw r1,(r12+84) 800fe68: 54 41 00 02 bgu r2,r1,800fe70 <== ALWAYS TAKEN 800fe6c: e0 00 00 09 bi 800fe90 <== NOT EXECUTED status = IMFS_memfile_extend( the_jnode, last_byte ); 800fe70: b9 80 08 00 mv r1,r12 800fe74: fb ff ff 8e calli 800fcac if ( status ) 800fe78: 44 20 00 06 be r1,r0,800fe90 rtems_set_errno_and_return_minus_one( ENOSPC ); 800fe7c: f8 00 05 94 calli 80114cc <__errno> 800fe80: 34 02 00 1c mvi r2,28 800fe84: 58 22 00 00 sw (r1+0),r2 800fe88: 34 0b ff ff mvi r11,-1 800fe8c: e0 00 00 45 bi 800ffa0 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800fe90: 78 01 08 01 mvhi r1,0x801 800fe94: 38 21 96 d8 ori r1,r1,0x96d8 800fe98: 28 33 00 00 lw r19,(r1+0) 800fe9c: b9 60 08 00 mv r1,r11 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { 800fea0: ba 20 80 00 mv r16,r17 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800fea4: ba 60 10 00 mv r2,r19 800fea8: f8 00 1c bb calli 8017194 <__modsi3> 800feac: b8 20 90 00 mv r18,r1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 800feb0: ba 60 10 00 mv r2,r19 800feb4: b9 60 08 00 mv r1,r11 800feb8: f8 00 1c 87 calli 80170d4 <__divsi3> 800febc: b8 20 70 00 mv r14,r1 if ( start_offset ) { 800fec0: b9 e0 68 00 mv r13,r15 status = IMFS_memfile_extend( the_jnode, last_byte ); if ( status ) rtems_set_errno_and_return_minus_one( ENOSPC ); } copied = 0; 800fec4: 34 0b 00 00 mvi r11,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; if ( start_offset ) { 800fec8: 46 40 00 11 be r18,r0,800ff0c 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 ); 800fecc: b9 80 08 00 mv r1,r12 800fed0: b9 c0 10 00 mv r2,r14 800fed4: 34 03 00 00 mvi r3,0 800fed8: fb ff fd 92 calli 800f520 if ( !block_ptr ) 800fedc: 44 20 00 31 be r1,r0,800ffa0 <== NEVER TAKEN */ 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; 800fee0: ca 72 58 00 sub r11,r19,r18 800fee4: 51 eb 00 02 bgeu r15,r11,800feec 800fee8: b9 e0 58 00 mv r11,r15 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); 800feec: 28 21 00 00 lw r1,(r1+0) 800fef0: ba 20 10 00 mv r2,r17 800fef4: b9 60 18 00 mv r3,r11 800fef8: b4 32 08 00 add r1,r1,r18 800fefc: f8 00 08 2a calli 8011fa4 src += to_copy; 800ff00: b6 2b 80 00 add r16,r17,r11 block++; 800ff04: 35 ce 00 01 addi r14,r14,1 my_length -= to_copy; 800ff08: c9 eb 68 00 sub r13,r15,r11 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 800ff0c: 78 01 08 01 mvhi r1,0x801 800ff10: 38 21 96 d8 ori r1,r1,0x96d8 800ff14: 28 2f 00 00 lw r15,(r1+0) while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800ff18: b8 20 88 00 mv r17,r1 800ff1c: e0 00 00 0e bi 800ff54 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800ff20: b9 80 08 00 mv r1,r12 800ff24: b9 c0 10 00 mv r2,r14 800ff28: 34 03 00 00 mvi r3,0 800ff2c: fb ff fd 7d calli 800f520 if ( !block_ptr ) 800ff30: 44 20 00 1c be r1,r0,800ffa0 <== NEVER TAKEN 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 ); 800ff34: 28 21 00 00 lw r1,(r1+0) 800ff38: ba 00 10 00 mv r2,r16 800ff3c: b9 e0 18 00 mv r3,r15 800ff40: f8 00 08 19 calli 8011fa4 src += to_copy; 800ff44: b6 0f 80 00 add r16,r16,r15 block++; 800ff48: 35 ce 00 01 addi r14,r14,1 my_length -= to_copy; 800ff4c: c9 af 68 00 sub r13,r13,r15 * * 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( 800ff50: b5 6f 58 00 add r11,r11,r15 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800ff54: 2a 21 00 00 lw r1,(r17+0) 800ff58: 51 a1 ff f2 bgeu r13,r1,800ff20 #if defined(RTEMS_DEBUG) assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); #endif to_copy = my_length; if ( my_length ) { 800ff5c: 45 a0 00 0b be r13,r0,800ff88 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800ff60: b9 80 08 00 mv r1,r12 800ff64: b9 c0 10 00 mv r2,r14 800ff68: 34 03 00 00 mvi r3,0 800ff6c: fb ff fd 6d calli 800f520 if ( !block_ptr ) 800ff70: 44 20 00 0c be r1,r0,800ffa0 <== NEVER TAKEN 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 ); 800ff74: 28 21 00 00 lw r1,(r1+0) 800ff78: ba 00 10 00 mv r2,r16 800ff7c: b9 a0 18 00 mv r3,r13 800ff80: f8 00 08 09 calli 8011fa4 my_length = 0; copied += to_copy; 800ff84: b5 6d 58 00 add r11,r11,r13 } IMFS_mtime_ctime_update( the_jnode ); 800ff88: 37 81 00 2c addi r1,sp,44 800ff8c: 34 02 00 00 mvi r2,0 800ff90: fb ff ca 1d calli 8002804 800ff94: 2b 81 00 2c lw r1,(sp+44) 800ff98: 59 81 00 44 sw (r12+68),r1 800ff9c: 59 81 00 48 sw (r12+72),r1 return copied; } 800ffa0: b9 60 08 00 mv r1,r11 800ffa4: 2b 9d 00 04 lw ra,(sp+4) 800ffa8: 2b 8b 00 28 lw r11,(sp+40) 800ffac: 2b 8c 00 24 lw r12,(sp+36) 800ffb0: 2b 8d 00 20 lw r13,(sp+32) 800ffb4: 2b 8e 00 1c lw r14,(sp+28) 800ffb8: 2b 8f 00 18 lw r15,(sp+24) 800ffbc: 2b 90 00 14 lw r16,(sp+20) 800ffc0: 2b 91 00 10 lw r17,(sp+16) 800ffc4: 2b 92 00 0c lw r18,(sp+12) 800ffc8: 2b 93 00 08 lw r19,(sp+8) 800ffcc: 37 9c 00 30 addi sp,sp,48 800ffd0: c3 a0 00 00 ret =============================================================================== 08001e20 : const char *token, /* IN */ mode_t mode, /* IN */ dev_t dev, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { 8001e20: 37 9c ff a8 addi sp,sp,-88 8001e24: 5b 8b 00 18 sw (sp+24),r11 8001e28: 5b 8c 00 14 sw (sp+20),r12 8001e2c: 5b 8d 00 10 sw (sp+16),r13 8001e30: 5b 8e 00 0c sw (sp+12),r14 8001e34: 5b 8f 00 08 sw (sp+8),r15 8001e38: 5b 9d 00 04 sw (sp+4),ra 8001e3c: b8 40 58 00 mv r11,r2 8001e40: b8 20 78 00 mv r15,r1 8001e44: b8 60 70 00 mv r14,r3 8001e48: b8 80 68 00 mv r13,r4 8001e4c: b8 a0 60 00 mv r12,r5 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 ); 8001e50: f8 00 42 0b calli 801267c 8001e54: b8 20 10 00 mv r2,r1 8001e58: 37 83 00 1c addi r3,sp,28 8001e5c: b9 e0 08 00 mv r1,r15 8001e60: 37 84 00 58 addi r4,sp,88 8001e64: f8 00 28 55 calli 800bfb8 /* * Figure out what type of IMFS node this is. */ if ( S_ISDIR(mode) ) 8001e68: 21 66 f0 00 andi r6,r11,0xf000 8001e6c: 34 01 40 00 mvi r1,16384 8001e70: 44 c1 00 11 be r6,r1,8001eb4 type = IMFS_DIRECTORY; else if ( S_ISREG(mode) ) 8001e74: 34 21 40 00 addi r1,r1,16384 8001e78: 44 c1 00 11 be r6,r1,8001ebc type = IMFS_MEMORY_FILE; else if ( S_ISBLK(mode) || S_ISCHR(mode) ) { 8001e7c: 64 c2 20 00 cmpei r2,r6,8192 8001e80: 64 c1 60 00 cmpei r1,r6,24576 8001e84: b8 41 08 00 or r1,r2,r1 8001e88: 44 20 00 05 be r1,r0,8001e9c type = IMFS_DEVICE; rtems_filesystem_split_dev_t( dev, info.device.major, info.device.minor ); 8001e8c: 5b 8e 00 40 sw (sp+64),r14 8001e90: 5b 8d 00 44 sw (sp+68),r13 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; 8001e94: 34 02 00 02 mvi r2,2 8001e98: e0 00 00 0a bi 8001ec0 rtems_filesystem_split_dev_t( dev, info.device.major, info.device.minor ); } else if (S_ISFIFO(mode)) 8001e9c: 34 01 10 00 mvi r1,4096 type = IMFS_FIFO; 8001ea0: 34 02 00 07 mvi r2,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)) 8001ea4: 44 c1 00 07 be r6,r1,8001ec0 <== ALWAYS TAKEN type = IMFS_FIFO; else { rtems_set_errno_and_return_minus_one( EINVAL ); 8001ea8: f8 00 3d 89 calli 80114cc <__errno> <== NOT EXECUTED 8001eac: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8001eb0: e0 00 00 0d bi 8001ee4 <== NOT EXECUTED /* * Figure out what type of IMFS node this is. */ if ( S_ISDIR(mode) ) type = IMFS_DIRECTORY; 8001eb4: 34 02 00 01 mvi r2,1 8001eb8: e0 00 00 02 bi 8001ec0 else if ( S_ISREG(mode) ) type = IMFS_MEMORY_FILE; 8001ebc: 34 02 00 05 mvi r2,5 * 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( 8001ec0: b9 80 08 00 mv r1,r12 8001ec4: 37 83 00 1c addi r3,sp,28 8001ec8: b9 60 20 00 mv r4,r11 8001ecc: 37 85 00 40 addi r5,sp,64 8001ed0: f8 00 25 36 calli 800b3a8 ); if ( !new_node ) rtems_set_errno_and_return_minus_one( ENOMEM ); return 0; 8001ed4: 34 02 00 00 mvi r2,0 new_name, mode, &info ); if ( !new_node ) 8001ed8: 5c 20 00 05 bne r1,r0,8001eec rtems_set_errno_and_return_minus_one( ENOMEM ); 8001edc: f8 00 3d 7c calli 80114cc <__errno> 8001ee0: 34 02 00 0c mvi r2,12 8001ee4: 58 22 00 00 sw (r1+0),r2 8001ee8: 34 02 ff ff mvi r2,-1 return 0; } 8001eec: b8 40 08 00 mv r1,r2 8001ef0: 2b 9d 00 04 lw ra,(sp+4) 8001ef4: 2b 8b 00 18 lw r11,(sp+24) 8001ef8: 2b 8c 00 14 lw r12,(sp+20) 8001efc: 2b 8d 00 10 lw r13,(sp+16) 8001f00: 2b 8e 00 0c lw r14,(sp+12) 8001f04: 2b 8f 00 08 lw r15,(sp+8) 8001f08: 37 9c 00 58 addi sp,sp,88 8001f0c: c3 a0 00 00 ret =============================================================================== 08001f10 : #include int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 8001f10: 37 9c ff fc addi sp,sp,-4 8001f14: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *node; node = mt_entry->mt_point_node.node_access; 8001f18: 28 22 00 08 lw r2,(r1+8) /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) 8001f1c: 34 03 00 01 mvi r3,1 8001f20: 28 44 00 4c lw r4,(r2+76) 8001f24: 44 83 00 06 be r4,r3,8001f3c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOTDIR ); 8001f28: f8 00 3d 69 calli 80114cc <__errno> <== NOT EXECUTED 8001f2c: 34 02 00 14 mvi r2,20 <== NOT EXECUTED 8001f30: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8001f34: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8001f38: e0 00 00 03 bi 8001f44 <== NOT EXECUTED /* * Set mt_fs pointer to point to the mount table entry for * the mounted file system. */ node->info.directory.mt_fs = mt_entry; 8001f3c: 58 41 00 5c sw (r2+92),r1 return 0; 8001f40: 34 01 00 00 mvi r1,0 } 8001f44: 2b 9d 00 04 lw ra,(sp+4) 8001f48: 37 9c 00 04 addi sp,sp,4 8001f4c: c3 a0 00 00 ret =============================================================================== 08002d58 : */ void IMFS_print_jnode( IMFS_jnode_t *the_jnode ) { 8002d58: 37 9c ff f0 addi sp,sp,-16 8002d5c: 5b 8b 00 10 sw (sp+16),r11 8002d60: 5b 8c 00 0c sw (sp+12),r12 8002d64: 5b 8d 00 08 sw (sp+8),r13 8002d68: 5b 9d 00 04 sw (sp+4),ra #if defined(RTEMS_DEBUG) assert( the_jnode ); #endif fprintf(stdout, "%s", the_jnode->name ); 8002d6c: 78 0c 08 02 mvhi r12,0x802 8002d70: 39 8c 61 b8 ori r12,r12,0x61b8 8002d74: 29 82 00 00 lw r2,(r12+0) */ void IMFS_print_jnode( IMFS_jnode_t *the_jnode ) { 8002d78: b8 20 58 00 mv r11,r1 #if defined(RTEMS_DEBUG) assert( the_jnode ); #endif fprintf(stdout, "%s", the_jnode->name ); 8002d7c: 34 21 00 0c addi r1,r1,12 8002d80: 28 42 00 08 lw r2,(r2+8) 8002d84: f8 00 37 b2 calli 8010c4c switch( the_jnode->type ) { 8002d88: 29 63 00 4c lw r3,(r11+76) 8002d8c: 34 02 00 06 mvi r2,6 8002d90: 34 61 ff ff addi r1,r3,-1 8002d94: 54 22 00 2d bgu r1,r2,8002e48 <== NEVER TAKEN 8002d98: 78 0d 08 02 mvhi r13,0x802 8002d9c: 34 02 00 02 mvi r2,2 8002da0: f8 00 7d 20 calli 8022220 <__ashlsi3> 8002da4: 39 ad 3f 8c ori r13,r13,0x3f8c 8002da8: b5 a1 08 00 add r1,r13,r1 8002dac: 28 21 00 00 lw r1,(r1+0) 8002db0: c0 20 00 00 b r1 case IMFS_DIRECTORY: fprintf(stdout, "/" ); 8002db4: 29 82 00 00 lw r2,(r12+0) 8002db8: 34 01 00 2f mvi r1,47 8002dbc: 28 42 00 08 lw r2,(r2+8) 8002dc0: f8 00 37 5f calli 8010b3c break; 8002dc4: e0 00 00 27 bi 8002e60 case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 8002dc8: 29 81 00 00 lw r1,(r12+0) 8002dcc: 78 02 08 02 mvhi r2,0x802 8002dd0: 38 42 3e a4 ori r2,r2,0x3ea4 8002dd4: 28 21 00 08 lw r1,(r1+8) 8002dd8: 29 63 00 50 lw r3,(r11+80) 8002ddc: 29 64 00 54 lw r4,(r11+84) 8002de0: e0 00 00 07 bi 8002dfc the_jnode->info.device.major, the_jnode->info.device.minor ); break; case IMFS_LINEAR_FILE: fprintf(stdout, " (file %" PRId32 " %p)", 8002de4: 29 81 00 00 lw r1,(r12+0) <== NOT EXECUTED 8002de8: 29 63 00 54 lw r3,(r11+84) <== NOT EXECUTED 8002dec: 29 64 00 58 lw r4,(r11+88) <== NOT EXECUTED 8002df0: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED 8002df4: 78 02 08 02 mvhi r2,0x802 <== NOT EXECUTED 8002df8: 38 42 3e b8 ori r2,r2,0x3eb8 <== NOT EXECUTED 8002dfc: f8 00 37 29 calli 8010aa0 (uint32_t)the_jnode->info.linearfile.size, the_jnode->info.linearfile.direct ); break; 8002e00: e0 00 00 18 bi 8002e60 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 8002e04: 29 81 00 00 lw r1,(r12+0) 8002e08: 29 63 00 54 lw r3,(r11+84) 8002e0c: 78 02 08 02 mvhi r2,0x802 8002e10: 28 21 00 08 lw r1,(r1+8) 8002e14: 38 42 3e c8 ori r2,r2,0x3ec8 8002e18: f8 00 37 22 calli 8010aa0 (uint32_t)the_jnode->info.file.size ); #endif break; 8002e1c: e0 00 00 11 bi 8002e60 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 8002e20: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 8002e24: 29 82 00 00 lw r2,(r12+0) <== NOT EXECUTED 8002e28: 38 21 3e d4 ori r1,r1,0x3ed4 <== NOT EXECUTED 8002e2c: e0 00 00 04 bi 8002e3c <== NOT EXECUTED return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 8002e30: 29 82 00 00 lw r2,(r12+0) <== NOT EXECUTED 8002e34: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 8002e38: 38 21 3e e8 ori r1,r1,0x3ee8 <== NOT EXECUTED 8002e3c: 28 42 00 08 lw r2,(r2+8) <== NOT EXECUTED 8002e40: f8 00 37 83 calli 8010c4c <== NOT EXECUTED return; 8002e44: e0 00 00 0a bi 8002e6c <== NOT EXECUTED default: fprintf(stdout, " bad type %d\n", the_jnode->type ); 8002e48: 29 81 00 00 lw r1,(r12+0) <== NOT EXECUTED 8002e4c: 78 02 08 02 mvhi r2,0x802 <== NOT EXECUTED 8002e50: 38 42 3e fc ori r2,r2,0x3efc <== NOT EXECUTED 8002e54: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED 8002e58: f8 00 37 12 calli 8010aa0 <== NOT EXECUTED return; 8002e5c: e0 00 00 04 bi 8002e6c <== NOT EXECUTED } puts(""); 8002e60: 78 01 08 02 mvhi r1,0x802 8002e64: 38 21 3a 5c ori r1,r1,0x3a5c 8002e68: f8 00 3f 12 calli 8012ab0 } 8002e6c: 2b 9d 00 04 lw ra,(sp+4) 8002e70: 2b 8b 00 10 lw r11,(sp+16) 8002e74: 2b 8c 00 0c lw r12,(sp+12) 8002e78: 2b 8d 00 08 lw r13,(sp+8) 8002e7c: 37 9c 00 10 addi sp,sp,16 8002e80: c3 a0 00 00 ret =============================================================================== 08001f5c : int IMFS_readlink( rtems_filesystem_location_info_t *loc, char *buf, /* OUT */ size_t bufsize ) { 8001f5c: 37 9c ff fc addi sp,sp,-4 8001f60: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *node; int i; node = loc->node_access; 8001f64: 28 24 00 00 lw r4,(r1+0) if ( node->type != IMFS_SYM_LINK ) 8001f68: 34 01 00 04 mvi r1,4 8001f6c: 28 85 00 4c lw r5,(r4+76) 8001f70: 5c a1 00 03 bne r5,r1,8001f7c <== NEVER TAKEN 8001f74: 34 01 00 00 mvi r1,0 8001f78: e0 00 00 09 bi 8001f9c rtems_set_errno_and_return_minus_one( EINVAL ); 8001f7c: f8 00 3d 54 calli 80114cc <__errno> <== NOT EXECUTED 8001f80: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8001f84: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8001f88: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8001f8c: e0 00 00 09 bi 8001fb0 <== NOT EXECUTED #include #include "imfs.h" #include #include int IMFS_readlink( 8001f90: b4 41 30 00 add r6,r2,r1 if ( node->type != IMFS_SYM_LINK ) rtems_set_errno_and_return_minus_one( EINVAL ); for( i=0; ((iinfo.sym_link.name[i] != '\0')); i++ ) buf[i] = node->info.sym_link.name[i]; 8001f94: 30 c5 00 00 sb (r6+0),r5 node = loc->node_access; if ( node->type != IMFS_SYM_LINK ) rtems_set_errno_and_return_minus_one( EINVAL ); for( i=0; ((iinfo.sym_link.name[i] != '\0')); i++ ) 8001f98: 34 21 00 01 addi r1,r1,1 8001f9c: 50 23 00 05 bgeu r1,r3,8001fb0 8001fa0: 28 85 00 50 lw r5,(r4+80) 8001fa4: b4 a1 28 00 add r5,r5,r1 8001fa8: 40 a5 00 00 lbu r5,(r5+0) 8001fac: 5c a0 ff f9 bne r5,r0,8001f90 buf[i] = node->info.sym_link.name[i]; return i; } 8001fb0: 2b 9d 00 04 lw ra,(sp+4) 8001fb4: 37 9c 00 04 addi sp,sp,4 8001fb8: c3 a0 00 00 ret =============================================================================== 08001fbc : rtems_filesystem_location_info_t *old_parent_loc, /* IN */ rtems_filesystem_location_info_t *old_loc, /* IN */ rtems_filesystem_location_info_t *new_parent_loc, /* IN */ const char *new_name /* IN */ ) { 8001fbc: 37 9c ff ec addi sp,sp,-20 8001fc0: 5b 8b 00 0c sw (sp+12),r11 8001fc4: 5b 8c 00 08 sw (sp+8),r12 8001fc8: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *the_jnode; IMFS_jnode_t *new_parent; the_jnode = old_loc->node_access; 8001fcc: 28 4b 00 00 lw r11,(r2+0) rtems_filesystem_location_info_t *old_parent_loc, /* IN */ rtems_filesystem_location_info_t *old_loc, /* IN */ rtems_filesystem_location_info_t *new_parent_loc, /* IN */ const char *new_name /* IN */ ) { 8001fd0: b8 60 60 00 mv r12,r3 IMFS_jnode_t *the_jnode; IMFS_jnode_t *new_parent; the_jnode = old_loc->node_access; strncpy( the_jnode->name, new_name, IMFS_NAME_MAX ); 8001fd4: b8 80 10 00 mv r2,r4 8001fd8: 35 61 00 0c addi r1,r11,12 8001fdc: 34 03 00 20 mvi r3,32 8001fe0: f8 00 41 d6 calli 8012738 if ( the_jnode->Parent != NULL ) 8001fe4: 29 61 00 08 lw r1,(r11+8) 8001fe8: 44 20 00 03 be r1,r0,8001ff4 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 8001fec: b9 60 08 00 mv r1,r11 8001ff0: f8 00 0a f7 calli 8004bcc <_Chain_Extract> rtems_chain_extract( (rtems_chain_node *) the_jnode ); new_parent = new_parent_loc->node_access; 8001ff4: 29 81 00 00 lw r1,(r12+0) RTEMS_INLINE_ROUTINE void rtems_chain_append( rtems_chain_control *the_chain, rtems_chain_node *the_node ) { _Chain_Append( the_chain, the_node ); 8001ff8: b9 60 10 00 mv r2,r11 the_jnode->Parent = new_parent; 8001ffc: 59 61 00 08 sw (r11+8),r1 8002000: 34 21 00 50 addi r1,r1,80 8002004: f8 00 0a e6 calli 8004b9c <_Chain_Append> rtems_chain_append( &new_parent->info.directory.Entries, &the_jnode->Node ); /* * Update the time. */ IMFS_update_ctime( the_jnode ); 8002008: 37 81 00 10 addi r1,sp,16 800200c: 34 02 00 00 mvi r2,0 8002010: f8 00 01 fd calli 8002804 8002014: 2b 81 00 10 lw r1,(sp+16) 8002018: 59 61 00 48 sw (r11+72),r1 return 0; } 800201c: 34 01 00 00 mvi r1,0 8002020: 2b 9d 00 04 lw ra,(sp+4) 8002024: 2b 8b 00 0c lw r11,(sp+12) 8002028: 2b 8c 00 08 lw r12,(sp+8) 800202c: 37 9c 00 14 addi sp,sp,20 8002030: c3 a0 00 00 ret =============================================================================== 0800c1dc : int IMFS_stat( rtems_filesystem_location_info_t *loc, struct stat *buf ) { 800c1dc: 37 9c ff ec addi sp,sp,-20 800c1e0: 5b 8b 00 14 sw (sp+20),r11 800c1e4: 5b 8c 00 10 sw (sp+16),r12 800c1e8: 5b 8d 00 0c sw (sp+12),r13 800c1ec: 5b 8e 00 08 sw (sp+8),r14 800c1f0: 5b 9d 00 04 sw (sp+4),ra IMFS_fs_info_t *fs_info; IMFS_jnode_t *the_jnode; IMFS_device_t *io; the_jnode = loc->node_access; 800c1f4: 28 2b 00 00 lw r11,(r1+0) int IMFS_stat( rtems_filesystem_location_info_t *loc, struct stat *buf ) { 800c1f8: b8 20 70 00 mv r14,r1 800c1fc: b8 40 60 00 mv r12,r2 IMFS_device_t *io; the_jnode = loc->node_access; switch ( the_jnode->type ) { 800c200: 29 61 00 4c lw r1,(r11+76) 800c204: 34 02 00 05 mvi r2,5 800c208: 34 21 ff fe addi r1,r1,-2 800c20c: 54 22 00 12 bgu r1,r2,800c254 <== NEVER TAKEN 800c210: 78 0d 08 01 mvhi r13,0x801 800c214: 34 02 00 02 mvi r2,2 800c218: f8 00 2b 2e calli 8016ed0 <__ashlsi3> 800c21c: 39 ad 84 24 ori r13,r13,0x8424 800c220: b5 a1 08 00 add r1,r13,r1 800c224: 28 21 00 00 lw r1,(r1+0) 800c228: c0 20 00 00 b r1 case IMFS_DEVICE: io = &the_jnode->info.device; buf->st_rdev = rtems_filesystem_make_dev_t( io->major, io->minor ); 800c22c: 29 61 00 54 lw r1,(r11+84) rtems_device_minor_number _minor ) { union __rtems_dev_t temp; temp.__overlay.major = _major; 800c230: 29 62 00 50 lw r2,(r11+80) 800c234: 59 81 00 1c sw (r12+28),r1 800c238: 59 82 00 18 sw (r12+24),r2 break; 800c23c: e0 00 00 0b bi 800c268 case IMFS_LINEAR_FILE: case IMFS_MEMORY_FILE: buf->st_size = the_jnode->info.file.size; 800c240: 29 61 00 54 lw r1,(r11+84) 800c244: 59 81 00 20 sw (r12+32),r1 break; 800c248: e0 00 00 08 bi 800c268 case IMFS_SYM_LINK: buf->st_size = 0; break; case IMFS_FIFO: buf->st_size = 0; 800c24c: 59 80 00 20 sw (r12+32),r0 break; 800c250: e0 00 00 06 bi 800c268 default: rtems_set_errno_and_return_minus_one( ENOTSUP ); 800c254: f8 00 14 9e calli 80114cc <__errno> <== NOT EXECUTED 800c258: 34 02 00 86 mvi r2,134 <== NOT EXECUTED 800c25c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 800c260: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800c264: e0 00 00 18 bi 800c2c4 <== NOT EXECUTED /* * The device number of the IMFS is the major number and the minor is the * instance. */ fs_info = loc->mt_entry->fs_info; 800c268: 29 c1 00 10 lw r1,(r14+16) buf->st_dev = rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); 800c26c: 28 21 00 34 lw r1,(r1+52) 800c270: 28 22 00 00 lw r2,(r1+0) 800c274: 38 01 ff fe mvu r1,0xfffe /* * 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 = 800c278: 59 81 00 00 sw (r12+0),r1 rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); buf->st_mode = the_jnode->st_mode; 800c27c: 29 61 00 30 lw r1,(r11+48) /* * 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 = 800c280: 59 82 00 04 sw (r12+4),r2 rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); buf->st_mode = the_jnode->st_mode; 800c284: 59 81 00 0c sw (r12+12),r1 buf->st_nlink = the_jnode->st_nlink; 800c288: 2d 61 00 34 lhu r1,(r11+52) 800c28c: 0d 81 00 10 sh (r12+16),r1 buf->st_ino = the_jnode->st_ino; 800c290: 29 61 00 38 lw r1,(r11+56) 800c294: 59 81 00 08 sw (r12+8),r1 buf->st_uid = the_jnode->st_uid; 800c298: 2d 61 00 3c lhu r1,(r11+60) 800c29c: 0d 81 00 12 sh (r12+18),r1 buf->st_gid = the_jnode->st_gid; 800c2a0: 2d 61 00 3e lhu r1,(r11+62) 800c2a4: 0d 81 00 14 sh (r12+20),r1 buf->st_atime = the_jnode->stat_atime; 800c2a8: 29 61 00 40 lw r1,(r11+64) 800c2ac: 59 81 00 24 sw (r12+36),r1 buf->st_mtime = the_jnode->stat_mtime; 800c2b0: 29 61 00 44 lw r1,(r11+68) 800c2b4: 59 81 00 2c sw (r12+44),r1 buf->st_ctime = the_jnode->stat_ctime; 800c2b8: 29 61 00 48 lw r1,(r11+72) 800c2bc: 59 81 00 34 sw (r12+52),r1 return 0; 800c2c0: 34 01 00 00 mvi r1,0 } 800c2c4: 2b 9d 00 04 lw ra,(sp+4) 800c2c8: 2b 8b 00 14 lw r11,(sp+20) 800c2cc: 2b 8c 00 10 lw r12,(sp+16) 800c2d0: 2b 8d 00 0c lw r13,(sp+12) 800c2d4: 2b 8e 00 08 lw r14,(sp+8) 800c2d8: 37 9c 00 14 addi sp,sp,20 800c2dc: c3 a0 00 00 ret =============================================================================== 08002034 : int IMFS_symlink( rtems_filesystem_location_info_t *parent_loc, const char *link_name, const char *node_name ) { 8002034: 37 9c ff ac addi sp,sp,-84 8002038: 5b 8b 00 14 sw (sp+20),r11 800203c: 5b 8c 00 10 sw (sp+16),r12 8002040: 5b 8d 00 0c sw (sp+12),r13 8002044: 5b 8e 00 08 sw (sp+8),r14 8002048: 5b 9d 00 04 sw (sp+4),ra 800204c: b8 20 68 00 mv r13,r1 int i; /* * Remove any separators at the end of the string. */ IMFS_get_token( node_name, strlen( node_name ), new_name, &i ); 8002050: b8 60 08 00 mv r1,r3 int IMFS_symlink( rtems_filesystem_location_info_t *parent_loc, const char *link_name, const char *node_name ) { 8002054: b8 40 70 00 mv r14,r2 8002058: b8 60 60 00 mv r12,r3 int i; /* * Remove any separators at the end of the string. */ IMFS_get_token( node_name, strlen( node_name ), new_name, &i ); 800205c: 37 8b 00 18 addi r11,sp,24 8002060: f8 00 41 87 calli 801267c 8002064: b8 20 10 00 mv r2,r1 8002068: b9 60 18 00 mv r3,r11 800206c: 37 84 00 54 addi r4,sp,84 8002070: b9 80 08 00 mv r1,r12 8002074: f8 00 27 d1 calli 800bfb8 /* * Duplicate link name */ info.sym_link.name = strdup(link_name); 8002078: b9 c0 08 00 mv r1,r14 800207c: f8 00 41 5d calli 80125f0 8002080: 5b 81 00 3c sw (sp+60),r1 if (info.sym_link.name == NULL) { 8002084: 44 20 00 0b be r1,r0,80020b0 <== NEVER TAKEN * 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( 8002088: 34 02 00 04 mvi r2,4 800208c: b9 a0 08 00 mv r1,r13 8002090: b9 60 18 00 mv r3,r11 8002094: 38 04 a1 ff mvu r4,0xa1ff 8002098: 37 85 00 3c addi r5,sp,60 800209c: f8 00 24 c3 calli 800b3a8 if (new_node == NULL) { free(info.sym_link.name); rtems_set_errno_and_return_minus_one(ENOMEM); } return 0; 80020a0: 34 02 00 00 mvi r2,0 new_name, ( S_IFLNK | ( S_IRWXU | S_IRWXG | S_IRWXO )), &info ); if (new_node == NULL) { 80020a4: 5c 20 00 07 bne r1,r0,80020c0 <== ALWAYS TAKEN free(info.sym_link.name); 80020a8: 2b 81 00 3c lw r1,(sp+60) <== NOT EXECUTED 80020ac: f8 00 01 a8 calli 800274c <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOMEM); 80020b0: f8 00 3d 07 calli 80114cc <__errno> <== NOT EXECUTED 80020b4: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 80020b8: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 80020bc: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED } return 0; } 80020c0: b8 40 08 00 mv r1,r2 80020c4: 2b 9d 00 04 lw ra,(sp+4) 80020c8: 2b 8b 00 14 lw r11,(sp+20) 80020cc: 2b 8c 00 10 lw r12,(sp+16) 80020d0: 2b 8d 00 0c lw r13,(sp+12) 80020d4: 2b 8e 00 08 lw r14,(sp+8) 80020d8: 37 9c 00 54 addi sp,sp,84 80020dc: c3 a0 00 00 ret =============================================================================== 080020e0 : int IMFS_unlink( rtems_filesystem_location_info_t *parentloc, /* IN */ rtems_filesystem_location_info_t *loc /* IN */ ) { 80020e0: 37 9c ff d0 addi sp,sp,-48 80020e4: 5b 8b 00 14 sw (sp+20),r11 80020e8: 5b 8c 00 10 sw (sp+16),r12 80020ec: 5b 8d 00 0c sw (sp+12),r13 80020f0: 5b 8e 00 08 sw (sp+8),r14 80020f4: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *node; rtems_filesystem_location_info_t the_link; int result = 0; node = loc->node_access; 80020f8: 28 4c 00 00 lw r12,(r2+0) int IMFS_unlink( rtems_filesystem_location_info_t *parentloc, /* IN */ rtems_filesystem_location_info_t *loc /* IN */ ) { 80020fc: b8 40 58 00 mv r11,r2 8002100: b8 20 68 00 mv r13,r1 /* * If this is the last last pointer to the node * free the node. */ if ( node->type == IMFS_HARD_LINK ) { 8002104: 29 82 00 4c lw r2,(r12+76) 8002108: 34 01 00 03 mvi r1,3 800210c: 5c 41 00 28 bne r2,r1,80021ac if ( !node->info.hard_link.link_node ) 8002110: 29 81 00 50 lw r1,(r12+80) 8002114: 5c 20 00 06 bne r1,r0,800212c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 8002118: f8 00 3c ed calli 80114cc <__errno> <== NOT EXECUTED 800211c: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8002120: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8002124: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8002128: e0 00 00 27 bi 80021c4 <== NOT EXECUTED the_link = *loc; 800212c: 29 64 00 08 lw r4,(r11+8) 8002130: 29 63 00 0c lw r3,(r11+12) 8002134: 29 65 00 04 lw r5,(r11+4) 8002138: 29 62 00 10 lw r2,(r11+16) the_link.node_access = node->info.hard_link.link_node; IMFS_Set_handlers( &the_link ); 800213c: 37 8e 00 18 addi r14,sp,24 if ( !node->info.hard_link.link_node ) rtems_set_errno_and_return_minus_one( EINVAL ); the_link = *loc; the_link.node_access = node->info.hard_link.link_node; 8002140: 5b 81 00 18 sw (sp+24),r1 IMFS_Set_handlers( &the_link ); 8002144: b9 c0 08 00 mv r1,r14 if ( node->type == IMFS_HARD_LINK ) { if ( !node->info.hard_link.link_node ) rtems_set_errno_and_return_minus_one( EINVAL ); the_link = *loc; 8002148: 5b 84 00 20 sw (sp+32),r4 800214c: 5b 83 00 24 sw (sp+36),r3 8002150: 5b 85 00 1c sw (sp+28),r5 8002154: 5b 82 00 28 sw (sp+40),r2 the_link.node_access = node->info.hard_link.link_node; IMFS_Set_handlers( &the_link ); 8002158: f8 00 24 f6 calli 800b530 /* * 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) 800215c: 29 83 00 50 lw r3,(r12+80) 8002160: 34 01 00 01 mvi r1,1 8002164: 2c 64 00 34 lhu r4,(r3+52) 8002168: 5c 81 00 09 bne r4,r1,800218c { result = (*the_link.handlers->rmnod_h)( parentloc, &the_link ); 800216c: 2b 81 00 20 lw r1,(sp+32) 8002170: b9 c0 10 00 mv r2,r14 8002174: 28 23 00 34 lw r3,(r1+52) 8002178: b9 a0 08 00 mv r1,r13 800217c: d8 60 00 00 call r3 if ( result != 0 ) return -1; 8002180: 34 02 ff ff mvi r2,-1 */ if ( node->info.hard_link.link_node->st_nlink == 1) { result = (*the_link.handlers->rmnod_h)( parentloc, &the_link ); if ( result != 0 ) 8002184: 44 20 00 0a be r1,r0,80021ac 8002188: e0 00 00 0f bi 80021c4 return -1; } else { node->info.hard_link.link_node->st_nlink --; 800218c: 34 84 ff ff addi r4,r4,-1 IMFS_update_ctime( node->info.hard_link.link_node ); 8002190: 34 02 00 00 mvi r2,0 if ( result != 0 ) return -1; } else { node->info.hard_link.link_node->st_nlink --; 8002194: 0c 64 00 34 sh (r3+52),r4 IMFS_update_ctime( node->info.hard_link.link_node ); 8002198: 37 81 00 2c addi r1,sp,44 800219c: f8 00 01 9a calli 8002804 80021a0: 29 81 00 50 lw r1,(r12+80) 80021a4: 2b 82 00 2c lw r2,(sp+44) 80021a8: 58 22 00 48 sw (r1+72),r2 /* * Now actually free the node we were asked to free. */ result = (*loc->handlers->rmnod_h)( parentloc, loc ); 80021ac: 29 61 00 08 lw r1,(r11+8) 80021b0: b9 60 10 00 mv r2,r11 80021b4: 28 23 00 34 lw r3,(r1+52) 80021b8: b9 a0 08 00 mv r1,r13 80021bc: d8 60 00 00 call r3 80021c0: b8 20 10 00 mv r2,r1 return result; } 80021c4: b8 40 08 00 mv r1,r2 80021c8: 2b 9d 00 04 lw ra,(sp+4) 80021cc: 2b 8b 00 14 lw r11,(sp+20) 80021d0: 2b 8c 00 10 lw r12,(sp+16) 80021d4: 2b 8d 00 0c lw r13,(sp+12) 80021d8: 2b 8e 00 08 lw r14,(sp+8) 80021dc: 37 9c 00 30 addi sp,sp,48 80021e0: c3 a0 00 00 ret =============================================================================== 080021e4 : #include int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 80021e4: 37 9c ff fc addi sp,sp,-4 80021e8: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *node; node = mt_entry->mt_point_node.node_access; 80021ec: 28 21 00 08 lw r1,(r1+8) /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) 80021f0: 34 02 00 01 mvi r2,1 80021f4: 28 23 00 4c lw r3,(r1+76) 80021f8: 44 62 00 04 be r3,r2,8002208 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOTDIR ); 80021fc: f8 00 3c b4 calli 80114cc <__errno> <== NOT EXECUTED 8002200: 34 02 00 14 mvi r2,20 <== NOT EXECUTED 8002204: e0 00 00 05 bi 8002218 <== NOT EXECUTED /* * Did the node indicate that there was a directory mounted here? */ if ( node->info.directory.mt_fs == NULL ) 8002208: 28 22 00 5c lw r2,(r1+92) 800220c: 5c 40 00 06 bne r2,r0,8002224 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); /* XXX */ 8002210: f8 00 3c af calli 80114cc <__errno> <== NOT EXECUTED 8002214: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8002218: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 800221c: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8002220: e0 00 00 03 bi 800222c <== NOT EXECUTED /* * Set the mt_fs pointer to indicate that there is no longer * a file system mounted to this point. */ node->info.directory.mt_fs = NULL; 8002224: 58 20 00 5c sw (r1+92),r0 return 0; 8002228: 34 01 00 00 mvi r1,0 } 800222c: 2b 9d 00 04 lw ra,(sp+4) 8002230: 37 9c 00 04 addi sp,sp,4 8002234: c3 a0 00 00 ret =============================================================================== 080006a0 : static rtems_printk_plugin_t print_handler; void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 80006a0: 37 9c ff e4 addi sp,sp,-28 80006a4: 5b 8b 00 14 sw (sp+20),r11 80006a8: 5b 8c 00 10 sw (sp+16),r12 80006ac: 5b 8d 00 0c sw (sp+12),r13 80006b0: 5b 8e 00 08 sw (sp+8),r14 80006b4: 5b 9d 00 04 sw (sp+4),ra 80006b8: b8 20 10 00 mv r2,r1 /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { 80006bc: 34 01 ff ff mvi r1,-1 80006c0: 5c 41 00 06 bne r2,r1,80006d8 if (!Stack_check_Interrupt_stack.area) 80006c4: 78 01 08 01 mvhi r1,0x801 80006c8: 38 21 47 40 ori r1,r1,0x4740 80006cc: 28 21 00 04 lw r1,(r1+4) 80006d0: 44 20 00 35 be r1,r0,80007a4 <== ALWAYS TAKEN return; stack = &Stack_check_Interrupt_stack; the_thread = 0; 80006d4: 34 02 00 00 mvi r2,0 <== NOT EXECUTED current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } #endif low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); 80006d8: 78 01 08 01 mvhi r1,0x801 80006dc: 38 21 47 40 ori r1,r1,0x4740 80006e0: 28 2d 00 00 lw r13,(r1+0) 80006e4: 78 03 08 01 mvhi r3,0x801 80006e8: 78 01 08 01 mvhi r1,0x801 80006ec: 35 ad ff f0 addi r13,r13,-16 80006f0: 38 21 46 ac ori r1,r1,0x46ac 80006f4: 38 63 46 a8 ori r3,r3,0x46a8 if ( high_water_mark ) used = Stack_check_Calculate_used( low, size, high_water_mark ); else used = 0; if ( the_thread ) { 80006f8: 44 40 00 0f be r2,r0,8000734 <== NEVER TAKEN (*print_handler)( 80006fc: 28 4b 00 08 lw r11,(r2+8) 8000700: 28 6e 00 00 lw r14,(r3+0) 8000704: 28 2c 00 00 lw r12,(r1+0) 8000708: 37 83 00 18 addi r3,sp,24 800070c: b9 60 08 00 mv r1,r11 8000710: 34 02 00 05 mvi r2,5 8000714: f8 00 08 b3 calli 80029e0 8000718: 78 02 08 01 mvhi r2,0x801 800071c: b8 20 20 00 mv r4,r1 8000720: 38 42 2b 70 ori r2,r2,0x2b70 8000724: b9 c0 08 00 mv r1,r14 8000728: b9 60 18 00 mv r3,r11 800072c: d9 80 00 00 call r12 8000730: e0 00 00 07 bi 800074c "0x%08" PRIx32 " %4s", the_thread->Object.id, rtems_object_get_name( the_thread->Object.id, sizeof(name), name ) ); } else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); 8000734: 28 24 00 00 lw r4,(r1+0) <== NOT EXECUTED 8000738: 28 61 00 00 lw r1,(r3+0) <== NOT EXECUTED 800073c: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8000740: 38 42 2b 80 ori r2,r2,0x2b80 <== NOT EXECUTED 8000744: 34 03 ff ff mvi r3,-1 <== NOT EXECUTED 8000748: d8 80 00 00 call r4 <== NOT EXECUTED (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 800074c: 78 01 08 01 mvhi r1,0x801 8000750: 38 21 47 40 ori r1,r1,0x4740 8000754: 28 24 00 00 lw r4,(r1+0) ); } else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } (*print_handler)( 8000758: 78 0b 08 01 mvhi r11,0x801 800075c: 78 0c 08 01 mvhi r12,0x801 print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 8000760: 28 23 00 04 lw r3,(r1+4) ); } else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } (*print_handler)( 8000764: 39 6b 46 ac ori r11,r11,0x46ac 8000768: 39 8c 46 a8 ori r12,r12,0x46a8 800076c: 29 67 00 00 lw r7,(r11+0) 8000770: 29 81 00 00 lw r1,(r12+0) print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 8000774: 34 84 ff ff addi r4,r4,-1 ); } else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } (*print_handler)( 8000778: 78 02 08 01 mvhi r2,0x801 800077c: 38 42 2b 90 ori r2,r2,0x2b90 8000780: b4 64 20 00 add r4,r3,r4 8000784: 34 05 00 00 mvi r5,0 8000788: b9 a0 30 00 mv r6,r13 800078c: d8 e0 00 00 call r7 current, size ); if (Stack_check_Initialized == 0) { (*print_handler)( print_context, "Unavailable\n" ); 8000790: 29 63 00 00 lw r3,(r11+0) 8000794: 29 81 00 00 lw r1,(r12+0) 8000798: 78 02 08 01 mvhi r2,0x801 800079c: 38 42 2b b0 ori r2,r2,0x2bb0 80007a0: d8 60 00 00 call r3 } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); } } 80007a4: 2b 9d 00 04 lw ra,(sp+4) 80007a8: 2b 8b 00 14 lw r11,(sp+20) 80007ac: 2b 8c 00 10 lw r12,(sp+16) 80007b0: 2b 8d 00 0c lw r13,(sp+12) 80007b4: 2b 8e 00 08 lw r14,(sp+8) 80007b8: 37 9c 00 1c addi sp,sp,28 80007bc: c3 a0 00 00 ret =============================================================================== 080007c0 : Stack_check_Dope_stack(&Stack_check_Interrupt_stack); } #endif Stack_check_Initialized = 1; } 80007c0: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08005d08 <_CORE_RWLock_Obtain_for_reading>: Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { 8005d08: 37 9c ff e4 addi sp,sp,-28 8005d0c: 5b 8b 00 1c sw (sp+28),r11 8005d10: 5b 8c 00 18 sw (sp+24),r12 8005d14: 5b 8d 00 14 sw (sp+20),r13 8005d18: 5b 8e 00 10 sw (sp+16),r14 8005d1c: 5b 8f 00 0c sw (sp+12),r15 8005d20: 5b 90 00 08 sw (sp+8),r16 8005d24: 5b 9d 00 04 sw (sp+4),ra 8005d28: b8 20 58 00 mv r11,r1 ISR_Level level; Thread_Control *executing = _Thread_Executing; 8005d2c: 78 01 08 01 mvhi r1,0x801 8005d30: 38 21 7d 44 ori r1,r1,0x7d44 8005d34: 28 2c 00 0c lw r12,(r1+12) Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { 8005d38: b8 40 78 00 mv r15,r2 8005d3c: b8 80 70 00 mv r14,r4 8005d40: 20 70 00 ff andi r16,r3,0xff * If unlocked, then OK to read. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 8005d44: 90 00 68 00 rcsr r13,IE 8005d48: 34 01 ff fe mvi r1,-2 8005d4c: a1 a1 08 00 and r1,r13,r1 8005d50: d0 01 00 00 wcsr IE,r1 switch ( the_rwlock->current_state ) { 8005d54: 29 61 00 44 lw r1,(r11+68) 8005d58: 44 20 00 04 be r1,r0,8005d68 <_CORE_RWLock_Obtain_for_reading+0x60> 8005d5c: 34 02 00 01 mvi r2,1 8005d60: 5c 22 00 12 bne r1,r2,8005da8 <_CORE_RWLock_Obtain_for_reading+0xa0> 8005d64: e0 00 00 08 bi 8005d84 <_CORE_RWLock_Obtain_for_reading+0x7c> case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 8005d68: 34 01 00 01 mvi r1,1 8005d6c: 59 61 00 44 sw (r11+68),r1 the_rwlock->number_of_readers += 1; 8005d70: 29 61 00 48 lw r1,(r11+72) 8005d74: 34 21 00 01 addi r1,r1,1 8005d78: 59 61 00 48 sw (r11+72),r1 _ISR_Enable( level ); 8005d7c: d0 0d 00 00 wcsr IE,r13 8005d80: e0 00 00 08 bi 8005da0 <_CORE_RWLock_Obtain_for_reading+0x98> executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; return; case CORE_RWLOCK_LOCKED_FOR_READING: { Thread_Control *waiter; waiter = _Thread_queue_First( &the_rwlock->Wait_queue ); 8005d84: b9 60 08 00 mv r1,r11 8005d88: f8 00 08 9f calli 8008004 <_Thread_queue_First> if ( !waiter ) { 8005d8c: 5c 20 00 07 bne r1,r0,8005da8 <_CORE_RWLock_Obtain_for_reading+0xa0><== NEVER TAKEN the_rwlock->number_of_readers += 1; 8005d90: 29 61 00 48 lw r1,(r11+72) 8005d94: 34 21 00 01 addi r1,r1,1 8005d98: 59 61 00 48 sw (r11+72),r1 _ISR_Enable( level ); 8005d9c: d0 0d 00 00 wcsr IE,r13 executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 8005da0: 59 80 00 34 sw (r12+52),r0 return; 8005da4: e0 00 00 12 bi 8005dec <_CORE_RWLock_Obtain_for_reading+0xe4> /* * If the thread is not willing to wait, then return immediately. */ if ( !wait ) { 8005da8: 5e 00 00 05 bne r16,r0,8005dbc <_CORE_RWLock_Obtain_for_reading+0xb4> _ISR_Enable( level ); 8005dac: d0 0d 00 00 wcsr IE,r13 executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 8005db0: 34 01 00 02 mvi r1,2 8005db4: 59 81 00 34 sw (r12+52),r1 return; 8005db8: e0 00 00 0d bi 8005dec <_CORE_RWLock_Obtain_for_reading+0xe4> 8005dbc: 34 01 00 01 mvi r1,1 8005dc0: 59 61 00 30 sw (r11+48),r1 /* * We need to wait to enter this critical section */ _Thread_queue_Enter_critical_section( &the_rwlock->Wait_queue ); executing->Wait.queue = &the_rwlock->Wait_queue; 8005dc4: 59 8b 00 44 sw (r12+68),r11 executing->Wait.id = id; 8005dc8: 59 8f 00 20 sw (r12+32),r15 executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; 8005dcc: 59 80 00 30 sw (r12+48),r0 executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 8005dd0: 59 80 00 34 sw (r12+52),r0 _ISR_Enable( level ); 8005dd4: d0 0d 00 00 wcsr IE,r13 _Thread_queue_Enqueue_with_handler( 8005dd8: 78 03 08 00 mvhi r3,0x800 8005ddc: b9 60 08 00 mv r1,r11 8005de0: b9 c0 10 00 mv r2,r14 8005de4: 38 63 5f 94 ori r3,r3,0x5f94 8005de8: f8 00 07 74 calli 8007bb8 <_Thread_queue_Enqueue_with_handler> timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 8005dec: 2b 9d 00 04 lw ra,(sp+4) 8005df0: 2b 8b 00 1c lw r11,(sp+28) 8005df4: 2b 8c 00 18 lw r12,(sp+24) 8005df8: 2b 8d 00 14 lw r13,(sp+20) 8005dfc: 2b 8e 00 10 lw r14,(sp+16) 8005e00: 2b 8f 00 0c lw r15,(sp+12) 8005e04: 2b 90 00 08 lw r16,(sp+8) 8005e08: 37 9c 00 1c addi sp,sp,28 8005e0c: c3 a0 00 00 ret =============================================================================== 08005ea0 <_CORE_RWLock_Release>: */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 8005ea0: 37 9c ff f4 addi sp,sp,-12 8005ea4: 5b 8b 00 0c sw (sp+12),r11 8005ea8: 5b 8c 00 08 sw (sp+8),r12 8005eac: 5b 9d 00 04 sw (sp+4),ra 8005eb0: b8 20 58 00 mv r11,r1 ISR_Level level; Thread_Control *executing = _Thread_Executing; 8005eb4: 78 01 08 01 mvhi r1,0x801 8005eb8: 38 21 7d 44 ori r1,r1,0x7d44 8005ebc: 28 22 00 0c lw r2,(r1+12) * Otherwise, we have to block. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 8005ec0: 90 00 08 00 rcsr r1,IE 8005ec4: 34 03 ff fe mvi r3,-2 8005ec8: a0 23 18 00 and r3,r1,r3 8005ecc: d0 03 00 00 wcsr IE,r3 if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 8005ed0: 29 63 00 44 lw r3,(r11+68) 8005ed4: 5c 60 00 05 bne r3,r0,8005ee8 <_CORE_RWLock_Release+0x48> _ISR_Enable( level ); 8005ed8: d0 01 00 00 wcsr IE,r1 executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 8005edc: 34 01 00 02 mvi r1,2 8005ee0: 58 41 00 34 sw (r2+52),r1 return CORE_RWLOCK_SUCCESSFUL; 8005ee4: e0 00 00 26 bi 8005f7c <_CORE_RWLock_Release+0xdc> } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 8005ee8: 34 04 00 01 mvi r4,1 8005eec: 5c 64 00 07 bne r3,r4,8005f08 <_CORE_RWLock_Release+0x68> the_rwlock->number_of_readers -= 1; 8005ef0: 29 63 00 48 lw r3,(r11+72) 8005ef4: 34 63 ff ff addi r3,r3,-1 8005ef8: 59 63 00 48 sw (r11+72),r3 if ( the_rwlock->number_of_readers != 0 ) { 8005efc: 44 60 00 03 be r3,r0,8005f08 <_CORE_RWLock_Release+0x68> /* must be unlocked again */ _ISR_Enable( level ); 8005f00: d0 01 00 00 wcsr IE,r1 return CORE_RWLOCK_SUCCESSFUL; 8005f04: e0 00 00 1e bi 8005f7c <_CORE_RWLock_Release+0xdc> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 8005f08: 58 40 00 34 sw (r2+52),r0 /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; 8005f0c: 59 60 00 44 sw (r11+68),r0 _ISR_Enable( level ); 8005f10: d0 01 00 00 wcsr IE,r1 next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 8005f14: b9 60 08 00 mv r1,r11 8005f18: f8 00 06 b7 calli 80079f4 <_Thread_queue_Dequeue> if ( next ) { 8005f1c: 44 20 00 18 be r1,r0,8005f7c <_CORE_RWLock_Release+0xdc> if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 8005f20: 28 22 00 30 lw r2,(r1+48) 8005f24: 34 01 00 01 mvi r1,1 8005f28: 5c 41 00 04 bne r2,r1,8005f38 <_CORE_RWLock_Release+0x98> the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 8005f2c: 34 01 00 02 mvi r1,2 8005f30: 59 61 00 44 sw (r11+68),r1 return CORE_RWLOCK_SUCCESSFUL; 8005f34: e0 00 00 12 bi 8005f7c <_CORE_RWLock_Release+0xdc> } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 8005f38: 29 62 00 48 lw r2,(r11+72) the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 8005f3c: 59 61 00 44 sw (r11+68),r1 /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); if ( !next || 8005f40: 34 0c 00 01 mvi r12,1 } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 8005f44: 34 42 00 01 addi r2,r2,1 8005f48: 59 62 00 48 sw (r11+72),r2 /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 8005f4c: b9 60 08 00 mv r1,r11 8005f50: f8 00 08 2d calli 8008004 <_Thread_queue_First> 8005f54: b8 20 10 00 mv r2,r1 if ( !next || 8005f58: 44 20 00 09 be r1,r0,8005f7c <_CORE_RWLock_Release+0xdc> 8005f5c: 28 21 00 30 lw r1,(r1+48) 8005f60: 44 2c 00 07 be r1,r12,8005f7c <_CORE_RWLock_Release+0xdc> <== NEVER TAKEN next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 8005f64: 29 61 00 48 lw r1,(r11+72) 8005f68: 34 21 00 01 addi r1,r1,1 8005f6c: 59 61 00 48 sw (r11+72),r1 _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 8005f70: b9 60 08 00 mv r1,r11 8005f74: f8 00 07 dc calli 8007ee4 <_Thread_queue_Extract> } 8005f78: e3 ff ff f5 bi 8005f4c <_CORE_RWLock_Release+0xac> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 8005f7c: 34 01 00 00 mvi r1,0 8005f80: 2b 9d 00 04 lw ra,(sp+4) 8005f84: 2b 8b 00 0c lw r11,(sp+12) 8005f88: 2b 8c 00 08 lw r12,(sp+8) 8005f8c: 37 9c 00 0c addi sp,sp,12 8005f90: c3 a0 00 00 ret =============================================================================== 08005f94 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 8005f94: 37 9c ff f8 addi sp,sp,-8 8005f98: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 8005f9c: 37 82 00 08 addi r2,sp,8 8005fa0: f8 00 05 98 calli 8007600 <_Thread_Get> switch ( location ) { 8005fa4: 2b 82 00 08 lw r2,(sp+8) 8005fa8: 5c 40 00 07 bne r2,r0,8005fc4 <_CORE_RWLock_Timeout+0x30> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 8005fac: f8 00 08 7b calli 8008198 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 8005fb0: 78 01 08 01 mvhi r1,0x801 8005fb4: 38 21 78 6c ori r1,r1,0x786c 8005fb8: 28 22 00 00 lw r2,(r1+0) 8005fbc: 34 42 ff ff addi r2,r2,-1 8005fc0: 58 22 00 00 sw (r1+0),r2 _Thread_Unnest_dispatch(); break; } } 8005fc4: 2b 9d 00 04 lw ra,(sp+4) 8005fc8: 37 9c 00 08 addi sp,sp,8 8005fcc: c3 a0 00 00 ret =============================================================================== 08015790 <_CORE_message_queue_Broadcast>: Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { 8015790: 37 9c ff e4 addi sp,sp,-28 8015794: 5b 8b 00 1c sw (sp+28),r11 8015798: 5b 8c 00 18 sw (sp+24),r12 801579c: 5b 8d 00 14 sw (sp+20),r13 80157a0: 5b 8e 00 10 sw (sp+16),r14 80157a4: 5b 8f 00 0c sw (sp+12),r15 80157a8: 5b 90 00 08 sw (sp+8),r16 80157ac: 5b 9d 00 04 sw (sp+4),ra 80157b0: b8 40 80 00 mv r16,r2 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 80157b4: 28 22 00 4c lw r2,(r1+76) Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { 80157b8: b8 20 58 00 mv r11,r1 80157bc: b8 60 68 00 mv r13,r3 80157c0: b8 c0 78 00 mv r15,r6 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; 80157c4: 34 01 00 01 mvi r1,1 { Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 80157c8: 54 62 00 13 bgu r3,r2,8015814 <_CORE_message_queue_Broadcast+0x84><== NEVER TAKEN * 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 ) { 80157cc: 29 61 00 48 lw r1,(r11+72) 80157d0: 34 0c 00 00 mvi r12,0 80157d4: 44 20 00 0a be r1,r0,80157fc <_CORE_message_queue_Broadcast+0x6c> *count = 0; 80157d8: 58 c0 00 00 sw (r6+0),r0 80157dc: e0 00 00 0d bi 8015810 <_CORE_message_queue_Broadcast+0x80> const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 80157e0: 29 c1 00 2c lw r1,(r14+44) 80157e4: ba 00 10 00 mv r2,r16 80157e8: b9 a0 18 00 mv r3,r13 80157ec: f8 00 2a ef calli 80203a8 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 80157f0: 29 c1 00 28 lw r1,(r14+40) */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; 80157f4: 35 8c 00 01 addi r12,r12,1 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 80157f8: 58 2d 00 00 sw (r1+0),r13 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 80157fc: b9 60 08 00 mv r1,r11 8015800: f8 00 0c 67 calli 801899c <_Thread_queue_Dequeue> 8015804: b8 20 70 00 mv r14,r1 8015808: 5c 20 ff f6 bne r1,r0,80157e0 <_CORE_message_queue_Broadcast+0x50> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 801580c: 59 ec 00 00 sw (r15+0),r12 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 8015810: 34 01 00 00 mvi r1,0 } 8015814: 2b 9d 00 04 lw ra,(sp+4) 8015818: 2b 8b 00 1c lw r11,(sp+28) 801581c: 2b 8c 00 18 lw r12,(sp+24) 8015820: 2b 8d 00 14 lw r13,(sp+20) 8015824: 2b 8e 00 10 lw r14,(sp+16) 8015828: 2b 8f 00 0c lw r15,(sp+12) 801582c: 2b 90 00 08 lw r16,(sp+8) 8015830: 37 9c 00 1c addi sp,sp,28 8015834: c3 a0 00 00 ret =============================================================================== 0800db4c <_CORE_message_queue_Initialize>: CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { 800db4c: 37 9c ff e4 addi sp,sp,-28 800db50: 5b 8b 00 1c sw (sp+28),r11 800db54: 5b 8c 00 18 sw (sp+24),r12 800db58: 5b 8d 00 14 sw (sp+20),r13 800db5c: 5b 8e 00 10 sw (sp+16),r14 800db60: 5b 8f 00 0c sw (sp+12),r15 800db64: 5b 90 00 08 sw (sp+8),r16 800db68: 5b 9d 00 04 sw (sp+4),ra 800db6c: b8 20 58 00 mv r11,r1 size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; the_message_queue->number_of_pending_messages = 0; 800db70: 58 20 00 48 sw (r1+72),r0 the_message_queue->maximum_message_size = maximum_message_size; 800db74: 58 24 00 4c sw (r1+76),r4 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; 800db78: 58 20 00 60 sw (r1+96),r0 the_message_queue->notify_argument = the_argument; 800db7c: 58 20 00 64 sw (r1+100),r0 ) { size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 800db80: 59 63 00 44 sw (r11+68),r3 /* * Round size up to multiple of a pointer for chain init and * check for overflow on adding overhead to each message. */ allocated_message_size = maximum_message_size; if (allocated_message_size & (sizeof(uint32_t) - 1)) { 800db84: 20 81 00 03 andi r1,r4,0x3 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { 800db88: b8 40 80 00 mv r16,r2 800db8c: b8 60 70 00 mv r14,r3 /* * Round size up to multiple of a pointer for chain init and * check for overflow on adding overhead to each message. */ allocated_message_size = maximum_message_size; if (allocated_message_size & (sizeof(uint32_t) - 1)) { 800db90: b8 80 60 00 mv r12,r4 800db94: 44 20 00 06 be r1,r0,800dbac <_CORE_message_queue_Initialize+0x60> allocated_message_size += sizeof(uint32_t); 800db98: 34 8c 00 04 addi r12,r4,4 allocated_message_size &= ~(sizeof(uint32_t) - 1); 800db9c: 34 01 ff fc mvi r1,-4 800dba0: a1 81 60 00 and r12,r12,r1 } if (allocated_message_size < maximum_message_size) return false; 800dba4: 34 0d 00 00 mvi r13,0 if (allocated_message_size & (sizeof(uint32_t) - 1)) { allocated_message_size += sizeof(uint32_t); allocated_message_size &= ~(sizeof(uint32_t) - 1); } if (allocated_message_size < maximum_message_size) 800dba8: 54 8c 00 1c bgu r4,r12,800dc18 <_CORE_message_queue_Initialize+0xcc><== NEVER TAKEN /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); 800dbac: 35 8f 00 14 addi r15,r12,20 /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * 800dbb0: b9 e0 08 00 mv r1,r15 800dbb4: b9 c0 10 00 mv r2,r14 800dbb8: f8 00 5c ee calli 8024f70 <__mulsi3> (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) return false; 800dbbc: 34 0d 00 00 mvi r13,0 * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 800dbc0: 55 81 00 16 bgu r12,r1,800dc18 <_CORE_message_queue_Initialize+0xcc><== NEVER TAKEN /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); 800dbc4: f8 00 0e 6e calli 801157c <_Workspace_Allocate> return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 800dbc8: 59 61 00 5c sw (r11+92),r1 _Workspace_Allocate( message_buffering_required ); 800dbcc: b8 20 28 00 mv r5,r1 if (the_message_queue->message_buffers == 0) 800dbd0: 44 20 00 12 be r1,r0,800dc18 <_CORE_message_queue_Initialize+0xcc> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 800dbd4: b8 a0 10 00 mv r2,r5 800dbd8: 35 61 00 68 addi r1,r11,104 800dbdc: b9 c0 18 00 mv r3,r14 800dbe0: b9 e0 20 00 mv r4,r15 800dbe4: f8 00 19 b9 calli 80142c8 <_Chain_Initialize> allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 800dbe8: 2a 02 00 00 lw r2,(r16+0) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 800dbec: 35 61 00 54 addi r1,r11,84 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 800dbf0: 59 61 00 50 sw (r11+80),r1 800dbf4: 64 42 00 01 cmpei r2,r2,1 the_message_queue->message_buffers, (size_t) maximum_pending_messages, allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); 800dbf8: 35 61 00 50 addi r1,r11,80 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 800dbfc: 59 61 00 58 sw (r11+88),r1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 800dc00: 59 60 00 54 sw (r11+84),r0 _Thread_queue_Initialize( 800dc04: b9 60 08 00 mv r1,r11 800dc08: 34 03 00 80 mvi r3,128 800dc0c: 34 04 00 06 mvi r4,6 800dc10: f8 00 0a 7b calli 80105fc <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 800dc14: 34 0d 00 01 mvi r13,1 } 800dc18: b9 a0 08 00 mv r1,r13 800dc1c: 2b 9d 00 04 lw ra,(sp+4) 800dc20: 2b 8b 00 1c lw r11,(sp+28) 800dc24: 2b 8c 00 18 lw r12,(sp+24) 800dc28: 2b 8d 00 14 lw r13,(sp+20) 800dc2c: 2b 8e 00 10 lw r14,(sp+16) 800dc30: 2b 8f 00 0c lw r15,(sp+12) 800dc34: 2b 90 00 08 lw r16,(sp+8) 800dc38: 37 9c 00 1c addi sp,sp,28 800dc3c: c3 a0 00 00 ret =============================================================================== 0800dc40 <_CORE_message_queue_Seize>: void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800dc40: 37 9c ff f0 addi sp,sp,-16 800dc44: 5b 8b 00 10 sw (sp+16),r11 800dc48: 5b 8c 00 0c sw (sp+12),r12 800dc4c: 5b 8d 00 08 sw (sp+8),r13 800dc50: 5b 9d 00 04 sw (sp+4),ra ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 800dc54: 78 07 08 02 mvhi r7,0x802 800dc58: 38 e7 8f 0c ori r7,r7,0x8f0c 800dc5c: 28 e7 00 0c lw r7,(r7+12) void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800dc60: b8 20 60 00 mv r12,r1 800dc64: 20 a5 00 ff andi r5,r5,0xff ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 800dc68: 58 e0 00 34 sw (r7+52),r0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800dc6c: b8 60 08 00 mv r1,r3 CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; _ISR_Disable( level ); 800dc70: 90 00 40 00 rcsr r8,IE 800dc74: 34 03 ff fe mvi r3,-2 800dc78: a1 03 18 00 and r3,r8,r3 800dc7c: d0 03 00 00 wcsr IE,r3 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 800dc80: 29 8b 00 50 lw r11,(r12+80) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 800dc84: 35 83 00 54 addi r3,r12,84 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 800dc88: 45 63 00 07 be r11,r3,800dca4 <_CORE_message_queue_Seize+0x64> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 800dc8c: 29 63 00 00 lw r3,(r11+0) CORE_message_queue_Buffer_control *_CORE_message_queue_Get_pending_message ( CORE_message_queue_Control *the_message_queue ) { return (CORE_message_queue_Buffer_control *) _Chain_Get_unprotected( &the_message_queue->Pending_messages ); 800dc90: 35 89 00 50 addi r9,r12,80 the_chain->first = new_first; 800dc94: 59 83 00 50 sw (r12+80),r3 new_first->previous = _Chain_Head(the_chain); 800dc98: 58 69 00 04 sw (r3+4),r9 the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { 800dc9c: 5d 60 00 04 bne r11,r0,800dcac <_CORE_message_queue_Seize+0x6c><== ALWAYS TAKEN 800dca0: e0 00 00 25 bi 800dd34 <_CORE_message_queue_Seize+0xf4> <== NOT EXECUTED ) { if ( !_Chain_Is_empty(the_chain)) return _Chain_Get_first_unprotected(the_chain); else return NULL; 800dca4: 34 0b 00 00 mvi r11,0 800dca8: e0 00 00 23 bi 800dd34 <_CORE_message_queue_Seize+0xf4> the_message_queue->number_of_pending_messages -= 1; 800dcac: 29 82 00 48 lw r2,(r12+72) 800dcb0: 34 42 ff ff addi r2,r2,-1 800dcb4: 59 82 00 48 sw (r12+72),r2 _ISR_Enable( level ); 800dcb8: d0 08 00 00 wcsr IE,r8 *size_p = the_message->Contents.size; 800dcbc: 29 63 00 0c lw r3,(r11+12) _Thread_Executing->Wait.count = 800dcc0: 78 02 08 02 mvhi r2,0x802 800dcc4: 38 42 8f 0c ori r2,r2,0x8f0c the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; _ISR_Enable( level ); *size_p = the_message->Contents.size; 800dcc8: 58 83 00 00 sw (r4+0),r3 _Thread_Executing->Wait.count = 800dccc: 29 64 00 08 lw r4,(r11+8) 800dcd0: 28 42 00 0c lw r2,(r2+12) _CORE_message_queue_Get_message_priority( the_message ); _CORE_message_queue_Copy_buffer( the_message->Contents.buffer, 800dcd4: 35 6d 00 10 addi r13,r11,16 if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; _ISR_Enable( level ); *size_p = the_message->Contents.size; _Thread_Executing->Wait.count = 800dcd8: 58 44 00 24 sw (r2+36),r4 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 800dcdc: b9 a0 10 00 mv r2,r13 800dce0: f8 00 27 a1 calli 8017b64 * is not, then we can go ahead and free the buffer. * * NOTE: If we note that the queue was not full before this receive, * then we can avoid this dequeue. */ the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 800dce4: b9 80 08 00 mv r1,r12 800dce8: f8 00 08 e8 calli 8010088 <_Thread_queue_Dequeue> 800dcec: b8 20 20 00 mv r4,r1 if ( !the_thread ) { 800dcf0: 5c 20 00 05 bne r1,r0,800dd04 <_CORE_message_queue_Seize+0xc4> RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer ( CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer_control *the_message ) { _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node ); 800dcf4: 35 81 00 68 addi r1,r12,104 800dcf8: b9 60 10 00 mv r2,r11 800dcfc: fb ff ff 64 calli 800da8c <_Chain_Append> _CORE_message_queue_Free_message_buffer( the_message_queue, the_message ); return; 800dd00: e0 00 00 1e bi 800dd78 <_CORE_message_queue_Seize+0x138> CORE_message_queue_Buffer_control *the_message, int priority ) { #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) the_message->priority = priority; 800dd04: 28 21 00 24 lw r1,(r1+36) */ _CORE_message_queue_Set_message_priority( the_message, the_thread->Wait.count ); the_message->Contents.size = (size_t) the_thread->Wait.option; 800dd08: 28 83 00 30 lw r3,(r4+48) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 800dd0c: 28 82 00 2c lw r2,(r4+44) CORE_message_queue_Buffer_control *the_message, int priority ) { #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) the_message->priority = priority; 800dd10: 59 61 00 08 sw (r11+8),r1 800dd14: 59 63 00 0c sw (r11+12),r3 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 800dd18: b9 a0 08 00 mv r1,r13 800dd1c: f8 00 27 92 calli 8017b64 the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 800dd20: 29 63 00 08 lw r3,(r11+8) 800dd24: b9 80 08 00 mv r1,r12 800dd28: b9 60 10 00 mv r2,r11 800dd2c: f8 00 19 74 calli 80142fc <_CORE_message_queue_Insert_message> the_message_queue, the_message, _CORE_message_queue_Get_message_priority( the_message ) ); return; 800dd30: e0 00 00 12 bi 800dd78 <_CORE_message_queue_Seize+0x138> } #endif } if ( !wait ) { 800dd34: 5c ab 00 05 bne r5,r11,800dd48 <_CORE_message_queue_Seize+0x108> _ISR_Enable( level ); 800dd38: d0 08 00 00 wcsr IE,r8 executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 800dd3c: 34 01 00 04 mvi r1,4 800dd40: 58 e1 00 34 sw (r7+52),r1 return; 800dd44: e0 00 00 0d bi 800dd78 <_CORE_message_queue_Seize+0x138> 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; 800dd48: 34 03 00 01 mvi r3,1 800dd4c: 59 83 00 30 sw (r12+48),r3 } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 800dd50: 58 ec 00 44 sw (r7+68),r12 executing->Wait.id = id; 800dd54: 58 e2 00 20 sw (r7+32),r2 executing->Wait.return_argument_second.mutable_object = buffer; 800dd58: 58 e1 00 2c sw (r7+44),r1 executing->Wait.return_argument = size_p; 800dd5c: 58 e4 00 28 sw (r7+40),r4 /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 800dd60: d0 08 00 00 wcsr IE,r8 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 800dd64: 78 03 08 01 mvhi r3,0x801 800dd68: b9 80 08 00 mv r1,r12 800dd6c: b8 c0 10 00 mv r2,r6 800dd70: 38 63 07 68 ori r3,r3,0x768 800dd74: f8 00 09 36 calli 801024c <_Thread_queue_Enqueue_with_handler> } 800dd78: 2b 9d 00 04 lw ra,(sp+4) 800dd7c: 2b 8b 00 10 lw r11,(sp+16) 800dd80: 2b 8c 00 0c lw r12,(sp+12) 800dd84: 2b 8d 00 08 lw r13,(sp+8) 800dd88: 37 9c 00 10 addi sp,sp,16 800dd8c: c3 a0 00 00 ret =============================================================================== 08004d84 <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 8004d84: 37 9c ff e8 addi sp,sp,-24 8004d88: 5b 8b 00 14 sw (sp+20),r11 8004d8c: 5b 8c 00 10 sw (sp+16),r12 8004d90: 5b 8d 00 0c sw (sp+12),r13 8004d94: 5b 8e 00 08 sw (sp+8),r14 8004d98: 5b 9d 00 04 sw (sp+4),ra 8004d9c: b8 20 58 00 mv r11,r1 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 8004da0: 78 01 08 01 mvhi r1,0x801 8004da4: 38 21 99 24 ori r1,r1,0x9924 8004da8: 28 21 00 00 lw r1,(r1+0) Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 8004dac: 5b 85 00 18 sw (sp+24),r5 8004db0: b8 40 70 00 mv r14,r2 8004db4: b8 80 68 00 mv r13,r4 8004db8: 20 6c 00 ff andi r12,r3,0xff _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 8004dbc: 44 20 00 0b be r1,r0,8004de8 <_CORE_mutex_Seize+0x64> 8004dc0: 45 80 00 0a be r12,r0,8004de8 <_CORE_mutex_Seize+0x64> <== NEVER TAKEN 8004dc4: 78 01 08 01 mvhi r1,0x801 8004dc8: 38 21 9a a4 ori r1,r1,0x9aa4 8004dcc: 28 21 00 00 lw r1,(r1+0) 8004dd0: 34 02 00 01 mvi r2,1 8004dd4: 50 41 00 05 bgeu r2,r1,8004de8 <_CORE_mutex_Seize+0x64> 8004dd8: 34 01 00 00 mvi r1,0 8004ddc: 34 02 00 00 mvi r2,0 8004de0: 34 03 00 12 mvi r3,18 8004de4: f8 00 02 0e calli 800561c <_Internal_error_Occurred> 8004de8: b9 60 08 00 mv r1,r11 8004dec: 37 82 00 18 addi r2,sp,24 8004df0: f8 00 25 9d calli 800e464 <_CORE_mutex_Seize_interrupt_trylock> 8004df4: 44 20 00 19 be r1,r0,8004e58 <_CORE_mutex_Seize+0xd4> 8004df8: 78 01 08 01 mvhi r1,0x801 8004dfc: 38 21 9d fc ori r1,r1,0x9dfc 8004e00: 5d 80 00 07 bne r12,r0,8004e1c <_CORE_mutex_Seize+0x98> 8004e04: 2b 82 00 18 lw r2,(sp+24) 8004e08: d0 02 00 00 wcsr IE,r2 8004e0c: 28 21 00 0c lw r1,(r1+12) 8004e10: 34 02 00 01 mvi r2,1 8004e14: 58 22 00 34 sw (r1+52),r2 8004e18: e0 00 00 10 bi 8004e58 <_CORE_mutex_Seize+0xd4> 8004e1c: 28 21 00 0c lw r1,(r1+12) 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; 8004e20: 34 02 00 01 mvi r2,1 8004e24: 59 62 00 30 sw (r11+48),r2 8004e28: 58 2b 00 44 sw (r1+68),r11 8004e2c: 58 2e 00 20 sw (r1+32),r14 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8004e30: 78 01 08 01 mvhi r1,0x801 8004e34: 38 21 99 24 ori r1,r1,0x9924 8004e38: 28 22 00 00 lw r2,(r1+0) 8004e3c: 34 42 00 01 addi r2,r2,1 8004e40: 58 22 00 00 sw (r1+0),r2 8004e44: 2b 81 00 18 lw r1,(sp+24) 8004e48: d0 01 00 00 wcsr IE,r1 8004e4c: b9 60 08 00 mv r1,r11 8004e50: b9 a0 10 00 mv r2,r13 8004e54: fb ff ff ab calli 8004d00 <_CORE_mutex_Seize_interrupt_blocking> } 8004e58: 2b 9d 00 04 lw ra,(sp+4) 8004e5c: 2b 8b 00 14 lw r11,(sp+20) 8004e60: 2b 8c 00 10 lw r12,(sp+16) 8004e64: 2b 8d 00 0c lw r13,(sp+12) 8004e68: 2b 8e 00 08 lw r14,(sp+8) 8004e6c: 37 9c 00 18 addi sp,sp,24 8004e70: c3 a0 00 00 ret =============================================================================== 08004e74 <_CORE_mutex_Surrender>: #else Objects_Id id __attribute__((unused)), CORE_mutex_API_mp_support_callout api_mutex_mp_support __attribute__((unused)) #endif ) { 8004e74: 37 9c ff f4 addi sp,sp,-12 8004e78: 5b 8b 00 0c sw (sp+12),r11 8004e7c: 5b 8c 00 08 sw (sp+8),r12 8004e80: 5b 9d 00 04 sw (sp+4),ra 8004e84: b8 20 58 00 mv r11,r1 * allowed when the mutex in quetion is FIFO or simple Priority * discipline. But Priority Ceiling or Priority Inheritance mutexes * must be released by the thread which acquired them. */ if ( the_mutex->Attributes.only_owner_release ) { 8004e88: 41 62 00 44 lbu r2,(r11+68) ) { Thread_Control *the_thread; Thread_Control *holder; holder = the_mutex->holder; 8004e8c: 28 21 00 5c lw r1,(r1+92) * allowed when the mutex in quetion is FIFO or simple Priority * discipline. But Priority Ceiling or Priority Inheritance mutexes * must be released by the thread which acquired them. */ if ( the_mutex->Attributes.only_owner_release ) { 8004e90: 44 40 00 06 be r2,r0,8004ea8 <_CORE_mutex_Surrender+0x34> RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 8004e94: 78 02 08 01 mvhi r2,0x801 8004e98: 38 42 9d fc ori r2,r2,0x9dfc if ( !_Thread_Is_executing( holder ) ) 8004e9c: 28 42 00 0c lw r2,(r2+12) return CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE; 8004ea0: 34 0c 00 03 mvi r12,3 * discipline. But Priority Ceiling or Priority Inheritance mutexes * must be released by the thread which acquired them. */ if ( the_mutex->Attributes.only_owner_release ) { if ( !_Thread_Is_executing( holder ) ) 8004ea4: 5c 22 00 37 bne r1,r2,8004f80 <_CORE_mutex_Surrender+0x10c> return CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE; } /* XXX already unlocked -- not right status */ if ( !the_mutex->nest_count ) 8004ea8: 29 62 00 54 lw r2,(r11+84) return CORE_MUTEX_STATUS_SUCCESSFUL; 8004eac: 34 0c 00 00 mvi r12,0 return CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE; } /* XXX already unlocked -- not right status */ if ( !the_mutex->nest_count ) 8004eb0: 44 40 00 34 be r2,r0,8004f80 <_CORE_mutex_Surrender+0x10c> return CORE_MUTEX_STATUS_SUCCESSFUL; the_mutex->nest_count--; 8004eb4: 34 42 ff ff addi r2,r2,-1 8004eb8: 59 62 00 54 sw (r11+84),r2 if ( the_mutex->nest_count != 0 ) { 8004ebc: 5c 40 00 31 bne r2,r0,8004f80 <_CORE_mutex_Surrender+0x10c> } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; return CORE_MUTEX_STATUS_SUCCESSFUL; } 8004ec0: 29 62 00 48 lw r2,(r11+72) /* * Formally release the mutex before possibly transferring it to a * blocked thread. */ if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 8004ec4: 34 03 00 02 mvi r3,2 8004ec8: 44 43 00 03 be r2,r3,8004ed4 <_CORE_mutex_Surrender+0x60> 8004ecc: 34 03 00 03 mvi r3,3 8004ed0: 5c 43 00 0a bne r2,r3,8004ef8 <_CORE_mutex_Surrender+0x84> _CORE_mutex_Pop_priority( the_mutex, holder ); if ( pop_status != CORE_MUTEX_STATUS_SUCCESSFUL ) return pop_status; holder->resource_count--; 8004ed4: 28 22 00 1c lw r2,(r1+28) 8004ed8: 34 42 ff ff addi r2,r2,-1 8004edc: 58 22 00 1c sw (r1+28),r2 /* * Whether or not someone is waiting for the mutex, an * inherited priority must be lowered if this is the last * mutex (i.e. resource) this task has. */ if ( holder->resource_count == 0 && 8004ee0: 5c 40 00 06 bne r2,r0,8004ef8 <_CORE_mutex_Surrender+0x84> holder->real_priority != holder->current_priority ) { 8004ee4: 28 22 00 18 lw r2,(r1+24) /* * Whether or not someone is waiting for the mutex, an * inherited priority must be lowered if this is the last * mutex (i.e. resource) this task has. */ if ( holder->resource_count == 0 && 8004ee8: 28 23 00 14 lw r3,(r1+20) 8004eec: 44 43 00 03 be r2,r3,8004ef8 <_CORE_mutex_Surrender+0x84> holder->real_priority != holder->current_priority ) { _Thread_Change_priority( holder, holder->real_priority, true ); 8004ef0: 34 03 00 01 mvi r3,1 8004ef4: f8 00 04 8a calli 800611c <_Thread_Change_priority> } } the_mutex->holder = NULL; 8004ef8: 59 60 00 5c sw (r11+92),r0 the_mutex->holder_id = 0; 8004efc: 59 60 00 60 sw (r11+96),r0 /* * Now we check if another thread was waiting for this mutex. If so, * transfer the mutex to that thread. */ if ( ( the_thread = _Thread_queue_Dequeue( &the_mutex->Wait_queue ) ) ) { 8004f00: b9 60 08 00 mv r1,r11 8004f04: f8 00 06 b2 calli 80069cc <_Thread_queue_Dequeue> 8004f08: b8 20 18 00 mv r3,r1 8004f0c: 44 20 00 1a be r1,r0,8004f74 <_CORE_mutex_Surrender+0x100> } else #endif { the_mutex->holder = the_thread; the_mutex->holder_id = the_thread->Object.id; 8004f10: 28 22 00 08 lw r2,(r1+8) } else #endif { the_mutex->holder = the_thread; 8004f14: 59 61 00 5c sw (r11+92),r1 the_mutex->holder_id = the_thread->Object.id; the_mutex->nest_count = 1; switch ( the_mutex->Attributes.discipline ) { 8004f18: 34 04 00 02 mvi r4,2 } else #endif { the_mutex->holder = the_thread; the_mutex->holder_id = the_thread->Object.id; 8004f1c: 59 62 00 60 sw (r11+96),r2 the_mutex->nest_count = 1; 8004f20: 34 02 00 01 mvi r2,1 8004f24: 59 62 00 54 sw (r11+84),r2 switch ( the_mutex->Attributes.discipline ) { 8004f28: 29 62 00 48 lw r2,(r11+72) 8004f2c: 44 44 00 04 be r2,r4,8004f3c <_CORE_mutex_Surrender+0xc8> 8004f30: 34 04 00 03 mvi r4,3 8004f34: 5c 44 00 12 bne r2,r4,8004f7c <_CORE_mutex_Surrender+0x108> 8004f38: e0 00 00 05 bi 8004f4c <_CORE_mutex_Surrender+0xd8> case CORE_MUTEX_DISCIPLINES_FIFO: case CORE_MUTEX_DISCIPLINES_PRIORITY: break; case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT: _CORE_mutex_Push_priority( the_mutex, the_thread ); the_thread->resource_count++; 8004f3c: 28 21 00 1c lw r1,(r1+28) 8004f40: 34 21 00 01 addi r1,r1,1 8004f44: 58 61 00 1c sw (r3+28),r1 8004f48: e0 00 00 0d bi 8004f7c <_CORE_mutex_Surrender+0x108> break; case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING: _CORE_mutex_Push_priority( the_mutex, the_thread ); the_thread->resource_count++; 8004f4c: 28 22 00 1c lw r2,(r1+28) if (the_mutex->Attributes.priority_ceiling < 8004f50: 28 23 00 14 lw r3,(r1+20) } } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; return CORE_MUTEX_STATUS_SUCCESSFUL; 8004f54: 34 0c 00 00 mvi r12,0 _CORE_mutex_Push_priority( the_mutex, the_thread ); the_thread->resource_count++; break; case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING: _CORE_mutex_Push_priority( the_mutex, the_thread ); the_thread->resource_count++; 8004f58: 34 42 00 01 addi r2,r2,1 8004f5c: 58 22 00 1c sw (r1+28),r2 if (the_mutex->Attributes.priority_ceiling < 8004f60: 29 62 00 4c lw r2,(r11+76) 8004f64: 50 43 00 07 bgeu r2,r3,8004f80 <_CORE_mutex_Surrender+0x10c><== NEVER TAKEN the_thread->current_priority){ _Thread_Change_priority( 8004f68: 34 03 00 00 mvi r3,0 8004f6c: f8 00 04 6c calli 800611c <_Thread_Change_priority> 8004f70: e0 00 00 04 bi 8004f80 <_CORE_mutex_Surrender+0x10c> } break; } } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; 8004f74: 34 01 00 01 mvi r1,1 8004f78: 59 61 00 50 sw (r11+80),r1 return CORE_MUTEX_STATUS_SUCCESSFUL; 8004f7c: 34 0c 00 00 mvi r12,0 } 8004f80: b9 80 08 00 mv r1,r12 8004f84: 2b 9d 00 04 lw ra,(sp+4) 8004f88: 2b 8b 00 0c lw r11,(sp+12) 8004f8c: 2b 8c 00 08 lw r12,(sp+8) 8004f90: 37 9c 00 0c addi sp,sp,12 8004f94: c3 a0 00 00 ret =============================================================================== 08004fec <_CORE_semaphore_Surrender>: CORE_semaphore_Status _CORE_semaphore_Surrender( CORE_semaphore_Control *the_semaphore, Objects_Id id, CORE_semaphore_API_mp_support_callout api_semaphore_mp_support ) { 8004fec: 37 9c ff f8 addi sp,sp,-8 8004ff0: 5b 8b 00 08 sw (sp+8),r11 8004ff4: 5b 9d 00 04 sw (sp+4),ra 8004ff8: b8 20 58 00 mv r11,r1 ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 8004ffc: f8 00 06 74 calli 80069cc <_Thread_queue_Dequeue> { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 8005000: 34 02 00 00 mvi r2,0 if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 8005004: 5c 20 00 0d bne r1,r0,8005038 <_CORE_semaphore_Surrender+0x4c> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 8005008: 90 00 08 00 rcsr r1,IE 800500c: 34 02 ff fe mvi r2,-2 8005010: a0 22 10 00 and r2,r1,r2 8005014: d0 02 00 00 wcsr IE,r2 if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 8005018: 29 63 00 48 lw r3,(r11+72) 800501c: 29 64 00 40 lw r4,(r11+64) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 8005020: 34 02 00 04 mvi r2,4 (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 8005024: 50 64 00 04 bgeu r3,r4,8005034 <_CORE_semaphore_Surrender+0x48><== NEVER TAKEN the_semaphore->count += 1; 8005028: 34 63 00 01 addi r3,r3,1 800502c: 59 63 00 48 sw (r11+72),r3 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 8005030: 34 02 00 00 mvi r2,0 _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 8005034: d0 01 00 00 wcsr IE,r1 } return status; } 8005038: b8 40 08 00 mv r1,r2 800503c: 2b 9d 00 04 lw ra,(sp+4) 8005040: 2b 8b 00 08 lw r11,(sp+8) 8005044: 37 9c 00 08 addi sp,sp,8 8005048: c3 a0 00 00 ret =============================================================================== 0800d6c8 <_Event_Seize>: rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 800d6c8: 37 9c ff f8 addi sp,sp,-8 800d6cc: 5b 8b 00 08 sw (sp+8),r11 800d6d0: 5b 9d 00 04 sw (sp+4),ra rtems_event_set pending_events; ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; 800d6d4: 78 05 08 01 mvhi r5,0x801 800d6d8: 38 a5 9d fc ori r5,r5,0x9dfc 800d6dc: 28 ab 00 0c lw r11,(r5+12) executing->Wait.return_code = RTEMS_SUCCESSFUL; 800d6e0: 59 60 00 34 sw (r11+52),r0 api = executing->API_Extensions[ THREAD_API_RTEMS ]; 800d6e4: 29 67 01 28 lw r7,(r11+296) _ISR_Disable( level ); 800d6e8: 90 00 30 00 rcsr r6,IE 800d6ec: 34 05 ff fe mvi r5,-2 800d6f0: a0 c5 28 00 and r5,r6,r5 800d6f4: d0 05 00 00 wcsr IE,r5 pending_events = api->pending_events; 800d6f8: 28 e8 00 00 lw r8,(r7+0) RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 800d6fc: a0 28 28 00 and r5,r1,r8 seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && 800d700: 44 a0 00 09 be r5,r0,800d724 <_Event_Seize+0x5c> 800d704: 44 a1 00 03 be r5,r1,800d710 <_Event_Seize+0x48> */ RTEMS_INLINE_ROUTINE bool _Options_Is_any ( rtems_option option_set ) { return (option_set & RTEMS_EVENT_ANY) ? true : false; 800d708: 20 49 00 02 andi r9,r2,0x2 (seized_events == event_in || _Options_Is_any( option_set )) ) { 800d70c: 45 20 00 06 be r9,r0,800d724 <_Event_Seize+0x5c> <== NEVER TAKEN RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear( rtems_event_set the_event_set, rtems_event_set the_mask ) { return ( the_event_set & ~(the_mask) ); 800d710: a4 a0 08 00 not r1,r5 800d714: a0 28 40 00 and r8,r1,r8 api->pending_events = 800d718: 58 e8 00 00 sw (r7+0),r8 _Event_sets_Clear( pending_events, seized_events ); _ISR_Enable( level ); 800d71c: d0 06 00 00 wcsr IE,r6 800d720: e0 00 00 06 bi 800d738 <_Event_Seize+0x70> */ RTEMS_INLINE_ROUTINE bool _Options_Is_no_wait ( rtems_option option_set ) { return (option_set & RTEMS_NO_WAIT) ? true : false; 800d724: 20 47 00 01 andi r7,r2,0x1 *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { 800d728: 44 e0 00 06 be r7,r0,800d740 <_Event_Seize+0x78> _ISR_Enable( level ); 800d72c: d0 06 00 00 wcsr IE,r6 executing->Wait.return_code = RTEMS_UNSATISFIED; 800d730: 34 01 00 0d mvi r1,13 800d734: 59 61 00 34 sw (r11+52),r1 *event_out = seized_events; 800d738: 58 85 00 00 sw (r4+0),r5 return; 800d73c: e0 00 00 27 bi 800d7d8 <_Event_Seize+0x110> * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; executing->Wait.count = (uint32_t) event_in; 800d740: 59 61 00 24 sw (r11+36),r1 executing->Wait.return_argument = event_out; _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 800d744: 78 01 08 01 mvhi r1,0x801 * set properly when we are marked as in the event critical section. * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; 800d748: 59 62 00 30 sw (r11+48),r2 executing->Wait.count = (uint32_t) event_in; executing->Wait.return_argument = event_out; _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 800d74c: 38 21 a2 c8 ori r1,r1,0xa2c8 800d750: 34 02 00 01 mvi r2,1 * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; executing->Wait.count = (uint32_t) event_in; executing->Wait.return_argument = event_out; 800d754: 59 64 00 28 sw (r11+40),r4 _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 800d758: 58 22 00 00 sw (r1+0),r2 _ISR_Enable( level ); 800d75c: d0 06 00 00 wcsr IE,r6 if ( ticks ) { 800d760: 44 60 00 0d be r3,r0,800d794 <_Event_Seize+0xcc> _Watchdog_Initialize( 800d764: 29 62 00 08 lw r2,(r11+8) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 800d768: 78 01 08 00 mvhi r1,0x800 800d76c: 38 21 d9 90 ori r1,r1,0xd990 800d770: 59 61 00 64 sw (r11+100),r1 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800d774: 78 01 08 01 mvhi r1,0x801 void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 800d778: 59 62 00 68 sw (r11+104),r2 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 800d77c: 59 60 00 50 sw (r11+80),r0 the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 800d780: 59 60 00 6c sw (r11+108),r0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 800d784: 59 63 00 54 sw (r11+84),r3 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800d788: 38 21 99 e8 ori r1,r1,0x99e8 800d78c: 35 62 00 48 addi r2,r11,72 800d790: fb ff e8 7c calli 8007980 <_Watchdog_Insert> NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); 800d794: b9 60 08 00 mv r1,r11 800d798: 34 02 01 00 mvi r2,256 800d79c: fb ff e6 75 calli 8007170 <_Thread_Set_state> _ISR_Disable( level ); 800d7a0: 90 00 18 00 rcsr r3,IE 800d7a4: 34 01 ff fe mvi r1,-2 800d7a8: a0 61 08 00 and r1,r3,r1 800d7ac: d0 01 00 00 wcsr IE,r1 sync_state = _Event_Sync_state; 800d7b0: 78 02 08 01 mvhi r2,0x801 800d7b4: 38 42 a2 c8 ori r2,r2,0xa2c8 800d7b8: 28 41 00 00 lw r1,(r2+0) _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 800d7bc: 58 40 00 00 sw (r2+0),r0 if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 800d7c0: 34 02 00 01 mvi r2,1 800d7c4: 5c 22 00 03 bne r1,r2,800d7d0 <_Event_Seize+0x108> <== NEVER TAKEN _ISR_Enable( level ); 800d7c8: d0 03 00 00 wcsr IE,r3 return; 800d7cc: e0 00 00 03 bi 800d7d8 <_Event_Seize+0x110> * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 800d7d0: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 800d7d4: f8 00 05 53 calli 800ed20 <_Thread_blocking_operation_Cancel><== NOT EXECUTED } 800d7d8: 2b 9d 00 04 lw ra,(sp+4) 800d7dc: 2b 8b 00 08 lw r11,(sp+8) 800d7e0: 37 9c 00 08 addi sp,sp,8 800d7e4: c3 a0 00 00 ret =============================================================================== 0800d850 <_Event_Surrender>: */ void _Event_Surrender( Thread_Control *the_thread ) { 800d850: 37 9c ff f8 addi sp,sp,-8 800d854: 5b 8b 00 08 sw (sp+8),r11 800d858: 5b 9d 00 04 sw (sp+4),ra rtems_event_set event_condition; rtems_event_set seized_events; rtems_option option_set; RTEMS_API_Control *api; api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 800d85c: 28 24 01 28 lw r4,(r1+296) option_set = (rtems_option) the_thread->Wait.option; 800d860: 28 28 00 30 lw r8,(r1+48) */ void _Event_Surrender( Thread_Control *the_thread ) { 800d864: b8 20 58 00 mv r11,r1 api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); 800d868: 90 00 08 00 rcsr r1,IE 800d86c: 34 07 ff fe mvi r7,-2 800d870: a0 27 38 00 and r7,r1,r7 800d874: d0 07 00 00 wcsr IE,r7 pending_events = api->pending_events; 800d878: 28 85 00 00 lw r5,(r4+0) event_condition = (rtems_event_set) the_thread->Wait.count; 800d87c: 29 66 00 24 lw r6,(r11+36) RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 800d880: a0 c5 10 00 and r2,r6,r5 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 800d884: 5c 40 00 03 bne r2,r0,800d890 <_Event_Surrender+0x40> _ISR_Enable( level ); 800d888: d0 01 00 00 wcsr IE,r1 return; 800d88c: e0 00 00 3d bi 800d980 <_Event_Surrender+0x130> /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 800d890: 78 03 08 01 mvhi r3,0x801 800d894: 38 63 9d fc ori r3,r3,0x9dfc 800d898: 28 69 00 08 lw r9,(r3+8) 800d89c: 45 20 00 1a be r9,r0,800d904 <_Event_Surrender+0xb4> 800d8a0: 28 63 00 0c lw r3,(r3+12) 800d8a4: 5d 63 00 18 bne r11,r3,800d904 <_Event_Surrender+0xb4> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 800d8a8: 78 03 08 01 mvhi r3,0x801 800d8ac: 38 63 a2 c8 ori r3,r3,0xa2c8 800d8b0: 28 6a 00 00 lw r10,(r3+0) /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && 800d8b4: 34 09 00 02 mvi r9,2 800d8b8: 45 49 00 04 be r10,r9,800d8c8 <_Event_Surrender+0x78> <== NEVER TAKEN ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 800d8bc: 28 69 00 00 lw r9,(r3+0) * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 800d8c0: 34 03 00 01 mvi r3,1 800d8c4: 5d 23 00 10 bne r9,r3,800d904 <_Event_Surrender+0xb4> <== NEVER TAKEN (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 800d8c8: 44 46 00 03 be r2,r6,800d8d4 <_Event_Surrender+0x84> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE bool _Options_Is_any ( rtems_option option_set ) { return (option_set & RTEMS_EVENT_ANY) ? true : false; 800d8cc: 21 08 00 02 andi r8,r8,0x2 <== NOT EXECUTED 800d8d0: 45 00 00 0b be r8,r0,800d8fc <_Event_Surrender+0xac> <== NOT EXECUTED RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear( rtems_event_set the_event_set, rtems_event_set the_mask ) { return ( the_event_set & ~(the_mask) ); 800d8d4: a4 40 18 00 not r3,r2 800d8d8: a0 65 28 00 and r5,r3,r5 api->pending_events = _Event_sets_Clear( pending_events,seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800d8dc: 29 63 00 28 lw r3,(r11+40) if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { api->pending_events = _Event_sets_Clear( pending_events,seized_events ); 800d8e0: 58 85 00 00 sw (r4+0),r5 the_thread->Wait.count = 0; 800d8e4: 59 60 00 24 sw (r11+36),r0 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800d8e8: 58 62 00 00 sw (r3+0),r2 _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 800d8ec: 78 02 08 01 mvhi r2,0x801 800d8f0: 38 42 a2 c8 ori r2,r2,0xa2c8 800d8f4: 34 03 00 03 mvi r3,3 800d8f8: 58 43 00 00 sw (r2+0),r3 } _ISR_Enable( level ); 800d8fc: d0 01 00 00 wcsr IE,r1 return; 800d900: e0 00 00 20 bi 800d980 <_Event_Surrender+0x130> */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_event ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_EVENT); 800d904: 29 63 00 10 lw r3,(r11+16) 800d908: 20 63 01 00 andi r3,r3,0x100 } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 800d90c: 44 60 00 1c be r3,r0,800d97c <_Event_Surrender+0x12c> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 800d910: 44 46 00 03 be r2,r6,800d91c <_Event_Surrender+0xcc> 800d914: 21 08 00 02 andi r8,r8,0x2 800d918: 45 00 00 19 be r8,r0,800d97c <_Event_Surrender+0x12c> <== NEVER TAKEN 800d91c: a4 40 18 00 not r3,r2 800d920: a0 65 28 00 and r5,r3,r5 api->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800d924: 29 63 00 28 lw r3,(r11+40) /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { api->pending_events = _Event_sets_Clear( pending_events, seized_events ); 800d928: 58 85 00 00 sw (r4+0),r5 the_thread->Wait.count = 0; 800d92c: 59 60 00 24 sw (r11+36),r0 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800d930: 58 62 00 00 sw (r3+0),r2 _ISR_Flash( level ); 800d934: d0 01 00 00 wcsr IE,r1 800d938: d0 07 00 00 wcsr IE,r7 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 800d93c: 29 63 00 50 lw r3,(r11+80) 800d940: 34 02 00 02 mvi r2,2 800d944: 44 62 00 03 be r3,r2,800d950 <_Event_Surrender+0x100> _ISR_Enable( level ); 800d948: d0 01 00 00 wcsr IE,r1 800d94c: e0 00 00 06 bi 800d964 <_Event_Surrender+0x114> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 800d950: 34 02 00 03 mvi r2,3 800d954: 59 62 00 50 sw (r11+80),r2 _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 800d958: d0 01 00 00 wcsr IE,r1 (void) _Watchdog_Remove( &the_thread->Timer ); 800d95c: 35 61 00 48 addi r1,r11,72 800d960: fb ff e8 65 calli 8007af4 <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800d964: 78 03 08 01 mvhi r3,0x801 800d968: 38 63 81 44 ori r3,r3,0x8144 800d96c: 28 62 00 00 lw r2,(r3+0) 800d970: b9 60 08 00 mv r1,r11 800d974: f8 00 05 03 calli 800ed80 <_Thread_Clear_state> 800d978: e0 00 00 02 bi 800d980 <_Event_Surrender+0x130> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 800d97c: d0 01 00 00 wcsr IE,r1 } 800d980: 2b 9d 00 04 lw ra,(sp+4) 800d984: 2b 8b 00 08 lw r11,(sp+8) 800d988: 37 9c 00 08 addi sp,sp,8 800d98c: c3 a0 00 00 ret =============================================================================== 0800d990 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 800d990: 37 9c ff f8 addi sp,sp,-8 800d994: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 800d998: 37 82 00 08 addi r2,sp,8 800d99c: fb ff e3 0f calli 80065d8 <_Thread_Get> switch ( location ) { 800d9a0: 2b 82 00 08 lw r2,(sp+8) 800d9a4: 5c 40 00 1d bne r2,r0,800da18 <_Event_Timeout+0x88> <== NEVER TAKEN * * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ _ISR_Disable( level ); 800d9a8: 90 00 18 00 rcsr r3,IE 800d9ac: 34 02 ff fe mvi r2,-2 800d9b0: a0 62 10 00 and r2,r3,r2 800d9b4: d0 02 00 00 wcsr IE,r2 RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 800d9b8: 78 02 08 01 mvhi r2,0x801 800d9bc: 38 42 9d fc ori r2,r2,0x9dfc return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 800d9c0: 28 42 00 0c lw r2,(r2+12) _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 800d9c4: 58 20 00 24 sw (r1+36),r0 if ( _Thread_Is_executing( the_thread ) ) { 800d9c8: 5c 22 00 08 bne r1,r2,800d9e8 <_Event_Timeout+0x58> <== ALWAYS TAKEN if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 800d9cc: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 800d9d0: 38 42 a2 c8 ori r2,r2,0xa2c8 <== NOT EXECUTED 800d9d4: 28 45 00 00 lw r5,(r2+0) <== NOT EXECUTED 800d9d8: 34 04 00 01 mvi r4,1 <== NOT EXECUTED 800d9dc: 5c a4 00 03 bne r5,r4,800d9e8 <_Event_Timeout+0x58> <== NOT EXECUTED _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800d9e0: 34 04 00 02 mvi r4,2 <== NOT EXECUTED 800d9e4: 58 44 00 00 sw (r2+0),r4 <== NOT EXECUTED } the_thread->Wait.return_code = RTEMS_TIMEOUT; 800d9e8: 34 02 00 06 mvi r2,6 800d9ec: 58 22 00 34 sw (r1+52),r2 _ISR_Enable( level ); 800d9f0: d0 03 00 00 wcsr IE,r3 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800d9f4: 78 03 08 01 mvhi r3,0x801 800d9f8: 38 63 81 44 ori r3,r3,0x8144 800d9fc: 28 62 00 00 lw r2,(r3+0) 800da00: f8 00 04 e0 calli 800ed80 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 800da04: 78 01 08 01 mvhi r1,0x801 800da08: 38 21 99 24 ori r1,r1,0x9924 800da0c: 28 22 00 00 lw r2,(r1+0) 800da10: 34 42 ff ff addi r2,r2,-1 800da14: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 800da18: 2b 9d 00 04 lw ra,(sp+4) 800da1c: 37 9c 00 08 addi sp,sp,8 800da20: c3 a0 00 00 ret =============================================================================== 0800e630 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 800e630: 37 9c ff b8 addi sp,sp,-72 800e634: 5b 8b 00 44 sw (sp+68),r11 800e638: 5b 8c 00 40 sw (sp+64),r12 800e63c: 5b 8d 00 3c sw (sp+60),r13 800e640: 5b 8e 00 38 sw (sp+56),r14 800e644: 5b 8f 00 34 sw (sp+52),r15 800e648: 5b 90 00 30 sw (sp+48),r16 800e64c: 5b 91 00 2c sw (sp+44),r17 800e650: 5b 92 00 28 sw (sp+40),r18 800e654: 5b 93 00 24 sw (sp+36),r19 800e658: 5b 94 00 20 sw (sp+32),r20 800e65c: 5b 95 00 1c sw (sp+28),r21 800e660: 5b 96 00 18 sw (sp+24),r22 800e664: 5b 97 00 14 sw (sp+20),r23 800e668: 5b 98 00 10 sw (sp+16),r24 800e66c: 5b 99 00 0c sw (sp+12),r25 800e670: 5b 9b 00 08 sw (sp+8),fp 800e674: 5b 9d 00 04 sw (sp+4),ra 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 800e678: 34 55 00 04 addi r21,r2,4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 800e67c: b8 20 60 00 mv r12,r1 if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 800e680: 28 2e 00 08 lw r14,(r1+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; 800e684: 28 33 00 10 lw r19,(r1+16) Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 800e688: b8 40 68 00 mv r13,r2 800e68c: b8 60 78 00 mv r15,r3 800e690: b8 80 90 00 mv r18,r4 uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { /* Integer overflow occured */ return NULL; 800e694: 34 01 00 00 mvi r1,0 - 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 ) { 800e698: 54 55 00 53 bgu r2,r21,800e7e4 <_Heap_Allocate_aligned_with_boundary+0x1b4> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 800e69c: 44 80 00 04 be r4,r0,800e6ac <_Heap_Allocate_aligned_with_boundary+0x7c> if ( boundary < alloc_size ) { 800e6a0: 54 44 00 51 bgu r2,r4,800e7e4 <_Heap_Allocate_aligned_with_boundary+0x1b4> return NULL; } if ( alignment == 0 ) { 800e6a4: 5c 60 00 02 bne r3,r0,800e6ac <_Heap_Allocate_aligned_with_boundary+0x7c> alignment = page_size; 800e6a8: ba 60 78 00 mv r15,r19 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; 800e6ac: 34 18 00 04 mvi r24,4 if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { alignment = page_size; 800e6b0: 34 11 00 00 mvi r17,0 800e6b4: 34 1b ff fe mvi fp,-2 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 800e6b8: 36 79 00 07 addi r25,r19,7 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; 800e6bc: cb 0d c0 00 sub r24,r24,r13 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800e6c0: 34 17 ff f8 mvi r23,-8 800e6c4: e0 00 00 42 bi 800e7cc <_Heap_Allocate_aligned_with_boundary+0x19c> /* * 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 ) { 800e6c8: 29 cb 00 04 lw r11,(r14+4) while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; 800e6cc: 36 31 00 01 addi r17,r17,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 ) { 800e6d0: 52 ab 00 3e bgeu r21,r11,800e7c8 <_Heap_Allocate_aligned_with_boundary+0x198> 800e6d4: 35 d4 00 08 addi r20,r14,8 if ( alignment == 0 ) { 800e6d8: 5d e0 00 03 bne r15,r0,800e6e4 <_Heap_Allocate_aligned_with_boundary+0xb4> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 800e6dc: ba 80 58 00 mv r11,r20 800e6e0: e0 00 00 30 bi 800e7a0 <_Heap_Allocate_aligned_with_boundary+0x170> uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 800e6e4: 29 96 00 14 lw r22,(r12+20) - 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; 800e6e8: a1 7b 58 00 and r11,r11,fp 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; 800e6ec: b5 cb 58 00 add r11,r14,r11 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; 800e6f0: cb 36 80 00 sub r16,r25,r22 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 800e6f4: b6 0b 80 00 add r16,r16,r11 + 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; 800e6f8: b7 0b 58 00 add r11,r24,r11 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800e6fc: b9 60 08 00 mv r1,r11 800e700: b9 e0 10 00 mv r2,r15 800e704: f8 00 22 dd calli 8017278 <__umodsi3> 800e708: c9 61 58 00 sub r11,r11,r1 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 ) { 800e70c: 52 0b 00 05 bgeu r16,r11,800e720 <_Heap_Allocate_aligned_with_boundary+0xf0> 800e710: ba 00 08 00 mv r1,r16 800e714: b9 e0 10 00 mv r2,r15 800e718: f8 00 22 d8 calli 8017278 <__umodsi3> 800e71c: ca 01 58 00 sub r11,r16,r1 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 800e720: 46 40 00 15 be r18,r0,800e774 <_Heap_Allocate_aligned_with_boundary+0x144> uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 800e724: b6 8d 08 00 add r1,r20,r13 /* 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; 800e728: b5 6d 80 00 add r16,r11,r13 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 800e72c: 5b 81 00 48 sw (sp+72),r1 800e730: e0 00 00 09 bi 800e754 <_Heap_Allocate_aligned_with_boundary+0x124> uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 800e734: 2b 82 00 48 lw r2,(sp+72) 800e738: 54 41 00 24 bgu r2,r1,800e7c8 <_Heap_Allocate_aligned_with_boundary+0x198> return 0; } alloc_begin = boundary_line - alloc_size; 800e73c: c8 2d 58 00 sub r11,r1,r13 800e740: b9 60 08 00 mv r1,r11 800e744: b9 e0 10 00 mv r2,r15 800e748: f8 00 22 cc calli 8017278 <__umodsi3> 800e74c: c9 61 58 00 sub r11,r11,r1 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 800e750: b5 6d 80 00 add r16,r11,r13 800e754: ba 00 08 00 mv r1,r16 800e758: ba 40 10 00 mv r2,r18 800e75c: f8 00 22 c7 calli 8017278 <__umodsi3> 800e760: ca 01 08 00 sub r1,r16,r1 /* 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 ) { 800e764: f6 01 80 00 cmpgu r16,r16,r1 800e768: f4 2b 10 00 cmpgu r2,r1,r11 800e76c: a2 02 80 00 and r16,r16,r2 800e770: 5e 00 ff f1 bne r16,r0,800e734 <_Heap_Allocate_aligned_with_boundary+0x104> 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 ) { 800e774: 56 8b 00 15 bgu r20,r11,800e7c8 <_Heap_Allocate_aligned_with_boundary+0x198> 800e778: ba 60 10 00 mv r2,r19 800e77c: ca ee 80 00 sub r16,r23,r14 800e780: b9 60 08 00 mv r1,r11 800e784: f8 00 22 bd calli 8017278 <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 800e788: b6 0b 80 00 add r16,r16,r11 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; 800e78c: ca 01 08 00 sub r1,r16,r1 if ( free_size >= min_block_size || free_size == 0 ) { 800e790: 64 22 00 00 cmpei r2,r1,0 800e794: f0 36 08 00 cmpgeu r1,r1,r22 800e798: b8 41 08 00 or r1,r2,r1 800e79c: 44 20 00 0b be r1,r0,800e7c8 <_Heap_Allocate_aligned_with_boundary+0x198> boundary ); } } if ( alloc_begin != 0 ) { 800e7a0: 45 60 00 0a be r11,r0,800e7c8 <_Heap_Allocate_aligned_with_boundary+0x198><== NEVER TAKEN block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 800e7a4: 29 81 00 4c lw r1,(r12+76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 800e7a8: b9 c0 10 00 mv r2,r14 800e7ac: b9 60 18 00 mv r3,r11 block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 800e7b0: b4 31 08 00 add r1,r1,r17 800e7b4: 59 81 00 4c sw (r12+76),r1 block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 800e7b8: b9 a0 20 00 mv r4,r13 800e7bc: b9 80 08 00 mv r1,r12 800e7c0: fb ff db 3b calli 80054ac <_Heap_Block_allocate> 800e7c4: e0 00 00 04 bi 800e7d4 <_Heap_Allocate_aligned_with_boundary+0x1a4> if ( alloc_begin != 0 ) { break; } block = block->next; 800e7c8: 29 ce 00 08 lw r14,(r14+8) if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 800e7cc: 5d cc ff bf bne r14,r12,800e6c8 <_Heap_Allocate_aligned_with_boundary+0x98> 800e7d0: 34 0b 00 00 mvi r11,0 boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { 800e7d4: 29 81 00 44 lw r1,(r12+68) 800e7d8: 50 31 00 02 bgeu r1,r17,800e7e0 <_Heap_Allocate_aligned_with_boundary+0x1b0> stats->max_search = search_count; 800e7dc: 59 91 00 44 sw (r12+68),r17 } return (void *) alloc_begin; 800e7e0: b9 60 08 00 mv r1,r11 } 800e7e4: 2b 9d 00 04 lw ra,(sp+4) 800e7e8: 2b 8b 00 44 lw r11,(sp+68) 800e7ec: 2b 8c 00 40 lw r12,(sp+64) 800e7f0: 2b 8d 00 3c lw r13,(sp+60) 800e7f4: 2b 8e 00 38 lw r14,(sp+56) 800e7f8: 2b 8f 00 34 lw r15,(sp+52) 800e7fc: 2b 90 00 30 lw r16,(sp+48) 800e800: 2b 91 00 2c lw r17,(sp+44) 800e804: 2b 92 00 28 lw r18,(sp+40) 800e808: 2b 93 00 24 lw r19,(sp+36) 800e80c: 2b 94 00 20 lw r20,(sp+32) 800e810: 2b 95 00 1c lw r21,(sp+28) 800e814: 2b 96 00 18 lw r22,(sp+24) 800e818: 2b 97 00 14 lw r23,(sp+20) 800e81c: 2b 98 00 10 lw r24,(sp+16) 800e820: 2b 99 00 0c lw r25,(sp+12) 800e824: 2b 9b 00 08 lw fp,(sp+8) 800e828: 37 9c 00 48 addi sp,sp,72 800e82c: c3 a0 00 00 ret =============================================================================== 08009d80 <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { 8009d80: 37 9c ff b8 addi sp,sp,-72 8009d84: 5b 8b 00 40 sw (sp+64),r11 8009d88: 5b 8c 00 3c sw (sp+60),r12 8009d8c: 5b 8d 00 38 sw (sp+56),r13 8009d90: 5b 8e 00 34 sw (sp+52),r14 8009d94: 5b 8f 00 30 sw (sp+48),r15 8009d98: 5b 90 00 2c sw (sp+44),r16 8009d9c: 5b 91 00 28 sw (sp+40),r17 8009da0: 5b 92 00 24 sw (sp+36),r18 8009da4: 5b 93 00 20 sw (sp+32),r19 8009da8: 5b 94 00 1c sw (sp+28),r20 8009dac: 5b 95 00 18 sw (sp+24),r21 8009db0: 5b 96 00 14 sw (sp+20),r22 8009db4: 5b 97 00 10 sw (sp+16),r23 8009db8: 5b 98 00 0c sw (sp+12),r24 8009dbc: 5b 99 00 08 sw (sp+8),r25 8009dc0: 5b 9d 00 04 sw (sp+4),ra 8009dc4: b8 40 70 00 mv r14,r2 Heap_Block *start_block = first_block; Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; 8009dc8: 5b 80 00 48 sw (sp+72),r0 Heap_Block *extend_last_block = NULL; 8009dcc: 5b 80 00 44 sw (sp+68),r0 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; 8009dd0: b5 c3 68 00 add r13,r14,r3 Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { 8009dd4: b8 80 a0 00 mv r20,r4 8009dd8: b8 20 58 00 mv r11,r1 8009ddc: b8 60 10 00 mv r2,r3 Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 8009de0: 28 35 00 20 lw r21,(r1+32) Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; 8009de4: 28 36 00 10 lw r22,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 8009de8: 28 24 00 14 lw r4,(r1+20) uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; uintptr_t const free_size = stats->free_size; 8009dec: 28 37 00 30 lw r23,(r1+48) uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { return false; 8009df0: 34 0c 00 00 mvi r12,0 uintptr_t const free_size = stats->free_size; uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { 8009df4: 55 cd 00 8e bgu r14,r13,800a02c <_Heap_Extend+0x2ac> return false; } extend_area_ok = _Heap_Get_first_and_last_block( 8009df8: b9 c0 08 00 mv r1,r14 8009dfc: ba c0 18 00 mv r3,r22 8009e00: 37 85 00 48 addi r5,sp,72 8009e04: 37 86 00 44 addi r6,sp,68 8009e08: fb ff e8 22 calli 8003e90 <_Heap_Get_first_and_last_block> page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 8009e0c: 44 20 00 88 be r1,r0,800a02c <_Heap_Extend+0x2ac> 8009e10: ba a0 78 00 mv r15,r21 8009e14: 34 11 00 00 mvi r17,0 8009e18: 34 13 00 00 mvi r19,0 8009e1c: 34 10 00 00 mvi r16,0 return false; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 8009e20: 29 61 00 18 lw r1,(r11+24) } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8009e24: 34 18 ff fe mvi r24,-2 8009e28: e0 00 00 02 bi 8009e30 <_Heap_Extend+0xb0> 8009e2c: b9 e0 08 00 mv r1,r15 uintptr_t const sub_area_end = start_block->prev_size; 8009e30: 29 f2 00 00 lw r18,(r15+0) Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( sub_area_end > extend_area_begin && extend_area_end > sub_area_begin 8009e34: f5 a1 18 00 cmpgu r3,r13,r1 8009e38: f6 4e 10 00 cmpgu r2,r18,r14 (uintptr_t) start_block : heap->area_begin; uintptr_t const sub_area_end = start_block->prev_size; Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( 8009e3c: a0 62 10 00 and r2,r3,r2 8009e40: 5c 40 00 7a bne r2,r0,800a028 <_Heap_Extend+0x2a8> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 8009e44: 45 a1 00 03 be r13,r1,8009e50 <_Heap_Extend+0xd0> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 8009e48: 56 4d 00 04 bgu r18,r13,8009e58 <_Heap_Extend+0xd8> 8009e4c: e0 00 00 04 bi 8009e5c <_Heap_Extend+0xdc> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 8009e50: b9 e0 80 00 mv r16,r15 8009e54: e0 00 00 02 bi 8009e5c <_Heap_Extend+0xdc> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 8009e58: b9 e0 98 00 mv r19,r15 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 8009e5c: ba 40 08 00 mv r1,r18 8009e60: ba c0 10 00 mv r2,r22 8009e64: 36 59 ff f8 addi r25,r18,-8 8009e68: f8 00 21 59 calli 80123cc <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 8009e6c: cb 21 08 00 sub r1,r25,r1 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 8009e70: 5d d2 00 04 bne r14,r18,8009e80 <_Heap_Extend+0x100> start_block->prev_size = extend_area_end; 8009e74: 59 ed 00 00 sw (r15+0),r13 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 8009e78: b8 20 60 00 mv r12,r1 8009e7c: e0 00 00 04 bi 8009e8c <_Heap_Extend+0x10c> merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 8009e80: 55 d2 00 02 bgu r14,r18,8009e88 <_Heap_Extend+0x108> 8009e84: e0 00 00 02 bi 8009e8c <_Heap_Extend+0x10c> 8009e88: b8 20 88 00 mv r17,r1 - 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; 8009e8c: 28 2f 00 04 lw r15,(r1+4) 8009e90: a3 0f 78 00 and r15,r24,r15 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8009e94: b4 2f 78 00 add r15,r1,r15 link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 8009e98: 5d f5 ff e5 bne r15,r21,8009e2c <_Heap_Extend+0xac> if ( extend_area_begin < heap->area_begin ) { 8009e9c: 29 61 00 18 lw r1,(r11+24) 8009ea0: 51 c1 00 03 bgeu r14,r1,8009eac <_Heap_Extend+0x12c> heap->area_begin = extend_area_begin; 8009ea4: 59 6e 00 18 sw (r11+24),r14 8009ea8: e0 00 00 04 bi 8009eb8 <_Heap_Extend+0x138> } else if ( heap->area_end < extend_area_end ) { 8009eac: 29 61 00 1c lw r1,(r11+28) 8009eb0: 50 2d 00 02 bgeu r1,r13,8009eb8 <_Heap_Extend+0x138> heap->area_end = extend_area_end; 8009eb4: 59 6d 00 1c sw (r11+28),r13 } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 8009eb8: 2b 81 00 44 lw r1,(sp+68) 8009ebc: 2b 82 00 48 lw r2,(sp+72) heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 8009ec0: c8 22 18 00 sub r3,r1,r2 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; 8009ec4: 58 4d 00 00 sw (r2+0),r13 extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 8009ec8: 38 64 00 01 ori r4,r3,0x1 extend_last_block->prev_size = extend_first_block_size; 8009ecc: 58 23 00 00 sw (r1+0),r3 extend_last_block->size_and_flag = 0; if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 8009ed0: 29 63 00 20 lw r3,(r11+32) extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = 8009ed4: 58 44 00 04 sw (r2+4),r4 extend_first_block_size | HEAP_PREV_BLOCK_USED; extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; 8009ed8: 58 20 00 04 sw (r1+4),r0 if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 8009edc: 50 43 00 03 bgeu r2,r3,8009ee8 <_Heap_Extend+0x168> heap->first_block = extend_first_block; 8009ee0: 59 62 00 20 sw (r11+32),r2 8009ee4: e0 00 00 04 bi 8009ef4 <_Heap_Extend+0x174> } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 8009ee8: 29 62 00 24 lw r2,(r11+36) 8009eec: 50 41 00 02 bgeu r2,r1,8009ef4 <_Heap_Extend+0x174> heap->last_block = extend_last_block; 8009ef0: 59 61 00 24 sw (r11+36),r1 } if ( merge_below_block != NULL ) { 8009ef4: 46 00 00 12 be r16,r0,8009f3c <_Heap_Extend+0x1bc> Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; 8009ef8: 29 6f 00 10 lw r15,(r11+16) uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); 8009efc: 35 ce 00 08 addi r14,r14,8 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 8009f00: b9 c0 08 00 mv r1,r14 8009f04: b9 e0 10 00 mv r2,r15 8009f08: f8 00 21 31 calli 80123cc <__umodsi3> if ( remainder != 0 ) { 8009f0c: 44 20 00 03 be r1,r0,8009f18 <_Heap_Extend+0x198> <== ALWAYS TAKEN return value - remainder + alignment; 8009f10: b5 cf 70 00 add r14,r14,r15 <== NOT EXECUTED 8009f14: c9 c1 70 00 sub r14,r14,r1 <== NOT EXECUTED uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; 8009f18: 2a 01 00 00 lw r1,(r16+0) ) { uintptr_t const page_size = heap->page_size; uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = 8009f1c: 35 c2 ff f8 addi r2,r14,-8 uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; 8009f20: 59 c1 ff f8 sw (r14+-8),r1 uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE; uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = 8009f24: ca 02 08 00 sub r1,r16,r2 first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; 8009f28: 38 21 00 01 ori r1,r1,0x1 8009f2c: 58 41 00 04 sw (r2+4),r1 _Heap_Free_block( heap, new_first_block ); 8009f30: b9 60 08 00 mv r1,r11 8009f34: fb ff ff 86 calli 8009d4c <_Heap_Free_block> 8009f38: e0 00 00 06 bi 8009f50 <_Heap_Extend+0x1d0> heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { _Heap_Merge_below( heap, extend_area_begin, merge_below_block ); } else if ( link_below_block != NULL ) { 8009f3c: 46 70 00 05 be r19,r16,8009f50 <_Heap_Extend+0x1d0> _Heap_Link_below( 8009f40: 2b 81 00 44 lw r1,(sp+68) { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = (link_begin - last_block_begin) | HEAP_PREV_BLOCK_USED; 8009f44: ca 61 98 00 sub r19,r19,r1 8009f48: 3a 73 00 01 ori r19,r19,0x1 ) { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = 8009f4c: 58 33 00 04 sw (r1+4),r19 link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 8009f50: 45 80 00 14 be r12,r0,8009fa0 <_Heap_Extend+0x220> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 8009f54: 29 62 00 10 lw r2,(r11+16) ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( extend_area_end - last_block_begin - HEAP_BLOCK_HEADER_SIZE, 8009f58: 35 ad ff f8 addi r13,r13,-8 uintptr_t extend_area_end ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( 8009f5c: c9 ac 68 00 sub r13,r13,r12 8009f60: b9 a0 08 00 mv r1,r13 8009f64: f8 00 21 1a calli 80123cc <__umodsi3> ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) 8009f68: 29 83 00 04 lw r3,(r12+4) 8009f6c: c9 a1 08 00 sub r1,r13,r1 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = 8009f70: b4 2c 10 00 add r2,r1,r12 (last_block->size_and_flag - last_block_new_size) 8009f74: c8 61 18 00 sub r3,r3,r1 | HEAP_PREV_BLOCK_USED; 8009f78: 38 63 00 01 ori r3,r3,0x1 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = 8009f7c: 58 43 00 04 sw (r2+4),r3 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 8009f80: 29 82 00 04 lw r2,(r12+4) 8009f84: 20 42 00 01 andi r2,r2,0x1 block->size_and_flag = size | flag; 8009f88: b8 22 08 00 or r1,r1,r2 8009f8c: 59 81 00 04 sw (r12+4),r1 (last_block->size_and_flag - last_block_new_size) | HEAP_PREV_BLOCK_USED; _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); 8009f90: b9 80 10 00 mv r2,r12 8009f94: b9 60 08 00 mv r1,r11 8009f98: fb ff ff 6d calli 8009d4c <_Heap_Free_block> 8009f9c: e0 00 00 0c bi 8009fcc <_Heap_Extend+0x24c> ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 8009fa0: 46 2c 00 0b be r17,r12,8009fcc <_Heap_Extend+0x24c> RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 8009fa4: 2a 21 00 04 lw r1,(r17+4) ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); 8009fa8: 2b 83 00 48 lw r3,(sp+72) } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { _Heap_Link_above( 8009fac: 2b 82 00 44 lw r2,(sp+68) 8009fb0: 20 21 00 01 andi r1,r1,0x1 ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); 8009fb4: c8 71 18 00 sub r3,r3,r17 block->size_and_flag = size | flag; 8009fb8: b8 61 08 00 or r1,r3,r1 8009fbc: 5a 21 00 04 sw (r17+4),r1 last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 8009fc0: 28 41 00 04 lw r1,(r2+4) 8009fc4: 38 21 00 01 ori r1,r1,0x1 8009fc8: 58 41 00 04 sw (r2+4),r1 extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 8009fcc: 65 8c 00 00 cmpei r12,r12,0 8009fd0: 66 10 00 00 cmpei r16,r16,0 8009fd4: a1 90 60 00 and r12,r12,r16 8009fd8: 45 80 00 04 be r12,r0,8009fe8 <_Heap_Extend+0x268> _Heap_Free_block( heap, extend_first_block ); 8009fdc: 2b 82 00 48 lw r2,(sp+72) 8009fe0: b9 60 08 00 mv r1,r11 8009fe4: fb ff ff 5a calli 8009d4c <_Heap_Free_block> */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( heap->last_block, (uintptr_t) heap->first_block - (uintptr_t) heap->last_block 8009fe8: 29 61 00 24 lw r1,(r11+36) * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 8009fec: 29 63 00 20 lw r3,(r11+32) stats->size += extended_size; if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; 8009ff0: 34 0c 00 01 mvi r12,1 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 8009ff4: 28 22 00 04 lw r2,(r1+4) * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 8009ff8: c8 61 18 00 sub r3,r3,r1 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 8009ffc: 20 42 00 01 andi r2,r2,0x1 block->size_and_flag = size | flag; 800a000: b8 62 10 00 or r2,r3,r2 800a004: 58 22 00 04 sw (r1+4),r2 _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 800a008: 29 61 00 30 lw r1,(r11+48) /* Statistics */ stats->size += extended_size; 800a00c: 29 62 00 2c lw r2,(r11+44) _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 800a010: c8 37 08 00 sub r1,r1,r23 /* Statistics */ stats->size += extended_size; 800a014: b4 41 10 00 add r2,r2,r1 800a018: 59 62 00 2c sw (r11+44),r2 if ( extended_size_ptr != NULL ) 800a01c: 46 80 00 04 be r20,r0,800a02c <_Heap_Extend+0x2ac> <== NEVER TAKEN *extended_size_ptr = extended_size; 800a020: 5a 81 00 00 sw (r20+0),r1 800a024: e0 00 00 02 bi 800a02c <_Heap_Extend+0x2ac> _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; 800a028: 34 0c 00 00 mvi r12,0 if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; } 800a02c: b9 80 08 00 mv r1,r12 800a030: 2b 9d 00 04 lw ra,(sp+4) 800a034: 2b 8b 00 40 lw r11,(sp+64) 800a038: 2b 8c 00 3c lw r12,(sp+60) 800a03c: 2b 8d 00 38 lw r13,(sp+56) 800a040: 2b 8e 00 34 lw r14,(sp+52) 800a044: 2b 8f 00 30 lw r15,(sp+48) 800a048: 2b 90 00 2c lw r16,(sp+44) 800a04c: 2b 91 00 28 lw r17,(sp+40) 800a050: 2b 92 00 24 lw r18,(sp+36) 800a054: 2b 93 00 20 lw r19,(sp+32) 800a058: 2b 94 00 1c lw r20,(sp+28) 800a05c: 2b 95 00 18 lw r21,(sp+24) 800a060: 2b 96 00 14 lw r22,(sp+20) 800a064: 2b 97 00 10 lw r23,(sp+16) 800a068: 2b 98 00 0c lw r24,(sp+12) 800a06c: 2b 99 00 08 lw r25,(sp+8) 800a070: 37 9c 00 48 addi sp,sp,72 800a074: c3 a0 00 00 ret =============================================================================== 0800e830 <_Heap_Free>: #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 800e830: 37 9c ff f4 addi sp,sp,-12 800e834: 5b 8b 00 0c sw (sp+12),r11 800e838: 5b 8c 00 08 sw (sp+8),r12 800e83c: 5b 9d 00 04 sw (sp+4),ra 800e840: b8 20 58 00 mv r11,r1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800e844: 34 4c ff f8 addi r12,r2,-8 800e848: b8 40 08 00 mv r1,r2 800e84c: 29 62 00 10 lw r2,(r11+16) 800e850: f8 00 22 8a calli 8017278 <__umodsi3> 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 800e854: 29 67 00 20 lw r7,(r11+32) uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 800e858: c9 81 18 00 sub r3,r12,r1 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; 800e85c: 34 01 00 00 mvi r1,0 800e860: 54 e3 00 03 bgu r7,r3,800e86c <_Heap_Free+0x3c> 800e864: 29 61 00 24 lw r1,(r11+36) 800e868: f0 23 08 00 cmpgeu r1,r1,r3 Heap_Block *next_block = NULL; uintptr_t block_size = 0; uintptr_t next_block_size = 0; bool next_is_free = false; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 800e86c: b8 20 10 00 mv r2,r1 return false; 800e870: 34 01 00 00 mvi r1,0 Heap_Block *next_block = NULL; uintptr_t block_size = 0; uintptr_t next_block_size = 0; bool next_is_free = false; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 800e874: 44 40 00 66 be r2,r0,800ea0c <_Heap_Free+0x1dc> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800e878: 28 66 00 04 lw r6,(r3+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; 800e87c: 34 04 ff fe mvi r4,-2 800e880: a0 c4 20 00 and r4,r6,r4 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800e884: b4 64 10 00 add r2,r3,r4 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; 800e888: 54 e2 00 03 bgu r7,r2,800e894 <_Heap_Free+0x64> <== NEVER TAKEN 800e88c: 29 61 00 24 lw r1,(r11+36) 800e890: f0 22 08 00 cmpgeu r1,r1,r2 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 800e894: b8 20 28 00 mv r5,r1 _HAssert( false ); return false; 800e898: 34 01 00 00 mvi r1,0 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 800e89c: 44 a0 00 5c be r5,r0,800ea0c <_Heap_Free+0x1dc> <== NEVER TAKEN --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800e8a0: 28 45 00 04 lw r5,(r2+4) 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; 800e8a4: 20 a8 00 01 andi r8,r5,0x1 if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { _HAssert( false ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 800e8a8: 45 00 00 59 be r8,r0,800ea0c <_Heap_Free+0x1dc> <== NEVER TAKEN _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 800e8ac: 29 69 00 24 lw r9,(r11+36) - 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; 800e8b0: 34 01 ff fe mvi r1,-2 800e8b4: a0 a1 28 00 and r5,r5,r1 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 800e8b8: 34 08 00 00 mvi r8,0 800e8bc: 45 22 00 05 be r9,r2,800e8d0 <_Heap_Free+0xa0> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800e8c0: b4 45 08 00 add r1,r2,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; 800e8c4: 28 28 00 04 lw r8,(r1+4) 800e8c8: 21 08 00 01 andi r8,r8,0x1 #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 800e8cc: 65 08 00 00 cmpei r8,r8,0 800e8d0: 20 c6 00 01 andi r6,r6,0x1 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 800e8d4: 21 08 00 ff andi r8,r8,0xff && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 800e8d8: 5c c0 00 24 bne r6,r0,800e968 <_Heap_Free+0x138> uintptr_t const prev_size = block->prev_size; 800e8dc: 28 66 00 00 lw r6,(r3+0) 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; 800e8e0: 34 01 00 00 mvi r1,0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800e8e4: c8 66 18 00 sub r3,r3,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; 800e8e8: 54 e3 00 02 bgu r7,r3,800e8f0 <_Heap_Free+0xc0> <== NEVER TAKEN 800e8ec: f1 23 08 00 cmpgeu r1,r9,r3 Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 800e8f0: b8 20 38 00 mv r7,r1 _HAssert( false ); return( false ); 800e8f4: 34 01 00 00 mvi r1,0 if ( !_Heap_Is_prev_used( block ) ) { uintptr_t const prev_size = block->prev_size; Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 800e8f8: 44 e0 00 45 be r7,r0,800ea0c <_Heap_Free+0x1dc> <== NEVER TAKEN 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; 800e8fc: 28 67 00 04 lw r7,(r3+4) 800e900: 20 e7 00 01 andi r7,r7,0x1 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) ) { 800e904: 44 e0 00 42 be r7,r0,800ea0c <_Heap_Free+0x1dc> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 800e908: 45 00 00 0f be r8,r0,800e944 <_Heap_Free+0x114> return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 800e90c: 28 41 00 08 lw r1,(r2+8) Heap_Block *prev = block->prev; 800e910: 28 42 00 0c lw r2,(r2+12) uintptr_t const size = block_size + prev_size + next_block_size; 800e914: b4 85 28 00 add r5,r4,r5 800e918: b4 a6 30 00 add r6,r5,r6 prev->next = next; 800e91c: 58 41 00 08 sw (r2+8),r1 next->prev = prev; 800e920: 58 22 00 0c sw (r1+12),r2 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 800e924: 29 61 00 38 lw r1,(r11+56) 800e928: 34 21 ff ff addi r1,r1,-1 800e92c: 59 61 00 38 sw (r11+56),r1 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800e930: 38 c1 00 01 ori r1,r6,0x1 800e934: 58 61 00 04 sw (r3+4),r1 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 800e938: b4 66 18 00 add r3,r3,r6 800e93c: 58 66 00 00 sw (r3+0),r6 800e940: e0 00 00 29 bi 800e9e4 <_Heap_Free+0x1b4> } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; 800e944: b4 86 30 00 add r6,r4,r6 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800e948: 38 c1 00 01 ori r1,r6,0x1 800e94c: 58 61 00 04 sw (r3+4),r1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800e950: 28 43 00 04 lw r3,(r2+4) 800e954: 34 01 ff fe mvi r1,-2 next_block->prev_size = size; 800e958: 58 46 00 00 sw (r2+0),r6 _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ 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; 800e95c: a0 61 08 00 and r1,r3,r1 800e960: 58 41 00 04 sw (r2+4),r1 800e964: e0 00 00 20 bi 800e9e4 <_Heap_Free+0x1b4> next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 800e968: 45 00 00 0d be r8,r0,800e99c <_Heap_Free+0x16c> uintptr_t const size = block_size + next_block_size; 800e96c: b4 a4 08 00 add r1,r5,r4 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 800e970: 28 45 00 08 lw r5,(r2+8) Heap_Block *prev = old_block->prev; 800e974: 28 42 00 0c lw r2,(r2+12) new_block->next = next; 800e978: 58 65 00 08 sw (r3+8),r5 new_block->prev = prev; 800e97c: 58 62 00 0c sw (r3+12),r2 next->prev = new_block; prev->next = new_block; 800e980: 58 43 00 08 sw (r2+8),r3 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800e984: 38 22 00 01 ori r2,r1,0x1 Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; 800e988: 58 a3 00 0c sw (r5+12),r3 800e98c: 58 62 00 04 sw (r3+4),r2 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 800e990: b4 61 18 00 add r3,r3,r1 800e994: 58 61 00 00 sw (r3+0),r1 800e998: e0 00 00 13 bi 800e9e4 <_Heap_Free+0x1b4> RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 800e99c: 29 61 00 08 lw r1,(r11+8) new_block->next = next; new_block->prev = block_before; 800e9a0: 58 6b 00 0c sw (r3+12),r11 /* 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; next_block->prev_size = block_size; 800e9a4: 58 44 00 00 sw (r2+0),r4 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 800e9a8: 58 61 00 08 sw (r3+8),r1 new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 800e9ac: 58 23 00 0c sw (r1+12),r3 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; 800e9b0: 38 81 00 01 ori r1,r4,0x1 800e9b4: 58 61 00 04 sw (r3+4),r1 { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 800e9b8: 59 63 00 08 sw (r11+8),r3 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800e9bc: 28 43 00 04 lw r3,(r2+4) 800e9c0: 34 01 ff fe mvi r1,-2 800e9c4: a0 61 08 00 and r1,r3,r1 800e9c8: 58 41 00 04 sw (r2+4),r1 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 800e9cc: 29 61 00 38 lw r1,(r11+56) if ( stats->max_free_blocks < stats->free_blocks ) { 800e9d0: 29 62 00 3c lw r2,(r11+60) block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 800e9d4: 34 21 00 01 addi r1,r1,1 800e9d8: 59 61 00 38 sw (r11+56),r1 if ( stats->max_free_blocks < stats->free_blocks ) { 800e9dc: 50 41 00 02 bgeu r2,r1,800e9e4 <_Heap_Free+0x1b4> stats->max_free_blocks = stats->free_blocks; 800e9e0: 59 61 00 3c sw (r11+60),r1 } } /* Statistics */ --stats->used_blocks; 800e9e4: 29 61 00 40 lw r1,(r11+64) 800e9e8: 34 21 ff ff addi r1,r1,-1 800e9ec: 59 61 00 40 sw (r11+64),r1 ++stats->frees; 800e9f0: 29 61 00 50 lw r1,(r11+80) 800e9f4: 34 21 00 01 addi r1,r1,1 800e9f8: 59 61 00 50 sw (r11+80),r1 stats->free_size += block_size; 800e9fc: 29 61 00 30 lw r1,(r11+48) 800ea00: b4 24 20 00 add r4,r1,r4 800ea04: 59 64 00 30 sw (r11+48),r4 return( true ); 800ea08: 34 01 00 01 mvi r1,1 } 800ea0c: 2b 9d 00 04 lw ra,(sp+4) 800ea10: 2b 8b 00 0c lw r11,(sp+12) 800ea14: 2b 8c 00 08 lw r12,(sp+8) 800ea18: 37 9c 00 0c addi sp,sp,12 800ea1c: c3 a0 00 00 ret =============================================================================== 0800eb7c <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 800eb7c: 37 9c ff ec addi sp,sp,-20 800eb80: 5b 8b 00 14 sw (sp+20),r11 800eb84: 5b 8c 00 10 sw (sp+16),r12 800eb88: 5b 8d 00 0c sw (sp+12),r13 800eb8c: 5b 8e 00 08 sw (sp+8),r14 800eb90: 5b 9d 00 04 sw (sp+4),ra 800eb94: b8 20 58 00 mv r11,r1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800eb98: 34 4e ff f8 addi r14,r2,-8 800eb9c: b8 40 08 00 mv r1,r2 800eba0: b8 40 60 00 mv r12,r2 800eba4: 29 62 00 10 lw r2,(r11+16) 800eba8: b8 60 68 00 mv r13,r3 800ebac: f8 00 21 b3 calli 8017278 <__umodsi3> 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 800ebb0: 29 62 00 20 lw r2,(r11+32) uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 800ebb4: c9 c1 20 00 sub r4,r14,r1 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; 800ebb8: 34 01 00 00 mvi r1,0 800ebbc: 54 44 00 03 bgu r2,r4,800ebc8 <_Heap_Size_of_alloc_area+0x4c> 800ebc0: 29 61 00 24 lw r1,(r11+36) 800ebc4: f0 24 08 00 cmpgeu r1,r1,r4 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 800ebc8: b8 20 18 00 mv r3,r1 return false; 800ebcc: 34 01 00 00 mvi r1,0 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 800ebd0: 44 60 00 13 be r3,r0,800ec1c <_Heap_Size_of_alloc_area+0xa0> - 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; 800ebd4: 28 83 00 04 lw r3,(r4+4) 800ebd8: 34 01 ff fe mvi r1,-2 800ebdc: a0 23 08 00 and r1,r1,r3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800ebe0: b4 81 20 00 add r4,r4,r1 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; 800ebe4: 34 01 00 00 mvi r1,0 800ebe8: 54 44 00 03 bgu r2,r4,800ebf4 <_Heap_Size_of_alloc_area+0x78><== NEVER TAKEN 800ebec: 29 61 00 24 lw r1,(r11+36) 800ebf0: f0 24 08 00 cmpgeu r1,r1,r4 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 800ebf4: b8 20 10 00 mv r2,r1 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ) { return false; 800ebf8: 34 01 00 00 mvi r1,0 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 800ebfc: 44 40 00 08 be r2,r0,800ec1c <_Heap_Size_of_alloc_area+0xa0><== NEVER TAKEN 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; 800ec00: 28 82 00 04 lw r2,(r4+4) 800ec04: 20 42 00 01 andi r2,r2,0x1 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 800ec08: 44 40 00 05 be r2,r0,800ec1c <_Heap_Size_of_alloc_area+0xa0><== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 800ec0c: c8 8c 20 00 sub r4,r4,r12 800ec10: 34 84 00 04 addi r4,r4,4 800ec14: 59 a4 00 00 sw (r13+0),r4 return true; 800ec18: 34 01 00 01 mvi r1,1 } 800ec1c: 2b 9d 00 04 lw ra,(sp+4) 800ec20: 2b 8b 00 14 lw r11,(sp+20) 800ec24: 2b 8c 00 10 lw r12,(sp+16) 800ec28: 2b 8d 00 0c lw r13,(sp+12) 800ec2c: 2b 8e 00 08 lw r14,(sp+8) 800ec30: 37 9c 00 14 addi sp,sp,20 800ec34: c3 a0 00 00 ret =============================================================================== 08004c64 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 8004c64: 37 9c ff a0 addi sp,sp,-96 8004c68: 5b 8b 00 50 sw (sp+80),r11 8004c6c: 5b 8c 00 4c sw (sp+76),r12 8004c70: 5b 8d 00 48 sw (sp+72),r13 8004c74: 5b 8e 00 44 sw (sp+68),r14 8004c78: 5b 8f 00 40 sw (sp+64),r15 8004c7c: 5b 90 00 3c sw (sp+60),r16 8004c80: 5b 91 00 38 sw (sp+56),r17 8004c84: 5b 92 00 34 sw (sp+52),r18 8004c88: 5b 93 00 30 sw (sp+48),r19 8004c8c: 5b 94 00 2c sw (sp+44),r20 8004c90: 5b 95 00 28 sw (sp+40),r21 8004c94: 5b 96 00 24 sw (sp+36),r22 8004c98: 5b 97 00 20 sw (sp+32),r23 8004c9c: 5b 98 00 1c sw (sp+28),r24 8004ca0: 5b 99 00 18 sw (sp+24),r25 8004ca4: 5b 9b 00 14 sw (sp+20),fp 8004ca8: 5b 9d 00 10 sw (sp+16),ra 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; 8004cac: 78 0d 08 00 mvhi r13,0x800 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 8004cb0: 20 63 00 ff andi r3,r3,0xff 8004cb4: b8 20 60 00 mv r12,r1 8004cb8: b8 40 70 00 mv r14,r2 uintptr_t const page_size = heap->page_size; 8004cbc: 28 33 00 10 lw r19,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 8004cc0: 28 35 00 14 lw r21,(r1+20) Heap_Block *const first_block = heap->first_block; 8004cc4: 28 34 00 20 lw r20,(r1+32) Heap_Block *const last_block = heap->last_block; 8004cc8: 28 36 00 24 lw r22,(r1+36) Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 8004ccc: 39 ad 4b cc ori r13,r13,0x4bcc 8004cd0: 44 60 00 03 be r3,r0,8004cdc <_Heap_Walk+0x78> 8004cd4: 78 0d 08 00 mvhi r13,0x800 8004cd8: 39 ad 4b f0 ori r13,r13,0x4bf0 if ( !_System_state_Is_up( _System_state_Get() ) ) { 8004cdc: 78 03 08 01 mvhi r3,0x801 8004ce0: 38 63 6a 74 ori r3,r3,0x6a74 8004ce4: 28 67 00 00 lw r7,(r3+0) 8004ce8: 34 02 00 03 mvi r2,3 return true; 8004cec: 34 03 00 01 mvi r3,1 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() ) ) { 8004cf0: 5c e2 01 08 bne r7,r2,8005110 <_Heap_Walk+0x4ac> <== NEVER TAKEN 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)( 8004cf4: 29 81 00 08 lw r1,(r12+8) 8004cf8: 29 86 00 18 lw r6,(r12+24) 8004cfc: 29 87 00 1c lw r7,(r12+28) 8004d00: 5b 81 00 08 sw (sp+8),r1 8004d04: 29 81 00 0c lw r1,(r12+12) 8004d08: 78 03 08 01 mvhi r3,0x801 8004d0c: 5b 96 00 04 sw (sp+4),r22 8004d10: 5b 81 00 0c sw (sp+12),r1 8004d14: 34 02 00 00 mvi r2,0 8004d18: b9 c0 08 00 mv r1,r14 8004d1c: 38 63 41 d8 ori r3,r3,0x41d8 8004d20: ba 60 20 00 mv r4,r19 8004d24: ba a0 28 00 mv r5,r21 8004d28: ba 80 40 00 mv r8,r20 8004d2c: d9 a0 00 00 call r13 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 8004d30: 5e 60 00 06 bne r19,r0,8004d48 <_Heap_Walk+0xe4> (*printer)( source, true, "page size is zero\n" ); 8004d34: 78 03 08 01 mvhi r3,0x801 8004d38: b9 c0 08 00 mv r1,r14 8004d3c: 34 02 00 01 mvi r2,1 8004d40: 38 63 42 6c ori r3,r3,0x426c 8004d44: e0 00 00 25 bi 8004dd8 <_Heap_Walk+0x174> ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 8004d48: 22 6f 00 07 andi r15,r19,0x7 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 8004d4c: 45 e0 00 07 be r15,r0,8004d68 <_Heap_Walk+0x104> (*printer)( 8004d50: 78 03 08 01 mvhi r3,0x801 8004d54: b9 c0 08 00 mv r1,r14 8004d58: 34 02 00 01 mvi r2,1 8004d5c: 38 63 42 80 ori r3,r3,0x4280 8004d60: ba 60 20 00 mv r4,r19 8004d64: e0 00 01 04 bi 8005174 <_Heap_Walk+0x510> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8004d68: ba a0 08 00 mv r1,r21 8004d6c: ba 60 10 00 mv r2,r19 8004d70: fb ff ef 82 calli 8000b78 <__umodsi3> 8004d74: b8 20 58 00 mv r11,r1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 8004d78: 44 2f 00 07 be r1,r15,8004d94 <_Heap_Walk+0x130> (*printer)( 8004d7c: 78 03 08 01 mvhi r3,0x801 8004d80: b9 c0 08 00 mv r1,r14 8004d84: 34 02 00 01 mvi r2,1 8004d88: 38 63 42 a0 ori r3,r3,0x42a0 8004d8c: ba a0 20 00 mv r4,r21 8004d90: e0 00 00 f9 bi 8005174 <_Heap_Walk+0x510> 8004d94: 36 81 00 08 addi r1,r20,8 8004d98: ba 60 10 00 mv r2,r19 8004d9c: fb ff ef 77 calli 8000b78 <__umodsi3> ); return false; } if ( 8004da0: 44 2b 00 07 be r1,r11,8004dbc <_Heap_Walk+0x158> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 8004da4: 78 03 08 01 mvhi r3,0x801 8004da8: b9 c0 08 00 mv r1,r14 8004dac: 34 02 00 01 mvi r2,1 8004db0: 38 63 42 c4 ori r3,r3,0x42c4 8004db4: ba 80 20 00 mv r4,r20 8004db8: e0 00 00 ef bi 8005174 <_Heap_Walk+0x510> 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; 8004dbc: 2a 82 00 04 lw r2,(r20+4) 8004dc0: 20 42 00 01 andi r2,r2,0x1 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 8004dc4: 5c 41 00 07 bne r2,r1,8004de0 <_Heap_Walk+0x17c> (*printer)( 8004dc8: 78 03 08 01 mvhi r3,0x801 8004dcc: b9 c0 08 00 mv r1,r14 8004dd0: 34 02 00 01 mvi r2,1 8004dd4: 38 63 42 f8 ori r3,r3,0x42f8 8004dd8: d9 a0 00 00 call r13 8004ddc: e0 00 00 40 bi 8004edc <_Heap_Walk+0x278> - 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; 8004de0: 2a cf 00 04 lw r15,(r22+4) 8004de4: 34 02 ff fe mvi r2,-2 8004de8: a0 4f 78 00 and r15,r2,r15 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8004dec: b6 cf 78 00 add r15,r22,r15 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; 8004df0: 29 e2 00 04 lw r2,(r15+4) 8004df4: 20 42 00 01 andi r2,r2,0x1 ); return false; } if ( _Heap_Is_free( last_block ) ) { 8004df8: 5c 41 00 06 bne r2,r1,8004e10 <_Heap_Walk+0x1ac> (*printer)( 8004dfc: 78 03 08 01 mvhi r3,0x801 8004e00: b9 c0 08 00 mv r1,r14 8004e04: 34 02 00 01 mvi r2,1 8004e08: 38 63 43 28 ori r3,r3,0x4328 8004e0c: e3 ff ff f3 bi 8004dd8 <_Heap_Walk+0x174> ); return false; } if ( 8004e10: 45 f4 00 06 be r15,r20,8004e28 <_Heap_Walk+0x1c4> <== ALWAYS TAKEN _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 8004e14: 78 03 08 01 mvhi r3,0x801 <== NOT EXECUTED 8004e18: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 8004e1c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8004e20: 38 63 43 40 ori r3,r3,0x4340 <== NOT EXECUTED 8004e24: e3 ff ff ed bi 8004dd8 <_Heap_Walk+0x174> <== NOT EXECUTED int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 8004e28: 29 92 00 10 lw r18,(r12+16) block = next_block; } while ( block != first_block ); return true; } 8004e2c: 29 8b 00 08 lw r11,(r12+8) Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 8004e30: b9 80 80 00 mv r16,r12 - 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; 8004e34: 34 11 ff fe mvi r17,-2 8004e38: e0 00 00 2d bi 8004eec <_Heap_Walk+0x288> 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; 8004e3c: 29 83 00 20 lw r3,(r12+32) 8004e40: 34 01 00 00 mvi r1,0 8004e44: 54 6b 00 03 bgu r3,r11,8004e50 <_Heap_Walk+0x1ec> 8004e48: 29 81 00 24 lw r1,(r12+36) 8004e4c: f0 2b 08 00 cmpgeu r1,r1,r11 const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { 8004e50: 5c 20 00 06 bne r1,r0,8004e68 <_Heap_Walk+0x204> (*printer)( 8004e54: 78 03 08 01 mvhi r3,0x801 8004e58: b9 c0 08 00 mv r1,r14 8004e5c: 34 02 00 01 mvi r2,1 8004e60: 38 63 43 70 ori r3,r3,0x4370 8004e64: e0 00 00 14 bi 8004eb4 <_Heap_Walk+0x250> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8004e68: 35 61 00 08 addi r1,r11,8 8004e6c: ba 40 10 00 mv r2,r18 8004e70: fb ff ef 42 calli 8000b78 <__umodsi3> ); return false; } if ( 8004e74: 44 20 00 06 be r1,r0,8004e8c <_Heap_Walk+0x228> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 8004e78: 78 03 08 01 mvhi r3,0x801 8004e7c: b9 c0 08 00 mv r1,r14 8004e80: 34 02 00 01 mvi r2,1 8004e84: 38 63 43 90 ori r3,r3,0x4390 8004e88: e0 00 00 0b bi 8004eb4 <_Heap_Walk+0x250> - 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; 8004e8c: 29 63 00 04 lw r3,(r11+4) 8004e90: a2 23 18 00 and r3,r17,r3 block = next_block; } while ( block != first_block ); return true; } 8004e94: b5 63 18 00 add r3,r11,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; 8004e98: 28 63 00 04 lw r3,(r3+4) 8004e9c: 20 63 00 01 andi r3,r3,0x1 ); return false; } if ( _Heap_Is_used( free_block ) ) { 8004ea0: 44 61 00 07 be r3,r1,8004ebc <_Heap_Walk+0x258> (*printer)( 8004ea4: 78 03 08 01 mvhi r3,0x801 8004ea8: b9 c0 08 00 mv r1,r14 8004eac: 34 02 00 01 mvi r2,1 8004eb0: 38 63 43 c0 ori r3,r3,0x43c0 8004eb4: b9 60 20 00 mv r4,r11 8004eb8: e0 00 00 af bi 8005174 <_Heap_Walk+0x510> ); return false; } if ( free_block->prev != prev_block ) { 8004ebc: 29 65 00 0c lw r5,(r11+12) 8004ec0: 44 b0 00 09 be r5,r16,8004ee4 <_Heap_Walk+0x280> (*printer)( 8004ec4: 78 03 08 01 mvhi r3,0x801 8004ec8: b9 c0 08 00 mv r1,r14 8004ecc: 34 02 00 01 mvi r2,1 8004ed0: 38 63 43 dc ori r3,r3,0x43dc 8004ed4: b9 60 20 00 mv r4,r11 8004ed8: d9 a0 00 00 call r13 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8004edc: 34 03 00 00 mvi r3,0 8004ee0: e0 00 00 8c bi 8005110 <_Heap_Walk+0x4ac> return false; } prev_block = free_block; free_block = free_block->next; 8004ee4: b9 60 80 00 mv r16,r11 8004ee8: 29 6b 00 08 lw r11,(r11+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 ) { 8004eec: 5d 6c ff d4 bne r11,r12,8004e3c <_Heap_Walk+0x1d8> 8004ef0: e0 00 00 03 bi 8004efc <_Heap_Walk+0x298> block->prev_size ); } block = next_block; } while ( block != first_block ); 8004ef4: ba 20 78 00 mv r15,r17 8004ef8: e0 00 00 15 bi 8004f4c <_Heap_Walk+0x2e8> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8004efc: 78 01 08 01 mvhi r1,0x801 8004f00: 38 21 45 8c ori r1,r1,0x458c 8004f04: 5b 81 00 54 sw (sp+84),r1 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( 8004f08: 78 01 08 01 mvhi r1,0x801 8004f0c: 38 21 45 74 ori r1,r1,0x4574 8004f10: 5b 81 00 58 sw (sp+88),r1 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)( 8004f14: 78 01 08 01 mvhi r1,0x801 8004f18: 38 21 41 a0 ori r1,r1,0x41a0 8004f1c: 5b 81 00 5c sw (sp+92),r1 8004f20: 78 01 08 01 mvhi r1,0x801 8004f24: 38 21 41 bc ori r1,r1,0x41bc 8004f28: 78 1b 08 01 mvhi fp,0x801 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8004f2c: 78 17 08 01 mvhi r23,0x801 8004f30: 78 19 08 01 mvhi r25,0x801 block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8004f34: 78 18 08 01 mvhi r24,0x801 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)( 8004f38: 5b 81 00 60 sw (sp+96),r1 8004f3c: 3b 7b 44 d0 ori fp,fp,0x44d0 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8004f40: 3a f7 45 40 ori r23,r23,0x4540 8004f44: 3b 39 41 cc ori r25,r25,0x41cc block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8004f48: 3b 18 41 b0 ori r24,r24,0x41b0 block = next_block; } while ( block != first_block ); return true; } 8004f4c: 29 f2 00 04 lw r18,(r15+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; 8004f50: 34 01 ff fe mvi r1,-2 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; 8004f54: 29 84 00 20 lw r4,(r12+32) - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8004f58: a2 41 80 00 and r16,r18,r1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8004f5c: b5 f0 88 00 add r17,r15,r16 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; 8004f60: 34 06 00 00 mvi r6,0 8004f64: 54 91 00 03 bgu r4,r17,8004f70 <_Heap_Walk+0x30c> <== NEVER TAKEN 8004f68: 29 86 00 24 lw r6,(r12+36) 8004f6c: f0 d1 30 00 cmpgeu r6,r6,r17 bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 8004f70: 5c c0 00 06 bne r6,r0,8004f88 <_Heap_Walk+0x324> (*printer)( 8004f74: 78 03 08 01 mvhi r3,0x801 8004f78: b9 c0 08 00 mv r1,r14 8004f7c: 34 02 00 01 mvi r2,1 8004f80: 38 63 44 10 ori r3,r3,0x4410 8004f84: e0 00 00 1f bi 8005000 <_Heap_Walk+0x39c> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8004f88: ba 00 08 00 mv r1,r16 8004f8c: ba 60 10 00 mv r2,r19 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; 8004f90: fd f6 58 00 cmpne r11,r15,r22 8004f94: fb ff ee f9 calli 8000b78 <__umodsi3> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 8004f98: 44 20 00 09 be r1,r0,8004fbc <_Heap_Walk+0x358> 8004f9c: 45 60 00 08 be r11,r0,8004fbc <_Heap_Walk+0x358> (*printer)( 8004fa0: 78 03 08 01 mvhi r3,0x801 8004fa4: b9 c0 08 00 mv r1,r14 8004fa8: 34 02 00 01 mvi r2,1 8004fac: 38 63 44 40 ori r3,r3,0x4440 8004fb0: b9 e0 20 00 mv r4,r15 8004fb4: ba 00 28 00 mv r5,r16 8004fb8: e3 ff ff c8 bi 8004ed8 <_Heap_Walk+0x274> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 8004fbc: 52 15 00 0b bgeu r16,r21,8004fe8 <_Heap_Walk+0x384> 8004fc0: 45 60 00 0a be r11,r0,8004fe8 <_Heap_Walk+0x384> <== NEVER TAKEN (*printer)( 8004fc4: 78 03 08 01 mvhi r3,0x801 8004fc8: b9 c0 08 00 mv r1,r14 8004fcc: 34 02 00 01 mvi r2,1 8004fd0: 38 63 44 70 ori r3,r3,0x4470 8004fd4: b9 e0 20 00 mv r4,r15 8004fd8: ba 00 28 00 mv r5,r16 8004fdc: ba a0 30 00 mv r6,r21 8004fe0: d9 a0 00 00 call r13 8004fe4: e3 ff ff be bi 8004edc <_Heap_Walk+0x278> ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 8004fe8: 56 2f 00 09 bgu r17,r15,800500c <_Heap_Walk+0x3a8> 8004fec: 45 60 00 08 be r11,r0,800500c <_Heap_Walk+0x3a8> (*printer)( 8004ff0: 78 03 08 01 mvhi r3,0x801 8004ff4: b9 c0 08 00 mv r1,r14 8004ff8: 34 02 00 01 mvi r2,1 8004ffc: 38 63 44 9c ori r3,r3,0x449c 8005000: b9 e0 20 00 mv r4,r15 8005004: ba 20 28 00 mv r5,r17 8005008: e3 ff ff b4 bi 8004ed8 <_Heap_Walk+0x274> 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; 800500c: 2a 24 00 04 lw r4,(r17+4) 8005010: 22 52 00 01 andi r18,r18,0x1 8005014: 20 84 00 01 andi r4,r4,0x1 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 8005018: 5c 80 00 2d bne r4,r0,80050cc <_Heap_Walk+0x468> 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 ? 800501c: 29 e6 00 0c lw r6,(r15+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)( 8005020: 29 85 00 08 lw r5,(r12+8) block = next_block; } while ( block != first_block ); return true; } 8005024: 29 84 00 0c lw r4,(r12+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)( 8005028: 2b 87 00 5c lw r7,(sp+92) 800502c: 44 c5 00 04 be r6,r5,800503c <_Heap_Walk+0x3d8> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8005030: ba e0 38 00 mv r7,r23 8005034: 5c cc 00 02 bne r6,r12,800503c <_Heap_Walk+0x3d8> 8005038: bb 00 38 00 mv r7,r24 block->next, block->next == last_free_block ? 800503c: 29 e8 00 08 lw r8,(r15+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)( 8005040: 2b 89 00 60 lw r9,(sp+96) 8005044: 45 04 00 04 be r8,r4,8005054 <_Heap_Walk+0x3f0> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8005048: ba e0 48 00 mv r9,r23 800504c: 5d 0c 00 02 bne r8,r12,8005054 <_Heap_Walk+0x3f0> 8005050: bb 20 48 00 mv r9,r25 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)( 8005054: 5b 89 00 04 sw (sp+4),r9 8005058: b9 c0 08 00 mv r1,r14 800505c: 34 02 00 00 mvi r2,0 8005060: bb 60 18 00 mv r3,fp 8005064: b9 e0 20 00 mv r4,r15 8005068: ba 00 28 00 mv r5,r16 800506c: d9 a0 00 00 call r13 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 8005070: 2a 26 00 00 lw r6,(r17+0) 8005074: 46 06 00 0a be r16,r6,800509c <_Heap_Walk+0x438> (*printer)( 8005078: 78 03 08 01 mvhi r3,0x801 800507c: b9 c0 08 00 mv r1,r14 8005080: 34 02 00 01 mvi r2,1 8005084: 38 63 45 08 ori r3,r3,0x4508 8005088: b9 e0 20 00 mv r4,r15 800508c: ba 00 28 00 mv r5,r16 8005090: ba 20 38 00 mv r7,r17 8005094: d9 a0 00 00 call r13 8005098: e3 ff ff 91 bi 8004edc <_Heap_Walk+0x278> ); return false; } if ( !prev_used ) { 800509c: 5e 40 00 06 bne r18,r0,80050b4 <_Heap_Walk+0x450> (*printer)( 80050a0: 78 03 08 01 mvhi r3,0x801 80050a4: b9 c0 08 00 mv r1,r14 80050a8: 34 02 00 01 mvi r2,1 80050ac: 38 63 45 44 ori r3,r3,0x4544 80050b0: e0 00 00 30 bi 8005170 <_Heap_Walk+0x50c> block = next_block; } while ( block != first_block ); return true; } 80050b4: 29 85 00 08 lw r5,(r12+8) 80050b8: e0 00 00 03 bi 80050c4 <_Heap_Walk+0x460> { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { if ( free_block == block ) { 80050bc: 44 af 00 13 be r5,r15,8005108 <_Heap_Walk+0x4a4> return true; } free_block = free_block->next; 80050c0: 28 a5 00 08 lw r5,(r5+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 ) { 80050c4: 5c ac ff fe bne r5,r12,80050bc <_Heap_Walk+0x458> 80050c8: e0 00 00 26 bi 8005160 <_Heap_Walk+0x4fc> if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 80050cc: 46 40 00 08 be r18,r0,80050ec <_Heap_Walk+0x488> (*printer)( 80050d0: 2b 83 00 58 lw r3,(sp+88) 80050d4: b9 c0 08 00 mv r1,r14 80050d8: 34 02 00 00 mvi r2,0 80050dc: b9 e0 20 00 mv r4,r15 80050e0: ba 00 28 00 mv r5,r16 80050e4: d9 a0 00 00 call r13 80050e8: e0 00 00 08 bi 8005108 <_Heap_Walk+0x4a4> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 80050ec: 2b 83 00 54 lw r3,(sp+84) 80050f0: 29 e6 00 00 lw r6,(r15+0) 80050f4: b9 c0 08 00 mv r1,r14 80050f8: 34 02 00 00 mvi r2,0 80050fc: b9 e0 20 00 mv r4,r15 8005100: ba 00 28 00 mv r5,r16 8005104: d9 a0 00 00 call r13 block->prev_size ); } block = next_block; } while ( block != first_block ); 8005108: 5e 91 ff 7b bne r20,r17,8004ef4 <_Heap_Walk+0x290> return true; 800510c: 34 03 00 01 mvi r3,1 } 8005110: b8 60 08 00 mv r1,r3 8005114: 2b 9d 00 10 lw ra,(sp+16) 8005118: 2b 8b 00 50 lw r11,(sp+80) 800511c: 2b 8c 00 4c lw r12,(sp+76) 8005120: 2b 8d 00 48 lw r13,(sp+72) 8005124: 2b 8e 00 44 lw r14,(sp+68) 8005128: 2b 8f 00 40 lw r15,(sp+64) 800512c: 2b 90 00 3c lw r16,(sp+60) 8005130: 2b 91 00 38 lw r17,(sp+56) 8005134: 2b 92 00 34 lw r18,(sp+52) 8005138: 2b 93 00 30 lw r19,(sp+48) 800513c: 2b 94 00 2c lw r20,(sp+44) 8005140: 2b 95 00 28 lw r21,(sp+40) 8005144: 2b 96 00 24 lw r22,(sp+36) 8005148: 2b 97 00 20 lw r23,(sp+32) 800514c: 2b 98 00 1c lw r24,(sp+28) 8005150: 2b 99 00 18 lw r25,(sp+24) 8005154: 2b 9b 00 14 lw fp,(sp+20) 8005158: 37 9c 00 60 addi sp,sp,96 800515c: c3 a0 00 00 ret return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 8005160: 78 03 08 01 mvhi r3,0x801 8005164: b9 c0 08 00 mv r1,r14 8005168: 34 02 00 01 mvi r2,1 800516c: 38 63 45 b4 ori r3,r3,0x45b4 8005170: b9 e0 20 00 mv r4,r15 8005174: d9 a0 00 00 call r13 8005178: e3 ff ff 59 bi 8004edc <_Heap_Walk+0x278> =============================================================================== 08004574 <_IO_Manager_initialization>: * workspace. * */ void _IO_Manager_initialization(void) { 8004574: 37 9c ff e8 addi sp,sp,-24 8004578: 5b 8b 00 18 sw (sp+24),r11 800457c: 5b 8c 00 14 sw (sp+20),r12 8004580: 5b 8d 00 10 sw (sp+16),r13 8004584: 5b 8e 00 0c sw (sp+12),r14 8004588: 5b 8f 00 08 sw (sp+8),r15 800458c: 5b 9d 00 04 sw (sp+4),ra uint32_t index; rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = Configuration.Device_driver_table; 8004590: 78 01 08 01 mvhi r1,0x801 8004594: 38 21 90 ac ori r1,r1,0x90ac drivers_in_table = Configuration.number_of_device_drivers; 8004598: 28 2d 00 30 lw r13,(r1+48) number_of_drivers = Configuration.maximum_drivers; 800459c: 28 2b 00 2c lw r11,(r1+44) uint32_t index; rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = Configuration.Device_driver_table; 80045a0: 28 2e 00 34 lw r14,(r1+52) /* * If the user claims there are less drivers than are actually in * the table, then let's just go with the table's count. */ if ( number_of_drivers <= drivers_in_table ) 80045a4: 51 ab 00 03 bgeu r13,r11,80045b0 <_IO_Manager_initialization+0x3c> /* * If the maximum number of driver is the same as the number in the * table, then we do not have to copy the driver table. They can't * register any dynamically. */ if ( number_of_drivers == drivers_in_table ) { 80045a8: 5d 6d 00 0a bne r11,r13,80045d0 <_IO_Manager_initialization+0x5c><== ALWAYS TAKEN 80045ac: e0 00 00 02 bi 80045b4 <_IO_Manager_initialization+0x40> <== NOT EXECUTED /* * If the user claims there are less drivers than are actually in * the table, then let's just go with the table's count. */ if ( number_of_drivers <= drivers_in_table ) 80045b0: b9 a0 58 00 mv r11,r13 * If the maximum number of driver is the same as the number in the * table, then we do not have to copy the driver table. They can't * register any dynamically. */ if ( number_of_drivers == drivers_in_table ) { _IO_Driver_address_table = driver_table; 80045b4: 78 01 08 01 mvhi r1,0x801 80045b8: 38 21 a2 44 ori r1,r1,0xa244 80045bc: 58 2e 00 00 sw (r1+0),r14 _IO_Number_of_drivers = number_of_drivers; 80045c0: 78 01 08 01 mvhi r1,0x801 80045c4: 38 21 a2 40 ori r1,r1,0xa240 80045c8: 58 2b 00 00 sw (r1+0),r11 return; 80045cc: e0 00 00 27 bi 8004668 <_IO_Manager_initialization+0xf4> * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) 80045d0: 34 02 00 01 mvi r2,1 80045d4: b9 60 08 00 mv r1,r11 80045d8: f8 00 4a 3e calli 8016ed0 <__ashlsi3> 80045dc: 34 02 00 03 mvi r2,3 80045e0: b4 2b 08 00 add r1,r1,r11 80045e4: f8 00 4a 3b calli 8016ed0 <__ashlsi3> 80045e8: b8 20 78 00 mv r15,r1 * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( 80045ec: f8 00 0d 9c calli 8007c5c <_Workspace_Allocate_or_fatal_error> sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 80045f0: 78 02 08 01 mvhi r2,0x801 80045f4: 38 42 a2 40 ori r2,r2,0xa240 /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) 80045f8: 78 0c 08 01 mvhi r12,0x801 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 80045fc: 58 4b 00 00 sw (r2+0),r11 memset( 8004600: b9 e0 18 00 mv r3,r15 /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) 8004604: 39 8c a2 44 ori r12,r12,0xa244 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 8004608: 34 02 00 00 mvi r2,0 /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) 800460c: 59 81 00 00 sw (r12+0),r1 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 8004610: f8 00 36 b1 calli 80120d4 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 8004614: 34 03 00 00 mvi r3,0 8004618: 34 04 00 00 mvi r4,0 800461c: e0 00 00 12 bi 8004664 <_IO_Manager_initialization+0xf0> _IO_Driver_address_table[index] = driver_table[index]; 8004620: 29 82 00 00 lw r2,(r12+0) * registration. The driver table is now allocated in the * workspace. * */ void _IO_Manager_initialization(void) 8004624: b5 c3 08 00 add r1,r14,r3 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; 8004628: 28 29 00 00 lw r9,(r1+0) 800462c: 28 28 00 04 lw r8,(r1+4) 8004630: 28 27 00 08 lw r7,(r1+8) 8004634: 28 26 00 0c lw r6,(r1+12) 8004638: 28 25 00 10 lw r5,(r1+16) 800463c: 28 21 00 14 lw r1,(r1+20) 8004640: b4 43 10 00 add r2,r2,r3 8004644: 58 49 00 00 sw (r2+0),r9 8004648: 58 48 00 04 sw (r2+4),r8 800464c: 58 47 00 08 sw (r2+8),r7 8004650: 58 46 00 0c sw (r2+12),r6 8004654: 58 45 00 10 sw (r2+16),r5 8004658: 58 41 00 14 sw (r2+20),r1 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 800465c: 34 84 00 01 addi r4,r4,1 8004660: 34 63 00 18 addi r3,r3,24 8004664: 55 a4 ff ef bgu r13,r4,8004620 <_IO_Manager_initialization+0xac> _IO_Driver_address_table[index] = driver_table[index]; number_of_drivers = drivers_in_table; } 8004668: 2b 9d 00 04 lw ra,(sp+4) 800466c: 2b 8b 00 18 lw r11,(sp+24) 8004670: 2b 8c 00 14 lw r12,(sp+20) 8004674: 2b 8d 00 10 lw r13,(sp+16) 8004678: 2b 8e 00 0c lw r14,(sp+12) 800467c: 2b 8f 00 08 lw r15,(sp+8) 8004680: 37 9c 00 18 addi sp,sp,24 8004684: c3 a0 00 00 ret =============================================================================== 080056d8 <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 80056d8: 37 9c ff ec addi sp,sp,-20 80056dc: 5b 8b 00 14 sw (sp+20),r11 80056e0: 5b 8c 00 10 sw (sp+16),r12 80056e4: 5b 8d 00 0c sw (sp+12),r13 80056e8: 5b 8e 00 08 sw (sp+8),r14 80056ec: 5b 9d 00 04 sw (sp+4),ra 80056f0: b8 20 58 00 mv r11,r1 * If the application is using the optional manager stubs and * still attempts to create the object, the information block * should be all zeroed out because it is in the BSS. So let's * check that code for this manager is even present. */ if ( information->size == 0 ) 80056f4: 28 21 00 18 lw r1,(r1+24) return NULL; 80056f8: 34 0c 00 00 mvi r12,0 * If the application is using the optional manager stubs and * still attempts to create the object, the information block * should be all zeroed out because it is in the BSS. So let's * check that code for this manager is even present. */ if ( information->size == 0 ) 80056fc: 44 20 00 1e be r1,r0,8005774 <_Objects_Allocate+0x9c> <== NEVER TAKEN /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 8005700: 35 6d 00 20 addi r13,r11,32 8005704: b9 a0 08 00 mv r1,r13 8005708: fb ff fd 3b calli 8004bf4 <_Chain_Get> 800570c: b8 20 60 00 mv r12,r1 8005710: b8 20 70 00 mv r14,r1 if ( information->auto_extend ) { 8005714: 41 61 00 12 lbu r1,(r11+18) 8005718: 44 20 00 17 be r1,r0,8005774 <_Objects_Allocate+0x9c> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 800571c: 5d 80 00 07 bne r12,r0,8005738 <_Objects_Allocate+0x60> _Objects_Extend_information( information ); 8005720: b9 60 08 00 mv r1,r11 8005724: f8 00 00 32 calli 80057ec <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 8005728: b9 a0 08 00 mv r1,r13 800572c: fb ff fd 32 calli 8004bf4 <_Chain_Get> 8005730: b8 20 60 00 mv r12,r1 } if ( the_object ) { 8005734: 44 2e 00 10 be r1,r14,8005774 <_Objects_Allocate+0x9c> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 8005738: 2d 82 00 0a lhu r2,(r12+10) 800573c: 2d 61 00 0a lhu r1,(r11+10) _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 8005740: c8 41 08 00 sub r1,r2,r1 8005744: 2d 62 00 14 lhu r2,(r11+20) 8005748: f8 00 46 bc calli 8017238 <__udivsi3> information->inactive_per_block[ block ]--; 800574c: 34 02 00 02 mvi r2,2 8005750: f8 00 45 e0 calli 8016ed0 <__ashlsi3> 8005754: 29 62 00 30 lw r2,(r11+48) 8005758: b4 41 08 00 add r1,r2,r1 800575c: 28 22 00 00 lw r2,(r1+0) 8005760: 34 42 ff ff addi r2,r2,-1 8005764: 58 22 00 00 sw (r1+0),r2 information->inactive--; 8005768: 2d 61 00 2c lhu r1,(r11+44) 800576c: 34 21 ff ff addi r1,r1,-1 8005770: 0d 61 00 2c sh (r11+44),r1 ); } #endif return the_object; } 8005774: b9 80 08 00 mv r1,r12 8005778: 2b 9d 00 04 lw ra,(sp+4) 800577c: 2b 8b 00 14 lw r11,(sp+20) 8005780: 2b 8c 00 10 lw r12,(sp+16) 8005784: 2b 8d 00 0c lw r13,(sp+12) 8005788: 2b 8e 00 08 lw r14,(sp+8) 800578c: 37 9c 00 14 addi sp,sp,20 8005790: c3 a0 00 00 ret =============================================================================== 0800ec84 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 800ec84: 37 9c ff ec addi sp,sp,-20 800ec88: 5b 8b 00 14 sw (sp+20),r11 800ec8c: 5b 8c 00 10 sw (sp+16),r12 800ec90: 5b 8d 00 0c sw (sp+12),r13 800ec94: 5b 8e 00 08 sw (sp+8),r14 800ec98: 5b 9d 00 04 sw (sp+4),ra Objects_Information *info; int the_class_api_maximum; if ( !the_class ) return NULL; 800ec9c: 34 0b 00 00 mvi r11,0 Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 800eca0: b8 20 70 00 mv r14,r1 800eca4: b8 40 60 00 mv r12,r2 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 800eca8: 44 40 00 16 be r2,r0,800ed00 <_Objects_Get_information+0x7c> /* * This call implicitly validates the_api so we do not call * _Objects_Is_api_valid above here. */ the_class_api_maximum = _Objects_API_maximum_class( the_api ); 800ecac: f8 00 09 4c calli 80111dc <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 800ecb0: 44 20 00 14 be r1,r0,800ed00 <_Objects_Get_information+0x7c> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 800ecb4: 55 81 00 13 bgu r12,r1,800ed00 <_Objects_Get_information+0x7c> return NULL; if ( !_Objects_Information_table[ the_api ] ) 800ecb8: 78 0d 08 01 mvhi r13,0x801 800ecbc: b9 c0 08 00 mv r1,r14 800ecc0: 34 02 00 02 mvi r2,2 800ecc4: 39 ad 98 c0 ori r13,r13,0x98c0 800ecc8: f8 00 20 82 calli 8016ed0 <__ashlsi3> 800eccc: b5 a1 08 00 add r1,r13,r1 800ecd0: 28 2d 00 00 lw r13,(r1+0) 800ecd4: 45 a0 00 0b be r13,r0,800ed00 <_Objects_Get_information+0x7c><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 800ecd8: b9 80 08 00 mv r1,r12 800ecdc: 34 02 00 02 mvi r2,2 800ece0: f8 00 20 7c calli 8016ed0 <__ashlsi3> 800ece4: b5 a1 08 00 add r1,r13,r1 800ece8: 28 2b 00 00 lw r11,(r1+0) if ( !info ) 800ecec: 45 60 00 05 be r11,r0,800ed00 <_Objects_Get_information+0x7c><== NEVER TAKEN * In a multprocessing configuration, we may access remote objects. * Thus we may have 0 local instances and still have a valid object * pointer. */ #if !defined(RTEMS_MULTIPROCESSING) if ( info->maximum == 0 ) 800ecf0: 2d 61 00 10 lhu r1,(r11+16) return NULL; 800ecf4: 7c 21 00 00 cmpnei r1,r1,0 800ecf8: c8 01 08 00 sub r1,r0,r1 800ecfc: a1 61 58 00 and r11,r11,r1 #endif return info; } 800ed00: b9 60 08 00 mv r1,r11 800ed04: 2b 9d 00 04 lw ra,(sp+4) 800ed08: 2b 8b 00 14 lw r11,(sp+20) 800ed0c: 2b 8c 00 10 lw r12,(sp+16) 800ed10: 2b 8d 00 0c lw r13,(sp+12) 800ed14: 2b 8e 00 08 lw r14,(sp+8) 800ed18: 37 9c 00 14 addi sp,sp,20 800ed1c: c3 a0 00 00 ret =============================================================================== 080179e0 <_Objects_Get_no_protection>: Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 80179e0: 37 9c ff f4 addi sp,sp,-12 80179e4: 5b 8b 00 0c sw (sp+12),r11 80179e8: 5b 8c 00 08 sw (sp+8),r12 80179ec: 5b 9d 00 04 sw (sp+4),ra 80179f0: b8 20 20 00 mv r4,r1 /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 80179f4: 28 21 00 08 lw r1,(r1+8) Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 80179f8: b8 60 58 00 mv r11,r3 /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 80179fc: c8 41 08 00 sub r1,r2,r1 if ( information->maximum >= index ) { 8017a00: 2c 82 00 10 lhu r2,(r4+16) /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 8017a04: 34 21 00 01 addi r1,r1,1 if ( information->maximum >= index ) { 8017a08: 54 22 00 09 bgu r1,r2,8017a2c <_Objects_Get_no_protection+0x4c> if ( (the_object = information->local_table[ index ]) != NULL ) { 8017a0c: 28 8c 00 1c lw r12,(r4+28) 8017a10: 34 02 00 02 mvi r2,2 8017a14: fb ff d9 43 calli 800df20 <__ashlsi3> 8017a18: b5 81 08 00 add r1,r12,r1 8017a1c: 28 21 00 00 lw r1,(r1+0) 8017a20: 44 20 00 03 be r1,r0,8017a2c <_Objects_Get_no_protection+0x4c><== NEVER TAKEN *location = OBJECTS_LOCAL; 8017a24: 59 60 00 00 sw (r11+0),r0 return the_object; 8017a28: e0 00 00 04 bi 8017a38 <_Objects_Get_no_protection+0x58> /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 8017a2c: 34 01 00 01 mvi r1,1 8017a30: 59 61 00 00 sw (r11+0),r1 return NULL; 8017a34: 34 01 00 00 mvi r1,0 } 8017a38: 2b 9d 00 04 lw ra,(sp+4) 8017a3c: 2b 8b 00 0c lw r11,(sp+12) 8017a40: 2b 8c 00 08 lw r12,(sp+8) 8017a44: 37 9c 00 0c addi sp,sp,12 8017a48: c3 a0 00 00 ret =============================================================================== 080062c8 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 80062c8: 37 9c ff e8 addi sp,sp,-24 80062cc: 5b 8b 00 14 sw (sp+20),r11 80062d0: 5b 8c 00 10 sw (sp+16),r12 80062d4: 5b 8d 00 0c sw (sp+12),r13 80062d8: 5b 8e 00 08 sw (sp+8),r14 80062dc: 5b 9d 00 04 sw (sp+4),ra 80062e0: b8 40 70 00 mv r14,r2 /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 80062e4: b8 20 58 00 mv r11,r1 80062e8: 5c 20 00 05 bne r1,r0,80062fc <_Objects_Id_to_name+0x34> 80062ec: 78 01 08 02 mvhi r1,0x802 80062f0: 38 21 0d cc ori r1,r1,0xdcc 80062f4: 28 21 00 0c lw r1,(r1+12) 80062f8: 28 2b 00 08 lw r11,(r1+8) */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 80062fc: 34 02 00 18 mvi r2,24 8006300: b9 60 08 00 mv r1,r11 8006304: f8 00 57 78 calli 801c0e4 <__lshrsi3> 8006308: 20 21 00 07 andi r1,r1,0x7 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 800630c: 34 23 ff ff addi r3,r1,-1 8006310: 34 02 00 02 mvi r2,2 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 8006314: 34 0d 00 03 mvi r13,3 8006318: 54 62 00 14 bgu r3,r2,8006368 <_Objects_Id_to_name+0xa0> 800631c: e0 00 00 1b bi 8006388 <_Objects_Id_to_name+0xc0> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 8006320: 34 02 00 1b mvi r2,27 8006324: b9 60 08 00 mv r1,r11 8006328: f8 00 57 6f calli 801c0e4 <__lshrsi3> if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 800632c: 34 02 00 02 mvi r2,2 8006330: fb ff ec c3 calli 800163c <__ashlsi3> 8006334: b5 81 08 00 add r1,r12,r1 8006338: 28 21 00 00 lw r1,(r1+0) if ( !information ) 800633c: 44 20 00 0b be r1,r0,8006368 <_Objects_Id_to_name+0xa0> <== NEVER TAKEN return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 8006340: 40 2c 00 38 lbu r12,(r1+56) 8006344: 5d 80 00 09 bne r12,r0,8006368 <_Objects_Id_to_name+0xa0> <== NEVER TAKEN return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 8006348: b9 60 10 00 mv r2,r11 800634c: 37 83 00 18 addi r3,sp,24 8006350: fb ff ff b8 calli 8006230 <_Objects_Get> if ( !the_object ) 8006354: 44 2c 00 05 be r1,r12,8006368 <_Objects_Id_to_name+0xa0> return OBJECTS_INVALID_ID; *name = the_object->name; 8006358: 28 21 00 0c lw r1,(r1+12) _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 800635c: 34 0d 00 00 mvi r13,0 the_object = _Objects_Get( information, tmpId, &ignored_location ); if ( !the_object ) return OBJECTS_INVALID_ID; *name = the_object->name; 8006360: 59 c1 00 00 sw (r14+0),r1 _Thread_Enable_dispatch(); 8006364: f8 00 02 5e calli 8006cdc <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 8006368: b9 a0 08 00 mv r1,r13 800636c: 2b 9d 00 04 lw ra,(sp+4) 8006370: 2b 8b 00 14 lw r11,(sp+20) 8006374: 2b 8c 00 10 lw r12,(sp+16) 8006378: 2b 8d 00 0c lw r13,(sp+12) 800637c: 2b 8e 00 08 lw r14,(sp+8) 8006380: 37 9c 00 18 addi sp,sp,24 8006384: c3 a0 00 00 ret the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 8006388: 78 0c 08 02 mvhi r12,0x802 800638c: 34 02 00 02 mvi r2,2 8006390: 39 8c 08 90 ori r12,r12,0x890 8006394: fb ff ec aa calli 800163c <__ashlsi3> 8006398: b5 81 08 00 add r1,r12,r1 800639c: 28 2c 00 00 lw r12,(r1+0) 80063a0: 5d 80 ff e0 bne r12,r0,8006320 <_Objects_Id_to_name+0x58> <== ALWAYS TAKEN 80063a4: e3 ff ff f1 bi 8006368 <_Objects_Id_to_name+0xa0> <== NOT EXECUTED =============================================================================== 08005d04 <_Objects_Initialize_information>: , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 8005d04: 37 9c ff e4 addi sp,sp,-28 8005d08: 5b 8b 00 1c sw (sp+28),r11 8005d0c: 5b 8c 00 18 sw (sp+24),r12 8005d10: 5b 8d 00 14 sw (sp+20),r13 8005d14: 5b 8e 00 10 sw (sp+16),r14 8005d18: 5b 8f 00 0c sw (sp+12),r15 8005d1c: 5b 90 00 08 sw (sp+8),r16 8005d20: 5b 9d 00 04 sw (sp+4),ra 8005d24: b8 20 58 00 mv r11,r1 8005d28: 20 a5 ff ff andi r5,r5,0xffff #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; 8005d2c: 0d 63 00 04 sh (r11+4),r3 information->size = size; 8005d30: 58 25 00 18 sw (r1+24),r5 information->local_table = 0; information->inactive_per_block = 0; information->object_blocks = 0; information->inactive = 0; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) information->is_string = is_string; 8005d34: 30 26 00 38 sb (r1+56),r6 uint32_t maximum_per_allocation; #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; 8005d38: 59 62 00 00 sw (r11+0),r2 information->the_class = the_class; information->size = size; information->local_table = 0; 8005d3c: 58 20 00 1c sw (r1+28),r0 information->inactive_per_block = 0; 8005d40: 58 20 00 30 sw (r1+48),r0 information->object_blocks = 0; 8005d44: 58 20 00 34 sw (r1+52),r0 information->inactive = 0; 8005d48: 0c 20 00 2c sh (r1+44),r0 /* * Set the maximum value to 0. It will be updated when objects are * added to the inactive set from _Objects_Extend_information() */ information->maximum = 0; 8005d4c: 0c 20 00 10 sh (r1+16),r0 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 8005d50: b8 40 70 00 mv r14,r2 information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 8005d54: b8 40 08 00 mv r1,r2 8005d58: 78 0f 08 01 mvhi r15,0x801 8005d5c: 34 02 00 02 mvi r2,2 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 8005d60: b8 60 68 00 mv r13,r3 8005d64: b8 80 60 00 mv r12,r4 8005d68: b8 e0 80 00 mv r16,r7 information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 8005d6c: 39 ef 98 c0 ori r15,r15,0x98c0 8005d70: f8 00 44 58 calli 8016ed0 <__ashlsi3> 8005d74: b5 e1 08 00 add r1,r15,r1 8005d78: 28 2f 00 00 lw r15,(r1+0) 8005d7c: 34 02 00 02 mvi r2,2 8005d80: b9 a0 08 00 mv r1,r13 8005d84: f8 00 44 53 calli 8016ed0 <__ashlsi3> 8005d88: b5 e1 08 00 add r1,r15,r1 8005d8c: 58 2b 00 00 sw (r1+0),r11 /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 8005d90: 34 02 00 1f mvi r2,31 8005d94: b9 80 08 00 mv r1,r12 8005d98: f8 00 44 9c calli 8017008 <__lshrsi3> maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 8005d9c: 78 03 08 01 mvhi r3,0x801 8005da0: 38 63 81 38 ori r3,r3,0x8138 /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 8005da4: 20 22 00 ff andi r2,r1,0xff maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 8005da8: 28 61 00 00 lw r1,(r3+0) _Objects_Information_table[ the_api ][ the_class ] = information; /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = 8005dac: 31 62 00 12 sb (r11+18),r2 (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 8005db0: a1 81 60 00 and r12,r12,r1 /* * Unlimited and maximum of zero is illogical. */ if ( information->auto_extend && maximum_per_allocation == 0) { 8005db4: 44 40 00 06 be r2,r0,8005dcc <_Objects_Initialize_information+0xc8> 8005db8: 5d 80 00 05 bne r12,r0,8005dcc <_Objects_Initialize_information+0xc8><== ALWAYS TAKEN _Internal_error_Occurred( 8005dbc: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8005dc0: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8005dc4: 34 03 00 13 mvi r3,19 <== NOT EXECUTED 8005dc8: fb ff fe 15 calli 800561c <_Internal_error_Occurred> <== NOT EXECUTED information->allocation_size = maximum_per_allocation; /* * Provide a null local table entry for the case of any empty table. */ information->local_table = &null_local_table; 8005dcc: 78 01 08 01 mvhi r1,0x801 8005dd0: 38 21 96 e4 ori r1,r1,0x96e4 8005dd4: 59 61 00 1c sw (r11+28),r1 8005dd8: 34 02 00 18 mvi r2,24 8005ddc: b9 c0 08 00 mv r1,r14 } /* * The allocation unit is the maximum value */ information->allocation_size = maximum_per_allocation; 8005de0: 0d 6c 00 14 sh (r11+20),r12 8005de4: f8 00 44 3b calli 8016ed0 <__ashlsi3> 8005de8: 78 0e 00 01 mvhi r14,0x1 8005dec: b8 2e 70 00 or r14,r1,r14 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 8005df0: 34 02 00 1b mvi r2,27 8005df4: b9 a0 08 00 mv r1,r13 8005df8: f8 00 44 36 calli 8016ed0 <__ashlsi3> information->local_table = &null_local_table; /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; 8005dfc: 7d 82 00 00 cmpnei r2,r12,0 8005e00: b9 c1 08 00 or r1,r14,r1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 8005e04: b8 22 08 00 or r1,r1,r2 information->minimum_id = 8005e08: 59 61 00 08 sw (r11+8),r1 /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 8005e0c: 22 01 00 03 andi r1,r16,0x3 8005e10: ba 00 38 00 mv r7,r16 8005e14: 44 20 00 04 be r1,r0,8005e24 <_Objects_Initialize_information+0x120> name_length = (name_length + OBJECTS_NAME_ALIGNMENT) & 8005e18: 36 07 00 04 addi r7,r16,4 8005e1c: 34 01 ff fc mvi r1,-4 8005e20: a0 e1 38 00 and r7,r7,r1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8005e24: 35 61 00 24 addi r1,r11,36 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8005e28: 59 61 00 20 sw (r11+32),r1 ~(OBJECTS_NAME_ALIGNMENT-1); information->name_length = name_length; _Chain_Initialize_empty( &information->Inactive ); 8005e2c: 35 61 00 20 addi r1,r11,32 if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) name_length = (name_length + OBJECTS_NAME_ALIGNMENT) & ~(OBJECTS_NAME_ALIGNMENT-1); information->name_length = name_length; 8005e30: 0d 67 00 3a sh (r11+58),r7 the_chain->permanent_null = NULL; 8005e34: 59 60 00 24 sw (r11+36),r0 the_chain->last = _Chain_Head(the_chain); 8005e38: 59 61 00 28 sw (r11+40),r1 _Chain_Initialize_empty( &information->Inactive ); /* * Initialize objects .. if there are any */ if ( maximum_per_allocation ) { 8005e3c: 45 80 00 03 be r12,r0,8005e48 <_Objects_Initialize_information+0x144> /* * Always have the maximum size available so the current performance * figures are create are met. If the user moves past the maximum * number then a performance hit is taken. */ _Objects_Extend_information( information ); 8005e40: b9 60 08 00 mv r1,r11 8005e44: fb ff fe 6a calli 80057ec <_Objects_Extend_information> _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 8005e48: 2b 9d 00 04 lw ra,(sp+4) 8005e4c: 2b 8b 00 1c lw r11,(sp+28) 8005e50: 2b 8c 00 18 lw r12,(sp+24) 8005e54: 2b 8d 00 14 lw r13,(sp+20) 8005e58: 2b 8e 00 10 lw r14,(sp+16) 8005e5c: 2b 8f 00 0c lw r15,(sp+12) 8005e60: 2b 90 00 08 lw r16,(sp+8) 8005e64: 37 9c 00 1c addi sp,sp,28 8005e68: c3 a0 00 00 ret =============================================================================== 08004ed4 <_Objects_Set_name>: bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 8004ed4: 37 9c ff ec addi sp,sp,-20 8004ed8: 5b 8b 00 14 sw (sp+20),r11 8004edc: 5b 8c 00 10 sw (sp+16),r12 8004ee0: 5b 8d 00 0c sw (sp+12),r13 8004ee4: 5b 8e 00 08 sw (sp+8),r14 8004ee8: 5b 9d 00 04 sw (sp+4),ra 8004eec: b8 20 70 00 mv r14,r1 8004ef0: b8 40 68 00 mv r13,r2 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 8004ef4: 2d c2 00 3a lhu r2,(r14+58) 8004ef8: b8 60 08 00 mv r1,r3 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 8004efc: b8 60 58 00 mv r11,r3 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 8004f00: f8 00 27 64 calli 800ec90 8004f04: b8 20 60 00 mv r12,r1 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 8004f08: 41 c1 00 38 lbu r1,(r14+56) 8004f0c: 44 20 00 12 be r1,r0,8004f54 <_Objects_Set_name+0x80> char *d; d = _Workspace_Allocate( length + 1 ); 8004f10: 35 81 00 01 addi r1,r12,1 8004f14: f8 00 07 8b calli 8006d40 <_Workspace_Allocate> 8004f18: b8 20 70 00 mv r14,r1 if ( !d ) return false; 8004f1c: 34 03 00 00 mvi r3,0 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); if ( !d ) 8004f20: 44 20 00 26 be r1,r0,8004fb8 <_Objects_Set_name+0xe4> <== NEVER TAKEN return false; if ( the_object->name.name_p ) { 8004f24: 29 a1 00 0c lw r1,(r13+12) 8004f28: 44 20 00 03 be r1,r0,8004f34 <_Objects_Set_name+0x60> _Workspace_Free( (void *)the_object->name.name_p ); 8004f2c: f8 00 07 90 calli 8006d6c <_Workspace_Free> the_object->name.name_p = NULL; 8004f30: 59 a0 00 0c sw (r13+12),r0 } strncpy( d, name, length ); 8004f34: b9 80 18 00 mv r3,r12 8004f38: b9 c0 08 00 mv r1,r14 8004f3c: b9 60 10 00 mv r2,r11 d[length] = '\0'; 8004f40: b5 cc 60 00 add r12,r14,r12 if ( the_object->name.name_p ) { _Workspace_Free( (void *)the_object->name.name_p ); the_object->name.name_p = NULL; } strncpy( d, name, length ); 8004f44: f8 00 27 20 calli 800ebc4 d[length] = '\0'; 8004f48: 31 80 00 00 sb (r12+0),r0 the_object->name.name_p = d; 8004f4c: 59 ae 00 0c sw (r13+12),r14 8004f50: e0 00 00 19 bi 8004fb4 <_Objects_Set_name+0xe0> } else #endif { the_object->name.name_u32 = _Objects_Build_name( 8004f54: 41 61 00 00 lbu r1,(r11+0) 8004f58: 34 02 00 18 mvi r2,24 8004f5c: f8 00 57 9c calli 801adcc <__ashlsi3> 8004f60: 34 02 00 01 mvi r2,1 8004f64: b8 20 70 00 mv r14,r1 8004f68: 78 01 00 20 mvhi r1,0x20 8004f6c: 50 4c 00 04 bgeu r2,r12,8004f7c <_Objects_Set_name+0xa8> 8004f70: 41 61 00 01 lbu r1,(r11+1) 8004f74: 34 02 00 10 mvi r2,16 8004f78: f8 00 57 95 calli 801adcc <__ashlsi3> 8004f7c: 34 02 00 02 mvi r2,2 8004f80: b8 2e 70 00 or r14,r1,r14 8004f84: 34 01 20 00 mvi r1,8192 8004f88: 50 4c 00 04 bgeu r2,r12,8004f98 <_Objects_Set_name+0xc4> 8004f8c: 41 61 00 02 lbu r1,(r11+2) 8004f90: 34 02 00 08 mvi r2,8 8004f94: f8 00 57 8e calli 801adcc <__ashlsi3> 8004f98: 34 03 00 03 mvi r3,3 8004f9c: b9 c1 08 00 or r1,r14,r1 8004fa0: 34 02 00 20 mvi r2,32 8004fa4: 50 6c 00 02 bgeu r3,r12,8004fac <_Objects_Set_name+0xd8> 8004fa8: 41 62 00 03 lbu r2,(r11+3) 8004fac: b8 22 10 00 or r2,r1,r2 8004fb0: 59 a2 00 0c sw (r13+12),r2 ((3 < length) ? s[ 3 ] : ' ') ); } return true; 8004fb4: 34 03 00 01 mvi r3,1 } 8004fb8: b8 60 08 00 mv r1,r3 8004fbc: 2b 9d 00 04 lw ra,(sp+4) 8004fc0: 2b 8b 00 14 lw r11,(sp+20) 8004fc4: 2b 8c 00 10 lw r12,(sp+16) 8004fc8: 2b 8d 00 0c lw r13,(sp+12) 8004fcc: 2b 8e 00 08 lw r14,(sp+8) 8004fd0: 37 9c 00 14 addi sp,sp,20 8004fd4: c3 a0 00 00 ret =============================================================================== 08003fc0 <_POSIX_Condition_variables_Wait_support>: pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 8003fc0: 37 9c ff e0 addi sp,sp,-32 8003fc4: 5b 8b 00 1c sw (sp+28),r11 8003fc8: 5b 8c 00 18 sw (sp+24),r12 8003fcc: 5b 8d 00 14 sw (sp+20),r13 8003fd0: 5b 8e 00 10 sw (sp+16),r14 8003fd4: 5b 8f 00 0c sw (sp+12),r15 8003fd8: 5b 90 00 08 sw (sp+8),r16 8003fdc: 5b 9d 00 04 sw (sp+4),ra 8003fe0: b8 20 70 00 mv r14,r1 8003fe4: b8 40 58 00 mv r11,r2 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 8003fe8: b8 40 08 00 mv r1,r2 8003fec: 37 82 00 20 addi r2,sp,32 pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 8003ff0: b8 60 80 00 mv r16,r3 8003ff4: 20 8f 00 ff andi r15,r4,0xff register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 8003ff8: f8 00 00 63 calli 8004184 <_POSIX_Mutex_Get> return EINVAL; 8003ffc: 34 0c 00 16 mvi r12,22 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 8004000: 44 20 00 34 be r1,r0,80040d0 <_POSIX_Condition_variables_Wait_support+0x110> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 8004004: 78 05 08 01 mvhi r5,0x801 8004008: 38 a5 78 6c ori r5,r5,0x786c 800400c: 28 a1 00 00 lw r1,(r5+0) return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 8004010: 37 82 00 20 addi r2,sp,32 8004014: 34 21 ff ff addi r1,r1,-1 8004018: 58 a1 00 00 sw (r5+0),r1 800401c: b9 c0 08 00 mv r1,r14 8004020: fb ff ff 4f calli 8003d5c <_POSIX_Condition_variables_Get> switch ( location ) { 8004024: 2b 84 00 20 lw r4,(sp+32) return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 8004028: b8 20 68 00 mv r13,r1 switch ( location ) { 800402c: 5c 80 00 29 bne r4,r0,80040d0 <_POSIX_Condition_variables_Wait_support+0x110> case OBJECTS_LOCAL: if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { 8004030: 28 21 00 14 lw r1,(r1+20) 8004034: 44 24 00 05 be r1,r4,8004048 <_POSIX_Condition_variables_Wait_support+0x88> 8004038: 29 62 00 00 lw r2,(r11+0) 800403c: 44 22 00 03 be r1,r2,8004048 <_POSIX_Condition_variables_Wait_support+0x88> _Thread_Enable_dispatch(); 8004040: f8 00 0c ec calli 80073f0 <_Thread_Enable_dispatch> return EINVAL; 8004044: e0 00 00 23 bi 80040d0 <_POSIX_Condition_variables_Wait_support+0x110> } (void) pthread_mutex_unlock( mutex ); 8004048: b9 60 08 00 mv r1,r11 800404c: f8 00 01 18 calli 80044ac _Thread_Enable_dispatch(); return EINVAL; } */ if ( !already_timedout ) { 8004050: 5d e0 00 1a bne r15,r0,80040b8 <_POSIX_Condition_variables_Wait_support+0xf8> the_cond->Mutex = *mutex; 8004054: 29 61 00 00 lw r1,(r11+0) _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 8004058: 78 0c 08 01 mvhi r12,0x801 800405c: 39 8c 7d 44 ori r12,r12,0x7d44 8004060: 29 85 00 0c lw r5,(r12+12) return EINVAL; } */ if ( !already_timedout ) { the_cond->Mutex = *mutex; 8004064: 59 a1 00 14 sw (r13+20),r1 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; 8004068: 34 01 00 01 mvi r1,1 800406c: 59 a1 00 48 sw (r13+72),r1 _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 8004070: 58 a0 00 34 sw (r5+52),r0 _Thread_Executing->Wait.queue = &the_cond->Wait_queue; _Thread_Executing->Wait.id = *cond; 8004074: 29 c1 00 00 lw r1,(r14+0) 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; 8004078: 35 ad 00 18 addi r13,r13,24 _Thread_Executing->Wait.id = *cond; _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 800407c: 78 03 08 00 mvhi r3,0x800 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; _Thread_Executing->Wait.id = *cond; 8004080: 58 a1 00 20 sw (r5+32),r1 _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 8004084: ba 00 10 00 mv r2,r16 8004088: b9 a0 08 00 mv r1,r13 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; 800408c: 58 ad 00 44 sw (r5+68),r13 _Thread_Executing->Wait.id = *cond; _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 8004090: 38 63 7e c0 ori r3,r3,0x7ec0 8004094: f8 00 0e 14 calli 80078e4 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 8004098: f8 00 0c d6 calli 80073f0 <_Thread_Enable_dispatch> /* * Switch ourself out because we blocked as a result of the * _Thread_queue_Enqueue. */ status = _Thread_Executing->Wait.return_code; 800409c: 29 81 00 0c lw r1,(r12+12) 80040a0: 28 2c 00 34 lw r12,(r1+52) if ( status && status != ETIMEDOUT ) 80040a4: 7d 82 00 74 cmpnei r2,r12,116 80040a8: 7d 81 00 00 cmpnei r1,r12,0 80040ac: a0 41 08 00 and r1,r2,r1 80040b0: 44 2f 00 04 be r1,r15,80040c0 <_POSIX_Condition_variables_Wait_support+0x100><== ALWAYS TAKEN 80040b4: e0 00 00 07 bi 80040d0 <_POSIX_Condition_variables_Wait_support+0x110><== NOT EXECUTED return status; } else { _Thread_Enable_dispatch(); 80040b8: f8 00 0c ce calli 80073f0 <_Thread_Enable_dispatch> status = ETIMEDOUT; 80040bc: 34 0c 00 74 mvi r12,116 /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); 80040c0: b9 60 08 00 mv r1,r11 80040c4: f8 00 00 c7 calli 80043e0 if ( mutex_status ) 80040c8: 44 20 00 02 be r1,r0,80040d0 <_POSIX_Condition_variables_Wait_support+0x110> return EINVAL; 80040cc: 34 0c 00 16 mvi r12,22 case OBJECTS_ERROR: break; } return EINVAL; } 80040d0: b9 80 08 00 mv r1,r12 80040d4: 2b 9d 00 04 lw ra,(sp+4) 80040d8: 2b 8b 00 1c lw r11,(sp+28) 80040dc: 2b 8c 00 18 lw r12,(sp+24) 80040e0: 2b 8d 00 14 lw r13,(sp+20) 80040e4: 2b 8e 00 10 lw r14,(sp+16) 80040e8: 2b 8f 00 0c lw r15,(sp+12) 80040ec: 2b 90 00 08 lw r16,(sp+8) 80040f0: 37 9c 00 20 addi sp,sp,32 80040f4: c3 a0 00 00 ret =============================================================================== 08008f70 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 8008f70: 37 9c ff dc addi sp,sp,-36 8008f74: 5b 8b 00 18 sw (sp+24),r11 8008f78: 5b 8c 00 14 sw (sp+20),r12 8008f7c: 5b 8d 00 10 sw (sp+16),r13 8008f80: 5b 8e 00 0c sw (sp+12),r14 8008f84: 5b 8f 00 08 sw (sp+8),r15 8008f88: 5b 9d 00 04 sw (sp+4),ra 8008f8c: b8 20 58 00 mv r11,r1 RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd ( mqd_t id, Objects_Locations *location ) { return (POSIX_Message_queue_Control_fd *) _Objects_Get( 8008f90: 78 01 08 02 mvhi r1,0x802 8008f94: b8 40 60 00 mv r12,r2 8008f98: b8 60 78 00 mv r15,r3 8008f9c: b9 60 10 00 mv r2,r11 8008fa0: 38 21 92 28 ori r1,r1,0x9228 8008fa4: 37 83 00 24 addi r3,sp,36 8008fa8: 5b 86 00 1c sw (sp+28),r6 8008fac: b8 80 68 00 mv r13,r4 8008fb0: 20 ae 00 ff andi r14,r5,0xff 8008fb4: f8 00 0c b9 calli 800c298 <_Objects_Get> Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 8008fb8: 2b 82 00 24 lw r2,(sp+36) 8008fbc: 2b 86 00 1c lw r6,(sp+28) 8008fc0: 5c 40 00 2f bne r2,r0,800907c <_POSIX_Message_queue_Receive_support+0x10c><== NEVER TAKEN case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 8008fc4: 28 28 00 14 lw r8,(r1+20) 8008fc8: 34 02 00 01 mvi r2,1 8008fcc: 21 03 00 03 andi r3,r8,0x3 8008fd0: 5c 62 00 03 bne r3,r2,8008fdc <_POSIX_Message_queue_Receive_support+0x6c> _Thread_Enable_dispatch(); 8008fd4: f8 00 0f 2d calli 800cc88 <_Thread_Enable_dispatch> 8008fd8: e0 00 00 29 bi 800907c <_POSIX_Message_queue_Receive_support+0x10c> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 8008fdc: 28 27 00 10 lw r7,(r1+16) if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 8008fe0: 28 e1 00 68 lw r1,(r7+104) 8008fe4: 51 e1 00 05 bgeu r15,r1,8008ff8 <_POSIX_Message_queue_Receive_support+0x88> _Thread_Enable_dispatch(); 8008fe8: f8 00 0f 28 calli 800cc88 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); 8008fec: f8 00 2e dd calli 8014b60 <__errno> 8008ff0: 34 02 00 7a mvi r2,122 8008ff4: e0 00 00 24 bi 8009084 <_POSIX_Message_queue_Receive_support+0x114> /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 8008ff8: 34 01 ff ff mvi r1,-1 8008ffc: 5b 81 00 20 sw (sp+32),r1 /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 8009000: 34 05 00 00 mvi r5,0 8009004: 45 c0 00 03 be r14,r0,8009010 <_POSIX_Message_queue_Receive_support+0xa0><== NEVER TAKEN do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 8009008: 21 05 40 00 andi r5,r8,0x4000 800900c: 64 a5 00 00 cmpei r5,r5,0 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 8009010: b9 60 10 00 mv r2,r11 timeout ); _Thread_Enable_dispatch(); *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 8009014: 78 0b 08 02 mvhi r11,0x802 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 8009018: 34 e1 00 1c addi r1,r7,28 800901c: b9 80 18 00 mv r3,r12 8009020: 37 84 00 20 addi r4,sp,32 timeout ); _Thread_Enable_dispatch(); *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 8009024: 39 6b 92 94 ori r11,r11,0x9294 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 8009028: f8 00 07 7c calli 800ae18 <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 800902c: f8 00 0f 17 calli 800cc88 <_Thread_Enable_dispatch> *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 8009030: 29 6c 00 0c lw r12,(r11+12) RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core( CORE_message_queue_Submit_types priority ) { /* absolute value without a library dependency */ return ((priority >= 0) ? priority : -priority); 8009034: 34 02 00 1f mvi r2,31 8009038: 29 81 00 24 lw r1,(r12+36) 800903c: f8 00 6c 6c calli 80241ec <__ashrsi3> 8009040: 29 82 00 24 lw r2,(r12+36) 8009044: 98 22 10 00 xor r2,r1,r2 8009048: c8 41 08 00 sub r1,r2,r1 do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = 800904c: 59 a1 00 00 sw (r13+0),r1 _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) 8009050: 29 81 00 34 lw r1,(r12+52) 8009054: 5c 20 00 03 bne r1,r0,8009060 <_POSIX_Message_queue_Receive_support+0xf0> return length_out; 8009058: 2b 81 00 20 lw r1,(sp+32) 800905c: e0 00 00 0c bi 800908c <_POSIX_Message_queue_Receive_support+0x11c> rtems_set_errno_and_return_minus_one( 8009060: f8 00 2e c0 calli 8014b60 <__errno> 8009064: b8 20 60 00 mv r12,r1 8009068: 29 61 00 0c lw r1,(r11+12) 800906c: 28 21 00 34 lw r1,(r1+52) 8009070: f8 00 00 b9 calli 8009354 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 8009074: 59 81 00 00 sw (r12+0),r1 8009078: e0 00 00 04 bi 8009088 <_POSIX_Message_queue_Receive_support+0x118> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 800907c: f8 00 2e b9 calli 8014b60 <__errno> 8009080: 34 02 00 09 mvi r2,9 8009084: 58 22 00 00 sw (r1+0),r2 8009088: 34 01 ff ff mvi r1,-1 } 800908c: 2b 9d 00 04 lw ra,(sp+4) 8009090: 2b 8b 00 18 lw r11,(sp+24) 8009094: 2b 8c 00 14 lw r12,(sp+20) 8009098: 2b 8d 00 10 lw r13,(sp+16) 800909c: 2b 8e 00 0c lw r14,(sp+12) 80090a0: 2b 8f 00 08 lw r15,(sp+8) 80090a4: 37 9c 00 24 addi sp,sp,36 80090a8: c3 a0 00 00 ret =============================================================================== 08008544 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: #include void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( Thread_Control *the_thread ) { 8008544: 37 9c ff fc addi sp,sp,-4 8008548: 5b 9d 00 04 sw (sp+4),ra POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 800854c: 28 22 01 2c lw r2,(r1+300) if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 8008550: 28 43 00 d4 lw r3,(r2+212) 8008554: 5c 60 00 0e bne r3,r0,800858c <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48><== NEVER TAKEN 8008558: 28 44 00 d8 lw r4,(r2+216) 800855c: 34 03 00 01 mvi r3,1 8008560: 5c 83 00 0b bne r4,r3,800858c <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48> thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 8008564: 28 42 00 dc lw r2,(r2+220) 8008568: 44 40 00 09 be r2,r0,800858c <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 800856c: 78 02 08 01 mvhi r2,0x801 8008570: 38 42 58 5c ori r2,r2,0x585c 8008574: 28 43 00 00 lw r3,(r2+0) 8008578: 34 63 ff ff addi r3,r3,-1 800857c: 58 43 00 00 sw (r2+0),r3 thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 8008580: 34 02 ff ff mvi r2,-1 8008584: f8 00 02 6b calli 8008f30 <_POSIX_Thread_Exit> 8008588: e0 00 00 02 bi 8008590 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x4c> } else _Thread_Enable_dispatch(); 800858c: fb ff f2 c6 calli 80050a4 <_Thread_Enable_dispatch> } 8008590: 2b 9d 00 04 lw ra,(sp+4) 8008594: 37 9c 00 04 addi sp,sp,4 8008598: c3 a0 00 00 ret =============================================================================== 08009fe0 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 8009fe0: 37 9c ff e8 addi sp,sp,-24 8009fe4: 5b 8b 00 18 sw (sp+24),r11 8009fe8: 5b 8c 00 14 sw (sp+20),r12 8009fec: 5b 8d 00 10 sw (sp+16),r13 8009ff0: 5b 8e 00 0c sw (sp+12),r14 8009ff4: 5b 8f 00 08 sw (sp+8),r15 8009ff8: 5b 9d 00 04 sw (sp+4),ra 8009ffc: b8 20 68 00 mv r13,r1 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 800a000: 28 41 00 00 lw r1,(r2+0) int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 800a004: b8 40 58 00 mv r11,r2 800a008: b8 60 70 00 mv r14,r3 800a00c: b8 80 78 00 mv r15,r4 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 800a010: fb ff ff ec calli 8009fc0 <_POSIX_Priority_Is_valid> return EINVAL; 800a014: 34 0c 00 16 mvi r12,22 struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 800a018: 44 20 00 2a be r1,r0,800a0c0 <_POSIX_Thread_Translate_sched_param+0xe0><== NEVER TAKEN return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 800a01c: 59 c0 00 00 sw (r14+0),r0 *budget_callout = NULL; 800a020: 59 e0 00 00 sw (r15+0),r0 if ( policy == SCHED_OTHER ) { 800a024: 5d a0 00 04 bne r13,r0,800a034 <_POSIX_Thread_Translate_sched_param+0x54> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 800a028: 34 01 00 01 mvi r1,1 800a02c: 59 c1 00 00 sw (r14+0),r1 800a030: e0 00 00 23 bi 800a0bc <_POSIX_Thread_Translate_sched_param+0xdc> return 0; } if ( policy == SCHED_FIFO ) { 800a034: 34 01 00 01 mvi r1,1 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; 800a038: 34 0c 00 00 mvi r12,0 if ( policy == SCHED_OTHER ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; return 0; } if ( policy == SCHED_FIFO ) { 800a03c: 45 a1 00 21 be r13,r1,800a0c0 <_POSIX_Thread_Translate_sched_param+0xe0> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 800a040: 34 01 00 02 mvi r1,2 800a044: 5d a1 00 03 bne r13,r1,800a050 <_POSIX_Thread_Translate_sched_param+0x70> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 800a048: 59 cd 00 00 sw (r14+0),r13 return 0; 800a04c: e0 00 00 1d bi 800a0c0 <_POSIX_Thread_Translate_sched_param+0xe0> } if ( policy == SCHED_SPORADIC ) { 800a050: 34 01 00 04 mvi r1,4 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; 800a054: 34 0c 00 16 mvi r12,22 if ( policy == SCHED_RR ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; return 0; } if ( policy == SCHED_SPORADIC ) { 800a058: 5d a1 00 1a bne r13,r1,800a0c0 <_POSIX_Thread_Translate_sched_param+0xe0> if ( (param->sched_ss_repl_period.tv_sec == 0) && 800a05c: 29 61 00 08 lw r1,(r11+8) 800a060: 5c 20 00 03 bne r1,r0,800a06c <_POSIX_Thread_Translate_sched_param+0x8c> 800a064: 29 62 00 0c lw r2,(r11+12) 800a068: 44 41 00 16 be r2,r1,800a0c0 <_POSIX_Thread_Translate_sched_param+0xe0> (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 800a06c: 29 61 00 10 lw r1,(r11+16) 800a070: 5c 20 00 04 bne r1,r0,800a080 <_POSIX_Thread_Translate_sched_param+0xa0> 800a074: 29 62 00 14 lw r2,(r11+20) (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; 800a078: 34 0c 00 16 mvi r12,22 if ( policy == SCHED_SPORADIC ) { if ( (param->sched_ss_repl_period.tv_sec == 0) && (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 800a07c: 44 41 00 11 be r2,r1,800a0c0 <_POSIX_Thread_Translate_sched_param+0xe0> (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 800a080: 35 61 00 08 addi r1,r11,8 800a084: fb ff f4 8b calli 80072b0 <_Timespec_To_ticks> 800a088: b8 20 68 00 mv r13,r1 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 800a08c: 35 61 00 10 addi r1,r11,16 800a090: fb ff f4 88 calli 80072b0 <_Timespec_To_ticks> return EINVAL; 800a094: 34 0c 00 16 mvi r12,22 if ( (param->sched_ss_init_budget.tv_sec == 0) && (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 800a098: 54 2d 00 0a bgu r1,r13,800a0c0 <_POSIX_Thread_Translate_sched_param+0xe0> _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) 800a09c: 29 61 00 04 lw r1,(r11+4) 800a0a0: fb ff ff c8 calli 8009fc0 <_POSIX_Priority_Is_valid> 800a0a4: 44 20 00 07 be r1,r0,800a0c0 <_POSIX_Thread_Translate_sched_param+0xe0> return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 800a0a8: 34 01 00 03 mvi r1,3 800a0ac: 59 c1 00 00 sw (r14+0),r1 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 800a0b0: 78 01 08 00 mvhi r1,0x800 800a0b4: 38 21 38 60 ori r1,r1,0x3860 800a0b8: 59 e1 00 00 sw (r15+0),r1 return 0; 800a0bc: 34 0c 00 00 mvi r12,0 } return EINVAL; } 800a0c0: b9 80 08 00 mv r1,r12 800a0c4: 2b 9d 00 04 lw ra,(sp+4) 800a0c8: 2b 8b 00 18 lw r11,(sp+24) 800a0cc: 2b 8c 00 14 lw r12,(sp+20) 800a0d0: 2b 8d 00 10 lw r13,(sp+16) 800a0d4: 2b 8e 00 0c lw r14,(sp+12) 800a0d8: 2b 8f 00 08 lw r15,(sp+8) 800a0dc: 37 9c 00 18 addi sp,sp,24 800a0e0: c3 a0 00 00 ret =============================================================================== 080034e0 <_POSIX_Threads_Initialize_user_threads_body>: * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { 80034e0: 37 9c ff ac addi sp,sp,-84 80034e4: 5b 8b 00 14 sw (sp+20),r11 80034e8: 5b 8c 00 10 sw (sp+16),r12 80034ec: 5b 8d 00 0c sw (sp+12),r13 80034f0: 5b 8e 00 08 sw (sp+8),r14 80034f4: 5b 9d 00 04 sw (sp+4),ra uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; 80034f8: 78 01 08 01 mvhi r1,0x801 80034fc: 38 21 f0 a8 ori r1,r1,0xf0a8 maximum = Configuration_POSIX_API.number_of_initialization_threads; 8003500: 28 2e 00 30 lw r14,(r1+48) uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; 8003504: 28 2c 00 34 lw r12,(r1+52) maximum = Configuration_POSIX_API.number_of_initialization_threads; if ( !user_threads || maximum == 0 ) 8003508: 65 c2 00 00 cmpei r2,r14,0 800350c: 65 81 00 00 cmpei r1,r12,0 8003510: b8 41 08 00 or r1,r2,r1 8003514: 5c 20 00 18 bne r1,r0,8003574 <_POSIX_Threads_Initialize_user_threads_body+0x94><== NEVER TAKEN 8003518: 34 0d 00 00 mvi r13,0 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 800351c: 37 8b 00 18 addi r11,sp,24 8003520: b9 60 08 00 mv r1,r11 8003524: f8 00 1a f0 calli 800a0e4 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 8003528: 34 02 00 02 mvi r2,2 800352c: b9 60 08 00 mv r1,r11 8003530: f8 00 1a fa calli 800a118 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 8003534: 29 82 00 04 lw r2,(r12+4) 8003538: b9 60 08 00 mv r1,r11 800353c: f8 00 1b 03 calli 800a148 status = pthread_create( 8003540: 29 83 00 00 lw r3,(r12+0) 8003544: 37 81 00 54 addi r1,sp,84 8003548: b9 60 10 00 mv r2,r11 800354c: 34 04 00 00 mvi r4,0 8003550: fb ff fe ed calli 8003104 8003554: b8 20 18 00 mv r3,r1 &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 8003558: 44 20 00 04 be r1,r0,8003568 <_POSIX_Threads_Initialize_user_threads_body+0x88><== ALWAYS TAKEN _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 800355c: 34 01 00 02 mvi r1,2 <== NOT EXECUTED 8003560: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8003564: f8 00 07 22 calli 80051ec <_Internal_error_Occurred> <== NOT EXECUTED * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { 8003568: 35 ad 00 01 addi r13,r13,1 800356c: 35 8c 00 08 addi r12,r12,8 8003570: 55 cd ff ec bgu r14,r13,8003520 <_POSIX_Threads_Initialize_user_threads_body+0x40><== NEVER TAKEN NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); } } 8003574: 2b 9d 00 04 lw ra,(sp+4) 8003578: 2b 8b 00 14 lw r11,(sp+20) 800357c: 2b 8c 00 10 lw r12,(sp+16) 8003580: 2b 8d 00 0c lw r13,(sp+12) 8003584: 2b 8e 00 08 lw r14,(sp+8) 8003588: 37 9c 00 54 addi sp,sp,84 800358c: c3 a0 00 00 ret =============================================================================== 0800d3e4 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 800d3e4: 37 9c ff f4 addi sp,sp,-12 800d3e8: 5b 8b 00 0c sw (sp+12),r11 800d3ec: 5b 8c 00 08 sw (sp+8),r12 800d3f0: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; POSIX_API_Control *api; the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 800d3f4: 28 4c 01 2c lw r12,(r2+300) */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 800d3f8: b8 40 58 00 mv r11,r2 the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 800d3fc: 35 81 00 94 addi r1,r12,148 800d400: f8 00 07 d9 calli 800f364 <_Timespec_To_ticks> the_thread->cpu_time_budget = ticks; 800d404: 59 61 00 78 sw (r11+120),r1 RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 800d408: 78 01 08 01 mvhi r1,0x801 800d40c: 38 21 90 a8 ori r1,r1,0x90a8 800d410: 40 21 00 00 lbu r1,(r1+0) 800d414: 29 82 00 84 lw r2,(r12+132) 800d418: c8 22 10 00 sub r2,r1,r2 */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 800d41c: 29 61 00 1c lw r1,(r11+28) ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); the_thread->cpu_time_budget = ticks; new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); the_thread->real_priority = new_priority; 800d420: 59 62 00 18 sw (r11+24),r2 */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 800d424: 5c 20 00 06 bne r1,r0,800d43c <_POSIX_Threads_Sporadic_budget_TSR+0x58><== NEVER TAKEN /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { 800d428: 29 61 00 14 lw r1,(r11+20) 800d42c: 50 41 00 04 bgeu r2,r1,800d43c <_POSIX_Threads_Sporadic_budget_TSR+0x58> _Thread_Change_priority( the_thread, new_priority, true ); 800d430: b9 60 08 00 mv r1,r11 800d434: 34 03 00 01 mvi r3,1 800d438: fb ff e3 39 calli 800611c <_Thread_Change_priority> #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); 800d43c: 35 81 00 8c addi r1,r12,140 800d440: f8 00 07 c9 calli 800f364 <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 800d444: 59 81 00 b0 sw (r12+176),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800d448: 78 01 08 01 mvhi r1,0x801 800d44c: 38 21 99 e8 ori r1,r1,0x99e8 800d450: 35 82 00 a4 addi r2,r12,164 800d454: fb ff e9 4b calli 8007980 <_Watchdog_Insert> _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); } 800d458: 2b 9d 00 04 lw ra,(sp+4) 800d45c: 2b 8b 00 0c lw r11,(sp+12) 800d460: 2b 8c 00 08 lw r12,(sp+8) 800d464: 37 9c 00 0c addi sp,sp,12 800d468: c3 a0 00 00 ret =============================================================================== 0800d46c <_POSIX_Threads_Sporadic_budget_callout>: * _POSIX_Threads_Sporadic_budget_callout */ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread ) { 800d46c: 37 9c ff fc addi sp,sp,-4 800d470: 5b 9d 00 04 sw (sp+4),ra /* * This will prevent the thread from consuming its entire "budget" * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ 800d474: 34 02 ff ff mvi r2,-1 ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 800d478: 28 25 01 2c lw r5,(r1+300) /* * This will prevent the thread from consuming its entire "budget" * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ 800d47c: 58 22 00 78 sw (r1+120),r2 800d480: 78 02 08 01 mvhi r2,0x801 800d484: 38 42 90 a8 ori r2,r2,0x90a8 800d488: 40 44 00 00 lbu r4,(r2+0) 800d48c: 28 a2 00 88 lw r2,(r5+136) 800d490: c8 82 10 00 sub r2,r4,r2 */ #if 0 printk( "callout %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 800d494: 28 24 00 1c lw r4,(r1+28) * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority); the_thread->real_priority = new_priority; 800d498: 58 22 00 18 sw (r1+24),r2 */ #if 0 printk( "callout %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 800d49c: 5c 80 00 05 bne r4,r0,800d4b0 <_POSIX_Threads_Sporadic_budget_callout+0x44><== NEVER TAKEN /* * Make sure we are actually lowering it. If they have lowered it * to logically lower than sched_ss_low_priority, then we do not want to * change it. */ if ( the_thread->current_priority < new_priority ) { 800d4a0: 28 23 00 14 lw r3,(r1+20) 800d4a4: 50 62 00 03 bgeu r3,r2,800d4b0 <_POSIX_Threads_Sporadic_budget_callout+0x44><== NEVER TAKEN _Thread_Change_priority( the_thread, new_priority, true ); 800d4a8: 34 03 00 01 mvi r3,1 800d4ac: fb ff e3 1c calli 800611c <_Thread_Change_priority> #if 0 printk( "lower priority\n" ); #endif } } } 800d4b0: 2b 9d 00 04 lw ra,(sp+4) 800d4b4: 37 9c 00 04 addi sp,sp,4 800d4b8: c3 a0 00 00 ret =============================================================================== 080031f8 <_POSIX_Timer_TSR>: * This is the operation that is run when a timer expires */ void _POSIX_Timer_TSR( Objects_Id timer __attribute__((unused)), void *data) { 80031f8: 37 9c ff f8 addi sp,sp,-8 80031fc: 5b 8b 00 08 sw (sp+8),r11 8003200: 5b 9d 00 04 sw (sp+4),ra bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 8003204: 28 41 00 68 lw r1,(r2+104) * This is the operation that is run when a timer expires */ void _POSIX_Timer_TSR( Objects_Id timer __attribute__((unused)), void *data) { 8003208: b8 40 58 00 mv r11,r2 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 800320c: 34 21 00 01 addi r1,r1,1 8003210: 58 41 00 68 sw (r2+104),r1 /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 8003214: 28 41 00 54 lw r1,(r2+84) 8003218: 5c 20 00 03 bne r1,r0,8003224 <_POSIX_Timer_TSR+0x2c> 800321c: 28 42 00 58 lw r2,(r2+88) 8003220: 44 41 00 0d be r2,r1,8003254 <_POSIX_Timer_TSR+0x5c> <== NEVER TAKEN ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 8003224: 29 62 00 64 lw r2,(r11+100) 8003228: 29 63 00 08 lw r3,(r11+8) 800322c: 78 04 08 00 mvhi r4,0x800 8003230: 35 61 00 10 addi r1,r11,16 8003234: 38 84 31 f8 ori r4,r4,0x31f8 8003238: b9 60 28 00 mv r5,r11 800323c: f8 00 1a 2d calli 8009af0 <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 8003240: 44 20 00 0b be r1,r0,800326c <_POSIX_Timer_TSR+0x74> <== NEVER TAKEN return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); 8003244: 35 61 00 6c addi r1,r11,108 8003248: f8 00 04 7f calli 8004444 <_TOD_Get> /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 800324c: 34 01 00 03 mvi r1,3 8003250: e0 00 00 02 bi 8003258 <_POSIX_Timer_TSR+0x60> } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 8003254: 34 01 00 04 mvi r1,4 <== NOT EXECUTED 8003258: 31 61 00 3c sb (r11+60),r1 /* * The sending of the signal to the process running the handling function * specified for that signal is simulated */ if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) { 800325c: 29 62 00 44 lw r2,(r11+68) 8003260: 29 61 00 38 lw r1,(r11+56) 8003264: f8 00 18 d3 calli 80095b0 } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 8003268: 59 60 00 68 sw (r11+104),r0 } 800326c: 2b 9d 00 04 lw ra,(sp+4) 8003270: 2b 8b 00 08 lw r11,(sp+8) 8003274: 37 9c 00 08 addi sp,sp,8 8003278: c3 a0 00 00 ret =============================================================================== 08010b00 <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 8010b00: 37 9c ff d4 addi sp,sp,-44 8010b04: 5b 8b 00 20 sw (sp+32),r11 8010b08: 5b 8c 00 1c sw (sp+28),r12 8010b0c: 5b 8d 00 18 sw (sp+24),r13 8010b10: 5b 8e 00 14 sw (sp+20),r14 8010b14: 5b 8f 00 10 sw (sp+16),r15 8010b18: 5b 90 00 0c sw (sp+12),r16 8010b1c: 5b 91 00 08 sw (sp+8),r17 8010b20: 5b 9d 00 04 sw (sp+4),ra siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 8010b24: 37 91 00 24 addi r17,sp,36 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 8010b28: 20 64 00 ff andi r4,r3,0xff siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 8010b2c: 34 05 00 01 mvi r5,1 8010b30: ba 20 18 00 mv r3,r17 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 8010b34: b8 20 68 00 mv r13,r1 8010b38: b8 40 58 00 mv r11,r2 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 8010b3c: f8 00 00 37 calli 8010c18 <_POSIX_signals_Clear_signals> is_global, true ) ) return false; 8010b40: 34 10 00 00 mvi r16,0 ) { siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 8010b44: 44 20 00 2a be r1,r0,8010bec <_POSIX_signals_Check_signal+0xec> #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 8010b48: 34 02 00 01 mvi r2,1 8010b4c: b9 60 08 00 mv r1,r11 8010b50: f8 00 18 e0 calli 8016ed0 <__ashlsi3> 8010b54: b4 2b 78 00 add r15,r1,r11 8010b58: 78 0c 08 01 mvhi r12,0x801 8010b5c: b9 e0 08 00 mv r1,r15 8010b60: 34 02 00 02 mvi r2,2 8010b64: f8 00 18 db calli 8016ed0 <__ashlsi3> 8010b68: 39 8c 9e 20 ori r12,r12,0x9e20 8010b6c: b5 81 60 00 add r12,r12,r1 8010b70: 29 8e 00 08 lw r14,(r12+8) 8010b74: 34 01 00 01 mvi r1,1 8010b78: 45 c1 00 1d be r14,r1,8010bec <_POSIX_signals_Check_signal+0xec><== NEVER TAKEN /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 8010b7c: 34 02 00 01 mvi r2,1 8010b80: b9 60 08 00 mv r1,r11 8010b84: f8 00 18 d3 calli 8016ed0 <__ashlsi3> 8010b88: 34 02 00 02 mvi r2,2 8010b8c: b9 e0 08 00 mv r1,r15 8010b90: f8 00 18 d0 calli 8016ed0 <__ashlsi3> return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 8010b94: 29 b0 00 cc lw r16,(r13+204) api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 8010b98: 29 81 00 04 lw r1,(r12+4) /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 8010b9c: 34 02 00 01 mvi r2,1 /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 8010ba0: b8 30 08 00 or r1,r1,r16 8010ba4: 59 a1 00 cc sw (r13+204),r1 /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 8010ba8: b9 60 08 00 mv r1,r11 8010bac: f8 00 18 c9 calli 8016ed0 <__ashlsi3> 8010bb0: 34 02 00 02 mvi r2,2 8010bb4: b9 e0 08 00 mv r1,r15 8010bb8: f8 00 18 c6 calli 8016ed0 <__ashlsi3> 8010bbc: 29 82 00 00 lw r2,(r12+0) 8010bc0: 34 01 00 02 mvi r1,2 8010bc4: 5c 41 00 06 bne r2,r1,8010bdc <_POSIX_signals_Check_signal+0xdc> case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 8010bc8: b9 60 08 00 mv r1,r11 8010bcc: ba 20 10 00 mv r2,r17 8010bd0: 34 03 00 00 mvi r3,0 8010bd4: d9 c0 00 00 call r14 signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 8010bd8: e0 00 00 03 bi 8010be4 <_POSIX_signals_Check_signal+0xe4> default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 8010bdc: b9 60 08 00 mv r1,r11 8010be0: d9 c0 00 00 call r14 } /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 8010be4: 59 b0 00 cc sw (r13+204),r16 return true; 8010be8: 34 10 00 01 mvi r16,1 } 8010bec: ba 00 08 00 mv r1,r16 8010bf0: 2b 9d 00 04 lw ra,(sp+4) 8010bf4: 2b 8b 00 20 lw r11,(sp+32) 8010bf8: 2b 8c 00 1c lw r12,(sp+28) 8010bfc: 2b 8d 00 18 lw r13,(sp+24) 8010c00: 2b 8e 00 14 lw r14,(sp+20) 8010c04: 2b 8f 00 10 lw r15,(sp+16) 8010c08: 2b 90 00 0c lw r16,(sp+12) 8010c0c: 2b 91 00 08 lw r17,(sp+8) 8010c10: 37 9c 00 2c addi sp,sp,44 8010c14: c3 a0 00 00 ret =============================================================================== 08011340 <_POSIX_signals_Clear_process_signals>: */ void _POSIX_signals_Clear_process_signals( int signo ) { 8011340: 37 9c ff ec addi sp,sp,-20 8011344: 5b 8b 00 14 sw (sp+20),r11 8011348: 5b 8c 00 10 sw (sp+16),r12 801134c: 5b 8d 00 0c sw (sp+12),r13 8011350: 5b 8e 00 08 sw (sp+8),r14 8011354: 5b 9d 00 04 sw (sp+4),ra 8011358: b8 20 60 00 mv r12,r1 clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 801135c: 90 00 70 00 rcsr r14,IE 8011360: 34 01 ff fe mvi r1,-2 8011364: a1 c1 08 00 and r1,r14,r1 8011368: d0 01 00 00 wcsr IE,r1 if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 801136c: 34 02 00 01 mvi r2,1 8011370: b9 80 08 00 mv r1,r12 8011374: f8 00 16 d7 calli 8016ed0 <__ashlsi3> 8011378: b4 2c 58 00 add r11,r1,r12 801137c: 34 02 00 02 mvi r2,2 8011380: 78 0d 08 01 mvhi r13,0x801 8011384: b9 60 08 00 mv r1,r11 8011388: f8 00 16 d2 calli 8016ed0 <__ashlsi3> 801138c: 39 ad 9e 20 ori r13,r13,0x9e20 8011390: b5 a1 08 00 add r1,r13,r1 8011394: 28 22 00 00 lw r2,(r1+0) 8011398: 34 01 00 02 mvi r1,2 801139c: 5c 41 00 13 bne r2,r1,80113e8 <_POSIX_signals_Clear_process_signals+0xa8> */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 80113a0: 34 02 00 01 mvi r2,1 80113a4: b9 80 08 00 mv r1,r12 80113a8: f8 00 16 ca calli 8016ed0 <__ashlsi3> 80113ac: 34 02 00 02 mvi r2,2 80113b0: 78 0d 08 01 mvhi r13,0x801 80113b4: b9 60 08 00 mv r1,r11 80113b8: f8 00 16 c6 calli 8016ed0 <__ashlsi3> 80113bc: 39 ad a0 18 ori r13,r13,0xa018 80113c0: b5 a1 68 00 add r13,r13,r1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 80113c4: 34 02 00 01 mvi r2,1 80113c8: b9 80 08 00 mv r1,r12 80113cc: f8 00 16 c1 calli 8016ed0 <__ashlsi3> 80113d0: 34 02 00 02 mvi r2,2 80113d4: b9 60 08 00 mv r1,r11 80113d8: f8 00 16 be calli 8016ed0 <__ashlsi3> if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 80113dc: 29 a2 00 00 lw r2,(r13+0) 80113e0: 35 a1 00 04 addi r1,r13,4 80113e4: 5c 41 00 0a bne r2,r1,801140c <_POSIX_signals_Clear_process_signals+0xcc><== NEVER TAKEN 80113e8: 35 82 ff ff addi r2,r12,-1 clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 80113ec: 78 0b 08 01 mvhi r11,0x801 80113f0: 34 01 00 01 mvi r1,1 80113f4: f8 00 16 b7 calli 8016ed0 <__ashlsi3> 80113f8: 39 6b a0 14 ori r11,r11,0xa014 80113fc: 29 62 00 00 lw r2,(r11+0) 8011400: a4 20 08 00 not r1,r1 8011404: a0 22 08 00 and r1,r1,r2 8011408: 59 61 00 00 sw (r11+0),r1 } _ISR_Enable( level ); 801140c: d0 0e 00 00 wcsr IE,r14 } 8011410: 2b 9d 00 04 lw ra,(sp+4) 8011414: 2b 8b 00 14 lw r11,(sp+20) 8011418: 2b 8c 00 10 lw r12,(sp+16) 801141c: 2b 8d 00 0c lw r13,(sp+12) 8011420: 2b 8e 00 08 lw r14,(sp+8) 8011424: 37 9c 00 14 addi sp,sp,20 8011428: c3 a0 00 00 ret =============================================================================== 08003e60 <_POSIX_signals_Get_highest>: #include int _POSIX_signals_Get_highest( sigset_t set ) { 8003e60: 37 9c ff f0 addi sp,sp,-16 8003e64: 5b 8b 00 10 sw (sp+16),r11 8003e68: 5b 8c 00 0c sw (sp+12),r12 8003e6c: 5b 8d 00 08 sw (sp+8),r13 8003e70: 5b 9d 00 04 sw (sp+4),ra int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 8003e74: 34 0b 00 1b mvi r11,27 #include int _POSIX_signals_Get_highest( sigset_t set ) { 8003e78: b8 20 60 00 mv r12,r1 int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 8003e7c: 34 0d 00 20 mvi r13,32 8003e80: 34 01 00 01 mvi r1,1 8003e84: 35 62 ff ff addi r2,r11,-1 8003e88: f8 00 65 c1 calli 801d58c <__ashlsi3> if ( set & signo_to_mask( signo ) ) { 8003e8c: a0 2c 08 00 and r1,r1,r12 8003e90: 5c 20 00 0c bne r1,r0,8003ec0 <_POSIX_signals_Get_highest+0x60><== NEVER TAKEN sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 8003e94: 35 6b 00 01 addi r11,r11,1 8003e98: 5d 6d ff fa bne r11,r13,8003e80 <_POSIX_signals_Get_highest+0x20> 8003e9c: 34 0b 00 01 mvi r11,1 */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 8003ea0: 34 0d 00 1b mvi r13,27 8003ea4: 34 01 00 01 mvi r1,1 8003ea8: 35 62 ff ff addi r2,r11,-1 8003eac: f8 00 65 b8 calli 801d58c <__ashlsi3> if ( set & signo_to_mask( signo ) ) { 8003eb0: a0 2c 08 00 and r1,r1,r12 8003eb4: 5c 20 00 03 bne r1,r0,8003ec0 <_POSIX_signals_Get_highest+0x60> */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 8003eb8: 35 6b 00 01 addi r11,r11,1 8003ebc: 5d 6d ff fa bne r11,r13,8003ea4 <_POSIX_signals_Get_highest+0x44><== ALWAYS TAKEN * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } 8003ec0: b9 60 08 00 mv r1,r11 8003ec4: 2b 9d 00 04 lw ra,(sp+4) 8003ec8: 2b 8b 00 10 lw r11,(sp+16) 8003ecc: 2b 8c 00 0c lw r12,(sp+12) 8003ed0: 2b 8d 00 08 lw r13,(sp+8) 8003ed4: 37 9c 00 10 addi sp,sp,16 8003ed8: c3 a0 00 00 ret =============================================================================== 08025560 <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 8025560: 37 9c ff ec addi sp,sp,-20 8025564: 5b 8b 00 14 sw (sp+20),r11 8025568: 5b 8c 00 10 sw (sp+16),r12 802556c: 5b 8d 00 0c sw (sp+12),r13 8025570: 5b 8e 00 08 sw (sp+8),r14 8025574: 5b 9d 00 04 sw (sp+4),ra 8025578: b8 20 58 00 mv r11,r1 802557c: b8 40 70 00 mv r14,r2 POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 8025580: 28 2d 01 2c lw r13,(r1+300) 8025584: 34 42 ff ff addi r2,r2,-1 8025588: 34 01 00 01 mvi r1,1 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 802558c: b8 60 60 00 mv r12,r3 8025590: fb ff 72 6e calli 8001f48 <__ashlsi3> /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 8025594: 78 04 08 02 mvhi r4,0x802 8025598: 38 84 6d b4 ori r4,r4,0x6db4 802559c: 29 63 00 10 lw r3,(r11+16) 80255a0: 28 82 00 00 lw r2,(r4+0) 80255a4: a0 62 20 00 and r4,r3,r2 80255a8: 5c 82 00 1c bne r4,r2,8025618 <_POSIX_signals_Unblock_thread+0xb8> if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 80255ac: 29 62 00 30 lw r2,(r11+48) 80255b0: a0 22 10 00 and r2,r1,r2 80255b4: 5c 40 00 06 bne r2,r0,80255cc <_POSIX_signals_Unblock_thread+0x6c> 80255b8: 29 a2 00 cc lw r2,(r13+204) 80255bc: a4 40 10 00 not r2,r2 80255c0: a0 22 10 00 and r2,r1,r2 /* * This should only be reached via pthread_kill(). */ return false; 80255c4: 34 01 00 00 mvi r1,0 * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 80255c8: 44 41 00 35 be r2,r1,802569c <_POSIX_signals_Unblock_thread+0x13c> the_thread->Wait.return_code = EINTR; 80255cc: 34 01 00 04 mvi r1,4 80255d0: 59 61 00 34 sw (r11+52),r1 the_info = (siginfo_t *) the_thread->Wait.return_argument; 80255d4: 29 61 00 28 lw r1,(r11+40) if ( !info ) { 80255d8: 5d 80 00 06 bne r12,r0,80255f0 <_POSIX_signals_Unblock_thread+0x90> the_info->si_signo = signo; the_info->si_code = SI_USER; 80255dc: 34 02 00 01 mvi r2,1 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; 80255e0: 58 2e 00 00 sw (r1+0),r14 the_info->si_code = SI_USER; 80255e4: 58 22 00 04 sw (r1+4),r2 the_info->si_value.sival_int = 0; 80255e8: 58 20 00 08 sw (r1+8),r0 80255ec: e0 00 00 07 bi 8025608 <_POSIX_signals_Unblock_thread+0xa8> } else { *the_info = *info; 80255f0: 29 83 00 00 lw r3,(r12+0) 80255f4: 29 82 00 04 lw r2,(r12+4) 80255f8: 29 84 00 08 lw r4,(r12+8) 80255fc: 58 23 00 00 sw (r1+0),r3 8025600: 58 22 00 04 sw (r1+4),r2 8025604: 58 24 00 08 sw (r1+8),r4 } _Thread_queue_Extract_with_proxy( the_thread ); 8025608: b9 60 08 00 mv r1,r11 802560c: fb ff 9c 0f calli 800c648 <_Thread_queue_Extract_with_proxy> return true; 8025610: 34 01 00 01 mvi r1,1 8025614: e0 00 00 22 bi 802569c <_POSIX_signals_Unblock_thread+0x13c> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 8025618: 29 a2 00 cc lw r2,(r13+204) 802561c: a4 40 10 00 not r2,r2 8025620: a0 22 10 00 and r2,r1,r2 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Context_Switch_necessary = true; } } return false; 8025624: 34 01 00 00 mvi r1,0 } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 8025628: 44 40 00 1d be r2,r0,802569c <_POSIX_signals_Unblock_thread+0x13c> * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { 802562c: 78 02 10 00 mvhi r2,0x1000 8025630: a0 62 10 00 and r2,r3,r2 8025634: 44 40 00 11 be r2,r0,8025678 <_POSIX_signals_Unblock_thread+0x118> the_thread->Wait.return_code = EINTR; 8025638: 34 02 00 04 mvi r2,4 802563c: 59 62 00 34 sw (r11+52),r2 */ RTEMS_INLINE_ROUTINE bool _States_Is_delaying ( States_Control the_states ) { return (the_states & STATES_DELAYING); 8025640: 20 63 00 08 andi r3,r3,0x8 #if 0 if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) _Thread_queue_Extract_with_proxy( the_thread ); else #endif if ( _States_Is_delaying(the_thread->current_state) ){ 8025644: 44 60 00 16 be r3,r0,802569c <_POSIX_signals_Unblock_thread+0x13c><== NEVER TAKEN if ( _Watchdog_Is_active( &the_thread->Timer ) ) 8025648: 29 62 00 50 lw r2,(r11+80) 802564c: 34 01 00 02 mvi r1,2 8025650: 5c 41 00 03 bne r2,r1,802565c <_POSIX_signals_Unblock_thread+0xfc><== NEVER TAKEN (void) _Watchdog_Remove( &the_thread->Timer ); 8025654: 35 61 00 48 addi r1,r11,72 8025658: fb ff 9f 83 calli 800d464 <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 802565c: 78 03 08 02 mvhi r3,0x802 8025660: 38 63 69 a0 ori r3,r3,0x69a0 8025664: 28 62 00 00 lw r2,(r3+0) 8025668: b9 60 08 00 mv r1,r11 802566c: fb ff 98 a2 calli 800b8f4 <_Thread_Clear_state> } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Context_Switch_necessary = true; } } return false; 8025670: 34 01 00 00 mvi r1,0 8025674: e0 00 00 0a bi 802569c <_POSIX_signals_Unblock_thread+0x13c> if ( _States_Is_delaying(the_thread->current_state) ){ if ( _Watchdog_Is_active( &the_thread->Timer ) ) (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 8025678: 5c 61 00 09 bne r3,r1,802569c <_POSIX_signals_Unblock_thread+0x13c><== NEVER TAKEN if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 802567c: 78 02 08 02 mvhi r2,0x802 8025680: 38 42 9e ec ori r2,r2,0x9eec 8025684: 28 43 00 08 lw r3,(r2+8) 8025688: 44 61 00 05 be r3,r1,802569c <_POSIX_signals_Unblock_thread+0x13c> 802568c: 28 43 00 0c lw r3,(r2+12) 8025690: 5d 63 00 03 bne r11,r3,802569c <_POSIX_signals_Unblock_thread+0x13c><== NEVER TAKEN _Context_Switch_necessary = true; 8025694: 34 03 00 01 mvi r3,1 8025698: 30 43 00 18 sb (r2+24),r3 } } return false; } 802569c: 2b 9d 00 04 lw ra,(sp+4) 80256a0: 2b 8b 00 14 lw r11,(sp+20) 80256a4: 2b 8c 00 10 lw r12,(sp+16) 80256a8: 2b 8d 00 0c lw r13,(sp+12) 80256ac: 2b 8e 00 08 lw r14,(sp+8) 80256b0: 37 9c 00 14 addi sp,sp,20 80256b4: c3 a0 00 00 ret =============================================================================== 080042dc <_RTEMS_tasks_Initialize_user_tasks_body>: * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { 80042dc: 37 9c ff e8 addi sp,sp,-24 80042e0: 5b 8b 00 14 sw (sp+20),r11 80042e4: 5b 8c 00 10 sw (sp+16),r12 80042e8: 5b 8d 00 0c sw (sp+12),r13 80042ec: 5b 8e 00 08 sw (sp+8),r14 80042f0: 5b 9d 00 04 sw (sp+4),ra rtems_initialization_tasks_table *user_tasks; /* * Move information into local variables */ user_tasks = Configuration_RTEMS_API.User_initialization_tasks_table; 80042f4: 78 01 08 01 mvhi r1,0x801 80042f8: 38 21 90 74 ori r1,r1,0x9074 80042fc: 28 2b 00 2c lw r11,(r1+44) maximum = Configuration_RTEMS_API.number_of_initialization_tasks; 8004300: 28 2e 00 28 lw r14,(r1+40) /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) 8004304: 34 0d 00 00 mvi r13,0 8004308: 5d 60 00 1a bne r11,r0,8004370 <_RTEMS_tasks_Initialize_user_tasks_body+0x94> 800430c: e0 00 00 1a bi 8004374 <_RTEMS_tasks_Initialize_user_tasks_body+0x98> /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { return_value = rtems_task_create( 8004310: 29 61 00 00 lw r1,(r11+0) 8004314: 29 62 00 08 lw r2,(r11+8) 8004318: 29 63 00 04 lw r3,(r11+4) 800431c: 29 64 00 14 lw r4,(r11+20) 8004320: 29 65 00 0c lw r5,(r11+12) 8004324: 37 86 00 18 addi r6,sp,24 8004328: f8 00 26 3d calli 800dc1c 800432c: b8 20 60 00 mv r12,r1 user_tasks[ index ].stack_size, user_tasks[ index ].mode_set, user_tasks[ index ].attribute_set, &id ); if ( !rtems_is_status_successful( return_value ) ) 8004330: 44 20 00 05 be r1,r0,8004344 <_RTEMS_tasks_Initialize_user_tasks_body+0x68><== ALWAYS TAKEN _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 8004334: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8004338: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 800433c: b9 80 18 00 mv r3,r12 <== NOT EXECUTED 8004340: e0 00 00 0a bi 8004368 <_RTEMS_tasks_Initialize_user_tasks_body+0x8c><== NOT EXECUTED return_value = rtems_task_start( 8004344: 29 63 00 18 lw r3,(r11+24) 8004348: 29 62 00 10 lw r2,(r11+16) 800434c: 2b 81 00 18 lw r1,(sp+24) 8004350: 35 6b 00 1c addi r11,r11,28 8004354: f8 00 00 0f calli 8004390 8004358: b8 20 18 00 mv r3,r1 id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) 800435c: 44 2c 00 04 be r1,r12,800436c <_RTEMS_tasks_Initialize_user_tasks_body+0x90> _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 8004360: 34 01 00 01 mvi r1,1 8004364: 34 02 00 01 mvi r2,1 8004368: f8 00 04 ad calli 800561c <_Internal_error_Occurred> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 800436c: 35 ad 00 01 addi r13,r13,1 8004370: 55 cd ff e8 bgu r14,r13,8004310 <_RTEMS_tasks_Initialize_user_tasks_body+0x34> user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); } } 8004374: 2b 9d 00 04 lw ra,(sp+4) 8004378: 2b 8b 00 14 lw r11,(sp+20) 800437c: 2b 8c 00 10 lw r12,(sp+16) 8004380: 2b 8d 00 0c lw r13,(sp+12) 8004384: 2b 8e 00 08 lw r14,(sp+8) 8004388: 37 9c 00 18 addi sp,sp,24 800438c: c3 a0 00 00 ret =============================================================================== 0800e050 <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 800e050: 37 9c ff f0 addi sp,sp,-16 800e054: 5b 8b 00 0c sw (sp+12),r11 800e058: 5b 8c 00 08 sw (sp+8),r12 800e05c: 5b 9d 00 04 sw (sp+4),ra RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 800e060: 28 2b 01 28 lw r11,(r1+296) if ( !api ) 800e064: 45 60 00 1a be r11,r0,800e0cc <_RTEMS_tasks_Post_switch_extension+0x7c><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 800e068: 90 00 08 00 rcsr r1,IE 800e06c: 34 02 ff fe mvi r2,-2 800e070: a0 22 10 00 and r2,r1,r2 800e074: d0 02 00 00 wcsr IE,r2 signal_set = asr->signals_posted; 800e078: 29 6c 00 14 lw r12,(r11+20) asr->signals_posted = 0; 800e07c: 59 60 00 14 sw (r11+20),r0 _ISR_Enable( level ); 800e080: d0 01 00 00 wcsr IE,r1 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 800e084: 45 80 00 12 be r12,r0,800e0cc <_RTEMS_tasks_Post_switch_extension+0x7c> return; asr->nest_level += 1; 800e088: 29 61 00 1c lw r1,(r11+28) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 800e08c: 37 83 00 10 addi r3,sp,16 800e090: 38 02 ff ff mvu r2,0xffff if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 800e094: 34 21 00 01 addi r1,r1,1 800e098: 59 61 00 1c sw (r11+28),r1 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 800e09c: 29 61 00 10 lw r1,(r11+16) 800e0a0: fb ff ff 5a calli 800de08 (*asr->handler)( signal_set ); 800e0a4: 29 62 00 0c lw r2,(r11+12) 800e0a8: b9 80 08 00 mv r1,r12 800e0ac: d8 40 00 00 call r2 asr->nest_level -= 1; 800e0b0: 29 61 00 1c lw r1,(r11+28) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 800e0b4: 38 02 ff ff mvu r2,0xffff 800e0b8: 37 83 00 10 addi r3,sp,16 asr->nest_level += 1; rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); (*asr->handler)( signal_set ); asr->nest_level -= 1; 800e0bc: 34 21 ff ff addi r1,r1,-1 800e0c0: 59 61 00 1c sw (r11+28),r1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 800e0c4: 2b 81 00 10 lw r1,(sp+16) 800e0c8: fb ff ff 50 calli 800de08 } 800e0cc: 2b 9d 00 04 lw ra,(sp+4) 800e0d0: 2b 8b 00 0c lw r11,(sp+12) 800e0d4: 2b 8c 00 08 lw r12,(sp+8) 800e0d8: 37 9c 00 10 addi sp,sp,16 800e0dc: c3 a0 00 00 ret =============================================================================== 08004698 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 8004698: 37 9c ff f4 addi sp,sp,-12 800469c: 5b 8b 00 08 sw (sp+8),r11 80046a0: 5b 9d 00 04 sw (sp+4),ra 80046a4: b8 20 10 00 mv r2,r1 80046a8: 78 01 08 02 mvhi r1,0x802 80046ac: 38 21 08 90 ori r1,r1,0x890 80046b0: 37 83 00 0c addi r3,sp,12 80046b4: f8 00 08 e5 calli 8006a48 <_Objects_Get> /* * When we get here, the Timer is already off the chain so we do not * have to worry about that -- hence no _Watchdog_Remove(). */ the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 80046b8: 2b 82 00 0c lw r2,(sp+12) 80046bc: b8 20 58 00 mv r11,r1 80046c0: 5c 40 00 22 bne r2,r0,8004748 <_Rate_monotonic_Timeout+0xb0><== NEVER TAKEN case OBJECTS_LOCAL: the_thread = the_period->owner; 80046c4: 28 21 00 40 lw r1,(r1+64) */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_period ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_PERIOD); 80046c8: 28 23 00 10 lw r3,(r1+16) 80046cc: 20 63 40 00 andi r3,r3,0x4000 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 80046d0: 44 62 00 09 be r3,r2,80046f4 <_Rate_monotonic_Timeout+0x5c> 80046d4: 28 23 00 20 lw r3,(r1+32) 80046d8: 29 62 00 08 lw r2,(r11+8) 80046dc: 5c 62 00 06 bne r3,r2,80046f4 <_Rate_monotonic_Timeout+0x5c> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 80046e0: 78 03 08 01 mvhi r3,0x801 80046e4: 38 63 e8 34 ori r3,r3,0xe834 80046e8: 28 62 00 00 lw r2,(r3+0) 80046ec: f8 00 0a 6c calli 800709c <_Thread_Clear_state> 80046f0: e0 00 00 06 bi 8004708 <_Rate_monotonic_Timeout+0x70> _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { 80046f4: 29 62 00 38 lw r2,(r11+56) 80046f8: 34 01 00 01 mvi r1,1 80046fc: 5c 41 00 0c bne r2,r1,800472c <_Rate_monotonic_Timeout+0x94> the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 8004700: 34 01 00 03 mvi r1,3 8004704: 59 61 00 38 sw (r11+56),r1 _Rate_monotonic_Initiate_statistics( the_period ); 8004708: b9 60 08 00 mv r1,r11 800470c: fb ff fe 2e calli 8003fc4 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8004710: 29 61 00 3c lw r1,(r11+60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8004714: 35 62 00 10 addi r2,r11,16 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8004718: 59 61 00 1c sw (r11+28),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800471c: 78 01 08 02 mvhi r1,0x802 8004720: 38 21 0a 80 ori r1,r1,0xa80 8004724: f8 00 11 38 calli 8008c04 <_Watchdog_Insert> 8004728: e0 00 00 03 bi 8004734 <_Rate_monotonic_Timeout+0x9c> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 800472c: 34 01 00 04 mvi r1,4 8004730: 59 61 00 38 sw (r11+56),r1 */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 8004734: 78 01 08 02 mvhi r1,0x802 8004738: 38 21 09 bc ori r1,r1,0x9bc 800473c: 28 22 00 00 lw r2,(r1+0) 8004740: 34 42 ff ff addi r2,r2,-1 8004744: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 8004748: 2b 9d 00 04 lw ra,(sp+4) 800474c: 2b 8b 00 08 lw r11,(sp+8) 8004750: 37 9c 00 0c addi sp,sp,12 8004754: c3 a0 00 00 ret =============================================================================== 08004058 <_Rate_monotonic_Update_statistics>: void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 8004058: 37 9c ff e4 addi sp,sp,-28 800405c: 5b 8b 00 0c sw (sp+12),r11 8004060: 5b 8c 00 08 sw (sp+8),r12 8004064: 5b 9d 00 04 sw (sp+4),ra 8004068: b8 20 58 00 mv r11,r1 /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 800406c: 28 21 00 54 lw r1,(r1+84) if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 8004070: 29 62 00 38 lw r2,(r11+56) /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 8004074: 34 21 00 01 addi r1,r1,1 8004078: 59 61 00 54 sw (r11+84),r1 if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 800407c: 34 01 00 04 mvi r1,4 8004080: 5c 41 00 04 bne r2,r1,8004090 <_Rate_monotonic_Update_statistics+0x38> stats->missed_count++; 8004084: 29 61 00 58 lw r1,(r11+88) 8004088: 34 21 00 01 addi r1,r1,1 800408c: 59 61 00 58 sw (r11+88),r1 /* * Grab status for time statistics. */ valid_status = _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); 8004090: 37 8c 00 18 addi r12,sp,24 stats->missed_count++; /* * Grab status for time statistics. */ valid_status = 8004094: b9 60 08 00 mv r1,r11 8004098: 37 82 00 10 addi r2,sp,16 800409c: b9 80 18 00 mv r3,r12 80040a0: fb ff ff 90 calli 8003ee0 <_Rate_monotonic_Get_status> _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 80040a4: 44 20 00 28 be r1,r0,8004144 <_Rate_monotonic_Update_statistics+0xec><== NEVER TAKEN /* * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); 80040a8: b9 80 10 00 mv r2,r12 80040ac: 35 61 00 6c addi r1,r11,108 80040b0: f8 00 11 72 calli 8008678 <_Timespec_Add_to> if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 80040b4: b9 80 08 00 mv r1,r12 80040b8: 35 62 00 5c addi r2,r11,92 80040bc: f8 00 11 cd calli 80087f0 <_Timespec_Less_than> 80040c0: 44 20 00 05 be r1,r0,80040d4 <_Rate_monotonic_Update_statistics+0x7c> stats->min_cpu_time = executed; 80040c4: 2b 81 00 18 lw r1,(sp+24) 80040c8: 59 61 00 5c sw (r11+92),r1 80040cc: 2b 81 00 1c lw r1,(sp+28) 80040d0: 59 61 00 60 sw (r11+96),r1 if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 80040d4: 37 81 00 18 addi r1,sp,24 80040d8: 35 62 00 64 addi r2,r11,100 80040dc: f8 00 11 ba calli 80087c4 <_Timespec_Greater_than> 80040e0: 44 20 00 05 be r1,r0,80040f4 <_Rate_monotonic_Update_statistics+0x9c> stats->max_cpu_time = executed; 80040e4: 2b 81 00 18 lw r1,(sp+24) 80040e8: 59 61 00 64 sw (r11+100),r1 80040ec: 2b 81 00 1c lw r1,(sp+28) 80040f0: 59 61 00 68 sw (r11+104),r1 /* * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); 80040f4: 37 8c 00 10 addi r12,sp,16 80040f8: b9 80 10 00 mv r2,r12 80040fc: 35 61 00 84 addi r1,r11,132 8004100: f8 00 11 5e calli 8008678 <_Timespec_Add_to> if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 8004104: b9 80 08 00 mv r1,r12 8004108: 35 62 00 74 addi r2,r11,116 800410c: f8 00 11 b9 calli 80087f0 <_Timespec_Less_than> 8004110: 44 20 00 05 be r1,r0,8004124 <_Rate_monotonic_Update_statistics+0xcc> stats->min_wall_time = since_last_period; 8004114: 2b 81 00 10 lw r1,(sp+16) 8004118: 59 61 00 74 sw (r11+116),r1 800411c: 2b 81 00 14 lw r1,(sp+20) 8004120: 59 61 00 78 sw (r11+120),r1 if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 8004124: 37 81 00 10 addi r1,sp,16 8004128: 35 62 00 7c addi r2,r11,124 800412c: f8 00 11 a6 calli 80087c4 <_Timespec_Greater_than> 8004130: 44 20 00 05 be r1,r0,8004144 <_Rate_monotonic_Update_statistics+0xec> stats->max_wall_time = since_last_period; 8004134: 2b 81 00 10 lw r1,(sp+16) 8004138: 59 61 00 7c sw (r11+124),r1 800413c: 2b 81 00 14 lw r1,(sp+20) 8004140: 59 61 00 80 sw (r11+128),r1 stats->min_wall_time = since_last_period; if ( since_last_period > stats->max_wall_time ) stats->max_wall_time = since_last_period; #endif } 8004144: 2b 9d 00 04 lw ra,(sp+4) 8004148: 2b 8b 00 0c lw r11,(sp+12) 800414c: 2b 8c 00 08 lw r12,(sp+8) 8004150: 37 9c 00 1c addi sp,sp,28 8004154: c3 a0 00 00 ret =============================================================================== 0800504c <_TOD_Get>: */ void _TOD_Get( struct timespec *time ) { 800504c: 37 9c ff e4 addi sp,sp,-28 8005050: 5b 8b 00 0c sw (sp+12),r11 8005054: 5b 8c 00 08 sw (sp+8),r12 8005058: 5b 9d 00 04 sw (sp+4),ra 800505c: b8 20 58 00 mv r11,r1 /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); 8005060: 90 00 60 00 rcsr r12,IE 8005064: 34 01 ff fe mvi r1,-2 8005068: a1 81 08 00 and r1,r12,r1 800506c: d0 01 00 00 wcsr IE,r1 now = _TOD_Now; 8005070: 78 02 08 01 mvhi r2,0x801 8005074: 38 42 99 ac ori r2,r2,0x99ac 8005078: 28 41 00 00 lw r1,(r2+0) 800507c: 5b 81 00 10 sw (sp+16),r1 8005080: 28 41 00 04 lw r1,(r2+4) if ( _Watchdog_Nanoseconds_since_tick_handler ) 8005084: 78 02 08 01 mvhi r2,0x801 8005088: 38 42 9a a8 ori r2,r2,0x9aa8 800508c: 28 43 00 00 lw r3,(r2+0) /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); now = _TOD_Now; 8005090: 5b 81 00 14 sw (sp+20),r1 long nanoseconds; /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; 8005094: 34 02 00 00 mvi r2,0 _ISR_Disable( level ); now = _TOD_Now; if ( _Watchdog_Nanoseconds_since_tick_handler ) 8005098: 44 60 00 03 be r3,r0,80050a4 <_TOD_Get+0x58> <== ALWAYS TAKEN nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 800509c: d8 60 00 00 call r3 <== NOT EXECUTED 80050a0: b8 20 10 00 mv r2,r1 <== NOT EXECUTED _ISR_Enable( level ); 80050a4: d0 0c 00 00 wcsr IE,r12 _Timestamp_Set( &offset, 0, nanoseconds ); 80050a8: 5b 82 00 1c sw (sp+28),r2 _Timestamp_Add_to( &now, &offset ); 80050ac: 37 81 00 10 addi r1,sp,16 80050b0: 37 82 00 18 addi r2,sp,24 now = _TOD_Now; if ( _Watchdog_Nanoseconds_since_tick_handler ) nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); _ISR_Enable( level ); _Timestamp_Set( &offset, 0, nanoseconds ); 80050b4: 5b 80 00 18 sw (sp+24),r0 _Timestamp_Add_to( &now, &offset ); 80050b8: f8 00 09 1f calli 8007534 <_Timespec_Add_to> _Timestamp_To_timespec( &now, time ); 80050bc: 2b 81 00 10 lw r1,(sp+16) 80050c0: 59 61 00 00 sw (r11+0),r1 80050c4: 2b 81 00 14 lw r1,(sp+20) 80050c8: 59 61 00 04 sw (r11+4),r1 } 80050cc: 2b 9d 00 04 lw ra,(sp+4) 80050d0: 2b 8b 00 0c lw r11,(sp+12) 80050d4: 2b 8c 00 08 lw r12,(sp+8) 80050d8: 37 9c 00 1c addi sp,sp,28 80050dc: c3 a0 00 00 ret =============================================================================== 0800e59c <_TOD_Get_uptime>: */ void _TOD_Get_uptime( Timestamp_Control *uptime ) { 800e59c: 37 9c ff e4 addi sp,sp,-28 800e5a0: 5b 8b 00 0c sw (sp+12),r11 800e5a4: 5b 8c 00 08 sw (sp+8),r12 800e5a8: 5b 9d 00 04 sw (sp+4),ra 800e5ac: b8 20 58 00 mv r11,r1 /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); 800e5b0: 90 00 60 00 rcsr r12,IE 800e5b4: 34 01 ff fe mvi r1,-2 800e5b8: a1 81 08 00 and r1,r12,r1 800e5bc: d0 01 00 00 wcsr IE,r1 up = _TOD_Uptime; 800e5c0: 78 02 08 01 mvhi r2,0x801 800e5c4: 38 42 99 a0 ori r2,r2,0x99a0 800e5c8: 28 41 00 00 lw r1,(r2+0) 800e5cc: 5b 81 00 10 sw (sp+16),r1 800e5d0: 28 41 00 04 lw r1,(r2+4) if ( _Watchdog_Nanoseconds_since_tick_handler ) 800e5d4: 78 02 08 01 mvhi r2,0x801 800e5d8: 38 42 9a a8 ori r2,r2,0x9aa8 800e5dc: 28 43 00 00 lw r3,(r2+0) /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); up = _TOD_Uptime; 800e5e0: 5b 81 00 14 sw (sp+20),r1 long nanoseconds; /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; 800e5e4: 34 02 00 00 mvi r2,0 _ISR_Disable( level ); up = _TOD_Uptime; if ( _Watchdog_Nanoseconds_since_tick_handler ) 800e5e8: 44 60 00 03 be r3,r0,800e5f4 <_TOD_Get_uptime+0x58> <== ALWAYS TAKEN nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 800e5ec: d8 60 00 00 call r3 <== NOT EXECUTED 800e5f0: b8 20 10 00 mv r2,r1 <== NOT EXECUTED _ISR_Enable( level ); 800e5f4: d0 0c 00 00 wcsr IE,r12 _Timestamp_Set( &offset, 0, nanoseconds ); 800e5f8: 5b 82 00 1c sw (sp+28),r2 _Timestamp_Add_to( &up, &offset ); 800e5fc: 37 81 00 10 addi r1,sp,16 800e600: 37 82 00 18 addi r2,sp,24 up = _TOD_Uptime; if ( _Watchdog_Nanoseconds_since_tick_handler ) nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); _ISR_Enable( level ); _Timestamp_Set( &offset, 0, nanoseconds ); 800e604: 5b 80 00 18 sw (sp+24),r0 _Timestamp_Add_to( &up, &offset ); 800e608: fb ff e3 cb calli 8007534 <_Timespec_Add_to> *uptime = up; 800e60c: 2b 81 00 10 lw r1,(sp+16) 800e610: 59 61 00 00 sw (r11+0),r1 800e614: 2b 81 00 14 lw r1,(sp+20) 800e618: 59 61 00 04 sw (r11+4),r1 } 800e61c: 2b 9d 00 04 lw ra,(sp+4) 800e620: 2b 8b 00 0c lw r11,(sp+12) 800e624: 2b 8c 00 08 lw r12,(sp+8) 800e628: 37 9c 00 1c addi sp,sp,28 800e62c: c3 a0 00 00 ret =============================================================================== 080042c8 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 80042c8: 37 9c ff f0 addi sp,sp,-16 80042cc: 5b 8b 00 10 sw (sp+16),r11 80042d0: 5b 8c 00 0c sw (sp+12),r12 80042d4: 5b 8d 00 08 sw (sp+8),r13 80042d8: 5b 9d 00 04 sw (sp+4),ra 80042dc: b8 20 58 00 mv r11,r1 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 80042e0: 78 01 08 02 mvhi r1,0x802 80042e4: 38 21 10 c4 ori r1,r1,0x10c4 80042e8: 28 22 00 0c lw r2,(r1+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; 80042ec: 34 0c 00 00 mvi r12,0 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) || 80042f0: 45 60 00 22 be r11,r0,8004378 <_TOD_Validate+0xb0> <== NEVER TAKEN ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 80042f4: 78 03 08 01 mvhi r3,0x801 80042f8: 38 63 e6 94 ori r3,r3,0xe694 80042fc: 28 61 00 00 lw r1,(r3+0) 8004300: f8 00 63 40 calli 801d000 <__udivsi3> rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 8004304: 29 62 00 18 lw r2,(r11+24) 8004308: 50 41 00 1c bgeu r2,r1,8004378 <_TOD_Validate+0xb0> (the_tod->ticks >= ticks_per_second) || 800430c: 29 62 00 14 lw r2,(r11+20) 8004310: 34 01 00 3b mvi r1,59 8004314: 54 41 00 19 bgu r2,r1,8004378 <_TOD_Validate+0xb0> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 8004318: 29 62 00 10 lw r2,(r11+16) 800431c: 54 41 00 17 bgu r2,r1,8004378 <_TOD_Validate+0xb0> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 8004320: 29 62 00 0c lw r2,(r11+12) 8004324: 34 01 00 17 mvi r1,23 8004328: 54 41 00 14 bgu r2,r1,8004378 <_TOD_Validate+0xb0> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 800432c: 29 61 00 04 lw r1,(r11+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) || 8004330: 44 20 00 12 be r1,r0,8004378 <_TOD_Validate+0xb0> <== NEVER TAKEN (the_tod->month == 0) || 8004334: 34 02 00 0c mvi r2,12 8004338: 54 22 00 10 bgu r1,r2,8004378 <_TOD_Validate+0xb0> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 800433c: 29 62 00 00 lw r2,(r11+0) (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) || 8004340: 34 03 07 c3 mvi r3,1987 8004344: 50 62 00 0d bgeu r3,r2,8004378 <_TOD_Validate+0xb0> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 8004348: 29 6d 00 08 lw r13,(r11+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) || 800434c: 45 a0 00 0b be r13,r0,8004378 <_TOD_Validate+0xb0> <== NEVER TAKEN 8004350: 78 0b 08 01 mvhi r11,0x801 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 8004354: 20 42 00 03 andi r2,r2,0x3 8004358: 39 6b ef 4c ori r11,r11,0xef4c 800435c: 5c 40 00 02 bne r2,r0,8004364 <_TOD_Validate+0x9c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 8004360: 34 21 00 0d addi r1,r1,13 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 8004364: 34 02 00 02 mvi r2,2 8004368: fb ff f3 d4 calli 80012b8 <__ashlsi3> 800436c: b5 61 08 00 add r1,r11,r1 8004370: 28 2c 00 00 lw r12,(r1+0) * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 8004374: f1 8d 60 00 cmpgeu r12,r12,r13 if ( the_tod->day > days_in_month ) return false; return true; } 8004378: b9 80 08 00 mv r1,r12 800437c: 2b 9d 00 04 lw ra,(sp+4) 8004380: 2b 8b 00 10 lw r11,(sp+16) 8004384: 2b 8c 00 0c lw r12,(sp+12) 8004388: 2b 8d 00 08 lw r13,(sp+8) 800438c: 37 9c 00 10 addi sp,sp,16 8004390: c3 a0 00 00 ret =============================================================================== 0800611c <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 800611c: 37 9c ff ec addi sp,sp,-20 8006120: 5b 8b 00 14 sw (sp+20),r11 8006124: 5b 8c 00 10 sw (sp+16),r12 8006128: 5b 8d 00 0c sw (sp+12),r13 800612c: 5b 8e 00 08 sw (sp+8),r14 8006130: 5b 9d 00 04 sw (sp+4),ra 8006134: b8 20 58 00 mv r11,r1 */ /* * Save original state */ original_state = the_thread->current_state; 8006138: 28 2e 00 10 lw r14,(r1+16) void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 800613c: b8 40 60 00 mv r12,r2 8006140: 20 6d 00 ff andi r13,r3,0xff /* * Set a transient state for the thread so it is pulled off the Ready chains. * This will prevent it from being scheduled no matter what happens in an * ISR. */ _Thread_Set_transient( the_thread ); 8006144: f8 00 04 84 calli 8007354 <_Thread_Set_transient> /* * Do not bother recomputing all the priority related information if * we are not REALLY changing priority. */ if ( the_thread->current_priority != new_priority ) 8006148: 29 61 00 14 lw r1,(r11+20) 800614c: 44 2c 00 04 be r1,r12,800615c <_Thread_Change_priority+0x40> _Thread_Set_priority( the_thread, new_priority ); 8006150: b9 60 08 00 mv r1,r11 8006154: b9 80 10 00 mv r2,r12 8006158: f8 00 03 d4 calli 80070a8 <_Thread_Set_priority> _ISR_Disable( level ); 800615c: 90 00 60 00 rcsr r12,IE 8006160: 34 04 ff fe mvi r4,-2 8006164: a1 84 20 00 and r4,r12,r4 8006168: d0 04 00 00 wcsr IE,r4 /* * If the thread has more than STATES_TRANSIENT set, then it is blocked, * If it is blocked on a thread queue, then we need to requeue it. */ state = the_thread->current_state; 800616c: 29 61 00 10 lw r1,(r11+16) if ( state != STATES_TRANSIENT ) { 8006170: 34 03 00 04 mvi r3,4 8006174: 21 c2 00 04 andi r2,r14,0x4 8006178: 44 23 00 0f be r1,r3,80061b4 <_Thread_Change_priority+0x98> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 800617c: 5c 40 00 04 bne r2,r0,800618c <_Thread_Change_priority+0x70><== NEVER TAKEN RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 8006180: 34 02 ff fb mvi r2,-5 8006184: a0 22 10 00 and r2,r1,r2 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 8006188: 59 62 00 10 sw (r11+16),r2 _ISR_Enable( level ); 800618c: d0 0c 00 00 wcsr IE,r12 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 8006190: 78 03 08 01 mvhi r3,0x801 8006194: 38 63 81 3c ori r3,r3,0x813c 8006198: 28 62 00 00 lw r2,(r3+0) 800619c: a0 22 08 00 and r1,r1,r2 if ( _States_Is_waiting_on_thread_queue( state ) ) { 80061a0: 44 20 00 60 be r1,r0,8006320 <_Thread_Change_priority+0x204> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 80061a4: 29 61 00 44 lw r1,(r11+68) 80061a8: b9 60 10 00 mv r2,r11 80061ac: f8 00 03 8a calli 8006fd4 <_Thread_queue_Requeue> 80061b0: e0 00 00 5c bi 8006320 <_Thread_Change_priority+0x204> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 80061b4: 5c 40 00 1c bne r2,r0,8006224 <_Thread_Change_priority+0x108><== NEVER TAKEN RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 80061b8: 29 61 00 90 lw r1,(r11+144) 80061bc: 2d 63 00 96 lhu r3,(r11+150) * Interrupts are STILL disabled. * We now know the thread will be in the READY state when we remove * the TRANSIENT state. So we have to place it on the appropriate * Ready Queue with interrupts off. */ the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 80061c0: 59 60 00 10 sw (r11+16),r0 80061c4: 2c 25 00 00 lhu r5,(r1+0) 80061c8: b8 a3 18 00 or r3,r5,r3 80061cc: 0c 23 00 00 sh (r1+0),r3 _Priority_Major_bit_map |= the_priority_map->ready_major; 80061d0: 78 01 08 01 mvhi r1,0x801 80061d4: 38 21 99 c4 ori r1,r1,0x99c4 80061d8: 2c 23 00 00 lhu r3,(r1+0) 80061dc: 2d 65 00 94 lhu r5,(r11+148) 80061e0: b8 a3 18 00 or r3,r5,r3 80061e4: 20 63 ff ff andi r3,r3,0xffff 80061e8: 0c 23 00 00 sh (r1+0),r3 80061ec: 29 61 00 8c lw r1,(r11+140) _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 80061f0: 45 a2 00 07 be r13,r2,800620c <_Thread_Change_priority+0xf0> ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 80061f4: 28 22 00 00 lw r2,(r1+0) Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 80061f8: 59 61 00 04 sw (r11+4),r1 before_node = after_node->next; after_node->next = the_node; 80061fc: 58 2b 00 00 sw (r1+0),r11 the_node->next = before_node; 8006200: 59 62 00 00 sw (r11+0),r2 before_node->previous = the_node; 8006204: 58 4b 00 04 sw (r2+4),r11 8006208: e0 00 00 07 bi 8006224 <_Thread_Change_priority+0x108> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 800620c: 34 22 00 04 addi r2,r1,4 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 8006210: 59 62 00 00 sw (r11+0),r2 old_last_node = the_chain->last; 8006214: 28 22 00 08 lw r2,(r1+8) the_chain->last = the_node; 8006218: 58 2b 00 08 sw (r1+8),r11 old_last_node->next = the_node; 800621c: 58 4b 00 00 sw (r2+0),r11 the_node->previous = old_last_node; 8006220: 59 62 00 04 sw (r11+4),r2 _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node ); else _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node ); } _ISR_Flash( level ); 8006224: d0 0c 00 00 wcsr IE,r12 8006228: d0 04 00 00 wcsr IE,r4 */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) _Thread_Ready_chain[ _Priority_Get_highest() ].first; 800622c: 78 01 08 01 mvhi r1,0x801 RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void ) { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 8006230: 78 02 08 01 mvhi r2,0x801 8006234: 38 21 98 b8 ori r1,r1,0x98b8 8006238: 38 42 99 c4 ori r2,r2,0x99c4 800623c: 28 2e 00 00 lw r14,(r1+0) 8006240: 2c 41 00 00 lhu r1,(r2+0) 8006244: 78 0b 08 01 mvhi r11,0x801 8006248: 34 02 00 ff mvi r2,255 800624c: 20 21 ff ff andi r1,r1,0xffff 8006250: 39 6b 7f c4 ori r11,r11,0x7fc4 8006254: 54 22 00 05 bgu r1,r2,8006268 <_Thread_Change_priority+0x14c> 8006258: b5 61 58 00 add r11,r11,r1 800625c: 41 6d 00 00 lbu r13,(r11+0) 8006260: 35 ad 00 08 addi r13,r13,8 8006264: e0 00 00 05 bi 8006278 <_Thread_Change_priority+0x15c> 8006268: 34 02 00 08 mvi r2,8 800626c: f8 00 43 67 calli 8017008 <__lshrsi3> 8006270: b5 61 58 00 add r11,r11,r1 8006274: 41 6d 00 00 lbu r13,(r11+0) _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 8006278: 34 02 00 01 mvi r2,1 800627c: 78 0b 08 01 mvhi r11,0x801 8006280: b9 a0 08 00 mv r1,r13 8006284: f8 00 43 13 calli 8016ed0 <__ashlsi3> 8006288: 39 6b 9a 38 ori r11,r11,0x9a38 800628c: b5 61 58 00 add r11,r11,r1 8006290: 2d 62 00 00 lhu r2,(r11+0) 8006294: 34 01 00 ff mvi r1,255 8006298: 78 0b 08 01 mvhi r11,0x801 800629c: 39 6b 7f c4 ori r11,r11,0x7fc4 80062a0: 54 41 00 05 bgu r2,r1,80062b4 <_Thread_Change_priority+0x198> 80062a4: b5 62 58 00 add r11,r11,r2 80062a8: 41 6b 00 00 lbu r11,(r11+0) 80062ac: 35 6b 00 08 addi r11,r11,8 80062b0: e0 00 00 06 bi 80062c8 <_Thread_Change_priority+0x1ac> 80062b4: b8 40 08 00 mv r1,r2 80062b8: 34 02 00 08 mvi r2,8 80062bc: f8 00 43 53 calli 8017008 <__lshrsi3> 80062c0: b5 61 58 00 add r11,r11,r1 80062c4: 41 6b 00 00 lbu r11,(r11+0) return (_Priority_Bits_index( major ) << 4) + 80062c8: 34 02 00 04 mvi r2,4 80062cc: b9 a0 08 00 mv r1,r13 80062d0: f8 00 43 00 calli 8016ed0 <__ashlsi3> 80062d4: b5 61 58 00 add r11,r11,r1 80062d8: 34 02 00 01 mvi r2,1 80062dc: b9 60 08 00 mv r1,r11 80062e0: f8 00 42 fc calli 8016ed0 <__ashlsi3> 80062e4: 34 02 00 02 mvi r2,2 80062e8: b4 2b 08 00 add r1,r1,r11 80062ec: f8 00 42 f9 calli 8016ed0 <__ashlsi3> 80062f0: b5 c1 08 00 add r1,r14,r1 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 80062f4: 28 23 00 00 lw r3,(r1+0) 80062f8: 78 01 08 01 mvhi r1,0x801 80062fc: 38 21 9d fc ori r1,r1,0x9dfc * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 8006300: 28 22 00 0c lw r2,(r1+12) * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 8006304: 58 23 00 10 sw (r1+16),r3 * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Thread_Calculate_heir(); if ( !_Thread_Is_executing_also_the_heir() && 8006308: 44 43 00 05 be r2,r3,800631c <_Thread_Change_priority+0x200> 800630c: 40 42 00 74 lbu r2,(r2+116) 8006310: 44 40 00 03 be r2,r0,800631c <_Thread_Change_priority+0x200> _Thread_Executing->is_preemptible ) _Context_Switch_necessary = true; 8006314: 34 02 00 01 mvi r2,1 8006318: 30 22 00 18 sb (r1+24),r2 _ISR_Enable( level ); 800631c: d0 0c 00 00 wcsr IE,r12 } 8006320: 2b 9d 00 04 lw ra,(sp+4) 8006324: 2b 8b 00 14 lw r11,(sp+20) 8006328: 2b 8c 00 10 lw r12,(sp+16) 800632c: 2b 8d 00 0c lw r13,(sp+12) 8006330: 2b 8e 00 08 lw r14,(sp+8) 8006334: 37 9c 00 14 addi sp,sp,20 8006338: c3 a0 00 00 ret =============================================================================== 0800ed80 <_Thread_Clear_state>: ) { ISR_Level level; States_Control current_state; _ISR_Disable( level ); 800ed80: 90 00 18 00 rcsr r3,IE 800ed84: 34 04 ff fe mvi r4,-2 800ed88: a0 64 20 00 and r4,r3,r4 800ed8c: d0 04 00 00 wcsr IE,r4 current_state = the_thread->current_state; 800ed90: 28 25 00 10 lw r5,(r1+16) if ( current_state & state ) { 800ed94: a0 45 30 00 and r6,r2,r5 800ed98: 44 c0 00 29 be r6,r0,800ee3c <_Thread_Clear_state+0xbc> RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 800ed9c: a4 40 10 00 not r2,r2 800eda0: a0 45 10 00 and r2,r2,r5 current_state = the_thread->current_state = _States_Clear( state, current_state ); 800eda4: 58 22 00 10 sw (r1+16),r2 if ( _States_Is_ready( current_state ) ) { 800eda8: 5c 40 00 25 bne r2,r0,800ee3c <_Thread_Clear_state+0xbc> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 800edac: 28 22 00 90 lw r2,(r1+144) 800edb0: 2c 25 00 96 lhu r5,(r1+150) 800edb4: 2c 46 00 00 lhu r6,(r2+0) 800edb8: b8 c5 28 00 or r5,r6,r5 800edbc: 0c 45 00 00 sh (r2+0),r5 _Priority_Major_bit_map |= the_priority_map->ready_major; 800edc0: 78 02 08 01 mvhi r2,0x801 800edc4: 38 42 99 c4 ori r2,r2,0x99c4 800edc8: 2c 45 00 00 lhu r5,(r2+0) 800edcc: 2c 26 00 94 lhu r6,(r1+148) 800edd0: b8 c5 28 00 or r5,r6,r5 800edd4: 20 a5 ff ff andi r5,r5,0xffff 800edd8: 0c 45 00 00 sh (r2+0),r5 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 800eddc: 28 22 00 8c lw r2,(r1+140) 800ede0: 34 45 00 04 addi r5,r2,4 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 800ede4: 58 25 00 00 sw (r1+0),r5 old_last_node = the_chain->last; 800ede8: 28 45 00 08 lw r5,(r2+8) the_chain->last = the_node; 800edec: 58 41 00 08 sw (r2+8),r1 old_last_node->next = the_node; 800edf0: 58 a1 00 00 sw (r5+0),r1 the_node->previous = old_last_node; 800edf4: 58 25 00 04 sw (r1+4),r5 _ISR_Flash( level ); 800edf8: d0 03 00 00 wcsr IE,r3 800edfc: d0 04 00 00 wcsr IE,r4 * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 800ee00: 78 02 08 01 mvhi r2,0x801 800ee04: 38 42 9d fc ori r2,r2,0x9dfc 800ee08: 28 45 00 10 lw r5,(r2+16) 800ee0c: 28 24 00 14 lw r4,(r1+20) 800ee10: 28 a5 00 14 lw r5,(r5+20) 800ee14: 50 85 00 0a bgeu r4,r5,800ee3c <_Thread_Clear_state+0xbc> _Thread_Heir = the_thread; 800ee18: 58 41 00 10 sw (r2+16),r1 if ( _Thread_Executing->is_preemptible || 800ee1c: 28 41 00 0c lw r1,(r2+12) 800ee20: 40 21 00 74 lbu r1,(r1+116) 800ee24: 5c 20 00 02 bne r1,r0,800ee2c <_Thread_Clear_state+0xac> 800ee28: 5c 81 00 05 bne r4,r1,800ee3c <_Thread_Clear_state+0xbc> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 800ee2c: 78 01 08 01 mvhi r1,0x801 800ee30: 38 21 9d fc ori r1,r1,0x9dfc 800ee34: 34 02 00 01 mvi r2,1 800ee38: 30 22 00 18 sb (r1+24),r2 } } } _ISR_Enable( level ); 800ee3c: d0 03 00 00 wcsr IE,r3 } 800ee40: c3 a0 00 00 ret =============================================================================== 0800bb68 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 800bb68: 37 9c ff f8 addi sp,sp,-8 800bb6c: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 800bb70: 37 82 00 08 addi r2,sp,8 800bb74: f8 00 00 7c calli 800bd64 <_Thread_Get> switch ( location ) { 800bb78: 2b 82 00 08 lw r2,(sp+8) 800bb7c: 5c 40 00 0a bne r2,r0,800bba4 <_Thread_Delay_ended+0x3c> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 800bb80: 78 03 08 02 mvhi r3,0x802 800bb84: 38 63 6b 54 ori r3,r3,0x6b54 800bb88: 28 62 00 00 lw r2,(r3+0) 800bb8c: fb ff ff 5a calli 800b8f4 <_Thread_Clear_state> 800bb90: 78 01 08 02 mvhi r1,0x802 800bb94: 38 21 9a 14 ori r1,r1,0x9a14 800bb98: 28 22 00 00 lw r2,(r1+0) 800bb9c: 34 42 ff ff addi r2,r2,-1 800bba0: 58 22 00 00 sw (r1+0),r2 | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 800bba4: 2b 9d 00 04 lw ra,(sp+4) 800bba8: 37 9c 00 08 addi sp,sp,8 800bbac: c3 a0 00 00 ret =============================================================================== 08006424 <_Thread_Dispatch>: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 8006424: 37 9c ff c0 addi sp,sp,-64 8006428: 5b 8b 00 30 sw (sp+48),r11 800642c: 5b 8c 00 2c sw (sp+44),r12 8006430: 5b 8d 00 28 sw (sp+40),r13 8006434: 5b 8e 00 24 sw (sp+36),r14 8006438: 5b 8f 00 20 sw (sp+32),r15 800643c: 5b 90 00 1c sw (sp+28),r16 8006440: 5b 91 00 18 sw (sp+24),r17 8006444: 5b 92 00 14 sw (sp+20),r18 8006448: 5b 93 00 10 sw (sp+16),r19 800644c: 5b 94 00 0c sw (sp+12),r20 8006450: 5b 95 00 08 sw (sp+8),r21 8006454: 5b 9d 00 04 sw (sp+4),ra Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 8006458: 78 01 08 01 mvhi r1,0x801 800645c: 38 21 9d fc ori r1,r1,0x9dfc 8006460: 28 2d 00 0c lw r13,(r1+12) _ISR_Disable( level ); 8006464: 90 00 20 00 rcsr r4,IE 8006468: 34 01 ff fe mvi r1,-2 800646c: a0 81 08 00 and r1,r4,r1 8006470: d0 01 00 00 wcsr IE,r1 while ( _Context_Switch_necessary == true ) { 8006474: 78 0c 08 01 mvhi r12,0x801 heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 8006478: 78 11 08 01 mvhi r17,0x801 #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 800647c: 78 0f 08 01 mvhi r15,0x801 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 8006480: 78 0e 08 01 mvhi r14,0x801 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8006484: 78 10 08 01 mvhi r16,0x801 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 8006488: 39 8c 9d fc ori r12,r12,0x9dfc heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 800648c: 3a 31 99 24 ori r17,r17,0x9924 8006490: 34 14 00 01 mvi r20,1 #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 8006494: 39 ef 98 bc ori r15,r15,0x98bc _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 8006498: 37 93 00 3c addi r19,sp,60 _Timestamp_Subtract( 800649c: 39 ce 99 d4 ori r14,r14,0x99d4 80064a0: 37 92 00 34 addi r18,sp,52 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 80064a4: 3a 10 99 a8 ori r16,r16,0x99a8 #endif #endif executing = _Thread_Executing; _ISR_Disable( level ); 80064a8: 34 15 ff fe mvi r21,-2 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 80064ac: e0 00 00 28 bi 800654c <_Thread_Dispatch+0x128> heir = _Thread_Heir; 80064b0: 29 8b 00 10 lw r11,(r12+16) _Thread_Dispatch_disable_level = 1; 80064b4: 5a 34 00 00 sw (r17+0),r20 _Context_Switch_necessary = false; 80064b8: 31 80 00 18 sb (r12+24),r0 _Thread_Executing = heir; 80064bc: 59 8b 00 0c sw (r12+12),r11 /* * When the heir and executing are the same, then we are being * requested to do the post switch dispatching. This is normally * done to dispatch signals. */ if ( heir == executing ) 80064c0: 45 6d 00 26 be r11,r13,8006558 <_Thread_Dispatch+0x134> */ #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) 80064c4: 29 61 00 7c lw r1,(r11+124) 80064c8: 5c 34 00 03 bne r1,r20,80064d4 <_Thread_Dispatch+0xb0> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 80064cc: 29 e1 00 00 lw r1,(r15+0) 80064d0: 59 61 00 78 sw (r11+120),r1 _ISR_Enable( level ); 80064d4: d0 04 00 00 wcsr IE,r4 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 80064d8: ba 60 08 00 mv r1,r19 80064dc: f8 00 20 30 calli 800e59c <_TOD_Get_uptime> _Timestamp_Subtract( 80064e0: b9 c0 08 00 mv r1,r14 80064e4: ba 60 10 00 mv r2,r19 80064e8: ba 40 18 00 mv r3,r18 80064ec: f8 00 04 2b calli 8007598 <_Timespec_Subtract> &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 80064f0: 35 a1 00 84 addi r1,r13,132 80064f4: ba 40 10 00 mv r2,r18 80064f8: f8 00 04 0f calli 8007534 <_Timespec_Add_to> _Thread_Time_of_last_context_switch = uptime; 80064fc: 2b 81 00 3c lw r1,(sp+60) #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8006500: 2a 04 00 00 lw r4,(r16+0) &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 8006504: 59 c1 00 00 sw (r14+0),r1 8006508: 2b 81 00 40 lw r1,(sp+64) 800650c: 59 c1 00 04 sw (r14+4),r1 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8006510: 44 80 00 05 be r4,r0,8006524 <_Thread_Dispatch+0x100> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 8006514: 28 81 00 00 lw r1,(r4+0) 8006518: 59 a1 01 24 sw (r13+292),r1 *_Thread_libc_reent = heir->libc_reent; 800651c: 29 61 01 24 lw r1,(r11+292) 8006520: 58 81 00 00 sw (r4+0),r1 } _User_extensions_Thread_switch( executing, heir ); 8006524: b9 a0 08 00 mv r1,r13 8006528: b9 60 10 00 mv r2,r11 800652c: f8 00 04 fa calli 8007914 <_User_extensions_Thread_switch> if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 8006530: 35 a1 00 d0 addi r1,r13,208 8006534: 35 62 00 d0 addi r2,r11,208 8006538: f8 00 05 d8 calli 8007c98 <_CPU_Context_switch> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 800653c: 29 8d 00 0c lw r13,(r12+12) _ISR_Disable( level ); 8006540: 90 00 20 00 rcsr r4,IE 8006544: a0 95 08 00 and r1,r4,r21 8006548: d0 01 00 00 wcsr IE,r1 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 800654c: 41 81 00 18 lbu r1,(r12+24) 8006550: 20 21 00 ff andi r1,r1,0xff 8006554: 5c 20 ff d7 bne r1,r0,80064b0 <_Thread_Dispatch+0x8c> _ISR_Disable( level ); } post_switch: _Thread_Dispatch_disable_level = 0; 8006558: 78 01 08 01 mvhi r1,0x801 800655c: 38 21 99 24 ori r1,r1,0x9924 8006560: 58 20 00 00 sw (r1+0),r0 _ISR_Enable( level ); 8006564: d0 04 00 00 wcsr IE,r4 _API_extensions_Run_postswitch(); 8006568: fb ff f9 3f calli 8004a64 <_API_extensions_Run_postswitch> } 800656c: 2b 9d 00 04 lw ra,(sp+4) 8006570: 2b 8b 00 30 lw r11,(sp+48) 8006574: 2b 8c 00 2c lw r12,(sp+44) 8006578: 2b 8d 00 28 lw r13,(sp+40) 800657c: 2b 8e 00 24 lw r14,(sp+36) 8006580: 2b 8f 00 20 lw r15,(sp+32) 8006584: 2b 90 00 1c lw r16,(sp+28) 8006588: 2b 91 00 18 lw r17,(sp+24) 800658c: 2b 92 00 14 lw r18,(sp+20) 8006590: 2b 93 00 10 lw r19,(sp+16) 8006594: 2b 94 00 0c lw r20,(sp+12) 8006598: 2b 95 00 08 lw r21,(sp+8) 800659c: 37 9c 00 40 addi sp,sp,64 80065a0: c3 a0 00 00 ret =============================================================================== 080065d8 <_Thread_Get>: Thread_Control *_Thread_Get ( Objects_Id id, Objects_Locations *location ) { 80065d8: 37 9c ff e8 addi sp,sp,-24 80065dc: 5b 8b 00 18 sw (sp+24),r11 80065e0: 5b 8c 00 14 sw (sp+20),r12 80065e4: 5b 8d 00 10 sw (sp+16),r13 80065e8: 5b 8e 00 0c sw (sp+12),r14 80065ec: 5b 8f 00 08 sw (sp+8),r15 80065f0: 5b 9d 00 04 sw (sp+4),ra 80065f4: b8 20 68 00 mv r13,r1 80065f8: b8 40 58 00 mv r11,r2 uint32_t the_class; Objects_Information **api_information; Objects_Information *information; Thread_Control *tp = (Thread_Control *) 0; if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) { 80065fc: 5c 20 00 0b bne r1,r0,8006628 <_Thread_Get+0x50> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8006600: 78 01 08 01 mvhi r1,0x801 8006604: 38 21 99 24 ori r1,r1,0x9924 8006608: 28 22 00 00 lw r2,(r1+0) 800660c: 34 42 00 01 addi r2,r2,1 8006610: 58 22 00 00 sw (r1+0),r2 _Thread_Disable_dispatch(); *location = OBJECTS_LOCAL; tp = _Thread_Executing; 8006614: 78 01 08 01 mvhi r1,0x801 8006618: 38 21 9d fc ori r1,r1,0x9dfc Objects_Information *information; Thread_Control *tp = (Thread_Control *) 0; if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) { _Thread_Disable_dispatch(); *location = OBJECTS_LOCAL; 800661c: 59 60 00 00 sw (r11+0),r0 tp = _Thread_Executing; 8006620: 28 21 00 0c lw r1,(r1+12) goto done; 8006624: e0 00 00 1c bi 8006694 <_Thread_Get+0xbc> */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 8006628: 34 02 00 18 mvi r2,24 800662c: f8 00 42 77 calli 8017008 <__lshrsi3> 8006630: 20 2f 00 07 andi r15,r1,0x7 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 8006634: 35 e1 ff ff addi r1,r15,-1 8006638: 34 02 00 02 mvi r2,2 800663c: 50 41 00 1e bgeu r2,r1,80066b4 <_Thread_Get+0xdc> } the_api = _Objects_Get_API( id ); if ( !_Objects_Is_api_valid( the_api ) ) { *location = OBJECTS_ERROR; 8006640: 34 01 00 01 mvi r1,1 8006644: 59 61 00 00 sw (r11+0),r1 8006648: e0 00 00 02 bi 8006650 <_Thread_Get+0x78> goto done; } the_class = _Objects_Get_class( id ); if ( the_class != 1 ) { /* threads are always first class :) */ *location = OBJECTS_ERROR; 800664c: 59 62 00 00 sw (r11+0),r2 { uint32_t the_api; uint32_t the_class; Objects_Information **api_information; Objects_Information *information; Thread_Control *tp = (Thread_Control *) 0; 8006650: 34 01 00 00 mvi r1,0 } the_class = _Objects_Get_class( id ); if ( the_class != 1 ) { /* threads are always first class :) */ *location = OBJECTS_ERROR; goto done; 8006654: e0 00 00 10 bi 8006694 <_Thread_Get+0xbc> } api_information = _Objects_Information_table[ the_api ]; 8006658: 78 0e 08 01 mvhi r14,0x801 800665c: b9 e0 08 00 mv r1,r15 8006660: 34 02 00 02 mvi r2,2 8006664: f8 00 42 1b calli 8016ed0 <__ashlsi3> 8006668: 39 ce 98 c0 ori r14,r14,0x98c0 800666c: b5 c1 08 00 add r1,r14,r1 8006670: 28 21 00 00 lw r1,(r1+0) if ( !api_information ) { 8006674: 44 20 00 03 be r1,r0,8006680 <_Thread_Get+0xa8> <== NEVER TAKEN *location = OBJECTS_ERROR; goto done; } information = api_information[ the_class ]; 8006678: 28 21 00 04 lw r1,(r1+4) if ( !information ) { 800667c: 5c 20 00 03 bne r1,r0,8006688 <_Thread_Get+0xb0> *location = OBJECTS_ERROR; 8006680: 59 6c 00 00 sw (r11+0),r12 goto done; 8006684: e0 00 00 04 bi 8006694 <_Thread_Get+0xbc> } tp = (Thread_Control *) _Objects_Get( information, id, location ); 8006688: b9 a0 10 00 mv r2,r13 800668c: b9 60 18 00 mv r3,r11 8006690: fb ff fd 77 calli 8005c6c <_Objects_Get> done: return tp; } 8006694: 2b 9d 00 04 lw ra,(sp+4) 8006698: 2b 8b 00 18 lw r11,(sp+24) 800669c: 2b 8c 00 14 lw r12,(sp+20) 80066a0: 2b 8d 00 10 lw r13,(sp+16) 80066a4: 2b 8e 00 0c lw r14,(sp+12) 80066a8: 2b 8f 00 08 lw r15,(sp+8) 80066ac: 37 9c 00 18 addi sp,sp,24 80066b0: c3 a0 00 00 ret */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 80066b4: 34 02 00 1b mvi r2,27 80066b8: b9 a0 08 00 mv r1,r13 80066bc: f8 00 42 53 calli 8017008 <__lshrsi3> *location = OBJECTS_ERROR; goto done; } the_class = _Objects_Get_class( id ); if ( the_class != 1 ) { /* threads are always first class :) */ 80066c0: 34 02 00 01 mvi r2,1 80066c4: b8 20 60 00 mv r12,r1 80066c8: 44 22 ff e4 be r1,r2,8006658 <_Thread_Get+0x80> 80066cc: e3 ff ff e0 bi 800664c <_Thread_Get+0x74> =============================================================================== 08011224 <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 8011224: 37 9c ff f4 addi sp,sp,-12 8011228: 5b 8b 00 0c sw (sp+12),r11 801122c: 5b 8c 00 08 sw (sp+8),r12 8011230: 5b 9d 00 04 sw (sp+4),ra #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 8011234: 78 01 08 01 mvhi r1,0x801 8011238: 38 21 9d fc ori r1,r1,0x9dfc 801123c: 28 2b 00 0c lw r11,(r1+12) /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 8011240: 29 61 00 b8 lw r1,(r11+184) _ISR_Set_level(level); 8011244: 64 21 00 00 cmpei r1,r1,0 8011248: d0 01 00 00 wcsr IE,r1 #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 801124c: 78 01 08 01 mvhi r1,0x801 8011250: 38 21 97 7c ori r1,r1,0x977c 8011254: 40 2c 00 00 lbu r12,(r1+0) doneConstructors = 1; 8011258: 34 02 00 01 mvi r2,1 801125c: 30 22 00 00 sb (r1+0),r2 /* * Take care that 'begin' extensions get to complete before * 'switch' extensions can run. This means must keep dispatch * disabled until all 'begin' extensions complete. */ _User_extensions_Thread_begin( executing ); 8011260: b9 60 08 00 mv r1,r11 8011264: fb ff d9 20 calli 80076e4 <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 8011268: fb ff d4 cf calli 80065a4 <_Thread_Enable_dispatch> /* * _init could be a weak symbol and we SHOULD test it but it isn't * in any configuration I know of and it generates a warning on every * RTEMS target configuration. --joel (12 May 2007) */ if (!doneCons) /* && (volatile void *)_init) */ { 801126c: 5d 80 00 02 bne r12,r0,8011274 <_Thread_Handler+0x50> INIT_NAME (); 8011270: fb ff bb 64 calli 8000000 } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 8011274: 29 61 00 a0 lw r1,(r11+160) 8011278: 5c 20 00 04 bne r1,r0,8011288 <_Thread_Handler+0x64> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 801127c: 29 62 00 9c lw r2,(r11+156) 8011280: 29 61 00 a8 lw r1,(r11+168) 8011284: e0 00 00 05 bi 8011298 <_Thread_Handler+0x74> executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 8011288: 34 02 00 01 mvi r2,1 801128c: 5c 22 00 05 bne r1,r2,80112a0 <_Thread_Handler+0x7c> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 8011290: 29 62 00 9c lw r2,(r11+156) 8011294: 29 61 00 a4 lw r1,(r11+164) 8011298: d8 40 00 00 call r2 executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 801129c: 59 61 00 28 sw (r11+40),r1 * was placed in return_argument. This assumed that if it returned * anything (which is not supporting in all APIs), then it would be * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); 80112a0: b9 60 08 00 mv r1,r11 80112a4: fb ff d9 28 calli 8007744 <_User_extensions_Thread_exitted> _Internal_error_Occurred( 80112a8: 34 01 00 00 mvi r1,0 80112ac: 34 02 00 01 mvi r2,1 80112b0: 34 03 00 05 mvi r3,5 80112b4: fb ff d0 da calli 800561c <_Internal_error_Occurred> =============================================================================== 0800a07c <_Thread_Resume>: { ISR_Level level; States_Control current_state; _ISR_Disable( level ); 800a07c: 90 00 18 00 rcsr r3,IE 800a080: 34 04 ff fe mvi r4,-2 800a084: a0 64 20 00 and r4,r3,r4 800a088: d0 04 00 00 wcsr IE,r4 current_state = the_thread->current_state; 800a08c: 28 22 00 10 lw r2,(r1+16) if ( current_state & STATES_SUSPENDED ) { 800a090: 20 45 00 02 andi r5,r2,0x2 800a094: 44 a0 00 29 be r5,r0,800a138 <_Thread_Resume+0xbc> <== NEVER TAKEN RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 800a098: 34 05 ff fd mvi r5,-3 800a09c: a0 45 10 00 and r2,r2,r5 current_state = the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); 800a0a0: 58 22 00 10 sw (r1+16),r2 if ( _States_Is_ready( current_state ) ) { 800a0a4: 5c 40 00 25 bne r2,r0,800a138 <_Thread_Resume+0xbc> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 800a0a8: 28 22 00 90 lw r2,(r1+144) 800a0ac: 2c 25 00 96 lhu r5,(r1+150) 800a0b0: 2c 46 00 00 lhu r6,(r2+0) 800a0b4: b8 c5 28 00 or r5,r6,r5 800a0b8: 0c 45 00 00 sh (r2+0),r5 _Priority_Major_bit_map |= the_priority_map->ready_major; 800a0bc: 78 02 08 01 mvhi r2,0x801 800a0c0: 38 42 9a 14 ori r2,r2,0x9a14 800a0c4: 2c 45 00 00 lhu r5,(r2+0) 800a0c8: 2c 26 00 94 lhu r6,(r1+148) 800a0cc: b8 c5 28 00 or r5,r6,r5 800a0d0: 20 a5 ff ff andi r5,r5,0xffff 800a0d4: 0c 45 00 00 sh (r2+0),r5 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 800a0d8: 28 22 00 8c lw r2,(r1+140) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 800a0dc: 34 45 00 04 addi r5,r2,4 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 800a0e0: 58 25 00 00 sw (r1+0),r5 old_last_node = the_chain->last; 800a0e4: 28 45 00 08 lw r5,(r2+8) the_chain->last = the_node; 800a0e8: 58 41 00 08 sw (r2+8),r1 old_last_node->next = the_node; 800a0ec: 58 a1 00 00 sw (r5+0),r1 the_node->previous = old_last_node; 800a0f0: 58 25 00 04 sw (r1+4),r5 _ISR_Flash( level ); 800a0f4: d0 03 00 00 wcsr IE,r3 800a0f8: d0 04 00 00 wcsr IE,r4 if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 800a0fc: 78 02 08 01 mvhi r2,0x801 800a100: 38 42 9e 4c ori r2,r2,0x9e4c 800a104: 28 45 00 10 lw r5,(r2+16) 800a108: 28 24 00 14 lw r4,(r1+20) 800a10c: 28 a5 00 14 lw r5,(r5+20) 800a110: 50 85 00 0a bgeu r4,r5,800a138 <_Thread_Resume+0xbc> _Thread_Heir = the_thread; 800a114: 58 41 00 10 sw (r2+16),r1 if ( _Thread_Executing->is_preemptible || 800a118: 28 41 00 0c lw r1,(r2+12) 800a11c: 40 21 00 74 lbu r1,(r1+116) 800a120: 5c 20 00 02 bne r1,r0,800a128 <_Thread_Resume+0xac> 800a124: 5c 81 00 05 bne r4,r1,800a138 <_Thread_Resume+0xbc> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 800a128: 78 01 08 01 mvhi r1,0x801 800a12c: 38 21 9e 4c ori r1,r1,0x9e4c 800a130: 34 02 00 01 mvi r2,1 800a134: 30 22 00 18 sb (r1+24),r2 } } } _ISR_Enable( level ); 800a138: d0 03 00 00 wcsr IE,r3 } 800a13c: c3 a0 00 00 ret =============================================================================== 0800be28 <_Thread_Tickle_timeslice>: * * Output parameters: NONE */ void _Thread_Tickle_timeslice( void ) { 800be28: 37 9c ff f8 addi sp,sp,-8 800be2c: 5b 8b 00 08 sw (sp+8),r11 800be30: 5b 9d 00 04 sw (sp+4),ra Thread_Control *executing; executing = _Thread_Executing; 800be34: 78 01 08 01 mvhi r1,0x801 800be38: 38 21 ae ac ori r1,r1,0xaeac 800be3c: 28 2b 00 0c lw r11,(r1+12) /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 800be40: 41 61 00 74 lbu r1,(r11+116) 800be44: 44 20 00 1b be r1,r0,800beb0 <_Thread_Tickle_timeslice+0x88> return; if ( !_States_Is_ready( executing->current_state ) ) 800be48: 29 61 00 10 lw r1,(r11+16) 800be4c: 5c 20 00 19 bne r1,r0,800beb0 <_Thread_Tickle_timeslice+0x88> /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 800be50: 29 61 00 7c lw r1,(r11+124) 800be54: 44 20 00 17 be r1,r0,800beb0 <_Thread_Tickle_timeslice+0x88> 800be58: 34 02 00 02 mvi r2,2 800be5c: 50 41 00 04 bgeu r2,r1,800be6c <_Thread_Tickle_timeslice+0x44> 800be60: 34 02 00 03 mvi r2,3 800be64: 5c 22 00 13 bne r1,r2,800beb0 <_Thread_Tickle_timeslice+0x88><== NEVER TAKEN 800be68: e0 00 00 0b bi 800be94 <_Thread_Tickle_timeslice+0x6c> case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: #endif if ( (int)(--executing->cpu_time_budget) <= 0 ) { 800be6c: 29 61 00 78 lw r1,(r11+120) 800be70: 34 21 ff ff addi r1,r1,-1 800be74: 59 61 00 78 sw (r11+120),r1 800be78: 48 20 00 0e bg r1,r0,800beb0 <_Thread_Tickle_timeslice+0x88> * at the priority of the currently executing thread, then the * executing thread's timeslice is reset. Otherwise, the * currently executing thread is placed at the rear of the * FIFO for this priority and a new heir is selected. */ _Thread_Yield_processor(); 800be7c: f8 00 00 11 calli 800bec0 <_Thread_Yield_processor> executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 800be80: 78 01 08 01 mvhi r1,0x801 800be84: 38 21 a9 6c ori r1,r1,0xa96c 800be88: 28 21 00 00 lw r1,(r1+0) 800be8c: 59 61 00 78 sw (r11+120),r1 800be90: e0 00 00 08 bi 800beb0 <_Thread_Tickle_timeslice+0x88> } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 800be94: 29 61 00 78 lw r1,(r11+120) 800be98: 34 21 ff ff addi r1,r1,-1 800be9c: 59 61 00 78 sw (r11+120),r1 800bea0: 5c 20 00 04 bne r1,r0,800beb0 <_Thread_Tickle_timeslice+0x88> (*executing->budget_callout)( executing ); 800bea4: 29 62 00 80 lw r2,(r11+128) 800bea8: b9 60 08 00 mv r1,r11 800beac: d8 40 00 00 call r2 break; #endif } } 800beb0: 2b 9d 00 04 lw ra,(sp+4) 800beb4: 2b 8b 00 08 lw r11,(sp+8) 800beb8: 37 9c 00 08 addi sp,sp,8 800bebc: c3 a0 00 00 ret =============================================================================== 0800ed20 <_Thread_blocking_operation_Cancel>: Thread_blocking_operation_States sync_state __attribute__((unused)), #endif Thread_Control *the_thread, ISR_Level level ) { 800ed20: 37 9c ff f8 addi sp,sp,-8 800ed24: 5b 8b 00 08 sw (sp+8),r11 800ed28: 5b 9d 00 04 sw (sp+4),ra 800ed2c: b8 40 58 00 mv r11,r2 #endif /* * The thread is not waiting on anything after this completes. */ the_thread->Wait.queue = NULL; 800ed30: 58 40 00 44 sw (r2+68),r0 /* * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { 800ed34: 28 42 00 50 lw r2,(r2+80) 800ed38: 34 01 00 02 mvi r1,2 800ed3c: 5c 41 00 07 bne r2,r1,800ed58 <_Thread_blocking_operation_Cancel+0x38><== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 800ed40: 34 01 00 03 mvi r1,3 <== NOT EXECUTED 800ed44: 59 61 00 50 sw (r11+80),r1 <== NOT EXECUTED _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 800ed48: d0 03 00 00 wcsr IE,r3 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 800ed4c: 35 61 00 48 addi r1,r11,72 <== NOT EXECUTED 800ed50: fb ff e3 69 calli 8007af4 <_Watchdog_Remove> <== NOT EXECUTED 800ed54: e0 00 00 02 bi 800ed5c <_Thread_blocking_operation_Cancel+0x3c><== NOT EXECUTED } else _ISR_Enable( level ); 800ed58: d0 03 00 00 wcsr IE,r3 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800ed5c: 78 03 08 01 mvhi r3,0x801 800ed60: 38 63 81 44 ori r3,r3,0x8144 800ed64: 28 62 00 00 lw r2,(r3+0) 800ed68: b9 60 08 00 mv r1,r11 800ed6c: f8 00 00 05 calli 800ed80 <_Thread_Clear_state> #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 800ed70: 2b 9d 00 04 lw ra,(sp+4) 800ed74: 2b 8b 00 08 lw r11,(sp+8) 800ed78: 37 9c 00 08 addi sp,sp,8 800ed7c: c3 a0 00 00 ret =============================================================================== 08006c54 <_Thread_queue_Enqueue_priority>: Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 8006c54: 37 9c ff c8 addi sp,sp,-56 8006c58: 5b 8b 00 38 sw (sp+56),r11 8006c5c: 5b 8c 00 34 sw (sp+52),r12 8006c60: 5b 8d 00 30 sw (sp+48),r13 8006c64: 5b 8e 00 2c sw (sp+44),r14 8006c68: 5b 8f 00 28 sw (sp+40),r15 8006c6c: 5b 90 00 24 sw (sp+36),r16 8006c70: 5b 91 00 20 sw (sp+32),r17 8006c74: 5b 92 00 1c sw (sp+28),r18 8006c78: 5b 93 00 18 sw (sp+24),r19 8006c7c: 5b 94 00 14 sw (sp+20),r20 8006c80: 5b 95 00 10 sw (sp+16),r21 8006c84: 5b 96 00 0c sw (sp+12),r22 8006c88: 5b 97 00 08 sw (sp+8),r23 8006c8c: 5b 9d 00 04 sw (sp+4),ra Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 8006c90: 28 50 00 14 lw r16,(r2+20) Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 8006c94: b8 20 68 00 mv r13,r1 8006c98: 34 41 00 3c addi r1,r2,60 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8006c9c: 58 41 00 38 sw (r2+56),r1 Chain_Node *previous_node; Chain_Node *search_node; Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); 8006ca0: 34 41 00 38 addi r1,r2,56 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 8006ca4: 58 41 00 40 sw (r2+64),r1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 8006ca8: 58 40 00 3c sw (r2+60),r0 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 8006cac: b8 40 58 00 mv r11,r2 RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number ( Priority_Control the_priority ) { return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER); 8006cb0: ba 00 08 00 mv r1,r16 8006cb4: 34 02 00 06 mvi r2,6 8006cb8: b8 60 a8 00 mv r21,r3 8006cbc: f8 00 40 d3 calli 8017008 <__lshrsi3> _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 ]; 8006cc0: 34 02 00 01 mvi r2,1 8006cc4: b8 20 70 00 mv r14,r1 8006cc8: f8 00 40 82 calli 8016ed0 <__ashlsi3> 8006ccc: 34 02 00 02 mvi r2,2 8006cd0: b4 2e 08 00 add r1,r1,r14 8006cd4: f8 00 40 7f calli 8016ed0 <__ashlsi3> the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 8006cd8: 78 12 08 01 mvhi r18,0x801 RTEMS_INLINE_ROUTINE bool _Thread_queue_Is_reverse_search ( Priority_Control the_priority ) { return ( the_priority & TASK_QUEUE_DATA_REVERSE_SEARCH_MASK ); 8006cdc: 22 02 00 20 andi r2,r16,0x20 _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 ]; 8006ce0: b5 a1 b8 00 add r23,r13,r1 block_state = the_thread_queue->state; 8006ce4: 29 b3 00 38 lw r19,(r13+56) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 8006ce8: 3a 52 90 a8 ori r18,r18,0x90a8 _ISR_Disable( level ); 8006cec: 34 16 ff fe mvi r22,-2 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 ) ) 8006cf0: 5c 40 00 30 bne r2,r0,8006db0 <_Thread_queue_Enqueue_priority+0x15c> goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 8006cf4: 34 14 ff fe mvi r20,-2 8006cf8: 90 00 78 00 rcsr r15,IE 8006cfc: a1 f4 90 00 and r18,r15,r20 8006d00: d0 12 00 00 wcsr IE,r18 search_thread = (Thread_Control *) header->first; 8006d04: 34 02 00 01 mvi r2,1 8006d08: b9 c0 08 00 mv r1,r14 8006d0c: f8 00 40 71 calli 8016ed0 <__ashlsi3> 8006d10: b4 2e 08 00 add r1,r1,r14 8006d14: 34 02 00 02 mvi r2,2 8006d18: f8 00 40 6e calli 8016ed0 <__ashlsi3> 8006d1c: b5 a1 08 00 add r1,r13,r1 8006d20: 28 2c 00 00 lw r12,(r1+0) if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; 8006d24: 34 11 ff ff mvi r17,-1 _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 8006d28: e0 00 00 0b bi 8006d54 <_Thread_queue_Enqueue_priority+0x100> search_priority = search_thread->current_priority; 8006d2c: 29 91 00 14 lw r17,(r12+20) if ( priority <= search_priority ) 8006d30: 52 30 00 12 bgeu r17,r16,8006d78 <_Thread_queue_Enqueue_priority+0x124> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 8006d34: d0 0f 00 00 wcsr IE,r15 8006d38: d0 12 00 00 wcsr IE,r18 RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 8006d3c: 29 81 00 10 lw r1,(r12+16) 8006d40: a2 61 08 00 and r1,r19,r1 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 8006d44: 5c 20 00 03 bne r1,r0,8006d50 <_Thread_queue_Enqueue_priority+0xfc><== ALWAYS TAKEN _ISR_Enable( level ); 8006d48: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED goto restart_forward_search; 8006d4c: e3 ff ff eb bi 8006cf8 <_Thread_queue_Enqueue_priority+0xa4><== NOT EXECUTED } search_thread = (Thread_Control *)search_thread->Object.Node.next; 8006d50: 29 8c 00 00 lw r12,(r12+0) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8006d54: 34 02 00 01 mvi r2,1 8006d58: b9 c0 08 00 mv r1,r14 8006d5c: f8 00 40 5d calli 8016ed0 <__ashlsi3> 8006d60: b4 2e 08 00 add r1,r1,r14 8006d64: 34 02 00 02 mvi r2,2 8006d68: f8 00 40 5a calli 8016ed0 <__ashlsi3> 8006d6c: b5 a1 08 00 add r1,r13,r1 8006d70: 34 21 00 04 addi r1,r1,4 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 ) ) { 8006d74: 5d 81 ff ee bne r12,r1,8006d2c <_Thread_queue_Enqueue_priority+0xd8> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 8006d78: 29 a3 00 30 lw r3,(r13+48) 8006d7c: 34 02 00 01 mvi r2,1 8006d80: b9 e0 08 00 mv r1,r15 8006d84: 5c 62 00 3c bne r3,r2,8006e74 <_Thread_queue_Enqueue_priority+0x220><== NEVER TAKEN THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8006d88: 59 a0 00 30 sw (r13+48),r0 if ( priority == search_priority ) 8006d8c: 46 11 00 31 be r16,r17,8006e50 <_Thread_queue_Enqueue_priority+0x1fc> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 8006d90: 29 81 00 04 lw r1,(r12+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8006d94: 59 6c 00 00 sw (r11+0),r12 the_node->previous = previous_node; 8006d98: 59 61 00 04 sw (r11+4),r1 previous_node->next = the_node; 8006d9c: 58 2b 00 00 sw (r1+0),r11 search_node->previous = the_node; 8006da0: 59 8b 00 04 sw (r12+4),r11 the_thread->Wait.queue = the_thread_queue; 8006da4: 59 6d 00 44 sw (r11+68),r13 _ISR_Enable( level ); 8006da8: d0 0f 00 00 wcsr IE,r15 8006dac: e0 00 00 27 bi 8006e48 <_Thread_queue_Enqueue_priority+0x1f4> return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 8006db0: 42 51 00 00 lbu r17,(r18+0) 8006db4: 36 31 00 01 addi r17,r17,1 _ISR_Disable( level ); 8006db8: 90 00 78 00 rcsr r15,IE 8006dbc: a1 f6 a0 00 and r20,r15,r22 8006dc0: d0 14 00 00 wcsr IE,r20 search_thread = (Thread_Control *) header->last; 8006dc4: 34 02 00 01 mvi r2,1 8006dc8: b9 c0 08 00 mv r1,r14 8006dcc: f8 00 40 41 calli 8016ed0 <__ashlsi3> 8006dd0: b4 2e 08 00 add r1,r1,r14 8006dd4: 34 02 00 02 mvi r2,2 8006dd8: f8 00 40 3e calli 8016ed0 <__ashlsi3> 8006ddc: b5 a1 08 00 add r1,r13,r1 8006de0: 28 2c 00 08 lw r12,(r1+8) while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8006de4: e0 00 00 0b bi 8006e10 <_Thread_queue_Enqueue_priority+0x1bc> search_priority = search_thread->current_priority; 8006de8: 29 91 00 14 lw r17,(r12+20) if ( priority >= search_priority ) 8006dec: 52 11 00 0a bgeu r16,r17,8006e14 <_Thread_queue_Enqueue_priority+0x1c0> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 8006df0: d0 0f 00 00 wcsr IE,r15 8006df4: d0 14 00 00 wcsr IE,r20 8006df8: 29 81 00 10 lw r1,(r12+16) 8006dfc: a2 61 08 00 and r1,r19,r1 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 8006e00: 5c 20 00 03 bne r1,r0,8006e0c <_Thread_queue_Enqueue_priority+0x1b8><== ALWAYS TAKEN _ISR_Enable( level ); 8006e04: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED goto restart_reverse_search; 8006e08: e3 ff ff ea bi 8006db0 <_Thread_queue_Enqueue_priority+0x15c><== NOT EXECUTED } search_thread = (Thread_Control *) search_thread->Object.Node.previous; 8006e0c: 29 8c 00 04 lw r12,(r12+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 ) ) { 8006e10: 5d 97 ff f6 bne r12,r23,8006de8 <_Thread_queue_Enqueue_priority+0x194> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 8006e14: 29 a3 00 30 lw r3,(r13+48) 8006e18: 34 02 00 01 mvi r2,1 8006e1c: b9 e0 08 00 mv r1,r15 8006e20: 5c 62 00 15 bne r3,r2,8006e74 <_Thread_queue_Enqueue_priority+0x220><== NEVER TAKEN THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8006e24: 59 a0 00 30 sw (r13+48),r0 if ( priority == search_priority ) 8006e28: 46 11 00 0a be r16,r17,8006e50 <_Thread_queue_Enqueue_priority+0x1fc> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 8006e2c: 29 81 00 00 lw r1,(r12+0) the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 8006e30: 59 6c 00 04 sw (r11+4),r12 search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 8006e34: 59 61 00 00 sw (r11+0),r1 the_node->previous = search_node; search_node->next = the_node; 8006e38: 59 8b 00 00 sw (r12+0),r11 next_node->previous = the_node; 8006e3c: 58 2b 00 04 sw (r1+4),r11 the_thread->Wait.queue = the_thread_queue; 8006e40: 59 6d 00 44 sw (r11+68),r13 _ISR_Enable( level ); 8006e44: d0 0f 00 00 wcsr IE,r15 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 8006e48: 34 01 00 01 mvi r1,1 8006e4c: e0 00 00 0c bi 8006e7c <_Thread_queue_Enqueue_priority+0x228> 8006e50: 35 8c 00 3c addi r12,r12,60 equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 8006e54: 29 81 00 04 lw r1,(r12+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8006e58: 59 6c 00 00 sw (r11+0),r12 the_node->previous = previous_node; 8006e5c: 59 61 00 04 sw (r11+4),r1 previous_node->next = the_node; 8006e60: 58 2b 00 00 sw (r1+0),r11 search_node->previous = the_node; 8006e64: 59 8b 00 04 sw (r12+4),r11 the_thread->Wait.queue = the_thread_queue; 8006e68: 59 6d 00 44 sw (r11+68),r13 _ISR_Enable( level ); 8006e6c: d0 0f 00 00 wcsr IE,r15 8006e70: e3 ff ff f6 bi 8006e48 <_Thread_queue_Enqueue_priority+0x1f4> * 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; 8006e74: 5a a1 00 00 sw (r21+0),r1 <== NOT EXECUTED return the_thread_queue->sync_state; 8006e78: 29 a1 00 30 lw r1,(r13+48) <== NOT EXECUTED } 8006e7c: 2b 9d 00 04 lw ra,(sp+4) 8006e80: 2b 8b 00 38 lw r11,(sp+56) 8006e84: 2b 8c 00 34 lw r12,(sp+52) 8006e88: 2b 8d 00 30 lw r13,(sp+48) 8006e8c: 2b 8e 00 2c lw r14,(sp+44) 8006e90: 2b 8f 00 28 lw r15,(sp+40) 8006e94: 2b 90 00 24 lw r16,(sp+36) 8006e98: 2b 91 00 20 lw r17,(sp+32) 8006e9c: 2b 92 00 1c lw r18,(sp+28) 8006ea0: 2b 93 00 18 lw r19,(sp+24) 8006ea4: 2b 94 00 14 lw r20,(sp+20) 8006ea8: 2b 95 00 10 lw r21,(sp+16) 8006eac: 2b 96 00 0c lw r22,(sp+12) 8006eb0: 2b 97 00 08 lw r23,(sp+8) 8006eb4: 37 9c 00 38 addi sp,sp,56 8006eb8: c3 a0 00 00 ret =============================================================================== 0800f048 <_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 ) { 800f048: 37 9c ff f8 addi sp,sp,-8 800f04c: 5b 8b 00 08 sw (sp+8),r11 800f050: 5b 9d 00 04 sw (sp+4),ra 800f054: b8 40 58 00 mv r11,r2 800f058: 20 63 00 ff andi r3,r3,0xff Chain_Node *new_first_node; Chain_Node *new_second_node; Chain_Node *last_node; the_node = (Chain_Node *) the_thread; _ISR_Disable( level ); 800f05c: 90 00 10 00 rcsr r2,IE 800f060: 34 01 ff fe mvi r1,-2 800f064: a0 41 08 00 and r1,r2,r1 800f068: d0 01 00 00 wcsr IE,r1 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 800f06c: 78 05 08 01 mvhi r5,0x801 800f070: 38 a5 81 3c ori r5,r5,0x813c 800f074: 29 64 00 10 lw r4,(r11+16) 800f078: 28 a1 00 00 lw r1,(r5+0) 800f07c: a0 81 08 00 and r1,r4,r1 if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 800f080: 5c 20 00 03 bne r1,r0,800f08c <_Thread_queue_Extract_priority_helper+0x44> _ISR_Enable( level ); 800f084: d0 02 00 00 wcsr IE,r2 return; 800f088: e0 00 00 28 bi 800f128 <_Thread_queue_Extract_priority_helper+0xe0> */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 800f08c: 29 61 00 38 lw r1,(r11+56) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 800f090: 35 66 00 3c addi r6,r11,60 /* * The thread was actually waiting on a thread queue so let's remove it. */ next_node = the_node->next; 800f094: 29 64 00 00 lw r4,(r11+0) previous_node = the_node->previous; 800f098: 29 65 00 04 lw r5,(r11+4) if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { 800f09c: 44 26 00 0f be r1,r6,800f0d8 <_Thread_queue_Extract_priority_helper+0x90> new_first_node = the_thread->Wait.Block2n.first; new_first_thread = (Thread_Control *) new_first_node; last_node = the_thread->Wait.Block2n.last; 800f0a0: 29 66 00 40 lw r6,(r11+64) new_second_node = new_first_node->next; 800f0a4: 28 27 00 00 lw r7,(r1+0) previous_node->next = new_first_node; next_node->previous = new_first_node; 800f0a8: 58 81 00 04 sw (r4+4),r1 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; 800f0ac: 58 a1 00 00 sw (r5+0),r1 next_node->previous = new_first_node; new_first_node->next = next_node; 800f0b0: 58 24 00 00 sw (r1+0),r4 new_first_node->previous = previous_node; 800f0b4: 58 25 00 04 sw (r1+4),r5 if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 800f0b8: 44 26 00 0a be r1,r6,800f0e0 <_Thread_queue_Extract_priority_helper+0x98> /* > two threads on 2-n */ new_second_node->previous = _Chain_Head( &new_first_thread->Wait.Block2n ); 800f0bc: 34 24 00 38 addi r4,r1,56 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 = 800f0c0: 58 e4 00 04 sw (r7+4),r4 _Chain_Head( &new_first_thread->Wait.Block2n ); new_first_thread->Wait.Block2n.first = new_second_node; 800f0c4: 58 27 00 38 sw (r1+56),r7 new_first_thread->Wait.Block2n.last = last_node; 800f0c8: 58 26 00 40 sw (r1+64),r6 800f0cc: 34 21 00 3c addi r1,r1,60 last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); 800f0d0: 58 c1 00 00 sw (r6+0),r1 800f0d4: e0 00 00 03 bi 800f0e0 <_Thread_queue_Extract_priority_helper+0x98> } } else { previous_node->next = next_node; 800f0d8: 58 a4 00 00 sw (r5+0),r4 next_node->previous = previous_node; 800f0dc: 58 85 00 04 sw (r4+4),r5 /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { 800f0e0: 44 60 00 03 be r3,r0,800f0ec <_Thread_queue_Extract_priority_helper+0xa4> _ISR_Enable( level ); 800f0e4: d0 02 00 00 wcsr IE,r2 return; 800f0e8: e0 00 00 10 bi 800f128 <_Thread_queue_Extract_priority_helper+0xe0> } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 800f0ec: 29 63 00 50 lw r3,(r11+80) 800f0f0: 34 01 00 02 mvi r1,2 800f0f4: 44 61 00 03 be r3,r1,800f100 <_Thread_queue_Extract_priority_helper+0xb8><== NEVER TAKEN _ISR_Enable( level ); 800f0f8: d0 02 00 00 wcsr IE,r2 800f0fc: e0 00 00 06 bi 800f114 <_Thread_queue_Extract_priority_helper+0xcc> 800f100: 34 01 00 03 mvi r1,3 <== NOT EXECUTED 800f104: 59 61 00 50 sw (r11+80),r1 <== NOT EXECUTED } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 800f108: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 800f10c: 35 61 00 48 addi r1,r11,72 <== NOT EXECUTED 800f110: fb ff e2 79 calli 8007af4 <_Watchdog_Remove> <== NOT EXECUTED 800f114: 78 03 08 01 mvhi r3,0x801 800f118: 38 63 81 44 ori r3,r3,0x8144 800f11c: 28 62 00 00 lw r2,(r3+0) 800f120: b9 60 08 00 mv r1,r11 800f124: fb ff ff 17 calli 800ed80 <_Thread_Clear_state> #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 800f128: 2b 9d 00 04 lw ra,(sp+4) 800f12c: 2b 8b 00 08 lw r11,(sp+8) 800f130: 37 9c 00 08 addi sp,sp,8 800f134: c3 a0 00 00 ret =============================================================================== 0800f178 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 800f178: 37 9c ff fc addi sp,sp,-4 800f17c: 5b 9d 00 04 sw (sp+4),ra 800f180: b8 20 10 00 mv r2,r1 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 800f184: 28 21 00 44 lw r1,(r1+68) * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && 800f188: 28 24 00 30 lw r4,(r1+48) 800f18c: 44 80 00 0c be r4,r0,800f1bc <_Thread_queue_Process_timeout+0x44> RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 800f190: 78 03 08 01 mvhi r3,0x801 800f194: 38 63 9d fc ori r3,r3,0x9dfc 800f198: 28 63 00 0c lw r3,(r3+12) 800f19c: 5c 43 00 08 bne r2,r3,800f1bc <_Thread_queue_Process_timeout+0x44> _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 800f1a0: 34 03 00 03 mvi r3,3 800f1a4: 44 83 00 09 be r4,r3,800f1c8 <_Thread_queue_Process_timeout+0x50><== ALWAYS TAKEN the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800f1a8: 28 23 00 3c lw r3,(r1+60) <== NOT EXECUTED 800f1ac: 58 43 00 34 sw (r2+52),r3 <== NOT EXECUTED the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800f1b0: 34 02 00 02 mvi r2,2 <== NOT EXECUTED 800f1b4: 58 22 00 30 sw (r1+48),r2 <== NOT EXECUTED 800f1b8: e0 00 00 04 bi 800f1c8 <_Thread_queue_Process_timeout+0x50><== NOT EXECUTED } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800f1bc: 28 23 00 3c lw r3,(r1+60) 800f1c0: 58 43 00 34 sw (r2+52),r3 _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 800f1c4: f8 00 08 3d calli 80112b8 <_Thread_queue_Extract> } } 800f1c8: 2b 9d 00 04 lw ra,(sp+4) 800f1cc: 37 9c 00 04 addi sp,sp,4 800f1d0: c3 a0 00 00 ret =============================================================================== 08006fd4 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 8006fd4: 37 9c ff ec addi sp,sp,-20 8006fd8: 5b 8b 00 10 sw (sp+16),r11 8006fdc: 5b 8c 00 0c sw (sp+12),r12 8006fe0: 5b 8d 00 08 sw (sp+8),r13 8006fe4: 5b 9d 00 04 sw (sp+4),ra 8006fe8: b8 20 58 00 mv r11,r1 8006fec: b8 40 60 00 mv r12,r2 /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 8006ff0: 44 20 00 19 be r1,r0,8007054 <_Thread_queue_Requeue+0x80> <== NEVER TAKEN /* * If queueing by FIFO, there is nothing to do. This only applies to * priority blocking discipline. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 8006ff4: 28 22 00 34 lw r2,(r1+52) 8006ff8: 34 01 00 01 mvi r1,1 8006ffc: 5c 41 00 16 bne r2,r1,8007054 <_Thread_queue_Requeue+0x80> <== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 8007000: 90 00 68 00 rcsr r13,IE 8007004: 34 01 ff fe mvi r1,-2 8007008: a1 a1 08 00 and r1,r13,r1 800700c: d0 01 00 00 wcsr IE,r1 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 8007010: 78 03 08 01 mvhi r3,0x801 8007014: 38 63 81 3c ori r3,r3,0x813c 8007018: 29 82 00 10 lw r2,(r12+16) 800701c: 28 61 00 00 lw r1,(r3+0) 8007020: a0 41 08 00 and r1,r2,r1 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 8007024: 44 20 00 0b be r1,r0,8007050 <_Thread_queue_Requeue+0x7c> <== NEVER TAKEN 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; 8007028: 34 01 00 01 mvi r1,1 800702c: 59 61 00 30 sw (r11+48),r1 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 8007030: b9 80 10 00 mv r2,r12 8007034: b9 60 08 00 mv r1,r11 8007038: 34 03 00 01 mvi r3,1 800703c: f8 00 20 03 calli 800f048 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 8007040: b9 60 08 00 mv r1,r11 8007044: b9 80 10 00 mv r2,r12 8007048: 37 83 00 14 addi r3,sp,20 800704c: fb ff ff 02 calli 8006c54 <_Thread_queue_Enqueue_priority> } _ISR_Enable( level ); 8007050: d0 0d 00 00 wcsr IE,r13 } } 8007054: 2b 9d 00 04 lw ra,(sp+4) 8007058: 2b 8b 00 10 lw r11,(sp+16) 800705c: 2b 8c 00 0c lw r12,(sp+12) 8007060: 2b 8d 00 08 lw r13,(sp+8) 8007064: 37 9c 00 14 addi sp,sp,20 8007068: c3 a0 00 00 ret =============================================================================== 0800706c <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 800706c: 37 9c ff f8 addi sp,sp,-8 8007070: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 8007074: 37 82 00 08 addi r2,sp,8 8007078: fb ff fd 58 calli 80065d8 <_Thread_Get> switch ( location ) { 800707c: 2b 82 00 08 lw r2,(sp+8) 8007080: 5c 40 00 07 bne r2,r0,800709c <_Thread_queue_Timeout+0x30> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 8007084: f8 00 20 3d calli 800f178 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 8007088: 78 01 08 01 mvhi r1,0x801 800708c: 38 21 99 24 ori r1,r1,0x9924 8007090: 28 22 00 00 lw r2,(r1+0) 8007094: 34 42 ff ff addi r2,r2,-1 8007098: 58 22 00 00 sw (r1+0),r2 _Thread_Unnest_dispatch(); break; } } 800709c: 2b 9d 00 04 lw ra,(sp+4) 80070a0: 37 9c 00 08 addi sp,sp,8 80070a4: c3 a0 00 00 ret =============================================================================== 08014814 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 8014814: 37 9c ff a4 addi sp,sp,-92 8014818: 5b 8b 00 44 sw (sp+68),r11 801481c: 5b 8c 00 40 sw (sp+64),r12 8014820: 5b 8d 00 3c sw (sp+60),r13 8014824: 5b 8e 00 38 sw (sp+56),r14 8014828: 5b 8f 00 34 sw (sp+52),r15 801482c: 5b 90 00 30 sw (sp+48),r16 8014830: 5b 91 00 2c sw (sp+44),r17 8014834: 5b 92 00 28 sw (sp+40),r18 8014838: 5b 93 00 24 sw (sp+36),r19 801483c: 5b 94 00 20 sw (sp+32),r20 8014840: 5b 95 00 1c sw (sp+28),r21 8014844: 5b 96 00 18 sw (sp+24),r22 8014848: 5b 97 00 14 sw (sp+20),r23 801484c: 5b 98 00 10 sw (sp+16),r24 8014850: 5b 99 00 0c sw (sp+12),r25 8014854: 5b 9b 00 08 sw (sp+8),fp 8014858: 5b 9d 00 04 sw (sp+4),ra static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 801485c: 78 10 08 04 mvhi r16,0x804 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 8014860: b8 20 58 00 mv r11,r1 8014864: 37 8f 00 48 addi r15,sp,72 8014868: 37 81 00 54 addi r1,sp,84 801486c: 37 95 00 58 addi r21,sp,88 8014870: 37 91 00 4c addi r17,sp,76 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8014874: 78 0e 08 04 mvhi r14,0x804 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8014878: 5b 95 00 54 sw (sp+84),r21 the_chain->permanent_null = NULL; 801487c: 5b 80 00 58 sw (sp+88),r0 the_chain->last = _Chain_Head(the_chain); 8014880: 5b 81 00 5c sw (sp+92),r1 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8014884: 5b 91 00 48 sw (sp+72),r17 the_chain->permanent_null = NULL; 8014888: 5b 80 00 4c sw (sp+76),r0 the_chain->last = _Chain_Head(the_chain); 801488c: 5b 8f 00 50 sw (sp+80),r15 { /* * 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; 8014890: b8 20 d8 00 mv fp,r1 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 8014894: 3a 10 0d dc ori r16,r16,0xddc */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8014898: 35 74 00 30 addi r20,r11,48 _Chain_Initialize_empty( &insert_chain ); _Chain_Initialize_empty( &fire_chain ); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); 801489c: b9 e0 98 00 mv r19,r15 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 80148a0: 39 ce 0d 2c ori r14,r14,0xd2c /* * 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 ); 80148a4: 35 6d 00 68 addi r13,r11,104 Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 80148a8: 34 19 00 03 mvi r25,3 * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 80148ac: 34 12 ff fe mvi r18,-2 _Thread_Set_state( ts->thread, STATES_DELAYING ); _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 80148b0: 34 18 00 01 mvi r24,1 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 80148b4: 35 77 00 08 addi r23,r11,8 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 80148b8: 35 76 00 40 addi r22,r11,64 { /* * 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; 80148bc: 59 7b 00 78 sw (r11+120),fp static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 80148c0: 2a 02 00 00 lw r2,(r16+0) /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 80148c4: 29 63 00 3c lw r3,(r11+60) watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 80148c8: ba 80 08 00 mv r1,r20 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 80148cc: 59 62 00 3c sw (r11+60),r2 _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 80148d0: c8 43 10 00 sub r2,r2,r3 80148d4: ba 60 18 00 mv r3,r19 80148d8: f8 00 15 cf calli 801a014 <_Watchdog_Adjust_to_chain> Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 80148dc: 29 64 00 74 lw r4,(r11+116) static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 80148e0: 29 cc 00 00 lw r12,(r14+0) /* * 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 ) { 80148e4: 50 8c 00 06 bgeu r4,r12,80148fc <_Timer_server_Body+0xe8> /* * 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 ); 80148e8: b9 a0 08 00 mv r1,r13 80148ec: c9 84 10 00 sub r2,r12,r4 80148f0: ba 60 18 00 mv r3,r19 80148f4: f8 00 15 c8 calli 801a014 <_Watchdog_Adjust_to_chain> 80148f8: e0 00 00 06 bi 8014910 <_Timer_server_Body+0xfc> } else if ( snapshot < last_snapshot ) { 80148fc: 51 84 00 05 bgeu r12,r4,8014910 <_Timer_server_Body+0xfc> /* * 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 ); 8014900: b9 a0 08 00 mv r1,r13 8014904: 34 02 00 01 mvi r2,1 8014908: c8 8c 18 00 sub r3,r4,r12 801490c: f8 00 15 8b calli 8019f38 <_Watchdog_Adjust> } watchdogs->last_snapshot = snapshot; 8014910: 59 6c 00 74 sw (r11+116),r12 static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8014914: 34 0c 00 01 mvi r12,1 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 8014918: 29 62 00 78 lw r2,(r11+120) 801491c: b8 40 08 00 mv r1,r2 8014920: f8 00 03 80 calli 8015720 <_Chain_Get> 8014924: b8 20 10 00 mv r2,r1 if ( timer == NULL ) { 8014928: 44 20 00 09 be r1,r0,801494c <_Timer_server_Body+0x138> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 801492c: 28 23 00 38 lw r3,(r1+56) _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 8014930: ba 80 08 00 mv r1,r20 static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8014934: 44 6c 00 03 be r3,r12,8014940 <_Timer_server_Body+0x12c> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 8014938: 5c 79 ff f8 bne r3,r25,8014918 <_Timer_server_Body+0x104> <== NEVER TAKEN _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 801493c: b9 a0 08 00 mv r1,r13 8014940: 34 42 00 10 addi r2,r2,16 8014944: f8 00 15 d9 calli 801a0a8 <_Watchdog_Insert> 8014948: e3 ff ff f4 bi 8014918 <_Timer_server_Body+0x104> * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 801494c: 90 00 10 00 rcsr r2,IE 8014950: a0 52 08 00 and r1,r2,r18 8014954: d0 01 00 00 wcsr IE,r1 if ( _Chain_Is_empty( insert_chain ) ) { 8014958: 2b 81 00 54 lw r1,(sp+84) 801495c: 5c 35 00 06 bne r1,r21,8014974 <_Timer_server_Body+0x160> <== NEVER TAKEN ts->insert_chain = NULL; 8014960: 59 60 00 78 sw (r11+120),r0 _ISR_Enable( level ); 8014964: d0 02 00 00 wcsr IE,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 ) ) { 8014968: 2b 81 00 48 lw r1,(sp+72) 801496c: 5c 31 00 04 bne r1,r17,801497c <_Timer_server_Body+0x168> 8014970: e0 00 00 15 bi 80149c4 <_Timer_server_Body+0x1b0> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 8014974: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED 8014978: e3 ff ff d2 bi 80148c0 <_Timer_server_Body+0xac> <== NOT EXECUTED /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 801497c: 90 00 20 00 rcsr r4,IE 8014980: a0 92 08 00 and r1,r4,r18 8014984: d0 01 00 00 wcsr IE,r1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8014988: 2b 82 00 48 lw r2,(sp+72) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 801498c: 44 51 00 0c be r2,r17,80149bc <_Timer_server_Body+0x1a8> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 8014990: 28 41 00 00 lw r1,(r2+0) the_chain->first = new_first; 8014994: 5b 81 00 48 sw (sp+72),r1 new_first->previous = _Chain_Head(the_chain); 8014998: 58 2f 00 04 sw (r1+4),r15 watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 801499c: 44 40 00 08 be r2,r0,80149bc <_Timer_server_Body+0x1a8> <== NEVER TAKEN watchdog->state = WATCHDOG_INACTIVE; 80149a0: 58 40 00 08 sw (r2+8),r0 _ISR_Enable( level ); 80149a4: d0 04 00 00 wcsr IE,r4 /* * 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 ); 80149a8: 28 43 00 1c lw r3,(r2+28) 80149ac: 28 41 00 20 lw r1,(r2+32) 80149b0: 28 42 00 24 lw r2,(r2+36) 80149b4: d8 60 00 00 call r3 } 80149b8: e3 ff ff f1 bi 801497c <_Timer_server_Body+0x168> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 80149bc: d0 04 00 00 wcsr IE,r4 80149c0: e3 ff ff bf bi 80148bc <_Timer_server_Body+0xa8> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 80149c4: 31 60 00 7c sb (r11+124),r0 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); 80149c8: fb ff ff 53 calli 8014714 <_Thread_Disable_dispatch> _Thread_Set_state( ts->thread, STATES_DELAYING ); 80149cc: 29 61 00 00 lw r1,(r11+0) 80149d0: 34 02 00 08 mvi r2,8 80149d4: f8 00 12 3f calli 80192d0 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 80149d8: b9 60 08 00 mv r1,r11 80149dc: fb ff ff 54 calli 801472c <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 80149e0: b9 60 08 00 mv r1,r11 80149e4: fb ff ff 6f calli 80147a0 <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 80149e8: f8 00 0e e3 calli 8018574 <_Thread_Enable_dispatch> static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 80149ec: ba e0 08 00 mv r1,r23 _Thread_Set_state( ts->thread, STATES_DELAYING ); _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 80149f0: 31 78 00 7c sb (r11+124),r24 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 80149f4: f8 00 16 0a calli 801a21c <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 80149f8: ba c0 08 00 mv r1,r22 80149fc: f8 00 16 08 calli 801a21c <_Watchdog_Remove> 8014a00: e3 ff ff af bi 80148bc <_Timer_server_Body+0xa8> =============================================================================== 08014a04 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 8014a04: 37 9c ff f4 addi sp,sp,-12 8014a08: 5b 8b 00 0c sw (sp+12),r11 8014a0c: 5b 8c 00 08 sw (sp+8),r12 8014a10: 5b 9d 00 04 sw (sp+4),ra 8014a14: b8 20 58 00 mv r11,r1 if ( ts->insert_chain == NULL ) { 8014a18: 28 21 00 78 lw r1,(r1+120) static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 8014a1c: b8 40 60 00 mv r12,r2 if ( ts->insert_chain == NULL ) { 8014a20: 5c 20 00 43 bne r1,r0,8014b2c <_Timer_server_Schedule_operation_method+0x128> * is the reference point for the delta chain. Thus if we do not update the * reference point we have to add DT to the initial delta of the watchdog * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); 8014a24: fb ff ff 3c calli 8014714 <_Thread_Disable_dispatch> if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8014a28: 29 81 00 38 lw r1,(r12+56) 8014a2c: 34 02 00 01 mvi r2,1 8014a30: 5c 22 00 1d bne r1,r2,8014aa4 <_Timer_server_Schedule_operation_method+0xa0> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 8014a34: 90 00 10 00 rcsr r2,IE 8014a38: 34 01 ff fe mvi r1,-2 8014a3c: a0 41 08 00 and r1,r2,r1 8014a40: d0 01 00 00 wcsr IE,r1 snapshot = _Watchdog_Ticks_since_boot; 8014a44: 78 01 08 04 mvhi r1,0x804 8014a48: 38 21 0d dc ori r1,r1,0xddc 8014a4c: 28 23 00 00 lw r3,(r1+0) */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8014a50: 29 61 00 30 lw r1,(r11+48) last_snapshot = ts->Interval_watchdogs.last_snapshot; 8014a54: 29 65 00 3c lw r5,(r11+60) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8014a58: 35 64 00 34 addi r4,r11,52 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 8014a5c: 44 24 00 07 be r1,r4,8014a78 <_Timer_server_Schedule_operation_method+0x74> /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 8014a60: 28 26 00 10 lw r6,(r1+16) first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 8014a64: c8 65 28 00 sub r5,r3,r5 delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 8014a68: 34 04 00 00 mvi r4,0 * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { 8014a6c: 50 a6 00 02 bgeu r5,r6,8014a74 <_Timer_server_Schedule_operation_method+0x70> delta_interval -= delta; 8014a70: c8 c5 20 00 sub r4,r6,r5 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 8014a74: 58 24 00 10 sw (r1+16),r4 } ts->Interval_watchdogs.last_snapshot = snapshot; 8014a78: 59 63 00 3c sw (r11+60),r3 _ISR_Enable( level ); 8014a7c: d0 02 00 00 wcsr IE,r2 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 8014a80: 35 61 00 30 addi r1,r11,48 8014a84: 35 82 00 10 addi r2,r12,16 8014a88: f8 00 15 88 calli 801a0a8 <_Watchdog_Insert> if ( !ts->active ) { 8014a8c: 41 61 00 7c lbu r1,(r11+124) 8014a90: 20 21 00 ff andi r1,r1,0xff 8014a94: 5c 20 00 24 bne r1,r0,8014b24 <_Timer_server_Schedule_operation_method+0x120> _Timer_server_Reset_interval_system_watchdog( ts ); 8014a98: b9 60 08 00 mv r1,r11 8014a9c: fb ff ff 24 calli 801472c <_Timer_server_Reset_interval_system_watchdog> 8014aa0: e0 00 00 21 bi 8014b24 <_Timer_server_Schedule_operation_method+0x120> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 8014aa4: 34 02 00 03 mvi r2,3 8014aa8: 5c 22 00 1f bne r1,r2,8014b24 <_Timer_server_Schedule_operation_method+0x120> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 8014aac: 90 00 30 00 rcsr r6,IE 8014ab0: 34 01 ff fe mvi r1,-2 8014ab4: a0 c1 08 00 and r1,r6,r1 8014ab8: d0 01 00 00 wcsr IE,r1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8014abc: 29 62 00 68 lw r2,(r11+104) snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8014ac0: 78 01 08 04 mvhi r1,0x804 last_snapshot = ts->TOD_watchdogs.last_snapshot; 8014ac4: 29 65 00 74 lw r5,(r11+116) /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8014ac8: 38 21 0d 2c ori r1,r1,0xd2c */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8014acc: 35 63 00 6c addi r3,r11,108 8014ad0: 28 21 00 00 lw r1,(r1+0) last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 8014ad4: 44 43 00 0a be r2,r3,8014afc <_Timer_server_Schedule_operation_method+0xf8> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 8014ad8: 28 44 00 10 lw r4,(r2+16) } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 8014adc: b4 85 18 00 add r3,r4,r5 delta_interval += delta; 8014ae0: c8 61 18 00 sub r3,r3,r1 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; if ( snapshot > last_snapshot ) { 8014ae4: 50 a1 00 05 bgeu r5,r1,8014af8 <_Timer_server_Schedule_operation_method+0xf4> /* * We advanced in time. */ delta = snapshot - last_snapshot; 8014ae8: c8 25 28 00 sub r5,r1,r5 if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 8014aec: 34 03 00 00 mvi r3,0 if ( snapshot > last_snapshot ) { /* * We advanced in time. */ delta = snapshot - last_snapshot; if (delta_interval > delta) { 8014af0: 50 a4 00 02 bgeu r5,r4,8014af8 <_Timer_server_Schedule_operation_method+0xf4><== NEVER TAKEN delta_interval -= delta; 8014af4: c8 85 18 00 sub r3,r4,r5 * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 8014af8: 58 43 00 10 sw (r2+16),r3 } ts->TOD_watchdogs.last_snapshot = snapshot; 8014afc: 59 61 00 74 sw (r11+116),r1 _ISR_Enable( level ); 8014b00: d0 06 00 00 wcsr IE,r6 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 8014b04: 35 61 00 68 addi r1,r11,104 8014b08: 35 82 00 10 addi r2,r12,16 8014b0c: f8 00 15 67 calli 801a0a8 <_Watchdog_Insert> if ( !ts->active ) { 8014b10: 41 61 00 7c lbu r1,(r11+124) 8014b14: 20 21 00 ff andi r1,r1,0xff 8014b18: 5c 20 00 03 bne r1,r0,8014b24 <_Timer_server_Schedule_operation_method+0x120> _Timer_server_Reset_tod_system_watchdog( ts ); 8014b1c: b9 60 08 00 mv r1,r11 8014b20: fb ff ff 20 calli 80147a0 <_Timer_server_Reset_tod_system_watchdog> } } _Thread_Enable_dispatch(); 8014b24: f8 00 0e 94 calli 8018574 <_Thread_Enable_dispatch> 8014b28: e0 00 00 03 bi 8014b34 <_Timer_server_Schedule_operation_method+0x130> * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 8014b2c: 29 61 00 78 lw r1,(r11+120) 8014b30: f8 00 02 e6 calli 80156c8 <_Chain_Append> } } 8014b34: 2b 9d 00 04 lw ra,(sp+4) 8014b38: 2b 8b 00 0c lw r11,(sp+12) 8014b3c: 2b 8c 00 08 lw r12,(sp+8) 8014b40: 37 9c 00 0c addi sp,sp,12 8014b44: c3 a0 00 00 ret =============================================================================== 080075e0 <_User_extensions_Handler_initialization>: #include #include #include void _User_extensions_Handler_initialization(void) { 80075e0: 37 9c ff ec addi sp,sp,-20 80075e4: 5b 8b 00 14 sw (sp+20),r11 80075e8: 5b 8c 00 10 sw (sp+16),r12 80075ec: 5b 8d 00 0c sw (sp+12),r13 80075f0: 5b 8e 00 08 sw (sp+8),r14 80075f4: 5b 9d 00 04 sw (sp+4),ra User_extensions_Control *extension; uint32_t i; uint32_t number_of_extensions; User_extensions_Table *initial_extensions; number_of_extensions = Configuration.number_of_initial_extensions; 80075f8: 78 02 08 01 mvhi r2,0x801 80075fc: 38 42 90 ac ori r2,r2,0x90ac 8007600: 28 4e 00 38 lw r14,(r2+56) initial_extensions = Configuration.User_extension_table; 8007604: 28 4b 00 3c lw r11,(r2+60) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8007608: 78 03 08 01 mvhi r3,0x801 800760c: 78 02 08 01 mvhi r2,0x801 8007610: 38 42 9a ac ori r2,r2,0x9aac 8007614: 38 63 9a b0 ori r3,r3,0x9ab0 8007618: 58 43 00 00 sw (r2+0),r3 the_chain->permanent_null = NULL; 800761c: 58 40 00 04 sw (r2+4),r0 the_chain->last = _Chain_Head(the_chain); 8007620: 58 42 00 08 sw (r2+8),r2 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8007624: 78 03 08 01 mvhi r3,0x801 8007628: 78 02 08 01 mvhi r2,0x801 800762c: 38 42 99 28 ori r2,r2,0x9928 8007630: 38 63 99 2c ori r3,r3,0x992c 8007634: 58 43 00 00 sw (r2+0),r3 the_chain->permanent_null = NULL; 8007638: 58 40 00 04 sw (r2+4),r0 the_chain->last = _Chain_Head(the_chain); 800763c: 58 42 00 08 sw (r2+8),r2 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { 8007640: 45 60 00 22 be r11,r0,80076c8 <_User_extensions_Handler_initialization+0xe8><== NEVER TAKEN extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) 8007644: 34 02 00 34 mvi r2,52 8007648: b9 c0 08 00 mv r1,r14 800764c: f8 00 3e 96 calli 80170a4 <__mulsi3> 8007650: b8 20 68 00 mv r13,r1 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( 8007654: f8 00 01 82 calli 8007c5c <_Workspace_Allocate_or_fatal_error> number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 8007658: b9 a0 18 00 mv r3,r13 800765c: 34 02 00 00 mvi r2,0 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( 8007660: b8 20 60 00 mv r12,r1 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 8007664: 34 0d 00 00 mvi r13,0 extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 8007668: f8 00 2a 9b calli 80120d4 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 800766c: e0 00 00 16 bi 80076c4 <_User_extensions_Handler_initialization+0xe4> RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 8007670: 29 61 00 1c lw r1,(r11+28) 8007674: 29 68 00 00 lw r8,(r11+0) 8007678: 29 67 00 04 lw r7,(r11+4) 800767c: 29 66 00 08 lw r6,(r11+8) 8007680: 29 65 00 0c lw r5,(r11+12) 8007684: 29 64 00 10 lw r4,(r11+16) 8007688: 29 63 00 14 lw r3,(r11+20) 800768c: 29 62 00 18 lw r2,(r11+24) 8007690: 59 81 00 30 sw (r12+48),r1 8007694: 59 88 00 14 sw (r12+20),r8 8007698: 59 87 00 18 sw (r12+24),r7 800769c: 59 86 00 1c sw (r12+28),r6 80076a0: 59 85 00 20 sw (r12+32),r5 80076a4: 59 84 00 24 sw (r12+36),r4 80076a8: 59 83 00 28 sw (r12+40),r3 80076ac: 59 82 00 2c sw (r12+44),r2 _User_extensions_Add_set( extension ); 80076b0: b9 80 08 00 mv r1,r12 80076b4: f8 00 1f 4a calli 800f3dc <_User_extensions_Add_set> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; 80076b8: 35 8c 00 34 addi r12,r12,52 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 80076bc: 35 ad 00 01 addi r13,r13,1 80076c0: 35 6b 00 20 addi r11,r11,32 80076c4: 55 cd ff eb bgu r14,r13,8007670 <_User_extensions_Handler_initialization+0x90> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; } } } 80076c8: 2b 9d 00 04 lw ra,(sp+4) 80076cc: 2b 8b 00 14 lw r11,(sp+20) 80076d0: 2b 8c 00 10 lw r12,(sp+16) 80076d4: 2b 8d 00 0c lw r13,(sp+12) 80076d8: 2b 8e 00 08 lw r14,(sp+8) 80076dc: 37 9c 00 14 addi sp,sp,20 80076e0: c3 a0 00 00 ret =============================================================================== 08008a20 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 8008a20: 37 9c ff e4 addi sp,sp,-28 8008a24: 5b 8b 00 1c sw (sp+28),r11 8008a28: 5b 8c 00 18 sw (sp+24),r12 8008a2c: 5b 8d 00 14 sw (sp+20),r13 8008a30: 5b 8e 00 10 sw (sp+16),r14 8008a34: 5b 8f 00 0c sw (sp+12),r15 8008a38: 5b 90 00 08 sw (sp+8),r16 8008a3c: 5b 9d 00 04 sw (sp+4),ra 8008a40: b8 20 60 00 mv r12,r1 8008a44: b8 60 58 00 mv r11,r3 ISR_Level level; _ISR_Disable( level ); 8008a48: 90 00 08 00 rcsr r1,IE 8008a4c: 34 03 ff fe mvi r3,-2 8008a50: a0 23 18 00 and r3,r1,r3 8008a54: d0 03 00 00 wcsr IE,r3 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8008a58: 29 83 00 00 lw r3,(r12+0) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8008a5c: 35 8e 00 04 addi r14,r12,4 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 8008a60: 44 6e 00 1d be r3,r14,8008ad4 <_Watchdog_Adjust+0xb4> switch ( direction ) { 8008a64: 44 40 00 04 be r2,r0,8008a74 <_Watchdog_Adjust+0x54> 8008a68: 34 04 00 01 mvi r4,1 8008a6c: 5c 44 00 1a bne r2,r4,8008ad4 <_Watchdog_Adjust+0xb4> <== NEVER TAKEN 8008a70: e0 00 00 04 bi 8008a80 <_Watchdog_Adjust+0x60> if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 8008a74: 34 10 00 01 mvi r16,1 _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 8008a78: 34 0f ff fe mvi r15,-2 8008a7c: e0 00 00 15 bi 8008ad0 <_Watchdog_Adjust+0xb0> * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 8008a80: 28 62 00 10 lw r2,(r3+16) 8008a84: b4 4b 58 00 add r11,r2,r11 8008a88: 58 6b 00 10 sw (r3+16),r11 break; 8008a8c: e0 00 00 12 bi 8008ad4 <_Watchdog_Adjust+0xb4> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 8008a90: 29 82 00 00 lw r2,(r12+0) case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 8008a94: 28 4d 00 10 lw r13,(r2+16) 8008a98: 51 6d 00 04 bgeu r11,r13,8008aa8 <_Watchdog_Adjust+0x88> _Watchdog_First( header )->delta_interval -= units; 8008a9c: c9 ab 58 00 sub r11,r13,r11 8008aa0: 58 4b 00 10 sw (r2+16),r11 break; 8008aa4: e0 00 00 0c bi 8008ad4 <_Watchdog_Adjust+0xb4> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 8008aa8: 58 50 00 10 sw (r2+16),r16 _ISR_Enable( level ); 8008aac: d0 01 00 00 wcsr IE,r1 _Watchdog_Tickle( header ); 8008ab0: b9 80 08 00 mv r1,r12 8008ab4: f8 00 00 98 calli 8008d14 <_Watchdog_Tickle> _ISR_Disable( level ); 8008ab8: 90 00 08 00 rcsr r1,IE 8008abc: a0 2f 10 00 and r2,r1,r15 8008ac0: d0 02 00 00 wcsr IE,r2 if ( _Chain_Is_empty( header ) ) 8008ac4: 29 82 00 00 lw r2,(r12+0) 8008ac8: 44 4e 00 03 be r2,r14,8008ad4 <_Watchdog_Adjust+0xb4> while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 8008acc: c9 6d 58 00 sub r11,r11,r13 switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 8008ad0: 5d 60 ff f0 bne r11,r0,8008a90 <_Watchdog_Adjust+0x70> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 8008ad4: d0 01 00 00 wcsr IE,r1 } 8008ad8: 2b 9d 00 04 lw ra,(sp+4) 8008adc: 2b 8b 00 1c lw r11,(sp+28) 8008ae0: 2b 8c 00 18 lw r12,(sp+24) 8008ae4: 2b 8d 00 14 lw r13,(sp+20) 8008ae8: 2b 8e 00 10 lw r14,(sp+16) 8008aec: 2b 8f 00 0c lw r15,(sp+12) 8008af0: 2b 90 00 08 lw r16,(sp+8) 8008af4: 37 9c 00 1c addi sp,sp,28 8008af8: c3 a0 00 00 ret =============================================================================== 08007af4 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 8007af4: 90 00 28 00 rcsr r5,IE 8007af8: 34 02 ff fe mvi r2,-2 8007afc: a0 a2 10 00 and r2,r5,r2 8007b00: d0 02 00 00 wcsr IE,r2 previous_state = the_watchdog->state; 8007b04: 28 23 00 08 lw r3,(r1+8) switch ( previous_state ) { 8007b08: 34 02 00 01 mvi r2,1 8007b0c: 44 62 00 05 be r3,r2,8007b20 <_Watchdog_Remove+0x2c> 8007b10: 44 60 00 1b be r3,r0,8007b7c <_Watchdog_Remove+0x88> 8007b14: 34 02 00 03 mvi r2,3 8007b18: 54 62 00 19 bgu r3,r2,8007b7c <_Watchdog_Remove+0x88> <== NEVER TAKEN 8007b1c: e0 00 00 03 bi 8007b28 <_Watchdog_Remove+0x34> /* * It is not actually on the chain so just change the state and * the Insert operation we interrupted will be aborted. */ the_watchdog->state = WATCHDOG_INACTIVE; 8007b20: 58 20 00 08 sw (r1+8),r0 break; 8007b24: e0 00 00 16 bi 8007b7c <_Watchdog_Remove+0x88> } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 8007b28: 28 22 00 00 lw r2,(r1+0) break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 8007b2c: 58 20 00 08 sw (r1+8),r0 next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 8007b30: 28 44 00 00 lw r4,(r2+0) 8007b34: 44 80 00 05 be r4,r0,8007b48 <_Watchdog_Remove+0x54> next_watchdog->delta_interval += the_watchdog->delta_interval; 8007b38: 28 46 00 10 lw r6,(r2+16) 8007b3c: 28 24 00 10 lw r4,(r1+16) 8007b40: b4 c4 20 00 add r4,r6,r4 8007b44: 58 44 00 10 sw (r2+16),r4 if ( _Watchdog_Sync_count ) 8007b48: 78 04 08 01 mvhi r4,0x801 8007b4c: 38 84 9a 58 ori r4,r4,0x9a58 8007b50: 28 84 00 00 lw r4,(r4+0) 8007b54: 44 80 00 07 be r4,r0,8007b70 <_Watchdog_Remove+0x7c> _Watchdog_Sync_level = _ISR_Nest_level; 8007b58: 78 04 08 01 mvhi r4,0x801 8007b5c: 38 84 9d fc ori r4,r4,0x9dfc 8007b60: 28 86 00 08 lw r6,(r4+8) 8007b64: 78 04 08 01 mvhi r4,0x801 8007b68: 38 84 99 cc ori r4,r4,0x99cc 8007b6c: 58 86 00 00 sw (r4+0),r6 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 8007b70: 28 24 00 04 lw r4,(r1+4) next->previous = previous; 8007b74: 58 44 00 04 sw (r2+4),r4 previous->next = next; 8007b78: 58 82 00 00 sw (r4+0),r2 _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8007b7c: 78 02 08 01 mvhi r2,0x801 8007b80: 38 42 9a 5c ori r2,r2,0x9a5c 8007b84: 28 42 00 00 lw r2,(r2+0) 8007b88: 58 22 00 18 sw (r1+24),r2 _ISR_Enable( level ); 8007b8c: d0 05 00 00 wcsr IE,r5 return( previous_state ); } 8007b90: b8 60 08 00 mv r1,r3 8007b94: c3 a0 00 00 ret =============================================================================== 0800861c <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 800861c: 37 9c ff ec addi sp,sp,-20 8008620: 5b 8b 00 14 sw (sp+20),r11 8008624: 5b 8c 00 10 sw (sp+16),r12 8008628: 5b 8d 00 0c sw (sp+12),r13 800862c: 5b 8e 00 08 sw (sp+8),r14 8008630: 5b 9d 00 04 sw (sp+4),ra 8008634: b8 20 70 00 mv r14,r1 8008638: b8 40 60 00 mv r12,r2 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 800863c: 90 00 68 00 rcsr r13,IE 8008640: 34 01 ff fe mvi r1,-2 8008644: a1 a1 08 00 and r1,r13,r1 8008648: d0 01 00 00 wcsr IE,r1 printk( "Watchdog Chain: %s %p\n", name, header ); 800864c: 78 01 08 01 mvhi r1,0x801 8008650: b9 80 18 00 mv r3,r12 8008654: 38 21 ea 6c ori r1,r1,0xea6c 8008658: b9 c0 10 00 mv r2,r14 800865c: fb ff eb 7b calli 8003448 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8008660: 29 8b 00 00 lw r11,(r12+0) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8008664: 35 8c 00 04 addi r12,r12,4 if ( !_Chain_Is_empty( header ) ) { 8008668: 45 6c 00 0b be r11,r12,8008694 <_Watchdog_Report_chain+0x78> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 800866c: b9 60 10 00 mv r2,r11 8008670: 34 01 00 00 mvi r1,0 8008674: f8 00 00 13 calli 80086c0 <_Watchdog_Report> _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = header->first ; node != _Chain_Tail(header) ; node = node->next ) 8008678: 29 6b 00 00 lw r11,(r11+0) Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = header->first ; 800867c: 5d 6c ff fc bne r11,r12,800866c <_Watchdog_Report_chain+0x50><== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 8008680: 78 01 08 01 mvhi r1,0x801 8008684: 38 21 ea 84 ori r1,r1,0xea84 8008688: b9 c0 10 00 mv r2,r14 800868c: fb ff eb 6f calli 8003448 8008690: e0 00 00 04 bi 80086a0 <_Watchdog_Report_chain+0x84> } else { printk( "Chain is empty\n" ); 8008694: 78 01 08 01 mvhi r1,0x801 8008698: 38 21 ea 94 ori r1,r1,0xea94 800869c: fb ff eb 6b calli 8003448 } _ISR_Enable( level ); 80086a0: d0 0d 00 00 wcsr IE,r13 } 80086a4: 2b 9d 00 04 lw ra,(sp+4) 80086a8: 2b 8b 00 14 lw r11,(sp+20) 80086ac: 2b 8c 00 10 lw r12,(sp+16) 80086b0: 2b 8d 00 0c lw r13,(sp+12) 80086b4: 2b 8e 00 08 lw r14,(sp+8) 80086b8: 37 9c 00 14 addi sp,sp,20 80086bc: c3 a0 00 00 ret =============================================================================== 0800c630 <_Watchdog_Tickle>: */ void _Watchdog_Tickle( Chain_Control *header ) { 800c630: 37 9c ff e4 addi sp,sp,-28 800c634: 5b 8b 00 1c sw (sp+28),r11 800c638: 5b 8c 00 18 sw (sp+24),r12 800c63c: 5b 8d 00 14 sw (sp+20),r13 800c640: 5b 8e 00 10 sw (sp+16),r14 800c644: 5b 8f 00 0c sw (sp+12),r15 800c648: 5b 90 00 08 sw (sp+8),r16 800c64c: 5b 9d 00 04 sw (sp+4),ra 800c650: b8 20 60 00 mv r12,r1 * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 800c654: 90 00 18 00 rcsr r3,IE 800c658: 34 01 ff fe mvi r1,-2 800c65c: a0 61 08 00 and r1,r3,r1 800c660: d0 01 00 00 wcsr IE,r1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 800c664: 29 8b 00 00 lw r11,(r12+0) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 800c668: 35 8e 00 04 addi r14,r12,4 800c66c: b8 60 10 00 mv r2,r3 if ( _Chain_Is_empty( header ) ) 800c670: 45 6e 00 1a be r11,r14,800c6d8 <_Watchdog_Tickle+0xa8> * to be inserted has already had its delta_interval adjusted to 0, and * so is added to the head of the chain with a delta_interval of 0. * * Steven Johnson - 12/2005 (gcc-3.2.3 -O3 on powerpc) */ if (the_watchdog->delta_interval != 0) { 800c674: 29 61 00 10 lw r1,(r11+16) 800c678: 44 20 00 04 be r1,r0,800c688 <_Watchdog_Tickle+0x58> the_watchdog->delta_interval--; 800c67c: 34 21 ff ff addi r1,r1,-1 800c680: 59 61 00 10 sw (r11+16),r1 if ( the_watchdog->delta_interval != 0 ) 800c684: 5c 20 00 15 bne r1,r0,800c6d8 <_Watchdog_Tickle+0xa8> */ void _Watchdog_Tickle( Chain_Control *header ) { 800c688: b8 60 68 00 mv r13,r3 do { watchdog_state = _Watchdog_Remove( the_watchdog ); _ISR_Enable( level ); switch( watchdog_state ) { 800c68c: 34 10 00 02 mvi r16,2 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 800c690: 34 0f ff fe mvi r15,-2 800c694: e0 00 00 02 bi 800c69c <_Watchdog_Tickle+0x6c> 800c698: b8 40 68 00 mv r13,r2 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 800c69c: b9 60 08 00 mv r1,r11 800c6a0: fb ff ff bb calli 800c58c <_Watchdog_Remove> _ISR_Enable( level ); 800c6a4: d0 0d 00 00 wcsr IE,r13 switch( watchdog_state ) { 800c6a8: 5c 30 00 05 bne r1,r16,800c6bc <_Watchdog_Tickle+0x8c> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 800c6ac: 29 63 00 1c lw r3,(r11+28) 800c6b0: 29 61 00 20 lw r1,(r11+32) 800c6b4: 29 62 00 24 lw r2,(r11+36) 800c6b8: d8 60 00 00 call r3 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 800c6bc: 90 00 10 00 rcsr r2,IE 800c6c0: a0 4f 08 00 and r1,r2,r15 800c6c4: d0 01 00 00 wcsr IE,r1 } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 800c6c8: 29 8b 00 00 lw r11,(r12+0) _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 800c6cc: 45 6e 00 03 be r11,r14,800c6d8 <_Watchdog_Tickle+0xa8> } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 800c6d0: 29 61 00 10 lw r1,(r11+16) 800c6d4: 44 20 ff f1 be r1,r0,800c698 <_Watchdog_Tickle+0x68> (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 800c6d8: d0 02 00 00 wcsr IE,r2 } 800c6dc: 2b 9d 00 04 lw ra,(sp+4) 800c6e0: 2b 8b 00 1c lw r11,(sp+28) 800c6e4: 2b 8c 00 18 lw r12,(sp+24) 800c6e8: 2b 8d 00 14 lw r13,(sp+20) 800c6ec: 2b 8e 00 10 lw r14,(sp+16) 800c6f0: 2b 8f 00 0c lw r15,(sp+12) 800c6f4: 2b 90 00 08 lw r16,(sp+8) 800c6f8: 37 9c 00 1c addi sp,sp,28 800c6fc: c3 a0 00 00 ret =============================================================================== 08017658 <_exit>: extern void FINI_SYMBOL( void ); #endif void EXIT_SYMBOL(int status) { 8017658: 37 9c ff f8 addi sp,sp,-8 801765c: 5b 9d 00 04 sw (sp+4),ra /* * If the toolset uses init/fini sections, then we need to * run the global destructors now. */ #if defined(__USE_INIT_FINI__) FINI_SYMBOL(); 8017660: 5b 81 00 08 sw (sp+8),r1 8017664: f8 00 01 5f calli 8017be0 <__start_set_sysctl_set> * 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(); 8017668: fb ff ff d9 calli 80175cc rtems_shutdown_executive(status); 801766c: 2b 81 00 08 lw r1,(sp+8) 8017670: f8 00 00 57 calli 80177cc 8017674: e0 00 00 00 bi 8017674 <_exit+0x1c> <== NOT EXECUTED =============================================================================== 080053a4 <_rename_r>: int _rename_r( struct _reent *ptr __attribute__((unused)), const char *old, const char *new ) { 80053a4: 37 9c ff a0 addi sp,sp,-96 80053a8: 5b 8b 00 1c sw (sp+28),r11 80053ac: 5b 8c 00 18 sw (sp+24),r12 80053b0: 5b 8d 00 14 sw (sp+20),r13 80053b4: 5b 8e 00 10 sw (sp+16),r14 80053b8: 5b 8f 00 0c sw (sp+12),r15 80053bc: 5b 90 00 08 sw (sp+8),r16 80053c0: 5b 9d 00 04 sw (sp+4),ra /* * Get the parent node of the old path to be renamed. Find the parent path. */ old_parent_pathlen = rtems_filesystem_dirname ( old ); 80053c4: b8 40 08 00 mv r1,r2 int _rename_r( struct _reent *ptr __attribute__((unused)), const char *old, const char *new ) { 80053c8: b8 40 58 00 mv r11,r2 80053cc: b8 60 80 00 mv r16,r3 /* * Get the parent node of the old path to be renamed. Find the parent path. */ old_parent_pathlen = rtems_filesystem_dirname ( old ); 80053d0: fb ff fa 1b calli 8003c3c 80053d4: b8 20 70 00 mv r14,r1 80053d8: 37 84 00 34 addi r4,sp,52 if ( old_parent_pathlen == 0 ) 80053dc: 5c 20 00 07 bne r1,r0,80053f8 <_rename_r+0x54> rtems_filesystem_get_start_loc( old, &i, &old_parent_loc ); 80053e0: b9 60 08 00 mv r1,r11 80053e4: 37 82 00 60 addi r2,sp,96 80053e8: b8 80 18 00 mv r3,r4 80053ec: f8 00 00 fa calli 80057d4 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; 80053f0: 34 0d 00 00 mvi r13,0 80053f4: e0 00 00 09 bi 8005418 <_rename_r+0x74> 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, 80053f8: b9 60 08 00 mv r1,r11 80053fc: b9 c0 10 00 mv r2,r14 8005400: 34 03 00 02 mvi r3,2 8005404: 34 05 00 00 mvi r5,0 8005408: fb ff f9 e8 calli 8003ba8 RTEMS_LIBIO_PERMS_WRITE, &old_parent_loc, false ); if ( result != 0 ) return -1; 800540c: 34 0c ff ff mvi r12,-1 else { result = rtems_filesystem_evaluate_path( old, old_parent_pathlen, RTEMS_LIBIO_PERMS_WRITE, &old_parent_loc, false ); if ( result != 0 ) 8005410: 5c 20 00 59 bne r1,r0,8005574 <_rename_r+0x1d0> <== NEVER TAKEN return -1; free_old_parentloc = true; 8005414: 34 0d 00 01 mvi r13,1 /* * Start from the parent to find the node that should be under it. */ old_loc = old_parent_loc; 8005418: 2b 81 00 34 lw r1,(sp+52) name = old + old_parent_pathlen; 800541c: b5 6e 58 00 add r11,r11,r14 8005420: 5b 8b 00 5c sw (sp+92),r11 /* * Start from the parent to find the node that should be under it. */ old_loc = old_parent_loc; 8005424: 5b 81 00 48 sw (sp+72),r1 8005428: 2b 81 00 38 lw r1,(sp+56) name = old + old_parent_pathlen; name += rtems_filesystem_prefix_separators( name, strlen( name ) ); result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 800542c: 37 8c 00 48 addi r12,sp,72 /* * Start from the parent to find the node that should be under it. */ old_loc = old_parent_loc; 8005430: 5b 81 00 4c sw (sp+76),r1 8005434: 2b 81 00 3c lw r1,(sp+60) 8005438: 5b 81 00 50 sw (sp+80),r1 800543c: 2b 81 00 40 lw r1,(sp+64) 8005440: 5b 81 00 54 sw (sp+84),r1 8005444: 2b 81 00 44 lw r1,(sp+68) 8005448: 5b 81 00 58 sw (sp+88),r1 name = old + old_parent_pathlen; name += rtems_filesystem_prefix_separators( name, strlen( name ) ); 800544c: b9 60 08 00 mv r1,r11 8005450: f8 00 38 42 calli 8013558 8005454: b8 20 10 00 mv r2,r1 8005458: b9 60 08 00 mv r1,r11 800545c: fb ff fa 0c calli 8003c8c 8005460: b5 61 58 00 add r11,r11,r1 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 8005464: b9 60 08 00 mv r1,r11 * 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 ) ); 8005468: 5b 8b 00 5c sw (sp+92),r11 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 800546c: f8 00 38 3b calli 8013558 8005470: b8 20 10 00 mv r2,r1 8005474: 34 03 00 00 mvi r3,0 8005478: b9 60 08 00 mv r1,r11 800547c: b9 80 20 00 mv r4,r12 8005480: 34 05 00 00 mvi r5,0 8005484: fb ff f9 9d calli 8003af8 8005488: b8 20 78 00 mv r15,r1 0, &old_loc, false ); if ( result != 0 ) { 800548c: 44 20 00 05 be r1,r0,80054a0 <_rename_r+0xfc> if ( free_old_parentloc ) rtems_filesystem_freenode( &old_parent_loc ); return -1; 8005490: 34 0c ff ff mvi r12,-1 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 ); 8005494: 37 81 00 34 addi r1,sp,52 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 ) 8005498: 45 a0 00 37 be r13,r0,8005574 <_rename_r+0x1d0> <== NEVER TAKEN 800549c: e0 00 00 35 bi 8005570 <_rename_r+0x1cc> /* * Get the parent of the new node we are renaming to. */ rtems_filesystem_get_start_loc( new, &i, &new_parent_loc ); 80054a0: 37 8b 00 20 addi r11,sp,32 80054a4: ba 00 08 00 mv r1,r16 80054a8: 37 82 00 60 addi r2,sp,96 80054ac: b9 60 18 00 mv r3,r11 80054b0: f8 00 00 c9 calli 80057d4 result = (*new_parent_loc.ops->evalformake_h)( &new[i], &new_parent_loc, &name ); 80054b4: 2b 81 00 2c lw r1,(sp+44) 80054b8: b9 60 10 00 mv r2,r11 80054bc: 37 83 00 5c addi r3,sp,92 80054c0: 28 24 00 04 lw r4,(r1+4) 80054c4: 2b 81 00 60 lw r1,(sp+96) 80054c8: b6 01 08 00 add r1,r16,r1 80054cc: d8 80 00 00 call r4 80054d0: b8 20 70 00 mv r14,r1 if ( result != 0 ) { 80054d4: 44 2f 00 09 be r1,r15,80054f8 <_rename_r+0x154> rtems_filesystem_freenode( &new_parent_loc ); 80054d8: b9 60 08 00 mv r1,r11 80054dc: fb ff fa 05 calli 8003cf0 if ( free_old_parentloc ) 80054e0: 45 a0 00 03 be r13,r0,80054ec <_rename_r+0x148> <== NEVER TAKEN rtems_filesystem_freenode( &old_parent_loc ); 80054e4: 37 81 00 34 addi r1,sp,52 80054e8: fb ff fa 02 calli 8003cf0 rtems_filesystem_freenode( &old_loc ); 80054ec: 37 81 00 48 addi r1,sp,72 80054f0: fb ff fa 00 calli 8003cf0 80054f4: e0 00 00 0e bi 800552c <_rename_r+0x188> /* * 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 ) { 80054f8: 2b 81 00 30 lw r1,(sp+48) 80054fc: 2b 82 00 44 lw r2,(sp+68) 8005500: 44 41 00 0d be r2,r1,8005534 <_rename_r+0x190> rtems_filesystem_freenode( &new_parent_loc ); 8005504: b9 60 08 00 mv r1,r11 8005508: fb ff f9 fa calli 8003cf0 if ( free_old_parentloc ) 800550c: 45 ae 00 03 be r13,r14,8005518 <_rename_r+0x174> rtems_filesystem_freenode( &old_parent_loc ); 8005510: 37 81 00 34 addi r1,sp,52 8005514: fb ff f9 f7 calli 8003cf0 rtems_filesystem_freenode( &old_loc ); 8005518: 37 81 00 48 addi r1,sp,72 800551c: fb ff f9 f5 calli 8003cf0 rtems_set_errno_and_return_minus_one( EXDEV ); 8005520: f8 00 2a 52 calli 800fe68 <__errno> 8005524: 34 02 00 12 mvi r2,18 8005528: 58 22 00 00 sw (r1+0),r2 800552c: 34 0c ff ff mvi r12,-1 8005530: e0 00 00 11 bi 8005574 <_rename_r+0x1d0> } result = (*new_parent_loc.ops->rename_h)( &old_parent_loc, &old_loc, &new_parent_loc, name ); 8005534: 2b 81 00 2c lw r1,(sp+44) 8005538: 2b 84 00 5c lw r4,(sp+92) 800553c: 37 8f 00 34 addi r15,sp,52 8005540: 28 25 00 40 lw r5,(r1+64) 8005544: b9 80 10 00 mv r2,r12 8005548: b9 e0 08 00 mv r1,r15 800554c: b9 60 18 00 mv r3,r11 8005550: d8 a0 00 00 call r5 8005554: b8 20 60 00 mv r12,r1 rtems_filesystem_freenode( &new_parent_loc ); 8005558: b9 60 08 00 mv r1,r11 800555c: fb ff f9 e5 calli 8003cf0 if ( free_old_parentloc ) 8005560: 45 ae 00 03 be r13,r14,800556c <_rename_r+0x1c8> rtems_filesystem_freenode( &old_parent_loc ); 8005564: b9 e0 08 00 mv r1,r15 8005568: fb ff f9 e2 calli 8003cf0 rtems_filesystem_freenode( &old_loc ); 800556c: 37 81 00 48 addi r1,sp,72 8005570: fb ff f9 e0 calli 8003cf0 return result; } 8005574: b9 80 08 00 mv r1,r12 8005578: 2b 9d 00 04 lw ra,(sp+4) 800557c: 2b 8b 00 1c lw r11,(sp+28) 8005580: 2b 8c 00 18 lw r12,(sp+24) 8005584: 2b 8d 00 14 lw r13,(sp+20) 8005588: 2b 8e 00 10 lw r14,(sp+16) 800558c: 2b 8f 00 0c lw r15,(sp+12) 8005590: 2b 90 00 08 lw r16,(sp+8) 8005594: 37 9c 00 60 addi sp,sp,96 8005598: c3 a0 00 00 ret =============================================================================== 080028bc : #include speed_t cfgetispeed( const struct termios *tp ) { 80028bc: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 80028c0: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED return (tp->c_cflag / (CIBAUD / CBAUD)) & CBAUD; 80028c4: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED 80028c8: 34 02 00 10 mvi r2,16 <== NOT EXECUTED 80028cc: f8 00 6f 88 calli 801e6ec <__lshrsi3> <== NOT EXECUTED } 80028d0: 20 21 10 0f andi r1,r1,0x100f <== NOT EXECUTED 80028d4: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80028d8: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 80028dc: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080028e0 : speed_t cfgetospeed( const struct termios *tp ) { return tp->c_cflag & CBAUD; 80028e0: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED } 80028e4: 20 21 10 0f andi r1,r1,0x100f <== NOT EXECUTED 80028e8: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080028ec : int cfsetispeed( struct termios *tp, speed_t speed ) { 80028ec: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED 80028f0: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED 80028f4: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED 80028f8: b8 20 58 00 mv r11,r1 <== NOT EXECUTED 80028fc: b8 40 08 00 mv r1,r2 <== NOT EXECUTED if ( speed & ~CBAUD ) 8002900: 34 02 ef f0 mvi r2,-4112 <== NOT EXECUTED 8002904: a0 22 10 00 and r2,r1,r2 <== NOT EXECUTED 8002908: 44 40 00 06 be r2,r0,8002920 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 800290c: f8 00 38 96 calli 8010b64 <__errno> <== NOT EXECUTED 8002910: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8002914: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8002918: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800291c: e0 00 00 0b bi 8002948 <== NOT EXECUTED tp->c_cflag = (tp->c_cflag & ~CIBAUD) | (speed * (CIBAUD / CBAUD)); 8002920: 34 02 00 10 mvi r2,16 <== NOT EXECUTED 8002924: fb ff fb d4 calli 8001874 <__ashlsi3> <== NOT EXECUTED 8002928: 78 04 08 02 mvhi r4,0x802 <== NOT EXECUTED 800292c: 38 84 05 a8 ori r4,r4,0x5a8 <== NOT EXECUTED 8002930: 29 63 00 08 lw r3,(r11+8) <== NOT EXECUTED 8002934: 28 82 00 00 lw r2,(r4+0) <== NOT EXECUTED 8002938: a0 62 10 00 and r2,r3,r2 <== NOT EXECUTED 800293c: b8 22 08 00 or r1,r1,r2 <== NOT EXECUTED 8002940: 59 61 00 08 sw (r11+8),r1 <== NOT EXECUTED return 0; 8002944: 34 01 00 00 mvi r1,0 <== NOT EXECUTED } 8002948: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800294c: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 8002950: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 8002954: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08002958 : int cfsetospeed( struct termios *tp, speed_t speed ) { 8002958: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 800295c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED if ( speed & ~CBAUD ) 8002960: 34 03 ef f0 mvi r3,-4112 <== NOT EXECUTED 8002964: a0 43 20 00 and r4,r2,r3 <== NOT EXECUTED 8002968: 44 80 00 06 be r4,r0,8002980 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 800296c: f8 00 38 7e calli 8010b64 <__errno> <== NOT EXECUTED 8002970: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8002974: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8002978: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800297c: e0 00 00 06 bi 8002994 <== NOT EXECUTED tp->c_cflag = (tp->c_cflag & ~CBAUD) | speed; 8002980: 28 24 00 08 lw r4,(r1+8) <== NOT EXECUTED 8002984: a0 64 18 00 and r3,r3,r4 <== NOT EXECUTED 8002988: b8 43 10 00 or r2,r2,r3 <== NOT EXECUTED 800298c: 58 22 00 08 sw (r1+8),r2 <== NOT EXECUTED return 0; 8002990: 34 01 00 00 mvi r1,0 <== NOT EXECUTED } 8002994: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8002998: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 800299c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080012b8 : #include int chroot( const char *pathname ) { 80012b8: 37 9c ff dc addi sp,sp,-36 80012bc: 5b 8b 00 10 sw (sp+16),r11 80012c0: 5b 8c 00 0c sw (sp+12),r12 80012c4: 5b 8d 00 08 sw (sp+8),r13 80012c8: 5b 9d 00 04 sw (sp+4),ra 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) { 80012cc: 78 0b 08 01 mvhi r11,0x801 80012d0: 39 6b 41 04 ori r11,r11,0x4104 80012d4: 29 6c 00 00 lw r12,(r11+0) 80012d8: 78 02 08 01 mvhi r2,0x801 80012dc: 38 42 47 50 ori r2,r2,0x4750 #include int chroot( const char *pathname ) { 80012e0: b8 20 68 00 mv r13,r1 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) { 80012e4: 5d 82 00 08 bne r12,r2,8001304 <== NEVER TAKEN rtems_libio_set_private_env(); /* try to set a new private env*/ 80012e8: f8 00 05 a0 calli 8002968 if (rtems_current_user_env == &rtems_global_user_env) /* not ok */ 80012ec: 29 61 00 00 lw r1,(r11+0) 80012f0: 5c 2c 00 05 bne r1,r12,8001304 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOTSUP ); 80012f4: f8 00 2d f4 calli 800cac4 <__errno> <== NOT EXECUTED 80012f8: 34 02 00 86 mvi r2,134 <== NOT EXECUTED 80012fc: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8001300: e0 00 00 0a bi 8001328 <== NOT EXECUTED } result = chdir(pathname); 8001304: b9 a0 08 00 mv r1,r13 8001308: f8 00 1c 7d calli 80084fc 800130c: b8 20 58 00 mv r11,r1 if (result) { 8001310: 44 20 00 08 be r1,r0,8001330 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( errno ); 8001314: f8 00 2d ec calli 800cac4 <__errno> <== NOT EXECUTED 8001318: b8 20 58 00 mv r11,r1 <== NOT EXECUTED 800131c: f8 00 2d ea calli 800cac4 <__errno> <== NOT EXECUTED 8001320: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED 8001324: 59 61 00 00 sw (r11+0),r1 <== NOT EXECUTED 8001328: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800132c: e0 00 00 1a bi 8001394 <== NOT EXECUTED } /* clone the new root location */ if (rtems_filesystem_evaluate_path(".", 1, 0, &loc, 0)) { 8001330: 78 01 08 01 mvhi r1,0x801 8001334: 38 21 30 88 ori r1,r1,0x3088 8001338: 34 02 00 01 mvi r2,1 800133c: 34 03 00 00 mvi r3,0 8001340: 37 84 00 14 addi r4,sp,20 8001344: 34 05 00 00 mvi r5,0 8001348: f8 00 00 72 calli 8001510 800134c: 5c 2b ff f2 bne r1,r11,8001314 <== NEVER TAKEN /* 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); 8001350: 78 0b 08 01 mvhi r11,0x801 8001354: 39 6b 41 04 ori r11,r11,0x4104 8001358: 29 61 00 00 lw r1,(r11+0) 800135c: 34 21 00 18 addi r1,r1,24 8001360: f8 00 00 be calli 8001658 rtems_filesystem_root = loc; 8001364: 29 61 00 00 lw r1,(r11+0) 8001368: 2b 82 00 14 lw r2,(sp+20) 800136c: 58 22 00 18 sw (r1+24),r2 8001370: 2b 82 00 18 lw r2,(sp+24) 8001374: 58 22 00 1c sw (r1+28),r2 8001378: 2b 82 00 1c lw r2,(sp+28) 800137c: 58 22 00 20 sw (r1+32),r2 8001380: 2b 82 00 20 lw r2,(sp+32) 8001384: 58 22 00 24 sw (r1+36),r2 8001388: 2b 82 00 24 lw r2,(sp+36) 800138c: 58 22 00 28 sw (r1+40),r2 return 0; 8001390: 34 01 00 00 mvi r1,0 } 8001394: 2b 9d 00 04 lw ra,(sp+4) 8001398: 2b 8b 00 10 lw r11,(sp+16) 800139c: 2b 8c 00 0c lw r12,(sp+12) 80013a0: 2b 8d 00 08 lw r13,(sp+8) 80013a4: 37 9c 00 24 addi sp,sp,36 80013a8: c3 a0 00 00 ret =============================================================================== 08002e24 : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 8002e24: 37 9c ff fc addi sp,sp,-4 8002e28: 5b 9d 00 04 sw (sp+4),ra 8002e2c: b8 20 18 00 mv r3,r1 8002e30: b8 40 08 00 mv r1,r2 if ( !tp ) 8002e34: 44 40 00 11 be r2,r0,8002e78 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 8002e38: 34 02 00 01 mvi r2,1 8002e3c: 5c 62 00 03 bne r3,r2,8002e48 _TOD_Get(tp); 8002e40: f8 00 06 ff calli 8004a3c <_TOD_Get> 8002e44: e0 00 00 06 bi 8002e5c return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 8002e48: 34 02 00 04 mvi r2,4 8002e4c: 44 62 00 03 be r3,r2,8002e58 <== NEVER TAKEN return 0; } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { 8002e50: 34 02 00 02 mvi r2,2 8002e54: 5c 62 00 04 bne r3,r2,8002e64 _TOD_Get_uptime_as_timespec( tp ); 8002e58: f8 00 07 1e calli 8004ad0 <_TOD_Get_uptime_as_timespec> return 0; 8002e5c: 34 01 00 00 mvi r1,0 8002e60: e0 00 00 0a bi 8002e88 } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) 8002e64: 34 01 00 03 mvi r1,3 8002e68: 5c 61 00 04 bne r3,r1,8002e78 rtems_set_errno_and_return_minus_one( ENOSYS ); 8002e6c: f8 00 2a c4 calli 800d97c <__errno> 8002e70: 34 02 00 58 mvi r2,88 8002e74: e0 00 00 03 bi 8002e80 #endif rtems_set_errno_and_return_minus_one( EINVAL ); 8002e78: f8 00 2a c1 calli 800d97c <__errno> 8002e7c: 34 02 00 16 mvi r2,22 8002e80: 58 22 00 00 sw (r1+0),r2 8002e84: 34 01 ff ff mvi r1,-1 return 0; } 8002e88: 2b 9d 00 04 lw ra,(sp+4) 8002e8c: 37 9c 00 04 addi sp,sp,4 8002e90: c3 a0 00 00 ret =============================================================================== 08002e94 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 8002e94: 37 9c ff fc addi sp,sp,-4 8002e98: 5b 9d 00 04 sw (sp+4),ra if ( !tp ) 8002e9c: 44 40 00 1a be r2,r0,8002f04 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 8002ea0: 34 03 00 01 mvi r3,1 8002ea4: 5c 23 00 11 bne r1,r3,8002ee8 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 8002ea8: 78 04 08 01 mvhi r4,0x801 8002eac: 38 84 e4 a4 ori r4,r4,0xe4a4 8002eb0: 28 43 00 00 lw r3,(r2+0) 8002eb4: 28 81 00 00 lw r1,(r4+0) 8002eb8: 54 61 00 02 bgu r3,r1,8002ec0 8002ebc: e0 00 00 12 bi 8002f04 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8002ec0: 78 01 08 02 mvhi r1,0x802 8002ec4: 38 21 08 ac ori r1,r1,0x8ac 8002ec8: 28 23 00 00 lw r3,(r1+0) 8002ecc: 34 63 00 01 addi r3,r3,1 8002ed0: 58 23 00 00 sw (r1+0),r3 rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); 8002ed4: b8 40 08 00 mv r1,r2 8002ed8: f8 00 07 1b calli 8004b44 <_TOD_Set> _Thread_Enable_dispatch(); 8002edc: f8 00 0c 43 calli 8005fe8 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 8002ee0: 34 01 00 00 mvi r1,0 8002ee4: e0 00 00 0c bi 8002f14 _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME ) 8002ee8: 34 02 00 02 mvi r2,2 8002eec: 44 22 00 03 be r1,r2,8002ef8 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) 8002ef0: 34 02 00 03 mvi r2,3 8002ef4: 5c 22 00 04 bne r1,r2,8002f04 rtems_set_errno_and_return_minus_one( ENOSYS ); 8002ef8: f8 00 2a a1 calli 800d97c <__errno> 8002efc: 34 02 00 58 mvi r2,88 8002f00: e0 00 00 03 bi 8002f0c #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 8002f04: f8 00 2a 9e calli 800d97c <__errno> 8002f08: 34 02 00 16 mvi r2,22 8002f0c: 58 22 00 00 sw (r1+0),r2 8002f10: 34 01 ff ff mvi r1,-1 return 0; } 8002f14: 2b 9d 00 04 lw ra,(sp+4) 8002f18: 37 9c 00 04 addi sp,sp,4 8002f1c: c3 a0 00 00 ret =============================================================================== 080012d8 : static char *ctermid_name = "/dev/console"; char *ctermid( char *s ) { 80012d8: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED 80012dc: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED 80012e0: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED 80012e4: 78 02 08 00 mvhi r2,0x800 <== NOT EXECUTED 80012e8: b8 20 58 00 mv r11,r1 <== NOT EXECUTED 80012ec: 38 42 fe 48 ori r2,r2,0xfe48 <== NOT EXECUTED if ( !s ) 80012f0: 44 20 00 03 be r1,r0,80012fc <== NOT EXECUTED return ctermid_name; strcpy( s, ctermid_name ); 80012f4: f8 00 27 e2 calli 800b27c <== NOT EXECUTED return s; 80012f8: e0 00 00 02 bi 8001300 <== NOT EXECUTED char *ctermid( char *s ) { if ( !s ) return ctermid_name; 80012fc: b8 40 58 00 mv r11,r2 <== NOT EXECUTED strcpy( s, ctermid_name ); return s; } 8001300: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8001304: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8001308: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 800130c: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 8001310: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08006650 : const char *pathname, size_t pathnamelen, int flags, rtems_filesystem_location_info_t *pathloc ) { 8006650: 37 9c ff e0 addi sp,sp,-32 8006654: 5b 8b 00 20 sw (sp+32),r11 8006658: 5b 8c 00 1c sw (sp+28),r12 800665c: 5b 8d 00 18 sw (sp+24),r13 8006660: 5b 8e 00 14 sw (sp+20),r14 8006664: 5b 8f 00 10 sw (sp+16),r15 8006668: 5b 90 00 0c sw (sp+12),r16 800666c: 5b 91 00 08 sw (sp+8),r17 8006670: 5b 9d 00 04 sw (sp+4),ra 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; 8006674: 28 8c 00 00 lw r12,(r4+0) if (!device_name_table) rtems_set_errno_and_return_minus_one( EFAULT ); for (i = 0; i < rtems_device_table_size; i++) { 8006678: 78 0d 08 01 mvhi r13,0x801 const char *pathname, size_t pathnamelen, int flags, rtems_filesystem_location_info_t *pathloc ) { 800667c: b8 20 88 00 mv r17,r1 8006680: b8 40 80 00 mv r16,r2 8006684: b8 80 58 00 mv r11,r4 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) 8006688: 34 0e 00 00 mvi r14,0 rtems_set_errno_and_return_minus_one( EFAULT ); for (i = 0; i < rtems_device_table_size; i++) { 800668c: 39 ad 10 14 ori r13,r13,0x1014 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) 8006690: 5d 80 00 1f bne r12,r0,800670c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); 8006694: f8 00 0e 8e calli 800a0cc <__errno> <== NOT EXECUTED 8006698: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 800669c: e0 00 00 20 bi 800671c <== NOT EXECUTED for (i = 0; i < rtems_device_table_size; i++) { if (!device_name_table[i].device_name) 80066a0: 29 8f 00 00 lw r15,(r12+0) 80066a4: 45 e0 00 18 be r15,r0,8006704 continue; if (strncmp(pathname, device_name_table[i].device_name, pathnamelen) != 0) 80066a8: ba 20 08 00 mv r1,r17 80066ac: b9 e0 10 00 mv r2,r15 80066b0: ba 00 18 00 mv r3,r16 80066b4: f8 00 12 fe calli 800b2ac 80066b8: b8 20 20 00 mv r4,r1 80066bc: 5c 20 00 12 bne r1,r0,8006704 <== NEVER TAKEN continue; if (device_name_table[i].device_name[pathnamelen] != '\0') 80066c0: b5 f0 78 00 add r15,r15,r16 80066c4: 41 e1 00 00 lbu r1,(r15+0) 80066c8: 5c 24 00 0f bne r1,r4,8006704 <== NEVER TAKEN continue; /* find the device, set proper values */ pathloc->node_access = (void *)&device_name_table[i]; pathloc->handlers = &devFS_file_handlers; 80066cc: 78 01 08 01 mvhi r1,0x801 80066d0: 38 21 11 58 ori r1,r1,0x1158 80066d4: 59 61 00 08 sw (r11+8),r1 pathloc->ops = &devFS_ops; 80066d8: 78 01 08 01 mvhi r1,0x801 80066dc: 38 21 11 10 ori r1,r1,0x1110 80066e0: 59 61 00 0c sw (r11+12),r1 pathloc->mt_entry = rtems_filesystem_root.mt_entry; 80066e4: 78 01 08 01 mvhi r1,0x801 80066e8: 38 21 11 9c ori r1,r1,0x119c 80066ec: 28 21 00 00 lw r1,(r1+0) if (device_name_table[i].device_name[pathnamelen] != '\0') continue; /* find the device, set proper values */ pathloc->node_access = (void *)&device_name_table[i]; 80066f0: 59 6c 00 00 sw (r11+0),r12 pathloc->handlers = &devFS_file_handlers; pathloc->ops = &devFS_ops; pathloc->mt_entry = rtems_filesystem_root.mt_entry; 80066f4: 28 21 00 28 lw r1,(r1+40) 80066f8: 59 61 00 10 sw (r11+16),r1 return 0; 80066fc: 34 01 00 00 mvi r1,0 8006700: e0 00 00 09 bi 8006724 /* 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++) { 8006704: 35 ce 00 01 addi r14,r14,1 8006708: 35 8c 00 14 addi r12,r12,20 800670c: 29 a1 00 00 lw r1,(r13+0) 8006710: 54 2e ff e4 bgu r1,r14,80066a0 pathloc->mt_entry = rtems_filesystem_root.mt_entry; return 0; } /* no such file or directory */ rtems_set_errno_and_return_minus_one( ENOENT ); 8006714: f8 00 0e 6e calli 800a0cc <__errno> 8006718: 34 02 00 02 mvi r2,2 800671c: 58 22 00 00 sw (r1+0),r2 8006720: 34 01 ff ff mvi r1,-1 } 8006724: 2b 9d 00 04 lw ra,(sp+4) 8006728: 2b 8b 00 20 lw r11,(sp+32) 800672c: 2b 8c 00 1c lw r12,(sp+28) 8006730: 2b 8d 00 18 lw r13,(sp+24) 8006734: 2b 8e 00 14 lw r14,(sp+20) 8006738: 2b 8f 00 10 lw r15,(sp+16) 800673c: 2b 90 00 0c lw r16,(sp+12) 8006740: 2b 91 00 08 lw r17,(sp+8) 8006744: 37 9c 00 20 addi sp,sp,32 8006748: c3 a0 00 00 ret =============================================================================== 0800091c : int devFS_initialize( rtems_filesystem_mount_table_entry_t *temp_mt_entry, const void *data ) { 800091c: 37 9c ff f0 addi sp,sp,-16 8000920: 5b 8b 00 10 sw (sp+16),r11 8000924: 5b 8c 00 0c sw (sp+12),r12 8000928: 5b 8d 00 08 sw (sp+8),r13 800092c: 5b 9d 00 04 sw (sp+4),ra rtems_device_name_t *device_name_table; /* allocate device only filesystem name table */ device_name_table = (rtems_device_name_t *)_Workspace_Allocate( sizeof( rtems_device_name_t ) * ( rtems_device_table_size ) 8000930: 78 0b 08 01 mvhi r11,0x801 8000934: 39 6b 10 14 ori r11,r11,0x1014 int devFS_initialize( rtems_filesystem_mount_table_entry_t *temp_mt_entry, const void *data ) { 8000938: b8 20 60 00 mv r12,r1 rtems_device_name_t *device_name_table; /* allocate device only filesystem name table */ device_name_table = (rtems_device_name_t *)_Workspace_Allocate( sizeof( rtems_device_name_t ) * ( rtems_device_table_size ) 800093c: 29 61 00 00 lw r1,(r11+0) 8000940: 34 02 00 02 mvi r2,2 8000944: f8 00 38 46 calli 800ea5c <__ashlsi3> 8000948: 34 02 00 02 mvi r2,2 800094c: b8 20 68 00 mv r13,r1 8000950: f8 00 38 43 calli 800ea5c <__ashlsi3> ) { rtems_device_name_t *device_name_table; /* allocate device only filesystem name table */ device_name_table = (rtems_device_name_t *)_Workspace_Allocate( 8000954: b5 a1 08 00 add r1,r13,r1 8000958: f8 00 15 9e calli 8005fd0 <_Workspace_Allocate> 800095c: b8 20 68 00 mv r13,r1 sizeof( rtems_device_name_t ) * ( rtems_device_table_size ) ); /* no memory for device filesystem */ if (!device_name_table) 8000960: 5c 20 00 06 bne r1,r0,8000978 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOMEM ); 8000964: f8 00 25 da calli 800a0cc <__errno> <== NOT EXECUTED 8000968: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 800096c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8000970: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8000974: e0 00 00 13 bi 80009c0 <== NOT EXECUTED memset( device_name_table, 0, sizeof( rtems_device_name_t ) * ( rtems_device_table_size ) 8000978: 29 61 00 00 lw r1,(r11+0) 800097c: 34 02 00 02 mvi r2,2 8000980: f8 00 38 37 calli 800ea5c <__ashlsi3> 8000984: 34 02 00 02 mvi r2,2 8000988: b8 20 58 00 mv r11,r1 800098c: f8 00 38 34 calli 800ea5c <__ashlsi3> 8000990: b5 61 18 00 add r3,r11,r1 /* no memory for device filesystem */ if (!device_name_table) rtems_set_errno_and_return_minus_one( ENOMEM ); memset( 8000994: 34 02 00 00 mvi r2,0 8000998: b9 a0 08 00 mv r1,r13 800099c: f8 00 28 ce calli 800acd4 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; 80009a0: 78 01 08 01 mvhi r1,0x801 80009a4: 38 21 11 58 ori r1,r1,0x1158 80009a8: 59 81 00 24 sw (r12+36),r1 temp_mt_entry->mt_fs_root.ops = &devFS_ops; 80009ac: 78 01 08 01 mvhi r1,0x801 80009b0: 38 21 11 10 ori r1,r1,0x1110 80009b4: 59 81 00 28 sw (r12+40),r1 /* Set the node_access to device name table */ temp_mt_entry->mt_fs_root.node_access = (void *)device_name_table; 80009b8: 59 8d 00 1c sw (r12+28),r13 return 0; 80009bc: 34 01 00 00 mvi r1,0 } 80009c0: 2b 9d 00 04 lw ra,(sp+4) 80009c4: 2b 8b 00 10 lw r11,(sp+16) 80009c8: 2b 8c 00 0c lw r12,(sp+12) 80009cc: 2b 8d 00 08 lw r13,(sp+8) 80009d0: 37 9c 00 10 addi sp,sp,16 80009d4: c3 a0 00 00 ret =============================================================================== 08000c0c : int devFS_ioctl( rtems_libio_t *iop, uint32_t command, void *buffer ) { 8000c0c: 37 9c ff ec addi sp,sp,-20 8000c10: 5b 9d 00 04 sw (sp+4),ra rtems_libio_ioctl_args_t args; rtems_status_code status; rtems_device_name_t *np; np = (rtems_device_name_t *)iop->pathinfo.node_access; 8000c14: 28 24 00 1c lw r4,(r1+28) args.iop = iop; 8000c18: 5b 81 00 08 sw (sp+8),r1 args.command = command; 8000c1c: 5b 82 00 0c sw (sp+12),r2 args.buffer = buffer; status = rtems_io_control( 8000c20: 28 81 00 08 lw r1,(r4+8) 8000c24: 28 82 00 0c lw r2,(r4+12) np = (rtems_device_name_t *)iop->pathinfo.node_access; args.iop = iop; args.command = command; args.buffer = buffer; 8000c28: 5b 83 00 10 sw (sp+16),r3 status = rtems_io_control( 8000c2c: 37 83 00 08 addi r3,sp,8 8000c30: f8 00 07 7d calli 8002a24 np->major, np->minor, (void *) &args ); if ( status ) 8000c34: 44 20 00 03 be r1,r0,8000c40 <== ALWAYS TAKEN return rtems_deviceio_errno(status); 8000c38: f8 00 16 c8 calli 8006758 <== NOT EXECUTED 8000c3c: e0 00 00 02 bi 8000c44 <== NOT EXECUTED return args.ioctl_return; 8000c40: 2b 81 00 14 lw r1,(sp+20) } 8000c44: 2b 9d 00 04 lw ra,(sp+4) 8000c48: 37 9c 00 14 addi sp,sp,20 8000c4c: c3 a0 00 00 ret =============================================================================== 080009d8 : const char *path, mode_t mode, dev_t dev, rtems_filesystem_location_info_t *pathloc ) { 80009d8: 37 9c ff d8 addi sp,sp,-40 80009dc: 5b 8b 00 28 sw (sp+40),r11 80009e0: 5b 8c 00 24 sw (sp+36),r12 80009e4: 5b 8d 00 20 sw (sp+32),r13 80009e8: 5b 8e 00 1c sw (sp+28),r14 80009ec: 5b 8f 00 18 sw (sp+24),r15 80009f0: 5b 90 00 14 sw (sp+20),r16 80009f4: 5b 91 00 10 sw (sp+16),r17 80009f8: 5b 92 00 0c sw (sp+12),r18 80009fc: 5b 93 00 08 sw (sp+8),r19 8000a00: 5b 9d 00 04 sw (sp+4),ra 8000a04: b8 40 88 00 mv r17,r2 * 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') && 8000a08: 40 22 00 00 lbu r2,(r1+0) const char *path, mode_t mode, dev_t dev, rtems_filesystem_location_info_t *pathloc ) { 8000a0c: b8 20 58 00 mv r11,r1 * 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') && 8000a10: 34 01 00 64 mvi r1,100 const char *path, mode_t mode, dev_t dev, rtems_filesystem_location_info_t *pathloc ) { 8000a14: b8 60 98 00 mv r19,r3 8000a18: b8 80 90 00 mv r18,r4 * 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') && 8000a1c: 5c 41 00 0a bne r2,r1,8000a44 <== NEVER TAKEN 8000a20: 41 62 00 01 lbu r2,(r11+1) 8000a24: 34 01 00 65 mvi r1,101 8000a28: 5c 41 00 07 bne r2,r1,8000a44 <== NEVER TAKEN 8000a2c: 41 62 00 02 lbu r2,(r11+2) 8000a30: 34 01 00 76 mvi r1,118 8000a34: 5c 41 00 04 bne r2,r1,8000a44 <== NEVER TAKEN (path[2] == 'v') && (path[3] == '\0')) 8000a38: 41 62 00 03 lbu r2,(r11+3) return 0; 8000a3c: 34 01 00 00 mvi r1,0 * actually passed in is 'dev', not '/dev'. Just return 0 to * indicate we are OK. */ if ((path[0] == 'd') && (path[1] == 'e') && (path[2] == 'v') && (path[3] == '\0')) 8000a40: 44 40 00 3d be r2,r0,8000b34 return 0; /* must be a character device or a block device */ if (!S_ISBLK(mode) && !S_ISCHR(mode)) 8000a44: 22 22 f0 00 andi r2,r17,0xf000 8000a48: 7c 41 20 00 cmpnei r1,r2,8192 8000a4c: 7c 42 60 00 cmpnei r2,r2,24576 8000a50: a0 22 08 00 and r1,r1,r2 8000a54: 44 20 00 04 be r1,r0,8000a64 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 8000a58: f8 00 25 9d calli 800a0cc <__errno> <== NOT EXECUTED 8000a5c: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8000a60: e0 00 00 0b bi 8000a8c <== NOT EXECUTED 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; 8000a64: 28 af 00 00 lw r15,(r5+0) if (!device_name_table) 8000a68: 45 e1 00 07 be r15,r1,8000a84 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); for (slot = -1, i = 0; i < rtems_device_table_size; i++){ 8000a6c: 78 0d 08 01 mvhi r13,0x801 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; if (!device_name_table) 8000a70: b9 e0 80 00 mv r16,r15 8000a74: 34 0c ff ff mvi r12,-1 8000a78: 34 0e 00 00 mvi r14,0 rtems_set_errno_and_return_minus_one( EFAULT ); for (slot = -1, i = 0; i < rtems_device_table_size; i++){ 8000a7c: 39 ad 10 14 ori r13,r13,0x1014 8000a80: e0 00 00 11 bi 8000ac4 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 ); 8000a84: f8 00 25 92 calli 800a0cc <__errno> <== NOT EXECUTED 8000a88: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 8000a8c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8000a90: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8000a94: e0 00 00 28 bi 8000b34 <== NOT EXECUTED for (slot = -1, i = 0; i < rtems_device_table_size; i++){ if (device_name_table[i].device_name == NULL) 8000a98: 2a 02 00 00 lw r2,(r16+0) 8000a9c: 44 40 00 07 be r2,r0,8000ab8 <== ALWAYS TAKEN slot = i; else if (strcmp(path, device_name_table[i].device_name) == 0) 8000aa0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8000aa4: f8 00 29 7f calli 800b0a0 <== NOT EXECUTED 8000aa8: 5c 20 00 05 bne r1,r0,8000abc <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EEXIST ); 8000aac: f8 00 25 88 calli 800a0cc <__errno> <== NOT EXECUTED 8000ab0: 34 02 00 11 mvi r2,17 <== NOT EXECUTED 8000ab4: e3 ff ff f6 bi 8000a8c <== NOT EXECUTED 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) slot = i; 8000ab8: b9 c0 60 00 mv r12,r14 /* 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++){ 8000abc: 35 ce 00 01 addi r14,r14,1 8000ac0: 36 10 00 14 addi r16,r16,20 8000ac4: 29 a1 00 00 lw r1,(r13+0) 8000ac8: 54 2e ff f4 bgu r1,r14,8000a98 else if (strcmp(path, device_name_table[i].device_name) == 0) rtems_set_errno_and_return_minus_one( EEXIST ); } if (slot == -1) 8000acc: 34 01 ff ff mvi r1,-1 8000ad0: 5d 81 00 04 bne r12,r1,8000ae0 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOMEM ); 8000ad4: f8 00 25 7e calli 800a0cc <__errno> <== NOT EXECUTED 8000ad8: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8000adc: e3 ff ff ec bi 8000a8c <== NOT EXECUTED _ISR_Disable(level); 8000ae0: 90 00 68 00 rcsr r13,IE 8000ae4: 34 01 ff fe mvi r1,-2 8000ae8: a1 a1 08 00 and r1,r13,r1 8000aec: d0 01 00 00 wcsr IE,r1 device_name_table[slot].device_name = (char *)path; 8000af0: 34 02 00 02 mvi r2,2 8000af4: b9 80 08 00 mv r1,r12 8000af8: f8 00 37 d9 calli 800ea5c <__ashlsi3> 8000afc: 34 02 00 02 mvi r2,2 8000b00: b8 20 60 00 mv r12,r1 8000b04: f8 00 37 d6 calli 800ea5c <__ashlsi3> 8000b08: b5 81 08 00 add r1,r12,r1 8000b0c: b5 e1 60 00 add r12,r15,r1 8000b10: 59 8b 00 00 sw (r12+0),r11 device_name_table[slot].device_name_length = strlen(path); 8000b14: b9 60 08 00 mv r1,r11 8000b18: f8 00 29 b6 calli 800b1f0 8000b1c: 59 81 00 04 sw (r12+4),r1 device_name_table[slot].major = major; 8000b20: 59 93 00 08 sw (r12+8),r19 device_name_table[slot].minor = minor; 8000b24: 59 92 00 0c sw (r12+12),r18 device_name_table[slot].mode = mode; 8000b28: 59 91 00 10 sw (r12+16),r17 _ISR_Enable(level); 8000b2c: d0 0d 00 00 wcsr IE,r13 return 0; 8000b30: 34 01 00 00 mvi r1,0 } 8000b34: 2b 9d 00 04 lw ra,(sp+4) 8000b38: 2b 8b 00 28 lw r11,(sp+40) 8000b3c: 2b 8c 00 24 lw r12,(sp+36) 8000b40: 2b 8d 00 20 lw r13,(sp+32) 8000b44: 2b 8e 00 1c lw r14,(sp+28) 8000b48: 2b 8f 00 18 lw r15,(sp+24) 8000b4c: 2b 90 00 14 lw r16,(sp+20) 8000b50: 2b 91 00 10 lw r17,(sp+16) 8000b54: 2b 92 00 0c lw r18,(sp+12) 8000b58: 2b 93 00 08 lw r19,(sp+8) 8000b5c: 37 9c 00 28 addi sp,sp,40 8000b60: c3 a0 00 00 ret =============================================================================== 08000c8c : ssize_t devFS_read( rtems_libio_t *iop, void *buffer, size_t count ) { 8000c8c: 37 9c ff dc addi sp,sp,-36 <== NOT EXECUTED 8000c90: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED rtems_status_code status; rtems_device_name_t *np; np = (rtems_device_name_t *)iop->pathinfo.node_access; args.iop = iop; 8000c94: 5b 81 00 08 sw (sp+8),r1 <== NOT EXECUTED args.offset = iop->offset; 8000c98: 28 25 00 14 lw r5,(r1+20) <== 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; 8000c9c: 28 24 00 1c lw r4,(r1+28) <== NOT EXECUTED args.iop = iop; args.offset = iop->offset; 8000ca0: 5b 85 00 14 sw (sp+20),r5 <== NOT EXECUTED 8000ca4: 28 25 00 10 lw r5,(r1+16) <== NOT EXECUTED args.buffer = buffer; 8000ca8: 5b 82 00 18 sw (sp+24),r2 <== NOT EXECUTED args.count = count; 8000cac: 5b 83 00 1c sw (sp+28),r3 <== NOT EXECUTED rtems_device_name_t *np; np = (rtems_device_name_t *)iop->pathinfo.node_access; args.iop = iop; args.offset = iop->offset; 8000cb0: 5b 85 00 10 sw (sp+16),r5 <== NOT EXECUTED args.buffer = buffer; args.count = count; args.flags = iop->flags; 8000cb4: 28 21 00 18 lw r1,(r1+24) <== NOT EXECUTED args.bytes_moved = 0; status = rtems_io_read( 8000cb8: 28 82 00 0c lw r2,(r4+12) <== NOT EXECUTED 8000cbc: 37 83 00 08 addi r3,sp,8 <== NOT EXECUTED args.iop = iop; args.offset = iop->offset; args.buffer = buffer; args.count = count; args.flags = iop->flags; 8000cc0: 5b 81 00 20 sw (sp+32),r1 <== NOT EXECUTED args.bytes_moved = 0; status = rtems_io_read( 8000cc4: 28 81 00 08 lw r1,(r4+8) <== NOT EXECUTED args.iop = iop; args.offset = iop->offset; args.buffer = buffer; args.count = count; args.flags = iop->flags; args.bytes_moved = 0; 8000cc8: 5b 80 00 24 sw (sp+36),r0 <== NOT EXECUTED status = rtems_io_read( 8000ccc: f8 00 07 f9 calli 8002cb0 <== NOT EXECUTED np->major, np->minor, (void *) &args ); if ( status ) 8000cd0: 44 20 00 03 be r1,r0,8000cdc <== NOT EXECUTED return rtems_deviceio_errno(status); 8000cd4: f8 00 16 a1 calli 8006758 <== NOT EXECUTED 8000cd8: e0 00 00 02 bi 8000ce0 <== NOT EXECUTED return (ssize_t) args.bytes_moved; 8000cdc: 2b 81 00 24 lw r1,(sp+36) <== NOT EXECUTED } 8000ce0: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8000ce4: 37 9c 00 24 addi sp,sp,36 <== NOT EXECUTED 8000ce8: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08000cec : int devFS_stat( rtems_filesystem_location_info_t *loc, struct stat *buf ) { 8000cec: 37 9c ff fc addi sp,sp,-4 8000cf0: 5b 9d 00 04 sw (sp+4),ra rtems_device_name_t *the_dev; the_dev = (rtems_device_name_t *)loc->node_access; 8000cf4: 28 21 00 00 lw r1,(r1+0) if (!the_dev) 8000cf8: 5c 20 00 06 bne r1,r0,8000d10 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); 8000cfc: f8 00 24 f4 calli 800a0cc <__errno> <== NOT EXECUTED 8000d00: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 8000d04: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8000d08: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8000d0c: e0 00 00 08 bi 8000d2c <== NOT EXECUTED buf->st_rdev = rtems_filesystem_make_dev_t( the_dev->major, the_dev->minor ); 8000d10: 28 23 00 0c lw r3,(r1+12) rtems_device_minor_number _minor ) { union __rtems_dev_t temp; temp.__overlay.major = _major; 8000d14: 28 24 00 08 lw r4,(r1+8) buf->st_mode = the_dev->mode; 8000d18: 28 21 00 10 lw r1,(r1+16) the_dev = (rtems_device_name_t *)loc->node_access; if (!the_dev) rtems_set_errno_and_return_minus_one( EFAULT ); buf->st_rdev = rtems_filesystem_make_dev_t( the_dev->major, the_dev->minor ); 8000d1c: 58 43 00 1c sw (r2+28),r3 8000d20: 58 44 00 18 sw (r2+24),r4 buf->st_mode = the_dev->mode; 8000d24: 58 41 00 0c sw (r2+12),r1 return 0; 8000d28: 34 01 00 00 mvi r1,0 } 8000d2c: 2b 9d 00 04 lw ra,(sp+4) 8000d30: 37 9c 00 04 addi sp,sp,4 8000d34: c3 a0 00 00 ret =============================================================================== 08000d38 : ssize_t devFS_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 8000d38: 37 9c ff dc addi sp,sp,-36 8000d3c: 5b 9d 00 04 sw (sp+4),ra rtems_status_code status; rtems_device_name_t *np; np = (rtems_device_name_t *)iop->pathinfo.node_access; args.iop = iop; 8000d40: 5b 81 00 08 sw (sp+8),r1 args.offset = iop->offset; 8000d44: 28 25 00 14 lw r5,(r1+20) { rtems_libio_rw_args_t args; rtems_status_code status; rtems_device_name_t *np; np = (rtems_device_name_t *)iop->pathinfo.node_access; 8000d48: 28 24 00 1c lw r4,(r1+28) args.iop = iop; args.offset = iop->offset; 8000d4c: 5b 85 00 14 sw (sp+20),r5 8000d50: 28 25 00 10 lw r5,(r1+16) args.buffer = (void *) buffer; 8000d54: 5b 82 00 18 sw (sp+24),r2 args.count = count; 8000d58: 5b 83 00 1c sw (sp+28),r3 rtems_device_name_t *np; np = (rtems_device_name_t *)iop->pathinfo.node_access; args.iop = iop; args.offset = iop->offset; 8000d5c: 5b 85 00 10 sw (sp+16),r5 args.buffer = (void *) buffer; args.count = count; args.flags = iop->flags; 8000d60: 28 21 00 18 lw r1,(r1+24) args.bytes_moved = 0; status = rtems_io_write( 8000d64: 28 82 00 0c lw r2,(r4+12) 8000d68: 37 83 00 08 addi r3,sp,8 args.iop = iop; args.offset = iop->offset; args.buffer = (void *) buffer; args.count = count; args.flags = iop->flags; 8000d6c: 5b 81 00 20 sw (sp+32),r1 args.bytes_moved = 0; status = rtems_io_write( 8000d70: 28 81 00 08 lw r1,(r4+8) args.iop = iop; args.offset = iop->offset; args.buffer = (void *) buffer; args.count = count; args.flags = iop->flags; args.bytes_moved = 0; 8000d74: 5b 80 00 24 sw (sp+36),r0 status = rtems_io_write( 8000d78: f8 00 07 f3 calli 8002d44 np->major, np->minor, (void *) &args ); if ( status ) 8000d7c: 44 20 00 03 be r1,r0,8000d88 <== ALWAYS TAKEN return rtems_deviceio_errno(status); 8000d80: f8 00 16 76 calli 8006758 <== NOT EXECUTED 8000d84: e0 00 00 02 bi 8000d8c <== NOT EXECUTED return (ssize_t) args.bytes_moved; 8000d88: 2b 81 00 24 lw r1,(sp+36) } 8000d8c: 2b 9d 00 04 lw ra,(sp+4) 8000d90: 37 9c 00 24 addi sp,sp,36 8000d94: c3 a0 00 00 ret =============================================================================== 08010464 : int device_ioctl( rtems_libio_t *iop, uint32_t command, void *buffer ) { 8010464: 37 9c ff ec addi sp,sp,-20 8010468: 5b 9d 00 04 sw (sp+4),ra rtems_libio_ioctl_args_t args; rtems_status_code status; IMFS_jnode_t *the_jnode; args.iop = iop; args.command = command; 801046c: 5b 82 00 0c sw (sp+12),r2 args.buffer = buffer; the_jnode = iop->pathinfo.node_access; 8010470: 28 22 00 1c lw r2,(r1+28) { rtems_libio_ioctl_args_t args; rtems_status_code status; IMFS_jnode_t *the_jnode; args.iop = iop; 8010474: 5b 81 00 08 sw (sp+8),r1 args.command = command; args.buffer = buffer; 8010478: 5b 83 00 10 sw (sp+16),r3 the_jnode = iop->pathinfo.node_access; status = rtems_io_control( 801047c: 28 41 00 50 lw r1,(r2+80) 8010480: 28 42 00 54 lw r2,(r2+84) 8010484: 37 83 00 08 addi r3,sp,8 8010488: f8 00 02 b5 calli 8010f5c the_jnode->info.device.major, the_jnode->info.device.minor, (void *) &args ); if ( status ) 801048c: 44 20 00 03 be r1,r0,8010498 <== ALWAYS TAKEN return rtems_deviceio_errno(status); 8010490: f8 00 03 96 calli 80112e8 <== NOT EXECUTED 8010494: e0 00 00 02 bi 801049c <== NOT EXECUTED return args.ioctl_return; 8010498: 2b 81 00 14 lw r1,(sp+20) } 801049c: 2b 9d 00 04 lw ra,(sp+4) 80104a0: 37 9c 00 14 addi sp,sp,20 80104a4: c3 a0 00 00 ret =============================================================================== 080103a4 : ssize_t device_read( rtems_libio_t *iop, void *buffer, size_t count ) { 80103a4: 37 9c ff dc addi sp,sp,-36 80103a8: 5b 9d 00 04 sw (sp+4),ra rtems_status_code status; IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; args.iop = iop; 80103ac: 5b 81 00 08 sw (sp+8),r1 args.offset = iop->offset; 80103b0: 28 25 00 14 lw r5,(r1+20) { rtems_libio_rw_args_t args; rtems_status_code status; IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 80103b4: 28 24 00 1c lw r4,(r1+28) args.iop = iop; args.offset = iop->offset; 80103b8: 5b 85 00 14 sw (sp+20),r5 80103bc: 28 25 00 10 lw r5,(r1+16) args.buffer = buffer; 80103c0: 5b 82 00 18 sw (sp+24),r2 args.count = count; 80103c4: 5b 83 00 1c sw (sp+28),r3 IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; args.iop = iop; args.offset = iop->offset; 80103c8: 5b 85 00 10 sw (sp+16),r5 args.buffer = buffer; args.count = count; args.flags = iop->flags; 80103cc: 28 21 00 18 lw r1,(r1+24) args.bytes_moved = 0; status = rtems_io_read( 80103d0: 28 82 00 54 lw r2,(r4+84) 80103d4: 37 83 00 08 addi r3,sp,8 args.iop = iop; args.offset = iop->offset; args.buffer = buffer; args.count = count; args.flags = iop->flags; 80103d8: 5b 81 00 20 sw (sp+32),r1 args.bytes_moved = 0; status = rtems_io_read( 80103dc: 28 81 00 50 lw r1,(r4+80) args.iop = iop; args.offset = iop->offset; args.buffer = buffer; args.count = count; args.flags = iop->flags; args.bytes_moved = 0; 80103e0: 5b 80 00 24 sw (sp+36),r0 status = rtems_io_read( 80103e4: f8 00 03 28 calli 8011084 the_jnode->info.device.major, the_jnode->info.device.minor, (void *) &args ); if ( status ) 80103e8: 44 20 00 03 be r1,r0,80103f4 <== ALWAYS TAKEN return rtems_deviceio_errno(status); 80103ec: f8 00 03 bf calli 80112e8 <== NOT EXECUTED 80103f0: e0 00 00 02 bi 80103f8 <== NOT EXECUTED return (ssize_t) args.bytes_moved; 80103f4: 2b 81 00 24 lw r1,(sp+36) } 80103f8: 2b 9d 00 04 lw ra,(sp+4) 80103fc: 37 9c 00 24 addi sp,sp,36 8010400: c3 a0 00 00 ret =============================================================================== 08010404 : ssize_t device_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 8010404: 37 9c ff dc addi sp,sp,-36 8010408: 5b 9d 00 04 sw (sp+4),ra rtems_status_code status; IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; args.iop = iop; 801040c: 5b 81 00 08 sw (sp+8),r1 args.offset = iop->offset; 8010410: 28 25 00 14 lw r5,(r1+20) { rtems_libio_rw_args_t args; rtems_status_code status; IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 8010414: 28 24 00 1c lw r4,(r1+28) args.iop = iop; args.offset = iop->offset; 8010418: 5b 85 00 14 sw (sp+20),r5 801041c: 28 25 00 10 lw r5,(r1+16) args.buffer = (void *) buffer; 8010420: 5b 82 00 18 sw (sp+24),r2 args.count = count; 8010424: 5b 83 00 1c sw (sp+28),r3 IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; args.iop = iop; args.offset = iop->offset; 8010428: 5b 85 00 10 sw (sp+16),r5 args.buffer = (void *) buffer; args.count = count; args.flags = iop->flags; 801042c: 28 21 00 18 lw r1,(r1+24) args.bytes_moved = 0; status = rtems_io_write( 8010430: 28 82 00 54 lw r2,(r4+84) 8010434: 37 83 00 08 addi r3,sp,8 args.iop = iop; args.offset = iop->offset; args.buffer = (void *) buffer; args.count = count; args.flags = iop->flags; 8010438: 5b 81 00 20 sw (sp+32),r1 args.bytes_moved = 0; status = rtems_io_write( 801043c: 28 81 00 50 lw r1,(r4+80) args.iop = iop; args.offset = iop->offset; args.buffer = (void *) buffer; args.count = count; args.flags = iop->flags; args.bytes_moved = 0; 8010440: 5b 80 00 24 sw (sp+36),r0 status = rtems_io_write( 8010444: f8 00 03 35 calli 8011118 the_jnode->info.device.major, the_jnode->info.device.minor, (void *) &args ); if ( status ) 8010448: 44 20 00 03 be r1,r0,8010454 <== ALWAYS TAKEN return rtems_deviceio_errno(status); 801044c: f8 00 03 a7 calli 80112e8 <== NOT EXECUTED 8010450: e0 00 00 02 bi 8010458 <== NOT EXECUTED return (ssize_t) args.bytes_moved; 8010454: 2b 81 00 24 lw r1,(sp+36) } 8010458: 2b 9d 00 04 lw ra,(sp+4) 801045c: 37 9c 00 24 addi sp,sp,36 8010460: c3 a0 00 00 ret =============================================================================== 08004774 : /* * Drain output queue */ static void drainOutput (struct rtems_termios_tty *tty) { 8004774: 37 9c ff f0 addi sp,sp,-16 8004778: 5b 8b 00 10 sw (sp+16),r11 800477c: 5b 8c 00 0c sw (sp+12),r12 8004780: 5b 8d 00 08 sw (sp+8),r13 8004784: 5b 9d 00 04 sw (sp+4),ra 8004788: b8 20 58 00 mv r11,r1 rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { 800478c: 28 21 00 b4 lw r1,(r1+180) 8004790: 44 20 00 17 be r1,r0,80047ec rtems_interrupt_disable (level); 8004794: 90 00 08 00 rcsr r1,IE 8004798: 34 02 ff fe mvi r2,-2 800479c: a0 22 10 00 and r2,r1,r2 80047a0: d0 02 00 00 wcsr IE,r2 while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { tty->rawOutBufState = rob_wait; 80047a4: 34 0d 00 02 mvi r13,2 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); rtems_interrupt_disable (level); 80047a8: 34 0c ff fe mvi r12,-2 rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { 80047ac: e0 00 00 0c bi 80047dc tty->rawOutBufState = rob_wait; 80047b0: 59 6d 00 94 sw (r11+148),r13 <== NOT EXECUTED rtems_interrupt_enable (level); 80047b4: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED sc = rtems_semaphore_obtain( 80047b8: 29 61 00 8c lw r1,(r11+140) <== NOT EXECUTED 80047bc: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 80047c0: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 80047c4: f8 00 0a 0b calli 8006ff0 <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 80047c8: 44 20 00 02 be r1,r0,80047d0 <== NOT EXECUTED rtems_fatal_error_occurred (sc); 80047cc: f8 00 0b e6 calli 8007764 <== NOT EXECUTED rtems_interrupt_disable (level); 80047d0: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED 80047d4: a0 2c 10 00 and r2,r1,r12 <== NOT EXECUTED 80047d8: d0 02 00 00 wcsr IE,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) { 80047dc: 29 63 00 84 lw r3,(r11+132) 80047e0: 29 62 00 80 lw r2,(r11+128) 80047e4: 5c 62 ff f3 bne r3,r2,80047b0 <== NEVER TAKEN tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } rtems_interrupt_enable (level); 80047e8: d0 01 00 00 wcsr IE,r1 } } 80047ec: 2b 9d 00 04 lw ra,(sp+4) 80047f0: 2b 8b 00 10 lw r11,(sp+16) 80047f4: 2b 8c 00 0c lw r12,(sp+12) 80047f8: 2b 8d 00 08 lw r13,(sp+8) 80047fc: 37 9c 00 10 addi sp,sp,16 8004800: c3 a0 00 00 ret =============================================================================== 08001bc0 : int dup2( int fildes, int fildes2 ) { 8001bc0: 37 9c ff a4 addi sp,sp,-92 8001bc4: 5b 8b 00 14 sw (sp+20),r11 8001bc8: 5b 8c 00 10 sw (sp+16),r12 8001bcc: 5b 8d 00 0c sw (sp+12),r13 8001bd0: 5b 8e 00 08 sw (sp+8),r14 8001bd4: 5b 9d 00 04 sw (sp+4),ra /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 8001bd8: 37 8d 00 18 addi r13,sp,24 int dup2( int fildes, int fildes2 ) { 8001bdc: b8 40 60 00 mv r12,r2 /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 8001be0: b9 a0 10 00 mv r2,r13 int dup2( int fildes, int fildes2 ) { 8001be4: b8 20 70 00 mv r14,r1 * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); if ( status == -1 ) return -1; 8001be8: 34 0b ff ff mvi r11,-1 /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 8001bec: f8 00 01 c2 calli 80022f4 if ( status == -1 ) 8001bf0: 44 2b 00 0a be r1,r11,8001c18 <== NEVER TAKEN /* * If fildes2 is not valid, then we should not do anything either. */ status = fstat( fildes2, &buf ); 8001bf4: b9 80 08 00 mv r1,r12 8001bf8: b9 a0 10 00 mv r2,r13 8001bfc: f8 00 01 be calli 80022f4 if ( status == -1 ) 8001c00: 44 2b 00 06 be r1,r11,8001c18 <== ALWAYS TAKEN /* * This fcntl handles everything else. */ return fcntl( fildes, F_DUPFD, fildes2 ); 8001c04: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 8001c08: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 8001c0c: b9 80 18 00 mv r3,r12 <== NOT EXECUTED 8001c10: f8 00 00 90 calli 8001e50 <== NOT EXECUTED 8001c14: b8 20 58 00 mv r11,r1 <== NOT EXECUTED } 8001c18: b9 60 08 00 mv r1,r11 8001c1c: 2b 9d 00 04 lw ra,(sp+4) 8001c20: 2b 8b 00 14 lw r11,(sp+20) 8001c24: 2b 8c 00 10 lw r12,(sp+16) 8001c28: 2b 8d 00 0c lw r13,(sp+12) 8001c2c: 2b 8e 00 08 lw r14,(sp+8) 8001c30: 37 9c 00 5c addi sp,sp,92 8001c34: c3 a0 00 00 ret =============================================================================== 0800553c : /* * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { 800553c: 37 9c ff f4 addi sp,sp,-12 8005540: 5b 8b 00 08 sw (sp+8),r11 8005544: 5b 9d 00 04 sw (sp+4),ra 8005548: b8 40 58 00 mv r11,r2 if ((tty->termios.c_lflag & ECHOCTL) && 800554c: 28 42 00 3c lw r2,(r2+60) 8005550: 20 42 02 00 andi r2,r2,0x200 8005554: 44 40 00 19 be r2,r0,80055b8 <== NEVER TAKEN iscntrl(c) && (c != '\t') && (c != '\n')) { 8005558: 78 02 08 02 mvhi r2,0x802 800555c: 38 42 33 10 ori r2,r2,0x3310 8005560: 28 42 00 00 lw r2,(r2+0) 8005564: 7c 23 00 09 cmpnei r3,r1,9 8005568: b4 41 10 00 add r2,r2,r1 800556c: 40 42 00 01 lbu r2,(r2+1) 8005570: 20 42 00 20 andi r2,r2,0x20 * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { if ((tty->termios.c_lflag & ECHOCTL) && 8005574: 7c 42 00 00 cmpnei r2,r2,0 iscntrl(c) && (c != '\t') && (c != '\n')) { 8005578: a0 43 10 00 and r2,r2,r3 800557c: 44 40 00 0f be r2,r0,80055b8 8005580: 34 02 00 0a mvi r2,10 8005584: 44 22 00 0d be r1,r2,80055b8 char echobuf[2]; echobuf[0] = '^'; 8005588: 34 02 00 5e mvi r2,94 echobuf[1] = c ^ 0x40; 800558c: 18 21 00 40 xori r1,r1,0x40 { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { char echobuf[2]; echobuf[0] = '^'; 8005590: 33 82 00 0c sb (sp+12),r2 echobuf[1] = c ^ 0x40; 8005594: 33 81 00 0d sb (sp+13),r1 rtems_termios_puts (echobuf, 2, tty); 8005598: 34 02 00 02 mvi r2,2 800559c: 37 81 00 0c addi r1,sp,12 80055a0: b9 60 18 00 mv r3,r11 80055a4: fb ff ff 34 calli 8005274 tty->column += 2; 80055a8: 29 61 00 28 lw r1,(r11+40) 80055ac: 34 21 00 02 addi r1,r1,2 80055b0: 59 61 00 28 sw (r11+40),r1 */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { 80055b4: e0 00 00 03 bi 80055c0 echobuf[0] = '^'; echobuf[1] = c ^ 0x40; rtems_termios_puts (echobuf, 2, tty); tty->column += 2; } else { oproc (c, tty); 80055b8: b9 60 10 00 mv r2,r11 80055bc: fb ff ff 84 calli 80053cc } } 80055c0: 2b 9d 00 04 lw ra,(sp+4) 80055c4: 2b 8b 00 08 lw r11,(sp+8) 80055c8: 37 9c 00 0c addi sp,sp,12 80055cc: c3 a0 00 00 ret =============================================================================== 08002744 : void endgrent(void) { 8002744: 37 9c ff fc addi sp,sp,-4 8002748: 5b 9d 00 04 sw (sp+4),ra if (group_fp != NULL) 800274c: 78 01 08 01 mvhi r1,0x801 8002750: 38 21 66 b4 ori r1,r1,0x66b4 8002754: 28 21 00 00 lw r1,(r1+0) 8002758: 44 20 00 02 be r1,r0,8002760 <== NEVER TAKEN fclose(group_fp); 800275c: f8 00 2c a6 calli 800d9f4 } 8002760: 2b 9d 00 04 lw ra,(sp+4) 8002764: 37 9c 00 04 addi sp,sp,4 8002768: c3 a0 00 00 ret =============================================================================== 0800257c : void endpwent(void) { 800257c: 37 9c ff fc addi sp,sp,-4 8002580: 5b 9d 00 04 sw (sp+4),ra if (passwd_fp != NULL) 8002584: 78 01 08 01 mvhi r1,0x801 8002588: 38 21 67 90 ori r1,r1,0x6790 800258c: 28 21 00 00 lw r1,(r1+0) 8002590: 44 20 00 02 be r1,r0,8002598 <== NEVER TAKEN fclose(passwd_fp); 8002594: f8 00 2d 18 calli 800d9f4 } 8002598: 2b 9d 00 04 lw ra,(sp+4) 800259c: 37 9c 00 04 addi sp,sp,4 80025a0: c3 a0 00 00 ret =============================================================================== 080055d0 : * 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) { 80055d0: 37 9c ff e0 addi sp,sp,-32 80055d4: 5b 8b 00 20 sw (sp+32),r11 80055d8: 5b 8c 00 1c sw (sp+28),r12 80055dc: 5b 8d 00 18 sw (sp+24),r13 80055e0: 5b 8e 00 14 sw (sp+20),r14 80055e4: 5b 8f 00 10 sw (sp+16),r15 80055e8: 5b 90 00 0c sw (sp+12),r16 80055ec: 5b 91 00 08 sw (sp+8),r17 80055f0: 5b 9d 00 04 sw (sp+4),ra 80055f4: b8 20 58 00 mv r11,r1 if (tty->ccount == 0) 80055f8: 28 21 00 20 lw r1,(r1+32) * 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) { 80055fc: b8 40 78 00 mv r15,r2 if (tty->ccount == 0) 8005600: 44 20 00 6c be r1,r0,80057b0 return; if (lineFlag) { 8005604: 44 40 00 62 be r2,r0,800578c if (!(tty->termios.c_lflag & ECHO)) { 8005608: 29 6c 00 3c lw r12,(r11+60) 800560c: 21 81 00 08 andi r1,r12,0x8 8005610: 5c 20 00 03 bne r1,r0,800561c <== ALWAYS TAKEN tty->ccount = 0; 8005614: 59 60 00 20 sw (r11+32),r0 <== NOT EXECUTED return; 8005618: e0 00 00 66 bi 80057b0 <== NOT EXECUTED } if (!(tty->termios.c_lflag & ECHOE)) { 800561c: 21 8c 00 10 andi r12,r12,0x10 8005620: 5d 80 00 5b bne r12,r0,800578c <== ALWAYS TAKEN tty->ccount = 0; echo (tty->termios.c_cc[VKILL], tty); 8005624: 41 61 00 44 lbu r1,(r11+68) <== NOT EXECUTED if (!(tty->termios.c_lflag & ECHO)) { tty->ccount = 0; return; } if (!(tty->termios.c_lflag & ECHOE)) { tty->ccount = 0; 8005628: 59 60 00 20 sw (r11+32),r0 <== NOT EXECUTED echo (tty->termios.c_cc[VKILL], tty); 800562c: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8005630: fb ff ff c3 calli 800553c <== NOT EXECUTED if (tty->termios.c_lflag & ECHOK) 8005634: 29 61 00 3c lw r1,(r11+60) <== NOT EXECUTED 8005638: 20 21 00 20 andi r1,r1,0x20 <== NOT EXECUTED 800563c: 44 2c 00 5d be r1,r12,80057b0 <== NOT EXECUTED echo ('\n', tty); 8005640: 34 01 00 0a mvi r1,10 <== NOT EXECUTED 8005644: e0 00 00 0d bi 8005678 <== NOT EXECUTED return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 8005648: 29 64 00 1c lw r4,(r11+28) 800564c: 34 21 ff ff addi r1,r1,-1 8005650: 59 61 00 20 sw (r11+32),r1 8005654: b4 81 10 00 add r2,r4,r1 8005658: 40 4c 00 00 lbu r12,(r2+0) if (tty->termios.c_lflag & ECHO) { 800565c: 29 62 00 3c lw r2,(r11+60) 8005660: 20 43 00 08 andi r3,r2,0x8 8005664: 44 60 00 48 be r3,r0,8005784 <== NEVER TAKEN if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { 8005668: 5d e0 00 07 bne r15,r0,8005684 800566c: 20 43 00 10 andi r3,r2,0x10 8005670: 5c 6f 00 05 bne r3,r15,8005684 <== ALWAYS TAKEN echo (tty->termios.c_cc[VERASE], tty); 8005674: 41 61 00 43 lbu r1,(r11+67) <== NOT EXECUTED 8005678: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 800567c: fb ff ff b0 calli 800553c <== NOT EXECUTED 8005680: e0 00 00 4c bi 80057b0 <== NOT EXECUTED } else if (c == '\t') { 8005684: 5d 91 00 20 bne r12,r17,8005704 int col = tty->read_start_column; 8005688: 29 6c 00 2c lw r12,(r11+44) */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { 800568c: 29 a6 00 00 lw r6,(r13+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; int i = 0; 8005690: 34 03 00 00 mvi r3,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) 8005694: 20 42 02 00 andi r2,r2,0x200 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 8005698: e0 00 00 0f bi 80056d4 * Erase a character or line * 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) 800569c: b4 83 28 00 add r5,r4,r3 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; 80056a0: 40 a5 00 00 lbu r5,(r5+0) 80056a4: 34 63 00 01 addi r3,r3,1 if (c == '\t') { 80056a8: 5c b1 00 03 bne r5,r17,80056b4 col = (col | 7) + 1; 80056ac: 39 8c 00 07 ori r12,r12,0x7 80056b0: e0 00 00 08 bi 80056d0 } else if (iscntrl (c)) { 80056b4: b4 c5 28 00 add r5,r6,r5 80056b8: 40 a5 00 01 lbu r5,(r5+1) 80056bc: 20 a5 00 20 andi r5,r5,0x20 80056c0: 44 a0 00 04 be r5,r0,80056d0 <== ALWAYS TAKEN if (tty->termios.c_lflag & ECHOCTL) 80056c4: 44 40 00 04 be r2,r0,80056d4 <== NOT EXECUTED col += 2; 80056c8: 35 8c 00 02 addi r12,r12,2 <== NOT EXECUTED 80056cc: e0 00 00 02 bi 80056d4 <== NOT EXECUTED } else { col++; 80056d0: 35 8c 00 01 addi r12,r12,1 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 80056d4: 5c 61 ff f2 bne r3,r1,800569c 80056d8: e0 00 00 08 bi 80056f8 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 80056dc: ba 00 08 00 mv r1,r16 80056e0: 34 02 00 01 mvi r2,1 80056e4: b9 60 18 00 mv r3,r11 80056e8: fb ff fe e3 calli 8005274 tty->column--; 80056ec: 29 61 00 28 lw r1,(r11+40) 80056f0: 34 21 ff ff addi r1,r1,-1 80056f4: 59 61 00 28 sw (r11+40),r1 } /* * Back up over the tab */ while (tty->column > col) { 80056f8: 29 61 00 28 lw r1,(r11+40) 80056fc: 48 2c ff f8 bg r1,r12,80056dc 8005700: e0 00 00 21 bi 8005784 rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 8005704: 29 a1 00 00 lw r1,(r13+0) 8005708: 35 8c 00 01 addi r12,r12,1 800570c: b4 2c 08 00 add r1,r1,r12 8005710: 40 21 00 00 lbu r1,(r1+0) 8005714: 20 21 00 20 andi r1,r1,0x20 8005718: 44 20 00 0b be r1,r0,8005744 <== ALWAYS TAKEN 800571c: 20 42 02 00 andi r2,r2,0x200 <== NOT EXECUTED 8005720: 44 40 00 09 be r2,r0,8005744 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 8005724: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 8005728: 34 02 00 03 mvi r2,3 <== NOT EXECUTED 800572c: b9 60 18 00 mv r3,r11 <== NOT EXECUTED 8005730: fb ff fe d1 calli 8005274 <== NOT EXECUTED if (tty->column) 8005734: 29 61 00 28 lw r1,(r11+40) <== NOT EXECUTED 8005738: 44 20 00 03 be r1,r0,8005744 <== NOT EXECUTED tty->column--; 800573c: 34 21 ff ff addi r1,r1,-1 <== NOT EXECUTED 8005740: 59 61 00 28 sw (r11+40),r1 <== NOT EXECUTED } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { 8005744: 29 a1 00 00 lw r1,(r13+0) 8005748: b4 2c 60 00 add r12,r1,r12 800574c: 41 81 00 00 lbu r1,(r12+0) 8005750: 20 21 00 20 andi r1,r1,0x20 8005754: 44 20 00 04 be r1,r0,8005764 <== ALWAYS TAKEN 8005758: 29 61 00 3c lw r1,(r11+60) <== NOT EXECUTED 800575c: 20 21 02 00 andi r1,r1,0x200 <== NOT EXECUTED 8005760: 44 20 00 09 be r1,r0,8005784 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 8005764: b9 c0 08 00 mv r1,r14 8005768: 34 02 00 03 mvi r2,3 800576c: b9 60 18 00 mv r3,r11 8005770: fb ff fe c1 calli 8005274 if (tty->column) 8005774: 29 61 00 28 lw r1,(r11+40) 8005778: 44 20 00 03 be r1,r0,8005784 <== NEVER TAKEN tty->column--; 800577c: 34 21 ff ff addi r1,r1,-1 8005780: 59 61 00 28 sw (r11+40),r1 } } } if (!lineFlag) 8005784: 5d e0 00 09 bne r15,r0,80057a8 8005788: e0 00 00 0a bi 80057b0 800578c: 78 0d 08 02 mvhi r13,0x802 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); 8005790: 78 0e 08 02 mvhi r14,0x802 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 8005794: 78 10 08 02 mvhi r16,0x802 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); } else if (c == '\t') { 8005798: 34 11 00 09 mvi r17,9 800579c: 39 ad 33 10 ori r13,r13,0x3310 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); 80057a0: 39 ce 0b b4 ori r14,r14,0xbb4 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 80057a4: 3a 10 0b b0 ori r16,r16,0xbb0 echo ('\n', tty); return; } } while (tty->ccount) { 80057a8: 29 61 00 20 lw r1,(r11+32) 80057ac: 5c 20 ff a7 bne r1,r0,8005648 } } if (!lineFlag) break; } } 80057b0: 2b 9d 00 04 lw ra,(sp+4) 80057b4: 2b 8b 00 20 lw r11,(sp+32) 80057b8: 2b 8c 00 1c lw r12,(sp+28) 80057bc: 2b 8d 00 18 lw r13,(sp+24) 80057c0: 2b 8e 00 14 lw r14,(sp+20) 80057c4: 2b 8f 00 10 lw r15,(sp+16) 80057c8: 2b 90 00 0c lw r16,(sp+12) 80057cc: 2b 91 00 08 lw r17,(sp+8) 80057d0: 37 9c 00 20 addi sp,sp,32 80057d4: c3 a0 00 00 ret =============================================================================== 08001e50 : int fcntl( int fd, int cmd, ... ) { 8001e50: 37 9c ff c4 addi sp,sp,-60 8001e54: 5b 8b 00 20 sw (sp+32),r11 8001e58: 5b 8c 00 1c sw (sp+28),r12 8001e5c: 5b 8d 00 18 sw (sp+24),r13 8001e60: 5b 8e 00 14 sw (sp+20),r14 8001e64: 5b 8f 00 10 sw (sp+16),r15 8001e68: 5b 90 00 0c sw (sp+12),r16 8001e6c: 5b 91 00 08 sw (sp+8),r17 8001e70: 5b 9d 00 04 sw (sp+4),ra 8001e74: 5b 82 00 24 sw (sp+36),r2 8001e78: b8 40 68 00 mv r13,r2 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 8001e7c: 78 02 08 01 mvhi r2,0x801 int fcntl( int fd, int cmd, ... ) { 8001e80: 5b 83 00 28 sw (sp+40),r3 8001e84: 5b 84 00 2c sw (sp+44),r4 8001e88: 5b 85 00 30 sw (sp+48),r5 8001e8c: 5b 86 00 34 sw (sp+52),r6 8001e90: 5b 87 00 38 sw (sp+56),r7 8001e94: 5b 88 00 3c sw (sp+60),r8 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 8001e98: 38 42 60 10 ori r2,r2,0x6010 8001e9c: 28 51 00 00 lw r17,(r2+0) ... ) { int ret; va_list ap; va_start( ap, cmd ); 8001ea0: 37 8e 00 28 addi r14,sp,40 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 8001ea4: 56 21 00 02 bgu r17,r1,8001eac 8001ea8: e0 00 00 0a bi 8001ed0 iop = rtems_libio_iop( fd ); 8001eac: 78 02 08 01 mvhi r2,0x801 8001eb0: 38 42 67 2c ori r2,r2,0x672c 8001eb4: 28 50 00 00 lw r16,(r2+0) 8001eb8: 34 02 00 06 mvi r2,6 8001ebc: f8 00 46 9a calli 8013924 <__ashlsi3> 8001ec0: b6 01 58 00 add r11,r16,r1 rtems_libio_check_is_open(iop); 8001ec4: 29 6c 00 18 lw r12,(r11+24) 8001ec8: 21 81 01 00 andi r1,r12,0x100 8001ecc: 5c 20 00 04 bne r1,r0,8001edc 8001ed0: f8 00 2e 9c calli 800d940 <__errno> 8001ed4: 34 02 00 09 mvi r2,9 8001ed8: e0 00 00 49 bi 8001ffc /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 8001edc: 34 01 00 09 mvi r1,9 8001ee0: 55 a1 00 45 bgu r13,r1,8001ff4 8001ee4: 78 0f 08 01 mvhi r15,0x801 8001ee8: b9 a0 08 00 mv r1,r13 8001eec: 34 02 00 02 mvi r2,2 8001ef0: f8 00 46 8d calli 8013924 <__ashlsi3> 8001ef4: 39 ef 4b 70 ori r15,r15,0x4b70 8001ef8: b5 e1 08 00 add r1,r15,r1 8001efc: 28 21 00 00 lw r1,(r1+0) 8001f00: c0 20 00 00 b r1 case F_DUPFD: /* dup */ fd2 = va_arg( ap, int ); 8001f04: 29 cc 00 00 lw r12,(r14+0) if ( fd2 ) 8001f08: 45 80 00 08 be r12,r0,8001f28 <== ALWAYS TAKEN diop = rtems_libio_iop( fd2 ); 8001f0c: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 8001f10: 51 91 00 09 bgeu r12,r17,8001f34 <== NOT EXECUTED 8001f14: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8001f18: 34 02 00 06 mvi r2,6 <== NOT EXECUTED 8001f1c: f8 00 46 82 calli 8013924 <__ashlsi3> <== NOT EXECUTED 8001f20: b6 01 18 00 add r3,r16,r1 <== NOT EXECUTED 8001f24: e0 00 00 04 bi 8001f34 <== NOT EXECUTED else { /* allocate a file control block */ diop = rtems_libio_allocate(); 8001f28: f8 00 01 e6 calli 80026c0 8001f2c: b8 20 18 00 mv r3,r1 if ( diop == 0 ) { 8001f30: 44 2c 00 3e be r1,r12,8002028 <== NEVER TAKEN ret = -1; break; } } diop->flags = iop->flags; 8001f34: 29 61 00 18 lw r1,(r11+24) diop->pathinfo = iop->pathinfo; 8001f38: 29 62 00 28 lw r2,(r11+40) 8001f3c: 29 66 00 1c lw r6,(r11+28) ret = -1; break; } } diop->flags = iop->flags; 8001f40: 58 61 00 18 sw (r3+24),r1 diop->pathinfo = iop->pathinfo; 8001f44: 29 61 00 2c lw r1,(r11+44) 8001f48: 29 65 00 20 lw r5,(r11+32) 8001f4c: 29 64 00 24 lw r4,(r11+36) 8001f50: 58 61 00 2c sw (r3+44),r1 ret = (int) (diop - rtems_libio_iops); 8001f54: 78 01 08 01 mvhi r1,0x801 8001f58: 38 21 67 2c ori r1,r1,0x672c 8001f5c: 28 21 00 00 lw r1,(r1+0) break; } } diop->flags = iop->flags; diop->pathinfo = iop->pathinfo; 8001f60: 58 62 00 28 sw (r3+40),r2 8001f64: 58 66 00 1c sw (r3+28),r6 8001f68: 58 65 00 20 sw (r3+32),r5 8001f6c: 58 64 00 24 sw (r3+36),r4 ret = (int) (diop - rtems_libio_iops); 8001f70: c8 61 08 00 sub r1,r3,r1 8001f74: 34 02 00 06 mvi r2,6 8001f78: f8 00 46 92 calli 80139c0 <__ashrsi3> 8001f7c: e0 00 00 0e bi 8001fb4 break; case F_GETFD: /* get f_flags */ ret = ((iop->flags & LIBIO_FLAGS_CLOSE_ON_EXEC) != 0); 8001f80: 21 8c 08 00 andi r12,r12,0x800 8001f84: 7d 8c 00 00 cmpnei r12,r12,0 8001f88: e0 00 00 1f bi 8002004 * 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 ) ) 8001f8c: 29 c1 00 00 lw r1,(r14+0) 8001f90: 44 20 00 03 be r1,r0,8001f9c <== NEVER TAKEN iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 8001f94: 39 8c 08 00 ori r12,r12,0x800 8001f98: e0 00 00 03 bi 8001fa4 else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 8001f9c: 34 01 f7 ff mvi r1,-2049 <== NOT EXECUTED 8001fa0: a1 81 60 00 and r12,r12,r1 <== NOT EXECUTED 8001fa4: 59 6c 00 18 sw (r11+24),r12 8001fa8: e0 00 00 0e bi 8001fe0 break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); 8001fac: b9 80 08 00 mv r1,r12 8001fb0: f8 00 01 b0 calli 8002670 8001fb4: b8 20 60 00 mv r12,r1 /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 8001fb8: 48 01 00 1d bg r0,r1,800202c <== NEVER TAKEN 8001fbc: e0 00 00 12 bi 8002004 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 ) ); 8001fc0: 29 c1 00 00 lw r1,(r14+0) 8001fc4: f8 00 01 95 calli 8002618 /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); 8001fc8: 29 63 00 18 lw r3,(r11+24) 8001fcc: 34 02 fd fe mvi r2,-514 8001fd0: 20 21 02 01 andi r1,r1,0x201 8001fd4: a0 43 10 00 and r2,r2,r3 8001fd8: b8 22 08 00 or r1,r1,r2 8001fdc: 59 61 00 18 sw (r11+24),r1 rtems_libio_t *iop; rtems_libio_t *diop; int fd2; int flags; int mask; int ret = 0; 8001fe0: 34 0c 00 00 mvi r12,0 8001fe4: e0 00 00 08 bi 8002004 errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 8001fe8: f8 00 2e 56 calli 800d940 <__errno> 8001fec: 34 02 00 86 mvi r2,134 8001ff0: e0 00 00 03 bi 8001ffc ret = -1; break; default: errno = EINVAL; 8001ff4: f8 00 2e 53 calli 800d940 <__errno> 8001ff8: 34 02 00 16 mvi r2,22 8001ffc: 58 22 00 00 sw (r1+0),r2 8002000: e0 00 00 0a bi 8002028 * 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 ); 8002004: 29 61 00 24 lw r1,(r11+36) 8002008: b9 60 10 00 mv r2,r11 800200c: 28 23 00 30 lw r3,(r1+48) 8002010: b9 a0 08 00 mv r1,r13 8002014: d8 60 00 00 call r3 8002018: b8 20 58 00 mv r11,r1 if (err) { 800201c: 44 20 00 04 be r1,r0,800202c <== ALWAYS TAKEN errno = err; 8002020: f8 00 2e 48 calli 800d940 <__errno> <== NOT EXECUTED 8002024: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED ret = -1; 8002028: 34 0c ff ff mvi r12,-1 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 800202c: b9 80 08 00 mv r1,r12 8002030: 2b 9d 00 04 lw ra,(sp+4) 8002034: 2b 8b 00 20 lw r11,(sp+32) 8002038: 2b 8c 00 1c lw r12,(sp+28) 800203c: 2b 8d 00 18 lw r13,(sp+24) 8002040: 2b 8e 00 14 lw r14,(sp+20) 8002044: 2b 8f 00 10 lw r15,(sp+16) 8002048: 2b 90 00 0c lw r16,(sp+12) 800204c: 2b 91 00 08 lw r17,(sp+8) 8002050: 37 9c 00 3c addi sp,sp,60 8002054: c3 a0 00 00 ret =============================================================================== 08009978 : */ int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 8009978: 37 9c ff d4 addi sp,sp,-44 800997c: 5b 8b 00 24 sw (sp+36),r11 8009980: 5b 8c 00 20 sw (sp+32),r12 8009984: 5b 8d 00 1c sw (sp+28),r13 8009988: 5b 8e 00 18 sw (sp+24),r14 800998c: 5b 8f 00 14 sw (sp+20),r15 8009990: 5b 90 00 10 sw (sp+16),r16 8009994: 5b 91 00 0c sw (sp+12),r17 8009998: 5b 92 00 08 sw (sp+8),r18 800999c: 5b 9d 00 04 sw (sp+4),ra 80099a0: b8 20 78 00 mv r15,r1 80099a4: b8 40 70 00 mv r14,r2 ) { pipe_control_t *pipe; int err = 0; err = pipe_lock(); 80099a8: fb ff ff 62 calli 8009730 80099ac: b8 20 60 00 mv r12,r1 if (err) 80099b0: 5c 20 00 cc bne r1,r0,8009ce0 return err; pipe = *pipep; 80099b4: 29 eb 00 00 lw r11,(r15+0) if (pipe == NULL) { 80099b8: 5d 61 00 55 bne r11,r1,8009b0c { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); 80099bc: 34 01 00 34 mvi r1,52 80099c0: fb ff e5 9d calli 8003034 80099c4: b8 20 58 00 mv r11,r1 80099c8: b8 20 80 00 mv r16,r1 if (pipe == NULL) 80099cc: 44 20 00 4e be r1,r0,8009b04 return err; memset(pipe, 0, sizeof(pipe_control_t)); 80099d0: 34 02 00 00 mvi r2,0 80099d4: 34 03 00 34 mvi r3,52 80099d8: f8 00 15 fa calli 800f1c0 pipe->Size = PIPE_BUF; 80099dc: 34 01 02 00 mvi r1,512 80099e0: 59 61 00 04 sw (r11+4),r1 pipe->Buffer = malloc(pipe->Size); 80099e4: fb ff e5 94 calli 8003034 80099e8: 59 61 00 00 sw (r11+0),r1 if (! pipe->Buffer) 80099ec: 44 20 00 44 be r1,r0,8009afc <== NEVER TAKEN goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), 80099f0: 78 0d 08 02 mvhi r13,0x802 if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 80099f4: 78 03 08 01 mvhi r3,0x801 80099f8: 38 63 e4 24 ori r3,r3,0xe424 rtems_build_name ('P', 'I', 'r', c), 80099fc: 39 ad 01 20 ori r13,r13,0x120 8009a00: 41 a2 00 00 lbu r2,(r13+0) if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 8009a04: 28 61 00 00 lw r1,(r3+0) 8009a08: 35 64 00 2c addi r4,r11,44 8009a0c: 34 03 00 00 mvi r3,0 8009a10: b8 41 08 00 or r1,r2,r1 8009a14: 34 02 00 00 mvi r2,0 8009a18: f8 00 07 ad calli 800b8cc 8009a1c: 5c 20 00 36 bne r1,r0,8009af4 rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( 8009a20: 78 03 08 01 mvhi r3,0x801 8009a24: 38 63 e4 28 ori r3,r3,0xe428 rtems_build_name ('P', 'I', 'w', c), 8009a28: 41 a2 00 00 lbu r2,(r13+0) 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( 8009a2c: 28 61 00 00 lw r1,(r3+0) 8009a30: 35 64 00 30 addi r4,r11,48 8009a34: 34 03 00 00 mvi r3,0 8009a38: b8 41 08 00 or r1,r2,r1 8009a3c: 34 02 00 00 mvi r2,0 8009a40: f8 00 07 a3 calli 800b8cc 8009a44: 5c 20 00 2a bne r1,r0,8009aec rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( 8009a48: 78 03 08 01 mvhi r3,0x801 8009a4c: 38 63 e4 2c ori r3,r3,0xe42c rtems_build_name ('P', 'I', 's', c), 1, 8009a50: 41 a2 00 00 lbu r2,(r13+0) 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( 8009a54: 28 61 00 00 lw r1,(r3+0) 8009a58: 34 04 00 00 mvi r4,0 8009a5c: 34 03 00 10 mvi r3,16 8009a60: b8 41 08 00 or r1,r2,r1 8009a64: 35 65 00 28 addi r5,r11,40 8009a68: 34 02 00 01 mvi r2,1 8009a6c: fb ff ea 22 calli 80042f4 8009a70: 5c 20 00 1d bne r1,r0,8009ae4 Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) _Objects_Get( &_Barrier_Information, id, location ); 8009a74: 29 62 00 2c lw r2,(r11+44) 8009a78: 78 10 08 02 mvhi r16,0x802 8009a7c: 3a 10 11 20 ori r16,r16,0x1120 /* 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 8009a80: 37 92 00 28 addi r18,sp,40 8009a84: ba 40 18 00 mv r3,r18 8009a88: ba 00 08 00 mv r1,r16 8009a8c: fb ff f1 6f calli 8006048 <_Objects_Get> |= STATES_INTERRUPTIBLE_BY_SIGNAL; 8009a90: 28 22 00 4c lw r2,(r1+76) 8009a94: 78 11 10 00 mvhi r17,0x1000 8009a98: b8 51 10 00 or r2,r2,r17 8009a9c: 58 22 00 4c sw (r1+76),r2 _Thread_Enable_dispatch(); 8009aa0: fb ff f3 86 calli 80068b8 <_Thread_Enable_dispatch> 8009aa4: 29 62 00 30 lw r2,(r11+48) 8009aa8: ba 40 18 00 mv r3,r18 8009aac: ba 00 08 00 mv r1,r16 8009ab0: fb ff f1 66 calli 8006048 <_Objects_Get> _Barrier_Get(pipe->writeBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; 8009ab4: 28 22 00 4c lw r2,(r1+76) 8009ab8: b8 51 88 00 or r17,r2,r17 8009abc: 58 31 00 4c sw (r1+76),r17 _Thread_Enable_dispatch(); 8009ac0: fb ff f3 7e calli 80068b8 <_Thread_Enable_dispatch> #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 8009ac4: 41 a1 00 00 lbu r1,(r13+0) 8009ac8: 34 22 00 01 addi r2,r1,1 8009acc: 31 a2 00 00 sb (r13+0),r2 8009ad0: 34 02 00 7a mvi r2,122 8009ad4: 5c 22 00 0e bne r1,r2,8009b0c c = 'a'; 8009ad8: 34 01 00 61 mvi r1,97 8009adc: 31 a1 00 00 sb (r13+0),r1 8009ae0: e0 00 00 0b bi 8009b0c return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); 8009ae4: 29 61 00 30 lw r1,(r11+48) 8009ae8: f8 00 07 b5 calli 800b9bc err_wbar: rtems_barrier_delete(pipe->readBarrier); 8009aec: 2a 01 00 2c lw r1,(r16+44) 8009af0: f8 00 07 b3 calli 800b9bc err_rbar: free(pipe->Buffer); 8009af4: 2a 01 00 00 lw r1,(r16+0) 8009af8: fb ff e3 8d calli 800292c err_buf: free(pipe); 8009afc: ba 00 08 00 mv r1,r16 8009b00: fb ff e3 8b calli 800292c if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; 8009b04: 34 0c ff f4 mvi r12,-12 8009b08: e0 00 00 0e bi 8009b40 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 8009b0c: 29 61 00 28 lw r1,(r11+40) 8009b10: 34 02 00 00 mvi r2,0 8009b14: 34 03 00 00 mvi r3,0 8009b18: fb ff ea a3 calli 80045a4 8009b1c: 44 20 00 02 be r1,r0,8009b24 <== ALWAYS TAKEN err = -EINTR; 8009b20: 34 0c ff fc mvi r12,-4 <== NOT EXECUTED if (*pipep == NULL) { 8009b24: 29 e1 00 00 lw r1,(r15+0) 8009b28: 5c 20 00 06 bne r1,r0,8009b40 if (err) 8009b2c: 45 81 00 04 be r12,r1,8009b3c <== ALWAYS TAKEN pipe_free(pipe); 8009b30: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8009b34: fb ff ff 2e calli 80097ec <== NOT EXECUTED 8009b38: e0 00 00 02 bi 8009b40 <== NOT EXECUTED else *pipep = pipe; 8009b3c: 59 eb 00 00 sw (r15+0),r11 } out: pipe_unlock(); 8009b40: fb ff ff 3d calli 8009834 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) 8009b44: 5d 80 00 67 bne r12,r0,8009ce0 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { 8009b48: 29 c1 00 18 lw r1,(r14+24) 8009b4c: 34 02 00 04 mvi r2,4 int err; err = pipe_new(pipep); if (err) return err; pipe = *pipep; 8009b50: 29 eb 00 00 lw r11,(r15+0) switch (LIBIO_ACCMODE(iop)) { 8009b54: 20 21 00 06 andi r1,r1,0x6 8009b58: 44 22 00 24 be r1,r2,8009be8 8009b5c: 34 02 00 06 mvi r2,6 8009b60: 44 22 00 45 be r1,r2,8009c74 8009b64: 34 02 00 02 mvi r2,2 8009b68: 5c 22 00 57 bne r1,r2,8009cc4 <== NEVER TAKEN case LIBIO_FLAGS_READ: pipe->readerCounter ++; 8009b6c: 29 61 00 20 lw r1,(r11+32) 8009b70: 34 21 00 01 addi r1,r1,1 8009b74: 59 61 00 20 sw (r11+32),r1 if (pipe->Readers ++ == 0) 8009b78: 29 61 00 10 lw r1,(r11+16) 8009b7c: 34 22 00 01 addi r2,r1,1 8009b80: 59 62 00 10 sw (r11+16),r2 8009b84: 5c 20 00 04 bne r1,r0,8009b94 <== NEVER TAKEN PIPE_WAKEUPWRITERS(pipe); 8009b88: 29 61 00 30 lw r1,(r11+48) 8009b8c: 37 82 00 2c addi r2,sp,44 8009b90: f8 00 07 bb calli 800ba7c if (pipe->Writers == 0) { 8009b94: 29 61 00 14 lw r1,(r11+20) 8009b98: 5c 20 00 4b bne r1,r0,8009cc4 /* Not an error */ if (LIBIO_NODELAY(iop)) 8009b9c: 29 c2 00 18 lw r2,(r14+24) 8009ba0: 20 42 00 01 andi r2,r2,0x1 8009ba4: 5c 41 00 48 bne r2,r1,8009cc4 break; prevCounter = pipe->writerCounter; 8009ba8: 29 70 00 24 lw r16,(r11+36) err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); 8009bac: 29 61 00 28 lw r1,(r11+40) 8009bb0: fb ff ea cd calli 80046e4 if (! PIPE_READWAIT(pipe)) 8009bb4: 29 61 00 2c lw r1,(r11+44) 8009bb8: 34 02 00 00 mvi r2,0 8009bbc: f8 00 07 cd calli 800baf0 8009bc0: b8 20 68 00 mv r13,r1 8009bc4: 5c 20 00 43 bne r1,r0,8009cd0 <== NEVER TAKEN goto out_error; if (! PIPE_LOCK(pipe)) 8009bc8: 29 61 00 28 lw r1,(r11+40) 8009bcc: 34 02 00 00 mvi r2,0 8009bd0: 34 03 00 00 mvi r3,0 8009bd4: fb ff ea 74 calli 80045a4 8009bd8: 5c 2d 00 3e bne r1,r13,8009cd0 <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->writerCounter); 8009bdc: 29 61 00 24 lw r1,(r11+36) 8009be0: 46 01 ff f3 be r16,r1,8009bac <== NEVER TAKEN 8009be4: e0 00 00 38 bi 8009cc4 } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 8009be8: 29 61 00 24 lw r1,(r11+36) 8009bec: 34 21 00 01 addi r1,r1,1 8009bf0: 59 61 00 24 sw (r11+36),r1 if (pipe->Writers ++ == 0) 8009bf4: 29 61 00 14 lw r1,(r11+20) 8009bf8: 34 22 00 01 addi r2,r1,1 8009bfc: 59 62 00 14 sw (r11+20),r2 8009c00: 5c 20 00 04 bne r1,r0,8009c10 <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); 8009c04: 29 61 00 2c lw r1,(r11+44) 8009c08: 37 82 00 2c addi r2,sp,44 8009c0c: f8 00 07 9c calli 800ba7c if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { 8009c10: 29 61 00 10 lw r1,(r11+16) 8009c14: 5c 20 00 2c bne r1,r0,8009cc4 8009c18: 29 c2 00 18 lw r2,(r14+24) 8009c1c: 20 42 00 01 andi r2,r2,0x1 8009c20: 44 41 00 05 be r2,r1,8009c34 PIPE_UNLOCK(pipe); 8009c24: 29 61 00 28 lw r1,(r11+40) err = -ENXIO; 8009c28: 34 0c ff fa mvi r12,-6 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { PIPE_UNLOCK(pipe); 8009c2c: fb ff ea ae calli 80046e4 err = -ENXIO; goto out_error; 8009c30: e0 00 00 29 bi 8009cd4 } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; 8009c34: 29 70 00 20 lw r16,(r11+32) err = -EINTR; do { PIPE_UNLOCK(pipe); 8009c38: 29 61 00 28 lw r1,(r11+40) 8009c3c: fb ff ea aa calli 80046e4 if (! PIPE_WRITEWAIT(pipe)) 8009c40: 29 61 00 30 lw r1,(r11+48) 8009c44: 34 02 00 00 mvi r2,0 8009c48: f8 00 07 aa calli 800baf0 8009c4c: b8 20 68 00 mv r13,r1 8009c50: 5c 20 00 20 bne r1,r0,8009cd0 <== NEVER TAKEN goto out_error; if (! PIPE_LOCK(pipe)) 8009c54: 29 61 00 28 lw r1,(r11+40) 8009c58: 34 02 00 00 mvi r2,0 8009c5c: 34 03 00 00 mvi r3,0 8009c60: fb ff ea 51 calli 80045a4 8009c64: 5c 2d 00 1b bne r1,r13,8009cd0 <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->readerCounter); 8009c68: 29 61 00 20 lw r1,(r11+32) 8009c6c: 46 01 ff f3 be r16,r1,8009c38 <== NEVER TAKEN 8009c70: e0 00 00 15 bi 8009cc4 } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 8009c74: 29 61 00 20 lw r1,(r11+32) 8009c78: 34 21 00 01 addi r1,r1,1 8009c7c: 59 61 00 20 sw (r11+32),r1 if (pipe->Readers ++ == 0) 8009c80: 29 61 00 10 lw r1,(r11+16) 8009c84: 34 22 00 01 addi r2,r1,1 8009c88: 59 62 00 10 sw (r11+16),r2 8009c8c: 5c 20 00 04 bne r1,r0,8009c9c <== NEVER TAKEN PIPE_WAKEUPWRITERS(pipe); 8009c90: 29 61 00 30 lw r1,(r11+48) 8009c94: 37 82 00 2c addi r2,sp,44 8009c98: f8 00 07 79 calli 800ba7c pipe->writerCounter ++; 8009c9c: 29 61 00 24 lw r1,(r11+36) 8009ca0: 34 21 00 01 addi r1,r1,1 8009ca4: 59 61 00 24 sw (r11+36),r1 if (pipe->Writers ++ == 0) 8009ca8: 29 61 00 14 lw r1,(r11+20) 8009cac: 34 22 00 01 addi r2,r1,1 8009cb0: 59 62 00 14 sw (r11+20),r2 8009cb4: 5c 20 00 04 bne r1,r0,8009cc4 <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); 8009cb8: 29 61 00 2c lw r1,(r11+44) 8009cbc: 37 82 00 2c addi r2,sp,44 8009cc0: f8 00 07 6f calli 800ba7c break; } PIPE_UNLOCK(pipe); 8009cc4: 29 61 00 28 lw r1,(r11+40) 8009cc8: fb ff ea 87 calli 80046e4 return 0; 8009ccc: e0 00 00 05 bi 8009ce0 goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; 8009cd0: 34 0c ff fc mvi r12,-4 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); 8009cd4: b9 e0 08 00 mv r1,r15 8009cd8: b9 c0 10 00 mv r2,r14 8009cdc: fb ff fe e4 calli 800986c return err; } 8009ce0: b9 80 08 00 mv r1,r12 8009ce4: 2b 9d 00 04 lw ra,(sp+4) 8009ce8: 2b 8b 00 24 lw r11,(sp+36) 8009cec: 2b 8c 00 20 lw r12,(sp+32) 8009cf0: 2b 8d 00 1c lw r13,(sp+28) 8009cf4: 2b 8e 00 18 lw r14,(sp+24) 8009cf8: 2b 8f 00 14 lw r15,(sp+20) 8009cfc: 2b 90 00 10 lw r16,(sp+16) 8009d00: 2b 91 00 0c lw r17,(sp+12) 8009d04: 2b 92 00 08 lw r18,(sp+8) 8009d08: 37 9c 00 2c addi sp,sp,44 8009d0c: c3 a0 00 00 ret =============================================================================== 08002104 : long fpathconf( int fd, int name ) { 8002104: 37 9c ff f0 addi sp,sp,-16 8002108: 5b 8b 00 10 sw (sp+16),r11 800210c: 5b 8c 00 0c sw (sp+12),r12 8002110: 5b 8d 00 08 sw (sp+8),r13 8002114: 5b 9d 00 04 sw (sp+4),ra long return_value; rtems_libio_t *iop; rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); 8002118: 78 03 08 01 mvhi r3,0x801 800211c: 38 63 60 10 ori r3,r3,0x6010 long fpathconf( int fd, int name ) { 8002120: b8 40 68 00 mv r13,r2 long return_value; rtems_libio_t *iop; rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); 8002124: 28 62 00 00 lw r2,(r3+0) 8002128: 54 41 00 02 bgu r2,r1,8002130 800212c: e0 00 00 0a bi 8002154 iop = rtems_libio_iop(fd); 8002130: 34 02 00 06 mvi r2,6 8002134: 78 0b 08 01 mvhi r11,0x801 8002138: f8 00 45 fb calli 8013924 <__ashlsi3> 800213c: 39 6b 67 2c ori r11,r11,0x672c 8002140: 29 63 00 00 lw r3,(r11+0) 8002144: b4 61 18 00 add r3,r3,r1 rtems_libio_check_is_open(iop); 8002148: 28 61 00 18 lw r1,(r3+24) 800214c: 20 22 01 00 andi r2,r1,0x100 8002150: 5c 40 00 04 bne r2,r0,8002160 <== ALWAYS TAKEN 8002154: f8 00 2d fb calli 800d940 <__errno> 8002158: 34 02 00 09 mvi r2,9 800215c: e0 00 00 28 bi 80021fc rtems_libio_check_permissions(iop, LIBIO_FLAGS_READ); 8002160: 20 21 00 02 andi r1,r1,0x2 8002164: 44 20 00 24 be r1,r0,80021f4 <== NEVER TAKEN * Now process the information request. */ the_limits = &iop->pathinfo.mt_entry->pathconf_limits_and_options; switch ( name ) { 8002168: 34 01 00 0b mvi r1,11 /* * Now process the information request. */ the_limits = &iop->pathinfo.mt_entry->pathconf_limits_and_options; 800216c: 28 6b 00 2c lw r11,(r3+44) switch ( name ) { 8002170: 55 a1 00 21 bgu r13,r1,80021f4 8002174: 78 0c 08 01 mvhi r12,0x801 8002178: b9 a0 08 00 mv r1,r13 800217c: 34 02 00 02 mvi r2,2 8002180: f8 00 45 e9 calli 8013924 <__ashlsi3> 8002184: 39 8c 4b 98 ori r12,r12,0x4b98 8002188: b5 81 08 00 add r1,r12,r1 800218c: 28 21 00 00 lw r1,(r1+0) 8002190: c0 20 00 00 b r1 case _PC_LINK_MAX: return_value = the_limits->link_max; 8002194: 29 61 00 38 lw r1,(r11+56) break; 8002198: e0 00 00 1b bi 8002204 case _PC_MAX_CANON: return_value = the_limits->max_canon; 800219c: 29 61 00 3c lw r1,(r11+60) break; 80021a0: e0 00 00 19 bi 8002204 case _PC_MAX_INPUT: return_value = the_limits->max_input; 80021a4: 29 61 00 40 lw r1,(r11+64) break; 80021a8: e0 00 00 17 bi 8002204 case _PC_NAME_MAX: return_value = the_limits->name_max; 80021ac: 29 61 00 44 lw r1,(r11+68) break; 80021b0: e0 00 00 15 bi 8002204 case _PC_PATH_MAX: return_value = the_limits->path_max; 80021b4: 29 61 00 48 lw r1,(r11+72) break; 80021b8: e0 00 00 13 bi 8002204 case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 80021bc: 29 61 00 4c lw r1,(r11+76) break; 80021c0: e0 00 00 11 bi 8002204 case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 80021c4: 29 61 00 54 lw r1,(r11+84) break; 80021c8: e0 00 00 0f bi 8002204 case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 80021cc: 29 61 00 58 lw r1,(r11+88) break; 80021d0: e0 00 00 0d bi 8002204 case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 80021d4: 29 61 00 64 lw r1,(r11+100) break; 80021d8: e0 00 00 0b bi 8002204 case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 80021dc: 29 61 00 50 lw r1,(r11+80) break; 80021e0: e0 00 00 09 bi 8002204 case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 80021e4: 29 61 00 5c lw r1,(r11+92) break; 80021e8: e0 00 00 07 bi 8002204 case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 80021ec: 29 61 00 60 lw r1,(r11+96) break; 80021f0: e0 00 00 05 bi 8002204 default: rtems_set_errno_and_return_minus_one( EINVAL ); 80021f4: f8 00 2d d3 calli 800d940 <__errno> 80021f8: 34 02 00 16 mvi r2,22 80021fc: 58 22 00 00 sw (r1+0),r2 8002200: 34 01 ff ff mvi r1,-1 break; } return return_value; } 8002204: 2b 9d 00 04 lw ra,(sp+4) 8002208: 2b 8b 00 10 lw r11,(sp+16) 800220c: 2b 8c 00 0c lw r12,(sp+12) 8002210: 2b 8d 00 08 lw r13,(sp+8) 8002214: 37 9c 00 10 addi sp,sp,16 8002218: c3 a0 00 00 ret =============================================================================== 0800274c : #include void free( void *ptr ) { 800274c: 37 9c ff f4 addi sp,sp,-12 8002750: 5b 8b 00 0c sw (sp+12),r11 8002754: 5b 8c 00 08 sw (sp+8),r12 8002758: 5b 9d 00 04 sw (sp+4),ra 800275c: b8 20 58 00 mv r11,r1 MSBUMP(free_calls, 1); 8002760: 78 01 08 01 mvhi r1,0x801 8002764: 38 21 98 00 ori r1,r1,0x9800 8002768: 28 22 00 0c lw r2,(r1+12) 800276c: 34 42 00 01 addi r2,r2,1 8002770: 58 22 00 0c sw (r1+12),r2 if ( !ptr ) 8002774: 45 60 00 1f be r11,r0,80027f0 #endif /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 8002778: 78 01 08 01 mvhi r1,0x801 800277c: 38 21 9a a4 ori r1,r1,0x9aa4 8002780: 28 22 00 00 lw r2,(r1+0) 8002784: 34 01 00 03 mvi r1,3 8002788: 5c 41 00 06 bne r2,r1,80027a0 <== NEVER TAKEN !malloc_is_system_state_OK() ) { 800278c: f8 00 00 80 calli 800298c #endif /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 8002790: 5c 20 00 04 bne r1,r0,80027a0 !malloc_is_system_state_OK() ) { malloc_deferred_free(ptr); 8002794: b9 60 08 00 mv r1,r11 8002798: f8 00 00 9d calli 8002a0c return; 800279c: e0 00 00 15 bi 80027f0 } /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 80027a0: 78 01 08 01 mvhi r1,0x801 80027a4: 38 21 96 80 ori r1,r1,0x9680 80027a8: 28 21 00 00 lw r1,(r1+0) 80027ac: 44 20 00 04 be r1,r0,80027bc (*rtems_malloc_statistics_helpers->at_free)(ptr); 80027b0: 28 22 00 08 lw r2,(r1+8) 80027b4: b9 60 08 00 mv r1,r11 80027b8: d8 40 00 00 call r2 if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { 80027bc: 78 0c 08 01 mvhi r12,0x801 80027c0: 39 8c 90 1c ori r12,r12,0x901c 80027c4: 29 81 00 00 lw r1,(r12+0) 80027c8: b9 60 10 00 mv r2,r11 80027cc: f8 00 0e 0a calli 8005ff4 <_Protected_heap_Free> 80027d0: 5c 20 00 08 bne r1,r0,80027f0 printk( "Program heap: free of bad pointer %p -- range %p - %p \n", ptr, RTEMS_Malloc_Heap->area_begin, 80027d4: 29 84 00 00 lw r4,(r12+0) */ if ( rtems_malloc_statistics_helpers ) (*rtems_malloc_statistics_helpers->at_free)(ptr); if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { printk( "Program heap: free of bad pointer %p -- range %p - %p \n", 80027d8: 78 01 08 01 mvhi r1,0x801 80027dc: 38 21 7f 08 ori r1,r1,0x7f08 80027e0: 28 83 00 18 lw r3,(r4+24) 80027e4: 28 84 00 1c lw r4,(r4+28) 80027e8: b9 60 10 00 mv r2,r11 80027ec: f8 00 03 b6 calli 80036c4 RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } 80027f0: 2b 9d 00 04 lw ra,(sp+4) 80027f4: 2b 8b 00 0c lw r11,(sp+12) 80027f8: 2b 8c 00 08 lw r12,(sp+8) 80027fc: 37 9c 00 0c addi sp,sp,12 8002800: c3 a0 00 00 ret =============================================================================== 08002924 : * NOTE: this must be called with * thread dispatching disabled! */ static void free_user_env(void *venv) { 8002924: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED 8002928: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED 800292c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED 8002930: b8 20 58 00 mv r11,r1 <== NOT EXECUTED rtems_user_env_t *env = (rtems_user_env_t*) venv ; if (env != &rtems_global_user_env 8002934: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8002938: 38 21 47 50 ori r1,r1,0x4750 <== NOT EXECUTED 800293c: 45 61 00 07 be r11,r1,8002958 <== NOT EXECUTED #ifdef HAVE_USERENV_REFCNT && --env->refcnt <= 0 #endif ) { rtems_filesystem_freenode( &env->current_directory); 8002940: 35 61 00 04 addi r1,r11,4 <== NOT EXECUTED 8002944: fb ff fb 45 calli 8001658 <== NOT EXECUTED rtems_filesystem_freenode( &env->root_directory); 8002948: 35 61 00 18 addi r1,r11,24 <== NOT EXECUTED 800294c: fb ff fb 43 calli 8001658 <== NOT EXECUTED free(env); 8002950: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8002954: fb ff fb 49 calli 8001678 <== NOT EXECUTED } } 8002958: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800295c: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 8002960: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 8002964: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08013928 : int getdents( int dd_fd, char *dd_buf, int dd_len ) { 8013928: 37 9c ff dc addi sp,sp,-36 801392c: 5b 8b 00 10 sw (sp+16),r11 8013930: 5b 8c 00 0c sw (sp+12),r12 8013934: 5b 8d 00 08 sw (sp+8),r13 8013938: 5b 9d 00 04 sw (sp+4),ra rtems_filesystem_location_info_t loc; /* * Get the file control block structure associated with the file descriptor */ iop = rtems_libio_iop( dd_fd ); 801393c: 78 04 08 01 mvhi r4,0x801 8013940: 38 84 70 10 ori r4,r4,0x7010 int getdents( int dd_fd, char *dd_buf, int dd_len ) { 8013944: b8 40 68 00 mv r13,r2 rtems_filesystem_location_info_t loc; /* * Get the file control block structure associated with the file descriptor */ iop = rtems_libio_iop( dd_fd ); 8013948: 28 82 00 00 lw r2,(r4+0) int getdents( int dd_fd, char *dd_buf, int dd_len ) { 801394c: b8 60 60 00 mv r12,r3 rtems_filesystem_location_info_t loc; /* * Get the file control block structure associated with the file descriptor */ iop = rtems_libio_iop( dd_fd ); 8013950: 34 0b 00 00 mvi r11,0 8013954: 50 22 00 07 bgeu r1,r2,8013970 <== NEVER TAKEN 8013958: 78 0b 08 01 mvhi r11,0x801 801395c: 39 6b 78 38 ori r11,r11,0x7838 8013960: 34 02 00 06 mvi r2,6 8013964: fb ff b5 ec calli 8001114 <__ashlsi3> 8013968: 29 6b 00 00 lw r11,(r11+0) 801396c: b5 61 58 00 add r11,r11,r1 /* * Make sure we are working on a directory */ loc = iop->pathinfo; 8013970: 29 64 00 20 lw r4,(r11+32) 8013974: 29 61 00 28 lw r1,(r11+40) 8013978: 29 65 00 1c lw r5,(r11+28) 801397c: 29 62 00 2c lw r2,(r11+44) 8013980: 29 63 00 24 lw r3,(r11+36) 8013984: 5b 84 00 18 sw (sp+24),r4 if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) 8013988: 28 24 00 10 lw r4,(r1+16) iop = rtems_libio_iop( dd_fd ); /* * Make sure we are working on a directory */ loc = iop->pathinfo; 801398c: 5b 81 00 20 sw (sp+32),r1 8013990: 5b 82 00 24 sw (sp+36),r2 8013994: 5b 85 00 14 sw (sp+20),r5 8013998: 5b 83 00 1c sw (sp+28),r3 if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) 801399c: 37 81 00 14 addi r1,sp,20 80139a0: d8 80 00 00 call r4 80139a4: 34 02 00 01 mvi r2,1 80139a8: 44 22 00 06 be r1,r2,80139c0 rtems_set_errno_and_return_minus_one( ENOTDIR ); 80139ac: fb ff e6 e4 calli 800d53c <__errno> 80139b0: 34 02 00 14 mvi r2,20 80139b4: 58 22 00 00 sw (r1+0),r2 80139b8: 34 01 ff ff mvi r1,-1 80139bc: e0 00 00 07 bi 80139d8 /* * Return the number of bytes that were actually transfered as a result * of the read attempt. */ return (*iop->pathinfo.handlers->read_h)( iop, dd_buf, dd_len ); 80139c0: 29 61 00 24 lw r1,(r11+36) 80139c4: b9 a0 10 00 mv r2,r13 80139c8: b9 80 18 00 mv r3,r12 80139cc: 28 24 00 08 lw r4,(r1+8) 80139d0: b9 60 08 00 mv r1,r11 80139d4: d8 80 00 00 call r4 } 80139d8: 2b 9d 00 04 lw ra,(sp+4) 80139dc: 2b 8b 00 10 lw r11,(sp+16) 80139e0: 2b 8c 00 0c lw r12,(sp+12) 80139e4: 2b 8d 00 08 lw r13,(sp+8) 80139e8: 37 9c 00 24 addi sp,sp,36 80139ec: c3 a0 00 00 ret =============================================================================== 080104bc : IMFS_jnode_t *the_jnode; /* Is the node a directory ? */ the_jnode = (IMFS_jnode_t *) iop->pathinfo.node_access; if ( the_jnode->type != IMFS_DIRECTORY ) 80104bc: 28 22 00 1c lw r2,(r1+28) 80104c0: 34 03 00 01 mvi r3,1 80104c4: 28 44 00 4c lw r4,(r2+76) return -1; /* It wasn't a directory --> return error */ 80104c8: 34 02 ff ff mvi r2,-1 IMFS_jnode_t *the_jnode; /* Is the node a directory ? */ the_jnode = (IMFS_jnode_t *) iop->pathinfo.node_access; if ( the_jnode->type != IMFS_DIRECTORY ) 80104cc: 5c 83 00 04 bne r4,r3,80104dc <== NEVER TAKEN return -1; /* It wasn't a directory --> return error */ iop->offset = 0; 80104d0: 58 20 00 10 sw (r1+16),r0 80104d4: 58 20 00 14 sw (r1+20),r0 return 0; 80104d8: 34 02 00 00 mvi r2,0 } 80104dc: b8 40 08 00 mv r1,r2 80104e0: c3 a0 00 00 ret =============================================================================== 08010718 : int imfs_dir_rmnod( rtems_filesystem_location_info_t *parent_pathloc, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN */ ) { 8010718: 37 9c ff f8 addi sp,sp,-8 801071c: 5b 8b 00 08 sw (sp+8),r11 8010720: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *the_jnode; the_jnode = (IMFS_jnode_t *) pathloc->node_access; 8010724: 28 4b 00 00 lw r11,(r2+0) /* * You cannot remove a node that still has children */ if ( ! rtems_chain_is_empty( &the_jnode->info.directory.Entries ) ) 8010728: 29 63 00 50 lw r3,(r11+80) 801072c: 35 61 00 54 addi r1,r11,84 8010730: 44 61 00 04 be r3,r1,8010740 rtems_set_errno_and_return_minus_one( ENOTEMPTY ); 8010734: f8 00 03 66 calli 80114cc <__errno> 8010738: 34 02 00 5a mvi r2,90 801073c: e0 00 00 06 bi 8010754 /* * You cannot remove the file system root node. */ if ( pathloc->mt_entry->mt_fs_root.node_access == pathloc->node_access ) 8010740: 28 41 00 10 lw r1,(r2+16) 8010744: 28 21 00 1c lw r1,(r1+28) 8010748: 5c 2b 00 06 bne r1,r11,8010760 rtems_set_errno_and_return_minus_one( EBUSY ); 801074c: f8 00 03 60 calli 80114cc <__errno> 8010750: 34 02 00 10 mvi r2,16 8010754: 58 22 00 00 sw (r1+0),r2 8010758: 34 01 ff ff mvi r1,-1 801075c: e0 00 00 08 bi 801077c /* * You cannot remove a mountpoint. */ if ( the_jnode->info.directory.mt_fs != NULL ) 8010760: 29 61 00 5c lw r1,(r11+92) 8010764: 5c 20 ff fa bne r1,r0,801074c <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EBUSY ); IMFS_create_orphan( the_jnode ); 8010768: b9 60 08 00 mv r1,r11 801076c: fb ff ee 5d calli 800c0e0 IMFS_check_node_remove( the_jnode ); 8010770: b9 60 08 00 mv r1,r11 8010774: fb ff ee 6f calli 800c130 return 0; 8010778: 34 01 00 00 mvi r1,0 } 801077c: 2b 9d 00 04 lw ra,(sp+4) 8010780: 2b 8b 00 08 lw r11,(sp+8) 8010784: 37 9c 00 08 addi sp,sp,8 8010788: c3 a0 00 00 ret =============================================================================== 08002108 : /* * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { 8002108: 37 9c ff f0 addi sp,sp,-16 800210c: 5b 8b 00 10 sw (sp+16),r11 8002110: 5b 8c 00 0c sw (sp+12),r12 8002114: 5b 8d 00 08 sw (sp+8),r13 8002118: 5b 9d 00 04 sw (sp+4),ra FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) 800211c: 78 01 08 01 mvhi r1,0x801 8002120: 38 21 68 78 ori r1,r1,0x6878 8002124: 40 2d 00 00 lbu r13,(r1+0) 8002128: 5d a0 00 2f bne r13,r0,80021e4 return; etc_passwd_initted = 1; 800212c: 34 02 00 01 mvi r2,1 8002130: 30 22 00 00 sb (r1+0),r2 mkdir("/etc", 0777); 8002134: 78 01 08 01 mvhi r1,0x801 8002138: 34 02 01 ff mvi r2,511 800213c: 38 21 4b 58 ori r1,r1,0x4b58 8002140: f8 00 02 a3 calli 8002bcc /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { 8002144: 78 0b 08 01 mvhi r11,0x801 8002148: 39 6b 4b 60 ori r11,r11,0x4b60 800214c: 78 02 08 01 mvhi r2,0x801 8002150: b9 60 08 00 mv r1,r11 8002154: 38 42 4b 6c ori r2,r2,0x4b6c 8002158: f8 00 30 56 calli 800e2b0 800215c: b8 20 60 00 mv r12,r1 8002160: 5c 2d 00 0c bne r1,r13,8002190 fclose(fp); } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { 8002164: 78 02 08 01 mvhi r2,0x801 8002168: b9 60 08 00 mv r1,r11 800216c: 38 42 4b 70 ori r2,r2,0x4b70 8002170: f8 00 30 50 calli 800e2b0 8002174: b8 20 58 00 mv r11,r1 8002178: 44 2c 00 07 be r1,r12,8002194 <== NEVER TAKEN fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" 800217c: 78 01 08 01 mvhi r1,0x801 8002180: 38 21 4b 74 ori r1,r1,0x4b74 8002184: b9 60 10 00 mv r2,r11 8002188: f8 00 30 81 calli 800e38c "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); 800218c: b9 60 08 00 mv r1,r11 8002190: f8 00 2e 19 calli 800d9f4 } /* * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { 8002194: 78 0b 08 01 mvhi r11,0x801 8002198: 39 6b 4b dc ori r11,r11,0x4bdc 800219c: 78 02 08 01 mvhi r2,0x801 80021a0: b9 60 08 00 mv r1,r11 80021a4: 38 42 4b 6c ori r2,r2,0x4b6c 80021a8: f8 00 30 42 calli 800e2b0 80021ac: b8 20 60 00 mv r12,r1 80021b0: 5c 20 00 0c bne r1,r0,80021e0 fclose(fp); } else if ((fp = fopen("/etc/group", "w")) != NULL) { 80021b4: 78 02 08 01 mvhi r2,0x801 80021b8: b9 60 08 00 mv r1,r11 80021bc: 38 42 4b 70 ori r2,r2,0x4b70 80021c0: f8 00 30 3c calli 800e2b0 80021c4: b8 20 58 00 mv r11,r1 80021c8: 44 2c 00 07 be r1,r12,80021e4 <== NEVER TAKEN fprintf( fp, "root:x:0:root\n" 80021cc: 78 01 08 01 mvhi r1,0x801 80021d0: 38 21 4b e8 ori r1,r1,0x4be8 80021d4: b9 60 10 00 mv r2,r11 80021d8: f8 00 30 6d calli 800e38c "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); 80021dc: b9 60 08 00 mv r1,r11 80021e0: f8 00 2e 05 calli 800d9f4 } } 80021e4: 2b 9d 00 04 lw ra,(sp+4) 80021e8: 2b 8b 00 10 lw r11,(sp+16) 80021ec: 2b 8c 00 0c lw r12,(sp+12) 80021f0: 2b 8d 00 08 lw r13,(sp+8) 80021f4: 37 9c 00 10 addi sp,sp,16 80021f8: c3 a0 00 00 ret =============================================================================== 080057d8 : /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 80057d8: 37 9c ff f4 addi sp,sp,-12 80057dc: 5b 8b 00 0c sw (sp+12),r11 80057e0: 5b 8c 00 08 sw (sp+8),r12 80057e4: 5b 9d 00 04 sw (sp+4),ra 80057e8: b8 40 58 00 mv r11,r2 if (tty->termios.c_iflag & ISTRIP) 80057ec: 28 42 00 30 lw r2,(r2+48) /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 80057f0: b8 20 60 00 mv r12,r1 if (tty->termios.c_iflag & ISTRIP) 80057f4: 20 41 00 20 andi r1,r2,0x20 80057f8: 44 20 00 02 be r1,r0,8005800 <== ALWAYS TAKEN c &= 0x7f; 80057fc: 21 8c 00 7f andi r12,r12,0x7f <== NOT EXECUTED if (tty->termios.c_iflag & IUCLC) 8005800: 20 41 02 00 andi r1,r2,0x200 8005804: 44 20 00 0b be r1,r0,8005830 c = tolower (c); 8005808: 78 01 08 02 mvhi r1,0x802 800580c: 38 21 33 10 ori r1,r1,0x3310 8005810: 28 21 00 00 lw r1,(r1+0) 8005814: b4 2c 08 00 add r1,r1,r12 8005818: 40 23 00 01 lbu r3,(r1+1) 800581c: 34 01 00 01 mvi r1,1 8005820: 20 63 00 03 andi r3,r3,0x3 8005824: 5c 61 00 02 bne r3,r1,800582c 8005828: 35 8c 00 20 addi r12,r12,32 800582c: 21 8c 00 ff andi r12,r12,0xff if (c == '\r') { 8005830: 34 01 00 0d mvi r1,13 8005834: 5d 81 00 08 bne r12,r1,8005854 if (tty->termios.c_iflag & IGNCR) 8005838: 20 43 00 80 andi r3,r2,0x80 return 0; 800583c: 34 01 00 00 mvi r1,0 if (tty->termios.c_iflag & IUCLC) c = tolower (c); if (c == '\r') { if (tty->termios.c_iflag & IGNCR) 8005840: 5c 60 00 4e bne r3,r0,8005978 <== NEVER TAKEN return 0; if (tty->termios.c_iflag & ICRNL) 8005844: 20 42 01 00 andi r2,r2,0x100 8005848: 44 43 00 0a be r2,r3,8005870 <== NEVER TAKEN c = '\n'; 800584c: 34 0c 00 0a mvi r12,10 8005850: e0 00 00 08 bi 8005870 } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { 8005854: 34 01 00 0a mvi r1,10 8005858: 5d 81 00 05 bne r12,r1,800586c 800585c: 20 42 00 40 andi r2,r2,0x40 8005860: 44 40 00 04 be r2,r0,8005870 <== ALWAYS TAKEN c = '\r'; 8005864: 34 0c 00 0d mvi r12,13 <== NOT EXECUTED 8005868: e0 00 00 02 bi 8005870 <== NOT EXECUTED } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 800586c: 45 80 00 2f be r12,r0,8005928 <== NEVER TAKEN 8005870: 29 62 00 3c lw r2,(r11+60) 8005874: 20 41 00 02 andi r1,r2,0x2 8005878: 44 20 00 2c be r1,r0,8005928 <== NEVER TAKEN if (c == tty->termios.c_cc[VERASE]) { 800587c: 41 61 00 43 lbu r1,(r11+67) 8005880: 5c 2c 00 04 bne r1,r12,8005890 erase (tty, 0); 8005884: b9 60 08 00 mv r1,r11 8005888: 34 02 00 00 mvi r2,0 800588c: e0 00 00 05 bi 80058a0 return 0; } else if (c == tty->termios.c_cc[VKILL]) { 8005890: 41 61 00 44 lbu r1,(r11+68) 8005894: 5c 2c 00 05 bne r1,r12,80058a8 erase (tty, 1); 8005898: b9 60 08 00 mv r1,r11 800589c: 34 02 00 01 mvi r2,1 80058a0: fb ff ff 4c calli 80055d0 80058a4: e0 00 00 34 bi 8005974 return 0; } else if (c == tty->termios.c_cc[VEOF]) { 80058a8: 41 63 00 45 lbu r3,(r11+69) return 1; 80058ac: 34 01 00 01 mvi r1,1 } else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { 80058b0: 44 6c 00 32 be r3,r12,8005978 <== NEVER TAKEN return 1; } else if (c == '\n') { 80058b4: 34 01 00 0a mvi r1,10 80058b8: 5d 81 00 0b bne r12,r1,80058e4 if (tty->termios.c_lflag & (ECHO | ECHONL)) 80058bc: 20 42 00 48 andi r2,r2,0x48 80058c0: 44 40 00 03 be r2,r0,80058cc <== NEVER TAKEN echo (c, tty); 80058c4: b9 60 10 00 mv r2,r11 80058c8: fb ff ff 1d calli 800553c tty->cbuf[tty->ccount++] = c; 80058cc: 29 61 00 20 lw r1,(r11+32) 80058d0: 29 62 00 1c lw r2,(r11+28) 80058d4: 34 03 00 0a mvi r3,10 80058d8: b4 41 10 00 add r2,r2,r1 80058dc: 30 43 00 00 sb (r2+0),r3 80058e0: e0 00 00 0e bi 8005918 return 1; } else if ((c == tty->termios.c_cc[VEOL]) || 80058e4: 41 61 00 4c lbu r1,(r11+76) 80058e8: 44 2c 00 03 be r1,r12,80058f4 <== NEVER TAKEN 80058ec: 41 61 00 51 lbu r1,(r11+81) 80058f0: 5c 2c 00 0e bne r1,r12,8005928 <== ALWAYS TAKEN (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) 80058f4: 20 42 00 08 andi r2,r2,0x8 <== NOT EXECUTED 80058f8: 44 40 00 04 be r2,r0,8005908 <== NOT EXECUTED echo (c, tty); 80058fc: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8005900: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8005904: fb ff ff 0e calli 800553c <== NOT EXECUTED tty->cbuf[tty->ccount++] = c; 8005908: 29 61 00 20 lw r1,(r11+32) <== NOT EXECUTED 800590c: 29 62 00 1c lw r2,(r11+28) <== NOT EXECUTED 8005910: b4 41 10 00 add r2,r2,r1 <== NOT EXECUTED 8005914: 30 4c 00 00 sb (r2+0),r12 <== NOT EXECUTED 8005918: 34 21 00 01 addi r1,r1,1 800591c: 59 61 00 20 sw (r11+32),r1 return 1; 8005920: 34 01 00 01 mvi r1,1 8005924: e0 00 00 15 bi 8005978 } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 8005928: 78 01 08 02 mvhi r1,0x802 800592c: 38 21 32 40 ori r1,r1,0x3240 8005930: 28 22 00 00 lw r2,(r1+0) 8005934: 29 63 00 20 lw r3,(r11+32) if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; 8005938: 34 01 00 00 mvi r1,0 } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 800593c: 34 42 ff ff addi r2,r2,-1 8005940: 4c 62 00 0e bge r3,r2,8005978 <== NEVER TAKEN if (tty->termios.c_lflag & ECHO) 8005944: 29 61 00 3c lw r1,(r11+60) 8005948: 20 21 00 08 andi r1,r1,0x8 800594c: 44 20 00 04 be r1,r0,800595c <== NEVER TAKEN echo (c, tty); 8005950: b9 80 08 00 mv r1,r12 8005954: b9 60 10 00 mv r2,r11 8005958: fb ff fe f9 calli 800553c tty->cbuf[tty->ccount++] = c; 800595c: 29 61 00 20 lw r1,(r11+32) 8005960: 29 62 00 1c lw r2,(r11+28) 8005964: b4 41 10 00 add r2,r2,r1 8005968: 30 4c 00 00 sb (r2+0),r12 800596c: 34 21 00 01 addi r1,r1,1 8005970: 59 61 00 20 sw (r11+32),r1 } return 0; 8005974: 34 01 00 00 mvi r1,0 } 8005978: 2b 9d 00 04 lw ra,(sp+4) 800597c: 2b 8b 00 0c lw r11,(sp+12) 8005980: 2b 8c 00 08 lw r12,(sp+8) 8005984: 37 9c 00 0c addi sp,sp,12 8005988: c3 a0 00 00 ret =============================================================================== 08025240 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 8025240: 37 9c ff dc addi sp,sp,-36 8025244: 5b 8b 00 18 sw (sp+24),r11 8025248: 5b 8c 00 14 sw (sp+20),r12 802524c: 5b 8d 00 10 sw (sp+16),r13 8025250: 5b 8e 00 0c sw (sp+12),r14 8025254: 5b 8f 00 08 sw (sp+8),r15 8025258: 5b 9d 00 04 sw (sp+4),ra 802525c: b8 20 60 00 mv r12,r1 8025260: b8 40 58 00 mv r11,r2 8025264: b8 60 68 00 mv r13,r3 POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 8025268: fb ff fe e8 calli 8024e08 802526c: 45 81 00 04 be r12,r1,802527c rtems_set_errno_and_return_minus_one( ESRCH ); 8025270: fb ff b7 c7 calli 801318c <__errno> 8025274: 34 02 00 03 mvi r2,3 8025278: e0 00 00 04 bi 8025288 /* * Validate the signal passed. */ if ( !sig ) 802527c: 5d 60 00 06 bne r11,r0,8025294 rtems_set_errno_and_return_minus_one( EINVAL ); 8025280: fb ff b7 c3 calli 801318c <__errno> 8025284: 34 02 00 16 mvi r2,22 8025288: 58 22 00 00 sw (r1+0),r2 802528c: 34 01 ff ff mvi r1,-1 8025290: e0 00 00 a1 bi 8025514 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 8025294: 35 6f ff ff addi r15,r11,-1 if ( !is_valid_signo(sig) ) 8025298: 34 01 00 1f mvi r1,31 802529c: 50 2f 00 02 bgeu r1,r15,80252a4 80252a0: e3 ff ff f8 bi 8025280 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 ) 80252a4: 34 02 00 01 mvi r2,1 80252a8: b9 60 08 00 mv r1,r11 80252ac: fb ff 73 27 calli 8001f48 <__ashlsi3> 80252b0: 34 02 00 02 mvi r2,2 80252b4: 78 0c 08 02 mvhi r12,0x802 80252b8: b4 2b 08 00 add r1,r1,r11 80252bc: fb ff 73 23 calli 8001f48 <__ashlsi3> 80252c0: 39 8c 9f 10 ori r12,r12,0x9f10 80252c4: b5 81 08 00 add r1,r12,r1 80252c8: 28 22 00 08 lw r2,(r1+8) 80252cc: 34 0e 00 01 mvi r14,1 return 0; 80252d0: 34 01 00 00 mvi r1,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 ) 80252d4: 44 4e 00 90 be r2,r14,8025514 /* * 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 ) ) 80252d8: 65 62 00 04 cmpei r2,r11,4 80252dc: 65 61 00 08 cmpei r1,r11,8 80252e0: b8 41 08 00 or r1,r2,r1 80252e4: 5c 20 00 03 bne r1,r0,80252f0 80252e8: 34 01 00 0b mvi r1,11 80252ec: 5d 61 00 05 bne r11,r1,8025300 return pthread_kill( pthread_self(), sig ); 80252f0: f8 00 01 37 calli 80257cc 80252f4: b9 60 10 00 mv r2,r11 80252f8: f8 00 00 f0 calli 80256b8 80252fc: e0 00 00 86 bi 8025514 static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 8025300: 34 01 00 01 mvi r1,1 8025304: b9 e0 10 00 mv r2,r15 8025308: fb ff 73 10 calli 8001f48 <__ashlsi3> /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 802530c: 5b 8b 00 1c sw (sp+28),r11 siginfo->si_code = SI_USER; 8025310: 5b 8e 00 20 sw (sp+32),r14 8025314: b8 20 60 00 mv r12,r1 if ( !value ) { 8025318: 5d a0 00 03 bne r13,r0,8025324 siginfo->si_value.sival_int = 0; 802531c: 5b 80 00 24 sw (sp+36),r0 8025320: e0 00 00 03 bi 802532c } else { siginfo->si_value = *value; 8025324: 29 a1 00 00 lw r1,(r13+0) 8025328: 5b 81 00 24 sw (sp+36),r1 802532c: 78 01 08 02 mvhi r1,0x802 8025330: 38 21 9a 14 ori r1,r1,0x9a14 8025334: 28 22 00 00 lw r2,(r1+0) 8025338: 34 42 00 01 addi r2,r2,1 802533c: 58 22 00 00 sw (r1+0),r2 /* * 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; 8025340: 78 01 08 02 mvhi r1,0x802 8025344: 38 21 9e ec ori r1,r1,0x9eec 8025348: 28 23 00 0c lw r3,(r1+12) api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 802534c: 28 61 01 2c lw r1,(r3+300) 8025350: 28 21 00 cc lw r1,(r1+204) 8025354: a4 20 08 00 not r1,r1 8025358: a1 81 08 00 and r1,r12,r1 802535c: 5c 20 00 3e bne r1,r0,8025454 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; 8025360: 78 01 08 02 mvhi r1,0x802 8025364: 38 21 a0 9c ori r1,r1,0xa09c 8025368: 28 22 00 00 lw r2,(r1+0) 802536c: 78 01 08 02 mvhi r1,0x802 8025370: 38 21 a0 a0 ori r1,r1,0xa0a0 8025374: e0 00 00 0b bi 80253a0 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 8025378: 28 44 00 30 lw r4,(r2+48) for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; 802537c: b8 40 18 00 mv r3,r2 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 8025380: 28 45 01 2c lw r5,(r2+300) #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 8025384: a1 84 20 00 and r4,r12,r4 8025388: 5c 80 00 33 bne r4,r0,8025454 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 802538c: 28 a5 00 cc lw r5,(r5+204) 8025390: a4 a0 28 00 not r5,r5 8025394: a1 85 28 00 and r5,r12,r5 8025398: 5c a4 00 2f bne r5,r4,8025454 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 ) { 802539c: 28 42 00 00 lw r2,(r2+0) /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; 80253a0: 5c 41 ff f6 bne r2,r1,8025378 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 80253a4: 78 01 08 02 mvhi r1,0x802 80253a8: 38 21 90 c0 ori r1,r1,0x90c0 80253ac: 40 21 00 00 lbu r1,(r1+0) */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 80253b0: 78 02 08 02 mvhi r2,0x802 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 80253b4: 78 04 08 02 mvhi r4,0x802 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 80253b8: 38 42 99 b0 ori r2,r2,0x99b0 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 80253bc: 34 21 00 01 addi r1,r1,1 80253c0: 38 84 99 b8 ori r4,r4,0x99b8 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 80253c4: 34 4d 00 10 addi r13,r2,16 * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 80253c8: 34 03 00 00 mvi r3,0 */ RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal ( States_Control the_states ) { return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL); 80253cc: 78 08 10 00 mvhi r8,0x1000 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 ] ) 80253d0: 28 85 00 00 lw r5,(r4+0) 80253d4: 44 a0 00 1d be r5,r0,8025448 <== NEVER TAKEN continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 80253d8: 28 a5 00 04 lw r5,(r5+4) #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 80253dc: 34 06 00 01 mvi r6,1 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 80253e0: 2c ae 00 10 lhu r14,(r5+16) 80253e4: 28 a7 00 1c lw r7,(r5+28) object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 80253e8: e0 00 00 17 bi 8025444 the_thread = (Thread_Control *) object_table[ index ]; 80253ec: 28 e2 00 04 lw r2,(r7+4) if ( !the_thread ) 80253f0: 44 40 00 13 be r2,r0,802543c /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 80253f4: 28 45 00 14 lw r5,(r2+20) 80253f8: 54 a1 00 11 bgu r5,r1,802543c #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 80253fc: 28 49 01 2c lw r9,(r2+300) 8025400: 29 29 00 cc lw r9,(r9+204) 8025404: a5 20 48 00 not r9,r9 8025408: a1 89 48 00 and r9,r12,r9 802540c: 45 20 00 0c be r9,r0,802543c * * 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 ) { 8025410: 54 25 00 09 bgu r1,r5,8025434 * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( !_States_Is_ready( interested->current_state ) ) { 8025414: 28 69 00 10 lw r9,(r3+16) 8025418: 45 20 00 09 be r9,r0,802543c <== NEVER TAKEN /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 802541c: 28 4a 00 10 lw r10,(r2+16) 8025420: 45 40 00 05 be r10,r0,8025434 8025424: a1 28 48 00 and r9,r9,r8 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 8025428: 5d 20 00 05 bne r9,r0,802543c 802542c: a1 48 50 00 and r10,r10,r8 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 8025430: 45 49 00 03 be r10,r9,802543c */ if ( !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 8025434: b8 a0 08 00 mv r1,r5 8025438: b8 40 18 00 mv r3,r2 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 802543c: 34 c6 00 01 addi r6,r6,1 8025440: 34 e7 00 04 addi r7,r7,4 8025444: 51 c6 ff ea bgeu r14,r6,80253ec 8025448: 34 84 00 04 addi r4,r4,4 * + 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++) { 802544c: 5c 8d ff e1 bne r4,r13,80253d0 } } } } if ( interested ) { 8025450: 44 60 00 06 be r3,r0,8025468 /* * 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 ) ) { 8025454: b8 60 08 00 mv r1,r3 8025458: b9 60 10 00 mv r2,r11 802545c: 37 83 00 1c addi r3,sp,28 8025460: f8 00 00 40 calli 8025560 <_POSIX_signals_Unblock_thread> 8025464: 5c 20 00 2a bne r1,r0,802550c /* * 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 ); 8025468: b9 80 08 00 mv r1,r12 802546c: f8 00 00 32 calli 8025534 <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 8025470: 34 02 00 01 mvi r2,1 8025474: b9 60 08 00 mv r1,r11 8025478: fb ff 72 b4 calli 8001f48 <__ashlsi3> 802547c: b4 2b 68 00 add r13,r1,r11 8025480: 34 02 00 02 mvi r2,2 8025484: 78 0c 08 02 mvhi r12,0x802 8025488: b9 a0 08 00 mv r1,r13 802548c: fb ff 72 af calli 8001f48 <__ashlsi3> 8025490: 39 8c 9f 10 ori r12,r12,0x9f10 8025494: b5 81 08 00 add r1,r12,r1 8025498: 28 22 00 00 lw r2,(r1+0) 802549c: 34 01 00 02 mvi r1,2 80254a0: 5c 41 00 1b bne r2,r1,802550c psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get( &_POSIX_signals_Inactive_siginfo ); 80254a4: 78 01 08 02 mvhi r1,0x802 80254a8: 38 21 a0 90 ori r1,r1,0xa090 80254ac: fb ff 92 b4 calli 8009f7c <_Chain_Get> 80254b0: b8 20 60 00 mv r12,r1 if ( !psiginfo ) { 80254b4: 5c 20 00 05 bne r1,r0,80254c8 _Thread_Enable_dispatch(); 80254b8: fb ff 9a 1e calli 800bd30 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 80254bc: fb ff b7 34 calli 801318c <__errno> 80254c0: 34 02 00 0b mvi r2,11 80254c4: e3 ff ff 71 bi 8025288 } psiginfo->Info = *siginfo; 80254c8: 2b 81 00 1c lw r1,(sp+28) _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 80254cc: 34 02 00 01 mvi r2,1 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 80254d0: 59 81 00 08 sw (r12+8),r1 80254d4: 2b 81 00 20 lw r1,(sp+32) 80254d8: 59 81 00 0c sw (r12+12),r1 80254dc: 2b 81 00 24 lw r1,(sp+36) 80254e0: 59 81 00 10 sw (r12+16),r1 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 80254e4: b9 60 08 00 mv r1,r11 80254e8: fb ff 72 98 calli 8001f48 <__ashlsi3> 80254ec: 34 02 00 02 mvi r2,2 80254f0: b9 a0 08 00 mv r1,r13 80254f4: fb ff 72 95 calli 8001f48 <__ashlsi3> 80254f8: 78 02 08 02 mvhi r2,0x802 80254fc: 38 42 a1 08 ori r2,r2,0xa108 8025500: b4 22 08 00 add r1,r1,r2 8025504: b9 80 10 00 mv r2,r12 8025508: fb ff 92 87 calli 8009f24 <_Chain_Append> } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 802550c: fb ff 9a 09 calli 800bd30 <_Thread_Enable_dispatch> return 0; 8025510: 34 01 00 00 mvi r1,0 } 8025514: 2b 9d 00 04 lw ra,(sp+4) 8025518: 2b 8b 00 18 lw r11,(sp+24) 802551c: 2b 8c 00 14 lw r12,(sp+20) 8025520: 2b 8d 00 10 lw r13,(sp+16) 8025524: 2b 8e 00 0c lw r14,(sp+12) 8025528: 2b 8f 00 08 lw r15,(sp+8) 802552c: 37 9c 00 24 addi sp,sp,36 8025530: c3 a0 00 00 ret =============================================================================== 080175cc : extern void _wrapup_reent(struct _reent *); extern void _reclaim_reent(struct _reent *); void libc_wrapup(void) { 80175cc: 37 9c ff f4 addi sp,sp,-12 80175d0: 5b 8b 00 0c sw (sp+12),r11 80175d4: 5b 8c 00 08 sw (sp+8),r12 80175d8: 5b 9d 00 04 sw (sp+4),ra /* * In case RTEMS is already down, don't do this. It could be * dangerous. */ if (!_System_state_Is_up(_System_state_Get())) 80175dc: 78 01 08 01 mvhi r1,0x801 80175e0: 38 21 9a a4 ori r1,r1,0x9aa4 80175e4: 28 22 00 00 lw r2,(r1+0) 80175e8: 34 01 00 03 mvi r1,3 80175ec: 5c 41 00 16 bne r2,r1,8017644 <== NEVER TAKEN /* * This was already done if the user called exit() directly . _wrapup_reent(0); */ if (_REENT != _global_impure_ptr) { 80175f0: 78 01 08 01 mvhi r1,0x801 80175f4: 78 0b 08 01 mvhi r11,0x801 80175f8: 38 21 87 28 ori r1,r1,0x8728 80175fc: 39 6b 91 d8 ori r11,r11,0x91d8 8017600: 28 2c 00 00 lw r12,(r1+0) 8017604: 29 61 00 00 lw r1,(r11+0) 8017608: 44 2c 00 04 be r1,r12,8017618 _wrapup_reent(_global_impure_ptr); 801760c: b9 80 08 00 mv r1,r12 8017610: f8 00 01 1b calli 8017a7c <_wrapup_reent> /* Don't reclaim this one, just in case we do printfs * on the way out to ROM. */ _reclaim_reent(&libc_global_reent); #endif _REENT = _global_impure_ptr; 8017614: 59 6c 00 00 sw (r11+0),r12 * * Should this be changed to do *all* file streams? * _fwalk (_REENT, fclose); */ fclose (stdin); 8017618: 78 0b 08 01 mvhi r11,0x801 801761c: 39 6b 91 d8 ori r11,r11,0x91d8 8017620: 29 61 00 00 lw r1,(r11+0) 8017624: 28 21 00 04 lw r1,(r1+4) 8017628: fb ff e8 09 calli 801164c fclose (stdout); 801762c: 29 61 00 00 lw r1,(r11+0) 8017630: 28 21 00 08 lw r1,(r1+8) 8017634: fb ff e8 06 calli 801164c fclose (stderr); 8017638: 29 61 00 00 lw r1,(r11+0) 801763c: 28 21 00 0c lw r1,(r1+12) 8017640: fb ff e8 03 calli 801164c } 8017644: 2b 9d 00 04 lw ra,(sp+4) 8017648: 2b 8b 00 0c lw r11,(sp+12) 801764c: 2b 8c 00 08 lw r12,(sp+8) 8017650: 37 9c 00 0c addi sp,sp,12 8017654: c3 a0 00 00 ret =============================================================================== 08002b34 : #include "malloc_p.h" void *malloc( size_t size ) { 8002b34: 37 9c ff f4 addi sp,sp,-12 8002b38: 5b 8b 00 0c sw (sp+12),r11 8002b3c: 5b 8c 00 08 sw (sp+8),r12 8002b40: 5b 9d 00 04 sw (sp+4),ra void *return_this; MSBUMP(malloc_calls, 1); 8002b44: 78 03 08 01 mvhi r3,0x801 8002b48: 38 63 98 00 ori r3,r3,0x9800 #include "malloc_p.h" void *malloc( size_t size ) { 8002b4c: b8 20 60 00 mv r12,r1 void *return_this; MSBUMP(malloc_calls, 1); 8002b50: 28 61 00 04 lw r1,(r3+4) /* * Validate the parameters */ if ( !size ) return (void *) 0; 8002b54: 34 0b 00 00 mvi r11,0 size_t size ) { void *return_this; MSBUMP(malloc_calls, 1); 8002b58: 34 21 00 01 addi r1,r1,1 8002b5c: 58 61 00 04 sw (r3+4),r1 /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); 8002b60: fb ff ff 9d calli 80029d4 /* * Validate the parameters */ if ( !size ) 8002b64: 45 80 00 2d be r12,r0,8002c18 return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 8002b68: 78 01 08 01 mvhi r1,0x801 8002b6c: 38 21 9a a4 ori r1,r1,0x9aa4 8002b70: 28 22 00 00 lw r2,(r1+0) 8002b74: 34 01 00 03 mvi r1,3 8002b78: 5c 41 00 03 bne r2,r1,8002b84 !malloc_is_system_state_OK() ) 8002b7c: fb ff ff 84 calli 800298c return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 8002b80: 44 20 00 26 be r1,r0,8002c18 <== NEVER TAKEN RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 8002b84: 78 01 08 01 mvhi r1,0x801 8002b88: 38 21 90 1c ori r1,r1,0x901c 8002b8c: 28 21 00 00 lw r1,(r1+0) 8002b90: b9 80 10 00 mv r2,r12 8002b94: 34 03 00 00 mvi r3,0 8002b98: 34 04 00 00 mvi r4,0 8002b9c: f8 00 0c fc calli 8005f8c <_Protected_heap_Allocate_aligned_with_boundary> 8002ba0: b8 20 58 00 mv r11,r1 * If this fails then return a NULL pointer. */ return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); if ( !return_this ) { 8002ba4: 5c 20 00 0f bne r1,r0,8002be0 if (rtems_malloc_sbrk_helpers) 8002ba8: 78 01 08 01 mvhi r1,0x801 8002bac: 38 21 96 84 ori r1,r1,0x9684 8002bb0: 28 21 00 00 lw r1,(r1+0) 8002bb4: 44 2b 00 06 be r1,r11,8002bcc return_this = (*rtems_malloc_sbrk_helpers->extend)( size ); 8002bb8: 28 22 00 04 lw r2,(r1+4) 8002bbc: b9 80 08 00 mv r1,r12 8002bc0: d8 40 00 00 call r2 8002bc4: b8 20 58 00 mv r11,r1 if ( !return_this ) { 8002bc8: 5c 20 00 06 bne r1,r0,8002be0 errno = ENOMEM; 8002bcc: f8 00 3a 40 calli 80114cc <__errno> 8002bd0: 34 02 00 0c mvi r2,12 8002bd4: 58 22 00 00 sw (r1+0),r2 return (void *) 0; 8002bd8: 34 0b 00 00 mvi r11,0 8002bdc: e0 00 00 0f bi 8002c18 } /* * If the user wants us to dirty the allocated memory, then do it. */ if ( rtems_malloc_dirty_helper ) 8002be0: 78 01 08 01 mvhi r1,0x801 8002be4: 38 21 96 88 ori r1,r1,0x9688 8002be8: 28 23 00 00 lw r3,(r1+0) 8002bec: 44 60 00 04 be r3,r0,8002bfc (*rtems_malloc_dirty_helper)( return_this, size ); 8002bf0: b9 60 08 00 mv r1,r11 8002bf4: b9 80 10 00 mv r2,r12 8002bf8: d8 60 00 00 call r3 /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 8002bfc: 78 01 08 01 mvhi r1,0x801 8002c00: 38 21 96 80 ori r1,r1,0x9680 8002c04: 28 21 00 00 lw r1,(r1+0) 8002c08: 44 20 00 04 be r1,r0,8002c18 (*rtems_malloc_statistics_helpers->at_malloc)(return_this); 8002c0c: 28 22 00 04 lw r2,(r1+4) 8002c10: b9 60 08 00 mv r1,r11 8002c14: d8 40 00 00 call r2 return return_this; } 8002c18: b9 60 08 00 mv r1,r11 8002c1c: 2b 9d 00 04 lw ra,(sp+4) 8002c20: 2b 8b 00 0c lw r11,(sp+12) 8002c24: 2b 8c 00 08 lw r12,(sp+8) 8002c28: 37 9c 00 0c addi sp,sp,12 8002c2c: c3 a0 00 00 ret =============================================================================== 08001b88 : } void *malloc_sbrk_extend_and_allocate( size_t size ) { 8001b88: 37 9c ff ec addi sp,sp,-20 8001b8c: 5b 8b 00 14 sw (sp+20),r11 8001b90: 5b 8c 00 10 sw (sp+16),r12 8001b94: 5b 8d 00 0c sw (sp+12),r13 8001b98: 5b 8e 00 08 sw (sp+8),r14 8001b9c: 5b 9d 00 04 sw (sp+4),ra * Round to the "requested sbrk amount" so hopefully we won't have * to grow again for a while. This effectively does sbrk() calls * in "page" amounts. */ sbrk_amount = RTEMS_Malloc_Sbrk_amount; 8001ba0: 78 03 08 01 mvhi r3,0x801 8001ba4: 38 63 48 58 ori r3,r3,0x4858 8001ba8: 28 6b 00 00 lw r11,(r3+0) } void *malloc_sbrk_extend_and_allocate( size_t size ) { 8001bac: b8 20 70 00 mv r14,r1 */ sbrk_amount = RTEMS_Malloc_Sbrk_amount; if ( sbrk_amount == 0 ) return (void *) 0; 8001bb0: 34 0d 00 00 mvi r13,0 * in "page" amounts. */ sbrk_amount = RTEMS_Malloc_Sbrk_amount; if ( sbrk_amount == 0 ) 8001bb4: 45 60 00 22 be r11,r0,8001c3c <== NEVER TAKEN return (void *) 0; the_size = ((size + sbrk_amount) / sbrk_amount * sbrk_amount); 8001bb8: b9 60 10 00 mv r2,r11 8001bbc: b4 2b 08 00 add r1,r1,r11 8001bc0: f8 00 41 f3 calli 801238c <__udivsi3> 8001bc4: b9 60 10 00 mv r2,r11 8001bc8: f8 00 41 8c calli 80121f8 <__mulsi3> 8001bcc: b8 20 60 00 mv r12,r1 starting_address = (void *) sbrk(the_size); 8001bd0: fb ff fa 15 calli 8000424 8001bd4: b8 20 10 00 mv r2,r1 if ( starting_address == (void*) -1 ) 8001bd8: 34 01 ff ff mvi r1,-1 8001bdc: 44 41 00 18 be r2,r1,8001c3c return (void *) 0; if ( !_Protected_heap_Extend( 8001be0: 78 0b 08 01 mvhi r11,0x801 8001be4: 39 6b 40 1c ori r11,r11,0x401c 8001be8: 29 61 00 00 lw r1,(r11+0) 8001bec: b9 80 18 00 mv r3,r12 8001bf0: f8 00 0c 74 calli 8004dc0 <_Protected_heap_Extend> 8001bf4: 5c 20 00 07 bne r1,r0,8001c10 RTEMS_Malloc_Heap, starting_address, the_size) ) { sbrk(-the_size); 8001bf8: c8 0c 08 00 sub r1,r0,r12 8001bfc: fb ff fa 0a calli 8000424 errno = ENOMEM; 8001c00: f8 00 2c 31 calli 800ccc4 <__errno> 8001c04: 34 02 00 0c mvi r2,12 8001c08: 58 22 00 00 sw (r1+0),r2 return (void *) 0; 8001c0c: e0 00 00 0c bi 8001c3c } MSBUMP(space_available, the_size); 8001c10: 78 04 08 01 mvhi r4,0x801 8001c14: 38 84 48 28 ori r4,r4,0x4828 8001c18: 28 81 00 00 lw r1,(r4+0) 8001c1c: b9 c0 10 00 mv r2,r14 8001c20: 34 03 00 00 mvi r3,0 8001c24: b5 81 60 00 add r12,r12,r1 8001c28: 29 61 00 00 lw r1,(r11+0) 8001c2c: 58 8c 00 00 sw (r4+0),r12 8001c30: 34 04 00 00 mvi r4,0 8001c34: f8 00 0c 49 calli 8004d58 <_Protected_heap_Allocate_aligned_with_boundary> 8001c38: b8 20 68 00 mv r13,r1 return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); return return_this; } 8001c3c: b9 a0 08 00 mv r1,r13 8001c40: 2b 9d 00 04 lw ra,(sp+4) 8001c44: 2b 8b 00 14 lw r11,(sp+20) 8001c48: 2b 8c 00 10 lw r12,(sp+16) 8001c4c: 2b 8d 00 0c lw r13,(sp+12) 8001c50: 2b 8e 00 08 lw r14,(sp+8) 8001c54: 37 9c 00 14 addi sp,sp,20 8001c58: c3 a0 00 00 ret =============================================================================== 0800f4e0 : */ int memfile_blocks_allocated = 0; void *memfile_alloc_block(void) { 800f4e0: 37 9c ff fc addi sp,sp,-4 800f4e4: 5b 9d 00 04 sw (sp+4),ra void *memory; memory = (void *)calloc(1, IMFS_MEMFILE_BYTES_PER_BLOCK); 800f4e8: 78 02 08 01 mvhi r2,0x801 800f4ec: 38 42 96 d8 ori r2,r2,0x96d8 800f4f0: 28 42 00 00 lw r2,(r2+0) 800f4f4: 34 01 00 01 mvi r1,1 800f4f8: fb ff cb f0 calli 80024b8 if ( memory ) 800f4fc: 44 20 00 06 be r1,r0,800f514 <== NEVER TAKEN memfile_blocks_allocated++; 800f500: 78 02 08 01 mvhi r2,0x801 800f504: 38 42 97 78 ori r2,r2,0x9778 800f508: 28 43 00 00 lw r3,(r2+0) 800f50c: 34 63 00 01 addi r3,r3,1 800f510: 58 43 00 00 sw (r2+0),r3 return memory; } 800f514: 2b 9d 00 04 lw ra,(sp+4) 800f518: 37 9c 00 04 addi sp,sp,4 800f51c: c3 a0 00 00 ret =============================================================================== 0800fa98 : void memfile_free_blocks_in_table( block_p **block_table, int entries ) { 800fa98: 37 9c ff ec addi sp,sp,-20 800fa9c: 5b 8b 00 14 sw (sp+20),r11 800faa0: 5b 8c 00 10 sw (sp+16),r12 800faa4: 5b 8d 00 0c sw (sp+12),r13 800faa8: 5b 8e 00 08 sw (sp+8),r14 800faac: 5b 9d 00 04 sw (sp+4),ra 800fab0: b8 20 58 00 mv r11,r1 800fab4: b8 40 70 00 mv r14,r2 */ #if defined(RTEMS_DEBUG) assert( block_table ); #endif if ( !block_table ) 800fab8: 44 20 00 0e be r1,r0,800faf0 <== NEVER TAKEN 800fabc: 28 2c 00 00 lw r12,(r1+0) * Now go through all the slots in the table and free the memory. */ b = *block_table; for ( i=0 ; i if ( b[i] ) { 800fac8: 29 81 00 00 lw r1,(r12+0) 800facc: 44 20 00 03 be r1,r0,800fad8 memfile_free_block( b[i] ); 800fad0: fb ff ff e7 calli 800fa6c b[i] = 0; 800fad4: 59 80 00 00 sw (r12+0),r0 * Now go through all the slots in the table and free the memory. */ b = *block_table; for ( i=0 ; i /* * Now that all the blocks in the block table are free, we can * free the block table itself. */ memfile_free_block( *block_table ); 800fae4: 29 61 00 00 lw r1,(r11+0) 800fae8: fb ff ff e1 calli 800fa6c *block_table = 0; 800faec: 59 60 00 00 sw (r11+0),r0 } 800faf0: 2b 9d 00 04 lw ra,(sp+4) 800faf4: 2b 8b 00 14 lw r11,(sp+20) 800faf8: 2b 8c 00 10 lw r12,(sp+16) 800fafc: 2b 8d 00 0c lw r13,(sp+12) 800fb00: 2b 8e 00 08 lw r14,(sp+8) 800fb04: 37 9c 00 14 addi sp,sp,20 800fb08: c3 a0 00 00 ret =============================================================================== 080100dc : int memfile_ftruncate( rtems_libio_t *iop, rtems_off64_t length ) { 80100dc: 37 9c ff f0 addi sp,sp,-16 80100e0: 5b 8b 00 08 sw (sp+8),r11 80100e4: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 80100e8: 28 2b 00 1c lw r11,(r1+28) * 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 ) 80100ec: 29 64 00 50 lw r4,(r11+80) 80100f0: 48 44 00 05 bg r2,r4,8010104 <== NEVER TAKEN 80100f4: 5c 82 00 08 bne r4,r2,8010114 <== NEVER TAKEN 80100f8: 29 64 00 54 lw r4,(r11+84) 80100fc: 54 64 00 02 bgu r3,r4,8010104 <== NEVER TAKEN 8010100: e0 00 00 05 bi 8010114 return IMFS_memfile_extend( the_jnode, length ); 8010104: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8010108: b8 60 10 00 mv r2,r3 <== NOT EXECUTED 801010c: fb ff fe e8 calli 800fcac <== NOT EXECUTED 8010110: e0 00 00 0b bi 801013c <== NOT EXECUTED * 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; 8010114: 59 62 00 50 sw (r11+80),r2 8010118: 59 63 00 54 sw (r11+84),r3 iop->size = the_jnode->info.file.size; 801011c: 58 22 00 08 sw (r1+8),r2 8010120: 58 23 00 0c sw (r1+12),r3 IMFS_update_atime( the_jnode ); 8010124: 34 02 00 00 mvi r2,0 8010128: 37 81 00 0c addi r1,sp,12 801012c: fb ff c9 b6 calli 8002804 8010130: 2b 81 00 0c lw r1,(sp+12) 8010134: 59 61 00 40 sw (r11+64),r1 return 0; 8010138: 34 01 00 00 mvi r1,0 } 801013c: 2b 9d 00 04 lw ra,(sp+4) 8010140: 2b 8b 00 08 lw r11,(sp+8) 8010144: 37 9c 00 10 addi sp,sp,16 8010148: c3 a0 00 00 ret =============================================================================== 0801014c : rtems_off64_t memfile_lseek( rtems_libio_t *iop, rtems_off64_t offset, int whence ) { 801014c: 37 9c ff f4 addi sp,sp,-12 8010150: 5b 8b 00 0c sw (sp+12),r11 8010154: 5b 8c 00 08 sw (sp+8),r12 8010158: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 801015c: 28 2c 00 1c lw r12,(r1+28) rtems_off64_t memfile_lseek( rtems_libio_t *iop, rtems_off64_t offset, int whence ) { 8010160: b8 20 58 00 mv r11,r1 IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; if (the_jnode->type == IMFS_LINEAR_FILE) { 8010164: 34 01 00 06 mvi r1,6 8010168: 29 82 00 4c lw r2,(r12+76) 801016c: 5c 41 00 0c bne r2,r1,801019c if (iop->offset > the_jnode->info.linearfile.size) 8010170: 29 81 00 50 lw r1,(r12+80) 8010174: 29 63 00 10 lw r3,(r11+16) 8010178: 29 82 00 54 lw r2,(r12+84) 801017c: 48 61 00 05 bg r3,r1,8010190 <== NEVER TAKEN 8010180: 5c 61 00 15 bne r3,r1,80101d4 <== NEVER TAKEN 8010184: 29 63 00 14 lw r3,(r11+20) 8010188: 54 62 00 02 bgu r3,r2,8010190 <== NEVER TAKEN 801018c: e0 00 00 12 bi 80101d4 iop->offset = the_jnode->info.linearfile.size; 8010190: 59 61 00 10 sw (r11+16),r1 <== NOT EXECUTED 8010194: 59 62 00 14 sw (r11+20),r2 <== NOT EXECUTED 8010198: e0 00 00 0f bi 80101d4 <== NOT EXECUTED } else { /* Must be a block file (IMFS_MEMORY_FILE). */ if (IMFS_memfile_extend( the_jnode, iop->offset )) 801019c: 29 62 00 14 lw r2,(r11+20) 80101a0: b9 80 08 00 mv r1,r12 80101a4: fb ff fe c2 calli 800fcac 80101a8: 44 20 00 07 be r1,r0,80101c4 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOSPC ); 80101ac: f8 00 04 c8 calli 80114cc <__errno> <== NOT EXECUTED 80101b0: 34 02 00 1c mvi r2,28 <== NOT EXECUTED 80101b4: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 80101b8: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 80101bc: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 80101c0: e0 00 00 07 bi 80101dc <== NOT EXECUTED iop->size = the_jnode->info.file.size; 80101c4: 29 81 00 50 lw r1,(r12+80) 80101c8: 59 61 00 08 sw (r11+8),r1 80101cc: 29 81 00 54 lw r1,(r12+84) 80101d0: 59 61 00 0c sw (r11+12),r1 } return iop->offset; 80101d4: 29 61 00 10 lw r1,(r11+16) 80101d8: 29 62 00 14 lw r2,(r11+20) } 80101dc: 2b 9d 00 04 lw ra,(sp+4) 80101e0: 2b 8b 00 0c lw r11,(sp+12) 80101e4: 2b 8c 00 08 lw r12,(sp+8) 80101e8: 37 9c 00 0c addi sp,sp,12 80101ec: c3 a0 00 00 ret =============================================================================== 08010028 : rtems_libio_t *iop, const char *pathname, uint32_t flag, uint32_t mode ) { 8010028: 37 9c ff f4 addi sp,sp,-12 801002c: 5b 8b 00 0c sw (sp+12),r11 8010030: 5b 8c 00 08 sw (sp+8),r12 8010034: 5b 9d 00 04 sw (sp+4),ra 8010038: b8 20 60 00 mv r12,r1 IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 801003c: 28 2b 00 1c lw r11,(r1+28) /* * Perform 'copy on write' for linear files */ if ((iop->flags & (LIBIO_FLAGS_WRITE | LIBIO_FLAGS_APPEND)) 8010040: 28 21 00 18 lw r1,(r1+24) 8010044: 20 21 02 04 andi r1,r1,0x204 8010048: 44 20 00 13 be r1,r0,8010094 && (the_jnode->type == IMFS_LINEAR_FILE)) { 801004c: 29 62 00 4c lw r2,(r11+76) 8010050: 34 01 00 06 mvi r1,6 8010054: 5c 41 00 10 bne r2,r1,8010094 <== ALWAYS TAKEN uint32_t count = the_jnode->info.linearfile.size; 8010058: 29 64 00 54 lw r4,(r11+84) <== NOT EXECUTED const unsigned char *buffer = the_jnode->info.linearfile.direct; the_jnode->type = IMFS_MEMORY_FILE; 801005c: 34 01 00 05 mvi r1,5 <== 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; 8010060: 29 63 00 58 lw r3,(r11+88) <== NOT EXECUTED the_jnode->type = IMFS_MEMORY_FILE; 8010064: 59 61 00 4c sw (r11+76),r1 <== NOT EXECUTED the_jnode->info.file.size = 0; 8010068: 59 60 00 50 sw (r11+80),r0 <== NOT EXECUTED 801006c: 59 60 00 54 sw (r11+84),r0 <== NOT EXECUTED the_jnode->info.file.indirect = 0; 8010070: 59 60 00 58 sw (r11+88),r0 <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; 8010074: 59 60 00 5c sw (r11+92),r0 <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; 8010078: 59 60 00 60 sw (r11+96),r0 <== NOT EXECUTED if ((count != 0) 801007c: 44 80 00 06 be r4,r0,8010094 <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) 8010080: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 8010084: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8010088: fb ff ff 5f calli 800fe04 <== NOT EXECUTED return -1; 801008c: 34 02 ff ff mvi r2,-1 <== 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) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) 8010090: 44 22 00 0d be r1,r2,80100c4 <== NOT EXECUTED return -1; } if (iop->flags & LIBIO_FLAGS_APPEND) 8010094: 29 81 00 18 lw r1,(r12+24) 8010098: 20 21 02 00 andi r1,r1,0x200 801009c: 44 20 00 05 be r1,r0,80100b0 iop->offset = the_jnode->info.file.size; 80100a0: 29 61 00 50 lw r1,(r11+80) 80100a4: 59 81 00 10 sw (r12+16),r1 80100a8: 29 61 00 54 lw r1,(r11+84) 80100ac: 59 81 00 14 sw (r12+20),r1 iop->size = the_jnode->info.file.size; 80100b0: 29 61 00 50 lw r1,(r11+80) return 0; 80100b4: 34 02 00 00 mvi r2,0 return -1; } if (iop->flags & LIBIO_FLAGS_APPEND) iop->offset = the_jnode->info.file.size; iop->size = the_jnode->info.file.size; 80100b8: 59 81 00 08 sw (r12+8),r1 80100bc: 29 61 00 54 lw r1,(r11+84) 80100c0: 59 81 00 0c sw (r12+12),r1 return 0; } 80100c4: b8 40 08 00 mv r1,r2 80100c8: 2b 9d 00 04 lw ra,(sp+4) 80100cc: 2b 8b 00 0c lw r11,(sp+12) 80100d0: 2b 8c 00 08 lw r12,(sp+8) 80100d4: 37 9c 00 0c addi sp,sp,12 80100d8: c3 a0 00 00 ret =============================================================================== 08002c54 : int mknod( const char *pathname, mode_t mode, dev_t dev ) { 8002c54: 37 9c ff cc addi sp,sp,-52 8002c58: 5b 8b 00 14 sw (sp+20),r11 8002c5c: 5b 8c 00 10 sw (sp+16),r12 8002c60: 5b 8d 00 0c sw (sp+12),r13 8002c64: 5b 8e 00 08 sw (sp+8),r14 8002c68: 5b 9d 00 04 sw (sp+4),ra 8002c6c: b8 40 68 00 mv r13,r2 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) ) ) 8002c70: 20 42 f0 00 andi r2,r2,0xf000 int mknod( const char *pathname, mode_t mode, dev_t dev ) { 8002c74: b8 20 60 00 mv r12,r1 8002c78: b8 60 70 00 mv r14,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) ) ) 8002c7c: 5c 40 00 06 bne r2,r0,8002c94 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 8002c80: f8 00 3a 13 calli 80114cc <__errno> <== NOT EXECUTED 8002c84: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8002c88: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8002c8c: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 8002c90: e0 00 00 1a bi 8002cf8 <== NOT EXECUTED rtems_filesystem_get_start_loc( pathname, &i, &temp_loc ); 8002c94: 37 8b 00 1c addi r11,sp,28 8002c98: 37 82 00 34 addi r2,sp,52 8002c9c: b9 60 18 00 mv r3,r11 8002ca0: 5b 84 00 18 sw (sp+24),r4 8002ca4: f8 00 02 e8 calli 8003844 result = (*temp_loc.ops->evalformake_h)( 8002ca8: 2b 81 00 28 lw r1,(sp+40) 8002cac: b9 60 10 00 mv r2,r11 8002cb0: 37 83 00 30 addi r3,sp,48 8002cb4: 28 25 00 04 lw r5,(r1+4) 8002cb8: 2b 81 00 34 lw r1,(sp+52) 8002cbc: b5 81 08 00 add r1,r12,r1 8002cc0: d8 a0 00 00 call r5 &pathname[i], &temp_loc, &name_start ); if ( result != 0 ) return -1; 8002cc4: 34 0c ff ff mvi r12,-1 result = (*temp_loc.ops->evalformake_h)( &pathname[i], &temp_loc, &name_start ); if ( result != 0 ) 8002cc8: 2b 84 00 18 lw r4,(sp+24) 8002ccc: 5c 20 00 0b bne r1,r0,8002cf8 return -1; result = (*temp_loc.ops->mknod_h)( name_start, mode, dev, &temp_loc ); 8002cd0: 2b 81 00 28 lw r1,(sp+40) 8002cd4: b9 a0 10 00 mv r2,r13 8002cd8: b9 c0 18 00 mv r3,r14 8002cdc: 28 26 00 14 lw r6,(r1+20) 8002ce0: 2b 81 00 30 lw r1,(sp+48) 8002ce4: b9 60 28 00 mv r5,r11 8002ce8: d8 c0 00 00 call r6 8002cec: b8 20 60 00 mv r12,r1 rtems_filesystem_freenode( &temp_loc ); 8002cf0: b9 60 08 00 mv r1,r11 8002cf4: fb ff fe 8e calli 800272c return result; } 8002cf8: b9 80 08 00 mv r1,r12 8002cfc: 2b 9d 00 04 lw ra,(sp+4) 8002d00: 2b 8b 00 14 lw r11,(sp+20) 8002d04: 2b 8c 00 10 lw r12,(sp+16) 8002d08: 2b 8d 00 0c lw r13,(sp+12) 8002d0c: 2b 8e 00 08 lw r14,(sp+8) 8002d10: 37 9c 00 34 addi sp,sp,52 8002d14: c3 a0 00 00 ret =============================================================================== 08002dfc : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 8002dfc: 37 9c ff b4 addi sp,sp,-76 8002e00: 5b 8b 00 38 sw (sp+56),r11 8002e04: 5b 8c 00 34 sw (sp+52),r12 8002e08: 5b 8d 00 30 sw (sp+48),r13 8002e0c: 5b 8e 00 2c sw (sp+44),r14 8002e10: 5b 8f 00 28 sw (sp+40),r15 8002e14: 5b 90 00 24 sw (sp+36),r16 8002e18: 5b 91 00 20 sw (sp+32),r17 8002e1c: 5b 92 00 1c sw (sp+28),r18 8002e20: 5b 93 00 18 sw (sp+24),r19 8002e24: 5b 94 00 14 sw (sp+20),r20 8002e28: 5b 95 00 10 sw (sp+16),r21 8002e2c: 5b 96 00 0c sw (sp+12),r22 8002e30: 5b 97 00 08 sw (sp+8),r23 8002e34: 5b 9d 00 04 sw (sp+4),ra 8002e38: b8 20 70 00 mv r14,r1 /* * Are the file system options valid? */ if ( options != RTEMS_FILESYSTEM_READ_ONLY && 8002e3c: 34 01 00 01 mvi r1,1 const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 8002e40: b8 40 80 00 mv r16,r2 8002e44: b8 60 90 00 mv r18,r3 8002e48: b8 80 a8 00 mv r21,r4 8002e4c: b8 a0 b8 00 mv r23,r5 /* * Are the file system options valid? */ if ( options != RTEMS_FILESYSTEM_READ_ONLY && 8002e50: 50 24 00 02 bgeu r1,r4,8002e58 8002e54: e0 00 00 05 bi 8002e68 rtems_set_errno_and_return_minus_one( EINVAL ); /* * Get mount handler */ mount_h = rtems_filesystem_get_mount_handler( filesystemtype ); 8002e58: b8 60 08 00 mv r1,r3 8002e5c: f8 00 26 af calli 800c918 8002e60: b8 20 98 00 mv r19,r1 if ( !mount_h ) 8002e64: 5c 20 00 04 bne r1,r0,8002e74 rtems_set_errno_and_return_minus_one( EINVAL ); 8002e68: f8 00 39 99 calli 80114cc <__errno> 8002e6c: 34 02 00 16 mvi r2,22 8002e70: e0 00 00 34 bi 8002f40 { 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; 8002e74: 7e 0f 00 00 cmpnei r15,r16,0 const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; 8002e78: ba 00 68 00 mv r13,r16 8002e7c: 5d e0 00 03 bne r15,r0,8002e88 8002e80: 78 0d 08 01 mvhi r13,0x801 8002e84: 39 ad 7e f0 ori r13,r13,0x7ef0 size_t filesystemtype_size = strlen( filesystemtype ) + 1; 8002e88: ba 40 08 00 mv r1,r18 8002e8c: f8 00 3d fc calli 801267c 8002e90: 34 36 00 01 addi r22,r1,1 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 8002e94: 34 11 00 00 mvi r17,0 8002e98: 45 c0 00 04 be r14,r0,8002ea8 8002e9c: b9 c0 08 00 mv r1,r14 8002ea0: f8 00 3d f7 calli 801267c 8002ea4: 34 31 00 01 addi r17,r1,1 size_t target_length = strlen( target ); 8002ea8: b9 a0 08 00 mv r1,r13 8002eac: f8 00 3d f4 calli 801267c size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_length + 1; 8002eb0: 36 c3 00 75 addi r3,r22,117 8002eb4: b4 61 18 00 add r3,r3,r1 { const char *target = target_or_null != NULL ? target_or_null : "/"; size_t filesystemtype_size = strlen( filesystemtype ) + 1; size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; size_t target_length = strlen( target ); 8002eb8: b8 20 a0 00 mv r20,r1 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_length + 1; rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); 8002ebc: b4 71 10 00 add r2,r3,r17 8002ec0: 34 01 00 01 mvi r1,1 8002ec4: fb ff fd 7d calli 80024b8 8002ec8: b8 20 58 00 mv r11,r1 if ( mt_entry != NULL ) { 8002ecc: 44 20 00 1b be r1,r0,8002f38 <== NEVER TAKEN char *str = (char *) mt_entry + sizeof( *mt_entry ); 8002ed0: 34 2c 00 74 addi r12,r1,116 strcpy( str, filesystemtype ); 8002ed4: b9 80 08 00 mv r1,r12 8002ed8: ba 40 10 00 mv r2,r18 8002edc: f8 00 3d a1 calli 8012560 mt_entry->type = str; 8002ee0: 59 6c 00 6c sw (r11+108),r12 str += filesystemtype_size; 8002ee4: b5 96 60 00 add r12,r12,r22 if ( source_or_null != NULL ) { 8002ee8: 45 c0 00 06 be r14,r0,8002f00 strcpy( str, source_or_null ); 8002eec: b9 80 08 00 mv r1,r12 8002ef0: b9 c0 10 00 mv r2,r14 8002ef4: f8 00 3d 9b calli 8012560 mt_entry->dev = str; 8002ef8: 59 6c 00 70 sw (r11+112),r12 str += source_size; 8002efc: b5 91 60 00 add r12,r12,r17 } strcpy( str, target ); 8002f00: b9 a0 10 00 mv r2,r13 8002f04: b9 80 08 00 mv r1,r12 8002f08: f8 00 3d 96 calli 8012560 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; 8002f0c: 78 03 08 01 mvhi r3,0x801 8002f10: b8 60 10 00 mv r2,r3 8002f14: 35 61 00 38 addi r1,r11,56 8002f18: 38 42 7f 44 ori r2,r2,0x7f44 8002f1c: 34 03 00 30 mvi r3,48 mt_entry->dev = str; str += source_size; } strcpy( str, target ); mt_entry->target = str; 8002f20: 59 6c 00 68 sw (r11+104),r12 &target_length ); if ( !mt_entry ) rtems_set_errno_and_return_minus_one( ENOMEM ); mt_entry->mt_fs_root.mt_entry = mt_entry; 8002f24: 59 6b 00 2c sw (r11+44),r11 mt_entry->options = options; 8002f28: 59 75 00 30 sw (r11+48),r21 mt_entry->pathconf_limits_and_options = rtems_filesystem_default_pathconf; 8002f2c: f8 00 3c 1e calli 8011fa4 /* * The mount_point should be a directory with read/write/execute * permissions in the existing tree. */ if ( has_target ) { 8002f30: 45 e0 00 2f be r15,r0,8002fec 8002f34: e0 00 00 06 bi 8002f4c target, filesystemtype, &target_length ); if ( !mt_entry ) rtems_set_errno_and_return_minus_one( ENOMEM ); 8002f38: f8 00 39 65 calli 80114cc <__errno> <== NOT EXECUTED 8002f3c: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8002f40: 58 22 00 00 sw (r1+0),r2 8002f44: 34 0d ff ff mvi r13,-1 8002f48: e0 00 00 5a bi 80030b0 * The mount_point should be a directory with read/write/execute * permissions in the existing tree. */ if ( has_target ) { if ( rtems_filesystem_evaluate_path( 8002f4c: 37 8c 00 3c addi r12,sp,60 8002f50: ba 80 10 00 mv r2,r20 8002f54: ba 00 08 00 mv r1,r16 8002f58: 34 03 00 07 mvi r3,7 8002f5c: b9 80 20 00 mv r4,r12 8002f60: 34 05 00 01 mvi r5,1 8002f64: fb ff fd a0 calli 80025e4 8002f68: 34 02 ff ff mvi r2,-1 8002f6c: 44 22 00 4a be r1,r2,8003094 <== NEVER TAKEN /* * Test to see if it is a directory */ if ( loc.ops->node_type_h( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 8002f70: 2b 81 00 48 lw r1,(sp+72) 8002f74: 28 23 00 10 lw r3,(r1+16) 8002f78: b9 80 08 00 mv r1,r12 8002f7c: d8 60 00 00 call r3 8002f80: 34 02 00 01 mvi r2,1 8002f84: 44 22 00 04 be r1,r2,8002f94 errno = ENOTDIR; 8002f88: f8 00 39 51 calli 80114cc <__errno> 8002f8c: 34 02 00 14 mvi r2,20 8002f90: e0 00 00 20 bi 8003010 /* * You can only mount one file system onto a single mount point. */ if ( rtems_filesystem_mount_iterate( is_node_fs_root, loc.node_access ) ) { 8002f94: 2b 82 00 3c lw r2,(sp+60) 8002f98: 78 01 08 00 mvhi r1,0x800 8002f9c: 38 21 2d 18 ori r1,r1,0x2d18 8002fa0: fb ff ff 75 calli 8002d74 8002fa4: b8 20 68 00 mv r13,r1 8002fa8: 44 20 00 04 be r1,r0,8002fb8 errno = EBUSY; 8002fac: f8 00 39 48 calli 80114cc <__errno> 8002fb0: 34 02 00 10 mvi r2,16 8002fb4: e0 00 00 17 bi 8003010 * 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; 8002fb8: 2b 81 00 3c lw r1,(sp+60) mt_entry->mt_point_node.handlers = loc.handlers; mt_entry->mt_point_node.ops = loc.ops; mt_entry->mt_point_node.mt_entry = loc.mt_entry; 8002fbc: 2b 82 00 4c lw r2,(sp+76) * 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; 8002fc0: 59 61 00 08 sw (r11+8),r1 mt_entry->mt_point_node.handlers = loc.handlers; 8002fc4: 2b 81 00 44 lw r1,(sp+68) mt_entry->mt_point_node.ops = loc.ops; mt_entry->mt_point_node.mt_entry = loc.mt_entry; 8002fc8: 59 62 00 18 sw (r11+24),r2 * until the system is unmounted. It may be needed to correctly * traverse the tree. */ mt_entry->mt_point_node.node_access = loc.node_access; mt_entry->mt_point_node.handlers = loc.handlers; 8002fcc: 59 61 00 10 sw (r11+16),r1 mt_entry->mt_point_node.ops = loc.ops; 8002fd0: 2b 81 00 48 lw r1,(sp+72) /* * 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 ) ) { 8002fd4: 28 23 00 20 lw r3,(r1+32) * 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; 8002fd8: 59 61 00 14 sw (r11+20),r1 /* * 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 ) ) { 8002fdc: b9 60 08 00 mv r1,r11 8002fe0: d8 60 00 00 call r3 8002fe4: 44 2d 00 0d be r1,r13,8003018 <== ALWAYS TAKEN 8002fe8: e0 00 00 2c bi 8003098 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8002fec: 78 04 08 01 mvhi r4,0x801 8002ff0: 38 84 90 f8 ori r4,r4,0x90f8 } } else { /* * Do we already have a base file system ? */ if ( !rtems_chain_is_empty( &mount_chain ) ) { 8002ff4: 28 81 00 00 lw r1,(r4+0) 8002ff8: 78 03 08 01 mvhi r3,0x801 8002ffc: 38 63 90 fc ori r3,r3,0x90fc ) { 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; 8003000: 34 0c 00 00 mvi r12,0 } } else { /* * Do we already have a base file system ? */ if ( !rtems_chain_is_empty( &mount_chain ) ) { 8003004: 44 23 00 05 be r1,r3,8003018 <== ALWAYS TAKEN errno = EINVAL; 8003008: f8 00 39 31 calli 80114cc <__errno> <== NOT EXECUTED 800300c: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8003010: 58 22 00 00 sw (r1+0),r2 goto cleanup_and_bail; 8003014: e0 00 00 21 bi 8003098 * 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 ) ) { 8003018: b9 60 08 00 mv r1,r11 800301c: ba e0 10 00 mv r2,r23 8003020: da 60 00 00 call r19 8003024: 44 20 00 06 be r1,r0,800303c <== ALWAYS TAKEN /* * Try to undo the mount operation */ loc.ops->unmount_h( mt_entry ); 8003028: 2b 81 00 48 lw r1,(sp+72) <== NOT EXECUTED 800302c: 28 22 00 28 lw r2,(r1+40) <== NOT EXECUTED 8003030: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8003034: d8 40 00 00 call r2 <== NOT EXECUTED goto cleanup_and_bail; 8003038: e0 00 00 18 bi 8003098 <== NOT EXECUTED } /* * Add the mount table entry to the mount table chain */ rtems_libio_lock(); 800303c: fb ff ff 3a calli 8002d24 8003040: 78 01 08 01 mvhi r1,0x801 8003044: 38 21 90 f8 ori r1,r1,0x90f8 8003048: b9 60 10 00 mv r2,r11 rtems_libio_unlock(); if ( !has_target ) rtems_filesystem_root = mt_entry->mt_fs_root; return 0; 800304c: 34 0d 00 00 mvi r13,0 8003050: f8 00 06 d3 calli 8004b9c <_Chain_Append> /* * Add the mount table entry to the mount table chain */ rtems_libio_lock(); rtems_chain_append( &mount_chain, &mt_entry->Node ); rtems_libio_unlock(); 8003054: fb ff ff 3f calli 8002d50 if ( !has_target ) 8003058: 5d ed 00 16 bne r15,r13,80030b0 rtems_filesystem_root = mt_entry->mt_fs_root; 800305c: 78 01 08 01 mvhi r1,0x801 8003060: 38 21 91 04 ori r1,r1,0x9104 8003064: 28 21 00 00 lw r1,(r1+0) 8003068: 29 66 00 1c lw r6,(r11+28) 800306c: 29 65 00 20 lw r5,(r11+32) 8003070: 29 64 00 24 lw r4,(r11+36) 8003074: 29 63 00 28 lw r3,(r11+40) 8003078: 29 62 00 2c lw r2,(r11+44) 800307c: 58 26 00 18 sw (r1+24),r6 8003080: 58 25 00 1c sw (r1+28),r5 8003084: 58 24 00 20 sw (r1+32),r4 8003088: 58 23 00 24 sw (r1+36),r3 800308c: 58 22 00 28 sw (r1+40),r2 8003090: e0 00 00 08 bi 80030b0 ) { 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; 8003094: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED return 0; cleanup_and_bail: free( mt_entry ); 8003098: b9 60 08 00 mv r1,r11 800309c: fb ff fd ac calli 800274c if ( loc_to_free ) rtems_filesystem_freenode( loc_to_free ); return -1; 80030a0: 34 0d ff ff mvi r13,-1 cleanup_and_bail: free( mt_entry ); if ( loc_to_free ) 80030a4: 45 80 00 03 be r12,r0,80030b0 <== NEVER TAKEN rtems_filesystem_freenode( loc_to_free ); 80030a8: b9 80 08 00 mv r1,r12 80030ac: fb ff fd a0 calli 800272c return -1; } 80030b0: b9 a0 08 00 mv r1,r13 80030b4: 2b 9d 00 04 lw ra,(sp+4) 80030b8: 2b 8b 00 38 lw r11,(sp+56) 80030bc: 2b 8c 00 34 lw r12,(sp+52) 80030c0: 2b 8d 00 30 lw r13,(sp+48) 80030c4: 2b 8e 00 2c lw r14,(sp+44) 80030c8: 2b 8f 00 28 lw r15,(sp+40) 80030cc: 2b 90 00 24 lw r16,(sp+36) 80030d0: 2b 91 00 20 lw r17,(sp+32) 80030d4: 2b 92 00 1c lw r18,(sp+28) 80030d8: 2b 93 00 18 lw r19,(sp+24) 80030dc: 2b 94 00 14 lw r20,(sp+20) 80030e0: 2b 95 00 10 lw r21,(sp+16) 80030e4: 2b 96 00 0c lw r22,(sp+12) 80030e8: 2b 97 00 08 lw r23,(sp+8) 80030ec: 37 9c 00 4c addi sp,sp,76 80030f0: c3 a0 00 00 ret =============================================================================== 08002084 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 8002084: 37 9c ff e8 addi sp,sp,-24 8002088: 5b 8b 00 0c sw (sp+12),r11 800208c: 5b 8c 00 08 sw (sp+8),r12 8002090: 5b 9d 00 04 sw (sp+4),ra 8002094: b8 20 60 00 mv r12,r1 8002098: b8 40 58 00 mv r11,r2 int rv = -1; if (target != NULL) { 800209c: 44 40 00 0f be r2,r0,80020d8 rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); 80020a0: b8 40 08 00 mv r1,r2 80020a4: 34 02 01 ff mvi r2,511 80020a8: 5b 83 00 18 sw (sp+24),r3 80020ac: 5b 84 00 14 sw (sp+20),r4 80020b0: 5b 85 00 10 sw (sp+16),r5 80020b4: f8 00 02 8c calli 8002ae4 if (rv == 0) { 80020b8: 2b 83 00 18 lw r3,(sp+24) 80020bc: 2b 84 00 14 lw r4,(sp+20) 80020c0: 2b 85 00 10 lw r5,(sp+16) 80020c4: 5c 20 00 09 bne r1,r0,80020e8 <== NEVER TAKEN rv = mount( 80020c8: b9 80 08 00 mv r1,r12 80020cc: b9 60 10 00 mv r2,r11 80020d0: f8 00 00 44 calli 80021e0 80020d4: e0 00 00 05 bi 80020e8 options, data ); } } else { errno = EINVAL; 80020d8: f8 00 2a 2d calli 800c98c <__errno> 80020dc: 34 02 00 16 mvi r2,22 80020e0: 58 22 00 00 sw (r1+0),r2 const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { int rv = -1; 80020e4: 34 01 ff ff mvi r1,-1 } else { errno = EINVAL; } return rv; } 80020e8: 2b 9d 00 04 lw ra,(sp+4) 80020ec: 2b 8b 00 0c lw r11,(sp+12) 80020f0: 2b 8c 00 08 lw r12,(sp+8) 80020f4: 37 9c 00 18 addi sp,sp,24 80020f8: c3 a0 00 00 ret =============================================================================== 0800331c : void newlib_delete_hook( rtems_tcb *current_task, rtems_tcb *deleted_task ) { 800331c: 37 9c ff f0 addi sp,sp,-16 8003320: 5b 8b 00 10 sw (sp+16),r11 8003324: 5b 8c 00 0c sw (sp+12),r12 8003328: 5b 8d 00 08 sw (sp+8),r13 800332c: 5b 9d 00 04 sw (sp+4),ra 8003330: b8 20 68 00 mv r13,r1 8003334: b8 40 60 00 mv r12,r2 /* * The reentrancy structure was allocated by newlib using malloc() */ if (current_task == deleted_task) { 8003338: 5c 22 00 05 bne r1,r2,800334c ptr = _REENT; 800333c: 78 02 08 01 mvhi r2,0x801 8003340: 38 42 91 d8 ori r2,r2,0x91d8 8003344: 28 4b 00 00 lw r11,(r2+0) 8003348: e0 00 00 02 bi 8003350 } else { ptr = deleted_task->libc_reent; 800334c: 28 4b 01 24 lw r11,(r2+292) } if (ptr && ptr != _global_impure_ptr) { 8003350: 45 60 00 0b be r11,r0,800337c <== NEVER TAKEN 8003354: 78 02 08 01 mvhi r2,0x801 8003358: 38 42 87 28 ori r2,r2,0x8728 800335c: 28 41 00 00 lw r1,(r2+0) 8003360: 45 61 00 07 be r11,r1,800337c _reclaim_reent(ptr); */ /* * Just in case there are some buffers lying around. */ _fwalk(ptr, newlib_free_buffers); 8003364: 78 02 08 00 mvhi r2,0x800 8003368: b9 60 08 00 mv r1,r11 800336c: 38 42 30 f8 ori r2,r2,0x30f8 8003370: f8 00 3a a5 calli 8011e04 <_fwalk> #if REENT_MALLOCED free(ptr); #else _Workspace_Free(ptr); 8003374: b9 60 08 00 mv r1,r11 8003378: f8 00 12 30 calli 8007c38 <_Workspace_Free> #endif } deleted_task->libc_reent = NULL; 800337c: 59 80 01 24 sw (r12+292),r0 /* * Require the switch back to another task to install its own */ if ( current_task == deleted_task ) { 8003380: 5d ac 00 04 bne r13,r12,8003390 _REENT = 0; 8003384: 78 01 08 01 mvhi r1,0x801 8003388: 38 21 91 d8 ori r1,r1,0x91d8 800338c: 58 20 00 00 sw (r1+0),r0 } } 8003390: 2b 9d 00 04 lw ra,(sp+4) 8003394: 2b 8b 00 10 lw r11,(sp+16) 8003398: 2b 8c 00 0c lw r12,(sp+12) 800339c: 2b 8d 00 08 lw r13,(sp+8) 80033a0: 37 9c 00 10 addi sp,sp,16 80033a4: c3 a0 00 00 ret =============================================================================== 080030f8 : */ int newlib_free_buffers( FILE *fp ) { 80030f8: 37 9c ff f8 addi sp,sp,-8 80030fc: 5b 8b 00 08 sw (sp+8),r11 8003100: 5b 9d 00 04 sw (sp+4),ra 8003104: b8 20 58 00 mv r11,r1 switch ( fileno(fp) ) { 8003108: f8 00 3a 06 calli 8011920 800310c: 34 02 00 02 mvi r2,2 8003110: 54 22 00 0c bgu r1,r2,8003140 <== NEVER TAKEN case 0: case 1: case 2: if (fp->_flags & __SMBF) { 8003114: 2d 61 00 0c lhu r1,(r11+12) 8003118: 20 21 00 80 andi r1,r1,0x80 800311c: 44 20 00 0b be r1,r0,8003148 <== ALWAYS TAKEN free( fp->_bf._base ); 8003120: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8003124: fb ff fd 8a calli 800274c <== NOT EXECUTED fp->_flags &= ~__SMBF; 8003128: 2d 61 00 0c lhu r1,(r11+12) <== NOT EXECUTED fp->_bf._base = fp->_p = (unsigned char *) NULL; 800312c: 59 60 00 00 sw (r11+0),r0 <== NOT EXECUTED 8003130: 59 60 00 10 sw (r11+16),r0 <== NOT EXECUTED case 0: case 1: case 2: if (fp->_flags & __SMBF) { free( fp->_bf._base ); fp->_flags &= ~__SMBF; 8003134: 20 21 ff 7f andi r1,r1,0xff7f <== NOT EXECUTED 8003138: 0d 61 00 0c sh (r11+12),r1 <== NOT EXECUTED 800313c: e0 00 00 03 bi 8003148 <== NOT EXECUTED fp->_bf._base = fp->_p = (unsigned char *) NULL; } break; default: fclose(fp); 8003140: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8003144: f8 00 39 42 calli 801164c <== NOT EXECUTED } return 0; } 8003148: 34 01 00 00 mvi r1,0 800314c: 2b 9d 00 04 lw ra,(sp+4) 8003150: 2b 8b 00 08 lw r11,(sp+8) 8003154: 37 9c 00 08 addi sp,sp,8 8003158: c3 a0 00 00 ret =============================================================================== 08001818 : rtems_device_driver null_initialize( rtems_device_major_number major, rtems_device_minor_number minor __attribute__((unused)), void *pargp __attribute__((unused)) ) { 8001818: 37 9c ff f4 addi sp,sp,-12 800181c: 5b 8b 00 0c sw (sp+12),r11 8001820: 5b 8c 00 08 sw (sp+8),r12 8001824: 5b 9d 00 04 sw (sp+4),ra rtems_device_driver status; if ( !initialized ) { 8001828: 78 03 08 02 mvhi r3,0x802 800182c: 38 63 07 30 ori r3,r3,0x730 8001830: 40 6c 00 00 lbu r12,(r3+0) rtems_device_driver null_initialize( rtems_device_major_number major, rtems_device_minor_number minor __attribute__((unused)), void *pargp __attribute__((unused)) ) { 8001834: b8 20 58 00 mv r11,r1 rtems_device_driver status; if ( !initialized ) { 8001838: 5d 80 00 0d bne r12,r0,800186c initialized = 1; 800183c: 34 01 00 01 mvi r1,1 8001840: 30 61 00 00 sb (r3+0),r1 status = rtems_io_register_name( 8001844: 78 01 08 01 mvhi r1,0x801 8001848: 38 21 d3 b0 ori r1,r1,0xd3b0 800184c: b9 60 10 00 mv r2,r11 8001850: 34 03 00 00 mvi r3,0 8001854: f8 00 01 b9 calli 8001f38 "/dev/null", major, (rtems_device_minor_number) 0 ); if (status != RTEMS_SUCCESSFUL) 8001858: 44 2c 00 02 be r1,r12,8001860 <== ALWAYS TAKEN rtems_fatal_error_occurred(status); 800185c: f8 00 0a 9f calli 80042d8 <== NOT EXECUTED NULL_major = major; 8001860: 78 03 08 02 mvhi r3,0x802 8001864: 38 63 07 b8 ori r3,r3,0x7b8 8001868: 58 6b 00 00 sw (r3+0),r11 } return RTEMS_SUCCESSFUL; } 800186c: 34 01 00 00 mvi r1,0 8001870: 2b 9d 00 04 lw ra,(sp+4) 8001874: 2b 8b 00 0c lw r11,(sp+12) 8001878: 2b 8c 00 08 lw r12,(sp+8) 800187c: 37 9c 00 0c addi sp,sp,12 8001880: c3 a0 00 00 ret =============================================================================== 0800189c : void *pargp ) { rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) pargp; if ( rw_args ) 800189c: 44 60 00 03 be r3,r0,80018a8 <== ALWAYS TAKEN rw_args->bytes_moved = rw_args->count; 80018a0: 28 61 00 14 lw r1,(r3+20) <== NOT EXECUTED 80018a4: 58 61 00 1c sw (r3+28),r1 <== NOT EXECUTED return NULL_SUCCESSFUL; } 80018a8: 34 01 00 00 mvi r1,0 80018ac: c3 a0 00 00 ret =============================================================================== 0800342c : int open( const char *pathname, int flags, ... ) { 800342c: 37 9c ff ac addi sp,sp,-84 8003430: 5b 8b 00 24 sw (sp+36),r11 8003434: 5b 8c 00 20 sw (sp+32),r12 8003438: 5b 8d 00 1c sw (sp+28),r13 800343c: 5b 8e 00 18 sw (sp+24),r14 8003440: 5b 8f 00 14 sw (sp+20),r15 8003444: 5b 90 00 10 sw (sp+16),r16 8003448: 5b 91 00 0c sw (sp+12),r17 800344c: 5b 92 00 08 sw (sp+8),r18 8003450: 5b 9d 00 04 sw (sp+4),ra 8003454: b8 20 78 00 mv r15,r1 /* * Set the Evaluation flags */ eval_flags = 0; status = flags + 1; 8003458: 34 41 00 01 addi r1,r2,1 int open( const char *pathname, int flags, ... ) { 800345c: 5b 82 00 3c sw (sp+60),r2 8003460: b8 40 70 00 mv r14,r2 8003464: 5b 83 00 40 sw (sp+64),r3 8003468: 5b 84 00 44 sw (sp+68),r4 800346c: 5b 85 00 48 sw (sp+72),r5 8003470: 5b 86 00 4c sw (sp+76),r6 8003474: 5b 87 00 50 sw (sp+80),r7 8003478: 5b 88 00 54 sw (sp+84),r8 /* * Set the Evaluation flags */ eval_flags = 0; status = flags + 1; if ( ( status & _FREAD ) == _FREAD ) 800347c: 20 22 00 01 andi r2,r1,0x1 int eval_flags; /* * Set the Evaluation flags */ eval_flags = 0; 8003480: 34 10 00 00 mvi r16,0 status = flags + 1; if ( ( status & _FREAD ) == _FREAD ) 8003484: 44 40 00 02 be r2,r0,800348c eval_flags |= RTEMS_LIBIO_PERMS_READ; 8003488: 34 10 00 04 mvi r16,4 if ( ( status & _FWRITE ) == _FWRITE ) 800348c: 20 21 00 02 andi r1,r1,0x2 8003490: 44 20 00 02 be r1,r0,8003498 eval_flags |= RTEMS_LIBIO_PERMS_WRITE; 8003494: 3a 10 00 02 ori r16,r16,0x2 va_start(ap, flags); mode = va_arg( ap, int ); 8003498: 2b 92 00 40 lw r18,(sp+64) * code does not require changes here since network file * descriptors are obtained using socket(), not open(). */ /* allocate a file control block */ iop = rtems_libio_allocate(); 800349c: f8 00 24 46 calli 800c5b4 80034a0: b8 20 58 00 mv r11,r1 int mode; int rc; rtems_libio_t *iop = 0; int status; rtems_filesystem_location_info_t loc; rtems_filesystem_location_info_t *loc_to_free = NULL; 80034a4: 34 0d 00 00 mvi r13,0 */ /* allocate a file control block */ iop = rtems_libio_allocate(); if ( iop == 0 ) { rc = ENFILE; 80034a8: 34 0c 00 17 mvi r12,23 * descriptors are obtained using socket(), not open(). */ /* allocate a file control block */ iop = rtems_libio_allocate(); if ( iop == 0 ) { 80034ac: 44 20 00 62 be r1,r0,8003634 } /* * See if the file exists. */ status = rtems_filesystem_evaluate_path( 80034b0: b9 e0 08 00 mv r1,r15 80034b4: f8 00 3c 72 calli 801267c 80034b8: 37 91 00 28 addi r17,sp,40 80034bc: b8 20 10 00 mv r2,r1 80034c0: ba 00 18 00 mv r3,r16 80034c4: b9 e0 08 00 mv r1,r15 80034c8: ba 20 20 00 mv r4,r17 80034cc: 34 05 00 01 mvi r5,1 80034d0: fb ff fc 45 calli 80025e4 pathname, strlen( pathname ), eval_flags, &loc, true ); if ( status == -1 ) { 80034d4: 34 02 ff ff mvi r2,-1 80034d8: 5c 22 00 1c bne r1,r2,8003548 if ( errno != ENOENT ) { 80034dc: f8 00 37 fc calli 80114cc <__errno> 80034e0: 28 22 00 00 lw r2,(r1+0) 80034e4: 34 01 00 02 mvi r1,2 80034e8: 5c 41 00 0a bne r2,r1,8003510 rc = errno; goto done; } /* If the file does not exist and we are not trying to create it--> error */ if ( !(flags & O_CREAT) ) { 80034ec: 21 c1 02 00 andi r1,r14,0x200 rc = ENOENT; 80034f0: 34 0c 00 02 mvi r12,2 rc = errno; goto done; } /* If the file does not exist and we are not trying to create it--> error */ if ( !(flags & O_CREAT) ) { 80034f4: 44 20 00 50 be r1,r0,8003634 rc = ENOENT; goto done; } /* Create the node for the new regular file */ rc = mknod( pathname, S_IFREG | mode, 0LL ); 80034f8: b9 e0 08 00 mv r1,r15 80034fc: 3a 42 80 00 ori r2,r18,0x8000 8003500: 34 03 00 00 mvi r3,0 8003504: 34 04 00 00 mvi r4,0 8003508: fb ff fd d3 calli 8002c54 if ( rc ) { 800350c: 44 20 00 04 be r1,r0,800351c <== ALWAYS TAKEN rc = errno; 8003510: f8 00 37 ef calli 80114cc <__errno> 8003514: 28 2c 00 00 lw r12,(r1+0) goto done; 8003518: e0 00 00 46 bi 8003630 /* * After we do the mknod(), we have to evaluate the path to get the * "loc" structure needed to actually have the file itself open. * So we created it, and then we need to have "look it up." */ status = rtems_filesystem_evaluate_path( 800351c: b9 e0 08 00 mv r1,r15 8003520: f8 00 3c 57 calli 801267c 8003524: b8 20 10 00 mv r2,r1 8003528: 34 03 00 00 mvi r3,0 800352c: b9 e0 08 00 mv r1,r15 8003530: ba 20 20 00 mv r4,r17 8003534: 34 05 00 01 mvi r5,1 8003538: fb ff fc 2b calli 80025e4 pathname, strlen( pathname ), 0x0, &loc, true ); if ( status != 0 ) { /* The file did not exist */ rc = EACCES; 800353c: 34 0c 00 0d mvi r12,13 * "loc" structure needed to actually have the file itself open. * So we created it, and then we need to have "look it up." */ status = rtems_filesystem_evaluate_path( pathname, strlen( pathname ), 0x0, &loc, true ); if ( status != 0 ) { /* The file did not exist */ 8003540: 5d a1 00 3d bne r13,r1,8003634 <== NEVER TAKEN 8003544: e0 00 00 06 bi 800355c rc = EACCES; goto done; } } else if ((flags & (O_EXCL|O_CREAT)) == (O_EXCL|O_CREAT)) { 8003548: 21 c2 0a 00 andi r2,r14,0xa00 800354c: 34 01 0a 00 mvi r1,2560 /* We were trying to create a file that already exists */ rc = EEXIST; loc_to_free = &loc; 8003550: ba 20 68 00 mv r13,r17 goto done; } } else if ((flags & (O_EXCL|O_CREAT)) == (O_EXCL|O_CREAT)) { /* We were trying to create a file that already exists */ rc = EEXIST; 8003554: 34 0c 00 11 mvi r12,17 if ( status != 0 ) { /* The file did not exist */ rc = EACCES; goto done; } } else if ((flags & (O_EXCL|O_CREAT)) == (O_EXCL|O_CREAT)) { 8003558: 44 41 00 37 be r2,r1,8003634 /* * Fill in the file control block based on the loc structure * returned by successful path evaluation. */ iop->flags |= rtems_libio_fcntl_flags( flags ); 800355c: b9 c0 08 00 mv r1,r14 8003560: 29 6c 00 18 lw r12,(r11+24) 8003564: f8 00 23 ea calli 800c50c iop->pathinfo = loc; 8003568: 2b 82 00 28 lw r2,(sp+40) /* * Fill in the file control block based on the loc structure * returned by successful path evaluation. */ iop->flags |= rtems_libio_fcntl_flags( flags ); 800356c: b8 2c 08 00 or r1,r1,r12 8003570: 59 61 00 18 sw (r11+24),r1 iop->pathinfo = loc; 8003574: 59 62 00 1c sw (r11+28),r2 8003578: 2b 82 00 2c lw r2,(sp+44) 800357c: 2b 81 00 30 lw r1,(sp+48) rc = (*iop->pathinfo.handlers->open_h)( iop, pathname, flags, mode ); 8003580: b9 c0 18 00 mv r3,r14 /* * Fill in the file control block based on the loc structure * returned by successful path evaluation. */ iop->flags |= rtems_libio_fcntl_flags( flags ); iop->pathinfo = loc; 8003584: 59 62 00 20 sw (r11+32),r2 8003588: 2b 82 00 34 lw r2,(sp+52) rc = (*iop->pathinfo.handlers->open_h)( iop, pathname, flags, mode ); 800358c: 28 25 00 00 lw r5,(r1+0) /* * Fill in the file control block based on the loc structure * returned by successful path evaluation. */ iop->flags |= rtems_libio_fcntl_flags( flags ); iop->pathinfo = loc; 8003590: 59 61 00 24 sw (r11+36),r1 8003594: 59 62 00 28 sw (r11+40),r2 8003598: 2b 82 00 38 lw r2,(sp+56) rc = (*iop->pathinfo.handlers->open_h)( iop, pathname, flags, mode ); 800359c: b9 60 08 00 mv r1,r11 80035a0: ba 40 20 00 mv r4,r18 /* * Fill in the file control block based on the loc structure * returned by successful path evaluation. */ iop->flags |= rtems_libio_fcntl_flags( flags ); iop->pathinfo = loc; 80035a4: 59 62 00 2c sw (r11+44),r2 rc = (*iop->pathinfo.handlers->open_h)( iop, pathname, flags, mode ); 80035a8: b9 e0 10 00 mv r2,r15 80035ac: d8 a0 00 00 call r5 if ( rc ) { 80035b0: 44 20 00 05 be r1,r0,80035c4 rc = errno; 80035b4: f8 00 37 c6 calli 80114cc <__errno> 80035b8: 28 2c 00 00 lw r12,(r1+0) rc = EEXIST; loc_to_free = &loc; goto done; } loc_to_free = &loc; 80035bc: 37 8d 00 28 addi r13,sp,40 iop->pathinfo = loc; rc = (*iop->pathinfo.handlers->open_h)( iop, pathname, flags, mode ); if ( rc ) { rc = errno; goto done; 80035c0: e0 00 00 1c bi 8003630 } /* * Optionally truncate the file. */ if ( (flags & O_TRUNC) == O_TRUNC ) { 80035c4: 21 ce 04 00 andi r14,r14,0x400 80035c8: 45 c1 00 25 be r14,r1,800365c rc = ftruncate( iop - rtems_libio_iops, 0 ); 80035cc: 78 01 08 01 mvhi r1,0x801 80035d0: 38 21 97 e8 ori r1,r1,0x97e8 80035d4: 28 21 00 00 lw r1,(r1+0) 80035d8: 34 02 00 06 mvi r2,6 rc = EEXIST; loc_to_free = &loc; goto done; } loc_to_free = &loc; 80035dc: 37 8d 00 28 addi r13,sp,40 /* * Optionally truncate the file. */ if ( (flags & O_TRUNC) == O_TRUNC ) { rc = ftruncate( iop - rtems_libio_iops, 0 ); 80035e0: c9 61 08 00 sub r1,r11,r1 80035e4: f8 00 4e 62 calli 8016f6c <__ashrsi3> 80035e8: 34 02 00 00 mvi r2,0 80035ec: f8 00 23 6a calli 800c394 80035f0: b8 20 60 00 mv r12,r1 if ( rc ) { 80035f4: 44 20 00 0f be r1,r0,8003630 if(errno) rc = errno; 80035f8: f8 00 37 b5 calli 80114cc <__errno> 80035fc: 28 21 00 00 lw r1,(r1+0) 8003600: 44 20 00 03 be r1,r0,800360c <== NEVER TAKEN 8003604: f8 00 37 b2 calli 80114cc <__errno> 8003608: 28 2c 00 00 lw r12,(r1+0) close( iop - rtems_libio_iops ); 800360c: 78 01 08 01 mvhi r1,0x801 8003610: 38 21 97 e8 ori r1,r1,0x97e8 8003614: 28 21 00 00 lw r1,(r1+0) 8003618: 34 02 00 06 mvi r2,6 /* those are released by close(): */ iop = 0; loc_to_free = NULL; 800361c: 34 0d 00 00 mvi r13,0 */ if ( (flags & O_TRUNC) == O_TRUNC ) { rc = ftruncate( iop - rtems_libio_iops, 0 ); if ( rc ) { if(errno) rc = errno; close( iop - rtems_libio_iops ); 8003620: c9 61 08 00 sub r1,r11,r1 8003624: f8 00 4e 52 calli 8016f6c <__ashrsi3> 8003628: f8 00 23 2e calli 800c2e0 /* those are released by close(): */ iop = 0; 800362c: 34 0b 00 00 mvi r11,0 * Single exit and clean up path. */ done: va_end(ap); if ( rc ) { 8003630: 45 80 00 0b be r12,r0,800365c if ( iop ) 8003634: 45 60 00 03 be r11,r0,8003640 rtems_libio_free( iop ); 8003638: b9 60 08 00 mv r1,r11 800363c: f8 00 24 0c calli 800c66c if ( loc_to_free ) 8003640: 45 a0 00 03 be r13,r0,800364c rtems_filesystem_freenode( loc_to_free ); 8003644: b9 a0 08 00 mv r1,r13 8003648: fb ff fc 39 calli 800272c rtems_set_errno_and_return_minus_one( rc ); 800364c: f8 00 37 a0 calli 80114cc <__errno> 8003650: 58 2c 00 00 sw (r1+0),r12 8003654: 34 01 ff ff mvi r1,-1 8003658: e0 00 00 07 bi 8003674 } return iop - rtems_libio_iops; 800365c: 78 01 08 01 mvhi r1,0x801 8003660: 38 21 97 e8 ori r1,r1,0x97e8 8003664: 28 21 00 00 lw r1,(r1+0) 8003668: 34 02 00 06 mvi r2,6 800366c: c9 61 08 00 sub r1,r11,r1 8003670: f8 00 4e 3f calli 8016f6c <__ashrsi3> } 8003674: 2b 9d 00 04 lw ra,(sp+4) 8003678: 2b 8b 00 24 lw r11,(sp+36) 800367c: 2b 8c 00 20 lw r12,(sp+32) 8003680: 2b 8d 00 1c lw r13,(sp+28) 8003684: 2b 8e 00 18 lw r14,(sp+24) 8003688: 2b 8f 00 14 lw r15,(sp+20) 800368c: 2b 90 00 10 lw r16,(sp+16) 8003690: 2b 91 00 0c lw r17,(sp+12) 8003694: 2b 92 00 08 lw r18,(sp+8) 8003698: 37 9c 00 54 addi sp,sp,84 800369c: c3 a0 00 00 ret =============================================================================== 080033a8 : /* * This is a replaceable stub which opens the console, if present. */ void open_dev_console(void) { 80033a8: 37 9c ff f4 addi sp,sp,-12 80033ac: 5b 8b 00 0c sw (sp+12),r11 80033b0: 5b 8c 00 08 sw (sp+8),r12 80033b4: 5b 9d 00 04 sw (sp+4),ra int stderr_fd; /* * Attempt to open /dev/console. */ if ((stdin_fd = open("/dev/console", O_RDONLY, 0)) == -1) { 80033b8: 78 0b 08 01 mvhi r11,0x801 80033bc: 39 6b 7e 6c ori r11,r11,0x7e6c 80033c0: b9 60 08 00 mv r1,r11 80033c4: 34 02 00 00 mvi r2,0 80033c8: 34 03 00 00 mvi r3,0 80033cc: f8 00 00 18 calli 800342c 80033d0: 34 0c ff ff mvi r12,-1 80033d4: 44 2c 00 11 be r1,r12,8003418 /* * But if we find /dev/console once, we better find it twice more * or something is REALLY wrong. */ if ((stdout_fd = open("/dev/console", O_WRONLY, 0)) == -1) 80033d8: 34 02 00 01 mvi r2,1 80033dc: b9 60 08 00 mv r1,r11 80033e0: 34 03 00 00 mvi r3,0 80033e4: f8 00 00 12 calli 800342c rtems_fatal_error_occurred( 0x55544431 ); /* error STD1 */ 80033e8: 78 02 08 01 mvhi r2,0x801 80033ec: 38 42 7f 78 ori r2,r2,0x7f78 /* * But if we find /dev/console once, we better find it twice more * or something is REALLY wrong. */ if ((stdout_fd = open("/dev/console", O_WRONLY, 0)) == -1) 80033f0: 44 2c 00 08 be r1,r12,8003410 <== NEVER TAKEN rtems_fatal_error_occurred( 0x55544431 ); /* error STD1 */ if ((stderr_fd = open("/dev/console", O_WRONLY, 0)) == -1) 80033f4: b9 60 08 00 mv r1,r11 80033f8: 34 02 00 01 mvi r2,1 80033fc: 34 03 00 00 mvi r3,0 8003400: f8 00 00 0b calli 800342c 8003404: 5c 2c 00 05 bne r1,r12,8003418 <== ALWAYS TAKEN rtems_fatal_error_occurred( 0x55544432 ); /* error STD2 */ 8003408: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 800340c: 38 42 7f 7c ori r2,r2,0x7f7c <== NOT EXECUTED 8003410: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 8003414: f8 00 04 52 calli 800455c <== NOT EXECUTED } 8003418: 2b 9d 00 04 lw ra,(sp+4) 800341c: 2b 8b 00 0c lw r11,(sp+12) 8003420: 2b 8c 00 08 lw r12,(sp+8) 8003424: 37 9c 00 0c addi sp,sp,12 8003428: c3 a0 00 00 ret =============================================================================== 080053cc : /* * Handle output processing */ static void oproc (unsigned char c, struct rtems_termios_tty *tty) { 80053cc: 37 9c ff f4 addi sp,sp,-12 80053d0: 5b 8b 00 08 sw (sp+8),r11 80053d4: 5b 9d 00 04 sw (sp+4),ra 80053d8: 33 81 00 0c sb (sp+12),r1 int i; if (tty->termios.c_oflag & OPOST) { 80053dc: 28 41 00 34 lw r1,(r2+52) /* * Handle output processing */ static void oproc (unsigned char c, struct rtems_termios_tty *tty) { 80053e0: b8 40 58 00 mv r11,r2 int i; if (tty->termios.c_oflag & OPOST) { 80053e4: 20 22 00 01 andi r2,r1,0x1 80053e8: 44 40 00 4d be r2,r0,800551c <== NEVER TAKEN switch (c) { 80053ec: 43 82 00 0c lbu r2,(sp+12) 80053f0: 34 03 00 09 mvi r3,9 80053f4: 44 43 00 21 be r2,r3,8005478 80053f8: 54 43 00 04 bgu r2,r3,8005408 <== ALWAYS TAKEN 80053fc: 34 03 00 08 mvi r3,8 <== NOT EXECUTED 8005400: 5c 43 00 30 bne r2,r3,80054c0 <== NOT EXECUTED 8005404: e0 00 00 2b bi 80054b0 <== NOT EXECUTED 8005408: 34 03 00 0a mvi r3,10 800540c: 44 43 00 04 be r2,r3,800541c 8005410: 34 03 00 0d mvi r3,13 8005414: 5c 43 00 2b bne r2,r3,80054c0 <== ALWAYS TAKEN 8005418: e0 00 00 0c bi 8005448 <== NOT EXECUTED case '\n': if (tty->termios.c_oflag & ONLRET) 800541c: 20 22 00 20 andi r2,r1,0x20 8005420: 44 40 00 02 be r2,r0,8005428 <== ALWAYS TAKEN tty->column = 0; 8005424: 59 60 00 28 sw (r11+40),r0 <== NOT EXECUTED if (tty->termios.c_oflag & ONLCR) { 8005428: 20 21 00 04 andi r1,r1,0x4 800542c: 44 20 00 3c be r1,r0,800551c <== NEVER TAKEN rtems_termios_puts ("\r", 1, tty); 8005430: 78 01 08 02 mvhi r1,0x802 8005434: 38 21 0b a0 ori r1,r1,0xba0 8005438: 34 02 00 01 mvi r2,1 800543c: b9 60 18 00 mv r3,r11 8005440: fb ff ff 8d calli 8005274 8005444: e0 00 00 0b bi 8005470 tty->column = 0; } break; case '\r': if ((tty->termios.c_oflag & ONOCR) && (tty->column == 0)) 8005448: 20 22 00 10 andi r2,r1,0x10 <== NOT EXECUTED 800544c: 44 40 00 03 be r2,r0,8005458 <== NOT EXECUTED 8005450: 29 62 00 28 lw r2,(r11+40) <== NOT EXECUTED 8005454: 44 40 00 36 be r2,r0,800552c <== NOT EXECUTED return; if (tty->termios.c_oflag & OCRNL) { 8005458: 20 22 00 08 andi r2,r1,0x8 <== NOT EXECUTED 800545c: 44 40 00 05 be r2,r0,8005470 <== NOT EXECUTED c = '\n'; 8005460: 34 02 00 0a mvi r2,10 <== NOT EXECUTED 8005464: 33 82 00 0c sb (sp+12),r2 <== NOT EXECUTED if (tty->termios.c_oflag & ONLRET) 8005468: 20 21 00 20 andi r1,r1,0x20 <== NOT EXECUTED 800546c: 44 20 00 2c be r1,r0,800551c <== NOT EXECUTED tty->column = 0; break; } tty->column = 0; 8005470: 59 60 00 28 sw (r11+40),r0 break; 8005474: e0 00 00 2a bi 800551c case '\t': i = 8 - (tty->column & 7); 8005478: 29 63 00 28 lw r3,(r11+40) 800547c: 34 04 00 08 mvi r4,8 if ((tty->termios.c_oflag & TABDLY) == XTABS) { 8005480: 20 21 18 00 andi r1,r1,0x1800 } tty->column = 0; break; case '\t': i = 8 - (tty->column & 7); 8005484: 20 62 00 07 andi r2,r3,0x7 8005488: c8 82 10 00 sub r2,r4,r2 if ((tty->termios.c_oflag & TABDLY) == XTABS) { 800548c: 34 04 18 00 mvi r4,6144 8005490: b4 43 18 00 add r3,r2,r3 8005494: 5c 24 00 05 bne r1,r4,80054a8 <== NEVER TAKEN tty->column += i; rtems_termios_puts ( " ", i, tty); 8005498: 78 01 08 02 mvhi r1,0x802 break; case '\t': i = 8 - (tty->column & 7); if ((tty->termios.c_oflag & TABDLY) == XTABS) { tty->column += i; 800549c: 59 63 00 28 sw (r11+40),r3 rtems_termios_puts ( " ", i, tty); 80054a0: 38 21 0b a4 ori r1,r1,0xba4 80054a4: e0 00 00 20 bi 8005524 return; } tty->column += i; 80054a8: 59 63 00 28 sw (r11+40),r3 <== NOT EXECUTED break; 80054ac: e0 00 00 1c bi 800551c <== NOT EXECUTED case '\b': if (tty->column > 0) 80054b0: 29 61 00 28 lw r1,(r11+40) <== NOT EXECUTED 80054b4: 4c 01 00 1a bge r0,r1,800551c <== NOT EXECUTED tty->column--; 80054b8: 34 21 ff ff addi r1,r1,-1 <== NOT EXECUTED 80054bc: e0 00 00 17 bi 8005518 <== NOT EXECUTED break; default: if (tty->termios.c_oflag & OLCUC) 80054c0: 20 21 00 02 andi r1,r1,0x2 80054c4: 44 20 00 0b be r1,r0,80054f0 <== ALWAYS TAKEN c = toupper(c); 80054c8: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 80054cc: 38 21 33 10 ori r1,r1,0x3310 <== NOT EXECUTED 80054d0: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED 80054d4: b4 22 08 00 add r1,r1,r2 <== NOT EXECUTED 80054d8: 40 23 00 01 lbu r3,(r1+1) <== NOT EXECUTED 80054dc: 34 01 00 02 mvi r1,2 <== NOT EXECUTED 80054e0: 20 63 00 03 andi r3,r3,0x3 <== NOT EXECUTED 80054e4: 5c 61 00 02 bne r3,r1,80054ec <== NOT EXECUTED 80054e8: 34 42 ff e0 addi r2,r2,-32 <== NOT EXECUTED 80054ec: 33 82 00 0c sb (sp+12),r2 <== NOT EXECUTED if (!iscntrl(c)) 80054f0: 78 01 08 02 mvhi r1,0x802 80054f4: 38 21 33 10 ori r1,r1,0x3310 80054f8: 43 82 00 0c lbu r2,(sp+12) 80054fc: 28 21 00 00 lw r1,(r1+0) 8005500: b4 22 08 00 add r1,r1,r2 8005504: 40 21 00 01 lbu r1,(r1+1) 8005508: 20 21 00 20 andi r1,r1,0x20 800550c: 5c 20 00 04 bne r1,r0,800551c <== NEVER TAKEN tty->column++; 8005510: 29 61 00 28 lw r1,(r11+40) 8005514: 34 21 00 01 addi r1,r1,1 8005518: 59 61 00 28 sw (r11+40),r1 break; } } rtems_termios_puts (&c, 1, tty); 800551c: 37 81 00 0c addi r1,sp,12 8005520: 34 02 00 01 mvi r2,1 8005524: b9 60 18 00 mv r3,r11 8005528: fb ff ff 53 calli 8005274 } 800552c: 2b 9d 00 04 lw ra,(sp+4) 8005530: 2b 8b 00 08 lw r11,(sp+8) 8005534: 37 9c 00 0c addi sp,sp,12 8005538: c3 a0 00 00 ret =============================================================================== 0800923c : * Called by pipe() to create an anonymous pipe. */ int pipe_create( int filsdes[2] ) { 800923c: 37 9c ff d8 addi sp,sp,-40 8009240: 5b 8b 00 18 sw (sp+24),r11 8009244: 5b 8c 00 14 sw (sp+20),r12 8009248: 5b 8d 00 10 sw (sp+16),r13 800924c: 5b 8e 00 0c sw (sp+12),r14 8009250: 5b 8f 00 08 sw (sp+8),r15 8009254: 5b 9d 00 04 sw (sp+4),ra 8009258: b8 20 70 00 mv r14,r1 rtems_libio_t *iop; int err = 0; if (rtems_mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO) != 0) 800925c: 78 01 08 01 mvhi r1,0x801 8009260: 38 21 e4 00 ori r1,r1,0xe400 8009264: 34 02 01 ff mvi r2,511 8009268: f8 00 06 6e calli 800ac20 800926c: b8 20 78 00 mv r15,r1 return -1; 8009270: 34 0d ff ff mvi r13,-1 ) { rtems_libio_t *iop; int err = 0; if (rtems_mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO) != 0) 8009274: 5c 20 00 43 bne r1,r0,8009380 <== NEVER TAKEN return -1; /* /tmp/.fifoXXXX */ char fifopath[15]; memcpy(fifopath, "/tmp/.fifo", 10); 8009278: 78 02 08 01 mvhi r2,0x801 800927c: 38 42 e4 08 ori r2,r2,0xe408 8009280: 28 43 00 00 lw r3,(r2+0) 8009284: 28 41 00 04 lw r1,(r2+4) 8009288: 37 8b 00 1c addi r11,sp,28 800928c: 5b 83 00 1c sw (sp+28),r3 8009290: 59 61 00 04 sw (r11+4),r1 8009294: 2c 41 00 08 lhu r1,(r2+8) sprintf(fifopath + 10, "%04x", rtems_pipe_no ++); 8009298: 78 02 08 02 mvhi r2,0x802 800929c: 38 42 06 cc ori r2,r2,0x6cc 80092a0: 2c 43 00 00 lhu r3,(r2+0) if (rtems_mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO) != 0) return -1; /* /tmp/.fifoXXXX */ char fifopath[15]; memcpy(fifopath, "/tmp/.fifo", 10); 80092a4: 0d 61 00 08 sh (r11+8),r1 sprintf(fifopath + 10, "%04x", rtems_pipe_no ++); 80092a8: 34 61 00 01 addi r1,r3,1 80092ac: 0c 41 00 00 sh (r2+0),r1 80092b0: 78 02 08 01 mvhi r2,0x801 80092b4: 38 42 e4 14 ori r2,r2,0xe414 80092b8: 37 81 00 26 addi r1,sp,38 80092bc: f8 00 18 40 calli 800f3bc /* Try creating FIFO file until find an available file name */ while (mkfifo(fifopath, S_IRUSR|S_IWUSR) != 0) { 80092c0: b9 60 08 00 mv r1,r11 80092c4: 34 02 01 80 mvi r2,384 80092c8: f8 00 05 8f calli 800a904 80092cc: b8 20 60 00 mv r12,r1 80092d0: 44 2f 00 03 be r1,r15,80092dc if (errno != EEXIST){ 80092d4: f8 00 14 b9 calli 800e5b8 <__errno> 80092d8: e0 00 00 2a bi 8009380 return -1; sprintf(fifopath + 10, "%04x", rtems_pipe_no ++); } /* Non-blocking open to avoid waiting for writers */ filsdes[0] = open(fifopath, O_RDONLY | O_NONBLOCK); 80092dc: b9 60 08 00 mv r1,r11 80092e0: 34 02 40 00 mvi r2,16384 80092e4: fb ff e9 92 calli 800392c 80092e8: 59 c1 00 00 sw (r14+0),r1 if (filsdes[0] < 0) { 80092ec: 4c 2c 00 05 bge r1,r12,8009300 err = errno; 80092f0: f8 00 14 b2 calli 800e5b8 <__errno> 80092f4: 28 2c 00 00 lw r12,(r1+0) /* Delete file at errors, or else if pipe is successfully created the file node will be deleted after it is closed by all. */ unlink(fifopath); 80092f8: b9 60 08 00 mv r1,r11 80092fc: e0 00 00 1b bi 8009368 } else { /* Reset open file to blocking mode */ iop = rtems_libio_iop(filsdes[0]); 8009300: 78 02 08 02 mvhi r2,0x802 8009304: 38 42 00 10 ori r2,r2,0x10 8009308: 28 44 00 00 lw r4,(r2+0) 800930c: 34 02 00 00 mvi r2,0 8009310: 50 24 00 07 bgeu r1,r4,800932c <== NEVER TAKEN 8009314: 34 02 00 06 mvi r2,6 8009318: 78 0b 08 02 mvhi r11,0x802 800931c: f8 00 4d ef calli 801cad8 <__ashlsi3> 8009320: 39 6b 07 44 ori r11,r11,0x744 8009324: 29 62 00 00 lw r2,(r11+0) 8009328: b4 41 10 00 add r2,r2,r1 iop->flags &= ~LIBIO_FLAGS_NO_DELAY; 800932c: 28 43 00 18 lw r3,(r2+24) 8009330: 34 01 ff fe mvi r1,-2 int pipe_create( int filsdes[2] ) { rtems_libio_t *iop; int err = 0; 8009334: 34 0c 00 00 mvi r12,0 unlink(fifopath); } else { /* Reset open file to blocking mode */ iop = rtems_libio_iop(filsdes[0]); iop->flags &= ~LIBIO_FLAGS_NO_DELAY; 8009338: a0 61 08 00 and r1,r3,r1 800933c: 58 41 00 18 sw (r2+24),r1 filsdes[1] = open(fifopath, O_WRONLY); 8009340: 37 81 00 1c addi r1,sp,28 8009344: 34 02 00 01 mvi r2,1 8009348: fb ff e9 79 calli 800392c 800934c: 59 c1 00 04 sw (r14+4),r1 if (filsdes[1] < 0) { 8009350: 4c 20 00 05 bge r1,r0,8009364 err = errno; 8009354: f8 00 14 99 calli 800e5b8 <__errno> 8009358: 28 2c 00 00 lw r12,(r1+0) close(filsdes[0]); 800935c: 29 c1 00 00 lw r1,(r14+0) 8009360: fb ff e4 c0 calli 8002660 } unlink(fifopath); 8009364: 37 81 00 1c addi r1,sp,28 8009368: fb ff ea 83 calli 8003d74 } if(err != 0) rtems_set_errno_and_return_minus_one(err); return 0; 800936c: 34 0d 00 00 mvi r13,0 err = errno; close(filsdes[0]); } unlink(fifopath); } if(err != 0) 8009370: 45 80 00 04 be r12,r0,8009380 rtems_set_errno_and_return_minus_one(err); 8009374: f8 00 14 91 calli 800e5b8 <__errno> 8009378: 58 2c 00 00 sw (r1+0),r12 800937c: 34 0d ff ff mvi r13,-1 return 0; } 8009380: b9 a0 08 00 mv r1,r13 8009384: 2b 9d 00 04 lw ra,(sp+4) 8009388: 2b 8b 00 18 lw r11,(sp+24) 800938c: 2b 8c 00 14 lw r12,(sp+20) 8009390: 2b 8d 00 10 lw r13,(sp+16) 8009394: 2b 8e 00 0c lw r14,(sp+12) 8009398: 2b 8f 00 08 lw r15,(sp+8) 800939c: 37 9c 00 28 addi sp,sp,40 80093a0: c3 a0 00 00 ret =============================================================================== 0800a0bc : pipe_control_t *pipe, uint32_t cmd, void *buffer, rtems_libio_t *iop ) { 800a0bc: 37 9c ff f4 addi sp,sp,-12 800a0c0: 5b 8b 00 0c sw (sp+12),r11 800a0c4: 5b 8c 00 08 sw (sp+8),r12 800a0c8: 5b 9d 00 04 sw (sp+4),ra 800a0cc: b8 60 60 00 mv r12,r3 if (cmd == FIONREAD) { 800a0d0: 78 03 08 01 mvhi r3,0x801 800a0d4: 38 63 e4 30 ori r3,r3,0xe430 pipe_control_t *pipe, uint32_t cmd, void *buffer, rtems_libio_t *iop ) { 800a0d8: b8 20 58 00 mv r11,r1 if (cmd == FIONREAD) { 800a0dc: 28 61 00 00 lw r1,(r3+0) *(unsigned int *)buffer = pipe->Length; PIPE_UNLOCK(pipe); return 0; } return -EINVAL; 800a0e0: 34 04 ff ea mvi r4,-22 uint32_t cmd, void *buffer, rtems_libio_t *iop ) { if (cmd == FIONREAD) { 800a0e4: 5c 41 00 0e bne r2,r1,800a11c if (buffer == NULL) return -EFAULT; 800a0e8: 34 04 ff f2 mvi r4,-14 void *buffer, rtems_libio_t *iop ) { if (cmd == FIONREAD) { if (buffer == NULL) 800a0ec: 45 80 00 0c be r12,r0,800a11c return -EFAULT; if (! PIPE_LOCK(pipe)) 800a0f0: 29 61 00 28 lw r1,(r11+40) 800a0f4: 34 02 00 00 mvi r2,0 800a0f8: 34 03 00 00 mvi r3,0 800a0fc: fb ff e9 2a calli 80045a4 return -EINTR; 800a100: 34 04 ff fc mvi r4,-4 { if (cmd == FIONREAD) { if (buffer == NULL) return -EFAULT; if (! PIPE_LOCK(pipe)) 800a104: 5c 20 00 06 bne r1,r0,800a11c <== NEVER TAKEN return -EINTR; /* Return length of pipe */ *(unsigned int *)buffer = pipe->Length; 800a108: 29 61 00 0c lw r1,(r11+12) 800a10c: 59 81 00 00 sw (r12+0),r1 PIPE_UNLOCK(pipe); 800a110: 29 61 00 28 lw r1,(r11+40) 800a114: fb ff e9 74 calli 80046e4 return 0; 800a118: 34 04 00 00 mvi r4,0 } return -EINVAL; } 800a11c: b8 80 08 00 mv r1,r4 800a120: 2b 9d 00 04 lw ra,(sp+4) 800a124: 2b 8b 00 0c lw r11,(sp+12) 800a128: 2b 8c 00 08 lw r12,(sp+8) 800a12c: 37 9c 00 0c addi sp,sp,12 800a130: c3 a0 00 00 ret =============================================================================== 08009730 : free(pipe->Buffer); free(pipe); } static rtems_status_code pipe_lock(void) { 8009730: 37 9c ff f4 addi sp,sp,-12 8009734: 5b 8b 00 0c sw (sp+12),r11 8009738: 5b 8c 00 08 sw (sp+8),r12 800973c: 5b 9d 00 04 sw (sp+4),ra rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 8009740: 78 0b 08 02 mvhi r11,0x802 8009744: 39 6b 06 d0 ori r11,r11,0x6d0 8009748: 29 61 00 00 lw r1,(r11+0) 800974c: 5c 20 00 19 bne r1,r0,80097b0 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 ); 8009750: 78 01 08 02 mvhi r1,0x802 8009754: 38 21 07 4c ori r1,r1,0x74c 8009758: 28 21 00 00 lw r1,(r1+0) 800975c: 34 02 00 00 mvi r2,0 8009760: 34 03 00 00 mvi r3,0 8009764: fb ff eb 90 calli 80045a4 rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { 8009768: 29 61 00 00 lw r1,(r11+0) free(pipe); } static rtems_status_code pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; 800976c: 34 0c 00 00 mvi r12,0 if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { 8009770: 5c 2c 00 0a bne r1,r12,8009798 <== NEVER TAKEN sc = rtems_semaphore_create( 8009774: 78 02 08 01 mvhi r2,0x801 8009778: 38 42 e4 1c ori r2,r2,0xe41c 800977c: 28 41 00 00 lw r1,(r2+0) 8009780: 34 03 00 54 mvi r3,84 8009784: 34 02 00 01 mvi r2,1 8009788: 34 04 00 00 mvi r4,0 800978c: b9 60 28 00 mv r5,r11 8009790: fb ff ea d9 calli 80042f4 8009794: b8 20 60 00 mv r12,r1 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 8009798: 78 01 08 02 mvhi r1,0x802 800979c: 38 21 07 4c ori r1,r1,0x74c 80097a0: 28 21 00 00 lw r1,(r1+0) 80097a4: fb ff eb d0 calli 80046e4 } if (sc == RTEMS_SUCCESSFUL) { return 0; } else { return -ENOMEM; 80097a8: 34 01 ff f4 mvi r1,-12 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { 80097ac: 5d 80 00 0b bne r12,r0,80097d8 sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 80097b0: 78 01 08 02 mvhi r1,0x802 80097b4: 38 21 06 d0 ori r1,r1,0x6d0 80097b8: 28 21 00 00 lw r1,(r1+0) 80097bc: 34 02 00 00 mvi r2,0 80097c0: 34 03 00 00 mvi r3,0 80097c4: fb ff eb 78 calli 80045a4 } if (sc == RTEMS_SUCCESSFUL) { return 0; } else { return -ENOMEM; 80097c8: 64 21 00 00 cmpei r1,r1,0 80097cc: c8 01 08 00 sub r1,r0,r1 80097d0: 20 21 00 0c andi r1,r1,0xc 80097d4: 34 21 ff f4 addi r1,r1,-12 } } 80097d8: 2b 9d 00 04 lw ra,(sp+4) 80097dc: 2b 8b 00 0c lw r11,(sp+12) 80097e0: 2b 8c 00 08 lw r12,(sp+8) 80097e4: 37 9c 00 0c addi sp,sp,12 80097e8: c3 a0 00 00 ret =============================================================================== 08009d10 : pipe_control_t *pipe, void *buffer, size_t count, rtems_libio_t *iop ) { 8009d10: 37 9c ff d8 addi sp,sp,-40 8009d14: 5b 8b 00 24 sw (sp+36),r11 8009d18: 5b 8c 00 20 sw (sp+32),r12 8009d1c: 5b 8d 00 1c sw (sp+28),r13 8009d20: 5b 8e 00 18 sw (sp+24),r14 8009d24: 5b 8f 00 14 sw (sp+20),r15 8009d28: 5b 90 00 10 sw (sp+16),r16 8009d2c: 5b 91 00 0c sw (sp+12),r17 8009d30: 5b 92 00 08 sw (sp+8),r18 8009d34: 5b 9d 00 04 sw (sp+4),ra 8009d38: b8 20 58 00 mv r11,r1 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) 8009d3c: 28 21 00 28 lw r1,(r1+40) pipe_control_t *pipe, void *buffer, size_t count, rtems_libio_t *iop ) { 8009d40: b8 40 78 00 mv r15,r2 8009d44: b8 60 80 00 mv r16,r3 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) 8009d48: 34 02 00 00 mvi r2,0 8009d4c: 34 03 00 00 mvi r3,0 pipe_control_t *pipe, void *buffer, size_t count, rtems_libio_t *iop ) { 8009d50: b8 80 88 00 mv r17,r4 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) 8009d54: fb ff ea 14 calli 80045a4 return -EINTR; 8009d58: 34 0c ff fc mvi r12,-4 rtems_libio_t *iop ) { int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) 8009d5c: 5c 20 00 4d bne r1,r0,8009e90 <== NEVER TAKEN 8009d60: 34 0c 00 00 mvi r12,0 } /* Wait until pipe is no more empty or no writer exists */ pipe->waitingReaders ++; PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) 8009d64: 34 12 ff fc mvi r18,-4 8009d68: e0 00 00 3f bi 8009e64 return -EINTR; while (read < count) { while (PIPE_EMPTY(pipe)) { /* Not an error */ if (pipe->Writers == 0) 8009d6c: 29 61 00 14 lw r1,(r11+20) 8009d70: 44 2d 00 3e be r1,r13,8009e68 <== NEVER TAKEN goto out_locked; if (LIBIO_NODELAY(iop)) { 8009d74: 2a 2d 00 18 lw r13,(r17+24) 8009d78: 21 ad 00 01 andi r13,r13,0x1 8009d7c: 5d a0 00 3d bne r13,r0,8009e70 <== NEVER TAKEN ret = -EAGAIN; goto out_locked; } /* Wait until pipe is no more empty or no writer exists */ pipe->waitingReaders ++; 8009d80: 29 61 00 18 lw r1,(r11+24) 8009d84: 34 21 00 01 addi r1,r1,1 8009d88: 59 61 00 18 sw (r11+24),r1 PIPE_UNLOCK(pipe); 8009d8c: 29 61 00 28 lw r1,(r11+40) 8009d90: fb ff ea 55 calli 80046e4 if (! PIPE_READWAIT(pipe)) 8009d94: 29 61 00 2c lw r1,(r11+44) 8009d98: 34 02 00 00 mvi r2,0 8009d9c: f8 00 07 55 calli 800baf0 8009da0: fc 2d 68 00 cmpne r13,r1,r13 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 8009da4: 29 61 00 28 lw r1,(r11+40) } /* Wait until pipe is no more empty or no writer exists */ pipe->waitingReaders ++; PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) 8009da8: c8 0d 68 00 sub r13,r0,r13 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 8009dac: 34 02 00 00 mvi r2,0 8009db0: 34 03 00 00 mvi r3,0 } /* Wait until pipe is no more empty or no writer exists */ pipe->waitingReaders ++; PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) 8009db4: a1 b2 68 00 and r13,r13,r18 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 8009db8: fb ff e9 fb calli 80045a4 8009dbc: 5c 20 00 31 bne r1,r0,8009e80 <== NEVER TAKEN /* WARN waitingReaders not restored! */ ret = -EINTR; goto out_nolock; } pipe->waitingReaders --; 8009dc0: 29 62 00 18 lw r2,(r11+24) 8009dc4: 34 42 ff ff addi r2,r2,-1 8009dc8: 59 62 00 18 sw (r11+24),r2 if (ret != 0) 8009dcc: 5d a1 00 2a bne r13,r1,8009e74 <== NEVER TAKEN if (! PIPE_LOCK(pipe)) return -EINTR; while (read < count) { while (PIPE_EMPTY(pipe)) { 8009dd0: 29 6d 00 0c lw r13,(r11+12) 8009dd4: 45 a0 ff e6 be r13,r0,8009d6c if (ret != 0) goto out_locked; } /* Read chunk bytes */ chunk = MIN(count - read, pipe->Length); 8009dd8: ca 0c 08 00 sub r1,r16,r12 8009ddc: 50 2d 00 02 bgeu r1,r13,8009de4 8009de0: b8 20 68 00 mv r13,r1 chunk1 = pipe->Size - pipe->Start; 8009de4: 29 65 00 08 lw r5,(r11+8) 8009de8: 29 6e 00 04 lw r14,(r11+4) 8009dec: 29 66 00 00 lw r6,(r11+0) 8009df0: b5 ec 08 00 add r1,r15,r12 8009df4: c9 c5 70 00 sub r14,r14,r5 if (chunk > chunk1) { 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); 8009df8: b4 c5 10 00 add r2,r6,r5 8009dfc: b9 a0 18 00 mv r3,r13 } /* Read chunk bytes */ chunk = MIN(count - read, pipe->Length); chunk1 = pipe->Size - pipe->Start; if (chunk > chunk1) { 8009e00: 4d cd 00 08 bge r14,r13,8009e20 memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk1); 8009e04: b4 c5 10 00 add r2,r6,r5 8009e08: b9 c0 18 00 mv r3,r14 8009e0c: f8 00 14 a1 calli 800f090 memcpy(buffer + read + chunk1, pipe->Buffer, chunk - chunk1); 8009e10: 29 62 00 00 lw r2,(r11+0) 8009e14: b5 8e 08 00 add r1,r12,r14 8009e18: b5 e1 08 00 add r1,r15,r1 8009e1c: c9 ae 18 00 sub r3,r13,r14 } else memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk); 8009e20: f8 00 14 9c calli 800f090 pipe->Start += chunk; 8009e24: 29 61 00 08 lw r1,(r11+8) pipe->Start %= pipe->Size; 8009e28: 29 62 00 04 lw r2,(r11+4) 8009e2c: b5 a1 08 00 add r1,r13,r1 8009e30: f8 00 4c 14 calli 801ce80 <__umodsi3> 8009e34: 59 61 00 08 sw (r11+8),r1 pipe->Length -= chunk; 8009e38: 29 61 00 0c lw r1,(r11+12) 8009e3c: c8 2d 08 00 sub r1,r1,r13 8009e40: 59 61 00 0c sw (r11+12),r1 /* For buffering optimization */ if (PIPE_EMPTY(pipe)) 8009e44: 5c 20 00 02 bne r1,r0,8009e4c pipe->Start = 0; 8009e48: 59 60 00 08 sw (r11+8),r0 if (pipe->waitingWriters > 0) 8009e4c: 29 61 00 1c lw r1,(r11+28) 8009e50: 44 20 00 04 be r1,r0,8009e60 PIPE_WAKEUPWRITERS(pipe); 8009e54: 29 61 00 30 lw r1,(r11+48) 8009e58: 37 82 00 28 addi r2,sp,40 8009e5c: f8 00 07 08 calli 800ba7c read += chunk; 8009e60: b5 8d 60 00 add r12,r12,r13 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) return -EINTR; while (read < count) { 8009e64: 56 0c ff db bgu r16,r12,8009dd0 while (PIPE_EMPTY(pipe)) { /* Not an error */ if (pipe->Writers == 0) 8009e68: 34 0d 00 00 mvi r13,0 8009e6c: e0 00 00 02 bi 8009e74 goto out_locked; if (LIBIO_NODELAY(iop)) { ret = -EAGAIN; 8009e70: 34 0d ff f5 mvi r13,-11 PIPE_WAKEUPWRITERS(pipe); read += chunk; } out_locked: PIPE_UNLOCK(pipe); 8009e74: 29 61 00 28 lw r1,(r11+40) 8009e78: fb ff ea 1b calli 80046e4 8009e7c: e0 00 00 02 bi 8009e84 PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) ret = -EINTR; if (! PIPE_LOCK(pipe)) { /* WARN waitingReaders not restored! */ ret = -EINTR; 8009e80: 34 0d ff fc mvi r13,-4 <== NOT EXECUTED out_locked: PIPE_UNLOCK(pipe); out_nolock: if (read > 0) 8009e84: 4c 0c 00 02 bge r0,r12,8009e8c 8009e88: e0 00 00 02 bi 8009e90 return read; return ret; 8009e8c: b9 a0 60 00 mv r12,r13 } 8009e90: b9 80 08 00 mv r1,r12 8009e94: 2b 9d 00 04 lw ra,(sp+4) 8009e98: 2b 8b 00 24 lw r11,(sp+36) 8009e9c: 2b 8c 00 20 lw r12,(sp+32) 8009ea0: 2b 8d 00 1c lw r13,(sp+28) 8009ea4: 2b 8e 00 18 lw r14,(sp+24) 8009ea8: 2b 8f 00 14 lw r15,(sp+20) 8009eac: 2b 90 00 10 lw r16,(sp+16) 8009eb0: 2b 91 00 0c lw r17,(sp+12) 8009eb4: 2b 92 00 08 lw r18,(sp+8) 8009eb8: 37 9c 00 28 addi sp,sp,40 8009ebc: c3 a0 00 00 ret =============================================================================== 0800986c : */ int pipe_release( pipe_control_t **pipep, rtems_libio_t *iop ) { 800986c: 37 9c ff e8 addi sp,sp,-24 8009870: 5b 8b 00 14 sw (sp+20),r11 8009874: 5b 8c 00 10 sw (sp+16),r12 8009878: 5b 8d 00 0c sw (sp+12),r13 800987c: 5b 8e 00 08 sw (sp+8),r14 8009880: 5b 9d 00 04 sw (sp+4),ra 8009884: b8 20 68 00 mv r13,r1 8009888: b8 40 70 00 mv r14,r2 pipe_control_t *pipe = *pipep; 800988c: 28 2b 00 00 lw r11,(r1+0) uint32_t mode; if (pipe_lock()) 8009890: fb ff ff a8 calli 8009730 8009894: b8 20 60 00 mv r12,r1 8009898: 5c 20 00 07 bne r1,r0,80098b4 <== NEVER TAKEN /* WARN pipe not freed and pipep not set to NULL! */ /* FIXME */ rtems_fatal_error_occurred(0xdeadbeef); if (!PIPE_LOCK(pipe)) 800989c: 29 61 00 28 lw r1,(r11+40) 80098a0: 34 03 00 00 mvi r3,0 80098a4: 34 02 00 00 mvi r2,0 80098a8: fb ff eb 3f calli 80045a4 80098ac: b8 20 18 00 mv r3,r1 80098b0: 44 2c 00 05 be r1,r12,80098c4 <== ALWAYS TAKEN /* WARN pipe not released! */ /* FIXME */ rtems_fatal_error_occurred(0xdeadbeef); 80098b4: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 80098b8: 38 42 e4 20 ori r2,r2,0xe420 <== NOT EXECUTED 80098bc: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 80098c0: fb ff ec 67 calli 8004a5c <== NOT EXECUTED mode = LIBIO_ACCMODE(iop); 80098c4: 29 c1 00 18 lw r1,(r14+24) 80098c8: 20 2c 00 06 andi r12,r1,0x6 if (mode & LIBIO_FLAGS_READ) 80098cc: 20 21 00 02 andi r1,r1,0x2 80098d0: 44 23 00 04 be r1,r3,80098e0 pipe->Readers --; 80098d4: 29 61 00 10 lw r1,(r11+16) 80098d8: 34 21 ff ff addi r1,r1,-1 80098dc: 59 61 00 10 sw (r11+16),r1 if (mode & LIBIO_FLAGS_WRITE) 80098e0: 21 81 00 04 andi r1,r12,0x4 80098e4: 44 20 00 04 be r1,r0,80098f4 pipe->Writers --; 80098e8: 29 61 00 14 lw r1,(r11+20) 80098ec: 34 21 ff ff addi r1,r1,-1 80098f0: 59 61 00 14 sw (r11+20),r1 PIPE_UNLOCK(pipe); 80098f4: 29 61 00 28 lw r1,(r11+40) 80098f8: fb ff eb 7b calli 80046e4 if (pipe->Readers == 0 && pipe->Writers == 0) { 80098fc: 29 62 00 10 lw r2,(r11+16) 8009900: 5c 40 00 07 bne r2,r0,800991c 8009904: 29 61 00 14 lw r1,(r11+20) 8009908: 5c 22 00 05 bne r1,r2,800991c #if 0 /* To delete an anonymous pipe file when all users closed it */ if (pipe->Anonymous) delfile = TRUE; #endif pipe_free(pipe); 800990c: b9 60 08 00 mv r1,r11 8009910: fb ff ff b7 calli 80097ec *pipep = NULL; 8009914: 59 a0 00 00 sw (r13+0),r0 8009918: e0 00 00 0f bi 8009954 } else if (pipe->Readers == 0 && mode != LIBIO_FLAGS_WRITE) 800991c: 7d 81 00 04 cmpnei r1,r12,4 8009920: 64 42 00 00 cmpei r2,r2,0 8009924: a0 22 10 00 and r2,r1,r2 8009928: 44 40 00 03 be r2,r0,8009934 /* Notify waiting Writers that all their partners left */ PIPE_WAKEUPWRITERS(pipe); 800992c: 29 61 00 30 lw r1,(r11+48) 8009930: e0 00 00 07 bi 800994c else if (pipe->Writers == 0 && mode != LIBIO_FLAGS_READ) 8009934: 29 61 00 14 lw r1,(r11+20) 8009938: 7d 8c 00 02 cmpnei r12,r12,2 800993c: 64 21 00 00 cmpei r1,r1,0 8009940: a1 81 60 00 and r12,r12,r1 8009944: 45 82 00 04 be r12,r2,8009954 <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); 8009948: 29 61 00 2c lw r1,(r11+44) 800994c: 37 82 00 18 addi r2,sp,24 8009950: f8 00 08 4b calli 800ba7c pipe_unlock(); 8009954: fb ff ff b8 calli 8009834 if(iop->pathinfo.ops->unlink_h(&iop->pathinfo)) return -errno; #endif return 0; } 8009958: 34 01 00 00 mvi r1,0 800995c: 2b 9d 00 04 lw ra,(sp+4) 8009960: 2b 8b 00 14 lw r11,(sp+20) 8009964: 2b 8c 00 10 lw r12,(sp+16) 8009968: 2b 8d 00 0c lw r13,(sp+12) 800996c: 2b 8e 00 08 lw r14,(sp+8) 8009970: 37 9c 00 18 addi sp,sp,24 8009974: c3 a0 00 00 ret =============================================================================== 08009834 : return -ENOMEM; } } static void pipe_unlock(void) { 8009834: 37 9c ff fc addi sp,sp,-4 8009838: 5b 9d 00 04 sw (sp+4),ra rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_release(pipe_semaphore); 800983c: 78 01 08 02 mvhi r1,0x802 8009840: 38 21 06 d0 ori r1,r1,0x6d0 8009844: 28 21 00 00 lw r1,(r1+0) 8009848: fb ff eb a7 calli 80046e4 if (sc != RTEMS_SUCCESSFUL) { 800984c: 44 20 00 05 be r1,r0,8009860 <== ALWAYS TAKEN /* FIXME */ rtems_fatal_error_occurred(0xdeadbeef); 8009850: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8009854: 38 42 e4 20 ori r2,r2,0xe420 <== NOT EXECUTED 8009858: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 800985c: fb ff ec 80 calli 8004a5c <== NOT EXECUTED } } 8009860: 2b 9d 00 04 lw ra,(sp+4) 8009864: 37 9c 00 04 addi sp,sp,4 8009868: c3 a0 00 00 ret =============================================================================== 08009ec0 : pipe_control_t *pipe, const void *buffer, size_t count, rtems_libio_t *iop ) { 8009ec0: 37 9c ff d4 addi sp,sp,-44 8009ec4: 5b 8b 00 28 sw (sp+40),r11 8009ec8: 5b 8c 00 24 sw (sp+36),r12 8009ecc: 5b 8d 00 20 sw (sp+32),r13 8009ed0: 5b 8e 00 1c sw (sp+28),r14 8009ed4: 5b 8f 00 18 sw (sp+24),r15 8009ed8: 5b 90 00 14 sw (sp+20),r16 8009edc: 5b 91 00 10 sw (sp+16),r17 8009ee0: 5b 92 00 0c sw (sp+12),r18 8009ee4: 5b 93 00 08 sw (sp+8),r19 8009ee8: 5b 9d 00 04 sw (sp+4),ra int chunk, chunk1, written = 0, ret = 0; /* Write nothing */ if (count == 0) return 0; 8009eec: 34 0c 00 00 mvi r12,0 pipe_control_t *pipe, const void *buffer, size_t count, rtems_libio_t *iop ) { 8009ef0: b8 20 58 00 mv r11,r1 8009ef4: b8 40 88 00 mv r17,r2 8009ef8: b8 60 70 00 mv r14,r3 8009efc: b8 80 90 00 mv r18,r4 int chunk, chunk1, written = 0, ret = 0; /* Write nothing */ if (count == 0) 8009f00: 44 60 00 62 be r3,r0,800a088 <== NEVER TAKEN return 0; if (! PIPE_LOCK(pipe)) 8009f04: 28 21 00 28 lw r1,(r1+40) 8009f08: 34 02 00 00 mvi r2,0 8009f0c: 34 03 00 00 mvi r3,0 8009f10: fb ff e9 a5 calli 80045a4 return -EINTR; 8009f14: 34 0c ff fc mvi r12,-4 /* Write nothing */ if (count == 0) return 0; if (! PIPE_LOCK(pipe)) 8009f18: 5c 20 00 5c bne r1,r0,800a088 <== NEVER TAKEN return -EINTR; if (pipe->Readers == 0) { 8009f1c: 29 62 00 10 lw r2,(r11+16) 8009f20: 44 41 00 48 be r2,r1,800a040 ret = -EPIPE; goto out_locked; } /* Write of PIPE_BUF bytes or less shall not be interleaved */ chunk = count <= pipe->Size ? count : 1; 8009f24: 29 61 00 04 lw r1,(r11+4) 8009f28: 34 10 00 01 mvi r16,1 8009f2c: 55 c1 00 02 bgu r14,r1,8009f34 <== NEVER TAKEN 8009f30: b9 c0 80 00 mv r16,r14 /* Wait until there is chunk bytes space or no reader exists */ pipe->waitingWriters ++; PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) ret = -EINTR; 8009f34: 34 0c 00 00 mvi r12,0 } /* Wait until there is chunk bytes space or no reader exists */ pipe->waitingWriters ++; PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) 8009f38: 34 13 ff fc mvi r19,-4 8009f3c: e0 00 00 3e bi 800a034 /* Write of PIPE_BUF bytes or less shall not be interleaved */ chunk = count <= pipe->Size ? count : 1; while (written < count) { while (PIPE_SPACE(pipe) < chunk) { if (LIBIO_NODELAY(iop)) { 8009f40: 2a 4d 00 18 lw r13,(r18+24) 8009f44: 21 ad 00 01 andi r13,r13,0x1 8009f48: 5d a0 00 41 bne r13,r0,800a04c ret = -EAGAIN; goto out_locked; } /* Wait until there is chunk bytes space or no reader exists */ pipe->waitingWriters ++; 8009f4c: 29 61 00 1c lw r1,(r11+28) 8009f50: 34 21 00 01 addi r1,r1,1 8009f54: 59 61 00 1c sw (r11+28),r1 PIPE_UNLOCK(pipe); 8009f58: 29 61 00 28 lw r1,(r11+40) 8009f5c: fb ff e9 e2 calli 80046e4 if (! PIPE_WRITEWAIT(pipe)) 8009f60: 29 61 00 30 lw r1,(r11+48) 8009f64: 34 02 00 00 mvi r2,0 8009f68: f8 00 06 e2 calli 800baf0 8009f6c: fc 2d 68 00 cmpne r13,r1,r13 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 8009f70: 29 61 00 28 lw r1,(r11+40) } /* Wait until there is chunk bytes space or no reader exists */ pipe->waitingWriters ++; PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) 8009f74: c8 0d 68 00 sub r13,r0,r13 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 8009f78: 34 02 00 00 mvi r2,0 8009f7c: 34 03 00 00 mvi r3,0 } /* Wait until there is chunk bytes space or no reader exists */ pipe->waitingWriters ++; PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) 8009f80: a1 b3 68 00 and r13,r13,r19 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 8009f84: fb ff e9 88 calli 80045a4 8009f88: 5c 20 00 3c bne r1,r0,800a078 <== NEVER TAKEN /* WARN waitingWriters not restored! */ ret = -EINTR; goto out_nolock; } pipe->waitingWriters --; 8009f8c: 29 62 00 1c lw r2,(r11+28) 8009f90: 34 42 ff ff addi r2,r2,-1 8009f94: 59 62 00 1c sw (r11+28),r2 if (ret != 0) 8009f98: 5d a1 00 30 bne r13,r1,800a058 <== NEVER TAKEN goto out_locked; if (pipe->Readers == 0) { 8009f9c: 29 61 00 10 lw r1,(r11+16) 8009fa0: 44 2d 00 2d be r1,r13,800a054 <== NEVER TAKEN /* 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) { 8009fa4: 29 6f 00 04 lw r15,(r11+4) 8009fa8: 29 61 00 0c lw r1,(r11+12) 8009fac: c9 e1 68 00 sub r13,r15,r1 8009fb0: 56 0d ff e4 bgu r16,r13,8009f40 ret = -EPIPE; goto out_locked; } } chunk = MIN(count - written, PIPE_SPACE(pipe)); 8009fb4: c9 cc 10 00 sub r2,r14,r12 8009fb8: 50 4d 00 02 bgeu r2,r13,8009fc0 8009fbc: b8 40 68 00 mv r13,r2 chunk1 = pipe->Size - PIPE_WSTART(pipe); 8009fc0: 29 62 00 08 lw r2,(r11+8) 8009fc4: b4 22 08 00 add r1,r1,r2 8009fc8: b9 e0 10 00 mv r2,r15 8009fcc: f8 00 4b ad calli 801ce80 <__umodsi3> 8009fd0: c9 e1 78 00 sub r15,r15,r1 8009fd4: 29 63 00 00 lw r3,(r11+0) 8009fd8: b6 2c 10 00 add r2,r17,r12 if (chunk > chunk1) { 8009fdc: 4d ed 00 09 bge r15,r13,800a000 memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk1); 8009fe0: b4 61 08 00 add r1,r3,r1 8009fe4: b9 e0 18 00 mv r3,r15 8009fe8: f8 00 14 2a calli 800f090 memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1); 8009fec: b5 ec 10 00 add r2,r15,r12 8009ff0: 29 61 00 00 lw r1,(r11+0) 8009ff4: b6 22 10 00 add r2,r17,r2 8009ff8: c9 af 18 00 sub r3,r13,r15 8009ffc: e0 00 00 03 bi 800a008 } else memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk); 800a000: b4 61 08 00 add r1,r3,r1 800a004: b9 a0 18 00 mv r3,r13 800a008: f8 00 14 22 calli 800f090 pipe->Length += chunk; 800a00c: 29 61 00 0c lw r1,(r11+12) 800a010: b4 2d 08 00 add r1,r1,r13 800a014: 59 61 00 0c sw (r11+12),r1 if (pipe->waitingReaders > 0) 800a018: 29 61 00 18 lw r1,(r11+24) 800a01c: 44 20 00 04 be r1,r0,800a02c PIPE_WAKEUPREADERS(pipe); 800a020: 29 61 00 2c lw r1,(r11+44) 800a024: 37 82 00 2c addi r2,sp,44 800a028: f8 00 06 95 calli 800ba7c written += chunk; 800a02c: b5 8d 60 00 add r12,r12,r13 /* Write of more than PIPE_BUF bytes can be interleaved */ chunk = 1; 800a030: 34 10 00 01 mvi r16,1 } /* Write of PIPE_BUF bytes or less shall not be interleaved */ chunk = count <= pipe->Size ? count : 1; while (written < count) { 800a034: 55 cc ff dc bgu r14,r12,8009fa4 800a038: 34 0d 00 00 mvi r13,0 800a03c: e0 00 00 07 bi 800a058 if (! PIPE_LOCK(pipe)) return -EINTR; if (pipe->Readers == 0) { ret = -EPIPE; 800a040: 34 0d ff e0 mvi r13,-32 const void *buffer, size_t count, rtems_libio_t *iop ) { int chunk, chunk1, written = 0, ret = 0; 800a044: 34 0c 00 00 mvi r12,0 800a048: e0 00 00 04 bi 800a058 chunk = count <= pipe->Size ? count : 1; while (written < count) { while (PIPE_SPACE(pipe) < chunk) { if (LIBIO_NODELAY(iop)) { ret = -EAGAIN; 800a04c: 34 0d ff f5 mvi r13,-11 800a050: e0 00 00 02 bi 800a058 pipe->waitingWriters --; if (ret != 0) goto out_locked; if (pipe->Readers == 0) { ret = -EPIPE; 800a054: 34 0d ff e0 mvi r13,-32 <== NOT EXECUTED /* Write of more than PIPE_BUF bytes can be interleaved */ chunk = 1; } out_locked: PIPE_UNLOCK(pipe); 800a058: 29 61 00 28 lw r1,(r11+40) 800a05c: fb ff e9 a2 calli 80046e4 out_nolock: #ifdef RTEMS_POSIX_API /* Signal SIGPIPE */ if (ret == -EPIPE) 800a060: 34 01 ff e0 mvi r1,-32 800a064: 5d a1 00 06 bne r13,r1,800a07c kill(getpid(), SIGPIPE); 800a068: f8 00 02 23 calli 800a8f4 800a06c: 34 02 00 0d mvi r2,13 800a070: f8 00 03 b7 calli 800af4c 800a074: e0 00 00 02 bi 800a07c PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) ret = -EINTR; if (! PIPE_LOCK(pipe)) { /* WARN waitingWriters not restored! */ ret = -EINTR; 800a078: 34 0d ff fc mvi r13,-4 <== NOT EXECUTED /* Signal SIGPIPE */ if (ret == -EPIPE) kill(getpid(), SIGPIPE); #endif if (written > 0) 800a07c: 4c 0c 00 02 bge r0,r12,800a084 800a080: e0 00 00 02 bi 800a088 800a084: b9 a0 60 00 mv r12,r13 return written; return ret; } 800a088: b9 80 08 00 mv r1,r12 800a08c: 2b 9d 00 04 lw ra,(sp+4) 800a090: 2b 8b 00 28 lw r11,(sp+40) 800a094: 2b 8c 00 24 lw r12,(sp+36) 800a098: 2b 8d 00 20 lw r13,(sp+32) 800a09c: 2b 8e 00 1c lw r14,(sp+28) 800a0a0: 2b 8f 00 18 lw r15,(sp+24) 800a0a4: 2b 90 00 14 lw r16,(sp+20) 800a0a8: 2b 91 00 10 lw r17,(sp+16) 800a0ac: 2b 92 00 0c lw r18,(sp+12) 800a0b0: 2b 93 00 08 lw r19,(sp+8) 800a0b4: 37 9c 00 2c addi sp,sp,44 800a0b8: c3 a0 00 00 ret =============================================================================== 080079bc : pthread_attr_t *attr, int policy ) { if ( !attr || !attr->is_initialized ) return EINVAL; 80079bc: 34 03 00 16 mvi r3,22 int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { if ( !attr || !attr->is_initialized ) 80079c0: 44 20 00 0c be r1,r0,80079f0 80079c4: 28 24 00 00 lw r4,(r1+0) 80079c8: 44 80 00 0a be r4,r0,80079f0 return EINVAL; switch ( policy ) { 80079cc: 48 02 00 08 bg r0,r2,80079ec 80079d0: 34 03 00 02 mvi r3,2 80079d4: 4c 62 00 03 bge r3,r2,80079e0 80079d8: 34 03 00 04 mvi r3,4 80079dc: 5c 43 00 04 bne r2,r3,80079ec <== NEVER TAKEN case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; 80079e0: 58 22 00 14 sw (r1+20),r2 return 0; 80079e4: 34 03 00 00 mvi r3,0 80079e8: e0 00 00 02 bi 80079f0 default: return ENOTSUP; 80079ec: 34 03 00 86 mvi r3,134 } } 80079f0: b8 60 08 00 mv r1,r3 80079f4: c3 a0 00 00 ret =============================================================================== 08003484 : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 8003484: 37 9c ff dc addi sp,sp,-36 8003488: 5b 8b 00 14 sw (sp+20),r11 800348c: 5b 8c 00 10 sw (sp+16),r12 8003490: 5b 8d 00 0c sw (sp+12),r13 8003494: 5b 8e 00 08 sw (sp+8),r14 8003498: 5b 9d 00 04 sw (sp+4),ra /* * Error check parameters */ if ( !barrier ) return EINVAL; 800349c: 34 04 00 16 mvi r4,22 int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 80034a0: b8 20 68 00 mv r13,r1 80034a4: b8 60 58 00 mv r11,r3 const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 80034a8: 44 20 00 2a be r1,r0,8003550 return EINVAL; if ( count == 0 ) 80034ac: 44 60 00 29 be r3,r0,8003550 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 80034b0: 5c 40 00 05 bne r2,r0,80034c4 the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 80034b4: 37 8c 00 18 addi r12,sp,24 80034b8: b9 80 08 00 mv r1,r12 80034bc: fb ff ff bb calli 80033a8 the_attr = &my_attr; 80034c0: b9 80 10 00 mv r2,r12 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 80034c4: 28 41 00 00 lw r1,(r2+0) return EINVAL; 80034c8: 34 04 00 16 mvi r4,22 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 80034cc: 44 20 00 21 be r1,r0,8003550 return EINVAL; switch ( the_attr->process_shared ) { 80034d0: 28 4e 00 04 lw r14,(r2+4) 80034d4: 5d c0 00 1f bne r14,r0,8003550 <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 80034d8: 78 02 08 01 mvhi r2,0x801 80034dc: 38 42 68 6c ori r2,r2,0x686c 80034e0: 28 41 00 00 lw r1,(r2+0) } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 80034e4: 5b 80 00 20 sw (sp+32),r0 the_attributes.maximum_count = count; 80034e8: 5b 8b 00 24 sw (sp+36),r11 80034ec: 34 21 00 01 addi r1,r1,1 80034f0: 58 41 00 00 sw (r2+0),r1 * the inactive chain of free barrier control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Allocate( void ) { return (POSIX_Barrier_Control *) _Objects_Allocate( &_POSIX_Barrier_Information ); 80034f4: 78 0c 08 01 mvhi r12,0x801 80034f8: 39 8c 6b cc ori r12,r12,0x6bcc 80034fc: b9 80 08 00 mv r1,r12 8003500: f8 00 07 e4 calli 8005490 <_Objects_Allocate> 8003504: b8 20 58 00 mv r11,r1 */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 8003508: 5c 2e 00 04 bne r1,r14,8003518 _Thread_Enable_dispatch(); 800350c: f8 00 0b 62 calli 8006294 <_Thread_Enable_dispatch> return EAGAIN; 8003510: 34 04 00 0b mvi r4,11 8003514: e0 00 00 0f bi 8003550 } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 8003518: 34 21 00 10 addi r1,r1,16 800351c: 37 82 00 20 addi r2,sp,32 8003520: f8 00 04 e7 calli 80048bc <_CORE_barrier_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 8003524: 29 6e 00 08 lw r14,(r11+8) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8003528: 29 8c 00 1c lw r12,(r12+28) 800352c: 34 02 00 02 mvi r2,2 8003530: 21 c1 ff ff andi r1,r14,0xffff 8003534: f8 00 3d e1 calli 8012cb8 <__ashlsi3> 8003538: b5 81 08 00 add r1,r12,r1 800353c: 58 2b 00 00 sw (r1+0),r11 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 8003540: 59 60 00 0c sw (r11+12),r0 ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 8003544: 59 ae 00 00 sw (r13+0),r14 _Thread_Enable_dispatch(); 8003548: f8 00 0b 53 calli 8006294 <_Thread_Enable_dispatch> return 0; 800354c: 34 04 00 00 mvi r4,0 } 8003550: b8 80 08 00 mv r1,r4 8003554: 2b 9d 00 04 lw ra,(sp+4) 8003558: 2b 8b 00 14 lw r11,(sp+20) 800355c: 2b 8c 00 10 lw r12,(sp+16) 8003560: 2b 8d 00 0c lw r13,(sp+12) 8003564: 2b 8e 00 08 lw r14,(sp+8) 8003568: 37 9c 00 24 addi sp,sp,36 800356c: c3 a0 00 00 ret =============================================================================== 08002d00 : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { 8002d00: 37 9c ff f4 addi sp,sp,-12 8002d04: 5b 8b 00 0c sw (sp+12),r11 8002d08: 5b 8c 00 08 sw (sp+8),r12 8002d0c: 5b 9d 00 04 sw (sp+4),ra 8002d10: b8 20 58 00 mv r11,r1 8002d14: b8 40 60 00 mv r12,r2 /* * The POSIX standard does not address what to do when the routine * is NULL. It also does not address what happens when we cannot * allocate memory or anything else bad happens. */ if ( !routine ) 8002d18: 44 20 00 13 be r1,r0,8002d64 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8002d1c: 78 03 08 01 mvhi r3,0x801 8002d20: 38 63 68 54 ori r3,r3,0x6854 8002d24: 28 61 00 00 lw r1,(r3+0) 8002d28: 34 21 00 01 addi r1,r1,1 8002d2c: 58 61 00 00 sw (r3+0),r1 return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); 8002d30: 34 01 00 10 mvi r1,16 8002d34: f8 00 11 44 calli 8007244 <_Workspace_Allocate> 8002d38: b8 20 10 00 mv r2,r1 if ( handler ) { 8002d3c: 44 20 00 09 be r1,r0,8002d60 <== NEVER TAKEN thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 8002d40: 78 03 08 01 mvhi r3,0x801 8002d44: 38 63 6d 2c ori r3,r3,0x6d2c 8002d48: 28 61 00 0c lw r1,(r3+12) handler_stack = &thread_support->Cancellation_Handlers; 8002d4c: 28 21 01 2c lw r1,(r1+300) handler->routine = routine; 8002d50: 58 4b 00 08 sw (r2+8),r11 handler->arg = arg; 8002d54: 58 4c 00 0c sw (r2+12),r12 _Chain_Append( handler_stack, &handler->Node ); 8002d58: 34 21 00 e0 addi r1,r1,224 8002d5c: f8 00 04 f7 calli 8004138 <_Chain_Append> } _Thread_Enable_dispatch(); 8002d60: f8 00 0b 3c calli 8005a50 <_Thread_Enable_dispatch> } 8002d64: 2b 9d 00 04 lw ra,(sp+4) 8002d68: 2b 8b 00 0c lw r11,(sp+12) 8002d6c: 2b 8c 00 08 lw r12,(sp+8) 8002d70: 37 9c 00 0c addi sp,sp,12 8002d74: c3 a0 00 00 ret =============================================================================== 08003dc8 : int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 8003dc8: 37 9c ff ec addi sp,sp,-20 8003dcc: 5b 8b 00 14 sw (sp+20),r11 8003dd0: 5b 8c 00 10 sw (sp+16),r12 8003dd4: 5b 8d 00 0c sw (sp+12),r13 8003dd8: 5b 8e 00 08 sw (sp+8),r14 8003ddc: 5b 9d 00 04 sw (sp+4),ra 8003de0: b8 20 70 00 mv r14,r1 8003de4: b8 40 58 00 mv r11,r2 POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; 8003de8: 5c 40 00 03 bne r2,r0,8003df4 else the_attr = &_POSIX_Condition_variables_Default_attributes; 8003dec: 78 0b 08 01 mvhi r11,0x801 8003df0: 39 6b 5a d0 ori r11,r11,0x5ad0 /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 8003df4: 29 63 00 04 lw r3,(r11+4) 8003df8: 34 02 00 01 mvi r2,1 return EINVAL; 8003dfc: 34 01 00 16 mvi r1,22 /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 8003e00: 44 62 00 24 be r3,r2,8003e90 <== NEVER TAKEN return EINVAL; if ( !the_attr->is_initialized ) 8003e04: 29 62 00 00 lw r2,(r11+0) 8003e08: 44 40 00 22 be r2,r0,8003e90 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8003e0c: 78 02 08 01 mvhi r2,0x801 8003e10: 38 42 78 6c ori r2,r2,0x786c 8003e14: 28 41 00 00 lw r1,(r2+0) 8003e18: 34 21 00 01 addi r1,r1,1 8003e1c: 58 41 00 00 sw (r2+0),r1 RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) _Objects_Allocate( &_POSIX_Condition_variables_Information ); 8003e20: 78 0d 08 01 mvhi r13,0x801 8003e24: 39 ad 7c 64 ori r13,r13,0x7c64 8003e28: b9 a0 08 00 mv r1,r13 8003e2c: f8 00 09 84 calli 800643c <_Objects_Allocate> 8003e30: b8 20 60 00 mv r12,r1 _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 8003e34: 5c 20 00 04 bne r1,r0,8003e44 _Thread_Enable_dispatch(); 8003e38: f8 00 0d 6e calli 80073f0 <_Thread_Enable_dispatch> return ENOMEM; 8003e3c: 34 01 00 0c mvi r1,12 8003e40: e0 00 00 14 bi 8003e90 } the_cond->process_shared = the_attr->process_shared; 8003e44: 29 61 00 04 lw r1,(r11+4) the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; /* XXX some more initialization might need to go here */ _Thread_queue_Initialize( 8003e48: 34 03 08 00 mvi r3,2048 8003e4c: 34 04 00 74 mvi r4,116 if ( !the_cond ) { _Thread_Enable_dispatch(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; 8003e50: 59 81 00 10 sw (r12+16),r1 the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; /* XXX some more initialization might need to go here */ _Thread_queue_Initialize( 8003e54: 34 02 00 00 mvi r2,0 8003e58: 35 81 00 18 addi r1,r12,24 return ENOMEM; } the_cond->process_shared = the_attr->process_shared; the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; 8003e5c: 59 80 00 14 sw (r12+20),r0 /* XXX some more initialization might need to go here */ _Thread_queue_Initialize( 8003e60: f8 00 0f bd calli 8007d54 <_Thread_queue_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 8003e64: 29 8b 00 08 lw r11,(r12+8) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8003e68: 29 ad 00 1c lw r13,(r13+28) 8003e6c: 34 02 00 02 mvi r2,2 8003e70: 21 61 ff ff andi r1,r11,0xffff 8003e74: f8 00 3f 47 calli 8013b90 <__ashlsi3> 8003e78: b5 a1 10 00 add r2,r13,r1 8003e7c: 58 4c 00 00 sw (r2+0),r12 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 8003e80: 59 80 00 0c sw (r12+12),r0 &_POSIX_Condition_variables_Information, &the_cond->Object, 0 ); *cond = the_cond->Object.id; 8003e84: 59 cb 00 00 sw (r14+0),r11 _Thread_Enable_dispatch(); 8003e88: f8 00 0d 5a calli 80073f0 <_Thread_Enable_dispatch> return 0; 8003e8c: 34 01 00 00 mvi r1,0 } 8003e90: 2b 9d 00 04 lw ra,(sp+4) 8003e94: 2b 8b 00 14 lw r11,(sp+20) 8003e98: 2b 8c 00 10 lw r12,(sp+16) 8003e9c: 2b 8d 00 0c lw r13,(sp+12) 8003ea0: 2b 8e 00 08 lw r14,(sp+8) 8003ea4: 37 9c 00 14 addi sp,sp,20 8003ea8: c3 a0 00 00 ret =============================================================================== 08003c3c : int pthread_condattr_destroy( pthread_condattr_t *attr ) { if ( !attr || attr->is_initialized == false ) return EINVAL; 8003c3c: 34 02 00 16 mvi r2,22 int pthread_condattr_destroy( pthread_condattr_t *attr ) { if ( !attr || attr->is_initialized == false ) 8003c40: 44 20 00 05 be r1,r0,8003c54 8003c44: 28 23 00 00 lw r3,(r1+0) 8003c48: 44 60 00 03 be r3,r0,8003c54 <== NEVER TAKEN return EINVAL; attr->is_initialized = false; 8003c4c: 58 20 00 00 sw (r1+0),r0 return 0; 8003c50: 34 02 00 00 mvi r2,0 } 8003c54: b8 40 08 00 mv r1,r2 8003c58: c3 a0 00 00 ret =============================================================================== 08003104 : pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { 8003104: 37 9c ff a0 addi sp,sp,-96 8003108: 5b 8b 00 3c sw (sp+60),r11 800310c: 5b 8c 00 38 sw (sp+56),r12 8003110: 5b 8d 00 34 sw (sp+52),r13 8003114: 5b 8e 00 30 sw (sp+48),r14 8003118: 5b 8f 00 2c sw (sp+44),r15 800311c: 5b 90 00 28 sw (sp+40),r16 8003120: 5b 91 00 24 sw (sp+36),r17 8003124: 5b 92 00 20 sw (sp+32),r18 8003128: 5b 93 00 1c sw (sp+28),r19 800312c: 5b 94 00 18 sw (sp+24),r20 8003130: 5b 95 00 14 sw (sp+20),r21 8003134: 5b 9d 00 10 sw (sp+16),ra struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) return EFAULT; 8003138: 34 0d 00 0e mvi r13,14 pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { 800313c: b8 20 88 00 mv r17,r1 8003140: b8 60 80 00 mv r16,r3 8003144: b8 80 90 00 mv r18,r4 int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) 8003148: 44 60 00 a5 be r3,r0,80033dc return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 800314c: b8 40 58 00 mv r11,r2 8003150: 5c 40 00 03 bne r2,r0,800315c 8003154: 78 0b 08 01 mvhi r11,0x801 8003158: 39 6b d3 04 ori r11,r11,0xd304 if ( !the_attr->is_initialized ) 800315c: 29 61 00 00 lw r1,(r11+0) return EINVAL; 8003160: 34 0d 00 16 mvi r13,22 if ( !start_routine ) return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; if ( !the_attr->is_initialized ) 8003164: 44 20 00 9e be r1,r0,80033dc * stack space if it is allowed to allocate it itself. * * NOTE: If the user provides the stack we will let it drop below * twice the minimum. */ if ( the_attr->stackaddr && !_Stack_Is_enough(the_attr->stacksize) ) 8003168: 29 61 00 04 lw r1,(r11+4) 800316c: 44 20 00 06 be r1,r0,8003184 8003170: 78 02 08 01 mvhi r2,0x801 8003174: 38 42 f0 e0 ori r2,r2,0xf0e0 8003178: 29 63 00 08 lw r3,(r11+8) 800317c: 28 41 00 00 lw r1,(r2+0) 8003180: 54 23 00 97 bgu r1,r3,80033dc * If inheritsched is set to PTHREAD_INHERIT_SCHED, then this thread * inherits scheduling attributes from the creating thread. If it is * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the * attributes structure. */ switch ( the_attr->inheritsched ) { 8003184: 29 62 00 10 lw r2,(r11+16) 8003188: 34 01 00 01 mvi r1,1 800318c: 44 41 00 05 be r2,r1,80031a0 8003190: 34 01 00 02 mvi r1,2 schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; break; default: return EINVAL; 8003194: 34 0d 00 16 mvi r13,22 * If inheritsched is set to PTHREAD_INHERIT_SCHED, then this thread * inherits scheduling attributes from the creating thread. If it is * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the * attributes structure. */ switch ( the_attr->inheritsched ) { 8003198: 5c 41 00 91 bne r2,r1,80033dc 800319c: e0 00 00 14 bi 80031ec case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 80031a0: 78 02 08 01 mvhi r2,0x801 80031a4: 38 42 fd 34 ori r2,r2,0xfd34 80031a8: 28 41 00 0c lw r1,(r2+12) 80031ac: 28 22 01 2c lw r2,(r1+300) schedpolicy = api->schedpolicy; schedparam = api->schedparam; 80031b0: 28 48 00 84 lw r8,(r2+132) 80031b4: 28 47 00 88 lw r7,(r2+136) 80031b8: 28 46 00 8c lw r6,(r2+140) 80031bc: 28 45 00 90 lw r5,(r2+144) 80031c0: 28 44 00 94 lw r4,(r2+148) 80031c4: 28 43 00 98 lw r3,(r2+152) * attributes structure. */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; schedpolicy = api->schedpolicy; 80031c8: 28 4f 00 80 lw r15,(r2+128) schedparam = api->schedparam; 80031cc: 28 41 00 9c lw r1,(r2+156) 80031d0: 5b 88 00 40 sw (sp+64),r8 80031d4: 5b 87 00 44 sw (sp+68),r7 80031d8: 5b 86 00 48 sw (sp+72),r6 80031dc: 5b 85 00 4c sw (sp+76),r5 80031e0: 5b 84 00 50 sw (sp+80),r4 80031e4: 5b 83 00 54 sw (sp+84),r3 80031e8: e0 00 00 0f bi 8003224 break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; 80031ec: 29 67 00 18 lw r7,(r11+24) 80031f0: 29 66 00 1c lw r6,(r11+28) 80031f4: 29 65 00 20 lw r5,(r11+32) 80031f8: 29 64 00 24 lw r4,(r11+36) 80031fc: 29 63 00 28 lw r3,(r11+40) 8003200: 29 62 00 2c lw r2,(r11+44) schedpolicy = api->schedpolicy; schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; 8003204: 29 6f 00 14 lw r15,(r11+20) schedparam = the_attr->schedparam; 8003208: 29 61 00 30 lw r1,(r11+48) 800320c: 5b 87 00 40 sw (sp+64),r7 8003210: 5b 86 00 44 sw (sp+68),r6 8003214: 5b 85 00 48 sw (sp+72),r5 8003218: 5b 84 00 4c sw (sp+76),r4 800321c: 5b 83 00 50 sw (sp+80),r3 8003220: 5b 82 00 54 sw (sp+84),r2 /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) 8003224: 29 6c 00 0c lw r12,(r11+12) schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; 8003228: 5b 81 00 58 sw (sp+88),r1 /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) return ENOTSUP; 800322c: 34 0d 00 86 mvi r13,134 /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) 8003230: 5d 80 00 6b bne r12,r0,80033dc return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 8003234: 2b 81 00 40 lw r1,(sp+64) return EINVAL; 8003238: 34 0d 00 16 mvi r13,22 return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 800323c: f8 00 1b 61 calli 8009fc0 <_POSIX_Priority_Is_valid> 8003240: 44 2c 00 67 be r1,r12,80033dc <== NEVER TAKEN RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 8003244: 78 02 08 01 mvhi r2,0x801 8003248: 38 42 f0 e4 ori r2,r2,0xf0e4 800324c: 40 54 00 00 lbu r20,(r2+0) core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 8003250: b9 e0 08 00 mv r1,r15 8003254: 37 82 00 40 addi r2,sp,64 8003258: 37 83 00 60 addi r3,sp,96 800325c: 37 84 00 5c addi r4,sp,92 * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) return EINVAL; core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); 8003260: 2b 93 00 40 lw r19,(sp+64) /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 8003264: f8 00 1b 5f calli 8009fe0 <_POSIX_Thread_Translate_sched_param> 8003268: b8 20 68 00 mv r13,r1 schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) 800326c: 5c 20 00 5c bne r1,r0,80033dc #endif /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 8003270: 78 0c 08 01 mvhi r12,0x801 8003274: 39 8c f9 00 ori r12,r12,0xf900 8003278: 29 81 00 00 lw r1,(r12+0) 800327c: f8 00 04 f5 calli 8004650 <_API_Mutex_Lock> * _POSIX_Threads_Allocate */ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ) { return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ); 8003280: 78 02 08 01 mvhi r2,0x801 8003284: b8 40 08 00 mv r1,r2 8003288: 38 21 fa 3c ori r1,r1,0xfa3c 800328c: f8 00 08 07 calli 80052a8 <_Objects_Allocate> 8003290: b8 20 70 00 mv r14,r1 * Allocate the thread control block. * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { 8003294: 5c 2d 00 03 bne r1,r13,80032a0 _RTEMS_Unlock_allocator(); 8003298: 29 81 00 00 lw r1,(r12+0) 800329c: e0 00 00 21 bi 8003320 static inline size_t _POSIX_Threads_Ensure_minimum_stack ( size_t size ) { if ( size >= PTHREAD_MINIMUM_STACK_SIZE ) 80032a0: 78 02 08 01 mvhi r2,0x801 80032a4: 38 42 f0 e0 ori r2,r2,0xf0e0 80032a8: 28 41 00 00 lw r1,(r2+0) /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 80032ac: 29 6c 00 08 lw r12,(r11+8) static inline size_t _POSIX_Threads_Ensure_minimum_stack ( size_t size ) { if ( size >= PTHREAD_MINIMUM_STACK_SIZE ) 80032b0: 34 02 00 01 mvi r2,1 80032b4: f8 00 61 9b calli 801b920 <__ashlsi3> /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 80032b8: 29 75 00 04 lw r21,(r11+4) static inline size_t _POSIX_Threads_Ensure_minimum_stack ( size_t size ) { if ( size >= PTHREAD_MINIMUM_STACK_SIZE ) 80032bc: b8 20 28 00 mv r5,r1 /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 80032c0: 50 2c 00 02 bgeu r1,r12,80032c8 80032c4: b9 80 28 00 mv r5,r12 80032c8: 2b 81 00 5c lw r1,(sp+92) 80032cc: 78 0c 08 01 mvhi r12,0x801 80032d0: 2b 88 00 60 lw r8,(sp+96) 80032d4: 39 8c fa 3c ori r12,r12,0xfa3c 80032d8: 5b 81 00 04 sw (sp+4),r1 80032dc: b8 a0 20 00 mv r4,r5 80032e0: b9 80 08 00 mv r1,r12 80032e4: b9 c0 10 00 mv r2,r14 80032e8: ba a0 18 00 mv r3,r21 80032ec: 34 05 00 00 mvi r5,0 80032f0: ca 93 30 00 sub r6,r20,r19 80032f4: 34 07 00 01 mvi r7,1 80032f8: 5b 80 00 08 sw (sp+8),r0 80032fc: 5b 80 00 0c sw (sp+12),r0 8003300: f8 00 0b c0 calli 8006200 <_Thread_Initialize> budget_callout, 0, /* isr level */ name /* posix threads don't have a name */ ); if ( !status ) { 8003304: 5c 20 00 0a bne r1,r0,800332c RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( Thread_Control *the_pthread ) { _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object ); 8003308: b9 80 08 00 mv r1,r12 800330c: b9 c0 10 00 mv r2,r14 8003310: f8 00 08 e2 calli 8005698 <_Objects_Free> _POSIX_Threads_Free( the_thread ); _RTEMS_Unlock_allocator(); 8003314: 78 01 08 01 mvhi r1,0x801 8003318: 38 21 f9 00 ori r1,r1,0xf900 800331c: 28 21 00 00 lw r1,(r1+0) 8003320: f8 00 04 e9 calli 80046c4 <_API_Mutex_Unlock> return EAGAIN; 8003324: 34 0d 00 0b mvi r13,11 8003328: e0 00 00 2d bi 80033dc } /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 800332c: 29 cc 01 2c lw r12,(r14+300) api->Attributes = *the_attr; 8003330: b9 60 10 00 mv r2,r11 8003334: 34 03 00 3c mvi r3,60 8003338: b9 80 08 00 mv r1,r12 800333c: f8 00 2a e7 calli 800ded8 api->detachstate = the_attr->detachstate; 8003340: 29 61 00 38 lw r1,(r11+56) api->schedparam = schedparam; /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 8003344: 34 02 00 01 mvi r2,1 */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; api->schedpolicy = schedpolicy; 8003348: 59 8f 00 80 sw (r12+128),r15 * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; 800334c: 59 81 00 3c sw (r12+60),r1 api->schedpolicy = schedpolicy; api->schedparam = schedparam; 8003350: 2b 81 00 40 lw r1,(sp+64) /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 8003354: ba 00 18 00 mv r3,r16 8003358: ba 40 20 00 mv r4,r18 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; api->schedpolicy = schedpolicy; api->schedparam = schedparam; 800335c: 59 81 00 84 sw (r12+132),r1 8003360: 2b 81 00 44 lw r1,(sp+68) /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 8003364: 34 05 00 00 mvi r5,0 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; api->schedpolicy = schedpolicy; api->schedparam = schedparam; 8003368: 59 81 00 88 sw (r12+136),r1 800336c: 2b 81 00 48 lw r1,(sp+72) 8003370: 59 81 00 8c sw (r12+140),r1 8003374: 2b 81 00 4c lw r1,(sp+76) 8003378: 59 81 00 90 sw (r12+144),r1 800337c: 2b 81 00 50 lw r1,(sp+80) 8003380: 59 81 00 94 sw (r12+148),r1 8003384: 2b 81 00 54 lw r1,(sp+84) 8003388: 59 81 00 98 sw (r12+152),r1 800338c: 2b 81 00 58 lw r1,(sp+88) 8003390: 59 81 00 9c sw (r12+156),r1 /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 8003394: b9 c0 08 00 mv r1,r14 8003398: f8 00 0f 1b calli 8007004 <_Thread_Start> _RTEMS_Unlock_allocator(); return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { 800339c: 34 01 00 04 mvi r1,4 80033a0: 5d e1 00 09 bne r15,r1,80033c4 _Watchdog_Insert_ticks( 80033a4: 35 81 00 8c addi r1,r12,140 80033a8: f8 00 0f c2 calli 80072b0 <_Timespec_To_ticks> ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 80033ac: 78 02 08 01 mvhi r2,0x801 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 80033b0: 59 81 00 b0 sw (r12+176),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 80033b4: b8 40 08 00 mv r1,r2 80033b8: 38 21 f9 20 ori r1,r1,0xf920 80033bc: 35 82 00 a4 addi r2,r12,164 80033c0: f8 00 10 f1 calli 8007784 <_Watchdog_Insert> } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 80033c4: 29 c1 00 08 lw r1,(r14+8) 80033c8: 5a 21 00 00 sw (r17+0),r1 _RTEMS_Unlock_allocator(); 80033cc: 78 01 08 01 mvhi r1,0x801 80033d0: 38 21 f9 00 ori r1,r1,0xf900 80033d4: 28 21 00 00 lw r1,(r1+0) 80033d8: f8 00 04 bb calli 80046c4 <_API_Mutex_Unlock> return 0; } 80033dc: b9 a0 08 00 mv r1,r13 80033e0: 2b 9d 00 10 lw ra,(sp+16) 80033e4: 2b 8b 00 3c lw r11,(sp+60) 80033e8: 2b 8c 00 38 lw r12,(sp+56) 80033ec: 2b 8d 00 34 lw r13,(sp+52) 80033f0: 2b 8e 00 30 lw r14,(sp+48) 80033f4: 2b 8f 00 2c lw r15,(sp+44) 80033f8: 2b 90 00 28 lw r16,(sp+40) 80033fc: 2b 91 00 24 lw r17,(sp+36) 8003400: 2b 92 00 20 lw r18,(sp+32) 8003404: 2b 93 00 1c lw r19,(sp+28) 8003408: 2b 94 00 18 lw r20,(sp+24) 800340c: 2b 95 00 14 lw r21,(sp+20) 8003410: 37 9c 00 60 addi sp,sp,96 8003414: c3 a0 00 00 ret =============================================================================== 08010ea0 : void pthread_exit( void *value_ptr ) { 8010ea0: 37 9c ff fc addi sp,sp,-4 8010ea4: 5b 9d 00 04 sw (sp+4),ra _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 8010ea8: 78 03 08 01 mvhi r3,0x801 8010eac: 38 63 9d fc ori r3,r3,0x9dfc } void pthread_exit( void *value_ptr ) { 8010eb0: b8 20 10 00 mv r2,r1 _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 8010eb4: 28 61 00 0c lw r1,(r3+12) 8010eb8: fb ff ff d4 calli 8010e08 <_POSIX_Thread_Exit> } 8010ebc: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8010ec0: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 8010ec4: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08002fa4 : int pthread_key_create( pthread_key_t *key, void (*destructor)( void * ) ) { 8002fa4: 37 9c ff e0 addi sp,sp,-32 8002fa8: 5b 8b 00 20 sw (sp+32),r11 8002fac: 5b 8c 00 1c sw (sp+28),r12 8002fb0: 5b 8d 00 18 sw (sp+24),r13 8002fb4: 5b 8e 00 14 sw (sp+20),r14 8002fb8: 5b 8f 00 10 sw (sp+16),r15 8002fbc: 5b 90 00 0c sw (sp+12),r16 8002fc0: 5b 91 00 08 sw (sp+8),r17 8002fc4: 5b 9d 00 04 sw (sp+4),ra 8002fc8: 78 03 08 01 mvhi r3,0x801 8002fcc: 38 63 68 bc ori r3,r3,0x68bc 8002fd0: b8 20 78 00 mv r15,r1 8002fd4: 28 61 00 00 lw r1,(r3+0) 8002fd8: b8 40 60 00 mv r12,r2 8002fdc: 34 21 00 01 addi r1,r1,1 8002fe0: 58 61 00 00 sw (r3+0),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 ); 8002fe4: 78 03 08 01 mvhi r3,0x801 8002fe8: b8 60 08 00 mv r1,r3 8002fec: 38 21 6c 74 ori r1,r1,0x6c74 8002ff0: f8 00 08 72 calli 80051b8 <_Objects_Allocate> 8002ff4: b8 20 58 00 mv r11,r1 _Thread_Disable_dispatch(); the_key = _POSIX_Keys_Allocate(); if ( !the_key ) { 8002ff8: 5c 20 00 04 bne r1,r0,8003008 _Thread_Enable_dispatch(); 8002ffc: f8 00 0c 5c calli 800616c <_Thread_Enable_dispatch> return EAGAIN; 8003000: 34 01 00 0b mvi r1,11 8003004: e0 00 00 3b bi 80030f0 } the_key->destructor = destructor; 8003008: 78 0d 08 01 mvhi r13,0x801 800300c: 58 2c 00 10 sw (r1+16),r12 8003010: 39 ad 68 5c ori r13,r13,0x685c 8003014: b8 20 70 00 mv r14,r1 * APIs are optional. * * NOTE: Currently RTEMS Classic API tasks are always enabled. */ for ( the_api = 1; 8003018: 34 0c 00 01 mvi r12,1 800301c: 34 10 00 04 mvi r16,4 the_api <= OBJECTS_APIS_LAST; the_api++ ) { if ( _Objects_Information_table[ the_api ] ) { 8003020: 29 a2 00 00 lw r2,(r13+0) 8003024: 44 40 00 21 be r2,r0,80030a8 <== NEVER TAKEN true, INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY ); #endif bytes_to_allocate = sizeof( void * ) * (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); 8003028: 28 41 00 04 lw r1,(r2+4) 800302c: 2c 22 00 10 lhu r2,(r1+16) INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY ); #endif bytes_to_allocate = sizeof( void * ) * 8003030: 34 41 00 01 addi r1,r2,1 8003034: 34 02 00 02 mvi r2,2 8003038: f8 00 41 fb calli 8013824 <__ashlsi3> 800303c: b8 20 88 00 mv r17,r1 (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); 8003040: f8 00 12 ab calli 8007aec <_Workspace_Allocate> if ( !table ) { 8003044: 5c 20 00 14 bne r1,r0,8003094 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, 8003048: 35 81 00 03 addi r1,r12,3 800304c: 34 02 00 02 mvi r2,2 8003050: f8 00 41 f5 calli 8013824 <__ashlsi3> 8003054: b5 61 08 00 add r1,r11,r1 for ( --the_api; 8003058: 35 8d ff ff addi r13,r12,-1 800305c: 34 2c 00 04 addi r12,r1,4 8003060: e0 00 00 05 bi 8003074 the_api >= 1; the_api-- ) _Workspace_Free( the_key->Values[ the_api ] ); 8003064: 29 81 00 00 lw r1,(r12+0) (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); if ( !table ) { for ( --the_api; the_api >= 1; the_api-- ) 8003068: 35 ad ff ff addi r13,r13,-1 800306c: 35 8c ff fc addi r12,r12,-4 _Workspace_Free( the_key->Values[ the_api ] ); 8003070: f8 00 12 aa calli 8007b18 <_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; 8003074: 5d a0 ff fc bne r13,r0,8003064 */ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free ( POSIX_Keys_Control *the_key ) { _Objects_Free( &_POSIX_Keys_Information, &the_key->Object ); 8003078: 78 01 08 01 mvhi r1,0x801 800307c: 38 21 6c 74 ori r1,r1,0x6c74 8003080: b9 60 10 00 mv r2,r11 8003084: f8 00 09 5f calli 8005600 <_Objects_Free> the_api >= 1; the_api-- ) _Workspace_Free( the_key->Values[ the_api ] ); _POSIX_Keys_Free( the_key ); _Thread_Enable_dispatch(); 8003088: f8 00 0c 39 calli 800616c <_Thread_Enable_dispatch> return ENOMEM; 800308c: 34 01 00 0c mvi r1,12 8003090: e0 00 00 18 bi 80030f0 } the_key->Values[ the_api ] = table; 8003094: 59 c1 00 18 sw (r14+24),r1 memset( table, '\0', bytes_to_allocate ); 8003098: 34 02 00 00 mvi r2,0 800309c: ba 20 18 00 mv r3,r17 80030a0: f8 00 2c 26 calli 800e138 80030a4: e0 00 00 02 bi 80030ac } else { the_key->Values[ the_api ] = NULL; 80030a8: 59 c0 00 18 sw (r14+24),r0 <== NOT EXECUTED * NOTE: Currently RTEMS Classic API tasks are always enabled. */ for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) { 80030ac: 35 8c 00 01 addi r12,r12,1 80030b0: 35 ad 00 04 addi r13,r13,4 80030b4: 35 ce 00 04 addi r14,r14,4 * APIs are optional. * * NOTE: Currently RTEMS Classic API tasks are always enabled. */ for ( the_api = 1; 80030b8: 5d 90 ff da bne r12,r16,8003020 uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 80030bc: 29 6c 00 08 lw r12,(r11+8) *key = the_key->Object.id; _Thread_Enable_dispatch(); return 0; } 80030c0: 78 02 08 01 mvhi r2,0x801 80030c4: 38 42 6c 74 ori r2,r2,0x6c74 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 80030c8: 28 4d 00 1c lw r13,(r2+28) 80030cc: 21 81 ff ff andi r1,r12,0xffff 80030d0: 34 02 00 02 mvi r2,2 80030d4: f8 00 41 d4 calli 8013824 <__ashlsi3> 80030d8: b5 a1 10 00 add r2,r13,r1 80030dc: 58 4b 00 00 sw (r2+0),r11 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 80030e0: 59 60 00 0c sw (r11+12),r0 } _Objects_Open_u32( &_POSIX_Keys_Information, &the_key->Object, 0 ); *key = the_key->Object.id; 80030e4: 59 ec 00 00 sw (r15+0),r12 _Thread_Enable_dispatch(); 80030e8: f8 00 0c 21 calli 800616c <_Thread_Enable_dispatch> return 0; 80030ec: 34 01 00 00 mvi r1,0 } 80030f0: 2b 9d 00 04 lw ra,(sp+4) 80030f4: 2b 8b 00 20 lw r11,(sp+32) 80030f8: 2b 8c 00 1c lw r12,(sp+28) 80030fc: 2b 8d 00 18 lw r13,(sp+24) 8003100: 2b 8e 00 14 lw r14,(sp+20) 8003104: 2b 8f 00 10 lw r15,(sp+16) 8003108: 2b 90 00 0c lw r16,(sp+12) 800310c: 2b 91 00 08 lw r17,(sp+8) 8003110: 37 9c 00 20 addi sp,sp,32 8003114: c3 a0 00 00 ret =============================================================================== 08003118 : */ int pthread_key_delete( pthread_key_t key ) { 8003118: 37 9c ff ec addi sp,sp,-20 800311c: 5b 8b 00 10 sw (sp+16),r11 8003120: 5b 8c 00 0c sw (sp+12),r12 8003124: 5b 8d 00 08 sw (sp+8),r13 8003128: 5b 9d 00 04 sw (sp+4),ra pthread_key_t id, Objects_Locations *location ) { return (POSIX_Keys_Control *) _Objects_Get( &_POSIX_Keys_Information, (Objects_Id) id, location ); 800312c: 78 0b 08 01 mvhi r11,0x801 8003130: 39 6b 6c 74 ori r11,r11,0x6c74 8003134: b8 20 10 00 mv r2,r1 8003138: 37 83 00 14 addi r3,sp,20 800313c: b9 60 08 00 mv r1,r11 8003140: f8 00 09 bd calli 8005834 <_Objects_Get> 8003144: b8 20 60 00 mv r12,r1 register POSIX_Keys_Control *the_key; Objects_Locations location; uint32_t the_api; the_key = _POSIX_Keys_Get( key, &location ); switch ( location ) { 8003148: 2b 81 00 14 lw r1,(sp+20) 800314c: 5c 20 00 13 bne r1,r0,8003198 case OBJECTS_LOCAL: _Objects_Close( &_POSIX_Keys_Information, &the_key->Object ); 8003150: b9 60 08 00 mv r1,r11 8003154: b9 80 10 00 mv r2,r12 8003158: f8 00 08 47 calli 8005274 <_Objects_Close> 800315c: b9 80 68 00 mv r13,r12 8003160: 34 0b 00 03 mvi r11,3 for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) if ( the_key->Values[ the_api ] ) 8003164: 29 a1 00 18 lw r1,(r13+24) 8003168: 44 20 00 02 be r1,r0,8003170 <== NEVER TAKEN _Workspace_Free( the_key->Values[ the_api ] ); 800316c: f8 00 12 6b calli 8007b18 <_Workspace_Free> 8003170: 35 6b ff ff addi r11,r11,-1 8003174: 35 ad 00 04 addi r13,r13,4 switch ( location ) { case OBJECTS_LOCAL: _Objects_Close( &_POSIX_Keys_Information, &the_key->Object ); for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) 8003178: 5d 60 ff fb bne r11,r0,8003164 */ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free ( POSIX_Keys_Control *the_key ) { _Objects_Free( &_POSIX_Keys_Information, &the_key->Object ); 800317c: 78 01 08 01 mvhi r1,0x801 8003180: 38 21 6c 74 ori r1,r1,0x6c74 8003184: b9 80 10 00 mv r2,r12 8003188: f8 00 09 1e calli 8005600 <_Objects_Free> * NOTE: The destructor is not called and it is the responsibility * of the application to free the memory. */ _POSIX_Keys_Free( the_key ); _Thread_Enable_dispatch(); 800318c: f8 00 0b f8 calli 800616c <_Thread_Enable_dispatch> return 0; 8003190: 34 01 00 00 mvi r1,0 8003194: e0 00 00 02 bi 800319c #endif case OBJECTS_ERROR: break; } return EINVAL; 8003198: 34 01 00 16 mvi r1,22 } 800319c: 2b 9d 00 04 lw ra,(sp+4) 80031a0: 2b 8b 00 10 lw r11,(sp+16) 80031a4: 2b 8c 00 0c lw r12,(sp+12) 80031a8: 2b 8d 00 08 lw r13,(sp+8) 80031ac: 37 9c 00 14 addi sp,sp,20 80031b0: c3 a0 00 00 ret =============================================================================== 080029d4 : const pthread_mutexattr_t *attr, int *type ) { if ( !attr ) return EINVAL; 80029d4: 34 03 00 16 mvi r3,22 int pthread_mutexattr_gettype( const pthread_mutexattr_t *attr, int *type ) { if ( !attr ) 80029d8: 44 20 00 07 be r1,r0,80029f4 return EINVAL; if ( !attr->is_initialized ) 80029dc: 28 24 00 00 lw r4,(r1+0) 80029e0: 44 80 00 05 be r4,r0,80029f4 return EINVAL; if ( !type ) 80029e4: 44 40 00 04 be r2,r0,80029f4 <== NEVER TAKEN return EINVAL; *type = attr->type; 80029e8: 28 21 00 10 lw r1,(r1+16) return 0; 80029ec: 34 03 00 00 mvi r3,0 return EINVAL; if ( !type ) return EINVAL; *type = attr->type; 80029f0: 58 41 00 00 sw (r2+0),r1 return 0; } 80029f4: b8 60 08 00 mv r1,r3 80029f8: c3 a0 00 00 ret =============================================================================== 08005200 : pthread_mutexattr_t *attr, int pshared ) { if ( !attr || !attr->is_initialized ) return EINVAL; 8005200: 34 03 00 16 mvi r3,22 int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { if ( !attr || !attr->is_initialized ) 8005204: 44 20 00 07 be r1,r0,8005220 8005208: 28 24 00 00 lw r4,(r1+0) 800520c: 44 80 00 05 be r4,r0,8005220 return EINVAL; switch ( pshared ) { 8005210: 34 04 00 01 mvi r4,1 8005214: 54 44 00 03 bgu r2,r4,8005220 <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 8005218: 58 22 00 04 sw (r1+4),r2 return 0; 800521c: 34 03 00 00 mvi r3,0 default: return EINVAL; } } 8005220: b8 60 08 00 mv r1,r3 8005224: c3 a0 00 00 ret =============================================================================== 08002a48 : pthread_mutexattr_t *attr, int type ) { if ( !attr || !attr->is_initialized ) return EINVAL; 8002a48: 34 03 00 16 mvi r3,22 int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { if ( !attr || !attr->is_initialized ) 8002a4c: 44 20 00 07 be r1,r0,8002a68 8002a50: 28 24 00 00 lw r4,(r1+0) 8002a54: 44 80 00 05 be r4,r0,8002a68 <== NEVER TAKEN return EINVAL; switch ( type ) { 8002a58: 34 04 00 03 mvi r4,3 8002a5c: 54 44 00 03 bgu r2,r4,8002a68 case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 8002a60: 58 22 00 10 sw (r1+16),r2 return 0; 8002a64: 34 03 00 00 mvi r3,0 default: return EINVAL; } } 8002a68: b8 60 08 00 mv r1,r3 8002a6c: c3 a0 00 00 ret =============================================================================== 08003908 : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 8003908: 37 9c ff ec addi sp,sp,-20 800390c: 5b 8b 00 10 sw (sp+16),r11 8003910: 5b 8c 00 0c sw (sp+12),r12 8003914: 5b 8d 00 08 sw (sp+8),r13 8003918: 5b 9d 00 04 sw (sp+4),ra 800391c: b8 20 58 00 mv r11,r1 8003920: b8 40 60 00 mv r12,r2 if ( !once_control || !init_routine ) 8003924: 64 21 00 00 cmpei r1,r1,0 8003928: 64 42 00 00 cmpei r2,r2,0 800392c: b8 41 10 00 or r2,r2,r1 return EINVAL; 8003930: 34 01 00 16 mvi r1,22 int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { if ( !once_control || !init_routine ) 8003934: 5c 40 00 13 bne r2,r0,8003980 return EINVAL; if ( !once_control->init_executed ) { 8003938: 29 6d 00 04 lw r13,(r11+4) once_control->init_executed = true; (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); } return 0; 800393c: 34 01 00 00 mvi r1,0 ) { if ( !once_control || !init_routine ) return EINVAL; if ( !once_control->init_executed ) { 8003940: 5d a2 00 10 bne r13,r2,8003980 rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 8003944: 34 01 01 00 mvi r1,256 8003948: 34 02 01 00 mvi r2,256 800394c: 37 83 00 14 addi r3,sp,20 8003950: f8 00 01 93 calli 8003f9c if ( !once_control->init_executed ) { 8003954: 29 61 00 04 lw r1,(r11+4) 8003958: 5c 2d 00 05 bne r1,r13,800396c <== NEVER TAKEN once_control->is_initialized = true; 800395c: 34 01 00 01 mvi r1,1 8003960: 59 61 00 00 sw (r11+0),r1 once_control->init_executed = true; 8003964: 59 61 00 04 sw (r11+4),r1 (*init_routine)(); 8003968: d9 80 00 00 call r12 } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 800396c: 2b 81 00 14 lw r1,(sp+20) 8003970: 34 02 01 00 mvi r2,256 8003974: 37 83 00 14 addi r3,sp,20 8003978: f8 00 01 89 calli 8003f9c } return 0; 800397c: 34 01 00 00 mvi r1,0 } 8003980: 2b 9d 00 04 lw ra,(sp+4) 8003984: 2b 8b 00 10 lw r11,(sp+16) 8003988: 2b 8c 00 0c lw r12,(sp+12) 800398c: 2b 8d 00 08 lw r13,(sp+8) 8003990: 37 9c 00 14 addi sp,sp,20 8003994: c3 a0 00 00 ret =============================================================================== 080040d4 : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 80040d4: 37 9c ff e0 addi sp,sp,-32 80040d8: 5b 8b 00 14 sw (sp+20),r11 80040dc: 5b 8c 00 10 sw (sp+16),r12 80040e0: 5b 8d 00 0c sw (sp+12),r13 80040e4: 5b 8e 00 08 sw (sp+8),r14 80040e8: 5b 9d 00 04 sw (sp+4),ra /* * Error check parameters */ if ( !rwlock ) return EINVAL; 80040ec: 34 03 00 16 mvi r3,22 int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 80040f0: b8 20 68 00 mv r13,r1 const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 80040f4: 44 20 00 27 be r1,r0,8004190 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 80040f8: 5c 40 00 05 bne r2,r0,800410c the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); 80040fc: 37 8b 00 18 addi r11,sp,24 8004100: b9 60 08 00 mv r1,r11 8004104: f8 00 02 fe calli 8004cfc the_attr = &default_attr; 8004108: b9 60 10 00 mv r2,r11 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 800410c: 28 41 00 00 lw r1,(r2+0) return EINVAL; 8004110: 34 03 00 16 mvi r3,22 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 8004114: 44 20 00 1f be r1,r0,8004190 <== NEVER TAKEN return EINVAL; switch ( the_attr->process_shared ) { 8004118: 28 4e 00 04 lw r14,(r2+4) 800411c: 5d c0 00 1d bne r14,r0,8004190 <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8004120: 78 02 08 01 mvhi r2,0x801 8004124: 38 42 78 6c ori r2,r2,0x786c 8004128: 28 41 00 00 lw r1,(r2+0) 800412c: 34 21 00 01 addi r1,r1,1 8004130: 58 41 00 00 sw (r2+0),r1 * the inactive chain of free RWLock control blocks. */ RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Allocate( void ) { return (POSIX_RWLock_Control *) _Objects_Allocate( &_POSIX_RWLock_Information ); 8004134: 78 0c 08 01 mvhi r12,0x801 8004138: 39 8c 7a 0c ori r12,r12,0x7a0c 800413c: b9 80 08 00 mv r1,r12 8004140: f8 00 09 a2 calli 80067c8 <_Objects_Allocate> 8004144: b8 20 58 00 mv r11,r1 */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 8004148: 5c 2e 00 04 bne r1,r14,8004158 _Thread_Enable_dispatch(); 800414c: f8 00 0d 20 calli 80075cc <_Thread_Enable_dispatch> return EAGAIN; 8004150: 34 03 00 0b mvi r3,11 8004154: e0 00 00 0f bi 8004190 } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 8004158: 34 21 00 10 addi r1,r1,16 800415c: 37 82 00 20 addi r2,sp,32 8004160: f8 00 06 dd calli 8005cd4 <_CORE_RWLock_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 8004164: 29 6e 00 08 lw r14,(r11+8) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8004168: 29 8c 00 1c lw r12,(r12+28) 800416c: 34 02 00 02 mvi r2,2 8004170: 21 c1 ff ff andi r1,r14,0xffff 8004174: f8 00 3f f6 calli 801414c <__ashlsi3> 8004178: b5 81 08 00 add r1,r12,r1 800417c: 58 2b 00 00 sw (r1+0),r11 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 8004180: 59 60 00 0c sw (r11+12),r0 &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; 8004184: 59 ae 00 00 sw (r13+0),r14 _Thread_Enable_dispatch(); 8004188: f8 00 0d 11 calli 80075cc <_Thread_Enable_dispatch> return 0; 800418c: 34 03 00 00 mvi r3,0 } 8004190: b8 60 08 00 mv r1,r3 8004194: 2b 9d 00 04 lw ra,(sp+4) 8004198: 2b 8b 00 14 lw r11,(sp+20) 800419c: 2b 8c 00 10 lw r12,(sp+16) 80041a0: 2b 8d 00 0c lw r13,(sp+12) 80041a4: 2b 8e 00 08 lw r14,(sp+8) 80041a8: 37 9c 00 20 addi sp,sp,32 80041ac: c3 a0 00 00 ret =============================================================================== 08004238 : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 8004238: 37 9c ff e0 addi sp,sp,-32 800423c: 5b 8b 00 18 sw (sp+24),r11 8004240: 5b 8c 00 14 sw (sp+20),r12 8004244: 5b 8d 00 10 sw (sp+16),r13 8004248: 5b 8e 00 0c sw (sp+12),r14 800424c: 5b 8f 00 08 sw (sp+8),r15 8004250: 5b 9d 00 04 sw (sp+4),ra 8004254: b8 20 70 00 mv r14,r1 Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) return EINVAL; 8004258: 34 0b 00 16 mvi r11,22 int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 800425c: b8 40 08 00 mv r1,r2 Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 8004260: 45 c0 00 25 be r14,r0,80042f4 * * 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 ); 8004264: 37 82 00 1c addi r2,sp,28 8004268: f8 00 1b d5 calli 800b1bc <_POSIX_Absolute_timeout_to_ticks> 800426c: 29 c2 00 00 lw r2,(r14+0) 8004270: b8 20 60 00 mv r12,r1 8004274: 78 01 08 01 mvhi r1,0x801 8004278: 38 21 7a 0c ori r1,r1,0x7a0c 800427c: 37 83 00 20 addi r3,sp,32 8004280: f8 00 0a b7 calli 8006d5c <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 8004284: 2b 8f 00 20 lw r15,(sp+32) 8004288: 5d e0 00 1b bne r15,r0,80042f4 int _EXFUN(pthread_rwlock_init, (pthread_rwlock_t *__rwlock, _CONST pthread_rwlockattr_t *__attr)); int _EXFUN(pthread_rwlock_destroy, (pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_rdlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_tryrdlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_timedrdlock, 800428c: 65 8d 00 03 cmpei r13,r12,3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 8004290: 29 c2 00 00 lw r2,(r14+0) 8004294: 2b 84 00 1c lw r4,(sp+28) 8004298: 34 21 00 10 addi r1,r1,16 800429c: b9 a0 18 00 mv r3,r13 80042a0: 34 05 00 00 mvi r5,0 80042a4: f8 00 06 99 calli 8005d08 <_CORE_RWLock_Obtain_for_reading> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 80042a8: f8 00 0c c9 calli 80075cc <_Thread_Enable_dispatch> if ( !do_wait ) { 80042ac: 5d af 00 0a bne r13,r15,80042d4 if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 80042b0: 78 01 08 01 mvhi r1,0x801 80042b4: 38 21 7d 44 ori r1,r1,0x7d44 80042b8: 28 21 00 0c lw r1,(r1+12) 80042bc: 34 02 00 02 mvi r2,2 80042c0: 28 21 00 34 lw r1,(r1+52) 80042c4: 5c 22 00 04 bne r1,r2,80042d4 switch (status) { 80042c8: 45 8d 00 0b be r12,r13,80042f4 <== NEVER TAKEN 80042cc: 55 81 00 02 bgu r12,r1,80042d4 <== NEVER TAKEN 80042d0: e0 00 00 08 bi 80042f0 } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( (CORE_RWLock_Status) _Thread_Executing->Wait.return_code 80042d4: 78 01 08 01 mvhi r1,0x801 80042d8: 38 21 7d 44 ori r1,r1,0x7d44 80042dc: 28 21 00 0c lw r1,(r1+12) break; } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 80042e0: 28 21 00 34 lw r1,(r1+52) 80042e4: f8 00 00 45 calli 80043f8 <_POSIX_RWLock_Translate_core_RWLock_return_code> 80042e8: b8 20 58 00 mv r11,r1 80042ec: e0 00 00 02 bi 80042f4 switch (status) { case POSIX_ABSOLUTE_TIMEOUT_INVALID: return EINVAL; case POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST: case POSIX_ABSOLUTE_TIMEOUT_IS_NOW: return ETIMEDOUT; 80042f0: 34 0b 00 74 mvi r11,116 case OBJECTS_ERROR: break; } return EINVAL; } 80042f4: b9 60 08 00 mv r1,r11 80042f8: 2b 9d 00 04 lw ra,(sp+4) 80042fc: 2b 8b 00 18 lw r11,(sp+24) 8004300: 2b 8c 00 14 lw r12,(sp+20) 8004304: 2b 8d 00 10 lw r13,(sp+16) 8004308: 2b 8e 00 0c lw r14,(sp+12) 800430c: 2b 8f 00 08 lw r15,(sp+8) 8004310: 37 9c 00 20 addi sp,sp,32 8004314: c3 a0 00 00 ret =============================================================================== 08004318 : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 8004318: 37 9c ff e0 addi sp,sp,-32 800431c: 5b 8b 00 18 sw (sp+24),r11 8004320: 5b 8c 00 14 sw (sp+20),r12 8004324: 5b 8d 00 10 sw (sp+16),r13 8004328: 5b 8e 00 0c sw (sp+12),r14 800432c: 5b 8f 00 08 sw (sp+8),r15 8004330: 5b 9d 00 04 sw (sp+4),ra 8004334: b8 20 70 00 mv r14,r1 Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) return EINVAL; 8004338: 34 0b 00 16 mvi r11,22 int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 800433c: b8 40 08 00 mv r1,r2 Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 8004340: 45 c0 00 25 be r14,r0,80043d4 * * 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 ); 8004344: 37 82 00 1c addi r2,sp,28 8004348: f8 00 1b 9d calli 800b1bc <_POSIX_Absolute_timeout_to_ticks> 800434c: 29 c2 00 00 lw r2,(r14+0) 8004350: b8 20 60 00 mv r12,r1 8004354: 78 01 08 01 mvhi r1,0x801 8004358: 38 21 7a 0c ori r1,r1,0x7a0c 800435c: 37 83 00 20 addi r3,sp,32 8004360: f8 00 0a 7f calli 8006d5c <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 8004364: 2b 8f 00 20 lw r15,(sp+32) 8004368: 5d e0 00 1b bne r15,r0,80043d4 (pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime)); int _EXFUN(pthread_rwlock_unlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_wrlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_trywrlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_timedwrlock, 800436c: 65 8d 00 03 cmpei r13,r12,3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 8004370: 29 c2 00 00 lw r2,(r14+0) 8004374: 2b 84 00 1c lw r4,(sp+28) 8004378: 34 21 00 10 addi r1,r1,16 800437c: b9 a0 18 00 mv r3,r13 8004380: 34 05 00 00 mvi r5,0 8004384: f8 00 06 a3 calli 8005e10 <_CORE_RWLock_Obtain_for_writing> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 8004388: f8 00 0c 91 calli 80075cc <_Thread_Enable_dispatch> if ( !do_wait && 800438c: 5d af 00 0a bne r13,r15,80043b4 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 8004390: 78 01 08 01 mvhi r1,0x801 8004394: 38 21 7d 44 ori r1,r1,0x7d44 8004398: 28 21 00 0c lw r1,(r1+12) ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait && 800439c: 34 02 00 02 mvi r2,2 80043a0: 28 21 00 34 lw r1,(r1+52) 80043a4: 5c 22 00 04 bne r1,r2,80043b4 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { switch (status) { 80043a8: 45 8d 00 0b be r12,r13,80043d4 <== NEVER TAKEN 80043ac: 55 81 00 02 bgu r12,r1,80043b4 <== NEVER TAKEN 80043b0: e0 00 00 08 bi 80043d0 break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( (CORE_RWLock_Status) _Thread_Executing->Wait.return_code 80043b4: 78 01 08 01 mvhi r1,0x801 80043b8: 38 21 7d 44 ori r1,r1,0x7d44 80043bc: 28 21 00 0c lw r1,(r1+12) case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE: break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 80043c0: 28 21 00 34 lw r1,(r1+52) 80043c4: f8 00 00 0d calli 80043f8 <_POSIX_RWLock_Translate_core_RWLock_return_code> 80043c8: b8 20 58 00 mv r11,r1 80043cc: e0 00 00 02 bi 80043d4 switch (status) { case POSIX_ABSOLUTE_TIMEOUT_INVALID: return EINVAL; case POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST: case POSIX_ABSOLUTE_TIMEOUT_IS_NOW: return ETIMEDOUT; 80043d0: 34 0b 00 74 mvi r11,116 case OBJECTS_ERROR: break; } return EINVAL; } 80043d4: b9 60 08 00 mv r1,r11 80043d8: 2b 9d 00 04 lw ra,(sp+4) 80043dc: 2b 8b 00 18 lw r11,(sp+24) 80043e0: 2b 8c 00 14 lw r12,(sp+20) 80043e4: 2b 8d 00 10 lw r13,(sp+16) 80043e8: 2b 8e 00 0c lw r14,(sp+12) 80043ec: 2b 8f 00 08 lw r15,(sp+8) 80043f0: 37 9c 00 20 addi sp,sp,32 80043f4: c3 a0 00 00 ret =============================================================================== 08004d1c : pthread_rwlockattr_t *attr, int pshared ) { if ( !attr ) return EINVAL; 8004d1c: 34 03 00 16 mvi r3,22 int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { if ( !attr ) 8004d20: 44 20 00 07 be r1,r0,8004d3c return EINVAL; if ( !attr->is_initialized ) 8004d24: 28 24 00 00 lw r4,(r1+0) 8004d28: 44 80 00 05 be r4,r0,8004d3c return EINVAL; switch ( pshared ) { 8004d2c: 34 04 00 01 mvi r4,1 8004d30: 54 44 00 03 bgu r2,r4,8004d3c <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 8004d34: 58 22 00 04 sw (r1+4),r2 return 0; 8004d38: 34 03 00 00 mvi r3,0 default: return EINVAL; } } 8004d3c: b8 60 08 00 mv r1,r3 8004d40: c3 a0 00 00 ret =============================================================================== 08006158 : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 8006158: 37 9c ff dc addi sp,sp,-36 800615c: 5b 8b 00 18 sw (sp+24),r11 8006160: 5b 8c 00 14 sw (sp+20),r12 8006164: 5b 8d 00 10 sw (sp+16),r13 8006168: 5b 8e 00 0c sw (sp+12),r14 800616c: 5b 8f 00 08 sw (sp+8),r15 8006170: 5b 9d 00 04 sw (sp+4),ra /* * Check all the parameters */ if ( !param ) return EINVAL; 8006174: 34 0e 00 16 mvi r14,22 int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 8006178: b8 20 58 00 mv r11,r1 800617c: b8 40 78 00 mv r15,r2 8006180: b8 60 60 00 mv r12,r3 int rc; /* * Check all the parameters */ if ( !param ) 8006184: 44 60 00 46 be r3,r0,800629c return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 8006188: b8 40 08 00 mv r1,r2 800618c: 37 84 00 20 addi r4,sp,32 8006190: b8 60 10 00 mv r2,r3 8006194: 37 83 00 24 addi r3,sp,36 8006198: f8 00 19 bc calli 800c888 <_POSIX_Thread_Translate_sched_param> 800619c: b8 20 70 00 mv r14,r1 policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 80061a0: 5c 20 00 3f bne r1,r0,800629c 80061a4: 78 03 08 01 mvhi r3,0x801 80061a8: b8 60 08 00 mv r1,r3 80061ac: 38 21 aa 9c ori r1,r1,0xaa9c 80061b0: b9 60 10 00 mv r2,r11 80061b4: 37 83 00 1c addi r3,sp,28 80061b8: f8 00 07 a6 calli 8008050 <_Objects_Get> 80061bc: b8 20 68 00 mv r13,r1 /* * Actually change the scheduling policy and parameters */ the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 80061c0: 2b 81 00 1c lw r1,(sp+28) 80061c4: 5c 2e 00 35 bne r1,r14,8006298 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 80061c8: 29 ab 01 2c lw r11,(r13+300) if ( api->schedpolicy == SCHED_SPORADIC ) 80061cc: 34 01 00 04 mvi r1,4 80061d0: 29 62 00 80 lw r2,(r11+128) 80061d4: 5c 41 00 03 bne r2,r1,80061e0 (void) _Watchdog_Remove( &api->Sporadic_timer ); 80061d8: 35 61 00 a4 addi r1,r11,164 80061dc: f8 00 0f f9 calli 800a1c0 <_Watchdog_Remove> api->schedpolicy = policy; 80061e0: 59 6f 00 80 sw (r11+128),r15 api->schedparam = *param; 80061e4: 29 81 00 14 lw r1,(r12+20) 80061e8: 29 82 00 00 lw r2,(r12+0) 80061ec: 29 86 00 04 lw r6,(r12+4) 80061f0: 29 85 00 08 lw r5,(r12+8) 80061f4: 29 84 00 0c lw r4,(r12+12) 80061f8: 29 83 00 10 lw r3,(r12+16) 80061fc: 29 87 00 18 lw r7,(r12+24) 8006200: 59 61 00 98 sw (r11+152),r1 the_thread->budget_algorithm = budget_algorithm; 8006204: 2b 81 00 24 lw r1,(sp+36) if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; 8006208: 59 62 00 84 sw (r11+132),r2 800620c: 59 66 00 88 sw (r11+136),r6 8006210: 59 65 00 8c sw (r11+140),r5 8006214: 59 64 00 90 sw (r11+144),r4 8006218: 59 63 00 94 sw (r11+148),r3 800621c: 59 67 00 9c sw (r11+156),r7 the_thread->budget_algorithm = budget_algorithm; 8006220: 59 a1 00 7c sw (r13+124),r1 the_thread->budget_callout = budget_callout; 8006224: 2b 81 00 20 lw r1,(sp+32) 8006228: 59 a1 00 80 sw (r13+128),r1 switch ( api->schedpolicy ) { 800622c: 48 0f 00 19 bg r0,r15,8006290 <== NEVER TAKEN 8006230: 34 01 00 02 mvi r1,2 8006234: 4c 2f 00 04 bge r1,r15,8006244 8006238: 34 01 00 04 mvi r1,4 800623c: 5d e1 00 15 bne r15,r1,8006290 <== NEVER TAKEN 8006240: e0 00 00 0e bi 8006278 case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 8006244: 78 01 08 01 mvhi r1,0x801 8006248: 38 21 a8 54 ori r1,r1,0xa854 800624c: 28 21 00 00 lw r1,(r1+0) the_thread->real_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 8006250: 34 03 00 01 mvi r3,1 switch ( api->schedpolicy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 8006254: 59 a1 00 78 sw (r13+120),r1 8006258: 78 01 08 01 mvhi r1,0x801 800625c: 38 21 a0 e4 ori r1,r1,0xa0e4 8006260: 40 21 00 00 lbu r1,(r1+0) 8006264: c8 22 10 00 sub r2,r1,r2 the_thread->real_priority = 8006268: 59 a2 00 18 sw (r13+24),r2 _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 800626c: b9 a0 08 00 mv r1,r13 8006270: f8 00 08 72 calli 8008438 <_Thread_Change_priority> the_thread, the_thread->real_priority, true ); break; 8006274: e0 00 00 07 bi 8006290 case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 8006278: 59 62 00 a0 sw (r11+160),r2 _Watchdog_Remove( &api->Sporadic_timer ); 800627c: 35 61 00 a4 addi r1,r11,164 8006280: f8 00 0f d0 calli 800a1c0 <_Watchdog_Remove> _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 8006284: 34 01 00 00 mvi r1,0 8006288: b9 a0 10 00 mv r2,r13 800628c: fb ff ff 62 calli 8006014 <_POSIX_Threads_Sporadic_budget_TSR> break; } _Thread_Enable_dispatch(); 8006290: f8 00 09 be calli 8008988 <_Thread_Enable_dispatch> return 0; 8006294: e0 00 00 02 bi 800629c #endif case OBJECTS_ERROR: break; } return ESRCH; 8006298: 34 0e 00 03 mvi r14,3 } 800629c: b9 c0 08 00 mv r1,r14 80062a0: 2b 9d 00 04 lw ra,(sp+4) 80062a4: 2b 8b 00 18 lw r11,(sp+24) 80062a8: 2b 8c 00 14 lw r12,(sp+20) 80062ac: 2b 8d 00 10 lw r13,(sp+16) 80062b0: 2b 8e 00 0c lw r14,(sp+12) 80062b4: 2b 8f 00 08 lw r15,(sp+8) 80062b8: 37 9c 00 24 addi sp,sp,36 80062bc: c3 a0 00 00 ret =============================================================================== 08003648 : * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 8003648: 37 9c ff f8 addi sp,sp,-8 800364c: 5b 8b 00 08 sw (sp+8),r11 8003650: 5b 9d 00 04 sw (sp+4),ra * Don't even think about deleting a resource from an ISR. * Besides this request is supposed to be for _Thread_Executing * and the ISR context is not a thread. */ if ( _ISR_Is_in_progress() ) 8003654: 78 01 08 01 mvhi r1,0x801 8003658: 38 21 6d 2c ori r1,r1,0x6d2c 800365c: 28 22 00 08 lw r2,(r1+8) 8003660: 5c 40 00 14 bne r2,r0,80036b0 <== NEVER TAKEN return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 8003664: 28 21 00 0c lw r1,(r1+12) 8003668: 28 22 01 2c lw r2,(r1+300) 800366c: 78 01 08 01 mvhi r1,0x801 8003670: 38 21 68 54 ori r1,r1,0x6854 8003674: 28 23 00 00 lw r3,(r1+0) 8003678: 34 63 00 01 addi r3,r3,1 800367c: 58 23 00 00 sw (r1+0),r3 _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 8003680: 28 41 00 d4 lw r1,(r2+212) */ void pthread_testcancel( void ) { POSIX_API_Control *thread_support; bool cancel = false; 8003684: 34 0b 00 00 mvi r11,0 return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 8003688: 5c 2b 00 03 bne r1,r11,8003694 <== NEVER TAKEN /* Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ int _EXFUN(pthread_setcancelstate, (int __state, int *__oldstate)); int _EXFUN(pthread_setcanceltype, (int __type, int *__oldtype)); void _EXFUN(pthread_testcancel, (void)); 800368c: 28 4b 00 dc lw r11,(r2+220) 8003690: 7d 6b 00 00 cmpnei r11,r11,0 thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 8003694: f8 00 08 ef calli 8005a50 <_Thread_Enable_dispatch> if ( cancel ) 8003698: 45 60 00 06 be r11,r0,80036b0 _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 800369c: 78 01 08 01 mvhi r1,0x801 80036a0: 38 21 6d 2c ori r1,r1,0x6d2c 80036a4: 28 21 00 0c lw r1,(r1+12) 80036a8: 34 02 ff ff mvi r2,-1 80036ac: f8 00 18 af calli 8009968 <_POSIX_Thread_Exit> } 80036b0: 2b 9d 00 04 lw ra,(sp+4) 80036b4: 2b 8b 00 08 lw r11,(sp+8) 80036b8: 37 9c 00 08 addi sp,sp,8 80036bc: c3 a0 00 00 ret =============================================================================== 08017678 : ssize_t read( int fd, void *buffer, size_t count ) { 8017678: 37 9c ff ec addi sp,sp,-20 801767c: 5b 8b 00 10 sw (sp+16),r11 8017680: 5b 8c 00 0c sw (sp+12),r12 8017684: 5b 8d 00 08 sw (sp+8),r13 8017688: 5b 9d 00 04 sw (sp+4),ra ssize_t rc; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 801768c: 78 04 08 01 mvhi r4,0x801 8017690: 38 84 90 10 ori r4,r4,0x9010 ssize_t read( int fd, void *buffer, size_t count ) { 8017694: b8 40 68 00 mv r13,r2 ssize_t rc; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8017698: 28 82 00 00 lw r2,(r4+0) 801769c: 54 41 00 02 bgu r2,r1,80176a4 <== ALWAYS TAKEN 80176a0: e0 00 00 0c bi 80176d0 <== NOT EXECUTED iop = rtems_libio_iop( fd ); 80176a4: 78 0b 08 01 mvhi r11,0x801 80176a8: 34 02 00 06 mvi r2,6 80176ac: 39 6b 97 e8 ori r11,r11,0x97e8 80176b0: 5b 83 00 14 sw (sp+20),r3 80176b4: fb ff fe 07 calli 8016ed0 <__ashlsi3> 80176b8: 29 6b 00 00 lw r11,(r11+0) rtems_libio_check_is_open( iop ); 80176bc: 2b 83 00 14 lw r3,(sp+20) { ssize_t rc; rtems_libio_t *iop; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); 80176c0: b5 61 58 00 add r11,r11,r1 rtems_libio_check_is_open( iop ); 80176c4: 29 61 00 18 lw r1,(r11+24) 80176c8: 20 22 01 00 andi r2,r1,0x100 80176cc: 5c 40 00 04 bne r2,r0,80176dc 80176d0: fb ff e7 7f calli 80114cc <__errno> 80176d4: 34 02 00 09 mvi r2,9 80176d8: e0 00 00 08 bi 80176f8 rtems_libio_check_buffer( buffer ); 80176dc: 45 a0 00 05 be r13,r0,80176f0 <== NEVER TAKEN rtems_libio_check_count( count ); 80176e0: 34 0c 00 00 mvi r12,0 80176e4: 44 60 00 19 be r3,r0,8017748 <== NEVER TAKEN rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ ); 80176e8: 20 21 00 02 andi r1,r1,0x2 80176ec: 5c 20 00 06 bne r1,r0,8017704 <== ALWAYS TAKEN 80176f0: fb ff e7 77 calli 80114cc <__errno> <== NOT EXECUTED 80176f4: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 80176f8: 58 22 00 00 sw (r1+0),r2 80176fc: 34 0c ff ff mvi r12,-1 8017700: e0 00 00 12 bi 8017748 return 0; /* * Now process the read(). */ rc = (*iop->pathinfo.handlers->read_h)( iop, buffer, count ); 8017704: 29 61 00 24 lw r1,(r11+36) 8017708: b9 a0 10 00 mv r2,r13 801770c: 28 24 00 08 lw r4,(r1+8) 8017710: b9 60 08 00 mv r1,r11 8017714: d8 80 00 00 call r4 8017718: b8 20 60 00 mv r12,r1 if ( rc > 0 ) 801771c: 4c 01 00 0b bge r0,r1,8017748 iop->offset += rc; 8017720: 34 02 00 1f mvi r2,31 8017724: fb ff fe 12 calli 8016f6c <__ashrsi3> 8017728: 29 62 00 14 lw r2,(r11+20) 801772c: 29 64 00 10 lw r4,(r11+16) 8017730: b5 82 10 00 add r2,r12,r2 8017734: f5 82 18 00 cmpgu r3,r12,r2 8017738: b4 24 08 00 add r1,r1,r4 801773c: b4 61 08 00 add r1,r3,r1 8017740: 59 61 00 10 sw (r11+16),r1 8017744: 59 62 00 14 sw (r11+20),r2 return rc; } 8017748: b9 80 08 00 mv r1,r12 801774c: 2b 9d 00 04 lw ra,(sp+4) 8017750: 2b 8b 00 10 lw r11,(sp+16) 8017754: 2b 8c 00 0c lw r12,(sp+12) 8017758: 2b 8d 00 08 lw r13,(sp+8) 801775c: 37 9c 00 14 addi sp,sp,20 8017760: c3 a0 00 00 ret =============================================================================== 08004d8c : ssize_t readlink( const char *pathname, char *buf, size_t bufsize ) { 8004d8c: 37 9c ff d8 addi sp,sp,-40 8004d90: 5b 8b 00 14 sw (sp+20),r11 8004d94: 5b 8c 00 10 sw (sp+16),r12 8004d98: 5b 8d 00 0c sw (sp+12),r13 8004d9c: 5b 8e 00 08 sw (sp+8),r14 8004da0: 5b 9d 00 04 sw (sp+4),ra 8004da4: b8 20 60 00 mv r12,r1 8004da8: b8 40 68 00 mv r13,r2 8004dac: b8 60 70 00 mv r14,r3 rtems_filesystem_location_info_t loc; int result; if (!buf) 8004db0: 5c 40 00 06 bne r2,r0,8004dc8 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); 8004db4: f8 00 2b 97 calli 800fc10 <__errno> <== NOT EXECUTED 8004db8: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 8004dbc: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8004dc0: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 8004dc4: e0 00 00 20 bi 8004e44 <== NOT EXECUTED result = rtems_filesystem_evaluate_path( pathname, strlen( pathname ), 8004dc8: f8 00 33 58 calli 8011b28 8004dcc: 37 8b 00 18 addi r11,sp,24 8004dd0: b8 20 10 00 mv r2,r1 8004dd4: 34 03 00 00 mvi r3,0 8004dd8: b9 80 08 00 mv r1,r12 8004ddc: b9 60 20 00 mv r4,r11 8004de0: 34 05 00 00 mvi r5,0 8004de4: fb ff fa e3 calli 8003970 0, &loc, false ); if ( result != 0 ) return -1; 8004de8: 34 0c ff ff mvi r12,-1 if (!buf) rtems_set_errno_and_return_minus_one( EFAULT ); result = rtems_filesystem_evaluate_path( pathname, strlen( pathname ), 0, &loc, false ); if ( result != 0 ) 8004dec: 5c 20 00 16 bne r1,r0,8004e44 <== NEVER TAKEN return -1; if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){ 8004df0: 2b 81 00 24 lw r1,(sp+36) 8004df4: 28 22 00 10 lw r2,(r1+16) 8004df8: b9 60 08 00 mv r1,r11 8004dfc: d8 40 00 00 call r2 8004e00: 34 02 00 04 mvi r2,4 8004e04: 44 22 00 07 be r1,r2,8004e20 rtems_filesystem_freenode( &loc ); 8004e08: b9 60 08 00 mv r1,r11 8004e0c: fb ff fb 2b calli 8003ab8 rtems_set_errno_and_return_minus_one( EINVAL ); 8004e10: f8 00 2b 80 calli 800fc10 <__errno> 8004e14: 34 02 00 16 mvi r2,22 8004e18: 58 22 00 00 sw (r1+0),r2 8004e1c: e0 00 00 0a bi 8004e44 } result = (*loc.ops->readlink_h)( &loc, buf, bufsize ); 8004e20: 2b 81 00 24 lw r1,(sp+36) 8004e24: b9 a0 10 00 mv r2,r13 8004e28: b9 c0 18 00 mv r3,r14 8004e2c: 28 24 00 3c lw r4,(r1+60) 8004e30: b9 60 08 00 mv r1,r11 8004e34: d8 80 00 00 call r4 8004e38: b8 20 60 00 mv r12,r1 rtems_filesystem_freenode( &loc ); 8004e3c: b9 60 08 00 mv r1,r11 8004e40: fb ff fb 1e calli 8003ab8 return result; } 8004e44: b9 80 08 00 mv r1,r12 8004e48: 2b 9d 00 04 lw ra,(sp+4) 8004e4c: 2b 8b 00 14 lw r11,(sp+20) 8004e50: 2b 8c 00 10 lw r12,(sp+16) 8004e54: 2b 8d 00 0c lw r13,(sp+12) 8004e58: 2b 8e 00 08 lw r14,(sp+8) 8004e5c: 37 9c 00 28 addi sp,sp,40 8004e60: c3 a0 00 00 ret =============================================================================== 080036d4 : ssize_t readv( int fd, const struct iovec *iov, int iovcnt ) { 80036d4: 37 9c ff e4 addi sp,sp,-28 80036d8: 5b 8b 00 1c sw (sp+28),r11 80036dc: 5b 8c 00 18 sw (sp+24),r12 80036e0: 5b 8d 00 14 sw (sp+20),r13 80036e4: 5b 8e 00 10 sw (sp+16),r14 80036e8: 5b 8f 00 0c sw (sp+12),r15 80036ec: 5b 90 00 08 sw (sp+8),r16 80036f0: 5b 9d 00 04 sw (sp+4),ra 80036f4: b8 60 78 00 mv r15,r3 int v; int bytes; rtems_libio_t *iop; bool all_zeros; rtems_libio_check_fd( fd ); 80036f8: 78 03 08 01 mvhi r3,0x801 80036fc: 38 63 60 10 ori r3,r3,0x6010 ssize_t readv( int fd, const struct iovec *iov, int iovcnt ) { 8003700: b8 40 68 00 mv r13,r2 int v; int bytes; rtems_libio_t *iop; bool all_zeros; rtems_libio_check_fd( fd ); 8003704: 28 62 00 00 lw r2,(r3+0) 8003708: 54 41 00 02 bgu r2,r1,8003710 800370c: e0 00 00 0a bi 8003734 iop = rtems_libio_iop( fd ); 8003710: 78 0b 08 01 mvhi r11,0x801 8003714: 34 02 00 06 mvi r2,6 8003718: 39 6b 67 2c ori r11,r11,0x672c 800371c: f8 00 3d fb calli 8012f08 <__ashlsi3> 8003720: 29 6c 00 00 lw r12,(r11+0) 8003724: b5 81 60 00 add r12,r12,r1 rtems_libio_check_is_open( iop ); 8003728: 29 81 00 18 lw r1,(r12+24) 800372c: 20 22 01 00 andi r2,r1,0x100 8003730: 5c 40 00 04 bne r2,r0,8003740 8003734: f8 00 28 2e calli 800d7ec <__errno> 8003738: 34 02 00 09 mvi r2,9 800373c: e0 00 00 16 bi 8003794 rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ ); 8003740: 20 21 00 02 andi r1,r1,0x2 8003744: 44 20 00 12 be r1,r0,800378c <== NEVER TAKEN /* * Argument validation on IO vector */ if ( !iov ) 8003748: 45 a0 00 11 be r13,r0,800378c rtems_set_errno_and_return_minus_one( EINVAL ); if ( iovcnt <= 0 ) 800374c: 49 e0 00 02 bg r15,r0,8003754 8003750: e0 00 00 0f bi 800378c rtems_set_errno_and_return_minus_one( EINVAL ); if ( iovcnt > IOV_MAX ) 8003754: 34 01 04 00 mvi r1,1024 8003758: 4c 2f 00 02 bge r1,r15,8003760 <== ALWAYS TAKEN 800375c: e0 00 00 0c bi 800378c <== NOT EXECUTED 8003760: b9 a0 08 00 mv r1,r13 8003764: 34 02 00 01 mvi r2,1 8003768: 34 04 00 00 mvi r4,0 800376c: 34 03 00 00 mvi r3,0 8003770: e0 00 00 02 bi 8003778 if ( iov[v].iov_len < 0 ) rtems_set_errno_and_return_minus_one( EINVAL ); /* check for wrap */ old = total; total += iov[v].iov_len; 8003774: b8 c0 18 00 mv r3,r6 all_zeros = true; for ( total=0, v=0 ; v < iovcnt ; v++ ) { ssize_t old; if ( !iov[v].iov_base ) 8003778: 28 25 00 00 lw r5,(r1+0) 800377c: 44 a0 00 04 be r5,r0,800378c if ( iov[v].iov_len < 0 ) rtems_set_errno_and_return_minus_one( EINVAL ); /* check for wrap */ old = total; total += iov[v].iov_len; 8003780: 28 25 00 04 lw r5,(r1+4) 8003784: b4 65 30 00 add r6,r3,r5 if ( total < old ) 8003788: 4c c3 00 05 bge r6,r3,800379c rtems_set_errno_and_return_minus_one( EINVAL ); 800378c: f8 00 28 18 calli 800d7ec <__errno> 8003790: 34 02 00 16 mvi r2,22 8003794: 58 22 00 00 sw (r1+0),r2 8003798: e0 00 00 24 bi 8003828 if ( iov[v].iov_len ) all_zeros = false; 800379c: 64 a5 00 00 cmpei r5,r5,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++ ) { 80037a0: 34 84 00 01 addi r4,r4,1 total += iov[v].iov_len; if ( total < old ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( iov[v].iov_len ) all_zeros = false; 80037a4: c8 05 28 00 sub r5,r0,r5 80037a8: a0 45 10 00 and r2,r2,r5 * 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++ ) { 80037ac: 34 21 00 08 addi r1,r1,8 80037b0: 49 e4 ff f1 bg r15,r4,8003774 * 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 ) { return 0; 80037b4: 34 0b 00 00 mvi r11,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 ) { 80037b8: 5c 40 00 1d bne r2,r0,800382c 80037bc: 34 10 00 00 mvi r16,0 /* * Now process the readv(). */ for ( total=0, v=0 ; v < iovcnt ; v++ ) { bytes = (*iop->pathinfo.handlers->read_h)( 80037c0: 29 81 00 24 lw r1,(r12+36) 80037c4: 29 a2 00 00 lw r2,(r13+0) 80037c8: 29 a3 00 04 lw r3,(r13+4) 80037cc: 28 24 00 08 lw r4,(r1+8) 80037d0: b9 80 08 00 mv r1,r12 80037d4: d8 80 00 00 call r4 80037d8: b8 20 70 00 mv r14,r1 iop, iov[v].iov_base, iov[v].iov_len ); if ( bytes < 0 ) 80037dc: 48 01 00 13 bg r0,r1,8003828 <== NEVER TAKEN return -1; if ( bytes > 0 ) { 80037e0: 44 20 00 0c be r1,r0,8003810 <== NEVER TAKEN iop->offset += bytes; 80037e4: 34 02 00 1f mvi r2,31 80037e8: f8 00 3d ef calli 8012fa4 <__ashrsi3> 80037ec: 29 82 00 14 lw r2,(r12+20) 80037f0: 29 84 00 10 lw r4,(r12+16) total += bytes; 80037f4: b5 6e 58 00 add r11,r11,r14 if ( bytes < 0 ) return -1; if ( bytes > 0 ) { iop->offset += bytes; 80037f8: b5 c2 10 00 add r2,r14,r2 80037fc: f5 c2 18 00 cmpgu r3,r14,r2 8003800: b4 24 08 00 add r1,r1,r4 8003804: b4 61 08 00 add r1,r3,r1 8003808: 59 81 00 10 sw (r12+16),r1 800380c: 59 82 00 14 sw (r12+20),r2 total += bytes; } if (bytes != iov[ v ].iov_len) 8003810: 29 a1 00 04 lw r1,(r13+4) 8003814: 5d c1 00 06 bne r14,r1,800382c <== NEVER TAKEN } /* * Now process the readv(). */ for ( total=0, v=0 ; v < iovcnt ; v++ ) { 8003818: 36 10 00 01 addi r16,r16,1 800381c: 35 ad 00 08 addi r13,r13,8 8003820: 49 f0 ff e8 bg r15,r16,80037c0 8003824: e0 00 00 02 bi 800382c iov[v].iov_base, iov[v].iov_len ); if ( bytes < 0 ) return -1; 8003828: 34 0b ff ff mvi r11,-1 if (bytes != iov[ v ].iov_len) break; } return total; } 800382c: b9 60 08 00 mv r1,r11 8003830: 2b 9d 00 04 lw ra,(sp+4) 8003834: 2b 8b 00 1c lw r11,(sp+28) 8003838: 2b 8c 00 18 lw r12,(sp+24) 800383c: 2b 8d 00 14 lw r13,(sp+20) 8003840: 2b 8e 00 10 lw r14,(sp+16) 8003844: 2b 8f 00 0c lw r15,(sp+12) 8003848: 2b 90 00 08 lw r16,(sp+8) 800384c: 37 9c 00 1c addi sp,sp,28 8003850: c3 a0 00 00 ret =============================================================================== 08003700 : void *realloc( void *ptr, size_t size ) { 8003700: 37 9c ff e8 addi sp,sp,-24 8003704: 5b 8b 00 14 sw (sp+20),r11 8003708: 5b 8c 00 10 sw (sp+16),r12 800370c: 5b 8d 00 0c sw (sp+12),r13 8003710: 5b 8e 00 08 sw (sp+8),r14 8003714: 5b 9d 00 04 sw (sp+4),ra 8003718: b8 20 58 00 mv r11,r1 uintptr_t old_size; char *new_area; MSBUMP(realloc_calls, 1); 800371c: 78 01 08 01 mvhi r1,0x801 8003720: 38 21 98 00 ori r1,r1,0x9800 void *realloc( void *ptr, size_t size ) { 8003724: b8 40 60 00 mv r12,r2 uintptr_t old_size; char *new_area; MSBUMP(realloc_calls, 1); 8003728: 28 22 00 10 lw r2,(r1+16) 800372c: 34 42 00 01 addi r2,r2,1 8003730: 58 22 00 10 sw (r1+16),r2 /* * Do not attempt to allocate memory if in a critical section or ISR. */ if (_System_state_Is_up(_System_state_Get())) { 8003734: 78 01 08 01 mvhi r1,0x801 8003738: 38 21 9a a4 ori r1,r1,0x9aa4 800373c: 28 22 00 00 lw r2,(r1+0) 8003740: 34 01 00 03 mvi r1,3 8003744: 5c 41 00 09 bne r2,r1,8003768 <== NEVER TAKEN if (_Thread_Dispatch_disable_level > 0) 8003748: 78 01 08 01 mvhi r1,0x801 800374c: 38 21 99 24 ori r1,r1,0x9924 8003750: 28 22 00 00 lw r2,(r1+0) 8003754: 5c 40 00 33 bne r2,r0,8003820 <== NEVER TAKEN return (void *) 0; if (_ISR_Nest_level > 0) 8003758: 78 01 08 01 mvhi r1,0x801 800375c: 38 21 9d fc ori r1,r1,0x9dfc 8003760: 28 21 00 08 lw r1,(r1+8) 8003764: 5c 22 00 2f bne r1,r2,8003820 <== NEVER TAKEN } /* * Continue with realloc(). */ if ( !ptr ) 8003768: 5d 60 00 05 bne r11,r0,800377c return malloc( size ); 800376c: b9 80 08 00 mv r1,r12 8003770: fb ff fc f1 calli 8002b34 8003774: b8 20 58 00 mv r11,r1 8003778: e0 00 00 2b bi 8003824 if ( !size ) { 800377c: 5d 80 00 04 bne r12,r0,800378c <== ALWAYS TAKEN free( ptr ); 8003780: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8003784: fb ff fb f2 calli 800274c <== NOT EXECUTED 8003788: e0 00 00 26 bi 8003820 <== NOT EXECUTED return (void *) 0; } if ( !_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, ptr, &old_size) ) { 800378c: 78 0d 08 01 mvhi r13,0x801 8003790: 39 ad 90 1c ori r13,r13,0x901c 8003794: 29 a1 00 00 lw r1,(r13+0) 8003798: b9 60 10 00 mv r2,r11 800379c: 37 83 00 18 addi r3,sp,24 80037a0: f8 00 0a 2b calli 800604c <_Protected_heap_Get_block_size> 80037a4: 5c 20 00 05 bne r1,r0,80037b8 errno = EINVAL; 80037a8: f8 00 37 49 calli 80114cc <__errno> 80037ac: 34 02 00 16 mvi r2,22 80037b0: 58 22 00 00 sw (r1+0),r2 80037b4: e0 00 00 1b bi 8003820 } /* * Now resize it. */ if ( _Protected_heap_Resize_block( RTEMS_Malloc_Heap, ptr, size ) ) { 80037b8: 29 a1 00 00 lw r1,(r13+0) 80037bc: b9 60 10 00 mv r2,r11 80037c0: b9 80 18 00 mv r3,r12 80037c4: f8 00 0a 3c calli 80060b4 <_Protected_heap_Resize_block> 80037c8: b8 20 70 00 mv r14,r1 80037cc: 5c 20 00 16 bne r1,r0,8003824 * 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 ); 80037d0: b9 80 08 00 mv r1,r12 80037d4: fb ff fc d8 calli 8002b34 MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */ 80037d8: 78 02 08 01 mvhi r2,0x801 80037dc: 38 42 98 00 ori r2,r2,0x9800 * 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 ); 80037e0: b8 20 68 00 mv r13,r1 MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */ 80037e4: 28 41 00 04 lw r1,(r2+4) 80037e8: 34 21 ff ff addi r1,r1,-1 80037ec: 58 41 00 04 sw (r2+4),r1 if ( !new_area ) { 80037f0: 45 ae 00 0c be r13,r14,8003820 return (void *) 0; } memcpy( new_area, ptr, (size < old_size) ? size : old_size ); 80037f4: 2b 81 00 18 lw r1,(sp+24) 80037f8: b9 80 18 00 mv r3,r12 80037fc: 50 2c 00 02 bgeu r1,r12,8003804 <== NEVER TAKEN 8003800: b8 20 18 00 mv r3,r1 8003804: b9 60 10 00 mv r2,r11 8003808: b9 a0 08 00 mv r1,r13 800380c: f8 00 39 e6 calli 8011fa4 free( ptr ); 8003810: b9 60 08 00 mv r1,r11 8003814: fb ff fb ce calli 800274c return new_area; 8003818: b9 a0 58 00 mv r11,r13 800381c: e0 00 00 02 bi 8003824 new_area = malloc( size ); MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */ if ( !new_area ) { return (void *) 0; 8003820: 34 0b 00 00 mvi r11,0 memcpy( new_area, ptr, (size < old_size) ? size : old_size ); free( ptr ); return new_area; } 8003824: b9 60 08 00 mv r1,r11 8003828: 2b 9d 00 04 lw ra,(sp+4) 800382c: 2b 8b 00 14 lw r11,(sp+20) 8003830: 2b 8c 00 10 lw r12,(sp+16) 8003834: 2b 8d 00 0c lw r13,(sp+12) 8003838: 2b 8e 00 08 lw r14,(sp+8) 800383c: 37 9c 00 18 addi sp,sp,24 8003840: c3 a0 00 00 ret =============================================================================== 0800373c : #include int rmdir( const char *pathname ) { 800373c: 37 9c ff c0 addi sp,sp,-64 8003740: 5b 8b 00 14 sw (sp+20),r11 8003744: 5b 8c 00 10 sw (sp+16),r12 8003748: 5b 8d 00 0c sw (sp+12),r13 800374c: 5b 8e 00 08 sw (sp+8),r14 8003750: 5b 9d 00 04 sw (sp+4),ra 8003754: b8 20 70 00 mv r14,r1 /* * Get the parent node of the node we wish to remove. Find the parent path. */ parentpathlen = rtems_filesystem_dirname ( pathname ); 8003758: fb ff fa 64 calli 80020e8 800375c: b8 20 58 00 mv r11,r1 8003760: 37 84 00 2c addi r4,sp,44 if ( parentpathlen == 0 ) 8003764: 5c 20 00 07 bne r1,r0,8003780 rtems_filesystem_get_start_loc( pathname, &i, &parentloc ); 8003768: b9 c0 08 00 mv r1,r14 800376c: 37 82 00 40 addi r2,sp,64 8003770: b8 80 18 00 mv r3,r4 8003774: f8 00 00 4e calli 80038ac const char *name; rtems_filesystem_location_info_t parentloc; rtems_filesystem_location_info_t loc; int i; int result; bool free_parentloc = false; 8003778: 34 0d 00 00 mvi r13,0 800377c: e0 00 00 09 bi 80037a0 parentpathlen = rtems_filesystem_dirname ( pathname ); if ( parentpathlen == 0 ) rtems_filesystem_get_start_loc( pathname, &i, &parentloc ); else { result = rtems_filesystem_evaluate_path(pathname, parentpathlen, 8003780: b9 c0 08 00 mv r1,r14 8003784: b9 60 10 00 mv r2,r11 8003788: 34 03 00 02 mvi r3,2 800378c: 34 05 00 00 mvi r5,0 8003790: fb ff fa 31 calli 8002054 RTEMS_LIBIO_PERMS_WRITE, &parentloc, false ); if ( result != 0 ) return -1; 8003794: 34 0c ff ff mvi r12,-1 else { result = rtems_filesystem_evaluate_path(pathname, parentpathlen, RTEMS_LIBIO_PERMS_WRITE, &parentloc, false ); if ( result != 0 ) 8003798: 5c 20 00 3d bne r1,r0,800388c <== NEVER TAKEN return -1; free_parentloc = true; 800379c: 34 0d 00 01 mvi r13,1 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 80037a0: 2b 81 00 2c lw r1,(sp+44) name = pathname + parentpathlen; 80037a4: b5 cb 58 00 add r11,r14,r11 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 80037a8: 5b 81 00 18 sw (sp+24),r1 80037ac: 2b 81 00 30 lw r1,(sp+48) 80037b0: 5b 81 00 1c sw (sp+28),r1 80037b4: 2b 81 00 34 lw r1,(sp+52) 80037b8: 5b 81 00 20 sw (sp+32),r1 80037bc: 2b 81 00 38 lw r1,(sp+56) 80037c0: 5b 81 00 24 sw (sp+36),r1 80037c4: 2b 81 00 3c lw r1,(sp+60) 80037c8: 5b 81 00 28 sw (sp+40),r1 name = pathname + parentpathlen; name += rtems_filesystem_prefix_separators( name, strlen( name ) ); 80037cc: b9 60 08 00 mv r1,r11 80037d0: f8 00 2c 89 calli 800e9f4 80037d4: b8 20 10 00 mv r2,r1 80037d8: b9 60 08 00 mv r1,r11 80037dc: fb ff fa 57 calli 8002138 80037e0: b5 61 60 00 add r12,r11,r1 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 80037e4: b9 80 08 00 mv r1,r12 80037e8: f8 00 2c 83 calli 800e9f4 80037ec: 37 8b 00 18 addi r11,sp,24 80037f0: b8 20 10 00 mv r2,r1 80037f4: 34 03 00 00 mvi r3,0 80037f8: b9 80 08 00 mv r1,r12 80037fc: b9 60 20 00 mv r4,r11 8003800: 34 05 00 00 mvi r5,0 8003804: fb ff f9 e8 calli 8001fa4 0, &loc, false ); if ( result != 0 ) { 8003808: 44 20 00 05 be r1,r0,800381c if ( free_parentloc ) rtems_filesystem_freenode( &parentloc ); return -1; 800380c: 34 0c ff ff mvi r12,-1 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 0, &loc, false ); if ( result != 0 ) { if ( free_parentloc ) rtems_filesystem_freenode( &parentloc ); 8003810: 37 81 00 2c addi r1,sp,44 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 ) 8003814: 45 a0 00 1e be r13,r0,800388c <== ALWAYS TAKEN 8003818: e0 00 00 1c bi 8003888 <== NOT EXECUTED } /* * Verify you can remove this node as a directory. */ if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ){ 800381c: 2b 81 00 24 lw r1,(sp+36) 8003820: 28 22 00 10 lw r2,(r1+16) 8003824: b9 60 08 00 mv r1,r11 8003828: d8 40 00 00 call r2 800382c: 34 02 00 01 mvi r2,1 8003830: 44 22 00 0b be r1,r2,800385c rtems_filesystem_freenode( &loc ); 8003834: b9 60 08 00 mv r1,r11 8003838: fb ff fb 0e calli 8002470 if ( free_parentloc ) 800383c: 45 a0 00 03 be r13,r0,8003848 <== NEVER TAKEN rtems_filesystem_freenode( &parentloc ); 8003840: 37 81 00 2c addi r1,sp,44 8003844: fb ff fb 0b calli 8002470 rtems_set_errno_and_return_minus_one( ENOTDIR ); 8003848: f8 00 27 ff calli 800d844 <__errno> 800384c: 34 02 00 14 mvi r2,20 8003850: 58 22 00 00 sw (r1+0),r2 8003854: 34 0c ff ff mvi r12,-1 8003858: e0 00 00 0d bi 800388c /* * Use the filesystems rmnod to remove the node. */ result = (*loc.handlers->rmnod_h)( &parentloc, &loc ); 800385c: 2b 81 00 20 lw r1,(sp+32) 8003860: 37 8e 00 2c addi r14,sp,44 8003864: b9 60 10 00 mv r2,r11 8003868: 28 23 00 34 lw r3,(r1+52) 800386c: b9 c0 08 00 mv r1,r14 8003870: d8 60 00 00 call r3 8003874: b8 20 60 00 mv r12,r1 rtems_filesystem_freenode( &loc ); 8003878: b9 60 08 00 mv r1,r11 800387c: fb ff fa fd calli 8002470 if ( free_parentloc ) 8003880: 45 a0 00 03 be r13,r0,800388c rtems_filesystem_freenode( &parentloc ); 8003884: b9 c0 08 00 mv r1,r14 8003888: fb ff fa fa calli 8002470 return result; } 800388c: b9 80 08 00 mv r1,r12 8003890: 2b 9d 00 04 lw ra,(sp+4) 8003894: 2b 8b 00 14 lw r11,(sp+20) 8003898: 2b 8c 00 10 lw r12,(sp+16) 800389c: 2b 8d 00 0c lw r13,(sp+12) 80038a0: 2b 8e 00 08 lw r14,(sp+8) 80038a4: 37 9c 00 40 addi sp,sp,64 80038a8: c3 a0 00 00 ret =============================================================================== 08001fac : uint32_t rtems_assoc_remote_by_local_bitfield( const rtems_assoc_t *ap, uint32_t local_value ) { 8001fac: 37 9c ff e8 addi sp,sp,-24 8001fb0: 5b 8b 00 18 sw (sp+24),r11 8001fb4: 5b 8c 00 14 sw (sp+20),r12 8001fb8: 5b 8d 00 10 sw (sp+16),r13 8001fbc: 5b 8e 00 0c sw (sp+12),r14 8001fc0: 5b 8f 00 08 sw (sp+8),r15 8001fc4: 5b 9d 00 04 sw (sp+4),ra 8001fc8: 34 0d 00 20 mvi r13,32 8001fcc: b8 20 78 00 mv r15,r1 8001fd0: b8 40 70 00 mv r14,r2 uint32_t b; uint32_t remote_value = 0; 8001fd4: 34 0c 00 00 mvi r12,0 for (b = 1; b; b <<= 1) 8001fd8: 34 0b 00 01 mvi r11,1 if (b & local_value) 8001fdc: a1 6e 08 00 and r1,r11,r14 8001fe0: 44 20 00 05 be r1,r0,8001ff4 remote_value |= rtems_assoc_remote_by_local(ap, b); 8001fe4: b9 e0 08 00 mv r1,r15 8001fe8: b9 60 10 00 mv r2,r11 8001fec: f8 00 00 11 calli 8002030 8001ff0: b9 81 60 00 or r12,r12,r1 ) { uint32_t b; uint32_t remote_value = 0; for (b = 1; b; b <<= 1) 8001ff4: b9 60 08 00 mv r1,r11 8001ff8: 34 02 00 01 mvi r2,1 8001ffc: f8 00 42 2d calli 80128b0 <__ashlsi3> 8002000: 35 ad ff ff addi r13,r13,-1 8002004: b8 20 58 00 mv r11,r1 8002008: 5d a0 ff f5 bne r13,r0,8001fdc <== NEVER TAKEN if (b & local_value) remote_value |= rtems_assoc_remote_by_local(ap, b); return remote_value; } 800200c: b9 80 08 00 mv r1,r12 8002010: 2b 9d 00 04 lw ra,(sp+4) 8002014: 2b 8b 00 18 lw r11,(sp+24) 8002018: 2b 8c 00 14 lw r12,(sp+20) 800201c: 2b 8d 00 10 lw r13,(sp+16) 8002020: 2b 8e 00 0c lw r14,(sp+12) 8002024: 2b 8f 00 08 lw r15,(sp+8) 8002028: 37 9c 00 18 addi sp,sp,24 800202c: c3 a0 00 00 ret =============================================================================== 08000c84 : const char *rtems_bsp_cmdline_get_param( const char *name, char *value, size_t length ) { 8000c84: 37 9c ff f4 addi sp,sp,-12 8000c88: 5b 8b 00 0c sw (sp+12),r11 8000c8c: 5b 8c 00 08 sw (sp+8),r12 8000c90: 5b 9d 00 04 sw (sp+4),ra 8000c94: b8 40 58 00 mv r11,r2 8000c98: b8 60 60 00 mv r12,r3 const char *p; if ( !name ) 8000c9c: 44 20 00 1b be r1,r0,8000d08 return NULL; if ( !value ) 8000ca0: 44 40 00 1b be r2,r0,8000d0c return NULL; if ( !length ) 8000ca4: 44 60 00 19 be r3,r0,8000d08 return NULL; value[0] = '\0'; 8000ca8: 30 40 00 00 sb (r2+0),r0 p = rtems_bsp_cmdline_get_param_raw( name ); 8000cac: f8 00 00 1e calli 8000d24 if ( !p ) 8000cb0: 44 20 00 16 be r1,r0,8000d08 8000cb4: b9 60 10 00 mv r2,r11 8000cb8: 34 05 00 00 mvi r5,0 int i; int quotes; const char *p = start; quotes=0; for (i=0 ; *p && i int quotes; const char *p = start; quotes=0; for (i=0 ; *p && i quotes++; 8000cd0: 34 a5 00 01 addi r5,r5,1 8000cd4: e0 00 00 04 bi 8000ce4 } else if ( ((quotes % 2) == 0) && *p == ' ' ) 8000cd8: 20 a7 00 01 andi r7,r5,0x1 8000cdc: 5c e0 00 02 bne r7,r0,8000ce4 8000ce0: 44 83 00 0b be r4,r3,8000d0c break; value[i++] = *p++; 8000ce4: 30 44 00 00 sb (r2+0),r4 value[i] = '\0'; 8000ce8: 30 40 00 01 sb (r2+1),r0 for (i=0 ; *p && i 8000cfc: c8 4b 38 00 sub r7,r2,r11 8000d00: 55 87 ff f3 bgu r12,r7,8000ccc <== ALWAYS TAKEN 8000d04: e0 00 00 02 bi 8000d0c <== NOT EXECUTED value[0] = '\0'; p = rtems_bsp_cmdline_get_param_raw( name ); if ( !p ) return NULL; 8000d08: 34 0b 00 00 mvi r11,0 copy_string( p, value, length ); return value; } 8000d0c: b9 60 08 00 mv r1,r11 8000d10: 2b 9d 00 04 lw ra,(sp+4) 8000d14: 2b 8b 00 0c lw r11,(sp+12) 8000d18: 2b 8c 00 08 lw r12,(sp+8) 8000d1c: 37 9c 00 0c addi sp,sp,12 8000d20: c3 a0 00 00 ret =============================================================================== 08000d5c : const char *rtems_bsp_cmdline_get_param_rhs( const char *name, char *value, size_t length ) { 8000d5c: 37 9c ff f0 addi sp,sp,-16 8000d60: 5b 8b 00 10 sw (sp+16),r11 8000d64: 5b 8c 00 0c sw (sp+12),r12 8000d68: 5b 8d 00 08 sw (sp+8),r13 8000d6c: 5b 9d 00 04 sw (sp+4),ra 8000d70: b8 20 68 00 mv r13,r1 8000d74: b8 40 58 00 mv r11,r2 const char *p; const char *rhs; char *d; p = rtems_bsp_cmdline_get_param( name, value, length ); 8000d78: fb ff ff c3 calli 8000c84 8000d7c: b8 20 60 00 mv r12,r1 if ( !p ) 8000d80: 44 20 00 1a be r1,r0,8000de8 return NULL; rhs = &p[strlen(name)]; 8000d84: b9 a0 08 00 mv r1,r13 8000d88: f8 00 32 e7 calli 800d924 8000d8c: b5 81 18 00 add r3,r12,r1 if ( *rhs != '=' ) 8000d90: 40 62 00 00 lbu r2,(r3+0) 8000d94: 34 01 00 3d mvi r1,61 8000d98: 5c 41 00 14 bne r2,r1,8000de8 <== NEVER TAKEN return NULL; rhs++; if ( *rhs == '\"' ) 8000d9c: 40 64 00 01 lbu r4,(r3+1) 8000da0: 34 02 00 22 mvi r2,34 rhs = &p[strlen(name)]; if ( *rhs != '=' ) return NULL; rhs++; 8000da4: 34 61 00 01 addi r1,r3,1 if ( *rhs == '\"' ) 8000da8: 5c 82 00 02 bne r4,r2,8000db0 rhs++; 8000dac: 34 61 00 02 addi r1,r3,2 const char *rtems_bsp_cmdline_get_param_rhs( const char *name, char *value, size_t length ) { 8000db0: b9 60 18 00 mv r3,r11 8000db4: e0 00 00 04 bi 8000dc4 rhs++; if ( *rhs == '\"' ) rhs++; for ( d=value ; *rhs ; ) *d++ = *rhs++; 8000db8: 30 62 00 00 sb (r3+0),r2 8000dbc: 34 21 00 01 addi r1,r1,1 8000dc0: 34 63 00 01 addi r3,r3,1 return NULL; rhs++; if ( *rhs == '\"' ) rhs++; for ( d=value ; *rhs ; ) 8000dc4: 40 22 00 00 lbu r2,(r1+0) 8000dc8: 5c 40 ff fc bne r2,r0,8000db8 *d++ = *rhs++; if ( *(d-1) == '\"' ) 8000dcc: 40 64 ff ff lbu r4,(r3+-1) 8000dd0: 34 02 00 22 mvi r2,34 8000dd4: 34 61 ff ff addi r1,r3,-1 8000dd8: 44 82 00 02 be r4,r2,8000de0 8000ddc: b8 60 08 00 mv r1,r3 d--; *d = '\0'; 8000de0: 30 20 00 00 sb (r1+0),r0 return value; 8000de4: e0 00 00 02 bi 8000dec if ( !p ) return NULL; rhs = &p[strlen(name)]; if ( *rhs != '=' ) return NULL; 8000de8: 34 0b 00 00 mvi r11,0 if ( *(d-1) == '\"' ) d--; *d = '\0'; return value; } 8000dec: b9 60 08 00 mv r1,r11 8000df0: 2b 9d 00 04 lw ra,(sp+4) 8000df4: 2b 8b 00 10 lw r11,(sp+16) 8000df8: 2b 8c 00 0c lw r12,(sp+12) 8000dfc: 2b 8d 00 08 lw r13,(sp+8) 8000e00: 37 9c 00 10 addi sp,sp,16 8000e04: c3 a0 00 00 ret =============================================================================== 08010b48 : * error code - if unsuccessful */ rtems_status_code rtems_clock_set_nanoseconds_extension( rtems_nanoseconds_extension_routine routine ) { 8010b48: b8 20 18 00 mv r3,r1 if ( !routine ) return RTEMS_INVALID_ADDRESS; 8010b4c: 34 01 00 09 mvi r1,9 */ rtems_status_code rtems_clock_set_nanoseconds_extension( rtems_nanoseconds_extension_routine routine ) { if ( !routine ) 8010b50: 44 60 00 05 be r3,r0,8010b64 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _Watchdog_Nanoseconds_since_tick_handler = routine; 8010b54: 78 02 08 04 mvhi r2,0x804 <== NOT EXECUTED 8010b58: 38 42 0e 28 ori r2,r2,0xe28 <== NOT EXECUTED 8010b5c: 58 43 00 00 sw (r2+0),r3 <== NOT EXECUTED return RTEMS_SUCCESSFUL; 8010b60: 34 01 00 00 mvi r1,0 <== NOT EXECUTED } 8010b64: c3 a0 00 00 ret =============================================================================== 08001a58 : void rtems_cpu_usage_report_with_plugin( void *context, rtems_printk_plugin_t print ) { 8001a58: 37 9c ff 84 addi sp,sp,-124 8001a5c: 5b 8b 00 44 sw (sp+68),r11 8001a60: 5b 8c 00 40 sw (sp+64),r12 8001a64: 5b 8d 00 3c sw (sp+60),r13 8001a68: 5b 8e 00 38 sw (sp+56),r14 8001a6c: 5b 8f 00 34 sw (sp+52),r15 8001a70: 5b 90 00 30 sw (sp+48),r16 8001a74: 5b 91 00 2c sw (sp+44),r17 8001a78: 5b 92 00 28 sw (sp+40),r18 8001a7c: 5b 93 00 24 sw (sp+36),r19 8001a80: 5b 94 00 20 sw (sp+32),r20 8001a84: 5b 95 00 1c sw (sp+28),r21 8001a88: 5b 96 00 18 sw (sp+24),r22 8001a8c: 5b 97 00 14 sw (sp+20),r23 8001a90: 5b 98 00 10 sw (sp+16),r24 8001a94: 5b 99 00 0c sw (sp+12),r25 8001a98: 5b 9b 00 08 sw (sp+8),fp 8001a9c: 5b 9d 00 04 sw (sp+4),ra 8001aa0: b8 20 70 00 mv r14,r1 8001aa4: b8 40 68 00 mv r13,r2 Timestamp_Control uptime, total, ran; #else uint32_t total_units = 0; #endif if ( !print ) 8001aa8: 44 40 00 61 be r2,r0,8001c2c <== NEVER TAKEN * When not using nanosecond CPU usage resolution, we have to count * the number of "ticks" we gave credit for to give the user a rough * guideline as to what each number means proportionally. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); 8001aac: 37 8b 00 70 addi r11,sp,112 8001ab0: b9 60 08 00 mv r1,r11 8001ab4: f8 00 0f 95 calli 8005908 <_TOD_Get_uptime> _Timestamp_Subtract( &CPU_usage_Uptime_at_last_reset, &uptime, &total ); 8001ab8: 37 90 00 68 addi r16,sp,104 8001abc: 78 01 08 02 mvhi r1,0x802 8001ac0: 38 21 9b d8 ori r1,r1,0x9bd8 8001ac4: b9 60 10 00 mv r2,r11 8001ac8: ba 00 18 00 mv r3,r16 8001acc: f8 00 1a c8 calli 80085ec <_Timespec_Subtract> } } } #endif (*print)( 8001ad0: 78 02 08 01 mvhi r2,0x801 8001ad4: b9 c0 08 00 mv r1,r14 8001ad8: 38 42 e6 e0 ori r2,r2,0xe6e0 8001adc: 78 0c 08 02 mvhi r12,0x802 if ( !the_thread ) continue; rtems_object_get_name( the_thread->Object.id, sizeof(name), name ); (*print)( 8001ae0: 78 13 08 01 mvhi r19,0x801 /* * If this is the currently executing thread, account for time * since the last context switch. */ ran = the_thread->cpu_time_used; if ( _Thread_Executing->Object.id == the_thread->Object.id ) { 8001ae4: 78 0f 08 02 mvhi r15,0x802 /* * Print the information */ (*print)( context, 8001ae8: 78 12 08 01 mvhi r18,0x801 * since the last context switch. */ ran = the_thread->cpu_time_used; if ( _Thread_Executing->Object.id == the_thread->Object.id ) { Timestamp_Control used; _Timestamp_Subtract( 8001aec: 78 11 08 02 mvhi r17,0x802 } } } #endif (*print)( 8001af0: d9 a0 00 00 call r13 8001af4: 39 8c 96 3c ori r12,r12,0x963c the_thread = (Thread_Control *)information->local_table[ i ]; if ( !the_thread ) continue; rtems_object_get_name( the_thread->Object.id, sizeof(name), name ); 8001af8: 37 98 00 48 addi r24,sp,72 (*print)( 8001afc: 3a 73 e8 54 ori r19,r19,0xe854 /* * If this is the currently executing thread, account for time * since the last context switch. */ ran = the_thread->cpu_time_used; if ( _Thread_Executing->Object.id == the_thread->Object.id ) { 8001b00: 39 ef 9b b4 ori r15,r15,0x9bb4 _Timestamp_Subtract( &_Thread_Time_of_last_context_switch, &uptime, &used ); _Timestamp_Add_to( &ran, &used ); }; _Timestamp_Divide( &ran, &total, &ival, &fval ); 8001b04: 37 97 00 60 addi r23,sp,96 8001b08: 37 9b 00 78 addi fp,sp,120 /* * Print the information */ (*print)( context, 8001b0c: 3a 52 e8 68 ori r18,r18,0xe868 * since the last context switch. */ ran = the_thread->cpu_time_used; if ( _Thread_Executing->Object.id == the_thread->Object.id ) { Timestamp_Control used; _Timestamp_Subtract( 8001b10: 3a 31 97 4c ori r17,r17,0x974c 8001b14: b9 60 c8 00 mv r25,r11 8001b18: 37 96 00 58 addi r22,sp,88 ); for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) 8001b1c: 29 83 00 00 lw r3,(r12+0) 8001b20: 44 60 00 35 be r3,r0,8001bf4 <== NEVER TAKEN continue; information = _Objects_Information_table[ api_index ][ 1 ]; 8001b24: 28 70 00 04 lw r16,(r3+4) if ( information ) { 8001b28: 34 15 00 04 mvi r21,4 8001b2c: 34 14 00 01 mvi r20,1 8001b30: 5e 00 00 2f bne r16,r0,8001bec <== ALWAYS TAKEN 8001b34: e0 00 00 30 bi 8001bf4 <== NOT EXECUTED for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 8001b38: 2a 01 00 1c lw r1,(r16+28) 8001b3c: b4 35 08 00 add r1,r1,r21 8001b40: 28 2b 00 00 lw r11,(r1+0) if ( !the_thread ) 8001b44: 45 60 00 28 be r11,r0,8001be4 <== NEVER TAKEN continue; rtems_object_get_name( the_thread->Object.id, sizeof(name), name ); 8001b48: 29 61 00 08 lw r1,(r11+8) 8001b4c: 34 02 00 0d mvi r2,13 8001b50: bb 00 18 00 mv r3,r24 8001b54: f8 00 0a 21 calli 80043d8 (*print)( 8001b58: 29 63 00 08 lw r3,(r11+8) 8001b5c: ba 60 10 00 mv r2,r19 8001b60: b9 c0 08 00 mv r1,r14 8001b64: bb 00 20 00 mv r4,r24 8001b68: d9 a0 00 00 call r13 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ /* * If this is the currently executing thread, account for time * since the last context switch. */ ran = the_thread->cpu_time_used; 8001b6c: 29 61 00 84 lw r1,(r11+132) 8001b70: 5b 81 00 60 sw (sp+96),r1 8001b74: 29 61 00 88 lw r1,(r11+136) 8001b78: 5b 81 00 64 sw (sp+100),r1 if ( _Thread_Executing->Object.id == the_thread->Object.id ) { 8001b7c: 29 e1 00 0c lw r1,(r15+12) 8001b80: 28 22 00 08 lw r2,(r1+8) 8001b84: 29 61 00 08 lw r1,(r11+8) 8001b88: 5c 41 00 08 bne r2,r1,8001ba8 Timestamp_Control used; _Timestamp_Subtract( 8001b8c: ba 20 08 00 mv r1,r17 8001b90: bb 20 10 00 mv r2,r25 8001b94: ba c0 18 00 mv r3,r22 8001b98: f8 00 1a 95 calli 80085ec <_Timespec_Subtract> &_Thread_Time_of_last_context_switch, &uptime, &used ); _Timestamp_Add_to( &ran, &used ); 8001b9c: ba e0 08 00 mv r1,r23 8001ba0: ba c0 10 00 mv r2,r22 8001ba4: f8 00 1a 21 calli 8008428 <_Timespec_Add_to> }; _Timestamp_Divide( &ran, &total, &ival, &fval ); 8001ba8: 37 83 00 7c addi r3,sp,124 8001bac: bb 60 20 00 mv r4,fp 8001bb0: ba e0 08 00 mv r1,r23 8001bb4: 37 82 00 68 addi r2,sp,104 8001bb8: f8 00 1a 35 calli 800848c <_Timespec_Divide> /* * Print the information */ (*print)( context, 8001bbc: 2b 81 00 64 lw r1,(sp+100) 8001bc0: 34 02 03 e8 mvi r2,1000 8001bc4: f8 00 6d 0f calli 801d000 <__udivsi3> 8001bc8: 2b 83 00 60 lw r3,(sp+96) 8001bcc: 2b 85 00 7c lw r5,(sp+124) 8001bd0: 2b 86 00 78 lw r6,(sp+120) 8001bd4: b8 20 20 00 mv r4,r1 8001bd8: ba 40 10 00 mv r2,r18 8001bdc: b9 c0 08 00 mv r1,r14 8001be0: d9 a0 00 00 call r13 api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) continue; information = _Objects_Information_table[ api_index ][ 1 ]; if ( information ) { for ( i=1 ; i <= information->maximum ; i++ ) { 8001be4: 36 94 00 01 addi r20,r20,1 8001be8: 36 b5 00 04 addi r21,r21,4 8001bec: 2e 01 00 10 lhu r1,(r16+16) 8001bf0: 50 34 ff d2 bgeu r1,r20,8001b38 " ID | NAME | TICKS | PERCENT\n" #endif "------------+----------------------------------------+---------------+---------\n" ); for ( api_index = 1 ; 8001bf4: 78 01 08 02 mvhi r1,0x802 api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) continue; information = _Objects_Information_table[ api_index ][ 1 ]; if ( information ) { for ( i=1 ; i <= information->maximum ; i++ ) { 8001bf8: 35 8c 00 04 addi r12,r12,4 " ID | NAME | TICKS | PERCENT\n" #endif "------------+----------------------------------------+---------------+---------\n" ); for ( api_index = 1 ; 8001bfc: 38 21 96 48 ori r1,r1,0x9648 8001c00: 5d 81 ff c7 bne r12,r1,8001b1c } } } #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( 8001c04: 2b 81 00 6c lw r1,(sp+108) 8001c08: 34 02 03 e8 mvi r2,1000 8001c0c: 78 0b 08 01 mvhi r11,0x801 8001c10: f8 00 6c fc calli 801d000 <__udivsi3> 8001c14: 2b 83 00 68 lw r3,(sp+104) 8001c18: 39 6b e8 80 ori r11,r11,0xe880 8001c1c: b8 20 20 00 mv r4,r1 8001c20: b9 60 10 00 mv r2,r11 8001c24: b9 c0 08 00 mv r1,r14 8001c28: d9 a0 00 00 call r13 "-------------------------------------------------------------------------------\n", _Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset, total_units ); #endif } 8001c2c: 2b 9d 00 04 lw ra,(sp+4) 8001c30: 2b 8b 00 44 lw r11,(sp+68) 8001c34: 2b 8c 00 40 lw r12,(sp+64) 8001c38: 2b 8d 00 3c lw r13,(sp+60) 8001c3c: 2b 8e 00 38 lw r14,(sp+56) 8001c40: 2b 8f 00 34 lw r15,(sp+52) 8001c44: 2b 90 00 30 lw r16,(sp+48) 8001c48: 2b 91 00 2c lw r17,(sp+44) 8001c4c: 2b 92 00 28 lw r18,(sp+40) 8001c50: 2b 93 00 24 lw r19,(sp+36) 8001c54: 2b 94 00 20 lw r20,(sp+32) 8001c58: 2b 95 00 1c lw r21,(sp+28) 8001c5c: 2b 96 00 18 lw r22,(sp+24) 8001c60: 2b 97 00 14 lw r23,(sp+20) 8001c64: 2b 98 00 10 lw r24,(sp+16) 8001c68: 2b 99 00 0c lw r25,(sp+12) 8001c6c: 2b 9b 00 08 lw fp,(sp+8) 8001c70: 37 9c 00 7c addi sp,sp,124 8001c74: c3 a0 00 00 ret =============================================================================== 080112e8 : [RTEMS_IO_ERROR] = EIO, [RTEMS_PROXY_BLOCKING] = EIO }; int rtems_deviceio_errno(rtems_status_code sc) { 80112e8: 37 9c ff f8 addi sp,sp,-8 80112ec: 5b 8b 00 08 sw (sp+8),r11 80112f0: 5b 9d 00 04 sw (sp+4),ra if (sc == RTEMS_SUCCESSFUL) { return 0; 80112f4: 34 02 00 00 mvi r2,0 [RTEMS_PROXY_BLOCKING] = EIO }; int rtems_deviceio_errno(rtems_status_code sc) { if (sc == RTEMS_SUCCESSFUL) { 80112f8: 44 20 00 0d be r1,r0,801132c <== ALWAYS TAKEN return 0; } else { int eno = EINVAL; if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) { 80112fc: 34 02 00 1c mvi r2,28 <== NOT EXECUTED int rtems_deviceio_errno(rtems_status_code sc) { if (sc == RTEMS_SUCCESSFUL) { return 0; } else { int eno = EINVAL; 8011300: 34 0b 00 16 mvi r11,22 <== NOT EXECUTED if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) { 8011304: 54 22 00 07 bgu r1,r2,8011320 <== NOT EXECUTED eno = status_code_to_errno [sc]; 8011308: 78 0b 08 01 mvhi r11,0x801 <== NOT EXECUTED 801130c: 34 02 00 02 mvi r2,2 <== NOT EXECUTED 8011310: 39 6b 86 b4 ori r11,r11,0x86b4 <== NOT EXECUTED 8011314: f8 00 16 ef calli 8016ed0 <__ashlsi3> <== NOT EXECUTED 8011318: b5 61 08 00 add r1,r11,r1 <== NOT EXECUTED 801131c: 28 2b 00 00 lw r11,(r1+0) <== NOT EXECUTED } errno = eno; 8011320: f8 00 00 6b calli 80114cc <__errno> <== NOT EXECUTED 8011324: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED return -1; 8011328: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED } } 801132c: b8 40 08 00 mv r1,r2 8011330: 2b 9d 00 04 lw ra,(sp+4) 8011334: 2b 8b 00 08 lw r11,(sp+8) 8011338: 37 9c 00 08 addi sp,sp,8 801133c: c3 a0 00 00 ret =============================================================================== 080025e4 : size_t pathnamelen, int flags, rtems_filesystem_location_info_t *pathloc, int follow_link ) { 80025e4: 37 9c ff e4 addi sp,sp,-28 80025e8: 5b 8b 00 10 sw (sp+16),r11 80025ec: 5b 8c 00 0c sw (sp+12),r12 80025f0: 5b 8d 00 08 sw (sp+8),r13 80025f4: 5b 9d 00 04 sw (sp+4),ra int i = 0; 80025f8: 5b 80 00 1c sw (sp+28),r0 size_t pathnamelen, int flags, rtems_filesystem_location_info_t *pathloc, int follow_link ) { 80025fc: b8 20 58 00 mv r11,r1 8002600: b8 40 68 00 mv r13,r2 8002604: b8 60 60 00 mv r12,r3 /* * Verify Input parameters. */ if ( !pathname ) 8002608: 5c 20 00 04 bne r1,r0,8002618 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); 800260c: f8 00 3b b0 calli 80114cc <__errno> <== NOT EXECUTED 8002610: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 8002614: e0 00 00 04 bi 8002624 <== NOT EXECUTED if ( !pathloc ) 8002618: 5c 80 00 06 bne r4,r0,8002630 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EIO ); /* should never happen */ 800261c: f8 00 3b ac calli 80114cc <__errno> <== NOT EXECUTED 8002620: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8002624: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8002628: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800262c: e0 00 00 0d bi 8002660 <== NOT EXECUTED /* * Evaluate the path using the optable evalpath. */ rtems_filesystem_get_start_loc( pathname, &i, pathloc ); 8002630: b8 80 18 00 mv r3,r4 8002634: 37 82 00 1c addi r2,sp,28 8002638: 5b 84 00 18 sw (sp+24),r4 800263c: 5b 85 00 14 sw (sp+20),r5 8002640: f8 00 04 81 calli 8003844 /* * We evaluation the path relative to the start location we get got. */ return rtems_filesystem_evaluate_relative_path( &pathname[i], 8002644: 2b 86 00 1c lw r6,(sp+28) 8002648: 2b 84 00 18 lw r4,(sp+24) 800264c: 2b 85 00 14 lw r5,(sp+20) 8002650: b5 66 08 00 add r1,r11,r6 8002654: c9 a6 10 00 sub r2,r13,r6 8002658: b9 80 18 00 mv r3,r12 800265c: fb ff ff b6 calli 8002534 pathnamelen - i, flags, pathloc, follow_link ); } 8002660: 2b 9d 00 04 lw ra,(sp+4) 8002664: 2b 8b 00 10 lw r11,(sp+16) 8002668: 2b 8c 00 0c lw r12,(sp+12) 800266c: 2b 8d 00 08 lw r13,(sp+8) 8002670: 37 9c 00 1c addi sp,sp,28 8002674: c3 a0 00 00 ret =============================================================================== 08002534 : size_t pathnamelen, int flags, rtems_filesystem_location_info_t *pathloc, int follow_link ) { 8002534: 37 9c ff f0 addi sp,sp,-16 8002538: 5b 8b 00 10 sw (sp+16),r11 800253c: 5b 8c 00 0c sw (sp+12),r12 8002540: 5b 8d 00 08 sw (sp+8),r13 8002544: 5b 9d 00 04 sw (sp+4),ra 8002548: b8 60 60 00 mv r12,r3 800254c: b8 80 58 00 mv r11,r4 8002550: b8 a0 68 00 mv r13,r5 /* * Verify Input parameters. */ if ( !pathname ) 8002554: 5c 20 00 04 bne r1,r0,8002564 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); 8002558: f8 00 3b dd calli 80114cc <__errno> <== NOT EXECUTED 800255c: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 8002560: e0 00 00 04 bi 8002570 <== NOT EXECUTED if ( !pathloc ) 8002564: 5c 80 00 06 bne r4,r0,800257c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EIO ); /* should never happen */ 8002568: f8 00 3b d9 calli 80114cc <__errno> <== NOT EXECUTED 800256c: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8002570: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8002574: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8002578: e0 00 00 15 bi 80025cc <== NOT EXECUTED result = (*pathloc->ops->evalpath_h)( pathname, pathnamelen, flags, pathloc ); 800257c: 28 85 00 0c lw r5,(r4+12) 8002580: 28 a6 00 00 lw r6,(r5+0) 8002584: d8 c0 00 00 call r6 /* * Get the Node type and determine if you need to follow the link or * not. */ if ( (result == 0) && follow_link ) { 8002588: 64 22 00 00 cmpei r2,r1,0 800258c: 7d a5 00 00 cmpnei r5,r13,0 8002590: a0 45 28 00 and r5,r2,r5 8002594: 44 a0 00 0e be r5,r0,80025cc type = (*pathloc->ops->node_type_h)( pathloc ); 8002598: 29 61 00 0c lw r1,(r11+12) 800259c: 28 24 00 10 lw r4,(r1+16) 80025a0: b9 60 08 00 mv r1,r11 80025a4: d8 80 00 00 call r4 if ( ( type == RTEMS_FILESYSTEM_HARD_LINK ) || 80025a8: 34 24 ff fd addi r4,r1,-3 80025ac: 34 02 00 01 mvi r2,1 80025b0: 34 01 00 00 mvi r1,0 80025b4: 54 82 00 06 bgu r4,r2,80025cc * 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 ); 80025b8: 29 61 00 0c lw r1,(r11+12) 80025bc: b9 80 10 00 mv r2,r12 80025c0: 28 24 00 34 lw r4,(r1+52) 80025c4: b9 60 08 00 mv r1,r11 80025c8: d8 80 00 00 call r4 } } return result; } 80025cc: 2b 9d 00 04 lw ra,(sp+4) 80025d0: 2b 8b 00 10 lw r11,(sp+16) 80025d4: 2b 8c 00 0c lw r12,(sp+12) 80025d8: 2b 8d 00 08 lw r13,(sp+8) 80025dc: 37 9c 00 10 addi sp,sp,16 80025e0: c3 a0 00 00 ret =============================================================================== 0800c918 : rtems_filesystem_fsmount_me_t rtems_filesystem_get_mount_handler( const char *type ) { 800c918: 37 9c ff f4 addi sp,sp,-12 800c91c: 5b 9d 00 04 sw (sp+4),ra find_arg fa = { 800c920: 5b 81 00 08 sw (sp+8),r1 800c924: 5b 80 00 0c sw (sp+12),r0 .type = type, .mount_h = NULL }; if ( type != NULL ) { 800c928: 44 20 00 05 be r1,r0,800c93c <== NEVER TAKEN rtems_filesystem_iterate( find_handler, &fa ); 800c92c: 78 01 08 00 mvhi r1,0x800 800c930: 38 21 c7 b4 ori r1,r1,0xc7b4 800c934: 37 82 00 08 addi r2,sp,8 800c938: fb ff ff c7 calli 800c854 } return fa.mount_h; } 800c93c: 2b 81 00 0c lw r1,(sp+12) 800c940: 2b 9d 00 04 lw ra,(sp+4) 800c944: 37 9c 00 0c addi sp,sp,12 800c948: c3 a0 00 00 ret =============================================================================== 0800236c : * configuration is a single instantiation of the IMFS or miniIMFS with * a single "/dev" directory in it. */ void rtems_filesystem_initialize( void ) { 800236c: 37 9c ff dc addi sp,sp,-36 8002370: 5b 8b 00 10 sw (sp+16),r11 8002374: 5b 8c 00 0c sw (sp+12),r12 8002378: 5b 8d 00 08 sw (sp+8),r13 800237c: 5b 9d 00 04 sw (sp+4),ra /* * Set the default umask to "022". */ rtems_filesystem_umask = 022; 8002380: 78 0b 08 01 mvhi r11,0x801 8002384: 39 6b 91 04 ori r11,r11,0x9104 8002388: 29 62 00 00 lw r2,(r11+0) 800238c: 34 01 00 12 mvi r1,18 8002390: 58 41 00 2c sw (r2+44),r1 /* * mount the first filesystem. */ if ( rtems_filesystem_mount_table_size == 0 ) 8002394: 78 01 08 01 mvhi r1,0x801 8002398: 38 21 7d f0 ori r1,r1,0x7df0 800239c: 28 21 00 00 lw r1,(r1+0) rtems_fatal_error_occurred( 0xABCD0001 ); 80023a0: 78 02 08 01 mvhi r2,0x801 80023a4: 38 42 7e fc ori r2,r2,0x7efc /* * mount the first filesystem. */ if ( rtems_filesystem_mount_table_size == 0 ) 80023a8: 44 20 00 0e be r1,r0,80023e0 <== NEVER TAKEN rtems_fatal_error_occurred( 0xABCD0001 ); mt = &rtems_filesystem_mount_table[0]; 80023ac: 78 01 08 01 mvhi r1,0x801 80023b0: 38 21 90 18 ori r1,r1,0x9018 80023b4: 28 24 00 00 lw r4,(r1+0) status = mount( mt->device, mt->mount_point, mt->type, mt->fsoptions, NULL ); 80023b8: 34 05 00 00 mvi r5,0 80023bc: 28 82 00 0c lw r2,(r4+12) 80023c0: 28 81 00 08 lw r1,(r4+8) 80023c4: 28 83 00 00 lw r3,(r4+0) 80023c8: 28 84 00 04 lw r4,(r4+4) 80023cc: f8 00 02 8c calli 8002dfc if ( status == -1 ) 80023d0: 34 02 ff ff mvi r2,-1 80023d4: 5c 22 00 05 bne r1,r2,80023e8 <== ALWAYS TAKEN rtems_fatal_error_occurred( 0xABCD0002 ); 80023d8: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 80023dc: 38 42 7f 00 ori r2,r2,0x7f00 <== NOT EXECUTED 80023e0: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 80023e4: f8 00 08 5e calli 800455c <== NOT EXECUTED rtems_filesystem_link_counts = 0; 80023e8: 29 61 00 00 lw r1,(r11+0) * gonna hit performance. * * Till Straumann, 10/25/2002 */ /* Clone the root pathloc */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 80023ec: 78 0c 08 01 mvhi r12,0x801 80023f0: 39 8c 7e f0 ori r12,r12,0x7ef0 80023f4: 37 8d 00 14 addi r13,sp,20 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; 80023f8: 0c 20 00 30 sh (r1+48),r0 * gonna hit performance. * * Till Straumann, 10/25/2002 */ /* Clone the root pathloc */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 80023fc: 34 02 00 01 mvi r2,1 8002400: 34 03 00 00 mvi r3,0 8002404: b9 a0 20 00 mv r4,r13 8002408: 34 05 00 00 mvi r5,0 800240c: b9 80 08 00 mv r1,r12 8002410: f8 00 00 75 calli 80025e4 rtems_filesystem_root = loc; 8002414: 29 61 00 00 lw r1,(r11+0) 8002418: 2b 82 00 14 lw r2,(sp+20) /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 800241c: 34 03 00 00 mvi r3,0 8002420: b9 a0 20 00 mv r4,r13 * * Till Straumann, 10/25/2002 */ /* Clone the root pathloc */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_root = loc; 8002424: 58 22 00 18 sw (r1+24),r2 8002428: 2b 82 00 18 lw r2,(sp+24) /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 800242c: 34 05 00 00 mvi r5,0 * * Till Straumann, 10/25/2002 */ /* Clone the root pathloc */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_root = loc; 8002430: 58 22 00 1c sw (r1+28),r2 8002434: 2b 82 00 1c lw r2,(sp+28) 8002438: 58 22 00 20 sw (r1+32),r2 800243c: 2b 82 00 20 lw r2,(sp+32) 8002440: 58 22 00 24 sw (r1+36),r2 8002444: 2b 82 00 24 lw r2,(sp+36) 8002448: 58 22 00 28 sw (r1+40),r2 /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 800244c: 34 02 00 01 mvi r2,1 8002450: b9 80 08 00 mv r1,r12 8002454: f8 00 00 64 calli 80025e4 rtems_filesystem_current = loc; 8002458: 29 61 00 00 lw r1,(r11+0) 800245c: 2b 82 00 14 lw r2,(sp+20) 8002460: 58 22 00 04 sw (r1+4),r2 8002464: 2b 82 00 18 lw r2,(sp+24) 8002468: 58 22 00 08 sw (r1+8),r2 800246c: 2b 82 00 1c lw r2,(sp+28) 8002470: 58 22 00 0c sw (r1+12),r2 8002474: 2b 82 00 20 lw r2,(sp+32) 8002478: 58 22 00 10 sw (r1+16),r2 800247c: 2b 82 00 24 lw r2,(sp+36) 8002480: 58 22 00 14 sw (r1+20),r2 * * 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); 8002484: 78 01 08 01 mvhi r1,0x801 8002488: 34 02 01 ff mvi r2,511 800248c: 38 21 7e f4 ori r1,r1,0x7ef4 8002490: f8 00 01 e8 calli 8002c30 if ( status != 0 ) rtems_fatal_error_occurred( 0xABCD0003 ); 8002494: 78 02 08 01 mvhi r2,0x801 8002498: 38 42 7f 04 ori r2,r2,0x7f04 * NOTE: UNIX root is 755 and owned by root/root (0/0). It is actually * created that way by the IMFS. */ status = mkdir( "/dev", 0777); if ( status != 0 ) 800249c: 5c 20 ff d1 bne r1,r0,80023e0 <== NEVER TAKEN * 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. */ } 80024a0: 2b 9d 00 04 lw ra,(sp+4) 80024a4: 2b 8b 00 10 lw r11,(sp+16) 80024a8: 2b 8c 00 0c lw r12,(sp+12) 80024ac: 2b 8d 00 08 lw r13,(sp+8) 80024b0: 37 9c 00 24 addi sp,sp,36 80024b4: c3 a0 00 00 ret =============================================================================== 0800c854 : bool rtems_filesystem_iterate( rtems_per_filesystem_routine routine, void *routine_arg ) { 800c854: 37 9c ff e8 addi sp,sp,-24 800c858: 5b 8b 00 18 sw (sp+24),r11 800c85c: 5b 8c 00 14 sw (sp+20),r12 800c860: 5b 8d 00 10 sw (sp+16),r13 800c864: 5b 8e 00 0c sw (sp+12),r14 800c868: 5b 8f 00 08 sw (sp+8),r15 800c86c: 5b 9d 00 04 sw (sp+4),ra const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0]; 800c870: 78 0b 08 01 mvhi r11,0x801 bool rtems_filesystem_iterate( rtems_per_filesystem_routine routine, void *routine_arg ) { 800c874: b8 20 70 00 mv r14,r1 800c878: b8 40 78 00 mv r15,r2 const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0]; rtems_chain_node *node = NULL; bool stop = false; 800c87c: 34 03 00 00 mvi r3,0 bool rtems_filesystem_iterate( rtems_per_filesystem_routine routine, void *routine_arg ) { const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0]; 800c880: 39 6b 7d d0 ori r11,r11,0x7dd0 rtems_chain_node *node = NULL; bool stop = false; while ( table_entry->type && !stop ) { 800c884: e0 00 00 06 bi 800c89c stop = (*routine)( table_entry, routine_arg ); 800c888: b9 60 08 00 mv r1,r11 800c88c: b9 e0 10 00 mv r2,r15 800c890: d9 c0 00 00 call r14 800c894: b8 20 18 00 mv r3,r1 ++table_entry; 800c898: 35 6b 00 08 addi r11,r11,8 { const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0]; rtems_chain_node *node = NULL; bool stop = false; while ( table_entry->type && !stop ) { 800c89c: 29 61 00 00 lw r1,(r11+0) 800c8a0: 44 20 00 03 be r1,r0,800c8ac 800c8a4: 44 60 ff f9 be r3,r0,800c888 <== ALWAYS TAKEN 800c8a8: e0 00 00 13 bi 800c8f4 <== NOT EXECUTED 800c8ac: b8 60 58 00 mv r11,r3 stop = (*routine)( table_entry, routine_arg ); ++table_entry; } if ( !stop ) { 800c8b0: 5c 23 00 11 bne r1,r3,800c8f4 rtems_libio_lock(); 800c8b4: fb ff ff d4 calli 800c804 } } rtems_libio_unlock(); rtems_set_errno_and_return_minus_one( ENOENT ); } 800c8b8: 78 03 08 01 mvhi r3,0x801 800c8bc: 38 63 91 40 ori r3,r3,0x9140 ++table_entry; } if ( !stop ) { rtems_libio_lock(); for ( 800c8c0: 78 0d 08 01 mvhi r13,0x801 } } rtems_libio_unlock(); rtems_set_errno_and_return_minus_one( ENOENT ); } 800c8c4: 28 6c 00 00 lw r12,(r3+0) ++table_entry; } if ( !stop ) { rtems_libio_lock(); for ( 800c8c8: 39 ad 91 44 ori r13,r13,0x9144 800c8cc: e0 00 00 06 bi 800c8e4 !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 ); 800c8d0: 35 81 00 08 addi r1,r12,8 800c8d4: b9 e0 10 00 mv r2,r15 800c8d8: d9 c0 00 00 call r14 } } rtems_libio_unlock(); rtems_set_errno_and_return_minus_one( ENOENT ); } 800c8dc: 29 8c 00 00 lw r12,(r12+0) !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 ); 800c8e0: b8 20 58 00 mv r11,r1 ++table_entry; } if ( !stop ) { rtems_libio_lock(); for ( 800c8e4: 45 8d 00 02 be r12,r13,800c8ec node = rtems_chain_first( &filesystem_chain ); !rtems_chain_is_tail( &filesystem_chain, node ) && !stop; 800c8e8: 45 60 ff fa be r11,r0,800c8d0 <== ALWAYS TAKEN ) { const filesystem_node *fsn = (filesystem_node *) node; stop = (*routine)( &fsn->entry, routine_arg ); } rtems_libio_unlock(); 800c8ec: fb ff ff d1 calli 800c830 800c8f0: b9 60 18 00 mv r3,r11 } return stop; } 800c8f4: b8 60 08 00 mv r1,r3 800c8f8: 2b 9d 00 04 lw ra,(sp+4) 800c8fc: 2b 8b 00 18 lw r11,(sp+24) 800c900: 2b 8c 00 14 lw r12,(sp+20) 800c904: 2b 8d 00 10 lw r13,(sp+16) 800c908: 2b 8e 00 0c lw r14,(sp+12) 800c90c: 2b 8f 00 08 lw r15,(sp+8) 800c910: 37 9c 00 18 addi sp,sp,24 800c914: c3 a0 00 00 ret =============================================================================== 08002d74 : bool rtems_filesystem_mount_iterate( rtems_per_filesystem_mount_routine routine, void *routine_arg ) { 8002d74: 37 9c ff e8 addi sp,sp,-24 8002d78: 5b 8b 00 18 sw (sp+24),r11 8002d7c: 5b 8c 00 14 sw (sp+20),r12 8002d80: 5b 8d 00 10 sw (sp+16),r13 8002d84: 5b 8e 00 0c sw (sp+12),r14 8002d88: 5b 8f 00 08 sw (sp+8),r15 8002d8c: 5b 9d 00 04 sw (sp+4),ra 8002d90: b8 20 78 00 mv r15,r1 8002d94: b8 40 70 00 mv r14,r2 rtems_chain_node *node = NULL; bool stop = false; rtems_libio_lock(); 8002d98: fb ff ff e3 calli 8002d24 stop = (*routine)( mt_entry, routine_arg ); } rtems_libio_unlock(); return stop; } 8002d9c: 78 03 08 01 mvhi r3,0x801 8002da0: 38 63 90 f8 ori r3,r3,0x90f8 { rtems_chain_node *node = NULL; bool stop = false; rtems_libio_lock(); for ( 8002da4: 78 0d 08 01 mvhi r13,0x801 stop = (*routine)( mt_entry, routine_arg ); } rtems_libio_unlock(); return stop; } 8002da8: 28 6b 00 00 lw r11,(r3+0) rtems_per_filesystem_mount_routine routine, void *routine_arg ) { rtems_chain_node *node = NULL; bool stop = false; 8002dac: 34 0c 00 00 mvi r12,0 rtems_libio_lock(); for ( 8002db0: 39 ad 90 fc ori r13,r13,0x90fc 8002db4: e0 00 00 06 bi 8002dcc 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 ); 8002db8: b9 60 08 00 mv r1,r11 8002dbc: b9 c0 10 00 mv r2,r14 8002dc0: d9 e0 00 00 call r15 } rtems_libio_unlock(); return stop; } 8002dc4: 29 6b 00 00 lw r11,(r11+0) 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 ); 8002dc8: b8 20 60 00 mv r12,r1 { rtems_chain_node *node = NULL; bool stop = false; rtems_libio_lock(); for ( 8002dcc: 45 6d 00 02 be r11,r13,8002dd4 node = rtems_chain_first( &mount_chain ); !rtems_chain_is_tail( &mount_chain, node ) && !stop; 8002dd0: 45 80 ff fa be r12,r0,8002db8 <== ALWAYS TAKEN const rtems_filesystem_mount_table_entry_t *mt_entry = (rtems_filesystem_mount_table_entry_t *) node; stop = (*routine)( mt_entry, routine_arg ); } rtems_libio_unlock(); 8002dd4: fb ff ff df calli 8002d50 return stop; } 8002dd8: b9 80 08 00 mv r1,r12 8002ddc: 2b 9d 00 04 lw ra,(sp+4) 8002de0: 2b 8b 00 18 lw r11,(sp+24) 8002de4: 2b 8c 00 14 lw r12,(sp+20) 8002de8: 2b 8d 00 10 lw r13,(sp+16) 8002dec: 2b 8e 00 0c lw r14,(sp+12) 8002df0: 2b 8f 00 08 lw r15,(sp+8) 8002df4: 37 9c 00 18 addi sp,sp,24 8002df8: c3 a0 00 00 ret =============================================================================== 080026c8 : int rtems_filesystem_prefix_separators( const char *pathname, int pathnamelen ) { 80026c8: 37 9c ff f0 addi sp,sp,-16 80026cc: 5b 8b 00 10 sw (sp+16),r11 80026d0: 5b 8c 00 0c sw (sp+12),r12 80026d4: 5b 8d 00 08 sw (sp+8),r13 80026d8: 5b 9d 00 04 sw (sp+4),ra /* * Eat any separators at start of the path. */ int stripped = 0; 80026dc: 34 0b 00 00 mvi r11,0 int rtems_filesystem_prefix_separators( const char *pathname, int pathnamelen ) { 80026e0: b8 20 68 00 mv r13,r1 80026e4: b8 40 60 00 mv r12,r2 /* * Eat any separators at start of the path. */ int stripped = 0; while ( *pathname && pathnamelen && rtems_filesystem_is_separator( *pathname ) ) 80026e8: e0 00 00 02 bi 80026f0 { pathname++; pathnamelen--; stripped++; 80026ec: 35 6b 00 01 addi r11,r11,1 } return len; } int rtems_filesystem_prefix_separators( 80026f0: b5 ab 08 00 add r1,r13,r11 { /* * Eat any separators at start of the path. */ int stripped = 0; while ( *pathname && pathnamelen && rtems_filesystem_is_separator( *pathname ) ) 80026f4: 40 21 00 00 lbu r1,(r1+0) 80026f8: fd 8b 18 00 cmpne r3,r12,r11 80026fc: 7c 22 00 00 cmpnei r2,r1,0 8002700: a0 62 10 00 and r2,r3,r2 8002704: 44 40 00 03 be r2,r0,8002710 <== NEVER TAKEN 8002708: f8 00 04 79 calli 80038ec 800270c: 5c 20 ff f8 bne r1,r0,80026ec pathname++; pathnamelen--; stripped++; } return stripped; } 8002710: b9 60 08 00 mv r1,r11 8002714: 2b 9d 00 04 lw ra,(sp+4) 8002718: 2b 8b 00 10 lw r11,(sp+16) 800271c: 2b 8c 00 0c lw r12,(sp+12) 8002720: 2b 8d 00 08 lw r13,(sp+8) 8002724: 37 9c 00 10 addi sp,sp,16 8002728: c3 a0 00 00 ret =============================================================================== 0800ca08 : int rtems_filesystem_unregister( const char *type ) { 800ca08: 37 9c ff f0 addi sp,sp,-16 800ca0c: 5b 8b 00 10 sw (sp+16),r11 800ca10: 5b 8c 00 0c sw (sp+12),r12 800ca14: 5b 8d 00 08 sw (sp+8),r13 800ca18: 5b 9d 00 04 sw (sp+4),ra 800ca1c: b8 20 68 00 mv r13,r1 rtems_chain_node *node = NULL; if ( type == NULL ) { 800ca20: 5c 20 00 04 bne r1,r0,800ca30 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 800ca24: f8 00 12 aa calli 80114cc <__errno> 800ca28: 34 02 00 16 mvi r2,22 800ca2c: e0 00 00 18 bi 800ca8c } rtems_libio_lock(); 800ca30: fb ff ff 75 calli 800c804 } } rtems_libio_unlock(); rtems_set_errno_and_return_minus_one( ENOENT ); } 800ca34: 78 03 08 01 mvhi r3,0x801 800ca38: 38 63 91 40 ori r3,r3,0x9140 if ( type == NULL ) { rtems_set_errno_and_return_minus_one( EINVAL ); } rtems_libio_lock(); for ( 800ca3c: 78 0c 08 01 mvhi r12,0x801 } } rtems_libio_unlock(); rtems_set_errno_and_return_minus_one( ENOENT ); } 800ca40: 28 6b 00 00 lw r11,(r3+0) if ( type == NULL ) { rtems_set_errno_and_return_minus_one( EINVAL ); } rtems_libio_lock(); for ( 800ca44: 39 8c 91 44 ori r12,r12,0x9144 800ca48: e0 00 00 0d bi 800ca7c !rtems_chain_is_tail( &filesystem_chain, node ); node = rtems_chain_next( node ) ) { filesystem_node *fsn = (filesystem_node *) node; if ( strcmp( fsn->entry.type, type ) == 0 ) { 800ca4c: 29 61 00 08 lw r1,(r11+8) 800ca50: b9 a0 10 00 mv r2,r13 800ca54: f8 00 16 93 calli 80124a0 800ca58: 5c 20 00 08 bne r1,r0,800ca78 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 800ca5c: b9 60 08 00 mv r1,r11 800ca60: fb ff e0 5b calli 8004bcc <_Chain_Extract> rtems_chain_extract( node ); free( fsn ); 800ca64: b9 60 08 00 mv r1,r11 800ca68: fb ff d7 39 calli 800274c rtems_libio_unlock(); 800ca6c: fb ff ff 71 calli 800c830 return 0; 800ca70: 34 01 00 00 mvi r1,0 800ca74: e0 00 00 08 bi 800ca94 } } rtems_libio_unlock(); rtems_set_errno_and_return_minus_one( ENOENT ); } 800ca78: 29 6b 00 00 lw r11,(r11+0) if ( type == NULL ) { rtems_set_errno_and_return_minus_one( EINVAL ); } rtems_libio_lock(); for ( 800ca7c: 5d 6c ff f4 bne r11,r12,800ca4c rtems_libio_unlock(); return 0; } } rtems_libio_unlock(); 800ca80: fb ff ff 6c calli 800c830 rtems_set_errno_and_return_minus_one( ENOENT ); 800ca84: f8 00 12 92 calli 80114cc <__errno> 800ca88: 34 02 00 02 mvi r2,2 800ca8c: 58 22 00 00 sw (r1+0),r2 800ca90: 34 01 ff ff mvi r1,-1 } 800ca94: 2b 9d 00 04 lw ra,(sp+4) 800ca98: 2b 8b 00 10 lw r11,(sp+16) 800ca9c: 2b 8c 00 0c lw r12,(sp+12) 800caa0: 2b 8d 00 08 lw r13,(sp+8) 800caa4: 37 9c 00 10 addi sp,sp,16 800caa8: c3 a0 00 00 ret =============================================================================== 08001ddc : void *rtems_gxx_getspecific(__gthread_key_t key) { 8001ddc: 37 9c ff f4 addi sp,sp,-12 8001de0: 5b 8b 00 08 sw (sp+8),r11 8001de4: 5b 9d 00 04 sw (sp+4),ra 8001de8: b8 20 58 00 mv r11,r1 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 ); 8001dec: b9 60 10 00 mv r2,r11 8001df0: 34 01 00 00 mvi r1,0 8001df4: 37 83 00 0c addi r3,sp,12 } void *rtems_gxx_getspecific(__gthread_key_t key) { rtems_status_code status; void *p= 0; 8001df8: 5b 80 00 0c sw (sp+12),r0 /* register with RTEMS the buffer that will hold the key values */ status = rtems_task_variable_get( RTEMS_SELF, (void **)key, &p ); 8001dfc: f8 00 07 80 calli 8003bfc if ( status == RTEMS_SUCCESSFUL ) { 8001e00: 5c 20 00 04 bne r1,r0,8001e10 <== NEVER TAKEN /* We do not have to do this, but what the heck ! */ p= key->val; 8001e04: 29 61 00 00 lw r1,(r11+0) 8001e08: 5b 81 00 0c sw (sp+12),r1 8001e0c: e0 00 00 0a bi 8001e34 } 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 ); 8001e10: 29 63 00 04 lw r3,(r11+4) <== NOT EXECUTED 8001e14: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8001e18: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8001e1c: f8 00 07 26 calli 8003ab4 <== NOT EXECUTED if ( status != RTEMS_SUCCESSFUL ) { 8001e20: 44 20 00 04 be r1,r0,8001e30 <== NOT EXECUTED rtems_panic ("rtems_gxx_getspecific"); 8001e24: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8001e28: 38 21 ca 74 ori r1,r1,0xca74 <== NOT EXECUTED 8001e2c: f8 00 1b 9e calli 8008ca4 <== NOT EXECUTED } key->val = (void *)0; 8001e30: 59 60 00 00 sw (r11+0),r0 <== NOT EXECUTED p, rtems_task_self() ); #endif return p; } 8001e34: 2b 81 00 0c lw r1,(sp+12) 8001e38: 2b 9d 00 04 lw ra,(sp+4) 8001e3c: 2b 8b 00 08 lw r11,(sp+8) 8001e40: 37 9c 00 0c addi sp,sp,12 8001e44: c3 a0 00 00 ret =============================================================================== 08001d9c : int rtems_gxx_key_delete (__gthread_key_t key) { 8001d9c: 37 9c ff f8 addi sp,sp,-8 8001da0: 5b 8b 00 08 sw (sp+8),r11 8001da4: 5b 9d 00 04 sw (sp+4),ra 8001da8: b8 20 58 00 mv r11,r1 #ifdef DEBUG_GXX_WRAPPERS printk( "gxx_wrappers: delete key=%x\n", key ); #endif /* register with RTEMS the buffer that will hold the key values */ status = rtems_task_variable_delete( RTEMS_SELF, (void **)key ); 8001dac: b9 60 10 00 mv r2,r11 8001db0: 34 01 00 00 mvi r1,0 8001db4: f8 00 07 6f calli 8003b70 if ( status == RTEMS_SUCCESSFUL ) { 8001db8: 5c 20 00 04 bne r1,r0,8001dc8 <== NEVER TAKEN /* Hmm - hopefully all tasks using this key have gone away... */ if ( key ) free( (void *)key ); 8001dbc: 45 61 00 03 be r11,r1,8001dc8 <== NEVER TAKEN 8001dc0: b9 60 08 00 mv r1,r11 8001dc4: fb ff ff 63 calli 8001b50 return 0; } return 0; } 8001dc8: 34 01 00 00 mvi r1,0 8001dcc: 2b 9d 00 04 lw ra,(sp+4) 8001dd0: 2b 8b 00 08 lw r11,(sp+8) 8001dd4: 37 9c 00 08 addi sp,sp,8 8001dd8: c3 a0 00 00 ret =============================================================================== 08001d90 : { #ifdef DEBUG_GXX_WRAPPERS printk( "gxx_wrappers: dtor key=%x, ptr=%x\n", key, ptr ); #endif key->val = 0; 8001d90: 58 20 00 00 sw (r1+0),r0 <== NOT EXECUTED return 0; } 8001d94: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8001d98: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08001f08 : int rtems_gxx_mutex_destroy (__gthread_mutex_t *mutex) { 8001f08: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 8001f0c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED #ifdef DEBUG_GXX_WRAPPERS printk( "gxx_wrappers: destroy mutex=%X\n", *mutex ); #endif status = rtems_semaphore_delete(*(rtems_id *)mutex); 8001f10: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED 8001f14: f8 00 05 71 calli 80034d8 <== NOT EXECUTED if ( status == RTEMS_SUCCESSFUL ) return 0; 8001f18: 7c 21 00 00 cmpnei r1,r1,0 <== NOT EXECUTED return -1; } 8001f1c: c8 01 08 00 sub r1,r0,r1 <== NOT EXECUTED 8001f20: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8001f24: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 8001f28: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08001e98 : /* * MUTEX support */ void rtems_gxx_mutex_init (__gthread_mutex_t *mutex) { 8001e98: 37 9c ff fc addi sp,sp,-4 8001e9c: 5b 9d 00 04 sw (sp+4),ra #ifdef DEBUG_GXX_WRAPPERS printk( "gxx_wrappers: mutex init =%X\n", *mutex ); #endif status = rtems_semaphore_create( 8001ea0: 78 02 08 01 mvhi r2,0x801 8001ea4: 38 42 ca a4 ori r2,r2,0xcaa4 /* * MUTEX support */ void rtems_gxx_mutex_init (__gthread_mutex_t *mutex) { 8001ea8: b8 20 28 00 mv r5,r1 #ifdef DEBUG_GXX_WRAPPERS printk( "gxx_wrappers: mutex init =%X\n", *mutex ); #endif status = rtems_semaphore_create( 8001eac: 28 41 00 00 lw r1,(r2+0) 8001eb0: 34 03 00 54 mvi r3,84 8001eb4: 34 02 00 01 mvi r2,1 8001eb8: 34 04 00 00 mvi r4,0 8001ebc: f8 00 05 0a calli 80032e4 RTEMS_PRIORITY|RTEMS_BINARY_SEMAPHORE| RTEMS_INHERIT_PRIORITY|RTEMS_NO_PRIORITY_CEILING|RTEMS_LOCAL, 0, (rtems_id *)mutex ); if ( status != RTEMS_SUCCESSFUL ) { 8001ec0: 44 20 00 04 be r1,r0,8001ed0 <== ALWAYS TAKEN "gxx_wrappers: mutex init failed %s (%d)\n", rtems_status_text(status), status ); #endif rtems_panic ("rtems_gxx_mutex_init"); 8001ec4: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8001ec8: 38 21 ca 8c ori r1,r1,0xca8c <== NOT EXECUTED 8001ecc: f8 00 1b 76 calli 8008ca4 <== NOT EXECUTED } #ifdef DEBUG_GXX_WRAPPERS printk( "gxx_wrappers: mutex init complete =%X\n", *mutex ); #endif } 8001ed0: 2b 9d 00 04 lw ra,(sp+4) 8001ed4: 37 9c 00 04 addi sp,sp,4 8001ed8: c3 a0 00 00 ret =============================================================================== 08001cb8 : 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)) { 8001cb8: 37 9c ff e8 addi sp,sp,-24 8001cbc: 5b 8b 00 14 sw (sp+20),r11 8001cc0: 5b 8c 00 10 sw (sp+16),r12 8001cc4: 5b 8d 00 0c sw (sp+12),r13 8001cc8: 5b 8e 00 08 sw (sp+8),r14 8001ccc: 5b 9d 00 04 sw (sp+4),ra #ifdef DEBUG_GXX_WRAPPERS printk( "gxx_wrappers: once=%x, func=%x\n", *once, func ); #endif if ( *(volatile __gthread_once_t *)once == 0 ) { 8001cd0: 28 2d 00 00 lw r13,(r1+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)) { 8001cd4: b8 20 58 00 mv r11,r1 8001cd8: b8 40 70 00 mv r14,r2 #ifdef DEBUG_GXX_WRAPPERS printk( "gxx_wrappers: once=%x, func=%x\n", *once, func ); #endif if ( *(volatile __gthread_once_t *)once == 0 ) { 8001cdc: 5d a0 00 0f bne r13,r0,8001d18 rtems_mode saveMode; __gthread_once_t o; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 8001ce0: 34 01 01 00 mvi r1,256 8001ce4: 34 02 01 00 mvi r2,256 8001ce8: 37 83 00 18 addi r3,sp,24 8001cec: f8 00 06 e5 calli 8003880 if ( (o = *(volatile __gthread_once_t *)once) == 0 ) { 8001cf0: 29 6c 00 00 lw r12,(r11+0) 8001cf4: 5d 8d 00 03 bne r12,r13,8001d00 <== NEVER TAKEN *(volatile __gthread_once_t *)once = 1; 8001cf8: 34 01 00 01 mvi r1,1 8001cfc: 59 61 00 00 sw (r11+0),r1 } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 8001d00: 2b 81 00 18 lw r1,(sp+24) 8001d04: 34 02 01 00 mvi r2,256 8001d08: 37 83 00 18 addi r3,sp,24 8001d0c: f8 00 06 dd calli 8003880 if ( o == 0 ) 8001d10: 5d 80 00 02 bne r12,r0,8001d18 <== NEVER TAKEN (*func)(); 8001d14: d9 c0 00 00 call r14 } return 0; } 8001d18: 34 01 00 00 mvi r1,0 8001d1c: 2b 9d 00 04 lw ra,(sp+4) 8001d20: 2b 8b 00 14 lw r11,(sp+20) 8001d24: 2b 8c 00 10 lw r12,(sp+16) 8001d28: 2b 8d 00 0c lw r13,(sp+12) 8001d2c: 2b 8e 00 08 lw r14,(sp+8) 8001d30: 37 9c 00 18 addi sp,sp,24 8001d34: c3 a0 00 00 ret =============================================================================== 08001e48 : int rtems_gxx_setspecific(__gthread_key_t key, const void *ptr) { 8001e48: 37 9c ff f4 addi sp,sp,-12 8001e4c: 5b 8b 00 0c sw (sp+12),r11 8001e50: 5b 8c 00 08 sw (sp+8),r12 8001e54: 5b 9d 00 04 sw (sp+4),ra 8001e58: b8 20 58 00 mv r11,r1 rtems_task_self() ); #endif /* register with RTEMS the buffer that will hold the key values */ status = rtems_task_variable_add( RTEMS_SELF, (void **)key, key->dtor ); 8001e5c: 29 63 00 04 lw r3,(r11+4) #endif return p; } int rtems_gxx_setspecific(__gthread_key_t key, const void *ptr) { 8001e60: b8 40 60 00 mv r12,r2 rtems_task_self() ); #endif /* register with RTEMS the buffer that will hold the key values */ status = rtems_task_variable_add( RTEMS_SELF, (void **)key, key->dtor ); 8001e64: 34 01 00 00 mvi r1,0 8001e68: b9 60 10 00 mv r2,r11 8001e6c: f8 00 07 12 calli 8003ab4 if ( status == RTEMS_SUCCESSFUL ) { /* now let's set the proper value */ key->val = (void *)ptr; return 0; } return -1; 8001e70: 34 03 ff ff mvi r3,-1 ); #endif /* register with RTEMS the buffer that will hold the key values */ status = rtems_task_variable_add( RTEMS_SELF, (void **)key, key->dtor ); if ( status == RTEMS_SUCCESSFUL ) { 8001e74: 5c 20 00 03 bne r1,r0,8001e80 <== NEVER TAKEN /* now let's set the proper value */ key->val = (void *)ptr; 8001e78: 59 6c 00 00 sw (r11+0),r12 return 0; 8001e7c: 34 03 00 00 mvi r3,0 } return -1; } 8001e80: b8 60 08 00 mv r1,r3 8001e84: 2b 9d 00 04 lw ra,(sp+4) 8001e88: 2b 8b 00 0c lw r11,(sp+12) 8001e8c: 2b 8c 00 08 lw r12,(sp+8) 8001e90: 37 9c 00 0c addi sp,sp,12 8001e94: c3 a0 00 00 ret =============================================================================== 08006d20 : void *rtems_heap_allocate_aligned_with_boundary( size_t size, uintptr_t alignment, uintptr_t boundary ) { 8006d20: 37 9c ff f0 addi sp,sp,-16 8006d24: 5b 8b 00 10 sw (sp+16),r11 8006d28: 5b 8c 00 0c sw (sp+12),r12 8006d2c: 5b 8d 00 08 sw (sp+8),r13 8006d30: 5b 9d 00 04 sw (sp+4),ra if ( 8006d34: 78 05 08 02 mvhi r5,0x802 8006d38: 38 a5 63 3c ori r5,r5,0x633c void *rtems_heap_allocate_aligned_with_boundary( size_t size, uintptr_t alignment, uintptr_t boundary ) { 8006d3c: b8 40 60 00 mv r12,r2 if ( 8006d40: 28 a2 00 00 lw r2,(r5+0) void *rtems_heap_allocate_aligned_with_boundary( size_t size, uintptr_t alignment, uintptr_t boundary ) { 8006d44: b8 20 68 00 mv r13,r1 if ( 8006d48: 34 01 00 03 mvi r1,3 void *rtems_heap_allocate_aligned_with_boundary( size_t size, uintptr_t alignment, uintptr_t boundary ) { 8006d4c: b8 60 58 00 mv r11,r3 if ( 8006d50: 5c 41 00 04 bne r2,r1,8006d60 <== NEVER TAKEN _System_state_Is_up( _System_state_Get() ) && !malloc_is_system_state_OK() 8006d54: fb ff fb 15 calli 80059a8 ) { return NULL; 8006d58: 34 05 00 00 mvi r5,0 uintptr_t boundary ) { if ( _System_state_Is_up( _System_state_Get() ) && !malloc_is_system_state_OK() 8006d5c: 44 20 00 0a be r1,r0,8006d84 ) { return NULL; } malloc_deferred_frees_process(); 8006d60: fb ff fb 24 calli 80059f0 /* FIXME: Statistics, boundary checks */ return _Protected_heap_Allocate_aligned_with_boundary( 8006d64: 78 05 08 02 mvhi r5,0x802 8006d68: 38 a5 50 1c ori r5,r5,0x501c 8006d6c: 28 a1 00 00 lw r1,(r5+0) 8006d70: b9 a0 10 00 mv r2,r13 8006d74: b9 80 18 00 mv r3,r12 8006d78: b9 60 20 00 mv r4,r11 8006d7c: f8 00 0e 02 calli 800a584 <_Protected_heap_Allocate_aligned_with_boundary> 8006d80: b8 20 28 00 mv r5,r1 RTEMS_Malloc_Heap, size, alignment, boundary ); } 8006d84: b8 a0 08 00 mv r1,r5 8006d88: 2b 9d 00 04 lw ra,(sp+4) 8006d8c: 2b 8b 00 10 lw r11,(sp+16) 8006d90: 2b 8c 00 0c lw r12,(sp+12) 8006d94: 2b 8d 00 08 lw r13,(sp+8) 8006d98: 37 9c 00 10 addi sp,sp,16 8006d9c: c3 a0 00 00 ret =============================================================================== 08010f5c : rtems_status_code rtems_io_control( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 8010f5c: 37 9c ff ec addi sp,sp,-20 8010f60: 5b 8b 00 10 sw (sp+16),r11 8010f64: 5b 8c 00 0c sw (sp+12),r12 8010f68: 5b 8d 00 08 sw (sp+8),r13 8010f6c: 5b 9d 00 04 sw (sp+4),ra rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 8010f70: 78 04 08 01 mvhi r4,0x801 8010f74: 38 84 a2 40 ori r4,r4,0xa240 rtems_status_code rtems_io_control( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 8010f78: b8 40 60 00 mv r12,r2 rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 8010f7c: 28 82 00 00 lw r2,(r4+0) rtems_status_code rtems_io_control( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 8010f80: b8 20 58 00 mv r11,r1 rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) return RTEMS_INVALID_NUMBER; 8010f84: 34 04 00 0a mvi r4,10 void *argument ) { rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 8010f88: 50 22 00 13 bgeu r1,r2,8010fd4 <== NEVER TAKEN return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].control_entry; 8010f8c: 78 04 08 01 mvhi r4,0x801 8010f90: 38 84 a2 44 ori r4,r4,0xa244 8010f94: 34 02 00 01 mvi r2,1 8010f98: 28 8d 00 00 lw r13,(r4+0) 8010f9c: 5b 83 00 14 sw (sp+20),r3 8010fa0: f8 00 17 cc calli 8016ed0 <__ashlsi3> 8010fa4: b4 2b 08 00 add r1,r1,r11 8010fa8: 34 02 00 03 mvi r2,3 8010fac: f8 00 17 c9 calli 8016ed0 <__ashlsi3> 8010fb0: b5 a1 08 00 add r1,r13,r1 8010fb4: 28 25 00 14 lw r5,(r1+20) return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 8010fb8: 34 04 00 00 mvi r4,0 8010fbc: 2b 83 00 14 lw r3,(sp+20) 8010fc0: 44 a0 00 05 be r5,r0,8010fd4 8010fc4: b9 60 08 00 mv r1,r11 8010fc8: b9 80 10 00 mv r2,r12 8010fcc: d8 a0 00 00 call r5 8010fd0: b8 20 20 00 mv r4,r1 } 8010fd4: b8 80 08 00 mv r1,r4 8010fd8: 2b 9d 00 04 lw ra,(sp+4) 8010fdc: 2b 8b 00 10 lw r11,(sp+16) 8010fe0: 2b 8c 00 0c lw r12,(sp+12) 8010fe4: 2b 8d 00 08 lw r13,(sp+8) 8010fe8: 37 9c 00 14 addi sp,sp,20 8010fec: c3 a0 00 00 ret =============================================================================== 080060c0 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 80060c0: 37 9c ff e4 addi sp,sp,-28 80060c4: 5b 8b 00 1c sw (sp+28),r11 80060c8: 5b 8c 00 18 sw (sp+24),r12 80060cc: 5b 8d 00 14 sw (sp+20),r13 80060d0: 5b 8e 00 10 sw (sp+16),r14 80060d4: 5b 8f 00 0c sw (sp+12),r15 80060d8: 5b 90 00 08 sw (sp+8),r16 80060dc: 5b 9d 00 04 sw (sp+4),ra 80060e0: b8 20 78 00 mv r15,r1 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 80060e4: 44 20 00 18 be r1,r0,8006144 <== NEVER TAKEN #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 80060e8: 78 02 08 02 mvhi r2,0x802 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 80060ec: 78 0b 08 02 mvhi r11,0x802 #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 80060f0: 38 42 96 38 ori r2,r2,0x9638 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 80060f4: 39 6b 96 3c ori r11,r11,0x963c #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 80060f8: 34 50 00 10 addi r16,r2,16 if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) 80060fc: 29 61 00 00 lw r1,(r11+0) 8006100: 44 20 00 0f be r1,r0,800613c <== NEVER TAKEN continue; information = _Objects_Information_table[ api_index ][ 1 ]; 8006104: 28 2c 00 04 lw r12,(r1+4) if ( !information ) 8006108: 34 0e 00 04 mvi r14,4 800610c: 34 0d 00 01 mvi r13,1 8006110: 5d 80 00 09 bne r12,r0,8006134 8006114: e0 00 00 0a bi 800613c continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 8006118: 29 81 00 1c lw r1,(r12+28) 800611c: b4 2e 08 00 add r1,r1,r14 8006120: 28 21 00 00 lw r1,(r1+0) if ( !the_thread ) 8006124: 44 20 00 02 be r1,r0,800612c continue; (*routine)(the_thread); 8006128: d9 e0 00 00 call r15 information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 800612c: 35 ad 00 01 addi r13,r13,1 8006130: 35 ce 00 04 addi r14,r14,4 8006134: 2d 81 00 10 lhu r1,(r12+16) 8006138: 50 2d ff f8 bgeu r1,r13,8006118 800613c: 35 6b 00 04 addi r11,r11,4 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 8006140: 5d 70 ff ef bne r11,r16,80060fc (*routine)(the_thread); } } } 8006144: 2b 9d 00 04 lw ra,(sp+4) 8006148: 2b 8b 00 1c lw r11,(sp+28) 800614c: 2b 8c 00 18 lw r12,(sp+24) 8006150: 2b 8d 00 14 lw r13,(sp+20) 8006154: 2b 8e 00 10 lw r14,(sp+16) 8006158: 2b 8f 00 0c lw r15,(sp+12) 800615c: 2b 90 00 08 lw r16,(sp+8) 8006160: 37 9c 00 1c addi sp,sp,28 8006164: c3 a0 00 00 ret =============================================================================== 0800c66c : */ void rtems_libio_free( rtems_libio_t *iop ) { 800c66c: 37 9c ff f8 addi sp,sp,-8 800c670: 5b 8b 00 08 sw (sp+8),r11 800c674: 5b 9d 00 04 sw (sp+4),ra 800c678: b8 20 58 00 mv r11,r1 rtems_libio_lock(); 800c67c: fb ff ff 90 calli 800c4bc if (iop->sem) 800c680: 29 61 00 30 lw r1,(r11+48) 800c684: 44 20 00 02 be r1,r0,800c68c <== NEVER TAKEN rtems_semaphore_delete(iop->sem); 800c688: fb ff de 58 calli 8003fe8 iop->flags &= ~LIBIO_FLAGS_OPEN; 800c68c: 29 62 00 18 lw r2,(r11+24) 800c690: 34 01 fe ff mvi r1,-257 800c694: a0 41 08 00 and r1,r2,r1 800c698: 59 61 00 18 sw (r11+24),r1 iop->data1 = rtems_libio_iop_freelist; 800c69c: 78 01 08 01 mvhi r1,0x801 800c6a0: 38 21 97 ec ori r1,r1,0x97ec 800c6a4: 28 22 00 00 lw r2,(r1+0) rtems_libio_iop_freelist = iop; 800c6a8: 58 2b 00 00 sw (r1+0),r11 if (iop->sem) rtems_semaphore_delete(iop->sem); iop->flags &= ~LIBIO_FLAGS_OPEN; iop->data1 = rtems_libio_iop_freelist; 800c6ac: 59 62 00 38 sw (r11+56),r2 rtems_libio_iop_freelist = iop; rtems_libio_unlock(); 800c6b0: fb ff ff 8e calli 800c4e8 } 800c6b4: 2b 9d 00 04 lw ra,(sp+4) 800c6b8: 2b 8b 00 08 lw r11,(sp+8) 800c6bc: 37 9c 00 08 addi sp,sp,8 800c6c0: c3 a0 00 00 ret =============================================================================== 080028b4 : * * Called by BSP startup code to initialize the libio subsystem. */ void rtems_libio_init( void ) { 80028b4: 37 9c ff f4 addi sp,sp,-12 80028b8: 5b 8b 00 0c sw (sp+12),r11 80028bc: 5b 8c 00 08 sw (sp+8),r12 80028c0: 5b 9d 00 04 sw (sp+4),ra rtems_status_code rc; uint32_t i; rtems_libio_t *iop; if (rtems_libio_number_iops > 0) 80028c4: 78 01 08 01 mvhi r1,0x801 80028c8: 38 21 90 10 ori r1,r1,0x9010 80028cc: 28 2c 00 00 lw r12,(r1+0) 80028d0: 45 80 00 19 be r12,r0,8002934 <== NEVER TAKEN { rtems_libio_iops = (rtems_libio_t *) calloc(rtems_libio_number_iops, 80028d4: b9 80 08 00 mv r1,r12 80028d8: 34 02 00 40 mvi r2,64 80028dc: fb ff fe f7 calli 80024b8 80028e0: b8 20 58 00 mv r11,r1 80028e4: 78 01 08 01 mvhi r1,0x801 80028e8: 38 21 97 e8 ori r1,r1,0x97e8 80028ec: 58 2b 00 00 sw (r1+0),r11 sizeof(rtems_libio_t)); if (rtems_libio_iops == NULL) rtems_fatal_error_occurred(RTEMS_NO_MEMORY); 80028f0: 34 01 00 1a mvi r1,26 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) 80028f4: 45 60 00 1b be r11,r0,8002960 rtems_fatal_error_occurred(RTEMS_NO_MEMORY); iop = rtems_libio_iop_freelist = rtems_libio_iops; 80028f8: 78 01 08 01 mvhi r1,0x801 80028fc: 38 21 97 ec ori r1,r1,0x97ec 8002900: 58 2b 00 00 sw (r1+0),r11 for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++) 8002904: 34 02 00 00 mvi r2,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); iop = rtems_libio_iop_freelist = rtems_libio_iops; 8002908: b9 60 08 00 mv r1,r11 for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++) 800290c: e0 00 00 02 bi 8002914 iop->data1 = iop + 1; 8002910: 58 21 ff f8 sw (r1+-8),r1 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++) 8002914: 34 42 00 01 addi r2,r2,1 8002918: 34 21 00 40 addi r1,r1,64 800291c: 55 82 ff fd bgu r12,r2,8002910 iop->data1 = iop + 1; iop->data1 = NULL; 8002920: b9 80 08 00 mv r1,r12 8002924: 34 02 00 06 mvi r2,6 8002928: f8 00 51 6a calli 8016ed0 <__ashlsi3> 800292c: b5 61 08 00 add r1,r11,r1 8002930: 58 20 ff f8 sw (r1+-8),r0 /* * Create the binary semaphore used to provide mutual exclusion * on the IOP Table. */ rc = rtems_semaphore_create( 8002934: 78 02 08 01 mvhi r2,0x801 8002938: 38 42 7f 40 ori r2,r2,0x7f40 800293c: 28 41 00 00 lw r1,(r2+0) 8002940: 78 05 08 01 mvhi r5,0x801 8002944: 34 03 00 54 mvi r3,84 8002948: 34 02 00 01 mvi r2,1 800294c: 34 04 00 00 mvi r4,0 8002950: 38 a5 97 f0 ori r5,r5,0x97f0 8002954: f8 00 05 28 calli 8003df4 8002958: b8 20 18 00 mv r3,r1 1, RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &rtems_libio_semaphore ); if ( rc != RTEMS_SUCCESSFUL ) 800295c: 44 20 00 02 be r1,r0,8002964 <== ALWAYS TAKEN rtems_fatal_error_occurred( rc ); 8002960: f8 00 06 ff calli 800455c /* * Initialize the base file system infrastructure. */ if (rtems_fs_init_helper) 8002964: 78 02 08 01 mvhi r2,0x801 8002968: 38 42 90 0c ori r2,r2,0x900c 800296c: 28 41 00 00 lw r1,(r2+0) 8002970: 44 23 00 02 be r1,r3,8002978 <== NEVER TAKEN (* rtems_fs_init_helper)(); 8002974: d8 20 00 00 call r1 } 8002978: 2b 9d 00 04 lw ra,(sp+4) 800297c: 2b 8b 00 0c lw r11,(sp+12) 8002980: 2b 8c 00 08 lw r12,(sp+8) 8002984: 37 9c 00 0c addi sp,sp,12 8002988: c3 a0 00 00 ret =============================================================================== 08002968 : rtems_status_code rtems_libio_set_private_env(void) { 8002968: 37 9c ff d4 addi sp,sp,-44 800296c: 5b 8b 00 14 sw (sp+20),r11 8002970: 5b 8c 00 10 sw (sp+16),r12 8002974: 5b 8d 00 0c sw (sp+12),r13 8002978: 5b 8e 00 08 sw (sp+8),r14 800297c: 5b 9d 00 04 sw (sp+4),ra rtems_status_code sc; rtems_id task_id; rtems_filesystem_location_info_t loc; sc=rtems_task_ident(RTEMS_SELF,0,&task_id); 8002980: 34 01 00 00 mvi r1,0 8002984: 34 02 00 00 mvi r2,0 8002988: 37 83 00 2c addi r3,sp,44 800298c: f8 00 02 fa calli 8003574 8002990: b8 20 60 00 mv r12,r1 if (sc != RTEMS_SUCCESSFUL) return sc; 8002994: 5c 20 00 48 bne r1,r0,8002ab4 <== NEVER TAKEN /* Only for the first time a malloc is necesary */ if (rtems_current_user_env==&rtems_global_user_env) { 8002998: 78 0b 08 01 mvhi r11,0x801 800299c: 39 6b 41 04 ori r11,r11,0x4104 80029a0: 29 62 00 00 lw r2,(r11+0) 80029a4: 78 01 08 01 mvhi r1,0x801 80029a8: 38 21 47 50 ori r1,r1,0x4750 80029ac: 5c 41 00 11 bne r2,r1,80029f0 rtems_user_env_t *tmp = malloc(sizeof(rtems_user_env_t)); 80029b0: 34 01 00 48 mvi r1,72 80029b4: fb ff fc e9 calli 8001d58 80029b8: b8 20 68 00 mv r13,r1 if (!tmp) 80029bc: 44 20 00 3d be r1,r0,8002ab0 <== NEVER TAKEN #ifdef HAVE_USERENV_REFCNT tmp->refcnt = 1; #endif sc = rtems_task_variable_add( 80029c0: 78 03 08 00 mvhi r3,0x800 80029c4: 34 01 00 00 mvi r1,0 80029c8: b9 60 10 00 mv r2,r11 80029cc: 38 63 29 24 ori r3,r3,0x2924 80029d0: f8 00 03 55 calli 8003724 80029d4: b8 20 70 00 mv r14,r1 RTEMS_SELF, (void*)&rtems_current_user_env, (void(*)(void *))free_user_env ); if (sc != RTEMS_SUCCESSFUL) { 80029d8: 44 20 00 05 be r1,r0,80029ec <== ALWAYS TAKEN /* don't use free_user_env because the pathlocs are * not initialized yet */ free(tmp); 80029dc: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 80029e0: fb ff fb 26 calli 8001678 <== NOT EXECUTED return sc; 80029e4: b9 c0 60 00 mv r12,r14 <== NOT EXECUTED 80029e8: e0 00 00 33 bi 8002ab4 <== NOT EXECUTED } rtems_current_user_env = tmp; 80029ec: 59 6d 00 00 sw (r11+0),r13 } *rtems_current_user_env = rtems_global_user_env; /* get the global values*/ 80029f0: 78 0b 08 01 mvhi r11,0x801 80029f4: 39 6b 41 04 ori r11,r11,0x4104 80029f8: 29 6d 00 00 lw r13,(r11+0) 80029fc: 78 02 08 01 mvhi r2,0x801 8002a00: 38 42 47 50 ori r2,r2,0x4750 8002a04: b9 a0 08 00 mv r1,r13 8002a08: 34 03 00 48 mvi r3,72 8002a0c: f8 00 2a e4 calli 800d59c rtems_current_user_env->task_id=task_id; /* mark the local values*/ 8002a10: 2b 81 00 2c lw r1,(sp+44) * 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); 8002a14: 37 8e 00 18 addi r14,sp,24 8002a18: 34 02 00 01 mvi r2,1 } 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*/ 8002a1c: 59 a1 00 00 sw (r13+0),r1 * 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); 8002a20: 78 0d 08 01 mvhi r13,0x801 8002a24: 39 ad 30 70 ori r13,r13,0x3070 8002a28: 34 03 00 00 mvi r3,0 8002a2c: b9 c0 20 00 mv r4,r14 8002a30: 34 05 00 00 mvi r5,0 8002a34: b9 a0 08 00 mv r1,r13 8002a38: fb ff fa b6 calli 8001510 rtems_filesystem_root = loc; 8002a3c: 29 61 00 00 lw r1,(r11+0) 8002a40: 2b 82 00 18 lw r2,(sp+24) rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 8002a44: 34 03 00 00 mvi r3,0 8002a48: b9 c0 20 00 mv r4,r14 * 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; 8002a4c: 58 22 00 18 sw (r1+24),r2 8002a50: 2b 82 00 1c lw r2,(sp+28) rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 8002a54: 34 05 00 00 mvi r5,0 * 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; 8002a58: 58 22 00 1c sw (r1+28),r2 8002a5c: 2b 82 00 20 lw r2,(sp+32) 8002a60: 58 22 00 20 sw (r1+32),r2 8002a64: 2b 82 00 24 lw r2,(sp+36) 8002a68: 58 22 00 24 sw (r1+36),r2 8002a6c: 2b 82 00 28 lw r2,(sp+40) 8002a70: 58 22 00 28 sw (r1+40),r2 rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 8002a74: 34 02 00 01 mvi r2,1 8002a78: b9 a0 08 00 mv r1,r13 8002a7c: fb ff fa a5 calli 8001510 rtems_filesystem_current = loc; 8002a80: 29 62 00 00 lw r2,(r11+0) 8002a84: 2b 81 00 18 lw r1,(sp+24) 8002a88: 58 41 00 04 sw (r2+4),r1 8002a8c: 2b 81 00 1c lw r1,(sp+28) 8002a90: 58 41 00 08 sw (r2+8),r1 8002a94: 2b 81 00 20 lw r1,(sp+32) 8002a98: 58 41 00 0c sw (r2+12),r1 8002a9c: 2b 81 00 24 lw r1,(sp+36) 8002aa0: 58 41 00 10 sw (r2+16),r1 8002aa4: 2b 81 00 28 lw r1,(sp+40) 8002aa8: 58 41 00 14 sw (r2+20),r1 return RTEMS_SUCCESSFUL; 8002aac: e0 00 00 02 bi 8002ab4 /* 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) return RTEMS_NO_MEMORY; 8002ab0: 34 0c 00 1a mvi r12,26 <== NOT EXECUTED rtems_filesystem_root = loc; rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_current = loc; return RTEMS_SUCCESSFUL; } 8002ab4: b9 80 08 00 mv r1,r12 8002ab8: 2b 9d 00 04 lw ra,(sp+4) 8002abc: 2b 8b 00 14 lw r11,(sp+20) 8002ac0: 2b 8c 00 10 lw r12,(sp+16) 8002ac4: 2b 8d 00 0c lw r13,(sp+12) 8002ac8: 2b 8e 00 08 lw r14,(sp+8) 8002acc: 37 9c 00 2c addi sp,sp,44 8002ad0: c3 a0 00 00 ret =============================================================================== 08002ad4 : * while changing any of those (chdir(), chroot()). */ #ifndef HAVE_USERENV_REFCNT rtems_status_code rtems_libio_share_private_env(rtems_id task_id) { 8002ad4: 37 9c ff ec addi sp,sp,-20 <== NOT EXECUTED 8002ad8: 5b 8b 00 0c sw (sp+12),r11 <== NOT EXECUTED 8002adc: 5b 8c 00 08 sw (sp+8),r12 <== NOT EXECUTED 8002ae0: 5b 9d 00 04 sw (sp+4),ra <== 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); 8002ae4: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 8002ae8: 37 83 00 10 addi r3,sp,16 <== NOT EXECUTED * while changing any of those (chdir(), chroot()). */ #ifndef HAVE_USERENV_REFCNT rtems_status_code rtems_libio_share_private_env(rtems_id task_id) { 8002aec: b8 20 60 00 mv r12,r1 <== 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); 8002af0: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8002af4: f8 00 02 a0 calli 8003574 <== NOT EXECUTED 8002af8: b8 20 18 00 mv r3,r1 <== NOT EXECUTED if (sc != RTEMS_SUCCESSFUL) return sc; 8002afc: 5c 20 00 23 bne r1,r0,8002b88 <== NOT EXECUTED if (rtems_current_user_env->task_id==current_task_id) { 8002b00: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8002b04: 38 42 41 04 ori r2,r2,0x4104 <== NOT EXECUTED 8002b08: 28 4b 00 00 lw r11,(r2+0) <== NOT EXECUTED 8002b0c: 2b 83 00 10 lw r3,(sp+16) <== NOT EXECUTED 8002b10: 29 64 00 00 lw r4,(r11+0) <== NOT EXECUTED 8002b14: 5c 83 00 07 bne r4,r3,8002b30 <== NOT EXECUTED /* 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); 8002b18: f8 00 03 32 calli 80037e0 <== NOT EXECUTED 8002b1c: b8 20 18 00 mv r3,r1 <== NOT EXECUTED if (sc != RTEMS_SUCCESSFUL) return sc; 8002b20: 5c 20 00 1a bne r1,r0,8002b88 <== NOT EXECUTED free_user_env(tmp); 8002b24: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8002b28: fb ff ff 7f calli 8002924 <== NOT EXECUTED 8002b2c: e0 00 00 06 bi 8002b44 <== NOT EXECUTED } else { sc = rtems_task_variable_get( 8002b30: 37 83 00 14 addi r3,sp,20 <== NOT EXECUTED 8002b34: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8002b38: f8 00 03 4d calli 800386c <== NOT EXECUTED 8002b3c: b8 20 18 00 mv r3,r1 <== NOT EXECUTED task_id,(void*)&rtems_current_user_env, (void*)&shared_user_env ); if (sc != RTEMS_SUCCESSFUL) 8002b40: 5c 20 00 0d bne r1,r0,8002b74 <== NOT EXECUTED goto bailout; } /* AT THIS POINT, rtems_current_user_env is DANGLING */ sc = rtems_task_variable_add( 8002b44: 78 0b 08 01 mvhi r11,0x801 <== NOT EXECUTED 8002b48: 39 6b 41 04 ori r11,r11,0x4104 <== NOT EXECUTED 8002b4c: 78 03 08 00 mvhi r3,0x800 <== NOT EXECUTED 8002b50: 38 63 29 24 ori r3,r3,0x2924 <== NOT EXECUTED 8002b54: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8002b58: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8002b5c: f8 00 02 f2 calli 8003724 <== NOT EXECUTED 8002b60: b8 20 18 00 mv r3,r1 <== NOT EXECUTED RTEMS_SELF,(void*)&rtems_current_user_env,free_user_env); if (sc != RTEMS_SUCCESSFUL) 8002b64: 5c 20 00 04 bne r1,r0,8002b74 <== NOT EXECUTED goto bailout; /* the current_user_env is the same pointer that remote env */ rtems_current_user_env = shared_user_env; 8002b68: 2b 81 00 14 lw r1,(sp+20) <== NOT EXECUTED 8002b6c: 59 61 00 00 sw (r11+0),r1 <== NOT EXECUTED /* increase the reference count */ #ifdef HAVE_USERENV_REFCNT rtems_current_user_env->refcnt++; #endif return RTEMS_SUCCESSFUL; 8002b70: e0 00 00 06 bi 8002b88 <== NOT EXECUTED bailout: /* fallback to the global env */ rtems_current_user_env = &rtems_global_user_env; 8002b74: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8002b78: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8002b7c: 38 21 41 04 ori r1,r1,0x4104 <== NOT EXECUTED 8002b80: 38 42 47 50 ori r2,r2,0x4750 <== NOT EXECUTED 8002b84: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED return sc; } 8002b88: b8 60 08 00 mv r1,r3 <== NOT EXECUTED 8002b8c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8002b90: 2b 8b 00 0c lw r11,(sp+12) <== NOT EXECUTED 8002b94: 2b 8c 00 08 lw r12,(sp+8) <== NOT EXECUTED 8002b98: 37 9c 00 14 addi sp,sp,20 <== NOT EXECUTED 8002b9c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 0800c564 : uint32_t flags ) { uint32_t fcntl_flags = 0; if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) { 800c564: 20 24 00 06 andi r4,r1,0x6 800c568: 34 03 00 06 mvi r3,6 fcntl_flags |= O_RDWR; 800c56c: 34 02 00 02 mvi r2,2 uint32_t flags ) { uint32_t fcntl_flags = 0; if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) { 800c570: 44 83 00 06 be r4,r3,800c588 <== NEVER TAKEN fcntl_flags |= O_RDWR; } else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) { 800c574: 20 23 00 02 andi r3,r1,0x2 fcntl_flags |= O_RDONLY; 800c578: 34 02 00 00 mvi r2,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) { 800c57c: 5c 60 00 03 bne r3,r0,800c588 <== ALWAYS TAKEN fcntl_flags |= O_RDONLY; } else if ( (flags & LIBIO_FLAGS_WRITE) == LIBIO_FLAGS_WRITE) { 800c580: 20 22 00 04 andi r2,r1,0x4 <== NOT EXECUTED ) { uint32_t fcntl_flags = 0; if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) { fcntl_flags |= O_RDWR; 800c584: 7c 42 00 00 cmpnei r2,r2,0 <== NOT EXECUTED fcntl_flags |= O_RDONLY; } else if ( (flags & LIBIO_FLAGS_WRITE) == LIBIO_FLAGS_WRITE) { fcntl_flags |= O_WRONLY; } if ( (flags & LIBIO_FLAGS_NO_DELAY) == LIBIO_FLAGS_NO_DELAY ) { 800c588: 20 23 00 01 andi r3,r1,0x1 800c58c: 44 60 00 02 be r3,r0,800c594 fcntl_flags |= O_NONBLOCK; 800c590: 38 42 40 00 ori r2,r2,0x4000 } if ( (flags & LIBIO_FLAGS_APPEND) == LIBIO_FLAGS_APPEND ) { 800c594: 20 23 02 00 andi r3,r1,0x200 800c598: 44 60 00 02 be r3,r0,800c5a0 fcntl_flags |= O_APPEND; 800c59c: 38 42 00 08 ori r2,r2,0x8 } if ( (flags & LIBIO_FLAGS_CREATE) == LIBIO_FLAGS_CREATE ) { 800c5a0: 20 21 04 00 andi r1,r1,0x400 800c5a4: 44 20 00 02 be r1,r0,800c5ac fcntl_flags |= O_CREAT; 800c5a8: 38 42 02 00 ori r2,r2,0x200 } return fcntl_flags; } 800c5ac: b8 40 08 00 mv r1,r2 800c5b0: c3 a0 00 00 ret =============================================================================== 08005e8c : * size and thus we skip updating the statistics. */ static void rtems_malloc_statistics_at_free( void *pointer ) { 8005e8c: 37 9c ff f8 addi sp,sp,-8 8005e90: 5b 9d 00 04 sw (sp+4),ra uintptr_t size; if (_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, pointer, &size) ) { 8005e94: 78 03 08 02 mvhi r3,0x802 8005e98: 38 63 50 1c ori r3,r3,0x501c * size and thus we skip updating the statistics. */ static void rtems_malloc_statistics_at_free( void *pointer ) { 8005e9c: b8 20 10 00 mv r2,r1 uintptr_t size; if (_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, pointer, &size) ) { 8005ea0: 28 61 00 00 lw r1,(r3+0) 8005ea4: 37 83 00 08 addi r3,sp,8 8005ea8: f8 00 12 00 calli 800a6a8 <_Protected_heap_Get_block_size> 8005eac: 44 20 00 0b be r1,r0,8005ed8 <== NEVER TAKEN MSBUMP(lifetime_freed, size); 8005eb0: 78 01 08 02 mvhi r1,0x802 8005eb4: 38 21 60 58 ori r1,r1,0x6058 8005eb8: 2b 83 00 08 lw r3,(sp+8) 8005ebc: 28 22 00 2c lw r2,(r1+44) 8005ec0: 28 24 00 28 lw r4,(r1+40) 8005ec4: b4 62 10 00 add r2,r3,r2 8005ec8: f4 62 18 00 cmpgu r3,r3,r2 8005ecc: 58 22 00 2c sw (r1+44),r2 8005ed0: b4 64 18 00 add r3,r3,r4 8005ed4: 58 23 00 28 sw (r1+40),r3 } } 8005ed8: 2b 9d 00 04 lw ra,(sp+4) 8005edc: 37 9c 00 08 addi sp,sp,8 8005ee0: c3 a0 00 00 ret =============================================================================== 08005ee4 : } static void rtems_malloc_statistics_at_malloc( void *pointer ) { 8005ee4: 37 9c ff f8 addi sp,sp,-8 8005ee8: 5b 9d 00 04 sw (sp+4),ra uintptr_t actual_size = 0; 8005eec: 5b 80 00 08 sw (sp+8),r0 } static void rtems_malloc_statistics_at_malloc( void *pointer ) { 8005ef0: b8 20 10 00 mv r2,r1 uintptr_t actual_size = 0; uint32_t current_depth; rtems_malloc_statistics_t *s = &rtems_malloc_statistics; if ( !pointer ) 8005ef4: 44 20 00 15 be r1,r0,8005f48 <== NEVER TAKEN return; _Protected_heap_Get_block_size(RTEMS_Malloc_Heap, pointer, &actual_size); 8005ef8: 78 03 08 02 mvhi r3,0x802 8005efc: 38 63 50 1c ori r3,r3,0x501c 8005f00: 28 61 00 00 lw r1,(r3+0) 8005f04: 37 83 00 08 addi r3,sp,8 8005f08: f8 00 11 e8 calli 800a6a8 <_Protected_heap_Get_block_size> MSBUMP(lifetime_allocated, actual_size); 8005f0c: 78 01 08 02 mvhi r1,0x802 8005f10: 38 21 60 58 ori r1,r1,0x6058 8005f14: 2b 83 00 08 lw r3,(sp+8) 8005f18: 28 22 00 24 lw r2,(r1+36) 8005f1c: 28 24 00 20 lw r4,(r1+32) 8005f20: b4 62 10 00 add r2,r3,r2 8005f24: f4 62 18 00 cmpgu r3,r3,r2 8005f28: 58 22 00 24 sw (r1+36),r2 8005f2c: b4 64 18 00 add r3,r3,r4 8005f30: 58 23 00 20 sw (r1+32),r3 current_depth = (uint32_t) (s->lifetime_allocated - s->lifetime_freed); 8005f34: 28 23 00 2c lw r3,(r1+44) 8005f38: c8 43 10 00 sub r2,r2,r3 if (current_depth > s->max_depth) 8005f3c: 28 23 00 18 lw r3,(r1+24) 8005f40: 50 62 00 02 bgeu r3,r2,8005f48 s->max_depth = current_depth; 8005f44: 58 22 00 18 sw (r1+24),r2 } 8005f48: 2b 9d 00 04 lw ra,(sp+4) 8005f4c: 37 9c 00 08 addi sp,sp,8 8005f50: c3 a0 00 00 ret =============================================================================== 0800caac : int rtems_memalign( void **pointer, size_t alignment, size_t size ) { 800caac: 37 9c ff ec addi sp,sp,-20 800cab0: 5b 8b 00 14 sw (sp+20),r11 800cab4: 5b 8c 00 10 sw (sp+16),r12 800cab8: 5b 8d 00 0c sw (sp+12),r13 800cabc: 5b 8e 00 08 sw (sp+8),r14 800cac0: 5b 9d 00 04 sw (sp+4),ra /* * Parameter error checks */ if ( !pointer ) return EINVAL; 800cac4: 34 0c 00 16 mvi r12,22 int rtems_memalign( void **pointer, size_t alignment, size_t size ) { 800cac8: b8 20 58 00 mv r11,r1 800cacc: b8 40 68 00 mv r13,r2 800cad0: b8 60 70 00 mv r14,r3 void *return_this; /* * Parameter error checks */ if ( !pointer ) 800cad4: 44 20 00 1d be r1,r0,800cb48 return EINVAL; *pointer = NULL; 800cad8: 58 20 00 00 sw (r1+0),r0 /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 800cadc: 78 01 08 01 mvhi r1,0x801 800cae0: 38 21 9a a4 ori r1,r1,0x9aa4 800cae4: 28 22 00 00 lw r2,(r1+0) 800cae8: 34 01 00 03 mvi r1,3 800caec: 5c 41 00 03 bne r2,r1,800caf8 <== NEVER TAKEN !malloc_is_system_state_OK() ) 800caf0: fb ff d7 a7 calli 800298c *pointer = NULL; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 800caf4: 44 20 00 15 be r1,r0,800cb48 <== NEVER TAKEN return EINVAL; /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); 800caf8: fb ff d7 b7 calli 80029d4 Heap_Control *heap, uintptr_t size, uintptr_t alignment ) { return 800cafc: 78 01 08 01 mvhi r1,0x801 800cb00: 38 21 90 1c ori r1,r1,0x901c 800cb04: 28 21 00 00 lw r1,(r1+0) 800cb08: b9 a0 18 00 mv r3,r13 800cb0c: b9 c0 10 00 mv r2,r14 800cb10: 34 04 00 00 mvi r4,0 800cb14: fb ff e5 1e calli 8005f8c <_Protected_heap_Allocate_aligned_with_boundary> 800cb18: b8 20 68 00 mv r13,r1 RTEMS_Malloc_Heap, size, alignment ); if ( !return_this ) return ENOMEM; 800cb1c: 34 0c 00 0c mvi r12,12 return_this = _Protected_heap_Allocate_aligned( RTEMS_Malloc_Heap, size, alignment ); if ( !return_this ) 800cb20: 44 20 00 0a be r1,r0,800cb48 return ENOMEM; /* * If configured, update the more involved statistics */ if ( rtems_malloc_statistics_helpers ) 800cb24: 78 02 08 01 mvhi r2,0x801 800cb28: 38 42 96 80 ori r2,r2,0x9680 800cb2c: 28 41 00 00 lw r1,(r2+0) 800cb30: 44 20 00 04 be r1,r0,800cb40 (*rtems_malloc_statistics_helpers->at_malloc)(pointer); 800cb34: 28 22 00 04 lw r2,(r1+4) 800cb38: b9 60 08 00 mv r1,r11 800cb3c: d8 40 00 00 call r2 *pointer = return_this; 800cb40: 59 6d 00 00 sw (r11+0),r13 return 0; 800cb44: 34 0c 00 00 mvi r12,0 } 800cb48: b9 80 08 00 mv r1,r12 800cb4c: 2b 9d 00 04 lw ra,(sp+4) 800cb50: 2b 8b 00 14 lw r11,(sp+20) 800cb54: 2b 8c 00 10 lw r12,(sp+16) 800cb58: 2b 8d 00 0c lw r13,(sp+12) 800cb5c: 2b 8e 00 08 lw r14,(sp+8) 800cb60: 37 9c 00 14 addi sp,sp,20 800cb64: c3 a0 00 00 ret =============================================================================== 0800ac20 : return (retval); } int rtems_mkdir(const char *path, mode_t mode) { 800ac20: 37 9c ff 84 addi sp,sp,-124 800ac24: 5b 8b 00 34 sw (sp+52),r11 800ac28: 5b 8c 00 30 sw (sp+48),r12 800ac2c: 5b 8d 00 2c sw (sp+44),r13 800ac30: 5b 8e 00 28 sw (sp+40),r14 800ac34: 5b 8f 00 24 sw (sp+36),r15 800ac38: 5b 90 00 20 sw (sp+32),r16 800ac3c: 5b 91 00 1c sw (sp+28),r17 800ac40: 5b 92 00 18 sw (sp+24),r18 800ac44: 5b 93 00 14 sw (sp+20),r19 800ac48: 5b 94 00 10 sw (sp+16),r20 800ac4c: 5b 95 00 0c sw (sp+12),r21 800ac50: 5b 96 00 08 sw (sp+8),r22 800ac54: 5b 9d 00 04 sw (sp+4),ra 800ac58: b8 40 b0 00 mv r22,r2 int success = 0; char *dup_path = strdup(path); 800ac5c: f8 00 12 e0 calli 800f7dc 800ac60: b8 20 60 00 mv r12,r1 if (dup_path != NULL) { success = build(dup_path, mode); free(dup_path); } return success != 0 ? 0 : -1; 800ac64: 34 01 ff ff mvi r1,-1 rtems_mkdir(const char *path, mode_t mode) { int success = 0; char *dup_path = strdup(path); if (dup_path != NULL) { 800ac68: 45 80 00 4d be r12,r0,800ad9c <== NEVER TAKEN char *p; p = path; oumask = 0; retval = 1; if (p[0] == '/') /* Skip leading '/'. */ 800ac6c: 41 8b 00 00 lbu r11,(r12+0) 800ac70: 34 0e 00 00 mvi r14,0 800ac74: 34 01 00 01 mvi r1,1 ++p; 800ac78: 65 6b 00 2f cmpei r11,r11,47 retval = 0; break; } } if (!last) *p = '/'; 800ac7c: 34 15 00 2f mvi r21,47 p = path; oumask = 0; retval = 1; if (p[0] == '/') /* Skip leading '/'. */ ++p; 800ac80: b5 8b 58 00 add r11,r12,r11 first = 0; } if (last) (void)umask(oumask); if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) { if (errno == EEXIST || errno == EISDIR) { 800ac84: 34 14 00 11 mvi r20,17 if (stat(path, &sb) < 0) { 800ac88: 37 93 00 38 addi r19,sp,56 retval = 0; break; } else if (!S_ISDIR(sb.st_mode)) { 800ac8c: 34 12 40 00 mvi r18,16384 first = 0; } if (last) (void)umask(oumask); if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) { if (errno == EEXIST || errno == EISDIR) { 800ac90: 34 11 00 15 mvi r17,21 * * We change the user's umask and then restore it, * instead of doing chmod's. */ oumask = umask(0); numask = oumask & ~(S_IWUSR | S_IXUSR); 800ac94: 34 10 ff 3f mvi r16,-193 if (p[0] == '/') /* Skip leading '/'. */ ++p; for (first = 1, last = 0; !last ; ++p) { if (p[0] == '\0') last = 1; else if (p[0] != '/') 800ac98: 34 0f 00 2f mvi r15,47 oumask = 0; retval = 1; if (p[0] == '/') /* Skip leading '/'. */ ++p; for (first = 1, last = 0; !last ; ++p) { if (p[0] == '\0') 800ac9c: 41 64 00 00 lbu r4,(r11+0) last = 1; 800aca0: 34 03 00 01 mvi r3,1 oumask = 0; retval = 1; if (p[0] == '/') /* Skip leading '/'. */ ++p; for (first = 1, last = 0; !last ; ++p) { if (p[0] == '\0') 800aca4: 44 80 00 03 be r4,r0,800acb0 last = 1; else if (p[0] != '/') 800aca8: 5c 8f 00 33 bne r4,r15,800ad74 800acac: 34 03 00 00 mvi r3,0 continue; *p = '\0'; 800acb0: 31 60 00 00 sb (r11+0),r0 if (!last && p[1] == '\0') 800acb4: 34 0d 00 01 mvi r13,1 800acb8: 5c 60 00 03 bne r3,r0,800acc4 800acbc: 41 6d 00 01 lbu r13,(r11+1) 800acc0: 65 ad 00 00 cmpei r13,r13,0 last = 1; if (first) { 800acc4: 44 20 00 06 be r1,r0,800acdc * mkdir [-m mode] dir * * We change the user's umask and then restore it, * instead of doing chmod's. */ oumask = umask(0); 800acc8: 34 01 00 00 mvi r1,0 800accc: f8 00 00 79 calli 800aeb0 800acd0: b8 20 70 00 mv r14,r1 numask = oumask & ~(S_IWUSR | S_IXUSR); (void)umask(numask); 800acd4: a0 30 08 00 and r1,r1,r16 800acd8: f8 00 00 76 calli 800aeb0 first = 0; } if (last) (void)umask(oumask); if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) { 800acdc: 34 03 01 ff mvi r3,511 oumask = umask(0); numask = oumask & ~(S_IWUSR | S_IXUSR); (void)umask(numask); first = 0; } if (last) 800ace0: 45 a0 00 04 be r13,r0,800acf0 (void)umask(oumask); 800ace4: b9 c0 08 00 mv r1,r14 800ace8: f8 00 00 72 calli 800aeb0 if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) { 800acec: ba c0 18 00 mv r3,r22 800acf0: b9 80 08 00 mv r1,r12 800acf4: b8 60 10 00 mv r2,r3 800acf8: fb ff e1 0e calli 8003130 800acfc: 4c 20 00 1b bge r1,r0,800ad68 if (errno == EEXIST || errno == EISDIR) { 800ad00: f8 00 0e 2e calli 800e5b8 <__errno> 800ad04: 28 21 00 00 lw r1,(r1+0) 800ad08: 44 34 00 04 be r1,r20,800ad18 <== ALWAYS TAKEN 800ad0c: f8 00 0e 2b calli 800e5b8 <__errno> <== NOT EXECUTED 800ad10: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED 800ad14: 5c 31 00 1a bne r1,r17,800ad7c <== NOT EXECUTED if (stat(path, &sb) < 0) { 800ad18: b9 80 08 00 mv r1,r12 800ad1c: ba 60 10 00 mv r2,r19 800ad20: f8 00 00 32 calli 800ade8 800ad24: 48 01 00 16 bg r0,r1,800ad7c <== NEVER TAKEN retval = 0; break; } else if (!S_ISDIR(sb.st_mode)) { 800ad28: 2b 81 00 44 lw r1,(sp+68) 800ad2c: 20 21 f0 00 andi r1,r1,0xf000 800ad30: 44 32 00 0c be r1,r18,800ad60 if (last) 800ad34: 45 a0 00 06 be r13,r0,800ad4c <== NEVER TAKEN errno = EEXIST; 800ad38: f8 00 0e 20 calli 800e5b8 <__errno> 800ad3c: 34 02 00 11 mvi r2,17 800ad40: 58 22 00 00 sw (r1+0),r2 else errno = ENOTDIR; retval = 0; 800ad44: 34 0b 00 00 mvi r11,0 800ad48: e0 00 00 11 bi 800ad8c break; } else if (!S_ISDIR(sb.st_mode)) { if (last) errno = EEXIST; else errno = ENOTDIR; 800ad4c: f8 00 0e 1b calli 800e5b8 <__errno> <== NOT EXECUTED 800ad50: 34 02 00 14 mvi r2,20 <== NOT EXECUTED 800ad54: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED retval = 0; 800ad58: 34 0b 00 00 mvi r11,0 <== NOT EXECUTED 800ad5c: e0 00 00 0a bi 800ad84 <== NOT EXECUTED break; } if (last) 800ad60: 5d a0 00 1e bne r13,r0,800add8 800ad64: e0 00 00 02 bi 800ad6c } else { retval = 0; break; } } if (!last) 800ad68: 5d a0 00 1e bne r13,r0,800ade0 *p = '/'; 800ad6c: 31 75 00 00 sb (r11+0),r21 800ad70: 34 01 00 00 mvi r1,0 p = path; oumask = 0; retval = 1; if (p[0] == '/') /* Skip leading '/'. */ ++p; for (first = 1, last = 0; !last ; ++p) { 800ad74: 35 6b 00 01 addi r11,r11,1 800ad78: e3 ff ff c9 bi 800ac9c 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) { retval = 0; 800ad7c: 34 0b 00 00 mvi r11,0 <== NOT EXECUTED } } if (!last) *p = '/'; } if (!first && !last) 800ad80: 5d a0 00 03 bne r13,r0,800ad8c <== NOT EXECUTED (void)umask(oumask); 800ad84: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 800ad88: f8 00 00 4a calli 800aeb0 <== NOT EXECUTED int success = 0; char *dup_path = strdup(path); if (dup_path != NULL) { success = build(dup_path, mode); free(dup_path); 800ad8c: b9 80 08 00 mv r1,r12 800ad90: fb ff de e7 calli 800292c } return success != 0 ? 0 : -1; 800ad94: 7d 61 00 00 cmpnei r1,r11,0 800ad98: 34 21 ff ff addi r1,r1,-1 } 800ad9c: 2b 9d 00 04 lw ra,(sp+4) 800ada0: 2b 8b 00 34 lw r11,(sp+52) 800ada4: 2b 8c 00 30 lw r12,(sp+48) 800ada8: 2b 8d 00 2c lw r13,(sp+44) 800adac: 2b 8e 00 28 lw r14,(sp+40) 800adb0: 2b 8f 00 24 lw r15,(sp+36) 800adb4: 2b 90 00 20 lw r16,(sp+32) 800adb8: 2b 91 00 1c lw r17,(sp+28) 800adbc: 2b 92 00 18 lw r18,(sp+24) 800adc0: 2b 93 00 14 lw r19,(sp+20) 800adc4: 2b 94 00 10 lw r20,(sp+16) 800adc8: 2b 95 00 0c lw r21,(sp+12) 800adcc: 2b 96 00 08 lw r22,(sp+8) 800add0: 37 9c 00 7c addi sp,sp,124 800add4: c3 a0 00 00 ret errno = ENOTDIR; retval = 0; break; } if (last) retval = 2; 800add8: 34 0b 00 02 mvi r11,2 800addc: e3 ff ff ec bi 800ad8c } else { retval = 0; break; } } if (!last) 800ade0: 34 0b 00 01 mvi r11,1 800ade4: e3 ff ff ea bi 800ad8c =============================================================================== 08011a64 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 8011a64: 37 9c ff d8 addi sp,sp,-40 8011a68: 5b 8b 00 28 sw (sp+40),r11 8011a6c: 5b 8c 00 24 sw (sp+36),r12 8011a70: 5b 8d 00 20 sw (sp+32),r13 8011a74: 5b 8e 00 1c sw (sp+28),r14 8011a78: 5b 8f 00 18 sw (sp+24),r15 8011a7c: 5b 90 00 14 sw (sp+20),r16 8011a80: 5b 91 00 10 sw (sp+16),r17 8011a84: 5b 92 00 0c sw (sp+12),r18 8011a88: 5b 93 00 08 sw (sp+8),r19 8011a8c: 5b 9d 00 04 sw (sp+4),ra register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; 8011a90: 34 07 00 03 mvi r7,3 uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 8011a94: b8 20 88 00 mv r17,r1 8011a98: b8 40 70 00 mv r14,r2 8011a9c: b8 60 78 00 mv r15,r3 8011aa0: b8 80 60 00 mv r12,r4 8011aa4: b8 a0 98 00 mv r19,r5 8011aa8: b8 c0 80 00 mv r16,r6 register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 8011aac: 44 20 00 36 be r1,r0,8011b84 return RTEMS_INVALID_NAME; if ( !starting_address ) return RTEMS_INVALID_ADDRESS; 8011ab0: 34 07 00 09 mvi r7,9 register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !starting_address ) 8011ab4: 44 40 00 34 be r2,r0,8011b84 return RTEMS_INVALID_ADDRESS; if ( !id ) 8011ab8: 44 c0 00 33 be r6,r0,8011b84 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 8011abc: 64 82 00 00 cmpei r2,r4,0 8011ac0: 64 61 00 00 cmpei r1,r3,0 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; 8011ac4: 34 07 00 08 mvi r7,8 return RTEMS_INVALID_ADDRESS; if ( !id ) return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 8011ac8: b8 41 08 00 or r1,r2,r1 8011acc: 5c 20 00 2e bne r1,r0,8011b84 8011ad0: 54 83 00 2d bgu r4,r3,8011b84 */ RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_size_aligned ( uint32_t buffer_size ) { return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0); 8011ad4: 20 81 00 07 andi r1,r4,0x7 8011ad8: 5c 20 00 2b bne r1,r0,8011b84 ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 8011adc: 21 d2 00 07 andi r18,r14,0x7 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) return RTEMS_INVALID_ADDRESS; 8011ae0: 34 07 00 09 mvi r7,9 if ( length == 0 || buffer_size == 0 || length < buffer_size || !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 8011ae4: 5e 41 00 28 bne r18,r1,8011b84 8011ae8: 78 02 08 04 mvhi r2,0x804 8011aec: 38 42 0c a4 ori r2,r2,0xca4 8011af0: 28 41 00 00 lw r1,(r2+0) 8011af4: 34 21 00 01 addi r1,r1,1 8011af8: 58 41 00 00 sw (r2+0),r1 * This function allocates a partition control block from * the inactive chain of free partition control blocks. */ RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Allocate ( void ) { return (Partition_Control *) _Objects_Allocate( &_Partition_Information ); 8011afc: 78 0d 08 04 mvhi r13,0x804 8011b00: 39 ad 0a f8 ori r13,r13,0xaf8 8011b04: b9 a0 08 00 mv r1,r13 8011b08: f8 00 16 17 calli 8017364 <_Objects_Allocate> 8011b0c: b8 20 58 00 mv r11,r1 _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 8011b10: 5c 32 00 04 bne r1,r18,8011b20 _Thread_Enable_dispatch(); 8011b14: f8 00 1a 98 calli 8018574 <_Thread_Enable_dispatch> return RTEMS_TOO_MANY; 8011b18: 34 07 00 05 mvi r7,5 8011b1c: e0 00 00 1a bi 8011b84 } #endif the_partition->starting_address = starting_address; the_partition->length = length; the_partition->buffer_size = buffer_size; 8011b20: 58 2c 00 18 sw (r1+24),r12 the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, length / buffer_size, buffer_size ); 8011b24: b9 80 10 00 mv r2,r12 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 8011b28: 58 2e 00 10 sw (r1+16),r14 the_partition->length = length; 8011b2c: 58 2f 00 14 sw (r1+20),r15 the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; 8011b30: 58 33 00 1c sw (r1+28),r19 the_partition->number_of_used_blocks = 0; 8011b34: 58 20 00 20 sw (r1+32),r0 _Chain_Initialize( &the_partition->Memory, starting_address, 8011b38: 34 32 00 24 addi r18,r1,36 length / buffer_size, buffer_size ); 8011b3c: b9 e0 08 00 mv r1,r15 8011b40: f8 00 7d 80 calli 8031140 <__udivsi3> 8011b44: b8 20 18 00 mv r3,r1 the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 8011b48: b9 80 20 00 mv r4,r12 8011b4c: ba 40 08 00 mv r1,r18 8011b50: b9 c0 10 00 mv r2,r14 8011b54: f8 00 0f 02 calli 801575c <_Chain_Initialize> Objects_Name name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 8011b58: 29 6c 00 08 lw r12,(r11+8) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8011b5c: 29 ad 00 1c lw r13,(r13+28) 8011b60: 34 02 00 02 mvi r2,2 8011b64: 21 81 ff ff andi r1,r12,0xffff 8011b68: fb ff f0 ee calli 800df20 <__ashlsi3> 8011b6c: b5 a1 08 00 add r1,r13,r1 8011b70: 58 2b 00 00 sw (r1+0),r11 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 8011b74: 59 71 00 0c sw (r11+12),r17 &_Partition_Information, &the_partition->Object, (Objects_Name) name ); *id = the_partition->Object.id; 8011b78: 5a 0c 00 00 sw (r16+0),r12 name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 8011b7c: f8 00 1a 7e calli 8018574 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8011b80: 34 07 00 00 mvi r7,0 } 8011b84: b8 e0 08 00 mv r1,r7 8011b88: 2b 9d 00 04 lw ra,(sp+4) 8011b8c: 2b 8b 00 28 lw r11,(sp+40) 8011b90: 2b 8c 00 24 lw r12,(sp+36) 8011b94: 2b 8d 00 20 lw r13,(sp+32) 8011b98: 2b 8e 00 1c lw r14,(sp+28) 8011b9c: 2b 8f 00 18 lw r15,(sp+24) 8011ba0: 2b 90 00 14 lw r16,(sp+20) 8011ba4: 2b 91 00 10 lw r17,(sp+16) 8011ba8: 2b 92 00 0c lw r18,(sp+12) 8011bac: 2b 93 00 08 lw r19,(sp+8) 8011bb0: 37 9c 00 28 addi sp,sp,40 8011bb4: c3 a0 00 00 ret =============================================================================== 08001094 : void rtems_print_buffer( const unsigned char *buffer, int length ) { 8001094: 37 9c ff ec addi sp,sp,-20 8001098: 5b 8b 00 14 sw (sp+20),r11 800109c: 5b 8c 00 10 sw (sp+16),r12 80010a0: 5b 8d 00 0c sw (sp+12),r13 80010a4: 5b 8e 00 08 sw (sp+8),r14 80010a8: 5b 9d 00 04 sw (sp+4),ra 80010ac: b8 20 70 00 mv r14,r1 int i, mod, max; if ( !length ) return; 80010b0: 44 40 00 16 be r2,r0,8001108 mod = length % 16; 80010b4: 78 01 08 01 mvhi r1,0x801 80010b8: 38 21 ed e0 ori r1,r1,0xede0 80010bc: 28 2b 00 00 lw r11,(r1+0) 80010c0: a0 4b 58 00 and r11,r2,r11 80010c4: 4d 60 00 05 bge r11,r0,80010d8 <== ALWAYS TAKEN 80010c8: 35 6b ff ff addi r11,r11,-1 <== NOT EXECUTED 80010cc: 34 01 ff f0 mvi r1,-16 <== NOT EXECUTED 80010d0: b9 61 58 00 or r11,r11,r1 <== NOT EXECUTED 80010d4: 35 6b 00 01 addi r11,r11,1 <== NOT EXECUTED max = length - mod; 80010d8: c8 4b 68 00 sub r13,r2,r11 for ( i=0 ; i Dump_Line( &buffer[ i ], 16 ); 80010e4: b5 cc 08 00 add r1,r14,r12 80010e8: 34 02 00 10 mvi r2,16 80010ec: fb ff ff 93 calli 8000f38 mod = length % 16; max = length - mod; for ( i=0 ; i Dump_Line( &buffer[ i ], 16 ); if ( mod ) 80010f8: 45 60 00 04 be r11,r0,8001108 Dump_Line( &buffer[ max ], mod ); 80010fc: b5 cd 08 00 add r1,r14,r13 8001100: b9 60 10 00 mv r2,r11 8001104: fb ff ff 8d calli 8000f38 } 8001108: 2b 9d 00 04 lw ra,(sp+4) 800110c: 2b 8b 00 14 lw r11,(sp+20) 8001110: 2b 8c 00 10 lw r12,(sp+16) 8001114: 2b 8d 00 0c lw r13,(sp+12) 8001118: 2b 8e 00 08 lw r14,(sp+8) 800111c: 37 9c 00 14 addi sp,sp,20 8001120: c3 a0 00 00 ret =============================================================================== 0800b8b4 : rtems_status_code rtems_rate_monotonic_get_statistics( rtems_id id, rtems_rate_monotonic_period_statistics *statistics ) { 800b8b4: 37 9c ff f4 addi sp,sp,-12 800b8b8: 5b 8b 00 08 sw (sp+8),r11 800b8bc: 5b 9d 00 04 sw (sp+4),ra 800b8c0: b8 20 18 00 mv r3,r1 800b8c4: b8 40 58 00 mv r11,r2 Rate_monotonic_Control *the_period; rtems_rate_monotonic_period_statistics *dst; Rate_monotonic_Statistics *src; if ( !statistics ) return RTEMS_INVALID_ADDRESS; 800b8c8: 34 01 00 09 mvi r1,9 Objects_Locations location; Rate_monotonic_Control *the_period; rtems_rate_monotonic_period_statistics *dst; Rate_monotonic_Statistics *src; if ( !statistics ) 800b8cc: 44 40 00 28 be r2,r0,800b96c <== NEVER TAKEN 800b8d0: 78 01 08 02 mvhi r1,0x802 800b8d4: b8 60 10 00 mv r2,r3 800b8d8: 38 21 08 90 ori r1,r1,0x890 800b8dc: 37 83 00 0c addi r3,sp,12 800b8e0: fb ff ec 5a calli 8006a48 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 800b8e4: 2b 82 00 0c lw r2,(sp+12) 800b8e8: 5c 40 00 20 bne r2,r0,800b968 case OBJECTS_LOCAL: dst = statistics; src = &the_period->Statistics; dst->count = src->count; 800b8ec: 28 22 00 54 lw r2,(r1+84) 800b8f0: 59 62 00 00 sw (r11+0),r2 dst->missed_count = src->missed_count; 800b8f4: 28 22 00 58 lw r2,(r1+88) 800b8f8: 59 62 00 04 sw (r11+4),r2 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_To_timespec( &src->min_cpu_time, &dst->min_cpu_time ); 800b8fc: 28 22 00 5c lw r2,(r1+92) 800b900: 59 62 00 08 sw (r11+8),r2 800b904: 28 22 00 60 lw r2,(r1+96) 800b908: 59 62 00 0c sw (r11+12),r2 _Timestamp_To_timespec( &src->max_cpu_time, &dst->max_cpu_time ); 800b90c: 28 22 00 64 lw r2,(r1+100) 800b910: 59 62 00 10 sw (r11+16),r2 800b914: 28 22 00 68 lw r2,(r1+104) 800b918: 59 62 00 14 sw (r11+20),r2 _Timestamp_To_timespec( &src->total_cpu_time, &dst->total_cpu_time ); 800b91c: 28 22 00 6c lw r2,(r1+108) 800b920: 59 62 00 18 sw (r11+24),r2 800b924: 28 22 00 70 lw r2,(r1+112) 800b928: 59 62 00 1c sw (r11+28),r2 _Timestamp_To_timespec( &src->min_wall_time, &dst->min_wall_time ); 800b92c: 28 22 00 74 lw r2,(r1+116) 800b930: 59 62 00 20 sw (r11+32),r2 800b934: 28 22 00 78 lw r2,(r1+120) 800b938: 59 62 00 24 sw (r11+36),r2 _Timestamp_To_timespec( &src->max_wall_time, &dst->max_wall_time ); 800b93c: 28 22 00 7c lw r2,(r1+124) 800b940: 59 62 00 28 sw (r11+40),r2 800b944: 28 22 00 80 lw r2,(r1+128) 800b948: 59 62 00 2c sw (r11+44),r2 _Timestamp_To_timespec( &src->total_wall_time, &dst->total_wall_time ); 800b94c: 28 22 00 84 lw r2,(r1+132) 800b950: 28 21 00 88 lw r1,(r1+136) 800b954: 59 62 00 30 sw (r11+48),r2 800b958: 59 61 00 34 sw (r11+52),r1 dst->min_wall_time = src->min_wall_time; dst->max_wall_time = src->max_wall_time; dst->total_wall_time = src->total_wall_time; #endif _Thread_Enable_dispatch(); 800b95c: fb ff ee ad calli 8007410 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 800b960: 34 01 00 00 mvi r1,0 800b964: e0 00 00 02 bi 800b96c #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 800b968: 34 01 00 04 mvi r1,4 } 800b96c: 2b 9d 00 04 lw ra,(sp+4) 800b970: 2b 8b 00 08 lw r11,(sp+8) 800b974: 37 9c 00 0c addi sp,sp,12 800b978: c3 a0 00 00 ret =============================================================================== 08004158 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 8004158: 37 9c ff e8 addi sp,sp,-24 800415c: 5b 8b 00 14 sw (sp+20),r11 8004160: 5b 8c 00 10 sw (sp+16),r12 8004164: 5b 8d 00 0c sw (sp+12),r13 8004168: 5b 8e 00 08 sw (sp+8),r14 800416c: 5b 9d 00 04 sw (sp+4),ra 8004170: b8 20 70 00 mv r14,r1 Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) _Objects_Get( &_Rate_monotonic_Information, id, location ); 8004174: 78 01 08 02 mvhi r1,0x802 8004178: b8 40 60 00 mv r12,r2 800417c: 38 21 08 90 ori r1,r1,0x890 8004180: b9 c0 10 00 mv r2,r14 8004184: 37 83 00 18 addi r3,sp,24 8004188: f8 00 0a 30 calli 8006a48 <_Objects_Get> 800418c: b8 20 58 00 mv r11,r1 rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 8004190: 2b 81 00 18 lw r1,(sp+24) 8004194: 5c 20 00 5f bne r1,r0,8004310 RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 8004198: 78 03 08 02 mvhi r3,0x802 800419c: 38 63 0e 94 ori r3,r3,0xe94 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 80041a0: 29 62 00 40 lw r2,(r11+64) 80041a4: 28 61 00 0c lw r1,(r3+12) 80041a8: 44 41 00 04 be r2,r1,80041b8 _Thread_Enable_dispatch(); 80041ac: f8 00 0c 99 calli 8007410 <_Thread_Enable_dispatch> return RTEMS_NOT_OWNER_OF_RESOURCE; 80041b0: 34 0b 00 17 mvi r11,23 80041b4: e0 00 00 58 bi 8004314 } if ( length == RTEMS_PERIOD_STATUS ) { 80041b8: 5d 80 00 0d bne r12,r0,80041ec switch ( the_period->state ) { 80041bc: 29 61 00 38 lw r1,(r11+56) 80041c0: 34 02 00 04 mvi r2,4 80041c4: 34 0b 00 00 mvi r11,0 80041c8: 54 22 00 07 bgu r1,r2,80041e4 <== NEVER TAKEN 80041cc: 78 0b 08 01 mvhi r11,0x801 80041d0: 34 02 00 02 mvi r2,2 80041d4: 39 6b e6 c8 ori r11,r11,0xe6c8 80041d8: fb ff f4 33 calli 80012a4 <__ashlsi3> 80041dc: b5 61 08 00 add r1,r11,r1 80041e0: 28 2b 00 00 lw r11,(r1+0) case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 80041e4: f8 00 0c 8b calli 8007410 <_Thread_Enable_dispatch> return( return_value ); 80041e8: e0 00 00 4b bi 8004314 } _ISR_Disable( level ); 80041ec: 90 00 68 00 rcsr r13,IE 80041f0: 34 01 ff fe mvi r1,-2 80041f4: a1 a1 08 00 and r1,r13,r1 80041f8: d0 01 00 00 wcsr IE,r1 switch ( the_period->state ) { 80041fc: 29 63 00 38 lw r3,(r11+56) 8004200: 34 01 00 02 mvi r1,2 8004204: 44 61 00 16 be r3,r1,800425c 8004208: 34 01 00 04 mvi r1,4 800420c: 44 61 00 33 be r3,r1,80042d8 8004210: 5c 60 00 40 bne r3,r0,8004310 <== NEVER TAKEN case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 8004214: d0 0d 00 00 wcsr IE,r13 /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 8004218: b9 60 08 00 mv r1,r11 800421c: fb ff ff 6a calli 8003fc4 <_Rate_monotonic_Initiate_statistics> the_period->state = RATE_MONOTONIC_ACTIVE; 8004220: 34 01 00 02 mvi r1,2 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 8004224: 78 03 08 00 mvhi r3,0x800 8004228: 59 61 00 38 sw (r11+56),r1 800422c: 38 63 46 98 ori r3,r3,0x4698 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8004230: 78 01 08 02 mvhi r1,0x802 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8004234: 59 60 00 18 sw (r11+24),r0 the_watchdog->routine = routine; 8004238: 59 63 00 2c sw (r11+44),r3 the_watchdog->id = id; 800423c: 59 6e 00 30 sw (r11+48),r14 the_watchdog->user_data = user_data; 8004240: 59 60 00 34 sw (r11+52),r0 _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; 8004244: 59 6c 00 3c sw (r11+60),r12 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8004248: 59 6c 00 1c sw (r11+28),r12 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800424c: 38 21 0a 80 ori r1,r1,0xa80 8004250: 35 62 00 10 addi r2,r11,16 8004254: f8 00 12 6c calli 8008c04 <_Watchdog_Insert> 8004258: e0 00 00 1d bi 80042cc case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 800425c: b9 60 08 00 mv r1,r11 8004260: fb ff ff 7e calli 8004058 <_Rate_monotonic_Update_statistics> /* * This tells the _Rate_monotonic_Timeout that this task is * in the process of blocking on the period and that we * may be changing the length of the next period. */ the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; 8004264: 34 01 00 01 mvi r1,1 8004268: 59 61 00 38 sw (r11+56),r1 the_period->next_length = length; 800426c: 59 6c 00 3c sw (r11+60),r12 _ISR_Enable( level ); 8004270: d0 0d 00 00 wcsr IE,r13 _Thread_Executing->Wait.id = the_period->Object.id; 8004274: 78 01 08 02 mvhi r1,0x802 8004278: 38 21 0e 94 ori r1,r1,0xe94 800427c: 29 62 00 08 lw r2,(r11+8) 8004280: 28 21 00 0c lw r1,(r1+12) 8004284: 58 22 00 20 sw (r1+32),r2 _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 8004288: 34 02 40 00 mvi r2,16384 800428c: f8 00 0f 43 calli 8007f98 <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 8004290: 90 00 08 00 rcsr r1,IE 8004294: 34 02 ff fe mvi r2,-2 8004298: a0 22 10 00 and r2,r1,r2 800429c: d0 02 00 00 wcsr IE,r2 local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 80042a0: 34 03 00 02 mvi r3,2 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 80042a4: 29 62 00 38 lw r2,(r11+56) the_period->state = RATE_MONOTONIC_ACTIVE; 80042a8: 59 63 00 38 sw (r11+56),r3 _ISR_Enable( level ); 80042ac: d0 01 00 00 wcsr IE,r1 /* * If it did, then we want to unblock ourself and continue as * if nothing happen. The period was reset in the timeout routine. */ if ( local_state == RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING ) 80042b0: 34 01 00 03 mvi r1,3 80042b4: 5c 41 00 06 bne r2,r1,80042cc _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 80042b8: 78 01 08 02 mvhi r1,0x802 80042bc: 38 21 0e 94 ori r1,r1,0xe94 80042c0: 28 21 00 0c lw r1,(r1+12) 80042c4: 34 02 40 00 mvi r2,16384 80042c8: f8 00 0b 75 calli 800709c <_Thread_Clear_state> _Thread_Enable_dispatch(); 80042cc: f8 00 0c 51 calli 8007410 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 80042d0: 34 0b 00 00 mvi r11,0 80042d4: e0 00 00 10 bi 8004314 case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 80042d8: b9 60 08 00 mv r1,r11 80042dc: fb ff ff 5f calli 8004058 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 80042e0: d0 0d 00 00 wcsr IE,r13 the_period->state = RATE_MONOTONIC_ACTIVE; 80042e4: 34 01 00 02 mvi r1,2 80042e8: 59 61 00 38 sw (r11+56),r1 80042ec: 78 01 08 02 mvhi r1,0x802 80042f0: 35 62 00 10 addi r2,r11,16 the_period->next_length = length; 80042f4: 59 6c 00 3c sw (r11+60),r12 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 80042f8: 59 6c 00 1c sw (r11+28),r12 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 80042fc: 38 21 0a 80 ori r1,r1,0xa80 8004300: f8 00 12 41 calli 8008c04 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_TIMEOUT; 8004304: 34 0b 00 06 mvi r11,6 the_period->state = RATE_MONOTONIC_ACTIVE; the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 8004308: f8 00 0c 42 calli 8007410 <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 800430c: e0 00 00 02 bi 8004314 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 8004310: 34 0b 00 04 mvi r11,4 } 8004314: b9 60 08 00 mv r1,r11 8004318: 2b 9d 00 04 lw ra,(sp+4) 800431c: 2b 8b 00 14 lw r11,(sp+20) 8004320: 2b 8c 00 10 lw r12,(sp+16) 8004324: 2b 8d 00 0c lw r13,(sp+12) 8004328: 2b 8e 00 08 lw r14,(sp+8) 800432c: 37 9c 00 18 addi sp,sp,24 8004330: c3 a0 00 00 ret =============================================================================== 08004334 : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 8004334: 37 9c ff 5c addi sp,sp,-164 8004338: 5b 8b 00 44 sw (sp+68),r11 800433c: 5b 8c 00 40 sw (sp+64),r12 8004340: 5b 8d 00 3c sw (sp+60),r13 8004344: 5b 8e 00 38 sw (sp+56),r14 8004348: 5b 8f 00 34 sw (sp+52),r15 800434c: 5b 90 00 30 sw (sp+48),r16 8004350: 5b 91 00 2c sw (sp+44),r17 8004354: 5b 92 00 28 sw (sp+40),r18 8004358: 5b 93 00 24 sw (sp+36),r19 800435c: 5b 94 00 20 sw (sp+32),r20 8004360: 5b 95 00 1c sw (sp+28),r21 8004364: 5b 96 00 18 sw (sp+24),r22 8004368: 5b 97 00 14 sw (sp+20),r23 800436c: 5b 98 00 10 sw (sp+16),r24 8004370: 5b 99 00 0c sw (sp+12),r25 8004374: 5b 9b 00 08 sw (sp+8),fp 8004378: 5b 9d 00 04 sw (sp+4),ra 800437c: b8 20 60 00 mv r12,r1 8004380: b8 40 58 00 mv r11,r2 rtems_id id; rtems_rate_monotonic_period_statistics the_stats; rtems_rate_monotonic_period_status the_status; char name[5]; if ( !print ) 8004384: 44 40 00 72 be r2,r0,800454c <== NEVER TAKEN return; (*print)( context, "Period information by period\n" ); 8004388: 78 02 08 01 mvhi r2,0x801 800438c: 38 42 e6 dc ori r2,r2,0xe6dc 8004390: d9 60 00 00 call r11 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 8004394: 78 02 08 01 mvhi r2,0x801 8004398: 38 42 e6 fc ori r2,r2,0xe6fc 800439c: b9 80 08 00 mv r1,r12 80043a0: d9 60 00 00 call r11 (*print)( context, "--- Wall times are in seconds ---\n" ); 80043a4: 78 02 08 01 mvhi r2,0x801 80043a8: 38 42 e7 20 ori r2,r2,0xe720 80043ac: b9 80 08 00 mv r1,r12 80043b0: d9 60 00 00 call r11 Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 80043b4: 78 02 08 01 mvhi r2,0x801 80043b8: 38 42 e7 44 ori r2,r2,0xe744 80043bc: b9 80 08 00 mv r1,r12 80043c0: d9 60 00 00 call r11 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 80043c4: 78 02 08 01 mvhi r2,0x801 80043c8: b9 80 08 00 mv r1,r12 80043cc: 38 42 e7 90 ori r2,r2,0xe790 80043d0: d9 60 00 00 call r11 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 80043d4: 78 01 08 02 mvhi r1,0x802 80043d8: 38 21 08 90 ori r1,r1,0x890 rtems_object_get_name( the_status.owner, sizeof(name), name ); /* * Print part of report line that is not dependent on granularity */ (*print)( context, 80043dc: 78 11 08 01 mvhi r17,0x801 struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); (*print)( context, 80043e0: 78 10 08 01 mvhi r16,0x801 struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); (*print)( context, 80043e4: 78 0f 08 01 mvhi r15,0x801 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 80043e8: 78 0e 08 01 mvhi r14,0x801 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 80043ec: 28 2d 00 08 lw r13,(r1+8) id <= _Rate_monotonic_Information.maximum_id ; 80043f0: b8 20 a0 00 mv r20,r1 id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 80043f4: 37 99 00 48 addi r25,sp,72 if ( status != RTEMS_SUCCESSFUL ) continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 80043f8: 37 98 00 80 addi r24,sp,128 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 80043fc: 37 93 00 a0 addi r19,sp,160 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 8004400: 3a 31 e7 dc ori r17,r17,0xe7dc { #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; 8004404: 37 97 00 60 addi r23,sp,96 _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 8004408: 37 92 00 98 addi r18,sp,152 (*print)( context, 800440c: 3a 10 e7 f4 ori r16,r16,0xe7f4 { #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ struct timespec wall_average; struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; 8004410: 37 96 00 78 addi r22,sp,120 _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); (*print)( context, 8004414: 39 ef e8 14 ori r15,r15,0xe814 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 8004418: 39 ce dd 20 ori r14,r14,0xdd20 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 800441c: e0 00 00 4a bi 8004544 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 8004420: b9 a0 08 00 mv r1,r13 8004424: bb 20 10 00 mv r2,r25 8004428: f8 00 1d 23 calli 800b8b4 800442c: b8 20 a8 00 mv r21,r1 if ( status != RTEMS_SUCCESSFUL ) 8004430: 5c 20 00 44 bne r1,r0,8004540 continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 8004434: bb 00 10 00 mv r2,r24 8004438: b9 a0 08 00 mv r1,r13 800443c: f8 00 1d 50 calli 800b97c #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 8004440: 2b 81 00 80 lw r1,(sp+128) 8004444: 34 02 00 05 mvi r2,5 8004448: ba 60 18 00 mv r3,r19 800444c: f8 00 00 c3 calli 8004758 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 8004450: 2b 85 00 48 lw r5,(sp+72) 8004454: 2b 86 00 4c lw r6,(sp+76) 8004458: ba 20 10 00 mv r2,r17 800445c: b9 80 08 00 mv r1,r12 8004460: b9 a0 18 00 mv r3,r13 8004464: ba 60 20 00 mv r4,r19 8004468: d9 60 00 00 call r11 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 800446c: 2b 82 00 48 lw r2,(sp+72) 8004470: 5c 55 00 05 bne r2,r21,8004484 (*print)( context, "\n" ); 8004474: b9 80 08 00 mv r1,r12 8004478: b9 c0 10 00 mv r2,r14 800447c: d9 60 00 00 call r11 continue; 8004480: e0 00 00 30 bi 8004540 struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 8004484: ba 40 18 00 mv r3,r18 8004488: ba e0 08 00 mv r1,r23 800448c: f8 00 10 94 calli 80086dc <_Timespec_Divide_by_integer> (*print)( context, 8004490: 2b 81 00 54 lw r1,(sp+84) 8004494: 34 02 03 e8 mvi r2,1000 8004498: f8 00 61 1d calli 801c90c <__divsi3> 800449c: b8 20 d8 00 mv fp,r1 80044a0: 2b 81 00 5c lw r1,(sp+92) 80044a4: 34 02 03 e8 mvi r2,1000 80044a8: f8 00 61 19 calli 801c90c <__divsi3> 80044ac: b8 20 a8 00 mv r21,r1 80044b0: 2b 81 00 9c lw r1,(sp+156) 80044b4: 34 02 03 e8 mvi r2,1000 80044b8: f8 00 61 15 calli 801c90c <__divsi3> 80044bc: 2b 85 00 58 lw r5,(sp+88) 80044c0: 2b 87 00 98 lw r7,(sp+152) 80044c4: 2b 83 00 50 lw r3,(sp+80) 80044c8: b8 20 40 00 mv r8,r1 80044cc: bb 60 20 00 mv r4,fp 80044d0: ba a0 30 00 mv r6,r21 80044d4: ba 00 10 00 mv r2,r16 80044d8: b9 80 08 00 mv r1,r12 80044dc: d9 60 00 00 call r11 struct timespec wall_average; struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); 80044e0: 2b 82 00 48 lw r2,(sp+72) 80044e4: ba 40 18 00 mv r3,r18 80044e8: ba c0 08 00 mv r1,r22 80044ec: f8 00 10 7c calli 80086dc <_Timespec_Divide_by_integer> (*print)( context, 80044f0: 2b 81 00 6c lw r1,(sp+108) 80044f4: 34 02 03 e8 mvi r2,1000 80044f8: f8 00 61 05 calli 801c90c <__divsi3> 80044fc: b8 20 d8 00 mv fp,r1 8004500: 2b 81 00 74 lw r1,(sp+116) 8004504: 34 02 03 e8 mvi r2,1000 8004508: f8 00 61 01 calli 801c90c <__divsi3> 800450c: b8 20 a8 00 mv r21,r1 8004510: 2b 81 00 9c lw r1,(sp+156) 8004514: 34 02 03 e8 mvi r2,1000 8004518: f8 00 60 fd calli 801c90c <__divsi3> 800451c: 2b 83 00 68 lw r3,(sp+104) 8004520: 2b 85 00 70 lw r5,(sp+112) 8004524: 2b 87 00 98 lw r7,(sp+152) 8004528: b8 20 40 00 mv r8,r1 800452c: b9 e0 10 00 mv r2,r15 8004530: b9 80 08 00 mv r1,r12 8004534: bb 60 20 00 mv r4,fp 8004538: ba a0 30 00 mv r6,r21 800453c: d9 60 00 00 call r11 * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 8004540: 35 ad 00 01 addi r13,r13,1 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 8004544: 2a 81 00 0c lw r1,(r20+12) 8004548: 50 2d ff b6 bgeu r1,r13,8004420 the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall ); #endif } } } 800454c: 2b 9d 00 04 lw ra,(sp+4) 8004550: 2b 8b 00 44 lw r11,(sp+68) 8004554: 2b 8c 00 40 lw r12,(sp+64) 8004558: 2b 8d 00 3c lw r13,(sp+60) 800455c: 2b 8e 00 38 lw r14,(sp+56) 8004560: 2b 8f 00 34 lw r15,(sp+52) 8004564: 2b 90 00 30 lw r16,(sp+48) 8004568: 2b 91 00 2c lw r17,(sp+44) 800456c: 2b 92 00 28 lw r18,(sp+40) 8004570: 2b 93 00 24 lw r19,(sp+36) 8004574: 2b 94 00 20 lw r20,(sp+32) 8004578: 2b 95 00 1c lw r21,(sp+28) 800457c: 2b 96 00 18 lw r22,(sp+24) 8004580: 2b 97 00 14 lw r23,(sp+20) 8004584: 2b 98 00 10 lw r24,(sp+16) 8004588: 2b 99 00 0c lw r25,(sp+12) 800458c: 2b 9b 00 08 lw fp,(sp+8) 8004590: 37 9c 00 a4 addi sp,sp,164 8004594: c3 a0 00 00 ret =============================================================================== 08003df4 : uint32_t count, rtems_attribute attribute_set, rtems_task_priority priority_ceiling, rtems_id *id ) { 8003df4: 37 9c ff c8 addi sp,sp,-56 8003df8: 5b 8b 00 20 sw (sp+32),r11 8003dfc: 5b 8c 00 1c sw (sp+28),r12 8003e00: 5b 8d 00 18 sw (sp+24),r13 8003e04: 5b 8e 00 14 sw (sp+20),r14 8003e08: 5b 8f 00 10 sw (sp+16),r15 8003e0c: 5b 90 00 0c sw (sp+12),r16 8003e10: 5b 91 00 08 sw (sp+8),r17 8003e14: 5b 9d 00 04 sw (sp+4),ra 8003e18: b8 20 80 00 mv r16,r1 8003e1c: b8 40 70 00 mv r14,r2 8003e20: b8 60 60 00 mv r12,r3 8003e24: b8 80 88 00 mv r17,r4 8003e28: b8 a0 78 00 mv r15,r5 CORE_mutex_Attributes the_mutex_attr; CORE_semaphore_Attributes the_semaphore_attr; CORE_mutex_Status mutex_status; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; 8003e2c: 34 01 00 03 mvi r1,3 register Semaphore_Control *the_semaphore; CORE_mutex_Attributes the_mutex_attr; CORE_semaphore_Attributes the_semaphore_attr; CORE_mutex_Status mutex_status; if ( !rtems_is_name_valid( name ) ) 8003e30: 46 00 00 64 be r16,r0,8003fc0 <== NEVER TAKEN return RTEMS_INVALID_NAME; if ( !id ) return RTEMS_INVALID_ADDRESS; 8003e34: 34 01 00 09 mvi r1,9 CORE_mutex_Status mutex_status; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !id ) 8003e38: 44 a0 00 62 be r5,r0,8003fc0 <== NEVER TAKEN * id - semaphore id * RTEMS_SUCCESSFUL - if successful * error code - if unsuccessful */ rtems_status_code rtems_semaphore_create( 8003e3c: 20 62 00 c0 andi r2,r3,0xc0 return RTEMS_NOT_DEFINED; } else #endif if ( _Attributes_Is_inherit_priority( attribute_set ) || 8003e40: 44 40 00 09 be r2,r0,8003e64 */ RTEMS_INLINE_ROUTINE bool _Attributes_Is_binary_semaphore( rtems_attribute attribute_set ) { return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_BINARY_SEMAPHORE); 8003e44: 20 64 00 30 andi r4,r3,0x30 _Attributes_Is_priority_ceiling( attribute_set ) ) { if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) && 8003e48: 34 03 00 10 mvi r3,16 _Attributes_Is_priority( attribute_set ) ) ) return RTEMS_NOT_DEFINED; 8003e4c: 34 01 00 0b mvi r1,11 #endif if ( _Attributes_Is_inherit_priority( attribute_set ) || _Attributes_Is_priority_ceiling( attribute_set ) ) { if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) && 8003e50: 5c 83 00 5c bne r4,r3,8003fc0 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority( rtems_attribute attribute_set ) { return ( attribute_set & RTEMS_PRIORITY ) ? true : false; 8003e54: 21 83 00 04 andi r3,r12,0x4 8003e58: 44 60 00 5a be r3,r0,8003fc0 <== NEVER TAKEN _Attributes_Is_priority( attribute_set ) ) ) return RTEMS_NOT_DEFINED; } if ( _Attributes_Is_inherit_priority( attribute_set ) && 8003e5c: 34 03 00 c0 mvi r3,192 8003e60: 44 43 00 58 be r2,r3,8003fc0 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE bool _Attributes_Is_counting_semaphore( rtems_attribute attribute_set ) { return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_COUNTING_SEMAPHORE); 8003e64: 21 8d 00 30 andi r13,r12,0x30 _Attributes_Is_priority_ceiling( attribute_set ) ) return RTEMS_NOT_DEFINED; if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) ) 8003e68: 45 a0 00 04 be r13,r0,8003e78 8003e6c: 34 02 00 01 mvi r2,1 return RTEMS_INVALID_NUMBER; 8003e70: 34 01 00 0a mvi r1,10 if ( _Attributes_Is_inherit_priority( attribute_set ) && _Attributes_Is_priority_ceiling( attribute_set ) ) return RTEMS_NOT_DEFINED; if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) ) 8003e74: 55 c2 00 53 bgu r14,r2,8003fc0 <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8003e78: 78 06 08 01 mvhi r6,0x801 8003e7c: 38 c6 99 24 ori r6,r6,0x9924 8003e80: 28 c1 00 00 lw r1,(r6+0) 8003e84: 34 21 00 01 addi r1,r1,1 8003e88: 58 c1 00 00 sw (r6+0),r1 * This function allocates a semaphore control block from * the inactive chain of free semaphore control blocks. */ RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Allocate( void ) { return (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information ); 8003e8c: 78 01 08 01 mvhi r1,0x801 8003e90: 38 21 98 78 ori r1,r1,0x9878 8003e94: f8 00 06 11 calli 80056d8 <_Objects_Allocate> 8003e98: b8 20 58 00 mv r11,r1 _Thread_Disable_dispatch(); /* prevents deletion */ the_semaphore = _Semaphore_Allocate(); if ( !the_semaphore ) { 8003e9c: 5c 20 00 04 bne r1,r0,8003eac _Thread_Enable_dispatch(); 8003ea0: f8 00 09 c1 calli 80065a4 <_Thread_Enable_dispatch> return RTEMS_TOO_MANY; 8003ea4: 34 01 00 05 mvi r1,5 8003ea8: e0 00 00 46 bi 8003fc0 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_semaphore->attribute_set = attribute_set; 8003eac: 58 2c 00 10 sw (r1+16),r12 8003eb0: 21 81 00 04 andi r1,r12,0x4 /* * Initialize it as a counting semaphore. */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { 8003eb4: 5d a0 00 0f bne r13,r0,8003ef0 /* * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; 8003eb8: 34 02 ff ff mvi r2,-1 8003ebc: 5b 82 00 34 sw (sp+52),r2 if ( _Attributes_Is_priority( attribute_set ) ) 8003ec0: 44 2d 00 04 be r1,r13,8003ed0 the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY; 8003ec4: 34 01 00 01 mvi r1,1 8003ec8: 5b 81 00 38 sw (sp+56),r1 8003ecc: e0 00 00 02 bi 8003ed4 else the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; 8003ed0: 5b 80 00 38 sw (sp+56),r0 * The following are just to make Purify happy. */ the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM; _CORE_semaphore_Initialize( 8003ed4: 35 61 00 14 addi r1,r11,20 8003ed8: 37 82 00 34 addi r2,sp,52 8003edc: b9 c0 18 00 mv r3,r14 the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * The following are just to make Purify happy. */ the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; 8003ee0: 5b 80 00 24 sw (sp+36),r0 the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM; 8003ee4: 5b 80 00 30 sw (sp+48),r0 _CORE_semaphore_Initialize( 8003ee8: f8 00 04 32 calli 8004fb0 <_CORE_semaphore_Initialize> 8003eec: e0 00 00 28 bi 8003f8c } else { /* * It is either simple binary semaphore or a more powerful mutex * style binary semaphore. This is the mutex style. */ if ( _Attributes_Is_priority( attribute_set ) ) 8003ef0: 44 20 00 04 be r1,r0,8003f00 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY; 8003ef4: 34 01 00 01 mvi r1,1 8003ef8: 5b 81 00 2c sw (sp+44),r1 8003efc: e0 00 00 02 bi 8003f04 else the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; 8003f00: 5b 80 00 2c sw (sp+44),r0 if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { 8003f04: 34 01 00 10 mvi r1,16 8003f08: 5d a1 00 11 bne r13,r1,8003f4c the_mutex_attr.priority_ceiling = priority_ceiling; the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.only_owner_release = false; if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { 8003f0c: 2b 82 00 2c lw r2,(sp+44) the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY; else the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { the_mutex_attr.priority_ceiling = priority_ceiling; 8003f10: 5b 91 00 30 sw (sp+48),r17 the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; 8003f14: 5b 80 00 24 sw (sp+36),r0 the_mutex_attr.only_owner_release = false; 8003f18: 33 80 00 28 sb (sp+40),r0 if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { 8003f1c: 34 01 00 01 mvi r1,1 8003f20: 5c 41 00 0e bne r2,r1,8003f58 */ RTEMS_INLINE_ROUTINE bool _Attributes_Is_inherit_priority( rtems_attribute attribute_set ) { return ( attribute_set & RTEMS_INHERIT_PRIORITY ) ? true : false; 8003f24: 21 81 00 40 andi r1,r12,0x40 if ( _Attributes_Is_inherit_priority( attribute_set ) ) { 8003f28: 44 20 00 03 be r1,r0,8003f34 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 8003f2c: 34 01 00 02 mvi r1,2 8003f30: e0 00 00 04 bi 8003f40 */ RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority_ceiling( rtems_attribute attribute_set ) { return ( attribute_set & RTEMS_PRIORITY_CEILING ) ? true : false; 8003f34: 21 8c 00 80 andi r12,r12,0x80 the_mutex_attr.only_owner_release = true; } else if ( _Attributes_Is_priority_ceiling( attribute_set ) ) { 8003f38: 45 81 00 08 be r12,r1,8003f58 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; 8003f3c: 34 01 00 03 mvi r1,3 8003f40: 5b 81 00 2c sw (sp+44),r1 the_mutex_attr.only_owner_release = true; 8003f44: 33 82 00 28 sb (sp+40),r2 8003f48: e0 00 00 04 bi 8003f58 } } } else /* must be simple binary semaphore */ { the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_BLOCKS; 8003f4c: 34 01 00 02 mvi r1,2 8003f50: 5b 81 00 24 sw (sp+36),r1 the_mutex_attr.only_owner_release = false; 8003f54: 33 80 00 28 sb (sp+40),r0 } mutex_status = _CORE_mutex_Initialize( 8003f58: 65 c3 00 01 cmpei r3,r14,1 8003f5c: 37 82 00 24 addi r2,sp,36 8003f60: 35 61 00 14 addi r1,r11,20 8003f64: f8 00 03 39 calli 8004c48 <_CORE_mutex_Initialize> &the_semaphore->Core_control.mutex, &the_mutex_attr, (count == 1) ? CORE_MUTEX_UNLOCKED : CORE_MUTEX_LOCKED ); if ( mutex_status == CORE_MUTEX_STATUS_CEILING_VIOLATED ) { 8003f68: 34 02 00 06 mvi r2,6 8003f6c: 5c 22 00 08 bne r1,r2,8003f8c */ RTEMS_INLINE_ROUTINE void _Semaphore_Free ( Semaphore_Control *the_semaphore ) { _Objects_Free( &_Semaphore_Information, &the_semaphore->Object ); 8003f70: 78 01 08 01 mvhi r1,0x801 8003f74: 38 21 98 78 ori r1,r1,0x9878 8003f78: b9 60 10 00 mv r2,r11 8003f7c: f8 00 06 e9 calli 8005b20 <_Objects_Free> _Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 8003f80: f8 00 09 89 calli 80065a4 <_Thread_Enable_dispatch> return RTEMS_INVALID_PRIORITY; 8003f84: 34 01 00 13 mvi r1,19 8003f88: e0 00 00 0e bi 8003fc0 Objects_Name name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 8003f8c: 29 6c 00 08 lw r12,(r11+8) 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 8003f90: 78 02 08 01 mvhi r2,0x801 8003f94: 38 42 98 78 ori r2,r2,0x9878 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8003f98: 28 4d 00 1c lw r13,(r2+28) 8003f9c: 21 81 ff ff andi r1,r12,0xffff 8003fa0: 34 02 00 02 mvi r2,2 8003fa4: f8 00 4b cb calli 8016ed0 <__ashlsi3> 8003fa8: b5 a1 08 00 add r1,r13,r1 8003fac: 58 2b 00 00 sw (r1+0),r11 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 8003fb0: 59 70 00 0c sw (r11+12),r16 &_Semaphore_Information, &the_semaphore->Object, (Objects_Name) name ); *id = the_semaphore->Object.id; 8003fb4: 59 ec 00 00 sw (r15+0),r12 the_semaphore->Object.id, name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 8003fb8: f8 00 09 7b calli 80065a4 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8003fbc: 34 01 00 00 mvi r1,0 } 8003fc0: 2b 9d 00 04 lw ra,(sp+4) 8003fc4: 2b 8b 00 20 lw r11,(sp+32) 8003fc8: 2b 8c 00 1c lw r12,(sp+28) 8003fcc: 2b 8d 00 18 lw r13,(sp+24) 8003fd0: 2b 8e 00 14 lw r14,(sp+20) 8003fd4: 2b 8f 00 10 lw r15,(sp+16) 8003fd8: 2b 90 00 0c lw r16,(sp+12) 8003fdc: 2b 91 00 08 lw r17,(sp+8) 8003fe0: 37 9c 00 38 addi sp,sp,56 8003fe4: c3 a0 00 00 ret =============================================================================== 0801349c : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 801349c: 37 9c ff f4 addi sp,sp,-12 80134a0: 5b 8b 00 08 sw (sp+8),r11 80134a4: 5b 9d 00 04 sw (sp+4),ra Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; 80134a8: 34 03 00 0a mvi r3,10 rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 80134ac: b8 40 58 00 mv r11,r2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 80134b0: 44 40 00 29 be r2,r0,8013554 return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 80134b4: 37 82 00 0c addi r2,sp,12 80134b8: f8 00 14 3c calli 80185a8 <_Thread_Get> switch ( location ) { 80134bc: 2b 82 00 0c lw r2,(sp+12) case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 80134c0: 34 03 00 04 mvi r3,4 if ( !signal_set ) return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); switch ( location ) { 80134c4: 5c 40 00 24 bne r2,r0,8013554 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 80134c8: 28 23 01 28 lw r3,(r1+296) asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 80134cc: 28 64 00 0c lw r4,(r3+12) 80134d0: 44 82 00 1f be r4,r2,801354c if ( asr->is_enabled ) { 80134d4: 40 62 00 08 lbu r2,(r3+8) 80134d8: 44 40 00 12 be r2,r0,8013520 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 80134dc: 90 00 10 00 rcsr r2,IE 80134e0: 34 04 ff fe mvi r4,-2 80134e4: a0 44 20 00 and r4,r2,r4 80134e8: d0 04 00 00 wcsr IE,r4 *signal_set |= signals; 80134ec: 28 64 00 14 lw r4,(r3+20) 80134f0: b8 8b 58 00 or r11,r4,r11 80134f4: 58 6b 00 14 sw (r3+20),r11 _ISR_Enable( _level ); 80134f8: d0 02 00 00 wcsr IE,r2 _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 80134fc: 78 02 08 04 mvhi r2,0x804 8013500: 38 42 11 84 ori r2,r2,0x1184 8013504: 28 43 00 08 lw r3,(r2+8) 8013508: 44 60 00 0e be r3,r0,8013540 801350c: 28 43 00 0c lw r3,(r2+12) 8013510: 5c 23 00 0c bne r1,r3,8013540 <== NEVER TAKEN _Context_Switch_necessary = true; 8013514: 34 01 00 01 mvi r1,1 8013518: 30 41 00 18 sb (r2+24),r1 801351c: e0 00 00 09 bi 8013540 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 8013520: 90 00 08 00 rcsr r1,IE 8013524: 34 02 ff fe mvi r2,-2 8013528: a0 22 10 00 and r2,r1,r2 801352c: d0 02 00 00 wcsr IE,r2 *signal_set |= signals; 8013530: 28 62 00 18 lw r2,(r3+24) 8013534: b8 4b 58 00 or r11,r2,r11 8013538: 58 6b 00 18 sw (r3+24),r11 _ISR_Enable( _level ); 801353c: d0 01 00 00 wcsr IE,r1 } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 8013540: f8 00 14 0d calli 8018574 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8013544: 34 03 00 00 mvi r3,0 8013548: e0 00 00 03 bi 8013554 } _Thread_Enable_dispatch(); 801354c: f8 00 14 0a calli 8018574 <_Thread_Enable_dispatch> return RTEMS_NOT_DEFINED; 8013550: 34 03 00 0b mvi r3,11 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8013554: b8 60 08 00 mv r1,r3 8013558: 2b 9d 00 04 lw ra,(sp+4) 801355c: 2b 8b 00 08 lw r11,(sp+8) 8013560: 37 9c 00 0c addi sp,sp,12 8013564: c3 a0 00 00 ret =============================================================================== 080007f4 : Thread_Control *the_thread ) { Stack_check_Control *the_pattern; if ( the_thread->Object.id == 0 ) /* skip system tasks */ 80007f4: 28 22 00 08 lw r2,(r1+8) 80007f8: 44 40 00 0c be r2,r0,8000828 <== NEVER TAKEN return; the_pattern = Stack_check_Get_pattern_area(&the_thread->Start.Initial_stack); *the_pattern = Stack_check_Pattern; 80007fc: 28 22 00 c8 lw r2,(r1+200) 8000800: 78 01 08 01 mvhi r1,0x801 8000804: 38 21 47 30 ori r1,r1,0x4730 8000808: 28 25 00 00 lw r5,(r1+0) 800080c: 28 24 00 04 lw r4,(r1+4) 8000810: 28 23 00 08 lw r3,(r1+8) 8000814: 28 21 00 0c lw r1,(r1+12) 8000818: 58 45 00 08 sw (r2+8),r5 800081c: 58 44 00 0c sw (r2+12),r4 8000820: 58 43 00 10 sw (r2+16),r3 8000824: 58 41 00 14 sw (r2+20),r1 8000828: c3 a0 00 00 ret =============================================================================== 080007c4 : */ bool rtems_stack_checker_create_extension( Thread_Control *running __attribute__((unused)), Thread_Control *the_thread ) { 80007c4: 37 9c ff fc addi sp,sp,-4 80007c8: 5b 9d 00 04 sw (sp+4),ra 80007cc: b8 40 18 00 mv r3,r2 Stack_check_Initialize(); if (the_thread) 80007d0: 44 40 00 05 be r2,r0,80007e4 <== NEVER TAKEN Stack_check_Dope_stack(&the_thread->Start.Initial_stack); 80007d4: 28 41 00 c8 lw r1,(r2+200) 80007d8: 28 63 00 c4 lw r3,(r3+196) 80007dc: 34 02 00 a5 mvi r2,165 80007e0: f8 00 32 af calli 800d29c return true; } 80007e4: 34 01 00 01 mvi r1,1 80007e8: 2b 9d 00 04 lw ra,(sp+4) 80007ec: 37 9c 00 04 addi sp,sp,4 80007f0: c3 a0 00 00 ret =============================================================================== 0800095c : /* * Check if blown */ bool rtems_stack_checker_is_blown( void ) { 800095c: 37 9c ff f8 addi sp,sp,-8 8000960: 5b 9b 00 08 sw (sp+8),fp 8000964: 34 1b 00 08 mvi fp,8 8000968: b7 7c d8 00 add fp,fp,sp 800096c: 5b 9d 00 04 sw (sp+4),ra Stack_Control *the_stack = &_Thread_Executing->Start.Initial_stack; 8000970: 78 01 08 01 mvhi r1,0x801 8000974: 38 21 4d 5c ori r1,r1,0x4d5c 8000978: 28 22 00 0c lw r2,(r1+12) ) { #if defined(__GNUC__) void *sp = __builtin_frame_address(0); if ( sp < the_stack->area ) { 800097c: 28 41 00 c8 lw r1,(r2+200) 8000980: 54 3b 00 04 bgu r1,fp,8000990 <== NEVER TAKEN return false; } if ( sp > (the_stack->area + the_stack->size) ) { 8000984: 28 42 00 c4 lw r2,(r2+196) 8000988: b4 22 08 00 add r1,r1,r2 800098c: 50 3b 00 06 bgeu r1,fp,80009a4 <== ALWAYS TAKEN /* * Let's report as much as we can. */ if ( !sp_ok || !pattern_ok ) { Stack_check_report_blown_task( _Thread_Executing, pattern_ok ); 8000990: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8000994: 38 21 4d 5c ori r1,r1,0x4d5c <== NOT EXECUTED 8000998: 28 21 00 0c lw r1,(r1+12) <== NOT EXECUTED 800099c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 80009a0: fb ff ff a3 calli 800082c <== NOT EXECUTED /* * The Stack Pointer and the Pattern Area are OK so return false. */ return false; } 80009a4: 34 01 00 00 mvi r1,0 80009a8: 2b 9d 00 04 lw ra,(sp+4) 80009ac: 2b 9b 00 08 lw fp,(sp+8) 80009b0: 37 9c 00 08 addi sp,sp,8 80009b4: c3 a0 00 00 ret =============================================================================== 080009b8 : void rtems_stack_checker_report_usage_with_plugin( void *context, rtems_printk_plugin_t print ) { 80009b8: 37 9c ff ec addi sp,sp,-20 80009bc: 5b 8b 00 14 sw (sp+20),r11 80009c0: 5b 8c 00 10 sw (sp+16),r12 80009c4: 5b 8d 00 0c sw (sp+12),r13 80009c8: 5b 8e 00 08 sw (sp+8),r14 80009cc: 5b 9d 00 04 sw (sp+4),ra 80009d0: b8 20 70 00 mv r14,r1 80009d4: b8 40 68 00 mv r13,r2 if ( !print ) 80009d8: 44 40 00 15 be r2,r0,8000a2c <== NEVER TAKEN return; print_context = context; print_handler = print; 80009dc: 78 0b 08 01 mvhi r11,0x801 80009e0: 39 6b 46 ac ori r11,r11,0x46ac ) { if ( !print ) return; print_context = context; 80009e4: 78 0c 08 01 mvhi r12,0x801 80009e8: 39 8c 46 a8 ori r12,r12,0x46a8 print_handler = print; 80009ec: 59 62 00 00 sw (r11+0),r2 (*print)( context, "Stack usage by thread\n"); 80009f0: 78 02 08 01 mvhi r2,0x801 80009f4: 38 42 2c 9c ori r2,r2,0x2c9c ) { if ( !print ) return; print_context = context; 80009f8: 59 81 00 00 sw (r12+0),r1 print_handler = print; (*print)( context, "Stack usage by thread\n"); 80009fc: d9 a0 00 00 call r13 (*print)( context, 8000a00: 78 02 08 01 mvhi r2,0x801 8000a04: 38 42 2c b4 ori r2,r2,0x2cb4 8000a08: b9 c0 08 00 mv r1,r14 8000a0c: d9 a0 00 00 call r13 " ID NAME LOW HIGH CURRENT AVAILABLE USED\n" ); /* iterate over all threads and dump the usage */ rtems_iterate_over_all_threads( Stack_check_Dump_threads_usage ); 8000a10: 78 01 08 00 mvhi r1,0x800 8000a14: 38 21 06 a0 ori r1,r1,0x6a0 8000a18: f8 00 0d 61 calli 8003f9c #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) /* dump interrupt stack info if any */ Stack_check_Dump_threads_usage((Thread_Control *) -1); 8000a1c: 34 01 ff ff mvi r1,-1 8000a20: fb ff ff 20 calli 80006a0 #endif print_context = NULL; 8000a24: 59 80 00 00 sw (r12+0),r0 print_handler = NULL; 8000a28: 59 60 00 00 sw (r11+0),r0 } 8000a2c: 2b 9d 00 04 lw ra,(sp+4) 8000a30: 2b 8b 00 14 lw r11,(sp+20) 8000a34: 2b 8c 00 10 lw r12,(sp+16) 8000a38: 2b 8d 00 0c lw r13,(sp+12) 8000a3c: 2b 8e 00 08 lw r14,(sp+8) 8000a40: 37 9c 00 14 addi sp,sp,20 8000a44: c3 a0 00 00 ret =============================================================================== 080008e4 : */ void rtems_stack_checker_switch_extension( Thread_Control *running __attribute__((unused)), Thread_Control *heir __attribute__((unused)) ) { 80008e4: 37 9c ff f0 addi sp,sp,-16 80008e8: 5b 9b 00 08 sw (sp+8),fp 80008ec: 34 1b 00 10 mvi fp,16 80008f0: b7 7c d8 00 add fp,fp,sp 80008f4: 5b 8b 00 10 sw (sp+16),r11 80008f8: 5b 8c 00 0c sw (sp+12),r12 80008fc: 5b 9d 00 04 sw (sp+4),ra 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; 8000900: 28 22 00 c8 lw r2,(r1+200) */ void rtems_stack_checker_switch_extension( Thread_Control *running __attribute__((unused)), Thread_Control *heir __attribute__((unused)) ) { 8000904: b8 20 58 00 mv r11,r1 { #if defined(__GNUC__) void *sp = __builtin_frame_address(0); if ( sp < the_stack->area ) { return false; 8000908: 34 0c 00 00 mvi r12,0 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; 800090c: 34 41 00 08 addi r1,r2,8 ) { #if defined(__GNUC__) void *sp = __builtin_frame_address(0); if ( sp < the_stack->area ) { 8000910: 54 5b 00 04 bgu r2,fp,8000920 <== NEVER TAKEN return false; } if ( sp > (the_stack->area + the_stack->size) ) { 8000914: 29 6c 00 c4 lw r12,(r11+196) } /* * rtems_stack_checker_switch_extension */ void rtems_stack_checker_switch_extension( 8000918: b4 4c 10 00 add r2,r2,r12 800091c: f0 5b 60 00 cmpgeu r12,r2,fp /* * 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, 8000920: 78 02 08 01 mvhi r2,0x801 8000924: 38 42 47 30 ori r2,r2,0x4730 8000928: 34 03 00 10 mvi r3,16 800092c: f8 00 31 ef calli 800d0e8 8000930: 64 22 00 00 cmpei r2,r1,0 (void *) Stack_check_Pattern.pattern, PATTERN_SIZE_BYTES)); if ( !sp_ok || !pattern_ok ) { 8000934: 45 80 00 02 be r12,r0,800093c 8000938: 5c 40 00 03 bne r2,r0,8000944 Stack_check_report_blown_task( running, pattern_ok ); 800093c: b9 60 08 00 mv r1,r11 8000940: fb ff ff bb calli 800082c } } 8000944: 2b 9d 00 04 lw ra,(sp+4) 8000948: 2b 8b 00 10 lw r11,(sp+16) 800094c: 2b 8c 00 0c lw r12,(sp+12) 8000950: 2b 9b 00 08 lw fp,(sp+8) 8000954: 37 9c 00 10 addi sp,sp,16 8000958: c3 a0 00 00 ret =============================================================================== 08008c74 : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008c74: 37 9c ff e4 addi sp,sp,-28 8008c78: 5b 8b 00 18 sw (sp+24),r11 8008c7c: 5b 8c 00 14 sw (sp+20),r12 8008c80: 5b 8d 00 10 sw (sp+16),r13 8008c84: 5b 8e 00 0c sw (sp+12),r14 8008c88: 5b 8f 00 08 sw (sp+8),r15 8008c8c: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 8008c90: 34 04 00 09 mvi r4,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008c94: b8 20 70 00 mv r14,r1 8008c98: b8 40 58 00 mv r11,r2 8008c9c: b8 60 78 00 mv r15,r3 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8008ca0: 44 40 00 21 be r2,r0,8008d24 return RTEMS_INVALID_ADDRESS; errno = 0; 8008ca4: f8 00 11 39 calli 800d188 <__errno> 8008ca8: 58 20 00 00 sw (r1+0),r0 *n = 0; 8008cac: 59 60 00 00 sw (r11+0),r0 8008cb0: 59 60 00 04 sw (r11+4),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); 8008cb4: b9 c0 08 00 mv r1,r14 8008cb8: 37 82 00 1c addi r2,sp,28 8008cbc: f8 00 1c 62 calli 800fe44 8008cc0: b8 20 68 00 mv r13,r1 8008cc4: b8 40 60 00 mv r12,r2 #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 ) 8008cc8: 45 e0 00 03 be r15,r0,8008cd4 *endptr = end; 8008ccc: 2b 81 00 1c lw r1,(sp+28) 8008cd0: 59 e1 00 00 sw (r15+0),r1 /* nothing was converted */ if ( end == s ) 8008cd4: 2b 81 00 1c lw r1,(sp+28) return RTEMS_NOT_DEFINED; 8008cd8: 34 04 00 0b mvi r4,11 /* If the user wants the end pointer back, then return it. */ if ( endptr ) *endptr = end; /* nothing was converted */ if ( end == s ) 8008cdc: 44 2e 00 12 be r1,r14,8008d24 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8008ce0: 78 04 08 02 mvhi r4,0x802 8008ce4: 38 84 04 30 ori r4,r4,0x430 8008ce8: 28 83 00 00 lw r3,(r4+0) 8008cec: b9 a0 08 00 mv r1,r13 8008cf0: b9 80 10 00 mv r2,r12 8008cf4: 34 04 ff ff mvi r4,-1 8008cf8: f8 00 49 ac calli 801b3a8 <__gedf2> 8008cfc: 48 20 00 02 bg r1,r0,8008d04 8008d00: e0 00 00 06 bi 8008d18 8008d04: f8 00 11 21 calli 800d188 <__errno> 8008d08: 28 22 00 00 lw r2,(r1+0) 8008d0c: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 8008d10: 34 04 00 0a mvi r4,10 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8008d14: 44 41 00 04 be r2,r1,8008d24 <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 8008d18: 59 6d 00 00 sw (r11+0),r13 8008d1c: 59 6c 00 04 sw (r11+4),r12 #endif return RTEMS_SUCCESSFUL; 8008d20: 34 04 00 00 mvi r4,0 } 8008d24: b8 80 08 00 mv r1,r4 8008d28: 2b 9d 00 04 lw ra,(sp+4) 8008d2c: 2b 8b 00 18 lw r11,(sp+24) 8008d30: 2b 8c 00 14 lw r12,(sp+20) 8008d34: 2b 8d 00 10 lw r13,(sp+16) 8008d38: 2b 8e 00 0c lw r14,(sp+12) 8008d3c: 2b 8f 00 08 lw r15,(sp+8) 8008d40: 37 9c 00 1c addi sp,sp,28 8008d44: c3 a0 00 00 ret =============================================================================== 08008d48 : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008d48: 37 9c ff e8 addi sp,sp,-24 8008d4c: 5b 8b 00 14 sw (sp+20),r11 8008d50: 5b 8c 00 10 sw (sp+16),r12 8008d54: 5b 8d 00 0c sw (sp+12),r13 8008d58: 5b 8e 00 08 sw (sp+8),r14 8008d5c: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 8008d60: 34 04 00 09 mvi r4,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008d64: b8 20 68 00 mv r13,r1 8008d68: b8 40 58 00 mv r11,r2 8008d6c: b8 60 70 00 mv r14,r3 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8008d70: 44 40 00 1c be r2,r0,8008de0 return RTEMS_INVALID_ADDRESS; errno = 0; 8008d74: f8 00 11 05 calli 800d188 <__errno> 8008d78: 58 20 00 00 sw (r1+0),r0 *n = 0; 8008d7c: 59 60 00 00 sw (r11+0),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); 8008d80: b9 a0 08 00 mv r1,r13 8008d84: 37 82 00 18 addi r2,sp,24 8008d88: f8 00 1c 3b calli 800fe74 8008d8c: b8 20 60 00 mv r12,r1 #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 ) 8008d90: 45 c0 00 03 be r14,r0,8008d9c *endptr = end; 8008d94: 2b 81 00 18 lw r1,(sp+24) 8008d98: 59 c1 00 00 sw (r14+0),r1 /* nothing was converted */ if ( end == s ) 8008d9c: 2b 81 00 18 lw r1,(sp+24) return RTEMS_NOT_DEFINED; 8008da0: 34 04 00 0b mvi r4,11 /* If the user wants the end pointer back, then return it. */ if ( endptr ) *endptr = end; /* nothing was converted */ if ( end == s ) 8008da4: 44 2d 00 0f be r1,r13,8008de0 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8008da8: 78 03 08 02 mvhi r3,0x802 8008dac: 38 63 04 34 ori r3,r3,0x434 8008db0: 28 62 00 00 lw r2,(r3+0) 8008db4: b9 80 08 00 mv r1,r12 8008db8: f8 00 43 84 calli 8019bc8 <__gesf2> 8008dbc: 48 20 00 02 bg r1,r0,8008dc4 8008dc0: e0 00 00 06 bi 8008dd8 8008dc4: f8 00 10 f1 calli 800d188 <__errno> 8008dc8: 28 22 00 00 lw r2,(r1+0) 8008dcc: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 8008dd0: 34 04 00 0a mvi r4,10 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8008dd4: 44 41 00 03 be r2,r1,8008de0 <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 8008dd8: 59 6c 00 00 sw (r11+0),r12 #endif return RTEMS_SUCCESSFUL; 8008ddc: 34 04 00 00 mvi r4,0 } 8008de0: b8 80 08 00 mv r1,r4 8008de4: 2b 9d 00 04 lw ra,(sp+4) 8008de8: 2b 8b 00 14 lw r11,(sp+20) 8008dec: 2b 8c 00 10 lw r12,(sp+16) 8008df0: 2b 8d 00 0c lw r13,(sp+12) 8008df4: 2b 8e 00 08 lw r14,(sp+8) 8008df8: 37 9c 00 18 addi sp,sp,24 8008dfc: c3 a0 00 00 ret =============================================================================== 08008e00 : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008e00: 37 9c ff e8 addi sp,sp,-24 8008e04: 5b 8b 00 14 sw (sp+20),r11 8008e08: 5b 8c 00 10 sw (sp+16),r12 8008e0c: 5b 8d 00 0c sw (sp+12),r13 8008e10: 5b 8e 00 08 sw (sp+8),r14 8008e14: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 8008e18: 34 05 00 09 mvi r5,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008e1c: b8 20 68 00 mv r13,r1 8008e20: b8 40 58 00 mv r11,r2 8008e24: b8 60 70 00 mv r14,r3 8008e28: b8 80 60 00 mv r12,r4 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8008e2c: 44 40 00 1a be r2,r0,8008e94 return RTEMS_INVALID_ADDRESS; errno = 0; 8008e30: f8 00 10 d6 calli 800d188 <__errno> 8008e34: 58 20 00 00 sw (r1+0),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); #elif defined(STRING_TO_POINTER) result = STRING_TO_METHOD( s, &end, 16 ); #elif defined(STRING_TO_INTEGER) result = STRING_TO_METHOD( s, &end, base ); 8008e38: b9 80 18 00 mv r3,r12 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 8008e3c: 59 60 00 00 sw (r11+0),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); #elif defined(STRING_TO_POINTER) result = STRING_TO_METHOD( s, &end, 16 ); #elif defined(STRING_TO_INTEGER) result = STRING_TO_METHOD( s, &end, base ); 8008e40: b9 a0 08 00 mv r1,r13 8008e44: 37 82 00 18 addi r2,sp,24 8008e48: f8 00 1c be calli 8010140 8008e4c: b8 20 60 00 mv r12,r1 #endif /* If the user wants the end pointer back, then return it. */ if ( endptr ) 8008e50: 45 c0 00 03 be r14,r0,8008e5c *endptr = end; 8008e54: 2b 81 00 18 lw r1,(sp+24) 8008e58: 59 c1 00 00 sw (r14+0),r1 /* nothing was converted */ if ( end == s ) 8008e5c: 2b 81 00 18 lw r1,(sp+24) return RTEMS_NOT_DEFINED; 8008e60: 34 05 00 0b mvi r5,11 /* If the user wants the end pointer back, then return it. */ if ( endptr ) *endptr = end; /* nothing was converted */ if ( end == s ) 8008e64: 44 2d 00 0c be r1,r13,8008e94 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8008e68: 78 02 08 02 mvhi r2,0x802 8008e6c: 38 42 04 14 ori r2,r2,0x414 8008e70: 28 41 00 00 lw r1,(r2+0) 8008e74: 5d 81 00 06 bne r12,r1,8008e8c 8008e78: f8 00 10 c4 calli 800d188 <__errno> 8008e7c: 28 22 00 00 lw r2,(r1+0) 8008e80: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 8008e84: 34 05 00 0a mvi r5,10 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8008e88: 44 41 00 03 be r2,r1,8008e94 <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 8008e8c: 59 6c 00 00 sw (r11+0),r12 #endif return RTEMS_SUCCESSFUL; 8008e90: 34 05 00 00 mvi r5,0 } 8008e94: b8 a0 08 00 mv r1,r5 8008e98: 2b 9d 00 04 lw ra,(sp+4) 8008e9c: 2b 8b 00 14 lw r11,(sp+20) 8008ea0: 2b 8c 00 10 lw r12,(sp+16) 8008ea4: 2b 8d 00 0c lw r13,(sp+12) 8008ea8: 2b 8e 00 08 lw r14,(sp+8) 8008eac: 37 9c 00 18 addi sp,sp,24 8008eb0: c3 a0 00 00 ret =============================================================================== 08008f90 : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008f90: 37 9c ff e8 addi sp,sp,-24 8008f94: 5b 8b 00 14 sw (sp+20),r11 8008f98: 5b 8c 00 10 sw (sp+16),r12 8008f9c: 5b 8d 00 0c sw (sp+12),r13 8008fa0: 5b 8e 00 08 sw (sp+8),r14 8008fa4: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 8008fa8: 34 05 00 09 mvi r5,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008fac: b8 20 68 00 mv r13,r1 8008fb0: b8 40 58 00 mv r11,r2 8008fb4: b8 60 70 00 mv r14,r3 8008fb8: b8 80 60 00 mv r12,r4 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8008fbc: 44 40 00 1c be r2,r0,800902c <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; errno = 0; 8008fc0: f8 00 10 72 calli 800d188 <__errno> 8008fc4: 58 20 00 00 sw (r1+0),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); #elif defined(STRING_TO_POINTER) result = STRING_TO_METHOD( s, &end, 16 ); #elif defined(STRING_TO_INTEGER) result = STRING_TO_METHOD( s, &end, base ); 8008fc8: b9 80 18 00 mv r3,r12 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 8008fcc: 59 60 00 00 sw (r11+0),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); #elif defined(STRING_TO_POINTER) result = STRING_TO_METHOD( s, &end, 16 ); #elif defined(STRING_TO_INTEGER) result = STRING_TO_METHOD( s, &end, base ); 8008fd0: b9 a0 08 00 mv r1,r13 8008fd4: 37 82 00 18 addi r2,sp,24 8008fd8: f8 00 1c 5a calli 8010140 8008fdc: b8 20 60 00 mv r12,r1 #endif /* If the user wants the end pointer back, then return it. */ if ( endptr ) 8008fe0: 45 c0 00 03 be r14,r0,8008fec *endptr = end; 8008fe4: 2b 81 00 18 lw r1,(sp+24) 8008fe8: 59 c1 00 00 sw (r14+0),r1 /* nothing was converted */ if ( end == s ) 8008fec: 2b 81 00 18 lw r1,(sp+24) return RTEMS_NOT_DEFINED; 8008ff0: 34 05 00 0b mvi r5,11 /* If the user wants the end pointer back, then return it. */ if ( endptr ) *endptr = end; /* nothing was converted */ if ( end == s ) 8008ff4: 44 2d 00 0e be r1,r13,800902c <== NEVER TAKEN return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8008ff8: 78 02 08 02 mvhi r2,0x802 8008ffc: 38 42 04 14 ori r2,r2,0x414 8009000: 28 41 00 00 lw r1,(r2+0) 8009004: 45 81 00 03 be r12,r1,8009010 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MIN /* there was an underflow */ if ( (result == STRING_TO_MIN) && (errno == ERANGE)) 8009008: 78 01 80 00 mvhi r1,0x8000 800900c: 5d 81 00 06 bne r12,r1,8009024 8009010: f8 00 10 5e calli 800d188 <__errno> 8009014: 28 22 00 00 lw r2,(r1+0) 8009018: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 800901c: 34 05 00 0a mvi r5,10 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MIN /* there was an underflow */ if ( (result == STRING_TO_MIN) && (errno == ERANGE)) 8009020: 44 41 00 03 be r2,r1,800902c <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 8009024: 59 6c 00 00 sw (r11+0),r12 #endif return RTEMS_SUCCESSFUL; 8009028: 34 05 00 00 mvi r5,0 } 800902c: b8 a0 08 00 mv r1,r5 8009030: 2b 9d 00 04 lw ra,(sp+4) 8009034: 2b 8b 00 14 lw r11,(sp+20) 8009038: 2b 8c 00 10 lw r12,(sp+16) 800903c: 2b 8d 00 0c lw r13,(sp+12) 8009040: 2b 8e 00 08 lw r14,(sp+8) 8009044: 37 9c 00 18 addi sp,sp,24 8009048: c3 a0 00 00 ret =============================================================================== 08008eb4 : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008eb4: 37 9c ff e4 addi sp,sp,-28 8008eb8: 5b 8b 00 18 sw (sp+24),r11 8008ebc: 5b 8c 00 14 sw (sp+20),r12 8008ec0: 5b 8d 00 10 sw (sp+16),r13 8008ec4: 5b 8e 00 0c sw (sp+12),r14 8008ec8: 5b 8f 00 08 sw (sp+8),r15 8008ecc: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 8008ed0: 34 05 00 09 mvi r5,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008ed4: b8 20 70 00 mv r14,r1 8008ed8: b8 40 58 00 mv r11,r2 8008edc: b8 60 78 00 mv r15,r3 8008ee0: b8 80 60 00 mv r12,r4 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8008ee4: 44 40 00 22 be r2,r0,8008f6c return RTEMS_INVALID_ADDRESS; errno = 0; 8008ee8: f8 00 10 a8 calli 800d188 <__errno> 8008eec: 58 20 00 00 sw (r1+0),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); #elif defined(STRING_TO_POINTER) result = STRING_TO_METHOD( s, &end, 16 ); #elif defined(STRING_TO_INTEGER) result = STRING_TO_METHOD( s, &end, base ); 8008ef0: b9 80 18 00 mv r3,r12 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 8008ef4: 59 60 00 00 sw (r11+0),r0 8008ef8: 59 60 00 04 sw (r11+4),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); #elif defined(STRING_TO_POINTER) result = STRING_TO_METHOD( s, &end, 16 ); #elif defined(STRING_TO_INTEGER) result = STRING_TO_METHOD( s, &end, base ); 8008efc: b9 c0 08 00 mv r1,r14 8008f00: 37 82 00 1c addi r2,sp,28 8008f04: f8 00 1c 9d calli 8010178 8008f08: b8 20 68 00 mv r13,r1 8008f0c: b8 40 60 00 mv r12,r2 #endif /* If the user wants the end pointer back, then return it. */ if ( endptr ) 8008f10: 45 e0 00 03 be r15,r0,8008f1c *endptr = end; 8008f14: 2b 81 00 1c lw r1,(sp+28) 8008f18: 59 e1 00 00 sw (r15+0),r1 /* nothing was converted */ if ( end == s ) 8008f1c: 2b 81 00 1c lw r1,(sp+28) return RTEMS_NOT_DEFINED; 8008f20: 34 05 00 0b mvi r5,11 /* If the user wants the end pointer back, then return it. */ if ( endptr ) *endptr = end; /* nothing was converted */ if ( end == s ) 8008f24: 44 2e 00 12 be r1,r14,8008f6c return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8008f28: 78 02 08 02 mvhi r2,0x802 8008f2c: 38 42 04 14 ori r2,r2,0x414 8008f30: 28 41 00 00 lw r1,(r2+0) 8008f34: 5d a1 00 03 bne r13,r1,8008f40 8008f38: 34 01 ff ff mvi r1,-1 8008f3c: 45 81 00 04 be r12,r1,8008f4c <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MIN /* there was an underflow */ if ( (result == STRING_TO_MIN) && (errno == ERANGE)) 8008f40: 78 01 80 00 mvhi r1,0x8000 8008f44: 5d a1 00 07 bne r13,r1,8008f60 8008f48: 5d 80 00 06 bne r12,r0,8008f60 <== NEVER TAKEN 8008f4c: f8 00 10 8f calli 800d188 <__errno> 8008f50: 28 22 00 00 lw r2,(r1+0) 8008f54: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 8008f58: 34 05 00 0a mvi r5,10 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MIN /* there was an underflow */ if ( (result == STRING_TO_MIN) && (errno == ERANGE)) 8008f5c: 44 41 00 04 be r2,r1,8008f6c <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 8008f60: 59 6d 00 00 sw (r11+0),r13 8008f64: 59 6c 00 04 sw (r11+4),r12 #endif return RTEMS_SUCCESSFUL; 8008f68: 34 05 00 00 mvi r5,0 } 8008f6c: b8 a0 08 00 mv r1,r5 8008f70: 2b 9d 00 04 lw ra,(sp+4) 8008f74: 2b 8b 00 18 lw r11,(sp+24) 8008f78: 2b 8c 00 14 lw r12,(sp+20) 8008f7c: 2b 8d 00 10 lw r13,(sp+16) 8008f80: 2b 8e 00 0c lw r14,(sp+12) 8008f84: 2b 8f 00 08 lw r15,(sp+8) 8008f88: 37 9c 00 1c addi sp,sp,28 8008f8c: c3 a0 00 00 ret =============================================================================== 0800904c : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 800904c: 37 9c ff e8 addi sp,sp,-24 8009050: 5b 8b 00 14 sw (sp+20),r11 8009054: 5b 8c 00 10 sw (sp+16),r12 8009058: 5b 8d 00 0c sw (sp+12),r13 800905c: 5b 8e 00 08 sw (sp+8),r14 8009060: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 8009064: 34 04 00 09 mvi r4,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8009068: b8 20 68 00 mv r13,r1 800906c: b8 40 58 00 mv r11,r2 8009070: b8 60 70 00 mv r14,r3 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8009074: 44 40 00 18 be r2,r0,80090d4 return RTEMS_INVALID_ADDRESS; errno = 0; 8009078: f8 00 10 44 calli 800d188 <__errno> 800907c: 58 20 00 00 sw (r1+0),r0 *n = 0; 8009080: 59 60 00 00 sw (r11+0),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); #elif defined(STRING_TO_POINTER) result = STRING_TO_METHOD( s, &end, 16 ); 8009084: b9 a0 08 00 mv r1,r13 8009088: 37 82 00 18 addi r2,sp,24 800908c: 34 03 00 10 mvi r3,16 8009090: f8 00 1d a5 calli 8010724 8009094: b8 20 60 00 mv r12,r1 #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 ) 8009098: 45 c0 00 03 be r14,r0,80090a4 *endptr = end; 800909c: 2b 81 00 18 lw r1,(sp+24) 80090a0: 59 c1 00 00 sw (r14+0),r1 /* nothing was converted */ if ( end == s ) 80090a4: 2b 81 00 18 lw r1,(sp+24) return RTEMS_NOT_DEFINED; 80090a8: 34 04 00 0b mvi r4,11 /* If the user wants the end pointer back, then return it. */ if ( endptr ) *endptr = end; /* nothing was converted */ if ( end == s ) 80090ac: 44 2d 00 0a be r1,r13,80090d4 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 80090b0: 34 01 ff ff mvi r1,-1 80090b4: 5d 81 00 06 bne r12,r1,80090cc <== ALWAYS TAKEN 80090b8: f8 00 10 34 calli 800d188 <__errno> <== NOT EXECUTED 80090bc: 28 22 00 00 lw r2,(r1+0) <== NOT EXECUTED 80090c0: 34 01 00 22 mvi r1,34 <== NOT EXECUTED return RTEMS_INVALID_NUMBER; 80090c4: 34 04 00 0a mvi r4,10 <== NOT EXECUTED return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 80090c8: 44 41 00 03 be r2,r1,80090d4 <== NOT EXECUTED if ( (result == STRING_TO_MIN) && (errno == ERANGE)) return RTEMS_INVALID_NUMBER; #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; 80090cc: 59 6c 00 00 sw (r11+0),r12 #else *n = (STRING_TO_TYPE) result; #endif return RTEMS_SUCCESSFUL; 80090d0: 34 04 00 00 mvi r4,0 } 80090d4: b8 80 08 00 mv r1,r4 80090d8: 2b 9d 00 04 lw ra,(sp+4) 80090dc: 2b 8b 00 14 lw r11,(sp+20) 80090e0: 2b 8c 00 10 lw r12,(sp+16) 80090e4: 2b 8d 00 0c lw r13,(sp+12) 80090e8: 2b 8e 00 08 lw r14,(sp+8) 80090ec: 37 9c 00 18 addi sp,sp,24 80090f0: c3 a0 00 00 ret =============================================================================== 08009184 : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8009184: 37 9c ff e8 addi sp,sp,-24 8009188: 5b 8b 00 14 sw (sp+20),r11 800918c: 5b 8c 00 10 sw (sp+16),r12 8009190: 5b 8d 00 0c sw (sp+12),r13 8009194: 5b 8e 00 08 sw (sp+8),r14 8009198: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 800919c: 34 05 00 09 mvi r5,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 80091a0: b8 20 68 00 mv r13,r1 80091a4: b8 40 58 00 mv r11,r2 80091a8: b8 60 70 00 mv r14,r3 80091ac: b8 80 60 00 mv r12,r4 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 80091b0: 44 40 00 18 be r2,r0,8009210 return RTEMS_INVALID_ADDRESS; errno = 0; 80091b4: f8 00 0f f5 calli 800d188 <__errno> 80091b8: 58 20 00 00 sw (r1+0),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); #elif defined(STRING_TO_POINTER) result = STRING_TO_METHOD( s, &end, 16 ); #elif defined(STRING_TO_INTEGER) result = STRING_TO_METHOD( s, &end, base ); 80091bc: b9 80 18 00 mv r3,r12 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 80091c0: 59 60 00 00 sw (r11+0),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); #elif defined(STRING_TO_POINTER) result = STRING_TO_METHOD( s, &end, 16 ); #elif defined(STRING_TO_INTEGER) result = STRING_TO_METHOD( s, &end, base ); 80091c4: b9 a0 08 00 mv r1,r13 80091c8: 37 82 00 18 addi r2,sp,24 80091cc: f8 00 1d 56 calli 8010724 80091d0: b8 20 60 00 mv r12,r1 #endif /* If the user wants the end pointer back, then return it. */ if ( endptr ) 80091d4: 45 c0 00 03 be r14,r0,80091e0 *endptr = end; 80091d8: 2b 81 00 18 lw r1,(sp+24) 80091dc: 59 c1 00 00 sw (r14+0),r1 /* nothing was converted */ if ( end == s ) 80091e0: 2b 81 00 18 lw r1,(sp+24) return RTEMS_NOT_DEFINED; 80091e4: 34 05 00 0b mvi r5,11 /* If the user wants the end pointer back, then return it. */ if ( endptr ) *endptr = end; /* nothing was converted */ if ( end == s ) 80091e8: 44 2d 00 0a be r1,r13,8009210 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 80091ec: 34 01 ff ff mvi r1,-1 80091f0: 5d 81 00 06 bne r12,r1,8009208 80091f4: f8 00 0f e5 calli 800d188 <__errno> 80091f8: 28 22 00 00 lw r2,(r1+0) 80091fc: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 8009200: 34 05 00 0a mvi r5,10 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8009204: 44 41 00 03 be r2,r1,8009210 <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 8009208: 59 6c 00 00 sw (r11+0),r12 #endif return RTEMS_SUCCESSFUL; 800920c: 34 05 00 00 mvi r5,0 } 8009210: b8 a0 08 00 mv r1,r5 8009214: 2b 9d 00 04 lw ra,(sp+4) 8009218: 2b 8b 00 14 lw r11,(sp+20) 800921c: 2b 8c 00 10 lw r12,(sp+16) 8009220: 2b 8d 00 0c lw r13,(sp+12) 8009224: 2b 8e 00 08 lw r14,(sp+8) 8009228: 37 9c 00 18 addi sp,sp,24 800922c: c3 a0 00 00 ret =============================================================================== 080092f4 : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 80092f4: 37 9c ff e8 addi sp,sp,-24 80092f8: 5b 8b 00 14 sw (sp+20),r11 80092fc: 5b 8c 00 10 sw (sp+16),r12 8009300: 5b 8d 00 0c sw (sp+12),r13 8009304: 5b 8e 00 08 sw (sp+8),r14 8009308: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 800930c: 34 05 00 09 mvi r5,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8009310: b8 20 68 00 mv r13,r1 8009314: b8 40 58 00 mv r11,r2 8009318: b8 60 70 00 mv r14,r3 800931c: b8 80 60 00 mv r12,r4 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8009320: 44 40 00 18 be r2,r0,8009380 return RTEMS_INVALID_ADDRESS; errno = 0; 8009324: f8 00 0f 99 calli 800d188 <__errno> 8009328: 58 20 00 00 sw (r1+0),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); #elif defined(STRING_TO_POINTER) result = STRING_TO_METHOD( s, &end, 16 ); #elif defined(STRING_TO_INTEGER) result = STRING_TO_METHOD( s, &end, base ); 800932c: b9 80 18 00 mv r3,r12 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 8009330: 59 60 00 00 sw (r11+0),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); #elif defined(STRING_TO_POINTER) result = STRING_TO_METHOD( s, &end, 16 ); #elif defined(STRING_TO_INTEGER) result = STRING_TO_METHOD( s, &end, base ); 8009334: b9 a0 08 00 mv r1,r13 8009338: 37 82 00 18 addi r2,sp,24 800933c: f8 00 1c fa calli 8010724 8009340: b8 20 60 00 mv r12,r1 #endif /* If the user wants the end pointer back, then return it. */ if ( endptr ) 8009344: 45 c0 00 03 be r14,r0,8009350 *endptr = end; 8009348: 2b 81 00 18 lw r1,(sp+24) 800934c: 59 c1 00 00 sw (r14+0),r1 /* nothing was converted */ if ( end == s ) 8009350: 2b 81 00 18 lw r1,(sp+24) return RTEMS_NOT_DEFINED; 8009354: 34 05 00 0b mvi r5,11 /* If the user wants the end pointer back, then return it. */ if ( endptr ) *endptr = end; /* nothing was converted */ if ( end == s ) 8009358: 44 2d 00 0a be r1,r13,8009380 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 800935c: 34 01 ff ff mvi r1,-1 8009360: 5d 81 00 06 bne r12,r1,8009378 8009364: f8 00 0f 89 calli 800d188 <__errno> 8009368: 28 22 00 00 lw r2,(r1+0) 800936c: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 8009370: 34 05 00 0a mvi r5,10 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8009374: 44 41 00 03 be r2,r1,8009380 <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 8009378: 59 6c 00 00 sw (r11+0),r12 #endif return RTEMS_SUCCESSFUL; 800937c: 34 05 00 00 mvi r5,0 } 8009380: b8 a0 08 00 mv r1,r5 8009384: 2b 9d 00 04 lw ra,(sp+4) 8009388: 2b 8b 00 14 lw r11,(sp+20) 800938c: 2b 8c 00 10 lw r12,(sp+16) 8009390: 2b 8d 00 0c lw r13,(sp+12) 8009394: 2b 8e 00 08 lw r14,(sp+8) 8009398: 37 9c 00 18 addi sp,sp,24 800939c: c3 a0 00 00 ret =============================================================================== 08009230 : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8009230: 37 9c ff e4 addi sp,sp,-28 8009234: 5b 8b 00 18 sw (sp+24),r11 8009238: 5b 8c 00 14 sw (sp+20),r12 800923c: 5b 8d 00 10 sw (sp+16),r13 8009240: 5b 8e 00 0c sw (sp+12),r14 8009244: 5b 8f 00 08 sw (sp+8),r15 8009248: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 800924c: 34 05 00 09 mvi r5,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8009250: b8 20 70 00 mv r14,r1 8009254: b8 40 58 00 mv r11,r2 8009258: b8 60 78 00 mv r15,r3 800925c: b8 80 60 00 mv r12,r4 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8009260: 44 40 00 1c be r2,r0,80092d0 return RTEMS_INVALID_ADDRESS; errno = 0; 8009264: f8 00 0f c9 calli 800d188 <__errno> 8009268: 58 20 00 00 sw (r1+0),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); #elif defined(STRING_TO_POINTER) result = STRING_TO_METHOD( s, &end, 16 ); #elif defined(STRING_TO_INTEGER) result = STRING_TO_METHOD( s, &end, base ); 800926c: b9 80 18 00 mv r3,r12 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 8009270: 59 60 00 00 sw (r11+0),r0 8009274: 59 60 00 04 sw (r11+4),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); #elif defined(STRING_TO_POINTER) result = STRING_TO_METHOD( s, &end, 16 ); #elif defined(STRING_TO_INTEGER) result = STRING_TO_METHOD( s, &end, base ); 8009278: b9 c0 08 00 mv r1,r14 800927c: 37 82 00 1c addi r2,sp,28 8009280: f8 00 1d 37 calli 801075c 8009284: b8 20 60 00 mv r12,r1 8009288: b8 40 68 00 mv r13,r2 #endif /* If the user wants the end pointer back, then return it. */ if ( endptr ) 800928c: 45 e0 00 03 be r15,r0,8009298 *endptr = end; 8009290: 2b 81 00 1c lw r1,(sp+28) 8009294: 59 e1 00 00 sw (r15+0),r1 /* nothing was converted */ if ( end == s ) 8009298: 2b 81 00 1c lw r1,(sp+28) return RTEMS_NOT_DEFINED; 800929c: 34 05 00 0b mvi r5,11 /* If the user wants the end pointer back, then return it. */ if ( endptr ) *endptr = end; /* nothing was converted */ if ( end == s ) 80092a0: 44 2e 00 0c be r1,r14,80092d0 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 80092a4: 34 01 ff ff mvi r1,-1 80092a8: 5d 81 00 07 bne r12,r1,80092c4 80092ac: 5d ac 00 06 bne r13,r12,80092c4 <== NEVER TAKEN 80092b0: f8 00 0f b6 calli 800d188 <__errno> 80092b4: 28 22 00 00 lw r2,(r1+0) 80092b8: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 80092bc: 34 05 00 0a mvi r5,10 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 80092c0: 44 41 00 04 be r2,r1,80092d0 <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 80092c4: 59 6c 00 00 sw (r11+0),r12 80092c8: 59 6d 00 04 sw (r11+4),r13 #endif return RTEMS_SUCCESSFUL; 80092cc: 34 05 00 00 mvi r5,0 } 80092d0: b8 a0 08 00 mv r1,r5 80092d4: 2b 9d 00 04 lw ra,(sp+4) 80092d8: 2b 8b 00 18 lw r11,(sp+24) 80092dc: 2b 8c 00 14 lw r12,(sp+20) 80092e0: 2b 8d 00 10 lw r13,(sp+16) 80092e4: 2b 8e 00 0c lw r14,(sp+12) 80092e8: 2b 8f 00 08 lw r15,(sp+8) 80092ec: 37 9c 00 1c addi sp,sp,28 80092f0: c3 a0 00 00 ret =============================================================================== 08000bf0 : int rtems_tarfs_load( char *mountpoint, uint8_t *tar_image, size_t tar_size ) { 8000bf0: 37 9c fe 20 addi sp,sp,-480 8000bf4: 5b 8b 00 44 sw (sp+68),r11 8000bf8: 5b 8c 00 40 sw (sp+64),r12 8000bfc: 5b 8d 00 3c sw (sp+60),r13 8000c00: 5b 8e 00 38 sw (sp+56),r14 8000c04: 5b 8f 00 34 sw (sp+52),r15 8000c08: 5b 90 00 30 sw (sp+48),r16 8000c0c: 5b 91 00 2c sw (sp+44),r17 8000c10: 5b 92 00 28 sw (sp+40),r18 8000c14: 5b 93 00 24 sw (sp+36),r19 8000c18: 5b 94 00 20 sw (sp+32),r20 8000c1c: 5b 95 00 1c sw (sp+28),r21 8000c20: 5b 96 00 18 sw (sp+24),r22 8000c24: 5b 97 00 14 sw (sp+20),r23 8000c28: 5b 98 00 10 sw (sp+16),r24 8000c2c: 5b 99 00 0c sw (sp+12),r25 8000c30: 5b 9b 00 08 sw (sp+8),fp 8000c34: 5b 9d 00 04 sw (sp+4),ra 8000c38: b8 20 98 00 mv r19,r1 8000c3c: b8 40 a0 00 mv r20,r2 8000c40: 5b 83 00 50 sw (sp+80),r3 int offset; unsigned long nblocks; IMFS_jnode_t *node; int status; status = rtems_filesystem_evaluate_path( 8000c44: f8 00 40 9d calli 8010eb8 8000c48: b8 20 10 00 mv r2,r1 8000c4c: 34 03 00 00 mvi r3,0 8000c50: ba 60 08 00 mv r1,r19 8000c54: 37 84 01 cc addi r4,sp,460 8000c58: 34 05 00 00 mvi r5,0 8000c5c: f8 00 03 57 calli 80019b8 8000c60: b8 20 60 00 mv r12,r1 strlen(mountpoint), 0, &root_loc, 0 ); if (status != 0) 8000c64: 5c 20 00 71 bne r1,r0,8000e28 <== NEVER TAKEN return -1; if (root_loc.ops != &IMFS_ops 8000c68: 2b 81 01 d8 lw r1,(sp+472) 8000c6c: 78 04 08 02 mvhi r4,0x802 8000c70: 38 84 05 b0 ori r4,r4,0x5b0 8000c74: 34 0b 00 00 mvi r11,0 8000c78: 44 24 00 08 be r1,r4,8000c98 <== ALWAYS TAKEN && root_loc.ops != &fifoIMFS_ops) 8000c7c: 78 04 08 02 mvhi r4,0x802 <== NOT EXECUTED 8000c80: 38 84 0e 28 ori r4,r4,0xe28 <== NOT EXECUTED 8000c84: b9 80 58 00 mv r11,r12 <== NOT EXECUTED 8000c88: 5c 24 00 68 bne r1,r4,8000e28 <== NOT EXECUTED 8000c8c: e0 00 00 03 bi 8000c98 <== NOT EXECUTED 8000c90: b9 c0 58 00 mv r11,r14 8000c94: e0 00 00 0c bi 8000cc4 /* * Read a header. */ hdr_ptr = (char *) &tar_image[offset]; offset += 512; if (strncmp(&hdr_ptr[257], "ustar ", 7)) 8000c98: 78 11 08 02 mvhi r17,0x802 * - For files, create a file node with special tarfs properties. */ if (linkflag == DIRTYPE) { strcpy(full_filename, mountpoint); if (full_filename[strlen(full_filename)-1] != '/') strcat(full_filename, "/"); 8000c9c: 78 0f 08 01 mvhi r15,0x801 /* * Read a header. */ hdr_ptr = (char *) &tar_image[offset]; offset += 512; if (strncmp(&hdr_ptr[257], "ustar ", 7)) 8000ca0: 3a 31 05 f8 ori r17,r17,0x5f8 break; strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); 8000ca4: 37 90 01 54 addi r16,sp,340 * 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) { 8000ca8: 34 1b 00 30 mvi fp,48 const char *name; loc = root_loc; if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { 8000cac: 37 92 01 b8 addi r18,sp,440 ); node->info.linearfile.size = file_size; node->info.linearfile.direct = &tar_image[offset]; } nblocks = (((file_size) + 511) & ~511) / 512; 8000cb0: 34 19 fe 00 mvi r25,-512 * - 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); 8000cb4: 37 8d 00 54 addi r13,sp,84 if (full_filename[strlen(full_filename)-1] != '/') 8000cb8: 37 98 00 53 addi r24,sp,83 8000cbc: 34 17 00 2f mvi r23,47 strcat(full_filename, "/"); 8000cc0: 39 ef db 54 ori r15,r15,0xdb54 /* * Create an IMFS node structure pointing to tar image memory. */ offset = 0; while (1) { if (offset + 512 > tar_size) 8000cc4: 2b 81 00 50 lw r1,(sp+80) 8000cc8: 35 6e 02 00 addi r14,r11,512 8000ccc: 55 c1 00 58 bgu r14,r1,8000e2c <== NEVER TAKEN break; /* * Read a header. */ hdr_ptr = (char *) &tar_image[offset]; 8000cd0: b6 8b 58 00 add r11,r20,r11 offset += 512; if (strncmp(&hdr_ptr[257], "ustar ", 7)) 8000cd4: 35 61 01 01 addi r1,r11,257 8000cd8: ba 20 10 00 mv r2,r17 8000cdc: 34 03 00 07 mvi r3,7 8000ce0: f8 00 40 a5 calli 8010f74 8000ce4: 5c 20 00 52 bne r1,r0,8000e2c break; strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); 8000ce8: 34 03 00 63 mvi r3,99 8000cec: b9 60 10 00 mv r2,r11 8000cf0: ba 00 08 00 mv r1,r16 8000cf4: f8 00 40 ed calli 80110a8 filename[MAX_NAME_FIELD_SIZE] = '\0'; linkflag = hdr_ptr[156]; file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8); 8000cf8: 34 02 00 08 mvi r2,8 offset += 512; if (strncmp(&hdr_ptr[257], "ustar ", 7)) break; strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); filename[MAX_NAME_FIELD_SIZE] = '\0'; 8000cfc: 33 80 01 b7 sb (sp+439),r0 linkflag = hdr_ptr[156]; file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8); 8000d00: 35 61 00 64 addi r1,r11,100 break; strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); filename[MAX_NAME_FIELD_SIZE] = '\0'; linkflag = hdr_ptr[156]; 8000d04: 41 76 00 9c lbu r22,(r11+156) file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8); 8000d08: f8 00 19 c9 calli 800742c <_rtems_octal2ulong> 8000d0c: 5b 81 00 4c sw (sp+76),r1 file_size = _rtems_octal2ulong(&hdr_ptr[124], 12); 8000d10: 34 02 00 0c mvi r2,12 8000d14: 35 61 00 7c addi r1,r11,124 8000d18: f8 00 19 c5 calli 800742c <_rtems_octal2ulong> hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8); 8000d1c: 34 02 00 08 mvi r2,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); 8000d20: b8 20 a8 00 mv r21,r1 hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8); 8000d24: 35 61 00 94 addi r1,r11,148 8000d28: f8 00 19 c1 calli 800742c <_rtems_octal2ulong> 8000d2c: b8 20 10 00 mv r2,r1 if (_rtems_tar_header_checksum(hdr_ptr) != hdr_chksum) 8000d30: b9 60 08 00 mv r1,r11 8000d34: 5b 82 00 48 sw (sp+72),r2 8000d38: f8 00 19 dc calli 80074a8 <_rtems_tar_header_checksum> 8000d3c: 2b 82 00 48 lw r2,(sp+72) 8000d40: 5c 22 00 3b bne r1,r2,8000e2c <== NEVER TAKEN * 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) { 8000d44: 34 01 00 35 mvi r1,53 8000d48: 5e c1 00 13 bne r22,r1,8000d94 strcpy(full_filename, mountpoint); 8000d4c: ba 60 10 00 mv r2,r19 8000d50: b9 a0 08 00 mv r1,r13 8000d54: f8 00 3f 25 calli 80109e8 if (full_filename[strlen(full_filename)-1] != '/') 8000d58: b9 a0 08 00 mv r1,r13 8000d5c: f8 00 40 57 calli 8010eb8 8000d60: b7 01 08 00 add r1,r24,r1 8000d64: 40 21 00 00 lbu r1,(r1+0) 8000d68: 44 37 00 04 be r1,r23,8000d78 <== ALWAYS TAKEN strcat(full_filename, "/"); 8000d6c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8000d70: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED 8000d74: f8 00 3e c6 calli 801088c <== NOT EXECUTED strcat(full_filename, filename); 8000d78: ba 00 10 00 mv r2,r16 8000d7c: b9 a0 08 00 mv r1,r13 8000d80: f8 00 3e c3 calli 801088c mkdir(full_filename, S_IRWXU | S_IRWXG | S_IRWXO); 8000d84: b9 a0 08 00 mv r1,r13 8000d88: 34 02 01 ff mvi r2,511 8000d8c: f8 00 05 bf calli 8002488 8000d90: e3 ff ff c0 bi 8000c90 * 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) { 8000d94: 5e db ff bf bne r22,fp,8000c90 const char *name; loc = root_loc; 8000d98: 2b 81 01 cc lw r1,(sp+460) if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { 8000d9c: ba 40 10 00 mv r2,r18 8000da0: 37 83 01 e0 addi r3,sp,480 * should not have this path. */ else if (linkflag == REGTYPE) { const char *name; loc = root_loc; 8000da4: 5b 81 01 b8 sw (sp+440),r1 8000da8: 2b 81 01 d0 lw r1,(sp+464) 8000dac: 5b 81 01 bc sw (sp+444),r1 8000db0: 2b 81 01 d4 lw r1,(sp+468) 8000db4: 5b 81 01 c0 sw (sp+448),r1 8000db8: 2b 81 01 d8 lw r1,(sp+472) 8000dbc: 5b 81 01 c4 sw (sp+452),r1 8000dc0: 2b 81 01 dc lw r1,(sp+476) 8000dc4: 5b 81 01 c8 sw (sp+456),r1 if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { 8000dc8: ba 00 08 00 mv r1,r16 8000dcc: f8 00 1d 70 calli 800838c 8000dd0: 5c 20 00 0e bne r1,r0,8000e08 <== NEVER TAKEN node = IMFS_create_node( &loc, IMFS_LINEAR_FILE, (char *)name, (file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG, 8000dd4: 2b 81 00 4c lw r1,(sp+76) else if (linkflag == REGTYPE) { const char *name; loc = root_loc; if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { node = IMFS_create_node( 8000dd8: 2b 83 01 e0 lw r3,(sp+480) 8000ddc: 34 02 00 06 mvi r2,6 &loc, IMFS_LINEAR_FILE, (char *)name, (file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG, 8000de0: 20 24 01 ff andi r4,r1,0x1ff else if (linkflag == REGTYPE) { const char *name; loc = root_loc; if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { node = IMFS_create_node( 8000de4: 38 84 80 00 ori r4,r4,0x8000 8000de8: ba 40 08 00 mv r1,r18 8000dec: 34 05 00 00 mvi r5,0 8000df0: f8 00 1b 7a calli 8007bd8 8000df4: b8 20 20 00 mv r4,r1 &loc, IMFS_LINEAR_FILE, (char *)name, (file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG, NULL ); node->info.linearfile.size = file_size; 8000df8: 58 20 00 50 sw (r1+80),r0 8000dfc: 58 35 00 54 sw (r1+84),r21 node->info.linearfile.direct = &tar_image[offset]; 8000e00: b6 8e 08 00 add r1,r20,r14 8000e04: 58 81 00 58 sw (r4+88),r1 } nblocks = (((file_size) + 511) & ~511) / 512; 8000e08: 36 a1 01 ff addi r1,r21,511 8000e0c: 34 02 00 09 mvi r2,9 8000e10: a0 39 08 00 and r1,r1,r25 8000e14: f8 00 70 b1 calli 801d0d8 <__lshrsi3> offset += 512 * nblocks; 8000e18: 34 02 00 09 mvi r2,9 8000e1c: f8 00 70 61 calli 801cfa0 <__ashlsi3> 8000e20: b4 2e 70 00 add r14,r1,r14 8000e24: e3 ff ff 9b bi 8000c90 if (status != 0) return -1; if (root_loc.ops != &IMFS_ops && root_loc.ops != &fifoIMFS_ops) return -1; 8000e28: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED nblocks = (((file_size) + 511) & ~511) / 512; offset += 512 * nblocks; } } return status; } 8000e2c: b9 80 08 00 mv r1,r12 8000e30: 2b 9d 00 04 lw ra,(sp+4) 8000e34: 2b 8b 00 44 lw r11,(sp+68) 8000e38: 2b 8c 00 40 lw r12,(sp+64) 8000e3c: 2b 8d 00 3c lw r13,(sp+60) 8000e40: 2b 8e 00 38 lw r14,(sp+56) 8000e44: 2b 8f 00 34 lw r15,(sp+52) 8000e48: 2b 90 00 30 lw r16,(sp+48) 8000e4c: 2b 91 00 2c lw r17,(sp+44) 8000e50: 2b 92 00 28 lw r18,(sp+40) 8000e54: 2b 93 00 24 lw r19,(sp+36) 8000e58: 2b 94 00 20 lw r20,(sp+32) 8000e5c: 2b 95 00 1c lw r21,(sp+28) 8000e60: 2b 96 00 18 lw r22,(sp+24) 8000e64: 2b 97 00 14 lw r23,(sp+20) 8000e68: 2b 98 00 10 lw r24,(sp+16) 8000e6c: 2b 99 00 0c lw r25,(sp+12) 8000e70: 2b 9b 00 08 lw fp,(sp+8) 8000e74: 37 9c 01 e0 addi sp,sp,480 8000e78: c3 a0 00 00 ret =============================================================================== 0800de08 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 800de08: 37 9c ff e0 addi sp,sp,-32 800de0c: 5b 8b 00 20 sw (sp+32),r11 800de10: 5b 8c 00 1c sw (sp+28),r12 800de14: 5b 8d 00 18 sw (sp+24),r13 800de18: 5b 8e 00 14 sw (sp+20),r14 800de1c: 5b 8f 00 10 sw (sp+16),r15 800de20: 5b 90 00 0c sw (sp+12),r16 800de24: 5b 91 00 08 sw (sp+8),r17 800de28: 5b 9d 00 04 sw (sp+4),ra bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; 800de2c: 34 04 00 09 mvi r4,9 rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 800de30: b8 20 68 00 mv r13,r1 800de34: b8 40 70 00 mv r14,r2 800de38: b8 60 80 00 mv r16,r3 ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) 800de3c: 44 60 00 55 be r3,r0,800df90 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 800de40: 78 01 08 01 mvhi r1,0x801 800de44: 38 21 9d fc ori r1,r1,0x9dfc 800de48: 28 2c 00 0c lw r12,(r1+12) api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 800de4c: 41 8f 00 74 lbu r15,(r12+116) if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 800de50: 29 81 00 7c lw r1,(r12+124) if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 800de54: 29 8b 01 28 lw r11,(r12+296) asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 800de58: 65 ef 00 00 cmpei r15,r15,0 800de5c: c8 0f 78 00 sub r15,r0,r15 800de60: 21 ef 01 00 andi r15,r15,0x100 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 800de64: 44 20 00 02 be r1,r0,800de6c old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 800de68: 39 ef 02 00 ori r15,r15,0x200 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 800de6c: 41 71 00 08 lbu r17,(r11+8) old_mode |= _ISR_Get_level(); 800de70: fb ff e7 ef calli 8007e2c <_CPU_ISR_Get_level> if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 800de74: 66 31 00 00 cmpei r17,r17,0 800de78: c8 11 88 00 sub r17,r0,r17 800de7c: 22 31 04 00 andi r17,r17,0x400 800de80: ba 21 08 00 or r1,r17,r1 old_mode |= _ISR_Get_level(); 800de84: b8 2f 78 00 or r15,r1,r15 *previous_mode_set = old_mode; 800de88: 5a 0f 00 00 sw (r16+0),r15 /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 800de8c: 21 c1 01 00 andi r1,r14,0x100 800de90: 44 20 00 04 be r1,r0,800dea0 */ RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt ( Modes_Control mode_set ) { return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT; 800de94: 21 a1 01 00 andi r1,r13,0x100 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 800de98: 64 21 00 00 cmpei r1,r1,0 800de9c: 31 81 00 74 sb (r12+116),r1 if ( mask & RTEMS_TIMESLICE_MASK ) { 800dea0: 21 c1 02 00 andi r1,r14,0x200 800dea4: 44 20 00 0b be r1,r0,800ded0 */ RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice ( Modes_Control mode_set ) { return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE; 800dea8: 21 a1 02 00 andi r1,r13,0x200 if ( _Modes_Is_timeslice(mode_set) ) { 800deac: 44 20 00 08 be r1,r0,800decc executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 800deb0: 34 01 00 01 mvi r1,1 800deb4: 59 81 00 7c sw (r12+124),r1 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 800deb8: 78 01 08 01 mvhi r1,0x801 800debc: 38 21 98 bc ori r1,r1,0x98bc 800dec0: 28 21 00 00 lw r1,(r1+0) 800dec4: 59 81 00 78 sw (r12+120),r1 800dec8: e0 00 00 02 bi 800ded0 } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 800decc: 59 80 00 7c sw (r12+124),r0 /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 800ded0: 21 c1 00 01 andi r1,r14,0x1 800ded4: 44 20 00 04 be r1,r0,800dee4 */ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level ( Modes_Control mode_set ) { return ( mode_set & RTEMS_INTERRUPT_MASK ); 800ded8: 21 a1 00 01 andi r1,r13,0x1 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 800dedc: 64 21 00 00 cmpei r1,r1,0 800dee0: d0 01 00 00 wcsr IE,r1 */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 800dee4: 21 ce 04 00 andi r14,r14,0x400 /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 800dee8: 34 03 00 00 mvi r3,0 if ( mask & RTEMS_ASR_MASK ) { 800deec: 45 c0 00 11 be r14,r0,800df30 */ RTEMS_INLINE_ROUTINE bool _Modes_Is_asr_disabled ( Modes_Control mode_set ) { return (mode_set & RTEMS_ASR_MASK) == RTEMS_NO_ASR; 800def0: 21 ad 04 00 andi r13,r13,0x400 is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 800def4: 41 61 00 08 lbu r1,(r11+8) * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 800def8: 65 ad 00 00 cmpei r13,r13,0 is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 800defc: 44 2d 00 0d be r1,r13,800df30 asr->is_enabled = is_asr_enabled; 800df00: 31 6d 00 08 sb (r11+8),r13 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 800df04: 90 00 08 00 rcsr r1,IE 800df08: 34 02 ff fe mvi r2,-2 800df0c: a0 22 10 00 and r2,r1,r2 800df10: d0 02 00 00 wcsr IE,r2 _signals = information->signals_pending; 800df14: 29 62 00 18 lw r2,(r11+24) information->signals_pending = information->signals_posted; 800df18: 29 63 00 14 lw r3,(r11+20) information->signals_posted = _signals; 800df1c: 59 62 00 14 sw (r11+20),r2 rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); _signals = information->signals_pending; information->signals_pending = information->signals_posted; 800df20: 59 63 00 18 sw (r11+24),r3 information->signals_posted = _signals; _ISR_Enable( _level ); 800df24: d0 01 00 00 wcsr IE,r1 _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { 800df28: 29 63 00 14 lw r3,(r11+20) /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 800df2c: 7c 63 00 00 cmpnei r3,r3,0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) 800df30: 78 01 08 01 mvhi r1,0x801 800df34: 38 21 9a a4 ori r1,r1,0x9aa4 800df38: 28 22 00 00 lw r2,(r1+0) 800df3c: 34 01 00 03 mvi r1,3 if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) _Thread_Dispatch(); return RTEMS_SUCCESSFUL; 800df40: 34 04 00 00 mvi r4,0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) 800df44: 5c 41 00 13 bne r2,r1,800df90 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE bool _Thread_Evaluate_mode( void ) { Thread_Control *executing; executing = _Thread_Executing; 800df48: 78 02 08 01 mvhi r2,0x801 800df4c: 38 42 9d fc ori r2,r2,0x9dfc 800df50: 28 41 00 0c lw r1,(r2+12) if ( !_States_Is_ready( executing->current_state ) || 800df54: 28 24 00 10 lw r4,(r1+16) 800df58: 5c 80 00 05 bne r4,r0,800df6c <== NEVER TAKEN 800df5c: 28 42 00 10 lw r2,(r2+16) 800df60: 44 22 00 08 be r1,r2,800df80 ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { 800df64: 40 21 00 74 lbu r1,(r1+116) 800df68: 44 20 00 06 be r1,r0,800df80 <== NEVER TAKEN _Context_Switch_necessary = true; 800df6c: 78 01 08 01 mvhi r1,0x801 800df70: 38 21 9d fc ori r1,r1,0x9dfc 800df74: 34 02 00 01 mvi r2,1 800df78: 30 22 00 18 sb (r1+24),r2 800df7c: e0 00 00 03 bi 800df88 if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) _Thread_Dispatch(); return RTEMS_SUCCESSFUL; 800df80: 34 04 00 00 mvi r4,0 } } } if ( _System_state_Is_up( _System_state_Get() ) ) if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) 800df84: 44 60 00 03 be r3,r0,800df90 _Thread_Dispatch(); 800df88: fb ff e1 27 calli 8006424 <_Thread_Dispatch> return RTEMS_SUCCESSFUL; 800df8c: 34 04 00 00 mvi r4,0 } 800df90: b8 80 08 00 mv r1,r4 800df94: 2b 9d 00 04 lw ra,(sp+4) 800df98: 2b 8b 00 20 lw r11,(sp+32) 800df9c: 2b 8c 00 1c lw r12,(sp+28) 800dfa0: 2b 8d 00 18 lw r13,(sp+24) 800dfa4: 2b 8e 00 14 lw r14,(sp+20) 800dfa8: 2b 8f 00 10 lw r15,(sp+16) 800dfac: 2b 90 00 0c lw r16,(sp+12) 800dfb0: 2b 91 00 08 lw r17,(sp+8) 800dfb4: 37 9c 00 20 addi sp,sp,32 800dfb8: c3 a0 00 00 ret =============================================================================== 08008538 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 8008538: 37 9c ff f0 addi sp,sp,-16 800853c: 5b 8b 00 0c sw (sp+12),r11 8008540: 5b 8c 00 08 sw (sp+8),r12 8008544: 5b 9d 00 04 sw (sp+4),ra 8008548: b8 40 58 00 mv r11,r2 800854c: b8 60 60 00 mv r12,r3 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 8008550: 44 40 00 06 be r2,r0,8008568 RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && ( the_priority <= RTEMS_MAXIMUM_PRIORITY ) ); 8008554: 78 02 08 01 mvhi r2,0x801 8008558: 38 42 a0 c0 ori r2,r2,0xa0c0 800855c: 40 43 00 00 lbu r3,(r2+0) !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; 8008560: 34 02 00 13 mvi r2,19 ) { register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 8008564: 55 63 00 16 bgu r11,r3,80085bc !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) return RTEMS_INVALID_ADDRESS; 8008568: 34 02 00 09 mvi r2,9 if ( new_priority != RTEMS_CURRENT_PRIORITY && !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 800856c: 45 80 00 14 be r12,r0,80085bc return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 8008570: 37 82 00 10 addi r2,sp,16 8008574: f8 00 09 9b calli 800abe0 <_Thread_Get> switch ( location ) { 8008578: 2b 82 00 10 lw r2,(sp+16) 800857c: 5c 40 00 0f bne r2,r0,80085b8 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 8008580: 28 23 00 14 lw r3,(r1+20) 8008584: 59 83 00 00 sw (r12+0),r3 if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 8008588: 45 62 00 09 be r11,r2,80085ac the_thread->real_priority = new_priority; if ( the_thread->resource_count == 0 || 800858c: 28 22 00 1c lw r2,(r1+28) case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; if ( new_priority != RTEMS_CURRENT_PRIORITY ) { the_thread->real_priority = new_priority; 8008590: 58 2b 00 18 sw (r1+24),r11 if ( the_thread->resource_count == 0 || 8008594: 44 40 00 03 be r2,r0,80085a0 8008598: 28 22 00 14 lw r2,(r1+20) 800859c: 51 62 00 04 bgeu r11,r2,80085ac <== ALWAYS TAKEN the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 80085a0: b9 60 10 00 mv r2,r11 80085a4: 34 03 00 00 mvi r3,0 80085a8: f8 00 07 fc calli 800a598 <_Thread_Change_priority> } _Thread_Enable_dispatch(); 80085ac: f8 00 09 80 calli 800abac <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 80085b0: 34 02 00 00 mvi r2,0 80085b4: e0 00 00 02 bi 80085bc case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 80085b8: 34 02 00 04 mvi r2,4 } 80085bc: b8 40 08 00 mv r1,r2 80085c0: 2b 9d 00 04 lw ra,(sp+4) 80085c4: 2b 8b 00 0c lw r11,(sp+12) 80085c8: 2b 8c 00 08 lw r12,(sp+8) 80085cc: 37 9c 00 10 addi sp,sp,16 80085d0: c3 a0 00 00 ret =============================================================================== 080043e8 : #include int rtems_termios_baud_to_index( rtems_termios_baud_t termios_baud ) { 80043e8: b8 20 10 00 mv r2,r1 case B134: baud_index = 4; break; case B150: baud_index = 5; break; case B200: baud_index = 6; break; case B300: baud_index = 7; break; case B600: baud_index = 8; break; case B1200: baud_index = 9; break; 80043ec: 34 01 00 09 mvi r1,9 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 80043f0: 44 41 00 38 be r2,r1,80044d0 80043f4: 48 41 00 19 bg r2,r1,8004458 case B0: baud_index = 0; break; case B50: baud_index = 1; break; case B75: baud_index = 2; break; case B110: baud_index = 3; break; case B134: baud_index = 4; break; 80043f8: 34 01 00 04 mvi r1,4 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 80043fc: 44 41 00 35 be r2,r1,80044d0 8004400: 48 41 00 0c bg r2,r1,8004430 case B0: baud_index = 0; break; case B50: baud_index = 1; break; 8004404: 34 01 00 01 mvi r1,1 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004408: 44 41 00 32 be r2,r1,80044d0 800440c: 48 41 00 04 bg r2,r1,800441c case B0: baud_index = 0; break; 8004410: 34 01 00 00 mvi r1,0 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004414: 5c 40 00 2e bne r2,r0,80044cc 8004418: c3 a0 00 00 ret case B0: baud_index = 0; break; case B50: baud_index = 1; break; case B75: baud_index = 2; break; 800441c: 34 01 00 02 mvi r1,2 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004420: 44 41 00 2c be r2,r1,80044d0 case B0: baud_index = 0; break; case B50: baud_index = 1; break; case B75: baud_index = 2; break; case B110: baud_index = 3; break; 8004424: 34 01 00 03 mvi r1,3 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004428: 5c 41 00 29 bne r2,r1,80044cc <== NEVER TAKEN 800442c: c3 a0 00 00 ret case B50: baud_index = 1; break; case B75: baud_index = 2; break; case B110: baud_index = 3; break; case B134: baud_index = 4; break; case B150: baud_index = 5; break; case B200: baud_index = 6; break; 8004430: 34 01 00 06 mvi r1,6 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004434: 44 41 00 27 be r2,r1,80044d0 8004438: 34 03 00 06 mvi r3,6 case B0: baud_index = 0; break; case B50: baud_index = 1; break; case B75: baud_index = 2; break; case B110: baud_index = 3; break; case B134: baud_index = 4; break; case B150: baud_index = 5; break; 800443c: 34 01 00 05 mvi r1,5 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004440: 48 62 00 24 bg r3,r2,80044d0 case B75: baud_index = 2; break; case B110: baud_index = 3; break; case B134: baud_index = 4; break; case B150: baud_index = 5; break; case B200: baud_index = 6; break; case B300: baud_index = 7; break; 8004444: 34 01 00 07 mvi r1,7 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004448: 44 41 00 22 be r2,r1,80044d0 case B110: baud_index = 3; break; case B134: baud_index = 4; break; case B150: baud_index = 5; break; case B200: baud_index = 6; break; case B300: baud_index = 7; break; case B600: baud_index = 8; break; 800444c: 34 01 00 08 mvi r1,8 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004450: 5c 41 00 1f bne r2,r1,80044cc <== NEVER TAKEN 8004454: c3 a0 00 00 ret case B1200: baud_index = 9; break; case B1800: baud_index = 10; break; case B2400: baud_index = 11; break; case B4800: baud_index = 12; break; case B9600: baud_index = 13; break; case B19200: baud_index = 14; break; 8004458: 34 01 00 0e mvi r1,14 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 800445c: 44 41 00 1d be r2,r1,80044d0 8004460: 48 41 00 0b bg r2,r1,800448c case B200: baud_index = 6; break; case B300: baud_index = 7; break; case B600: baud_index = 8; break; case B1200: baud_index = 9; break; case B1800: baud_index = 10; break; case B2400: baud_index = 11; break; 8004464: 34 01 00 0b mvi r1,11 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004468: 44 41 00 1a be r2,r1,80044d0 800446c: 34 03 00 0b mvi r3,11 case B150: baud_index = 5; break; case B200: baud_index = 6; break; case B300: baud_index = 7; break; case B600: baud_index = 8; break; case B1200: baud_index = 9; break; case B1800: baud_index = 10; break; 8004470: 34 01 00 0a mvi r1,10 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004474: 48 62 00 17 bg r3,r2,80044d0 case B300: baud_index = 7; break; case B600: baud_index = 8; break; case B1200: baud_index = 9; break; case B1800: baud_index = 10; break; case B2400: baud_index = 11; break; case B4800: baud_index = 12; break; 8004478: 34 01 00 0c mvi r1,12 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 800447c: 44 41 00 15 be r2,r1,80044d0 case B600: baud_index = 8; break; case B1200: baud_index = 9; break; case B1800: baud_index = 10; break; case B2400: baud_index = 11; break; case B4800: baud_index = 12; break; case B9600: baud_index = 13; break; 8004480: 34 01 00 0d mvi r1,13 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004484: 5c 41 00 12 bne r2,r1,80044cc <== NEVER TAKEN 8004488: c3 a0 00 00 ret 800448c: 34 03 10 02 mvi r3,4098 case B4800: baud_index = 12; break; case B9600: baud_index = 13; break; case B19200: baud_index = 14; break; case B38400: baud_index = 15; break; case B57600: baud_index = 16; break; case B115200: baud_index = 17; break; 8004490: 34 01 00 11 mvi r1,17 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004494: 44 43 00 0f be r2,r3,80044d0 8004498: 48 43 00 07 bg r2,r3,80044b4 case B1800: baud_index = 10; break; case B2400: baud_index = 11; break; case B4800: baud_index = 12; break; case B9600: baud_index = 13; break; case B19200: baud_index = 14; break; case B38400: baud_index = 15; break; 800449c: 34 01 00 0f mvi r1,15 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 80044a0: 44 41 00 0c be r2,r1,80044d0 80044a4: 34 03 10 01 mvi r3,4097 case B2400: baud_index = 11; break; case B4800: baud_index = 12; break; case B9600: baud_index = 13; break; case B19200: baud_index = 14; break; case B38400: baud_index = 15; break; case B57600: baud_index = 16; break; 80044a8: 34 01 00 10 mvi r1,16 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 80044ac: 5c 43 00 08 bne r2,r3,80044cc <== NEVER TAKEN 80044b0: c3 a0 00 00 ret 80044b4: 34 03 10 03 mvi r3,4099 case B9600: baud_index = 13; break; case B19200: baud_index = 14; break; case B38400: baud_index = 15; break; case B57600: baud_index = 16; break; case B115200: baud_index = 17; break; case B230400: baud_index = 18; break; 80044b8: 34 01 00 12 mvi r1,18 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 80044bc: 44 43 00 05 be r2,r3,80044d0 80044c0: 34 03 10 04 mvi r3,4100 case B19200: baud_index = 14; break; case B38400: baud_index = 15; break; case B57600: baud_index = 16; break; case B115200: baud_index = 17; break; case B230400: baud_index = 18; break; case B460800: baud_index = 19; break; 80044c4: 34 01 00 13 mvi r1,19 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 80044c8: 44 43 00 02 be r2,r3,80044d0 <== ALWAYS TAKEN case B38400: baud_index = 15; break; case B57600: baud_index = 16; break; case B115200: baud_index = 17; break; case B230400: baud_index = 18; break; case B460800: baud_index = 19; break; default: baud_index = -1; break; 80044cc: 34 01 ff ff mvi r1,-1 } return baud_index; } 80044d0: c3 a0 00 00 ret =============================================================================== 080044d4 : int termios_baud ) { int32_t baud; switch (termios_baud) { 80044d4: 34 03 00 09 mvi r3,9 case B134: baud = 134; break; case B150: baud = 150; break; case B200: baud = 200; break; case B300: baud = 300; break; case B600: baud = 600; break; case B1200: baud = 1200; break; 80044d8: 34 02 04 b0 mvi r2,1200 int termios_baud ) { int32_t baud; switch (termios_baud) { 80044dc: 44 23 00 44 be r1,r3,80045ec 80044e0: 48 23 00 1d bg r1,r3,8004554 80044e4: 34 03 00 04 mvi r3,4 case B0: baud = 0; break; case B50: baud = 50; break; case B75: baud = 75; break; case B110: baud = 110; break; case B134: baud = 134; break; 80044e8: 34 02 00 86 mvi r2,134 int termios_baud ) { int32_t baud; switch (termios_baud) { 80044ec: 44 23 00 40 be r1,r3,80045ec 80044f0: 48 23 00 0e bg r1,r3,8004528 80044f4: 34 03 00 01 mvi r3,1 case B0: baud = 0; break; case B50: baud = 50; break; 80044f8: 34 02 00 32 mvi r2,50 int termios_baud ) { int32_t baud; switch (termios_baud) { 80044fc: 44 23 00 3c be r1,r3,80045ec 8004500: 48 23 00 04 bg r1,r3,8004510 case B0: baud = 0; break; 8004504: 34 02 00 00 mvi r2,0 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004508: 5c 20 00 38 bne r1,r0,80045e8 800450c: e0 00 00 38 bi 80045ec 8004510: 34 03 00 02 mvi r3,2 case B0: baud = 0; break; case B50: baud = 50; break; case B75: baud = 75; break; 8004514: 34 02 00 4b mvi r2,75 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004518: 44 23 00 35 be r1,r3,80045ec case B0: baud = 0; break; case B50: baud = 50; break; case B75: baud = 75; break; case B110: baud = 110; break; 800451c: 34 02 00 6e mvi r2,110 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004520: 34 03 00 03 mvi r3,3 8004524: e0 00 00 30 bi 80045e4 8004528: 34 03 00 06 mvi r3,6 case B50: baud = 50; break; case B75: baud = 75; break; case B110: baud = 110; break; case B134: baud = 134; break; case B150: baud = 150; break; case B200: baud = 200; break; 800452c: 34 02 00 c8 mvi r2,200 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004530: 44 23 00 2f be r1,r3,80045ec case B0: baud = 0; break; case B50: baud = 50; break; case B75: baud = 75; break; case B110: baud = 110; break; case B134: baud = 134; break; case B150: baud = 150; break; 8004534: 34 02 00 96 mvi r2,150 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004538: 48 61 00 2d bg r3,r1,80045ec 800453c: 34 03 00 07 mvi r3,7 case B75: baud = 75; break; case B110: baud = 110; break; case B134: baud = 134; break; case B150: baud = 150; break; case B200: baud = 200; break; case B300: baud = 300; break; 8004540: 34 02 01 2c mvi r2,300 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004544: 44 23 00 2a be r1,r3,80045ec case B110: baud = 110; break; case B134: baud = 134; break; case B150: baud = 150; break; case B200: baud = 200; break; case B300: baud = 300; break; case B600: baud = 600; break; 8004548: 34 02 02 58 mvi r2,600 int termios_baud ) { int32_t baud; switch (termios_baud) { 800454c: 34 03 00 08 mvi r3,8 8004550: e0 00 00 25 bi 80045e4 8004554: 34 03 00 0e mvi r3,14 case B1200: baud = 1200; break; case B1800: baud = 1800; break; case B2400: baud = 2400; break; case B4800: baud = 4800; break; case B9600: baud = 9600; break; case B19200: baud = 19200; break; 8004558: 34 02 4b 00 mvi r2,19200 int termios_baud ) { int32_t baud; switch (termios_baud) { 800455c: 44 23 00 24 be r1,r3,80045ec 8004560: 48 23 00 0c bg r1,r3,8004590 8004564: 34 03 00 0b mvi r3,11 case B200: baud = 200; break; case B300: baud = 300; break; case B600: baud = 600; break; case B1200: baud = 1200; break; case B1800: baud = 1800; break; case B2400: baud = 2400; break; 8004568: 34 02 09 60 mvi r2,2400 int termios_baud ) { int32_t baud; switch (termios_baud) { 800456c: 44 23 00 20 be r1,r3,80045ec case B150: baud = 150; break; case B200: baud = 200; break; case B300: baud = 300; break; case B600: baud = 600; break; case B1200: baud = 1200; break; case B1800: baud = 1800; break; 8004570: 34 02 07 08 mvi r2,1800 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004574: 48 61 00 1e bg r3,r1,80045ec 8004578: 34 03 00 0c mvi r3,12 case B300: baud = 300; break; case B600: baud = 600; break; case B1200: baud = 1200; break; case B1800: baud = 1800; break; case B2400: baud = 2400; break; case B4800: baud = 4800; break; 800457c: 34 02 12 c0 mvi r2,4800 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004580: 44 23 00 1b be r1,r3,80045ec case B600: baud = 600; break; case B1200: baud = 1200; break; case B1800: baud = 1800; break; case B2400: baud = 2400; break; case B4800: baud = 4800; break; case B9600: baud = 9600; break; 8004584: 34 02 25 80 mvi r2,9600 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004588: 34 03 00 0d mvi r3,13 800458c: e0 00 00 16 bi 80045e4 case B4800: baud = 4800; break; case B9600: baud = 9600; break; case B19200: baud = 19200; break; case B38400: baud = 38400; break; case B57600: baud = 57600; break; case B115200: baud = 115200; break; 8004590: 78 04 08 02 mvhi r4,0x802 8004594: 38 84 04 f4 ori r4,r4,0x4f4 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004598: 34 03 10 02 mvi r3,4098 case B4800: baud = 4800; break; case B9600: baud = 9600; break; case B19200: baud = 19200; break; case B38400: baud = 38400; break; case B57600: baud = 57600; break; case B115200: baud = 115200; break; 800459c: 28 82 00 00 lw r2,(r4+0) int termios_baud ) { int32_t baud; switch (termios_baud) { 80045a0: 44 23 00 13 be r1,r3,80045ec 80045a4: 48 23 00 07 bg r1,r3,80045c0 80045a8: 34 03 00 0f mvi r3,15 case B1800: baud = 1800; break; case B2400: baud = 2400; break; case B4800: baud = 4800; break; case B9600: baud = 9600; break; case B19200: baud = 19200; break; case B38400: baud = 38400; break; 80045ac: 38 02 96 00 mvu r2,0x9600 int termios_baud ) { int32_t baud; switch (termios_baud) { 80045b0: 44 23 00 0f be r1,r3,80045ec case B2400: baud = 2400; break; case B4800: baud = 4800; break; case B9600: baud = 9600; break; case B19200: baud = 19200; break; case B38400: baud = 38400; break; case B57600: baud = 57600; break; 80045b4: 34 42 4b 00 addi r2,r2,19200 int termios_baud ) { int32_t baud; switch (termios_baud) { 80045b8: 34 03 10 01 mvi r3,4097 80045bc: e0 00 00 0a bi 80045e4 case B9600: baud = 9600; break; case B19200: baud = 19200; break; case B38400: baud = 38400; break; case B57600: baud = 57600; break; case B115200: baud = 115200; break; case B230400: baud = 230400; break; 80045c0: 78 03 08 02 mvhi r3,0x802 80045c4: 38 63 0b 70 ori r3,r3,0xb70 80045c8: 28 62 00 00 lw r2,(r3+0) int termios_baud ) { int32_t baud; switch (termios_baud) { 80045cc: 34 03 10 03 mvi r3,4099 80045d0: 44 23 00 07 be r1,r3,80045ec case B19200: baud = 19200; break; case B38400: baud = 38400; break; case B57600: baud = 57600; break; case B115200: baud = 115200; break; case B230400: baud = 230400; break; case B460800: baud = 460800; break; 80045d4: 78 04 08 02 mvhi r4,0x802 80045d8: 38 84 0b 74 ori r4,r4,0xb74 80045dc: 28 82 00 00 lw r2,(r4+0) int termios_baud ) { int32_t baud; switch (termios_baud) { 80045e0: 34 03 10 04 mvi r3,4100 80045e4: 44 23 00 02 be r1,r3,80045ec <== ALWAYS TAKEN case B38400: baud = 38400; break; case B57600: baud = 57600; break; case B115200: baud = 115200; break; case B230400: baud = 230400; break; case B460800: baud = 460800; break; default: baud = -1; break; 80045e8: 34 02 ff ff mvi r2,-1 } return baud; } 80045ec: b8 40 08 00 mv r1,r2 80045f0: c3 a0 00 00 ret =============================================================================== 08004e74 : int cbufsize, int raw_input, int raw_output ) { rtems_termios_cbufsize = cbufsize; 8004e74: 78 04 08 02 mvhi r4,0x802 <== NOT EXECUTED 8004e78: 38 84 32 40 ori r4,r4,0x3240 <== NOT EXECUTED 8004e7c: 58 81 00 00 sw (r4+0),r1 <== NOT EXECUTED rtems_termios_raw_input_size = raw_input; 8004e80: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 8004e84: 38 21 32 44 ori r1,r1,0x3244 <== NOT EXECUTED 8004e88: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rtems_termios_raw_output_size = raw_output; 8004e8c: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 8004e90: 38 21 32 48 ori r1,r1,0x3248 <== NOT EXECUTED 8004e94: 58 23 00 00 sw (r1+0),r3 <== NOT EXECUTED return RTEMS_SUCCESSFUL; } 8004e98: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8004e9c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08004cbc : } } rtems_status_code rtems_termios_close (void *arg) { 8004cbc: 37 9c ff ec addi sp,sp,-20 8004cc0: 5b 8b 00 14 sw (sp+20),r11 8004cc4: 5b 8c 00 10 sw (sp+16),r12 8004cc8: 5b 8d 00 0c sw (sp+12),r13 8004ccc: 5b 8e 00 08 sw (sp+8),r14 8004cd0: 5b 9d 00 04 sw (sp+4),ra 8004cd4: b8 20 70 00 mv r14,r1 rtems_libio_open_close_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8004cd8: 28 21 00 00 lw r1,(r1+0) rtems_status_code sc; sc = rtems_semaphore_obtain( 8004cdc: 78 02 08 02 mvhi r2,0x802 8004ce0: 38 42 39 d8 ori r2,r2,0x39d8 rtems_status_code rtems_termios_close (void *arg) { rtems_libio_open_close_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8004ce4: 28 2b 00 38 lw r11,(r1+56) rtems_status_code sc; sc = rtems_semaphore_obtain( 8004ce8: 28 41 00 00 lw r1,(r2+0) 8004cec: 34 03 00 00 mvi r3,0 8004cf0: 34 02 00 00 mvi r2,0 8004cf4: f8 00 08 bf calli 8006ff0 rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 8004cf8: 5c 20 00 23 bne r1,r0,8004d84 <== NEVER TAKEN rtems_fatal_error_occurred (sc); if (--tty->refcount == 0) { 8004cfc: 29 6d 00 08 lw r13,(r11+8) 8004d00: 35 ad ff ff addi r13,r13,-1 8004d04: 59 6d 00 08 sw (r11+8),r13 8004d08: 5d a1 00 4f bne r13,r1,8004e44 <== NEVER TAKEN if (rtems_termios_linesw[tty->t_line].l_close != NULL) { 8004d0c: 29 61 00 cc lw r1,(r11+204) 8004d10: 78 0c 08 02 mvhi r12,0x802 8004d14: 34 02 00 05 mvi r2,5 8004d18: 39 8c 38 10 ori r12,r12,0x3810 8004d1c: fb ff f2 d6 calli 8001874 <__ashlsi3> 8004d20: b5 81 08 00 add r1,r12,r1 8004d24: 28 2c 00 04 lw r12,(r1+4) 8004d28: 45 8d 00 04 be r12,r13,8004d38 /* * call discipline-specific close */ sc = rtems_termios_linesw[tty->t_line].l_close(tty); 8004d2c: b9 60 08 00 mv r1,r11 8004d30: d9 80 00 00 call r12 8004d34: e0 00 00 08 bi 8004d54 } else { /* * default: just flush output buffer */ sc = rtems_semaphore_obtain(tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8004d38: 29 61 00 18 lw r1,(r11+24) 8004d3c: 34 02 00 00 mvi r2,0 8004d40: 34 03 00 00 mvi r3,0 8004d44: f8 00 08 ab calli 8006ff0 if (sc != RTEMS_SUCCESSFUL) { 8004d48: 5d 81 00 0f bne r12,r1,8004d84 <== NEVER TAKEN rtems_fatal_error_occurred (sc); } drainOutput (tty); 8004d4c: b9 60 08 00 mv r1,r11 8004d50: fb ff fe 89 calli 8004774 } if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 8004d54: 29 62 00 b4 lw r2,(r11+180) 8004d58: 34 01 00 02 mvi r1,2 8004d5c: 5c 41 00 0b bne r2,r1,8004d88 /* * send "terminate" to I/O tasks */ sc = rtems_event_send( tty->rxTaskId, TERMIOS_RX_TERMINATE_EVENT ); 8004d60: 29 61 00 c4 lw r1,(r11+196) 8004d64: 34 02 00 01 mvi r2,1 8004d68: f8 00 07 56 calli 8006ac0 8004d6c: b8 20 60 00 mv r12,r1 if (sc != RTEMS_SUCCESSFUL) 8004d70: 5c 20 00 05 bne r1,r0,8004d84 <== NEVER TAKEN rtems_fatal_error_occurred (sc); sc = rtems_event_send( tty->txTaskId, TERMIOS_TX_TERMINATE_EVENT ); 8004d74: 29 61 00 c8 lw r1,(r11+200) 8004d78: 34 02 00 01 mvi r2,1 8004d7c: f8 00 07 51 calli 8006ac0 if (sc != RTEMS_SUCCESSFUL) 8004d80: 44 2c 00 02 be r1,r12,8004d88 <== ALWAYS TAKEN rtems_fatal_error_occurred (sc); 8004d84: f8 00 0a 78 calli 8007764 <== NOT EXECUTED } if (tty->device.lastClose) 8004d88: 29 64 00 9c lw r4,(r11+156) 8004d8c: 44 80 00 05 be r4,r0,8004da0 <== ALWAYS TAKEN (*tty->device.lastClose)(tty->major, tty->minor, arg); 8004d90: 29 61 00 0c lw r1,(r11+12) <== NOT EXECUTED 8004d94: 29 62 00 10 lw r2,(r11+16) <== NOT EXECUTED 8004d98: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED 8004d9c: d8 80 00 00 call r4 <== NOT EXECUTED if (tty->forw == NULL) { 8004da0: 29 62 00 00 lw r2,(r11+0) 8004da4: 29 61 00 04 lw r1,(r11+4) 8004da8: 5c 40 00 07 bne r2,r0,8004dc4 <== NEVER TAKEN rtems_termios_ttyTail = tty->back; 8004dac: 78 03 08 02 mvhi r3,0x802 8004db0: 38 63 39 dc ori r3,r3,0x39dc 8004db4: 58 61 00 00 sw (r3+0),r1 if ( rtems_termios_ttyTail != NULL ) { 8004db8: 44 22 00 04 be r1,r2,8004dc8 <== ALWAYS TAKEN rtems_termios_ttyTail->forw = NULL; 8004dbc: 58 20 00 00 sw (r1+0),r0 <== NOT EXECUTED 8004dc0: e0 00 00 02 bi 8004dc8 <== NOT EXECUTED } } else { tty->forw->back = tty->back; 8004dc4: 58 41 00 04 sw (r2+4),r1 <== NOT EXECUTED } if (tty->back == NULL) { 8004dc8: 29 62 00 04 lw r2,(r11+4) 8004dcc: 29 61 00 00 lw r1,(r11+0) 8004dd0: 5c 40 00 07 bne r2,r0,8004dec <== NEVER TAKEN rtems_termios_ttyHead = tty->forw; 8004dd4: 78 03 08 02 mvhi r3,0x802 8004dd8: 38 63 39 e0 ori r3,r3,0x39e0 8004ddc: 58 61 00 00 sw (r3+0),r1 if ( rtems_termios_ttyHead != NULL ) { 8004de0: 44 22 00 04 be r1,r2,8004df0 <== ALWAYS TAKEN rtems_termios_ttyHead->back = NULL; 8004de4: 58 20 00 04 sw (r1+4),r0 <== NOT EXECUTED 8004de8: e0 00 00 02 bi 8004df0 <== NOT EXECUTED } } else { tty->back->forw = tty->forw; 8004dec: 58 41 00 00 sw (r2+0),r1 <== NOT EXECUTED } rtems_semaphore_delete (tty->isem); 8004df0: 29 61 00 14 lw r1,(r11+20) 8004df4: f8 00 08 50 calli 8006f34 rtems_semaphore_delete (tty->osem); 8004df8: 29 61 00 18 lw r1,(r11+24) 8004dfc: f8 00 08 4e calli 8006f34 rtems_semaphore_delete (tty->rawOutBuf.Semaphore); 8004e00: 29 61 00 8c lw r1,(r11+140) 8004e04: f8 00 08 4c calli 8006f34 if ((tty->device.pollRead == NULL) || 8004e08: 29 61 00 a0 lw r1,(r11+160) 8004e0c: 44 20 00 04 be r1,r0,8004e1c 8004e10: 29 62 00 b4 lw r2,(r11+180) 8004e14: 34 01 00 02 mvi r1,2 8004e18: 5c 41 00 03 bne r2,r1,8004e24 (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)) rtems_semaphore_delete (tty->rawInBuf.Semaphore); 8004e1c: 29 61 00 68 lw r1,(r11+104) 8004e20: f8 00 08 45 calli 8006f34 free (tty->rawInBuf.theBuf); 8004e24: 29 61 00 58 lw r1,(r11+88) 8004e28: fb ff f8 42 calli 8002f30 free (tty->rawOutBuf.theBuf); 8004e2c: 29 61 00 7c lw r1,(r11+124) 8004e30: fb ff f8 40 calli 8002f30 free (tty->cbuf); 8004e34: 29 61 00 1c lw r1,(r11+28) 8004e38: fb ff f8 3e calli 8002f30 free (tty); 8004e3c: b9 60 08 00 mv r1,r11 8004e40: fb ff f8 3c calli 8002f30 } rtems_semaphore_release (rtems_termios_ttyMutex); 8004e44: 78 01 08 02 mvhi r1,0x802 8004e48: 38 21 39 d8 ori r1,r1,0x39d8 8004e4c: 28 21 00 00 lw r1,(r1+0) 8004e50: f8 00 08 b8 calli 8007130 return RTEMS_SUCCESSFUL; } 8004e54: 34 01 00 00 mvi r1,0 8004e58: 2b 9d 00 04 lw ra,(sp+4) 8004e5c: 2b 8b 00 14 lw r11,(sp+20) 8004e60: 2b 8c 00 10 lw r12,(sp+16) 8004e64: 2b 8d 00 0c lw r13,(sp+12) 8004e68: 2b 8e 00 08 lw r14,(sp+8) 8004e6c: 37 9c 00 14 addi sp,sp,20 8004e70: c3 a0 00 00 ret =============================================================================== 08006478 : * for each transmitted character. * It returns number of characters left to transmit */ int rtems_termios_dequeue_characters (void *ttyp, int len) { 8006478: 37 9c ff f8 addi sp,sp,-8 800647c: 5b 8b 00 08 sw (sp+8),r11 8006480: 5b 9d 00 04 sw (sp+4),ra rtems_status_code sc; /* * sum up character count already sent */ tty->t_dqlen += len; 8006484: 28 24 00 90 lw r4,(r1+144) 8006488: b4 82 10 00 add r2,r4,r2 if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 800648c: 28 24 00 b4 lw r4,(r1+180) rtems_status_code sc; /* * sum up character count already sent */ tty->t_dqlen += len; 8006490: 58 22 00 90 sw (r1+144),r2 if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 8006494: 34 02 00 02 mvi r2,2 8006498: 5c 82 00 06 bne r4,r2,80064b0 /* * send wake up to transmitter task */ sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT); 800649c: 28 21 00 c8 lw r1,(r1+200) if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); return 0; /* nothing to output in IRQ... */ 80064a0: 34 0b 00 00 mvi r11,0 if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { /* * send wake up to transmitter task */ sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT); 80064a4: f8 00 01 87 calli 8006ac0 if (sc != RTEMS_SUCCESSFUL) 80064a8: 44 20 00 0e be r1,r0,80064e0 <== ALWAYS TAKEN rtems_fatal_error_occurred (sc); 80064ac: f8 00 04 ae calli 8007764 <== NOT EXECUTED return 0; /* nothing to output in IRQ... */ } if (tty->t_line == PPPDISC ) { 80064b0: 28 23 00 cc lw r3,(r1+204) 80064b4: 34 02 00 05 mvi r2,5 80064b8: 5c 62 00 08 bne r3,r2,80064d8 /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 80064bc: 78 02 08 02 mvhi r2,0x802 80064c0: 38 42 38 10 ori r2,r2,0x3810 80064c4: 28 42 00 b4 lw r2,(r2+180) rtems_termios_linesw[tty->t_line].l_start(tty); } return 0; /* nothing to output in IRQ... */ 80064c8: 34 0b 00 00 mvi r11,0 if (tty->t_line == PPPDISC ) { /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 80064cc: 44 40 00 05 be r2,r0,80064e0 <== NEVER TAKEN rtems_termios_linesw[tty->t_line].l_start(tty); 80064d0: d8 40 00 00 call r2 80064d4: e0 00 00 03 bi 80064e0 } return 0; /* nothing to output in IRQ... */ } return rtems_termios_refill_transmitter(tty); 80064d8: fb ff ff 4a calli 8006200 80064dc: b8 20 58 00 mv r11,r1 } 80064e0: b9 60 08 00 mv r1,r11 80064e4: 2b 9d 00 04 lw ra,(sp+4) 80064e8: 2b 8b 00 08 lw r11,(sp+8) 80064ec: 37 9c 00 08 addi sp,sp,8 80064f0: c3 a0 00 00 ret =============================================================================== 08005e60 : * 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) { 8005e60: 37 9c ff bc addi sp,sp,-68 8005e64: 5b 8b 00 44 sw (sp+68),r11 8005e68: 5b 8c 00 40 sw (sp+64),r12 8005e6c: 5b 8d 00 3c sw (sp+60),r13 8005e70: 5b 8e 00 38 sw (sp+56),r14 8005e74: 5b 8f 00 34 sw (sp+52),r15 8005e78: 5b 90 00 30 sw (sp+48),r16 8005e7c: 5b 91 00 2c sw (sp+44),r17 8005e80: 5b 92 00 28 sw (sp+40),r18 8005e84: 5b 93 00 24 sw (sp+36),r19 8005e88: 5b 94 00 20 sw (sp+32),r20 8005e8c: 5b 95 00 1c sw (sp+28),r21 8005e90: 5b 96 00 18 sw (sp+24),r22 8005e94: 5b 97 00 14 sw (sp+20),r23 8005e98: 5b 98 00 10 sw (sp+16),r24 8005e9c: 5b 99 00 0c sw (sp+12),r25 8005ea0: 5b 9b 00 08 sw (sp+8),fp 8005ea4: 5b 9d 00 04 sw (sp+4),ra 8005ea8: b8 20 58 00 mv r11,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) { 8005eac: 28 21 00 cc lw r1,(r1+204) * 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) { 8005eb0: b8 40 68 00 mv r13,r2 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) { 8005eb4: 78 0c 08 02 mvhi r12,0x802 8005eb8: 34 02 00 05 mvi r2,5 * 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) { 8005ebc: b8 60 78 00 mv r15,r3 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) { 8005ec0: 39 8c 38 10 ori r12,r12,0x3810 8005ec4: fb ff ee 6c calli 8001874 <__ashlsi3> 8005ec8: b5 81 08 00 add r1,r12,r1 8005ecc: 28 21 00 10 lw r1,(r1+16) 8005ed0: b9 e0 70 00 mv r14,r15 8005ed4: 5c 20 00 17 bne r1,r0,8005f30 8005ed8: 34 12 00 00 mvi r18,0 8005edc: 34 0c 00 00 mvi r12,0 flow_rcv = true; } } if (flow_rcv) { /* restart output according to FL_ORCVXOF flag */ if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) { 8005ee0: 34 1b 00 20 mvi fp,32 /* disable interrupts */ rtems_interrupt_disable(level); 8005ee4: 34 11 ff fe mvi r17,-2 tty->flow_ctrl &= ~FL_OSTOP; 8005ee8: 34 19 ff df mvi r25,-33 /* * 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); 8005eec: 35 78 00 30 addi r24,r11,48 if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size) % tty->rawInBuf.Size) > tty->highwater) && !(tty->flow_ctrl & FL_IREQXOF)) { /* incoming data stream should be stopped */ tty->flow_ctrl |= FL_IREQXOF; if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF)) 8005ef0: 34 17 04 00 mvi r23,1024 /* 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) ) { 8005ef4: 34 16 01 00 mvi r22,256 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, 8005ef8: 35 75 00 4a addi r21,r11,74 flow_rcv = true; } else if (c == tty->termios.c_cc[VSTART]) { /* VSTART received */ /* restart output */ tty->flow_ctrl &= ~FL_ORCVXOF; 8005efc: 34 14 ff ef mvi r20,-17 8005f00: e0 00 00 87 bi 800611c rtems_interrupt_level level; if (rtems_termios_linesw[tty->t_line].l_rint != NULL) { while (len--) { c = *buf++; rtems_termios_linesw[tty->t_line].l_rint(c,tty); 8005f04: 29 61 00 cc lw r1,(r11+204) 8005f08: 34 02 00 05 mvi r2,5 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--) { c = *buf++; 8005f0c: 41 af 00 00 lbu r15,(r13+0) rtems_termios_linesw[tty->t_line].l_rint(c,tty); 8005f10: fb ff ee 59 calli 8001874 <__ashlsi3> 8005f14: b5 81 10 00 add r2,r12,r1 8005f18: 28 43 00 10 lw r3,(r2+16) 8005f1c: b9 e0 08 00 mv r1,r15 8005f20: b9 60 10 00 mv r2,r11 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--) { c = *buf++; 8005f24: 35 ad 00 01 addi r13,r13,1 rtems_termios_linesw[tty->t_line].l_rint(c,tty); 8005f28: d8 60 00 00 call r3 8005f2c: 35 ce ff ff addi r14,r14,-1 int dropped = 0; bool flow_rcv = false; /* true, if flow control char received */ rtems_interrupt_level level; if (rtems_termios_linesw[tty->t_line].l_rint != NULL) { while (len--) { 8005f30: 5d c0 ff f5 bne r14,r0,8005f04 } /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { 8005f34: 29 61 00 e4 lw r1,(r11+228) (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); tty->tty_rcvwakeup = 1; } return 0; 8005f38: 34 0c 00 00 mvi r12,0 } /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { 8005f3c: 5c 2c 00 7e bne r1,r12,8006134 <== NEVER TAKEN 8005f40: 29 63 00 dc lw r3,(r11+220) (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); tty->tty_rcvwakeup = 1; } return 0; 8005f44: b9 c0 60 00 mv r12,r14 } /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { 8005f48: 44 60 00 7b be r3,r0,8006134 <== ALWAYS TAKEN (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); 8005f4c: 29 62 00 e0 lw r2,(r11+224) <== NOT EXECUTED 8005f50: 35 61 00 30 addi r1,r11,48 <== NOT EXECUTED 8005f54: d8 60 00 00 call r3 <== NOT EXECUTED tty->tty_rcvwakeup = 1; 8005f58: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8005f5c: 59 61 00 e4 sw (r11+228),r1 <== NOT EXECUTED 8005f60: e0 00 00 75 bi 8006134 <== NOT EXECUTED while (len--) { c = *buf++; /* FIXME: implement IXANY: any character restarts output */ /* if incoming XON/XOFF controls outgoing stream: */ if (tty->flow_ctrl & FL_MDXON) { 8005f64: 29 61 00 b8 lw r1,(r11+184) } return 0; } while (len--) { c = *buf++; 8005f68: 41 b0 00 00 lbu r16,(r13+0) 8005f6c: 35 ad 00 01 addi r13,r13,1 /* FIXME: implement IXANY: any character restarts output */ /* if incoming XON/XOFF controls outgoing stream: */ if (tty->flow_ctrl & FL_MDXON) { 8005f70: 20 21 02 00 andi r1,r1,0x200 8005f74: 44 20 00 11 be r1,r0,8005fb8 /* if received char is V_STOP and V_START (both are equal value) */ if (c == tty->termios.c_cc[VSTOP]) { 8005f78: 41 64 00 4a lbu r4,(r11+74) 8005f7c: 41 63 00 49 lbu r3,(r11+73) 8005f80: 5c 90 00 0a bne r4,r16,8005fa8 <== ALWAYS TAKEN if (c == tty->termios.c_cc[VSTART]) { 8005f84: 5c 64 00 04 bne r3,r4,8005f94 <== NOT EXECUTED /* received VSTOP and VSTART==VSTOP? */ /* then toggle "stop output" status */ tty->flow_ctrl = tty->flow_ctrl ^ FL_ORCVXOF; 8005f88: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8005f8c: 18 21 00 10 xori r1,r1,0x10 <== NOT EXECUTED 8005f90: e0 00 00 03 bi 8005f9c <== NOT EXECUTED } else { /* VSTOP received (other code than VSTART) */ /* stop output */ tty->flow_ctrl |= FL_ORCVXOF; 8005f94: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8005f98: 38 21 00 10 ori r1,r1,0x10 <== NOT EXECUTED 8005f9c: 59 61 00 b8 sw (r11+184),r1 <== 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) { 8005fa0: 34 12 00 01 mvi r18,1 <== NOT EXECUTED 8005fa4: e0 00 00 06 bi 8005fbc <== NOT EXECUTED /* stop output */ tty->flow_ctrl |= FL_ORCVXOF; } flow_rcv = true; } else if (c == tty->termios.c_cc[VSTART]) { 8005fa8: 5c 70 00 04 bne r3,r16,8005fb8 <== ALWAYS TAKEN /* VSTART received */ /* restart output */ tty->flow_ctrl &= ~FL_ORCVXOF; 8005fac: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8005fb0: a0 34 08 00 and r1,r1,r20 <== NOT EXECUTED 8005fb4: e3 ff ff fa bi 8005f9c <== NOT EXECUTED flow_rcv = true; } } if (flow_rcv) { 8005fb8: 46 40 00 15 be r18,r0,800600c <== ALWAYS TAKEN /* restart output according to FL_ORCVXOF flag */ if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) { 8005fbc: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8005fc0: 20 21 00 30 andi r1,r1,0x30 <== NOT EXECUTED 8005fc4: 5c 3b 00 55 bne r1,fp,8006118 <== NOT EXECUTED /* disable interrupts */ rtems_interrupt_disable(level); 8005fc8: 90 00 70 00 rcsr r14,IE <== NOT EXECUTED 8005fcc: a1 d1 08 00 and r1,r14,r17 <== NOT EXECUTED 8005fd0: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED tty->flow_ctrl &= ~FL_OSTOP; 8005fd4: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8005fd8: a0 39 08 00 and r1,r1,r25 <== NOT EXECUTED 8005fdc: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { 8005fe0: 29 61 00 94 lw r1,(r11+148) <== NOT EXECUTED 8005fe4: 44 20 00 08 be r1,r0,8006004 <== NOT EXECUTED /* if chars available, call write function... */ (*tty->device.write)( tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1); 8005fe8: 29 63 00 84 lw r3,(r11+132) <== 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)( 8005fec: 29 62 00 7c lw r2,(r11+124) <== NOT EXECUTED 8005ff0: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED 8005ff4: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8005ff8: b4 43 10 00 add r2,r2,r3 <== NOT EXECUTED 8005ffc: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 8006000: d8 80 00 00 call r4 <== NOT EXECUTED tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1); } /* reenable interrupts */ rtems_interrupt_enable(level); 8006004: d0 0e 00 00 wcsr IE,r14 <== NOT EXECUTED 8006008: e0 00 00 44 bi 8006118 <== NOT EXECUTED } } else { newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size; 800600c: 29 63 00 60 lw r3,(r11+96) 8006010: 29 62 00 64 lw r2,(r11+100) 8006014: 34 61 00 01 addi r1,r3,1 8006018: f8 00 62 51 calli 801e95c <__umodsi3> 800601c: b8 20 70 00 mv r14,r1 /* if chars_in_buffer > highwater */ rtems_interrupt_disable(level); 8006020: 90 00 98 00 rcsr r19,IE 8006024: a2 71 08 00 and r1,r19,r17 8006028: d0 01 00 00 wcsr IE,r1 if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size) 800602c: 29 61 00 5c lw r1,(r11+92) 8006030: 29 63 00 64 lw r3,(r11+100) % tty->rawInBuf.Size) > tty->highwater) && 8006034: 29 62 00 64 lw r2,(r11+100) } } 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) 8006038: c8 61 18 00 sub r3,r3,r1 % tty->rawInBuf.Size) > tty->highwater) && 800603c: b4 6e 08 00 add r1,r3,r14 8006040: f8 00 62 47 calli 801e95c <__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) 8006044: 29 62 00 c0 lw r2,(r11+192) 8006048: 50 41 00 22 bgeu r2,r1,80060d0 <== ALWAYS TAKEN % tty->rawInBuf.Size) > tty->highwater) && !(tty->flow_ctrl & FL_IREQXOF)) { 800604c: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8006050: 20 21 00 01 andi r1,r1,0x1 <== 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) && 8006054: 5c 20 00 1f bne r1,r0,80060d0 <== NOT EXECUTED !(tty->flow_ctrl & FL_IREQXOF)) { /* incoming data stream should be stopped */ tty->flow_ctrl |= FL_IREQXOF; 8006058: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 800605c: 38 21 00 01 ori r1,r1,0x1 <== NOT EXECUTED 8006060: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF)) 8006064: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8006068: 20 21 04 02 andi r1,r1,0x402 <== NOT EXECUTED 800606c: 5c 37 00 0f bne r1,r23,80060a8 <== NOT EXECUTED == (FL_MDXOF ) ) { if ((tty->flow_ctrl & FL_OSTOP) || 8006070: 29 63 00 b8 lw r3,(r11+184) <== NOT EXECUTED 8006074: 20 63 00 20 andi r3,r3,0x20 <== NOT EXECUTED 8006078: 5c 60 00 03 bne r3,r0,8006084 <== NOT EXECUTED 800607c: 29 61 00 94 lw r1,(r11+148) <== NOT EXECUTED 8006080: 5c 23 00 14 bne r1,r3,80060d0 <== 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; 8006084: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED (*tty->device.write)(tty->minor, 8006088: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED 800608c: ba a0 10 00 mv r2,r21 <== NOT EXECUTED == (FL_MDXOF ) ) { 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; 8006090: 38 21 00 02 ori r1,r1,0x2 <== NOT EXECUTED 8006094: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED (*tty->device.write)(tty->minor, 8006098: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 800609c: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 80060a0: d8 80 00 00 call r4 <== NOT EXECUTED 80060a4: e0 00 00 0b bi 80060d0 <== NOT EXECUTED (void *)&(tty->termios.c_cc[VSTOP]), 1); } } else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) { 80060a8: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 80060ac: 20 21 01 04 andi r1,r1,0x104 <== NOT EXECUTED 80060b0: 5c 36 00 08 bne r1,r22,80060d0 <== NOT EXECUTED tty->flow_ctrl |= FL_IRTSOFF; 80060b4: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED /* deactivate RTS line */ if (tty->device.stopRemoteTx != NULL) { 80060b8: 29 63 00 ac lw r3,(r11+172) <== 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; 80060bc: 38 21 00 04 ori r1,r1,0x4 <== NOT EXECUTED 80060c0: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* deactivate RTS line */ if (tty->device.stopRemoteTx != NULL) { 80060c4: 44 60 00 03 be r3,r0,80060d0 <== NOT EXECUTED tty->device.stopRemoteTx(tty->minor); 80060c8: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 80060cc: d8 60 00 00 call r3 <== NOT EXECUTED } } } /* reenable interrupts */ rtems_interrupt_enable(level); 80060d0: d0 13 00 00 wcsr IE,r19 if (newTail == tty->rawInBuf.Head) { 80060d4: 29 61 00 5c lw r1,(r11+92) 80060d8: 5d c1 00 03 bne r14,r1,80060e4 <== ALWAYS TAKEN dropped++; 80060dc: 35 8c 00 01 addi r12,r12,1 <== NOT EXECUTED 80060e0: e0 00 00 0e bi 8006118 <== NOT EXECUTED } else { tty->rawInBuf.theBuf[newTail] = c; 80060e4: 29 61 00 58 lw r1,(r11+88) 80060e8: b4 2e 08 00 add r1,r1,r14 80060ec: 30 30 00 00 sb (r1+0),r16 tty->rawInBuf.Tail = newTail; /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { 80060f0: 29 64 00 e4 lw r4,(r11+228) if (newTail == tty->rawInBuf.Head) { dropped++; } else { tty->rawInBuf.theBuf[newTail] = c; tty->rawInBuf.Tail = newTail; 80060f4: 59 6e 00 60 sw (r11+96),r14 /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { 80060f8: 5c 80 00 08 bne r4,r0,8006118 <== NEVER TAKEN 80060fc: 29 63 00 dc lw r3,(r11+220) 8006100: 44 64 00 06 be r3,r4,8006118 <== ALWAYS TAKEN (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); 8006104: 29 62 00 e0 lw r2,(r11+224) <== NOT EXECUTED 8006108: bb 00 08 00 mv r1,r24 <== NOT EXECUTED 800610c: d8 60 00 00 call r3 <== NOT EXECUTED tty->tty_rcvwakeup = 1; 8006110: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8006114: 59 61 00 e4 sw (r11+228),r1 <== NOT EXECUTED 8006118: 35 ef ff ff addi r15,r15,-1 tty->tty_rcvwakeup = 1; } return 0; } while (len--) { 800611c: 5d e0 ff 92 bne r15,r0,8005f64 } } } } tty->rawInBufDropped += dropped; 8006120: 29 61 00 78 lw r1,(r11+120) 8006124: b4 2c 08 00 add r1,r1,r12 8006128: 59 61 00 78 sw (r11+120),r1 rtems_semaphore_release (tty->rawInBuf.Semaphore); 800612c: 29 61 00 68 lw r1,(r11+104) 8006130: f8 00 04 00 calli 8007130 return dropped; } 8006134: b9 80 08 00 mv r1,r12 8006138: 2b 9d 00 04 lw ra,(sp+4) 800613c: 2b 8b 00 44 lw r11,(sp+68) 8006140: 2b 8c 00 40 lw r12,(sp+64) 8006144: 2b 8d 00 3c lw r13,(sp+60) 8006148: 2b 8e 00 38 lw r14,(sp+56) 800614c: 2b 8f 00 34 lw r15,(sp+52) 8006150: 2b 90 00 30 lw r16,(sp+48) 8006154: 2b 91 00 2c lw r17,(sp+44) 8006158: 2b 92 00 28 lw r18,(sp+40) 800615c: 2b 93 00 24 lw r19,(sp+36) 8006160: 2b 94 00 20 lw r20,(sp+32) 8006164: 2b 95 00 1c lw r21,(sp+28) 8006168: 2b 96 00 18 lw r22,(sp+24) 800616c: 2b 97 00 14 lw r23,(sp+20) 8006170: 2b 98 00 10 lw r24,(sp+16) 8006174: 2b 99 00 0c lw r25,(sp+12) 8006178: 2b 9b 00 08 lw fp,(sp+8) 800617c: 37 9c 00 44 addi sp,sp,68 8006180: c3 a0 00 00 ret =============================================================================== 080045f4 : struct rtems_termios_tty *rtems_termios_ttyTail; rtems_id rtems_termios_ttyMutex; void rtems_termios_initialize (void) { 80045f4: 37 9c ff f8 addi sp,sp,-8 80045f8: 5b 8b 00 08 sw (sp+8),r11 80045fc: 5b 9d 00 04 sw (sp+4),ra rtems_status_code sc; /* * Create the mutex semaphore for the tty list */ if (!rtems_termios_ttyMutex) { 8004600: 78 05 08 02 mvhi r5,0x802 8004604: 38 a5 39 d8 ori r5,r5,0x39d8 8004608: 28 ab 00 00 lw r11,(r5+0) 800460c: 5d 60 00 0a bne r11,r0,8004634 <== NEVER TAKEN sc = rtems_semaphore_create ( 8004610: 78 02 08 02 mvhi r2,0x802 8004614: 38 42 0b 78 ori r2,r2,0xb78 8004618: 28 41 00 00 lw r1,(r2+0) 800461c: 34 03 00 54 mvi r3,84 8004620: 34 02 00 01 mvi r2,1 8004624: 34 04 00 00 mvi r4,0 8004628: f8 00 09 c6 calli 8006d40 rtems_build_name ('T', 'R', 'm', 'i'), 1, RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &rtems_termios_ttyMutex); if (sc != RTEMS_SUCCESSFUL) 800462c: 44 2b 00 02 be r1,r11,8004634 <== ALWAYS TAKEN rtems_fatal_error_occurred (sc); 8004630: f8 00 0c 4d calli 8007764 <== NOT EXECUTED } } 8004634: 2b 9d 00 04 lw ra,(sp+4) 8004638: 2b 8b 00 08 lw r11,(sp+8) 800463c: 37 9c 00 08 addi sp,sp,8 8004640: c3 a0 00 00 ret =============================================================================== 08004ea0 : } } rtems_status_code rtems_termios_ioctl (void *arg) { 8004ea0: 37 9c ff e8 addi sp,sp,-24 8004ea4: 5b 8b 00 18 sw (sp+24),r11 8004ea8: 5b 8c 00 14 sw (sp+20),r12 8004eac: 5b 8d 00 10 sw (sp+16),r13 8004eb0: 5b 8e 00 0c sw (sp+12),r14 8004eb4: 5b 8f 00 08 sw (sp+8),r15 8004eb8: 5b 9d 00 04 sw (sp+4),ra 8004ebc: b8 20 60 00 mv r12,r1 rtems_libio_ioctl_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8004ec0: 28 21 00 00 lw r1,(r1+0) struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer; rtems_status_code sc; args->ioctl_return = 0; sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8004ec4: 34 02 00 00 mvi r2,0 8004ec8: 34 03 00 00 mvi r3,0 rtems_status_code rtems_termios_ioctl (void *arg) { rtems_libio_ioctl_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8004ecc: 28 2b 00 38 lw r11,(r1+56) struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer; rtems_status_code sc; args->ioctl_return = 0; 8004ed0: 59 80 00 0c sw (r12+12),r0 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; 8004ed4: 29 8e 00 08 lw r14,(r12+8) rtems_status_code sc; args->ioctl_return = 0; sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8004ed8: 29 61 00 18 lw r1,(r11+24) 8004edc: f8 00 08 45 calli 8006ff0 8004ee0: b8 20 68 00 mv r13,r1 if (sc != RTEMS_SUCCESSFUL) { 8004ee4: 5c 20 00 da bne r1,r0,800524c <== NEVER TAKEN args->ioctl_return = sc; return sc; } switch (args->command) { 8004ee8: 29 82 00 04 lw r2,(r12+4) 8004eec: 34 01 00 04 mvi r1,4 8004ef0: 44 41 00 a6 be r2,r1,8005188 <== NEVER TAKEN 8004ef4: 54 41 00 07 bgu r2,r1,8004f10 8004ef8: 34 01 00 02 mvi r1,2 8004efc: 44 41 00 27 be r2,r1,8004f98 8004f00: 54 41 00 9a bgu r2,r1,8005168 <== NEVER TAKEN 8004f04: 34 01 00 01 mvi r1,1 8004f08: 5c 41 00 12 bne r2,r1,8004f50 <== NEVER TAKEN 8004f0c: e0 00 00 1e bi 8004f84 8004f10: 78 03 08 02 mvhi r3,0x802 8004f14: 38 63 0b 94 ori r3,r3,0xb94 8004f18: 28 61 00 00 lw r1,(r3+0) 8004f1c: 44 41 00 be be r2,r1,8005214 <== NEVER TAKEN 8004f20: 54 41 00 04 bgu r2,r1,8004f30 8004f24: 34 01 00 05 mvi r1,5 8004f28: 5c 41 00 0a bne r2,r1,8004f50 <== ALWAYS TAKEN 8004f2c: e0 00 00 92 bi 8005174 <== NOT EXECUTED 8004f30: 78 03 08 02 mvhi r3,0x802 8004f34: 38 63 0b 98 ori r3,r3,0xb98 8004f38: 28 61 00 00 lw r1,(r3+0) 8004f3c: 44 41 00 b2 be r2,r1,8005204 <== NEVER TAKEN 8004f40: 78 03 08 02 mvhi r3,0x802 8004f44: 38 63 0b 9c ori r3,r3,0xb9c 8004f48: 28 61 00 00 lw r1,(r3+0) 8004f4c: 44 41 00 94 be r2,r1,800519c <== ALWAYS TAKEN default: if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) { 8004f50: 29 61 00 cc lw r1,(r11+204) 8004f54: 78 0d 08 02 mvhi r13,0x802 8004f58: 34 02 00 05 mvi r2,5 8004f5c: 39 ad 38 10 ori r13,r13,0x3810 8004f60: fb ff f2 45 calli 8001874 <__ashlsi3> 8004f64: b5 a1 08 00 add r1,r13,r1 8004f68: 28 23 00 18 lw r3,(r1+24) sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args); } else { sc = RTEMS_INVALID_NUMBER; 8004f6c: 34 0d 00 0a mvi r13,10 args->ioctl_return = sc; return sc; } switch (args->command) { default: if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) { 8004f70: 44 60 00 b5 be r3,r0,8005244 <== NEVER TAKEN sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args); 8004f74: b9 60 08 00 mv r1,r11 8004f78: b9 80 10 00 mv r2,r12 8004f7c: d8 60 00 00 call r3 8004f80: e0 00 00 9f bi 80051fc sc = RTEMS_INVALID_NUMBER; } break; case RTEMS_IO_GET_ATTRIBUTES: *(struct termios *)args->buffer = tty->termios; 8004f84: 29 81 00 08 lw r1,(r12+8) 8004f88: 35 62 00 30 addi r2,r11,48 8004f8c: 34 03 00 24 mvi r3,36 8004f90: f8 00 31 cd calli 80116c4 break; 8004f94: e0 00 00 ac bi 8005244 case RTEMS_IO_SET_ATTRIBUTES: tty->termios = *(struct termios *)args->buffer; 8004f98: 29 82 00 08 lw r2,(r12+8) 8004f9c: 35 61 00 30 addi r1,r11,48 8004fa0: 34 03 00 24 mvi r3,36 8004fa4: f8 00 31 c8 calli 80116c4 /* * check for flow control options to be switched off */ /* check for outgoing XON/XOFF flow control switched off */ if (( tty->flow_ctrl & FL_MDXON) && 8004fa8: 29 61 00 b8 lw r1,(r11+184) 8004fac: 20 21 02 00 andi r1,r1,0x200 8004fb0: 44 20 00 1d be r1,r0,8005024 !(tty->termios.c_iflag & IXON)) { 8004fb4: 29 61 00 30 lw r1,(r11+48) 8004fb8: 20 21 04 00 andi r1,r1,0x400 /* * check for flow control options to be switched off */ /* check for outgoing XON/XOFF flow control switched off */ if (( tty->flow_ctrl & FL_MDXON) && 8004fbc: 5c 20 00 1a bne r1,r0,8005024 <== ALWAYS TAKEN !(tty->termios.c_iflag & IXON)) { /* clear related flags in flow_ctrl */ tty->flow_ctrl &= ~(FL_MDXON | FL_ORCVXOF); 8004fc0: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 8004fc4: 34 01 fd ef mvi r1,-529 <== NOT EXECUTED 8004fc8: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED 8004fcc: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* has output been stopped due to received XOFF? */ if (tty->flow_ctrl & FL_OSTOP) { 8004fd0: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8004fd4: 20 21 00 20 andi r1,r1,0x20 <== NOT EXECUTED 8004fd8: 44 20 00 13 be r1,r0,8005024 <== NOT EXECUTED /* disable interrupts */ rtems_interrupt_disable(level); 8004fdc: 90 00 70 00 rcsr r14,IE <== NOT EXECUTED 8004fe0: 34 01 ff fe mvi r1,-2 <== NOT EXECUTED 8004fe4: a1 c1 08 00 and r1,r14,r1 <== NOT EXECUTED 8004fe8: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED tty->flow_ctrl &= ~FL_OSTOP; 8004fec: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 8004ff0: 34 01 ff df mvi r1,-33 <== NOT EXECUTED 8004ff4: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED 8004ff8: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { 8004ffc: 29 61 00 94 lw r1,(r11+148) <== NOT EXECUTED 8005000: 44 20 00 08 be r1,r0,8005020 <== NOT EXECUTED /* if chars available, call write function... */ (*tty->device.write)( 8005004: 29 63 00 7c lw r3,(r11+124) <== NOT EXECUTED tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); 8005008: 29 62 00 84 lw r2,(r11+132) <== 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)( 800500c: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED 8005010: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8005014: b4 62 10 00 add r2,r3,r2 <== NOT EXECUTED 8005018: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 800501c: d8 80 00 00 call r4 <== NOT EXECUTED tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); } /* reenable interrupts */ rtems_interrupt_enable(level); 8005020: d0 0e 00 00 wcsr IE,r14 <== NOT EXECUTED } } /* check for incoming XON/XOFF flow control switched off */ if (( tty->flow_ctrl & FL_MDXOF) && !(tty->termios.c_iflag & IXOFF)) { 8005024: 29 61 00 b8 lw r1,(r11+184) 8005028: 20 21 04 00 andi r1,r1,0x400 800502c: 44 20 00 0c be r1,r0,800505c <== ALWAYS TAKEN 8005030: 29 61 00 30 lw r1,(r11+48) <== NOT EXECUTED 8005034: 20 21 10 00 andi r1,r1,0x1000 <== NOT EXECUTED 8005038: 5c 20 00 09 bne r1,r0,800505c <== NOT EXECUTED /* clear related flags in flow_ctrl */ tty->flow_ctrl &= ~(FL_MDXOF); 800503c: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 8005040: 34 01 fb ff mvi r1,-1025 <== NOT EXECUTED 8005044: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED 8005048: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* FIXME: what happens, if we had sent XOFF but not yet XON? */ tty->flow_ctrl &= ~(FL_ISNTXOF); 800504c: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 8005050: 34 01 ff fd mvi r1,-3 <== NOT EXECUTED 8005054: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED 8005058: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED } /* check for incoming RTS/CTS flow control switched off */ if (( tty->flow_ctrl & FL_MDRTS) && !(tty->termios.c_cflag & CRTSCTS)) { 800505c: 29 61 00 b8 lw r1,(r11+184) 8005060: 20 21 01 00 andi r1,r1,0x100 8005064: 44 20 00 12 be r1,r0,80050ac <== ALWAYS TAKEN 8005068: 29 61 00 38 lw r1,(r11+56) <== NOT EXECUTED 800506c: 48 01 00 10 bg r0,r1,80050ac <== NOT EXECUTED /* clear related flags in flow_ctrl */ tty->flow_ctrl &= ~(FL_MDRTS); 8005070: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 8005074: 34 01 fe ff mvi r1,-257 <== NOT EXECUTED 8005078: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED 800507c: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* restart remote Tx, if it was stopped */ if ((tty->flow_ctrl & FL_IRTSOFF) && (tty->device.startRemoteTx != NULL)) { 8005080: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8005084: 20 21 00 04 andi r1,r1,0x4 <== NOT EXECUTED 8005088: 44 20 00 05 be r1,r0,800509c <== NOT EXECUTED 800508c: 29 62 00 b0 lw r2,(r11+176) <== NOT EXECUTED 8005090: 44 40 00 03 be r2,r0,800509c <== NOT EXECUTED tty->device.startRemoteTx(tty->minor); 8005094: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8005098: d8 40 00 00 call r2 <== NOT EXECUTED } tty->flow_ctrl &= ~(FL_IRTSOFF); 800509c: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 80050a0: 34 01 ff fb mvi r1,-5 <== NOT EXECUTED 80050a4: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED 80050a8: 59 61 00 b8 sw (r11+184),r1 <== 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) { 80050ac: 29 61 00 38 lw r1,(r11+56) 80050b0: 4c 20 00 04 bge r1,r0,80050c0 <== ALWAYS TAKEN tty->flow_ctrl |= FL_MDRTS; 80050b4: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 80050b8: 38 21 01 00 ori r1,r1,0x100 <== NOT EXECUTED 80050bc: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED } /* check for incoming XON/XOF flow control switched on */ if (tty->termios.c_iflag & IXOFF) { 80050c0: 29 61 00 30 lw r1,(r11+48) 80050c4: 20 22 10 00 andi r2,r1,0x1000 80050c8: 44 40 00 04 be r2,r0,80050d8 <== ALWAYS TAKEN tty->flow_ctrl |= FL_MDXOF; 80050cc: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 80050d0: 38 42 04 00 ori r2,r2,0x400 <== NOT EXECUTED 80050d4: 59 62 00 b8 sw (r11+184),r2 <== NOT EXECUTED } /* check for outgoing XON/XOF flow control switched on */ if (tty->termios.c_iflag & IXON) { 80050d8: 20 21 04 00 andi r1,r1,0x400 80050dc: 44 20 00 04 be r1,r0,80050ec <== NEVER TAKEN tty->flow_ctrl |= FL_MDXON; 80050e0: 29 61 00 b8 lw r1,(r11+184) 80050e4: 38 21 02 00 ori r1,r1,0x200 80050e8: 59 61 00 b8 sw (r11+184),r1 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) { 80050ec: 29 6e 00 3c lw r14,(r11+60) 80050f0: 21 ce 00 02 andi r14,r14,0x2 80050f4: 5d c0 00 11 bne r14,r0,8005138 <== ALWAYS TAKEN tty->rawInBufSemaphoreOptions = RTEMS_WAIT; tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT; tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; } else { tty->vtimeTicks = tty->termios.c_cc[VTIME] * 80050f8: 41 6f 00 46 lbu r15,(r11+70) <== NOT EXECUTED rtems_clock_get_ticks_per_second() / 10; 80050fc: f8 00 05 e8 calli 800689c <== 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] * 8005100: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED 8005104: f8 00 65 a1 calli 801e788 <__mulsi3> <== NOT EXECUTED rtems_clock_get_ticks_per_second() / 10; 8005108: 34 02 00 0a mvi r2,10 <== NOT EXECUTED 800510c: f8 00 66 04 calli 801e91c <__udivsi3> <== NOT EXECUTED if (tty->termios.c_cc[VTIME]) { 8005110: 41 62 00 46 lbu r2,(r11+70) <== 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] * 8005114: 59 61 00 54 sw (r11+84),r1 <== NOT EXECUTED 8005118: 41 63 00 47 lbu r3,(r11+71) <== NOT EXECUTED rtems_clock_get_ticks_per_second() / 10; if (tty->termios.c_cc[VTIME]) { 800511c: 44 4e 00 06 be r2,r14,8005134 <== NOT EXECUTED tty->rawInBufSemaphoreOptions = RTEMS_WAIT; 8005120: 59 60 00 6c sw (r11+108),r0 <== NOT EXECUTED tty->rawInBufSemaphoreTimeout = tty->vtimeTicks; 8005124: 59 61 00 70 sw (r11+112),r1 <== NOT EXECUTED if (tty->termios.c_cc[VMIN]) 8005128: 5c 60 00 06 bne r3,r0,8005140 <== NOT EXECUTED tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; else tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks; 800512c: 59 61 00 74 sw (r11+116),r1 <== NOT EXECUTED 8005130: e0 00 00 08 bi 8005150 <== NOT EXECUTED } else { if (tty->termios.c_cc[VMIN]) { 8005134: 44 62 00 05 be r3,r2,8005148 <== NOT EXECUTED tty->rawInBufSemaphoreOptions = RTEMS_WAIT; 8005138: 59 60 00 6c sw (r11+108),r0 tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT; 800513c: 59 60 00 70 sw (r11+112),r0 tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; 8005140: 59 60 00 74 sw (r11+116),r0 8005144: e0 00 00 03 bi 8005150 } else { tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT; 8005148: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 800514c: 59 61 00 6c sw (r11+108),r1 <== NOT EXECUTED } } } if (tty->device.setAttributes) 8005150: 29 63 00 a8 lw r3,(r11+168) 8005154: 44 60 00 3c be r3,r0,8005244 <== NEVER TAKEN (*tty->device.setAttributes)(tty->minor, &tty->termios); 8005158: 29 61 00 10 lw r1,(r11+16) 800515c: 35 62 00 30 addi r2,r11,48 8005160: d8 60 00 00 call r3 8005164: e0 00 00 38 bi 8005244 break; case RTEMS_IO_TCDRAIN: drainOutput (tty); 8005168: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 800516c: fb ff fd 82 calli 8004774 <== NOT EXECUTED break; 8005170: e0 00 00 35 bi 8005244 <== NOT EXECUTED case RTEMS_IO_SNDWAKEUP: tty->tty_snd = *wakeup; 8005174: 29 c1 00 00 lw r1,(r14+0) <== NOT EXECUTED 8005178: 59 61 00 d4 sw (r11+212),r1 <== NOT EXECUTED 800517c: 29 c1 00 04 lw r1,(r14+4) <== NOT EXECUTED 8005180: 59 61 00 d8 sw (r11+216),r1 <== NOT EXECUTED break; 8005184: e0 00 00 30 bi 8005244 <== NOT EXECUTED case RTEMS_IO_RCVWAKEUP: tty->tty_rcv = *wakeup; 8005188: 29 c1 00 00 lw r1,(r14+0) <== NOT EXECUTED 800518c: 59 61 00 dc sw (r11+220),r1 <== NOT EXECUTED 8005190: 29 c1 00 04 lw r1,(r14+4) <== NOT EXECUTED 8005194: 59 61 00 e0 sw (r11+224),r1 <== NOT EXECUTED break; 8005198: e0 00 00 2b bi 8005244 <== NOT EXECUTED #if 1 /* FIXME */ case TIOCSETD: /* * close old line discipline */ if (rtems_termios_linesw[tty->t_line].l_close != NULL) { 800519c: 29 61 00 cc lw r1,(r11+204) 80051a0: 34 02 00 05 mvi r2,5 80051a4: 78 0e 08 02 mvhi r14,0x802 80051a8: fb ff f1 b3 calli 8001874 <__ashlsi3> 80051ac: 39 ce 38 10 ori r14,r14,0x3810 80051b0: b5 c1 08 00 add r1,r14,r1 80051b4: 28 22 00 04 lw r2,(r1+4) 80051b8: 44 40 00 04 be r2,r0,80051c8 sc = rtems_termios_linesw[tty->t_line].l_close(tty); 80051bc: b9 60 08 00 mv r1,r11 80051c0: d8 40 00 00 call r2 80051c4: b8 20 68 00 mv r13,r1 } tty->t_line=*(int*)(args->buffer); 80051c8: 29 81 00 08 lw r1,(r12+8) tty->t_sc = NULL; /* ensure that no more valid data */ /* * open new line discipline */ if (rtems_termios_linesw[tty->t_line].l_open != NULL) { 80051cc: 34 02 00 05 mvi r2,5 80051d0: 78 0e 08 02 mvhi r14,0x802 * 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); 80051d4: 28 21 00 00 lw r1,(r1+0) tty->t_sc = NULL; /* ensure that no more valid data */ 80051d8: 59 60 00 d0 sw (r11+208),r0 /* * open new line discipline */ if (rtems_termios_linesw[tty->t_line].l_open != NULL) { 80051dc: 39 ce 38 10 ori r14,r14,0x3810 * 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); 80051e0: 59 61 00 cc sw (r11+204),r1 tty->t_sc = NULL; /* ensure that no more valid data */ /* * open new line discipline */ if (rtems_termios_linesw[tty->t_line].l_open != NULL) { 80051e4: fb ff f1 a4 calli 8001874 <__ashlsi3> 80051e8: b5 c1 08 00 add r1,r14,r1 80051ec: 28 22 00 00 lw r2,(r1+0) 80051f0: 44 40 00 15 be r2,r0,8005244 <== NEVER TAKEN sc = rtems_termios_linesw[tty->t_line].l_open(tty); 80051f4: b9 60 08 00 mv r1,r11 80051f8: d8 40 00 00 call r2 80051fc: b8 20 68 00 mv r13,r1 8005200: e0 00 00 11 bi 8005244 } break; case TIOCGETD: *(int*)(args->buffer)=tty->t_line; 8005204: 29 81 00 08 lw r1,(r12+8) 8005208: 29 62 00 cc lw r2,(r11+204) 800520c: 58 22 00 00 sw (r1+0),r2 break; 8005210: e0 00 00 0d bi 8005244 #endif case FIONREAD: { int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head; 8005214: 29 62 00 60 lw r2,(r11+96) <== NOT EXECUTED 8005218: 29 61 00 5c lw r1,(r11+92) <== NOT EXECUTED 800521c: c8 41 08 00 sub r1,r2,r1 <== NOT EXECUTED if ( rawnc < 0 ) 8005220: 4c 20 00 03 bge r1,r0,800522c <== NOT EXECUTED rawnc += tty->rawInBuf.Size; 8005224: 29 62 00 64 lw r2,(r11+100) <== NOT EXECUTED 8005228: b4 22 08 00 add r1,r1,r2 <== NOT EXECUTED /* Half guess that this is the right operation */ *(int *)args->buffer = tty->ccount - tty->cindex + rawnc; 800522c: 29 64 00 20 lw r4,(r11+32) <== NOT EXECUTED 8005230: 29 62 00 24 lw r2,(r11+36) <== NOT EXECUTED 8005234: 29 83 00 08 lw r3,(r12+8) <== NOT EXECUTED 8005238: c8 82 10 00 sub r2,r4,r2 <== NOT EXECUTED 800523c: b4 41 08 00 add r1,r2,r1 <== NOT EXECUTED 8005240: 58 61 00 00 sw (r3+0),r1 <== NOT EXECUTED } break; } rtems_semaphore_release (tty->osem); 8005244: 29 61 00 18 lw r1,(r11+24) 8005248: f8 00 07 ba calli 8007130 args->ioctl_return = sc; return sc; } 800524c: b9 a0 08 00 mv r1,r13 } break; } rtems_semaphore_release (tty->osem); args->ioctl_return = sc; 8005250: 59 8d 00 0c sw (r12+12),r13 return sc; } 8005254: 2b 9d 00 04 lw ra,(sp+4) 8005258: 2b 8b 00 18 lw r11,(sp+24) 800525c: 2b 8c 00 14 lw r12,(sp+20) 8005260: 2b 8d 00 10 lw r13,(sp+16) 8005264: 2b 8e 00 0c lw r14,(sp+12) 8005268: 2b 8f 00 08 lw r15,(sp+8) 800526c: 37 9c 00 18 addi sp,sp,24 8005270: c3 a0 00 00 ret =============================================================================== 08004644 : int32_t baud ) { int termios_baud; switch (baud) { 8004644: 34 03 04 b0 mvi r3,1200 case 134: termios_baud = B134; break; case 150: termios_baud = B150; break; case 200: termios_baud = B200; break; case 300: termios_baud = B300; break; case 600: termios_baud = B600; break; case 1200: termios_baud = B1200; break; 8004648: 34 02 00 09 mvi r2,9 int32_t baud ) { int termios_baud; switch (baud) { 800464c: 44 23 00 48 be r1,r3,800476c 8004650: 48 23 00 1f bg r1,r3,80046cc 8004654: 34 03 00 86 mvi r3,134 case 0: termios_baud = B0; break; case 50: termios_baud = B50; break; case 75: termios_baud = B75; break; case 110: termios_baud = B110; break; case 134: termios_baud = B134; break; 8004658: 34 02 00 04 mvi r2,4 int32_t baud ) { int termios_baud; switch (baud) { 800465c: 44 23 00 44 be r1,r3,800476c 8004660: 48 23 00 0e bg r1,r3,8004698 8004664: 34 03 00 32 mvi r3,50 case 0: termios_baud = B0; break; case 50: termios_baud = B50; break; 8004668: 34 02 00 01 mvi r2,1 int32_t baud ) { int termios_baud; switch (baud) { 800466c: 44 23 00 40 be r1,r3,800476c 8004670: 48 23 00 04 bg r1,r3,8004680 case 0: termios_baud = B0; break; 8004674: 34 02 00 00 mvi r2,0 int32_t baud ) { int termios_baud; switch (baud) { 8004678: 5c 20 00 3c bne r1,r0,8004768 800467c: e0 00 00 3c bi 800476c 8004680: 34 03 00 4b mvi r3,75 case 0: termios_baud = B0; break; case 50: termios_baud = B50; break; case 75: termios_baud = B75; break; 8004684: 34 02 00 02 mvi r2,2 int32_t baud ) { int termios_baud; switch (baud) { 8004688: 44 23 00 39 be r1,r3,800476c case 0: termios_baud = B0; break; case 50: termios_baud = B50; break; case 75: termios_baud = B75; break; case 110: termios_baud = B110; break; 800468c: 34 02 00 03 mvi r2,3 int32_t baud ) { int termios_baud; switch (baud) { 8004690: 34 03 00 6e mvi r3,110 8004694: e0 00 00 34 bi 8004764 8004698: 34 03 00 c8 mvi r3,200 case 50: termios_baud = B50; break; case 75: termios_baud = B75; break; case 110: termios_baud = B110; break; case 134: termios_baud = B134; break; case 150: termios_baud = B150; break; case 200: termios_baud = B200; break; 800469c: 34 02 00 06 mvi r2,6 int32_t baud ) { int termios_baud; switch (baud) { 80046a0: 44 23 00 33 be r1,r3,800476c 80046a4: 48 23 00 04 bg r1,r3,80046b4 case 0: termios_baud = B0; break; case 50: termios_baud = B50; break; case 75: termios_baud = B75; break; case 110: termios_baud = B110; break; case 134: termios_baud = B134; break; case 150: termios_baud = B150; break; 80046a8: 34 02 00 05 mvi r2,5 int32_t baud ) { int termios_baud; switch (baud) { 80046ac: 34 03 00 96 mvi r3,150 80046b0: e0 00 00 2d bi 8004764 80046b4: 34 03 01 2c mvi r3,300 case 75: termios_baud = B75; break; case 110: termios_baud = B110; break; case 134: termios_baud = B134; break; case 150: termios_baud = B150; break; case 200: termios_baud = B200; break; case 300: termios_baud = B300; break; 80046b8: 34 02 00 07 mvi r2,7 int32_t baud ) { int termios_baud; switch (baud) { 80046bc: 44 23 00 2c be r1,r3,800476c case 110: termios_baud = B110; break; case 134: termios_baud = B134; break; case 150: termios_baud = B150; break; case 200: termios_baud = B200; break; case 300: termios_baud = B300; break; case 600: termios_baud = B600; break; 80046c0: 34 02 00 08 mvi r2,8 int32_t baud ) { int termios_baud; switch (baud) { 80046c4: 34 03 02 58 mvi r3,600 80046c8: e0 00 00 27 bi 8004764 80046cc: 34 03 4b 00 mvi r3,19200 case 1200: termios_baud = B1200; break; case 1800: termios_baud = B1800; break; case 2400: termios_baud = B2400; break; case 4800: termios_baud = B4800; break; case 9600: termios_baud = B9600; break; case 19200: termios_baud = B19200; break; 80046d0: 34 02 00 0e mvi r2,14 int32_t baud ) { int termios_baud; switch (baud) { 80046d4: 44 23 00 26 be r1,r3,800476c 80046d8: 48 23 00 0e bg r1,r3,8004710 80046dc: 34 03 09 60 mvi r3,2400 case 200: termios_baud = B200; break; case 300: termios_baud = B300; break; case 600: termios_baud = B600; break; case 1200: termios_baud = B1200; break; case 1800: termios_baud = B1800; break; case 2400: termios_baud = B2400; break; 80046e0: 34 02 00 0b mvi r2,11 int32_t baud ) { int termios_baud; switch (baud) { 80046e4: 44 23 00 22 be r1,r3,800476c 80046e8: 48 23 00 04 bg r1,r3,80046f8 case 150: termios_baud = B150; break; case 200: termios_baud = B200; break; case 300: termios_baud = B300; break; case 600: termios_baud = B600; break; case 1200: termios_baud = B1200; break; case 1800: termios_baud = B1800; break; 80046ec: 34 02 00 0a mvi r2,10 int32_t baud ) { int termios_baud; switch (baud) { 80046f0: 34 03 07 08 mvi r3,1800 80046f4: e0 00 00 1c bi 8004764 80046f8: 34 03 12 c0 mvi r3,4800 case 300: termios_baud = B300; break; case 600: termios_baud = B600; break; case 1200: termios_baud = B1200; break; case 1800: termios_baud = B1800; break; case 2400: termios_baud = B2400; break; case 4800: termios_baud = B4800; break; 80046fc: 34 02 00 0c mvi r2,12 int32_t baud ) { int termios_baud; switch (baud) { 8004700: 44 23 00 1b be r1,r3,800476c case 600: termios_baud = B600; break; case 1200: termios_baud = B1200; break; case 1800: termios_baud = B1800; break; case 2400: termios_baud = B2400; break; case 4800: termios_baud = B4800; break; case 9600: termios_baud = B9600; break; 8004704: 34 02 00 0d mvi r2,13 int32_t baud ) { int termios_baud; switch (baud) { 8004708: 34 03 25 80 mvi r3,9600 800470c: e0 00 00 16 bi 8004764 8004710: 78 02 08 02 mvhi r2,0x802 8004714: 38 42 04 f4 ori r2,r2,0x4f4 8004718: 28 43 00 00 lw r3,(r2+0) case 4800: termios_baud = B4800; break; case 9600: termios_baud = B9600; break; case 19200: termios_baud = B19200; break; case 38400: termios_baud = B38400; break; case 57600: termios_baud = B57600; break; case 115200: termios_baud = B115200; break; 800471c: 34 02 10 02 mvi r2,4098 int32_t baud ) { int termios_baud; switch (baud) { 8004720: 44 23 00 13 be r1,r3,800476c 8004724: 48 23 00 07 bg r1,r3,8004740 8004728: 38 03 96 00 mvu r3,0x9600 case 1800: termios_baud = B1800; break; case 2400: termios_baud = B2400; break; case 4800: termios_baud = B4800; break; case 9600: termios_baud = B9600; break; case 19200: termios_baud = B19200; break; case 38400: termios_baud = B38400; break; 800472c: 34 02 00 0f mvi r2,15 int32_t baud ) { int termios_baud; switch (baud) { 8004730: 44 23 00 0f be r1,r3,800476c case 2400: termios_baud = B2400; break; case 4800: termios_baud = B4800; break; case 9600: termios_baud = B9600; break; case 19200: termios_baud = B19200; break; case 38400: termios_baud = B38400; break; case 57600: termios_baud = B57600; break; 8004734: 34 02 10 01 mvi r2,4097 int32_t baud ) { int termios_baud; switch (baud) { 8004738: 34 63 4b 00 addi r3,r3,19200 800473c: e0 00 00 0a bi 8004764 8004740: 78 04 08 02 mvhi r4,0x802 8004744: 38 84 0b 70 ori r4,r4,0xb70 8004748: 28 83 00 00 lw r3,(r4+0) case 9600: termios_baud = B9600; break; case 19200: termios_baud = B19200; break; case 38400: termios_baud = B38400; break; case 57600: termios_baud = B57600; break; case 115200: termios_baud = B115200; break; case 230400: termios_baud = B230400; break; 800474c: 34 02 10 03 mvi r2,4099 int32_t baud ) { int termios_baud; switch (baud) { 8004750: 44 23 00 07 be r1,r3,800476c 8004754: 78 04 08 02 mvhi r4,0x802 8004758: 38 84 0b 74 ori r4,r4,0xb74 800475c: 28 83 00 00 lw r3,(r4+0) case 19200: termios_baud = B19200; break; case 38400: termios_baud = B38400; break; case 57600: termios_baud = B57600; break; case 115200: termios_baud = B115200; break; case 230400: termios_baud = B230400; break; case 460800: termios_baud = B460800; break; 8004760: 34 02 10 04 mvi r2,4100 int32_t baud ) { int termios_baud; switch (baud) { 8004764: 44 23 00 02 be r1,r3,800476c <== ALWAYS TAKEN case 38400: termios_baud = B38400; break; case 57600: termios_baud = B57600; break; case 115200: termios_baud = B115200; break; case 230400: termios_baud = B230400; break; case 460800: termios_baud = B460800; break; default: termios_baud = -1; break; 8004768: 34 02 ff ff mvi r2,-1 } return termios_baud; } 800476c: b8 40 08 00 mv r1,r2 8004770: c3 a0 00 00 ret =============================================================================== 08004804 : rtems_device_major_number major, rtems_device_minor_number minor, void *arg, const rtems_termios_callbacks *callbacks ) { 8004804: 37 9c ff d4 addi sp,sp,-44 8004808: 5b 8b 00 2c sw (sp+44),r11 800480c: 5b 8c 00 28 sw (sp+40),r12 8004810: 5b 8d 00 24 sw (sp+36),r13 8004814: 5b 8e 00 20 sw (sp+32),r14 8004818: 5b 8f 00 1c sw (sp+28),r15 800481c: 5b 90 00 18 sw (sp+24),r16 8004820: 5b 91 00 14 sw (sp+20),r17 8004824: 5b 92 00 10 sw (sp+16),r18 8004828: 5b 93 00 0c sw (sp+12),r19 800482c: 5b 94 00 08 sw (sp+8),r20 8004830: 5b 9d 00 04 sw (sp+4),ra 8004834: b8 20 88 00 mv r17,r1 struct rtems_termios_tty *tty; /* * See if the device has already been opened */ sc = rtems_semaphore_obtain( 8004838: 78 01 08 02 mvhi r1,0x802 800483c: 38 21 39 d8 ori r1,r1,0x39d8 8004840: 28 21 00 00 lw r1,(r1+0) rtems_device_major_number major, rtems_device_minor_number minor, void *arg, const rtems_termios_callbacks *callbacks ) { 8004844: b8 40 90 00 mv r18,r2 8004848: b8 60 a0 00 mv r20,r3 struct rtems_termios_tty *tty; /* * See if the device has already been opened */ sc = rtems_semaphore_obtain( 800484c: 34 02 00 00 mvi r2,0 8004850: 34 03 00 00 mvi r3,0 rtems_device_major_number major, rtems_device_minor_number minor, void *arg, const rtems_termios_callbacks *callbacks ) { 8004854: b8 80 68 00 mv r13,r4 struct rtems_termios_tty *tty; /* * See if the device has already been opened */ sc = rtems_semaphore_obtain( 8004858: f8 00 09 e6 calli 8006ff0 800485c: b8 20 78 00 mv r15,r1 rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 8004860: 5c 20 01 02 bne r1,r0,8004c68 <== NEVER TAKEN return sc; for (tty = rtems_termios_ttyHead ; tty != NULL ; tty = tty->forw) { 8004864: 78 01 08 02 mvhi r1,0x802 8004868: 38 21 39 e0 ori r1,r1,0x39e0 800486c: 28 2e 00 00 lw r14,(r1+0) 8004870: b9 c0 60 00 mv r12,r14 8004874: e0 00 00 06 bi 800488c if ((tty->major == major) && (tty->minor == minor)) 8004878: 29 81 00 0c lw r1,(r12+12) <== NOT EXECUTED 800487c: 5c 31 00 03 bne r1,r17,8004888 <== NOT EXECUTED 8004880: 29 81 00 10 lw r1,(r12+16) <== NOT EXECUTED 8004884: 44 32 00 d8 be r1,r18,8004be4 <== NOT EXECUTED sc = rtems_semaphore_obtain( rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) return sc; for (tty = rtems_termios_ttyHead ; tty != NULL ; tty = tty->forw) { 8004888: 29 8c 00 00 lw r12,(r12+0) <== NOT EXECUTED 800488c: 5d 80 ff fb bne r12,r0,8004878 <== NEVER TAKEN 8004890: e0 00 01 04 bi 8004ca0 return RTEMS_NO_MEMORY; } /* * allocate raw input buffer */ tty->rawInBuf.Size = RAW_INPUT_BUFFER_SIZE; 8004894: 78 01 08 02 mvhi r1,0x802 8004898: 38 21 32 44 ori r1,r1,0x3244 800489c: 28 21 00 00 lw r1,(r1+0) 80048a0: 59 81 00 64 sw (r12+100),r1 tty->rawInBuf.theBuf = malloc (tty->rawInBuf.Size); 80048a4: 29 81 00 64 lw r1,(r12+100) 80048a8: fb ff fb 5a calli 8003610 80048ac: 59 81 00 58 sw (r12+88),r1 80048b0: b8 20 80 00 mv r16,r1 if (tty->rawInBuf.theBuf == NULL) { 80048b4: 5c 20 00 09 bne r1,r0,80048d8 <== ALWAYS TAKEN free(tty); 80048b8: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 80048bc: fb ff f9 9d calli 8002f30 <== NOT EXECUTED rtems_semaphore_release (rtems_termios_ttyMutex); 80048c0: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 80048c4: 38 21 39 d8 ori r1,r1,0x39d8 <== NOT EXECUTED 80048c8: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED return RTEMS_NO_MEMORY; 80048cc: 34 0f 00 1a mvi r15,26 <== NOT EXECUTED */ tty->rawInBuf.Size = RAW_INPUT_BUFFER_SIZE; tty->rawInBuf.theBuf = malloc (tty->rawInBuf.Size); if (tty->rawInBuf.theBuf == NULL) { free(tty); rtems_semaphore_release (rtems_termios_ttyMutex); 80048d0: f8 00 0a 18 calli 8007130 <== NOT EXECUTED return RTEMS_NO_MEMORY; 80048d4: e0 00 00 e5 bi 8004c68 <== NOT EXECUTED } /* * allocate raw output buffer */ tty->rawOutBuf.Size = RAW_OUTPUT_BUFFER_SIZE; 80048d8: 78 01 08 02 mvhi r1,0x802 80048dc: 38 21 32 48 ori r1,r1,0x3248 80048e0: 28 21 00 00 lw r1,(r1+0) 80048e4: 59 81 00 88 sw (r12+136),r1 tty->rawOutBuf.theBuf = malloc (tty->rawOutBuf.Size); 80048e8: 29 81 00 88 lw r1,(r12+136) 80048ec: fb ff fb 49 calli 8003610 80048f0: 59 81 00 7c sw (r12+124),r1 80048f4: b8 20 98 00 mv r19,r1 if (tty->rawOutBuf.theBuf == NULL) { 80048f8: 44 20 00 09 be r1,r0,800491c <== NEVER TAKEN return RTEMS_NO_MEMORY; } /* * allocate cooked buffer */ tty->cbuf = malloc (CBUFSIZE); 80048fc: 78 01 08 02 mvhi r1,0x802 8004900: 38 21 32 40 ori r1,r1,0x3240 8004904: 28 21 00 00 lw r1,(r1+0) 8004908: fb ff fb 42 calli 8003610 800490c: 59 81 00 1c sw (r12+28),r1 if (tty->cbuf == NULL) { 8004910: 5c 20 00 06 bne r1,r0,8004928 <== ALWAYS TAKEN free((void *)(tty->rawOutBuf.theBuf)); 8004914: ba 60 08 00 mv r1,r19 <== NOT EXECUTED 8004918: fb ff f9 86 calli 8002f30 <== NOT EXECUTED free((void *)(tty->rawInBuf.theBuf)); 800491c: ba 00 08 00 mv r1,r16 <== NOT EXECUTED 8004920: fb ff f9 84 calli 8002f30 <== NOT EXECUTED 8004924: e3 ff ff e5 bi 80048b8 <== NOT EXECUTED return RTEMS_NO_MEMORY; } /* * Initialize wakeup callbacks */ tty->tty_snd.sw_pfn = NULL; 8004928: 59 80 00 d4 sw (r12+212),r0 tty->tty_snd.sw_arg = NULL; 800492c: 59 80 00 d8 sw (r12+216),r0 tty->tty_rcv.sw_pfn = NULL; 8004930: 59 80 00 dc sw (r12+220),r0 tty->tty_rcv.sw_arg = NULL; 8004934: 59 80 00 e0 sw (r12+224),r0 tty->tty_rcvwakeup = 0; 8004938: 59 80 00 e4 sw (r12+228),r0 /* * link tty */ tty->forw = rtems_termios_ttyHead; 800493c: 59 8e 00 00 sw (r12+0),r14 tty->back = NULL; 8004940: 59 80 00 04 sw (r12+4),r0 if (rtems_termios_ttyHead != NULL) 8004944: 45 c0 00 02 be r14,r0,800494c <== ALWAYS TAKEN rtems_termios_ttyHead->back = tty; 8004948: 59 cc 00 04 sw (r14+4),r12 <== NOT EXECUTED rtems_termios_ttyHead = tty; 800494c: 78 01 08 02 mvhi r1,0x802 if (rtems_termios_ttyTail == NULL) 8004950: 78 04 08 02 mvhi r4,0x802 */ tty->forw = rtems_termios_ttyHead; tty->back = NULL; if (rtems_termios_ttyHead != NULL) rtems_termios_ttyHead->back = tty; rtems_termios_ttyHead = tty; 8004954: 38 21 39 e0 ori r1,r1,0x39e0 if (rtems_termios_ttyTail == NULL) 8004958: 38 84 39 dc ori r4,r4,0x39dc */ tty->forw = rtems_termios_ttyHead; tty->back = NULL; if (rtems_termios_ttyHead != NULL) rtems_termios_ttyHead->back = tty; rtems_termios_ttyHead = tty; 800495c: 58 2b 00 00 sw (r1+0),r11 if (rtems_termios_ttyTail == NULL) 8004960: 28 81 00 00 lw r1,(r4+0) 8004964: 5c 20 00 02 bne r1,r0,800496c <== NEVER TAKEN rtems_termios_ttyTail = tty; 8004968: 58 8b 00 00 sw (r4+0),r11 /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( rtems_build_name ('T', 'R', 'i', c), 800496c: 78 0e 08 02 mvhi r14,0x802 tty->major = major; /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( 8004970: 78 03 08 02 mvhi r3,0x802 8004974: 38 63 0b 7c ori r3,r3,0xb7c rtems_build_name ('T', 'R', 'i', c), 8004978: 39 ce 32 4c ori r14,r14,0x324c 800497c: 41 c2 00 00 lbu r2,(r14+0) tty->major = major; /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( 8004980: 28 61 00 00 lw r1,(r3+0) rtems_termios_ttyHead->back = tty; rtems_termios_ttyHead = tty; if (rtems_termios_ttyTail == NULL) rtems_termios_ttyTail = tty; tty->minor = minor; 8004984: 59 72 00 10 sw (r11+16),r18 tty->major = major; 8004988: 59 71 00 0c sw (r11+12),r17 /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( 800498c: b8 41 08 00 or r1,r2,r1 8004990: 34 03 00 54 mvi r3,84 8004994: 34 02 00 01 mvi r2,1 8004998: 34 04 00 00 mvi r4,0 800499c: 35 65 00 14 addi r5,r11,20 80049a0: f8 00 08 e8 calli 8006d40 80049a4: b8 20 80 00 mv r16,r1 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) 80049a8: 5c 20 00 ab bne r1,r0,8004c54 <== NEVER TAKEN rtems_fatal_error_occurred (sc); sc = rtems_semaphore_create ( 80049ac: 78 03 08 02 mvhi r3,0x802 80049b0: 38 63 0b 80 ori r3,r3,0xb80 rtems_build_name ('T', 'R', 'o', c), 80049b4: 41 c2 00 00 lbu r2,(r14+0) 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 ( 80049b8: 28 61 00 00 lw r1,(r3+0) 80049bc: 34 04 00 00 mvi r4,0 80049c0: 34 03 00 54 mvi r3,84 80049c4: b8 41 08 00 or r1,r2,r1 80049c8: 35 65 00 18 addi r5,r11,24 80049cc: 34 02 00 01 mvi r2,1 80049d0: f8 00 08 dc calli 8006d40 80049d4: b8 20 98 00 mv r19,r1 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) 80049d8: 5c 30 00 9f bne r1,r16,8004c54 <== NEVER TAKEN rtems_fatal_error_occurred (sc); sc = rtems_semaphore_create ( 80049dc: 78 03 08 02 mvhi r3,0x802 80049e0: 38 63 0b 84 ori r3,r3,0xb84 rtems_build_name ('T', 'R', 'x', c), 80049e4: 41 c2 00 00 lbu r2,(r14+0) 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 ( 80049e8: 28 61 00 00 lw r1,(r3+0) 80049ec: 34 04 00 00 mvi r4,0 80049f0: 34 03 00 20 mvi r3,32 80049f4: b8 41 08 00 or r1,r2,r1 80049f8: 35 65 00 8c addi r5,r11,140 80049fc: 34 02 00 00 mvi r2,0 8004a00: f8 00 08 d0 calli 8006d40 8004a04: b8 20 80 00 mv r16,r1 rtems_build_name ('T', 'R', 'x', c), 0, RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_FIFO, RTEMS_NO_PRIORITY, &tty->rawOutBuf.Semaphore); if (sc != RTEMS_SUCCESSFUL) 8004a08: 5c 33 00 93 bne r1,r19,8004c54 <== NEVER TAKEN tty->rawOutBufState = rob_idle; /* * Set callbacks */ tty->device = *callbacks; 8004a0c: 29 a2 00 18 lw r2,(r13+24) 8004a10: 29 a8 00 00 lw r8,(r13+0) 8004a14: 29 a7 00 04 lw r7,(r13+4) 8004a18: 29 a6 00 08 lw r6,(r13+8) 8004a1c: 29 a5 00 0c lw r5,(r13+12) 8004a20: 29 a4 00 10 lw r4,(r13+16) 8004a24: 29 a3 00 14 lw r3,(r13+20) 8004a28: 29 a1 00 1c lw r1,(r13+28) 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; 8004a2c: 59 60 00 94 sw (r11+148),r0 /* * Set callbacks */ tty->device = *callbacks; 8004a30: 59 62 00 b0 sw (r11+176),r2 8004a34: 59 68 00 98 sw (r11+152),r8 8004a38: 59 67 00 9c sw (r11+156),r7 8004a3c: 59 66 00 a0 sw (r11+160),r6 8004a40: 59 65 00 a4 sw (r11+164),r5 8004a44: 59 64 00 a8 sw (r11+168),r4 8004a48: 59 63 00 ac sw (r11+172),r3 8004a4c: 59 61 00 b4 sw (r11+180),r1 /* * Create I/O tasks */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 8004a50: 34 02 00 02 mvi r2,2 8004a54: 5c 22 00 1a bne r1,r2,8004abc sc = rtems_task_create ( 8004a58: 78 03 08 02 mvhi r3,0x802 8004a5c: 38 63 0b 88 ori r3,r3,0xb88 rtems_build_name ('T', 'x', 'T', c), 8004a60: 41 c2 00 00 lbu r2,(r14+0) /* * Create I/O tasks */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { sc = rtems_task_create ( 8004a64: 28 61 00 00 lw r1,(r3+0) 8004a68: 34 04 05 00 mvi r4,1280 8004a6c: 34 03 04 00 mvi r3,1024 8004a70: b8 41 08 00 or r1,r2,r1 8004a74: 34 05 00 00 mvi r5,0 8004a78: 34 02 00 0a mvi r2,10 8004a7c: 35 66 00 c8 addi r6,r11,200 8004a80: f8 00 09 ea calli 8007228 8004a84: b8 20 68 00 mv r13,r1 TERMIOS_TXTASK_STACKSIZE, RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, &tty->txTaskId); if (sc != RTEMS_SUCCESSFUL) 8004a88: 5c 30 00 73 bne r1,r16,8004c54 <== NEVER TAKEN rtems_fatal_error_occurred (sc); sc = rtems_task_create ( 8004a8c: 78 03 08 02 mvhi r3,0x802 8004a90: 38 63 0b 8c ori r3,r3,0xb8c rtems_build_name ('R', 'x', 'T', c), 8004a94: 41 c2 00 00 lbu r2,(r14+0) RTEMS_NO_ASR, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, &tty->txTaskId); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); sc = rtems_task_create ( 8004a98: 28 61 00 00 lw r1,(r3+0) 8004a9c: 34 04 05 00 mvi r4,1280 8004aa0: 34 03 04 00 mvi r3,1024 8004aa4: b8 41 08 00 or r1,r2,r1 8004aa8: 34 05 00 00 mvi r5,0 8004aac: 34 02 00 09 mvi r2,9 8004ab0: 35 66 00 c4 addi r6,r11,196 8004ab4: f8 00 09 dd calli 8007228 TERMIOS_RXTASK_STACKSIZE, RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, &tty->rxTaskId); if (sc != RTEMS_SUCCESSFUL) 8004ab8: 5c 2d 00 67 bne r1,r13,8004c54 <== NEVER TAKEN rtems_fatal_error_occurred (sc); } if ((tty->device.pollRead == NULL) || 8004abc: 29 61 00 a0 lw r1,(r11+160) 8004ac0: 44 20 00 04 be r1,r0,8004ad0 8004ac4: 29 62 00 b4 lw r2,(r11+180) 8004ac8: 34 01 00 02 mvi r1,2 8004acc: 5c 41 00 0e bne r2,r1,8004b04 (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){ sc = rtems_semaphore_create ( rtems_build_name ('T', 'R', 'r', c), 8004ad0: 78 01 08 02 mvhi r1,0x802 rtems_fatal_error_occurred (sc); } if ((tty->device.pollRead == NULL) || (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){ sc = rtems_semaphore_create ( 8004ad4: 78 03 08 02 mvhi r3,0x802 rtems_build_name ('T', 'R', 'r', c), 8004ad8: 38 21 32 4c ori r1,r1,0x324c rtems_fatal_error_occurred (sc); } if ((tty->device.pollRead == NULL) || (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){ sc = rtems_semaphore_create ( 8004adc: 38 63 0b 90 ori r3,r3,0xb90 rtems_build_name ('T', 'R', 'r', c), 8004ae0: 40 22 00 00 lbu r2,(r1+0) rtems_fatal_error_occurred (sc); } if ((tty->device.pollRead == NULL) || (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){ sc = rtems_semaphore_create ( 8004ae4: 28 61 00 00 lw r1,(r3+0) 8004ae8: 34 04 00 00 mvi r4,0 8004aec: 34 03 00 24 mvi r3,36 8004af0: b8 41 08 00 or r1,r2,r1 8004af4: 35 65 00 68 addi r5,r11,104 8004af8: 34 02 00 00 mvi r2,0 8004afc: f8 00 08 91 calli 8006d40 rtems_build_name ('T', 'R', 'r', c), 0, RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &tty->rawInBuf.Semaphore); if (sc != RTEMS_SUCCESSFUL) 8004b00: 5c 20 00 55 bne r1,r0,8004c54 <== NEVER TAKEN } /* * Set default parameters */ tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL; 8004b04: 34 01 25 02 mvi r1,9474 8004b08: 59 61 00 30 sw (r11+48),r1 tty->termios.c_oflag = OPOST | ONLCR | XTABS; 8004b0c: 34 01 18 05 mvi r1,6149 8004b10: 59 61 00 34 sw (r11+52),r1 tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL; 8004b14: 34 01 08 bd mvi r1,2237 8004b18: 59 61 00 38 sw (r11+56),r1 tty->termios.c_lflag = 8004b1c: 34 21 79 7e addi r1,r1,31102 8004b20: 59 61 00 3c sw (r11+60),r1 ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL; tty->termios.c_cc[VINTR] = '\003'; 8004b24: 34 01 00 03 mvi r1,3 8004b28: 31 61 00 41 sb (r11+65),r1 tty->termios.c_cc[VQUIT] = '\034'; 8004b2c: 34 01 00 1c mvi r1,28 8004b30: 31 61 00 42 sb (r11+66),r1 tty->termios.c_cc[VERASE] = '\177'; 8004b34: 34 01 00 7f mvi r1,127 8004b38: 31 61 00 43 sb (r11+67),r1 tty->termios.c_cc[VKILL] = '\025'; 8004b3c: 34 01 00 15 mvi r1,21 8004b40: 31 61 00 44 sb (r11+68),r1 tty->termios.c_cc[VEOF] = '\004'; 8004b44: 34 01 00 04 mvi r1,4 8004b48: 31 61 00 45 sb (r11+69),r1 tty->termios.c_cc[VEOL] = '\000'; tty->termios.c_cc[VEOL2] = '\000'; tty->termios.c_cc[VSTART] = '\021'; 8004b4c: 34 01 00 11 mvi r1,17 8004b50: 31 61 00 49 sb (r11+73),r1 tty->termios.c_cc[VSTOP] = '\023'; 8004b54: 34 01 00 13 mvi r1,19 8004b58: 31 61 00 4a sb (r11+74),r1 tty->termios.c_cc[VSUSP] = '\032'; 8004b5c: 34 01 00 1a mvi r1,26 8004b60: 31 61 00 4b sb (r11+75),r1 tty->termios.c_cc[VREPRINT] = '\022'; 8004b64: 34 01 00 12 mvi r1,18 8004b68: 31 61 00 4d sb (r11+77),r1 tty->termios.c_cc[VDISCARD] = '\017'; 8004b6c: 34 01 00 0f mvi r1,15 8004b70: 31 61 00 4e sb (r11+78),r1 tty->termios.c_cc[VWERASE] = '\027'; 8004b74: 34 01 00 17 mvi r1,23 8004b78: 31 61 00 4f sb (r11+79),r1 tty->termios.c_cc[VLNEXT] = '\026'; /* start with no flow control, clear flow control flags */ tty->flow_ctrl = 0; 8004b7c: 59 60 00 b8 sw (r11+184),r0 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'; 8004b80: 34 01 00 16 mvi r1,22 8004b84: 31 61 00 50 sb (r11+80),r1 /* 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; 8004b88: 29 61 00 64 lw r1,(r11+100) 8004b8c: 34 02 00 01 mvi r2,1 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'; 8004b90: 31 60 00 4c sb (r11+76),r0 tty->termios.c_cc[VEOL2] = '\000'; 8004b94: 31 60 00 51 sb (r11+81),r0 /* 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; 8004b98: f8 00 66 d5 calli 801e6ec <__lshrsi3> tty->highwater = tty->rawInBuf.Size * 3/4; 8004b9c: 29 6d 00 64 lw r13,(r11+100) /* 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; 8004ba0: 59 61 00 bc sw (r11+188),r1 tty->highwater = tty->rawInBuf.Size * 3/4; 8004ba4: 34 02 00 01 mvi r2,1 8004ba8: b9 a0 08 00 mv r1,r13 8004bac: fb ff f3 32 calli 8001874 <__ashlsi3> 8004bb0: 34 02 00 02 mvi r2,2 8004bb4: b4 2d 08 00 add r1,r1,r13 8004bb8: f8 00 66 cd calli 801e6ec <__lshrsi3> /* * Bump name characer */ if (c++ == 'z') 8004bbc: 78 04 08 02 mvhi r4,0x802 8004bc0: 38 84 32 4c ori r4,r4,0x324c 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; 8004bc4: 59 61 00 c0 sw (r11+192),r1 /* * Bump name characer */ if (c++ == 'z') 8004bc8: 40 81 00 00 lbu r1,(r4+0) 8004bcc: 34 22 00 01 addi r2,r1,1 8004bd0: 30 82 00 00 sb (r4+0),r2 8004bd4: 34 02 00 7a mvi r2,122 8004bd8: 5c 22 00 03 bne r1,r2,8004be4 <== ALWAYS TAKEN c = 'a'; 8004bdc: 34 01 00 61 mvi r1,97 <== NOT EXECUTED 8004be0: 30 81 00 00 sb (r4+0),r1 <== NOT EXECUTED } args->iop->data1 = tty; 8004be4: 2a 81 00 00 lw r1,(r20+0) if (!tty->refcount++) { 8004be8: 29 82 00 08 lw r2,(r12+8) */ if (c++ == 'z') c = 'a'; } args->iop->data1 = tty; 8004bec: 58 2c 00 38 sw (r1+56),r12 if (!tty->refcount++) { 8004bf0: 34 41 00 01 addi r1,r2,1 8004bf4: 59 81 00 08 sw (r12+8),r1 8004bf8: 5c 40 00 18 bne r2,r0,8004c58 <== NEVER TAKEN if (tty->device.firstOpen) 8004bfc: 29 84 00 98 lw r4,(r12+152) 8004c00: 44 82 00 05 be r4,r2,8004c14 <== ALWAYS TAKEN (*tty->device.firstOpen)(major, minor, arg); 8004c04: ba 20 08 00 mv r1,r17 <== NOT EXECUTED 8004c08: ba 40 10 00 mv r2,r18 <== NOT EXECUTED 8004c0c: ba 80 18 00 mv r3,r20 <== NOT EXECUTED 8004c10: d8 80 00 00 call r4 <== NOT EXECUTED /* * start I/O tasks, if needed */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 8004c14: 29 82 00 b4 lw r2,(r12+180) 8004c18: 34 01 00 02 mvi r1,2 8004c1c: 5c 41 00 0f bne r2,r1,8004c58 sc = rtems_task_start( 8004c20: 29 81 00 c4 lw r1,(r12+196) 8004c24: 78 02 08 00 mvhi r2,0x800 8004c28: 38 42 61 84 ori r2,r2,0x6184 8004c2c: b9 80 18 00 mv r3,r12 8004c30: f8 00 0a 26 calli 80074c8 8004c34: b8 20 58 00 mv r11,r1 tty->rxTaskId, rtems_termios_rxdaemon, (rtems_task_argument)tty); if (sc != RTEMS_SUCCESSFUL) 8004c38: 5c 20 00 07 bne r1,r0,8004c54 <== NEVER TAKEN rtems_fatal_error_occurred (sc); sc = rtems_task_start( 8004c3c: 29 81 00 c8 lw r1,(r12+200) 8004c40: 78 02 08 00 mvhi r2,0x800 8004c44: 38 42 64 04 ori r2,r2,0x6404 8004c48: b9 80 18 00 mv r3,r12 8004c4c: f8 00 0a 1f calli 80074c8 tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty); if (sc != RTEMS_SUCCESSFUL) 8004c50: 44 2b 00 02 be r1,r11,8004c58 <== ALWAYS TAKEN rtems_fatal_error_occurred (sc); 8004c54: f8 00 0a c4 calli 8007764 <== NOT EXECUTED } } rtems_semaphore_release (rtems_termios_ttyMutex); 8004c58: 78 01 08 02 mvhi r1,0x802 8004c5c: 38 21 39 d8 ori r1,r1,0x39d8 8004c60: 28 21 00 00 lw r1,(r1+0) 8004c64: f8 00 09 33 calli 8007130 return RTEMS_SUCCESSFUL; } 8004c68: b9 e0 08 00 mv r1,r15 8004c6c: 2b 9d 00 04 lw ra,(sp+4) 8004c70: 2b 8b 00 2c lw r11,(sp+44) 8004c74: 2b 8c 00 28 lw r12,(sp+40) 8004c78: 2b 8d 00 24 lw r13,(sp+36) 8004c7c: 2b 8e 00 20 lw r14,(sp+32) 8004c80: 2b 8f 00 1c lw r15,(sp+28) 8004c84: 2b 90 00 18 lw r16,(sp+24) 8004c88: 2b 91 00 14 lw r17,(sp+20) 8004c8c: 2b 92 00 10 lw r18,(sp+16) 8004c90: 2b 93 00 0c lw r19,(sp+12) 8004c94: 2b 94 00 08 lw r20,(sp+8) 8004c98: 37 9c 00 2c addi sp,sp,44 8004c9c: c3 a0 00 00 ret static char c = 'a'; /* * Create a new device */ tty = calloc (1, sizeof (struct rtems_termios_tty)); 8004ca0: 34 01 00 01 mvi r1,1 8004ca4: 34 02 00 e8 mvi r2,232 8004ca8: fb ff f6 e6 calli 8002840 8004cac: b8 20 60 00 mv r12,r1 8004cb0: b8 20 58 00 mv r11,r1 if (tty == NULL) { 8004cb4: 5c 20 fe f8 bne r1,r0,8004894 <== ALWAYS TAKEN 8004cb8: e3 ff ff 02 bi 80048c0 <== NOT EXECUTED =============================================================================== 08005274 : * Send characters to device-specific code */ void rtems_termios_puts ( const void *_buf, int len, struct rtems_termios_tty *tty) { 8005274: 37 9c ff dc addi sp,sp,-36 8005278: 5b 8b 00 24 sw (sp+36),r11 800527c: 5b 8c 00 20 sw (sp+32),r12 8005280: 5b 8d 00 1c sw (sp+28),r13 8005284: 5b 8e 00 18 sw (sp+24),r14 8005288: 5b 8f 00 14 sw (sp+20),r15 800528c: 5b 90 00 10 sw (sp+16),r16 8005290: 5b 91 00 0c sw (sp+12),r17 8005294: 5b 92 00 08 sw (sp+8),r18 8005298: 5b 9d 00 04 sw (sp+4),ra 800529c: b8 20 20 00 mv r4,r1 const unsigned char *buf = _buf; 80052a0: b8 20 68 00 mv r13,r1 unsigned int newHead; rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) { 80052a4: 28 61 00 b4 lw r1,(r3+180) * Send characters to device-specific code */ void rtems_termios_puts ( const void *_buf, int len, struct rtems_termios_tty *tty) { 80052a8: b8 40 70 00 mv r14,r2 80052ac: b8 60 58 00 mv r11,r3 const unsigned char *buf = _buf; unsigned int newHead; rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) { 80052b0: 5c 20 00 07 bne r1,r0,80052cc (*tty->device.write)(tty->minor, (void *)buf, len); 80052b4: 28 65 00 a4 lw r5,(r3+164) 80052b8: 28 61 00 10 lw r1,(r3+16) 80052bc: b8 80 10 00 mv r2,r4 80052c0: b9 c0 18 00 mv r3,r14 80052c4: d8 a0 00 00 call r5 return; 80052c8: e0 00 00 36 bi 80053a0 } newHead = tty->rawOutBuf.Head; 80052cc: 28 6c 00 80 lw r12,(r3+128) * * To minimize latency, the memcpy should be done * with interrupts enabled. */ newHead = (newHead + 1) % tty->rawOutBuf.Size; rtems_interrupt_disable (level); 80052d0: 34 10 ff fe mvi r16,-2 while (newHead == tty->rawOutBuf.Tail) { tty->rawOutBufState = rob_wait; 80052d4: 34 12 00 02 mvi r18,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; 80052d8: 34 11 00 01 mvi r17,1 if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) { (*tty->device.write)(tty->minor, (void *)buf, len); return; } newHead = tty->rawOutBuf.Head; while (len) { 80052dc: e0 00 00 30 bi 800539c * len -= ncopy * * To minimize latency, the memcpy should be done * with interrupts enabled. */ newHead = (newHead + 1) % tty->rawOutBuf.Size; 80052e0: 29 62 00 88 lw r2,(r11+136) 80052e4: 35 81 00 01 addi r1,r12,1 80052e8: f8 00 65 9d calli 801e95c <__umodsi3> 80052ec: b8 20 60 00 mv r12,r1 rtems_interrupt_disable (level); 80052f0: 90 00 78 00 rcsr r15,IE 80052f4: a1 f0 08 00 and r1,r15,r16 80052f8: d0 01 00 00 wcsr IE,r1 while (newHead == tty->rawOutBuf.Tail) { 80052fc: e0 00 00 0c bi 800532c tty->rawOutBufState = rob_wait; 8005300: 59 72 00 94 sw (r11+148),r18 rtems_interrupt_enable (level); 8005304: d0 0f 00 00 wcsr IE,r15 sc = rtems_semaphore_obtain( 8005308: 29 61 00 8c lw r1,(r11+140) 800530c: 34 02 00 00 mvi r2,0 8005310: 34 03 00 00 mvi r3,0 8005314: f8 00 07 37 calli 8006ff0 tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 8005318: 44 20 00 02 be r1,r0,8005320 <== ALWAYS TAKEN rtems_fatal_error_occurred (sc); 800531c: f8 00 09 12 calli 8007764 <== NOT EXECUTED rtems_interrupt_disable (level); 8005320: 90 00 78 00 rcsr r15,IE 8005324: a1 f0 08 00 and r1,r15,r16 8005328: d0 01 00 00 wcsr IE,r1 * 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) { 800532c: 29 61 00 84 lw r1,(r11+132) 8005330: 45 81 ff f4 be r12,r1,8005300 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++; 8005334: 29 61 00 80 lw r1,(r11+128) 8005338: 29 62 00 7c lw r2,(r11+124) 800533c: b4 41 08 00 add r1,r2,r1 8005340: 41 a2 00 00 lbu r2,(r13+0) 8005344: 35 ad 00 01 addi r13,r13,1 8005348: 30 22 00 00 sb (r1+0),r2 tty->rawOutBuf.Head = newHead; if (tty->rawOutBufState == rob_idle) { 800534c: 29 61 00 94 lw r1,(r11+148) if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } tty->rawOutBuf.theBuf[tty->rawOutBuf.Head] = *buf++; tty->rawOutBuf.Head = newHead; 8005350: 59 6c 00 80 sw (r11+128),r12 if (tty->rawOutBufState == rob_idle) { 8005354: 5c 20 00 10 bne r1,r0,8005394 /* check, whether XOFF has been received */ if (!(tty->flow_ctrl & FL_ORCVXOF)) { 8005358: 29 62 00 b8 lw r2,(r11+184) 800535c: 20 42 00 10 andi r2,r2,0x10 8005360: 5c 41 00 09 bne r2,r1,8005384 <== NEVER TAKEN (*tty->device.write)(tty->minor, 8005364: 29 63 00 7c lw r3,(r11+124) (char *)&tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); 8005368: 29 62 00 84 lw r2,(r11+132) 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, 800536c: 29 64 00 a4 lw r4,(r11+164) 8005370: 29 61 00 10 lw r1,(r11+16) 8005374: b4 62 10 00 add r2,r3,r2 8005378: 34 03 00 01 mvi r3,1 800537c: d8 80 00 00 call r4 8005380: e0 00 00 04 bi 8005390 (char *)&tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); } else { /* remember that output has been stopped due to flow ctrl*/ tty->flow_ctrl |= FL_OSTOP; 8005384: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8005388: 38 21 00 20 ori r1,r1,0x20 <== NOT EXECUTED 800538c: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED } tty->rawOutBufState = rob_busy; 8005390: 59 71 00 94 sw (r11+148),r17 } rtems_interrupt_enable (level); 8005394: d0 0f 00 00 wcsr IE,r15 len--; 8005398: 35 ce ff ff addi r14,r14,-1 if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) { (*tty->device.write)(tty->minor, (void *)buf, len); return; } newHead = tty->rawOutBuf.Head; while (len) { 800539c: 5d c0 ff d1 bne r14,r0,80052e0 tty->rawOutBufState = rob_busy; } rtems_interrupt_enable (level); len--; } } 80053a0: 2b 9d 00 04 lw ra,(sp+4) 80053a4: 2b 8b 00 24 lw r11,(sp+36) 80053a8: 2b 8c 00 20 lw r12,(sp+32) 80053ac: 2b 8d 00 1c lw r13,(sp+28) 80053b0: 2b 8e 00 18 lw r14,(sp+24) 80053b4: 2b 8f 00 14 lw r15,(sp+20) 80053b8: 2b 90 00 10 lw r16,(sp+16) 80053bc: 2b 91 00 0c lw r17,(sp+12) 80053c0: 2b 92 00 08 lw r18,(sp+8) 80053c4: 37 9c 00 24 addi sp,sp,36 80053c8: c3 a0 00 00 ret =============================================================================== 08005aec : return RTEMS_SUCCESSFUL; } rtems_status_code rtems_termios_read (void *arg) { 8005aec: 37 9c ff cc addi sp,sp,-52 8005af0: 5b 8b 00 34 sw (sp+52),r11 8005af4: 5b 8c 00 30 sw (sp+48),r12 8005af8: 5b 8d 00 2c sw (sp+44),r13 8005afc: 5b 8e 00 28 sw (sp+40),r14 8005b00: 5b 8f 00 24 sw (sp+36),r15 8005b04: 5b 90 00 20 sw (sp+32),r16 8005b08: 5b 91 00 1c sw (sp+28),r17 8005b0c: 5b 92 00 18 sw (sp+24),r18 8005b10: 5b 93 00 14 sw (sp+20),r19 8005b14: 5b 94 00 10 sw (sp+16),r20 8005b18: 5b 95 00 0c sw (sp+12),r21 8005b1c: 5b 96 00 08 sw (sp+8),r22 8005b20: 5b 9d 00 04 sw (sp+4),ra 8005b24: b8 20 60 00 mv r12,r1 rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8005b28: 28 21 00 00 lw r1,(r1+0) uint32_t count = args->count; char *buffer = args->buffer; rtems_status_code sc; sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8005b2c: 34 02 00 00 mvi r2,0 8005b30: 34 03 00 00 mvi r3,0 rtems_status_code rtems_termios_read (void *arg) { rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8005b34: 28 2b 00 38 lw r11,(r1+56) uint32_t count = args->count; 8005b38: 29 8f 00 14 lw r15,(r12+20) char *buffer = args->buffer; 8005b3c: 29 91 00 10 lw r17,(r12+16) rtems_status_code sc; sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8005b40: 29 61 00 14 lw r1,(r11+20) 8005b44: f8 00 05 2b calli 8006ff0 8005b48: b8 20 70 00 mv r14,r1 if (sc != RTEMS_SUCCESSFUL) 8005b4c: 5c 20 00 ad bne r1,r0,8005e00 <== NEVER TAKEN return sc; if (rtems_termios_linesw[tty->t_line].l_read != NULL) { 8005b50: 29 61 00 cc lw r1,(r11+204) 8005b54: 78 0d 08 02 mvhi r13,0x802 8005b58: 34 02 00 05 mvi r2,5 8005b5c: fb ff ef 46 calli 8001874 <__ashlsi3> 8005b60: 39 ad 38 10 ori r13,r13,0x3810 8005b64: b5 a1 08 00 add r1,r13,r1 8005b68: 28 23 00 08 lw r3,(r1+8) 8005b6c: 44 6e 00 06 be r3,r14,8005b84 sc = rtems_termios_linesw[tty->t_line].l_read(tty,args); 8005b70: b9 60 08 00 mv r1,r11 8005b74: b9 80 10 00 mv r2,r12 8005b78: d8 60 00 00 call r3 8005b7c: b8 20 70 00 mv r14,r1 8005b80: e0 00 00 9d bi 8005df4 tty->tty_rcvwakeup = 0; rtems_semaphore_release (tty->isem); return sc; } if (tty->cindex == tty->ccount) { 8005b84: 29 62 00 24 lw r2,(r11+36) 8005b88: 29 61 00 20 lw r1,(r11+32) 8005b8c: 5c 41 00 93 bne r2,r1,8005dd8 <== NEVER TAKEN tty->cindex = tty->ccount = 0; tty->read_start_column = tty->column; 8005b90: 29 61 00 28 lw r1,(r11+40) rtems_semaphore_release (tty->isem); return sc; } if (tty->cindex == tty->ccount) { tty->cindex = tty->ccount = 0; 8005b94: 59 60 00 20 sw (r11+32),r0 8005b98: 59 60 00 24 sw (r11+36),r0 tty->read_start_column = tty->column; 8005b9c: 59 61 00 2c sw (r11+44),r1 if (tty->device.pollRead != NULL && 8005ba0: 29 61 00 a0 lw r1,(r11+160) 8005ba4: 44 20 00 31 be r1,r0,8005c68 8005ba8: 29 61 00 b4 lw r1,(r11+180) 8005bac: 5c 20 00 2f bne r1,r0,8005c68 static rtems_status_code fillBufferPoll (struct rtems_termios_tty *tty) { int n; if (tty->termios.c_lflag & ICANON) { 8005bb0: 29 61 00 3c lw r1,(r11+60) 8005bb4: 20 21 00 02 andi r1,r1,0x2 8005bb8: 44 20 00 0d be r1,r0,8005bec <== NEVER TAKEN for (;;) { n = (*tty->device.pollRead)(tty->minor); 8005bbc: 29 62 00 a0 lw r2,(r11+160) 8005bc0: 29 61 00 10 lw r1,(r11+16) 8005bc4: d8 40 00 00 call r2 if (n < 0) { 8005bc8: 4c 20 00 04 bge r1,r0,8005bd8 rtems_task_wake_after (1); 8005bcc: 34 01 00 01 mvi r1,1 8005bd0: f8 00 06 5e calli 8007548 8005bd4: e3 ff ff fa bi 8005bbc } else { if (siproc (n, tty)) 8005bd8: 20 21 00 ff andi r1,r1,0xff 8005bdc: b9 60 10 00 mv r2,r11 8005be0: fb ff ff 6b calli 800598c 8005be4: 44 20 ff f6 be r1,r0,8005bbc 8005be8: e0 00 00 7c bi 8005dd8 } } } else { rtems_interval then, now; then = rtems_clock_get_ticks_since_boot(); 8005bec: f8 00 03 38 calli 80068cc <== NOT EXECUTED 8005bf0: b8 20 68 00 mv r13,r1 <== NOT EXECUTED for (;;) { n = (*tty->device.pollRead)(tty->minor); 8005bf4: 29 62 00 a0 lw r2,(r11+160) <== NOT EXECUTED 8005bf8: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8005bfc: d8 40 00 00 call r2 <== NOT EXECUTED if (n < 0) { 8005c00: 4c 20 00 10 bge r1,r0,8005c40 <== NOT EXECUTED if (tty->termios.c_cc[VMIN]) { 8005c04: 41 61 00 47 lbu r1,(r11+71) <== NOT EXECUTED 8005c08: 41 62 00 46 lbu r2,(r11+70) <== NOT EXECUTED 8005c0c: 44 20 00 05 be r1,r0,8005c20 <== NOT EXECUTED if (tty->termios.c_cc[VTIME] && tty->ccount) { 8005c10: 44 40 00 09 be r2,r0,8005c34 <== NOT EXECUTED 8005c14: 29 61 00 20 lw r1,(r11+32) <== NOT EXECUTED 8005c18: 44 20 00 07 be r1,r0,8005c34 <== NOT EXECUTED 8005c1c: e0 00 00 02 bi 8005c24 <== NOT EXECUTED if ((now - then) > tty->vtimeTicks) { break; } } } else { if (!tty->termios.c_cc[VTIME]) 8005c20: 44 41 00 6e be r2,r1,8005dd8 <== NOT EXECUTED break; now = rtems_clock_get_ticks_since_boot(); 8005c24: f8 00 03 2a calli 80068cc <== NOT EXECUTED if ((now - then) > tty->vtimeTicks) { 8005c28: 29 62 00 54 lw r2,(r11+84) <== NOT EXECUTED 8005c2c: c8 2d 08 00 sub r1,r1,r13 <== NOT EXECUTED 8005c30: 54 22 00 6a bgu r1,r2,8005dd8 <== NOT EXECUTED break; } } rtems_task_wake_after (1); 8005c34: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8005c38: f8 00 06 44 calli 8007548 <== NOT EXECUTED 8005c3c: e3 ff ff ee bi 8005bf4 <== NOT EXECUTED } else { siproc (n, tty); 8005c40: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8005c44: 20 21 00 ff andi r1,r1,0xff <== NOT EXECUTED 8005c48: fb ff ff 51 calli 800598c <== NOT EXECUTED if (tty->ccount >= tty->termios.c_cc[VMIN]) 8005c4c: 41 61 00 47 lbu r1,(r11+71) <== NOT EXECUTED 8005c50: 29 62 00 20 lw r2,(r11+32) <== NOT EXECUTED 8005c54: 4c 41 00 61 bge r2,r1,8005dd8 <== NOT EXECUTED break; if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME]) 8005c58: 44 20 ff e7 be r1,r0,8005bf4 <== NOT EXECUTED 8005c5c: 41 61 00 46 lbu r1,(r11+70) <== NOT EXECUTED 8005c60: 44 20 ff e5 be r1,r0,8005bf4 <== NOT EXECUTED 8005c64: e3 ff ff e2 bi 8005bec <== NOT EXECUTED while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && (tty->ccount < (CBUFSIZE-1))) { 8005c68: 78 10 08 02 mvhi r16,0x802 * Fill the input buffer from the raw input queue */ static rtems_status_code fillBufferQueue (struct rtems_termios_tty *tty) { rtems_interval timeout = tty->rawInBufSemaphoreFirstTimeout; 8005c6c: 29 72 00 74 lw r18,(r11+116) rtems_status_code sc; int wait = (int)1; 8005c70: 34 0d 00 01 mvi r13,1 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && (tty->ccount < (CBUFSIZE-1))) { 8005c74: 3a 10 32 40 ori r16,r16,0x3240 c = tty->rawInBuf.theBuf[newHead]; tty->rawInBuf.Head = newHead; if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size) % tty->rawInBuf.Size) < tty->lowwater) { tty->flow_ctrl &= ~FL_IREQXOF; 8005c78: 34 16 ff fe mvi r22,-2 /* if tx stopped and XON should be sent... */ if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF)) 8005c7c: 34 15 02 02 mvi r21,514 || (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; 8005c80: 34 14 ff fb mvi r20,-5 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)( 8005c84: 35 73 00 49 addi r19,r11,73 8005c88: e0 00 00 3e bi 8005d80 while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && (tty->ccount < (CBUFSIZE-1))) { unsigned char c; unsigned int newHead; newHead = (tty->rawInBuf.Head + 1) % tty->rawInBuf.Size; 8005c8c: 29 61 00 5c lw r1,(r11+92) 8005c90: 29 62 00 64 lw r2,(r11+100) 8005c94: 34 21 00 01 addi r1,r1,1 8005c98: f8 00 63 31 calli 801e95c <__umodsi3> 8005c9c: b8 20 18 00 mv r3,r1 c = tty->rawInBuf.theBuf[newHead]; 8005ca0: 29 61 00 58 lw r1,(r11+88) 8005ca4: b4 23 08 00 add r1,r1,r3 8005ca8: 40 32 00 00 lbu r18,(r1+0) tty->rawInBuf.Head = newHead; 8005cac: 59 63 00 5c sw (r11+92),r3 if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size) 8005cb0: 29 61 00 60 lw r1,(r11+96) 8005cb4: 29 64 00 64 lw r4,(r11+100) % tty->rawInBuf.Size) 8005cb8: 29 62 00 64 lw r2,(r11+100) 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) 8005cbc: b4 81 08 00 add r1,r4,r1 % tty->rawInBuf.Size) 8005cc0: c8 23 08 00 sub r1,r1,r3 8005cc4: f8 00 63 26 calli 801e95c <__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) 8005cc8: 29 62 00 bc lw r2,(r11+188) 8005ccc: 50 22 00 1c bgeu r1,r2,8005d3c <== NEVER TAKEN % tty->rawInBuf.Size) < tty->lowwater) { tty->flow_ctrl &= ~FL_IREQXOF; 8005cd0: 29 61 00 b8 lw r1,(r11+184) 8005cd4: a0 36 08 00 and r1,r1,r22 8005cd8: 59 61 00 b8 sw (r11+184),r1 /* if tx stopped and XON should be sent... */ if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF)) 8005cdc: 29 61 00 b8 lw r1,(r11+184) 8005ce0: 20 21 02 02 andi r1,r1,0x202 8005ce4: 5c 35 00 0c bne r1,r21,8005d14 <== ALWAYS TAKEN == (FL_MDXON | FL_ISNTXOF)) && ((tty->rawOutBufState == rob_idle) 8005ce8: 29 61 00 94 lw r1,(r11+148) <== NOT EXECUTED 8005cec: 44 20 00 04 be r1,r0,8005cfc <== NOT EXECUTED || (tty->flow_ctrl & FL_OSTOP))) { 8005cf0: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8005cf4: 20 21 00 20 andi r1,r1,0x20 <== NOT EXECUTED 8005cf8: 44 20 00 07 be r1,r0,8005d14 <== NOT EXECUTED /* XON should be sent now... */ (*tty->device.write)( 8005cfc: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED 8005d00: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8005d04: ba 60 10 00 mv r2,r19 <== NOT EXECUTED 8005d08: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 8005d0c: d8 80 00 00 call r4 <== NOT EXECUTED 8005d10: e0 00 00 0b bi 8005d3c <== NOT EXECUTED tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1); } else if (tty->flow_ctrl & FL_MDRTS) { 8005d14: 29 61 00 b8 lw r1,(r11+184) 8005d18: 20 21 01 00 andi r1,r1,0x100 8005d1c: 44 20 00 08 be r1,r0,8005d3c <== ALWAYS TAKEN tty->flow_ctrl &= ~FL_IRTSOFF; 8005d20: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED /* activate RTS line */ if (tty->device.startRemoteTx != NULL) { 8005d24: 29 63 00 b0 lw r3,(r11+176) <== 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; 8005d28: a0 34 08 00 and r1,r1,r20 <== NOT EXECUTED 8005d2c: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* activate RTS line */ if (tty->device.startRemoteTx != NULL) { 8005d30: 44 60 00 03 be r3,r0,8005d3c <== NOT EXECUTED tty->device.startRemoteTx(tty->minor); 8005d34: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8005d38: d8 60 00 00 call r3 <== NOT EXECUTED } } } /* continue processing new character */ if (tty->termios.c_lflag & ICANON) { 8005d3c: 29 61 00 3c lw r1,(r11+60) 8005d40: 20 21 00 02 andi r1,r1,0x2 8005d44: 44 20 00 06 be r1,r0,8005d5c <== NEVER TAKEN if (siproc (c, tty)) 8005d48: ba 40 08 00 mv r1,r18 8005d4c: b9 60 10 00 mv r2,r11 8005d50: fb ff ff 0f calli 800598c wait = 0; 8005d54: 64 21 00 00 cmpei r1,r1,0 8005d58: e0 00 00 07 bi 8005d74 } else { siproc (c, tty); 8005d5c: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8005d60: ba 40 08 00 mv r1,r18 <== NOT EXECUTED 8005d64: fb ff ff 0a calli 800598c <== NOT EXECUTED if (tty->ccount >= tty->termios.c_cc[VMIN]) 8005d68: 41 61 00 47 lbu r1,(r11+71) <== NOT EXECUTED 8005d6c: 29 62 00 20 lw r2,(r11+32) <== NOT EXECUTED wait = 0; 8005d70: e8 22 08 00 cmpg r1,r1,r2 <== NOT EXECUTED } timeout = tty->rawInBufSemaphoreTimeout; 8005d74: 29 72 00 70 lw r18,(r11+112) if (siproc (c, tty)) wait = 0; } else { siproc (c, tty); if (tty->ccount >= tty->termios.c_cc[VMIN]) wait = 0; 8005d78: c8 01 08 00 sub r1,r0,r1 8005d7c: a1 a1 68 00 and r13,r13,r1 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 8005d80: 29 62 00 5c lw r2,(r11+92) 8005d84: 29 61 00 60 lw r1,(r11+96) 8005d88: 44 41 00 05 be r2,r1,8005d9c (tty->ccount < (CBUFSIZE-1))) { 8005d8c: 2a 01 00 00 lw r1,(r16+0) while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 8005d90: 29 62 00 20 lw r2,(r11+32) (tty->ccount < (CBUFSIZE-1))) { 8005d94: 34 21 ff ff addi r1,r1,-1 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 8005d98: 48 22 ff bd bg r1,r2,8005c8c <== ALWAYS TAKEN } /* * Wait for characters */ if ( wait ) { 8005d9c: 45 a0 00 0f be r13,r0,8005dd8 sc = rtems_semaphore_obtain( 8005da0: 29 61 00 68 lw r1,(r11+104) 8005da4: 29 62 00 6c lw r2,(r11+108) 8005da8: ba 40 18 00 mv r3,r18 8005dac: f8 00 04 91 calli 8006ff0 tty->rawInBuf.Semaphore, tty->rawInBufSemaphoreOptions, timeout); if (sc != RTEMS_SUCCESSFUL) 8005db0: 44 20 ff f4 be r1,r0,8005d80 <== ALWAYS TAKEN 8005db4: e0 00 00 09 bi 8005dd8 <== NOT EXECUTED if (sc != RTEMS_SUCCESSFUL) tty->cindex = tty->ccount = 0; } while (count && (tty->cindex < tty->ccount)) { *buffer++ = tty->cbuf[tty->cindex++]; 8005db8: 29 62 00 1c lw r2,(r11+28) count--; 8005dbc: 35 ef ff ff addi r15,r15,-1 if (sc != RTEMS_SUCCESSFUL) tty->cindex = tty->ccount = 0; } while (count && (tty->cindex < tty->ccount)) { *buffer++ = tty->cbuf[tty->cindex++]; 8005dc0: b4 41 10 00 add r2,r2,r1 8005dc4: 40 42 00 00 lbu r2,(r2+0) 8005dc8: 34 21 00 01 addi r1,r1,1 8005dcc: 32 22 00 00 sb (r17+0),r2 8005dd0: 59 61 00 24 sw (r11+36),r1 8005dd4: 36 31 00 01 addi r17,r17,1 sc = fillBufferQueue (tty); if (sc != RTEMS_SUCCESSFUL) tty->cindex = tty->ccount = 0; } while (count && (tty->cindex < tty->ccount)) { 8005dd8: 45 e0 00 04 be r15,r0,8005de8 <== NEVER TAKEN 8005ddc: 29 61 00 24 lw r1,(r11+36) 8005de0: 29 62 00 20 lw r2,(r11+32) 8005de4: 48 41 ff f5 bg r2,r1,8005db8 *buffer++ = tty->cbuf[tty->cindex++]; count--; } args->bytes_moved = args->count - count; 8005de8: 29 81 00 14 lw r1,(r12+20) 8005dec: c8 2f 78 00 sub r15,r1,r15 8005df0: 59 8f 00 1c sw (r12+28),r15 tty->tty_rcvwakeup = 0; rtems_semaphore_release (tty->isem); 8005df4: 29 61 00 14 lw r1,(r11+20) while (count && (tty->cindex < tty->ccount)) { *buffer++ = tty->cbuf[tty->cindex++]; count--; } args->bytes_moved = args->count - count; tty->tty_rcvwakeup = 0; 8005df8: 59 60 00 e4 sw (r11+228),r0 rtems_semaphore_release (tty->isem); 8005dfc: f8 00 04 cd calli 8007130 return sc; } 8005e00: b9 c0 08 00 mv r1,r14 8005e04: 2b 9d 00 04 lw ra,(sp+4) 8005e08: 2b 8b 00 34 lw r11,(sp+52) 8005e0c: 2b 8c 00 30 lw r12,(sp+48) 8005e10: 2b 8d 00 2c lw r13,(sp+44) 8005e14: 2b 8e 00 28 lw r14,(sp+40) 8005e18: 2b 8f 00 24 lw r15,(sp+36) 8005e1c: 2b 90 00 20 lw r16,(sp+32) 8005e20: 2b 91 00 1c lw r17,(sp+28) 8005e24: 2b 92 00 18 lw r18,(sp+24) 8005e28: 2b 93 00 14 lw r19,(sp+20) 8005e2c: 2b 94 00 10 lw r20,(sp+16) 8005e30: 2b 95 00 0c lw r21,(sp+12) 8005e34: 2b 96 00 08 lw r22,(sp+8) 8005e38: 37 9c 00 34 addi sp,sp,52 8005e3c: c3 a0 00 00 ret =============================================================================== 08006200 : * 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) { 8006200: 37 9c ff f0 addi sp,sp,-16 8006204: 5b 8b 00 10 sw (sp+16),r11 8006208: 5b 8c 00 0c sw (sp+12),r12 800620c: 5b 8d 00 08 sw (sp+8),r13 8006210: 5b 9d 00 04 sw (sp+4),ra int nToSend; rtems_interrupt_level level; int len; /* check for XOF/XON to send */ if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF)) 8006214: 28 22 00 b8 lw r2,(r1+184) * 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) { 8006218: b8 20 58 00 mv r11,r1 int nToSend; rtems_interrupt_level level; int len; /* check for XOF/XON to send */ if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF)) 800621c: 34 01 04 01 mvi r1,1025 8006220: 20 42 04 03 andi r2,r2,0x403 8006224: 5c 41 00 12 bne r2,r1,800626c <== ALWAYS TAKEN == (FL_MDXOF | FL_IREQXOF)) { /* XOFF should be sent now... */ (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1); 8006228: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED 800622c: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8006230: 35 62 00 4a addi r2,r11,74 <== NOT EXECUTED 8006234: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 8006238: d8 80 00 00 call r4 <== NOT EXECUTED rtems_interrupt_disable(level); 800623c: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED 8006240: 34 02 ff fe mvi r2,-2 <== NOT EXECUTED 8006244: a0 22 10 00 and r2,r1,r2 <== NOT EXECUTED 8006248: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED tty->t_dqlen--; 800624c: 29 62 00 90 lw r2,(r11+144) <== NOT EXECUTED 8006250: 34 42 ff ff addi r2,r2,-1 <== NOT EXECUTED 8006254: 59 62 00 90 sw (r11+144),r2 <== NOT EXECUTED tty->flow_ctrl |= FL_ISNTXOF; 8006258: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 800625c: 38 42 00 02 ori r2,r2,0x2 <== NOT EXECUTED 8006260: 59 62 00 b8 sw (r11+184),r2 <== NOT EXECUTED rtems_interrupt_enable(level); 8006264: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED 8006268: e0 00 00 16 bi 80062c0 <== NOT EXECUTED nToSend = 1; } else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) { 800626c: 29 62 00 b8 lw r2,(r11+184) 8006270: 34 01 00 02 mvi r1,2 8006274: 20 42 00 03 andi r2,r2,0x3 8006278: 5c 41 00 14 bne r2,r1,80062c8 <== ALWAYS TAKEN * 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); 800627c: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED 8006280: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8006284: 35 62 00 49 addi r2,r11,73 <== NOT EXECUTED 8006288: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 800628c: d8 80 00 00 call r4 <== NOT EXECUTED rtems_interrupt_disable(level); 8006290: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED 8006294: 34 02 ff fe mvi r2,-2 <== NOT EXECUTED 8006298: a0 22 10 00 and r2,r1,r2 <== NOT EXECUTED 800629c: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED tty->t_dqlen--; 80062a0: 29 62 00 90 lw r2,(r11+144) <== NOT EXECUTED tty->flow_ctrl &= ~FL_ISNTXOF; 80062a4: 29 63 00 b8 lw r3,(r11+184) <== 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--; 80062a8: 34 42 ff ff addi r2,r2,-1 <== NOT EXECUTED 80062ac: 59 62 00 90 sw (r11+144),r2 <== NOT EXECUTED tty->flow_ctrl &= ~FL_ISNTXOF; 80062b0: 34 02 ff fd mvi r2,-3 <== NOT EXECUTED 80062b4: a0 62 10 00 and r2,r3,r2 <== NOT EXECUTED 80062b8: 59 62 00 b8 sw (r11+184),r2 <== NOT EXECUTED rtems_interrupt_enable(level); 80062bc: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED nToSend = 1; 80062c0: 34 0c 00 01 mvi r12,1 <== NOT EXECUTED 80062c4: e0 00 00 49 bi 80063e8 <== NOT EXECUTED } else { if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) { 80062c8: 29 63 00 80 lw r3,(r11+128) 80062cc: 29 62 00 84 lw r2,(r11+132) 80062d0: 5c 62 00 07 bne r3,r2,80062ec /* * buffer was empty */ if (tty->rawOutBufState == rob_wait) { 80062d4: 29 62 00 94 lw r2,(r11+148) /* * this should never happen... */ rtems_semaphore_release (tty->rawOutBuf.Semaphore); } return 0; 80062d8: 34 0c 00 00 mvi r12,0 } else { if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) { /* * buffer was empty */ if (tty->rawOutBufState == rob_wait) { 80062dc: 5c 41 00 43 bne r2,r1,80063e8 <== ALWAYS TAKEN /* * this should never happen... */ rtems_semaphore_release (tty->rawOutBuf.Semaphore); 80062e0: 29 61 00 8c lw r1,(r11+140) <== NOT EXECUTED 80062e4: f8 00 03 93 calli 8007130 <== NOT EXECUTED 80062e8: e0 00 00 40 bi 80063e8 <== NOT EXECUTED } return 0; } rtems_interrupt_disable(level); 80062ec: 90 00 10 00 rcsr r2,IE 80062f0: 34 01 ff fe mvi r1,-2 80062f4: a0 41 08 00 and r1,r2,r1 80062f8: d0 01 00 00 wcsr IE,r1 len = tty->t_dqlen; 80062fc: 29 63 00 90 lw r3,(r11+144) tty->t_dqlen = 0; 8006300: 59 60 00 90 sw (r11+144),r0 rtems_interrupt_enable(level); 8006304: d0 02 00 00 wcsr IE,r2 newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size; 8006308: 29 61 00 84 lw r1,(r11+132) 800630c: 29 62 00 88 lw r2,(r11+136) 8006310: b4 61 08 00 add r1,r3,r1 8006314: f8 00 61 92 calli 801e95c <__umodsi3> tty->rawOutBuf.Tail = newTail; if (tty->rawOutBufState == rob_wait) { 8006318: 29 62 00 94 lw r2,(r11+148) rtems_interrupt_disable(level); len = tty->t_dqlen; tty->t_dqlen = 0; rtems_interrupt_enable(level); newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size; 800631c: b8 20 68 00 mv r13,r1 tty->rawOutBuf.Tail = newTail; 8006320: 59 61 00 84 sw (r11+132),r1 if (tty->rawOutBufState == rob_wait) { 8006324: 34 01 00 02 mvi r1,2 8006328: 5c 41 00 03 bne r2,r1,8006334 /* * wake up any pending writer task */ rtems_semaphore_release (tty->rawOutBuf.Semaphore); 800632c: 29 61 00 8c lw r1,(r11+140) 8006330: f8 00 03 80 calli 8007130 } if (newTail == tty->rawOutBuf.Head) { 8006334: 29 61 00 80 lw r1,(r11+128) 8006338: 5d a1 00 09 bne r13,r1,800635c nToSend = 0; /* * check to see if snd wakeup callback was set */ if ( tty->tty_snd.sw_pfn != NULL) { 800633c: 29 63 00 d4 lw r3,(r11+212) if (newTail == tty->rawOutBuf.Head) { /* * Buffer has become empty */ tty->rawOutBufState = rob_idle; 8006340: 59 60 00 94 sw (r11+148),r0 nToSend = 0; 8006344: 34 0c 00 00 mvi r12,0 /* * check to see if snd wakeup callback was set */ if ( tty->tty_snd.sw_pfn != NULL) { 8006348: 44 60 00 27 be r3,r0,80063e4 <== ALWAYS TAKEN (*tty->tty_snd.sw_pfn)(&tty->termios, tty->tty_snd.sw_arg); 800634c: 29 62 00 d8 lw r2,(r11+216) <== NOT EXECUTED 8006350: 35 61 00 30 addi r1,r11,48 <== NOT EXECUTED 8006354: d8 60 00 00 call r3 <== NOT EXECUTED 8006358: e0 00 00 23 bi 80063e4 <== NOT EXECUTED } } /* check, whether output should stop due to received XOFF */ else if ((tty->flow_ctrl & (FL_MDXON | FL_ORCVXOF)) 800635c: 29 62 00 b8 lw r2,(r11+184) 8006360: 34 01 02 10 mvi r1,528 8006364: 20 42 02 10 andi r2,r2,0x210 8006368: 5c 41 00 0d bne r2,r1,800639c <== ALWAYS TAKEN == (FL_MDXON | FL_ORCVXOF)) { /* Buffer not empty, but output stops due to XOFF */ /* set flag, that output has been stopped */ rtems_interrupt_disable(level); 800636c: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED 8006370: 34 02 ff fe mvi r2,-2 <== NOT EXECUTED 8006374: a0 22 10 00 and r2,r1,r2 <== NOT EXECUTED 8006378: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED tty->flow_ctrl |= FL_OSTOP; 800637c: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 8006380: 38 42 00 20 ori r2,r2,0x20 <== NOT EXECUTED 8006384: 59 62 00 b8 sw (r11+184),r2 <== NOT EXECUTED tty->rawOutBufState = rob_busy; /*apm*/ 8006388: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 800638c: 59 62 00 94 sw (r11+148),r2 <== NOT EXECUTED rtems_interrupt_enable(level); 8006390: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED nToSend = 0; 8006394: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED 8006398: e0 00 00 13 bi 80063e4 <== NOT EXECUTED } else { /* * Buffer not empty, start tranmitter */ if (newTail > tty->rawOutBuf.Head) 800639c: 29 61 00 80 lw r1,(r11+128) 80063a0: 50 2d 00 03 bgeu r1,r13,80063ac nToSend = tty->rawOutBuf.Size - newTail; 80063a4: 29 6c 00 88 lw r12,(r11+136) 80063a8: e0 00 00 02 bi 80063b0 else nToSend = tty->rawOutBuf.Head - newTail; 80063ac: 29 6c 00 80 lw r12,(r11+128) /* 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)) { 80063b0: 29 61 00 b8 lw r1,(r11+184) * Buffer not empty, start tranmitter */ if (newTail > tty->rawOutBuf.Head) nToSend = tty->rawOutBuf.Size - newTail; else nToSend = tty->rawOutBuf.Head - newTail; 80063b4: c9 8d 60 00 sub r12,r12,r13 /* 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)) { 80063b8: 20 21 06 00 andi r1,r1,0x600 80063bc: 44 20 00 02 be r1,r0,80063c4 nToSend = 1; 80063c0: 34 0c 00 01 mvi r12,1 } tty->rawOutBufState = rob_busy; /*apm*/ 80063c4: 34 01 00 01 mvi r1,1 (*tty->device.write)( 80063c8: 29 62 00 7c lw r2,(r11+124) /* 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; } tty->rawOutBufState = rob_busy; /*apm*/ 80063cc: 59 61 00 94 sw (r11+148),r1 (*tty->device.write)( 80063d0: 29 64 00 a4 lw r4,(r11+164) 80063d4: 29 61 00 10 lw r1,(r11+16) 80063d8: b4 4d 10 00 add r2,r2,r13 80063dc: b9 80 18 00 mv r3,r12 80063e0: d8 80 00 00 call r4 tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend); } tty->rawOutBuf.Tail = newTail; /*apm*/ 80063e4: 59 6d 00 84 sw (r11+132),r13 } return nToSend; } 80063e8: b9 80 08 00 mv r1,r12 80063ec: 2b 9d 00 04 lw ra,(sp+4) 80063f0: 2b 8b 00 10 lw r11,(sp+16) 80063f4: 2b 8c 00 0c lw r12,(sp+12) 80063f8: 2b 8d 00 08 lw r13,(sp+8) 80063fc: 37 9c 00 10 addi sp,sp,16 8006400: c3 a0 00 00 ret =============================================================================== 08006184 : /* * this task actually processes any receive events */ static rtems_task rtems_termios_rxdaemon(rtems_task_argument argument) { 8006184: 37 9c ff e4 addi sp,sp,-28 8006188: 5b 8b 00 14 sw (sp+20),r11 800618c: 5b 8c 00 10 sw (sp+16),r12 8006190: 5b 8d 00 0c sw (sp+12),r13 8006194: 5b 8e 00 08 sw (sp+8),r14 8006198: 5b 9d 00 04 sw (sp+4),ra /* * do something */ c = tty->device.pollRead(tty->minor); if (c != EOF) { 800619c: 34 0d ff ff mvi r13,-1 /* * this task actually processes any receive events */ static rtems_task rtems_termios_rxdaemon(rtems_task_argument argument) { 80061a0: b8 20 58 00 mv r11,r1 while (1) { /* * wait for rtems event */ rtems_event_receive( 80061a4: 37 8e 00 18 addi r14,sp,24 if (c != EOF) { /* * pollRead did call enqueue on its own */ c_buf = c; rtems_termios_enqueue_raw_characters ( tty,&c_buf,1); 80061a8: 37 8c 00 1f addi r12,sp,31 while (1) { /* * wait for rtems event */ rtems_event_receive( 80061ac: 34 01 00 03 mvi r1,3 80061b0: 34 02 00 02 mvi r2,2 80061b4: 34 03 00 00 mvi r3,0 80061b8: b9 c0 20 00 mv r4,r14 80061bc: f8 00 01 dd calli 8006930 (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) { 80061c0: 2b 81 00 18 lw r1,(sp+24) 80061c4: 20 21 00 01 andi r1,r1,0x1 80061c8: 44 20 00 04 be r1,r0,80061d8 <== ALWAYS TAKEN tty->rxTaskId = 0; 80061cc: 59 60 00 c4 sw (r11+196),r0 <== NOT EXECUTED rtems_task_delete(RTEMS_SELF); 80061d0: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 80061d4: f8 00 04 6c calli 8007384 <== NOT EXECUTED } /* * do something */ c = tty->device.pollRead(tty->minor); 80061d8: 29 62 00 a0 lw r2,(r11+160) 80061dc: 29 61 00 10 lw r1,(r11+16) 80061e0: d8 40 00 00 call r2 if (c != EOF) { 80061e4: 44 2d ff f2 be r1,r13,80061ac /* * pollRead did call enqueue on its own */ c_buf = c; 80061e8: 33 81 00 1f sb (sp+31),r1 rtems_termios_enqueue_raw_characters ( tty,&c_buf,1); 80061ec: b9 80 10 00 mv r2,r12 80061f0: b9 60 08 00 mv r1,r11 80061f4: 34 03 00 01 mvi r3,1 80061f8: fb ff ff 1a calli 8005e60 80061fc: e3 ff ff ec bi 80061ac =============================================================================== 080064f4 : int rtems_termios_set_initial_baud( struct rtems_termios_tty *ttyp, int32_t baud ) { 80064f4: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED 80064f8: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED 80064fc: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED 8006500: b8 20 58 00 mv r11,r1 <== NOT EXECUTED int cflags_baud; cflags_baud = rtems_termios_number_to_baud(baud); 8006504: b8 40 08 00 mv r1,r2 <== NOT EXECUTED 8006508: fb ff f8 4f calli 8004644 <== NOT EXECUTED if ( cflags_baud == -1 ) return -1; 800650c: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED ) { int cflags_baud; cflags_baud = rtems_termios_number_to_baud(baud); if ( cflags_baud == -1 ) 8006510: 44 22 00 07 be r1,r2,800652c <== NOT EXECUTED return -1; ttyp->termios.c_cflag = (ttyp->termios.c_cflag & ~CBAUD) | cflags_baud; 8006514: 29 63 00 38 lw r3,(r11+56) <== NOT EXECUTED 8006518: 34 02 ef f0 mvi r2,-4112 <== NOT EXECUTED 800651c: a0 43 10 00 and r2,r2,r3 <== NOT EXECUTED 8006520: b8 22 08 00 or r1,r1,r2 <== NOT EXECUTED 8006524: 59 61 00 38 sw (r11+56),r1 <== NOT EXECUTED return 0; 8006528: 34 02 00 00 mvi r2,0 <== NOT EXECUTED } 800652c: b8 40 08 00 mv r1,r2 <== NOT EXECUTED 8006530: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8006534: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 8006538: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 800653c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08006404 : /* * this task actually processes any transmit events */ static rtems_task rtems_termios_txdaemon(rtems_task_argument argument) { 8006404: 37 9c ff f0 addi sp,sp,-16 8006408: 5b 8b 00 0c sw (sp+12),r11 800640c: 5b 8c 00 08 sw (sp+8),r12 8006410: 5b 9d 00 04 sw (sp+4),ra } /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 8006414: 78 0c 08 02 mvhi r12,0x802 /* * this task actually processes any transmit events */ static rtems_task rtems_termios_txdaemon(rtems_task_argument argument) { 8006418: b8 20 58 00 mv r11,r1 } /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 800641c: 39 8c 38 10 ori r12,r12,0x3810 while (1) { /* * wait for rtems event */ rtems_event_receive( 8006420: 34 01 00 03 mvi r1,3 8006424: 34 02 00 02 mvi r2,2 8006428: 34 03 00 00 mvi r3,0 800642c: 37 84 00 10 addi r4,sp,16 8006430: f8 00 01 40 calli 8006930 (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) { 8006434: 2b 81 00 10 lw r1,(sp+16) 8006438: 20 21 00 01 andi r1,r1,0x1 800643c: 44 20 00 04 be r1,r0,800644c <== ALWAYS TAKEN tty->txTaskId = 0; 8006440: 59 60 00 c8 sw (r11+200),r0 <== NOT EXECUTED rtems_task_delete(RTEMS_SELF); 8006444: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8006448: f8 00 03 cf calli 8007384 <== NOT EXECUTED } /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 800644c: 29 61 00 cc lw r1,(r11+204) 8006450: 34 02 00 05 mvi r2,5 8006454: fb ff ed 08 calli 8001874 <__ashlsi3> 8006458: b5 81 08 00 add r1,r12,r1 800645c: 28 22 00 14 lw r2,(r1+20) 8006460: 44 40 00 03 be r2,r0,800646c <== ALWAYS TAKEN rtems_termios_linesw[tty->t_line].l_start(tty); 8006464: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8006468: d8 40 00 00 call r2 <== NOT EXECUTED } /* * try to push further characters to device */ rtems_termios_refill_transmitter(tty); 800646c: b9 60 08 00 mv r1,r11 8006470: fb ff ff 64 calli 8006200 } 8006474: e3 ff ff eb bi 8006420 =============================================================================== 08005a00 : rtems_termios_puts (&c, 1, tty); } rtems_status_code rtems_termios_write (void *arg) { 8005a00: 37 9c ff e8 addi sp,sp,-24 8005a04: 5b 8b 00 18 sw (sp+24),r11 8005a08: 5b 8c 00 14 sw (sp+20),r12 8005a0c: 5b 8d 00 10 sw (sp+16),r13 8005a10: 5b 8e 00 0c sw (sp+12),r14 8005a14: 5b 8f 00 08 sw (sp+8),r15 8005a18: 5b 9d 00 04 sw (sp+4),ra 8005a1c: b8 20 58 00 mv r11,r1 rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8005a20: 28 21 00 00 lw r1,(r1+0) rtems_status_code sc; sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8005a24: 34 02 00 00 mvi r2,0 8005a28: 34 03 00 00 mvi r3,0 rtems_status_code rtems_termios_write (void *arg) { rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8005a2c: 28 2c 00 38 lw r12,(r1+56) rtems_status_code sc; sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8005a30: 29 81 00 18 lw r1,(r12+24) 8005a34: f8 00 05 6f calli 8006ff0 8005a38: b8 20 68 00 mv r13,r1 if (sc != RTEMS_SUCCESSFUL) 8005a3c: 5c 20 00 23 bne r1,r0,8005ac8 <== NEVER TAKEN return sc; if (rtems_termios_linesw[tty->t_line].l_write != NULL) { 8005a40: 29 81 00 cc lw r1,(r12+204) 8005a44: 78 0e 08 02 mvhi r14,0x802 8005a48: 34 02 00 05 mvi r2,5 8005a4c: fb ff ef 8a calli 8001874 <__ashlsi3> 8005a50: 39 ce 38 10 ori r14,r14,0x3810 8005a54: b5 c1 08 00 add r1,r14,r1 8005a58: 28 23 00 0c lw r3,(r1+12) 8005a5c: 44 6d 00 06 be r3,r13,8005a74 sc = rtems_termios_linesw[tty->t_line].l_write(tty,args); 8005a60: b9 80 08 00 mv r1,r12 8005a64: b9 60 10 00 mv r2,r11 8005a68: d8 60 00 00 call r3 8005a6c: b8 20 68 00 mv r13,r1 8005a70: e0 00 00 14 bi 8005ac0 rtems_semaphore_release (tty->osem); return sc; } if (tty->termios.c_oflag & OPOST) { 8005a74: 29 83 00 34 lw r3,(r12+52) 8005a78: 29 62 00 14 lw r2,(r11+20) 8005a7c: 29 61 00 10 lw r1,(r11+16) 8005a80: 20 63 00 01 andi r3,r3,0x1 uint32_t count = args->count; 8005a84: b8 40 78 00 mv r15,r2 char *buffer = args->buffer; 8005a88: b8 20 70 00 mv r14,r1 if (rtems_termios_linesw[tty->t_line].l_write != NULL) { sc = rtems_termios_linesw[tty->t_line].l_write(tty,args); rtems_semaphore_release (tty->osem); return sc; } if (tty->termios.c_oflag & OPOST) { 8005a8c: 5c 60 00 07 bne r3,r0,8005aa8 <== ALWAYS TAKEN 8005a90: e0 00 00 08 bi 8005ab0 <== NOT EXECUTED uint32_t count = args->count; char *buffer = args->buffer; while (count--) oproc (*buffer++, tty); 8005a94: 41 c1 00 00 lbu r1,(r14+0) 8005a98: b9 80 10 00 mv r2,r12 8005a9c: 35 ce 00 01 addi r14,r14,1 8005aa0: fb ff fe 4b calli 80053cc 8005aa4: 35 ef ff ff addi r15,r15,-1 return sc; } if (tty->termios.c_oflag & OPOST) { uint32_t count = args->count; char *buffer = args->buffer; while (count--) 8005aa8: 5d e0 ff fb bne r15,r0,8005a94 8005aac: e0 00 00 03 bi 8005ab8 oproc (*buffer++, tty); args->bytes_moved = args->count; } else { rtems_termios_puts (args->buffer, args->count, tty); 8005ab0: b9 80 18 00 mv r3,r12 <== NOT EXECUTED 8005ab4: fb ff fd f0 calli 8005274 <== NOT EXECUTED args->bytes_moved = args->count; 8005ab8: 29 61 00 14 lw r1,(r11+20) 8005abc: 59 61 00 1c sw (r11+28),r1 } rtems_semaphore_release (tty->osem); 8005ac0: 29 81 00 18 lw r1,(r12+24) 8005ac4: f8 00 05 9b calli 8007130 return sc; } 8005ac8: b9 a0 08 00 mv r1,r13 8005acc: 2b 9d 00 04 lw ra,(sp+4) 8005ad0: 2b 8b 00 18 lw r11,(sp+24) 8005ad4: 2b 8c 00 14 lw r12,(sp+20) 8005ad8: 2b 8d 00 10 lw r13,(sp+16) 8005adc: 2b 8e 00 0c lw r14,(sp+12) 8005ae0: 2b 8f 00 08 lw r15,(sp+8) 8005ae4: 37 9c 00 18 addi sp,sp,24 8005ae8: c3 a0 00 00 ret =============================================================================== 08013fd0 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 8013fd0: 37 9c ff f8 addi sp,sp,-8 8013fd4: 5b 9d 00 04 sw (sp+4),ra 8013fd8: b8 20 10 00 mv r2,r1 Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) _Objects_Get( &_Timer_Information, id, location ); 8013fdc: 78 01 08 04 mvhi r1,0x804 8013fe0: 38 21 15 8c ori r1,r1,0x158c 8013fe4: 37 83 00 08 addi r3,sp,8 8013fe8: f8 00 0e 99 calli 8017a4c <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 8013fec: 2b 82 00 08 lw r2,(sp+8) 8013ff0: 5c 40 00 09 bne r2,r0,8014014 <== NEVER TAKEN case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 8013ff4: 28 23 00 38 lw r3,(r1+56) 8013ff8: 34 02 00 04 mvi r2,4 8013ffc: 44 62 00 03 be r3,r2,8014008 <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 8014000: 34 21 00 10 addi r1,r1,16 8014004: f8 00 18 86 calli 801a21c <_Watchdog_Remove> _Thread_Enable_dispatch(); 8014008: f8 00 11 5b calli 8018574 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 801400c: 34 01 00 00 mvi r1,0 8014010: e0 00 00 02 bi 8014018 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 8014014: 34 01 00 04 mvi r1,4 } 8014018: 2b 9d 00 04 lw ra,(sp+4) 801401c: 37 9c 00 08 addi sp,sp,8 8014020: c3 a0 00 00 ret =============================================================================== 080145ec : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 80145ec: 37 9c ff dc addi sp,sp,-36 80145f0: 5b 8b 00 20 sw (sp+32),r11 80145f4: 5b 8c 00 1c sw (sp+28),r12 80145f8: 5b 8d 00 18 sw (sp+24),r13 80145fc: 5b 8e 00 14 sw (sp+20),r14 8014600: 5b 8f 00 10 sw (sp+16),r15 8014604: 5b 90 00 0c sw (sp+12),r16 8014608: 5b 91 00 08 sw (sp+8),r17 801460c: 5b 9d 00 04 sw (sp+4),ra Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 8014610: 78 05 08 04 mvhi r5,0x804 8014614: 38 a5 15 cc ori r5,r5,0x15cc 8014618: 28 ad 00 00 lw r13,(r5+0) rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 801461c: b8 20 78 00 mv r15,r1 8014620: b8 40 60 00 mv r12,r2 8014624: b8 60 80 00 mv r16,r3 8014628: b8 80 88 00 mv r17,r4 Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; 801462c: 34 0b 00 0e mvi r11,14 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) 8014630: 45 a0 00 2e be r13,r0,80146e8 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 8014634: 78 05 08 04 mvhi r5,0x804 8014638: 38 a5 0c b4 ori r5,r5,0xcb4 801463c: 40 a1 00 00 lbu r1,(r5+0) return RTEMS_NOT_DEFINED; 8014640: 34 0b 00 0b mvi r11,11 Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 8014644: 44 20 00 29 be r1,r0,80146e8 <== NEVER TAKEN return RTEMS_NOT_DEFINED; if ( !routine ) return RTEMS_INVALID_ADDRESS; 8014648: 34 0b 00 09 mvi r11,9 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; if ( !routine ) 801464c: 44 60 00 27 be r3,r0,80146e8 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 8014650: b8 40 08 00 mv r1,r2 8014654: fb ff f1 bc calli 8010d44 <_TOD_Validate> return RTEMS_INVALID_CLOCK; 8014658: 34 0b 00 14 mvi r11,20 return RTEMS_NOT_DEFINED; if ( !routine ) return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 801465c: 44 20 00 23 be r1,r0,80146e8 return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 8014660: b9 80 08 00 mv r1,r12 if ( seconds <= _TOD_Seconds_since_epoch() ) 8014664: 78 0c 08 04 mvhi r12,0x804 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 8014668: fb ff f1 77 calli 8010c44 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 801466c: 39 8c 0d 2c ori r12,r12,0xd2c return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 8014670: b8 20 70 00 mv r14,r1 if ( seconds <= _TOD_Seconds_since_epoch() ) 8014674: 29 81 00 00 lw r1,(r12+0) 8014678: 50 2e 00 1c bgeu r1,r14,80146e8 801467c: 78 01 08 04 mvhi r1,0x804 8014680: 38 21 15 8c ori r1,r1,0x158c 8014684: b9 e0 10 00 mv r2,r15 8014688: 37 83 00 24 addi r3,sp,36 801468c: f8 00 0c f0 calli 8017a4c <_Objects_Get> 8014690: b8 20 58 00 mv r11,r1 return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 8014694: 2b 81 00 24 lw r1,(sp+36) 8014698: 5c 20 00 13 bne r1,r0,80146e4 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 801469c: 35 61 00 10 addi r1,r11,16 80146a0: f8 00 16 df calli 801a21c <_Watchdog_Remove> the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 80146a4: 34 01 00 03 mvi r1,3 80146a8: 59 61 00 38 sw (r11+56),r1 _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 80146ac: 29 81 00 00 lw r1,(r12+0) (*timer_server->schedule_operation)( timer_server, the_timer ); 80146b0: 29 a3 00 04 lw r3,(r13+4) 80146b4: b9 60 10 00 mv r2,r11 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 80146b8: c9 c1 70 00 sub r14,r14,r1 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 80146bc: 59 60 00 18 sw (r11+24),r0 the_watchdog->routine = routine; 80146c0: 59 70 00 2c sw (r11+44),r16 the_watchdog->id = id; 80146c4: 59 6f 00 30 sw (r11+48),r15 the_watchdog->user_data = user_data; 80146c8: 59 71 00 34 sw (r11+52),r17 80146cc: 59 6e 00 1c sw (r11+28),r14 (*timer_server->schedule_operation)( timer_server, the_timer ); 80146d0: b9 a0 08 00 mv r1,r13 80146d4: d8 60 00 00 call r3 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 80146d8: 34 0b 00 00 mvi r11,0 _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); (*timer_server->schedule_operation)( timer_server, the_timer ); _Thread_Enable_dispatch(); 80146dc: f8 00 0f a6 calli 8018574 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 80146e0: e0 00 00 02 bi 80146e8 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 80146e4: 34 0b 00 04 mvi r11,4 } 80146e8: b9 60 08 00 mv r1,r11 80146ec: 2b 9d 00 04 lw ra,(sp+4) 80146f0: 2b 8b 00 20 lw r11,(sp+32) 80146f4: 2b 8c 00 1c lw r12,(sp+28) 80146f8: 2b 8d 00 18 lw r13,(sp+24) 80146fc: 2b 8e 00 14 lw r14,(sp+20) 8014700: 2b 8f 00 10 lw r15,(sp+16) 8014704: 2b 90 00 0c lw r16,(sp+12) 8014708: 2b 91 00 08 lw r17,(sp+8) 801470c: 37 9c 00 24 addi sp,sp,36 8014710: c3 a0 00 00 ret =============================================================================== 08006aec : static int rtems_verror( rtems_error_code_t error_flag, const char *printf_format, va_list arglist ) { 8006aec: 37 9c ff e4 addi sp,sp,-28 8006af0: 5b 8b 00 1c sw (sp+28),r11 8006af4: 5b 8c 00 18 sw (sp+24),r12 8006af8: 5b 8d 00 14 sw (sp+20),r13 8006afc: 5b 8e 00 10 sw (sp+16),r14 8006b00: 5b 8f 00 0c sw (sp+12),r15 8006b04: 5b 90 00 08 sw (sp+8),r16 8006b08: 5b 9d 00 04 sw (sp+4),ra 8006b0c: b8 20 60 00 mv r12,r1 int local_errno = 0; int chars_written = 0; rtems_status_code status; if (error_flag & RTEMS_ERROR_PANIC) { 8006b10: 78 01 20 00 mvhi r1,0x2000 8006b14: a1 81 08 00 and r1,r12,r1 static int rtems_verror( rtems_error_code_t error_flag, const char *printf_format, va_list arglist ) { 8006b18: b8 40 80 00 mv r16,r2 8006b1c: b8 60 78 00 mv r15,r3 int local_errno = 0; int chars_written = 0; rtems_status_code status; if (error_flag & RTEMS_ERROR_PANIC) { 8006b20: 44 20 00 12 be r1,r0,8006b68 if (rtems_panic_in_progress++) 8006b24: 78 04 08 02 mvhi r4,0x802 8006b28: 38 84 98 94 ori r4,r4,0x9894 8006b2c: 28 81 00 00 lw r1,(r4+0) 8006b30: 34 22 00 01 addi r2,r1,1 8006b34: 58 82 00 00 sw (r4+0),r2 8006b38: 44 20 00 06 be r1,r0,8006b50 <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8006b3c: 78 04 08 02 mvhi r4,0x802 <== NOT EXECUTED 8006b40: 38 84 9a 14 ori r4,r4,0x9a14 <== NOT EXECUTED 8006b44: 28 81 00 00 lw r1,(r4+0) <== NOT EXECUTED 8006b48: 34 21 00 01 addi r1,r1,1 <== NOT EXECUTED 8006b4c: 58 81 00 00 sw (r4+0),r1 <== NOT EXECUTED _Thread_Disable_dispatch(); /* disable task switches */ /* don't aggravate things */ if (rtems_panic_in_progress > 2) 8006b50: 78 01 08 02 mvhi r1,0x802 8006b54: 38 21 98 94 ori r1,r1,0x9894 8006b58: 28 22 00 00 lw r2,(r1+0) 8006b5c: 34 01 00 02 mvi r1,2 return 0; 8006b60: 34 0b 00 00 mvi r11,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) 8006b64: 48 41 00 48 bg r2,r1,8006c84 <== NEVER TAKEN return 0; } (void) fflush(stdout); /* in case stdout/stderr same */ 8006b68: 78 01 08 02 mvhi r1,0x802 8006b6c: 38 21 92 30 ori r1,r1,0x9230 8006b70: 28 21 00 00 lw r1,(r1+0) 8006b74: 28 21 00 08 lw r1,(r1+8) 8006b78: f8 00 32 86 calli 8013590 status = error_flag & ~RTEMS_ERROR_MASK; 8006b7c: 78 01 08 02 mvhi r1,0x802 8006b80: 38 21 67 a8 ori r1,r1,0x67a8 8006b84: 28 2e 00 00 lw r14,(r1+0) if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */ 8006b88: 78 01 40 00 mvhi r1,0x4000 8006b8c: a1 81 08 00 and r1,r12,r1 return 0; } (void) fflush(stdout); /* in case stdout/stderr same */ status = error_flag & ~RTEMS_ERROR_MASK; 8006b90: a1 8e 70 00 and r14,r12,r14 rtems_error_code_t error_flag, const char *printf_format, va_list arglist ) { int local_errno = 0; 8006b94: 34 0c 00 00 mvi r12,0 } (void) fflush(stdout); /* in case stdout/stderr same */ status = error_flag & ~RTEMS_ERROR_MASK; if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */ 8006b98: 44 20 00 03 be r1,r0,8006ba4 local_errno = errno; 8006b9c: f8 00 31 7c calli 801318c <__errno> 8006ba0: 28 2c 00 00 lw r12,(r1+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); 8006ba4: 78 0d 08 02 mvhi r13,0x802 8006ba8: 39 ad 92 30 ori r13,r13,0x9230 8006bac: 29 a1 00 00 lw r1,(r13+0) 8006bb0: ba 00 10 00 mv r2,r16 8006bb4: b9 e0 18 00 mv r3,r15 8006bb8: 28 21 00 0c lw r1,(r1+12) 8006bbc: f8 00 49 3b calli 80190a8 8006bc0: b8 20 58 00 mv r11,r1 if (status) 8006bc4: 45 c0 00 0b be r14,r0,8006bf0 chars_written += fprintf(stderr, " (status: %s)", rtems_status_text(status)); 8006bc8: 29 a1 00 00 lw r1,(r13+0) 8006bcc: 28 2d 00 0c lw r13,(r1+12) 8006bd0: b9 c0 08 00 mv r1,r14 8006bd4: fb ff ff bd calli 8006ac8 8006bd8: 78 02 08 02 mvhi r2,0x802 8006bdc: b8 20 18 00 mv r3,r1 8006be0: 38 42 64 64 ori r2,r2,0x6464 8006be4: b9 a0 08 00 mv r1,r13 8006be8: f8 00 33 a2 calli 8013a70 #endif chars_written += vfprintf(stderr, printf_format, arglist); if (status) chars_written += 8006bec: b5 61 58 00 add r11,r11,r1 fprintf(stderr, " (status: %s)", rtems_status_text(status)); if (local_errno) { 8006bf0: 45 80 00 1a be r12,r0,8006c58 if ((local_errno > 0) && *strerror(local_errno)) 8006bf4: 4c 0c 00 10 bge r0,r12,8006c34 8006bf8: b9 80 08 00 mv r1,r12 8006bfc: f8 00 37 48 calli 801491c 8006c00: 40 21 00 00 lbu r1,(r1+0) 8006c04: 44 20 00 0c be r1,r0,8006c34 <== NEVER TAKEN chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno)); 8006c08: 78 01 08 02 mvhi r1,0x802 8006c0c: 38 21 92 30 ori r1,r1,0x9230 8006c10: 28 21 00 00 lw r1,(r1+0) 8006c14: 28 2d 00 0c lw r13,(r1+12) 8006c18: b9 80 08 00 mv r1,r12 8006c1c: f8 00 37 40 calli 801491c 8006c20: 78 02 08 02 mvhi r2,0x802 8006c24: b8 20 18 00 mv r3,r1 8006c28: 38 42 64 74 ori r2,r2,0x6474 8006c2c: b9 a0 08 00 mv r1,r13 8006c30: e0 00 00 08 bi 8006c50 else chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno); 8006c34: 78 01 08 02 mvhi r1,0x802 8006c38: 38 21 92 30 ori r1,r1,0x9230 8006c3c: 28 21 00 00 lw r1,(r1+0) 8006c40: 78 02 08 02 mvhi r2,0x802 8006c44: 38 42 64 84 ori r2,r2,0x6484 8006c48: 28 21 00 0c lw r1,(r1+12) 8006c4c: b9 80 18 00 mv r3,r12 8006c50: f8 00 33 88 calli 8013a70 8006c54: b5 61 58 00 add r11,r11,r1 } chars_written += fprintf(stderr, "\n"); 8006c58: 78 0c 08 02 mvhi r12,0x802 8006c5c: 39 8c 92 30 ori r12,r12,0x9230 8006c60: 29 81 00 00 lw r1,(r12+0) 8006c64: 78 02 08 02 mvhi r2,0x802 8006c68: 38 42 5b d8 ori r2,r2,0x5bd8 8006c6c: 28 21 00 0c lw r1,(r1+12) 8006c70: f8 00 33 80 calli 8013a70 8006c74: b4 2b 58 00 add r11,r1,r11 (void) fflush(stderr); 8006c78: 29 81 00 00 lw r1,(r12+0) 8006c7c: 28 21 00 0c lw r1,(r1+12) 8006c80: f8 00 32 44 calli 8013590 return chars_written; } 8006c84: b9 60 08 00 mv r1,r11 8006c88: 2b 9d 00 04 lw ra,(sp+4) 8006c8c: 2b 8b 00 1c lw r11,(sp+28) 8006c90: 2b 8c 00 18 lw r12,(sp+24) 8006c94: 2b 8d 00 14 lw r13,(sp+20) 8006c98: 2b 8e 00 10 lw r14,(sp+16) 8006c9c: 2b 8f 00 0c lw r15,(sp+12) 8006ca0: 2b 90 00 08 lw r16,(sp+8) 8006ca4: 37 9c 00 1c addi sp,sp,28 8006ca8: c3 a0 00 00 ret =============================================================================== 08001bb8 : /* * Extract an integer value from the database */ static int scanInt(FILE *fp, int *val) { 8001bb8: 37 9c ff d4 addi sp,sp,-44 8001bbc: 5b 8b 00 2c sw (sp+44),r11 8001bc0: 5b 8c 00 28 sw (sp+40),r12 8001bc4: 5b 8d 00 24 sw (sp+36),r13 8001bc8: 5b 8e 00 20 sw (sp+32),r14 8001bcc: 5b 8f 00 1c sw (sp+28),r15 8001bd0: 5b 90 00 18 sw (sp+24),r16 8001bd4: 5b 91 00 14 sw (sp+20),r17 8001bd8: 5b 92 00 10 sw (sp+16),r18 8001bdc: 5b 93 00 0c sw (sp+12),r19 8001be0: 5b 94 00 08 sw (sp+8),r20 8001be4: 5b 9d 00 04 sw (sp+4),ra 8001be8: b8 20 58 00 mv r11,r1 int c; unsigned int i = 0; unsigned int limit = INT_MAX; 8001bec: 78 01 08 01 mvhi r1,0x801 8001bf0: 38 21 4b 54 ori r1,r1,0x4b54 8001bf4: 28 2e 00 00 lw r14,(r1+0) int sign = 0; int d; for (;;) { c = getc(fp); 8001bf8: 78 11 08 01 mvhi r17,0x801 limit++; continue; } sign = 1; } if (!isdigit(c)) 8001bfc: 78 10 08 01 mvhi r16,0x801 /* * Extract an integer value from the database */ static int scanInt(FILE *fp, int *val) { 8001c00: b8 40 90 00 mv r18,r2 int c; unsigned int i = 0; unsigned int limit = INT_MAX; int sign = 0; 8001c04: 34 0d 00 00 mvi r13,0 */ static int scanInt(FILE *fp, int *val) { int c; unsigned int i = 0; 8001c08: 34 0c 00 00 mvi r12,0 unsigned int limit = INT_MAX; int sign = 0; int d; for (;;) { c = getc(fp); 8001c0c: 3a 31 61 b8 ori r17,r17,0x61b8 if (c == ':') 8001c10: 34 14 00 3a mvi r20,58 limit++; continue; } sign = 1; } if (!isdigit(c)) 8001c14: 3a 10 61 b4 ori r16,r16,0x61b4 for (;;) { c = getc(fp); if (c == ':') break; if (sign == 0) { if (c == '-') { 8001c18: 34 13 00 2d mvi r19,45 unsigned int limit = INT_MAX; int sign = 0; int d; for (;;) { c = getc(fp); 8001c1c: 29 61 00 04 lw r1,(r11+4) 8001c20: 34 21 ff ff addi r1,r1,-1 8001c24: 59 61 00 04 sw (r11+4),r1 8001c28: 4c 20 00 06 bge r1,r0,8001c40 <== ALWAYS TAKEN 8001c2c: 2a 21 00 00 lw r1,(r17+0) <== NOT EXECUTED 8001c30: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8001c34: f8 00 37 3e calli 800f92c <__srget_r> <== NOT EXECUTED 8001c38: b8 20 78 00 mv r15,r1 <== NOT EXECUTED 8001c3c: e0 00 00 05 bi 8001c50 <== NOT EXECUTED 8001c40: 29 61 00 00 lw r1,(r11+0) 8001c44: 40 2f 00 00 lbu r15,(r1+0) 8001c48: 34 21 00 01 addi r1,r1,1 8001c4c: 59 61 00 00 sw (r11+0),r1 if (c == ':') 8001c50: 45 f4 00 1f be r15,r20,8001ccc break; if (sign == 0) { 8001c54: 5d a0 00 06 bne r13,r0,8001c6c if (c == '-') { sign = -1; limit++; continue; } sign = 1; 8001c58: 34 0d 00 01 mvi r13,1 for (;;) { c = getc(fp); if (c == ':') break; if (sign == 0) { if (c == '-') { 8001c5c: 5d f3 00 04 bne r15,r19,8001c6c sign = -1; limit++; 8001c60: 35 ce 00 01 addi r14,r14,1 c = getc(fp); if (c == ':') break; if (sign == 0) { if (c == '-') { sign = -1; 8001c64: 34 0d ff ff mvi r13,-1 limit++; continue; 8001c68: e3 ff ff ed bi 8001c1c } sign = 1; } if (!isdigit(c)) 8001c6c: 2a 01 00 00 lw r1,(r16+0) 8001c70: b4 2f 08 00 add r1,r1,r15 8001c74: 40 21 00 01 lbu r1,(r1+1) 8001c78: 20 21 00 04 andi r1,r1,0x4 8001c7c: 44 20 00 1c be r1,r0,8001cec return 0; d = c - '0'; if ((i > (limit / 10)) 8001c80: b9 c0 08 00 mv r1,r14 8001c84: 34 02 00 0a mvi r2,10 8001c88: f8 00 47 4b calli 80139b4 <__udivsi3> 8001c8c: 55 81 00 18 bgu r12,r1,8001cec <== NEVER TAKEN } sign = 1; } if (!isdigit(c)) return 0; d = c - '0'; 8001c90: 35 ef ff d0 addi r15,r15,-48 if ((i > (limit / 10)) || ((i == (limit / 10)) && (d > (limit % 10)))) 8001c94: 5d 81 00 05 bne r12,r1,8001ca8 <== ALWAYS TAKEN 8001c98: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 8001c9c: 34 02 00 0a mvi r2,10 <== NOT EXECUTED 8001ca0: f8 00 47 55 calli 80139f4 <__umodsi3> <== NOT EXECUTED 8001ca4: 55 e1 00 12 bgu r15,r1,8001cec <== NOT EXECUTED return 0; i = i * 10 + d; 8001ca8: b9 80 08 00 mv r1,r12 8001cac: 34 02 00 01 mvi r2,1 8001cb0: f8 00 46 67 calli 801364c <__ashlsi3> 8001cb4: 34 02 00 02 mvi r2,2 8001cb8: b8 20 60 00 mv r12,r1 8001cbc: f8 00 46 64 calli 801364c <__ashlsi3> 8001cc0: b5 81 08 00 add r1,r12,r1 8001cc4: b5 e1 60 00 add r12,r15,r1 8001cc8: e3 ff ff d5 bi 8001c1c } if (sign == 0) return 0; 8001ccc: 34 03 00 00 mvi r3,0 if ((i > (limit / 10)) || ((i == (limit / 10)) && (d > (limit % 10)))) return 0; i = i * 10 + d; } if (sign == 0) 8001cd0: 45 a0 00 08 be r13,r0,8001cf0 <== NEVER TAKEN return 0; *val = i * sign; 8001cd4: b9 a0 08 00 mv r1,r13 8001cd8: b9 80 10 00 mv r2,r12 8001cdc: f8 00 46 d1 calli 8013820 <__mulsi3> 8001ce0: 5a 41 00 00 sw (r18+0),r1 return 1; 8001ce4: 34 03 00 01 mvi r3,1 8001ce8: e0 00 00 02 bi 8001cf0 if (!isdigit(c)) return 0; d = c - '0'; if ((i > (limit / 10)) || ((i == (limit / 10)) && (d > (limit % 10)))) return 0; 8001cec: 34 03 00 00 mvi r3,0 } if (sign == 0) return 0; *val = i * sign; return 1; } 8001cf0: b8 60 08 00 mv r1,r3 8001cf4: 2b 9d 00 04 lw ra,(sp+4) 8001cf8: 2b 8b 00 2c lw r11,(sp+44) 8001cfc: 2b 8c 00 28 lw r12,(sp+40) 8001d00: 2b 8d 00 24 lw r13,(sp+36) 8001d04: 2b 8e 00 20 lw r14,(sp+32) 8001d08: 2b 8f 00 1c lw r15,(sp+28) 8001d0c: 2b 90 00 18 lw r16,(sp+24) 8001d10: 2b 91 00 14 lw r17,(sp+20) 8001d14: 2b 92 00 10 lw r18,(sp+16) 8001d18: 2b 93 00 0c lw r19,(sp+12) 8001d1c: 2b 94 00 08 lw r20,(sp+8) 8001d20: 37 9c 00 2c addi sp,sp,44 8001d24: c3 a0 00 00 ret =============================================================================== 08001d28 : /* * Extract a string value from the database */ static int scanString(FILE *fp, char **name, char **bufp, size_t *nleft, int nlFlag) { 8001d28: 37 9c ff d8 addi sp,sp,-40 8001d2c: 5b 8b 00 28 sw (sp+40),r11 8001d30: 5b 8c 00 24 sw (sp+36),r12 8001d34: 5b 8d 00 20 sw (sp+32),r13 8001d38: 5b 8e 00 1c sw (sp+28),r14 8001d3c: 5b 8f 00 18 sw (sp+24),r15 8001d40: 5b 90 00 14 sw (sp+20),r16 8001d44: 5b 91 00 10 sw (sp+16),r17 8001d48: 5b 92 00 0c sw (sp+12),r18 8001d4c: 5b 93 00 08 sw (sp+8),r19 8001d50: 5b 9d 00 04 sw (sp+4),ra 8001d54: b8 20 68 00 mv r13,r1 int c; *name = *bufp; 8001d58: 28 61 00 00 lw r1,(r3+0) for (;;) { c = getc(fp); 8001d5c: 78 0e 08 01 mvhi r14,0x801 /* * Extract a string value from the database */ static int scanString(FILE *fp, char **name, char **bufp, size_t *nleft, int nlFlag) { 8001d60: b8 60 58 00 mv r11,r3 8001d64: b8 80 60 00 mv r12,r4 8001d68: b8 a0 78 00 mv r15,r5 int c; *name = *bufp; 8001d6c: 58 41 00 00 sw (r2+0),r1 for (;;) { c = getc(fp); 8001d70: 39 ce 61 b8 ori r14,r14,0x61b8 if (c == ':') { 8001d74: 34 13 00 3a mvi r19,58 if (nlFlag) return 0; break; } if (c == '\n') { 8001d78: 34 12 00 0a mvi r18,10 if (!nlFlag) return 0; break; } if (c == EOF) 8001d7c: 34 11 ff ff mvi r17,-1 return 0; if (*nleft < 2) 8001d80: 34 10 00 01 mvi r16,1 { int c; *name = *bufp; for (;;) { c = getc(fp); 8001d84: 29 a1 00 04 lw r1,(r13+4) 8001d88: 34 21 ff ff addi r1,r1,-1 8001d8c: 59 a1 00 04 sw (r13+4),r1 8001d90: 4c 20 00 05 bge r1,r0,8001da4 8001d94: 29 c1 00 00 lw r1,(r14+0) 8001d98: b9 a0 10 00 mv r2,r13 8001d9c: f8 00 36 e4 calli 800f92c <__srget_r> 8001da0: e0 00 00 05 bi 8001db4 8001da4: 29 a2 00 00 lw r2,(r13+0) 8001da8: 40 41 00 00 lbu r1,(r2+0) 8001dac: 34 42 00 01 addi r2,r2,1 8001db0: 59 a2 00 00 sw (r13+0),r2 if (c == ':') { 8001db4: 5c 33 00 04 bne r1,r19,8001dc4 if (nlFlag) return 0; 8001db8: 34 01 00 00 mvi r1,0 *name = *bufp; for (;;) { c = getc(fp); if (c == ':') { if (nlFlag) 8001dbc: 45 e0 00 12 be r15,r0,8001e04 8001dc0: e0 00 00 1c bi 8001e30 return 0; break; } if (c == '\n') { 8001dc4: 5c 32 00 04 bne r1,r18,8001dd4 if (!nlFlag) return 0; 8001dc8: 34 01 00 00 mvi r1,0 if (nlFlag) return 0; break; } if (c == '\n') { if (!nlFlag) 8001dcc: 5d e0 00 0e bne r15,r0,8001e04 8001dd0: e0 00 00 18 bi 8001e30 return 0; break; } if (c == EOF) 8001dd4: 44 31 00 16 be r1,r17,8001e2c return 0; if (*nleft < 2) 8001dd8: 29 82 00 00 lw r2,(r12+0) 8001ddc: 52 02 00 14 bgeu r16,r2,8001e2c <== NEVER TAKEN return 0; **bufp = c; 8001de0: 29 62 00 00 lw r2,(r11+0) 8001de4: 30 41 00 00 sb (r2+0),r1 ++(*bufp); 8001de8: 29 61 00 00 lw r1,(r11+0) 8001dec: 34 21 00 01 addi r1,r1,1 8001df0: 59 61 00 00 sw (r11+0),r1 --(*nleft); 8001df4: 29 81 00 00 lw r1,(r12+0) 8001df8: 34 21 ff ff addi r1,r1,-1 8001dfc: 59 81 00 00 sw (r12+0),r1 } 8001e00: e3 ff ff e1 bi 8001d84 **bufp = '\0'; 8001e04: 29 61 00 00 lw r1,(r11+0) 8001e08: 30 20 00 00 sb (r1+0),r0 ++(*bufp); 8001e0c: 29 61 00 00 lw r1,(r11+0) 8001e10: 34 21 00 01 addi r1,r1,1 8001e14: 59 61 00 00 sw (r11+0),r1 --(*nleft); 8001e18: 29 81 00 00 lw r1,(r12+0) 8001e1c: 34 21 ff ff addi r1,r1,-1 8001e20: 59 81 00 00 sw (r12+0),r1 return 1; 8001e24: 34 01 00 01 mvi r1,1 8001e28: e0 00 00 02 bi 8001e30 break; } if (c == EOF) return 0; if (*nleft < 2) return 0; 8001e2c: 34 01 00 00 mvi r1,0 } **bufp = '\0'; ++(*bufp); --(*nleft); return 1; } 8001e30: 2b 9d 00 04 lw ra,(sp+4) 8001e34: 2b 8b 00 28 lw r11,(sp+40) 8001e38: 2b 8c 00 24 lw r12,(sp+36) 8001e3c: 2b 8d 00 20 lw r13,(sp+32) 8001e40: 2b 8e 00 1c lw r14,(sp+28) 8001e44: 2b 8f 00 18 lw r15,(sp+24) 8001e48: 2b 90 00 14 lw r16,(sp+20) 8001e4c: 2b 91 00 10 lw r17,(sp+16) 8001e50: 2b 92 00 0c lw r18,(sp+12) 8001e54: 2b 93 00 08 lw r19,(sp+8) 8001e58: 37 9c 00 28 addi sp,sp,40 8001e5c: c3 a0 00 00 ret =============================================================================== 08001e60 : FILE *fp, struct group *grp, char *buffer, size_t bufsize ) { 8001e60: 37 9c ff d8 addi sp,sp,-40 8001e64: 5b 8b 00 18 sw (sp+24),r11 8001e68: 5b 8c 00 14 sw (sp+20),r12 8001e6c: 5b 8d 00 10 sw (sp+16),r13 8001e70: 5b 8e 00 0c sw (sp+12),r14 8001e74: 5b 8f 00 08 sw (sp+8),r15 8001e78: 5b 9d 00 04 sw (sp+4),ra int grgid; char *grmem, *cp; int memcount; if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0) 8001e7c: 37 8e 00 20 addi r14,sp,32 8001e80: 37 8d 00 1c addi r13,sp,28 FILE *fp, struct group *grp, char *buffer, size_t bufsize ) { 8001e84: 5b 83 00 20 sw (sp+32),r3 8001e88: 5b 84 00 1c sw (sp+28),r4 int grgid; char *grmem, *cp; int memcount; if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0) 8001e8c: b9 c0 18 00 mv r3,r14 8001e90: b9 a0 20 00 mv r4,r13 8001e94: 34 05 00 00 mvi r5,0 FILE *fp, struct group *grp, char *buffer, size_t bufsize ) { 8001e98: b8 20 78 00 mv r15,r1 8001e9c: b8 40 58 00 mv r11,r2 int grgid; char *grmem, *cp; int memcount; if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0) 8001ea0: fb ff ff a2 calli 8001d28 || !scanString(fp, &grp->gr_passwd, &buffer, &bufsize, 0) || !scanInt(fp, &grgid) || !scanString(fp, &grmem, &buffer, &bufsize, 1)) return 0; 8001ea4: 34 0c 00 00 mvi r12,0 { int grgid; char *grmem, *cp; int memcount; if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0) 8001ea8: 44 20 00 43 be r1,r0,8001fb4 || !scanString(fp, &grp->gr_passwd, &buffer, &bufsize, 0) 8001eac: b9 e0 08 00 mv r1,r15 8001eb0: 35 62 00 04 addi r2,r11,4 8001eb4: b9 c0 18 00 mv r3,r14 8001eb8: b9 a0 20 00 mv r4,r13 8001ebc: 34 05 00 00 mvi r5,0 8001ec0: fb ff ff 9a calli 8001d28 8001ec4: 44 20 00 3c be r1,r0,8001fb4 <== NEVER TAKEN || !scanInt(fp, &grgid) 8001ec8: b9 e0 08 00 mv r1,r15 8001ecc: 37 82 00 28 addi r2,sp,40 8001ed0: fb ff ff 3a calli 8001bb8 8001ed4: 44 20 00 38 be r1,r0,8001fb4 <== NEVER TAKEN || !scanString(fp, &grmem, &buffer, &bufsize, 1)) 8001ed8: b9 e0 08 00 mv r1,r15 8001edc: 37 82 00 24 addi r2,sp,36 8001ee0: b9 c0 18 00 mv r3,r14 8001ee4: b9 a0 20 00 mv r4,r13 8001ee8: 34 05 00 01 mvi r5,1 8001eec: fb ff ff 8f calli 8001d28 8001ef0: 44 20 00 31 be r1,r0,8001fb4 <== NEVER TAKEN return 0; grp->gr_gid = grgid; 8001ef4: 2b 81 00 28 lw r1,(sp+40) /* * Determine number of members */ for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 8001ef8: 2b 8d 00 24 lw r13,(sp+36) 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; 8001efc: 0d 61 00 08 sh (r11+8),r1 /* * Determine number of members */ for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 8001f00: b9 a0 10 00 mv r2,r13 8001f04: 34 01 00 01 mvi r1,1 8001f08: e0 00 00 04 bi 8001f18 if(*cp == ',') memcount++; 8001f0c: 64 63 00 2c cmpei r3,r3,44 grp->gr_gid = grgid; /* * Determine number of members */ for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 8001f10: 34 42 00 01 addi r2,r2,1 if(*cp == ',') memcount++; 8001f14: b4 23 08 00 add r1,r1,r3 grp->gr_gid = grgid; /* * Determine number of members */ for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 8001f18: 40 43 00 00 lbu r3,(r2+0) 8001f1c: 5c 60 ff fc bne r3,r0,8001f0c } /* * Hack to produce (hopefully) a suitably-aligned array of pointers */ if (bufsize < (((memcount+1)*sizeof(char *)) + 15)) 8001f20: 34 02 00 02 mvi r2,2 8001f24: 34 21 00 01 addi r1,r1,1 8001f28: f8 00 45 c9 calli 801364c <__ashlsi3> 8001f2c: 2b 82 00 1c lw r2,(sp+28) 8001f30: 34 21 00 0f addi r1,r1,15 return 0; 8001f34: 34 0c 00 00 mvi r12,0 } /* * Hack to produce (hopefully) a suitably-aligned array of pointers */ if (bufsize < (((memcount+1)*sizeof(char *)) + 15)) 8001f38: 54 22 00 1f bgu r1,r2,8001fb4 <== NEVER TAKEN return 0; grp->gr_mem = (char **)(((uintptr_t)buffer + 15) & ~15); 8001f3c: 2b 81 00 20 lw r1,(sp+32) 8001f40: 34 02 ff f0 mvi r2,-16 /* * Fill in pointer array */ grp->gr_mem[0] = grmem; for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { if(*cp == ',') { 8001f44: 34 0e 00 2c mvi r14,44 /* * Hack to produce (hopefully) a suitably-aligned array of pointers */ if (bufsize < (((memcount+1)*sizeof(char *)) + 15)) return 0; grp->gr_mem = (char **)(((uintptr_t)buffer + 15) & ~15); 8001f48: 34 21 00 0f addi r1,r1,15 8001f4c: a0 22 08 00 and r1,r1,r2 8001f50: 59 61 00 0c sw (r11+12),r1 /* * Fill in pointer array */ grp->gr_mem[0] = grmem; 8001f54: 58 2d 00 00 sw (r1+0),r13 } /* * Extract a single group record from the database */ static int scangr( 8001f58: 2b 8c 00 24 lw r12,(sp+36) /* * Fill in pointer array */ grp->gr_mem[0] = grmem; for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 8001f5c: 34 0d 00 01 mvi r13,1 } /* * Extract a single group record from the database */ static int scangr( 8001f60: 35 8c 00 01 addi r12,r12,1 /* * Fill in pointer array */ grp->gr_mem[0] = grmem; for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 8001f64: e0 00 00 0b bi 8001f90 if(*cp == ',') { 8001f68: 5c 2e 00 09 bne r1,r14,8001f8c *cp = '\0'; 8001f6c: 31 80 ff ff sb (r12+-1),r0 grp->gr_mem[memcount++] = cp + 1; 8001f70: 29 6f 00 0c lw r15,(r11+12) 8001f74: b9 a0 08 00 mv r1,r13 8001f78: 34 02 00 02 mvi r2,2 8001f7c: f8 00 45 b4 calli 801364c <__ashlsi3> 8001f80: b5 e1 08 00 add r1,r15,r1 8001f84: 58 2c 00 00 sw (r1+0),r12 8001f88: 35 ad 00 01 addi r13,r13,1 8001f8c: 35 8c 00 01 addi r12,r12,1 /* * Fill in pointer array */ grp->gr_mem[0] = grmem; for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 8001f90: 41 81 ff ff lbu r1,(r12+-1) 8001f94: 5c 20 ff f5 bne r1,r0,8001f68 if(*cp == ',') { *cp = '\0'; grp->gr_mem[memcount++] = cp + 1; } } grp->gr_mem[memcount] = NULL; 8001f98: 29 6b 00 0c lw r11,(r11+12) 8001f9c: b9 a0 08 00 mv r1,r13 8001fa0: 34 02 00 02 mvi r2,2 8001fa4: f8 00 45 aa calli 801364c <__ashlsi3> 8001fa8: b5 61 08 00 add r1,r11,r1 8001fac: 58 20 00 00 sw (r1+0),r0 return 1; 8001fb0: 34 0c 00 01 mvi r12,1 } 8001fb4: b9 80 08 00 mv r1,r12 8001fb8: 2b 9d 00 04 lw ra,(sp+4) 8001fbc: 2b 8b 00 18 lw r11,(sp+24) 8001fc0: 2b 8c 00 14 lw r12,(sp+20) 8001fc4: 2b 8d 00 10 lw r13,(sp+16) 8001fc8: 2b 8e 00 0c lw r14,(sp+12) 8001fcc: 2b 8f 00 08 lw r15,(sp+8) 8001fd0: 37 9c 00 28 addi sp,sp,40 8001fd4: c3 a0 00 00 ret =============================================================================== 08001fd8 : FILE *fp, struct passwd *pwd, char *buffer, size_t bufsize ) { 8001fd8: 37 9c ff d8 addi sp,sp,-40 8001fdc: 5b 8b 00 18 sw (sp+24),r11 8001fe0: 5b 8c 00 14 sw (sp+20),r12 8001fe4: 5b 8d 00 10 sw (sp+16),r13 8001fe8: 5b 8e 00 0c sw (sp+12),r14 8001fec: 5b 8f 00 08 sw (sp+8),r15 8001ff0: 5b 9d 00 04 sw (sp+4),ra int pwuid, pwgid; if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0) 8001ff4: 37 8e 00 20 addi r14,sp,32 8001ff8: 37 8d 00 1c addi r13,sp,28 FILE *fp, struct passwd *pwd, char *buffer, size_t bufsize ) { 8001ffc: 5b 83 00 20 sw (sp+32),r3 8002000: 5b 84 00 1c sw (sp+28),r4 int pwuid, pwgid; if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0) 8002004: b9 c0 18 00 mv r3,r14 8002008: b9 a0 20 00 mv r4,r13 800200c: 34 05 00 00 mvi r5,0 FILE *fp, struct passwd *pwd, char *buffer, size_t bufsize ) { 8002010: b8 20 60 00 mv r12,r1 8002014: b8 40 58 00 mv r11,r2 int pwuid, pwgid; if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0) 8002018: fb ff ff 44 calli 8001d28 || !scanInt(fp, &pwgid) || !scanString(fp, &pwd->pw_comment, &buffer, &bufsize, 0) || !scanString(fp, &pwd->pw_gecos, &buffer, &bufsize, 0) || !scanString(fp, &pwd->pw_dir, &buffer, &bufsize, 0) || !scanString(fp, &pwd->pw_shell, &buffer, &bufsize, 1)) return 0; 800201c: 34 0f 00 00 mvi r15,0 size_t bufsize ) { int pwuid, pwgid; if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0) 8002020: 44 20 00 31 be r1,r0,80020e4 || !scanString(fp, &pwd->pw_passwd, &buffer, &bufsize, 0) 8002024: b9 80 08 00 mv r1,r12 8002028: 35 62 00 04 addi r2,r11,4 800202c: b9 c0 18 00 mv r3,r14 8002030: b9 a0 20 00 mv r4,r13 8002034: 34 05 00 00 mvi r5,0 8002038: fb ff ff 3c calli 8001d28 800203c: 44 20 00 2a be r1,r0,80020e4 <== NEVER TAKEN || !scanInt(fp, &pwuid) 8002040: b9 80 08 00 mv r1,r12 8002044: 37 82 00 28 addi r2,sp,40 8002048: fb ff fe dc calli 8001bb8 800204c: 44 20 00 26 be r1,r0,80020e4 <== NEVER TAKEN || !scanInt(fp, &pwgid) 8002050: b9 80 08 00 mv r1,r12 8002054: 37 82 00 24 addi r2,sp,36 8002058: fb ff fe d8 calli 8001bb8 800205c: 44 20 00 22 be r1,r0,80020e4 <== NEVER TAKEN || !scanString(fp, &pwd->pw_comment, &buffer, &bufsize, 0) 8002060: b9 80 08 00 mv r1,r12 8002064: 35 62 00 0c addi r2,r11,12 8002068: b9 c0 18 00 mv r3,r14 800206c: b9 a0 20 00 mv r4,r13 8002070: 34 05 00 00 mvi r5,0 8002074: fb ff ff 2d calli 8001d28 8002078: 44 20 00 1b be r1,r0,80020e4 <== NEVER TAKEN || !scanString(fp, &pwd->pw_gecos, &buffer, &bufsize, 0) 800207c: b9 80 08 00 mv r1,r12 8002080: 35 62 00 10 addi r2,r11,16 8002084: b9 c0 18 00 mv r3,r14 8002088: b9 a0 20 00 mv r4,r13 800208c: 34 05 00 00 mvi r5,0 8002090: fb ff ff 26 calli 8001d28 8002094: 44 20 00 14 be r1,r0,80020e4 <== NEVER TAKEN || !scanString(fp, &pwd->pw_dir, &buffer, &bufsize, 0) 8002098: b9 80 08 00 mv r1,r12 800209c: 35 62 00 14 addi r2,r11,20 80020a0: b9 c0 18 00 mv r3,r14 80020a4: b9 a0 20 00 mv r4,r13 80020a8: 34 05 00 00 mvi r5,0 80020ac: fb ff ff 1f calli 8001d28 80020b0: 44 20 00 0d be r1,r0,80020e4 <== NEVER TAKEN || !scanString(fp, &pwd->pw_shell, &buffer, &bufsize, 1)) 80020b4: b9 80 08 00 mv r1,r12 80020b8: 35 62 00 18 addi r2,r11,24 80020bc: b9 c0 18 00 mv r3,r14 80020c0: b9 a0 20 00 mv r4,r13 80020c4: 34 05 00 01 mvi r5,1 80020c8: fb ff ff 18 calli 8001d28 80020cc: 44 20 00 06 be r1,r0,80020e4 return 0; pwd->pw_uid = pwuid; 80020d0: 2b 81 00 28 lw r1,(sp+40) pwd->pw_gid = pwgid; return 1; 80020d4: 34 0f 00 01 mvi r15,1 || !scanString(fp, &pwd->pw_comment, &buffer, &bufsize, 0) || !scanString(fp, &pwd->pw_gecos, &buffer, &bufsize, 0) || !scanString(fp, &pwd->pw_dir, &buffer, &bufsize, 0) || !scanString(fp, &pwd->pw_shell, &buffer, &bufsize, 1)) return 0; pwd->pw_uid = pwuid; 80020d8: 0d 61 00 08 sh (r11+8),r1 pwd->pw_gid = pwgid; 80020dc: 2b 81 00 24 lw r1,(sp+36) 80020e0: 0d 61 00 0a sh (r11+10),r1 return 1; } 80020e4: b9 e0 08 00 mv r1,r15 80020e8: 2b 9d 00 04 lw ra,(sp+4) 80020ec: 2b 8b 00 18 lw r11,(sp+24) 80020f0: 2b 8c 00 14 lw r12,(sp+20) 80020f4: 2b 8d 00 10 lw r13,(sp+16) 80020f8: 2b 8e 00 0c lw r14,(sp+12) 80020fc: 2b 8f 00 08 lw r15,(sp+8) 8002100: 37 9c 00 28 addi sp,sp,40 8002104: c3 a0 00 00 ret =============================================================================== 080039ac : #include int sched_get_priority_max( int policy ) { 80039ac: 37 9c ff fc addi sp,sp,-4 80039b0: 5b 9d 00 04 sw (sp+4),ra switch ( policy ) { 80039b4: 48 01 00 05 bg r0,r1,80039c8 80039b8: 34 02 00 02 mvi r2,2 80039bc: 4c 41 00 08 bge r2,r1,80039dc 80039c0: 34 02 00 04 mvi r2,4 80039c4: 44 22 00 06 be r1,r2,80039dc <== ALWAYS TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 80039c8: f8 00 26 8e calli 800d400 <__errno> 80039cc: 34 02 00 16 mvi r2,22 80039d0: 58 22 00 00 sw (r1+0),r2 80039d4: 34 01 ff ff mvi r1,-1 80039d8: e0 00 00 05 bi 80039ec } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 80039dc: 78 01 08 01 mvhi r1,0x801 80039e0: 38 21 f0 e4 ori r1,r1,0xf0e4 80039e4: 40 21 00 00 lbu r1,(r1+0) 80039e8: 34 21 ff ff addi r1,r1,-1 } 80039ec: 2b 9d 00 04 lw ra,(sp+4) 80039f0: 37 9c 00 04 addi sp,sp,4 80039f4: c3 a0 00 00 ret =============================================================================== 080039f8 : #include int sched_get_priority_min( int policy ) { 80039f8: 37 9c ff fc addi sp,sp,-4 80039fc: 5b 9d 00 04 sw (sp+4),ra switch ( policy ) { 8003a00: 48 01 00 05 bg r0,r1,8003a14 8003a04: 34 02 00 02 mvi r2,2 8003a08: 4c 41 00 08 bge r2,r1,8003a28 <== ALWAYS TAKEN 8003a0c: 34 02 00 04 mvi r2,4 <== NOT EXECUTED 8003a10: 44 22 00 06 be r1,r2,8003a28 <== NOT EXECUTED case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 8003a14: f8 00 26 7b calli 800d400 <__errno> 8003a18: 34 02 00 16 mvi r2,22 8003a1c: 58 22 00 00 sw (r1+0),r2 8003a20: 34 01 ff ff mvi r1,-1 8003a24: e0 00 00 02 bi 8003a2c } return POSIX_SCHEDULER_MINIMUM_PRIORITY; 8003a28: 34 01 00 01 mvi r1,1 } 8003a2c: 2b 9d 00 04 lw ra,(sp+4) 8003a30: 37 9c 00 04 addi sp,sp,4 8003a34: c3 a0 00 00 ret =============================================================================== 08003a38 : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 8003a38: 37 9c ff f4 addi sp,sp,-12 8003a3c: 5b 8b 00 08 sw (sp+8),r11 8003a40: 5b 9d 00 04 sw (sp+4),ra 8003a44: b8 20 58 00 mv r11,r1 /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 8003a48: 44 20 00 08 be r1,r0,8003a68 <== NEVER TAKEN 8003a4c: 5b 82 00 0c sw (sp+12),r2 8003a50: fb ff f8 ba calli 8001d38 8003a54: 2b 82 00 0c lw r2,(sp+12) 8003a58: 45 61 00 04 be r11,r1,8003a68 rtems_set_errno_and_return_minus_one( ESRCH ); 8003a5c: f8 00 26 69 calli 800d400 <__errno> 8003a60: 34 02 00 03 mvi r2,3 8003a64: e0 00 00 04 bi 8003a74 if ( !interval ) 8003a68: 5c 40 00 06 bne r2,r0,8003a80 rtems_set_errno_and_return_minus_one( EINVAL ); 8003a6c: f8 00 26 65 calli 800d400 <__errno> 8003a70: 34 02 00 16 mvi r2,22 8003a74: 58 22 00 00 sw (r1+0),r2 8003a78: 34 01 ff ff mvi r1,-1 8003a7c: e0 00 00 06 bi 8003a94 _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 8003a80: 78 01 08 01 mvhi r1,0x801 8003a84: 38 21 f7 f4 ori r1,r1,0xf7f4 8003a88: 28 21 00 00 lw r1,(r1+0) 8003a8c: f8 00 0d db calli 80071f8 <_Timespec_From_ticks> return 0; 8003a90: 34 01 00 00 mvi r1,0 } 8003a94: 2b 9d 00 04 lw ra,(sp+4) 8003a98: 2b 8b 00 08 lw r11,(sp+8) 8003a9c: 37 9c 00 0c addi sp,sp,12 8003aa0: c3 a0 00 00 ret =============================================================================== 080061a8 : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 80061a8: 37 9c ff c0 addi sp,sp,-64 80061ac: 5b 8b 00 18 sw (sp+24),r11 80061b0: 5b 8c 00 14 sw (sp+20),r12 80061b4: 5b 8d 00 10 sw (sp+16),r13 80061b8: 5b 8e 00 0c sw (sp+12),r14 80061bc: 5b 8f 00 08 sw (sp+8),r15 80061c0: 5b 9d 00 04 sw (sp+4),ra 80061c4: 5b 83 00 2c sw (sp+44),r3 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 80061c8: 78 03 08 02 mvhi r3,0x802 80061cc: 5b 82 00 28 sw (sp+40),r2 80061d0: 5b 84 00 30 sw (sp+48),r4 80061d4: 5b 85 00 34 sw (sp+52),r5 80061d8: 5b 86 00 38 sw (sp+56),r6 80061dc: 5b 87 00 3c sw (sp+60),r7 80061e0: 5b 88 00 40 sw (sp+64),r8 80061e4: 38 63 4a 54 ori r3,r3,0x4a54 80061e8: b8 20 60 00 mv r12,r1 80061ec: 28 61 00 00 lw r1,(r3+0) 80061f0: b8 40 70 00 mv r14,r2 80061f4: 34 21 00 01 addi r1,r1,1 80061f8: 58 61 00 00 sw (r3+0),r1 POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 80061fc: 20 4f 02 00 andi r15,r2,0x200 /* unsigned int value */ ) { va_list arg; mode_t mode; unsigned int value = 0; 8006200: 34 0d 00 00 mvi r13,0 POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 8006204: 45 e0 00 02 be r15,r0,800620c va_start(arg, oflag); mode = (mode_t) va_arg( arg, unsigned int ); value = va_arg( arg, unsigned int ); 8006208: 2b 8d 00 30 lw r13,(sp+48) va_end(arg); } status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); 800620c: b9 80 08 00 mv r1,r12 8006210: 37 82 00 24 addi r2,sp,36 8006214: f8 00 1a c6 calli 800cd2c <_POSIX_Semaphore_Name_to_id> 8006218: b8 20 58 00 mv r11,r1 * and we can just return a pointer to the id. Otherwise we may * need to check to see if this is a "semaphore does not exist" * or some other miscellaneous error on the name. */ if ( status ) { 800621c: 44 20 00 08 be r1,r0,800623c /* * Unless provided a valid name that did not already exist * and we are willing to create then it is an error. */ if ( !( status == ENOENT && (oflag & O_CREAT) ) ) { 8006220: 34 01 00 02 mvi r1,2 8006224: 5d 61 00 02 bne r11,r1,800622c <== NEVER TAKEN 8006228: 5d e0 00 1a bne r15,r0,8006290 _Thread_Enable_dispatch(); 800622c: f8 00 09 b8 calli 800890c <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 8006230: f8 00 2a 66 calli 8010bc8 <__errno> 8006234: 58 2b 00 00 sw (r1+0),r11 8006238: e0 00 00 08 bi 8006258 /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 800623c: 21 ce 0a 00 andi r14,r14,0xa00 8006240: 34 01 0a 00 mvi r1,2560 8006244: 5d c1 00 07 bne r14,r1,8006260 _Thread_Enable_dispatch(); 8006248: f8 00 09 b1 calli 800890c <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 800624c: f8 00 2a 5f calli 8010bc8 <__errno> 8006250: 34 02 00 11 mvi r2,17 8006254: 58 22 00 00 sw (r1+0),r2 8006258: 34 01 ff ff mvi r1,-1 800625c: e0 00 00 18 bi 80062bc 8006260: 2b 82 00 24 lw r2,(sp+36) 8006264: 78 01 08 02 mvhi r1,0x802 8006268: 37 83 00 1c addi r3,sp,28 800626c: 38 21 4c b4 ori r1,r1,0x4cb4 8006270: f8 00 07 5d calli 8007fe4 <_Objects_Get> } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); the_semaphore->open_count += 1; 8006274: 28 22 00 18 lw r2,(r1+24) if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); 8006278: 5b 81 00 20 sw (sp+32),r1 the_semaphore->open_count += 1; 800627c: 34 42 00 01 addi r2,r2,1 8006280: 58 22 00 18 sw (r1+24),r2 _Thread_Enable_dispatch(); 8006284: f8 00 09 a2 calli 800890c <_Thread_Enable_dispatch> _Thread_Enable_dispatch(); 8006288: f8 00 09 a1 calli 800890c <_Thread_Enable_dispatch> goto return_id; 800628c: e0 00 00 0a bi 80062b4 /* * At this point, the semaphore does not exist and everything has been * checked. We should go ahead and create a semaphore. */ status =_POSIX_Semaphore_Create_support( 8006290: 34 02 00 00 mvi r2,0 8006294: b9 a0 18 00 mv r3,r13 8006298: 37 84 00 20 addi r4,sp,32 800629c: b9 80 08 00 mv r1,r12 80062a0: f8 00 1a 3f calli 800cb9c <_POSIX_Semaphore_Create_support> 80062a4: b8 20 58 00 mv r11,r1 /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); 80062a8: f8 00 09 99 calli 800890c <_Thread_Enable_dispatch> if ( status == -1 ) return SEM_FAILED; 80062ac: 34 01 ff ff mvi r1,-1 * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); if ( status == -1 ) 80062b0: 45 61 00 03 be r11,r1,80062bc return_id: #if defined(RTEMS_USE_16_BIT_OBJECT) the_semaphore->Semaphore_id = the_semaphore->Object.id; id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; 80062b4: 2b 81 00 20 lw r1,(sp+32) 80062b8: 34 21 00 08 addi r1,r1,8 #endif return id; } 80062bc: 2b 9d 00 04 lw ra,(sp+4) 80062c0: 2b 8b 00 18 lw r11,(sp+24) 80062c4: 2b 8c 00 14 lw r12,(sp+20) 80062c8: 2b 8d 00 10 lw r13,(sp+16) 80062cc: 2b 8e 00 0c lw r14,(sp+12) 80062d0: 2b 8f 00 08 lw r15,(sp+8) 80062d4: 37 9c 00 40 addi sp,sp,64 80062d8: c3 a0 00 00 ret =============================================================================== 080038b4 : int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 80038b4: 37 9c ff e4 addi sp,sp,-28 80038b8: 5b 8b 00 1c sw (sp+28),r11 80038bc: 5b 8c 00 18 sw (sp+24),r12 80038c0: 5b 8d 00 14 sw (sp+20),r13 80038c4: 5b 8e 00 10 sw (sp+16),r14 80038c8: 5b 8f 00 0c sw (sp+12),r15 80038cc: 5b 90 00 08 sw (sp+8),r16 80038d0: 5b 9d 00 04 sw (sp+4),ra 80038d4: b8 20 58 00 mv r11,r1 80038d8: b8 40 60 00 mv r12,r2 80038dc: b8 60 68 00 mv r13,r3 ISR_Level level; if ( oact ) 80038e0: 44 60 00 0f be r3,r0,800391c *oact = _POSIX_signals_Vectors[ sig ]; 80038e4: 34 02 00 01 mvi r2,1 80038e8: f8 00 65 7d calli 801cedc <__ashlsi3> 80038ec: 34 02 00 02 mvi r2,2 80038f0: 78 0e 08 02 mvhi r14,0x802 80038f4: b4 2b 08 00 add r1,r1,r11 80038f8: f8 00 65 79 calli 801cedc <__ashlsi3> 80038fc: 39 ce 0d a8 ori r14,r14,0xda8 8003900: b5 c1 08 00 add r1,r14,r1 8003904: 28 23 00 00 lw r3,(r1+0) 8003908: 28 22 00 04 lw r2,(r1+4) 800390c: 28 21 00 08 lw r1,(r1+8) 8003910: 59 a3 00 00 sw (r13+0),r3 8003914: 59 a2 00 04 sw (r13+4),r2 8003918: 59 a1 00 08 sw (r13+8),r1 if ( !sig ) 800391c: 45 60 00 07 be r11,r0,8003938 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 8003920: 35 61 ff ff addi r1,r11,-1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 8003924: 34 02 00 1f mvi r2,31 8003928: 50 41 00 02 bgeu r2,r1,8003930 800392c: e0 00 00 03 bi 8003938 * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 8003930: 34 01 00 09 mvi r1,9 8003934: 5d 61 00 06 bne r11,r1,800394c rtems_set_errno_and_return_minus_one( EINVAL ); 8003938: f8 00 28 11 calli 800d97c <__errno> 800393c: 34 02 00 16 mvi r2,22 8003940: 58 22 00 00 sw (r1+0),r2 8003944: 34 01 ff ff mvi r1,-1 8003948: e0 00 00 35 bi 8003a1c * 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; 800394c: 34 01 00 00 mvi r1,0 /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 8003950: 45 80 00 33 be r12,r0,8003a1c <== NEVER TAKEN /* * Unless the user is installing the default signal actions, then * we can just copy the provided sigaction structure into the vectors. */ _ISR_Disable( level ); 8003954: 90 00 70 00 rcsr r14,IE 8003958: 34 01 ff fe mvi r1,-2 800395c: a1 c1 08 00 and r1,r14,r1 8003960: d0 01 00 00 wcsr IE,r1 if ( act->sa_handler == SIG_DFL ) { 8003964: 29 81 00 08 lw r1,(r12+8) 8003968: 78 0d 08 02 mvhi r13,0x802 800396c: 39 ad 0d a8 ori r13,r13,0xda8 8003970: 5c 20 00 1a bne r1,r0,80039d8 _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; 8003974: 34 02 00 01 mvi r2,1 8003978: b9 60 08 00 mv r1,r11 800397c: f8 00 65 58 calli 801cedc <__ashlsi3> 8003980: b4 2b 80 00 add r16,r1,r11 8003984: 34 02 00 02 mvi r2,2 8003988: ba 00 08 00 mv r1,r16 800398c: f8 00 65 54 calli 801cedc <__ashlsi3> 8003990: b5 a1 68 00 add r13,r13,r1 8003994: b8 20 78 00 mv r15,r1 8003998: 34 02 00 01 mvi r2,1 800399c: b9 60 08 00 mv r1,r11 80039a0: f8 00 65 4f calli 801cedc <__ashlsi3> 80039a4: 34 02 00 02 mvi r2,2 80039a8: 78 0c 08 01 mvhi r12,0x801 80039ac: ba 00 08 00 mv r1,r16 80039b0: f8 00 65 4b calli 801cedc <__ashlsi3> 80039b4: 39 8c e8 f4 ori r12,r12,0xe8f4 80039b8: b5 8f 08 00 add r1,r12,r15 80039bc: 28 23 00 00 lw r3,(r1+0) 80039c0: 28 22 00 04 lw r2,(r1+4) 80039c4: 28 21 00 08 lw r1,(r1+8) 80039c8: 59 a3 00 00 sw (r13+0),r3 80039cc: 59 a2 00 04 sw (r13+4),r2 80039d0: 59 a1 00 08 sw (r13+8),r1 80039d4: e0 00 00 10 bi 8003a14 } else { _POSIX_signals_Clear_process_signals( sig ); 80039d8: b9 60 08 00 mv r1,r11 80039dc: f8 00 18 5f calli 8009b58 <_POSIX_signals_Clear_process_signals> _POSIX_signals_Vectors[ sig ] = *act; 80039e0: 34 02 00 01 mvi r2,1 80039e4: b9 60 08 00 mv r1,r11 80039e8: f8 00 65 3d calli 801cedc <__ashlsi3> 80039ec: 34 02 00 02 mvi r2,2 80039f0: b4 2b 08 00 add r1,r1,r11 80039f4: f8 00 65 3a calli 801cedc <__ashlsi3> 80039f8: 29 83 00 00 lw r3,(r12+0) 80039fc: 29 82 00 04 lw r2,(r12+4) 8003a00: 29 84 00 08 lw r4,(r12+8) 8003a04: b5 a1 08 00 add r1,r13,r1 8003a08: 58 23 00 00 sw (r1+0),r3 8003a0c: 58 22 00 04 sw (r1+4),r2 8003a10: 58 24 00 08 sw (r1+8),r4 } _ISR_Enable( level ); 8003a14: d0 0e 00 00 wcsr IE,r14 * 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; 8003a18: 34 01 00 00 mvi r1,0 } 8003a1c: 2b 9d 00 04 lw ra,(sp+4) 8003a20: 2b 8b 00 1c lw r11,(sp+28) 8003a24: 2b 8c 00 18 lw r12,(sp+24) 8003a28: 2b 8d 00 14 lw r13,(sp+20) 8003a2c: 2b 8e 00 10 lw r14,(sp+16) 8003a30: 2b 8f 00 0c lw r15,(sp+12) 8003a34: 2b 90 00 08 lw r16,(sp+8) 8003a38: 37 9c 00 1c addi sp,sp,28 8003a3c: c3 a0 00 00 ret =============================================================================== 0800605c : #include int sigsuspend( const sigset_t *sigmask ) { 800605c: 37 9c ff f0 addi sp,sp,-16 8006060: 5b 8b 00 08 sw (sp+8),r11 8006064: 5b 9d 00 04 sw (sp+4),ra 8006068: b8 20 10 00 mv r2,r1 int status; POSIX_API_Control *api; api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); 800606c: 37 83 00 10 addi r3,sp,16 8006070: 34 01 00 01 mvi r1,1 8006074: fb ff ff ec calli 8006024 (void) sigfillset( &all_signals ); 8006078: 37 8b 00 0c addi r11,sp,12 800607c: b9 60 08 00 mv r1,r11 8006080: fb ff ff ad calli 8005f34 status = sigtimedwait( &all_signals, NULL, NULL ); 8006084: b9 60 08 00 mv r1,r11 8006088: 34 02 00 00 mvi r2,0 800608c: 34 03 00 00 mvi r3,0 8006090: f8 00 00 2f calli 800614c (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); 8006094: 37 82 00 10 addi r2,sp,16 status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); (void) sigfillset( &all_signals ); status = sigtimedwait( &all_signals, NULL, NULL ); 8006098: b8 20 58 00 mv r11,r1 (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); 800609c: 34 03 00 00 mvi r3,0 80060a0: 34 01 00 00 mvi r1,0 80060a4: fb ff ff e0 calli 8006024 /* * sigtimedwait() returns the signal number while sigsuspend() * is supposed to return -1 and EINTR when a signal is caught. */ if ( status != -1 ) 80060a8: 34 02 ff ff mvi r2,-1 80060ac: 45 62 00 04 be r11,r2,80060bc <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINTR ); 80060b0: f8 00 27 76 calli 800fe88 <__errno> 80060b4: 34 02 00 04 mvi r2,4 80060b8: 58 22 00 00 sw (r1+0),r2 return status; } 80060bc: 34 01 ff ff mvi r1,-1 80060c0: 2b 9d 00 04 lw ra,(sp+4) 80060c4: 2b 8b 00 08 lw r11,(sp+8) 80060c8: 37 9c 00 10 addi sp,sp,16 80060cc: c3 a0 00 00 ret =============================================================================== 08003edc : int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { 8003edc: 37 9c ff e0 addi sp,sp,-32 8003ee0: 5b 8b 00 14 sw (sp+20),r11 8003ee4: 5b 8c 00 10 sw (sp+16),r12 8003ee8: 5b 8d 00 0c sw (sp+12),r13 8003eec: 5b 8e 00 08 sw (sp+8),r14 8003ef0: 5b 9d 00 04 sw (sp+4),ra 8003ef4: b8 20 60 00 mv r12,r1 8003ef8: b8 40 58 00 mv r11,r2 8003efc: b8 60 68 00 mv r13,r3 ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) 8003f00: 44 20 00 09 be r1,r0,8003f24 /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; if ( timeout ) { 8003f04: 44 60 00 0d be r3,r0,8003f38 if ( !_Timespec_Is_valid( timeout ) ) 8003f08: b8 60 08 00 mv r1,r3 8003f0c: f8 00 0d f5 calli 80076e0 <_Timespec_Is_valid> 8003f10: 44 20 00 05 be r1,r0,8003f24 rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); 8003f14: b9 a0 08 00 mv r1,r13 8003f18: f8 00 0e 10 calli 8007758 <_Timespec_To_ticks> 8003f1c: b8 20 10 00 mv r2,r1 if ( !interval ) 8003f20: 5c 20 00 07 bne r1,r0,8003f3c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 8003f24: f8 00 28 59 calli 800e088 <__errno> 8003f28: 34 02 00 16 mvi r2,22 8003f2c: 58 22 00 00 sw (r1+0),r2 8003f30: 34 0c ff ff mvi r12,-1 8003f34: e0 00 00 55 bi 8004088 /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; 8003f38: 34 02 00 00 mvi r2,0 /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 8003f3c: 5d 60 00 02 bne r11,r0,8003f44 8003f40: 37 8b 00 18 addi r11,sp,24 the_thread = _Thread_Executing; 8003f44: 78 01 08 02 mvhi r1,0x802 8003f48: 38 21 0d 84 ori r1,r1,0xd84 8003f4c: 28 23 00 0c lw r3,(r1+12) api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 8003f50: 28 6d 01 2c lw r13,(r3+300) * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 8003f54: 90 00 70 00 rcsr r14,IE 8003f58: 34 01 ff fe mvi r1,-2 8003f5c: a1 c1 08 00 and r1,r14,r1 8003f60: d0 01 00 00 wcsr IE,r1 if ( *set & api->signals_pending ) { 8003f64: 29 85 00 00 lw r5,(r12+0) 8003f68: 29 a1 00 d0 lw r1,(r13+208) 8003f6c: a0 a1 20 00 and r4,r5,r1 8003f70: 44 80 00 0e be r4,r0,8003fa8 /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending ); 8003f74: fb ff ff bb calli 8003e60 <_POSIX_signals_Get_highest> 8003f78: b8 20 10 00 mv r2,r1 8003f7c: 59 61 00 00 sw (r11+0),r1 _POSIX_signals_Clear_signals( 8003f80: b9 60 18 00 mv r3,r11 8003f84: b9 a0 08 00 mv r1,r13 8003f88: 34 04 00 00 mvi r4,0 8003f8c: 34 05 00 00 mvi r5,0 8003f90: f8 00 19 6f calli 800a54c <_POSIX_signals_Clear_signals> the_info->si_signo, the_info, false, false ); _ISR_Enable( level ); 8003f94: d0 0e 00 00 wcsr IE,r14 the_info->si_code = SI_USER; 8003f98: 34 01 00 01 mvi r1,1 8003f9c: 59 61 00 04 sw (r11+4),r1 the_info->si_value.sival_int = 0; 8003fa0: 59 60 00 08 sw (r11+8),r0 8003fa4: e0 00 00 38 bi 8004084 return the_info->si_signo; } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { 8003fa8: 78 01 08 02 mvhi r1,0x802 8003fac: 38 21 0f 9c ori r1,r1,0xf9c 8003fb0: 28 21 00 00 lw r1,(r1+0) 8003fb4: a0 a1 28 00 and r5,r5,r1 8003fb8: 44 a4 00 0f be r5,r4,8003ff4 signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); 8003fbc: fb ff ff a9 calli 8003e60 <_POSIX_signals_Get_highest> 8003fc0: b8 20 60 00 mv r12,r1 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 8003fc4: b9 80 10 00 mv r2,r12 8003fc8: b9 a0 08 00 mv r1,r13 8003fcc: b9 60 18 00 mv r3,r11 8003fd0: 34 04 00 01 mvi r4,1 8003fd4: 34 05 00 00 mvi r5,0 8003fd8: f8 00 19 5d calli 800a54c <_POSIX_signals_Clear_signals> _ISR_Enable( level ); 8003fdc: d0 0e 00 00 wcsr IE,r14 the_info->si_signo = signo; the_info->si_code = SI_USER; 8003fe0: 34 01 00 01 mvi r1,1 if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); _ISR_Enable( level ); the_info->si_signo = signo; 8003fe4: 59 6c 00 00 sw (r11+0),r12 the_info->si_code = SI_USER; 8003fe8: 59 61 00 04 sw (r11+4),r1 the_info->si_value.sival_int = 0; 8003fec: 59 60 00 08 sw (r11+8),r0 return signo; 8003ff0: e0 00 00 26 bi 8004088 } the_info->si_signo = -1; 8003ff4: 34 01 ff ff mvi r1,-1 8003ff8: 59 61 00 00 sw (r11+0),r1 8003ffc: 78 01 08 02 mvhi r1,0x802 8004000: 38 21 08 ac ori r1,r1,0x8ac 8004004: 28 24 00 00 lw r4,(r1+0) 8004008: 34 84 00 01 addi r4,r4,1 800400c: 58 24 00 00 sw (r1+0),r4 _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; 8004010: 34 01 00 04 mvi r1,4 8004014: 58 61 00 34 sw (r3+52),r1 the_thread->Wait.option = *set; 8004018: 29 81 00 00 lw r1,(r12+0) } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 800401c: 78 04 08 02 mvhi r4,0x802 8004020: 38 84 0f 34 ori r4,r4,0xf34 the_thread->Wait.return_code = EINTR; the_thread->Wait.option = *set; 8004024: 58 61 00 30 sw (r3+48),r1 the_thread->Wait.return_argument = the_info; 8004028: 58 6b 00 28 sw (r3+40),r11 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; 800402c: 34 01 00 01 mvi r1,1 } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 8004030: 58 64 00 44 sw (r3+68),r4 8004034: 58 81 00 30 sw (r4+48),r1 the_thread->Wait.return_code = EINTR; the_thread->Wait.option = *set; the_thread->Wait.return_argument = the_info; _Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue ); _ISR_Enable( level ); 8004038: d0 0e 00 00 wcsr IE,r14 _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 800403c: 78 01 08 02 mvhi r1,0x802 8004040: 78 03 08 00 mvhi r3,0x800 8004044: 38 21 0f 34 ori r1,r1,0xf34 8004048: 38 63 70 80 ori r3,r3,0x7080 800404c: f8 00 0a d7 calli 8006ba8 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 8004050: f8 00 09 99 calli 80066b4 <_Thread_Enable_dispatch> /* * When the thread is set free by a signal, it is need to eliminate * the signal. */ _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, false, false ); 8004054: 29 62 00 00 lw r2,(r11+0) 8004058: b9 60 18 00 mv r3,r11 800405c: 34 04 00 00 mvi r4,0 8004060: 34 05 00 00 mvi r5,0 8004064: b9 a0 08 00 mv r1,r13 8004068: f8 00 19 39 calli 800a54c <_POSIX_signals_Clear_signals> errno = _Thread_Executing->Wait.return_code; 800406c: f8 00 28 07 calli 800e088 <__errno> 8004070: 78 02 08 02 mvhi r2,0x802 8004074: 38 42 0d 84 ori r2,r2,0xd84 8004078: 28 42 00 0c lw r2,(r2+12) 800407c: 28 42 00 34 lw r2,(r2+52) 8004080: 58 22 00 00 sw (r1+0),r2 return the_info->si_signo; 8004084: 29 6c 00 00 lw r12,(r11+0) } 8004088: b9 80 08 00 mv r1,r12 800408c: 2b 9d 00 04 lw ra,(sp+4) 8004090: 2b 8b 00 14 lw r11,(sp+20) 8004094: 2b 8c 00 10 lw r12,(sp+16) 8004098: 2b 8d 00 0c lw r13,(sp+12) 800409c: 2b 8e 00 08 lw r14,(sp+8) 80040a0: 37 9c 00 20 addi sp,sp,32 80040a4: c3 a0 00 00 ret =============================================================================== 08006334 : int sigwait( const sigset_t *set, int *sig ) { 8006334: 37 9c ff f8 addi sp,sp,-8 8006338: 5b 8b 00 08 sw (sp+8),r11 800633c: 5b 9d 00 04 sw (sp+4),ra int status; status = sigtimedwait( set, NULL, NULL ); 8006340: 34 03 00 00 mvi r3,0 int sigwait( const sigset_t *set, int *sig ) { 8006344: b8 40 58 00 mv r11,r2 int status; status = sigtimedwait( set, NULL, NULL ); 8006348: 34 02 00 00 mvi r2,0 800634c: fb ff ff 80 calli 800614c 8006350: b8 20 18 00 mv r3,r1 if ( status != -1 ) { 8006354: 34 01 ff ff mvi r1,-1 8006358: 44 61 00 05 be r3,r1,800636c if ( sig ) *sig = status; return 0; 800635c: 34 01 00 00 mvi r1,0 int status; status = sigtimedwait( set, NULL, NULL ); if ( status != -1 ) { if ( sig ) 8006360: 45 60 00 05 be r11,r0,8006374 <== NEVER TAKEN *sig = status; 8006364: 59 63 00 00 sw (r11+0),r3 8006368: e0 00 00 03 bi 8006374 return 0; } return errno; 800636c: f8 00 26 c7 calli 800fe88 <__errno> 8006370: 28 21 00 00 lw r1,(r1+0) } 8006374: 2b 9d 00 04 lw ra,(sp+4) 8006378: 2b 8b 00 08 lw r11,(sp+8) 800637c: 37 9c 00 08 addi sp,sp,8 8006380: c3 a0 00 00 ret =============================================================================== 0800598c : /* * Process input character, with semaphore. */ static int siproc (unsigned char c, struct rtems_termios_tty *tty) { 800598c: 37 9c ff f4 addi sp,sp,-12 8005990: 5b 8b 00 0c sw (sp+12),r11 8005994: 5b 8c 00 08 sw (sp+8),r12 8005998: 5b 9d 00 04 sw (sp+4),ra 800599c: b8 20 60 00 mv r12,r1 int i; /* * Obtain output semaphore if character will be echoed */ if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) { 80059a0: 28 41 00 3c lw r1,(r2+60) /* * Process input character, with semaphore. */ static int siproc (unsigned char c, struct rtems_termios_tty *tty) { 80059a4: b8 40 58 00 mv r11,r2 int i; /* * Obtain output semaphore if character will be echoed */ if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) { 80059a8: 20 21 0e 78 andi r1,r1,0xe78 80059ac: 44 20 00 0c be r1,r0,80059dc <== NEVER TAKEN rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 80059b0: 28 41 00 18 lw r1,(r2+24) 80059b4: 34 03 00 00 mvi r3,0 80059b8: 34 02 00 00 mvi r2,0 80059bc: f8 00 05 8d calli 8006ff0 i = iproc (c, tty); 80059c0: b9 80 08 00 mv r1,r12 80059c4: b9 60 10 00 mv r2,r11 80059c8: fb ff ff 84 calli 80057d8 80059cc: b8 20 60 00 mv r12,r1 rtems_semaphore_release (tty->osem); 80059d0: 29 61 00 18 lw r1,(r11+24) 80059d4: f8 00 05 d7 calli 8007130 80059d8: e0 00 00 04 bi 80059e8 } else { i = iproc (c, tty); 80059dc: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 80059e0: fb ff ff 7e calli 80057d8 <== NOT EXECUTED 80059e4: b8 20 60 00 mv r12,r1 <== NOT EXECUTED } return i; } 80059e8: b9 80 08 00 mv r1,r12 80059ec: 2b 9d 00 04 lw ra,(sp+4) 80059f0: 2b 8b 00 0c lw r11,(sp+12) 80059f4: 2b 8c 00 08 lw r12,(sp+8) 80059f8: 37 9c 00 0c addi sp,sp,12 80059fc: c3 a0 00 00 ret =============================================================================== 0800509c : #include int statvfs (const char *path, struct statvfs *sb) { 800509c: 37 9c ff dc addi sp,sp,-36 80050a0: 5b 8b 00 10 sw (sp+16),r11 80050a4: 5b 8c 00 0c sw (sp+12),r12 80050a8: 5b 8d 00 08 sw (sp+8),r13 80050ac: 5b 9d 00 04 sw (sp+4),ra 80050b0: b8 20 58 00 mv r11,r1 80050b4: b8 40 68 00 mv r13,r2 * 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 ) ) 80050b8: 37 8c 00 14 addi r12,sp,20 80050bc: f8 00 32 9b calli 8011b28 80050c0: b8 20 10 00 mv r2,r1 80050c4: 34 03 00 00 mvi r3,0 80050c8: b9 60 08 00 mv r1,r11 80050cc: b9 80 20 00 mv r4,r12 80050d0: 34 05 00 01 mvi r5,1 80050d4: fb ff fa 27 calli 8003970 return -1; 80050d8: 34 0b ff ff mvi r11,-1 * 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 ) ) 80050dc: 5c 20 00 0e bne r1,r0,8005114 <== NEVER TAKEN return -1; mt_entry = loc.mt_entry; 80050e0: 2b 8b 00 24 lw r11,(sp+36) fs_mount_root = &mt_entry->mt_fs_root; memset (sb, 0, sizeof (struct statvfs)); 80050e4: 34 02 00 00 mvi r2,0 80050e8: 34 03 00 38 mvi r3,56 80050ec: b9 a0 08 00 mv r1,r13 80050f0: f8 00 2d e2 calli 8010878 result = ( fs_mount_root->ops->statvfs_h )( fs_mount_root, sb ); 80050f4: 29 61 00 28 lw r1,(r11+40) 80050f8: b9 a0 10 00 mv r2,r13 80050fc: 28 23 00 44 lw r3,(r1+68) 8005100: 35 61 00 1c addi r1,r11,28 8005104: d8 60 00 00 call r3 8005108: b8 20 58 00 mv r11,r1 rtems_filesystem_freenode( &loc ); 800510c: b9 80 08 00 mv r1,r12 8005110: fb ff fa 6a calli 8003ab8 return result; } 8005114: b9 60 08 00 mv r1,r11 8005118: 2b 9d 00 04 lw ra,(sp+4) 800511c: 2b 8b 00 10 lw r11,(sp+16) 8005120: 2b 8c 00 0c lw r12,(sp+12) 8005124: 2b 8d 00 08 lw r13,(sp+8) 8005128: 37 9c 00 24 addi sp,sp,36 800512c: c3 a0 00 00 ret =============================================================================== 080039ac : fdatasync(fn); } /* iterate over all FILE *'s for this thread */ static void sync_per_thread(Thread_Control *t) { 80039ac: 37 9c ff f4 addi sp,sp,-12 80039b0: 5b 8b 00 0c sw (sp+12),r11 80039b4: 5b 8c 00 08 sw (sp+8),r12 80039b8: 5b 9d 00 04 sw (sp+4),ra /* * The sync_wrapper() function will operate on the current thread's * reent structure so we will temporarily use that. */ this_reent = t->libc_reent; 80039bc: 28 22 01 24 lw r2,(r1+292) if ( this_reent ) { 80039c0: 44 40 00 0c be r2,r0,80039f0 <== NEVER TAKEN current_reent = _Thread_Executing->libc_reent; 80039c4: 78 0b 08 01 mvhi r11,0x801 80039c8: 39 6b 6d 44 ori r11,r11,0x6d44 80039cc: 29 63 00 0c lw r3,(r11+12) 80039d0: 28 6c 01 24 lw r12,(r3+292) _Thread_Executing->libc_reent = this_reent; 80039d4: 58 62 01 24 sw (r3+292),r2 _fwalk (t->libc_reent, sync_wrapper); 80039d8: 28 21 01 24 lw r1,(r1+292) 80039dc: 78 02 08 00 mvhi r2,0x800 80039e0: 38 42 3a 04 ori r2,r2,0x3a04 80039e4: f8 00 2b d6 calli 800e93c <_fwalk> _Thread_Executing->libc_reent = current_reent; 80039e8: 29 61 00 0c lw r1,(r11+12) 80039ec: 58 2c 01 24 sw (r1+292),r12 } } 80039f0: 2b 9d 00 04 lw ra,(sp+4) 80039f4: 2b 8b 00 0c lw r11,(sp+12) 80039f8: 2b 8c 00 08 lw r12,(sp+8) 80039fc: 37 9c 00 0c addi sp,sp,12 8003a00: c3 a0 00 00 ret =============================================================================== 080022d0 : int tcflow ( int fd __attribute__((unused)), int action ) { 80022d0: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 80022d4: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED case TCOOFF: case TCOON: case TCIOFF: case TCION: default: rtems_set_errno_and_return_minus_one( EINVAL ); 80022d8: f8 00 1f c4 calli 800a1e8 <__errno> <== NOT EXECUTED 80022dc: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 80022e0: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED /* fd is not validated */ /* When this is supported, implement it here */ rtems_set_errno_and_return_minus_one( ENOTSUP ); } 80022e4: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 80022e8: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80022ec: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 80022f0: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080022f4 : int tcflush ( int fd __attribute__((unused)), int queue ) { 80022f4: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 80022f8: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED switch (queue) { case TCIFLUSH: case TCOFLUSH: case TCIOFLUSH: default: rtems_set_errno_and_return_minus_one( EINVAL ); 80022fc: f8 00 1f bb calli 800a1e8 <__errno> <== NOT EXECUTED 8002300: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8002304: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED /* fd is not validated */ /* When this is supported, implement it here */ rtems_set_errno_and_return_minus_one( ENOTSUP ); return 0; } 8002308: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800230c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8002310: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 8002314: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08002318 : #include #include pid_t tcgetpgrp(int fd __attribute__((unused))) { 8002318: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 800231c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED return getpid(); 8002320: fb ff fc 83 calli 800152c <== NOT EXECUTED } 8002324: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8002328: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 800232c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08002330 : int tcsendbreak ( int fd __attribute__((unused)), int duration __attribute__((unused)) ) { return 0; } 8002330: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8002334: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08004370 : int tcsetattr( int fd, int opt, struct termios *tp ) { 8004370: 37 9c ff f4 addi sp,sp,-12 8004374: 5b 8b 00 0c sw (sp+12),r11 8004378: 5b 8c 00 08 sw (sp+8),r12 800437c: 5b 9d 00 04 sw (sp+4),ra 8004380: b8 20 60 00 mv r12,r1 8004384: b8 60 58 00 mv r11,r3 switch (opt) { 8004388: 44 40 00 0d be r2,r0,80043bc 800438c: 34 03 00 01 mvi r3,1 8004390: 44 43 00 06 be r2,r3,80043a8 default: rtems_set_errno_and_return_minus_one( ENOTSUP ); 8004394: f8 00 31 f4 calli 8010b64 <__errno> 8004398: 34 02 00 86 mvi r2,134 800439c: 58 22 00 00 sw (r1+0),r2 80043a0: 34 02 ff ff mvi r2,-1 80043a4: e0 00 00 0b bi 80043d0 case TCSADRAIN: if (ioctl( fd, RTEMS_IO_TCDRAIN, NULL ) < 0) 80043a8: 34 02 00 03 mvi r2,3 80043ac: 34 03 00 00 mvi r3,0 80043b0: f8 00 22 01 calli 800cbb4 return -1; 80043b4: 34 02 ff ff mvi r2,-1 switch (opt) { default: rtems_set_errno_and_return_minus_one( ENOTSUP ); case TCSADRAIN: if (ioctl( fd, RTEMS_IO_TCDRAIN, NULL ) < 0) 80043b8: 48 01 00 06 bg r0,r1,80043d0 <== NEVER TAKEN return -1; /* * Fall through to.... */ case TCSANOW: return ioctl( fd, RTEMS_IO_SET_ATTRIBUTES, tp ); 80043bc: 34 02 00 02 mvi r2,2 80043c0: b9 80 08 00 mv r1,r12 80043c4: b9 60 18 00 mv r3,r11 80043c8: f8 00 21 fb calli 800cbb4 80043cc: b8 20 10 00 mv r2,r1 } } 80043d0: b8 40 08 00 mv r1,r2 80043d4: 2b 9d 00 04 lw ra,(sp+4) 80043d8: 2b 8b 00 0c lw r11,(sp+12) 80043dc: 2b 8c 00 08 lw r12,(sp+8) 80043e0: 37 9c 00 0c addi sp,sp,12 80043e4: c3 a0 00 00 ret =============================================================================== 08002338 : int tcsetpgrp( int fd __attribute__((unused)), pid_t pid __attribute__((unused)) ) { return 0; } 8002338: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 800233c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08002eac : int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 8002eac: 37 9c ff ec addi sp,sp,-20 8002eb0: 5b 8b 00 14 sw (sp+20),r11 8002eb4: 5b 8c 00 10 sw (sp+16),r12 8002eb8: 5b 8d 00 0c sw (sp+12),r13 8002ebc: 5b 8e 00 08 sw (sp+8),r14 8002ec0: 5b 9d 00 04 sw (sp+4),ra 8002ec4: b8 40 60 00 mv r12,r2 POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 8002ec8: 34 02 00 01 mvi r2,1 int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 8002ecc: b8 60 68 00 mv r13,r3 POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 8002ed0: 5c 22 00 0c bne r1,r2,8002f00 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) 8002ed4: 44 60 00 0b be r3,r0,8002f00 /* * The data of the structure evp are checked in order to verify if they * are coherent. */ if (evp != NULL) { 8002ed8: 45 80 00 0d be r12,r0,8002f0c /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 8002edc: 29 82 00 00 lw r2,(r12+0) 8002ee0: 34 42 ff ff addi r2,r2,-1 8002ee4: 50 22 00 02 bgeu r1,r2,8002eec <== ALWAYS TAKEN 8002ee8: e0 00 00 06 bi 8002f00 <== NOT EXECUTED ( evp->sigev_notify != SIGEV_SIGNAL ) ) { /* The value of the field sigev_notify is not valid */ rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !evp->sigev_signo ) 8002eec: 29 81 00 04 lw r1,(r12+4) 8002ef0: 44 20 00 04 be r1,r0,8002f00 <== NEVER TAKEN static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 8002ef4: 34 21 ff ff addi r1,r1,-1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) 8002ef8: 34 02 00 1f mvi r2,31 8002efc: 50 41 00 04 bgeu r2,r1,8002f0c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 8002f00: f8 00 29 dc calli 800d670 <__errno> 8002f04: 34 02 00 16 mvi r2,22 8002f08: e0 00 00 0e bi 8002f40 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8002f0c: 78 01 08 01 mvhi r1,0x801 8002f10: 38 21 f8 bc ori r1,r1,0xf8bc 8002f14: 28 22 00 00 lw r2,(r1+0) 8002f18: 34 42 00 01 addi r2,r2,1 8002f1c: 58 22 00 00 sw (r1+0),r2 * the inactive chain of free timer control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Allocate( void ) { return (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information ); 8002f20: 78 01 08 01 mvhi r1,0x801 8002f24: 38 21 fb 5c ori r1,r1,0xfb5c 8002f28: f8 00 07 10 calli 8004b68 <_Objects_Allocate> 8002f2c: b8 20 58 00 mv r11,r1 /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 8002f30: 5c 20 00 07 bne r1,r0,8002f4c _Thread_Enable_dispatch(); 8002f34: f8 00 0a 6a calli 80058dc <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 8002f38: f8 00 29 ce calli 800d670 <__errno> 8002f3c: 34 02 00 0b mvi r2,11 8002f40: 58 22 00 00 sw (r1+0),r2 8002f44: 34 01 ff ff mvi r1,-1 8002f48: e0 00 00 25 bi 8002fdc } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 8002f4c: 34 01 00 02 mvi r1,2 8002f50: 31 61 00 3c sb (r11+60),r1 ptimer->thread_id = _Thread_Executing->Object.id; 8002f54: 78 01 08 01 mvhi r1,0x801 8002f58: 38 21 fd 94 ori r1,r1,0xfd94 8002f5c: 28 21 00 0c lw r1,(r1+12) 8002f60: 28 21 00 08 lw r1,(r1+8) 8002f64: 59 61 00 38 sw (r11+56),r1 if ( evp != NULL ) { 8002f68: 45 80 00 07 be r12,r0,8002f84 ptimer->inf.sigev_notify = evp->sigev_notify; 8002f6c: 29 81 00 00 lw r1,(r12+0) 8002f70: 59 61 00 40 sw (r11+64),r1 ptimer->inf.sigev_signo = evp->sigev_signo; 8002f74: 29 81 00 04 lw r1,(r12+4) 8002f78: 59 61 00 44 sw (r11+68),r1 ptimer->inf.sigev_value = evp->sigev_value; 8002f7c: 29 81 00 08 lw r1,(r12+8) 8002f80: 59 61 00 48 sw (r11+72),r1 uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 8002f84: 29 6c 00 08 lw r12,(r11+8) _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; _Thread_Enable_dispatch(); return 0; } 8002f88: 78 01 08 01 mvhi r1,0x801 8002f8c: 38 21 fb 5c ori r1,r1,0xfb5c #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8002f90: 28 2e 00 1c lw r14,(r1+28) 8002f94: 34 02 00 02 mvi r2,2 ptimer->inf.sigev_notify = evp->sigev_notify; ptimer->inf.sigev_signo = evp->sigev_signo; ptimer->inf.sigev_value = evp->sigev_value; } ptimer->overrun = 0; 8002f98: 59 60 00 68 sw (r11+104),r0 ptimer->timer_data.it_value.tv_sec = 0; 8002f9c: 59 60 00 5c sw (r11+92),r0 ptimer->timer_data.it_value.tv_nsec = 0; 8002fa0: 59 60 00 60 sw (r11+96),r0 ptimer->timer_data.it_interval.tv_sec = 0; 8002fa4: 59 60 00 54 sw (r11+84),r0 ptimer->timer_data.it_interval.tv_nsec = 0; 8002fa8: 59 60 00 58 sw (r11+88),r0 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8002fac: 59 60 00 18 sw (r11+24),r0 the_watchdog->routine = routine; 8002fb0: 59 60 00 2c sw (r11+44),r0 the_watchdog->id = id; 8002fb4: 59 60 00 30 sw (r11+48),r0 the_watchdog->user_data = user_data; 8002fb8: 59 60 00 34 sw (r11+52),r0 8002fbc: 21 81 ff ff andi r1,r12,0xffff 8002fc0: f8 00 61 59 calli 801b524 <__ashlsi3> 8002fc4: b5 c1 08 00 add r1,r14,r1 8002fc8: 58 2b 00 00 sw (r1+0),r11 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 8002fcc: 59 60 00 0c sw (r11+12),r0 _Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL ); _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; 8002fd0: 59 ac 00 00 sw (r13+0),r12 _Thread_Enable_dispatch(); 8002fd4: f8 00 0a 42 calli 80058dc <_Thread_Enable_dispatch> return 0; 8002fd8: 34 01 00 00 mvi r1,0 } 8002fdc: 2b 9d 00 04 lw ra,(sp+4) 8002fe0: 2b 8b 00 14 lw r11,(sp+20) 8002fe4: 2b 8c 00 10 lw r12,(sp+16) 8002fe8: 2b 8d 00 0c lw r13,(sp+12) 8002fec: 2b 8e 00 08 lw r14,(sp+8) 8002ff0: 37 9c 00 14 addi sp,sp,20 8002ff4: c3 a0 00 00 ret =============================================================================== 08002ff8 : timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue ) { 8002ff8: 37 9c ff cc addi sp,sp,-52 8002ffc: 5b 8b 00 18 sw (sp+24),r11 8003000: 5b 8c 00 14 sw (sp+20),r12 8003004: 5b 8d 00 10 sw (sp+16),r13 8003008: 5b 8e 00 0c sw (sp+12),r14 800300c: 5b 8f 00 08 sw (sp+8),r15 8003010: 5b 9d 00 04 sw (sp+4),ra 8003014: b8 20 78 00 mv r15,r1 8003018: b8 40 58 00 mv r11,r2 800301c: b8 60 60 00 mv r12,r3 8003020: b8 80 68 00 mv r13,r4 Objects_Locations location; bool activated; uint32_t initial_period; struct itimerspec normalize; if ( !value ) 8003024: 44 60 00 69 be r3,r0,80031c8 <== NEVER TAKEN /* * First, it verifies if the structure "value" is correct * if the number of nanoseconds is not correct return EINVAL */ if ( !_Timespec_Is_valid( &(value->it_value) ) ) { 8003028: 34 61 00 08 addi r1,r3,8 800302c: f8 00 0e 70 calli 80069ec <_Timespec_Is_valid> 8003030: 44 20 00 66 be r1,r0,80031c8 rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !_Timespec_Is_valid( &(value->it_interval) ) ) { 8003034: b9 80 08 00 mv r1,r12 8003038: f8 00 0e 6d calli 80069ec <_Timespec_Is_valid> 800303c: 44 20 00 63 be r1,r0,80031c8 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); } if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { 8003040: 7d 62 00 00 cmpnei r2,r11,0 8003044: 7d 61 00 04 cmpnei r1,r11,4 8003048: a0 41 08 00 and r1,r2,r1 800304c: 5c 20 00 5f bne r1,r0,80031c8 rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 8003050: 29 81 00 0c lw r1,(r12+12) 8003054: 29 84 00 00 lw r4,(r12+0) 8003058: 29 83 00 04 lw r3,(r12+4) 800305c: 29 82 00 08 lw r2,(r12+8) 8003060: 5b 81 00 28 sw (sp+40),r1 8003064: 5b 84 00 1c sw (sp+28),r4 8003068: 5b 83 00 20 sw (sp+32),r3 800306c: 5b 82 00 24 sw (sp+36),r2 /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { 8003070: 34 01 00 04 mvi r1,4 8003074: 5d 61 00 0d bne r11,r1,80030a8 struct timespec now; _TOD_Get( &now ); 8003078: 37 8b 00 2c addi r11,sp,44 800307c: b9 60 08 00 mv r1,r11 8003080: f8 00 04 f1 calli 8004444 <_TOD_Get> /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 8003084: 37 8e 00 24 addi r14,sp,36 8003088: b9 60 08 00 mv r1,r11 800308c: b9 c0 10 00 mv r2,r14 8003090: f8 00 0e 4c calli 80069c0 <_Timespec_Greater_than> 8003094: 5c 20 00 4d bne r1,r0,80031c8 rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value ); 8003098: b9 60 08 00 mv r1,r11 800309c: b9 c0 10 00 mv r2,r14 80030a0: b9 c0 18 00 mv r3,r14 80030a4: f8 00 0e 5e calli 8006a1c <_Timespec_Subtract> timer_t id, Objects_Locations *location ) { return (POSIX_Timer_Control *) _Objects_Get( &_POSIX_Timer_Information, (Objects_Id) id, location ); 80030a8: 78 03 08 01 mvhi r3,0x801 80030ac: b8 60 08 00 mv r1,r3 80030b0: b9 e0 10 00 mv r2,r15 80030b4: 38 21 fb 5c ori r1,r1,0xfb5c 80030b8: 37 83 00 34 addi r3,sp,52 80030bc: f8 00 07 fa calli 80050a4 <_Objects_Get> * something with the structure of times of the timer: to stop, start * or start it again */ ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { 80030c0: 2b 82 00 34 lw r2,(sp+52) 80030c4: b8 20 58 00 mv r11,r1 80030c8: 5c 40 00 40 bne r2,r0,80031c8 case OBJECTS_LOCAL: /* First, it verifies if the timer must be stopped */ if ( normalize.it_value.tv_sec == 0 && normalize.it_value.tv_nsec == 0 ) { 80030cc: 2b 81 00 24 lw r1,(sp+36) 80030d0: 5c 22 00 19 bne r1,r2,8003134 80030d4: 2b 8e 00 28 lw r14,(sp+40) 80030d8: 5d c1 00 17 bne r14,r1,8003134 /* Stop the timer */ (void) _Watchdog_Remove( &ptimer->Timer ); 80030dc: 35 61 00 10 addi r1,r11,16 80030e0: f8 00 0f c4 calli 8006ff0 <_Watchdog_Remove> /* The old data of the timer are returned */ if ( ovalue ) 80030e4: 45 ae 00 09 be r13,r14,8003108 *ovalue = ptimer->timer_data; 80030e8: 29 64 00 54 lw r4,(r11+84) 80030ec: 29 63 00 58 lw r3,(r11+88) 80030f0: 29 62 00 5c lw r2,(r11+92) 80030f4: 29 61 00 60 lw r1,(r11+96) 80030f8: 59 a4 00 00 sw (r13+0),r4 80030fc: 59 a3 00 04 sw (r13+4),r3 8003100: 59 a2 00 08 sw (r13+8),r2 8003104: 59 a1 00 0c sw (r13+12),r1 /* The new data are set */ ptimer->timer_data = normalize; 8003108: 2b 81 00 1c lw r1,(sp+28) 800310c: 59 61 00 54 sw (r11+84),r1 8003110: 2b 81 00 20 lw r1,(sp+32) 8003114: 59 61 00 58 sw (r11+88),r1 8003118: 2b 81 00 24 lw r1,(sp+36) 800311c: 59 61 00 5c sw (r11+92),r1 8003120: 2b 81 00 28 lw r1,(sp+40) 8003124: 59 61 00 60 sw (r11+96),r1 /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 8003128: 34 01 00 04 mvi r1,4 800312c: 31 61 00 3c sb (r11+60),r1 8003130: e0 00 00 23 bi 80031bc _Thread_Enable_dispatch(); return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); 8003134: b9 80 08 00 mv r1,r12 8003138: f8 00 0e 4b calli 8006a64 <_Timespec_To_ticks> 800313c: 59 61 00 64 sw (r11+100),r1 initial_period = _Timespec_To_ticks( &normalize.it_value ); 8003140: 37 81 00 24 addi r1,sp,36 8003144: f8 00 0e 48 calli 8006a64 <_Timespec_To_ticks> activated = _POSIX_Timer_Insert_helper( 8003148: 29 63 00 08 lw r3,(r11+8) 800314c: 78 04 08 00 mvhi r4,0x800 return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); initial_period = _Timespec_To_ticks( &normalize.it_value ); 8003150: b8 20 10 00 mv r2,r1 activated = _POSIX_Timer_Insert_helper( 8003154: 38 84 31 f8 ori r4,r4,0x31f8 8003158: 35 61 00 10 addi r1,r11,16 800315c: b9 60 28 00 mv r5,r11 8003160: f8 00 1a 64 calli 8009af0 <_POSIX_Timer_Insert_helper> initial_period, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { 8003164: 44 20 00 16 be r1,r0,80031bc /* * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) 8003168: 45 a0 00 09 be r13,r0,800318c *ovalue = ptimer->timer_data; 800316c: 29 64 00 54 lw r4,(r11+84) 8003170: 29 63 00 58 lw r3,(r11+88) 8003174: 29 62 00 5c lw r2,(r11+92) 8003178: 29 61 00 60 lw r1,(r11+96) 800317c: 59 a4 00 00 sw (r13+0),r4 8003180: 59 a3 00 04 sw (r13+4),r3 8003184: 59 a2 00 08 sw (r13+8),r2 8003188: 59 a1 00 0c sw (r13+12),r1 ptimer->timer_data = normalize; 800318c: 2b 81 00 1c lw r1,(sp+28) 8003190: 59 61 00 54 sw (r11+84),r1 8003194: 2b 81 00 20 lw r1,(sp+32) 8003198: 59 61 00 58 sw (r11+88),r1 800319c: 2b 81 00 24 lw r1,(sp+36) 80031a0: 59 61 00 5c sw (r11+92),r1 80031a4: 2b 81 00 28 lw r1,(sp+40) 80031a8: 59 61 00 60 sw (r11+96),r1 /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 80031ac: 34 01 00 03 mvi r1,3 80031b0: 31 61 00 3c sb (r11+60),r1 _TOD_Get( &ptimer->time ); 80031b4: 35 61 00 6c addi r1,r11,108 80031b8: f8 00 04 a3 calli 8004444 <_TOD_Get> _Thread_Enable_dispatch(); 80031bc: f8 00 09 c8 calli 80058dc <_Thread_Enable_dispatch> return 0; 80031c0: 34 01 00 00 mvi r1,0 80031c4: e0 00 00 05 bi 80031d8 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 80031c8: f8 00 29 2a calli 800d670 <__errno> 80031cc: 34 02 00 16 mvi r2,22 80031d0: 58 22 00 00 sw (r1+0),r2 80031d4: 34 01 ff ff mvi r1,-1 } 80031d8: 2b 9d 00 04 lw ra,(sp+4) 80031dc: 2b 8b 00 18 lw r11,(sp+24) 80031e0: 2b 8c 00 14 lw r12,(sp+20) 80031e4: 2b 8d 00 10 lw r13,(sp+16) 80031e8: 2b 8e 00 0c lw r14,(sp+12) 80031ec: 2b 8f 00 08 lw r15,(sp+8) 80031f0: 37 9c 00 34 addi sp,sp,52 80031f4: c3 a0 00 00 ret =============================================================================== 08002ddc : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 8002ddc: 37 9c ff e8 addi sp,sp,-24 8002de0: 5b 8b 00 10 sw (sp+16),r11 8002de4: 5b 8c 00 0c sw (sp+12),r12 8002de8: 5b 8d 00 08 sw (sp+8),r13 8002dec: 5b 9d 00 04 sw (sp+4),ra /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 8002df0: 78 0b 08 01 mvhi r11,0x801 8002df4: 39 6b 71 30 ori r11,r11,0x7130 useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 8002df8: b8 20 68 00 mv r13,r1 /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 8002dfc: 29 61 00 1c lw r1,(r11+28) 8002e00: 5c 20 00 09 bne r1,r0,8002e24 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 8002e04: 78 01 08 00 mvhi r1,0x800 8002e08: 38 21 2d 94 ori r1,r1,0x2d94 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8002e0c: 59 60 00 08 sw (r11+8),r0 the_watchdog->routine = routine; 8002e10: 59 61 00 1c sw (r11+28),r1 the_watchdog->id = id; 8002e14: 59 60 00 20 sw (r11+32),r0 the_watchdog->user_data = user_data; 8002e18: 59 60 00 24 sw (r11+36),r0 useconds_t ualarm( useconds_t useconds, useconds_t interval ) { useconds_t remaining = 0; 8002e1c: 34 0c 00 00 mvi r12,0 8002e20: e0 00 00 18 bi 8002e80 if ( !the_timer->routine ) { _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 8002e24: b9 60 08 00 mv r1,r11 8002e28: f8 00 0e e4 calli 80069b8 <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 8002e2c: 34 21 ff fe addi r1,r1,-2 8002e30: 34 02 00 01 mvi r2,1 useconds_t ualarm( useconds_t useconds, useconds_t interval ) { useconds_t remaining = 0; 8002e34: 34 0c 00 00 mvi r12,0 _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 8002e38: 54 22 00 12 bgu r1,r2,8002e80 <== NEVER TAKEN * boot. Since alarm() is dealing in seconds, we must account for * this. */ ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); 8002e3c: 29 61 00 0c lw r1,(r11+12) 8002e40: 29 62 00 14 lw r2,(r11+20) 8002e44: b4 41 10 00 add r2,r2,r1 8002e48: 29 61 00 18 lw r1,(r11+24) /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 8002e4c: c8 41 08 00 sub r1,r2,r1 8002e50: 37 82 00 14 addi r2,sp,20 8002e54: f8 00 0d 11 calli 8006298 <_Timespec_From_ticks> remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 8002e58: 78 03 08 01 mvhi r3,0x801 8002e5c: 38 63 4e b0 ori r3,r3,0x4eb0 8002e60: 28 62 00 00 lw r2,(r3+0) 8002e64: 2b 81 00 14 lw r1,(sp+20) 8002e68: f8 00 43 5f calli 8013be4 <__mulsi3> 8002e6c: b8 20 60 00 mv r12,r1 remaining += tp.tv_nsec / 1000; 8002e70: 2b 81 00 18 lw r1,(sp+24) 8002e74: 34 02 03 e8 mvi r2,1000 8002e78: f8 00 43 67 calli 8013c14 <__divsi3> 8002e7c: b4 2c 60 00 add r12,r1,r12 /* * If useconds is non-zero, then the caller wants to schedule * the alarm repeatedly at that interval. If the interval is * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { 8002e80: 45 a0 00 1a be r13,r0,8002ee8 Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 8002e84: 78 03 08 01 mvhi r3,0x801 8002e88: 38 63 4e b0 ori r3,r3,0x4eb0 8002e8c: 28 62 00 00 lw r2,(r3+0) 8002e90: b9 a0 08 00 mv r1,r13 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; ticks = _Timespec_To_ticks( &tp ); 8002e94: 37 8b 00 14 addi r11,sp,20 * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 8002e98: f8 00 43 b8 calli 8013d78 <__udivsi3> tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 8002e9c: 78 03 08 01 mvhi r3,0x801 8002ea0: 38 63 4e b0 ori r3,r3,0x4eb0 8002ea4: 28 62 00 00 lw r2,(r3+0) * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 8002ea8: 5b 81 00 14 sw (sp+20),r1 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 8002eac: b9 a0 08 00 mv r1,r13 8002eb0: f8 00 43 c2 calli 8013db8 <__umodsi3> 8002eb4: 34 02 03 e8 mvi r2,1000 8002eb8: f8 00 43 4b calli 8013be4 <__mulsi3> 8002ebc: 5b 81 00 18 sw (sp+24),r1 ticks = _Timespec_To_ticks( &tp ); 8002ec0: b9 60 08 00 mv r1,r11 8002ec4: f8 00 0d 23 calli 8006350 <_Timespec_To_ticks> if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 8002ec8: b9 60 08 00 mv r1,r11 8002ecc: f8 00 0d 21 calli 8006350 <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8002ed0: 78 02 08 01 mvhi r2,0x801 8002ed4: 38 42 71 30 ori r2,r2,0x7130 8002ed8: 58 41 00 0c sw (r2+12),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8002edc: 78 01 08 01 mvhi r1,0x801 8002ee0: 38 21 69 80 ori r1,r1,0x6980 8002ee4: f8 00 0e 58 calli 8006844 <_Watchdog_Insert> } return remaining; } 8002ee8: b9 80 08 00 mv r1,r12 8002eec: 2b 9d 00 04 lw ra,(sp+4) 8002ef0: 2b 8b 00 10 lw r11,(sp+16) 8002ef4: 2b 8c 00 0c lw r12,(sp+12) 8002ef8: 2b 8d 00 08 lw r13,(sp+8) 8002efc: 37 9c 00 18 addi sp,sp,24 8002f00: c3 a0 00 00 ret =============================================================================== 0800390c : #include int unlink( const char *path ) { 800390c: 37 9c ff c0 addi sp,sp,-64 8003910: 5b 8b 00 14 sw (sp+20),r11 8003914: 5b 8c 00 10 sw (sp+16),r12 8003918: 5b 8d 00 0c sw (sp+12),r13 800391c: 5b 8e 00 08 sw (sp+8),r14 8003920: 5b 9d 00 04 sw (sp+4),ra 8003924: b8 20 70 00 mv r14,r1 /* * Get the node to be unlinked. Find the parent path first. */ parentpathlen = rtems_filesystem_dirname ( path ); 8003928: fb ff fb 54 calli 8002678 800392c: b8 20 58 00 mv r11,r1 8003930: 37 84 00 2c addi r4,sp,44 if ( parentpathlen == 0 ) 8003934: 5c 20 00 07 bne r1,r0,8003950 rtems_filesystem_get_start_loc( path, &i, &parentloc ); 8003938: b9 c0 08 00 mv r1,r14 800393c: 37 82 00 40 addi r2,sp,64 8003940: b8 80 18 00 mv r3,r4 8003944: fb ff ff c0 calli 8003844 const char *name; rtems_filesystem_location_info_t parentloc; rtems_filesystem_location_info_t loc; int i; int result; bool free_parentloc = false; 8003948: 34 0d 00 00 mvi r13,0 800394c: e0 00 00 09 bi 8003970 parentpathlen = rtems_filesystem_dirname ( path ); if ( parentpathlen == 0 ) rtems_filesystem_get_start_loc( path, &i, &parentloc ); else { result = rtems_filesystem_evaluate_path( path, parentpathlen, 8003950: b9 c0 08 00 mv r1,r14 8003954: b9 60 10 00 mv r2,r11 8003958: 34 03 00 02 mvi r3,2 800395c: 34 05 00 00 mvi r5,0 8003960: fb ff fb 21 calli 80025e4 RTEMS_LIBIO_PERMS_WRITE, &parentloc, false ); if ( result != 0 ) return -1; 8003964: 34 0c ff ff mvi r12,-1 else { result = rtems_filesystem_evaluate_path( path, parentpathlen, RTEMS_LIBIO_PERMS_WRITE, &parentloc, false ); if ( result != 0 ) 8003968: 5c 20 00 3d bne r1,r0,8003a5c <== NEVER TAKEN return -1; free_parentloc = true; 800396c: 34 0d 00 01 mvi r13,1 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 8003970: 2b 81 00 2c lw r1,(sp+44) name = path + parentpathlen; 8003974: b5 cb 58 00 add r11,r14,r11 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 8003978: 5b 81 00 18 sw (sp+24),r1 800397c: 2b 81 00 30 lw r1,(sp+48) 8003980: 5b 81 00 1c sw (sp+28),r1 8003984: 2b 81 00 34 lw r1,(sp+52) 8003988: 5b 81 00 20 sw (sp+32),r1 800398c: 2b 81 00 38 lw r1,(sp+56) 8003990: 5b 81 00 24 sw (sp+36),r1 8003994: 2b 81 00 3c lw r1,(sp+60) 8003998: 5b 81 00 28 sw (sp+40),r1 name = path + parentpathlen; name += rtems_filesystem_prefix_separators( name, strlen( name ) ); 800399c: b9 60 08 00 mv r1,r11 80039a0: f8 00 3b 37 calli 801267c 80039a4: b8 20 10 00 mv r2,r1 80039a8: b9 60 08 00 mv r1,r11 80039ac: fb ff fb 47 calli 80026c8 80039b0: b5 61 60 00 add r12,r11,r1 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 80039b4: b9 80 08 00 mv r1,r12 80039b8: f8 00 3b 31 calli 801267c 80039bc: 37 8b 00 18 addi r11,sp,24 80039c0: b8 20 10 00 mv r2,r1 80039c4: 34 03 00 00 mvi r3,0 80039c8: b9 80 08 00 mv r1,r12 80039cc: b9 60 20 00 mv r4,r11 80039d0: 34 05 00 00 mvi r5,0 80039d4: fb ff fa d8 calli 8002534 0, &loc, false ); if ( result != 0 ) { 80039d8: 44 20 00 05 be r1,r0,80039ec if ( free_parentloc ) rtems_filesystem_freenode( &parentloc ); return -1; 80039dc: 34 0c ff ff mvi r12,-1 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 0, &loc, false ); if ( result != 0 ) { if ( free_parentloc ) rtems_filesystem_freenode( &parentloc ); 80039e0: 37 81 00 2c addi r1,sp,44 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 ) 80039e4: 45 a0 00 1e be r13,r0,8003a5c <== NEVER TAKEN 80039e8: e0 00 00 1c bi 8003a58 rtems_filesystem_freenode( &parentloc ); return -1; } if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) { 80039ec: 2b 81 00 24 lw r1,(sp+36) 80039f0: 28 22 00 10 lw r2,(r1+16) 80039f4: b9 60 08 00 mv r1,r11 80039f8: d8 40 00 00 call r2 80039fc: 34 02 00 01 mvi r2,1 8003a00: 5c 22 00 0b bne r1,r2,8003a2c rtems_filesystem_freenode( &loc ); 8003a04: b9 60 08 00 mv r1,r11 8003a08: fb ff fb 49 calli 800272c if ( free_parentloc ) 8003a0c: 45 a0 00 03 be r13,r0,8003a18 <== ALWAYS TAKEN rtems_filesystem_freenode( &parentloc ); 8003a10: 37 81 00 2c addi r1,sp,44 <== NOT EXECUTED 8003a14: fb ff fb 46 calli 800272c <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EISDIR ); 8003a18: f8 00 36 ad calli 80114cc <__errno> 8003a1c: 34 02 00 15 mvi r2,21 8003a20: 58 22 00 00 sw (r1+0),r2 8003a24: 34 0c ff ff mvi r12,-1 8003a28: e0 00 00 0d bi 8003a5c } result = (*loc.ops->unlink_h)( &parentloc, &loc ); 8003a2c: 2b 81 00 24 lw r1,(sp+36) 8003a30: 37 8e 00 2c addi r14,sp,44 8003a34: b9 60 10 00 mv r2,r11 8003a38: 28 23 00 0c lw r3,(r1+12) 8003a3c: b9 c0 08 00 mv r1,r14 8003a40: d8 60 00 00 call r3 8003a44: b8 20 60 00 mv r12,r1 rtems_filesystem_freenode( &loc ); 8003a48: b9 60 08 00 mv r1,r11 8003a4c: fb ff fb 38 calli 800272c if ( free_parentloc ) 8003a50: 45 a0 00 03 be r13,r0,8003a5c rtems_filesystem_freenode( &parentloc ); 8003a54: b9 c0 08 00 mv r1,r14 8003a58: fb ff fb 35 calli 800272c return result; } 8003a5c: b9 80 08 00 mv r1,r12 8003a60: 2b 9d 00 04 lw ra,(sp+4) 8003a64: 2b 8b 00 14 lw r11,(sp+20) 8003a68: 2b 8c 00 10 lw r12,(sp+16) 8003a6c: 2b 8d 00 0c lw r13,(sp+12) 8003a70: 2b 8e 00 08 lw r14,(sp+8) 8003a74: 37 9c 00 40 addi sp,sp,64 8003a78: c3 a0 00 00 ret =============================================================================== 08003988 : */ int unmount( const char *path ) { 8003988: 37 9c ff dc addi sp,sp,-36 800398c: 5b 8b 00 10 sw (sp+16),r11 8003990: 5b 8c 00 0c sw (sp+12),r12 8003994: 5b 8d 00 08 sw (sp+8),r13 8003998: 5b 9d 00 04 sw (sp+4),ra 800399c: b8 20 58 00 mv r11,r1 * 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 ) ) 80039a0: 37 8c 00 14 addi r12,sp,20 80039a4: f8 00 2c 8c calli 800ebd4 80039a8: b8 20 10 00 mv r2,r1 80039ac: 34 03 00 00 mvi r3,0 80039b0: b9 60 08 00 mv r1,r11 80039b4: b9 80 20 00 mv r4,r12 80039b8: 34 05 00 01 mvi r5,1 80039bc: fb ff fa 18 calli 800221c 80039c0: 5c 20 00 41 bne r1,r0,8003ac4 return -1; mt_entry = loc.mt_entry; 80039c4: 2b 8b 00 24 lw r11,(sp+36) /* * Verify this is the root node for the file system to be unmounted. */ if ( fs_root_loc->node_access != loc.node_access ){ 80039c8: 2b 81 00 14 lw r1,(sp+20) 80039cc: 29 62 00 1c lw r2,(r11+28) 80039d0: 44 41 00 06 be r2,r1,80039e8 rtems_filesystem_freenode( &loc ); 80039d4: b9 80 08 00 mv r1,r12 80039d8: fb ff fa 63 calli 8002364 rtems_set_errno_and_return_minus_one( EACCES ); 80039dc: f8 00 26 d8 calli 800d53c <__errno> 80039e0: 34 02 00 0d mvi r2,13 80039e4: e0 00 00 13 bi 8003a30 /* * Free the loc node and just use the nodes from the mt_entry . */ rtems_filesystem_freenode( &loc ); 80039e8: b9 80 08 00 mv r1,r12 80039ec: fb ff fa 5e calli 8002364 * 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 ) 80039f0: 78 01 08 01 mvhi r1,0x801 80039f4: 38 21 71 a0 ori r1,r1,0x71a0 80039f8: 28 21 00 00 lw r1,(r1+0) 80039fc: 28 21 00 14 lw r1,(r1+20) 8003a00: 44 2b 00 0a be r1,r11,8003a28 /* * Verify there are no file systems below the path specified */ if ( rtems_filesystem_mount_iterate( is_fs_below_mount_point, 8003a04: 29 62 00 2c lw r2,(r11+44) 8003a08: 78 01 08 00 mvhi r1,0x800 8003a0c: 38 21 39 7c ori r1,r1,0x397c 8003a10: fb ff fc ef calli 8002dcc 8003a14: 5c 20 00 05 bne r1,r0,8003a28 * 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 ) 8003a18: b9 60 08 00 mv r1,r11 8003a1c: fb ff fb 6c calli 80027cc 8003a20: 34 02 00 01 mvi r2,1 8003a24: 5c 22 00 05 bne r1,r2,8003a38 rtems_set_errno_and_return_minus_one( EBUSY ); 8003a28: f8 00 26 c5 calli 800d53c <__errno> 8003a2c: 34 02 00 10 mvi r2,16 8003a30: 58 22 00 00 sw (r1+0),r2 8003a34: e0 00 00 24 bi 8003ac4 * 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 ) 8003a38: 29 61 00 14 lw r1,(r11+20) return -1; 8003a3c: 34 0c ff ff mvi r12,-1 * 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 ) 8003a40: 28 22 00 28 lw r2,(r1+40) 8003a44: b9 60 08 00 mv r1,r11 8003a48: d8 40 00 00 call r2 8003a4c: b8 20 68 00 mv r13,r1 8003a50: 5c 20 00 1e bne r1,r0,8003ac8 <== NEVER TAKEN * 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){ 8003a54: 29 61 00 28 lw r1,(r11+40) 8003a58: 28 22 00 2c lw r2,(r1+44) 8003a5c: b9 60 08 00 mv r1,r11 8003a60: d8 40 00 00 call r2 8003a64: 44 2d 00 08 be r1,r13,8003a84 <== ALWAYS TAKEN if (( fs_mount_loc->ops->mount_h )( mt_entry ) != 0 ) 8003a68: 29 61 00 14 lw r1,(r11+20) <== NOT EXECUTED 8003a6c: 28 22 00 20 lw r2,(r1+32) <== NOT EXECUTED 8003a70: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8003a74: d8 40 00 00 call r2 <== NOT EXECUTED 8003a78: 44 20 00 14 be r1,r0,8003ac8 <== NOT EXECUTED rtems_fatal_error_occurred( 0 ); 8003a7c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8003a80: f8 00 02 ca calli 80045a8 <== NOT EXECUTED rtems_status_code rtems_libio_set_private_env(void); rtems_status_code rtems_libio_share_private_env(rtems_id task_id) ; static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 8003a84: 78 0c 08 01 mvhi r12,0x801 8003a88: 39 8c 78 40 ori r12,r12,0x7840 8003a8c: 29 81 00 00 lw r1,(r12+0) 8003a90: 34 02 00 00 mvi r2,0 8003a94: 34 03 00 00 mvi r3,0 8003a98: f8 00 01 96 calli 80040f0 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 8003a9c: b9 60 08 00 mv r1,r11 8003aa0: f8 00 03 c9 calli 80049c4 <_Chain_Extract> } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 8003aa4: 29 81 00 00 lw r1,(r12+0) */ rtems_filesystem_freenode( fs_mount_loc ); free( mt_entry ); return 0; 8003aa8: 34 0c 00 00 mvi r12,0 8003aac: f8 00 01 e1 calli 8004230 /* * 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 ); 8003ab0: 35 61 00 08 addi r1,r11,8 8003ab4: fb ff fa 2c calli 8002364 free( mt_entry ); 8003ab8: b9 60 08 00 mv r1,r11 8003abc: fb ff fa 32 calli 8002384 return 0; 8003ac0: e0 00 00 02 bi 8003ac8 * 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 ) ) return -1; 8003ac4: 34 0c ff ff mvi r12,-1 rtems_filesystem_freenode( fs_mount_loc ); free( mt_entry ); return 0; } 8003ac8: b9 80 08 00 mv r1,r12 8003acc: 2b 9d 00 04 lw ra,(sp+4) 8003ad0: 2b 8b 00 10 lw r11,(sp+16) 8003ad4: 2b 8c 00 0c lw r12,(sp+12) 8003ad8: 2b 8d 00 08 lw r13,(sp+8) 8003adc: 37 9c 00 24 addi sp,sp,36 8003ae0: c3 a0 00 00 ret =============================================================================== 08003a88 : int utime( const char *path, const struct utimbuf *times ) { 8003a88: 37 9c ff d4 addi sp,sp,-44 8003a8c: 5b 8b 00 10 sw (sp+16),r11 8003a90: 5b 8c 00 0c sw (sp+12),r12 8003a94: 5b 8d 00 08 sw (sp+8),r13 8003a98: 5b 9d 00 04 sw (sp+4),ra 8003a9c: b8 20 60 00 mv r12,r1 8003aa0: b8 40 58 00 mv r11,r2 rtems_filesystem_location_info_t temp_loc; int result; struct utimbuf now; if ( rtems_filesystem_evaluate_path( path, strlen( path ), 0x00, &temp_loc, true ) ) 8003aa4: f8 00 2f 98 calli 800f904 8003aa8: b8 20 10 00 mv r2,r1 8003aac: 34 03 00 00 mvi r3,0 8003ab0: b9 80 08 00 mv r1,r12 8003ab4: 37 84 00 14 addi r4,sp,20 8003ab8: 34 05 00 01 mvi r5,1 8003abc: fb ff f8 93 calli 8001d08 return -1; 8003ac0: 34 0c ff ff mvi r12,-1 { rtems_filesystem_location_info_t temp_loc; int result; struct utimbuf now; if ( rtems_filesystem_evaluate_path( path, strlen( path ), 0x00, &temp_loc, true ) ) 8003ac4: 5c 20 00 10 bne r1,r0,8003b04 return -1; if ( times == NULL ) { 8003ac8: 5d 61 00 05 bne r11,r1,8003adc <== ALWAYS TAKEN now.actime = now.modtime = time( NULL ); 8003acc: f8 00 2f f0 calli 800fa8c