=============================================================================== 08006f84 : #define MAXSYMLINK 5 int IMFS_Set_handlers( rtems_filesystem_location_info_t *loc ) { 8006f84: 37 9c ff f0 addi sp,sp,-16 8006f88: 5b 8b 00 10 sw (sp+16),r11 8006f8c: 5b 8c 00 0c sw (sp+12),r12 8006f90: 5b 8d 00 08 sw (sp+8),r13 8006f94: 5b 9d 00 04 sw (sp+4),ra 8006f98: 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; 8006f9c: 28 21 00 10 lw r1,(r1+16) switch( node->type ) { 8006fa0: 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; 8006fa4: 28 2c 00 34 lw r12,(r1+52) switch( node->type ) { 8006fa8: 29 61 00 00 lw r1,(r11+0) 8006fac: 28 21 00 4c lw r1,(r1+76) 8006fb0: 34 21 ff ff addi r1,r1,-1 8006fb4: 54 22 00 14 bgu r1,r2,8007004 <== NEVER TAKEN 8006fb8: 78 0d 08 01 mvhi r13,0x801 8006fbc: 34 02 00 02 mvi r2,2 8006fc0: f8 00 25 b9 calli 80106a4 <__ashlsi3> 8006fc4: 39 ad 1c a0 ori r13,r13,0x1ca0 8006fc8: b5 a1 08 00 add r1,r13,r1 8006fcc: 28 21 00 00 lw r1,(r1+0) 8006fd0: c0 20 00 00 b r1 case IMFS_DIRECTORY: loc->handlers = fs_info->directory_handlers; 8006fd4: 29 81 00 0c lw r1,(r12+12) 8006fd8: e0 00 00 0a bi 8007000 break; case IMFS_DEVICE: loc->handlers = &IMFS_device_handlers; 8006fdc: 78 01 08 01 mvhi r1,0x801 8006fe0: 38 21 1c cc ori r1,r1,0x1ccc 8006fe4: e0 00 00 07 bi 8007000 break; case IMFS_SYM_LINK: case IMFS_HARD_LINK: loc->handlers = &IMFS_link_handlers; 8006fe8: 78 01 08 01 mvhi r1,0x801 8006fec: 38 21 1d 3c ori r1,r1,0x1d3c 8006ff0: e0 00 00 04 bi 8007000 break; case IMFS_LINEAR_FILE: loc->handlers = fs_info->memfile_handlers; break; case IMFS_MEMORY_FILE: loc->handlers = fs_info->memfile_handlers; 8006ff4: 29 81 00 08 lw r1,(r12+8) 8006ff8: e0 00 00 02 bi 8007000 break; case IMFS_FIFO: loc->handlers = fs_info->fifo_handlers; 8006ffc: 29 81 00 10 lw r1,(r12+16) 8007000: 59 61 00 08 sw (r11+8),r1 break; } return 0; } 8007004: 34 01 00 00 mvi r1,0 8007008: 2b 9d 00 04 lw ra,(sp+4) 800700c: 2b 8b 00 10 lw r11,(sp+16) 8007010: 2b 8c 00 0c lw r12,(sp+12) 8007014: 2b 8d 00 08 lw r13,(sp+8) 8007018: 37 9c 00 10 addi sp,sp,16 800701c: c3 a0 00 00 ret =============================================================================== 08006de8 : IMFS_jnode_types_t type, const char *name, mode_t mode, const IMFS_types_union *info ) { 8006de8: 37 9c ff e8 addi sp,sp,-24 8006dec: 5b 8b 00 18 sw (sp+24),r11 8006df0: 5b 8c 00 14 sw (sp+20),r12 8006df4: 5b 8d 00 10 sw (sp+16),r13 8006df8: 5b 8e 00 0c sw (sp+12),r14 8006dfc: 5b 8f 00 08 sw (sp+8),r15 8006e00: 5b 9d 00 04 sw (sp+4),ra /* * MUST have a parent node to call this routine. */ if ( parent_loc == NULL ) return NULL; 8006e04: 34 0b 00 00 mvi r11,0 IMFS_jnode_types_t type, const char *name, mode_t mode, const IMFS_types_union *info ) { 8006e08: b8 40 60 00 mv r12,r2 8006e0c: b8 a0 68 00 mv r13,r5 8006e10: 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 ) 8006e14: 44 20 00 43 be r1,r0,8006f20 <== NEVER TAKEN return NULL; parent = parent_loc->node_access; 8006e18: 28 2f 00 00 lw r15,(r1+0) fs_info = parent_loc->mt_entry->fs_info; 8006e1c: 28 21 00 10 lw r1,(r1+16) 8006e20: 28 2e 00 34 lw r14,(r1+52) /* * Reject creation of FIFOs if support is disabled. */ if ( type == IMFS_FIFO && 8006e24: 34 01 00 07 mvi r1,7 8006e28: 5d 81 00 05 bne r12,r1,8006e3c 8006e2c: 29 c1 00 10 lw r1,(r14+16) 8006e30: 78 05 08 01 mvhi r5,0x801 8006e34: 38 a5 1c 38 ori r5,r5,0x1c38 8006e38: 44 25 00 3a be r1,r5,8006f20 return NULL; /* * Allocate filesystem node and fill in basic information */ node = IMFS_allocate_node( type, name, mode & ~rtems_filesystem_umask ); 8006e3c: 78 05 08 01 mvhi r5,0x801 8006e40: 38 a5 31 1c ori r5,r5,0x311c 8006e44: 28 a1 00 00 lw r1,(r5+0) 8006e48: 28 23 00 2c lw r3,(r1+44) 8006e4c: b9 80 08 00 mv r1,r12 8006e50: a4 60 18 00 not r3,r3 8006e54: a0 83 18 00 and r3,r4,r3 8006e58: fb ff ff bd calli 8006d4c 8006e5c: b8 20 58 00 mv r11,r1 if ( !node ) 8006e60: 44 20 00 30 be r1,r0,8006f20 return NULL; /* * Set the type specific information */ if ( type == IMFS_DIRECTORY ) { 8006e64: 34 01 00 01 mvi r1,1 8006e68: 5d 81 00 07 bne r12,r1,8006e84 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8006e6c: 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); 8006e70: 59 61 00 50 sw (r11+80),r1 rtems_chain_initialize_empty(&node->info.directory.Entries); 8006e74: 35 61 00 50 addi r1,r11,80 the_chain->permanent_null = NULL; 8006e78: 59 60 00 54 sw (r11+84),r0 the_chain->last = _Chain_Head(the_chain); 8006e7c: 59 61 00 58 sw (r11+88),r1 8006e80: e0 00 00 20 bi 8006f00 } else if ( type == IMFS_HARD_LINK ) { 8006e84: 34 01 00 03 mvi r1,3 8006e88: 45 81 00 03 be r12,r1,8006e94 node->info.hard_link.link_node = info->hard_link.link_node; } else if ( type == IMFS_SYM_LINK ) { 8006e8c: 34 01 00 04 mvi r1,4 8006e90: 5d 81 00 04 bne r12,r1,8006ea0 node->info.sym_link.name = info->sym_link.name; 8006e94: 29 a1 00 00 lw r1,(r13+0) 8006e98: 59 61 00 50 sw (r11+80),r1 8006e9c: e0 00 00 19 bi 8006f00 } else if ( type == IMFS_DEVICE ) { 8006ea0: 34 01 00 02 mvi r1,2 8006ea4: 5d 81 00 06 bne r12,r1,8006ebc node->info.device.major = info->device.major; 8006ea8: 29 a1 00 00 lw r1,(r13+0) 8006eac: 59 61 00 50 sw (r11+80),r1 node->info.device.minor = info->device.minor; 8006eb0: 29 a1 00 04 lw r1,(r13+4) 8006eb4: 59 61 00 54 sw (r11+84),r1 8006eb8: e0 00 00 12 bi 8006f00 } else if ( type == IMFS_LINEAR_FILE ) { 8006ebc: 34 01 00 06 mvi r1,6 8006ec0: 5d 81 00 05 bne r12,r1,8006ed4 node->info.linearfile.size = 0; 8006ec4: 59 60 00 50 sw (r11+80),r0 8006ec8: 59 60 00 54 sw (r11+84),r0 node->info.linearfile.direct = 0; 8006ecc: 59 60 00 58 sw (r11+88),r0 8006ed0: e0 00 00 0c bi 8006f00 } else if ( type == IMFS_MEMORY_FILE ) { 8006ed4: 34 01 00 05 mvi r1,5 8006ed8: 5d 81 00 07 bne r12,r1,8006ef4 node->info.file.size = 0; 8006edc: 59 60 00 50 sw (r11+80),r0 8006ee0: 59 60 00 54 sw (r11+84),r0 node->info.file.indirect = 0; 8006ee4: 59 60 00 58 sw (r11+88),r0 node->info.file.doubly_indirect = 0; 8006ee8: 59 60 00 5c sw (r11+92),r0 node->info.file.triply_indirect = 0; 8006eec: 59 60 00 60 sw (r11+96),r0 8006ef0: e0 00 00 04 bi 8006f00 } else if ( type == IMFS_FIFO ) { 8006ef4: 34 01 00 07 mvi r1,7 8006ef8: 5d 81 00 02 bne r12,r1,8006f00 <== NEVER TAKEN node->info.fifo.pipe = NULL; 8006efc: 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; 8006f00: 29 c1 00 04 lw r1,(r14+4) } /* * This node MUST have a parent, so put it in that directory list. */ node->Parent = parent; 8006f04: 59 6f 00 08 sw (r11+8),r15 8006f08: b9 60 10 00 mv r2,r11 node->st_ino = ++fs_info->ino_count; 8006f0c: 34 21 00 01 addi r1,r1,1 8006f10: 59 c1 00 04 sw (r14+4),r1 8006f14: 59 61 00 38 sw (r11+56),r1 8006f18: 35 e1 00 50 addi r1,r15,80 8006f1c: fb ff f1 6b calli 80034c8 <_Chain_Append> rtems_chain_append( &parent->info.directory.Entries, &node->Node ); return node; } 8006f20: b9 60 08 00 mv r1,r11 8006f24: 2b 9d 00 04 lw ra,(sp+4) 8006f28: 2b 8b 00 18 lw r11,(sp+24) 8006f2c: 2b 8c 00 14 lw r12,(sp+20) 8006f30: 2b 8d 00 10 lw r13,(sp+16) 8006f34: 2b 8e 00 0c lw r14,(sp+12) 8006f38: 2b 8f 00 08 lw r15,(sp+8) 8006f3c: 37 9c 00 18 addi sp,sp,24 8006f40: c3 a0 00 00 ret =============================================================================== 080070d8 : const char *pathname, /* IN */ size_t pathnamelen, /* IN */ int flags, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { 80070d8: 37 9c ff 84 addi sp,sp,-124 80070dc: 5b 8b 00 40 sw (sp+64),r11 80070e0: 5b 8c 00 3c sw (sp+60),r12 80070e4: 5b 8d 00 38 sw (sp+56),r13 80070e8: 5b 8e 00 34 sw (sp+52),r14 80070ec: 5b 8f 00 30 sw (sp+48),r15 80070f0: 5b 90 00 2c sw (sp+44),r16 80070f4: 5b 91 00 28 sw (sp+40),r17 80070f8: 5b 92 00 24 sw (sp+36),r18 80070fc: 5b 93 00 20 sw (sp+32),r19 8007100: 5b 94 00 1c sw (sp+28),r20 8007104: 5b 95 00 18 sw (sp+24),r21 8007108: 5b 96 00 14 sw (sp+20),r22 800710c: 5b 97 00 10 sw (sp+16),r23 8007110: 5b 98 00 0c sw (sp+12),r24 8007114: 5b 99 00 08 sw (sp+8),r25 8007118: 5b 9d 00 04 sw (sp+4),ra 800711c: b8 20 90 00 mv r18,r1 char token[ IMFS_NAME_MAX + 1 ]; rtems_filesystem_location_info_t newloc; IMFS_jnode_t *node; int result; if ( !rtems_libio_is_valid_perms( flags ) ) { 8007120: 34 01 ff f8 mvi r1,-8 8007124: a0 61 08 00 and r1,r3,r1 const char *pathname, /* IN */ size_t pathnamelen, /* IN */ int flags, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { 8007128: b8 40 78 00 mv r15,r2 800712c: b8 60 88 00 mv r17,r3 8007130: b8 80 58 00 mv r11,r4 char token[ IMFS_NAME_MAX + 1 ]; rtems_filesystem_location_info_t newloc; IMFS_jnode_t *node; int result; if ( !rtems_libio_is_valid_perms( flags ) ) { 8007134: 44 20 00 04 be r1,r0,8007144 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EIO ); 8007138: f8 00 10 58 calli 800b298 <__errno> <== NOT EXECUTED 800713c: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8007140: e0 00 00 91 bi 8007384 <== NOT EXECUTED case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 8007144: 78 13 08 01 mvhi r19,0x801 /* * This was filled in by the caller and is valid in the * mount table. */ node = pathloc->node_access; 8007148: 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; 800714c: 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; 8007150: 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 ); 8007154: 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 ) 8007158: 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 ) { 800715c: 34 19 00 03 mvi r25,3 * It would be a design error if we evaluated the link and * was broken. */ IMFS_assert( node ); } else if ( node->type == IMFS_SYM_LINK ) { 8007160: 34 14 00 04 mvi r20,4 /* * In contrast to a hard link, it is possible to have a broken * symbolic link. */ node = pathloc->node_access; if ( result == -1 ) 8007164: 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 ) { 8007168: 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 ) 800716c: 3a 73 31 1c ori r19,r19,0x311c /* * Evaluate all tokens until we are done or an error occurs. */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { 8007170: e0 00 00 5a bi 80072d8 type = IMFS_get_token( &pathname[i], pathnamelen, token, &len ); 8007174: b6 50 08 00 add r1,r18,r16 8007178: b9 e0 10 00 mv r2,r15 800717c: ba c0 18 00 mv r3,r22 8007180: 37 84 00 7c addi r4,sp,124 8007184: f8 00 02 11 calli 80079c8 8007188: b8 20 70 00 mv r14,r1 pathnamelen -= len; i += len; if ( !pathloc->node_access ) 800718c: 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; 8007190: 2b 8d 00 7c lw r13,(sp+124) i += len; if ( !pathloc->node_access ) 8007194: 44 20 00 49 be r1,r0,80072b8 <== 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 ) 8007198: 45 c0 00 07 be r14,r0,80071b4 if ( node->type == IMFS_DIRECTORY ) 800719c: 29 81 00 4c lw r1,(r12+76) 80071a0: 5c 35 00 05 bne r1,r21,80071b4 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 80071a4: b9 60 08 00 mv r1,r11 80071a8: 34 02 00 01 mvi r2,1 80071ac: fb ff ff 9d calli 8007020 80071b0: 44 20 00 73 be r1,r0,800737c */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { type = IMFS_get_token( &pathname[i], pathnamelen, token, &len ); pathnamelen -= len; 80071b4: c9 ed 78 00 sub r15,r15,r13 i += len; 80071b8: 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; 80071bc: 29 6c 00 00 lw r12,(r11+0) switch( type ) { 80071c0: 45 d9 00 14 be r14,r25,8007210 80071c4: 45 d4 00 42 be r14,r20,80072cc 80071c8: 5d d7 00 44 bne r14,r23,80072d8 case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 80071cc: 2a 61 00 00 lw r1,(r19+0) 80071d0: 28 21 00 18 lw r1,(r1+24) 80071d4: 45 81 00 41 be r12,r1,80072d8 /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access) { 80071d8: 29 64 00 10 lw r4,(r11+16) /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == 80071dc: 28 81 00 1c lw r1,(r4+28) 80071e0: 5d 81 00 07 bne r12,r1,80071fc */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; /* Throw out the .. in this case */ } else { newloc = pathloc->mt_entry->mt_point_node; 80071e4: 28 85 00 08 lw r5,(r4+8) 80071e8: 28 82 00 0c lw r2,(r4+12) 80071ec: 28 81 00 10 lw r1,(r4+16) 80071f0: 28 83 00 14 lw r3,(r4+20) 80071f4: 28 84 00 18 lw r4,(r4+24) 80071f8: e0 00 00 46 bi 8007310 pathnamelen+len, flags,pathloc); } } else { if ( !node->Parent ) 80071fc: 29 8c 00 08 lw r12,(r12+8) 8007200: 5d 80 00 31 bne r12,r0,80072c4 rtems_set_errno_and_return_minus_one( ENOENT ); 8007204: f8 00 10 25 calli 800b298 <__errno> 8007208: 58 2e 00 00 sw (r1+0),r14 800720c: e0 00 00 5f bi 8007388 case IMFS_NAME: /* * If we are at a link follow it. */ if ( node->type == IMFS_HARD_LINK ) { 8007210: 29 81 00 4c lw r1,(r12+76) 8007214: 5c 2e 00 06 bne r1,r14,800722c IMFS_evaluate_hard_link( pathloc, 0 ); 8007218: b9 60 08 00 mv r1,r11 800721c: 34 02 00 00 mvi r2,0 8007220: fb ff ff 97 calli 800707c node = pathloc->node_access; 8007224: 29 6c 00 00 lw r12,(r11+0) 8007228: e0 00 00 08 bi 8007248 * It would be a design error if we evaluated the link and * was broken. */ IMFS_assert( node ); } else if ( node->type == IMFS_SYM_LINK ) { 800722c: 5c 34 00 07 bne r1,r20,8007248 result = IMFS_evaluate_sym_link( pathloc, 0 ); 8007230: b9 60 08 00 mv r1,r11 8007234: 34 02 00 00 mvi r2,0 8007238: f8 00 00 68 calli 80073d8 800723c: b8 20 68 00 mv r13,r1 /* * In contrast to a hard link, it is possible to have a broken * symbolic link. */ node = pathloc->node_access; 8007240: 29 6c 00 00 lw r12,(r11+0) if ( result == -1 ) 8007244: 44 38 00 52 be r1,r24,800738c <== NEVER TAKEN } /* * Only a directory can be decended into. */ if ( node->type != IMFS_DIRECTORY ) 8007248: 29 81 00 4c lw r1,(r12+76) 800724c: 44 35 00 04 be r1,r21,800725c rtems_set_errno_and_return_minus_one( ENOTDIR ); 8007250: f8 00 10 12 calli 800b298 <__errno> 8007254: 34 02 00 14 mvi r2,20 8007258: e0 00 00 4b bi 8007384 /* * 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 ) { 800725c: 29 8d 00 5c lw r13,(r12+92) 8007260: 45 a0 00 11 be r13,r0,80072a4 newloc = node->info.directory.mt_fs->mt_fs_root; 8007264: 29 a4 00 1c lw r4,(r13+28) 8007268: 29 a2 00 20 lw r2,(r13+32) 800726c: 29 a1 00 24 lw r1,(r13+36) 8007270: 29 a3 00 28 lw r3,(r13+40) 8007274: 29 a5 00 2c lw r5,(r13+44) 8007278: 5b 84 00 68 sw (sp+104),r4 800727c: 5b 82 00 6c sw (sp+108),r2 8007280: 5b 81 00 70 sw (sp+112),r1 8007284: 5b 83 00 74 sw (sp+116),r3 8007288: 5b 85 00 78 sw (sp+120),r5 *pathloc = newloc; 800728c: 59 64 00 00 sw (r11+0),r4 8007290: 59 62 00 04 sw (r11+4),r2 8007294: 59 61 00 08 sw (r11+8),r1 8007298: 59 63 00 0c sw (r11+12),r3 800729c: 59 65 00 10 sw (r11+16),r5 80072a0: e0 00 00 26 bi 8007338 } /* * Otherwise find the token name in the present location. */ node = IMFS_find_match_in_dir( node, token ); 80072a4: b9 80 08 00 mv r1,r12 80072a8: ba c0 10 00 mv r2,r22 80072ac: f8 00 01 a1 calli 8007930 80072b0: b8 20 60 00 mv r12,r1 if ( !node ) 80072b4: 5c 2d 00 04 bne r1,r13,80072c4 rtems_set_errno_and_return_minus_one( ENOENT ); 80072b8: f8 00 0f f8 calli 800b298 <__errno> 80072bc: 34 02 00 02 mvi r2,2 80072c0: e0 00 00 31 bi 8007384 /* * Set the node access to the point we have found. */ pathloc->node_access = node; 80072c4: 59 6c 00 00 sw (r11+0),r12 80072c8: e0 00 00 04 bi 80072d8 case IMFS_NO_MORE_PATH: case IMFS_CURRENT_DIR: break; case IMFS_INVALID_TOKEN: rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); 80072cc: f8 00 0f f3 calli 800b298 <__errno> 80072d0: 34 02 00 5b mvi r2,91 80072d4: e0 00 00 2c bi 8007384 /* * Evaluate all tokens until we are done or an error occurs. */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { 80072d8: 7d c1 00 04 cmpnei r1,r14,4 80072dc: 7d ce 00 00 cmpnei r14,r14,0 80072e0: a0 2e 70 00 and r14,r1,r14 80072e4: 5d c0 ff a4 bne r14,r0,8007174 * 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 ) { 80072e8: 29 82 00 4c lw r2,(r12+76) 80072ec: 34 01 00 01 mvi r1,1 80072f0: 5c 41 00 1c bne r2,r1,8007360 if ( node->info.directory.mt_fs != NULL ) { 80072f4: 29 84 00 5c lw r4,(r12+92) 80072f8: 44 80 00 1a be r4,r0,8007360 newloc = node->info.directory.mt_fs->mt_fs_root; 80072fc: 28 85 00 1c lw r5,(r4+28) 8007300: 28 82 00 20 lw r2,(r4+32) 8007304: 28 81 00 24 lw r1,(r4+36) 8007308: 28 83 00 28 lw r3,(r4+40) 800730c: 28 84 00 2c lw r4,(r4+44) 8007310: 5b 85 00 68 sw (sp+104),r5 8007314: 5b 82 00 6c sw (sp+108),r2 8007318: 5b 81 00 70 sw (sp+112),r1 800731c: 5b 83 00 74 sw (sp+116),r3 8007320: 5b 84 00 78 sw (sp+120),r4 *pathloc = newloc; 8007324: 59 65 00 00 sw (r11+0),r5 8007328: 59 62 00 04 sw (r11+4),r2 800732c: 59 61 00 08 sw (r11+8),r1 8007330: 59 63 00 0c sw (r11+12),r3 8007334: 59 64 00 10 sw (r11+16),r4 return (*pathloc->ops->evalpath_h)( &pathname[i-len], 8007338: 2b 82 00 7c lw r2,(sp+124) 800733c: 28 65 00 00 lw r5,(r3+0) 8007340: b9 60 20 00 mv r4,r11 8007344: ca 02 08 00 sub r1,r16,r2 8007348: b6 41 08 00 add r1,r18,r1 800734c: b5 e2 10 00 add r2,r15,r2 8007350: ba 20 18 00 mv r3,r17 8007354: d8 a0 00 00 call r5 8007358: b8 20 68 00 mv r13,r1 800735c: e0 00 00 0c bi 800738c flags, pathloc ); } else { result = IMFS_Set_handlers( pathloc ); } } else { result = IMFS_Set_handlers( pathloc ); 8007360: b9 60 08 00 mv r1,r11 8007364: fb ff ff 08 calli 8006f84 8007368: b8 20 68 00 mv r13,r1 /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( pathloc, flags ) ) 800736c: ba 20 10 00 mv r2,r17 8007370: b9 60 08 00 mv r1,r11 8007374: fb ff ff 2b calli 8007020 8007378: 5c 20 00 05 bne r1,r0,800738c rtems_set_errno_and_return_minus_one( EACCES ); 800737c: f8 00 0f c7 calli 800b298 <__errno> 8007380: 34 02 00 0d mvi r2,13 8007384: 58 22 00 00 sw (r1+0),r2 8007388: 34 0d ff ff mvi r13,-1 return result; } 800738c: b9 a0 08 00 mv r1,r13 8007390: 2b 9d 00 04 lw ra,(sp+4) 8007394: 2b 8b 00 40 lw r11,(sp+64) 8007398: 2b 8c 00 3c lw r12,(sp+60) 800739c: 2b 8d 00 38 lw r13,(sp+56) 80073a0: 2b 8e 00 34 lw r14,(sp+52) 80073a4: 2b 8f 00 30 lw r15,(sp+48) 80073a8: 2b 90 00 2c lw r16,(sp+44) 80073ac: 2b 91 00 28 lw r17,(sp+40) 80073b0: 2b 92 00 24 lw r18,(sp+36) 80073b4: 2b 93 00 20 lw r19,(sp+32) 80073b8: 2b 94 00 1c lw r20,(sp+28) 80073bc: 2b 95 00 18 lw r21,(sp+24) 80073c0: 2b 96 00 14 lw r22,(sp+20) 80073c4: 2b 97 00 10 lw r23,(sp+16) 80073c8: 2b 98 00 0c lw r24,(sp+12) 80073cc: 2b 99 00 08 lw r25,(sp+8) 80073d0: 37 9c 00 7c addi sp,sp,124 80073d4: c3 a0 00 00 ret =============================================================================== 08007574 : int IMFS_evaluate_for_make( const char *path, /* IN */ rtems_filesystem_location_info_t *pathloc, /* IN/OUT */ const char **name /* OUT */ ) { 8007574: 37 9c ff 84 addi sp,sp,-124 8007578: 5b 8b 00 40 sw (sp+64),r11 800757c: 5b 8c 00 3c sw (sp+60),r12 8007580: 5b 8d 00 38 sw (sp+56),r13 8007584: 5b 8e 00 34 sw (sp+52),r14 8007588: 5b 8f 00 30 sw (sp+48),r15 800758c: 5b 90 00 2c sw (sp+44),r16 8007590: 5b 91 00 28 sw (sp+40),r17 8007594: 5b 92 00 24 sw (sp+36),r18 8007598: 5b 93 00 20 sw (sp+32),r19 800759c: 5b 94 00 1c sw (sp+28),r20 80075a0: 5b 95 00 18 sw (sp+24),r21 80075a4: 5b 96 00 14 sw (sp+20),r22 80075a8: 5b 97 00 10 sw (sp+16),r23 80075ac: 5b 98 00 0c sw (sp+12),r24 80075b0: 5b 99 00 08 sw (sp+8),r25 80075b4: 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 ) 80075b8: 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 */ ) { 80075bc: b8 20 78 00 mv r15,r1 80075c0: b8 40 58 00 mv r11,r2 80075c4: 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; 80075c8: 28 4c 00 00 lw r12,(r2+0) /* * Get the path length. */ pathlen = strlen( path ); 80075cc: f8 00 13 d4 calli 800c51c 80075d0: 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; 80075d4: 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 ); 80075d8: 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 ) 80075dc: 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 ) { 80075e0: 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 ) 80075e4: 3a 10 31 1c ori r16,r16,0x311c if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; switch( type ) { 80075e8: 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 ) { 80075ec: 34 14 00 04 mvi r20,4 result = IMFS_evaluate_link( pathloc, 0 ); if ( result == -1 ) 80075f0: 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 ); 80075f4: ba 40 10 00 mv r2,r18 80075f8: b5 ee 08 00 add r1,r15,r14 80075fc: bb 00 18 00 mv r3,r24 8007600: 37 84 00 7c addi r4,sp,124 8007604: f8 00 00 f1 calli 80079c8 8007608: b8 20 68 00 mv r13,r1 pathlen -= len; 800760c: 2b 99 00 7c lw r25,(sp+124) i += len; if ( !pathloc->node_access ) 8007610: 29 61 00 00 lw r1,(r11+0) */ while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); pathlen -= len; 8007614: ca 59 90 00 sub r18,r18,r25 i += len; if ( !pathloc->node_access ) 8007618: 44 20 00 68 be r1,r0,80077b8 <== NEVER TAKEN /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) 800761c: 45 a0 00 07 be r13,r0,8007638 if ( node->type == IMFS_DIRECTORY ) 8007620: 29 81 00 4c lw r1,(r12+76) 8007624: 5c 37 00 05 bne r1,r23,8007638 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 8007628: b9 60 08 00 mv r1,r11 800762c: 34 02 00 01 mvi r2,1 8007630: fb ff fe 7c calli 8007020 8007634: 44 20 00 74 be r1,r0,8007804 while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); pathlen -= len; i += len; 8007638: 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; 800763c: 29 6c 00 00 lw r12,(r11+0) switch( type ) { 8007640: 45 b6 00 07 be r13,r22,800765c 8007644: 55 b6 00 03 bgu r13,r22,8007650 8007648: 5d a0 ff eb bne r13,r0,80075f4 800764c: e0 00 00 4c bi 800777c 8007650: 45 b5 00 1e be r13,r21,80076c8 8007654: 5d b4 ff e8 bne r13,r20,80075f4 <== NEVER TAKEN 8007658: e0 00 00 4c bi 8007788 case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 800765c: 2a 01 00 00 lw r1,(r16+0) 8007660: 28 21 00 18 lw r1,(r1+24) 8007664: 45 81 ff e4 be r12,r1,80075f4 /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access){ 8007668: 29 64 00 10 lw r4,(r11+16) 800766c: 28 81 00 1c lw r1,(r4+28) 8007670: 5d 81 00 11 bne r12,r1,80076b4 if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; } else { newloc = pathloc->mt_entry->mt_point_node; 8007674: 28 85 00 08 lw r5,(r4+8) 8007678: 28 83 00 0c lw r3,(r4+12) 800767c: 28 81 00 10 lw r1,(r4+16) 8007680: 28 82 00 14 lw r2,(r4+20) 8007684: 28 84 00 18 lw r4,(r4+24) 8007688: 5b 85 00 68 sw (sp+104),r5 800768c: 5b 83 00 6c sw (sp+108),r3 8007690: 5b 81 00 70 sw (sp+112),r1 8007694: 5b 82 00 74 sw (sp+116),r2 8007698: 5b 84 00 78 sw (sp+120),r4 *pathloc = newloc; 800769c: 59 65 00 00 sw (r11+0),r5 80076a0: 59 63 00 04 sw (r11+4),r3 80076a4: 59 61 00 08 sw (r11+8),r1 80076a8: 59 62 00 0c sw (r11+12),r2 80076ac: 59 64 00 10 sw (r11+16),r4 80076b0: e0 00 00 23 bi 800773c return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); } } else { if ( !node->Parent ) 80076b4: 29 8c 00 08 lw r12,(r12+8) 80076b8: 5d 80 00 2f bne r12,r0,8007774 rtems_set_errno_and_return_minus_one( ENOENT ); 80076bc: f8 00 0e f7 calli 800b298 <__errno> 80076c0: 58 2d 00 00 sw (r1+0),r13 80076c4: e0 00 00 53 bi 8007810 pathloc->node_access = node; break; case IMFS_NAME: if ( node->type == IMFS_HARD_LINK ) { 80076c8: 29 81 00 4c lw r1,(r12+76) 80076cc: 44 35 00 02 be r1,r21,80076d4 result = IMFS_evaluate_link( pathloc, 0 ); if ( result == -1 ) return -1; } else if ( node->type == IMFS_SYM_LINK ) { 80076d0: 5c 34 00 06 bne r1,r20,80076e8 result = IMFS_evaluate_link( pathloc, 0 ); 80076d4: b9 60 08 00 mv r1,r11 80076d8: 34 02 00 00 mvi r2,0 80076dc: fb ff ff 69 calli 8007480 80076e0: b8 20 60 00 mv r12,r1 if ( result == -1 ) 80076e4: 44 33 00 4c be r1,r19,8007814 <== NEVER TAKEN return -1; } node = pathloc->node_access; 80076e8: 29 64 00 00 lw r4,(r11+0) if ( !node ) 80076ec: 44 80 00 3f be r4,r0,80077e8 <== NEVER TAKEN /* * Only a directory can be decended into. */ if ( node->type != IMFS_DIRECTORY ) 80076f0: 28 81 00 4c lw r1,(r4+76) 80076f4: 5c 37 00 3d bne r1,r23,80077e8 /* * 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 ) { 80076f8: 28 8d 00 5c lw r13,(r4+92) 80076fc: 45 a0 00 19 be r13,r0,8007760 newloc = node->info.directory.mt_fs->mt_fs_root; 8007700: 29 a4 00 1c lw r4,(r13+28) 8007704: 29 a3 00 20 lw r3,(r13+32) 8007708: 29 a1 00 24 lw r1,(r13+36) 800770c: 29 a2 00 28 lw r2,(r13+40) 8007710: 29 a5 00 2c lw r5,(r13+44) 8007714: 5b 84 00 68 sw (sp+104),r4 8007718: 5b 83 00 6c sw (sp+108),r3 800771c: 5b 81 00 70 sw (sp+112),r1 8007720: 5b 82 00 74 sw (sp+116),r2 8007724: 5b 85 00 78 sw (sp+120),r5 *pathloc = newloc; 8007728: 59 64 00 00 sw (r11+0),r4 800772c: 59 63 00 04 sw (r11+4),r3 8007730: 59 61 00 08 sw (r11+8),r1 8007734: 59 62 00 0c sw (r11+12),r2 8007738: 59 65 00 10 sw (r11+16),r5 return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); 800773c: 2b 81 00 7c lw r1,(sp+124) 8007740: 28 44 00 04 lw r4,(r2+4) 8007744: ba 20 18 00 mv r3,r17 8007748: c9 c1 70 00 sub r14,r14,r1 800774c: b5 ee 08 00 add r1,r15,r14 8007750: b9 60 10 00 mv r2,r11 8007754: d8 80 00 00 call r4 8007758: b8 20 60 00 mv r12,r1 800775c: e0 00 00 2e bi 8007814 /* * Otherwise find the token name in the present location. */ node = IMFS_find_match_in_dir( node, token ); 8007760: b8 80 08 00 mv r1,r4 8007764: bb 00 10 00 mv r2,r24 8007768: f8 00 00 72 calli 8007930 800776c: 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 ) 8007770: 44 2d 00 09 be r1,r13,8007794 done = true; else pathloc->node_access = node; 8007774: 59 6c 00 00 sw (r11+0),r12 8007778: e3 ff ff 9f bi 80075f4 break; case IMFS_NO_MORE_PATH: rtems_set_errno_and_return_minus_one( EEXIST ); 800777c: f8 00 0e c7 calli 800b298 <__errno> 8007780: 34 02 00 11 mvi r2,17 8007784: e0 00 00 22 bi 800780c break; case IMFS_INVALID_TOKEN: rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); 8007788: f8 00 0e c4 calli 800b298 <__errno> 800778c: 34 02 00 5b mvi r2,91 8007790: e0 00 00 1f bi 800780c case IMFS_CURRENT_DIR: break; } } *name = &path[ i - len ]; 8007794: 2b 81 00 7c lw r1,(sp+124) 8007798: c9 c1 08 00 sub r1,r14,r1 800779c: b5 e1 08 00 add r1,r15,r1 80077a0: 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( 80077a4: 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++) { 80077a8: e0 00 00 07 bi 80077c4 if ( !IMFS_is_separator( path[ i ] ) ) 80077ac: fb ff ea f9 calli 8002390 80077b0: 35 ce 00 01 addi r14,r14,1 80077b4: 5c 20 00 04 bne r1,r0,80077c4 rtems_set_errno_and_return_minus_one( ENOENT ); 80077b8: f8 00 0e b8 calli 800b298 <__errno> 80077bc: 34 02 00 02 mvi r2,2 80077c0: e0 00 00 13 bi 800780c /* * 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++) { 80077c4: 41 c1 00 00 lbu r1,(r14+0) 80077c8: 5c 20 ff f9 bne r1,r0,80077ac /* * Verify we can execute and write to this directory. */ result = IMFS_Set_handlers( pathloc ); 80077cc: b9 60 08 00 mv r1,r11 80077d0: fb ff fd ed calli 8006f84 80077d4: b8 20 60 00 mv r12,r1 /* * The returned node must be a directory */ node = pathloc->node_access; if ( node->type != IMFS_DIRECTORY ) 80077d8: 29 61 00 00 lw r1,(r11+0) 80077dc: 28 22 00 4c lw r2,(r1+76) 80077e0: 34 01 00 01 mvi r1,1 80077e4: 44 41 00 04 be r2,r1,80077f4 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOTDIR ); 80077e8: f8 00 0e ac calli 800b298 <__errno> 80077ec: 34 02 00 14 mvi r2,20 80077f0: e0 00 00 07 bi 800780c /* * We must have Write and execute permission on the returned node. */ if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) ) 80077f4: b9 60 08 00 mv r1,r11 80077f8: 34 02 00 03 mvi r2,3 80077fc: fb ff fe 09 calli 8007020 8007800: 5c 20 00 05 bne r1,r0,8007814 rtems_set_errno_and_return_minus_one( EACCES ); 8007804: f8 00 0e a5 calli 800b298 <__errno> 8007808: 34 02 00 0d mvi r2,13 800780c: 58 22 00 00 sw (r1+0),r2 8007810: 34 0c ff ff mvi r12,-1 return result; } 8007814: b9 80 08 00 mv r1,r12 8007818: 2b 9d 00 04 lw ra,(sp+4) 800781c: 2b 8b 00 40 lw r11,(sp+64) 8007820: 2b 8c 00 3c lw r12,(sp+60) 8007824: 2b 8d 00 38 lw r13,(sp+56) 8007828: 2b 8e 00 34 lw r14,(sp+52) 800782c: 2b 8f 00 30 lw r15,(sp+48) 8007830: 2b 90 00 2c lw r16,(sp+44) 8007834: 2b 91 00 28 lw r17,(sp+40) 8007838: 2b 92 00 24 lw r18,(sp+36) 800783c: 2b 93 00 20 lw r19,(sp+32) 8007840: 2b 94 00 1c lw r20,(sp+28) 8007844: 2b 95 00 18 lw r21,(sp+24) 8007848: 2b 96 00 14 lw r22,(sp+20) 800784c: 2b 97 00 10 lw r23,(sp+16) 8007850: 2b 98 00 0c lw r24,(sp+12) 8007854: 2b 99 00 08 lw r25,(sp+8) 8007858: 37 9c 00 7c addi sp,sp,124 800785c: c3 a0 00 00 ret =============================================================================== 08007020 : */ int IMFS_evaluate_permission( rtems_filesystem_location_info_t *node, int flags ) { 8007020: 37 9c ff f8 addi sp,sp,-8 8007024: 5b 8b 00 08 sw (sp+8),r11 8007028: 5b 9d 00 04 sw (sp+4),ra 800702c: b8 20 58 00 mv r11,r1 uid_t st_uid; gid_t st_gid; IMFS_jnode_t *jnode; int flags_to_test; if ( !rtems_libio_is_valid_perms( flags ) ) 8007030: 34 01 ff f8 mvi r1,-8 8007034: a0 41 08 00 and r1,r2,r1 8007038: 44 20 00 06 be r1,r0,8007050 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EPERM ); 800703c: f8 00 10 97 calli 800b298 <__errno> <== NOT EXECUTED 8007040: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8007044: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8007048: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800704c: e0 00 00 08 bi 800706c <== NOT EXECUTED */ flags_to_test = flags; if ( st_uid == jnode->st_uid ) flags_to_test <<= 6; 8007050: b8 40 08 00 mv r1,r2 8007054: 34 02 00 06 mvi r2,6 8007058: f8 00 25 93 calli 80106a4 <__ashlsi3> /* * If all of the flags are set we have permission * to do this. */ if ( ( flags_to_test & jnode->st_mode) == flags_to_test ) 800705c: 29 62 00 00 lw r2,(r11+0) 8007060: 28 42 00 30 lw r2,(r2+48) 8007064: a0 22 10 00 and r2,r1,r2 gid_t st_gid; IMFS_jnode_t *jnode; int flags_to_test; if ( !rtems_libio_is_valid_perms( flags ) ) rtems_set_errno_and_return_minus_one( EPERM ); 8007068: e4 41 08 00 cmpe r1,r2,r1 */ if ( ( flags_to_test & jnode->st_mode) == flags_to_test ) return 1; return 0; } 800706c: 2b 9d 00 04 lw ra,(sp+4) 8007070: 2b 8b 00 08 lw r11,(sp+8) 8007074: 37 9c 00 08 addi sp,sp,8 8007078: c3 a0 00 00 ret =============================================================================== 08001f04 : rtems_off64_t IMFS_fifo_lseek( rtems_libio_t *iop, rtems_off64_t offset, int whence ) { 8001f04: 37 9c ff f8 addi sp,sp,-8 8001f08: 5b 8b 00 08 sw (sp+8),r11 8001f0c: 5b 9d 00 04 sw (sp+4),ra 8001f10: b8 20 28 00 mv r5,r1 off_t err = pipe_lseek(LIBIO2PIPE(iop), offset, whence, iop); 8001f14: 28 21 00 1c lw r1,(r1+28) 8001f18: b8 60 10 00 mv r2,r3 8001f1c: b8 80 18 00 mv r3,r4 8001f20: 28 21 00 50 lw r1,(r1+80) 8001f24: b8 a0 20 00 mv r4,r5 8001f28: f8 00 22 13 calli 800a774 8001f2c: b8 20 58 00 mv r11,r1 IMFS_FIFO_RETURN(err); 8001f30: 4c 20 00 07 bge r1,r0,8001f4c <== NEVER TAKEN 8001f34: f8 00 2c a3 calli 800d1c0 <__errno> 8001f38: c8 0b 58 00 sub r11,r0,r11 8001f3c: 58 2b 00 00 sw (r1+0),r11 8001f40: 34 01 ff ff mvi r1,-1 8001f44: 34 0b ff ff mvi r11,-1 8001f48: e0 00 00 03 bi 8001f54 8001f4c: 34 02 00 1f mvi r2,31 <== NOT EXECUTED 8001f50: f8 00 6f e7 calli 801deec <__ashrsi3> <== NOT EXECUTED } 8001f54: b9 60 10 00 mv r2,r11 8001f58: 2b 9d 00 04 lw ra,(sp+4) 8001f5c: 2b 8b 00 08 lw r11,(sp+8) 8001f60: 37 9c 00 08 addi sp,sp,8 8001f64: c3 a0 00 00 ret =============================================================================== 08001ff4 : ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 8001ff4: 37 9c ff ec addi sp,sp,-20 8001ff8: 5b 8b 00 0c sw (sp+12),r11 8001ffc: 5b 8c 00 08 sw (sp+8),r12 8002000: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *jnode = iop->pathinfo.node_access; 8002004: 28 2c 00 1c lw r12,(r1+28) ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 8002008: b8 20 20 00 mv r4,r1 IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); 800200c: 29 81 00 50 lw r1,(r12+80) 8002010: f8 00 21 41 calli 800a514 8002014: b8 20 58 00 mv r11,r1 if (err > 0) { 8002018: 4c 01 00 08 bge r0,r1,8002038 IMFS_mtime_ctime_update(jnode); 800201c: 37 81 00 10 addi r1,sp,16 8002020: 34 02 00 00 mvi r2,0 8002024: f8 00 04 d4 calli 8003374 8002028: 2b 81 00 10 lw r1,(sp+16) 800202c: 59 81 00 44 sw (r12+68),r1 8002030: 59 81 00 48 sw (r12+72),r1 8002034: e0 00 00 06 bi 800204c } IMFS_FIFO_RETURN(err); 8002038: 44 20 00 05 be r1,r0,800204c <== NEVER TAKEN 800203c: c8 0b 58 00 sub r11,r0,r11 8002040: f8 00 2c 60 calli 800d1c0 <__errno> 8002044: 58 2b 00 00 sw (r1+0),r11 8002048: 34 0b ff ff mvi r11,-1 } 800204c: b9 60 08 00 mv r1,r11 8002050: 2b 9d 00 04 lw ra,(sp+4) 8002054: 2b 8b 00 0c lw r11,(sp+12) 8002058: 2b 8c 00 08 lw r12,(sp+8) 800205c: 37 9c 00 14 addi sp,sp,20 8002060: c3 a0 00 00 ret =============================================================================== 08007930 : IMFS_jnode_t *IMFS_find_match_in_dir( IMFS_jnode_t *directory, char *name ) { 8007930: 37 9c ff f0 addi sp,sp,-16 8007934: 5b 8b 00 10 sw (sp+16),r11 8007938: 5b 8c 00 0c sw (sp+12),r12 800793c: 5b 8d 00 08 sw (sp+8),r13 8007940: 5b 9d 00 04 sw (sp+4),ra 8007944: b8 20 58 00 mv r11,r1 8007948: b8 40 68 00 mv r13,r2 /* * Check for "." and ".." */ if ( !strcmp( name, dotname ) ) 800794c: b8 40 08 00 mv r1,r2 8007950: 78 02 08 01 mvhi r2,0x801 8007954: 38 42 1c bc ori r2,r2,0x1cbc 8007958: f8 00 12 7a calli 800c340 800795c: 44 20 00 14 be r1,r0,80079ac <== NEVER TAKEN return directory; if ( !strcmp( name, dotdotname ) ) 8007960: 78 02 08 01 mvhi r2,0x801 8007964: b9 a0 08 00 mv r1,r13 8007968: 38 42 1c c0 ori r2,r2,0x1cc0 800796c: f8 00 12 75 calli 800c340 8007970: 5c 20 00 03 bne r1,r0,800797c <== ALWAYS TAKEN return directory->Parent; 8007974: 29 6b 00 08 lw r11,(r11+8) <== NOT EXECUTED 8007978: e0 00 00 0d bi 80079ac <== NOT EXECUTED the_chain = &directory->info.directory.Entries; for ( the_node = the_chain->first; 800797c: 29 6c 00 50 lw r12,(r11+80) 8007980: 35 6b 00 54 addi r11,r11,84 8007984: e0 00 00 06 bi 800799c !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 ) ) 8007988: b9 a0 08 00 mv r1,r13 800798c: 35 82 00 0c addi r2,r12,12 8007990: f8 00 12 6c calli 800c340 8007994: 44 20 00 05 be r1,r0,80079a8 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 ) { 8007998: 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; 800799c: 5d 8b ff fb bne r12,r11,8007988 if ( !strcmp( name, the_jnode->name ) ) return the_jnode; } return 0; 80079a0: 34 0b 00 00 mvi r11,0 80079a4: e0 00 00 02 bi 80079ac 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; 80079a8: b9 80 58 00 mv r11,r12 if ( !strcmp( name, the_jnode->name ) ) return the_jnode; } return 0; } 80079ac: b9 60 08 00 mv r1,r11 80079b0: 2b 9d 00 04 lw ra,(sp+4) 80079b4: 2b 8b 00 10 lw r11,(sp+16) 80079b8: 2b 8c 00 0c lw r12,(sp+12) 80079bc: 2b 8d 00 08 lw r13,(sp+8) 80079c0: 37 9c 00 10 addi sp,sp,16 80079c4: c3 a0 00 00 ret =============================================================================== 08007860 : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) int IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 8007860: 37 9c ff d8 addi sp,sp,-40 8007864: 5b 8b 00 14 sw (sp+20),r11 8007868: 5b 8c 00 10 sw (sp+16),r12 800786c: 5b 8d 00 0c sw (sp+12),r13 8007870: 5b 8e 00 08 sw (sp+8),r14 8007874: 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; 8007878: 28 2b 00 1c lw r11,(r1+28) loc = temp_mt_entry->mt_fs_root; 800787c: 28 25 00 20 lw r5,(r1+32) 8007880: 28 24 00 24 lw r4,(r1+36) 8007884: 28 23 00 28 lw r3,(r1+40) 8007888: 28 22 00 2c lw r2,(r1+44) 800788c: 5b 8b 00 18 sw (sp+24),r11 8007890: 5b 85 00 1c sw (sp+28),r5 8007894: 5b 84 00 20 sw (sp+32),r4 8007898: 5b 83 00 24 sw (sp+36),r3 800789c: 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; 80078a0: 58 20 00 1c sw (r1+28),r0 do { next = jnode->Parent; loc.node_access = (void *)jnode; IMFS_Set_handlers( &loc ); 80078a4: 37 8c 00 18 addi r12,sp,24 if ( jnode->type != IMFS_DIRECTORY ) { 80078a8: 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 ); 80078ac: b9 80 08 00 mv r1,r12 */ temp_mt_entry->mt_fs_root.node_access = NULL; do { next = jnode->Parent; 80078b0: 29 6e 00 08 lw r14,(r11+8) loc.node_access = (void *)jnode; 80078b4: 5b 8b 00 18 sw (sp+24),r11 IMFS_Set_handlers( &loc ); 80078b8: fb ff fd b3 calli 8006f84 if ( jnode->type != IMFS_DIRECTORY ) { 80078bc: 29 61 00 4c lw r1,(r11+76) 80078c0: 5c 2d 00 04 bne r1,r13,80078d0 result = IMFS_unlink( NULL, &loc ); if (result != 0) return -1; jnode = next; } else if ( jnode_has_no_children( jnode ) ) { 80078c4: 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; 80078c8: 35 61 00 54 addi r1,r11,84 80078cc: 5c 41 00 06 bne r2,r1,80078e4 result = IMFS_unlink( NULL, &loc ); 80078d0: 34 01 00 00 mvi r1,0 80078d4: b9 80 10 00 mv r2,r12 80078d8: fb ff e5 0b calli 8000d04 if (result != 0) 80078dc: 5c 20 00 0b bne r1,r0,8007908 <== NEVER TAKEN return -1; jnode = next; 80078e0: b9 c0 58 00 mv r11,r14 } if ( jnode != NULL ) { 80078e4: 45 60 00 0b be r11,r0,8007910 if ( jnode->type == IMFS_DIRECTORY ) { 80078e8: 29 61 00 4c lw r1,(r11+76) 80078ec: 5c 2d ff f0 bne r1,r13,80078ac <== NEVER TAKEN if ( jnode_has_children( jnode ) ) 80078f0: 29 61 00 50 lw r1,(r11+80) 80078f4: 35 62 00 54 addi r2,r11,84 80078f8: 44 22 ff ed be r1,r2,80078ac jnode = jnode_get_first_child( jnode ); 80078fc: b8 20 58 00 mv r11,r1 } } } while (jnode != NULL); 8007900: 5c 20 ff eb bne r1,r0,80078ac <== ALWAYS TAKEN 8007904: e0 00 00 03 bi 8007910 <== NOT EXECUTED return -1; jnode = next; } else if ( jnode_has_no_children( jnode ) ) { result = IMFS_unlink( NULL, &loc ); if (result != 0) return -1; 8007908: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800790c: e0 00 00 02 bi 8007914 <== NOT EXECUTED jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); return 0; 8007910: 34 01 00 00 mvi r1,0 } 8007914: 2b 9d 00 04 lw ra,(sp+4) 8007918: 2b 8b 00 14 lw r11,(sp+20) 800791c: 2b 8c 00 10 lw r12,(sp+16) 8007920: 2b 8d 00 0c lw r13,(sp+12) 8007924: 2b 8e 00 08 lw r14,(sp+8) 8007928: 37 9c 00 28 addi sp,sp,40 800792c: c3 a0 00 00 ret =============================================================================== 080079c8 : const char *path, int pathlen, char *token, int *token_len ) { 80079c8: 37 9c ff e0 addi sp,sp,-32 80079cc: 5b 8b 00 20 sw (sp+32),r11 80079d0: 5b 8c 00 1c sw (sp+28),r12 80079d4: 5b 8d 00 18 sw (sp+24),r13 80079d8: 5b 8e 00 14 sw (sp+20),r14 80079dc: 5b 8f 00 10 sw (sp+16),r15 80079e0: 5b 90 00 0c sw (sp+12),r16 80079e4: 5b 91 00 08 sw (sp+8),r17 80079e8: 5b 9d 00 04 sw (sp+4),ra register int i = 0; 80079ec: 34 0b 00 00 mvi r11,0 const char *path, int pathlen, char *token, int *token_len ) { 80079f0: b8 20 78 00 mv r15,r1 80079f4: b8 40 70 00 mv r14,r2 80079f8: b8 60 68 00 mv r13,r3 80079fc: b8 80 80 00 mv r16,r4 register char c; /* * Copy a name into token. (Remember NULL is a token.) */ c = path[i]; 8007a00: 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 ) 8007a04: 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) ) { 8007a08: e0 00 00 07 bi 8007a24 #include #include "imfs.h" #include IMFS_token_types IMFS_get_token( 8007a0c: 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; 8007a10: 30 2c 00 00 sb (r1+0),r12 if ( i == IMFS_NAME_MAX ) 8007a14: 45 71 00 27 be r11,r17,8007ab0 return IMFS_INVALID_TOKEN; if ( !IMFS_is_valid_name_char(c) ) type = IMFS_INVALID_TOKEN; c = path [++i]; 8007a18: 35 6b 00 01 addi r11,r11,1 #include #include "imfs.h" #include IMFS_token_types IMFS_get_token( 8007a1c: 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]; 8007a20: 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) ) { 8007a24: b9 80 08 00 mv r1,r12 8007a28: fb ff ea 5a calli 8002390 8007a2c: 5c 20 00 03 bne r1,r0,8007a38 8007a30: e9 cb 10 00 cmpg r2,r14,r11 8007a34: 5c 41 ff f6 bne r2,r1,8007a0c <== ALWAYS TAKEN /* * Copy a seperator into token. */ if ( i == 0 ) { 8007a38: 5d 60 00 08 bne r11,r0,8007a58 token[i] = c; 8007a3c: 31 ac 00 00 sb (r13+0),r12 if ( (token[i] != '\0') && pathlen ) { 8007a40: 7d ce 00 00 cmpnei r14,r14,0 8007a44: 7d 8c 00 00 cmpnei r12,r12,0 8007a48: a1 8e 60 00 and r12,r12,r14 8007a4c: 5d 8b 00 09 bne r12,r11,8007a70 i++; type = IMFS_CURRENT_DIR; } else { type = IMFS_NO_MORE_PATH; 8007a50: 34 0c 00 00 mvi r12,0 8007a54: e0 00 00 09 bi 8007a78 } } else if (token[ i-1 ] != '\0') { 8007a58: b5 ab 08 00 add r1,r13,r11 8007a5c: 40 22 ff ff lbu r2,(r1+-1) char *token, int *token_len ) { register int i = 0; IMFS_token_types type = IMFS_NAME; 8007a60: 34 0c 00 03 mvi r12,3 i++; type = IMFS_CURRENT_DIR; } else { type = IMFS_NO_MORE_PATH; } } else if (token[ i-1 ] != '\0') { 8007a64: 44 40 00 05 be r2,r0,8007a78 <== NEVER TAKEN token[i] = '\0'; 8007a68: 30 20 00 00 sb (r1+0),r0 8007a6c: e0 00 00 03 bi 8007a78 if ( i == 0 ) { token[i] = c; if ( (token[i] != '\0') && pathlen ) { i++; type = IMFS_CURRENT_DIR; 8007a70: 34 0c 00 01 mvi r12,1 if ( i == 0 ) { token[i] = c; if ( (token[i] != '\0') && pathlen ) { i++; 8007a74: 34 0b 00 01 mvi r11,1 /* * Set token_len to the number of characters copied. */ *token_len = i; 8007a78: 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 ) { 8007a7c: 34 01 00 03 mvi r1,3 8007a80: 5d 81 00 11 bne r12,r1,8007ac4 if ( strcmp( token, "..") == 0 ) 8007a84: 78 02 08 01 mvhi r2,0x801 8007a88: b9 a0 08 00 mv r1,r13 8007a8c: 38 42 1c c4 ori r2,r2,0x1cc4 8007a90: f8 00 12 2c calli 800c340 8007a94: 44 20 00 09 be r1,r0,8007ab8 type = IMFS_UP_DIR; else if ( strcmp( token, "." ) == 0 ) 8007a98: 78 02 08 01 mvhi r2,0x801 8007a9c: b9 a0 08 00 mv r1,r13 8007aa0: 38 42 1c c8 ori r2,r2,0x1cc8 8007aa4: f8 00 12 27 calli 800c340 8007aa8: 44 20 00 06 be r1,r0,8007ac0 8007aac: e0 00 00 06 bi 8007ac4 while ( (!IMFS_is_separator(c)) && (i < pathlen) && (i <= IMFS_NAME_MAX) ) { token[i] = c; if ( i == IMFS_NAME_MAX ) return IMFS_INVALID_TOKEN; 8007ab0: 34 0c 00 04 mvi r12,4 8007ab4: e0 00 00 04 bi 8007ac4 * it was a special name. */ if ( type == IMFS_NAME ) { if ( strcmp( token, "..") == 0 ) type = IMFS_UP_DIR; 8007ab8: 34 0c 00 02 mvi r12,2 8007abc: e0 00 00 02 bi 8007ac4 else if ( strcmp( token, "." ) == 0 ) type = IMFS_CURRENT_DIR; 8007ac0: 34 0c 00 01 mvi r12,1 } return type; } 8007ac4: b9 80 08 00 mv r1,r12 8007ac8: 2b 9d 00 04 lw ra,(sp+4) 8007acc: 2b 8b 00 20 lw r11,(sp+32) 8007ad0: 2b 8c 00 1c lw r12,(sp+28) 8007ad4: 2b 8d 00 18 lw r13,(sp+24) 8007ad8: 2b 8e 00 14 lw r14,(sp+20) 8007adc: 2b 8f 00 10 lw r15,(sp+16) 8007ae0: 2b 90 00 0c lw r16,(sp+12) 8007ae4: 2b 91 00 08 lw r17,(sp+8) 8007ae8: 37 9c 00 20 addi sp,sp,32 8007aec: c3 a0 00 00 ret =============================================================================== 08000888 : 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 ) { 8000888: 37 9c ff e0 addi sp,sp,-32 800088c: 5b 8b 00 20 sw (sp+32),r11 8000890: 5b 8c 00 1c sw (sp+28),r12 8000894: 5b 8d 00 18 sw (sp+24),r13 8000898: 5b 8e 00 14 sw (sp+20),r14 800089c: 5b 8f 00 10 sw (sp+16),r15 80008a0: 5b 90 00 0c sw (sp+12),r16 80008a4: 5b 91 00 08 sw (sp+8),r17 80008a8: 5b 9d 00 04 sw (sp+4),ra 80008ac: 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, 80008b0: 78 01 08 01 mvhi r1,0x801 80008b4: 38 21 30 14 ori r1,r1,0x3014 80008b8: 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 ) { 80008bc: b8 40 88 00 mv r17,r2 80008c0: b8 60 80 00 mv r16,r3 80008c4: b8 80 70 00 mv r14,r4 80008c8: 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, 80008cc: 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) { 80008d0: 34 01 00 10 mvi r1,16 if (bit_mask == requested_bytes_per_block) { 80008d4: 44 2c 00 07 be r1,r12,80008f0 is_valid = true; break; } if(bit_mask > requested_bytes_per_block) 80008d8: 48 2c 00 05 bg r1,r12,80008ec int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 80008dc: 34 02 00 01 mvi r2,1 80008e0: 35 ad ff ff addi r13,r13,-1 80008e4: f8 00 3f 70 calli 80106a4 <__ashlsi3> 80008e8: 5d a0 ff fb bne r13,r0,80008d4 <== ALWAYS TAKEN if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) ? requested_bytes_per_block : default_bytes_per_block); 80008ec: 34 0c 00 80 mvi r12,128 break; } if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) 80008f0: 78 01 08 01 mvhi r1,0x801 80008f4: 38 21 36 1c ori r1,r1,0x361c 80008f8: 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(); 80008fc: f8 00 19 92 calli 8006f44 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; 8000900: 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(); 8000904: 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; 8000908: 38 42 1c 70 ori r2,r2,0x1c70 800090c: 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(); 8000910: b8 20 60 00 mv r12,r1 temp_mt_entry->mt_fs_root.handlers = directory_handlers; 8000914: 59 6e 00 24 sw (r11+36),r14 temp_mt_entry->mt_fs_root.ops = op_table; 8000918: 59 71 00 28 sw (r11+40),r17 temp_mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS; 800091c: 35 61 00 38 addi r1,r11,56 8000920: f8 00 2d 14 calli 800bd70 /* * Create custom file system data. */ fs_info = calloc( 1, sizeof( IMFS_fs_info_t ) ); 8000924: 34 02 00 14 mvi r2,20 8000928: 34 01 00 01 mvi r1,1 800092c: f8 00 01 ec calli 80010dc 8000930: b8 20 10 00 mv r2,r1 if ( !fs_info ) { 8000934: 5c 20 00 08 bne r1,r0,8000954 free(temp_mt_entry->mt_fs_root.node_access); 8000938: b9 80 08 00 mv r1,r12 800093c: f8 00 02 79 calli 8001320 rtems_set_errno_and_return_minus_one(ENOMEM); 8000940: f8 00 2a 56 calli 800b298 <__errno> 8000944: 34 02 00 0c mvi r2,12 8000948: 58 22 00 00 sw (r1+0),r2 800094c: 34 01 ff ff mvi r1,-1 8000950: e0 00 00 0f bi 800098c /* * Set st_ino for the root to 1. */ fs_info->instance = imfs_instance++; 8000954: 78 06 08 01 mvhi r6,0x801 8000958: 38 c6 36 20 ori r6,r6,0x3620 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; 800095c: 59 61 00 34 sw (r11+52),r1 /* * Set st_ino for the root to 1. */ fs_info->instance = imfs_instance++; 8000960: 28 c1 00 00 lw r1,(r6+0) fs_info->ino_count = 1; fs_info->memfile_handlers = memfile_handlers; 8000964: 58 50 00 08 sw (r2+8),r16 fs_info->directory_handlers = directory_handlers; 8000968: 58 4e 00 0c sw (r2+12),r14 /* * Set st_ino for the root to 1. */ fs_info->instance = imfs_instance++; 800096c: 58 41 00 00 sw (r2+0),r1 8000970: 34 21 00 01 addi r1,r1,1 8000974: 58 c1 00 00 sw (r6+0),r1 fs_info->ino_count = 1; 8000978: 34 01 00 01 mvi r1,1 800097c: 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; 8000980: 58 4f 00 10 sw (r2+16),r15 jnode = temp_mt_entry->mt_fs_root.node_access; jnode->st_ino = fs_info->ino_count; 8000984: 59 81 00 38 sw (r12+56),r1 return 0; 8000988: 34 01 00 00 mvi r1,0 } 800098c: 2b 9d 00 04 lw ra,(sp+4) 8000990: 2b 8b 00 20 lw r11,(sp+32) 8000994: 2b 8c 00 1c lw r12,(sp+28) 8000998: 2b 8d 00 18 lw r13,(sp+24) 800099c: 2b 8e 00 14 lw r14,(sp+20) 80009a0: 2b 8f 00 10 lw r15,(sp+16) 80009a4: 2b 90 00 0c lw r16,(sp+12) 80009a8: 2b 91 00 08 lw r17,(sp+8) 80009ac: 37 9c 00 20 addi sp,sp,32 80009b0: c3 a0 00 00 ret =============================================================================== 0800a060 : */ MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, off_t new_length ) { 800a060: 37 9c ff e0 addi sp,sp,-32 800a064: 5b 8b 00 20 sw (sp+32),r11 800a068: 5b 8c 00 1c sw (sp+28),r12 800a06c: 5b 8d 00 18 sw (sp+24),r13 800a070: 5b 8e 00 14 sw (sp+20),r14 800a074: 5b 8f 00 10 sw (sp+16),r15 800a078: 5b 90 00 0c sw (sp+12),r16 800a07c: 5b 91 00 08 sw (sp+8),r17 800a080: 5b 9d 00 04 sw (sp+4),ra 800a084: b8 20 60 00 mv r12,r1 IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 800a088: 78 01 08 01 mvhi r1,0x801 800a08c: 38 21 36 1c ori r1,r1,0x361c 800a090: 28 2b 00 00 lw r11,(r1+0) */ MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, off_t new_length ) { 800a094: b8 40 68 00 mv r13,r2 IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 800a098: 34 02 00 02 mvi r2,2 800a09c: b9 60 08 00 mv r1,r11 800a0a0: f8 00 19 cf calli 80107dc <__lshrsi3> 800a0a4: b8 20 70 00 mv r14,r1 800a0a8: b9 c0 10 00 mv r2,r14 800a0ac: 34 21 00 01 addi r1,r1,1 800a0b0: f8 00 19 f2 calli 8010878 <__mulsi3> 800a0b4: b9 c0 10 00 mv r2,r14 800a0b8: 34 21 00 01 addi r1,r1,1 800a0bc: f8 00 19 ef calli 8010878 <__mulsi3> 800a0c0: 34 21 ff ff addi r1,r1,-1 800a0c4: b9 60 10 00 mv r2,r11 800a0c8: f8 00 19 ec calli 8010878 <__mulsi3> 800a0cc: 54 2d 00 04 bgu r1,r13,800a0dc rtems_set_errno_and_return_minus_one( EINVAL ); 800a0d0: f8 00 04 72 calli 800b298 <__errno> 800a0d4: 34 02 00 16 mvi r2,22 800a0d8: e0 00 00 26 bi 800a170 /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) 800a0dc: b9 a0 08 00 mv r1,r13 800a0e0: 34 02 00 1f mvi r2,31 800a0e4: f8 00 19 97 calli 8010740 <__ashrsi3> 800a0e8: 29 8f 00 50 lw r15,(r12+80) 800a0ec: b8 20 70 00 mv r14,r1 800a0f0: 29 90 00 54 lw r16,(r12+84) 800a0f4: 48 2f 00 04 bg r1,r15,800a104 <== NEVER TAKEN 800a0f8: 5c 2f 00 25 bne r1,r15,800a18c <== NEVER TAKEN 800a0fc: 55 b0 00 02 bgu r13,r16,800a104 800a100: e0 00 00 23 bi 800a18c return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; 800a104: b9 60 10 00 mv r2,r11 800a108: b9 a0 08 00 mv r1,r13 800a10c: f8 00 19 e7 calli 80108a8 <__divsi3> old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 800a110: 34 02 00 1f mvi r2,31 return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; 800a114: b8 20 88 00 mv r17,r1 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 800a118: b9 60 08 00 mv r1,r11 800a11c: f8 00 19 89 calli 8010740 <__ashrsi3> 800a120: b8 20 18 00 mv r3,r1 800a124: b9 60 20 00 mv r4,r11 800a128: b9 e0 08 00 mv r1,r15 800a12c: ba 00 10 00 mv r2,r16 800a130: f8 00 13 92 calli 800ef78 <__divdi3> 800a134: b8 40 78 00 mv r15,r2 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { 800a138: b8 40 58 00 mv r11,r2 800a13c: e0 00 00 11 bi 800a180 if ( IMFS_memfile_addblock( the_jnode, block ) ) { 800a140: b9 80 08 00 mv r1,r12 800a144: b9 60 10 00 mv r2,r11 800a148: fb ff ff 23 calli 8009dd4 800a14c: 44 20 00 0c be r1,r0,800a17c 800a150: e0 00 00 05 bi 800a164 for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); 800a154: b9 60 10 00 mv r2,r11 800a158: b9 80 08 00 mv r1,r12 800a15c: fb ff ff b5 calli 800a030 /* * 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-- ) { 800a160: 35 6b ff ff addi r11,r11,-1 800a164: 51 6f ff fc bgeu r11,r15,800a154 IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); 800a168: f8 00 04 4c calli 800b298 <__errno> 800a16c: 34 02 00 1c mvi r2,28 800a170: 58 22 00 00 sw (r1+0),r2 800a174: 34 01 ff ff mvi r1,-1 800a178: e0 00 00 06 bi 800a190 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { 800a17c: 35 6b 00 01 addi r11,r11,1 800a180: 52 2b ff f0 bgeu r17,r11,800a140 } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; 800a184: 59 8e 00 50 sw (r12+80),r14 800a188: 59 8d 00 54 sw (r12+84),r13 /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) return 0; 800a18c: 34 01 00 00 mvi r1,0 /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; return 0; } 800a190: 2b 9d 00 04 lw ra,(sp+4) 800a194: 2b 8b 00 20 lw r11,(sp+32) 800a198: 2b 8c 00 1c lw r12,(sp+28) 800a19c: 2b 8d 00 18 lw r13,(sp+24) 800a1a0: 2b 8e 00 14 lw r14,(sp+20) 800a1a4: 2b 8f 00 10 lw r15,(sp+16) 800a1a8: 2b 90 00 0c lw r16,(sp+12) 800a1ac: 2b 91 00 08 lw r17,(sp+8) 800a1b0: 37 9c 00 20 addi sp,sp,32 800a1b4: c3 a0 00 00 ret =============================================================================== 08009918 : #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 8009918: 37 9c ff e0 addi sp,sp,-32 800991c: 5b 8b 00 20 sw (sp+32),r11 8009920: 5b 8c 00 1c sw (sp+28),r12 8009924: 5b 8d 00 18 sw (sp+24),r13 8009928: 5b 8e 00 14 sw (sp+20),r14 800992c: 5b 8f 00 10 sw (sp+16),r15 8009930: 5b 90 00 0c sw (sp+12),r16 8009934: 5b 91 00 08 sw (sp+8),r17 8009938: 5b 9d 00 04 sw (sp+4),ra 800993c: b8 20 68 00 mv r13,r1 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 8009940: 78 01 08 01 mvhi r1,0x801 8009944: 38 21 36 1c ori r1,r1,0x361c 8009948: 28 21 00 00 lw r1,(r1+0) #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 800994c: b8 40 70 00 mv r14,r2 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 8009950: 34 02 00 02 mvi r2,2 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 8009954: b8 60 78 00 mv r15,r3 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 8009958: f8 00 1b a1 calli 80107dc <__lshrsi3> 800995c: b8 20 60 00 mv r12,r1 8009960: 34 21 ff ff addi r1,r1,-1 8009964: 55 c1 00 12 bgu r14,r1,80099ac p = info->indirect; 8009968: 29 ac 00 58 lw r12,(r13+88) if ( malloc_it ) { 800996c: 45 e0 00 0c be r15,r0,800999c if ( !p ) { 8009970: 5d 80 00 05 bne r12,r0,8009984 p = memfile_alloc_block(); 8009974: fb ff ff d9 calli 80098d8 if ( !p ) return 0; 8009978: 34 0b 00 00 mvi r11,0 if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); if ( !p ) 800997c: 44 2c 00 81 be r1,r12,8009b80 <== NEVER TAKEN return 0; info->indirect = p; 8009980: 59 a1 00 58 sw (r13+88),r1 } return &info->indirect[ my_block ]; 8009984: b9 c0 08 00 mv r1,r14 8009988: 34 02 00 02 mvi r2,2 800998c: f8 00 1b 46 calli 80106a4 <__ashlsi3> 8009990: 29 ab 00 58 lw r11,(r13+88) 8009994: b5 61 58 00 add r11,r11,r1 8009998: e0 00 00 7a bi 8009b80 } if ( !p ) return 0; 800999c: 34 0b 00 00 mvi r11,0 return &info->indirect[ my_block ]; 80099a0: b9 c0 08 00 mv r1,r14 info->indirect = p; } return &info->indirect[ my_block ]; } if ( !p ) 80099a4: 5d 8b 00 74 bne r12,r11,8009b74 <== ALWAYS TAKEN 80099a8: e0 00 00 76 bi 8009b80 <== NOT EXECUTED /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { 80099ac: 35 81 00 01 addi r1,r12,1 80099b0: b9 80 10 00 mv r2,r12 80099b4: f8 00 1b b1 calli 8010878 <__mulsi3> 80099b8: b8 20 80 00 mv r16,r1 80099bc: 34 21 ff ff addi r1,r1,-1 80099c0: 55 c1 00 2b bgu r14,r1,8009a6c my_block -= FIRST_DOUBLY_INDIRECT; 80099c4: c9 cc 70 00 sub r14,r14,r12 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 80099c8: b9 80 10 00 mv r2,r12 80099cc: b9 c0 08 00 mv r1,r14 80099d0: f8 00 1c 1f calli 8010a4c <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 80099d4: b9 80 10 00 mv r2,r12 */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 80099d8: b8 20 80 00 mv r16,r1 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 80099dc: b9 c0 08 00 mv r1,r14 80099e0: f8 00 1c 0b calli 8010a0c <__udivsi3> 80099e4: b8 20 70 00 mv r14,r1 p = info->doubly_indirect; 80099e8: 29 ac 00 5c lw r12,(r13+92) if ( malloc_it ) { 80099ec: 45 e0 00 17 be r15,r0,8009a48 if ( !p ) { 80099f0: 5d 80 00 06 bne r12,r0,8009a08 p = memfile_alloc_block(); 80099f4: fb ff ff b9 calli 80098d8 80099f8: b8 20 60 00 mv r12,r1 if ( !p ) return 0; 80099fc: 34 0b 00 00 mvi r11,0 p = info->doubly_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); if ( !p ) 8009a00: 44 20 00 60 be r1,r0,8009b80 <== NEVER TAKEN return 0; info->doubly_indirect = p; 8009a04: 59 a1 00 5c sw (r13+92),r1 } p1 = (block_p *)p[ doubly ]; 8009a08: b9 c0 08 00 mv r1,r14 8009a0c: 34 02 00 02 mvi r2,2 8009a10: f8 00 1b 25 calli 80106a4 <__ashlsi3> 8009a14: b5 81 60 00 add r12,r12,r1 8009a18: 29 8d 00 00 lw r13,(r12+0) if ( !p1 ) { 8009a1c: 5d a0 00 06 bne r13,r0,8009a34 p1 = memfile_alloc_block(); 8009a20: fb ff ff ae calli 80098d8 8009a24: b8 20 68 00 mv r13,r1 if ( !p1 ) return 0; 8009a28: 34 0b 00 00 mvi r11,0 } p1 = (block_p *)p[ doubly ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) 8009a2c: 44 20 00 55 be r1,r0,8009b80 <== NEVER TAKEN return 0; p[ doubly ] = (block_p) p1; 8009a30: 59 81 00 00 sw (r12+0),r1 } return (block_p *)&p1[ singly ]; 8009a34: ba 00 08 00 mv r1,r16 8009a38: 34 02 00 02 mvi r2,2 8009a3c: f8 00 1b 1a calli 80106a4 <__ashlsi3> 8009a40: b5 a1 58 00 add r11,r13,r1 8009a44: e0 00 00 4f bi 8009b80 } if ( !p ) return 0; 8009a48: 34 0b 00 00 mvi r11,0 } return (block_p *)&p1[ singly ]; } if ( !p ) 8009a4c: 45 8b 00 4d be r12,r11,8009b80 <== NEVER TAKEN return 0; p = (block_p *)p[ doubly ]; 8009a50: 34 02 00 02 mvi r2,2 8009a54: f8 00 1b 14 calli 80106a4 <__ashlsi3> 8009a58: b5 81 08 00 add r1,r12,r1 8009a5c: 28 2c 00 00 lw r12,(r1+0) if ( !p ) return 0; return (block_p *)&p[ singly ]; 8009a60: ba 00 08 00 mv r1,r16 if ( !p ) return 0; p = (block_p *)p[ doubly ]; if ( !p ) 8009a64: 5d 80 00 44 bne r12,r0,8009b74 <== ALWAYS TAKEN 8009a68: e0 00 00 46 bi 8009b80 <== NOT EXECUTED } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 8009a6c: 36 01 00 01 addi r1,r16,1 8009a70: b9 80 10 00 mv r2,r12 8009a74: f8 00 1b 81 calli 8010878 <__mulsi3> 8009a78: 34 21 ff ff addi r1,r1,-1 } /* * This means the requested block number is out of range. */ return 0; 8009a7c: 34 0b 00 00 mvi r11,0 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 8009a80: 55 c1 00 40 bgu r14,r1,8009b80 <== NEVER TAKEN my_block -= FIRST_TRIPLY_INDIRECT; 8009a84: c9 d0 70 00 sub r14,r14,r16 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 8009a88: b9 80 10 00 mv r2,r12 8009a8c: b9 c0 08 00 mv r1,r14 8009a90: f8 00 1b ef calli 8010a4c <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 8009a94: b9 80 10 00 mv r2,r12 * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 8009a98: b8 20 88 00 mv r17,r1 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 8009a9c: b9 c0 08 00 mv r1,r14 8009aa0: f8 00 1b db calli 8010a0c <__udivsi3> triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 8009aa4: 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; 8009aa8: b8 20 70 00 mv r14,r1 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 8009aac: f8 00 1b d8 calli 8010a0c <__udivsi3> doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 8009ab0: 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; 8009ab4: b8 20 80 00 mv r16,r1 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 8009ab8: b9 c0 08 00 mv r1,r14 8009abc: f8 00 1b e4 calli 8010a4c <__umodsi3> 8009ac0: b8 20 70 00 mv r14,r1 p = info->triply_indirect; 8009ac4: 29 ac 00 60 lw r12,(r13+96) if ( malloc_it ) { 8009ac8: 45 e0 00 1d be r15,r0,8009b3c if ( !p ) { 8009acc: 5d 80 00 05 bne r12,r0,8009ae0 p = memfile_alloc_block(); 8009ad0: fb ff ff 82 calli 80098d8 8009ad4: b8 20 60 00 mv r12,r1 if ( !p ) 8009ad8: 44 20 00 2a be r1,r0,8009b80 <== NEVER TAKEN return 0; info->triply_indirect = p; 8009adc: 59 a1 00 60 sw (r13+96),r1 } p1 = (block_p *) p[ triply ]; 8009ae0: ba 00 08 00 mv r1,r16 8009ae4: 34 02 00 02 mvi r2,2 8009ae8: f8 00 1a ef calli 80106a4 <__ashlsi3> 8009aec: b5 81 60 00 add r12,r12,r1 8009af0: 29 8d 00 00 lw r13,(r12+0) if ( !p1 ) { 8009af4: 5d a0 00 06 bne r13,r0,8009b0c p1 = memfile_alloc_block(); 8009af8: fb ff ff 78 calli 80098d8 8009afc: b8 20 68 00 mv r13,r1 if ( !p1 ) return 0; 8009b00: 34 0b 00 00 mvi r11,0 } p1 = (block_p *) p[ triply ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) 8009b04: 44 20 00 1f be r1,r0,8009b80 <== NEVER TAKEN return 0; p[ triply ] = (block_p) p1; 8009b08: 59 81 00 00 sw (r12+0),r1 } p2 = (block_p *)p1[ doubly ]; 8009b0c: b9 c0 08 00 mv r1,r14 8009b10: 34 02 00 02 mvi r2,2 8009b14: f8 00 1a e4 calli 80106a4 <__ashlsi3> 8009b18: b5 a1 68 00 add r13,r13,r1 8009b1c: 29 ac 00 00 lw r12,(r13+0) if ( !p2 ) { 8009b20: 5d 80 00 14 bne r12,r0,8009b70 p2 = memfile_alloc_block(); 8009b24: fb ff ff 6d calli 80098d8 8009b28: b8 20 60 00 mv r12,r1 if ( !p2 ) return 0; 8009b2c: 34 0b 00 00 mvi r11,0 } p2 = (block_p *)p1[ doubly ]; if ( !p2 ) { p2 = memfile_alloc_block(); if ( !p2 ) 8009b30: 44 20 00 14 be r1,r0,8009b80 <== NEVER TAKEN return 0; p1[ doubly ] = (block_p) p2; 8009b34: 59 a1 00 00 sw (r13+0),r1 8009b38: e0 00 00 0e bi 8009b70 } return (block_p *)&p2[ singly ]; } if ( !p ) 8009b3c: 45 8b 00 11 be r12,r11,8009b80 <== NEVER TAKEN return 0; p1 = (block_p *) p[ triply ]; 8009b40: ba 00 08 00 mv r1,r16 8009b44: 34 02 00 02 mvi r2,2 8009b48: f8 00 1a d7 calli 80106a4 <__ashlsi3> 8009b4c: b5 81 08 00 add r1,r12,r1 8009b50: 28 2c 00 00 lw r12,(r1+0) if ( !p1 ) 8009b54: 45 80 00 0b be r12,r0,8009b80 <== NEVER TAKEN return 0; p2 = (block_p *)p1[ doubly ]; 8009b58: b9 c0 08 00 mv r1,r14 8009b5c: 34 02 00 02 mvi r2,2 8009b60: f8 00 1a d1 calli 80106a4 <__ashlsi3> 8009b64: b5 81 08 00 add r1,r12,r1 8009b68: 28 2c 00 00 lw r12,(r1+0) if ( !p2 ) 8009b6c: 45 80 00 05 be r12,r0,8009b80 <== NEVER TAKEN return 0; return (block_p *)&p2[ singly ]; 8009b70: ba 20 08 00 mv r1,r17 8009b74: 34 02 00 02 mvi r2,2 8009b78: f8 00 1a cb calli 80106a4 <__ashlsi3> 8009b7c: b5 81 58 00 add r11,r12,r1 /* * This means the requested block number is out of range. */ return 0; } 8009b80: b9 60 08 00 mv r1,r11 8009b84: 2b 9d 00 04 lw ra,(sp+4) 8009b88: 2b 8b 00 20 lw r11,(sp+32) 8009b8c: 2b 8c 00 1c lw r12,(sp+28) 8009b90: 2b 8d 00 18 lw r13,(sp+24) 8009b94: 2b 8e 00 14 lw r14,(sp+20) 8009b98: 2b 8f 00 10 lw r15,(sp+16) 8009b9c: 2b 90 00 0c lw r16,(sp+12) 8009ba0: 2b 91 00 08 lw r17,(sp+8) 8009ba4: 37 9c 00 20 addi sp,sp,32 8009ba8: c3 a0 00 00 ret =============================================================================== 08009bac : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 8009bac: 37 9c ff d4 addi sp,sp,-44 8009bb0: 5b 8b 00 24 sw (sp+36),r11 8009bb4: 5b 8c 00 20 sw (sp+32),r12 8009bb8: 5b 8d 00 1c sw (sp+28),r13 8009bbc: 5b 8e 00 18 sw (sp+24),r14 8009bc0: 5b 8f 00 14 sw (sp+20),r15 8009bc4: 5b 90 00 10 sw (sp+16),r16 8009bc8: 5b 91 00 0c sw (sp+12),r17 8009bcc: 5b 92 00 08 sw (sp+8),r18 8009bd0: 5b 9d 00 04 sw (sp+4),ra 8009bd4: b8 40 70 00 mv r14,r2 * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; if (the_jnode->type == IMFS_LINEAR_FILE) { 8009bd8: 28 22 00 4c lw r2,(r1+76) IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 8009bdc: b8 20 60 00 mv r12,r1 8009be0: 28 2d 00 50 lw r13,(r1+80) 8009be4: 28 2f 00 54 lw r15,(r1+84) * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; if (the_jnode->type == IMFS_LINEAR_FILE) { 8009be8: 34 01 00 06 mvi r1,6 IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 8009bec: b8 60 80 00 mv r16,r3 8009bf0: b8 80 58 00 mv r11,r4 * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; if (the_jnode->type == IMFS_LINEAR_FILE) { 8009bf4: 5c 41 00 15 bne r2,r1,8009c48 unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) 8009bf8: 34 02 00 1f mvi r2,31 8009bfc: b9 c0 08 00 mv r1,r14 8009c00: f8 00 1a d0 calli 8010740 <__ashrsi3> 8009c04: c9 ee 18 00 sub r3,r15,r14 8009c08: f4 6f 10 00 cmpgu r2,r3,r15 8009c0c: c9 a1 08 00 sub r1,r13,r1 8009c10: c8 22 68 00 sub r13,r1,r2 my_length = length; if (the_jnode->type == IMFS_LINEAR_FILE) { unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; 8009c14: 29 91 00 58 lw r17,(r12+88) if (my_length > (the_jnode->info.linearfile.size - start)) 8009c18: 48 0d 00 04 bg r0,r13,8009c28 <== NEVER TAKEN 8009c1c: 5c 0d 00 05 bne r0,r13,8009c30 <== NEVER TAKEN 8009c20: 55 63 00 02 bgu r11,r3,8009c28 <== ALWAYS TAKEN 8009c24: e0 00 00 03 bi 8009c30 <== NOT EXECUTED my_length = the_jnode->info.linearfile.size - start; 8009c28: c9 ee 68 00 sub r13,r15,r14 8009c2c: e0 00 00 02 bi 8009c34 /* * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; 8009c30: b9 60 68 00 mv r13,r11 <== NOT EXECUTED file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) my_length = the_jnode->info.linearfile.size - start; memcpy(dest, &file_ptr[start], my_length); 8009c34: ba 00 08 00 mv r1,r16 8009c38: b6 2e 10 00 add r2,r17,r14 8009c3c: b9 a0 18 00 mv r3,r13 8009c40: f8 00 08 4c calli 800bd70 8009c44: e0 00 00 47 bi 8009d60 /* * 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; 8009c48: b4 8e 08 00 add r1,r4,r14 if ( last_byte > the_jnode->info.file.size ) 8009c4c: 48 0d 00 04 bg r0,r13,8009c5c <== NEVER TAKEN 8009c50: 5d a0 00 04 bne r13,r0,8009c60 <== NEVER TAKEN 8009c54: 54 2f 00 02 bgu r1,r15,8009c5c 8009c58: e0 00 00 02 bi 8009c60 my_length = the_jnode->info.file.size - start; 8009c5c: c9 ee 58 00 sub r11,r15,r14 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 8009c60: 78 01 08 01 mvhi r1,0x801 8009c64: 38 21 36 1c ori r1,r1,0x361c 8009c68: 28 32 00 00 lw r18,(r1+0) 8009c6c: b9 c0 08 00 mv r1,r14 unsigned int last_byte; unsigned int copied; unsigned int start_offset; unsigned char *dest; dest = destination; 8009c70: ba 00 78 00 mv r15,r16 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 8009c74: ba 40 10 00 mv r2,r18 8009c78: f8 00 1b 3c calli 8010968 <__modsi3> 8009c7c: b8 20 88 00 mv r17,r1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 8009c80: ba 40 10 00 mv r2,r18 8009c84: b9 c0 08 00 mv r1,r14 8009c88: f8 00 1b 08 calli 80108a8 <__divsi3> 8009c8c: 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; 8009c90: 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 ) { 8009c94: 46 20 00 12 be r17,r0,8009cdc 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 ); 8009c98: b9 80 08 00 mv r1,r12 8009c9c: b9 c0 10 00 mv r2,r14 8009ca0: 34 03 00 00 mvi r3,0 8009ca4: fb ff ff 1d calli 8009918 if ( !block_ptr ) 8009ca8: 44 20 00 33 be r1,r0,8009d74 <== NEVER TAKEN * 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 ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; 8009cac: ca 51 90 00 sub r18,r18,r17 8009cb0: b9 60 68 00 mv r13,r11 8009cb4: 52 4b 00 02 bgeu r18,r11,8009cbc 8009cb8: 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 ); 8009cbc: 28 22 00 00 lw r2,(r1+0) 8009cc0: b9 a0 18 00 mv r3,r13 8009cc4: ba 00 08 00 mv r1,r16 8009cc8: b4 51 10 00 add r2,r2,r17 8009ccc: f8 00 08 29 calli 800bd70 dest += to_copy; 8009cd0: b6 0d 78 00 add r15,r16,r13 block++; 8009cd4: 35 ce 00 01 addi r14,r14,1 my_length -= to_copy; 8009cd8: c9 6d 58 00 sub r11,r11,r13 } /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 8009cdc: 78 01 08 01 mvhi r1,0x801 8009ce0: 38 21 36 1c ori r1,r1,0x361c 8009ce4: 28 30 00 00 lw r16,(r1+0) while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 8009ce8: b8 20 88 00 mv r17,r1 8009cec: e0 00 00 0f bi 8009d28 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 8009cf0: b9 c0 10 00 mv r2,r14 8009cf4: b9 80 08 00 mv r1,r12 8009cf8: 34 03 00 00 mvi r3,0 8009cfc: fb ff ff 07 calli 8009918 8009d00: b8 20 10 00 mv r2,r1 if ( !block_ptr ) 8009d04: 44 20 00 1c be r1,r0,8009d74 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 8009d08: 28 42 00 00 lw r2,(r2+0) 8009d0c: b9 e0 08 00 mv r1,r15 8009d10: ba 00 18 00 mv r3,r16 8009d14: f8 00 08 17 calli 800bd70 dest += to_copy; 8009d18: b5 f0 78 00 add r15,r15,r16 block++; 8009d1c: 35 ce 00 01 addi r14,r14,1 my_length -= to_copy; 8009d20: c9 70 58 00 sub r11,r11,r16 copied += to_copy; 8009d24: 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 ) { 8009d28: 2a 21 00 00 lw r1,(r17+0) 8009d2c: 51 61 ff f1 bgeu r11,r1,8009cf0 /* * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { 8009d30: 45 60 00 0c be r11,r0,8009d60 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 8009d34: b9 c0 10 00 mv r2,r14 8009d38: b9 80 08 00 mv r1,r12 8009d3c: 34 03 00 00 mvi r3,0 8009d40: fb ff fe f6 calli 8009918 8009d44: b8 20 10 00 mv r2,r1 if ( !block_ptr ) 8009d48: 44 20 00 0b be r1,r0,8009d74 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); 8009d4c: 28 42 00 00 lw r2,(r2+0) 8009d50: b9 e0 08 00 mv r1,r15 8009d54: b9 60 18 00 mv r3,r11 8009d58: f8 00 08 06 calli 800bd70 copied += my_length; 8009d5c: b5 6d 68 00 add r13,r11,r13 } IMFS_update_atime( the_jnode ); 8009d60: 37 81 00 28 addi r1,sp,40 8009d64: 34 02 00 00 mvi r2,0 8009d68: fb ff dd 9c calli 80013d8 8009d6c: 2b 81 00 28 lw r1,(sp+40) 8009d70: 59 81 00 40 sw (r12+64),r1 return copied; } 8009d74: b9 a0 08 00 mv r1,r13 8009d78: 2b 9d 00 04 lw ra,(sp+4) 8009d7c: 2b 8b 00 24 lw r11,(sp+36) 8009d80: 2b 8c 00 20 lw r12,(sp+32) 8009d84: 2b 8d 00 1c lw r13,(sp+28) 8009d88: 2b 8e 00 18 lw r14,(sp+24) 8009d8c: 2b 8f 00 14 lw r15,(sp+20) 8009d90: 2b 90 00 10 lw r16,(sp+16) 8009d94: 2b 91 00 0c lw r17,(sp+12) 8009d98: 2b 92 00 08 lw r18,(sp+8) 8009d9c: 37 9c 00 2c addi sp,sp,44 8009da0: c3 a0 00 00 ret =============================================================================== 08009ec4 : * is better to stick to simple, easy to understand algorithms. */ int IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { 8009ec4: 37 9c ff e0 addi sp,sp,-32 8009ec8: 5b 8b 00 20 sw (sp+32),r11 8009ecc: 5b 8c 00 1c sw (sp+28),r12 8009ed0: 5b 8d 00 18 sw (sp+24),r13 8009ed4: 5b 8e 00 14 sw (sp+20),r14 8009ed8: 5b 8f 00 10 sw (sp+16),r15 8009edc: 5b 90 00 0c sw (sp+12),r16 8009ee0: 5b 91 00 08 sw (sp+8),r17 8009ee4: 5b 9d 00 04 sw (sp+4),ra 8009ee8: 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; 8009eec: 78 01 08 01 mvhi r1,0x801 8009ef0: 38 21 36 1c ori r1,r1,0x361c 8009ef4: 28 21 00 00 lw r1,(r1+0) 8009ef8: 34 02 00 02 mvi r2,2 8009efc: f8 00 1a 38 calli 80107dc <__lshrsi3> 8009f00: b8 20 60 00 mv r12,r1 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 8009f04: 29 61 00 58 lw r1,(r11+88) 8009f08: 44 20 00 04 be r1,r0,8009f18 memfile_free_blocks_in_table( &info->indirect, to_free ); 8009f0c: 35 61 00 58 addi r1,r11,88 8009f10: b9 80 10 00 mv r2,r12 8009f14: fb ff ff d0 calli 8009e54 } if ( info->doubly_indirect ) { 8009f18: 29 61 00 5c lw r1,(r11+92) 8009f1c: 44 20 00 15 be r1,r0,8009f70 for ( i=0 ; iindirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { 8009f24: 34 0f 00 00 mvi r15,0 8009f28: 34 0e 00 00 mvi r14,0 for ( i=0 ; i if ( info->doubly_indirect[i] ) { 8009f34: 29 61 00 5c lw r1,(r11+92) 8009f38: b4 2f 08 00 add r1,r1,r15 8009f3c: 28 22 00 00 lw r2,(r1+0) 8009f40: 44 40 00 03 be r2,r0,8009f4c <== NEVER TAKEN memfile_free_blocks_in_table( 8009f44: b9 80 10 00 mv r2,r12 8009f48: fb ff ff c3 calli 8009e54 if ( info->indirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; i 8009f60: 54 2e ff f5 bgu r1,r14,8009f34 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 ); 8009f64: 35 61 00 5c addi r1,r11,92 8009f68: b9 80 10 00 mv r2,r12 8009f6c: fb ff ff ba calli 8009e54 } if ( info->triply_indirect ) { 8009f70: 29 61 00 60 lw r1,(r11+96) 8009f74: 44 20 00 24 be r1,r0,800a004 for ( i=0 ; idoubly_indirect, to_free ); } if ( info->triply_indirect ) { 8009f7c: 34 0f 00 00 mvi r15,0 8009f80: 34 10 00 00 mvi r16,0 for ( i=0 ; i p = (block_p *) info->triply_indirect[i]; 8009f8c: 29 61 00 60 lw r1,(r11+96) 8009f90: b4 2f 08 00 add r1,r1,r15 8009f94: 28 2d 00 00 lw r13,(r1+0) if ( !p ) /* ensure we have a valid pointer */ 8009f98: 45 a0 00 18 be r13,r0,8009ff8 <== NEVER TAKEN 8009f9c: 34 11 00 00 mvi r17,0 8009fa0: e0 00 00 08 bi 8009fc0 break; for ( j=0 ; j <== NEVER TAKEN memfile_free_blocks_in_table( (block_p **)&p[j], to_free); 8009fac: b9 a0 08 00 mv r1,r13 8009fb0: b9 80 10 00 mv r2,r12 8009fb4: fb ff ff a8 calli 8009e54 if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j 8009fcc: 54 31 ff f6 bgu r1,r17,8009fa4 if ( p[j] ) { memfile_free_blocks_in_table( (block_p **)&p[j], to_free); } } memfile_free_blocks_in_table( 8009fd0: 29 61 00 60 lw r1,(r11+96) 8009fd4: b9 80 10 00 mv r2,r12 memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i 8009ff4: 54 30 ff e6 bgu r1,r16,8009f8c } } memfile_free_blocks_in_table( (block_p **)&info->triply_indirect[i], to_free ); } memfile_free_blocks_in_table( 8009ff8: 35 61 00 60 addi r1,r11,96 8009ffc: b9 80 10 00 mv r2,r12 800a000: fb ff ff 95 calli 8009e54 (block_p **)&info->triply_indirect, to_free ); } return 0; } 800a004: 34 01 00 00 mvi r1,0 800a008: 2b 9d 00 04 lw ra,(sp+4) 800a00c: 2b 8b 00 20 lw r11,(sp+32) 800a010: 2b 8c 00 1c lw r12,(sp+28) 800a014: 2b 8d 00 18 lw r13,(sp+24) 800a018: 2b 8e 00 14 lw r14,(sp+20) 800a01c: 2b 8f 00 10 lw r15,(sp+16) 800a020: 2b 90 00 0c lw r16,(sp+12) 800a024: 2b 91 00 08 lw r17,(sp+8) 800a028: 37 9c 00 20 addi sp,sp,32 800a02c: c3 a0 00 00 ret =============================================================================== 0800a1b8 : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 800a1b8: 37 9c ff d0 addi sp,sp,-48 800a1bc: 5b 8b 00 28 sw (sp+40),r11 800a1c0: 5b 8c 00 24 sw (sp+36),r12 800a1c4: 5b 8d 00 20 sw (sp+32),r13 800a1c8: 5b 8e 00 1c sw (sp+28),r14 800a1cc: 5b 8f 00 18 sw (sp+24),r15 800a1d0: 5b 90 00 14 sw (sp+20),r16 800a1d4: 5b 91 00 10 sw (sp+16),r17 800a1d8: 5b 92 00 0c sw (sp+12),r18 800a1dc: 5b 93 00 08 sw (sp+8),r19 800a1e0: 5b 9d 00 04 sw (sp+4),ra 800a1e4: b8 20 58 00 mv r11,r1 * 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 + my_length; if ( last_byte > the_jnode->info.file.size ) { 800a1e8: 28 21 00 50 lw r1,(r1+80) IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 800a1ec: b8 40 60 00 mv r12,r2 800a1f0: b8 60 88 00 mv r17,r3 800a1f4: b8 80 80 00 mv r16,r4 /* * 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 + my_length; 800a1f8: b4 82 10 00 add r2,r4,r2 if ( last_byte > the_jnode->info.file.size ) { 800a1fc: 48 01 00 05 bg r0,r1,800a210 <== NEVER TAKEN 800a200: 5c 20 00 0c bne r1,r0,800a230 <== NEVER TAKEN 800a204: 29 61 00 54 lw r1,(r11+84) 800a208: 54 41 00 02 bgu r2,r1,800a210 <== ALWAYS TAKEN 800a20c: e0 00 00 09 bi 800a230 <== NOT EXECUTED status = IMFS_memfile_extend( the_jnode, last_byte ); 800a210: b9 60 08 00 mv r1,r11 800a214: fb ff ff 93 calli 800a060 if ( status ) 800a218: 44 20 00 06 be r1,r0,800a230 rtems_set_errno_and_return_minus_one( ENOSPC ); 800a21c: f8 00 04 1f calli 800b298 <__errno> 800a220: 34 02 00 1c mvi r2,28 800a224: 58 22 00 00 sw (r1+0),r2 800a228: 34 0c ff ff mvi r12,-1 800a22c: e0 00 00 45 bi 800a340 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800a230: 78 01 08 01 mvhi r1,0x801 800a234: 38 21 36 1c ori r1,r1,0x361c 800a238: 28 33 00 00 lw r19,(r1+0) 800a23c: b9 80 08 00 mv r1,r12 unsigned int last_byte; unsigned int start_offset; int copied; const unsigned char *src; src = source; 800a240: ba 20 78 00 mv r15,r17 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800a244: ba 60 10 00 mv r2,r19 800a248: f8 00 19 c8 calli 8010968 <__modsi3> 800a24c: b8 20 90 00 mv r18,r1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 800a250: ba 60 10 00 mv r2,r19 800a254: b9 80 08 00 mv r1,r12 800a258: f8 00 19 94 calli 80108a8 <__divsi3> 800a25c: b8 20 70 00 mv r14,r1 if ( start_offset ) { 800a260: ba 00 68 00 mv r13,r16 status = IMFS_memfile_extend( the_jnode, last_byte ); if ( status ) rtems_set_errno_and_return_minus_one( ENOSPC ); } copied = 0; 800a264: 34 0c 00 00 mvi r12,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 ) { 800a268: 46 40 00 11 be r18,r0,800a2ac 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 ); 800a26c: b9 60 08 00 mv r1,r11 800a270: b9 c0 10 00 mv r2,r14 800a274: 34 03 00 00 mvi r3,0 800a278: fb ff fd a8 calli 8009918 if ( !block_ptr ) 800a27c: 44 20 00 31 be r1,r0,800a340 <== NEVER TAKEN * 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 ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; 800a280: ca 72 60 00 sub r12,r19,r18 800a284: 52 0c 00 02 bgeu r16,r12,800a28c 800a288: ba 00 60 00 mv r12,r16 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); 800a28c: 28 21 00 00 lw r1,(r1+0) 800a290: ba 20 10 00 mv r2,r17 800a294: b9 80 18 00 mv r3,r12 800a298: b4 32 08 00 add r1,r1,r18 800a29c: f8 00 06 b5 calli 800bd70 src += to_copy; 800a2a0: b6 2c 78 00 add r15,r17,r12 block++; 800a2a4: 35 ce 00 01 addi r14,r14,1 my_length -= to_copy; 800a2a8: ca 0c 68 00 sub r13,r16,r12 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 800a2ac: 78 01 08 01 mvhi r1,0x801 800a2b0: 38 21 36 1c ori r1,r1,0x361c 800a2b4: 28 30 00 00 lw r16,(r1+0) while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800a2b8: b8 20 88 00 mv r17,r1 800a2bc: e0 00 00 0e bi 800a2f4 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800a2c0: b9 60 08 00 mv r1,r11 800a2c4: b9 c0 10 00 mv r2,r14 800a2c8: 34 03 00 00 mvi r3,0 800a2cc: fb ff fd 93 calli 8009918 if ( !block_ptr ) 800a2d0: 44 20 00 1c be r1,r0,800a340 <== 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 ); 800a2d4: 28 21 00 00 lw r1,(r1+0) 800a2d8: b9 e0 10 00 mv r2,r15 800a2dc: ba 00 18 00 mv r3,r16 800a2e0: f8 00 06 a4 calli 800bd70 src += to_copy; 800a2e4: b5 f0 78 00 add r15,r15,r16 block++; 800a2e8: 35 ce 00 01 addi r14,r14,1 my_length -= to_copy; 800a2ec: c9 b0 68 00 sub r13,r13,r16 * IMFS_memfile_write * * 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( 800a2f0: b5 90 60 00 add r12,r12,r16 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800a2f4: 2a 21 00 00 lw r1,(r17+0) 800a2f8: 51 a1 ff f2 bgeu r13,r1,800a2c0 * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); to_copy = my_length; if ( my_length ) { 800a2fc: 45 a0 00 0b be r13,r0,800a328 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800a300: b9 60 08 00 mv r1,r11 800a304: b9 c0 10 00 mv r2,r14 800a308: 34 03 00 00 mvi r3,0 800a30c: fb ff fd 83 calli 8009918 if ( !block_ptr ) 800a310: 44 20 00 0c be r1,r0,800a340 <== 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 ); 800a314: 28 21 00 00 lw r1,(r1+0) 800a318: b9 e0 10 00 mv r2,r15 800a31c: b9 a0 18 00 mv r3,r13 800a320: f8 00 06 94 calli 800bd70 my_length = 0; copied += to_copy; 800a324: b5 8d 60 00 add r12,r12,r13 } IMFS_mtime_ctime_update( the_jnode ); 800a328: 37 81 00 2c addi r1,sp,44 800a32c: 34 02 00 00 mvi r2,0 800a330: fb ff dc 2a calli 80013d8 800a334: 2b 81 00 2c lw r1,(sp+44) 800a338: 59 61 00 44 sw (r11+68),r1 800a33c: 59 61 00 48 sw (r11+72),r1 return copied; } 800a340: b9 80 08 00 mv r1,r12 800a344: 2b 9d 00 04 lw ra,(sp+4) 800a348: 2b 8b 00 28 lw r11,(sp+40) 800a34c: 2b 8c 00 24 lw r12,(sp+36) 800a350: 2b 8d 00 20 lw r13,(sp+32) 800a354: 2b 8e 00 1c lw r14,(sp+28) 800a358: 2b 8f 00 18 lw r15,(sp+24) 800a35c: 2b 90 00 14 lw r16,(sp+20) 800a360: 2b 91 00 10 lw r17,(sp+16) 800a364: 2b 92 00 0c lw r18,(sp+12) 800a368: 2b 93 00 08 lw r19,(sp+8) 800a36c: 37 9c 00 30 addi sp,sp,48 800a370: c3 a0 00 00 ret =============================================================================== 08000b64 : #include int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 8000b64: 37 9c ff fc addi sp,sp,-4 8000b68: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *node; node = mt_entry->mt_point_node.node_access; 8000b6c: 28 22 00 08 lw r2,(r1+8) /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) 8000b70: 34 03 00 01 mvi r3,1 8000b74: 28 44 00 4c lw r4,(r2+76) 8000b78: 44 83 00 06 be r4,r3,8000b90 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOTDIR ); 8000b7c: f8 00 29 c7 calli 800b298 <__errno> <== NOT EXECUTED 8000b80: 34 02 00 14 mvi r2,20 <== NOT EXECUTED 8000b84: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8000b88: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8000b8c: e0 00 00 03 bi 8000b98 <== 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; 8000b90: 58 41 00 5c sw (r2+92),r1 return 0; 8000b94: 34 01 00 00 mvi r1,0 } 8000b98: 2b 9d 00 04 lw ra,(sp+4) 8000b9c: 37 9c 00 04 addi sp,sp,4 8000ba0: c3 a0 00 00 ret =============================================================================== 08003860 : * This routine prints the contents of the specified jnode. */ void IMFS_print_jnode( IMFS_jnode_t *the_jnode ) { 8003860: 37 9c ff f0 addi sp,sp,-16 8003864: 5b 8b 00 10 sw (sp+16),r11 8003868: 5b 8c 00 0c sw (sp+12),r12 800386c: 5b 8d 00 08 sw (sp+8),r13 8003870: 5b 9d 00 04 sw (sp+4),ra IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); 8003874: 78 0c 08 02 mvhi r12,0x802 8003878: 39 8c 61 78 ori r12,r12,0x6178 800387c: 29 82 00 00 lw r2,(r12+0) * This routine prints the contents of the specified jnode. */ void IMFS_print_jnode( IMFS_jnode_t *the_jnode ) { 8003880: b8 20 58 00 mv r11,r1 IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); 8003884: 34 21 00 0c addi r1,r1,12 8003888: 28 42 00 08 lw r2,(r2+8) 800388c: f8 00 32 db calli 80103f8 switch( the_jnode->type ) { 8003890: 29 63 00 4c lw r3,(r11+76) 8003894: 34 02 00 06 mvi r2,6 8003898: 34 61 ff ff addi r1,r3,-1 800389c: 54 22 00 2d bgu r1,r2,8003950 <== NEVER TAKEN 80038a0: 78 0d 08 02 mvhi r13,0x802 80038a4: 34 02 00 02 mvi r2,2 80038a8: f8 00 78 7a calli 8021a90 <__ashlsi3> 80038ac: 39 ad 39 a4 ori r13,r13,0x39a4 80038b0: b5 a1 08 00 add r1,r13,r1 80038b4: 28 21 00 00 lw r1,(r1+0) 80038b8: c0 20 00 00 b r1 case IMFS_DIRECTORY: fprintf(stdout, "/" ); 80038bc: 29 82 00 00 lw r2,(r12+0) 80038c0: 34 01 00 2f mvi r1,47 80038c4: 28 42 00 08 lw r2,(r2+8) 80038c8: f8 00 32 88 calli 80102e8 break; 80038cc: e0 00 00 27 bi 8003968 case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 80038d0: 29 81 00 00 lw r1,(r12+0) 80038d4: 78 02 08 02 mvhi r2,0x802 80038d8: 38 42 38 c0 ori r2,r2,0x38c0 80038dc: 28 21 00 08 lw r1,(r1+8) 80038e0: 29 63 00 50 lw r3,(r11+80) 80038e4: 29 64 00 54 lw r4,(r11+84) 80038e8: e0 00 00 07 bi 8003904 the_jnode->info.device.major, the_jnode->info.device.minor ); break; case IMFS_LINEAR_FILE: fprintf(stdout, " (file %" PRId32 " %p)", 80038ec: 29 81 00 00 lw r1,(r12+0) 80038f0: 29 63 00 54 lw r3,(r11+84) 80038f4: 29 64 00 58 lw r4,(r11+88) 80038f8: 28 21 00 08 lw r1,(r1+8) 80038fc: 78 02 08 02 mvhi r2,0x802 8003900: 38 42 38 d4 ori r2,r2,0x38d4 8003904: f8 00 32 52 calli 801024c (uint32_t)the_jnode->info.linearfile.size, the_jnode->info.linearfile.direct ); break; 8003908: e0 00 00 18 bi 8003968 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 800390c: 29 81 00 00 lw r1,(r12+0) 8003910: 29 63 00 54 lw r3,(r11+84) 8003914: 78 02 08 02 mvhi r2,0x802 8003918: 28 21 00 08 lw r1,(r1+8) 800391c: 38 42 38 e4 ori r2,r2,0x38e4 8003920: f8 00 32 4b calli 801024c (uint32_t)the_jnode->info.file.size ); #endif break; 8003924: e0 00 00 11 bi 8003968 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 8003928: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 800392c: 29 82 00 00 lw r2,(r12+0) <== NOT EXECUTED 8003930: 38 21 38 f0 ori r1,r1,0x38f0 <== NOT EXECUTED 8003934: e0 00 00 04 bi 8003944 <== NOT EXECUTED return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 8003938: 29 82 00 00 lw r2,(r12+0) <== NOT EXECUTED 800393c: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 8003940: 38 21 39 04 ori r1,r1,0x3904 <== NOT EXECUTED 8003944: 28 42 00 08 lw r2,(r2+8) <== NOT EXECUTED 8003948: f8 00 32 ac calli 80103f8 <== NOT EXECUTED return; 800394c: e0 00 00 0a bi 8003974 <== NOT EXECUTED default: fprintf(stdout, " bad type %d\n", the_jnode->type ); 8003950: 29 81 00 00 lw r1,(r12+0) <== NOT EXECUTED 8003954: 78 02 08 02 mvhi r2,0x802 <== NOT EXECUTED 8003958: 38 42 39 18 ori r2,r2,0x3918 <== NOT EXECUTED 800395c: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED 8003960: f8 00 32 3b calli 801024c <== NOT EXECUTED return; 8003964: e0 00 00 04 bi 8003974 <== NOT EXECUTED } puts(""); 8003968: 78 01 08 02 mvhi r1,0x802 800396c: 38 21 34 88 ori r1,r1,0x3488 8003970: f8 00 3a 19 calli 80121d4 } 8003974: 2b 9d 00 04 lw ra,(sp+4) 8003978: 2b 8b 00 10 lw r11,(sp+16) 800397c: 2b 8c 00 0c lw r12,(sp+12) 8003980: 2b 8d 00 08 lw r13,(sp+8) 8003984: 37 9c 00 10 addi sp,sp,16 8003988: c3 a0 00 00 ret =============================================================================== 08000be0 : 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 */ ) { 8000be0: 37 9c ff ec addi sp,sp,-20 8000be4: 5b 8b 00 0c sw (sp+12),r11 8000be8: 5b 8c 00 08 sw (sp+8),r12 8000bec: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *the_jnode; IMFS_jnode_t *new_parent; the_jnode = old_loc->node_access; 8000bf0: 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 */ ) { 8000bf4: 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 ); 8000bf8: b8 80 10 00 mv r2,r4 8000bfc: 35 61 00 0c addi r1,r11,12 8000c00: 34 03 00 20 mvi r3,32 8000c04: f8 00 2e 75 calli 800c5d8 if ( the_jnode->Parent != NULL ) 8000c08: 29 61 00 08 lw r1,(r11+8) 8000c0c: 44 20 00 03 be r1,r0,8000c18 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 8000c10: b9 60 08 00 mv r1,r11 8000c14: f8 00 0a 39 calli 80034f8 <_Chain_Extract> rtems_chain_extract( (rtems_chain_node *) the_jnode ); new_parent = new_parent_loc->node_access; 8000c18: 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 ); 8000c1c: b9 60 10 00 mv r2,r11 the_jnode->Parent = new_parent; 8000c20: 59 61 00 08 sw (r11+8),r1 8000c24: 34 21 00 50 addi r1,r1,80 8000c28: f8 00 0a 28 calli 80034c8 <_Chain_Append> rtems_chain_append( &new_parent->info.directory.Entries, &the_jnode->Node ); /* * Update the time. */ IMFS_update_ctime( the_jnode ); 8000c2c: 37 81 00 10 addi r1,sp,16 8000c30: 34 02 00 00 mvi r2,0 8000c34: f8 00 01 e9 calli 80013d8 8000c38: 2b 81 00 10 lw r1,(sp+16) 8000c3c: 59 61 00 48 sw (r11+72),r1 return 0; } 8000c40: 34 01 00 00 mvi r1,0 8000c44: 2b 9d 00 04 lw ra,(sp+4) 8000c48: 2b 8b 00 0c lw r11,(sp+12) 8000c4c: 2b 8c 00 08 lw r12,(sp+8) 8000c50: 37 9c 00 14 addi sp,sp,20 8000c54: c3 a0 00 00 ret =============================================================================== 08007bec : int IMFS_stat( rtems_filesystem_location_info_t *loc, struct stat *buf ) { 8007bec: 37 9c ff ec addi sp,sp,-20 8007bf0: 5b 8b 00 14 sw (sp+20),r11 8007bf4: 5b 8c 00 10 sw (sp+16),r12 8007bf8: 5b 8d 00 0c sw (sp+12),r13 8007bfc: 5b 8e 00 08 sw (sp+8),r14 8007c00: 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; 8007c04: 28 2b 00 00 lw r11,(r1+0) int IMFS_stat( rtems_filesystem_location_info_t *loc, struct stat *buf ) { 8007c08: b8 20 70 00 mv r14,r1 8007c0c: b8 40 60 00 mv r12,r2 IMFS_device_t *io; the_jnode = loc->node_access; switch ( the_jnode->type ) { 8007c10: 29 61 00 4c lw r1,(r11+76) 8007c14: 34 02 00 05 mvi r2,5 8007c18: 34 21 ff fe addi r1,r1,-2 8007c1c: 54 22 00 12 bgu r1,r2,8007c64 <== NEVER TAKEN 8007c20: 78 0d 08 01 mvhi r13,0x801 8007c24: 34 02 00 02 mvi r2,2 8007c28: f8 00 22 9f calli 80106a4 <__ashlsi3> 8007c2c: 39 ad 1d ac ori r13,r13,0x1dac 8007c30: b5 a1 08 00 add r1,r13,r1 8007c34: 28 21 00 00 lw r1,(r1+0) 8007c38: 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 ); 8007c3c: 29 61 00 54 lw r1,(r11+84) rtems_device_minor_number _minor ) { union __rtems_dev_t temp; temp.__overlay.major = _major; 8007c40: 29 62 00 50 lw r2,(r11+80) 8007c44: 59 81 00 1c sw (r12+28),r1 8007c48: 59 82 00 18 sw (r12+24),r2 break; 8007c4c: e0 00 00 0b bi 8007c78 case IMFS_LINEAR_FILE: case IMFS_MEMORY_FILE: buf->st_size = the_jnode->info.file.size; 8007c50: 29 61 00 54 lw r1,(r11+84) 8007c54: 59 81 00 20 sw (r12+32),r1 break; 8007c58: e0 00 00 08 bi 8007c78 case IMFS_SYM_LINK: buf->st_size = 0; break; case IMFS_FIFO: buf->st_size = 0; 8007c5c: 59 80 00 20 sw (r12+32),r0 break; 8007c60: e0 00 00 06 bi 8007c78 default: rtems_set_errno_and_return_minus_one( ENOTSUP ); 8007c64: f8 00 0d 8d calli 800b298 <__errno> 8007c68: 34 02 00 86 mvi r2,134 8007c6c: 58 22 00 00 sw (r1+0),r2 8007c70: 34 01 ff ff mvi r1,-1 8007c74: e0 00 00 18 bi 8007cd4 /* * The device number of the IMFS is the major number and the minor is the * instance. */ fs_info = loc->mt_entry->fs_info; 8007c78: 29 c1 00 10 lw r1,(r14+16) buf->st_dev = rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); 8007c7c: 28 21 00 34 lw r1,(r1+52) 8007c80: 28 22 00 00 lw r2,(r1+0) 8007c84: 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 = 8007c88: 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; 8007c8c: 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 = 8007c90: 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; 8007c94: 59 81 00 0c sw (r12+12),r1 buf->st_nlink = the_jnode->st_nlink; 8007c98: 2d 61 00 34 lhu r1,(r11+52) 8007c9c: 0d 81 00 10 sh (r12+16),r1 buf->st_ino = the_jnode->st_ino; 8007ca0: 29 61 00 38 lw r1,(r11+56) 8007ca4: 59 81 00 08 sw (r12+8),r1 buf->st_uid = the_jnode->st_uid; 8007ca8: 2d 61 00 3c lhu r1,(r11+60) 8007cac: 0d 81 00 12 sh (r12+18),r1 buf->st_gid = the_jnode->st_gid; 8007cb0: 2d 61 00 3e lhu r1,(r11+62) 8007cb4: 0d 81 00 14 sh (r12+20),r1 buf->st_atime = the_jnode->stat_atime; 8007cb8: 29 61 00 40 lw r1,(r11+64) 8007cbc: 59 81 00 24 sw (r12+36),r1 buf->st_mtime = the_jnode->stat_mtime; 8007cc0: 29 61 00 44 lw r1,(r11+68) 8007cc4: 59 81 00 2c sw (r12+44),r1 buf->st_ctime = the_jnode->stat_ctime; 8007cc8: 29 61 00 48 lw r1,(r11+72) 8007ccc: 59 81 00 34 sw (r12+52),r1 return 0; 8007cd0: 34 01 00 00 mvi r1,0 } 8007cd4: 2b 9d 00 04 lw ra,(sp+4) 8007cd8: 2b 8b 00 14 lw r11,(sp+20) 8007cdc: 2b 8c 00 10 lw r12,(sp+16) 8007ce0: 2b 8d 00 0c lw r13,(sp+12) 8007ce4: 2b 8e 00 08 lw r14,(sp+8) 8007ce8: 37 9c 00 14 addi sp,sp,20 8007cec: c3 a0 00 00 ret =============================================================================== 08000d04 : int IMFS_unlink( rtems_filesystem_location_info_t *parentloc, /* IN */ rtems_filesystem_location_info_t *loc /* IN */ ) { 8000d04: 37 9c ff d0 addi sp,sp,-48 8000d08: 5b 8b 00 14 sw (sp+20),r11 8000d0c: 5b 8c 00 10 sw (sp+16),r12 8000d10: 5b 8d 00 0c sw (sp+12),r13 8000d14: 5b 8e 00 08 sw (sp+8),r14 8000d18: 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; 8000d1c: 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 */ ) { 8000d20: b8 40 58 00 mv r11,r2 8000d24: 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 ) { 8000d28: 29 82 00 4c lw r2,(r12+76) 8000d2c: 34 01 00 03 mvi r1,3 8000d30: 5c 41 00 28 bne r2,r1,8000dd0 if ( !node->info.hard_link.link_node ) 8000d34: 29 81 00 50 lw r1,(r12+80) 8000d38: 5c 20 00 06 bne r1,r0,8000d50 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 8000d3c: f8 00 29 57 calli 800b298 <__errno> <== NOT EXECUTED 8000d40: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8000d44: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8000d48: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8000d4c: e0 00 00 27 bi 8000de8 <== NOT EXECUTED the_link = *loc; 8000d50: 29 64 00 08 lw r4,(r11+8) 8000d54: 29 63 00 0c lw r3,(r11+12) 8000d58: 29 65 00 04 lw r5,(r11+4) 8000d5c: 29 62 00 10 lw r2,(r11+16) the_link.node_access = node->info.hard_link.link_node; IMFS_Set_handlers( &the_link ); 8000d60: 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; 8000d64: 5b 81 00 18 sw (sp+24),r1 IMFS_Set_handlers( &the_link ); 8000d68: 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; 8000d6c: 5b 84 00 20 sw (sp+32),r4 8000d70: 5b 83 00 24 sw (sp+36),r3 8000d74: 5b 85 00 1c sw (sp+28),r5 8000d78: 5b 82 00 28 sw (sp+40),r2 the_link.node_access = node->info.hard_link.link_node; IMFS_Set_handlers( &the_link ); 8000d7c: f8 00 18 82 calli 8006f84 /* * 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) 8000d80: 29 83 00 50 lw r3,(r12+80) 8000d84: 34 01 00 01 mvi r1,1 8000d88: 2c 64 00 34 lhu r4,(r3+52) 8000d8c: 5c 81 00 09 bne r4,r1,8000db0 { result = (*the_link.handlers->rmnod_h)( parentloc, &the_link ); 8000d90: 2b 81 00 20 lw r1,(sp+32) 8000d94: b9 c0 10 00 mv r2,r14 8000d98: 28 23 00 34 lw r3,(r1+52) 8000d9c: b9 a0 08 00 mv r1,r13 8000da0: d8 60 00 00 call r3 if ( result != 0 ) return -1; 8000da4: 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 ) 8000da8: 44 20 00 0a be r1,r0,8000dd0 8000dac: e0 00 00 0f bi 8000de8 return -1; } else { node->info.hard_link.link_node->st_nlink --; 8000db0: 34 84 ff ff addi r4,r4,-1 IMFS_update_ctime( node->info.hard_link.link_node ); 8000db4: 34 02 00 00 mvi r2,0 if ( result != 0 ) return -1; } else { node->info.hard_link.link_node->st_nlink --; 8000db8: 0c 64 00 34 sh (r3+52),r4 IMFS_update_ctime( node->info.hard_link.link_node ); 8000dbc: 37 81 00 2c addi r1,sp,44 8000dc0: f8 00 01 86 calli 80013d8 8000dc4: 29 81 00 50 lw r1,(r12+80) 8000dc8: 2b 82 00 2c lw r2,(sp+44) 8000dcc: 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 ); 8000dd0: 29 61 00 08 lw r1,(r11+8) 8000dd4: b9 60 10 00 mv r2,r11 8000dd8: 28 23 00 34 lw r3,(r1+52) 8000ddc: b9 a0 08 00 mv r1,r13 8000de0: d8 60 00 00 call r3 8000de4: b8 20 10 00 mv r2,r1 return result; } 8000de8: b8 40 08 00 mv r1,r2 8000dec: 2b 9d 00 04 lw ra,(sp+4) 8000df0: 2b 8b 00 14 lw r11,(sp+20) 8000df4: 2b 8c 00 10 lw r12,(sp+16) 8000df8: 2b 8d 00 0c lw r13,(sp+12) 8000dfc: 2b 8e 00 08 lw r14,(sp+8) 8000e00: 37 9c 00 30 addi sp,sp,48 8000e04: c3 a0 00 00 ret =============================================================================== 08000e08 : #include int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 8000e08: 37 9c ff fc addi sp,sp,-4 8000e0c: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *node; node = mt_entry->mt_point_node.node_access; 8000e10: 28 21 00 08 lw r1,(r1+8) /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) 8000e14: 34 02 00 01 mvi r2,1 8000e18: 28 23 00 4c lw r3,(r1+76) 8000e1c: 44 62 00 04 be r3,r2,8000e2c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOTDIR ); 8000e20: f8 00 29 1e calli 800b298 <__errno> <== NOT EXECUTED 8000e24: 34 02 00 14 mvi r2,20 <== NOT EXECUTED 8000e28: e0 00 00 05 bi 8000e3c <== NOT EXECUTED /* * Did the node indicate that there was a directory mounted here? */ if ( node->info.directory.mt_fs == NULL ) 8000e2c: 28 22 00 5c lw r2,(r1+92) 8000e30: 5c 40 00 06 bne r2,r0,8000e48 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); /* XXX */ 8000e34: f8 00 29 19 calli 800b298 <__errno> <== NOT EXECUTED 8000e38: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8000e3c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8000e40: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8000e44: e0 00 00 03 bi 8000e50 <== 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; 8000e48: 58 20 00 5c sw (r1+92),r0 return 0; 8000e4c: 34 01 00 00 mvi r1,0 } 8000e50: 2b 9d 00 04 lw ra,(sp+4) 8000e54: 37 9c 00 04 addi sp,sp,4 8000e58: 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 d4 addi sp,sp,-44 80006a4: 5b 8b 00 24 sw (sp+36),r11 80006a8: 5b 8c 00 20 sw (sp+32),r12 80006ac: 5b 8d 00 1c sw (sp+28),r13 80006b0: 5b 8e 00 18 sw (sp+24),r14 80006b4: 5b 8f 00 14 sw (sp+20),r15 80006b8: 5b 90 00 10 sw (sp+16),r16 80006bc: 5b 91 00 0c sw (sp+12),r17 80006c0: 5b 92 00 08 sw (sp+8),r18 80006c4: 5b 9d 00 04 sw (sp+4),ra 80006c8: b8 20 68 00 mv r13,r1 /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { 80006cc: 34 01 ff ff mvi r1,-1 80006d0: 5d a1 00 08 bne r13,r1,80006f0 if (!Stack_check_Interrupt_stack.area) 80006d4: 78 0c 08 01 mvhi r12,0x801 80006d8: 39 8c 36 c8 ori r12,r12,0x36c8 80006dc: 29 81 00 04 lw r1,(r12+4) return; stack = &Stack_check_Interrupt_stack; the_thread = 0; current = 0; 80006e0: 34 10 00 00 mvi r16,0 #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { if (!Stack_check_Interrupt_stack.area) return; stack = &Stack_check_Interrupt_stack; the_thread = 0; 80006e4: 34 0d 00 00 mvi r13,0 /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { if (!Stack_check_Interrupt_stack.area) 80006e8: 5c 20 00 04 bne r1,r0,80006f8 <== ALWAYS TAKEN 80006ec: e0 00 00 54 bi 800083c <== NOT EXECUTED current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); 80006f0: 29 b0 01 10 lw r16,(r13+272) the_thread = 0; current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; 80006f4: 35 ac 00 c0 addi r12,r13,192 current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); 80006f8: 29 8f 00 00 lw r15,(r12+0) { const uint32_t *base, *ebase; uint32_t length; base = s; length = n/4; 80006fc: 34 02 00 02 mvi r2,2 { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 8000700: 29 8b 00 04 lw r11,(r12+4) size = Stack_check_usable_stack_size(stack); 8000704: 35 ef ff f0 addi r15,r15,-16 { const uint32_t *base, *ebase; uint32_t length; base = s; length = n/4; 8000708: b9 e0 08 00 mv r1,r15 800070c: f8 00 3f a9 calli 80105b0 <__lshrsi3> * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 8000710: 34 02 00 02 mvi r2,2 8000714: f8 00 3f 59 calli 8010478 <__ashlsi3> if (*base != U32_PATTERN) 8000718: 78 03 08 01 mvhi r3,0x801 { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 800071c: 35 71 00 10 addi r17,r11,16 * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) if (*base != U32_PATTERN) 8000720: 38 63 18 d8 ori r3,r3,0x18d8 /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; 8000724: 35 6b 00 20 addi r11,r11,32 for (ebase = base + length; base < ebase; base++) 8000728: b5 61 08 00 add r1,r11,r1 if (*base != U32_PATTERN) 800072c: 28 62 00 00 lw r2,(r3+0) 8000730: e0 00 00 04 bi 8000740 8000734: 29 63 00 00 lw r3,(r11+0) 8000738: 5c 62 00 05 bne r3,r2,800074c * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 800073c: 35 6b 00 04 addi r11,r11,4 8000740: 54 2b ff fd bgu r1,r11,8000734 <== ALWAYS TAKEN high_water_mark = Stack_check_find_high_water_mark(low, size); if ( high_water_mark ) used = Stack_check_Calculate_used( low, size, high_water_mark ); else used = 0; 8000744: 34 0e 00 00 mvi r14,0 <== NOT EXECUTED 8000748: e0 00 00 05 bi 800075c <== NOT EXECUTED 800074c: 34 0e 00 00 mvi r14,0 low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); high_water_mark = Stack_check_find_high_water_mark(low, size); if ( high_water_mark ) 8000750: 45 60 00 03 be r11,r0,800075c <== NEVER TAKEN used = Stack_check_Calculate_used( low, size, high_water_mark ); 8000754: b6 2f 70 00 add r14,r17,r15 8000758: c9 cb 70 00 sub r14,r14,r11 800075c: 78 04 08 01 mvhi r4,0x801 8000760: 78 02 08 01 mvhi r2,0x801 8000764: 38 84 36 30 ori r4,r4,0x3630 8000768: 38 42 36 2c ori r2,r2,0x362c else used = 0; #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) 800076c: 45 a0 00 0f be r13,r0,80007a8 #endif { (*print_handler)( 8000770: 29 ab 00 08 lw r11,(r13+8) 8000774: 28 52 00 00 lw r18,(r2+0) 8000778: 37 83 00 28 addi r3,sp,40 800077c: b9 60 08 00 mv r1,r11 8000780: 34 02 00 05 mvi r2,5 8000784: 28 91 00 00 lw r17,(r4+0) 8000788: f8 00 08 df calli 8002b04 800078c: 78 02 08 01 mvhi r2,0x801 8000790: b8 20 20 00 mv r4,r1 8000794: 38 42 17 40 ori r2,r2,0x1740 8000798: ba 40 08 00 mv r1,r18 800079c: b9 60 18 00 mv r3,r11 80007a0: da 20 00 00 call r17 80007a4: e0 00 00 07 bi 80007c0 rtems_object_get_name( the_thread->Object.id, sizeof(name), name ) ); } #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); 80007a8: 28 41 00 00 lw r1,(r2+0) 80007ac: 28 84 00 00 lw r4,(r4+0) 80007b0: 78 02 08 01 mvhi r2,0x801 80007b4: 38 42 17 50 ori r2,r2,0x1750 80007b8: 34 03 ff ff mvi r3,-1 80007bc: d8 80 00 00 call r4 (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 80007c0: 29 84 00 00 lw r4,(r12+0) else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 80007c4: 78 0b 08 01 mvhi r11,0x801 80007c8: 78 0d 08 01 mvhi r13,0x801 print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 80007cc: 29 83 00 04 lw r3,(r12+4) else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 80007d0: 39 6b 36 30 ori r11,r11,0x3630 80007d4: 39 ad 36 2c ori r13,r13,0x362c 80007d8: 29 67 00 00 lw r7,(r11+0) 80007dc: 29 a1 00 00 lw r1,(r13+0) print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 80007e0: 34 84 ff ff addi r4,r4,-1 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 80007e4: 78 02 08 01 mvhi r2,0x801 80007e8: 38 42 17 60 ori r2,r2,0x1760 80007ec: b4 64 20 00 add r4,r3,r4 80007f0: ba 00 28 00 mv r5,r16 80007f4: b9 e0 30 00 mv r6,r15 80007f8: d8 e0 00 00 call r7 stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 80007fc: 78 01 08 01 mvhi r1,0x801 8000800: 38 21 36 34 ori r1,r1,0x3634 8000804: 28 21 00 00 lw r1,(r1+0) 8000808: 5c 20 00 07 bne r1,r0,8000824 <== ALWAYS TAKEN (*print_handler)( print_context, "Unavailable\n" ); 800080c: 29 63 00 00 lw r3,(r11+0) <== NOT EXECUTED 8000810: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED 8000814: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8000818: 38 42 17 80 ori r2,r2,0x1780 <== NOT EXECUTED 800081c: d8 60 00 00 call r3 <== NOT EXECUTED 8000820: e0 00 00 07 bi 800083c <== NOT EXECUTED } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 8000824: 29 64 00 00 lw r4,(r11+0) 8000828: 29 a1 00 00 lw r1,(r13+0) 800082c: 78 02 08 01 mvhi r2,0x801 8000830: 38 42 17 90 ori r2,r2,0x1790 8000834: b9 c0 18 00 mv r3,r14 8000838: d8 80 00 00 call r4 } } 800083c: 2b 9d 00 04 lw ra,(sp+4) 8000840: 2b 8b 00 24 lw r11,(sp+36) 8000844: 2b 8c 00 20 lw r12,(sp+32) 8000848: 2b 8d 00 1c lw r13,(sp+28) 800084c: 2b 8e 00 18 lw r14,(sp+24) 8000850: 2b 8f 00 14 lw r15,(sp+20) 8000854: 2b 90 00 10 lw r16,(sp+16) 8000858: 2b 91 00 0c lw r17,(sp+12) 800085c: 2b 92 00 08 lw r18,(sp+8) 8000860: 37 9c 00 2c addi sp,sp,44 8000864: c3 a0 00 00 ret =============================================================================== 08000868 : /* * Stack_check_Initialize */ void Stack_check_Initialize( void ) { 8000868: 37 9c ff fc addi sp,sp,-4 800086c: 5b 9d 00 04 sw (sp+4),ra static uint32_t pattern[ 4 ] = { 0xFEEDF00D, 0x0BAD0D06, /* FEED FOOD to BAD DOG */ 0xDEADF00D, 0x600D0D06 /* DEAD FOOD but GOOD DOG */ }; if ( Stack_check_Initialized ) 8000870: 78 01 08 01 mvhi r1,0x801 8000874: 38 21 36 34 ori r1,r1,0x3634 8000878: 28 23 00 00 lw r3,(r1+0) 800087c: 5c 60 00 24 bne r3,r0,800090c /* * Dope the pattern and fill areas */ p = Stack_check_Pattern.pattern; for ( i = 0; i < PATTERN_SIZE_WORDS; i++ ) { p[i] = pattern[ i%4 ]; 8000880: 78 04 08 01 mvhi r4,0x801 8000884: 38 84 18 dc ori r4,r4,0x18dc 8000888: 28 82 00 00 lw r2,(r4+0) 800088c: 78 01 08 01 mvhi r1,0x801 8000890: 78 04 08 01 mvhi r4,0x801 8000894: 38 21 36 b8 ori r1,r1,0x36b8 8000898: 38 84 18 e0 ori r4,r4,0x18e0 800089c: 58 22 00 00 sw (r1+0),r2 80008a0: 28 82 00 00 lw r2,(r4+0) 80008a4: 78 04 08 01 mvhi r4,0x801 80008a8: 38 84 18 e4 ori r4,r4,0x18e4 80008ac: 58 22 00 04 sw (r1+4),r2 80008b0: 28 82 00 00 lw r2,(r4+0) 80008b4: 78 04 08 01 mvhi r4,0x801 80008b8: 38 84 18 e8 ori r4,r4,0x18e8 80008bc: 58 22 00 08 sw (r1+8),r2 80008c0: 28 82 00 00 lw r2,(r4+0) 80008c4: 58 22 00 0c sw (r1+12),r2 /* * If appropriate, setup the interrupt stack for high water testing * also. */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (_CPU_Interrupt_stack_low && _CPU_Interrupt_stack_high) { 80008c8: 78 02 08 01 mvhi r2,0x801 80008cc: 38 42 39 d8 ori r2,r2,0x39d8 80008d0: 28 41 00 00 lw r1,(r2+0) 80008d4: 44 23 00 0a be r1,r3,80008fc <== NEVER TAKEN 80008d8: 28 43 00 04 lw r3,(r2+4) 80008dc: 44 60 00 08 be r3,r0,80008fc <== NEVER TAKEN Stack_check_Interrupt_stack.area = _CPU_Interrupt_stack_low; 80008e0: 78 02 08 01 mvhi r2,0x801 80008e4: 38 42 36 c8 ori r2,r2,0x36c8 Stack_check_Interrupt_stack.size = (char *) _CPU_Interrupt_stack_high - 80008e8: c8 61 18 00 sub r3,r3,r1 * If appropriate, setup the interrupt stack for high water testing * also. */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (_CPU_Interrupt_stack_low && _CPU_Interrupt_stack_high) { Stack_check_Interrupt_stack.area = _CPU_Interrupt_stack_low; 80008ec: 58 41 00 04 sw (r2+4),r1 Stack_check_Interrupt_stack.size = (char *) _CPU_Interrupt_stack_high - 80008f0: 58 43 00 00 sw (r2+0),r3 (char *) _CPU_Interrupt_stack_low; Stack_check_Dope_stack(&Stack_check_Interrupt_stack); 80008f4: 34 02 00 a5 mvi r2,165 80008f8: f8 00 2d 65 calli 800be8c } #endif Stack_check_Initialized = 1; 80008fc: 78 01 08 01 mvhi r1,0x801 8000900: 38 21 36 34 ori r1,r1,0x3634 8000904: 34 02 00 01 mvi r2,1 8000908: 58 22 00 00 sw (r1+0),r2 } 800090c: 2b 9d 00 04 lw ra,(sp+4) 8000910: 37 9c 00 04 addi sp,sp,4 8000914: c3 a0 00 00 ret =============================================================================== 080155d8 <_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 ) { 80155d8: 37 9c ff e4 addi sp,sp,-28 80155dc: 5b 8b 00 1c sw (sp+28),r11 80155e0: 5b 8c 00 18 sw (sp+24),r12 80155e4: 5b 8d 00 14 sw (sp+20),r13 80155e8: 5b 8e 00 10 sw (sp+16),r14 80155ec: 5b 8f 00 0c sw (sp+12),r15 80155f0: 5b 90 00 08 sw (sp+8),r16 80155f4: 5b 9d 00 04 sw (sp+4),ra 80155f8: 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 ) { 80155fc: 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 ) { 8015600: b8 20 58 00 mv r11,r1 8015604: b8 60 68 00 mv r13,r3 8015608: 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; 801560c: 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 ) { 8015610: 54 62 00 13 bgu r3,r2,801565c <_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 ) { 8015614: 29 61 00 48 lw r1,(r11+72) 8015618: 34 0c 00 00 mvi r12,0 801561c: 44 20 00 0a be r1,r0,8015644 <_CORE_message_queue_Broadcast+0x6c> *count = 0; 8015620: 58 c0 00 00 sw (r6+0),r0 8015624: e0 00 00 0d bi 8015658 <_CORE_message_queue_Broadcast+0x80> const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 8015628: 29 c1 00 2c lw r1,(r14+44) 801562c: ba 00 10 00 mv r2,r16 8015630: b9 a0 18 00 mv r3,r13 8015634: f8 00 25 c0 calli 801ed34 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 8015638: 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; 801563c: 35 8c 00 01 addi r12,r12,1 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 8015640: 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 = 8015644: b9 60 08 00 mv r1,r11 8015648: f8 00 0c 15 calli 801869c <_Thread_queue_Dequeue> 801564c: b8 20 70 00 mv r14,r1 8015650: 5c 20 ff f6 bne r1,r0,8015628 <_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; 8015654: 59 ec 00 00 sw (r15+0),r12 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 8015658: 34 01 00 00 mvi r1,0 } 801565c: 2b 9d 00 04 lw ra,(sp+4) 8015660: 2b 8b 00 1c lw r11,(sp+28) 8015664: 2b 8c 00 18 lw r12,(sp+24) 8015668: 2b 8d 00 14 lw r13,(sp+20) 801566c: 2b 8e 00 10 lw r14,(sp+16) 8015670: 2b 8f 00 0c lw r15,(sp+12) 8015674: 2b 90 00 08 lw r16,(sp+8) 8015678: 37 9c 00 1c addi sp,sp,28 801567c: c3 a0 00 00 ret =============================================================================== 0800da48 <_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 ) { 800da48: 37 9c ff e4 addi sp,sp,-28 800da4c: 5b 8b 00 1c sw (sp+28),r11 800da50: 5b 8c 00 18 sw (sp+24),r12 800da54: 5b 8d 00 14 sw (sp+20),r13 800da58: 5b 8e 00 10 sw (sp+16),r14 800da5c: 5b 8f 00 0c sw (sp+12),r15 800da60: 5b 90 00 08 sw (sp+8),r16 800da64: 5b 9d 00 04 sw (sp+4),ra 800da68: 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; 800da6c: 58 20 00 48 sw (r1+72),r0 the_message_queue->maximum_message_size = maximum_message_size; 800da70: 58 24 00 4c sw (r1+76),r4 ) { size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 800da74: 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)) { 800da78: 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 ) { 800da7c: b8 40 80 00 mv r16,r2 800da80: 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)) { 800da84: b8 80 60 00 mv r12,r4 800da88: 44 20 00 06 be r1,r0,800daa0 <_CORE_message_queue_Initialize+0x58> allocated_message_size += sizeof(uint32_t); 800da8c: 34 8c 00 04 addi r12,r4,4 allocated_message_size &= ~(sizeof(uint32_t) - 1); 800da90: 34 01 ff fc mvi r1,-4 800da94: a1 81 60 00 and r12,r12,r1 } if (allocated_message_size < maximum_message_size) return false; 800da98: 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) 800da9c: 54 8c 00 1c bgu r4,r12,800db0c <_CORE_message_queue_Initialize+0xc4><== 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)); 800daa0: 35 8f 00 10 addi r15,r12,16 /* * 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 * 800daa4: b9 e0 08 00 mv r1,r15 800daa8: b9 c0 10 00 mv r2,r14 800daac: f8 00 58 00 calli 8023aac <__mulsi3> (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) return false; 800dab0: 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) 800dab4: 55 81 00 16 bgu r12,r1,800db0c <_CORE_message_queue_Initialize+0xc4><== NEVER TAKEN /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); 800dab8: f8 00 0e 00 calli 80112b8 <_Workspace_Allocate> return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 800dabc: 59 61 00 5c sw (r11+92),r1 _Workspace_Allocate( message_buffering_required ); 800dac0: b8 20 28 00 mv r5,r1 if (the_message_queue->message_buffers == 0) 800dac4: 44 20 00 12 be r1,r0,800db0c <_CORE_message_queue_Initialize+0xc4> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 800dac8: b8 a0 10 00 mv r2,r5 800dacc: 35 61 00 60 addi r1,r11,96 800dad0: b9 c0 18 00 mv r3,r14 800dad4: b9 e0 20 00 mv r4,r15 800dad8: f8 00 16 ad calli 801358c <_Chain_Initialize> allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 800dadc: 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; 800dae0: 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); 800dae4: 59 61 00 50 sw (r11+80),r1 800dae8: 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 ); 800daec: 35 61 00 50 addi r1,r11,80 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 800daf0: 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; 800daf4: 59 60 00 54 sw (r11+84),r0 _Thread_queue_Initialize( 800daf8: b9 60 08 00 mv r1,r11 800dafc: 34 03 00 80 mvi r3,128 800db00: 34 04 00 06 mvi r4,6 800db04: f8 00 0a 25 calli 8010398 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 800db08: 34 0d 00 01 mvi r13,1 } 800db0c: b9 a0 08 00 mv r1,r13 800db10: 2b 9d 00 04 lw ra,(sp+4) 800db14: 2b 8b 00 1c lw r11,(sp+28) 800db18: 2b 8c 00 18 lw r12,(sp+24) 800db1c: 2b 8d 00 14 lw r13,(sp+20) 800db20: 2b 8e 00 10 lw r14,(sp+16) 800db24: 2b 8f 00 0c lw r15,(sp+12) 800db28: 2b 90 00 08 lw r16,(sp+8) 800db2c: 37 9c 00 1c addi sp,sp,28 800db30: c3 a0 00 00 ret =============================================================================== 0800db34 <_CORE_message_queue_Seize>: void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800db34: 37 9c ff f4 addi sp,sp,-12 800db38: 5b 8b 00 0c sw (sp+12),r11 800db3c: 5b 8c 00 08 sw (sp+8),r12 800db40: 5b 9d 00 04 sw (sp+4),ra ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 800db44: 78 07 08 02 mvhi r7,0x802 800db48: 38 e7 7b 88 ori r7,r7,0x7b88 800db4c: 28 e7 00 0c lw r7,(r7+12) void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800db50: b8 20 58 00 mv r11,r1 800db54: 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; 800db58: 58 e0 00 34 sw (r7+52),r0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800db5c: 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 ); 800db60: 90 00 40 00 rcsr r8,IE 800db64: 34 03 ff fe mvi r3,-2 800db68: a1 03 18 00 and r3,r8,r3 800db6c: 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)); 800db70: 29 6c 00 50 lw r12,(r11+80) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 800db74: 35 63 00 54 addi r3,r11,84 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 800db78: 45 83 00 07 be r12,r3,800db94 <_CORE_message_queue_Seize+0x60> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 800db7c: 29 83 00 00 lw r3,(r12+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 ); 800db80: 35 69 00 50 addi r9,r11,80 the_chain->first = new_first; 800db84: 59 63 00 50 sw (r11+80),r3 new_first->previous = _Chain_Head(the_chain); 800db88: 58 69 00 04 sw (r3+4),r9 the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { 800db8c: 5d 80 00 04 bne r12,r0,800db9c <_CORE_message_queue_Seize+0x68><== ALWAYS TAKEN 800db90: e0 00 00 13 bi 800dbdc <_CORE_message_queue_Seize+0xa8> <== NOT EXECUTED ) { if ( !_Chain_Is_empty(the_chain)) return _Chain_Get_first_unprotected(the_chain); else return NULL; 800db94: 34 0c 00 00 mvi r12,0 800db98: e0 00 00 11 bi 800dbdc <_CORE_message_queue_Seize+0xa8> the_message_queue->number_of_pending_messages -= 1; 800db9c: 29 62 00 48 lw r2,(r11+72) 800dba0: 34 42 ff ff addi r2,r2,-1 800dba4: 59 62 00 48 sw (r11+72),r2 _ISR_Enable( level ); 800dba8: d0 08 00 00 wcsr IE,r8 *size_p = the_message->Contents.size; _Thread_Executing->Wait.count = 800dbac: 78 02 08 02 mvhi r2,0x802 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; 800dbb0: 29 83 00 08 lw r3,(r12+8) _Thread_Executing->Wait.count = 800dbb4: 38 42 7b 88 ori r2,r2,0x7b88 800dbb8: 28 42 00 0c lw r2,(r2+12) 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; 800dbbc: 58 83 00 00 sw (r4+0),r3 _Thread_Executing->Wait.count = 800dbc0: 58 40 00 24 sw (r2+36),r0 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 800dbc4: 35 82 00 0c addi r2,r12,12 800dbc8: f8 00 22 77 calli 80165a4 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 ); 800dbcc: 35 61 00 60 addi r1,r11,96 800dbd0: b9 80 10 00 mv r2,r12 800dbd4: fb ff ff 6d calli 800d988 <_Chain_Append> /* * There is not an API with blocking sends enabled. * So return immediately. */ _CORE_message_queue_Free_message_buffer(the_message_queue, the_message); return; 800dbd8: e0 00 00 12 bi 800dc20 <_CORE_message_queue_Seize+0xec> return; } #endif } if ( !wait ) { 800dbdc: 5c ac 00 05 bne r5,r12,800dbf0 <_CORE_message_queue_Seize+0xbc> _ISR_Enable( level ); 800dbe0: d0 08 00 00 wcsr IE,r8 executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 800dbe4: 34 01 00 04 mvi r1,4 800dbe8: 58 e1 00 34 sw (r7+52),r1 return; 800dbec: e0 00 00 0d bi 800dc20 <_CORE_message_queue_Seize+0xec> 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; 800dbf0: 34 03 00 01 mvi r3,1 800dbf4: 59 63 00 30 sw (r11+48),r3 } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 800dbf8: 58 eb 00 44 sw (r7+68),r11 executing->Wait.id = id; 800dbfc: 58 e2 00 20 sw (r7+32),r2 executing->Wait.return_argument_second.mutable_object = buffer; 800dc00: 58 e1 00 2c sw (r7+44),r1 executing->Wait.return_argument = size_p; 800dc04: 58 e4 00 28 sw (r7+40),r4 /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 800dc08: d0 08 00 00 wcsr IE,r8 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 800dc0c: 78 03 08 01 mvhi r3,0x801 800dc10: b9 60 08 00 mv r1,r11 800dc14: b8 c0 10 00 mv r2,r6 800dc18: 38 63 04 d8 ori r3,r3,0x4d8 800dc1c: f8 00 08 f3 calli 800ffe8 <_Thread_queue_Enqueue_with_handler> } 800dc20: 2b 9d 00 04 lw ra,(sp+4) 800dc24: 2b 8b 00 0c lw r11,(sp+12) 800dc28: 2b 8c 00 08 lw r12,(sp+8) 800dc2c: 37 9c 00 0c addi sp,sp,12 800dc30: c3 a0 00 00 ret =============================================================================== 08003698 <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 8003698: 37 9c ff e8 addi sp,sp,-24 800369c: 5b 8b 00 14 sw (sp+20),r11 80036a0: 5b 8c 00 10 sw (sp+16),r12 80036a4: 5b 8d 00 0c sw (sp+12),r13 80036a8: 5b 8e 00 08 sw (sp+8),r14 80036ac: 5b 9d 00 04 sw (sp+4),ra 80036b0: b8 20 58 00 mv r11,r1 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 80036b4: 78 01 08 01 mvhi r1,0x801 80036b8: 38 21 38 1c ori r1,r1,0x381c 80036bc: 28 21 00 00 lw r1,(r1+0) Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 80036c0: 5b 85 00 18 sw (sp+24),r5 80036c4: b8 40 70 00 mv r14,r2 80036c8: b8 80 68 00 mv r13,r4 80036cc: 20 6c 00 ff andi r12,r3,0xff _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 80036d0: 44 20 00 0b be r1,r0,80036fc <_CORE_mutex_Seize+0x64> 80036d4: 45 80 00 0a be r12,r0,80036fc <_CORE_mutex_Seize+0x64> <== NEVER TAKEN 80036d8: 78 01 08 01 mvhi r1,0x801 80036dc: 38 21 39 9c ori r1,r1,0x399c 80036e0: 28 21 00 00 lw r1,(r1+0) 80036e4: 34 02 00 01 mvi r2,1 80036e8: 50 41 00 05 bgeu r2,r1,80036fc <_CORE_mutex_Seize+0x64> 80036ec: 34 01 00 00 mvi r1,0 80036f0: 34 02 00 00 mvi r2,0 80036f4: 34 03 00 12 mvi r3,18 80036f8: f8 00 02 2c calli 8003fa8 <_Internal_error_Occurred> 80036fc: b9 60 08 00 mv r1,r11 8003700: 37 82 00 18 addi r2,sp,24 8003704: f8 00 15 3f calli 8008c00 <_CORE_mutex_Seize_interrupt_trylock> 8003708: 44 20 00 19 be r1,r0,800376c <_CORE_mutex_Seize+0xd4> 800370c: 78 01 08 01 mvhi r1,0x801 8003710: 38 21 39 e8 ori r1,r1,0x39e8 8003714: 5d 80 00 07 bne r12,r0,8003730 <_CORE_mutex_Seize+0x98> 8003718: 2b 82 00 18 lw r2,(sp+24) 800371c: d0 02 00 00 wcsr IE,r2 8003720: 28 21 00 0c lw r1,(r1+12) 8003724: 34 02 00 01 mvi r2,1 8003728: 58 22 00 34 sw (r1+52),r2 800372c: e0 00 00 10 bi 800376c <_CORE_mutex_Seize+0xd4> 8003730: 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; 8003734: 34 02 00 01 mvi r2,1 8003738: 59 62 00 30 sw (r11+48),r2 800373c: 58 2b 00 44 sw (r1+68),r11 8003740: 58 2e 00 20 sw (r1+32),r14 8003744: 78 01 08 01 mvhi r1,0x801 8003748: 38 21 38 1c ori r1,r1,0x381c 800374c: 28 22 00 00 lw r2,(r1+0) 8003750: 34 42 00 01 addi r2,r2,1 8003754: 58 22 00 00 sw (r1+0),r2 8003758: 2b 81 00 18 lw r1,(sp+24) 800375c: d0 01 00 00 wcsr IE,r1 8003760: b9 60 08 00 mv r1,r11 8003764: b9 a0 10 00 mv r2,r13 8003768: fb ff ff ab calli 8003614 <_CORE_mutex_Seize_interrupt_blocking> } 800376c: 2b 9d 00 04 lw ra,(sp+4) 8003770: 2b 8b 00 14 lw r11,(sp+20) 8003774: 2b 8c 00 10 lw r12,(sp+16) 8003778: 2b 8d 00 0c lw r13,(sp+12) 800377c: 2b 8e 00 08 lw r14,(sp+8) 8003780: 37 9c 00 18 addi sp,sp,24 8003784: c3 a0 00 00 ret =============================================================================== 08008c00 <_CORE_mutex_Seize_interrupt_trylock>: #if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__) int _CORE_mutex_Seize_interrupt_trylock( CORE_mutex_Control *the_mutex, ISR_Level *level_p ) { 8008c00: 37 9c ff fc addi sp,sp,-4 8008c04: 5b 9d 00 04 sw (sp+4),ra 8008c08: b8 20 18 00 mv r3,r1 { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 8008c0c: 78 01 08 01 mvhi r1,0x801 8008c10: 38 21 39 e8 ori r1,r1,0x39e8 8008c14: 28 24 00 0c lw r4,(r1+12) executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 8008c18: 28 61 00 50 lw r1,(r3+80) Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; 8008c1c: 58 80 00 34 sw (r4+52),r0 if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 8008c20: 44 20 00 31 be r1,r0,8008ce4 <_CORE_mutex_Seize_interrupt_trylock+0xe4> the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; 8008c24: 28 81 00 08 lw r1,(r4+8) /* disabled when you get here */ executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; 8008c28: 58 60 00 50 sw (r3+80),r0 the_mutex->holder = executing; 8008c2c: 58 64 00 5c sw (r3+92),r4 the_mutex->holder_id = executing->Object.id; 8008c30: 58 61 00 60 sw (r3+96),r1 the_mutex->nest_count = 1; 8008c34: 34 01 00 01 mvi r1,1 8008c38: 58 61 00 54 sw (r3+84),r1 return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); } 8008c3c: 28 61 00 48 lw r1,(r3+72) if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 8008c40: 34 05 00 02 mvi r5,2 8008c44: 44 25 00 03 be r1,r5,8008c50 <_CORE_mutex_Seize_interrupt_trylock+0x50> 8008c48: 34 05 00 03 mvi r5,3 8008c4c: 5c 25 00 06 bne r1,r5,8008c64 <_CORE_mutex_Seize_interrupt_trylock+0x64> _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 8008c50: 28 85 00 1c lw r5,(r4+28) 8008c54: 34 a6 00 01 addi r6,r5,1 8008c58: 58 86 00 1c sw (r4+28),r6 } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { 8008c5c: 34 06 00 03 mvi r6,3 8008c60: 44 26 00 04 be r1,r6,8008c70 <_CORE_mutex_Seize_interrupt_trylock+0x70> _ISR_Enable( *level_p ); 8008c64: 28 41 00 00 lw r1,(r2+0) 8008c68: d0 01 00 00 wcsr IE,r1 8008c6c: e0 00 00 2f bi 8008d28 <_CORE_mutex_Seize_interrupt_trylock+0x128> */ { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; 8008c70: 28 66 00 4c lw r6,(r3+76) current = executing->current_priority; 8008c74: 28 81 00 14 lw r1,(r4+20) if ( current == ceiling ) { 8008c78: 5c 26 00 04 bne r1,r6,8008c88 <_CORE_mutex_Seize_interrupt_trylock+0x88> _ISR_Enable( *level_p ); 8008c7c: 28 41 00 00 lw r1,(r2+0) 8008c80: d0 01 00 00 wcsr IE,r1 8008c84: e0 00 00 29 bi 8008d28 <_CORE_mutex_Seize_interrupt_trylock+0x128> return 0; } if ( current > ceiling ) { 8008c88: 50 c1 00 0e bgeu r6,r1,8008cc0 <_CORE_mutex_Seize_interrupt_trylock+0xc0> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8008c8c: 78 01 08 01 mvhi r1,0x801 8008c90: 38 21 38 1c ori r1,r1,0x381c 8008c94: 28 24 00 00 lw r4,(r1+0) 8008c98: 34 84 00 01 addi r4,r4,1 8008c9c: 58 24 00 00 sw (r1+0),r4 _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); 8008ca0: 28 41 00 00 lw r1,(r2+0) 8008ca4: d0 01 00 00 wcsr IE,r1 _Thread_Change_priority( 8008ca8: 28 61 00 5c lw r1,(r3+92) 8008cac: 28 62 00 4c lw r2,(r3+76) 8008cb0: 34 03 00 00 mvi r3,0 8008cb4: fb ff ef 83 calli 8004ac0 <_Thread_Change_priority> the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch(); 8008cb8: fb ff f0 d6 calli 8005010 <_Thread_Enable_dispatch> 8008cbc: e0 00 00 1b bi 8008d28 <_CORE_mutex_Seize_interrupt_trylock+0x128> return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 8008cc0: 34 01 00 06 mvi r1,6 8008cc4: 58 81 00 34 sw (r4+52),r1 the_mutex->lock = CORE_MUTEX_UNLOCKED; 8008cc8: 34 01 00 01 mvi r1,1 8008ccc: 58 61 00 50 sw (r3+80),r1 the_mutex->nest_count = 0; /* undo locking above */ 8008cd0: 58 60 00 54 sw (r3+84),r0 executing->resource_count--; /* undo locking above */ 8008cd4: 58 85 00 1c sw (r4+28),r5 _ISR_Enable( *level_p ); 8008cd8: 28 41 00 00 lw r1,(r2+0) 8008cdc: d0 01 00 00 wcsr IE,r1 8008ce0: e0 00 00 12 bi 8008d28 <_CORE_mutex_Seize_interrupt_trylock+0x128> /* * At this point, we know the mutex was not available. If this thread * is the thread that has locked the mutex, let's see if we are allowed * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { 8008ce4: 28 65 00 5c lw r5,(r3+92) /* * The mutex is not available and the caller must deal with the possibility * of blocking. */ return 1; 8008ce8: 34 01 00 01 mvi r1,1 /* * At this point, we know the mutex was not available. If this thread * is the thread that has locked the mutex, let's see if we are allowed * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { 8008cec: 5c a4 00 10 bne r5,r4,8008d2c <_CORE_mutex_Seize_interrupt_trylock+0x12c> switch ( the_mutex->Attributes.lock_nesting_behavior ) { 8008cf0: 28 64 00 40 lw r4,(r3+64) 8008cf4: 44 80 00 03 be r4,r0,8008d00 <_CORE_mutex_Seize_interrupt_trylock+0x100> 8008cf8: 5c 81 00 0d bne r4,r1,8008d2c <_CORE_mutex_Seize_interrupt_trylock+0x12c><== ALWAYS TAKEN 8008cfc: e0 00 00 07 bi 8008d18 <_CORE_mutex_Seize_interrupt_trylock+0x118><== NOT EXECUTED case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; 8008d00: 28 61 00 54 lw r1,(r3+84) 8008d04: 34 21 00 01 addi r1,r1,1 8008d08: 58 61 00 54 sw (r3+84),r1 _ISR_Enable( *level_p ); 8008d0c: 28 41 00 00 lw r1,(r2+0) 8008d10: d0 01 00 00 wcsr IE,r1 8008d14: e0 00 00 05 bi 8008d28 <_CORE_mutex_Seize_interrupt_trylock+0x128> return 0; case CORE_MUTEX_NESTING_IS_ERROR: executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; 8008d18: 34 01 00 02 mvi r1,2 <== NOT EXECUTED 8008d1c: 58 a1 00 34 sw (r5+52),r1 <== NOT EXECUTED _ISR_Enable( *level_p ); 8008d20: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 8008d24: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED return 0; 8008d28: 34 01 00 00 mvi r1,0 8008d2c: 2b 9d 00 04 lw ra,(sp+4) 8008d30: 37 9c 00 04 addi sp,sp,4 8008d34: c3 a0 00 00 ret =============================================================================== 080038e8 <_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 ) { 80038e8: 37 9c ff f8 addi sp,sp,-8 80038ec: 5b 8b 00 08 sw (sp+8),r11 80038f0: 5b 9d 00 04 sw (sp+4),ra 80038f4: 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)) ) { 80038f8: f8 00 06 bf calli 80053f4 <_Thread_queue_Dequeue> { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 80038fc: 34 02 00 00 mvi r2,0 if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 8003900: 5c 20 00 0d bne r1,r0,8003934 <_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 ); 8003904: 90 00 08 00 rcsr r1,IE 8003908: 34 02 ff fe mvi r2,-2 800390c: a0 22 10 00 and r2,r1,r2 8003910: d0 02 00 00 wcsr IE,r2 if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 8003914: 29 63 00 48 lw r3,(r11+72) 8003918: 29 64 00 40 lw r4,(r11+64) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 800391c: 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 ) 8003920: 50 64 00 04 bgeu r3,r4,8003930 <_CORE_semaphore_Surrender+0x48><== NEVER TAKEN the_semaphore->count += 1; 8003924: 34 63 00 01 addi r3,r3,1 8003928: 59 63 00 48 sw (r11+72),r3 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 800392c: 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 ); 8003930: d0 01 00 00 wcsr IE,r1 } return status; } 8003934: b8 40 08 00 mv r1,r2 8003938: 2b 9d 00 04 lw ra,(sp+4) 800393c: 2b 8b 00 08 lw r11,(sp+8) 8003940: 37 9c 00 08 addi sp,sp,8 8003944: c3 a0 00 00 ret =============================================================================== 08003c4c <_Chain_Get_with_empty_check>: ) { ISR_Level level; bool is_empty_now; _ISR_Disable( level ); 8003c4c: 90 00 28 00 rcsr r5,IE 8003c50: 34 03 ff fe mvi r3,-2 8003c54: a0 a3 18 00 and r3,r5,r3 8003c58: d0 03 00 00 wcsr IE,r3 Chain_Control *the_chain, Chain_Node **the_node ) { bool is_empty_now = true; Chain_Node *first = the_chain->first; 8003c5c: 28 24 00 00 lw r4,(r1+0) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8003c60: 34 26 00 04 addi r6,r1,4 ) { bool is_empty_now = true; Chain_Node *first = the_chain->first; if ( first != _Chain_Tail( the_chain ) ) { 8003c64: 44 86 00 07 be r4,r6,8003c80 <_Chain_Get_with_empty_check+0x34><== NEVER TAKEN Chain_Node *new_first = first->next; 8003c68: 28 83 00 00 lw r3,(r4+0) the_chain->first = new_first; 8003c6c: 58 23 00 00 sw (r1+0),r3 new_first->previous = _Chain_Head( the_chain ); 8003c70: 58 61 00 04 sw (r3+4),r1 *the_node = first; 8003c74: 58 44 00 00 sw (r2+0),r4 is_empty_now = new_first == _Chain_Tail( the_chain ); 8003c78: e4 66 08 00 cmpe r1,r3,r6 8003c7c: e0 00 00 03 bi 8003c88 <_Chain_Get_with_empty_check+0x3c> } else *the_node = NULL; 8003c80: 58 40 00 00 sw (r2+0),r0 <== NOT EXECUTED RTEMS_INLINE_ROUTINE bool _Chain_Get_with_empty_check_unprotected( Chain_Control *the_chain, Chain_Node **the_node ) { bool is_empty_now = true; 8003c84: 34 01 00 01 mvi r1,1 <== NOT EXECUTED is_empty_now = _Chain_Get_with_empty_check_unprotected( chain, node ); _ISR_Enable( level ); 8003c88: d0 05 00 00 wcsr IE,r5 return is_empty_now; } 8003c8c: c3 a0 00 00 ret =============================================================================== 0800cc3c <_Event_Surrender>: */ void _Event_Surrender( Thread_Control *the_thread ) { 800cc3c: 37 9c ff f8 addi sp,sp,-8 800cc40: 5b 8b 00 08 sw (sp+8),r11 800cc44: 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 ]; 800cc48: 28 24 01 24 lw r4,(r1+292) option_set = (rtems_option) the_thread->Wait.option; 800cc4c: 28 28 00 30 lw r8,(r1+48) */ void _Event_Surrender( Thread_Control *the_thread ) { 800cc50: 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 ); 800cc54: 90 00 08 00 rcsr r1,IE 800cc58: 34 07 ff fe mvi r7,-2 800cc5c: a0 27 38 00 and r7,r1,r7 800cc60: d0 07 00 00 wcsr IE,r7 pending_events = api->pending_events; 800cc64: 28 85 00 00 lw r5,(r4+0) event_condition = (rtems_event_set) the_thread->Wait.count; 800cc68: 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 ); 800cc6c: 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 ) ) { 800cc70: 5c 40 00 03 bne r2,r0,800cc7c <_Event_Surrender+0x40> _ISR_Enable( level ); 800cc74: d0 01 00 00 wcsr IE,r1 return; 800cc78: e0 00 00 3d bi 800cd6c <_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() && 800cc7c: 78 03 08 01 mvhi r3,0x801 800cc80: 38 63 8a 68 ori r3,r3,0x8a68 800cc84: 28 69 00 08 lw r9,(r3+8) 800cc88: 45 20 00 1a be r9,r0,800ccf0 <_Event_Surrender+0xb4> 800cc8c: 28 63 00 0c lw r3,(r3+12) 800cc90: 5d 63 00 18 bne r11,r3,800ccf0 <_Event_Surrender+0xb4> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 800cc94: 78 03 08 01 mvhi r3,0x801 800cc98: 38 63 8b 94 ori r3,r3,0x8b94 800cc9c: 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 ) && 800cca0: 34 09 00 02 mvi r9,2 800cca4: 45 49 00 04 be r10,r9,800ccb4 <_Event_Surrender+0x78> <== NEVER TAKEN ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 800cca8: 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) || 800ccac: 34 03 00 01 mvi r3,1 800ccb0: 5d 23 00 10 bne r9,r3,800ccf0 <_Event_Surrender+0xb4> <== NEVER TAKEN (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 800ccb4: 44 46 00 03 be r2,r6,800ccc0 <_Event_Surrender+0x84> */ RTEMS_INLINE_ROUTINE bool _Options_Is_any ( rtems_option option_set ) { return (option_set & RTEMS_EVENT_ANY) ? true : false; 800ccb8: 21 08 00 02 andi r8,r8,0x2 800ccbc: 45 00 00 0b be r8,r0,800cce8 <_Event_Surrender+0xac> <== 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) ); 800ccc0: a4 40 18 00 not r3,r2 800ccc4: 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; 800ccc8: 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 ); 800cccc: 58 85 00 00 sw (r4+0),r5 the_thread->Wait.count = 0; 800ccd0: 59 60 00 24 sw (r11+36),r0 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800ccd4: 58 62 00 00 sw (r3+0),r2 _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 800ccd8: 78 02 08 01 mvhi r2,0x801 800ccdc: 38 42 8b 94 ori r2,r2,0x8b94 800cce0: 34 03 00 03 mvi r3,3 800cce4: 58 43 00 00 sw (r2+0),r3 } _ISR_Enable( level ); 800cce8: d0 01 00 00 wcsr IE,r1 return; 800ccec: e0 00 00 20 bi 800cd6c <_Event_Surrender+0x130> */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_event ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_EVENT); 800ccf0: 29 63 00 10 lw r3,(r11+16) 800ccf4: 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 ) ) { 800ccf8: 44 60 00 1c be r3,r0,800cd68 <_Event_Surrender+0x12c> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 800ccfc: 44 46 00 03 be r2,r6,800cd08 <_Event_Surrender+0xcc> 800cd00: 21 08 00 02 andi r8,r8,0x2 800cd04: 45 00 00 19 be r8,r0,800cd68 <_Event_Surrender+0x12c> <== NEVER TAKEN 800cd08: a4 40 18 00 not r3,r2 800cd0c: 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; 800cd10: 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 ); 800cd14: 58 85 00 00 sw (r4+0),r5 the_thread->Wait.count = 0; 800cd18: 59 60 00 24 sw (r11+36),r0 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800cd1c: 58 62 00 00 sw (r3+0),r2 _ISR_Flash( level ); 800cd20: d0 01 00 00 wcsr IE,r1 800cd24: d0 07 00 00 wcsr IE,r7 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 800cd28: 29 63 00 50 lw r3,(r11+80) 800cd2c: 34 02 00 02 mvi r2,2 800cd30: 44 62 00 03 be r3,r2,800cd3c <_Event_Surrender+0x100> _ISR_Enable( level ); 800cd34: d0 01 00 00 wcsr IE,r1 800cd38: e0 00 00 06 bi 800cd50 <_Event_Surrender+0x114> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 800cd3c: 34 02 00 03 mvi r2,3 800cd40: 59 62 00 50 sw (r11+80),r2 _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 800cd44: d0 01 00 00 wcsr IE,r1 (void) _Watchdog_Remove( &the_thread->Timer ); 800cd48: 35 61 00 48 addi r1,r11,72 800cd4c: fb ff eb 0c calli 800797c <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800cd50: 78 03 08 01 mvhi r3,0x801 800cd54: 38 63 6c f4 ori r3,r3,0x6cf4 800cd58: 28 62 00 00 lw r2,(r3+0) 800cd5c: b9 60 08 00 mv r1,r11 800cd60: f8 00 05 05 calli 800e174 <_Thread_Clear_state> 800cd64: e0 00 00 02 bi 800cd6c <_Event_Surrender+0x130> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 800cd68: d0 01 00 00 wcsr IE,r1 } 800cd6c: 2b 9d 00 04 lw ra,(sp+4) 800cd70: 2b 8b 00 08 lw r11,(sp+8) 800cd74: 37 9c 00 08 addi sp,sp,8 800cd78: c3 a0 00 00 ret =============================================================================== 0800cd7c <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 800cd7c: 37 9c ff f8 addi sp,sp,-8 800cd80: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 800cd84: 37 82 00 08 addi r2,sp,8 800cd88: fb ff e5 d3 calli 80064d4 <_Thread_Get> switch ( location ) { 800cd8c: 2b 82 00 08 lw r2,(sp+8) 800cd90: 5c 40 00 1d bne r2,r0,800ce04 <_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 ); 800cd94: 90 00 18 00 rcsr r3,IE 800cd98: 34 02 ff fe mvi r2,-2 800cd9c: a0 62 10 00 and r2,r3,r2 800cda0: d0 02 00 00 wcsr IE,r2 RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 800cda4: 78 02 08 01 mvhi r2,0x801 800cda8: 38 42 8a 68 ori r2,r2,0x8a68 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 800cdac: 28 42 00 0c lw r2,(r2+12) _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 800cdb0: 58 20 00 24 sw (r1+36),r0 if ( _Thread_Is_executing( the_thread ) ) { 800cdb4: 5c 22 00 08 bne r1,r2,800cdd4 <_Event_Timeout+0x58> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 800cdb8: 78 02 08 01 mvhi r2,0x801 800cdbc: 38 42 8b 94 ori r2,r2,0x8b94 800cdc0: 28 45 00 00 lw r5,(r2+0) 800cdc4: 34 04 00 01 mvi r4,1 800cdc8: 5c a4 00 03 bne r5,r4,800cdd4 <_Event_Timeout+0x58> <== ALWAYS TAKEN _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800cdcc: 34 04 00 02 mvi r4,2 <== NOT EXECUTED 800cdd0: 58 44 00 00 sw (r2+0),r4 <== NOT EXECUTED } the_thread->Wait.return_code = RTEMS_TIMEOUT; 800cdd4: 34 02 00 06 mvi r2,6 800cdd8: 58 22 00 34 sw (r1+52),r2 _ISR_Enable( level ); 800cddc: d0 03 00 00 wcsr IE,r3 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800cde0: 78 03 08 01 mvhi r3,0x801 800cde4: 38 63 6c f4 ori r3,r3,0x6cf4 800cde8: 28 62 00 00 lw r2,(r3+0) 800cdec: f8 00 04 e2 calli 800e174 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 800cdf0: 78 01 08 01 mvhi r1,0x801 800cdf4: 38 21 88 9c ori r1,r1,0x889c 800cdf8: 28 22 00 00 lw r2,(r1+0) 800cdfc: 34 42 ff ff addi r2,r2,-1 800ce00: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 800ce04: 2b 9d 00 04 lw ra,(sp+4) 800ce08: 37 9c 00 08 addi sp,sp,8 800ce0c: c3 a0 00 00 ret =============================================================================== 080091b8 <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { 80091b8: 37 9c ff b8 addi sp,sp,-72 80091bc: 5b 8b 00 40 sw (sp+64),r11 80091c0: 5b 8c 00 3c sw (sp+60),r12 80091c4: 5b 8d 00 38 sw (sp+56),r13 80091c8: 5b 8e 00 34 sw (sp+52),r14 80091cc: 5b 8f 00 30 sw (sp+48),r15 80091d0: 5b 90 00 2c sw (sp+44),r16 80091d4: 5b 91 00 28 sw (sp+40),r17 80091d8: 5b 92 00 24 sw (sp+36),r18 80091dc: 5b 93 00 20 sw (sp+32),r19 80091e0: 5b 94 00 1c sw (sp+28),r20 80091e4: 5b 95 00 18 sw (sp+24),r21 80091e8: 5b 96 00 14 sw (sp+20),r22 80091ec: 5b 97 00 10 sw (sp+16),r23 80091f0: 5b 98 00 0c sw (sp+12),r24 80091f4: 5b 99 00 08 sw (sp+8),r25 80091f8: 5b 9d 00 04 sw (sp+4),ra 80091fc: 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; 8009200: 5b 80 00 48 sw (sp+72),r0 Heap_Block *extend_last_block = NULL; 8009204: 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; 8009208: 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 ) { 800920c: b8 80 a0 00 mv r20,r4 8009210: b8 20 58 00 mv r11,r1 8009214: b8 60 10 00 mv r2,r3 Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 8009218: 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; 800921c: 28 36 00 10 lw r22,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 8009220: 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; 8009224: 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; 8009228: 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 ) { 800922c: 55 cd 00 8e bgu r14,r13,8009464 <_Heap_Extend+0x2ac> return false; } extend_area_ok = _Heap_Get_first_and_last_block( 8009230: b9 c0 08 00 mv r1,r14 8009234: ba c0 18 00 mv r3,r22 8009238: 37 85 00 48 addi r5,sp,72 800923c: 37 86 00 44 addi r6,sp,68 8009240: fb ff eb 3b calli 8003f2c <_Heap_Get_first_and_last_block> page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 8009244: 44 20 00 88 be r1,r0,8009464 <_Heap_Extend+0x2ac> 8009248: ba a0 78 00 mv r15,r21 800924c: 34 11 00 00 mvi r17,0 8009250: 34 13 00 00 mvi r19,0 8009254: 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; 8009258: 29 61 00 18 lw r1,(r11+24) - 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; 800925c: 34 18 ff fe mvi r24,-2 8009260: e0 00 00 02 bi 8009268 <_Heap_Extend+0xb0> 8009264: b9 e0 08 00 mv r1,r15 uintptr_t const sub_area_end = start_block->prev_size; 8009268: 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 800926c: f5 a1 18 00 cmpgu r3,r13,r1 8009270: 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 ( 8009274: a0 62 10 00 and r2,r3,r2 8009278: 5c 40 00 7a bne r2,r0,8009460 <_Heap_Extend+0x2a8> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 800927c: 45 a1 00 03 be r13,r1,8009288 <_Heap_Extend+0xd0> <== NEVER TAKEN merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 8009280: 56 4d 00 04 bgu r18,r13,8009290 <_Heap_Extend+0xd8> 8009284: e0 00 00 04 bi 8009294 <_Heap_Extend+0xdc> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 8009288: b9 e0 80 00 mv r16,r15 <== NOT EXECUTED 800928c: e0 00 00 02 bi 8009294 <_Heap_Extend+0xdc> <== NOT EXECUTED merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 8009290: 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); 8009294: ba 40 08 00 mv r1,r18 8009298: ba c0 10 00 mv r2,r22 800929c: 36 59 ff f8 addi r25,r18,-8 80092a0: f8 00 1e d8 calli 8010e00 <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 80092a4: cb 21 08 00 sub r1,r25,r1 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 80092a8: 5d d2 00 04 bne r14,r18,80092b8 <_Heap_Extend+0x100> start_block->prev_size = extend_area_end; 80092ac: 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 ) 80092b0: b8 20 60 00 mv r12,r1 80092b4: e0 00 00 04 bi 80092c4 <_Heap_Extend+0x10c> merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 80092b8: 55 d2 00 02 bgu r14,r18,80092c0 <_Heap_Extend+0x108> 80092bc: e0 00 00 02 bi 80092c4 <_Heap_Extend+0x10c> 80092c0: 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; 80092c4: 28 2f 00 04 lw r15,(r1+4) 80092c8: 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); 80092cc: 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 ); 80092d0: 5d f5 ff e5 bne r15,r21,8009264 <_Heap_Extend+0xac> if ( extend_area_begin < heap->area_begin ) { 80092d4: 29 61 00 18 lw r1,(r11+24) 80092d8: 51 c1 00 03 bgeu r14,r1,80092e4 <_Heap_Extend+0x12c> heap->area_begin = extend_area_begin; 80092dc: 59 6e 00 18 sw (r11+24),r14 80092e0: e0 00 00 04 bi 80092f0 <_Heap_Extend+0x138> } else if ( heap->area_end < extend_area_end ) { 80092e4: 29 61 00 1c lw r1,(r11+28) 80092e8: 50 2d 00 02 bgeu r1,r13,80092f0 <_Heap_Extend+0x138> heap->area_end = extend_area_end; 80092ec: 59 6d 00 1c sw (r11+28),r13 } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 80092f0: 2b 81 00 44 lw r1,(sp+68) 80092f4: 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 = 80092f8: 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; 80092fc: 58 4d 00 00 sw (r2+0),r13 extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 8009300: 38 64 00 01 ori r4,r3,0x1 _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; 8009304: 58 23 00 00 sw (r1+0),r3 extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 8009308: 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 = 800930c: 58 44 00 04 sw (r2+4),r4 extend_first_block_size | HEAP_PREV_BLOCK_USED; _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; 8009310: 58 20 00 04 sw (r1+4),r0 _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 8009314: 50 43 00 03 bgeu r2,r3,8009320 <_Heap_Extend+0x168> heap->first_block = extend_first_block; 8009318: 59 62 00 20 sw (r11+32),r2 800931c: e0 00 00 04 bi 800932c <_Heap_Extend+0x174> } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 8009320: 29 62 00 24 lw r2,(r11+36) 8009324: 50 41 00 02 bgeu r2,r1,800932c <_Heap_Extend+0x174> heap->last_block = extend_last_block; 8009328: 59 61 00 24 sw (r11+36),r1 } if ( merge_below_block != NULL ) { 800932c: 46 00 00 12 be r16,r0,8009374 <_Heap_Extend+0x1bc> <== ALWAYS TAKEN Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; 8009330: 29 6f 00 10 lw r15,(r11+16) <== NOT EXECUTED uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); 8009334: 35 ce 00 08 addi r14,r14,8 <== NOT EXECUTED RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 8009338: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 800933c: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED 8009340: f8 00 1e b0 calli 8010e00 <__umodsi3> <== NOT EXECUTED if ( remainder != 0 ) { 8009344: 44 20 00 03 be r1,r0,8009350 <_Heap_Extend+0x198> <== NOT EXECUTED return value - remainder + alignment; 8009348: b5 cf 70 00 add r14,r14,r15 <== NOT EXECUTED 800934c: 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; 8009350: 2a 01 00 00 lw r1,(r16+0) <== NOT EXECUTED ) { uintptr_t const page_size = heap->page_size; uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = 8009354: 35 c2 ff f8 addi r2,r14,-8 <== NOT EXECUTED uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; 8009358: 59 c1 ff f8 sw (r14+-8),r1 <== NOT EXECUTED uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE; uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = 800935c: ca 02 08 00 sub r1,r16,r2 <== NOT EXECUTED first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; 8009360: 38 21 00 01 ori r1,r1,0x1 <== NOT EXECUTED 8009364: 58 41 00 04 sw (r2+4),r1 <== NOT EXECUTED _Heap_Free_block( heap, new_first_block ); 8009368: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 800936c: fb ff ff 86 calli 8009184 <_Heap_Free_block> <== NOT EXECUTED 8009370: e0 00 00 06 bi 8009388 <_Heap_Extend+0x1d0> <== NOT EXECUTED heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { _Heap_Merge_below( heap, extend_area_begin, merge_below_block ); } else if ( link_below_block != NULL ) { 8009374: 46 70 00 05 be r19,r16,8009388 <_Heap_Extend+0x1d0> _Heap_Link_below( 8009378: 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; 800937c: ca 61 98 00 sub r19,r19,r1 8009380: 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 = 8009384: 58 33 00 04 sw (r1+4),r19 link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 8009388: 45 80 00 14 be r12,r0,80093d8 <_Heap_Extend+0x220> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800938c: 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, 8009390: 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( 8009394: c9 ac 68 00 sub r13,r13,r12 8009398: b9 a0 08 00 mv r1,r13 800939c: f8 00 1e 99 calli 8010e00 <__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) 80093a0: 29 83 00 04 lw r3,(r12+4) 80093a4: 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 = 80093a8: b4 2c 10 00 add r2,r1,r12 (last_block->size_and_flag - last_block_new_size) 80093ac: c8 61 18 00 sub r3,r3,r1 | HEAP_PREV_BLOCK_USED; 80093b0: 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 = 80093b4: 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; 80093b8: 29 82 00 04 lw r2,(r12+4) 80093bc: 20 42 00 01 andi r2,r2,0x1 block->size_and_flag = size | flag; 80093c0: b8 22 08 00 or r1,r1,r2 80093c4: 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 ); 80093c8: b9 80 10 00 mv r2,r12 80093cc: b9 60 08 00 mv r1,r11 80093d0: fb ff ff 6d calli 8009184 <_Heap_Free_block> 80093d4: e0 00 00 0c bi 8009404 <_Heap_Extend+0x24c> ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 80093d8: 46 2c 00 0b be r17,r12,8009404 <_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; 80093dc: 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 ); 80093e0: 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( 80093e4: 2b 82 00 44 lw r2,(sp+68) 80093e8: 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 ); 80093ec: c8 71 18 00 sub r3,r3,r17 block->size_and_flag = size | flag; 80093f0: b8 61 08 00 or r1,r3,r1 80093f4: 5a 21 00 04 sw (r17+4),r1 last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 80093f8: 28 41 00 04 lw r1,(r2+4) 80093fc: 38 21 00 01 ori r1,r1,0x1 8009400: 58 41 00 04 sw (r2+4),r1 extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 8009404: 65 8c 00 00 cmpei r12,r12,0 8009408: 66 10 00 00 cmpei r16,r16,0 800940c: a1 90 60 00 and r12,r12,r16 8009410: 45 80 00 04 be r12,r0,8009420 <_Heap_Extend+0x268> _Heap_Free_block( heap, extend_first_block ); 8009414: 2b 82 00 48 lw r2,(sp+72) 8009418: b9 60 08 00 mv r1,r11 800941c: fb ff ff 5a calli 8009184 <_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 8009420: 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( 8009424: 29 63 00 20 lw r3,(r11+32) stats->size += extended_size; if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; 8009428: 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; 800942c: 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( 8009430: 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; 8009434: 20 42 00 01 andi r2,r2,0x1 block->size_and_flag = size | flag; 8009438: b8 62 10 00 or r2,r3,r2 800943c: 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; 8009440: 29 61 00 30 lw r1,(r11+48) /* Statistics */ stats->size += extended_size; 8009444: 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; 8009448: c8 37 08 00 sub r1,r1,r23 /* Statistics */ stats->size += extended_size; 800944c: b4 41 10 00 add r2,r2,r1 8009450: 59 62 00 2c sw (r11+44),r2 if ( extended_size_ptr != NULL ) 8009454: 46 80 00 04 be r20,r0,8009464 <_Heap_Extend+0x2ac> <== NEVER TAKEN *extended_size_ptr = extended_size; 8009458: 5a 81 00 00 sw (r20+0),r1 800945c: e0 00 00 02 bi 8009464 <_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; 8009460: 34 0c 00 00 mvi r12,0 if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; } 8009464: b9 80 08 00 mv r1,r12 8009468: 2b 9d 00 04 lw ra,(sp+4) 800946c: 2b 8b 00 40 lw r11,(sp+64) 8009470: 2b 8c 00 3c lw r12,(sp+60) 8009474: 2b 8d 00 38 lw r13,(sp+56) 8009478: 2b 8e 00 34 lw r14,(sp+52) 800947c: 2b 8f 00 30 lw r15,(sp+48) 8009480: 2b 90 00 2c lw r16,(sp+44) 8009484: 2b 91 00 28 lw r17,(sp+40) 8009488: 2b 92 00 24 lw r18,(sp+36) 800948c: 2b 93 00 20 lw r19,(sp+32) 8009490: 2b 94 00 1c lw r20,(sp+28) 8009494: 2b 95 00 18 lw r21,(sp+24) 8009498: 2b 96 00 14 lw r22,(sp+20) 800949c: 2b 97 00 10 lw r23,(sp+16) 80094a0: 2b 98 00 0c lw r24,(sp+12) 80094a4: 2b 99 00 08 lw r25,(sp+8) 80094a8: 37 9c 00 48 addi sp,sp,72 80094ac: c3 a0 00 00 ret =============================================================================== 08008ffc <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 8008ffc: 37 9c ff f4 addi sp,sp,-12 8009000: 5b 8b 00 0c sw (sp+12),r11 8009004: 5b 8c 00 08 sw (sp+8),r12 8009008: 5b 9d 00 04 sw (sp+4),ra 800900c: b8 20 58 00 mv r11,r1 8009010: 34 4c ff f8 addi r12,r2,-8 8009014: b8 40 08 00 mv r1,r2 8009018: 29 62 00 10 lw r2,(r11+16) 800901c: f8 00 1e 8c calli 8010a4c <__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 8009020: 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); 8009024: 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; 8009028: 34 01 00 00 mvi r1,0 800902c: 54 e3 00 03 bgu r7,r3,8009038 <_Heap_Free+0x3c> 8009030: 29 61 00 24 lw r1,(r11+36) 8009034: f0 23 08 00 cmpgeu r1,r1,r3 uintptr_t next_block_size = 0; bool next_is_free = false; _Heap_Protection_block_check( heap, block ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { 8009038: b8 20 10 00 mv r2,r1 return false; 800903c: 34 01 00 00 mvi r1,0 uintptr_t next_block_size = 0; bool next_is_free = false; _Heap_Protection_block_check( heap, block ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { 8009040: 44 40 00 66 be r2,r0,80091d8 <_Heap_Free+0x1dc> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 8009044: 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; 8009048: 34 04 ff fe mvi r4,-2 800904c: 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); 8009050: 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; 8009054: 54 e2 00 03 bgu r7,r2,8009060 <_Heap_Free+0x64> <== NEVER TAKEN 8009058: 29 61 00 24 lw r1,(r11+36) 800905c: f0 22 08 00 cmpgeu r1,r1,r2 block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 8009060: b8 20 28 00 mv r5,r1 _HAssert( false ); return false; 8009064: 34 01 00 00 mvi r1,0 block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 8009068: 44 a0 00 5c be r5,r0,80091d8 <_Heap_Free+0x1dc> <== NEVER TAKEN --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800906c: 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; 8009070: 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 ) ) { 8009074: 45 00 00 59 be r8,r0,80091d8 <_Heap_Free+0x1dc> <== NEVER TAKEN if ( !_Heap_Protection_determine_block_free( heap, block ) ) { return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 8009078: 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; 800907c: 34 01 ff fe mvi r1,-2 8009080: a0 a1 28 00 and r5,r5,r1 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 8009084: 34 08 00 00 mvi r8,0 8009088: 45 22 00 05 be r9,r2,800909c <_Heap_Free+0xa0> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800908c: 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; 8009090: 28 28 00 04 lw r8,(r1+4) 8009094: 21 08 00 01 andi r8,r8,0x1 return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 8009098: 65 08 00 00 cmpei r8,r8,0 800909c: 20 c6 00 01 andi r6,r6,0x1 if ( !_Heap_Protection_determine_block_free( heap, block ) ) { return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 80090a0: 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 ) ) { 80090a4: 5c c0 00 24 bne r6,r0,8009134 <_Heap_Free+0x138> uintptr_t const prev_size = block->prev_size; 80090a8: 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; 80090ac: 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); 80090b0: 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; 80090b4: 54 e3 00 02 bgu r7,r3,80090bc <_Heap_Free+0xc0> <== NEVER TAKEN 80090b8: 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 ) ) { 80090bc: b8 20 38 00 mv r7,r1 _HAssert( false ); return( false ); 80090c0: 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 ) ) { 80090c4: 44 e0 00 45 be r7,r0,80091d8 <_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; 80090c8: 28 67 00 04 lw r7,(r3+4) 80090cc: 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) ) { 80090d0: 44 e0 00 42 be r7,r0,80091d8 <_Heap_Free+0x1dc> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 80090d4: 45 00 00 0f be r8,r0,8009110 <_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; 80090d8: 28 41 00 08 lw r1,(r2+8) Heap_Block *prev = block->prev; 80090dc: 28 42 00 0c lw r2,(r2+12) uintptr_t const size = block_size + prev_size + next_block_size; 80090e0: b4 85 28 00 add r5,r4,r5 80090e4: b4 a6 30 00 add r6,r5,r6 prev->next = next; 80090e8: 58 41 00 08 sw (r2+8),r1 next->prev = prev; 80090ec: 58 22 00 0c sw (r1+12),r2 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 80090f0: 29 61 00 38 lw r1,(r11+56) 80090f4: 34 21 ff ff addi r1,r1,-1 80090f8: 59 61 00 38 sw (r11+56),r1 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 80090fc: 38 c1 00 01 ori r1,r6,0x1 8009100: 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; 8009104: b4 66 18 00 add r3,r3,r6 8009108: 58 66 00 00 sw (r3+0),r6 800910c: e0 00 00 29 bi 80091b0 <_Heap_Free+0x1b4> } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; 8009110: b4 86 30 00 add r6,r4,r6 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 8009114: 38 c1 00 01 ori r1,r6,0x1 8009118: 58 61 00 04 sw (r3+4),r1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800911c: 28 43 00 04 lw r3,(r2+4) 8009120: 34 01 ff fe mvi r1,-2 next_block->prev_size = size; 8009124: 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; 8009128: a0 61 08 00 and r1,r3,r1 800912c: 58 41 00 04 sw (r2+4),r1 8009130: e0 00 00 20 bi 80091b0 <_Heap_Free+0x1b4> next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 8009134: 45 00 00 0d be r8,r0,8009168 <_Heap_Free+0x16c> uintptr_t const size = block_size + next_block_size; 8009138: 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; 800913c: 28 45 00 08 lw r5,(r2+8) Heap_Block *prev = old_block->prev; 8009140: 28 42 00 0c lw r2,(r2+12) new_block->next = next; 8009144: 58 65 00 08 sw (r3+8),r5 new_block->prev = prev; 8009148: 58 62 00 0c sw (r3+12),r2 next->prev = new_block; prev->next = new_block; 800914c: 58 43 00 08 sw (r2+8),r3 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 8009150: 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; 8009154: 58 a3 00 0c sw (r5+12),r3 8009158: 58 62 00 04 sw (r3+4),r2 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 800915c: b4 61 18 00 add r3,r3,r1 8009160: 58 61 00 00 sw (r3+0),r1 8009164: e0 00 00 13 bi 80091b0 <_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; 8009168: 29 61 00 08 lw r1,(r11+8) new_block->next = next; new_block->prev = block_before; 800916c: 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; 8009170: 58 44 00 00 sw (r2+0),r4 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 8009174: 58 61 00 08 sw (r3+8),r1 new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 8009178: 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; 800917c: 38 81 00 01 ori r1,r4,0x1 8009180: 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; 8009184: 59 63 00 08 sw (r11+8),r3 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 8009188: 28 43 00 04 lw r3,(r2+4) 800918c: 34 01 ff fe mvi r1,-2 8009190: a0 61 08 00 and r1,r3,r1 8009194: 58 41 00 04 sw (r2+4),r1 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 8009198: 29 61 00 38 lw r1,(r11+56) if ( stats->max_free_blocks < stats->free_blocks ) { 800919c: 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; 80091a0: 34 21 00 01 addi r1,r1,1 80091a4: 59 61 00 38 sw (r11+56),r1 if ( stats->max_free_blocks < stats->free_blocks ) { 80091a8: 50 41 00 02 bgeu r2,r1,80091b0 <_Heap_Free+0x1b4> stats->max_free_blocks = stats->free_blocks; 80091ac: 59 61 00 3c sw (r11+60),r1 } } /* Statistics */ --stats->used_blocks; 80091b0: 29 61 00 40 lw r1,(r11+64) 80091b4: 34 21 ff ff addi r1,r1,-1 80091b8: 59 61 00 40 sw (r11+64),r1 ++stats->frees; 80091bc: 29 61 00 50 lw r1,(r11+80) 80091c0: 34 21 00 01 addi r1,r1,1 80091c4: 59 61 00 50 sw (r11+80),r1 stats->free_size += block_size; 80091c8: 29 61 00 30 lw r1,(r11+48) 80091cc: b4 24 20 00 add r4,r1,r4 80091d0: 59 64 00 30 sw (r11+48),r4 return( true ); 80091d4: 34 01 00 01 mvi r1,1 } 80091d8: 2b 9d 00 04 lw ra,(sp+4) 80091dc: 2b 8b 00 0c lw r11,(sp+12) 80091e0: 2b 8c 00 08 lw r12,(sp+8) 80091e4: 37 9c 00 0c addi sp,sp,12 80091e8: c3 a0 00 00 ret =============================================================================== 08011430 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 8011430: 37 9c ff ec addi sp,sp,-20 8011434: 5b 8b 00 14 sw (sp+20),r11 8011438: 5b 8c 00 10 sw (sp+16),r12 801143c: 5b 8d 00 0c sw (sp+12),r13 8011440: 5b 8e 00 08 sw (sp+8),r14 8011444: 5b 9d 00 04 sw (sp+4),ra 8011448: 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); 801144c: 34 4e ff f8 addi r14,r2,-8 8011450: b8 40 08 00 mv r1,r2 8011454: b8 40 60 00 mv r12,r2 8011458: 29 62 00 10 lw r2,(r11+16) 801145c: b8 60 68 00 mv r13,r3 8011460: fb ff fd 7b calli 8010a4c <__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 8011464: 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); 8011468: 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; 801146c: 34 01 00 00 mvi r1,0 8011470: 54 44 00 03 bgu r2,r4,801147c <_Heap_Size_of_alloc_area+0x4c> 8011474: 29 61 00 24 lw r1,(r11+36) 8011478: 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 ) ) { 801147c: b8 20 18 00 mv r3,r1 return false; 8011480: 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 ) ) { 8011484: 44 60 00 13 be r3,r0,80114d0 <_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; 8011488: 28 83 00 04 lw r3,(r4+4) 801148c: 34 01 ff fe mvi r1,-2 8011490: 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); 8011494: 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; 8011498: 34 01 00 00 mvi r1,0 801149c: 54 44 00 03 bgu r2,r4,80114a8 <_Heap_Size_of_alloc_area+0x78><== NEVER TAKEN 80114a0: 29 61 00 24 lw r1,(r11+36) 80114a4: f0 24 08 00 cmpgeu r1,r1,r4 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 80114a8: b8 20 10 00 mv r2,r1 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ) { return false; 80114ac: 34 01 00 00 mvi r1,0 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 80114b0: 44 40 00 08 be r2,r0,80114d0 <_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; 80114b4: 28 82 00 04 lw r2,(r4+4) 80114b8: 20 42 00 01 andi r2,r2,0x1 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 80114bc: 44 40 00 05 be r2,r0,80114d0 <_Heap_Size_of_alloc_area+0xa0><== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 80114c0: c8 8c 20 00 sub r4,r4,r12 80114c4: 34 84 00 04 addi r4,r4,4 80114c8: 59 a4 00 00 sw (r13+0),r4 return true; 80114cc: 34 01 00 01 mvi r1,1 } 80114d0: 2b 9d 00 04 lw ra,(sp+4) 80114d4: 2b 8b 00 14 lw r11,(sp+20) 80114d8: 2b 8c 00 10 lw r12,(sp+16) 80114dc: 2b 8d 00 0c lw r13,(sp+12) 80114e0: 2b 8e 00 08 lw r14,(sp+8) 80114e4: 37 9c 00 14 addi sp,sp,20 80114e8: c3 a0 00 00 ret =============================================================================== 08004ba4 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 8004ba4: 37 9c ff a0 addi sp,sp,-96 8004ba8: 5b 8b 00 50 sw (sp+80),r11 8004bac: 5b 8c 00 4c sw (sp+76),r12 8004bb0: 5b 8d 00 48 sw (sp+72),r13 8004bb4: 5b 8e 00 44 sw (sp+68),r14 8004bb8: 5b 8f 00 40 sw (sp+64),r15 8004bbc: 5b 90 00 3c sw (sp+60),r16 8004bc0: 5b 91 00 38 sw (sp+56),r17 8004bc4: 5b 92 00 34 sw (sp+52),r18 8004bc8: 5b 93 00 30 sw (sp+48),r19 8004bcc: 5b 94 00 2c sw (sp+44),r20 8004bd0: 5b 95 00 28 sw (sp+40),r21 8004bd4: 5b 96 00 24 sw (sp+36),r22 8004bd8: 5b 97 00 20 sw (sp+32),r23 8004bdc: 5b 98 00 1c sw (sp+28),r24 8004be0: 5b 99 00 18 sw (sp+24),r25 8004be4: 5b 9b 00 14 sw (sp+20),fp 8004be8: 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; 8004bec: 78 0d 08 00 mvhi r13,0x800 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 8004bf0: 20 63 00 ff andi r3,r3,0xff 8004bf4: b8 20 60 00 mv r12,r1 8004bf8: b8 40 70 00 mv r14,r2 uintptr_t const page_size = heap->page_size; 8004bfc: 28 33 00 10 lw r19,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 8004c00: 28 35 00 14 lw r21,(r1+20) Heap_Block *const first_block = heap->first_block; 8004c04: 28 34 00 20 lw r20,(r1+32) Heap_Block *const last_block = heap->last_block; 8004c08: 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; 8004c0c: 39 ad 4b 0c ori r13,r13,0x4b0c 8004c10: 44 60 00 03 be r3,r0,8004c1c <_Heap_Walk+0x78> 8004c14: 78 0d 08 00 mvhi r13,0x800 8004c18: 39 ad 4b 30 ori r13,r13,0x4b30 if ( !_System_state_Is_up( _System_state_Get() ) ) { 8004c1c: 78 03 08 01 mvhi r3,0x801 8004c20: 38 63 59 e4 ori r3,r3,0x59e4 8004c24: 28 67 00 00 lw r7,(r3+0) 8004c28: 34 02 00 03 mvi r2,3 return true; 8004c2c: 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() ) ) { 8004c30: 5c e2 01 08 bne r7,r2,8005050 <_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)( 8004c34: 29 81 00 08 lw r1,(r12+8) 8004c38: 29 86 00 18 lw r6,(r12+24) 8004c3c: 29 87 00 1c lw r7,(r12+28) 8004c40: 5b 81 00 08 sw (sp+8),r1 8004c44: 29 81 00 0c lw r1,(r12+12) 8004c48: 78 03 08 01 mvhi r3,0x801 8004c4c: 5b 96 00 04 sw (sp+4),r22 8004c50: 5b 81 00 0c sw (sp+12),r1 8004c54: 34 02 00 00 mvi r2,0 8004c58: b9 c0 08 00 mv r1,r14 8004c5c: 38 63 2c 08 ori r3,r3,0x2c08 8004c60: ba 60 20 00 mv r4,r19 8004c64: ba a0 28 00 mv r5,r21 8004c68: ba 80 40 00 mv r8,r20 8004c6c: 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 ) { 8004c70: 5e 60 00 06 bne r19,r0,8004c88 <_Heap_Walk+0xe4> (*printer)( source, true, "page size is zero\n" ); 8004c74: 78 03 08 01 mvhi r3,0x801 8004c78: b9 c0 08 00 mv r1,r14 8004c7c: 34 02 00 01 mvi r2,1 8004c80: 38 63 2c 9c ori r3,r3,0x2c9c 8004c84: e0 00 00 25 bi 8004d18 <_Heap_Walk+0x174> ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 8004c88: 22 6f 00 07 andi r15,r19,0x7 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 8004c8c: 45 e0 00 07 be r15,r0,8004ca8 <_Heap_Walk+0x104> (*printer)( 8004c90: 78 03 08 01 mvhi r3,0x801 8004c94: b9 c0 08 00 mv r1,r14 8004c98: 34 02 00 01 mvi r2,1 8004c9c: 38 63 2c b0 ori r3,r3,0x2cb0 8004ca0: ba 60 20 00 mv r4,r19 8004ca4: e0 00 01 04 bi 80050b4 <_Heap_Walk+0x510> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8004ca8: ba a0 08 00 mv r1,r21 8004cac: ba 60 10 00 mv r2,r19 8004cb0: fb ff ef b2 calli 8000b78 <__umodsi3> 8004cb4: b8 20 58 00 mv r11,r1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 8004cb8: 44 2f 00 07 be r1,r15,8004cd4 <_Heap_Walk+0x130> (*printer)( 8004cbc: 78 03 08 01 mvhi r3,0x801 8004cc0: b9 c0 08 00 mv r1,r14 8004cc4: 34 02 00 01 mvi r2,1 8004cc8: 38 63 2c d0 ori r3,r3,0x2cd0 8004ccc: ba a0 20 00 mv r4,r21 8004cd0: e0 00 00 f9 bi 80050b4 <_Heap_Walk+0x510> 8004cd4: 36 81 00 08 addi r1,r20,8 8004cd8: ba 60 10 00 mv r2,r19 8004cdc: fb ff ef a7 calli 8000b78 <__umodsi3> ); return false; } if ( 8004ce0: 44 2b 00 07 be r1,r11,8004cfc <_Heap_Walk+0x158> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 8004ce4: 78 03 08 01 mvhi r3,0x801 8004ce8: b9 c0 08 00 mv r1,r14 8004cec: 34 02 00 01 mvi r2,1 8004cf0: 38 63 2c f4 ori r3,r3,0x2cf4 8004cf4: ba 80 20 00 mv r4,r20 8004cf8: e0 00 00 ef bi 80050b4 <_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; 8004cfc: 2a 82 00 04 lw r2,(r20+4) 8004d00: 20 42 00 01 andi r2,r2,0x1 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 8004d04: 5c 41 00 07 bne r2,r1,8004d20 <_Heap_Walk+0x17c> (*printer)( 8004d08: 78 03 08 01 mvhi r3,0x801 8004d0c: b9 c0 08 00 mv r1,r14 8004d10: 34 02 00 01 mvi r2,1 8004d14: 38 63 2d 28 ori r3,r3,0x2d28 8004d18: d9 a0 00 00 call r13 8004d1c: e0 00 00 40 bi 8004e1c <_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; 8004d20: 2a cf 00 04 lw r15,(r22+4) 8004d24: 34 02 ff fe mvi r2,-2 8004d28: 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); 8004d2c: 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; 8004d30: 29 e2 00 04 lw r2,(r15+4) 8004d34: 20 42 00 01 andi r2,r2,0x1 ); return false; } if ( _Heap_Is_free( last_block ) ) { 8004d38: 5c 41 00 06 bne r2,r1,8004d50 <_Heap_Walk+0x1ac> (*printer)( 8004d3c: 78 03 08 01 mvhi r3,0x801 8004d40: b9 c0 08 00 mv r1,r14 8004d44: 34 02 00 01 mvi r2,1 8004d48: 38 63 2d 58 ori r3,r3,0x2d58 8004d4c: e3 ff ff f3 bi 8004d18 <_Heap_Walk+0x174> ); return false; } if ( 8004d50: 45 f4 00 06 be r15,r20,8004d68 <_Heap_Walk+0x1c4> <== ALWAYS TAKEN _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 8004d54: 78 03 08 01 mvhi r3,0x801 <== NOT EXECUTED 8004d58: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 8004d5c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8004d60: 38 63 2d 70 ori r3,r3,0x2d70 <== NOT EXECUTED 8004d64: e3 ff ff ed bi 8004d18 <_Heap_Walk+0x174> <== NOT EXECUTED int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 8004d68: 29 92 00 10 lw r18,(r12+16) block = next_block; } while ( block != first_block ); return true; } 8004d6c: 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 ); 8004d70: 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; 8004d74: 34 11 ff fe mvi r17,-2 8004d78: e0 00 00 2d bi 8004e2c <_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; 8004d7c: 29 83 00 20 lw r3,(r12+32) 8004d80: 34 01 00 00 mvi r1,0 8004d84: 54 6b 00 03 bgu r3,r11,8004d90 <_Heap_Walk+0x1ec> 8004d88: 29 81 00 24 lw r1,(r12+36) 8004d8c: 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 ) ) { 8004d90: 5c 20 00 06 bne r1,r0,8004da8 <_Heap_Walk+0x204> (*printer)( 8004d94: 78 03 08 01 mvhi r3,0x801 8004d98: b9 c0 08 00 mv r1,r14 8004d9c: 34 02 00 01 mvi r2,1 8004da0: 38 63 2d a0 ori r3,r3,0x2da0 8004da4: e0 00 00 14 bi 8004df4 <_Heap_Walk+0x250> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8004da8: 35 61 00 08 addi r1,r11,8 8004dac: ba 40 10 00 mv r2,r18 8004db0: fb ff ef 72 calli 8000b78 <__umodsi3> ); return false; } if ( 8004db4: 44 20 00 06 be r1,r0,8004dcc <_Heap_Walk+0x228> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 8004db8: 78 03 08 01 mvhi r3,0x801 8004dbc: b9 c0 08 00 mv r1,r14 8004dc0: 34 02 00 01 mvi r2,1 8004dc4: 38 63 2d c0 ori r3,r3,0x2dc0 8004dc8: e0 00 00 0b bi 8004df4 <_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; 8004dcc: 29 63 00 04 lw r3,(r11+4) 8004dd0: a2 23 18 00 and r3,r17,r3 block = next_block; } while ( block != first_block ); return true; } 8004dd4: 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; 8004dd8: 28 63 00 04 lw r3,(r3+4) 8004ddc: 20 63 00 01 andi r3,r3,0x1 ); return false; } if ( _Heap_Is_used( free_block ) ) { 8004de0: 44 61 00 07 be r3,r1,8004dfc <_Heap_Walk+0x258> (*printer)( 8004de4: 78 03 08 01 mvhi r3,0x801 8004de8: b9 c0 08 00 mv r1,r14 8004dec: 34 02 00 01 mvi r2,1 8004df0: 38 63 2d f0 ori r3,r3,0x2df0 8004df4: b9 60 20 00 mv r4,r11 8004df8: e0 00 00 af bi 80050b4 <_Heap_Walk+0x510> ); return false; } if ( free_block->prev != prev_block ) { 8004dfc: 29 65 00 0c lw r5,(r11+12) 8004e00: 44 b0 00 09 be r5,r16,8004e24 <_Heap_Walk+0x280> (*printer)( 8004e04: 78 03 08 01 mvhi r3,0x801 8004e08: b9 c0 08 00 mv r1,r14 8004e0c: 34 02 00 01 mvi r2,1 8004e10: 38 63 2e 0c ori r3,r3,0x2e0c 8004e14: b9 60 20 00 mv r4,r11 8004e18: 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; 8004e1c: 34 03 00 00 mvi r3,0 8004e20: e0 00 00 8c bi 8005050 <_Heap_Walk+0x4ac> return false; } prev_block = free_block; free_block = free_block->next; 8004e24: b9 60 80 00 mv r16,r11 8004e28: 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 ) { 8004e2c: 5d 6c ff d4 bne r11,r12,8004d7c <_Heap_Walk+0x1d8> 8004e30: e0 00 00 03 bi 8004e3c <_Heap_Walk+0x298> block->prev_size ); } block = next_block; } while ( block != first_block ); 8004e34: ba 20 78 00 mv r15,r17 8004e38: e0 00 00 15 bi 8004e8c <_Heap_Walk+0x2e8> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8004e3c: 78 01 08 01 mvhi r1,0x801 8004e40: 38 21 2f bc ori r1,r1,0x2fbc 8004e44: 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)( 8004e48: 78 01 08 01 mvhi r1,0x801 8004e4c: 38 21 2f a4 ori r1,r1,0x2fa4 8004e50: 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)( 8004e54: 78 01 08 01 mvhi r1,0x801 8004e58: 38 21 2b d0 ori r1,r1,0x2bd0 8004e5c: 5b 81 00 5c sw (sp+92),r1 8004e60: 78 01 08 01 mvhi r1,0x801 8004e64: 38 21 2b ec ori r1,r1,0x2bec 8004e68: 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)" : "") 8004e6c: 78 17 08 01 mvhi r23,0x801 8004e70: 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)" : ""), 8004e74: 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)( 8004e78: 5b 81 00 60 sw (sp+96),r1 8004e7c: 3b 7b 2f 00 ori fp,fp,0x2f00 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8004e80: 3a f7 2f 70 ori r23,r23,0x2f70 8004e84: 3b 39 2b fc ori r25,r25,0x2bfc block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8004e88: 3b 18 2b e0 ori r24,r24,0x2be0 block = next_block; } while ( block != first_block ); return true; } 8004e8c: 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; 8004e90: 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; 8004e94: 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; 8004e98: 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); 8004e9c: 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; 8004ea0: 34 06 00 00 mvi r6,0 8004ea4: 54 91 00 03 bgu r4,r17,8004eb0 <_Heap_Walk+0x30c> <== NEVER TAKEN 8004ea8: 29 86 00 24 lw r6,(r12+36) 8004eac: 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 ) ) { 8004eb0: 5c c0 00 06 bne r6,r0,8004ec8 <_Heap_Walk+0x324> (*printer)( 8004eb4: 78 03 08 01 mvhi r3,0x801 8004eb8: b9 c0 08 00 mv r1,r14 8004ebc: 34 02 00 01 mvi r2,1 8004ec0: 38 63 2e 40 ori r3,r3,0x2e40 8004ec4: e0 00 00 1f bi 8004f40 <_Heap_Walk+0x39c> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8004ec8: ba 00 08 00 mv r1,r16 8004ecc: 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; 8004ed0: fd f6 58 00 cmpne r11,r15,r22 8004ed4: fb ff ef 29 calli 8000b78 <__umodsi3> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 8004ed8: 44 20 00 09 be r1,r0,8004efc <_Heap_Walk+0x358> 8004edc: 45 60 00 08 be r11,r0,8004efc <_Heap_Walk+0x358> (*printer)( 8004ee0: 78 03 08 01 mvhi r3,0x801 8004ee4: b9 c0 08 00 mv r1,r14 8004ee8: 34 02 00 01 mvi r2,1 8004eec: 38 63 2e 70 ori r3,r3,0x2e70 8004ef0: b9 e0 20 00 mv r4,r15 8004ef4: ba 00 28 00 mv r5,r16 8004ef8: e3 ff ff c8 bi 8004e18 <_Heap_Walk+0x274> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 8004efc: 52 15 00 0b bgeu r16,r21,8004f28 <_Heap_Walk+0x384> 8004f00: 45 60 00 0a be r11,r0,8004f28 <_Heap_Walk+0x384> <== NEVER TAKEN (*printer)( 8004f04: 78 03 08 01 mvhi r3,0x801 8004f08: b9 c0 08 00 mv r1,r14 8004f0c: 34 02 00 01 mvi r2,1 8004f10: 38 63 2e a0 ori r3,r3,0x2ea0 8004f14: b9 e0 20 00 mv r4,r15 8004f18: ba 00 28 00 mv r5,r16 8004f1c: ba a0 30 00 mv r6,r21 8004f20: d9 a0 00 00 call r13 8004f24: e3 ff ff be bi 8004e1c <_Heap_Walk+0x278> ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 8004f28: 56 2f 00 09 bgu r17,r15,8004f4c <_Heap_Walk+0x3a8> 8004f2c: 45 60 00 08 be r11,r0,8004f4c <_Heap_Walk+0x3a8> (*printer)( 8004f30: 78 03 08 01 mvhi r3,0x801 8004f34: b9 c0 08 00 mv r1,r14 8004f38: 34 02 00 01 mvi r2,1 8004f3c: 38 63 2e cc ori r3,r3,0x2ecc 8004f40: b9 e0 20 00 mv r4,r15 8004f44: ba 20 28 00 mv r5,r17 8004f48: e3 ff ff b4 bi 8004e18 <_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; 8004f4c: 2a 24 00 04 lw r4,(r17+4) 8004f50: 22 52 00 01 andi r18,r18,0x1 8004f54: 20 84 00 01 andi r4,r4,0x1 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 8004f58: 5c 80 00 2d bne r4,r0,800500c <_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 ? 8004f5c: 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)( 8004f60: 29 85 00 08 lw r5,(r12+8) block = next_block; } while ( block != first_block ); return true; } 8004f64: 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)( 8004f68: 2b 87 00 5c lw r7,(sp+92) 8004f6c: 44 c5 00 04 be r6,r5,8004f7c <_Heap_Walk+0x3d8> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8004f70: ba e0 38 00 mv r7,r23 8004f74: 5c cc 00 02 bne r6,r12,8004f7c <_Heap_Walk+0x3d8> 8004f78: bb 00 38 00 mv r7,r24 block->next, block->next == last_free_block ? 8004f7c: 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)( 8004f80: 2b 89 00 60 lw r9,(sp+96) 8004f84: 45 04 00 04 be r8,r4,8004f94 <_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)" : "") 8004f88: ba e0 48 00 mv r9,r23 8004f8c: 5d 0c 00 02 bne r8,r12,8004f94 <_Heap_Walk+0x3f0> 8004f90: 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)( 8004f94: 5b 89 00 04 sw (sp+4),r9 8004f98: b9 c0 08 00 mv r1,r14 8004f9c: 34 02 00 00 mvi r2,0 8004fa0: bb 60 18 00 mv r3,fp 8004fa4: b9 e0 20 00 mv r4,r15 8004fa8: ba 00 28 00 mv r5,r16 8004fac: 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 ) { 8004fb0: 2a 26 00 00 lw r6,(r17+0) 8004fb4: 46 06 00 0a be r16,r6,8004fdc <_Heap_Walk+0x438> (*printer)( 8004fb8: 78 03 08 01 mvhi r3,0x801 8004fbc: b9 c0 08 00 mv r1,r14 8004fc0: 34 02 00 01 mvi r2,1 8004fc4: 38 63 2f 38 ori r3,r3,0x2f38 8004fc8: b9 e0 20 00 mv r4,r15 8004fcc: ba 00 28 00 mv r5,r16 8004fd0: ba 20 38 00 mv r7,r17 8004fd4: d9 a0 00 00 call r13 8004fd8: e3 ff ff 91 bi 8004e1c <_Heap_Walk+0x278> ); return false; } if ( !prev_used ) { 8004fdc: 5e 40 00 06 bne r18,r0,8004ff4 <_Heap_Walk+0x450> (*printer)( 8004fe0: 78 03 08 01 mvhi r3,0x801 8004fe4: b9 c0 08 00 mv r1,r14 8004fe8: 34 02 00 01 mvi r2,1 8004fec: 38 63 2f 74 ori r3,r3,0x2f74 8004ff0: e0 00 00 30 bi 80050b0 <_Heap_Walk+0x50c> block = next_block; } while ( block != first_block ); return true; } 8004ff4: 29 85 00 08 lw r5,(r12+8) 8004ff8: e0 00 00 03 bi 8005004 <_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 ) { 8004ffc: 44 af 00 13 be r5,r15,8005048 <_Heap_Walk+0x4a4> return true; } free_block = free_block->next; 8005000: 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 ) { 8005004: 5c ac ff fe bne r5,r12,8004ffc <_Heap_Walk+0x458> 8005008: e0 00 00 26 bi 80050a0 <_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) { 800500c: 46 40 00 08 be r18,r0,800502c <_Heap_Walk+0x488> (*printer)( 8005010: 2b 83 00 58 lw r3,(sp+88) 8005014: b9 c0 08 00 mv r1,r14 8005018: 34 02 00 00 mvi r2,0 800501c: b9 e0 20 00 mv r4,r15 8005020: ba 00 28 00 mv r5,r16 8005024: d9 a0 00 00 call r13 8005028: e0 00 00 08 bi 8005048 <_Heap_Walk+0x4a4> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 800502c: 2b 83 00 54 lw r3,(sp+84) 8005030: 29 e6 00 00 lw r6,(r15+0) 8005034: b9 c0 08 00 mv r1,r14 8005038: 34 02 00 00 mvi r2,0 800503c: b9 e0 20 00 mv r4,r15 8005040: ba 00 28 00 mv r5,r16 8005044: d9 a0 00 00 call r13 block->prev_size ); } block = next_block; } while ( block != first_block ); 8005048: 5e 91 ff 7b bne r20,r17,8004e34 <_Heap_Walk+0x290> return true; 800504c: 34 03 00 01 mvi r3,1 } 8005050: b8 60 08 00 mv r1,r3 8005054: 2b 9d 00 10 lw ra,(sp+16) 8005058: 2b 8b 00 50 lw r11,(sp+80) 800505c: 2b 8c 00 4c lw r12,(sp+76) 8005060: 2b 8d 00 48 lw r13,(sp+72) 8005064: 2b 8e 00 44 lw r14,(sp+68) 8005068: 2b 8f 00 40 lw r15,(sp+64) 800506c: 2b 90 00 3c lw r16,(sp+60) 8005070: 2b 91 00 38 lw r17,(sp+56) 8005074: 2b 92 00 34 lw r18,(sp+52) 8005078: 2b 93 00 30 lw r19,(sp+48) 800507c: 2b 94 00 2c lw r20,(sp+44) 8005080: 2b 95 00 28 lw r21,(sp+40) 8005084: 2b 96 00 24 lw r22,(sp+36) 8005088: 2b 97 00 20 lw r23,(sp+32) 800508c: 2b 98 00 1c lw r24,(sp+28) 8005090: 2b 99 00 18 lw r25,(sp+24) 8005094: 2b 9b 00 14 lw fp,(sp+20) 8005098: 37 9c 00 60 addi sp,sp,96 800509c: c3 a0 00 00 ret return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*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 2f e4 ori r3,r3,0x2fe4 80050b0: b9 e0 20 00 mv r4,r15 80050b4: d9 a0 00 00 call r13 80050b8: e3 ff ff 59 bi 8004e1c <_Heap_Walk+0x278> =============================================================================== 080030cc <_IO_Manager_initialization>: * workspace. * */ void _IO_Manager_initialization(void) { 80030cc: 37 9c ff e8 addi sp,sp,-24 80030d0: 5b 8b 00 18 sw (sp+24),r11 80030d4: 5b 8c 00 14 sw (sp+20),r12 80030d8: 5b 8d 00 10 sw (sp+16),r13 80030dc: 5b 8e 00 0c sw (sp+12),r14 80030e0: 5b 8f 00 08 sw (sp+8),r15 80030e4: 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; 80030e8: 78 01 08 01 mvhi r1,0x801 80030ec: 38 21 30 c4 ori r1,r1,0x30c4 drivers_in_table = Configuration.number_of_device_drivers; 80030f0: 28 2d 00 30 lw r13,(r1+48) number_of_drivers = Configuration.maximum_drivers; 80030f4: 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; 80030f8: 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 ) 80030fc: 51 ab 00 03 bgeu r13,r11,8003108 <_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 ) { 8003100: 5d 6d 00 0a bne r11,r13,8003128 <_IO_Manager_initialization+0x5c><== ALWAYS TAKEN 8003104: e0 00 00 02 bi 800310c <_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 ) 8003108: 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; 800310c: 78 01 08 01 mvhi r1,0x801 8003110: 38 21 3a 50 ori r1,r1,0x3a50 8003114: 58 2e 00 00 sw (r1+0),r14 _IO_Number_of_drivers = number_of_drivers; 8003118: 78 01 08 01 mvhi r1,0x801 800311c: 38 21 3a 4c ori r1,r1,0x3a4c 8003120: 58 2b 00 00 sw (r1+0),r11 return; 8003124: e0 00 00 27 bi 80031c0 <_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 ) 8003128: 34 02 00 01 mvi r2,1 800312c: b9 60 08 00 mv r1,r11 8003130: f8 00 35 5d calli 80106a4 <__ashlsi3> 8003134: 34 02 00 03 mvi r2,3 8003138: b4 2b 08 00 add r1,r1,r11 800313c: f8 00 35 5a calli 80106a4 <__ashlsi3> 8003140: 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( 8003144: f8 00 0d d4 calli 8006894 <_Workspace_Allocate_or_fatal_error> sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 8003148: 78 02 08 01 mvhi r2,0x801 800314c: 38 42 3a 4c ori r2,r2,0x3a4c /* * 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 *) 8003150: 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; 8003154: 58 4b 00 00 sw (r2+0),r11 memset( 8003158: 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 *) 800315c: 39 8c 3a 50 ori r12,r12,0x3a50 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 8003160: 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 *) 8003164: 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( 8003168: f8 00 23 43 calli 800be74 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 800316c: 34 03 00 00 mvi r3,0 8003170: 34 04 00 00 mvi r4,0 8003174: e0 00 00 12 bi 80031bc <_IO_Manager_initialization+0xf0> _IO_Driver_address_table[index] = driver_table[index]; 8003178: 29 82 00 00 lw r2,(r12+0) * registration. The driver table is now allocated in the * workspace. * */ void _IO_Manager_initialization(void) 800317c: 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]; 8003180: 28 29 00 00 lw r9,(r1+0) 8003184: 28 28 00 04 lw r8,(r1+4) 8003188: 28 27 00 08 lw r7,(r1+8) 800318c: 28 26 00 0c lw r6,(r1+12) 8003190: 28 25 00 10 lw r5,(r1+16) 8003194: 28 21 00 14 lw r1,(r1+20) 8003198: b4 43 10 00 add r2,r2,r3 800319c: 58 49 00 00 sw (r2+0),r9 80031a0: 58 48 00 04 sw (r2+4),r8 80031a4: 58 47 00 08 sw (r2+8),r7 80031a8: 58 46 00 0c sw (r2+12),r6 80031ac: 58 45 00 10 sw (r2+16),r5 80031b0: 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++ ) 80031b4: 34 84 00 01 addi r4,r4,1 80031b8: 34 63 00 18 addi r3,r3,24 80031bc: 55 a4 ff ef bgu r13,r4,8003178 <_IO_Manager_initialization+0xac> _IO_Driver_address_table[index] = driver_table[index]; number_of_drivers = drivers_in_table; } 80031c0: 2b 9d 00 04 lw ra,(sp+4) 80031c4: 2b 8b 00 18 lw r11,(sp+24) 80031c8: 2b 8c 00 14 lw r12,(sp+20) 80031cc: 2b 8d 00 10 lw r13,(sp+16) 80031d0: 2b 8e 00 0c lw r14,(sp+12) 80031d4: 2b 8f 00 08 lw r15,(sp+8) 80031d8: 37 9c 00 18 addi sp,sp,24 80031dc: c3 a0 00 00 ret =============================================================================== 0800406c <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 800406c: 37 9c ff ec addi sp,sp,-20 8004070: 5b 8b 00 14 sw (sp+20),r11 8004074: 5b 8c 00 10 sw (sp+16),r12 8004078: 5b 8d 00 0c sw (sp+12),r13 800407c: 5b 8e 00 08 sw (sp+8),r14 8004080: 5b 9d 00 04 sw (sp+4),ra 8004084: 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 ) 8004088: 28 21 00 18 lw r1,(r1+24) return NULL; 800408c: 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 ) 8004090: 44 20 00 1e be r1,r0,8004108 <_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 ); 8004094: 35 6d 00 20 addi r13,r11,32 8004098: b9 a0 08 00 mv r1,r13 800409c: fb ff fd 21 calli 8003520 <_Chain_Get> 80040a0: b8 20 60 00 mv r12,r1 80040a4: b8 20 70 00 mv r14,r1 if ( information->auto_extend ) { 80040a8: 41 61 00 12 lbu r1,(r11+18) 80040ac: 44 20 00 17 be r1,r0,8004108 <_Objects_Allocate+0x9c> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 80040b0: 5d 80 00 07 bne r12,r0,80040cc <_Objects_Allocate+0x60> _Objects_Extend_information( information ); 80040b4: b9 60 08 00 mv r1,r11 80040b8: f8 00 00 1c calli 8004128 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 80040bc: b9 a0 08 00 mv r1,r13 80040c0: fb ff fd 18 calli 8003520 <_Chain_Get> 80040c4: b8 20 60 00 mv r12,r1 } if ( the_object ) { 80040c8: 44 2e 00 10 be r1,r14,8004108 <_Objects_Allocate+0x9c> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 80040cc: 2d 82 00 0a lhu r2,(r12+10) 80040d0: 2d 61 00 0a lhu r1,(r11+10) _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 80040d4: c8 41 08 00 sub r1,r2,r1 80040d8: 2d 62 00 14 lhu r2,(r11+20) 80040dc: f8 00 32 4c calli 8010a0c <__udivsi3> information->inactive_per_block[ block ]--; 80040e0: 34 02 00 02 mvi r2,2 80040e4: f8 00 31 70 calli 80106a4 <__ashlsi3> 80040e8: 29 62 00 30 lw r2,(r11+48) 80040ec: b4 41 08 00 add r1,r2,r1 80040f0: 28 22 00 00 lw r2,(r1+0) 80040f4: 34 42 ff ff addi r2,r2,-1 80040f8: 58 22 00 00 sw (r1+0),r2 information->inactive--; 80040fc: 2d 61 00 2c lhu r1,(r11+44) 8004100: 34 21 ff ff addi r1,r1,-1 8004104: 0d 61 00 2c sh (r11+44),r1 ); } #endif return the_object; } 8004108: b9 80 08 00 mv r1,r12 800410c: 2b 9d 00 04 lw ra,(sp+4) 8004110: 2b 8b 00 14 lw r11,(sp+20) 8004114: 2b 8c 00 10 lw r12,(sp+16) 8004118: 2b 8d 00 0c lw r13,(sp+12) 800411c: 2b 8e 00 08 lw r14,(sp+8) 8004120: 37 9c 00 14 addi sp,sp,20 8004124: c3 a0 00 00 ret =============================================================================== 0800454c <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 800454c: 37 9c ff ec addi sp,sp,-20 8004550: 5b 8b 00 14 sw (sp+20),r11 8004554: 5b 8c 00 10 sw (sp+16),r12 8004558: 5b 8d 00 0c sw (sp+12),r13 800455c: 5b 8e 00 08 sw (sp+8),r14 8004560: 5b 9d 00 04 sw (sp+4),ra 8004564: 20 4c ff ff andi r12,r2,0xffff 8004568: b8 20 70 00 mv r14,r1 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) return NULL; 800456c: 34 0b 00 00 mvi r11,0 ) { Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 8004570: 45 80 00 16 be r12,r0,80045c8 <_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 ); 8004574: f8 00 13 1e calli 80091ec <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 8004578: 44 20 00 14 be r1,r0,80045c8 <_Objects_Get_information+0x7c> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 800457c: 55 81 00 13 bgu r12,r1,80045c8 <_Objects_Get_information+0x7c> return NULL; if ( !_Objects_Information_table[ the_api ] ) 8004580: 78 0d 08 01 mvhi r13,0x801 8004584: b9 c0 08 00 mv r1,r14 8004588: 34 02 00 02 mvi r2,2 800458c: 39 ad 37 b8 ori r13,r13,0x37b8 8004590: f8 00 30 45 calli 80106a4 <__ashlsi3> 8004594: b5 a1 08 00 add r1,r13,r1 8004598: 28 2d 00 00 lw r13,(r1+0) 800459c: 45 a0 00 0b be r13,r0,80045c8 <_Objects_Get_information+0x7c><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 80045a0: b9 80 08 00 mv r1,r12 80045a4: 34 02 00 02 mvi r2,2 80045a8: f8 00 30 3f calli 80106a4 <__ashlsi3> 80045ac: b5 a1 08 00 add r1,r13,r1 80045b0: 28 2b 00 00 lw r11,(r1+0) if ( !info ) 80045b4: 45 60 00 05 be r11,r0,80045c8 <_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 ) 80045b8: 2d 61 00 10 lhu r1,(r11+16) return NULL; 80045bc: 7c 21 00 00 cmpnei r1,r1,0 80045c0: c8 01 08 00 sub r1,r0,r1 80045c4: a1 61 58 00 and r11,r11,r1 #endif return info; } 80045c8: b9 60 08 00 mv r1,r11 80045cc: 2b 9d 00 04 lw ra,(sp+4) 80045d0: 2b 8b 00 14 lw r11,(sp+20) 80045d4: 2b 8c 00 10 lw r12,(sp+16) 80045d8: 2b 8d 00 0c lw r13,(sp+12) 80045dc: 2b 8e 00 08 lw r14,(sp+8) 80045e0: 37 9c 00 14 addi sp,sp,20 80045e4: c3 a0 00 00 ret =============================================================================== 08017758 <_Objects_Get_no_protection>: Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 8017758: 37 9c ff f4 addi sp,sp,-12 801775c: 5b 8b 00 0c sw (sp+12),r11 8017760: 5b 8c 00 08 sw (sp+8),r12 8017764: 5b 9d 00 04 sw (sp+4),ra 8017768: 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; 801776c: 28 21 00 08 lw r1,(r1+8) Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 8017770: 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; 8017774: c8 41 08 00 sub r1,r2,r1 if ( information->maximum >= index ) { 8017778: 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; 801777c: 34 21 00 01 addi r1,r1,1 if ( information->maximum >= index ) { 8017780: 54 22 00 09 bgu r1,r2,80177a4 <_Objects_Get_no_protection+0x4c> if ( (the_object = information->local_table[ index ]) != NULL ) { 8017784: 28 8c 00 1c lw r12,(r4+28) 8017788: 34 02 00 02 mvi r2,2 801778c: fb ff d9 b2 calli 800de54 <__ashlsi3> 8017790: b5 81 08 00 add r1,r12,r1 8017794: 28 21 00 00 lw r1,(r1+0) 8017798: 44 20 00 03 be r1,r0,80177a4 <_Objects_Get_no_protection+0x4c><== NEVER TAKEN *location = OBJECTS_LOCAL; 801779c: 59 60 00 00 sw (r11+0),r0 return the_object; 80177a0: e0 00 00 04 bi 80177b0 <_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; 80177a4: 34 01 00 01 mvi r1,1 80177a8: 59 61 00 00 sw (r11+0),r1 return NULL; 80177ac: 34 01 00 00 mvi r1,0 } 80177b0: 2b 9d 00 04 lw ra,(sp+4) 80177b4: 2b 8b 00 0c lw r11,(sp+12) 80177b8: 2b 8c 00 08 lw r12,(sp+8) 80177bc: 37 9c 00 0c addi sp,sp,12 80177c0: c3 a0 00 00 ret =============================================================================== 080061fc <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 80061fc: 37 9c ff e8 addi sp,sp,-24 8006200: 5b 8b 00 14 sw (sp+20),r11 8006204: 5b 8c 00 10 sw (sp+16),r12 8006208: 5b 8d 00 0c sw (sp+12),r13 800620c: 5b 8e 00 08 sw (sp+8),r14 8006210: 5b 9d 00 04 sw (sp+4),ra 8006214: b8 40 70 00 mv r14,r2 /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 8006218: b8 20 58 00 mv r11,r1 800621c: 5c 20 00 05 bne r1,r0,8006230 <_Objects_Id_to_name+0x34> 8006220: 78 01 08 01 mvhi r1,0x801 8006224: 38 21 ea 48 ori r1,r1,0xea48 8006228: 28 21 00 0c lw r1,(r1+12) 800622c: 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); 8006230: 34 02 00 18 mvi r2,24 8006234: b9 60 08 00 mv r1,r11 8006238: f8 00 52 e4 calli 801adc8 <__lshrsi3> 800623c: 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 ) 8006240: 34 23 ff ff addi r3,r1,-1 8006244: 34 02 00 02 mvi r2,2 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 8006248: 34 0d 00 03 mvi r13,3 800624c: 54 62 00 12 bgu r3,r2,8006294 <_Objects_Id_to_name+0x98> 8006250: e0 00 00 19 bi 80062b4 <_Objects_Id_to_name+0xb8> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 8006254: 34 02 00 1b mvi r2,27 8006258: b9 60 08 00 mv r1,r11 800625c: f8 00 52 db calli 801adc8 <__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 ]; 8006260: 34 02 00 02 mvi r2,2 8006264: fb ff ec f6 calli 800163c <__ashlsi3> 8006268: b5 81 08 00 add r1,r12,r1 800626c: 28 21 00 00 lw r1,(r1+0) if ( !information ) 8006270: 44 20 00 09 be r1,r0,8006294 <_Objects_Id_to_name+0x98> <== NEVER TAKEN #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 8006274: b9 60 10 00 mv r2,r11 8006278: 37 83 00 18 addi r3,sp,24 800627c: fb ff ff ba calli 8006164 <_Objects_Get> if ( !the_object ) 8006280: 44 20 00 05 be r1,r0,8006294 <_Objects_Id_to_name+0x98> return OBJECTS_INVALID_ID; *name = the_object->name; 8006284: 28 21 00 0c lw r1,(r1+12) _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 8006288: 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; 800628c: 59 c1 00 00 sw (r14+0),r1 _Thread_Enable_dispatch(); 8006290: f8 00 02 5d calli 8006c04 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 8006294: b9 a0 08 00 mv r1,r13 8006298: 2b 9d 00 04 lw ra,(sp+4) 800629c: 2b 8b 00 14 lw r11,(sp+20) 80062a0: 2b 8c 00 10 lw r12,(sp+16) 80062a4: 2b 8d 00 0c lw r13,(sp+12) 80062a8: 2b 8e 00 08 lw r14,(sp+8) 80062ac: 37 9c 00 18 addi sp,sp,24 80062b0: 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 ] ) 80062b4: 78 0c 08 01 mvhi r12,0x801 80062b8: 34 02 00 02 mvi r2,2 80062bc: 39 8c e8 18 ori r12,r12,0xe818 80062c0: fb ff ec df calli 800163c <__ashlsi3> 80062c4: b5 81 08 00 add r1,r12,r1 80062c8: 28 2c 00 00 lw r12,(r1+0) 80062cc: 5d 80 ff e2 bne r12,r0,8006254 <_Objects_Id_to_name+0x58> 80062d0: e3 ff ff f1 bi 8006294 <_Objects_Id_to_name+0x98> =============================================================================== 08004728 <_Objects_Initialize_information>: , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 8004728: 37 9c ff e4 addi sp,sp,-28 800472c: 5b 8b 00 1c sw (sp+28),r11 8004730: 5b 8c 00 18 sw (sp+24),r12 8004734: 5b 8d 00 14 sw (sp+20),r13 8004738: 5b 8e 00 10 sw (sp+16),r14 800473c: 5b 8f 00 0c sw (sp+12),r15 8004740: 5b 90 00 08 sw (sp+8),r16 8004744: 5b 9d 00 04 sw (sp+4),ra 8004748: 20 6d ff ff andi r13,r3,0xffff 800474c: b8 20 58 00 mv r11,r1 8004750: 20 a5 ff ff andi r5,r5,0xffff uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; information->size = size; 8004754: 58 25 00 18 sw (r1+24),r5 uint32_t maximum_per_allocation; #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; 8004758: 59 62 00 00 sw (r11+0),r2 information->the_class = the_class; 800475c: 0c 2d 00 04 sh (r1+4),r13 information->size = size; information->local_table = 0; 8004760: 58 20 00 1c sw (r1+28),r0 information->inactive_per_block = 0; 8004764: 58 20 00 30 sw (r1+48),r0 information->object_blocks = 0; 8004768: 58 20 00 34 sw (r1+52),r0 information->inactive = 0; 800476c: 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; 8004770: 0c 20 00 10 sh (r1+16),r0 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 8004774: 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; 8004778: b8 40 08 00 mv r1,r2 800477c: 78 0f 08 01 mvhi r15,0x801 8004780: 34 02 00 02 mvi r2,2 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 8004784: b8 80 60 00 mv r12,r4 8004788: 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; 800478c: 39 ef 37 b8 ori r15,r15,0x37b8 8004790: f8 00 2f c5 calli 80106a4 <__ashlsi3> 8004794: b5 e1 08 00 add r1,r15,r1 8004798: 28 2f 00 00 lw r15,(r1+0) 800479c: 34 02 00 02 mvi r2,2 80047a0: b9 a0 08 00 mv r1,r13 80047a4: f8 00 2f c0 calli 80106a4 <__ashlsi3> 80047a8: b5 e1 08 00 add r1,r15,r1 80047ac: 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; 80047b0: 34 02 00 1f mvi r2,31 80047b4: b9 80 08 00 mv r1,r12 80047b8: f8 00 30 09 calli 80107dc <__lshrsi3> maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 80047bc: 78 03 08 01 mvhi r3,0x801 80047c0: 38 63 1c 1c ori r3,r3,0x1c1c /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 80047c4: 20 22 00 ff andi r2,r1,0xff maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 80047c8: 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 = 80047cc: 31 62 00 12 sb (r11+18),r2 (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 80047d0: a1 81 60 00 and r12,r12,r1 /* * Unlimited and maximum of zero is illogical. */ if ( information->auto_extend && maximum_per_allocation == 0) { 80047d4: 44 40 00 06 be r2,r0,80047ec <_Objects_Initialize_information+0xc4> 80047d8: 5d 80 00 05 bne r12,r0,80047ec <_Objects_Initialize_information+0xc4><== ALWAYS TAKEN _Internal_error_Occurred( 80047dc: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 80047e0: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 80047e4: 34 03 00 13 mvi r3,19 <== NOT EXECUTED 80047e8: fb ff fd f0 calli 8003fa8 <_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; 80047ec: 78 01 08 01 mvhi r1,0x801 80047f0: 38 21 36 28 ori r1,r1,0x3628 80047f4: 59 61 00 1c sw (r11+28),r1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 80047f8: 34 02 00 18 mvi r2,24 80047fc: b9 c0 08 00 mv r1,r14 } /* * The allocation unit is the maximum value */ information->allocation_size = maximum_per_allocation; 8004800: 0d 6c 00 14 sh (r11+20),r12 8004804: f8 00 2f a8 calli 80106a4 <__ashlsi3> 8004808: 78 0e 00 01 mvhi r14,0x1 800480c: b8 2e 70 00 or r14,r1,r14 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 8004810: 34 02 00 1b mvi r2,27 8004814: b9 a0 08 00 mv r1,r13 8004818: f8 00 2f a3 calli 80106a4 <__ashlsi3> information->local_table = &null_local_table; /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; 800481c: 7d 82 00 00 cmpnei r2,r12,0 8004820: 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) | 8004824: b8 22 08 00 or r1,r1,r2 information->minimum_id = 8004828: 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) ) 800482c: 22 01 00 03 andi r1,r16,0x3 8004830: ba 00 38 00 mv r7,r16 8004834: 44 20 00 04 be r1,r0,8004844 <_Objects_Initialize_information+0x11c><== ALWAYS TAKEN name_length = (name_length + OBJECTS_NAME_ALIGNMENT) & 8004838: 36 07 00 04 addi r7,r16,4 <== NOT EXECUTED 800483c: 34 01 ff fc mvi r1,-4 <== NOT EXECUTED 8004840: a0 e1 38 00 and r7,r7,r1 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8004844: 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); 8004848: 59 61 00 20 sw (r11+32),r1 ~(OBJECTS_NAME_ALIGNMENT-1); information->name_length = name_length; _Chain_Initialize_empty( &information->Inactive ); 800484c: 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; 8004850: 0d 67 00 38 sh (r11+56),r7 the_chain->permanent_null = NULL; 8004854: 59 60 00 24 sw (r11+36),r0 the_chain->last = _Chain_Head(the_chain); 8004858: 59 61 00 28 sw (r11+40),r1 _Chain_Initialize_empty( &information->Inactive ); /* * Initialize objects .. if there are any */ if ( maximum_per_allocation ) { 800485c: 45 80 00 03 be r12,r0,8004868 <_Objects_Initialize_information+0x140> /* * 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 ); 8004860: b9 60 08 00 mv r1,r11 8004864: fb ff fe 31 calli 8004128 <_Objects_Extend_information> _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 8004868: 2b 9d 00 04 lw ra,(sp+4) 800486c: 2b 8b 00 1c lw r11,(sp+28) 8004870: 2b 8c 00 18 lw r12,(sp+24) 8004874: 2b 8d 00 14 lw r13,(sp+20) 8004878: 2b 8e 00 10 lw r14,(sp+16) 800487c: 2b 8f 00 0c lw r15,(sp+12) 8004880: 2b 90 00 08 lw r16,(sp+8) 8004884: 37 9c 00 1c addi sp,sp,28 8004888: c3 a0 00 00 ret =============================================================================== 08002e38 <_RTEMS_tasks_Initialize_user_tasks_body>: * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { 8002e38: 37 9c ff e8 addi sp,sp,-24 8002e3c: 5b 8b 00 14 sw (sp+20),r11 8002e40: 5b 8c 00 10 sw (sp+16),r12 8002e44: 5b 8d 00 0c sw (sp+12),r13 8002e48: 5b 8e 00 08 sw (sp+8),r14 8002e4c: 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; 8002e50: 78 01 08 01 mvhi r1,0x801 8002e54: 38 21 30 8c ori r1,r1,0x308c 8002e58: 28 2b 00 2c lw r11,(r1+44) maximum = Configuration_RTEMS_API.number_of_initialization_tasks; 8002e5c: 28 2e 00 28 lw r14,(r1+40) /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) 8002e60: 34 0d 00 00 mvi r13,0 8002e64: 5d 60 00 1a bne r11,r0,8002ecc <_RTEMS_tasks_Initialize_user_tasks_body+0x94> 8002e68: e0 00 00 1a bi 8002ed0 <_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( 8002e6c: 29 61 00 00 lw r1,(r11+0) 8002e70: 29 62 00 08 lw r2,(r11+8) 8002e74: 29 63 00 04 lw r3,(r11+4) 8002e78: 29 64 00 14 lw r4,(r11+20) 8002e7c: 29 65 00 0c lw r5,(r11+12) 8002e80: 37 86 00 18 addi r6,sp,24 8002e84: fb ff ff 53 calli 8002bd0 8002e88: 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 ) ) 8002e8c: 44 20 00 05 be r1,r0,8002ea0 <_RTEMS_tasks_Initialize_user_tasks_body+0x68><== ALWAYS TAKEN _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 8002e90: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8002e94: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8002e98: b9 80 18 00 mv r3,r12 <== NOT EXECUTED 8002e9c: e0 00 00 0a bi 8002ec4 <_RTEMS_tasks_Initialize_user_tasks_body+0x8c><== NOT EXECUTED return_value = rtems_task_start( 8002ea0: 29 63 00 18 lw r3,(r11+24) 8002ea4: 29 62 00 10 lw r2,(r11+16) 8002ea8: 2b 81 00 18 lw r1,(sp+24) 8002eac: 35 6b 00 1c addi r11,r11,28 8002eb0: f8 00 00 0f calli 8002eec 8002eb4: b8 20 18 00 mv r3,r1 id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) 8002eb8: 44 2c 00 04 be r1,r12,8002ec8 <_RTEMS_tasks_Initialize_user_tasks_body+0x90><== ALWAYS TAKEN _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 8002ebc: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8002ec0: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8002ec4: f8 00 04 39 calli 8003fa8 <_Internal_error_Occurred> <== NOT EXECUTED return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 8002ec8: 35 ad 00 01 addi r13,r13,1 8002ecc: 55 cd ff e8 bgu r14,r13,8002e6c <_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 ); } } 8002ed0: 2b 9d 00 04 lw ra,(sp+4) 8002ed4: 2b 8b 00 14 lw r11,(sp+20) 8002ed8: 2b 8c 00 10 lw r12,(sp+16) 8002edc: 2b 8d 00 0c lw r13,(sp+12) 8002ee0: 2b 8e 00 08 lw r14,(sp+8) 8002ee4: 37 9c 00 18 addi sp,sp,24 8002ee8: c3 a0 00 00 ret =============================================================================== 0800887c <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 800887c: 37 9c ff f0 addi sp,sp,-16 8008880: 5b 8b 00 0c sw (sp+12),r11 8008884: 5b 8c 00 08 sw (sp+8),r12 8008888: 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 ]; 800888c: 28 2b 01 24 lw r11,(r1+292) if ( !api ) 8008890: 45 60 00 1a be r11,r0,80088f8 <_RTEMS_tasks_Post_switch_extension+0x7c><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 8008894: 90 00 08 00 rcsr r1,IE 8008898: 34 02 ff fe mvi r2,-2 800889c: a0 22 10 00 and r2,r1,r2 80088a0: d0 02 00 00 wcsr IE,r2 signal_set = asr->signals_posted; 80088a4: 29 6c 00 14 lw r12,(r11+20) asr->signals_posted = 0; 80088a8: 59 60 00 14 sw (r11+20),r0 _ISR_Enable( level ); 80088ac: d0 01 00 00 wcsr IE,r1 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 80088b0: 45 80 00 12 be r12,r0,80088f8 <_RTEMS_tasks_Post_switch_extension+0x7c> return; asr->nest_level += 1; 80088b4: 29 61 00 1c lw r1,(r11+28) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 80088b8: 37 83 00 10 addi r3,sp,16 80088bc: 38 02 ff ff mvu r2,0xffff if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 80088c0: 34 21 00 01 addi r1,r1,1 80088c4: 59 61 00 1c sw (r11+28),r1 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 80088c8: 29 61 00 10 lw r1,(r11+16) 80088cc: f8 00 08 e9 calli 800ac70 (*asr->handler)( signal_set ); 80088d0: 29 62 00 0c lw r2,(r11+12) 80088d4: b9 80 08 00 mv r1,r12 80088d8: d8 40 00 00 call r2 asr->nest_level -= 1; 80088dc: 29 61 00 1c lw r1,(r11+28) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 80088e0: 38 02 ff ff mvu r2,0xffff 80088e4: 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; 80088e8: 34 21 ff ff addi r1,r1,-1 80088ec: 59 61 00 1c sw (r11+28),r1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 80088f0: 2b 81 00 10 lw r1,(sp+16) 80088f4: f8 00 08 df calli 800ac70 } 80088f8: 2b 9d 00 04 lw ra,(sp+4) 80088fc: 2b 8b 00 0c lw r11,(sp+12) 8008900: 2b 8c 00 08 lw r12,(sp+8) 8008904: 37 9c 00 10 addi sp,sp,16 8008908: c3 a0 00 00 ret =============================================================================== 08004604 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 8004604: 37 9c ff f4 addi sp,sp,-12 8004608: 5b 8b 00 08 sw (sp+8),r11 800460c: 5b 9d 00 04 sw (sp+4),ra 8004610: b8 20 10 00 mv r2,r1 8004614: 78 01 08 01 mvhi r1,0x801 8004618: 38 21 f8 18 ori r1,r1,0xf818 800461c: 37 83 00 0c addi r3,sp,12 8004620: f8 00 08 c4 calli 8006930 <_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 ) { 8004624: 2b 82 00 0c lw r2,(sp+12) 8004628: b8 20 58 00 mv r11,r1 800462c: 5c 40 00 22 bne r2,r0,80046b4 <_Rate_monotonic_Timeout+0xb0><== NEVER TAKEN case OBJECTS_LOCAL: the_thread = the_period->owner; 8004630: 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); 8004634: 28 23 00 10 lw r3,(r1+16) 8004638: 20 63 40 00 andi r3,r3,0x4000 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 800463c: 44 62 00 09 be r3,r2,8004660 <_Rate_monotonic_Timeout+0x5c> 8004640: 28 23 00 20 lw r3,(r1+32) 8004644: 29 62 00 08 lw r2,(r11+8) 8004648: 5c 62 00 06 bne r3,r2,8004660 <_Rate_monotonic_Timeout+0x5c> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800464c: 78 03 08 01 mvhi r3,0x801 8004650: 38 63 cd b4 ori r3,r3,0xcdb4 8004654: 28 62 00 00 lw r2,(r3+0) 8004658: f8 00 0a 4a calli 8006f80 <_Thread_Clear_state> 800465c: e0 00 00 06 bi 8004674 <_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 ) { 8004660: 29 62 00 38 lw r2,(r11+56) 8004664: 34 01 00 01 mvi r1,1 8004668: 5c 41 00 0c bne r2,r1,8004698 <_Rate_monotonic_Timeout+0x94> the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 800466c: 34 01 00 03 mvi r1,3 8004670: 59 61 00 38 sw (r11+56),r1 _Rate_monotonic_Initiate_statistics( the_period ); 8004674: b9 60 08 00 mv r1,r11 8004678: fb ff fe 2e calli 8003f30 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 800467c: 29 61 00 3c lw r1,(r11+60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8004680: 35 62 00 10 addi r2,r11,16 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8004684: 59 61 00 1c sw (r11+28),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8004688: 78 01 08 01 mvhi r1,0x801 800468c: 38 21 fa 08 ori r1,r1,0xfa08 8004690: f8 00 10 ed calli 8008a44 <_Watchdog_Insert> 8004694: e0 00 00 03 bi 80046a0 <_Rate_monotonic_Timeout+0x9c> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 8004698: 34 01 00 04 mvi r1,4 800469c: 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; 80046a0: 78 01 08 01 mvhi r1,0x801 80046a4: 38 21 f9 44 ori r1,r1,0xf944 80046a8: 28 22 00 00 lw r2,(r1+0) 80046ac: 34 42 ff ff addi r2,r2,-1 80046b0: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 80046b4: 2b 9d 00 04 lw ra,(sp+4) 80046b8: 2b 8b 00 08 lw r11,(sp+8) 80046bc: 37 9c 00 0c addi sp,sp,12 80046c0: c3 a0 00 00 ret =============================================================================== 08003fc4 <_Rate_monotonic_Update_statistics>: void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 8003fc4: 37 9c ff e4 addi sp,sp,-28 8003fc8: 5b 8b 00 0c sw (sp+12),r11 8003fcc: 5b 8c 00 08 sw (sp+8),r12 8003fd0: 5b 9d 00 04 sw (sp+4),ra 8003fd4: b8 20 58 00 mv r11,r1 /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 8003fd8: 28 21 00 54 lw r1,(r1+84) if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 8003fdc: 29 62 00 38 lw r2,(r11+56) /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 8003fe0: 34 21 00 01 addi r1,r1,1 8003fe4: 59 61 00 54 sw (r11+84),r1 if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 8003fe8: 34 01 00 04 mvi r1,4 8003fec: 5c 41 00 04 bne r2,r1,8003ffc <_Rate_monotonic_Update_statistics+0x38> stats->missed_count++; 8003ff0: 29 61 00 58 lw r1,(r11+88) 8003ff4: 34 21 00 01 addi r1,r1,1 8003ff8: 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 ); 8003ffc: 37 8c 00 18 addi r12,sp,24 stats->missed_count++; /* * Grab status for time statistics. */ valid_status = 8004000: b9 60 08 00 mv r1,r11 8004004: 37 82 00 10 addi r2,sp,16 8004008: b9 80 18 00 mv r3,r12 800400c: fb ff ff 90 calli 8003e4c <_Rate_monotonic_Get_status> _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 8004010: 44 20 00 28 be r1,r0,80040b0 <_Rate_monotonic_Update_statistics+0xec><== NEVER TAKEN /* * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); 8004014: b9 80 10 00 mv r2,r12 8004018: 35 61 00 6c addi r1,r11,108 800401c: f8 00 11 27 calli 80084b8 <_Timespec_Add_to> if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 8004020: b9 80 08 00 mv r1,r12 8004024: 35 62 00 5c addi r2,r11,92 8004028: f8 00 11 82 calli 8008630 <_Timespec_Less_than> 800402c: 44 20 00 05 be r1,r0,8004040 <_Rate_monotonic_Update_statistics+0x7c> stats->min_cpu_time = executed; 8004030: 2b 81 00 18 lw r1,(sp+24) 8004034: 59 61 00 5c sw (r11+92),r1 8004038: 2b 81 00 1c lw r1,(sp+28) 800403c: 59 61 00 60 sw (r11+96),r1 if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 8004040: 37 81 00 18 addi r1,sp,24 8004044: 35 62 00 64 addi r2,r11,100 8004048: f8 00 11 6f calli 8008604 <_Timespec_Greater_than> 800404c: 44 20 00 05 be r1,r0,8004060 <_Rate_monotonic_Update_statistics+0x9c> stats->max_cpu_time = executed; 8004050: 2b 81 00 18 lw r1,(sp+24) 8004054: 59 61 00 64 sw (r11+100),r1 8004058: 2b 81 00 1c lw r1,(sp+28) 800405c: 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 ); 8004060: 37 8c 00 10 addi r12,sp,16 8004064: b9 80 10 00 mv r2,r12 8004068: 35 61 00 84 addi r1,r11,132 800406c: f8 00 11 13 calli 80084b8 <_Timespec_Add_to> if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 8004070: b9 80 08 00 mv r1,r12 8004074: 35 62 00 74 addi r2,r11,116 8004078: f8 00 11 6e calli 8008630 <_Timespec_Less_than> 800407c: 44 20 00 05 be r1,r0,8004090 <_Rate_monotonic_Update_statistics+0xcc> stats->min_wall_time = since_last_period; 8004080: 2b 81 00 10 lw r1,(sp+16) 8004084: 59 61 00 74 sw (r11+116),r1 8004088: 2b 81 00 14 lw r1,(sp+20) 800408c: 59 61 00 78 sw (r11+120),r1 if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 8004090: 37 81 00 10 addi r1,sp,16 8004094: 35 62 00 7c addi r2,r11,124 8004098: f8 00 11 5b calli 8008604 <_Timespec_Greater_than> 800409c: 44 20 00 05 be r1,r0,80040b0 <_Rate_monotonic_Update_statistics+0xec> stats->max_wall_time = since_last_period; 80040a0: 2b 81 00 10 lw r1,(sp+16) 80040a4: 59 61 00 7c sw (r11+124),r1 80040a8: 2b 81 00 14 lw r1,(sp+20) 80040ac: 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 } 80040b0: 2b 9d 00 04 lw ra,(sp+4) 80040b4: 2b 8b 00 0c lw r11,(sp+12) 80040b8: 2b 8c 00 08 lw r12,(sp+8) 80040bc: 37 9c 00 1c addi sp,sp,28 80040c0: c3 a0 00 00 ret =============================================================================== 08003948 <_TOD_Get>: */ void _TOD_Get( struct timespec *time ) { 8003948: 37 9c ff e4 addi sp,sp,-28 800394c: 5b 8b 00 0c sw (sp+12),r11 8003950: 5b 8c 00 08 sw (sp+8),r12 8003954: 5b 9d 00 04 sw (sp+4),ra 8003958: 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 ); 800395c: 90 00 60 00 rcsr r12,IE 8003960: 34 01 ff fe mvi r1,-2 8003964: a1 81 08 00 and r1,r12,r1 8003968: d0 01 00 00 wcsr IE,r1 now = _TOD_Now; 800396c: 78 02 08 01 mvhi r2,0x801 8003970: 38 42 38 a4 ori r2,r2,0x38a4 8003974: 28 41 00 00 lw r1,(r2+0) 8003978: 5b 81 00 10 sw (sp+16),r1 800397c: 28 41 00 04 lw r1,(r2+4) if ( _Watchdog_Nanoseconds_since_tick_handler ) 8003980: 78 02 08 01 mvhi r2,0x801 8003984: 38 42 39 a0 ori r2,r2,0x39a0 8003988: 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; 800398c: 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; 8003990: 34 02 00 00 mvi r2,0 _ISR_Disable( level ); now = _TOD_Now; if ( _Watchdog_Nanoseconds_since_tick_handler ) 8003994: 44 60 00 03 be r3,r0,80039a0 <_TOD_Get+0x58> <== ALWAYS TAKEN nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 8003998: d8 60 00 00 call r3 <== NOT EXECUTED 800399c: b8 20 10 00 mv r2,r1 <== NOT EXECUTED _ISR_Enable( level ); 80039a0: d0 0c 00 00 wcsr IE,r12 _Timestamp_Set( &offset, 0, nanoseconds ); 80039a4: 5b 82 00 1c sw (sp+28),r2 _Timestamp_Add_to( &now, &offset ); 80039a8: 37 81 00 10 addi r1,sp,16 80039ac: 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 ); 80039b0: 5b 80 00 18 sw (sp+24),r0 _Timestamp_Add_to( &now, &offset ); 80039b4: f8 00 09 9e calli 800602c <_Timespec_Add_to> _Timestamp_To_timespec( &now, time ); 80039b8: 2b 81 00 10 lw r1,(sp+16) 80039bc: 59 61 00 00 sw (r11+0),r1 80039c0: 2b 81 00 14 lw r1,(sp+20) 80039c4: 59 61 00 04 sw (r11+4),r1 } 80039c8: 2b 9d 00 04 lw ra,(sp+4) 80039cc: 2b 8b 00 0c lw r11,(sp+12) 80039d0: 2b 8c 00 08 lw r12,(sp+8) 80039d4: 37 9c 00 1c addi sp,sp,28 80039d8: c3 a0 00 00 ret =============================================================================== 08008d50 <_TOD_Get_uptime>: */ void _TOD_Get_uptime( Timestamp_Control *uptime ) { 8008d50: 37 9c ff e4 addi sp,sp,-28 8008d54: 5b 8b 00 0c sw (sp+12),r11 8008d58: 5b 8c 00 08 sw (sp+8),r12 8008d5c: 5b 9d 00 04 sw (sp+4),ra 8008d60: 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 ); 8008d64: 90 00 60 00 rcsr r12,IE 8008d68: 34 01 ff fe mvi r1,-2 8008d6c: a1 81 08 00 and r1,r12,r1 8008d70: d0 01 00 00 wcsr IE,r1 up = _TOD_Uptime; 8008d74: 78 02 08 01 mvhi r2,0x801 8008d78: 38 42 38 98 ori r2,r2,0x3898 8008d7c: 28 41 00 00 lw r1,(r2+0) 8008d80: 5b 81 00 10 sw (sp+16),r1 8008d84: 28 41 00 04 lw r1,(r2+4) if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008d88: 78 02 08 01 mvhi r2,0x801 8008d8c: 38 42 39 a0 ori r2,r2,0x39a0 8008d90: 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; 8008d94: 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; 8008d98: 34 02 00 00 mvi r2,0 _ISR_Disable( level ); up = _TOD_Uptime; if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008d9c: 44 60 00 03 be r3,r0,8008da8 <_TOD_Get_uptime+0x58> <== ALWAYS TAKEN nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 8008da0: d8 60 00 00 call r3 <== NOT EXECUTED 8008da4: b8 20 10 00 mv r2,r1 <== NOT EXECUTED _ISR_Enable( level ); 8008da8: d0 0c 00 00 wcsr IE,r12 _Timestamp_Set( &offset, 0, nanoseconds ); 8008dac: 5b 82 00 1c sw (sp+28),r2 _Timestamp_Add_to( &up, &offset ); 8008db0: 37 81 00 10 addi r1,sp,16 8008db4: 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 ); 8008db8: 5b 80 00 18 sw (sp+24),r0 _Timestamp_Add_to( &up, &offset ); 8008dbc: fb ff f4 9c calli 800602c <_Timespec_Add_to> *uptime = up; 8008dc0: 2b 81 00 10 lw r1,(sp+16) 8008dc4: 59 61 00 00 sw (r11+0),r1 8008dc8: 2b 81 00 14 lw r1,(sp+20) 8008dcc: 59 61 00 04 sw (r11+4),r1 } 8008dd0: 2b 9d 00 04 lw ra,(sp+4) 8008dd4: 2b 8b 00 0c lw r11,(sp+12) 8008dd8: 2b 8c 00 08 lw r12,(sp+8) 8008ddc: 37 9c 00 1c addi sp,sp,28 8008de0: c3 a0 00 00 ret =============================================================================== 08004230 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 8004230: 37 9c ff f0 addi sp,sp,-16 8004234: 5b 8b 00 10 sw (sp+16),r11 8004238: 5b 8c 00 0c sw (sp+12),r12 800423c: 5b 8d 00 08 sw (sp+8),r13 8004240: 5b 9d 00 04 sw (sp+4),ra 8004244: 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(); 8004248: 78 01 08 01 mvhi r1,0x801 800424c: 38 21 f0 c4 ori r1,r1,0xf0c4 8004250: 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; 8004254: 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) || 8004258: 45 60 00 22 be r11,r0,80042e0 <_TOD_Validate+0xb0> <== NEVER TAKEN ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 800425c: 78 03 08 01 mvhi r3,0x801 8004260: 38 63 cb e4 ori r3,r3,0xcbe4 8004264: 28 61 00 00 lw r1,(r3+0) 8004268: f8 00 5e 28 calli 801bb08 <__udivsi3> rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 800426c: 29 62 00 18 lw r2,(r11+24) 8004270: 50 41 00 1c bgeu r2,r1,80042e0 <_TOD_Validate+0xb0> (the_tod->ticks >= ticks_per_second) || 8004274: 29 62 00 14 lw r2,(r11+20) 8004278: 34 01 00 3b mvi r1,59 800427c: 54 41 00 19 bgu r2,r1,80042e0 <_TOD_Validate+0xb0> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 8004280: 29 62 00 10 lw r2,(r11+16) 8004284: 54 41 00 17 bgu r2,r1,80042e0 <_TOD_Validate+0xb0> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 8004288: 29 62 00 0c lw r2,(r11+12) 800428c: 34 01 00 17 mvi r1,23 8004290: 54 41 00 14 bgu r2,r1,80042e0 <_TOD_Validate+0xb0> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 8004294: 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) || 8004298: 44 20 00 12 be r1,r0,80042e0 <_TOD_Validate+0xb0> <== NEVER TAKEN (the_tod->month == 0) || 800429c: 34 02 00 0c mvi r2,12 80042a0: 54 22 00 10 bgu r1,r2,80042e0 <_TOD_Validate+0xb0> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 80042a4: 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) || 80042a8: 34 03 07 c3 mvi r3,1987 80042ac: 50 62 00 0d bgeu r3,r2,80042e0 <_TOD_Validate+0xb0> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 80042b0: 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) || 80042b4: 45 a0 00 0b be r13,r0,80042e0 <_TOD_Validate+0xb0> <== NEVER TAKEN 80042b8: 78 0b 08 01 mvhi r11,0x801 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 80042bc: 20 42 00 03 andi r2,r2,0x3 80042c0: 39 6b d4 9c ori r11,r11,0xd49c 80042c4: 5c 40 00 02 bne r2,r0,80042cc <_TOD_Validate+0x9c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 80042c8: 34 21 00 0d addi r1,r1,13 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 80042cc: 34 02 00 02 mvi r2,2 80042d0: fb ff f3 f4 calli 80012a0 <__ashlsi3> 80042d4: b5 61 08 00 add r1,r11,r1 80042d8: 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( 80042dc: f1 8d 60 00 cmpgeu r12,r12,r13 if ( the_tod->day > days_in_month ) return false; return true; } 80042e0: b9 80 08 00 mv r1,r12 80042e4: 2b 9d 00 04 lw ra,(sp+4) 80042e8: 2b 8b 00 10 lw r11,(sp+16) 80042ec: 2b 8c 00 0c lw r12,(sp+12) 80042f0: 2b 8d 00 08 lw r13,(sp+8) 80042f4: 37 9c 00 10 addi sp,sp,16 80042f8: c3 a0 00 00 ret =============================================================================== 08004ac0 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 8004ac0: 37 9c ff ec addi sp,sp,-20 8004ac4: 5b 8b 00 14 sw (sp+20),r11 8004ac8: 5b 8c 00 10 sw (sp+16),r12 8004acc: 5b 8d 00 0c sw (sp+12),r13 8004ad0: 5b 8e 00 08 sw (sp+8),r14 8004ad4: 5b 9d 00 04 sw (sp+4),ra 8004ad8: b8 20 58 00 mv r11,r1 */ /* * Save original state */ original_state = the_thread->current_state; 8004adc: 28 2e 00 10 lw r14,(r1+16) void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 8004ae0: b8 40 60 00 mv r12,r2 8004ae4: 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 ); 8004ae8: f8 00 04 99 calli 8005d4c <_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 ) 8004aec: 29 61 00 14 lw r1,(r11+20) 8004af0: 44 2c 00 04 be r1,r12,8004b00 <_Thread_Change_priority+0x40> _Thread_Set_priority( the_thread, new_priority ); 8004af4: b9 60 08 00 mv r1,r11 8004af8: b9 80 10 00 mv r2,r12 8004afc: f8 00 03 e9 calli 8005aa0 <_Thread_Set_priority> _ISR_Disable( level ); 8004b00: 90 00 60 00 rcsr r12,IE 8004b04: 34 04 ff fe mvi r4,-2 8004b08: a1 84 20 00 and r4,r12,r4 8004b0c: 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; 8004b10: 29 61 00 10 lw r1,(r11+16) if ( state != STATES_TRANSIENT ) { 8004b14: 34 03 00 04 mvi r3,4 8004b18: 21 c2 00 04 andi r2,r14,0x4 8004b1c: 44 23 00 0f be r1,r3,8004b58 <_Thread_Change_priority+0x98> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 8004b20: 5c 40 00 04 bne r2,r0,8004b30 <_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); 8004b24: 34 02 ff fb mvi r2,-5 8004b28: a0 22 10 00 and r2,r1,r2 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 8004b2c: 59 62 00 10 sw (r11+16),r2 _ISR_Enable( level ); 8004b30: 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); 8004b34: 78 03 08 01 mvhi r3,0x801 8004b38: 38 63 1c 20 ori r3,r3,0x1c20 8004b3c: 28 62 00 00 lw r2,(r3+0) 8004b40: a0 22 08 00 and r1,r1,r2 if ( _States_Is_waiting_on_thread_queue( state ) ) { 8004b44: 44 20 00 60 be r1,r0,8004cc4 <_Thread_Change_priority+0x204> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 8004b48: 29 61 00 44 lw r1,(r11+68) 8004b4c: b9 60 10 00 mv r2,r11 8004b50: f8 00 03 9f calli 80059cc <_Thread_queue_Requeue> 8004b54: e0 00 00 5c bi 8004cc4 <_Thread_Change_priority+0x204> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 8004b58: 5c 40 00 1c bne r2,r0,8004bc8 <_Thread_Change_priority+0x108><== NEVER TAKEN RTEMS_INLINE_ROUTINE void _Priority_bit_map_Add ( Priority_bit_map_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 8004b5c: 29 61 00 90 lw r1,(r11+144) 8004b60: 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 ); 8004b64: 59 60 00 10 sw (r11+16),r0 8004b68: 2c 25 00 00 lhu r5,(r1+0) 8004b6c: b8 a3 18 00 or r3,r5,r3 8004b70: 0c 23 00 00 sh (r1+0),r3 _Priority_Major_bit_map |= the_priority_map->ready_major; 8004b74: 78 01 08 01 mvhi r1,0x801 8004b78: 38 21 38 bc ori r1,r1,0x38bc 8004b7c: 2c 23 00 00 lhu r3,(r1+0) 8004b80: 2d 65 00 94 lhu r5,(r11+148) 8004b84: b8 a3 18 00 or r3,r5,r3 8004b88: 20 63 ff ff andi r3,r3,0xffff 8004b8c: 0c 23 00 00 sh (r1+0),r3 8004b90: 29 61 00 8c lw r1,(r11+140) _Priority_bit_map_Add( &the_thread->Priority_map ); if ( prepend_it ) 8004b94: 45 a2 00 07 be r13,r2,8004bb0 <_Thread_Change_priority+0xf0> ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 8004b98: 28 22 00 00 lw r2,(r1+0) Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 8004b9c: 59 61 00 04 sw (r11+4),r1 before_node = after_node->next; after_node->next = the_node; 8004ba0: 58 2b 00 00 sw (r1+0),r11 the_node->next = before_node; 8004ba4: 59 62 00 00 sw (r11+0),r2 before_node->previous = the_node; 8004ba8: 58 4b 00 04 sw (r2+4),r11 8004bac: e0 00 00 07 bi 8004bc8 <_Thread_Change_priority+0x108> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8004bb0: 34 22 00 04 addi r2,r1,4 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 8004bb4: 59 62 00 00 sw (r11+0),r2 old_last_node = the_chain->last; 8004bb8: 28 22 00 08 lw r2,(r1+8) the_chain->last = the_node; 8004bbc: 58 2b 00 08 sw (r1+8),r11 old_last_node->next = the_node; 8004bc0: 58 4b 00 00 sw (r2+0),r11 the_node->previous = old_last_node; 8004bc4: 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 ); 8004bc8: d0 0c 00 00 wcsr IE,r12 8004bcc: d0 04 00 00 wcsr IE,r4 */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) _Thread_Ready_chain[ _Priority_bit_map_Get_highest() ].first; 8004bd0: 78 01 08 01 mvhi r1,0x801 RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 8004bd4: 78 02 08 01 mvhi r2,0x801 8004bd8: 38 21 37 b0 ori r1,r1,0x37b0 8004bdc: 38 42 38 bc ori r2,r2,0x38bc 8004be0: 28 2e 00 00 lw r14,(r1+0) 8004be4: 2c 41 00 00 lhu r1,(r2+0) 8004be8: 78 0b 08 01 mvhi r11,0x801 8004bec: 34 02 00 ff mvi r2,255 8004bf0: 20 21 ff ff andi r1,r1,0xffff 8004bf4: 39 6b 1a a8 ori r11,r11,0x1aa8 8004bf8: 54 22 00 05 bgu r1,r2,8004c0c <_Thread_Change_priority+0x14c> 8004bfc: b5 61 58 00 add r11,r11,r1 8004c00: 41 6d 00 00 lbu r13,(r11+0) 8004c04: 35 ad 00 08 addi r13,r13,8 8004c08: e0 00 00 05 bi 8004c1c <_Thread_Change_priority+0x15c> 8004c0c: 34 02 00 08 mvi r2,8 8004c10: f8 00 2e f3 calli 80107dc <__lshrsi3> 8004c14: b5 61 58 00 add r11,r11,r1 8004c18: 41 6d 00 00 lbu r13,(r11+0) _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 8004c1c: 34 02 00 01 mvi r2,1 8004c20: 78 0b 08 01 mvhi r11,0x801 8004c24: b9 a0 08 00 mv r1,r13 8004c28: f8 00 2e 9f calli 80106a4 <__ashlsi3> 8004c2c: 39 6b 39 30 ori r11,r11,0x3930 8004c30: b5 61 58 00 add r11,r11,r1 8004c34: 2d 62 00 00 lhu r2,(r11+0) 8004c38: 34 01 00 ff mvi r1,255 8004c3c: 78 0b 08 01 mvhi r11,0x801 8004c40: 39 6b 1a a8 ori r11,r11,0x1aa8 8004c44: 54 41 00 05 bgu r2,r1,8004c58 <_Thread_Change_priority+0x198> 8004c48: b5 62 58 00 add r11,r11,r2 8004c4c: 41 6b 00 00 lbu r11,(r11+0) 8004c50: 35 6b 00 08 addi r11,r11,8 8004c54: e0 00 00 06 bi 8004c6c <_Thread_Change_priority+0x1ac> 8004c58: b8 40 08 00 mv r1,r2 8004c5c: 34 02 00 08 mvi r2,8 8004c60: f8 00 2e df calli 80107dc <__lshrsi3> 8004c64: b5 61 58 00 add r11,r11,r1 8004c68: 41 6b 00 00 lbu r11,(r11+0) return (_Priority_Bits_index( major ) << 4) + 8004c6c: 34 02 00 04 mvi r2,4 8004c70: b9 a0 08 00 mv r1,r13 8004c74: f8 00 2e 8c calli 80106a4 <__ashlsi3> 8004c78: b5 61 58 00 add r11,r11,r1 8004c7c: 34 02 00 01 mvi r2,1 8004c80: b9 60 08 00 mv r1,r11 8004c84: f8 00 2e 88 calli 80106a4 <__ashlsi3> 8004c88: 34 02 00 02 mvi r2,2 8004c8c: b4 2b 08 00 add r1,r1,r11 8004c90: f8 00 2e 85 calli 80106a4 <__ashlsi3> 8004c94: b5 c1 08 00 add r1,r14,r1 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 8004c98: 28 23 00 00 lw r3,(r1+0) 8004c9c: 78 01 08 01 mvhi r1,0x801 8004ca0: 38 21 39 e8 ori r1,r1,0x39e8 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 8004ca4: 28 22 00 0c lw r2,(r1+12) * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 8004ca8: 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() && 8004cac: 44 43 00 05 be r2,r3,8004cc0 <_Thread_Change_priority+0x200> 8004cb0: 40 42 00 74 lbu r2,(r2+116) 8004cb4: 44 40 00 03 be r2,r0,8004cc0 <_Thread_Change_priority+0x200> _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 8004cb8: 34 02 00 01 mvi r2,1 8004cbc: 30 22 00 18 sb (r1+24),r2 _ISR_Enable( level ); 8004cc0: d0 0c 00 00 wcsr IE,r12 } 8004cc4: 2b 9d 00 04 lw ra,(sp+4) 8004cc8: 2b 8b 00 14 lw r11,(sp+20) 8004ccc: 2b 8c 00 10 lw r12,(sp+16) 8004cd0: 2b 8d 00 0c lw r13,(sp+12) 8004cd4: 2b 8e 00 08 lw r14,(sp+8) 8004cd8: 37 9c 00 14 addi sp,sp,20 8004cdc: c3 a0 00 00 ret =============================================================================== 080092f4 <_Thread_Clear_state>: ) { ISR_Level level; States_Control current_state; _ISR_Disable( level ); 80092f4: 90 00 18 00 rcsr r3,IE 80092f8: 34 04 ff fe mvi r4,-2 80092fc: a0 64 20 00 and r4,r3,r4 8009300: d0 04 00 00 wcsr IE,r4 current_state = the_thread->current_state; 8009304: 28 25 00 10 lw r5,(r1+16) if ( current_state & state ) { 8009308: a0 45 30 00 and r6,r2,r5 800930c: 44 c0 00 29 be r6,r0,80093b0 <_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); 8009310: a4 40 10 00 not r2,r2 8009314: a0 45 10 00 and r2,r2,r5 current_state = the_thread->current_state = _States_Clear( state, current_state ); 8009318: 58 22 00 10 sw (r1+16),r2 if ( _States_Is_ready( current_state ) ) { 800931c: 5c 40 00 25 bne r2,r0,80093b0 <_Thread_Clear_state+0xbc> RTEMS_INLINE_ROUTINE void _Priority_bit_map_Add ( Priority_bit_map_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 8009320: 28 22 00 90 lw r2,(r1+144) 8009324: 2c 25 00 96 lhu r5,(r1+150) 8009328: 2c 46 00 00 lhu r6,(r2+0) 800932c: b8 c5 28 00 or r5,r6,r5 8009330: 0c 45 00 00 sh (r2+0),r5 _Priority_Major_bit_map |= the_priority_map->ready_major; 8009334: 78 02 08 01 mvhi r2,0x801 8009338: 38 42 38 bc ori r2,r2,0x38bc 800933c: 2c 45 00 00 lhu r5,(r2+0) 8009340: 2c 26 00 94 lhu r6,(r1+148) 8009344: b8 c5 28 00 or r5,r6,r5 8009348: 20 a5 ff ff andi r5,r5,0xffff 800934c: 0c 45 00 00 sh (r2+0),r5 _Priority_bit_map_Add( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 8009350: 28 22 00 8c lw r2,(r1+140) 8009354: 34 45 00 04 addi r5,r2,4 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 8009358: 58 25 00 00 sw (r1+0),r5 old_last_node = the_chain->last; 800935c: 28 45 00 08 lw r5,(r2+8) the_chain->last = the_node; 8009360: 58 41 00 08 sw (r2+8),r1 old_last_node->next = the_node; 8009364: 58 a1 00 00 sw (r5+0),r1 the_node->previous = old_last_node; 8009368: 58 25 00 04 sw (r1+4),r5 _ISR_Flash( level ); 800936c: d0 03 00 00 wcsr IE,r3 8009370: 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 ) { 8009374: 78 02 08 01 mvhi r2,0x801 8009378: 38 42 39 e8 ori r2,r2,0x39e8 800937c: 28 45 00 10 lw r5,(r2+16) 8009380: 28 24 00 14 lw r4,(r1+20) 8009384: 28 a5 00 14 lw r5,(r5+20) 8009388: 50 85 00 0a bgeu r4,r5,80093b0 <_Thread_Clear_state+0xbc> _Thread_Heir = the_thread; 800938c: 58 41 00 10 sw (r2+16),r1 if ( _Thread_Executing->is_preemptible || 8009390: 28 41 00 0c lw r1,(r2+12) 8009394: 40 21 00 74 lbu r1,(r1+116) 8009398: 5c 20 00 02 bne r1,r0,80093a0 <_Thread_Clear_state+0xac> 800939c: 5c 81 00 05 bne r4,r1,80093b0 <_Thread_Clear_state+0xbc> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 80093a0: 78 01 08 01 mvhi r1,0x801 80093a4: 38 21 39 e8 ori r1,r1,0x39e8 80093a8: 34 02 00 01 mvi r2,1 80093ac: 30 22 00 18 sb (r1+24),r2 } } } _ISR_Enable( level ); 80093b0: d0 03 00 00 wcsr IE,r3 } 80093b4: c3 a0 00 00 ret =============================================================================== 0800b99c <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 800b99c: 37 9c ff f8 addi sp,sp,-8 800b9a0: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 800b9a4: 37 82 00 08 addi r2,sp,8 800b9a8: f8 00 00 7c calli 800bb98 <_Thread_Get> switch ( location ) { 800b9ac: 2b 82 00 08 lw r2,(sp+8) 800b9b0: 5c 40 00 0a bne r2,r0,800b9d8 <_Thread_Delay_ended+0x3c> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 800b9b4: 78 03 08 02 mvhi r3,0x802 800b9b8: 38 63 51 d4 ori r3,r3,0x51d4 800b9bc: 28 62 00 00 lw r2,(r3+0) 800b9c0: fb ff ff 5a calli 800b728 <_Thread_Clear_state> 800b9c4: 78 01 08 02 mvhi r1,0x802 800b9c8: 38 21 79 9c ori r1,r1,0x799c 800b9cc: 28 22 00 00 lw r2,(r1+0) 800b9d0: 34 42 ff ff addi r2,r2,-1 800b9d4: 58 22 00 00 sw (r1+0),r2 | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 800b9d8: 2b 9d 00 04 lw ra,(sp+4) 800b9dc: 37 9c 00 08 addi sp,sp,8 800b9e0: c3 a0 00 00 ret =============================================================================== 08004e90 <_Thread_Dispatch>: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 8004e90: 37 9c ff c0 addi sp,sp,-64 8004e94: 5b 8b 00 30 sw (sp+48),r11 8004e98: 5b 8c 00 2c sw (sp+44),r12 8004e9c: 5b 8d 00 28 sw (sp+40),r13 8004ea0: 5b 8e 00 24 sw (sp+36),r14 8004ea4: 5b 8f 00 20 sw (sp+32),r15 8004ea8: 5b 90 00 1c sw (sp+28),r16 8004eac: 5b 91 00 18 sw (sp+24),r17 8004eb0: 5b 92 00 14 sw (sp+20),r18 8004eb4: 5b 93 00 10 sw (sp+16),r19 8004eb8: 5b 94 00 0c sw (sp+12),r20 8004ebc: 5b 95 00 08 sw (sp+8),r21 8004ec0: 5b 9d 00 04 sw (sp+4),ra Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 8004ec4: 78 01 08 01 mvhi r1,0x801 8004ec8: 38 21 39 e8 ori r1,r1,0x39e8 8004ecc: 28 2d 00 0c lw r13,(r1+12) _ISR_Disable( level ); 8004ed0: 90 00 20 00 rcsr r4,IE 8004ed4: 34 01 ff fe mvi r1,-2 8004ed8: a0 81 08 00 and r1,r4,r1 8004edc: d0 01 00 00 wcsr IE,r1 while ( _Thread_Dispatch_necessary == true ) { 8004ee0: 78 0c 08 01 mvhi r12,0x801 heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 8004ee4: 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; 8004ee8: 78 0f 08 01 mvhi r15,0x801 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 8004eec: 78 0e 08 01 mvhi r14,0x801 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8004ef0: 78 10 08 01 mvhi r16,0x801 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 8004ef4: 39 8c 39 e8 ori r12,r12,0x39e8 heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 8004ef8: 3a 31 38 1c ori r17,r17,0x381c 8004efc: 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; 8004f00: 39 ef 37 b4 ori r15,r15,0x37b4 _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 8004f04: 37 93 00 3c addi r19,sp,60 _Timestamp_Subtract( 8004f08: 39 ce 38 cc ori r14,r14,0x38cc 8004f0c: 37 92 00 34 addi r18,sp,52 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8004f10: 3a 10 38 a0 ori r16,r16,0x38a0 #endif #endif executing = _Thread_Executing; _ISR_Disable( level ); 8004f14: 34 15 ff fe mvi r21,-2 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 8004f18: e0 00 00 28 bi 8004fb8 <_Thread_Dispatch+0x128> heir = _Thread_Heir; 8004f1c: 29 8b 00 10 lw r11,(r12+16) _Thread_Dispatch_disable_level = 1; 8004f20: 5a 34 00 00 sw (r17+0),r20 _Thread_Dispatch_necessary = false; 8004f24: 31 80 00 18 sb (r12+24),r0 _Thread_Executing = heir; 8004f28: 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 ) 8004f2c: 45 6d 00 26 be r11,r13,8004fc4 <_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 ) 8004f30: 29 61 00 7c lw r1,(r11+124) 8004f34: 5c 34 00 03 bne r1,r20,8004f40 <_Thread_Dispatch+0xb0> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 8004f38: 29 e1 00 00 lw r1,(r15+0) 8004f3c: 59 61 00 78 sw (r11+120),r1 _ISR_Enable( level ); 8004f40: d0 04 00 00 wcsr IE,r4 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 8004f44: ba 60 08 00 mv r1,r19 8004f48: f8 00 0f 82 calli 8008d50 <_TOD_Get_uptime> _Timestamp_Subtract( 8004f4c: b9 c0 08 00 mv r1,r14 8004f50: ba 60 10 00 mv r2,r19 8004f54: ba 40 18 00 mv r3,r18 8004f58: f8 00 04 4e calli 8006090 <_Timespec_Subtract> &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 8004f5c: 35 a1 00 84 addi r1,r13,132 8004f60: ba 40 10 00 mv r2,r18 8004f64: f8 00 04 32 calli 800602c <_Timespec_Add_to> _Thread_Time_of_last_context_switch = uptime; 8004f68: 2b 81 00 3c lw r1,(sp+60) #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8004f6c: 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; 8004f70: 59 c1 00 00 sw (r14+0),r1 8004f74: 2b 81 00 40 lw r1,(sp+64) 8004f78: 59 c1 00 04 sw (r14+4),r1 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8004f7c: 44 80 00 05 be r4,r0,8004f90 <_Thread_Dispatch+0x100> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 8004f80: 28 81 00 00 lw r1,(r4+0) 8004f84: 59 a1 01 20 sw (r13+288),r1 *_Thread_libc_reent = heir->libc_reent; 8004f88: 29 61 01 20 lw r1,(r11+288) 8004f8c: 58 81 00 00 sw (r4+0),r1 } _User_extensions_Thread_switch( executing, heir ); 8004f90: b9 a0 08 00 mv r1,r13 8004f94: b9 60 10 00 mv r2,r11 8004f98: f8 00 05 39 calli 800647c <_User_extensions_Thread_switch> if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 8004f9c: 35 a1 00 cc addi r1,r13,204 8004fa0: 35 62 00 cc addi r2,r11,204 8004fa4: f8 00 06 4b calli 80068d0 <_CPU_Context_switch> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 8004fa8: 29 8d 00 0c lw r13,(r12+12) _ISR_Disable( level ); 8004fac: 90 00 20 00 rcsr r4,IE 8004fb0: a0 95 08 00 and r1,r4,r21 8004fb4: d0 01 00 00 wcsr IE,r1 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 8004fb8: 41 81 00 18 lbu r1,(r12+24) 8004fbc: 20 21 00 ff andi r1,r1,0xff 8004fc0: 5c 20 ff d7 bne r1,r0,8004f1c <_Thread_Dispatch+0x8c> _ISR_Disable( level ); } post_switch: _Thread_Dispatch_disable_level = 0; 8004fc4: 78 01 08 01 mvhi r1,0x801 8004fc8: 38 21 38 1c ori r1,r1,0x381c 8004fcc: 58 20 00 00 sw (r1+0),r0 _ISR_Enable( level ); 8004fd0: d0 04 00 00 wcsr IE,r4 _API_extensions_Run_postswitch(); 8004fd4: fb ff f8 d0 calli 8003314 <_API_extensions_Run_postswitch> } 8004fd8: 2b 9d 00 04 lw ra,(sp+4) 8004fdc: 2b 8b 00 30 lw r11,(sp+48) 8004fe0: 2b 8c 00 2c lw r12,(sp+44) 8004fe4: 2b 8d 00 28 lw r13,(sp+40) 8004fe8: 2b 8e 00 24 lw r14,(sp+36) 8004fec: 2b 8f 00 20 lw r15,(sp+32) 8004ff0: 2b 90 00 1c lw r16,(sp+28) 8004ff4: 2b 91 00 18 lw r17,(sp+24) 8004ff8: 2b 92 00 14 lw r18,(sp+20) 8004ffc: 2b 93 00 10 lw r19,(sp+16) 8005000: 2b 94 00 0c lw r20,(sp+12) 8005004: 2b 95 00 08 lw r21,(sp+8) 8005008: 37 9c 00 40 addi sp,sp,64 800500c: c3 a0 00 00 ret =============================================================================== 08005044 <_Thread_Get>: */ Thread_Control *_Thread_Get ( Objects_Id id, Objects_Locations *location ) { 8005044: 37 9c ff e8 addi sp,sp,-24 8005048: 5b 8b 00 18 sw (sp+24),r11 800504c: 5b 8c 00 14 sw (sp+20),r12 8005050: 5b 8d 00 10 sw (sp+16),r13 8005054: 5b 8e 00 0c sw (sp+12),r14 8005058: 5b 8f 00 08 sw (sp+8),r15 800505c: 5b 9d 00 04 sw (sp+4),ra 8005060: b8 20 68 00 mv r13,r1 8005064: 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 ) ) { 8005068: 5c 20 00 0b bne r1,r0,8005094 <_Thread_Get+0x50> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 800506c: 78 01 08 01 mvhi r1,0x801 8005070: 38 21 38 1c ori r1,r1,0x381c 8005074: 28 22 00 00 lw r2,(r1+0) 8005078: 34 42 00 01 addi r2,r2,1 800507c: 58 22 00 00 sw (r1+0),r2 _Thread_Disable_dispatch(); *location = OBJECTS_LOCAL; tp = _Thread_Executing; 8005080: 78 01 08 01 mvhi r1,0x801 8005084: 38 21 39 e8 ori r1,r1,0x39e8 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; 8005088: 59 60 00 00 sw (r11+0),r0 tp = _Thread_Executing; 800508c: 28 21 00 0c lw r1,(r1+12) goto done; 8005090: e0 00 00 1c bi 8005100 <_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); 8005094: 34 02 00 18 mvi r2,24 8005098: f8 00 2d d1 calli 80107dc <__lshrsi3> 800509c: 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 ) 80050a0: 35 e1 ff ff addi r1,r15,-1 80050a4: 34 02 00 02 mvi r2,2 80050a8: 50 41 00 1e bgeu r2,r1,8005120 <_Thread_Get+0xdc> } the_api = _Objects_Get_API( id ); if ( !_Objects_Is_api_valid( the_api ) ) { *location = OBJECTS_ERROR; 80050ac: 34 01 00 01 mvi r1,1 80050b0: 59 61 00 00 sw (r11+0),r1 80050b4: e0 00 00 02 bi 80050bc <_Thread_Get+0x78> goto done; } the_class = _Objects_Get_class( id ); if ( the_class != 1 ) { /* threads are always first class :) */ *location = OBJECTS_ERROR; 80050b8: 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; 80050bc: 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; 80050c0: e0 00 00 10 bi 8005100 <_Thread_Get+0xbc> } api_information = _Objects_Information_table[ the_api ]; 80050c4: 78 0e 08 01 mvhi r14,0x801 80050c8: b9 e0 08 00 mv r1,r15 80050cc: 34 02 00 02 mvi r2,2 80050d0: f8 00 2d 75 calli 80106a4 <__ashlsi3> 80050d4: 39 ce 37 b8 ori r14,r14,0x37b8 80050d8: b5 c1 08 00 add r1,r14,r1 80050dc: 28 21 00 00 lw r1,(r1+0) /* * There is no way for this to happen if POSIX is enabled. */ #if !defined(RTEMS_POSIX_API) if ( !api_information ) { 80050e0: 44 20 00 03 be r1,r0,80050ec <_Thread_Get+0xa8> <== NEVER TAKEN *location = OBJECTS_ERROR; goto done; } #endif information = api_information[ the_class ]; 80050e4: 28 21 00 04 lw r1,(r1+4) if ( !information ) { 80050e8: 5c 20 00 03 bne r1,r0,80050f4 <_Thread_Get+0xb0> *location = OBJECTS_ERROR; 80050ec: 59 6c 00 00 sw (r11+0),r12 goto done; 80050f0: e0 00 00 04 bi 8005100 <_Thread_Get+0xbc> } tp = (Thread_Control *) _Objects_Get( information, id, location ); 80050f4: b9 a0 10 00 mv r2,r13 80050f8: b9 60 18 00 mv r3,r11 80050fc: fb ff fd 65 calli 8004690 <_Objects_Get> done: return tp; } 8005100: 2b 9d 00 04 lw ra,(sp+4) 8005104: 2b 8b 00 18 lw r11,(sp+24) 8005108: 2b 8c 00 14 lw r12,(sp+20) 800510c: 2b 8d 00 10 lw r13,(sp+16) 8005110: 2b 8e 00 0c lw r14,(sp+12) 8005114: 2b 8f 00 08 lw r15,(sp+8) 8005118: 37 9c 00 18 addi sp,sp,24 800511c: c3 a0 00 00 ret */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 8005120: 34 02 00 1b mvi r2,27 8005124: b9 a0 08 00 mv r1,r13 8005128: f8 00 2d ad calli 80107dc <__lshrsi3> *location = OBJECTS_ERROR; goto done; } the_class = _Objects_Get_class( id ); if ( the_class != 1 ) { /* threads are always first class :) */ 800512c: 34 02 00 01 mvi r2,1 8005130: b8 20 60 00 mv r12,r1 8005134: 44 22 ff e4 be r1,r2,80050c4 <_Thread_Get+0x80> 8005138: e3 ff ff e0 bi 80050b8 <_Thread_Get+0x74> =============================================================================== 0800b0f8 <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 800b0f8: 37 9c ff f4 addi sp,sp,-12 800b0fc: 5b 8b 00 0c sw (sp+12),r11 800b100: 5b 8c 00 08 sw (sp+8),r12 800b104: 5b 9d 00 04 sw (sp+4),ra #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 800b108: 78 01 08 01 mvhi r1,0x801 800b10c: 38 21 39 e8 ori r1,r1,0x39e8 800b110: 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; 800b114: 29 61 00 b8 lw r1,(r11+184) _ISR_Set_level(level); 800b118: 64 21 00 00 cmpei r1,r1,0 800b11c: d0 01 00 00 wcsr IE,r1 #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 800b120: 78 01 08 01 mvhi r1,0x801 800b124: 38 21 36 30 ori r1,r1,0x3630 800b128: 40 2c 00 00 lbu r12,(r1+0) doneConstructors = 1; 800b12c: 34 02 00 01 mvi r2,1 800b130: 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 ); 800b134: b9 60 08 00 mv r1,r11 800b138: fb ff ec 29 calli 80061dc <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 800b13c: fb ff e7 b5 calli 8005010 <_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) */ { 800b140: 5d 80 00 02 bne r12,r0,800b148 <_Thread_Handler+0x50> INIT_NAME (); 800b144: fb ff d3 af calli 8000000 } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 800b148: 29 61 00 a0 lw r1,(r11+160) 800b14c: 5c 20 00 05 bne r1,r0,800b160 <_Thread_Handler+0x68> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 800b150: 29 62 00 9c lw r2,(r11+156) 800b154: 29 61 00 a8 lw r1,(r11+168) 800b158: d8 40 00 00 call r2 INIT_NAME (); } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 800b15c: 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 ); 800b160: b9 60 08 00 mv r1,r11 800b164: fb ff ec 36 calli 800623c <_User_extensions_Thread_exitted> _Internal_error_Occurred( 800b168: 34 01 00 00 mvi r1,0 800b16c: 34 02 00 01 mvi r2,1 800b170: 34 03 00 05 mvi r3,5 800b174: fb ff e3 8d calli 8003fa8 <_Internal_error_Occurred> =============================================================================== 0800513c <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 800513c: 37 9c ff e4 addi sp,sp,-28 8005140: 5b 8b 00 1c sw (sp+28),r11 8005144: 5b 8c 00 18 sw (sp+24),r12 8005148: 5b 8d 00 14 sw (sp+20),r13 800514c: 5b 8e 00 10 sw (sp+16),r14 8005150: 5b 8f 00 0c sw (sp+12),r15 8005154: 5b 90 00 08 sw (sp+8),r16 8005158: 5b 9d 00 04 sw (sp+4),ra /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 800515c: 58 40 01 24 sw (r2+292),r0 8005160: 58 40 01 28 sw (r2+296),r0 extensions_area = NULL; the_thread->libc_reent = NULL; 8005164: 58 40 01 20 sw (r2+288),r0 Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 8005168: b8 20 70 00 mv r14,r1 800516c: b8 40 58 00 mv r11,r2 /* * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 8005170: b8 40 08 00 mv r1,r2 8005174: b8 80 10 00 mv r2,r4 Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 8005178: b8 80 60 00 mv r12,r4 800517c: b8 c0 68 00 mv r13,r6 8005180: b9 00 78 00 mv r15,r8 8005184: 20 f0 00 ff andi r16,r7,0xff /* * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 8005188: f8 00 03 14 calli 8005dd8 <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) 800518c: f5 81 60 00 cmpgu r12,r12,r1 8005190: 64 22 00 00 cmpei r2,r1,0 return false; /* stack allocation failed */ 8005194: 34 03 00 00 mvi r3,0 /* * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) 8005198: b9 82 60 00 or r12,r12,r2 800519c: 5d 80 00 4a bne r12,r0,80052c4 <_Thread_Initialize+0x188> Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 80051a0: 29 62 00 c8 lw r2,(r11+200) the_stack->size = size; 80051a4: 59 61 00 c0 sw (r11+192),r1 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 80051a8: 59 60 00 50 sw (r11+80),r0 Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 80051ac: 59 62 00 c4 sw (r11+196),r2 #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 80051b0: 78 02 08 01 mvhi r2,0x801 80051b4: 38 42 38 ac ori r2,r2,0x38ac 80051b8: 28 42 00 00 lw r2,(r2+0) the_watchdog->routine = routine; 80051bc: 59 60 00 64 sw (r11+100),r0 the_watchdog->id = id; 80051c0: 59 60 00 68 sw (r11+104),r0 the_watchdog->user_data = user_data; 80051c4: 59 60 00 6c sw (r11+108),r0 80051c8: 44 4c 00 07 be r2,r12,80051e4 <_Thread_Initialize+0xa8> extensions_area = _Workspace_Allocate( (_Thread_Maximum_extensions + 1) * sizeof( void * ) 80051cc: 34 41 00 01 addi r1,r2,1 80051d0: 34 02 00 02 mvi r2,2 80051d4: f8 00 2d 34 calli 80106a4 <__ashlsi3> /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( 80051d8: f8 00 05 9b calli 8006844 <_Workspace_Allocate> 80051dc: b8 20 60 00 mv r12,r1 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 80051e0: 44 20 00 2a be r1,r0,8005288 <_Thread_Initialize+0x14c> goto failed; } the_thread->extensions = (void **) extensions_area; 80051e4: 59 6c 01 2c sw (r11+300),r12 * if they are linked to the thread. An extension user may * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { 80051e8: 45 80 00 0b be r12,r0,8005214 <_Thread_Initialize+0xd8> for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 80051ec: 78 02 08 01 mvhi r2,0x801 80051f0: 38 42 38 ac ori r2,r2,0x38ac 80051f4: 28 41 00 00 lw r1,(r2+0) 80051f8: b9 80 18 00 mv r3,r12 80051fc: 34 02 00 00 mvi r2,0 8005200: e0 00 00 04 bi 8005210 <_Thread_Initialize+0xd4> the_thread->extensions[i] = NULL; 8005204: 58 60 00 00 sw (r3+0),r0 * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 8005208: 34 42 00 01 addi r2,r2,1 800520c: 34 63 00 04 addi r3,r3,4 8005210: 50 22 ff fd bgeu r1,r2,8005204 <_Thread_Initialize+0xc8> * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 8005214: 2b 81 00 20 lw r1,(sp+32) the_thread->current_state = STATES_DORMANT; the_thread->Wait.queue = NULL; the_thread->resource_count = 0; the_thread->real_priority = priority; the_thread->Start.initial_priority = priority; _Thread_Set_priority( the_thread, priority ); 8005218: b9 a0 10 00 mv r2,r13 the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; the_thread->Wait.queue = NULL; the_thread->resource_count = 0; the_thread->real_priority = priority; 800521c: 59 6d 00 18 sw (r11+24),r13 * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 8005220: 59 61 00 b4 sw (r11+180),r1 case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 8005224: 2b 81 00 24 lw r1,(sp+36) the_thread->current_state = STATES_DORMANT; the_thread->Wait.queue = NULL; the_thread->resource_count = 0; the_thread->real_priority = priority; the_thread->Start.initial_priority = priority; 8005228: 59 6d 00 bc sw (r11+188),r13 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 800522c: 31 70 00 ac sb (r11+172),r16 case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 8005230: 59 61 00 b8 sw (r11+184),r1 the_thread->current_state = STATES_DORMANT; 8005234: 34 01 00 01 mvi r1,1 8005238: 59 61 00 10 sw (r11+16),r1 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; 800523c: 59 6f 00 b0 sw (r11+176),r15 the_thread->current_state = STATES_DORMANT; the_thread->Wait.queue = NULL; the_thread->resource_count = 0; the_thread->real_priority = priority; the_thread->Start.initial_priority = priority; _Thread_Set_priority( the_thread, priority ); 8005240: b9 60 08 00 mv r1,r11 } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; the_thread->Wait.queue = NULL; 8005244: 59 60 00 44 sw (r11+68),r0 the_thread->resource_count = 0; 8005248: 59 60 00 1c sw (r11+28),r0 the_thread->real_priority = priority; the_thread->Start.initial_priority = priority; _Thread_Set_priority( the_thread, priority ); 800524c: f8 00 02 15 calli 8005aa0 <_Thread_Set_priority> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8005250: 2d 61 00 0a lhu r1,(r11+10) _Thread_Stack_Free( the_thread ); return false; } 8005254: 29 cd 00 1c lw r13,(r14+28) 8005258: 34 02 00 02 mvi r2,2 /* * Initialize the CPU usage statistics */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Set_to_zero( &the_thread->cpu_time_used ); 800525c: 59 60 00 84 sw (r11+132),r0 8005260: 59 60 00 88 sw (r11+136),r0 8005264: f8 00 2d 10 calli 80106a4 <__ashlsi3> 8005268: b5 a1 08 00 add r1,r13,r1 800526c: 58 2b 00 00 sw (r1+0),r11 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 8005270: 2b 81 00 28 lw r1,(sp+40) 8005274: 59 61 00 0c sw (r11+12),r1 * enabled when we get here. We want to be able to run the * user extensions with dispatching enabled. The Allocator * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); 8005278: b9 60 08 00 mv r1,r11 800527c: f8 00 04 26 calli 8006314 <_User_extensions_Thread_create> if ( extension_status ) return true; 8005280: 34 03 00 01 mvi r3,1 * user extensions with dispatching enabled. The Allocator * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) 8005284: 5c 20 00 10 bne r1,r0,80052c4 <_Thread_Initialize+0x188> return true; failed: if ( the_thread->libc_reent ) 8005288: 29 61 01 20 lw r1,(r11+288) 800528c: 44 20 00 02 be r1,r0,8005294 <_Thread_Initialize+0x158> _Workspace_Free( the_thread->libc_reent ); 8005290: f8 00 05 78 calli 8006870 <_Workspace_Free> for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 8005294: 29 61 01 24 lw r1,(r11+292) 8005298: 44 20 00 02 be r1,r0,80052a0 <_Thread_Initialize+0x164> _Workspace_Free( the_thread->API_Extensions[i] ); 800529c: f8 00 05 75 calli 8006870 <_Workspace_Free> failed: if ( the_thread->libc_reent ) _Workspace_Free( the_thread->libc_reent ); for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 80052a0: 29 61 01 28 lw r1,(r11+296) 80052a4: 44 20 00 02 be r1,r0,80052ac <_Thread_Initialize+0x170> <== ALWAYS TAKEN _Workspace_Free( the_thread->API_Extensions[i] ); 80052a8: f8 00 05 72 calli 8006870 <_Workspace_Free> <== NOT EXECUTED if ( extensions_area ) 80052ac: 45 80 00 03 be r12,r0,80052b8 <_Thread_Initialize+0x17c> (void) _Workspace_Free( extensions_area ); 80052b0: b9 80 08 00 mv r1,r12 80052b4: f8 00 05 6f calli 8006870 <_Workspace_Free> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( fp_area ) (void) _Workspace_Free( fp_area ); #endif _Thread_Stack_Free( the_thread ); 80052b8: b9 60 08 00 mv r1,r11 80052bc: f8 00 02 e5 calli 8005e50 <_Thread_Stack_Free> return false; 80052c0: 34 03 00 00 mvi r3,0 } 80052c4: b8 60 08 00 mv r1,r3 80052c8: 2b 9d 00 04 lw ra,(sp+4) 80052cc: 2b 8b 00 1c lw r11,(sp+28) 80052d0: 2b 8c 00 18 lw r12,(sp+24) 80052d4: 2b 8d 00 14 lw r13,(sp+20) 80052d8: 2b 8e 00 10 lw r14,(sp+16) 80052dc: 2b 8f 00 0c lw r15,(sp+12) 80052e0: 2b 90 00 08 lw r16,(sp+8) 80052e4: 37 9c 00 1c addi sp,sp,28 80052e8: c3 a0 00 00 ret =============================================================================== 08009ed4 <_Thread_Resume>: { ISR_Level level; States_Control current_state; _ISR_Disable( level ); 8009ed4: 90 00 18 00 rcsr r3,IE 8009ed8: 34 04 ff fe mvi r4,-2 8009edc: a0 64 20 00 and r4,r3,r4 8009ee0: d0 04 00 00 wcsr IE,r4 current_state = the_thread->current_state; 8009ee4: 28 22 00 10 lw r2,(r1+16) if ( current_state & STATES_SUSPENDED ) { 8009ee8: 20 45 00 02 andi r5,r2,0x2 8009eec: 44 a0 00 29 be r5,r0,8009f90 <_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); 8009ef0: 34 05 ff fd mvi r5,-3 8009ef4: a0 45 10 00 and r2,r2,r5 current_state = the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); 8009ef8: 58 22 00 10 sw (r1+16),r2 if ( _States_Is_ready( current_state ) ) { 8009efc: 5c 40 00 25 bne r2,r0,8009f90 <_Thread_Resume+0xbc> RTEMS_INLINE_ROUTINE void _Priority_bit_map_Add ( Priority_bit_map_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 8009f00: 28 22 00 90 lw r2,(r1+144) 8009f04: 2c 25 00 96 lhu r5,(r1+150) 8009f08: 2c 46 00 00 lhu r6,(r2+0) 8009f0c: b8 c5 28 00 or r5,r6,r5 8009f10: 0c 45 00 00 sh (r2+0),r5 _Priority_Major_bit_map |= the_priority_map->ready_major; 8009f14: 78 02 08 01 mvhi r2,0x801 8009f18: 38 42 89 8c ori r2,r2,0x898c 8009f1c: 2c 45 00 00 lhu r5,(r2+0) 8009f20: 2c 26 00 94 lhu r6,(r1+148) 8009f24: b8 c5 28 00 or r5,r6,r5 8009f28: 20 a5 ff ff andi r5,r5,0xffff 8009f2c: 0c 45 00 00 sh (r2+0),r5 _Priority_bit_map_Add( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 8009f30: 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; 8009f34: 34 45 00 04 addi r5,r2,4 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 8009f38: 58 25 00 00 sw (r1+0),r5 old_last_node = the_chain->last; 8009f3c: 28 45 00 08 lw r5,(r2+8) the_chain->last = the_node; 8009f40: 58 41 00 08 sw (r2+8),r1 old_last_node->next = the_node; 8009f44: 58 a1 00 00 sw (r5+0),r1 the_node->previous = old_last_node; 8009f48: 58 25 00 04 sw (r1+4),r5 _ISR_Flash( level ); 8009f4c: d0 03 00 00 wcsr IE,r3 8009f50: d0 04 00 00 wcsr IE,r4 if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 8009f54: 78 02 08 01 mvhi r2,0x801 8009f58: 38 42 8a b8 ori r2,r2,0x8ab8 8009f5c: 28 45 00 10 lw r5,(r2+16) 8009f60: 28 24 00 14 lw r4,(r1+20) 8009f64: 28 a5 00 14 lw r5,(r5+20) 8009f68: 50 85 00 0a bgeu r4,r5,8009f90 <_Thread_Resume+0xbc> _Thread_Heir = the_thread; 8009f6c: 58 41 00 10 sw (r2+16),r1 if ( _Thread_Executing->is_preemptible || 8009f70: 28 41 00 0c lw r1,(r2+12) 8009f74: 40 21 00 74 lbu r1,(r1+116) 8009f78: 5c 20 00 02 bne r1,r0,8009f80 <_Thread_Resume+0xac> 8009f7c: 5c 81 00 05 bne r4,r1,8009f90 <_Thread_Resume+0xbc> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 8009f80: 78 01 08 01 mvhi r1,0x801 8009f84: 38 21 8a b8 ori r1,r1,0x8ab8 8009f88: 34 02 00 01 mvi r2,1 8009f8c: 30 22 00 18 sb (r1+24),r2 } } } _ISR_Enable( level ); 8009f90: d0 03 00 00 wcsr IE,r3 } 8009f94: c3 a0 00 00 ret =============================================================================== 08005f90 <_Thread_Yield_processor>: { ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 8005f90: 78 01 08 01 mvhi r1,0x801 8005f94: 38 21 39 e8 ori r1,r1,0x39e8 8005f98: 28 21 00 0c lw r1,(r1+12) ready = executing->ready; 8005f9c: 28 23 00 8c lw r3,(r1+140) _ISR_Disable( level ); 8005fa0: 90 00 20 00 rcsr r4,IE 8005fa4: 34 06 ff fe mvi r6,-2 8005fa8: a0 86 30 00 and r6,r4,r6 8005fac: d0 06 00 00 wcsr IE,r6 */ RTEMS_INLINE_ROUTINE bool _Chain_Has_only_one_node( const Chain_Control *the_chain ) { return (the_chain->first == the_chain->last); 8005fb0: 28 65 00 08 lw r5,(r3+8) if ( !_Chain_Has_only_one_node( ready ) ) { 8005fb4: 28 67 00 00 lw r7,(r3+0) 8005fb8: 78 02 08 01 mvhi r2,0x801 8005fbc: 38 42 39 e8 ori r2,r2,0x39e8 8005fc0: 44 e5 00 15 be r7,r5,8006014 <_Thread_Yield_processor+0x84> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 8005fc4: 28 28 00 00 lw r8,(r1+0) previous = the_node->previous; 8005fc8: 28 27 00 04 lw r7,(r1+4) next->previous = previous; previous->next = next; 8005fcc: 58 e8 00 00 sw (r7+0),r8 Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 8005fd0: 59 07 00 04 sw (r8+4),r7 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8005fd4: 34 67 00 04 addi r7,r3,4 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 8005fd8: 58 27 00 00 sw (r1+0),r7 old_last_node = the_chain->last; the_chain->last = the_node; 8005fdc: 58 61 00 08 sw (r3+8),r1 old_last_node->next = the_node; 8005fe0: 58 a1 00 00 sw (r5+0),r1 the_node->previous = old_last_node; 8005fe4: 58 25 00 04 sw (r1+4),r5 _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 8005fe8: d0 04 00 00 wcsr IE,r4 8005fec: d0 06 00 00 wcsr IE,r6 if ( _Thread_Is_heir( executing ) ) 8005ff0: 28 45 00 10 lw r5,(r2+16) 8005ff4: 5c 25 00 03 bne r1,r5,8006000 <_Thread_Yield_processor+0x70><== NEVER TAKEN _Thread_Heir = (Thread_Control *) ready->first; 8005ff8: 28 61 00 00 lw r1,(r3+0) 8005ffc: 58 41 00 10 sw (r2+16),r1 _Thread_Dispatch_necessary = true; 8006000: 78 01 08 01 mvhi r1,0x801 8006004: 38 21 39 e8 ori r1,r1,0x39e8 8006008: 34 02 00 01 mvi r2,1 800600c: 30 22 00 18 sb (r1+24),r2 8006010: e0 00 00 05 bi 8006024 <_Thread_Yield_processor+0x94> } else if ( !_Thread_Is_heir( executing ) ) 8006014: 28 43 00 10 lw r3,(r2+16) 8006018: 44 23 00 03 be r1,r3,8006024 <_Thread_Yield_processor+0x94><== ALWAYS TAKEN _Thread_Dispatch_necessary = true; 800601c: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8006020: 30 41 00 18 sb (r2+24),r1 <== NOT EXECUTED _ISR_Enable( level ); 8006024: d0 04 00 00 wcsr IE,r4 } 8006028: c3 a0 00 00 ret =============================================================================== 0800567c <_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 ) { 800567c: 37 9c ff c8 addi sp,sp,-56 8005680: 5b 8b 00 38 sw (sp+56),r11 8005684: 5b 8c 00 34 sw (sp+52),r12 8005688: 5b 8d 00 30 sw (sp+48),r13 800568c: 5b 8e 00 2c sw (sp+44),r14 8005690: 5b 8f 00 28 sw (sp+40),r15 8005694: 5b 90 00 24 sw (sp+36),r16 8005698: 5b 91 00 20 sw (sp+32),r17 800569c: 5b 92 00 1c sw (sp+28),r18 80056a0: 5b 93 00 18 sw (sp+24),r19 80056a4: 5b 94 00 14 sw (sp+20),r20 80056a8: 5b 95 00 10 sw (sp+16),r21 80056ac: 5b 96 00 0c sw (sp+12),r22 80056b0: 5b 97 00 08 sw (sp+8),r23 80056b4: 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; 80056b8: 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 ) { 80056bc: b8 20 68 00 mv r13,r1 80056c0: 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); 80056c4: 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 ); 80056c8: 34 41 00 38 addi r1,r2,56 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 80056cc: 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; 80056d0: 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 ) { 80056d4: 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); 80056d8: ba 00 08 00 mv r1,r16 80056dc: 34 02 00 06 mvi r2,6 80056e0: b8 60 a8 00 mv r21,r3 80056e4: f8 00 2c 3e calli 80107dc <__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 ]; 80056e8: 34 02 00 01 mvi r2,1 80056ec: b8 20 70 00 mv r14,r1 80056f0: f8 00 2b ed calli 80106a4 <__ashlsi3> 80056f4: 34 02 00 02 mvi r2,2 80056f8: b4 2e 08 00 add r1,r1,r14 80056fc: f8 00 2b ea calli 80106a4 <__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; 8005700: 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 ); 8005704: 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 ]; 8005708: b5 a1 b8 00 add r23,r13,r1 block_state = the_thread_queue->state; 800570c: 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; 8005710: 3a 52 30 c0 ori r18,r18,0x30c0 _ISR_Disable( level ); 8005714: 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 ) ) 8005718: 5c 40 00 30 bne r2,r0,80057d8 <_Thread_queue_Enqueue_priority+0x15c> goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 800571c: 34 14 ff fe mvi r20,-2 8005720: 90 00 78 00 rcsr r15,IE 8005724: a1 f4 90 00 and r18,r15,r20 8005728: d0 12 00 00 wcsr IE,r18 search_thread = (Thread_Control *) header->first; 800572c: 34 02 00 01 mvi r2,1 8005730: b9 c0 08 00 mv r1,r14 8005734: f8 00 2b dc calli 80106a4 <__ashlsi3> 8005738: b4 2e 08 00 add r1,r1,r14 800573c: 34 02 00 02 mvi r2,2 8005740: f8 00 2b d9 calli 80106a4 <__ashlsi3> 8005744: b5 a1 08 00 add r1,r13,r1 8005748: 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; 800574c: 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 ) ) { 8005750: e0 00 00 0b bi 800577c <_Thread_queue_Enqueue_priority+0x100> search_priority = search_thread->current_priority; 8005754: 29 91 00 14 lw r17,(r12+20) if ( priority <= search_priority ) 8005758: 52 30 00 12 bgeu r17,r16,80057a0 <_Thread_queue_Enqueue_priority+0x124> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 800575c: d0 0f 00 00 wcsr IE,r15 8005760: 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); 8005764: 29 81 00 10 lw r1,(r12+16) 8005768: a2 61 08 00 and r1,r19,r1 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 800576c: 5c 20 00 03 bne r1,r0,8005778 <_Thread_queue_Enqueue_priority+0xfc><== ALWAYS TAKEN _ISR_Enable( level ); 8005770: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED goto restart_forward_search; 8005774: e3 ff ff eb bi 8005720 <_Thread_queue_Enqueue_priority+0xa4><== NOT EXECUTED } search_thread = (Thread_Control *)search_thread->Object.Node.next; 8005778: 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; 800577c: 34 02 00 01 mvi r2,1 8005780: b9 c0 08 00 mv r1,r14 8005784: f8 00 2b c8 calli 80106a4 <__ashlsi3> 8005788: b4 2e 08 00 add r1,r1,r14 800578c: 34 02 00 02 mvi r2,2 8005790: f8 00 2b c5 calli 80106a4 <__ashlsi3> 8005794: b5 a1 08 00 add r1,r13,r1 8005798: 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 ) ) { 800579c: 5d 81 ff ee bne r12,r1,8005754 <_Thread_queue_Enqueue_priority+0xd8> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 80057a0: 29 a3 00 30 lw r3,(r13+48) 80057a4: 34 02 00 01 mvi r2,1 80057a8: b9 e0 08 00 mv r1,r15 80057ac: 5c 62 00 3c bne r3,r2,800589c <_Thread_queue_Enqueue_priority+0x220><== NEVER TAKEN THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 80057b0: 59 a0 00 30 sw (r13+48),r0 if ( priority == search_priority ) 80057b4: 46 11 00 31 be r16,r17,8005878 <_Thread_queue_Enqueue_priority+0x1fc> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 80057b8: 29 81 00 04 lw r1,(r12+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 80057bc: 59 6c 00 00 sw (r11+0),r12 the_node->previous = previous_node; 80057c0: 59 61 00 04 sw (r11+4),r1 previous_node->next = the_node; 80057c4: 58 2b 00 00 sw (r1+0),r11 search_node->previous = the_node; 80057c8: 59 8b 00 04 sw (r12+4),r11 the_thread->Wait.queue = the_thread_queue; 80057cc: 59 6d 00 44 sw (r11+68),r13 _ISR_Enable( level ); 80057d0: d0 0f 00 00 wcsr IE,r15 80057d4: e0 00 00 27 bi 8005870 <_Thread_queue_Enqueue_priority+0x1f4> return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 80057d8: 42 51 00 00 lbu r17,(r18+0) 80057dc: 36 31 00 01 addi r17,r17,1 _ISR_Disable( level ); 80057e0: 90 00 78 00 rcsr r15,IE 80057e4: a1 f6 a0 00 and r20,r15,r22 80057e8: d0 14 00 00 wcsr IE,r20 search_thread = (Thread_Control *) header->last; 80057ec: 34 02 00 01 mvi r2,1 80057f0: b9 c0 08 00 mv r1,r14 80057f4: f8 00 2b ac calli 80106a4 <__ashlsi3> 80057f8: b4 2e 08 00 add r1,r1,r14 80057fc: 34 02 00 02 mvi r2,2 8005800: f8 00 2b a9 calli 80106a4 <__ashlsi3> 8005804: b5 a1 08 00 add r1,r13,r1 8005808: 28 2c 00 08 lw r12,(r1+8) while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 800580c: e0 00 00 0b bi 8005838 <_Thread_queue_Enqueue_priority+0x1bc> search_priority = search_thread->current_priority; 8005810: 29 91 00 14 lw r17,(r12+20) if ( priority >= search_priority ) 8005814: 52 11 00 0a bgeu r16,r17,800583c <_Thread_queue_Enqueue_priority+0x1c0> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 8005818: d0 0f 00 00 wcsr IE,r15 800581c: d0 14 00 00 wcsr IE,r20 8005820: 29 81 00 10 lw r1,(r12+16) 8005824: a2 61 08 00 and r1,r19,r1 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 8005828: 5c 20 00 03 bne r1,r0,8005834 <_Thread_queue_Enqueue_priority+0x1b8><== ALWAYS TAKEN _ISR_Enable( level ); 800582c: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED goto restart_reverse_search; 8005830: e3 ff ff ea bi 80057d8 <_Thread_queue_Enqueue_priority+0x15c><== NOT EXECUTED } search_thread = (Thread_Control *) search_thread->Object.Node.previous; 8005834: 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 ) ) { 8005838: 5d 97 ff f6 bne r12,r23,8005810 <_Thread_queue_Enqueue_priority+0x194> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 800583c: 29 a3 00 30 lw r3,(r13+48) 8005840: 34 02 00 01 mvi r2,1 8005844: b9 e0 08 00 mv r1,r15 8005848: 5c 62 00 15 bne r3,r2,800589c <_Thread_queue_Enqueue_priority+0x220><== NEVER TAKEN THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 800584c: 59 a0 00 30 sw (r13+48),r0 if ( priority == search_priority ) 8005850: 46 11 00 0a be r16,r17,8005878 <_Thread_queue_Enqueue_priority+0x1fc> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 8005854: 29 81 00 00 lw r1,(r12+0) the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 8005858: 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; 800585c: 59 61 00 00 sw (r11+0),r1 the_node->previous = search_node; search_node->next = the_node; 8005860: 59 8b 00 00 sw (r12+0),r11 next_node->previous = the_node; 8005864: 58 2b 00 04 sw (r1+4),r11 the_thread->Wait.queue = the_thread_queue; 8005868: 59 6d 00 44 sw (r11+68),r13 _ISR_Enable( level ); 800586c: d0 0f 00 00 wcsr IE,r15 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 8005870: 34 01 00 01 mvi r1,1 8005874: e0 00 00 0c bi 80058a4 <_Thread_queue_Enqueue_priority+0x228> 8005878: 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; 800587c: 29 81 00 04 lw r1,(r12+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8005880: 59 6c 00 00 sw (r11+0),r12 the_node->previous = previous_node; 8005884: 59 61 00 04 sw (r11+4),r1 previous_node->next = the_node; 8005888: 58 2b 00 00 sw (r1+0),r11 search_node->previous = the_node; 800588c: 59 8b 00 04 sw (r12+4),r11 the_thread->Wait.queue = the_thread_queue; 8005890: 59 6d 00 44 sw (r11+68),r13 _ISR_Enable( level ); 8005894: d0 0f 00 00 wcsr IE,r15 8005898: e3 ff ff f6 bi 8005870 <_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; 800589c: 5a a1 00 00 sw (r21+0),r1 <== NOT EXECUTED return the_thread_queue->sync_state; 80058a0: 29 a1 00 30 lw r1,(r13+48) <== NOT EXECUTED } 80058a4: 2b 9d 00 04 lw ra,(sp+4) 80058a8: 2b 8b 00 38 lw r11,(sp+56) 80058ac: 2b 8c 00 34 lw r12,(sp+52) 80058b0: 2b 8d 00 30 lw r13,(sp+48) 80058b4: 2b 8e 00 2c lw r14,(sp+44) 80058b8: 2b 8f 00 28 lw r15,(sp+40) 80058bc: 2b 90 00 24 lw r16,(sp+36) 80058c0: 2b 91 00 20 lw r17,(sp+32) 80058c4: 2b 92 00 1c lw r18,(sp+28) 80058c8: 2b 93 00 18 lw r19,(sp+24) 80058cc: 2b 94 00 14 lw r20,(sp+20) 80058d0: 2b 95 00 10 lw r21,(sp+16) 80058d4: 2b 96 00 0c lw r22,(sp+12) 80058d8: 2b 97 00 08 lw r23,(sp+8) 80058dc: 37 9c 00 38 addi sp,sp,56 80058e0: c3 a0 00 00 ret =============================================================================== 08009658 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 8009658: 37 9c ff fc addi sp,sp,-4 800965c: 5b 9d 00 04 sw (sp+4),ra 8009660: b8 20 10 00 mv r2,r1 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 8009664: 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 && 8009668: 28 24 00 30 lw r4,(r1+48) 800966c: 44 80 00 0c be r4,r0,800969c <_Thread_queue_Process_timeout+0x44> RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 8009670: 78 03 08 01 mvhi r3,0x801 8009674: 38 63 39 e8 ori r3,r3,0x39e8 8009678: 28 63 00 0c lw r3,(r3+12) 800967c: 5c 43 00 08 bne r2,r3,800969c <_Thread_queue_Process_timeout+0x44> _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 8009680: 34 03 00 03 mvi r3,3 8009684: 44 83 00 09 be r4,r3,80096a8 <_Thread_queue_Process_timeout+0x50><== NEVER TAKEN the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 8009688: 28 23 00 3c lw r3,(r1+60) 800968c: 58 43 00 34 sw (r2+52),r3 the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 8009690: 34 02 00 02 mvi r2,2 8009694: 58 22 00 30 sw (r1+48),r2 8009698: e0 00 00 04 bi 80096a8 <_Thread_queue_Process_timeout+0x50> } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800969c: 28 23 00 3c lw r3,(r1+60) 80096a0: 58 43 00 34 sw (r2+52),r3 _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 80096a4: fb ff ff 94 calli 80094f4 <_Thread_queue_Extract> } } 80096a8: 2b 9d 00 04 lw ra,(sp+4) 80096ac: 37 9c 00 04 addi sp,sp,4 80096b0: c3 a0 00 00 ret =============================================================================== 080059cc <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 80059cc: 37 9c ff ec addi sp,sp,-20 80059d0: 5b 8b 00 10 sw (sp+16),r11 80059d4: 5b 8c 00 0c sw (sp+12),r12 80059d8: 5b 8d 00 08 sw (sp+8),r13 80059dc: 5b 9d 00 04 sw (sp+4),ra 80059e0: b8 20 58 00 mv r11,r1 80059e4: 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 ) 80059e8: 44 20 00 19 be r1,r0,8005a4c <_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 ) { 80059ec: 28 22 00 34 lw r2,(r1+52) 80059f0: 34 01 00 01 mvi r1,1 80059f4: 5c 41 00 16 bne r2,r1,8005a4c <_Thread_queue_Requeue+0x80> <== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 80059f8: 90 00 68 00 rcsr r13,IE 80059fc: 34 01 ff fe mvi r1,-2 8005a00: a1 a1 08 00 and r1,r13,r1 8005a04: d0 01 00 00 wcsr IE,r1 8005a08: 78 03 08 01 mvhi r3,0x801 8005a0c: 38 63 1c 20 ori r3,r3,0x1c20 8005a10: 29 82 00 10 lw r2,(r12+16) 8005a14: 28 61 00 00 lw r1,(r3+0) 8005a18: a0 41 08 00 and r1,r2,r1 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 8005a1c: 44 20 00 0b be r1,r0,8005a48 <_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; 8005a20: 34 01 00 01 mvi r1,1 8005a24: 59 61 00 30 sw (r11+48),r1 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 8005a28: b9 80 10 00 mv r2,r12 8005a2c: b9 60 08 00 mv r1,r11 8005a30: 34 03 00 01 mvi r3,1 8005a34: f8 00 0e bc calli 8009524 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 8005a38: b9 60 08 00 mv r1,r11 8005a3c: b9 80 10 00 mv r2,r12 8005a40: 37 83 00 14 addi r3,sp,20 8005a44: fb ff ff 0e calli 800567c <_Thread_queue_Enqueue_priority> } _ISR_Enable( level ); 8005a48: d0 0d 00 00 wcsr IE,r13 } } 8005a4c: 2b 9d 00 04 lw ra,(sp+4) 8005a50: 2b 8b 00 10 lw r11,(sp+16) 8005a54: 2b 8c 00 0c lw r12,(sp+12) 8005a58: 2b 8d 00 08 lw r13,(sp+8) 8005a5c: 37 9c 00 14 addi sp,sp,20 8005a60: c3 a0 00 00 ret =============================================================================== 08005a64 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 8005a64: 37 9c ff f8 addi sp,sp,-8 8005a68: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 8005a6c: 37 82 00 08 addi r2,sp,8 8005a70: fb ff fd 75 calli 8005044 <_Thread_Get> switch ( location ) { 8005a74: 2b 82 00 08 lw r2,(sp+8) 8005a78: 5c 40 00 07 bne r2,r0,8005a94 <_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 ); 8005a7c: f8 00 0e f7 calli 8009658 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 8005a80: 78 01 08 01 mvhi r1,0x801 8005a84: 38 21 38 1c ori r1,r1,0x381c 8005a88: 28 22 00 00 lw r2,(r1+0) 8005a8c: 34 42 ff ff addi r2,r2,-1 8005a90: 58 22 00 00 sw (r1+0),r2 _Thread_Unnest_dispatch(); break; } } 8005a94: 2b 9d 00 04 lw ra,(sp+4) 8005a98: 37 9c 00 08 addi sp,sp,8 8005a9c: c3 a0 00 00 ret =============================================================================== 080146ac <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 80146ac: 37 9c ff a4 addi sp,sp,-92 80146b0: 5b 8b 00 44 sw (sp+68),r11 80146b4: 5b 8c 00 40 sw (sp+64),r12 80146b8: 5b 8d 00 3c sw (sp+60),r13 80146bc: 5b 8e 00 38 sw (sp+56),r14 80146c0: 5b 8f 00 34 sw (sp+52),r15 80146c4: 5b 90 00 30 sw (sp+48),r16 80146c8: 5b 91 00 2c sw (sp+44),r17 80146cc: 5b 92 00 28 sw (sp+40),r18 80146d0: 5b 93 00 24 sw (sp+36),r19 80146d4: 5b 94 00 20 sw (sp+32),r20 80146d8: 5b 95 00 1c sw (sp+28),r21 80146dc: 5b 96 00 18 sw (sp+24),r22 80146e0: 5b 97 00 14 sw (sp+20),r23 80146e4: 5b 98 00 10 sw (sp+16),r24 80146e8: 5b 99 00 0c sw (sp+12),r25 80146ec: 5b 9b 00 08 sw (sp+8),fp 80146f0: 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; 80146f4: 78 10 08 03 mvhi r16,0x803 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 80146f8: b8 20 58 00 mv r11,r1 80146fc: 37 8f 00 48 addi r15,sp,72 8014700: 37 81 00 54 addi r1,sp,84 8014704: 37 95 00 58 addi r21,sp,88 8014708: 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(); 801470c: 78 0e 08 03 mvhi r14,0x803 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8014710: 5b 95 00 54 sw (sp+84),r21 the_chain->permanent_null = NULL; 8014714: 5b 80 00 58 sw (sp+88),r0 the_chain->last = _Chain_Head(the_chain); 8014718: 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); 801471c: 5b 91 00 48 sw (sp+72),r17 the_chain->permanent_null = NULL; 8014720: 5b 80 00 4c sw (sp+76),r0 the_chain->last = _Chain_Head(the_chain); 8014724: 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; 8014728: 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; 801472c: 3a 10 ed 64 ori r16,r16,0xed64 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8014730: 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 ); 8014734: 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(); 8014738: 39 ce ec b4 ori r14,r14,0xecb4 /* * 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 ); 801473c: 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 ) { 8014740: 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 ); 8014744: 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; 8014748: 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 ); 801474c: 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 ); 8014750: 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; 8014754: 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; 8014758: 2a 02 00 00 lw r2,(r16+0) /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 801475c: 29 63 00 3c lw r3,(r11+60) watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8014760: ba 80 08 00 mv r1,r20 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 8014764: 59 62 00 3c sw (r11+60),r2 _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8014768: c8 43 10 00 sub r2,r2,r3 801476c: ba 60 18 00 mv r3,r19 8014770: f8 00 15 51 calli 8019cb4 <_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; 8014774: 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(); 8014778: 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 ) { 801477c: 50 8c 00 06 bgeu r4,r12,8014794 <_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 ); 8014780: b9 a0 08 00 mv r1,r13 8014784: c9 84 10 00 sub r2,r12,r4 8014788: ba 60 18 00 mv r3,r19 801478c: f8 00 15 4a calli 8019cb4 <_Watchdog_Adjust_to_chain> 8014790: e0 00 00 06 bi 80147a8 <_Timer_server_Body+0xfc> } else if ( snapshot < last_snapshot ) { 8014794: 51 84 00 05 bgeu r12,r4,80147a8 <_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 ); 8014798: b9 a0 08 00 mv r1,r13 801479c: 34 02 00 01 mvi r2,1 80147a0: c8 8c 18 00 sub r3,r4,r12 80147a4: f8 00 15 0d calli 8019bd8 <_Watchdog_Adjust> } watchdogs->last_snapshot = snapshot; 80147a8: 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 ) { 80147ac: 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 ); 80147b0: 29 62 00 78 lw r2,(r11+120) 80147b4: b8 40 08 00 mv r1,r2 80147b8: f8 00 03 6c calli 8015568 <_Chain_Get> 80147bc: b8 20 10 00 mv r2,r1 if ( timer == NULL ) { 80147c0: 44 20 00 09 be r1,r0,80147e4 <_Timer_server_Body+0x138> <== ALWAYS TAKEN static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 80147c4: 28 23 00 38 lw r3,(r1+56) <== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 80147c8: ba 80 08 00 mv r1,r20 <== NOT EXECUTED static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 80147cc: 44 6c 00 03 be r3,r12,80147d8 <_Timer_server_Body+0x12c> <== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 80147d0: 5c 79 ff f8 bne r3,r25,80147b0 <_Timer_server_Body+0x104> <== NOT EXECUTED _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 80147d4: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 80147d8: 34 42 00 10 addi r2,r2,16 <== NOT EXECUTED 80147dc: f8 00 15 5b calli 8019d48 <_Watchdog_Insert> <== NOT EXECUTED 80147e0: e3 ff ff f4 bi 80147b0 <_Timer_server_Body+0x104> <== NOT EXECUTED * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 80147e4: 90 00 10 00 rcsr r2,IE 80147e8: a0 52 08 00 and r1,r2,r18 80147ec: d0 01 00 00 wcsr IE,r1 if ( _Chain_Is_empty( insert_chain ) ) { 80147f0: 2b 81 00 54 lw r1,(sp+84) 80147f4: 5c 35 00 06 bne r1,r21,801480c <_Timer_server_Body+0x160> <== NEVER TAKEN ts->insert_chain = NULL; 80147f8: 59 60 00 78 sw (r11+120),r0 _ISR_Enable( level ); 80147fc: 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 ) ) { 8014800: 2b 81 00 48 lw r1,(sp+72) 8014804: 5c 31 00 04 bne r1,r17,8014814 <_Timer_server_Body+0x168> 8014808: e0 00 00 15 bi 801485c <_Timer_server_Body+0x1b0> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 801480c: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED 8014810: e3 ff ff d2 bi 8014758 <_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 ); 8014814: 90 00 20 00 rcsr r4,IE 8014818: a0 92 08 00 and r1,r4,r18 801481c: 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)); 8014820: 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)) 8014824: 44 51 00 0c be r2,r17,8014854 <_Timer_server_Body+0x1a8> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 8014828: 28 41 00 00 lw r1,(r2+0) the_chain->first = new_first; 801482c: 5b 81 00 48 sw (sp+72),r1 new_first->previous = _Chain_Head(the_chain); 8014830: 58 2f 00 04 sw (r1+4),r15 watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 8014834: 44 40 00 08 be r2,r0,8014854 <_Timer_server_Body+0x1a8> <== NEVER TAKEN watchdog->state = WATCHDOG_INACTIVE; 8014838: 58 40 00 08 sw (r2+8),r0 _ISR_Enable( level ); 801483c: 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 ); 8014840: 28 43 00 1c lw r3,(r2+28) 8014844: 28 41 00 20 lw r1,(r2+32) 8014848: 28 42 00 24 lw r2,(r2+36) 801484c: d8 60 00 00 call r3 } 8014850: e3 ff ff f1 bi 8014814 <_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 ); 8014854: d0 04 00 00 wcsr IE,r4 8014858: e3 ff ff bf bi 8014754 <_Timer_server_Body+0xa8> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 801485c: 31 60 00 7c sb (r11+124),r0 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); 8014860: fb ff ff 53 calli 80145ac <_Thread_Disable_dispatch> _Thread_Set_state( ts->thread, STATES_DELAYING ); 8014864: 29 61 00 00 lw r1,(r11+0) 8014868: 34 02 00 08 mvi r2,8 801486c: f8 00 11 ce calli 8018fa4 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 8014870: b9 60 08 00 mv r1,r11 8014874: fb ff ff 54 calli 80145c4 <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 8014878: b9 60 08 00 mv r1,r11 801487c: fb ff ff 6f calli 8014638 <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 8014880: f8 00 0e 8e calli 80182b8 <_Thread_Enable_dispatch> static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 8014884: 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; 8014888: 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 ); 801488c: f8 00 15 8c calli 8019ebc <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 8014890: ba c0 08 00 mv r1,r22 8014894: f8 00 15 8a calli 8019ebc <_Watchdog_Remove> 8014898: e3 ff ff af bi 8014754 <_Timer_server_Body+0xa8> =============================================================================== 0801489c <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 801489c: 37 9c ff f4 addi sp,sp,-12 80148a0: 5b 8b 00 0c sw (sp+12),r11 80148a4: 5b 8c 00 08 sw (sp+8),r12 80148a8: 5b 9d 00 04 sw (sp+4),ra 80148ac: b8 20 58 00 mv r11,r1 if ( ts->insert_chain == NULL ) { 80148b0: 28 21 00 78 lw r1,(r1+120) static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 80148b4: b8 40 60 00 mv r12,r2 if ( ts->insert_chain == NULL ) { 80148b8: 5c 20 00 43 bne r1,r0,80149c4 <_Timer_server_Schedule_operation_method+0x128><== NEVER TAKEN * 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(); 80148bc: fb ff ff 3c calli 80145ac <_Thread_Disable_dispatch> if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 80148c0: 29 81 00 38 lw r1,(r12+56) 80148c4: 34 02 00 01 mvi r2,1 80148c8: 5c 22 00 1d bne r1,r2,801493c <_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 ); 80148cc: 90 00 10 00 rcsr r2,IE 80148d0: 34 01 ff fe mvi r1,-2 80148d4: a0 41 08 00 and r1,r2,r1 80148d8: d0 01 00 00 wcsr IE,r1 snapshot = _Watchdog_Ticks_since_boot; 80148dc: 78 01 08 03 mvhi r1,0x803 80148e0: 38 21 ed 64 ori r1,r1,0xed64 80148e4: 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)); 80148e8: 29 61 00 30 lw r1,(r11+48) last_snapshot = ts->Interval_watchdogs.last_snapshot; 80148ec: 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; 80148f0: 35 64 00 34 addi r4,r11,52 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 80148f4: 44 24 00 07 be r1,r4,8014910 <_Timer_server_Schedule_operation_method+0x74> /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 80148f8: 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; 80148fc: 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; 8014900: 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) { 8014904: 50 a6 00 02 bgeu r5,r6,801490c <_Timer_server_Schedule_operation_method+0x70> delta_interval -= delta; 8014908: c8 c5 20 00 sub r4,r6,r5 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 801490c: 58 24 00 10 sw (r1+16),r4 } ts->Interval_watchdogs.last_snapshot = snapshot; 8014910: 59 63 00 3c sw (r11+60),r3 _ISR_Enable( level ); 8014914: d0 02 00 00 wcsr IE,r2 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 8014918: 35 61 00 30 addi r1,r11,48 801491c: 35 82 00 10 addi r2,r12,16 8014920: f8 00 15 0a calli 8019d48 <_Watchdog_Insert> if ( !ts->active ) { 8014924: 41 61 00 7c lbu r1,(r11+124) 8014928: 20 21 00 ff andi r1,r1,0xff 801492c: 5c 20 00 24 bne r1,r0,80149bc <_Timer_server_Schedule_operation_method+0x120> _Timer_server_Reset_interval_system_watchdog( ts ); 8014930: b9 60 08 00 mv r1,r11 8014934: fb ff ff 24 calli 80145c4 <_Timer_server_Reset_interval_system_watchdog> 8014938: e0 00 00 21 bi 80149bc <_Timer_server_Schedule_operation_method+0x120> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 801493c: 34 02 00 03 mvi r2,3 8014940: 5c 22 00 1f bne r1,r2,80149bc <_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 ); 8014944: 90 00 30 00 rcsr r6,IE 8014948: 34 01 ff fe mvi r1,-2 801494c: a0 c1 08 00 and r1,r6,r1 8014950: 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)); 8014954: 29 62 00 68 lw r2,(r11+104) snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8014958: 78 01 08 03 mvhi r1,0x803 last_snapshot = ts->TOD_watchdogs.last_snapshot; 801495c: 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(); 8014960: 38 21 ec b4 ori r1,r1,0xecb4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8014964: 35 63 00 6c addi r3,r11,108 8014968: 28 21 00 00 lw r1,(r1+0) last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 801496c: 44 43 00 0a be r2,r3,8014994 <_Timer_server_Schedule_operation_method+0xf8> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 8014970: 28 44 00 10 lw r4,(r2+16) } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 8014974: b4 85 18 00 add r3,r4,r5 delta_interval += delta; 8014978: 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 ) { 801497c: 50 a1 00 05 bgeu r5,r1,8014990 <_Timer_server_Schedule_operation_method+0xf4> /* * We advanced in time. */ delta = snapshot - last_snapshot; 8014980: c8 25 28 00 sub r5,r1,r5 if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 8014984: 34 03 00 00 mvi r3,0 if ( snapshot > last_snapshot ) { /* * We advanced in time. */ delta = snapshot - last_snapshot; if (delta_interval > delta) { 8014988: 50 a4 00 02 bgeu r5,r4,8014990 <_Timer_server_Schedule_operation_method+0xf4><== NEVER TAKEN delta_interval -= delta; 801498c: 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; 8014990: 58 43 00 10 sw (r2+16),r3 } ts->TOD_watchdogs.last_snapshot = snapshot; 8014994: 59 61 00 74 sw (r11+116),r1 _ISR_Enable( level ); 8014998: d0 06 00 00 wcsr IE,r6 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 801499c: 35 61 00 68 addi r1,r11,104 80149a0: 35 82 00 10 addi r2,r12,16 80149a4: f8 00 14 e9 calli 8019d48 <_Watchdog_Insert> if ( !ts->active ) { 80149a8: 41 61 00 7c lbu r1,(r11+124) 80149ac: 20 21 00 ff andi r1,r1,0xff 80149b0: 5c 20 00 03 bne r1,r0,80149bc <_Timer_server_Schedule_operation_method+0x120><== NEVER TAKEN _Timer_server_Reset_tod_system_watchdog( ts ); 80149b4: b9 60 08 00 mv r1,r11 80149b8: fb ff ff 20 calli 8014638 <_Timer_server_Reset_tod_system_watchdog> } } _Thread_Enable_dispatch(); 80149bc: f8 00 0e 3f calli 80182b8 <_Thread_Enable_dispatch> 80149c0: e0 00 00 03 bi 80149cc <_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 ); 80149c4: 29 61 00 78 lw r1,(r11+120) <== NOT EXECUTED 80149c8: f8 00 02 d2 calli 8015510 <_Chain_Append> <== NOT EXECUTED } } 80149cc: 2b 9d 00 04 lw ra,(sp+4) 80149d0: 2b 8b 00 0c lw r11,(sp+12) 80149d4: 2b 8c 00 08 lw r12,(sp+8) 80149d8: 37 9c 00 0c addi sp,sp,12 80149dc: c3 a0 00 00 ret =============================================================================== 08008604 <_Timespec_Greater_than>: bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { if ( lhs->tv_sec > rhs->tv_sec ) 8008604: 28 24 00 00 lw r4,(r1+0) 8008608: 28 45 00 00 lw r5,(r2+0) bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { 800860c: b8 20 18 00 mv r3,r1 if ( lhs->tv_sec > rhs->tv_sec ) return true; 8008610: 34 01 00 01 mvi r1,1 bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { if ( lhs->tv_sec > rhs->tv_sec ) 8008614: 48 85 00 06 bg r4,r5,800862c <_Timespec_Greater_than+0x28> return true; if ( lhs->tv_sec < rhs->tv_sec ) return false; 8008618: 34 01 00 00 mvi r1,0 ) { if ( lhs->tv_sec > rhs->tv_sec ) return true; if ( lhs->tv_sec < rhs->tv_sec ) 800861c: 48 a4 00 04 bg r5,r4,800862c <_Timespec_Greater_than+0x28> <== NEVER TAKEN #include #include #include bool _Timespec_Greater_than( 8008620: 28 63 00 04 lw r3,(r3+4) 8008624: 28 41 00 04 lw r1,(r2+4) 8008628: e8 61 08 00 cmpg r1,r3,r1 /* ASSERT: lhs->tv_sec == rhs->tv_sec */ if ( lhs->tv_nsec > rhs->tv_nsec ) return true; return false; } 800862c: c3 a0 00 00 ret =============================================================================== 080060d8 <_User_extensions_Handler_initialization>: #include #include #include void _User_extensions_Handler_initialization(void) { 80060d8: 37 9c ff ec addi sp,sp,-20 80060dc: 5b 8b 00 14 sw (sp+20),r11 80060e0: 5b 8c 00 10 sw (sp+16),r12 80060e4: 5b 8d 00 0c sw (sp+12),r13 80060e8: 5b 8e 00 08 sw (sp+8),r14 80060ec: 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; 80060f0: 78 02 08 01 mvhi r2,0x801 80060f4: 38 42 30 c4 ori r2,r2,0x30c4 80060f8: 28 4e 00 38 lw r14,(r2+56) initial_extensions = Configuration.User_extension_table; 80060fc: 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); 8006100: 78 03 08 01 mvhi r3,0x801 8006104: 78 02 08 01 mvhi r2,0x801 8006108: 38 42 39 a4 ori r2,r2,0x39a4 800610c: 38 63 39 a8 ori r3,r3,0x39a8 8006110: 58 43 00 00 sw (r2+0),r3 the_chain->permanent_null = NULL; 8006114: 58 40 00 04 sw (r2+4),r0 the_chain->last = _Chain_Head(the_chain); 8006118: 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); 800611c: 78 03 08 01 mvhi r3,0x801 8006120: 78 02 08 01 mvhi r2,0x801 8006124: 38 42 38 20 ori r2,r2,0x3820 8006128: 38 63 38 24 ori r3,r3,0x3824 800612c: 58 43 00 00 sw (r2+0),r3 the_chain->permanent_null = NULL; 8006130: 58 40 00 04 sw (r2+4),r0 the_chain->last = _Chain_Head(the_chain); 8006134: 58 42 00 08 sw (r2+8),r2 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { 8006138: 45 60 00 22 be r11,r0,80061c0 <_User_extensions_Handler_initialization+0xe8><== NEVER TAKEN extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) 800613c: 34 02 00 34 mvi r2,52 8006140: b9 c0 08 00 mv r1,r14 8006144: f8 00 29 cd calli 8010878 <__mulsi3> 8006148: 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( 800614c: f8 00 01 d2 calli 8006894 <_Workspace_Allocate_or_fatal_error> number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 8006150: b9 a0 18 00 mv r3,r13 8006154: 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( 8006158: b8 20 60 00 mv r12,r1 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 800615c: 34 0d 00 00 mvi r13,0 extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 8006160: f8 00 17 45 calli 800be74 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 8006164: e0 00 00 16 bi 80061bc <_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; 8006168: 29 61 00 1c lw r1,(r11+28) 800616c: 29 68 00 00 lw r8,(r11+0) 8006170: 29 67 00 04 lw r7,(r11+4) 8006174: 29 66 00 08 lw r6,(r11+8) 8006178: 29 65 00 0c lw r5,(r11+12) 800617c: 29 64 00 10 lw r4,(r11+16) 8006180: 29 63 00 14 lw r3,(r11+20) 8006184: 29 62 00 18 lw r2,(r11+24) 8006188: 59 81 00 30 sw (r12+48),r1 800618c: 59 88 00 14 sw (r12+20),r8 8006190: 59 87 00 18 sw (r12+24),r7 8006194: 59 86 00 1c sw (r12+28),r6 8006198: 59 85 00 20 sw (r12+32),r5 800619c: 59 84 00 24 sw (r12+36),r4 80061a0: 59 83 00 28 sw (r12+40),r3 80061a4: 59 82 00 2c sw (r12+44),r2 _User_extensions_Add_set( extension ); 80061a8: b9 80 08 00 mv r1,r12 80061ac: f8 00 0d a6 calli 8009844 <_User_extensions_Add_set> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; 80061b0: 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++ ) { 80061b4: 35 ad 00 01 addi r13,r13,1 80061b8: 35 6b 00 20 addi r11,r11,32 80061bc: 55 cd ff eb bgu r14,r13,8006168 <_User_extensions_Handler_initialization+0x90> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; } } } 80061c0: 2b 9d 00 04 lw ra,(sp+4) 80061c4: 2b 8b 00 14 lw r11,(sp+20) 80061c8: 2b 8c 00 10 lw r12,(sp+16) 80061cc: 2b 8d 00 0c lw r13,(sp+12) 80061d0: 2b 8e 00 08 lw r14,(sp+8) 80061d4: 37 9c 00 14 addi sp,sp,20 80061d8: c3 a0 00 00 ret =============================================================================== 08008858 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 8008858: 37 9c ff e4 addi sp,sp,-28 800885c: 5b 8b 00 1c sw (sp+28),r11 8008860: 5b 8c 00 18 sw (sp+24),r12 8008864: 5b 8d 00 14 sw (sp+20),r13 8008868: 5b 8e 00 10 sw (sp+16),r14 800886c: 5b 8f 00 0c sw (sp+12),r15 8008870: 5b 90 00 08 sw (sp+8),r16 8008874: 5b 9d 00 04 sw (sp+4),ra 8008878: b8 20 60 00 mv r12,r1 800887c: b8 60 58 00 mv r11,r3 ISR_Level level; _ISR_Disable( level ); 8008880: 90 00 08 00 rcsr r1,IE 8008884: 34 03 ff fe mvi r3,-2 8008888: a0 23 18 00 and r3,r1,r3 800888c: 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)); 8008890: 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; 8008894: 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 ) ) { 8008898: 44 6e 00 1d be r3,r14,800890c <_Watchdog_Adjust+0xb4> switch ( direction ) { 800889c: 44 40 00 04 be r2,r0,80088ac <_Watchdog_Adjust+0x54> 80088a0: 34 04 00 01 mvi r4,1 80088a4: 5c 44 00 1a bne r2,r4,800890c <_Watchdog_Adjust+0xb4> <== NEVER TAKEN 80088a8: e0 00 00 04 bi 80088b8 <_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; 80088ac: 34 10 00 01 mvi r16,1 _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 80088b0: 34 0f ff fe mvi r15,-2 80088b4: e0 00 00 15 bi 8008908 <_Watchdog_Adjust+0xb0> * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 80088b8: 28 62 00 10 lw r2,(r3+16) 80088bc: b4 4b 58 00 add r11,r2,r11 80088c0: 58 6b 00 10 sw (r3+16),r11 break; 80088c4: e0 00 00 12 bi 800890c <_Watchdog_Adjust+0xb4> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 80088c8: 29 82 00 00 lw r2,(r12+0) case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 80088cc: 28 4d 00 10 lw r13,(r2+16) 80088d0: 51 6d 00 04 bgeu r11,r13,80088e0 <_Watchdog_Adjust+0x88> _Watchdog_First( header )->delta_interval -= units; 80088d4: c9 ab 58 00 sub r11,r13,r11 80088d8: 58 4b 00 10 sw (r2+16),r11 break; 80088dc: e0 00 00 0c bi 800890c <_Watchdog_Adjust+0xb4> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 80088e0: 58 50 00 10 sw (r2+16),r16 _ISR_Enable( level ); 80088e4: d0 01 00 00 wcsr IE,r1 _Watchdog_Tickle( header ); 80088e8: b9 80 08 00 mv r1,r12 80088ec: f8 00 00 98 calli 8008b4c <_Watchdog_Tickle> _ISR_Disable( level ); 80088f0: 90 00 08 00 rcsr r1,IE 80088f4: a0 2f 10 00 and r2,r1,r15 80088f8: d0 02 00 00 wcsr IE,r2 if ( _Chain_Is_empty( header ) ) 80088fc: 29 82 00 00 lw r2,(r12+0) 8008900: 44 4e 00 03 be r2,r14,800890c <_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; 8008904: 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 ) { 8008908: 5d 60 ff f0 bne r11,r0,80088c8 <_Watchdog_Adjust+0x70> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 800890c: d0 01 00 00 wcsr IE,r1 } 8008910: 2b 9d 00 04 lw ra,(sp+4) 8008914: 2b 8b 00 1c lw r11,(sp+28) 8008918: 2b 8c 00 18 lw r12,(sp+24) 800891c: 2b 8d 00 14 lw r13,(sp+20) 8008920: 2b 8e 00 10 lw r14,(sp+16) 8008924: 2b 8f 00 0c lw r15,(sp+12) 8008928: 2b 90 00 08 lw r16,(sp+8) 800892c: 37 9c 00 1c addi sp,sp,28 8008930: c3 a0 00 00 ret =============================================================================== 0800665c <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 800665c: 90 00 28 00 rcsr r5,IE 8006660: 34 02 ff fe mvi r2,-2 8006664: a0 a2 10 00 and r2,r5,r2 8006668: d0 02 00 00 wcsr IE,r2 previous_state = the_watchdog->state; 800666c: 28 23 00 08 lw r3,(r1+8) switch ( previous_state ) { 8006670: 34 02 00 01 mvi r2,1 8006674: 44 62 00 05 be r3,r2,8006688 <_Watchdog_Remove+0x2c> 8006678: 44 60 00 1b be r3,r0,80066e4 <_Watchdog_Remove+0x88> 800667c: 34 02 00 03 mvi r2,3 8006680: 54 62 00 19 bgu r3,r2,80066e4 <_Watchdog_Remove+0x88> <== NEVER TAKEN 8006684: e0 00 00 03 bi 8006690 <_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; 8006688: 58 20 00 08 sw (r1+8),r0 break; 800668c: e0 00 00 16 bi 80066e4 <_Watchdog_Remove+0x88> } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 8006690: 28 22 00 00 lw r2,(r1+0) break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 8006694: 58 20 00 08 sw (r1+8),r0 next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 8006698: 28 44 00 00 lw r4,(r2+0) 800669c: 44 80 00 05 be r4,r0,80066b0 <_Watchdog_Remove+0x54> next_watchdog->delta_interval += the_watchdog->delta_interval; 80066a0: 28 46 00 10 lw r6,(r2+16) 80066a4: 28 24 00 10 lw r4,(r1+16) 80066a8: b4 c4 20 00 add r4,r6,r4 80066ac: 58 44 00 10 sw (r2+16),r4 if ( _Watchdog_Sync_count ) 80066b0: 78 04 08 01 mvhi r4,0x801 80066b4: 38 84 39 50 ori r4,r4,0x3950 80066b8: 28 84 00 00 lw r4,(r4+0) 80066bc: 44 80 00 07 be r4,r0,80066d8 <_Watchdog_Remove+0x7c> _Watchdog_Sync_level = _ISR_Nest_level; 80066c0: 78 04 08 01 mvhi r4,0x801 80066c4: 38 84 39 e8 ori r4,r4,0x39e8 80066c8: 28 86 00 08 lw r6,(r4+8) 80066cc: 78 04 08 01 mvhi r4,0x801 80066d0: 38 84 38 c4 ori r4,r4,0x38c4 80066d4: 58 86 00 00 sw (r4+0),r6 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 80066d8: 28 24 00 04 lw r4,(r1+4) next->previous = previous; 80066dc: 58 44 00 04 sw (r2+4),r4 previous->next = next; 80066e0: 58 82 00 00 sw (r4+0),r2 _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 80066e4: 78 02 08 01 mvhi r2,0x801 80066e8: 38 42 39 54 ori r2,r2,0x3954 80066ec: 28 42 00 00 lw r2,(r2+0) 80066f0: 58 22 00 18 sw (r1+24),r2 _ISR_Enable( level ); 80066f4: d0 05 00 00 wcsr IE,r5 return( previous_state ); } 80066f8: b8 60 08 00 mv r1,r3 80066fc: c3 a0 00 00 ret =============================================================================== 08008478 <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 8008478: 37 9c ff ec addi sp,sp,-20 800847c: 5b 8b 00 14 sw (sp+20),r11 8008480: 5b 8c 00 10 sw (sp+16),r12 8008484: 5b 8d 00 0c sw (sp+12),r13 8008488: 5b 8e 00 08 sw (sp+8),r14 800848c: 5b 9d 00 04 sw (sp+4),ra 8008490: b8 20 70 00 mv r14,r1 8008494: b8 40 60 00 mv r12,r2 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 8008498: 90 00 68 00 rcsr r13,IE 800849c: 34 01 ff fe mvi r1,-2 80084a0: a1 a1 08 00 and r1,r13,r1 80084a4: d0 01 00 00 wcsr IE,r1 printk( "Watchdog Chain: %s %p\n", name, header ); 80084a8: 78 01 08 01 mvhi r1,0x801 80084ac: b9 80 18 00 mv r3,r12 80084b0: 38 21 d1 7c ori r1,r1,0xd17c 80084b4: b9 c0 10 00 mv r2,r14 80084b8: fb ff eb c5 calli 80033cc */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 80084bc: 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; 80084c0: 35 8c 00 04 addi r12,r12,4 if ( !_Chain_Is_empty( header ) ) { 80084c4: 45 6c 00 0b be r11,r12,80084f0 <_Watchdog_Report_chain+0x78> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 80084c8: b9 60 10 00 mv r2,r11 80084cc: 34 01 00 00 mvi r1,0 80084d0: f8 00 00 13 calli 800851c <_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 ) 80084d4: 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 ; 80084d8: 5d 6c ff fc bne r11,r12,80084c8 <_Watchdog_Report_chain+0x50><== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 80084dc: 78 01 08 01 mvhi r1,0x801 80084e0: 38 21 d1 94 ori r1,r1,0xd194 80084e4: b9 c0 10 00 mv r2,r14 80084e8: fb ff eb b9 calli 80033cc 80084ec: e0 00 00 04 bi 80084fc <_Watchdog_Report_chain+0x84> } else { printk( "Chain is empty\n" ); 80084f0: 78 01 08 01 mvhi r1,0x801 80084f4: 38 21 d1 a4 ori r1,r1,0xd1a4 80084f8: fb ff eb b5 calli 80033cc } _ISR_Enable( level ); 80084fc: d0 0d 00 00 wcsr IE,r13 } 8008500: 2b 9d 00 04 lw ra,(sp+4) 8008504: 2b 8b 00 14 lw r11,(sp+20) 8008508: 2b 8c 00 10 lw r12,(sp+16) 800850c: 2b 8d 00 0c lw r13,(sp+12) 8008510: 2b 8e 00 08 lw r14,(sp+8) 8008514: 37 9c 00 14 addi sp,sp,20 8008518: c3 a0 00 00 ret =============================================================================== 08006700 <_Watchdog_Tickle>: */ void _Watchdog_Tickle( Chain_Control *header ) { 8006700: 37 9c ff e4 addi sp,sp,-28 8006704: 5b 8b 00 1c sw (sp+28),r11 8006708: 5b 8c 00 18 sw (sp+24),r12 800670c: 5b 8d 00 14 sw (sp+20),r13 8006710: 5b 8e 00 10 sw (sp+16),r14 8006714: 5b 8f 00 0c sw (sp+12),r15 8006718: 5b 90 00 08 sw (sp+8),r16 800671c: 5b 9d 00 04 sw (sp+4),ra 8006720: 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 ); 8006724: 90 00 18 00 rcsr r3,IE 8006728: 34 01 ff fe mvi r1,-2 800672c: a0 61 08 00 and r1,r3,r1 8006730: 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)); 8006734: 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; 8006738: 35 8e 00 04 addi r14,r12,4 800673c: b8 60 10 00 mv r2,r3 if ( _Chain_Is_empty( header ) ) 8006740: 45 6e 00 1a be r11,r14,80067a8 <_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) { 8006744: 29 61 00 10 lw r1,(r11+16) 8006748: 44 20 00 04 be r1,r0,8006758 <_Watchdog_Tickle+0x58> the_watchdog->delta_interval--; 800674c: 34 21 ff ff addi r1,r1,-1 8006750: 59 61 00 10 sw (r11+16),r1 if ( the_watchdog->delta_interval != 0 ) 8006754: 5c 20 00 15 bne r1,r0,80067a8 <_Watchdog_Tickle+0xa8> */ void _Watchdog_Tickle( Chain_Control *header ) { 8006758: b8 60 68 00 mv r13,r3 do { watchdog_state = _Watchdog_Remove( the_watchdog ); _ISR_Enable( level ); switch( watchdog_state ) { 800675c: 34 10 00 02 mvi r16,2 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 8006760: 34 0f ff fe mvi r15,-2 8006764: e0 00 00 02 bi 800676c <_Watchdog_Tickle+0x6c> 8006768: b8 40 68 00 mv r13,r2 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 800676c: b9 60 08 00 mv r1,r11 8006770: fb ff ff bb calli 800665c <_Watchdog_Remove> _ISR_Enable( level ); 8006774: d0 0d 00 00 wcsr IE,r13 switch( watchdog_state ) { 8006778: 5c 30 00 05 bne r1,r16,800678c <_Watchdog_Tickle+0x8c> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 800677c: 29 63 00 1c lw r3,(r11+28) 8006780: 29 61 00 20 lw r1,(r11+32) 8006784: 29 62 00 24 lw r2,(r11+36) 8006788: d8 60 00 00 call r3 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 800678c: 90 00 10 00 rcsr r2,IE 8006790: a0 4f 08 00 and r1,r2,r15 8006794: d0 01 00 00 wcsr IE,r1 } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 8006798: 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) ); 800679c: 45 6e 00 03 be r11,r14,80067a8 <_Watchdog_Tickle+0xa8> } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 80067a0: 29 61 00 10 lw r1,(r11+16) 80067a4: 44 20 ff f1 be r1,r0,8006768 <_Watchdog_Tickle+0x68> (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 80067a8: d0 02 00 00 wcsr IE,r2 } 80067ac: 2b 9d 00 04 lw ra,(sp+4) 80067b0: 2b 8b 00 1c lw r11,(sp+28) 80067b4: 2b 8c 00 18 lw r12,(sp+24) 80067b8: 2b 8d 00 14 lw r13,(sp+20) 80067bc: 2b 8e 00 10 lw r14,(sp+16) 80067c0: 2b 8f 00 0c lw r15,(sp+12) 80067c4: 2b 90 00 08 lw r16,(sp+8) 80067c8: 37 9c 00 1c addi sp,sp,28 80067cc: c3 a0 00 00 ret =============================================================================== 08023a6c <__kill>: #endif int __kill( pid_t pid, int sig ) { return 0; } 8023a6c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8023a70: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08001470 <_gettimeofday>: int _gettimeofday( struct timeval *tp, struct timezone *tzp ) { 8001470: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 8001474: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED return gettimeofday( tp, tzp ); 8001478: fb ff ff d8 calli 80013d8 <== NOT EXECUTED } 800147c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8001480: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 8001484: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08006060 <_rename_r>: int _rename_r( struct _reent *ptr __attribute__((unused)), const char *old, const char *new ) { 8006060: 37 9c ff a0 addi sp,sp,-96 8006064: 5b 8b 00 1c sw (sp+28),r11 8006068: 5b 8c 00 18 sw (sp+24),r12 800606c: 5b 8d 00 14 sw (sp+20),r13 8006070: 5b 8e 00 10 sw (sp+16),r14 8006074: 5b 8f 00 0c sw (sp+12),r15 8006078: 5b 90 00 08 sw (sp+8),r16 800607c: 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 ); 8006080: b8 40 08 00 mv r1,r2 int _rename_r( struct _reent *ptr __attribute__((unused)), const char *old, const char *new ) { 8006084: b8 40 58 00 mv r11,r2 8006088: 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 ); 800608c: fb ff f9 8b calli 80046b8 8006090: b8 20 70 00 mv r14,r1 8006094: 37 84 00 34 addi r4,sp,52 if ( old_parent_pathlen == 0 ) 8006098: 5c 20 00 07 bne r1,r0,80060b4 <_rename_r+0x54> rtems_filesystem_get_start_loc( old, &i, &old_parent_loc ); 800609c: b9 60 08 00 mv r1,r11 80060a0: 37 82 00 60 addi r2,sp,96 80060a4: b8 80 18 00 mv r3,r4 80060a8: f8 00 00 fa calli 8006490 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; 80060ac: 34 0d 00 00 mvi r13,0 80060b0: e0 00 00 09 bi 80060d4 <_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, 80060b4: b9 60 08 00 mv r1,r11 80060b8: b9 c0 10 00 mv r2,r14 80060bc: 34 03 00 02 mvi r3,2 80060c0: 34 05 00 00 mvi r5,0 80060c4: fb ff f9 62 calli 800464c RTEMS_LIBIO_PERMS_WRITE, &old_parent_loc, false ); if ( result != 0 ) return -1; 80060c8: 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 ) 80060cc: 5c 20 00 59 bne r1,r0,8006230 <_rename_r+0x1d0> <== NEVER TAKEN return -1; free_old_parentloc = true; 80060d0: 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; 80060d4: 2b 81 00 34 lw r1,(sp+52) name = old + old_parent_pathlen; 80060d8: b5 6e 58 00 add r11,r11,r14 80060dc: 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; 80060e0: 5b 81 00 48 sw (sp+72),r1 80060e4: 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 ), 80060e8: 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; 80060ec: 5b 81 00 4c sw (sp+76),r1 80060f0: 2b 81 00 3c lw r1,(sp+60) 80060f4: 5b 81 00 50 sw (sp+80),r1 80060f8: 2b 81 00 40 lw r1,(sp+64) 80060fc: 5b 81 00 54 sw (sp+84),r1 8006100: 2b 81 00 44 lw r1,(sp+68) 8006104: 5b 81 00 58 sw (sp+88),r1 name = old + old_parent_pathlen; name += rtems_filesystem_prefix_separators( name, strlen( name ) ); 8006108: b9 60 08 00 mv r1,r11 800610c: f8 00 32 dc calli 8012c7c 8006110: b8 20 10 00 mv r2,r1 8006114: b9 60 08 00 mv r1,r11 8006118: fb ff f9 7c calli 8004708 800611c: b5 61 58 00 add r11,r11,r1 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 8006120: 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 ) ); 8006124: 5b 8b 00 5c sw (sp+92),r11 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 8006128: f8 00 32 d5 calli 8012c7c 800612c: b8 20 10 00 mv r2,r1 8006130: 34 03 00 00 mvi r3,0 8006134: b9 60 08 00 mv r1,r11 8006138: b9 80 20 00 mv r4,r12 800613c: 34 05 00 00 mvi r5,0 8006140: fb ff f9 21 calli 80045c4 8006144: b8 20 78 00 mv r15,r1 0, &old_loc, false ); if ( result != 0 ) { 8006148: 44 20 00 05 be r1,r0,800615c <_rename_r+0xfc> if ( free_old_parentloc ) rtems_filesystem_freenode( &old_parent_loc ); return -1; 800614c: 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 ); 8006150: 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 ) 8006154: 45 a0 00 37 be r13,r0,8006230 <_rename_r+0x1d0> <== NEVER TAKEN 8006158: e0 00 00 35 bi 800622c <_rename_r+0x1cc> /* * Get the parent of the new node we are renaming to. */ rtems_filesystem_get_start_loc( new, &i, &new_parent_loc ); 800615c: 37 8b 00 20 addi r11,sp,32 8006160: ba 00 08 00 mv r1,r16 8006164: 37 82 00 60 addi r2,sp,96 8006168: b9 60 18 00 mv r3,r11 800616c: f8 00 00 c9 calli 8006490 result = (*new_parent_loc.ops->evalformake_h)( &new[i], &new_parent_loc, &name ); 8006170: 2b 81 00 2c lw r1,(sp+44) 8006174: b9 60 10 00 mv r2,r11 8006178: 37 83 00 5c addi r3,sp,92 800617c: 28 24 00 04 lw r4,(r1+4) 8006180: 2b 81 00 60 lw r1,(sp+96) 8006184: b6 01 08 00 add r1,r16,r1 8006188: d8 80 00 00 call r4 800618c: b8 20 70 00 mv r14,r1 if ( result != 0 ) { 8006190: 44 2f 00 09 be r1,r15,80061b4 <_rename_r+0x154> rtems_filesystem_freenode( &new_parent_loc ); 8006194: b9 60 08 00 mv r1,r11 8006198: fb ff fa 00 calli 8004998 if ( free_old_parentloc ) 800619c: 45 a0 00 03 be r13,r0,80061a8 <_rename_r+0x148> <== NEVER TAKEN rtems_filesystem_freenode( &old_parent_loc ); 80061a0: 37 81 00 34 addi r1,sp,52 80061a4: fb ff f9 fd calli 8004998 rtems_filesystem_freenode( &old_loc ); 80061a8: 37 81 00 48 addi r1,sp,72 80061ac: fb ff f9 fb calli 8004998 80061b0: e0 00 00 0e bi 80061e8 <_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 ) { 80061b4: 2b 81 00 30 lw r1,(sp+48) 80061b8: 2b 82 00 44 lw r2,(sp+68) 80061bc: 44 41 00 0d be r2,r1,80061f0 <_rename_r+0x190> rtems_filesystem_freenode( &new_parent_loc ); 80061c0: b9 60 08 00 mv r1,r11 80061c4: fb ff f9 f5 calli 8004998 if ( free_old_parentloc ) 80061c8: 45 ae 00 03 be r13,r14,80061d4 <_rename_r+0x174> rtems_filesystem_freenode( &old_parent_loc ); 80061cc: 37 81 00 34 addi r1,sp,52 80061d0: fb ff f9 f2 calli 8004998 rtems_filesystem_freenode( &old_loc ); 80061d4: 37 81 00 48 addi r1,sp,72 80061d8: fb ff f9 f0 calli 8004998 rtems_set_errno_and_return_minus_one( EXDEV ); 80061dc: f8 00 25 0e calli 800f614 <__errno> 80061e0: 34 02 00 12 mvi r2,18 80061e4: 58 22 00 00 sw (r1+0),r2 80061e8: 34 0c ff ff mvi r12,-1 80061ec: e0 00 00 11 bi 8006230 <_rename_r+0x1d0> } result = (*new_parent_loc.ops->rename_h)( &old_parent_loc, &old_loc, &new_parent_loc, name ); 80061f0: 2b 81 00 2c lw r1,(sp+44) 80061f4: 2b 84 00 5c lw r4,(sp+92) 80061f8: 37 8f 00 34 addi r15,sp,52 80061fc: 28 25 00 40 lw r5,(r1+64) 8006200: b9 80 10 00 mv r2,r12 8006204: b9 e0 08 00 mv r1,r15 8006208: b9 60 18 00 mv r3,r11 800620c: d8 a0 00 00 call r5 8006210: b8 20 60 00 mv r12,r1 rtems_filesystem_freenode( &new_parent_loc ); 8006214: b9 60 08 00 mv r1,r11 8006218: fb ff f9 e0 calli 8004998 if ( free_old_parentloc ) 800621c: 45 ae 00 03 be r13,r14,8006228 <_rename_r+0x1c8> rtems_filesystem_freenode( &old_parent_loc ); 8006220: b9 e0 08 00 mv r1,r15 8006224: fb ff f9 dd calli 8004998 rtems_filesystem_freenode( &old_loc ); 8006228: 37 81 00 48 addi r1,sp,72 800622c: fb ff f9 db calli 8004998 return result; } 8006230: b9 80 08 00 mv r1,r12 8006234: 2b 9d 00 04 lw ra,(sp+4) 8006238: 2b 8b 00 1c lw r11,(sp+28) 800623c: 2b 8c 00 18 lw r12,(sp+24) 8006240: 2b 8d 00 14 lw r13,(sp+20) 8006244: 2b 8e 00 10 lw r14,(sp+16) 8006248: 2b 8f 00 0c lw r15,(sp+12) 800624c: 2b 90 00 08 lw r16,(sp+8) 8006250: 37 9c 00 60 addi sp,sp,96 8006254: c3 a0 00 00 ret =============================================================================== 080013f4 : #include int chroot( const char *pathname ) { 80013f4: 37 9c ff dc addi sp,sp,-36 80013f8: 5b 8b 00 10 sw (sp+16),r11 80013fc: 5b 8c 00 0c sw (sp+12),r12 8001400: 5b 8d 00 08 sw (sp+8),r13 8001404: 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) { 8001408: 78 0b 08 01 mvhi r11,0x801 800140c: 39 6b 31 04 ori r11,r11,0x3104 8001410: 29 6c 00 00 lw r12,(r11+0) 8001414: 78 02 08 01 mvhi r2,0x801 8001418: 38 42 36 d8 ori r2,r2,0x36d8 #include int chroot( const char *pathname ) { 800141c: 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) { 8001420: 5d 82 00 08 bne r12,r2,8001440 rtems_libio_set_private_env(); /* try to set a new private env*/ 8001424: f8 00 05 9c calli 8002a94 if (rtems_current_user_env == &rtems_global_user_env) /* not ok */ 8001428: 29 61 00 00 lw r1,(r11+0) 800142c: 5c 2c 00 05 bne r1,r12,8001440 rtems_set_errno_and_return_minus_one( ENOTSUP ); 8001430: f8 00 28 73 calli 800b5fc <__errno> 8001434: 34 02 00 86 mvi r2,134 8001438: 58 22 00 00 sw (r1+0),r2 800143c: e0 00 00 0a bi 8001464 } result = chdir(pathname); 8001440: b9 a0 08 00 mv r1,r13 8001444: f8 00 1b aa calli 80082ec 8001448: b8 20 58 00 mv r11,r1 if (result) { 800144c: 44 20 00 08 be r1,r0,800146c rtems_set_errno_and_return_minus_one( errno ); 8001450: f8 00 28 6b calli 800b5fc <__errno> 8001454: b8 20 58 00 mv r11,r1 8001458: f8 00 28 69 calli 800b5fc <__errno> 800145c: 28 21 00 00 lw r1,(r1+0) 8001460: 59 61 00 00 sw (r11+0),r1 8001464: 34 01 ff ff mvi r1,-1 8001468: e0 00 00 1a bi 80014d0 } /* clone the new root location */ if (rtems_filesystem_evaluate_path(".", 1, 0, &loc, 0)) { 800146c: 78 01 08 01 mvhi r1,0x801 8001470: 38 21 1c 4c ori r1,r1,0x1c4c 8001474: 34 02 00 01 mvi r2,1 8001478: 34 03 00 00 mvi r3,0 800147c: 37 84 00 14 addi r4,sp,20 8001480: 34 05 00 00 mvi r5,0 8001484: f8 00 00 68 calli 8001624 8001488: 5c 2b ff f2 bne r1,r11,8001450 <== 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); 800148c: 78 0b 08 01 mvhi r11,0x801 8001490: 39 6b 31 04 ori r11,r11,0x3104 8001494: 29 61 00 00 lw r1,(r11+0) 8001498: 34 21 00 18 addi r1,r1,24 800149c: f8 00 00 aa calli 8001744 rtems_filesystem_root = loc; 80014a0: 29 61 00 00 lw r1,(r11+0) 80014a4: 2b 82 00 14 lw r2,(sp+20) 80014a8: 58 22 00 18 sw (r1+24),r2 80014ac: 2b 82 00 18 lw r2,(sp+24) 80014b0: 58 22 00 1c sw (r1+28),r2 80014b4: 2b 82 00 1c lw r2,(sp+28) 80014b8: 58 22 00 20 sw (r1+32),r2 80014bc: 2b 82 00 20 lw r2,(sp+32) 80014c0: 58 22 00 24 sw (r1+36),r2 80014c4: 2b 82 00 24 lw r2,(sp+36) 80014c8: 58 22 00 28 sw (r1+40),r2 return 0; 80014cc: 34 01 00 00 mvi r1,0 } 80014d0: 2b 9d 00 04 lw ra,(sp+4) 80014d4: 2b 8b 00 10 lw r11,(sp+16) 80014d8: 2b 8c 00 0c lw r12,(sp+12) 80014dc: 2b 8d 00 08 lw r13,(sp+8) 80014e0: 37 9c 00 24 addi sp,sp,36 80014e4: c3 a0 00 00 ret =============================================================================== 080012b0 : static char *ctermid_name = "/dev/console"; char *ctermid( char *s ) { 80012b0: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED 80012b4: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED 80012b8: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED 80012bc: 78 02 08 00 mvhi r2,0x800 <== NOT EXECUTED 80012c0: b8 20 58 00 mv r11,r1 <== NOT EXECUTED 80012c4: 38 42 ea 28 ori r2,r2,0xea28 <== NOT EXECUTED if ( !s ) 80012c8: 44 20 00 03 be r1,r0,80012d4 <== NOT EXECUTED /* * We have no way of knowing the length of the user provided buffer. * It may not be large enough but there is no way to know that. :( * So this is a potential buffer owerrun that we can do nothing about. */ strcpy( s, ctermid_name ); 80012cc: f8 00 22 ec calli 8009e7c <== NOT EXECUTED return s; 80012d0: e0 00 00 02 bi 80012d8 <== NOT EXECUTED char *ctermid( char *s ) { if ( !s ) return ctermid_name; 80012d4: b8 40 58 00 mv r11,r2 <== NOT EXECUTED * It may not be large enough but there is no way to know that. :( * So this is a potential buffer owerrun that we can do nothing about. */ strcpy( s, ctermid_name ); return s; } 80012d8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 80012dc: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80012e0: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 80012e4: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 80012e8: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080064d0 : const char *pathname, size_t pathnamelen, int flags, rtems_filesystem_location_info_t *pathloc ) { 80064d0: 37 9c ff e0 addi sp,sp,-32 80064d4: 5b 8b 00 20 sw (sp+32),r11 80064d8: 5b 8c 00 1c sw (sp+28),r12 80064dc: 5b 8d 00 18 sw (sp+24),r13 80064e0: 5b 8e 00 14 sw (sp+20),r14 80064e4: 5b 8f 00 10 sw (sp+16),r15 80064e8: 5b 90 00 0c sw (sp+12),r16 80064ec: 5b 91 00 08 sw (sp+8),r17 80064f0: 5b 9d 00 04 sw (sp+4),ra 80064f4: b8 80 58 00 mv r11,r4 int i; rtems_device_name_t *device_name_table; /* see if 'flags' is valid */ if ( !rtems_libio_is_valid_perms( flags ) ) 80064f8: 34 04 ff f8 mvi r4,-8 80064fc: a0 64 20 00 and r4,r3,r4 const char *pathname, size_t pathnamelen, int flags, rtems_filesystem_location_info_t *pathloc ) { 8006500: b8 20 88 00 mv r17,r1 8006504: b8 40 80 00 mv r16,r2 int i; rtems_device_name_t *device_name_table; /* see if 'flags' is valid */ if ( !rtems_libio_is_valid_perms( flags ) ) 8006508: 44 80 00 04 be r4,r0,8006518 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EPERM ); 800650c: f8 00 09 ef calli 8008cc8 <__errno> <== NOT EXECUTED 8006510: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8006514: e0 00 00 28 bi 80065b4 <== NOT EXECUTED /* get the device name table */ device_name_table = (rtems_device_name_t *)pathloc->node_access; 8006518: 29 6c 00 00 lw r12,(r11+0) if (!device_name_table) rtems_set_errno_and_return_minus_one( EFAULT ); for (i = 0; i < rtems_device_table_size; i++) { 800651c: 78 0d 08 00 mvhi r13,0x800 if ( !rtems_libio_is_valid_perms( flags ) ) rtems_set_errno_and_return_minus_one( EPERM ); /* get the device name table */ device_name_table = (rtems_device_name_t *)pathloc->node_access; if (!device_name_table) 8006520: 34 0e 00 00 mvi r14,0 rtems_set_errno_and_return_minus_one( EFAULT ); for (i = 0; i < rtems_device_table_size; i++) { 8006524: 39 ad f0 14 ori r13,r13,0xf014 if ( !rtems_libio_is_valid_perms( flags ) ) rtems_set_errno_and_return_minus_one( EPERM ); /* get the device name table */ device_name_table = (rtems_device_name_t *)pathloc->node_access; if (!device_name_table) 8006528: 5d 84 00 1f bne r12,r4,80065a4 rtems_set_errno_and_return_minus_one( EFAULT ); 800652c: f8 00 09 e7 calli 8008cc8 <__errno> 8006530: 34 02 00 0e mvi r2,14 8006534: e0 00 00 20 bi 80065b4 for (i = 0; i < rtems_device_table_size; i++) { if (!device_name_table[i].device_name) 8006538: 29 8f 00 00 lw r15,(r12+0) 800653c: 45 e0 00 18 be r15,r0,800659c continue; if (strncmp(pathname, device_name_table[i].device_name, pathnamelen) != 0) 8006540: ba 20 08 00 mv r1,r17 8006544: b9 e0 10 00 mv r2,r15 8006548: ba 00 18 00 mv r3,r16 800654c: f8 00 0e 28 calli 8009dec 8006550: b8 20 20 00 mv r4,r1 8006554: 5c 20 00 12 bne r1,r0,800659c continue; if (device_name_table[i].device_name[pathnamelen] != '\0') 8006558: b5 f0 78 00 add r15,r15,r16 800655c: 41 e1 00 00 lbu r1,(r15+0) 8006560: 5c 24 00 0f bne r1,r4,800659c <== NEVER TAKEN continue; /* find the device, set proper values */ pathloc->node_access = (void *)&device_name_table[i]; pathloc->handlers = &devFS_file_handlers; 8006564: 78 01 08 00 mvhi r1,0x800 8006568: 38 21 f1 58 ori r1,r1,0xf158 800656c: 59 61 00 08 sw (r11+8),r1 pathloc->ops = &devFS_ops; 8006570: 78 01 08 00 mvhi r1,0x800 8006574: 38 21 f1 10 ori r1,r1,0xf110 8006578: 59 61 00 0c sw (r11+12),r1 pathloc->mt_entry = rtems_filesystem_root.mt_entry; 800657c: 78 01 08 00 mvhi r1,0x800 8006580: 38 21 f1 9c ori r1,r1,0xf19c 8006584: 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]; 8006588: 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; 800658c: 28 21 00 28 lw r1,(r1+40) 8006590: 59 61 00 10 sw (r11+16),r1 return 0; 8006594: 34 01 00 00 mvi r1,0 8006598: e0 00 00 09 bi 80065bc /* 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++) { 800659c: 35 ce 00 01 addi r14,r14,1 80065a0: 35 8c 00 14 addi r12,r12,20 80065a4: 29 a1 00 00 lw r1,(r13+0) 80065a8: 54 2e ff e4 bgu r1,r14,8006538 pathloc->mt_entry = rtems_filesystem_root.mt_entry; return 0; } /* no such file or directory */ rtems_set_errno_and_return_minus_one( ENOENT ); 80065ac: f8 00 09 c7 calli 8008cc8 <__errno> 80065b0: 34 02 00 02 mvi r2,2 80065b4: 58 22 00 00 sw (r1+0),r2 80065b8: 34 01 ff ff mvi r1,-1 } 80065bc: 2b 9d 00 04 lw ra,(sp+4) 80065c0: 2b 8b 00 20 lw r11,(sp+32) 80065c4: 2b 8c 00 1c lw r12,(sp+28) 80065c8: 2b 8d 00 18 lw r13,(sp+24) 80065cc: 2b 8e 00 14 lw r14,(sp+20) 80065d0: 2b 8f 00 10 lw r15,(sp+16) 80065d4: 2b 90 00 0c lw r16,(sp+12) 80065d8: 2b 91 00 08 lw r17,(sp+8) 80065dc: 37 9c 00 20 addi sp,sp,32 80065e0: 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 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 rtems_set_errno_and_return_minus_one( EINVAL ); 8000a58: f8 00 20 9c calli 8008cc8 <__errno> 8000a5c: 34 02 00 16 mvi r2,22 8000a60: e0 00 00 0b bi 8000a8c 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 rtems_set_errno_and_return_minus_one( EFAULT ); for (slot = -1, i = 0; i < rtems_device_table_size; i++){ 8000a6c: 78 0d 08 00 mvhi r13,0x800 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 f0 14 ori r13,r13,0xf014 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 20 91 calli 8008cc8 <__errno> 8000a88: 34 02 00 0e mvi r2,14 8000a8c: 58 22 00 00 sw (r1+0),r2 8000a90: 34 01 ff ff mvi r1,-1 8000a94: e0 00 00 28 bi 8000b34 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 slot = i; else if (strcmp(path, device_name_table[i].device_name) == 0) 8000aa0: b9 60 08 00 mv r1,r11 8000aa4: f8 00 24 73 calli 8009c70 8000aa8: 5c 20 00 05 bne r1,r0,8000abc rtems_set_errno_and_return_minus_one( EEXIST ); 8000aac: f8 00 20 87 calli 8008cc8 <__errno> 8000ab0: 34 02 00 11 mvi r2,17 8000ab4: e3 ff ff f6 bi 8000a8c 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 rtems_set_errno_and_return_minus_one( ENOMEM ); 8000ad4: f8 00 20 7d calli 8008cc8 <__errno> 8000ad8: 34 02 00 0c mvi r2,12 8000adc: e3 ff ff ec bi 8000a8c _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 32 9e calli 800d570 <__ashlsi3> 8000afc: 34 02 00 02 mvi r2,2 8000b00: b8 20 60 00 mv r12,r1 8000b04: f8 00 32 9b calli 800d570 <__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 24 86 calli 8009d30 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 =============================================================================== 08004884 : /* * Drain output queue */ static void drainOutput (struct rtems_termios_tty *tty) { 8004884: 37 9c ff f0 addi sp,sp,-16 8004888: 5b 8b 00 10 sw (sp+16),r11 800488c: 5b 8c 00 0c sw (sp+12),r12 8004890: 5b 8d 00 08 sw (sp+8),r13 8004894: 5b 9d 00 04 sw (sp+4),ra 8004898: b8 20 58 00 mv r11,r1 rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { 800489c: 28 21 00 b4 lw r1,(r1+180) 80048a0: 44 20 00 17 be r1,r0,80048fc rtems_interrupt_disable (level); 80048a4: 90 00 08 00 rcsr r1,IE 80048a8: 34 02 ff fe mvi r2,-2 80048ac: a0 22 10 00 and r2,r1,r2 80048b0: d0 02 00 00 wcsr IE,r2 while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { tty->rawOutBufState = rob_wait; 80048b4: 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); 80048b8: 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) { 80048bc: e0 00 00 0c bi 80048ec tty->rawOutBufState = rob_wait; 80048c0: 59 6d 00 94 sw (r11+148),r13 <== NOT EXECUTED rtems_interrupt_enable (level); 80048c4: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED sc = rtems_semaphore_obtain( 80048c8: 29 61 00 8c lw r1,(r11+140) <== NOT EXECUTED 80048cc: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 80048d0: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 80048d4: f8 00 0a 0d calli 8007108 <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 80048d8: 44 20 00 02 be r1,r0,80048e0 <== NOT EXECUTED rtems_fatal_error_occurred (sc); 80048dc: f8 00 0b e9 calli 8007880 <== NOT EXECUTED rtems_interrupt_disable (level); 80048e0: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED 80048e4: a0 2c 10 00 and r2,r1,r12 <== NOT EXECUTED 80048e8: 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) { 80048ec: 29 63 00 84 lw r3,(r11+132) 80048f0: 29 62 00 80 lw r2,(r11+128) 80048f4: 5c 62 ff f3 bne r3,r2,80048c0 <== 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); 80048f8: d0 01 00 00 wcsr IE,r1 } } 80048fc: 2b 9d 00 04 lw ra,(sp+4) 8004900: 2b 8b 00 10 lw r11,(sp+16) 8004904: 2b 8c 00 0c lw r12,(sp+12) 8004908: 2b 8d 00 08 lw r13,(sp+8) 800490c: 37 9c 00 10 addi sp,sp,16 8004910: c3 a0 00 00 ret =============================================================================== 08005654 : /* * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { 8005654: 37 9c ff f4 addi sp,sp,-12 8005658: 5b 8b 00 08 sw (sp+8),r11 800565c: 5b 9d 00 04 sw (sp+4),ra 8005660: b8 40 58 00 mv r11,r2 if ((tty->termios.c_lflag & ECHOCTL) && 8005664: 28 42 00 3c lw r2,(r2+60) 8005668: 20 42 02 00 andi r2,r2,0x200 800566c: 44 40 00 19 be r2,r0,80056d0 <== NEVER TAKEN iscntrl(c) && (c != '\t') && (c != '\n')) { 8005670: 78 02 08 02 mvhi r2,0x802 8005674: 38 42 13 c8 ori r2,r2,0x13c8 8005678: 28 42 00 00 lw r2,(r2+0) 800567c: 7c 23 00 09 cmpnei r3,r1,9 8005680: b4 41 10 00 add r2,r2,r1 8005684: 40 42 00 01 lbu r2,(r2+1) 8005688: 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) && 800568c: 7c 42 00 00 cmpnei r2,r2,0 iscntrl(c) && (c != '\t') && (c != '\n')) { 8005690: a0 43 10 00 and r2,r2,r3 8005694: 44 40 00 0f be r2,r0,80056d0 8005698: 34 02 00 0a mvi r2,10 800569c: 44 22 00 0d be r1,r2,80056d0 char echobuf[2]; echobuf[0] = '^'; 80056a0: 34 02 00 5e mvi r2,94 echobuf[1] = c ^ 0x40; 80056a4: 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] = '^'; 80056a8: 33 82 00 0c sb (sp+12),r2 echobuf[1] = c ^ 0x40; 80056ac: 33 81 00 0d sb (sp+13),r1 rtems_termios_puts (echobuf, 2, tty); 80056b0: 34 02 00 02 mvi r2,2 80056b4: 37 81 00 0c addi r1,sp,12 80056b8: b9 60 18 00 mv r3,r11 80056bc: fb ff ff 34 calli 800538c tty->column += 2; 80056c0: 29 61 00 28 lw r1,(r11+40) 80056c4: 34 21 00 02 addi r1,r1,2 80056c8: 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')) { 80056cc: e0 00 00 03 bi 80056d8 echobuf[0] = '^'; echobuf[1] = c ^ 0x40; rtems_termios_puts (echobuf, 2, tty); tty->column += 2; } else { oproc (c, tty); 80056d0: b9 60 10 00 mv r2,r11 80056d4: fb ff ff 84 calli 80054e4 } } 80056d8: 2b 9d 00 04 lw ra,(sp+4) 80056dc: 2b 8b 00 08 lw r11,(sp+8) 80056e0: 37 9c 00 0c addi sp,sp,12 80056e4: c3 a0 00 00 ret =============================================================================== 08002690 : void endgrent(void) { 8002690: 37 9c ff fc addi sp,sp,-4 8002694: 5b 9d 00 04 sw (sp+4),ra if (group_fp != NULL) 8002698: 78 01 08 01 mvhi r1,0x801 800269c: 38 21 56 38 ori r1,r1,0x5638 80026a0: 28 21 00 00 lw r1,(r1+0) 80026a4: 44 20 00 02 be r1,r0,80026ac <== NEVER TAKEN fclose(group_fp); 80026a8: f8 00 27 77 calli 800c484 } 80026ac: 2b 9d 00 04 lw ra,(sp+4) 80026b0: 37 9c 00 04 addi sp,sp,4 80026b4: c3 a0 00 00 ret =============================================================================== 080024c8 : void endpwent(void) { 80024c8: 37 9c ff fc addi sp,sp,-4 80024cc: 5b 9d 00 04 sw (sp+4),ra if (passwd_fp != NULL) 80024d0: 78 01 08 01 mvhi r1,0x801 80024d4: 38 21 57 14 ori r1,r1,0x5714 80024d8: 28 21 00 00 lw r1,(r1+0) 80024dc: 44 20 00 02 be r1,r0,80024e4 <== NEVER TAKEN fclose(passwd_fp); 80024e0: f8 00 27 e9 calli 800c484 } 80024e4: 2b 9d 00 04 lw ra,(sp+4) 80024e8: 37 9c 00 04 addi sp,sp,4 80024ec: c3 a0 00 00 ret =============================================================================== 080056e8 : * 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) { 80056e8: 37 9c ff e0 addi sp,sp,-32 80056ec: 5b 8b 00 20 sw (sp+32),r11 80056f0: 5b 8c 00 1c sw (sp+28),r12 80056f4: 5b 8d 00 18 sw (sp+24),r13 80056f8: 5b 8e 00 14 sw (sp+20),r14 80056fc: 5b 8f 00 10 sw (sp+16),r15 8005700: 5b 90 00 0c sw (sp+12),r16 8005704: 5b 91 00 08 sw (sp+8),r17 8005708: 5b 9d 00 04 sw (sp+4),ra 800570c: b8 20 58 00 mv r11,r1 if (tty->ccount == 0) 8005710: 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) { 8005714: b8 40 78 00 mv r15,r2 if (tty->ccount == 0) 8005718: 44 20 00 6c be r1,r0,80058c8 return; if (lineFlag) { 800571c: 44 40 00 62 be r2,r0,80058a4 if (!(tty->termios.c_lflag & ECHO)) { 8005720: 29 6c 00 3c lw r12,(r11+60) 8005724: 21 81 00 08 andi r1,r12,0x8 8005728: 5c 20 00 03 bne r1,r0,8005734 <== ALWAYS TAKEN tty->ccount = 0; 800572c: 59 60 00 20 sw (r11+32),r0 <== NOT EXECUTED return; 8005730: e0 00 00 66 bi 80058c8 <== NOT EXECUTED } if (!(tty->termios.c_lflag & ECHOE)) { 8005734: 21 8c 00 10 andi r12,r12,0x10 8005738: 5d 80 00 5b bne r12,r0,80058a4 <== ALWAYS TAKEN tty->ccount = 0; echo (tty->termios.c_cc[VKILL], tty); 800573c: 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; 8005740: 59 60 00 20 sw (r11+32),r0 <== NOT EXECUTED echo (tty->termios.c_cc[VKILL], tty); 8005744: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8005748: fb ff ff c3 calli 8005654 <== NOT EXECUTED if (tty->termios.c_lflag & ECHOK) 800574c: 29 61 00 3c lw r1,(r11+60) <== NOT EXECUTED 8005750: 20 21 00 20 andi r1,r1,0x20 <== NOT EXECUTED 8005754: 44 2c 00 5d be r1,r12,80058c8 <== NOT EXECUTED echo ('\n', tty); 8005758: 34 01 00 0a mvi r1,10 <== NOT EXECUTED 800575c: e0 00 00 0d bi 8005790 <== NOT EXECUTED return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 8005760: 29 64 00 1c lw r4,(r11+28) 8005764: 34 21 ff ff addi r1,r1,-1 8005768: 59 61 00 20 sw (r11+32),r1 800576c: b4 81 10 00 add r2,r4,r1 8005770: 40 4c 00 00 lbu r12,(r2+0) if (tty->termios.c_lflag & ECHO) { 8005774: 29 62 00 3c lw r2,(r11+60) 8005778: 20 43 00 08 andi r3,r2,0x8 800577c: 44 60 00 48 be r3,r0,800589c <== NEVER TAKEN if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { 8005780: 5d e0 00 07 bne r15,r0,800579c 8005784: 20 43 00 10 andi r3,r2,0x10 8005788: 5c 6f 00 05 bne r3,r15,800579c <== ALWAYS TAKEN echo (tty->termios.c_cc[VERASE], tty); 800578c: 41 61 00 43 lbu r1,(r11+67) <== NOT EXECUTED 8005790: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8005794: fb ff ff b0 calli 8005654 <== NOT EXECUTED 8005798: e0 00 00 4c bi 80058c8 <== NOT EXECUTED } else if (c == '\t') { 800579c: 5d 91 00 20 bne r12,r17,800581c int col = tty->read_start_column; 80057a0: 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)) { 80057a4: 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; 80057a8: 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) 80057ac: 20 42 02 00 andi r2,r2,0x200 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 80057b0: e0 00 00 0f bi 80057ec * 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) 80057b4: b4 83 28 00 add r5,r4,r3 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; 80057b8: 40 a5 00 00 lbu r5,(r5+0) 80057bc: 34 63 00 01 addi r3,r3,1 if (c == '\t') { 80057c0: 5c b1 00 03 bne r5,r17,80057cc col = (col | 7) + 1; 80057c4: 39 8c 00 07 ori r12,r12,0x7 80057c8: e0 00 00 08 bi 80057e8 } else if (iscntrl (c)) { 80057cc: b4 c5 28 00 add r5,r6,r5 80057d0: 40 a5 00 01 lbu r5,(r5+1) 80057d4: 20 a5 00 20 andi r5,r5,0x20 80057d8: 44 a0 00 04 be r5,r0,80057e8 <== ALWAYS TAKEN if (tty->termios.c_lflag & ECHOCTL) 80057dc: 44 40 00 04 be r2,r0,80057ec <== NOT EXECUTED col += 2; 80057e0: 35 8c 00 02 addi r12,r12,2 <== NOT EXECUTED 80057e4: e0 00 00 02 bi 80057ec <== NOT EXECUTED } else { col++; 80057e8: 35 8c 00 01 addi r12,r12,1 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 80057ec: 5c 61 ff f2 bne r3,r1,80057b4 80057f0: e0 00 00 08 bi 8005810 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 80057f4: ba 00 08 00 mv r1,r16 80057f8: 34 02 00 01 mvi r2,1 80057fc: b9 60 18 00 mv r3,r11 8005800: fb ff fe e3 calli 800538c tty->column--; 8005804: 29 61 00 28 lw r1,(r11+40) 8005808: 34 21 ff ff addi r1,r1,-1 800580c: 59 61 00 28 sw (r11+40),r1 } /* * Back up over the tab */ while (tty->column > col) { 8005810: 29 61 00 28 lw r1,(r11+40) 8005814: 48 2c ff f8 bg r1,r12,80057f4 8005818: e0 00 00 21 bi 800589c rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 800581c: 29 a1 00 00 lw r1,(r13+0) 8005820: 35 8c 00 01 addi r12,r12,1 8005824: b4 2c 08 00 add r1,r1,r12 8005828: 40 21 00 00 lbu r1,(r1+0) 800582c: 20 21 00 20 andi r1,r1,0x20 8005830: 44 20 00 0b be r1,r0,800585c <== ALWAYS TAKEN 8005834: 20 42 02 00 andi r2,r2,0x200 <== NOT EXECUTED 8005838: 44 40 00 09 be r2,r0,800585c <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 800583c: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 8005840: 34 02 00 03 mvi r2,3 <== NOT EXECUTED 8005844: b9 60 18 00 mv r3,r11 <== NOT EXECUTED 8005848: fb ff fe d1 calli 800538c <== NOT EXECUTED if (tty->column) 800584c: 29 61 00 28 lw r1,(r11+40) <== NOT EXECUTED 8005850: 44 20 00 03 be r1,r0,800585c <== NOT EXECUTED tty->column--; 8005854: 34 21 ff ff addi r1,r1,-1 <== NOT EXECUTED 8005858: 59 61 00 28 sw (r11+40),r1 <== NOT EXECUTED } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { 800585c: 29 a1 00 00 lw r1,(r13+0) 8005860: b4 2c 60 00 add r12,r1,r12 8005864: 41 81 00 00 lbu r1,(r12+0) 8005868: 20 21 00 20 andi r1,r1,0x20 800586c: 44 20 00 04 be r1,r0,800587c <== ALWAYS TAKEN 8005870: 29 61 00 3c lw r1,(r11+60) <== NOT EXECUTED 8005874: 20 21 02 00 andi r1,r1,0x200 <== NOT EXECUTED 8005878: 44 20 00 09 be r1,r0,800589c <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 800587c: b9 c0 08 00 mv r1,r14 8005880: 34 02 00 03 mvi r2,3 8005884: b9 60 18 00 mv r3,r11 8005888: fb ff fe c1 calli 800538c if (tty->column) 800588c: 29 61 00 28 lw r1,(r11+40) 8005890: 44 20 00 03 be r1,r0,800589c <== NEVER TAKEN tty->column--; 8005894: 34 21 ff ff addi r1,r1,-1 8005898: 59 61 00 28 sw (r11+40),r1 } } } if (!lineFlag) 800589c: 5d e0 00 09 bne r15,r0,80058c0 80058a0: e0 00 00 0a bi 80058c8 80058a4: 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); 80058a8: 78 0e 08 01 mvhi r14,0x801 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 80058ac: 78 10 08 01 mvhi r16,0x801 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') { 80058b0: 34 11 00 09 mvi r17,9 80058b4: 39 ad 13 c8 ori r13,r13,0x13c8 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); 80058b8: 39 ce f6 38 ori r14,r14,0xf638 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 80058bc: 3a 10 f6 34 ori r16,r16,0xf634 echo ('\n', tty); return; } } while (tty->ccount) { 80058c0: 29 61 00 20 lw r1,(r11+32) 80058c4: 5c 20 ff a7 bne r1,r0,8005760 } } if (!lineFlag) break; } } 80058c8: 2b 9d 00 04 lw ra,(sp+4) 80058cc: 2b 8b 00 20 lw r11,(sp+32) 80058d0: 2b 8c 00 1c lw r12,(sp+28) 80058d4: 2b 8d 00 18 lw r13,(sp+24) 80058d8: 2b 8e 00 14 lw r14,(sp+20) 80058dc: 2b 8f 00 10 lw r15,(sp+16) 80058e0: 2b 90 00 0c lw r16,(sp+12) 80058e4: 2b 91 00 08 lw r17,(sp+8) 80058e8: 37 9c 00 20 addi sp,sp,32 80058ec: c3 a0 00 00 ret =============================================================================== 08001e44 : int fcntl( int fd, int cmd, ... ) { 8001e44: 37 9c ff c4 addi sp,sp,-60 8001e48: 5b 8b 00 20 sw (sp+32),r11 8001e4c: 5b 8c 00 1c sw (sp+28),r12 8001e50: 5b 8d 00 18 sw (sp+24),r13 8001e54: 5b 8e 00 14 sw (sp+20),r14 8001e58: 5b 8f 00 10 sw (sp+16),r15 8001e5c: 5b 90 00 0c sw (sp+12),r16 8001e60: 5b 91 00 08 sw (sp+8),r17 8001e64: 5b 9d 00 04 sw (sp+4),ra 8001e68: 5b 82 00 24 sw (sp+36),r2 8001e6c: b8 40 68 00 mv r13,r2 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 8001e70: 78 02 08 01 mvhi r2,0x801 int fcntl( int fd, int cmd, ... ) { 8001e74: 5b 83 00 28 sw (sp+40),r3 8001e78: 5b 84 00 2c sw (sp+44),r4 8001e7c: 5b 85 00 30 sw (sp+48),r5 8001e80: 5b 86 00 34 sw (sp+52),r6 8001e84: 5b 87 00 38 sw (sp+56),r7 8001e88: 5b 88 00 3c sw (sp+60),r8 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 8001e8c: 38 42 40 10 ori r2,r2,0x4010 8001e90: 28 51 00 00 lw r17,(r2+0) ... ) { int ret; va_list ap; va_start( ap, cmd ); 8001e94: 37 8e 00 28 addi r14,sp,40 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 8001e98: 56 21 00 02 bgu r17,r1,8001ea0 8001e9c: e0 00 00 0a bi 8001ec4 iop = rtems_libio_iop( fd ); 8001ea0: 78 02 08 01 mvhi r2,0x801 8001ea4: 38 42 46 a0 ori r2,r2,0x46a0 8001ea8: 28 50 00 00 lw r16,(r2+0) 8001eac: 34 02 00 06 mvi r2,6 8001eb0: f8 00 41 45 calli 80123c4 <__ashlsi3> 8001eb4: b6 01 58 00 add r11,r16,r1 rtems_libio_check_is_open(iop); 8001eb8: 29 6c 00 18 lw r12,(r11+24) 8001ebc: 21 81 01 00 andi r1,r12,0x100 8001ec0: 5c 20 00 04 bne r1,r0,8001ed0 8001ec4: f8 00 29 5c calli 800c434 <__errno> 8001ec8: 34 02 00 09 mvi r2,9 8001ecc: e0 00 00 49 bi 8001ff0 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 8001ed0: 34 01 00 09 mvi r1,9 8001ed4: 55 a1 00 45 bgu r13,r1,8001fe8 8001ed8: 78 0f 08 01 mvhi r15,0x801 8001edc: b9 a0 08 00 mv r1,r13 8001ee0: 34 02 00 02 mvi r2,2 8001ee4: f8 00 41 38 calli 80123c4 <__ashlsi3> 8001ee8: 39 ef 36 20 ori r15,r15,0x3620 8001eec: b5 e1 08 00 add r1,r15,r1 8001ef0: 28 21 00 00 lw r1,(r1+0) 8001ef4: c0 20 00 00 b r1 case F_DUPFD: /* dup */ fd2 = va_arg( ap, int ); 8001ef8: 29 cc 00 00 lw r12,(r14+0) if ( fd2 ) 8001efc: 45 80 00 08 be r12,r0,8001f1c diop = rtems_libio_iop( fd2 ); 8001f00: 34 03 00 00 mvi r3,0 8001f04: 51 91 00 09 bgeu r12,r17,8001f28 <== NEVER TAKEN 8001f08: b9 80 08 00 mv r1,r12 8001f0c: 34 02 00 06 mvi r2,6 8001f10: f8 00 41 2d calli 80123c4 <__ashlsi3> 8001f14: b6 01 18 00 add r3,r16,r1 8001f18: e0 00 00 04 bi 8001f28 else { /* allocate a file control block */ diop = rtems_libio_allocate(); 8001f1c: f8 00 01 e6 calli 80026b4 8001f20: b8 20 18 00 mv r3,r1 if ( diop == 0 ) { 8001f24: 44 2c 00 3e be r1,r12,800201c <== NEVER TAKEN ret = -1; break; } } diop->flags = iop->flags; 8001f28: 29 61 00 18 lw r1,(r11+24) diop->pathinfo = iop->pathinfo; 8001f2c: 29 62 00 28 lw r2,(r11+40) 8001f30: 29 66 00 1c lw r6,(r11+28) ret = -1; break; } } diop->flags = iop->flags; 8001f34: 58 61 00 18 sw (r3+24),r1 diop->pathinfo = iop->pathinfo; 8001f38: 29 61 00 2c lw r1,(r11+44) 8001f3c: 29 65 00 20 lw r5,(r11+32) 8001f40: 29 64 00 24 lw r4,(r11+36) 8001f44: 58 61 00 2c sw (r3+44),r1 ret = (int) (diop - rtems_libio_iops); 8001f48: 78 01 08 01 mvhi r1,0x801 8001f4c: 38 21 46 a0 ori r1,r1,0x46a0 8001f50: 28 21 00 00 lw r1,(r1+0) break; } } diop->flags = iop->flags; diop->pathinfo = iop->pathinfo; 8001f54: 58 62 00 28 sw (r3+40),r2 8001f58: 58 66 00 1c sw (r3+28),r6 8001f5c: 58 65 00 20 sw (r3+32),r5 8001f60: 58 64 00 24 sw (r3+36),r4 ret = (int) (diop - rtems_libio_iops); 8001f64: c8 61 08 00 sub r1,r3,r1 8001f68: 34 02 00 06 mvi r2,6 8001f6c: f8 00 41 3d calli 8012460 <__ashrsi3> 8001f70: e0 00 00 0e bi 8001fa8 break; case F_GETFD: /* get f_flags */ ret = ((iop->flags & LIBIO_FLAGS_CLOSE_ON_EXEC) != 0); 8001f74: 21 8c 08 00 andi r12,r12,0x800 8001f78: 7d 8c 00 00 cmpnei r12,r12,0 8001f7c: e0 00 00 1f bi 8001ff8 * 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 ) ) 8001f80: 29 c1 00 00 lw r1,(r14+0) 8001f84: 44 20 00 03 be r1,r0,8001f90 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 8001f88: 39 8c 08 00 ori r12,r12,0x800 8001f8c: e0 00 00 03 bi 8001f98 else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 8001f90: 34 01 f7 ff mvi r1,-2049 8001f94: a1 81 60 00 and r12,r12,r1 8001f98: 59 6c 00 18 sw (r11+24),r12 8001f9c: e0 00 00 0e bi 8001fd4 break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); 8001fa0: b9 80 08 00 mv r1,r12 8001fa4: f8 00 01 b0 calli 8002664 8001fa8: 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) { 8001fac: 48 01 00 1d bg r0,r1,8002020 <== NEVER TAKEN 8001fb0: e0 00 00 12 bi 8001ff8 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 ) ); 8001fb4: 29 c1 00 00 lw r1,(r14+0) 8001fb8: f8 00 01 95 calli 800260c /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); 8001fbc: 29 63 00 18 lw r3,(r11+24) 8001fc0: 34 02 fd fe mvi r2,-514 8001fc4: 20 21 02 01 andi r1,r1,0x201 8001fc8: a0 43 10 00 and r2,r2,r3 8001fcc: b8 22 08 00 or r1,r1,r2 8001fd0: 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; 8001fd4: 34 0c 00 00 mvi r12,0 8001fd8: e0 00 00 08 bi 8001ff8 errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 8001fdc: f8 00 29 16 calli 800c434 <__errno> 8001fe0: 34 02 00 86 mvi r2,134 8001fe4: e0 00 00 03 bi 8001ff0 ret = -1; break; default: errno = EINVAL; 8001fe8: f8 00 29 13 calli 800c434 <__errno> 8001fec: 34 02 00 16 mvi r2,22 8001ff0: 58 22 00 00 sw (r1+0),r2 8001ff4: e0 00 00 0a bi 800201c * 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 ); 8001ff8: 29 61 00 24 lw r1,(r11+36) 8001ffc: b9 60 10 00 mv r2,r11 8002000: 28 23 00 30 lw r3,(r1+48) 8002004: b9 a0 08 00 mv r1,r13 8002008: d8 60 00 00 call r3 800200c: b8 20 58 00 mv r11,r1 if (err) { 8002010: 44 20 00 04 be r1,r0,8002020 <== ALWAYS TAKEN errno = err; 8002014: f8 00 29 08 calli 800c434 <__errno> <== NOT EXECUTED 8002018: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED ret = -1; 800201c: 34 0c ff ff mvi r12,-1 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 8002020: b9 80 08 00 mv r1,r12 8002024: 2b 9d 00 04 lw ra,(sp+4) 8002028: 2b 8b 00 20 lw r11,(sp+32) 800202c: 2b 8c 00 1c lw r12,(sp+28) 8002030: 2b 8d 00 18 lw r13,(sp+24) 8002034: 2b 8e 00 14 lw r14,(sp+20) 8002038: 2b 8f 00 10 lw r15,(sp+16) 800203c: 2b 90 00 0c lw r16,(sp+12) 8002040: 2b 91 00 08 lw r17,(sp+8) 8002044: 37 9c 00 3c addi sp,sp,60 8002048: c3 a0 00 00 ret =============================================================================== 08009fa4 : */ int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 8009fa4: 37 9c ff e0 addi sp,sp,-32 8009fa8: 5b 8b 00 1c sw (sp+28),r11 8009fac: 5b 8c 00 18 sw (sp+24),r12 8009fb0: 5b 8d 00 14 sw (sp+20),r13 8009fb4: 5b 8e 00 10 sw (sp+16),r14 8009fb8: 5b 8f 00 0c sw (sp+12),r15 8009fbc: 5b 90 00 08 sw (sp+8),r16 8009fc0: 5b 9d 00 04 sw (sp+4),ra static rtems_status_code pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 8009fc4: 78 0b 08 02 mvhi r11,0x802 8009fc8: 39 6b 16 50 ori r11,r11,0x1650 */ int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 8009fcc: b8 20 78 00 mv r15,r1 static rtems_status_code pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 8009fd0: 29 61 00 00 lw r1,(r11+0) */ int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 8009fd4: b8 40 70 00 mv r14,r2 static rtems_status_code pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 8009fd8: 5c 20 00 18 bne r1,r0,800a038 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 ); 8009fdc: 78 01 08 02 mvhi r1,0x802 8009fe0: 38 21 16 cc ori r1,r1,0x16cc 8009fe4: 28 21 00 00 lw r1,(r1+0) 8009fe8: 34 02 00 00 mvi r2,0 8009fec: 34 03 00 00 mvi r3,0 8009ff0: fb ff ec 18 calli 8005050 rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { 8009ff4: 29 61 00 00 lw r1,(r11+0) free(pipe); } static rtems_status_code pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; 8009ff8: 34 0c 00 00 mvi r12,0 if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { 8009ffc: 5c 2c 00 0a bne r1,r12,800a024 <== NEVER TAKEN sc = rtems_semaphore_create( 800a000: 78 02 08 01 mvhi r2,0x801 800a004: 38 42 fb a8 ori r2,r2,0xfba8 800a008: 28 41 00 00 lw r1,(r2+0) 800a00c: 34 03 00 54 mvi r3,84 800a010: 34 02 00 01 mvi r2,1 800a014: 34 04 00 00 mvi r4,0 800a018: b9 60 28 00 mv r5,r11 800a01c: fb ff eb 61 calli 8004da0 800a020: b8 20 60 00 mv r12,r1 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 800a024: 78 01 08 02 mvhi r1,0x802 800a028: 38 21 16 cc ori r1,r1,0x16cc 800a02c: 28 21 00 00 lw r1,(r1+0) 800a030: fb ff ec 58 calli 8005190 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { 800a034: 5d 80 00 08 bne r12,r0,800a054 sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 800a038: 78 01 08 02 mvhi r1,0x802 800a03c: 38 21 16 50 ori r1,r1,0x1650 800a040: 28 21 00 00 lw r1,(r1+0) 800a044: 34 02 00 00 mvi r2,0 800a048: 34 03 00 00 mvi r3,0 800a04c: fb ff ec 01 calli 8005050 } if (sc == RTEMS_SUCCESSFUL) { 800a050: 44 20 00 03 be r1,r0,800a05c <== ALWAYS TAKEN 800a054: 34 0c ff f4 mvi r12,-12 800a058: e0 00 00 b9 bi 800a33c err = pipe_lock(); if (err) return err; pipe = *pipep; 800a05c: 29 eb 00 00 lw r11,(r15+0) 800a060: 34 0c 00 00 mvi r12,0 if (pipe == NULL) { 800a064: 5d 60 00 41 bne r11,r0,800a168 { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); 800a068: 34 01 00 34 mvi r1,52 800a06c: fb ff e6 d3 calli 8003bb8 800a070: b8 20 58 00 mv r11,r1 800a074: b8 20 80 00 mv r16,r1 if (pipe == NULL) 800a078: 44 20 00 3a be r1,r0,800a160 return err; memset(pipe, 0, sizeof(pipe_control_t)); 800a07c: 34 02 00 00 mvi r2,0 800a080: 34 03 00 34 mvi r3,52 800a084: f8 00 11 ab calli 800e730 pipe->Size = PIPE_BUF; 800a088: 34 01 02 00 mvi r1,512 800a08c: 59 61 00 04 sw (r11+4),r1 pipe->Buffer = malloc(pipe->Size); 800a090: fb ff e6 ca calli 8003bb8 800a094: 59 61 00 00 sw (r11+0),r1 if (! pipe->Buffer) 800a098: 44 20 00 30 be r1,r0,800a158 <== NEVER TAKEN goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), 800a09c: 78 0d 08 02 mvhi r13,0x802 if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 800a0a0: 78 03 08 01 mvhi r3,0x801 800a0a4: 38 63 fb ac ori r3,r3,0xfbac rtems_build_name ('P', 'I', 'r', c), 800a0a8: 39 ad 11 20 ori r13,r13,0x1120 800a0ac: 41 a2 00 00 lbu r2,(r13+0) if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 800a0b0: 28 61 00 00 lw r1,(r3+0) 800a0b4: 35 64 00 2c addi r4,r11,44 800a0b8: 34 03 00 00 mvi r3,0 800a0bc: b8 41 08 00 or r1,r2,r1 800a0c0: 34 02 00 00 mvi r2,0 800a0c4: f8 00 04 7e calli 800b2bc 800a0c8: 5c 20 00 22 bne r1,r0,800a150 rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( 800a0cc: 78 03 08 01 mvhi r3,0x801 800a0d0: 38 63 fb b0 ori r3,r3,0xfbb0 rtems_build_name ('P', 'I', 'w', c), 800a0d4: 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( 800a0d8: 28 61 00 00 lw r1,(r3+0) 800a0dc: 35 64 00 30 addi r4,r11,48 800a0e0: 34 03 00 00 mvi r3,0 800a0e4: b8 41 08 00 or r1,r2,r1 800a0e8: 34 02 00 00 mvi r2,0 800a0ec: f8 00 04 74 calli 800b2bc 800a0f0: 5c 20 00 16 bne r1,r0,800a148 rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( 800a0f4: 78 03 08 01 mvhi r3,0x801 800a0f8: 38 63 fb b4 ori r3,r3,0xfbb4 rtems_build_name ('P', 'I', 's', c), 1, 800a0fc: 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( 800a100: 28 61 00 00 lw r1,(r3+0) 800a104: 34 04 00 00 mvi r4,0 800a108: 34 03 00 10 mvi r3,16 800a10c: b8 41 08 00 or r1,r2,r1 800a110: 35 65 00 28 addi r5,r11,40 800a114: 34 02 00 01 mvi r2,1 800a118: fb ff eb 22 calli 8004da0 800a11c: 5c 20 00 09 bne r1,r0,800a140 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 800a120: 41 a1 00 00 lbu r1,(r13+0) 800a124: 34 22 00 01 addi r2,r1,1 800a128: 31 a2 00 00 sb (r13+0),r2 800a12c: 34 02 00 7a mvi r2,122 800a130: 5c 22 00 0e bne r1,r2,800a168 c = 'a'; 800a134: 34 01 00 61 mvi r1,97 800a138: 31 a1 00 00 sb (r13+0),r1 800a13c: e0 00 00 0b bi 800a168 return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); 800a140: 29 61 00 30 lw r1,(r11+48) 800a144: f8 00 04 9a calli 800b3ac err_wbar: rtems_barrier_delete(pipe->readBarrier); 800a148: 2a 01 00 2c lw r1,(r16+44) 800a14c: f8 00 04 98 calli 800b3ac err_rbar: free(pipe->Buffer); 800a150: 2a 01 00 00 lw r1,(r16+0) 800a154: fb ff e4 5a calli 80032bc err_buf: free(pipe); 800a158: ba 00 08 00 mv r1,r16 800a15c: fb ff e4 58 calli 80032bc if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; 800a160: 34 0c ff f4 mvi r12,-12 800a164: e0 00 00 0e bi 800a19c err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 800a168: 29 61 00 28 lw r1,(r11+40) 800a16c: 34 02 00 00 mvi r2,0 800a170: 34 03 00 00 mvi r3,0 800a174: fb ff eb b7 calli 8005050 800a178: 44 20 00 02 be r1,r0,800a180 <== ALWAYS TAKEN err = -EINTR; 800a17c: 34 0c ff fc mvi r12,-4 <== NOT EXECUTED if (*pipep == NULL) { 800a180: 29 e1 00 00 lw r1,(r15+0) 800a184: 5c 20 00 06 bne r1,r0,800a19c if (err) 800a188: 45 81 00 04 be r12,r1,800a198 <== ALWAYS TAKEN pipe_free(pipe); 800a18c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 800a190: fb ff ff 41 calli 8009e94 <== NOT EXECUTED 800a194: e0 00 00 02 bi 800a19c <== NOT EXECUTED else *pipep = pipe; 800a198: 59 eb 00 00 sw (r15+0),r11 } out: pipe_unlock(); 800a19c: fb ff ff 35 calli 8009e70 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) 800a1a0: 5d 80 00 67 bne r12,r0,800a33c <== NEVER TAKEN return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { 800a1a4: 29 c1 00 18 lw r1,(r14+24) 800a1a8: 34 02 00 04 mvi r2,4 int err; err = pipe_new(pipep); if (err) return err; pipe = *pipep; 800a1ac: 29 eb 00 00 lw r11,(r15+0) switch (LIBIO_ACCMODE(iop)) { 800a1b0: 20 21 00 06 andi r1,r1,0x6 800a1b4: 44 22 00 24 be r1,r2,800a244 800a1b8: 34 02 00 06 mvi r2,6 800a1bc: 44 22 00 45 be r1,r2,800a2d0 <== NEVER TAKEN 800a1c0: 34 02 00 02 mvi r2,2 800a1c4: 5c 22 00 57 bne r1,r2,800a320 <== NEVER TAKEN case LIBIO_FLAGS_READ: pipe->readerCounter ++; 800a1c8: 29 61 00 20 lw r1,(r11+32) 800a1cc: 34 21 00 01 addi r1,r1,1 800a1d0: 59 61 00 20 sw (r11+32),r1 if (pipe->Readers ++ == 0) 800a1d4: 29 61 00 10 lw r1,(r11+16) 800a1d8: 34 22 00 01 addi r2,r1,1 800a1dc: 59 62 00 10 sw (r11+16),r2 800a1e0: 5c 20 00 04 bne r1,r0,800a1f0 <== NEVER TAKEN PIPE_WAKEUPWRITERS(pipe); 800a1e4: 29 61 00 30 lw r1,(r11+48) 800a1e8: 37 82 00 20 addi r2,sp,32 800a1ec: f8 00 04 a0 calli 800b46c if (pipe->Writers == 0) { 800a1f0: 29 61 00 14 lw r1,(r11+20) 800a1f4: 5c 20 00 4b bne r1,r0,800a320 /* Not an error */ if (LIBIO_NODELAY(iop)) 800a1f8: 29 c2 00 18 lw r2,(r14+24) 800a1fc: 20 42 00 01 andi r2,r2,0x1 800a200: 5c 41 00 48 bne r2,r1,800a320 break; prevCounter = pipe->writerCounter; 800a204: 29 70 00 24 lw r16,(r11+36) err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); 800a208: 29 61 00 28 lw r1,(r11+40) 800a20c: fb ff eb e1 calli 8005190 if (! PIPE_READWAIT(pipe)) 800a210: 29 61 00 2c lw r1,(r11+44) 800a214: 34 02 00 00 mvi r2,0 800a218: f8 00 04 b2 calli 800b4e0 800a21c: b8 20 68 00 mv r13,r1 800a220: 5c 20 00 43 bne r1,r0,800a32c <== NEVER TAKEN goto out_error; if (! PIPE_LOCK(pipe)) 800a224: 29 61 00 28 lw r1,(r11+40) 800a228: 34 02 00 00 mvi r2,0 800a22c: 34 03 00 00 mvi r3,0 800a230: fb ff eb 88 calli 8005050 800a234: 5c 2d 00 3e bne r1,r13,800a32c <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->writerCounter); 800a238: 29 61 00 24 lw r1,(r11+36) 800a23c: 46 01 ff f3 be r16,r1,800a208 <== NEVER TAKEN 800a240: e0 00 00 38 bi 800a320 } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 800a244: 29 61 00 24 lw r1,(r11+36) 800a248: 34 21 00 01 addi r1,r1,1 800a24c: 59 61 00 24 sw (r11+36),r1 if (pipe->Writers ++ == 0) 800a250: 29 61 00 14 lw r1,(r11+20) 800a254: 34 22 00 01 addi r2,r1,1 800a258: 59 62 00 14 sw (r11+20),r2 800a25c: 5c 20 00 04 bne r1,r0,800a26c <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); 800a260: 29 61 00 2c lw r1,(r11+44) 800a264: 37 82 00 20 addi r2,sp,32 800a268: f8 00 04 81 calli 800b46c if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { 800a26c: 29 61 00 10 lw r1,(r11+16) 800a270: 5c 20 00 2c bne r1,r0,800a320 800a274: 29 c2 00 18 lw r2,(r14+24) 800a278: 20 42 00 01 andi r2,r2,0x1 800a27c: 44 41 00 05 be r2,r1,800a290 PIPE_UNLOCK(pipe); 800a280: 29 61 00 28 lw r1,(r11+40) err = -ENXIO; 800a284: 34 0c ff fa mvi r12,-6 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { PIPE_UNLOCK(pipe); 800a288: fb ff eb c2 calli 8005190 err = -ENXIO; goto out_error; 800a28c: e0 00 00 29 bi 800a330 } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; 800a290: 29 70 00 20 lw r16,(r11+32) err = -EINTR; do { PIPE_UNLOCK(pipe); 800a294: 29 61 00 28 lw r1,(r11+40) 800a298: fb ff eb be calli 8005190 if (! PIPE_WRITEWAIT(pipe)) 800a29c: 29 61 00 30 lw r1,(r11+48) 800a2a0: 34 02 00 00 mvi r2,0 800a2a4: f8 00 04 8f calli 800b4e0 800a2a8: b8 20 68 00 mv r13,r1 800a2ac: 5c 20 00 20 bne r1,r0,800a32c <== NEVER TAKEN goto out_error; if (! PIPE_LOCK(pipe)) 800a2b0: 29 61 00 28 lw r1,(r11+40) 800a2b4: 34 02 00 00 mvi r2,0 800a2b8: 34 03 00 00 mvi r3,0 800a2bc: fb ff eb 65 calli 8005050 800a2c0: 5c 2d 00 1b bne r1,r13,800a32c <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->readerCounter); 800a2c4: 29 61 00 20 lw r1,(r11+32) 800a2c8: 46 01 ff f3 be r16,r1,800a294 <== NEVER TAKEN 800a2cc: e0 00 00 15 bi 800a320 } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 800a2d0: 29 61 00 20 lw r1,(r11+32) 800a2d4: 34 21 00 01 addi r1,r1,1 800a2d8: 59 61 00 20 sw (r11+32),r1 if (pipe->Readers ++ == 0) 800a2dc: 29 61 00 10 lw r1,(r11+16) 800a2e0: 34 22 00 01 addi r2,r1,1 800a2e4: 59 62 00 10 sw (r11+16),r2 800a2e8: 5c 20 00 04 bne r1,r0,800a2f8 <== NEVER TAKEN PIPE_WAKEUPWRITERS(pipe); 800a2ec: 29 61 00 30 lw r1,(r11+48) 800a2f0: 37 82 00 20 addi r2,sp,32 800a2f4: f8 00 04 5e calli 800b46c pipe->writerCounter ++; 800a2f8: 29 61 00 24 lw r1,(r11+36) 800a2fc: 34 21 00 01 addi r1,r1,1 800a300: 59 61 00 24 sw (r11+36),r1 if (pipe->Writers ++ == 0) 800a304: 29 61 00 14 lw r1,(r11+20) 800a308: 34 22 00 01 addi r2,r1,1 800a30c: 59 62 00 14 sw (r11+20),r2 800a310: 5c 20 00 04 bne r1,r0,800a320 <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); 800a314: 29 61 00 2c lw r1,(r11+44) 800a318: 37 82 00 20 addi r2,sp,32 800a31c: f8 00 04 54 calli 800b46c break; } PIPE_UNLOCK(pipe); 800a320: 29 61 00 28 lw r1,(r11+40) 800a324: fb ff eb 9b calli 8005190 return 0; 800a328: e0 00 00 05 bi 800a33c goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; 800a32c: 34 0c ff fc mvi r12,-4 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); 800a330: b9 e0 08 00 mv r1,r15 800a334: b9 c0 10 00 mv r2,r14 800a338: fb ff fe e9 calli 8009edc return err; } 800a33c: b9 80 08 00 mv r1,r12 800a340: 2b 9d 00 04 lw ra,(sp+4) 800a344: 2b 8b 00 1c lw r11,(sp+28) 800a348: 2b 8c 00 18 lw r12,(sp+24) 800a34c: 2b 8d 00 14 lw r13,(sp+20) 800a350: 2b 8e 00 10 lw r14,(sp+16) 800a354: 2b 8f 00 0c lw r15,(sp+12) 800a358: 2b 90 00 08 lw r16,(sp+8) 800a35c: 37 9c 00 20 addi sp,sp,32 800a360: c3 a0 00 00 ret =============================================================================== 080020f8 : long fpathconf( int fd, int name ) { 80020f8: 37 9c ff f0 addi sp,sp,-16 80020fc: 5b 8b 00 10 sw (sp+16),r11 8002100: 5b 8c 00 0c sw (sp+12),r12 8002104: 5b 8d 00 08 sw (sp+8),r13 8002108: 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); 800210c: 78 03 08 01 mvhi r3,0x801 8002110: 38 63 40 10 ori r3,r3,0x4010 long fpathconf( int fd, int name ) { 8002114: 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); 8002118: 28 62 00 00 lw r2,(r3+0) 800211c: 54 41 00 02 bgu r2,r1,8002124 8002120: e0 00 00 0a bi 8002148 iop = rtems_libio_iop(fd); 8002124: 34 02 00 06 mvi r2,6 8002128: 78 0b 08 01 mvhi r11,0x801 800212c: f8 00 40 a6 calli 80123c4 <__ashlsi3> 8002130: 39 6b 46 a0 ori r11,r11,0x46a0 8002134: 29 63 00 00 lw r3,(r11+0) 8002138: b4 61 18 00 add r3,r3,r1 rtems_libio_check_is_open(iop); 800213c: 28 61 00 18 lw r1,(r3+24) 8002140: 20 22 01 00 andi r2,r1,0x100 8002144: 5c 40 00 04 bne r2,r0,8002154 <== ALWAYS TAKEN 8002148: f8 00 28 bb calli 800c434 <__errno> 800214c: 34 02 00 09 mvi r2,9 8002150: e0 00 00 28 bi 80021f0 rtems_libio_check_permissions(iop, LIBIO_FLAGS_READ); 8002154: 20 21 00 02 andi r1,r1,0x2 8002158: 44 20 00 24 be r1,r0,80021e8 * Now process the information request. */ the_limits = &iop->pathinfo.mt_entry->pathconf_limits_and_options; switch ( name ) { 800215c: 34 01 00 0b mvi r1,11 /* * Now process the information request. */ the_limits = &iop->pathinfo.mt_entry->pathconf_limits_and_options; 8002160: 28 6b 00 2c lw r11,(r3+44) switch ( name ) { 8002164: 55 a1 00 21 bgu r13,r1,80021e8 8002168: 78 0c 08 01 mvhi r12,0x801 800216c: b9 a0 08 00 mv r1,r13 8002170: 34 02 00 02 mvi r2,2 8002174: f8 00 40 94 calli 80123c4 <__ashlsi3> 8002178: 39 8c 36 48 ori r12,r12,0x3648 800217c: b5 81 08 00 add r1,r12,r1 8002180: 28 21 00 00 lw r1,(r1+0) 8002184: c0 20 00 00 b r1 case _PC_LINK_MAX: return_value = the_limits->link_max; 8002188: 29 61 00 38 lw r1,(r11+56) break; 800218c: e0 00 00 1b bi 80021f8 case _PC_MAX_CANON: return_value = the_limits->max_canon; 8002190: 29 61 00 3c lw r1,(r11+60) break; 8002194: e0 00 00 19 bi 80021f8 case _PC_MAX_INPUT: return_value = the_limits->max_input; 8002198: 29 61 00 40 lw r1,(r11+64) break; 800219c: e0 00 00 17 bi 80021f8 case _PC_NAME_MAX: return_value = the_limits->name_max; 80021a0: 29 61 00 44 lw r1,(r11+68) break; 80021a4: e0 00 00 15 bi 80021f8 case _PC_PATH_MAX: return_value = the_limits->path_max; 80021a8: 29 61 00 48 lw r1,(r11+72) break; 80021ac: e0 00 00 13 bi 80021f8 case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 80021b0: 29 61 00 4c lw r1,(r11+76) break; 80021b4: e0 00 00 11 bi 80021f8 case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 80021b8: 29 61 00 54 lw r1,(r11+84) break; 80021bc: e0 00 00 0f bi 80021f8 case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 80021c0: 29 61 00 58 lw r1,(r11+88) break; 80021c4: e0 00 00 0d bi 80021f8 case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 80021c8: 29 61 00 64 lw r1,(r11+100) break; 80021cc: e0 00 00 0b bi 80021f8 case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 80021d0: 29 61 00 50 lw r1,(r11+80) break; 80021d4: e0 00 00 09 bi 80021f8 case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 80021d8: 29 61 00 5c lw r1,(r11+92) break; 80021dc: e0 00 00 07 bi 80021f8 case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 80021e0: 29 61 00 60 lw r1,(r11+96) break; 80021e4: e0 00 00 05 bi 80021f8 default: rtems_set_errno_and_return_minus_one( EINVAL ); 80021e8: f8 00 28 93 calli 800c434 <__errno> 80021ec: 34 02 00 16 mvi r2,22 80021f0: 58 22 00 00 sw (r1+0),r2 80021f4: 34 01 ff ff mvi r1,-1 break; } return return_value; } 80021f8: 2b 9d 00 04 lw ra,(sp+4) 80021fc: 2b 8b 00 10 lw r11,(sp+16) 8002200: 2b 8c 00 0c lw r12,(sp+12) 8002204: 2b 8d 00 08 lw r13,(sp+8) 8002208: 37 9c 00 10 addi sp,sp,16 800220c: c3 a0 00 00 ret =============================================================================== 08001320 : #include void free( void *ptr ) { 8001320: 37 9c ff f4 addi sp,sp,-12 8001324: 5b 8b 00 0c sw (sp+12),r11 8001328: 5b 8c 00 08 sw (sp+8),r12 800132c: 5b 9d 00 04 sw (sp+4),ra 8001330: b8 20 58 00 mv r11,r1 MSBUMP(free_calls, 1); 8001334: 78 01 08 01 mvhi r1,0x801 8001338: 38 21 36 b8 ori r1,r1,0x36b8 800133c: 28 22 00 0c lw r2,(r1+12) 8001340: 34 42 00 01 addi r2,r2,1 8001344: 58 22 00 0c sw (r1+12),r2 if ( !ptr ) 8001348: 45 60 00 1f be r11,r0,80013c4 return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 800134c: 78 01 08 01 mvhi r1,0x801 8001350: 38 21 39 9c ori r1,r1,0x399c 8001354: 28 22 00 00 lw r2,(r1+0) 8001358: 34 01 00 03 mvi r1,3 800135c: 5c 41 00 06 bne r2,r1,8001374 <== NEVER TAKEN !malloc_is_system_state_OK() ) { 8001360: f8 00 00 80 calli 8001560 return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 8001364: 5c 20 00 04 bne r1,r0,8001374 !malloc_is_system_state_OK() ) { malloc_deferred_free(ptr); 8001368: b9 60 08 00 mv r1,r11 800136c: f8 00 00 9d calli 80015e0 return; 8001370: e0 00 00 15 bi 80013c4 } /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 8001374: 78 01 08 01 mvhi r1,0x801 8001378: 38 21 36 10 ori r1,r1,0x3610 800137c: 28 21 00 00 lw r1,(r1+0) 8001380: 44 20 00 04 be r1,r0,8001390 (*rtems_malloc_statistics_helpers->at_free)(ptr); 8001384: 28 22 00 08 lw r2,(r1+8) 8001388: b9 60 08 00 mv r1,r11 800138c: d8 40 00 00 call r2 if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { 8001390: 78 0c 08 01 mvhi r12,0x801 8001394: 39 8c 30 1c ori r12,r12,0x301c 8001398: 29 81 00 00 lw r1,(r12+0) 800139c: b9 60 10 00 mv r2,r11 80013a0: f8 00 0d b0 calli 8004a60 <_Protected_heap_Free> 80013a4: 5c 20 00 08 bne r1,r0,80013c4 printk( "Program heap: free of bad pointer %p -- range %p - %p \n", ptr, RTEMS_Malloc_Heap->area_begin, 80013a8: 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", 80013ac: 78 01 08 01 mvhi r1,0x801 80013b0: 38 21 19 ec ori r1,r1,0x19ec 80013b4: 28 83 00 18 lw r3,(r4+24) 80013b8: 28 84 00 1c lw r4,(r4+28) 80013bc: b9 60 10 00 mv r2,r11 80013c0: f8 00 03 bb calli 80022ac RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } 80013c4: 2b 9d 00 04 lw ra,(sp+4) 80013c8: 2b 8b 00 0c lw r11,(sp+12) 80013cc: 2b 8c 00 08 lw r12,(sp+8) 80013d0: 37 9c 00 0c addi sp,sp,12 80013d4: c3 a0 00 00 ret =============================================================================== 08002a50 : * NOTE: this must be called with * thread dispatching disabled! */ static void free_user_env(void *venv) { 8002a50: 37 9c ff f8 addi sp,sp,-8 8002a54: 5b 8b 00 08 sw (sp+8),r11 8002a58: 5b 9d 00 04 sw (sp+4),ra 8002a5c: b8 20 58 00 mv r11,r1 rtems_user_env_t *env = (rtems_user_env_t*) venv ; if (env != &rtems_global_user_env 8002a60: 78 01 08 01 mvhi r1,0x801 8002a64: 38 21 36 d8 ori r1,r1,0x36d8 8002a68: 45 61 00 07 be r11,r1,8002a84 <== NEVER TAKEN #ifdef HAVE_USERENV_REFCNT && --env->refcnt <= 0 #endif ) { rtems_filesystem_freenode( &env->current_directory); 8002a6c: 35 61 00 04 addi r1,r11,4 8002a70: fb ff fb 35 calli 8001744 rtems_filesystem_freenode( &env->root_directory); 8002a74: 35 61 00 18 addi r1,r11,24 8002a78: fb ff fb 33 calli 8001744 free(env); 8002a7c: b9 60 08 00 mv r1,r11 8002a80: fb ff fb 39 calli 8001764 } } 8002a84: 2b 9d 00 04 lw ra,(sp+4) 8002a88: 2b 8b 00 08 lw r11,(sp+8) 8002a8c: 37 9c 00 08 addi sp,sp,8 8002a90: c3 a0 00 00 ret =============================================================================== 08012384 : int getdents( int dd_fd, char *dd_buf, int dd_len ) { 8012384: 37 9c ff dc addi sp,sp,-36 8012388: 5b 8b 00 10 sw (sp+16),r11 801238c: 5b 8c 00 0c sw (sp+12),r12 8012390: 5b 8d 00 08 sw (sp+8),r13 8012394: 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 ); 8012398: 78 04 08 01 mvhi r4,0x801 801239c: 38 84 50 10 ori r4,r4,0x5010 int getdents( int dd_fd, char *dd_buf, int dd_len ) { 80123a0: 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 ); 80123a4: 28 82 00 00 lw r2,(r4+0) int getdents( int dd_fd, char *dd_buf, int dd_len ) { 80123a8: 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 ); 80123ac: 34 0b 00 00 mvi r11,0 80123b0: 50 22 00 07 bgeu r1,r2,80123cc <== NEVER TAKEN 80123b4: 78 0b 08 01 mvhi r11,0x801 80123b8: 39 6b 57 bc ori r11,r11,0x57bc 80123bc: 34 02 00 06 mvi r2,6 80123c0: fb ff bb 55 calli 8001114 <__ashlsi3> 80123c4: 29 6b 00 00 lw r11,(r11+0) 80123c8: b5 61 58 00 add r11,r11,r1 /* * Make sure we are working on a directory */ loc = iop->pathinfo; 80123cc: 29 64 00 20 lw r4,(r11+32) 80123d0: 29 61 00 28 lw r1,(r11+40) 80123d4: 29 65 00 1c lw r5,(r11+28) 80123d8: 29 62 00 2c lw r2,(r11+44) 80123dc: 29 63 00 24 lw r3,(r11+36) 80123e0: 5b 84 00 18 sw (sp+24),r4 if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) 80123e4: 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; 80123e8: 5b 81 00 20 sw (sp+32),r1 80123ec: 5b 82 00 24 sw (sp+36),r2 80123f0: 5b 85 00 14 sw (sp+20),r5 80123f4: 5b 83 00 1c sw (sp+28),r3 if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) 80123f8: 37 81 00 14 addi r1,sp,20 80123fc: d8 80 00 00 call r4 8012400: 34 02 00 01 mvi r2,1 8012404: 44 22 00 06 be r1,r2,801241c rtems_set_errno_and_return_minus_one( ENOTDIR ); 8012408: fb ff e6 f7 calli 800bfe4 <__errno> 801240c: 34 02 00 14 mvi r2,20 8012410: 58 22 00 00 sw (r1+0),r2 8012414: 34 01 ff ff mvi r1,-1 8012418: e0 00 00 07 bi 8012434 /* * 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 ); 801241c: 29 61 00 24 lw r1,(r11+36) 8012420: b9 a0 10 00 mv r2,r13 8012424: b9 80 18 00 mv r3,r12 8012428: 28 24 00 08 lw r4,(r1+8) 801242c: b9 60 08 00 mv r1,r11 8012430: d8 80 00 00 call r4 } 8012434: 2b 9d 00 04 lw ra,(sp+4) 8012438: 2b 8b 00 10 lw r11,(sp+16) 801243c: 2b 8c 00 0c lw r12,(sp+12) 8012440: 2b 8d 00 08 lw r13,(sp+8) 8012444: 37 9c 00 24 addi sp,sp,36 8012448: c3 a0 00 00 ret =============================================================================== 080013d8 : */ int gettimeofday( struct timeval *tp, void * __tz __attribute__((unused)) ) { 80013d8: 37 9c ff ec addi sp,sp,-20 80013dc: 5b 8b 00 0c sw (sp+12),r11 80013e0: 5b 8c 00 08 sw (sp+8),r12 80013e4: 5b 9d 00 04 sw (sp+4),ra 80013e8: b8 20 58 00 mv r11,r1 /* struct timezone* tzp = (struct timezone*) __tz; */ if ( !tp ) 80013ec: 5c 20 00 06 bne r1,r0,8001404 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); 80013f0: f8 00 27 aa calli 800b298 <__errno> <== NOT EXECUTED 80013f4: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 80013f8: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 80013fc: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8001400: e0 00 00 0f bi 800143c <== NOT EXECUTED { ISR_Level level; struct timespec now; suseconds_t useconds; _ISR_Disable(level); 8001404: 90 00 60 00 rcsr r12,IE 8001408: 34 01 ff fe mvi r1,-2 800140c: a1 81 08 00 and r1,r12,r1 8001410: d0 01 00 00 wcsr IE,r1 _TOD_Get( &now ); 8001414: 37 81 00 10 addi r1,sp,16 8001418: f8 00 09 4c calli 8003948 <_TOD_Get> _ISR_Enable(level); 800141c: d0 0c 00 00 wcsr IE,r12 useconds = (suseconds_t)now.tv_nsec; useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; time->tv_sec = now.tv_sec; 8001420: 2b 81 00 10 lw r1,(sp+16) _ISR_Disable(level); _TOD_Get( &now ); _ISR_Enable(level); useconds = (suseconds_t)now.tv_nsec; useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; 8001424: 34 02 03 e8 mvi r2,1000 time->tv_sec = now.tv_sec; 8001428: 59 61 00 00 sw (r11+0),r1 _ISR_Disable(level); _TOD_Get( &now ); _ISR_Enable(level); useconds = (suseconds_t)now.tv_nsec; useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; 800142c: 2b 81 00 14 lw r1,(sp+20) 8001430: f8 00 3d 1e calli 80108a8 <__divsi3> time->tv_sec = now.tv_sec; time->tv_usec = useconds; 8001434: 59 61 00 04 sw (r11+4),r1 * Timezone information ignored by the OS proper. Per email * with Eric Norum, this is how GNU/Linux, Solaris, and MacOS X * do it. This puts us in good company. */ return 0; 8001438: 34 01 00 00 mvi r1,0 } 800143c: 2b 9d 00 04 lw ra,(sp+4) 8001440: 2b 8b 00 0c lw r11,(sp+12) 8001444: 2b 8c 00 08 lw r12,(sp+8) 8001448: 37 9c 00 14 addi sp,sp,20 800144c: c3 a0 00 00 ret =============================================================================== 0800a824 : 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 ) 800a824: 28 22 00 1c lw r2,(r1+28) 800a828: 34 03 00 01 mvi r3,1 800a82c: 28 44 00 4c lw r4,(r2+76) return -1; /* It wasn't a directory --> return error */ 800a830: 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 ) 800a834: 5c 83 00 04 bne r4,r3,800a844 <== NEVER TAKEN return -1; /* It wasn't a directory --> return error */ iop->offset = 0; 800a838: 58 20 00 10 sw (r1+16),r0 800a83c: 58 20 00 14 sw (r1+20),r0 return 0; 800a840: 34 02 00 00 mvi r2,0 } 800a844: b8 40 08 00 mv r1,r2 800a848: c3 a0 00 00 ret =============================================================================== 0800aa80 : int imfs_dir_rmnod( rtems_filesystem_location_info_t *parent_pathloc, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN */ ) { 800aa80: 37 9c ff f8 addi sp,sp,-8 800aa84: 5b 8b 00 08 sw (sp+8),r11 800aa88: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *the_jnode; the_jnode = (IMFS_jnode_t *) pathloc->node_access; 800aa8c: 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 ) ) 800aa90: 29 63 00 50 lw r3,(r11+80) 800aa94: 35 61 00 54 addi r1,r11,84 800aa98: 44 61 00 04 be r3,r1,800aaa8 rtems_set_errno_and_return_minus_one( ENOTEMPTY ); 800aa9c: f8 00 01 ff calli 800b298 <__errno> 800aaa0: 34 02 00 5a mvi r2,90 800aaa4: e0 00 00 06 bi 800aabc /* * You cannot remove the file system root node. */ if ( pathloc->mt_entry->mt_fs_root.node_access == pathloc->node_access ) 800aaa8: 28 41 00 10 lw r1,(r2+16) 800aaac: 28 21 00 1c lw r1,(r1+28) 800aab0: 5c 2b 00 06 bne r1,r11,800aac8 rtems_set_errno_and_return_minus_one( EBUSY ); 800aab4: f8 00 01 f9 calli 800b298 <__errno> 800aab8: 34 02 00 10 mvi r2,16 800aabc: 58 22 00 00 sw (r1+0),r2 800aac0: 34 01 ff ff mvi r1,-1 800aac4: e0 00 00 08 bi 800aae4 /* * You cannot remove a mountpoint. */ if ( the_jnode->info.directory.mt_fs != NULL ) 800aac8: 29 61 00 5c lw r1,(r11+92) 800aacc: 5c 20 ff fa bne r1,r0,800aab4 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EBUSY ); IMFS_create_orphan( the_jnode ); 800aad0: b9 60 08 00 mv r1,r11 800aad4: fb ff f4 07 calli 8007af0 IMFS_check_node_remove( the_jnode ); 800aad8: b9 60 08 00 mv r1,r11 800aadc: fb ff f4 19 calli 8007b40 return 0; 800aae0: 34 01 00 00 mvi r1,0 } 800aae4: 2b 9d 00 04 lw ra,(sp+4) 800aae8: 2b 8b 00 08 lw r11,(sp+8) 800aaec: 37 9c 00 08 addi sp,sp,8 800aaf0: c3 a0 00 00 ret =============================================================================== 08002054 : /* * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { 8002054: 37 9c ff f0 addi sp,sp,-16 8002058: 5b 8b 00 10 sw (sp+16),r11 800205c: 5b 8c 00 0c sw (sp+12),r12 8002060: 5b 8d 00 08 sw (sp+8),r13 8002064: 5b 9d 00 04 sw (sp+4),ra FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) 8002068: 78 01 08 01 mvhi r1,0x801 800206c: 38 21 57 fc ori r1,r1,0x57fc 8002070: 40 2d 00 00 lbu r13,(r1+0) 8002074: 5d a0 00 2f bne r13,r0,8002130 return; etc_passwd_initted = 1; 8002078: 34 02 00 01 mvi r2,1 800207c: 30 22 00 00 sb (r1+0),r2 mkdir("/etc", 0777); 8002080: 78 01 08 01 mvhi r1,0x801 8002084: 34 02 01 ff mvi r2,511 8002088: 38 21 35 98 ori r1,r1,0x3598 800208c: f8 00 02 9d calli 8002b00 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { 8002090: 78 0b 08 01 mvhi r11,0x801 8002094: 39 6b 35 a0 ori r11,r11,0x35a0 8002098: 78 02 08 01 mvhi r2,0x801 800209c: b9 60 08 00 mv r1,r11 80020a0: 38 42 35 ac ori r2,r2,0x35ac 80020a4: f8 00 2b 27 calli 800cd40 80020a8: b8 20 60 00 mv r12,r1 80020ac: 5c 2d 00 0c bne r1,r13,80020dc fclose(fp); } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { 80020b0: 78 02 08 01 mvhi r2,0x801 80020b4: b9 60 08 00 mv r1,r11 80020b8: 38 42 35 b0 ori r2,r2,0x35b0 80020bc: f8 00 2b 21 calli 800cd40 80020c0: b8 20 58 00 mv r11,r1 80020c4: 44 2c 00 07 be r1,r12,80020e0 <== NEVER TAKEN fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" 80020c8: 78 01 08 01 mvhi r1,0x801 80020cc: 38 21 35 b4 ori r1,r1,0x35b4 80020d0: b9 60 10 00 mv r2,r11 80020d4: f8 00 2b 52 calli 800ce1c "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); 80020d8: b9 60 08 00 mv r1,r11 80020dc: f8 00 28 ea calli 800c484 } /* * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { 80020e0: 78 0b 08 01 mvhi r11,0x801 80020e4: 39 6b 36 1c ori r11,r11,0x361c 80020e8: 78 02 08 01 mvhi r2,0x801 80020ec: b9 60 08 00 mv r1,r11 80020f0: 38 42 35 ac ori r2,r2,0x35ac 80020f4: f8 00 2b 13 calli 800cd40 80020f8: b8 20 60 00 mv r12,r1 80020fc: 5c 20 00 0c bne r1,r0,800212c fclose(fp); } else if ((fp = fopen("/etc/group", "w")) != NULL) { 8002100: 78 02 08 01 mvhi r2,0x801 8002104: b9 60 08 00 mv r1,r11 8002108: 38 42 35 b0 ori r2,r2,0x35b0 800210c: f8 00 2b 0d calli 800cd40 8002110: b8 20 58 00 mv r11,r1 8002114: 44 2c 00 07 be r1,r12,8002130 <== NEVER TAKEN fprintf( fp, "root:x:0:root\n" 8002118: 78 01 08 01 mvhi r1,0x801 800211c: 38 21 36 28 ori r1,r1,0x3628 8002120: b9 60 10 00 mv r2,r11 8002124: f8 00 2b 3e calli 800ce1c "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); 8002128: b9 60 08 00 mv r1,r11 800212c: f8 00 28 d6 calli 800c484 } } 8002130: 2b 9d 00 04 lw ra,(sp+4) 8002134: 2b 8b 00 10 lw r11,(sp+16) 8002138: 2b 8c 00 0c lw r12,(sp+12) 800213c: 2b 8d 00 08 lw r13,(sp+8) 8002140: 37 9c 00 10 addi sp,sp,16 8002144: c3 a0 00 00 ret =============================================================================== 080058f0 : /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 80058f0: 37 9c ff f4 addi sp,sp,-12 80058f4: 5b 8b 00 0c sw (sp+12),r11 80058f8: 5b 8c 00 08 sw (sp+8),r12 80058fc: 5b 9d 00 04 sw (sp+4),ra 8005900: b8 40 58 00 mv r11,r2 if (tty->termios.c_iflag & ISTRIP) 8005904: 28 42 00 30 lw r2,(r2+48) /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 8005908: b8 20 60 00 mv r12,r1 if (tty->termios.c_iflag & ISTRIP) 800590c: 20 41 00 20 andi r1,r2,0x20 8005910: 44 20 00 02 be r1,r0,8005918 <== ALWAYS TAKEN c &= 0x7f; 8005914: 21 8c 00 7f andi r12,r12,0x7f <== NOT EXECUTED if (tty->termios.c_iflag & IUCLC) 8005918: 20 41 02 00 andi r1,r2,0x200 800591c: 44 20 00 0b be r1,r0,8005948 c = tolower (c); 8005920: 78 01 08 02 mvhi r1,0x802 8005924: 38 21 13 c8 ori r1,r1,0x13c8 8005928: 28 21 00 00 lw r1,(r1+0) 800592c: b4 2c 08 00 add r1,r1,r12 8005930: 40 23 00 01 lbu r3,(r1+1) 8005934: 34 01 00 01 mvi r1,1 8005938: 20 63 00 03 andi r3,r3,0x3 800593c: 5c 61 00 02 bne r3,r1,8005944 8005940: 35 8c 00 20 addi r12,r12,32 8005944: 21 8c 00 ff andi r12,r12,0xff if (c == '\r') { 8005948: 34 01 00 0d mvi r1,13 800594c: 5d 81 00 08 bne r12,r1,800596c if (tty->termios.c_iflag & IGNCR) 8005950: 20 43 00 80 andi r3,r2,0x80 return 0; 8005954: 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) 8005958: 5c 60 00 4e bne r3,r0,8005a90 <== NEVER TAKEN return 0; if (tty->termios.c_iflag & ICRNL) 800595c: 20 42 01 00 andi r2,r2,0x100 8005960: 44 43 00 0a be r2,r3,8005988 <== NEVER TAKEN c = '\n'; 8005964: 34 0c 00 0a mvi r12,10 8005968: e0 00 00 08 bi 8005988 } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { 800596c: 34 01 00 0a mvi r1,10 8005970: 5d 81 00 05 bne r12,r1,8005984 8005974: 20 42 00 40 andi r2,r2,0x40 8005978: 44 40 00 04 be r2,r0,8005988 <== ALWAYS TAKEN c = '\r'; 800597c: 34 0c 00 0d mvi r12,13 <== NOT EXECUTED 8005980: e0 00 00 02 bi 8005988 <== NOT EXECUTED } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 8005984: 45 80 00 2f be r12,r0,8005a40 <== NEVER TAKEN 8005988: 29 62 00 3c lw r2,(r11+60) 800598c: 20 41 00 02 andi r1,r2,0x2 8005990: 44 20 00 2c be r1,r0,8005a40 if (c == tty->termios.c_cc[VERASE]) { 8005994: 41 61 00 43 lbu r1,(r11+67) 8005998: 5c 2c 00 04 bne r1,r12,80059a8 erase (tty, 0); 800599c: b9 60 08 00 mv r1,r11 80059a0: 34 02 00 00 mvi r2,0 80059a4: e0 00 00 05 bi 80059b8 return 0; } else if (c == tty->termios.c_cc[VKILL]) { 80059a8: 41 61 00 44 lbu r1,(r11+68) 80059ac: 5c 2c 00 05 bne r1,r12,80059c0 erase (tty, 1); 80059b0: b9 60 08 00 mv r1,r11 80059b4: 34 02 00 01 mvi r2,1 80059b8: fb ff ff 4c calli 80056e8 80059bc: e0 00 00 34 bi 8005a8c return 0; } else if (c == tty->termios.c_cc[VEOF]) { 80059c0: 41 63 00 45 lbu r3,(r11+69) return 1; 80059c4: 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]) { 80059c8: 44 6c 00 32 be r3,r12,8005a90 <== NEVER TAKEN return 1; } else if (c == '\n') { 80059cc: 34 01 00 0a mvi r1,10 80059d0: 5d 81 00 0b bne r12,r1,80059fc if (tty->termios.c_lflag & (ECHO | ECHONL)) 80059d4: 20 42 00 48 andi r2,r2,0x48 80059d8: 44 40 00 03 be r2,r0,80059e4 <== NEVER TAKEN echo (c, tty); 80059dc: b9 60 10 00 mv r2,r11 80059e0: fb ff ff 1d calli 8005654 tty->cbuf[tty->ccount++] = c; 80059e4: 29 61 00 20 lw r1,(r11+32) 80059e8: 29 62 00 1c lw r2,(r11+28) 80059ec: 34 03 00 0a mvi r3,10 80059f0: b4 41 10 00 add r2,r2,r1 80059f4: 30 43 00 00 sb (r2+0),r3 80059f8: e0 00 00 0e bi 8005a30 return 1; } else if ((c == tty->termios.c_cc[VEOL]) || 80059fc: 41 61 00 4c lbu r1,(r11+76) 8005a00: 44 2c 00 03 be r1,r12,8005a0c <== NEVER TAKEN 8005a04: 41 61 00 51 lbu r1,(r11+81) 8005a08: 5c 2c 00 0e bne r1,r12,8005a40 <== ALWAYS TAKEN (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) 8005a0c: 20 42 00 08 andi r2,r2,0x8 <== NOT EXECUTED 8005a10: 44 40 00 04 be r2,r0,8005a20 <== NOT EXECUTED echo (c, tty); 8005a14: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8005a18: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8005a1c: fb ff ff 0e calli 8005654 <== NOT EXECUTED tty->cbuf[tty->ccount++] = c; 8005a20: 29 61 00 20 lw r1,(r11+32) <== NOT EXECUTED 8005a24: 29 62 00 1c lw r2,(r11+28) <== NOT EXECUTED 8005a28: b4 41 10 00 add r2,r2,r1 <== NOT EXECUTED 8005a2c: 30 4c 00 00 sb (r2+0),r12 <== NOT EXECUTED 8005a30: 34 21 00 01 addi r1,r1,1 8005a34: 59 61 00 20 sw (r11+32),r1 return 1; 8005a38: 34 01 00 01 mvi r1,1 8005a3c: e0 00 00 15 bi 8005a90 } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 8005a40: 78 01 08 02 mvhi r1,0x802 8005a44: 38 21 13 3c ori r1,r1,0x133c 8005a48: 28 22 00 00 lw r2,(r1+0) 8005a4c: 29 63 00 20 lw r3,(r11+32) if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; 8005a50: 34 01 00 00 mvi r1,0 } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 8005a54: 34 42 ff ff addi r2,r2,-1 8005a58: 4c 62 00 0e bge r3,r2,8005a90 <== NEVER TAKEN if (tty->termios.c_lflag & ECHO) 8005a5c: 29 61 00 3c lw r1,(r11+60) 8005a60: 20 21 00 08 andi r1,r1,0x8 8005a64: 44 20 00 04 be r1,r0,8005a74 <== NEVER TAKEN echo (c, tty); 8005a68: b9 80 08 00 mv r1,r12 8005a6c: b9 60 10 00 mv r2,r11 8005a70: fb ff fe f9 calli 8005654 tty->cbuf[tty->ccount++] = c; 8005a74: 29 61 00 20 lw r1,(r11+32) 8005a78: 29 62 00 1c lw r2,(r11+28) 8005a7c: b4 41 10 00 add r2,r2,r1 8005a80: 30 4c 00 00 sb (r2+0),r12 8005a84: 34 21 00 01 addi r1,r1,1 8005a88: 59 61 00 20 sw (r11+32),r1 } return 0; 8005a8c: 34 01 00 00 mvi r1,0 } 8005a90: 2b 9d 00 04 lw ra,(sp+4) 8005a94: 2b 8b 00 0c lw r11,(sp+12) 8005a98: 2b 8c 00 08 lw r12,(sp+8) 8005a9c: 37 9c 00 0c addi sp,sp,12 8005aa0: c3 a0 00 00 ret =============================================================================== 08023a5c : #if !defined(RTEMS_POSIX_API) int kill( pid_t pid, int sig ) { return 0; } 8023a5c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8023a60: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08010da0 : extern void _wrapup_reent(struct _reent *); extern void _reclaim_reent(struct _reent *); void libc_wrapup(void) { 8010da0: 37 9c ff f4 addi sp,sp,-12 8010da4: 5b 8b 00 0c sw (sp+12),r11 8010da8: 5b 8c 00 08 sw (sp+8),r12 8010dac: 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())) 8010db0: 78 01 08 01 mvhi r1,0x801 8010db4: 38 21 39 9c ori r1,r1,0x399c 8010db8: 28 22 00 00 lw r2,(r1+0) 8010dbc: 34 01 00 03 mvi r1,3 8010dc0: 5c 41 00 16 bne r2,r1,8010e18 <== NEVER TAKEN /* * This was already done if the user called exit() directly . _wrapup_reent(0); */ if (_REENT != _global_impure_ptr) { 8010dc4: 78 01 08 01 mvhi r1,0x801 8010dc8: 78 0b 08 01 mvhi r11,0x801 8010dcc: 38 21 1e ec ori r1,r1,0x1eec 8010dd0: 39 6b 31 70 ori r11,r11,0x3170 8010dd4: 28 2c 00 00 lw r12,(r1+0) 8010dd8: 29 61 00 00 lw r1,(r11+0) 8010ddc: 44 2c 00 04 be r1,r12,8010dec _wrapup_reent(_global_impure_ptr); 8010de0: b9 80 08 00 mv r1,r12 8010de4: f8 00 02 25 calli 8011678 <_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; 8010de8: 59 6c 00 00 sw (r11+0),r12 * * Should this be changed to do *all* file streams? * _fwalk (_REENT, fclose); */ fclose (stdin); 8010dec: 78 0b 08 01 mvhi r11,0x801 8010df0: 39 6b 31 70 ori r11,r11,0x3170 8010df4: 29 61 00 00 lw r1,(r11+0) 8010df8: 28 21 00 04 lw r1,(r1+4) 8010dfc: fb ff e9 87 calli 800b418 fclose (stdout); 8010e00: 29 61 00 00 lw r1,(r11+0) 8010e04: 28 21 00 08 lw r1,(r1+8) 8010e08: fb ff e9 84 calli 800b418 fclose (stderr); 8010e0c: 29 61 00 00 lw r1,(r11+0) 8010e10: 28 21 00 0c lw r1,(r1+12) 8010e14: fb ff e9 81 calli 800b418 } 8010e18: 2b 9d 00 04 lw ra,(sp+4) 8010e1c: 2b 8b 00 0c lw r11,(sp+12) 8010e20: 2b 8c 00 08 lw r12,(sp+8) 8010e24: 37 9c 00 0c addi sp,sp,12 8010e28: c3 a0 00 00 ret =============================================================================== 08001708 : #include "malloc_p.h" void *malloc( size_t size ) { 8001708: 37 9c ff f4 addi sp,sp,-12 800170c: 5b 8b 00 0c sw (sp+12),r11 8001710: 5b 8c 00 08 sw (sp+8),r12 8001714: 5b 9d 00 04 sw (sp+4),ra void *return_this; MSBUMP(malloc_calls, 1); 8001718: 78 03 08 01 mvhi r3,0x801 800171c: 38 63 36 b8 ori r3,r3,0x36b8 #include "malloc_p.h" void *malloc( size_t size ) { 8001720: b8 20 60 00 mv r12,r1 void *return_this; MSBUMP(malloc_calls, 1); 8001724: 28 61 00 04 lw r1,(r3+4) /* * Validate the parameters */ if ( !size ) return (void *) 0; 8001728: 34 0b 00 00 mvi r11,0 size_t size ) { void *return_this; MSBUMP(malloc_calls, 1); 800172c: 34 21 00 01 addi r1,r1,1 8001730: 58 61 00 04 sw (r3+4),r1 /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); 8001734: fb ff ff 9d calli 80015a8 /* * Validate the parameters */ if ( !size ) 8001738: 45 80 00 2d be r12,r0,80017ec return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 800173c: 78 01 08 01 mvhi r1,0x801 8001740: 38 21 39 9c ori r1,r1,0x399c 8001744: 28 22 00 00 lw r2,(r1+0) 8001748: 34 01 00 03 mvi r1,3 800174c: 5c 41 00 03 bne r2,r1,8001758 !malloc_is_system_state_OK() ) 8001750: fb ff ff 84 calli 8001560 return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 8001754: 44 20 00 26 be r1,r0,80017ec <== 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 ); 8001758: 78 01 08 01 mvhi r1,0x801 800175c: 38 21 30 1c ori r1,r1,0x301c 8001760: 28 21 00 00 lw r1,(r1+0) 8001764: b9 80 10 00 mv r2,r12 8001768: 34 03 00 00 mvi r3,0 800176c: 34 04 00 00 mvi r4,0 8001770: f8 00 0c a2 calli 80049f8 <_Protected_heap_Allocate_aligned_with_boundary> 8001774: 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 ) { 8001778: 5c 20 00 0f bne r1,r0,80017b4 if (rtems_malloc_sbrk_helpers) 800177c: 78 01 08 01 mvhi r1,0x801 8001780: 38 21 36 14 ori r1,r1,0x3614 8001784: 28 21 00 00 lw r1,(r1+0) 8001788: 44 2b 00 06 be r1,r11,80017a0 return_this = (*rtems_malloc_sbrk_helpers->extend)( size ); 800178c: 28 22 00 04 lw r2,(r1+4) 8001790: b9 80 08 00 mv r1,r12 8001794: d8 40 00 00 call r2 8001798: b8 20 58 00 mv r11,r1 if ( !return_this ) { 800179c: 5c 20 00 06 bne r1,r0,80017b4 errno = ENOMEM; 80017a0: f8 00 26 be calli 800b298 <__errno> 80017a4: 34 02 00 0c mvi r2,12 80017a8: 58 22 00 00 sw (r1+0),r2 return (void *) 0; 80017ac: 34 0b 00 00 mvi r11,0 80017b0: e0 00 00 0f bi 80017ec } /* * If the user wants us to dirty the allocated memory, then do it. */ if ( rtems_malloc_dirty_helper ) 80017b4: 78 01 08 01 mvhi r1,0x801 80017b8: 38 21 36 18 ori r1,r1,0x3618 80017bc: 28 23 00 00 lw r3,(r1+0) 80017c0: 44 60 00 04 be r3,r0,80017d0 (*rtems_malloc_dirty_helper)( return_this, size ); 80017c4: b9 60 08 00 mv r1,r11 80017c8: b9 80 10 00 mv r2,r12 80017cc: d8 60 00 00 call r3 /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 80017d0: 78 01 08 01 mvhi r1,0x801 80017d4: 38 21 36 10 ori r1,r1,0x3610 80017d8: 28 21 00 00 lw r1,(r1+0) 80017dc: 44 20 00 04 be r1,r0,80017ec (*rtems_malloc_statistics_helpers->at_malloc)(return_this); 80017e0: 28 22 00 04 lw r2,(r1+4) 80017e4: b9 60 08 00 mv r1,r11 80017e8: d8 40 00 00 call r2 return return_this; } 80017ec: b9 60 08 00 mv r1,r11 80017f0: 2b 9d 00 04 lw ra,(sp+4) 80017f4: 2b 8b 00 0c lw r11,(sp+12) 80017f8: 2b 8c 00 08 lw r12,(sp+8) 80017fc: 37 9c 00 0c addi sp,sp,12 8001800: c3 a0 00 00 ret =============================================================================== 08001afc : } void *malloc_sbrk_extend_and_allocate( size_t size ) { 8001afc: 37 9c ff ec addi sp,sp,-20 8001b00: 5b 8b 00 14 sw (sp+20),r11 8001b04: 5b 8c 00 10 sw (sp+16),r12 8001b08: 5b 8d 00 0c sw (sp+12),r13 8001b0c: 5b 8e 00 08 sw (sp+8),r14 8001b10: 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; 8001b14: 78 03 08 01 mvhi r3,0x801 8001b18: 38 63 38 30 ori r3,r3,0x3830 8001b1c: 28 6b 00 00 lw r11,(r3+0) } void *malloc_sbrk_extend_and_allocate( size_t size ) { 8001b20: b8 20 70 00 mv r14,r1 */ sbrk_amount = RTEMS_Malloc_Sbrk_amount; if ( sbrk_amount == 0 ) return (void *) 0; 8001b24: 34 0d 00 00 mvi r13,0 * in "page" amounts. */ sbrk_amount = RTEMS_Malloc_Sbrk_amount; if ( sbrk_amount == 0 ) 8001b28: 45 60 00 22 be r11,r0,8001bb0 <== NEVER TAKEN return (void *) 0; the_size = ((size + sbrk_amount) / sbrk_amount * sbrk_amount); 8001b2c: b9 60 10 00 mv r2,r11 8001b30: b4 2b 08 00 add r1,r1,r11 8001b34: f8 00 3c a3 calli 8010dc0 <__udivsi3> 8001b38: b9 60 10 00 mv r2,r11 8001b3c: f8 00 3c 3c calli 8010c2c <__mulsi3> 8001b40: b8 20 60 00 mv r12,r1 starting_address = (void *) sbrk(the_size); 8001b44: fb ff fa 34 calli 8000414 8001b48: b8 20 10 00 mv r2,r1 if ( starting_address == (void*) -1 ) 8001b4c: 34 01 ff ff mvi r1,-1 8001b50: 44 41 00 18 be r2,r1,8001bb0 return (void *) 0; if ( !_Protected_heap_Extend( 8001b54: 78 0b 08 01 mvhi r11,0x801 8001b58: 39 6b 30 1c ori r11,r11,0x301c 8001b5c: 29 61 00 00 lw r1,(r11+0) 8001b60: b9 80 18 00 mv r3,r12 8001b64: f8 00 0c 66 calli 8004cfc <_Protected_heap_Extend> 8001b68: 5c 20 00 07 bne r1,r0,8001b84 RTEMS_Malloc_Heap, starting_address, the_size) ) { sbrk(-the_size); 8001b6c: c8 0c 08 00 sub r1,r0,r12 8001b70: fb ff fa 29 calli 8000414 errno = ENOMEM; 8001b74: f8 00 26 f6 calli 800b74c <__errno> 8001b78: 34 02 00 0c mvi r2,12 8001b7c: 58 22 00 00 sw (r1+0),r2 return (void *) 0; 8001b80: e0 00 00 0c bi 8001bb0 } MSBUMP(space_available, the_size); 8001b84: 78 04 08 01 mvhi r4,0x801 8001b88: 38 84 38 00 ori r4,r4,0x3800 8001b8c: 28 81 00 00 lw r1,(r4+0) 8001b90: b9 c0 10 00 mv r2,r14 8001b94: 34 03 00 00 mvi r3,0 8001b98: b5 81 60 00 add r12,r12,r1 8001b9c: 29 61 00 00 lw r1,(r11+0) 8001ba0: 58 8c 00 00 sw (r4+0),r12 8001ba4: 34 04 00 00 mvi r4,0 8001ba8: f8 00 0c 3b calli 8004c94 <_Protected_heap_Allocate_aligned_with_boundary> 8001bac: b8 20 68 00 mv r13,r1 return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); return return_this; } 8001bb0: b9 a0 08 00 mv r1,r13 8001bb4: 2b 9d 00 04 lw ra,(sp+4) 8001bb8: 2b 8b 00 14 lw r11,(sp+20) 8001bbc: 2b 8c 00 10 lw r12,(sp+16) 8001bc0: 2b 8d 00 0c lw r13,(sp+12) 8001bc4: 2b 8e 00 08 lw r14,(sp+8) 8001bc8: 37 9c 00 14 addi sp,sp,20 8001bcc: c3 a0 00 00 ret =============================================================================== 0800a47c : */ int memfile_ftruncate( rtems_libio_t *iop, rtems_off64_t length ) { 800a47c: 37 9c ff f0 addi sp,sp,-16 800a480: 5b 8b 00 08 sw (sp+8),r11 800a484: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 800a488: 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 ) 800a48c: 29 64 00 50 lw r4,(r11+80) 800a490: 48 44 00 05 bg r2,r4,800a4a4 <== NEVER TAKEN 800a494: 5c 82 00 08 bne r4,r2,800a4b4 <== NEVER TAKEN 800a498: 29 64 00 54 lw r4,(r11+84) 800a49c: 54 64 00 02 bgu r3,r4,800a4a4 800a4a0: e0 00 00 05 bi 800a4b4 return IMFS_memfile_extend( the_jnode, length ); 800a4a4: b9 60 08 00 mv r1,r11 800a4a8: b8 60 10 00 mv r2,r3 800a4ac: fb ff fe ed calli 800a060 800a4b0: e0 00 00 0b bi 800a4dc /* * 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; 800a4b4: 59 62 00 50 sw (r11+80),r2 800a4b8: 59 63 00 54 sw (r11+84),r3 iop->size = the_jnode->info.file.size; 800a4bc: 58 22 00 08 sw (r1+8),r2 800a4c0: 58 23 00 0c sw (r1+12),r3 IMFS_update_atime( the_jnode ); 800a4c4: 34 02 00 00 mvi r2,0 800a4c8: 37 81 00 0c addi r1,sp,12 800a4cc: fb ff db c3 calli 80013d8 800a4d0: 2b 81 00 0c lw r1,(sp+12) 800a4d4: 59 61 00 40 sw (r11+64),r1 return 0; 800a4d8: 34 01 00 00 mvi r1,0 } 800a4dc: 2b 9d 00 04 lw ra,(sp+4) 800a4e0: 2b 8b 00 08 lw r11,(sp+8) 800a4e4: 37 9c 00 10 addi sp,sp,16 800a4e8: c3 a0 00 00 ret =============================================================================== 0800a4ec : rtems_off64_t memfile_lseek( rtems_libio_t *iop, rtems_off64_t offset, int whence ) { 800a4ec: 37 9c ff f4 addi sp,sp,-12 800a4f0: 5b 8b 00 0c sw (sp+12),r11 800a4f4: 5b 8c 00 08 sw (sp+8),r12 800a4f8: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 800a4fc: 28 2c 00 1c lw r12,(r1+28) rtems_off64_t memfile_lseek( rtems_libio_t *iop, rtems_off64_t offset, int whence ) { 800a500: 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) { 800a504: 34 01 00 06 mvi r1,6 800a508: 29 82 00 4c lw r2,(r12+76) 800a50c: 5c 41 00 0c bne r2,r1,800a53c if (iop->offset > the_jnode->info.linearfile.size) 800a510: 29 81 00 50 lw r1,(r12+80) 800a514: 29 63 00 10 lw r3,(r11+16) 800a518: 29 82 00 54 lw r2,(r12+84) 800a51c: 48 61 00 05 bg r3,r1,800a530 <== NEVER TAKEN 800a520: 5c 61 00 15 bne r3,r1,800a574 <== NEVER TAKEN 800a524: 29 63 00 14 lw r3,(r11+20) 800a528: 54 62 00 02 bgu r3,r2,800a530 <== NEVER TAKEN 800a52c: e0 00 00 12 bi 800a574 iop->offset = the_jnode->info.linearfile.size; 800a530: 59 61 00 10 sw (r11+16),r1 <== NOT EXECUTED 800a534: 59 62 00 14 sw (r11+20),r2 <== NOT EXECUTED 800a538: e0 00 00 0f bi 800a574 <== NOT EXECUTED } else { /* Must be a block file (IMFS_MEMORY_FILE). */ if (IMFS_memfile_extend( the_jnode, iop->offset )) 800a53c: 29 62 00 14 lw r2,(r11+20) 800a540: b9 80 08 00 mv r1,r12 800a544: fb ff fe c7 calli 800a060 800a548: 44 20 00 07 be r1,r0,800a564 rtems_set_errno_and_return_minus_one( ENOSPC ); 800a54c: f8 00 03 53 calli 800b298 <__errno> 800a550: 34 02 00 1c mvi r2,28 800a554: 58 22 00 00 sw (r1+0),r2 800a558: 34 01 ff ff mvi r1,-1 800a55c: 34 02 ff ff mvi r2,-1 800a560: e0 00 00 07 bi 800a57c iop->size = the_jnode->info.file.size; 800a564: 29 81 00 50 lw r1,(r12+80) 800a568: 59 61 00 08 sw (r11+8),r1 800a56c: 29 81 00 54 lw r1,(r12+84) 800a570: 59 61 00 0c sw (r11+12),r1 } return iop->offset; 800a574: 29 61 00 10 lw r1,(r11+16) 800a578: 29 62 00 14 lw r2,(r11+20) } 800a57c: 2b 9d 00 04 lw ra,(sp+4) 800a580: 2b 8b 00 0c lw r11,(sp+12) 800a584: 2b 8c 00 08 lw r12,(sp+8) 800a588: 37 9c 00 0c addi sp,sp,12 800a58c: c3 a0 00 00 ret =============================================================================== 0800a3c8 : rtems_libio_t *iop, const char *pathname, uint32_t flag, uint32_t mode ) { 800a3c8: 37 9c ff f4 addi sp,sp,-12 800a3cc: 5b 8b 00 0c sw (sp+12),r11 800a3d0: 5b 8c 00 08 sw (sp+8),r12 800a3d4: 5b 9d 00 04 sw (sp+4),ra 800a3d8: b8 20 60 00 mv r12,r1 IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 800a3dc: 28 2b 00 1c lw r11,(r1+28) /* * Perform 'copy on write' for linear files */ if ((iop->flags & (LIBIO_FLAGS_WRITE | LIBIO_FLAGS_APPEND)) 800a3e0: 28 21 00 18 lw r1,(r1+24) 800a3e4: 20 21 02 04 andi r1,r1,0x204 800a3e8: 44 20 00 13 be r1,r0,800a434 && (the_jnode->type == IMFS_LINEAR_FILE)) { 800a3ec: 29 62 00 4c lw r2,(r11+76) 800a3f0: 34 01 00 06 mvi r1,6 800a3f4: 5c 41 00 10 bne r2,r1,800a434 <== ALWAYS TAKEN uint32_t count = the_jnode->info.linearfile.size; 800a3f8: 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; 800a3fc: 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; 800a400: 29 63 00 58 lw r3,(r11+88) <== NOT EXECUTED the_jnode->type = IMFS_MEMORY_FILE; 800a404: 59 61 00 4c sw (r11+76),r1 <== NOT EXECUTED the_jnode->info.file.size = 0; 800a408: 59 60 00 50 sw (r11+80),r0 <== NOT EXECUTED 800a40c: 59 60 00 54 sw (r11+84),r0 <== NOT EXECUTED the_jnode->info.file.indirect = 0; 800a410: 59 60 00 58 sw (r11+88),r0 <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; 800a414: 59 60 00 5c sw (r11+92),r0 <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; 800a418: 59 60 00 60 sw (r11+96),r0 <== NOT EXECUTED if ((count != 0) 800a41c: 44 80 00 06 be r4,r0,800a434 <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) 800a420: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 800a424: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 800a428: fb ff ff 64 calli 800a1b8 <== NOT EXECUTED return -1; 800a42c: 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)) 800a430: 44 22 00 0d be r1,r2,800a464 <== NOT EXECUTED return -1; } if (iop->flags & LIBIO_FLAGS_APPEND) 800a434: 29 81 00 18 lw r1,(r12+24) 800a438: 20 21 02 00 andi r1,r1,0x200 800a43c: 44 20 00 05 be r1,r0,800a450 iop->offset = the_jnode->info.file.size; 800a440: 29 61 00 50 lw r1,(r11+80) 800a444: 59 81 00 10 sw (r12+16),r1 800a448: 29 61 00 54 lw r1,(r11+84) 800a44c: 59 81 00 14 sw (r12+20),r1 iop->size = the_jnode->info.file.size; 800a450: 29 61 00 50 lw r1,(r11+80) return 0; 800a454: 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; 800a458: 59 81 00 08 sw (r12+8),r1 800a45c: 29 61 00 54 lw r1,(r11+84) 800a460: 59 81 00 0c sw (r12+12),r1 return 0; } 800a464: b8 40 08 00 mv r1,r2 800a468: 2b 9d 00 04 lw ra,(sp+4) 800a46c: 2b 8b 00 0c lw r11,(sp+12) 800a470: 2b 8c 00 08 lw r12,(sp+8) 800a474: 37 9c 00 0c addi sp,sp,12 800a478: c3 a0 00 00 ret =============================================================================== 080019d0 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 80019d0: 37 9c ff b0 addi sp,sp,-80 80019d4: 5b 8b 00 3c sw (sp+60),r11 80019d8: 5b 8c 00 38 sw (sp+56),r12 80019dc: 5b 8d 00 34 sw (sp+52),r13 80019e0: 5b 8e 00 30 sw (sp+48),r14 80019e4: 5b 8f 00 2c sw (sp+44),r15 80019e8: 5b 90 00 28 sw (sp+40),r16 80019ec: 5b 91 00 24 sw (sp+36),r17 80019f0: 5b 92 00 20 sw (sp+32),r18 80019f4: 5b 93 00 1c sw (sp+28),r19 80019f8: 5b 94 00 18 sw (sp+24),r20 80019fc: 5b 95 00 14 sw (sp+20),r21 8001a00: 5b 96 00 10 sw (sp+16),r22 8001a04: 5b 97 00 0c sw (sp+12),r23 8001a08: 5b 98 00 08 sw (sp+8),r24 8001a0c: 5b 9d 00 04 sw (sp+4),ra 8001a10: b8 20 88 00 mv r17,r1 /* * Are the file system options valid? */ if ( options != RTEMS_FILESYSTEM_READ_ONLY && 8001a14: 34 01 00 01 mvi r1,1 const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 8001a18: b8 40 78 00 mv r15,r2 8001a1c: b8 60 98 00 mv r19,r3 8001a20: b8 80 b0 00 mv r22,r4 8001a24: b8 a0 c0 00 mv r24,r5 /* * Are the file system options valid? */ if ( options != RTEMS_FILESYSTEM_READ_ONLY && 8001a28: 50 24 00 02 bgeu r1,r4,8001a30 8001a2c: e0 00 00 05 bi 8001a40 rtems_set_errno_and_return_minus_one( EINVAL ); /* * Get mount handler */ mount_h = rtems_filesystem_get_mount_handler( filesystemtype ); 8001a30: b8 60 08 00 mv r1,r3 8001a34: f8 00 1a 33 calli 8008300 8001a38: b8 20 a0 00 mv r20,r1 if ( !mount_h ) 8001a3c: 5c 20 00 04 bne r1,r0,8001a4c rtems_set_errno_and_return_minus_one( EINVAL ); 8001a40: f8 00 26 16 calli 800b298 <__errno> 8001a44: 34 02 00 16 mvi r2,22 8001a48: e0 00 00 37 bi 8001b24 { 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; 8001a4c: 7d ee 00 00 cmpnei r14,r15,0 const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; 8001a50: b9 e0 60 00 mv r12,r15 8001a54: 5d c0 00 03 bne r14,r0,8001a60 8001a58: 78 0c 08 01 mvhi r12,0x801 8001a5c: 39 8c 19 d4 ori r12,r12,0x19d4 size_t filesystemtype_size = strlen( filesystemtype ) + 1; 8001a60: ba 60 08 00 mv r1,r19 8001a64: f8 00 2a ae calli 800c51c 8001a68: 34 30 00 01 addi r16,r1,1 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 8001a6c: 34 0d 00 00 mvi r13,0 8001a70: 46 20 00 04 be r17,r0,8001a80 8001a74: ba 20 08 00 mv r1,r17 8001a78: f8 00 2a a9 calli 800c51c 8001a7c: 34 2d 00 01 addi r13,r1,1 size_t target_size = strlen( target ) + 1; 8001a80: b9 80 08 00 mv r1,r12 8001a84: f8 00 2a a6 calli 800c51c size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size; 8001a88: 36 03 00 74 addi r3,r16,116 { const char *target = target_or_null != NULL ? target_or_null : "/"; size_t filesystemtype_size = strlen( filesystemtype ) + 1; size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; size_t target_size = strlen( target ) + 1; 8001a8c: 34 37 00 01 addi r23,r1,1 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size; 8001a90: b4 6d 18 00 add r3,r3,r13 { const char *target = target_or_null != NULL ? target_or_null : "/"; size_t filesystemtype_size = strlen( filesystemtype ) + 1; size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; size_t target_size = strlen( target ) + 1; 8001a94: b8 20 a8 00 mv r21,r1 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size; rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); 8001a98: b4 77 10 00 add r2,r3,r23 8001a9c: 34 01 00 01 mvi r1,1 8001aa0: fb ff fd 8f calli 80010dc 8001aa4: b8 20 58 00 mv r11,r1 if ( mt_entry != NULL ) { 8001aa8: 44 20 00 1d be r1,r0,8001b1c <== NEVER TAKEN char *str = (char *) mt_entry + sizeof( *mt_entry ); 8001aac: 34 32 00 74 addi r18,r1,116 memcpy( str, filesystemtype, filesystemtype_size ); 8001ab0: ba 00 18 00 mv r3,r16 8001ab4: ba 60 10 00 mv r2,r19 8001ab8: ba 40 08 00 mv r1,r18 8001abc: f8 00 28 ad calli 800bd70 mt_entry->type = str; str += filesystemtype_size; 8001ac0: b6 50 80 00 add r16,r18,r16 memcpy( str, source_or_null, source_size ); 8001ac4: b9 a0 18 00 mv r3,r13 8001ac8: ba 20 10 00 mv r2,r17 8001acc: ba 00 08 00 mv r1,r16 mt_entry->dev = str; str += source_size; 8001ad0: b6 0d 68 00 add r13,r16,r13 if ( mt_entry != NULL ) { char *str = (char *) mt_entry + sizeof( *mt_entry ); memcpy( str, filesystemtype, filesystemtype_size ); mt_entry->type = str; 8001ad4: 59 72 00 6c sw (r11+108),r18 str += filesystemtype_size; memcpy( str, source_or_null, source_size ); 8001ad8: f8 00 28 a6 calli 800bd70 mt_entry->dev = str; str += source_size; memcpy( str, target, target_size ); 8001adc: b9 80 10 00 mv r2,r12 8001ae0: ba e0 18 00 mv r3,r23 8001ae4: b9 a0 08 00 mv r1,r13 memcpy( str, filesystemtype, filesystemtype_size ); mt_entry->type = str; str += filesystemtype_size; memcpy( str, source_or_null, source_size ); mt_entry->dev = str; 8001ae8: 59 70 00 70 sw (r11+112),r16 str += source_size; memcpy( str, target, target_size ); 8001aec: f8 00 28 a1 calli 800bd70 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; 8001af0: 78 03 08 01 mvhi r3,0x801 8001af4: b8 60 10 00 mv r2,r3 8001af8: 35 61 00 38 addi r1,r11,56 8001afc: 38 42 1a 28 ori r2,r2,0x1a28 8001b00: 34 03 00 30 mvi r3,48 memcpy( str, source_or_null, source_size ); mt_entry->dev = str; str += source_size; memcpy( str, target, target_size ); mt_entry->target = str; 8001b04: 59 6d 00 68 sw (r11+104),r13 &target_length ); if ( !mt_entry ) rtems_set_errno_and_return_minus_one( ENOMEM ); mt_entry->mt_fs_root.mt_entry = mt_entry; 8001b08: 59 6b 00 2c sw (r11+44),r11 mt_entry->options = options; 8001b0c: 59 76 00 30 sw (r11+48),r22 mt_entry->pathconf_limits_and_options = rtems_filesystem_default_pathconf; 8001b10: f8 00 28 98 calli 800bd70 /* * The mount_point should be a directory with read/write/execute * permissions in the existing tree. */ if ( has_target ) { 8001b14: 45 c0 00 2f be r14,r0,8001bd0 8001b18: e0 00 00 06 bi 8001b30 target, filesystemtype, &target_length ); if ( !mt_entry ) rtems_set_errno_and_return_minus_one( ENOMEM ); 8001b1c: f8 00 25 df calli 800b298 <__errno> <== NOT EXECUTED 8001b20: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8001b24: 58 22 00 00 sw (r1+0),r2 8001b28: 34 0d ff ff mvi r13,-1 8001b2c: e0 00 00 5a bi 8001c94 * The mount_point should be a directory with read/write/execute * permissions in the existing tree. */ if ( has_target ) { if ( rtems_filesystem_evaluate_path( 8001b30: 37 8c 00 40 addi r12,sp,64 8001b34: ba a0 10 00 mv r2,r21 8001b38: b9 e0 08 00 mv r1,r15 8001b3c: 34 03 00 07 mvi r3,7 8001b40: b9 80 20 00 mv r4,r12 8001b44: 34 05 00 01 mvi r5,1 8001b48: fb ff fd a6 calli 80011e0 8001b4c: 34 02 ff ff mvi r2,-1 8001b50: 44 22 00 4a be r1,r2,8001c78 <== NEVER TAKEN /* * Test to see if it is a directory */ if ( loc.ops->node_type_h( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 8001b54: 2b 81 00 4c lw r1,(sp+76) 8001b58: 28 23 00 10 lw r3,(r1+16) 8001b5c: b9 80 08 00 mv r1,r12 8001b60: d8 60 00 00 call r3 8001b64: 34 02 00 01 mvi r2,1 8001b68: 44 22 00 04 be r1,r2,8001b78 errno = ENOTDIR; 8001b6c: f8 00 25 cb calli 800b298 <__errno> 8001b70: 34 02 00 14 mvi r2,20 8001b74: e0 00 00 20 bi 8001bf4 /* * You can only mount one file system onto a single mount point. */ if ( rtems_filesystem_mount_iterate( is_node_fs_root, loc.node_access ) ) { 8001b78: 2b 82 00 40 lw r2,(sp+64) 8001b7c: 78 01 08 00 mvhi r1,0x800 8001b80: 38 21 18 ec ori r1,r1,0x18ec 8001b84: fb ff ff 71 calli 8001948 8001b88: b8 20 68 00 mv r13,r1 8001b8c: 44 20 00 04 be r1,r0,8001b9c errno = EBUSY; 8001b90: f8 00 25 c2 calli 800b298 <__errno> 8001b94: 34 02 00 10 mvi r2,16 8001b98: e0 00 00 17 bi 8001bf4 * 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; 8001b9c: 2b 81 00 40 lw r1,(sp+64) 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; 8001ba0: 2b 82 00 50 lw r2,(sp+80) * 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; 8001ba4: 59 61 00 08 sw (r11+8),r1 mt_entry->mt_point_node.handlers = loc.handlers; 8001ba8: 2b 81 00 48 lw r1,(sp+72) mt_entry->mt_point_node.ops = loc.ops; mt_entry->mt_point_node.mt_entry = loc.mt_entry; 8001bac: 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; 8001bb0: 59 61 00 10 sw (r11+16),r1 mt_entry->mt_point_node.ops = loc.ops; 8001bb4: 2b 81 00 4c lw r1,(sp+76) /* * 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 ) ) { 8001bb8: 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; 8001bbc: 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 ) ) { 8001bc0: b9 60 08 00 mv r1,r11 8001bc4: d8 60 00 00 call r3 8001bc8: 44 2d 00 0d be r1,r13,8001bfc <== ALWAYS TAKEN 8001bcc: e0 00 00 2c bi 8001c7c <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8001bd0: 78 04 08 01 mvhi r4,0x801 8001bd4: 38 84 31 10 ori r4,r4,0x3110 } } else { /* * Do we already have a base file system ? */ if ( !rtems_chain_is_empty( &mount_chain ) ) { 8001bd8: 28 81 00 00 lw r1,(r4+0) 8001bdc: 78 03 08 01 mvhi r3,0x801 8001be0: 38 63 31 14 ori r3,r3,0x3114 ) { 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; 8001be4: 34 0c 00 00 mvi r12,0 } } else { /* * Do we already have a base file system ? */ if ( !rtems_chain_is_empty( &mount_chain ) ) { 8001be8: 44 23 00 05 be r1,r3,8001bfc <== ALWAYS TAKEN errno = EINVAL; 8001bec: f8 00 25 ab calli 800b298 <__errno> <== NOT EXECUTED 8001bf0: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8001bf4: 58 22 00 00 sw (r1+0),r2 goto cleanup_and_bail; 8001bf8: e0 00 00 21 bi 8001c7c * 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 ) ) { 8001bfc: b9 60 08 00 mv r1,r11 8001c00: bb 00 10 00 mv r2,r24 8001c04: da 80 00 00 call r20 8001c08: 44 20 00 06 be r1,r0,8001c20 /* * Try to undo the mount operation */ loc.ops->unmount_h( mt_entry ); 8001c0c: 2b 81 00 4c lw r1,(sp+76) 8001c10: 28 22 00 28 lw r2,(r1+40) 8001c14: b9 60 08 00 mv r1,r11 8001c18: d8 40 00 00 call r2 goto cleanup_and_bail; 8001c1c: e0 00 00 18 bi 8001c7c } /* * Add the mount table entry to the mount table chain */ rtems_libio_lock(); 8001c20: fb ff ff 36 calli 80018f8 8001c24: 78 01 08 01 mvhi r1,0x801 8001c28: 38 21 31 10 ori r1,r1,0x3110 8001c2c: b9 60 10 00 mv r2,r11 rtems_libio_unlock(); if ( !has_target ) rtems_filesystem_root = mt_entry->mt_fs_root; return 0; 8001c30: 34 0d 00 00 mvi r13,0 8001c34: f8 00 06 25 calli 80034c8 <_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(); 8001c38: fb ff ff 3b calli 8001924 if ( !has_target ) 8001c3c: 5d cd 00 16 bne r14,r13,8001c94 rtems_filesystem_root = mt_entry->mt_fs_root; 8001c40: 78 01 08 01 mvhi r1,0x801 8001c44: 38 21 31 1c ori r1,r1,0x311c 8001c48: 28 21 00 00 lw r1,(r1+0) 8001c4c: 29 66 00 1c lw r6,(r11+28) 8001c50: 29 65 00 20 lw r5,(r11+32) 8001c54: 29 64 00 24 lw r4,(r11+36) 8001c58: 29 63 00 28 lw r3,(r11+40) 8001c5c: 29 62 00 2c lw r2,(r11+44) 8001c60: 58 26 00 18 sw (r1+24),r6 8001c64: 58 25 00 1c sw (r1+28),r5 8001c68: 58 24 00 20 sw (r1+32),r4 8001c6c: 58 23 00 24 sw (r1+36),r3 8001c70: 58 22 00 28 sw (r1+40),r2 8001c74: e0 00 00 08 bi 8001c94 ) { 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; 8001c78: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED return 0; cleanup_and_bail: free( mt_entry ); 8001c7c: b9 60 08 00 mv r1,r11 8001c80: fb ff fd a8 calli 8001320 if ( loc_to_free ) rtems_filesystem_freenode( loc_to_free ); return -1; 8001c84: 34 0d ff ff mvi r13,-1 cleanup_and_bail: free( mt_entry ); if ( loc_to_free ) 8001c88: 45 80 00 03 be r12,r0,8001c94 <== NEVER TAKEN rtems_filesystem_freenode( loc_to_free ); 8001c8c: b9 80 08 00 mv r1,r12 8001c90: fb ff fd 9c calli 8001300 return -1; } 8001c94: b9 a0 08 00 mv r1,r13 8001c98: 2b 9d 00 04 lw ra,(sp+4) 8001c9c: 2b 8b 00 3c lw r11,(sp+60) 8001ca0: 2b 8c 00 38 lw r12,(sp+56) 8001ca4: 2b 8d 00 34 lw r13,(sp+52) 8001ca8: 2b 8e 00 30 lw r14,(sp+48) 8001cac: 2b 8f 00 2c lw r15,(sp+44) 8001cb0: 2b 90 00 28 lw r16,(sp+40) 8001cb4: 2b 91 00 24 lw r17,(sp+36) 8001cb8: 2b 92 00 20 lw r18,(sp+32) 8001cbc: 2b 93 00 1c lw r19,(sp+28) 8001cc0: 2b 94 00 18 lw r20,(sp+24) 8001cc4: 2b 95 00 14 lw r21,(sp+20) 8001cc8: 2b 96 00 10 lw r22,(sp+16) 8001ccc: 2b 97 00 0c lw r23,(sp+12) 8001cd0: 2b 98 00 08 lw r24,(sp+8) 8001cd4: 37 9c 00 50 addi sp,sp,80 8001cd8: c3 a0 00 00 ret =============================================================================== 08002020 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 8002020: 37 9c ff e8 addi sp,sp,-24 8002024: 5b 8b 00 0c sw (sp+12),r11 8002028: 5b 8c 00 08 sw (sp+8),r12 800202c: 5b 9d 00 04 sw (sp+4),ra 8002030: b8 20 60 00 mv r12,r1 8002034: b8 40 58 00 mv r11,r2 int rv = -1; if (target != NULL) { 8002038: 44 40 00 0f be r2,r0,8002074 rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); 800203c: b8 40 08 00 mv r1,r2 8002040: 34 02 01 ff mvi r2,511 8002044: 5b 83 00 18 sw (sp+24),r3 8002048: 5b 84 00 14 sw (sp+20),r4 800204c: 5b 85 00 10 sw (sp+16),r5 8002050: f8 00 02 91 calli 8002a94 if (rv == 0) { 8002054: 2b 83 00 18 lw r3,(sp+24) 8002058: 2b 84 00 14 lw r4,(sp+20) 800205c: 2b 85 00 10 lw r5,(sp+16) 8002060: 5c 20 00 09 bne r1,r0,8002084 <== NEVER TAKEN rv = mount( 8002064: b9 80 08 00 mv r1,r12 8002068: b9 60 10 00 mv r2,r11 800206c: f8 00 00 44 calli 800217c 8002070: e0 00 00 05 bi 8002084 options, data ); } } else { errno = EINVAL; 8002074: f8 00 24 f9 calli 800b458 <__errno> 8002078: 34 02 00 16 mvi r2,22 800207c: 58 22 00 00 sw (r1+0),r2 const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { int rv = -1; 8002080: 34 01 ff ff mvi r1,-1 } else { errno = EINVAL; } return rv; } 8002084: 2b 9d 00 04 lw ra,(sp+4) 8002088: 2b 8b 00 0c lw r11,(sp+12) 800208c: 2b 8c 00 08 lw r12,(sp+8) 8002090: 37 9c 00 18 addi sp,sp,24 8002094: c3 a0 00 00 ret =============================================================================== 08001f04 : void newlib_delete_hook( rtems_tcb *current_task, rtems_tcb *deleted_task ) { 8001f04: 37 9c ff f0 addi sp,sp,-16 8001f08: 5b 8b 00 10 sw (sp+16),r11 8001f0c: 5b 8c 00 0c sw (sp+12),r12 8001f10: 5b 8d 00 08 sw (sp+8),r13 8001f14: 5b 9d 00 04 sw (sp+4),ra 8001f18: b8 20 68 00 mv r13,r1 8001f1c: b8 40 60 00 mv r12,r2 /* * The reentrancy structure was allocated by newlib using malloc() */ if (current_task == deleted_task) { 8001f20: 5c 22 00 05 bne r1,r2,8001f34 ptr = _REENT; 8001f24: 78 02 08 01 mvhi r2,0x801 8001f28: 38 42 31 70 ori r2,r2,0x3170 8001f2c: 28 4b 00 00 lw r11,(r2+0) 8001f30: e0 00 00 02 bi 8001f38 } else { ptr = deleted_task->libc_reent; 8001f34: 28 4b 01 20 lw r11,(r2+288) } if (ptr && ptr != _global_impure_ptr) { 8001f38: 45 60 00 0b be r11,r0,8001f64 <== NEVER TAKEN 8001f3c: 78 02 08 01 mvhi r2,0x801 8001f40: 38 42 1e ec ori r2,r2,0x1eec 8001f44: 28 41 00 00 lw r1,(r2+0) 8001f48: 45 61 00 07 be r11,r1,8001f64 _reclaim_reent(ptr); */ /* * Just in case there are some buffers lying around. */ _fwalk(ptr, newlib_free_buffers); 8001f4c: 78 02 08 00 mvhi r2,0x800 8001f50: b9 60 08 00 mv r1,r11 8001f54: 38 42 1c e0 ori r2,r2,0x1ce0 8001f58: f8 00 27 1e calli 800bbd0 <_fwalk> #if REENT_MALLOCED free(ptr); #else _Workspace_Free(ptr); 8001f5c: b9 60 08 00 mv r1,r11 8001f60: f8 00 12 44 calli 8006870 <_Workspace_Free> #endif } deleted_task->libc_reent = NULL; 8001f64: 59 80 01 20 sw (r12+288),r0 /* * Require the switch back to another task to install its own */ if ( current_task == deleted_task ) { 8001f68: 5d ac 00 04 bne r13,r12,8001f78 _REENT = 0; 8001f6c: 78 01 08 01 mvhi r1,0x801 8001f70: 38 21 31 70 ori r1,r1,0x3170 8001f74: 58 20 00 00 sw (r1+0),r0 } } 8001f78: 2b 9d 00 04 lw ra,(sp+4) 8001f7c: 2b 8b 00 10 lw r11,(sp+16) 8001f80: 2b 8c 00 0c lw r12,(sp+12) 8001f84: 2b 8d 00 08 lw r13,(sp+8) 8001f88: 37 9c 00 10 addi sp,sp,16 8001f8c: c3 a0 00 00 ret =============================================================================== 08001ce0 : */ int newlib_free_buffers( FILE *fp ) { 8001ce0: 37 9c ff f8 addi sp,sp,-8 8001ce4: 5b 8b 00 08 sw (sp+8),r11 8001ce8: 5b 9d 00 04 sw (sp+4),ra 8001cec: b8 20 58 00 mv r11,r1 switch ( fileno(fp) ) { 8001cf0: f8 00 26 7f calli 800b6ec 8001cf4: 34 02 00 02 mvi r2,2 8001cf8: 54 22 00 0c bgu r1,r2,8001d28 <== NEVER TAKEN case 0: case 1: case 2: if (fp->_flags & __SMBF) { 8001cfc: 2d 61 00 0c lhu r1,(r11+12) 8001d00: 20 21 00 80 andi r1,r1,0x80 8001d04: 44 20 00 0b be r1,r0,8001d30 <== ALWAYS TAKEN free( fp->_bf._base ); 8001d08: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8001d0c: fb ff fd 85 calli 8001320 <== NOT EXECUTED fp->_flags &= ~__SMBF; 8001d10: 2d 61 00 0c lhu r1,(r11+12) <== NOT EXECUTED fp->_bf._base = fp->_p = (unsigned char *) NULL; 8001d14: 59 60 00 00 sw (r11+0),r0 <== NOT EXECUTED 8001d18: 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; 8001d1c: 20 21 ff 7f andi r1,r1,0xff7f <== NOT EXECUTED 8001d20: 0d 61 00 0c sh (r11+12),r1 <== NOT EXECUTED 8001d24: e0 00 00 03 bi 8001d30 <== NOT EXECUTED fp->_bf._base = fp->_p = (unsigned char *) NULL; } break; default: fclose(fp); 8001d28: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8001d2c: f8 00 25 bb calli 800b418 <== NOT EXECUTED } return 0; } 8001d30: 34 01 00 00 mvi r1,0 8001d34: 2b 9d 00 04 lw ra,(sp+4) 8001d38: 2b 8b 00 08 lw r11,(sp+8) 8001d3c: 37 9c 00 08 addi sp,sp,8 8001d40: c3 a0 00 00 ret =============================================================================== 08002014 : int open( const char *pathname, int flags, ... ) { 8002014: 37 9c ff ac addi sp,sp,-84 8002018: 5b 8b 00 24 sw (sp+36),r11 800201c: 5b 8c 00 20 sw (sp+32),r12 8002020: 5b 8d 00 1c sw (sp+28),r13 8002024: 5b 8e 00 18 sw (sp+24),r14 8002028: 5b 8f 00 14 sw (sp+20),r15 800202c: 5b 90 00 10 sw (sp+16),r16 8002030: 5b 91 00 0c sw (sp+12),r17 8002034: 5b 92 00 08 sw (sp+8),r18 8002038: 5b 9d 00 04 sw (sp+4),ra 800203c: b8 20 78 00 mv r15,r1 /* * Set the Evaluation flags */ eval_flags = 0; status = flags + 1; 8002040: 34 41 00 01 addi r1,r2,1 int open( const char *pathname, int flags, ... ) { 8002044: 5b 82 00 3c sw (sp+60),r2 8002048: b8 40 70 00 mv r14,r2 800204c: 5b 83 00 40 sw (sp+64),r3 8002050: 5b 84 00 44 sw (sp+68),r4 8002054: 5b 85 00 48 sw (sp+72),r5 8002058: 5b 86 00 4c sw (sp+76),r6 800205c: 5b 87 00 50 sw (sp+80),r7 8002060: 5b 88 00 54 sw (sp+84),r8 /* * Set the Evaluation flags */ eval_flags = 0; status = flags + 1; if ( ( status & _FREAD ) == _FREAD ) 8002064: 20 22 00 01 andi r2,r1,0x1 int eval_flags; /* * Set the Evaluation flags */ eval_flags = 0; 8002068: 34 10 00 00 mvi r16,0 status = flags + 1; if ( ( status & _FREAD ) == _FREAD ) 800206c: 44 40 00 02 be r2,r0,8002074 eval_flags |= RTEMS_LIBIO_PERMS_READ; 8002070: 34 10 00 04 mvi r16,4 if ( ( status & _FWRITE ) == _FWRITE ) 8002074: 20 21 00 02 andi r1,r1,0x2 8002078: 44 20 00 02 be r1,r0,8002080 eval_flags |= RTEMS_LIBIO_PERMS_WRITE; 800207c: 3a 10 00 02 ori r16,r16,0x2 va_start(ap, flags); mode = va_arg( ap, int ); 8002080: 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(); 8002084: f8 00 17 c6 calli 8007f9c 8002088: 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; 800208c: 34 0d 00 00 mvi r13,0 */ /* allocate a file control block */ iop = rtems_libio_allocate(); if ( iop == 0 ) { rc = ENFILE; 8002090: 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 ) { 8002094: 44 20 00 62 be r1,r0,800221c } /* * See if the file exists. */ status = rtems_filesystem_evaluate_path( 8002098: b9 e0 08 00 mv r1,r15 800209c: f8 00 29 20 calli 800c51c 80020a0: 37 91 00 28 addi r17,sp,40 80020a4: b8 20 10 00 mv r2,r1 80020a8: ba 00 18 00 mv r3,r16 80020ac: b9 e0 08 00 mv r1,r15 80020b0: ba 20 20 00 mv r4,r17 80020b4: 34 05 00 01 mvi r5,1 80020b8: fb ff fc 4a calli 80011e0 pathname, strlen( pathname ), eval_flags, &loc, true ); if ( status == -1 ) { 80020bc: 34 02 ff ff mvi r2,-1 80020c0: 5c 22 00 1c bne r1,r2,8002130 if ( errno != ENOENT ) { 80020c4: f8 00 24 75 calli 800b298 <__errno> 80020c8: 28 22 00 00 lw r2,(r1+0) 80020cc: 34 01 00 02 mvi r1,2 80020d0: 5c 41 00 0a bne r2,r1,80020f8 rc = errno; goto done; } /* If the file does not exist and we are not trying to create it--> error */ if ( !(flags & O_CREAT) ) { 80020d4: 21 c1 02 00 andi r1,r14,0x200 rc = ENOENT; 80020d8: 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) ) { 80020dc: 44 20 00 50 be r1,r0,800221c rc = ENOENT; goto done; } /* Create the node for the new regular file */ rc = mknod( pathname, S_IFREG | mode, 0LL ); 80020e0: b9 e0 08 00 mv r1,r15 80020e4: 3a 42 80 00 ori r2,r18,0x8000 80020e8: 34 03 00 00 mvi r3,0 80020ec: 34 04 00 00 mvi r4,0 80020f0: fb ff fd ce calli 8001828 if ( rc ) { 80020f4: 44 20 00 04 be r1,r0,8002104 <== ALWAYS TAKEN rc = errno; 80020f8: f8 00 24 68 calli 800b298 <__errno> 80020fc: 28 2c 00 00 lw r12,(r1+0) goto done; 8002100: e0 00 00 46 bi 8002218 /* * 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( 8002104: b9 e0 08 00 mv r1,r15 8002108: f8 00 29 05 calli 800c51c 800210c: b8 20 10 00 mv r2,r1 8002110: 34 03 00 00 mvi r3,0 8002114: b9 e0 08 00 mv r1,r15 8002118: ba 20 20 00 mv r4,r17 800211c: 34 05 00 01 mvi r5,1 8002120: fb ff fc 30 calli 80011e0 pathname, strlen( pathname ), 0x0, &loc, true ); if ( status != 0 ) { /* The file did not exist */ rc = EACCES; 8002124: 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 */ 8002128: 5d a1 00 3d bne r13,r1,800221c <== NEVER TAKEN 800212c: e0 00 00 06 bi 8002144 rc = EACCES; goto done; } } else if ((flags & (O_EXCL|O_CREAT)) == (O_EXCL|O_CREAT)) { 8002130: 21 c2 0a 00 andi r2,r14,0xa00 8002134: 34 01 0a 00 mvi r1,2560 /* We were trying to create a file that already exists */ rc = EEXIST; loc_to_free = &loc; 8002138: 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; 800213c: 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)) { 8002140: 44 41 00 37 be r2,r1,800221c /* * Fill in the file control block based on the loc structure * returned by successful path evaluation. */ iop->flags |= rtems_libio_fcntl_flags( flags ); 8002144: b9 c0 08 00 mv r1,r14 8002148: 29 6c 00 18 lw r12,(r11+24) 800214c: f8 00 17 6a calli 8007ef4 iop->pathinfo = loc; 8002150: 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 ); 8002154: b8 2c 08 00 or r1,r1,r12 8002158: 59 61 00 18 sw (r11+24),r1 iop->pathinfo = loc; 800215c: 59 62 00 1c sw (r11+28),r2 8002160: 2b 82 00 2c lw r2,(sp+44) 8002164: 2b 81 00 30 lw r1,(sp+48) rc = (*iop->pathinfo.handlers->open_h)( iop, pathname, flags, mode ); 8002168: 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; 800216c: 59 62 00 20 sw (r11+32),r2 8002170: 2b 82 00 34 lw r2,(sp+52) rc = (*iop->pathinfo.handlers->open_h)( iop, pathname, flags, mode ); 8002174: 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; 8002178: 59 61 00 24 sw (r11+36),r1 800217c: 59 62 00 28 sw (r11+40),r2 8002180: 2b 82 00 38 lw r2,(sp+56) rc = (*iop->pathinfo.handlers->open_h)( iop, pathname, flags, mode ); 8002184: b9 60 08 00 mv r1,r11 8002188: 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; 800218c: 59 62 00 2c sw (r11+44),r2 rc = (*iop->pathinfo.handlers->open_h)( iop, pathname, flags, mode ); 8002190: b9 e0 10 00 mv r2,r15 8002194: d8 a0 00 00 call r5 if ( rc ) { 8002198: 44 20 00 05 be r1,r0,80021ac rc = errno; 800219c: f8 00 24 3f calli 800b298 <__errno> 80021a0: 28 2c 00 00 lw r12,(r1+0) rc = EEXIST; loc_to_free = &loc; goto done; } loc_to_free = &loc; 80021a4: 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; 80021a8: e0 00 00 1c bi 8002218 } /* * Optionally truncate the file. */ if ( (flags & O_TRUNC) == O_TRUNC ) { 80021ac: 21 ce 04 00 andi r14,r14,0x400 80021b0: 45 c1 00 25 be r14,r1,8002244 rc = ftruncate( iop - rtems_libio_iops, 0 ); 80021b4: 78 01 08 01 mvhi r1,0x801 80021b8: 38 21 36 a0 ori r1,r1,0x36a0 80021bc: 28 21 00 00 lw r1,(r1+0) 80021c0: 34 02 00 06 mvi r2,6 rc = EEXIST; loc_to_free = &loc; goto done; } loc_to_free = &loc; 80021c4: 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 ); 80021c8: c9 61 08 00 sub r1,r11,r1 80021cc: f8 00 39 5d calli 8010740 <__ashrsi3> 80021d0: 34 02 00 00 mvi r2,0 80021d4: f8 00 16 f4 calli 8007da4 80021d8: b8 20 60 00 mv r12,r1 if ( rc ) { 80021dc: 44 20 00 0f be r1,r0,8002218 if(errno) rc = errno; 80021e0: f8 00 24 2e calli 800b298 <__errno> 80021e4: 28 21 00 00 lw r1,(r1+0) 80021e8: 44 20 00 03 be r1,r0,80021f4 <== NEVER TAKEN 80021ec: f8 00 24 2b calli 800b298 <__errno> 80021f0: 28 2c 00 00 lw r12,(r1+0) close( iop - rtems_libio_iops ); 80021f4: 78 01 08 01 mvhi r1,0x801 80021f8: 38 21 36 a0 ori r1,r1,0x36a0 80021fc: 28 21 00 00 lw r1,(r1+0) 8002200: 34 02 00 06 mvi r2,6 /* those are released by close(): */ iop = 0; loc_to_free = NULL; 8002204: 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 ); 8002208: c9 61 08 00 sub r1,r11,r1 800220c: f8 00 39 4d calli 8010740 <__ashrsi3> 8002210: f8 00 16 b8 calli 8007cf0 /* those are released by close(): */ iop = 0; 8002214: 34 0b 00 00 mvi r11,0 * Single exit and clean up path. */ done: va_end(ap); if ( rc ) { 8002218: 45 80 00 0b be r12,r0,8002244 if ( iop ) 800221c: 45 60 00 03 be r11,r0,8002228 rtems_libio_free( iop ); 8002220: b9 60 08 00 mv r1,r11 8002224: f8 00 17 8c calli 8008054 if ( loc_to_free ) 8002228: 45 a0 00 03 be r13,r0,8002234 rtems_filesystem_freenode( loc_to_free ); 800222c: b9 a0 08 00 mv r1,r13 8002230: fb ff fc 34 calli 8001300 rtems_set_errno_and_return_minus_one( rc ); 8002234: f8 00 24 19 calli 800b298 <__errno> 8002238: 58 2c 00 00 sw (r1+0),r12 800223c: 34 01 ff ff mvi r1,-1 8002240: e0 00 00 07 bi 800225c } return iop - rtems_libio_iops; 8002244: 78 01 08 01 mvhi r1,0x801 8002248: 38 21 36 a0 ori r1,r1,0x36a0 800224c: 28 21 00 00 lw r1,(r1+0) 8002250: 34 02 00 06 mvi r2,6 8002254: c9 61 08 00 sub r1,r11,r1 8002258: f8 00 39 3a calli 8010740 <__ashrsi3> } 800225c: 2b 9d 00 04 lw ra,(sp+4) 8002260: 2b 8b 00 24 lw r11,(sp+36) 8002264: 2b 8c 00 20 lw r12,(sp+32) 8002268: 2b 8d 00 1c lw r13,(sp+28) 800226c: 2b 8e 00 18 lw r14,(sp+24) 8002270: 2b 8f 00 14 lw r15,(sp+20) 8002274: 2b 90 00 10 lw r16,(sp+16) 8002278: 2b 91 00 0c lw r17,(sp+12) 800227c: 2b 92 00 08 lw r18,(sp+8) 8002280: 37 9c 00 54 addi sp,sp,84 8002284: c3 a0 00 00 ret =============================================================================== 08001f90 : /* * This is a replaceable stub which opens the console, if present. */ void open_dev_console(void) { 8001f90: 37 9c ff f4 addi sp,sp,-12 8001f94: 5b 8b 00 0c sw (sp+12),r11 8001f98: 5b 8c 00 08 sw (sp+8),r12 8001f9c: 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) { 8001fa0: 78 0b 08 01 mvhi r11,0x801 8001fa4: 39 6b 19 64 ori r11,r11,0x1964 8001fa8: b9 60 08 00 mv r1,r11 8001fac: 34 02 00 00 mvi r2,0 8001fb0: 34 03 00 00 mvi r3,0 8001fb4: f8 00 00 18 calli 8002014 8001fb8: 34 0c ff ff mvi r12,-1 8001fbc: 44 2c 00 11 be r1,r12,8002000 /* * 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) 8001fc0: 34 02 00 01 mvi r2,1 8001fc4: b9 60 08 00 mv r1,r11 8001fc8: 34 03 00 00 mvi r3,0 8001fcc: f8 00 00 12 calli 8002014 rtems_fatal_error_occurred( 0x55544431 ); /* error STD1 */ 8001fd0: 78 02 08 01 mvhi r2,0x801 8001fd4: 38 42 1a 5c ori r2,r2,0x1a5c /* * 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) 8001fd8: 44 2c 00 08 be r1,r12,8001ff8 <== NEVER TAKEN rtems_fatal_error_occurred( 0x55544431 ); /* error STD1 */ if ((stderr_fd = open("/dev/console", O_WRONLY, 0)) == -1) 8001fdc: b9 60 08 00 mv r1,r11 8001fe0: 34 02 00 01 mvi r2,1 8001fe4: 34 03 00 00 mvi r3,0 8001fe8: f8 00 00 0b calli 8002014 8001fec: 5c 2c 00 05 bne r1,r12,8002000 <== ALWAYS TAKEN rtems_fatal_error_occurred( 0x55544432 ); /* error STD2 */ 8001ff0: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8001ff4: 38 42 1a 60 ori r2,r2,0x1a60 <== NOT EXECUTED 8001ff8: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 8001ffc: f8 00 04 2e calli 80030b4 <== NOT EXECUTED } 8002000: 2b 9d 00 04 lw ra,(sp+4) 8002004: 2b 8b 00 0c lw r11,(sp+12) 8002008: 2b 8c 00 08 lw r12,(sp+8) 800200c: 37 9c 00 0c addi sp,sp,12 8002010: c3 a0 00 00 ret =============================================================================== 080054e4 : /* * Handle output processing */ static void oproc (unsigned char c, struct rtems_termios_tty *tty) { 80054e4: 37 9c ff f4 addi sp,sp,-12 80054e8: 5b 8b 00 08 sw (sp+8),r11 80054ec: 5b 9d 00 04 sw (sp+4),ra 80054f0: 33 81 00 0c sb (sp+12),r1 int i; if (tty->termios.c_oflag & OPOST) { 80054f4: 28 41 00 34 lw r1,(r2+52) /* * Handle output processing */ static void oproc (unsigned char c, struct rtems_termios_tty *tty) { 80054f8: b8 40 58 00 mv r11,r2 int i; if (tty->termios.c_oflag & OPOST) { 80054fc: 20 22 00 01 andi r2,r1,0x1 8005500: 44 40 00 4d be r2,r0,8005634 <== NEVER TAKEN switch (c) { 8005504: 43 82 00 0c lbu r2,(sp+12) 8005508: 34 03 00 09 mvi r3,9 800550c: 44 43 00 21 be r2,r3,8005590 8005510: 54 43 00 04 bgu r2,r3,8005520 <== ALWAYS TAKEN 8005514: 34 03 00 08 mvi r3,8 <== NOT EXECUTED 8005518: 5c 43 00 30 bne r2,r3,80055d8 <== NOT EXECUTED 800551c: e0 00 00 2b bi 80055c8 <== NOT EXECUTED 8005520: 34 03 00 0a mvi r3,10 8005524: 44 43 00 04 be r2,r3,8005534 8005528: 34 03 00 0d mvi r3,13 800552c: 5c 43 00 2b bne r2,r3,80055d8 <== ALWAYS TAKEN 8005530: e0 00 00 0c bi 8005560 <== NOT EXECUTED case '\n': if (tty->termios.c_oflag & ONLRET) 8005534: 20 22 00 20 andi r2,r1,0x20 8005538: 44 40 00 02 be r2,r0,8005540 <== ALWAYS TAKEN tty->column = 0; 800553c: 59 60 00 28 sw (r11+40),r0 <== NOT EXECUTED if (tty->termios.c_oflag & ONLCR) { 8005540: 20 21 00 04 andi r1,r1,0x4 8005544: 44 20 00 3c be r1,r0,8005634 <== NEVER TAKEN rtems_termios_puts ("\r", 1, tty); 8005548: 78 01 08 01 mvhi r1,0x801 800554c: 38 21 f6 24 ori r1,r1,0xf624 8005550: 34 02 00 01 mvi r2,1 8005554: b9 60 18 00 mv r3,r11 8005558: fb ff ff 8d calli 800538c 800555c: e0 00 00 0b bi 8005588 tty->column = 0; } break; case '\r': if ((tty->termios.c_oflag & ONOCR) && (tty->column == 0)) 8005560: 20 22 00 10 andi r2,r1,0x10 <== NOT EXECUTED 8005564: 44 40 00 03 be r2,r0,8005570 <== NOT EXECUTED 8005568: 29 62 00 28 lw r2,(r11+40) <== NOT EXECUTED 800556c: 44 40 00 36 be r2,r0,8005644 <== NOT EXECUTED return; if (tty->termios.c_oflag & OCRNL) { 8005570: 20 22 00 08 andi r2,r1,0x8 <== NOT EXECUTED 8005574: 44 40 00 05 be r2,r0,8005588 <== NOT EXECUTED c = '\n'; 8005578: 34 02 00 0a mvi r2,10 <== NOT EXECUTED 800557c: 33 82 00 0c sb (sp+12),r2 <== NOT EXECUTED if (tty->termios.c_oflag & ONLRET) 8005580: 20 21 00 20 andi r1,r1,0x20 <== NOT EXECUTED 8005584: 44 20 00 2c be r1,r0,8005634 <== NOT EXECUTED tty->column = 0; break; } tty->column = 0; 8005588: 59 60 00 28 sw (r11+40),r0 break; 800558c: e0 00 00 2a bi 8005634 case '\t': i = 8 - (tty->column & 7); 8005590: 29 63 00 28 lw r3,(r11+40) 8005594: 34 04 00 08 mvi r4,8 if ((tty->termios.c_oflag & TABDLY) == XTABS) { 8005598: 20 21 18 00 andi r1,r1,0x1800 } tty->column = 0; break; case '\t': i = 8 - (tty->column & 7); 800559c: 20 62 00 07 andi r2,r3,0x7 80055a0: c8 82 10 00 sub r2,r4,r2 if ((tty->termios.c_oflag & TABDLY) == XTABS) { 80055a4: 34 04 18 00 mvi r4,6144 80055a8: b4 43 18 00 add r3,r2,r3 80055ac: 5c 24 00 05 bne r1,r4,80055c0 <== NEVER TAKEN tty->column += i; rtems_termios_puts ( " ", i, tty); 80055b0: 78 01 08 01 mvhi r1,0x801 break; case '\t': i = 8 - (tty->column & 7); if ((tty->termios.c_oflag & TABDLY) == XTABS) { tty->column += i; 80055b4: 59 63 00 28 sw (r11+40),r3 rtems_termios_puts ( " ", i, tty); 80055b8: 38 21 f6 28 ori r1,r1,0xf628 80055bc: e0 00 00 20 bi 800563c return; } tty->column += i; 80055c0: 59 63 00 28 sw (r11+40),r3 <== NOT EXECUTED break; 80055c4: e0 00 00 1c bi 8005634 <== NOT EXECUTED case '\b': if (tty->column > 0) 80055c8: 29 61 00 28 lw r1,(r11+40) <== NOT EXECUTED 80055cc: 4c 01 00 1a bge r0,r1,8005634 <== NOT EXECUTED tty->column--; 80055d0: 34 21 ff ff addi r1,r1,-1 <== NOT EXECUTED 80055d4: e0 00 00 17 bi 8005630 <== NOT EXECUTED break; default: if (tty->termios.c_oflag & OLCUC) 80055d8: 20 21 00 02 andi r1,r1,0x2 80055dc: 44 20 00 0b be r1,r0,8005608 <== ALWAYS TAKEN c = toupper(c); 80055e0: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 80055e4: 38 21 13 c8 ori r1,r1,0x13c8 <== NOT EXECUTED 80055e8: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED 80055ec: b4 22 08 00 add r1,r1,r2 <== NOT EXECUTED 80055f0: 40 23 00 01 lbu r3,(r1+1) <== NOT EXECUTED 80055f4: 34 01 00 02 mvi r1,2 <== NOT EXECUTED 80055f8: 20 63 00 03 andi r3,r3,0x3 <== NOT EXECUTED 80055fc: 5c 61 00 02 bne r3,r1,8005604 <== NOT EXECUTED 8005600: 34 42 ff e0 addi r2,r2,-32 <== NOT EXECUTED 8005604: 33 82 00 0c sb (sp+12),r2 <== NOT EXECUTED if (!iscntrl(c)) 8005608: 78 01 08 02 mvhi r1,0x802 800560c: 38 21 13 c8 ori r1,r1,0x13c8 8005610: 43 82 00 0c lbu r2,(sp+12) 8005614: 28 21 00 00 lw r1,(r1+0) 8005618: b4 22 08 00 add r1,r1,r2 800561c: 40 21 00 01 lbu r1,(r1+1) 8005620: 20 21 00 20 andi r1,r1,0x20 8005624: 5c 20 00 04 bne r1,r0,8005634 <== NEVER TAKEN tty->column++; 8005628: 29 61 00 28 lw r1,(r11+40) 800562c: 34 21 00 01 addi r1,r1,1 8005630: 59 61 00 28 sw (r11+40),r1 break; } } rtems_termios_puts (&c, 1, tty); 8005634: 37 81 00 0c addi r1,sp,12 8005638: 34 02 00 01 mvi r2,1 800563c: b9 60 18 00 mv r3,r11 8005640: fb ff ff 53 calli 800538c } 8005644: 2b 9d 00 04 lw ra,(sp+4) 8005648: 2b 8b 00 08 lw r11,(sp+8) 800564c: 37 9c 00 0c addi sp,sp,12 8005650: c3 a0 00 00 ret =============================================================================== 08008f38 : * Called by pipe() to create an anonymous pipe. */ int pipe_create( int filsdes[2] ) { 8008f38: 37 9c ff d8 addi sp,sp,-40 8008f3c: 5b 8b 00 18 sw (sp+24),r11 8008f40: 5b 8c 00 14 sw (sp+20),r12 8008f44: 5b 8d 00 10 sw (sp+16),r13 8008f48: 5b 8e 00 0c sw (sp+12),r14 8008f4c: 5b 8f 00 08 sw (sp+8),r15 8008f50: 5b 9d 00 04 sw (sp+4),ra 8008f54: 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) 8008f58: 78 01 08 01 mvhi r1,0x801 8008f5c: 38 21 c8 a0 ori r1,r1,0xc8a0 8008f60: 34 02 01 ff mvi r2,511 8008f64: f8 00 06 13 calli 800a7b0 8008f68: b8 20 78 00 mv r15,r1 return -1; 8008f6c: 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) 8008f70: 5c 20 00 43 bne r1,r0,800907c <== NEVER TAKEN return -1; /* /tmp/.fifoXXXX */ char fifopath[15]; memcpy(fifopath, "/tmp/.fifo", 10); 8008f74: 78 02 08 01 mvhi r2,0x801 8008f78: 38 42 c8 a8 ori r2,r2,0xc8a8 8008f7c: 28 43 00 00 lw r3,(r2+0) 8008f80: 28 41 00 04 lw r1,(r2+4) 8008f84: 37 8b 00 1c addi r11,sp,28 8008f88: 5b 83 00 1c sw (sp+28),r3 8008f8c: 59 61 00 04 sw (r11+4),r1 8008f90: 2c 41 00 08 lhu r1,(r2+8) sprintf(fifopath + 10, "%04x", rtems_pipe_no ++); 8008f94: 78 02 08 01 mvhi r2,0x801 8008f98: 38 42 e6 50 ori r2,r2,0xe650 8008f9c: 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); 8008fa0: 0d 61 00 08 sh (r11+8),r1 sprintf(fifopath + 10, "%04x", rtems_pipe_no ++); 8008fa4: 34 61 00 01 addi r1,r3,1 8008fa8: 0c 41 00 00 sh (r2+0),r1 8008fac: 78 02 08 01 mvhi r2,0x801 8008fb0: 38 42 c8 b4 ori r2,r2,0xc8b4 8008fb4: 37 81 00 26 addi r1,sp,38 8008fb8: f8 00 11 e0 calli 800d738 /* Try creating FIFO file until find an available file name */ while (mkfifo(fifopath, S_IRUSR|S_IWUSR) != 0) { 8008fbc: b9 60 08 00 mv r1,r11 8008fc0: 34 02 01 80 mvi r2,384 8008fc4: f8 00 05 30 calli 800a484 8008fc8: b8 20 60 00 mv r12,r1 8008fcc: 44 2f 00 03 be r1,r15,8008fd8 if (errno != EEXIST){ 8008fd0: f8 00 0e 64 calli 800c960 <__errno> 8008fd4: e0 00 00 2a bi 800907c 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); 8008fd8: b9 60 08 00 mv r1,r11 8008fdc: 34 02 40 00 mvi r2,16384 8008fe0: fb ff ea 05 calli 80037f4 8008fe4: 59 c1 00 00 sw (r14+0),r1 if (filsdes[0] < 0) { 8008fe8: 4c 2c 00 05 bge r1,r12,8008ffc err = errno; 8008fec: f8 00 0e 5d calli 800c960 <__errno> 8008ff0: 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); 8008ff4: b9 60 08 00 mv r1,r11 8008ff8: e0 00 00 1b bi 8009064 } else { /* Reset open file to blocking mode */ iop = rtems_libio_iop(filsdes[0]); 8008ffc: 78 02 08 01 mvhi r2,0x801 8009000: 38 42 e0 10 ori r2,r2,0xe010 8009004: 28 44 00 00 lw r4,(r2+0) 8009008: 34 02 00 00 mvi r2,0 800900c: 50 24 00 07 bgeu r1,r4,8009028 <== NEVER TAKEN 8009010: 34 02 00 06 mvi r2,6 8009014: 78 0b 08 01 mvhi r11,0x801 8009018: f8 00 47 d8 calli 801af78 <__ashlsi3> 800901c: 39 6b e6 c8 ori r11,r11,0xe6c8 8009020: 29 62 00 00 lw r2,(r11+0) 8009024: b4 41 10 00 add r2,r2,r1 iop->flags &= ~LIBIO_FLAGS_NO_DELAY; 8009028: 28 43 00 18 lw r3,(r2+24) 800902c: 34 01 ff fe mvi r1,-2 int pipe_create( int filsdes[2] ) { rtems_libio_t *iop; int err = 0; 8009030: 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; 8009034: a0 61 08 00 and r1,r3,r1 8009038: 58 41 00 18 sw (r2+24),r1 filsdes[1] = open(fifopath, O_WRONLY); 800903c: 37 81 00 1c addi r1,sp,28 8009040: 34 02 00 01 mvi r2,1 8009044: fb ff e9 ec calli 80037f4 8009048: 59 c1 00 04 sw (r14+4),r1 if (filsdes[1] < 0) { 800904c: 4c 20 00 05 bge r1,r0,8009060 err = errno; 8009050: f8 00 0e 44 calli 800c960 <__errno> 8009054: 28 2c 00 00 lw r12,(r1+0) close(filsdes[0]); 8009058: 29 c1 00 00 lw r1,(r14+0) 800905c: fb ff e5 41 calli 8002560 } unlink(fifopath); 8009060: 37 81 00 1c addi r1,sp,28 8009064: fb ff ea f6 calli 8003c3c } if(err != 0) rtems_set_errno_and_return_minus_one(err); return 0; 8009068: 34 0d 00 00 mvi r13,0 err = errno; close(filsdes[0]); } unlink(fifopath); } if(err != 0) 800906c: 45 80 00 04 be r12,r0,800907c rtems_set_errno_and_return_minus_one(err); 8009070: f8 00 0e 3c calli 800c960 <__errno> 8009074: 58 2c 00 00 sw (r1+0),r12 8009078: 34 0d ff ff mvi r13,-1 return 0; } 800907c: b9 a0 08 00 mv r1,r13 8009080: 2b 9d 00 04 lw ra,(sp+4) 8009084: 2b 8b 00 18 lw r11,(sp+24) 8009088: 2b 8c 00 14 lw r12,(sp+20) 800908c: 2b 8d 00 10 lw r13,(sp+16) 8009090: 2b 8e 00 0c lw r14,(sp+12) 8009094: 2b 8f 00 08 lw r15,(sp+8) 8009098: 37 9c 00 28 addi sp,sp,40 800909c: c3 a0 00 00 ret =============================================================================== 0800a6fc : pipe_control_t *pipe, uint32_t cmd, void *buffer, rtems_libio_t *iop ) { 800a6fc: 37 9c ff f4 addi sp,sp,-12 800a700: 5b 8b 00 0c sw (sp+12),r11 800a704: 5b 8c 00 08 sw (sp+8),r12 800a708: 5b 9d 00 04 sw (sp+4),ra 800a70c: b8 60 60 00 mv r12,r3 if (cmd == FIONREAD) { 800a710: 78 03 08 01 mvhi r3,0x801 800a714: 38 63 fb b8 ori r3,r3,0xfbb8 pipe_control_t *pipe, uint32_t cmd, void *buffer, rtems_libio_t *iop ) { 800a718: b8 20 58 00 mv r11,r1 if (cmd == FIONREAD) { 800a71c: 28 61 00 00 lw r1,(r3+0) *(unsigned int *)buffer = pipe->Length; PIPE_UNLOCK(pipe); return 0; } return -EINVAL; 800a720: 34 04 ff ea mvi r4,-22 uint32_t cmd, void *buffer, rtems_libio_t *iop ) { if (cmd == FIONREAD) { 800a724: 5c 41 00 0e bne r2,r1,800a75c if (buffer == NULL) return -EFAULT; 800a728: 34 04 ff f2 mvi r4,-14 void *buffer, rtems_libio_t *iop ) { if (cmd == FIONREAD) { if (buffer == NULL) 800a72c: 45 80 00 0c be r12,r0,800a75c return -EFAULT; if (! PIPE_LOCK(pipe)) 800a730: 29 61 00 28 lw r1,(r11+40) 800a734: 34 02 00 00 mvi r2,0 800a738: 34 03 00 00 mvi r3,0 800a73c: fb ff ea 45 calli 8005050 return -EINTR; 800a740: 34 04 ff fc mvi r4,-4 { if (cmd == FIONREAD) { if (buffer == NULL) return -EFAULT; if (! PIPE_LOCK(pipe)) 800a744: 5c 20 00 06 bne r1,r0,800a75c <== NEVER TAKEN return -EINTR; /* Return length of pipe */ *(unsigned int *)buffer = pipe->Length; 800a748: 29 61 00 0c lw r1,(r11+12) 800a74c: 59 81 00 00 sw (r12+0),r1 PIPE_UNLOCK(pipe); 800a750: 29 61 00 28 lw r1,(r11+40) 800a754: fb ff ea 8f calli 8005190 return 0; 800a758: 34 04 00 00 mvi r4,0 } return -EINVAL; } 800a75c: b8 80 08 00 mv r1,r4 800a760: 2b 9d 00 04 lw ra,(sp+4) 800a764: 2b 8b 00 0c lw r11,(sp+12) 800a768: 2b 8c 00 08 lw r12,(sp+8) 800a76c: 37 9c 00 0c addi sp,sp,12 800a770: c3 a0 00 00 ret =============================================================================== 0800a364 : pipe_control_t *pipe, void *buffer, size_t count, rtems_libio_t *iop ) { 800a364: 37 9c ff d8 addi sp,sp,-40 800a368: 5b 8b 00 24 sw (sp+36),r11 800a36c: 5b 8c 00 20 sw (sp+32),r12 800a370: 5b 8d 00 1c sw (sp+28),r13 800a374: 5b 8e 00 18 sw (sp+24),r14 800a378: 5b 8f 00 14 sw (sp+20),r15 800a37c: 5b 90 00 10 sw (sp+16),r16 800a380: 5b 91 00 0c sw (sp+12),r17 800a384: 5b 92 00 08 sw (sp+8),r18 800a388: 5b 9d 00 04 sw (sp+4),ra 800a38c: b8 20 58 00 mv r11,r1 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) 800a390: 28 21 00 28 lw r1,(r1+40) pipe_control_t *pipe, void *buffer, size_t count, rtems_libio_t *iop ) { 800a394: b8 40 78 00 mv r15,r2 800a398: b8 60 80 00 mv r16,r3 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) 800a39c: 34 02 00 00 mvi r2,0 800a3a0: 34 03 00 00 mvi r3,0 pipe_control_t *pipe, void *buffer, size_t count, rtems_libio_t *iop ) { 800a3a4: b8 80 88 00 mv r17,r4 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) 800a3a8: fb ff eb 2a calli 8005050 return -EINTR; 800a3ac: 34 0c ff fc mvi r12,-4 rtems_libio_t *iop ) { int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) 800a3b0: 5c 20 00 4d bne r1,r0,800a4e4 <== NEVER TAKEN 800a3b4: 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)) 800a3b8: 34 12 ff fc mvi r18,-4 800a3bc: e0 00 00 3f bi 800a4b8 return -EINTR; while (read < count) { while (PIPE_EMPTY(pipe)) { /* Not an error */ if (pipe->Writers == 0) 800a3c0: 29 61 00 14 lw r1,(r11+20) 800a3c4: 44 2d 00 3e be r1,r13,800a4bc goto out_locked; if (LIBIO_NODELAY(iop)) { 800a3c8: 2a 2d 00 18 lw r13,(r17+24) 800a3cc: 21 ad 00 01 andi r13,r13,0x1 800a3d0: 5d a0 00 3d bne r13,r0,800a4c4 ret = -EAGAIN; goto out_locked; } /* Wait until pipe is no more empty or no writer exists */ pipe->waitingReaders ++; 800a3d4: 29 61 00 18 lw r1,(r11+24) 800a3d8: 34 21 00 01 addi r1,r1,1 800a3dc: 59 61 00 18 sw (r11+24),r1 PIPE_UNLOCK(pipe); 800a3e0: 29 61 00 28 lw r1,(r11+40) 800a3e4: fb ff eb 6b calli 8005190 if (! PIPE_READWAIT(pipe)) 800a3e8: 29 61 00 2c lw r1,(r11+44) 800a3ec: 34 02 00 00 mvi r2,0 800a3f0: f8 00 04 3c calli 800b4e0 800a3f4: fc 2d 68 00 cmpne r13,r1,r13 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 800a3f8: 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)) 800a3fc: c8 0d 68 00 sub r13,r0,r13 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 800a400: 34 02 00 00 mvi r2,0 800a404: 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)) 800a408: a1 b2 68 00 and r13,r13,r18 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 800a40c: fb ff eb 11 calli 8005050 800a410: 5c 20 00 31 bne r1,r0,800a4d4 <== NEVER TAKEN /* WARN waitingReaders not restored! */ ret = -EINTR; goto out_nolock; } pipe->waitingReaders --; 800a414: 29 62 00 18 lw r2,(r11+24) 800a418: 34 42 ff ff addi r2,r2,-1 800a41c: 59 62 00 18 sw (r11+24),r2 if (ret != 0) 800a420: 5d a1 00 2a bne r13,r1,800a4c8 <== NEVER TAKEN if (! PIPE_LOCK(pipe)) return -EINTR; while (read < count) { while (PIPE_EMPTY(pipe)) { 800a424: 29 6d 00 0c lw r13,(r11+12) 800a428: 45 a0 ff e6 be r13,r0,800a3c0 if (ret != 0) goto out_locked; } /* Read chunk bytes */ chunk = MIN(count - read, pipe->Length); 800a42c: ca 0c 08 00 sub r1,r16,r12 800a430: 50 2d 00 02 bgeu r1,r13,800a438 800a434: b8 20 68 00 mv r13,r1 chunk1 = pipe->Size - pipe->Start; 800a438: 29 65 00 08 lw r5,(r11+8) 800a43c: 29 6e 00 04 lw r14,(r11+4) 800a440: 29 66 00 00 lw r6,(r11+0) 800a444: b5 ec 08 00 add r1,r15,r12 800a448: 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); 800a44c: b4 c5 10 00 add r2,r6,r5 800a450: b9 a0 18 00 mv r3,r13 } /* Read chunk bytes */ chunk = MIN(count - read, pipe->Length); chunk1 = pipe->Size - pipe->Start; if (chunk > chunk1) { 800a454: 4d cd 00 08 bge r14,r13,800a474 memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk1); 800a458: b4 c5 10 00 add r2,r6,r5 800a45c: b9 c0 18 00 mv r3,r14 800a460: f8 00 10 26 calli 800e4f8 memcpy(buffer + read + chunk1, pipe->Buffer, chunk - chunk1); 800a464: 29 62 00 00 lw r2,(r11+0) 800a468: b5 8e 08 00 add r1,r12,r14 800a46c: b5 e1 08 00 add r1,r15,r1 800a470: c9 ae 18 00 sub r3,r13,r14 } else memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk); 800a474: f8 00 10 21 calli 800e4f8 pipe->Start += chunk; 800a478: 29 61 00 08 lw r1,(r11+8) pipe->Start %= pipe->Size; 800a47c: 29 62 00 04 lw r2,(r11+4) 800a480: b5 a1 08 00 add r1,r13,r1 800a484: f8 00 4f 5d calli 801e1f8 <__umodsi3> 800a488: 59 61 00 08 sw (r11+8),r1 pipe->Length -= chunk; 800a48c: 29 61 00 0c lw r1,(r11+12) 800a490: c8 2d 08 00 sub r1,r1,r13 800a494: 59 61 00 0c sw (r11+12),r1 /* For buffering optimization */ if (PIPE_EMPTY(pipe)) 800a498: 5c 20 00 02 bne r1,r0,800a4a0 pipe->Start = 0; 800a49c: 59 60 00 08 sw (r11+8),r0 if (pipe->waitingWriters > 0) 800a4a0: 29 61 00 1c lw r1,(r11+28) 800a4a4: 44 20 00 04 be r1,r0,800a4b4 PIPE_WAKEUPWRITERS(pipe); 800a4a8: 29 61 00 30 lw r1,(r11+48) 800a4ac: 37 82 00 28 addi r2,sp,40 800a4b0: f8 00 03 ef calli 800b46c read += chunk; 800a4b4: b5 8d 60 00 add r12,r12,r13 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) return -EINTR; while (read < count) { 800a4b8: 56 0c ff db bgu r16,r12,800a424 while (PIPE_EMPTY(pipe)) { /* Not an error */ if (pipe->Writers == 0) 800a4bc: 34 0d 00 00 mvi r13,0 800a4c0: e0 00 00 02 bi 800a4c8 goto out_locked; if (LIBIO_NODELAY(iop)) { ret = -EAGAIN; 800a4c4: 34 0d ff f5 mvi r13,-11 PIPE_WAKEUPWRITERS(pipe); read += chunk; } out_locked: PIPE_UNLOCK(pipe); 800a4c8: 29 61 00 28 lw r1,(r11+40) 800a4cc: fb ff eb 31 calli 8005190 800a4d0: e0 00 00 02 bi 800a4d8 PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) ret = -EINTR; if (! PIPE_LOCK(pipe)) { /* WARN waitingReaders not restored! */ ret = -EINTR; 800a4d4: 34 0d ff fc mvi r13,-4 <== NOT EXECUTED out_locked: PIPE_UNLOCK(pipe); out_nolock: if (read > 0) 800a4d8: 4c 0c 00 02 bge r0,r12,800a4e0 800a4dc: e0 00 00 02 bi 800a4e4 return read; return ret; 800a4e0: b9 a0 60 00 mv r12,r13 } 800a4e4: b9 80 08 00 mv r1,r12 800a4e8: 2b 9d 00 04 lw ra,(sp+4) 800a4ec: 2b 8b 00 24 lw r11,(sp+36) 800a4f0: 2b 8c 00 20 lw r12,(sp+32) 800a4f4: 2b 8d 00 1c lw r13,(sp+28) 800a4f8: 2b 8e 00 18 lw r14,(sp+24) 800a4fc: 2b 8f 00 14 lw r15,(sp+20) 800a500: 2b 90 00 10 lw r16,(sp+16) 800a504: 2b 91 00 0c lw r17,(sp+12) 800a508: 2b 92 00 08 lw r18,(sp+8) 800a50c: 37 9c 00 28 addi sp,sp,40 800a510: c3 a0 00 00 ret =============================================================================== 08009edc : */ void pipe_release( pipe_control_t **pipep, rtems_libio_t *iop ) { 8009edc: 37 9c ff ec addi sp,sp,-20 8009ee0: 5b 8b 00 10 sw (sp+16),r11 8009ee4: 5b 8c 00 0c sw (sp+12),r12 8009ee8: 5b 8d 00 08 sw (sp+8),r13 8009eec: 5b 9d 00 04 sw (sp+4),ra 8009ef0: b8 20 68 00 mv r13,r1 pipe_control_t *pipe = *pipep; 8009ef4: 28 2b 00 00 lw r11,(r1+0) /* WARN pipe not released! */ if (!PIPE_LOCK(pipe)) rtems_fatal_error_occurred(0xdeadbeef); #endif mode = LIBIO_ACCMODE(iop); 8009ef8: 28 41 00 18 lw r1,(r2+24) 8009efc: 20 2c 00 06 andi r12,r1,0x6 if (mode & LIBIO_FLAGS_READ) 8009f00: 20 21 00 02 andi r1,r1,0x2 8009f04: 44 20 00 04 be r1,r0,8009f14 pipe->Readers --; 8009f08: 29 61 00 10 lw r1,(r11+16) 8009f0c: 34 21 ff ff addi r1,r1,-1 8009f10: 59 61 00 10 sw (r11+16),r1 if (mode & LIBIO_FLAGS_WRITE) 8009f14: 21 81 00 04 andi r1,r12,0x4 8009f18: 44 20 00 04 be r1,r0,8009f28 pipe->Writers --; 8009f1c: 29 61 00 14 lw r1,(r11+20) 8009f20: 34 21 ff ff addi r1,r1,-1 8009f24: 59 61 00 14 sw (r11+20),r1 PIPE_UNLOCK(pipe); 8009f28: 29 61 00 28 lw r1,(r11+40) 8009f2c: fb ff ec 99 calli 8005190 if (pipe->Readers == 0 && pipe->Writers == 0) { 8009f30: 29 62 00 10 lw r2,(r11+16) 8009f34: 5c 40 00 07 bne r2,r0,8009f50 8009f38: 29 61 00 14 lw r1,(r11+20) 8009f3c: 5c 22 00 05 bne r1,r2,8009f50 #if 0 /* To delete an anonymous pipe file when all users closed it */ if (pipe->Anonymous) delfile = TRUE; #endif pipe_free(pipe); 8009f40: b9 60 08 00 mv r1,r11 8009f44: fb ff ff d4 calli 8009e94 *pipep = NULL; 8009f48: 59 a0 00 00 sw (r13+0),r0 8009f4c: e0 00 00 0f bi 8009f88 } else if (pipe->Readers == 0 && mode != LIBIO_FLAGS_WRITE) 8009f50: 7d 81 00 04 cmpnei r1,r12,4 8009f54: 64 42 00 00 cmpei r2,r2,0 8009f58: a0 22 10 00 and r2,r1,r2 8009f5c: 44 40 00 03 be r2,r0,8009f68 /* Notify waiting Writers that all their partners left */ PIPE_WAKEUPWRITERS(pipe); 8009f60: 29 61 00 30 lw r1,(r11+48) 8009f64: e0 00 00 07 bi 8009f80 else if (pipe->Writers == 0 && mode != LIBIO_FLAGS_READ) 8009f68: 29 61 00 14 lw r1,(r11+20) 8009f6c: 7d 8c 00 02 cmpnei r12,r12,2 8009f70: 64 21 00 00 cmpei r1,r1,0 8009f74: a1 81 60 00 and r12,r12,r1 8009f78: 45 82 00 04 be r12,r2,8009f88 <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); 8009f7c: 29 61 00 2c lw r1,(r11+44) 8009f80: 37 82 00 14 addi r2,sp,20 8009f84: f8 00 05 3a calli 800b46c pipe_unlock(); 8009f88: fb ff ff ba calli 8009e70 iop->flags &= ~LIBIO_FLAGS_OPEN; if(iop->pathinfo.ops->unlink_h(&iop->pathinfo)) return; #endif } 8009f8c: 2b 9d 00 04 lw ra,(sp+4) 8009f90: 2b 8b 00 10 lw r11,(sp+16) 8009f94: 2b 8c 00 0c lw r12,(sp+12) 8009f98: 2b 8d 00 08 lw r13,(sp+8) 8009f9c: 37 9c 00 14 addi sp,sp,20 8009fa0: c3 a0 00 00 ret =============================================================================== 0800a514 : pipe_control_t *pipe, const void *buffer, size_t count, rtems_libio_t *iop ) { 800a514: 37 9c ff d4 addi sp,sp,-44 800a518: 5b 8b 00 28 sw (sp+40),r11 800a51c: 5b 8c 00 24 sw (sp+36),r12 800a520: 5b 8d 00 20 sw (sp+32),r13 800a524: 5b 8e 00 1c sw (sp+28),r14 800a528: 5b 8f 00 18 sw (sp+24),r15 800a52c: 5b 90 00 14 sw (sp+20),r16 800a530: 5b 91 00 10 sw (sp+16),r17 800a534: 5b 92 00 0c sw (sp+12),r18 800a538: 5b 93 00 08 sw (sp+8),r19 800a53c: 5b 9d 00 04 sw (sp+4),ra int chunk, chunk1, written = 0, ret = 0; /* Write nothing */ if (count == 0) return 0; 800a540: 34 0c 00 00 mvi r12,0 pipe_control_t *pipe, const void *buffer, size_t count, rtems_libio_t *iop ) { 800a544: b8 20 58 00 mv r11,r1 800a548: b8 40 88 00 mv r17,r2 800a54c: b8 60 70 00 mv r14,r3 800a550: b8 80 90 00 mv r18,r4 int chunk, chunk1, written = 0, ret = 0; /* Write nothing */ if (count == 0) 800a554: 44 60 00 5d be r3,r0,800a6c8 <== NEVER TAKEN return 0; if (! PIPE_LOCK(pipe)) 800a558: 28 21 00 28 lw r1,(r1+40) 800a55c: 34 02 00 00 mvi r2,0 800a560: 34 03 00 00 mvi r3,0 800a564: fb ff ea bb calli 8005050 return -EINTR; 800a568: 34 0c ff fc mvi r12,-4 /* Write nothing */ if (count == 0) return 0; if (! PIPE_LOCK(pipe)) 800a56c: 5c 20 00 57 bne r1,r0,800a6c8 <== NEVER TAKEN return -EINTR; if (pipe->Readers == 0) { 800a570: 29 62 00 10 lw r2,(r11+16) 800a574: 44 41 00 48 be r2,r1,800a694 ret = -EPIPE; goto out_locked; } /* Write of PIPE_BUF bytes or less shall not be interleaved */ chunk = count <= pipe->Size ? count : 1; 800a578: 29 61 00 04 lw r1,(r11+4) 800a57c: 34 10 00 01 mvi r16,1 800a580: 55 c1 00 02 bgu r14,r1,800a588 <== NEVER TAKEN 800a584: 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; 800a588: 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)) 800a58c: 34 13 ff fc mvi r19,-4 800a590: e0 00 00 3e bi 800a688 /* 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)) { 800a594: 2a 4d 00 18 lw r13,(r18+24) 800a598: 21 ad 00 01 andi r13,r13,0x1 800a59c: 5d a0 00 41 bne r13,r0,800a6a0 ret = -EAGAIN; goto out_locked; } /* Wait until there is chunk bytes space or no reader exists */ pipe->waitingWriters ++; 800a5a0: 29 61 00 1c lw r1,(r11+28) 800a5a4: 34 21 00 01 addi r1,r1,1 800a5a8: 59 61 00 1c sw (r11+28),r1 PIPE_UNLOCK(pipe); 800a5ac: 29 61 00 28 lw r1,(r11+40) 800a5b0: fb ff ea f8 calli 8005190 if (! PIPE_WRITEWAIT(pipe)) 800a5b4: 29 61 00 30 lw r1,(r11+48) 800a5b8: 34 02 00 00 mvi r2,0 800a5bc: f8 00 03 c9 calli 800b4e0 800a5c0: fc 2d 68 00 cmpne r13,r1,r13 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 800a5c4: 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)) 800a5c8: c8 0d 68 00 sub r13,r0,r13 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 800a5cc: 34 02 00 00 mvi r2,0 800a5d0: 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)) 800a5d4: a1 b3 68 00 and r13,r13,r19 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 800a5d8: fb ff ea 9e calli 8005050 800a5dc: 5c 20 00 37 bne r1,r0,800a6b8 <== NEVER TAKEN /* WARN waitingWriters not restored! */ ret = -EINTR; goto out_nolock; } pipe->waitingWriters --; 800a5e0: 29 62 00 1c lw r2,(r11+28) 800a5e4: 34 42 ff ff addi r2,r2,-1 800a5e8: 59 62 00 1c sw (r11+28),r2 if (ret != 0) 800a5ec: 5d a1 00 30 bne r13,r1,800a6ac <== NEVER TAKEN goto out_locked; if (pipe->Readers == 0) { 800a5f0: 29 61 00 10 lw r1,(r11+16) 800a5f4: 44 2d 00 2d be r1,r13,800a6a8 <== 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) { 800a5f8: 29 6f 00 04 lw r15,(r11+4) 800a5fc: 29 61 00 0c lw r1,(r11+12) 800a600: c9 e1 68 00 sub r13,r15,r1 800a604: 56 0d ff e4 bgu r16,r13,800a594 ret = -EPIPE; goto out_locked; } } chunk = MIN(count - written, PIPE_SPACE(pipe)); 800a608: c9 cc 10 00 sub r2,r14,r12 800a60c: 50 4d 00 02 bgeu r2,r13,800a614 800a610: b8 40 68 00 mv r13,r2 chunk1 = pipe->Size - PIPE_WSTART(pipe); 800a614: 29 62 00 08 lw r2,(r11+8) 800a618: b4 22 08 00 add r1,r1,r2 800a61c: b9 e0 10 00 mv r2,r15 800a620: f8 00 4e f6 calli 801e1f8 <__umodsi3> 800a624: c9 e1 78 00 sub r15,r15,r1 800a628: 29 63 00 00 lw r3,(r11+0) 800a62c: b6 2c 10 00 add r2,r17,r12 if (chunk > chunk1) { 800a630: 4d ed 00 09 bge r15,r13,800a654 memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk1); 800a634: b4 61 08 00 add r1,r3,r1 800a638: b9 e0 18 00 mv r3,r15 800a63c: f8 00 0f af calli 800e4f8 memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1); 800a640: b5 ec 10 00 add r2,r15,r12 800a644: 29 61 00 00 lw r1,(r11+0) 800a648: b6 22 10 00 add r2,r17,r2 800a64c: c9 af 18 00 sub r3,r13,r15 800a650: e0 00 00 03 bi 800a65c } else memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk); 800a654: b4 61 08 00 add r1,r3,r1 800a658: b9 a0 18 00 mv r3,r13 800a65c: f8 00 0f a7 calli 800e4f8 pipe->Length += chunk; 800a660: 29 61 00 0c lw r1,(r11+12) 800a664: b4 2d 08 00 add r1,r1,r13 800a668: 59 61 00 0c sw (r11+12),r1 if (pipe->waitingReaders > 0) 800a66c: 29 61 00 18 lw r1,(r11+24) 800a670: 44 20 00 04 be r1,r0,800a680 PIPE_WAKEUPREADERS(pipe); 800a674: 29 61 00 2c lw r1,(r11+44) 800a678: 37 82 00 2c addi r2,sp,44 800a67c: f8 00 03 7c calli 800b46c written += chunk; 800a680: b5 8d 60 00 add r12,r12,r13 /* Write of more than PIPE_BUF bytes can be interleaved */ chunk = 1; 800a684: 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) { 800a688: 55 cc ff dc bgu r14,r12,800a5f8 800a68c: 34 0d 00 00 mvi r13,0 800a690: e0 00 00 07 bi 800a6ac if (! PIPE_LOCK(pipe)) return -EINTR; if (pipe->Readers == 0) { ret = -EPIPE; 800a694: 34 0d ff e0 mvi r13,-32 const void *buffer, size_t count, rtems_libio_t *iop ) { int chunk, chunk1, written = 0, ret = 0; 800a698: 34 0c 00 00 mvi r12,0 800a69c: e0 00 00 04 bi 800a6ac chunk = count <= pipe->Size ? count : 1; while (written < count) { while (PIPE_SPACE(pipe) < chunk) { if (LIBIO_NODELAY(iop)) { ret = -EAGAIN; 800a6a0: 34 0d ff f5 mvi r13,-11 800a6a4: e0 00 00 02 bi 800a6ac pipe->waitingWriters --; if (ret != 0) goto out_locked; if (pipe->Readers == 0) { ret = -EPIPE; 800a6a8: 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); 800a6ac: 29 61 00 28 lw r1,(r11+40) 800a6b0: fb ff ea b8 calli 8005190 800a6b4: e0 00 00 02 bi 800a6bc PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) ret = -EINTR; if (! PIPE_LOCK(pipe)) { /* WARN waitingWriters not restored! */ ret = -EINTR; 800a6b8: 34 0d ff fc mvi r13,-4 <== NOT EXECUTED /* Signal SIGPIPE */ if (ret == -EPIPE) kill(getpid(), SIGPIPE); #endif if (written > 0) 800a6bc: 4c 0c 00 02 bge r0,r12,800a6c4 800a6c0: e0 00 00 02 bi 800a6c8 return written; return ret; 800a6c4: b9 a0 60 00 mv r12,r13 } 800a6c8: b9 80 08 00 mv r1,r12 800a6cc: 2b 9d 00 04 lw ra,(sp+4) 800a6d0: 2b 8b 00 28 lw r11,(sp+40) 800a6d4: 2b 8c 00 24 lw r12,(sp+36) 800a6d8: 2b 8d 00 20 lw r13,(sp+32) 800a6dc: 2b 8e 00 1c lw r14,(sp+28) 800a6e0: 2b 8f 00 18 lw r15,(sp+24) 800a6e4: 2b 90 00 14 lw r16,(sp+20) 800a6e8: 2b 91 00 10 lw r17,(sp+16) 800a6ec: 2b 92 00 0c lw r18,(sp+12) 800a6f0: 2b 93 00 08 lw r19,(sp+8) 800a6f4: 37 9c 00 2c addi sp,sp,44 800a6f8: c3 a0 00 00 ret =============================================================================== 08010e48 : ssize_t read( int fd, void *buffer, size_t count ) { 8010e48: 37 9c ff ec addi sp,sp,-20 8010e4c: 5b 8b 00 10 sw (sp+16),r11 8010e50: 5b 8c 00 0c sw (sp+12),r12 8010e54: 5b 8d 00 08 sw (sp+8),r13 8010e58: 5b 9d 00 04 sw (sp+4),ra ssize_t rc; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8010e5c: 78 04 08 01 mvhi r4,0x801 8010e60: 38 84 30 10 ori r4,r4,0x3010 ssize_t read( int fd, void *buffer, size_t count ) { 8010e64: b8 40 68 00 mv r13,r2 ssize_t rc; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8010e68: 28 82 00 00 lw r2,(r4+0) 8010e6c: 54 41 00 02 bgu r2,r1,8010e74 <== ALWAYS TAKEN 8010e70: e0 00 00 0c bi 8010ea0 <== NOT EXECUTED iop = rtems_libio_iop( fd ); 8010e74: 78 0b 08 01 mvhi r11,0x801 8010e78: 34 02 00 06 mvi r2,6 8010e7c: 39 6b 36 a0 ori r11,r11,0x36a0 8010e80: 5b 83 00 14 sw (sp+20),r3 8010e84: fb ff fe 08 calli 80106a4 <__ashlsi3> 8010e88: 29 6b 00 00 lw r11,(r11+0) rtems_libio_check_is_open( iop ); 8010e8c: 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 ); 8010e90: b5 61 58 00 add r11,r11,r1 rtems_libio_check_is_open( iop ); 8010e94: 29 61 00 18 lw r1,(r11+24) 8010e98: 20 22 01 00 andi r2,r1,0x100 8010e9c: 5c 40 00 04 bne r2,r0,8010eac 8010ea0: fb ff e8 fe calli 800b298 <__errno> 8010ea4: 34 02 00 09 mvi r2,9 8010ea8: e0 00 00 08 bi 8010ec8 rtems_libio_check_buffer( buffer ); 8010eac: 45 a0 00 05 be r13,r0,8010ec0 <== NEVER TAKEN rtems_libio_check_count( count ); 8010eb0: 34 0c 00 00 mvi r12,0 8010eb4: 44 60 00 19 be r3,r0,8010f18 rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ ); 8010eb8: 20 21 00 02 andi r1,r1,0x2 8010ebc: 5c 20 00 06 bne r1,r0,8010ed4 8010ec0: fb ff e8 f6 calli 800b298 <__errno> 8010ec4: 34 02 00 16 mvi r2,22 8010ec8: 58 22 00 00 sw (r1+0),r2 8010ecc: 34 0c ff ff mvi r12,-1 8010ed0: e0 00 00 12 bi 8010f18 /* * Now process the read(). */ rc = (*iop->pathinfo.handlers->read_h)( iop, buffer, count ); 8010ed4: 29 61 00 24 lw r1,(r11+36) 8010ed8: b9 a0 10 00 mv r2,r13 8010edc: 28 24 00 08 lw r4,(r1+8) 8010ee0: b9 60 08 00 mv r1,r11 8010ee4: d8 80 00 00 call r4 8010ee8: b8 20 60 00 mv r12,r1 if ( rc > 0 ) 8010eec: 4c 01 00 0b bge r0,r1,8010f18 iop->offset += rc; 8010ef0: 34 02 00 1f mvi r2,31 8010ef4: fb ff fe 13 calli 8010740 <__ashrsi3> 8010ef8: 29 62 00 14 lw r2,(r11+20) 8010efc: 29 64 00 10 lw r4,(r11+16) 8010f00: b5 82 10 00 add r2,r12,r2 8010f04: f5 82 18 00 cmpgu r3,r12,r2 8010f08: b4 24 08 00 add r1,r1,r4 8010f0c: b4 61 08 00 add r1,r3,r1 8010f10: 59 61 00 10 sw (r11+16),r1 8010f14: 59 62 00 14 sw (r11+20),r2 return rc; } 8010f18: b9 80 08 00 mv r1,r12 8010f1c: 2b 9d 00 04 lw ra,(sp+4) 8010f20: 2b 8b 00 10 lw r11,(sp+16) 8010f24: 2b 8c 00 0c lw r12,(sp+12) 8010f28: 2b 8d 00 08 lw r13,(sp+8) 8010f2c: 37 9c 00 14 addi sp,sp,20 8010f30: c3 a0 00 00 ret =============================================================================== 08004d98 : ssize_t readlink( const char *pathname, char *buf, size_t bufsize ) { 8004d98: 37 9c ff d8 addi sp,sp,-40 8004d9c: 5b 8b 00 14 sw (sp+20),r11 8004da0: 5b 8c 00 10 sw (sp+16),r12 8004da4: 5b 8d 00 0c sw (sp+12),r13 8004da8: 5b 8e 00 08 sw (sp+8),r14 8004dac: 5b 9d 00 04 sw (sp+4),ra 8004db0: b8 20 60 00 mv r12,r1 8004db4: b8 40 68 00 mv r13,r2 8004db8: b8 60 70 00 mv r14,r3 rtems_filesystem_location_info_t loc; int result; if (!buf) 8004dbc: 5c 40 00 06 bne r2,r0,8004dd4 rtems_set_errno_and_return_minus_one( EFAULT ); 8004dc0: f8 00 26 5d calli 800e734 <__errno> 8004dc4: 34 02 00 0e mvi r2,14 8004dc8: 58 22 00 00 sw (r1+0),r2 8004dcc: 34 0c ff ff mvi r12,-1 8004dd0: e0 00 00 20 bi 8004e50 result = rtems_filesystem_evaluate_path( pathname, strlen( pathname ), 8004dd4: f8 00 2e 09 calli 80105f8 8004dd8: 37 8b 00 18 addi r11,sp,24 8004ddc: b8 20 10 00 mv r2,r1 8004de0: 34 03 00 00 mvi r3,0 8004de4: b9 80 08 00 mv r1,r12 8004de8: b9 60 20 00 mv r4,r11 8004dec: 34 05 00 00 mvi r5,0 8004df0: fb ff fa e8 calli 8003990 0, &loc, false ); if ( result != 0 ) return -1; 8004df4: 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 ) 8004df8: 5c 20 00 16 bne r1,r0,8004e50 <== NEVER TAKEN return -1; if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){ 8004dfc: 2b 81 00 24 lw r1,(sp+36) 8004e00: 28 22 00 10 lw r2,(r1+16) 8004e04: b9 60 08 00 mv r1,r11 8004e08: d8 40 00 00 call r2 8004e0c: 34 02 00 04 mvi r2,4 8004e10: 44 22 00 07 be r1,r2,8004e2c rtems_filesystem_freenode( &loc ); 8004e14: b9 60 08 00 mv r1,r11 8004e18: fb ff fb 26 calli 8003ab0 rtems_set_errno_and_return_minus_one( EINVAL ); 8004e1c: f8 00 26 46 calli 800e734 <__errno> 8004e20: 34 02 00 16 mvi r2,22 8004e24: 58 22 00 00 sw (r1+0),r2 8004e28: e0 00 00 0a bi 8004e50 } result = (*loc.ops->readlink_h)( &loc, buf, bufsize ); 8004e2c: 2b 81 00 24 lw r1,(sp+36) 8004e30: b9 a0 10 00 mv r2,r13 8004e34: b9 c0 18 00 mv r3,r14 8004e38: 28 24 00 3c lw r4,(r1+60) 8004e3c: b9 60 08 00 mv r1,r11 8004e40: d8 80 00 00 call r4 8004e44: b8 20 60 00 mv r12,r1 rtems_filesystem_freenode( &loc ); 8004e48: b9 60 08 00 mv r1,r11 8004e4c: fb ff fb 19 calli 8003ab0 return result; } 8004e50: b9 80 08 00 mv r1,r12 8004e54: 2b 9d 00 04 lw ra,(sp+4) 8004e58: 2b 8b 00 14 lw r11,(sp+20) 8004e5c: 2b 8c 00 10 lw r12,(sp+16) 8004e60: 2b 8d 00 0c lw r13,(sp+12) 8004e64: 2b 8e 00 08 lw r14,(sp+8) 8004e68: 37 9c 00 28 addi sp,sp,40 8004e6c: c3 a0 00 00 ret =============================================================================== 0800365c : ssize_t readv( int fd, const struct iovec *iov, int iovcnt ) { 800365c: 37 9c ff e4 addi sp,sp,-28 8003660: 5b 8b 00 1c sw (sp+28),r11 8003664: 5b 8c 00 18 sw (sp+24),r12 8003668: 5b 8d 00 14 sw (sp+20),r13 800366c: 5b 8e 00 10 sw (sp+16),r14 8003670: 5b 8f 00 0c sw (sp+12),r15 8003674: 5b 90 00 08 sw (sp+8),r16 8003678: 5b 9d 00 04 sw (sp+4),ra 800367c: b8 60 78 00 mv r15,r3 int v; int bytes; rtems_libio_t *iop; bool all_zeros; rtems_libio_check_fd( fd ); 8003680: 78 03 08 01 mvhi r3,0x801 8003684: 38 63 40 10 ori r3,r3,0x4010 ssize_t readv( int fd, const struct iovec *iov, int iovcnt ) { 8003688: b8 40 68 00 mv r13,r2 int v; int bytes; rtems_libio_t *iop; bool all_zeros; rtems_libio_check_fd( fd ); 800368c: 28 62 00 00 lw r2,(r3+0) 8003690: 54 41 00 02 bgu r2,r1,8003698 8003694: e0 00 00 0a bi 80036bc iop = rtems_libio_iop( fd ); 8003698: 78 0b 08 01 mvhi r11,0x801 800369c: 34 02 00 06 mvi r2,6 80036a0: 39 6b 46 a0 ori r11,r11,0x46a0 80036a4: f8 00 38 a2 calli 801192c <__ashlsi3> 80036a8: 29 6c 00 00 lw r12,(r11+0) 80036ac: b5 81 60 00 add r12,r12,r1 rtems_libio_check_is_open( iop ); 80036b0: 29 81 00 18 lw r1,(r12+24) 80036b4: 20 22 01 00 andi r2,r1,0x100 80036b8: 5c 40 00 04 bne r2,r0,80036c8 80036bc: f8 00 22 ea calli 800c264 <__errno> 80036c0: 34 02 00 09 mvi r2,9 80036c4: e0 00 00 16 bi 800371c rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ ); 80036c8: 20 21 00 02 andi r1,r1,0x2 80036cc: 44 20 00 12 be r1,r0,8003714 <== NEVER TAKEN /* * Argument validation on IO vector */ if ( !iov ) 80036d0: 45 a0 00 11 be r13,r0,8003714 rtems_set_errno_and_return_minus_one( EINVAL ); if ( iovcnt <= 0 ) 80036d4: 49 e0 00 02 bg r15,r0,80036dc 80036d8: e0 00 00 0f bi 8003714 rtems_set_errno_and_return_minus_one( EINVAL ); if ( iovcnt > IOV_MAX ) 80036dc: 34 01 04 00 mvi r1,1024 80036e0: 4c 2f 00 02 bge r1,r15,80036e8 <== ALWAYS TAKEN 80036e4: e0 00 00 0c bi 8003714 <== NOT EXECUTED 80036e8: b9 a0 08 00 mv r1,r13 80036ec: 34 02 00 01 mvi r2,1 80036f0: 34 04 00 00 mvi r4,0 80036f4: 34 03 00 00 mvi r3,0 80036f8: e0 00 00 02 bi 8003700 if ( iov[v].iov_base == 0 ) rtems_set_errno_and_return_minus_one( EINVAL ); /* check for wrap */ old = total; total += iov[v].iov_len; 80036fc: b8 c0 18 00 mv r3,r6 /* * iov[v].iov_len cannot be less than 0 because size_t is unsigned. * So we only check for zero. */ if ( iov[v].iov_base == 0 ) 8003700: 28 25 00 00 lw r5,(r1+0) 8003704: 44 a0 00 04 be r5,r0,8003714 rtems_set_errno_and_return_minus_one( EINVAL ); /* check for wrap */ old = total; total += iov[v].iov_len; 8003708: 28 25 00 04 lw r5,(r1+4) 800370c: b4 65 30 00 add r6,r3,r5 if ( total < old ) 8003710: 4c c3 00 05 bge r6,r3,8003724 rtems_set_errno_and_return_minus_one( EINVAL ); 8003714: f8 00 22 d4 calli 800c264 <__errno> 8003718: 34 02 00 16 mvi r2,22 800371c: 58 22 00 00 sw (r1+0),r2 8003720: e0 00 00 24 bi 80037b0 if ( iov[v].iov_len ) all_zeros = false; 8003724: 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++ ) { 8003728: 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; 800372c: c8 05 28 00 sub r5,r0,r5 8003730: 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++ ) { 8003734: 34 21 00 08 addi r1,r1,8 8003738: 49 e4 ff f1 bg r15,r4,80036fc * 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; 800373c: 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 ) { 8003740: 5c 40 00 1d bne r2,r0,80037b4 8003744: 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)( 8003748: 29 81 00 24 lw r1,(r12+36) 800374c: 29 a2 00 00 lw r2,(r13+0) 8003750: 29 a3 00 04 lw r3,(r13+4) 8003754: 28 24 00 08 lw r4,(r1+8) 8003758: b9 80 08 00 mv r1,r12 800375c: d8 80 00 00 call r4 8003760: b8 20 70 00 mv r14,r1 iop, iov[v].iov_base, iov[v].iov_len ); if ( bytes < 0 ) 8003764: 48 01 00 13 bg r0,r1,80037b0 <== NEVER TAKEN return -1; if ( bytes > 0 ) { 8003768: 44 20 00 0c be r1,r0,8003798 <== NEVER TAKEN iop->offset += bytes; 800376c: 34 02 00 1f mvi r2,31 8003770: f8 00 38 96 calli 80119c8 <__ashrsi3> 8003774: 29 82 00 14 lw r2,(r12+20) 8003778: 29 84 00 10 lw r4,(r12+16) total += bytes; 800377c: b5 6e 58 00 add r11,r11,r14 if ( bytes < 0 ) return -1; if ( bytes > 0 ) { iop->offset += bytes; 8003780: b5 c2 10 00 add r2,r14,r2 8003784: f5 c2 18 00 cmpgu r3,r14,r2 8003788: b4 24 08 00 add r1,r1,r4 800378c: b4 61 08 00 add r1,r3,r1 8003790: 59 81 00 10 sw (r12+16),r1 8003794: 59 82 00 14 sw (r12+20),r2 total += bytes; } if (bytes != iov[ v ].iov_len) 8003798: 29 a1 00 04 lw r1,(r13+4) 800379c: 5d c1 00 06 bne r14,r1,80037b4 <== NEVER TAKEN } /* * Now process the readv(). */ for ( total=0, v=0 ; v < iovcnt ; v++ ) { 80037a0: 36 10 00 01 addi r16,r16,1 80037a4: 35 ad 00 08 addi r13,r13,8 80037a8: 49 f0 ff e8 bg r15,r16,8003748 80037ac: e0 00 00 02 bi 80037b4 iov[v].iov_base, iov[v].iov_len ); if ( bytes < 0 ) return -1; 80037b0: 34 0b ff ff mvi r11,-1 if (bytes != iov[ v ].iov_len) break; } return total; } 80037b4: b9 60 08 00 mv r1,r11 80037b8: 2b 9d 00 04 lw ra,(sp+4) 80037bc: 2b 8b 00 1c lw r11,(sp+28) 80037c0: 2b 8c 00 18 lw r12,(sp+24) 80037c4: 2b 8d 00 14 lw r13,(sp+20) 80037c8: 2b 8e 00 10 lw r14,(sp+16) 80037cc: 2b 8f 00 0c lw r15,(sp+12) 80037d0: 2b 90 00 08 lw r16,(sp+8) 80037d4: 37 9c 00 1c addi sp,sp,28 80037d8: c3 a0 00 00 ret =============================================================================== 08010fdc : void *realloc( void *ptr, size_t size ) { 8010fdc: 37 9c ff e8 addi sp,sp,-24 8010fe0: 5b 8b 00 14 sw (sp+20),r11 8010fe4: 5b 8c 00 10 sw (sp+16),r12 8010fe8: 5b 8d 00 0c sw (sp+12),r13 8010fec: 5b 8e 00 08 sw (sp+8),r14 8010ff0: 5b 9d 00 04 sw (sp+4),ra 8010ff4: b8 20 58 00 mv r11,r1 uintptr_t old_size; char *new_area; MSBUMP(realloc_calls, 1); 8010ff8: 78 01 08 01 mvhi r1,0x801 8010ffc: 38 21 36 b8 ori r1,r1,0x36b8 void *realloc( void *ptr, size_t size ) { 8011000: b8 40 60 00 mv r12,r2 uintptr_t old_size; char *new_area; MSBUMP(realloc_calls, 1); 8011004: 28 22 00 10 lw r2,(r1+16) 8011008: 34 42 00 01 addi r2,r2,1 801100c: 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())) { 8011010: 78 01 08 01 mvhi r1,0x801 8011014: 38 21 39 9c ori r1,r1,0x399c 8011018: 28 22 00 00 lw r2,(r1+0) 801101c: 34 01 00 03 mvi r1,3 8011020: 5c 41 00 09 bne r2,r1,8011044 <== NEVER TAKEN if (_Thread_Dispatch_disable_level > 0) 8011024: 78 01 08 01 mvhi r1,0x801 8011028: 38 21 38 1c ori r1,r1,0x381c 801102c: 28 22 00 00 lw r2,(r1+0) 8011030: 5c 40 00 33 bne r2,r0,80110fc <== NEVER TAKEN return (void *) 0; if (_ISR_Nest_level > 0) 8011034: 78 01 08 01 mvhi r1,0x801 8011038: 38 21 39 e8 ori r1,r1,0x39e8 801103c: 28 21 00 08 lw r1,(r1+8) 8011040: 5c 22 00 2f bne r1,r2,80110fc <== NEVER TAKEN } /* * Continue with realloc(). */ if ( !ptr ) 8011044: 5d 60 00 05 bne r11,r0,8011058 return malloc( size ); 8011048: b9 80 08 00 mv r1,r12 801104c: fb ff c1 af calli 8001708 8011050: b8 20 58 00 mv r11,r1 8011054: e0 00 00 2b bi 8011100 if ( !size ) { 8011058: 5d 80 00 04 bne r12,r0,8011068 <== ALWAYS TAKEN free( ptr ); 801105c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8011060: fb ff c0 b0 calli 8001320 <== NOT EXECUTED 8011064: e0 00 00 26 bi 80110fc <== NOT EXECUTED return (void *) 0; } if ( !_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, ptr, &old_size) ) { 8011068: 78 0d 08 01 mvhi r13,0x801 801106c: 39 ad 30 1c ori r13,r13,0x301c 8011070: 29 a1 00 00 lw r1,(r13+0) 8011074: b9 60 10 00 mv r2,r11 8011078: 37 83 00 18 addi r3,sp,24 801107c: f8 00 00 64 calli 801120c <_Protected_heap_Get_block_size> 8011080: 5c 20 00 05 bne r1,r0,8011094 errno = EINVAL; 8011084: fb ff e8 85 calli 800b298 <__errno> 8011088: 34 02 00 16 mvi r2,22 801108c: 58 22 00 00 sw (r1+0),r2 8011090: e0 00 00 1b bi 80110fc } /* * Now resize it. */ if ( _Protected_heap_Resize_block( RTEMS_Malloc_Heap, ptr, size ) ) { 8011094: 29 a1 00 00 lw r1,(r13+0) 8011098: b9 60 10 00 mv r2,r11 801109c: b9 80 18 00 mv r3,r12 80110a0: f8 00 00 73 calli 801126c <_Protected_heap_Resize_block> 80110a4: b8 20 70 00 mv r14,r1 80110a8: 5c 20 00 16 bne r1,r0,8011100 * 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 ); 80110ac: b9 80 08 00 mv r1,r12 80110b0: fb ff c1 96 calli 8001708 MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */ 80110b4: 78 02 08 01 mvhi r2,0x801 80110b8: 38 42 36 b8 ori r2,r2,0x36b8 * 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 ); 80110bc: b8 20 68 00 mv r13,r1 MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */ 80110c0: 28 41 00 04 lw r1,(r2+4) 80110c4: 34 21 ff ff addi r1,r1,-1 80110c8: 58 41 00 04 sw (r2+4),r1 if ( !new_area ) { 80110cc: 45 ae 00 0c be r13,r14,80110fc return (void *) 0; } memcpy( new_area, ptr, (size < old_size) ? size : old_size ); 80110d0: 2b 81 00 18 lw r1,(sp+24) 80110d4: b9 80 18 00 mv r3,r12 80110d8: 50 2c 00 02 bgeu r1,r12,80110e0 <== NEVER TAKEN 80110dc: b8 20 18 00 mv r3,r1 80110e0: b9 60 10 00 mv r2,r11 80110e4: b9 a0 08 00 mv r1,r13 80110e8: fb ff eb 22 calli 800bd70 free( ptr ); 80110ec: b9 60 08 00 mv r1,r11 80110f0: fb ff c0 8c calli 8001320 return new_area; 80110f4: b9 a0 58 00 mv r11,r13 80110f8: e0 00 00 02 bi 8011100 new_area = malloc( size ); MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */ if ( !new_area ) { return (void *) 0; 80110fc: 34 0b 00 00 mvi r11,0 memcpy( new_area, ptr, (size < old_size) ? size : old_size ); free( ptr ); return new_area; } 8011100: b9 60 08 00 mv r1,r11 8011104: 2b 9d 00 04 lw ra,(sp+4) 8011108: 2b 8b 00 14 lw r11,(sp+20) 801110c: 2b 8c 00 10 lw r12,(sp+16) 8011110: 2b 8d 00 0c lw r13,(sp+12) 8011114: 2b 8e 00 08 lw r14,(sp+8) 8011118: 37 9c 00 18 addi sp,sp,24 801111c: c3 a0 00 00 ret =============================================================================== 0800281c : #include int rmdir( const char *pathname ) { 800281c: 37 9c ff c0 addi sp,sp,-64 8002820: 5b 8b 00 14 sw (sp+20),r11 8002824: 5b 8c 00 10 sw (sp+16),r12 8002828: 5b 8d 00 0c sw (sp+12),r13 800282c: 5b 8e 00 08 sw (sp+8),r14 8002830: 5b 9d 00 04 sw (sp+4),ra 8002834: 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 ); 8002838: fb ff fb d2 calli 8001780 800283c: b8 20 58 00 mv r11,r1 8002840: 37 84 00 2c addi r4,sp,44 if ( parentpathlen == 0 ) 8002844: 5c 20 00 07 bne r1,r0,8002860 rtems_filesystem_get_start_loc( pathname, &i, &parentloc ); 8002848: b9 c0 08 00 mv r1,r14 800284c: 37 82 00 40 addi r2,sp,64 8002850: b8 80 18 00 mv r3,r4 8002854: f8 00 00 4e calli 800298c const char *name; rtems_filesystem_location_info_t parentloc; rtems_filesystem_location_info_t loc; int i; int result; bool free_parentloc = false; 8002858: 34 0d 00 00 mvi r13,0 800285c: e0 00 00 09 bi 8002880 parentpathlen = rtems_filesystem_dirname ( pathname ); if ( parentpathlen == 0 ) rtems_filesystem_get_start_loc( pathname, &i, &parentloc ); else { result = rtems_filesystem_evaluate_path(pathname, parentpathlen, 8002860: b9 c0 08 00 mv r1,r14 8002864: b9 60 10 00 mv r2,r11 8002868: 34 03 00 02 mvi r3,2 800286c: 34 05 00 00 mvi r5,0 8002870: fb ff fb a9 calli 8001714 RTEMS_LIBIO_PERMS_WRITE, &parentloc, false ); if ( result != 0 ) return -1; 8002874: 34 0c ff ff mvi r12,-1 else { result = rtems_filesystem_evaluate_path(pathname, parentpathlen, RTEMS_LIBIO_PERMS_WRITE, &parentloc, false ); if ( result != 0 ) 8002878: 5c 20 00 3d bne r1,r0,800296c <== NEVER TAKEN return -1; free_parentloc = true; 800287c: 34 0d 00 01 mvi r13,1 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 8002880: 2b 81 00 2c lw r1,(sp+44) name = pathname + parentpathlen; 8002884: b5 cb 58 00 add r11,r14,r11 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 8002888: 5b 81 00 18 sw (sp+24),r1 800288c: 2b 81 00 30 lw r1,(sp+48) 8002890: 5b 81 00 1c sw (sp+28),r1 8002894: 2b 81 00 34 lw r1,(sp+52) 8002898: 5b 81 00 20 sw (sp+32),r1 800289c: 2b 81 00 38 lw r1,(sp+56) 80028a0: 5b 81 00 24 sw (sp+36),r1 80028a4: 2b 81 00 3c lw r1,(sp+60) 80028a8: 5b 81 00 28 sw (sp+40),r1 name = pathname + parentpathlen; name += rtems_filesystem_prefix_separators( name, strlen( name ) ); 80028ac: b9 60 08 00 mv r1,r11 80028b0: f8 00 28 d1 calli 800cbf4 80028b4: b8 20 10 00 mv r2,r1 80028b8: b9 60 08 00 mv r1,r11 80028bc: fb ff fb c5 calli 80017d0 80028c0: b5 61 60 00 add r12,r11,r1 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 80028c4: b9 80 08 00 mv r1,r12 80028c8: f8 00 28 cb calli 800cbf4 80028cc: 37 8b 00 18 addi r11,sp,24 80028d0: b8 20 10 00 mv r2,r1 80028d4: 34 03 00 00 mvi r3,0 80028d8: b9 80 08 00 mv r1,r12 80028dc: b9 60 20 00 mv r4,r11 80028e0: 34 05 00 00 mvi r5,0 80028e4: fb ff fb 6a calli 800168c 0, &loc, false ); if ( result != 0 ) { 80028e8: 44 20 00 05 be r1,r0,80028fc if ( free_parentloc ) rtems_filesystem_freenode( &parentloc ); return -1; 80028ec: 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 ); 80028f0: 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 ) 80028f4: 45 a0 00 1e be r13,r0,800296c 80028f8: e0 00 00 1c bi 8002968 } /* * Verify you can remove this node as a directory. */ if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 80028fc: 2b 81 00 24 lw r1,(sp+36) 8002900: 28 22 00 10 lw r2,(r1+16) 8002904: b9 60 08 00 mv r1,r11 8002908: d8 40 00 00 call r2 800290c: 34 02 00 01 mvi r2,1 8002910: 44 22 00 0b be r1,r2,800293c rtems_filesystem_freenode( &loc ); 8002914: b9 60 08 00 mv r1,r11 8002918: fb ff fb c7 calli 8001834 if ( free_parentloc ) 800291c: 45 a0 00 03 be r13,r0,8002928 <== NEVER TAKEN rtems_filesystem_freenode( &parentloc ); 8002920: 37 81 00 2c addi r1,sp,44 8002924: fb ff fb c4 calli 8001834 rtems_set_errno_and_return_minus_one( ENOTDIR ); 8002928: f8 00 24 52 calli 800ba70 <__errno> 800292c: 34 02 00 14 mvi r2,20 8002930: 58 22 00 00 sw (r1+0),r2 8002934: 34 0c ff ff mvi r12,-1 8002938: e0 00 00 0d bi 800296c /* * Use the filesystems rmnod to remove the node. */ result = (*loc.handlers->rmnod_h)( &parentloc, &loc ); 800293c: 2b 81 00 20 lw r1,(sp+32) 8002940: 37 8e 00 2c addi r14,sp,44 8002944: b9 60 10 00 mv r2,r11 8002948: 28 23 00 34 lw r3,(r1+52) 800294c: b9 c0 08 00 mv r1,r14 8002950: d8 60 00 00 call r3 8002954: b8 20 60 00 mv r12,r1 rtems_filesystem_freenode( &loc ); 8002958: b9 60 08 00 mv r1,r11 800295c: fb ff fb b6 calli 8001834 if ( free_parentloc ) 8002960: 45 a0 00 03 be r13,r0,800296c rtems_filesystem_freenode( &parentloc ); 8002964: b9 c0 08 00 mv r1,r14 8002968: fb ff fb b3 calli 8001834 return result; } 800296c: b9 80 08 00 mv r1,r12 8002970: 2b 9d 00 04 lw ra,(sp+4) 8002974: 2b 8b 00 14 lw r11,(sp+20) 8002978: 2b 8c 00 10 lw r12,(sp+16) 800297c: 2b 8d 00 0c lw r13,(sp+12) 8002980: 2b 8e 00 08 lw r14,(sp+8) 8002984: 37 9c 00 40 addi sp,sp,64 8002988: c3 a0 00 00 ret =============================================================================== 08003568 : rtems_chain_control *chain, rtems_chain_node *node, rtems_id task, rtems_event_set events ) { 8003568: 37 9c ff f4 addi sp,sp,-12 800356c: 5b 8b 00 0c sw (sp+12),r11 8003570: 5b 8c 00 08 sw (sp+8),r12 8003574: 5b 9d 00 04 sw (sp+4),ra 8003578: b8 60 60 00 mv r12,r3 800357c: b8 80 58 00 mv r11,r4 RTEMS_INLINE_ROUTINE bool rtems_chain_append_with_empty_check( rtems_chain_control *chain, rtems_chain_node *node ) { return _Chain_Append_with_empty_check( chain, node ); 8003580: f8 00 01 8e calli 8003bb8 <_Chain_Append_with_empty_check> rtems_status_code sc = RTEMS_SUCCESSFUL; 8003584: 34 05 00 00 mvi r5,0 bool was_empty = rtems_chain_append_with_empty_check( chain, node ); if ( was_empty ) { 8003588: 44 20 00 05 be r1,r0,800359c <== NEVER TAKEN sc = rtems_event_send( task, events ); 800358c: b9 80 08 00 mv r1,r12 8003590: b9 60 10 00 mv r2,r11 8003594: f8 00 15 8c calli 8008bc4 8003598: b8 20 28 00 mv r5,r1 } return sc; } 800359c: b8 a0 08 00 mv r1,r5 80035a0: 2b 9d 00 04 lw ra,(sp+4) 80035a4: 2b 8b 00 0c lw r11,(sp+12) 80035a8: 2b 8c 00 08 lw r12,(sp+8) 80035ac: 37 9c 00 0c addi sp,sp,12 80035b0: c3 a0 00 00 ret =============================================================================== 080035b4 : rtems_chain_control *chain, rtems_id task, rtems_event_set events, rtems_chain_node **node ) { 80035b4: 37 9c ff f4 addi sp,sp,-12 80035b8: 5b 8b 00 0c sw (sp+12),r11 80035bc: 5b 8c 00 08 sw (sp+8),r12 80035c0: 5b 9d 00 04 sw (sp+4),ra 80035c4: b8 40 60 00 mv r12,r2 RTEMS_INLINE_ROUTINE bool rtems_chain_get_with_empty_check( rtems_chain_control *chain, rtems_chain_node **node ) { return _Chain_Get_with_empty_check( chain, node ); 80035c8: b8 80 10 00 mv r2,r4 80035cc: b8 60 58 00 mv r11,r3 80035d0: f8 00 01 9f calli 8003c4c <_Chain_Get_with_empty_check> rtems_status_code sc = RTEMS_SUCCESSFUL; 80035d4: 34 04 00 00 mvi r4,0 bool is_empty = rtems_chain_get_with_empty_check( chain, node ); if ( is_empty ) { 80035d8: 44 20 00 05 be r1,r0,80035ec <== NEVER TAKEN sc = rtems_event_send( task, events ); 80035dc: b9 80 08 00 mv r1,r12 80035e0: b9 60 10 00 mv r2,r11 80035e4: f8 00 15 78 calli 8008bc4 80035e8: b8 20 20 00 mv r4,r1 } return sc; } 80035ec: b8 80 08 00 mv r1,r4 80035f0: 2b 9d 00 04 lw ra,(sp+4) 80035f4: 2b 8b 00 0c lw r11,(sp+12) 80035f8: 2b 8c 00 08 lw r12,(sp+8) 80035fc: 37 9c 00 0c addi sp,sp,12 8003600: c3 a0 00 00 ret =============================================================================== 08003604 : rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 8003604: 37 9c ff e4 addi sp,sp,-28 8003608: 5b 8b 00 18 sw (sp+24),r11 800360c: 5b 8c 00 14 sw (sp+20),r12 8003610: 5b 8d 00 10 sw (sp+16),r13 8003614: 5b 8e 00 0c sw (sp+12),r14 8003618: 5b 8f 00 08 sw (sp+8),r15 800361c: 5b 9d 00 04 sw (sp+4),ra 8003620: b8 20 78 00 mv r15,r1 8003624: b8 40 70 00 mv r14,r2 8003628: b8 60 68 00 mv r13,r3 800362c: b8 80 60 00 mv r12,r4 8003630: e0 00 00 08 bi 8003650 while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL ) { rtems_event_set out; sc = rtems_event_receive( 8003634: b9 c0 08 00 mv r1,r14 8003638: 34 02 00 00 mvi r2,0 800363c: b9 a0 18 00 mv r3,r13 8003640: 37 84 00 1c addi r4,sp,28 8003644: fb ff fd d2 calli 8002d8c 8003648: b8 20 28 00 mv r5,r1 ) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( 800364c: 5c 2b 00 06 bne r1,r11,8003664 <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 8003650: b9 e0 08 00 mv r1,r15 8003654: f8 00 01 8f calli 8003c90 <_Chain_Get> 8003658: b8 20 58 00 mv r11,r1 sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 800365c: 44 20 ff f6 be r1,r0,8003634 8003660: 34 05 00 00 mvi r5,0 } *node_ptr = node; return sc; } 8003664: b8 a0 08 00 mv r1,r5 timeout, &out ); } *node_ptr = node; 8003668: 59 8b 00 00 sw (r12+0),r11 return sc; } 800366c: 2b 9d 00 04 lw ra,(sp+4) 8003670: 2b 8b 00 18 lw r11,(sp+24) 8003674: 2b 8c 00 14 lw r12,(sp+20) 8003678: 2b 8d 00 10 lw r13,(sp+16) 800367c: 2b 8e 00 0c lw r14,(sp+12) 8003680: 2b 8f 00 08 lw r15,(sp+8) 8003684: 37 9c 00 1c addi sp,sp,28 8003688: c3 a0 00 00 ret =============================================================================== 0800368c : rtems_chain_control *chain, rtems_chain_node *node, rtems_id task, rtems_event_set events ) { 800368c: 37 9c ff f4 addi sp,sp,-12 8003690: 5b 8b 00 0c sw (sp+12),r11 8003694: 5b 8c 00 08 sw (sp+8),r12 8003698: 5b 9d 00 04 sw (sp+4),ra 800369c: b8 60 60 00 mv r12,r3 80036a0: b8 80 58 00 mv r11,r4 RTEMS_INLINE_ROUTINE bool rtems_chain_prepend_with_empty_check( rtems_chain_control *chain, rtems_chain_node *node ) { return _Chain_Prepend_with_empty_check( chain, node ); 80036a4: f8 00 01 95 calli 8003cf8 <_Chain_Prepend_with_empty_check> rtems_status_code sc = RTEMS_SUCCESSFUL; 80036a8: 34 05 00 00 mvi r5,0 bool was_empty = rtems_chain_prepend_with_empty_check( chain, node ); if (was_empty) { 80036ac: 44 20 00 05 be r1,r0,80036c0 <== NEVER TAKEN sc = rtems_event_send( task, events ); 80036b0: b9 80 08 00 mv r1,r12 80036b4: b9 60 10 00 mv r2,r11 80036b8: f8 00 15 43 calli 8008bc4 80036bc: b8 20 28 00 mv r5,r1 } return sc; } 80036c0: b8 a0 08 00 mv r1,r5 80036c4: 2b 9d 00 04 lw ra,(sp+4) 80036c8: 2b 8b 00 0c lw r11,(sp+12) 80036cc: 2b 8c 00 08 lw r12,(sp+8) 80036d0: 37 9c 00 0c addi sp,sp,12 80036d4: c3 a0 00 00 ret =============================================================================== 08010a00 : * error code - if unsuccessful */ rtems_status_code rtems_clock_set_nanoseconds_extension( rtems_nanoseconds_extension_routine routine ) { 8010a00: b8 20 18 00 mv r3,r1 if ( !routine ) return RTEMS_INVALID_ADDRESS; 8010a04: 34 01 00 09 mvi r1,9 */ rtems_status_code rtems_clock_set_nanoseconds_extension( rtems_nanoseconds_extension_routine routine ) { if ( !routine ) 8010a08: 44 60 00 05 be r3,r0,8010a1c <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _Watchdog_Nanoseconds_since_tick_handler = routine; 8010a0c: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED 8010a10: 38 42 ed b0 ori r2,r2,0xedb0 <== NOT EXECUTED 8010a14: 58 43 00 00 sw (r2+0),r3 <== NOT EXECUTED return RTEMS_SUCCESSFUL; 8010a18: 34 01 00 00 mvi r1,0 <== NOT EXECUTED } 8010a1c: c3 a0 00 00 ret =============================================================================== 08001a40 : void rtems_cpu_usage_report_with_plugin( void *context, rtems_printk_plugin_t print ) { 8001a40: 37 9c ff 84 addi sp,sp,-124 8001a44: 5b 8b 00 44 sw (sp+68),r11 8001a48: 5b 8c 00 40 sw (sp+64),r12 8001a4c: 5b 8d 00 3c sw (sp+60),r13 8001a50: 5b 8e 00 38 sw (sp+56),r14 8001a54: 5b 8f 00 34 sw (sp+52),r15 8001a58: 5b 90 00 30 sw (sp+48),r16 8001a5c: 5b 91 00 2c sw (sp+44),r17 8001a60: 5b 92 00 28 sw (sp+40),r18 8001a64: 5b 93 00 24 sw (sp+36),r19 8001a68: 5b 94 00 20 sw (sp+32),r20 8001a6c: 5b 95 00 1c sw (sp+28),r21 8001a70: 5b 96 00 18 sw (sp+24),r22 8001a74: 5b 97 00 14 sw (sp+20),r23 8001a78: 5b 98 00 10 sw (sp+16),r24 8001a7c: 5b 99 00 0c sw (sp+12),r25 8001a80: 5b 9b 00 08 sw (sp+8),fp 8001a84: 5b 9d 00 04 sw (sp+4),ra 8001a88: b8 20 70 00 mv r14,r1 8001a8c: b8 40 68 00 mv r13,r2 Timestamp_Control uptime, total, ran; #else uint32_t total_units = 0; #endif if ( !print ) 8001a90: 44 40 00 60 be r2,r0,8001c10 <== 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 ); 8001a94: 37 8b 00 70 addi r11,sp,112 8001a98: b9 60 08 00 mv r1,r11 8001a9c: f8 00 0f 5d calli 8005810 <_TOD_Get_uptime> _Timestamp_Subtract( &CPU_usage_Uptime_at_last_reset, &uptime, &total ); 8001aa0: 37 90 00 68 addi r16,sp,104 8001aa4: 78 01 08 02 mvhi r1,0x802 8001aa8: 38 21 78 54 ori r1,r1,0x7854 8001aac: b9 60 10 00 mv r2,r11 8001ab0: ba 00 18 00 mv r3,r16 8001ab4: f8 00 1a 5c calli 8008424 <_Timespec_Subtract> } } } #endif (*print)( 8001ab8: 78 02 08 01 mvhi r2,0x801 8001abc: b9 c0 08 00 mv r1,r14 8001ac0: 38 42 cc 30 ori r2,r2,0xcc30 8001ac4: 78 0c 08 02 mvhi r12,0x802 if ( !the_thread ) continue; rtems_object_get_name( the_thread->Object.id, sizeof(name), name ); (*print)( 8001ac8: 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 ) { 8001acc: 78 0f 08 02 mvhi r15,0x802 /* * Print the information */ (*print)( context, 8001ad0: 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( 8001ad4: 78 11 08 02 mvhi r17,0x802 } } } #endif (*print)( 8001ad8: d9 a0 00 00 call r13 8001adc: 39 8c 75 c4 ori r12,r12,0x75c4 the_thread = (Thread_Control *)information->local_table[ i ]; if ( !the_thread ) continue; rtems_object_get_name( the_thread->Object.id, sizeof(name), name ); 8001ae0: 37 98 00 48 addi r24,sp,72 (*print)( 8001ae4: 3a 73 cd a4 ori r19,r19,0xcda4 /* * 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 ) { 8001ae8: 39 ef 78 30 ori r15,r15,0x7830 _Timestamp_Subtract( &_Thread_Time_of_last_context_switch, &uptime, &used ); _Timestamp_Add_to( &ran, &used ); }; _Timestamp_Divide( &ran, &total, &ival, &fval ); 8001aec: 37 97 00 60 addi r23,sp,96 8001af0: 37 9b 00 78 addi fp,sp,120 /* * Print the information */ (*print)( context, 8001af4: 3a 52 cd b8 ori r18,r18,0xcdb8 * 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( 8001af8: 3a 31 76 d4 ori r17,r17,0x76d4 8001afc: b9 60 c8 00 mv r25,r11 8001b00: 37 96 00 58 addi r22,sp,88 #if defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 8001b04: 29 81 00 00 lw r1,(r12+0) if ( information ) { 8001b08: 34 15 00 04 mvi r21,4 8001b0c: 34 14 00 01 mvi r20,1 #if defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 8001b10: 28 30 00 04 lw r16,(r1+4) if ( information ) { 8001b14: 5e 00 00 2f bne r16,r0,8001bd0 8001b18: e0 00 00 30 bi 8001bd8 for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 8001b1c: 2a 01 00 1c lw r1,(r16+28) 8001b20: b4 35 08 00 add r1,r1,r21 8001b24: 28 2b 00 00 lw r11,(r1+0) if ( !the_thread ) 8001b28: 45 60 00 28 be r11,r0,8001bc8 <== NEVER TAKEN continue; rtems_object_get_name( the_thread->Object.id, sizeof(name), name ); 8001b2c: 29 61 00 08 lw r1,(r11+8) 8001b30: 34 02 00 0d mvi r2,13 8001b34: bb 00 18 00 mv r3,r24 8001b38: f8 00 0a 02 calli 8004340 (*print)( 8001b3c: 29 63 00 08 lw r3,(r11+8) 8001b40: ba 60 10 00 mv r2,r19 8001b44: b9 c0 08 00 mv r1,r14 8001b48: bb 00 20 00 mv r4,r24 8001b4c: 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; 8001b50: 29 61 00 84 lw r1,(r11+132) 8001b54: 5b 81 00 60 sw (sp+96),r1 8001b58: 29 61 00 88 lw r1,(r11+136) 8001b5c: 5b 81 00 64 sw (sp+100),r1 if ( _Thread_Executing->Object.id == the_thread->Object.id ) { 8001b60: 29 e1 00 0c lw r1,(r15+12) 8001b64: 28 22 00 08 lw r2,(r1+8) 8001b68: 29 61 00 08 lw r1,(r11+8) 8001b6c: 5c 41 00 08 bne r2,r1,8001b8c Timestamp_Control used; _Timestamp_Subtract( 8001b70: ba 20 08 00 mv r1,r17 8001b74: bb 20 10 00 mv r2,r25 8001b78: ba c0 18 00 mv r3,r22 8001b7c: f8 00 1a 2a calli 8008424 <_Timespec_Subtract> &_Thread_Time_of_last_context_switch, &uptime, &used ); _Timestamp_Add_to( &ran, &used ); 8001b80: ba e0 08 00 mv r1,r23 8001b84: ba c0 10 00 mv r2,r22 8001b88: f8 00 19 b6 calli 8008260 <_Timespec_Add_to> }; _Timestamp_Divide( &ran, &total, &ival, &fval ); 8001b8c: 37 83 00 7c addi r3,sp,124 8001b90: bb 60 20 00 mv r4,fp 8001b94: ba e0 08 00 mv r1,r23 8001b98: 37 82 00 68 addi r2,sp,104 8001b9c: f8 00 19 ca calli 80082c4 <_Timespec_Divide> /* * Print the information */ (*print)( context, 8001ba0: 2b 81 00 64 lw r1,(sp+100) 8001ba4: 34 02 03 e8 mvi r2,1000 8001ba8: f8 00 67 d8 calli 801bb08 <__udivsi3> 8001bac: 2b 83 00 60 lw r3,(sp+96) 8001bb0: 2b 85 00 7c lw r5,(sp+124) 8001bb4: 2b 86 00 78 lw r6,(sp+120) 8001bb8: b8 20 20 00 mv r4,r1 8001bbc: ba 40 10 00 mv r2,r18 8001bc0: b9 c0 08 00 mv r1,r14 8001bc4: d9 a0 00 00 call r13 continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; if ( information ) { for ( i=1 ; i <= information->maximum ; i++ ) { 8001bc8: 36 94 00 01 addi r20,r20,1 8001bcc: 36 b5 00 04 addi r21,r21,4 8001bd0: 2e 01 00 10 lhu r1,(r16+16) 8001bd4: 50 34 ff d2 bgeu r1,r20,8001b1c " ID | NAME | TICKS | PERCENT\n" #endif "------------+----------------------------------------+---------------+---------\n" ); for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 8001bd8: 78 01 08 02 mvhi r1,0x802 continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; if ( information ) { for ( i=1 ; i <= information->maximum ; i++ ) { 8001bdc: 35 8c 00 04 addi r12,r12,4 " ID | NAME | TICKS | PERCENT\n" #endif "------------+----------------------------------------+---------------+---------\n" ); for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 8001be0: 38 21 75 d0 ori r1,r1,0x75d0 8001be4: 5d 81 ff c8 bne r12,r1,8001b04 } } } #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( 8001be8: 2b 81 00 6c lw r1,(sp+108) 8001bec: 34 02 03 e8 mvi r2,1000 8001bf0: 78 0b 08 01 mvhi r11,0x801 8001bf4: f8 00 67 c5 calli 801bb08 <__udivsi3> 8001bf8: 2b 83 00 68 lw r3,(sp+104) 8001bfc: 39 6b cd d0 ori r11,r11,0xcdd0 8001c00: b8 20 20 00 mv r4,r1 8001c04: b9 60 10 00 mv r2,r11 8001c08: b9 c0 08 00 mv r1,r14 8001c0c: d9 a0 00 00 call r13 "-------------------------------------------------------------------------------\n", _Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset, total_units ); #endif } 8001c10: 2b 9d 00 04 lw ra,(sp+4) 8001c14: 2b 8b 00 44 lw r11,(sp+68) 8001c18: 2b 8c 00 40 lw r12,(sp+64) 8001c1c: 2b 8d 00 3c lw r13,(sp+60) 8001c20: 2b 8e 00 38 lw r14,(sp+56) 8001c24: 2b 8f 00 34 lw r15,(sp+52) 8001c28: 2b 90 00 30 lw r16,(sp+48) 8001c2c: 2b 91 00 2c lw r17,(sp+44) 8001c30: 2b 92 00 28 lw r18,(sp+40) 8001c34: 2b 93 00 24 lw r19,(sp+36) 8001c38: 2b 94 00 20 lw r20,(sp+32) 8001c3c: 2b 95 00 1c lw r21,(sp+28) 8001c40: 2b 96 00 18 lw r22,(sp+24) 8001c44: 2b 97 00 14 lw r23,(sp+20) 8001c48: 2b 98 00 10 lw r24,(sp+16) 8001c4c: 2b 99 00 0c lw r25,(sp+12) 8001c50: 2b 9b 00 08 lw fp,(sp+8) 8001c54: 37 9c 00 7c addi sp,sp,124 8001c58: c3 a0 00 00 ret =============================================================================== 0800b218 : [RTEMS_IO_ERROR] = EIO, [RTEMS_PROXY_BLOCKING] = EIO }; int rtems_deviceio_errno(rtems_status_code sc) { 800b218: 37 9c ff f8 addi sp,sp,-8 800b21c: 5b 8b 00 08 sw (sp+8),r11 800b220: 5b 9d 00 04 sw (sp+4),ra if (sc == RTEMS_SUCCESSFUL) { return 0; 800b224: 34 02 00 00 mvi r2,0 [RTEMS_PROXY_BLOCKING] = EIO }; int rtems_deviceio_errno(rtems_status_code sc) { if (sc == RTEMS_SUCCESSFUL) { 800b228: 44 20 00 0d be r1,r0,800b25c return 0; } else { int eno = EINVAL; if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) { 800b22c: 34 02 00 1c mvi r2,28 int rtems_deviceio_errno(rtems_status_code sc) { if (sc == RTEMS_SUCCESSFUL) { return 0; } else { int eno = EINVAL; 800b230: 34 0b 00 16 mvi r11,22 if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) { 800b234: 54 22 00 07 bgu r1,r2,800b250 <== NEVER TAKEN eno = status_code_to_errno [sc]; 800b238: 78 0b 08 01 mvhi r11,0x801 800b23c: 34 02 00 02 mvi r2,2 800b240: 39 6b 1e 78 ori r11,r11,0x1e78 800b244: f8 00 15 18 calli 80106a4 <__ashlsi3> 800b248: b5 61 08 00 add r1,r11,r1 800b24c: 28 2b 00 00 lw r11,(r1+0) } errno = eno; 800b250: f8 00 00 12 calli 800b298 <__errno> 800b254: 58 2b 00 00 sw (r1+0),r11 return -1; 800b258: 34 02 ff ff mvi r2,-1 } } 800b25c: b8 40 08 00 mv r1,r2 800b260: 2b 9d 00 04 lw ra,(sp+4) 800b264: 2b 8b 00 08 lw r11,(sp+8) 800b268: 37 9c 00 08 addi sp,sp,8 800b26c: c3 a0 00 00 ret =============================================================================== 08008300 : rtems_filesystem_fsmount_me_t rtems_filesystem_get_mount_handler( const char *type ) { 8008300: 37 9c ff f4 addi sp,sp,-12 8008304: 5b 9d 00 04 sw (sp+4),ra find_arg fa = { 8008308: 5b 81 00 08 sw (sp+8),r1 800830c: 5b 80 00 0c sw (sp+12),r0 .type = type, .mount_h = NULL }; if ( type != NULL ) { 8008310: 44 20 00 05 be r1,r0,8008324 <== NEVER TAKEN rtems_filesystem_iterate( find_handler, &fa ); 8008314: 78 01 08 00 mvhi r1,0x800 8008318: 38 21 81 9c ori r1,r1,0x819c 800831c: 37 82 00 08 addi r2,sp,8 8008320: fb ff ff c7 calli 800823c } return fa.mount_h; } 8008324: 2b 81 00 0c lw r1,(sp+12) 8008328: 2b 9d 00 04 lw ra,(sp+4) 800832c: 37 9c 00 0c addi sp,sp,12 8008330: c3 a0 00 00 ret =============================================================================== 08000f90 : * configuration is a single instantiation of the IMFS or miniIMFS with * a single "/dev" directory in it. */ void rtems_filesystem_initialize( void ) { 8000f90: 37 9c ff dc addi sp,sp,-36 8000f94: 5b 8b 00 10 sw (sp+16),r11 8000f98: 5b 8c 00 0c sw (sp+12),r12 8000f9c: 5b 8d 00 08 sw (sp+8),r13 8000fa0: 5b 9d 00 04 sw (sp+4),ra /* * Set the default umask to "022". */ rtems_filesystem_umask = 022; 8000fa4: 78 0b 08 01 mvhi r11,0x801 8000fa8: 39 6b 31 1c ori r11,r11,0x311c 8000fac: 29 62 00 00 lw r2,(r11+0) 8000fb0: 34 01 00 12 mvi r1,18 8000fb4: 58 41 00 2c sw (r2+44),r1 /* * mount the first filesystem. */ if ( rtems_filesystem_mount_table_size == 0 ) 8000fb8: 78 01 08 01 mvhi r1,0x801 8000fbc: 38 21 18 80 ori r1,r1,0x1880 8000fc0: 28 21 00 00 lw r1,(r1+0) rtems_fatal_error_occurred( 0xABCD0001 ); 8000fc4: 78 02 08 01 mvhi r2,0x801 8000fc8: 38 42 19 e0 ori r2,r2,0x19e0 rtems_filesystem_umask = 022; /* * mount the first filesystem. */ if ( rtems_filesystem_mount_table_size == 0 ) 8000fcc: 44 20 00 0e be r1,r0,8001004 <== NEVER TAKEN rtems_fatal_error_occurred( 0xABCD0001 ); mt = &rtems_filesystem_mount_table[0]; 8000fd0: 78 01 08 01 mvhi r1,0x801 8000fd4: 38 21 30 18 ori r1,r1,0x3018 8000fd8: 28 24 00 00 lw r4,(r1+0) status = mount( mt->device, mt->mount_point, mt->type, mt->fsoptions, NULL ); 8000fdc: 34 05 00 00 mvi r5,0 8000fe0: 28 82 00 0c lw r2,(r4+12) 8000fe4: 28 81 00 08 lw r1,(r4+8) 8000fe8: 28 83 00 00 lw r3,(r4+0) 8000fec: 28 84 00 04 lw r4,(r4+4) 8000ff0: f8 00 02 78 calli 80019d0 if ( status == -1 ) 8000ff4: 34 02 ff ff mvi r2,-1 8000ff8: 5c 22 00 05 bne r1,r2,800100c <== ALWAYS TAKEN rtems_fatal_error_occurred( 0xABCD0002 ); 8000ffc: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8001000: 38 42 19 e4 ori r2,r2,0x19e4 <== NOT EXECUTED 8001004: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 8001008: f8 00 08 2b calli 80030b4 <== NOT EXECUTED rtems_filesystem_link_counts = 0; 800100c: 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); 8001010: 78 0c 08 01 mvhi r12,0x801 8001014: 39 8c 19 d4 ori r12,r12,0x19d4 8001018: 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; 800101c: 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); 8001020: 34 02 00 01 mvi r2,1 8001024: 34 03 00 00 mvi r3,0 8001028: b9 a0 20 00 mv r4,r13 800102c: 34 05 00 00 mvi r5,0 8001030: b9 80 08 00 mv r1,r12 8001034: f8 00 00 6b calli 80011e0 rtems_filesystem_root = loc; 8001038: 29 61 00 00 lw r1,(r11+0) 800103c: 2b 82 00 14 lw r2,(sp+20) /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 8001040: 34 03 00 00 mvi r3,0 8001044: 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; 8001048: 58 22 00 18 sw (r1+24),r2 800104c: 2b 82 00 18 lw r2,(sp+24) /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 8001050: 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; 8001054: 58 22 00 1c sw (r1+28),r2 8001058: 2b 82 00 1c lw r2,(sp+28) 800105c: 58 22 00 20 sw (r1+32),r2 8001060: 2b 82 00 20 lw r2,(sp+32) 8001064: 58 22 00 24 sw (r1+36),r2 8001068: 2b 82 00 24 lw r2,(sp+36) 800106c: 58 22 00 28 sw (r1+40),r2 /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 8001070: 34 02 00 01 mvi r2,1 8001074: b9 80 08 00 mv r1,r12 8001078: f8 00 00 5a calli 80011e0 rtems_filesystem_current = loc; 800107c: 29 61 00 00 lw r1,(r11+0) 8001080: 2b 82 00 14 lw r2,(sp+20) 8001084: 58 22 00 04 sw (r1+4),r2 8001088: 2b 82 00 18 lw r2,(sp+24) 800108c: 58 22 00 08 sw (r1+8),r2 8001090: 2b 82 00 1c lw r2,(sp+28) 8001094: 58 22 00 0c sw (r1+12),r2 8001098: 2b 82 00 20 lw r2,(sp+32) 800109c: 58 22 00 10 sw (r1+16),r2 80010a0: 2b 82 00 24 lw r2,(sp+36) 80010a4: 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); 80010a8: 78 01 08 01 mvhi r1,0x801 80010ac: 34 02 01 ff mvi r2,511 80010b0: 38 21 19 d8 ori r1,r1,0x19d8 80010b4: f8 00 01 d4 calli 8001804 if ( status != 0 ) rtems_fatal_error_occurred( 0xABCD0003 ); 80010b8: 78 02 08 01 mvhi r2,0x801 80010bc: 38 42 19 e8 ori r2,r2,0x19e8 * 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 ) 80010c0: 5c 20 ff d1 bne r1,r0,8001004 <== 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. */ } 80010c4: 2b 9d 00 04 lw ra,(sp+4) 80010c8: 2b 8b 00 10 lw r11,(sp+16) 80010cc: 2b 8c 00 0c lw r12,(sp+12) 80010d0: 2b 8d 00 08 lw r13,(sp+8) 80010d4: 37 9c 00 24 addi sp,sp,36 80010d8: c3 a0 00 00 ret =============================================================================== 0800823c : bool rtems_filesystem_iterate( rtems_per_filesystem_routine routine, void *routine_arg ) { 800823c: 37 9c ff e8 addi sp,sp,-24 8008240: 5b 8b 00 18 sw (sp+24),r11 8008244: 5b 8c 00 14 sw (sp+20),r12 8008248: 5b 8d 00 10 sw (sp+16),r13 800824c: 5b 8e 00 0c sw (sp+12),r14 8008250: 5b 8f 00 08 sw (sp+8),r15 8008254: 5b 9d 00 04 sw (sp+4),ra const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0]; 8008258: 78 0b 08 01 mvhi r11,0x801 bool rtems_filesystem_iterate( rtems_per_filesystem_routine routine, void *routine_arg ) { 800825c: b8 20 70 00 mv r14,r1 8008260: 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; 8008264: 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]; 8008268: 39 6b 18 60 ori r11,r11,0x1860 rtems_chain_node *node = NULL; bool stop = false; while ( table_entry->type && !stop ) { 800826c: e0 00 00 06 bi 8008284 stop = (*routine)( table_entry, routine_arg ); 8008270: b9 60 08 00 mv r1,r11 8008274: b9 e0 10 00 mv r2,r15 8008278: d9 c0 00 00 call r14 800827c: b8 20 18 00 mv r3,r1 ++table_entry; 8008280: 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 ) { 8008284: 29 61 00 00 lw r1,(r11+0) 8008288: 44 20 00 03 be r1,r0,8008294 800828c: 44 60 ff f9 be r3,r0,8008270 8008290: e0 00 00 13 bi 80082dc 8008294: b8 60 58 00 mv r11,r3 stop = (*routine)( table_entry, routine_arg ); ++table_entry; } if ( !stop ) { 8008298: 5c 23 00 11 bne r1,r3,80082dc rtems_libio_lock(); 800829c: fb ff ff d4 calli 80081ec } } rtems_libio_unlock(); rtems_set_errno_and_return_minus_one( ENOENT ); } 80082a0: 78 03 08 01 mvhi r3,0x801 80082a4: 38 63 31 20 ori r3,r3,0x3120 ++table_entry; } if ( !stop ) { rtems_libio_lock(); for ( 80082a8: 78 0d 08 01 mvhi r13,0x801 } } rtems_libio_unlock(); rtems_set_errno_and_return_minus_one( ENOENT ); } 80082ac: 28 6c 00 00 lw r12,(r3+0) ++table_entry; } if ( !stop ) { rtems_libio_lock(); for ( 80082b0: 39 ad 31 24 ori r13,r13,0x3124 80082b4: e0 00 00 06 bi 80082cc !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 ); 80082b8: 35 81 00 08 addi r1,r12,8 80082bc: b9 e0 10 00 mv r2,r15 80082c0: d9 c0 00 00 call r14 } } rtems_libio_unlock(); rtems_set_errno_and_return_minus_one( ENOENT ); } 80082c4: 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 ); 80082c8: b8 20 58 00 mv r11,r1 ++table_entry; } if ( !stop ) { rtems_libio_lock(); for ( 80082cc: 45 8d 00 02 be r12,r13,80082d4 node = rtems_chain_first( &filesystem_chain ); !rtems_chain_is_tail( &filesystem_chain, node ) && !stop; 80082d0: 45 60 ff fa be r11,r0,80082b8 <== ALWAYS TAKEN ) { const filesystem_node *fsn = (filesystem_node *) node; stop = (*routine)( &fsn->entry, routine_arg ); } rtems_libio_unlock(); 80082d4: fb ff ff d1 calli 8008218 80082d8: b9 60 18 00 mv r3,r11 } return stop; } 80082dc: b8 60 08 00 mv r1,r3 80082e0: 2b 9d 00 04 lw ra,(sp+4) 80082e4: 2b 8b 00 18 lw r11,(sp+24) 80082e8: 2b 8c 00 14 lw r12,(sp+20) 80082ec: 2b 8d 00 10 lw r13,(sp+16) 80082f0: 2b 8e 00 0c lw r14,(sp+12) 80082f4: 2b 8f 00 08 lw r15,(sp+8) 80082f8: 37 9c 00 18 addi sp,sp,24 80082fc: c3 a0 00 00 ret =============================================================================== 08001948 : bool rtems_filesystem_mount_iterate( rtems_per_filesystem_mount_routine routine, void *routine_arg ) { 8001948: 37 9c ff e8 addi sp,sp,-24 800194c: 5b 8b 00 18 sw (sp+24),r11 8001950: 5b 8c 00 14 sw (sp+20),r12 8001954: 5b 8d 00 10 sw (sp+16),r13 8001958: 5b 8e 00 0c sw (sp+12),r14 800195c: 5b 8f 00 08 sw (sp+8),r15 8001960: 5b 9d 00 04 sw (sp+4),ra 8001964: b8 20 78 00 mv r15,r1 8001968: b8 40 70 00 mv r14,r2 rtems_chain_node *node = NULL; bool stop = false; rtems_libio_lock(); 800196c: fb ff ff e3 calli 80018f8 stop = (*routine)( mt_entry, routine_arg ); } rtems_libio_unlock(); return stop; } 8001970: 78 03 08 01 mvhi r3,0x801 8001974: 38 63 31 10 ori r3,r3,0x3110 { rtems_chain_node *node = NULL; bool stop = false; rtems_libio_lock(); for ( 8001978: 78 0d 08 01 mvhi r13,0x801 stop = (*routine)( mt_entry, routine_arg ); } rtems_libio_unlock(); return stop; } 800197c: 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; 8001980: 34 0c 00 00 mvi r12,0 rtems_libio_lock(); for ( 8001984: 39 ad 31 14 ori r13,r13,0x3114 8001988: e0 00 00 06 bi 80019a0 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 ); 800198c: b9 60 08 00 mv r1,r11 8001990: b9 c0 10 00 mv r2,r14 8001994: d9 e0 00 00 call r15 } rtems_libio_unlock(); return stop; } 8001998: 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 ); 800199c: b8 20 60 00 mv r12,r1 { rtems_chain_node *node = NULL; bool stop = false; rtems_libio_lock(); for ( 80019a0: 45 6d 00 02 be r11,r13,80019a8 node = rtems_chain_first( &mount_chain ); !rtems_chain_is_tail( &mount_chain, node ) && !stop; 80019a4: 45 80 ff fa be r12,r0,800198c <== 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(); 80019a8: fb ff ff df calli 8001924 return stop; } 80019ac: b9 80 08 00 mv r1,r12 80019b0: 2b 9d 00 04 lw ra,(sp+4) 80019b4: 2b 8b 00 18 lw r11,(sp+24) 80019b8: 2b 8c 00 14 lw r12,(sp+20) 80019bc: 2b 8d 00 10 lw r13,(sp+16) 80019c0: 2b 8e 00 0c lw r14,(sp+12) 80019c4: 2b 8f 00 08 lw r15,(sp+8) 80019c8: 37 9c 00 18 addi sp,sp,24 80019cc: c3 a0 00 00 ret =============================================================================== 0800129c : int rtems_filesystem_prefix_separators( const char *pathname, int pathnamelen ) { 800129c: 37 9c ff f0 addi sp,sp,-16 80012a0: 5b 8b 00 10 sw (sp+16),r11 80012a4: 5b 8c 00 0c sw (sp+12),r12 80012a8: 5b 8d 00 08 sw (sp+8),r13 80012ac: 5b 9d 00 04 sw (sp+4),ra /* * Eat any separators at start of the path. */ int stripped = 0; 80012b0: 34 0b 00 00 mvi r11,0 int rtems_filesystem_prefix_separators( const char *pathname, int pathnamelen ) { 80012b4: b8 20 68 00 mv r13,r1 80012b8: 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 ) ) 80012bc: e0 00 00 02 bi 80012c4 { pathname++; pathnamelen--; stripped++; 80012c0: 35 6b 00 01 addi r11,r11,1 } return len; } int rtems_filesystem_prefix_separators( 80012c4: 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 ) ) 80012c8: 40 21 00 00 lbu r1,(r1+0) 80012cc: fd 8b 18 00 cmpne r3,r12,r11 80012d0: 7c 22 00 00 cmpnei r2,r1,0 80012d4: a0 62 10 00 and r2,r3,r2 80012d8: 44 40 00 03 be r2,r0,80012e4 <== NEVER TAKEN 80012dc: f8 00 04 2d calli 8002390 80012e0: 5c 20 ff f8 bne r1,r0,80012c0 pathname++; pathnamelen--; stripped++; } return stripped; } 80012e4: b9 60 08 00 mv r1,r11 80012e8: 2b 9d 00 04 lw ra,(sp+4) 80012ec: 2b 8b 00 10 lw r11,(sp+16) 80012f0: 2b 8c 00 0c lw r12,(sp+12) 80012f4: 2b 8d 00 08 lw r13,(sp+8) 80012f8: 37 9c 00 10 addi sp,sp,16 80012fc: c3 a0 00 00 ret =============================================================================== 08001fb4 : void *rtems_gxx_getspecific(__gthread_key_t key) { 8001fb4: 37 9c ff f4 addi sp,sp,-12 8001fb8: 5b 8b 00 08 sw (sp+8),r11 8001fbc: 5b 9d 00 04 sw (sp+4),ra 8001fc0: 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 ); 8001fc4: b9 60 10 00 mv r2,r11 8001fc8: 34 01 00 00 mvi r1,0 8001fcc: 37 83 00 0c addi r3,sp,12 } void *rtems_gxx_getspecific(__gthread_key_t key) { rtems_status_code status; void *p= 0; 8001fd0: 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 ); 8001fd4: f8 00 07 83 calli 8003de0 if ( status == RTEMS_SUCCESSFUL ) { 8001fd8: 5c 20 00 04 bne r1,r0,8001fe8 /* We do not have to do this, but what the heck ! */ p= key->val; 8001fdc: 29 61 00 00 lw r1,(r11+0) 8001fe0: 5b 81 00 0c sw (sp+12),r1 8001fe4: e0 00 00 0b bi 8002010 } 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 ); 8001fe8: 29 63 00 04 lw r3,(r11+4) 8001fec: 34 01 00 00 mvi r1,0 8001ff0: b9 60 10 00 mv r2,r11 8001ff4: f8 00 07 29 calli 8003c98 if ( status != RTEMS_SUCCESSFUL ) { 8001ff8: 44 20 00 05 be r1,r0,800200c <== NEVER TAKEN _Internal_error_Occurred( 8001ffc: 34 01 00 00 mvi r1,0 8002000: 34 02 00 01 mvi r2,1 8002004: 34 03 00 15 mvi r3,21 8002008: f8 00 0b aa calli 8004eb0 <_Internal_error_Occurred> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_GXX_KEY_ADD_FAILED ); } key->val = (void *)0; 800200c: 59 60 00 00 sw (r11+0),r0 p, rtems_task_self() ); #endif return p; } 8002010: 2b 81 00 0c lw r1,(sp+12) 8002014: 2b 9d 00 04 lw ra,(sp+4) 8002018: 2b 8b 00 08 lw r11,(sp+8) 800201c: 37 9c 00 0c addi sp,sp,12 8002020: c3 a0 00 00 ret =============================================================================== 08001f74 : int rtems_gxx_key_delete (__gthread_key_t key) { 8001f74: 37 9c ff f8 addi sp,sp,-8 8001f78: 5b 8b 00 08 sw (sp+8),r11 8001f7c: 5b 9d 00 04 sw (sp+4),ra 8001f80: 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 ); 8001f84: b9 60 10 00 mv r2,r11 8001f88: 34 01 00 00 mvi r1,0 8001f8c: f8 00 07 72 calli 8003d54 if ( status == RTEMS_SUCCESSFUL ) { 8001f90: 5c 20 00 04 bne r1,r0,8001fa0 <== NEVER TAKEN /* Hmm - hopefully all tasks using this key have gone away... */ if ( key ) free( *(void **)key ); 8001f94: 45 61 00 03 be r11,r1,8001fa0 <== NEVER TAKEN 8001f98: 29 61 00 00 lw r1,(r11+0) 8001f9c: fb ff ff 63 calli 8001d28 return 0; } key = NULL; return 0; } 8001fa0: 34 01 00 00 mvi r1,0 8001fa4: 2b 9d 00 04 lw ra,(sp+4) 8001fa8: 2b 8b 00 08 lw r11,(sp+8) 8001fac: 37 9c 00 08 addi sp,sp,8 8001fb0: c3 a0 00 00 ret =============================================================================== 08001e90 : /* uncomment this if you need to debug this interface */ /*#define DEBUG_GXX_WRAPPERS 1*/ int rtems_gxx_once(__gthread_once_t *once, void (*func) (void)) { 8001e90: 37 9c ff e8 addi sp,sp,-24 8001e94: 5b 8b 00 14 sw (sp+20),r11 8001e98: 5b 8c 00 10 sw (sp+16),r12 8001e9c: 5b 8d 00 0c sw (sp+12),r13 8001ea0: 5b 8e 00 08 sw (sp+8),r14 8001ea4: 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 ) { 8001ea8: 28 2d 00 00 lw r13,(r1+0) /* uncomment this if you need to debug this interface */ /*#define DEBUG_GXX_WRAPPERS 1*/ int rtems_gxx_once(__gthread_once_t *once, void (*func) (void)) { 8001eac: b8 20 58 00 mv r11,r1 8001eb0: 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 ) { 8001eb4: 5d a0 00 0f bne r13,r0,8001ef0 rtems_mode saveMode; __gthread_once_t o; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 8001eb8: 34 01 01 00 mvi r1,256 8001ebc: 34 02 01 00 mvi r2,256 8001ec0: 37 83 00 18 addi r3,sp,24 8001ec4: f8 00 06 ec calli 8003a74 if ( (o = *(volatile __gthread_once_t *)once) == 0 ) { 8001ec8: 29 6c 00 00 lw r12,(r11+0) 8001ecc: 5d 8d 00 03 bne r12,r13,8001ed8 <== NEVER TAKEN *(volatile __gthread_once_t *)once = 1; 8001ed0: 34 01 00 01 mvi r1,1 8001ed4: 59 61 00 00 sw (r11+0),r1 } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 8001ed8: 2b 81 00 18 lw r1,(sp+24) 8001edc: 34 02 01 00 mvi r2,256 8001ee0: 37 83 00 18 addi r3,sp,24 8001ee4: f8 00 06 e4 calli 8003a74 if ( o == 0 ) 8001ee8: 5d 80 00 02 bne r12,r0,8001ef0 <== NEVER TAKEN (*func)(); 8001eec: d9 c0 00 00 call r14 } return 0; } 8001ef0: 34 01 00 00 mvi r1,0 8001ef4: 2b 9d 00 04 lw ra,(sp+4) 8001ef8: 2b 8b 00 14 lw r11,(sp+20) 8001efc: 2b 8c 00 10 lw r12,(sp+16) 8001f00: 2b 8d 00 0c lw r13,(sp+12) 8001f04: 2b 8e 00 08 lw r14,(sp+8) 8001f08: 37 9c 00 18 addi sp,sp,24 8001f0c: c3 a0 00 00 ret =============================================================================== 08002024 : int rtems_gxx_setspecific(__gthread_key_t key, const void *ptr) { 8002024: 37 9c ff f4 addi sp,sp,-12 8002028: 5b 8b 00 0c sw (sp+12),r11 800202c: 5b 8c 00 08 sw (sp+8),r12 8002030: 5b 9d 00 04 sw (sp+4),ra 8002034: 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 ); 8002038: 29 63 00 04 lw r3,(r11+4) #endif return p; } int rtems_gxx_setspecific(__gthread_key_t key, const void *ptr) { 800203c: 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 ); 8002040: 34 01 00 00 mvi r1,0 8002044: b9 60 10 00 mv r2,r11 8002048: f8 00 07 14 calli 8003c98 if ( status == RTEMS_SUCCESSFUL ) { /* now let's set the proper value */ key->val = (void *)ptr; return 0; } return -1; 800204c: 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 ) { 8002050: 5c 20 00 03 bne r1,r0,800205c <== NEVER TAKEN /* now let's set the proper value */ key->val = (void *)ptr; 8002054: 59 6c 00 00 sw (r11+0),r12 return 0; 8002058: 34 03 00 00 mvi r3,0 } return -1; } 800205c: b8 60 08 00 mv r1,r3 8002060: 2b 9d 00 04 lw ra,(sp+4) 8002064: 2b 8b 00 0c lw r11,(sp+12) 8002068: 2b 8c 00 08 lw r12,(sp+8) 800206c: 37 9c 00 0c addi sp,sp,12 8002070: c3 a0 00 00 ret =============================================================================== 08006cac : void *rtems_heap_allocate_aligned_with_boundary( size_t size, uintptr_t alignment, uintptr_t boundary ) { 8006cac: 37 9c ff f0 addi sp,sp,-16 8006cb0: 5b 8b 00 10 sw (sp+16),r11 8006cb4: 5b 8c 00 0c sw (sp+12),r12 8006cb8: 5b 8d 00 08 sw (sp+8),r13 8006cbc: 5b 9d 00 04 sw (sp+4),ra if ( 8006cc0: 78 05 08 02 mvhi r5,0x802 8006cc4: 38 a5 42 bc ori r5,r5,0x42bc void *rtems_heap_allocate_aligned_with_boundary( size_t size, uintptr_t alignment, uintptr_t boundary ) { 8006cc8: b8 40 60 00 mv r12,r2 if ( 8006ccc: 28 a2 00 00 lw r2,(r5+0) void *rtems_heap_allocate_aligned_with_boundary( size_t size, uintptr_t alignment, uintptr_t boundary ) { 8006cd0: b8 20 68 00 mv r13,r1 if ( 8006cd4: 34 01 00 03 mvi r1,3 void *rtems_heap_allocate_aligned_with_boundary( size_t size, uintptr_t alignment, uintptr_t boundary ) { 8006cd8: b8 60 58 00 mv r11,r3 if ( 8006cdc: 5c 41 00 04 bne r2,r1,8006cec <== NEVER TAKEN _System_state_Is_up( _System_state_Get() ) && !malloc_is_system_state_OK() 8006ce0: fb ff fb 11 calli 8005924 ) { return NULL; 8006ce4: 34 05 00 00 mvi r5,0 uintptr_t boundary ) { if ( _System_state_Is_up( _System_state_Get() ) && !malloc_is_system_state_OK() 8006ce8: 44 20 00 0a be r1,r0,8006d10 ) { return NULL; } malloc_deferred_frees_process(); 8006cec: fb ff fb 20 calli 800596c /* FIXME: Statistics, boundary checks */ return _Protected_heap_Allocate_aligned_with_boundary( 8006cf0: 78 05 08 02 mvhi r5,0x802 8006cf4: 38 a5 30 1c ori r5,r5,0x301c 8006cf8: 28 a1 00 00 lw r1,(r5+0) 8006cfc: b9 a0 10 00 mv r2,r13 8006d00: b9 80 18 00 mv r3,r12 8006d04: b9 60 20 00 mv r4,r11 8006d08: f8 00 0d f3 calli 800a4d4 <_Protected_heap_Allocate_aligned_with_boundary> 8006d0c: b8 20 28 00 mv r5,r1 RTEMS_Malloc_Heap, size, alignment, boundary ); } 8006d10: b8 a0 08 00 mv r1,r5 8006d14: 2b 9d 00 04 lw ra,(sp+4) 8006d18: 2b 8b 00 10 lw r11,(sp+16) 8006d1c: 2b 8c 00 0c lw r12,(sp+12) 8006d20: 2b 8d 00 08 lw r13,(sp+8) 8006d24: 37 9c 00 10 addi sp,sp,16 8006d28: c3 a0 00 00 ret =============================================================================== 08005fc8 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 8005fc8: 37 9c ff e4 addi sp,sp,-28 8005fcc: 5b 8b 00 1c sw (sp+28),r11 8005fd0: 5b 8c 00 18 sw (sp+24),r12 8005fd4: 5b 8d 00 14 sw (sp+20),r13 8005fd8: 5b 8e 00 10 sw (sp+16),r14 8005fdc: 5b 8f 00 0c sw (sp+12),r15 8005fe0: 5b 90 00 08 sw (sp+8),r16 8005fe4: 5b 9d 00 04 sw (sp+4),ra 8005fe8: b8 20 78 00 mv r15,r1 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 8005fec: 44 20 00 17 be r1,r0,8006048 <== NEVER TAKEN #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 8005ff0: 78 02 08 02 mvhi r2,0x802 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 8005ff4: 78 0b 08 02 mvhi r11,0x802 #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 8005ff8: 38 42 75 c0 ori r2,r2,0x75c0 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 8005ffc: 39 6b 75 c4 ori r11,r11,0x75c4 #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 8006000: 34 50 00 10 addi r16,r2,16 #if defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 8006004: 29 61 00 00 lw r1,(r11+0) if ( !information ) 8006008: 34 0e 00 04 mvi r14,4 800600c: 34 0d 00 01 mvi r13,1 #if defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 8006010: 28 2c 00 04 lw r12,(r1+4) if ( !information ) 8006014: 5d 80 00 09 bne r12,r0,8006038 8006018: e0 00 00 0a bi 8006040 continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 800601c: 29 81 00 1c lw r1,(r12+28) 8006020: b4 2e 08 00 add r1,r1,r14 8006024: 28 21 00 00 lw r1,(r1+0) if ( !the_thread ) 8006028: 44 20 00 02 be r1,r0,8006030 continue; (*routine)(the_thread); 800602c: d9 e0 00 00 call r15 information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 8006030: 35 ad 00 01 addi r13,r13,1 8006034: 35 ce 00 04 addi r14,r14,4 8006038: 2d 81 00 10 lhu r1,(r12+16) 800603c: 50 2d ff f8 bgeu r1,r13,800601c 8006040: 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++ ) { 8006044: 5d 70 ff f0 bne r11,r16,8006004 (*routine)(the_thread); } } } 8006048: 2b 9d 00 04 lw ra,(sp+4) 800604c: 2b 8b 00 1c lw r11,(sp+28) 8006050: 2b 8c 00 18 lw r12,(sp+24) 8006054: 2b 8d 00 14 lw r13,(sp+20) 8006058: 2b 8e 00 10 lw r14,(sp+16) 800605c: 2b 8f 00 0c lw r15,(sp+12) 8006060: 2b 90 00 08 lw r16,(sp+8) 8006064: 37 9c 00 1c addi sp,sp,28 8006068: c3 a0 00 00 ret =============================================================================== 08008054 : */ void rtems_libio_free( rtems_libio_t *iop ) { 8008054: 37 9c ff f8 addi sp,sp,-8 8008058: 5b 8b 00 08 sw (sp+8),r11 800805c: 5b 9d 00 04 sw (sp+4),ra 8008060: b8 20 58 00 mv r11,r1 rtems_libio_lock(); 8008064: fb ff ff 90 calli 8007ea4 if (iop->sem) 8008068: 29 61 00 30 lw r1,(r11+48) 800806c: 44 20 00 02 be r1,r0,8008074 <== NEVER TAKEN rtems_semaphore_delete(iop->sem); 8008070: f8 00 01 a3 calli 80086fc iop->flags &= ~LIBIO_FLAGS_OPEN; 8008074: 29 62 00 18 lw r2,(r11+24) 8008078: 34 01 fe ff mvi r1,-257 800807c: a0 41 08 00 and r1,r2,r1 8008080: 59 61 00 18 sw (r11+24),r1 iop->data1 = rtems_libio_iop_freelist; 8008084: 78 01 08 01 mvhi r1,0x801 8008088: 38 21 36 a4 ori r1,r1,0x36a4 800808c: 28 22 00 00 lw r2,(r1+0) rtems_libio_iop_freelist = iop; 8008090: 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; 8008094: 59 62 00 38 sw (r11+56),r2 rtems_libio_iop_freelist = iop; rtems_libio_unlock(); 8008098: fb ff ff 8e calli 8007ed0 } 800809c: 2b 9d 00 04 lw ra,(sp+4) 80080a0: 2b 8b 00 08 lw r11,(sp+8) 80080a4: 37 9c 00 08 addi sp,sp,8 80080a8: c3 a0 00 00 ret =============================================================================== 08001488 : * * Called by BSP startup code to initialize the libio subsystem. */ void rtems_libio_init( void ) { 8001488: 37 9c ff f4 addi sp,sp,-12 800148c: 5b 8b 00 0c sw (sp+12),r11 8001490: 5b 8c 00 08 sw (sp+8),r12 8001494: 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) 8001498: 78 01 08 01 mvhi r1,0x801 800149c: 38 21 30 10 ori r1,r1,0x3010 80014a0: 28 2c 00 00 lw r12,(r1+0) 80014a4: 45 80 00 19 be r12,r0,8001508 <== NEVER TAKEN { rtems_libio_iops = (rtems_libio_t *) calloc(rtems_libio_number_iops, 80014a8: b9 80 08 00 mv r1,r12 80014ac: 34 02 00 40 mvi r2,64 80014b0: fb ff ff 0b calli 80010dc 80014b4: b8 20 58 00 mv r11,r1 80014b8: 78 01 08 01 mvhi r1,0x801 80014bc: 38 21 36 a0 ori r1,r1,0x36a0 80014c0: 58 2b 00 00 sw (r1+0),r11 sizeof(rtems_libio_t)); if (rtems_libio_iops == NULL) rtems_fatal_error_occurred(RTEMS_NO_MEMORY); 80014c4: 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) 80014c8: 45 60 00 1b be r11,r0,8001534 rtems_fatal_error_occurred(RTEMS_NO_MEMORY); iop = rtems_libio_iop_freelist = rtems_libio_iops; 80014cc: 78 01 08 01 mvhi r1,0x801 80014d0: 38 21 36 a4 ori r1,r1,0x36a4 80014d4: 58 2b 00 00 sw (r1+0),r11 for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++) 80014d8: 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; 80014dc: b9 60 08 00 mv r1,r11 for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++) 80014e0: e0 00 00 02 bi 80014e8 iop->data1 = iop + 1; 80014e4: 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++) 80014e8: 34 42 00 01 addi r2,r2,1 80014ec: 34 21 00 40 addi r1,r1,64 80014f0: 55 82 ff fd bgu r12,r2,80014e4 iop->data1 = iop + 1; iop->data1 = NULL; 80014f4: b9 80 08 00 mv r1,r12 80014f8: 34 02 00 06 mvi r2,6 80014fc: f8 00 3c 6a calli 80106a4 <__ashlsi3> 8001500: b5 61 08 00 add r1,r11,r1 8001504: 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( 8001508: 78 02 08 01 mvhi r2,0x801 800150c: 38 42 1a 24 ori r2,r2,0x1a24 8001510: 28 41 00 00 lw r1,(r2+0) 8001514: 78 05 08 01 mvhi r5,0x801 8001518: 34 03 00 54 mvi r3,84 800151c: 34 02 00 01 mvi r2,1 8001520: 34 04 00 00 mvi r4,0 8001524: 38 a5 36 a8 ori r5,r5,0x36a8 8001528: f8 00 04 9f calli 80027a4 800152c: 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 ) 8001530: 44 20 00 02 be r1,r0,8001538 <== ALWAYS TAKEN rtems_fatal_error_occurred( rc ); 8001534: f8 00 06 e0 calli 80030b4 /* * Initialize the base file system infrastructure. */ if (rtems_fs_init_helper) 8001538: 78 02 08 01 mvhi r2,0x801 800153c: 38 42 30 0c ori r2,r2,0x300c 8001540: 28 41 00 00 lw r1,(r2+0) 8001544: 44 23 00 02 be r1,r3,800154c <== NEVER TAKEN (* rtems_fs_init_helper)(); 8001548: d8 20 00 00 call r1 } 800154c: 2b 9d 00 04 lw ra,(sp+4) 8001550: 2b 8b 00 0c lw r11,(sp+12) 8001554: 2b 8c 00 08 lw r12,(sp+8) 8001558: 37 9c 00 0c addi sp,sp,12 800155c: c3 a0 00 00 ret =============================================================================== 08002a94 : rtems_status_code rtems_libio_set_private_env(void) { 8002a94: 37 9c ff c8 addi sp,sp,-56 8002a98: 5b 8b 00 10 sw (sp+16),r11 8002a9c: 5b 8c 00 0c sw (sp+12),r12 8002aa0: 5b 8d 00 08 sw (sp+8),r13 8002aa4: 5b 9d 00 04 sw (sp+4),ra rtems_filesystem_location_info_t root_loc; rtems_filesystem_location_info_t current_loc; rtems_user_env_t *new_env = NULL; int rv = 0; rv = rtems_filesystem_evaluate_path("/", 1, 0, &root_loc, 0); 8002aa8: 78 0b 08 01 mvhi r11,0x801 } rtems_status_code rtems_libio_set_private_env(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_id task_id = rtems_task_self(); 8002aac: f8 00 03 1a calli 8003714 rtems_filesystem_location_info_t root_loc; rtems_filesystem_location_info_t current_loc; rtems_user_env_t *new_env = NULL; int rv = 0; rv = rtems_filesystem_evaluate_path("/", 1, 0, &root_loc, 0); 8002ab0: 39 6b 1c 34 ori r11,r11,0x1c34 8002ab4: 34 02 00 01 mvi r2,1 } rtems_status_code rtems_libio_set_private_env(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_id task_id = rtems_task_self(); 8002ab8: b8 20 68 00 mv r13,r1 rtems_filesystem_location_info_t root_loc; rtems_filesystem_location_info_t current_loc; rtems_user_env_t *new_env = NULL; int rv = 0; rv = rtems_filesystem_evaluate_path("/", 1, 0, &root_loc, 0); 8002abc: 34 03 00 00 mvi r3,0 8002ac0: b9 60 08 00 mv r1,r11 8002ac4: 37 84 00 28 addi r4,sp,40 8002ac8: 34 05 00 00 mvi r5,0 8002acc: fb ff fa d6 calli 8001624 8002ad0: b8 20 60 00 mv r12,r1 error_1: rtems_filesystem_freenode(&root_loc); error_0: return RTEMS_NO_MEMORY; 8002ad4: 34 02 00 1a mvi r2,26 rtems_filesystem_location_info_t current_loc; rtems_user_env_t *new_env = NULL; int rv = 0; rv = rtems_filesystem_evaluate_path("/", 1, 0, &root_loc, 0); if (rv != 0) 8002ad8: 5c 20 00 43 bne r1,r0,8002be4 <== NEVER TAKEN goto error_0; rv = rtems_filesystem_evaluate_path("/", 1, 0, ¤t_loc, 0); 8002adc: b9 60 08 00 mv r1,r11 8002ae0: 34 02 00 01 mvi r2,1 8002ae4: 34 03 00 00 mvi r3,0 8002ae8: 37 84 00 14 addi r4,sp,20 8002aec: 34 05 00 00 mvi r5,0 8002af0: fb ff fa cd calli 8001624 if (rv != 0) 8002af4: 5c 2c 00 39 bne r1,r12,8002bd8 <== NEVER TAKEN * Bharath: I'm not sure if the check can be reduced to * if( rtems_current_user_env->task_id != task_id ) { */ if ( rtems_current_user_env == &rtems_global_user_env 8002af8: 78 02 08 01 mvhi r2,0x801 8002afc: 38 42 31 04 ori r2,r2,0x3104 8002b00: 28 41 00 00 lw r1,(r2+0) /* * Bharath: I'm not sure if the check can be reduced to * if( rtems_current_user_env->task_id != task_id ) { */ if ( 8002b04: 78 02 08 01 mvhi r2,0x801 8002b08: 38 42 36 d8 ori r2,r2,0x36d8 8002b0c: 44 22 00 03 be r1,r2,8002b18 rtems_current_user_env == &rtems_global_user_env || rtems_current_user_env->task_id != task_id 8002b10: 28 21 00 00 lw r1,(r1+0) 8002b14: 44 2d 00 0e be r1,r13,8002b4c ) { new_env = malloc(sizeof(rtems_user_env_t)); 8002b18: 34 01 00 48 mvi r1,72 8002b1c: fb ff fc d5 calli 8001e70 8002b20: b8 20 60 00 mv r12,r1 if (new_env == NULL) 8002b24: 44 20 00 2b be r1,r0,8002bd0 #ifdef HAVE_USERENV_REFCNT new_env->refcnt = 1; #endif sc = rtems_task_variable_add( 8002b28: 78 0b 08 01 mvhi r11,0x801 8002b2c: 39 6b 31 04 ori r11,r11,0x3104 8002b30: 78 03 08 00 mvhi r3,0x800 8002b34: 34 01 00 00 mvi r1,0 8002b38: b9 60 10 00 mv r2,r11 8002b3c: 38 63 2a 50 ori r3,r3,0x2a50 8002b40: f8 00 03 1a calli 80037a8 RTEMS_SELF, (void*)&rtems_current_user_env, (void(*)(void *))free_user_env ); if (sc != RTEMS_SUCCESSFUL) 8002b44: 5c 20 00 21 bne r1,r0,8002bc8 goto error_3; rtems_current_user_env = new_env; 8002b48: 59 6c 00 00 sw (r11+0),r12 } /* Inherit the global values */ *rtems_current_user_env = rtems_global_user_env; 8002b4c: 78 02 08 01 mvhi r2,0x801 8002b50: 38 42 31 04 ori r2,r2,0x3104 8002b54: 28 4b 00 00 lw r11,(r2+0) 8002b58: 78 02 08 01 mvhi r2,0x801 8002b5c: 38 42 36 d8 ori r2,r2,0x36d8 8002b60: b9 60 08 00 mv r1,r11 8002b64: 34 03 00 48 mvi r3,72 8002b68: f8 00 25 5b calli 800c0d4 * Clone the pathlocs. In contrast to most other code we must _not_ free the * original locs because 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_root = root_loc; 8002b6c: 2b 81 00 28 lw r1,(sp+40) } /* Inherit the global values */ *rtems_current_user_env = rtems_global_user_env; rtems_current_user_env->task_id = task_id; 8002b70: 59 6d 00 00 sw (r11+0),r13 * be freed when deleting the environment. */ rtems_filesystem_root = root_loc; rtems_filesystem_current = current_loc; return RTEMS_SUCCESSFUL; 8002b74: 34 02 00 00 mvi r2,0 * Clone the pathlocs. In contrast to most other code we must _not_ free the * original locs because 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_root = root_loc; 8002b78: 59 61 00 18 sw (r11+24),r1 8002b7c: 2b 81 00 2c lw r1,(sp+44) 8002b80: 59 61 00 1c sw (r11+28),r1 8002b84: 2b 81 00 30 lw r1,(sp+48) 8002b88: 59 61 00 20 sw (r11+32),r1 8002b8c: 2b 81 00 34 lw r1,(sp+52) 8002b90: 59 61 00 24 sw (r11+36),r1 8002b94: 2b 81 00 38 lw r1,(sp+56) 8002b98: 59 61 00 28 sw (r11+40),r1 rtems_filesystem_current = current_loc; 8002b9c: 2b 81 00 14 lw r1,(sp+20) 8002ba0: 59 61 00 04 sw (r11+4),r1 8002ba4: 2b 81 00 18 lw r1,(sp+24) 8002ba8: 59 61 00 08 sw (r11+8),r1 8002bac: 2b 81 00 1c lw r1,(sp+28) 8002bb0: 59 61 00 0c sw (r11+12),r1 8002bb4: 2b 81 00 20 lw r1,(sp+32) 8002bb8: 59 61 00 10 sw (r11+16),r1 8002bbc: 2b 81 00 24 lw r1,(sp+36) 8002bc0: 59 61 00 14 sw (r11+20),r1 return RTEMS_SUCCESSFUL; 8002bc4: e0 00 00 08 bi 8002be4 error_3: free(new_env); 8002bc8: b9 80 08 00 mv r1,r12 8002bcc: fb ff fa e6 calli 8001764 error_2: rtems_filesystem_freenode(¤t_loc); 8002bd0: 37 81 00 14 addi r1,sp,20 8002bd4: fb ff fa dc calli 8001744 error_1: rtems_filesystem_freenode(&root_loc); 8002bd8: 37 81 00 28 addi r1,sp,40 8002bdc: fb ff fa da calli 8001744 error_0: return RTEMS_NO_MEMORY; 8002be0: 34 02 00 1a mvi r2,26 } 8002be4: b8 40 08 00 mv r1,r2 8002be8: 2b 9d 00 04 lw ra,(sp+4) 8002bec: 2b 8b 00 10 lw r11,(sp+16) 8002bf0: 2b 8c 00 0c lw r12,(sp+12) 8002bf4: 2b 8d 00 08 lw r13,(sp+8) 8002bf8: 37 9c 00 38 addi sp,sp,56 8002bfc: c3 a0 00 00 ret =============================================================================== 08002c00 : * b) mutex access to rtems_filesystem_current, rtems_filesytem_root * while changing any of those (chdir(), chroot()). */ rtems_status_code rtems_libio_share_private_env(rtems_id task_id) { 8002c00: 37 9c ff e8 addi sp,sp,-24 8002c04: 5b 8b 00 14 sw (sp+20),r11 8002c08: 5b 8c 00 10 sw (sp+16),r12 8002c0c: 5b 8d 00 0c sw (sp+12),r13 8002c10: 5b 8e 00 08 sw (sp+8),r14 8002c14: 5b 9d 00 04 sw (sp+4),ra 8002c18: b8 20 70 00 mv r14,r1 rtems_id current_task_id; /* * get current task id */ current_task_id = rtems_task_self(); 8002c1c: f8 00 02 be calli 8003714 8002c20: b8 20 68 00 mv r13,r1 * If this was an attempt to share the task with self, * if somebody wanted to do it... Lets tell them, its shared */ if( task_id == current_task_id ) return RTEMS_SUCCESSFUL; 8002c24: 34 0c 00 00 mvi r12,0 /* * If this was an attempt to share the task with self, * if somebody wanted to do it... Lets tell them, its shared */ if( task_id == current_task_id ) 8002c28: 45 c1 00 11 be r14,r1,8002c6c <== NEVER TAKEN return RTEMS_SUCCESSFUL; /* * Try to get the requested user environment */ sc = rtems_task_variable_get( 8002c2c: 78 0b 08 01 mvhi r11,0x801 8002c30: 39 6b 31 04 ori r11,r11,0x3104 8002c34: b9 c0 08 00 mv r1,r14 8002c38: b9 60 10 00 mv r2,r11 8002c3c: 37 83 00 18 addi r3,sp,24 8002c40: f8 00 03 09 calli 8003864 8002c44: b8 20 60 00 mv r12,r1 (void*)&shared_user_env ); /* * If it was not successful, return the error code */ if (sc != RTEMS_SUCCESSFUL) 8002c48: 5c 20 00 09 bne r1,r0,8002c6c * If we have a current environment in place, we need to * free it, since we will be sharing the variable with the * shared_user_env */ if (rtems_current_user_env->task_id==current_task_id) { 8002c4c: 29 61 00 00 lw r1,(r11+0) 8002c50: 28 22 00 00 lw r2,(r1+0) 8002c54: 5c 4d 00 02 bne r2,r13,8002c5c rtems_user_env_t *tmp = rtems_current_user_env; free_user_env( tmp ); 8002c58: fb ff ff 7e calli 8002a50 } /* the current_user_env is the same pointer that remote env */ rtems_current_user_env = shared_user_env; 8002c5c: 2b 82 00 18 lw r2,(sp+24) 8002c60: 78 01 08 01 mvhi r1,0x801 8002c64: 38 21 31 04 ori r1,r1,0x3104 8002c68: 58 22 00 00 sw (r1+0),r2 #ifdef HAVE_USERENV_REFCNT rtems_current_user_env->refcnt++; #endif return RTEMS_SUCCESSFUL; } 8002c6c: b9 80 08 00 mv r1,r12 8002c70: 2b 9d 00 04 lw ra,(sp+4) 8002c74: 2b 8b 00 14 lw r11,(sp+20) 8002c78: 2b 8c 00 10 lw r12,(sp+16) 8002c7c: 2b 8d 00 0c lw r13,(sp+12) 8002c80: 2b 8e 00 08 lw r14,(sp+8) 8002c84: 37 9c 00 18 addi sp,sp,24 8002c88: c3 a0 00 00 ret =============================================================================== 08007f4c : uint32_t flags ) { uint32_t fcntl_flags = 0; if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) { 8007f4c: 20 24 00 06 andi r4,r1,0x6 8007f50: 34 03 00 06 mvi r3,6 fcntl_flags |= O_RDWR; 8007f54: 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 ) { 8007f58: 44 83 00 06 be r4,r3,8007f70 <== NEVER TAKEN fcntl_flags |= O_RDWR; } else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) { 8007f5c: 20 23 00 02 andi r3,r1,0x2 fcntl_flags |= O_RDONLY; 8007f60: 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) { 8007f64: 5c 60 00 03 bne r3,r0,8007f70 <== ALWAYS TAKEN fcntl_flags |= O_RDONLY; } else if ( (flags & LIBIO_FLAGS_WRITE) == LIBIO_FLAGS_WRITE) { 8007f68: 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; 8007f6c: 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 ) { 8007f70: 20 23 00 01 andi r3,r1,0x1 8007f74: 44 60 00 02 be r3,r0,8007f7c fcntl_flags |= O_NONBLOCK; 8007f78: 38 42 40 00 ori r2,r2,0x4000 } if ( (flags & LIBIO_FLAGS_APPEND) == LIBIO_FLAGS_APPEND ) { 8007f7c: 20 23 02 00 andi r3,r1,0x200 8007f80: 44 60 00 02 be r3,r0,8007f88 fcntl_flags |= O_APPEND; 8007f84: 38 42 00 08 ori r2,r2,0x8 } if ( (flags & LIBIO_FLAGS_CREATE) == LIBIO_FLAGS_CREATE ) { 8007f88: 20 21 04 00 andi r1,r1,0x400 8007f8c: 44 20 00 02 be r1,r0,8007f94 fcntl_flags |= O_CREAT; 8007f90: 38 42 02 00 ori r2,r2,0x200 } return fcntl_flags; } 8007f94: b8 40 08 00 mv r1,r2 8007f98: c3 a0 00 00 ret =============================================================================== 08005e08 : * size and thus we skip updating the statistics. */ static void rtems_malloc_statistics_at_free( void *pointer ) { 8005e08: 37 9c ff f8 addi sp,sp,-8 8005e0c: 5b 9d 00 04 sw (sp+4),ra uintptr_t size; if (_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, pointer, &size) ) { 8005e10: 78 03 08 02 mvhi r3,0x802 8005e14: 38 63 30 1c ori r3,r3,0x301c * size and thus we skip updating the statistics. */ static void rtems_malloc_statistics_at_free( void *pointer ) { 8005e18: b8 20 10 00 mv r2,r1 uintptr_t size; if (_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, pointer, &size) ) { 8005e1c: 28 61 00 00 lw r1,(r3+0) 8005e20: 37 83 00 08 addi r3,sp,8 8005e24: f8 00 11 f5 calli 800a5f8 <_Protected_heap_Get_block_size> 8005e28: 44 20 00 0b be r1,r0,8005e54 <== NEVER TAKEN MSBUMP(lifetime_freed, size); 8005e2c: 78 01 08 02 mvhi r1,0x802 8005e30: 38 21 3f d8 ori r1,r1,0x3fd8 8005e34: 2b 83 00 08 lw r3,(sp+8) 8005e38: 28 22 00 2c lw r2,(r1+44) 8005e3c: 28 24 00 28 lw r4,(r1+40) 8005e40: b4 62 10 00 add r2,r3,r2 8005e44: f4 62 18 00 cmpgu r3,r3,r2 8005e48: 58 22 00 2c sw (r1+44),r2 8005e4c: b4 64 18 00 add r3,r3,r4 8005e50: 58 23 00 28 sw (r1+40),r3 } } 8005e54: 2b 9d 00 04 lw ra,(sp+4) 8005e58: 37 9c 00 08 addi sp,sp,8 8005e5c: c3 a0 00 00 ret =============================================================================== 08005e60 : } static void rtems_malloc_statistics_at_malloc( void *pointer ) { 8005e60: 37 9c ff f8 addi sp,sp,-8 8005e64: 5b 9d 00 04 sw (sp+4),ra uintptr_t actual_size = 0; 8005e68: 5b 80 00 08 sw (sp+8),r0 } static void rtems_malloc_statistics_at_malloc( void *pointer ) { 8005e6c: 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 ) 8005e70: 44 20 00 15 be r1,r0,8005ec4 <== NEVER TAKEN return; _Protected_heap_Get_block_size(RTEMS_Malloc_Heap, pointer, &actual_size); 8005e74: 78 03 08 02 mvhi r3,0x802 8005e78: 38 63 30 1c ori r3,r3,0x301c 8005e7c: 28 61 00 00 lw r1,(r3+0) 8005e80: 37 83 00 08 addi r3,sp,8 8005e84: f8 00 11 dd calli 800a5f8 <_Protected_heap_Get_block_size> MSBUMP(lifetime_allocated, actual_size); 8005e88: 78 01 08 02 mvhi r1,0x802 8005e8c: 38 21 3f d8 ori r1,r1,0x3fd8 8005e90: 2b 83 00 08 lw r3,(sp+8) 8005e94: 28 22 00 24 lw r2,(r1+36) 8005e98: 28 24 00 20 lw r4,(r1+32) 8005e9c: b4 62 10 00 add r2,r3,r2 8005ea0: f4 62 18 00 cmpgu r3,r3,r2 8005ea4: 58 22 00 24 sw (r1+36),r2 8005ea8: b4 64 18 00 add r3,r3,r4 8005eac: 58 23 00 20 sw (r1+32),r3 current_depth = (uint32_t) (s->lifetime_allocated - s->lifetime_freed); 8005eb0: 28 23 00 2c lw r3,(r1+44) 8005eb4: c8 43 10 00 sub r2,r2,r3 if (current_depth > s->max_depth) 8005eb8: 28 23 00 18 lw r3,(r1+24) 8005ebc: 50 62 00 02 bgeu r3,r2,8005ec4 s->max_depth = current_depth; 8005ec0: 58 22 00 18 sw (r1+24),r2 } 8005ec4: 2b 9d 00 04 lw ra,(sp+4) 8005ec8: 37 9c 00 08 addi sp,sp,8 8005ecc: c3 a0 00 00 ret =============================================================================== 0800c87c : int rtems_memalign( void **pointer, size_t alignment, size_t size ) { 800c87c: 37 9c ff ec addi sp,sp,-20 800c880: 5b 8b 00 14 sw (sp+20),r11 800c884: 5b 8c 00 10 sw (sp+16),r12 800c888: 5b 8d 00 0c sw (sp+12),r13 800c88c: 5b 8e 00 08 sw (sp+8),r14 800c890: 5b 9d 00 04 sw (sp+4),ra /* * Parameter error checks */ if ( !pointer ) return EINVAL; 800c894: 34 0c 00 16 mvi r12,22 int rtems_memalign( void **pointer, size_t alignment, size_t size ) { 800c898: b8 20 58 00 mv r11,r1 800c89c: b8 40 68 00 mv r13,r2 800c8a0: b8 60 70 00 mv r14,r3 void *return_this; /* * Parameter error checks */ if ( !pointer ) 800c8a4: 44 20 00 1d be r1,r0,800c918 return EINVAL; *pointer = NULL; 800c8a8: 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()) && 800c8ac: 78 01 08 01 mvhi r1,0x801 800c8b0: 38 21 8a 1c ori r1,r1,0x8a1c 800c8b4: 28 22 00 00 lw r2,(r1+0) 800c8b8: 34 01 00 03 mvi r1,3 800c8bc: 5c 41 00 03 bne r2,r1,800c8c8 <== NEVER TAKEN !malloc_is_system_state_OK() ) 800c8c0: fb ff d8 10 calli 8002900 *pointer = NULL; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 800c8c4: 44 20 00 15 be r1,r0,800c918 <== NEVER TAKEN return EINVAL; /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); 800c8c8: fb ff d8 20 calli 8002948 Heap_Control *heap, uintptr_t size, uintptr_t alignment ) { return 800c8cc: 78 01 08 01 mvhi r1,0x801 800c8d0: 38 21 80 1c ori r1,r1,0x801c 800c8d4: 28 21 00 00 lw r1,(r1+0) 800c8d8: b9 a0 18 00 mv r3,r13 800c8dc: b9 c0 10 00 mv r2,r14 800c8e0: 34 04 00 00 mvi r4,0 800c8e4: fb ff e5 69 calli 8005e88 <_Protected_heap_Allocate_aligned_with_boundary> 800c8e8: b8 20 68 00 mv r13,r1 RTEMS_Malloc_Heap, size, alignment ); if ( !return_this ) return ENOMEM; 800c8ec: 34 0c 00 0c mvi r12,12 return_this = _Protected_heap_Allocate_aligned( RTEMS_Malloc_Heap, size, alignment ); if ( !return_this ) 800c8f0: 44 20 00 0a be r1,r0,800c918 return ENOMEM; /* * If configured, update the more involved statistics */ if ( rtems_malloc_statistics_helpers ) 800c8f4: 78 02 08 01 mvhi r2,0x801 800c8f8: 38 42 86 30 ori r2,r2,0x8630 800c8fc: 28 41 00 00 lw r1,(r2+0) 800c900: 44 20 00 04 be r1,r0,800c910 (*rtems_malloc_statistics_helpers->at_malloc)(pointer); 800c904: 28 22 00 04 lw r2,(r1+4) 800c908: b9 60 08 00 mv r1,r11 800c90c: d8 40 00 00 call r2 *pointer = return_this; 800c910: 59 6d 00 00 sw (r11+0),r13 return 0; 800c914: 34 0c 00 00 mvi r12,0 } 800c918: b9 80 08 00 mv r1,r12 800c91c: 2b 9d 00 04 lw ra,(sp+4) 800c920: 2b 8b 00 14 lw r11,(sp+20) 800c924: 2b 8c 00 10 lw r12,(sp+16) 800c928: 2b 8d 00 0c lw r13,(sp+12) 800c92c: 2b 8e 00 08 lw r14,(sp+8) 800c930: 37 9c 00 14 addi sp,sp,20 800c934: c3 a0 00 00 ret =============================================================================== 0800a7b0 : return (retval); } int rtems_mkdir(const char *path, mode_t mode) { 800a7b0: 37 9c ff 84 addi sp,sp,-124 800a7b4: 5b 8b 00 34 sw (sp+52),r11 800a7b8: 5b 8c 00 30 sw (sp+48),r12 800a7bc: 5b 8d 00 2c sw (sp+44),r13 800a7c0: 5b 8e 00 28 sw (sp+40),r14 800a7c4: 5b 8f 00 24 sw (sp+36),r15 800a7c8: 5b 90 00 20 sw (sp+32),r16 800a7cc: 5b 91 00 1c sw (sp+28),r17 800a7d0: 5b 92 00 18 sw (sp+24),r18 800a7d4: 5b 93 00 14 sw (sp+20),r19 800a7d8: 5b 94 00 10 sw (sp+16),r20 800a7dc: 5b 95 00 0c sw (sp+12),r21 800a7e0: 5b 96 00 08 sw (sp+8),r22 800a7e4: 5b 9d 00 04 sw (sp+4),ra 800a7e8: b8 40 b0 00 mv r22,r2 int success = 0; char *dup_path = strdup(path); 800a7ec: f8 00 0c db calli 800db58 800a7f0: b8 20 60 00 mv r12,r1 if (dup_path != NULL) { success = build(dup_path, mode); free(dup_path); } return success != 0 ? 0 : -1; 800a7f4: 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) { 800a7f8: 45 80 00 4d be r12,r0,800a92c <== NEVER TAKEN char *p; p = path; oumask = 0; retval = 1; if (p[0] == '/') /* Skip leading '/'. */ 800a7fc: 41 8b 00 00 lbu r11,(r12+0) 800a800: 34 0e 00 00 mvi r14,0 800a804: 34 01 00 01 mvi r1,1 ++p; 800a808: 65 6b 00 2f cmpei r11,r11,47 retval = 0; break; } } if (!last) *p = '/'; 800a80c: 34 15 00 2f mvi r21,47 p = path; oumask = 0; retval = 1; if (p[0] == '/') /* Skip leading '/'. */ ++p; 800a810: 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) { 800a814: 34 14 00 11 mvi r20,17 if (stat(path, &sb) < 0) { 800a818: 37 93 00 38 addi r19,sp,56 retval = 0; break; } else if (!S_ISDIR(sb.st_mode)) { 800a81c: 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) { 800a820: 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); 800a824: 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] != '/') 800a828: 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') 800a82c: 41 64 00 00 lbu r4,(r11+0) last = 1; 800a830: 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') 800a834: 44 80 00 03 be r4,r0,800a840 last = 1; else if (p[0] != '/') 800a838: 5c 8f 00 33 bne r4,r15,800a904 800a83c: 34 03 00 00 mvi r3,0 continue; *p = '\0'; 800a840: 31 60 00 00 sb (r11+0),r0 if (!last && p[1] == '\0') 800a844: 34 0d 00 01 mvi r13,1 800a848: 5c 60 00 03 bne r3,r0,800a854 800a84c: 41 6d 00 01 lbu r13,(r11+1) 800a850: 65 ad 00 00 cmpei r13,r13,0 last = 1; if (first) { 800a854: 44 20 00 06 be r1,r0,800a86c * mkdir [-m mode] dir * * We change the user's umask and then restore it, * instead of doing chmod's. */ oumask = umask(0); 800a858: 34 01 00 00 mvi r1,0 800a85c: f8 00 00 79 calli 800aa40 800a860: b8 20 70 00 mv r14,r1 numask = oumask & ~(S_IWUSR | S_IXUSR); (void)umask(numask); 800a864: a0 30 08 00 and r1,r1,r16 800a868: f8 00 00 76 calli 800aa40 first = 0; } if (last) (void)umask(oumask); if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) { 800a86c: 34 03 01 ff mvi r3,511 oumask = umask(0); numask = oumask & ~(S_IWUSR | S_IXUSR); (void)umask(numask); first = 0; } if (last) 800a870: 45 a0 00 04 be r13,r0,800a880 (void)umask(oumask); 800a874: b9 c0 08 00 mv r1,r14 800a878: f8 00 00 72 calli 800aa40 if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) { 800a87c: ba c0 18 00 mv r3,r22 800a880: b9 80 08 00 mv r1,r12 800a884: b8 60 10 00 mv r2,r3 800a888: fb ff e1 d7 calli 8002fe4 800a88c: 4c 20 00 1b bge r1,r0,800a8f8 if (errno == EEXIST || errno == EISDIR) { 800a890: f8 00 08 34 calli 800c960 <__errno> 800a894: 28 21 00 00 lw r1,(r1+0) 800a898: 44 34 00 04 be r1,r20,800a8a8 800a89c: f8 00 08 31 calli 800c960 <__errno> 800a8a0: 28 21 00 00 lw r1,(r1+0) 800a8a4: 5c 31 00 1a bne r1,r17,800a90c <== ALWAYS TAKEN if (stat(path, &sb) < 0) { 800a8a8: b9 80 08 00 mv r1,r12 800a8ac: ba 60 10 00 mv r2,r19 800a8b0: f8 00 00 32 calli 800a978 800a8b4: 48 01 00 16 bg r0,r1,800a90c <== NEVER TAKEN retval = 0; break; } else if (!S_ISDIR(sb.st_mode)) { 800a8b8: 2b 81 00 44 lw r1,(sp+68) 800a8bc: 20 21 f0 00 andi r1,r1,0xf000 800a8c0: 44 32 00 0c be r1,r18,800a8f0 if (last) 800a8c4: 45 a0 00 06 be r13,r0,800a8dc errno = EEXIST; 800a8c8: f8 00 08 26 calli 800c960 <__errno> 800a8cc: 34 02 00 11 mvi r2,17 800a8d0: 58 22 00 00 sw (r1+0),r2 else errno = ENOTDIR; retval = 0; 800a8d4: 34 0b 00 00 mvi r11,0 800a8d8: e0 00 00 11 bi 800a91c break; } else if (!S_ISDIR(sb.st_mode)) { if (last) errno = EEXIST; else errno = ENOTDIR; 800a8dc: f8 00 08 21 calli 800c960 <__errno> 800a8e0: 34 02 00 14 mvi r2,20 800a8e4: 58 22 00 00 sw (r1+0),r2 retval = 0; 800a8e8: 34 0b 00 00 mvi r11,0 800a8ec: e0 00 00 0a bi 800a914 break; } if (last) 800a8f0: 5d a0 00 1e bne r13,r0,800a968 800a8f4: e0 00 00 02 bi 800a8fc } else { retval = 0; break; } } if (!last) 800a8f8: 5d a0 00 1e bne r13,r0,800a970 *p = '/'; 800a8fc: 31 75 00 00 sb (r11+0),r21 800a900: 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) { 800a904: 35 6b 00 01 addi r11,r11,1 800a908: e3 ff ff c9 bi 800a82c 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; 800a90c: 34 0b 00 00 mvi r11,0 } } if (!last) *p = '/'; } if (!first && !last) 800a910: 5d a0 00 03 bne r13,r0,800a91c <== ALWAYS TAKEN (void)umask(oumask); 800a914: b9 c0 08 00 mv r1,r14 800a918: f8 00 00 4a calli 800aa40 int success = 0; char *dup_path = strdup(path); if (dup_path != NULL) { success = build(dup_path, mode); free(dup_path); 800a91c: b9 80 08 00 mv r1,r12 800a920: fb ff df af calli 80027dc } return success != 0 ? 0 : -1; 800a924: 7d 61 00 00 cmpnei r1,r11,0 800a928: 34 21 ff ff addi r1,r1,-1 } 800a92c: 2b 9d 00 04 lw ra,(sp+4) 800a930: 2b 8b 00 34 lw r11,(sp+52) 800a934: 2b 8c 00 30 lw r12,(sp+48) 800a938: 2b 8d 00 2c lw r13,(sp+44) 800a93c: 2b 8e 00 28 lw r14,(sp+40) 800a940: 2b 8f 00 24 lw r15,(sp+36) 800a944: 2b 90 00 20 lw r16,(sp+32) 800a948: 2b 91 00 1c lw r17,(sp+28) 800a94c: 2b 92 00 18 lw r18,(sp+24) 800a950: 2b 93 00 14 lw r19,(sp+20) 800a954: 2b 94 00 10 lw r20,(sp+16) 800a958: 2b 95 00 0c lw r21,(sp+12) 800a95c: 2b 96 00 08 lw r22,(sp+8) 800a960: 37 9c 00 7c addi sp,sp,124 800a964: c3 a0 00 00 ret errno = ENOTDIR; retval = 0; break; } if (last) retval = 2; 800a968: 34 0b 00 02 mvi r11,2 800a96c: e3 ff ff ec bi 800a91c } else { retval = 0; break; } } if (!last) 800a970: 34 0b 00 01 mvi r11,1 800a974: e3 ff ff ea bi 800a91c =============================================================================== 0801191c : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 801191c: 37 9c ff d8 addi sp,sp,-40 8011920: 5b 8b 00 28 sw (sp+40),r11 8011924: 5b 8c 00 24 sw (sp+36),r12 8011928: 5b 8d 00 20 sw (sp+32),r13 801192c: 5b 8e 00 1c sw (sp+28),r14 8011930: 5b 8f 00 18 sw (sp+24),r15 8011934: 5b 90 00 14 sw (sp+20),r16 8011938: 5b 91 00 10 sw (sp+16),r17 801193c: 5b 92 00 0c sw (sp+12),r18 8011940: 5b 93 00 08 sw (sp+8),r19 8011944: 5b 9d 00 04 sw (sp+4),ra register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; 8011948: 34 07 00 03 mvi r7,3 uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 801194c: b8 20 88 00 mv r17,r1 8011950: b8 40 70 00 mv r14,r2 8011954: b8 60 78 00 mv r15,r3 8011958: b8 80 60 00 mv r12,r4 801195c: b8 a0 98 00 mv r19,r5 8011960: b8 c0 80 00 mv r16,r6 register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 8011964: 44 20 00 36 be r1,r0,8011a3c return RTEMS_INVALID_NAME; if ( !starting_address ) return RTEMS_INVALID_ADDRESS; 8011968: 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 ) 801196c: 44 40 00 34 be r2,r0,8011a3c return RTEMS_INVALID_ADDRESS; if ( !id ) 8011970: 44 c0 00 33 be r6,r0,8011a3c <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 8011974: 64 82 00 00 cmpei r2,r4,0 8011978: 64 61 00 00 cmpei r1,r3,0 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; 801197c: 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 || 8011980: b8 41 08 00 or r1,r2,r1 8011984: 5c 20 00 2e bne r1,r0,8011a3c 8011988: 54 83 00 2d bgu r4,r3,8011a3c */ RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_size_aligned ( uint32_t buffer_size ) { return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0); 801198c: 20 81 00 07 andi r1,r4,0x7 8011990: 5c 20 00 2b bne r1,r0,8011a3c ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 8011994: 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; 8011998: 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 ) ) 801199c: 5e 41 00 28 bne r18,r1,8011a3c 80119a0: 78 02 08 03 mvhi r2,0x803 80119a4: 38 42 ec 2c ori r2,r2,0xec2c 80119a8: 28 41 00 00 lw r1,(r2+0) 80119ac: 34 21 00 01 addi r1,r1,1 80119b0: 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 ); 80119b4: 78 0d 08 03 mvhi r13,0x803 80119b8: 39 ad ea 80 ori r13,r13,0xea80 80119bc: b9 a0 08 00 mv r1,r13 80119c0: f8 00 15 c7 calli 80170dc <_Objects_Allocate> 80119c4: b8 20 58 00 mv r11,r1 _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 80119c8: 5c 32 00 04 bne r1,r18,80119d8 _Thread_Enable_dispatch(); 80119cc: f8 00 1a 3b calli 80182b8 <_Thread_Enable_dispatch> return RTEMS_TOO_MANY; 80119d0: 34 07 00 05 mvi r7,5 80119d4: e0 00 00 1a bi 8011a3c } #endif the_partition->starting_address = starting_address; the_partition->length = length; the_partition->buffer_size = buffer_size; 80119d8: 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 ); 80119dc: b9 80 10 00 mv r2,r12 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 80119e0: 58 2e 00 10 sw (r1+16),r14 the_partition->length = length; 80119e4: 58 2f 00 14 sw (r1+20),r15 the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; 80119e8: 58 33 00 1c sw (r1+28),r19 the_partition->number_of_used_blocks = 0; 80119ec: 58 20 00 20 sw (r1+32),r0 _Chain_Initialize( &the_partition->Memory, starting_address, 80119f0: 34 32 00 24 addi r18,r1,36 length / buffer_size, buffer_size ); 80119f4: b9 e0 08 00 mv r1,r15 80119f8: f8 00 78 66 calli 802fb90 <__udivsi3> 80119fc: 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, 8011a00: b9 80 20 00 mv r4,r12 8011a04: ba 40 08 00 mv r1,r18 8011a08: b9 c0 10 00 mv r2,r14 8011a0c: f8 00 0e e6 calli 80155a4 <_Chain_Initialize> Objects_Name name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 8011a10: 29 6c 00 08 lw r12,(r11+8) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8011a14: 29 ad 00 1c lw r13,(r13+28) 8011a18: 34 02 00 02 mvi r2,2 8011a1c: 21 81 ff ff andi r1,r12,0xffff 8011a20: fb ff f1 0d calli 800de54 <__ashlsi3> 8011a24: b5 a1 08 00 add r1,r13,r1 8011a28: 58 2b 00 00 sw (r1+0),r11 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 8011a2c: 59 71 00 0c sw (r11+12),r17 &_Partition_Information, &the_partition->Object, (Objects_Name) name ); *id = the_partition->Object.id; 8011a30: 5a 0c 00 00 sw (r16+0),r12 name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 8011a34: f8 00 1a 21 calli 80182b8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8011a38: 34 07 00 00 mvi r7,0 } 8011a3c: b8 e0 08 00 mv r1,r7 8011a40: 2b 9d 00 04 lw ra,(sp+4) 8011a44: 2b 8b 00 28 lw r11,(sp+40) 8011a48: 2b 8c 00 24 lw r12,(sp+36) 8011a4c: 2b 8d 00 20 lw r13,(sp+32) 8011a50: 2b 8e 00 1c lw r14,(sp+28) 8011a54: 2b 8f 00 18 lw r15,(sp+24) 8011a58: 2b 90 00 14 lw r16,(sp+20) 8011a5c: 2b 91 00 10 lw r17,(sp+16) 8011a60: 2b 92 00 0c lw r18,(sp+12) 8011a64: 2b 93 00 08 lw r19,(sp+8) 8011a68: 37 9c 00 28 addi sp,sp,40 8011a6c: c3 a0 00 00 ret =============================================================================== 0800ad44 : rtems_status_code rtems_rate_monotonic_get_status( rtems_id id, rtems_rate_monotonic_period_status *status ) { 800ad44: 37 9c ff e4 addi sp,sp,-28 800ad48: 5b 8b 00 08 sw (sp+8),r11 800ad4c: 5b 9d 00 04 sw (sp+4),ra 800ad50: b8 20 18 00 mv r3,r1 800ad54: b8 40 58 00 mv r11,r2 Rate_monotonic_Period_time_t since_last_period; Rate_monotonic_Control *the_period; bool valid_status; if ( !status ) return RTEMS_INVALID_ADDRESS; 800ad58: 34 01 00 09 mvi r1,9 Objects_Locations location; Rate_monotonic_Period_time_t since_last_period; Rate_monotonic_Control *the_period; bool valid_status; if ( !status ) 800ad5c: 44 40 00 26 be r2,r0,800adf4 <== NEVER TAKEN 800ad60: 78 01 08 01 mvhi r1,0x801 800ad64: b8 60 10 00 mv r2,r3 800ad68: 38 21 f8 18 ori r1,r1,0xf818 800ad6c: 37 83 00 1c addi r3,sp,28 800ad70: fb ff ee f0 calli 8006930 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 800ad74: 2b 83 00 1c lw r3,(sp+28) 800ad78: 5c 60 00 1e bne r3,r0,800adf0 case OBJECTS_LOCAL: status->owner = the_period->owner->Object.id; 800ad7c: 28 24 00 40 lw r4,(r1+64) status->state = the_period->state; 800ad80: 28 22 00 38 lw r2,(r1+56) the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: status->owner = the_period->owner->Object.id; 800ad84: 28 84 00 08 lw r4,(r4+8) status->state = the_period->state; 800ad88: 59 62 00 04 sw (r11+4),r2 the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: status->owner = the_period->owner->Object.id; 800ad8c: 59 64 00 00 sw (r11+0),r4 status->state = the_period->state; /* * If the period is inactive, there is no information. */ if ( status->state == RATE_MONOTONIC_INACTIVE ) { 800ad90: 5c 43 00 06 bne r2,r3,800ada8 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timespec_Set_to_zero( &status->since_last_period ); 800ad94: 59 60 00 08 sw (r11+8),r0 800ad98: 59 60 00 0c sw (r11+12),r0 _Timespec_Set_to_zero( &status->executed_since_last_period ); 800ad9c: 59 60 00 10 sw (r11+16),r0 800ada0: 59 60 00 14 sw (r11+20),r0 800ada4: e0 00 00 10 bi 800ade4 } else { /* * Grab the current status. */ valid_status = 800ada8: 37 82 00 0c addi r2,sp,12 800adac: 37 83 00 14 addi r3,sp,20 800adb0: fb ff e4 27 calli 8003e4c <_Rate_monotonic_Get_status> _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) { 800adb4: 5c 20 00 04 bne r1,r0,800adc4 _Thread_Enable_dispatch(); 800adb8: fb ff f1 4f calli 80072f4 <_Thread_Enable_dispatch> return RTEMS_NOT_DEFINED; 800adbc: 34 01 00 0b mvi r1,11 800adc0: e0 00 00 0d bi 800adf4 } #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_To_timespec( 800adc4: 2b 81 00 0c lw r1,(sp+12) 800adc8: 59 61 00 08 sw (r11+8),r1 800adcc: 2b 81 00 10 lw r1,(sp+16) 800add0: 59 61 00 0c sw (r11+12),r1 &since_last_period, &status->since_last_period ); _Timestamp_To_timespec( 800add4: 2b 81 00 14 lw r1,(sp+20) 800add8: 59 61 00 10 sw (r11+16),r1 800addc: 2b 81 00 18 lw r1,(sp+24) 800ade0: 59 61 00 14 sw (r11+20),r1 status->since_last_period = since_last_period; status->executed_since_last_period = executed; #endif } _Thread_Enable_dispatch(); 800ade4: fb ff f1 44 calli 80072f4 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 800ade8: 34 01 00 00 mvi r1,0 800adec: e0 00 00 02 bi 800adf4 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 800adf0: 34 01 00 04 mvi r1,4 } 800adf4: 2b 9d 00 04 lw ra,(sp+4) 800adf8: 2b 8b 00 08 lw r11,(sp+8) 800adfc: 37 9c 00 1c addi sp,sp,28 800ae00: c3 a0 00 00 ret =============================================================================== 080040c4 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 80040c4: 37 9c ff e8 addi sp,sp,-24 80040c8: 5b 8b 00 14 sw (sp+20),r11 80040cc: 5b 8c 00 10 sw (sp+16),r12 80040d0: 5b 8d 00 0c sw (sp+12),r13 80040d4: 5b 8e 00 08 sw (sp+8),r14 80040d8: 5b 9d 00 04 sw (sp+4),ra 80040dc: b8 20 60 00 mv r12,r1 Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) _Objects_Get( &_Rate_monotonic_Information, id, location ); 80040e0: 78 01 08 01 mvhi r1,0x801 80040e4: b8 40 68 00 mv r13,r2 80040e8: 38 21 f8 18 ori r1,r1,0xf818 80040ec: b9 80 10 00 mv r2,r12 80040f0: 37 83 00 18 addi r3,sp,24 80040f4: f8 00 0a 0f calli 8006930 <_Objects_Get> 80040f8: 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 ) { 80040fc: 2b 81 00 18 lw r1,(sp+24) 8004100: 5c 20 00 5f bne r1,r0,800427c RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 8004104: 78 03 08 01 mvhi r3,0x801 8004108: 38 63 fb 10 ori r3,r3,0xfb10 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 800410c: 29 62 00 40 lw r2,(r11+64) 8004110: 28 61 00 0c lw r1,(r3+12) 8004114: 44 41 00 04 be r2,r1,8004124 _Thread_Enable_dispatch(); 8004118: f8 00 0c 77 calli 80072f4 <_Thread_Enable_dispatch> return RTEMS_NOT_OWNER_OF_RESOURCE; 800411c: 34 0c 00 17 mvi r12,23 8004120: e0 00 00 58 bi 8004280 } if ( length == RTEMS_PERIOD_STATUS ) { 8004124: 5d a0 00 0d bne r13,r0,8004158 switch ( the_period->state ) { 8004128: 29 61 00 38 lw r1,(r11+56) 800412c: 34 02 00 04 mvi r2,4 8004130: 34 0c 00 00 mvi r12,0 8004134: 54 22 00 07 bgu r1,r2,8004150 <== NEVER TAKEN 8004138: 78 0b 08 01 mvhi r11,0x801 800413c: 34 02 00 02 mvi r2,2 8004140: fb ff f4 53 calli 800128c <__ashlsi3> 8004144: 39 6b cc 48 ori r11,r11,0xcc48 8004148: b5 61 08 00 add r1,r11,r1 800414c: 28 2c 00 00 lw r12,(r1+0) case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 8004150: f8 00 0c 69 calli 80072f4 <_Thread_Enable_dispatch> return( return_value ); 8004154: e0 00 00 4b bi 8004280 } _ISR_Disable( level ); 8004158: 90 00 70 00 rcsr r14,IE 800415c: 34 01 ff fe mvi r1,-2 8004160: a1 c1 08 00 and r1,r14,r1 8004164: d0 01 00 00 wcsr IE,r1 if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { 8004168: 29 63 00 38 lw r3,(r11+56) 800416c: 5c 60 00 13 bne r3,r0,80041b8 _ISR_Enable( level ); 8004170: d0 0e 00 00 wcsr IE,r14 /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 8004174: b9 60 08 00 mv r1,r11 8004178: fb ff ff 6e calli 8003f30 <_Rate_monotonic_Initiate_statistics> the_period->state = RATE_MONOTONIC_ACTIVE; 800417c: 34 01 00 02 mvi r1,2 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 8004180: 78 03 08 00 mvhi r3,0x800 8004184: 59 61 00 38 sw (r11+56),r1 8004188: 38 63 46 04 ori r3,r3,0x4604 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800418c: 78 01 08 01 mvhi r1,0x801 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8004190: 59 60 00 18 sw (r11+24),r0 the_watchdog->routine = routine; 8004194: 59 63 00 2c sw (r11+44),r3 the_watchdog->id = id; 8004198: 59 6c 00 30 sw (r11+48),r12 the_watchdog->user_data = user_data; 800419c: 59 60 00 34 sw (r11+52),r0 _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; 80041a0: 59 6d 00 3c sw (r11+60),r13 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 80041a4: 59 6d 00 1c sw (r11+28),r13 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 80041a8: 38 21 fa 08 ori r1,r1,0xfa08 80041ac: 35 62 00 10 addi r2,r11,16 80041b0: f8 00 12 25 calli 8008a44 <_Watchdog_Insert> 80041b4: e0 00 00 1f bi 8004230 _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { 80041b8: 34 01 00 02 mvi r1,2 80041bc: 5c 61 00 20 bne r3,r1,800423c /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 80041c0: b9 60 08 00 mv r1,r11 80041c4: fb ff ff 80 calli 8003fc4 <_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; 80041c8: 34 01 00 01 mvi r1,1 80041cc: 59 61 00 38 sw (r11+56),r1 the_period->next_length = length; 80041d0: 59 6d 00 3c sw (r11+60),r13 _ISR_Enable( level ); 80041d4: d0 0e 00 00 wcsr IE,r14 _Thread_Executing->Wait.id = the_period->Object.id; 80041d8: 78 01 08 01 mvhi r1,0x801 80041dc: 38 21 fb 10 ori r1,r1,0xfb10 80041e0: 29 62 00 08 lw r2,(r11+8) 80041e4: 28 21 00 0c lw r1,(r1+12) 80041e8: 58 22 00 20 sw (r1+32),r2 _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 80041ec: 34 02 40 00 mvi r2,16384 80041f0: f8 00 0f 07 calli 8007e0c <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 80041f4: 90 00 08 00 rcsr r1,IE 80041f8: 34 02 ff fe mvi r2,-2 80041fc: a0 22 10 00 and r2,r1,r2 8004200: d0 02 00 00 wcsr IE,r2 local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 8004204: 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; 8004208: 29 62 00 38 lw r2,(r11+56) the_period->state = RATE_MONOTONIC_ACTIVE; 800420c: 59 63 00 38 sw (r11+56),r3 _ISR_Enable( level ); 8004210: 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 ) 8004214: 34 01 00 03 mvi r1,3 8004218: 5c 41 00 06 bne r2,r1,8004230 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 800421c: 78 01 08 01 mvhi r1,0x801 8004220: 38 21 fb 10 ori r1,r1,0xfb10 8004224: 28 21 00 0c lw r1,(r1+12) 8004228: 34 02 40 00 mvi r2,16384 800422c: f8 00 0b 55 calli 8006f80 <_Thread_Clear_state> _Thread_Enable_dispatch(); 8004230: f8 00 0c 31 calli 80072f4 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8004234: 34 0c 00 00 mvi r12,0 8004238: e0 00 00 12 bi 8004280 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 800423c: 34 0c 00 04 mvi r12,4 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_EXPIRED ) { 8004240: 5c 6c 00 10 bne r3,r12,8004280 <== NEVER TAKEN /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 8004244: b9 60 08 00 mv r1,r11 8004248: fb ff ff 5f calli 8003fc4 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 800424c: d0 0e 00 00 wcsr IE,r14 the_period->state = RATE_MONOTONIC_ACTIVE; 8004250: 34 01 00 02 mvi r1,2 8004254: 59 61 00 38 sw (r11+56),r1 8004258: 78 01 08 01 mvhi r1,0x801 800425c: 38 21 fa 08 ori r1,r1,0xfa08 8004260: 35 62 00 10 addi r2,r11,16 the_period->next_length = length; 8004264: 59 6d 00 3c sw (r11+60),r13 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8004268: 59 6d 00 1c sw (r11+28),r13 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800426c: f8 00 11 f6 calli 8008a44 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_TIMEOUT; 8004270: 34 0c 00 06 mvi r12,6 the_period->state = RATE_MONOTONIC_ACTIVE; the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 8004274: f8 00 0c 20 calli 80072f4 <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 8004278: e0 00 00 02 bi 8004280 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 800427c: 34 0c 00 04 mvi r12,4 } 8004280: b9 80 08 00 mv r1,r12 8004284: 2b 9d 00 04 lw ra,(sp+4) 8004288: 2b 8b 00 14 lw r11,(sp+20) 800428c: 2b 8c 00 10 lw r12,(sp+16) 8004290: 2b 8d 00 0c lw r13,(sp+12) 8004294: 2b 8e 00 08 lw r14,(sp+8) 8004298: 37 9c 00 18 addi sp,sp,24 800429c: c3 a0 00 00 ret =============================================================================== 080042a0 : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 80042a0: 37 9c ff 5c addi sp,sp,-164 80042a4: 5b 8b 00 44 sw (sp+68),r11 80042a8: 5b 8c 00 40 sw (sp+64),r12 80042ac: 5b 8d 00 3c sw (sp+60),r13 80042b0: 5b 8e 00 38 sw (sp+56),r14 80042b4: 5b 8f 00 34 sw (sp+52),r15 80042b8: 5b 90 00 30 sw (sp+48),r16 80042bc: 5b 91 00 2c sw (sp+44),r17 80042c0: 5b 92 00 28 sw (sp+40),r18 80042c4: 5b 93 00 24 sw (sp+36),r19 80042c8: 5b 94 00 20 sw (sp+32),r20 80042cc: 5b 95 00 1c sw (sp+28),r21 80042d0: 5b 96 00 18 sw (sp+24),r22 80042d4: 5b 97 00 14 sw (sp+20),r23 80042d8: 5b 98 00 10 sw (sp+16),r24 80042dc: 5b 99 00 0c sw (sp+12),r25 80042e0: 5b 9b 00 08 sw (sp+8),fp 80042e4: 5b 9d 00 04 sw (sp+4),ra 80042e8: b8 20 60 00 mv r12,r1 80042ec: 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 ) 80042f0: 44 40 00 72 be r2,r0,80044b8 <== NEVER TAKEN return; (*print)( context, "Period information by period\n" ); 80042f4: 78 02 08 01 mvhi r2,0x801 80042f8: 38 42 cc 5c ori r2,r2,0xcc5c 80042fc: d9 60 00 00 call r11 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 8004300: 78 02 08 01 mvhi r2,0x801 8004304: 38 42 cc 7c ori r2,r2,0xcc7c 8004308: b9 80 08 00 mv r1,r12 800430c: d9 60 00 00 call r11 (*print)( context, "--- Wall times are in seconds ---\n" ); 8004310: 78 02 08 01 mvhi r2,0x801 8004314: 38 42 cc a0 ori r2,r2,0xcca0 8004318: b9 80 08 00 mv r1,r12 800431c: d9 60 00 00 call r11 Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 8004320: 78 02 08 01 mvhi r2,0x801 8004324: 38 42 cc c4 ori r2,r2,0xccc4 8004328: b9 80 08 00 mv r1,r12 800432c: d9 60 00 00 call r11 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 8004330: 78 02 08 01 mvhi r2,0x801 8004334: b9 80 08 00 mv r1,r12 8004338: 38 42 cd 10 ori r2,r2,0xcd10 800433c: 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 ; 8004340: 78 01 08 01 mvhi r1,0x801 8004344: 38 21 f8 18 ori r1,r1,0xf818 rtems_object_get_name( the_status.owner, sizeof(name), name ); /* * Print part of report line that is not dependent on granularity */ (*print)( context, 8004348: 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, 800434c: 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, 8004350: 78 0f 08 01 mvhi r15,0x801 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 8004354: 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 ; 8004358: 28 2d 00 08 lw r13,(r1+8) id <= _Rate_monotonic_Information.maximum_id ; 800435c: b8 20 a0 00 mv r20,r1 id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 8004360: 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 ); 8004364: 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 ); 8004368: 37 93 00 a0 addi r19,sp,160 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 800436c: 3a 31 cd 5c ori r17,r17,0xcd5c { #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; 8004370: 37 97 00 60 addi r23,sp,96 _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 8004374: 37 92 00 98 addi r18,sp,152 (*print)( context, 8004378: 3a 10 cd 74 ori r16,r16,0xcd74 { #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; 800437c: 37 96 00 78 addi r22,sp,120 _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); (*print)( context, 8004380: 39 ef cd 94 ori r15,r15,0xcd94 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 8004384: 39 ce c2 a0 ori r14,r14,0xc2a0 /* * 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 ; 8004388: e0 00 00 4a bi 80044b0 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 800438c: b9 a0 08 00 mv r1,r13 8004390: bb 20 10 00 mv r2,r25 8004394: f8 00 1a 3a calli 800ac7c 8004398: b8 20 a8 00 mv r21,r1 if ( status != RTEMS_SUCCESSFUL ) 800439c: 5c 20 00 44 bne r1,r0,80044ac continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 80043a0: bb 00 10 00 mv r2,r24 80043a4: b9 a0 08 00 mv r1,r13 80043a8: f8 00 1a 67 calli 800ad44 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 80043ac: 2b 81 00 80 lw r1,(sp+128) 80043b0: 34 02 00 05 mvi r2,5 80043b4: ba 60 18 00 mv r3,r19 80043b8: f8 00 00 c3 calli 80046c4 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 80043bc: 2b 85 00 48 lw r5,(sp+72) 80043c0: 2b 86 00 4c lw r6,(sp+76) 80043c4: ba 20 10 00 mv r2,r17 80043c8: b9 80 08 00 mv r1,r12 80043cc: b9 a0 18 00 mv r3,r13 80043d0: ba 60 20 00 mv r4,r19 80043d4: d9 60 00 00 call r11 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 80043d8: 2b 82 00 48 lw r2,(sp+72) 80043dc: 5c 55 00 05 bne r2,r21,80043f0 (*print)( context, "\n" ); 80043e0: b9 80 08 00 mv r1,r12 80043e4: b9 c0 10 00 mv r2,r14 80043e8: d9 60 00 00 call r11 continue; 80043ec: e0 00 00 30 bi 80044ac 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 ); 80043f0: ba 40 18 00 mv r3,r18 80043f4: ba e0 08 00 mv r1,r23 80043f8: f8 00 10 49 calli 800851c <_Timespec_Divide_by_integer> (*print)( context, 80043fc: 2b 81 00 54 lw r1,(sp+84) 8004400: 34 02 03 e8 mvi r2,1000 8004404: f8 00 5c 10 calli 801b444 <__divsi3> 8004408: b8 20 d8 00 mv fp,r1 800440c: 2b 81 00 5c lw r1,(sp+92) 8004410: 34 02 03 e8 mvi r2,1000 8004414: f8 00 5c 0c calli 801b444 <__divsi3> 8004418: b8 20 a8 00 mv r21,r1 800441c: 2b 81 00 9c lw r1,(sp+156) 8004420: 34 02 03 e8 mvi r2,1000 8004424: f8 00 5c 08 calli 801b444 <__divsi3> 8004428: 2b 85 00 58 lw r5,(sp+88) 800442c: 2b 87 00 98 lw r7,(sp+152) 8004430: 2b 83 00 50 lw r3,(sp+80) 8004434: b8 20 40 00 mv r8,r1 8004438: bb 60 20 00 mv r4,fp 800443c: ba a0 30 00 mv r6,r21 8004440: ba 00 10 00 mv r2,r16 8004444: b9 80 08 00 mv r1,r12 8004448: 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); 800444c: 2b 82 00 48 lw r2,(sp+72) 8004450: ba 40 18 00 mv r3,r18 8004454: ba c0 08 00 mv r1,r22 8004458: f8 00 10 31 calli 800851c <_Timespec_Divide_by_integer> (*print)( context, 800445c: 2b 81 00 6c lw r1,(sp+108) 8004460: 34 02 03 e8 mvi r2,1000 8004464: f8 00 5b f8 calli 801b444 <__divsi3> 8004468: b8 20 d8 00 mv fp,r1 800446c: 2b 81 00 74 lw r1,(sp+116) 8004470: 34 02 03 e8 mvi r2,1000 8004474: f8 00 5b f4 calli 801b444 <__divsi3> 8004478: b8 20 a8 00 mv r21,r1 800447c: 2b 81 00 9c lw r1,(sp+156) 8004480: 34 02 03 e8 mvi r2,1000 8004484: f8 00 5b f0 calli 801b444 <__divsi3> 8004488: 2b 83 00 68 lw r3,(sp+104) 800448c: 2b 85 00 70 lw r5,(sp+112) 8004490: 2b 87 00 98 lw r7,(sp+152) 8004494: b8 20 40 00 mv r8,r1 8004498: b9 e0 10 00 mv r2,r15 800449c: b9 80 08 00 mv r1,r12 80044a0: bb 60 20 00 mv r4,fp 80044a4: ba a0 30 00 mv r6,r21 80044a8: 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++ ) { 80044ac: 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 ; 80044b0: 2a 81 00 0c lw r1,(r20+12) 80044b4: 50 2d ff b6 bgeu r1,r13,800438c the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall ); #endif } } } 80044b8: 2b 9d 00 04 lw ra,(sp+4) 80044bc: 2b 8b 00 44 lw r11,(sp+68) 80044c0: 2b 8c 00 40 lw r12,(sp+64) 80044c4: 2b 8d 00 3c lw r13,(sp+60) 80044c8: 2b 8e 00 38 lw r14,(sp+56) 80044cc: 2b 8f 00 34 lw r15,(sp+52) 80044d0: 2b 90 00 30 lw r16,(sp+48) 80044d4: 2b 91 00 2c lw r17,(sp+44) 80044d8: 2b 92 00 28 lw r18,(sp+40) 80044dc: 2b 93 00 24 lw r19,(sp+36) 80044e0: 2b 94 00 20 lw r20,(sp+32) 80044e4: 2b 95 00 1c lw r21,(sp+28) 80044e8: 2b 96 00 18 lw r22,(sp+24) 80044ec: 2b 97 00 14 lw r23,(sp+20) 80044f0: 2b 98 00 10 lw r24,(sp+16) 80044f4: 2b 99 00 0c lw r25,(sp+12) 80044f8: 2b 9b 00 08 lw fp,(sp+8) 80044fc: 37 9c 00 a4 addi sp,sp,164 8004500: c3 a0 00 00 ret =============================================================================== 08013344 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 8013344: 37 9c ff f4 addi sp,sp,-12 8013348: 5b 8b 00 08 sw (sp+8),r11 801334c: 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; 8013350: 34 03 00 0a mvi r3,10 rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 8013354: 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 ) 8013358: 44 40 00 29 be r2,r0,80133fc return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 801335c: 37 82 00 0c addi r2,sp,12 8013360: f8 00 13 e3 calli 80182ec <_Thread_Get> switch ( location ) { 8013364: 2b 82 00 0c lw r2,(sp+12) case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 8013368: 34 03 00 04 mvi r3,4 if ( !signal_set ) return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); switch ( location ) { 801336c: 5c 40 00 24 bne r2,r0,80133fc case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 8013370: 28 23 01 24 lw r3,(r1+292) asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 8013374: 28 64 00 0c lw r4,(r3+12) 8013378: 44 82 00 1f be r4,r2,80133f4 if ( asr->is_enabled ) { 801337c: 40 62 00 08 lbu r2,(r3+8) 8013380: 44 40 00 12 be r2,r0,80133c8 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 8013384: 90 00 10 00 rcsr r2,IE 8013388: 34 04 ff fe mvi r4,-2 801338c: a0 44 20 00 and r4,r2,r4 8013390: d0 04 00 00 wcsr IE,r4 *signal_set |= signals; 8013394: 28 64 00 14 lw r4,(r3+20) 8013398: b8 8b 58 00 or r11,r4,r11 801339c: 58 6b 00 14 sw (r3+20),r11 _ISR_Enable( _level ); 80133a0: 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 ) ) 80133a4: 78 02 08 03 mvhi r2,0x803 80133a8: 38 42 ee 00 ori r2,r2,0xee00 80133ac: 28 43 00 08 lw r3,(r2+8) 80133b0: 44 60 00 0e be r3,r0,80133e8 80133b4: 28 43 00 0c lw r3,(r2+12) 80133b8: 5c 23 00 0c bne r1,r3,80133e8 <== NEVER TAKEN _Thread_Dispatch_necessary = true; 80133bc: 34 01 00 01 mvi r1,1 80133c0: 30 41 00 18 sb (r2+24),r1 80133c4: e0 00 00 09 bi 80133e8 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 80133c8: 90 00 08 00 rcsr r1,IE 80133cc: 34 02 ff fe mvi r2,-2 80133d0: a0 22 10 00 and r2,r1,r2 80133d4: d0 02 00 00 wcsr IE,r2 *signal_set |= signals; 80133d8: 28 62 00 18 lw r2,(r3+24) 80133dc: b8 4b 58 00 or r11,r2,r11 80133e0: 58 6b 00 18 sw (r3+24),r11 _ISR_Enable( _level ); 80133e4: d0 01 00 00 wcsr IE,r1 } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 80133e8: f8 00 13 b4 calli 80182b8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 80133ec: 34 03 00 00 mvi r3,0 80133f0: e0 00 00 03 bi 80133fc } _Thread_Enable_dispatch(); 80133f4: f8 00 13 b1 calli 80182b8 <_Thread_Enable_dispatch> return RTEMS_NOT_DEFINED; 80133f8: 34 03 00 0b mvi r3,11 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80133fc: b8 60 08 00 mv r1,r3 8013400: 2b 9d 00 04 lw ra,(sp+4) 8013404: 2b 8b 00 08 lw r11,(sp+8) 8013408: 37 9c 00 0c addi sp,sp,12 801340c: c3 a0 00 00 ret =============================================================================== 08000954 : Thread_Control *the_thread ) { Stack_check_Control *the_pattern; if ( the_thread->Object.id == 0 ) /* skip system tasks */ 8000954: 28 22 00 08 lw r2,(r1+8) 8000958: 44 40 00 0c be r2,r0,8000988 <== NEVER TAKEN return; the_pattern = Stack_check_Get_pattern_area(&the_thread->Start.Initial_stack); *the_pattern = Stack_check_Pattern; 800095c: 28 22 00 c4 lw r2,(r1+196) 8000960: 78 01 08 01 mvhi r1,0x801 8000964: 38 21 36 b8 ori r1,r1,0x36b8 8000968: 28 25 00 00 lw r5,(r1+0) 800096c: 28 24 00 04 lw r4,(r1+4) 8000970: 28 23 00 08 lw r3,(r1+8) 8000974: 28 21 00 0c lw r1,(r1+12) 8000978: 58 45 00 08 sw (r2+8),r5 800097c: 58 44 00 0c sw (r2+12),r4 8000980: 58 43 00 10 sw (r2+16),r3 8000984: 58 41 00 14 sw (r2+20),r1 8000988: c3 a0 00 00 ret =============================================================================== 08000918 : */ bool rtems_stack_checker_create_extension( Thread_Control *running __attribute__((unused)), Thread_Control *the_thread ) { 8000918: 37 9c ff f8 addi sp,sp,-8 800091c: 5b 8b 00 08 sw (sp+8),r11 8000920: 5b 9d 00 04 sw (sp+4),ra 8000924: b8 40 58 00 mv r11,r2 Stack_check_Initialize(); 8000928: fb ff ff d0 calli 8000868 if (the_thread) 800092c: 45 60 00 05 be r11,r0,8000940 <== NEVER TAKEN Stack_check_Dope_stack(&the_thread->Start.Initial_stack); 8000930: 29 61 00 c4 lw r1,(r11+196) 8000934: 29 63 00 c0 lw r3,(r11+192) 8000938: 34 02 00 a5 mvi r2,165 800093c: f8 00 2d 54 calli 800be8c return true; } 8000940: 34 01 00 01 mvi r1,1 8000944: 2b 9d 00 04 lw ra,(sp+4) 8000948: 2b 8b 00 08 lw r11,(sp+8) 800094c: 37 9c 00 08 addi sp,sp,8 8000950: c3 a0 00 00 ret =============================================================================== 08000abc : /* * Check if blown */ bool rtems_stack_checker_is_blown( void ) { 8000abc: 37 9c ff f4 addi sp,sp,-12 8000ac0: 5b 9b 00 08 sw (sp+8),fp 8000ac4: 34 1b 00 0c mvi fp,12 8000ac8: b7 7c d8 00 add fp,fp,sp 8000acc: 5b 8b 00 0c sw (sp+12),r11 8000ad0: 5b 9d 00 04 sw (sp+4),ra Stack_Control *the_stack = &_Thread_Executing->Start.Initial_stack; 8000ad4: 78 01 08 01 mvhi r1,0x801 8000ad8: 38 21 39 d8 ori r1,r1,0x39d8 8000adc: 28 22 00 0c lw r2,(r1+12) { #if defined(__GNUC__) void *sp = __builtin_frame_address(0); if ( sp < the_stack->area ) { return false; 8000ae0: 34 0b 00 00 mvi r11,0 ) { #if defined(__GNUC__) void *sp = __builtin_frame_address(0); if ( sp < the_stack->area ) { 8000ae4: 28 41 00 c4 lw r1,(r2+196) 8000ae8: 54 3b 00 04 bgu r1,fp,8000af8 <== NEVER TAKEN return false; } if ( sp > (the_stack->area + the_stack->size) ) { 8000aec: 28 4b 00 c0 lw r11,(r2+192) } /* * Check if blown */ bool rtems_stack_checker_is_blown( void ) 8000af0: b4 2b 58 00 add r11,r1,r11 8000af4: f1 7b 58 00 cmpgeu r11,r11,fp /* * The stack checker must be initialized before the pattern is there * to check. */ if ( Stack_check_Initialized ) { 8000af8: 78 02 08 01 mvhi r2,0x801 8000afc: 38 42 36 34 ori r2,r2,0x3634 8000b00: 28 43 00 00 lw r3,(r2+0) */ bool rtems_stack_checker_is_blown( void ) { Stack_Control *the_stack = &_Thread_Executing->Start.Initial_stack; bool sp_ok; bool pattern_ok = true; 8000b04: 34 02 00 01 mvi r2,1 /* * The stack checker must be initialized before the pattern is there * to check. */ if ( Stack_check_Initialized ) { 8000b08: 44 60 00 07 be r3,r0,8000b24 <== NEVER TAKEN pattern_ok = (!memcmp( 8000b0c: 78 02 08 01 mvhi r2,0x801 8000b10: 38 42 36 b8 ori r2,r2,0x36b8 8000b14: 34 21 00 08 addi r1,r1,8 8000b18: 34 03 00 10 mvi r3,16 8000b1c: f8 00 2c 7a calli 800bd04 8000b20: 64 22 00 00 cmpei r2,r1,0 /* * Let's report as much as we can. */ if ( !sp_ok || !pattern_ok ) { 8000b24: 45 60 00 02 be r11,r0,8000b2c <== NEVER TAKEN 8000b28: 5c 40 00 05 bne r2,r0,8000b3c <== ALWAYS TAKEN Stack_check_report_blown_task( _Thread_Executing, pattern_ok ); 8000b2c: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8000b30: 38 21 39 d8 ori r1,r1,0x39d8 <== NOT EXECUTED 8000b34: 28 21 00 0c lw r1,(r1+12) <== NOT EXECUTED 8000b38: fb ff ff 95 calli 800098c <== NOT EXECUTED /* * The Stack Pointer and the Pattern Area are OK so return false. */ return false; } 8000b3c: 34 01 00 00 mvi r1,0 8000b40: 2b 9d 00 04 lw ra,(sp+4) 8000b44: 2b 8b 00 0c lw r11,(sp+12) 8000b48: 2b 9b 00 08 lw fp,(sp+8) 8000b4c: 37 9c 00 0c addi sp,sp,12 8000b50: c3 a0 00 00 ret =============================================================================== 08000b54 : void rtems_stack_checker_report_usage_with_plugin( void *context, rtems_printk_plugin_t print ) { 8000b54: 37 9c ff ec addi sp,sp,-20 8000b58: 5b 8b 00 14 sw (sp+20),r11 8000b5c: 5b 8c 00 10 sw (sp+16),r12 8000b60: 5b 8d 00 0c sw (sp+12),r13 8000b64: 5b 8e 00 08 sw (sp+8),r14 8000b68: 5b 9d 00 04 sw (sp+4),ra 8000b6c: b8 20 70 00 mv r14,r1 8000b70: b8 40 68 00 mv r13,r2 if ( !print ) 8000b74: 44 40 00 15 be r2,r0,8000bc8 <== NEVER TAKEN return; print_context = context; print_handler = print; 8000b78: 78 0b 08 01 mvhi r11,0x801 8000b7c: 39 6b 36 30 ori r11,r11,0x3630 ) { if ( !print ) return; print_context = context; 8000b80: 78 0c 08 01 mvhi r12,0x801 8000b84: 39 8c 36 2c ori r12,r12,0x362c print_handler = print; 8000b88: 59 62 00 00 sw (r11+0),r2 (*print)( context, "Stack usage by thread\n"); 8000b8c: 78 02 08 01 mvhi r2,0x801 8000b90: 38 42 18 74 ori r2,r2,0x1874 ) { if ( !print ) return; print_context = context; 8000b94: 59 81 00 00 sw (r12+0),r1 print_handler = print; (*print)( context, "Stack usage by thread\n"); 8000b98: d9 a0 00 00 call r13 (*print)( context, 8000b9c: 78 02 08 01 mvhi r2,0x801 8000ba0: 38 42 18 8c ori r2,r2,0x188c 8000ba4: b9 c0 08 00 mv r1,r14 8000ba8: 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 ); 8000bac: 78 01 08 00 mvhi r1,0x800 8000bb0: 38 21 06 a0 ori r1,r1,0x6a0 8000bb4: f8 00 0d 2d calli 8004068 #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) /* dump interrupt stack info if any */ Stack_check_Dump_threads_usage((Thread_Control *) -1); 8000bb8: 34 01 ff ff mvi r1,-1 8000bbc: fb ff fe b9 calli 80006a0 #endif print_context = NULL; 8000bc0: 59 80 00 00 sw (r12+0),r0 print_handler = NULL; 8000bc4: 59 60 00 00 sw (r11+0),r0 } 8000bc8: 2b 9d 00 04 lw ra,(sp+4) 8000bcc: 2b 8b 00 14 lw r11,(sp+20) 8000bd0: 2b 8c 00 10 lw r12,(sp+16) 8000bd4: 2b 8d 00 0c lw r13,(sp+12) 8000bd8: 2b 8e 00 08 lw r14,(sp+8) 8000bdc: 37 9c 00 14 addi sp,sp,20 8000be0: c3 a0 00 00 ret =============================================================================== 08000a44 : */ void rtems_stack_checker_switch_extension( Thread_Control *running __attribute__((unused)), Thread_Control *heir __attribute__((unused)) ) { 8000a44: 37 9c ff f0 addi sp,sp,-16 8000a48: 5b 9b 00 08 sw (sp+8),fp 8000a4c: 34 1b 00 10 mvi fp,16 8000a50: b7 7c d8 00 add fp,fp,sp 8000a54: 5b 8b 00 10 sw (sp+16),r11 8000a58: 5b 8c 00 0c sw (sp+12),r12 8000a5c: 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; 8000a60: 28 22 00 c4 lw r2,(r1+196) */ void rtems_stack_checker_switch_extension( Thread_Control *running __attribute__((unused)), Thread_Control *heir __attribute__((unused)) ) { 8000a64: b8 20 58 00 mv r11,r1 { #if defined(__GNUC__) void *sp = __builtin_frame_address(0); if ( sp < the_stack->area ) { return false; 8000a68: 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; 8000a6c: 34 41 00 08 addi r1,r2,8 ) { #if defined(__GNUC__) void *sp = __builtin_frame_address(0); if ( sp < the_stack->area ) { 8000a70: 54 5b 00 04 bgu r2,fp,8000a80 <== NEVER TAKEN return false; } if ( sp > (the_stack->area + the_stack->size) ) { 8000a74: 29 6c 00 c0 lw r12,(r11+192) } /* * rtems_stack_checker_switch_extension */ void rtems_stack_checker_switch_extension( 8000a78: b4 4c 10 00 add r2,r2,r12 8000a7c: 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, 8000a80: 78 02 08 01 mvhi r2,0x801 8000a84: 38 42 36 b8 ori r2,r2,0x36b8 8000a88: 34 03 00 10 mvi r3,16 8000a8c: f8 00 2c 9e calli 800bd04 8000a90: 64 22 00 00 cmpei r2,r1,0 (void *) Stack_check_Pattern.pattern, PATTERN_SIZE_BYTES)); if ( !sp_ok || !pattern_ok ) { 8000a94: 45 80 00 02 be r12,r0,8000a9c 8000a98: 5c 40 00 03 bne r2,r0,8000aa4 Stack_check_report_blown_task( running, pattern_ok ); 8000a9c: b9 60 08 00 mv r1,r11 8000aa0: fb ff ff bb calli 800098c } } 8000aa4: 2b 9d 00 04 lw ra,(sp+4) 8000aa8: 2b 8b 00 10 lw r11,(sp+16) 8000aac: 2b 8c 00 0c lw r12,(sp+12) 8000ab0: 2b 9b 00 08 lw fp,(sp+8) 8000ab4: 37 9c 00 10 addi sp,sp,16 8000ab8: c3 a0 00 00 ret =============================================================================== 08008dbc : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008dbc: 37 9c ff e4 addi sp,sp,-28 8008dc0: 5b 8b 00 18 sw (sp+24),r11 8008dc4: 5b 8c 00 14 sw (sp+20),r12 8008dc8: 5b 8d 00 10 sw (sp+16),r13 8008dcc: 5b 8e 00 0c sw (sp+12),r14 8008dd0: 5b 8f 00 08 sw (sp+8),r15 8008dd4: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 8008dd8: 34 04 00 09 mvi r4,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008ddc: b8 20 70 00 mv r14,r1 8008de0: b8 40 58 00 mv r11,r2 8008de4: b8 60 78 00 mv r15,r3 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8008de8: 44 40 00 21 be r2,r0,8008e6c return RTEMS_INVALID_ADDRESS; errno = 0; 8008dec: f8 00 0c 91 calli 800c030 <__errno> 8008df0: 58 20 00 00 sw (r1+0),r0 *n = 0; 8008df4: 59 60 00 00 sw (r11+0),r0 8008df8: 59 60 00 04 sw (r11+4),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); 8008dfc: b9 c0 08 00 mv r1,r14 8008e00: 37 82 00 1c addi r2,sp,28 8008e04: f8 00 17 99 calli 800ec68 8008e08: b8 20 68 00 mv r13,r1 8008e0c: 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 ) 8008e10: 45 e0 00 03 be r15,r0,8008e1c *endptr = end; 8008e14: 2b 81 00 1c lw r1,(sp+28) 8008e18: 59 e1 00 00 sw (r15+0),r1 /* nothing was converted */ if ( end == s ) 8008e1c: 2b 81 00 1c lw r1,(sp+28) return RTEMS_NOT_DEFINED; 8008e20: 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 ) 8008e24: 44 2e 00 12 be r1,r14,8008e6c return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8008e28: 78 04 08 01 mvhi r4,0x801 8008e2c: 38 84 ef 14 ori r4,r4,0xef14 8008e30: 28 83 00 00 lw r3,(r4+0) 8008e34: b9 a0 08 00 mv r1,r13 8008e38: b9 80 10 00 mv r2,r12 8008e3c: 34 04 ff ff mvi r4,-1 8008e40: f8 00 45 29 calli 801a2e4 <__gedf2> 8008e44: 48 20 00 02 bg r1,r0,8008e4c 8008e48: e0 00 00 06 bi 8008e60 8008e4c: f8 00 0c 79 calli 800c030 <__errno> 8008e50: 28 22 00 00 lw r2,(r1+0) 8008e54: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 8008e58: 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)) 8008e5c: 44 41 00 04 be r2,r1,8008e6c <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 8008e60: 59 6d 00 00 sw (r11+0),r13 8008e64: 59 6c 00 04 sw (r11+4),r12 #endif return RTEMS_SUCCESSFUL; 8008e68: 34 04 00 00 mvi r4,0 } 8008e6c: b8 80 08 00 mv r1,r4 8008e70: 2b 9d 00 04 lw ra,(sp+4) 8008e74: 2b 8b 00 18 lw r11,(sp+24) 8008e78: 2b 8c 00 14 lw r12,(sp+20) 8008e7c: 2b 8d 00 10 lw r13,(sp+16) 8008e80: 2b 8e 00 0c lw r14,(sp+12) 8008e84: 2b 8f 00 08 lw r15,(sp+8) 8008e88: 37 9c 00 1c addi sp,sp,28 8008e8c: c3 a0 00 00 ret =============================================================================== 08008e90 : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008e90: 37 9c ff e8 addi sp,sp,-24 8008e94: 5b 8b 00 14 sw (sp+20),r11 8008e98: 5b 8c 00 10 sw (sp+16),r12 8008e9c: 5b 8d 00 0c sw (sp+12),r13 8008ea0: 5b 8e 00 08 sw (sp+8),r14 8008ea4: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 8008ea8: 34 04 00 09 mvi r4,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008eac: b8 20 68 00 mv r13,r1 8008eb0: b8 40 58 00 mv r11,r2 8008eb4: b8 60 70 00 mv r14,r3 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8008eb8: 44 40 00 1c be r2,r0,8008f28 return RTEMS_INVALID_ADDRESS; errno = 0; 8008ebc: f8 00 0c 5d calli 800c030 <__errno> 8008ec0: 58 20 00 00 sw (r1+0),r0 *n = 0; 8008ec4: 59 60 00 00 sw (r11+0),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); 8008ec8: b9 a0 08 00 mv r1,r13 8008ecc: 37 82 00 18 addi r2,sp,24 8008ed0: f8 00 17 72 calli 800ec98 8008ed4: 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 ) 8008ed8: 45 c0 00 03 be r14,r0,8008ee4 *endptr = end; 8008edc: 2b 81 00 18 lw r1,(sp+24) 8008ee0: 59 c1 00 00 sw (r14+0),r1 /* nothing was converted */ if ( end == s ) 8008ee4: 2b 81 00 18 lw r1,(sp+24) return RTEMS_NOT_DEFINED; 8008ee8: 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 ) 8008eec: 44 2d 00 0f be r1,r13,8008f28 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8008ef0: 78 03 08 01 mvhi r3,0x801 8008ef4: 38 63 ef 18 ori r3,r3,0xef18 8008ef8: 28 62 00 00 lw r2,(r3+0) 8008efc: b9 80 08 00 mv r1,r12 8008f00: f8 00 3e ff calli 8018afc <__gesf2> 8008f04: 48 20 00 02 bg r1,r0,8008f0c 8008f08: e0 00 00 06 bi 8008f20 8008f0c: f8 00 0c 49 calli 800c030 <__errno> 8008f10: 28 22 00 00 lw r2,(r1+0) 8008f14: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 8008f18: 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)) 8008f1c: 44 41 00 03 be r2,r1,8008f28 <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 8008f20: 59 6c 00 00 sw (r11+0),r12 #endif return RTEMS_SUCCESSFUL; 8008f24: 34 04 00 00 mvi r4,0 } 8008f28: b8 80 08 00 mv r1,r4 8008f2c: 2b 9d 00 04 lw ra,(sp+4) 8008f30: 2b 8b 00 14 lw r11,(sp+20) 8008f34: 2b 8c 00 10 lw r12,(sp+16) 8008f38: 2b 8d 00 0c lw r13,(sp+12) 8008f3c: 2b 8e 00 08 lw r14,(sp+8) 8008f40: 37 9c 00 18 addi sp,sp,24 8008f44: c3 a0 00 00 ret =============================================================================== 08008ffc : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008ffc: 37 9c ff e4 addi sp,sp,-28 8009000: 5b 8b 00 18 sw (sp+24),r11 8009004: 5b 8c 00 14 sw (sp+20),r12 8009008: 5b 8d 00 10 sw (sp+16),r13 800900c: 5b 8e 00 0c sw (sp+12),r14 8009010: 5b 8f 00 08 sw (sp+8),r15 8009014: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 8009018: 34 05 00 09 mvi r5,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 800901c: b8 20 70 00 mv r14,r1 8009020: b8 40 58 00 mv r11,r2 8009024: b8 60 78 00 mv r15,r3 8009028: b8 80 60 00 mv r12,r4 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 800902c: 44 40 00 22 be r2,r0,80090b4 return RTEMS_INVALID_ADDRESS; errno = 0; 8009030: f8 00 0c 00 calli 800c030 <__errno> 8009034: 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 ); 8009038: b9 80 18 00 mv r3,r12 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 800903c: 59 60 00 00 sw (r11+0),r0 8009040: 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 ); 8009044: b9 c0 08 00 mv r1,r14 8009048: 37 82 00 1c addi r2,sp,28 800904c: f8 00 17 d4 calli 800ef9c 8009050: b8 20 68 00 mv r13,r1 8009054: b8 40 60 00 mv r12,r2 #endif /* If the user wants the end pointer back, then return it. */ if ( endptr ) 8009058: 45 e0 00 03 be r15,r0,8009064 *endptr = end; 800905c: 2b 81 00 1c lw r1,(sp+28) 8009060: 59 e1 00 00 sw (r15+0),r1 /* nothing was converted */ if ( end == s ) 8009064: 2b 81 00 1c lw r1,(sp+28) return RTEMS_NOT_DEFINED; 8009068: 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 ) 800906c: 44 2e 00 12 be r1,r14,80090b4 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8009070: 78 02 08 01 mvhi r2,0x801 8009074: 38 42 e7 80 ori r2,r2,0xe780 8009078: 28 41 00 00 lw r1,(r2+0) 800907c: 5d a1 00 03 bne r13,r1,8009088 8009080: 34 01 ff ff mvi r1,-1 8009084: 45 81 00 04 be r12,r1,8009094 <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MIN /* there was an underflow */ if ( (result == STRING_TO_MIN) && (errno == ERANGE)) 8009088: 78 01 80 00 mvhi r1,0x8000 800908c: 5d a1 00 07 bne r13,r1,80090a8 8009090: 5d 80 00 06 bne r12,r0,80090a8 <== NEVER TAKEN 8009094: f8 00 0b e7 calli 800c030 <__errno> 8009098: 28 22 00 00 lw r2,(r1+0) 800909c: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 80090a0: 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)) 80090a4: 44 41 00 04 be r2,r1,80090b4 #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 80090a8: 59 6d 00 00 sw (r11+0),r13 80090ac: 59 6c 00 04 sw (r11+4),r12 #endif return RTEMS_SUCCESSFUL; 80090b0: 34 05 00 00 mvi r5,0 } 80090b4: b8 a0 08 00 mv r1,r5 80090b8: 2b 9d 00 04 lw ra,(sp+4) 80090bc: 2b 8b 00 18 lw r11,(sp+24) 80090c0: 2b 8c 00 14 lw r12,(sp+20) 80090c4: 2b 8d 00 10 lw r13,(sp+16) 80090c8: 2b 8e 00 0c lw r14,(sp+12) 80090cc: 2b 8f 00 08 lw r15,(sp+8) 80090d0: 37 9c 00 1c addi sp,sp,28 80090d4: c3 a0 00 00 ret =============================================================================== 08009194 : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8009194: 37 9c ff e8 addi sp,sp,-24 8009198: 5b 8b 00 14 sw (sp+20),r11 800919c: 5b 8c 00 10 sw (sp+16),r12 80091a0: 5b 8d 00 0c sw (sp+12),r13 80091a4: 5b 8e 00 08 sw (sp+8),r14 80091a8: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 80091ac: 34 04 00 09 mvi r4,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 80091b0: b8 20 68 00 mv r13,r1 80091b4: b8 40 58 00 mv r11,r2 80091b8: b8 60 70 00 mv r14,r3 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 80091bc: 44 40 00 18 be r2,r0,800921c return RTEMS_INVALID_ADDRESS; errno = 0; 80091c0: f8 00 0b 9c calli 800c030 <__errno> 80091c4: 58 20 00 00 sw (r1+0),r0 *n = 0; 80091c8: 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 ); 80091cc: b9 a0 08 00 mv r1,r13 80091d0: 37 82 00 18 addi r2,sp,24 80091d4: 34 03 00 10 mvi r3,16 80091d8: f8 00 18 dc calli 800f548 80091dc: 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 ) 80091e0: 45 c0 00 03 be r14,r0,80091ec *endptr = end; 80091e4: 2b 81 00 18 lw r1,(sp+24) 80091e8: 59 c1 00 00 sw (r14+0),r1 /* nothing was converted */ if ( end == s ) 80091ec: 2b 81 00 18 lw r1,(sp+24) return RTEMS_NOT_DEFINED; 80091f0: 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 ) 80091f4: 44 2d 00 0a be r1,r13,800921c return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 80091f8: 34 01 ff ff mvi r1,-1 80091fc: 5d 81 00 06 bne r12,r1,8009214 <== ALWAYS TAKEN 8009200: f8 00 0b 8c calli 800c030 <__errno> <== NOT EXECUTED 8009204: 28 22 00 00 lw r2,(r1+0) <== NOT EXECUTED 8009208: 34 01 00 22 mvi r1,34 <== NOT EXECUTED return RTEMS_INVALID_NUMBER; 800920c: 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)) 8009210: 44 41 00 03 be r2,r1,800921c <== 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; 8009214: 59 6c 00 00 sw (r11+0),r12 #else *n = (STRING_TO_TYPE) result; #endif return RTEMS_SUCCESSFUL; 8009218: 34 04 00 00 mvi r4,0 } 800921c: b8 80 08 00 mv r1,r4 8009220: 2b 9d 00 04 lw ra,(sp+4) 8009224: 2b 8b 00 14 lw r11,(sp+20) 8009228: 2b 8c 00 10 lw r12,(sp+16) 800922c: 2b 8d 00 0c lw r13,(sp+12) 8009230: 2b 8e 00 08 lw r14,(sp+8) 8009234: 37 9c 00 18 addi sp,sp,24 8009238: c3 a0 00 00 ret =============================================================================== 080092cc : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 80092cc: 37 9c ff e8 addi sp,sp,-24 80092d0: 5b 8b 00 14 sw (sp+20),r11 80092d4: 5b 8c 00 10 sw (sp+16),r12 80092d8: 5b 8d 00 0c sw (sp+12),r13 80092dc: 5b 8e 00 08 sw (sp+8),r14 80092e0: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 80092e4: 34 05 00 09 mvi r5,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 80092e8: b8 20 68 00 mv r13,r1 80092ec: b8 40 58 00 mv r11,r2 80092f0: b8 60 70 00 mv r14,r3 80092f4: b8 80 60 00 mv r12,r4 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 80092f8: 44 40 00 18 be r2,r0,8009358 return RTEMS_INVALID_ADDRESS; errno = 0; 80092fc: f8 00 0b 4d calli 800c030 <__errno> 8009300: 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 ); 8009304: b9 80 18 00 mv r3,r12 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 8009308: 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 ); 800930c: b9 a0 08 00 mv r1,r13 8009310: 37 82 00 18 addi r2,sp,24 8009314: f8 00 18 8d calli 800f548 8009318: b8 20 60 00 mv r12,r1 #endif /* If the user wants the end pointer back, then return it. */ if ( endptr ) 800931c: 45 c0 00 03 be r14,r0,8009328 *endptr = end; 8009320: 2b 81 00 18 lw r1,(sp+24) 8009324: 59 c1 00 00 sw (r14+0),r1 /* nothing was converted */ if ( end == s ) 8009328: 2b 81 00 18 lw r1,(sp+24) return RTEMS_NOT_DEFINED; 800932c: 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 ) 8009330: 44 2d 00 0a be r1,r13,8009358 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8009334: 34 01 ff ff mvi r1,-1 8009338: 5d 81 00 06 bne r12,r1,8009350 800933c: f8 00 0b 3d calli 800c030 <__errno> 8009340: 28 22 00 00 lw r2,(r1+0) 8009344: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 8009348: 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)) 800934c: 44 41 00 03 be r2,r1,8009358 <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 8009350: 59 6c 00 00 sw (r11+0),r12 #endif return RTEMS_SUCCESSFUL; 8009354: 34 05 00 00 mvi r5,0 } 8009358: b8 a0 08 00 mv r1,r5 800935c: 2b 9d 00 04 lw ra,(sp+4) 8009360: 2b 8b 00 14 lw r11,(sp+20) 8009364: 2b 8c 00 10 lw r12,(sp+16) 8009368: 2b 8d 00 0c lw r13,(sp+12) 800936c: 2b 8e 00 08 lw r14,(sp+8) 8009370: 37 9c 00 18 addi sp,sp,24 8009374: c3 a0 00 00 ret =============================================================================== 0800943c : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 800943c: 37 9c ff e8 addi sp,sp,-24 8009440: 5b 8b 00 14 sw (sp+20),r11 8009444: 5b 8c 00 10 sw (sp+16),r12 8009448: 5b 8d 00 0c sw (sp+12),r13 800944c: 5b 8e 00 08 sw (sp+8),r14 8009450: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 8009454: 34 05 00 09 mvi r5,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8009458: b8 20 68 00 mv r13,r1 800945c: b8 40 58 00 mv r11,r2 8009460: b8 60 70 00 mv r14,r3 8009464: b8 80 60 00 mv r12,r4 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8009468: 44 40 00 18 be r2,r0,80094c8 return RTEMS_INVALID_ADDRESS; errno = 0; 800946c: f8 00 0a f1 calli 800c030 <__errno> 8009470: 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 ); 8009474: b9 80 18 00 mv r3,r12 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 8009478: 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 ); 800947c: b9 a0 08 00 mv r1,r13 8009480: 37 82 00 18 addi r2,sp,24 8009484: f8 00 18 31 calli 800f548 8009488: b8 20 60 00 mv r12,r1 #endif /* If the user wants the end pointer back, then return it. */ if ( endptr ) 800948c: 45 c0 00 03 be r14,r0,8009498 *endptr = end; 8009490: 2b 81 00 18 lw r1,(sp+24) 8009494: 59 c1 00 00 sw (r14+0),r1 /* nothing was converted */ if ( end == s ) 8009498: 2b 81 00 18 lw r1,(sp+24) return RTEMS_NOT_DEFINED; 800949c: 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 ) 80094a0: 44 2d 00 0a be r1,r13,80094c8 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 80094a4: 34 01 ff ff mvi r1,-1 80094a8: 5d 81 00 06 bne r12,r1,80094c0 80094ac: f8 00 0a e1 calli 800c030 <__errno> 80094b0: 28 22 00 00 lw r2,(r1+0) 80094b4: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 80094b8: 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)) 80094bc: 44 41 00 03 be r2,r1,80094c8 <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 80094c0: 59 6c 00 00 sw (r11+0),r12 #endif return RTEMS_SUCCESSFUL; 80094c4: 34 05 00 00 mvi r5,0 } 80094c8: b8 a0 08 00 mv r1,r5 80094cc: 2b 9d 00 04 lw ra,(sp+4) 80094d0: 2b 8b 00 14 lw r11,(sp+20) 80094d4: 2b 8c 00 10 lw r12,(sp+16) 80094d8: 2b 8d 00 0c lw r13,(sp+12) 80094dc: 2b 8e 00 08 lw r14,(sp+8) 80094e0: 37 9c 00 18 addi sp,sp,24 80094e4: c3 a0 00 00 ret =============================================================================== 08009378 : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8009378: 37 9c ff e4 addi sp,sp,-28 800937c: 5b 8b 00 18 sw (sp+24),r11 8009380: 5b 8c 00 14 sw (sp+20),r12 8009384: 5b 8d 00 10 sw (sp+16),r13 8009388: 5b 8e 00 0c sw (sp+12),r14 800938c: 5b 8f 00 08 sw (sp+8),r15 8009390: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 8009394: 34 05 00 09 mvi r5,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8009398: b8 20 70 00 mv r14,r1 800939c: b8 40 58 00 mv r11,r2 80093a0: b8 60 78 00 mv r15,r3 80093a4: b8 80 60 00 mv r12,r4 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 80093a8: 44 40 00 1c be r2,r0,8009418 return RTEMS_INVALID_ADDRESS; errno = 0; 80093ac: f8 00 0b 21 calli 800c030 <__errno> 80093b0: 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 ); 80093b4: b9 80 18 00 mv r3,r12 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 80093b8: 59 60 00 00 sw (r11+0),r0 80093bc: 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 ); 80093c0: b9 c0 08 00 mv r1,r14 80093c4: 37 82 00 1c addi r2,sp,28 80093c8: f8 00 18 6e calli 800f580 80093cc: b8 20 60 00 mv r12,r1 80093d0: b8 40 68 00 mv r13,r2 #endif /* If the user wants the end pointer back, then return it. */ if ( endptr ) 80093d4: 45 e0 00 03 be r15,r0,80093e0 *endptr = end; 80093d8: 2b 81 00 1c lw r1,(sp+28) 80093dc: 59 e1 00 00 sw (r15+0),r1 /* nothing was converted */ if ( end == s ) 80093e0: 2b 81 00 1c lw r1,(sp+28) return RTEMS_NOT_DEFINED; 80093e4: 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 ) 80093e8: 44 2e 00 0c be r1,r14,8009418 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 80093ec: 34 01 ff ff mvi r1,-1 80093f0: 5d 81 00 07 bne r12,r1,800940c 80093f4: 5d ac 00 06 bne r13,r12,800940c <== NEVER TAKEN 80093f8: f8 00 0b 0e calli 800c030 <__errno> 80093fc: 28 22 00 00 lw r2,(r1+0) 8009400: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 8009404: 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)) 8009408: 44 41 00 04 be r2,r1,8009418 <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 800940c: 59 6c 00 00 sw (r11+0),r12 8009410: 59 6d 00 04 sw (r11+4),r13 #endif return RTEMS_SUCCESSFUL; 8009414: 34 05 00 00 mvi r5,0 } 8009418: b8 a0 08 00 mv r1,r5 800941c: 2b 9d 00 04 lw ra,(sp+4) 8009420: 2b 8b 00 18 lw r11,(sp+24) 8009424: 2b 8c 00 14 lw r12,(sp+20) 8009428: 2b 8d 00 10 lw r13,(sp+16) 800942c: 2b 8e 00 0c lw r14,(sp+12) 8009430: 2b 8f 00 08 lw r15,(sp+8) 8009434: 37 9c 00 1c addi sp,sp,28 8009438: c3 a0 00 00 ret =============================================================================== 08000ec0 : int rtems_tarfs_load( char *mountpoint, uint8_t *tar_image, size_t tar_size ) { 8000ec0: 37 9c fe 20 addi sp,sp,-480 8000ec4: 5b 8b 00 44 sw (sp+68),r11 8000ec8: 5b 8c 00 40 sw (sp+64),r12 8000ecc: 5b 8d 00 3c sw (sp+60),r13 8000ed0: 5b 8e 00 38 sw (sp+56),r14 8000ed4: 5b 8f 00 34 sw (sp+52),r15 8000ed8: 5b 90 00 30 sw (sp+48),r16 8000edc: 5b 91 00 2c sw (sp+44),r17 8000ee0: 5b 92 00 28 sw (sp+40),r18 8000ee4: 5b 93 00 24 sw (sp+36),r19 8000ee8: 5b 94 00 20 sw (sp+32),r20 8000eec: 5b 95 00 1c sw (sp+28),r21 8000ef0: 5b 96 00 18 sw (sp+24),r22 8000ef4: 5b 97 00 14 sw (sp+20),r23 8000ef8: 5b 98 00 10 sw (sp+16),r24 8000efc: 5b 99 00 0c sw (sp+12),r25 8000f00: 5b 9b 00 08 sw (sp+8),fp 8000f04: 5b 9d 00 04 sw (sp+4),ra 8000f08: b8 20 98 00 mv r19,r1 8000f0c: b8 40 a0 00 mv r20,r2 8000f10: 5b 83 00 50 sw (sp+80),r3 int offset; unsigned long nblocks; IMFS_jnode_t *node; int status; status = rtems_filesystem_evaluate_path( 8000f14: f8 00 3c 6b calli 80100c0 8000f18: b8 20 10 00 mv r2,r1 8000f1c: 34 03 00 00 mvi r3,0 8000f20: ba 60 08 00 mv r1,r19 8000f24: 37 84 01 cc addi r4,sp,460 8000f28: 34 05 00 00 mvi r5,0 8000f2c: f8 00 03 3d calli 8001c20 8000f30: b8 20 60 00 mv r12,r1 strlen(mountpoint), 0, &root_loc, 0 ); if (status != 0) 8000f34: 5c 20 00 71 bne r1,r0,80010f8 return -1; if (root_loc.ops != &IMFS_ops && root_loc.ops != &fifoIMFS_ops) 8000f38: 2b 81 01 d8 lw r1,(sp+472) 8000f3c: 78 04 08 01 mvhi r4,0x801 8000f40: 38 84 f2 50 ori r4,r4,0xf250 8000f44: 34 0b 00 00 mvi r11,0 8000f48: 44 24 00 08 be r1,r4,8000f68 8000f4c: 78 04 08 01 mvhi r4,0x801 8000f50: 38 84 fa c8 ori r4,r4,0xfac8 8000f54: b9 80 58 00 mv r11,r12 8000f58: 5c 24 00 68 bne r1,r4,80010f8 <== ALWAYS TAKEN 8000f5c: e0 00 00 03 bi 8000f68 <== NOT EXECUTED 8000f60: b9 c0 58 00 mv r11,r14 8000f64: e0 00 00 0c bi 8000f94 /* * Read a header. */ hdr_ptr = (char *) &tar_image[offset]; offset += 512; if (strncmp(&hdr_ptr[257], "ustar", 5)) 8000f68: 78 11 08 01 mvhi r17,0x801 * - 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, "/"); 8000f6c: 78 0f 08 01 mvhi r15,0x801 /* * Read a header. */ hdr_ptr = (char *) &tar_image[offset]; offset += 512; if (strncmp(&hdr_ptr[257], "ustar", 5)) 8000f70: 3a 31 f2 98 ori r17,r17,0xf298 break; strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); 8000f74: 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) { 8000f78: 34 1b 00 30 mvi fp,48 const char *name; loc = root_loc; if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { 8000f7c: 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; 8000f80: 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); 8000f84: 37 8d 00 54 addi r13,sp,84 if (full_filename[strlen(full_filename)-1] != '/') 8000f88: 37 98 00 53 addi r24,sp,83 8000f8c: 34 17 00 2f mvi r23,47 strcat(full_filename, "/"); 8000f90: 39 ef c6 f4 ori r15,r15,0xc6f4 /* * Create an IMFS node structure pointing to tar image memory. */ offset = 0; while (1) { if (offset + 512 > tar_size) 8000f94: 2b 81 00 50 lw r1,(sp+80) 8000f98: 35 6e 02 00 addi r14,r11,512 8000f9c: 55 c1 00 58 bgu r14,r1,80010fc <== NEVER TAKEN break; /* * Read a header. */ hdr_ptr = (char *) &tar_image[offset]; 8000fa0: b6 8b 58 00 add r11,r20,r11 offset += 512; if (strncmp(&hdr_ptr[257], "ustar", 5)) 8000fa4: 35 61 01 01 addi r1,r11,257 8000fa8: ba 20 10 00 mv r2,r17 8000fac: 34 03 00 05 mvi r3,5 8000fb0: f8 00 3c 73 calli 801017c 8000fb4: 5c 20 00 52 bne r1,r0,80010fc <== NEVER TAKEN break; strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); 8000fb8: 34 03 00 63 mvi r3,99 8000fbc: b9 60 10 00 mv r2,r11 8000fc0: ba 00 08 00 mv r1,r16 8000fc4: f8 00 3c bb calli 80102b0 filename[MAX_NAME_FIELD_SIZE] = '\0'; linkflag = hdr_ptr[156]; file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8); 8000fc8: 34 02 00 08 mvi r2,8 offset += 512; if (strncmp(&hdr_ptr[257], "ustar", 5)) break; strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); filename[MAX_NAME_FIELD_SIZE] = '\0'; 8000fcc: 33 80 01 b7 sb (sp+439),r0 linkflag = hdr_ptr[156]; file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8); 8000fd0: 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]; 8000fd4: 41 76 00 9c lbu r22,(r11+156) file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8); 8000fd8: f8 00 19 6b calli 8007584 <_rtems_octal2ulong> 8000fdc: 5b 81 00 4c sw (sp+76),r1 file_size = _rtems_octal2ulong(&hdr_ptr[124], 12); 8000fe0: 34 02 00 0c mvi r2,12 8000fe4: 35 61 00 7c addi r1,r11,124 8000fe8: f8 00 19 67 calli 8007584 <_rtems_octal2ulong> hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8); 8000fec: 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); 8000ff0: b8 20 a8 00 mv r21,r1 hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8); 8000ff4: 35 61 00 94 addi r1,r11,148 8000ff8: f8 00 19 63 calli 8007584 <_rtems_octal2ulong> 8000ffc: b8 20 10 00 mv r2,r1 if (_rtems_tar_header_checksum(hdr_ptr) != hdr_chksum) 8001000: b9 60 08 00 mv r1,r11 8001004: 5b 82 00 48 sw (sp+72),r2 8001008: f8 00 19 7e calli 8007600 <_rtems_tar_header_checksum> 800100c: 2b 82 00 48 lw r2,(sp+72) 8001010: 5c 22 00 3b bne r1,r2,80010fc <== 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) { 8001014: 34 01 00 35 mvi r1,53 8001018: 5e c1 00 13 bne r22,r1,8001064 strcpy(full_filename, mountpoint); 800101c: ba 60 10 00 mv r2,r19 8001020: b9 a0 08 00 mv r1,r13 8001024: f8 00 3a f3 calli 800fbf0 if (full_filename[strlen(full_filename)-1] != '/') 8001028: b9 a0 08 00 mv r1,r13 800102c: f8 00 3c 25 calli 80100c0 8001030: b7 01 08 00 add r1,r24,r1 8001034: 40 21 00 00 lbu r1,(r1+0) 8001038: 44 37 00 04 be r1,r23,8001048 <== ALWAYS TAKEN strcat(full_filename, "/"); 800103c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8001040: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED 8001044: f8 00 3a 94 calli 800fa94 <== NOT EXECUTED strcat(full_filename, filename); 8001048: ba 00 10 00 mv r2,r16 800104c: b9 a0 08 00 mv r1,r13 8001050: f8 00 3a 91 calli 800fa94 mkdir(full_filename, S_IRWXU | S_IRWXG | S_IRWXO); 8001054: b9 a0 08 00 mv r1,r13 8001058: 34 02 01 ff mvi r2,511 800105c: f8 00 05 9b calli 80026c8 8001060: e3 ff ff c0 bi 8000f60 * 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) { 8001064: 5e db ff bf bne r22,fp,8000f60 <== NEVER TAKEN const char *name; loc = root_loc; 8001068: 2b 81 01 cc lw r1,(sp+460) if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { 800106c: ba 40 10 00 mv r2,r18 8001070: 37 83 01 e0 addi r3,sp,480 * should not have this path. */ else if (linkflag == REGTYPE) { const char *name; loc = root_loc; 8001074: 5b 81 01 b8 sw (sp+440),r1 8001078: 2b 81 01 d0 lw r1,(sp+464) 800107c: 5b 81 01 bc sw (sp+444),r1 8001080: 2b 81 01 d4 lw r1,(sp+468) 8001084: 5b 81 01 c0 sw (sp+448),r1 8001088: 2b 81 01 d8 lw r1,(sp+472) 800108c: 5b 81 01 c4 sw (sp+452),r1 8001090: 2b 81 01 dc lw r1,(sp+476) 8001094: 5b 81 01 c8 sw (sp+456),r1 if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { 8001098: ba 00 08 00 mv r1,r16 800109c: f8 00 1c f4 calli 800846c 80010a0: 5c 20 00 0e bne r1,r0,80010d8 <== NEVER TAKEN node = IMFS_create_node( &loc, IMFS_LINEAR_FILE, (char *)name, (file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG, 80010a4: 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( 80010a8: 2b 83 01 e0 lw r3,(sp+480) 80010ac: 34 02 00 06 mvi r2,6 &loc, IMFS_LINEAR_FILE, (char *)name, (file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG, 80010b0: 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( 80010b4: 38 84 80 00 ori r4,r4,0x8000 80010b8: ba 40 08 00 mv r1,r18 80010bc: 34 05 00 00 mvi r5,0 80010c0: f8 00 1b 08 calli 8007ce0 80010c4: 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; 80010c8: 58 20 00 50 sw (r1+80),r0 80010cc: 58 35 00 54 sw (r1+84),r21 node->info.linearfile.direct = &tar_image[offset]; 80010d0: b6 8e 08 00 add r1,r20,r14 80010d4: 58 81 00 58 sw (r4+88),r1 } nblocks = (((file_size) + 511) & ~511) / 512; 80010d8: 36 a1 01 ff addi r1,r21,511 80010dc: 34 02 00 09 mvi r2,9 80010e0: a0 39 08 00 and r1,r1,r25 80010e4: f8 00 6a e7 calli 801bc80 <__lshrsi3> offset += 512 * nblocks; 80010e8: 34 02 00 09 mvi r2,9 80010ec: f8 00 6a 97 calli 801bb48 <__ashlsi3> 80010f0: b4 2e 70 00 add r14,r1,r14 80010f4: e3 ff ff 9b bi 8000f60 ); if (status != 0) return -1; if (root_loc.ops != &IMFS_ops && root_loc.ops != &fifoIMFS_ops) return -1; 80010f8: 34 0c ff ff mvi r12,-1 nblocks = (((file_size) + 511) & ~511) / 512; offset += 512 * nblocks; } } return status; } 80010fc: b9 80 08 00 mv r1,r12 8001100: 2b 9d 00 04 lw ra,(sp+4) 8001104: 2b 8b 00 44 lw r11,(sp+68) 8001108: 2b 8c 00 40 lw r12,(sp+64) 800110c: 2b 8d 00 3c lw r13,(sp+60) 8001110: 2b 8e 00 38 lw r14,(sp+56) 8001114: 2b 8f 00 34 lw r15,(sp+52) 8001118: 2b 90 00 30 lw r16,(sp+48) 800111c: 2b 91 00 2c lw r17,(sp+44) 8001120: 2b 92 00 28 lw r18,(sp+40) 8001124: 2b 93 00 24 lw r19,(sp+36) 8001128: 2b 94 00 20 lw r20,(sp+32) 800112c: 2b 95 00 1c lw r21,(sp+28) 8001130: 2b 96 00 18 lw r22,(sp+24) 8001134: 2b 97 00 14 lw r23,(sp+20) 8001138: 2b 98 00 10 lw r24,(sp+16) 800113c: 2b 99 00 0c lw r25,(sp+12) 8001140: 2b 9b 00 08 lw fp,(sp+8) 8001144: 37 9c 01 e0 addi sp,sp,480 8001148: c3 a0 00 00 ret =============================================================================== 0800ac70 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 800ac70: 37 9c ff e0 addi sp,sp,-32 800ac74: 5b 8b 00 20 sw (sp+32),r11 800ac78: 5b 8c 00 1c sw (sp+28),r12 800ac7c: 5b 8d 00 18 sw (sp+24),r13 800ac80: 5b 8e 00 14 sw (sp+20),r14 800ac84: 5b 8f 00 10 sw (sp+16),r15 800ac88: 5b 90 00 0c sw (sp+12),r16 800ac8c: 5b 91 00 08 sw (sp+8),r17 800ac90: 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; 800ac94: 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 ) { 800ac98: b8 20 68 00 mv r13,r1 800ac9c: b8 40 70 00 mv r14,r2 800aca0: 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 ) 800aca4: 44 60 00 51 be r3,r0,800ade8 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 800aca8: 78 01 08 01 mvhi r1,0x801 800acac: 38 21 39 e8 ori r1,r1,0x39e8 800acb0: 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; 800acb4: 41 8f 00 74 lbu r15,(r12+116) if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 800acb8: 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 ]; 800acbc: 29 8b 01 24 lw r11,(r12+292) asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 800acc0: 65 ef 00 00 cmpei r15,r15,0 800acc4: c8 0f 78 00 sub r15,r0,r15 800acc8: 21 ef 01 00 andi r15,r15,0x100 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 800accc: 44 20 00 02 be r1,r0,800acd4 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 800acd0: 39 ef 02 00 ori r15,r15,0x200 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 800acd4: 41 71 00 08 lbu r17,(r11+8) old_mode |= _ISR_Get_level(); 800acd8: fb ff ef 63 calli 8006a64 <_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; 800acdc: 66 31 00 00 cmpei r17,r17,0 800ace0: c8 11 88 00 sub r17,r0,r17 800ace4: 22 31 04 00 andi r17,r17,0x400 800ace8: ba 21 08 00 or r1,r17,r1 old_mode |= _ISR_Get_level(); 800acec: b8 2f 78 00 or r15,r1,r15 *previous_mode_set = old_mode; 800acf0: 5a 0f 00 00 sw (r16+0),r15 /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 800acf4: 21 c1 01 00 andi r1,r14,0x100 800acf8: 44 20 00 04 be r1,r0,800ad08 */ RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt ( Modes_Control mode_set ) { return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT; 800acfc: 21 a1 01 00 andi r1,r13,0x100 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 800ad00: 64 21 00 00 cmpei r1,r1,0 800ad04: 31 81 00 74 sb (r12+116),r1 if ( mask & RTEMS_TIMESLICE_MASK ) { 800ad08: 21 c1 02 00 andi r1,r14,0x200 800ad0c: 44 20 00 0b be r1,r0,800ad38 */ RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice ( Modes_Control mode_set ) { return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE; 800ad10: 21 a1 02 00 andi r1,r13,0x200 if ( _Modes_Is_timeslice(mode_set) ) { 800ad14: 44 20 00 08 be r1,r0,800ad34 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 800ad18: 34 01 00 01 mvi r1,1 800ad1c: 59 81 00 7c sw (r12+124),r1 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 800ad20: 78 01 08 01 mvhi r1,0x801 800ad24: 38 21 37 b4 ori r1,r1,0x37b4 800ad28: 28 21 00 00 lw r1,(r1+0) 800ad2c: 59 81 00 78 sw (r12+120),r1 800ad30: e0 00 00 02 bi 800ad38 } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 800ad34: 59 80 00 7c sw (r12+124),r0 } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 800ad38: 21 c1 00 01 andi r1,r14,0x1 800ad3c: 44 20 00 04 be r1,r0,800ad4c */ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level ( Modes_Control mode_set ) { return ( mode_set & RTEMS_INTERRUPT_MASK ); 800ad40: 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 ) ); 800ad44: 64 21 00 00 cmpei r1,r1,0 800ad48: d0 01 00 00 wcsr IE,r1 * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 800ad4c: 21 ce 04 00 andi r14,r14,0x400 /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 800ad50: 34 03 00 00 mvi r3,0 if ( mask & RTEMS_ASR_MASK ) { 800ad54: 45 c0 00 11 be r14,r0,800ad98 */ RTEMS_INLINE_ROUTINE bool _Modes_Is_asr_disabled ( Modes_Control mode_set ) { return (mode_set & RTEMS_ASR_MASK) == RTEMS_NO_ASR; 800ad58: 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 ) { 800ad5c: 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( 800ad60: 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 ) { 800ad64: 44 2d 00 0d be r1,r13,800ad98 asr->is_enabled = is_asr_enabled; 800ad68: 31 6d 00 08 sb (r11+8),r13 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 800ad6c: 90 00 08 00 rcsr r1,IE 800ad70: 34 02 ff fe mvi r2,-2 800ad74: a0 22 10 00 and r2,r1,r2 800ad78: d0 02 00 00 wcsr IE,r2 _signals = information->signals_pending; 800ad7c: 29 62 00 18 lw r2,(r11+24) information->signals_pending = information->signals_posted; 800ad80: 29 63 00 14 lw r3,(r11+20) information->signals_posted = _signals; 800ad84: 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; 800ad88: 59 63 00 18 sw (r11+24),r3 information->signals_posted = _signals; _ISR_Enable( _level ); 800ad8c: d0 01 00 00 wcsr IE,r1 _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { 800ad90: 29 63 00 14 lw r3,(r11+20) /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 800ad94: 7c 63 00 00 cmpnei r3,r3,0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 800ad98: 78 01 08 01 mvhi r1,0x801 800ad9c: 38 21 39 9c ori r1,r1,0x399c 800ada0: 28 22 00 00 lw r2,(r1+0) 800ada4: 34 01 00 03 mvi r1,3 if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; 800ada8: 34 04 00 00 mvi r4,0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 800adac: 5c 41 00 0f bne r2,r1,800ade8 <== NEVER TAKEN bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; 800adb0: 78 01 08 01 mvhi r1,0x801 800adb4: 38 21 39 e8 ori r1,r1,0x39e8 800adb8: 28 22 00 0c lw r2,(r1+12) if ( are_signals_pending || 800adbc: 5c 60 00 05 bne r3,r0,800add0 800adc0: 28 21 00 10 lw r1,(r1+16) 800adc4: 44 41 00 09 be r2,r1,800ade8 (!_Thread_Is_heir( executing ) && executing->is_preemptible) ) { 800adc8: 40 41 00 74 lbu r1,(r2+116) 800adcc: 44 20 00 07 be r1,r0,800ade8 <== NEVER TAKEN _Thread_Dispatch_necessary = true; 800add0: 78 01 08 01 mvhi r1,0x801 800add4: 38 21 39 e8 ori r1,r1,0x39e8 800add8: 34 02 00 01 mvi r2,1 800addc: 30 22 00 18 sb (r1+24),r2 if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); 800ade0: fb ff e8 2c calli 8004e90 <_Thread_Dispatch> } return RTEMS_SUCCESSFUL; 800ade4: 34 04 00 00 mvi r4,0 } 800ade8: b8 80 08 00 mv r1,r4 800adec: 2b 9d 00 04 lw ra,(sp+4) 800adf0: 2b 8b 00 20 lw r11,(sp+32) 800adf4: 2b 8c 00 1c lw r12,(sp+28) 800adf8: 2b 8d 00 18 lw r13,(sp+24) 800adfc: 2b 8e 00 14 lw r14,(sp+20) 800ae00: 2b 8f 00 10 lw r15,(sp+16) 800ae04: 2b 90 00 0c lw r16,(sp+12) 800ae08: 2b 91 00 08 lw r17,(sp+8) 800ae0c: 37 9c 00 20 addi sp,sp,32 800ae10: c3 a0 00 00 ret =============================================================================== 080055b8 : rtems_status_code rtems_task_set_note( rtems_id id, uint32_t notepad, uint32_t note ) { 80055b8: 37 9c ff ec addi sp,sp,-20 80055bc: 5b 8b 00 10 sw (sp+16),r11 80055c0: 5b 8c 00 0c sw (sp+12),r12 80055c4: 5b 8d 00 08 sw (sp+8),r13 80055c8: 5b 9d 00 04 sw (sp+4),ra 80055cc: b8 40 58 00 mv r11,r2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; if ( !rtems_configuration_get_notepads_enabled() ) 80055d0: 78 02 08 02 mvhi r2,0x802 80055d4: 38 42 30 8c ori r2,r2,0x308c 80055d8: 40 42 00 04 lbu r2,(r2+4) rtems_status_code rtems_task_set_note( rtems_id id, uint32_t notepad, uint32_t note ) { 80055dc: b8 60 60 00 mv r12,r3 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; if ( !rtems_configuration_get_notepads_enabled() ) return RTEMS_NOT_CONFIGURED; 80055e0: 34 04 00 16 mvi r4,22 { register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; if ( !rtems_configuration_get_notepads_enabled() ) 80055e4: 44 40 00 21 be r2,r0,8005668 <== NEVER TAKEN /* * NOTE: There is no check for < RTEMS_NOTEPAD_FIRST because that would * be checking an unsigned number for being negative. */ if ( notepad > RTEMS_NOTEPAD_LAST ) 80055e8: 34 02 00 0f mvi r2,15 return RTEMS_INVALID_NUMBER; 80055ec: 34 04 00 0a mvi r4,10 /* * NOTE: There is no check for < RTEMS_NOTEPAD_FIRST because that would * be checking an unsigned number for being negative. */ if ( notepad > RTEMS_NOTEPAD_LAST ) 80055f0: 55 62 00 1e bgu r11,r2,8005668 /* * Optimize the most likely case to avoid the Thread_Dispatch. */ if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) || 80055f4: 44 20 00 06 be r1,r0,800560c _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) { 80055f8: 78 02 08 02 mvhi r2,0x802 80055fc: 38 42 3c d0 ori r2,r2,0x3cd0 8005600: 28 42 00 0c lw r2,(r2+12) /* * Optimize the most likely case to avoid the Thread_Dispatch. */ if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) || 8005604: 28 42 00 08 lw r2,(r2+8) 8005608: 5c 22 00 0b bne r1,r2,8005634 _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) { api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ]; 800560c: 78 01 08 02 mvhi r1,0x802 8005610: 38 21 3c d0 ori r1,r1,0x3cd0 8005614: 28 21 00 0c lw r1,(r1+12) api->Notepads[ notepad ] = note; 8005618: 34 02 00 02 mvi r2,2 800561c: 28 2d 01 24 lw r13,(r1+292) 8005620: 35 61 00 08 addi r1,r11,8 8005624: fb ff f3 45 calli 8002338 <__ashlsi3> 8005628: b5 a1 08 00 add r1,r13,r1 800562c: 58 2c 00 00 sw (r1+0),r12 8005630: e0 00 00 0d bi 8005664 return RTEMS_SUCCESSFUL; } the_thread = _Thread_Get( id, &location ); 8005634: 37 82 00 14 addi r2,sp,20 8005638: f8 00 09 79 calli 8007c1c <_Thread_Get> switch ( location ) { 800563c: 2b 82 00 14 lw r2,(sp+20) case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 8005640: 34 04 00 04 mvi r4,4 api->Notepads[ notepad ] = note; return RTEMS_SUCCESSFUL; } the_thread = _Thread_Get( id, &location ); switch ( location ) { 8005644: 5c 40 00 09 bne r2,r0,8005668 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; api->Notepads[ notepad ] = note; 8005648: 28 2d 01 24 lw r13,(r1+292) 800564c: 34 02 00 02 mvi r2,2 8005650: 35 61 00 08 addi r1,r11,8 8005654: fb ff f3 39 calli 8002338 <__ashlsi3> 8005658: b5 a1 08 00 add r1,r13,r1 800565c: 58 2c 00 00 sw (r1+0),r12 _Thread_Enable_dispatch(); 8005660: f8 00 09 62 calli 8007be8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8005664: 34 04 00 00 mvi r4,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8005668: b8 80 08 00 mv r1,r4 800566c: 2b 9d 00 04 lw ra,(sp+4) 8005670: 2b 8b 00 10 lw r11,(sp+16) 8005674: 2b 8c 00 0c lw r12,(sp+12) 8005678: 2b 8d 00 08 lw r13,(sp+8) 800567c: 37 9c 00 14 addi sp,sp,20 8005680: c3 a0 00 00 ret =============================================================================== 0800848c : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 800848c: 37 9c ff f0 addi sp,sp,-16 8008490: 5b 8b 00 0c sw (sp+12),r11 8008494: 5b 8c 00 08 sw (sp+8),r12 8008498: 5b 9d 00 04 sw (sp+4),ra 800849c: b8 40 58 00 mv r11,r2 80084a0: b8 60 60 00 mv r12,r3 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 80084a4: 44 40 00 06 be r2,r0,80084bc 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 ) ); 80084a8: 78 02 08 01 mvhi r2,0x801 80084ac: 38 42 90 c0 ori r2,r2,0x90c0 80084b0: 40 43 00 00 lbu r3,(r2+0) !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; 80084b4: 34 02 00 13 mvi r2,19 ) { register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 80084b8: 55 63 00 16 bgu r11,r3,8008510 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) return RTEMS_INVALID_ADDRESS; 80084bc: 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 ) 80084c0: 45 80 00 14 be r12,r0,8008510 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 80084c4: 37 82 00 10 addi r2,sp,16 80084c8: f8 00 09 78 calli 800aaa8 <_Thread_Get> switch ( location ) { 80084cc: 2b 82 00 10 lw r2,(sp+16) 80084d0: 5c 40 00 0f bne r2,r0,800850c case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 80084d4: 28 23 00 14 lw r3,(r1+20) 80084d8: 59 83 00 00 sw (r12+0),r3 if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 80084dc: 45 62 00 09 be r11,r2,8008500 the_thread->real_priority = new_priority; if ( the_thread->resource_count == 0 || 80084e0: 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; 80084e4: 58 2b 00 18 sw (r1+24),r11 if ( the_thread->resource_count == 0 || 80084e8: 44 40 00 03 be r2,r0,80084f4 80084ec: 28 22 00 14 lw r2,(r1+20) 80084f0: 51 62 00 04 bgeu r11,r2,8008500 <== ALWAYS TAKEN the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 80084f4: b9 60 10 00 mv r2,r11 80084f8: 34 03 00 00 mvi r3,0 80084fc: f8 00 07 d9 calli 800a460 <_Thread_Change_priority> } _Thread_Enable_dispatch(); 8008500: f8 00 09 5d calli 800aa74 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8008504: 34 02 00 00 mvi r2,0 8008508: e0 00 00 02 bi 8008510 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 800850c: 34 02 00 04 mvi r2,4 } 8008510: b8 40 08 00 mv r1,r2 8008514: 2b 9d 00 04 lw ra,(sp+4) 8008518: 2b 8b 00 0c lw r11,(sp+12) 800851c: 2b 8c 00 08 lw r12,(sp+8) 8008520: 37 9c 00 10 addi sp,sp,16 8008524: c3 a0 00 00 ret =============================================================================== 08002eec : rtems_status_code rtems_task_start( rtems_id id, rtems_task_entry entry_point, rtems_task_argument argument ) { 8002eec: 37 9c ff ec addi sp,sp,-20 8002ef0: 5b 8b 00 10 sw (sp+16),r11 8002ef4: 5b 8c 00 0c sw (sp+12),r12 8002ef8: 5b 8d 00 08 sw (sp+8),r13 8002efc: 5b 9d 00 04 sw (sp+4),ra register Thread_Control *the_thread; Objects_Locations location; if ( entry_point == NULL ) return RTEMS_INVALID_ADDRESS; 8002f00: 34 04 00 09 mvi r4,9 rtems_status_code rtems_task_start( rtems_id id, rtems_task_entry entry_point, rtems_task_argument argument ) { 8002f04: b8 40 60 00 mv r12,r2 8002f08: b8 60 68 00 mv r13,r3 register Thread_Control *the_thread; Objects_Locations location; if ( entry_point == NULL ) 8002f0c: 44 40 00 11 be r2,r0,8002f50 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 8002f10: 37 82 00 14 addi r2,sp,20 8002f14: f8 00 08 4c calli 8005044 <_Thread_Get> switch ( location ) { 8002f18: 2b 8b 00 14 lw r11,(sp+20) case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 8002f1c: 34 04 00 04 mvi r4,4 if ( entry_point == NULL ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); switch ( location ) { 8002f20: 5d 60 00 0c bne r11,r0,8002f50 case OBJECTS_LOCAL: if ( _Thread_Start( 8002f24: 34 02 00 00 mvi r2,0 8002f28: b9 80 18 00 mv r3,r12 8002f2c: 34 04 00 00 mvi r4,0 8002f30: b9 a0 28 00 mv r5,r13 8002f34: f8 00 0b e6 calli 8005ecc <_Thread_Start> 8002f38: 44 2b 00 04 be r1,r11,8002f48 the_thread, THREAD_START_NUMERIC, entry_point, NULL, argument ) ) { _Thread_Enable_dispatch(); 8002f3c: f8 00 08 35 calli 8005010 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8002f40: 34 04 00 00 mvi r4,0 8002f44: e0 00 00 03 bi 8002f50 } _Thread_Enable_dispatch(); 8002f48: f8 00 08 32 calli 8005010 <_Thread_Enable_dispatch> return RTEMS_INCORRECT_STATE; 8002f4c: 34 04 00 0e mvi r4,14 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8002f50: b8 80 08 00 mv r1,r4 8002f54: 2b 9d 00 04 lw ra,(sp+4) 8002f58: 2b 8b 00 10 lw r11,(sp+16) 8002f5c: 2b 8c 00 0c lw r12,(sp+12) 8002f60: 2b 8d 00 08 lw r13,(sp+8) 8002f64: 37 9c 00 14 addi sp,sp,20 8002f68: c3 a0 00 00 ret =============================================================================== 080046c0 : #include int rtems_termios_baud_to_index( rtems_termios_baud_t termios_baud ) { 80046c0: 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; 80046c4: 34 01 00 09 mvi r1,9 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 80046c8: 44 41 00 38 be r2,r1,80047a8 80046cc: 48 41 00 19 bg r2,r1,8004730 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; 80046d0: 34 01 00 04 mvi r1,4 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 80046d4: 44 41 00 35 be r2,r1,80047a8 80046d8: 48 41 00 0c bg r2,r1,8004708 case B0: baud_index = 0; break; case B50: baud_index = 1; break; 80046dc: 34 01 00 01 mvi r1,1 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 80046e0: 44 41 00 32 be r2,r1,80047a8 80046e4: 48 41 00 04 bg r2,r1,80046f4 case B0: baud_index = 0; break; 80046e8: 34 01 00 00 mvi r1,0 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 80046ec: 5c 40 00 2e bne r2,r0,80047a4 80046f0: c3 a0 00 00 ret case B0: baud_index = 0; break; case B50: baud_index = 1; break; case B75: baud_index = 2; break; 80046f4: 34 01 00 02 mvi r1,2 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 80046f8: 44 41 00 2c be r2,r1,80047a8 case B0: baud_index = 0; break; case B50: baud_index = 1; break; case B75: baud_index = 2; break; case B110: baud_index = 3; break; 80046fc: 34 01 00 03 mvi r1,3 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004700: 5c 41 00 29 bne r2,r1,80047a4 <== NEVER TAKEN 8004704: 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; 8004708: 34 01 00 06 mvi r1,6 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 800470c: 44 41 00 27 be r2,r1,80047a8 8004710: 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; 8004714: 34 01 00 05 mvi r1,5 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004718: 48 62 00 24 bg r3,r2,80047a8 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; 800471c: 34 01 00 07 mvi r1,7 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004720: 44 41 00 22 be r2,r1,80047a8 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; 8004724: 34 01 00 08 mvi r1,8 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004728: 5c 41 00 1f bne r2,r1,80047a4 <== NEVER TAKEN 800472c: 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; 8004730: 34 01 00 0e mvi r1,14 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004734: 44 41 00 1d be r2,r1,80047a8 8004738: 48 41 00 0b bg r2,r1,8004764 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; 800473c: 34 01 00 0b mvi r1,11 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004740: 44 41 00 1a be r2,r1,80047a8 8004744: 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; 8004748: 34 01 00 0a mvi r1,10 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 800474c: 48 62 00 17 bg r3,r2,80047a8 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; 8004750: 34 01 00 0c mvi r1,12 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004754: 44 41 00 15 be r2,r1,80047a8 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; 8004758: 34 01 00 0d mvi r1,13 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 800475c: 5c 41 00 12 bne r2,r1,80047a4 <== NEVER TAKEN 8004760: c3 a0 00 00 ret 8004764: 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; 8004768: 34 01 00 11 mvi r1,17 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 800476c: 44 43 00 0f be r2,r3,80047a8 8004770: 48 43 00 07 bg r2,r3,800478c 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; 8004774: 34 01 00 0f mvi r1,15 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004778: 44 41 00 0c be r2,r1,80047a8 800477c: 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; 8004780: 34 01 00 10 mvi r1,16 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004784: 5c 43 00 08 bne r2,r3,80047a4 <== NEVER TAKEN 8004788: c3 a0 00 00 ret 800478c: 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; 8004790: 34 01 00 12 mvi r1,18 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004794: 44 43 00 05 be r2,r3,80047a8 8004798: 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; 800479c: 34 01 00 13 mvi r1,19 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 80047a0: 44 43 00 02 be r2,r3,80047a8 <== 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; 80047a4: 34 01 ff ff mvi r1,-1 } return baud_index; } 80047a8: c3 a0 00 00 ret =============================================================================== 08004dcc : } } rtems_status_code rtems_termios_close (void *arg) { 8004dcc: 37 9c ff ec addi sp,sp,-20 8004dd0: 5b 8b 00 14 sw (sp+20),r11 8004dd4: 5b 8c 00 10 sw (sp+16),r12 8004dd8: 5b 8d 00 0c sw (sp+12),r13 8004ddc: 5b 8e 00 08 sw (sp+8),r14 8004de0: 5b 9d 00 04 sw (sp+4),ra 8004de4: b8 20 70 00 mv r14,r1 rtems_libio_open_close_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8004de8: 28 21 00 00 lw r1,(r1+0) rtems_status_code sc; sc = rtems_semaphore_obtain( 8004dec: 78 02 08 02 mvhi r2,0x802 8004df0: 38 42 1a 50 ori r2,r2,0x1a50 rtems_status_code rtems_termios_close (void *arg) { rtems_libio_open_close_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8004df4: 28 2b 00 38 lw r11,(r1+56) rtems_status_code sc; sc = rtems_semaphore_obtain( 8004df8: 28 41 00 00 lw r1,(r2+0) 8004dfc: 34 03 00 00 mvi r3,0 8004e00: 34 02 00 00 mvi r2,0 8004e04: f8 00 08 c1 calli 8007108 rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 8004e08: 5c 20 00 25 bne r1,r0,8004e9c <== NEVER TAKEN rtems_fatal_error_occurred (sc); if (--tty->refcount == 0) { 8004e0c: 29 6d 00 08 lw r13,(r11+8) 8004e10: 35 ad ff ff addi r13,r13,-1 8004e14: 59 6d 00 08 sw (r11+8),r13 8004e18: 5d a1 00 51 bne r13,r1,8004f5c <== NEVER TAKEN if (rtems_termios_linesw[tty->t_line].l_close != NULL) { 8004e1c: 29 61 00 cc lw r1,(r11+204) 8004e20: 78 0c 08 02 mvhi r12,0x802 8004e24: 34 02 00 05 mvi r2,5 8004e28: 39 8c 18 88 ori r12,r12,0x1888 8004e2c: fb ff f3 5c calli 8001b9c <__ashlsi3> 8004e30: b5 81 08 00 add r1,r12,r1 8004e34: 28 2c 00 04 lw r12,(r1+4) 8004e38: 45 8d 00 04 be r12,r13,8004e48 /* * call discipline-specific close */ sc = rtems_termios_linesw[tty->t_line].l_close(tty); 8004e3c: b9 60 08 00 mv r1,r11 8004e40: d9 80 00 00 call r12 8004e44: e0 00 00 0a bi 8004e6c } else { /* * default: just flush output buffer */ sc = rtems_semaphore_obtain(tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8004e48: 29 61 00 18 lw r1,(r11+24) 8004e4c: 34 02 00 00 mvi r2,0 8004e50: 34 03 00 00 mvi r3,0 8004e54: f8 00 08 ad calli 8007108 if (sc != RTEMS_SUCCESSFUL) { 8004e58: 5d 81 00 11 bne r12,r1,8004e9c <== NEVER TAKEN rtems_fatal_error_occurred (sc); } drainOutput (tty); 8004e5c: b9 60 08 00 mv r1,r11 8004e60: fb ff fe 89 calli 8004884 rtems_semaphore_release (tty->osem); 8004e64: 29 61 00 18 lw r1,(r11+24) 8004e68: f8 00 08 f8 calli 8007248 } if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 8004e6c: 29 62 00 b4 lw r2,(r11+180) 8004e70: 34 01 00 02 mvi r1,2 8004e74: 5c 41 00 0b bne r2,r1,8004ea0 /* * send "terminate" to I/O tasks */ sc = rtems_event_send( tty->rxTaskId, TERMIOS_RX_TERMINATE_EVENT ); 8004e78: 29 61 00 c4 lw r1,(r11+196) 8004e7c: 34 02 00 01 mvi r2,1 8004e80: f8 00 07 56 calli 8006bd8 8004e84: b8 20 60 00 mv r12,r1 if (sc != RTEMS_SUCCESSFUL) 8004e88: 5c 20 00 05 bne r1,r0,8004e9c <== NEVER TAKEN rtems_fatal_error_occurred (sc); sc = rtems_event_send( tty->txTaskId, TERMIOS_TX_TERMINATE_EVENT ); 8004e8c: 29 61 00 c8 lw r1,(r11+200) 8004e90: 34 02 00 01 mvi r2,1 8004e94: f8 00 07 51 calli 8006bd8 if (sc != RTEMS_SUCCESSFUL) 8004e98: 44 2c 00 02 be r1,r12,8004ea0 <== ALWAYS TAKEN rtems_fatal_error_occurred (sc); 8004e9c: f8 00 0a 79 calli 8007880 <== NOT EXECUTED } if (tty->device.lastClose) 8004ea0: 29 64 00 9c lw r4,(r11+156) 8004ea4: 44 80 00 05 be r4,r0,8004eb8 <== ALWAYS TAKEN (*tty->device.lastClose)(tty->major, tty->minor, arg); 8004ea8: 29 61 00 0c lw r1,(r11+12) <== NOT EXECUTED 8004eac: 29 62 00 10 lw r2,(r11+16) <== NOT EXECUTED 8004eb0: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED 8004eb4: d8 80 00 00 call r4 <== NOT EXECUTED if (tty->forw == NULL) { 8004eb8: 29 62 00 00 lw r2,(r11+0) 8004ebc: 29 61 00 04 lw r1,(r11+4) 8004ec0: 5c 40 00 07 bne r2,r0,8004edc <== NEVER TAKEN rtems_termios_ttyTail = tty->back; 8004ec4: 78 03 08 02 mvhi r3,0x802 8004ec8: 38 63 1a 54 ori r3,r3,0x1a54 8004ecc: 58 61 00 00 sw (r3+0),r1 if ( rtems_termios_ttyTail != NULL ) { 8004ed0: 44 22 00 04 be r1,r2,8004ee0 <== ALWAYS TAKEN rtems_termios_ttyTail->forw = NULL; 8004ed4: 58 20 00 00 sw (r1+0),r0 <== NOT EXECUTED 8004ed8: e0 00 00 02 bi 8004ee0 <== NOT EXECUTED } } else { tty->forw->back = tty->back; 8004edc: 58 41 00 04 sw (r2+4),r1 <== NOT EXECUTED } if (tty->back == NULL) { 8004ee0: 29 62 00 04 lw r2,(r11+4) 8004ee4: 29 61 00 00 lw r1,(r11+0) 8004ee8: 5c 40 00 07 bne r2,r0,8004f04 <== NEVER TAKEN rtems_termios_ttyHead = tty->forw; 8004eec: 78 03 08 02 mvhi r3,0x802 8004ef0: 38 63 1a 58 ori r3,r3,0x1a58 8004ef4: 58 61 00 00 sw (r3+0),r1 if ( rtems_termios_ttyHead != NULL ) { 8004ef8: 44 22 00 04 be r1,r2,8004f08 <== ALWAYS TAKEN rtems_termios_ttyHead->back = NULL; 8004efc: 58 20 00 04 sw (r1+4),r0 <== NOT EXECUTED 8004f00: e0 00 00 02 bi 8004f08 <== NOT EXECUTED } } else { tty->back->forw = tty->forw; 8004f04: 58 41 00 00 sw (r2+0),r1 <== NOT EXECUTED } rtems_semaphore_delete (tty->isem); 8004f08: 29 61 00 14 lw r1,(r11+20) 8004f0c: f8 00 08 50 calli 800704c rtems_semaphore_delete (tty->osem); 8004f10: 29 61 00 18 lw r1,(r11+24) 8004f14: f8 00 08 4e calli 800704c rtems_semaphore_delete (tty->rawOutBuf.Semaphore); 8004f18: 29 61 00 8c lw r1,(r11+140) 8004f1c: f8 00 08 4c calli 800704c if ((tty->device.pollRead == NULL) || 8004f20: 29 61 00 a0 lw r1,(r11+160) 8004f24: 44 20 00 04 be r1,r0,8004f34 8004f28: 29 62 00 b4 lw r2,(r11+180) 8004f2c: 34 01 00 02 mvi r1,2 8004f30: 5c 41 00 03 bne r2,r1,8004f3c (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)) rtems_semaphore_delete (tty->rawInBuf.Semaphore); 8004f34: 29 61 00 68 lw r1,(r11+104) 8004f38: f8 00 08 45 calli 800704c free (tty->rawInBuf.theBuf); 8004f3c: 29 61 00 58 lw r1,(r11+88) 8004f40: fb ff f8 a3 calli 80031cc free (tty->rawOutBuf.theBuf); 8004f44: 29 61 00 7c lw r1,(r11+124) 8004f48: fb ff f8 a1 calli 80031cc free (tty->cbuf); 8004f4c: 29 61 00 1c lw r1,(r11+28) 8004f50: fb ff f8 9f calli 80031cc free (tty); 8004f54: b9 60 08 00 mv r1,r11 8004f58: fb ff f8 9d calli 80031cc } rtems_semaphore_release (rtems_termios_ttyMutex); 8004f5c: 78 01 08 02 mvhi r1,0x802 8004f60: 38 21 1a 50 ori r1,r1,0x1a50 8004f64: 28 21 00 00 lw r1,(r1+0) 8004f68: f8 00 08 b8 calli 8007248 return RTEMS_SUCCESSFUL; } 8004f6c: 34 01 00 00 mvi r1,0 8004f70: 2b 9d 00 04 lw ra,(sp+4) 8004f74: 2b 8b 00 14 lw r11,(sp+20) 8004f78: 2b 8c 00 10 lw r12,(sp+16) 8004f7c: 2b 8d 00 0c lw r13,(sp+12) 8004f80: 2b 8e 00 08 lw r14,(sp+8) 8004f84: 37 9c 00 14 addi sp,sp,20 8004f88: c3 a0 00 00 ret =============================================================================== 08006590 : * for each transmitted character. * It returns number of characters left to transmit */ int rtems_termios_dequeue_characters (void *ttyp, int len) { 8006590: 37 9c ff f8 addi sp,sp,-8 8006594: 5b 8b 00 08 sw (sp+8),r11 8006598: 5b 9d 00 04 sw (sp+4),ra rtems_status_code sc; /* * sum up character count already sent */ tty->t_dqlen += len; 800659c: 28 24 00 90 lw r4,(r1+144) 80065a0: b4 82 10 00 add r2,r4,r2 if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 80065a4: 28 24 00 b4 lw r4,(r1+180) rtems_status_code sc; /* * sum up character count already sent */ tty->t_dqlen += len; 80065a8: 58 22 00 90 sw (r1+144),r2 if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 80065ac: 34 02 00 02 mvi r2,2 80065b0: 5c 82 00 06 bne r4,r2,80065c8 /* * send wake up to transmitter task */ sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT); 80065b4: 28 21 00 c8 lw r1,(r1+200) if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); return 0; /* nothing to output in IRQ... */ 80065b8: 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); 80065bc: f8 00 01 87 calli 8006bd8 if (sc != RTEMS_SUCCESSFUL) 80065c0: 44 20 00 0e be r1,r0,80065f8 <== ALWAYS TAKEN rtems_fatal_error_occurred (sc); 80065c4: f8 00 04 af calli 8007880 <== NOT EXECUTED return 0; /* nothing to output in IRQ... */ } if (tty->t_line == PPPDISC ) { 80065c8: 28 23 00 cc lw r3,(r1+204) 80065cc: 34 02 00 05 mvi r2,5 80065d0: 5c 62 00 08 bne r3,r2,80065f0 /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 80065d4: 78 02 08 02 mvhi r2,0x802 80065d8: 38 42 18 88 ori r2,r2,0x1888 80065dc: 28 42 00 b4 lw r2,(r2+180) rtems_termios_linesw[tty->t_line].l_start(tty); } return 0; /* nothing to output in IRQ... */ 80065e0: 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) { 80065e4: 44 40 00 05 be r2,r0,80065f8 <== NEVER TAKEN rtems_termios_linesw[tty->t_line].l_start(tty); 80065e8: d8 40 00 00 call r2 80065ec: e0 00 00 03 bi 80065f8 } return 0; /* nothing to output in IRQ... */ } return rtems_termios_refill_transmitter(tty); 80065f0: fb ff ff 4a calli 8006318 80065f4: b8 20 58 00 mv r11,r1 } 80065f8: b9 60 08 00 mv r1,r11 80065fc: 2b 9d 00 04 lw ra,(sp+4) 8006600: 2b 8b 00 08 lw r11,(sp+8) 8006604: 37 9c 00 08 addi sp,sp,8 8006608: c3 a0 00 00 ret =============================================================================== 08005f78 : * 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) { 8005f78: 37 9c ff bc addi sp,sp,-68 8005f7c: 5b 8b 00 44 sw (sp+68),r11 8005f80: 5b 8c 00 40 sw (sp+64),r12 8005f84: 5b 8d 00 3c sw (sp+60),r13 8005f88: 5b 8e 00 38 sw (sp+56),r14 8005f8c: 5b 8f 00 34 sw (sp+52),r15 8005f90: 5b 90 00 30 sw (sp+48),r16 8005f94: 5b 91 00 2c sw (sp+44),r17 8005f98: 5b 92 00 28 sw (sp+40),r18 8005f9c: 5b 93 00 24 sw (sp+36),r19 8005fa0: 5b 94 00 20 sw (sp+32),r20 8005fa4: 5b 95 00 1c sw (sp+28),r21 8005fa8: 5b 96 00 18 sw (sp+24),r22 8005fac: 5b 97 00 14 sw (sp+20),r23 8005fb0: 5b 98 00 10 sw (sp+16),r24 8005fb4: 5b 99 00 0c sw (sp+12),r25 8005fb8: 5b 9b 00 08 sw (sp+8),fp 8005fbc: 5b 9d 00 04 sw (sp+4),ra 8005fc0: 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) { 8005fc4: 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) { 8005fc8: 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) { 8005fcc: 78 0c 08 02 mvhi r12,0x802 8005fd0: 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) { 8005fd4: 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) { 8005fd8: 39 8c 18 88 ori r12,r12,0x1888 8005fdc: fb ff ee f0 calli 8001b9c <__ashlsi3> 8005fe0: b5 81 08 00 add r1,r12,r1 8005fe4: 28 21 00 10 lw r1,(r1+16) 8005fe8: b9 e0 70 00 mv r14,r15 8005fec: 5c 20 00 17 bne r1,r0,8006048 8005ff0: 34 12 00 00 mvi r18,0 8005ff4: 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) { 8005ff8: 34 1b 00 20 mvi fp,32 /* disable interrupts */ rtems_interrupt_disable(level); 8005ffc: 34 11 ff fe mvi r17,-2 tty->flow_ctrl &= ~FL_OSTOP; 8006000: 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); 8006004: 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)) 8006008: 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) ) { 800600c: 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, 8006010: 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; 8006014: 34 14 ff ef mvi r20,-17 8006018: e0 00 00 87 bi 8006234 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); 800601c: 29 61 00 cc lw r1,(r11+204) 8006020: 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++; 8006024: 41 af 00 00 lbu r15,(r13+0) rtems_termios_linesw[tty->t_line].l_rint(c,tty); 8006028: fb ff ee dd calli 8001b9c <__ashlsi3> 800602c: b5 81 10 00 add r2,r12,r1 8006030: 28 43 00 10 lw r3,(r2+16) 8006034: b9 e0 08 00 mv r1,r15 8006038: 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++; 800603c: 35 ad 00 01 addi r13,r13,1 rtems_termios_linesw[tty->t_line].l_rint(c,tty); 8006040: d8 60 00 00 call r3 8006044: 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--) { 8006048: 5d c0 ff f5 bne r14,r0,800601c } /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { 800604c: 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; 8006050: 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 )) { 8006054: 5c 2c 00 7e bne r1,r12,800624c <== NEVER TAKEN 8006058: 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; 800605c: 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 )) { 8006060: 44 60 00 7b be r3,r0,800624c <== NEVER TAKEN (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); 8006064: 29 62 00 e0 lw r2,(r11+224) 8006068: 35 61 00 30 addi r1,r11,48 800606c: d8 60 00 00 call r3 tty->tty_rcvwakeup = 1; 8006070: 34 01 00 01 mvi r1,1 8006074: 59 61 00 e4 sw (r11+228),r1 8006078: e0 00 00 75 bi 800624c while (len--) { c = *buf++; /* FIXME: implement IXANY: any character restarts output */ /* if incoming XON/XOFF controls outgoing stream: */ if (tty->flow_ctrl & FL_MDXON) { 800607c: 29 61 00 b8 lw r1,(r11+184) } return 0; } while (len--) { c = *buf++; 8006080: 41 b0 00 00 lbu r16,(r13+0) 8006084: 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) { 8006088: 20 21 02 00 andi r1,r1,0x200 800608c: 44 20 00 11 be r1,r0,80060d0 /* if received char is V_STOP and V_START (both are equal value) */ if (c == tty->termios.c_cc[VSTOP]) { 8006090: 41 64 00 4a lbu r4,(r11+74) 8006094: 41 63 00 49 lbu r3,(r11+73) 8006098: 5c 90 00 0a bne r4,r16,80060c0 if (c == tty->termios.c_cc[VSTART]) { 800609c: 5c 64 00 04 bne r3,r4,80060ac <== ALWAYS TAKEN /* received VSTOP and VSTART==VSTOP? */ /* then toggle "stop output" status */ tty->flow_ctrl = tty->flow_ctrl ^ FL_ORCVXOF; 80060a0: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 80060a4: 18 21 00 10 xori r1,r1,0x10 <== NOT EXECUTED 80060a8: e0 00 00 03 bi 80060b4 <== NOT EXECUTED } else { /* VSTOP received (other code than VSTART) */ /* stop output */ tty->flow_ctrl |= FL_ORCVXOF; 80060ac: 29 61 00 b8 lw r1,(r11+184) 80060b0: 38 21 00 10 ori r1,r1,0x10 80060b4: 59 61 00 b8 sw (r11+184),r1 * 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) { 80060b8: 34 12 00 01 mvi r18,1 80060bc: e0 00 00 06 bi 80060d4 /* stop output */ tty->flow_ctrl |= FL_ORCVXOF; } flow_rcv = true; } else if (c == tty->termios.c_cc[VSTART]) { 80060c0: 5c 70 00 04 bne r3,r16,80060d0 <== ALWAYS TAKEN /* VSTART received */ /* restart output */ tty->flow_ctrl &= ~FL_ORCVXOF; 80060c4: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 80060c8: a0 34 08 00 and r1,r1,r20 <== NOT EXECUTED 80060cc: e3 ff ff fa bi 80060b4 <== NOT EXECUTED flow_rcv = true; } } if (flow_rcv) { 80060d0: 46 40 00 15 be r18,r0,8006124 <== ALWAYS TAKEN /* restart output according to FL_ORCVXOF flag */ if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) { 80060d4: 29 61 00 b8 lw r1,(r11+184) 80060d8: 20 21 00 30 andi r1,r1,0x30 80060dc: 5c 3b 00 55 bne r1,fp,8006230 <== ALWAYS TAKEN /* disable interrupts */ rtems_interrupt_disable(level); 80060e0: 90 00 70 00 rcsr r14,IE <== NOT EXECUTED 80060e4: a1 d1 08 00 and r1,r14,r17 <== NOT EXECUTED 80060e8: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED tty->flow_ctrl &= ~FL_OSTOP; 80060ec: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 80060f0: a0 39 08 00 and r1,r1,r25 <== NOT EXECUTED 80060f4: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { 80060f8: 29 61 00 94 lw r1,(r11+148) <== NOT EXECUTED 80060fc: 44 20 00 08 be r1,r0,800611c <== NOT EXECUTED /* if chars available, call write function... */ (*tty->device.write)( tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1); 8006100: 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)( 8006104: 29 62 00 7c lw r2,(r11+124) <== NOT EXECUTED 8006108: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED 800610c: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8006110: b4 43 10 00 add r2,r2,r3 <== NOT EXECUTED 8006114: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 8006118: d8 80 00 00 call r4 <== NOT EXECUTED tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1); } /* reenable interrupts */ rtems_interrupt_enable(level); 800611c: d0 0e 00 00 wcsr IE,r14 <== NOT EXECUTED 8006120: e0 00 00 44 bi 8006230 <== NOT EXECUTED } } else { newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size; 8006124: 29 63 00 60 lw r3,(r11+96) 8006128: 29 62 00 64 lw r2,(r11+100) 800612c: 34 61 00 01 addi r1,r3,1 8006130: f8 00 5d de calli 801d8a8 <__umodsi3> 8006134: b8 20 70 00 mv r14,r1 /* if chars_in_buffer > highwater */ rtems_interrupt_disable(level); 8006138: 90 00 98 00 rcsr r19,IE 800613c: a2 71 08 00 and r1,r19,r17 8006140: d0 01 00 00 wcsr IE,r1 if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size) 8006144: 29 61 00 5c lw r1,(r11+92) 8006148: 29 63 00 64 lw r3,(r11+100) % tty->rawInBuf.Size) > tty->highwater) && 800614c: 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) 8006150: c8 61 18 00 sub r3,r3,r1 % tty->rawInBuf.Size) > tty->highwater) && 8006154: b4 6e 08 00 add r1,r3,r14 8006158: f8 00 5d d4 calli 801d8a8 <__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) 800615c: 29 62 00 c0 lw r2,(r11+192) 8006160: 50 41 00 22 bgeu r2,r1,80061e8 <== ALWAYS TAKEN % tty->rawInBuf.Size) > tty->highwater) && !(tty->flow_ctrl & FL_IREQXOF)) { 8006164: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8006168: 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) && 800616c: 5c 20 00 1f bne r1,r0,80061e8 <== NOT EXECUTED !(tty->flow_ctrl & FL_IREQXOF)) { /* incoming data stream should be stopped */ tty->flow_ctrl |= FL_IREQXOF; 8006170: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8006174: 38 21 00 01 ori r1,r1,0x1 <== NOT EXECUTED 8006178: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF)) 800617c: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8006180: 20 21 04 02 andi r1,r1,0x402 <== NOT EXECUTED 8006184: 5c 37 00 0f bne r1,r23,80061c0 <== NOT EXECUTED == (FL_MDXOF ) ) { if ((tty->flow_ctrl & FL_OSTOP) || 8006188: 29 63 00 b8 lw r3,(r11+184) <== NOT EXECUTED 800618c: 20 63 00 20 andi r3,r3,0x20 <== NOT EXECUTED 8006190: 5c 60 00 03 bne r3,r0,800619c <== NOT EXECUTED 8006194: 29 61 00 94 lw r1,(r11+148) <== NOT EXECUTED 8006198: 5c 23 00 14 bne r1,r3,80061e8 <== 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; 800619c: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED (*tty->device.write)(tty->minor, 80061a0: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED 80061a4: 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; 80061a8: 38 21 00 02 ori r1,r1,0x2 <== NOT EXECUTED 80061ac: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED (*tty->device.write)(tty->minor, 80061b0: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 80061b4: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 80061b8: d8 80 00 00 call r4 <== NOT EXECUTED 80061bc: e0 00 00 0b bi 80061e8 <== NOT EXECUTED (void *)&(tty->termios.c_cc[VSTOP]), 1); } } else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) { 80061c0: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 80061c4: 20 21 01 04 andi r1,r1,0x104 <== NOT EXECUTED 80061c8: 5c 36 00 08 bne r1,r22,80061e8 <== NOT EXECUTED tty->flow_ctrl |= FL_IRTSOFF; 80061cc: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED /* deactivate RTS line */ if (tty->device.stopRemoteTx != NULL) { 80061d0: 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; 80061d4: 38 21 00 04 ori r1,r1,0x4 <== NOT EXECUTED 80061d8: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* deactivate RTS line */ if (tty->device.stopRemoteTx != NULL) { 80061dc: 44 60 00 03 be r3,r0,80061e8 <== NOT EXECUTED tty->device.stopRemoteTx(tty->minor); 80061e0: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 80061e4: d8 60 00 00 call r3 <== NOT EXECUTED } } } /* reenable interrupts */ rtems_interrupt_enable(level); 80061e8: d0 13 00 00 wcsr IE,r19 if (newTail == tty->rawInBuf.Head) { 80061ec: 29 61 00 5c lw r1,(r11+92) 80061f0: 5d c1 00 03 bne r14,r1,80061fc <== ALWAYS TAKEN dropped++; 80061f4: 35 8c 00 01 addi r12,r12,1 <== NOT EXECUTED 80061f8: e0 00 00 0e bi 8006230 <== NOT EXECUTED } else { tty->rawInBuf.theBuf[newTail] = c; 80061fc: 29 61 00 58 lw r1,(r11+88) 8006200: b4 2e 08 00 add r1,r1,r14 8006204: 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 )) { 8006208: 29 64 00 e4 lw r4,(r11+228) if (newTail == tty->rawInBuf.Head) { dropped++; } else { tty->rawInBuf.theBuf[newTail] = c; tty->rawInBuf.Tail = newTail; 800620c: 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 )) { 8006210: 5c 80 00 08 bne r4,r0,8006230 <== NEVER TAKEN 8006214: 29 63 00 dc lw r3,(r11+220) 8006218: 44 64 00 06 be r3,r4,8006230 <== ALWAYS TAKEN (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); 800621c: 29 62 00 e0 lw r2,(r11+224) <== NOT EXECUTED 8006220: bb 00 08 00 mv r1,r24 <== NOT EXECUTED 8006224: d8 60 00 00 call r3 <== NOT EXECUTED tty->tty_rcvwakeup = 1; 8006228: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 800622c: 59 61 00 e4 sw (r11+228),r1 <== NOT EXECUTED 8006230: 35 ef ff ff addi r15,r15,-1 tty->tty_rcvwakeup = 1; } return 0; } while (len--) { 8006234: 5d e0 ff 92 bne r15,r0,800607c } } } } tty->rawInBufDropped += dropped; 8006238: 29 61 00 78 lw r1,(r11+120) 800623c: b4 2c 08 00 add r1,r1,r12 8006240: 59 61 00 78 sw (r11+120),r1 rtems_semaphore_release (tty->rawInBuf.Semaphore); 8006244: 29 61 00 68 lw r1,(r11+104) 8006248: f8 00 04 00 calli 8007248 return dropped; } 800624c: b9 80 08 00 mv r1,r12 8006250: 2b 9d 00 04 lw ra,(sp+4) 8006254: 2b 8b 00 44 lw r11,(sp+68) 8006258: 2b 8c 00 40 lw r12,(sp+64) 800625c: 2b 8d 00 3c lw r13,(sp+60) 8006260: 2b 8e 00 38 lw r14,(sp+56) 8006264: 2b 8f 00 34 lw r15,(sp+52) 8006268: 2b 90 00 30 lw r16,(sp+48) 800626c: 2b 91 00 2c lw r17,(sp+44) 8006270: 2b 92 00 28 lw r18,(sp+40) 8006274: 2b 93 00 24 lw r19,(sp+36) 8006278: 2b 94 00 20 lw r20,(sp+32) 800627c: 2b 95 00 1c lw r21,(sp+28) 8006280: 2b 96 00 18 lw r22,(sp+24) 8006284: 2b 97 00 14 lw r23,(sp+20) 8006288: 2b 98 00 10 lw r24,(sp+16) 800628c: 2b 99 00 0c lw r25,(sp+12) 8006290: 2b 9b 00 08 lw fp,(sp+8) 8006294: 37 9c 00 44 addi sp,sp,68 8006298: c3 a0 00 00 ret =============================================================================== 080047f0 : struct rtems_termios_tty *rtems_termios_ttyTail; rtems_id rtems_termios_ttyMutex; void rtems_termios_initialize (void) { 80047f0: 37 9c ff f8 addi sp,sp,-8 80047f4: 5b 8b 00 08 sw (sp+8),r11 80047f8: 5b 9d 00 04 sw (sp+4),ra rtems_status_code sc; /* * Create the mutex semaphore for the tty list */ if (!rtems_termios_ttyMutex) { 80047fc: 78 05 08 02 mvhi r5,0x802 8004800: 38 a5 1a 50 ori r5,r5,0x1a50 8004804: 28 ab 00 00 lw r11,(r5+0) 8004808: 5d 60 00 0a bne r11,r0,8004830 <== NEVER TAKEN sc = rtems_semaphore_create ( 800480c: 78 02 08 01 mvhi r2,0x801 8004810: 38 42 f5 fc ori r2,r2,0xf5fc 8004814: 28 41 00 00 lw r1,(r2+0) 8004818: 34 03 00 54 mvi r3,84 800481c: 34 02 00 01 mvi r2,1 8004820: 34 04 00 00 mvi r4,0 8004824: f8 00 09 8d calli 8006e58 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) 8004828: 44 2b 00 02 be r1,r11,8004830 <== ALWAYS TAKEN rtems_fatal_error_occurred (sc); 800482c: f8 00 0c 15 calli 8007880 <== NOT EXECUTED } } 8004830: 2b 9d 00 04 lw ra,(sp+4) 8004834: 2b 8b 00 08 lw r11,(sp+8) 8004838: 37 9c 00 08 addi sp,sp,8 800483c: c3 a0 00 00 ret =============================================================================== 08004fb8 : } } rtems_status_code rtems_termios_ioctl (void *arg) { 8004fb8: 37 9c ff e8 addi sp,sp,-24 8004fbc: 5b 8b 00 18 sw (sp+24),r11 8004fc0: 5b 8c 00 14 sw (sp+20),r12 8004fc4: 5b 8d 00 10 sw (sp+16),r13 8004fc8: 5b 8e 00 0c sw (sp+12),r14 8004fcc: 5b 8f 00 08 sw (sp+8),r15 8004fd0: 5b 9d 00 04 sw (sp+4),ra 8004fd4: b8 20 60 00 mv r12,r1 rtems_libio_ioctl_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8004fd8: 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); 8004fdc: 34 02 00 00 mvi r2,0 8004fe0: 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; 8004fe4: 28 2b 00 38 lw r11,(r1+56) struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer; rtems_status_code sc; args->ioctl_return = 0; 8004fe8: 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; 8004fec: 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); 8004ff0: 29 61 00 18 lw r1,(r11+24) 8004ff4: f8 00 08 45 calli 8007108 8004ff8: b8 20 68 00 mv r13,r1 if (sc != RTEMS_SUCCESSFUL) { 8004ffc: 5c 20 00 da bne r1,r0,8005364 <== NEVER TAKEN args->ioctl_return = sc; return sc; } switch (args->command) { 8005000: 29 82 00 04 lw r2,(r12+4) 8005004: 34 01 00 04 mvi r1,4 8005008: 44 41 00 a6 be r2,r1,80052a0 <== NEVER TAKEN 800500c: 54 41 00 07 bgu r2,r1,8005028 8005010: 34 01 00 02 mvi r1,2 8005014: 44 41 00 27 be r2,r1,80050b0 8005018: 54 41 00 9a bgu r2,r1,8005280 800501c: 34 01 00 01 mvi r1,1 8005020: 5c 41 00 12 bne r2,r1,8005068 <== NEVER TAKEN 8005024: e0 00 00 1e bi 800509c 8005028: 78 03 08 01 mvhi r3,0x801 800502c: 38 63 f6 18 ori r3,r3,0xf618 8005030: 28 61 00 00 lw r1,(r3+0) 8005034: 44 41 00 be be r2,r1,800532c <== NEVER TAKEN 8005038: 54 41 00 04 bgu r2,r1,8005048 800503c: 34 01 00 05 mvi r1,5 8005040: 5c 41 00 0a bne r2,r1,8005068 8005044: e0 00 00 92 bi 800528c 8005048: 78 03 08 01 mvhi r3,0x801 800504c: 38 63 f6 1c ori r3,r3,0xf61c 8005050: 28 61 00 00 lw r1,(r3+0) 8005054: 44 41 00 b2 be r2,r1,800531c <== NEVER TAKEN 8005058: 78 03 08 01 mvhi r3,0x801 800505c: 38 63 f6 20 ori r3,r3,0xf620 8005060: 28 61 00 00 lw r1,(r3+0) 8005064: 44 41 00 94 be r2,r1,80052b4 default: if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) { 8005068: 29 61 00 cc lw r1,(r11+204) 800506c: 78 0d 08 02 mvhi r13,0x802 8005070: 34 02 00 05 mvi r2,5 8005074: 39 ad 18 88 ori r13,r13,0x1888 8005078: fb ff f2 c9 calli 8001b9c <__ashlsi3> 800507c: b5 a1 08 00 add r1,r13,r1 8005080: 28 23 00 18 lw r3,(r1+24) sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args); } else { sc = RTEMS_INVALID_NUMBER; 8005084: 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) { 8005088: 44 60 00 b5 be r3,r0,800535c <== NEVER TAKEN sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args); 800508c: b9 60 08 00 mv r1,r11 8005090: b9 80 10 00 mv r2,r12 8005094: d8 60 00 00 call r3 8005098: e0 00 00 9f bi 8005314 sc = RTEMS_INVALID_NUMBER; } break; case RTEMS_IO_GET_ATTRIBUTES: *(struct termios *)args->buffer = tty->termios; 800509c: 29 81 00 08 lw r1,(r12+8) 80050a0: 35 62 00 30 addi r2,r11,48 80050a4: 34 03 00 24 mvi r3,36 80050a8: f8 00 2d 1c calli 8010518 break; 80050ac: e0 00 00 ac bi 800535c case RTEMS_IO_SET_ATTRIBUTES: tty->termios = *(struct termios *)args->buffer; 80050b0: 29 82 00 08 lw r2,(r12+8) 80050b4: 35 61 00 30 addi r1,r11,48 80050b8: 34 03 00 24 mvi r3,36 80050bc: f8 00 2d 17 calli 8010518 /* * check for flow control options to be switched off */ /* check for outgoing XON/XOFF flow control switched off */ if (( tty->flow_ctrl & FL_MDXON) && 80050c0: 29 61 00 b8 lw r1,(r11+184) 80050c4: 20 21 02 00 andi r1,r1,0x200 80050c8: 44 20 00 1d be r1,r0,800513c !(tty->termios.c_iflag & IXON)) { 80050cc: 29 61 00 30 lw r1,(r11+48) 80050d0: 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) && 80050d4: 5c 20 00 1a bne r1,r0,800513c <== ALWAYS TAKEN !(tty->termios.c_iflag & IXON)) { /* clear related flags in flow_ctrl */ tty->flow_ctrl &= ~(FL_MDXON | FL_ORCVXOF); 80050d8: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 80050dc: 34 01 fd ef mvi r1,-529 <== NOT EXECUTED 80050e0: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED 80050e4: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* has output been stopped due to received XOFF? */ if (tty->flow_ctrl & FL_OSTOP) { 80050e8: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 80050ec: 20 21 00 20 andi r1,r1,0x20 <== NOT EXECUTED 80050f0: 44 20 00 13 be r1,r0,800513c <== NOT EXECUTED /* disable interrupts */ rtems_interrupt_disable(level); 80050f4: 90 00 70 00 rcsr r14,IE <== NOT EXECUTED 80050f8: 34 01 ff fe mvi r1,-2 <== NOT EXECUTED 80050fc: a1 c1 08 00 and r1,r14,r1 <== NOT EXECUTED 8005100: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED tty->flow_ctrl &= ~FL_OSTOP; 8005104: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 8005108: 34 01 ff df mvi r1,-33 <== NOT EXECUTED 800510c: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED 8005110: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { 8005114: 29 61 00 94 lw r1,(r11+148) <== NOT EXECUTED 8005118: 44 20 00 08 be r1,r0,8005138 <== NOT EXECUTED /* if chars available, call write function... */ (*tty->device.write)( 800511c: 29 63 00 7c lw r3,(r11+124) <== NOT EXECUTED tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); 8005120: 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)( 8005124: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED 8005128: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 800512c: b4 62 10 00 add r2,r3,r2 <== NOT EXECUTED 8005130: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 8005134: d8 80 00 00 call r4 <== NOT EXECUTED tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); } /* reenable interrupts */ rtems_interrupt_enable(level); 8005138: 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)) { 800513c: 29 61 00 b8 lw r1,(r11+184) 8005140: 20 21 04 00 andi r1,r1,0x400 8005144: 44 20 00 0c be r1,r0,8005174 <== ALWAYS TAKEN 8005148: 29 61 00 30 lw r1,(r11+48) <== NOT EXECUTED 800514c: 20 21 10 00 andi r1,r1,0x1000 <== NOT EXECUTED 8005150: 5c 20 00 09 bne r1,r0,8005174 <== NOT EXECUTED /* clear related flags in flow_ctrl */ tty->flow_ctrl &= ~(FL_MDXOF); 8005154: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 8005158: 34 01 fb ff mvi r1,-1025 <== NOT EXECUTED 800515c: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED 8005160: 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); 8005164: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 8005168: 34 01 ff fd mvi r1,-3 <== NOT EXECUTED 800516c: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED 8005170: 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)) { 8005174: 29 61 00 b8 lw r1,(r11+184) 8005178: 20 21 01 00 andi r1,r1,0x100 800517c: 44 20 00 12 be r1,r0,80051c4 <== ALWAYS TAKEN 8005180: 29 61 00 38 lw r1,(r11+56) <== NOT EXECUTED 8005184: 48 01 00 10 bg r0,r1,80051c4 <== NOT EXECUTED /* clear related flags in flow_ctrl */ tty->flow_ctrl &= ~(FL_MDRTS); 8005188: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 800518c: 34 01 fe ff mvi r1,-257 <== NOT EXECUTED 8005190: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED 8005194: 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)) { 8005198: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 800519c: 20 21 00 04 andi r1,r1,0x4 <== NOT EXECUTED 80051a0: 44 20 00 05 be r1,r0,80051b4 <== NOT EXECUTED 80051a4: 29 62 00 b0 lw r2,(r11+176) <== NOT EXECUTED 80051a8: 44 40 00 03 be r2,r0,80051b4 <== NOT EXECUTED tty->device.startRemoteTx(tty->minor); 80051ac: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 80051b0: d8 40 00 00 call r2 <== NOT EXECUTED } tty->flow_ctrl &= ~(FL_IRTSOFF); 80051b4: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 80051b8: 34 01 ff fb mvi r1,-5 <== NOT EXECUTED 80051bc: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED 80051c0: 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) { 80051c4: 29 61 00 38 lw r1,(r11+56) 80051c8: 4c 20 00 04 bge r1,r0,80051d8 <== ALWAYS TAKEN tty->flow_ctrl |= FL_MDRTS; 80051cc: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 80051d0: 38 21 01 00 ori r1,r1,0x100 <== NOT EXECUTED 80051d4: 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) { 80051d8: 29 61 00 30 lw r1,(r11+48) 80051dc: 20 22 10 00 andi r2,r1,0x1000 80051e0: 44 40 00 04 be r2,r0,80051f0 tty->flow_ctrl |= FL_MDXOF; 80051e4: 29 62 00 b8 lw r2,(r11+184) 80051e8: 38 42 04 00 ori r2,r2,0x400 80051ec: 59 62 00 b8 sw (r11+184),r2 } /* check for outgoing XON/XOF flow control switched on */ if (tty->termios.c_iflag & IXON) { 80051f0: 20 21 04 00 andi r1,r1,0x400 80051f4: 44 20 00 04 be r1,r0,8005204 tty->flow_ctrl |= FL_MDXON; 80051f8: 29 61 00 b8 lw r1,(r11+184) 80051fc: 38 21 02 00 ori r1,r1,0x200 8005200: 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) { 8005204: 29 6e 00 3c lw r14,(r11+60) 8005208: 21 ce 00 02 andi r14,r14,0x2 800520c: 5d c0 00 11 bne r14,r0,8005250 tty->rawInBufSemaphoreOptions = RTEMS_WAIT; tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT; tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; } else { tty->vtimeTicks = tty->termios.c_cc[VTIME] * 8005210: 41 6f 00 46 lbu r15,(r11+70) rtems_clock_get_ticks_per_second() / 10; 8005214: f8 00 05 e8 calli 80069b4 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] * 8005218: b9 e0 10 00 mv r2,r15 800521c: f8 00 61 2e calli 801d6d4 <__mulsi3> rtems_clock_get_ticks_per_second() / 10; 8005220: 34 02 00 0a mvi r2,10 8005224: f8 00 61 91 calli 801d868 <__udivsi3> if (tty->termios.c_cc[VTIME]) { 8005228: 41 62 00 46 lbu r2,(r11+70) 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] * 800522c: 59 61 00 54 sw (r11+84),r1 8005230: 41 63 00 47 lbu r3,(r11+71) rtems_clock_get_ticks_per_second() / 10; if (tty->termios.c_cc[VTIME]) { 8005234: 44 4e 00 06 be r2,r14,800524c tty->rawInBufSemaphoreOptions = RTEMS_WAIT; 8005238: 59 60 00 6c sw (r11+108),r0 tty->rawInBufSemaphoreTimeout = tty->vtimeTicks; 800523c: 59 61 00 70 sw (r11+112),r1 if (tty->termios.c_cc[VMIN]) 8005240: 5c 60 00 06 bne r3,r0,8005258 tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; else tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks; 8005244: 59 61 00 74 sw (r11+116),r1 8005248: e0 00 00 08 bi 8005268 } else { if (tty->termios.c_cc[VMIN]) { 800524c: 44 62 00 05 be r3,r2,8005260 <== ALWAYS TAKEN tty->rawInBufSemaphoreOptions = RTEMS_WAIT; 8005250: 59 60 00 6c sw (r11+108),r0 tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT; 8005254: 59 60 00 70 sw (r11+112),r0 tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; 8005258: 59 60 00 74 sw (r11+116),r0 800525c: e0 00 00 03 bi 8005268 } else { tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT; 8005260: 34 01 00 01 mvi r1,1 8005264: 59 61 00 6c sw (r11+108),r1 } } } if (tty->device.setAttributes) 8005268: 29 63 00 a8 lw r3,(r11+168) 800526c: 44 60 00 3c be r3,r0,800535c <== NEVER TAKEN (*tty->device.setAttributes)(tty->minor, &tty->termios); 8005270: 29 61 00 10 lw r1,(r11+16) 8005274: 35 62 00 30 addi r2,r11,48 8005278: d8 60 00 00 call r3 800527c: e0 00 00 38 bi 800535c break; case RTEMS_IO_TCDRAIN: drainOutput (tty); 8005280: b9 60 08 00 mv r1,r11 8005284: fb ff fd 80 calli 8004884 break; 8005288: e0 00 00 35 bi 800535c case RTEMS_IO_SNDWAKEUP: tty->tty_snd = *wakeup; 800528c: 29 c1 00 00 lw r1,(r14+0) 8005290: 59 61 00 d4 sw (r11+212),r1 8005294: 29 c1 00 04 lw r1,(r14+4) 8005298: 59 61 00 d8 sw (r11+216),r1 break; 800529c: e0 00 00 30 bi 800535c case RTEMS_IO_RCVWAKEUP: tty->tty_rcv = *wakeup; 80052a0: 29 c1 00 00 lw r1,(r14+0) 80052a4: 59 61 00 dc sw (r11+220),r1 80052a8: 29 c1 00 04 lw r1,(r14+4) 80052ac: 59 61 00 e0 sw (r11+224),r1 break; 80052b0: e0 00 00 2b bi 800535c #if 1 /* FIXME */ case TIOCSETD: /* * close old line discipline */ if (rtems_termios_linesw[tty->t_line].l_close != NULL) { 80052b4: 29 61 00 cc lw r1,(r11+204) 80052b8: 34 02 00 05 mvi r2,5 80052bc: 78 0e 08 02 mvhi r14,0x802 80052c0: fb ff f2 37 calli 8001b9c <__ashlsi3> 80052c4: 39 ce 18 88 ori r14,r14,0x1888 80052c8: b5 c1 08 00 add r1,r14,r1 80052cc: 28 22 00 04 lw r2,(r1+4) 80052d0: 44 40 00 04 be r2,r0,80052e0 sc = rtems_termios_linesw[tty->t_line].l_close(tty); 80052d4: b9 60 08 00 mv r1,r11 80052d8: d8 40 00 00 call r2 80052dc: b8 20 68 00 mv r13,r1 } tty->t_line=*(int*)(args->buffer); 80052e0: 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) { 80052e4: 34 02 00 05 mvi r2,5 80052e8: 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); 80052ec: 28 21 00 00 lw r1,(r1+0) tty->t_sc = NULL; /* ensure that no more valid data */ 80052f0: 59 60 00 d0 sw (r11+208),r0 /* * open new line discipline */ if (rtems_termios_linesw[tty->t_line].l_open != NULL) { 80052f4: 39 ce 18 88 ori r14,r14,0x1888 * 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); 80052f8: 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) { 80052fc: fb ff f2 28 calli 8001b9c <__ashlsi3> 8005300: b5 c1 08 00 add r1,r14,r1 8005304: 28 22 00 00 lw r2,(r1+0) 8005308: 44 40 00 15 be r2,r0,800535c <== NEVER TAKEN sc = rtems_termios_linesw[tty->t_line].l_open(tty); 800530c: b9 60 08 00 mv r1,r11 8005310: d8 40 00 00 call r2 8005314: b8 20 68 00 mv r13,r1 8005318: e0 00 00 11 bi 800535c } break; case TIOCGETD: *(int*)(args->buffer)=tty->t_line; 800531c: 29 81 00 08 lw r1,(r12+8) 8005320: 29 62 00 cc lw r2,(r11+204) 8005324: 58 22 00 00 sw (r1+0),r2 break; 8005328: e0 00 00 0d bi 800535c #endif case FIONREAD: { int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head; 800532c: 29 62 00 60 lw r2,(r11+96) <== NOT EXECUTED 8005330: 29 61 00 5c lw r1,(r11+92) <== NOT EXECUTED 8005334: c8 41 08 00 sub r1,r2,r1 <== NOT EXECUTED if ( rawnc < 0 ) 8005338: 4c 20 00 03 bge r1,r0,8005344 <== NOT EXECUTED rawnc += tty->rawInBuf.Size; 800533c: 29 62 00 64 lw r2,(r11+100) <== NOT EXECUTED 8005340: 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; 8005344: 29 64 00 20 lw r4,(r11+32) <== NOT EXECUTED 8005348: 29 62 00 24 lw r2,(r11+36) <== NOT EXECUTED 800534c: 29 83 00 08 lw r3,(r12+8) <== NOT EXECUTED 8005350: c8 82 10 00 sub r2,r4,r2 <== NOT EXECUTED 8005354: b4 41 08 00 add r1,r2,r1 <== NOT EXECUTED 8005358: 58 61 00 00 sw (r3+0),r1 <== NOT EXECUTED } break; } rtems_semaphore_release (tty->osem); 800535c: 29 61 00 18 lw r1,(r11+24) 8005360: f8 00 07 ba calli 8007248 args->ioctl_return = sc; return sc; } 8005364: b9 a0 08 00 mv r1,r13 } break; } rtems_semaphore_release (tty->osem); args->ioctl_return = sc; 8005368: 59 8d 00 0c sw (r12+12),r13 return sc; } 800536c: 2b 9d 00 04 lw ra,(sp+4) 8005370: 2b 8b 00 18 lw r11,(sp+24) 8005374: 2b 8c 00 14 lw r12,(sp+20) 8005378: 2b 8d 00 10 lw r13,(sp+16) 800537c: 2b 8e 00 0c lw r14,(sp+12) 8005380: 2b 8f 00 08 lw r15,(sp+8) 8005384: 37 9c 00 18 addi sp,sp,24 8005388: c3 a0 00 00 ret =============================================================================== 08004914 : rtems_device_major_number major, rtems_device_minor_number minor, void *arg, const rtems_termios_callbacks *callbacks ) { 8004914: 37 9c ff d4 addi sp,sp,-44 8004918: 5b 8b 00 2c sw (sp+44),r11 800491c: 5b 8c 00 28 sw (sp+40),r12 8004920: 5b 8d 00 24 sw (sp+36),r13 8004924: 5b 8e 00 20 sw (sp+32),r14 8004928: 5b 8f 00 1c sw (sp+28),r15 800492c: 5b 90 00 18 sw (sp+24),r16 8004930: 5b 91 00 14 sw (sp+20),r17 8004934: 5b 92 00 10 sw (sp+16),r18 8004938: 5b 93 00 0c sw (sp+12),r19 800493c: 5b 94 00 08 sw (sp+8),r20 8004940: 5b 9d 00 04 sw (sp+4),ra 8004944: b8 20 88 00 mv r17,r1 struct rtems_termios_tty *tty; /* * See if the device has already been opened */ sc = rtems_semaphore_obtain( 8004948: 78 01 08 02 mvhi r1,0x802 800494c: 38 21 1a 50 ori r1,r1,0x1a50 8004950: 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 ) { 8004954: b8 40 90 00 mv r18,r2 8004958: b8 60 a0 00 mv r20,r3 struct rtems_termios_tty *tty; /* * See if the device has already been opened */ sc = rtems_semaphore_obtain( 800495c: 34 02 00 00 mvi r2,0 8004960: 34 03 00 00 mvi r3,0 rtems_device_major_number major, rtems_device_minor_number minor, void *arg, const rtems_termios_callbacks *callbacks ) { 8004964: b8 80 68 00 mv r13,r4 struct rtems_termios_tty *tty; /* * See if the device has already been opened */ sc = rtems_semaphore_obtain( 8004968: f8 00 09 e8 calli 8007108 800496c: b8 20 78 00 mv r15,r1 rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 8004970: 5c 20 01 02 bne r1,r0,8004d78 <== NEVER TAKEN return sc; for (tty = rtems_termios_ttyHead ; tty != NULL ; tty = tty->forw) { 8004974: 78 01 08 02 mvhi r1,0x802 8004978: 38 21 1a 58 ori r1,r1,0x1a58 800497c: 28 2e 00 00 lw r14,(r1+0) 8004980: b9 c0 60 00 mv r12,r14 8004984: e0 00 00 06 bi 800499c if ((tty->major == major) && (tty->minor == minor)) 8004988: 29 81 00 0c lw r1,(r12+12) <== NOT EXECUTED 800498c: 5c 31 00 03 bne r1,r17,8004998 <== NOT EXECUTED 8004990: 29 81 00 10 lw r1,(r12+16) <== NOT EXECUTED 8004994: 44 32 00 d8 be r1,r18,8004cf4 <== 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) { 8004998: 29 8c 00 00 lw r12,(r12+0) <== NOT EXECUTED 800499c: 5d 80 ff fb bne r12,r0,8004988 <== NEVER TAKEN 80049a0: e0 00 01 04 bi 8004db0 return RTEMS_NO_MEMORY; } /* * allocate raw input buffer */ tty->rawInBuf.Size = RAW_INPUT_BUFFER_SIZE; 80049a4: 78 01 08 02 mvhi r1,0x802 80049a8: 38 21 13 40 ori r1,r1,0x1340 80049ac: 28 21 00 00 lw r1,(r1+0) 80049b0: 59 81 00 64 sw (r12+100),r1 tty->rawInBuf.theBuf = malloc (tty->rawInBuf.Size); 80049b4: 29 81 00 64 lw r1,(r12+100) 80049b8: fb ff fb c8 calli 80038d8 80049bc: 59 81 00 58 sw (r12+88),r1 80049c0: b8 20 80 00 mv r16,r1 if (tty->rawInBuf.theBuf == NULL) { 80049c4: 5c 20 00 09 bne r1,r0,80049e8 free(tty); 80049c8: b9 80 08 00 mv r1,r12 80049cc: fb ff fa 00 calli 80031cc rtems_semaphore_release (rtems_termios_ttyMutex); 80049d0: 78 01 08 02 mvhi r1,0x802 80049d4: 38 21 1a 50 ori r1,r1,0x1a50 80049d8: 28 21 00 00 lw r1,(r1+0) return RTEMS_NO_MEMORY; 80049dc: 34 0f 00 1a mvi r15,26 */ 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); 80049e0: f8 00 0a 1a calli 8007248 return RTEMS_NO_MEMORY; 80049e4: e0 00 00 e5 bi 8004d78 } /* * allocate raw output buffer */ tty->rawOutBuf.Size = RAW_OUTPUT_BUFFER_SIZE; 80049e8: 78 01 08 02 mvhi r1,0x802 80049ec: 38 21 13 44 ori r1,r1,0x1344 80049f0: 28 21 00 00 lw r1,(r1+0) 80049f4: 59 81 00 88 sw (r12+136),r1 tty->rawOutBuf.theBuf = malloc (tty->rawOutBuf.Size); 80049f8: 29 81 00 88 lw r1,(r12+136) 80049fc: fb ff fb b7 calli 80038d8 8004a00: 59 81 00 7c sw (r12+124),r1 8004a04: b8 20 98 00 mv r19,r1 if (tty->rawOutBuf.theBuf == NULL) { 8004a08: 44 20 00 09 be r1,r0,8004a2c return RTEMS_NO_MEMORY; } /* * allocate cooked buffer */ tty->cbuf = malloc (CBUFSIZE); 8004a0c: 78 01 08 02 mvhi r1,0x802 8004a10: 38 21 13 3c ori r1,r1,0x133c 8004a14: 28 21 00 00 lw r1,(r1+0) 8004a18: fb ff fb b0 calli 80038d8 8004a1c: 59 81 00 1c sw (r12+28),r1 if (tty->cbuf == NULL) { 8004a20: 5c 20 00 06 bne r1,r0,8004a38 <== ALWAYS TAKEN free((void *)(tty->rawOutBuf.theBuf)); 8004a24: ba 60 08 00 mv r1,r19 <== NOT EXECUTED 8004a28: fb ff f9 e9 calli 80031cc <== NOT EXECUTED free((void *)(tty->rawInBuf.theBuf)); 8004a2c: ba 00 08 00 mv r1,r16 8004a30: fb ff f9 e7 calli 80031cc 8004a34: e3 ff ff e5 bi 80049c8 return RTEMS_NO_MEMORY; } /* * Initialize wakeup callbacks */ tty->tty_snd.sw_pfn = NULL; 8004a38: 59 80 00 d4 sw (r12+212),r0 tty->tty_snd.sw_arg = NULL; 8004a3c: 59 80 00 d8 sw (r12+216),r0 tty->tty_rcv.sw_pfn = NULL; 8004a40: 59 80 00 dc sw (r12+220),r0 tty->tty_rcv.sw_arg = NULL; 8004a44: 59 80 00 e0 sw (r12+224),r0 tty->tty_rcvwakeup = 0; 8004a48: 59 80 00 e4 sw (r12+228),r0 /* * link tty */ tty->forw = rtems_termios_ttyHead; 8004a4c: 59 8e 00 00 sw (r12+0),r14 tty->back = NULL; 8004a50: 59 80 00 04 sw (r12+4),r0 if (rtems_termios_ttyHead != NULL) 8004a54: 45 c0 00 02 be r14,r0,8004a5c <== ALWAYS TAKEN rtems_termios_ttyHead->back = tty; 8004a58: 59 cc 00 04 sw (r14+4),r12 <== NOT EXECUTED rtems_termios_ttyHead = tty; 8004a5c: 78 01 08 02 mvhi r1,0x802 if (rtems_termios_ttyTail == NULL) 8004a60: 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; 8004a64: 38 21 1a 58 ori r1,r1,0x1a58 if (rtems_termios_ttyTail == NULL) 8004a68: 38 84 1a 54 ori r4,r4,0x1a54 */ tty->forw = rtems_termios_ttyHead; tty->back = NULL; if (rtems_termios_ttyHead != NULL) rtems_termios_ttyHead->back = tty; rtems_termios_ttyHead = tty; 8004a6c: 58 2b 00 00 sw (r1+0),r11 if (rtems_termios_ttyTail == NULL) 8004a70: 28 81 00 00 lw r1,(r4+0) 8004a74: 5c 20 00 02 bne r1,r0,8004a7c <== NEVER TAKEN rtems_termios_ttyTail = tty; 8004a78: 58 8b 00 00 sw (r4+0),r11 /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( rtems_build_name ('T', 'R', 'i', c), 8004a7c: 78 0e 08 02 mvhi r14,0x802 tty->major = major; /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( 8004a80: 78 03 08 01 mvhi r3,0x801 8004a84: 38 63 f6 00 ori r3,r3,0xf600 rtems_build_name ('T', 'R', 'i', c), 8004a88: 39 ce 13 48 ori r14,r14,0x1348 8004a8c: 41 c2 00 00 lbu r2,(r14+0) tty->major = major; /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( 8004a90: 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; 8004a94: 59 72 00 10 sw (r11+16),r18 tty->major = major; 8004a98: 59 71 00 0c sw (r11+12),r17 /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( 8004a9c: b8 41 08 00 or r1,r2,r1 8004aa0: 34 03 00 54 mvi r3,84 8004aa4: 34 02 00 01 mvi r2,1 8004aa8: 34 04 00 00 mvi r4,0 8004aac: 35 65 00 14 addi r5,r11,20 8004ab0: f8 00 08 ea calli 8006e58 8004ab4: 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) 8004ab8: 5c 20 00 ab bne r1,r0,8004d64 <== NEVER TAKEN rtems_fatal_error_occurred (sc); sc = rtems_semaphore_create ( 8004abc: 78 03 08 01 mvhi r3,0x801 8004ac0: 38 63 f6 04 ori r3,r3,0xf604 rtems_build_name ('T', 'R', 'o', c), 8004ac4: 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 ( 8004ac8: 28 61 00 00 lw r1,(r3+0) 8004acc: 34 04 00 00 mvi r4,0 8004ad0: 34 03 00 54 mvi r3,84 8004ad4: b8 41 08 00 or r1,r2,r1 8004ad8: 35 65 00 18 addi r5,r11,24 8004adc: 34 02 00 01 mvi r2,1 8004ae0: f8 00 08 de calli 8006e58 8004ae4: 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) 8004ae8: 5c 30 00 9f bne r1,r16,8004d64 <== NEVER TAKEN rtems_fatal_error_occurred (sc); sc = rtems_semaphore_create ( 8004aec: 78 03 08 01 mvhi r3,0x801 8004af0: 38 63 f6 08 ori r3,r3,0xf608 rtems_build_name ('T', 'R', 'x', c), 8004af4: 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 ( 8004af8: 28 61 00 00 lw r1,(r3+0) 8004afc: 34 04 00 00 mvi r4,0 8004b00: 34 03 00 20 mvi r3,32 8004b04: b8 41 08 00 or r1,r2,r1 8004b08: 35 65 00 8c addi r5,r11,140 8004b0c: 34 02 00 00 mvi r2,0 8004b10: f8 00 08 d2 calli 8006e58 8004b14: 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) 8004b18: 5c 33 00 93 bne r1,r19,8004d64 <== NEVER TAKEN tty->rawOutBufState = rob_idle; /* * Set callbacks */ tty->device = *callbacks; 8004b1c: 29 a2 00 18 lw r2,(r13+24) 8004b20: 29 a8 00 00 lw r8,(r13+0) 8004b24: 29 a7 00 04 lw r7,(r13+4) 8004b28: 29 a6 00 08 lw r6,(r13+8) 8004b2c: 29 a5 00 0c lw r5,(r13+12) 8004b30: 29 a4 00 10 lw r4,(r13+16) 8004b34: 29 a3 00 14 lw r3,(r13+20) 8004b38: 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; 8004b3c: 59 60 00 94 sw (r11+148),r0 /* * Set callbacks */ tty->device = *callbacks; 8004b40: 59 62 00 b0 sw (r11+176),r2 8004b44: 59 68 00 98 sw (r11+152),r8 8004b48: 59 67 00 9c sw (r11+156),r7 8004b4c: 59 66 00 a0 sw (r11+160),r6 8004b50: 59 65 00 a4 sw (r11+164),r5 8004b54: 59 64 00 a8 sw (r11+168),r4 8004b58: 59 63 00 ac sw (r11+172),r3 8004b5c: 59 61 00 b4 sw (r11+180),r1 /* * Create I/O tasks */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 8004b60: 34 02 00 02 mvi r2,2 8004b64: 5c 22 00 1a bne r1,r2,8004bcc sc = rtems_task_create ( 8004b68: 78 03 08 01 mvhi r3,0x801 8004b6c: 38 63 f6 0c ori r3,r3,0xf60c rtems_build_name ('T', 'x', 'T', c), 8004b70: 41 c2 00 00 lbu r2,(r14+0) /* * Create I/O tasks */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { sc = rtems_task_create ( 8004b74: 28 61 00 00 lw r1,(r3+0) 8004b78: 34 04 05 00 mvi r4,1280 8004b7c: 34 03 04 00 mvi r3,1024 8004b80: b8 41 08 00 or r1,r2,r1 8004b84: 34 05 00 00 mvi r5,0 8004b88: 34 02 00 0a mvi r2,10 8004b8c: 35 66 00 c8 addi r6,r11,200 8004b90: f8 00 09 ec calli 8007340 8004b94: 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) 8004b98: 5c 30 00 73 bne r1,r16,8004d64 <== NEVER TAKEN rtems_fatal_error_occurred (sc); sc = rtems_task_create ( 8004b9c: 78 03 08 01 mvhi r3,0x801 8004ba0: 38 63 f6 10 ori r3,r3,0xf610 rtems_build_name ('R', 'x', 'T', c), 8004ba4: 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 ( 8004ba8: 28 61 00 00 lw r1,(r3+0) 8004bac: 34 04 05 00 mvi r4,1280 8004bb0: 34 03 04 00 mvi r3,1024 8004bb4: b8 41 08 00 or r1,r2,r1 8004bb8: 34 05 00 00 mvi r5,0 8004bbc: 34 02 00 09 mvi r2,9 8004bc0: 35 66 00 c4 addi r6,r11,196 8004bc4: f8 00 09 df calli 8007340 TERMIOS_RXTASK_STACKSIZE, RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, &tty->rxTaskId); if (sc != RTEMS_SUCCESSFUL) 8004bc8: 5c 2d 00 67 bne r1,r13,8004d64 <== NEVER TAKEN rtems_fatal_error_occurred (sc); } if ((tty->device.pollRead == NULL) || 8004bcc: 29 61 00 a0 lw r1,(r11+160) 8004bd0: 44 20 00 04 be r1,r0,8004be0 8004bd4: 29 62 00 b4 lw r2,(r11+180) 8004bd8: 34 01 00 02 mvi r1,2 8004bdc: 5c 41 00 0e bne r2,r1,8004c14 (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){ sc = rtems_semaphore_create ( rtems_build_name ('T', 'R', 'r', c), 8004be0: 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 ( 8004be4: 78 03 08 01 mvhi r3,0x801 rtems_build_name ('T', 'R', 'r', c), 8004be8: 38 21 13 48 ori r1,r1,0x1348 rtems_fatal_error_occurred (sc); } if ((tty->device.pollRead == NULL) || (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){ sc = rtems_semaphore_create ( 8004bec: 38 63 f6 14 ori r3,r3,0xf614 rtems_build_name ('T', 'R', 'r', c), 8004bf0: 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 ( 8004bf4: 28 61 00 00 lw r1,(r3+0) 8004bf8: 34 04 00 00 mvi r4,0 8004bfc: 34 03 00 24 mvi r3,36 8004c00: b8 41 08 00 or r1,r2,r1 8004c04: 35 65 00 68 addi r5,r11,104 8004c08: 34 02 00 00 mvi r2,0 8004c0c: f8 00 08 93 calli 8006e58 rtems_build_name ('T', 'R', 'r', c), 0, RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &tty->rawInBuf.Semaphore); if (sc != RTEMS_SUCCESSFUL) 8004c10: 5c 20 00 55 bne r1,r0,8004d64 <== NEVER TAKEN } /* * Set default parameters */ tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL; 8004c14: 34 01 25 02 mvi r1,9474 8004c18: 59 61 00 30 sw (r11+48),r1 tty->termios.c_oflag = OPOST | ONLCR | XTABS; 8004c1c: 34 01 18 05 mvi r1,6149 8004c20: 59 61 00 34 sw (r11+52),r1 tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL; 8004c24: 34 01 08 bd mvi r1,2237 8004c28: 59 61 00 38 sw (r11+56),r1 tty->termios.c_lflag = 8004c2c: 34 21 79 7e addi r1,r1,31102 8004c30: 59 61 00 3c sw (r11+60),r1 ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL; tty->termios.c_cc[VINTR] = '\003'; 8004c34: 34 01 00 03 mvi r1,3 8004c38: 31 61 00 41 sb (r11+65),r1 tty->termios.c_cc[VQUIT] = '\034'; 8004c3c: 34 01 00 1c mvi r1,28 8004c40: 31 61 00 42 sb (r11+66),r1 tty->termios.c_cc[VERASE] = '\177'; 8004c44: 34 01 00 7f mvi r1,127 8004c48: 31 61 00 43 sb (r11+67),r1 tty->termios.c_cc[VKILL] = '\025'; 8004c4c: 34 01 00 15 mvi r1,21 8004c50: 31 61 00 44 sb (r11+68),r1 tty->termios.c_cc[VEOF] = '\004'; 8004c54: 34 01 00 04 mvi r1,4 8004c58: 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'; 8004c5c: 34 01 00 11 mvi r1,17 8004c60: 31 61 00 49 sb (r11+73),r1 tty->termios.c_cc[VSTOP] = '\023'; 8004c64: 34 01 00 13 mvi r1,19 8004c68: 31 61 00 4a sb (r11+74),r1 tty->termios.c_cc[VSUSP] = '\032'; 8004c6c: 34 01 00 1a mvi r1,26 8004c70: 31 61 00 4b sb (r11+75),r1 tty->termios.c_cc[VREPRINT] = '\022'; 8004c74: 34 01 00 12 mvi r1,18 8004c78: 31 61 00 4d sb (r11+77),r1 tty->termios.c_cc[VDISCARD] = '\017'; 8004c7c: 34 01 00 0f mvi r1,15 8004c80: 31 61 00 4e sb (r11+78),r1 tty->termios.c_cc[VWERASE] = '\027'; 8004c84: 34 01 00 17 mvi r1,23 8004c88: 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; 8004c8c: 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'; 8004c90: 34 01 00 16 mvi r1,22 8004c94: 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; 8004c98: 29 61 00 64 lw r1,(r11+100) 8004c9c: 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'; 8004ca0: 31 60 00 4c sb (r11+76),r0 tty->termios.c_cc[VEOL2] = '\000'; 8004ca4: 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; 8004ca8: f8 00 62 64 calli 801d638 <__lshrsi3> tty->highwater = tty->rawInBuf.Size * 3/4; 8004cac: 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; 8004cb0: 59 61 00 bc sw (r11+188),r1 tty->highwater = tty->rawInBuf.Size * 3/4; 8004cb4: 34 02 00 01 mvi r2,1 8004cb8: b9 a0 08 00 mv r1,r13 8004cbc: fb ff f3 b8 calli 8001b9c <__ashlsi3> 8004cc0: 34 02 00 02 mvi r2,2 8004cc4: b4 2d 08 00 add r1,r1,r13 8004cc8: f8 00 62 5c calli 801d638 <__lshrsi3> /* * Bump name characer */ if (c++ == 'z') 8004ccc: 78 04 08 02 mvhi r4,0x802 8004cd0: 38 84 13 48 ori r4,r4,0x1348 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; 8004cd4: 59 61 00 c0 sw (r11+192),r1 /* * Bump name characer */ if (c++ == 'z') 8004cd8: 40 81 00 00 lbu r1,(r4+0) 8004cdc: 34 22 00 01 addi r2,r1,1 8004ce0: 30 82 00 00 sb (r4+0),r2 8004ce4: 34 02 00 7a mvi r2,122 8004ce8: 5c 22 00 03 bne r1,r2,8004cf4 c = 'a'; 8004cec: 34 01 00 61 mvi r1,97 8004cf0: 30 81 00 00 sb (r4+0),r1 } args->iop->data1 = tty; 8004cf4: 2a 81 00 00 lw r1,(r20+0) if (!tty->refcount++) { 8004cf8: 29 82 00 08 lw r2,(r12+8) */ if (c++ == 'z') c = 'a'; } args->iop->data1 = tty; 8004cfc: 58 2c 00 38 sw (r1+56),r12 if (!tty->refcount++) { 8004d00: 34 41 00 01 addi r1,r2,1 8004d04: 59 81 00 08 sw (r12+8),r1 8004d08: 5c 40 00 18 bne r2,r0,8004d68 <== NEVER TAKEN if (tty->device.firstOpen) 8004d0c: 29 84 00 98 lw r4,(r12+152) 8004d10: 44 82 00 05 be r4,r2,8004d24 <== ALWAYS TAKEN (*tty->device.firstOpen)(major, minor, arg); 8004d14: ba 20 08 00 mv r1,r17 <== NOT EXECUTED 8004d18: ba 40 10 00 mv r2,r18 <== NOT EXECUTED 8004d1c: ba 80 18 00 mv r3,r20 <== NOT EXECUTED 8004d20: d8 80 00 00 call r4 <== NOT EXECUTED /* * start I/O tasks, if needed */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 8004d24: 29 82 00 b4 lw r2,(r12+180) 8004d28: 34 01 00 02 mvi r1,2 8004d2c: 5c 41 00 0f bne r2,r1,8004d68 sc = rtems_task_start( 8004d30: 29 81 00 c4 lw r1,(r12+196) 8004d34: 78 02 08 00 mvhi r2,0x800 8004d38: 38 42 62 9c ori r2,r2,0x629c 8004d3c: b9 80 18 00 mv r3,r12 8004d40: f8 00 0a 28 calli 80075e0 8004d44: b8 20 58 00 mv r11,r1 tty->rxTaskId, rtems_termios_rxdaemon, (rtems_task_argument)tty); if (sc != RTEMS_SUCCESSFUL) 8004d48: 5c 20 00 07 bne r1,r0,8004d64 <== NEVER TAKEN rtems_fatal_error_occurred (sc); sc = rtems_task_start( 8004d4c: 29 81 00 c8 lw r1,(r12+200) 8004d50: 78 02 08 00 mvhi r2,0x800 8004d54: 38 42 65 1c ori r2,r2,0x651c 8004d58: b9 80 18 00 mv r3,r12 8004d5c: f8 00 0a 21 calli 80075e0 tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty); if (sc != RTEMS_SUCCESSFUL) 8004d60: 44 2b 00 02 be r1,r11,8004d68 <== ALWAYS TAKEN rtems_fatal_error_occurred (sc); 8004d64: f8 00 0a c7 calli 8007880 <== NOT EXECUTED } } rtems_semaphore_release (rtems_termios_ttyMutex); 8004d68: 78 01 08 02 mvhi r1,0x802 8004d6c: 38 21 1a 50 ori r1,r1,0x1a50 8004d70: 28 21 00 00 lw r1,(r1+0) 8004d74: f8 00 09 35 calli 8007248 return RTEMS_SUCCESSFUL; } 8004d78: b9 e0 08 00 mv r1,r15 8004d7c: 2b 9d 00 04 lw ra,(sp+4) 8004d80: 2b 8b 00 2c lw r11,(sp+44) 8004d84: 2b 8c 00 28 lw r12,(sp+40) 8004d88: 2b 8d 00 24 lw r13,(sp+36) 8004d8c: 2b 8e 00 20 lw r14,(sp+32) 8004d90: 2b 8f 00 1c lw r15,(sp+28) 8004d94: 2b 90 00 18 lw r16,(sp+24) 8004d98: 2b 91 00 14 lw r17,(sp+20) 8004d9c: 2b 92 00 10 lw r18,(sp+16) 8004da0: 2b 93 00 0c lw r19,(sp+12) 8004da4: 2b 94 00 08 lw r20,(sp+8) 8004da8: 37 9c 00 2c addi sp,sp,44 8004dac: c3 a0 00 00 ret static char c = 'a'; /* * Create a new device */ tty = calloc (1, sizeof (struct rtems_termios_tty)); 8004db0: 34 01 00 01 mvi r1,1 8004db4: 34 02 00 e8 mvi r2,232 8004db8: fb ff f7 5d calli 8002b2c 8004dbc: b8 20 60 00 mv r12,r1 8004dc0: b8 20 58 00 mv r11,r1 if (tty == NULL) { 8004dc4: 5c 20 fe f8 bne r1,r0,80049a4 8004dc8: e3 ff ff 02 bi 80049d0 =============================================================================== 0800538c : * Send characters to device-specific code */ void rtems_termios_puts ( const void *_buf, int len, struct rtems_termios_tty *tty) { 800538c: 37 9c ff dc addi sp,sp,-36 8005390: 5b 8b 00 24 sw (sp+36),r11 8005394: 5b 8c 00 20 sw (sp+32),r12 8005398: 5b 8d 00 1c sw (sp+28),r13 800539c: 5b 8e 00 18 sw (sp+24),r14 80053a0: 5b 8f 00 14 sw (sp+20),r15 80053a4: 5b 90 00 10 sw (sp+16),r16 80053a8: 5b 91 00 0c sw (sp+12),r17 80053ac: 5b 92 00 08 sw (sp+8),r18 80053b0: 5b 9d 00 04 sw (sp+4),ra 80053b4: b8 20 20 00 mv r4,r1 const unsigned char *buf = _buf; 80053b8: b8 20 68 00 mv r13,r1 unsigned int newHead; rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) { 80053bc: 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) { 80053c0: b8 40 70 00 mv r14,r2 80053c4: 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) { 80053c8: 5c 20 00 07 bne r1,r0,80053e4 (*tty->device.write)(tty->minor, (void *)buf, len); 80053cc: 28 65 00 a4 lw r5,(r3+164) 80053d0: 28 61 00 10 lw r1,(r3+16) 80053d4: b8 80 10 00 mv r2,r4 80053d8: b9 c0 18 00 mv r3,r14 80053dc: d8 a0 00 00 call r5 return; 80053e0: e0 00 00 36 bi 80054b8 } newHead = tty->rawOutBuf.Head; 80053e4: 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); 80053e8: 34 10 ff fe mvi r16,-2 while (newHead == tty->rawOutBuf.Tail) { tty->rawOutBufState = rob_wait; 80053ec: 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; 80053f0: 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) { 80053f4: e0 00 00 30 bi 80054b4 * len -= ncopy * * To minimize latency, the memcpy should be done * with interrupts enabled. */ newHead = (newHead + 1) % tty->rawOutBuf.Size; 80053f8: 29 62 00 88 lw r2,(r11+136) 80053fc: 35 81 00 01 addi r1,r12,1 8005400: f8 00 61 2a calli 801d8a8 <__umodsi3> 8005404: b8 20 60 00 mv r12,r1 rtems_interrupt_disable (level); 8005408: 90 00 78 00 rcsr r15,IE 800540c: a1 f0 08 00 and r1,r15,r16 8005410: d0 01 00 00 wcsr IE,r1 while (newHead == tty->rawOutBuf.Tail) { 8005414: e0 00 00 0c bi 8005444 tty->rawOutBufState = rob_wait; 8005418: 59 72 00 94 sw (r11+148),r18 rtems_interrupt_enable (level); 800541c: d0 0f 00 00 wcsr IE,r15 sc = rtems_semaphore_obtain( 8005420: 29 61 00 8c lw r1,(r11+140) 8005424: 34 02 00 00 mvi r2,0 8005428: 34 03 00 00 mvi r3,0 800542c: f8 00 07 37 calli 8007108 tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 8005430: 44 20 00 02 be r1,r0,8005438 <== ALWAYS TAKEN rtems_fatal_error_occurred (sc); 8005434: f8 00 09 13 calli 8007880 <== NOT EXECUTED rtems_interrupt_disable (level); 8005438: 90 00 78 00 rcsr r15,IE 800543c: a1 f0 08 00 and r1,r15,r16 8005440: 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) { 8005444: 29 61 00 84 lw r1,(r11+132) 8005448: 45 81 ff f4 be r12,r1,8005418 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++; 800544c: 29 61 00 80 lw r1,(r11+128) 8005450: 29 62 00 7c lw r2,(r11+124) 8005454: b4 41 08 00 add r1,r2,r1 8005458: 41 a2 00 00 lbu r2,(r13+0) 800545c: 35 ad 00 01 addi r13,r13,1 8005460: 30 22 00 00 sb (r1+0),r2 tty->rawOutBuf.Head = newHead; if (tty->rawOutBufState == rob_idle) { 8005464: 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; 8005468: 59 6c 00 80 sw (r11+128),r12 if (tty->rawOutBufState == rob_idle) { 800546c: 5c 20 00 10 bne r1,r0,80054ac /* check, whether XOFF has been received */ if (!(tty->flow_ctrl & FL_ORCVXOF)) { 8005470: 29 62 00 b8 lw r2,(r11+184) 8005474: 20 42 00 10 andi r2,r2,0x10 8005478: 5c 41 00 09 bne r2,r1,800549c <== NEVER TAKEN (*tty->device.write)(tty->minor, 800547c: 29 63 00 7c lw r3,(r11+124) (char *)&tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); 8005480: 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, 8005484: 29 64 00 a4 lw r4,(r11+164) 8005488: 29 61 00 10 lw r1,(r11+16) 800548c: b4 62 10 00 add r2,r3,r2 8005490: 34 03 00 01 mvi r3,1 8005494: d8 80 00 00 call r4 8005498: e0 00 00 04 bi 80054a8 (char *)&tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); } else { /* remember that output has been stopped due to flow ctrl*/ tty->flow_ctrl |= FL_OSTOP; 800549c: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 80054a0: 38 21 00 20 ori r1,r1,0x20 <== NOT EXECUTED 80054a4: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED } tty->rawOutBufState = rob_busy; 80054a8: 59 71 00 94 sw (r11+148),r17 } rtems_interrupt_enable (level); 80054ac: d0 0f 00 00 wcsr IE,r15 len--; 80054b0: 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) { 80054b4: 5d c0 ff d1 bne r14,r0,80053f8 <== NEVER TAKEN tty->rawOutBufState = rob_busy; } rtems_interrupt_enable (level); len--; } } 80054b8: 2b 9d 00 04 lw ra,(sp+4) 80054bc: 2b 8b 00 24 lw r11,(sp+36) 80054c0: 2b 8c 00 20 lw r12,(sp+32) 80054c4: 2b 8d 00 1c lw r13,(sp+28) 80054c8: 2b 8e 00 18 lw r14,(sp+24) 80054cc: 2b 8f 00 14 lw r15,(sp+20) 80054d0: 2b 90 00 10 lw r16,(sp+16) 80054d4: 2b 91 00 0c lw r17,(sp+12) 80054d8: 2b 92 00 08 lw r18,(sp+8) 80054dc: 37 9c 00 24 addi sp,sp,36 80054e0: c3 a0 00 00 ret =============================================================================== 08005c04 : return RTEMS_SUCCESSFUL; } rtems_status_code rtems_termios_read (void *arg) { 8005c04: 37 9c ff cc addi sp,sp,-52 8005c08: 5b 8b 00 34 sw (sp+52),r11 8005c0c: 5b 8c 00 30 sw (sp+48),r12 8005c10: 5b 8d 00 2c sw (sp+44),r13 8005c14: 5b 8e 00 28 sw (sp+40),r14 8005c18: 5b 8f 00 24 sw (sp+36),r15 8005c1c: 5b 90 00 20 sw (sp+32),r16 8005c20: 5b 91 00 1c sw (sp+28),r17 8005c24: 5b 92 00 18 sw (sp+24),r18 8005c28: 5b 93 00 14 sw (sp+20),r19 8005c2c: 5b 94 00 10 sw (sp+16),r20 8005c30: 5b 95 00 0c sw (sp+12),r21 8005c34: 5b 96 00 08 sw (sp+8),r22 8005c38: 5b 9d 00 04 sw (sp+4),ra 8005c3c: b8 20 60 00 mv r12,r1 rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8005c40: 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); 8005c44: 34 02 00 00 mvi r2,0 8005c48: 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; 8005c4c: 28 2b 00 38 lw r11,(r1+56) uint32_t count = args->count; 8005c50: 29 8f 00 14 lw r15,(r12+20) char *buffer = args->buffer; 8005c54: 29 91 00 10 lw r17,(r12+16) rtems_status_code sc; sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8005c58: 29 61 00 14 lw r1,(r11+20) 8005c5c: f8 00 05 2b calli 8007108 8005c60: b8 20 70 00 mv r14,r1 if (sc != RTEMS_SUCCESSFUL) 8005c64: 5c 20 00 ad bne r1,r0,8005f18 <== NEVER TAKEN return sc; if (rtems_termios_linesw[tty->t_line].l_read != NULL) { 8005c68: 29 61 00 cc lw r1,(r11+204) 8005c6c: 78 0d 08 02 mvhi r13,0x802 8005c70: 34 02 00 05 mvi r2,5 8005c74: fb ff ef ca calli 8001b9c <__ashlsi3> 8005c78: 39 ad 18 88 ori r13,r13,0x1888 8005c7c: b5 a1 08 00 add r1,r13,r1 8005c80: 28 23 00 08 lw r3,(r1+8) 8005c84: 44 6e 00 06 be r3,r14,8005c9c sc = rtems_termios_linesw[tty->t_line].l_read(tty,args); 8005c88: b9 60 08 00 mv r1,r11 8005c8c: b9 80 10 00 mv r2,r12 8005c90: d8 60 00 00 call r3 8005c94: b8 20 70 00 mv r14,r1 8005c98: e0 00 00 9d bi 8005f0c tty->tty_rcvwakeup = 0; rtems_semaphore_release (tty->isem); return sc; } if (tty->cindex == tty->ccount) { 8005c9c: 29 62 00 24 lw r2,(r11+36) 8005ca0: 29 61 00 20 lw r1,(r11+32) 8005ca4: 5c 41 00 93 bne r2,r1,8005ef0 <== NEVER TAKEN tty->cindex = tty->ccount = 0; tty->read_start_column = tty->column; 8005ca8: 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; 8005cac: 59 60 00 20 sw (r11+32),r0 8005cb0: 59 60 00 24 sw (r11+36),r0 tty->read_start_column = tty->column; 8005cb4: 59 61 00 2c sw (r11+44),r1 if (tty->device.pollRead != NULL && 8005cb8: 29 61 00 a0 lw r1,(r11+160) 8005cbc: 44 20 00 31 be r1,r0,8005d80 8005cc0: 29 61 00 b4 lw r1,(r11+180) 8005cc4: 5c 20 00 2f bne r1,r0,8005d80 static rtems_status_code fillBufferPoll (struct rtems_termios_tty *tty) { int n; if (tty->termios.c_lflag & ICANON) { 8005cc8: 29 61 00 3c lw r1,(r11+60) 8005ccc: 20 21 00 02 andi r1,r1,0x2 8005cd0: 44 20 00 0d be r1,r0,8005d04 for (;;) { n = (*tty->device.pollRead)(tty->minor); 8005cd4: 29 62 00 a0 lw r2,(r11+160) 8005cd8: 29 61 00 10 lw r1,(r11+16) 8005cdc: d8 40 00 00 call r2 if (n < 0) { 8005ce0: 4c 20 00 04 bge r1,r0,8005cf0 rtems_task_wake_after (1); 8005ce4: 34 01 00 01 mvi r1,1 8005ce8: f8 00 06 5e calli 8007660 8005cec: e3 ff ff fa bi 8005cd4 } else { if (siproc (n, tty)) 8005cf0: 20 21 00 ff andi r1,r1,0xff 8005cf4: b9 60 10 00 mv r2,r11 8005cf8: fb ff ff 6b calli 8005aa4 8005cfc: 44 20 ff f6 be r1,r0,8005cd4 8005d00: e0 00 00 7c bi 8005ef0 } } } else { rtems_interval then, now; then = rtems_clock_get_ticks_since_boot(); 8005d04: f8 00 03 38 calli 80069e4 8005d08: b8 20 68 00 mv r13,r1 for (;;) { n = (*tty->device.pollRead)(tty->minor); 8005d0c: 29 62 00 a0 lw r2,(r11+160) 8005d10: 29 61 00 10 lw r1,(r11+16) 8005d14: d8 40 00 00 call r2 if (n < 0) { 8005d18: 4c 20 00 10 bge r1,r0,8005d58 if (tty->termios.c_cc[VMIN]) { 8005d1c: 41 61 00 47 lbu r1,(r11+71) 8005d20: 41 62 00 46 lbu r2,(r11+70) 8005d24: 44 20 00 05 be r1,r0,8005d38 <== NEVER TAKEN if (tty->termios.c_cc[VTIME] && tty->ccount) { 8005d28: 44 40 00 09 be r2,r0,8005d4c <== NEVER TAKEN 8005d2c: 29 61 00 20 lw r1,(r11+32) 8005d30: 44 20 00 07 be r1,r0,8005d4c 8005d34: e0 00 00 02 bi 8005d3c if ((now - then) > tty->vtimeTicks) { break; } } } else { if (!tty->termios.c_cc[VTIME]) 8005d38: 44 41 00 6e be r2,r1,8005ef0 <== NOT EXECUTED break; now = rtems_clock_get_ticks_since_boot(); 8005d3c: f8 00 03 2a calli 80069e4 if ((now - then) > tty->vtimeTicks) { 8005d40: 29 62 00 54 lw r2,(r11+84) 8005d44: c8 2d 08 00 sub r1,r1,r13 8005d48: 54 22 00 6a bgu r1,r2,8005ef0 break; } } rtems_task_wake_after (1); 8005d4c: 34 01 00 01 mvi r1,1 8005d50: f8 00 06 44 calli 8007660 8005d54: e3 ff ff ee bi 8005d0c } else { siproc (n, tty); 8005d58: b9 60 10 00 mv r2,r11 8005d5c: 20 21 00 ff andi r1,r1,0xff 8005d60: fb ff ff 51 calli 8005aa4 if (tty->ccount >= tty->termios.c_cc[VMIN]) 8005d64: 41 61 00 47 lbu r1,(r11+71) 8005d68: 29 62 00 20 lw r2,(r11+32) 8005d6c: 4c 41 00 61 bge r2,r1,8005ef0 <== NEVER TAKEN break; if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME]) 8005d70: 44 20 ff e7 be r1,r0,8005d0c <== NEVER TAKEN 8005d74: 41 61 00 46 lbu r1,(r11+70) 8005d78: 44 20 ff e5 be r1,r0,8005d0c <== NEVER TAKEN 8005d7c: e3 ff ff e2 bi 8005d04 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && (tty->ccount < (CBUFSIZE-1))) { 8005d80: 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; 8005d84: 29 72 00 74 lw r18,(r11+116) rtems_status_code sc; int wait = (int)1; 8005d88: 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))) { 8005d8c: 3a 10 13 3c ori r16,r16,0x133c 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; 8005d90: 34 16 ff fe mvi r22,-2 /* if tx stopped and XON should be sent... */ if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF)) 8005d94: 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; 8005d98: 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)( 8005d9c: 35 73 00 49 addi r19,r11,73 8005da0: e0 00 00 3e bi 8005e98 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; 8005da4: 29 61 00 5c lw r1,(r11+92) 8005da8: 29 62 00 64 lw r2,(r11+100) 8005dac: 34 21 00 01 addi r1,r1,1 8005db0: f8 00 5e be calli 801d8a8 <__umodsi3> 8005db4: b8 20 18 00 mv r3,r1 c = tty->rawInBuf.theBuf[newHead]; 8005db8: 29 61 00 58 lw r1,(r11+88) 8005dbc: b4 23 08 00 add r1,r1,r3 8005dc0: 40 32 00 00 lbu r18,(r1+0) tty->rawInBuf.Head = newHead; 8005dc4: 59 63 00 5c sw (r11+92),r3 if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size) 8005dc8: 29 61 00 60 lw r1,(r11+96) 8005dcc: 29 64 00 64 lw r4,(r11+100) % tty->rawInBuf.Size) 8005dd0: 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) 8005dd4: b4 81 08 00 add r1,r4,r1 % tty->rawInBuf.Size) 8005dd8: c8 23 08 00 sub r1,r1,r3 8005ddc: f8 00 5e b3 calli 801d8a8 <__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) 8005de0: 29 62 00 bc lw r2,(r11+188) 8005de4: 50 22 00 1c bgeu r1,r2,8005e54 <== NEVER TAKEN % tty->rawInBuf.Size) < tty->lowwater) { tty->flow_ctrl &= ~FL_IREQXOF; 8005de8: 29 61 00 b8 lw r1,(r11+184) 8005dec: a0 36 08 00 and r1,r1,r22 8005df0: 59 61 00 b8 sw (r11+184),r1 /* if tx stopped and XON should be sent... */ if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF)) 8005df4: 29 61 00 b8 lw r1,(r11+184) 8005df8: 20 21 02 02 andi r1,r1,0x202 8005dfc: 5c 35 00 0c bne r1,r21,8005e2c <== ALWAYS TAKEN == (FL_MDXON | FL_ISNTXOF)) && ((tty->rawOutBufState == rob_idle) 8005e00: 29 61 00 94 lw r1,(r11+148) <== NOT EXECUTED 8005e04: 44 20 00 04 be r1,r0,8005e14 <== NOT EXECUTED || (tty->flow_ctrl & FL_OSTOP))) { 8005e08: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8005e0c: 20 21 00 20 andi r1,r1,0x20 <== NOT EXECUTED 8005e10: 44 20 00 07 be r1,r0,8005e2c <== NOT EXECUTED /* XON should be sent now... */ (*tty->device.write)( 8005e14: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED 8005e18: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8005e1c: ba 60 10 00 mv r2,r19 <== NOT EXECUTED 8005e20: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 8005e24: d8 80 00 00 call r4 <== NOT EXECUTED 8005e28: e0 00 00 0b bi 8005e54 <== NOT EXECUTED tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1); } else if (tty->flow_ctrl & FL_MDRTS) { 8005e2c: 29 61 00 b8 lw r1,(r11+184) 8005e30: 20 21 01 00 andi r1,r1,0x100 8005e34: 44 20 00 08 be r1,r0,8005e54 <== ALWAYS TAKEN tty->flow_ctrl &= ~FL_IRTSOFF; 8005e38: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED /* activate RTS line */ if (tty->device.startRemoteTx != NULL) { 8005e3c: 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; 8005e40: a0 34 08 00 and r1,r1,r20 <== NOT EXECUTED 8005e44: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* activate RTS line */ if (tty->device.startRemoteTx != NULL) { 8005e48: 44 60 00 03 be r3,r0,8005e54 <== NOT EXECUTED tty->device.startRemoteTx(tty->minor); 8005e4c: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8005e50: d8 60 00 00 call r3 <== NOT EXECUTED } } } /* continue processing new character */ if (tty->termios.c_lflag & ICANON) { 8005e54: 29 61 00 3c lw r1,(r11+60) 8005e58: 20 21 00 02 andi r1,r1,0x2 8005e5c: 44 20 00 06 be r1,r0,8005e74 <== NEVER TAKEN if (siproc (c, tty)) 8005e60: ba 40 08 00 mv r1,r18 8005e64: b9 60 10 00 mv r2,r11 8005e68: fb ff ff 0f calli 8005aa4 wait = 0; 8005e6c: 64 21 00 00 cmpei r1,r1,0 8005e70: e0 00 00 07 bi 8005e8c } else { siproc (c, tty); 8005e74: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8005e78: ba 40 08 00 mv r1,r18 <== NOT EXECUTED 8005e7c: fb ff ff 0a calli 8005aa4 <== NOT EXECUTED if (tty->ccount >= tty->termios.c_cc[VMIN]) 8005e80: 41 61 00 47 lbu r1,(r11+71) <== NOT EXECUTED 8005e84: 29 62 00 20 lw r2,(r11+32) <== NOT EXECUTED wait = 0; 8005e88: e8 22 08 00 cmpg r1,r1,r2 <== NOT EXECUTED } timeout = tty->rawInBufSemaphoreTimeout; 8005e8c: 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; 8005e90: c8 01 08 00 sub r1,r0,r1 8005e94: a1 a1 68 00 and r13,r13,r1 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 8005e98: 29 62 00 5c lw r2,(r11+92) 8005e9c: 29 61 00 60 lw r1,(r11+96) 8005ea0: 44 41 00 05 be r2,r1,8005eb4 (tty->ccount < (CBUFSIZE-1))) { 8005ea4: 2a 01 00 00 lw r1,(r16+0) while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 8005ea8: 29 62 00 20 lw r2,(r11+32) (tty->ccount < (CBUFSIZE-1))) { 8005eac: 34 21 ff ff addi r1,r1,-1 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 8005eb0: 48 22 ff bd bg r1,r2,8005da4 <== ALWAYS TAKEN } /* * Wait for characters */ if ( wait ) { 8005eb4: 45 a0 00 0f be r13,r0,8005ef0 sc = rtems_semaphore_obtain( 8005eb8: 29 61 00 68 lw r1,(r11+104) 8005ebc: 29 62 00 6c lw r2,(r11+108) 8005ec0: ba 40 18 00 mv r3,r18 8005ec4: f8 00 04 91 calli 8007108 tty->rawInBuf.Semaphore, tty->rawInBufSemaphoreOptions, timeout); if (sc != RTEMS_SUCCESSFUL) 8005ec8: 44 20 ff f4 be r1,r0,8005e98 <== ALWAYS TAKEN 8005ecc: e0 00 00 09 bi 8005ef0 <== NOT EXECUTED if (sc != RTEMS_SUCCESSFUL) tty->cindex = tty->ccount = 0; } while (count && (tty->cindex < tty->ccount)) { *buffer++ = tty->cbuf[tty->cindex++]; 8005ed0: 29 62 00 1c lw r2,(r11+28) count--; 8005ed4: 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++]; 8005ed8: b4 41 10 00 add r2,r2,r1 8005edc: 40 42 00 00 lbu r2,(r2+0) 8005ee0: 34 21 00 01 addi r1,r1,1 8005ee4: 32 22 00 00 sb (r17+0),r2 8005ee8: 59 61 00 24 sw (r11+36),r1 8005eec: 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)) { 8005ef0: 45 e0 00 04 be r15,r0,8005f00 8005ef4: 29 61 00 24 lw r1,(r11+36) 8005ef8: 29 62 00 20 lw r2,(r11+32) 8005efc: 48 41 ff f5 bg r2,r1,8005ed0 *buffer++ = tty->cbuf[tty->cindex++]; count--; } args->bytes_moved = args->count - count; 8005f00: 29 81 00 14 lw r1,(r12+20) 8005f04: c8 2f 78 00 sub r15,r1,r15 8005f08: 59 8f 00 1c sw (r12+28),r15 tty->tty_rcvwakeup = 0; rtems_semaphore_release (tty->isem); 8005f0c: 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; 8005f10: 59 60 00 e4 sw (r11+228),r0 rtems_semaphore_release (tty->isem); 8005f14: f8 00 04 cd calli 8007248 return sc; } 8005f18: b9 c0 08 00 mv r1,r14 8005f1c: 2b 9d 00 04 lw ra,(sp+4) 8005f20: 2b 8b 00 34 lw r11,(sp+52) 8005f24: 2b 8c 00 30 lw r12,(sp+48) 8005f28: 2b 8d 00 2c lw r13,(sp+44) 8005f2c: 2b 8e 00 28 lw r14,(sp+40) 8005f30: 2b 8f 00 24 lw r15,(sp+36) 8005f34: 2b 90 00 20 lw r16,(sp+32) 8005f38: 2b 91 00 1c lw r17,(sp+28) 8005f3c: 2b 92 00 18 lw r18,(sp+24) 8005f40: 2b 93 00 14 lw r19,(sp+20) 8005f44: 2b 94 00 10 lw r20,(sp+16) 8005f48: 2b 95 00 0c lw r21,(sp+12) 8005f4c: 2b 96 00 08 lw r22,(sp+8) 8005f50: 37 9c 00 34 addi sp,sp,52 8005f54: c3 a0 00 00 ret =============================================================================== 08006318 : * 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) { 8006318: 37 9c ff f0 addi sp,sp,-16 800631c: 5b 8b 00 10 sw (sp+16),r11 8006320: 5b 8c 00 0c sw (sp+12),r12 8006324: 5b 8d 00 08 sw (sp+8),r13 8006328: 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)) 800632c: 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) { 8006330: 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)) 8006334: 34 01 04 01 mvi r1,1025 8006338: 20 42 04 03 andi r2,r2,0x403 800633c: 5c 41 00 12 bne r2,r1,8006384 <== ALWAYS TAKEN == (FL_MDXOF | FL_IREQXOF)) { /* XOFF should be sent now... */ (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1); 8006340: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED 8006344: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8006348: 35 62 00 4a addi r2,r11,74 <== NOT EXECUTED 800634c: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 8006350: d8 80 00 00 call r4 <== NOT EXECUTED rtems_interrupt_disable(level); 8006354: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED 8006358: 34 02 ff fe mvi r2,-2 <== NOT EXECUTED 800635c: a0 22 10 00 and r2,r1,r2 <== NOT EXECUTED 8006360: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED tty->t_dqlen--; 8006364: 29 62 00 90 lw r2,(r11+144) <== NOT EXECUTED 8006368: 34 42 ff ff addi r2,r2,-1 <== NOT EXECUTED 800636c: 59 62 00 90 sw (r11+144),r2 <== NOT EXECUTED tty->flow_ctrl |= FL_ISNTXOF; 8006370: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 8006374: 38 42 00 02 ori r2,r2,0x2 <== NOT EXECUTED 8006378: 59 62 00 b8 sw (r11+184),r2 <== NOT EXECUTED rtems_interrupt_enable(level); 800637c: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED 8006380: e0 00 00 16 bi 80063d8 <== NOT EXECUTED nToSend = 1; } else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) { 8006384: 29 62 00 b8 lw r2,(r11+184) 8006388: 34 01 00 02 mvi r1,2 800638c: 20 42 00 03 andi r2,r2,0x3 8006390: 5c 41 00 14 bne r2,r1,80063e0 <== 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); 8006394: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED 8006398: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 800639c: 35 62 00 49 addi r2,r11,73 <== NOT EXECUTED 80063a0: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 80063a4: d8 80 00 00 call r4 <== NOT EXECUTED rtems_interrupt_disable(level); 80063a8: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED 80063ac: 34 02 ff fe mvi r2,-2 <== NOT EXECUTED 80063b0: a0 22 10 00 and r2,r1,r2 <== NOT EXECUTED 80063b4: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED tty->t_dqlen--; 80063b8: 29 62 00 90 lw r2,(r11+144) <== NOT EXECUTED tty->flow_ctrl &= ~FL_ISNTXOF; 80063bc: 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--; 80063c0: 34 42 ff ff addi r2,r2,-1 <== NOT EXECUTED 80063c4: 59 62 00 90 sw (r11+144),r2 <== NOT EXECUTED tty->flow_ctrl &= ~FL_ISNTXOF; 80063c8: 34 02 ff fd mvi r2,-3 <== NOT EXECUTED 80063cc: a0 62 10 00 and r2,r3,r2 <== NOT EXECUTED 80063d0: 59 62 00 b8 sw (r11+184),r2 <== NOT EXECUTED rtems_interrupt_enable(level); 80063d4: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED nToSend = 1; 80063d8: 34 0c 00 01 mvi r12,1 <== NOT EXECUTED 80063dc: e0 00 00 49 bi 8006500 <== NOT EXECUTED } else { if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) { 80063e0: 29 63 00 80 lw r3,(r11+128) 80063e4: 29 62 00 84 lw r2,(r11+132) 80063e8: 5c 62 00 07 bne r3,r2,8006404 /* * buffer was empty */ if (tty->rawOutBufState == rob_wait) { 80063ec: 29 62 00 94 lw r2,(r11+148) /* * this should never happen... */ rtems_semaphore_release (tty->rawOutBuf.Semaphore); } return 0; 80063f0: 34 0c 00 00 mvi r12,0 } else { if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) { /* * buffer was empty */ if (tty->rawOutBufState == rob_wait) { 80063f4: 5c 41 00 43 bne r2,r1,8006500 /* * this should never happen... */ rtems_semaphore_release (tty->rawOutBuf.Semaphore); 80063f8: 29 61 00 8c lw r1,(r11+140) <== NOT EXECUTED 80063fc: f8 00 03 93 calli 8007248 <== NOT EXECUTED 8006400: e0 00 00 40 bi 8006500 <== NOT EXECUTED } return 0; } rtems_interrupt_disable(level); 8006404: 90 00 10 00 rcsr r2,IE 8006408: 34 01 ff fe mvi r1,-2 800640c: a0 41 08 00 and r1,r2,r1 8006410: d0 01 00 00 wcsr IE,r1 len = tty->t_dqlen; 8006414: 29 63 00 90 lw r3,(r11+144) tty->t_dqlen = 0; 8006418: 59 60 00 90 sw (r11+144),r0 rtems_interrupt_enable(level); 800641c: d0 02 00 00 wcsr IE,r2 newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size; 8006420: 29 61 00 84 lw r1,(r11+132) 8006424: 29 62 00 88 lw r2,(r11+136) 8006428: b4 61 08 00 add r1,r3,r1 800642c: f8 00 5d 1f calli 801d8a8 <__umodsi3> tty->rawOutBuf.Tail = newTail; if (tty->rawOutBufState == rob_wait) { 8006430: 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; 8006434: b8 20 68 00 mv r13,r1 tty->rawOutBuf.Tail = newTail; 8006438: 59 61 00 84 sw (r11+132),r1 if (tty->rawOutBufState == rob_wait) { 800643c: 34 01 00 02 mvi r1,2 8006440: 5c 41 00 03 bne r2,r1,800644c /* * wake up any pending writer task */ rtems_semaphore_release (tty->rawOutBuf.Semaphore); 8006444: 29 61 00 8c lw r1,(r11+140) 8006448: f8 00 03 80 calli 8007248 } if (newTail == tty->rawOutBuf.Head) { 800644c: 29 61 00 80 lw r1,(r11+128) 8006450: 5d a1 00 09 bne r13,r1,8006474 nToSend = 0; /* * check to see if snd wakeup callback was set */ if ( tty->tty_snd.sw_pfn != NULL) { 8006454: 29 63 00 d4 lw r3,(r11+212) if (newTail == tty->rawOutBuf.Head) { /* * Buffer has become empty */ tty->rawOutBufState = rob_idle; 8006458: 59 60 00 94 sw (r11+148),r0 nToSend = 0; 800645c: 34 0c 00 00 mvi r12,0 /* * check to see if snd wakeup callback was set */ if ( tty->tty_snd.sw_pfn != NULL) { 8006460: 44 60 00 27 be r3,r0,80064fc <== ALWAYS TAKEN (*tty->tty_snd.sw_pfn)(&tty->termios, tty->tty_snd.sw_arg); 8006464: 29 62 00 d8 lw r2,(r11+216) <== NOT EXECUTED 8006468: 35 61 00 30 addi r1,r11,48 <== NOT EXECUTED 800646c: d8 60 00 00 call r3 <== NOT EXECUTED 8006470: e0 00 00 23 bi 80064fc <== NOT EXECUTED } } /* check, whether output should stop due to received XOFF */ else if ((tty->flow_ctrl & (FL_MDXON | FL_ORCVXOF)) 8006474: 29 62 00 b8 lw r2,(r11+184) 8006478: 34 01 02 10 mvi r1,528 800647c: 20 42 02 10 andi r2,r2,0x210 8006480: 5c 41 00 0d bne r2,r1,80064b4 <== 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); 8006484: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED 8006488: 34 02 ff fe mvi r2,-2 <== NOT EXECUTED 800648c: a0 22 10 00 and r2,r1,r2 <== NOT EXECUTED 8006490: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED tty->flow_ctrl |= FL_OSTOP; 8006494: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 8006498: 38 42 00 20 ori r2,r2,0x20 <== NOT EXECUTED 800649c: 59 62 00 b8 sw (r11+184),r2 <== NOT EXECUTED tty->rawOutBufState = rob_busy; /*apm*/ 80064a0: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 80064a4: 59 62 00 94 sw (r11+148),r2 <== NOT EXECUTED rtems_interrupt_enable(level); 80064a8: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED nToSend = 0; 80064ac: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED 80064b0: e0 00 00 13 bi 80064fc <== NOT EXECUTED } else { /* * Buffer not empty, start tranmitter */ if (newTail > tty->rawOutBuf.Head) 80064b4: 29 61 00 80 lw r1,(r11+128) 80064b8: 50 2d 00 03 bgeu r1,r13,80064c4 nToSend = tty->rawOutBuf.Size - newTail; 80064bc: 29 6c 00 88 lw r12,(r11+136) 80064c0: e0 00 00 02 bi 80064c8 else nToSend = tty->rawOutBuf.Head - newTail; 80064c4: 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)) { 80064c8: 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; 80064cc: 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)) { 80064d0: 20 21 06 00 andi r1,r1,0x600 80064d4: 44 20 00 02 be r1,r0,80064dc nToSend = 1; 80064d8: 34 0c 00 01 mvi r12,1 } tty->rawOutBufState = rob_busy; /*apm*/ 80064dc: 34 01 00 01 mvi r1,1 (*tty->device.write)( 80064e0: 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*/ 80064e4: 59 61 00 94 sw (r11+148),r1 (*tty->device.write)( 80064e8: 29 64 00 a4 lw r4,(r11+164) 80064ec: 29 61 00 10 lw r1,(r11+16) 80064f0: b4 4d 10 00 add r2,r2,r13 80064f4: b9 80 18 00 mv r3,r12 80064f8: d8 80 00 00 call r4 tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend); } tty->rawOutBuf.Tail = newTail; /*apm*/ 80064fc: 59 6d 00 84 sw (r11+132),r13 } return nToSend; } 8006500: b9 80 08 00 mv r1,r12 8006504: 2b 9d 00 04 lw ra,(sp+4) 8006508: 2b 8b 00 10 lw r11,(sp+16) 800650c: 2b 8c 00 0c lw r12,(sp+12) 8006510: 2b 8d 00 08 lw r13,(sp+8) 8006514: 37 9c 00 10 addi sp,sp,16 8006518: c3 a0 00 00 ret =============================================================================== 0800629c : /* * this task actually processes any receive events */ static rtems_task rtems_termios_rxdaemon(rtems_task_argument argument) { 800629c: 37 9c ff e4 addi sp,sp,-28 80062a0: 5b 8b 00 14 sw (sp+20),r11 80062a4: 5b 8c 00 10 sw (sp+16),r12 80062a8: 5b 8d 00 0c sw (sp+12),r13 80062ac: 5b 8e 00 08 sw (sp+8),r14 80062b0: 5b 9d 00 04 sw (sp+4),ra /* * do something */ c = tty->device.pollRead(tty->minor); if (c != EOF) { 80062b4: 34 0d ff ff mvi r13,-1 /* * this task actually processes any receive events */ static rtems_task rtems_termios_rxdaemon(rtems_task_argument argument) { 80062b8: b8 20 58 00 mv r11,r1 while (1) { /* * wait for rtems event */ rtems_event_receive( 80062bc: 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); 80062c0: 37 8c 00 1f addi r12,sp,31 while (1) { /* * wait for rtems event */ rtems_event_receive( 80062c4: 34 01 00 03 mvi r1,3 80062c8: 34 02 00 02 mvi r2,2 80062cc: 34 03 00 00 mvi r3,0 80062d0: b9 c0 20 00 mv r4,r14 80062d4: f8 00 01 dd calli 8006a48 (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) { 80062d8: 2b 81 00 18 lw r1,(sp+24) 80062dc: 20 21 00 01 andi r1,r1,0x1 80062e0: 44 20 00 04 be r1,r0,80062f0 <== ALWAYS TAKEN tty->rxTaskId = 0; 80062e4: 59 60 00 c4 sw (r11+196),r0 <== NOT EXECUTED rtems_task_delete(RTEMS_SELF); 80062e8: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 80062ec: f8 00 04 6c calli 800749c <== NOT EXECUTED } /* * do something */ c = tty->device.pollRead(tty->minor); 80062f0: 29 62 00 a0 lw r2,(r11+160) 80062f4: 29 61 00 10 lw r1,(r11+16) 80062f8: d8 40 00 00 call r2 if (c != EOF) { 80062fc: 44 2d ff f2 be r1,r13,80062c4 /* * pollRead did call enqueue on its own */ c_buf = c; 8006300: 33 81 00 1f sb (sp+31),r1 rtems_termios_enqueue_raw_characters ( tty,&c_buf,1); 8006304: b9 80 10 00 mv r2,r12 8006308: b9 60 08 00 mv r1,r11 800630c: 34 03 00 01 mvi r3,1 8006310: fb ff ff 1a calli 8005f78 8006314: e3 ff ff ec bi 80062c4 =============================================================================== 0800651c : /* * this task actually processes any transmit events */ static rtems_task rtems_termios_txdaemon(rtems_task_argument argument) { 800651c: 37 9c ff f0 addi sp,sp,-16 8006520: 5b 8b 00 0c sw (sp+12),r11 8006524: 5b 8c 00 08 sw (sp+8),r12 8006528: 5b 9d 00 04 sw (sp+4),ra } /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 800652c: 78 0c 08 02 mvhi r12,0x802 /* * this task actually processes any transmit events */ static rtems_task rtems_termios_txdaemon(rtems_task_argument argument) { 8006530: b8 20 58 00 mv r11,r1 } /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 8006534: 39 8c 18 88 ori r12,r12,0x1888 while (1) { /* * wait for rtems event */ rtems_event_receive( 8006538: 34 01 00 03 mvi r1,3 800653c: 34 02 00 02 mvi r2,2 8006540: 34 03 00 00 mvi r3,0 8006544: 37 84 00 10 addi r4,sp,16 8006548: f8 00 01 40 calli 8006a48 (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) { 800654c: 2b 81 00 10 lw r1,(sp+16) 8006550: 20 21 00 01 andi r1,r1,0x1 8006554: 44 20 00 04 be r1,r0,8006564 <== ALWAYS TAKEN tty->txTaskId = 0; 8006558: 59 60 00 c8 sw (r11+200),r0 <== NOT EXECUTED rtems_task_delete(RTEMS_SELF); 800655c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8006560: f8 00 03 cf calli 800749c <== NOT EXECUTED } /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 8006564: 29 61 00 cc lw r1,(r11+204) 8006568: 34 02 00 05 mvi r2,5 800656c: fb ff ed 8c calli 8001b9c <__ashlsi3> 8006570: b5 81 08 00 add r1,r12,r1 8006574: 28 22 00 14 lw r2,(r1+20) 8006578: 44 40 00 03 be r2,r0,8006584 <== ALWAYS TAKEN rtems_termios_linesw[tty->t_line].l_start(tty); 800657c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8006580: d8 40 00 00 call r2 <== NOT EXECUTED } /* * try to push further characters to device */ rtems_termios_refill_transmitter(tty); 8006584: b9 60 08 00 mv r1,r11 8006588: fb ff ff 64 calli 8006318 } 800658c: e3 ff ff eb bi 8006538 =============================================================================== 08005b18 : rtems_termios_puts (&c, 1, tty); } rtems_status_code rtems_termios_write (void *arg) { 8005b18: 37 9c ff e8 addi sp,sp,-24 8005b1c: 5b 8b 00 18 sw (sp+24),r11 8005b20: 5b 8c 00 14 sw (sp+20),r12 8005b24: 5b 8d 00 10 sw (sp+16),r13 8005b28: 5b 8e 00 0c sw (sp+12),r14 8005b2c: 5b 8f 00 08 sw (sp+8),r15 8005b30: 5b 9d 00 04 sw (sp+4),ra 8005b34: b8 20 58 00 mv r11,r1 rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8005b38: 28 21 00 00 lw r1,(r1+0) rtems_status_code sc; sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8005b3c: 34 02 00 00 mvi r2,0 8005b40: 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; 8005b44: 28 2c 00 38 lw r12,(r1+56) rtems_status_code sc; sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8005b48: 29 81 00 18 lw r1,(r12+24) 8005b4c: f8 00 05 6f calli 8007108 8005b50: b8 20 68 00 mv r13,r1 if (sc != RTEMS_SUCCESSFUL) 8005b54: 5c 20 00 23 bne r1,r0,8005be0 <== NEVER TAKEN return sc; if (rtems_termios_linesw[tty->t_line].l_write != NULL) { 8005b58: 29 81 00 cc lw r1,(r12+204) 8005b5c: 78 0e 08 02 mvhi r14,0x802 8005b60: 34 02 00 05 mvi r2,5 8005b64: fb ff f0 0e calli 8001b9c <__ashlsi3> 8005b68: 39 ce 18 88 ori r14,r14,0x1888 8005b6c: b5 c1 08 00 add r1,r14,r1 8005b70: 28 23 00 0c lw r3,(r1+12) 8005b74: 44 6d 00 06 be r3,r13,8005b8c sc = rtems_termios_linesw[tty->t_line].l_write(tty,args); 8005b78: b9 80 08 00 mv r1,r12 8005b7c: b9 60 10 00 mv r2,r11 8005b80: d8 60 00 00 call r3 8005b84: b8 20 68 00 mv r13,r1 8005b88: e0 00 00 14 bi 8005bd8 rtems_semaphore_release (tty->osem); return sc; } if (tty->termios.c_oflag & OPOST) { 8005b8c: 29 83 00 34 lw r3,(r12+52) 8005b90: 29 62 00 14 lw r2,(r11+20) 8005b94: 29 61 00 10 lw r1,(r11+16) 8005b98: 20 63 00 01 andi r3,r3,0x1 uint32_t count = args->count; 8005b9c: b8 40 78 00 mv r15,r2 char *buffer = args->buffer; 8005ba0: 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) { 8005ba4: 5c 60 00 07 bne r3,r0,8005bc0 <== ALWAYS TAKEN 8005ba8: e0 00 00 08 bi 8005bc8 <== NOT EXECUTED uint32_t count = args->count; char *buffer = args->buffer; while (count--) oproc (*buffer++, tty); 8005bac: 41 c1 00 00 lbu r1,(r14+0) 8005bb0: b9 80 10 00 mv r2,r12 8005bb4: 35 ce 00 01 addi r14,r14,1 8005bb8: fb ff fe 4b calli 80054e4 8005bbc: 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--) 8005bc0: 5d e0 ff fb bne r15,r0,8005bac 8005bc4: e0 00 00 03 bi 8005bd0 oproc (*buffer++, tty); args->bytes_moved = args->count; } else { rtems_termios_puts (args->buffer, args->count, tty); 8005bc8: b9 80 18 00 mv r3,r12 <== NOT EXECUTED 8005bcc: fb ff fd f0 calli 800538c <== NOT EXECUTED args->bytes_moved = args->count; 8005bd0: 29 61 00 14 lw r1,(r11+20) 8005bd4: 59 61 00 1c sw (r11+28),r1 } rtems_semaphore_release (tty->osem); 8005bd8: 29 81 00 18 lw r1,(r12+24) 8005bdc: f8 00 05 9b calli 8007248 return sc; } 8005be0: b9 a0 08 00 mv r1,r13 8005be4: 2b 9d 00 04 lw ra,(sp+4) 8005be8: 2b 8b 00 18 lw r11,(sp+24) 8005bec: 2b 8c 00 14 lw r12,(sp+20) 8005bf0: 2b 8d 00 10 lw r13,(sp+16) 8005bf4: 2b 8e 00 0c lw r14,(sp+12) 8005bf8: 2b 8f 00 08 lw r15,(sp+8) 8005bfc: 37 9c 00 18 addi sp,sp,24 8005c00: c3 a0 00 00 ret =============================================================================== 08013e68 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 8013e68: 37 9c ff f8 addi sp,sp,-8 8013e6c: 5b 9d 00 04 sw (sp+4),ra 8013e70: b8 20 10 00 mv r2,r1 Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) _Objects_Get( &_Timer_Information, id, location ); 8013e74: 78 01 08 03 mvhi r1,0x803 8013e78: 38 21 ee 68 ori r1,r1,0xee68 8013e7c: 37 83 00 08 addi r3,sp,8 8013e80: f8 00 0e 51 calli 80177c4 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 8013e84: 2b 82 00 08 lw r2,(sp+8) 8013e88: 5c 40 00 09 bne r2,r0,8013eac case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 8013e8c: 28 23 00 38 lw r3,(r1+56) 8013e90: 34 02 00 04 mvi r2,4 8013e94: 44 62 00 03 be r3,r2,8013ea0 <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 8013e98: 34 21 00 10 addi r1,r1,16 8013e9c: f8 00 18 08 calli 8019ebc <_Watchdog_Remove> _Thread_Enable_dispatch(); 8013ea0: f8 00 11 06 calli 80182b8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8013ea4: 34 01 00 00 mvi r1,0 8013ea8: e0 00 00 02 bi 8013eb0 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 8013eac: 34 01 00 04 mvi r1,4 } 8013eb0: 2b 9d 00 04 lw ra,(sp+4) 8013eb4: 37 9c 00 08 addi sp,sp,8 8013eb8: c3 a0 00 00 ret =============================================================================== 08014484 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 8014484: 37 9c ff dc addi sp,sp,-36 8014488: 5b 8b 00 20 sw (sp+32),r11 801448c: 5b 8c 00 1c sw (sp+28),r12 8014490: 5b 8d 00 18 sw (sp+24),r13 8014494: 5b 8e 00 14 sw (sp+20),r14 8014498: 5b 8f 00 10 sw (sp+16),r15 801449c: 5b 90 00 0c sw (sp+12),r16 80144a0: 5b 91 00 08 sw (sp+8),r17 80144a4: 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; 80144a8: 78 05 08 03 mvhi r5,0x803 80144ac: 38 a5 ee a8 ori r5,r5,0xeea8 80144b0: 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 ) { 80144b4: b8 20 78 00 mv r15,r1 80144b8: b8 40 60 00 mv r12,r2 80144bc: b8 60 80 00 mv r16,r3 80144c0: 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; 80144c4: 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 ) 80144c8: 45 a0 00 2e be r13,r0,8014580 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 80144cc: 78 05 08 03 mvhi r5,0x803 80144d0: 38 a5 ec 3c ori r5,r5,0xec3c 80144d4: 40 a1 00 00 lbu r1,(r5+0) return RTEMS_NOT_DEFINED; 80144d8: 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 ) 80144dc: 44 20 00 29 be r1,r0,8014580 <== NEVER TAKEN return RTEMS_NOT_DEFINED; if ( !routine ) return RTEMS_INVALID_ADDRESS; 80144e0: 34 0b 00 09 mvi r11,9 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; if ( !routine ) 80144e4: 44 60 00 27 be r3,r0,8014580 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 80144e8: b8 40 08 00 mv r1,r2 80144ec: fb ff f1 c4 calli 8010bfc <_TOD_Validate> return RTEMS_INVALID_CLOCK; 80144f0: 34 0b 00 14 mvi r11,20 return RTEMS_NOT_DEFINED; if ( !routine ) return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 80144f4: 44 20 00 23 be r1,r0,8014580 return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 80144f8: b9 80 08 00 mv r1,r12 if ( seconds <= _TOD_Seconds_since_epoch() ) 80144fc: 78 0c 08 03 mvhi r12,0x803 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 8014500: fb ff f1 7f calli 8010afc <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 8014504: 39 8c ec b4 ori r12,r12,0xecb4 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 8014508: b8 20 70 00 mv r14,r1 if ( seconds <= _TOD_Seconds_since_epoch() ) 801450c: 29 81 00 00 lw r1,(r12+0) 8014510: 50 2e 00 1c bgeu r1,r14,8014580 8014514: 78 01 08 03 mvhi r1,0x803 8014518: 38 21 ee 68 ori r1,r1,0xee68 801451c: b9 e0 10 00 mv r2,r15 8014520: 37 83 00 24 addi r3,sp,36 8014524: f8 00 0c a8 calli 80177c4 <_Objects_Get> 8014528: b8 20 58 00 mv r11,r1 return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 801452c: 2b 81 00 24 lw r1,(sp+36) 8014530: 5c 20 00 13 bne r1,r0,801457c case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 8014534: 35 61 00 10 addi r1,r11,16 8014538: f8 00 16 61 calli 8019ebc <_Watchdog_Remove> the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 801453c: 34 01 00 03 mvi r1,3 8014540: 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(); 8014544: 29 81 00 00 lw r1,(r12+0) (*timer_server->schedule_operation)( timer_server, the_timer ); 8014548: 29 a3 00 04 lw r3,(r13+4) 801454c: 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(); 8014550: c9 c1 70 00 sub r14,r14,r1 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8014554: 59 60 00 18 sw (r11+24),r0 the_watchdog->routine = routine; 8014558: 59 70 00 2c sw (r11+44),r16 the_watchdog->id = id; 801455c: 59 6f 00 30 sw (r11+48),r15 the_watchdog->user_data = user_data; 8014560: 59 71 00 34 sw (r11+52),r17 8014564: 59 6e 00 1c sw (r11+28),r14 (*timer_server->schedule_operation)( timer_server, the_timer ); 8014568: b9 a0 08 00 mv r1,r13 801456c: d8 60 00 00 call r3 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 8014570: 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(); 8014574: f8 00 0f 51 calli 80182b8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8014578: e0 00 00 02 bi 8014580 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 801457c: 34 0b 00 04 mvi r11,4 } 8014580: b9 60 08 00 mv r1,r11 8014584: 2b 9d 00 04 lw ra,(sp+4) 8014588: 2b 8b 00 20 lw r11,(sp+32) 801458c: 2b 8c 00 1c lw r12,(sp+28) 8014590: 2b 8d 00 18 lw r13,(sp+24) 8014594: 2b 8e 00 14 lw r14,(sp+20) 8014598: 2b 8f 00 10 lw r15,(sp+16) 801459c: 2b 90 00 0c lw r16,(sp+12) 80145a0: 2b 91 00 08 lw r17,(sp+8) 80145a4: 37 9c 00 24 addi sp,sp,36 80145a8: c3 a0 00 00 ret =============================================================================== 080069f4 : static int rtems_verror( rtems_error_code_t error_flag, const char *printf_format, va_list arglist ) { 80069f4: 37 9c ff e4 addi sp,sp,-28 80069f8: 5b 8b 00 1c sw (sp+28),r11 80069fc: 5b 8c 00 18 sw (sp+24),r12 8006a00: 5b 8d 00 14 sw (sp+20),r13 8006a04: 5b 8e 00 10 sw (sp+16),r14 8006a08: 5b 8f 00 0c sw (sp+12),r15 8006a0c: 5b 90 00 08 sw (sp+8),r16 8006a10: 5b 9d 00 04 sw (sp+4),ra 8006a14: 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) { 8006a18: 78 01 20 00 mvhi r1,0x2000 8006a1c: 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 ) { 8006a20: b8 40 80 00 mv r16,r2 8006a24: 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) { 8006a28: 44 20 00 12 be r1,r0,8006a70 if (rtems_panic_in_progress++) 8006a2c: 78 04 08 02 mvhi r4,0x802 8006a30: 38 84 78 1c ori r4,r4,0x781c 8006a34: 28 81 00 00 lw r1,(r4+0) 8006a38: 34 22 00 01 addi r2,r1,1 8006a3c: 58 82 00 00 sw (r4+0),r2 8006a40: 44 20 00 06 be r1,r0,8006a58 <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8006a44: 78 04 08 02 mvhi r4,0x802 <== NOT EXECUTED 8006a48: 38 84 79 9c ori r4,r4,0x799c <== NOT EXECUTED 8006a4c: 28 81 00 00 lw r1,(r4+0) <== NOT EXECUTED 8006a50: 34 21 00 01 addi r1,r1,1 <== NOT EXECUTED 8006a54: 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) 8006a58: 78 01 08 02 mvhi r1,0x802 8006a5c: 38 21 78 1c ori r1,r1,0x781c 8006a60: 28 22 00 00 lw r2,(r1+0) 8006a64: 34 01 00 02 mvi r1,2 return 0; 8006a68: 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) 8006a6c: 48 41 00 48 bg r2,r1,8006b8c <== NEVER TAKEN return 0; } (void) fflush(stdout); /* in case stdout/stderr same */ 8006a70: 78 01 08 02 mvhi r1,0x802 8006a74: 38 21 71 e8 ori r1,r1,0x71e8 8006a78: 28 21 00 00 lw r1,(r1+0) 8006a7c: 28 21 00 08 lw r1,(r1+8) 8006a80: f8 00 2d 92 calli 80120c8 status = error_flag & ~RTEMS_ERROR_MASK; 8006a84: 78 01 08 02 mvhi r1,0x802 8006a88: 38 21 4e 28 ori r1,r1,0x4e28 8006a8c: 28 2e 00 00 lw r14,(r1+0) if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */ 8006a90: 78 01 40 00 mvhi r1,0x4000 8006a94: a1 81 08 00 and r1,r12,r1 return 0; } (void) fflush(stdout); /* in case stdout/stderr same */ status = error_flag & ~RTEMS_ERROR_MASK; 8006a98: 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; 8006a9c: 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? */ 8006aa0: 44 20 00 03 be r1,r0,8006aac local_errno = errno; 8006aa4: f8 00 2c 88 calli 8011cc4 <__errno> 8006aa8: 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); 8006aac: 78 0d 08 02 mvhi r13,0x802 8006ab0: 39 ad 71 e8 ori r13,r13,0x71e8 8006ab4: 29 a1 00 00 lw r1,(r13+0) 8006ab8: ba 00 10 00 mv r2,r16 8006abc: b9 e0 18 00 mv r3,r15 8006ac0: 28 21 00 0c lw r1,(r1+12) 8006ac4: f8 00 44 36 calli 8017b9c 8006ac8: b8 20 58 00 mv r11,r1 if (status) 8006acc: 45 c0 00 0b be r14,r0,8006af8 chars_written += fprintf(stderr, " (status: %s)", rtems_status_text(status)); 8006ad0: 29 a1 00 00 lw r1,(r13+0) 8006ad4: 28 2d 00 0c lw r13,(r1+12) 8006ad8: b9 c0 08 00 mv r1,r14 8006adc: fb ff ff bd calli 80069d0 8006ae0: 78 02 08 02 mvhi r2,0x802 8006ae4: b8 20 18 00 mv r3,r1 8006ae8: 38 42 4a e4 ori r2,r2,0x4ae4 8006aec: b9 a0 08 00 mv r1,r13 8006af0: f8 00 2e ae calli 80125a8 #endif chars_written += vfprintf(stderr, printf_format, arglist); if (status) chars_written += 8006af4: b5 61 58 00 add r11,r11,r1 fprintf(stderr, " (status: %s)", rtems_status_text(status)); if (local_errno) { 8006af8: 45 80 00 1a be r12,r0,8006b60 if ((local_errno > 0) && *strerror(local_errno)) 8006afc: 4c 0c 00 10 bge r0,r12,8006b3c 8006b00: b9 80 08 00 mv r1,r12 8006b04: f8 00 32 49 calli 8013428 8006b08: 40 21 00 00 lbu r1,(r1+0) 8006b0c: 44 20 00 0c be r1,r0,8006b3c <== NEVER TAKEN chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno)); 8006b10: 78 01 08 02 mvhi r1,0x802 8006b14: 38 21 71 e8 ori r1,r1,0x71e8 8006b18: 28 21 00 00 lw r1,(r1+0) 8006b1c: 28 2d 00 0c lw r13,(r1+12) 8006b20: b9 80 08 00 mv r1,r12 8006b24: f8 00 32 41 calli 8013428 8006b28: 78 02 08 02 mvhi r2,0x802 8006b2c: b8 20 18 00 mv r3,r1 8006b30: 38 42 4a f4 ori r2,r2,0x4af4 8006b34: b9 a0 08 00 mv r1,r13 8006b38: e0 00 00 08 bi 8006b58 else chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno); 8006b3c: 78 01 08 02 mvhi r1,0x802 8006b40: 38 21 71 e8 ori r1,r1,0x71e8 8006b44: 28 21 00 00 lw r1,(r1+0) 8006b48: 78 02 08 02 mvhi r2,0x802 8006b4c: 38 42 4b 04 ori r2,r2,0x4b04 8006b50: 28 21 00 0c lw r1,(r1+12) 8006b54: b9 80 18 00 mv r3,r12 8006b58: f8 00 2e 94 calli 80125a8 8006b5c: b5 61 58 00 add r11,r11,r1 } chars_written += fprintf(stderr, "\n"); 8006b60: 78 0c 08 02 mvhi r12,0x802 8006b64: 39 8c 71 e8 ori r12,r12,0x71e8 8006b68: 29 81 00 00 lw r1,(r12+0) 8006b6c: 78 02 08 02 mvhi r2,0x802 8006b70: 38 42 42 58 ori r2,r2,0x4258 8006b74: 28 21 00 0c lw r1,(r1+12) 8006b78: f8 00 2e 8c calli 80125a8 8006b7c: b4 2b 58 00 add r11,r1,r11 (void) fflush(stderr); 8006b80: 29 81 00 00 lw r1,(r12+0) 8006b84: 28 21 00 0c lw r1,(r1+12) 8006b88: f8 00 2d 50 calli 80120c8 return chars_written; } 8006b8c: b9 60 08 00 mv r1,r11 8006b90: 2b 9d 00 04 lw ra,(sp+4) 8006b94: 2b 8b 00 1c lw r11,(sp+28) 8006b98: 2b 8c 00 18 lw r12,(sp+24) 8006b9c: 2b 8d 00 14 lw r13,(sp+20) 8006ba0: 2b 8e 00 10 lw r14,(sp+16) 8006ba4: 2b 8f 00 0c lw r15,(sp+12) 8006ba8: 2b 90 00 08 lw r16,(sp+8) 8006bac: 37 9c 00 1c addi sp,sp,28 8006bb0: c3 a0 00 00 ret =============================================================================== 08001b04 : /* * Extract an integer value from the database */ static int scanInt(FILE *fp, int *val) { 8001b04: 37 9c ff d4 addi sp,sp,-44 8001b08: 5b 8b 00 2c sw (sp+44),r11 8001b0c: 5b 8c 00 28 sw (sp+40),r12 8001b10: 5b 8d 00 24 sw (sp+36),r13 8001b14: 5b 8e 00 20 sw (sp+32),r14 8001b18: 5b 8f 00 1c sw (sp+28),r15 8001b1c: 5b 90 00 18 sw (sp+24),r16 8001b20: 5b 91 00 14 sw (sp+20),r17 8001b24: 5b 92 00 10 sw (sp+16),r18 8001b28: 5b 93 00 0c sw (sp+12),r19 8001b2c: 5b 94 00 08 sw (sp+8),r20 8001b30: 5b 9d 00 04 sw (sp+4),ra 8001b34: b8 20 58 00 mv r11,r1 int c; unsigned int i = 0; unsigned int limit = INT_MAX; 8001b38: 78 01 08 01 mvhi r1,0x801 8001b3c: 38 21 35 94 ori r1,r1,0x3594 8001b40: 28 2e 00 00 lw r14,(r1+0) int sign = 0; int d; for (;;) { c = getc(fp); 8001b44: 78 11 08 01 mvhi r17,0x801 limit++; continue; } sign = 1; } if (!isdigit(c)) 8001b48: 78 10 08 01 mvhi r16,0x801 /* * Extract an integer value from the database */ static int scanInt(FILE *fp, int *val) { 8001b4c: b8 40 90 00 mv r18,r2 int c; unsigned int i = 0; unsigned int limit = INT_MAX; int sign = 0; 8001b50: 34 0d 00 00 mvi r13,0 */ static int scanInt(FILE *fp, int *val) { int c; unsigned int i = 0; 8001b54: 34 0c 00 00 mvi r12,0 unsigned int limit = INT_MAX; int sign = 0; int d; for (;;) { c = getc(fp); 8001b58: 3a 31 51 78 ori r17,r17,0x5178 if (c == ':') 8001b5c: 34 14 00 3a mvi r20,58 limit++; continue; } sign = 1; } if (!isdigit(c)) 8001b60: 3a 10 51 70 ori r16,r16,0x5170 for (;;) { c = getc(fp); if (c == ':') break; if (sign == 0) { if (c == '-') { 8001b64: 34 13 00 2d mvi r19,45 unsigned int limit = INT_MAX; int sign = 0; int d; for (;;) { c = getc(fp); 8001b68: 29 61 00 04 lw r1,(r11+4) 8001b6c: 34 21 ff ff addi r1,r1,-1 8001b70: 59 61 00 04 sw (r11+4),r1 8001b74: 4c 20 00 06 bge r1,r0,8001b8c <== ALWAYS TAKEN 8001b78: 2a 21 00 00 lw r1,(r17+0) <== NOT EXECUTED 8001b7c: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8001b80: f8 00 31 f7 calli 800e35c <__srget_r> <== NOT EXECUTED 8001b84: b8 20 78 00 mv r15,r1 <== NOT EXECUTED 8001b88: e0 00 00 05 bi 8001b9c <== NOT EXECUTED 8001b8c: 29 61 00 00 lw r1,(r11+0) 8001b90: 40 2f 00 00 lbu r15,(r1+0) 8001b94: 34 21 00 01 addi r1,r1,1 8001b98: 59 61 00 00 sw (r11+0),r1 if (c == ':') 8001b9c: 45 f4 00 1f be r15,r20,8001c18 break; if (sign == 0) { 8001ba0: 5d a0 00 06 bne r13,r0,8001bb8 if (c == '-') { sign = -1; limit++; continue; } sign = 1; 8001ba4: 34 0d 00 01 mvi r13,1 for (;;) { c = getc(fp); if (c == ':') break; if (sign == 0) { if (c == '-') { 8001ba8: 5d f3 00 04 bne r15,r19,8001bb8 sign = -1; limit++; 8001bac: 35 ce 00 01 addi r14,r14,1 c = getc(fp); if (c == ':') break; if (sign == 0) { if (c == '-') { sign = -1; 8001bb0: 34 0d ff ff mvi r13,-1 limit++; continue; 8001bb4: e3 ff ff ed bi 8001b68 } sign = 1; } if (!isdigit(c)) 8001bb8: 2a 01 00 00 lw r1,(r16+0) 8001bbc: b4 2f 08 00 add r1,r1,r15 8001bc0: 40 21 00 01 lbu r1,(r1+1) 8001bc4: 20 21 00 04 andi r1,r1,0x4 8001bc8: 44 20 00 1c be r1,r0,8001c38 return 0; d = c - '0'; if ((i > (limit / 10)) 8001bcc: b9 c0 08 00 mv r1,r14 8001bd0: 34 02 00 0a mvi r2,10 8001bd4: f8 00 42 07 calli 80123f0 <__udivsi3> 8001bd8: 55 81 00 18 bgu r12,r1,8001c38 } sign = 1; } if (!isdigit(c)) return 0; d = c - '0'; 8001bdc: 35 ef ff d0 addi r15,r15,-48 if ((i > (limit / 10)) || ((i == (limit / 10)) && (d > (limit % 10)))) 8001be0: 5d 81 00 05 bne r12,r1,8001bf4 8001be4: b9 c0 08 00 mv r1,r14 8001be8: 34 02 00 0a mvi r2,10 8001bec: f8 00 42 11 calli 8012430 <__umodsi3> 8001bf0: 55 e1 00 12 bgu r15,r1,8001c38 <== ALWAYS TAKEN return 0; i = i * 10 + d; 8001bf4: b9 80 08 00 mv r1,r12 8001bf8: 34 02 00 01 mvi r2,1 8001bfc: f8 00 41 23 calli 8012088 <__ashlsi3> 8001c00: 34 02 00 02 mvi r2,2 8001c04: b8 20 60 00 mv r12,r1 8001c08: f8 00 41 20 calli 8012088 <__ashlsi3> 8001c0c: b5 81 08 00 add r1,r12,r1 8001c10: b5 e1 60 00 add r12,r15,r1 8001c14: e3 ff ff d5 bi 8001b68 } if (sign == 0) return 0; 8001c18: 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) 8001c1c: 45 a0 00 08 be r13,r0,8001c3c <== NEVER TAKEN return 0; *val = i * sign; 8001c20: b9 a0 08 00 mv r1,r13 8001c24: b9 80 10 00 mv r2,r12 8001c28: f8 00 41 8d calli 801225c <__mulsi3> 8001c2c: 5a 41 00 00 sw (r18+0),r1 return 1; 8001c30: 34 03 00 01 mvi r3,1 8001c34: e0 00 00 02 bi 8001c3c if (!isdigit(c)) return 0; d = c - '0'; if ((i > (limit / 10)) || ((i == (limit / 10)) && (d > (limit % 10)))) return 0; 8001c38: 34 03 00 00 mvi r3,0 } if (sign == 0) return 0; *val = i * sign; return 1; } 8001c3c: b8 60 08 00 mv r1,r3 8001c40: 2b 9d 00 04 lw ra,(sp+4) 8001c44: 2b 8b 00 2c lw r11,(sp+44) 8001c48: 2b 8c 00 28 lw r12,(sp+40) 8001c4c: 2b 8d 00 24 lw r13,(sp+36) 8001c50: 2b 8e 00 20 lw r14,(sp+32) 8001c54: 2b 8f 00 1c lw r15,(sp+28) 8001c58: 2b 90 00 18 lw r16,(sp+24) 8001c5c: 2b 91 00 14 lw r17,(sp+20) 8001c60: 2b 92 00 10 lw r18,(sp+16) 8001c64: 2b 93 00 0c lw r19,(sp+12) 8001c68: 2b 94 00 08 lw r20,(sp+8) 8001c6c: 37 9c 00 2c addi sp,sp,44 8001c70: c3 a0 00 00 ret =============================================================================== 08001dac : FILE *fp, struct group *grp, char *buffer, size_t bufsize ) { 8001dac: 37 9c ff d8 addi sp,sp,-40 8001db0: 5b 8b 00 18 sw (sp+24),r11 8001db4: 5b 8c 00 14 sw (sp+20),r12 8001db8: 5b 8d 00 10 sw (sp+16),r13 8001dbc: 5b 8e 00 0c sw (sp+12),r14 8001dc0: 5b 8f 00 08 sw (sp+8),r15 8001dc4: 5b 9d 00 04 sw (sp+4),ra int grgid; char *grmem, *cp; int memcount; if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0) 8001dc8: 37 8e 00 20 addi r14,sp,32 8001dcc: 37 8d 00 1c addi r13,sp,28 FILE *fp, struct group *grp, char *buffer, size_t bufsize ) { 8001dd0: 5b 83 00 20 sw (sp+32),r3 8001dd4: 5b 84 00 1c sw (sp+28),r4 int grgid; char *grmem, *cp; int memcount; if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0) 8001dd8: b9 c0 18 00 mv r3,r14 8001ddc: b9 a0 20 00 mv r4,r13 8001de0: 34 05 00 00 mvi r5,0 FILE *fp, struct group *grp, char *buffer, size_t bufsize ) { 8001de4: b8 20 78 00 mv r15,r1 8001de8: b8 40 58 00 mv r11,r2 int grgid; char *grmem, *cp; int memcount; if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0) 8001dec: fb ff ff a2 calli 8001c74 || !scanString(fp, &grp->gr_passwd, &buffer, &bufsize, 0) || !scanInt(fp, &grgid) || !scanString(fp, &grmem, &buffer, &bufsize, 1)) return 0; 8001df0: 34 0c 00 00 mvi r12,0 { int grgid; char *grmem, *cp; int memcount; if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0) 8001df4: 44 20 00 43 be r1,r0,8001f00 || !scanString(fp, &grp->gr_passwd, &buffer, &bufsize, 0) 8001df8: b9 e0 08 00 mv r1,r15 8001dfc: 35 62 00 04 addi r2,r11,4 8001e00: b9 c0 18 00 mv r3,r14 8001e04: b9 a0 20 00 mv r4,r13 8001e08: 34 05 00 00 mvi r5,0 8001e0c: fb ff ff 9a calli 8001c74 8001e10: 44 20 00 3c be r1,r0,8001f00 <== NEVER TAKEN || !scanInt(fp, &grgid) 8001e14: b9 e0 08 00 mv r1,r15 8001e18: 37 82 00 28 addi r2,sp,40 8001e1c: fb ff ff 3a calli 8001b04 8001e20: 44 20 00 38 be r1,r0,8001f00 <== NEVER TAKEN || !scanString(fp, &grmem, &buffer, &bufsize, 1)) 8001e24: b9 e0 08 00 mv r1,r15 8001e28: 37 82 00 24 addi r2,sp,36 8001e2c: b9 c0 18 00 mv r3,r14 8001e30: b9 a0 20 00 mv r4,r13 8001e34: 34 05 00 01 mvi r5,1 8001e38: fb ff ff 8f calli 8001c74 8001e3c: 44 20 00 31 be r1,r0,8001f00 <== NEVER TAKEN return 0; grp->gr_gid = grgid; 8001e40: 2b 81 00 28 lw r1,(sp+40) /* * Determine number of members */ for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 8001e44: 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; 8001e48: 0d 61 00 08 sh (r11+8),r1 /* * Determine number of members */ for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 8001e4c: b9 a0 10 00 mv r2,r13 8001e50: 34 01 00 01 mvi r1,1 8001e54: e0 00 00 04 bi 8001e64 if(*cp == ',') memcount++; 8001e58: 64 63 00 2c cmpei r3,r3,44 grp->gr_gid = grgid; /* * Determine number of members */ for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 8001e5c: 34 42 00 01 addi r2,r2,1 if(*cp == ',') memcount++; 8001e60: b4 23 08 00 add r1,r1,r3 grp->gr_gid = grgid; /* * Determine number of members */ for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 8001e64: 40 43 00 00 lbu r3,(r2+0) 8001e68: 5c 60 ff fc bne r3,r0,8001e58 } /* * Hack to produce (hopefully) a suitably-aligned array of pointers */ if (bufsize < (((memcount+1)*sizeof(char *)) + 15)) 8001e6c: 34 02 00 02 mvi r2,2 8001e70: 34 21 00 01 addi r1,r1,1 8001e74: f8 00 40 85 calli 8012088 <__ashlsi3> 8001e78: 2b 82 00 1c lw r2,(sp+28) 8001e7c: 34 21 00 0f addi r1,r1,15 return 0; 8001e80: 34 0c 00 00 mvi r12,0 } /* * Hack to produce (hopefully) a suitably-aligned array of pointers */ if (bufsize < (((memcount+1)*sizeof(char *)) + 15)) 8001e84: 54 22 00 1f bgu r1,r2,8001f00 <== NEVER TAKEN return 0; grp->gr_mem = (char **)(((uintptr_t)buffer + 15) & ~15); 8001e88: 2b 81 00 20 lw r1,(sp+32) 8001e8c: 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 == ',') { 8001e90: 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); 8001e94: 34 21 00 0f addi r1,r1,15 8001e98: a0 22 08 00 and r1,r1,r2 8001e9c: 59 61 00 0c sw (r11+12),r1 /* * Fill in pointer array */ grp->gr_mem[0] = grmem; 8001ea0: 58 2d 00 00 sw (r1+0),r13 } /* * Extract a single group record from the database */ static int scangr( 8001ea4: 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++) { 8001ea8: 34 0d 00 01 mvi r13,1 } /* * Extract a single group record from the database */ static int scangr( 8001eac: 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++) { 8001eb0: e0 00 00 0b bi 8001edc if(*cp == ',') { 8001eb4: 5c 2e 00 09 bne r1,r14,8001ed8 *cp = '\0'; 8001eb8: 31 80 ff ff sb (r12+-1),r0 grp->gr_mem[memcount++] = cp + 1; 8001ebc: 29 6f 00 0c lw r15,(r11+12) 8001ec0: b9 a0 08 00 mv r1,r13 8001ec4: 34 02 00 02 mvi r2,2 8001ec8: f8 00 40 70 calli 8012088 <__ashlsi3> 8001ecc: b5 e1 08 00 add r1,r15,r1 8001ed0: 58 2c 00 00 sw (r1+0),r12 8001ed4: 35 ad 00 01 addi r13,r13,1 8001ed8: 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++) { 8001edc: 41 81 ff ff lbu r1,(r12+-1) 8001ee0: 5c 20 ff f5 bne r1,r0,8001eb4 if(*cp == ',') { *cp = '\0'; grp->gr_mem[memcount++] = cp + 1; } } grp->gr_mem[memcount] = NULL; 8001ee4: 29 6b 00 0c lw r11,(r11+12) 8001ee8: b9 a0 08 00 mv r1,r13 8001eec: 34 02 00 02 mvi r2,2 8001ef0: f8 00 40 66 calli 8012088 <__ashlsi3> 8001ef4: b5 61 08 00 add r1,r11,r1 8001ef8: 58 20 00 00 sw (r1+0),r0 return 1; 8001efc: 34 0c 00 01 mvi r12,1 } 8001f00: b9 80 08 00 mv r1,r12 8001f04: 2b 9d 00 04 lw ra,(sp+4) 8001f08: 2b 8b 00 18 lw r11,(sp+24) 8001f0c: 2b 8c 00 14 lw r12,(sp+20) 8001f10: 2b 8d 00 10 lw r13,(sp+16) 8001f14: 2b 8e 00 0c lw r14,(sp+12) 8001f18: 2b 8f 00 08 lw r15,(sp+8) 8001f1c: 37 9c 00 28 addi sp,sp,40 8001f20: c3 a0 00 00 ret =============================================================================== 08001f24 : FILE *fp, struct passwd *pwd, char *buffer, size_t bufsize ) { 8001f24: 37 9c ff d8 addi sp,sp,-40 8001f28: 5b 8b 00 18 sw (sp+24),r11 8001f2c: 5b 8c 00 14 sw (sp+20),r12 8001f30: 5b 8d 00 10 sw (sp+16),r13 8001f34: 5b 8e 00 0c sw (sp+12),r14 8001f38: 5b 8f 00 08 sw (sp+8),r15 8001f3c: 5b 9d 00 04 sw (sp+4),ra int pwuid, pwgid; if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0) 8001f40: 37 8e 00 20 addi r14,sp,32 8001f44: 37 8d 00 1c addi r13,sp,28 FILE *fp, struct passwd *pwd, char *buffer, size_t bufsize ) { 8001f48: 5b 83 00 20 sw (sp+32),r3 8001f4c: 5b 84 00 1c sw (sp+28),r4 int pwuid, pwgid; if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0) 8001f50: b9 c0 18 00 mv r3,r14 8001f54: b9 a0 20 00 mv r4,r13 8001f58: 34 05 00 00 mvi r5,0 FILE *fp, struct passwd *pwd, char *buffer, size_t bufsize ) { 8001f5c: b8 20 60 00 mv r12,r1 8001f60: b8 40 58 00 mv r11,r2 int pwuid, pwgid; if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0) 8001f64: fb ff ff 44 calli 8001c74 || !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; 8001f68: 34 0f 00 00 mvi r15,0 size_t bufsize ) { int pwuid, pwgid; if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0) 8001f6c: 44 20 00 31 be r1,r0,8002030 || !scanString(fp, &pwd->pw_passwd, &buffer, &bufsize, 0) 8001f70: b9 80 08 00 mv r1,r12 8001f74: 35 62 00 04 addi r2,r11,4 8001f78: b9 c0 18 00 mv r3,r14 8001f7c: b9 a0 20 00 mv r4,r13 8001f80: 34 05 00 00 mvi r5,0 8001f84: fb ff ff 3c calli 8001c74 8001f88: 44 20 00 2a be r1,r0,8002030 <== NEVER TAKEN || !scanInt(fp, &pwuid) 8001f8c: b9 80 08 00 mv r1,r12 8001f90: 37 82 00 28 addi r2,sp,40 8001f94: fb ff fe dc calli 8001b04 8001f98: 44 20 00 26 be r1,r0,8002030 || !scanInt(fp, &pwgid) 8001f9c: b9 80 08 00 mv r1,r12 8001fa0: 37 82 00 24 addi r2,sp,36 8001fa4: fb ff fe d8 calli 8001b04 8001fa8: 44 20 00 22 be r1,r0,8002030 || !scanString(fp, &pwd->pw_comment, &buffer, &bufsize, 0) 8001fac: b9 80 08 00 mv r1,r12 8001fb0: 35 62 00 0c addi r2,r11,12 8001fb4: b9 c0 18 00 mv r3,r14 8001fb8: b9 a0 20 00 mv r4,r13 8001fbc: 34 05 00 00 mvi r5,0 8001fc0: fb ff ff 2d calli 8001c74 8001fc4: 44 20 00 1b be r1,r0,8002030 <== NEVER TAKEN || !scanString(fp, &pwd->pw_gecos, &buffer, &bufsize, 0) 8001fc8: b9 80 08 00 mv r1,r12 8001fcc: 35 62 00 10 addi r2,r11,16 8001fd0: b9 c0 18 00 mv r3,r14 8001fd4: b9 a0 20 00 mv r4,r13 8001fd8: 34 05 00 00 mvi r5,0 8001fdc: fb ff ff 26 calli 8001c74 8001fe0: 44 20 00 14 be r1,r0,8002030 <== NEVER TAKEN || !scanString(fp, &pwd->pw_dir, &buffer, &bufsize, 0) 8001fe4: b9 80 08 00 mv r1,r12 8001fe8: 35 62 00 14 addi r2,r11,20 8001fec: b9 c0 18 00 mv r3,r14 8001ff0: b9 a0 20 00 mv r4,r13 8001ff4: 34 05 00 00 mvi r5,0 8001ff8: fb ff ff 1f calli 8001c74 8001ffc: 44 20 00 0d be r1,r0,8002030 <== NEVER TAKEN || !scanString(fp, &pwd->pw_shell, &buffer, &bufsize, 1)) 8002000: b9 80 08 00 mv r1,r12 8002004: 35 62 00 18 addi r2,r11,24 8002008: b9 c0 18 00 mv r3,r14 800200c: b9 a0 20 00 mv r4,r13 8002010: 34 05 00 01 mvi r5,1 8002014: fb ff ff 18 calli 8001c74 8002018: 44 20 00 06 be r1,r0,8002030 return 0; pwd->pw_uid = pwuid; 800201c: 2b 81 00 28 lw r1,(sp+40) pwd->pw_gid = pwgid; return 1; 8002020: 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; 8002024: 0d 61 00 08 sh (r11+8),r1 pwd->pw_gid = pwgid; 8002028: 2b 81 00 24 lw r1,(sp+36) 800202c: 0d 61 00 0a sh (r11+10),r1 return 1; } 8002030: b9 e0 08 00 mv r1,r15 8002034: 2b 9d 00 04 lw ra,(sp+4) 8002038: 2b 8b 00 18 lw r11,(sp+24) 800203c: 2b 8c 00 14 lw r12,(sp+20) 8002040: 2b 8d 00 10 lw r13,(sp+16) 8002044: 2b 8e 00 0c lw r14,(sp+12) 8002048: 2b 8f 00 08 lw r15,(sp+8) 800204c: 37 9c 00 28 addi sp,sp,40 8002050: c3 a0 00 00 ret =============================================================================== 08005aa4 : /* * Process input character, with semaphore. */ static int siproc (unsigned char c, struct rtems_termios_tty *tty) { 8005aa4: 37 9c ff f4 addi sp,sp,-12 8005aa8: 5b 8b 00 0c sw (sp+12),r11 8005aac: 5b 8c 00 08 sw (sp+8),r12 8005ab0: 5b 9d 00 04 sw (sp+4),ra 8005ab4: 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)) { 8005ab8: 28 41 00 3c lw r1,(r2+60) /* * Process input character, with semaphore. */ static int siproc (unsigned char c, struct rtems_termios_tty *tty) { 8005abc: 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)) { 8005ac0: 20 21 0e 78 andi r1,r1,0xe78 8005ac4: 44 20 00 0c be r1,r0,8005af4 <== NEVER TAKEN rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8005ac8: 28 41 00 18 lw r1,(r2+24) 8005acc: 34 03 00 00 mvi r3,0 8005ad0: 34 02 00 00 mvi r2,0 8005ad4: f8 00 05 8d calli 8007108 i = iproc (c, tty); 8005ad8: b9 80 08 00 mv r1,r12 8005adc: b9 60 10 00 mv r2,r11 8005ae0: fb ff ff 84 calli 80058f0 8005ae4: b8 20 60 00 mv r12,r1 rtems_semaphore_release (tty->osem); 8005ae8: 29 61 00 18 lw r1,(r11+24) 8005aec: f8 00 05 d7 calli 8007248 8005af0: e0 00 00 04 bi 8005b00 } else { i = iproc (c, tty); 8005af4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8005af8: fb ff ff 7e calli 80058f0 <== NOT EXECUTED 8005afc: b8 20 60 00 mv r12,r1 <== NOT EXECUTED } return i; } 8005b00: b9 80 08 00 mv r1,r12 8005b04: 2b 9d 00 04 lw ra,(sp+4) 8005b08: 2b 8b 00 0c lw r11,(sp+12) 8005b0c: 2b 8c 00 08 lw r12,(sp+8) 8005b10: 37 9c 00 0c addi sp,sp,12 8005b14: c3 a0 00 00 ret =============================================================================== 080020c8 : int _STAT_NAME( const char *path, struct stat *buf ) { 80020c8: 37 9c ff dc addi sp,sp,-36 80020cc: 5b 8b 00 10 sw (sp+16),r11 80020d0: 5b 8c 00 0c sw (sp+12),r12 80020d4: 5b 8d 00 08 sw (sp+8),r13 80020d8: 5b 9d 00 04 sw (sp+4),ra 80020dc: b8 20 58 00 mv r11,r1 80020e0: b8 40 68 00 mv r13,r2 /* * Check to see if we were passed a valid pointer. */ if ( !buf ) 80020e4: 5c 40 00 06 bne r2,r0,80020fc <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); 80020e8: f8 00 1b cc calli 8009018 <__errno> 80020ec: 34 02 00 0e mvi r2,14 80020f0: 58 22 00 00 sw (r1+0),r2 80020f4: 34 0b ff ff mvi r11,-1 80020f8: e0 00 00 17 bi 8002154 status = rtems_filesystem_evaluate_path( path, strlen( path ), 80020fc: f8 00 1f e1 calli 800a080 8002100: 37 8c 00 14 addi r12,sp,20 8002104: b8 20 10 00 mv r2,r1 8002108: 34 03 00 00 mvi r3,0 800210c: b9 60 08 00 mv r1,r11 8002110: b9 80 20 00 mv r4,r12 8002114: 34 05 00 01 mvi r5,1 8002118: fb ff fc 63 calli 80012a4 0, &loc, _STAT_FOLLOW_LINKS ); if ( status != 0 ) return -1; 800211c: 34 0b ff ff mvi r11,-1 if ( !buf ) rtems_set_errno_and_return_minus_one( EFAULT ); status = rtems_filesystem_evaluate_path( path, strlen( path ), 0, &loc, _STAT_FOLLOW_LINKS ); if ( status != 0 ) 8002120: 5c 20 00 0d bne r1,r0,8002154 /* * Zero out the stat structure so the various support * versions of stat don't have to. */ memset( buf, 0, sizeof(struct stat) ); 8002124: 34 02 00 00 mvi r2,0 8002128: 34 03 00 48 mvi r3,72 800212c: b9 a0 08 00 mv r1,r13 8002130: f8 00 1e b1 calli 8009bf4 status = (*loc.handlers->fstat_h)( &loc, buf ); 8002134: 2b 81 00 1c lw r1,(sp+28) 8002138: b9 a0 10 00 mv r2,r13 800213c: 28 23 00 18 lw r3,(r1+24) 8002140: b9 80 08 00 mv r1,r12 8002144: d8 60 00 00 call r3 8002148: b8 20 58 00 mv r11,r1 rtems_filesystem_freenode( &loc ); 800214c: b9 80 08 00 mv r1,r12 8002150: fb ff fc 9d calli 80013c4 return status; } 8002154: b9 60 08 00 mv r1,r11 8002158: 2b 9d 00 04 lw ra,(sp+4) 800215c: 2b 8b 00 10 lw r11,(sp+16) 8002160: 2b 8c 00 0c lw r12,(sp+12) 8002164: 2b 8d 00 08 lw r13,(sp+8) 8002168: 37 9c 00 24 addi sp,sp,36 800216c: c3 a0 00 00 ret =============================================================================== 080050a8 : #include int statvfs (const char *path, struct statvfs *sb) { 80050a8: 37 9c ff dc addi sp,sp,-36 80050ac: 5b 8b 00 10 sw (sp+16),r11 80050b0: 5b 8c 00 0c sw (sp+12),r12 80050b4: 5b 8d 00 08 sw (sp+8),r13 80050b8: 5b 9d 00 04 sw (sp+4),ra 80050bc: b8 20 58 00 mv r11,r1 80050c0: 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 ) ) 80050c4: 37 8c 00 14 addi r12,sp,20 80050c8: f8 00 2d 4c calli 80105f8 80050cc: b8 20 10 00 mv r2,r1 80050d0: 34 03 00 00 mvi r3,0 80050d4: b9 60 08 00 mv r1,r11 80050d8: b9 80 20 00 mv r4,r12 80050dc: 34 05 00 01 mvi r5,1 80050e0: fb ff fa 2c calli 8003990 return -1; 80050e4: 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 ) ) 80050e8: 5c 20 00 0e bne r1,r0,8005120 <== NEVER TAKEN return -1; mt_entry = loc.mt_entry; 80050ec: 2b 8b 00 24 lw r11,(sp+36) fs_mount_root = &mt_entry->mt_fs_root; memset (sb, 0, sizeof (struct statvfs)); 80050f0: 34 02 00 00 mvi r2,0 80050f4: 34 03 00 38 mvi r3,56 80050f8: b9 a0 08 00 mv r1,r13 80050fc: f8 00 28 9d calli 800f370 result = ( fs_mount_root->ops->statvfs_h )( fs_mount_root, sb ); 8005100: 29 61 00 28 lw r1,(r11+40) 8005104: b9 a0 10 00 mv r2,r13 8005108: 28 23 00 44 lw r3,(r1+68) 800510c: 35 61 00 1c addi r1,r11,28 8005110: d8 60 00 00 call r3 8005114: b8 20 58 00 mv r11,r1 rtems_filesystem_freenode( &loc ); 8005118: b9 80 08 00 mv r1,r12 800511c: fb ff fa 65 calli 8003ab0 return result; } 8005120: b9 60 08 00 mv r1,r11 8005124: 2b 9d 00 04 lw ra,(sp+4) 8005128: 2b 8b 00 10 lw r11,(sp+16) 800512c: 2b 8c 00 0c lw r12,(sp+12) 8005130: 2b 8d 00 08 lw r13,(sp+8) 8005134: 37 9c 00 24 addi sp,sp,36 8005138: c3 a0 00 00 ret =============================================================================== 080039b4 : fdatasync(fn); } /* iterate over all FILE *'s for this thread */ static void sync_per_thread(Thread_Control *t) { 80039b4: 37 9c ff f4 addi sp,sp,-12 80039b8: 5b 8b 00 0c sw (sp+12),r11 80039bc: 5b 8c 00 08 sw (sp+8),r12 80039c0: 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; 80039c4: 28 22 01 20 lw r2,(r1+288) if ( this_reent ) { 80039c8: 44 40 00 0c be r2,r0,80039f8 <== NEVER TAKEN current_reent = _Thread_Executing->libc_reent; 80039cc: 78 0b 08 01 mvhi r11,0x801 80039d0: 39 6b 49 a8 ori r11,r11,0x49a8 80039d4: 29 63 00 0c lw r3,(r11+12) 80039d8: 28 6c 01 20 lw r12,(r3+288) _Thread_Executing->libc_reent = this_reent; 80039dc: 58 62 01 20 sw (r3+288),r2 _fwalk (t->libc_reent, sync_wrapper); 80039e0: 28 21 01 20 lw r1,(r1+288) 80039e4: 78 02 08 00 mvhi r2,0x800 80039e8: 38 42 3a 0c ori r2,r2,0x3a0c 80039ec: f8 00 26 91 calli 800d430 <_fwalk> _Thread_Executing->libc_reent = current_reent; 80039f0: 29 61 00 0c lw r1,(r11+12) 80039f4: 58 2c 01 20 sw (r1+288),r12 } } 80039f8: 2b 9d 00 04 lw ra,(sp+4) 80039fc: 2b 8b 00 0c lw r11,(sp+12) 8003a00: 2b 8c 00 08 lw r12,(sp+8) 8003a04: 37 9c 00 0c addi sp,sp,12 8003a08: c3 a0 00 00 ret =============================================================================== 0800226c : int tcflow ( int fd __attribute__((unused)), int action ) { 800226c: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 8002270: 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 ); 8002274: f8 00 1a e8 calli 8008e14 <__errno> <== NOT EXECUTED 8002278: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 800227c: 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 ); } 8002280: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8002284: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8002288: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 800228c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08002290 : int tcflush ( int fd __attribute__((unused)), int queue ) { 8002290: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 8002294: 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 ); 8002298: f8 00 1a df calli 8008e14 <__errno> <== NOT EXECUTED 800229c: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 80022a0: 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; } 80022a4: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 80022a8: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80022ac: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 80022b0: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080022b4 : #include #include pid_t tcgetpgrp(int fd __attribute__((unused))) { 80022b4: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 80022b8: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED return getpid(); 80022bc: fb ff fc 7e calli 80014b4 <== NOT EXECUTED } 80022c0: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80022c4: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 80022c8: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080022cc : int tcsendbreak ( int fd __attribute__((unused)), int duration __attribute__((unused)) ) { return 0; } 80022cc: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 80022d0: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08004648 : int tcsetattr( int fd, int opt, struct termios *tp ) { 8004648: 37 9c ff f4 addi sp,sp,-12 800464c: 5b 8b 00 0c sw (sp+12),r11 8004650: 5b 8c 00 08 sw (sp+8),r12 8004654: 5b 9d 00 04 sw (sp+4),ra 8004658: b8 20 60 00 mv r12,r1 800465c: b8 60 58 00 mv r11,r3 switch (opt) { 8004660: 44 40 00 0d be r2,r0,8004694 8004664: 34 03 00 01 mvi r3,1 8004668: 44 43 00 06 be r2,r3,8004680 default: rtems_set_errno_and_return_minus_one( ENOTSUP ); 800466c: f8 00 2c d3 calli 800f9b8 <__errno> 8004670: 34 02 00 86 mvi r2,134 8004674: 58 22 00 00 sw (r1+0),r2 8004678: 34 02 ff ff mvi r2,-1 800467c: e0 00 00 0b bi 80046a8 case TCSADRAIN: if (ioctl( fd, RTEMS_IO_TCDRAIN, NULL ) < 0) 8004680: 34 02 00 03 mvi r2,3 8004684: 34 03 00 00 mvi r3,0 8004688: f8 00 21 3d calli 800cb7c return -1; 800468c: 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) 8004690: 48 01 00 06 bg r0,r1,80046a8 <== NEVER TAKEN return -1; /* * Fall through to.... */ case TCSANOW: return ioctl( fd, RTEMS_IO_SET_ATTRIBUTES, tp ); 8004694: 34 02 00 02 mvi r2,2 8004698: b9 80 08 00 mv r1,r12 800469c: b9 60 18 00 mv r3,r11 80046a0: f8 00 21 37 calli 800cb7c 80046a4: b8 20 10 00 mv r2,r1 } } 80046a8: b8 40 08 00 mv r1,r2 80046ac: 2b 9d 00 04 lw ra,(sp+4) 80046b0: 2b 8b 00 0c lw r11,(sp+12) 80046b4: 2b 8c 00 08 lw r12,(sp+8) 80046b8: 37 9c 00 0c addi sp,sp,12 80046bc: c3 a0 00 00 ret =============================================================================== 080022d4 : int tcsetpgrp( int fd __attribute__((unused)), pid_t pid __attribute__((unused)) ) { return 0; } 80022d4: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 80022d8: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08003894 : #include int unlink( const char *path ) { 8003894: 37 9c ff c0 addi sp,sp,-64 8003898: 5b 8b 00 14 sw (sp+20),r11 800389c: 5b 8c 00 10 sw (sp+16),r12 80038a0: 5b 8d 00 0c sw (sp+12),r13 80038a4: 5b 8e 00 08 sw (sp+8),r14 80038a8: 5b 9d 00 04 sw (sp+4),ra 80038ac: b8 20 70 00 mv r14,r1 /* * Get the node to be unlinked. Find the parent path first. */ parentpathlen = rtems_filesystem_dirname ( path ); 80038b0: fb ff fb 4f calli 80025ec 80038b4: b8 20 58 00 mv r11,r1 80038b8: 37 84 00 2c addi r4,sp,44 if ( parentpathlen == 0 ) 80038bc: 5c 20 00 07 bne r1,r0,80038d8 rtems_filesystem_get_start_loc( path, &i, &parentloc ); 80038c0: b9 c0 08 00 mv r1,r14 80038c4: 37 82 00 40 addi r2,sp,64 80038c8: b8 80 18 00 mv r3,r4 80038cc: fb ff ff c0 calli 80037cc const char *name; rtems_filesystem_location_info_t parentloc; rtems_filesystem_location_info_t loc; int i; int result; bool free_parentloc = false; 80038d0: 34 0d 00 00 mvi r13,0 80038d4: e0 00 00 09 bi 80038f8 parentpathlen = rtems_filesystem_dirname ( path ); if ( parentpathlen == 0 ) rtems_filesystem_get_start_loc( path, &i, &parentloc ); else { result = rtems_filesystem_evaluate_path( path, parentpathlen, 80038d8: b9 c0 08 00 mv r1,r14 80038dc: b9 60 10 00 mv r2,r11 80038e0: 34 03 00 02 mvi r3,2 80038e4: 34 05 00 00 mvi r5,0 80038e8: fb ff fb 26 calli 8002580 RTEMS_LIBIO_PERMS_WRITE, &parentloc, false ); if ( result != 0 ) return -1; 80038ec: 34 0c ff ff mvi r12,-1 else { result = rtems_filesystem_evaluate_path( path, parentpathlen, RTEMS_LIBIO_PERMS_WRITE, &parentloc, false ); if ( result != 0 ) 80038f0: 5c 20 00 3d bne r1,r0,80039e4 <== NEVER TAKEN return -1; free_parentloc = true; 80038f4: 34 0d 00 01 mvi r13,1 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 80038f8: 2b 81 00 2c lw r1,(sp+44) name = path + parentpathlen; 80038fc: b5 cb 58 00 add r11,r14,r11 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 8003900: 5b 81 00 18 sw (sp+24),r1 8003904: 2b 81 00 30 lw r1,(sp+48) 8003908: 5b 81 00 1c sw (sp+28),r1 800390c: 2b 81 00 34 lw r1,(sp+52) 8003910: 5b 81 00 20 sw (sp+32),r1 8003914: 2b 81 00 38 lw r1,(sp+56) 8003918: 5b 81 00 24 sw (sp+36),r1 800391c: 2b 81 00 3c lw r1,(sp+60) 8003920: 5b 81 00 28 sw (sp+40),r1 name = path + parentpathlen; name += rtems_filesystem_prefix_separators( name, strlen( name ) ); 8003924: b9 60 08 00 mv r1,r11 8003928: f8 00 36 49 calli 801124c 800392c: b8 20 10 00 mv r2,r1 8003930: b9 60 08 00 mv r1,r11 8003934: fb ff fb 42 calli 800263c 8003938: b5 61 60 00 add r12,r11,r1 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 800393c: b9 80 08 00 mv r1,r12 8003940: f8 00 36 43 calli 801124c 8003944: 37 8b 00 18 addi r11,sp,24 8003948: b8 20 10 00 mv r2,r1 800394c: 34 03 00 00 mvi r3,0 8003950: b9 80 08 00 mv r1,r12 8003954: b9 60 20 00 mv r4,r11 8003958: 34 05 00 00 mvi r5,0 800395c: fb ff fa e7 calli 80024f8 0, &loc, false ); if ( result != 0 ) { 8003960: 44 20 00 05 be r1,r0,8003974 if ( free_parentloc ) rtems_filesystem_freenode( &parentloc ); return -1; 8003964: 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 ); 8003968: 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 ) 800396c: 45 a0 00 1e be r13,r0,80039e4 <== NEVER TAKEN 8003970: e0 00 00 1c bi 80039e0 rtems_filesystem_freenode( &parentloc ); return -1; } if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) { 8003974: 2b 81 00 24 lw r1,(sp+36) 8003978: 28 22 00 10 lw r2,(r1+16) 800397c: b9 60 08 00 mv r1,r11 8003980: d8 40 00 00 call r2 8003984: 34 02 00 01 mvi r2,1 8003988: 5c 22 00 0b bne r1,r2,80039b4 rtems_filesystem_freenode( &loc ); 800398c: b9 60 08 00 mv r1,r11 8003990: fb ff fb 44 calli 80026a0 if ( free_parentloc ) 8003994: 45 a0 00 03 be r13,r0,80039a0 rtems_filesystem_freenode( &parentloc ); 8003998: 37 81 00 2c addi r1,sp,44 800399c: fb ff fb 41 calli 80026a0 rtems_set_errno_and_return_minus_one( EISDIR ); 80039a0: f8 00 31 ca calli 80100c8 <__errno> 80039a4: 34 02 00 15 mvi r2,21 80039a8: 58 22 00 00 sw (r1+0),r2 80039ac: 34 0c ff ff mvi r12,-1 80039b0: e0 00 00 0d bi 80039e4 } result = (*loc.ops->unlink_h)( &parentloc, &loc ); 80039b4: 2b 81 00 24 lw r1,(sp+36) 80039b8: 37 8e 00 2c addi r14,sp,44 80039bc: b9 60 10 00 mv r2,r11 80039c0: 28 23 00 0c lw r3,(r1+12) 80039c4: b9 c0 08 00 mv r1,r14 80039c8: d8 60 00 00 call r3 80039cc: b8 20 60 00 mv r12,r1 rtems_filesystem_freenode( &loc ); 80039d0: b9 60 08 00 mv r1,r11 80039d4: fb ff fb 33 calli 80026a0 if ( free_parentloc ) 80039d8: 45 a0 00 03 be r13,r0,80039e4 rtems_filesystem_freenode( &parentloc ); 80039dc: b9 c0 08 00 mv r1,r14 80039e0: fb ff fb 30 calli 80026a0 return result; } 80039e4: b9 80 08 00 mv r1,r12 80039e8: 2b 9d 00 04 lw ra,(sp+4) 80039ec: 2b 8b 00 14 lw r11,(sp+20) 80039f0: 2b 8c 00 10 lw r12,(sp+16) 80039f4: 2b 8d 00 0c lw r13,(sp+12) 80039f8: 2b 8e 00 08 lw r14,(sp+8) 80039fc: 37 9c 00 40 addi sp,sp,64 8003a00: c3 a0 00 00 ret =============================================================================== 08003910 : */ int unmount( const char *path ) { 8003910: 37 9c ff dc addi sp,sp,-36 8003914: 5b 8b 00 10 sw (sp+16),r11 8003918: 5b 8c 00 0c sw (sp+12),r12 800391c: 5b 8d 00 08 sw (sp+8),r13 8003920: 5b 9d 00 04 sw (sp+4),ra 8003924: 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 ) ) 8003928: 37 8c 00 14 addi r12,sp,20 800392c: f8 00 27 4b calli 800d658 8003930: b8 20 10 00 mv r2,r1 8003934: 34 03 00 00 mvi r3,0 8003938: b9 60 08 00 mv r1,r11 800393c: b9 80 20 00 mv r4,r12 8003940: 34 05 00 01 mvi r5,1 8003944: fb ff fa 1d calli 80021b8 8003948: 5c 20 00 41 bne r1,r0,8003a4c return -1; mt_entry = loc.mt_entry; 800394c: 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 ){ 8003950: 2b 81 00 14 lw r1,(sp+20) 8003954: 29 62 00 1c lw r2,(r11+28) 8003958: 44 41 00 06 be r2,r1,8003970 rtems_filesystem_freenode( &loc ); 800395c: b9 80 08 00 mv r1,r12 8003960: fb ff fa 5e calli 80022d8 rtems_set_errno_and_return_minus_one( EACCES ); 8003964: f8 00 21 a0 calli 800bfe4 <__errno> 8003968: 34 02 00 0d mvi r2,13 800396c: e0 00 00 13 bi 80039b8 /* * Free the loc node and just use the nodes from the mt_entry . */ rtems_filesystem_freenode( &loc ); 8003970: b9 80 08 00 mv r1,r12 8003974: fb ff fa 59 calli 80022d8 * 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 ) 8003978: 78 01 08 01 mvhi r1,0x801 800397c: 38 21 51 a0 ori r1,r1,0x51a0 8003980: 28 21 00 00 lw r1,(r1+0) 8003984: 28 21 00 14 lw r1,(r1+20) 8003988: 44 2b 00 0a be r1,r11,80039b0 /* * Verify there are no file systems below the path specified */ if ( rtems_filesystem_mount_iterate( is_fs_below_mount_point, 800398c: 29 62 00 2c lw r2,(r11+44) 8003990: 78 01 08 00 mvhi r1,0x800 8003994: 38 21 39 04 ori r1,r1,0x3904 8003998: fb ff fc ea calli 8002d40 800399c: 5c 20 00 05 bne r1,r0,80039b0 * 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 ) 80039a0: b9 60 08 00 mv r1,r11 80039a4: fb ff fb 67 calli 8002740 80039a8: 34 02 00 01 mvi r2,1 80039ac: 5c 22 00 05 bne r1,r2,80039c0 rtems_set_errno_and_return_minus_one( EBUSY ); 80039b0: f8 00 21 8d calli 800bfe4 <__errno> 80039b4: 34 02 00 10 mvi r2,16 80039b8: 58 22 00 00 sw (r1+0),r2 80039bc: e0 00 00 24 bi 8003a4c * 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 ) 80039c0: 29 61 00 14 lw r1,(r11+20) return -1; 80039c4: 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 ) 80039c8: 28 22 00 28 lw r2,(r1+40) 80039cc: b9 60 08 00 mv r1,r11 80039d0: d8 40 00 00 call r2 80039d4: b8 20 68 00 mv r13,r1 80039d8: 5c 20 00 1e bne r1,r0,8003a50 <== 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){ 80039dc: 29 61 00 28 lw r1,(r11+40) 80039e0: 28 22 00 2c lw r2,(r1+44) 80039e4: b9 60 08 00 mv r1,r11 80039e8: d8 40 00 00 call r2 80039ec: 44 2d 00 08 be r1,r13,8003a0c <== ALWAYS TAKEN if (( fs_mount_loc->ops->mount_h )( mt_entry ) != 0 ) 80039f0: 29 61 00 14 lw r1,(r11+20) <== NOT EXECUTED 80039f4: 28 22 00 20 lw r2,(r1+32) <== NOT EXECUTED 80039f8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 80039fc: d8 40 00 00 call r2 <== NOT EXECUTED 8003a00: 44 20 00 14 be r1,r0,8003a50 <== NOT EXECUTED rtems_fatal_error_occurred( 0 ); 8003a04: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8003a08: f8 00 02 c9 calli 800452c <== 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 ); 8003a0c: 78 0c 08 01 mvhi r12,0x801 8003a10: 39 8c 57 c4 ori r12,r12,0x57c4 8003a14: 29 81 00 00 lw r1,(r12+0) 8003a18: 34 02 00 00 mvi r2,0 8003a1c: 34 03 00 00 mvi r3,0 8003a20: f8 00 01 96 calli 8004078 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 8003a24: b9 60 08 00 mv r1,r11 8003a28: f8 00 03 b3 calli 80048f4 <_Chain_Extract> } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 8003a2c: 29 81 00 00 lw r1,(r12+0) */ rtems_filesystem_freenode( fs_mount_loc ); free( mt_entry ); return 0; 8003a30: 34 0c 00 00 mvi r12,0 8003a34: f8 00 01 e1 calli 80041b8 /* * 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 ); 8003a38: 35 61 00 08 addi r1,r11,8 8003a3c: fb ff fa 27 calli 80022d8 free( mt_entry ); 8003a40: b9 60 08 00 mv r1,r11 8003a44: fb ff fa 2d calli 80022f8 return 0; 8003a48: e0 00 00 02 bi 8003a50 * 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; 8003a4c: 34 0c ff ff mvi r12,-1 rtems_filesystem_freenode( fs_mount_loc ); free( mt_entry ); return 0; } 8003a50: b9 80 08 00 mv r1,r12 8003a54: 2b 9d 00 04 lw ra,(sp+4) 8003a58: 2b 8b 00 10 lw r11,(sp+16) 8003a5c: 2b 8c 00 0c lw r12,(sp+12) 8003a60: 2b 8d 00 08 lw r13,(sp+8) 8003a64: 37 9c 00 24 addi sp,sp,36 8003a68: c3 a0 00 00 ret =============================================================================== 08011120 : ssize_t write( int fd, const void *buffer, size_t count ) { 8011120: 37 9c ff ec addi sp,sp,-20 8011124: 5b 8b 00 10 sw (sp+16),r11 8011128: 5b 8c 00 0c sw (sp+12),r12 801112c: 5b 8d 00 08 sw (sp+8),r13 8011130: 5b 9d 00 04 sw (sp+4),ra ssize_t rc; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8011134: 78 04 08 01 mvhi r4,0x801 8011138: 38 84 30 10 ori r4,r4,0x3010 ssize_t write( int fd, const void *buffer, size_t count ) { 801113c: b8 40 68 00 mv r13,r2 ssize_t rc; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8011140: 28 82 00 00 lw r2,(r4+0) 8011144: 54 41 00 02 bgu r2,r1,801114c 8011148: e0 00 00 0c bi 8011178 iop = rtems_libio_iop( fd ); 801114c: 78 0b 08 01 mvhi r11,0x801 8011150: 34 02 00 06 mvi r2,6 8011154: 39 6b 36 a0 ori r11,r11,0x36a0 8011158: 5b 83 00 14 sw (sp+20),r3 801115c: fb ff fd 52 calli 80106a4 <__ashlsi3> 8011160: 29 6b 00 00 lw r11,(r11+0) rtems_libio_check_is_open( iop ); 8011164: 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 ); 8011168: b5 61 58 00 add r11,r11,r1 rtems_libio_check_is_open( iop ); 801116c: 29 61 00 18 lw r1,(r11+24) 8011170: 20 22 01 00 andi r2,r1,0x100 8011174: 5c 40 00 04 bne r2,r0,8011184 8011178: fb ff e8 48 calli 800b298 <__errno> 801117c: 34 02 00 09 mvi r2,9 8011180: e0 00 00 08 bi 80111a0 rtems_libio_check_buffer( buffer ); 8011184: 45 a0 00 05 be r13,r0,8011198 <== NEVER TAKEN rtems_libio_check_count( count ); 8011188: 34 0c 00 00 mvi r12,0 801118c: 44 60 00 19 be r3,r0,80111f0 rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); 8011190: 20 21 00 04 andi r1,r1,0x4 8011194: 5c 20 00 06 bne r1,r0,80111ac 8011198: fb ff e8 40 calli 800b298 <__errno> 801119c: 34 02 00 16 mvi r2,22 80111a0: 58 22 00 00 sw (r1+0),r2 80111a4: 34 0c ff ff mvi r12,-1 80111a8: e0 00 00 12 bi 80111f0 /* * Now process the write() request. */ rc = (*iop->pathinfo.handlers->write_h)( iop, buffer, count ); 80111ac: 29 61 00 24 lw r1,(r11+36) 80111b0: b9 a0 10 00 mv r2,r13 80111b4: 28 24 00 0c lw r4,(r1+12) 80111b8: b9 60 08 00 mv r1,r11 80111bc: d8 80 00 00 call r4 80111c0: b8 20 60 00 mv r12,r1 if ( rc > 0 ) 80111c4: 4c 01 00 0b bge r0,r1,80111f0 iop->offset += rc; 80111c8: 34 02 00 1f mvi r2,31 80111cc: fb ff fd 5d calli 8010740 <__ashrsi3> 80111d0: 29 62 00 14 lw r2,(r11+20) 80111d4: 29 64 00 10 lw r4,(r11+16) 80111d8: b5 82 10 00 add r2,r12,r2 80111dc: f5 82 18 00 cmpgu r3,r12,r2 80111e0: b4 24 08 00 add r1,r1,r4 80111e4: b4 61 08 00 add r1,r3,r1 80111e8: 59 61 00 10 sw (r11+16),r1 80111ec: 59 62 00 14 sw (r11+20),r2 return rc; } 80111f0: b9 80 08 00 mv r1,r12 80111f4: 2b 9d 00 04 lw ra,(sp+4) 80111f8: 2b 8b 00 10 lw r11,(sp+16) 80111fc: 2b 8c 00 0c lw r12,(sp+12) 8011200: 2b 8d 00 08 lw r13,(sp+8) 8011204: 37 9c 00 14 addi sp,sp,20 8011208: c3 a0 00 00 ret =============================================================================== 08003cec : ssize_t writev( int fd, const struct iovec *iov, int iovcnt ) { 8003cec: 37 9c ff e4 addi sp,sp,-28 8003cf0: 5b 8b 00 1c sw (sp+28),r11 8003cf4: 5b 8c 00 18 sw (sp+24),r12 8003cf8: 5b 8d 00 14 sw (sp+20),r13 8003cfc: 5b 8e 00 10 sw (sp+16),r14 8003d00: 5b 8f 00 0c sw (sp+12),r15 8003d04: 5b 90 00 08 sw (sp+8),r16 8003d08: 5b 9d 00 04 sw (sp+4),ra 8003d0c: b8 60 78 00 mv r15,r3 int bytes; rtems_libio_t *iop; ssize_t old; bool all_zeros; rtems_libio_check_fd( fd ); 8003d10: 78 03 08 01 mvhi r3,0x801 8003d14: 38 63 40 10 ori r3,r3,0x4010 ssize_t writev( int fd, const struct iovec *iov, int iovcnt ) { 8003d18: b8 40 68 00 mv r13,r2 int bytes; rtems_libio_t *iop; ssize_t old; bool all_zeros; rtems_libio_check_fd( fd ); 8003d1c: 28 62 00 00 lw r2,(r3+0) 8003d20: 54 41 00 02 bgu r2,r1,8003d28 8003d24: e0 00 00 0a bi 8003d4c iop = rtems_libio_iop( fd ); 8003d28: 78 0b 08 01 mvhi r11,0x801 8003d2c: 34 02 00 06 mvi r2,6 8003d30: 39 6b 46 a0 ori r11,r11,0x46a0 8003d34: f8 00 36 fe calli 801192c <__ashlsi3> 8003d38: 29 6c 00 00 lw r12,(r11+0) 8003d3c: b5 81 60 00 add r12,r12,r1 rtems_libio_check_is_open( iop ); 8003d40: 29 81 00 18 lw r1,(r12+24) 8003d44: 20 22 01 00 andi r2,r1,0x100 8003d48: 5c 40 00 04 bne r2,r0,8003d58 8003d4c: f8 00 21 46 calli 800c264 <__errno> 8003d50: 34 02 00 09 mvi r2,9 8003d54: e0 00 00 1c bi 8003dc4 rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); 8003d58: 20 21 00 04 andi r1,r1,0x4 8003d5c: 44 20 00 18 be r1,r0,8003dbc <== NEVER TAKEN /* * Argument validation on IO vector */ if ( !iov ) 8003d60: 45 a0 00 17 be r13,r0,8003dbc rtems_set_errno_and_return_minus_one( EINVAL ); if ( iovcnt <= 0 ) 8003d64: 49 e0 00 02 bg r15,r0,8003d6c 8003d68: e0 00 00 15 bi 8003dbc rtems_set_errno_and_return_minus_one( EINVAL ); if ( iovcnt > IOV_MAX ) 8003d6c: 34 01 04 00 mvi r1,1024 8003d70: 4c 2f 00 02 bge r1,r15,8003d78 <== ALWAYS TAKEN 8003d74: e0 00 00 12 bi 8003dbc <== NOT EXECUTED 8003d78: b9 a0 08 00 mv r1,r13 8003d7c: 34 02 00 01 mvi r2,1 8003d80: 34 04 00 00 mvi r4,0 8003d84: 34 03 00 00 mvi r3,0 8003d88: e0 00 00 02 bi 8003d90 if ( iov[v].iov_len ) all_zeros = false; /* check for wrap */ old = total; total += iov[v].iov_len; 8003d8c: b8 a0 18 00 mv r3,r5 /* * iov[v].iov_len cannot be less than 0 because size_t is unsigned. * So we only check for zero. */ if ( iov[v].iov_base == 0 ) 8003d90: 28 25 00 00 lw r5,(r1+0) 8003d94: 44 a0 00 0a be r5,r0,8003dbc rtems_set_errno_and_return_minus_one( EINVAL ); if ( iov[v].iov_len ) 8003d98: 28 25 00 04 lw r5,(r1+4) all_zeros = false; 8003d9c: 64 a6 00 00 cmpei r6,r5,0 /* check for wrap */ old = total; total += iov[v].iov_len; 8003da0: b4 65 28 00 add r5,r3,r5 */ if ( iov[v].iov_base == 0 ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( iov[v].iov_len ) all_zeros = false; 8003da4: c8 06 30 00 sub r6,r0,r6 8003da8: a0 46 10 00 and r2,r2,r6 /* check for wrap */ old = total; total += iov[v].iov_len; if ( total < old || total > SSIZE_MAX ) 8003dac: e8 65 18 00 cmpg r3,r3,r5 8003db0: 68 a6 7f ff cmpgi r6,r5,32767 8003db4: b8 c3 18 00 or r3,r6,r3 8003db8: 44 60 00 05 be r3,r0,8003dcc rtems_set_errno_and_return_minus_one( EINVAL ); 8003dbc: f8 00 21 2a calli 800c264 <__errno> 8003dc0: 34 02 00 16 mvi r2,22 8003dc4: 58 22 00 00 sw (r1+0),r2 8003dc8: e0 00 00 22 bi 8003e50 * this loop does that check as well and sets "all-zero" appropriately. * The variable "all_zero" is used as an early exit point before * entering the write loop. */ all_zeros = true; for ( old=0, total=0, v=0 ; v < iovcnt ; v++ ) { 8003dcc: 34 84 00 01 addi r4,r4,1 8003dd0: 34 21 00 08 addi r1,r1,8 8003dd4: 49 e4 ff ee bg r15,r4,8003d8c /* * A writev with all zeros is supposed to have no effect per OpenGroup. */ if ( all_zeros == true ) { return 0; 8003dd8: 34 0b 00 00 mvi r11,0 } /* * A writev with all zeros is supposed to have no effect per OpenGroup. */ if ( all_zeros == true ) { 8003ddc: 5c 40 00 1e bne r2,r0,8003e54 8003de0: 34 10 00 00 mvi r16,0 /* * Now process the writev(). */ for ( total=0, v=0 ; v < iovcnt ; v++ ) { /* all zero lengths has no effect */ if ( iov[v].iov_len == 0 ) 8003de4: 29 a3 00 04 lw r3,(r13+4) 8003de8: 44 60 00 16 be r3,r0,8003e40 <== NEVER TAKEN continue; bytes = (*iop->pathinfo.handlers->write_h)( 8003dec: 29 81 00 24 lw r1,(r12+36) 8003df0: 29 a2 00 00 lw r2,(r13+0) 8003df4: 28 24 00 0c lw r4,(r1+12) 8003df8: b9 80 08 00 mv r1,r12 8003dfc: d8 80 00 00 call r4 8003e00: b8 20 70 00 mv r14,r1 iop, iov[v].iov_base, iov[v].iov_len ); if ( bytes < 0 ) 8003e04: 48 01 00 13 bg r0,r1,8003e50 <== NEVER TAKEN return -1; if ( bytes > 0 ) { 8003e08: 44 20 00 0c be r1,r0,8003e38 <== NEVER TAKEN iop->offset += bytes; 8003e0c: 34 02 00 1f mvi r2,31 8003e10: f8 00 36 ee calli 80119c8 <__ashrsi3> 8003e14: 29 82 00 14 lw r2,(r12+20) 8003e18: 29 84 00 10 lw r4,(r12+16) total += bytes; 8003e1c: b5 6e 58 00 add r11,r11,r14 if ( bytes < 0 ) return -1; if ( bytes > 0 ) { iop->offset += bytes; 8003e20: b5 c2 10 00 add r2,r14,r2 8003e24: f5 c2 18 00 cmpgu r3,r14,r2 8003e28: b4 24 08 00 add r1,r1,r4 8003e2c: b4 61 08 00 add r1,r3,r1 8003e30: 59 81 00 10 sw (r12+16),r1 8003e34: 59 82 00 14 sw (r12+20),r2 total += bytes; } if (bytes != iov[ v ].iov_len) 8003e38: 29 a1 00 04 lw r1,(r13+4) 8003e3c: 5d c1 00 06 bne r14,r1,8003e54 <== NEVER TAKEN } /* * Now process the writev(). */ for ( total=0, v=0 ; v < iovcnt ; v++ ) { 8003e40: 36 10 00 01 addi r16,r16,1 8003e44: 35 ad 00 08 addi r13,r13,8 8003e48: 49 f0 ff e7 bg r15,r16,8003de4 8003e4c: e0 00 00 02 bi 8003e54 iov[v].iov_base, iov[v].iov_len ); if ( bytes < 0 ) return -1; 8003e50: 34 0b ff ff mvi r11,-1 if (bytes != iov[ v ].iov_len) break; } return total; } 8003e54: b9 60 08 00 mv r1,r11 8003e58: 2b 9d 00 04 lw ra,(sp+4) 8003e5c: 2b 8b 00 1c lw r11,(sp+28) 8003e60: 2b 8c 00 18 lw r12,(sp+24) 8003e64: 2b 8d 00 14 lw r13,(sp+20) 8003e68: 2b 8e 00 10 lw r14,(sp+16) 8003e6c: 2b 8f 00 0c lw r15,(sp+12) 8003e70: 2b 90 00 08 lw r16,(sp+8) 8003e74: 37 9c 00 1c addi sp,sp,28 8003e78: c3 a0 00 00 ret