=============================================================================== 08007010 : #define MAXSYMLINK 5 int IMFS_Set_handlers( rtems_filesystem_location_info_t *loc ) { 8007010: 37 9c ff f0 addi sp,sp,-16 8007014: 5b 8b 00 10 sw (sp+16),r11 8007018: 5b 8c 00 0c sw (sp+12),r12 800701c: 5b 8d 00 08 sw (sp+8),r13 8007020: 5b 9d 00 04 sw (sp+4),ra 8007024: 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; 8007028: 28 21 00 10 lw r1,(r1+16) switch( node->type ) { 800702c: 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; 8007030: 28 2c 00 34 lw r12,(r1+52) switch( node->type ) { 8007034: 29 61 00 00 lw r1,(r11+0) 8007038: 28 21 00 4c lw r1,(r1+76) 800703c: 34 21 ff ff addi r1,r1,-1 8007040: 54 22 00 14 bgu r1,r2,8007090 <== NEVER TAKEN 8007044: 78 0d 08 01 mvhi r13,0x801 8007048: 34 02 00 02 mvi r2,2 800704c: f8 00 26 04 calli 801085c <__ashlsi3> 8007050: 39 ad 1e 6c ori r13,r13,0x1e6c 8007054: b5 a1 08 00 add r1,r13,r1 8007058: 28 21 00 00 lw r1,(r1+0) 800705c: c0 20 00 00 b r1 case IMFS_DIRECTORY: loc->handlers = fs_info->directory_handlers; 8007060: 29 81 00 0c lw r1,(r12+12) 8007064: e0 00 00 0a bi 800708c break; case IMFS_DEVICE: loc->handlers = &IMFS_device_handlers; 8007068: 78 01 08 01 mvhi r1,0x801 800706c: 38 21 1e 98 ori r1,r1,0x1e98 8007070: e0 00 00 07 bi 800708c break; case IMFS_SYM_LINK: case IMFS_HARD_LINK: loc->handlers = &IMFS_link_handlers; 8007074: 78 01 08 01 mvhi r1,0x801 8007078: 38 21 1f 08 ori r1,r1,0x1f08 800707c: e0 00 00 04 bi 800708c break; case IMFS_LINEAR_FILE: loc->handlers = fs_info->memfile_handlers; break; case IMFS_MEMORY_FILE: loc->handlers = fs_info->memfile_handlers; 8007080: 29 81 00 08 lw r1,(r12+8) 8007084: e0 00 00 02 bi 800708c break; case IMFS_FIFO: loc->handlers = fs_info->fifo_handlers; 8007088: 29 81 00 10 lw r1,(r12+16) 800708c: 59 61 00 08 sw (r11+8),r1 break; } return 0; } 8007090: 34 01 00 00 mvi r1,0 8007094: 2b 9d 00 04 lw ra,(sp+4) 8007098: 2b 8b 00 10 lw r11,(sp+16) 800709c: 2b 8c 00 0c lw r12,(sp+12) 80070a0: 2b 8d 00 08 lw r13,(sp+8) 80070a4: 37 9c 00 10 addi sp,sp,16 80070a8: c3 a0 00 00 ret =============================================================================== 08006e88 : IMFS_jnode_types_t type, const char *name, mode_t mode, const IMFS_types_union *info ) { 8006e88: 37 9c ff e8 addi sp,sp,-24 8006e8c: 5b 8b 00 18 sw (sp+24),r11 8006e90: 5b 8c 00 14 sw (sp+20),r12 8006e94: 5b 8d 00 10 sw (sp+16),r13 8006e98: 5b 8e 00 0c sw (sp+12),r14 8006e9c: 5b 8f 00 08 sw (sp+8),r15 8006ea0: 5b 9d 00 04 sw (sp+4),ra /* * MUST have a parent node to call this routine. */ if ( parent_loc == NULL ) return NULL; 8006ea4: 34 0b 00 00 mvi r11,0 IMFS_jnode_types_t type, const char *name, mode_t mode, const IMFS_types_union *info ) { 8006ea8: b8 40 70 00 mv r14,r2 8006eac: b8 a0 60 00 mv r12,r5 8006eb0: 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 ) 8006eb4: 44 20 00 3e be r1,r0,8006fac <== NEVER TAKEN return NULL; parent = parent_loc->node_access; 8006eb8: 28 2f 00 00 lw r15,(r1+0) fs_info = parent_loc->mt_entry->fs_info; 8006ebc: 28 21 00 10 lw r1,(r1+16) 8006ec0: 28 2d 00 34 lw r13,(r1+52) /* * Reject creation of FIFOs if support is disabled. */ if ( type == IMFS_FIFO && 8006ec4: 34 01 00 07 mvi r1,7 8006ec8: 5d c1 00 05 bne r14,r1,8006edc 8006ecc: 29 a1 00 10 lw r1,(r13+16) 8006ed0: 78 05 08 01 mvhi r5,0x801 8006ed4: 38 a5 1d e8 ori r5,r5,0x1de8 8006ed8: 44 25 00 35 be r1,r5,8006fac return NULL; /* * Allocate filesystem node and fill in basic information */ node = IMFS_allocate_node( type, name, mode & ~rtems_filesystem_umask ); 8006edc: 78 05 08 01 mvhi r5,0x801 8006ee0: 38 a5 31 1c ori r5,r5,0x311c 8006ee4: 28 a1 00 00 lw r1,(r5+0) 8006ee8: 28 23 00 2c lw r3,(r1+44) 8006eec: b9 c0 08 00 mv r1,r14 8006ef0: a4 60 18 00 not r3,r3 8006ef4: a0 83 18 00 and r3,r4,r3 8006ef8: fb ff ff bd calli 8006dec 8006efc: b8 20 58 00 mv r11,r1 if ( !node ) 8006f00: 44 20 00 2b be r1,r0,8006fac return NULL; /* * Set the type specific information */ switch (type) { 8006f04: 35 c1 ff ff addi r1,r14,-1 8006f08: 34 02 00 06 mvi r2,6 8006f0c: 54 22 00 20 bgu r1,r2,8006f8c <== NEVER TAKEN 8006f10: 78 0e 08 01 mvhi r14,0x801 8006f14: 34 02 00 02 mvi r2,2 8006f18: f8 00 26 51 calli 801085c <__ashlsi3> 8006f1c: 39 ce 1e 50 ori r14,r14,0x1e50 8006f20: b5 c1 08 00 add r1,r14,r1 8006f24: 28 21 00 00 lw r1,(r1+0) 8006f28: c0 20 00 00 b r1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8006f2c: 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); 8006f30: 59 61 00 50 sw (r11+80),r1 case IMFS_DIRECTORY: rtems_chain_initialize_empty(&node->info.directory.Entries); 8006f34: 35 61 00 50 addi r1,r11,80 the_chain->permanent_null = NULL; 8006f38: 59 60 00 54 sw (r11+84),r0 the_chain->last = _Chain_Head(the_chain); 8006f3c: 59 61 00 58 sw (r11+88),r1 8006f40: e0 00 00 13 bi 8006f8c case IMFS_HARD_LINK: node->info.hard_link.link_node = info->hard_link.link_node; break; case IMFS_SYM_LINK: node->info.sym_link.name = info->sym_link.name; 8006f44: 29 81 00 00 lw r1,(r12+0) 8006f48: 59 61 00 50 sw (r11+80),r1 break; 8006f4c: e0 00 00 10 bi 8006f8c case IMFS_DEVICE: node->info.device.major = info->device.major; 8006f50: 29 81 00 00 lw r1,(r12+0) 8006f54: 59 61 00 50 sw (r11+80),r1 node->info.device.minor = info->device.minor; 8006f58: 29 81 00 04 lw r1,(r12+4) 8006f5c: 59 61 00 54 sw (r11+84),r1 break; 8006f60: e0 00 00 0b bi 8006f8c case IMFS_LINEAR_FILE: node->info.linearfile.size = 0; 8006f64: 59 60 00 50 sw (r11+80),r0 8006f68: 59 60 00 54 sw (r11+84),r0 node->info.linearfile.direct = 0; 8006f6c: 59 60 00 58 sw (r11+88),r0 case IMFS_MEMORY_FILE: node->info.file.size = 0; 8006f70: 59 60 00 50 sw (r11+80),r0 8006f74: 59 60 00 54 sw (r11+84),r0 node->info.file.indirect = 0; 8006f78: 59 60 00 58 sw (r11+88),r0 node->info.file.doubly_indirect = 0; 8006f7c: 59 60 00 5c sw (r11+92),r0 node->info.file.triply_indirect = 0; 8006f80: 59 60 00 60 sw (r11+96),r0 break; 8006f84: e0 00 00 02 bi 8006f8c case IMFS_FIFO: node->info.fifo.pipe = NULL; 8006f88: 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; 8006f8c: 29 a1 00 04 lw r1,(r13+4) /* * This node MUST have a parent, so put it in that directory list. */ node->Parent = parent; 8006f90: 59 6f 00 08 sw (r11+8),r15 8006f94: b9 60 10 00 mv r2,r11 node->st_ino = ++fs_info->ino_count; 8006f98: 34 21 00 01 addi r1,r1,1 8006f9c: 59 a1 00 04 sw (r13+4),r1 8006fa0: 59 61 00 38 sw (r11+56),r1 8006fa4: 35 e1 00 50 addi r1,r15,80 8006fa8: fb ff f1 66 calli 8003540 <_Chain_Append> rtems_chain_append( &parent->info.directory.Entries, &node->Node ); return node; } 8006fac: b9 60 08 00 mv r1,r11 8006fb0: 2b 9d 00 04 lw ra,(sp+4) 8006fb4: 2b 8b 00 18 lw r11,(sp+24) 8006fb8: 2b 8c 00 14 lw r12,(sp+20) 8006fbc: 2b 8d 00 10 lw r13,(sp+16) 8006fc0: 2b 8e 00 0c lw r14,(sp+12) 8006fc4: 2b 8f 00 08 lw r15,(sp+8) 8006fc8: 37 9c 00 18 addi sp,sp,24 8006fcc: c3 a0 00 00 ret =============================================================================== 08006fd0 : return node; } IMFS_jnode_t *IMFS_create_root_node(void) { 8006fd0: 37 9c ff fc addi sp,sp,-4 8006fd4: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *node; /* * Allocate filesystem node and fill in basic information */ node = IMFS_allocate_node( IMFS_DIRECTORY, "", (S_IFDIR | 0755) ); 8006fd8: 78 02 08 01 mvhi r2,0x801 8006fdc: 34 01 00 01 mvi r1,1 8006fe0: 38 42 1a e4 ori r2,r2,0x1ae4 8006fe4: 34 03 41 ed mvi r3,16877 8006fe8: fb ff ff 81 calli 8006dec if ( !node ) 8006fec: 44 20 00 06 be r1,r0,8007004 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8006ff0: 34 22 00 54 addi r2,r1,84 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8006ff4: 58 22 00 50 sw (r1+80),r2 /* * Set the type specific information * * NOTE: Root node is always a directory. */ rtems_chain_initialize_empty(&node->info.directory.Entries); 8006ff8: 34 22 00 50 addi r2,r1,80 the_chain->permanent_null = NULL; 8006ffc: 58 20 00 54 sw (r1+84),r0 the_chain->last = _Chain_Head(the_chain); 8007000: 58 22 00 58 sw (r1+88),r2 return node; } 8007004: 2b 9d 00 04 lw ra,(sp+4) 8007008: 37 9c 00 04 addi sp,sp,4 800700c: c3 a0 00 00 ret =============================================================================== 08007158 : const char *pathname, /* IN */ size_t pathnamelen, /* IN */ int flags, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { 8007158: 37 9c ff 80 addi sp,sp,-128 800715c: 5b 8b 00 44 sw (sp+68),r11 8007160: 5b 8c 00 40 sw (sp+64),r12 8007164: 5b 8d 00 3c sw (sp+60),r13 8007168: 5b 8e 00 38 sw (sp+56),r14 800716c: 5b 8f 00 34 sw (sp+52),r15 8007170: 5b 90 00 30 sw (sp+48),r16 8007174: 5b 91 00 2c sw (sp+44),r17 8007178: 5b 92 00 28 sw (sp+40),r18 800717c: 5b 93 00 24 sw (sp+36),r19 8007180: 5b 94 00 20 sw (sp+32),r20 8007184: 5b 95 00 1c sw (sp+28),r21 8007188: 5b 96 00 18 sw (sp+24),r22 800718c: 5b 97 00 14 sw (sp+20),r23 8007190: 5b 98 00 10 sw (sp+16),r24 8007194: 5b 99 00 0c sw (sp+12),r25 8007198: 5b 9b 00 08 sw (sp+8),fp 800719c: 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 ) 80071a0: 78 14 08 01 mvhi r20,0x801 const char *pathname, /* IN */ size_t pathnamelen, /* IN */ int flags, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { 80071a4: b8 20 90 00 mv r18,r1 80071a8: b8 40 78 00 mv r15,r2 80071ac: b8 60 88 00 mv r17,r3 80071b0: b8 80 58 00 mv r11,r4 /* * This was filled in by the caller and is valid in the * mount table. */ node = pathloc->node_access; 80071b4: 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; 80071b8: 34 0d 00 01 mvi r13,1 size_t pathnamelen, /* IN */ int flags, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { int i = 0; 80071bc: 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 ); 80071c0: 37 97 00 48 addi r23,sp,72 /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) if ( node->type == IMFS_DIRECTORY ) 80071c4: 34 16 00 01 mvi r22,1 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; switch( type ) { 80071c8: 34 1b 00 03 mvi fp,3 node = pathloc->node_access; if ( !node ) rtems_set_errno_and_return_minus_one( ENOTDIR ); } else if ( node->type == IMFS_SYM_LINK ) { 80071cc: 34 15 00 04 mvi r21,4 result = IMFS_evaluate_sym_link( pathloc, 0 ); node = pathloc->node_access; if ( result == -1 ) 80071d0: 34 19 ff ff mvi r25,-1 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; switch( type ) { 80071d4: 34 18 00 02 mvi r24,2 case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 80071d8: 3a 94 31 1c ori r20,r20,0x311c /* * Evaluate all tokens until we are done or an error occurs. */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { 80071dc: e0 00 00 6a bi 8007384 type = IMFS_get_token( &pathname[i], pathnamelen, token, &len ); 80071e0: b6 50 08 00 add r1,r18,r16 80071e4: b9 e0 10 00 mv r2,r15 80071e8: ba e0 18 00 mv r3,r23 80071ec: 37 84 00 80 addi r4,sp,128 80071f0: f8 00 02 2f calli 8007aac pathnamelen -= len; i += len; if ( !pathloc->node_access ) 80071f4: 29 6e 00 00 lw r14,(r11+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 ); 80071f8: b8 20 68 00 mv r13,r1 pathnamelen -= len; 80071fc: 2b 93 00 80 lw r19,(sp+128) i += len; if ( !pathloc->node_access ) 8007200: 45 c0 00 59 be r14,r0,8007364 <== 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 ) 8007204: 44 20 00 07 be r1,r0,8007220 if ( node->type == IMFS_DIRECTORY ) 8007208: 29 81 00 4c lw r1,(r12+76) 800720c: 5c 36 00 05 bne r1,r22,8007220 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 8007210: b9 60 08 00 mv r1,r11 8007214: 34 02 00 01 mvi r2,1 8007218: fb ff ff a5 calli 80070ac 800721c: 44 20 00 83 be r1,r0,8007428 */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { type = IMFS_get_token( &pathname[i], pathnamelen, token, &len ); pathnamelen -= len; 8007220: c9 f3 78 00 sub r15,r15,r19 i += len; 8007224: b6 13 80 00 add r16,r16,r19 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; 8007228: b9 c0 60 00 mv r12,r14 switch( type ) { 800722c: 45 bb 00 22 be r13,fp,80072b4 8007230: 45 b5 00 52 be r13,r21,8007378 8007234: 5d b8 00 54 bne r13,r24,8007384 case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 8007238: 2a 81 00 00 lw r1,(r20+0) 800723c: 28 21 00 18 lw r1,(r1+24) 8007240: 45 c1 00 51 be r14,r1,8007384 /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access) { 8007244: 29 64 00 10 lw r4,(r11+16) /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == 8007248: 28 81 00 1c lw r1,(r4+28) 800724c: 5d c1 00 15 bne r14,r1,80072a0 */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; /* Throw out the .. in this case */ } else { newloc = pathloc->mt_entry->mt_point_node; 8007250: 28 81 00 10 lw r1,(r4+16) 8007254: 28 82 00 14 lw r2,(r4+20) 8007258: 28 85 00 08 lw r5,(r4+8) 800725c: 28 83 00 0c lw r3,(r4+12) 8007260: 28 84 00 18 lw r4,(r4+24) 8007264: 5b 81 00 74 sw (sp+116),r1 *pathloc = newloc; 8007268: 59 61 00 08 sw (r11+8),r1 return (*pathloc->ops->evalpath_h)(&(pathname[i-len]), 800726c: ca 13 08 00 sub r1,r16,r19 */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; /* Throw out the .. in this case */ } else { newloc = pathloc->mt_entry->mt_point_node; 8007270: 5b 85 00 6c sw (sp+108),r5 8007274: 5b 82 00 78 sw (sp+120),r2 *pathloc = newloc; 8007278: 59 65 00 00 sw (r11+0),r5 800727c: 59 62 00 0c sw (r11+12),r2 return (*pathloc->ops->evalpath_h)(&(pathname[i-len]), 8007280: 28 45 00 00 lw r5,(r2+0) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; /* Throw out the .. in this case */ } else { newloc = pathloc->mt_entry->mt_point_node; 8007284: 5b 83 00 70 sw (sp+112),r3 8007288: 5b 84 00 7c sw (sp+124),r4 *pathloc = newloc; 800728c: 59 63 00 04 sw (r11+4),r3 8007290: 59 64 00 10 sw (r11+16),r4 return (*pathloc->ops->evalpath_h)(&(pathname[i-len]), 8007294: b6 41 08 00 add r1,r18,r1 8007298: b6 6f 10 00 add r2,r19,r15 800729c: e0 00 00 57 bi 80073f8 pathnamelen+len, flags,pathloc); } } else { if ( !node->Parent ) 80072a0: 29 cc 00 08 lw r12,(r14+8) 80072a4: 5d 80 00 33 bne r12,r0,8007370 rtems_set_errno_and_return_minus_one( ENOENT ); 80072a8: f8 00 10 55 calli 800b3fc <__errno> 80072ac: 58 2d 00 00 sw (r1+0),r13 80072b0: e0 00 00 61 bi 8007434 case IMFS_NAME: /* * If we are at a link follow it. */ if ( node->type == IMFS_HARD_LINK ) { 80072b4: 29 c1 00 4c lw r1,(r14+76) 80072b8: 5c 2d 00 07 bne r1,r13,80072d4 IMFS_evaluate_hard_link( pathloc, 0 ); 80072bc: b9 60 08 00 mv r1,r11 80072c0: 34 02 00 00 mvi r2,0 80072c4: fb ff ff 89 calli 80070e8 node = pathloc->node_access; 80072c8: 29 6c 00 00 lw r12,(r11+0) if ( !node ) 80072cc: 5d 80 00 0a bne r12,r0,80072f4 <== ALWAYS TAKEN 80072d0: e0 00 00 0b bi 80072fc <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOTDIR ); } else if ( node->type == IMFS_SYM_LINK ) { 80072d4: 5c 35 00 08 bne r1,r21,80072f4 result = IMFS_evaluate_sym_link( pathloc, 0 ); 80072d8: b9 60 08 00 mv r1,r11 80072dc: 34 02 00 00 mvi r2,0 80072e0: f8 00 00 6a calli 8007488 80072e4: b8 20 60 00 mv r12,r1 node = pathloc->node_access; 80072e8: 29 61 00 00 lw r1,(r11+0) if ( result == -1 ) 80072ec: 45 99 00 53 be r12,r25,8007438 <== NEVER TAKEN } else if ( node->type == IMFS_SYM_LINK ) { result = IMFS_evaluate_sym_link( pathloc, 0 ); node = pathloc->node_access; 80072f0: b8 20 60 00 mv r12,r1 /* * Only a directory can be decended into. */ if ( node->type != IMFS_DIRECTORY ) 80072f4: 29 81 00 4c lw r1,(r12+76) 80072f8: 44 36 00 04 be r1,r22,8007308 rtems_set_errno_and_return_minus_one( ENOTDIR ); 80072fc: f8 00 10 40 calli 800b3fc <__errno> 8007300: 34 02 00 14 mvi r2,20 8007304: e0 00 00 4b bi 8007430 /* * 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 ) { 8007308: 29 8e 00 5c lw r14,(r12+92) 800730c: 45 c0 00 11 be r14,r0,8007350 newloc = node->info.directory.mt_fs->mt_fs_root; 8007310: 29 c4 00 1c lw r4,(r14+28) 8007314: 29 c2 00 20 lw r2,(r14+32) 8007318: 29 c1 00 24 lw r1,(r14+36) 800731c: 29 c3 00 28 lw r3,(r14+40) 8007320: 29 c5 00 2c lw r5,(r14+44) 8007324: 5b 84 00 6c sw (sp+108),r4 8007328: 5b 82 00 70 sw (sp+112),r2 800732c: 5b 81 00 74 sw (sp+116),r1 8007330: 5b 83 00 78 sw (sp+120),r3 8007334: 5b 85 00 7c sw (sp+124),r5 *pathloc = newloc; 8007338: 59 64 00 00 sw (r11+0),r4 800733c: 59 62 00 04 sw (r11+4),r2 8007340: 59 61 00 08 sw (r11+8),r1 8007344: 59 63 00 0c sw (r11+12),r3 8007348: 59 65 00 10 sw (r11+16),r5 800734c: e0 00 00 26 bi 80073e4 /* * Otherwise find the token name in the present location. */ node = IMFS_find_match_in_dir( node, token ); 8007350: b9 80 08 00 mv r1,r12 8007354: ba e0 10 00 mv r2,r23 8007358: f8 00 01 ad calli 8007a0c 800735c: b8 20 60 00 mv r12,r1 if ( !node ) 8007360: 5c 2e 00 04 bne r1,r14,8007370 rtems_set_errno_and_return_minus_one( ENOENT ); 8007364: f8 00 10 26 calli 800b3fc <__errno> 8007368: 34 02 00 02 mvi r2,2 800736c: e0 00 00 31 bi 8007430 /* * Set the node access to the point we have found. */ pathloc->node_access = node; 8007370: 59 6c 00 00 sw (r11+0),r12 8007374: e0 00 00 04 bi 8007384 case IMFS_NO_MORE_PATH: case IMFS_CURRENT_DIR: break; case IMFS_INVALID_TOKEN: rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); 8007378: f8 00 10 21 calli 800b3fc <__errno> 800737c: 34 02 00 5b mvi r2,91 8007380: e0 00 00 2c bi 8007430 /* * Evaluate all tokens until we are done or an error occurs. */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { 8007384: 7d a1 00 04 cmpnei r1,r13,4 8007388: 7d ad 00 00 cmpnei r13,r13,0 800738c: a0 2d 68 00 and r13,r1,r13 8007390: 5d a0 ff 94 bne r13,r0,80071e0 * 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 ) { 8007394: 29 82 00 4c lw r2,(r12+76) 8007398: 34 01 00 01 mvi r1,1 800739c: 5c 41 00 1c bne r2,r1,800740c if ( node->info.directory.mt_fs != NULL ) { 80073a0: 29 84 00 5c lw r4,(r12+92) 80073a4: 44 80 00 1a be r4,r0,800740c newloc = node->info.directory.mt_fs->mt_fs_root; 80073a8: 28 85 00 1c lw r5,(r4+28) 80073ac: 28 82 00 20 lw r2,(r4+32) 80073b0: 28 81 00 24 lw r1,(r4+36) 80073b4: 28 83 00 28 lw r3,(r4+40) 80073b8: 28 84 00 2c lw r4,(r4+44) 80073bc: 5b 85 00 6c sw (sp+108),r5 80073c0: 5b 82 00 70 sw (sp+112),r2 80073c4: 5b 81 00 74 sw (sp+116),r1 80073c8: 5b 83 00 78 sw (sp+120),r3 80073cc: 5b 84 00 7c sw (sp+124),r4 *pathloc = newloc; 80073d0: 59 65 00 00 sw (r11+0),r5 80073d4: 59 62 00 04 sw (r11+4),r2 80073d8: 59 61 00 08 sw (r11+8),r1 80073dc: 59 63 00 0c sw (r11+12),r3 80073e0: 59 64 00 10 sw (r11+16),r4 return (*pathloc->ops->evalpath_h)( &pathname[i-len], 80073e4: 2b 82 00 80 lw r2,(sp+128) 80073e8: 28 65 00 00 lw r5,(r3+0) 80073ec: ca 02 08 00 sub r1,r16,r2 80073f0: b6 41 08 00 add r1,r18,r1 80073f4: b5 e2 10 00 add r2,r15,r2 80073f8: ba 20 18 00 mv r3,r17 80073fc: b9 60 20 00 mv r4,r11 8007400: d8 a0 00 00 call r5 8007404: b8 20 60 00 mv r12,r1 8007408: e0 00 00 0c bi 8007438 flags, pathloc ); } else { result = IMFS_Set_handlers( pathloc ); } } else { result = IMFS_Set_handlers( pathloc ); 800740c: b9 60 08 00 mv r1,r11 8007410: fb ff ff 00 calli 8007010 8007414: b8 20 60 00 mv r12,r1 /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( pathloc, flags ) ) 8007418: ba 20 10 00 mv r2,r17 800741c: b9 60 08 00 mv r1,r11 8007420: fb ff ff 23 calli 80070ac 8007424: 5c 20 00 05 bne r1,r0,8007438 rtems_set_errno_and_return_minus_one( EACCES ); 8007428: f8 00 0f f5 calli 800b3fc <__errno> 800742c: 34 02 00 0d mvi r2,13 8007430: 58 22 00 00 sw (r1+0),r2 8007434: 34 0c ff ff mvi r12,-1 return result; } 8007438: b9 80 08 00 mv r1,r12 800743c: 2b 9d 00 04 lw ra,(sp+4) 8007440: 2b 8b 00 44 lw r11,(sp+68) 8007444: 2b 8c 00 40 lw r12,(sp+64) 8007448: 2b 8d 00 3c lw r13,(sp+60) 800744c: 2b 8e 00 38 lw r14,(sp+56) 8007450: 2b 8f 00 34 lw r15,(sp+52) 8007454: 2b 90 00 30 lw r16,(sp+48) 8007458: 2b 91 00 2c lw r17,(sp+44) 800745c: 2b 92 00 28 lw r18,(sp+40) 8007460: 2b 93 00 24 lw r19,(sp+36) 8007464: 2b 94 00 20 lw r20,(sp+32) 8007468: 2b 95 00 1c lw r21,(sp+28) 800746c: 2b 96 00 18 lw r22,(sp+24) 8007470: 2b 97 00 14 lw r23,(sp+20) 8007474: 2b 98 00 10 lw r24,(sp+16) 8007478: 2b 99 00 0c lw r25,(sp+12) 800747c: 2b 9b 00 08 lw fp,(sp+8) 8007480: 37 9c 00 80 addi sp,sp,128 8007484: c3 a0 00 00 ret =============================================================================== 08007644 : int IMFS_evaluate_for_make( const char *path, /* IN */ rtems_filesystem_location_info_t *pathloc, /* IN/OUT */ const char **name /* OUT */ ) { 8007644: 37 9c ff 80 addi sp,sp,-128 8007648: 5b 8b 00 44 sw (sp+68),r11 800764c: 5b 8c 00 40 sw (sp+64),r12 8007650: 5b 8d 00 3c sw (sp+60),r13 8007654: 5b 8e 00 38 sw (sp+56),r14 8007658: 5b 8f 00 34 sw (sp+52),r15 800765c: 5b 90 00 30 sw (sp+48),r16 8007660: 5b 91 00 2c sw (sp+44),r17 8007664: 5b 92 00 28 sw (sp+40),r18 8007668: 5b 93 00 24 sw (sp+36),r19 800766c: 5b 94 00 20 sw (sp+32),r20 8007670: 5b 95 00 1c sw (sp+28),r21 8007674: 5b 96 00 18 sw (sp+24),r22 8007678: 5b 97 00 14 sw (sp+20),r23 800767c: 5b 98 00 10 sw (sp+16),r24 8007680: 5b 99 00 0c sw (sp+12),r25 8007684: 5b 9b 00 08 sw (sp+8),fp 8007688: 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 ) 800768c: 78 11 08 01 mvhi r17,0x801 int IMFS_evaluate_for_make( const char *path, /* IN */ rtems_filesystem_location_info_t *pathloc, /* IN/OUT */ const char **name /* OUT */ ) { 8007690: b8 20 80 00 mv r16,r1 8007694: b8 40 58 00 mv r11,r2 8007698: b8 60 90 00 mv r18,r3 /* * This was filled in by the caller and is valid in the * mount table. */ node = pathloc->node_access; 800769c: 28 4d 00 00 lw r13,(r2+0) /* * Get the path length. */ pathlen = strlen( path ); 80076a0: f8 00 14 03 calli 800c6ac 80076a4: b8 20 a0 00 mv r20,r1 const char *path, /* IN */ rtems_filesystem_location_info_t *pathloc, /* IN/OUT */ const char **name /* OUT */ ) { int i = 0; 80076a8: 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 ); 80076ac: 37 9b 00 48 addi fp,sp,72 /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) if ( node->type == IMFS_DIRECTORY ) 80076b0: 34 19 00 01 mvi r25,1 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; switch( type ) { 80076b4: 34 18 00 02 mvi r24,2 case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 80076b8: 3a 31 31 1c ori r17,r17,0x311c if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; switch( type ) { 80076bc: 34 17 00 03 mvi r23,3 result = IMFS_evaluate_link( pathloc, 0 ); if ( result == -1 ) return -1; } else if ( node->type == IMFS_SYM_LINK ) { 80076c0: 34 16 00 04 mvi r22,4 result = IMFS_evaluate_link( pathloc, 0 ); if ( result == -1 ) 80076c4: 34 15 ff ff mvi r21,-1 * Evaluate all tokens until we are done or an error occurs. */ while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); 80076c8: ba 80 10 00 mv r2,r20 80076cc: b6 0e 08 00 add r1,r16,r14 80076d0: bb 60 18 00 mv r3,fp 80076d4: 37 84 00 80 addi r4,sp,128 80076d8: f8 00 00 f5 calli 8007aac pathlen -= len; 80076dc: 2b 93 00 80 lw r19,(sp+128) i += len; if ( !pathloc->node_access ) 80076e0: 29 6f 00 00 lw r15,(r11+0) * Evaluate all tokens until we are done or an error occurs. */ while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); 80076e4: b8 20 60 00 mv r12,r1 pathlen -= len; 80076e8: ca 93 a0 00 sub r20,r20,r19 i += len; if ( !pathloc->node_access ) 80076ec: 45 e0 00 69 be r15,r0,8007890 <== NEVER TAKEN /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) 80076f0: 44 20 00 07 be r1,r0,800770c if ( node->type == IMFS_DIRECTORY ) 80076f4: 29 a1 00 4c lw r1,(r13+76) 80076f8: 5c 39 00 05 bne r1,r25,800770c if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 80076fc: b9 60 08 00 mv r1,r11 8007700: 34 02 00 01 mvi r2,1 8007704: fb ff fe 6a calli 80070ac 8007708: 44 20 00 75 be r1,r0,80078dc while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); pathlen -= len; i += len; 800770c: b5 d3 70 00 add r14,r14,r19 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; 8007710: b9 e0 68 00 mv r13,r15 switch( type ) { 8007714: 45 98 00 07 be r12,r24,8007730 8007718: 55 98 00 03 bgu r12,r24,8007724 800771c: 5d 80 ff eb bne r12,r0,80076c8 8007720: e0 00 00 4d bi 8007854 8007724: 45 97 00 1f be r12,r23,80077a0 8007728: 5d 96 ff e8 bne r12,r22,80076c8 <== NEVER TAKEN 800772c: e0 00 00 4d bi 8007860 case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 8007730: 2a 21 00 00 lw r1,(r17+0) 8007734: 28 21 00 18 lw r1,(r1+24) 8007738: 45 e1 ff e4 be r15,r1,80076c8 /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access){ 800773c: 29 64 00 10 lw r4,(r11+16) 8007740: 28 81 00 1c lw r1,(r4+28) 8007744: 5d e1 00 12 bne r15,r1,800778c if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; } else { newloc = pathloc->mt_entry->mt_point_node; 8007748: 28 85 00 08 lw r5,(r4+8) 800774c: 28 83 00 0c lw r3,(r4+12) 8007750: 28 81 00 10 lw r1,(r4+16) 8007754: 28 82 00 14 lw r2,(r4+20) 8007758: 28 84 00 18 lw r4,(r4+24) 800775c: 5b 85 00 6c sw (sp+108),r5 8007760: 5b 83 00 70 sw (sp+112),r3 8007764: 5b 81 00 74 sw (sp+116),r1 8007768: 5b 82 00 78 sw (sp+120),r2 800776c: 5b 84 00 7c sw (sp+124),r4 *pathloc = newloc; 8007770: 59 65 00 00 sw (r11+0),r5 8007774: 59 63 00 04 sw (r11+4),r3 8007778: 59 61 00 08 sw (r11+8),r1 800777c: 59 62 00 0c sw (r11+12),r2 8007780: 59 64 00 10 sw (r11+16),r4 return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); 8007784: c9 d3 70 00 sub r14,r14,r19 8007788: e0 00 00 25 bi 800781c } } else { if ( !node->Parent ) 800778c: 29 ed 00 08 lw r13,(r15+8) 8007790: 5d a0 00 2f bne r13,r0,800784c rtems_set_errno_and_return_minus_one( ENOENT ); 8007794: f8 00 0f 1a calli 800b3fc <__errno> 8007798: 58 2c 00 00 sw (r1+0),r12 800779c: e0 00 00 53 bi 80078e8 pathloc->node_access = node; break; case IMFS_NAME: if ( node->type == IMFS_HARD_LINK ) { 80077a0: 29 e1 00 4c lw r1,(r15+76) 80077a4: 44 37 00 02 be r1,r23,80077ac result = IMFS_evaluate_link( pathloc, 0 ); if ( result == -1 ) return -1; } else if ( node->type == IMFS_SYM_LINK ) { 80077a8: 5c 36 00 06 bne r1,r22,80077c0 result = IMFS_evaluate_link( pathloc, 0 ); 80077ac: b9 60 08 00 mv r1,r11 80077b0: 34 02 00 00 mvi r2,0 80077b4: fb ff ff 67 calli 8007550 80077b8: b8 20 60 00 mv r12,r1 if ( result == -1 ) 80077bc: 44 35 00 4c be r1,r21,80078ec <== NEVER TAKEN return -1; } node = pathloc->node_access; 80077c0: 29 64 00 00 lw r4,(r11+0) if ( !node ) 80077c4: 44 80 00 3f be r4,r0,80078c0 <== NEVER TAKEN /* * Only a directory can be decended into. */ if ( node->type != IMFS_DIRECTORY ) 80077c8: 28 81 00 4c lw r1,(r4+76) 80077cc: 5c 39 00 3d bne r1,r25,80078c0 /* * 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 ) { 80077d0: 28 8c 00 5c lw r12,(r4+92) 80077d4: 45 80 00 19 be r12,r0,8007838 newloc = node->info.directory.mt_fs->mt_fs_root; 80077d8: 29 81 00 24 lw r1,(r12+36) 80077dc: 29 84 00 1c lw r4,(r12+28) 80077e0: 29 83 00 20 lw r3,(r12+32) 80077e4: 29 82 00 28 lw r2,(r12+40) 80077e8: 29 85 00 2c lw r5,(r12+44) 80077ec: 5b 81 00 74 sw (sp+116),r1 *pathloc = newloc; 80077f0: 59 61 00 08 sw (r11+8),r1 return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); 80077f4: 2b 81 00 80 lw r1,(sp+128) * If we are at a node that is a mount point. Set loc to the * new fs root node and let them finish evaluating the path. */ if ( node->info.directory.mt_fs != NULL ) { newloc = node->info.directory.mt_fs->mt_fs_root; 80077f8: 5b 84 00 6c sw (sp+108),r4 80077fc: 5b 83 00 70 sw (sp+112),r3 8007800: 5b 82 00 78 sw (sp+120),r2 8007804: 5b 85 00 7c sw (sp+124),r5 *pathloc = newloc; 8007808: 59 64 00 00 sw (r11+0),r4 800780c: 59 63 00 04 sw (r11+4),r3 8007810: 59 62 00 0c sw (r11+12),r2 8007814: 59 65 00 10 sw (r11+16),r5 return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); 8007818: c9 c1 70 00 sub r14,r14,r1 800781c: 28 44 00 04 lw r4,(r2+4) 8007820: b6 0e 08 00 add r1,r16,r14 8007824: b9 60 10 00 mv r2,r11 8007828: ba 40 18 00 mv r3,r18 800782c: d8 80 00 00 call r4 8007830: b8 20 60 00 mv r12,r1 8007834: e0 00 00 2e bi 80078ec /* * Otherwise find the token name in the present location. */ node = IMFS_find_match_in_dir( node, token ); 8007838: b8 80 08 00 mv r1,r4 800783c: bb 60 10 00 mv r2,fp 8007840: f8 00 00 73 calli 8007a0c 8007844: b8 20 68 00 mv r13,r1 /* * If there is no node we have found the name of the node we * wish to create. */ if ( ! node ) 8007848: 44 2c 00 09 be r1,r12,800786c done = true; else pathloc->node_access = node; 800784c: 59 6d 00 00 sw (r11+0),r13 8007850: e3 ff ff 9e bi 80076c8 break; case IMFS_NO_MORE_PATH: rtems_set_errno_and_return_minus_one( EEXIST ); 8007854: f8 00 0e ea calli 800b3fc <__errno> 8007858: 34 02 00 11 mvi r2,17 800785c: e0 00 00 22 bi 80078e4 break; case IMFS_INVALID_TOKEN: rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); 8007860: f8 00 0e e7 calli 800b3fc <__errno> 8007864: 34 02 00 5b mvi r2,91 8007868: e0 00 00 1f bi 80078e4 case IMFS_CURRENT_DIR: break; } } *name = &path[ i - len ]; 800786c: 2b 81 00 80 lw r1,(sp+128) 8007870: c9 c1 08 00 sub r1,r14,r1 8007874: b6 01 08 00 add r1,r16,r1 8007878: 5a 41 00 00 sw (r18+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( 800787c: b6 0e 70 00 add r14,r16,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++) { 8007880: e0 00 00 07 bi 800789c if ( !IMFS_is_separator( path[ i ] ) ) 8007884: fb ff ea e1 calli 8002408 8007888: 35 ce 00 01 addi r14,r14,1 800788c: 5c 20 00 04 bne r1,r0,800789c rtems_set_errno_and_return_minus_one( ENOENT ); 8007890: f8 00 0e db calli 800b3fc <__errno> 8007894: 34 02 00 02 mvi r2,2 8007898: e0 00 00 13 bi 80078e4 /* * 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++) { 800789c: 41 c1 00 00 lbu r1,(r14+0) 80078a0: 5c 20 ff f9 bne r1,r0,8007884 /* * Verify we can execute and write to this directory. */ result = IMFS_Set_handlers( pathloc ); 80078a4: b9 60 08 00 mv r1,r11 80078a8: fb ff fd da calli 8007010 80078ac: b8 20 60 00 mv r12,r1 /* * The returned node must be a directory */ node = pathloc->node_access; if ( node->type != IMFS_DIRECTORY ) 80078b0: 29 61 00 00 lw r1,(r11+0) 80078b4: 28 22 00 4c lw r2,(r1+76) 80078b8: 34 01 00 01 mvi r1,1 80078bc: 44 41 00 04 be r2,r1,80078cc <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOTDIR ); 80078c0: f8 00 0e cf calli 800b3fc <__errno> 80078c4: 34 02 00 14 mvi r2,20 80078c8: e0 00 00 07 bi 80078e4 /* * We must have Write and execute permission on the returned node. */ if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) ) 80078cc: b9 60 08 00 mv r1,r11 80078d0: 34 02 00 03 mvi r2,3 80078d4: fb ff fd f6 calli 80070ac 80078d8: 5c 20 00 05 bne r1,r0,80078ec rtems_set_errno_and_return_minus_one( EACCES ); 80078dc: f8 00 0e c8 calli 800b3fc <__errno> 80078e0: 34 02 00 0d mvi r2,13 80078e4: 58 22 00 00 sw (r1+0),r2 80078e8: 34 0c ff ff mvi r12,-1 return result; } 80078ec: b9 80 08 00 mv r1,r12 80078f0: 2b 9d 00 04 lw ra,(sp+4) 80078f4: 2b 8b 00 44 lw r11,(sp+68) 80078f8: 2b 8c 00 40 lw r12,(sp+64) 80078fc: 2b 8d 00 3c lw r13,(sp+60) 8007900: 2b 8e 00 38 lw r14,(sp+56) 8007904: 2b 8f 00 34 lw r15,(sp+52) 8007908: 2b 90 00 30 lw r16,(sp+48) 800790c: 2b 91 00 2c lw r17,(sp+44) 8007910: 2b 92 00 28 lw r18,(sp+40) 8007914: 2b 93 00 24 lw r19,(sp+36) 8007918: 2b 94 00 20 lw r20,(sp+32) 800791c: 2b 95 00 1c lw r21,(sp+28) 8007920: 2b 96 00 18 lw r22,(sp+24) 8007924: 2b 97 00 14 lw r23,(sp+20) 8007928: 2b 98 00 10 lw r24,(sp+16) 800792c: 2b 99 00 0c lw r25,(sp+12) 8007930: 2b 9b 00 08 lw fp,(sp+8) 8007934: 37 9c 00 80 addi sp,sp,128 8007938: c3 a0 00 00 ret =============================================================================== 080070e8 : int IMFS_evaluate_hard_link( rtems_filesystem_location_info_t *node, /* IN/OUT */ int flags /* IN */ ) { 80070e8: 37 9c ff f4 addi sp,sp,-12 80070ec: 5b 8b 00 08 sw (sp+8),r11 80070f0: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *jnode = node->node_access; 80070f4: 28 23 00 00 lw r3,(r1+0) /* * Check for things that should never happen. */ if ( jnode->type != IMFS_HARD_LINK ) 80070f8: 34 04 00 03 mvi r4,3 int IMFS_evaluate_hard_link( rtems_filesystem_location_info_t *node, /* IN/OUT */ int flags /* IN */ ) { 80070fc: b8 20 58 00 mv r11,r1 /* * Check for things that should never happen. */ if ( jnode->type != IMFS_HARD_LINK ) 8007100: 28 65 00 4c lw r5,(r3+76) 8007104: 44 a4 00 03 be r5,r4,8007110 <== ALWAYS TAKEN rtems_fatal_error_occurred (0xABCD0000); 8007108: 78 01 ab cd mvhi r1,0xabcd <== NOT EXECUTED 800710c: fb ff f0 08 calli 800312c <== NOT EXECUTED /* * Set the hard link value and the handlers. */ node->node_access = jnode->info.hard_link.link_node; 8007110: 28 63 00 50 lw r3,(r3+80) 8007114: 58 23 00 00 sw (r1+0),r3 IMFS_Set_handlers( node ); 8007118: 5b 82 00 0c sw (sp+12),r2 800711c: fb ff ff bd calli 8007010 /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( node, flags ) ) 8007120: 2b 82 00 0c lw r2,(sp+12) 8007124: b9 60 08 00 mv r1,r11 8007128: fb ff ff e1 calli 80070ac rtems_set_errno_and_return_minus_one( EACCES ); return result; 800712c: 34 02 00 00 mvi r2,0 /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( node, flags ) ) 8007130: 5c 20 00 05 bne r1,r0,8007144 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EACCES ); 8007134: f8 00 10 b2 calli 800b3fc <__errno> <== NOT EXECUTED 8007138: 34 02 00 0d mvi r2,13 <== NOT EXECUTED 800713c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8007140: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED return result; } 8007144: b8 40 08 00 mv r1,r2 8007148: 2b 9d 00 04 lw ra,(sp+4) 800714c: 2b 8b 00 08 lw r11,(sp+8) 8007150: 37 9c 00 0c addi sp,sp,12 8007154: c3 a0 00 00 ret =============================================================================== 08007488 : int IMFS_evaluate_sym_link( rtems_filesystem_location_info_t *node, /* IN/OUT */ int flags /* IN */ ) { 8007488: 37 9c ff ec addi sp,sp,-20 800748c: 5b 8b 00 10 sw (sp+16),r11 8007490: 5b 8c 00 0c sw (sp+12),r12 8007494: 5b 8d 00 08 sw (sp+8),r13 8007498: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *jnode = node->node_access; 800749c: 28 2c 00 00 lw r12,(r1+0) int IMFS_evaluate_sym_link( rtems_filesystem_location_info_t *node, /* IN/OUT */ int flags /* IN */ ) { 80074a0: b8 40 68 00 mv r13,r2 80074a4: b8 20 58 00 mv r11,r1 /* * Check for things that should never happen. */ if ( jnode->type != IMFS_SYM_LINK ) 80074a8: 29 82 00 4c lw r2,(r12+76) 80074ac: 34 01 00 04 mvi r1,4 80074b0: 44 41 00 03 be r2,r1,80074bc <== ALWAYS TAKEN rtems_fatal_error_occurred (0xABCD0000); 80074b4: 78 01 ab cd mvhi r1,0xabcd <== NOT EXECUTED 80074b8: e0 00 00 04 bi 80074c8 <== NOT EXECUTED if ( !jnode->Parent ) 80074bc: 29 81 00 08 lw r1,(r12+8) 80074c0: 5c 20 00 03 bne r1,r0,80074cc <== ALWAYS TAKEN rtems_fatal_error_occurred( 0xBAD00000 ); 80074c4: 78 01 ba d0 mvhi r1,0xbad0 <== NOT EXECUTED 80074c8: fb ff ef 19 calli 800312c <== NOT EXECUTED /* * Move the node_access to either the symbolic links parent or * root depending on the symbolic links path. */ node->node_access = jnode->Parent; 80074cc: 59 61 00 00 sw (r11+0),r1 rtems_filesystem_get_sym_start_loc( 80074d0: 29 81 00 50 lw r1,(r12+80) 80074d4: 37 82 00 14 addi r2,sp,20 80074d8: b9 60 18 00 mv r3,r11 80074dc: f8 00 04 27 calli 8008578 /* * Use eval path to evaluate the path of the symbolic link. */ result = IMFS_eval_path( 80074e0: 29 81 00 50 lw r1,(r12+80) 80074e4: 2b 8c 00 14 lw r12,(sp+20) 80074e8: b4 2c 60 00 add r12,r1,r12 80074ec: b9 80 08 00 mv r1,r12 80074f0: f8 00 14 6f calli 800c6ac 80074f4: b8 20 10 00 mv r2,r1 80074f8: b9 a0 18 00 mv r3,r13 80074fc: b9 80 08 00 mv r1,r12 8007500: b9 60 20 00 mv r4,r11 8007504: fb ff ff 15 calli 8007158 8007508: b8 20 60 00 mv r12,r1 strlen( &jnode->info.sym_link.name[i] ), flags, node ); IMFS_Set_handlers( node ); 800750c: b9 60 08 00 mv r1,r11 8007510: fb ff fe c0 calli 8007010 /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( node, flags ) ) 8007514: b9 60 08 00 mv r1,r11 8007518: b9 a0 10 00 mv r2,r13 800751c: fb ff fe e4 calli 80070ac 8007520: 5c 20 00 05 bne r1,r0,8007534 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EACCES ); 8007524: f8 00 0f b6 calli 800b3fc <__errno> <== NOT EXECUTED 8007528: 34 02 00 0d mvi r2,13 <== NOT EXECUTED 800752c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8007530: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED return result; } 8007534: b9 80 08 00 mv r1,r12 8007538: 2b 9d 00 04 lw ra,(sp+4) 800753c: 2b 8b 00 10 lw r11,(sp+16) 8007540: 2b 8c 00 0c lw r12,(sp+12) 8007544: 2b 8d 00 08 lw r13,(sp+8) 8007548: 37 9c 00 14 addi sp,sp,20 800754c: c3 a0 00 00 ret =============================================================================== 080017c8 : } int IMFS_fifo_close( rtems_libio_t *iop ) { 80017c8: 37 9c ff f0 addi sp,sp,-16 80017cc: 5b 8b 00 10 sw (sp+16),r11 80017d0: 5b 8c 00 0c sw (sp+12),r12 80017d4: 5b 8d 00 08 sw (sp+8),r13 80017d8: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *jnode = iop->pathinfo.node_access; 80017dc: 28 2d 00 1c lw r13,(r1+28) } int IMFS_fifo_close( rtems_libio_t *iop ) { 80017e0: b8 20 60 00 mv r12,r1 IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = pipe_release(&JNODE2PIPE(jnode), iop); 80017e4: b9 80 10 00 mv r2,r12 80017e8: 35 a1 00 50 addi r1,r13,80 80017ec: f8 00 1f c8 calli 800970c 80017f0: b8 20 58 00 mv r11,r1 if (err == 0) { 80017f4: 5c 20 00 08 bne r1,r0,8001814 <== NEVER TAKEN iop->flags &= ~LIBIO_FLAGS_OPEN; 80017f8: 29 82 00 18 lw r2,(r12+24) 80017fc: 34 01 fe ff mvi r1,-257 8001800: a0 41 08 00 and r1,r2,r1 8001804: 59 81 00 18 sw (r12+24),r1 IMFS_check_node_remove(jnode); 8001808: b9 a0 08 00 mv r1,r13 800180c: f8 00 01 dd calli 8001f80 8001810: e0 00 00 06 bi 8001828 } IMFS_FIFO_RETURN(err); 8001814: 4c 20 00 05 bge r1,r0,8001828 <== NOT EXECUTED 8001818: c8 0b 58 00 sub r11,r0,r11 <== NOT EXECUTED 800181c: f8 00 2c ce calli 800cb54 <__errno> <== NOT EXECUTED 8001820: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED 8001824: 34 0b ff ff mvi r11,-1 <== NOT EXECUTED } 8001828: b9 60 08 00 mv r1,r11 800182c: 2b 9d 00 04 lw ra,(sp+4) 8001830: 2b 8b 00 10 lw r11,(sp+16) 8001834: 2b 8c 00 0c lw r12,(sp+12) 8001838: 2b 8d 00 08 lw r13,(sp+8) 800183c: 37 9c 00 10 addi sp,sp,16 8001840: c3 a0 00 00 ret =============================================================================== 080015fc : rtems_off64_t IMFS_fifo_lseek( rtems_libio_t *iop, rtems_off64_t offset, int whence ) { 80015fc: 37 9c ff f8 addi sp,sp,-8 8001600: 5b 8b 00 08 sw (sp+8),r11 8001604: 5b 9d 00 04 sw (sp+4),ra 8001608: b8 20 28 00 mv r5,r1 off_t err = pipe_lseek(LIBIO2PIPE(iop), offset, whence, iop); 800160c: 28 21 00 1c lw r1,(r1+28) 8001610: b8 60 10 00 mv r2,r3 8001614: b8 80 18 00 mv r3,r4 8001618: 28 21 00 50 lw r1,(r1+80) 800161c: b8 a0 20 00 mv r4,r5 8001620: f8 00 22 50 calli 8009f60 8001624: b8 20 58 00 mv r11,r1 IMFS_FIFO_RETURN(err); 8001628: 4c 20 00 07 bge r1,r0,8001644 <== NEVER TAKEN 800162c: f8 00 2d 4a calli 800cb54 <__errno> 8001630: c8 0b 58 00 sub r11,r0,r11 8001634: 58 2b 00 00 sw (r1+0),r11 8001638: 34 01 ff ff mvi r1,-1 800163c: 34 0b ff ff mvi r11,-1 8001640: e0 00 00 03 bi 800164c 8001644: 34 02 00 1f mvi r2,31 <== NOT EXECUTED 8001648: f8 00 66 b2 calli 801b110 <__ashrsi3> <== NOT EXECUTED } 800164c: b9 60 10 00 mv r2,r11 8001650: 2b 9d 00 04 lw ra,(sp+4) 8001654: 2b 8b 00 08 lw r11,(sp+8) 8001658: 37 9c 00 08 addi sp,sp,8 800165c: c3 a0 00 00 ret =============================================================================== 080016ec : ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 80016ec: 37 9c ff ec addi sp,sp,-20 80016f0: 5b 8b 00 0c sw (sp+12),r11 80016f4: 5b 8c 00 08 sw (sp+8),r12 80016f8: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *jnode = iop->pathinfo.node_access; 80016fc: 28 2c 00 1c lw r12,(r1+28) ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 8001700: b8 20 20 00 mv r4,r1 IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); 8001704: 29 81 00 50 lw r1,(r12+80) 8001708: f8 00 21 7e calli 8009d00 800170c: b8 20 58 00 mv r11,r1 if (err > 0) { 8001710: 4c 01 00 08 bge r0,r1,8001730 IMFS_mtime_ctime_update(jnode); 8001714: 37 81 00 10 addi r1,sp,16 8001718: 34 02 00 00 mvi r2,0 800171c: f8 00 04 a6 calli 80029b4 8001720: 2b 81 00 10 lw r1,(sp+16) 8001724: 59 81 00 44 sw (r12+68),r1 8001728: 59 81 00 48 sw (r12+72),r1 800172c: e0 00 00 06 bi 8001744 } IMFS_FIFO_RETURN(err); 8001730: 44 20 00 05 be r1,r0,8001744 <== NEVER TAKEN 8001734: c8 0b 58 00 sub r11,r0,r11 8001738: f8 00 2d 07 calli 800cb54 <__errno> 800173c: 58 2b 00 00 sw (r1+0),r11 8001740: 34 0b ff ff mvi r11,-1 } 8001744: b9 60 08 00 mv r1,r11 8001748: 2b 9d 00 04 lw ra,(sp+4) 800174c: 2b 8b 00 0c lw r11,(sp+12) 8001750: 2b 8c 00 08 lw r12,(sp+8) 8001754: 37 9c 00 14 addi sp,sp,20 8001758: c3 a0 00 00 ret =============================================================================== 08007a0c : IMFS_jnode_t *IMFS_find_match_in_dir( IMFS_jnode_t *directory, char *name ) { 8007a0c: 37 9c ff f0 addi sp,sp,-16 8007a10: 5b 8b 00 10 sw (sp+16),r11 8007a14: 5b 8c 00 0c sw (sp+12),r12 8007a18: 5b 8d 00 08 sw (sp+8),r13 8007a1c: 5b 9d 00 04 sw (sp+4),ra 8007a20: b8 20 58 00 mv r11,r1 8007a24: b8 40 68 00 mv r13,r2 #if defined(RTEMS_DEBUG) assert( directory ); assert( name ); #endif if ( !name ) 8007a28: 44 40 00 17 be r2,r0,8007a84 <== NEVER TAKEN return 0; if ( !directory ) 8007a2c: 44 20 00 19 be r1,r0,8007a90 <== NEVER TAKEN /* * Check for "." and ".." */ if ( !strcmp( name, dotname ) ) 8007a30: b8 40 08 00 mv r1,r2 8007a34: 78 02 08 01 mvhi r2,0x801 8007a38: 38 42 1e 88 ori r2,r2,0x1e88 8007a3c: f8 00 12 a5 calli 800c4d0 8007a40: 44 20 00 14 be r1,r0,8007a90 <== NEVER TAKEN return directory; if ( !strcmp( name, dotdotname ) ) 8007a44: 78 02 08 01 mvhi r2,0x801 8007a48: b9 a0 08 00 mv r1,r13 8007a4c: 38 42 1e 8c ori r2,r2,0x1e8c 8007a50: f8 00 12 a0 calli 800c4d0 8007a54: 5c 20 00 03 bne r1,r0,8007a60 <== ALWAYS TAKEN return directory->Parent; 8007a58: 29 6b 00 08 lw r11,(r11+8) <== NOT EXECUTED 8007a5c: e0 00 00 0d bi 8007a90 <== NOT EXECUTED the_chain = &directory->info.directory.Entries; for ( the_node = the_chain->first; 8007a60: 29 6c 00 50 lw r12,(r11+80) 8007a64: 35 6b 00 54 addi r11,r11,84 8007a68: e0 00 00 06 bi 8007a80 !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 ) ) 8007a6c: b9 a0 08 00 mv r1,r13 8007a70: 35 82 00 0c addi r2,r12,12 8007a74: f8 00 12 97 calli 800c4d0 8007a78: 44 20 00 05 be r1,r0,8007a8c 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 ) { 8007a7c: 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; 8007a80: 5d 8b ff fb bne r12,r11,8007a6c #if defined(RTEMS_DEBUG) assert( directory ); assert( name ); #endif if ( !name ) return 0; 8007a84: 34 0b 00 00 mvi r11,0 8007a88: e0 00 00 02 bi 8007a90 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; 8007a8c: b9 80 58 00 mv r11,r12 if ( !strcmp( name, the_jnode->name ) ) return the_jnode; } return 0; } 8007a90: b9 60 08 00 mv r1,r11 8007a94: 2b 9d 00 04 lw ra,(sp+4) 8007a98: 2b 8b 00 10 lw r11,(sp+16) 8007a9c: 2b 8c 00 0c lw r12,(sp+12) 8007aa0: 2b 8d 00 08 lw r13,(sp+8) 8007aa4: 37 9c 00 10 addi sp,sp,16 8007aa8: c3 a0 00 00 ret =============================================================================== 0800793c : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) int IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 800793c: 37 9c ff d8 addi sp,sp,-40 8007940: 5b 8b 00 14 sw (sp+20),r11 8007944: 5b 8c 00 10 sw (sp+16),r12 8007948: 5b 8d 00 0c sw (sp+12),r13 800794c: 5b 8e 00 08 sw (sp+8),r14 8007950: 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; 8007954: 28 2b 00 1c lw r11,(r1+28) loc = temp_mt_entry->mt_fs_root; 8007958: 28 25 00 20 lw r5,(r1+32) 800795c: 28 24 00 24 lw r4,(r1+36) 8007960: 28 23 00 28 lw r3,(r1+40) 8007964: 28 22 00 2c lw r2,(r1+44) 8007968: 5b 8b 00 18 sw (sp+24),r11 800796c: 5b 85 00 1c sw (sp+28),r5 8007970: 5b 84 00 20 sw (sp+32),r4 8007974: 5b 83 00 24 sw (sp+36),r3 8007978: 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; 800797c: 58 20 00 1c sw (r1+28),r0 do { next = jnode->Parent; loc.node_access = (void *)jnode; IMFS_Set_handlers( &loc ); 8007980: 37 8c 00 18 addi r12,sp,24 if ( jnode->type != IMFS_DIRECTORY ) { 8007984: 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 ); 8007988: b9 80 08 00 mv r1,r12 */ temp_mt_entry->mt_fs_root.node_access = NULL; do { next = jnode->Parent; 800798c: 29 6e 00 08 lw r14,(r11+8) loc.node_access = (void *)jnode; 8007990: 5b 8b 00 18 sw (sp+24),r11 IMFS_Set_handlers( &loc ); 8007994: fb ff fd 9f calli 8007010 if ( jnode->type != IMFS_DIRECTORY ) { 8007998: 29 61 00 4c lw r1,(r11+76) 800799c: 5c 2d 00 04 bne r1,r13,80079ac result = IMFS_unlink( NULL, &loc ); if (result != 0) return -1; jnode = next; } else if ( jnode_has_no_children( jnode ) ) { 80079a0: 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; 80079a4: 35 61 00 54 addi r1,r11,84 80079a8: 5c 41 00 06 bne r2,r1,80079c0 result = IMFS_unlink( NULL, &loc ); 80079ac: 34 01 00 00 mvi r1,0 80079b0: b9 80 10 00 mv r2,r12 80079b4: fb ff e4 e3 calli 8000d40 if (result != 0) 80079b8: 5c 20 00 0b bne r1,r0,80079e4 <== NEVER TAKEN return -1; jnode = next; 80079bc: b9 c0 58 00 mv r11,r14 } if ( jnode != NULL ) { 80079c0: 45 60 00 0b be r11,r0,80079ec if ( jnode->type == IMFS_DIRECTORY ) { 80079c4: 29 61 00 4c lw r1,(r11+76) 80079c8: 5c 2d ff f0 bne r1,r13,8007988 <== NEVER TAKEN if ( jnode_has_children( jnode ) ) 80079cc: 29 61 00 50 lw r1,(r11+80) 80079d0: 35 62 00 54 addi r2,r11,84 80079d4: 44 22 ff ed be r1,r2,8007988 jnode = jnode_get_first_child( jnode ); 80079d8: b8 20 58 00 mv r11,r1 } } } while (jnode != NULL); 80079dc: 5c 20 ff eb bne r1,r0,8007988 <== ALWAYS TAKEN 80079e0: e0 00 00 03 bi 80079ec <== NOT EXECUTED return -1; jnode = next; } else if ( jnode_has_no_children( jnode ) ) { result = IMFS_unlink( NULL, &loc ); if (result != 0) return -1; 80079e4: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 80079e8: e0 00 00 02 bi 80079f0 <== NOT EXECUTED jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); return 0; 80079ec: 34 01 00 00 mvi r1,0 } 80079f0: 2b 9d 00 04 lw ra,(sp+4) 80079f4: 2b 8b 00 14 lw r11,(sp+20) 80079f8: 2b 8c 00 10 lw r12,(sp+16) 80079fc: 2b 8d 00 0c lw r13,(sp+12) 8007a00: 2b 8e 00 08 lw r14,(sp+8) 8007a04: 37 9c 00 28 addi sp,sp,40 8007a08: c3 a0 00 00 ret =============================================================================== 08007aac : const char *path, int pathlen, char *token, int *token_len ) { 8007aac: 37 9c ff e0 addi sp,sp,-32 8007ab0: 5b 8b 00 20 sw (sp+32),r11 8007ab4: 5b 8c 00 1c sw (sp+28),r12 8007ab8: 5b 8d 00 18 sw (sp+24),r13 8007abc: 5b 8e 00 14 sw (sp+20),r14 8007ac0: 5b 8f 00 10 sw (sp+16),r15 8007ac4: 5b 90 00 0c sw (sp+12),r16 8007ac8: 5b 91 00 08 sw (sp+8),r17 8007acc: 5b 9d 00 04 sw (sp+4),ra register int i = 0; 8007ad0: 34 0b 00 00 mvi r11,0 const char *path, int pathlen, char *token, int *token_len ) { 8007ad4: b8 20 78 00 mv r15,r1 8007ad8: b8 40 70 00 mv r14,r2 8007adc: b8 60 68 00 mv r13,r3 8007ae0: b8 80 80 00 mv r16,r4 register char c; /* * Copy a name into token. (Remember NULL is a token.) */ c = path[i]; 8007ae4: 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 ) 8007ae8: 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) ) { 8007aec: e0 00 00 07 bi 8007b08 #include #include "imfs.h" #include IMFS_token_types IMFS_get_token( 8007af0: 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; 8007af4: 30 2c 00 00 sb (r1+0),r12 if ( i == IMFS_NAME_MAX ) 8007af8: 45 71 00 27 be r11,r17,8007b94 return IMFS_INVALID_TOKEN; if ( !IMFS_is_valid_name_char(c) ) type = IMFS_INVALID_TOKEN; c = path [++i]; 8007afc: 35 6b 00 01 addi r11,r11,1 #include #include "imfs.h" #include IMFS_token_types IMFS_get_token( 8007b00: 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]; 8007b04: 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) ) { 8007b08: b9 80 08 00 mv r1,r12 8007b0c: fb ff ea 3f calli 8002408 8007b10: 5c 20 00 03 bne r1,r0,8007b1c 8007b14: e9 cb 10 00 cmpg r2,r14,r11 8007b18: 5c 41 ff f6 bne r2,r1,8007af0 <== ALWAYS TAKEN /* * Copy a seperator into token. */ if ( i == 0 ) { 8007b1c: 5d 60 00 08 bne r11,r0,8007b3c token[i] = c; 8007b20: 31 ac 00 00 sb (r13+0),r12 if ( (token[i] != '\0') && pathlen ) { 8007b24: 7d ce 00 00 cmpnei r14,r14,0 8007b28: 7d 8c 00 00 cmpnei r12,r12,0 8007b2c: a1 8e 60 00 and r12,r12,r14 8007b30: 5d 8b 00 09 bne r12,r11,8007b54 i++; type = IMFS_CURRENT_DIR; } else { type = IMFS_NO_MORE_PATH; 8007b34: 34 0c 00 00 mvi r12,0 8007b38: e0 00 00 09 bi 8007b5c } } else if (token[ i-1 ] != '\0') { 8007b3c: b5 ab 08 00 add r1,r13,r11 8007b40: 40 22 ff ff lbu r2,(r1+-1) char *token, int *token_len ) { register int i = 0; IMFS_token_types type = IMFS_NAME; 8007b44: 34 0c 00 03 mvi r12,3 i++; type = IMFS_CURRENT_DIR; } else { type = IMFS_NO_MORE_PATH; } } else if (token[ i-1 ] != '\0') { 8007b48: 44 40 00 05 be r2,r0,8007b5c <== NEVER TAKEN token[i] = '\0'; 8007b4c: 30 20 00 00 sb (r1+0),r0 8007b50: e0 00 00 03 bi 8007b5c if ( i == 0 ) { token[i] = c; if ( (token[i] != '\0') && pathlen ) { i++; type = IMFS_CURRENT_DIR; 8007b54: 34 0c 00 01 mvi r12,1 if ( i == 0 ) { token[i] = c; if ( (token[i] != '\0') && pathlen ) { i++; 8007b58: 34 0b 00 01 mvi r11,1 /* * Set token_len to the number of characters copied. */ *token_len = i; 8007b5c: 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 ) { 8007b60: 34 01 00 03 mvi r1,3 8007b64: 5d 81 00 11 bne r12,r1,8007ba8 if ( strcmp( token, "..") == 0 ) 8007b68: 78 02 08 01 mvhi r2,0x801 8007b6c: b9 a0 08 00 mv r1,r13 8007b70: 38 42 1e 90 ori r2,r2,0x1e90 8007b74: f8 00 12 57 calli 800c4d0 8007b78: 44 20 00 09 be r1,r0,8007b9c type = IMFS_UP_DIR; else if ( strcmp( token, "." ) == 0 ) 8007b7c: 78 02 08 01 mvhi r2,0x801 8007b80: b9 a0 08 00 mv r1,r13 8007b84: 38 42 1e 94 ori r2,r2,0x1e94 8007b88: f8 00 12 52 calli 800c4d0 8007b8c: 44 20 00 06 be r1,r0,8007ba4 8007b90: e0 00 00 06 bi 8007ba8 while ( (!IMFS_is_separator(c)) && (i < pathlen) && (i <= IMFS_NAME_MAX) ) { token[i] = c; if ( i == IMFS_NAME_MAX ) return IMFS_INVALID_TOKEN; 8007b94: 34 0c 00 04 mvi r12,4 8007b98: e0 00 00 04 bi 8007ba8 * it was a special name. */ if ( type == IMFS_NAME ) { if ( strcmp( token, "..") == 0 ) type = IMFS_UP_DIR; 8007b9c: 34 0c 00 02 mvi r12,2 8007ba0: e0 00 00 02 bi 8007ba8 else if ( strcmp( token, "." ) == 0 ) type = IMFS_CURRENT_DIR; 8007ba4: 34 0c 00 01 mvi r12,1 } return type; } 8007ba8: b9 80 08 00 mv r1,r12 8007bac: 2b 9d 00 04 lw ra,(sp+4) 8007bb0: 2b 8b 00 20 lw r11,(sp+32) 8007bb4: 2b 8c 00 1c lw r12,(sp+28) 8007bb8: 2b 8d 00 18 lw r13,(sp+24) 8007bbc: 2b 8e 00 14 lw r14,(sp+20) 8007bc0: 2b 8f 00 10 lw r15,(sp+16) 8007bc4: 2b 90 00 0c lw r16,(sp+12) 8007bc8: 2b 91 00 08 lw r17,(sp+8) 8007bcc: 37 9c 00 20 addi sp,sp,32 8007bd0: 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 80008d4: 44 2c 00 06 be r1,r12,80008ec 80008d8: 34 02 00 01 mvi r2,1 80008dc: 35 ad ff ff addi r13,r13,-1 80008e0: f8 00 3f df calli 801085c <__ashlsi3> 80008e4: 5d a0 ff fc bne r13,r0,80008d4 <== ALWAYS TAKEN is_valid = true; } } *dest_bytes_per_block = ((is_valid) ? requested_bytes_per_block : default_bytes_per_block); 80008e8: 34 0c 00 80 mvi r12,128 <== NOT EXECUTED for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { if (bit_mask == requested_bytes_per_block) { is_valid = true; } } *dest_bytes_per_block = ((is_valid) 80008ec: 78 01 08 01 mvhi r1,0x801 80008f0: 38 21 36 1c ori r1,r1,0x361c 80008f4: 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(); 80008f8: f8 00 19 b6 calli 8006fd0 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; 80008fc: 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(); 8000900: 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; 8000904: 38 42 1e 20 ori r2,r2,0x1e20 8000908: 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(); 800090c: b8 20 60 00 mv r12,r1 temp_mt_entry->mt_fs_root.handlers = directory_handlers; 8000910: 59 6e 00 24 sw (r11+36),r14 temp_mt_entry->mt_fs_root.ops = op_table; 8000914: 59 71 00 28 sw (r11+40),r17 temp_mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS; 8000918: 35 61 00 38 addi r1,r11,56 800091c: f8 00 2d 6e calli 800bed4 /* * Create custom file system data. */ fs_info = calloc( 1, sizeof( IMFS_fs_info_t ) ); 8000920: 34 02 00 14 mvi r2,20 8000924: 34 01 00 01 mvi r1,1 8000928: f8 00 01 fc calli 8001118 800092c: b8 20 10 00 mv r2,r1 if ( !fs_info ) { 8000930: 5c 20 00 08 bne r1,r0,8000950 <== ALWAYS TAKEN free(temp_mt_entry->mt_fs_root.node_access); 8000934: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8000938: f8 00 02 9d calli 80013ac <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOMEM); 800093c: f8 00 2a b0 calli 800b3fc <__errno> <== NOT EXECUTED 8000940: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8000944: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8000948: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800094c: e0 00 00 0f bi 8000988 <== NOT EXECUTED /* * Set st_ino for the root to 1. */ fs_info->instance = imfs_instance++; 8000950: 78 06 08 01 mvhi r6,0x801 8000954: 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; 8000958: 59 61 00 34 sw (r11+52),r1 /* * Set st_ino for the root to 1. */ fs_info->instance = imfs_instance++; 800095c: 28 c1 00 00 lw r1,(r6+0) fs_info->ino_count = 1; fs_info->memfile_handlers = memfile_handlers; 8000960: 58 50 00 08 sw (r2+8),r16 fs_info->directory_handlers = directory_handlers; 8000964: 58 4e 00 0c sw (r2+12),r14 /* * Set st_ino for the root to 1. */ fs_info->instance = imfs_instance++; 8000968: 58 41 00 00 sw (r2+0),r1 800096c: 34 21 00 01 addi r1,r1,1 8000970: 58 c1 00 00 sw (r6+0),r1 fs_info->ino_count = 1; 8000974: 34 01 00 01 mvi r1,1 8000978: 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; 800097c: 58 4f 00 10 sw (r2+16),r15 jnode = temp_mt_entry->mt_fs_root.node_access; jnode->st_ino = fs_info->ino_count; 8000980: 59 81 00 38 sw (r12+56),r1 return 0; 8000984: 34 01 00 00 mvi r1,0 } 8000988: 2b 9d 00 04 lw ra,(sp+4) 800098c: 2b 8b 00 20 lw r11,(sp+32) 8000990: 2b 8c 00 1c lw r12,(sp+28) 8000994: 2b 8d 00 18 lw r13,(sp+24) 8000998: 2b 8e 00 14 lw r14,(sp+20) 800099c: 2b 8f 00 10 lw r15,(sp+16) 80009a0: 2b 90 00 0c lw r16,(sp+12) 80009a4: 2b 91 00 08 lw r17,(sp+8) 80009a8: 37 9c 00 20 addi sp,sp,32 80009ac: c3 a0 00 00 ret =============================================================================== 080009b0 : int IMFS_link( rtems_filesystem_location_info_t *to_loc, /* IN */ rtems_filesystem_location_info_t *parent_loc, /* IN */ const char *token /* IN */ ) { 80009b0: 37 9c ff a8 addi sp,sp,-88 80009b4: 5b 8b 00 10 sw (sp+16),r11 80009b8: 5b 8c 00 0c sw (sp+12),r12 80009bc: 5b 8d 00 08 sw (sp+8),r13 80009c0: 5b 9d 00 04 sw (sp+4),ra 80009c4: b8 60 60 00 mv r12,r3 int i; /* * Verify this node can be linked to. */ info.hard_link.link_node = to_loc->node_access; 80009c8: 28 23 00 00 lw r3,(r1+0) int IMFS_link( rtems_filesystem_location_info_t *to_loc, /* IN */ rtems_filesystem_location_info_t *parent_loc, /* IN */ const char *token /* IN */ ) { 80009cc: b8 40 68 00 mv r13,r2 /* * Verify this node can be linked to. */ info.hard_link.link_node = to_loc->node_access; if ( info.hard_link.link_node->st_nlink >= LINK_MAX ) 80009d0: 34 02 00 07 mvi r2,7 80009d4: 2c 61 00 34 lhu r1,(r3+52) int i; /* * Verify this node can be linked to. */ info.hard_link.link_node = to_loc->node_access; 80009d8: 5b 83 00 38 sw (sp+56),r3 if ( info.hard_link.link_node->st_nlink >= LINK_MAX ) 80009dc: 50 41 00 04 bgeu r2,r1,80009ec rtems_set_errno_and_return_minus_one( EMLINK ); 80009e0: f8 00 2a 87 calli 800b3fc <__errno> 80009e4: 34 02 00 1f mvi r2,31 80009e8: e0 00 00 12 bi 8000a30 /* * Remove any separators at the end of the string. */ IMFS_get_token( token, strlen( token ), new_name, &i ); 80009ec: b9 80 08 00 mv r1,r12 80009f0: f8 00 2f 2f calli 800c6ac 80009f4: 37 8b 00 14 addi r11,sp,20 80009f8: b8 20 10 00 mv r2,r1 80009fc: b9 60 18 00 mv r3,r11 8000a00: 37 84 00 58 addi r4,sp,88 8000a04: b9 80 08 00 mv r1,r12 8000a08: f8 00 1c 29 calli 8007aac * was ONLY passed a NULL when we created the root node. We * added a new IMFS_create_root_node() so this path no longer * existed. The result was simpler code which should not have * this path. */ new_node = IMFS_create_node( 8000a0c: b9 a0 08 00 mv r1,r13 8000a10: 34 02 00 03 mvi r2,3 8000a14: b9 60 18 00 mv r3,r11 8000a18: 38 04 a1 ff mvu r4,0xa1ff 8000a1c: 37 85 00 38 addi r5,sp,56 8000a20: f8 00 19 1a calli 8006e88 new_name, ( S_IFLNK | ( S_IRWXU | S_IRWXG | S_IRWXO )), &info ); if ( !new_node ) 8000a24: 5c 20 00 06 bne r1,r0,8000a3c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOMEM ); 8000a28: f8 00 2a 75 calli 800b3fc <__errno> <== NOT EXECUTED 8000a2c: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8000a30: 58 22 00 00 sw (r1+0),r2 8000a34: 34 01 ff ff mvi r1,-1 8000a38: e0 00 00 0c bi 8000a68 /* * Increment the link count of the node being pointed to. */ info.hard_link.link_node->st_nlink++; 8000a3c: 2b 81 00 38 lw r1,(sp+56) 8000a40: 2c 22 00 34 lhu r2,(r1+52) 8000a44: 34 42 00 01 addi r2,r2,1 8000a48: 0c 22 00 34 sh (r1+52),r2 IMFS_update_ctime( info.hard_link.link_node ); 8000a4c: 34 02 00 00 mvi r2,0 8000a50: 37 81 00 50 addi r1,sp,80 8000a54: f8 00 02 84 calli 8001464 8000a58: 2b 81 00 38 lw r1,(sp+56) 8000a5c: 2b 82 00 50 lw r2,(sp+80) 8000a60: 58 22 00 48 sw (r1+72),r2 return 0; 8000a64: 34 01 00 00 mvi r1,0 } 8000a68: 2b 9d 00 04 lw ra,(sp+4) 8000a6c: 2b 8b 00 10 lw r11,(sp+16) 8000a70: 2b 8c 00 0c lw r12,(sp+12) 8000a74: 2b 8d 00 08 lw r13,(sp+8) 8000a78: 37 9c 00 58 addi sp,sp,88 8000a7c: c3 a0 00 00 ret =============================================================================== 08009ecc : MEMFILE_STATIC int IMFS_memfile_addblock( IMFS_jnode_t *the_jnode, unsigned int block ) { 8009ecc: 37 9c ff f4 addi sp,sp,-12 8009ed0: 5b 8b 00 0c sw (sp+12),r11 8009ed4: 5b 8c 00 08 sw (sp+8),r12 8009ed8: 5b 9d 00 04 sw (sp+4),ra #if defined(RTEMS_DEBUG) assert( the_jnode ); assert( the_jnode->type == IMFS_MEMORY_FILE ); #endif block_entry_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 1 ); 8009edc: 34 03 00 01 mvi r3,1 8009ee0: fb ff fe bd calli 80099d4 if ( *block_entry_ptr ) 8009ee4: 28 2c 00 00 lw r12,(r1+0) #if defined(RTEMS_DEBUG) assert( the_jnode ); assert( the_jnode->type == IMFS_MEMORY_FILE ); #endif block_entry_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 1 ); 8009ee8: b8 20 58 00 mv r11,r1 if ( *block_entry_ptr ) return 0; 8009eec: 34 02 00 00 mvi r2,0 assert( the_jnode ); assert( the_jnode->type == IMFS_MEMORY_FILE ); #endif block_entry_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 1 ); if ( *block_entry_ptr ) 8009ef0: 5d 80 00 06 bne r12,r0,8009f08 #if 0 fprintf(stdout, "%d %p", block, block_entry_ptr ); fflush(stdout); #endif memory = memfile_alloc_block(); 8009ef4: fb ff fe a8 calli 8009994 if ( !memory ) return 1; 8009ef8: 34 02 00 01 mvi r2,1 fprintf(stdout, "%d %p", block, block_entry_ptr ); fflush(stdout); #endif memory = memfile_alloc_block(); if ( !memory ) 8009efc: 44 2c 00 03 be r1,r12,8009f08 <== NEVER TAKEN return 1; *block_entry_ptr = memory; 8009f00: 59 61 00 00 sw (r11+0),r1 return 0; 8009f04: 34 02 00 00 mvi r2,0 } 8009f08: b8 40 08 00 mv r1,r2 8009f0c: 2b 9d 00 04 lw ra,(sp+4) 8009f10: 2b 8b 00 0c lw r11,(sp+12) 8009f14: 2b 8c 00 08 lw r12,(sp+8) 8009f18: 37 9c 00 0c addi sp,sp,12 8009f1c: c3 a0 00 00 ret =============================================================================== 0800a160 : MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, off_t new_length ) { 800a160: 37 9c ff e0 addi sp,sp,-32 800a164: 5b 8b 00 20 sw (sp+32),r11 800a168: 5b 8c 00 1c sw (sp+28),r12 800a16c: 5b 8d 00 18 sw (sp+24),r13 800a170: 5b 8e 00 14 sw (sp+20),r14 800a174: 5b 8f 00 10 sw (sp+16),r15 800a178: 5b 90 00 0c sw (sp+12),r16 800a17c: 5b 91 00 08 sw (sp+8),r17 800a180: 5b 9d 00 04 sw (sp+4),ra 800a184: b8 20 60 00 mv r12,r1 #if defined(RTEMS_DEBUG) assert( the_jnode ); assert( the_jnode->type == IMFS_MEMORY_FILE ); #endif if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 800a188: 78 01 08 01 mvhi r1,0x801 800a18c: 38 21 36 1c ori r1,r1,0x361c 800a190: 28 2b 00 00 lw r11,(r1+0) MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, off_t new_length ) { 800a194: b8 40 68 00 mv r13,r2 #if defined(RTEMS_DEBUG) assert( the_jnode ); assert( the_jnode->type == IMFS_MEMORY_FILE ); #endif if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 800a198: 34 02 00 02 mvi r2,2 800a19c: b9 60 08 00 mv r1,r11 800a1a0: f8 00 19 fd calli 8010994 <__lshrsi3> 800a1a4: b8 20 70 00 mv r14,r1 800a1a8: b9 c0 10 00 mv r2,r14 800a1ac: 34 21 00 01 addi r1,r1,1 800a1b0: f8 00 1a 20 calli 8010a30 <__mulsi3> 800a1b4: b9 c0 10 00 mv r2,r14 800a1b8: 34 21 00 01 addi r1,r1,1 800a1bc: f8 00 1a 1d calli 8010a30 <__mulsi3> 800a1c0: 34 21 ff ff addi r1,r1,-1 800a1c4: b9 60 10 00 mv r2,r11 800a1c8: f8 00 1a 1a calli 8010a30 <__mulsi3> 800a1cc: 54 2d 00 04 bgu r1,r13,800a1dc rtems_set_errno_and_return_minus_one( EINVAL ); 800a1d0: f8 00 04 8b calli 800b3fc <__errno> 800a1d4: 34 02 00 16 mvi r2,22 800a1d8: e0 00 00 26 bi 800a270 if ( new_length <= the_jnode->info.file.size ) 800a1dc: b9 a0 08 00 mv r1,r13 800a1e0: 34 02 00 1f mvi r2,31 800a1e4: f8 00 19 c5 calli 80108f8 <__ashrsi3> 800a1e8: 29 8f 00 50 lw r15,(r12+80) 800a1ec: b8 20 70 00 mv r14,r1 800a1f0: 29 90 00 54 lw r16,(r12+84) 800a1f4: 48 2f 00 04 bg r1,r15,800a204 <== NEVER TAKEN 800a1f8: 5c 2f 00 25 bne r1,r15,800a28c <== NEVER TAKEN 800a1fc: 55 b0 00 02 bgu r13,r16,800a204 800a200: e0 00 00 23 bi 800a28c /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; 800a204: b9 60 10 00 mv r2,r11 800a208: b9 a0 08 00 mv r1,r13 800a20c: f8 00 1a 15 calli 8010a60 <__divsi3> old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 800a210: 34 02 00 1f mvi r2,31 /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; 800a214: b8 20 88 00 mv r17,r1 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 800a218: b9 60 08 00 mv r1,r11 800a21c: f8 00 19 b7 calli 80108f8 <__ashrsi3> 800a220: b8 20 18 00 mv r3,r1 800a224: b9 60 20 00 mv r4,r11 800a228: b9 e0 08 00 mv r1,r15 800a22c: ba 00 10 00 mv r2,r16 800a230: f8 00 13 c1 calli 800f134 <__divdi3> 800a234: b8 40 78 00 mv r15,r2 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { 800a238: b8 40 58 00 mv r11,r2 800a23c: e0 00 00 11 bi 800a280 if ( IMFS_memfile_addblock( the_jnode, block ) ) { 800a240: b9 80 08 00 mv r1,r12 800a244: b9 60 10 00 mv r2,r11 800a248: fb ff ff 21 calli 8009ecc 800a24c: 44 20 00 0c be r1,r0,800a27c <== ALWAYS TAKEN 800a250: e0 00 00 05 bi 800a264 <== NOT EXECUTED for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); 800a254: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 800a258: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 800a25c: fb ff ff b4 calli 800a12c <== NOT EXECUTED * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { if ( IMFS_memfile_addblock( the_jnode, block ) ) { for ( ; block>=old_blocks ; block-- ) { 800a260: 35 6b ff ff addi r11,r11,-1 <== NOT EXECUTED 800a264: 51 6f ff fc bgeu r11,r15,800a254 <== NOT EXECUTED IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); 800a268: f8 00 04 65 calli 800b3fc <__errno> <== NOT EXECUTED 800a26c: 34 02 00 1c mvi r2,28 <== NOT EXECUTED 800a270: 58 22 00 00 sw (r1+0),r2 800a274: 34 01 ff ff mvi r1,-1 800a278: e0 00 00 06 bi 800a290 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { 800a27c: 35 6b 00 01 addi r11,r11,1 800a280: 52 2b ff f0 bgeu r17,r11,800a240 /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; 800a284: 59 8e 00 50 sw (r12+80),r14 800a288: 59 8d 00 54 sw (r12+84),r13 if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( new_length <= the_jnode->info.file.size ) return 0; 800a28c: 34 01 00 00 mvi r1,0 * Set the new length of the file. */ the_jnode->info.file.size = new_length; return 0; } 800a290: 2b 9d 00 04 lw ra,(sp+4) 800a294: 2b 8b 00 20 lw r11,(sp+32) 800a298: 2b 8c 00 1c lw r12,(sp+28) 800a29c: 2b 8d 00 18 lw r13,(sp+24) 800a2a0: 2b 8e 00 14 lw r14,(sp+20) 800a2a4: 2b 8f 00 10 lw r15,(sp+16) 800a2a8: 2b 90 00 0c lw r16,(sp+12) 800a2ac: 2b 91 00 08 lw r17,(sp+8) 800a2b0: 37 9c 00 20 addi sp,sp,32 800a2b4: c3 a0 00 00 ret =============================================================================== 080099d4 : #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 80099d4: 37 9c ff e0 addi sp,sp,-32 80099d8: 5b 8b 00 20 sw (sp+32),r11 80099dc: 5b 8c 00 1c sw (sp+28),r12 80099e0: 5b 8d 00 18 sw (sp+24),r13 80099e4: 5b 8e 00 14 sw (sp+20),r14 80099e8: 5b 8f 00 10 sw (sp+16),r15 80099ec: 5b 90 00 0c sw (sp+12),r16 80099f0: 5b 91 00 08 sw (sp+8),r17 80099f4: 5b 9d 00 04 sw (sp+4),ra 80099f8: b8 20 68 00 mv r13,r1 /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 80099fc: 78 01 08 01 mvhi r1,0x801 8009a00: 38 21 36 1c ori r1,r1,0x361c 8009a04: 28 21 00 00 lw r1,(r1+0) #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 8009a08: b8 40 70 00 mv r14,r2 /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 8009a0c: 34 02 00 02 mvi r2,2 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 8009a10: b8 60 78 00 mv r15,r3 /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 8009a14: f8 00 1b e0 calli 8010994 <__lshrsi3> 8009a18: b8 20 60 00 mv r12,r1 8009a1c: 34 21 ff ff addi r1,r1,-1 8009a20: 55 c1 00 11 bgu r14,r1,8009a64 p = info->indirect; 8009a24: 29 ac 00 58 lw r12,(r13+88) if ( malloc_it ) { 8009a28: 45 e0 00 0b be r15,r0,8009a54 if ( !p ) { 8009a2c: 5d 80 00 05 bne r12,r0,8009a40 p = memfile_alloc_block(); 8009a30: fb ff ff d9 calli 8009994 if ( !p ) return 0; 8009a34: 34 0b 00 00 mvi r11,0 if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); if ( !p ) 8009a38: 44 2c 00 83 be r1,r12,8009c44 <== NEVER TAKEN return 0; info->indirect = p; 8009a3c: 59 a1 00 58 sw (r13+88),r1 } return &info->indirect[ my_block ]; 8009a40: b9 c0 08 00 mv r1,r14 8009a44: 34 02 00 02 mvi r2,2 8009a48: f8 00 1b 85 calli 801085c <__ashlsi3> 8009a4c: 29 ab 00 58 lw r11,(r13+88) 8009a50: e0 00 00 7c bi 8009c40 } if ( !p ) return 0; 8009a54: 34 0b 00 00 mvi r11,0 return &info->indirect[ my_block ]; 8009a58: b9 c0 08 00 mv r1,r14 info->indirect = p; } return &info->indirect[ my_block ]; } if ( !p ) 8009a5c: 5d 8b 00 66 bne r12,r11,8009bf4 <== ALWAYS TAKEN 8009a60: e0 00 00 79 bi 8009c44 <== NOT EXECUTED /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { 8009a64: 35 81 00 01 addi r1,r12,1 8009a68: b9 80 10 00 mv r2,r12 8009a6c: f8 00 1b f1 calli 8010a30 <__mulsi3> 8009a70: b8 20 80 00 mv r16,r1 8009a74: 34 21 ff ff addi r1,r1,-1 8009a78: 55 c1 00 2b bgu r14,r1,8009b24 #if 0 fprintf(stdout, "(d %d) ", block ); fflush(stdout); #endif my_block -= FIRST_DOUBLY_INDIRECT; 8009a7c: c9 cc 70 00 sub r14,r14,r12 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 8009a80: b9 80 10 00 mv r2,r12 8009a84: b9 c0 08 00 mv r1,r14 8009a88: f8 00 1c 5f calli 8010c04 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 8009a8c: b9 80 10 00 mv r2,r12 fflush(stdout); #endif my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 8009a90: b8 20 80 00 mv r16,r1 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 8009a94: b9 c0 08 00 mv r1,r14 8009a98: f8 00 1c 4b calli 8010bc4 <__udivsi3> 8009a9c: b8 20 70 00 mv r14,r1 p = info->doubly_indirect; 8009aa0: 29 ac 00 5c lw r12,(r13+92) if ( malloc_it ) { 8009aa4: 45 e0 00 17 be r15,r0,8009b00 if ( !p ) { 8009aa8: 5d 80 00 06 bne r12,r0,8009ac0 p = memfile_alloc_block(); 8009aac: fb ff ff ba calli 8009994 8009ab0: b8 20 60 00 mv r12,r1 if ( !p ) return 0; 8009ab4: 34 0b 00 00 mvi r11,0 p = info->doubly_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); if ( !p ) 8009ab8: 44 20 00 63 be r1,r0,8009c44 <== NEVER TAKEN return 0; info->doubly_indirect = p; 8009abc: 59 a1 00 5c sw (r13+92),r1 } p1 = (block_p *)p[ doubly ]; 8009ac0: b9 c0 08 00 mv r1,r14 8009ac4: 34 02 00 02 mvi r2,2 8009ac8: f8 00 1b 65 calli 801085c <__ashlsi3> 8009acc: b5 81 60 00 add r12,r12,r1 8009ad0: 29 8d 00 00 lw r13,(r12+0) if ( !p1 ) { 8009ad4: 5d a0 00 06 bne r13,r0,8009aec p1 = memfile_alloc_block(); 8009ad8: fb ff ff af calli 8009994 8009adc: b8 20 68 00 mv r13,r1 if ( !p1 ) return 0; 8009ae0: 34 0b 00 00 mvi r11,0 } p1 = (block_p *)p[ doubly ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) 8009ae4: 44 20 00 58 be r1,r0,8009c44 <== NEVER TAKEN return 0; p[ doubly ] = (block_p) p1; 8009ae8: 59 81 00 00 sw (r12+0),r1 } return (block_p *)&p1[ singly ]; 8009aec: ba 00 08 00 mv r1,r16 8009af0: 34 02 00 02 mvi r2,2 8009af4: f8 00 1b 5a calli 801085c <__ashlsi3> 8009af8: b5 a1 58 00 add r11,r13,r1 8009afc: e0 00 00 52 bi 8009c44 } if ( !p ) return 0; 8009b00: 34 0b 00 00 mvi r11,0 } return (block_p *)&p1[ singly ]; } if ( !p ) 8009b04: 45 8b 00 50 be r12,r11,8009c44 <== NEVER TAKEN return 0; p = (block_p *)p[ doubly ]; 8009b08: 34 02 00 02 mvi r2,2 8009b0c: f8 00 1b 54 calli 801085c <__ashlsi3> 8009b10: b5 81 08 00 add r1,r12,r1 8009b14: 28 2c 00 00 lw r12,(r1+0) #if 0 fprintf(stdout, "(d %d %d %d %d %p %p) ", block, my_block, doubly, singly, p, &p[singly] ); fflush(stdout); #endif return (block_p *)&p[ singly ]; 8009b18: ba 00 08 00 mv r1,r16 if ( !p ) return 0; p = (block_p *)p[ doubly ]; if ( !p ) 8009b1c: 5d 80 00 36 bne r12,r0,8009bf4 <== ALWAYS TAKEN 8009b20: e0 00 00 49 bi 8009c44 <== NOT EXECUTED #endif /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 8009b24: 36 01 00 01 addi r1,r16,1 8009b28: b9 80 10 00 mv r2,r12 8009b2c: f8 00 1b c1 calli 8010a30 <__mulsi3> 8009b30: 34 21 ff ff addi r1,r1,-1 /* * This means the requested block number is out of range. */ return 0; 8009b34: 34 0b 00 00 mvi r11,0 #endif /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 8009b38: 55 c1 00 43 bgu r14,r1,8009c44 <== NEVER TAKEN my_block -= FIRST_TRIPLY_INDIRECT; 8009b3c: c9 d0 70 00 sub r14,r14,r16 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 8009b40: b9 80 10 00 mv r2,r12 8009b44: b9 c0 08 00 mv r1,r14 8009b48: f8 00 1c 2f calli 8010c04 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 8009b4c: 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; 8009b50: b8 20 88 00 mv r17,r1 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 8009b54: b9 c0 08 00 mv r1,r14 8009b58: f8 00 1c 1b calli 8010bc4 <__udivsi3> triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 8009b5c: 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; 8009b60: b8 20 70 00 mv r14,r1 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 8009b64: f8 00 1c 18 calli 8010bc4 <__udivsi3> doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 8009b68: 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; 8009b6c: b8 20 80 00 mv r16,r1 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 8009b70: b9 c0 08 00 mv r1,r14 8009b74: f8 00 1c 24 calli 8010c04 <__umodsi3> 8009b78: b8 20 70 00 mv r14,r1 p = info->triply_indirect; 8009b7c: 29 ac 00 60 lw r12,(r13+96) if ( malloc_it ) { 8009b80: 45 e0 00 21 be r15,r0,8009c04 if ( !p ) { 8009b84: 5d 80 00 05 bne r12,r0,8009b98 p = memfile_alloc_block(); 8009b88: fb ff ff 83 calli 8009994 8009b8c: b8 20 60 00 mv r12,r1 if ( !p ) 8009b90: 44 20 00 2d be r1,r0,8009c44 <== NEVER TAKEN return 0; info->triply_indirect = p; 8009b94: 59 a1 00 60 sw (r13+96),r1 } p1 = (block_p *) p[ triply ]; 8009b98: ba 00 08 00 mv r1,r16 8009b9c: 34 02 00 02 mvi r2,2 8009ba0: f8 00 1b 2f calli 801085c <__ashlsi3> 8009ba4: b5 81 60 00 add r12,r12,r1 8009ba8: 29 8d 00 00 lw r13,(r12+0) if ( !p1 ) { 8009bac: 5d a0 00 06 bne r13,r0,8009bc4 p1 = memfile_alloc_block(); 8009bb0: fb ff ff 79 calli 8009994 8009bb4: b8 20 68 00 mv r13,r1 if ( !p1 ) return 0; 8009bb8: 34 0b 00 00 mvi r11,0 } p1 = (block_p *) p[ triply ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) 8009bbc: 44 20 00 22 be r1,r0,8009c44 <== NEVER TAKEN return 0; p[ triply ] = (block_p) p1; 8009bc0: 59 81 00 00 sw (r12+0),r1 } p2 = (block_p *)p1[ doubly ]; 8009bc4: b9 c0 08 00 mv r1,r14 8009bc8: 34 02 00 02 mvi r2,2 8009bcc: f8 00 1b 24 calli 801085c <__ashlsi3> 8009bd0: b5 a1 68 00 add r13,r13,r1 8009bd4: 29 ac 00 00 lw r12,(r13+0) if ( !p2 ) { 8009bd8: 5d 80 00 06 bne r12,r0,8009bf0 p2 = memfile_alloc_block(); 8009bdc: fb ff ff 6e calli 8009994 8009be0: b8 20 60 00 mv r12,r1 if ( !p2 ) return 0; 8009be4: 34 0b 00 00 mvi r11,0 } p2 = (block_p *)p1[ doubly ]; if ( !p2 ) { p2 = memfile_alloc_block(); if ( !p2 ) 8009be8: 44 20 00 17 be r1,r0,8009c44 <== NEVER TAKEN return 0; p1[ doubly ] = (block_p) p2; 8009bec: 59 a1 00 00 sw (r13+0),r1 } return (block_p *)&p2[ singly ]; 8009bf0: ba 20 08 00 mv r1,r17 8009bf4: 34 02 00 02 mvi r2,2 8009bf8: f8 00 1b 19 calli 801085c <__ashlsi3> 8009bfc: b5 81 58 00 add r11,r12,r1 8009c00: e0 00 00 11 bi 8009c44 } if ( !p ) 8009c04: 45 8b 00 10 be r12,r11,8009c44 <== NEVER TAKEN #if 0 fprintf(stdout, "(t %d %d %d %d %d) ", block, my_block, triply, doubly, singly ); fflush(stdout); #endif p1 = (block_p *) p[ triply ]; 8009c08: ba 00 08 00 mv r1,r16 8009c0c: 34 02 00 02 mvi r2,2 8009c10: f8 00 1b 13 calli 801085c <__ashlsi3> 8009c14: b5 81 08 00 add r1,r12,r1 8009c18: 28 2c 00 00 lw r12,(r1+0) if ( !p1 ) 8009c1c: 45 80 00 0a be r12,r0,8009c44 <== NEVER TAKEN return 0; p2 = (block_p *)p1[ doubly ]; 8009c20: 34 02 00 02 mvi r2,2 8009c24: b9 c0 08 00 mv r1,r14 8009c28: f8 00 1b 0d calli 801085c <__ashlsi3> 8009c2c: b5 81 60 00 add r12,r12,r1 if ( !p ) return 0; return (block_p *)&p2[ singly ]; 8009c30: 34 02 00 02 mvi r2,2 8009c34: ba 20 08 00 mv r1,r17 8009c38: f8 00 1b 09 calli 801085c <__ashlsi3> 8009c3c: 29 8b 00 00 lw r11,(r12+0) 8009c40: b5 61 58 00 add r11,r11,r1 /* * This means the requested block number is out of range. */ return 0; } 8009c44: b9 60 08 00 mv r1,r11 8009c48: 2b 9d 00 04 lw ra,(sp+4) 8009c4c: 2b 8b 00 20 lw r11,(sp+32) 8009c50: 2b 8c 00 1c lw r12,(sp+28) 8009c54: 2b 8d 00 18 lw r13,(sp+24) 8009c58: 2b 8e 00 14 lw r14,(sp+20) 8009c5c: 2b 8f 00 10 lw r15,(sp+16) 8009c60: 2b 90 00 0c lw r16,(sp+12) 8009c64: 2b 91 00 08 lw r17,(sp+8) 8009c68: 37 9c 00 20 addi sp,sp,32 8009c6c: c3 a0 00 00 ret =============================================================================== 08009c70 : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 8009c70: 37 9c ff d4 addi sp,sp,-44 8009c74: 5b 8b 00 24 sw (sp+36),r11 8009c78: 5b 8c 00 20 sw (sp+32),r12 8009c7c: 5b 8d 00 1c sw (sp+28),r13 8009c80: 5b 8e 00 18 sw (sp+24),r14 8009c84: 5b 8f 00 14 sw (sp+20),r15 8009c88: 5b 90 00 10 sw (sp+16),r16 8009c8c: 5b 91 00 0c sw (sp+12),r17 8009c90: 5b 92 00 08 sw (sp+8),r18 8009c94: 5b 9d 00 04 sw (sp+4),ra 8009c98: b8 20 60 00 mv r12,r1 8009c9c: b8 40 68 00 mv r13,r2 8009ca0: b8 60 80 00 mv r16,r3 8009ca4: b8 80 58 00 mv r11,r4 /* * Error checks on arguments */ if ( !dest ) 8009ca8: 44 60 00 02 be r3,r0,8009cb0 <== NEVER TAKEN /* * If there is nothing to read, then quick exit. */ my_length = length; if ( !my_length ) 8009cac: 5c 80 00 06 bne r4,r0,8009cc4 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 8009cb0: f8 00 05 d3 calli 800b3fc <__errno> <== NOT EXECUTED 8009cb4: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8009cb8: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8009cbc: 34 04 ff ff mvi r4,-1 <== NOT EXECUTED 8009cc0: e0 00 00 6b bi 8009e6c <== NOT EXECUTED /* * Linear files (as created from a tar file are easier to handle * than block files). */ if (the_jnode->type == IMFS_LINEAR_FILE) { 8009cc4: 28 22 00 4c lw r2,(r1+76) 8009cc8: 28 2f 00 50 lw r15,(r1+80) 8009ccc: 28 2e 00 54 lw r14,(r1+84) 8009cd0: 34 01 00 06 mvi r1,6 8009cd4: 5c 41 00 19 bne r2,r1,8009d38 unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) 8009cd8: 34 02 00 1f mvi r2,31 8009cdc: b9 a0 08 00 mv r1,r13 8009ce0: f8 00 1b 06 calli 80108f8 <__ashrsi3> 8009ce4: c9 cd 18 00 sub r3,r14,r13 8009ce8: f4 6e 10 00 cmpgu r2,r3,r14 8009cec: c9 e1 08 00 sub r1,r15,r1 8009cf0: c8 22 78 00 sub r15,r1,r2 * than block files). */ if (the_jnode->type == IMFS_LINEAR_FILE) { unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; 8009cf4: 29 91 00 58 lw r17,(r12+88) if (my_length > (the_jnode->info.linearfile.size - start)) 8009cf8: 48 0f 00 04 bg r0,r15,8009d08 <== NEVER TAKEN 8009cfc: 5c 0f 00 04 bne r0,r15,8009d0c <== NEVER TAKEN 8009d00: 55 63 00 02 bgu r11,r3,8009d08 <== ALWAYS TAKEN 8009d04: e0 00 00 02 bi 8009d0c <== NOT EXECUTED my_length = the_jnode->info.linearfile.size - start; 8009d08: c9 cd 58 00 sub r11,r14,r13 memcpy(dest, &file_ptr[start], my_length); 8009d0c: b6 2d 10 00 add r2,r17,r13 8009d10: b9 60 18 00 mv r3,r11 8009d14: ba 00 08 00 mv r1,r16 8009d18: f8 00 08 6f calli 800bed4 IMFS_update_atime( the_jnode ); 8009d1c: 37 81 00 28 addi r1,sp,40 8009d20: 34 02 00 00 mvi r2,0 8009d24: fb ff dd d0 calli 8001464 8009d28: 2b 81 00 28 lw r1,(sp+40) return my_length; 8009d2c: b9 60 20 00 mv r4,r11 if (my_length > (the_jnode->info.linearfile.size - start)) my_length = the_jnode->info.linearfile.size - start; memcpy(dest, &file_ptr[start], my_length); IMFS_update_atime( the_jnode ); 8009d30: 59 81 00 40 sw (r12+64),r1 return my_length; 8009d34: e0 00 00 4e bi 8009e6c /* * 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; 8009d38: b4 8d 08 00 add r1,r4,r13 if ( last_byte > the_jnode->info.file.size ) 8009d3c: 48 0f 00 04 bg r0,r15,8009d4c <== NEVER TAKEN 8009d40: 5d e0 00 04 bne r15,r0,8009d50 <== NEVER TAKEN 8009d44: 54 2e 00 02 bgu r1,r14,8009d4c 8009d48: e0 00 00 02 bi 8009d50 my_length = the_jnode->info.file.size - start; 8009d4c: c9 cd 58 00 sub r11,r14,r13 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 8009d50: 78 01 08 01 mvhi r1,0x801 8009d54: 38 21 36 1c ori r1,r1,0x361c 8009d58: 28 32 00 00 lw r18,(r1+0) 8009d5c: b9 a0 08 00 mv r1,r13 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { 8009d60: ba 00 78 00 mv r15,r16 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 8009d64: ba 40 10 00 mv r2,r18 8009d68: f8 00 1b 6e calli 8010b20 <__modsi3> 8009d6c: b8 20 88 00 mv r17,r1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 8009d70: ba 40 10 00 mv r2,r18 8009d74: b9 a0 08 00 mv r1,r13 8009d78: f8 00 1b 3a calli 8010a60 <__divsi3> 8009d7c: 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; 8009d80: 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 ) { 8009d84: 46 20 00 13 be r17,r0,8009dd0 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 ); 8009d88: b9 80 08 00 mv r1,r12 8009d8c: b9 c0 10 00 mv r2,r14 8009d90: 34 03 00 00 mvi r3,0 8009d94: fb ff ff 10 calli 80099d4 if ( !block_ptr ) return copied; 8009d98: 34 04 00 00 mvi r4,0 if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) 8009d9c: 44 20 00 34 be r1,r0,8009e6c <== NEVER TAKEN */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; 8009da0: ca 51 90 00 sub r18,r18,r17 8009da4: b9 60 68 00 mv r13,r11 8009da8: 52 4b 00 02 bgeu r18,r11,8009db0 8009dac: 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 ); 8009db0: 28 22 00 00 lw r2,(r1+0) 8009db4: b9 a0 18 00 mv r3,r13 8009db8: ba 00 08 00 mv r1,r16 8009dbc: b4 51 10 00 add r2,r2,r17 8009dc0: f8 00 08 45 calli 800bed4 dest += to_copy; 8009dc4: b6 0d 78 00 add r15,r16,r13 block++; 8009dc8: 35 ce 00 01 addi r14,r14,1 my_length -= to_copy; 8009dcc: c9 6d 58 00 sub r11,r11,r13 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 8009dd0: 78 01 08 01 mvhi r1,0x801 8009dd4: 38 21 36 1c ori r1,r1,0x361c 8009dd8: 28 30 00 00 lw r16,(r1+0) while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 8009ddc: b8 20 88 00 mv r17,r1 8009de0: e0 00 00 0f bi 8009e1c block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 8009de4: b9 c0 10 00 mv r2,r14 8009de8: b9 80 08 00 mv r1,r12 8009dec: 34 03 00 00 mvi r3,0 8009df0: fb ff fe f9 calli 80099d4 8009df4: b8 20 10 00 mv r2,r1 if ( !block_ptr ) 8009df8: 44 20 00 1c be r1,r0,8009e68 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 8009dfc: 28 42 00 00 lw r2,(r2+0) 8009e00: b9 e0 08 00 mv r1,r15 8009e04: ba 00 18 00 mv r3,r16 8009e08: f8 00 08 33 calli 800bed4 dest += to_copy; 8009e0c: b5 f0 78 00 add r15,r15,r16 block++; 8009e10: 35 ce 00 01 addi r14,r14,1 my_length -= to_copy; 8009e14: c9 70 58 00 sub r11,r11,r16 copied += to_copy; 8009e18: 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 ) { 8009e1c: 2a 21 00 00 lw r1,(r17+0) 8009e20: 51 61 ff f1 bgeu r11,r1,8009de4 #if defined(RTEMS_DEBUG) assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); #endif if ( my_length ) { 8009e24: 45 60 00 0c be r11,r0,8009e54 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 8009e28: b9 c0 10 00 mv r2,r14 8009e2c: b9 80 08 00 mv r1,r12 8009e30: 34 03 00 00 mvi r3,0 8009e34: fb ff fe e8 calli 80099d4 8009e38: b8 20 10 00 mv r2,r1 if ( !block_ptr ) 8009e3c: 44 20 00 0b be r1,r0,8009e68 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); 8009e40: 28 42 00 00 lw r2,(r2+0) 8009e44: b9 e0 08 00 mv r1,r15 8009e48: b9 60 18 00 mv r3,r11 8009e4c: f8 00 08 22 calli 800bed4 copied += my_length; 8009e50: b5 6d 68 00 add r13,r11,r13 } IMFS_update_atime( the_jnode ); 8009e54: 37 81 00 28 addi r1,sp,40 8009e58: 34 02 00 00 mvi r2,0 8009e5c: fb ff dd 82 calli 8001464 8009e60: 2b 81 00 28 lw r1,(sp+40) 8009e64: 59 81 00 40 sw (r12+64),r1 return copied; 8009e68: b9 a0 20 00 mv r4,r13 } 8009e6c: b8 80 08 00 mv r1,r4 8009e70: 2b 9d 00 04 lw ra,(sp+4) 8009e74: 2b 8b 00 24 lw r11,(sp+36) 8009e78: 2b 8c 00 20 lw r12,(sp+32) 8009e7c: 2b 8d 00 1c lw r13,(sp+28) 8009e80: 2b 8e 00 18 lw r14,(sp+24) 8009e84: 2b 8f 00 14 lw r15,(sp+20) 8009e88: 2b 90 00 10 lw r16,(sp+16) 8009e8c: 2b 91 00 0c lw r17,(sp+12) 8009e90: 2b 92 00 08 lw r18,(sp+8) 8009e94: 37 9c 00 2c addi sp,sp,44 8009e98: c3 a0 00 00 ret =============================================================================== 08009fc0 : */ int IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { 8009fc0: 37 9c ff e0 addi sp,sp,-32 8009fc4: 5b 8b 00 20 sw (sp+32),r11 8009fc8: 5b 8c 00 1c sw (sp+28),r12 8009fcc: 5b 8d 00 18 sw (sp+24),r13 8009fd0: 5b 8e 00 14 sw (sp+20),r14 8009fd4: 5b 8f 00 10 sw (sp+16),r15 8009fd8: 5b 90 00 0c sw (sp+12),r16 8009fdc: 5b 91 00 08 sw (sp+8),r17 8009fe0: 5b 9d 00 04 sw (sp+4),ra 8009fe4: 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; 8009fe8: 78 01 08 01 mvhi r1,0x801 8009fec: 38 21 36 1c ori r1,r1,0x361c 8009ff0: 28 21 00 00 lw r1,(r1+0) 8009ff4: 34 02 00 02 mvi r2,2 8009ff8: f8 00 1a 67 calli 8010994 <__lshrsi3> 8009ffc: b8 20 60 00 mv r12,r1 * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 800a000: 29 61 00 58 lw r1,(r11+88) 800a004: 44 20 00 04 be r1,r0,800a014 memfile_free_blocks_in_table( &info->indirect, to_free ); 800a008: 35 61 00 58 addi r1,r11,88 800a00c: b9 80 10 00 mv r2,r12 800a010: fb ff ff cf calli 8009f4c } if ( info->doubly_indirect ) { 800a014: 29 61 00 5c lw r1,(r11+92) 800a018: 44 20 00 15 be r1,r0,800a06c <== ALWAYS TAKEN for ( i=0 ; iindirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { 800a020: 34 0f 00 00 mvi r15,0 <== NOT EXECUTED 800a024: 34 0e 00 00 mvi r14,0 <== NOT EXECUTED for ( i=0 ; i <== NOT EXECUTED if ( info->doubly_indirect[i] ) { 800a030: 29 61 00 5c lw r1,(r11+92) <== NOT EXECUTED 800a034: b4 2f 08 00 add r1,r1,r15 <== NOT EXECUTED 800a038: 28 22 00 00 lw r2,(r1+0) <== NOT EXECUTED 800a03c: 44 40 00 03 be r2,r0,800a048 <== NOT EXECUTED memfile_free_blocks_in_table( 800a040: b9 80 10 00 mv r2,r12 <== NOT EXECUTED 800a044: fb ff ff c2 calli 8009f4c <== NOT EXECUTED memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; i <== NOT EXECUTED 800a05c: 54 2e ff f5 bgu r1,r14,800a030 <== NOT EXECUTED if ( info->doubly_indirect[i] ) { memfile_free_blocks_in_table( (block_p **)&info->doubly_indirect[i], to_free ); } } memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); 800a060: 35 61 00 5c addi r1,r11,92 <== NOT EXECUTED 800a064: b9 80 10 00 mv r2,r12 <== NOT EXECUTED 800a068: fb ff ff b9 calli 8009f4c <== NOT EXECUTED } if ( info->triply_indirect ) { 800a06c: 29 61 00 60 lw r1,(r11+96) 800a070: 44 20 00 24 be r1,r0,800a100 <== ALWAYS TAKEN for ( i=0 ; idoubly_indirect, to_free ); } if ( info->triply_indirect ) { 800a078: 34 0f 00 00 mvi r15,0 <== NOT EXECUTED 800a07c: 34 10 00 00 mvi r16,0 <== NOT EXECUTED for ( i=0 ; i <== NOT EXECUTED p = (block_p *) info->triply_indirect[i]; 800a088: 29 61 00 60 lw r1,(r11+96) <== NOT EXECUTED 800a08c: b4 2f 08 00 add r1,r1,r15 <== NOT EXECUTED 800a090: 28 2d 00 00 lw r13,(r1+0) <== NOT EXECUTED if ( !p ) /* ensure we have a valid pointer */ 800a094: 45 a0 00 18 be r13,r0,800a0f4 <== NOT EXECUTED 800a098: 34 11 00 00 mvi r17,0 <== NOT EXECUTED 800a09c: e0 00 00 08 bi 800a0bc <== NOT EXECUTED break; for ( j=0 ; j <== NOT EXECUTED memfile_free_blocks_in_table( (block_p **)&p[j], to_free); 800a0a8: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 800a0ac: b9 80 10 00 mv r2,r12 <== NOT EXECUTED 800a0b0: fb ff ff a7 calli 8009f4c <== NOT EXECUTED if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j <== NOT EXECUTED 800a0c8: 54 31 ff f6 bgu r1,r17,800a0a0 <== NOT EXECUTED if ( p[j] ) { memfile_free_blocks_in_table( (block_p **)&p[j], to_free); } } memfile_free_blocks_in_table( 800a0cc: 29 61 00 60 lw r1,(r11+96) <== NOT EXECUTED 800a0d0: b9 80 10 00 mv r2,r12 <== NOT EXECUTED memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i <== NOT EXECUTED memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i <== NOT EXECUTED 800a0f0: 54 30 ff e6 bgu r1,r16,800a088 <== NOT EXECUTED } } memfile_free_blocks_in_table( (block_p **)&info->triply_indirect[i], to_free ); } memfile_free_blocks_in_table( 800a0f4: 35 61 00 60 addi r1,r11,96 <== NOT EXECUTED 800a0f8: b9 80 10 00 mv r2,r12 <== NOT EXECUTED 800a0fc: fb ff ff 94 calli 8009f4c <== NOT EXECUTED (block_p **)&info->triply_indirect, to_free ); } return 0; } 800a100: 34 01 00 00 mvi r1,0 800a104: 2b 9d 00 04 lw ra,(sp+4) 800a108: 2b 8b 00 20 lw r11,(sp+32) 800a10c: 2b 8c 00 1c lw r12,(sp+28) 800a110: 2b 8d 00 18 lw r13,(sp+24) 800a114: 2b 8e 00 14 lw r14,(sp+20) 800a118: 2b 8f 00 10 lw r15,(sp+16) 800a11c: 2b 90 00 0c lw r16,(sp+12) 800a120: 2b 91 00 08 lw r17,(sp+8) 800a124: 37 9c 00 20 addi sp,sp,32 800a128: c3 a0 00 00 ret =============================================================================== 0800a12c : MEMFILE_STATIC int IMFS_memfile_remove_block( IMFS_jnode_t *the_jnode, unsigned int block ) { 800a12c: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 800a130: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED block_p *block_ptr; block_p ptr; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800a134: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 800a138: fb ff fe 27 calli 80099d4 <== NOT EXECUTED #if defined(RTEMS_DEBUG) assert( block_ptr ); #endif if ( block_ptr ) { 800a13c: 44 20 00 05 be r1,r0,800a150 <== NOT EXECUTED ptr = *block_ptr; 800a140: 28 22 00 00 lw r2,(r1+0) <== NOT EXECUTED *block_ptr = 0; 800a144: 58 20 00 00 sw (r1+0),r0 <== NOT EXECUTED memfile_free_block( ptr ); 800a148: b8 40 08 00 mv r1,r2 <== NOT EXECUTED 800a14c: fb ff ff 75 calli 8009f20 <== NOT EXECUTED } return 1; } 800a150: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 800a154: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800a158: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 800a15c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 0800a2b8 : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 800a2b8: 37 9c ff d0 addi sp,sp,-48 800a2bc: 5b 8b 00 28 sw (sp+40),r11 800a2c0: 5b 8c 00 24 sw (sp+36),r12 800a2c4: 5b 8d 00 20 sw (sp+32),r13 800a2c8: 5b 8e 00 1c sw (sp+28),r14 800a2cc: 5b 8f 00 18 sw (sp+24),r15 800a2d0: 5b 90 00 14 sw (sp+20),r16 800a2d4: 5b 91 00 10 sw (sp+16),r17 800a2d8: 5b 92 00 0c sw (sp+12),r18 800a2dc: 5b 93 00 08 sw (sp+8),r19 800a2e0: 5b 9d 00 04 sw (sp+4),ra 800a2e4: b8 20 60 00 mv r12,r1 800a2e8: b8 40 58 00 mv r11,r2 800a2ec: b8 60 88 00 mv r17,r3 800a2f0: b8 80 78 00 mv r15,r4 /* * Error check arguments */ if ( !source ) 800a2f4: 44 60 00 02 be r3,r0,800a2fc <== NEVER TAKEN /* * If there is nothing to write, then quick exit. */ my_length = length; if ( !my_length ) 800a2f8: 5c 80 00 04 bne r4,r0,800a308 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 800a2fc: f8 00 04 40 calli 800b3fc <__errno> <== NOT EXECUTED 800a300: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 800a304: e0 00 00 0d bi 800a338 <== NOT EXECUTED * If the last byte we are supposed to write is past the end of this * in memory file, then extend the length. */ last_byte = start + length; if ( last_byte > the_jnode->info.file.size ) { 800a308: 28 21 00 50 lw r1,(r1+80) /* * If the last byte we are supposed to write is past the end of this * in memory file, then extend the length. */ last_byte = start + length; 800a30c: b4 82 10 00 add r2,r4,r2 if ( last_byte > the_jnode->info.file.size ) { 800a310: 48 01 00 05 bg r0,r1,800a324 <== NEVER TAKEN 800a314: 5c 20 00 0c bne r1,r0,800a344 <== NEVER TAKEN 800a318: 29 81 00 54 lw r1,(r12+84) 800a31c: 54 41 00 02 bgu r2,r1,800a324 <== ALWAYS TAKEN 800a320: e0 00 00 09 bi 800a344 <== NOT EXECUTED status = IMFS_memfile_extend( the_jnode, last_byte ); 800a324: b9 80 08 00 mv r1,r12 800a328: fb ff ff 8e calli 800a160 if ( status ) 800a32c: 44 20 00 06 be r1,r0,800a344 rtems_set_errno_and_return_minus_one( ENOSPC ); 800a330: f8 00 04 33 calli 800b3fc <__errno> 800a334: 34 02 00 1c mvi r2,28 800a338: 58 22 00 00 sw (r1+0),r2 800a33c: 34 0b ff ff mvi r11,-1 800a340: e0 00 00 45 bi 800a454 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800a344: 78 01 08 01 mvhi r1,0x801 800a348: 38 21 36 1c ori r1,r1,0x361c 800a34c: 28 33 00 00 lw r19,(r1+0) 800a350: b9 60 08 00 mv r1,r11 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { 800a354: ba 20 80 00 mv r16,r17 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800a358: ba 60 10 00 mv r2,r19 800a35c: f8 00 19 f1 calli 8010b20 <__modsi3> 800a360: b8 20 90 00 mv r18,r1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 800a364: ba 60 10 00 mv r2,r19 800a368: b9 60 08 00 mv r1,r11 800a36c: f8 00 19 bd calli 8010a60 <__divsi3> 800a370: b8 20 70 00 mv r14,r1 if ( start_offset ) { 800a374: b9 e0 68 00 mv r13,r15 status = IMFS_memfile_extend( the_jnode, last_byte ); if ( status ) rtems_set_errno_and_return_minus_one( ENOSPC ); } copied = 0; 800a378: 34 0b 00 00 mvi r11,0 * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { 800a37c: 46 40 00 11 be r18,r0,800a3c0 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 ); 800a380: b9 80 08 00 mv r1,r12 800a384: b9 c0 10 00 mv r2,r14 800a388: 34 03 00 00 mvi r3,0 800a38c: fb ff fd 92 calli 80099d4 if ( !block_ptr ) 800a390: 44 20 00 31 be r1,r0,800a454 <== NEVER TAKEN */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; 800a394: ca 72 58 00 sub r11,r19,r18 800a398: 51 eb 00 02 bgeu r15,r11,800a3a0 800a39c: b9 e0 58 00 mv r11,r15 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); 800a3a0: 28 21 00 00 lw r1,(r1+0) 800a3a4: ba 20 10 00 mv r2,r17 800a3a8: b9 60 18 00 mv r3,r11 800a3ac: b4 32 08 00 add r1,r1,r18 800a3b0: f8 00 06 c9 calli 800bed4 src += to_copy; 800a3b4: b6 2b 80 00 add r16,r17,r11 block++; 800a3b8: 35 ce 00 01 addi r14,r14,1 my_length -= to_copy; 800a3bc: c9 eb 68 00 sub r13,r15,r11 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 800a3c0: 78 01 08 01 mvhi r1,0x801 800a3c4: 38 21 36 1c ori r1,r1,0x361c 800a3c8: 28 2f 00 00 lw r15,(r1+0) while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800a3cc: b8 20 88 00 mv r17,r1 800a3d0: e0 00 00 0e bi 800a408 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800a3d4: b9 80 08 00 mv r1,r12 800a3d8: b9 c0 10 00 mv r2,r14 800a3dc: 34 03 00 00 mvi r3,0 800a3e0: fb ff fd 7d calli 80099d4 if ( !block_ptr ) 800a3e4: 44 20 00 1c be r1,r0,800a454 <== 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 ); 800a3e8: 28 21 00 00 lw r1,(r1+0) 800a3ec: ba 00 10 00 mv r2,r16 800a3f0: b9 e0 18 00 mv r3,r15 800a3f4: f8 00 06 b8 calli 800bed4 src += to_copy; 800a3f8: b6 0f 80 00 add r16,r16,r15 block++; 800a3fc: 35 ce 00 01 addi r14,r14,1 my_length -= to_copy; 800a400: c9 af 68 00 sub r13,r13,r15 * * This routine writes the specified data buffer into the in memory * file pointed to by the_jnode. The file is extended as needed. */ MEMFILE_STATIC ssize_t IMFS_memfile_write( 800a404: b5 6f 58 00 add r11,r11,r15 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800a408: 2a 21 00 00 lw r1,(r17+0) 800a40c: 51 a1 ff f2 bgeu r13,r1,800a3d4 #if defined(RTEMS_DEBUG) assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); #endif to_copy = my_length; if ( my_length ) { 800a410: 45 a0 00 0b be r13,r0,800a43c block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800a414: b9 80 08 00 mv r1,r12 800a418: b9 c0 10 00 mv r2,r14 800a41c: 34 03 00 00 mvi r3,0 800a420: fb ff fd 6d calli 80099d4 if ( !block_ptr ) 800a424: 44 20 00 0c be r1,r0,800a454 <== 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 ); 800a428: 28 21 00 00 lw r1,(r1+0) 800a42c: ba 00 10 00 mv r2,r16 800a430: b9 a0 18 00 mv r3,r13 800a434: f8 00 06 a8 calli 800bed4 my_length = 0; copied += to_copy; 800a438: b5 6d 58 00 add r11,r11,r13 } IMFS_mtime_ctime_update( the_jnode ); 800a43c: 37 81 00 2c addi r1,sp,44 800a440: 34 02 00 00 mvi r2,0 800a444: fb ff dc 08 calli 8001464 800a448: 2b 81 00 2c lw r1,(sp+44) 800a44c: 59 81 00 44 sw (r12+68),r1 800a450: 59 81 00 48 sw (r12+72),r1 return copied; } 800a454: b9 60 08 00 mv r1,r11 800a458: 2b 9d 00 04 lw ra,(sp+4) 800a45c: 2b 8b 00 28 lw r11,(sp+40) 800a460: 2b 8c 00 24 lw r12,(sp+36) 800a464: 2b 8d 00 20 lw r13,(sp+32) 800a468: 2b 8e 00 1c lw r14,(sp+28) 800a46c: 2b 8f 00 18 lw r15,(sp+24) 800a470: 2b 90 00 14 lw r16,(sp+20) 800a474: 2b 91 00 10 lw r17,(sp+16) 800a478: 2b 92 00 0c lw r18,(sp+12) 800a47c: 2b 93 00 08 lw r19,(sp+8) 800a480: 37 9c 00 30 addi sp,sp,48 800a484: c3 a0 00 00 ret =============================================================================== 08000a80 : const char *token, /* IN */ mode_t mode, /* IN */ dev_t dev, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { 8000a80: 37 9c ff a8 addi sp,sp,-88 8000a84: 5b 8b 00 18 sw (sp+24),r11 8000a88: 5b 8c 00 14 sw (sp+20),r12 8000a8c: 5b 8d 00 10 sw (sp+16),r13 8000a90: 5b 8e 00 0c sw (sp+12),r14 8000a94: 5b 8f 00 08 sw (sp+8),r15 8000a98: 5b 9d 00 04 sw (sp+4),ra 8000a9c: b8 40 58 00 mv r11,r2 8000aa0: b8 20 78 00 mv r15,r1 8000aa4: b8 60 70 00 mv r14,r3 8000aa8: b8 80 68 00 mv r13,r4 8000aac: b8 a0 60 00 mv r12,r5 IMFS_jnode_t *new_node; int result; char new_name[ IMFS_NAME_MAX + 1 ]; IMFS_types_union info; IMFS_get_token( token, strlen( token ), new_name, &result ); 8000ab0: f8 00 2e ff calli 800c6ac 8000ab4: b8 20 10 00 mv r2,r1 8000ab8: 37 83 00 1c addi r3,sp,28 8000abc: b9 e0 08 00 mv r1,r15 8000ac0: 37 84 00 58 addi r4,sp,88 8000ac4: f8 00 1b fa calli 8007aac /* * Figure out what type of IMFS node this is. */ if ( S_ISDIR(mode) ) 8000ac8: 21 66 f0 00 andi r6,r11,0xf000 8000acc: 34 01 40 00 mvi r1,16384 8000ad0: 44 c1 00 11 be r6,r1,8000b14 type = IMFS_DIRECTORY; else if ( S_ISREG(mode) ) 8000ad4: 34 21 40 00 addi r1,r1,16384 8000ad8: 44 c1 00 11 be r6,r1,8000b1c type = IMFS_MEMORY_FILE; else if ( S_ISBLK(mode) || S_ISCHR(mode) ) { 8000adc: 64 c2 20 00 cmpei r2,r6,8192 8000ae0: 64 c1 60 00 cmpei r1,r6,24576 8000ae4: b8 41 08 00 or r1,r2,r1 8000ae8: 44 20 00 05 be r1,r0,8000afc type = IMFS_DEVICE; rtems_filesystem_split_dev_t( dev, info.device.major, info.device.minor ); 8000aec: 5b 8e 00 40 sw (sp+64),r14 8000af0: 5b 8d 00 44 sw (sp+68),r13 if ( S_ISDIR(mode) ) type = IMFS_DIRECTORY; else if ( S_ISREG(mode) ) type = IMFS_MEMORY_FILE; else if ( S_ISBLK(mode) || S_ISCHR(mode) ) { type = IMFS_DEVICE; 8000af4: 34 02 00 02 mvi r2,2 8000af8: e0 00 00 0a bi 8000b20 rtems_filesystem_split_dev_t( dev, info.device.major, info.device.minor ); } else if (S_ISFIFO(mode)) 8000afc: 34 01 10 00 mvi r1,4096 type = IMFS_FIFO; 8000b00: 34 02 00 07 mvi r2,7 type = IMFS_MEMORY_FILE; else if ( S_ISBLK(mode) || S_ISCHR(mode) ) { type = IMFS_DEVICE; rtems_filesystem_split_dev_t( dev, info.device.major, info.device.minor ); } else if (S_ISFIFO(mode)) 8000b04: 44 c1 00 07 be r6,r1,8000b20 <== ALWAYS TAKEN type = IMFS_FIFO; else { rtems_set_errno_and_return_minus_one( EINVAL ); 8000b08: f8 00 2a 3d calli 800b3fc <__errno> <== NOT EXECUTED 8000b0c: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8000b10: e0 00 00 0d bi 8000b44 <== NOT EXECUTED /* * Figure out what type of IMFS node this is. */ if ( S_ISDIR(mode) ) type = IMFS_DIRECTORY; 8000b14: 34 02 00 01 mvi r2,1 8000b18: e0 00 00 02 bi 8000b20 else if ( S_ISREG(mode) ) type = IMFS_MEMORY_FILE; 8000b1c: 34 02 00 05 mvi r2,5 * was ONLY passed a NULL when we created the root node. We * added a new IMFS_create_root_node() so this path no longer * existed. The result was simpler code which should not have * this path. */ new_node = IMFS_create_node( 8000b20: b9 80 08 00 mv r1,r12 8000b24: 37 83 00 1c addi r3,sp,28 8000b28: b9 60 20 00 mv r4,r11 8000b2c: 37 85 00 40 addi r5,sp,64 8000b30: f8 00 18 d6 calli 8006e88 ); if ( !new_node ) rtems_set_errno_and_return_minus_one( ENOMEM ); return 0; 8000b34: 34 02 00 00 mvi r2,0 new_name, mode, &info ); if ( !new_node ) 8000b38: 5c 20 00 05 bne r1,r0,8000b4c rtems_set_errno_and_return_minus_one( ENOMEM ); 8000b3c: f8 00 2a 30 calli 800b3fc <__errno> 8000b40: 34 02 00 0c mvi r2,12 8000b44: 58 22 00 00 sw (r1+0),r2 8000b48: 34 02 ff ff mvi r2,-1 return 0; } 8000b4c: b8 40 08 00 mv r1,r2 8000b50: 2b 9d 00 04 lw ra,(sp+4) 8000b54: 2b 8b 00 18 lw r11,(sp+24) 8000b58: 2b 8c 00 14 lw r12,(sp+20) 8000b5c: 2b 8d 00 10 lw r13,(sp+16) 8000b60: 2b 8e 00 0c lw r14,(sp+12) 8000b64: 2b 8f 00 08 lw r15,(sp+8) 8000b68: 37 9c 00 58 addi sp,sp,88 8000b6c: c3 a0 00 00 ret =============================================================================== 08000b70 : #include int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 8000b70: 37 9c ff fc addi sp,sp,-4 8000b74: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *node; node = mt_entry->mt_point_node.node_access; 8000b78: 28 22 00 08 lw r2,(r1+8) /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) 8000b7c: 34 03 00 01 mvi r3,1 8000b80: 28 44 00 4c lw r4,(r2+76) 8000b84: 44 83 00 06 be r4,r3,8000b9c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOTDIR ); 8000b88: f8 00 2a 1d calli 800b3fc <__errno> <== NOT EXECUTED 8000b8c: 34 02 00 14 mvi r2,20 <== NOT EXECUTED 8000b90: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8000b94: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8000b98: e0 00 00 03 bi 8000ba4 <== 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; 8000b9c: 58 41 00 5c sw (r2+92),r1 return 0; 8000ba0: 34 01 00 00 mvi r1,0 } 8000ba4: 2b 9d 00 04 lw ra,(sp+4) 8000ba8: 37 9c 00 04 addi sp,sp,4 8000bac: c3 a0 00 00 ret =============================================================================== 08002d58 : */ void IMFS_print_jnode( IMFS_jnode_t *the_jnode ) { 8002d58: 37 9c ff f0 addi sp,sp,-16 8002d5c: 5b 8b 00 10 sw (sp+16),r11 8002d60: 5b 8c 00 0c sw (sp+12),r12 8002d64: 5b 8d 00 08 sw (sp+8),r13 8002d68: 5b 9d 00 04 sw (sp+4),ra #if defined(RTEMS_DEBUG) assert( the_jnode ); #endif fprintf(stdout, "%s", the_jnode->name ); 8002d6c: 78 0c 08 02 mvhi r12,0x802 8002d70: 39 8c 51 78 ori r12,r12,0x5178 8002d74: 29 82 00 00 lw r2,(r12+0) */ void IMFS_print_jnode( IMFS_jnode_t *the_jnode ) { 8002d78: b8 20 58 00 mv r11,r1 #if defined(RTEMS_DEBUG) assert( the_jnode ); #endif fprintf(stdout, "%s", the_jnode->name ); 8002d7c: 34 21 00 0c addi r1,r1,12 8002d80: 28 42 00 08 lw r2,(r2+8) 8002d84: f8 00 32 a9 calli 800f828 switch( the_jnode->type ) { 8002d88: 29 63 00 4c lw r3,(r11+76) 8002d8c: 34 02 00 06 mvi r2,6 8002d90: 34 61 ff ff addi r1,r3,-1 8002d94: 54 22 00 2d bgu r1,r2,8002e48 <== NEVER TAKEN 8002d98: 78 0d 08 02 mvhi r13,0x802 8002d9c: 34 02 00 02 mvi r2,2 8002da0: f8 00 78 17 calli 8020dfc <__ashlsi3> 8002da4: 39 ad 2b 6c ori r13,r13,0x2b6c 8002da8: b5 a1 08 00 add r1,r13,r1 8002dac: 28 21 00 00 lw r1,(r1+0) 8002db0: c0 20 00 00 b r1 case IMFS_DIRECTORY: fprintf(stdout, "/" ); 8002db4: 29 82 00 00 lw r2,(r12+0) 8002db8: 34 01 00 2f mvi r1,47 8002dbc: 28 42 00 08 lw r2,(r2+8) 8002dc0: f8 00 32 56 calli 800f718 break; 8002dc4: e0 00 00 27 bi 8002e60 case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 8002dc8: 29 81 00 00 lw r1,(r12+0) 8002dcc: 78 02 08 02 mvhi r2,0x802 8002dd0: 38 42 2a 84 ori r2,r2,0x2a84 8002dd4: 28 21 00 08 lw r1,(r1+8) 8002dd8: 29 63 00 50 lw r3,(r11+80) 8002ddc: 29 64 00 54 lw r4,(r11+84) 8002de0: e0 00 00 07 bi 8002dfc the_jnode->info.device.major, the_jnode->info.device.minor ); break; case IMFS_LINEAR_FILE: fprintf(stdout, " (file %" PRId32 " %p)", 8002de4: 29 81 00 00 lw r1,(r12+0) <== NOT EXECUTED 8002de8: 29 63 00 54 lw r3,(r11+84) <== NOT EXECUTED 8002dec: 29 64 00 58 lw r4,(r11+88) <== NOT EXECUTED 8002df0: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED 8002df4: 78 02 08 02 mvhi r2,0x802 <== NOT EXECUTED 8002df8: 38 42 2a 98 ori r2,r2,0x2a98 <== NOT EXECUTED 8002dfc: f8 00 32 20 calli 800f67c (uint32_t)the_jnode->info.linearfile.size, the_jnode->info.linearfile.direct ); break; 8002e00: e0 00 00 18 bi 8002e60 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 8002e04: 29 81 00 00 lw r1,(r12+0) 8002e08: 29 63 00 54 lw r3,(r11+84) 8002e0c: 78 02 08 02 mvhi r2,0x802 8002e10: 28 21 00 08 lw r1,(r1+8) 8002e14: 38 42 2a a8 ori r2,r2,0x2aa8 8002e18: f8 00 32 19 calli 800f67c (uint32_t)the_jnode->info.file.size ); #endif break; 8002e1c: e0 00 00 11 bi 8002e60 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 8002e20: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 8002e24: 29 82 00 00 lw r2,(r12+0) <== NOT EXECUTED 8002e28: 38 21 2a b4 ori r1,r1,0x2ab4 <== NOT EXECUTED 8002e2c: e0 00 00 04 bi 8002e3c <== NOT EXECUTED return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 8002e30: 29 82 00 00 lw r2,(r12+0) <== NOT EXECUTED 8002e34: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 8002e38: 38 21 2a c8 ori r1,r1,0x2ac8 <== NOT EXECUTED 8002e3c: 28 42 00 08 lw r2,(r2+8) <== NOT EXECUTED 8002e40: f8 00 32 7a calli 800f828 <== NOT EXECUTED return; 8002e44: e0 00 00 0a bi 8002e6c <== NOT EXECUTED default: fprintf(stdout, " bad type %d\n", the_jnode->type ); 8002e48: 29 81 00 00 lw r1,(r12+0) <== NOT EXECUTED 8002e4c: 78 02 08 02 mvhi r2,0x802 <== NOT EXECUTED 8002e50: 38 42 2a dc ori r2,r2,0x2adc <== NOT EXECUTED 8002e54: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED 8002e58: f8 00 32 09 calli 800f67c <== NOT EXECUTED return; 8002e5c: e0 00 00 04 bi 8002e6c <== NOT EXECUTED } puts(""); 8002e60: 78 01 08 02 mvhi r1,0x802 8002e64: 38 21 26 3c ori r1,r1,0x263c 8002e68: f8 00 3a 09 calli 801168c } 8002e6c: 2b 9d 00 04 lw ra,(sp+4) 8002e70: 2b 8b 00 10 lw r11,(sp+16) 8002e74: 2b 8c 00 0c lw r12,(sp+12) 8002e78: 2b 8d 00 08 lw r13,(sp+8) 8002e7c: 37 9c 00 10 addi sp,sp,16 8002e80: c3 a0 00 00 ret =============================================================================== 08000bbc : int IMFS_readlink( rtems_filesystem_location_info_t *loc, char *buf, /* OUT */ size_t bufsize ) { 8000bbc: 37 9c ff fc addi sp,sp,-4 8000bc0: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *node; int i; node = loc->node_access; 8000bc4: 28 24 00 00 lw r4,(r1+0) if ( node->type != IMFS_SYM_LINK ) 8000bc8: 34 01 00 04 mvi r1,4 8000bcc: 28 85 00 4c lw r5,(r4+76) 8000bd0: 5c a1 00 03 bne r5,r1,8000bdc <== NEVER TAKEN 8000bd4: 34 01 00 00 mvi r1,0 8000bd8: e0 00 00 09 bi 8000bfc rtems_set_errno_and_return_minus_one( EINVAL ); 8000bdc: f8 00 2a 08 calli 800b3fc <__errno> <== NOT EXECUTED 8000be0: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8000be4: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8000be8: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8000bec: e0 00 00 09 bi 8000c10 <== NOT EXECUTED #include #include "imfs.h" #include #include int IMFS_readlink( 8000bf0: b4 41 30 00 add r6,r2,r1 if ( node->type != IMFS_SYM_LINK ) rtems_set_errno_and_return_minus_one( EINVAL ); for( i=0; ((iinfo.sym_link.name[i] != '\0')); i++ ) buf[i] = node->info.sym_link.name[i]; 8000bf4: 30 c5 00 00 sb (r6+0),r5 node = loc->node_access; if ( node->type != IMFS_SYM_LINK ) rtems_set_errno_and_return_minus_one( EINVAL ); for( i=0; ((iinfo.sym_link.name[i] != '\0')); i++ ) 8000bf8: 34 21 00 01 addi r1,r1,1 8000bfc: 50 23 00 05 bgeu r1,r3,8000c10 8000c00: 28 85 00 50 lw r5,(r4+80) 8000c04: b4 a1 28 00 add r5,r5,r1 8000c08: 40 a5 00 00 lbu r5,(r5+0) 8000c0c: 5c a0 ff f9 bne r5,r0,8000bf0 buf[i] = node->info.sym_link.name[i]; return i; } 8000c10: 2b 9d 00 04 lw ra,(sp+4) 8000c14: 37 9c 00 04 addi sp,sp,4 8000c18: c3 a0 00 00 ret =============================================================================== 08000c1c : 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 */ ) { 8000c1c: 37 9c ff ec addi sp,sp,-20 8000c20: 5b 8b 00 0c sw (sp+12),r11 8000c24: 5b 8c 00 08 sw (sp+8),r12 8000c28: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *the_jnode; IMFS_jnode_t *new_parent; the_jnode = old_loc->node_access; 8000c2c: 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 */ ) { 8000c30: 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 ); 8000c34: b8 80 10 00 mv r2,r4 8000c38: 35 61 00 0c addi r1,r11,12 8000c3c: 34 03 00 20 mvi r3,32 8000c40: f8 00 2e ca calli 800c768 if ( the_jnode->Parent != NULL ) 8000c44: 29 61 00 08 lw r1,(r11+8) 8000c48: 44 20 00 03 be r1,r0,8000c54 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 8000c4c: b9 60 08 00 mv r1,r11 8000c50: f8 00 0a 48 calli 8003570 <_Chain_Extract> rtems_chain_extract( (rtems_chain_node *) the_jnode ); new_parent = new_parent_loc->node_access; 8000c54: 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 ); 8000c58: b9 60 10 00 mv r2,r11 the_jnode->Parent = new_parent; 8000c5c: 59 61 00 08 sw (r11+8),r1 8000c60: 34 21 00 50 addi r1,r1,80 8000c64: f8 00 0a 37 calli 8003540 <_Chain_Append> rtems_chain_append( &new_parent->info.directory.Entries, &the_jnode->Node ); /* * Update the time. */ IMFS_update_ctime( the_jnode ); 8000c68: 37 81 00 10 addi r1,sp,16 8000c6c: 34 02 00 00 mvi r2,0 8000c70: f8 00 01 fd calli 8001464 8000c74: 2b 81 00 10 lw r1,(sp+16) 8000c78: 59 61 00 48 sw (r11+72),r1 return 0; } 8000c7c: 34 01 00 00 mvi r1,0 8000c80: 2b 9d 00 04 lw ra,(sp+4) 8000c84: 2b 8b 00 0c lw r11,(sp+12) 8000c88: 2b 8c 00 08 lw r12,(sp+8) 8000c8c: 37 9c 00 14 addi sp,sp,20 8000c90: c3 a0 00 00 ret =============================================================================== 08007cd0 : int IMFS_stat( rtems_filesystem_location_info_t *loc, struct stat *buf ) { 8007cd0: 37 9c ff ec addi sp,sp,-20 8007cd4: 5b 8b 00 14 sw (sp+20),r11 8007cd8: 5b 8c 00 10 sw (sp+16),r12 8007cdc: 5b 8d 00 0c sw (sp+12),r13 8007ce0: 5b 8e 00 08 sw (sp+8),r14 8007ce4: 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; 8007ce8: 28 2b 00 00 lw r11,(r1+0) int IMFS_stat( rtems_filesystem_location_info_t *loc, struct stat *buf ) { 8007cec: b8 20 70 00 mv r14,r1 8007cf0: b8 40 60 00 mv r12,r2 IMFS_device_t *io; the_jnode = loc->node_access; switch ( the_jnode->type ) { 8007cf4: 29 61 00 4c lw r1,(r11+76) 8007cf8: 34 02 00 05 mvi r2,5 8007cfc: 34 21 ff fe addi r1,r1,-2 8007d00: 54 22 00 12 bgu r1,r2,8007d48 <== NEVER TAKEN 8007d04: 78 0d 08 01 mvhi r13,0x801 8007d08: 34 02 00 02 mvi r2,2 8007d0c: f8 00 22 d4 calli 801085c <__ashlsi3> 8007d10: 39 ad 1f 78 ori r13,r13,0x1f78 8007d14: b5 a1 08 00 add r1,r13,r1 8007d18: 28 21 00 00 lw r1,(r1+0) 8007d1c: 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 ); 8007d20: 29 61 00 54 lw r1,(r11+84) rtems_device_minor_number _minor ) { union __rtems_dev_t temp; temp.__overlay.major = _major; 8007d24: 29 62 00 50 lw r2,(r11+80) 8007d28: 59 81 00 1c sw (r12+28),r1 8007d2c: 59 82 00 18 sw (r12+24),r2 break; 8007d30: e0 00 00 0b bi 8007d5c case IMFS_LINEAR_FILE: case IMFS_MEMORY_FILE: buf->st_size = the_jnode->info.file.size; 8007d34: 29 61 00 54 lw r1,(r11+84) 8007d38: 59 81 00 20 sw (r12+32),r1 break; 8007d3c: e0 00 00 08 bi 8007d5c case IMFS_SYM_LINK: buf->st_size = 0; break; case IMFS_FIFO: buf->st_size = 0; 8007d40: 59 80 00 20 sw (r12+32),r0 break; 8007d44: e0 00 00 06 bi 8007d5c default: rtems_set_errno_and_return_minus_one( ENOTSUP ); 8007d48: f8 00 0d ad calli 800b3fc <__errno> <== NOT EXECUTED 8007d4c: 34 02 00 86 mvi r2,134 <== NOT EXECUTED 8007d50: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8007d54: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8007d58: e0 00 00 18 bi 8007db8 <== NOT EXECUTED /* * The device number of the IMFS is the major number and the minor is the * instance. */ fs_info = loc->mt_entry->fs_info; 8007d5c: 29 c1 00 10 lw r1,(r14+16) buf->st_dev = rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); 8007d60: 28 21 00 34 lw r1,(r1+52) 8007d64: 28 22 00 00 lw r2,(r1+0) 8007d68: 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 = 8007d6c: 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; 8007d70: 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 = 8007d74: 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; 8007d78: 59 81 00 0c sw (r12+12),r1 buf->st_nlink = the_jnode->st_nlink; 8007d7c: 2d 61 00 34 lhu r1,(r11+52) 8007d80: 0d 81 00 10 sh (r12+16),r1 buf->st_ino = the_jnode->st_ino; 8007d84: 29 61 00 38 lw r1,(r11+56) 8007d88: 59 81 00 08 sw (r12+8),r1 buf->st_uid = the_jnode->st_uid; 8007d8c: 2d 61 00 3c lhu r1,(r11+60) 8007d90: 0d 81 00 12 sh (r12+18),r1 buf->st_gid = the_jnode->st_gid; 8007d94: 2d 61 00 3e lhu r1,(r11+62) 8007d98: 0d 81 00 14 sh (r12+20),r1 buf->st_atime = the_jnode->stat_atime; 8007d9c: 29 61 00 40 lw r1,(r11+64) 8007da0: 59 81 00 24 sw (r12+36),r1 buf->st_mtime = the_jnode->stat_mtime; 8007da4: 29 61 00 44 lw r1,(r11+68) 8007da8: 59 81 00 2c sw (r12+44),r1 buf->st_ctime = the_jnode->stat_ctime; 8007dac: 29 61 00 48 lw r1,(r11+72) 8007db0: 59 81 00 34 sw (r12+52),r1 return 0; 8007db4: 34 01 00 00 mvi r1,0 } 8007db8: 2b 9d 00 04 lw ra,(sp+4) 8007dbc: 2b 8b 00 14 lw r11,(sp+20) 8007dc0: 2b 8c 00 10 lw r12,(sp+16) 8007dc4: 2b 8d 00 0c lw r13,(sp+12) 8007dc8: 2b 8e 00 08 lw r14,(sp+8) 8007dcc: 37 9c 00 14 addi sp,sp,20 8007dd0: c3 a0 00 00 ret =============================================================================== 08000c94 : int IMFS_symlink( rtems_filesystem_location_info_t *parent_loc, const char *link_name, const char *node_name ) { 8000c94: 37 9c ff ac addi sp,sp,-84 8000c98: 5b 8b 00 14 sw (sp+20),r11 8000c9c: 5b 8c 00 10 sw (sp+16),r12 8000ca0: 5b 8d 00 0c sw (sp+12),r13 8000ca4: 5b 8e 00 08 sw (sp+8),r14 8000ca8: 5b 9d 00 04 sw (sp+4),ra 8000cac: b8 20 68 00 mv r13,r1 int i; /* * Remove any separators at the end of the string. */ IMFS_get_token( node_name, strlen( node_name ), new_name, &i ); 8000cb0: b8 60 08 00 mv r1,r3 int IMFS_symlink( rtems_filesystem_location_info_t *parent_loc, const char *link_name, const char *node_name ) { 8000cb4: b8 40 70 00 mv r14,r2 8000cb8: b8 60 60 00 mv r12,r3 int i; /* * Remove any separators at the end of the string. */ IMFS_get_token( node_name, strlen( node_name ), new_name, &i ); 8000cbc: 37 8b 00 18 addi r11,sp,24 8000cc0: f8 00 2e 7b calli 800c6ac 8000cc4: b8 20 10 00 mv r2,r1 8000cc8: b9 60 18 00 mv r3,r11 8000ccc: 37 84 00 54 addi r4,sp,84 8000cd0: b9 80 08 00 mv r1,r12 8000cd4: f8 00 1b 76 calli 8007aac /* * Duplicate link name */ info.sym_link.name = strdup(link_name); 8000cd8: b9 c0 08 00 mv r1,r14 8000cdc: f8 00 2e 51 calli 800c620 8000ce0: 5b 81 00 3c sw (sp+60),r1 if (info.sym_link.name == NULL) { 8000ce4: 44 20 00 0b be r1,r0,8000d10 <== NEVER TAKEN * was ONLY passed a NULL when we created the root node. We * added a new IMFS_create_root_node() so this path no longer * existed. The result was simpler code which should not have * this path. */ new_node = IMFS_create_node( 8000ce8: 34 02 00 04 mvi r2,4 8000cec: b9 a0 08 00 mv r1,r13 8000cf0: b9 60 18 00 mv r3,r11 8000cf4: 38 04 a1 ff mvu r4,0xa1ff 8000cf8: 37 85 00 3c addi r5,sp,60 8000cfc: f8 00 18 63 calli 8006e88 if (new_node == NULL) { free(info.sym_link.name); rtems_set_errno_and_return_minus_one(ENOMEM); } return 0; 8000d00: 34 02 00 00 mvi r2,0 new_name, ( S_IFLNK | ( S_IRWXU | S_IRWXG | S_IRWXO )), &info ); if (new_node == NULL) { 8000d04: 5c 20 00 07 bne r1,r0,8000d20 <== ALWAYS TAKEN free(info.sym_link.name); 8000d08: 2b 81 00 3c lw r1,(sp+60) <== NOT EXECUTED 8000d0c: f8 00 01 a8 calli 80013ac <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOMEM); 8000d10: f8 00 29 bb calli 800b3fc <__errno> <== NOT EXECUTED 8000d14: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8000d18: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8000d1c: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED } return 0; } 8000d20: b8 40 08 00 mv r1,r2 8000d24: 2b 9d 00 04 lw ra,(sp+4) 8000d28: 2b 8b 00 14 lw r11,(sp+20) 8000d2c: 2b 8c 00 10 lw r12,(sp+16) 8000d30: 2b 8d 00 0c lw r13,(sp+12) 8000d34: 2b 8e 00 08 lw r14,(sp+8) 8000d38: 37 9c 00 54 addi sp,sp,84 8000d3c: c3 a0 00 00 ret =============================================================================== 08000d40 : int IMFS_unlink( rtems_filesystem_location_info_t *parentloc, /* IN */ rtems_filesystem_location_info_t *loc /* IN */ ) { 8000d40: 37 9c ff d0 addi sp,sp,-48 8000d44: 5b 8b 00 14 sw (sp+20),r11 8000d48: 5b 8c 00 10 sw (sp+16),r12 8000d4c: 5b 8d 00 0c sw (sp+12),r13 8000d50: 5b 8e 00 08 sw (sp+8),r14 8000d54: 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; 8000d58: 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 */ ) { 8000d5c: b8 40 58 00 mv r11,r2 8000d60: 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 ) { 8000d64: 29 82 00 4c lw r2,(r12+76) 8000d68: 34 01 00 03 mvi r1,3 8000d6c: 5c 41 00 28 bne r2,r1,8000e0c if ( !node->info.hard_link.link_node ) 8000d70: 29 81 00 50 lw r1,(r12+80) 8000d74: 5c 20 00 06 bne r1,r0,8000d8c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 8000d78: f8 00 29 a1 calli 800b3fc <__errno> <== NOT EXECUTED 8000d7c: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8000d80: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8000d84: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8000d88: e0 00 00 27 bi 8000e24 <== NOT EXECUTED the_link = *loc; 8000d8c: 29 64 00 08 lw r4,(r11+8) 8000d90: 29 63 00 0c lw r3,(r11+12) 8000d94: 29 65 00 04 lw r5,(r11+4) 8000d98: 29 62 00 10 lw r2,(r11+16) the_link.node_access = node->info.hard_link.link_node; IMFS_Set_handlers( &the_link ); 8000d9c: 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; 8000da0: 5b 81 00 18 sw (sp+24),r1 IMFS_Set_handlers( &the_link ); 8000da4: 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; 8000da8: 5b 84 00 20 sw (sp+32),r4 8000dac: 5b 83 00 24 sw (sp+36),r3 8000db0: 5b 85 00 1c sw (sp+28),r5 8000db4: 5b 82 00 28 sw (sp+40),r2 the_link.node_access = node->info.hard_link.link_node; IMFS_Set_handlers( &the_link ); 8000db8: f8 00 18 96 calli 8007010 /* * 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) 8000dbc: 29 83 00 50 lw r3,(r12+80) 8000dc0: 34 01 00 01 mvi r1,1 8000dc4: 2c 64 00 34 lhu r4,(r3+52) 8000dc8: 5c 81 00 09 bne r4,r1,8000dec { result = (*the_link.handlers->rmnod_h)( parentloc, &the_link ); 8000dcc: 2b 81 00 20 lw r1,(sp+32) 8000dd0: b9 c0 10 00 mv r2,r14 8000dd4: 28 23 00 34 lw r3,(r1+52) 8000dd8: b9 a0 08 00 mv r1,r13 8000ddc: d8 60 00 00 call r3 if ( result != 0 ) return -1; 8000de0: 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 ) 8000de4: 44 20 00 0a be r1,r0,8000e0c 8000de8: e0 00 00 0f bi 8000e24 return -1; } else { node->info.hard_link.link_node->st_nlink --; 8000dec: 34 84 ff ff addi r4,r4,-1 IMFS_update_ctime( node->info.hard_link.link_node ); 8000df0: 34 02 00 00 mvi r2,0 if ( result != 0 ) return -1; } else { node->info.hard_link.link_node->st_nlink --; 8000df4: 0c 64 00 34 sh (r3+52),r4 IMFS_update_ctime( node->info.hard_link.link_node ); 8000df8: 37 81 00 2c addi r1,sp,44 8000dfc: f8 00 01 9a calli 8001464 8000e00: 29 81 00 50 lw r1,(r12+80) 8000e04: 2b 82 00 2c lw r2,(sp+44) 8000e08: 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 ); 8000e0c: 29 61 00 08 lw r1,(r11+8) 8000e10: b9 60 10 00 mv r2,r11 8000e14: 28 23 00 34 lw r3,(r1+52) 8000e18: b9 a0 08 00 mv r1,r13 8000e1c: d8 60 00 00 call r3 8000e20: b8 20 10 00 mv r2,r1 return result; } 8000e24: b8 40 08 00 mv r1,r2 8000e28: 2b 9d 00 04 lw ra,(sp+4) 8000e2c: 2b 8b 00 14 lw r11,(sp+20) 8000e30: 2b 8c 00 10 lw r12,(sp+16) 8000e34: 2b 8d 00 0c lw r13,(sp+12) 8000e38: 2b 8e 00 08 lw r14,(sp+8) 8000e3c: 37 9c 00 30 addi sp,sp,48 8000e40: c3 a0 00 00 ret =============================================================================== 08000e44 : #include int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 8000e44: 37 9c ff fc addi sp,sp,-4 8000e48: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *node; node = mt_entry->mt_point_node.node_access; 8000e4c: 28 21 00 08 lw r1,(r1+8) /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) 8000e50: 34 02 00 01 mvi r2,1 8000e54: 28 23 00 4c lw r3,(r1+76) 8000e58: 44 62 00 04 be r3,r2,8000e68 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOTDIR ); 8000e5c: f8 00 29 68 calli 800b3fc <__errno> <== NOT EXECUTED 8000e60: 34 02 00 14 mvi r2,20 <== NOT EXECUTED 8000e64: e0 00 00 05 bi 8000e78 <== NOT EXECUTED /* * Did the node indicate that there was a directory mounted here? */ if ( node->info.directory.mt_fs == NULL ) 8000e68: 28 22 00 5c lw r2,(r1+92) 8000e6c: 5c 40 00 06 bne r2,r0,8000e84 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); /* XXX */ 8000e70: f8 00 29 63 calli 800b3fc <__errno> <== NOT EXECUTED 8000e74: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8000e78: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8000e7c: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8000e80: e0 00 00 03 bi 8000e8c <== 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; 8000e84: 58 20 00 5c sw (r1+92),r0 return 0; 8000e88: 34 01 00 00 mvi r1,0 } 8000e8c: 2b 9d 00 04 lw ra,(sp+4) 8000e90: 37 9c 00 04 addi sp,sp,4 8000e94: c3 a0 00 00 ret =============================================================================== 080006a0 : static rtems_printk_plugin_t print_handler; void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 80006a0: 37 9c ff e4 addi sp,sp,-28 80006a4: 5b 8b 00 14 sw (sp+20),r11 80006a8: 5b 8c 00 10 sw (sp+16),r12 80006ac: 5b 8d 00 0c sw (sp+12),r13 80006b0: 5b 8e 00 08 sw (sp+8),r14 80006b4: 5b 9d 00 04 sw (sp+4),ra 80006b8: b8 20 10 00 mv r2,r1 /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { 80006bc: 34 01 ff ff mvi r1,-1 80006c0: 5c 41 00 06 bne r2,r1,80006d8 if (!Stack_check_Interrupt_stack.area) 80006c4: 78 01 08 01 mvhi r1,0x801 80006c8: 38 21 36 c4 ori r1,r1,0x36c4 80006cc: 28 21 00 04 lw r1,(r1+4) 80006d0: 44 20 00 35 be r1,r0,80007a4 <== ALWAYS TAKEN return; stack = &Stack_check_Interrupt_stack; the_thread = 0; 80006d4: 34 02 00 00 mvi r2,0 <== NOT EXECUTED current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } #endif low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); 80006d8: 78 01 08 01 mvhi r1,0x801 80006dc: 38 21 36 c4 ori r1,r1,0x36c4 80006e0: 28 2d 00 00 lw r13,(r1+0) 80006e4: 78 03 08 01 mvhi r3,0x801 80006e8: 78 01 08 01 mvhi r1,0x801 80006ec: 35 ad ff f0 addi r13,r13,-16 80006f0: 38 21 36 30 ori r1,r1,0x3630 80006f4: 38 63 36 2c ori r3,r3,0x362c if ( high_water_mark ) used = Stack_check_Calculate_used( low, size, high_water_mark ); else used = 0; if ( the_thread ) { 80006f8: 44 40 00 0f be r2,r0,8000734 <== NEVER TAKEN (*print_handler)( 80006fc: 28 4b 00 08 lw r11,(r2+8) 8000700: 28 6e 00 00 lw r14,(r3+0) 8000704: 28 2c 00 00 lw r12,(r1+0) 8000708: 37 83 00 18 addi r3,sp,24 800070c: b9 60 08 00 mv r1,r11 8000710: 34 02 00 05 mvi r2,5 8000714: f8 00 08 b3 calli 80029e0 8000718: 78 02 08 01 mvhi r2,0x801 800071c: b8 20 20 00 mv r4,r1 8000720: 38 42 17 60 ori r2,r2,0x1760 8000724: b9 c0 08 00 mv r1,r14 8000728: b9 60 18 00 mv r3,r11 800072c: d9 80 00 00 call r12 8000730: e0 00 00 07 bi 800074c "0x%08" PRIx32 " %4s", the_thread->Object.id, rtems_object_get_name( the_thread->Object.id, sizeof(name), name ) ); } else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); 8000734: 28 24 00 00 lw r4,(r1+0) <== NOT EXECUTED 8000738: 28 61 00 00 lw r1,(r3+0) <== NOT EXECUTED 800073c: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8000740: 38 42 17 70 ori r2,r2,0x1770 <== NOT EXECUTED 8000744: 34 03 ff ff mvi r3,-1 <== NOT EXECUTED 8000748: d8 80 00 00 call r4 <== NOT EXECUTED (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 800074c: 78 01 08 01 mvhi r1,0x801 8000750: 38 21 36 c4 ori r1,r1,0x36c4 8000754: 28 24 00 00 lw r4,(r1+0) ); } else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } (*print_handler)( 8000758: 78 0b 08 01 mvhi r11,0x801 800075c: 78 0c 08 01 mvhi r12,0x801 print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 8000760: 28 23 00 04 lw r3,(r1+4) ); } else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } (*print_handler)( 8000764: 39 6b 36 30 ori r11,r11,0x3630 8000768: 39 8c 36 2c ori r12,r12,0x362c 800076c: 29 67 00 00 lw r7,(r11+0) 8000770: 29 81 00 00 lw r1,(r12+0) print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 8000774: 34 84 ff ff addi r4,r4,-1 ); } else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } (*print_handler)( 8000778: 78 02 08 01 mvhi r2,0x801 800077c: 38 42 17 80 ori r2,r2,0x1780 8000780: b4 64 20 00 add r4,r3,r4 8000784: 34 05 00 00 mvi r5,0 8000788: b9 a0 30 00 mv r6,r13 800078c: d8 e0 00 00 call r7 current, size ); if (Stack_check_Initialized == 0) { (*print_handler)( print_context, "Unavailable\n" ); 8000790: 29 63 00 00 lw r3,(r11+0) 8000794: 29 81 00 00 lw r1,(r12+0) 8000798: 78 02 08 01 mvhi r2,0x801 800079c: 38 42 17 a0 ori r2,r2,0x17a0 80007a0: d8 60 00 00 call r3 } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); } } 80007a4: 2b 9d 00 04 lw ra,(sp+4) 80007a8: 2b 8b 00 14 lw r11,(sp+20) 80007ac: 2b 8c 00 10 lw r12,(sp+16) 80007b0: 2b 8d 00 0c lw r13,(sp+12) 80007b4: 2b 8e 00 08 lw r14,(sp+8) 80007b8: 37 9c 00 1c addi sp,sp,28 80007bc: c3 a0 00 00 ret =============================================================================== 080007c0 : Stack_check_Dope_stack(&Stack_check_Interrupt_stack); } #endif Stack_check_Initialized = 1; } 80007c0: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08015738 <_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 ) { 8015738: 37 9c ff e4 addi sp,sp,-28 801573c: 5b 8b 00 1c sw (sp+28),r11 8015740: 5b 8c 00 18 sw (sp+24),r12 8015744: 5b 8d 00 14 sw (sp+20),r13 8015748: 5b 8e 00 10 sw (sp+16),r14 801574c: 5b 8f 00 0c sw (sp+12),r15 8015750: 5b 90 00 08 sw (sp+8),r16 8015754: 5b 9d 00 04 sw (sp+4),ra 8015758: 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 ) { 801575c: 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 ) { 8015760: b8 20 58 00 mv r11,r1 8015764: b8 60 68 00 mv r13,r3 8015768: 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; 801576c: 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 ) { 8015770: 54 62 00 13 bgu r3,r2,80157bc <_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 ) { 8015774: 29 61 00 48 lw r1,(r11+72) 8015778: 34 0c 00 00 mvi r12,0 801577c: 44 20 00 0a be r1,r0,80157a4 <_CORE_message_queue_Broadcast+0x6c> *count = 0; 8015780: 58 c0 00 00 sw (r6+0),r0 8015784: e0 00 00 0d bi 80157b8 <_CORE_message_queue_Broadcast+0x80> const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 8015788: 29 c1 00 2c lw r1,(r14+44) 801578c: ba 00 10 00 mv r2,r16 8015790: b9 a0 18 00 mv r3,r13 8015794: f8 00 25 f7 calli 801ef70 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 8015798: 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; 801579c: 35 8c 00 01 addi r12,r12,1 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 80157a0: 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 = 80157a4: b9 60 08 00 mv r1,r11 80157a8: f8 00 0c 0f calli 80187e4 <_Thread_queue_Dequeue> 80157ac: b8 20 70 00 mv r14,r1 80157b0: 5c 20 ff f6 bne r1,r0,8015788 <_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; 80157b4: 59 ec 00 00 sw (r15+0),r12 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 80157b8: 34 01 00 00 mvi r1,0 } 80157bc: 2b 9d 00 04 lw ra,(sp+4) 80157c0: 2b 8b 00 1c lw r11,(sp+28) 80157c4: 2b 8c 00 18 lw r12,(sp+24) 80157c8: 2b 8d 00 14 lw r13,(sp+20) 80157cc: 2b 8e 00 10 lw r14,(sp+16) 80157d0: 2b 8f 00 0c lw r15,(sp+12) 80157d4: 2b 90 00 08 lw r16,(sp+8) 80157d8: 37 9c 00 1c addi sp,sp,28 80157dc: c3 a0 00 00 ret =============================================================================== 0800daf4 <_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 ) { 800daf4: 37 9c ff e4 addi sp,sp,-28 800daf8: 5b 8b 00 1c sw (sp+28),r11 800dafc: 5b 8c 00 18 sw (sp+24),r12 800db00: 5b 8d 00 14 sw (sp+20),r13 800db04: 5b 8e 00 10 sw (sp+16),r14 800db08: 5b 8f 00 0c sw (sp+12),r15 800db0c: 5b 90 00 08 sw (sp+8),r16 800db10: 5b 9d 00 04 sw (sp+4),ra 800db14: 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; 800db18: 58 20 00 48 sw (r1+72),r0 the_message_queue->maximum_message_size = maximum_message_size; 800db1c: 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; 800db20: 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)) { 800db24: 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 ) { 800db28: b8 40 80 00 mv r16,r2 800db2c: 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)) { 800db30: b8 80 60 00 mv r12,r4 800db34: 44 20 00 06 be r1,r0,800db4c <_CORE_message_queue_Initialize+0x58> allocated_message_size += sizeof(uint32_t); 800db38: 34 8c 00 04 addi r12,r4,4 allocated_message_size &= ~(sizeof(uint32_t) - 1); 800db3c: 34 01 ff fc mvi r1,-4 800db40: a1 81 60 00 and r12,r12,r1 } if (allocated_message_size < maximum_message_size) return false; 800db44: 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) 800db48: 54 8c 00 1c bgu r4,r12,800dbb8 <_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)); 800db4c: 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 * 800db50: b9 e0 08 00 mv r1,r15 800db54: b9 c0 10 00 mv r2,r14 800db58: f8 00 57 f8 calli 8023b38 <__mulsi3> (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) return false; 800db5c: 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) 800db60: 55 81 00 16 bgu r12,r1,800dbb8 <_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 ); 800db64: f8 00 0e 0a calli 801138c <_Workspace_Allocate> return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 800db68: 59 61 00 5c sw (r11+92),r1 _Workspace_Allocate( message_buffering_required ); 800db6c: b8 20 28 00 mv r5,r1 if (the_message_queue->message_buffers == 0) 800db70: 44 20 00 12 be r1,r0,800dbb8 <_CORE_message_queue_Initialize+0xc4> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 800db74: b8 a0 10 00 mv r2,r5 800db78: 35 61 00 60 addi r1,r11,96 800db7c: b9 c0 18 00 mv r3,r14 800db80: b9 e0 20 00 mv r4,r15 800db84: f8 00 16 c4 calli 8013694 <_Chain_Initialize> allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 800db88: 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; 800db8c: 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); 800db90: 59 61 00 50 sw (r11+80),r1 800db94: 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 ); 800db98: 35 61 00 50 addi r1,r11,80 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 800db9c: 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; 800dba0: 59 60 00 54 sw (r11+84),r0 _Thread_queue_Initialize( 800dba4: b9 60 08 00 mv r1,r11 800dba8: 34 03 00 80 mvi r3,128 800dbac: 34 04 00 06 mvi r4,6 800dbb0: f8 00 0a 25 calli 8010444 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 800dbb4: 34 0d 00 01 mvi r13,1 } 800dbb8: b9 a0 08 00 mv r1,r13 800dbbc: 2b 9d 00 04 lw ra,(sp+4) 800dbc0: 2b 8b 00 1c lw r11,(sp+28) 800dbc4: 2b 8c 00 18 lw r12,(sp+24) 800dbc8: 2b 8d 00 14 lw r13,(sp+20) 800dbcc: 2b 8e 00 10 lw r14,(sp+16) 800dbd0: 2b 8f 00 0c lw r15,(sp+12) 800dbd4: 2b 90 00 08 lw r16,(sp+8) 800dbd8: 37 9c 00 1c addi sp,sp,28 800dbdc: c3 a0 00 00 ret =============================================================================== 0800dbe0 <_CORE_message_queue_Seize>: void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800dbe0: 37 9c ff f4 addi sp,sp,-12 800dbe4: 5b 8b 00 0c sw (sp+12),r11 800dbe8: 5b 8c 00 08 sw (sp+8),r12 800dbec: 5b 9d 00 04 sw (sp+4),ra ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 800dbf0: 78 07 08 02 mvhi r7,0x802 800dbf4: 38 e7 7b 88 ori r7,r7,0x7b88 800dbf8: 28 e7 00 0c lw r7,(r7+12) void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800dbfc: b8 20 58 00 mv r11,r1 800dc00: 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; 800dc04: 58 e0 00 34 sw (r7+52),r0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800dc08: 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 ); 800dc0c: 90 00 40 00 rcsr r8,IE 800dc10: 34 03 ff fe mvi r3,-2 800dc14: a1 03 18 00 and r3,r8,r3 800dc18: 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)); 800dc1c: 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; 800dc20: 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)) 800dc24: 45 83 00 07 be r12,r3,800dc40 <_CORE_message_queue_Seize+0x60> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 800dc28: 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 ); 800dc2c: 35 69 00 50 addi r9,r11,80 the_chain->first = new_first; 800dc30: 59 63 00 50 sw (r11+80),r3 new_first->previous = _Chain_Head(the_chain); 800dc34: 58 69 00 04 sw (r3+4),r9 the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { 800dc38: 5d 80 00 04 bne r12,r0,800dc48 <_CORE_message_queue_Seize+0x68><== ALWAYS TAKEN 800dc3c: e0 00 00 13 bi 800dc88 <_CORE_message_queue_Seize+0xa8> <== NOT EXECUTED ) { if ( !_Chain_Is_empty(the_chain)) return _Chain_Get_first_unprotected(the_chain); else return NULL; 800dc40: 34 0c 00 00 mvi r12,0 800dc44: e0 00 00 11 bi 800dc88 <_CORE_message_queue_Seize+0xa8> the_message_queue->number_of_pending_messages -= 1; 800dc48: 29 62 00 48 lw r2,(r11+72) 800dc4c: 34 42 ff ff addi r2,r2,-1 800dc50: 59 62 00 48 sw (r11+72),r2 _ISR_Enable( level ); 800dc54: d0 08 00 00 wcsr IE,r8 *size_p = the_message->Contents.size; _Thread_Executing->Wait.count = 800dc58: 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; 800dc5c: 29 83 00 08 lw r3,(r12+8) _Thread_Executing->Wait.count = 800dc60: 38 42 7b 88 ori r2,r2,0x7b88 800dc64: 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; 800dc68: 58 83 00 00 sw (r4+0),r3 _Thread_Executing->Wait.count = 800dc6c: 58 40 00 24 sw (r2+36),r0 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 800dc70: 35 82 00 0c addi r2,r12,12 800dc74: f8 00 22 ae calli 801672c 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 ); 800dc78: 35 61 00 60 addi r1,r11,96 800dc7c: b9 80 10 00 mv r2,r12 800dc80: fb ff ff 6d calli 800da34 <_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; 800dc84: e0 00 00 12 bi 800dccc <_CORE_message_queue_Seize+0xec> return; } #endif } if ( !wait ) { 800dc88: 5c ac 00 05 bne r5,r12,800dc9c <_CORE_message_queue_Seize+0xbc> _ISR_Enable( level ); 800dc8c: d0 08 00 00 wcsr IE,r8 executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 800dc90: 34 01 00 04 mvi r1,4 800dc94: 58 e1 00 34 sw (r7+52),r1 return; 800dc98: e0 00 00 0d bi 800dccc <_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; 800dc9c: 34 03 00 01 mvi r3,1 800dca0: 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; 800dca4: 58 eb 00 44 sw (r7+68),r11 executing->Wait.id = id; 800dca8: 58 e2 00 20 sw (r7+32),r2 executing->Wait.return_argument_second.mutable_object = buffer; 800dcac: 58 e1 00 2c sw (r7+44),r1 executing->Wait.return_argument = size_p; 800dcb0: 58 e4 00 28 sw (r7+40),r4 /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 800dcb4: d0 08 00 00 wcsr IE,r8 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 800dcb8: 78 03 08 01 mvhi r3,0x801 800dcbc: b9 60 08 00 mv r1,r11 800dcc0: b8 c0 10 00 mv r2,r6 800dcc4: 38 63 05 b0 ori r3,r3,0x5b0 800dcc8: f8 00 08 f3 calli 8010094 <_Thread_queue_Enqueue_with_handler> } 800dccc: 2b 9d 00 04 lw ra,(sp+4) 800dcd0: 2b 8b 00 0c lw r11,(sp+12) 800dcd4: 2b 8c 00 08 lw r12,(sp+8) 800dcd8: 37 9c 00 0c addi sp,sp,12 800dcdc: c3 a0 00 00 ret =============================================================================== 08003710 <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 8003710: 37 9c ff e8 addi sp,sp,-24 8003714: 5b 8b 00 14 sw (sp+20),r11 8003718: 5b 8c 00 10 sw (sp+16),r12 800371c: 5b 8d 00 0c sw (sp+12),r13 8003720: 5b 8e 00 08 sw (sp+8),r14 8003724: 5b 9d 00 04 sw (sp+4),ra 8003728: b8 20 58 00 mv r11,r1 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 800372c: 78 01 08 01 mvhi r1,0x801 8003730: 38 21 38 1c ori r1,r1,0x381c 8003734: 28 21 00 00 lw r1,(r1+0) Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 8003738: 5b 85 00 18 sw (sp+24),r5 800373c: b8 40 70 00 mv r14,r2 8003740: b8 80 68 00 mv r13,r4 8003744: 20 6c 00 ff andi r12,r3,0xff _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 8003748: 44 20 00 0b be r1,r0,8003774 <_CORE_mutex_Seize+0x64> 800374c: 45 80 00 0a be r12,r0,8003774 <_CORE_mutex_Seize+0x64> <== NEVER TAKEN 8003750: 78 01 08 01 mvhi r1,0x801 8003754: 38 21 39 9c ori r1,r1,0x399c 8003758: 28 21 00 00 lw r1,(r1+0) 800375c: 34 02 00 01 mvi r2,1 8003760: 50 41 00 05 bgeu r2,r1,8003774 <_CORE_mutex_Seize+0x64> 8003764: 34 01 00 00 mvi r1,0 8003768: 34 02 00 00 mvi r2,0 800376c: 34 03 00 12 mvi r3,18 8003770: f8 00 02 2e calli 8004028 <_Internal_error_Occurred> 8003774: b9 60 08 00 mv r1,r11 8003778: 37 82 00 18 addi r2,sp,24 800377c: f8 00 15 56 calli 8008cd4 <_CORE_mutex_Seize_interrupt_trylock> 8003780: 44 20 00 19 be r1,r0,80037e4 <_CORE_mutex_Seize+0xd4> 8003784: 78 01 08 01 mvhi r1,0x801 8003788: 38 21 39 e8 ori r1,r1,0x39e8 800378c: 5d 80 00 07 bne r12,r0,80037a8 <_CORE_mutex_Seize+0x98> 8003790: 2b 82 00 18 lw r2,(sp+24) 8003794: d0 02 00 00 wcsr IE,r2 8003798: 28 21 00 0c lw r1,(r1+12) 800379c: 34 02 00 01 mvi r2,1 80037a0: 58 22 00 34 sw (r1+52),r2 80037a4: e0 00 00 10 bi 80037e4 <_CORE_mutex_Seize+0xd4> 80037a8: 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; 80037ac: 34 02 00 01 mvi r2,1 80037b0: 59 62 00 30 sw (r11+48),r2 80037b4: 58 2b 00 44 sw (r1+68),r11 80037b8: 58 2e 00 20 sw (r1+32),r14 80037bc: 78 01 08 01 mvhi r1,0x801 80037c0: 38 21 38 1c ori r1,r1,0x381c 80037c4: 28 22 00 00 lw r2,(r1+0) 80037c8: 34 42 00 01 addi r2,r2,1 80037cc: 58 22 00 00 sw (r1+0),r2 80037d0: 2b 81 00 18 lw r1,(sp+24) 80037d4: d0 01 00 00 wcsr IE,r1 80037d8: b9 60 08 00 mv r1,r11 80037dc: b9 a0 10 00 mv r2,r13 80037e0: fb ff ff ab calli 800368c <_CORE_mutex_Seize_interrupt_blocking> } 80037e4: 2b 9d 00 04 lw ra,(sp+4) 80037e8: 2b 8b 00 14 lw r11,(sp+20) 80037ec: 2b 8c 00 10 lw r12,(sp+16) 80037f0: 2b 8d 00 0c lw r13,(sp+12) 80037f4: 2b 8e 00 08 lw r14,(sp+8) 80037f8: 37 9c 00 18 addi sp,sp,24 80037fc: c3 a0 00 00 ret =============================================================================== 08008cd4 <_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 ) { 8008cd4: 37 9c ff fc addi sp,sp,-4 8008cd8: 5b 9d 00 04 sw (sp+4),ra 8008cdc: b8 20 18 00 mv r3,r1 { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 8008ce0: 78 01 08 01 mvhi r1,0x801 8008ce4: 38 21 39 e8 ori r1,r1,0x39e8 8008ce8: 28 24 00 0c lw r4,(r1+12) executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 8008cec: 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; 8008cf0: 58 80 00 34 sw (r4+52),r0 if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 8008cf4: 44 20 00 31 be r1,r0,8008db8 <_CORE_mutex_Seize_interrupt_trylock+0xe4> the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; 8008cf8: 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; 8008cfc: 58 60 00 50 sw (r3+80),r0 the_mutex->holder = executing; 8008d00: 58 64 00 5c sw (r3+92),r4 the_mutex->holder_id = executing->Object.id; 8008d04: 58 61 00 60 sw (r3+96),r1 the_mutex->nest_count = 1; 8008d08: 34 01 00 01 mvi r1,1 8008d0c: 58 61 00 54 sw (r3+84),r1 return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); } 8008d10: 28 61 00 48 lw r1,(r3+72) if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 8008d14: 34 05 00 02 mvi r5,2 8008d18: 44 25 00 03 be r1,r5,8008d24 <_CORE_mutex_Seize_interrupt_trylock+0x50> 8008d1c: 34 05 00 03 mvi r5,3 8008d20: 5c 25 00 06 bne r1,r5,8008d38 <_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++; 8008d24: 28 85 00 1c lw r5,(r4+28) 8008d28: 34 a6 00 01 addi r6,r5,1 8008d2c: 58 86 00 1c sw (r4+28),r6 } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { 8008d30: 34 06 00 03 mvi r6,3 8008d34: 44 26 00 04 be r1,r6,8008d44 <_CORE_mutex_Seize_interrupt_trylock+0x70> _ISR_Enable( *level_p ); 8008d38: 28 41 00 00 lw r1,(r2+0) 8008d3c: d0 01 00 00 wcsr IE,r1 8008d40: e0 00 00 2f bi 8008dfc <_CORE_mutex_Seize_interrupt_trylock+0x128> */ { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; 8008d44: 28 66 00 4c lw r6,(r3+76) current = executing->current_priority; 8008d48: 28 81 00 14 lw r1,(r4+20) if ( current == ceiling ) { 8008d4c: 5c 26 00 04 bne r1,r6,8008d5c <_CORE_mutex_Seize_interrupt_trylock+0x88> _ISR_Enable( *level_p ); 8008d50: 28 41 00 00 lw r1,(r2+0) 8008d54: d0 01 00 00 wcsr IE,r1 8008d58: e0 00 00 29 bi 8008dfc <_CORE_mutex_Seize_interrupt_trylock+0x128> return 0; } if ( current > ceiling ) { 8008d5c: 50 c1 00 0e bgeu r6,r1,8008d94 <_CORE_mutex_Seize_interrupt_trylock+0xc0> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8008d60: 78 01 08 01 mvhi r1,0x801 8008d64: 38 21 38 1c ori r1,r1,0x381c 8008d68: 28 24 00 00 lw r4,(r1+0) 8008d6c: 34 84 00 01 addi r4,r4,1 8008d70: 58 24 00 00 sw (r1+0),r4 _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); 8008d74: 28 41 00 00 lw r1,(r2+0) 8008d78: d0 01 00 00 wcsr IE,r1 _Thread_Change_priority( 8008d7c: 28 61 00 5c lw r1,(r3+92) 8008d80: 28 62 00 4c lw r2,(r3+76) 8008d84: 34 03 00 00 mvi r3,0 8008d88: fb ff ef 6c calli 8004b38 <_Thread_Change_priority> the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch(); 8008d8c: fb ff f0 bf calli 8005088 <_Thread_Enable_dispatch> 8008d90: e0 00 00 1b bi 8008dfc <_CORE_mutex_Seize_interrupt_trylock+0x128> return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 8008d94: 34 01 00 06 mvi r1,6 8008d98: 58 81 00 34 sw (r4+52),r1 the_mutex->lock = CORE_MUTEX_UNLOCKED; 8008d9c: 34 01 00 01 mvi r1,1 8008da0: 58 61 00 50 sw (r3+80),r1 the_mutex->nest_count = 0; /* undo locking above */ 8008da4: 58 60 00 54 sw (r3+84),r0 executing->resource_count--; /* undo locking above */ 8008da8: 58 85 00 1c sw (r4+28),r5 _ISR_Enable( *level_p ); 8008dac: 28 41 00 00 lw r1,(r2+0) 8008db0: d0 01 00 00 wcsr IE,r1 8008db4: e0 00 00 12 bi 8008dfc <_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 ) ) { 8008db8: 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; 8008dbc: 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 ) ) { 8008dc0: 5c a4 00 10 bne r5,r4,8008e00 <_CORE_mutex_Seize_interrupt_trylock+0x12c> switch ( the_mutex->Attributes.lock_nesting_behavior ) { 8008dc4: 28 64 00 40 lw r4,(r3+64) 8008dc8: 44 80 00 03 be r4,r0,8008dd4 <_CORE_mutex_Seize_interrupt_trylock+0x100> 8008dcc: 5c 81 00 0d bne r4,r1,8008e00 <_CORE_mutex_Seize_interrupt_trylock+0x12c><== ALWAYS TAKEN 8008dd0: e0 00 00 07 bi 8008dec <_CORE_mutex_Seize_interrupt_trylock+0x118><== NOT EXECUTED case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; 8008dd4: 28 61 00 54 lw r1,(r3+84) 8008dd8: 34 21 00 01 addi r1,r1,1 8008ddc: 58 61 00 54 sw (r3+84),r1 _ISR_Enable( *level_p ); 8008de0: 28 41 00 00 lw r1,(r2+0) 8008de4: d0 01 00 00 wcsr IE,r1 8008de8: e0 00 00 05 bi 8008dfc <_CORE_mutex_Seize_interrupt_trylock+0x128> return 0; case CORE_MUTEX_NESTING_IS_ERROR: executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; 8008dec: 34 01 00 02 mvi r1,2 <== NOT EXECUTED 8008df0: 58 a1 00 34 sw (r5+52),r1 <== NOT EXECUTED _ISR_Enable( *level_p ); 8008df4: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 8008df8: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED return 0; 8008dfc: 34 01 00 00 mvi r1,0 8008e00: 2b 9d 00 04 lw ra,(sp+4) 8008e04: 37 9c 00 04 addi sp,sp,4 8008e08: c3 a0 00 00 ret =============================================================================== 08003960 <_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 ) { 8003960: 37 9c ff f8 addi sp,sp,-8 8003964: 5b 8b 00 08 sw (sp+8),r11 8003968: 5b 9d 00 04 sw (sp+4),ra 800396c: 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)) ) { 8003970: f8 00 06 bf calli 800546c <_Thread_queue_Dequeue> { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 8003974: 34 02 00 00 mvi r2,0 if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 8003978: 5c 20 00 0d bne r1,r0,80039ac <_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 ); 800397c: 90 00 08 00 rcsr r1,IE 8003980: 34 02 ff fe mvi r2,-2 8003984: a0 22 10 00 and r2,r1,r2 8003988: d0 02 00 00 wcsr IE,r2 if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 800398c: 29 63 00 48 lw r3,(r11+72) 8003990: 29 64 00 40 lw r4,(r11+64) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 8003994: 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 ) 8003998: 50 64 00 04 bgeu r3,r4,80039a8 <_CORE_semaphore_Surrender+0x48><== NEVER TAKEN the_semaphore->count += 1; 800399c: 34 63 00 01 addi r3,r3,1 80039a0: 59 63 00 48 sw (r11+72),r3 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 80039a4: 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 ); 80039a8: d0 01 00 00 wcsr IE,r1 } return status; } 80039ac: b8 40 08 00 mv r1,r2 80039b0: 2b 9d 00 04 lw ra,(sp+4) 80039b4: 2b 8b 00 08 lw r11,(sp+8) 80039b8: 37 9c 00 08 addi sp,sp,8 80039bc: c3 a0 00 00 ret =============================================================================== 0800cbac <_Event_Seize>: rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 800cbac: 37 9c ff f8 addi sp,sp,-8 800cbb0: 5b 8b 00 08 sw (sp+8),r11 800cbb4: 5b 9d 00 04 sw (sp+4),ra rtems_event_set pending_events; ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; 800cbb8: 78 05 08 01 mvhi r5,0x801 800cbbc: 38 a5 8a 68 ori r5,r5,0x8a68 800cbc0: 28 ab 00 0c lw r11,(r5+12) executing->Wait.return_code = RTEMS_SUCCESSFUL; 800cbc4: 59 60 00 34 sw (r11+52),r0 api = executing->API_Extensions[ THREAD_API_RTEMS ]; 800cbc8: 29 67 01 24 lw r7,(r11+292) _ISR_Disable( level ); 800cbcc: 90 00 30 00 rcsr r6,IE 800cbd0: 34 05 ff fe mvi r5,-2 800cbd4: a0 c5 28 00 and r5,r6,r5 800cbd8: d0 05 00 00 wcsr IE,r5 pending_events = api->pending_events; 800cbdc: 28 e8 00 00 lw r8,(r7+0) RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 800cbe0: a0 28 28 00 and r5,r1,r8 seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && 800cbe4: 44 a0 00 09 be r5,r0,800cc08 <_Event_Seize+0x5c> 800cbe8: 44 a1 00 03 be r5,r1,800cbf4 <_Event_Seize+0x48> */ RTEMS_INLINE_ROUTINE bool _Options_Is_any ( rtems_option option_set ) { return (option_set & RTEMS_EVENT_ANY) ? true : false; 800cbec: 20 49 00 02 andi r9,r2,0x2 (seized_events == event_in || _Options_Is_any( option_set )) ) { 800cbf0: 45 20 00 06 be r9,r0,800cc08 <_Event_Seize+0x5c> <== NEVER TAKEN RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear( rtems_event_set the_event_set, rtems_event_set the_mask ) { return ( the_event_set & ~(the_mask) ); 800cbf4: a4 a0 08 00 not r1,r5 800cbf8: a0 28 40 00 and r8,r1,r8 api->pending_events = 800cbfc: 58 e8 00 00 sw (r7+0),r8 _Event_sets_Clear( pending_events, seized_events ); _ISR_Enable( level ); 800cc00: d0 06 00 00 wcsr IE,r6 800cc04: e0 00 00 06 bi 800cc1c <_Event_Seize+0x70> */ RTEMS_INLINE_ROUTINE bool _Options_Is_no_wait ( rtems_option option_set ) { return (option_set & RTEMS_NO_WAIT) ? true : false; 800cc08: 20 47 00 01 andi r7,r2,0x1 *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { 800cc0c: 44 e0 00 06 be r7,r0,800cc24 <_Event_Seize+0x78> _ISR_Enable( level ); 800cc10: d0 06 00 00 wcsr IE,r6 executing->Wait.return_code = RTEMS_UNSATISFIED; 800cc14: 34 01 00 0d mvi r1,13 800cc18: 59 61 00 34 sw (r11+52),r1 *event_out = seized_events; 800cc1c: 58 85 00 00 sw (r4+0),r5 return; 800cc20: e0 00 00 27 bi 800ccbc <_Event_Seize+0x110> * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; executing->Wait.count = (uint32_t) event_in; 800cc24: 59 61 00 24 sw (r11+36),r1 executing->Wait.return_argument = event_out; _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 800cc28: 78 01 08 01 mvhi r1,0x801 * set properly when we are marked as in the event critical section. * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; 800cc2c: 59 62 00 30 sw (r11+48),r2 executing->Wait.count = (uint32_t) event_in; executing->Wait.return_argument = event_out; _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 800cc30: 38 21 8b 94 ori r1,r1,0x8b94 800cc34: 34 02 00 01 mvi r2,1 * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; executing->Wait.count = (uint32_t) event_in; executing->Wait.return_argument = event_out; 800cc38: 59 64 00 28 sw (r11+40),r4 _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 800cc3c: 58 22 00 00 sw (r1+0),r2 _ISR_Enable( level ); 800cc40: d0 06 00 00 wcsr IE,r6 if ( ticks ) { 800cc44: 44 60 00 0d be r3,r0,800cc78 <_Event_Seize+0xcc> _Watchdog_Initialize( 800cc48: 29 62 00 08 lw r2,(r11+8) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 800cc4c: 78 01 08 00 mvhi r1,0x800 800cc50: 38 21 ce 74 ori r1,r1,0xce74 800cc54: 59 61 00 64 sw (r11+100),r1 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800cc58: 78 01 08 01 mvhi r1,0x801 void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 800cc5c: 59 62 00 68 sw (r11+104),r2 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 800cc60: 59 60 00 50 sw (r11+80),r0 the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 800cc64: 59 60 00 6c sw (r11+108),r0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 800cc68: 59 63 00 54 sw (r11+84),r3 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800cc6c: 38 21 89 60 ori r1,r1,0x8960 800cc70: 35 62 00 48 addi r2,r11,72 800cc74: fb ff eb 0d calli 80078a8 <_Watchdog_Insert> NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); 800cc78: b9 60 08 00 mv r1,r11 800cc7c: 34 02 01 00 mvi r2,256 800cc80: fb ff e9 08 calli 80070a0 <_Thread_Set_state> _ISR_Disable( level ); 800cc84: 90 00 18 00 rcsr r3,IE 800cc88: 34 01 ff fe mvi r1,-2 800cc8c: a0 61 08 00 and r1,r3,r1 800cc90: d0 01 00 00 wcsr IE,r1 sync_state = _Event_Sync_state; 800cc94: 78 02 08 01 mvhi r2,0x801 800cc98: 38 42 8b 94 ori r2,r2,0x8b94 800cc9c: 28 41 00 00 lw r1,(r2+0) _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 800cca0: 58 40 00 00 sw (r2+0),r0 if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 800cca4: 34 02 00 01 mvi r2,1 800cca8: 5c 22 00 03 bne r1,r2,800ccb4 <_Event_Seize+0x108> _ISR_Enable( level ); 800ccac: d0 03 00 00 wcsr IE,r3 return; 800ccb0: e0 00 00 03 bi 800ccbc <_Event_Seize+0x110> * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 800ccb4: b9 60 10 00 mv r2,r11 800ccb8: f8 00 05 53 calli 800e204 <_Thread_blocking_operation_Cancel> } 800ccbc: 2b 9d 00 04 lw ra,(sp+4) 800ccc0: 2b 8b 00 08 lw r11,(sp+8) 800ccc4: 37 9c 00 08 addi sp,sp,8 800ccc8: c3 a0 00 00 ret =============================================================================== 0800cd34 <_Event_Surrender>: */ void _Event_Surrender( Thread_Control *the_thread ) { 800cd34: 37 9c ff f8 addi sp,sp,-8 800cd38: 5b 8b 00 08 sw (sp+8),r11 800cd3c: 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 ]; 800cd40: 28 24 01 24 lw r4,(r1+292) option_set = (rtems_option) the_thread->Wait.option; 800cd44: 28 28 00 30 lw r8,(r1+48) */ void _Event_Surrender( Thread_Control *the_thread ) { 800cd48: 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 ); 800cd4c: 90 00 08 00 rcsr r1,IE 800cd50: 34 07 ff fe mvi r7,-2 800cd54: a0 27 38 00 and r7,r1,r7 800cd58: d0 07 00 00 wcsr IE,r7 pending_events = api->pending_events; 800cd5c: 28 85 00 00 lw r5,(r4+0) event_condition = (rtems_event_set) the_thread->Wait.count; 800cd60: 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 ); 800cd64: 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 ) ) { 800cd68: 5c 40 00 03 bne r2,r0,800cd74 <_Event_Surrender+0x40> _ISR_Enable( level ); 800cd6c: d0 01 00 00 wcsr IE,r1 return; 800cd70: e0 00 00 3d bi 800ce64 <_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() && 800cd74: 78 03 08 01 mvhi r3,0x801 800cd78: 38 63 8a 68 ori r3,r3,0x8a68 800cd7c: 28 69 00 08 lw r9,(r3+8) 800cd80: 45 20 00 1a be r9,r0,800cde8 <_Event_Surrender+0xb4> 800cd84: 28 63 00 0c lw r3,(r3+12) 800cd88: 5d 63 00 18 bne r11,r3,800cde8 <_Event_Surrender+0xb4> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 800cd8c: 78 03 08 01 mvhi r3,0x801 800cd90: 38 63 8b 94 ori r3,r3,0x8b94 800cd94: 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 ) && 800cd98: 34 09 00 02 mvi r9,2 800cd9c: 45 49 00 04 be r10,r9,800cdac <_Event_Surrender+0x78> <== NEVER TAKEN ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 800cda0: 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) || 800cda4: 34 03 00 01 mvi r3,1 800cda8: 5d 23 00 10 bne r9,r3,800cde8 <_Event_Surrender+0xb4> <== NEVER TAKEN (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 800cdac: 44 46 00 03 be r2,r6,800cdb8 <_Event_Surrender+0x84> */ RTEMS_INLINE_ROUTINE bool _Options_Is_any ( rtems_option option_set ) { return (option_set & RTEMS_EVENT_ANY) ? true : false; 800cdb0: 21 08 00 02 andi r8,r8,0x2 800cdb4: 45 00 00 0b be r8,r0,800cde0 <_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) ); 800cdb8: a4 40 18 00 not r3,r2 800cdbc: 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; 800cdc0: 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 ); 800cdc4: 58 85 00 00 sw (r4+0),r5 the_thread->Wait.count = 0; 800cdc8: 59 60 00 24 sw (r11+36),r0 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800cdcc: 58 62 00 00 sw (r3+0),r2 _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 800cdd0: 78 02 08 01 mvhi r2,0x801 800cdd4: 38 42 8b 94 ori r2,r2,0x8b94 800cdd8: 34 03 00 03 mvi r3,3 800cddc: 58 43 00 00 sw (r2+0),r3 } _ISR_Enable( level ); 800cde0: d0 01 00 00 wcsr IE,r1 return; 800cde4: e0 00 00 20 bi 800ce64 <_Event_Surrender+0x130> */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_event ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_EVENT); 800cde8: 29 63 00 10 lw r3,(r11+16) 800cdec: 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 ) ) { 800cdf0: 44 60 00 1c be r3,r0,800ce60 <_Event_Surrender+0x12c> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 800cdf4: 44 46 00 03 be r2,r6,800ce00 <_Event_Surrender+0xcc> 800cdf8: 21 08 00 02 andi r8,r8,0x2 800cdfc: 45 00 00 19 be r8,r0,800ce60 <_Event_Surrender+0x12c> <== NEVER TAKEN 800ce00: a4 40 18 00 not r3,r2 800ce04: 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; 800ce08: 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 ); 800ce0c: 58 85 00 00 sw (r4+0),r5 the_thread->Wait.count = 0; 800ce10: 59 60 00 24 sw (r11+36),r0 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800ce14: 58 62 00 00 sw (r3+0),r2 _ISR_Flash( level ); 800ce18: d0 01 00 00 wcsr IE,r1 800ce1c: d0 07 00 00 wcsr IE,r7 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 800ce20: 29 63 00 50 lw r3,(r11+80) 800ce24: 34 02 00 02 mvi r2,2 800ce28: 44 62 00 03 be r3,r2,800ce34 <_Event_Surrender+0x100> _ISR_Enable( level ); 800ce2c: d0 01 00 00 wcsr IE,r1 800ce30: e0 00 00 06 bi 800ce48 <_Event_Surrender+0x114> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 800ce34: 34 02 00 03 mvi r2,3 800ce38: 59 62 00 50 sw (r11+80),r2 _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 800ce3c: d0 01 00 00 wcsr IE,r1 (void) _Watchdog_Remove( &the_thread->Timer ); 800ce40: 35 61 00 48 addi r1,r11,72 800ce44: fb ff ea f6 calli 8007a1c <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800ce48: 78 03 08 01 mvhi r3,0x801 800ce4c: 38 63 6e c4 ori r3,r3,0x6ec4 800ce50: 28 62 00 00 lw r2,(r3+0) 800ce54: b9 60 08 00 mv r1,r11 800ce58: f8 00 05 03 calli 800e264 <_Thread_Clear_state> 800ce5c: e0 00 00 02 bi 800ce64 <_Event_Surrender+0x130> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 800ce60: d0 01 00 00 wcsr IE,r1 } 800ce64: 2b 9d 00 04 lw ra,(sp+4) 800ce68: 2b 8b 00 08 lw r11,(sp+8) 800ce6c: 37 9c 00 08 addi sp,sp,8 800ce70: c3 a0 00 00 ret =============================================================================== 0800ce74 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 800ce74: 37 9c ff f8 addi sp,sp,-8 800ce78: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 800ce7c: 37 82 00 08 addi r2,sp,8 800ce80: fb ff e5 b3 calli 800654c <_Thread_Get> switch ( location ) { 800ce84: 2b 82 00 08 lw r2,(sp+8) 800ce88: 5c 40 00 1d bne r2,r0,800cefc <_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 ); 800ce8c: 90 00 18 00 rcsr r3,IE 800ce90: 34 02 ff fe mvi r2,-2 800ce94: a0 62 10 00 and r2,r3,r2 800ce98: d0 02 00 00 wcsr IE,r2 RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 800ce9c: 78 02 08 01 mvhi r2,0x801 800cea0: 38 42 8a 68 ori r2,r2,0x8a68 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 800cea4: 28 42 00 0c lw r2,(r2+12) _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 800cea8: 58 20 00 24 sw (r1+36),r0 if ( _Thread_Is_executing( the_thread ) ) { 800ceac: 5c 22 00 08 bne r1,r2,800cecc <_Event_Timeout+0x58> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 800ceb0: 78 02 08 01 mvhi r2,0x801 800ceb4: 38 42 8b 94 ori r2,r2,0x8b94 800ceb8: 28 45 00 00 lw r5,(r2+0) 800cebc: 34 04 00 01 mvi r4,1 800cec0: 5c a4 00 03 bne r5,r4,800cecc <_Event_Timeout+0x58> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800cec4: 34 04 00 02 mvi r4,2 800cec8: 58 44 00 00 sw (r2+0),r4 } the_thread->Wait.return_code = RTEMS_TIMEOUT; 800cecc: 34 02 00 06 mvi r2,6 800ced0: 58 22 00 34 sw (r1+52),r2 _ISR_Enable( level ); 800ced4: d0 03 00 00 wcsr IE,r3 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800ced8: 78 03 08 01 mvhi r3,0x801 800cedc: 38 63 6e c4 ori r3,r3,0x6ec4 800cee0: 28 62 00 00 lw r2,(r3+0) 800cee4: f8 00 04 e0 calli 800e264 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 800cee8: 78 01 08 01 mvhi r1,0x801 800ceec: 38 21 88 9c ori r1,r1,0x889c 800cef0: 28 22 00 00 lw r2,(r1+0) 800cef4: 34 42 ff ff addi r2,r2,-1 800cef8: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 800cefc: 2b 9d 00 04 lw ra,(sp+4) 800cf00: 37 9c 00 08 addi sp,sp,8 800cf04: c3 a0 00 00 ret =============================================================================== 08008eb8 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 8008eb8: 37 9c ff b8 addi sp,sp,-72 8008ebc: 5b 8b 00 44 sw (sp+68),r11 8008ec0: 5b 8c 00 40 sw (sp+64),r12 8008ec4: 5b 8d 00 3c sw (sp+60),r13 8008ec8: 5b 8e 00 38 sw (sp+56),r14 8008ecc: 5b 8f 00 34 sw (sp+52),r15 8008ed0: 5b 90 00 30 sw (sp+48),r16 8008ed4: 5b 91 00 2c sw (sp+44),r17 8008ed8: 5b 92 00 28 sw (sp+40),r18 8008edc: 5b 93 00 24 sw (sp+36),r19 8008ee0: 5b 94 00 20 sw (sp+32),r20 8008ee4: 5b 95 00 1c sw (sp+28),r21 8008ee8: 5b 96 00 18 sw (sp+24),r22 8008eec: 5b 97 00 14 sw (sp+20),r23 8008ef0: 5b 98 00 10 sw (sp+16),r24 8008ef4: 5b 99 00 0c sw (sp+12),r25 8008ef8: 5b 9b 00 08 sw (sp+8),fp 8008efc: 5b 9d 00 04 sw (sp+4),ra Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE 8008f00: 34 55 00 04 addi r21,r2,4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 8008f04: b8 20 60 00 mv r12,r1 if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 8008f08: 28 2e 00 08 lw r14,(r1+8) Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; 8008f0c: 28 33 00 10 lw r19,(r1+16) Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 8008f10: b8 40 68 00 mv r13,r2 8008f14: b8 60 78 00 mv r15,r3 8008f18: b8 80 90 00 mv r18,r4 uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { /* Integer overflow occured */ return NULL; 8008f1c: 34 01 00 00 mvi r1,0 - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 8008f20: 54 55 00 53 bgu r2,r21,800906c <_Heap_Allocate_aligned_with_boundary+0x1b4> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 8008f24: 44 80 00 04 be r4,r0,8008f34 <_Heap_Allocate_aligned_with_boundary+0x7c> if ( boundary < alloc_size ) { 8008f28: 54 44 00 51 bgu r2,r4,800906c <_Heap_Allocate_aligned_with_boundary+0x1b4> return NULL; } if ( alignment == 0 ) { 8008f2c: 5c 60 00 02 bne r3,r0,8008f34 <_Heap_Allocate_aligned_with_boundary+0x7c> alignment = page_size; 8008f30: ba 60 78 00 mv r15,r19 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; 8008f34: 34 18 00 04 mvi r24,4 if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { alignment = page_size; 8008f38: 34 11 00 00 mvi r17,0 8008f3c: 34 1b ff fe mvi fp,-2 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 8008f40: 36 79 00 07 addi r25,r19,7 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; 8008f44: cb 0d c0 00 sub r24,r24,r13 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 8008f48: 34 17 ff f8 mvi r23,-8 8008f4c: e0 00 00 42 bi 8009054 <_Heap_Allocate_aligned_with_boundary+0x19c> /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 8008f50: 29 cb 00 04 lw r11,(r14+4) while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; 8008f54: 36 31 00 01 addi r17,r17,1 /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 8008f58: 52 ab 00 3e bgeu r21,r11,8009050 <_Heap_Allocate_aligned_with_boundary+0x198> 8008f5c: 35 d4 00 08 addi r20,r14,8 if ( alignment == 0 ) { 8008f60: 5d e0 00 03 bne r15,r0,8008f6c <_Heap_Allocate_aligned_with_boundary+0xb4> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 8008f64: ba 80 58 00 mv r11,r20 8008f68: e0 00 00 30 bi 8009028 <_Heap_Allocate_aligned_with_boundary+0x170> uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 8008f6c: 29 96 00 14 lw r22,(r12+20) - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8008f70: a1 7b 58 00 and r11,r11,fp uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; 8008f74: b5 cb 58 00 add r11,r14,r11 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 8008f78: cb 36 80 00 sub r16,r25,r22 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 8008f7c: b6 0b 80 00 add r16,r16,r11 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 8008f80: b7 0b 58 00 add r11,r24,r11 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 8008f84: b9 60 08 00 mv r1,r11 8008f88: b9 e0 10 00 mv r2,r15 8008f8c: f8 00 1f 1e calli 8010c04 <__umodsi3> 8008f90: c9 61 58 00 sub r11,r11,r1 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { 8008f94: 52 0b 00 05 bgeu r16,r11,8008fa8 <_Heap_Allocate_aligned_with_boundary+0xf0> 8008f98: ba 00 08 00 mv r1,r16 8008f9c: b9 e0 10 00 mv r2,r15 8008fa0: f8 00 1f 19 calli 8010c04 <__umodsi3> 8008fa4: ca 01 58 00 sub r11,r16,r1 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 8008fa8: 46 40 00 15 be r18,r0,8008ffc <_Heap_Allocate_aligned_with_boundary+0x144> uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 8008fac: b6 8d 08 00 add r1,r20,r13 /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; 8008fb0: b5 6d 80 00 add r16,r11,r13 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 8008fb4: 5b 81 00 48 sw (sp+72),r1 8008fb8: e0 00 00 09 bi 8008fdc <_Heap_Allocate_aligned_with_boundary+0x124> uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 8008fbc: 2b 82 00 48 lw r2,(sp+72) 8008fc0: 54 41 00 24 bgu r2,r1,8009050 <_Heap_Allocate_aligned_with_boundary+0x198> return 0; } alloc_begin = boundary_line - alloc_size; 8008fc4: c8 2d 58 00 sub r11,r1,r13 8008fc8: b9 60 08 00 mv r1,r11 8008fcc: b9 e0 10 00 mv r2,r15 8008fd0: f8 00 1f 0d calli 8010c04 <__umodsi3> 8008fd4: c9 61 58 00 sub r11,r11,r1 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 8008fd8: b5 6d 80 00 add r16,r11,r13 8008fdc: ba 00 08 00 mv r1,r16 8008fe0: ba 40 10 00 mv r2,r18 8008fe4: f8 00 1f 08 calli 8010c04 <__umodsi3> 8008fe8: ca 01 08 00 sub r1,r16,r1 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 8008fec: f6 01 80 00 cmpgu r16,r16,r1 8008ff0: f4 2b 10 00 cmpgu r2,r1,r11 8008ff4: a2 02 80 00 and r16,r16,r2 8008ff8: 5e 00 ff f1 bne r16,r0,8008fbc <_Heap_Allocate_aligned_with_boundary+0x104> boundary_line = _Heap_Align_down( alloc_end, boundary ); } } /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { 8008ffc: 56 8b 00 15 bgu r20,r11,8009050 <_Heap_Allocate_aligned_with_boundary+0x198> 8009000: ba 60 10 00 mv r2,r19 8009004: ca ee 80 00 sub r16,r23,r14 8009008: b9 60 08 00 mv r1,r11 800900c: f8 00 1e fe calli 8010c04 <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 8009010: b6 0b 80 00 add r16,r16,r11 uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; 8009014: ca 01 08 00 sub r1,r16,r1 if ( free_size >= min_block_size || free_size == 0 ) { 8009018: 64 22 00 00 cmpei r2,r1,0 800901c: f0 36 08 00 cmpgeu r1,r1,r22 8009020: b8 41 08 00 or r1,r2,r1 8009024: 44 20 00 0b be r1,r0,8009050 <_Heap_Allocate_aligned_with_boundary+0x198> boundary ); } } if ( alloc_begin != 0 ) { 8009028: 45 60 00 0a be r11,r0,8009050 <_Heap_Allocate_aligned_with_boundary+0x198><== NEVER TAKEN block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 800902c: 29 81 00 4c lw r1,(r12+76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 8009030: b9 c0 10 00 mv r2,r14 8009034: b9 60 18 00 mv r3,r11 block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 8009038: b4 31 08 00 add r1,r1,r17 800903c: 59 81 00 4c sw (r12+76),r1 block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 8009040: b9 a0 20 00 mv r4,r13 8009044: b9 80 08 00 mv r1,r12 8009048: fb ff eb 9c calli 8003eb8 <_Heap_Block_allocate> 800904c: e0 00 00 04 bi 800905c <_Heap_Allocate_aligned_with_boundary+0x1a4> if ( alloc_begin != 0 ) { break; } block = block->next; 8009050: 29 ce 00 08 lw r14,(r14+8) if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 8009054: 5d cc ff bf bne r14,r12,8008f50 <_Heap_Allocate_aligned_with_boundary+0x98> 8009058: 34 0b 00 00 mvi r11,0 boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { 800905c: 29 81 00 44 lw r1,(r12+68) 8009060: 50 31 00 02 bgeu r1,r17,8009068 <_Heap_Allocate_aligned_with_boundary+0x1b0> stats->max_search = search_count; 8009064: 59 91 00 44 sw (r12+68),r17 } return (void *) alloc_begin; 8009068: b9 60 08 00 mv r1,r11 } 800906c: 2b 9d 00 04 lw ra,(sp+4) 8009070: 2b 8b 00 44 lw r11,(sp+68) 8009074: 2b 8c 00 40 lw r12,(sp+64) 8009078: 2b 8d 00 3c lw r13,(sp+60) 800907c: 2b 8e 00 38 lw r14,(sp+56) 8009080: 2b 8f 00 34 lw r15,(sp+52) 8009084: 2b 90 00 30 lw r16,(sp+48) 8009088: 2b 91 00 2c lw r17,(sp+44) 800908c: 2b 92 00 28 lw r18,(sp+40) 8009090: 2b 93 00 24 lw r19,(sp+36) 8009094: 2b 94 00 20 lw r20,(sp+32) 8009098: 2b 95 00 1c lw r21,(sp+28) 800909c: 2b 96 00 18 lw r22,(sp+24) 80090a0: 2b 97 00 14 lw r23,(sp+20) 80090a4: 2b 98 00 10 lw r24,(sp+16) 80090a8: 2b 99 00 0c lw r25,(sp+12) 80090ac: 2b 9b 00 08 lw fp,(sp+8) 80090b0: 37 9c 00 48 addi sp,sp,72 80090b4: c3 a0 00 00 ret =============================================================================== 08009264 <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { 8009264: 37 9c ff b8 addi sp,sp,-72 8009268: 5b 8b 00 40 sw (sp+64),r11 800926c: 5b 8c 00 3c sw (sp+60),r12 8009270: 5b 8d 00 38 sw (sp+56),r13 8009274: 5b 8e 00 34 sw (sp+52),r14 8009278: 5b 8f 00 30 sw (sp+48),r15 800927c: 5b 90 00 2c sw (sp+44),r16 8009280: 5b 91 00 28 sw (sp+40),r17 8009284: 5b 92 00 24 sw (sp+36),r18 8009288: 5b 93 00 20 sw (sp+32),r19 800928c: 5b 94 00 1c sw (sp+28),r20 8009290: 5b 95 00 18 sw (sp+24),r21 8009294: 5b 96 00 14 sw (sp+20),r22 8009298: 5b 97 00 10 sw (sp+16),r23 800929c: 5b 98 00 0c sw (sp+12),r24 80092a0: 5b 99 00 08 sw (sp+8),r25 80092a4: 5b 9d 00 04 sw (sp+4),ra 80092a8: 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; 80092ac: 5b 80 00 48 sw (sp+72),r0 Heap_Block *extend_last_block = NULL; 80092b0: 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; 80092b4: 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 ) { 80092b8: b8 80 a0 00 mv r20,r4 80092bc: b8 20 58 00 mv r11,r1 80092c0: b8 60 10 00 mv r2,r3 Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 80092c4: 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; 80092c8: 28 36 00 10 lw r22,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 80092cc: 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; 80092d0: 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; 80092d4: 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 ) { 80092d8: 55 cd 00 8e bgu r14,r13,8009510 <_Heap_Extend+0x2ac> return false; } extend_area_ok = _Heap_Get_first_and_last_block( 80092dc: b9 c0 08 00 mv r1,r14 80092e0: ba c0 18 00 mv r3,r22 80092e4: 37 85 00 48 addi r5,sp,72 80092e8: 37 86 00 44 addi r6,sp,68 80092ec: fb ff ea d3 calli 8003e38 <_Heap_Get_first_and_last_block> page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 80092f0: 44 20 00 88 be r1,r0,8009510 <_Heap_Extend+0x2ac> 80092f4: ba a0 78 00 mv r15,r21 80092f8: 34 11 00 00 mvi r17,0 80092fc: 34 13 00 00 mvi r19,0 8009300: 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; 8009304: 29 61 00 18 lw r1,(r11+24) } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8009308: 34 18 ff fe mvi r24,-2 800930c: e0 00 00 02 bi 8009314 <_Heap_Extend+0xb0> 8009310: b9 e0 08 00 mv r1,r15 uintptr_t const sub_area_end = start_block->prev_size; 8009314: 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 8009318: f5 a1 18 00 cmpgu r3,r13,r1 800931c: 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 ( 8009320: a0 62 10 00 and r2,r3,r2 8009324: 5c 40 00 7a bne r2,r0,800950c <_Heap_Extend+0x2a8> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 8009328: 45 a1 00 03 be r13,r1,8009334 <_Heap_Extend+0xd0> <== NEVER TAKEN merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 800932c: 56 4d 00 04 bgu r18,r13,800933c <_Heap_Extend+0xd8> 8009330: e0 00 00 04 bi 8009340 <_Heap_Extend+0xdc> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 8009334: b9 e0 80 00 mv r16,r15 <== NOT EXECUTED 8009338: e0 00 00 02 bi 8009340 <_Heap_Extend+0xdc> <== NOT EXECUTED merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 800933c: 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); 8009340: ba 40 08 00 mv r1,r18 8009344: ba c0 10 00 mv r2,r22 8009348: 36 59 ff f8 addi r25,r18,-8 800934c: f8 00 1f 17 calli 8010fa8 <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 8009350: cb 21 08 00 sub r1,r25,r1 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 8009354: 5d d2 00 04 bne r14,r18,8009364 <_Heap_Extend+0x100> start_block->prev_size = extend_area_end; 8009358: 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 ) 800935c: b8 20 60 00 mv r12,r1 8009360: e0 00 00 04 bi 8009370 <_Heap_Extend+0x10c> merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 8009364: 55 d2 00 02 bgu r14,r18,800936c <_Heap_Extend+0x108> 8009368: e0 00 00 02 bi 8009370 <_Heap_Extend+0x10c> 800936c: 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; 8009370: 28 2f 00 04 lw r15,(r1+4) 8009374: 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); 8009378: 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 ); 800937c: 5d f5 ff e5 bne r15,r21,8009310 <_Heap_Extend+0xac> if ( extend_area_begin < heap->area_begin ) { 8009380: 29 61 00 18 lw r1,(r11+24) 8009384: 51 c1 00 03 bgeu r14,r1,8009390 <_Heap_Extend+0x12c> heap->area_begin = extend_area_begin; 8009388: 59 6e 00 18 sw (r11+24),r14 800938c: e0 00 00 04 bi 800939c <_Heap_Extend+0x138> } else if ( heap->area_end < extend_area_end ) { 8009390: 29 61 00 1c lw r1,(r11+28) 8009394: 50 2d 00 02 bgeu r1,r13,800939c <_Heap_Extend+0x138> heap->area_end = extend_area_end; 8009398: 59 6d 00 1c sw (r11+28),r13 } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 800939c: 2b 81 00 44 lw r1,(sp+68) 80093a0: 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 = 80093a4: 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; 80093a8: 58 4d 00 00 sw (r2+0),r13 extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 80093ac: 38 64 00 01 ori r4,r3,0x1 extend_last_block->prev_size = extend_first_block_size; 80093b0: 58 23 00 00 sw (r1+0),r3 extend_last_block->size_and_flag = 0; if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 80093b4: 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 = 80093b8: 58 44 00 04 sw (r2+4),r4 extend_first_block_size | HEAP_PREV_BLOCK_USED; extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; 80093bc: 58 20 00 04 sw (r1+4),r0 if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 80093c0: 50 43 00 03 bgeu r2,r3,80093cc <_Heap_Extend+0x168> heap->first_block = extend_first_block; 80093c4: 59 62 00 20 sw (r11+32),r2 80093c8: e0 00 00 04 bi 80093d8 <_Heap_Extend+0x174> } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 80093cc: 29 62 00 24 lw r2,(r11+36) 80093d0: 50 41 00 02 bgeu r2,r1,80093d8 <_Heap_Extend+0x174> heap->last_block = extend_last_block; 80093d4: 59 61 00 24 sw (r11+36),r1 } if ( merge_below_block != NULL ) { 80093d8: 46 00 00 12 be r16,r0,8009420 <_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; 80093dc: 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 ); 80093e0: 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; 80093e4: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 80093e8: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED 80093ec: f8 00 1e ef calli 8010fa8 <__umodsi3> <== NOT EXECUTED if ( remainder != 0 ) { 80093f0: 44 20 00 03 be r1,r0,80093fc <_Heap_Extend+0x198> <== NOT EXECUTED return value - remainder + alignment; 80093f4: b5 cf 70 00 add r14,r14,r15 <== NOT EXECUTED 80093f8: 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; 80093fc: 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 = 8009400: 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; 8009404: 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 = 8009408: 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; 800940c: 38 21 00 01 ori r1,r1,0x1 <== NOT EXECUTED 8009410: 58 41 00 04 sw (r2+4),r1 <== NOT EXECUTED _Heap_Free_block( heap, new_first_block ); 8009414: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8009418: fb ff ff 86 calli 8009230 <_Heap_Free_block> <== NOT EXECUTED 800941c: e0 00 00 06 bi 8009434 <_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 ) { 8009420: 46 70 00 05 be r19,r16,8009434 <_Heap_Extend+0x1d0> _Heap_Link_below( 8009424: 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; 8009428: ca 61 98 00 sub r19,r19,r1 800942c: 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 = 8009430: 58 33 00 04 sw (r1+4),r19 link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 8009434: 45 80 00 14 be r12,r0,8009484 <_Heap_Extend+0x220> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 8009438: 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, 800943c: 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( 8009440: c9 ac 68 00 sub r13,r13,r12 8009444: b9 a0 08 00 mv r1,r13 8009448: f8 00 1e d8 calli 8010fa8 <__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) 800944c: 29 83 00 04 lw r3,(r12+4) 8009450: 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 = 8009454: b4 2c 10 00 add r2,r1,r12 (last_block->size_and_flag - last_block_new_size) 8009458: c8 61 18 00 sub r3,r3,r1 | HEAP_PREV_BLOCK_USED; 800945c: 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 = 8009460: 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; 8009464: 29 82 00 04 lw r2,(r12+4) 8009468: 20 42 00 01 andi r2,r2,0x1 block->size_and_flag = size | flag; 800946c: b8 22 08 00 or r1,r1,r2 8009470: 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 ); 8009474: b9 80 10 00 mv r2,r12 8009478: b9 60 08 00 mv r1,r11 800947c: fb ff ff 6d calli 8009230 <_Heap_Free_block> 8009480: e0 00 00 0c bi 80094b0 <_Heap_Extend+0x24c> ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 8009484: 46 2c 00 0b be r17,r12,80094b0 <_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; 8009488: 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 ); 800948c: 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( 8009490: 2b 82 00 44 lw r2,(sp+68) 8009494: 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 ); 8009498: c8 71 18 00 sub r3,r3,r17 block->size_and_flag = size | flag; 800949c: b8 61 08 00 or r1,r3,r1 80094a0: 5a 21 00 04 sw (r17+4),r1 last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 80094a4: 28 41 00 04 lw r1,(r2+4) 80094a8: 38 21 00 01 ori r1,r1,0x1 80094ac: 58 41 00 04 sw (r2+4),r1 extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 80094b0: 65 8c 00 00 cmpei r12,r12,0 80094b4: 66 10 00 00 cmpei r16,r16,0 80094b8: a1 90 60 00 and r12,r12,r16 80094bc: 45 80 00 04 be r12,r0,80094cc <_Heap_Extend+0x268> _Heap_Free_block( heap, extend_first_block ); 80094c0: 2b 82 00 48 lw r2,(sp+72) 80094c4: b9 60 08 00 mv r1,r11 80094c8: fb ff ff 5a calli 8009230 <_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 80094cc: 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( 80094d0: 29 63 00 20 lw r3,(r11+32) stats->size += extended_size; if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; 80094d4: 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; 80094d8: 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( 80094dc: 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; 80094e0: 20 42 00 01 andi r2,r2,0x1 block->size_and_flag = size | flag; 80094e4: b8 62 10 00 or r2,r3,r2 80094e8: 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; 80094ec: 29 61 00 30 lw r1,(r11+48) /* Statistics */ stats->size += extended_size; 80094f0: 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; 80094f4: c8 37 08 00 sub r1,r1,r23 /* Statistics */ stats->size += extended_size; 80094f8: b4 41 10 00 add r2,r2,r1 80094fc: 59 62 00 2c sw (r11+44),r2 if ( extended_size_ptr != NULL ) 8009500: 46 80 00 04 be r20,r0,8009510 <_Heap_Extend+0x2ac> <== NEVER TAKEN *extended_size_ptr = extended_size; 8009504: 5a 81 00 00 sw (r20+0),r1 8009508: e0 00 00 02 bi 8009510 <_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; 800950c: 34 0c 00 00 mvi r12,0 if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; } 8009510: b9 80 08 00 mv r1,r12 8009514: 2b 9d 00 04 lw ra,(sp+4) 8009518: 2b 8b 00 40 lw r11,(sp+64) 800951c: 2b 8c 00 3c lw r12,(sp+60) 8009520: 2b 8d 00 38 lw r13,(sp+56) 8009524: 2b 8e 00 34 lw r14,(sp+52) 8009528: 2b 8f 00 30 lw r15,(sp+48) 800952c: 2b 90 00 2c lw r16,(sp+44) 8009530: 2b 91 00 28 lw r17,(sp+40) 8009534: 2b 92 00 24 lw r18,(sp+36) 8009538: 2b 93 00 20 lw r19,(sp+32) 800953c: 2b 94 00 1c lw r20,(sp+28) 8009540: 2b 95 00 18 lw r21,(sp+24) 8009544: 2b 96 00 14 lw r22,(sp+20) 8009548: 2b 97 00 10 lw r23,(sp+16) 800954c: 2b 98 00 0c lw r24,(sp+12) 8009550: 2b 99 00 08 lw r25,(sp+8) 8009554: 37 9c 00 48 addi sp,sp,72 8009558: c3 a0 00 00 ret =============================================================================== 080090b8 <_Heap_Free>: #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 80090b8: 37 9c ff f4 addi sp,sp,-12 80090bc: 5b 8b 00 0c sw (sp+12),r11 80090c0: 5b 8c 00 08 sw (sp+8),r12 80090c4: 5b 9d 00 04 sw (sp+4),ra 80090c8: 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); 80090cc: 34 4c ff f8 addi r12,r2,-8 80090d0: b8 40 08 00 mv r1,r2 80090d4: 29 62 00 10 lw r2,(r11+16) 80090d8: f8 00 1e cb calli 8010c04 <__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 80090dc: 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); 80090e0: 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; 80090e4: 34 01 00 00 mvi r1,0 80090e8: 54 e3 00 03 bgu r7,r3,80090f4 <_Heap_Free+0x3c> 80090ec: 29 61 00 24 lw r1,(r11+36) 80090f0: f0 23 08 00 cmpgeu r1,r1,r3 Heap_Block *next_block = NULL; uintptr_t block_size = 0; uintptr_t next_block_size = 0; bool next_is_free = false; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 80090f4: b8 20 10 00 mv r2,r1 return false; 80090f8: 34 01 00 00 mvi r1,0 Heap_Block *next_block = NULL; uintptr_t block_size = 0; uintptr_t next_block_size = 0; bool next_is_free = false; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 80090fc: 44 40 00 66 be r2,r0,8009294 <_Heap_Free+0x1dc> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 8009100: 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; 8009104: 34 04 ff fe mvi r4,-2 8009108: 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); 800910c: 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; 8009110: 54 e2 00 03 bgu r7,r2,800911c <_Heap_Free+0x64> <== NEVER TAKEN 8009114: 29 61 00 24 lw r1,(r11+36) 8009118: f0 22 08 00 cmpgeu r1,r1,r2 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 800911c: b8 20 28 00 mv r5,r1 _HAssert( false ); return false; 8009120: 34 01 00 00 mvi r1,0 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 8009124: 44 a0 00 5c be r5,r0,8009294 <_Heap_Free+0x1dc> <== NEVER TAKEN --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 8009128: 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; 800912c: 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 ) ) { 8009130: 45 00 00 59 be r8,r0,8009294 <_Heap_Free+0x1dc> <== NEVER TAKEN _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 8009134: 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; 8009138: 34 01 ff fe mvi r1,-2 800913c: a0 a1 28 00 and r5,r5,r1 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 8009140: 34 08 00 00 mvi r8,0 8009144: 45 22 00 05 be r9,r2,8009158 <_Heap_Free+0xa0> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 8009148: 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; 800914c: 28 28 00 04 lw r8,(r1+4) 8009150: 21 08 00 01 andi r8,r8,0x1 #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 8009154: 65 08 00 00 cmpei r8,r8,0 8009158: 20 c6 00 01 andi r6,r6,0x1 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 800915c: 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 ) ) { 8009160: 5c c0 00 24 bne r6,r0,80091f0 <_Heap_Free+0x138> uintptr_t const prev_size = block->prev_size; 8009164: 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; 8009168: 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); 800916c: 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; 8009170: 54 e3 00 02 bgu r7,r3,8009178 <_Heap_Free+0xc0> <== NEVER TAKEN 8009174: 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 ) ) { 8009178: b8 20 38 00 mv r7,r1 _HAssert( false ); return( false ); 800917c: 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 ) ) { 8009180: 44 e0 00 45 be r7,r0,8009294 <_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; 8009184: 28 67 00 04 lw r7,(r3+4) 8009188: 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) ) { 800918c: 44 e0 00 42 be r7,r0,8009294 <_Heap_Free+0x1dc> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 8009190: 45 00 00 0f be r8,r0,80091cc <_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; 8009194: 28 41 00 08 lw r1,(r2+8) Heap_Block *prev = block->prev; 8009198: 28 42 00 0c lw r2,(r2+12) uintptr_t const size = block_size + prev_size + next_block_size; 800919c: b4 85 28 00 add r5,r4,r5 80091a0: b4 a6 30 00 add r6,r5,r6 prev->next = next; 80091a4: 58 41 00 08 sw (r2+8),r1 next->prev = prev; 80091a8: 58 22 00 0c sw (r1+12),r2 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 80091ac: 29 61 00 38 lw r1,(r11+56) 80091b0: 34 21 ff ff addi r1,r1,-1 80091b4: 59 61 00 38 sw (r11+56),r1 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 80091b8: 38 c1 00 01 ori r1,r6,0x1 80091bc: 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; 80091c0: b4 66 18 00 add r3,r3,r6 80091c4: 58 66 00 00 sw (r3+0),r6 80091c8: e0 00 00 29 bi 800926c <_Heap_Free+0x1b4> } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; 80091cc: b4 86 30 00 add r6,r4,r6 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 80091d0: 38 c1 00 01 ori r1,r6,0x1 80091d4: 58 61 00 04 sw (r3+4),r1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 80091d8: 28 43 00 04 lw r3,(r2+4) 80091dc: 34 01 ff fe mvi r1,-2 next_block->prev_size = size; 80091e0: 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; 80091e4: a0 61 08 00 and r1,r3,r1 80091e8: 58 41 00 04 sw (r2+4),r1 80091ec: e0 00 00 20 bi 800926c <_Heap_Free+0x1b4> next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 80091f0: 45 00 00 0d be r8,r0,8009224 <_Heap_Free+0x16c> uintptr_t const size = block_size + next_block_size; 80091f4: 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; 80091f8: 28 45 00 08 lw r5,(r2+8) Heap_Block *prev = old_block->prev; 80091fc: 28 42 00 0c lw r2,(r2+12) new_block->next = next; 8009200: 58 65 00 08 sw (r3+8),r5 new_block->prev = prev; 8009204: 58 62 00 0c sw (r3+12),r2 next->prev = new_block; prev->next = new_block; 8009208: 58 43 00 08 sw (r2+8),r3 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800920c: 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; 8009210: 58 a3 00 0c sw (r5+12),r3 8009214: 58 62 00 04 sw (r3+4),r2 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 8009218: b4 61 18 00 add r3,r3,r1 800921c: 58 61 00 00 sw (r3+0),r1 8009220: e0 00 00 13 bi 800926c <_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; 8009224: 29 61 00 08 lw r1,(r11+8) new_block->next = next; new_block->prev = block_before; 8009228: 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; 800922c: 58 44 00 00 sw (r2+0),r4 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 8009230: 58 61 00 08 sw (r3+8),r1 new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 8009234: 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; 8009238: 38 81 00 01 ori r1,r4,0x1 800923c: 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; 8009240: 59 63 00 08 sw (r11+8),r3 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 8009244: 28 43 00 04 lw r3,(r2+4) 8009248: 34 01 ff fe mvi r1,-2 800924c: a0 61 08 00 and r1,r3,r1 8009250: 58 41 00 04 sw (r2+4),r1 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 8009254: 29 61 00 38 lw r1,(r11+56) if ( stats->max_free_blocks < stats->free_blocks ) { 8009258: 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; 800925c: 34 21 00 01 addi r1,r1,1 8009260: 59 61 00 38 sw (r11+56),r1 if ( stats->max_free_blocks < stats->free_blocks ) { 8009264: 50 41 00 02 bgeu r2,r1,800926c <_Heap_Free+0x1b4> stats->max_free_blocks = stats->free_blocks; 8009268: 59 61 00 3c sw (r11+60),r1 } } /* Statistics */ --stats->used_blocks; 800926c: 29 61 00 40 lw r1,(r11+64) 8009270: 34 21 ff ff addi r1,r1,-1 8009274: 59 61 00 40 sw (r11+64),r1 ++stats->frees; 8009278: 29 61 00 50 lw r1,(r11+80) 800927c: 34 21 00 01 addi r1,r1,1 8009280: 59 61 00 50 sw (r11+80),r1 stats->free_size += block_size; 8009284: 29 61 00 30 lw r1,(r11+48) 8009288: b4 24 20 00 add r4,r1,r4 800928c: 59 64 00 30 sw (r11+48),r4 return( true ); 8009290: 34 01 00 01 mvi r1,1 } 8009294: 2b 9d 00 04 lw ra,(sp+4) 8009298: 2b 8b 00 0c lw r11,(sp+12) 800929c: 2b 8c 00 08 lw r12,(sp+8) 80092a0: 37 9c 00 0c addi sp,sp,12 80092a4: c3 a0 00 00 ret =============================================================================== 08011488 <_Heap_Resize_block>: void *alloc_begin_ptr, uintptr_t new_alloc_size, uintptr_t *old_size, uintptr_t *new_size ) { 8011488: 37 9c ff e4 addi sp,sp,-28 801148c: 5b 8b 00 1c sw (sp+28),r11 8011490: 5b 8c 00 18 sw (sp+24),r12 8011494: 5b 8d 00 14 sw (sp+20),r13 8011498: 5b 8e 00 10 sw (sp+16),r14 801149c: 5b 8f 00 0c sw (sp+12),r15 80114a0: 5b 90 00 08 sw (sp+8),r16 80114a4: 5b 9d 00 04 sw (sp+4),ra 80114a8: 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); 80114ac: 34 50 ff f8 addi r16,r2,-8 80114b0: b8 40 08 00 mv r1,r2 80114b4: b8 40 60 00 mv r12,r2 80114b8: 29 62 00 10 lw r2,(r11+16) 80114bc: b8 80 78 00 mv r15,r4 80114c0: b8 a0 68 00 mv r13,r5 80114c4: b8 60 70 00 mv r14,r3 80114c8: fb ff fd cf calli 8010c04 <__umodsi3> 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; 80114cc: 29 62 00 20 lw r2,(r11+32) uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *const block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); *old_size = 0; 80114d0: 59 e0 00 00 sw (r15+0),r0 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 80114d4: ca 01 30 00 sub r6,r16,r1 *new_size = 0; 80114d8: 59 a0 00 00 sw (r13+0),r0 new_alloc_size, old_size, new_size ); } else { return HEAP_RESIZE_FATAL_ERROR; 80114dc: 34 01 00 02 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; 80114e0: 54 46 00 38 bgu r2,r6,80115c0 <_Heap_Resize_block+0x138> 80114e4: 29 62 00 24 lw r2,(r11+36) 80114e8: 54 c2 00 36 bgu r6,r2,80115c0 <_Heap_Resize_block+0x138> <== NEVER TAKEN - 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; 80114ec: 28 c2 00 04 lw r2,(r6+4) 80114f0: 34 01 ff fe mvi r1,-2 80114f4: a0 22 10 00 and r2,r1,r2 { Heap_Statistics *const stats = &heap->stats; uintptr_t const block_begin = (uintptr_t) block; uintptr_t block_size = _Heap_Block_size( block ); uintptr_t block_end = block_begin + block_size; 80114f8: b4 c2 38 00 add r7,r6,r2 80114fc: 28 e8 00 04 lw r8,(r7+4) uintptr_t alloc_size = block_end - alloc_begin + HEAP_BLOCK_SIZE_OFFSET; 8011500: c8 ec 48 00 sub r9,r7,r12 8011504: 35 29 00 04 addi r9,r9,4 8011508: a0 28 40 00 and r8,r1,r8 new_size ); } else { return HEAP_RESIZE_FATAL_ERROR; } } 801150c: b4 e8 08 00 add r1,r7,r8 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; 8011510: 28 23 00 04 lw r3,(r1+4) bool next_block_is_free = _Heap_Is_free( next_block );; _HAssert( _Heap_Is_block_in_heap( heap, next_block ) ); _HAssert( _Heap_Is_prev_used( next_block ) ); *old_size = alloc_size; 8011514: 59 e9 00 00 sw (r15+0),r9 8011518: 20 63 00 01 andi r3,r3,0x1 RTEMS_INLINE_ROUTINE bool _Heap_Is_free( const Heap_Block *block ) { return !_Heap_Is_used( block ); 801151c: 18 63 00 01 xori r3,r3,0x1 if ( next_block_is_free ) { 8011520: 44 60 00 03 be r3,r0,801152c <_Heap_Resize_block+0xa4> block_size += next_block_size; 8011524: b4 48 10 00 add r2,r2,r8 alloc_size += next_block_size; 8011528: b5 28 48 00 add r9,r9,r8 } if ( new_alloc_size > alloc_size ) { return HEAP_RESIZE_UNSATISFIED; 801152c: 34 01 00 01 mvi r1,1 if ( next_block_is_free ) { block_size += next_block_size; alloc_size += next_block_size; } if ( new_alloc_size > alloc_size ) { 8011530: 55 c9 00 24 bgu r14,r9,80115c0 <_Heap_Resize_block+0x138> return HEAP_RESIZE_UNSATISFIED; } if ( next_block_is_free ) { 8011534: 44 60 00 13 be r3,r0,8011580 <_Heap_Resize_block+0xf8> 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; 8011538: 28 c1 00 04 lw r1,(r6+4) } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; 801153c: 28 e3 00 0c lw r3,(r7+12) 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; 8011540: 20 21 00 01 andi r1,r1,0x1 block->size_and_flag = size | flag; 8011544: b8 41 08 00 or r1,r2,r1 8011548: 58 c1 00 04 sw (r6+4),r1 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 801154c: 28 e1 00 08 lw r1,(r7+8) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8011550: b4 46 10 00 add r2,r2,r6 RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 8011554: 58 61 00 08 sw (r3+8),r1 next->prev = prev; 8011558: 58 23 00 0c sw (r1+12),r3 _Heap_Block_set_size( block, block_size ); _Heap_Free_list_remove( next_block ); next_block = _Heap_Block_at( block, block_size ); next_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 801155c: 28 41 00 04 lw r1,(r2+4) 8011560: 38 21 00 01 ori r1,r1,0x1 8011564: 58 41 00 04 sw (r2+4),r1 /* Statistics */ --stats->free_blocks; 8011568: 29 61 00 38 lw r1,(r11+56) 801156c: 34 21 ff ff addi r1,r1,-1 8011570: 59 61 00 38 sw (r11+56),r1 stats->free_size -= next_block_size; 8011574: 29 61 00 30 lw r1,(r11+48) 8011578: c8 28 40 00 sub r8,r1,r8 801157c: 59 68 00 30 sw (r11+48),r8 } block = _Heap_Block_allocate( heap, block, alloc_begin, new_alloc_size ); 8011580: b9 80 18 00 mv r3,r12 8011584: b8 c0 10 00 mv r2,r6 8011588: b9 60 08 00 mv r1,r11 801158c: b9 c0 20 00 mv r4,r14 8011590: fb ff ca 4a calli 8003eb8 <_Heap_Block_allocate> - 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; 8011594: 28 23 00 04 lw r3,(r1+4) 8011598: 34 02 ff fe mvi r2,-2 801159c: a0 43 10 00 and r2,r2,r3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 80115a0: 34 42 00 04 addi r2,r2,4 block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); *new_size = (uintptr_t) next_block - alloc_begin + HEAP_BLOCK_SIZE_OFFSET; 80115a4: c8 4c 60 00 sub r12,r2,r12 80115a8: b4 2c 08 00 add r1,r1,r12 80115ac: 59 a1 00 00 sw (r13+0),r1 /* Statistics */ ++stats->resizes; 80115b0: 29 61 00 54 lw r1,(r11+84) 80115b4: 34 21 00 01 addi r1,r1,1 80115b8: 59 61 00 54 sw (r11+84),r1 return HEAP_RESIZE_SUCCESSFUL; 80115bc: 34 01 00 00 mvi r1,0 new_size ); } else { return HEAP_RESIZE_FATAL_ERROR; } } 80115c0: 2b 9d 00 04 lw ra,(sp+4) 80115c4: 2b 8b 00 1c lw r11,(sp+28) 80115c8: 2b 8c 00 18 lw r12,(sp+24) 80115cc: 2b 8d 00 14 lw r13,(sp+20) 80115d0: 2b 8e 00 10 lw r14,(sp+16) 80115d4: 2b 8f 00 0c lw r15,(sp+12) 80115d8: 2b 90 00 08 lw r16,(sp+8) 80115dc: 37 9c 00 1c addi sp,sp,28 80115e0: c3 a0 00 00 ret =============================================================================== 080115e4 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 80115e4: 37 9c ff ec addi sp,sp,-20 80115e8: 5b 8b 00 14 sw (sp+20),r11 80115ec: 5b 8c 00 10 sw (sp+16),r12 80115f0: 5b 8d 00 0c sw (sp+12),r13 80115f4: 5b 8e 00 08 sw (sp+8),r14 80115f8: 5b 9d 00 04 sw (sp+4),ra 80115fc: 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); 8011600: 34 4e ff f8 addi r14,r2,-8 8011604: b8 40 08 00 mv r1,r2 8011608: b8 40 60 00 mv r12,r2 801160c: 29 62 00 10 lw r2,(r11+16) 8011610: b8 60 68 00 mv r13,r3 8011614: fb ff fd 7c calli 8010c04 <__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 8011618: 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); 801161c: 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; 8011620: 34 01 00 00 mvi r1,0 8011624: 54 44 00 03 bgu r2,r4,8011630 <_Heap_Size_of_alloc_area+0x4c> 8011628: 29 61 00 24 lw r1,(r11+36) 801162c: 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 ) ) { 8011630: b8 20 18 00 mv r3,r1 return false; 8011634: 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 ) ) { 8011638: 44 60 00 13 be r3,r0,8011684 <_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; 801163c: 28 83 00 04 lw r3,(r4+4) 8011640: 34 01 ff fe mvi r1,-2 8011644: 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); 8011648: 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; 801164c: 34 01 00 00 mvi r1,0 8011650: 54 44 00 03 bgu r2,r4,801165c <_Heap_Size_of_alloc_area+0x78><== NEVER TAKEN 8011654: 29 61 00 24 lw r1,(r11+36) 8011658: f0 24 08 00 cmpgeu r1,r1,r4 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 801165c: b8 20 10 00 mv r2,r1 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ) { return false; 8011660: 34 01 00 00 mvi r1,0 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 8011664: 44 40 00 08 be r2,r0,8011684 <_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; 8011668: 28 82 00 04 lw r2,(r4+4) 801166c: 20 42 00 01 andi r2,r2,0x1 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 8011670: 44 40 00 05 be r2,r0,8011684 <_Heap_Size_of_alloc_area+0xa0><== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 8011674: c8 8c 20 00 sub r4,r4,r12 8011678: 34 84 00 04 addi r4,r4,4 801167c: 59 a4 00 00 sw (r13+0),r4 return true; 8011680: 34 01 00 01 mvi r1,1 } 8011684: 2b 9d 00 04 lw ra,(sp+4) 8011688: 2b 8b 00 14 lw r11,(sp+20) 801168c: 2b 8c 00 10 lw r12,(sp+16) 8011690: 2b 8d 00 0c lw r13,(sp+12) 8011694: 2b 8e 00 08 lw r14,(sp+8) 8011698: 37 9c 00 14 addi sp,sp,20 801169c: c3 a0 00 00 ret =============================================================================== 08004c0c <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 8004c0c: 37 9c ff a0 addi sp,sp,-96 8004c10: 5b 8b 00 50 sw (sp+80),r11 8004c14: 5b 8c 00 4c sw (sp+76),r12 8004c18: 5b 8d 00 48 sw (sp+72),r13 8004c1c: 5b 8e 00 44 sw (sp+68),r14 8004c20: 5b 8f 00 40 sw (sp+64),r15 8004c24: 5b 90 00 3c sw (sp+60),r16 8004c28: 5b 91 00 38 sw (sp+56),r17 8004c2c: 5b 92 00 34 sw (sp+52),r18 8004c30: 5b 93 00 30 sw (sp+48),r19 8004c34: 5b 94 00 2c sw (sp+44),r20 8004c38: 5b 95 00 28 sw (sp+40),r21 8004c3c: 5b 96 00 24 sw (sp+36),r22 8004c40: 5b 97 00 20 sw (sp+32),r23 8004c44: 5b 98 00 1c sw (sp+28),r24 8004c48: 5b 99 00 18 sw (sp+24),r25 8004c4c: 5b 9b 00 14 sw (sp+20),fp 8004c50: 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; 8004c54: 78 0d 08 00 mvhi r13,0x800 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 8004c58: 20 63 00 ff andi r3,r3,0xff 8004c5c: b8 20 60 00 mv r12,r1 8004c60: b8 40 70 00 mv r14,r2 uintptr_t const page_size = heap->page_size; 8004c64: 28 33 00 10 lw r19,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 8004c68: 28 35 00 14 lw r21,(r1+20) Heap_Block *const first_block = heap->first_block; 8004c6c: 28 34 00 20 lw r20,(r1+32) Heap_Block *const last_block = heap->last_block; 8004c70: 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; 8004c74: 39 ad 4b 74 ori r13,r13,0x4b74 8004c78: 44 60 00 03 be r3,r0,8004c84 <_Heap_Walk+0x78> 8004c7c: 78 0d 08 00 mvhi r13,0x800 8004c80: 39 ad 4b 98 ori r13,r13,0x4b98 if ( !_System_state_Is_up( _System_state_Get() ) ) { 8004c84: 78 03 08 01 mvhi r3,0x801 8004c88: 38 63 59 e4 ori r3,r3,0x59e4 8004c8c: 28 67 00 00 lw r7,(r3+0) 8004c90: 34 02 00 03 mvi r2,3 return true; 8004c94: 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() ) ) { 8004c98: 5c e2 01 08 bne r7,r2,80050b8 <_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)( 8004c9c: 29 81 00 08 lw r1,(r12+8) 8004ca0: 29 86 00 18 lw r6,(r12+24) 8004ca4: 29 87 00 1c lw r7,(r12+28) 8004ca8: 5b 81 00 08 sw (sp+8),r1 8004cac: 29 81 00 0c lw r1,(r12+12) 8004cb0: 78 03 08 01 mvhi r3,0x801 8004cb4: 5b 96 00 04 sw (sp+4),r22 8004cb8: 5b 81 00 0c sw (sp+12),r1 8004cbc: 34 02 00 00 mvi r2,0 8004cc0: b9 c0 08 00 mv r1,r14 8004cc4: 38 63 2d b8 ori r3,r3,0x2db8 8004cc8: ba 60 20 00 mv r4,r19 8004ccc: ba a0 28 00 mv r5,r21 8004cd0: ba 80 40 00 mv r8,r20 8004cd4: 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 ) { 8004cd8: 5e 60 00 06 bne r19,r0,8004cf0 <_Heap_Walk+0xe4> (*printer)( source, true, "page size is zero\n" ); 8004cdc: 78 03 08 01 mvhi r3,0x801 8004ce0: b9 c0 08 00 mv r1,r14 8004ce4: 34 02 00 01 mvi r2,1 8004ce8: 38 63 2e 4c ori r3,r3,0x2e4c 8004cec: e0 00 00 25 bi 8004d80 <_Heap_Walk+0x174> ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 8004cf0: 22 6f 00 07 andi r15,r19,0x7 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 8004cf4: 45 e0 00 07 be r15,r0,8004d10 <_Heap_Walk+0x104> (*printer)( 8004cf8: 78 03 08 01 mvhi r3,0x801 8004cfc: b9 c0 08 00 mv r1,r14 8004d00: 34 02 00 01 mvi r2,1 8004d04: 38 63 2e 60 ori r3,r3,0x2e60 8004d08: ba 60 20 00 mv r4,r19 8004d0c: e0 00 01 04 bi 800511c <_Heap_Walk+0x510> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8004d10: ba a0 08 00 mv r1,r21 8004d14: ba 60 10 00 mv r2,r19 8004d18: fb ff ef 98 calli 8000b78 <__umodsi3> 8004d1c: b8 20 58 00 mv r11,r1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 8004d20: 44 2f 00 07 be r1,r15,8004d3c <_Heap_Walk+0x130> (*printer)( 8004d24: 78 03 08 01 mvhi r3,0x801 8004d28: b9 c0 08 00 mv r1,r14 8004d2c: 34 02 00 01 mvi r2,1 8004d30: 38 63 2e 80 ori r3,r3,0x2e80 8004d34: ba a0 20 00 mv r4,r21 8004d38: e0 00 00 f9 bi 800511c <_Heap_Walk+0x510> 8004d3c: 36 81 00 08 addi r1,r20,8 8004d40: ba 60 10 00 mv r2,r19 8004d44: fb ff ef 8d calli 8000b78 <__umodsi3> ); return false; } if ( 8004d48: 44 2b 00 07 be r1,r11,8004d64 <_Heap_Walk+0x158> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 8004d4c: 78 03 08 01 mvhi r3,0x801 8004d50: b9 c0 08 00 mv r1,r14 8004d54: 34 02 00 01 mvi r2,1 8004d58: 38 63 2e a4 ori r3,r3,0x2ea4 8004d5c: ba 80 20 00 mv r4,r20 8004d60: e0 00 00 ef bi 800511c <_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; 8004d64: 2a 82 00 04 lw r2,(r20+4) 8004d68: 20 42 00 01 andi r2,r2,0x1 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 8004d6c: 5c 41 00 07 bne r2,r1,8004d88 <_Heap_Walk+0x17c> (*printer)( 8004d70: 78 03 08 01 mvhi r3,0x801 8004d74: b9 c0 08 00 mv r1,r14 8004d78: 34 02 00 01 mvi r2,1 8004d7c: 38 63 2e d8 ori r3,r3,0x2ed8 8004d80: d9 a0 00 00 call r13 8004d84: e0 00 00 40 bi 8004e84 <_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; 8004d88: 2a cf 00 04 lw r15,(r22+4) 8004d8c: 34 02 ff fe mvi r2,-2 8004d90: 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); 8004d94: 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; 8004d98: 29 e2 00 04 lw r2,(r15+4) 8004d9c: 20 42 00 01 andi r2,r2,0x1 ); return false; } if ( _Heap_Is_free( last_block ) ) { 8004da0: 5c 41 00 06 bne r2,r1,8004db8 <_Heap_Walk+0x1ac> (*printer)( 8004da4: 78 03 08 01 mvhi r3,0x801 8004da8: b9 c0 08 00 mv r1,r14 8004dac: 34 02 00 01 mvi r2,1 8004db0: 38 63 2f 08 ori r3,r3,0x2f08 8004db4: e3 ff ff f3 bi 8004d80 <_Heap_Walk+0x174> ); return false; } if ( 8004db8: 45 f4 00 06 be r15,r20,8004dd0 <_Heap_Walk+0x1c4> <== ALWAYS TAKEN _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 8004dbc: 78 03 08 01 mvhi r3,0x801 <== NOT EXECUTED 8004dc0: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 8004dc4: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8004dc8: 38 63 2f 20 ori r3,r3,0x2f20 <== NOT EXECUTED 8004dcc: e3 ff ff ed bi 8004d80 <_Heap_Walk+0x174> <== NOT EXECUTED int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 8004dd0: 29 92 00 10 lw r18,(r12+16) block = next_block; } while ( block != first_block ); return true; } 8004dd4: 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 ); 8004dd8: 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; 8004ddc: 34 11 ff fe mvi r17,-2 8004de0: e0 00 00 2d bi 8004e94 <_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; 8004de4: 29 83 00 20 lw r3,(r12+32) 8004de8: 34 01 00 00 mvi r1,0 8004dec: 54 6b 00 03 bgu r3,r11,8004df8 <_Heap_Walk+0x1ec> 8004df0: 29 81 00 24 lw r1,(r12+36) 8004df4: 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 ) ) { 8004df8: 5c 20 00 06 bne r1,r0,8004e10 <_Heap_Walk+0x204> (*printer)( 8004dfc: 78 03 08 01 mvhi r3,0x801 8004e00: b9 c0 08 00 mv r1,r14 8004e04: 34 02 00 01 mvi r2,1 8004e08: 38 63 2f 50 ori r3,r3,0x2f50 8004e0c: e0 00 00 14 bi 8004e5c <_Heap_Walk+0x250> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8004e10: 35 61 00 08 addi r1,r11,8 8004e14: ba 40 10 00 mv r2,r18 8004e18: fb ff ef 58 calli 8000b78 <__umodsi3> ); return false; } if ( 8004e1c: 44 20 00 06 be r1,r0,8004e34 <_Heap_Walk+0x228> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 8004e20: 78 03 08 01 mvhi r3,0x801 8004e24: b9 c0 08 00 mv r1,r14 8004e28: 34 02 00 01 mvi r2,1 8004e2c: 38 63 2f 70 ori r3,r3,0x2f70 8004e30: e0 00 00 0b bi 8004e5c <_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; 8004e34: 29 63 00 04 lw r3,(r11+4) 8004e38: a2 23 18 00 and r3,r17,r3 block = next_block; } while ( block != first_block ); return true; } 8004e3c: 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; 8004e40: 28 63 00 04 lw r3,(r3+4) 8004e44: 20 63 00 01 andi r3,r3,0x1 ); return false; } if ( _Heap_Is_used( free_block ) ) { 8004e48: 44 61 00 07 be r3,r1,8004e64 <_Heap_Walk+0x258> (*printer)( 8004e4c: 78 03 08 01 mvhi r3,0x801 8004e50: b9 c0 08 00 mv r1,r14 8004e54: 34 02 00 01 mvi r2,1 8004e58: 38 63 2f a0 ori r3,r3,0x2fa0 8004e5c: b9 60 20 00 mv r4,r11 8004e60: e0 00 00 af bi 800511c <_Heap_Walk+0x510> ); return false; } if ( free_block->prev != prev_block ) { 8004e64: 29 65 00 0c lw r5,(r11+12) 8004e68: 44 b0 00 09 be r5,r16,8004e8c <_Heap_Walk+0x280> (*printer)( 8004e6c: 78 03 08 01 mvhi r3,0x801 8004e70: b9 c0 08 00 mv r1,r14 8004e74: 34 02 00 01 mvi r2,1 8004e78: 38 63 2f bc ori r3,r3,0x2fbc 8004e7c: b9 60 20 00 mv r4,r11 8004e80: 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; 8004e84: 34 03 00 00 mvi r3,0 8004e88: e0 00 00 8c bi 80050b8 <_Heap_Walk+0x4ac> return false; } prev_block = free_block; free_block = free_block->next; 8004e8c: b9 60 80 00 mv r16,r11 8004e90: 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 ) { 8004e94: 5d 6c ff d4 bne r11,r12,8004de4 <_Heap_Walk+0x1d8> 8004e98: e0 00 00 03 bi 8004ea4 <_Heap_Walk+0x298> block->prev_size ); } block = next_block; } while ( block != first_block ); 8004e9c: ba 20 78 00 mv r15,r17 8004ea0: e0 00 00 15 bi 8004ef4 <_Heap_Walk+0x2e8> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8004ea4: 78 01 08 01 mvhi r1,0x801 8004ea8: 38 21 31 6c ori r1,r1,0x316c 8004eac: 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)( 8004eb0: 78 01 08 01 mvhi r1,0x801 8004eb4: 38 21 31 54 ori r1,r1,0x3154 8004eb8: 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)( 8004ebc: 78 01 08 01 mvhi r1,0x801 8004ec0: 38 21 2d 80 ori r1,r1,0x2d80 8004ec4: 5b 81 00 5c sw (sp+92),r1 8004ec8: 78 01 08 01 mvhi r1,0x801 8004ecc: 38 21 2d 9c ori r1,r1,0x2d9c 8004ed0: 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)" : "") 8004ed4: 78 17 08 01 mvhi r23,0x801 8004ed8: 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)" : ""), 8004edc: 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)( 8004ee0: 5b 81 00 60 sw (sp+96),r1 8004ee4: 3b 7b 30 b0 ori fp,fp,0x30b0 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8004ee8: 3a f7 31 20 ori r23,r23,0x3120 8004eec: 3b 39 2d ac ori r25,r25,0x2dac block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8004ef0: 3b 18 2d 90 ori r24,r24,0x2d90 block = next_block; } while ( block != first_block ); return true; } 8004ef4: 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; 8004ef8: 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; 8004efc: 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; 8004f00: 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); 8004f04: 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; 8004f08: 34 06 00 00 mvi r6,0 8004f0c: 54 91 00 03 bgu r4,r17,8004f18 <_Heap_Walk+0x30c> <== NEVER TAKEN 8004f10: 29 86 00 24 lw r6,(r12+36) 8004f14: 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 ) ) { 8004f18: 5c c0 00 06 bne r6,r0,8004f30 <_Heap_Walk+0x324> (*printer)( 8004f1c: 78 03 08 01 mvhi r3,0x801 8004f20: b9 c0 08 00 mv r1,r14 8004f24: 34 02 00 01 mvi r2,1 8004f28: 38 63 2f f0 ori r3,r3,0x2ff0 8004f2c: e0 00 00 1f bi 8004fa8 <_Heap_Walk+0x39c> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8004f30: ba 00 08 00 mv r1,r16 8004f34: 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; 8004f38: fd f6 58 00 cmpne r11,r15,r22 8004f3c: fb ff ef 0f calli 8000b78 <__umodsi3> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 8004f40: 44 20 00 09 be r1,r0,8004f64 <_Heap_Walk+0x358> 8004f44: 45 60 00 08 be r11,r0,8004f64 <_Heap_Walk+0x358> (*printer)( 8004f48: 78 03 08 01 mvhi r3,0x801 8004f4c: b9 c0 08 00 mv r1,r14 8004f50: 34 02 00 01 mvi r2,1 8004f54: 38 63 30 20 ori r3,r3,0x3020 8004f58: b9 e0 20 00 mv r4,r15 8004f5c: ba 00 28 00 mv r5,r16 8004f60: e3 ff ff c8 bi 8004e80 <_Heap_Walk+0x274> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 8004f64: 52 15 00 0b bgeu r16,r21,8004f90 <_Heap_Walk+0x384> 8004f68: 45 60 00 0a be r11,r0,8004f90 <_Heap_Walk+0x384> <== NEVER TAKEN (*printer)( 8004f6c: 78 03 08 01 mvhi r3,0x801 8004f70: b9 c0 08 00 mv r1,r14 8004f74: 34 02 00 01 mvi r2,1 8004f78: 38 63 30 50 ori r3,r3,0x3050 8004f7c: b9 e0 20 00 mv r4,r15 8004f80: ba 00 28 00 mv r5,r16 8004f84: ba a0 30 00 mv r6,r21 8004f88: d9 a0 00 00 call r13 8004f8c: e3 ff ff be bi 8004e84 <_Heap_Walk+0x278> ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 8004f90: 56 2f 00 09 bgu r17,r15,8004fb4 <_Heap_Walk+0x3a8> 8004f94: 45 60 00 08 be r11,r0,8004fb4 <_Heap_Walk+0x3a8> (*printer)( 8004f98: 78 03 08 01 mvhi r3,0x801 8004f9c: b9 c0 08 00 mv r1,r14 8004fa0: 34 02 00 01 mvi r2,1 8004fa4: 38 63 30 7c ori r3,r3,0x307c 8004fa8: b9 e0 20 00 mv r4,r15 8004fac: ba 20 28 00 mv r5,r17 8004fb0: e3 ff ff b4 bi 8004e80 <_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; 8004fb4: 2a 24 00 04 lw r4,(r17+4) 8004fb8: 22 52 00 01 andi r18,r18,0x1 8004fbc: 20 84 00 01 andi r4,r4,0x1 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 8004fc0: 5c 80 00 2d bne r4,r0,8005074 <_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 ? 8004fc4: 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)( 8004fc8: 29 85 00 08 lw r5,(r12+8) block = next_block; } while ( block != first_block ); return true; } 8004fcc: 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)( 8004fd0: 2b 87 00 5c lw r7,(sp+92) 8004fd4: 44 c5 00 04 be r6,r5,8004fe4 <_Heap_Walk+0x3d8> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8004fd8: ba e0 38 00 mv r7,r23 8004fdc: 5c cc 00 02 bne r6,r12,8004fe4 <_Heap_Walk+0x3d8> 8004fe0: bb 00 38 00 mv r7,r24 block->next, block->next == last_free_block ? 8004fe4: 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)( 8004fe8: 2b 89 00 60 lw r9,(sp+96) 8004fec: 45 04 00 04 be r8,r4,8004ffc <_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)" : "") 8004ff0: ba e0 48 00 mv r9,r23 8004ff4: 5d 0c 00 02 bne r8,r12,8004ffc <_Heap_Walk+0x3f0> 8004ff8: 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)( 8004ffc: 5b 89 00 04 sw (sp+4),r9 8005000: b9 c0 08 00 mv r1,r14 8005004: 34 02 00 00 mvi r2,0 8005008: bb 60 18 00 mv r3,fp 800500c: b9 e0 20 00 mv r4,r15 8005010: ba 00 28 00 mv r5,r16 8005014: 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 ) { 8005018: 2a 26 00 00 lw r6,(r17+0) 800501c: 46 06 00 0a be r16,r6,8005044 <_Heap_Walk+0x438> (*printer)( 8005020: 78 03 08 01 mvhi r3,0x801 8005024: b9 c0 08 00 mv r1,r14 8005028: 34 02 00 01 mvi r2,1 800502c: 38 63 30 e8 ori r3,r3,0x30e8 8005030: b9 e0 20 00 mv r4,r15 8005034: ba 00 28 00 mv r5,r16 8005038: ba 20 38 00 mv r7,r17 800503c: d9 a0 00 00 call r13 8005040: e3 ff ff 91 bi 8004e84 <_Heap_Walk+0x278> ); return false; } if ( !prev_used ) { 8005044: 5e 40 00 06 bne r18,r0,800505c <_Heap_Walk+0x450> (*printer)( 8005048: 78 03 08 01 mvhi r3,0x801 800504c: b9 c0 08 00 mv r1,r14 8005050: 34 02 00 01 mvi r2,1 8005054: 38 63 31 24 ori r3,r3,0x3124 8005058: e0 00 00 30 bi 8005118 <_Heap_Walk+0x50c> block = next_block; } while ( block != first_block ); return true; } 800505c: 29 85 00 08 lw r5,(r12+8) 8005060: e0 00 00 03 bi 800506c <_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 ) { 8005064: 44 af 00 13 be r5,r15,80050b0 <_Heap_Walk+0x4a4> return true; } free_block = free_block->next; 8005068: 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 ) { 800506c: 5c ac ff fe bne r5,r12,8005064 <_Heap_Walk+0x458> 8005070: e0 00 00 26 bi 8005108 <_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) { 8005074: 46 40 00 08 be r18,r0,8005094 <_Heap_Walk+0x488> (*printer)( 8005078: 2b 83 00 58 lw r3,(sp+88) 800507c: b9 c0 08 00 mv r1,r14 8005080: 34 02 00 00 mvi r2,0 8005084: b9 e0 20 00 mv r4,r15 8005088: ba 00 28 00 mv r5,r16 800508c: d9 a0 00 00 call r13 8005090: e0 00 00 08 bi 80050b0 <_Heap_Walk+0x4a4> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8005094: 2b 83 00 54 lw r3,(sp+84) 8005098: 29 e6 00 00 lw r6,(r15+0) 800509c: b9 c0 08 00 mv r1,r14 80050a0: 34 02 00 00 mvi r2,0 80050a4: b9 e0 20 00 mv r4,r15 80050a8: ba 00 28 00 mv r5,r16 80050ac: d9 a0 00 00 call r13 block->prev_size ); } block = next_block; } while ( block != first_block ); 80050b0: 5e 91 ff 7b bne r20,r17,8004e9c <_Heap_Walk+0x290> return true; 80050b4: 34 03 00 01 mvi r3,1 } 80050b8: b8 60 08 00 mv r1,r3 80050bc: 2b 9d 00 10 lw ra,(sp+16) 80050c0: 2b 8b 00 50 lw r11,(sp+80) 80050c4: 2b 8c 00 4c lw r12,(sp+76) 80050c8: 2b 8d 00 48 lw r13,(sp+72) 80050cc: 2b 8e 00 44 lw r14,(sp+68) 80050d0: 2b 8f 00 40 lw r15,(sp+64) 80050d4: 2b 90 00 3c lw r16,(sp+60) 80050d8: 2b 91 00 38 lw r17,(sp+56) 80050dc: 2b 92 00 34 lw r18,(sp+52) 80050e0: 2b 93 00 30 lw r19,(sp+48) 80050e4: 2b 94 00 2c lw r20,(sp+44) 80050e8: 2b 95 00 28 lw r21,(sp+40) 80050ec: 2b 96 00 24 lw r22,(sp+36) 80050f0: 2b 97 00 20 lw r23,(sp+32) 80050f4: 2b 98 00 1c lw r24,(sp+28) 80050f8: 2b 99 00 18 lw r25,(sp+24) 80050fc: 2b 9b 00 14 lw fp,(sp+20) 8005100: 37 9c 00 60 addi sp,sp,96 8005104: c3 a0 00 00 ret return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 8005108: 78 03 08 01 mvhi r3,0x801 800510c: b9 c0 08 00 mv r1,r14 8005110: 34 02 00 01 mvi r2,1 8005114: 38 63 31 94 ori r3,r3,0x3194 8005118: b9 e0 20 00 mv r4,r15 800511c: d9 a0 00 00 call r13 8005120: e3 ff ff 59 bi 8004e84 <_Heap_Walk+0x278> =============================================================================== 08003144 <_IO_Manager_initialization>: * workspace. * */ void _IO_Manager_initialization(void) { 8003144: 37 9c ff e8 addi sp,sp,-24 8003148: 5b 8b 00 18 sw (sp+24),r11 800314c: 5b 8c 00 14 sw (sp+20),r12 8003150: 5b 8d 00 10 sw (sp+16),r13 8003154: 5b 8e 00 0c sw (sp+12),r14 8003158: 5b 8f 00 08 sw (sp+8),r15 800315c: 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; 8003160: 78 01 08 01 mvhi r1,0x801 8003164: 38 21 30 c4 ori r1,r1,0x30c4 drivers_in_table = Configuration.number_of_device_drivers; 8003168: 28 2d 00 30 lw r13,(r1+48) number_of_drivers = Configuration.maximum_drivers; 800316c: 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; 8003170: 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 ) 8003174: 51 ab 00 03 bgeu r13,r11,8003180 <_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 ) { 8003178: 5d 6d 00 0a bne r11,r13,80031a0 <_IO_Manager_initialization+0x5c><== ALWAYS TAKEN 800317c: e0 00 00 02 bi 8003184 <_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 ) 8003180: 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; 8003184: 78 01 08 01 mvhi r1,0x801 8003188: 38 21 3a 50 ori r1,r1,0x3a50 800318c: 58 2e 00 00 sw (r1+0),r14 _IO_Number_of_drivers = number_of_drivers; 8003190: 78 01 08 01 mvhi r1,0x801 8003194: 38 21 3a 4c ori r1,r1,0x3a4c 8003198: 58 2b 00 00 sw (r1+0),r11 return; 800319c: e0 00 00 27 bi 8003238 <_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 ) 80031a0: 34 02 00 01 mvi r2,1 80031a4: b9 60 08 00 mv r1,r11 80031a8: f8 00 35 ad calli 801085c <__ashlsi3> 80031ac: 34 02 00 03 mvi r2,3 80031b0: b4 2b 08 00 add r1,r1,r11 80031b4: f8 00 35 aa calli 801085c <__ashlsi3> 80031b8: 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( 80031bc: f8 00 0d de calli 8006934 <_Workspace_Allocate_or_fatal_error> sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 80031c0: 78 02 08 01 mvhi r2,0x801 80031c4: 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 *) 80031c8: 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; 80031cc: 58 4b 00 00 sw (r2+0),r11 memset( 80031d0: 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 *) 80031d4: 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( 80031d8: 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 *) 80031dc: 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( 80031e0: f8 00 23 89 calli 800c004 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 80031e4: 34 03 00 00 mvi r3,0 80031e8: 34 04 00 00 mvi r4,0 80031ec: e0 00 00 12 bi 8003234 <_IO_Manager_initialization+0xf0> _IO_Driver_address_table[index] = driver_table[index]; 80031f0: 29 82 00 00 lw r2,(r12+0) * registration. The driver table is now allocated in the * workspace. * */ void _IO_Manager_initialization(void) 80031f4: 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]; 80031f8: 28 29 00 00 lw r9,(r1+0) 80031fc: 28 28 00 04 lw r8,(r1+4) 8003200: 28 27 00 08 lw r7,(r1+8) 8003204: 28 26 00 0c lw r6,(r1+12) 8003208: 28 25 00 10 lw r5,(r1+16) 800320c: 28 21 00 14 lw r1,(r1+20) 8003210: b4 43 10 00 add r2,r2,r3 8003214: 58 49 00 00 sw (r2+0),r9 8003218: 58 48 00 04 sw (r2+4),r8 800321c: 58 47 00 08 sw (r2+8),r7 8003220: 58 46 00 0c sw (r2+12),r6 8003224: 58 45 00 10 sw (r2+16),r5 8003228: 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++ ) 800322c: 34 84 00 01 addi r4,r4,1 8003230: 34 63 00 18 addi r3,r3,24 8003234: 55 a4 ff ef bgu r13,r4,80031f0 <_IO_Manager_initialization+0xac> _IO_Driver_address_table[index] = driver_table[index]; number_of_drivers = drivers_in_table; } 8003238: 2b 9d 00 04 lw ra,(sp+4) 800323c: 2b 8b 00 18 lw r11,(sp+24) 8003240: 2b 8c 00 14 lw r12,(sp+20) 8003244: 2b 8d 00 10 lw r13,(sp+16) 8003248: 2b 8e 00 0c lw r14,(sp+12) 800324c: 2b 8f 00 08 lw r15,(sp+8) 8003250: 37 9c 00 18 addi sp,sp,24 8003254: c3 a0 00 00 ret =============================================================================== 080040e4 <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 80040e4: 37 9c ff ec addi sp,sp,-20 80040e8: 5b 8b 00 14 sw (sp+20),r11 80040ec: 5b 8c 00 10 sw (sp+16),r12 80040f0: 5b 8d 00 0c sw (sp+12),r13 80040f4: 5b 8e 00 08 sw (sp+8),r14 80040f8: 5b 9d 00 04 sw (sp+4),ra 80040fc: 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 ) 8004100: 28 21 00 18 lw r1,(r1+24) return NULL; 8004104: 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 ) 8004108: 44 20 00 1e be r1,r0,8004180 <_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 ); 800410c: 35 6d 00 20 addi r13,r11,32 8004110: b9 a0 08 00 mv r1,r13 8004114: fb ff fd 21 calli 8003598 <_Chain_Get> 8004118: b8 20 60 00 mv r12,r1 800411c: b8 20 70 00 mv r14,r1 if ( information->auto_extend ) { 8004120: 41 61 00 12 lbu r1,(r11+18) 8004124: 44 20 00 17 be r1,r0,8004180 <_Objects_Allocate+0x9c> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 8004128: 5d 80 00 07 bne r12,r0,8004144 <_Objects_Allocate+0x60> _Objects_Extend_information( information ); 800412c: b9 60 08 00 mv r1,r11 8004130: f8 00 00 1c calli 80041a0 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 8004134: b9 a0 08 00 mv r1,r13 8004138: fb ff fd 18 calli 8003598 <_Chain_Get> 800413c: b8 20 60 00 mv r12,r1 } if ( the_object ) { 8004140: 44 2e 00 10 be r1,r14,8004180 <_Objects_Allocate+0x9c> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 8004144: 2d 82 00 0a lhu r2,(r12+10) 8004148: 2d 61 00 0a lhu r1,(r11+10) _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 800414c: c8 41 08 00 sub r1,r2,r1 8004150: 2d 62 00 14 lhu r2,(r11+20) 8004154: f8 00 32 9c calli 8010bc4 <__udivsi3> information->inactive_per_block[ block ]--; 8004158: 34 02 00 02 mvi r2,2 800415c: f8 00 31 c0 calli 801085c <__ashlsi3> 8004160: 29 62 00 30 lw r2,(r11+48) 8004164: b4 41 08 00 add r1,r2,r1 8004168: 28 22 00 00 lw r2,(r1+0) 800416c: 34 42 ff ff addi r2,r2,-1 8004170: 58 22 00 00 sw (r1+0),r2 information->inactive--; 8004174: 2d 61 00 2c lhu r1,(r11+44) 8004178: 34 21 ff ff addi r1,r1,-1 800417c: 0d 61 00 2c sh (r11+44),r1 ); } #endif return the_object; } 8004180: b9 80 08 00 mv r1,r12 8004184: 2b 9d 00 04 lw ra,(sp+4) 8004188: 2b 8b 00 14 lw r11,(sp+20) 800418c: 2b 8c 00 10 lw r12,(sp+16) 8004190: 2b 8d 00 0c lw r13,(sp+12) 8004194: 2b 8e 00 08 lw r14,(sp+8) 8004198: 37 9c 00 14 addi sp,sp,20 800419c: c3 a0 00 00 ret =============================================================================== 080045c4 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 80045c4: 37 9c ff ec addi sp,sp,-20 80045c8: 5b 8b 00 14 sw (sp+20),r11 80045cc: 5b 8c 00 10 sw (sp+16),r12 80045d0: 5b 8d 00 0c sw (sp+12),r13 80045d4: 5b 8e 00 08 sw (sp+8),r14 80045d8: 5b 9d 00 04 sw (sp+4),ra Objects_Information *info; int the_class_api_maximum; if ( !the_class ) return NULL; 80045dc: 34 0b 00 00 mvi r11,0 Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 80045e0: b8 20 70 00 mv r14,r1 80045e4: b8 40 60 00 mv r12,r2 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 80045e8: 44 40 00 16 be r2,r0,8004640 <_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 ); 80045ec: f8 00 13 2f calli 80092a8 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 80045f0: 44 20 00 14 be r1,r0,8004640 <_Objects_Get_information+0x7c> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 80045f4: 55 81 00 13 bgu r12,r1,8004640 <_Objects_Get_information+0x7c> return NULL; if ( !_Objects_Information_table[ the_api ] ) 80045f8: 78 0d 08 01 mvhi r13,0x801 80045fc: b9 c0 08 00 mv r1,r14 8004600: 34 02 00 02 mvi r2,2 8004604: 39 ad 37 b8 ori r13,r13,0x37b8 8004608: f8 00 30 95 calli 801085c <__ashlsi3> 800460c: b5 a1 08 00 add r1,r13,r1 8004610: 28 2d 00 00 lw r13,(r1+0) 8004614: 45 a0 00 0b be r13,r0,8004640 <_Objects_Get_information+0x7c><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 8004618: b9 80 08 00 mv r1,r12 800461c: 34 02 00 02 mvi r2,2 8004620: f8 00 30 8f calli 801085c <__ashlsi3> 8004624: b5 a1 08 00 add r1,r13,r1 8004628: 28 2b 00 00 lw r11,(r1+0) if ( !info ) 800462c: 45 60 00 05 be r11,r0,8004640 <_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 ) 8004630: 2d 61 00 10 lhu r1,(r11+16) return NULL; 8004634: 7c 21 00 00 cmpnei r1,r1,0 8004638: c8 01 08 00 sub r1,r0,r1 800463c: a1 61 58 00 and r11,r11,r1 #endif return info; } 8004640: b9 60 08 00 mv r1,r11 8004644: 2b 9d 00 04 lw ra,(sp+4) 8004648: 2b 8b 00 14 lw r11,(sp+20) 800464c: 2b 8c 00 10 lw r12,(sp+16) 8004650: 2b 8d 00 0c lw r13,(sp+12) 8004654: 2b 8e 00 08 lw r14,(sp+8) 8004658: 37 9c 00 14 addi sp,sp,20 800465c: c3 a0 00 00 ret =============================================================================== 080178a0 <_Objects_Get_no_protection>: Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 80178a0: 37 9c ff f4 addi sp,sp,-12 80178a4: 5b 8b 00 0c sw (sp+12),r11 80178a8: 5b 8c 00 08 sw (sp+8),r12 80178ac: 5b 9d 00 04 sw (sp+4),ra 80178b0: 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; 80178b4: 28 21 00 08 lw r1,(r1+8) Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 80178b8: 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; 80178bc: c8 41 08 00 sub r1,r2,r1 if ( information->maximum >= index ) { 80178c0: 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; 80178c4: 34 21 00 01 addi r1,r1,1 if ( information->maximum >= index ) { 80178c8: 54 22 00 09 bgu r1,r2,80178ec <_Objects_Get_no_protection+0x4c> if ( (the_object = information->local_table[ index ]) != NULL ) { 80178cc: 28 8c 00 1c lw r12,(r4+28) 80178d0: 34 02 00 02 mvi r2,2 80178d4: fb ff d9 93 calli 800df20 <__ashlsi3> 80178d8: b5 81 08 00 add r1,r12,r1 80178dc: 28 21 00 00 lw r1,(r1+0) 80178e0: 44 20 00 03 be r1,r0,80178ec <_Objects_Get_no_protection+0x4c><== NEVER TAKEN *location = OBJECTS_LOCAL; 80178e4: 59 60 00 00 sw (r11+0),r0 return the_object; 80178e8: e0 00 00 04 bi 80178f8 <_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; 80178ec: 34 01 00 01 mvi r1,1 80178f0: 59 61 00 00 sw (r11+0),r1 return NULL; 80178f4: 34 01 00 00 mvi r1,0 } 80178f8: 2b 9d 00 04 lw ra,(sp+4) 80178fc: 2b 8b 00 0c lw r11,(sp+12) 8017900: 2b 8c 00 08 lw r12,(sp+8) 8017904: 37 9c 00 0c addi sp,sp,12 8017908: c3 a0 00 00 ret =============================================================================== 08006270 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 8006270: 37 9c ff e8 addi sp,sp,-24 8006274: 5b 8b 00 14 sw (sp+20),r11 8006278: 5b 8c 00 10 sw (sp+16),r12 800627c: 5b 8d 00 0c sw (sp+12),r13 8006280: 5b 8e 00 08 sw (sp+8),r14 8006284: 5b 9d 00 04 sw (sp+4),ra 8006288: b8 40 70 00 mv r14,r2 /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 800628c: b8 20 58 00 mv r11,r1 8006290: 5c 20 00 05 bne r1,r0,80062a4 <_Objects_Id_to_name+0x34> 8006294: 78 01 08 01 mvhi r1,0x801 8006298: 38 21 ea 48 ori r1,r1,0xea48 800629c: 28 21 00 0c lw r1,(r1+12) 80062a0: 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); 80062a4: 34 02 00 18 mvi r2,24 80062a8: b9 60 08 00 mv r1,r11 80062ac: f8 00 52 e1 calli 801ae30 <__lshrsi3> 80062b0: 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 ) 80062b4: 34 23 ff ff addi r3,r1,-1 80062b8: 34 02 00 02 mvi r2,2 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 80062bc: 34 0d 00 03 mvi r13,3 80062c0: 54 62 00 12 bgu r3,r2,8006308 <_Objects_Id_to_name+0x98> 80062c4: e0 00 00 19 bi 8006328 <_Objects_Id_to_name+0xb8> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 80062c8: 34 02 00 1b mvi r2,27 80062cc: b9 60 08 00 mv r1,r11 80062d0: f8 00 52 d8 calli 801ae30 <__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 ]; 80062d4: 34 02 00 02 mvi r2,2 80062d8: fb ff ec d9 calli 800163c <__ashlsi3> 80062dc: b5 81 08 00 add r1,r12,r1 80062e0: 28 21 00 00 lw r1,(r1+0) if ( !information ) 80062e4: 44 20 00 09 be r1,r0,8006308 <_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 ); 80062e8: b9 60 10 00 mv r2,r11 80062ec: 37 83 00 18 addi r3,sp,24 80062f0: fb ff ff ba calli 80061d8 <_Objects_Get> if ( !the_object ) 80062f4: 44 20 00 05 be r1,r0,8006308 <_Objects_Id_to_name+0x98> return OBJECTS_INVALID_ID; *name = the_object->name; 80062f8: 28 21 00 0c lw r1,(r1+12) _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 80062fc: 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; 8006300: 59 c1 00 00 sw (r14+0),r1 _Thread_Enable_dispatch(); 8006304: f8 00 02 5d calli 8006c78 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 8006308: b9 a0 08 00 mv r1,r13 800630c: 2b 9d 00 04 lw ra,(sp+4) 8006310: 2b 8b 00 14 lw r11,(sp+20) 8006314: 2b 8c 00 10 lw r12,(sp+16) 8006318: 2b 8d 00 0c lw r13,(sp+12) 800631c: 2b 8e 00 08 lw r14,(sp+8) 8006320: 37 9c 00 18 addi sp,sp,24 8006324: 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 ] ) 8006328: 78 0c 08 01 mvhi r12,0x801 800632c: 34 02 00 02 mvi r2,2 8006330: 39 8c e8 18 ori r12,r12,0xe818 8006334: fb ff ec c2 calli 800163c <__ashlsi3> 8006338: b5 81 08 00 add r1,r12,r1 800633c: 28 2c 00 00 lw r12,(r1+0) 8006340: 5d 80 ff e2 bne r12,r0,80062c8 <_Objects_Id_to_name+0x58> <== ALWAYS TAKEN 8006344: e3 ff ff f1 bi 8006308 <_Objects_Id_to_name+0x98> <== NOT EXECUTED =============================================================================== 080047a0 <_Objects_Initialize_information>: , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 80047a0: 37 9c ff e4 addi sp,sp,-28 80047a4: 5b 8b 00 1c sw (sp+28),r11 80047a8: 5b 8c 00 18 sw (sp+24),r12 80047ac: 5b 8d 00 14 sw (sp+20),r13 80047b0: 5b 8e 00 10 sw (sp+16),r14 80047b4: 5b 8f 00 0c sw (sp+12),r15 80047b8: 5b 90 00 08 sw (sp+8),r16 80047bc: 5b 9d 00 04 sw (sp+4),ra 80047c0: b8 20 58 00 mv r11,r1 80047c4: 20 a5 ff ff andi r5,r5,0xffff #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; 80047c8: 0d 63 00 04 sh (r11+4),r3 information->size = size; 80047cc: 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; 80047d0: 59 62 00 00 sw (r11+0),r2 information->the_class = the_class; information->size = size; information->local_table = 0; 80047d4: 58 20 00 1c sw (r1+28),r0 information->inactive_per_block = 0; 80047d8: 58 20 00 30 sw (r1+48),r0 information->object_blocks = 0; 80047dc: 58 20 00 34 sw (r1+52),r0 information->inactive = 0; 80047e0: 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; 80047e4: 0c 20 00 10 sh (r1+16),r0 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 80047e8: 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; 80047ec: b8 40 08 00 mv r1,r2 80047f0: 78 0f 08 01 mvhi r15,0x801 80047f4: 34 02 00 02 mvi r2,2 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 80047f8: b8 60 68 00 mv r13,r3 80047fc: b8 80 60 00 mv r12,r4 8004800: 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; 8004804: 39 ef 37 b8 ori r15,r15,0x37b8 8004808: f8 00 30 15 calli 801085c <__ashlsi3> 800480c: b5 e1 08 00 add r1,r15,r1 8004810: 28 2f 00 00 lw r15,(r1+0) 8004814: 34 02 00 02 mvi r2,2 8004818: b9 a0 08 00 mv r1,r13 800481c: f8 00 30 10 calli 801085c <__ashlsi3> 8004820: b5 e1 08 00 add r1,r15,r1 8004824: 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; 8004828: 34 02 00 1f mvi r2,31 800482c: b9 80 08 00 mv r1,r12 8004830: f8 00 30 59 calli 8010994 <__lshrsi3> maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 8004834: 78 03 08 01 mvhi r3,0x801 8004838: 38 63 1d cc ori r3,r3,0x1dcc /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 800483c: 20 22 00 ff andi r2,r1,0xff maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 8004840: 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 = 8004844: 31 62 00 12 sb (r11+18),r2 (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 8004848: a1 81 60 00 and r12,r12,r1 /* * Unlimited and maximum of zero is illogical. */ if ( information->auto_extend && maximum_per_allocation == 0) { 800484c: 44 40 00 06 be r2,r0,8004864 <_Objects_Initialize_information+0xc4> 8004850: 5d 80 00 05 bne r12,r0,8004864 <_Objects_Initialize_information+0xc4><== ALWAYS TAKEN _Internal_error_Occurred( 8004854: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8004858: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 800485c: 34 03 00 13 mvi r3,19 <== NOT EXECUTED 8004860: fb ff fd f2 calli 8004028 <_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; 8004864: 78 01 08 01 mvhi r1,0x801 8004868: 38 21 36 28 ori r1,r1,0x3628 800486c: 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) | 8004870: 34 02 00 18 mvi r2,24 8004874: b9 c0 08 00 mv r1,r14 } /* * The allocation unit is the maximum value */ information->allocation_size = maximum_per_allocation; 8004878: 0d 6c 00 14 sh (r11+20),r12 800487c: f8 00 2f f8 calli 801085c <__ashlsi3> 8004880: 78 0e 00 01 mvhi r14,0x1 8004884: b8 2e 70 00 or r14,r1,r14 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 8004888: 34 02 00 1b mvi r2,27 800488c: b9 a0 08 00 mv r1,r13 8004890: f8 00 2f f3 calli 801085c <__ashlsi3> information->local_table = &null_local_table; /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; 8004894: 7d 82 00 00 cmpnei r2,r12,0 8004898: 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) | 800489c: b8 22 08 00 or r1,r1,r2 information->minimum_id = 80048a0: 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) ) 80048a4: 22 01 00 03 andi r1,r16,0x3 80048a8: ba 00 38 00 mv r7,r16 80048ac: 44 20 00 04 be r1,r0,80048bc <_Objects_Initialize_information+0x11c><== ALWAYS TAKEN name_length = (name_length + OBJECTS_NAME_ALIGNMENT) & 80048b0: 36 07 00 04 addi r7,r16,4 <== NOT EXECUTED 80048b4: 34 01 ff fc mvi r1,-4 <== NOT EXECUTED 80048b8: 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; 80048bc: 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); 80048c0: 59 61 00 20 sw (r11+32),r1 ~(OBJECTS_NAME_ALIGNMENT-1); information->name_length = name_length; _Chain_Initialize_empty( &information->Inactive ); 80048c4: 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; 80048c8: 0d 67 00 38 sh (r11+56),r7 the_chain->permanent_null = NULL; 80048cc: 59 60 00 24 sw (r11+36),r0 the_chain->last = _Chain_Head(the_chain); 80048d0: 59 61 00 28 sw (r11+40),r1 _Chain_Initialize_empty( &information->Inactive ); /* * Initialize objects .. if there are any */ if ( maximum_per_allocation ) { 80048d4: 45 80 00 03 be r12,r0,80048e0 <_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 ); 80048d8: b9 60 08 00 mv r1,r11 80048dc: fb ff fe 31 calli 80041a0 <_Objects_Extend_information> _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 80048e0: 2b 9d 00 04 lw ra,(sp+4) 80048e4: 2b 8b 00 1c lw r11,(sp+28) 80048e8: 2b 8c 00 18 lw r12,(sp+24) 80048ec: 2b 8d 00 14 lw r13,(sp+20) 80048f0: 2b 8e 00 10 lw r14,(sp+16) 80048f4: 2b 8f 00 0c lw r15,(sp+12) 80048f8: 2b 90 00 08 lw r16,(sp+8) 80048fc: 37 9c 00 1c addi sp,sp,28 8004900: c3 a0 00 00 ret =============================================================================== 08002eb0 <_RTEMS_tasks_Initialize_user_tasks_body>: * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { 8002eb0: 37 9c ff e8 addi sp,sp,-24 8002eb4: 5b 8b 00 14 sw (sp+20),r11 8002eb8: 5b 8c 00 10 sw (sp+16),r12 8002ebc: 5b 8d 00 0c sw (sp+12),r13 8002ec0: 5b 8e 00 08 sw (sp+8),r14 8002ec4: 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; 8002ec8: 78 01 08 01 mvhi r1,0x801 8002ecc: 38 21 30 8c ori r1,r1,0x308c 8002ed0: 28 2b 00 2c lw r11,(r1+44) maximum = Configuration_RTEMS_API.number_of_initialization_tasks; 8002ed4: 28 2e 00 28 lw r14,(r1+40) /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) 8002ed8: 34 0d 00 00 mvi r13,0 8002edc: 5d 60 00 1a bne r11,r0,8002f44 <_RTEMS_tasks_Initialize_user_tasks_body+0x94> 8002ee0: e0 00 00 1a bi 8002f48 <_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( 8002ee4: 29 61 00 00 lw r1,(r11+0) 8002ee8: 29 62 00 08 lw r2,(r11+8) 8002eec: 29 63 00 04 lw r3,(r11+4) 8002ef0: 29 64 00 14 lw r4,(r11+20) 8002ef4: 29 65 00 0c lw r5,(r11+12) 8002ef8: 37 86 00 18 addi r6,sp,24 8002efc: fb ff ff 53 calli 8002c48 8002f00: 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 ) ) 8002f04: 44 20 00 05 be r1,r0,8002f18 <_RTEMS_tasks_Initialize_user_tasks_body+0x68><== ALWAYS TAKEN _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 8002f08: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8002f0c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8002f10: b9 80 18 00 mv r3,r12 <== NOT EXECUTED 8002f14: e0 00 00 0a bi 8002f3c <_RTEMS_tasks_Initialize_user_tasks_body+0x8c><== NOT EXECUTED return_value = rtems_task_start( 8002f18: 29 63 00 18 lw r3,(r11+24) 8002f1c: 29 62 00 10 lw r2,(r11+16) 8002f20: 2b 81 00 18 lw r1,(sp+24) 8002f24: 35 6b 00 1c addi r11,r11,28 8002f28: f8 00 00 0f calli 8002f64 8002f2c: b8 20 18 00 mv r3,r1 id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) 8002f30: 44 2c 00 04 be r1,r12,8002f40 <_RTEMS_tasks_Initialize_user_tasks_body+0x90><== ALWAYS TAKEN _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 8002f34: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8002f38: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8002f3c: f8 00 04 3b calli 8004028 <_Internal_error_Occurred> <== NOT EXECUTED return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 8002f40: 35 ad 00 01 addi r13,r13,1 8002f44: 55 cd ff e8 bgu r14,r13,8002ee4 <_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 ); } } 8002f48: 2b 9d 00 04 lw ra,(sp+4) 8002f4c: 2b 8b 00 14 lw r11,(sp+20) 8002f50: 2b 8c 00 10 lw r12,(sp+16) 8002f54: 2b 8d 00 0c lw r13,(sp+12) 8002f58: 2b 8e 00 08 lw r14,(sp+8) 8002f5c: 37 9c 00 18 addi sp,sp,24 8002f60: c3 a0 00 00 ret =============================================================================== 08008950 <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 8008950: 37 9c ff f0 addi sp,sp,-16 8008954: 5b 8b 00 0c sw (sp+12),r11 8008958: 5b 8c 00 08 sw (sp+8),r12 800895c: 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 ]; 8008960: 28 2b 01 24 lw r11,(r1+292) if ( !api ) 8008964: 45 60 00 1a be r11,r0,80089cc <_RTEMS_tasks_Post_switch_extension+0x7c><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 8008968: 90 00 08 00 rcsr r1,IE 800896c: 34 02 ff fe mvi r2,-2 8008970: a0 22 10 00 and r2,r1,r2 8008974: d0 02 00 00 wcsr IE,r2 signal_set = asr->signals_posted; 8008978: 29 6c 00 14 lw r12,(r11+20) asr->signals_posted = 0; 800897c: 59 60 00 14 sw (r11+20),r0 _ISR_Enable( level ); 8008980: d0 01 00 00 wcsr IE,r1 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 8008984: 45 80 00 12 be r12,r0,80089cc <_RTEMS_tasks_Post_switch_extension+0x7c> return; asr->nest_level += 1; 8008988: 29 61 00 1c lw r1,(r11+28) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 800898c: 37 83 00 10 addi r3,sp,16 8008990: 38 02 ff ff mvu r2,0xffff if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 8008994: 34 21 00 01 addi r1,r1,1 8008998: 59 61 00 1c sw (r11+28),r1 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 800899c: 29 61 00 10 lw r1,(r11+16) 80089a0: f8 00 09 09 calli 800adc4 (*asr->handler)( signal_set ); 80089a4: 29 62 00 0c lw r2,(r11+12) 80089a8: b9 80 08 00 mv r1,r12 80089ac: d8 40 00 00 call r2 asr->nest_level -= 1; 80089b0: 29 61 00 1c lw r1,(r11+28) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 80089b4: 38 02 ff ff mvu r2,0xffff 80089b8: 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; 80089bc: 34 21 ff ff addi r1,r1,-1 80089c0: 59 61 00 1c sw (r11+28),r1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 80089c4: 2b 81 00 10 lw r1,(sp+16) 80089c8: f8 00 08 ff calli 800adc4 } 80089cc: 2b 9d 00 04 lw ra,(sp+4) 80089d0: 2b 8b 00 0c lw r11,(sp+12) 80089d4: 2b 8c 00 08 lw r12,(sp+8) 80089d8: 37 9c 00 10 addi sp,sp,16 80089dc: c3 a0 00 00 ret =============================================================================== 08004698 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 8004698: 37 9c ff f4 addi sp,sp,-12 800469c: 5b 8b 00 08 sw (sp+8),r11 80046a0: 5b 9d 00 04 sw (sp+4),ra 80046a4: b8 20 10 00 mv r2,r1 80046a8: 78 01 08 01 mvhi r1,0x801 80046ac: 38 21 f8 18 ori r1,r1,0xf818 80046b0: 37 83 00 0c addi r3,sp,12 80046b4: f8 00 08 c6 calli 80069cc <_Objects_Get> /* * When we get here, the Timer is already off the chain so we do not * have to worry about that -- hence no _Watchdog_Remove(). */ the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 80046b8: 2b 82 00 0c lw r2,(sp+12) 80046bc: b8 20 58 00 mv r11,r1 80046c0: 5c 40 00 22 bne r2,r0,8004748 <_Rate_monotonic_Timeout+0xb0><== NEVER TAKEN case OBJECTS_LOCAL: the_thread = the_period->owner; 80046c4: 28 21 00 40 lw r1,(r1+64) */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_period ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_PERIOD); 80046c8: 28 23 00 10 lw r3,(r1+16) 80046cc: 20 63 40 00 andi r3,r3,0x4000 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 80046d0: 44 62 00 09 be r3,r2,80046f4 <_Rate_monotonic_Timeout+0x5c> 80046d4: 28 23 00 20 lw r3,(r1+32) 80046d8: 29 62 00 08 lw r2,(r11+8) 80046dc: 5c 62 00 06 bne r3,r2,80046f4 <_Rate_monotonic_Timeout+0x5c> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 80046e0: 78 03 08 01 mvhi r3,0x801 80046e4: 38 63 ce 34 ori r3,r3,0xce34 80046e8: 28 62 00 00 lw r2,(r3+0) 80046ec: f8 00 0a 4c calli 800701c <_Thread_Clear_state> 80046f0: e0 00 00 06 bi 8004708 <_Rate_monotonic_Timeout+0x70> _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { 80046f4: 29 62 00 38 lw r2,(r11+56) 80046f8: 34 01 00 01 mvi r1,1 80046fc: 5c 41 00 0c bne r2,r1,800472c <_Rate_monotonic_Timeout+0x94> the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 8004700: 34 01 00 03 mvi r1,3 8004704: 59 61 00 38 sw (r11+56),r1 _Rate_monotonic_Initiate_statistics( the_period ); 8004708: b9 60 08 00 mv r1,r11 800470c: fb ff fe 2e calli 8003fc4 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8004710: 29 61 00 3c lw r1,(r11+60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8004714: 35 62 00 10 addi r2,r11,16 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8004718: 59 61 00 1c sw (r11+28),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800471c: 78 01 08 01 mvhi r1,0x801 8004720: 38 21 fa 08 ori r1,r1,0xfa08 8004724: f8 00 10 f9 calli 8008b08 <_Watchdog_Insert> 8004728: e0 00 00 03 bi 8004734 <_Rate_monotonic_Timeout+0x9c> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 800472c: 34 01 00 04 mvi r1,4 8004730: 59 61 00 38 sw (r11+56),r1 */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 8004734: 78 01 08 01 mvhi r1,0x801 8004738: 38 21 f9 44 ori r1,r1,0xf944 800473c: 28 22 00 00 lw r2,(r1+0) 8004740: 34 42 ff ff addi r2,r2,-1 8004744: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 8004748: 2b 9d 00 04 lw ra,(sp+4) 800474c: 2b 8b 00 08 lw r11,(sp+8) 8004750: 37 9c 00 0c addi sp,sp,12 8004754: c3 a0 00 00 ret =============================================================================== 08004058 <_Rate_monotonic_Update_statistics>: void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 8004058: 37 9c ff e4 addi sp,sp,-28 800405c: 5b 8b 00 0c sw (sp+12),r11 8004060: 5b 8c 00 08 sw (sp+8),r12 8004064: 5b 9d 00 04 sw (sp+4),ra 8004068: b8 20 58 00 mv r11,r1 /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 800406c: 28 21 00 54 lw r1,(r1+84) if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 8004070: 29 62 00 38 lw r2,(r11+56) /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 8004074: 34 21 00 01 addi r1,r1,1 8004078: 59 61 00 54 sw (r11+84),r1 if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 800407c: 34 01 00 04 mvi r1,4 8004080: 5c 41 00 04 bne r2,r1,8004090 <_Rate_monotonic_Update_statistics+0x38> stats->missed_count++; 8004084: 29 61 00 58 lw r1,(r11+88) 8004088: 34 21 00 01 addi r1,r1,1 800408c: 59 61 00 58 sw (r11+88),r1 /* * Grab status for time statistics. */ valid_status = _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); 8004090: 37 8c 00 18 addi r12,sp,24 stats->missed_count++; /* * Grab status for time statistics. */ valid_status = 8004094: b9 60 08 00 mv r1,r11 8004098: 37 82 00 10 addi r2,sp,16 800409c: b9 80 18 00 mv r3,r12 80040a0: fb ff ff 90 calli 8003ee0 <_Rate_monotonic_Get_status> _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 80040a4: 44 20 00 28 be r1,r0,8004144 <_Rate_monotonic_Update_statistics+0xec><== NEVER TAKEN /* * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); 80040a8: b9 80 10 00 mv r2,r12 80040ac: 35 61 00 6c addi r1,r11,108 80040b0: f8 00 11 33 calli 800857c <_Timespec_Add_to> if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 80040b4: b9 80 08 00 mv r1,r12 80040b8: 35 62 00 5c addi r2,r11,92 80040bc: f8 00 11 8e calli 80086f4 <_Timespec_Less_than> 80040c0: 44 20 00 05 be r1,r0,80040d4 <_Rate_monotonic_Update_statistics+0x7c> stats->min_cpu_time = executed; 80040c4: 2b 81 00 18 lw r1,(sp+24) 80040c8: 59 61 00 5c sw (r11+92),r1 80040cc: 2b 81 00 1c lw r1,(sp+28) 80040d0: 59 61 00 60 sw (r11+96),r1 if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 80040d4: 37 81 00 18 addi r1,sp,24 80040d8: 35 62 00 64 addi r2,r11,100 80040dc: f8 00 11 7b calli 80086c8 <_Timespec_Greater_than> 80040e0: 44 20 00 05 be r1,r0,80040f4 <_Rate_monotonic_Update_statistics+0x9c> stats->max_cpu_time = executed; 80040e4: 2b 81 00 18 lw r1,(sp+24) 80040e8: 59 61 00 64 sw (r11+100),r1 80040ec: 2b 81 00 1c lw r1,(sp+28) 80040f0: 59 61 00 68 sw (r11+104),r1 /* * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); 80040f4: 37 8c 00 10 addi r12,sp,16 80040f8: b9 80 10 00 mv r2,r12 80040fc: 35 61 00 84 addi r1,r11,132 8004100: f8 00 11 1f calli 800857c <_Timespec_Add_to> if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 8004104: b9 80 08 00 mv r1,r12 8004108: 35 62 00 74 addi r2,r11,116 800410c: f8 00 11 7a calli 80086f4 <_Timespec_Less_than> 8004110: 44 20 00 05 be r1,r0,8004124 <_Rate_monotonic_Update_statistics+0xcc> stats->min_wall_time = since_last_period; 8004114: 2b 81 00 10 lw r1,(sp+16) 8004118: 59 61 00 74 sw (r11+116),r1 800411c: 2b 81 00 14 lw r1,(sp+20) 8004120: 59 61 00 78 sw (r11+120),r1 if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 8004124: 37 81 00 10 addi r1,sp,16 8004128: 35 62 00 7c addi r2,r11,124 800412c: f8 00 11 67 calli 80086c8 <_Timespec_Greater_than> 8004130: 44 20 00 05 be r1,r0,8004144 <_Rate_monotonic_Update_statistics+0xec> stats->max_wall_time = since_last_period; 8004134: 2b 81 00 10 lw r1,(sp+16) 8004138: 59 61 00 7c sw (r11+124),r1 800413c: 2b 81 00 14 lw r1,(sp+20) 8004140: 59 61 00 80 sw (r11+128),r1 stats->min_wall_time = since_last_period; if ( since_last_period > stats->max_wall_time ) stats->max_wall_time = since_last_period; #endif } 8004144: 2b 9d 00 04 lw ra,(sp+4) 8004148: 2b 8b 00 0c lw r11,(sp+12) 800414c: 2b 8c 00 08 lw r12,(sp+8) 8004150: 37 9c 00 1c addi sp,sp,28 8004154: c3 a0 00 00 ret =============================================================================== 080039c0 <_TOD_Get>: */ void _TOD_Get( struct timespec *time ) { 80039c0: 37 9c ff e4 addi sp,sp,-28 80039c4: 5b 8b 00 0c sw (sp+12),r11 80039c8: 5b 8c 00 08 sw (sp+8),r12 80039cc: 5b 9d 00 04 sw (sp+4),ra 80039d0: 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 ); 80039d4: 90 00 60 00 rcsr r12,IE 80039d8: 34 01 ff fe mvi r1,-2 80039dc: a1 81 08 00 and r1,r12,r1 80039e0: d0 01 00 00 wcsr IE,r1 now = _TOD_Now; 80039e4: 78 02 08 01 mvhi r2,0x801 80039e8: 38 42 38 a4 ori r2,r2,0x38a4 80039ec: 28 41 00 00 lw r1,(r2+0) 80039f0: 5b 81 00 10 sw (sp+16),r1 80039f4: 28 41 00 04 lw r1,(r2+4) if ( _Watchdog_Nanoseconds_since_tick_handler ) 80039f8: 78 02 08 01 mvhi r2,0x801 80039fc: 38 42 39 a0 ori r2,r2,0x39a0 8003a00: 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; 8003a04: 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; 8003a08: 34 02 00 00 mvi r2,0 _ISR_Disable( level ); now = _TOD_Now; if ( _Watchdog_Nanoseconds_since_tick_handler ) 8003a0c: 44 60 00 03 be r3,r0,8003a18 <_TOD_Get+0x58> <== ALWAYS TAKEN nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 8003a10: d8 60 00 00 call r3 <== NOT EXECUTED 8003a14: b8 20 10 00 mv r2,r1 <== NOT EXECUTED _ISR_Enable( level ); 8003a18: d0 0c 00 00 wcsr IE,r12 _Timestamp_Set( &offset, 0, nanoseconds ); 8003a1c: 5b 82 00 1c sw (sp+28),r2 _Timestamp_Add_to( &now, &offset ); 8003a20: 37 81 00 10 addi r1,sp,16 8003a24: 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 ); 8003a28: 5b 80 00 18 sw (sp+24),r0 _Timestamp_Add_to( &now, &offset ); 8003a2c: f8 00 09 a8 calli 80060cc <_Timespec_Add_to> _Timestamp_To_timespec( &now, time ); 8003a30: 2b 81 00 10 lw r1,(sp+16) 8003a34: 59 61 00 00 sw (r11+0),r1 8003a38: 2b 81 00 14 lw r1,(sp+20) 8003a3c: 59 61 00 04 sw (r11+4),r1 } 8003a40: 2b 9d 00 04 lw ra,(sp+4) 8003a44: 2b 8b 00 0c lw r11,(sp+12) 8003a48: 2b 8c 00 08 lw r12,(sp+8) 8003a4c: 37 9c 00 1c addi sp,sp,28 8003a50: c3 a0 00 00 ret =============================================================================== 08008e24 <_TOD_Get_uptime>: */ void _TOD_Get_uptime( Timestamp_Control *uptime ) { 8008e24: 37 9c ff e4 addi sp,sp,-28 8008e28: 5b 8b 00 0c sw (sp+12),r11 8008e2c: 5b 8c 00 08 sw (sp+8),r12 8008e30: 5b 9d 00 04 sw (sp+4),ra 8008e34: 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 ); 8008e38: 90 00 60 00 rcsr r12,IE 8008e3c: 34 01 ff fe mvi r1,-2 8008e40: a1 81 08 00 and r1,r12,r1 8008e44: d0 01 00 00 wcsr IE,r1 up = _TOD_Uptime; 8008e48: 78 02 08 01 mvhi r2,0x801 8008e4c: 38 42 38 98 ori r2,r2,0x3898 8008e50: 28 41 00 00 lw r1,(r2+0) 8008e54: 5b 81 00 10 sw (sp+16),r1 8008e58: 28 41 00 04 lw r1,(r2+4) if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008e5c: 78 02 08 01 mvhi r2,0x801 8008e60: 38 42 39 a0 ori r2,r2,0x39a0 8008e64: 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; 8008e68: 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; 8008e6c: 34 02 00 00 mvi r2,0 _ISR_Disable( level ); up = _TOD_Uptime; if ( _Watchdog_Nanoseconds_since_tick_handler ) 8008e70: 44 60 00 03 be r3,r0,8008e7c <_TOD_Get_uptime+0x58> <== ALWAYS TAKEN nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 8008e74: d8 60 00 00 call r3 <== NOT EXECUTED 8008e78: b8 20 10 00 mv r2,r1 <== NOT EXECUTED _ISR_Enable( level ); 8008e7c: d0 0c 00 00 wcsr IE,r12 _Timestamp_Set( &offset, 0, nanoseconds ); 8008e80: 5b 82 00 1c sw (sp+28),r2 _Timestamp_Add_to( &up, &offset ); 8008e84: 37 81 00 10 addi r1,sp,16 8008e88: 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 ); 8008e8c: 5b 80 00 18 sw (sp+24),r0 _Timestamp_Add_to( &up, &offset ); 8008e90: fb ff f4 8f calli 80060cc <_Timespec_Add_to> *uptime = up; 8008e94: 2b 81 00 10 lw r1,(sp+16) 8008e98: 59 61 00 00 sw (r11+0),r1 8008e9c: 2b 81 00 14 lw r1,(sp+20) 8008ea0: 59 61 00 04 sw (r11+4),r1 } 8008ea4: 2b 9d 00 04 lw ra,(sp+4) 8008ea8: 2b 8b 00 0c lw r11,(sp+12) 8008eac: 2b 8c 00 08 lw r12,(sp+8) 8008eb0: 37 9c 00 1c addi sp,sp,28 8008eb4: c3 a0 00 00 ret =============================================================================== 080042c8 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 80042c8: 37 9c ff f0 addi sp,sp,-16 80042cc: 5b 8b 00 10 sw (sp+16),r11 80042d0: 5b 8c 00 0c sw (sp+12),r12 80042d4: 5b 8d 00 08 sw (sp+8),r13 80042d8: 5b 9d 00 04 sw (sp+4),ra 80042dc: b8 20 58 00 mv r11,r1 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 80042e0: 78 01 08 01 mvhi r1,0x801 80042e4: 38 21 f0 c4 ori r1,r1,0xf0c4 80042e8: 28 22 00 0c lw r2,(r1+12) (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; 80042ec: 34 0c 00 00 mvi r12,0 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 80042f0: 45 60 00 22 be r11,r0,8004378 <_TOD_Validate+0xb0> <== NEVER TAKEN ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 80042f4: 78 03 08 01 mvhi r3,0x801 80042f8: 38 63 cc 94 ori r3,r3,0xcc94 80042fc: 28 61 00 00 lw r1,(r3+0) 8004300: f8 00 5e 2e calli 801bbb8 <__udivsi3> rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 8004304: 29 62 00 18 lw r2,(r11+24) 8004308: 50 41 00 1c bgeu r2,r1,8004378 <_TOD_Validate+0xb0> (the_tod->ticks >= ticks_per_second) || 800430c: 29 62 00 14 lw r2,(r11+20) 8004310: 34 01 00 3b mvi r1,59 8004314: 54 41 00 19 bgu r2,r1,8004378 <_TOD_Validate+0xb0> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 8004318: 29 62 00 10 lw r2,(r11+16) 800431c: 54 41 00 17 bgu r2,r1,8004378 <_TOD_Validate+0xb0> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 8004320: 29 62 00 0c lw r2,(r11+12) 8004324: 34 01 00 17 mvi r1,23 8004328: 54 41 00 14 bgu r2,r1,8004378 <_TOD_Validate+0xb0> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 800432c: 29 61 00 04 lw r1,(r11+4) rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || 8004330: 44 20 00 12 be r1,r0,8004378 <_TOD_Validate+0xb0> <== NEVER TAKEN (the_tod->month == 0) || 8004334: 34 02 00 0c mvi r2,12 8004338: 54 22 00 10 bgu r1,r2,8004378 <_TOD_Validate+0xb0> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 800433c: 29 62 00 00 lw r2,(r11+0) (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || 8004340: 34 03 07 c3 mvi r3,1987 8004344: 50 62 00 0d bgeu r3,r2,8004378 <_TOD_Validate+0xb0> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 8004348: 29 6d 00 08 lw r13,(r11+8) (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 800434c: 45 a0 00 0b be r13,r0,8004378 <_TOD_Validate+0xb0> <== NEVER TAKEN 8004350: 78 0b 08 01 mvhi r11,0x801 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 8004354: 20 42 00 03 andi r2,r2,0x3 8004358: 39 6b d5 4c ori r11,r11,0xd54c 800435c: 5c 40 00 02 bne r2,r0,8004364 <_TOD_Validate+0x9c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 8004360: 34 21 00 0d addi r1,r1,13 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 8004364: 34 02 00 02 mvi r2,2 8004368: fb ff f3 d4 calli 80012b8 <__ashlsi3> 800436c: b5 61 08 00 add r1,r11,r1 8004370: 28 2c 00 00 lw r12,(r1+0) * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 8004374: f1 8d 60 00 cmpgeu r12,r12,r13 if ( the_tod->day > days_in_month ) return false; return true; } 8004378: b9 80 08 00 mv r1,r12 800437c: 2b 9d 00 04 lw ra,(sp+4) 8004380: 2b 8b 00 10 lw r11,(sp+16) 8004384: 2b 8c 00 0c lw r12,(sp+12) 8004388: 2b 8d 00 08 lw r13,(sp+8) 800438c: 37 9c 00 10 addi sp,sp,16 8004390: c3 a0 00 00 ret =============================================================================== 08004b38 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 8004b38: 37 9c ff ec addi sp,sp,-20 8004b3c: 5b 8b 00 14 sw (sp+20),r11 8004b40: 5b 8c 00 10 sw (sp+16),r12 8004b44: 5b 8d 00 0c sw (sp+12),r13 8004b48: 5b 8e 00 08 sw (sp+8),r14 8004b4c: 5b 9d 00 04 sw (sp+4),ra 8004b50: b8 20 58 00 mv r11,r1 */ /* * Save original state */ original_state = the_thread->current_state; 8004b54: 28 2e 00 10 lw r14,(r1+16) void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 8004b58: b8 40 60 00 mv r12,r2 8004b5c: 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 ); 8004b60: f8 00 04 a4 calli 8005df0 <_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 ) 8004b64: 29 61 00 14 lw r1,(r11+20) 8004b68: 44 2c 00 04 be r1,r12,8004b78 <_Thread_Change_priority+0x40> _Thread_Set_priority( the_thread, new_priority ); 8004b6c: b9 60 08 00 mv r1,r11 8004b70: b9 80 10 00 mv r2,r12 8004b74: f8 00 03 f4 calli 8005b44 <_Thread_Set_priority> _ISR_Disable( level ); 8004b78: 90 00 60 00 rcsr r12,IE 8004b7c: 34 04 ff fe mvi r4,-2 8004b80: a1 84 20 00 and r4,r12,r4 8004b84: 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; 8004b88: 29 61 00 10 lw r1,(r11+16) if ( state != STATES_TRANSIENT ) { 8004b8c: 34 03 00 04 mvi r3,4 8004b90: 21 c2 00 04 andi r2,r14,0x4 8004b94: 44 23 00 0f be r1,r3,8004bd0 <_Thread_Change_priority+0x98> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 8004b98: 5c 40 00 04 bne r2,r0,8004ba8 <_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); 8004b9c: 34 02 ff fb mvi r2,-5 8004ba0: a0 22 10 00 and r2,r1,r2 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 8004ba4: 59 62 00 10 sw (r11+16),r2 _ISR_Enable( level ); 8004ba8: 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); 8004bac: 78 03 08 01 mvhi r3,0x801 8004bb0: 38 63 1d d0 ori r3,r3,0x1dd0 8004bb4: 28 62 00 00 lw r2,(r3+0) 8004bb8: a0 22 08 00 and r1,r1,r2 if ( _States_Is_waiting_on_thread_queue( state ) ) { 8004bbc: 44 20 00 60 be r1,r0,8004d3c <_Thread_Change_priority+0x204> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 8004bc0: 29 61 00 44 lw r1,(r11+68) 8004bc4: b9 60 10 00 mv r2,r11 8004bc8: f8 00 03 aa calli 8005a70 <_Thread_queue_Requeue> 8004bcc: e0 00 00 5c bi 8004d3c <_Thread_Change_priority+0x204> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 8004bd0: 5c 40 00 1c bne r2,r0,8004c40 <_Thread_Change_priority+0x108><== NEVER TAKEN RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 8004bd4: 29 61 00 90 lw r1,(r11+144) 8004bd8: 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 ); 8004bdc: 59 60 00 10 sw (r11+16),r0 8004be0: 2c 25 00 00 lhu r5,(r1+0) 8004be4: b8 a3 18 00 or r3,r5,r3 8004be8: 0c 23 00 00 sh (r1+0),r3 _Priority_Major_bit_map |= the_priority_map->ready_major; 8004bec: 78 01 08 01 mvhi r1,0x801 8004bf0: 38 21 38 bc ori r1,r1,0x38bc 8004bf4: 2c 23 00 00 lhu r3,(r1+0) 8004bf8: 2d 65 00 94 lhu r5,(r11+148) 8004bfc: b8 a3 18 00 or r3,r5,r3 8004c00: 20 63 ff ff andi r3,r3,0xffff 8004c04: 0c 23 00 00 sh (r1+0),r3 8004c08: 29 61 00 8c lw r1,(r11+140) _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 8004c0c: 45 a2 00 07 be r13,r2,8004c28 <_Thread_Change_priority+0xf0> ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 8004c10: 28 22 00 00 lw r2,(r1+0) Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 8004c14: 59 61 00 04 sw (r11+4),r1 before_node = after_node->next; after_node->next = the_node; 8004c18: 58 2b 00 00 sw (r1+0),r11 the_node->next = before_node; 8004c1c: 59 62 00 00 sw (r11+0),r2 before_node->previous = the_node; 8004c20: 58 4b 00 04 sw (r2+4),r11 8004c24: e0 00 00 07 bi 8004c40 <_Thread_Change_priority+0x108> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8004c28: 34 22 00 04 addi r2,r1,4 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 8004c2c: 59 62 00 00 sw (r11+0),r2 old_last_node = the_chain->last; 8004c30: 28 22 00 08 lw r2,(r1+8) the_chain->last = the_node; 8004c34: 58 2b 00 08 sw (r1+8),r11 old_last_node->next = the_node; 8004c38: 58 4b 00 00 sw (r2+0),r11 the_node->previous = old_last_node; 8004c3c: 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 ); 8004c40: d0 0c 00 00 wcsr IE,r12 8004c44: d0 04 00 00 wcsr IE,r4 */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) _Thread_Ready_chain[ _Priority_Get_highest() ].first; 8004c48: 78 01 08 01 mvhi r1,0x801 RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void ) { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 8004c4c: 78 02 08 01 mvhi r2,0x801 8004c50: 38 21 37 b0 ori r1,r1,0x37b0 8004c54: 38 42 38 bc ori r2,r2,0x38bc 8004c58: 28 2e 00 00 lw r14,(r1+0) 8004c5c: 2c 41 00 00 lhu r1,(r2+0) 8004c60: 78 0b 08 01 mvhi r11,0x801 8004c64: 34 02 00 ff mvi r2,255 8004c68: 20 21 ff ff andi r1,r1,0xffff 8004c6c: 39 6b 1c 58 ori r11,r11,0x1c58 8004c70: 54 22 00 05 bgu r1,r2,8004c84 <_Thread_Change_priority+0x14c> 8004c74: b5 61 58 00 add r11,r11,r1 8004c78: 41 6d 00 00 lbu r13,(r11+0) 8004c7c: 35 ad 00 08 addi r13,r13,8 8004c80: e0 00 00 05 bi 8004c94 <_Thread_Change_priority+0x15c> 8004c84: 34 02 00 08 mvi r2,8 8004c88: f8 00 2f 43 calli 8010994 <__lshrsi3> 8004c8c: b5 61 58 00 add r11,r11,r1 8004c90: 41 6d 00 00 lbu r13,(r11+0) _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 8004c94: 34 02 00 01 mvi r2,1 8004c98: 78 0b 08 01 mvhi r11,0x801 8004c9c: b9 a0 08 00 mv r1,r13 8004ca0: f8 00 2e ef calli 801085c <__ashlsi3> 8004ca4: 39 6b 39 30 ori r11,r11,0x3930 8004ca8: b5 61 58 00 add r11,r11,r1 8004cac: 2d 62 00 00 lhu r2,(r11+0) 8004cb0: 34 01 00 ff mvi r1,255 8004cb4: 78 0b 08 01 mvhi r11,0x801 8004cb8: 39 6b 1c 58 ori r11,r11,0x1c58 8004cbc: 54 41 00 05 bgu r2,r1,8004cd0 <_Thread_Change_priority+0x198> 8004cc0: b5 62 58 00 add r11,r11,r2 8004cc4: 41 6b 00 00 lbu r11,(r11+0) 8004cc8: 35 6b 00 08 addi r11,r11,8 8004ccc: e0 00 00 06 bi 8004ce4 <_Thread_Change_priority+0x1ac> 8004cd0: b8 40 08 00 mv r1,r2 8004cd4: 34 02 00 08 mvi r2,8 8004cd8: f8 00 2f 2f calli 8010994 <__lshrsi3> 8004cdc: b5 61 58 00 add r11,r11,r1 8004ce0: 41 6b 00 00 lbu r11,(r11+0) return (_Priority_Bits_index( major ) << 4) + 8004ce4: 34 02 00 04 mvi r2,4 8004ce8: b9 a0 08 00 mv r1,r13 8004cec: f8 00 2e dc calli 801085c <__ashlsi3> 8004cf0: b5 61 58 00 add r11,r11,r1 8004cf4: 34 02 00 01 mvi r2,1 8004cf8: b9 60 08 00 mv r1,r11 8004cfc: f8 00 2e d8 calli 801085c <__ashlsi3> 8004d00: 34 02 00 02 mvi r2,2 8004d04: b4 2b 08 00 add r1,r1,r11 8004d08: f8 00 2e d5 calli 801085c <__ashlsi3> 8004d0c: b5 c1 08 00 add r1,r14,r1 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 8004d10: 28 23 00 00 lw r3,(r1+0) 8004d14: 78 01 08 01 mvhi r1,0x801 8004d18: 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 ); 8004d1c: 28 22 00 0c lw r2,(r1+12) * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 8004d20: 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() && 8004d24: 44 43 00 05 be r2,r3,8004d38 <_Thread_Change_priority+0x200> 8004d28: 40 42 00 74 lbu r2,(r2+116) 8004d2c: 44 40 00 03 be r2,r0,8004d38 <_Thread_Change_priority+0x200> _Thread_Executing->is_preemptible ) _Context_Switch_necessary = true; 8004d30: 34 02 00 01 mvi r2,1 8004d34: 30 22 00 18 sb (r1+24),r2 _ISR_Enable( level ); 8004d38: d0 0c 00 00 wcsr IE,r12 } 8004d3c: 2b 9d 00 04 lw ra,(sp+4) 8004d40: 2b 8b 00 14 lw r11,(sp+20) 8004d44: 2b 8c 00 10 lw r12,(sp+16) 8004d48: 2b 8d 00 0c lw r13,(sp+12) 8004d4c: 2b 8e 00 08 lw r14,(sp+8) 8004d50: 37 9c 00 14 addi sp,sp,20 8004d54: c3 a0 00 00 ret =============================================================================== 080093b0 <_Thread_Clear_state>: ) { ISR_Level level; States_Control current_state; _ISR_Disable( level ); 80093b0: 90 00 18 00 rcsr r3,IE 80093b4: 34 04 ff fe mvi r4,-2 80093b8: a0 64 20 00 and r4,r3,r4 80093bc: d0 04 00 00 wcsr IE,r4 current_state = the_thread->current_state; 80093c0: 28 25 00 10 lw r5,(r1+16) if ( current_state & state ) { 80093c4: a0 45 30 00 and r6,r2,r5 80093c8: 44 c0 00 29 be r6,r0,800946c <_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); 80093cc: a4 40 10 00 not r2,r2 80093d0: a0 45 10 00 and r2,r2,r5 current_state = the_thread->current_state = _States_Clear( state, current_state ); 80093d4: 58 22 00 10 sw (r1+16),r2 if ( _States_Is_ready( current_state ) ) { 80093d8: 5c 40 00 25 bne r2,r0,800946c <_Thread_Clear_state+0xbc> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 80093dc: 28 22 00 90 lw r2,(r1+144) 80093e0: 2c 25 00 96 lhu r5,(r1+150) 80093e4: 2c 46 00 00 lhu r6,(r2+0) 80093e8: b8 c5 28 00 or r5,r6,r5 80093ec: 0c 45 00 00 sh (r2+0),r5 _Priority_Major_bit_map |= the_priority_map->ready_major; 80093f0: 78 02 08 01 mvhi r2,0x801 80093f4: 38 42 38 bc ori r2,r2,0x38bc 80093f8: 2c 45 00 00 lhu r5,(r2+0) 80093fc: 2c 26 00 94 lhu r6,(r1+148) 8009400: b8 c5 28 00 or r5,r6,r5 8009404: 20 a5 ff ff andi r5,r5,0xffff 8009408: 0c 45 00 00 sh (r2+0),r5 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 800940c: 28 22 00 8c lw r2,(r1+140) 8009410: 34 45 00 04 addi r5,r2,4 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 8009414: 58 25 00 00 sw (r1+0),r5 old_last_node = the_chain->last; 8009418: 28 45 00 08 lw r5,(r2+8) the_chain->last = the_node; 800941c: 58 41 00 08 sw (r2+8),r1 old_last_node->next = the_node; 8009420: 58 a1 00 00 sw (r5+0),r1 the_node->previous = old_last_node; 8009424: 58 25 00 04 sw (r1+4),r5 _ISR_Flash( level ); 8009428: d0 03 00 00 wcsr IE,r3 800942c: 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 ) { 8009430: 78 02 08 01 mvhi r2,0x801 8009434: 38 42 39 e8 ori r2,r2,0x39e8 8009438: 28 45 00 10 lw r5,(r2+16) 800943c: 28 24 00 14 lw r4,(r1+20) 8009440: 28 a5 00 14 lw r5,(r5+20) 8009444: 50 85 00 0a bgeu r4,r5,800946c <_Thread_Clear_state+0xbc> _Thread_Heir = the_thread; 8009448: 58 41 00 10 sw (r2+16),r1 if ( _Thread_Executing->is_preemptible || 800944c: 28 41 00 0c lw r1,(r2+12) 8009450: 40 21 00 74 lbu r1,(r1+116) 8009454: 5c 20 00 02 bne r1,r0,800945c <_Thread_Clear_state+0xac> 8009458: 5c 81 00 05 bne r4,r1,800946c <_Thread_Clear_state+0xbc> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 800945c: 78 01 08 01 mvhi r1,0x801 8009460: 38 21 39 e8 ori r1,r1,0x39e8 8009464: 34 02 00 01 mvi r2,1 8009468: 30 22 00 18 sb (r1+24),r2 } } } _ISR_Enable( level ); 800946c: d0 03 00 00 wcsr IE,r3 } 8009470: c3 a0 00 00 ret =============================================================================== 0800badc <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 800badc: 37 9c ff f8 addi sp,sp,-8 800bae0: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 800bae4: 37 82 00 08 addi r2,sp,8 800bae8: f8 00 00 7c calli 800bcd8 <_Thread_Get> switch ( location ) { 800baec: 2b 82 00 08 lw r2,(sp+8) 800baf0: 5c 40 00 0a bne r2,r0,800bb18 <_Thread_Delay_ended+0x3c> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 800baf4: 78 03 08 02 mvhi r3,0x802 800baf8: 38 63 52 f4 ori r3,r3,0x52f4 800bafc: 28 62 00 00 lw r2,(r3+0) 800bb00: fb ff ff 5a calli 800b868 <_Thread_Clear_state> 800bb04: 78 01 08 02 mvhi r1,0x802 800bb08: 38 21 79 9c ori r1,r1,0x799c 800bb0c: 28 22 00 00 lw r2,(r1+0) 800bb10: 34 42 ff ff addi r2,r2,-1 800bb14: 58 22 00 00 sw (r1+0),r2 | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 800bb18: 2b 9d 00 04 lw ra,(sp+4) 800bb1c: 37 9c 00 08 addi sp,sp,8 800bb20: c3 a0 00 00 ret =============================================================================== 08004f08 <_Thread_Dispatch>: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 8004f08: 37 9c ff c0 addi sp,sp,-64 8004f0c: 5b 8b 00 30 sw (sp+48),r11 8004f10: 5b 8c 00 2c sw (sp+44),r12 8004f14: 5b 8d 00 28 sw (sp+40),r13 8004f18: 5b 8e 00 24 sw (sp+36),r14 8004f1c: 5b 8f 00 20 sw (sp+32),r15 8004f20: 5b 90 00 1c sw (sp+28),r16 8004f24: 5b 91 00 18 sw (sp+24),r17 8004f28: 5b 92 00 14 sw (sp+20),r18 8004f2c: 5b 93 00 10 sw (sp+16),r19 8004f30: 5b 94 00 0c sw (sp+12),r20 8004f34: 5b 95 00 08 sw (sp+8),r21 8004f38: 5b 9d 00 04 sw (sp+4),ra Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 8004f3c: 78 01 08 01 mvhi r1,0x801 8004f40: 38 21 39 e8 ori r1,r1,0x39e8 8004f44: 28 2d 00 0c lw r13,(r1+12) _ISR_Disable( level ); 8004f48: 90 00 20 00 rcsr r4,IE 8004f4c: 34 01 ff fe mvi r1,-2 8004f50: a0 81 08 00 and r1,r4,r1 8004f54: d0 01 00 00 wcsr IE,r1 while ( _Context_Switch_necessary == true ) { 8004f58: 78 0c 08 01 mvhi r12,0x801 heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 8004f5c: 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; 8004f60: 78 0f 08 01 mvhi r15,0x801 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 8004f64: 78 0e 08 01 mvhi r14,0x801 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8004f68: 78 10 08 01 mvhi r16,0x801 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 8004f6c: 39 8c 39 e8 ori r12,r12,0x39e8 heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 8004f70: 3a 31 38 1c ori r17,r17,0x381c 8004f74: 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; 8004f78: 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 ); 8004f7c: 37 93 00 3c addi r19,sp,60 _Timestamp_Subtract( 8004f80: 39 ce 38 cc ori r14,r14,0x38cc 8004f84: 37 92 00 34 addi r18,sp,52 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8004f88: 3a 10 38 a0 ori r16,r16,0x38a0 #endif #endif executing = _Thread_Executing; _ISR_Disable( level ); 8004f8c: 34 15 ff fe mvi r21,-2 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 8004f90: e0 00 00 28 bi 8005030 <_Thread_Dispatch+0x128> heir = _Thread_Heir; 8004f94: 29 8b 00 10 lw r11,(r12+16) _Thread_Dispatch_disable_level = 1; 8004f98: 5a 34 00 00 sw (r17+0),r20 _Context_Switch_necessary = false; 8004f9c: 31 80 00 18 sb (r12+24),r0 _Thread_Executing = heir; 8004fa0: 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 ) 8004fa4: 45 6d 00 26 be r11,r13,800503c <_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 ) 8004fa8: 29 61 00 7c lw r1,(r11+124) 8004fac: 5c 34 00 03 bne r1,r20,8004fb8 <_Thread_Dispatch+0xb0> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 8004fb0: 29 e1 00 00 lw r1,(r15+0) 8004fb4: 59 61 00 78 sw (r11+120),r1 _ISR_Enable( level ); 8004fb8: d0 04 00 00 wcsr IE,r4 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 8004fbc: ba 60 08 00 mv r1,r19 8004fc0: f8 00 0f 99 calli 8008e24 <_TOD_Get_uptime> _Timestamp_Subtract( 8004fc4: b9 c0 08 00 mv r1,r14 8004fc8: ba 60 10 00 mv r2,r19 8004fcc: ba 40 18 00 mv r3,r18 8004fd0: f8 00 04 58 calli 8006130 <_Timespec_Subtract> &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 8004fd4: 35 a1 00 84 addi r1,r13,132 8004fd8: ba 40 10 00 mv r2,r18 8004fdc: f8 00 04 3c calli 80060cc <_Timespec_Add_to> _Thread_Time_of_last_context_switch = uptime; 8004fe0: 2b 81 00 3c lw r1,(sp+60) #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8004fe4: 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; 8004fe8: 59 c1 00 00 sw (r14+0),r1 8004fec: 2b 81 00 40 lw r1,(sp+64) 8004ff0: 59 c1 00 04 sw (r14+4),r1 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8004ff4: 44 80 00 05 be r4,r0,8005008 <_Thread_Dispatch+0x100> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 8004ff8: 28 81 00 00 lw r1,(r4+0) 8004ffc: 59 a1 01 20 sw (r13+288),r1 *_Thread_libc_reent = heir->libc_reent; 8005000: 29 61 01 20 lw r1,(r11+288) 8005004: 58 81 00 00 sw (r4+0),r1 } _User_extensions_Thread_switch( executing, heir ); 8005008: b9 a0 08 00 mv r1,r13 800500c: b9 60 10 00 mv r2,r11 8005010: f8 00 05 43 calli 800651c <_User_extensions_Thread_switch> if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 8005014: 35 a1 00 cc addi r1,r13,204 8005018: 35 62 00 cc addi r2,r11,204 800501c: f8 00 06 55 calli 8006970 <_CPU_Context_switch> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 8005020: 29 8d 00 0c lw r13,(r12+12) _ISR_Disable( level ); 8005024: 90 00 20 00 rcsr r4,IE 8005028: a0 95 08 00 and r1,r4,r21 800502c: d0 01 00 00 wcsr IE,r1 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 8005030: 41 81 00 18 lbu r1,(r12+24) 8005034: 20 21 00 ff andi r1,r1,0xff 8005038: 5c 20 ff d7 bne r1,r0,8004f94 <_Thread_Dispatch+0x8c> _ISR_Disable( level ); } post_switch: _Thread_Dispatch_disable_level = 0; 800503c: 78 01 08 01 mvhi r1,0x801 8005040: 38 21 38 1c ori r1,r1,0x381c 8005044: 58 20 00 00 sw (r1+0),r0 _ISR_Enable( level ); 8005048: d0 04 00 00 wcsr IE,r4 _API_extensions_Run_postswitch(); 800504c: fb ff f8 d0 calli 800338c <_API_extensions_Run_postswitch> } 8005050: 2b 9d 00 04 lw ra,(sp+4) 8005054: 2b 8b 00 30 lw r11,(sp+48) 8005058: 2b 8c 00 2c lw r12,(sp+44) 800505c: 2b 8d 00 28 lw r13,(sp+40) 8005060: 2b 8e 00 24 lw r14,(sp+36) 8005064: 2b 8f 00 20 lw r15,(sp+32) 8005068: 2b 90 00 1c lw r16,(sp+28) 800506c: 2b 91 00 18 lw r17,(sp+24) 8005070: 2b 92 00 14 lw r18,(sp+20) 8005074: 2b 93 00 10 lw r19,(sp+16) 8005078: 2b 94 00 0c lw r20,(sp+12) 800507c: 2b 95 00 08 lw r21,(sp+8) 8005080: 37 9c 00 40 addi sp,sp,64 8005084: c3 a0 00 00 ret =============================================================================== 080050bc <_Thread_Get>: Thread_Control *_Thread_Get ( Objects_Id id, Objects_Locations *location ) { 80050bc: 37 9c ff e8 addi sp,sp,-24 80050c0: 5b 8b 00 18 sw (sp+24),r11 80050c4: 5b 8c 00 14 sw (sp+20),r12 80050c8: 5b 8d 00 10 sw (sp+16),r13 80050cc: 5b 8e 00 0c sw (sp+12),r14 80050d0: 5b 8f 00 08 sw (sp+8),r15 80050d4: 5b 9d 00 04 sw (sp+4),ra 80050d8: b8 20 68 00 mv r13,r1 80050dc: 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 ) ) { 80050e0: 5c 20 00 0b bne r1,r0,800510c <_Thread_Get+0x50> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 80050e4: 78 01 08 01 mvhi r1,0x801 80050e8: 38 21 38 1c ori r1,r1,0x381c 80050ec: 28 22 00 00 lw r2,(r1+0) 80050f0: 34 42 00 01 addi r2,r2,1 80050f4: 58 22 00 00 sw (r1+0),r2 _Thread_Disable_dispatch(); *location = OBJECTS_LOCAL; tp = _Thread_Executing; 80050f8: 78 01 08 01 mvhi r1,0x801 80050fc: 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; 8005100: 59 60 00 00 sw (r11+0),r0 tp = _Thread_Executing; 8005104: 28 21 00 0c lw r1,(r1+12) goto done; 8005108: e0 00 00 1c bi 8005178 <_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); 800510c: 34 02 00 18 mvi r2,24 8005110: f8 00 2e 21 calli 8010994 <__lshrsi3> 8005114: 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 ) 8005118: 35 e1 ff ff addi r1,r15,-1 800511c: 34 02 00 02 mvi r2,2 8005120: 50 41 00 1e bgeu r2,r1,8005198 <_Thread_Get+0xdc> } the_api = _Objects_Get_API( id ); if ( !_Objects_Is_api_valid( the_api ) ) { *location = OBJECTS_ERROR; 8005124: 34 01 00 01 mvi r1,1 8005128: 59 61 00 00 sw (r11+0),r1 800512c: e0 00 00 02 bi 8005134 <_Thread_Get+0x78> goto done; } the_class = _Objects_Get_class( id ); if ( the_class != 1 ) { /* threads are always first class :) */ *location = OBJECTS_ERROR; 8005130: 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; 8005134: 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; 8005138: e0 00 00 10 bi 8005178 <_Thread_Get+0xbc> } api_information = _Objects_Information_table[ the_api ]; 800513c: 78 0e 08 01 mvhi r14,0x801 8005140: b9 e0 08 00 mv r1,r15 8005144: 34 02 00 02 mvi r2,2 8005148: f8 00 2d c5 calli 801085c <__ashlsi3> 800514c: 39 ce 37 b8 ori r14,r14,0x37b8 8005150: b5 c1 08 00 add r1,r14,r1 8005154: 28 21 00 00 lw r1,(r1+0) if ( !api_information ) { 8005158: 44 20 00 03 be r1,r0,8005164 <_Thread_Get+0xa8> <== NEVER TAKEN *location = OBJECTS_ERROR; goto done; } information = api_information[ the_class ]; 800515c: 28 21 00 04 lw r1,(r1+4) if ( !information ) { 8005160: 5c 20 00 03 bne r1,r0,800516c <_Thread_Get+0xb0> *location = OBJECTS_ERROR; 8005164: 59 6c 00 00 sw (r11+0),r12 goto done; 8005168: e0 00 00 04 bi 8005178 <_Thread_Get+0xbc> } tp = (Thread_Control *) _Objects_Get( information, id, location ); 800516c: b9 a0 10 00 mv r2,r13 8005170: b9 60 18 00 mv r3,r11 8005174: fb ff fd 65 calli 8004708 <_Objects_Get> done: return tp; } 8005178: 2b 9d 00 04 lw ra,(sp+4) 800517c: 2b 8b 00 18 lw r11,(sp+24) 8005180: 2b 8c 00 14 lw r12,(sp+20) 8005184: 2b 8d 00 10 lw r13,(sp+16) 8005188: 2b 8e 00 0c lw r14,(sp+12) 800518c: 2b 8f 00 08 lw r15,(sp+8) 8005190: 37 9c 00 18 addi sp,sp,24 8005194: c3 a0 00 00 ret */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 8005198: 34 02 00 1b mvi r2,27 800519c: b9 a0 08 00 mv r1,r13 80051a0: f8 00 2d fd calli 8010994 <__lshrsi3> *location = OBJECTS_ERROR; goto done; } the_class = _Objects_Get_class( id ); if ( the_class != 1 ) { /* threads are always first class :) */ 80051a4: 34 02 00 01 mvi r2,1 80051a8: b8 20 60 00 mv r12,r1 80051ac: 44 22 ff e4 be r1,r2,800513c <_Thread_Get+0x80> 80051b0: e3 ff ff e0 bi 8005130 <_Thread_Get+0x74> =============================================================================== 0800b25c <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 800b25c: 37 9c ff f4 addi sp,sp,-12 800b260: 5b 8b 00 0c sw (sp+12),r11 800b264: 5b 8c 00 08 sw (sp+8),r12 800b268: 5b 9d 00 04 sw (sp+4),ra #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 800b26c: 78 01 08 01 mvhi r1,0x801 800b270: 38 21 39 e8 ori r1,r1,0x39e8 800b274: 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; 800b278: 29 61 00 b8 lw r1,(r11+184) _ISR_Set_level(level); 800b27c: 64 21 00 00 cmpei r1,r1,0 800b280: d0 01 00 00 wcsr IE,r1 #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 800b284: 78 01 08 01 mvhi r1,0x801 800b288: 38 21 36 30 ori r1,r1,0x3630 800b28c: 40 2c 00 00 lbu r12,(r1+0) doneConstructors = 1; 800b290: 34 02 00 01 mvi r2,1 800b294: 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 ); 800b298: b9 60 08 00 mv r1,r11 800b29c: fb ff eb f8 calli 800627c <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 800b2a0: fb ff e7 7a calli 8005088 <_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) */ { 800b2a4: 5d 80 00 02 bne r12,r0,800b2ac <_Thread_Handler+0x50> INIT_NAME (); 800b2a8: fb ff d3 56 calli 8000000 } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 800b2ac: 29 61 00 a0 lw r1,(r11+160) 800b2b0: 5c 20 00 05 bne r1,r0,800b2c4 <_Thread_Handler+0x68> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 800b2b4: 29 62 00 9c lw r2,(r11+156) 800b2b8: 29 61 00 a8 lw r1,(r11+168) 800b2bc: d8 40 00 00 call r2 INIT_NAME (); } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 800b2c0: 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 ); 800b2c4: b9 60 08 00 mv r1,r11 800b2c8: fb ff ec 05 calli 80062dc <_User_extensions_Thread_exitted> _Internal_error_Occurred( 800b2cc: 34 01 00 00 mvi r1,0 800b2d0: 34 02 00 01 mvi r2,1 800b2d4: 34 03 00 05 mvi r3,5 800b2d8: fb ff e3 54 calli 8004028 <_Internal_error_Occurred> =============================================================================== 080051b4 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 80051b4: 37 9c ff e4 addi sp,sp,-28 80051b8: 5b 8b 00 1c sw (sp+28),r11 80051bc: 5b 8c 00 18 sw (sp+24),r12 80051c0: 5b 8d 00 14 sw (sp+20),r13 80051c4: 5b 8e 00 10 sw (sp+16),r14 80051c8: 5b 8f 00 0c sw (sp+12),r15 80051cc: 5b 90 00 08 sw (sp+8),r16 80051d0: 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; 80051d4: 58 40 01 24 sw (r2+292),r0 80051d8: 58 40 01 28 sw (r2+296),r0 extensions_area = NULL; the_thread->libc_reent = NULL; 80051dc: 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 ) { 80051e0: b8 20 70 00 mv r14,r1 80051e4: 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 ); 80051e8: b8 40 08 00 mv r1,r2 80051ec: 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 ) { 80051f0: b8 80 60 00 mv r12,r4 80051f4: b8 c0 68 00 mv r13,r6 80051f8: b9 00 78 00 mv r15,r8 80051fc: 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 ); 8005200: f8 00 03 1f calli 8005e7c <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) 8005204: f5 81 60 00 cmpgu r12,r12,r1 8005208: 64 22 00 00 cmpei r2,r1,0 return false; /* stack allocation failed */ 800520c: 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 ) 8005210: b9 82 60 00 or r12,r12,r2 8005214: 5d 80 00 4a bne r12,r0,800533c <_Thread_Initialize+0x188> Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 8005218: 29 62 00 c8 lw r2,(r11+200) the_stack->size = size; 800521c: 59 61 00 c0 sw (r11+192),r1 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8005220: 59 60 00 50 sw (r11+80),r0 Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 8005224: 59 62 00 c4 sw (r11+196),r2 #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 8005228: 78 02 08 01 mvhi r2,0x801 800522c: 38 42 38 ac ori r2,r2,0x38ac 8005230: 28 42 00 00 lw r2,(r2+0) the_watchdog->routine = routine; 8005234: 59 60 00 64 sw (r11+100),r0 the_watchdog->id = id; 8005238: 59 60 00 68 sw (r11+104),r0 the_watchdog->user_data = user_data; 800523c: 59 60 00 6c sw (r11+108),r0 8005240: 44 4c 00 07 be r2,r12,800525c <_Thread_Initialize+0xa8> extensions_area = _Workspace_Allocate( (_Thread_Maximum_extensions + 1) * sizeof( void * ) 8005244: 34 41 00 01 addi r1,r2,1 8005248: 34 02 00 02 mvi r2,2 800524c: f8 00 2d 84 calli 801085c <__ashlsi3> /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( 8005250: f8 00 05 a5 calli 80068e4 <_Workspace_Allocate> 8005254: b8 20 60 00 mv r12,r1 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 8005258: 44 20 00 2a be r1,r0,8005300 <_Thread_Initialize+0x14c> goto failed; } the_thread->extensions = (void **) extensions_area; 800525c: 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 ) { 8005260: 45 80 00 0b be r12,r0,800528c <_Thread_Initialize+0xd8> for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 8005264: 78 02 08 01 mvhi r2,0x801 8005268: 38 42 38 ac ori r2,r2,0x38ac 800526c: 28 41 00 00 lw r1,(r2+0) 8005270: b9 80 18 00 mv r3,r12 8005274: 34 02 00 00 mvi r2,0 8005278: e0 00 00 04 bi 8005288 <_Thread_Initialize+0xd4> the_thread->extensions[i] = NULL; 800527c: 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++ ) 8005280: 34 42 00 01 addi r2,r2,1 8005284: 34 63 00 04 addi r3,r3,4 8005288: 50 22 ff fd bgeu r1,r2,800527c <_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; 800528c: 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 ); 8005290: 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; 8005294: 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; 8005298: 59 61 00 b4 sw (r11+180),r1 case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 800529c: 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; 80052a0: 59 6d 00 bc sw (r11+188),r13 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 80052a4: 31 70 00 ac sb (r11+172),r16 case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 80052a8: 59 61 00 b8 sw (r11+184),r1 the_thread->current_state = STATES_DORMANT; 80052ac: 34 01 00 01 mvi r1,1 80052b0: 59 61 00 10 sw (r11+16),r1 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; 80052b4: 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 ); 80052b8: 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; 80052bc: 59 60 00 44 sw (r11+68),r0 the_thread->resource_count = 0; 80052c0: 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 ); 80052c4: f8 00 02 20 calli 8005b44 <_Thread_Set_priority> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 80052c8: 2d 61 00 0a lhu r1,(r11+10) _Thread_Stack_Free( the_thread ); return false; } 80052cc: 29 cd 00 1c lw r13,(r14+28) 80052d0: 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 ); 80052d4: 59 60 00 84 sw (r11+132),r0 80052d8: 59 60 00 88 sw (r11+136),r0 80052dc: f8 00 2d 60 calli 801085c <__ashlsi3> 80052e0: b5 a1 08 00 add r1,r13,r1 80052e4: 58 2b 00 00 sw (r1+0),r11 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 80052e8: 2b 81 00 28 lw r1,(sp+40) 80052ec: 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 ); 80052f0: b9 60 08 00 mv r1,r11 80052f4: f8 00 04 30 calli 80063b4 <_User_extensions_Thread_create> if ( extension_status ) return true; 80052f8: 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 ) 80052fc: 5c 20 00 10 bne r1,r0,800533c <_Thread_Initialize+0x188> return true; failed: if ( the_thread->libc_reent ) 8005300: 29 61 01 20 lw r1,(r11+288) 8005304: 44 20 00 02 be r1,r0,800530c <_Thread_Initialize+0x158> _Workspace_Free( the_thread->libc_reent ); 8005308: f8 00 05 82 calli 8006910 <_Workspace_Free> for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 800530c: 29 61 01 24 lw r1,(r11+292) 8005310: 44 20 00 02 be r1,r0,8005318 <_Thread_Initialize+0x164> _Workspace_Free( the_thread->API_Extensions[i] ); 8005314: f8 00 05 7f calli 8006910 <_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] ) 8005318: 29 61 01 28 lw r1,(r11+296) 800531c: 44 20 00 02 be r1,r0,8005324 <_Thread_Initialize+0x170> <== ALWAYS TAKEN _Workspace_Free( the_thread->API_Extensions[i] ); 8005320: f8 00 05 7c calli 8006910 <_Workspace_Free> <== NOT EXECUTED if ( extensions_area ) 8005324: 45 80 00 03 be r12,r0,8005330 <_Thread_Initialize+0x17c> (void) _Workspace_Free( extensions_area ); 8005328: b9 80 08 00 mv r1,r12 800532c: f8 00 05 79 calli 8006910 <_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 ); 8005330: b9 60 08 00 mv r1,r11 8005334: f8 00 02 ef calli 8005ef0 <_Thread_Stack_Free> return false; 8005338: 34 03 00 00 mvi r3,0 } 800533c: b8 60 08 00 mv r1,r3 8005340: 2b 9d 00 04 lw ra,(sp+4) 8005344: 2b 8b 00 1c lw r11,(sp+28) 8005348: 2b 8c 00 18 lw r12,(sp+24) 800534c: 2b 8d 00 14 lw r13,(sp+20) 8005350: 2b 8e 00 10 lw r14,(sp+16) 8005354: 2b 8f 00 0c lw r15,(sp+12) 8005358: 2b 90 00 08 lw r16,(sp+8) 800535c: 37 9c 00 1c addi sp,sp,28 8005360: c3 a0 00 00 ret =============================================================================== 08009fac <_Thread_Resume>: { ISR_Level level; States_Control current_state; _ISR_Disable( level ); 8009fac: 90 00 18 00 rcsr r3,IE 8009fb0: 34 04 ff fe mvi r4,-2 8009fb4: a0 64 20 00 and r4,r3,r4 8009fb8: d0 04 00 00 wcsr IE,r4 current_state = the_thread->current_state; 8009fbc: 28 22 00 10 lw r2,(r1+16) if ( current_state & STATES_SUSPENDED ) { 8009fc0: 20 45 00 02 andi r5,r2,0x2 8009fc4: 44 a0 00 29 be r5,r0,800a068 <_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); 8009fc8: 34 05 ff fd mvi r5,-3 8009fcc: a0 45 10 00 and r2,r2,r5 current_state = the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); 8009fd0: 58 22 00 10 sw (r1+16),r2 if ( _States_Is_ready( current_state ) ) { 8009fd4: 5c 40 00 25 bne r2,r0,800a068 <_Thread_Resume+0xbc> <== NEVER TAKEN RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 8009fd8: 28 22 00 90 lw r2,(r1+144) 8009fdc: 2c 25 00 96 lhu r5,(r1+150) 8009fe0: 2c 46 00 00 lhu r6,(r2+0) 8009fe4: b8 c5 28 00 or r5,r6,r5 8009fe8: 0c 45 00 00 sh (r2+0),r5 _Priority_Major_bit_map |= the_priority_map->ready_major; 8009fec: 78 02 08 01 mvhi r2,0x801 8009ff0: 38 42 89 8c ori r2,r2,0x898c 8009ff4: 2c 45 00 00 lhu r5,(r2+0) 8009ff8: 2c 26 00 94 lhu r6,(r1+148) 8009ffc: b8 c5 28 00 or r5,r6,r5 800a000: 20 a5 ff ff andi r5,r5,0xffff 800a004: 0c 45 00 00 sh (r2+0),r5 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 800a008: 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; 800a00c: 34 45 00 04 addi r5,r2,4 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 800a010: 58 25 00 00 sw (r1+0),r5 old_last_node = the_chain->last; 800a014: 28 45 00 08 lw r5,(r2+8) the_chain->last = the_node; 800a018: 58 41 00 08 sw (r2+8),r1 old_last_node->next = the_node; 800a01c: 58 a1 00 00 sw (r5+0),r1 the_node->previous = old_last_node; 800a020: 58 25 00 04 sw (r1+4),r5 _ISR_Flash( level ); 800a024: d0 03 00 00 wcsr IE,r3 800a028: d0 04 00 00 wcsr IE,r4 if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 800a02c: 78 02 08 01 mvhi r2,0x801 800a030: 38 42 8a b8 ori r2,r2,0x8ab8 800a034: 28 45 00 10 lw r5,(r2+16) 800a038: 28 24 00 14 lw r4,(r1+20) 800a03c: 28 a5 00 14 lw r5,(r5+20) 800a040: 50 85 00 0a bgeu r4,r5,800a068 <_Thread_Resume+0xbc> _Thread_Heir = the_thread; 800a044: 58 41 00 10 sw (r2+16),r1 if ( _Thread_Executing->is_preemptible || 800a048: 28 41 00 0c lw r1,(r2+12) 800a04c: 40 21 00 74 lbu r1,(r1+116) 800a050: 5c 20 00 02 bne r1,r0,800a058 <_Thread_Resume+0xac> 800a054: 5c 81 00 05 bne r4,r1,800a068 <_Thread_Resume+0xbc> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 800a058: 78 01 08 01 mvhi r1,0x801 800a05c: 38 21 8a b8 ori r1,r1,0x8ab8 800a060: 34 02 00 01 mvi r2,1 800a064: 30 22 00 18 sb (r1+24),r2 } } } _ISR_Enable( level ); 800a068: d0 03 00 00 wcsr IE,r3 } 800a06c: c3 a0 00 00 ret =============================================================================== 08006030 <_Thread_Yield_processor>: { ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 8006030: 78 01 08 01 mvhi r1,0x801 8006034: 38 21 39 e8 ori r1,r1,0x39e8 8006038: 28 21 00 0c lw r1,(r1+12) ready = executing->ready; 800603c: 28 23 00 8c lw r3,(r1+140) _ISR_Disable( level ); 8006040: 90 00 20 00 rcsr r4,IE 8006044: 34 06 ff fe mvi r6,-2 8006048: a0 86 30 00 and r6,r4,r6 800604c: 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); 8006050: 28 65 00 08 lw r5,(r3+8) if ( !_Chain_Has_only_one_node( ready ) ) { 8006054: 28 67 00 00 lw r7,(r3+0) 8006058: 78 02 08 01 mvhi r2,0x801 800605c: 38 42 39 e8 ori r2,r2,0x39e8 8006060: 44 e5 00 15 be r7,r5,80060b4 <_Thread_Yield_processor+0x84> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 8006064: 28 28 00 00 lw r8,(r1+0) previous = the_node->previous; 8006068: 28 27 00 04 lw r7,(r1+4) next->previous = previous; previous->next = next; 800606c: 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; 8006070: 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; 8006074: 34 67 00 04 addi r7,r3,4 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 8006078: 58 27 00 00 sw (r1+0),r7 old_last_node = the_chain->last; the_chain->last = the_node; 800607c: 58 61 00 08 sw (r3+8),r1 old_last_node->next = the_node; 8006080: 58 a1 00 00 sw (r5+0),r1 the_node->previous = old_last_node; 8006084: 58 25 00 04 sw (r1+4),r5 _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 8006088: d0 04 00 00 wcsr IE,r4 800608c: d0 06 00 00 wcsr IE,r6 if ( _Thread_Is_heir( executing ) ) 8006090: 28 45 00 10 lw r5,(r2+16) 8006094: 5c 25 00 03 bne r1,r5,80060a0 <_Thread_Yield_processor+0x70><== NEVER TAKEN _Thread_Heir = (Thread_Control *) ready->first; 8006098: 28 61 00 00 lw r1,(r3+0) 800609c: 58 41 00 10 sw (r2+16),r1 _Context_Switch_necessary = true; 80060a0: 78 01 08 01 mvhi r1,0x801 80060a4: 38 21 39 e8 ori r1,r1,0x39e8 80060a8: 34 02 00 01 mvi r2,1 80060ac: 30 22 00 18 sb (r1+24),r2 80060b0: e0 00 00 05 bi 80060c4 <_Thread_Yield_processor+0x94> } else if ( !_Thread_Is_heir( executing ) ) 80060b4: 28 43 00 10 lw r3,(r2+16) 80060b8: 44 23 00 03 be r1,r3,80060c4 <_Thread_Yield_processor+0x94><== ALWAYS TAKEN _Context_Switch_necessary = true; 80060bc: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 80060c0: 30 41 00 18 sb (r2+24),r1 <== NOT EXECUTED _ISR_Enable( level ); 80060c4: d0 04 00 00 wcsr IE,r4 } 80060c8: c3 a0 00 00 ret =============================================================================== 08009560 <_Thread_queue_Enqueue_fifo>: ) { Thread_blocking_operation_States sync_state; ISR_Level level; _ISR_Disable( level ); 8009560: 90 00 20 00 rcsr r4,IE 8009564: 34 05 ff fe mvi r5,-2 8009568: a0 85 28 00 and r5,r4,r5 800956c: d0 05 00 00 wcsr IE,r5 sync_state = the_thread_queue->sync_state; 8009570: 28 25 00 30 lw r5,(r1+48) the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) { 8009574: 34 06 00 01 mvi r6,1 ISR_Level level; _ISR_Disable( level ); sync_state = the_thread_queue->sync_state; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8009578: 58 20 00 30 sw (r1+48),r0 if (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) { 800957c: 5c a6 00 0a bne r5,r6,80095a4 <_Thread_queue_Enqueue_fifo+0x44><== NEVER TAKEN */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8009580: 34 23 00 04 addi r3,r1,4 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 8009584: 58 43 00 00 sw (r2+0),r3 old_last_node = the_chain->last; 8009588: 28 23 00 08 lw r3,(r1+8) the_chain->last = the_node; 800958c: 58 22 00 08 sw (r1+8),r2 old_last_node->next = the_node; 8009590: 58 62 00 00 sw (r3+0),r2 the_node->previous = old_last_node; 8009594: 58 43 00 04 sw (r2+4),r3 _Chain_Append_unprotected( &the_thread_queue->Queues.Fifo, &the_thread->Object.Node ); the_thread->Wait.queue = the_thread_queue; 8009598: 58 41 00 44 sw (r2+68),r1 the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; _ISR_Enable( level ); 800959c: d0 04 00 00 wcsr IE,r4 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 80095a0: e0 00 00 02 bi 80095a8 <_Thread_queue_Enqueue_fifo+0x48> * 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; 80095a4: 58 64 00 00 sw (r3+0),r4 <== NOT EXECUTED return sync_state; } 80095a8: b8 a0 08 00 mv r1,r5 80095ac: c3 a0 00 00 ret =============================================================================== 080056f4 <_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 ) { 80056f4: 37 9c ff c8 addi sp,sp,-56 80056f8: 5b 8b 00 38 sw (sp+56),r11 80056fc: 5b 8c 00 34 sw (sp+52),r12 8005700: 5b 8d 00 30 sw (sp+48),r13 8005704: 5b 8e 00 2c sw (sp+44),r14 8005708: 5b 8f 00 28 sw (sp+40),r15 800570c: 5b 90 00 24 sw (sp+36),r16 8005710: 5b 91 00 20 sw (sp+32),r17 8005714: 5b 92 00 1c sw (sp+28),r18 8005718: 5b 93 00 18 sw (sp+24),r19 800571c: 5b 94 00 14 sw (sp+20),r20 8005720: 5b 95 00 10 sw (sp+16),r21 8005724: 5b 96 00 0c sw (sp+12),r22 8005728: 5b 97 00 08 sw (sp+8),r23 800572c: 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; 8005730: 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 ) { 8005734: b8 20 68 00 mv r13,r1 8005738: 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); 800573c: 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 ); 8005740: 34 41 00 38 addi r1,r2,56 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 8005744: 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; 8005748: 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 ) { 800574c: 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); 8005750: ba 00 08 00 mv r1,r16 8005754: 34 02 00 06 mvi r2,6 8005758: b8 60 a8 00 mv r21,r3 800575c: f8 00 2c 8e calli 8010994 <__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 ]; 8005760: 34 02 00 01 mvi r2,1 8005764: b8 20 70 00 mv r14,r1 8005768: f8 00 2c 3d calli 801085c <__ashlsi3> 800576c: 34 02 00 02 mvi r2,2 8005770: b4 2e 08 00 add r1,r1,r14 8005774: f8 00 2c 3a calli 801085c <__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; 8005778: 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 ); 800577c: 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 ]; 8005780: b5 a1 b8 00 add r23,r13,r1 block_state = the_thread_queue->state; 8005784: 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; 8005788: 3a 52 30 c0 ori r18,r18,0x30c0 _ISR_Disable( level ); 800578c: 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 ) ) 8005790: 5c 40 00 30 bne r2,r0,8005850 <_Thread_queue_Enqueue_priority+0x15c> goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 8005794: 34 14 ff fe mvi r20,-2 8005798: 90 00 78 00 rcsr r15,IE 800579c: a1 f4 90 00 and r18,r15,r20 80057a0: d0 12 00 00 wcsr IE,r18 search_thread = (Thread_Control *) header->first; 80057a4: 34 02 00 01 mvi r2,1 80057a8: b9 c0 08 00 mv r1,r14 80057ac: f8 00 2c 2c calli 801085c <__ashlsi3> 80057b0: b4 2e 08 00 add r1,r1,r14 80057b4: 34 02 00 02 mvi r2,2 80057b8: f8 00 2c 29 calli 801085c <__ashlsi3> 80057bc: b5 a1 08 00 add r1,r13,r1 80057c0: 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; 80057c4: 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 ) ) { 80057c8: e0 00 00 0b bi 80057f4 <_Thread_queue_Enqueue_priority+0x100> search_priority = search_thread->current_priority; 80057cc: 29 91 00 14 lw r17,(r12+20) if ( priority <= search_priority ) 80057d0: 52 30 00 12 bgeu r17,r16,8005818 <_Thread_queue_Enqueue_priority+0x124> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 80057d4: d0 0f 00 00 wcsr IE,r15 80057d8: 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); 80057dc: 29 81 00 10 lw r1,(r12+16) 80057e0: a2 61 08 00 and r1,r19,r1 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 80057e4: 5c 20 00 03 bne r1,r0,80057f0 <_Thread_queue_Enqueue_priority+0xfc><== ALWAYS TAKEN _ISR_Enable( level ); 80057e8: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED goto restart_forward_search; 80057ec: e3 ff ff eb bi 8005798 <_Thread_queue_Enqueue_priority+0xa4><== NOT EXECUTED } search_thread = (Thread_Control *)search_thread->Object.Node.next; 80057f0: 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; 80057f4: 34 02 00 01 mvi r2,1 80057f8: b9 c0 08 00 mv r1,r14 80057fc: f8 00 2c 18 calli 801085c <__ashlsi3> 8005800: b4 2e 08 00 add r1,r1,r14 8005804: 34 02 00 02 mvi r2,2 8005808: f8 00 2c 15 calli 801085c <__ashlsi3> 800580c: b5 a1 08 00 add r1,r13,r1 8005810: 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 ) ) { 8005814: 5d 81 ff ee bne r12,r1,80057cc <_Thread_queue_Enqueue_priority+0xd8> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 8005818: 29 a3 00 30 lw r3,(r13+48) 800581c: 34 02 00 01 mvi r2,1 8005820: b9 e0 08 00 mv r1,r15 8005824: 5c 62 00 3c bne r3,r2,8005914 <_Thread_queue_Enqueue_priority+0x220><== NEVER TAKEN THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8005828: 59 a0 00 30 sw (r13+48),r0 if ( priority == search_priority ) 800582c: 46 11 00 31 be r16,r17,80058f0 <_Thread_queue_Enqueue_priority+0x1fc> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 8005830: 29 81 00 04 lw r1,(r12+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8005834: 59 6c 00 00 sw (r11+0),r12 the_node->previous = previous_node; 8005838: 59 61 00 04 sw (r11+4),r1 previous_node->next = the_node; 800583c: 58 2b 00 00 sw (r1+0),r11 search_node->previous = the_node; 8005840: 59 8b 00 04 sw (r12+4),r11 the_thread->Wait.queue = the_thread_queue; 8005844: 59 6d 00 44 sw (r11+68),r13 _ISR_Enable( level ); 8005848: d0 0f 00 00 wcsr IE,r15 800584c: e0 00 00 27 bi 80058e8 <_Thread_queue_Enqueue_priority+0x1f4> return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 8005850: 42 51 00 00 lbu r17,(r18+0) 8005854: 36 31 00 01 addi r17,r17,1 _ISR_Disable( level ); 8005858: 90 00 78 00 rcsr r15,IE 800585c: a1 f6 a0 00 and r20,r15,r22 8005860: d0 14 00 00 wcsr IE,r20 search_thread = (Thread_Control *) header->last; 8005864: 34 02 00 01 mvi r2,1 8005868: b9 c0 08 00 mv r1,r14 800586c: f8 00 2b fc calli 801085c <__ashlsi3> 8005870: b4 2e 08 00 add r1,r1,r14 8005874: 34 02 00 02 mvi r2,2 8005878: f8 00 2b f9 calli 801085c <__ashlsi3> 800587c: b5 a1 08 00 add r1,r13,r1 8005880: 28 2c 00 08 lw r12,(r1+8) while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8005884: e0 00 00 0b bi 80058b0 <_Thread_queue_Enqueue_priority+0x1bc> search_priority = search_thread->current_priority; 8005888: 29 91 00 14 lw r17,(r12+20) if ( priority >= search_priority ) 800588c: 52 11 00 0a bgeu r16,r17,80058b4 <_Thread_queue_Enqueue_priority+0x1c0> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 8005890: d0 0f 00 00 wcsr IE,r15 8005894: d0 14 00 00 wcsr IE,r20 8005898: 29 81 00 10 lw r1,(r12+16) 800589c: a2 61 08 00 and r1,r19,r1 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 80058a0: 5c 20 00 03 bne r1,r0,80058ac <_Thread_queue_Enqueue_priority+0x1b8><== ALWAYS TAKEN _ISR_Enable( level ); 80058a4: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED goto restart_reverse_search; 80058a8: e3 ff ff ea bi 8005850 <_Thread_queue_Enqueue_priority+0x15c><== NOT EXECUTED } search_thread = (Thread_Control *) search_thread->Object.Node.previous; 80058ac: 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 ) ) { 80058b0: 5d 97 ff f6 bne r12,r23,8005888 <_Thread_queue_Enqueue_priority+0x194> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 80058b4: 29 a3 00 30 lw r3,(r13+48) 80058b8: 34 02 00 01 mvi r2,1 80058bc: b9 e0 08 00 mv r1,r15 80058c0: 5c 62 00 15 bne r3,r2,8005914 <_Thread_queue_Enqueue_priority+0x220><== NEVER TAKEN THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 80058c4: 59 a0 00 30 sw (r13+48),r0 if ( priority == search_priority ) 80058c8: 46 11 00 0a be r16,r17,80058f0 <_Thread_queue_Enqueue_priority+0x1fc> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 80058cc: 29 81 00 00 lw r1,(r12+0) the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 80058d0: 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; 80058d4: 59 61 00 00 sw (r11+0),r1 the_node->previous = search_node; search_node->next = the_node; 80058d8: 59 8b 00 00 sw (r12+0),r11 next_node->previous = the_node; 80058dc: 58 2b 00 04 sw (r1+4),r11 the_thread->Wait.queue = the_thread_queue; 80058e0: 59 6d 00 44 sw (r11+68),r13 _ISR_Enable( level ); 80058e4: d0 0f 00 00 wcsr IE,r15 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 80058e8: 34 01 00 01 mvi r1,1 80058ec: e0 00 00 0c bi 800591c <_Thread_queue_Enqueue_priority+0x228> 80058f0: 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; 80058f4: 29 81 00 04 lw r1,(r12+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 80058f8: 59 6c 00 00 sw (r11+0),r12 the_node->previous = previous_node; 80058fc: 59 61 00 04 sw (r11+4),r1 previous_node->next = the_node; 8005900: 58 2b 00 00 sw (r1+0),r11 search_node->previous = the_node; 8005904: 59 8b 00 04 sw (r12+4),r11 the_thread->Wait.queue = the_thread_queue; 8005908: 59 6d 00 44 sw (r11+68),r13 _ISR_Enable( level ); 800590c: d0 0f 00 00 wcsr IE,r15 8005910: e3 ff ff f6 bi 80058e8 <_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; 8005914: 5a a1 00 00 sw (r21+0),r1 <== NOT EXECUTED return the_thread_queue->sync_state; 8005918: 29 a1 00 30 lw r1,(r13+48) <== NOT EXECUTED } 800591c: 2b 9d 00 04 lw ra,(sp+4) 8005920: 2b 8b 00 38 lw r11,(sp+56) 8005924: 2b 8c 00 34 lw r12,(sp+52) 8005928: 2b 8d 00 30 lw r13,(sp+48) 800592c: 2b 8e 00 2c lw r14,(sp+44) 8005930: 2b 8f 00 28 lw r15,(sp+40) 8005934: 2b 90 00 24 lw r16,(sp+36) 8005938: 2b 91 00 20 lw r17,(sp+32) 800593c: 2b 92 00 1c lw r18,(sp+28) 8005940: 2b 93 00 18 lw r19,(sp+24) 8005944: 2b 94 00 14 lw r20,(sp+20) 8005948: 2b 95 00 10 lw r21,(sp+16) 800594c: 2b 96 00 0c lw r22,(sp+12) 8005950: 2b 97 00 08 lw r23,(sp+8) 8005954: 37 9c 00 38 addi sp,sp,56 8005958: c3 a0 00 00 ret =============================================================================== 08005630 <_Thread_queue_Enqueue_with_handler>: void _Thread_queue_Enqueue_with_handler( Thread_queue_Control *the_thread_queue, Watchdog_Interval timeout, Thread_queue_Timeout_callout handler ) { 8005630: 37 9c ff e8 addi sp,sp,-24 8005634: 5b 8b 00 14 sw (sp+20),r11 8005638: 5b 8c 00 10 sw (sp+16),r12 800563c: 5b 8d 00 0c sw (sp+12),r13 8005640: 5b 8e 00 08 sw (sp+8),r14 8005644: 5b 9d 00 04 sw (sp+4),ra 8005648: b8 20 60 00 mv r12,r1 Thread_queue_Control *, Thread_Control *, ISR_Level * ); the_thread = _Thread_Executing; 800564c: 78 01 08 01 mvhi r1,0x801 8005650: 38 21 39 e8 ori r1,r1,0x39e8 8005654: 28 2b 00 0c lw r11,(r1+12) void _Thread_queue_Enqueue_with_handler( Thread_queue_Control *the_thread_queue, Watchdog_Interval timeout, Thread_queue_Timeout_callout handler ) { 8005658: b8 40 68 00 mv r13,r2 else #endif /* * Set the blocking state for this thread queue in the thread. */ _Thread_Set_state( the_thread, the_thread_queue->state ); 800565c: 29 82 00 38 lw r2,(r12+56) 8005660: b9 60 08 00 mv r1,r11 void _Thread_queue_Enqueue_with_handler( Thread_queue_Control *the_thread_queue, Watchdog_Interval timeout, Thread_queue_Timeout_callout handler ) { 8005664: b8 60 70 00 mv r14,r3 else #endif /* * Set the blocking state for this thread queue in the thread. */ _Thread_Set_state( the_thread, the_thread_queue->state ); 8005668: f8 00 01 69 calli 8005c0c <_Thread_Set_state> /* * If the thread wants to timeout, then schedule its timer. */ if ( timeout ) { 800566c: 45 a0 00 0b be r13,r0,8005698 <_Thread_queue_Enqueue_with_handler+0x68> _Watchdog_Initialize( 8005670: 29 61 00 08 lw r1,(r11+8) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8005674: 59 60 00 50 sw (r11+80),r0 the_watchdog->routine = routine; 8005678: 59 6e 00 64 sw (r11+100),r14 the_watchdog->id = id; 800567c: 59 61 00 68 sw (r11+104),r1 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8005680: 78 01 08 01 mvhi r1,0x801 ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 8005684: 59 60 00 6c sw (r11+108),r0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8005688: 59 6d 00 54 sw (r11+84),r13 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800568c: 38 21 38 e0 ori r1,r1,0x38e0 8005690: 35 62 00 48 addi r2,r11,72 8005694: f8 00 03 bd calli 8006588 <_Watchdog_Insert> } /* * Now enqueue the thread per the discipline for this thread queue. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 8005698: 29 82 00 34 lw r2,(r12+52) enqueue_p = _Thread_queue_Enqueue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ enqueue_p = _Thread_queue_Enqueue_fifo; 800569c: 78 04 08 00 mvhi r4,0x800 } /* * Now enqueue the thread per the discipline for this thread queue. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 80056a0: 34 01 00 01 mvi r1,1 enqueue_p = _Thread_queue_Enqueue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ enqueue_p = _Thread_queue_Enqueue_fifo; 80056a4: 38 84 95 60 ori r4,r4,0x9560 } /* * Now enqueue the thread per the discipline for this thread queue. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 80056a8: 5c 41 00 03 bne r2,r1,80056b4 <_Thread_queue_Enqueue_with_handler+0x84> enqueue_p = _Thread_queue_Enqueue_priority; 80056ac: 78 04 08 00 mvhi r4,0x800 80056b0: 38 84 56 f4 ori r4,r4,0x56f4 else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ enqueue_p = _Thread_queue_Enqueue_fifo; sync_state = (*enqueue_p)( the_thread_queue, the_thread, &level ); 80056b4: b9 60 10 00 mv r2,r11 80056b8: b9 80 08 00 mv r1,r12 80056bc: 37 83 00 18 addi r3,sp,24 80056c0: d8 80 00 00 call r4 if ( sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 80056c4: 34 02 00 01 mvi r2,1 80056c8: 44 22 00 04 be r1,r2,80056d8 <_Thread_queue_Enqueue_with_handler+0xa8><== ALWAYS TAKEN _Thread_blocking_operation_Cancel( sync_state, the_thread, level ); 80056cc: 2b 83 00 18 lw r3,(sp+24) <== NOT EXECUTED 80056d0: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 80056d4: f8 00 0f 1f calli 8009350 <_Thread_blocking_operation_Cancel><== NOT EXECUTED } 80056d8: 2b 9d 00 04 lw ra,(sp+4) 80056dc: 2b 8b 00 14 lw r11,(sp+20) 80056e0: 2b 8c 00 10 lw r12,(sp+16) 80056e4: 2b 8d 00 0c lw r13,(sp+12) 80056e8: 2b 8e 00 08 lw r14,(sp+8) 80056ec: 37 9c 00 18 addi sp,sp,24 80056f0: c3 a0 00 00 ret =============================================================================== 080095e0 <_Thread_queue_Extract_priority_helper>: void _Thread_queue_Extract_priority_helper( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread, bool requeuing ) { 80095e0: 37 9c ff f8 addi sp,sp,-8 80095e4: 5b 8b 00 08 sw (sp+8),r11 80095e8: 5b 9d 00 04 sw (sp+4),ra 80095ec: b8 40 58 00 mv r11,r2 80095f0: 20 63 00 ff andi r3,r3,0xff Chain_Node *new_first_node; Chain_Node *new_second_node; Chain_Node *last_node; the_node = (Chain_Node *) the_thread; _ISR_Disable( level ); 80095f4: 90 00 10 00 rcsr r2,IE 80095f8: 34 01 ff fe mvi r1,-2 80095fc: a0 41 08 00 and r1,r2,r1 8009600: d0 01 00 00 wcsr IE,r1 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 8009604: 78 05 08 01 mvhi r5,0x801 8009608: 38 a5 1d d0 ori r5,r5,0x1dd0 800960c: 29 64 00 10 lw r4,(r11+16) 8009610: 28 a1 00 00 lw r1,(r5+0) 8009614: a0 81 08 00 and r1,r4,r1 if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 8009618: 5c 20 00 03 bne r1,r0,8009624 <_Thread_queue_Extract_priority_helper+0x44> _ISR_Enable( level ); 800961c: d0 02 00 00 wcsr IE,r2 return; 8009620: e0 00 00 28 bi 80096c0 <_Thread_queue_Extract_priority_helper+0xe0> */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8009624: 29 61 00 38 lw r1,(r11+56) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8009628: 35 66 00 3c addi r6,r11,60 /* * The thread was actually waiting on a thread queue so let's remove it. */ next_node = the_node->next; 800962c: 29 64 00 00 lw r4,(r11+0) previous_node = the_node->previous; 8009630: 29 65 00 04 lw r5,(r11+4) if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { 8009634: 44 26 00 0f be r1,r6,8009670 <_Thread_queue_Extract_priority_helper+0x90> new_first_node = the_thread->Wait.Block2n.first; new_first_thread = (Thread_Control *) new_first_node; last_node = the_thread->Wait.Block2n.last; 8009638: 29 66 00 40 lw r6,(r11+64) new_second_node = new_first_node->next; 800963c: 28 27 00 00 lw r7,(r1+0) previous_node->next = new_first_node; next_node->previous = new_first_node; 8009640: 58 81 00 04 sw (r4+4),r1 new_first_node = the_thread->Wait.Block2n.first; new_first_thread = (Thread_Control *) new_first_node; last_node = the_thread->Wait.Block2n.last; new_second_node = new_first_node->next; previous_node->next = new_first_node; 8009644: 58 a1 00 00 sw (r5+0),r1 next_node->previous = new_first_node; new_first_node->next = next_node; 8009648: 58 24 00 00 sw (r1+0),r4 new_first_node->previous = previous_node; 800964c: 58 25 00 04 sw (r1+4),r5 if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 8009650: 44 26 00 0a be r1,r6,8009678 <_Thread_queue_Extract_priority_helper+0x98> /* > two threads on 2-n */ new_second_node->previous = _Chain_Head( &new_first_thread->Wait.Block2n ); 8009654: 34 24 00 38 addi r4,r1,56 new_first_node->next = next_node; new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { /* > two threads on 2-n */ new_second_node->previous = 8009658: 58 e4 00 04 sw (r7+4),r4 _Chain_Head( &new_first_thread->Wait.Block2n ); new_first_thread->Wait.Block2n.first = new_second_node; 800965c: 58 27 00 38 sw (r1+56),r7 new_first_thread->Wait.Block2n.last = last_node; 8009660: 58 26 00 40 sw (r1+64),r6 8009664: 34 21 00 3c addi r1,r1,60 last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); 8009668: 58 c1 00 00 sw (r6+0),r1 800966c: e0 00 00 03 bi 8009678 <_Thread_queue_Extract_priority_helper+0x98> } } else { previous_node->next = next_node; 8009670: 58 a4 00 00 sw (r5+0),r4 next_node->previous = previous_node; 8009674: 58 85 00 04 sw (r4+4),r5 /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { 8009678: 44 60 00 03 be r3,r0,8009684 <_Thread_queue_Extract_priority_helper+0xa4> _ISR_Enable( level ); 800967c: d0 02 00 00 wcsr IE,r2 return; 8009680: e0 00 00 10 bi 80096c0 <_Thread_queue_Extract_priority_helper+0xe0> } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 8009684: 29 63 00 50 lw r3,(r11+80) 8009688: 34 01 00 02 mvi r1,2 800968c: 44 61 00 03 be r3,r1,8009698 <_Thread_queue_Extract_priority_helper+0xb8><== NEVER TAKEN _ISR_Enable( level ); 8009690: d0 02 00 00 wcsr IE,r2 8009694: e0 00 00 06 bi 80096ac <_Thread_queue_Extract_priority_helper+0xcc> 8009698: 34 01 00 03 mvi r1,3 <== NOT EXECUTED 800969c: 59 61 00 50 sw (r11+80),r1 <== NOT EXECUTED } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 80096a0: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 80096a4: 35 61 00 48 addi r1,r11,72 <== NOT EXECUTED 80096a8: fb ff f4 15 calli 80066fc <_Watchdog_Remove> <== NOT EXECUTED 80096ac: 78 03 08 01 mvhi r3,0x801 80096b0: 38 63 1d d8 ori r3,r3,0x1dd8 80096b4: 28 62 00 00 lw r2,(r3+0) 80096b8: b9 60 08 00 mv r1,r11 80096bc: fb ff ff 3d calli 80093b0 <_Thread_Clear_state> #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 80096c0: 2b 9d 00 04 lw ra,(sp+4) 80096c4: 2b 8b 00 08 lw r11,(sp+8) 80096c8: 37 9c 00 08 addi sp,sp,8 80096cc: c3 a0 00 00 ret =============================================================================== 08005a70 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 8005a70: 37 9c ff ec addi sp,sp,-20 8005a74: 5b 8b 00 10 sw (sp+16),r11 8005a78: 5b 8c 00 0c sw (sp+12),r12 8005a7c: 5b 8d 00 08 sw (sp+8),r13 8005a80: 5b 9d 00 04 sw (sp+4),ra 8005a84: b8 20 58 00 mv r11,r1 8005a88: 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 ) 8005a8c: 44 20 00 19 be r1,r0,8005af0 <_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 ) { 8005a90: 28 22 00 34 lw r2,(r1+52) 8005a94: 34 01 00 01 mvi r1,1 8005a98: 5c 41 00 16 bne r2,r1,8005af0 <_Thread_queue_Requeue+0x80> <== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 8005a9c: 90 00 68 00 rcsr r13,IE 8005aa0: 34 01 ff fe mvi r1,-2 8005aa4: a1 a1 08 00 and r1,r13,r1 8005aa8: d0 01 00 00 wcsr IE,r1 8005aac: 78 03 08 01 mvhi r3,0x801 8005ab0: 38 63 1d d0 ori r3,r3,0x1dd0 8005ab4: 29 82 00 10 lw r2,(r12+16) 8005ab8: 28 61 00 00 lw r1,(r3+0) 8005abc: a0 41 08 00 and r1,r2,r1 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 8005ac0: 44 20 00 0b be r1,r0,8005aec <_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; 8005ac4: 34 01 00 01 mvi r1,1 8005ac8: 59 61 00 30 sw (r11+48),r1 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 8005acc: b9 80 10 00 mv r2,r12 8005ad0: b9 60 08 00 mv r1,r11 8005ad4: 34 03 00 01 mvi r3,1 8005ad8: f8 00 0e c2 calli 80095e0 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 8005adc: b9 60 08 00 mv r1,r11 8005ae0: b9 80 10 00 mv r2,r12 8005ae4: 37 83 00 14 addi r3,sp,20 8005ae8: fb ff ff 03 calli 80056f4 <_Thread_queue_Enqueue_priority> } _ISR_Enable( level ); 8005aec: d0 0d 00 00 wcsr IE,r13 } } 8005af0: 2b 9d 00 04 lw ra,(sp+4) 8005af4: 2b 8b 00 10 lw r11,(sp+16) 8005af8: 2b 8c 00 0c lw r12,(sp+12) 8005afc: 2b 8d 00 08 lw r13,(sp+8) 8005b00: 37 9c 00 14 addi sp,sp,20 8005b04: c3 a0 00 00 ret =============================================================================== 08005b08 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 8005b08: 37 9c ff f8 addi sp,sp,-8 8005b0c: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 8005b10: 37 82 00 08 addi r2,sp,8 8005b14: fb ff fd 6a calli 80050bc <_Thread_Get> switch ( location ) { 8005b18: 2b 82 00 08 lw r2,(sp+8) 8005b1c: 5c 40 00 07 bne r2,r0,8005b38 <_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 ); 8005b20: f8 00 0e fd calli 8009714 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 8005b24: 78 01 08 01 mvhi r1,0x801 8005b28: 38 21 38 1c ori r1,r1,0x381c 8005b2c: 28 22 00 00 lw r2,(r1+0) 8005b30: 34 42 ff ff addi r2,r2,-1 8005b34: 58 22 00 00 sw (r1+0),r2 _Thread_Unnest_dispatch(); break; } } 8005b38: 2b 9d 00 04 lw ra,(sp+4) 8005b3c: 37 9c 00 08 addi sp,sp,8 8005b40: c3 a0 00 00 ret =============================================================================== 08014814 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 8014814: 37 9c ff a4 addi sp,sp,-92 8014818: 5b 8b 00 44 sw (sp+68),r11 801481c: 5b 8c 00 40 sw (sp+64),r12 8014820: 5b 8d 00 3c sw (sp+60),r13 8014824: 5b 8e 00 38 sw (sp+56),r14 8014828: 5b 8f 00 34 sw (sp+52),r15 801482c: 5b 90 00 30 sw (sp+48),r16 8014830: 5b 91 00 2c sw (sp+44),r17 8014834: 5b 92 00 28 sw (sp+40),r18 8014838: 5b 93 00 24 sw (sp+36),r19 801483c: 5b 94 00 20 sw (sp+32),r20 8014840: 5b 95 00 1c sw (sp+28),r21 8014844: 5b 96 00 18 sw (sp+24),r22 8014848: 5b 97 00 14 sw (sp+20),r23 801484c: 5b 98 00 10 sw (sp+16),r24 8014850: 5b 99 00 0c sw (sp+12),r25 8014854: 5b 9b 00 08 sw (sp+8),fp 8014858: 5b 9d 00 04 sw (sp+4),ra static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 801485c: 78 10 08 03 mvhi r16,0x803 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 8014860: b8 20 58 00 mv r11,r1 8014864: 37 8f 00 48 addi r15,sp,72 8014868: 37 81 00 54 addi r1,sp,84 801486c: 37 95 00 58 addi r21,sp,88 8014870: 37 91 00 4c addi r17,sp,76 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8014874: 78 0e 08 03 mvhi r14,0x803 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8014878: 5b 95 00 54 sw (sp+84),r21 the_chain->permanent_null = NULL; 801487c: 5b 80 00 58 sw (sp+88),r0 the_chain->last = _Chain_Head(the_chain); 8014880: 5b 81 00 5c sw (sp+92),r1 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 8014884: 5b 91 00 48 sw (sp+72),r17 the_chain->permanent_null = NULL; 8014888: 5b 80 00 4c sw (sp+76),r0 the_chain->last = _Chain_Head(the_chain); 801488c: 5b 8f 00 50 sw (sp+80),r15 { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 8014890: b8 20 d8 00 mv fp,r1 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 8014894: 3a 10 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 ); 8014898: 35 74 00 30 addi r20,r11,48 _Chain_Initialize_empty( &insert_chain ); _Chain_Initialize_empty( &fire_chain ); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); 801489c: b9 e0 98 00 mv r19,r15 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 80148a0: 39 ce 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 ); 80148a4: 35 6d 00 68 addi r13,r11,104 Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 80148a8: 34 19 00 03 mvi r25,3 * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 80148ac: 34 12 ff fe mvi r18,-2 _Thread_Set_state( ts->thread, STATES_DELAYING ); _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 80148b0: 34 18 00 01 mvi r24,1 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 80148b4: 35 77 00 08 addi r23,r11,8 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 80148b8: 35 76 00 40 addi r22,r11,64 { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 80148bc: 59 7b 00 78 sw (r11+120),fp static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 80148c0: 2a 02 00 00 lw r2,(r16+0) /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 80148c4: 29 63 00 3c lw r3,(r11+60) watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 80148c8: ba 80 08 00 mv r1,r20 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 80148cc: 59 62 00 3c sw (r11+60),r2 _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 80148d0: c8 43 10 00 sub r2,r2,r3 80148d4: ba 60 18 00 mv r3,r19 80148d8: f8 00 15 53 calli 8019e24 <_Watchdog_Adjust_to_chain> Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 80148dc: 29 64 00 74 lw r4,(r11+116) static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 80148e0: 29 cc 00 00 lw r12,(r14+0) /* * Process the seconds chain. Start by checking that the Time * of Day (TOD) has not been set backwards. If it has then * we want to adjust the watchdogs->Chain to indicate this. */ if ( snapshot > last_snapshot ) { 80148e4: 50 8c 00 06 bgeu r4,r12,80148fc <_Timer_server_Body+0xe8> /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 80148e8: b9 a0 08 00 mv r1,r13 80148ec: c9 84 10 00 sub r2,r12,r4 80148f0: ba 60 18 00 mv r3,r19 80148f4: f8 00 15 4c calli 8019e24 <_Watchdog_Adjust_to_chain> 80148f8: e0 00 00 06 bi 8014910 <_Timer_server_Body+0xfc> } else if ( snapshot < last_snapshot ) { 80148fc: 51 84 00 05 bgeu r12,r4,8014910 <_Timer_server_Body+0xfc> /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 8014900: b9 a0 08 00 mv r1,r13 8014904: 34 02 00 01 mvi r2,1 8014908: c8 8c 18 00 sub r3,r4,r12 801490c: f8 00 15 0f calli 8019d48 <_Watchdog_Adjust> } watchdogs->last_snapshot = snapshot; 8014910: 59 6c 00 74 sw (r11+116),r12 static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8014914: 34 0c 00 01 mvi r12,1 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 8014918: 29 62 00 78 lw r2,(r11+120) 801491c: b8 40 08 00 mv r1,r2 8014920: f8 00 03 6a calli 80156c8 <_Chain_Get> 8014924: b8 20 10 00 mv r2,r1 if ( timer == NULL ) { 8014928: 44 20 00 09 be r1,r0,801494c <_Timer_server_Body+0x138> <== ALWAYS TAKEN static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 801492c: 28 23 00 38 lw r3,(r1+56) <== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 8014930: 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 ) { 8014934: 44 6c 00 03 be r3,r12,8014940 <_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 ) { 8014938: 5c 79 ff f8 bne r3,r25,8014918 <_Timer_server_Body+0x104> <== NOT EXECUTED _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 801493c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8014940: 34 42 00 10 addi r2,r2,16 <== NOT EXECUTED 8014944: f8 00 15 5d calli 8019eb8 <_Watchdog_Insert> <== NOT EXECUTED 8014948: e3 ff ff f4 bi 8014918 <_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 ); 801494c: 90 00 10 00 rcsr r2,IE 8014950: a0 52 08 00 and r1,r2,r18 8014954: d0 01 00 00 wcsr IE,r1 if ( _Chain_Is_empty( insert_chain ) ) { 8014958: 2b 81 00 54 lw r1,(sp+84) 801495c: 5c 35 00 06 bne r1,r21,8014974 <_Timer_server_Body+0x160> <== NEVER TAKEN ts->insert_chain = NULL; 8014960: 59 60 00 78 sw (r11+120),r0 _ISR_Enable( level ); 8014964: d0 02 00 00 wcsr IE,r2 _Chain_Initialize_empty( &fire_chain ); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); if ( !_Chain_Is_empty( &fire_chain ) ) { 8014968: 2b 81 00 48 lw r1,(sp+72) 801496c: 5c 31 00 04 bne r1,r17,801497c <_Timer_server_Body+0x168> 8014970: e0 00 00 15 bi 80149c4 <_Timer_server_Body+0x1b0> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 8014974: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED 8014978: e3 ff ff d2 bi 80148c0 <_Timer_server_Body+0xac> <== NOT EXECUTED /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 801497c: 90 00 20 00 rcsr r4,IE 8014980: a0 92 08 00 and r1,r4,r18 8014984: d0 01 00 00 wcsr IE,r1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8014988: 2b 82 00 48 lw r2,(sp+72) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 801498c: 44 51 00 0c be r2,r17,80149bc <_Timer_server_Body+0x1a8> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 8014990: 28 41 00 00 lw r1,(r2+0) the_chain->first = new_first; 8014994: 5b 81 00 48 sw (sp+72),r1 new_first->previous = _Chain_Head(the_chain); 8014998: 58 2f 00 04 sw (r1+4),r15 watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 801499c: 44 40 00 08 be r2,r0,80149bc <_Timer_server_Body+0x1a8> <== NEVER TAKEN watchdog->state = WATCHDOG_INACTIVE; 80149a0: 58 40 00 08 sw (r2+8),r0 _ISR_Enable( level ); 80149a4: d0 04 00 00 wcsr IE,r4 /* * The timer server may block here and wait for resources or time. * The system watchdogs are inactive and will remain inactive since * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); 80149a8: 28 43 00 1c lw r3,(r2+28) 80149ac: 28 41 00 20 lw r1,(r2+32) 80149b0: 28 42 00 24 lw r2,(r2+36) 80149b4: d8 60 00 00 call r3 } 80149b8: e3 ff ff f1 bi 801497c <_Timer_server_Body+0x168> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 80149bc: d0 04 00 00 wcsr IE,r4 80149c0: e3 ff ff bf bi 80148bc <_Timer_server_Body+0xa8> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 80149c4: 31 60 00 7c sb (r11+124),r0 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); 80149c8: fb ff ff 53 calli 8014714 <_Thread_Disable_dispatch> _Thread_Set_state( ts->thread, STATES_DELAYING ); 80149cc: 29 61 00 00 lw r1,(r11+0) 80149d0: 34 02 00 08 mvi r2,8 80149d4: f8 00 11 d1 calli 8019118 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 80149d8: b9 60 08 00 mv r1,r11 80149dc: fb ff ff 54 calli 801472c <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 80149e0: b9 60 08 00 mv r1,r11 80149e4: fb ff ff 6f calli 80147a0 <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 80149e8: f8 00 0e 86 calli 8018400 <_Thread_Enable_dispatch> static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 80149ec: ba e0 08 00 mv r1,r23 _Thread_Set_state( ts->thread, STATES_DELAYING ); _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 80149f0: 31 78 00 7c sb (r11+124),r24 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 80149f4: f8 00 15 8e calli 801a02c <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 80149f8: ba c0 08 00 mv r1,r22 80149fc: f8 00 15 8c calli 801a02c <_Watchdog_Remove> 8014a00: e3 ff ff af bi 80148bc <_Timer_server_Body+0xa8> =============================================================================== 08014a04 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 8014a04: 37 9c ff f4 addi sp,sp,-12 8014a08: 5b 8b 00 0c sw (sp+12),r11 8014a0c: 5b 8c 00 08 sw (sp+8),r12 8014a10: 5b 9d 00 04 sw (sp+4),ra 8014a14: b8 20 58 00 mv r11,r1 if ( ts->insert_chain == NULL ) { 8014a18: 28 21 00 78 lw r1,(r1+120) static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 8014a1c: b8 40 60 00 mv r12,r2 if ( ts->insert_chain == NULL ) { 8014a20: 5c 20 00 43 bne r1,r0,8014b2c <_Timer_server_Schedule_operation_method+0x128><== 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(); 8014a24: fb ff ff 3c calli 8014714 <_Thread_Disable_dispatch> if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8014a28: 29 81 00 38 lw r1,(r12+56) 8014a2c: 34 02 00 01 mvi r2,1 8014a30: 5c 22 00 1d bne r1,r2,8014aa4 <_Timer_server_Schedule_operation_method+0xa0> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 8014a34: 90 00 10 00 rcsr r2,IE 8014a38: 34 01 ff fe mvi r1,-2 8014a3c: a0 41 08 00 and r1,r2,r1 8014a40: d0 01 00 00 wcsr IE,r1 snapshot = _Watchdog_Ticks_since_boot; 8014a44: 78 01 08 03 mvhi r1,0x803 8014a48: 38 21 ed 64 ori r1,r1,0xed64 8014a4c: 28 23 00 00 lw r3,(r1+0) */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8014a50: 29 61 00 30 lw r1,(r11+48) last_snapshot = ts->Interval_watchdogs.last_snapshot; 8014a54: 29 65 00 3c lw r5,(r11+60) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8014a58: 35 64 00 34 addi r4,r11,52 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 8014a5c: 44 24 00 07 be r1,r4,8014a78 <_Timer_server_Schedule_operation_method+0x74> /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 8014a60: 28 26 00 10 lw r6,(r1+16) first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 8014a64: c8 65 28 00 sub r5,r3,r5 delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 8014a68: 34 04 00 00 mvi r4,0 * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { 8014a6c: 50 a6 00 02 bgeu r5,r6,8014a74 <_Timer_server_Schedule_operation_method+0x70> delta_interval -= delta; 8014a70: c8 c5 20 00 sub r4,r6,r5 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 8014a74: 58 24 00 10 sw (r1+16),r4 } ts->Interval_watchdogs.last_snapshot = snapshot; 8014a78: 59 63 00 3c sw (r11+60),r3 _ISR_Enable( level ); 8014a7c: d0 02 00 00 wcsr IE,r2 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 8014a80: 35 61 00 30 addi r1,r11,48 8014a84: 35 82 00 10 addi r2,r12,16 8014a88: f8 00 15 0c calli 8019eb8 <_Watchdog_Insert> if ( !ts->active ) { 8014a8c: 41 61 00 7c lbu r1,(r11+124) 8014a90: 20 21 00 ff andi r1,r1,0xff 8014a94: 5c 20 00 24 bne r1,r0,8014b24 <_Timer_server_Schedule_operation_method+0x120> _Timer_server_Reset_interval_system_watchdog( ts ); 8014a98: b9 60 08 00 mv r1,r11 8014a9c: fb ff ff 24 calli 801472c <_Timer_server_Reset_interval_system_watchdog> 8014aa0: e0 00 00 21 bi 8014b24 <_Timer_server_Schedule_operation_method+0x120> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 8014aa4: 34 02 00 03 mvi r2,3 8014aa8: 5c 22 00 1f bne r1,r2,8014b24 <_Timer_server_Schedule_operation_method+0x120> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 8014aac: 90 00 30 00 rcsr r6,IE 8014ab0: 34 01 ff fe mvi r1,-2 8014ab4: a0 c1 08 00 and r1,r6,r1 8014ab8: d0 01 00 00 wcsr IE,r1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8014abc: 29 62 00 68 lw r2,(r11+104) snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8014ac0: 78 01 08 03 mvhi r1,0x803 last_snapshot = ts->TOD_watchdogs.last_snapshot; 8014ac4: 29 65 00 74 lw r5,(r11+116) /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8014ac8: 38 21 ec b4 ori r1,r1,0xecb4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 8014acc: 35 63 00 6c addi r3,r11,108 8014ad0: 28 21 00 00 lw r1,(r1+0) last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 8014ad4: 44 43 00 0a be r2,r3,8014afc <_Timer_server_Schedule_operation_method+0xf8> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 8014ad8: 28 44 00 10 lw r4,(r2+16) } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 8014adc: b4 85 18 00 add r3,r4,r5 delta_interval += delta; 8014ae0: c8 61 18 00 sub r3,r3,r1 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; if ( snapshot > last_snapshot ) { 8014ae4: 50 a1 00 05 bgeu r5,r1,8014af8 <_Timer_server_Schedule_operation_method+0xf4> /* * We advanced in time. */ delta = snapshot - last_snapshot; 8014ae8: c8 25 28 00 sub r5,r1,r5 if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 8014aec: 34 03 00 00 mvi r3,0 if ( snapshot > last_snapshot ) { /* * We advanced in time. */ delta = snapshot - last_snapshot; if (delta_interval > delta) { 8014af0: 50 a4 00 02 bgeu r5,r4,8014af8 <_Timer_server_Schedule_operation_method+0xf4><== NEVER TAKEN delta_interval -= delta; 8014af4: c8 85 18 00 sub r3,r4,r5 * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 8014af8: 58 43 00 10 sw (r2+16),r3 } ts->TOD_watchdogs.last_snapshot = snapshot; 8014afc: 59 61 00 74 sw (r11+116),r1 _ISR_Enable( level ); 8014b00: d0 06 00 00 wcsr IE,r6 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 8014b04: 35 61 00 68 addi r1,r11,104 8014b08: 35 82 00 10 addi r2,r12,16 8014b0c: f8 00 14 eb calli 8019eb8 <_Watchdog_Insert> if ( !ts->active ) { 8014b10: 41 61 00 7c lbu r1,(r11+124) 8014b14: 20 21 00 ff andi r1,r1,0xff 8014b18: 5c 20 00 03 bne r1,r0,8014b24 <_Timer_server_Schedule_operation_method+0x120><== NEVER TAKEN _Timer_server_Reset_tod_system_watchdog( ts ); 8014b1c: b9 60 08 00 mv r1,r11 8014b20: fb ff ff 20 calli 80147a0 <_Timer_server_Reset_tod_system_watchdog> } } _Thread_Enable_dispatch(); 8014b24: f8 00 0e 37 calli 8018400 <_Thread_Enable_dispatch> 8014b28: e0 00 00 03 bi 8014b34 <_Timer_server_Schedule_operation_method+0x130> * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 8014b2c: 29 61 00 78 lw r1,(r11+120) <== NOT EXECUTED 8014b30: f8 00 02 d0 calli 8015670 <_Chain_Append> <== NOT EXECUTED } } 8014b34: 2b 9d 00 04 lw ra,(sp+4) 8014b38: 2b 8b 00 0c lw r11,(sp+12) 8014b3c: 2b 8c 00 08 lw r12,(sp+8) 8014b40: 37 9c 00 0c addi sp,sp,12 8014b44: c3 a0 00 00 ret =============================================================================== 080086c8 <_Timespec_Greater_than>: bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { if ( lhs->tv_sec > rhs->tv_sec ) 80086c8: 28 24 00 00 lw r4,(r1+0) 80086cc: 28 45 00 00 lw r5,(r2+0) bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { 80086d0: b8 20 18 00 mv r3,r1 if ( lhs->tv_sec > rhs->tv_sec ) return true; 80086d4: 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 ) 80086d8: 48 85 00 06 bg r4,r5,80086f0 <_Timespec_Greater_than+0x28> return true; if ( lhs->tv_sec < rhs->tv_sec ) return false; 80086dc: 34 01 00 00 mvi r1,0 ) { if ( lhs->tv_sec > rhs->tv_sec ) return true; if ( lhs->tv_sec < rhs->tv_sec ) 80086e0: 48 a4 00 04 bg r5,r4,80086f0 <_Timespec_Greater_than+0x28> <== NEVER TAKEN #include #include #include bool _Timespec_Greater_than( 80086e4: 28 63 00 04 lw r3,(r3+4) 80086e8: 28 41 00 04 lw r1,(r2+4) 80086ec: 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; } 80086f0: c3 a0 00 00 ret =============================================================================== 08006178 <_User_extensions_Handler_initialization>: #include #include #include void _User_extensions_Handler_initialization(void) { 8006178: 37 9c ff ec addi sp,sp,-20 800617c: 5b 8b 00 14 sw (sp+20),r11 8006180: 5b 8c 00 10 sw (sp+16),r12 8006184: 5b 8d 00 0c sw (sp+12),r13 8006188: 5b 8e 00 08 sw (sp+8),r14 800618c: 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; 8006190: 78 02 08 01 mvhi r2,0x801 8006194: 38 42 30 c4 ori r2,r2,0x30c4 8006198: 28 4e 00 38 lw r14,(r2+56) initial_extensions = Configuration.User_extension_table; 800619c: 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); 80061a0: 78 03 08 01 mvhi r3,0x801 80061a4: 78 02 08 01 mvhi r2,0x801 80061a8: 38 42 39 a4 ori r2,r2,0x39a4 80061ac: 38 63 39 a8 ori r3,r3,0x39a8 80061b0: 58 43 00 00 sw (r2+0),r3 the_chain->permanent_null = NULL; 80061b4: 58 40 00 04 sw (r2+4),r0 the_chain->last = _Chain_Head(the_chain); 80061b8: 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); 80061bc: 78 03 08 01 mvhi r3,0x801 80061c0: 78 02 08 01 mvhi r2,0x801 80061c4: 38 42 38 20 ori r2,r2,0x3820 80061c8: 38 63 38 24 ori r3,r3,0x3824 80061cc: 58 43 00 00 sw (r2+0),r3 the_chain->permanent_null = NULL; 80061d0: 58 40 00 04 sw (r2+4),r0 the_chain->last = _Chain_Head(the_chain); 80061d4: 58 42 00 08 sw (r2+8),r2 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { 80061d8: 45 60 00 22 be r11,r0,8006260 <_User_extensions_Handler_initialization+0xe8><== NEVER TAKEN extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) 80061dc: 34 02 00 34 mvi r2,52 80061e0: b9 c0 08 00 mv r1,r14 80061e4: f8 00 2a 13 calli 8010a30 <__mulsi3> 80061e8: 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( 80061ec: f8 00 01 d2 calli 8006934 <_Workspace_Allocate_or_fatal_error> number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 80061f0: b9 a0 18 00 mv r3,r13 80061f4: 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( 80061f8: b8 20 60 00 mv r12,r1 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 80061fc: 34 0d 00 00 mvi r13,0 extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 8006200: f8 00 17 81 calli 800c004 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 8006204: e0 00 00 16 bi 800625c <_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; 8006208: 29 61 00 1c lw r1,(r11+28) 800620c: 29 68 00 00 lw r8,(r11+0) 8006210: 29 67 00 04 lw r7,(r11+4) 8006214: 29 66 00 08 lw r6,(r11+8) 8006218: 29 65 00 0c lw r5,(r11+12) 800621c: 29 64 00 10 lw r4,(r11+16) 8006220: 29 63 00 14 lw r3,(r11+20) 8006224: 29 62 00 18 lw r2,(r11+24) 8006228: 59 81 00 30 sw (r12+48),r1 800622c: 59 88 00 14 sw (r12+20),r8 8006230: 59 87 00 18 sw (r12+24),r7 8006234: 59 86 00 1c sw (r12+28),r6 8006238: 59 85 00 20 sw (r12+32),r5 800623c: 59 84 00 24 sw (r12+36),r4 8006240: 59 83 00 28 sw (r12+40),r3 8006244: 59 82 00 2c sw (r12+44),r2 _User_extensions_Add_set( extension ); 8006248: b9 80 08 00 mv r1,r12 800624c: f8 00 0d ad calli 8009900 <_User_extensions_Add_set> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; 8006250: 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++ ) { 8006254: 35 ad 00 01 addi r13,r13,1 8006258: 35 6b 00 20 addi r11,r11,32 800625c: 55 cd ff eb bgu r14,r13,8006208 <_User_extensions_Handler_initialization+0x90> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; } } } 8006260: 2b 9d 00 04 lw ra,(sp+4) 8006264: 2b 8b 00 14 lw r11,(sp+20) 8006268: 2b 8c 00 10 lw r12,(sp+16) 800626c: 2b 8d 00 0c lw r13,(sp+12) 8006270: 2b 8e 00 08 lw r14,(sp+8) 8006274: 37 9c 00 14 addi sp,sp,20 8006278: c3 a0 00 00 ret =============================================================================== 08008924 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 8008924: 37 9c ff e4 addi sp,sp,-28 8008928: 5b 8b 00 1c sw (sp+28),r11 800892c: 5b 8c 00 18 sw (sp+24),r12 8008930: 5b 8d 00 14 sw (sp+20),r13 8008934: 5b 8e 00 10 sw (sp+16),r14 8008938: 5b 8f 00 0c sw (sp+12),r15 800893c: 5b 90 00 08 sw (sp+8),r16 8008940: 5b 9d 00 04 sw (sp+4),ra 8008944: b8 20 60 00 mv r12,r1 8008948: b8 60 58 00 mv r11,r3 ISR_Level level; _ISR_Disable( level ); 800894c: 90 00 08 00 rcsr r1,IE 8008950: 34 03 ff fe mvi r3,-2 8008954: a0 23 18 00 and r3,r1,r3 8008958: 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)); 800895c: 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; 8008960: 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 ) ) { 8008964: 44 6e 00 1d be r3,r14,80089d8 <_Watchdog_Adjust+0xb4> switch ( direction ) { 8008968: 44 40 00 04 be r2,r0,8008978 <_Watchdog_Adjust+0x54> 800896c: 34 04 00 01 mvi r4,1 8008970: 5c 44 00 1a bne r2,r4,80089d8 <_Watchdog_Adjust+0xb4> <== NEVER TAKEN 8008974: e0 00 00 04 bi 8008984 <_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; 8008978: 34 10 00 01 mvi r16,1 _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 800897c: 34 0f ff fe mvi r15,-2 8008980: e0 00 00 15 bi 80089d4 <_Watchdog_Adjust+0xb0> * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 8008984: 28 62 00 10 lw r2,(r3+16) 8008988: b4 4b 58 00 add r11,r2,r11 800898c: 58 6b 00 10 sw (r3+16),r11 break; 8008990: e0 00 00 12 bi 80089d8 <_Watchdog_Adjust+0xb4> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 8008994: 29 82 00 00 lw r2,(r12+0) case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 8008998: 28 4d 00 10 lw r13,(r2+16) 800899c: 51 6d 00 04 bgeu r11,r13,80089ac <_Watchdog_Adjust+0x88> _Watchdog_First( header )->delta_interval -= units; 80089a0: c9 ab 58 00 sub r11,r13,r11 80089a4: 58 4b 00 10 sw (r2+16),r11 break; 80089a8: e0 00 00 0c bi 80089d8 <_Watchdog_Adjust+0xb4> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 80089ac: 58 50 00 10 sw (r2+16),r16 _ISR_Enable( level ); 80089b0: d0 01 00 00 wcsr IE,r1 _Watchdog_Tickle( header ); 80089b4: b9 80 08 00 mv r1,r12 80089b8: f8 00 00 98 calli 8008c18 <_Watchdog_Tickle> _ISR_Disable( level ); 80089bc: 90 00 08 00 rcsr r1,IE 80089c0: a0 2f 10 00 and r2,r1,r15 80089c4: d0 02 00 00 wcsr IE,r2 if ( _Chain_Is_empty( header ) ) 80089c8: 29 82 00 00 lw r2,(r12+0) 80089cc: 44 4e 00 03 be r2,r14,80089d8 <_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; 80089d0: 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 ) { 80089d4: 5d 60 ff f0 bne r11,r0,8008994 <_Watchdog_Adjust+0x70> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 80089d8: d0 01 00 00 wcsr IE,r1 } 80089dc: 2b 9d 00 04 lw ra,(sp+4) 80089e0: 2b 8b 00 1c lw r11,(sp+28) 80089e4: 2b 8c 00 18 lw r12,(sp+24) 80089e8: 2b 8d 00 14 lw r13,(sp+20) 80089ec: 2b 8e 00 10 lw r14,(sp+16) 80089f0: 2b 8f 00 0c lw r15,(sp+12) 80089f4: 2b 90 00 08 lw r16,(sp+8) 80089f8: 37 9c 00 1c addi sp,sp,28 80089fc: c3 a0 00 00 ret =============================================================================== 080066fc <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 80066fc: 90 00 28 00 rcsr r5,IE 8006700: 34 02 ff fe mvi r2,-2 8006704: a0 a2 10 00 and r2,r5,r2 8006708: d0 02 00 00 wcsr IE,r2 previous_state = the_watchdog->state; 800670c: 28 23 00 08 lw r3,(r1+8) switch ( previous_state ) { 8006710: 34 02 00 01 mvi r2,1 8006714: 44 62 00 05 be r3,r2,8006728 <_Watchdog_Remove+0x2c> 8006718: 44 60 00 1b be r3,r0,8006784 <_Watchdog_Remove+0x88> 800671c: 34 02 00 03 mvi r2,3 8006720: 54 62 00 19 bgu r3,r2,8006784 <_Watchdog_Remove+0x88> <== NEVER TAKEN 8006724: e0 00 00 03 bi 8006730 <_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; 8006728: 58 20 00 08 sw (r1+8),r0 break; 800672c: e0 00 00 16 bi 8006784 <_Watchdog_Remove+0x88> } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 8006730: 28 22 00 00 lw r2,(r1+0) break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 8006734: 58 20 00 08 sw (r1+8),r0 next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 8006738: 28 44 00 00 lw r4,(r2+0) 800673c: 44 80 00 05 be r4,r0,8006750 <_Watchdog_Remove+0x54> next_watchdog->delta_interval += the_watchdog->delta_interval; 8006740: 28 46 00 10 lw r6,(r2+16) 8006744: 28 24 00 10 lw r4,(r1+16) 8006748: b4 c4 20 00 add r4,r6,r4 800674c: 58 44 00 10 sw (r2+16),r4 if ( _Watchdog_Sync_count ) 8006750: 78 04 08 01 mvhi r4,0x801 8006754: 38 84 39 50 ori r4,r4,0x3950 8006758: 28 84 00 00 lw r4,(r4+0) 800675c: 44 80 00 07 be r4,r0,8006778 <_Watchdog_Remove+0x7c> _Watchdog_Sync_level = _ISR_Nest_level; 8006760: 78 04 08 01 mvhi r4,0x801 8006764: 38 84 39 e8 ori r4,r4,0x39e8 8006768: 28 86 00 08 lw r6,(r4+8) 800676c: 78 04 08 01 mvhi r4,0x801 8006770: 38 84 38 c4 ori r4,r4,0x38c4 8006774: 58 86 00 00 sw (r4+0),r6 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 8006778: 28 24 00 04 lw r4,(r1+4) next->previous = previous; 800677c: 58 44 00 04 sw (r2+4),r4 previous->next = next; 8006780: 58 82 00 00 sw (r4+0),r2 _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8006784: 78 02 08 01 mvhi r2,0x801 8006788: 38 42 39 54 ori r2,r2,0x3954 800678c: 28 42 00 00 lw r2,(r2+0) 8006790: 58 22 00 18 sw (r1+24),r2 _ISR_Enable( level ); 8006794: d0 05 00 00 wcsr IE,r5 return( previous_state ); } 8006798: b8 60 08 00 mv r1,r3 800679c: c3 a0 00 00 ret =============================================================================== 08008514 <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 8008514: 37 9c ff ec addi sp,sp,-20 8008518: 5b 8b 00 14 sw (sp+20),r11 800851c: 5b 8c 00 10 sw (sp+16),r12 8008520: 5b 8d 00 0c sw (sp+12),r13 8008524: 5b 8e 00 08 sw (sp+8),r14 8008528: 5b 9d 00 04 sw (sp+4),ra 800852c: b8 20 70 00 mv r14,r1 8008530: b8 40 60 00 mv r12,r2 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 8008534: 90 00 68 00 rcsr r13,IE 8008538: 34 01 ff fe mvi r1,-2 800853c: a1 a1 08 00 and r1,r13,r1 8008540: d0 01 00 00 wcsr IE,r1 printk( "Watchdog Chain: %s %p\n", name, header ); 8008544: 78 01 08 01 mvhi r1,0x801 8008548: b9 80 18 00 mv r3,r12 800854c: 38 21 d2 0c ori r1,r1,0xd20c 8008550: b9 c0 10 00 mv r2,r14 8008554: fb ff eb bd calli 8003448 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8008558: 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; 800855c: 35 8c 00 04 addi r12,r12,4 if ( !_Chain_Is_empty( header ) ) { 8008560: 45 6c 00 0b be r11,r12,800858c <_Watchdog_Report_chain+0x78> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 8008564: b9 60 10 00 mv r2,r11 8008568: 34 01 00 00 mvi r1,0 800856c: f8 00 00 13 calli 80085b8 <_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 ) 8008570: 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 ; 8008574: 5d 6c ff fc bne r11,r12,8008564 <_Watchdog_Report_chain+0x50><== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 8008578: 78 01 08 01 mvhi r1,0x801 800857c: 38 21 d2 24 ori r1,r1,0xd224 8008580: b9 c0 10 00 mv r2,r14 8008584: fb ff eb b1 calli 8003448 8008588: e0 00 00 04 bi 8008598 <_Watchdog_Report_chain+0x84> } else { printk( "Chain is empty\n" ); 800858c: 78 01 08 01 mvhi r1,0x801 8008590: 38 21 d2 34 ori r1,r1,0xd234 8008594: fb ff eb ad calli 8003448 } _ISR_Enable( level ); 8008598: d0 0d 00 00 wcsr IE,r13 } 800859c: 2b 9d 00 04 lw ra,(sp+4) 80085a0: 2b 8b 00 14 lw r11,(sp+20) 80085a4: 2b 8c 00 10 lw r12,(sp+16) 80085a8: 2b 8d 00 0c lw r13,(sp+12) 80085ac: 2b 8e 00 08 lw r14,(sp+8) 80085b0: 37 9c 00 14 addi sp,sp,20 80085b4: c3 a0 00 00 ret =============================================================================== 080067a0 <_Watchdog_Tickle>: */ void _Watchdog_Tickle( Chain_Control *header ) { 80067a0: 37 9c ff e4 addi sp,sp,-28 80067a4: 5b 8b 00 1c sw (sp+28),r11 80067a8: 5b 8c 00 18 sw (sp+24),r12 80067ac: 5b 8d 00 14 sw (sp+20),r13 80067b0: 5b 8e 00 10 sw (sp+16),r14 80067b4: 5b 8f 00 0c sw (sp+12),r15 80067b8: 5b 90 00 08 sw (sp+8),r16 80067bc: 5b 9d 00 04 sw (sp+4),ra 80067c0: 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 ); 80067c4: 90 00 18 00 rcsr r3,IE 80067c8: 34 01 ff fe mvi r1,-2 80067cc: a0 61 08 00 and r1,r3,r1 80067d0: 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)); 80067d4: 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; 80067d8: 35 8e 00 04 addi r14,r12,4 80067dc: b8 60 10 00 mv r2,r3 if ( _Chain_Is_empty( header ) ) 80067e0: 45 6e 00 1a be r11,r14,8006848 <_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) { 80067e4: 29 61 00 10 lw r1,(r11+16) 80067e8: 44 20 00 04 be r1,r0,80067f8 <_Watchdog_Tickle+0x58> the_watchdog->delta_interval--; 80067ec: 34 21 ff ff addi r1,r1,-1 80067f0: 59 61 00 10 sw (r11+16),r1 if ( the_watchdog->delta_interval != 0 ) 80067f4: 5c 20 00 15 bne r1,r0,8006848 <_Watchdog_Tickle+0xa8> */ void _Watchdog_Tickle( Chain_Control *header ) { 80067f8: b8 60 68 00 mv r13,r3 do { watchdog_state = _Watchdog_Remove( the_watchdog ); _ISR_Enable( level ); switch( watchdog_state ) { 80067fc: 34 10 00 02 mvi r16,2 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 8006800: 34 0f ff fe mvi r15,-2 8006804: e0 00 00 02 bi 800680c <_Watchdog_Tickle+0x6c> 8006808: b8 40 68 00 mv r13,r2 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 800680c: b9 60 08 00 mv r1,r11 8006810: fb ff ff bb calli 80066fc <_Watchdog_Remove> _ISR_Enable( level ); 8006814: d0 0d 00 00 wcsr IE,r13 switch( watchdog_state ) { 8006818: 5c 30 00 05 bne r1,r16,800682c <_Watchdog_Tickle+0x8c> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 800681c: 29 63 00 1c lw r3,(r11+28) 8006820: 29 61 00 20 lw r1,(r11+32) 8006824: 29 62 00 24 lw r2,(r11+36) 8006828: d8 60 00 00 call r3 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 800682c: 90 00 10 00 rcsr r2,IE 8006830: a0 4f 08 00 and r1,r2,r15 8006834: d0 01 00 00 wcsr IE,r1 } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 8006838: 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) ); 800683c: 45 6e 00 03 be r11,r14,8006848 <_Watchdog_Tickle+0xa8> } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 8006840: 29 61 00 10 lw r1,(r11+16) 8006844: 44 20 ff f1 be r1,r0,8006808 <_Watchdog_Tickle+0x68> (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 8006848: d0 02 00 00 wcsr IE,r2 } 800684c: 2b 9d 00 04 lw ra,(sp+4) 8006850: 2b 8b 00 1c lw r11,(sp+28) 8006854: 2b 8c 00 18 lw r12,(sp+24) 8006858: 2b 8d 00 14 lw r13,(sp+20) 800685c: 2b 8e 00 10 lw r14,(sp+16) 8006860: 2b 8f 00 0c lw r15,(sp+12) 8006864: 2b 90 00 08 lw r16,(sp+8) 8006868: 37 9c 00 1c addi sp,sp,28 800686c: c3 a0 00 00 ret =============================================================================== 08023b98 <__kill>: #endif int __kill( pid_t pid, int sig ) { return 0; } 8023b98: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8023b9c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08010fe4 <_exit>: extern void FINI_SYMBOL( void ); #endif void EXIT_SYMBOL(int status) { 8010fe4: 37 9c ff f8 addi sp,sp,-8 8010fe8: 5b 9d 00 04 sw (sp+4),ra /* * If the toolset uses init/fini sections, then we need to * run the global destructors now. */ #if defined(__USE_INIT_FINI__) FINI_SYMBOL(); 8010fec: 5b 81 00 08 sw (sp+8),r1 8010ff0: f8 00 02 68 calli 8011990 <__start_set_sysctl_set> * We need to do the exit processing on the global reentrancy structure. * This has already been done on the per task reentrancy structure * associated with this task. */ libc_wrapup(); 8010ff4: fb ff ff d9 calli 8010f58 rtems_shutdown_executive(status); 8010ff8: 2b 81 00 08 lw r1,(sp+8) 8010ffc: f8 00 00 57 calli 8011158 8011000: e0 00 00 00 bi 8011000 <_exit+0x1c> <== NOT EXECUTED =============================================================================== 080014fc <_gettimeofday>: int _gettimeofday( struct timeval *tp, struct timezone *tzp ) { 80014fc: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 8001500: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED return gettimeofday( tp, tzp ); 8001504: fb ff ff d8 calli 8001464 <== NOT EXECUTED } 8001508: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800150c: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 8001510: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080053a4 <_rename_r>: int _rename_r( struct _reent *ptr __attribute__((unused)), const char *old, const char *new ) { 80053a4: 37 9c ff a0 addi sp,sp,-96 80053a8: 5b 8b 00 1c sw (sp+28),r11 80053ac: 5b 8c 00 18 sw (sp+24),r12 80053b0: 5b 8d 00 14 sw (sp+20),r13 80053b4: 5b 8e 00 10 sw (sp+16),r14 80053b8: 5b 8f 00 0c sw (sp+12),r15 80053bc: 5b 90 00 08 sw (sp+8),r16 80053c0: 5b 9d 00 04 sw (sp+4),ra /* * Get the parent node of the old path to be renamed. Find the parent path. */ old_parent_pathlen = rtems_filesystem_dirname ( old ); 80053c4: b8 40 08 00 mv r1,r2 int _rename_r( struct _reent *ptr __attribute__((unused)), const char *old, const char *new ) { 80053c8: b8 40 58 00 mv r11,r2 80053cc: b8 60 80 00 mv r16,r3 /* * Get the parent node of the old path to be renamed. Find the parent path. */ old_parent_pathlen = rtems_filesystem_dirname ( old ); 80053d0: fb ff fa 1b calli 8003c3c 80053d4: b8 20 70 00 mv r14,r1 80053d8: 37 84 00 34 addi r4,sp,52 if ( old_parent_pathlen == 0 ) 80053dc: 5c 20 00 07 bne r1,r0,80053f8 <_rename_r+0x54> rtems_filesystem_get_start_loc( old, &i, &old_parent_loc ); 80053e0: b9 60 08 00 mv r1,r11 80053e4: 37 82 00 60 addi r2,sp,96 80053e8: b8 80 18 00 mv r3,r4 80053ec: f8 00 00 fa calli 80057d4 rtems_filesystem_location_info_t old_parent_loc; rtems_filesystem_location_info_t new_parent_loc; int i; int result; const char *name; bool free_old_parentloc = false; 80053f0: 34 0d 00 00 mvi r13,0 80053f4: e0 00 00 09 bi 8005418 <_rename_r+0x74> old_parent_pathlen = rtems_filesystem_dirname ( old ); if ( old_parent_pathlen == 0 ) rtems_filesystem_get_start_loc( old, &i, &old_parent_loc ); else { result = rtems_filesystem_evaluate_path( old, old_parent_pathlen, 80053f8: b9 60 08 00 mv r1,r11 80053fc: b9 c0 10 00 mv r2,r14 8005400: 34 03 00 02 mvi r3,2 8005404: 34 05 00 00 mvi r5,0 8005408: fb ff f9 e8 calli 8003ba8 RTEMS_LIBIO_PERMS_WRITE, &old_parent_loc, false ); if ( result != 0 ) return -1; 800540c: 34 0c ff ff mvi r12,-1 else { result = rtems_filesystem_evaluate_path( old, old_parent_pathlen, RTEMS_LIBIO_PERMS_WRITE, &old_parent_loc, false ); if ( result != 0 ) 8005410: 5c 20 00 59 bne r1,r0,8005574 <_rename_r+0x1d0> <== NEVER TAKEN return -1; free_old_parentloc = true; 8005414: 34 0d 00 01 mvi r13,1 /* * Start from the parent to find the node that should be under it. */ old_loc = old_parent_loc; 8005418: 2b 81 00 34 lw r1,(sp+52) name = old + old_parent_pathlen; 800541c: b5 6e 58 00 add r11,r11,r14 8005420: 5b 8b 00 5c sw (sp+92),r11 /* * Start from the parent to find the node that should be under it. */ old_loc = old_parent_loc; 8005424: 5b 81 00 48 sw (sp+72),r1 8005428: 2b 81 00 38 lw r1,(sp+56) name = old + old_parent_pathlen; name += rtems_filesystem_prefix_separators( name, strlen( name ) ); result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 800542c: 37 8c 00 48 addi r12,sp,72 /* * Start from the parent to find the node that should be under it. */ old_loc = old_parent_loc; 8005430: 5b 81 00 4c sw (sp+76),r1 8005434: 2b 81 00 3c lw r1,(sp+60) 8005438: 5b 81 00 50 sw (sp+80),r1 800543c: 2b 81 00 40 lw r1,(sp+64) 8005440: 5b 81 00 54 sw (sp+84),r1 8005444: 2b 81 00 44 lw r1,(sp+68) 8005448: 5b 81 00 58 sw (sp+88),r1 name = old + old_parent_pathlen; name += rtems_filesystem_prefix_separators( name, strlen( name ) ); 800544c: b9 60 08 00 mv r1,r11 8005450: f8 00 33 39 calli 8012134 8005454: b8 20 10 00 mv r2,r1 8005458: b9 60 08 00 mv r1,r11 800545c: fb ff fa 0c calli 8003c8c 8005460: b5 61 58 00 add r11,r11,r1 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 8005464: b9 60 08 00 mv r1,r11 * Start from the parent to find the node that should be under it. */ old_loc = old_parent_loc; name = old + old_parent_pathlen; name += rtems_filesystem_prefix_separators( name, strlen( name ) ); 8005468: 5b 8b 00 5c sw (sp+92),r11 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 800546c: f8 00 33 32 calli 8012134 8005470: b8 20 10 00 mv r2,r1 8005474: 34 03 00 00 mvi r3,0 8005478: b9 60 08 00 mv r1,r11 800547c: b9 80 20 00 mv r4,r12 8005480: 34 05 00 00 mvi r5,0 8005484: fb ff f9 9d calli 8003af8 8005488: b8 20 78 00 mv r15,r1 0, &old_loc, false ); if ( result != 0 ) { 800548c: 44 20 00 05 be r1,r0,80054a0 <_rename_r+0xfc> if ( free_old_parentloc ) rtems_filesystem_freenode( &old_parent_loc ); return -1; 8005490: 34 0c ff ff mvi r12,-1 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 0, &old_loc, false ); if ( result != 0 ) { if ( free_old_parentloc ) rtems_filesystem_freenode( &old_parent_loc ); 8005494: 37 81 00 34 addi r1,sp,52 name += rtems_filesystem_prefix_separators( name, strlen( name ) ); result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 0, &old_loc, false ); if ( result != 0 ) { if ( free_old_parentloc ) 8005498: 45 a0 00 37 be r13,r0,8005574 <_rename_r+0x1d0> <== NEVER TAKEN 800549c: e0 00 00 35 bi 8005570 <_rename_r+0x1cc> /* * Get the parent of the new node we are renaming to. */ rtems_filesystem_get_start_loc( new, &i, &new_parent_loc ); 80054a0: 37 8b 00 20 addi r11,sp,32 80054a4: ba 00 08 00 mv r1,r16 80054a8: 37 82 00 60 addi r2,sp,96 80054ac: b9 60 18 00 mv r3,r11 80054b0: f8 00 00 c9 calli 80057d4 result = (*new_parent_loc.ops->evalformake_h)( &new[i], &new_parent_loc, &name ); 80054b4: 2b 81 00 2c lw r1,(sp+44) 80054b8: b9 60 10 00 mv r2,r11 80054bc: 37 83 00 5c addi r3,sp,92 80054c0: 28 24 00 04 lw r4,(r1+4) 80054c4: 2b 81 00 60 lw r1,(sp+96) 80054c8: b6 01 08 00 add r1,r16,r1 80054cc: d8 80 00 00 call r4 80054d0: b8 20 70 00 mv r14,r1 if ( result != 0 ) { 80054d4: 44 2f 00 09 be r1,r15,80054f8 <_rename_r+0x154> rtems_filesystem_freenode( &new_parent_loc ); 80054d8: b9 60 08 00 mv r1,r11 80054dc: fb ff fa 05 calli 8003cf0 if ( free_old_parentloc ) 80054e0: 45 a0 00 03 be r13,r0,80054ec <_rename_r+0x148> <== NEVER TAKEN rtems_filesystem_freenode( &old_parent_loc ); 80054e4: 37 81 00 34 addi r1,sp,52 80054e8: fb ff fa 02 calli 8003cf0 rtems_filesystem_freenode( &old_loc ); 80054ec: 37 81 00 48 addi r1,sp,72 80054f0: fb ff fa 00 calli 8003cf0 80054f4: e0 00 00 0e bi 800552c <_rename_r+0x188> /* * Check to see if the caller is trying to rename across file system * boundaries. */ if ( old_parent_loc.mt_entry != new_parent_loc.mt_entry ) { 80054f8: 2b 81 00 30 lw r1,(sp+48) 80054fc: 2b 82 00 44 lw r2,(sp+68) 8005500: 44 41 00 0d be r2,r1,8005534 <_rename_r+0x190> rtems_filesystem_freenode( &new_parent_loc ); 8005504: b9 60 08 00 mv r1,r11 8005508: fb ff f9 fa calli 8003cf0 if ( free_old_parentloc ) 800550c: 45 ae 00 03 be r13,r14,8005518 <_rename_r+0x174> rtems_filesystem_freenode( &old_parent_loc ); 8005510: 37 81 00 34 addi r1,sp,52 8005514: fb ff f9 f7 calli 8003cf0 rtems_filesystem_freenode( &old_loc ); 8005518: 37 81 00 48 addi r1,sp,72 800551c: fb ff f9 f5 calli 8003cf0 rtems_set_errno_and_return_minus_one( EXDEV ); 8005520: f8 00 25 49 calli 800ea44 <__errno> 8005524: 34 02 00 12 mvi r2,18 8005528: 58 22 00 00 sw (r1+0),r2 800552c: 34 0c ff ff mvi r12,-1 8005530: e0 00 00 11 bi 8005574 <_rename_r+0x1d0> } result = (*new_parent_loc.ops->rename_h)( &old_parent_loc, &old_loc, &new_parent_loc, name ); 8005534: 2b 81 00 2c lw r1,(sp+44) 8005538: 2b 84 00 5c lw r4,(sp+92) 800553c: 37 8f 00 34 addi r15,sp,52 8005540: 28 25 00 40 lw r5,(r1+64) 8005544: b9 80 10 00 mv r2,r12 8005548: b9 e0 08 00 mv r1,r15 800554c: b9 60 18 00 mv r3,r11 8005550: d8 a0 00 00 call r5 8005554: b8 20 60 00 mv r12,r1 rtems_filesystem_freenode( &new_parent_loc ); 8005558: b9 60 08 00 mv r1,r11 800555c: fb ff f9 e5 calli 8003cf0 if ( free_old_parentloc ) 8005560: 45 ae 00 03 be r13,r14,800556c <_rename_r+0x1c8> rtems_filesystem_freenode( &old_parent_loc ); 8005564: b9 e0 08 00 mv r1,r15 8005568: fb ff f9 e2 calli 8003cf0 rtems_filesystem_freenode( &old_loc ); 800556c: 37 81 00 48 addi r1,sp,72 8005570: fb ff f9 e0 calli 8003cf0 return result; } 8005574: b9 80 08 00 mv r1,r12 8005578: 2b 9d 00 04 lw ra,(sp+4) 800557c: 2b 8b 00 1c lw r11,(sp+28) 8005580: 2b 8c 00 18 lw r12,(sp+24) 8005584: 2b 8d 00 14 lw r13,(sp+20) 8005588: 2b 8e 00 10 lw r14,(sp+16) 800558c: 2b 8f 00 0c lw r15,(sp+12) 8005590: 2b 90 00 08 lw r16,(sp+8) 8005594: 37 9c 00 60 addi sp,sp,96 8005598: c3 a0 00 00 ret =============================================================================== 080028bc : #include speed_t cfgetispeed( const struct termios *tp ) { 80028bc: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 80028c0: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED return (tp->c_cflag / (CIBAUD / CBAUD)) & CBAUD; 80028c4: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED 80028c8: 34 02 00 10 mvi r2,16 <== NOT EXECUTED 80028cc: f8 00 6a dd calli 801d440 <__lshrsi3> <== NOT EXECUTED } 80028d0: 20 21 10 0f andi r1,r1,0x100f <== NOT EXECUTED 80028d4: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80028d8: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 80028dc: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080028e0 : speed_t cfgetospeed( const struct termios *tp ) { return tp->c_cflag & CBAUD; 80028e0: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED } 80028e4: 20 21 10 0f andi r1,r1,0x100f <== NOT EXECUTED 80028e8: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080028ec : int cfsetispeed( struct termios *tp, speed_t speed ) { 80028ec: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED 80028f0: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED 80028f4: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED 80028f8: b8 20 58 00 mv r11,r1 <== NOT EXECUTED 80028fc: b8 40 08 00 mv r1,r2 <== NOT EXECUTED if ( speed & ~CBAUD ) 8002900: 34 02 ef f0 mvi r2,-4112 <== NOT EXECUTED 8002904: a0 22 10 00 and r2,r1,r2 <== NOT EXECUTED 8002908: 44 40 00 06 be r2,r0,8002920 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 800290c: f8 00 33 eb calli 800f8b8 <__errno> <== NOT EXECUTED 8002910: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8002914: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8002918: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800291c: e0 00 00 0b bi 8002948 <== NOT EXECUTED tp->c_cflag = (tp->c_cflag & ~CIBAUD) | (speed * (CIBAUD / CBAUD)); 8002920: 34 02 00 10 mvi r2,16 <== NOT EXECUTED 8002924: fb ff fb d4 calli 8001874 <__ashlsi3> <== NOT EXECUTED 8002928: 78 04 08 01 mvhi r4,0x801 <== NOT EXECUTED 800292c: 38 84 ed 58 ori r4,r4,0xed58 <== NOT EXECUTED 8002930: 29 63 00 08 lw r3,(r11+8) <== NOT EXECUTED 8002934: 28 82 00 00 lw r2,(r4+0) <== NOT EXECUTED 8002938: a0 62 10 00 and r2,r3,r2 <== NOT EXECUTED 800293c: b8 22 08 00 or r1,r1,r2 <== NOT EXECUTED 8002940: 59 61 00 08 sw (r11+8),r1 <== NOT EXECUTED return 0; 8002944: 34 01 00 00 mvi r1,0 <== NOT EXECUTED } 8002948: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800294c: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 8002950: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 8002954: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08002958 : int cfsetospeed( struct termios *tp, speed_t speed ) { 8002958: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 800295c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED if ( speed & ~CBAUD ) 8002960: 34 03 ef f0 mvi r3,-4112 <== NOT EXECUTED 8002964: a0 43 20 00 and r4,r2,r3 <== NOT EXECUTED 8002968: 44 80 00 06 be r4,r0,8002980 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 800296c: f8 00 33 d3 calli 800f8b8 <__errno> <== NOT EXECUTED 8002970: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8002974: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8002978: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800297c: e0 00 00 06 bi 8002994 <== NOT EXECUTED tp->c_cflag = (tp->c_cflag & ~CBAUD) | speed; 8002980: 28 24 00 08 lw r4,(r1+8) <== NOT EXECUTED 8002984: a0 64 18 00 and r3,r3,r4 <== NOT EXECUTED 8002988: b8 43 10 00 or r2,r2,r3 <== NOT EXECUTED 800298c: 58 22 00 08 sw (r1+8),r2 <== NOT EXECUTED return 0; 8002990: 34 01 00 00 mvi r1,0 <== NOT EXECUTED } 8002994: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8002998: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 800299c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080012b8 : #include int chroot( const char *pathname ) { 80012b8: 37 9c ff dc addi sp,sp,-36 80012bc: 5b 8b 00 10 sw (sp+16),r11 80012c0: 5b 8c 00 0c sw (sp+12),r12 80012c4: 5b 8d 00 08 sw (sp+8),r13 80012c8: 5b 9d 00 04 sw (sp+4),ra int result; rtems_filesystem_location_info_t loc; /* an automatic call to new private env the first time */ if (rtems_current_user_env == &rtems_global_user_env) { 80012cc: 78 0b 08 01 mvhi r11,0x801 80012d0: 39 6b 31 04 ori r11,r11,0x3104 80012d4: 29 6c 00 00 lw r12,(r11+0) 80012d8: 78 02 08 01 mvhi r2,0x801 80012dc: 38 42 36 d8 ori r2,r2,0x36d8 #include int chroot( const char *pathname ) { 80012e0: b8 20 68 00 mv r13,r1 int result; rtems_filesystem_location_info_t loc; /* an automatic call to new private env the first time */ if (rtems_current_user_env == &rtems_global_user_env) { 80012e4: 5d 82 00 08 bne r12,r2,8001304 <== NEVER TAKEN rtems_libio_set_private_env(); /* try to set a new private env*/ 80012e8: f8 00 05 a0 calli 8002968 if (rtems_current_user_env == &rtems_global_user_env) /* not ok */ 80012ec: 29 61 00 00 lw r1,(r11+0) 80012f0: 5c 2c 00 05 bne r1,r12,8001304 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOTSUP ); 80012f4: f8 00 28 f7 calli 800b6d0 <__errno> <== NOT EXECUTED 80012f8: 34 02 00 86 mvi r2,134 <== NOT EXECUTED 80012fc: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8001300: e0 00 00 0a bi 8001328 <== NOT EXECUTED } result = chdir(pathname); 8001304: b9 a0 08 00 mv r1,r13 8001308: f8 00 1c 39 calli 80083ec 800130c: b8 20 58 00 mv r11,r1 if (result) { 8001310: 44 20 00 08 be r1,r0,8001330 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( errno ); 8001314: f8 00 28 ef calli 800b6d0 <__errno> <== NOT EXECUTED 8001318: b8 20 58 00 mv r11,r1 <== NOT EXECUTED 800131c: f8 00 28 ed calli 800b6d0 <__errno> <== NOT EXECUTED 8001320: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED 8001324: 59 61 00 00 sw (r11+0),r1 <== NOT EXECUTED 8001328: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800132c: e0 00 00 1a bi 8001394 <== NOT EXECUTED } /* clone the new root location */ if (rtems_filesystem_evaluate_path(".", 1, 0, &loc, 0)) { 8001330: 78 01 08 01 mvhi r1,0x801 8001334: 38 21 1c 98 ori r1,r1,0x1c98 8001338: 34 02 00 01 mvi r2,1 800133c: 34 03 00 00 mvi r3,0 8001340: 37 84 00 14 addi r4,sp,20 8001344: 34 05 00 00 mvi r5,0 8001348: f8 00 00 72 calli 8001510 800134c: 5c 2b ff f2 bne r1,r11,8001314 <== NEVER TAKEN /* our cwd has changed, though - but there is no easy way of return :-( */ rtems_set_errno_and_return_minus_one( errno ); } rtems_filesystem_freenode(&rtems_filesystem_root); 8001350: 78 0b 08 01 mvhi r11,0x801 8001354: 39 6b 31 04 ori r11,r11,0x3104 8001358: 29 61 00 00 lw r1,(r11+0) 800135c: 34 21 00 18 addi r1,r1,24 8001360: f8 00 00 be calli 8001658 rtems_filesystem_root = loc; 8001364: 29 61 00 00 lw r1,(r11+0) 8001368: 2b 82 00 14 lw r2,(sp+20) 800136c: 58 22 00 18 sw (r1+24),r2 8001370: 2b 82 00 18 lw r2,(sp+24) 8001374: 58 22 00 1c sw (r1+28),r2 8001378: 2b 82 00 1c lw r2,(sp+28) 800137c: 58 22 00 20 sw (r1+32),r2 8001380: 2b 82 00 20 lw r2,(sp+32) 8001384: 58 22 00 24 sw (r1+36),r2 8001388: 2b 82 00 24 lw r2,(sp+36) 800138c: 58 22 00 28 sw (r1+40),r2 return 0; 8001390: 34 01 00 00 mvi r1,0 } 8001394: 2b 9d 00 04 lw ra,(sp+4) 8001398: 2b 8b 00 10 lw r11,(sp+16) 800139c: 2b 8c 00 0c lw r12,(sp+12) 80013a0: 2b 8d 00 08 lw r13,(sp+8) 80013a4: 37 9c 00 24 addi sp,sp,36 80013a8: c3 a0 00 00 ret =============================================================================== 080012d8 : static char *ctermid_name = "/dev/console"; char *ctermid( char *s ) { 80012d8: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED 80012dc: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED 80012e0: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED 80012e4: 78 02 08 00 mvhi r2,0x800 <== NOT EXECUTED 80012e8: b8 20 58 00 mv r11,r1 <== NOT EXECUTED 80012ec: 38 42 ea e8 ori r2,r2,0xeae8 <== NOT EXECUTED if ( !s ) 80012f0: 44 20 00 03 be r1,r0,80012fc <== NOT EXECUTED return ctermid_name; strcpy( s, ctermid_name ); 80012f4: f8 00 23 0b calli 8009f20 <== NOT EXECUTED return s; 80012f8: e0 00 00 02 bi 8001300 <== NOT EXECUTED char *ctermid( char *s ) { if ( !s ) return ctermid_name; 80012fc: b8 40 58 00 mv r11,r2 <== NOT EXECUTED strcpy( s, ctermid_name ); return s; } 8001300: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8001304: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8001308: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 800130c: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 8001310: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08006578 : const char *pathname, size_t pathnamelen, int flags, rtems_filesystem_location_info_t *pathloc ) { 8006578: 37 9c ff e0 addi sp,sp,-32 800657c: 5b 8b 00 20 sw (sp+32),r11 8006580: 5b 8c 00 1c sw (sp+28),r12 8006584: 5b 8d 00 18 sw (sp+24),r13 8006588: 5b 8e 00 14 sw (sp+20),r14 800658c: 5b 8f 00 10 sw (sp+16),r15 8006590: 5b 90 00 0c sw (sp+12),r16 8006594: 5b 91 00 08 sw (sp+8),r17 8006598: 5b 9d 00 04 sw (sp+4),ra assert( 0 ); rtems_set_errno_and_return_minus_one( EIO ); } /* get the device name table */ device_name_table = (rtems_device_name_t *)pathloc->node_access; 800659c: 28 8c 00 00 lw r12,(r4+0) if (!device_name_table) rtems_set_errno_and_return_minus_one( EFAULT ); for (i = 0; i < rtems_device_table_size; i++) { 80065a0: 78 0d 08 01 mvhi r13,0x801 const char *pathname, size_t pathnamelen, int flags, rtems_filesystem_location_info_t *pathloc ) { 80065a4: b8 20 88 00 mv r17,r1 80065a8: b8 40 80 00 mv r16,r2 80065ac: b8 80 58 00 mv r11,r4 rtems_set_errno_and_return_minus_one( EIO ); } /* get the device name table */ device_name_table = (rtems_device_name_t *)pathloc->node_access; if (!device_name_table) 80065b0: 34 0e 00 00 mvi r14,0 rtems_set_errno_and_return_minus_one( EFAULT ); for (i = 0; i < rtems_device_table_size; i++) { 80065b4: 39 ad 00 14 ori r13,r13,0x14 rtems_set_errno_and_return_minus_one( EIO ); } /* get the device name table */ device_name_table = (rtems_device_name_t *)pathloc->node_access; if (!device_name_table) 80065b8: 5d 80 00 1f bne r12,r0,8006634 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); 80065bc: f8 00 09 e1 calli 8008d40 <__errno> <== NOT EXECUTED 80065c0: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 80065c4: e0 00 00 20 bi 8006644 <== NOT EXECUTED for (i = 0; i < rtems_device_table_size; i++) { if (!device_name_table[i].device_name) 80065c8: 29 8f 00 00 lw r15,(r12+0) 80065cc: 45 e0 00 18 be r15,r0,800662c continue; if (strncmp(pathname, device_name_table[i].device_name, pathnamelen) != 0) 80065d0: ba 20 08 00 mv r1,r17 80065d4: b9 e0 10 00 mv r2,r15 80065d8: ba 00 18 00 mv r3,r16 80065dc: f8 00 0e 51 calli 8009f20 80065e0: b8 20 20 00 mv r4,r1 80065e4: 5c 20 00 12 bne r1,r0,800662c <== NEVER TAKEN continue; if (device_name_table[i].device_name[pathnamelen] != '\0') 80065e8: b5 f0 78 00 add r15,r15,r16 80065ec: 41 e1 00 00 lbu r1,(r15+0) 80065f0: 5c 24 00 0f bne r1,r4,800662c <== NEVER TAKEN continue; /* find the device, set proper values */ pathloc->node_access = (void *)&device_name_table[i]; pathloc->handlers = &devFS_file_handlers; 80065f4: 78 01 08 01 mvhi r1,0x801 80065f8: 38 21 01 58 ori r1,r1,0x158 80065fc: 59 61 00 08 sw (r11+8),r1 pathloc->ops = &devFS_ops; 8006600: 78 01 08 01 mvhi r1,0x801 8006604: 38 21 01 10 ori r1,r1,0x110 8006608: 59 61 00 0c sw (r11+12),r1 pathloc->mt_entry = rtems_filesystem_root.mt_entry; 800660c: 78 01 08 01 mvhi r1,0x801 8006610: 38 21 01 9c ori r1,r1,0x19c 8006614: 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]; 8006618: 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; 800661c: 28 21 00 28 lw r1,(r1+40) 8006620: 59 61 00 10 sw (r11+16),r1 return 0; 8006624: 34 01 00 00 mvi r1,0 8006628: e0 00 00 09 bi 800664c /* 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++) { 800662c: 35 ce 00 01 addi r14,r14,1 8006630: 35 8c 00 14 addi r12,r12,20 8006634: 29 a1 00 00 lw r1,(r13+0) 8006638: 54 2e ff e4 bgu r1,r14,80065c8 pathloc->mt_entry = rtems_filesystem_root.mt_entry; return 0; } /* no such file or directory */ rtems_set_errno_and_return_minus_one( ENOENT ); 800663c: f8 00 09 c1 calli 8008d40 <__errno> 8006640: 34 02 00 02 mvi r2,2 8006644: 58 22 00 00 sw (r1+0),r2 8006648: 34 01 ff ff mvi r1,-1 } 800664c: 2b 9d 00 04 lw ra,(sp+4) 8006650: 2b 8b 00 20 lw r11,(sp+32) 8006654: 2b 8c 00 1c lw r12,(sp+28) 8006658: 2b 8d 00 18 lw r13,(sp+24) 800665c: 2b 8e 00 14 lw r14,(sp+20) 8006660: 2b 8f 00 10 lw r15,(sp+16) 8006664: 2b 90 00 0c lw r16,(sp+12) 8006668: 2b 91 00 08 lw r17,(sp+8) 800666c: 37 9c 00 20 addi sp,sp,32 8006670: c3 a0 00 00 ret =============================================================================== 0800091c : int devFS_initialize( rtems_filesystem_mount_table_entry_t *temp_mt_entry, const void *data ) { 800091c: 37 9c ff f0 addi sp,sp,-16 8000920: 5b 8b 00 10 sw (sp+16),r11 8000924: 5b 8c 00 0c sw (sp+12),r12 8000928: 5b 8d 00 08 sw (sp+8),r13 800092c: 5b 9d 00 04 sw (sp+4),ra rtems_device_name_t *device_name_table; /* allocate device only filesystem name table */ device_name_table = (rtems_device_name_t *)_Workspace_Allocate( sizeof( rtems_device_name_t ) * ( rtems_device_table_size ) 8000930: 78 0b 08 01 mvhi r11,0x801 8000934: 39 6b 00 14 ori r11,r11,0x14 int devFS_initialize( rtems_filesystem_mount_table_entry_t *temp_mt_entry, const void *data ) { 8000938: b8 20 60 00 mv r12,r1 rtems_device_name_t *device_name_table; /* allocate device only filesystem name table */ device_name_table = (rtems_device_name_t *)_Workspace_Allocate( sizeof( rtems_device_name_t ) * ( rtems_device_table_size ) 800093c: 29 61 00 00 lw r1,(r11+0) 8000940: 34 02 00 02 mvi r2,2 8000944: f8 00 33 63 calli 800d6d0 <__ashlsi3> 8000948: 34 02 00 02 mvi r2,2 800094c: b8 20 68 00 mv r13,r1 8000950: f8 00 33 60 calli 800d6d0 <__ashlsi3> ) { rtems_device_name_t *device_name_table; /* allocate device only filesystem name table */ device_name_table = (rtems_device_name_t *)_Workspace_Allocate( 8000954: b5 a1 08 00 add r1,r13,r1 8000958: f8 00 15 68 calli 8005ef8 <_Workspace_Allocate> 800095c: b8 20 68 00 mv r13,r1 sizeof( rtems_device_name_t ) * ( rtems_device_table_size ) ); /* no memory for device filesystem */ if (!device_name_table) 8000960: 5c 20 00 06 bne r1,r0,8000978 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOMEM ); 8000964: f8 00 20 f7 calli 8008d40 <__errno> <== NOT EXECUTED 8000968: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 800096c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8000970: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8000974: e0 00 00 13 bi 80009c0 <== NOT EXECUTED memset( device_name_table, 0, sizeof( rtems_device_name_t ) * ( rtems_device_table_size ) 8000978: 29 61 00 00 lw r1,(r11+0) 800097c: 34 02 00 02 mvi r2,2 8000980: f8 00 33 54 calli 800d6d0 <__ashlsi3> 8000984: 34 02 00 02 mvi r2,2 8000988: b8 20 58 00 mv r11,r1 800098c: f8 00 33 51 calli 800d6d0 <__ashlsi3> 8000990: b5 61 18 00 add r3,r11,r1 /* no memory for device filesystem */ if (!device_name_table) rtems_set_errno_and_return_minus_one( ENOMEM ); memset( 8000994: 34 02 00 00 mvi r2,0 8000998: b9 a0 08 00 mv r1,r13 800099c: f8 00 23 eb calli 8009948 device_name_table, 0, sizeof( rtems_device_name_t ) * ( rtems_device_table_size ) ); /* set file handlers */ temp_mt_entry->mt_fs_root.handlers = &devFS_file_handlers; 80009a0: 78 01 08 01 mvhi r1,0x801 80009a4: 38 21 01 58 ori r1,r1,0x158 80009a8: 59 81 00 24 sw (r12+36),r1 temp_mt_entry->mt_fs_root.ops = &devFS_ops; 80009ac: 78 01 08 01 mvhi r1,0x801 80009b0: 38 21 01 10 ori r1,r1,0x110 80009b4: 59 81 00 28 sw (r12+40),r1 /* Set the node_access to device name table */ temp_mt_entry->mt_fs_root.node_access = (void *)device_name_table; 80009b8: 59 8d 00 1c sw (r12+28),r13 return 0; 80009bc: 34 01 00 00 mvi r1,0 } 80009c0: 2b 9d 00 04 lw ra,(sp+4) 80009c4: 2b 8b 00 10 lw r11,(sp+16) 80009c8: 2b 8c 00 0c lw r12,(sp+12) 80009cc: 2b 8d 00 08 lw r13,(sp+8) 80009d0: 37 9c 00 10 addi sp,sp,16 80009d4: c3 a0 00 00 ret =============================================================================== 08000c0c : int devFS_ioctl( rtems_libio_t *iop, uint32_t command, void *buffer ) { 8000c0c: 37 9c ff ec addi sp,sp,-20 8000c10: 5b 9d 00 04 sw (sp+4),ra rtems_libio_ioctl_args_t args; rtems_status_code status; rtems_device_name_t *np; np = (rtems_device_name_t *)iop->pathinfo.node_access; 8000c14: 28 24 00 1c lw r4,(r1+28) args.iop = iop; 8000c18: 5b 81 00 08 sw (sp+8),r1 args.command = command; 8000c1c: 5b 82 00 0c sw (sp+12),r2 args.buffer = buffer; status = rtems_io_control( 8000c20: 28 81 00 08 lw r1,(r4+8) 8000c24: 28 82 00 0c lw r2,(r4+12) np = (rtems_device_name_t *)iop->pathinfo.node_access; args.iop = iop; args.command = command; args.buffer = buffer; 8000c28: 5b 83 00 10 sw (sp+16),r3 status = rtems_io_control( 8000c2c: 37 83 00 08 addi r3,sp,8 8000c30: f8 00 07 7c calli 8002a20 np->major, np->minor, (void *) &args ); if ( status ) 8000c34: 44 20 00 03 be r1,r0,8000c40 <== ALWAYS TAKEN return rtems_deviceio_errno(status); 8000c38: f8 00 16 92 calli 8006680 <== NOT EXECUTED 8000c3c: e0 00 00 02 bi 8000c44 <== NOT EXECUTED return args.ioctl_return; 8000c40: 2b 81 00 14 lw r1,(sp+20) } 8000c44: 2b 9d 00 04 lw ra,(sp+4) 8000c48: 37 9c 00 14 addi sp,sp,20 8000c4c: c3 a0 00 00 ret =============================================================================== 080009d8 : const char *path, mode_t mode, dev_t dev, rtems_filesystem_location_info_t *pathloc ) { 80009d8: 37 9c ff d8 addi sp,sp,-40 80009dc: 5b 8b 00 28 sw (sp+40),r11 80009e0: 5b 8c 00 24 sw (sp+36),r12 80009e4: 5b 8d 00 20 sw (sp+32),r13 80009e8: 5b 8e 00 1c sw (sp+28),r14 80009ec: 5b 8f 00 18 sw (sp+24),r15 80009f0: 5b 90 00 14 sw (sp+20),r16 80009f4: 5b 91 00 10 sw (sp+16),r17 80009f8: 5b 92 00 0c sw (sp+12),r18 80009fc: 5b 93 00 08 sw (sp+8),r19 8000a00: 5b 9d 00 04 sw (sp+4),ra 8000a04: b8 40 88 00 mv r17,r2 * condition and do not create the '/dev' and the 'path' * actually passed in is 'dev', not '/dev'. Just return 0 to * indicate we are OK. */ if ((path[0] == 'd') && (path[1] == 'e') && 8000a08: 40 22 00 00 lbu r2,(r1+0) const char *path, mode_t mode, dev_t dev, rtems_filesystem_location_info_t *pathloc ) { 8000a0c: b8 20 58 00 mv r11,r1 * condition and do not create the '/dev' and the 'path' * actually passed in is 'dev', not '/dev'. Just return 0 to * indicate we are OK. */ if ((path[0] == 'd') && (path[1] == 'e') && 8000a10: 34 01 00 64 mvi r1,100 const char *path, mode_t mode, dev_t dev, rtems_filesystem_location_info_t *pathloc ) { 8000a14: b8 60 98 00 mv r19,r3 8000a18: b8 80 90 00 mv r18,r4 * condition and do not create the '/dev' and the 'path' * actually passed in is 'dev', not '/dev'. Just return 0 to * indicate we are OK. */ if ((path[0] == 'd') && (path[1] == 'e') && 8000a1c: 5c 41 00 0a bne r2,r1,8000a44 <== NEVER TAKEN 8000a20: 41 62 00 01 lbu r2,(r11+1) 8000a24: 34 01 00 65 mvi r1,101 8000a28: 5c 41 00 07 bne r2,r1,8000a44 <== NEVER TAKEN 8000a2c: 41 62 00 02 lbu r2,(r11+2) 8000a30: 34 01 00 76 mvi r1,118 8000a34: 5c 41 00 04 bne r2,r1,8000a44 <== NEVER TAKEN (path[2] == 'v') && (path[3] == '\0')) 8000a38: 41 62 00 03 lbu r2,(r11+3) return 0; 8000a3c: 34 01 00 00 mvi r1,0 * actually passed in is 'dev', not '/dev'. Just return 0 to * indicate we are OK. */ if ((path[0] == 'd') && (path[1] == 'e') && (path[2] == 'v') && (path[3] == '\0')) 8000a40: 44 40 00 3d be r2,r0,8000b34 return 0; /* must be a character device or a block device */ if (!S_ISBLK(mode) && !S_ISCHR(mode)) 8000a44: 22 22 f0 00 andi r2,r17,0xf000 8000a48: 7c 41 20 00 cmpnei r1,r2,8192 8000a4c: 7c 42 60 00 cmpnei r2,r2,24576 8000a50: a0 22 08 00 and r1,r1,r2 8000a54: 44 20 00 04 be r1,r0,8000a64 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 8000a58: f8 00 20 ba calli 8008d40 <__errno> <== NOT EXECUTED 8000a5c: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8000a60: e0 00 00 0b bi 8000a8c <== NOT EXECUTED else rtems_filesystem_split_dev_t(dev, major, minor); /* Find an empty slot in device name table */ device_name_table = (rtems_device_name_t *)pathloc->node_access; 8000a64: 28 af 00 00 lw r15,(r5+0) if (!device_name_table) 8000a68: 45 e1 00 07 be r15,r1,8000a84 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); for (slot = -1, i = 0; i < rtems_device_table_size; i++){ 8000a6c: 78 0d 08 01 mvhi r13,0x801 else rtems_filesystem_split_dev_t(dev, major, minor); /* Find an empty slot in device name table */ device_name_table = (rtems_device_name_t *)pathloc->node_access; if (!device_name_table) 8000a70: b9 e0 80 00 mv r16,r15 8000a74: 34 0c ff ff mvi r12,-1 8000a78: 34 0e 00 00 mvi r14,0 rtems_set_errno_and_return_minus_one( EFAULT ); for (slot = -1, i = 0; i < rtems_device_table_size; i++){ 8000a7c: 39 ad 00 14 ori r13,r13,0x14 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 af calli 8008d40 <__errno> <== NOT EXECUTED 8000a88: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 8000a8c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8000a90: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8000a94: e0 00 00 28 bi 8000b34 <== NOT EXECUTED for (slot = -1, i = 0; i < rtems_device_table_size; i++){ if (device_name_table[i].device_name == NULL) 8000a98: 2a 02 00 00 lw r2,(r16+0) 8000a9c: 44 40 00 07 be r2,r0,8000ab8 <== ALWAYS TAKEN slot = i; else if (strcmp(path, device_name_table[i].device_name) == 0) 8000aa0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8000aa4: f8 00 24 9c calli 8009d14 <== NOT EXECUTED 8000aa8: 5c 20 00 05 bne r1,r0,8000abc <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EEXIST ); 8000aac: f8 00 20 a5 calli 8008d40 <__errno> <== NOT EXECUTED 8000ab0: 34 02 00 11 mvi r2,17 <== NOT EXECUTED 8000ab4: e3 ff ff f6 bi 8000a8c <== NOT EXECUTED if (!device_name_table) rtems_set_errno_and_return_minus_one( EFAULT ); for (slot = -1, i = 0; i < rtems_device_table_size; i++){ if (device_name_table[i].device_name == NULL) slot = i; 8000ab8: b9 c0 60 00 mv r12,r14 /* Find an empty slot in device name table */ device_name_table = (rtems_device_name_t *)pathloc->node_access; if (!device_name_table) rtems_set_errno_and_return_minus_one( EFAULT ); for (slot = -1, i = 0; i < rtems_device_table_size; i++){ 8000abc: 35 ce 00 01 addi r14,r14,1 8000ac0: 36 10 00 14 addi r16,r16,20 8000ac4: 29 a1 00 00 lw r1,(r13+0) 8000ac8: 54 2e ff f4 bgu r1,r14,8000a98 else if (strcmp(path, device_name_table[i].device_name) == 0) rtems_set_errno_and_return_minus_one( EEXIST ); } if (slot == -1) 8000acc: 34 01 ff ff mvi r1,-1 8000ad0: 5d 81 00 04 bne r12,r1,8000ae0 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOMEM ); 8000ad4: f8 00 20 9b calli 8008d40 <__errno> <== NOT EXECUTED 8000ad8: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8000adc: e3 ff ff ec bi 8000a8c <== NOT EXECUTED _ISR_Disable(level); 8000ae0: 90 00 68 00 rcsr r13,IE 8000ae4: 34 01 ff fe mvi r1,-2 8000ae8: a1 a1 08 00 and r1,r13,r1 8000aec: d0 01 00 00 wcsr IE,r1 device_name_table[slot].device_name = (char *)path; 8000af0: 34 02 00 02 mvi r2,2 8000af4: b9 80 08 00 mv r1,r12 8000af8: f8 00 32 f6 calli 800d6d0 <__ashlsi3> 8000afc: 34 02 00 02 mvi r2,2 8000b00: b8 20 60 00 mv r12,r1 8000b04: f8 00 32 f3 calli 800d6d0 <__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 d3 calli 8009e64 8000b1c: 59 81 00 04 sw (r12+4),r1 device_name_table[slot].major = major; 8000b20: 59 93 00 08 sw (r12+8),r19 device_name_table[slot].minor = minor; 8000b24: 59 92 00 0c sw (r12+12),r18 device_name_table[slot].mode = mode; 8000b28: 59 91 00 10 sw (r12+16),r17 _ISR_Enable(level); 8000b2c: d0 0d 00 00 wcsr IE,r13 return 0; 8000b30: 34 01 00 00 mvi r1,0 } 8000b34: 2b 9d 00 04 lw ra,(sp+4) 8000b38: 2b 8b 00 28 lw r11,(sp+40) 8000b3c: 2b 8c 00 24 lw r12,(sp+36) 8000b40: 2b 8d 00 20 lw r13,(sp+32) 8000b44: 2b 8e 00 1c lw r14,(sp+28) 8000b48: 2b 8f 00 18 lw r15,(sp+24) 8000b4c: 2b 90 00 14 lw r16,(sp+20) 8000b50: 2b 91 00 10 lw r17,(sp+16) 8000b54: 2b 92 00 0c lw r18,(sp+12) 8000b58: 2b 93 00 08 lw r19,(sp+8) 8000b5c: 37 9c 00 28 addi sp,sp,40 8000b60: c3 a0 00 00 ret =============================================================================== 08000c8c : ssize_t devFS_read( rtems_libio_t *iop, void *buffer, size_t count ) { 8000c8c: 37 9c ff dc addi sp,sp,-36 <== NOT EXECUTED 8000c90: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED rtems_status_code status; rtems_device_name_t *np; np = (rtems_device_name_t *)iop->pathinfo.node_access; args.iop = iop; 8000c94: 5b 81 00 08 sw (sp+8),r1 <== NOT EXECUTED args.offset = iop->offset; 8000c98: 28 25 00 14 lw r5,(r1+20) <== NOT EXECUTED { rtems_libio_rw_args_t args; rtems_status_code status; rtems_device_name_t *np; np = (rtems_device_name_t *)iop->pathinfo.node_access; 8000c9c: 28 24 00 1c lw r4,(r1+28) <== NOT EXECUTED args.iop = iop; args.offset = iop->offset; 8000ca0: 5b 85 00 14 sw (sp+20),r5 <== NOT EXECUTED 8000ca4: 28 25 00 10 lw r5,(r1+16) <== NOT EXECUTED args.buffer = buffer; 8000ca8: 5b 82 00 18 sw (sp+24),r2 <== NOT EXECUTED args.count = count; 8000cac: 5b 83 00 1c sw (sp+28),r3 <== NOT EXECUTED rtems_device_name_t *np; np = (rtems_device_name_t *)iop->pathinfo.node_access; args.iop = iop; args.offset = iop->offset; 8000cb0: 5b 85 00 10 sw (sp+16),r5 <== NOT EXECUTED args.buffer = buffer; args.count = count; args.flags = iop->flags; 8000cb4: 28 21 00 18 lw r1,(r1+24) <== NOT EXECUTED args.bytes_moved = 0; status = rtems_io_read( 8000cb8: 28 82 00 0c lw r2,(r4+12) <== NOT EXECUTED 8000cbc: 37 83 00 08 addi r3,sp,8 <== NOT EXECUTED args.iop = iop; args.offset = iop->offset; args.buffer = buffer; args.count = count; args.flags = iop->flags; 8000cc0: 5b 81 00 20 sw (sp+32),r1 <== NOT EXECUTED args.bytes_moved = 0; status = rtems_io_read( 8000cc4: 28 81 00 08 lw r1,(r4+8) <== NOT EXECUTED args.iop = iop; args.offset = iop->offset; args.buffer = buffer; args.count = count; args.flags = iop->flags; args.bytes_moved = 0; 8000cc8: 5b 80 00 24 sw (sp+36),r0 <== NOT EXECUTED status = rtems_io_read( 8000ccc: f8 00 07 f8 calli 8002cac <== NOT EXECUTED np->major, np->minor, (void *) &args ); if ( status ) 8000cd0: 44 20 00 03 be r1,r0,8000cdc <== NOT EXECUTED return rtems_deviceio_errno(status); 8000cd4: f8 00 16 6b calli 8006680 <== NOT EXECUTED 8000cd8: e0 00 00 02 bi 8000ce0 <== NOT EXECUTED return (ssize_t) args.bytes_moved; 8000cdc: 2b 81 00 24 lw r1,(sp+36) <== NOT EXECUTED } 8000ce0: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8000ce4: 37 9c 00 24 addi sp,sp,36 <== NOT EXECUTED 8000ce8: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08000cec : int devFS_stat( rtems_filesystem_location_info_t *loc, struct stat *buf ) { 8000cec: 37 9c ff fc addi sp,sp,-4 8000cf0: 5b 9d 00 04 sw (sp+4),ra rtems_device_name_t *the_dev; the_dev = (rtems_device_name_t *)loc->node_access; 8000cf4: 28 21 00 00 lw r1,(r1+0) if (!the_dev) 8000cf8: 5c 20 00 06 bne r1,r0,8000d10 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); 8000cfc: f8 00 20 11 calli 8008d40 <__errno> <== NOT EXECUTED 8000d00: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 8000d04: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8000d08: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8000d0c: e0 00 00 08 bi 8000d2c <== NOT EXECUTED buf->st_rdev = rtems_filesystem_make_dev_t( the_dev->major, the_dev->minor ); 8000d10: 28 23 00 0c lw r3,(r1+12) rtems_device_minor_number _minor ) { union __rtems_dev_t temp; temp.__overlay.major = _major; 8000d14: 28 24 00 08 lw r4,(r1+8) buf->st_mode = the_dev->mode; 8000d18: 28 21 00 10 lw r1,(r1+16) the_dev = (rtems_device_name_t *)loc->node_access; if (!the_dev) rtems_set_errno_and_return_minus_one( EFAULT ); buf->st_rdev = rtems_filesystem_make_dev_t( the_dev->major, the_dev->minor ); 8000d1c: 58 43 00 1c sw (r2+28),r3 8000d20: 58 44 00 18 sw (r2+24),r4 buf->st_mode = the_dev->mode; 8000d24: 58 41 00 0c sw (r2+12),r1 return 0; 8000d28: 34 01 00 00 mvi r1,0 } 8000d2c: 2b 9d 00 04 lw ra,(sp+4) 8000d30: 37 9c 00 04 addi sp,sp,4 8000d34: c3 a0 00 00 ret =============================================================================== 08000d38 : ssize_t devFS_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 8000d38: 37 9c ff dc addi sp,sp,-36 8000d3c: 5b 9d 00 04 sw (sp+4),ra rtems_status_code status; rtems_device_name_t *np; np = (rtems_device_name_t *)iop->pathinfo.node_access; args.iop = iop; 8000d40: 5b 81 00 08 sw (sp+8),r1 args.offset = iop->offset; 8000d44: 28 25 00 14 lw r5,(r1+20) { rtems_libio_rw_args_t args; rtems_status_code status; rtems_device_name_t *np; np = (rtems_device_name_t *)iop->pathinfo.node_access; 8000d48: 28 24 00 1c lw r4,(r1+28) args.iop = iop; args.offset = iop->offset; 8000d4c: 5b 85 00 14 sw (sp+20),r5 8000d50: 28 25 00 10 lw r5,(r1+16) args.buffer = (void *) buffer; 8000d54: 5b 82 00 18 sw (sp+24),r2 args.count = count; 8000d58: 5b 83 00 1c sw (sp+28),r3 rtems_device_name_t *np; np = (rtems_device_name_t *)iop->pathinfo.node_access; args.iop = iop; args.offset = iop->offset; 8000d5c: 5b 85 00 10 sw (sp+16),r5 args.buffer = (void *) buffer; args.count = count; args.flags = iop->flags; 8000d60: 28 21 00 18 lw r1,(r1+24) args.bytes_moved = 0; status = rtems_io_write( 8000d64: 28 82 00 0c lw r2,(r4+12) 8000d68: 37 83 00 08 addi r3,sp,8 args.iop = iop; args.offset = iop->offset; args.buffer = (void *) buffer; args.count = count; args.flags = iop->flags; 8000d6c: 5b 81 00 20 sw (sp+32),r1 args.bytes_moved = 0; status = rtems_io_write( 8000d70: 28 81 00 08 lw r1,(r4+8) args.iop = iop; args.offset = iop->offset; args.buffer = (void *) buffer; args.count = count; args.flags = iop->flags; args.bytes_moved = 0; 8000d74: 5b 80 00 24 sw (sp+36),r0 status = rtems_io_write( 8000d78: f8 00 07 f2 calli 8002d40 np->major, np->minor, (void *) &args ); if ( status ) 8000d7c: 44 20 00 03 be r1,r0,8000d88 <== ALWAYS TAKEN return rtems_deviceio_errno(status); 8000d80: f8 00 16 40 calli 8006680 <== NOT EXECUTED 8000d84: e0 00 00 02 bi 8000d8c <== NOT EXECUTED return (ssize_t) args.bytes_moved; 8000d88: 2b 81 00 24 lw r1,(sp+36) } 8000d8c: 2b 9d 00 04 lw ra,(sp+4) 8000d90: 37 9c 00 24 addi sp,sp,36 8000d94: c3 a0 00 00 ret =============================================================================== 0800a918 : int device_ioctl( rtems_libio_t *iop, uint32_t command, void *buffer ) { 800a918: 37 9c ff ec addi sp,sp,-20 800a91c: 5b 9d 00 04 sw (sp+4),ra rtems_libio_ioctl_args_t args; rtems_status_code status; IMFS_jnode_t *the_jnode; args.iop = iop; args.command = command; 800a920: 5b 82 00 0c sw (sp+12),r2 args.buffer = buffer; the_jnode = iop->pathinfo.node_access; 800a924: 28 22 00 1c lw r2,(r1+28) { rtems_libio_ioctl_args_t args; rtems_status_code status; IMFS_jnode_t *the_jnode; args.iop = iop; 800a928: 5b 81 00 08 sw (sp+8),r1 args.command = command; args.buffer = buffer; 800a92c: 5b 83 00 10 sw (sp+16),r3 the_jnode = iop->pathinfo.node_access; status = rtems_io_control( 800a930: 28 41 00 50 lw r1,(r2+80) 800a934: 28 42 00 54 lw r2,(r2+84) 800a938: 37 83 00 08 addi r3,sp,8 800a93c: f8 00 01 b4 calli 800b00c the_jnode->info.device.major, the_jnode->info.device.minor, (void *) &args ); if ( status ) 800a940: 44 20 00 03 be r1,r0,800a94c <== ALWAYS TAKEN return rtems_deviceio_errno(status); 800a944: f8 00 02 8e calli 800b37c <== NOT EXECUTED 800a948: e0 00 00 02 bi 800a950 <== NOT EXECUTED return args.ioctl_return; 800a94c: 2b 81 00 14 lw r1,(sp+20) } 800a950: 2b 9d 00 04 lw ra,(sp+4) 800a954: 37 9c 00 14 addi sp,sp,20 800a958: c3 a0 00 00 ret =============================================================================== 0800a858 : ssize_t device_read( rtems_libio_t *iop, void *buffer, size_t count ) { 800a858: 37 9c ff dc addi sp,sp,-36 800a85c: 5b 9d 00 04 sw (sp+4),ra rtems_status_code status; IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; args.iop = iop; 800a860: 5b 81 00 08 sw (sp+8),r1 args.offset = iop->offset; 800a864: 28 25 00 14 lw r5,(r1+20) { rtems_libio_rw_args_t args; rtems_status_code status; IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 800a868: 28 24 00 1c lw r4,(r1+28) args.iop = iop; args.offset = iop->offset; 800a86c: 5b 85 00 14 sw (sp+20),r5 800a870: 28 25 00 10 lw r5,(r1+16) args.buffer = buffer; 800a874: 5b 82 00 18 sw (sp+24),r2 args.count = count; 800a878: 5b 83 00 1c sw (sp+28),r3 IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; args.iop = iop; args.offset = iop->offset; 800a87c: 5b 85 00 10 sw (sp+16),r5 args.buffer = buffer; args.count = count; args.flags = iop->flags; 800a880: 28 21 00 18 lw r1,(r1+24) args.bytes_moved = 0; status = rtems_io_read( 800a884: 28 82 00 54 lw r2,(r4+84) 800a888: 37 83 00 08 addi r3,sp,8 args.iop = iop; args.offset = iop->offset; args.buffer = buffer; args.count = count; args.flags = iop->flags; 800a88c: 5b 81 00 20 sw (sp+32),r1 args.bytes_moved = 0; status = rtems_io_read( 800a890: 28 81 00 50 lw r1,(r4+80) args.iop = iop; args.offset = iop->offset; args.buffer = buffer; args.count = count; args.flags = iop->flags; args.bytes_moved = 0; 800a894: 5b 80 00 24 sw (sp+36),r0 status = rtems_io_read( 800a898: f8 00 02 27 calli 800b134 the_jnode->info.device.major, the_jnode->info.device.minor, (void *) &args ); if ( status ) 800a89c: 44 20 00 03 be r1,r0,800a8a8 <== ALWAYS TAKEN return rtems_deviceio_errno(status); 800a8a0: f8 00 02 b7 calli 800b37c <== NOT EXECUTED 800a8a4: e0 00 00 02 bi 800a8ac <== NOT EXECUTED return (ssize_t) args.bytes_moved; 800a8a8: 2b 81 00 24 lw r1,(sp+36) } 800a8ac: 2b 9d 00 04 lw ra,(sp+4) 800a8b0: 37 9c 00 24 addi sp,sp,36 800a8b4: c3 a0 00 00 ret =============================================================================== 0800a8b8 : ssize_t device_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 800a8b8: 37 9c ff dc addi sp,sp,-36 800a8bc: 5b 9d 00 04 sw (sp+4),ra rtems_status_code status; IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; args.iop = iop; 800a8c0: 5b 81 00 08 sw (sp+8),r1 args.offset = iop->offset; 800a8c4: 28 25 00 14 lw r5,(r1+20) { rtems_libio_rw_args_t args; rtems_status_code status; IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 800a8c8: 28 24 00 1c lw r4,(r1+28) args.iop = iop; args.offset = iop->offset; 800a8cc: 5b 85 00 14 sw (sp+20),r5 800a8d0: 28 25 00 10 lw r5,(r1+16) args.buffer = (void *) buffer; 800a8d4: 5b 82 00 18 sw (sp+24),r2 args.count = count; 800a8d8: 5b 83 00 1c sw (sp+28),r3 IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; args.iop = iop; args.offset = iop->offset; 800a8dc: 5b 85 00 10 sw (sp+16),r5 args.buffer = (void *) buffer; args.count = count; args.flags = iop->flags; 800a8e0: 28 21 00 18 lw r1,(r1+24) args.bytes_moved = 0; status = rtems_io_write( 800a8e4: 28 82 00 54 lw r2,(r4+84) 800a8e8: 37 83 00 08 addi r3,sp,8 args.iop = iop; args.offset = iop->offset; args.buffer = (void *) buffer; args.count = count; args.flags = iop->flags; 800a8ec: 5b 81 00 20 sw (sp+32),r1 args.bytes_moved = 0; status = rtems_io_write( 800a8f0: 28 81 00 50 lw r1,(r4+80) args.iop = iop; args.offset = iop->offset; args.buffer = (void *) buffer; args.count = count; args.flags = iop->flags; args.bytes_moved = 0; 800a8f4: 5b 80 00 24 sw (sp+36),r0 status = rtems_io_write( 800a8f8: f8 00 02 34 calli 800b1c8 the_jnode->info.device.major, the_jnode->info.device.minor, (void *) &args ); if ( status ) 800a8fc: 44 20 00 03 be r1,r0,800a908 <== ALWAYS TAKEN return rtems_deviceio_errno(status); 800a900: f8 00 02 9f calli 800b37c <== NOT EXECUTED 800a904: e0 00 00 02 bi 800a90c <== NOT EXECUTED return (ssize_t) args.bytes_moved; 800a908: 2b 81 00 24 lw r1,(sp+36) } 800a90c: 2b 9d 00 04 lw ra,(sp+4) 800a910: 37 9c 00 24 addi sp,sp,36 800a914: c3 a0 00 00 ret =============================================================================== 08004774 : /* * Drain output queue */ static void drainOutput (struct rtems_termios_tty *tty) { 8004774: 37 9c ff f0 addi sp,sp,-16 8004778: 5b 8b 00 10 sw (sp+16),r11 800477c: 5b 8c 00 0c sw (sp+12),r12 8004780: 5b 8d 00 08 sw (sp+8),r13 8004784: 5b 9d 00 04 sw (sp+4),ra 8004788: b8 20 58 00 mv r11,r1 rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { 800478c: 28 21 00 b4 lw r1,(r1+180) 8004790: 44 20 00 17 be r1,r0,80047ec rtems_interrupt_disable (level); 8004794: 90 00 08 00 rcsr r1,IE 8004798: 34 02 ff fe mvi r2,-2 800479c: a0 22 10 00 and r2,r1,r2 80047a0: d0 02 00 00 wcsr IE,r2 while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { tty->rawOutBufState = rob_wait; 80047a4: 34 0d 00 02 mvi r13,2 rtems_interrupt_enable (level); sc = rtems_semaphore_obtain( tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); 80047a8: 34 0c ff fe mvi r12,-2 rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { 80047ac: e0 00 00 0c bi 80047dc tty->rawOutBufState = rob_wait; 80047b0: 59 6d 00 94 sw (r11+148),r13 <== NOT EXECUTED rtems_interrupt_enable (level); 80047b4: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED sc = rtems_semaphore_obtain( 80047b8: 29 61 00 8c lw r1,(r11+140) <== NOT EXECUTED 80047bc: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 80047c0: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 80047c4: f8 00 0a 0b calli 8006ff0 <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 80047c8: 44 20 00 02 be r1,r0,80047d0 <== NOT EXECUTED rtems_fatal_error_occurred (sc); 80047cc: f8 00 0b e5 calli 8007760 <== NOT EXECUTED rtems_interrupt_disable (level); 80047d0: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED 80047d4: a0 2c 10 00 and r2,r1,r12 <== NOT EXECUTED 80047d8: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { 80047dc: 29 63 00 84 lw r3,(r11+132) 80047e0: 29 62 00 80 lw r2,(r11+128) 80047e4: 5c 62 ff f3 bne r3,r2,80047b0 <== NEVER TAKEN tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } rtems_interrupt_enable (level); 80047e8: d0 01 00 00 wcsr IE,r1 } } 80047ec: 2b 9d 00 04 lw ra,(sp+4) 80047f0: 2b 8b 00 10 lw r11,(sp+16) 80047f4: 2b 8c 00 0c lw r12,(sp+12) 80047f8: 2b 8d 00 08 lw r13,(sp+8) 80047fc: 37 9c 00 10 addi sp,sp,16 8004800: c3 a0 00 00 ret =============================================================================== 08001bc0 : int dup2( int fildes, int fildes2 ) { 8001bc0: 37 9c ff a4 addi sp,sp,-92 8001bc4: 5b 8b 00 14 sw (sp+20),r11 8001bc8: 5b 8c 00 10 sw (sp+16),r12 8001bcc: 5b 8d 00 0c sw (sp+12),r13 8001bd0: 5b 8e 00 08 sw (sp+8),r14 8001bd4: 5b 9d 00 04 sw (sp+4),ra /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 8001bd8: 37 8d 00 18 addi r13,sp,24 int dup2( int fildes, int fildes2 ) { 8001bdc: b8 40 60 00 mv r12,r2 /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 8001be0: b9 a0 10 00 mv r2,r13 int dup2( int fildes, int fildes2 ) { 8001be4: b8 20 70 00 mv r14,r1 * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); if ( status == -1 ) return -1; 8001be8: 34 0b ff ff mvi r11,-1 /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 8001bec: f8 00 01 c2 calli 80022f4 if ( status == -1 ) 8001bf0: 44 2b 00 0a be r1,r11,8001c18 <== NEVER TAKEN /* * If fildes2 is not valid, then we should not do anything either. */ status = fstat( fildes2, &buf ); 8001bf4: b9 80 08 00 mv r1,r12 8001bf8: b9 a0 10 00 mv r2,r13 8001bfc: f8 00 01 be calli 80022f4 if ( status == -1 ) 8001c00: 44 2b 00 06 be r1,r11,8001c18 <== ALWAYS TAKEN /* * This fcntl handles everything else. */ return fcntl( fildes, F_DUPFD, fildes2 ); 8001c04: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 8001c08: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 8001c0c: b9 80 18 00 mv r3,r12 <== NOT EXECUTED 8001c10: f8 00 00 90 calli 8001e50 <== NOT EXECUTED 8001c14: b8 20 58 00 mv r11,r1 <== NOT EXECUTED } 8001c18: b9 60 08 00 mv r1,r11 8001c1c: 2b 9d 00 04 lw ra,(sp+4) 8001c20: 2b 8b 00 14 lw r11,(sp+20) 8001c24: 2b 8c 00 10 lw r12,(sp+16) 8001c28: 2b 8d 00 0c lw r13,(sp+12) 8001c2c: 2b 8e 00 08 lw r14,(sp+8) 8001c30: 37 9c 00 5c addi sp,sp,92 8001c34: c3 a0 00 00 ret =============================================================================== 0800553c : /* * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { 800553c: 37 9c ff f4 addi sp,sp,-12 8005540: 5b 8b 00 08 sw (sp+8),r11 8005544: 5b 9d 00 04 sw (sp+4),ra 8005548: b8 40 58 00 mv r11,r2 if ((tty->termios.c_lflag & ECHOCTL) && 800554c: 28 42 00 3c lw r2,(r2+60) 8005550: 20 42 02 00 andi r2,r2,0x200 8005554: 44 40 00 19 be r2,r0,80055b8 <== NEVER TAKEN iscntrl(c) && (c != '\t') && (c != '\n')) { 8005558: 78 02 08 02 mvhi r2,0x802 800555c: 38 42 12 cc ori r2,r2,0x12cc 8005560: 28 42 00 00 lw r2,(r2+0) 8005564: 7c 23 00 09 cmpnei r3,r1,9 8005568: b4 41 10 00 add r2,r2,r1 800556c: 40 42 00 01 lbu r2,(r2+1) 8005570: 20 42 00 20 andi r2,r2,0x20 * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { if ((tty->termios.c_lflag & ECHOCTL) && 8005574: 7c 42 00 00 cmpnei r2,r2,0 iscntrl(c) && (c != '\t') && (c != '\n')) { 8005578: a0 43 10 00 and r2,r2,r3 800557c: 44 40 00 0f be r2,r0,80055b8 8005580: 34 02 00 0a mvi r2,10 8005584: 44 22 00 0d be r1,r2,80055b8 char echobuf[2]; echobuf[0] = '^'; 8005588: 34 02 00 5e mvi r2,94 echobuf[1] = c ^ 0x40; 800558c: 18 21 00 40 xori r1,r1,0x40 { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { char echobuf[2]; echobuf[0] = '^'; 8005590: 33 82 00 0c sb (sp+12),r2 echobuf[1] = c ^ 0x40; 8005594: 33 81 00 0d sb (sp+13),r1 rtems_termios_puts (echobuf, 2, tty); 8005598: 34 02 00 02 mvi r2,2 800559c: 37 81 00 0c addi r1,sp,12 80055a0: b9 60 18 00 mv r3,r11 80055a4: fb ff ff 34 calli 8005274 tty->column += 2; 80055a8: 29 61 00 28 lw r1,(r11+40) 80055ac: 34 21 00 02 addi r1,r1,2 80055b0: 59 61 00 28 sw (r11+40),r1 */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { 80055b4: e0 00 00 03 bi 80055c0 echobuf[0] = '^'; echobuf[1] = c ^ 0x40; rtems_termios_puts (echobuf, 2, tty); tty->column += 2; } else { oproc (c, tty); 80055b8: b9 60 10 00 mv r2,r11 80055bc: fb ff ff 84 calli 80053cc } } 80055c0: 2b 9d 00 04 lw ra,(sp+4) 80055c4: 2b 8b 00 08 lw r11,(sp+8) 80055c8: 37 9c 00 0c addi sp,sp,12 80055cc: c3 a0 00 00 ret =============================================================================== 08002744 : void endgrent(void) { 8002744: 37 9c ff fc addi sp,sp,-4 8002748: 5b 9d 00 04 sw (sp+4),ra if (group_fp != NULL) 800274c: 78 01 08 01 mvhi r1,0x801 8002750: 38 21 56 38 ori r1,r1,0x5638 8002754: 28 21 00 00 lw r1,(r1+0) 8002758: 44 20 00 02 be r1,r0,8002760 <== NEVER TAKEN fclose(group_fp); 800275c: f8 00 27 a7 calli 800c5f8 } 8002760: 2b 9d 00 04 lw ra,(sp+4) 8002764: 37 9c 00 04 addi sp,sp,4 8002768: c3 a0 00 00 ret =============================================================================== 0800257c : void endpwent(void) { 800257c: 37 9c ff fc addi sp,sp,-4 8002580: 5b 9d 00 04 sw (sp+4),ra if (passwd_fp != NULL) 8002584: 78 01 08 01 mvhi r1,0x801 8002588: 38 21 57 14 ori r1,r1,0x5714 800258c: 28 21 00 00 lw r1,(r1+0) 8002590: 44 20 00 02 be r1,r0,8002598 <== NEVER TAKEN fclose(passwd_fp); 8002594: f8 00 28 19 calli 800c5f8 } 8002598: 2b 9d 00 04 lw ra,(sp+4) 800259c: 37 9c 00 04 addi sp,sp,4 80025a0: c3 a0 00 00 ret =============================================================================== 080055d0 : * FIXME: Needs support for WERASE and ECHOPRT. * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { 80055d0: 37 9c ff e0 addi sp,sp,-32 80055d4: 5b 8b 00 20 sw (sp+32),r11 80055d8: 5b 8c 00 1c sw (sp+28),r12 80055dc: 5b 8d 00 18 sw (sp+24),r13 80055e0: 5b 8e 00 14 sw (sp+20),r14 80055e4: 5b 8f 00 10 sw (sp+16),r15 80055e8: 5b 90 00 0c sw (sp+12),r16 80055ec: 5b 91 00 08 sw (sp+8),r17 80055f0: 5b 9d 00 04 sw (sp+4),ra 80055f4: b8 20 58 00 mv r11,r1 if (tty->ccount == 0) 80055f8: 28 21 00 20 lw r1,(r1+32) * FIXME: Needs support for WERASE and ECHOPRT. * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { 80055fc: b8 40 78 00 mv r15,r2 if (tty->ccount == 0) 8005600: 44 20 00 6c be r1,r0,80057b0 return; if (lineFlag) { 8005604: 44 40 00 62 be r2,r0,800578c if (!(tty->termios.c_lflag & ECHO)) { 8005608: 29 6c 00 3c lw r12,(r11+60) 800560c: 21 81 00 08 andi r1,r12,0x8 8005610: 5c 20 00 03 bne r1,r0,800561c <== ALWAYS TAKEN tty->ccount = 0; 8005614: 59 60 00 20 sw (r11+32),r0 <== NOT EXECUTED return; 8005618: e0 00 00 66 bi 80057b0 <== NOT EXECUTED } if (!(tty->termios.c_lflag & ECHOE)) { 800561c: 21 8c 00 10 andi r12,r12,0x10 8005620: 5d 80 00 5b bne r12,r0,800578c <== ALWAYS TAKEN tty->ccount = 0; echo (tty->termios.c_cc[VKILL], tty); 8005624: 41 61 00 44 lbu r1,(r11+68) <== NOT EXECUTED if (!(tty->termios.c_lflag & ECHO)) { tty->ccount = 0; return; } if (!(tty->termios.c_lflag & ECHOE)) { tty->ccount = 0; 8005628: 59 60 00 20 sw (r11+32),r0 <== NOT EXECUTED echo (tty->termios.c_cc[VKILL], tty); 800562c: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8005630: fb ff ff c3 calli 800553c <== NOT EXECUTED if (tty->termios.c_lflag & ECHOK) 8005634: 29 61 00 3c lw r1,(r11+60) <== NOT EXECUTED 8005638: 20 21 00 20 andi r1,r1,0x20 <== NOT EXECUTED 800563c: 44 2c 00 5d be r1,r12,80057b0 <== NOT EXECUTED echo ('\n', tty); 8005640: 34 01 00 0a mvi r1,10 <== NOT EXECUTED 8005644: e0 00 00 0d bi 8005678 <== NOT EXECUTED return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 8005648: 29 64 00 1c lw r4,(r11+28) 800564c: 34 21 ff ff addi r1,r1,-1 8005650: 59 61 00 20 sw (r11+32),r1 8005654: b4 81 10 00 add r2,r4,r1 8005658: 40 4c 00 00 lbu r12,(r2+0) if (tty->termios.c_lflag & ECHO) { 800565c: 29 62 00 3c lw r2,(r11+60) 8005660: 20 43 00 08 andi r3,r2,0x8 8005664: 44 60 00 48 be r3,r0,8005784 <== NEVER TAKEN if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { 8005668: 5d e0 00 07 bne r15,r0,8005684 800566c: 20 43 00 10 andi r3,r2,0x10 8005670: 5c 6f 00 05 bne r3,r15,8005684 <== ALWAYS TAKEN echo (tty->termios.c_cc[VERASE], tty); 8005674: 41 61 00 43 lbu r1,(r11+67) <== NOT EXECUTED 8005678: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 800567c: fb ff ff b0 calli 800553c <== NOT EXECUTED 8005680: e0 00 00 4c bi 80057b0 <== NOT EXECUTED } else if (c == '\t') { 8005684: 5d 91 00 20 bne r12,r17,8005704 int col = tty->read_start_column; 8005688: 29 6c 00 2c lw r12,(r11+44) */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { 800568c: 29 a6 00 00 lw r6,(r13+0) if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { echo (tty->termios.c_cc[VERASE], tty); } else if (c == '\t') { int col = tty->read_start_column; int i = 0; 8005690: 34 03 00 00 mvi r3,0 while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { if (tty->termios.c_lflag & ECHOCTL) 8005694: 20 42 02 00 andi r2,r2,0x200 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 8005698: e0 00 00 0f bi 80056d4 * Erase a character or line * FIXME: Needs support for WERASE and ECHOPRT. * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) 800569c: b4 83 28 00 add r5,r4,r3 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; 80056a0: 40 a5 00 00 lbu r5,(r5+0) 80056a4: 34 63 00 01 addi r3,r3,1 if (c == '\t') { 80056a8: 5c b1 00 03 bne r5,r17,80056b4 col = (col | 7) + 1; 80056ac: 39 8c 00 07 ori r12,r12,0x7 80056b0: e0 00 00 08 bi 80056d0 } else if (iscntrl (c)) { 80056b4: b4 c5 28 00 add r5,r6,r5 80056b8: 40 a5 00 01 lbu r5,(r5+1) 80056bc: 20 a5 00 20 andi r5,r5,0x20 80056c0: 44 a0 00 04 be r5,r0,80056d0 <== ALWAYS TAKEN if (tty->termios.c_lflag & ECHOCTL) 80056c4: 44 40 00 04 be r2,r0,80056d4 <== NOT EXECUTED col += 2; 80056c8: 35 8c 00 02 addi r12,r12,2 <== NOT EXECUTED 80056cc: e0 00 00 02 bi 80056d4 <== NOT EXECUTED } else { col++; 80056d0: 35 8c 00 01 addi r12,r12,1 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 80056d4: 5c 61 ff f2 bne r3,r1,800569c 80056d8: e0 00 00 08 bi 80056f8 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 80056dc: ba 00 08 00 mv r1,r16 80056e0: 34 02 00 01 mvi r2,1 80056e4: b9 60 18 00 mv r3,r11 80056e8: fb ff fe e3 calli 8005274 tty->column--; 80056ec: 29 61 00 28 lw r1,(r11+40) 80056f0: 34 21 ff ff addi r1,r1,-1 80056f4: 59 61 00 28 sw (r11+40),r1 } /* * Back up over the tab */ while (tty->column > col) { 80056f8: 29 61 00 28 lw r1,(r11+40) 80056fc: 48 2c ff f8 bg r1,r12,80056dc 8005700: e0 00 00 21 bi 8005784 rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 8005704: 29 a1 00 00 lw r1,(r13+0) 8005708: 35 8c 00 01 addi r12,r12,1 800570c: b4 2c 08 00 add r1,r1,r12 8005710: 40 21 00 00 lbu r1,(r1+0) 8005714: 20 21 00 20 andi r1,r1,0x20 8005718: 44 20 00 0b be r1,r0,8005744 <== ALWAYS TAKEN 800571c: 20 42 02 00 andi r2,r2,0x200 <== NOT EXECUTED 8005720: 44 40 00 09 be r2,r0,8005744 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 8005724: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 8005728: 34 02 00 03 mvi r2,3 <== NOT EXECUTED 800572c: b9 60 18 00 mv r3,r11 <== NOT EXECUTED 8005730: fb ff fe d1 calli 8005274 <== NOT EXECUTED if (tty->column) 8005734: 29 61 00 28 lw r1,(r11+40) <== NOT EXECUTED 8005738: 44 20 00 03 be r1,r0,8005744 <== NOT EXECUTED tty->column--; 800573c: 34 21 ff ff addi r1,r1,-1 <== NOT EXECUTED 8005740: 59 61 00 28 sw (r11+40),r1 <== NOT EXECUTED } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { 8005744: 29 a1 00 00 lw r1,(r13+0) 8005748: b4 2c 60 00 add r12,r1,r12 800574c: 41 81 00 00 lbu r1,(r12+0) 8005750: 20 21 00 20 andi r1,r1,0x20 8005754: 44 20 00 04 be r1,r0,8005764 <== ALWAYS TAKEN 8005758: 29 61 00 3c lw r1,(r11+60) <== NOT EXECUTED 800575c: 20 21 02 00 andi r1,r1,0x200 <== NOT EXECUTED 8005760: 44 20 00 09 be r1,r0,8005784 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 8005764: b9 c0 08 00 mv r1,r14 8005768: 34 02 00 03 mvi r2,3 800576c: b9 60 18 00 mv r3,r11 8005770: fb ff fe c1 calli 8005274 if (tty->column) 8005774: 29 61 00 28 lw r1,(r11+40) 8005778: 44 20 00 03 be r1,r0,8005784 <== NEVER TAKEN tty->column--; 800577c: 34 21 ff ff addi r1,r1,-1 8005780: 59 61 00 28 sw (r11+40),r1 } } } if (!lineFlag) 8005784: 5d e0 00 09 bne r15,r0,80057a8 8005788: e0 00 00 0a bi 80057b0 800578c: 78 0d 08 02 mvhi r13,0x802 rtems_termios_puts ("\b \b", 3, tty); if (tty->column) tty->column--; } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); 8005790: 78 0e 08 01 mvhi r14,0x801 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 8005794: 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') { 8005798: 34 11 00 09 mvi r17,9 800579c: 39 ad 12 cc ori r13,r13,0x12cc rtems_termios_puts ("\b \b", 3, tty); if (tty->column) tty->column--; } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); 80057a0: 39 ce f3 64 ori r14,r14,0xf364 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 80057a4: 3a 10 f3 60 ori r16,r16,0xf360 echo ('\n', tty); return; } } while (tty->ccount) { 80057a8: 29 61 00 20 lw r1,(r11+32) 80057ac: 5c 20 ff a7 bne r1,r0,8005648 } } if (!lineFlag) break; } } 80057b0: 2b 9d 00 04 lw ra,(sp+4) 80057b4: 2b 8b 00 20 lw r11,(sp+32) 80057b8: 2b 8c 00 1c lw r12,(sp+28) 80057bc: 2b 8d 00 18 lw r13,(sp+24) 80057c0: 2b 8e 00 14 lw r14,(sp+20) 80057c4: 2b 8f 00 10 lw r15,(sp+16) 80057c8: 2b 90 00 0c lw r16,(sp+12) 80057cc: 2b 91 00 08 lw r17,(sp+8) 80057d0: 37 9c 00 20 addi sp,sp,32 80057d4: c3 a0 00 00 ret =============================================================================== 08001e50 : int fcntl( int fd, int cmd, ... ) { 8001e50: 37 9c ff c4 addi sp,sp,-60 8001e54: 5b 8b 00 20 sw (sp+32),r11 8001e58: 5b 8c 00 1c sw (sp+28),r12 8001e5c: 5b 8d 00 18 sw (sp+24),r13 8001e60: 5b 8e 00 14 sw (sp+20),r14 8001e64: 5b 8f 00 10 sw (sp+16),r15 8001e68: 5b 90 00 0c sw (sp+12),r16 8001e6c: 5b 91 00 08 sw (sp+8),r17 8001e70: 5b 9d 00 04 sw (sp+4),ra 8001e74: 5b 82 00 24 sw (sp+36),r2 8001e78: b8 40 68 00 mv r13,r2 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 8001e7c: 78 02 08 01 mvhi r2,0x801 int fcntl( int fd, int cmd, ... ) { 8001e80: 5b 83 00 28 sw (sp+40),r3 8001e84: 5b 84 00 2c sw (sp+44),r4 8001e88: 5b 85 00 30 sw (sp+48),r5 8001e8c: 5b 86 00 34 sw (sp+52),r6 8001e90: 5b 87 00 38 sw (sp+56),r7 8001e94: 5b 88 00 3c sw (sp+60),r8 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 8001e98: 38 42 50 10 ori r2,r2,0x5010 8001e9c: 28 51 00 00 lw r17,(r2+0) ... ) { int ret; va_list ap; va_start( ap, cmd ); 8001ea0: 37 8e 00 28 addi r14,sp,40 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 8001ea4: 56 21 00 02 bgu r17,r1,8001eac 8001ea8: e0 00 00 0a bi 8001ed0 iop = rtems_libio_iop( fd ); 8001eac: 78 02 08 01 mvhi r2,0x801 8001eb0: 38 42 56 a0 ori r2,r2,0x56a0 8001eb4: 28 50 00 00 lw r16,(r2+0) 8001eb8: 34 02 00 06 mvi r2,6 8001ebc: f8 00 41 91 calli 8012500 <__ashlsi3> 8001ec0: b6 01 58 00 add r11,r16,r1 rtems_libio_check_is_open(iop); 8001ec4: 29 6c 00 18 lw r12,(r11+24) 8001ec8: 21 81 01 00 andi r1,r12,0x100 8001ecc: 5c 20 00 04 bne r1,r0,8001edc 8001ed0: f8 00 29 93 calli 800c51c <__errno> 8001ed4: 34 02 00 09 mvi r2,9 8001ed8: e0 00 00 49 bi 8001ffc /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 8001edc: 34 01 00 09 mvi r1,9 8001ee0: 55 a1 00 45 bgu r13,r1,8001ff4 8001ee4: 78 0f 08 01 mvhi r15,0x801 8001ee8: b9 a0 08 00 mv r1,r13 8001eec: 34 02 00 02 mvi r2,2 8001ef0: f8 00 41 84 calli 8012500 <__ashlsi3> 8001ef4: 39 ef 37 50 ori r15,r15,0x3750 8001ef8: b5 e1 08 00 add r1,r15,r1 8001efc: 28 21 00 00 lw r1,(r1+0) 8001f00: c0 20 00 00 b r1 case F_DUPFD: /* dup */ fd2 = va_arg( ap, int ); 8001f04: 29 cc 00 00 lw r12,(r14+0) if ( fd2 ) 8001f08: 45 80 00 08 be r12,r0,8001f28 <== ALWAYS TAKEN diop = rtems_libio_iop( fd2 ); 8001f0c: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 8001f10: 51 91 00 09 bgeu r12,r17,8001f34 <== NOT EXECUTED 8001f14: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8001f18: 34 02 00 06 mvi r2,6 <== NOT EXECUTED 8001f1c: f8 00 41 79 calli 8012500 <__ashlsi3> <== NOT EXECUTED 8001f20: b6 01 18 00 add r3,r16,r1 <== NOT EXECUTED 8001f24: e0 00 00 04 bi 8001f34 <== NOT EXECUTED else { /* allocate a file control block */ diop = rtems_libio_allocate(); 8001f28: f8 00 01 e6 calli 80026c0 8001f2c: b8 20 18 00 mv r3,r1 if ( diop == 0 ) { 8001f30: 44 2c 00 3e be r1,r12,8002028 <== NEVER TAKEN ret = -1; break; } } diop->flags = iop->flags; 8001f34: 29 61 00 18 lw r1,(r11+24) diop->pathinfo = iop->pathinfo; 8001f38: 29 62 00 28 lw r2,(r11+40) 8001f3c: 29 66 00 1c lw r6,(r11+28) ret = -1; break; } } diop->flags = iop->flags; 8001f40: 58 61 00 18 sw (r3+24),r1 diop->pathinfo = iop->pathinfo; 8001f44: 29 61 00 2c lw r1,(r11+44) 8001f48: 29 65 00 20 lw r5,(r11+32) 8001f4c: 29 64 00 24 lw r4,(r11+36) 8001f50: 58 61 00 2c sw (r3+44),r1 ret = (int) (diop - rtems_libio_iops); 8001f54: 78 01 08 01 mvhi r1,0x801 8001f58: 38 21 56 a0 ori r1,r1,0x56a0 8001f5c: 28 21 00 00 lw r1,(r1+0) break; } } diop->flags = iop->flags; diop->pathinfo = iop->pathinfo; 8001f60: 58 62 00 28 sw (r3+40),r2 8001f64: 58 66 00 1c sw (r3+28),r6 8001f68: 58 65 00 20 sw (r3+32),r5 8001f6c: 58 64 00 24 sw (r3+36),r4 ret = (int) (diop - rtems_libio_iops); 8001f70: c8 61 08 00 sub r1,r3,r1 8001f74: 34 02 00 06 mvi r2,6 8001f78: f8 00 41 89 calli 801259c <__ashrsi3> 8001f7c: e0 00 00 0e bi 8001fb4 break; case F_GETFD: /* get f_flags */ ret = ((iop->flags & LIBIO_FLAGS_CLOSE_ON_EXEC) != 0); 8001f80: 21 8c 08 00 andi r12,r12,0x800 8001f84: 7d 8c 00 00 cmpnei r12,r12,0 8001f88: e0 00 00 1f bi 8002004 * if a new process is exec()'ed. Since RTEMS does not support * processes, then we can ignore this one except to make * F_GETFD work. */ if ( va_arg( ap, int ) ) 8001f8c: 29 c1 00 00 lw r1,(r14+0) 8001f90: 44 20 00 03 be r1,r0,8001f9c <== NEVER TAKEN iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 8001f94: 39 8c 08 00 ori r12,r12,0x800 8001f98: e0 00 00 03 bi 8001fa4 else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 8001f9c: 34 01 f7 ff mvi r1,-2049 <== NOT EXECUTED 8001fa0: a1 81 60 00 and r12,r12,r1 <== NOT EXECUTED 8001fa4: 59 6c 00 18 sw (r11+24),r12 8001fa8: e0 00 00 0e bi 8001fe0 break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); 8001fac: b9 80 08 00 mv r1,r12 8001fb0: f8 00 01 b0 calli 8002670 8001fb4: b8 20 60 00 mv r12,r1 /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 8001fb8: 48 01 00 1d bg r0,r1,800202c <== NEVER TAKEN 8001fbc: e0 00 00 12 bi 8002004 case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 8001fc0: 29 c1 00 00 lw r1,(r14+0) 8001fc4: f8 00 01 95 calli 8002618 /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); 8001fc8: 29 63 00 18 lw r3,(r11+24) 8001fcc: 34 02 fd fe mvi r2,-514 8001fd0: 20 21 02 01 andi r1,r1,0x201 8001fd4: a0 43 10 00 and r2,r2,r3 8001fd8: b8 22 08 00 or r1,r1,r2 8001fdc: 59 61 00 18 sw (r11+24),r1 rtems_libio_t *iop; rtems_libio_t *diop; int fd2; int flags; int mask; int ret = 0; 8001fe0: 34 0c 00 00 mvi r12,0 8001fe4: e0 00 00 08 bi 8002004 errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 8001fe8: f8 00 29 4d calli 800c51c <__errno> 8001fec: 34 02 00 86 mvi r2,134 8001ff0: e0 00 00 03 bi 8001ffc ret = -1; break; default: errno = EINVAL; 8001ff4: f8 00 29 4a calli 800c51c <__errno> 8001ff8: 34 02 00 16 mvi r2,22 8001ffc: 58 22 00 00 sw (r1+0),r2 8002000: e0 00 00 0a bi 8002028 * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { int err = (*iop->pathinfo.handlers->fcntl_h)( cmd, iop ); 8002004: 29 61 00 24 lw r1,(r11+36) 8002008: b9 60 10 00 mv r2,r11 800200c: 28 23 00 30 lw r3,(r1+48) 8002010: b9 a0 08 00 mv r1,r13 8002014: d8 60 00 00 call r3 8002018: b8 20 58 00 mv r11,r1 if (err) { 800201c: 44 20 00 04 be r1,r0,800202c <== ALWAYS TAKEN errno = err; 8002020: f8 00 29 3f calli 800c51c <__errno> <== NOT EXECUTED 8002024: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED ret = -1; 8002028: 34 0c ff ff mvi r12,-1 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 800202c: b9 80 08 00 mv r1,r12 8002030: 2b 9d 00 04 lw ra,(sp+4) 8002034: 2b 8b 00 20 lw r11,(sp+32) 8002038: 2b 8c 00 1c lw r12,(sp+28) 800203c: 2b 8d 00 18 lw r13,(sp+24) 8002040: 2b 8e 00 14 lw r14,(sp+20) 8002044: 2b 8f 00 10 lw r15,(sp+16) 8002048: 2b 90 00 0c lw r16,(sp+12) 800204c: 2b 91 00 08 lw r17,(sp+8) 8002050: 37 9c 00 3c addi sp,sp,60 8002054: c3 a0 00 00 ret =============================================================================== 08009818 : */ int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 8009818: 37 9c ff e0 addi sp,sp,-32 800981c: 5b 8b 00 1c sw (sp+28),r11 8009820: 5b 8c 00 18 sw (sp+24),r12 8009824: 5b 8d 00 14 sw (sp+20),r13 8009828: 5b 8e 00 10 sw (sp+16),r14 800982c: 5b 8f 00 0c sw (sp+12),r15 8009830: 5b 90 00 08 sw (sp+8),r16 8009834: 5b 9d 00 04 sw (sp+4),ra 8009838: b8 20 78 00 mv r15,r1 800983c: b8 40 70 00 mv r14,r2 ) { pipe_control_t *pipe; int err = 0; err = pipe_lock(); 8009840: fb ff ff 64 calli 80095d0 8009844: b8 20 60 00 mv r12,r1 if (err) 8009848: 5c 20 00 b8 bne r1,r0,8009b28 return err; pipe = *pipep; 800984c: 29 eb 00 00 lw r11,(r15+0) if (pipe == NULL) { 8009850: 5d 61 00 41 bne r11,r1,8009954 { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); 8009854: 34 01 00 34 mvi r1,52 8009858: fb ff e5 e1 calli 8002fdc 800985c: b8 20 58 00 mv r11,r1 8009860: b8 20 80 00 mv r16,r1 if (pipe == NULL) 8009864: 44 20 00 3a be r1,r0,800994c return err; memset(pipe, 0, sizeof(pipe_control_t)); 8009868: 34 02 00 00 mvi r2,0 800986c: 34 03 00 34 mvi r3,52 8009870: f8 00 0f bb calli 800d75c pipe->Size = PIPE_BUF; 8009874: 34 01 02 00 mvi r1,512 8009878: 59 61 00 04 sw (r11+4),r1 pipe->Buffer = malloc(pipe->Size); 800987c: fb ff e5 d8 calli 8002fdc 8009880: 59 61 00 00 sw (r11+0),r1 if (! pipe->Buffer) 8009884: 44 20 00 30 be r1,r0,8009944 <== NEVER TAKEN goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), 8009888: 78 0d 08 01 mvhi r13,0x801 if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 800988c: 78 03 08 01 mvhi r3,0x801 8009890: 38 63 c9 b4 ori r3,r3,0xc9b4 rtems_build_name ('P', 'I', 'r', c), 8009894: 39 ad e1 20 ori r13,r13,0xe120 8009898: 41 a2 00 00 lbu r2,(r13+0) if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 800989c: 28 61 00 00 lw r1,(r3+0) 80098a0: 35 64 00 2c addi r4,r11,44 80098a4: 34 03 00 00 mvi r3,0 80098a8: b8 41 08 00 or r1,r2,r1 80098ac: 34 02 00 00 mvi r2,0 80098b0: f8 00 04 fe calli 800aca8 80098b4: 5c 20 00 22 bne r1,r0,800993c rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( 80098b8: 78 03 08 01 mvhi r3,0x801 80098bc: 38 63 c9 b8 ori r3,r3,0xc9b8 rtems_build_name ('P', 'I', 'w', c), 80098c0: 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( 80098c4: 28 61 00 00 lw r1,(r3+0) 80098c8: 35 64 00 30 addi r4,r11,48 80098cc: 34 03 00 00 mvi r3,0 80098d0: b8 41 08 00 or r1,r2,r1 80098d4: 34 02 00 00 mvi r2,0 80098d8: f8 00 04 f4 calli 800aca8 80098dc: 5c 20 00 16 bne r1,r0,8009934 rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( 80098e0: 78 03 08 01 mvhi r3,0x801 80098e4: 38 63 c9 bc ori r3,r3,0xc9bc rtems_build_name ('P', 'I', 's', c), 1, 80098e8: 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( 80098ec: 28 61 00 00 lw r1,(r3+0) 80098f0: 34 04 00 00 mvi r4,0 80098f4: 34 03 00 10 mvi r3,16 80098f8: b8 41 08 00 or r1,r2,r1 80098fc: 35 65 00 28 addi r5,r11,40 8009900: 34 02 00 01 mvi r2,1 8009904: fb ff ea 66 calli 800429c 8009908: 5c 20 00 09 bne r1,r0,800992c #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 800990c: 41 a1 00 00 lbu r1,(r13+0) 8009910: 34 22 00 01 addi r2,r1,1 8009914: 31 a2 00 00 sb (r13+0),r2 8009918: 34 02 00 7a mvi r2,122 800991c: 5c 22 00 0e bne r1,r2,8009954 c = 'a'; 8009920: 34 01 00 61 mvi r1,97 8009924: 31 a1 00 00 sb (r13+0),r1 8009928: e0 00 00 0b bi 8009954 return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); 800992c: 29 61 00 30 lw r1,(r11+48) 8009930: f8 00 05 1a calli 800ad98 err_wbar: rtems_barrier_delete(pipe->readBarrier); 8009934: 2a 01 00 2c lw r1,(r16+44) 8009938: f8 00 05 18 calli 800ad98 err_rbar: free(pipe->Buffer); 800993c: 2a 01 00 00 lw r1,(r16+0) 8009940: fb ff e3 ef calli 80028fc err_buf: free(pipe); 8009944: ba 00 08 00 mv r1,r16 8009948: fb ff e3 ed calli 80028fc if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; 800994c: 34 0c ff f4 mvi r12,-12 8009950: e0 00 00 0e bi 8009988 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 8009954: 29 61 00 28 lw r1,(r11+40) 8009958: 34 02 00 00 mvi r2,0 800995c: 34 03 00 00 mvi r3,0 8009960: fb ff ea fb calli 800454c 8009964: 44 20 00 02 be r1,r0,800996c <== ALWAYS TAKEN err = -EINTR; 8009968: 34 0c ff fc mvi r12,-4 <== NOT EXECUTED if (*pipep == NULL) { 800996c: 29 e1 00 00 lw r1,(r15+0) 8009970: 5c 20 00 06 bne r1,r0,8009988 if (err) 8009974: 45 81 00 04 be r12,r1,8009984 <== ALWAYS TAKEN pipe_free(pipe); 8009978: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 800997c: fb ff ff 44 calli 800968c <== NOT EXECUTED 8009980: e0 00 00 02 bi 8009988 <== NOT EXECUTED else *pipep = pipe; 8009984: 59 eb 00 00 sw (r15+0),r11 } out: pipe_unlock(); 8009988: fb ff ff 53 calli 80096d4 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) 800998c: 5d 80 00 67 bne r12,r0,8009b28 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { 8009990: 29 c1 00 18 lw r1,(r14+24) 8009994: 34 02 00 04 mvi r2,4 int err; err = pipe_new(pipep); if (err) return err; pipe = *pipep; 8009998: 29 eb 00 00 lw r11,(r15+0) switch (LIBIO_ACCMODE(iop)) { 800999c: 20 21 00 06 andi r1,r1,0x6 80099a0: 44 22 00 24 be r1,r2,8009a30 80099a4: 34 02 00 06 mvi r2,6 80099a8: 44 22 00 45 be r1,r2,8009abc 80099ac: 34 02 00 02 mvi r2,2 80099b0: 5c 22 00 57 bne r1,r2,8009b0c <== NEVER TAKEN case LIBIO_FLAGS_READ: pipe->readerCounter ++; 80099b4: 29 61 00 20 lw r1,(r11+32) 80099b8: 34 21 00 01 addi r1,r1,1 80099bc: 59 61 00 20 sw (r11+32),r1 if (pipe->Readers ++ == 0) 80099c0: 29 61 00 10 lw r1,(r11+16) 80099c4: 34 22 00 01 addi r2,r1,1 80099c8: 59 62 00 10 sw (r11+16),r2 80099cc: 5c 20 00 04 bne r1,r0,80099dc <== NEVER TAKEN PIPE_WAKEUPWRITERS(pipe); 80099d0: 29 61 00 30 lw r1,(r11+48) 80099d4: 37 82 00 20 addi r2,sp,32 80099d8: f8 00 05 20 calli 800ae58 if (pipe->Writers == 0) { 80099dc: 29 61 00 14 lw r1,(r11+20) 80099e0: 5c 20 00 4b bne r1,r0,8009b0c /* Not an error */ if (LIBIO_NODELAY(iop)) 80099e4: 29 c2 00 18 lw r2,(r14+24) 80099e8: 20 42 00 01 andi r2,r2,0x1 80099ec: 5c 41 00 48 bne r2,r1,8009b0c break; prevCounter = pipe->writerCounter; 80099f0: 29 70 00 24 lw r16,(r11+36) err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); 80099f4: 29 61 00 28 lw r1,(r11+40) 80099f8: fb ff eb 25 calli 800468c if (! PIPE_READWAIT(pipe)) 80099fc: 29 61 00 2c lw r1,(r11+44) 8009a00: 34 02 00 00 mvi r2,0 8009a04: f8 00 05 32 calli 800aecc 8009a08: b8 20 68 00 mv r13,r1 8009a0c: 5c 20 00 43 bne r1,r0,8009b18 <== NEVER TAKEN goto out_error; if (! PIPE_LOCK(pipe)) 8009a10: 29 61 00 28 lw r1,(r11+40) 8009a14: 34 02 00 00 mvi r2,0 8009a18: 34 03 00 00 mvi r3,0 8009a1c: fb ff ea cc calli 800454c 8009a20: 5c 2d 00 3e bne r1,r13,8009b18 <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->writerCounter); 8009a24: 29 61 00 24 lw r1,(r11+36) 8009a28: 46 01 ff f3 be r16,r1,80099f4 <== NEVER TAKEN 8009a2c: e0 00 00 38 bi 8009b0c } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 8009a30: 29 61 00 24 lw r1,(r11+36) 8009a34: 34 21 00 01 addi r1,r1,1 8009a38: 59 61 00 24 sw (r11+36),r1 if (pipe->Writers ++ == 0) 8009a3c: 29 61 00 14 lw r1,(r11+20) 8009a40: 34 22 00 01 addi r2,r1,1 8009a44: 59 62 00 14 sw (r11+20),r2 8009a48: 5c 20 00 04 bne r1,r0,8009a58 <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); 8009a4c: 29 61 00 2c lw r1,(r11+44) 8009a50: 37 82 00 20 addi r2,sp,32 8009a54: f8 00 05 01 calli 800ae58 if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { 8009a58: 29 61 00 10 lw r1,(r11+16) 8009a5c: 5c 20 00 2c bne r1,r0,8009b0c 8009a60: 29 c2 00 18 lw r2,(r14+24) 8009a64: 20 42 00 01 andi r2,r2,0x1 8009a68: 44 41 00 05 be r2,r1,8009a7c PIPE_UNLOCK(pipe); 8009a6c: 29 61 00 28 lw r1,(r11+40) err = -ENXIO; 8009a70: 34 0c ff fa mvi r12,-6 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { PIPE_UNLOCK(pipe); 8009a74: fb ff eb 06 calli 800468c err = -ENXIO; goto out_error; 8009a78: e0 00 00 29 bi 8009b1c } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; 8009a7c: 29 70 00 20 lw r16,(r11+32) err = -EINTR; do { PIPE_UNLOCK(pipe); 8009a80: 29 61 00 28 lw r1,(r11+40) 8009a84: fb ff eb 02 calli 800468c if (! PIPE_WRITEWAIT(pipe)) 8009a88: 29 61 00 30 lw r1,(r11+48) 8009a8c: 34 02 00 00 mvi r2,0 8009a90: f8 00 05 0f calli 800aecc 8009a94: b8 20 68 00 mv r13,r1 8009a98: 5c 20 00 20 bne r1,r0,8009b18 <== NEVER TAKEN goto out_error; if (! PIPE_LOCK(pipe)) 8009a9c: 29 61 00 28 lw r1,(r11+40) 8009aa0: 34 02 00 00 mvi r2,0 8009aa4: 34 03 00 00 mvi r3,0 8009aa8: fb ff ea a9 calli 800454c 8009aac: 5c 2d 00 1b bne r1,r13,8009b18 <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->readerCounter); 8009ab0: 29 61 00 20 lw r1,(r11+32) 8009ab4: 46 01 ff f3 be r16,r1,8009a80 <== NEVER TAKEN 8009ab8: e0 00 00 15 bi 8009b0c } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 8009abc: 29 61 00 20 lw r1,(r11+32) 8009ac0: 34 21 00 01 addi r1,r1,1 8009ac4: 59 61 00 20 sw (r11+32),r1 if (pipe->Readers ++ == 0) 8009ac8: 29 61 00 10 lw r1,(r11+16) 8009acc: 34 22 00 01 addi r2,r1,1 8009ad0: 59 62 00 10 sw (r11+16),r2 8009ad4: 5c 20 00 04 bne r1,r0,8009ae4 <== NEVER TAKEN PIPE_WAKEUPWRITERS(pipe); 8009ad8: 29 61 00 30 lw r1,(r11+48) 8009adc: 37 82 00 20 addi r2,sp,32 8009ae0: f8 00 04 de calli 800ae58 pipe->writerCounter ++; 8009ae4: 29 61 00 24 lw r1,(r11+36) 8009ae8: 34 21 00 01 addi r1,r1,1 8009aec: 59 61 00 24 sw (r11+36),r1 if (pipe->Writers ++ == 0) 8009af0: 29 61 00 14 lw r1,(r11+20) 8009af4: 34 22 00 01 addi r2,r1,1 8009af8: 59 62 00 14 sw (r11+20),r2 8009afc: 5c 20 00 04 bne r1,r0,8009b0c <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); 8009b00: 29 61 00 2c lw r1,(r11+44) 8009b04: 37 82 00 20 addi r2,sp,32 8009b08: f8 00 04 d4 calli 800ae58 break; } PIPE_UNLOCK(pipe); 8009b0c: 29 61 00 28 lw r1,(r11+40) 8009b10: fb ff ea df calli 800468c return 0; 8009b14: e0 00 00 05 bi 8009b28 goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; 8009b18: 34 0c ff fc mvi r12,-4 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); 8009b1c: b9 e0 08 00 mv r1,r15 8009b20: b9 c0 10 00 mv r2,r14 8009b24: fb ff fe fa calli 800970c return err; } 8009b28: b9 80 08 00 mv r1,r12 8009b2c: 2b 9d 00 04 lw ra,(sp+4) 8009b30: 2b 8b 00 1c lw r11,(sp+28) 8009b34: 2b 8c 00 18 lw r12,(sp+24) 8009b38: 2b 8d 00 14 lw r13,(sp+20) 8009b3c: 2b 8e 00 10 lw r14,(sp+16) 8009b40: 2b 8f 00 0c lw r15,(sp+12) 8009b44: 2b 90 00 08 lw r16,(sp+8) 8009b48: 37 9c 00 20 addi sp,sp,32 8009b4c: c3 a0 00 00 ret =============================================================================== 08002104 : long fpathconf( int fd, int name ) { 8002104: 37 9c ff f0 addi sp,sp,-16 8002108: 5b 8b 00 10 sw (sp+16),r11 800210c: 5b 8c 00 0c sw (sp+12),r12 8002110: 5b 8d 00 08 sw (sp+8),r13 8002114: 5b 9d 00 04 sw (sp+4),ra long return_value; rtems_libio_t *iop; rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); 8002118: 78 03 08 01 mvhi r3,0x801 800211c: 38 63 50 10 ori r3,r3,0x5010 long fpathconf( int fd, int name ) { 8002120: b8 40 68 00 mv r13,r2 long return_value; rtems_libio_t *iop; rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); 8002124: 28 62 00 00 lw r2,(r3+0) 8002128: 54 41 00 02 bgu r2,r1,8002130 800212c: e0 00 00 0a bi 8002154 iop = rtems_libio_iop(fd); 8002130: 34 02 00 06 mvi r2,6 8002134: 78 0b 08 01 mvhi r11,0x801 8002138: f8 00 40 f2 calli 8012500 <__ashlsi3> 800213c: 39 6b 56 a0 ori r11,r11,0x56a0 8002140: 29 63 00 00 lw r3,(r11+0) 8002144: b4 61 18 00 add r3,r3,r1 rtems_libio_check_is_open(iop); 8002148: 28 61 00 18 lw r1,(r3+24) 800214c: 20 22 01 00 andi r2,r1,0x100 8002150: 5c 40 00 04 bne r2,r0,8002160 <== ALWAYS TAKEN 8002154: f8 00 28 f2 calli 800c51c <__errno> 8002158: 34 02 00 09 mvi r2,9 800215c: e0 00 00 28 bi 80021fc rtems_libio_check_permissions(iop, LIBIO_FLAGS_READ); 8002160: 20 21 00 02 andi r1,r1,0x2 8002164: 44 20 00 24 be r1,r0,80021f4 <== NEVER TAKEN * Now process the information request. */ the_limits = &iop->pathinfo.mt_entry->pathconf_limits_and_options; switch ( name ) { 8002168: 34 01 00 0b mvi r1,11 /* * Now process the information request. */ the_limits = &iop->pathinfo.mt_entry->pathconf_limits_and_options; 800216c: 28 6b 00 2c lw r11,(r3+44) switch ( name ) { 8002170: 55 a1 00 21 bgu r13,r1,80021f4 8002174: 78 0c 08 01 mvhi r12,0x801 8002178: b9 a0 08 00 mv r1,r13 800217c: 34 02 00 02 mvi r2,2 8002180: f8 00 40 e0 calli 8012500 <__ashlsi3> 8002184: 39 8c 37 78 ori r12,r12,0x3778 8002188: b5 81 08 00 add r1,r12,r1 800218c: 28 21 00 00 lw r1,(r1+0) 8002190: c0 20 00 00 b r1 case _PC_LINK_MAX: return_value = the_limits->link_max; 8002194: 29 61 00 38 lw r1,(r11+56) break; 8002198: e0 00 00 1b bi 8002204 case _PC_MAX_CANON: return_value = the_limits->max_canon; 800219c: 29 61 00 3c lw r1,(r11+60) break; 80021a0: e0 00 00 19 bi 8002204 case _PC_MAX_INPUT: return_value = the_limits->max_input; 80021a4: 29 61 00 40 lw r1,(r11+64) break; 80021a8: e0 00 00 17 bi 8002204 case _PC_NAME_MAX: return_value = the_limits->name_max; 80021ac: 29 61 00 44 lw r1,(r11+68) break; 80021b0: e0 00 00 15 bi 8002204 case _PC_PATH_MAX: return_value = the_limits->path_max; 80021b4: 29 61 00 48 lw r1,(r11+72) break; 80021b8: e0 00 00 13 bi 8002204 case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 80021bc: 29 61 00 4c lw r1,(r11+76) break; 80021c0: e0 00 00 11 bi 8002204 case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 80021c4: 29 61 00 54 lw r1,(r11+84) break; 80021c8: e0 00 00 0f bi 8002204 case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 80021cc: 29 61 00 58 lw r1,(r11+88) break; 80021d0: e0 00 00 0d bi 8002204 case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 80021d4: 29 61 00 64 lw r1,(r11+100) break; 80021d8: e0 00 00 0b bi 8002204 case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 80021dc: 29 61 00 50 lw r1,(r11+80) break; 80021e0: e0 00 00 09 bi 8002204 case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 80021e4: 29 61 00 5c lw r1,(r11+92) break; 80021e8: e0 00 00 07 bi 8002204 case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 80021ec: 29 61 00 60 lw r1,(r11+96) break; 80021f0: e0 00 00 05 bi 8002204 default: rtems_set_errno_and_return_minus_one( EINVAL ); 80021f4: f8 00 28 ca calli 800c51c <__errno> 80021f8: 34 02 00 16 mvi r2,22 80021fc: 58 22 00 00 sw (r1+0),r2 8002200: 34 01 ff ff mvi r1,-1 break; } return return_value; } 8002204: 2b 9d 00 04 lw ra,(sp+4) 8002208: 2b 8b 00 10 lw r11,(sp+16) 800220c: 2b 8c 00 0c lw r12,(sp+12) 8002210: 2b 8d 00 08 lw r13,(sp+8) 8002214: 37 9c 00 10 addi sp,sp,16 8002218: c3 a0 00 00 ret =============================================================================== 080013ac : #include void free( void *ptr ) { 80013ac: 37 9c ff f4 addi sp,sp,-12 80013b0: 5b 8b 00 0c sw (sp+12),r11 80013b4: 5b 8c 00 08 sw (sp+8),r12 80013b8: 5b 9d 00 04 sw (sp+4),ra 80013bc: b8 20 58 00 mv r11,r1 MSBUMP(free_calls, 1); 80013c0: 78 01 08 01 mvhi r1,0x801 80013c4: 38 21 36 b8 ori r1,r1,0x36b8 80013c8: 28 22 00 0c lw r2,(r1+12) 80013cc: 34 42 00 01 addi r2,r2,1 80013d0: 58 22 00 0c sw (r1+12),r2 if ( !ptr ) 80013d4: 45 60 00 1f be r11,r0,8001450 #endif /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 80013d8: 78 01 08 01 mvhi r1,0x801 80013dc: 38 21 39 9c ori r1,r1,0x399c 80013e0: 28 22 00 00 lw r2,(r1+0) 80013e4: 34 01 00 03 mvi r1,3 80013e8: 5c 41 00 06 bne r2,r1,8001400 <== NEVER TAKEN !malloc_is_system_state_OK() ) { 80013ec: f8 00 00 80 calli 80015ec #endif /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 80013f0: 5c 20 00 04 bne r1,r0,8001400 !malloc_is_system_state_OK() ) { malloc_deferred_free(ptr); 80013f4: b9 60 08 00 mv r1,r11 80013f8: f8 00 00 9d calli 800166c return; 80013fc: e0 00 00 15 bi 8001450 } /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 8001400: 78 01 08 01 mvhi r1,0x801 8001404: 38 21 36 10 ori r1,r1,0x3610 8001408: 28 21 00 00 lw r1,(r1+0) 800140c: 44 20 00 04 be r1,r0,800141c (*rtems_malloc_statistics_helpers->at_free)(ptr); 8001410: 28 22 00 08 lw r2,(r1+8) 8001414: b9 60 08 00 mv r1,r11 8001418: d8 40 00 00 call r2 if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { 800141c: 78 0c 08 01 mvhi r12,0x801 8001420: 39 8c 30 1c ori r12,r12,0x301c 8001424: 29 81 00 00 lw r1,(r12+0) 8001428: b9 60 10 00 mv r2,r11 800142c: f8 00 0d ab calli 8004ad8 <_Protected_heap_Free> 8001430: 5c 20 00 08 bne r1,r0,8001450 printk( "Program heap: free of bad pointer %p -- range %p - %p \n", ptr, RTEMS_Malloc_Heap->area_begin, 8001434: 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", 8001438: 78 01 08 01 mvhi r1,0x801 800143c: 38 21 1b 9c ori r1,r1,0x1b9c 8001440: 28 83 00 18 lw r3,(r4+24) 8001444: 28 84 00 1c lw r4,(r4+28) 8001448: b9 60 10 00 mv r2,r11 800144c: f8 00 03 b6 calli 8002324 RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } 8001450: 2b 9d 00 04 lw ra,(sp+4) 8001454: 2b 8b 00 0c lw r11,(sp+12) 8001458: 2b 8c 00 08 lw r12,(sp+8) 800145c: 37 9c 00 0c addi sp,sp,12 8001460: c3 a0 00 00 ret =============================================================================== 08002924 : * NOTE: this must be called with * thread dispatching disabled! */ static void free_user_env(void *venv) { 8002924: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED 8002928: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED 800292c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED 8002930: b8 20 58 00 mv r11,r1 <== NOT EXECUTED rtems_user_env_t *env = (rtems_user_env_t*) venv ; if (env != &rtems_global_user_env 8002934: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8002938: 38 21 36 d8 ori r1,r1,0x36d8 <== NOT EXECUTED 800293c: 45 61 00 07 be r11,r1,8002958 <== NOT EXECUTED #ifdef HAVE_USERENV_REFCNT && --env->refcnt <= 0 #endif ) { rtems_filesystem_freenode( &env->current_directory); 8002940: 35 61 00 04 addi r1,r11,4 <== NOT EXECUTED 8002944: fb ff fb 45 calli 8001658 <== NOT EXECUTED rtems_filesystem_freenode( &env->root_directory); 8002948: 35 61 00 18 addi r1,r11,24 <== NOT EXECUTED 800294c: fb ff fb 43 calli 8001658 <== NOT EXECUTED free(env); 8002950: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8002954: fb ff fb 49 calli 8001678 <== NOT EXECUTED } } 8002958: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800295c: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 8002960: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 8002964: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08012534 : int getdents( int dd_fd, char *dd_buf, int dd_len ) { 8012534: 37 9c ff dc addi sp,sp,-36 8012538: 5b 8b 00 10 sw (sp+16),r11 801253c: 5b 8c 00 0c sw (sp+12),r12 8012540: 5b 8d 00 08 sw (sp+8),r13 8012544: 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 ); 8012548: 78 04 08 01 mvhi r4,0x801 801254c: 38 84 50 10 ori r4,r4,0x5010 int getdents( int dd_fd, char *dd_buf, int dd_len ) { 8012550: 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 ); 8012554: 28 82 00 00 lw r2,(r4+0) int getdents( int dd_fd, char *dd_buf, int dd_len ) { 8012558: 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 ); 801255c: 34 0b 00 00 mvi r11,0 8012560: 50 22 00 07 bgeu r1,r2,801257c <== NEVER TAKEN 8012564: 78 0b 08 01 mvhi r11,0x801 8012568: 39 6b 57 bc ori r11,r11,0x57bc 801256c: 34 02 00 06 mvi r2,6 8012570: fb ff ba e9 calli 8001114 <__ashlsi3> 8012574: 29 6b 00 00 lw r11,(r11+0) 8012578: b5 61 58 00 add r11,r11,r1 /* * Make sure we are working on a directory */ loc = iop->pathinfo; 801257c: 29 64 00 20 lw r4,(r11+32) 8012580: 29 61 00 28 lw r1,(r11+40) 8012584: 29 65 00 1c lw r5,(r11+28) 8012588: 29 62 00 2c lw r2,(r11+44) 801258c: 29 63 00 24 lw r3,(r11+36) 8012590: 5b 84 00 18 sw (sp+24),r4 if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) 8012594: 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; 8012598: 5b 81 00 20 sw (sp+32),r1 801259c: 5b 82 00 24 sw (sp+36),r2 80125a0: 5b 85 00 14 sw (sp+20),r5 80125a4: 5b 83 00 1c sw (sp+28),r3 if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) 80125a8: 37 81 00 14 addi r1,sp,20 80125ac: d8 80 00 00 call r4 80125b0: 34 02 00 01 mvi r2,1 80125b4: 44 22 00 06 be r1,r2,80125cc rtems_set_errno_and_return_minus_one( ENOTDIR ); 80125b8: fb ff e6 e4 calli 800c148 <__errno> 80125bc: 34 02 00 14 mvi r2,20 80125c0: 58 22 00 00 sw (r1+0),r2 80125c4: 34 01 ff ff mvi r1,-1 80125c8: e0 00 00 07 bi 80125e4 /* * 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 ); 80125cc: 29 61 00 24 lw r1,(r11+36) 80125d0: b9 a0 10 00 mv r2,r13 80125d4: b9 80 18 00 mv r3,r12 80125d8: 28 24 00 08 lw r4,(r1+8) 80125dc: b9 60 08 00 mv r1,r11 80125e0: d8 80 00 00 call r4 } 80125e4: 2b 9d 00 04 lw ra,(sp+4) 80125e8: 2b 8b 00 10 lw r11,(sp+16) 80125ec: 2b 8c 00 0c lw r12,(sp+12) 80125f0: 2b 8d 00 08 lw r13,(sp+8) 80125f4: 37 9c 00 24 addi sp,sp,36 80125f8: c3 a0 00 00 ret =============================================================================== 08001464 : */ int gettimeofday( struct timeval *tp, void * __tz __attribute__((unused)) ) { 8001464: 37 9c ff ec addi sp,sp,-20 8001468: 5b 8b 00 0c sw (sp+12),r11 800146c: 5b 8c 00 08 sw (sp+8),r12 8001470: 5b 9d 00 04 sw (sp+4),ra 8001474: b8 20 58 00 mv r11,r1 /* struct timezone* tzp = (struct timezone*) __tz; */ if ( !tp ) 8001478: 5c 20 00 06 bne r1,r0,8001490 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); 800147c: f8 00 27 e0 calli 800b3fc <__errno> <== NOT EXECUTED 8001480: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 8001484: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8001488: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800148c: e0 00 00 0f bi 80014c8 <== NOT EXECUTED { ISR_Level level; struct timespec now; suseconds_t useconds; _ISR_Disable(level); 8001490: 90 00 60 00 rcsr r12,IE 8001494: 34 01 ff fe mvi r1,-2 8001498: a1 81 08 00 and r1,r12,r1 800149c: d0 01 00 00 wcsr IE,r1 _TOD_Get( &now ); 80014a0: 37 81 00 10 addi r1,sp,16 80014a4: f8 00 09 47 calli 80039c0 <_TOD_Get> _ISR_Enable(level); 80014a8: 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; 80014ac: 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; 80014b0: 34 02 03 e8 mvi r2,1000 time->tv_sec = now.tv_sec; 80014b4: 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; 80014b8: 2b 81 00 14 lw r1,(sp+20) 80014bc: f8 00 3d 69 calli 8010a60 <__divsi3> time->tv_sec = now.tv_sec; time->tv_usec = useconds; 80014c0: 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; 80014c4: 34 01 00 00 mvi r1,0 } 80014c8: 2b 9d 00 04 lw ra,(sp+4) 80014cc: 2b 8b 00 0c lw r11,(sp+12) 80014d0: 2b 8c 00 08 lw r12,(sp+8) 80014d4: 37 9c 00 14 addi sp,sp,20 80014d8: c3 a0 00 00 ret =============================================================================== 0800a970 : 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 ) 800a970: 28 22 00 1c lw r2,(r1+28) 800a974: 34 03 00 01 mvi r3,1 800a978: 28 44 00 4c lw r4,(r2+76) return -1; /* It wasn't a directory --> return error */ 800a97c: 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 ) 800a980: 5c 83 00 04 bne r4,r3,800a990 <== NEVER TAKEN return -1; /* It wasn't a directory --> return error */ iop->offset = 0; 800a984: 58 20 00 10 sw (r1+16),r0 800a988: 58 20 00 14 sw (r1+20),r0 return 0; 800a98c: 34 02 00 00 mvi r2,0 } 800a990: b8 40 08 00 mv r1,r2 800a994: c3 a0 00 00 ret =============================================================================== 0800abcc : int imfs_dir_rmnod( rtems_filesystem_location_info_t *parent_pathloc, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN */ ) { 800abcc: 37 9c ff f8 addi sp,sp,-8 800abd0: 5b 8b 00 08 sw (sp+8),r11 800abd4: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *the_jnode; the_jnode = (IMFS_jnode_t *) pathloc->node_access; 800abd8: 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 ) ) 800abdc: 29 63 00 50 lw r3,(r11+80) 800abe0: 35 61 00 54 addi r1,r11,84 800abe4: 44 61 00 04 be r3,r1,800abf4 rtems_set_errno_and_return_minus_one( ENOTEMPTY ); 800abe8: f8 00 02 05 calli 800b3fc <__errno> 800abec: 34 02 00 5a mvi r2,90 800abf0: e0 00 00 06 bi 800ac08 /* * You cannot remove the file system root node. */ if ( pathloc->mt_entry->mt_fs_root.node_access == pathloc->node_access ) 800abf4: 28 41 00 10 lw r1,(r2+16) 800abf8: 28 21 00 1c lw r1,(r1+28) 800abfc: 5c 2b 00 06 bne r1,r11,800ac14 rtems_set_errno_and_return_minus_one( EBUSY ); 800ac00: f8 00 01 ff calli 800b3fc <__errno> 800ac04: 34 02 00 10 mvi r2,16 800ac08: 58 22 00 00 sw (r1+0),r2 800ac0c: 34 01 ff ff mvi r1,-1 800ac10: e0 00 00 08 bi 800ac30 /* * You cannot remove a mountpoint. */ if ( the_jnode->info.directory.mt_fs != NULL ) 800ac14: 29 61 00 5c lw r1,(r11+92) 800ac18: 5c 20 ff fa bne r1,r0,800ac00 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EBUSY ); IMFS_create_orphan( the_jnode ); 800ac1c: b9 60 08 00 mv r1,r11 800ac20: fb ff f3 ed calli 8007bd4 IMFS_check_node_remove( the_jnode ); 800ac24: b9 60 08 00 mv r1,r11 800ac28: fb ff f3 ff calli 8007c24 return 0; 800ac2c: 34 01 00 00 mvi r1,0 } 800ac30: 2b 9d 00 04 lw ra,(sp+4) 800ac34: 2b 8b 00 08 lw r11,(sp+8) 800ac38: 37 9c 00 08 addi sp,sp,8 800ac3c: c3 a0 00 00 ret =============================================================================== 08002108 : /* * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { 8002108: 37 9c ff f0 addi sp,sp,-16 800210c: 5b 8b 00 10 sw (sp+16),r11 8002110: 5b 8c 00 0c sw (sp+12),r12 8002114: 5b 8d 00 08 sw (sp+8),r13 8002118: 5b 9d 00 04 sw (sp+4),ra FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) 800211c: 78 01 08 01 mvhi r1,0x801 8002120: 38 21 57 fc ori r1,r1,0x57fc 8002124: 40 2d 00 00 lbu r13,(r1+0) 8002128: 5d a0 00 2f bne r13,r0,80021e4 return; etc_passwd_initted = 1; 800212c: 34 02 00 01 mvi r2,1 8002130: 30 22 00 00 sb (r1+0),r2 mkdir("/etc", 0777); 8002134: 78 01 08 01 mvhi r1,0x801 8002138: 34 02 01 ff mvi r2,511 800213c: 38 21 37 58 ori r1,r1,0x3758 8002140: f8 00 02 a3 calli 8002bcc /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { 8002144: 78 0b 08 01 mvhi r11,0x801 8002148: 39 6b 37 60 ori r11,r11,0x3760 800214c: 78 02 08 01 mvhi r2,0x801 8002150: b9 60 08 00 mv r1,r11 8002154: 38 42 37 6c ori r2,r2,0x376c 8002158: f8 00 2b 57 calli 800ceb4 800215c: b8 20 60 00 mv r12,r1 8002160: 5c 2d 00 0c bne r1,r13,8002190 fclose(fp); } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { 8002164: 78 02 08 01 mvhi r2,0x801 8002168: b9 60 08 00 mv r1,r11 800216c: 38 42 37 70 ori r2,r2,0x3770 8002170: f8 00 2b 51 calli 800ceb4 8002174: b8 20 58 00 mv r11,r1 8002178: 44 2c 00 07 be r1,r12,8002194 <== NEVER TAKEN fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" 800217c: 78 01 08 01 mvhi r1,0x801 8002180: 38 21 37 74 ori r1,r1,0x3774 8002184: b9 60 10 00 mv r2,r11 8002188: f8 00 2b 82 calli 800cf90 "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); 800218c: b9 60 08 00 mv r1,r11 8002190: f8 00 29 1a calli 800c5f8 } /* * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { 8002194: 78 0b 08 01 mvhi r11,0x801 8002198: 39 6b 37 dc ori r11,r11,0x37dc 800219c: 78 02 08 01 mvhi r2,0x801 80021a0: b9 60 08 00 mv r1,r11 80021a4: 38 42 37 6c ori r2,r2,0x376c 80021a8: f8 00 2b 43 calli 800ceb4 80021ac: b8 20 60 00 mv r12,r1 80021b0: 5c 20 00 0c bne r1,r0,80021e0 fclose(fp); } else if ((fp = fopen("/etc/group", "w")) != NULL) { 80021b4: 78 02 08 01 mvhi r2,0x801 80021b8: b9 60 08 00 mv r1,r11 80021bc: 38 42 37 70 ori r2,r2,0x3770 80021c0: f8 00 2b 3d calli 800ceb4 80021c4: b8 20 58 00 mv r11,r1 80021c8: 44 2c 00 07 be r1,r12,80021e4 <== NEVER TAKEN fprintf( fp, "root:x:0:root\n" 80021cc: 78 01 08 01 mvhi r1,0x801 80021d0: 38 21 37 e8 ori r1,r1,0x37e8 80021d4: b9 60 10 00 mv r2,r11 80021d8: f8 00 2b 6e calli 800cf90 "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); 80021dc: b9 60 08 00 mv r1,r11 80021e0: f8 00 29 06 calli 800c5f8 } } 80021e4: 2b 9d 00 04 lw ra,(sp+4) 80021e8: 2b 8b 00 10 lw r11,(sp+16) 80021ec: 2b 8c 00 0c lw r12,(sp+12) 80021f0: 2b 8d 00 08 lw r13,(sp+8) 80021f4: 37 9c 00 10 addi sp,sp,16 80021f8: c3 a0 00 00 ret =============================================================================== 080057d8 : /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 80057d8: 37 9c ff f4 addi sp,sp,-12 80057dc: 5b 8b 00 0c sw (sp+12),r11 80057e0: 5b 8c 00 08 sw (sp+8),r12 80057e4: 5b 9d 00 04 sw (sp+4),ra 80057e8: b8 40 58 00 mv r11,r2 if (tty->termios.c_iflag & ISTRIP) 80057ec: 28 42 00 30 lw r2,(r2+48) /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 80057f0: b8 20 60 00 mv r12,r1 if (tty->termios.c_iflag & ISTRIP) 80057f4: 20 41 00 20 andi r1,r2,0x20 80057f8: 44 20 00 02 be r1,r0,8005800 <== ALWAYS TAKEN c &= 0x7f; 80057fc: 21 8c 00 7f andi r12,r12,0x7f <== NOT EXECUTED if (tty->termios.c_iflag & IUCLC) 8005800: 20 41 02 00 andi r1,r2,0x200 8005804: 44 20 00 0b be r1,r0,8005830 c = tolower (c); 8005808: 78 01 08 02 mvhi r1,0x802 800580c: 38 21 12 cc ori r1,r1,0x12cc 8005810: 28 21 00 00 lw r1,(r1+0) 8005814: b4 2c 08 00 add r1,r1,r12 8005818: 40 23 00 01 lbu r3,(r1+1) 800581c: 34 01 00 01 mvi r1,1 8005820: 20 63 00 03 andi r3,r3,0x3 8005824: 5c 61 00 02 bne r3,r1,800582c 8005828: 35 8c 00 20 addi r12,r12,32 800582c: 21 8c 00 ff andi r12,r12,0xff if (c == '\r') { 8005830: 34 01 00 0d mvi r1,13 8005834: 5d 81 00 08 bne r12,r1,8005854 if (tty->termios.c_iflag & IGNCR) 8005838: 20 43 00 80 andi r3,r2,0x80 return 0; 800583c: 34 01 00 00 mvi r1,0 if (tty->termios.c_iflag & IUCLC) c = tolower (c); if (c == '\r') { if (tty->termios.c_iflag & IGNCR) 8005840: 5c 60 00 4e bne r3,r0,8005978 <== NEVER TAKEN return 0; if (tty->termios.c_iflag & ICRNL) 8005844: 20 42 01 00 andi r2,r2,0x100 8005848: 44 43 00 0a be r2,r3,8005870 <== NEVER TAKEN c = '\n'; 800584c: 34 0c 00 0a mvi r12,10 8005850: e0 00 00 08 bi 8005870 } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { 8005854: 34 01 00 0a mvi r1,10 8005858: 5d 81 00 05 bne r12,r1,800586c 800585c: 20 42 00 40 andi r2,r2,0x40 8005860: 44 40 00 04 be r2,r0,8005870 <== ALWAYS TAKEN c = '\r'; 8005864: 34 0c 00 0d mvi r12,13 <== NOT EXECUTED 8005868: e0 00 00 02 bi 8005870 <== NOT EXECUTED } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 800586c: 45 80 00 2f be r12,r0,8005928 <== NEVER TAKEN 8005870: 29 62 00 3c lw r2,(r11+60) 8005874: 20 41 00 02 andi r1,r2,0x2 8005878: 44 20 00 2c be r1,r0,8005928 <== NEVER TAKEN if (c == tty->termios.c_cc[VERASE]) { 800587c: 41 61 00 43 lbu r1,(r11+67) 8005880: 5c 2c 00 04 bne r1,r12,8005890 erase (tty, 0); 8005884: b9 60 08 00 mv r1,r11 8005888: 34 02 00 00 mvi r2,0 800588c: e0 00 00 05 bi 80058a0 return 0; } else if (c == tty->termios.c_cc[VKILL]) { 8005890: 41 61 00 44 lbu r1,(r11+68) 8005894: 5c 2c 00 05 bne r1,r12,80058a8 erase (tty, 1); 8005898: b9 60 08 00 mv r1,r11 800589c: 34 02 00 01 mvi r2,1 80058a0: fb ff ff 4c calli 80055d0 80058a4: e0 00 00 34 bi 8005974 return 0; } else if (c == tty->termios.c_cc[VEOF]) { 80058a8: 41 63 00 45 lbu r3,(r11+69) return 1; 80058ac: 34 01 00 01 mvi r1,1 } else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { 80058b0: 44 6c 00 32 be r3,r12,8005978 <== NEVER TAKEN return 1; } else if (c == '\n') { 80058b4: 34 01 00 0a mvi r1,10 80058b8: 5d 81 00 0b bne r12,r1,80058e4 if (tty->termios.c_lflag & (ECHO | ECHONL)) 80058bc: 20 42 00 48 andi r2,r2,0x48 80058c0: 44 40 00 03 be r2,r0,80058cc <== NEVER TAKEN echo (c, tty); 80058c4: b9 60 10 00 mv r2,r11 80058c8: fb ff ff 1d calli 800553c tty->cbuf[tty->ccount++] = c; 80058cc: 29 61 00 20 lw r1,(r11+32) 80058d0: 29 62 00 1c lw r2,(r11+28) 80058d4: 34 03 00 0a mvi r3,10 80058d8: b4 41 10 00 add r2,r2,r1 80058dc: 30 43 00 00 sb (r2+0),r3 80058e0: e0 00 00 0e bi 8005918 return 1; } else if ((c == tty->termios.c_cc[VEOL]) || 80058e4: 41 61 00 4c lbu r1,(r11+76) 80058e8: 44 2c 00 03 be r1,r12,80058f4 <== NEVER TAKEN 80058ec: 41 61 00 51 lbu r1,(r11+81) 80058f0: 5c 2c 00 0e bne r1,r12,8005928 <== ALWAYS TAKEN (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) 80058f4: 20 42 00 08 andi r2,r2,0x8 <== NOT EXECUTED 80058f8: 44 40 00 04 be r2,r0,8005908 <== NOT EXECUTED echo (c, tty); 80058fc: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8005900: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8005904: fb ff ff 0e calli 800553c <== NOT EXECUTED tty->cbuf[tty->ccount++] = c; 8005908: 29 61 00 20 lw r1,(r11+32) <== NOT EXECUTED 800590c: 29 62 00 1c lw r2,(r11+28) <== NOT EXECUTED 8005910: b4 41 10 00 add r2,r2,r1 <== NOT EXECUTED 8005914: 30 4c 00 00 sb (r2+0),r12 <== NOT EXECUTED 8005918: 34 21 00 01 addi r1,r1,1 800591c: 59 61 00 20 sw (r11+32),r1 return 1; 8005920: 34 01 00 01 mvi r1,1 8005924: e0 00 00 15 bi 8005978 } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 8005928: 78 01 08 02 mvhi r1,0x802 800592c: 38 21 12 40 ori r1,r1,0x1240 8005930: 28 22 00 00 lw r2,(r1+0) 8005934: 29 63 00 20 lw r3,(r11+32) if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; 8005938: 34 01 00 00 mvi r1,0 } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 800593c: 34 42 ff ff addi r2,r2,-1 8005940: 4c 62 00 0e bge r3,r2,8005978 <== NEVER TAKEN if (tty->termios.c_lflag & ECHO) 8005944: 29 61 00 3c lw r1,(r11+60) 8005948: 20 21 00 08 andi r1,r1,0x8 800594c: 44 20 00 04 be r1,r0,800595c <== NEVER TAKEN echo (c, tty); 8005950: b9 80 08 00 mv r1,r12 8005954: b9 60 10 00 mv r2,r11 8005958: fb ff fe f9 calli 800553c tty->cbuf[tty->ccount++] = c; 800595c: 29 61 00 20 lw r1,(r11+32) 8005960: 29 62 00 1c lw r2,(r11+28) 8005964: b4 41 10 00 add r2,r2,r1 8005968: 30 4c 00 00 sb (r2+0),r12 800596c: 34 21 00 01 addi r1,r1,1 8005970: 59 61 00 20 sw (r11+32),r1 } return 0; 8005974: 34 01 00 00 mvi r1,0 } 8005978: 2b 9d 00 04 lw ra,(sp+4) 800597c: 2b 8b 00 0c lw r11,(sp+12) 8005980: 2b 8c 00 08 lw r12,(sp+8) 8005984: 37 9c 00 0c addi sp,sp,12 8005988: c3 a0 00 00 ret =============================================================================== 08023b88 : #if !defined(RTEMS_POSIX_API) int kill( pid_t pid, int sig ) { return 0; } 8023b88: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8023b8c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08010f58 : extern void _wrapup_reent(struct _reent *); extern void _reclaim_reent(struct _reent *); void libc_wrapup(void) { 8010f58: 37 9c ff f4 addi sp,sp,-12 8010f5c: 5b 8b 00 0c sw (sp+12),r11 8010f60: 5b 8c 00 08 sw (sp+8),r12 8010f64: 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())) 8010f68: 78 01 08 01 mvhi r1,0x801 8010f6c: 38 21 39 9c ori r1,r1,0x399c 8010f70: 28 22 00 00 lw r2,(r1+0) 8010f74: 34 01 00 03 mvi r1,3 8010f78: 5c 41 00 16 bne r2,r1,8010fd0 <== NEVER TAKEN /* * This was already done if the user called exit() directly . _wrapup_reent(0); */ if (_REENT != _global_impure_ptr) { 8010f7c: 78 01 08 01 mvhi r1,0x801 8010f80: 78 0b 08 01 mvhi r11,0x801 8010f84: 38 21 20 b8 ori r1,r1,0x20b8 8010f88: 39 6b 31 70 ori r11,r11,0x3170 8010f8c: 28 2c 00 00 lw r12,(r1+0) 8010f90: 29 61 00 00 lw r1,(r11+0) 8010f94: 44 2c 00 04 be r1,r12,8010fa4 _wrapup_reent(_global_impure_ptr); 8010f98: b9 80 08 00 mv r1,r12 8010f9c: f8 00 02 24 calli 801182c <_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; 8010fa0: 59 6c 00 00 sw (r11+0),r12 * * Should this be changed to do *all* file streams? * _fwalk (_REENT, fclose); */ fclose (stdin); 8010fa4: 78 0b 08 01 mvhi r11,0x801 8010fa8: 39 6b 31 70 ori r11,r11,0x3170 8010fac: 29 61 00 00 lw r1,(r11+0) 8010fb0: 28 21 00 04 lw r1,(r1+4) 8010fb4: fb ff e9 72 calli 800b57c fclose (stdout); 8010fb8: 29 61 00 00 lw r1,(r11+0) 8010fbc: 28 21 00 08 lw r1,(r1+8) 8010fc0: fb ff e9 6f calli 800b57c fclose (stderr); 8010fc4: 29 61 00 00 lw r1,(r11+0) 8010fc8: 28 21 00 0c lw r1,(r1+12) 8010fcc: fb ff e9 6c calli 800b57c } 8010fd0: 2b 9d 00 04 lw ra,(sp+4) 8010fd4: 2b 8b 00 0c lw r11,(sp+12) 8010fd8: 2b 8c 00 08 lw r12,(sp+8) 8010fdc: 37 9c 00 0c addi sp,sp,12 8010fe0: c3 a0 00 00 ret =============================================================================== 08001794 : #include "malloc_p.h" void *malloc( size_t size ) { 8001794: 37 9c ff f4 addi sp,sp,-12 8001798: 5b 8b 00 0c sw (sp+12),r11 800179c: 5b 8c 00 08 sw (sp+8),r12 80017a0: 5b 9d 00 04 sw (sp+4),ra void *return_this; MSBUMP(malloc_calls, 1); 80017a4: 78 03 08 01 mvhi r3,0x801 80017a8: 38 63 36 b8 ori r3,r3,0x36b8 #include "malloc_p.h" void *malloc( size_t size ) { 80017ac: b8 20 60 00 mv r12,r1 void *return_this; MSBUMP(malloc_calls, 1); 80017b0: 28 61 00 04 lw r1,(r3+4) /* * Validate the parameters */ if ( !size ) return (void *) 0; 80017b4: 34 0b 00 00 mvi r11,0 size_t size ) { void *return_this; MSBUMP(malloc_calls, 1); 80017b8: 34 21 00 01 addi r1,r1,1 80017bc: 58 61 00 04 sw (r3+4),r1 /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); 80017c0: fb ff ff 9d calli 8001634 /* * Validate the parameters */ if ( !size ) 80017c4: 45 80 00 2d be r12,r0,8001878 return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 80017c8: 78 01 08 01 mvhi r1,0x801 80017cc: 38 21 39 9c ori r1,r1,0x399c 80017d0: 28 22 00 00 lw r2,(r1+0) 80017d4: 34 01 00 03 mvi r1,3 80017d8: 5c 41 00 03 bne r2,r1,80017e4 !malloc_is_system_state_OK() ) 80017dc: fb ff ff 84 calli 80015ec return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 80017e0: 44 20 00 26 be r1,r0,8001878 <== 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 ); 80017e4: 78 01 08 01 mvhi r1,0x801 80017e8: 38 21 30 1c ori r1,r1,0x301c 80017ec: 28 21 00 00 lw r1,(r1+0) 80017f0: b9 80 10 00 mv r2,r12 80017f4: 34 03 00 00 mvi r3,0 80017f8: 34 04 00 00 mvi r4,0 80017fc: f8 00 0c 9d calli 8004a70 <_Protected_heap_Allocate_aligned_with_boundary> 8001800: 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 ) { 8001804: 5c 20 00 0f bne r1,r0,8001840 if (rtems_malloc_sbrk_helpers) 8001808: 78 01 08 01 mvhi r1,0x801 800180c: 38 21 36 14 ori r1,r1,0x3614 8001810: 28 21 00 00 lw r1,(r1+0) 8001814: 44 2b 00 06 be r1,r11,800182c return_this = (*rtems_malloc_sbrk_helpers->extend)( size ); 8001818: 28 22 00 04 lw r2,(r1+4) 800181c: b9 80 08 00 mv r1,r12 8001820: d8 40 00 00 call r2 8001824: b8 20 58 00 mv r11,r1 if ( !return_this ) { 8001828: 5c 20 00 06 bne r1,r0,8001840 errno = ENOMEM; 800182c: f8 00 26 f4 calli 800b3fc <__errno> 8001830: 34 02 00 0c mvi r2,12 8001834: 58 22 00 00 sw (r1+0),r2 return (void *) 0; 8001838: 34 0b 00 00 mvi r11,0 800183c: e0 00 00 0f bi 8001878 } /* * If the user wants us to dirty the allocated memory, then do it. */ if ( rtems_malloc_dirty_helper ) 8001840: 78 01 08 01 mvhi r1,0x801 8001844: 38 21 36 18 ori r1,r1,0x3618 8001848: 28 23 00 00 lw r3,(r1+0) 800184c: 44 60 00 04 be r3,r0,800185c (*rtems_malloc_dirty_helper)( return_this, size ); 8001850: b9 60 08 00 mv r1,r11 8001854: b9 80 10 00 mv r2,r12 8001858: d8 60 00 00 call r3 /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 800185c: 78 01 08 01 mvhi r1,0x801 8001860: 38 21 36 10 ori r1,r1,0x3610 8001864: 28 21 00 00 lw r1,(r1+0) 8001868: 44 20 00 04 be r1,r0,8001878 (*rtems_malloc_statistics_helpers->at_malloc)(return_this); 800186c: 28 22 00 04 lw r2,(r1+4) 8001870: b9 60 08 00 mv r1,r11 8001874: d8 40 00 00 call r2 return return_this; } 8001878: b9 60 08 00 mv r1,r11 800187c: 2b 9d 00 04 lw ra,(sp+4) 8001880: 2b 8b 00 0c lw r11,(sp+12) 8001884: 2b 8c 00 08 lw r12,(sp+8) 8001888: 37 9c 00 0c addi sp,sp,12 800188c: c3 a0 00 00 ret =============================================================================== 08001b88 : } void *malloc_sbrk_extend_and_allocate( size_t size ) { 8001b88: 37 9c ff ec addi sp,sp,-20 8001b8c: 5b 8b 00 14 sw (sp+20),r11 8001b90: 5b 8c 00 10 sw (sp+16),r12 8001b94: 5b 8d 00 0c sw (sp+12),r13 8001b98: 5b 8e 00 08 sw (sp+8),r14 8001b9c: 5b 9d 00 04 sw (sp+4),ra * Round to the "requested sbrk amount" so hopefully we won't have * to grow again for a while. This effectively does sbrk() calls * in "page" amounts. */ sbrk_amount = RTEMS_Malloc_Sbrk_amount; 8001ba0: 78 03 08 01 mvhi r3,0x801 8001ba4: 38 63 37 d8 ori r3,r3,0x37d8 8001ba8: 28 6b 00 00 lw r11,(r3+0) } void *malloc_sbrk_extend_and_allocate( size_t size ) { 8001bac: b8 20 70 00 mv r14,r1 */ sbrk_amount = RTEMS_Malloc_Sbrk_amount; if ( sbrk_amount == 0 ) return (void *) 0; 8001bb0: 34 0d 00 00 mvi r13,0 * in "page" amounts. */ sbrk_amount = RTEMS_Malloc_Sbrk_amount; if ( sbrk_amount == 0 ) 8001bb4: 45 60 00 22 be r11,r0,8001c3c <== NEVER TAKEN return (void *) 0; the_size = ((size + sbrk_amount) / sbrk_amount * sbrk_amount); 8001bb8: b9 60 10 00 mv r2,r11 8001bbc: b4 2b 08 00 add r1,r1,r11 8001bc0: f8 00 3c ea calli 8010f68 <__udivsi3> 8001bc4: b9 60 10 00 mv r2,r11 8001bc8: f8 00 3c 83 calli 8010dd4 <__mulsi3> 8001bcc: b8 20 60 00 mv r12,r1 starting_address = (void *) sbrk(the_size); 8001bd0: fb ff fa 15 calli 8000424 8001bd4: b8 20 10 00 mv r2,r1 if ( starting_address == (void*) -1 ) 8001bd8: 34 01 ff ff mvi r1,-1 8001bdc: 44 41 00 18 be r2,r1,8001c3c return (void *) 0; if ( !_Protected_heap_Extend( 8001be0: 78 0b 08 01 mvhi r11,0x801 8001be4: 39 6b 30 1c ori r11,r11,0x301c 8001be8: 29 61 00 00 lw r1,(r11+0) 8001bec: b9 80 18 00 mv r3,r12 8001bf0: f8 00 0c 5d calli 8004d64 <_Protected_heap_Extend> 8001bf4: 5c 20 00 07 bne r1,r0,8001c10 RTEMS_Malloc_Heap, starting_address, the_size) ) { sbrk(-the_size); 8001bf8: c8 0c 08 00 sub r1,r0,r12 8001bfc: fb ff fa 0a calli 8000424 errno = ENOMEM; 8001c00: f8 00 27 28 calli 800b8a0 <__errno> 8001c04: 34 02 00 0c mvi r2,12 8001c08: 58 22 00 00 sw (r1+0),r2 return (void *) 0; 8001c0c: e0 00 00 0c bi 8001c3c } MSBUMP(space_available, the_size); 8001c10: 78 04 08 01 mvhi r4,0x801 8001c14: 38 84 37 a8 ori r4,r4,0x37a8 8001c18: 28 81 00 00 lw r1,(r4+0) 8001c1c: b9 c0 10 00 mv r2,r14 8001c20: 34 03 00 00 mvi r3,0 8001c24: b5 81 60 00 add r12,r12,r1 8001c28: 29 61 00 00 lw r1,(r11+0) 8001c2c: 58 8c 00 00 sw (r4+0),r12 8001c30: 34 04 00 00 mvi r4,0 8001c34: f8 00 0c 32 calli 8004cfc <_Protected_heap_Allocate_aligned_with_boundary> 8001c38: b8 20 68 00 mv r13,r1 return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); return return_this; } 8001c3c: b9 a0 08 00 mv r1,r13 8001c40: 2b 9d 00 04 lw ra,(sp+4) 8001c44: 2b 8b 00 14 lw r11,(sp+20) 8001c48: 2b 8c 00 10 lw r12,(sp+16) 8001c4c: 2b 8d 00 0c lw r13,(sp+12) 8001c50: 2b 8e 00 08 lw r14,(sp+8) 8001c54: 37 9c 00 14 addi sp,sp,20 8001c58: c3 a0 00 00 ret =============================================================================== 08009994 : */ int memfile_blocks_allocated = 0; void *memfile_alloc_block(void) { 8009994: 37 9c ff fc addi sp,sp,-4 8009998: 5b 9d 00 04 sw (sp+4),ra void *memory; memory = (void *)calloc(1, IMFS_MEMFILE_BYTES_PER_BLOCK); 800999c: 78 02 08 01 mvhi r2,0x801 80099a0: 38 42 36 1c ori r2,r2,0x361c 80099a4: 28 42 00 00 lw r2,(r2+0) 80099a8: 34 01 00 01 mvi r1,1 80099ac: fb ff dd db calli 8001118 if ( memory ) 80099b0: 44 20 00 06 be r1,r0,80099c8 <== NEVER TAKEN memfile_blocks_allocated++; 80099b4: 78 02 08 01 mvhi r2,0x801 80099b8: 38 42 36 2c ori r2,r2,0x362c 80099bc: 28 43 00 00 lw r3,(r2+0) 80099c0: 34 63 00 01 addi r3,r3,1 80099c4: 58 43 00 00 sw (r2+0),r3 return memory; } 80099c8: 2b 9d 00 04 lw ra,(sp+4) 80099cc: 37 9c 00 04 addi sp,sp,4 80099d0: c3 a0 00 00 ret =============================================================================== 08009f4c : void memfile_free_blocks_in_table( block_p **block_table, int entries ) { 8009f4c: 37 9c ff ec addi sp,sp,-20 8009f50: 5b 8b 00 14 sw (sp+20),r11 8009f54: 5b 8c 00 10 sw (sp+16),r12 8009f58: 5b 8d 00 0c sw (sp+12),r13 8009f5c: 5b 8e 00 08 sw (sp+8),r14 8009f60: 5b 9d 00 04 sw (sp+4),ra 8009f64: b8 20 58 00 mv r11,r1 8009f68: b8 40 70 00 mv r14,r2 */ #if defined(RTEMS_DEBUG) assert( block_table ); #endif if ( !block_table ) 8009f6c: 44 20 00 0e be r1,r0,8009fa4 <== NEVER TAKEN 8009f70: 28 2c 00 00 lw r12,(r1+0) * Now go through all the slots in the table and free the memory. */ b = *block_table; for ( i=0 ; i if ( b[i] ) { 8009f7c: 29 81 00 00 lw r1,(r12+0) 8009f80: 44 20 00 03 be r1,r0,8009f8c memfile_free_block( b[i] ); 8009f84: fb ff ff e7 calli 8009f20 b[i] = 0; 8009f88: 59 80 00 00 sw (r12+0),r0 * Now go through all the slots in the table and free the memory. */ b = *block_table; for ( i=0 ; i /* * Now that all the blocks in the block table are free, we can * free the block table itself. */ memfile_free_block( *block_table ); 8009f98: 29 61 00 00 lw r1,(r11+0) 8009f9c: fb ff ff e1 calli 8009f20 *block_table = 0; 8009fa0: 59 60 00 00 sw (r11+0),r0 } 8009fa4: 2b 9d 00 04 lw ra,(sp+4) 8009fa8: 2b 8b 00 14 lw r11,(sp+20) 8009fac: 2b 8c 00 10 lw r12,(sp+16) 8009fb0: 2b 8d 00 0c lw r13,(sp+12) 8009fb4: 2b 8e 00 08 lw r14,(sp+8) 8009fb8: 37 9c 00 14 addi sp,sp,20 8009fbc: c3 a0 00 00 ret =============================================================================== 0800a590 : int memfile_ftruncate( rtems_libio_t *iop, rtems_off64_t length ) { 800a590: 37 9c ff f0 addi sp,sp,-16 800a594: 5b 8b 00 08 sw (sp+8),r11 800a598: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 800a59c: 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 ) 800a5a0: 29 64 00 50 lw r4,(r11+80) 800a5a4: 48 44 00 05 bg r2,r4,800a5b8 <== NEVER TAKEN 800a5a8: 5c 82 00 08 bne r4,r2,800a5c8 <== NEVER TAKEN 800a5ac: 29 64 00 54 lw r4,(r11+84) 800a5b0: 54 64 00 02 bgu r3,r4,800a5b8 <== NEVER TAKEN 800a5b4: e0 00 00 05 bi 800a5c8 return IMFS_memfile_extend( the_jnode, length ); 800a5b8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 800a5bc: b8 60 10 00 mv r2,r3 <== NOT EXECUTED 800a5c0: fb ff fe e8 calli 800a160 <== NOT EXECUTED 800a5c4: e0 00 00 0b bi 800a5f0 <== NOT EXECUTED * The in-memory files do not currently reclaim memory until the file is * deleted. So we leave the previously allocated blocks in place for * future use and just set the length. */ the_jnode->info.file.size = length; 800a5c8: 59 62 00 50 sw (r11+80),r2 800a5cc: 59 63 00 54 sw (r11+84),r3 iop->size = the_jnode->info.file.size; 800a5d0: 58 22 00 08 sw (r1+8),r2 800a5d4: 58 23 00 0c sw (r1+12),r3 IMFS_update_atime( the_jnode ); 800a5d8: 34 02 00 00 mvi r2,0 800a5dc: 37 81 00 0c addi r1,sp,12 800a5e0: fb ff db a1 calli 8001464 800a5e4: 2b 81 00 0c lw r1,(sp+12) 800a5e8: 59 61 00 40 sw (r11+64),r1 return 0; 800a5ec: 34 01 00 00 mvi r1,0 } 800a5f0: 2b 9d 00 04 lw ra,(sp+4) 800a5f4: 2b 8b 00 08 lw r11,(sp+8) 800a5f8: 37 9c 00 10 addi sp,sp,16 800a5fc: c3 a0 00 00 ret =============================================================================== 0800a600 : rtems_off64_t memfile_lseek( rtems_libio_t *iop, rtems_off64_t offset, int whence ) { 800a600: 37 9c ff f4 addi sp,sp,-12 800a604: 5b 8b 00 0c sw (sp+12),r11 800a608: 5b 8c 00 08 sw (sp+8),r12 800a60c: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 800a610: 28 2c 00 1c lw r12,(r1+28) rtems_off64_t memfile_lseek( rtems_libio_t *iop, rtems_off64_t offset, int whence ) { 800a614: 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) { 800a618: 34 01 00 06 mvi r1,6 800a61c: 29 82 00 4c lw r2,(r12+76) 800a620: 5c 41 00 0c bne r2,r1,800a650 if (iop->offset > the_jnode->info.linearfile.size) 800a624: 29 81 00 50 lw r1,(r12+80) 800a628: 29 63 00 10 lw r3,(r11+16) 800a62c: 29 82 00 54 lw r2,(r12+84) 800a630: 48 61 00 05 bg r3,r1,800a644 <== NEVER TAKEN 800a634: 5c 61 00 15 bne r3,r1,800a688 <== NEVER TAKEN 800a638: 29 63 00 14 lw r3,(r11+20) 800a63c: 54 62 00 02 bgu r3,r2,800a644 <== NEVER TAKEN 800a640: e0 00 00 12 bi 800a688 iop->offset = the_jnode->info.linearfile.size; 800a644: 59 61 00 10 sw (r11+16),r1 <== NOT EXECUTED 800a648: 59 62 00 14 sw (r11+20),r2 <== NOT EXECUTED 800a64c: e0 00 00 0f bi 800a688 <== NOT EXECUTED } else { /* Must be a block file (IMFS_MEMORY_FILE). */ if (IMFS_memfile_extend( the_jnode, iop->offset )) 800a650: 29 62 00 14 lw r2,(r11+20) 800a654: b9 80 08 00 mv r1,r12 800a658: fb ff fe c2 calli 800a160 800a65c: 44 20 00 07 be r1,r0,800a678 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ENOSPC ); 800a660: f8 00 03 67 calli 800b3fc <__errno> <== NOT EXECUTED 800a664: 34 02 00 1c mvi r2,28 <== NOT EXECUTED 800a668: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 800a66c: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800a670: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 800a674: e0 00 00 07 bi 800a690 <== NOT EXECUTED iop->size = the_jnode->info.file.size; 800a678: 29 81 00 50 lw r1,(r12+80) 800a67c: 59 61 00 08 sw (r11+8),r1 800a680: 29 81 00 54 lw r1,(r12+84) 800a684: 59 61 00 0c sw (r11+12),r1 } return iop->offset; 800a688: 29 61 00 10 lw r1,(r11+16) 800a68c: 29 62 00 14 lw r2,(r11+20) } 800a690: 2b 9d 00 04 lw ra,(sp+4) 800a694: 2b 8b 00 0c lw r11,(sp+12) 800a698: 2b 8c 00 08 lw r12,(sp+8) 800a69c: 37 9c 00 0c addi sp,sp,12 800a6a0: c3 a0 00 00 ret =============================================================================== 0800a4dc : rtems_libio_t *iop, const char *pathname, uint32_t flag, uint32_t mode ) { 800a4dc: 37 9c ff f4 addi sp,sp,-12 800a4e0: 5b 8b 00 0c sw (sp+12),r11 800a4e4: 5b 8c 00 08 sw (sp+8),r12 800a4e8: 5b 9d 00 04 sw (sp+4),ra 800a4ec: b8 20 60 00 mv r12,r1 IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 800a4f0: 28 2b 00 1c lw r11,(r1+28) /* * Perform 'copy on write' for linear files */ if ((iop->flags & (LIBIO_FLAGS_WRITE | LIBIO_FLAGS_APPEND)) 800a4f4: 28 21 00 18 lw r1,(r1+24) 800a4f8: 20 21 02 04 andi r1,r1,0x204 800a4fc: 44 20 00 13 be r1,r0,800a548 && (the_jnode->type == IMFS_LINEAR_FILE)) { 800a500: 29 62 00 4c lw r2,(r11+76) 800a504: 34 01 00 06 mvi r1,6 800a508: 5c 41 00 10 bne r2,r1,800a548 <== ALWAYS TAKEN uint32_t count = the_jnode->info.linearfile.size; 800a50c: 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; 800a510: 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; 800a514: 29 63 00 58 lw r3,(r11+88) <== NOT EXECUTED the_jnode->type = IMFS_MEMORY_FILE; 800a518: 59 61 00 4c sw (r11+76),r1 <== NOT EXECUTED the_jnode->info.file.size = 0; 800a51c: 59 60 00 50 sw (r11+80),r0 <== NOT EXECUTED 800a520: 59 60 00 54 sw (r11+84),r0 <== NOT EXECUTED the_jnode->info.file.indirect = 0; 800a524: 59 60 00 58 sw (r11+88),r0 <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; 800a528: 59 60 00 5c sw (r11+92),r0 <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; 800a52c: 59 60 00 60 sw (r11+96),r0 <== NOT EXECUTED if ((count != 0) 800a530: 44 80 00 06 be r4,r0,800a548 <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) 800a534: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 800a538: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 800a53c: fb ff ff 5f calli 800a2b8 <== NOT EXECUTED return -1; 800a540: 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)) 800a544: 44 22 00 0d be r1,r2,800a578 <== NOT EXECUTED return -1; } if (iop->flags & LIBIO_FLAGS_APPEND) 800a548: 29 81 00 18 lw r1,(r12+24) 800a54c: 20 21 02 00 andi r1,r1,0x200 800a550: 44 20 00 05 be r1,r0,800a564 iop->offset = the_jnode->info.file.size; 800a554: 29 61 00 50 lw r1,(r11+80) 800a558: 59 81 00 10 sw (r12+16),r1 800a55c: 29 61 00 54 lw r1,(r11+84) 800a560: 59 81 00 14 sw (r12+20),r1 iop->size = the_jnode->info.file.size; 800a564: 29 61 00 50 lw r1,(r11+80) return 0; 800a568: 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; 800a56c: 59 81 00 08 sw (r12+8),r1 800a570: 29 61 00 54 lw r1,(r11+84) 800a574: 59 81 00 0c sw (r12+12),r1 return 0; } 800a578: b8 40 08 00 mv r1,r2 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 =============================================================================== 080018b4 : int mknod( const char *pathname, mode_t mode, dev_t dev ) { 80018b4: 37 9c ff cc addi sp,sp,-52 80018b8: 5b 8b 00 14 sw (sp+20),r11 80018bc: 5b 8c 00 10 sw (sp+16),r12 80018c0: 5b 8d 00 0c sw (sp+12),r13 80018c4: 5b 8e 00 08 sw (sp+8),r14 80018c8: 5b 9d 00 04 sw (sp+4),ra 80018cc: b8 40 68 00 mv r13,r2 rtems_filesystem_location_info_t temp_loc; int i; const char *name_start; int result; if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) ) 80018d0: 20 42 f0 00 andi r2,r2,0xf000 int mknod( const char *pathname, mode_t mode, dev_t dev ) { 80018d4: b8 20 60 00 mv r12,r1 80018d8: b8 60 70 00 mv r14,r3 rtems_filesystem_location_info_t temp_loc; int i; const char *name_start; int result; if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) ) 80018dc: 5c 40 00 06 bne r2,r0,80018f4 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 80018e0: f8 00 26 c7 calli 800b3fc <__errno> <== NOT EXECUTED 80018e4: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 80018e8: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 80018ec: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 80018f0: e0 00 00 1a bi 8001958 <== NOT EXECUTED rtems_filesystem_get_start_loc( pathname, &i, &temp_loc ); 80018f4: 37 8b 00 1c addi r11,sp,28 80018f8: 37 82 00 34 addi r2,sp,52 80018fc: b9 60 18 00 mv r3,r11 8001900: 5b 84 00 18 sw (sp+24),r4 8001904: f8 00 02 97 calli 8002360 result = (*temp_loc.ops->evalformake_h)( 8001908: 2b 81 00 28 lw r1,(sp+40) 800190c: b9 60 10 00 mv r2,r11 8001910: 37 83 00 30 addi r3,sp,48 8001914: 28 25 00 04 lw r5,(r1+4) 8001918: 2b 81 00 34 lw r1,(sp+52) 800191c: b5 81 08 00 add r1,r12,r1 8001920: d8 a0 00 00 call r5 &pathname[i], &temp_loc, &name_start ); if ( result != 0 ) return -1; 8001924: 34 0c ff ff mvi r12,-1 result = (*temp_loc.ops->evalformake_h)( &pathname[i], &temp_loc, &name_start ); if ( result != 0 ) 8001928: 2b 84 00 18 lw r4,(sp+24) 800192c: 5c 20 00 0b bne r1,r0,8001958 return -1; result = (*temp_loc.ops->mknod_h)( name_start, mode, dev, &temp_loc ); 8001930: 2b 81 00 28 lw r1,(sp+40) 8001934: b9 a0 10 00 mv r2,r13 8001938: b9 c0 18 00 mv r3,r14 800193c: 28 26 00 14 lw r6,(r1+20) 8001940: 2b 81 00 30 lw r1,(sp+48) 8001944: b9 60 28 00 mv r5,r11 8001948: d8 c0 00 00 call r6 800194c: b8 20 60 00 mv r12,r1 rtems_filesystem_freenode( &temp_loc ); 8001950: b9 60 08 00 mv r1,r11 8001954: fb ff fe 8e calli 800138c return result; } 8001958: b9 80 08 00 mv r1,r12 800195c: 2b 9d 00 04 lw ra,(sp+4) 8001960: 2b 8b 00 14 lw r11,(sp+20) 8001964: 2b 8c 00 10 lw r12,(sp+16) 8001968: 2b 8d 00 0c lw r13,(sp+12) 800196c: 2b 8e 00 08 lw r14,(sp+8) 8001970: 37 9c 00 34 addi sp,sp,52 8001974: c3 a0 00 00 ret =============================================================================== 08001a5c : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 8001a5c: 37 9c ff b4 addi sp,sp,-76 8001a60: 5b 8b 00 38 sw (sp+56),r11 8001a64: 5b 8c 00 34 sw (sp+52),r12 8001a68: 5b 8d 00 30 sw (sp+48),r13 8001a6c: 5b 8e 00 2c sw (sp+44),r14 8001a70: 5b 8f 00 28 sw (sp+40),r15 8001a74: 5b 90 00 24 sw (sp+36),r16 8001a78: 5b 91 00 20 sw (sp+32),r17 8001a7c: 5b 92 00 1c sw (sp+28),r18 8001a80: 5b 93 00 18 sw (sp+24),r19 8001a84: 5b 94 00 14 sw (sp+20),r20 8001a88: 5b 95 00 10 sw (sp+16),r21 8001a8c: 5b 96 00 0c sw (sp+12),r22 8001a90: 5b 97 00 08 sw (sp+8),r23 8001a94: 5b 9d 00 04 sw (sp+4),ra 8001a98: b8 20 70 00 mv r14,r1 /* * Are the file system options valid? */ if ( options != RTEMS_FILESYSTEM_READ_ONLY && 8001a9c: 34 01 00 01 mvi r1,1 const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 8001aa0: b8 40 80 00 mv r16,r2 8001aa4: b8 60 90 00 mv r18,r3 8001aa8: b8 80 a8 00 mv r21,r4 8001aac: b8 a0 b8 00 mv r23,r5 /* * Are the file system options valid? */ if ( options != RTEMS_FILESYSTEM_READ_ONLY && 8001ab0: 50 24 00 02 bgeu r1,r4,8001ab8 8001ab4: e0 00 00 05 bi 8001ac8 rtems_set_errno_and_return_minus_one( EINVAL ); /* * Get mount handler */ mount_h = rtems_filesystem_get_mount_handler( filesystemtype ); 8001ab8: b8 60 08 00 mv r1,r3 8001abc: f8 00 1a 4a calli 80083e4 8001ac0: b8 20 98 00 mv r19,r1 if ( !mount_h ) 8001ac4: 5c 20 00 04 bne r1,r0,8001ad4 rtems_set_errno_and_return_minus_one( EINVAL ); 8001ac8: f8 00 26 4d calli 800b3fc <__errno> 8001acc: 34 02 00 16 mvi r2,22 8001ad0: e0 00 00 34 bi 8001ba0 { 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; 8001ad4: 7e 0f 00 00 cmpnei r15,r16,0 const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; 8001ad8: ba 00 68 00 mv r13,r16 8001adc: 5d e0 00 03 bne r15,r0,8001ae8 8001ae0: 78 0d 08 01 mvhi r13,0x801 8001ae4: 39 ad 1b 84 ori r13,r13,0x1b84 size_t filesystemtype_size = strlen( filesystemtype ) + 1; 8001ae8: ba 40 08 00 mv r1,r18 8001aec: f8 00 2a f0 calli 800c6ac 8001af0: 34 36 00 01 addi r22,r1,1 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 8001af4: 34 11 00 00 mvi r17,0 8001af8: 45 c0 00 04 be r14,r0,8001b08 8001afc: b9 c0 08 00 mv r1,r14 8001b00: f8 00 2a eb calli 800c6ac 8001b04: 34 31 00 01 addi r17,r1,1 size_t target_length = strlen( target ); 8001b08: b9 a0 08 00 mv r1,r13 8001b0c: f8 00 2a e8 calli 800c6ac size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_length + 1; 8001b10: 36 c3 00 75 addi r3,r22,117 8001b14: b4 61 18 00 add r3,r3,r1 { const char *target = target_or_null != NULL ? target_or_null : "/"; size_t filesystemtype_size = strlen( filesystemtype ) + 1; size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; size_t target_length = strlen( target ); 8001b18: b8 20 a0 00 mv r20,r1 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_length + 1; rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); 8001b1c: b4 71 10 00 add r2,r3,r17 8001b20: 34 01 00 01 mvi r1,1 8001b24: fb ff fd 7d calli 8001118 8001b28: b8 20 58 00 mv r11,r1 if ( mt_entry != NULL ) { 8001b2c: 44 20 00 1b be r1,r0,8001b98 <== NEVER TAKEN char *str = (char *) mt_entry + sizeof( *mt_entry ); 8001b30: 34 2c 00 74 addi r12,r1,116 strcpy( str, filesystemtype ); 8001b34: b9 80 08 00 mv r1,r12 8001b38: ba 40 10 00 mv r2,r18 8001b3c: f8 00 2a 95 calli 800c590 mt_entry->type = str; 8001b40: 59 6c 00 6c sw (r11+108),r12 str += filesystemtype_size; 8001b44: b5 96 60 00 add r12,r12,r22 if ( source_or_null != NULL ) { 8001b48: 45 c0 00 06 be r14,r0,8001b60 strcpy( str, source_or_null ); 8001b4c: b9 80 08 00 mv r1,r12 8001b50: b9 c0 10 00 mv r2,r14 8001b54: f8 00 2a 8f calli 800c590 mt_entry->dev = str; 8001b58: 59 6c 00 70 sw (r11+112),r12 str += source_size; 8001b5c: b5 91 60 00 add r12,r12,r17 } strcpy( str, target ); 8001b60: b9 a0 10 00 mv r2,r13 8001b64: b9 80 08 00 mv r1,r12 8001b68: f8 00 2a 8a calli 800c590 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; 8001b6c: 78 03 08 01 mvhi r3,0x801 8001b70: b8 60 10 00 mv r2,r3 8001b74: 35 61 00 38 addi r1,r11,56 8001b78: 38 42 1b d8 ori r2,r2,0x1bd8 8001b7c: 34 03 00 30 mvi r3,48 mt_entry->dev = str; str += source_size; } strcpy( str, target ); mt_entry->target = str; 8001b80: 59 6c 00 68 sw (r11+104),r12 &target_length ); if ( !mt_entry ) rtems_set_errno_and_return_minus_one( ENOMEM ); mt_entry->mt_fs_root.mt_entry = mt_entry; 8001b84: 59 6b 00 2c sw (r11+44),r11 mt_entry->options = options; 8001b88: 59 75 00 30 sw (r11+48),r21 mt_entry->pathconf_limits_and_options = rtems_filesystem_default_pathconf; 8001b8c: f8 00 28 d2 calli 800bed4 /* * The mount_point should be a directory with read/write/execute * permissions in the existing tree. */ if ( has_target ) { 8001b90: 45 e0 00 2f be r15,r0,8001c4c 8001b94: e0 00 00 06 bi 8001bac target, filesystemtype, &target_length ); if ( !mt_entry ) rtems_set_errno_and_return_minus_one( ENOMEM ); 8001b98: f8 00 26 19 calli 800b3fc <__errno> <== NOT EXECUTED 8001b9c: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8001ba0: 58 22 00 00 sw (r1+0),r2 8001ba4: 34 0d ff ff mvi r13,-1 8001ba8: e0 00 00 5a bi 8001d10 * The mount_point should be a directory with read/write/execute * permissions in the existing tree. */ if ( has_target ) { if ( rtems_filesystem_evaluate_path( 8001bac: 37 8c 00 3c addi r12,sp,60 8001bb0: ba 80 10 00 mv r2,r20 8001bb4: ba 00 08 00 mv r1,r16 8001bb8: 34 03 00 07 mvi r3,7 8001bbc: b9 80 20 00 mv r4,r12 8001bc0: 34 05 00 01 mvi r5,1 8001bc4: fb ff fd a0 calli 8001244 8001bc8: 34 02 ff ff mvi r2,-1 8001bcc: 44 22 00 4a be r1,r2,8001cf4 <== NEVER TAKEN /* * Test to see if it is a directory */ if ( loc.ops->node_type_h( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 8001bd0: 2b 81 00 48 lw r1,(sp+72) 8001bd4: 28 23 00 10 lw r3,(r1+16) 8001bd8: b9 80 08 00 mv r1,r12 8001bdc: d8 60 00 00 call r3 8001be0: 34 02 00 01 mvi r2,1 8001be4: 44 22 00 04 be r1,r2,8001bf4 errno = ENOTDIR; 8001be8: f8 00 26 05 calli 800b3fc <__errno> 8001bec: 34 02 00 14 mvi r2,20 8001bf0: e0 00 00 20 bi 8001c70 /* * You can only mount one file system onto a single mount point. */ if ( rtems_filesystem_mount_iterate( is_node_fs_root, loc.node_access ) ) { 8001bf4: 2b 82 00 3c lw r2,(sp+60) 8001bf8: 78 01 08 00 mvhi r1,0x800 8001bfc: 38 21 19 78 ori r1,r1,0x1978 8001c00: fb ff ff 75 calli 80019d4 8001c04: b8 20 68 00 mv r13,r1 8001c08: 44 20 00 04 be r1,r0,8001c18 errno = EBUSY; 8001c0c: f8 00 25 fc calli 800b3fc <__errno> 8001c10: 34 02 00 10 mvi r2,16 8001c14: e0 00 00 17 bi 8001c70 * 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; 8001c18: 2b 81 00 3c lw r1,(sp+60) mt_entry->mt_point_node.handlers = loc.handlers; mt_entry->mt_point_node.ops = loc.ops; mt_entry->mt_point_node.mt_entry = loc.mt_entry; 8001c1c: 2b 82 00 4c lw r2,(sp+76) * may have been allocated in loc should not be sent to freenode * until the system is unmounted. It may be needed to correctly * traverse the tree. */ mt_entry->mt_point_node.node_access = loc.node_access; 8001c20: 59 61 00 08 sw (r11+8),r1 mt_entry->mt_point_node.handlers = loc.handlers; 8001c24: 2b 81 00 44 lw r1,(sp+68) mt_entry->mt_point_node.ops = loc.ops; mt_entry->mt_point_node.mt_entry = loc.mt_entry; 8001c28: 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; 8001c2c: 59 61 00 10 sw (r11+16),r1 mt_entry->mt_point_node.ops = loc.ops; 8001c30: 2b 81 00 48 lw r1,(sp+72) /* * This link to the parent is only done when we are dealing with system * below the base file system */ if ( loc.ops->mount_h( mt_entry ) ) { 8001c34: 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; 8001c38: 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 ) ) { 8001c3c: b9 60 08 00 mv r1,r11 8001c40: d8 60 00 00 call r3 8001c44: 44 2d 00 0d be r1,r13,8001c78 <== ALWAYS TAKEN 8001c48: e0 00 00 2c bi 8001cf8 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 8001c4c: 78 04 08 01 mvhi r4,0x801 8001c50: 38 84 31 10 ori r4,r4,0x3110 } } else { /* * Do we already have a base file system ? */ if ( !rtems_chain_is_empty( &mount_chain ) ) { 8001c54: 28 81 00 00 lw r1,(r4+0) 8001c58: 78 03 08 01 mvhi r3,0x801 8001c5c: 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; 8001c60: 34 0c 00 00 mvi r12,0 } } else { /* * Do we already have a base file system ? */ if ( !rtems_chain_is_empty( &mount_chain ) ) { 8001c64: 44 23 00 05 be r1,r3,8001c78 <== ALWAYS TAKEN errno = EINVAL; 8001c68: f8 00 25 e5 calli 800b3fc <__errno> <== NOT EXECUTED 8001c6c: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8001c70: 58 22 00 00 sw (r1+0),r2 goto cleanup_and_bail; 8001c74: e0 00 00 21 bi 8001cf8 * 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 ) ) { 8001c78: b9 60 08 00 mv r1,r11 8001c7c: ba e0 10 00 mv r2,r23 8001c80: da 60 00 00 call r19 8001c84: 44 20 00 06 be r1,r0,8001c9c <== ALWAYS TAKEN /* * Try to undo the mount operation */ loc.ops->unmount_h( mt_entry ); 8001c88: 2b 81 00 48 lw r1,(sp+72) <== NOT EXECUTED 8001c8c: 28 22 00 28 lw r2,(r1+40) <== NOT EXECUTED 8001c90: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8001c94: d8 40 00 00 call r2 <== NOT EXECUTED goto cleanup_and_bail; 8001c98: e0 00 00 18 bi 8001cf8 <== NOT EXECUTED } /* * Add the mount table entry to the mount table chain */ rtems_libio_lock(); 8001c9c: fb ff ff 3a calli 8001984 8001ca0: 78 01 08 01 mvhi r1,0x801 8001ca4: 38 21 31 10 ori r1,r1,0x3110 8001ca8: b9 60 10 00 mv r2,r11 rtems_libio_unlock(); if ( !has_target ) rtems_filesystem_root = mt_entry->mt_fs_root; return 0; 8001cac: 34 0d 00 00 mvi r13,0 8001cb0: f8 00 06 24 calli 8003540 <_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(); 8001cb4: fb ff ff 3f calli 80019b0 if ( !has_target ) 8001cb8: 5d ed 00 16 bne r15,r13,8001d10 rtems_filesystem_root = mt_entry->mt_fs_root; 8001cbc: 78 01 08 01 mvhi r1,0x801 8001cc0: 38 21 31 1c ori r1,r1,0x311c 8001cc4: 28 21 00 00 lw r1,(r1+0) 8001cc8: 29 66 00 1c lw r6,(r11+28) 8001ccc: 29 65 00 20 lw r5,(r11+32) 8001cd0: 29 64 00 24 lw r4,(r11+36) 8001cd4: 29 63 00 28 lw r3,(r11+40) 8001cd8: 29 62 00 2c lw r2,(r11+44) 8001cdc: 58 26 00 18 sw (r1+24),r6 8001ce0: 58 25 00 1c sw (r1+28),r5 8001ce4: 58 24 00 20 sw (r1+32),r4 8001ce8: 58 23 00 24 sw (r1+36),r3 8001cec: 58 22 00 28 sw (r1+40),r2 8001cf0: e0 00 00 08 bi 8001d10 ) { 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; 8001cf4: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED return 0; cleanup_and_bail: free( mt_entry ); 8001cf8: b9 60 08 00 mv r1,r11 8001cfc: fb ff fd ac calli 80013ac if ( loc_to_free ) rtems_filesystem_freenode( loc_to_free ); return -1; 8001d00: 34 0d ff ff mvi r13,-1 cleanup_and_bail: free( mt_entry ); if ( loc_to_free ) 8001d04: 45 80 00 03 be r12,r0,8001d10 <== NEVER TAKEN rtems_filesystem_freenode( loc_to_free ); 8001d08: b9 80 08 00 mv r1,r12 8001d0c: fb ff fd a0 calli 800138c return -1; } 8001d10: b9 a0 08 00 mv r1,r13 8001d14: 2b 9d 00 04 lw ra,(sp+4) 8001d18: 2b 8b 00 38 lw r11,(sp+56) 8001d1c: 2b 8c 00 34 lw r12,(sp+52) 8001d20: 2b 8d 00 30 lw r13,(sp+48) 8001d24: 2b 8e 00 2c lw r14,(sp+44) 8001d28: 2b 8f 00 28 lw r15,(sp+40) 8001d2c: 2b 90 00 24 lw r16,(sp+36) 8001d30: 2b 91 00 20 lw r17,(sp+32) 8001d34: 2b 92 00 1c lw r18,(sp+28) 8001d38: 2b 93 00 18 lw r19,(sp+24) 8001d3c: 2b 94 00 14 lw r20,(sp+20) 8001d40: 2b 95 00 10 lw r21,(sp+16) 8001d44: 2b 96 00 0c lw r22,(sp+12) 8001d48: 2b 97 00 08 lw r23,(sp+8) 8001d4c: 37 9c 00 4c addi sp,sp,76 8001d50: c3 a0 00 00 ret =============================================================================== 08002084 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 8002084: 37 9c ff e8 addi sp,sp,-24 8002088: 5b 8b 00 0c sw (sp+12),r11 800208c: 5b 8c 00 08 sw (sp+8),r12 8002090: 5b 9d 00 04 sw (sp+4),ra 8002094: b8 20 60 00 mv r12,r1 8002098: b8 40 58 00 mv r11,r2 int rv = -1; if (target != NULL) { 800209c: 44 40 00 0f be r2,r0,80020d8 rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); 80020a0: b8 40 08 00 mv r1,r2 80020a4: 34 02 01 ff mvi r2,511 80020a8: 5b 83 00 18 sw (sp+24),r3 80020ac: 5b 84 00 14 sw (sp+20),r4 80020b0: 5b 85 00 10 sw (sp+16),r5 80020b4: f8 00 02 8c calli 8002ae4 if (rv == 0) { 80020b8: 2b 83 00 18 lw r3,(sp+24) 80020bc: 2b 84 00 14 lw r4,(sp+20) 80020c0: 2b 85 00 10 lw r5,(sp+16) 80020c4: 5c 20 00 09 bne r1,r0,80020e8 <== NEVER TAKEN rv = mount( 80020c8: b9 80 08 00 mv r1,r12 80020cc: b9 60 10 00 mv r2,r11 80020d0: f8 00 00 44 calli 80021e0 80020d4: e0 00 00 05 bi 80020e8 options, data ); } } else { errno = EINVAL; 80020d8: f8 00 25 30 calli 800b598 <__errno> 80020dc: 34 02 00 16 mvi r2,22 80020e0: 58 22 00 00 sw (r1+0),r2 const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { int rv = -1; 80020e4: 34 01 ff ff mvi r1,-1 } else { errno = EINVAL; } return rv; } 80020e8: 2b 9d 00 04 lw ra,(sp+4) 80020ec: 2b 8b 00 0c lw r11,(sp+12) 80020f0: 2b 8c 00 08 lw r12,(sp+8) 80020f4: 37 9c 00 18 addi sp,sp,24 80020f8: c3 a0 00 00 ret =============================================================================== 08001f7c : void newlib_delete_hook( rtems_tcb *current_task, rtems_tcb *deleted_task ) { 8001f7c: 37 9c ff f0 addi sp,sp,-16 8001f80: 5b 8b 00 10 sw (sp+16),r11 8001f84: 5b 8c 00 0c sw (sp+12),r12 8001f88: 5b 8d 00 08 sw (sp+8),r13 8001f8c: 5b 9d 00 04 sw (sp+4),ra 8001f90: b8 20 68 00 mv r13,r1 8001f94: b8 40 60 00 mv r12,r2 /* * The reentrancy structure was allocated by newlib using malloc() */ if (current_task == deleted_task) { 8001f98: 5c 22 00 05 bne r1,r2,8001fac ptr = _REENT; 8001f9c: 78 02 08 01 mvhi r2,0x801 8001fa0: 38 42 31 70 ori r2,r2,0x3170 8001fa4: 28 4b 00 00 lw r11,(r2+0) 8001fa8: e0 00 00 02 bi 8001fb0 } else { ptr = deleted_task->libc_reent; 8001fac: 28 4b 01 20 lw r11,(r2+288) } if (ptr && ptr != _global_impure_ptr) { 8001fb0: 45 60 00 0b be r11,r0,8001fdc <== NEVER TAKEN 8001fb4: 78 02 08 01 mvhi r2,0x801 8001fb8: 38 42 20 b8 ori r2,r2,0x20b8 8001fbc: 28 41 00 00 lw r1,(r2+0) 8001fc0: 45 61 00 07 be r11,r1,8001fdc _reclaim_reent(ptr); */ /* * Just in case there are some buffers lying around. */ _fwalk(ptr, newlib_free_buffers); 8001fc4: 78 02 08 00 mvhi r2,0x800 8001fc8: b9 60 08 00 mv r1,r11 8001fcc: 38 42 1d 58 ori r2,r2,0x1d58 8001fd0: f8 00 27 59 calli 800bd34 <_fwalk> #if REENT_MALLOCED free(ptr); #else _Workspace_Free(ptr); 8001fd4: b9 60 08 00 mv r1,r11 8001fd8: f8 00 12 4e calli 8006910 <_Workspace_Free> #endif } deleted_task->libc_reent = NULL; 8001fdc: 59 80 01 20 sw (r12+288),r0 /* * Require the switch back to another task to install its own */ if ( current_task == deleted_task ) { 8001fe0: 5d ac 00 04 bne r13,r12,8001ff0 _REENT = 0; 8001fe4: 78 01 08 01 mvhi r1,0x801 8001fe8: 38 21 31 70 ori r1,r1,0x3170 8001fec: 58 20 00 00 sw (r1+0),r0 } } 8001ff0: 2b 9d 00 04 lw ra,(sp+4) 8001ff4: 2b 8b 00 10 lw r11,(sp+16) 8001ff8: 2b 8c 00 0c lw r12,(sp+12) 8001ffc: 2b 8d 00 08 lw r13,(sp+8) 8002000: 37 9c 00 10 addi sp,sp,16 8002004: c3 a0 00 00 ret =============================================================================== 08001d58 : */ int newlib_free_buffers( FILE *fp ) { 8001d58: 37 9c ff f8 addi sp,sp,-8 8001d5c: 5b 8b 00 08 sw (sp+8),r11 8001d60: 5b 9d 00 04 sw (sp+4),ra 8001d64: b8 20 58 00 mv r11,r1 switch ( fileno(fp) ) { 8001d68: f8 00 26 ba calli 800b850 8001d6c: 34 02 00 02 mvi r2,2 8001d70: 54 22 00 0c bgu r1,r2,8001da0 <== NEVER TAKEN case 0: case 1: case 2: if (fp->_flags & __SMBF) { 8001d74: 2d 61 00 0c lhu r1,(r11+12) 8001d78: 20 21 00 80 andi r1,r1,0x80 8001d7c: 44 20 00 0b be r1,r0,8001da8 <== ALWAYS TAKEN free( fp->_bf._base ); 8001d80: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8001d84: fb ff fd 8a calli 80013ac <== NOT EXECUTED fp->_flags &= ~__SMBF; 8001d88: 2d 61 00 0c lhu r1,(r11+12) <== NOT EXECUTED fp->_bf._base = fp->_p = (unsigned char *) NULL; 8001d8c: 59 60 00 00 sw (r11+0),r0 <== NOT EXECUTED 8001d90: 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; 8001d94: 20 21 ff 7f andi r1,r1,0xff7f <== NOT EXECUTED 8001d98: 0d 61 00 0c sh (r11+12),r1 <== NOT EXECUTED 8001d9c: e0 00 00 03 bi 8001da8 <== NOT EXECUTED fp->_bf._base = fp->_p = (unsigned char *) NULL; } break; default: fclose(fp); 8001da0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8001da4: f8 00 25 f6 calli 800b57c <== NOT EXECUTED } return 0; } 8001da8: 34 01 00 00 mvi r1,0 8001dac: 2b 9d 00 04 lw ra,(sp+4) 8001db0: 2b 8b 00 08 lw r11,(sp+8) 8001db4: 37 9c 00 08 addi sp,sp,8 8001db8: c3 a0 00 00 ret =============================================================================== 08001818 : rtems_device_driver null_initialize( rtems_device_major_number major, rtems_device_minor_number minor __attribute__((unused)), void *pargp __attribute__((unused)) ) { 8001818: 37 9c ff f4 addi sp,sp,-12 800181c: 5b 8b 00 0c sw (sp+12),r11 8001820: 5b 8c 00 08 sw (sp+8),r12 8001824: 5b 9d 00 04 sw (sp+4),ra rtems_device_driver status; if ( !initialized ) { 8001828: 78 03 08 01 mvhi r3,0x801 800182c: 38 63 e6 a4 ori r3,r3,0xe6a4 8001830: 40 6c 00 00 lbu r12,(r3+0) rtems_device_driver null_initialize( rtems_device_major_number major, rtems_device_minor_number minor __attribute__((unused)), void *pargp __attribute__((unused)) ) { 8001834: b8 20 58 00 mv r11,r1 rtems_device_driver status; if ( !initialized ) { 8001838: 5d 80 00 0d bne r12,r0,800186c initialized = 1; 800183c: 34 01 00 01 mvi r1,1 8001840: 30 61 00 00 sb (r3+0),r1 status = rtems_io_register_name( 8001844: 78 01 08 01 mvhi r1,0x801 8001848: 38 21 b9 e0 ori r1,r1,0xb9e0 800184c: b9 60 10 00 mv r2,r11 8001850: 34 03 00 00 mvi r3,0 8001854: f8 00 01 b9 calli 8001f38 "/dev/null", major, (rtems_device_minor_number) 0 ); if (status != RTEMS_SUCCESSFUL) 8001858: 44 2c 00 02 be r1,r12,8001860 <== ALWAYS TAKEN rtems_fatal_error_occurred(status); 800185c: f8 00 0a 9e calli 80042d4 <== NOT EXECUTED NULL_major = major; 8001860: 78 03 08 01 mvhi r3,0x801 8001864: 38 63 e7 2c ori r3,r3,0xe72c 8001868: 58 6b 00 00 sw (r3+0),r11 } return RTEMS_SUCCESSFUL; } 800186c: 34 01 00 00 mvi r1,0 8001870: 2b 9d 00 04 lw ra,(sp+4) 8001874: 2b 8b 00 0c lw r11,(sp+12) 8001878: 2b 8c 00 08 lw r12,(sp+8) 800187c: 37 9c 00 0c addi sp,sp,12 8001880: c3 a0 00 00 ret =============================================================================== 0800189c : void *pargp ) { rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) pargp; if ( rw_args ) 800189c: 44 60 00 03 be r3,r0,80018a8 <== ALWAYS TAKEN rw_args->bytes_moved = rw_args->count; 80018a0: 28 61 00 14 lw r1,(r3+20) <== NOT EXECUTED 80018a4: 58 61 00 1c sw (r3+28),r1 <== NOT EXECUTED return NULL_SUCCESSFUL; } 80018a8: 34 01 00 00 mvi r1,0 80018ac: c3 a0 00 00 ret =============================================================================== 0800208c : int open( const char *pathname, int flags, ... ) { 800208c: 37 9c ff ac addi sp,sp,-84 8002090: 5b 8b 00 24 sw (sp+36),r11 8002094: 5b 8c 00 20 sw (sp+32),r12 8002098: 5b 8d 00 1c sw (sp+28),r13 800209c: 5b 8e 00 18 sw (sp+24),r14 80020a0: 5b 8f 00 14 sw (sp+20),r15 80020a4: 5b 90 00 10 sw (sp+16),r16 80020a8: 5b 91 00 0c sw (sp+12),r17 80020ac: 5b 92 00 08 sw (sp+8),r18 80020b0: 5b 9d 00 04 sw (sp+4),ra 80020b4: b8 20 78 00 mv r15,r1 /* * Set the Evaluation flags */ eval_flags = 0; status = flags + 1; 80020b8: 34 41 00 01 addi r1,r2,1 int open( const char *pathname, int flags, ... ) { 80020bc: 5b 82 00 3c sw (sp+60),r2 80020c0: b8 40 70 00 mv r14,r2 80020c4: 5b 83 00 40 sw (sp+64),r3 80020c8: 5b 84 00 44 sw (sp+68),r4 80020cc: 5b 85 00 48 sw (sp+72),r5 80020d0: 5b 86 00 4c sw (sp+76),r6 80020d4: 5b 87 00 50 sw (sp+80),r7 80020d8: 5b 88 00 54 sw (sp+84),r8 /* * Set the Evaluation flags */ eval_flags = 0; status = flags + 1; if ( ( status & _FREAD ) == _FREAD ) 80020dc: 20 22 00 01 andi r2,r1,0x1 int eval_flags; /* * Set the Evaluation flags */ eval_flags = 0; 80020e0: 34 10 00 00 mvi r16,0 status = flags + 1; if ( ( status & _FREAD ) == _FREAD ) 80020e4: 44 40 00 02 be r2,r0,80020ec eval_flags |= RTEMS_LIBIO_PERMS_READ; 80020e8: 34 10 00 04 mvi r16,4 if ( ( status & _FWRITE ) == _FWRITE ) 80020ec: 20 21 00 02 andi r1,r1,0x2 80020f0: 44 20 00 02 be r1,r0,80020f8 eval_flags |= RTEMS_LIBIO_PERMS_WRITE; 80020f4: 3a 10 00 02 ori r16,r16,0x2 va_start(ap, flags); mode = va_arg( ap, int ); 80020f8: 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(); 80020fc: f8 00 17 e1 calli 8008080 8002100: 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; 8002104: 34 0d 00 00 mvi r13,0 */ /* allocate a file control block */ iop = rtems_libio_allocate(); if ( iop == 0 ) { rc = ENFILE; 8002108: 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 ) { 800210c: 44 20 00 62 be r1,r0,8002294 } /* * See if the file exists. */ status = rtems_filesystem_evaluate_path( 8002110: b9 e0 08 00 mv r1,r15 8002114: f8 00 29 66 calli 800c6ac 8002118: 37 91 00 28 addi r17,sp,40 800211c: b8 20 10 00 mv r2,r1 8002120: ba 00 18 00 mv r3,r16 8002124: b9 e0 08 00 mv r1,r15 8002128: ba 20 20 00 mv r4,r17 800212c: 34 05 00 01 mvi r5,1 8002130: fb ff fc 45 calli 8001244 pathname, strlen( pathname ), eval_flags, &loc, true ); if ( status == -1 ) { 8002134: 34 02 ff ff mvi r2,-1 8002138: 5c 22 00 1c bne r1,r2,80021a8 if ( errno != ENOENT ) { 800213c: f8 00 24 b0 calli 800b3fc <__errno> 8002140: 28 22 00 00 lw r2,(r1+0) 8002144: 34 01 00 02 mvi r1,2 8002148: 5c 41 00 0a bne r2,r1,8002170 rc = errno; goto done; } /* If the file does not exist and we are not trying to create it--> error */ if ( !(flags & O_CREAT) ) { 800214c: 21 c1 02 00 andi r1,r14,0x200 rc = ENOENT; 8002150: 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) ) { 8002154: 44 20 00 50 be r1,r0,8002294 rc = ENOENT; goto done; } /* Create the node for the new regular file */ rc = mknod( pathname, S_IFREG | mode, 0LL ); 8002158: b9 e0 08 00 mv r1,r15 800215c: 3a 42 80 00 ori r2,r18,0x8000 8002160: 34 03 00 00 mvi r3,0 8002164: 34 04 00 00 mvi r4,0 8002168: fb ff fd d3 calli 80018b4 if ( rc ) { 800216c: 44 20 00 04 be r1,r0,800217c <== ALWAYS TAKEN rc = errno; 8002170: f8 00 24 a3 calli 800b3fc <__errno> 8002174: 28 2c 00 00 lw r12,(r1+0) goto done; 8002178: e0 00 00 46 bi 8002290 /* * 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( 800217c: b9 e0 08 00 mv r1,r15 8002180: f8 00 29 4b calli 800c6ac 8002184: b8 20 10 00 mv r2,r1 8002188: 34 03 00 00 mvi r3,0 800218c: b9 e0 08 00 mv r1,r15 8002190: ba 20 20 00 mv r4,r17 8002194: 34 05 00 01 mvi r5,1 8002198: fb ff fc 2b calli 8001244 pathname, strlen( pathname ), 0x0, &loc, true ); if ( status != 0 ) { /* The file did not exist */ rc = EACCES; 800219c: 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 */ 80021a0: 5d a1 00 3d bne r13,r1,8002294 <== NEVER TAKEN 80021a4: e0 00 00 06 bi 80021bc rc = EACCES; goto done; } } else if ((flags & (O_EXCL|O_CREAT)) == (O_EXCL|O_CREAT)) { 80021a8: 21 c2 0a 00 andi r2,r14,0xa00 80021ac: 34 01 0a 00 mvi r1,2560 /* We were trying to create a file that already exists */ rc = EEXIST; loc_to_free = &loc; 80021b0: 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; 80021b4: 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)) { 80021b8: 44 41 00 37 be r2,r1,8002294 /* * Fill in the file control block based on the loc structure * returned by successful path evaluation. */ iop->flags |= rtems_libio_fcntl_flags( flags ); 80021bc: b9 c0 08 00 mv r1,r14 80021c0: 29 6c 00 18 lw r12,(r11+24) 80021c4: f8 00 17 85 calli 8007fd8 iop->pathinfo = loc; 80021c8: 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 ); 80021cc: b8 2c 08 00 or r1,r1,r12 80021d0: 59 61 00 18 sw (r11+24),r1 iop->pathinfo = loc; 80021d4: 59 62 00 1c sw (r11+28),r2 80021d8: 2b 82 00 2c lw r2,(sp+44) 80021dc: 2b 81 00 30 lw r1,(sp+48) rc = (*iop->pathinfo.handlers->open_h)( iop, pathname, flags, mode ); 80021e0: 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; 80021e4: 59 62 00 20 sw (r11+32),r2 80021e8: 2b 82 00 34 lw r2,(sp+52) rc = (*iop->pathinfo.handlers->open_h)( iop, pathname, flags, mode ); 80021ec: 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; 80021f0: 59 61 00 24 sw (r11+36),r1 80021f4: 59 62 00 28 sw (r11+40),r2 80021f8: 2b 82 00 38 lw r2,(sp+56) rc = (*iop->pathinfo.handlers->open_h)( iop, pathname, flags, mode ); 80021fc: b9 60 08 00 mv r1,r11 8002200: 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; 8002204: 59 62 00 2c sw (r11+44),r2 rc = (*iop->pathinfo.handlers->open_h)( iop, pathname, flags, mode ); 8002208: b9 e0 10 00 mv r2,r15 800220c: d8 a0 00 00 call r5 if ( rc ) { 8002210: 44 20 00 05 be r1,r0,8002224 rc = errno; 8002214: f8 00 24 7a calli 800b3fc <__errno> 8002218: 28 2c 00 00 lw r12,(r1+0) rc = EEXIST; loc_to_free = &loc; goto done; } loc_to_free = &loc; 800221c: 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; 8002220: e0 00 00 1c bi 8002290 } /* * Optionally truncate the file. */ if ( (flags & O_TRUNC) == O_TRUNC ) { 8002224: 21 ce 04 00 andi r14,r14,0x400 8002228: 45 c1 00 25 be r14,r1,80022bc rc = ftruncate( iop - rtems_libio_iops, 0 ); 800222c: 78 01 08 01 mvhi r1,0x801 8002230: 38 21 36 a0 ori r1,r1,0x36a0 8002234: 28 21 00 00 lw r1,(r1+0) 8002238: 34 02 00 06 mvi r2,6 rc = EEXIST; loc_to_free = &loc; goto done; } loc_to_free = &loc; 800223c: 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 ); 8002240: c9 61 08 00 sub r1,r11,r1 8002244: f8 00 39 ad calli 80108f8 <__ashrsi3> 8002248: 34 02 00 00 mvi r2,0 800224c: f8 00 17 0f calli 8007e88 8002250: b8 20 60 00 mv r12,r1 if ( rc ) { 8002254: 44 20 00 0f be r1,r0,8002290 if(errno) rc = errno; 8002258: f8 00 24 69 calli 800b3fc <__errno> 800225c: 28 21 00 00 lw r1,(r1+0) 8002260: 44 20 00 03 be r1,r0,800226c <== NEVER TAKEN 8002264: f8 00 24 66 calli 800b3fc <__errno> 8002268: 28 2c 00 00 lw r12,(r1+0) close( iop - rtems_libio_iops ); 800226c: 78 01 08 01 mvhi r1,0x801 8002270: 38 21 36 a0 ori r1,r1,0x36a0 8002274: 28 21 00 00 lw r1,(r1+0) 8002278: 34 02 00 06 mvi r2,6 /* those are released by close(): */ iop = 0; loc_to_free = NULL; 800227c: 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 ); 8002280: c9 61 08 00 sub r1,r11,r1 8002284: f8 00 39 9d calli 80108f8 <__ashrsi3> 8002288: f8 00 16 d3 calli 8007dd4 /* those are released by close(): */ iop = 0; 800228c: 34 0b 00 00 mvi r11,0 * Single exit and clean up path. */ done: va_end(ap); if ( rc ) { 8002290: 45 80 00 0b be r12,r0,80022bc if ( iop ) 8002294: 45 60 00 03 be r11,r0,80022a0 rtems_libio_free( iop ); 8002298: b9 60 08 00 mv r1,r11 800229c: f8 00 17 a7 calli 8008138 if ( loc_to_free ) 80022a0: 45 a0 00 03 be r13,r0,80022ac rtems_filesystem_freenode( loc_to_free ); 80022a4: b9 a0 08 00 mv r1,r13 80022a8: fb ff fc 39 calli 800138c rtems_set_errno_and_return_minus_one( rc ); 80022ac: f8 00 24 54 calli 800b3fc <__errno> 80022b0: 58 2c 00 00 sw (r1+0),r12 80022b4: 34 01 ff ff mvi r1,-1 80022b8: e0 00 00 07 bi 80022d4 } return iop - rtems_libio_iops; 80022bc: 78 01 08 01 mvhi r1,0x801 80022c0: 38 21 36 a0 ori r1,r1,0x36a0 80022c4: 28 21 00 00 lw r1,(r1+0) 80022c8: 34 02 00 06 mvi r2,6 80022cc: c9 61 08 00 sub r1,r11,r1 80022d0: f8 00 39 8a calli 80108f8 <__ashrsi3> } 80022d4: 2b 9d 00 04 lw ra,(sp+4) 80022d8: 2b 8b 00 24 lw r11,(sp+36) 80022dc: 2b 8c 00 20 lw r12,(sp+32) 80022e0: 2b 8d 00 1c lw r13,(sp+28) 80022e4: 2b 8e 00 18 lw r14,(sp+24) 80022e8: 2b 8f 00 14 lw r15,(sp+20) 80022ec: 2b 90 00 10 lw r16,(sp+16) 80022f0: 2b 91 00 0c lw r17,(sp+12) 80022f4: 2b 92 00 08 lw r18,(sp+8) 80022f8: 37 9c 00 54 addi sp,sp,84 80022fc: c3 a0 00 00 ret =============================================================================== 08002008 : /* * This is a replaceable stub which opens the console, if present. */ void open_dev_console(void) { 8002008: 37 9c ff f4 addi sp,sp,-12 800200c: 5b 8b 00 0c sw (sp+12),r11 8002010: 5b 8c 00 08 sw (sp+8),r12 8002014: 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) { 8002018: 78 0b 08 01 mvhi r11,0x801 800201c: 39 6b 1b 14 ori r11,r11,0x1b14 8002020: b9 60 08 00 mv r1,r11 8002024: 34 02 00 00 mvi r2,0 8002028: 34 03 00 00 mvi r3,0 800202c: f8 00 00 18 calli 800208c 8002030: 34 0c ff ff mvi r12,-1 8002034: 44 2c 00 11 be r1,r12,8002078 /* * 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) 8002038: 34 02 00 01 mvi r2,1 800203c: b9 60 08 00 mv r1,r11 8002040: 34 03 00 00 mvi r3,0 8002044: f8 00 00 12 calli 800208c rtems_fatal_error_occurred( 0x55544431 ); /* error STD1 */ 8002048: 78 02 08 01 mvhi r2,0x801 800204c: 38 42 1c 0c ori r2,r2,0x1c0c /* * 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) 8002050: 44 2c 00 08 be r1,r12,8002070 <== NEVER TAKEN rtems_fatal_error_occurred( 0x55544431 ); /* error STD1 */ if ((stderr_fd = open("/dev/console", O_WRONLY, 0)) == -1) 8002054: b9 60 08 00 mv r1,r11 8002058: 34 02 00 01 mvi r2,1 800205c: 34 03 00 00 mvi r3,0 8002060: f8 00 00 0b calli 800208c 8002064: 5c 2c 00 05 bne r1,r12,8002078 <== ALWAYS TAKEN rtems_fatal_error_occurred( 0x55544432 ); /* error STD2 */ 8002068: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 800206c: 38 42 1c 10 ori r2,r2,0x1c10 <== NOT EXECUTED 8002070: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 8002074: f8 00 04 2e calli 800312c <== NOT EXECUTED } 8002078: 2b 9d 00 04 lw ra,(sp+4) 800207c: 2b 8b 00 0c lw r11,(sp+12) 8002080: 2b 8c 00 08 lw r12,(sp+8) 8002084: 37 9c 00 0c addi sp,sp,12 8002088: c3 a0 00 00 ret =============================================================================== 080053cc : /* * Handle output processing */ static void oproc (unsigned char c, struct rtems_termios_tty *tty) { 80053cc: 37 9c ff f4 addi sp,sp,-12 80053d0: 5b 8b 00 08 sw (sp+8),r11 80053d4: 5b 9d 00 04 sw (sp+4),ra 80053d8: 33 81 00 0c sb (sp+12),r1 int i; if (tty->termios.c_oflag & OPOST) { 80053dc: 28 41 00 34 lw r1,(r2+52) /* * Handle output processing */ static void oproc (unsigned char c, struct rtems_termios_tty *tty) { 80053e0: b8 40 58 00 mv r11,r2 int i; if (tty->termios.c_oflag & OPOST) { 80053e4: 20 22 00 01 andi r2,r1,0x1 80053e8: 44 40 00 4d be r2,r0,800551c <== NEVER TAKEN switch (c) { 80053ec: 43 82 00 0c lbu r2,(sp+12) 80053f0: 34 03 00 09 mvi r3,9 80053f4: 44 43 00 21 be r2,r3,8005478 80053f8: 54 43 00 04 bgu r2,r3,8005408 <== ALWAYS TAKEN 80053fc: 34 03 00 08 mvi r3,8 <== NOT EXECUTED 8005400: 5c 43 00 30 bne r2,r3,80054c0 <== NOT EXECUTED 8005404: e0 00 00 2b bi 80054b0 <== NOT EXECUTED 8005408: 34 03 00 0a mvi r3,10 800540c: 44 43 00 04 be r2,r3,800541c 8005410: 34 03 00 0d mvi r3,13 8005414: 5c 43 00 2b bne r2,r3,80054c0 <== ALWAYS TAKEN 8005418: e0 00 00 0c bi 8005448 <== NOT EXECUTED case '\n': if (tty->termios.c_oflag & ONLRET) 800541c: 20 22 00 20 andi r2,r1,0x20 8005420: 44 40 00 02 be r2,r0,8005428 <== ALWAYS TAKEN tty->column = 0; 8005424: 59 60 00 28 sw (r11+40),r0 <== NOT EXECUTED if (tty->termios.c_oflag & ONLCR) { 8005428: 20 21 00 04 andi r1,r1,0x4 800542c: 44 20 00 3c be r1,r0,800551c <== NEVER TAKEN rtems_termios_puts ("\r", 1, tty); 8005430: 78 01 08 01 mvhi r1,0x801 8005434: 38 21 f3 50 ori r1,r1,0xf350 8005438: 34 02 00 01 mvi r2,1 800543c: b9 60 18 00 mv r3,r11 8005440: fb ff ff 8d calli 8005274 8005444: e0 00 00 0b bi 8005470 tty->column = 0; } break; case '\r': if ((tty->termios.c_oflag & ONOCR) && (tty->column == 0)) 8005448: 20 22 00 10 andi r2,r1,0x10 <== NOT EXECUTED 800544c: 44 40 00 03 be r2,r0,8005458 <== NOT EXECUTED 8005450: 29 62 00 28 lw r2,(r11+40) <== NOT EXECUTED 8005454: 44 40 00 36 be r2,r0,800552c <== NOT EXECUTED return; if (tty->termios.c_oflag & OCRNL) { 8005458: 20 22 00 08 andi r2,r1,0x8 <== NOT EXECUTED 800545c: 44 40 00 05 be r2,r0,8005470 <== NOT EXECUTED c = '\n'; 8005460: 34 02 00 0a mvi r2,10 <== NOT EXECUTED 8005464: 33 82 00 0c sb (sp+12),r2 <== NOT EXECUTED if (tty->termios.c_oflag & ONLRET) 8005468: 20 21 00 20 andi r1,r1,0x20 <== NOT EXECUTED 800546c: 44 20 00 2c be r1,r0,800551c <== NOT EXECUTED tty->column = 0; break; } tty->column = 0; 8005470: 59 60 00 28 sw (r11+40),r0 break; 8005474: e0 00 00 2a bi 800551c case '\t': i = 8 - (tty->column & 7); 8005478: 29 63 00 28 lw r3,(r11+40) 800547c: 34 04 00 08 mvi r4,8 if ((tty->termios.c_oflag & TABDLY) == XTABS) { 8005480: 20 21 18 00 andi r1,r1,0x1800 } tty->column = 0; break; case '\t': i = 8 - (tty->column & 7); 8005484: 20 62 00 07 andi r2,r3,0x7 8005488: c8 82 10 00 sub r2,r4,r2 if ((tty->termios.c_oflag & TABDLY) == XTABS) { 800548c: 34 04 18 00 mvi r4,6144 8005490: b4 43 18 00 add r3,r2,r3 8005494: 5c 24 00 05 bne r1,r4,80054a8 <== NEVER TAKEN tty->column += i; rtems_termios_puts ( " ", i, tty); 8005498: 78 01 08 01 mvhi r1,0x801 break; case '\t': i = 8 - (tty->column & 7); if ((tty->termios.c_oflag & TABDLY) == XTABS) { tty->column += i; 800549c: 59 63 00 28 sw (r11+40),r3 rtems_termios_puts ( " ", i, tty); 80054a0: 38 21 f3 54 ori r1,r1,0xf354 80054a4: e0 00 00 20 bi 8005524 return; } tty->column += i; 80054a8: 59 63 00 28 sw (r11+40),r3 <== NOT EXECUTED break; 80054ac: e0 00 00 1c bi 800551c <== NOT EXECUTED case '\b': if (tty->column > 0) 80054b0: 29 61 00 28 lw r1,(r11+40) <== NOT EXECUTED 80054b4: 4c 01 00 1a bge r0,r1,800551c <== NOT EXECUTED tty->column--; 80054b8: 34 21 ff ff addi r1,r1,-1 <== NOT EXECUTED 80054bc: e0 00 00 17 bi 8005518 <== NOT EXECUTED break; default: if (tty->termios.c_oflag & OLCUC) 80054c0: 20 21 00 02 andi r1,r1,0x2 80054c4: 44 20 00 0b be r1,r0,80054f0 <== ALWAYS TAKEN c = toupper(c); 80054c8: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 80054cc: 38 21 12 cc ori r1,r1,0x12cc <== NOT EXECUTED 80054d0: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED 80054d4: b4 22 08 00 add r1,r1,r2 <== NOT EXECUTED 80054d8: 40 23 00 01 lbu r3,(r1+1) <== NOT EXECUTED 80054dc: 34 01 00 02 mvi r1,2 <== NOT EXECUTED 80054e0: 20 63 00 03 andi r3,r3,0x3 <== NOT EXECUTED 80054e4: 5c 61 00 02 bne r3,r1,80054ec <== NOT EXECUTED 80054e8: 34 42 ff e0 addi r2,r2,-32 <== NOT EXECUTED 80054ec: 33 82 00 0c sb (sp+12),r2 <== NOT EXECUTED if (!iscntrl(c)) 80054f0: 78 01 08 02 mvhi r1,0x802 80054f4: 38 21 12 cc ori r1,r1,0x12cc 80054f8: 43 82 00 0c lbu r2,(sp+12) 80054fc: 28 21 00 00 lw r1,(r1+0) 8005500: b4 22 08 00 add r1,r1,r2 8005504: 40 21 00 01 lbu r1,(r1+1) 8005508: 20 21 00 20 andi r1,r1,0x20 800550c: 5c 20 00 04 bne r1,r0,800551c <== NEVER TAKEN tty->column++; 8005510: 29 61 00 28 lw r1,(r11+40) 8005514: 34 21 00 01 addi r1,r1,1 8005518: 59 61 00 28 sw (r11+40),r1 break; } } rtems_termios_puts (&c, 1, tty); 800551c: 37 81 00 0c addi r1,sp,12 8005520: 34 02 00 01 mvi r2,1 8005524: b9 60 18 00 mv r3,r11 8005528: fb ff ff 53 calli 8005274 } 800552c: 2b 9d 00 04 lw ra,(sp+4) 8005530: 2b 8b 00 08 lw r11,(sp+8) 8005534: 37 9c 00 0c addi sp,sp,12 8005538: c3 a0 00 00 ret =============================================================================== 080090dc : * Called by pipe() to create an anonymous pipe. */ int pipe_create( int filsdes[2] ) { 80090dc: 37 9c ff d8 addi sp,sp,-40 80090e0: 5b 8b 00 18 sw (sp+24),r11 80090e4: 5b 8c 00 14 sw (sp+20),r12 80090e8: 5b 8d 00 10 sw (sp+16),r13 80090ec: 5b 8e 00 0c sw (sp+12),r14 80090f0: 5b 8f 00 08 sw (sp+8),r15 80090f4: 5b 9d 00 04 sw (sp+4),ra 80090f8: 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) 80090fc: 78 01 08 01 mvhi r1,0x801 8009100: 38 21 c9 90 ori r1,r1,0xc990 8009104: 34 02 01 ff mvi r2,511 8009108: f8 00 06 3d calli 800a9fc 800910c: b8 20 78 00 mv r15,r1 return -1; 8009110: 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) 8009114: 5c 20 00 43 bne r1,r0,8009220 <== NEVER TAKEN return -1; /* /tmp/.fifoXXXX */ char fifopath[15]; memcpy(fifopath, "/tmp/.fifo", 10); 8009118: 78 02 08 01 mvhi r2,0x801 800911c: 38 42 c9 98 ori r2,r2,0xc998 8009120: 28 43 00 00 lw r3,(r2+0) 8009124: 28 41 00 04 lw r1,(r2+4) 8009128: 37 8b 00 1c addi r11,sp,28 800912c: 5b 83 00 1c sw (sp+28),r3 8009130: 59 61 00 04 sw (r11+4),r1 8009134: 2c 41 00 08 lhu r1,(r2+8) sprintf(fifopath + 10, "%04x", rtems_pipe_no ++); 8009138: 78 02 08 01 mvhi r2,0x801 800913c: 38 42 e6 50 ori r2,r2,0xe650 8009140: 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); 8009144: 0d 61 00 08 sh (r11+8),r1 sprintf(fifopath + 10, "%04x", rtems_pipe_no ++); 8009148: 34 61 00 01 addi r1,r3,1 800914c: 0c 41 00 00 sh (r2+0),r1 8009150: 78 02 08 01 mvhi r2,0x801 8009154: 38 42 c9 a4 ori r2,r2,0xc9a4 8009158: 37 81 00 26 addi r1,sp,38 800915c: f8 00 11 ff calli 800d958 /* Try creating FIFO file until find an available file name */ while (mkfifo(fifopath, S_IRUSR|S_IWUSR) != 0) { 8009160: b9 60 08 00 mv r1,r11 8009164: 34 02 01 80 mvi r2,384 8009168: f8 00 05 5e calli 800a6e0 800916c: b8 20 60 00 mv r12,r1 8009170: 44 2f 00 03 be r1,r15,800917c if (errno != EEXIST){ 8009174: f8 00 0e 78 calli 800cb54 <__errno> 8009178: e0 00 00 2a bi 8009220 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); 800917c: b9 60 08 00 mv r1,r11 8009180: 34 02 40 00 mvi r2,16384 8009184: fb ff e9 d4 calli 80038d4 8009188: 59 c1 00 00 sw (r14+0),r1 if (filsdes[0] < 0) { 800918c: 4c 2c 00 05 bge r1,r12,80091a0 err = errno; 8009190: f8 00 0e 71 calli 800cb54 <__errno> 8009194: 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); 8009198: b9 60 08 00 mv r1,r11 800919c: e0 00 00 1b bi 8009208 } else { /* Reset open file to blocking mode */ iop = rtems_libio_iop(filsdes[0]); 80091a0: 78 02 08 01 mvhi r2,0x801 80091a4: 38 42 e0 10 ori r2,r2,0xe010 80091a8: 28 44 00 00 lw r4,(r2+0) 80091ac: 34 02 00 00 mvi r2,0 80091b0: 50 24 00 07 bgeu r1,r4,80091cc <== NEVER TAKEN 80091b4: 34 02 00 06 mvi r2,6 80091b8: 78 0b 08 01 mvhi r11,0x801 80091bc: f8 00 47 ae calli 801b074 <__ashlsi3> 80091c0: 39 6b e6 c8 ori r11,r11,0xe6c8 80091c4: 29 62 00 00 lw r2,(r11+0) 80091c8: b4 41 10 00 add r2,r2,r1 iop->flags &= ~LIBIO_FLAGS_NO_DELAY; 80091cc: 28 43 00 18 lw r3,(r2+24) 80091d0: 34 01 ff fe mvi r1,-2 int pipe_create( int filsdes[2] ) { rtems_libio_t *iop; int err = 0; 80091d4: 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; 80091d8: a0 61 08 00 and r1,r3,r1 80091dc: 58 41 00 18 sw (r2+24),r1 filsdes[1] = open(fifopath, O_WRONLY); 80091e0: 37 81 00 1c addi r1,sp,28 80091e4: 34 02 00 01 mvi r2,1 80091e8: fb ff e9 bb calli 80038d4 80091ec: 59 c1 00 04 sw (r14+4),r1 if (filsdes[1] < 0) { 80091f0: 4c 20 00 05 bge r1,r0,8009204 err = errno; 80091f4: f8 00 0e 58 calli 800cb54 <__errno> 80091f8: 28 2c 00 00 lw r12,(r1+0) close(filsdes[0]); 80091fc: 29 c1 00 00 lw r1,(r14+0) 8009200: fb ff e5 0c calli 8002630 } unlink(fifopath); 8009204: 37 81 00 1c addi r1,sp,28 8009208: fb ff ea c5 calli 8003d1c } if(err != 0) rtems_set_errno_and_return_minus_one(err); return 0; 800920c: 34 0d 00 00 mvi r13,0 err = errno; close(filsdes[0]); } unlink(fifopath); } if(err != 0) 8009210: 45 80 00 04 be r12,r0,8009220 rtems_set_errno_and_return_minus_one(err); 8009214: f8 00 0e 50 calli 800cb54 <__errno> 8009218: 58 2c 00 00 sw (r1+0),r12 800921c: 34 0d ff ff mvi r13,-1 return 0; } 8009220: b9 a0 08 00 mv r1,r13 8009224: 2b 9d 00 04 lw ra,(sp+4) 8009228: 2b 8b 00 18 lw r11,(sp+24) 800922c: 2b 8c 00 14 lw r12,(sp+20) 8009230: 2b 8d 00 10 lw r13,(sp+16) 8009234: 2b 8e 00 0c lw r14,(sp+12) 8009238: 2b 8f 00 08 lw r15,(sp+8) 800923c: 37 9c 00 28 addi sp,sp,40 8009240: c3 a0 00 00 ret =============================================================================== 08009ee8 : pipe_control_t *pipe, uint32_t cmd, void *buffer, rtems_libio_t *iop ) { 8009ee8: 37 9c ff f4 addi sp,sp,-12 8009eec: 5b 8b 00 0c sw (sp+12),r11 8009ef0: 5b 8c 00 08 sw (sp+8),r12 8009ef4: 5b 9d 00 04 sw (sp+4),ra 8009ef8: b8 60 60 00 mv r12,r3 if (cmd == FIONREAD) { 8009efc: 78 03 08 01 mvhi r3,0x801 8009f00: 38 63 c9 c0 ori r3,r3,0xc9c0 pipe_control_t *pipe, uint32_t cmd, void *buffer, rtems_libio_t *iop ) { 8009f04: b8 20 58 00 mv r11,r1 if (cmd == FIONREAD) { 8009f08: 28 61 00 00 lw r1,(r3+0) *(unsigned int *)buffer = pipe->Length; PIPE_UNLOCK(pipe); return 0; } return -EINVAL; 8009f0c: 34 04 ff ea mvi r4,-22 uint32_t cmd, void *buffer, rtems_libio_t *iop ) { if (cmd == FIONREAD) { 8009f10: 5c 41 00 0e bne r2,r1,8009f48 if (buffer == NULL) return -EFAULT; 8009f14: 34 04 ff f2 mvi r4,-14 void *buffer, rtems_libio_t *iop ) { if (cmd == FIONREAD) { if (buffer == NULL) 8009f18: 45 80 00 0c be r12,r0,8009f48 return -EFAULT; if (! PIPE_LOCK(pipe)) 8009f1c: 29 61 00 28 lw r1,(r11+40) 8009f20: 34 02 00 00 mvi r2,0 8009f24: 34 03 00 00 mvi r3,0 8009f28: fb ff e9 89 calli 800454c return -EINTR; 8009f2c: 34 04 ff fc mvi r4,-4 { if (cmd == FIONREAD) { if (buffer == NULL) return -EFAULT; if (! PIPE_LOCK(pipe)) 8009f30: 5c 20 00 06 bne r1,r0,8009f48 <== NEVER TAKEN return -EINTR; /* Return length of pipe */ *(unsigned int *)buffer = pipe->Length; 8009f34: 29 61 00 0c lw r1,(r11+12) 8009f38: 59 81 00 00 sw (r12+0),r1 PIPE_UNLOCK(pipe); 8009f3c: 29 61 00 28 lw r1,(r11+40) 8009f40: fb ff e9 d3 calli 800468c return 0; 8009f44: 34 04 00 00 mvi r4,0 } return -EINVAL; } 8009f48: b8 80 08 00 mv r1,r4 8009f4c: 2b 9d 00 04 lw ra,(sp+4) 8009f50: 2b 8b 00 0c lw r11,(sp+12) 8009f54: 2b 8c 00 08 lw r12,(sp+8) 8009f58: 37 9c 00 0c addi sp,sp,12 8009f5c: c3 a0 00 00 ret =============================================================================== 080095d0 : free(pipe->Buffer); free(pipe); } static rtems_status_code pipe_lock(void) { 80095d0: 37 9c ff f4 addi sp,sp,-12 80095d4: 5b 8b 00 0c sw (sp+12),r11 80095d8: 5b 8c 00 08 sw (sp+8),r12 80095dc: 5b 9d 00 04 sw (sp+4),ra rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 80095e0: 78 0b 08 01 mvhi r11,0x801 80095e4: 39 6b e6 54 ori r11,r11,0xe654 80095e8: 29 61 00 00 lw r1,(r11+0) 80095ec: 5c 20 00 19 bne r1,r0,8009650 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 ); 80095f0: 78 01 08 01 mvhi r1,0x801 80095f4: 38 21 e6 d0 ori r1,r1,0xe6d0 80095f8: 28 21 00 00 lw r1,(r1+0) 80095fc: 34 02 00 00 mvi r2,0 8009600: 34 03 00 00 mvi r3,0 8009604: fb ff eb d2 calli 800454c rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { 8009608: 29 61 00 00 lw r1,(r11+0) free(pipe); } static rtems_status_code pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; 800960c: 34 0c 00 00 mvi r12,0 if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { 8009610: 5c 2c 00 0a bne r1,r12,8009638 <== NEVER TAKEN sc = rtems_semaphore_create( 8009614: 78 02 08 01 mvhi r2,0x801 8009618: 38 42 c9 ac ori r2,r2,0xc9ac 800961c: 28 41 00 00 lw r1,(r2+0) 8009620: 34 03 00 54 mvi r3,84 8009624: 34 02 00 01 mvi r2,1 8009628: 34 04 00 00 mvi r4,0 800962c: b9 60 28 00 mv r5,r11 8009630: fb ff eb 1b calli 800429c 8009634: b8 20 60 00 mv r12,r1 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 8009638: 78 01 08 01 mvhi r1,0x801 800963c: 38 21 e6 d0 ori r1,r1,0xe6d0 8009640: 28 21 00 00 lw r1,(r1+0) 8009644: fb ff ec 12 calli 800468c } if (sc == RTEMS_SUCCESSFUL) { return 0; } else { return -ENOMEM; 8009648: 34 01 ff f4 mvi r1,-12 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { 800964c: 5d 80 00 0b bne r12,r0,8009678 sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8009650: 78 01 08 01 mvhi r1,0x801 8009654: 38 21 e6 54 ori r1,r1,0xe654 8009658: 28 21 00 00 lw r1,(r1+0) 800965c: 34 02 00 00 mvi r2,0 8009660: 34 03 00 00 mvi r3,0 8009664: fb ff eb ba calli 800454c } if (sc == RTEMS_SUCCESSFUL) { return 0; } else { return -ENOMEM; 8009668: 64 21 00 00 cmpei r1,r1,0 800966c: c8 01 08 00 sub r1,r0,r1 8009670: 20 21 00 0c andi r1,r1,0xc 8009674: 34 21 ff f4 addi r1,r1,-12 } } 8009678: 2b 9d 00 04 lw ra,(sp+4) 800967c: 2b 8b 00 0c lw r11,(sp+12) 8009680: 2b 8c 00 08 lw r12,(sp+8) 8009684: 37 9c 00 0c addi sp,sp,12 8009688: c3 a0 00 00 ret =============================================================================== 08009b50 : pipe_control_t *pipe, void *buffer, size_t count, rtems_libio_t *iop ) { 8009b50: 37 9c ff d8 addi sp,sp,-40 8009b54: 5b 8b 00 24 sw (sp+36),r11 8009b58: 5b 8c 00 20 sw (sp+32),r12 8009b5c: 5b 8d 00 1c sw (sp+28),r13 8009b60: 5b 8e 00 18 sw (sp+24),r14 8009b64: 5b 8f 00 14 sw (sp+20),r15 8009b68: 5b 90 00 10 sw (sp+16),r16 8009b6c: 5b 91 00 0c sw (sp+12),r17 8009b70: 5b 92 00 08 sw (sp+8),r18 8009b74: 5b 9d 00 04 sw (sp+4),ra 8009b78: b8 20 58 00 mv r11,r1 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) 8009b7c: 28 21 00 28 lw r1,(r1+40) pipe_control_t *pipe, void *buffer, size_t count, rtems_libio_t *iop ) { 8009b80: b8 40 78 00 mv r15,r2 8009b84: b8 60 80 00 mv r16,r3 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) 8009b88: 34 02 00 00 mvi r2,0 8009b8c: 34 03 00 00 mvi r3,0 pipe_control_t *pipe, void *buffer, size_t count, rtems_libio_t *iop ) { 8009b90: b8 80 88 00 mv r17,r4 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) 8009b94: fb ff ea 6e calli 800454c return -EINTR; 8009b98: 34 0c ff fc mvi r12,-4 rtems_libio_t *iop ) { int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) 8009b9c: 5c 20 00 4d bne r1,r0,8009cd0 <== NEVER TAKEN 8009ba0: 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)) 8009ba4: 34 12 ff fc mvi r18,-4 8009ba8: e0 00 00 3f bi 8009ca4 return -EINTR; while (read < count) { while (PIPE_EMPTY(pipe)) { /* Not an error */ if (pipe->Writers == 0) 8009bac: 29 61 00 14 lw r1,(r11+20) 8009bb0: 44 2d 00 3e be r1,r13,8009ca8 goto out_locked; if (LIBIO_NODELAY(iop)) { 8009bb4: 2a 2d 00 18 lw r13,(r17+24) 8009bb8: 21 ad 00 01 andi r13,r13,0x1 8009bbc: 5d a0 00 3d bne r13,r0,8009cb0 ret = -EAGAIN; goto out_locked; } /* Wait until pipe is no more empty or no writer exists */ pipe->waitingReaders ++; 8009bc0: 29 61 00 18 lw r1,(r11+24) 8009bc4: 34 21 00 01 addi r1,r1,1 8009bc8: 59 61 00 18 sw (r11+24),r1 PIPE_UNLOCK(pipe); 8009bcc: 29 61 00 28 lw r1,(r11+40) 8009bd0: fb ff ea af calli 800468c if (! PIPE_READWAIT(pipe)) 8009bd4: 29 61 00 2c lw r1,(r11+44) 8009bd8: 34 02 00 00 mvi r2,0 8009bdc: f8 00 04 bc calli 800aecc 8009be0: fc 2d 68 00 cmpne r13,r1,r13 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 8009be4: 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)) 8009be8: c8 0d 68 00 sub r13,r0,r13 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 8009bec: 34 02 00 00 mvi r2,0 8009bf0: 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)) 8009bf4: a1 b2 68 00 and r13,r13,r18 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 8009bf8: fb ff ea 55 calli 800454c 8009bfc: 5c 20 00 31 bne r1,r0,8009cc0 <== NEVER TAKEN /* WARN waitingReaders not restored! */ ret = -EINTR; goto out_nolock; } pipe->waitingReaders --; 8009c00: 29 62 00 18 lw r2,(r11+24) 8009c04: 34 42 ff ff addi r2,r2,-1 8009c08: 59 62 00 18 sw (r11+24),r2 if (ret != 0) 8009c0c: 5d a1 00 2a bne r13,r1,8009cb4 <== NEVER TAKEN if (! PIPE_LOCK(pipe)) return -EINTR; while (read < count) { while (PIPE_EMPTY(pipe)) { 8009c10: 29 6d 00 0c lw r13,(r11+12) 8009c14: 45 a0 ff e6 be r13,r0,8009bac if (ret != 0) goto out_locked; } /* Read chunk bytes */ chunk = MIN(count - read, pipe->Length); 8009c18: ca 0c 08 00 sub r1,r16,r12 8009c1c: 50 2d 00 02 bgeu r1,r13,8009c24 8009c20: b8 20 68 00 mv r13,r1 chunk1 = pipe->Size - pipe->Start; 8009c24: 29 65 00 08 lw r5,(r11+8) 8009c28: 29 6e 00 04 lw r14,(r11+4) 8009c2c: 29 66 00 00 lw r6,(r11+0) 8009c30: b5 ec 08 00 add r1,r15,r12 8009c34: 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); 8009c38: b4 c5 10 00 add r2,r6,r5 8009c3c: b9 a0 18 00 mv r3,r13 } /* Read chunk bytes */ chunk = MIN(count - read, pipe->Length); chunk1 = pipe->Size - pipe->Start; if (chunk > chunk1) { 8009c40: 4d cd 00 08 bge r14,r13,8009c60 memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk1); 8009c44: b4 c5 10 00 add r2,r6,r5 8009c48: b9 c0 18 00 mv r3,r14 8009c4c: f8 00 0e 78 calli 800d62c memcpy(buffer + read + chunk1, pipe->Buffer, chunk - chunk1); 8009c50: 29 62 00 00 lw r2,(r11+0) 8009c54: b5 8e 08 00 add r1,r12,r14 8009c58: b5 e1 08 00 add r1,r15,r1 8009c5c: c9 ae 18 00 sub r3,r13,r14 } else memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk); 8009c60: f8 00 0e 73 calli 800d62c pipe->Start += chunk; 8009c64: 29 61 00 08 lw r1,(r11+8) pipe->Start %= pipe->Size; 8009c68: 29 62 00 04 lw r2,(r11+4) 8009c6c: b5 a1 08 00 add r1,r13,r1 8009c70: f8 00 45 eb calli 801b41c <__umodsi3> 8009c74: 59 61 00 08 sw (r11+8),r1 pipe->Length -= chunk; 8009c78: 29 61 00 0c lw r1,(r11+12) 8009c7c: c8 2d 08 00 sub r1,r1,r13 8009c80: 59 61 00 0c sw (r11+12),r1 /* For buffering optimization */ if (PIPE_EMPTY(pipe)) 8009c84: 5c 20 00 02 bne r1,r0,8009c8c pipe->Start = 0; 8009c88: 59 60 00 08 sw (r11+8),r0 if (pipe->waitingWriters > 0) 8009c8c: 29 61 00 1c lw r1,(r11+28) 8009c90: 44 20 00 04 be r1,r0,8009ca0 PIPE_WAKEUPWRITERS(pipe); 8009c94: 29 61 00 30 lw r1,(r11+48) 8009c98: 37 82 00 28 addi r2,sp,40 8009c9c: f8 00 04 6f calli 800ae58 read += chunk; 8009ca0: b5 8d 60 00 add r12,r12,r13 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) return -EINTR; while (read < count) { 8009ca4: 56 0c ff db bgu r16,r12,8009c10 while (PIPE_EMPTY(pipe)) { /* Not an error */ if (pipe->Writers == 0) 8009ca8: 34 0d 00 00 mvi r13,0 8009cac: e0 00 00 02 bi 8009cb4 goto out_locked; if (LIBIO_NODELAY(iop)) { ret = -EAGAIN; 8009cb0: 34 0d ff f5 mvi r13,-11 PIPE_WAKEUPWRITERS(pipe); read += chunk; } out_locked: PIPE_UNLOCK(pipe); 8009cb4: 29 61 00 28 lw r1,(r11+40) 8009cb8: fb ff ea 75 calli 800468c 8009cbc: e0 00 00 02 bi 8009cc4 PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) ret = -EINTR; if (! PIPE_LOCK(pipe)) { /* WARN waitingReaders not restored! */ ret = -EINTR; 8009cc0: 34 0d ff fc mvi r13,-4 <== NOT EXECUTED out_locked: PIPE_UNLOCK(pipe); out_nolock: if (read > 0) 8009cc4: 4c 0c 00 02 bge r0,r12,8009ccc 8009cc8: e0 00 00 02 bi 8009cd0 return read; return ret; 8009ccc: b9 a0 60 00 mv r12,r13 } 8009cd0: b9 80 08 00 mv r1,r12 8009cd4: 2b 9d 00 04 lw ra,(sp+4) 8009cd8: 2b 8b 00 24 lw r11,(sp+36) 8009cdc: 2b 8c 00 20 lw r12,(sp+32) 8009ce0: 2b 8d 00 1c lw r13,(sp+28) 8009ce4: 2b 8e 00 18 lw r14,(sp+24) 8009ce8: 2b 8f 00 14 lw r15,(sp+20) 8009cec: 2b 90 00 10 lw r16,(sp+16) 8009cf0: 2b 91 00 0c lw r17,(sp+12) 8009cf4: 2b 92 00 08 lw r18,(sp+8) 8009cf8: 37 9c 00 28 addi sp,sp,40 8009cfc: c3 a0 00 00 ret =============================================================================== 0800970c : */ int pipe_release( pipe_control_t **pipep, rtems_libio_t *iop ) { 800970c: 37 9c ff e8 addi sp,sp,-24 8009710: 5b 8b 00 14 sw (sp+20),r11 8009714: 5b 8c 00 10 sw (sp+16),r12 8009718: 5b 8d 00 0c sw (sp+12),r13 800971c: 5b 8e 00 08 sw (sp+8),r14 8009720: 5b 9d 00 04 sw (sp+4),ra 8009724: b8 20 68 00 mv r13,r1 8009728: b8 40 70 00 mv r14,r2 pipe_control_t *pipe = *pipep; 800972c: 28 2b 00 00 lw r11,(r1+0) uint32_t mode; if (pipe_lock()) 8009730: fb ff ff a8 calli 80095d0 8009734: b8 20 60 00 mv r12,r1 8009738: 5c 20 00 07 bne r1,r0,8009754 <== NEVER TAKEN /* WARN pipe not freed and pipep not set to NULL! */ /* FIXME */ rtems_fatal_error_occurred(0xdeadbeef); if (!PIPE_LOCK(pipe)) 800973c: 29 61 00 28 lw r1,(r11+40) 8009740: 34 03 00 00 mvi r3,0 8009744: 34 02 00 00 mvi r2,0 8009748: fb ff eb 81 calli 800454c 800974c: b8 20 18 00 mv r3,r1 8009750: 44 2c 00 05 be r1,r12,8009764 <== ALWAYS TAKEN /* WARN pipe not released! */ /* FIXME */ rtems_fatal_error_occurred(0xdeadbeef); 8009754: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8009758: 38 42 c9 b0 ori r2,r2,0xc9b0 <== NOT EXECUTED 800975c: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 8009760: fb ff ec a8 calli 8004a00 <== NOT EXECUTED mode = LIBIO_ACCMODE(iop); 8009764: 29 c1 00 18 lw r1,(r14+24) 8009768: 20 2c 00 06 andi r12,r1,0x6 if (mode & LIBIO_FLAGS_READ) 800976c: 20 21 00 02 andi r1,r1,0x2 8009770: 44 23 00 04 be r1,r3,8009780 pipe->Readers --; 8009774: 29 61 00 10 lw r1,(r11+16) 8009778: 34 21 ff ff addi r1,r1,-1 800977c: 59 61 00 10 sw (r11+16),r1 if (mode & LIBIO_FLAGS_WRITE) 8009780: 21 81 00 04 andi r1,r12,0x4 8009784: 44 20 00 04 be r1,r0,8009794 pipe->Writers --; 8009788: 29 61 00 14 lw r1,(r11+20) 800978c: 34 21 ff ff addi r1,r1,-1 8009790: 59 61 00 14 sw (r11+20),r1 PIPE_UNLOCK(pipe); 8009794: 29 61 00 28 lw r1,(r11+40) 8009798: fb ff eb bd calli 800468c if (pipe->Readers == 0 && pipe->Writers == 0) { 800979c: 29 62 00 10 lw r2,(r11+16) 80097a0: 5c 40 00 07 bne r2,r0,80097bc 80097a4: 29 61 00 14 lw r1,(r11+20) 80097a8: 5c 22 00 05 bne r1,r2,80097bc #if 0 /* To delete an anonymous pipe file when all users closed it */ if (pipe->Anonymous) delfile = TRUE; #endif pipe_free(pipe); 80097ac: b9 60 08 00 mv r1,r11 80097b0: fb ff ff b7 calli 800968c *pipep = NULL; 80097b4: 59 a0 00 00 sw (r13+0),r0 80097b8: e0 00 00 0f bi 80097f4 } else if (pipe->Readers == 0 && mode != LIBIO_FLAGS_WRITE) 80097bc: 7d 81 00 04 cmpnei r1,r12,4 80097c0: 64 42 00 00 cmpei r2,r2,0 80097c4: a0 22 10 00 and r2,r1,r2 80097c8: 44 40 00 03 be r2,r0,80097d4 /* Notify waiting Writers that all their partners left */ PIPE_WAKEUPWRITERS(pipe); 80097cc: 29 61 00 30 lw r1,(r11+48) 80097d0: e0 00 00 07 bi 80097ec else if (pipe->Writers == 0 && mode != LIBIO_FLAGS_READ) 80097d4: 29 61 00 14 lw r1,(r11+20) 80097d8: 7d 8c 00 02 cmpnei r12,r12,2 80097dc: 64 21 00 00 cmpei r1,r1,0 80097e0: a1 81 60 00 and r12,r12,r1 80097e4: 45 82 00 04 be r12,r2,80097f4 <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); 80097e8: 29 61 00 2c lw r1,(r11+44) 80097ec: 37 82 00 18 addi r2,sp,24 80097f0: f8 00 05 9a calli 800ae58 pipe_unlock(); 80097f4: fb ff ff b8 calli 80096d4 if(iop->pathinfo.ops->unlink_h(&iop->pathinfo)) return -errno; #endif return 0; } 80097f8: 34 01 00 00 mvi r1,0 80097fc: 2b 9d 00 04 lw ra,(sp+4) 8009800: 2b 8b 00 14 lw r11,(sp+20) 8009804: 2b 8c 00 10 lw r12,(sp+16) 8009808: 2b 8d 00 0c lw r13,(sp+12) 800980c: 2b 8e 00 08 lw r14,(sp+8) 8009810: 37 9c 00 18 addi sp,sp,24 8009814: c3 a0 00 00 ret =============================================================================== 080096d4 : return -ENOMEM; } } static void pipe_unlock(void) { 80096d4: 37 9c ff fc addi sp,sp,-4 80096d8: 5b 9d 00 04 sw (sp+4),ra rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_release(pipe_semaphore); 80096dc: 78 01 08 01 mvhi r1,0x801 80096e0: 38 21 e6 54 ori r1,r1,0xe654 80096e4: 28 21 00 00 lw r1,(r1+0) 80096e8: fb ff eb e9 calli 800468c if (sc != RTEMS_SUCCESSFUL) { 80096ec: 44 20 00 05 be r1,r0,8009700 <== ALWAYS TAKEN /* FIXME */ rtems_fatal_error_occurred(0xdeadbeef); 80096f0: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 80096f4: 38 42 c9 b0 ori r2,r2,0xc9b0 <== NOT EXECUTED 80096f8: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 80096fc: fb ff ec c1 calli 8004a00 <== NOT EXECUTED } } 8009700: 2b 9d 00 04 lw ra,(sp+4) 8009704: 37 9c 00 04 addi sp,sp,4 8009708: c3 a0 00 00 ret =============================================================================== 08009d00 : pipe_control_t *pipe, const void *buffer, size_t count, rtems_libio_t *iop ) { 8009d00: 37 9c ff d4 addi sp,sp,-44 8009d04: 5b 8b 00 28 sw (sp+40),r11 8009d08: 5b 8c 00 24 sw (sp+36),r12 8009d0c: 5b 8d 00 20 sw (sp+32),r13 8009d10: 5b 8e 00 1c sw (sp+28),r14 8009d14: 5b 8f 00 18 sw (sp+24),r15 8009d18: 5b 90 00 14 sw (sp+20),r16 8009d1c: 5b 91 00 10 sw (sp+16),r17 8009d20: 5b 92 00 0c sw (sp+12),r18 8009d24: 5b 93 00 08 sw (sp+8),r19 8009d28: 5b 9d 00 04 sw (sp+4),ra int chunk, chunk1, written = 0, ret = 0; /* Write nothing */ if (count == 0) return 0; 8009d2c: 34 0c 00 00 mvi r12,0 pipe_control_t *pipe, const void *buffer, size_t count, rtems_libio_t *iop ) { 8009d30: b8 20 58 00 mv r11,r1 8009d34: b8 40 88 00 mv r17,r2 8009d38: b8 60 70 00 mv r14,r3 8009d3c: b8 80 90 00 mv r18,r4 int chunk, chunk1, written = 0, ret = 0; /* Write nothing */ if (count == 0) 8009d40: 44 60 00 5d be r3,r0,8009eb4 <== NEVER TAKEN return 0; if (! PIPE_LOCK(pipe)) 8009d44: 28 21 00 28 lw r1,(r1+40) 8009d48: 34 02 00 00 mvi r2,0 8009d4c: 34 03 00 00 mvi r3,0 8009d50: fb ff e9 ff calli 800454c return -EINTR; 8009d54: 34 0c ff fc mvi r12,-4 /* Write nothing */ if (count == 0) return 0; if (! PIPE_LOCK(pipe)) 8009d58: 5c 20 00 57 bne r1,r0,8009eb4 <== NEVER TAKEN return -EINTR; if (pipe->Readers == 0) { 8009d5c: 29 62 00 10 lw r2,(r11+16) 8009d60: 44 41 00 48 be r2,r1,8009e80 <== NEVER TAKEN ret = -EPIPE; goto out_locked; } /* Write of PIPE_BUF bytes or less shall not be interleaved */ chunk = count <= pipe->Size ? count : 1; 8009d64: 29 61 00 04 lw r1,(r11+4) 8009d68: 34 10 00 01 mvi r16,1 8009d6c: 55 c1 00 02 bgu r14,r1,8009d74 <== NEVER TAKEN 8009d70: 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; 8009d74: 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)) 8009d78: 34 13 ff fc mvi r19,-4 8009d7c: e0 00 00 3e bi 8009e74 /* 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)) { 8009d80: 2a 4d 00 18 lw r13,(r18+24) 8009d84: 21 ad 00 01 andi r13,r13,0x1 8009d88: 5d a0 00 41 bne r13,r0,8009e8c <== NEVER TAKEN ret = -EAGAIN; goto out_locked; } /* Wait until there is chunk bytes space or no reader exists */ pipe->waitingWriters ++; 8009d8c: 29 61 00 1c lw r1,(r11+28) 8009d90: 34 21 00 01 addi r1,r1,1 8009d94: 59 61 00 1c sw (r11+28),r1 PIPE_UNLOCK(pipe); 8009d98: 29 61 00 28 lw r1,(r11+40) 8009d9c: fb ff ea 3c calli 800468c if (! PIPE_WRITEWAIT(pipe)) 8009da0: 29 61 00 30 lw r1,(r11+48) 8009da4: 34 02 00 00 mvi r2,0 8009da8: f8 00 04 49 calli 800aecc 8009dac: fc 2d 68 00 cmpne r13,r1,r13 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 8009db0: 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)) 8009db4: c8 0d 68 00 sub r13,r0,r13 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 8009db8: 34 02 00 00 mvi r2,0 8009dbc: 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)) 8009dc0: a1 b3 68 00 and r13,r13,r19 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 8009dc4: fb ff e9 e2 calli 800454c 8009dc8: 5c 20 00 37 bne r1,r0,8009ea4 <== NEVER TAKEN /* WARN waitingWriters not restored! */ ret = -EINTR; goto out_nolock; } pipe->waitingWriters --; 8009dcc: 29 62 00 1c lw r2,(r11+28) 8009dd0: 34 42 ff ff addi r2,r2,-1 8009dd4: 59 62 00 1c sw (r11+28),r2 if (ret != 0) 8009dd8: 5d a1 00 30 bne r13,r1,8009e98 <== NEVER TAKEN goto out_locked; if (pipe->Readers == 0) { 8009ddc: 29 61 00 10 lw r1,(r11+16) 8009de0: 44 2d 00 2d be r1,r13,8009e94 <== 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) { 8009de4: 29 6f 00 04 lw r15,(r11+4) 8009de8: 29 61 00 0c lw r1,(r11+12) 8009dec: c9 e1 68 00 sub r13,r15,r1 8009df0: 56 0d ff e4 bgu r16,r13,8009d80 <== NEVER TAKEN ret = -EPIPE; goto out_locked; } } chunk = MIN(count - written, PIPE_SPACE(pipe)); 8009df4: c9 cc 10 00 sub r2,r14,r12 8009df8: 50 4d 00 02 bgeu r2,r13,8009e00 8009dfc: b8 40 68 00 mv r13,r2 chunk1 = pipe->Size - PIPE_WSTART(pipe); 8009e00: 29 62 00 08 lw r2,(r11+8) 8009e04: b4 22 08 00 add r1,r1,r2 8009e08: b9 e0 10 00 mv r2,r15 8009e0c: f8 00 45 84 calli 801b41c <__umodsi3> 8009e10: c9 e1 78 00 sub r15,r15,r1 8009e14: 29 63 00 00 lw r3,(r11+0) 8009e18: b6 2c 10 00 add r2,r17,r12 if (chunk > chunk1) { 8009e1c: 4d ed 00 09 bge r15,r13,8009e40 memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk1); 8009e20: b4 61 08 00 add r1,r3,r1 8009e24: b9 e0 18 00 mv r3,r15 8009e28: f8 00 0e 01 calli 800d62c memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1); 8009e2c: b5 ec 10 00 add r2,r15,r12 8009e30: 29 61 00 00 lw r1,(r11+0) 8009e34: b6 22 10 00 add r2,r17,r2 8009e38: c9 af 18 00 sub r3,r13,r15 8009e3c: e0 00 00 03 bi 8009e48 } else memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk); 8009e40: b4 61 08 00 add r1,r3,r1 8009e44: b9 a0 18 00 mv r3,r13 8009e48: f8 00 0d f9 calli 800d62c pipe->Length += chunk; 8009e4c: 29 61 00 0c lw r1,(r11+12) 8009e50: b4 2d 08 00 add r1,r1,r13 8009e54: 59 61 00 0c sw (r11+12),r1 if (pipe->waitingReaders > 0) 8009e58: 29 61 00 18 lw r1,(r11+24) 8009e5c: 44 20 00 04 be r1,r0,8009e6c PIPE_WAKEUPREADERS(pipe); 8009e60: 29 61 00 2c lw r1,(r11+44) 8009e64: 37 82 00 2c addi r2,sp,44 8009e68: f8 00 03 fc calli 800ae58 written += chunk; 8009e6c: b5 8d 60 00 add r12,r12,r13 /* Write of more than PIPE_BUF bytes can be interleaved */ chunk = 1; 8009e70: 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) { 8009e74: 55 cc ff dc bgu r14,r12,8009de4 8009e78: 34 0d 00 00 mvi r13,0 8009e7c: e0 00 00 07 bi 8009e98 if (! PIPE_LOCK(pipe)) return -EINTR; if (pipe->Readers == 0) { ret = -EPIPE; 8009e80: 34 0d ff e0 mvi r13,-32 const void *buffer, size_t count, rtems_libio_t *iop ) { int chunk, chunk1, written = 0, ret = 0; 8009e84: 34 0c 00 00 mvi r12,0 8009e88: e0 00 00 04 bi 8009e98 chunk = count <= pipe->Size ? count : 1; while (written < count) { while (PIPE_SPACE(pipe) < chunk) { if (LIBIO_NODELAY(iop)) { ret = -EAGAIN; 8009e8c: 34 0d ff f5 mvi r13,-11 8009e90: e0 00 00 02 bi 8009e98 pipe->waitingWriters --; if (ret != 0) goto out_locked; if (pipe->Readers == 0) { ret = -EPIPE; 8009e94: 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); 8009e98: 29 61 00 28 lw r1,(r11+40) 8009e9c: fb ff e9 fc calli 800468c 8009ea0: e0 00 00 02 bi 8009ea8 PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) ret = -EINTR; if (! PIPE_LOCK(pipe)) { /* WARN waitingWriters not restored! */ ret = -EINTR; 8009ea4: 34 0d ff fc mvi r13,-4 <== NOT EXECUTED /* Signal SIGPIPE */ if (ret == -EPIPE) kill(getpid(), SIGPIPE); #endif if (written > 0) 8009ea8: 4c 0c 00 02 bge r0,r12,8009eb0 8009eac: e0 00 00 02 bi 8009eb4 return written; return ret; 8009eb0: b9 a0 60 00 mv r12,r13 } 8009eb4: b9 80 08 00 mv r1,r12 8009eb8: 2b 9d 00 04 lw ra,(sp+4) 8009ebc: 2b 8b 00 28 lw r11,(sp+40) 8009ec0: 2b 8c 00 24 lw r12,(sp+36) 8009ec4: 2b 8d 00 20 lw r13,(sp+32) 8009ec8: 2b 8e 00 1c lw r14,(sp+28) 8009ecc: 2b 8f 00 18 lw r15,(sp+24) 8009ed0: 2b 90 00 14 lw r16,(sp+20) 8009ed4: 2b 91 00 10 lw r17,(sp+16) 8009ed8: 2b 92 00 0c lw r18,(sp+12) 8009edc: 2b 93 00 08 lw r19,(sp+8) 8009ee0: 37 9c 00 2c addi sp,sp,44 8009ee4: c3 a0 00 00 ret =============================================================================== 08011004 : ssize_t read( int fd, void *buffer, size_t count ) { 8011004: 37 9c ff ec addi sp,sp,-20 8011008: 5b 8b 00 10 sw (sp+16),r11 801100c: 5b 8c 00 0c sw (sp+12),r12 8011010: 5b 8d 00 08 sw (sp+8),r13 8011014: 5b 9d 00 04 sw (sp+4),ra ssize_t rc; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8011018: 78 04 08 01 mvhi r4,0x801 801101c: 38 84 30 10 ori r4,r4,0x3010 ssize_t read( int fd, void *buffer, size_t count ) { 8011020: b8 40 68 00 mv r13,r2 ssize_t rc; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8011024: 28 82 00 00 lw r2,(r4+0) 8011028: 54 41 00 02 bgu r2,r1,8011030 <== ALWAYS TAKEN 801102c: e0 00 00 0c bi 801105c <== NOT EXECUTED iop = rtems_libio_iop( fd ); 8011030: 78 0b 08 01 mvhi r11,0x801 8011034: 34 02 00 06 mvi r2,6 8011038: 39 6b 36 a0 ori r11,r11,0x36a0 801103c: 5b 83 00 14 sw (sp+20),r3 8011040: fb ff fe 07 calli 801085c <__ashlsi3> 8011044: 29 6b 00 00 lw r11,(r11+0) rtems_libio_check_is_open( iop ); 8011048: 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 ); 801104c: b5 61 58 00 add r11,r11,r1 rtems_libio_check_is_open( iop ); 8011050: 29 61 00 18 lw r1,(r11+24) 8011054: 20 22 01 00 andi r2,r1,0x100 8011058: 5c 40 00 04 bne r2,r0,8011068 801105c: fb ff e8 e8 calli 800b3fc <__errno> 8011060: 34 02 00 09 mvi r2,9 8011064: e0 00 00 08 bi 8011084 rtems_libio_check_buffer( buffer ); 8011068: 45 a0 00 05 be r13,r0,801107c <== NEVER TAKEN rtems_libio_check_count( count ); 801106c: 34 0c 00 00 mvi r12,0 8011070: 44 60 00 19 be r3,r0,80110d4 <== NEVER TAKEN rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ ); 8011074: 20 21 00 02 andi r1,r1,0x2 8011078: 5c 20 00 06 bne r1,r0,8011090 <== ALWAYS TAKEN 801107c: fb ff e8 e0 calli 800b3fc <__errno> <== NOT EXECUTED 8011080: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8011084: 58 22 00 00 sw (r1+0),r2 8011088: 34 0c ff ff mvi r12,-1 801108c: e0 00 00 12 bi 80110d4 return 0; /* * Now process the read(). */ rc = (*iop->pathinfo.handlers->read_h)( iop, buffer, count ); 8011090: 29 61 00 24 lw r1,(r11+36) 8011094: b9 a0 10 00 mv r2,r13 8011098: 28 24 00 08 lw r4,(r1+8) 801109c: b9 60 08 00 mv r1,r11 80110a0: d8 80 00 00 call r4 80110a4: b8 20 60 00 mv r12,r1 if ( rc > 0 ) 80110a8: 4c 01 00 0b bge r0,r1,80110d4 iop->offset += rc; 80110ac: 34 02 00 1f mvi r2,31 80110b0: fb ff fe 12 calli 80108f8 <__ashrsi3> 80110b4: 29 62 00 14 lw r2,(r11+20) 80110b8: 29 64 00 10 lw r4,(r11+16) 80110bc: b5 82 10 00 add r2,r12,r2 80110c0: f5 82 18 00 cmpgu r3,r12,r2 80110c4: b4 24 08 00 add r1,r1,r4 80110c8: b4 61 08 00 add r1,r3,r1 80110cc: 59 61 00 10 sw (r11+16),r1 80110d0: 59 62 00 14 sw (r11+20),r2 return rc; } 80110d4: b9 80 08 00 mv r1,r12 80110d8: 2b 9d 00 04 lw ra,(sp+4) 80110dc: 2b 8b 00 10 lw r11,(sp+16) 80110e0: 2b 8c 00 0c lw r12,(sp+12) 80110e4: 2b 8d 00 08 lw r13,(sp+8) 80110e8: 37 9c 00 14 addi sp,sp,20 80110ec: c3 a0 00 00 ret =============================================================================== 08004d8c : ssize_t readlink( const char *pathname, char *buf, size_t bufsize ) { 8004d8c: 37 9c ff d8 addi sp,sp,-40 8004d90: 5b 8b 00 14 sw (sp+20),r11 8004d94: 5b 8c 00 10 sw (sp+16),r12 8004d98: 5b 8d 00 0c sw (sp+12),r13 8004d9c: 5b 8e 00 08 sw (sp+8),r14 8004da0: 5b 9d 00 04 sw (sp+4),ra 8004da4: b8 20 60 00 mv r12,r1 8004da8: b8 40 68 00 mv r13,r2 8004dac: b8 60 70 00 mv r14,r3 rtems_filesystem_location_info_t loc; int result; if (!buf) 8004db0: 5c 40 00 06 bne r2,r0,8004dc8 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); 8004db4: f8 00 26 98 calli 800e814 <__errno> <== NOT EXECUTED 8004db8: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 8004dbc: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8004dc0: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 8004dc4: e0 00 00 20 bi 8004e44 <== NOT EXECUTED result = rtems_filesystem_evaluate_path( pathname, strlen( pathname ), 8004dc8: f8 00 2e 59 calli 801072c 8004dcc: 37 8b 00 18 addi r11,sp,24 8004dd0: b8 20 10 00 mv r2,r1 8004dd4: 34 03 00 00 mvi r3,0 8004dd8: b9 80 08 00 mv r1,r12 8004ddc: b9 60 20 00 mv r4,r11 8004de0: 34 05 00 00 mvi r5,0 8004de4: fb ff fa e3 calli 8003970 0, &loc, false ); if ( result != 0 ) return -1; 8004de8: 34 0c ff ff mvi r12,-1 if (!buf) rtems_set_errno_and_return_minus_one( EFAULT ); result = rtems_filesystem_evaluate_path( pathname, strlen( pathname ), 0, &loc, false ); if ( result != 0 ) 8004dec: 5c 20 00 16 bne r1,r0,8004e44 <== NEVER TAKEN return -1; if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){ 8004df0: 2b 81 00 24 lw r1,(sp+36) 8004df4: 28 22 00 10 lw r2,(r1+16) 8004df8: b9 60 08 00 mv r1,r11 8004dfc: d8 40 00 00 call r2 8004e00: 34 02 00 04 mvi r2,4 8004e04: 44 22 00 07 be r1,r2,8004e20 rtems_filesystem_freenode( &loc ); 8004e08: b9 60 08 00 mv r1,r11 8004e0c: fb ff fb 2b calli 8003ab8 rtems_set_errno_and_return_minus_one( EINVAL ); 8004e10: f8 00 26 81 calli 800e814 <__errno> 8004e14: 34 02 00 16 mvi r2,22 8004e18: 58 22 00 00 sw (r1+0),r2 8004e1c: e0 00 00 0a bi 8004e44 } result = (*loc.ops->readlink_h)( &loc, buf, bufsize ); 8004e20: 2b 81 00 24 lw r1,(sp+36) 8004e24: b9 a0 10 00 mv r2,r13 8004e28: b9 c0 18 00 mv r3,r14 8004e2c: 28 24 00 3c lw r4,(r1+60) 8004e30: b9 60 08 00 mv r1,r11 8004e34: d8 80 00 00 call r4 8004e38: b8 20 60 00 mv r12,r1 rtems_filesystem_freenode( &loc ); 8004e3c: b9 60 08 00 mv r1,r11 8004e40: fb ff fb 1e calli 8003ab8 return result; } 8004e44: b9 80 08 00 mv r1,r12 8004e48: 2b 9d 00 04 lw ra,(sp+4) 8004e4c: 2b 8b 00 14 lw r11,(sp+20) 8004e50: 2b 8c 00 10 lw r12,(sp+16) 8004e54: 2b 8d 00 0c lw r13,(sp+12) 8004e58: 2b 8e 00 08 lw r14,(sp+8) 8004e5c: 37 9c 00 28 addi sp,sp,40 8004e60: c3 a0 00 00 ret =============================================================================== 080036d4 : ssize_t readv( int fd, const struct iovec *iov, int iovcnt ) { 80036d4: 37 9c ff e4 addi sp,sp,-28 80036d8: 5b 8b 00 1c sw (sp+28),r11 80036dc: 5b 8c 00 18 sw (sp+24),r12 80036e0: 5b 8d 00 14 sw (sp+20),r13 80036e4: 5b 8e 00 10 sw (sp+16),r14 80036e8: 5b 8f 00 0c sw (sp+12),r15 80036ec: 5b 90 00 08 sw (sp+8),r16 80036f0: 5b 9d 00 04 sw (sp+4),ra 80036f4: b8 60 78 00 mv r15,r3 int v; int bytes; rtems_libio_t *iop; bool all_zeros; rtems_libio_check_fd( fd ); 80036f8: 78 03 08 01 mvhi r3,0x801 80036fc: 38 63 40 10 ori r3,r3,0x4010 ssize_t readv( int fd, const struct iovec *iov, int iovcnt ) { 8003700: b8 40 68 00 mv r13,r2 int v; int bytes; rtems_libio_t *iop; bool all_zeros; rtems_libio_check_fd( fd ); 8003704: 28 62 00 00 lw r2,(r3+0) 8003708: 54 41 00 02 bgu r2,r1,8003710 800370c: e0 00 00 0a bi 8003734 iop = rtems_libio_iop( fd ); 8003710: 78 0b 08 01 mvhi r11,0x801 8003714: 34 02 00 06 mvi r2,6 8003718: 39 6b 46 a0 ori r11,r11,0x46a0 800371c: f8 00 38 f2 calli 8011ae4 <__ashlsi3> 8003720: 29 6c 00 00 lw r12,(r11+0) 8003724: b5 81 60 00 add r12,r12,r1 rtems_libio_check_is_open( iop ); 8003728: 29 81 00 18 lw r1,(r12+24) 800372c: 20 22 01 00 andi r2,r1,0x100 8003730: 5c 40 00 04 bne r2,r0,8003740 8003734: f8 00 23 25 calli 800c3c8 <__errno> 8003738: 34 02 00 09 mvi r2,9 800373c: e0 00 00 16 bi 8003794 rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ ); 8003740: 20 21 00 02 andi r1,r1,0x2 8003744: 44 20 00 12 be r1,r0,800378c <== NEVER TAKEN /* * Argument validation on IO vector */ if ( !iov ) 8003748: 45 a0 00 11 be r13,r0,800378c rtems_set_errno_and_return_minus_one( EINVAL ); if ( iovcnt <= 0 ) 800374c: 49 e0 00 02 bg r15,r0,8003754 8003750: e0 00 00 0f bi 800378c rtems_set_errno_and_return_minus_one( EINVAL ); if ( iovcnt > IOV_MAX ) 8003754: 34 01 04 00 mvi r1,1024 8003758: 4c 2f 00 02 bge r1,r15,8003760 <== ALWAYS TAKEN 800375c: e0 00 00 0c bi 800378c <== NOT EXECUTED 8003760: b9 a0 08 00 mv r1,r13 8003764: 34 02 00 01 mvi r2,1 8003768: 34 04 00 00 mvi r4,0 800376c: 34 03 00 00 mvi r3,0 8003770: e0 00 00 02 bi 8003778 if ( iov[v].iov_len < 0 ) rtems_set_errno_and_return_minus_one( EINVAL ); /* check for wrap */ old = total; total += iov[v].iov_len; 8003774: b8 c0 18 00 mv r3,r6 all_zeros = true; for ( total=0, v=0 ; v < iovcnt ; v++ ) { ssize_t old; if ( !iov[v].iov_base ) 8003778: 28 25 00 00 lw r5,(r1+0) 800377c: 44 a0 00 04 be r5,r0,800378c if ( iov[v].iov_len < 0 ) rtems_set_errno_and_return_minus_one( EINVAL ); /* check for wrap */ old = total; total += iov[v].iov_len; 8003780: 28 25 00 04 lw r5,(r1+4) 8003784: b4 65 30 00 add r6,r3,r5 if ( total < old ) 8003788: 4c c3 00 05 bge r6,r3,800379c rtems_set_errno_and_return_minus_one( EINVAL ); 800378c: f8 00 23 0f calli 800c3c8 <__errno> 8003790: 34 02 00 16 mvi r2,22 8003794: 58 22 00 00 sw (r1+0),r2 8003798: e0 00 00 24 bi 8003828 if ( iov[v].iov_len ) all_zeros = false; 800379c: 64 a5 00 00 cmpei r5,r5,0 * are obvious errors in the iovec. So this extra loop ensures * that we do not do anything if there is an argument error. */ all_zeros = true; for ( total=0, v=0 ; v < iovcnt ; v++ ) { 80037a0: 34 84 00 01 addi r4,r4,1 total += iov[v].iov_len; if ( total < old ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( iov[v].iov_len ) all_zeros = false; 80037a4: c8 05 28 00 sub r5,r0,r5 80037a8: a0 45 10 00 and r2,r2,r5 * are obvious errors in the iovec. So this extra loop ensures * that we do not do anything if there is an argument error. */ all_zeros = true; for ( total=0, v=0 ; v < iovcnt ; v++ ) { 80037ac: 34 21 00 08 addi r1,r1,8 80037b0: 49 e4 ff f1 bg r15,r4,8003774 * A readv with all zeros logically has no effect. Even though * OpenGroup didn't address this case as they did with writev(), * we will handle it the same way for symmetry. */ if ( all_zeros == true ) { return 0; 80037b4: 34 0b 00 00 mvi r11,0 /* * A readv with all zeros logically has no effect. Even though * OpenGroup didn't address this case as they did with writev(), * we will handle it the same way for symmetry. */ if ( all_zeros == true ) { 80037b8: 5c 40 00 1d bne r2,r0,800382c 80037bc: 34 10 00 00 mvi r16,0 /* * Now process the readv(). */ for ( total=0, v=0 ; v < iovcnt ; v++ ) { bytes = (*iop->pathinfo.handlers->read_h)( 80037c0: 29 81 00 24 lw r1,(r12+36) 80037c4: 29 a2 00 00 lw r2,(r13+0) 80037c8: 29 a3 00 04 lw r3,(r13+4) 80037cc: 28 24 00 08 lw r4,(r1+8) 80037d0: b9 80 08 00 mv r1,r12 80037d4: d8 80 00 00 call r4 80037d8: b8 20 70 00 mv r14,r1 iop, iov[v].iov_base, iov[v].iov_len ); if ( bytes < 0 ) 80037dc: 48 01 00 13 bg r0,r1,8003828 <== NEVER TAKEN return -1; if ( bytes > 0 ) { 80037e0: 44 20 00 0c be r1,r0,8003810 <== NEVER TAKEN iop->offset += bytes; 80037e4: 34 02 00 1f mvi r2,31 80037e8: f8 00 38 e6 calli 8011b80 <__ashrsi3> 80037ec: 29 82 00 14 lw r2,(r12+20) 80037f0: 29 84 00 10 lw r4,(r12+16) total += bytes; 80037f4: b5 6e 58 00 add r11,r11,r14 if ( bytes < 0 ) return -1; if ( bytes > 0 ) { iop->offset += bytes; 80037f8: b5 c2 10 00 add r2,r14,r2 80037fc: f5 c2 18 00 cmpgu r3,r14,r2 8003800: b4 24 08 00 add r1,r1,r4 8003804: b4 61 08 00 add r1,r3,r1 8003808: 59 81 00 10 sw (r12+16),r1 800380c: 59 82 00 14 sw (r12+20),r2 total += bytes; } if (bytes != iov[ v ].iov_len) 8003810: 29 a1 00 04 lw r1,(r13+4) 8003814: 5d c1 00 06 bne r14,r1,800382c <== NEVER TAKEN } /* * Now process the readv(). */ for ( total=0, v=0 ; v < iovcnt ; v++ ) { 8003818: 36 10 00 01 addi r16,r16,1 800381c: 35 ad 00 08 addi r13,r13,8 8003820: 49 f0 ff e8 bg r15,r16,80037c0 8003824: e0 00 00 02 bi 800382c iov[v].iov_base, iov[v].iov_len ); if ( bytes < 0 ) return -1; 8003828: 34 0b ff ff mvi r11,-1 if (bytes != iov[ v ].iov_len) break; } return total; } 800382c: b9 60 08 00 mv r1,r11 8003830: 2b 9d 00 04 lw ra,(sp+4) 8003834: 2b 8b 00 1c lw r11,(sp+28) 8003838: 2b 8c 00 18 lw r12,(sp+24) 800383c: 2b 8d 00 14 lw r13,(sp+20) 8003840: 2b 8e 00 10 lw r14,(sp+16) 8003844: 2b 8f 00 0c lw r15,(sp+12) 8003848: 2b 90 00 08 lw r16,(sp+8) 800384c: 37 9c 00 1c addi sp,sp,28 8003850: c3 a0 00 00 ret =============================================================================== 08011190 : void *realloc( void *ptr, size_t size ) { 8011190: 37 9c ff e8 addi sp,sp,-24 8011194: 5b 8b 00 14 sw (sp+20),r11 8011198: 5b 8c 00 10 sw (sp+16),r12 801119c: 5b 8d 00 0c sw (sp+12),r13 80111a0: 5b 8e 00 08 sw (sp+8),r14 80111a4: 5b 9d 00 04 sw (sp+4),ra 80111a8: b8 20 58 00 mv r11,r1 uintptr_t old_size; char *new_area; MSBUMP(realloc_calls, 1); 80111ac: 78 01 08 01 mvhi r1,0x801 80111b0: 38 21 36 b8 ori r1,r1,0x36b8 void *realloc( void *ptr, size_t size ) { 80111b4: b8 40 60 00 mv r12,r2 uintptr_t old_size; char *new_area; MSBUMP(realloc_calls, 1); 80111b8: 28 22 00 10 lw r2,(r1+16) 80111bc: 34 42 00 01 addi r2,r2,1 80111c0: 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())) { 80111c4: 78 01 08 01 mvhi r1,0x801 80111c8: 38 21 39 9c ori r1,r1,0x399c 80111cc: 28 22 00 00 lw r2,(r1+0) 80111d0: 34 01 00 03 mvi r1,3 80111d4: 5c 41 00 09 bne r2,r1,80111f8 <== NEVER TAKEN if (_Thread_Dispatch_disable_level > 0) 80111d8: 78 01 08 01 mvhi r1,0x801 80111dc: 38 21 38 1c ori r1,r1,0x381c 80111e0: 28 22 00 00 lw r2,(r1+0) 80111e4: 5c 40 00 33 bne r2,r0,80112b0 <== NEVER TAKEN return (void *) 0; if (_ISR_Nest_level > 0) 80111e8: 78 01 08 01 mvhi r1,0x801 80111ec: 38 21 39 e8 ori r1,r1,0x39e8 80111f0: 28 21 00 08 lw r1,(r1+8) 80111f4: 5c 22 00 2f bne r1,r2,80112b0 <== NEVER TAKEN } /* * Continue with realloc(). */ if ( !ptr ) 80111f8: 5d 60 00 05 bne r11,r0,801120c return malloc( size ); 80111fc: b9 80 08 00 mv r1,r12 8011200: fb ff c1 65 calli 8001794 8011204: b8 20 58 00 mv r11,r1 8011208: e0 00 00 2b bi 80112b4 if ( !size ) { 801120c: 5d 80 00 04 bne r12,r0,801121c <== ALWAYS TAKEN free( ptr ); 8011210: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8011214: fb ff c0 66 calli 80013ac <== NOT EXECUTED 8011218: e0 00 00 26 bi 80112b0 <== NOT EXECUTED return (void *) 0; } if ( !_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, ptr, &old_size) ) { 801121c: 78 0d 08 01 mvhi r13,0x801 8011220: 39 ad 30 1c ori r13,r13,0x301c 8011224: 29 a1 00 00 lw r1,(r13+0) 8011228: b9 60 10 00 mv r2,r11 801122c: 37 83 00 18 addi r3,sp,24 8011230: f8 00 00 64 calli 80113c0 <_Protected_heap_Get_block_size> 8011234: 5c 20 00 05 bne r1,r0,8011248 errno = EINVAL; 8011238: fb ff e8 71 calli 800b3fc <__errno> 801123c: 34 02 00 16 mvi r2,22 8011240: 58 22 00 00 sw (r1+0),r2 8011244: e0 00 00 1b bi 80112b0 } /* * Now resize it. */ if ( _Protected_heap_Resize_block( RTEMS_Malloc_Heap, ptr, size ) ) { 8011248: 29 a1 00 00 lw r1,(r13+0) 801124c: b9 60 10 00 mv r2,r11 8011250: b9 80 18 00 mv r3,r12 8011254: f8 00 00 73 calli 8011420 <_Protected_heap_Resize_block> 8011258: b8 20 70 00 mv r14,r1 801125c: 5c 20 00 16 bne r1,r0,80112b4 * 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 ); 8011260: b9 80 08 00 mv r1,r12 8011264: fb ff c1 4c calli 8001794 MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */ 8011268: 78 02 08 01 mvhi r2,0x801 801126c: 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 ); 8011270: b8 20 68 00 mv r13,r1 MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */ 8011274: 28 41 00 04 lw r1,(r2+4) 8011278: 34 21 ff ff addi r1,r1,-1 801127c: 58 41 00 04 sw (r2+4),r1 if ( !new_area ) { 8011280: 45 ae 00 0c be r13,r14,80112b0 return (void *) 0; } memcpy( new_area, ptr, (size < old_size) ? size : old_size ); 8011284: 2b 81 00 18 lw r1,(sp+24) 8011288: b9 80 18 00 mv r3,r12 801128c: 50 2c 00 02 bgeu r1,r12,8011294 <== NEVER TAKEN 8011290: b8 20 18 00 mv r3,r1 8011294: b9 60 10 00 mv r2,r11 8011298: b9 a0 08 00 mv r1,r13 801129c: fb ff eb 0e calli 800bed4 free( ptr ); 80112a0: b9 60 08 00 mv r1,r11 80112a4: fb ff c0 42 calli 80013ac return new_area; 80112a8: b9 a0 58 00 mv r11,r13 80112ac: e0 00 00 02 bi 80112b4 new_area = malloc( size ); MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */ if ( !new_area ) { return (void *) 0; 80112b0: 34 0b 00 00 mvi r11,0 memcpy( new_area, ptr, (size < old_size) ? size : old_size ); free( ptr ); return new_area; } 80112b4: b9 60 08 00 mv r1,r11 80112b8: 2b 9d 00 04 lw ra,(sp+4) 80112bc: 2b 8b 00 14 lw r11,(sp+20) 80112c0: 2b 8c 00 10 lw r12,(sp+16) 80112c4: 2b 8d 00 0c lw r13,(sp+12) 80112c8: 2b 8e 00 08 lw r14,(sp+8) 80112cc: 37 9c 00 18 addi sp,sp,24 80112d0: c3 a0 00 00 ret =============================================================================== 0800373c : #include int rmdir( const char *pathname ) { 800373c: 37 9c ff c0 addi sp,sp,-64 8003740: 5b 8b 00 14 sw (sp+20),r11 8003744: 5b 8c 00 10 sw (sp+16),r12 8003748: 5b 8d 00 0c sw (sp+12),r13 800374c: 5b 8e 00 08 sw (sp+8),r14 8003750: 5b 9d 00 04 sw (sp+4),ra 8003754: b8 20 70 00 mv r14,r1 /* * Get the parent node of the node we wish to remove. Find the parent path. */ parentpathlen = rtems_filesystem_dirname ( pathname ); 8003758: fb ff fa 64 calli 80020e8 800375c: b8 20 58 00 mv r11,r1 8003760: 37 84 00 2c addi r4,sp,44 if ( parentpathlen == 0 ) 8003764: 5c 20 00 07 bne r1,r0,8003780 rtems_filesystem_get_start_loc( pathname, &i, &parentloc ); 8003768: b9 c0 08 00 mv r1,r14 800376c: 37 82 00 40 addi r2,sp,64 8003770: b8 80 18 00 mv r3,r4 8003774: f8 00 00 4e calli 80038ac const char *name; rtems_filesystem_location_info_t parentloc; rtems_filesystem_location_info_t loc; int i; int result; bool free_parentloc = false; 8003778: 34 0d 00 00 mvi r13,0 800377c: e0 00 00 09 bi 80037a0 parentpathlen = rtems_filesystem_dirname ( pathname ); if ( parentpathlen == 0 ) rtems_filesystem_get_start_loc( pathname, &i, &parentloc ); else { result = rtems_filesystem_evaluate_path(pathname, parentpathlen, 8003780: b9 c0 08 00 mv r1,r14 8003784: b9 60 10 00 mv r2,r11 8003788: 34 03 00 02 mvi r3,2 800378c: 34 05 00 00 mvi r5,0 8003790: fb ff fa 31 calli 8002054 RTEMS_LIBIO_PERMS_WRITE, &parentloc, false ); if ( result != 0 ) return -1; 8003794: 34 0c ff ff mvi r12,-1 else { result = rtems_filesystem_evaluate_path(pathname, parentpathlen, RTEMS_LIBIO_PERMS_WRITE, &parentloc, false ); if ( result != 0 ) 8003798: 5c 20 00 3d bne r1,r0,800388c <== NEVER TAKEN return -1; free_parentloc = true; 800379c: 34 0d 00 01 mvi r13,1 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 80037a0: 2b 81 00 2c lw r1,(sp+44) name = pathname + parentpathlen; 80037a4: b5 cb 58 00 add r11,r14,r11 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 80037a8: 5b 81 00 18 sw (sp+24),r1 80037ac: 2b 81 00 30 lw r1,(sp+48) 80037b0: 5b 81 00 1c sw (sp+28),r1 80037b4: 2b 81 00 34 lw r1,(sp+52) 80037b8: 5b 81 00 20 sw (sp+32),r1 80037bc: 2b 81 00 38 lw r1,(sp+56) 80037c0: 5b 81 00 24 sw (sp+36),r1 80037c4: 2b 81 00 3c lw r1,(sp+60) 80037c8: 5b 81 00 28 sw (sp+40),r1 name = pathname + parentpathlen; name += rtems_filesystem_prefix_separators( name, strlen( name ) ); 80037cc: b9 60 08 00 mv r1,r11 80037d0: f8 00 27 80 calli 800d5d0 80037d4: b8 20 10 00 mv r2,r1 80037d8: b9 60 08 00 mv r1,r11 80037dc: fb ff fa 57 calli 8002138 80037e0: b5 61 60 00 add r12,r11,r1 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 80037e4: b9 80 08 00 mv r1,r12 80037e8: f8 00 27 7a calli 800d5d0 80037ec: 37 8b 00 18 addi r11,sp,24 80037f0: b8 20 10 00 mv r2,r1 80037f4: 34 03 00 00 mvi r3,0 80037f8: b9 80 08 00 mv r1,r12 80037fc: b9 60 20 00 mv r4,r11 8003800: 34 05 00 00 mvi r5,0 8003804: fb ff f9 e8 calli 8001fa4 0, &loc, false ); if ( result != 0 ) { 8003808: 44 20 00 05 be r1,r0,800381c if ( free_parentloc ) rtems_filesystem_freenode( &parentloc ); return -1; 800380c: 34 0c ff ff mvi r12,-1 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 0, &loc, false ); if ( result != 0 ) { if ( free_parentloc ) rtems_filesystem_freenode( &parentloc ); 8003810: 37 81 00 2c addi r1,sp,44 name += rtems_filesystem_prefix_separators( name, strlen( name ) ); result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 0, &loc, false ); if ( result != 0 ) { if ( free_parentloc ) 8003814: 45 a0 00 1e be r13,r0,800388c <== ALWAYS TAKEN 8003818: e0 00 00 1c bi 8003888 <== NOT EXECUTED } /* * Verify you can remove this node as a directory. */ if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ){ 800381c: 2b 81 00 24 lw r1,(sp+36) 8003820: 28 22 00 10 lw r2,(r1+16) 8003824: b9 60 08 00 mv r1,r11 8003828: d8 40 00 00 call r2 800382c: 34 02 00 01 mvi r2,1 8003830: 44 22 00 0b be r1,r2,800385c rtems_filesystem_freenode( &loc ); 8003834: b9 60 08 00 mv r1,r11 8003838: fb ff fb 0e calli 8002470 if ( free_parentloc ) 800383c: 45 a0 00 03 be r13,r0,8003848 <== NEVER TAKEN rtems_filesystem_freenode( &parentloc ); 8003840: 37 81 00 2c addi r1,sp,44 8003844: fb ff fb 0b calli 8002470 rtems_set_errno_and_return_minus_one( ENOTDIR ); 8003848: f8 00 22 f6 calli 800c420 <__errno> 800384c: 34 02 00 14 mvi r2,20 8003850: 58 22 00 00 sw (r1+0),r2 8003854: 34 0c ff ff mvi r12,-1 8003858: e0 00 00 0d bi 800388c /* * Use the filesystems rmnod to remove the node. */ result = (*loc.handlers->rmnod_h)( &parentloc, &loc ); 800385c: 2b 81 00 20 lw r1,(sp+32) 8003860: 37 8e 00 2c addi r14,sp,44 8003864: b9 60 10 00 mv r2,r11 8003868: 28 23 00 34 lw r3,(r1+52) 800386c: b9 c0 08 00 mv r1,r14 8003870: d8 60 00 00 call r3 8003874: b8 20 60 00 mv r12,r1 rtems_filesystem_freenode( &loc ); 8003878: b9 60 08 00 mv r1,r11 800387c: fb ff fa fd calli 8002470 if ( free_parentloc ) 8003880: 45 a0 00 03 be r13,r0,800388c rtems_filesystem_freenode( &parentloc ); 8003884: b9 c0 08 00 mv r1,r14 8003888: fb ff fa fa calli 8002470 return result; } 800388c: b9 80 08 00 mv r1,r12 8003890: 2b 9d 00 04 lw ra,(sp+4) 8003894: 2b 8b 00 14 lw r11,(sp+20) 8003898: 2b 8c 00 10 lw r12,(sp+16) 800389c: 2b 8d 00 0c lw r13,(sp+12) 80038a0: 2b 8e 00 08 lw r14,(sp+8) 80038a4: 37 9c 00 40 addi sp,sp,64 80038a8: c3 a0 00 00 ret =============================================================================== 08001fac : uint32_t rtems_assoc_remote_by_local_bitfield( const rtems_assoc_t *ap, uint32_t local_value ) { 8001fac: 37 9c ff e8 addi sp,sp,-24 8001fb0: 5b 8b 00 18 sw (sp+24),r11 8001fb4: 5b 8c 00 14 sw (sp+20),r12 8001fb8: 5b 8d 00 10 sw (sp+16),r13 8001fbc: 5b 8e 00 0c sw (sp+12),r14 8001fc0: 5b 8f 00 08 sw (sp+8),r15 8001fc4: 5b 9d 00 04 sw (sp+4),ra 8001fc8: 34 0d 00 20 mvi r13,32 8001fcc: b8 20 78 00 mv r15,r1 8001fd0: b8 40 70 00 mv r14,r2 uint32_t b; uint32_t remote_value = 0; 8001fd4: 34 0c 00 00 mvi r12,0 for (b = 1; b; b <<= 1) 8001fd8: 34 0b 00 01 mvi r11,1 if (b & local_value) 8001fdc: a1 6e 08 00 and r1,r11,r14 8001fe0: 44 20 00 05 be r1,r0,8001ff4 remote_value |= rtems_assoc_remote_by_local(ap, b); 8001fe4: b9 e0 08 00 mv r1,r15 8001fe8: b9 60 10 00 mv r2,r11 8001fec: f8 00 00 11 calli 8002030 8001ff0: b9 81 60 00 or r12,r12,r1 ) { uint32_t b; uint32_t remote_value = 0; for (b = 1; b; b <<= 1) 8001ff4: b9 60 08 00 mv r1,r11 8001ff8: 34 02 00 01 mvi r2,1 8001ffc: f8 00 3d 24 calli 801148c <__ashlsi3> 8002000: 35 ad ff ff addi r13,r13,-1 8002004: b8 20 58 00 mv r11,r1 8002008: 5d a0 ff f5 bne r13,r0,8001fdc <== NEVER TAKEN if (b & local_value) remote_value |= rtems_assoc_remote_by_local(ap, b); return remote_value; } 800200c: b9 80 08 00 mv r1,r12 8002010: 2b 9d 00 04 lw ra,(sp+4) 8002014: 2b 8b 00 18 lw r11,(sp+24) 8002018: 2b 8c 00 14 lw r12,(sp+20) 800201c: 2b 8d 00 10 lw r13,(sp+16) 8002020: 2b 8e 00 0c lw r14,(sp+12) 8002024: 2b 8f 00 08 lw r15,(sp+8) 8002028: 37 9c 00 18 addi sp,sp,24 800202c: c3 a0 00 00 ret =============================================================================== 08000c84 : const char *rtems_bsp_cmdline_get_param( const char *name, char *value, size_t length ) { 8000c84: 37 9c ff f4 addi sp,sp,-12 8000c88: 5b 8b 00 0c sw (sp+12),r11 8000c8c: 5b 8c 00 08 sw (sp+8),r12 8000c90: 5b 9d 00 04 sw (sp+4),ra 8000c94: b8 40 58 00 mv r11,r2 8000c98: b8 60 60 00 mv r12,r3 const char *p; if ( !name ) 8000c9c: 44 20 00 1b be r1,r0,8000d08 return NULL; if ( !value ) 8000ca0: 44 40 00 1b be r2,r0,8000d0c return NULL; if ( !length ) 8000ca4: 44 60 00 19 be r3,r0,8000d08 return NULL; value[0] = '\0'; 8000ca8: 30 40 00 00 sb (r2+0),r0 p = rtems_bsp_cmdline_get_param_raw( name ); 8000cac: f8 00 00 1e calli 8000d24 if ( !p ) 8000cb0: 44 20 00 16 be r1,r0,8000d08 8000cb4: b9 60 10 00 mv r2,r11 8000cb8: 34 05 00 00 mvi r5,0 int i; int quotes; const char *p = start; quotes=0; for (i=0 ; *p && i int quotes; const char *p = start; quotes=0; for (i=0 ; *p && i quotes++; 8000cd0: 34 a5 00 01 addi r5,r5,1 8000cd4: e0 00 00 04 bi 8000ce4 } else if ( ((quotes % 2) == 0) && *p == ' ' ) 8000cd8: 20 a7 00 01 andi r7,r5,0x1 8000cdc: 5c e0 00 02 bne r7,r0,8000ce4 8000ce0: 44 83 00 0b be r4,r3,8000d0c break; value[i++] = *p++; 8000ce4: 30 44 00 00 sb (r2+0),r4 value[i] = '\0'; 8000ce8: 30 40 00 01 sb (r2+1),r0 for (i=0 ; *p && i 8000cfc: c8 4b 38 00 sub r7,r2,r11 8000d00: 55 87 ff f3 bgu r12,r7,8000ccc <== ALWAYS TAKEN 8000d04: e0 00 00 02 bi 8000d0c <== NOT EXECUTED value[0] = '\0'; p = rtems_bsp_cmdline_get_param_raw( name ); if ( !p ) return NULL; 8000d08: 34 0b 00 00 mvi r11,0 copy_string( p, value, length ); return value; } 8000d0c: b9 60 08 00 mv r1,r11 8000d10: 2b 9d 00 04 lw ra,(sp+4) 8000d14: 2b 8b 00 0c lw r11,(sp+12) 8000d18: 2b 8c 00 08 lw r12,(sp+8) 8000d1c: 37 9c 00 0c addi sp,sp,12 8000d20: c3 a0 00 00 ret =============================================================================== 08000d5c : const char *rtems_bsp_cmdline_get_param_rhs( const char *name, char *value, size_t length ) { 8000d5c: 37 9c ff f0 addi sp,sp,-16 8000d60: 5b 8b 00 10 sw (sp+16),r11 8000d64: 5b 8c 00 0c sw (sp+12),r12 8000d68: 5b 8d 00 08 sw (sp+8),r13 8000d6c: 5b 9d 00 04 sw (sp+4),ra 8000d70: b8 20 68 00 mv r13,r1 8000d74: b8 40 58 00 mv r11,r2 const char *p; const char *rhs; char *d; p = rtems_bsp_cmdline_get_param( name, value, length ); 8000d78: fb ff ff c3 calli 8000c84 8000d7c: b8 20 60 00 mv r12,r1 if ( !p ) 8000d80: 44 20 00 1a be r1,r0,8000de8 return NULL; rhs = &p[strlen(name)]; 8000d84: b9 a0 08 00 mv r1,r13 8000d88: f8 00 2d ea calli 800c530 8000d8c: b5 81 18 00 add r3,r12,r1 if ( *rhs != '=' ) 8000d90: 40 62 00 00 lbu r2,(r3+0) 8000d94: 34 01 00 3d mvi r1,61 8000d98: 5c 41 00 14 bne r2,r1,8000de8 <== NEVER TAKEN return NULL; rhs++; if ( *rhs == '\"' ) 8000d9c: 40 64 00 01 lbu r4,(r3+1) 8000da0: 34 02 00 22 mvi r2,34 rhs = &p[strlen(name)]; if ( *rhs != '=' ) return NULL; rhs++; 8000da4: 34 61 00 01 addi r1,r3,1 if ( *rhs == '\"' ) 8000da8: 5c 82 00 02 bne r4,r2,8000db0 rhs++; 8000dac: 34 61 00 02 addi r1,r3,2 const char *rtems_bsp_cmdline_get_param_rhs( const char *name, char *value, size_t length ) { 8000db0: b9 60 18 00 mv r3,r11 8000db4: e0 00 00 04 bi 8000dc4 rhs++; if ( *rhs == '\"' ) rhs++; for ( d=value ; *rhs ; ) *d++ = *rhs++; 8000db8: 30 62 00 00 sb (r3+0),r2 8000dbc: 34 21 00 01 addi r1,r1,1 8000dc0: 34 63 00 01 addi r3,r3,1 return NULL; rhs++; if ( *rhs == '\"' ) rhs++; for ( d=value ; *rhs ; ) 8000dc4: 40 22 00 00 lbu r2,(r1+0) 8000dc8: 5c 40 ff fc bne r2,r0,8000db8 *d++ = *rhs++; if ( *(d-1) == '\"' ) 8000dcc: 40 64 ff ff lbu r4,(r3+-1) 8000dd0: 34 02 00 22 mvi r2,34 8000dd4: 34 61 ff ff addi r1,r3,-1 8000dd8: 44 82 00 02 be r4,r2,8000de0 8000ddc: b8 60 08 00 mv r1,r3 d--; *d = '\0'; 8000de0: 30 20 00 00 sb (r1+0),r0 return value; 8000de4: e0 00 00 02 bi 8000dec if ( !p ) return NULL; rhs = &p[strlen(name)]; if ( *rhs != '=' ) return NULL; 8000de8: 34 0b 00 00 mvi r11,0 if ( *(d-1) == '\"' ) d--; *d = '\0'; return value; } 8000dec: b9 60 08 00 mv r1,r11 8000df0: 2b 9d 00 04 lw ra,(sp+4) 8000df4: 2b 8b 00 10 lw r11,(sp+16) 8000df8: 2b 8c 00 0c lw r12,(sp+12) 8000dfc: 2b 8d 00 08 lw r13,(sp+8) 8000e00: 37 9c 00 10 addi sp,sp,16 8000e04: c3 a0 00 00 ret =============================================================================== 08010b48 : * error code - if unsuccessful */ rtems_status_code rtems_clock_set_nanoseconds_extension( rtems_nanoseconds_extension_routine routine ) { 8010b48: b8 20 18 00 mv r3,r1 if ( !routine ) return RTEMS_INVALID_ADDRESS; 8010b4c: 34 01 00 09 mvi r1,9 */ rtems_status_code rtems_clock_set_nanoseconds_extension( rtems_nanoseconds_extension_routine routine ) { if ( !routine ) 8010b50: 44 60 00 05 be r3,r0,8010b64 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _Watchdog_Nanoseconds_since_tick_handler = routine; 8010b54: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED 8010b58: 38 42 ed b0 ori r2,r2,0xedb0 <== NOT EXECUTED 8010b5c: 58 43 00 00 sw (r2+0),r3 <== NOT EXECUTED return RTEMS_SUCCESSFUL; 8010b60: 34 01 00 00 mvi r1,0 <== NOT EXECUTED } 8010b64: c3 a0 00 00 ret =============================================================================== 08001a58 : void rtems_cpu_usage_report_with_plugin( void *context, rtems_printk_plugin_t print ) { 8001a58: 37 9c ff 84 addi sp,sp,-124 8001a5c: 5b 8b 00 44 sw (sp+68),r11 8001a60: 5b 8c 00 40 sw (sp+64),r12 8001a64: 5b 8d 00 3c sw (sp+60),r13 8001a68: 5b 8e 00 38 sw (sp+56),r14 8001a6c: 5b 8f 00 34 sw (sp+52),r15 8001a70: 5b 90 00 30 sw (sp+48),r16 8001a74: 5b 91 00 2c sw (sp+44),r17 8001a78: 5b 92 00 28 sw (sp+40),r18 8001a7c: 5b 93 00 24 sw (sp+36),r19 8001a80: 5b 94 00 20 sw (sp+32),r20 8001a84: 5b 95 00 1c sw (sp+28),r21 8001a88: 5b 96 00 18 sw (sp+24),r22 8001a8c: 5b 97 00 14 sw (sp+20),r23 8001a90: 5b 98 00 10 sw (sp+16),r24 8001a94: 5b 99 00 0c sw (sp+12),r25 8001a98: 5b 9b 00 08 sw (sp+8),fp 8001a9c: 5b 9d 00 04 sw (sp+4),ra 8001aa0: b8 20 70 00 mv r14,r1 8001aa4: b8 40 68 00 mv r13,r2 Timestamp_Control uptime, total, ran; #else uint32_t total_units = 0; #endif if ( !print ) 8001aa8: 44 40 00 61 be r2,r0,8001c2c <== NEVER TAKEN * When not using nanosecond CPU usage resolution, we have to count * the number of "ticks" we gave credit for to give the user a rough * guideline as to what each number means proportionally. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); 8001aac: 37 8b 00 70 addi r11,sp,112 8001ab0: b9 60 08 00 mv r1,r11 8001ab4: f8 00 0f 7f calli 80058b0 <_TOD_Get_uptime> _Timestamp_Subtract( &CPU_usage_Uptime_at_last_reset, &uptime, &total ); 8001ab8: 37 90 00 68 addi r16,sp,104 8001abc: 78 01 08 02 mvhi r1,0x802 8001ac0: 38 21 78 54 ori r1,r1,0x7854 8001ac4: b9 60 10 00 mv r2,r11 8001ac8: ba 00 18 00 mv r3,r16 8001acc: f8 00 1a 89 calli 80084f0 <_Timespec_Subtract> } } } #endif (*print)( 8001ad0: 78 02 08 01 mvhi r2,0x801 8001ad4: b9 c0 08 00 mv r1,r14 8001ad8: 38 42 cc e0 ori r2,r2,0xcce0 8001adc: 78 0c 08 02 mvhi r12,0x802 if ( !the_thread ) continue; rtems_object_get_name( the_thread->Object.id, sizeof(name), name ); (*print)( 8001ae0: 78 13 08 01 mvhi r19,0x801 /* * If this is the currently executing thread, account for time * since the last context switch. */ ran = the_thread->cpu_time_used; if ( _Thread_Executing->Object.id == the_thread->Object.id ) { 8001ae4: 78 0f 08 02 mvhi r15,0x802 /* * Print the information */ (*print)( context, 8001ae8: 78 12 08 01 mvhi r18,0x801 * since the last context switch. */ ran = the_thread->cpu_time_used; if ( _Thread_Executing->Object.id == the_thread->Object.id ) { Timestamp_Control used; _Timestamp_Subtract( 8001aec: 78 11 08 02 mvhi r17,0x802 } } } #endif (*print)( 8001af0: d9 a0 00 00 call r13 8001af4: 39 8c 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 ); 8001af8: 37 98 00 48 addi r24,sp,72 (*print)( 8001afc: 3a 73 ce 54 ori r19,r19,0xce54 /* * If this is the currently executing thread, account for time * since the last context switch. */ ran = the_thread->cpu_time_used; if ( _Thread_Executing->Object.id == the_thread->Object.id ) { 8001b00: 39 ef 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 ); 8001b04: 37 97 00 60 addi r23,sp,96 8001b08: 37 9b 00 78 addi fp,sp,120 /* * Print the information */ (*print)( context, 8001b0c: 3a 52 ce 68 ori r18,r18,0xce68 * since the last context switch. */ ran = the_thread->cpu_time_used; if ( _Thread_Executing->Object.id == the_thread->Object.id ) { Timestamp_Control used; _Timestamp_Subtract( 8001b10: 3a 31 76 d4 ori r17,r17,0x76d4 8001b14: b9 60 c8 00 mv r25,r11 8001b18: 37 96 00 58 addi r22,sp,88 ); for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) 8001b1c: 29 83 00 00 lw r3,(r12+0) 8001b20: 44 60 00 35 be r3,r0,8001bf4 continue; information = _Objects_Information_table[ api_index ][ 1 ]; 8001b24: 28 70 00 04 lw r16,(r3+4) if ( information ) { 8001b28: 34 15 00 04 mvi r21,4 8001b2c: 34 14 00 01 mvi r20,1 8001b30: 5e 00 00 2f bne r16,r0,8001bec <== ALWAYS TAKEN 8001b34: e0 00 00 30 bi 8001bf4 <== NOT EXECUTED for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 8001b38: 2a 01 00 1c lw r1,(r16+28) 8001b3c: b4 35 08 00 add r1,r1,r21 8001b40: 28 2b 00 00 lw r11,(r1+0) if ( !the_thread ) 8001b44: 45 60 00 28 be r11,r0,8001be4 <== NEVER TAKEN continue; rtems_object_get_name( the_thread->Object.id, sizeof(name), name ); 8001b48: 29 61 00 08 lw r1,(r11+8) 8001b4c: 34 02 00 0d mvi r2,13 8001b50: bb 00 18 00 mv r3,r24 8001b54: f8 00 0a 21 calli 80043d8 (*print)( 8001b58: 29 63 00 08 lw r3,(r11+8) 8001b5c: ba 60 10 00 mv r2,r19 8001b60: b9 c0 08 00 mv r1,r14 8001b64: bb 00 20 00 mv r4,r24 8001b68: d9 a0 00 00 call r13 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ /* * If this is the currently executing thread, account for time * since the last context switch. */ ran = the_thread->cpu_time_used; 8001b6c: 29 61 00 84 lw r1,(r11+132) 8001b70: 5b 81 00 60 sw (sp+96),r1 8001b74: 29 61 00 88 lw r1,(r11+136) 8001b78: 5b 81 00 64 sw (sp+100),r1 if ( _Thread_Executing->Object.id == the_thread->Object.id ) { 8001b7c: 29 e1 00 0c lw r1,(r15+12) 8001b80: 28 22 00 08 lw r2,(r1+8) 8001b84: 29 61 00 08 lw r1,(r11+8) 8001b88: 5c 41 00 08 bne r2,r1,8001ba8 Timestamp_Control used; _Timestamp_Subtract( 8001b8c: ba 20 08 00 mv r1,r17 8001b90: bb 20 10 00 mv r2,r25 8001b94: ba c0 18 00 mv r3,r22 8001b98: f8 00 1a 56 calli 80084f0 <_Timespec_Subtract> &_Thread_Time_of_last_context_switch, &uptime, &used ); _Timestamp_Add_to( &ran, &used ); 8001b9c: ba e0 08 00 mv r1,r23 8001ba0: ba c0 10 00 mv r2,r22 8001ba4: f8 00 19 e2 calli 800832c <_Timespec_Add_to> }; _Timestamp_Divide( &ran, &total, &ival, &fval ); 8001ba8: 37 83 00 7c addi r3,sp,124 8001bac: bb 60 20 00 mv r4,fp 8001bb0: ba e0 08 00 mv r1,r23 8001bb4: 37 82 00 68 addi r2,sp,104 8001bb8: f8 00 19 f6 calli 8008390 <_Timespec_Divide> /* * Print the information */ (*print)( context, 8001bbc: 2b 81 00 64 lw r1,(sp+100) 8001bc0: 34 02 03 e8 mvi r2,1000 8001bc4: f8 00 67 fd calli 801bbb8 <__udivsi3> 8001bc8: 2b 83 00 60 lw r3,(sp+96) 8001bcc: 2b 85 00 7c lw r5,(sp+124) 8001bd0: 2b 86 00 78 lw r6,(sp+120) 8001bd4: b8 20 20 00 mv r4,r1 8001bd8: ba 40 10 00 mv r2,r18 8001bdc: b9 c0 08 00 mv r1,r14 8001be0: d9 a0 00 00 call r13 api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) continue; information = _Objects_Information_table[ api_index ][ 1 ]; if ( information ) { for ( i=1 ; i <= information->maximum ; i++ ) { 8001be4: 36 94 00 01 addi r20,r20,1 8001be8: 36 b5 00 04 addi r21,r21,4 8001bec: 2e 01 00 10 lhu r1,(r16+16) 8001bf0: 50 34 ff d2 bgeu r1,r20,8001b38 " ID | NAME | TICKS | PERCENT\n" #endif "------------+----------------------------------------+---------------+---------\n" ); for ( api_index = 1 ; 8001bf4: 78 01 08 02 mvhi r1,0x802 api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) continue; information = _Objects_Information_table[ api_index ][ 1 ]; if ( information ) { for ( i=1 ; i <= information->maximum ; i++ ) { 8001bf8: 35 8c 00 04 addi r12,r12,4 " ID | NAME | TICKS | PERCENT\n" #endif "------------+----------------------------------------+---------------+---------\n" ); for ( api_index = 1 ; 8001bfc: 38 21 75 d0 ori r1,r1,0x75d0 8001c00: 5d 81 ff c7 bne r12,r1,8001b1c } } } #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( 8001c04: 2b 81 00 6c lw r1,(sp+108) 8001c08: 34 02 03 e8 mvi r2,1000 8001c0c: 78 0b 08 01 mvhi r11,0x801 8001c10: f8 00 67 ea calli 801bbb8 <__udivsi3> 8001c14: 2b 83 00 68 lw r3,(sp+104) 8001c18: 39 6b ce 80 ori r11,r11,0xce80 8001c1c: b8 20 20 00 mv r4,r1 8001c20: b9 60 10 00 mv r2,r11 8001c24: b9 c0 08 00 mv r1,r14 8001c28: d9 a0 00 00 call r13 "-------------------------------------------------------------------------------\n", _Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset, total_units ); #endif } 8001c2c: 2b 9d 00 04 lw ra,(sp+4) 8001c30: 2b 8b 00 44 lw r11,(sp+68) 8001c34: 2b 8c 00 40 lw r12,(sp+64) 8001c38: 2b 8d 00 3c lw r13,(sp+60) 8001c3c: 2b 8e 00 38 lw r14,(sp+56) 8001c40: 2b 8f 00 34 lw r15,(sp+52) 8001c44: 2b 90 00 30 lw r16,(sp+48) 8001c48: 2b 91 00 2c lw r17,(sp+44) 8001c4c: 2b 92 00 28 lw r18,(sp+40) 8001c50: 2b 93 00 24 lw r19,(sp+36) 8001c54: 2b 94 00 20 lw r20,(sp+32) 8001c58: 2b 95 00 1c lw r21,(sp+28) 8001c5c: 2b 96 00 18 lw r22,(sp+24) 8001c60: 2b 97 00 14 lw r23,(sp+20) 8001c64: 2b 98 00 10 lw r24,(sp+16) 8001c68: 2b 99 00 0c lw r25,(sp+12) 8001c6c: 2b 9b 00 08 lw fp,(sp+8) 8001c70: 37 9c 00 7c addi sp,sp,124 8001c74: c3 a0 00 00 ret =============================================================================== 0800b37c : [RTEMS_IO_ERROR] = EIO, [RTEMS_PROXY_BLOCKING] = EIO }; int rtems_deviceio_errno(rtems_status_code sc) { 800b37c: 37 9c ff f8 addi sp,sp,-8 800b380: 5b 8b 00 08 sw (sp+8),r11 800b384: 5b 9d 00 04 sw (sp+4),ra if (sc == RTEMS_SUCCESSFUL) { return 0; 800b388: 34 02 00 00 mvi r2,0 [RTEMS_PROXY_BLOCKING] = EIO }; int rtems_deviceio_errno(rtems_status_code sc) { if (sc == RTEMS_SUCCESSFUL) { 800b38c: 44 20 00 0d be r1,r0,800b3c0 <== ALWAYS TAKEN return 0; } else { int eno = EINVAL; if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) { 800b390: 34 02 00 1c mvi r2,28 <== NOT EXECUTED int rtems_deviceio_errno(rtems_status_code sc) { if (sc == RTEMS_SUCCESSFUL) { return 0; } else { int eno = EINVAL; 800b394: 34 0b 00 16 mvi r11,22 <== NOT EXECUTED if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) { 800b398: 54 22 00 07 bgu r1,r2,800b3b4 <== NOT EXECUTED eno = status_code_to_errno [sc]; 800b39c: 78 0b 08 01 mvhi r11,0x801 <== NOT EXECUTED 800b3a0: 34 02 00 02 mvi r2,2 <== NOT EXECUTED 800b3a4: 39 6b 20 44 ori r11,r11,0x2044 <== NOT EXECUTED 800b3a8: f8 00 15 2d calli 801085c <__ashlsi3> <== NOT EXECUTED 800b3ac: b5 61 08 00 add r1,r11,r1 <== NOT EXECUTED 800b3b0: 28 2b 00 00 lw r11,(r1+0) <== NOT EXECUTED } errno = eno; 800b3b4: f8 00 00 12 calli 800b3fc <__errno> <== NOT EXECUTED 800b3b8: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED return -1; 800b3bc: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED } } 800b3c0: b8 40 08 00 mv r1,r2 800b3c4: 2b 9d 00 04 lw ra,(sp+4) 800b3c8: 2b 8b 00 08 lw r11,(sp+8) 800b3cc: 37 9c 00 08 addi sp,sp,8 800b3d0: c3 a0 00 00 ret =============================================================================== 08001244 : size_t pathnamelen, int flags, rtems_filesystem_location_info_t *pathloc, int follow_link ) { 8001244: 37 9c ff e4 addi sp,sp,-28 8001248: 5b 8b 00 10 sw (sp+16),r11 800124c: 5b 8c 00 0c sw (sp+12),r12 8001250: 5b 8d 00 08 sw (sp+8),r13 8001254: 5b 9d 00 04 sw (sp+4),ra int i = 0; 8001258: 5b 80 00 1c sw (sp+28),r0 size_t pathnamelen, int flags, rtems_filesystem_location_info_t *pathloc, int follow_link ) { 800125c: b8 20 58 00 mv r11,r1 8001260: b8 40 68 00 mv r13,r2 8001264: b8 60 60 00 mv r12,r3 /* * Verify Input parameters. */ if ( !pathname ) 8001268: 5c 20 00 04 bne r1,r0,8001278 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); 800126c: f8 00 28 64 calli 800b3fc <__errno> <== NOT EXECUTED 8001270: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 8001274: e0 00 00 04 bi 8001284 <== NOT EXECUTED if ( !pathloc ) 8001278: 5c 80 00 06 bne r4,r0,8001290 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EIO ); /* should never happen */ 800127c: f8 00 28 60 calli 800b3fc <__errno> <== NOT EXECUTED 8001280: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8001284: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8001288: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800128c: e0 00 00 0d bi 80012c0 <== NOT EXECUTED /* * Evaluate the path using the optable evalpath. */ rtems_filesystem_get_start_loc( pathname, &i, pathloc ); 8001290: b8 80 18 00 mv r3,r4 8001294: 37 82 00 1c addi r2,sp,28 8001298: 5b 84 00 18 sw (sp+24),r4 800129c: 5b 85 00 14 sw (sp+20),r5 80012a0: f8 00 04 30 calli 8002360 /* * We evaluation the path relative to the start location we get got. */ return rtems_filesystem_evaluate_relative_path( &pathname[i], 80012a4: 2b 86 00 1c lw r6,(sp+28) 80012a8: 2b 84 00 18 lw r4,(sp+24) 80012ac: 2b 85 00 14 lw r5,(sp+20) 80012b0: b5 66 08 00 add r1,r11,r6 80012b4: c9 a6 10 00 sub r2,r13,r6 80012b8: b9 80 18 00 mv r3,r12 80012bc: fb ff ff b6 calli 8001194 pathnamelen - i, flags, pathloc, follow_link ); } 80012c0: 2b 9d 00 04 lw ra,(sp+4) 80012c4: 2b 8b 00 10 lw r11,(sp+16) 80012c8: 2b 8c 00 0c lw r12,(sp+12) 80012cc: 2b 8d 00 08 lw r13,(sp+8) 80012d0: 37 9c 00 1c addi sp,sp,28 80012d4: c3 a0 00 00 ret =============================================================================== 08001194 : size_t pathnamelen, int flags, rtems_filesystem_location_info_t *pathloc, int follow_link ) { 8001194: 37 9c ff f0 addi sp,sp,-16 8001198: 5b 8b 00 10 sw (sp+16),r11 800119c: 5b 8c 00 0c sw (sp+12),r12 80011a0: 5b 8d 00 08 sw (sp+8),r13 80011a4: 5b 9d 00 04 sw (sp+4),ra 80011a8: b8 60 60 00 mv r12,r3 80011ac: b8 80 58 00 mv r11,r4 80011b0: b8 a0 68 00 mv r13,r5 /* * Verify Input parameters. */ if ( !pathname ) 80011b4: 5c 20 00 04 bne r1,r0,80011c4 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); 80011b8: f8 00 28 91 calli 800b3fc <__errno> <== NOT EXECUTED 80011bc: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 80011c0: e0 00 00 04 bi 80011d0 <== NOT EXECUTED if ( !pathloc ) 80011c4: 5c 80 00 06 bne r4,r0,80011dc <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EIO ); /* should never happen */ 80011c8: f8 00 28 8d calli 800b3fc <__errno> <== NOT EXECUTED 80011cc: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 80011d0: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 80011d4: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 80011d8: e0 00 00 15 bi 800122c <== NOT EXECUTED result = (*pathloc->ops->evalpath_h)( pathname, pathnamelen, flags, pathloc ); 80011dc: 28 85 00 0c lw r5,(r4+12) 80011e0: 28 a6 00 00 lw r6,(r5+0) 80011e4: d8 c0 00 00 call r6 /* * Get the Node type and determine if you need to follow the link or * not. */ if ( (result == 0) && follow_link ) { 80011e8: 64 22 00 00 cmpei r2,r1,0 80011ec: 7d a5 00 00 cmpnei r5,r13,0 80011f0: a0 45 28 00 and r5,r2,r5 80011f4: 44 a0 00 0e be r5,r0,800122c type = (*pathloc->ops->node_type_h)( pathloc ); 80011f8: 29 61 00 0c lw r1,(r11+12) 80011fc: 28 24 00 10 lw r4,(r1+16) 8001200: b9 60 08 00 mv r1,r11 8001204: d8 80 00 00 call r4 if ( ( type == RTEMS_FILESYSTEM_HARD_LINK ) || 8001208: 34 24 ff fd addi r4,r1,-3 800120c: 34 02 00 01 mvi r2,1 8001210: 34 01 00 00 mvi r1,0 8001214: 54 82 00 06 bgu r4,r2,800122c * pathloc will be passed up (and eventually released). * Hence, the (valid) originial node that we submit to * eval_link_h() should be released by the handler. */ result = (*pathloc->ops->eval_link_h)( pathloc, flags ); 8001218: 29 61 00 0c lw r1,(r11+12) 800121c: b9 80 10 00 mv r2,r12 8001220: 28 24 00 34 lw r4,(r1+52) 8001224: b9 60 08 00 mv r1,r11 8001228: d8 80 00 00 call r4 } } return result; } 800122c: 2b 9d 00 04 lw ra,(sp+4) 8001230: 2b 8b 00 10 lw r11,(sp+16) 8001234: 2b 8c 00 0c lw r12,(sp+12) 8001238: 2b 8d 00 08 lw r13,(sp+8) 800123c: 37 9c 00 10 addi sp,sp,16 8001240: c3 a0 00 00 ret =============================================================================== 080083e4 : rtems_filesystem_fsmount_me_t rtems_filesystem_get_mount_handler( const char *type ) { 80083e4: 37 9c ff f4 addi sp,sp,-12 80083e8: 5b 9d 00 04 sw (sp+4),ra find_arg fa = { 80083ec: 5b 81 00 08 sw (sp+8),r1 80083f0: 5b 80 00 0c sw (sp+12),r0 .type = type, .mount_h = NULL }; if ( type != NULL ) { 80083f4: 44 20 00 05 be r1,r0,8008408 <== NEVER TAKEN rtems_filesystem_iterate( find_handler, &fa ); 80083f8: 78 01 08 00 mvhi r1,0x800 80083fc: 38 21 82 80 ori r1,r1,0x8280 8008400: 37 82 00 08 addi r2,sp,8 8008404: fb ff ff c7 calli 8008320 } return fa.mount_h; } 8008408: 2b 81 00 0c lw r1,(sp+12) 800840c: 2b 9d 00 04 lw ra,(sp+4) 8008410: 37 9c 00 0c addi sp,sp,12 8008414: c3 a0 00 00 ret =============================================================================== 08000fcc : * configuration is a single instantiation of the IMFS or miniIMFS with * a single "/dev" directory in it. */ void rtems_filesystem_initialize( void ) { 8000fcc: 37 9c ff dc addi sp,sp,-36 8000fd0: 5b 8b 00 10 sw (sp+16),r11 8000fd4: 5b 8c 00 0c sw (sp+12),r12 8000fd8: 5b 8d 00 08 sw (sp+8),r13 8000fdc: 5b 9d 00 04 sw (sp+4),ra /* * Set the default umask to "022". */ rtems_filesystem_umask = 022; 8000fe0: 78 0b 08 01 mvhi r11,0x801 8000fe4: 39 6b 31 1c ori r11,r11,0x311c 8000fe8: 29 62 00 00 lw r2,(r11+0) 8000fec: 34 01 00 12 mvi r1,18 8000ff0: 58 41 00 2c sw (r2+44),r1 /* * mount the first filesystem. */ if ( rtems_filesystem_mount_table_size == 0 ) 8000ff4: 78 01 08 01 mvhi r1,0x801 8000ff8: 38 21 1a 30 ori r1,r1,0x1a30 8000ffc: 28 21 00 00 lw r1,(r1+0) rtems_fatal_error_occurred( 0xABCD0001 ); 8001000: 78 02 08 01 mvhi r2,0x801 8001004: 38 42 1b 90 ori r2,r2,0x1b90 /* * mount the first filesystem. */ if ( rtems_filesystem_mount_table_size == 0 ) 8001008: 44 20 00 0e be r1,r0,8001040 <== NEVER TAKEN rtems_fatal_error_occurred( 0xABCD0001 ); mt = &rtems_filesystem_mount_table[0]; 800100c: 78 01 08 01 mvhi r1,0x801 8001010: 38 21 30 18 ori r1,r1,0x3018 8001014: 28 24 00 00 lw r4,(r1+0) status = mount( mt->device, mt->mount_point, mt->type, mt->fsoptions, NULL ); 8001018: 34 05 00 00 mvi r5,0 800101c: 28 82 00 0c lw r2,(r4+12) 8001020: 28 81 00 08 lw r1,(r4+8) 8001024: 28 83 00 00 lw r3,(r4+0) 8001028: 28 84 00 04 lw r4,(r4+4) 800102c: f8 00 02 8c calli 8001a5c if ( status == -1 ) 8001030: 34 02 ff ff mvi r2,-1 8001034: 5c 22 00 05 bne r1,r2,8001048 <== ALWAYS TAKEN rtems_fatal_error_occurred( 0xABCD0002 ); 8001038: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 800103c: 38 42 1b 94 ori r2,r2,0x1b94 <== NOT EXECUTED 8001040: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 8001044: f8 00 08 3a calli 800312c <== NOT EXECUTED rtems_filesystem_link_counts = 0; 8001048: 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); 800104c: 78 0c 08 01 mvhi r12,0x801 8001050: 39 8c 1b 84 ori r12,r12,0x1b84 8001054: 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; 8001058: 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); 800105c: 34 02 00 01 mvi r2,1 8001060: 34 03 00 00 mvi r3,0 8001064: b9 a0 20 00 mv r4,r13 8001068: 34 05 00 00 mvi r5,0 800106c: b9 80 08 00 mv r1,r12 8001070: f8 00 00 75 calli 8001244 rtems_filesystem_root = loc; 8001074: 29 61 00 00 lw r1,(r11+0) 8001078: 2b 82 00 14 lw r2,(sp+20) /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 800107c: 34 03 00 00 mvi r3,0 8001080: 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; 8001084: 58 22 00 18 sw (r1+24),r2 8001088: 2b 82 00 18 lw r2,(sp+24) /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 800108c: 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; 8001090: 58 22 00 1c sw (r1+28),r2 8001094: 2b 82 00 1c lw r2,(sp+28) 8001098: 58 22 00 20 sw (r1+32),r2 800109c: 2b 82 00 20 lw r2,(sp+32) 80010a0: 58 22 00 24 sw (r1+36),r2 80010a4: 2b 82 00 24 lw r2,(sp+36) 80010a8: 58 22 00 28 sw (r1+40),r2 /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 80010ac: 34 02 00 01 mvi r2,1 80010b0: b9 80 08 00 mv r1,r12 80010b4: f8 00 00 64 calli 8001244 rtems_filesystem_current = loc; 80010b8: 29 61 00 00 lw r1,(r11+0) 80010bc: 2b 82 00 14 lw r2,(sp+20) 80010c0: 58 22 00 04 sw (r1+4),r2 80010c4: 2b 82 00 18 lw r2,(sp+24) 80010c8: 58 22 00 08 sw (r1+8),r2 80010cc: 2b 82 00 1c lw r2,(sp+28) 80010d0: 58 22 00 0c sw (r1+12),r2 80010d4: 2b 82 00 20 lw r2,(sp+32) 80010d8: 58 22 00 10 sw (r1+16),r2 80010dc: 2b 82 00 24 lw r2,(sp+36) 80010e0: 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); 80010e4: 78 01 08 01 mvhi r1,0x801 80010e8: 34 02 01 ff mvi r2,511 80010ec: 38 21 1b 88 ori r1,r1,0x1b88 80010f0: f8 00 01 e8 calli 8001890 if ( status != 0 ) rtems_fatal_error_occurred( 0xABCD0003 ); 80010f4: 78 02 08 01 mvhi r2,0x801 80010f8: 38 42 1b 98 ori r2,r2,0x1b98 * 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 ) 80010fc: 5c 20 ff d1 bne r1,r0,8001040 <== 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. */ } 8001100: 2b 9d 00 04 lw ra,(sp+4) 8001104: 2b 8b 00 10 lw r11,(sp+16) 8001108: 2b 8c 00 0c lw r12,(sp+12) 800110c: 2b 8d 00 08 lw r13,(sp+8) 8001110: 37 9c 00 24 addi sp,sp,36 8001114: c3 a0 00 00 ret =============================================================================== 08008320 : bool rtems_filesystem_iterate( rtems_per_filesystem_routine routine, void *routine_arg ) { 8008320: 37 9c ff e8 addi sp,sp,-24 8008324: 5b 8b 00 18 sw (sp+24),r11 8008328: 5b 8c 00 14 sw (sp+20),r12 800832c: 5b 8d 00 10 sw (sp+16),r13 8008330: 5b 8e 00 0c sw (sp+12),r14 8008334: 5b 8f 00 08 sw (sp+8),r15 8008338: 5b 9d 00 04 sw (sp+4),ra const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0]; 800833c: 78 0b 08 01 mvhi r11,0x801 bool rtems_filesystem_iterate( rtems_per_filesystem_routine routine, void *routine_arg ) { 8008340: b8 20 70 00 mv r14,r1 8008344: 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; 8008348: 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]; 800834c: 39 6b 1a 10 ori r11,r11,0x1a10 rtems_chain_node *node = NULL; bool stop = false; while ( table_entry->type && !stop ) { 8008350: e0 00 00 06 bi 8008368 stop = (*routine)( table_entry, routine_arg ); 8008354: b9 60 08 00 mv r1,r11 8008358: b9 e0 10 00 mv r2,r15 800835c: d9 c0 00 00 call r14 8008360: b8 20 18 00 mv r3,r1 ++table_entry; 8008364: 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 ) { 8008368: 29 61 00 00 lw r1,(r11+0) 800836c: 44 20 00 03 be r1,r0,8008378 8008370: 44 60 ff f9 be r3,r0,8008354 <== ALWAYS TAKEN 8008374: e0 00 00 13 bi 80083c0 <== NOT EXECUTED 8008378: b8 60 58 00 mv r11,r3 stop = (*routine)( table_entry, routine_arg ); ++table_entry; } if ( !stop ) { 800837c: 5c 23 00 11 bne r1,r3,80083c0 rtems_libio_lock(); 8008380: fb ff ff d4 calli 80082d0 } } rtems_libio_unlock(); rtems_set_errno_and_return_minus_one( ENOENT ); } 8008384: 78 03 08 01 mvhi r3,0x801 8008388: 38 63 31 20 ori r3,r3,0x3120 ++table_entry; } if ( !stop ) { rtems_libio_lock(); for ( 800838c: 78 0d 08 01 mvhi r13,0x801 } } rtems_libio_unlock(); rtems_set_errno_and_return_minus_one( ENOENT ); } 8008390: 28 6c 00 00 lw r12,(r3+0) ++table_entry; } if ( !stop ) { rtems_libio_lock(); for ( 8008394: 39 ad 31 24 ori r13,r13,0x3124 8008398: e0 00 00 06 bi 80083b0 !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 ); 800839c: 35 81 00 08 addi r1,r12,8 80083a0: b9 e0 10 00 mv r2,r15 80083a4: d9 c0 00 00 call r14 } } rtems_libio_unlock(); rtems_set_errno_and_return_minus_one( ENOENT ); } 80083a8: 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 ); 80083ac: b8 20 58 00 mv r11,r1 ++table_entry; } if ( !stop ) { rtems_libio_lock(); for ( 80083b0: 45 8d 00 02 be r12,r13,80083b8 node = rtems_chain_first( &filesystem_chain ); !rtems_chain_is_tail( &filesystem_chain, node ) && !stop; 80083b4: 45 60 ff fa be r11,r0,800839c <== ALWAYS TAKEN ) { const filesystem_node *fsn = (filesystem_node *) node; stop = (*routine)( &fsn->entry, routine_arg ); } rtems_libio_unlock(); 80083b8: fb ff ff d1 calli 80082fc 80083bc: b9 60 18 00 mv r3,r11 } return stop; } 80083c0: b8 60 08 00 mv r1,r3 80083c4: 2b 9d 00 04 lw ra,(sp+4) 80083c8: 2b 8b 00 18 lw r11,(sp+24) 80083cc: 2b 8c 00 14 lw r12,(sp+20) 80083d0: 2b 8d 00 10 lw r13,(sp+16) 80083d4: 2b 8e 00 0c lw r14,(sp+12) 80083d8: 2b 8f 00 08 lw r15,(sp+8) 80083dc: 37 9c 00 18 addi sp,sp,24 80083e0: c3 a0 00 00 ret =============================================================================== 080019d4 : bool rtems_filesystem_mount_iterate( rtems_per_filesystem_mount_routine routine, void *routine_arg ) { 80019d4: 37 9c ff e8 addi sp,sp,-24 80019d8: 5b 8b 00 18 sw (sp+24),r11 80019dc: 5b 8c 00 14 sw (sp+20),r12 80019e0: 5b 8d 00 10 sw (sp+16),r13 80019e4: 5b 8e 00 0c sw (sp+12),r14 80019e8: 5b 8f 00 08 sw (sp+8),r15 80019ec: 5b 9d 00 04 sw (sp+4),ra 80019f0: b8 20 78 00 mv r15,r1 80019f4: b8 40 70 00 mv r14,r2 rtems_chain_node *node = NULL; bool stop = false; rtems_libio_lock(); 80019f8: fb ff ff e3 calli 8001984 stop = (*routine)( mt_entry, routine_arg ); } rtems_libio_unlock(); return stop; } 80019fc: 78 03 08 01 mvhi r3,0x801 8001a00: 38 63 31 10 ori r3,r3,0x3110 { rtems_chain_node *node = NULL; bool stop = false; rtems_libio_lock(); for ( 8001a04: 78 0d 08 01 mvhi r13,0x801 stop = (*routine)( mt_entry, routine_arg ); } rtems_libio_unlock(); return stop; } 8001a08: 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; 8001a0c: 34 0c 00 00 mvi r12,0 rtems_libio_lock(); for ( 8001a10: 39 ad 31 14 ori r13,r13,0x3114 8001a14: e0 00 00 06 bi 8001a2c 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 ); 8001a18: b9 60 08 00 mv r1,r11 8001a1c: b9 c0 10 00 mv r2,r14 8001a20: d9 e0 00 00 call r15 } rtems_libio_unlock(); return stop; } 8001a24: 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 ); 8001a28: b8 20 60 00 mv r12,r1 { rtems_chain_node *node = NULL; bool stop = false; rtems_libio_lock(); for ( 8001a2c: 45 6d 00 02 be r11,r13,8001a34 node = rtems_chain_first( &mount_chain ); !rtems_chain_is_tail( &mount_chain, node ) && !stop; 8001a30: 45 80 ff fa be r12,r0,8001a18 <== 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(); 8001a34: fb ff ff df calli 80019b0 return stop; } 8001a38: b9 80 08 00 mv r1,r12 8001a3c: 2b 9d 00 04 lw ra,(sp+4) 8001a40: 2b 8b 00 18 lw r11,(sp+24) 8001a44: 2b 8c 00 14 lw r12,(sp+20) 8001a48: 2b 8d 00 10 lw r13,(sp+16) 8001a4c: 2b 8e 00 0c lw r14,(sp+12) 8001a50: 2b 8f 00 08 lw r15,(sp+8) 8001a54: 37 9c 00 18 addi sp,sp,24 8001a58: c3 a0 00 00 ret =============================================================================== 08001328 : int rtems_filesystem_prefix_separators( const char *pathname, int pathnamelen ) { 8001328: 37 9c ff f0 addi sp,sp,-16 800132c: 5b 8b 00 10 sw (sp+16),r11 8001330: 5b 8c 00 0c sw (sp+12),r12 8001334: 5b 8d 00 08 sw (sp+8),r13 8001338: 5b 9d 00 04 sw (sp+4),ra /* * Eat any separators at start of the path. */ int stripped = 0; 800133c: 34 0b 00 00 mvi r11,0 int rtems_filesystem_prefix_separators( const char *pathname, int pathnamelen ) { 8001340: b8 20 68 00 mv r13,r1 8001344: 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 ) ) 8001348: e0 00 00 02 bi 8001350 { pathname++; pathnamelen--; stripped++; 800134c: 35 6b 00 01 addi r11,r11,1 } return len; } int rtems_filesystem_prefix_separators( 8001350: 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 ) ) 8001354: 40 21 00 00 lbu r1,(r1+0) 8001358: fd 8b 18 00 cmpne r3,r12,r11 800135c: 7c 22 00 00 cmpnei r2,r1,0 8001360: a0 62 10 00 and r2,r3,r2 8001364: 44 40 00 03 be r2,r0,8001370 <== NEVER TAKEN 8001368: f8 00 04 28 calli 8002408 800136c: 5c 20 ff f8 bne r1,r0,800134c pathname++; pathnamelen--; stripped++; } return stripped; } 8001370: b9 60 08 00 mv r1,r11 8001374: 2b 9d 00 04 lw ra,(sp+4) 8001378: 2b 8b 00 10 lw r11,(sp+16) 800137c: 2b 8c 00 0c lw r12,(sp+12) 8001380: 2b 8d 00 08 lw r13,(sp+8) 8001384: 37 9c 00 10 addi sp,sp,16 8001388: c3 a0 00 00 ret =============================================================================== 080084d4 : int rtems_filesystem_unregister( const char *type ) { 80084d4: 37 9c ff f0 addi sp,sp,-16 80084d8: 5b 8b 00 10 sw (sp+16),r11 80084dc: 5b 8c 00 0c sw (sp+12),r12 80084e0: 5b 8d 00 08 sw (sp+8),r13 80084e4: 5b 9d 00 04 sw (sp+4),ra 80084e8: b8 20 68 00 mv r13,r1 rtems_chain_node *node = NULL; if ( type == NULL ) { 80084ec: 5c 20 00 04 bne r1,r0,80084fc <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 80084f0: f8 00 0b c3 calli 800b3fc <__errno> 80084f4: 34 02 00 16 mvi r2,22 80084f8: e0 00 00 18 bi 8008558 } rtems_libio_lock(); 80084fc: fb ff ff 75 calli 80082d0 } } rtems_libio_unlock(); rtems_set_errno_and_return_minus_one( ENOENT ); } 8008500: 78 03 08 01 mvhi r3,0x801 8008504: 38 63 31 20 ori r3,r3,0x3120 if ( type == NULL ) { rtems_set_errno_and_return_minus_one( EINVAL ); } rtems_libio_lock(); for ( 8008508: 78 0c 08 01 mvhi r12,0x801 } } rtems_libio_unlock(); rtems_set_errno_and_return_minus_one( ENOENT ); } 800850c: 28 6b 00 00 lw r11,(r3+0) if ( type == NULL ) { rtems_set_errno_and_return_minus_one( EINVAL ); } rtems_libio_lock(); for ( 8008510: 39 8c 31 24 ori r12,r12,0x3124 8008514: e0 00 00 0d bi 8008548 !rtems_chain_is_tail( &filesystem_chain, node ); node = rtems_chain_next( node ) ) { filesystem_node *fsn = (filesystem_node *) node; if ( strcmp( fsn->entry.type, type ) == 0 ) { 8008518: 29 61 00 08 lw r1,(r11+8) 800851c: b9 a0 10 00 mv r2,r13 8008520: f8 00 0f ec calli 800c4d0 8008524: 5c 20 00 08 bne r1,r0,8008544 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 8008528: b9 60 08 00 mv r1,r11 800852c: fb ff ec 11 calli 8003570 <_Chain_Extract> rtems_chain_extract( node ); free( fsn ); 8008530: b9 60 08 00 mv r1,r11 8008534: fb ff e3 9e calli 80013ac rtems_libio_unlock(); 8008538: fb ff ff 71 calli 80082fc return 0; 800853c: 34 01 00 00 mvi r1,0 8008540: e0 00 00 08 bi 8008560 } } rtems_libio_unlock(); rtems_set_errno_and_return_minus_one( ENOENT ); } 8008544: 29 6b 00 00 lw r11,(r11+0) if ( type == NULL ) { rtems_set_errno_and_return_minus_one( EINVAL ); } rtems_libio_lock(); for ( 8008548: 5d 6c ff f4 bne r11,r12,8008518 rtems_libio_unlock(); return 0; } } rtems_libio_unlock(); 800854c: fb ff ff 6c calli 80082fc rtems_set_errno_and_return_minus_one( ENOENT ); 8008550: f8 00 0b ab calli 800b3fc <__errno> 8008554: 34 02 00 02 mvi r2,2 8008558: 58 22 00 00 sw (r1+0),r2 800855c: 34 01 ff ff mvi r1,-1 } 8008560: 2b 9d 00 04 lw ra,(sp+4) 8008564: 2b 8b 00 10 lw r11,(sp+16) 8008568: 2b 8c 00 0c lw r12,(sp+12) 800856c: 2b 8d 00 08 lw r13,(sp+8) 8008570: 37 9c 00 10 addi sp,sp,16 8008574: c3 a0 00 00 ret =============================================================================== 08001ddc : void *rtems_gxx_getspecific(__gthread_key_t key) { 8001ddc: 37 9c ff f4 addi sp,sp,-12 8001de0: 5b 8b 00 08 sw (sp+8),r11 8001de4: 5b 9d 00 04 sw (sp+4),ra 8001de8: b8 20 58 00 mv r11,r1 rtems_status_code status; void *p= 0; /* register with RTEMS the buffer that will hold the key values */ status = rtems_task_variable_get( RTEMS_SELF, (void **)key, &p ); 8001dec: b9 60 10 00 mv r2,r11 8001df0: 34 01 00 00 mvi r1,0 8001df4: 37 83 00 0c addi r3,sp,12 } void *rtems_gxx_getspecific(__gthread_key_t key) { rtems_status_code status; void *p= 0; 8001df8: 5b 80 00 0c sw (sp+12),r0 /* register with RTEMS the buffer that will hold the key values */ status = rtems_task_variable_get( RTEMS_SELF, (void **)key, &p ); 8001dfc: f8 00 07 80 calli 8003bfc if ( status == RTEMS_SUCCESSFUL ) { 8001e00: 5c 20 00 04 bne r1,r0,8001e10 <== NEVER TAKEN /* We do not have to do this, but what the heck ! */ p= key->val; 8001e04: 29 61 00 00 lw r1,(r11+0) 8001e08: 5b 81 00 0c sw (sp+12),r1 8001e0c: e0 00 00 0a bi 8001e34 } else { /* fisrt time, always set to zero, it is unknown the value that the others * threads are using at the moment of this call */ status = rtems_task_variable_add( RTEMS_SELF, (void **)key, key->dtor ); 8001e10: 29 63 00 04 lw r3,(r11+4) <== NOT EXECUTED 8001e14: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8001e18: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8001e1c: f8 00 07 26 calli 8003ab4 <== NOT EXECUTED if ( status != RTEMS_SUCCESSFUL ) { 8001e20: 44 20 00 04 be r1,r0,8001e30 <== NOT EXECUTED rtems_panic ("rtems_gxx_getspecific"); 8001e24: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8001e28: 38 21 b0 a4 ori r1,r1,0xb0a4 <== NOT EXECUTED 8001e2c: f8 00 1b 4e calli 8008b64 <== NOT EXECUTED } key->val = (void *)0; 8001e30: 59 60 00 00 sw (r11+0),r0 <== NOT EXECUTED p, rtems_task_self() ); #endif return p; } 8001e34: 2b 81 00 0c lw r1,(sp+12) 8001e38: 2b 9d 00 04 lw ra,(sp+4) 8001e3c: 2b 8b 00 08 lw r11,(sp+8) 8001e40: 37 9c 00 0c addi sp,sp,12 8001e44: c3 a0 00 00 ret =============================================================================== 08001d9c : int rtems_gxx_key_delete (__gthread_key_t key) { 8001d9c: 37 9c ff f8 addi sp,sp,-8 8001da0: 5b 8b 00 08 sw (sp+8),r11 8001da4: 5b 9d 00 04 sw (sp+4),ra 8001da8: b8 20 58 00 mv r11,r1 #ifdef DEBUG_GXX_WRAPPERS printk( "gxx_wrappers: delete key=%x\n", key ); #endif /* register with RTEMS the buffer that will hold the key values */ status = rtems_task_variable_delete( RTEMS_SELF, (void **)key ); 8001dac: b9 60 10 00 mv r2,r11 8001db0: 34 01 00 00 mvi r1,0 8001db4: f8 00 07 6f calli 8003b70 if ( status == RTEMS_SUCCESSFUL ) { 8001db8: 5c 20 00 04 bne r1,r0,8001dc8 <== NEVER TAKEN /* Hmm - hopefully all tasks using this key have gone away... */ if ( key ) free( (void *)key ); 8001dbc: 45 61 00 03 be r11,r1,8001dc8 <== NEVER TAKEN 8001dc0: b9 60 08 00 mv r1,r11 8001dc4: fb ff ff 63 calli 8001b50 return 0; } return 0; } 8001dc8: 34 01 00 00 mvi r1,0 8001dcc: 2b 9d 00 04 lw ra,(sp+4) 8001dd0: 2b 8b 00 08 lw r11,(sp+8) 8001dd4: 37 9c 00 08 addi sp,sp,8 8001dd8: c3 a0 00 00 ret =============================================================================== 08001d90 : { #ifdef DEBUG_GXX_WRAPPERS printk( "gxx_wrappers: dtor key=%x, ptr=%x\n", key, ptr ); #endif key->val = 0; 8001d90: 58 20 00 00 sw (r1+0),r0 <== NOT EXECUTED return 0; } 8001d94: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8001d98: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08001f08 : int rtems_gxx_mutex_destroy (__gthread_mutex_t *mutex) { 8001f08: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 8001f0c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED #ifdef DEBUG_GXX_WRAPPERS printk( "gxx_wrappers: destroy mutex=%X\n", *mutex ); #endif status = rtems_semaphore_delete(*(rtems_id *)mutex); 8001f10: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED 8001f14: f8 00 05 71 calli 80034d8 <== NOT EXECUTED if ( status == RTEMS_SUCCESSFUL ) return 0; 8001f18: 7c 21 00 00 cmpnei r1,r1,0 <== NOT EXECUTED return -1; } 8001f1c: c8 01 08 00 sub r1,r0,r1 <== NOT EXECUTED 8001f20: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8001f24: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 8001f28: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08001e98 : /* * MUTEX support */ void rtems_gxx_mutex_init (__gthread_mutex_t *mutex) { 8001e98: 37 9c ff fc addi sp,sp,-4 8001e9c: 5b 9d 00 04 sw (sp+4),ra #ifdef DEBUG_GXX_WRAPPERS printk( "gxx_wrappers: mutex init =%X\n", *mutex ); #endif status = rtems_semaphore_create( 8001ea0: 78 02 08 01 mvhi r2,0x801 8001ea4: 38 42 b0 d4 ori r2,r2,0xb0d4 /* * MUTEX support */ void rtems_gxx_mutex_init (__gthread_mutex_t *mutex) { 8001ea8: b8 20 28 00 mv r5,r1 #ifdef DEBUG_GXX_WRAPPERS printk( "gxx_wrappers: mutex init =%X\n", *mutex ); #endif status = rtems_semaphore_create( 8001eac: 28 41 00 00 lw r1,(r2+0) 8001eb0: 34 03 00 54 mvi r3,84 8001eb4: 34 02 00 01 mvi r2,1 8001eb8: 34 04 00 00 mvi r4,0 8001ebc: f8 00 05 0a calli 80032e4 RTEMS_PRIORITY|RTEMS_BINARY_SEMAPHORE| RTEMS_INHERIT_PRIORITY|RTEMS_NO_PRIORITY_CEILING|RTEMS_LOCAL, 0, (rtems_id *)mutex ); if ( status != RTEMS_SUCCESSFUL ) { 8001ec0: 44 20 00 04 be r1,r0,8001ed0 <== ALWAYS TAKEN "gxx_wrappers: mutex init failed %s (%d)\n", rtems_status_text(status), status ); #endif rtems_panic ("rtems_gxx_mutex_init"); 8001ec4: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8001ec8: 38 21 b0 bc ori r1,r1,0xb0bc <== NOT EXECUTED 8001ecc: f8 00 1b 26 calli 8008b64 <== NOT EXECUTED } #ifdef DEBUG_GXX_WRAPPERS printk( "gxx_wrappers: mutex init complete =%X\n", *mutex ); #endif } 8001ed0: 2b 9d 00 04 lw ra,(sp+4) 8001ed4: 37 9c 00 04 addi sp,sp,4 8001ed8: c3 a0 00 00 ret =============================================================================== 08001cb8 : typedef int __gthread_once_t; typedef void *__gthread_mutex_t; typedef void *__gthread_recursive_mutex_t; int rtems_gxx_once(__gthread_once_t *once, void (*func) (void)) { 8001cb8: 37 9c ff e8 addi sp,sp,-24 8001cbc: 5b 8b 00 14 sw (sp+20),r11 8001cc0: 5b 8c 00 10 sw (sp+16),r12 8001cc4: 5b 8d 00 0c sw (sp+12),r13 8001cc8: 5b 8e 00 08 sw (sp+8),r14 8001ccc: 5b 9d 00 04 sw (sp+4),ra #ifdef DEBUG_GXX_WRAPPERS printk( "gxx_wrappers: once=%x, func=%x\n", *once, func ); #endif if ( *(volatile __gthread_once_t *)once == 0 ) { 8001cd0: 28 2d 00 00 lw r13,(r1+0) typedef int __gthread_once_t; typedef void *__gthread_mutex_t; typedef void *__gthread_recursive_mutex_t; int rtems_gxx_once(__gthread_once_t *once, void (*func) (void)) { 8001cd4: b8 20 58 00 mv r11,r1 8001cd8: b8 40 70 00 mv r14,r2 #ifdef DEBUG_GXX_WRAPPERS printk( "gxx_wrappers: once=%x, func=%x\n", *once, func ); #endif if ( *(volatile __gthread_once_t *)once == 0 ) { 8001cdc: 5d a0 00 0f bne r13,r0,8001d18 rtems_mode saveMode; __gthread_once_t o; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 8001ce0: 34 01 01 00 mvi r1,256 8001ce4: 34 02 01 00 mvi r2,256 8001ce8: 37 83 00 18 addi r3,sp,24 8001cec: f8 00 06 e5 calli 8003880 if ( (o = *(volatile __gthread_once_t *)once) == 0 ) { 8001cf0: 29 6c 00 00 lw r12,(r11+0) 8001cf4: 5d 8d 00 03 bne r12,r13,8001d00 <== NEVER TAKEN *(volatile __gthread_once_t *)once = 1; 8001cf8: 34 01 00 01 mvi r1,1 8001cfc: 59 61 00 00 sw (r11+0),r1 } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 8001d00: 2b 81 00 18 lw r1,(sp+24) 8001d04: 34 02 01 00 mvi r2,256 8001d08: 37 83 00 18 addi r3,sp,24 8001d0c: f8 00 06 dd calli 8003880 if ( o == 0 ) 8001d10: 5d 80 00 02 bne r12,r0,8001d18 <== NEVER TAKEN (*func)(); 8001d14: d9 c0 00 00 call r14 } return 0; } 8001d18: 34 01 00 00 mvi r1,0 8001d1c: 2b 9d 00 04 lw ra,(sp+4) 8001d20: 2b 8b 00 14 lw r11,(sp+20) 8001d24: 2b 8c 00 10 lw r12,(sp+16) 8001d28: 2b 8d 00 0c lw r13,(sp+12) 8001d2c: 2b 8e 00 08 lw r14,(sp+8) 8001d30: 37 9c 00 18 addi sp,sp,24 8001d34: c3 a0 00 00 ret =============================================================================== 08001e48 : int rtems_gxx_setspecific(__gthread_key_t key, const void *ptr) { 8001e48: 37 9c ff f4 addi sp,sp,-12 8001e4c: 5b 8b 00 0c sw (sp+12),r11 8001e50: 5b 8c 00 08 sw (sp+8),r12 8001e54: 5b 9d 00 04 sw (sp+4),ra 8001e58: b8 20 58 00 mv r11,r1 rtems_task_self() ); #endif /* register with RTEMS the buffer that will hold the key values */ status = rtems_task_variable_add( RTEMS_SELF, (void **)key, key->dtor ); 8001e5c: 29 63 00 04 lw r3,(r11+4) #endif return p; } int rtems_gxx_setspecific(__gthread_key_t key, const void *ptr) { 8001e60: b8 40 60 00 mv r12,r2 rtems_task_self() ); #endif /* register with RTEMS the buffer that will hold the key values */ status = rtems_task_variable_add( RTEMS_SELF, (void **)key, key->dtor ); 8001e64: 34 01 00 00 mvi r1,0 8001e68: b9 60 10 00 mv r2,r11 8001e6c: f8 00 07 12 calli 8003ab4 if ( status == RTEMS_SUCCESSFUL ) { /* now let's set the proper value */ key->val = (void *)ptr; return 0; } return -1; 8001e70: 34 03 ff ff mvi r3,-1 ); #endif /* register with RTEMS the buffer that will hold the key values */ status = rtems_task_variable_add( RTEMS_SELF, (void **)key, key->dtor ); if ( status == RTEMS_SUCCESSFUL ) { 8001e74: 5c 20 00 03 bne r1,r0,8001e80 <== NEVER TAKEN /* now let's set the proper value */ key->val = (void *)ptr; 8001e78: 59 6c 00 00 sw (r11+0),r12 return 0; 8001e7c: 34 03 00 00 mvi r3,0 } return -1; } 8001e80: b8 60 08 00 mv r1,r3 8001e84: 2b 9d 00 04 lw ra,(sp+4) 8001e88: 2b 8b 00 0c lw r11,(sp+12) 8001e8c: 2b 8c 00 08 lw r12,(sp+8) 8001e90: 37 9c 00 0c addi sp,sp,12 8001e94: c3 a0 00 00 ret =============================================================================== 08006d20 : void *rtems_heap_allocate_aligned_with_boundary( size_t size, uintptr_t alignment, uintptr_t boundary ) { 8006d20: 37 9c ff f0 addi sp,sp,-16 8006d24: 5b 8b 00 10 sw (sp+16),r11 8006d28: 5b 8c 00 0c sw (sp+12),r12 8006d2c: 5b 8d 00 08 sw (sp+8),r13 8006d30: 5b 9d 00 04 sw (sp+4),ra if ( 8006d34: 78 05 08 02 mvhi r5,0x802 8006d38: 38 a5 42 bc ori r5,r5,0x42bc void *rtems_heap_allocate_aligned_with_boundary( size_t size, uintptr_t alignment, uintptr_t boundary ) { 8006d3c: b8 40 60 00 mv r12,r2 if ( 8006d40: 28 a2 00 00 lw r2,(r5+0) void *rtems_heap_allocate_aligned_with_boundary( size_t size, uintptr_t alignment, uintptr_t boundary ) { 8006d44: b8 20 68 00 mv r13,r1 if ( 8006d48: 34 01 00 03 mvi r1,3 void *rtems_heap_allocate_aligned_with_boundary( size_t size, uintptr_t alignment, uintptr_t boundary ) { 8006d4c: b8 60 58 00 mv r11,r3 if ( 8006d50: 5c 41 00 04 bne r2,r1,8006d60 <== NEVER TAKEN _System_state_Is_up( _System_state_Get() ) && !malloc_is_system_state_OK() 8006d54: fb ff fb 15 calli 80059a8 ) { return NULL; 8006d58: 34 05 00 00 mvi r5,0 uintptr_t boundary ) { if ( _System_state_Is_up( _System_state_Get() ) && !malloc_is_system_state_OK() 8006d5c: 44 20 00 0a be r1,r0,8006d84 ) { return NULL; } malloc_deferred_frees_process(); 8006d60: fb ff fb 24 calli 80059f0 /* FIXME: Statistics, boundary checks */ return _Protected_heap_Allocate_aligned_with_boundary( 8006d64: 78 05 08 02 mvhi r5,0x802 8006d68: 38 a5 30 1c ori r5,r5,0x301c 8006d6c: 28 a1 00 00 lw r1,(r5+0) 8006d70: b9 a0 10 00 mv r2,r13 8006d74: b9 80 18 00 mv r3,r12 8006d78: b9 60 20 00 mv r4,r11 8006d7c: f8 00 0d eb calli 800a528 <_Protected_heap_Allocate_aligned_with_boundary> 8006d80: b8 20 28 00 mv r5,r1 RTEMS_Malloc_Heap, size, alignment, boundary ); } 8006d84: b8 a0 08 00 mv r1,r5 8006d88: 2b 9d 00 04 lw ra,(sp+4) 8006d8c: 2b 8b 00 10 lw r11,(sp+16) 8006d90: 2b 8c 00 0c lw r12,(sp+12) 8006d94: 2b 8d 00 08 lw r13,(sp+8) 8006d98: 37 9c 00 10 addi sp,sp,16 8006d9c: c3 a0 00 00 ret =============================================================================== 0800b00c : rtems_status_code rtems_io_control( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 800b00c: 37 9c ff ec addi sp,sp,-20 800b010: 5b 8b 00 10 sw (sp+16),r11 800b014: 5b 8c 00 0c sw (sp+12),r12 800b018: 5b 8d 00 08 sw (sp+8),r13 800b01c: 5b 9d 00 04 sw (sp+4),ra rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 800b020: 78 04 08 01 mvhi r4,0x801 800b024: 38 84 3a 4c ori r4,r4,0x3a4c rtems_status_code rtems_io_control( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 800b028: b8 40 60 00 mv r12,r2 rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 800b02c: 28 82 00 00 lw r2,(r4+0) rtems_status_code rtems_io_control( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 800b030: b8 20 58 00 mv r11,r1 rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) return RTEMS_INVALID_NUMBER; 800b034: 34 04 00 0a mvi r4,10 void *argument ) { rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 800b038: 50 22 00 13 bgeu r1,r2,800b084 <== NEVER TAKEN return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].control_entry; 800b03c: 78 04 08 01 mvhi r4,0x801 800b040: 38 84 3a 50 ori r4,r4,0x3a50 800b044: 34 02 00 01 mvi r2,1 800b048: 28 8d 00 00 lw r13,(r4+0) 800b04c: 5b 83 00 14 sw (sp+20),r3 800b050: f8 00 16 03 calli 801085c <__ashlsi3> 800b054: b4 2b 08 00 add r1,r1,r11 800b058: 34 02 00 03 mvi r2,3 800b05c: f8 00 16 00 calli 801085c <__ashlsi3> 800b060: b5 a1 08 00 add r1,r13,r1 800b064: 28 25 00 14 lw r5,(r1+20) return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 800b068: 34 04 00 00 mvi r4,0 800b06c: 2b 83 00 14 lw r3,(sp+20) 800b070: 44 a0 00 05 be r5,r0,800b084 800b074: b9 60 08 00 mv r1,r11 800b078: b9 80 10 00 mv r2,r12 800b07c: d8 a0 00 00 call r5 800b080: b8 20 20 00 mv r4,r1 } 800b084: b8 80 08 00 mv r1,r4 800b088: 2b 9d 00 04 lw ra,(sp+4) 800b08c: 2b 8b 00 10 lw r11,(sp+16) 800b090: 2b 8c 00 0c lw r12,(sp+12) 800b094: 2b 8d 00 08 lw r13,(sp+8) 800b098: 37 9c 00 14 addi sp,sp,20 800b09c: c3 a0 00 00 ret =============================================================================== 08006068 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 8006068: 37 9c ff e4 addi sp,sp,-28 800606c: 5b 8b 00 1c sw (sp+28),r11 8006070: 5b 8c 00 18 sw (sp+24),r12 8006074: 5b 8d 00 14 sw (sp+20),r13 8006078: 5b 8e 00 10 sw (sp+16),r14 800607c: 5b 8f 00 0c sw (sp+12),r15 8006080: 5b 90 00 08 sw (sp+8),r16 8006084: 5b 9d 00 04 sw (sp+4),ra 8006088: b8 20 78 00 mv r15,r1 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 800608c: 44 20 00 18 be r1,r0,80060ec <== NEVER TAKEN #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 8006090: 78 02 08 02 mvhi r2,0x802 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 8006094: 78 0b 08 02 mvhi r11,0x802 #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 8006098: 38 42 75 c0 ori r2,r2,0x75c0 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 800609c: 39 6b 75 c4 ori r11,r11,0x75c4 #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 80060a0: 34 50 00 10 addi r16,r2,16 if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) 80060a4: 29 61 00 00 lw r1,(r11+0) 80060a8: 44 20 00 0f be r1,r0,80060e4 continue; information = _Objects_Information_table[ api_index ][ 1 ]; 80060ac: 28 2c 00 04 lw r12,(r1+4) if ( !information ) 80060b0: 34 0e 00 04 mvi r14,4 80060b4: 34 0d 00 01 mvi r13,1 80060b8: 5d 80 00 09 bne r12,r0,80060dc 80060bc: e0 00 00 0a bi 80060e4 continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 80060c0: 29 81 00 1c lw r1,(r12+28) 80060c4: b4 2e 08 00 add r1,r1,r14 80060c8: 28 21 00 00 lw r1,(r1+0) if ( !the_thread ) 80060cc: 44 20 00 02 be r1,r0,80060d4 continue; (*routine)(the_thread); 80060d0: d9 e0 00 00 call r15 information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 80060d4: 35 ad 00 01 addi r13,r13,1 80060d8: 35 ce 00 04 addi r14,r14,4 80060dc: 2d 81 00 10 lhu r1,(r12+16) 80060e0: 50 2d ff f8 bgeu r1,r13,80060c0 80060e4: 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++ ) { 80060e8: 5d 70 ff ef bne r11,r16,80060a4 (*routine)(the_thread); } } } 80060ec: 2b 9d 00 04 lw ra,(sp+4) 80060f0: 2b 8b 00 1c lw r11,(sp+28) 80060f4: 2b 8c 00 18 lw r12,(sp+24) 80060f8: 2b 8d 00 14 lw r13,(sp+20) 80060fc: 2b 8e 00 10 lw r14,(sp+16) 8006100: 2b 8f 00 0c lw r15,(sp+12) 8006104: 2b 90 00 08 lw r16,(sp+8) 8006108: 37 9c 00 1c addi sp,sp,28 800610c: c3 a0 00 00 ret =============================================================================== 08008138 : */ void rtems_libio_free( rtems_libio_t *iop ) { 8008138: 37 9c ff f8 addi sp,sp,-8 800813c: 5b 8b 00 08 sw (sp+8),r11 8008140: 5b 9d 00 04 sw (sp+4),ra 8008144: b8 20 58 00 mv r11,r1 rtems_libio_lock(); 8008148: fb ff ff 90 calli 8007f88 if (iop->sem) 800814c: 29 61 00 30 lw r1,(r11+48) 8008150: 44 20 00 02 be r1,r0,8008158 <== NEVER TAKEN rtems_semaphore_delete(iop->sem); 8008154: f8 00 01 9f calli 80087d0 iop->flags &= ~LIBIO_FLAGS_OPEN; 8008158: 29 62 00 18 lw r2,(r11+24) 800815c: 34 01 fe ff mvi r1,-257 8008160: a0 41 08 00 and r1,r2,r1 8008164: 59 61 00 18 sw (r11+24),r1 iop->data1 = rtems_libio_iop_freelist; 8008168: 78 01 08 01 mvhi r1,0x801 800816c: 38 21 36 a4 ori r1,r1,0x36a4 8008170: 28 22 00 00 lw r2,(r1+0) rtems_libio_iop_freelist = iop; 8008174: 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; 8008178: 59 62 00 38 sw (r11+56),r2 rtems_libio_iop_freelist = iop; rtems_libio_unlock(); 800817c: fb ff ff 8e calli 8007fb4 } 8008180: 2b 9d 00 04 lw ra,(sp+4) 8008184: 2b 8b 00 08 lw r11,(sp+8) 8008188: 37 9c 00 08 addi sp,sp,8 800818c: c3 a0 00 00 ret =============================================================================== 08001514 : * * Called by BSP startup code to initialize the libio subsystem. */ void rtems_libio_init( void ) { 8001514: 37 9c ff f4 addi sp,sp,-12 8001518: 5b 8b 00 0c sw (sp+12),r11 800151c: 5b 8c 00 08 sw (sp+8),r12 8001520: 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) 8001524: 78 01 08 01 mvhi r1,0x801 8001528: 38 21 30 10 ori r1,r1,0x3010 800152c: 28 2c 00 00 lw r12,(r1+0) 8001530: 45 80 00 19 be r12,r0,8001594 <== NEVER TAKEN { rtems_libio_iops = (rtems_libio_t *) calloc(rtems_libio_number_iops, 8001534: b9 80 08 00 mv r1,r12 8001538: 34 02 00 40 mvi r2,64 800153c: fb ff fe f7 calli 8001118 8001540: b8 20 58 00 mv r11,r1 8001544: 78 01 08 01 mvhi r1,0x801 8001548: 38 21 36 a0 ori r1,r1,0x36a0 800154c: 58 2b 00 00 sw (r1+0),r11 sizeof(rtems_libio_t)); if (rtems_libio_iops == NULL) rtems_fatal_error_occurred(RTEMS_NO_MEMORY); 8001550: 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) 8001554: 45 60 00 1b be r11,r0,80015c0 rtems_fatal_error_occurred(RTEMS_NO_MEMORY); iop = rtems_libio_iop_freelist = rtems_libio_iops; 8001558: 78 01 08 01 mvhi r1,0x801 800155c: 38 21 36 a4 ori r1,r1,0x36a4 8001560: 58 2b 00 00 sw (r1+0),r11 for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++) 8001564: 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; 8001568: b9 60 08 00 mv r1,r11 for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++) 800156c: e0 00 00 02 bi 8001574 iop->data1 = iop + 1; 8001570: 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++) 8001574: 34 42 00 01 addi r2,r2,1 8001578: 34 21 00 40 addi r1,r1,64 800157c: 55 82 ff fd bgu r12,r2,8001570 iop->data1 = iop + 1; iop->data1 = NULL; 8001580: b9 80 08 00 mv r1,r12 8001584: 34 02 00 06 mvi r2,6 8001588: f8 00 3c b5 calli 801085c <__ashlsi3> 800158c: b5 61 08 00 add r1,r11,r1 8001590: 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( 8001594: 78 02 08 01 mvhi r2,0x801 8001598: 38 42 1b d4 ori r2,r2,0x1bd4 800159c: 28 41 00 00 lw r1,(r2+0) 80015a0: 78 05 08 01 mvhi r5,0x801 80015a4: 34 03 00 54 mvi r3,84 80015a8: 34 02 00 01 mvi r2,1 80015ac: 34 04 00 00 mvi r4,0 80015b0: 38 a5 36 a8 ori r5,r5,0x36a8 80015b4: f8 00 04 9a calli 800281c 80015b8: 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 ) 80015bc: 44 20 00 02 be r1,r0,80015c4 <== ALWAYS TAKEN rtems_fatal_error_occurred( rc ); 80015c0: f8 00 06 db calli 800312c /* * Initialize the base file system infrastructure. */ if (rtems_fs_init_helper) 80015c4: 78 02 08 01 mvhi r2,0x801 80015c8: 38 42 30 0c ori r2,r2,0x300c 80015cc: 28 41 00 00 lw r1,(r2+0) 80015d0: 44 23 00 02 be r1,r3,80015d8 <== NEVER TAKEN (* rtems_fs_init_helper)(); 80015d4: d8 20 00 00 call r1 } 80015d8: 2b 9d 00 04 lw ra,(sp+4) 80015dc: 2b 8b 00 0c lw r11,(sp+12) 80015e0: 2b 8c 00 08 lw r12,(sp+8) 80015e4: 37 9c 00 0c addi sp,sp,12 80015e8: c3 a0 00 00 ret =============================================================================== 08002968 : rtems_status_code rtems_libio_set_private_env(void) { 8002968: 37 9c ff d4 addi sp,sp,-44 800296c: 5b 8b 00 14 sw (sp+20),r11 8002970: 5b 8c 00 10 sw (sp+16),r12 8002974: 5b 8d 00 0c sw (sp+12),r13 8002978: 5b 8e 00 08 sw (sp+8),r14 800297c: 5b 9d 00 04 sw (sp+4),ra rtems_status_code sc; rtems_id task_id; rtems_filesystem_location_info_t loc; sc=rtems_task_ident(RTEMS_SELF,0,&task_id); 8002980: 34 01 00 00 mvi r1,0 8002984: 34 02 00 00 mvi r2,0 8002988: 37 83 00 2c addi r3,sp,44 800298c: f8 00 02 fa calli 8003574 8002990: b8 20 60 00 mv r12,r1 if (sc != RTEMS_SUCCESSFUL) return sc; 8002994: 5c 20 00 48 bne r1,r0,8002ab4 <== NEVER TAKEN /* Only for the first time a malloc is necesary */ if (rtems_current_user_env==&rtems_global_user_env) { 8002998: 78 0b 08 01 mvhi r11,0x801 800299c: 39 6b 31 04 ori r11,r11,0x3104 80029a0: 29 62 00 00 lw r2,(r11+0) 80029a4: 78 01 08 01 mvhi r1,0x801 80029a8: 38 21 36 d8 ori r1,r1,0x36d8 80029ac: 5c 41 00 11 bne r2,r1,80029f0 rtems_user_env_t *tmp = malloc(sizeof(rtems_user_env_t)); 80029b0: 34 01 00 48 mvi r1,72 80029b4: fb ff fc e9 calli 8001d58 80029b8: b8 20 68 00 mv r13,r1 if (!tmp) 80029bc: 44 20 00 3d be r1,r0,8002ab0 <== NEVER TAKEN #ifdef HAVE_USERENV_REFCNT tmp->refcnt = 1; #endif sc = rtems_task_variable_add( 80029c0: 78 03 08 00 mvhi r3,0x800 80029c4: 34 01 00 00 mvi r1,0 80029c8: b9 60 10 00 mv r2,r11 80029cc: 38 63 29 24 ori r3,r3,0x2924 80029d0: f8 00 03 55 calli 8003724 80029d4: b8 20 70 00 mv r14,r1 RTEMS_SELF, (void*)&rtems_current_user_env, (void(*)(void *))free_user_env ); if (sc != RTEMS_SUCCESSFUL) { 80029d8: 44 20 00 05 be r1,r0,80029ec <== ALWAYS TAKEN /* don't use free_user_env because the pathlocs are * not initialized yet */ free(tmp); 80029dc: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 80029e0: fb ff fb 26 calli 8001678 <== NOT EXECUTED return sc; 80029e4: b9 c0 60 00 mv r12,r14 <== NOT EXECUTED 80029e8: e0 00 00 33 bi 8002ab4 <== NOT EXECUTED } rtems_current_user_env = tmp; 80029ec: 59 6d 00 00 sw (r11+0),r13 } *rtems_current_user_env = rtems_global_user_env; /* get the global values*/ 80029f0: 78 0b 08 01 mvhi r11,0x801 80029f4: 39 6b 31 04 ori r11,r11,0x3104 80029f8: 29 6d 00 00 lw r13,(r11+0) 80029fc: 78 02 08 01 mvhi r2,0x801 8002a00: 38 42 36 d8 ori r2,r2,0x36d8 8002a04: b9 a0 08 00 mv r1,r13 8002a08: 34 03 00 48 mvi r3,72 8002a0c: f8 00 25 e7 calli 800c1a8 rtems_current_user_env->task_id=task_id; /* mark the local values*/ 8002a10: 2b 81 00 2c lw r1,(sp+44) * what we are trying to do here is forking off * clones. The reason is a pathloc can be allocated by the * file system and needs to be freed when deleting the environment. */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 8002a14: 37 8e 00 18 addi r14,sp,24 8002a18: 34 02 00 01 mvi r2,1 } rtems_current_user_env = tmp; } *rtems_current_user_env = rtems_global_user_env; /* get the global values*/ rtems_current_user_env->task_id=task_id; /* mark the local values*/ 8002a1c: 59 a1 00 00 sw (r13+0),r1 * what we are trying to do here is forking off * clones. The reason is a pathloc can be allocated by the * file system and needs to be freed when deleting the environment. */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 8002a20: 78 0d 08 01 mvhi r13,0x801 8002a24: 39 ad 1c 80 ori r13,r13,0x1c80 8002a28: 34 03 00 00 mvi r3,0 8002a2c: b9 c0 20 00 mv r4,r14 8002a30: 34 05 00 00 mvi r5,0 8002a34: b9 a0 08 00 mv r1,r13 8002a38: fb ff fa b6 calli 8001510 rtems_filesystem_root = loc; 8002a3c: 29 61 00 00 lw r1,(r11+0) 8002a40: 2b 82 00 18 lw r2,(sp+24) rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 8002a44: 34 03 00 00 mvi r3,0 8002a48: b9 c0 20 00 mv r4,r14 * clones. The reason is a pathloc can be allocated by the * file system and needs to be freed when deleting the environment. */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_root = loc; 8002a4c: 58 22 00 18 sw (r1+24),r2 8002a50: 2b 82 00 1c lw r2,(sp+28) rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 8002a54: 34 05 00 00 mvi r5,0 * clones. The reason is a pathloc can be allocated by the * file system and needs to be freed when deleting the environment. */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_root = loc; 8002a58: 58 22 00 1c sw (r1+28),r2 8002a5c: 2b 82 00 20 lw r2,(sp+32) 8002a60: 58 22 00 20 sw (r1+32),r2 8002a64: 2b 82 00 24 lw r2,(sp+36) 8002a68: 58 22 00 24 sw (r1+36),r2 8002a6c: 2b 82 00 28 lw r2,(sp+40) 8002a70: 58 22 00 28 sw (r1+40),r2 rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 8002a74: 34 02 00 01 mvi r2,1 8002a78: b9 a0 08 00 mv r1,r13 8002a7c: fb ff fa a5 calli 8001510 rtems_filesystem_current = loc; 8002a80: 29 62 00 00 lw r2,(r11+0) 8002a84: 2b 81 00 18 lw r1,(sp+24) 8002a88: 58 41 00 04 sw (r2+4),r1 8002a8c: 2b 81 00 1c lw r1,(sp+28) 8002a90: 58 41 00 08 sw (r2+8),r1 8002a94: 2b 81 00 20 lw r1,(sp+32) 8002a98: 58 41 00 0c sw (r2+12),r1 8002a9c: 2b 81 00 24 lw r1,(sp+36) 8002aa0: 58 41 00 10 sw (r2+16),r1 8002aa4: 2b 81 00 28 lw r1,(sp+40) 8002aa8: 58 41 00 14 sw (r2+20),r1 return RTEMS_SUCCESSFUL; 8002aac: e0 00 00 02 bi 8002ab4 /* Only for the first time a malloc is necesary */ if (rtems_current_user_env==&rtems_global_user_env) { rtems_user_env_t *tmp = malloc(sizeof(rtems_user_env_t)); if (!tmp) return RTEMS_NO_MEMORY; 8002ab0: 34 0c 00 1a mvi r12,26 <== NOT EXECUTED rtems_filesystem_root = loc; rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_current = loc; return RTEMS_SUCCESSFUL; } 8002ab4: b9 80 08 00 mv r1,r12 8002ab8: 2b 9d 00 04 lw ra,(sp+4) 8002abc: 2b 8b 00 14 lw r11,(sp+20) 8002ac0: 2b 8c 00 10 lw r12,(sp+16) 8002ac4: 2b 8d 00 0c lw r13,(sp+12) 8002ac8: 2b 8e 00 08 lw r14,(sp+8) 8002acc: 37 9c 00 2c addi sp,sp,44 8002ad0: c3 a0 00 00 ret =============================================================================== 08002ad4 : * while changing any of those (chdir(), chroot()). */ #ifndef HAVE_USERENV_REFCNT rtems_status_code rtems_libio_share_private_env(rtems_id task_id) { 8002ad4: 37 9c ff ec addi sp,sp,-20 <== NOT EXECUTED 8002ad8: 5b 8b 00 0c sw (sp+12),r11 <== NOT EXECUTED 8002adc: 5b 8c 00 08 sw (sp+8),r12 <== NOT EXECUTED 8002ae0: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED rtems_status_code sc; rtems_user_env_t * shared_user_env; rtems_id current_task_id; sc=rtems_task_ident(RTEMS_SELF,0,¤t_task_id); 8002ae4: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 8002ae8: 37 83 00 10 addi r3,sp,16 <== NOT EXECUTED * while changing any of those (chdir(), chroot()). */ #ifndef HAVE_USERENV_REFCNT rtems_status_code rtems_libio_share_private_env(rtems_id task_id) { 8002aec: b8 20 60 00 mv r12,r1 <== NOT EXECUTED rtems_status_code sc; rtems_user_env_t * shared_user_env; rtems_id current_task_id; sc=rtems_task_ident(RTEMS_SELF,0,¤t_task_id); 8002af0: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8002af4: f8 00 02 a0 calli 8003574 <== NOT EXECUTED 8002af8: b8 20 18 00 mv r3,r1 <== NOT EXECUTED if (sc != RTEMS_SUCCESSFUL) return sc; 8002afc: 5c 20 00 23 bne r1,r0,8002b88 <== NOT EXECUTED if (rtems_current_user_env->task_id==current_task_id) { 8002b00: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8002b04: 38 42 31 04 ori r2,r2,0x3104 <== NOT EXECUTED 8002b08: 28 4b 00 00 lw r11,(r2+0) <== NOT EXECUTED 8002b0c: 2b 83 00 10 lw r3,(sp+16) <== NOT EXECUTED 8002b10: 29 64 00 00 lw r4,(r11+0) <== NOT EXECUTED 8002b14: 5c 83 00 07 bne r4,r3,8002b30 <== NOT EXECUTED /* kill the current user env & task_var*/ rtems_user_env_t *tmp = rtems_current_user_env; sc = rtems_task_variable_delete(RTEMS_SELF,(void*)&rtems_current_user_env); 8002b18: f8 00 03 32 calli 80037e0 <== NOT EXECUTED 8002b1c: b8 20 18 00 mv r3,r1 <== NOT EXECUTED if (sc != RTEMS_SUCCESSFUL) return sc; 8002b20: 5c 20 00 1a bne r1,r0,8002b88 <== NOT EXECUTED free_user_env(tmp); 8002b24: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8002b28: fb ff ff 7f calli 8002924 <== NOT EXECUTED 8002b2c: e0 00 00 06 bi 8002b44 <== NOT EXECUTED } else { sc = rtems_task_variable_get( 8002b30: 37 83 00 14 addi r3,sp,20 <== NOT EXECUTED 8002b34: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8002b38: f8 00 03 4d calli 800386c <== NOT EXECUTED 8002b3c: b8 20 18 00 mv r3,r1 <== NOT EXECUTED task_id,(void*)&rtems_current_user_env, (void*)&shared_user_env ); if (sc != RTEMS_SUCCESSFUL) 8002b40: 5c 20 00 0d bne r1,r0,8002b74 <== NOT EXECUTED goto bailout; } /* AT THIS POINT, rtems_current_user_env is DANGLING */ sc = rtems_task_variable_add( 8002b44: 78 0b 08 01 mvhi r11,0x801 <== NOT EXECUTED 8002b48: 39 6b 31 04 ori r11,r11,0x3104 <== NOT EXECUTED 8002b4c: 78 03 08 00 mvhi r3,0x800 <== NOT EXECUTED 8002b50: 38 63 29 24 ori r3,r3,0x2924 <== NOT EXECUTED 8002b54: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8002b58: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8002b5c: f8 00 02 f2 calli 8003724 <== NOT EXECUTED 8002b60: b8 20 18 00 mv r3,r1 <== NOT EXECUTED RTEMS_SELF,(void*)&rtems_current_user_env,free_user_env); if (sc != RTEMS_SUCCESSFUL) 8002b64: 5c 20 00 04 bne r1,r0,8002b74 <== NOT EXECUTED goto bailout; /* the current_user_env is the same pointer that remote env */ rtems_current_user_env = shared_user_env; 8002b68: 2b 81 00 14 lw r1,(sp+20) <== NOT EXECUTED 8002b6c: 59 61 00 00 sw (r11+0),r1 <== NOT EXECUTED /* increase the reference count */ #ifdef HAVE_USERENV_REFCNT rtems_current_user_env->refcnt++; #endif return RTEMS_SUCCESSFUL; 8002b70: e0 00 00 06 bi 8002b88 <== NOT EXECUTED bailout: /* fallback to the global env */ rtems_current_user_env = &rtems_global_user_env; 8002b74: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8002b78: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8002b7c: 38 21 31 04 ori r1,r1,0x3104 <== NOT EXECUTED 8002b80: 38 42 36 d8 ori r2,r2,0x36d8 <== NOT EXECUTED 8002b84: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED return sc; } 8002b88: b8 60 08 00 mv r1,r3 <== NOT EXECUTED 8002b8c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8002b90: 2b 8b 00 0c lw r11,(sp+12) <== NOT EXECUTED 8002b94: 2b 8c 00 08 lw r12,(sp+8) <== NOT EXECUTED 8002b98: 37 9c 00 14 addi sp,sp,20 <== NOT EXECUTED 8002b9c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08008030 : uint32_t flags ) { uint32_t fcntl_flags = 0; if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) { 8008030: 20 24 00 06 andi r4,r1,0x6 8008034: 34 03 00 06 mvi r3,6 fcntl_flags |= O_RDWR; 8008038: 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 ) { 800803c: 44 83 00 06 be r4,r3,8008054 <== NEVER TAKEN fcntl_flags |= O_RDWR; } else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) { 8008040: 20 23 00 02 andi r3,r1,0x2 fcntl_flags |= O_RDONLY; 8008044: 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) { 8008048: 5c 60 00 03 bne r3,r0,8008054 <== ALWAYS TAKEN fcntl_flags |= O_RDONLY; } else if ( (flags & LIBIO_FLAGS_WRITE) == LIBIO_FLAGS_WRITE) { 800804c: 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; 8008050: 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 ) { 8008054: 20 23 00 01 andi r3,r1,0x1 8008058: 44 60 00 02 be r3,r0,8008060 fcntl_flags |= O_NONBLOCK; 800805c: 38 42 40 00 ori r2,r2,0x4000 } if ( (flags & LIBIO_FLAGS_APPEND) == LIBIO_FLAGS_APPEND ) { 8008060: 20 23 02 00 andi r3,r1,0x200 8008064: 44 60 00 02 be r3,r0,800806c fcntl_flags |= O_APPEND; 8008068: 38 42 00 08 ori r2,r2,0x8 } if ( (flags & LIBIO_FLAGS_CREATE) == LIBIO_FLAGS_CREATE ) { 800806c: 20 21 04 00 andi r1,r1,0x400 8008070: 44 20 00 02 be r1,r0,8008078 fcntl_flags |= O_CREAT; 8008074: 38 42 02 00 ori r2,r2,0x200 } return fcntl_flags; } 8008078: b8 40 08 00 mv r1,r2 800807c: c3 a0 00 00 ret =============================================================================== 08005e8c : * size and thus we skip updating the statistics. */ static void rtems_malloc_statistics_at_free( void *pointer ) { 8005e8c: 37 9c ff f8 addi sp,sp,-8 8005e90: 5b 9d 00 04 sw (sp+4),ra uintptr_t size; if (_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, pointer, &size) ) { 8005e94: 78 03 08 02 mvhi r3,0x802 8005e98: 38 63 30 1c ori r3,r3,0x301c * size and thus we skip updating the statistics. */ static void rtems_malloc_statistics_at_free( void *pointer ) { 8005e9c: b8 20 10 00 mv r2,r1 uintptr_t size; if (_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, pointer, &size) ) { 8005ea0: 28 61 00 00 lw r1,(r3+0) 8005ea4: 37 83 00 08 addi r3,sp,8 8005ea8: f8 00 11 e9 calli 800a64c <_Protected_heap_Get_block_size> 8005eac: 44 20 00 0b be r1,r0,8005ed8 <== NEVER TAKEN MSBUMP(lifetime_freed, size); 8005eb0: 78 01 08 02 mvhi r1,0x802 8005eb4: 38 21 3f d8 ori r1,r1,0x3fd8 8005eb8: 2b 83 00 08 lw r3,(sp+8) 8005ebc: 28 22 00 2c lw r2,(r1+44) 8005ec0: 28 24 00 28 lw r4,(r1+40) 8005ec4: b4 62 10 00 add r2,r3,r2 8005ec8: f4 62 18 00 cmpgu r3,r3,r2 8005ecc: 58 22 00 2c sw (r1+44),r2 8005ed0: b4 64 18 00 add r3,r3,r4 8005ed4: 58 23 00 28 sw (r1+40),r3 } } 8005ed8: 2b 9d 00 04 lw ra,(sp+4) 8005edc: 37 9c 00 08 addi sp,sp,8 8005ee0: c3 a0 00 00 ret =============================================================================== 08005ee4 : } static void rtems_malloc_statistics_at_malloc( void *pointer ) { 8005ee4: 37 9c ff f8 addi sp,sp,-8 8005ee8: 5b 9d 00 04 sw (sp+4),ra uintptr_t actual_size = 0; 8005eec: 5b 80 00 08 sw (sp+8),r0 } static void rtems_malloc_statistics_at_malloc( void *pointer ) { 8005ef0: b8 20 10 00 mv r2,r1 uintptr_t actual_size = 0; uint32_t current_depth; rtems_malloc_statistics_t *s = &rtems_malloc_statistics; if ( !pointer ) 8005ef4: 44 20 00 15 be r1,r0,8005f48 <== NEVER TAKEN return; _Protected_heap_Get_block_size(RTEMS_Malloc_Heap, pointer, &actual_size); 8005ef8: 78 03 08 02 mvhi r3,0x802 8005efc: 38 63 30 1c ori r3,r3,0x301c 8005f00: 28 61 00 00 lw r1,(r3+0) 8005f04: 37 83 00 08 addi r3,sp,8 8005f08: f8 00 11 d1 calli 800a64c <_Protected_heap_Get_block_size> MSBUMP(lifetime_allocated, actual_size); 8005f0c: 78 01 08 02 mvhi r1,0x802 8005f10: 38 21 3f d8 ori r1,r1,0x3fd8 8005f14: 2b 83 00 08 lw r3,(sp+8) 8005f18: 28 22 00 24 lw r2,(r1+36) 8005f1c: 28 24 00 20 lw r4,(r1+32) 8005f20: b4 62 10 00 add r2,r3,r2 8005f24: f4 62 18 00 cmpgu r3,r3,r2 8005f28: 58 22 00 24 sw (r1+36),r2 8005f2c: b4 64 18 00 add r3,r3,r4 8005f30: 58 23 00 20 sw (r1+32),r3 current_depth = (uint32_t) (s->lifetime_allocated - s->lifetime_freed); 8005f34: 28 23 00 2c lw r3,(r1+44) 8005f38: c8 43 10 00 sub r2,r2,r3 if (current_depth > s->max_depth) 8005f3c: 28 23 00 18 lw r3,(r1+24) 8005f40: 50 62 00 02 bgeu r3,r2,8005f48 s->max_depth = current_depth; 8005f44: 58 22 00 18 sw (r1+24),r2 } 8005f48: 2b 9d 00 04 lw ra,(sp+4) 8005f4c: 37 9c 00 08 addi sp,sp,8 8005f50: c3 a0 00 00 ret =============================================================================== 0800c974 : int rtems_memalign( void **pointer, size_t alignment, size_t size ) { 800c974: 37 9c ff ec addi sp,sp,-20 800c978: 5b 8b 00 14 sw (sp+20),r11 800c97c: 5b 8c 00 10 sw (sp+16),r12 800c980: 5b 8d 00 0c sw (sp+12),r13 800c984: 5b 8e 00 08 sw (sp+8),r14 800c988: 5b 9d 00 04 sw (sp+4),ra /* * Parameter error checks */ if ( !pointer ) return EINVAL; 800c98c: 34 0c 00 16 mvi r12,22 int rtems_memalign( void **pointer, size_t alignment, size_t size ) { 800c990: b8 20 58 00 mv r11,r1 800c994: b8 40 68 00 mv r13,r2 800c998: b8 60 70 00 mv r14,r3 void *return_this; /* * Parameter error checks */ if ( !pointer ) 800c99c: 44 20 00 1d be r1,r0,800ca10 return EINVAL; *pointer = NULL; 800c9a0: 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()) && 800c9a4: 78 01 08 01 mvhi r1,0x801 800c9a8: 38 21 8a 1c ori r1,r1,0x8a1c 800c9ac: 28 22 00 00 lw r2,(r1+0) 800c9b0: 34 01 00 03 mvi r1,3 800c9b4: 5c 41 00 03 bne r2,r1,800c9c0 <== NEVER TAKEN !malloc_is_system_state_OK() ) 800c9b8: fb ff d7 f5 calli 800298c *pointer = NULL; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 800c9bc: 44 20 00 15 be r1,r0,800ca10 <== NEVER TAKEN return EINVAL; /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); 800c9c0: fb ff d8 05 calli 80029d4 Heap_Control *heap, uintptr_t size, uintptr_t alignment ) { return 800c9c4: 78 01 08 01 mvhi r1,0x801 800c9c8: 38 21 80 1c ori r1,r1,0x801c 800c9cc: 28 21 00 00 lw r1,(r1+0) 800c9d0: b9 a0 18 00 mv r3,r13 800c9d4: b9 c0 10 00 mv r2,r14 800c9d8: 34 04 00 00 mvi r4,0 800c9dc: fb ff e5 49 calli 8005f00 <_Protected_heap_Allocate_aligned_with_boundary> 800c9e0: b8 20 68 00 mv r13,r1 RTEMS_Malloc_Heap, size, alignment ); if ( !return_this ) return ENOMEM; 800c9e4: 34 0c 00 0c mvi r12,12 return_this = _Protected_heap_Allocate_aligned( RTEMS_Malloc_Heap, size, alignment ); if ( !return_this ) 800c9e8: 44 20 00 0a be r1,r0,800ca10 return ENOMEM; /* * If configured, update the more involved statistics */ if ( rtems_malloc_statistics_helpers ) 800c9ec: 78 02 08 01 mvhi r2,0x801 800c9f0: 38 42 86 30 ori r2,r2,0x8630 800c9f4: 28 41 00 00 lw r1,(r2+0) 800c9f8: 44 20 00 04 be r1,r0,800ca08 (*rtems_malloc_statistics_helpers->at_malloc)(pointer); 800c9fc: 28 22 00 04 lw r2,(r1+4) 800ca00: b9 60 08 00 mv r1,r11 800ca04: d8 40 00 00 call r2 *pointer = return_this; 800ca08: 59 6d 00 00 sw (r11+0),r13 return 0; 800ca0c: 34 0c 00 00 mvi r12,0 } 800ca10: b9 80 08 00 mv r1,r12 800ca14: 2b 9d 00 04 lw ra,(sp+4) 800ca18: 2b 8b 00 14 lw r11,(sp+20) 800ca1c: 2b 8c 00 10 lw r12,(sp+16) 800ca20: 2b 8d 00 0c lw r13,(sp+12) 800ca24: 2b 8e 00 08 lw r14,(sp+8) 800ca28: 37 9c 00 14 addi sp,sp,20 800ca2c: c3 a0 00 00 ret =============================================================================== 0800a9fc : return (retval); } int rtems_mkdir(const char *path, mode_t mode) { 800a9fc: 37 9c ff 84 addi sp,sp,-124 800aa00: 5b 8b 00 34 sw (sp+52),r11 800aa04: 5b 8c 00 30 sw (sp+48),r12 800aa08: 5b 8d 00 2c sw (sp+44),r13 800aa0c: 5b 8e 00 28 sw (sp+40),r14 800aa10: 5b 8f 00 24 sw (sp+36),r15 800aa14: 5b 90 00 20 sw (sp+32),r16 800aa18: 5b 91 00 1c sw (sp+28),r17 800aa1c: 5b 92 00 18 sw (sp+24),r18 800aa20: 5b 93 00 14 sw (sp+20),r19 800aa24: 5b 94 00 10 sw (sp+16),r20 800aa28: 5b 95 00 0c sw (sp+12),r21 800aa2c: 5b 96 00 08 sw (sp+8),r22 800aa30: 5b 9d 00 04 sw (sp+4),ra 800aa34: b8 40 b0 00 mv r22,r2 int success = 0; char *dup_path = strdup(path); 800aa38: f8 00 0c d0 calli 800dd78 800aa3c: b8 20 60 00 mv r12,r1 if (dup_path != NULL) { success = build(dup_path, mode); free(dup_path); } return success != 0 ? 0 : -1; 800aa40: 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) { 800aa44: 45 80 00 4d be r12,r0,800ab78 <== NEVER TAKEN char *p; p = path; oumask = 0; retval = 1; if (p[0] == '/') /* Skip leading '/'. */ 800aa48: 41 8b 00 00 lbu r11,(r12+0) 800aa4c: 34 0e 00 00 mvi r14,0 800aa50: 34 01 00 01 mvi r1,1 ++p; 800aa54: 65 6b 00 2f cmpei r11,r11,47 retval = 0; break; } } if (!last) *p = '/'; 800aa58: 34 15 00 2f mvi r21,47 p = path; oumask = 0; retval = 1; if (p[0] == '/') /* Skip leading '/'. */ ++p; 800aa5c: 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) { 800aa60: 34 14 00 11 mvi r20,17 if (stat(path, &sb) < 0) { 800aa64: 37 93 00 38 addi r19,sp,56 retval = 0; break; } else if (!S_ISDIR(sb.st_mode)) { 800aa68: 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) { 800aa6c: 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); 800aa70: 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] != '/') 800aa74: 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') 800aa78: 41 64 00 00 lbu r4,(r11+0) last = 1; 800aa7c: 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') 800aa80: 44 80 00 03 be r4,r0,800aa8c last = 1; else if (p[0] != '/') 800aa84: 5c 8f 00 33 bne r4,r15,800ab50 800aa88: 34 03 00 00 mvi r3,0 continue; *p = '\0'; 800aa8c: 31 60 00 00 sb (r11+0),r0 if (!last && p[1] == '\0') 800aa90: 34 0d 00 01 mvi r13,1 800aa94: 5c 60 00 03 bne r3,r0,800aaa0 800aa98: 41 6d 00 01 lbu r13,(r11+1) 800aa9c: 65 ad 00 00 cmpei r13,r13,0 last = 1; if (first) { 800aaa0: 44 20 00 06 be r1,r0,800aab8 * mkdir [-m mode] dir * * We change the user's umask and then restore it, * instead of doing chmod's. */ oumask = umask(0); 800aaa4: 34 01 00 00 mvi r1,0 800aaa8: f8 00 00 79 calli 800ac8c 800aaac: b8 20 70 00 mv r14,r1 numask = oumask & ~(S_IWUSR | S_IXUSR); (void)umask(numask); 800aab0: a0 30 08 00 and r1,r1,r16 800aab4: f8 00 00 76 calli 800ac8c first = 0; } if (last) (void)umask(oumask); if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) { 800aab8: 34 03 01 ff mvi r3,511 oumask = umask(0); numask = oumask & ~(S_IWUSR | S_IXUSR); (void)umask(numask); first = 0; } if (last) 800aabc: 45 a0 00 04 be r13,r0,800aacc (void)umask(oumask); 800aac0: b9 c0 08 00 mv r1,r14 800aac4: f8 00 00 72 calli 800ac8c if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) { 800aac8: ba c0 18 00 mv r3,r22 800aacc: b9 80 08 00 mv r1,r12 800aad0: b8 60 10 00 mv r2,r3 800aad4: fb ff e1 81 calli 80030d8 800aad8: 4c 20 00 1b bge r1,r0,800ab44 if (errno == EEXIST || errno == EISDIR) { 800aadc: f8 00 08 1e calli 800cb54 <__errno> 800aae0: 28 21 00 00 lw r1,(r1+0) 800aae4: 44 34 00 04 be r1,r20,800aaf4 <== ALWAYS TAKEN 800aae8: f8 00 08 1b calli 800cb54 <__errno> <== NOT EXECUTED 800aaec: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED 800aaf0: 5c 31 00 1a bne r1,r17,800ab58 <== NOT EXECUTED if (stat(path, &sb) < 0) { 800aaf4: b9 80 08 00 mv r1,r12 800aaf8: ba 60 10 00 mv r2,r19 800aafc: f8 00 00 32 calli 800abc4 800ab00: 48 01 00 16 bg r0,r1,800ab58 <== NEVER TAKEN retval = 0; break; } else if (!S_ISDIR(sb.st_mode)) { 800ab04: 2b 81 00 44 lw r1,(sp+68) 800ab08: 20 21 f0 00 andi r1,r1,0xf000 800ab0c: 44 32 00 0c be r1,r18,800ab3c if (last) 800ab10: 45 a0 00 06 be r13,r0,800ab28 <== NEVER TAKEN errno = EEXIST; 800ab14: f8 00 08 10 calli 800cb54 <__errno> 800ab18: 34 02 00 11 mvi r2,17 800ab1c: 58 22 00 00 sw (r1+0),r2 else errno = ENOTDIR; retval = 0; 800ab20: 34 0b 00 00 mvi r11,0 800ab24: e0 00 00 11 bi 800ab68 break; } else if (!S_ISDIR(sb.st_mode)) { if (last) errno = EEXIST; else errno = ENOTDIR; 800ab28: f8 00 08 0b calli 800cb54 <__errno> <== NOT EXECUTED 800ab2c: 34 02 00 14 mvi r2,20 <== NOT EXECUTED 800ab30: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED retval = 0; 800ab34: 34 0b 00 00 mvi r11,0 <== NOT EXECUTED 800ab38: e0 00 00 0a bi 800ab60 <== NOT EXECUTED break; } if (last) 800ab3c: 5d a0 00 1e bne r13,r0,800abb4 800ab40: e0 00 00 02 bi 800ab48 } else { retval = 0; break; } } if (!last) 800ab44: 5d a0 00 1e bne r13,r0,800abbc *p = '/'; 800ab48: 31 75 00 00 sb (r11+0),r21 800ab4c: 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) { 800ab50: 35 6b 00 01 addi r11,r11,1 800ab54: e3 ff ff c9 bi 800aa78 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; 800ab58: 34 0b 00 00 mvi r11,0 <== NOT EXECUTED } } if (!last) *p = '/'; } if (!first && !last) 800ab5c: 5d a0 00 03 bne r13,r0,800ab68 <== NOT EXECUTED (void)umask(oumask); 800ab60: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 800ab64: f8 00 00 4a calli 800ac8c <== NOT EXECUTED int success = 0; char *dup_path = strdup(path); if (dup_path != NULL) { success = build(dup_path, mode); free(dup_path); 800ab68: b9 80 08 00 mv r1,r12 800ab6c: fb ff df 64 calli 80028fc } return success != 0 ? 0 : -1; 800ab70: 7d 61 00 00 cmpnei r1,r11,0 800ab74: 34 21 ff ff addi r1,r1,-1 } 800ab78: 2b 9d 00 04 lw ra,(sp+4) 800ab7c: 2b 8b 00 34 lw r11,(sp+52) 800ab80: 2b 8c 00 30 lw r12,(sp+48) 800ab84: 2b 8d 00 2c lw r13,(sp+44) 800ab88: 2b 8e 00 28 lw r14,(sp+40) 800ab8c: 2b 8f 00 24 lw r15,(sp+36) 800ab90: 2b 90 00 20 lw r16,(sp+32) 800ab94: 2b 91 00 1c lw r17,(sp+28) 800ab98: 2b 92 00 18 lw r18,(sp+24) 800ab9c: 2b 93 00 14 lw r19,(sp+20) 800aba0: 2b 94 00 10 lw r20,(sp+16) 800aba4: 2b 95 00 0c lw r21,(sp+12) 800aba8: 2b 96 00 08 lw r22,(sp+8) 800abac: 37 9c 00 7c addi sp,sp,124 800abb0: c3 a0 00 00 ret errno = ENOTDIR; retval = 0; break; } if (last) retval = 2; 800abb4: 34 0b 00 02 mvi r11,2 800abb8: e3 ff ff ec bi 800ab68 } else { retval = 0; break; } } if (!last) 800abbc: 34 0b 00 01 mvi r11,1 800abc0: e3 ff ff ea bi 800ab68 =============================================================================== 08011a64 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 8011a64: 37 9c ff d8 addi sp,sp,-40 8011a68: 5b 8b 00 28 sw (sp+40),r11 8011a6c: 5b 8c 00 24 sw (sp+36),r12 8011a70: 5b 8d 00 20 sw (sp+32),r13 8011a74: 5b 8e 00 1c sw (sp+28),r14 8011a78: 5b 8f 00 18 sw (sp+24),r15 8011a7c: 5b 90 00 14 sw (sp+20),r16 8011a80: 5b 91 00 10 sw (sp+16),r17 8011a84: 5b 92 00 0c sw (sp+12),r18 8011a88: 5b 93 00 08 sw (sp+8),r19 8011a8c: 5b 9d 00 04 sw (sp+4),ra register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; 8011a90: 34 07 00 03 mvi r7,3 uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 8011a94: b8 20 88 00 mv r17,r1 8011a98: b8 40 70 00 mv r14,r2 8011a9c: b8 60 78 00 mv r15,r3 8011aa0: b8 80 60 00 mv r12,r4 8011aa4: b8 a0 98 00 mv r19,r5 8011aa8: b8 c0 80 00 mv r16,r6 register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 8011aac: 44 20 00 36 be r1,r0,8011b84 return RTEMS_INVALID_NAME; if ( !starting_address ) return RTEMS_INVALID_ADDRESS; 8011ab0: 34 07 00 09 mvi r7,9 register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !starting_address ) 8011ab4: 44 40 00 34 be r2,r0,8011b84 return RTEMS_INVALID_ADDRESS; if ( !id ) 8011ab8: 44 c0 00 33 be r6,r0,8011b84 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 8011abc: 64 82 00 00 cmpei r2,r4,0 8011ac0: 64 61 00 00 cmpei r1,r3,0 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; 8011ac4: 34 07 00 08 mvi r7,8 return RTEMS_INVALID_ADDRESS; if ( !id ) return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 8011ac8: b8 41 08 00 or r1,r2,r1 8011acc: 5c 20 00 2e bne r1,r0,8011b84 8011ad0: 54 83 00 2d bgu r4,r3,8011b84 */ RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_size_aligned ( uint32_t buffer_size ) { return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0); 8011ad4: 20 81 00 07 andi r1,r4,0x7 8011ad8: 5c 20 00 2b bne r1,r0,8011b84 ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 8011adc: 21 d2 00 07 andi r18,r14,0x7 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) return RTEMS_INVALID_ADDRESS; 8011ae0: 34 07 00 09 mvi r7,9 if ( length == 0 || buffer_size == 0 || length < buffer_size || !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 8011ae4: 5e 41 00 28 bne r18,r1,8011b84 8011ae8: 78 02 08 03 mvhi r2,0x803 8011aec: 38 42 ec 2c ori r2,r2,0xec2c 8011af0: 28 41 00 00 lw r1,(r2+0) 8011af4: 34 21 00 01 addi r1,r1,1 8011af8: 58 41 00 00 sw (r2+0),r1 * This function allocates a partition control block from * the inactive chain of free partition control blocks. */ RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Allocate ( void ) { return (Partition_Control *) _Objects_Allocate( &_Partition_Information ); 8011afc: 78 0d 08 03 mvhi r13,0x803 8011b00: 39 ad ea 80 ori r13,r13,0xea80 8011b04: b9 a0 08 00 mv r1,r13 8011b08: f8 00 15 c7 calli 8017224 <_Objects_Allocate> 8011b0c: b8 20 58 00 mv r11,r1 _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 8011b10: 5c 32 00 04 bne r1,r18,8011b20 _Thread_Enable_dispatch(); 8011b14: f8 00 1a 3b calli 8018400 <_Thread_Enable_dispatch> return RTEMS_TOO_MANY; 8011b18: 34 07 00 05 mvi r7,5 8011b1c: e0 00 00 1a bi 8011b84 } #endif the_partition->starting_address = starting_address; the_partition->length = length; the_partition->buffer_size = buffer_size; 8011b20: 58 2c 00 18 sw (r1+24),r12 the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, length / buffer_size, buffer_size ); 8011b24: b9 80 10 00 mv r2,r12 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 8011b28: 58 2e 00 10 sw (r1+16),r14 the_partition->length = length; 8011b2c: 58 2f 00 14 sw (r1+20),r15 the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; 8011b30: 58 33 00 1c sw (r1+28),r19 the_partition->number_of_used_blocks = 0; 8011b34: 58 20 00 20 sw (r1+32),r0 _Chain_Initialize( &the_partition->Memory, starting_address, 8011b38: 34 32 00 24 addi r18,r1,36 length / buffer_size, buffer_size ); 8011b3c: b9 e0 08 00 mv r1,r15 8011b40: f8 00 78 72 calli 802fd08 <__udivsi3> 8011b44: b8 20 18 00 mv r3,r1 the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 8011b48: b9 80 20 00 mv r4,r12 8011b4c: ba 40 08 00 mv r1,r18 8011b50: b9 c0 10 00 mv r2,r14 8011b54: f8 00 0e ec calli 8015704 <_Chain_Initialize> Objects_Name name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 8011b58: 29 6c 00 08 lw r12,(r11+8) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8011b5c: 29 ad 00 1c lw r13,(r13+28) 8011b60: 34 02 00 02 mvi r2,2 8011b64: 21 81 ff ff andi r1,r12,0xffff 8011b68: fb ff f0 ee calli 800df20 <__ashlsi3> 8011b6c: b5 a1 08 00 add r1,r13,r1 8011b70: 58 2b 00 00 sw (r1+0),r11 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 8011b74: 59 71 00 0c sw (r11+12),r17 &_Partition_Information, &the_partition->Object, (Objects_Name) name ); *id = the_partition->Object.id; 8011b78: 5a 0c 00 00 sw (r16+0),r12 name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 8011b7c: f8 00 1a 21 calli 8018400 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8011b80: 34 07 00 00 mvi r7,0 } 8011b84: b8 e0 08 00 mv r1,r7 8011b88: 2b 9d 00 04 lw ra,(sp+4) 8011b8c: 2b 8b 00 28 lw r11,(sp+40) 8011b90: 2b 8c 00 24 lw r12,(sp+36) 8011b94: 2b 8d 00 20 lw r13,(sp+32) 8011b98: 2b 8e 00 1c lw r14,(sp+28) 8011b9c: 2b 8f 00 18 lw r15,(sp+24) 8011ba0: 2b 90 00 14 lw r16,(sp+20) 8011ba4: 2b 91 00 10 lw r17,(sp+16) 8011ba8: 2b 92 00 0c lw r18,(sp+12) 8011bac: 2b 93 00 08 lw r19,(sp+8) 8011bb0: 37 9c 00 28 addi sp,sp,40 8011bb4: c3 a0 00 00 ret =============================================================================== 08001094 : void rtems_print_buffer( const unsigned char *buffer, int length ) { 8001094: 37 9c ff ec addi sp,sp,-20 8001098: 5b 8b 00 14 sw (sp+20),r11 800109c: 5b 8c 00 10 sw (sp+16),r12 80010a0: 5b 8d 00 0c sw (sp+12),r13 80010a4: 5b 8e 00 08 sw (sp+8),r14 80010a8: 5b 9d 00 04 sw (sp+4),ra 80010ac: b8 20 70 00 mv r14,r1 int i, mod, max; if ( !length ) return; 80010b0: 44 40 00 16 be r2,r0,8001108 mod = length % 16; 80010b4: 78 01 08 01 mvhi r1,0x801 80010b8: 38 21 db 30 ori r1,r1,0xdb30 80010bc: 28 2b 00 00 lw r11,(r1+0) 80010c0: a0 4b 58 00 and r11,r2,r11 80010c4: 4d 60 00 05 bge r11,r0,80010d8 <== ALWAYS TAKEN 80010c8: 35 6b ff ff addi r11,r11,-1 <== NOT EXECUTED 80010cc: 34 01 ff f0 mvi r1,-16 <== NOT EXECUTED 80010d0: b9 61 58 00 or r11,r11,r1 <== NOT EXECUTED 80010d4: 35 6b 00 01 addi r11,r11,1 <== NOT EXECUTED max = length - mod; 80010d8: c8 4b 68 00 sub r13,r2,r11 for ( i=0 ; i Dump_Line( &buffer[ i ], 16 ); 80010e4: b5 cc 08 00 add r1,r14,r12 80010e8: 34 02 00 10 mvi r2,16 80010ec: fb ff ff 93 calli 8000f38 mod = length % 16; max = length - mod; for ( i=0 ; i Dump_Line( &buffer[ i ], 16 ); if ( mod ) 80010f8: 45 60 00 04 be r11,r0,8001108 Dump_Line( &buffer[ max ], mod ); 80010fc: b5 cd 08 00 add r1,r14,r13 8001100: b9 60 10 00 mv r2,r11 8001104: fb ff ff 8d calli 8000f38 } 8001108: 2b 9d 00 04 lw ra,(sp+4) 800110c: 2b 8b 00 14 lw r11,(sp+20) 8001110: 2b 8c 00 10 lw r12,(sp+16) 8001114: 2b 8d 00 0c lw r13,(sp+12) 8001118: 2b 8e 00 08 lw r14,(sp+8) 800111c: 37 9c 00 14 addi sp,sp,20 8001120: c3 a0 00 00 ret =============================================================================== 0800ad74 : rtems_status_code rtems_rate_monotonic_get_statistics( rtems_id id, rtems_rate_monotonic_period_statistics *statistics ) { 800ad74: 37 9c ff f4 addi sp,sp,-12 800ad78: 5b 8b 00 08 sw (sp+8),r11 800ad7c: 5b 9d 00 04 sw (sp+4),ra 800ad80: b8 20 18 00 mv r3,r1 800ad84: b8 40 58 00 mv r11,r2 Rate_monotonic_Control *the_period; rtems_rate_monotonic_period_statistics *dst; Rate_monotonic_Statistics *src; if ( !statistics ) return RTEMS_INVALID_ADDRESS; 800ad88: 34 01 00 09 mvi r1,9 Objects_Locations location; Rate_monotonic_Control *the_period; rtems_rate_monotonic_period_statistics *dst; Rate_monotonic_Statistics *src; if ( !statistics ) 800ad8c: 44 40 00 28 be r2,r0,800ae2c <== NEVER TAKEN 800ad90: 78 01 08 01 mvhi r1,0x801 800ad94: b8 60 10 00 mv r2,r3 800ad98: 38 21 f8 18 ori r1,r1,0xf818 800ad9c: 37 83 00 0c addi r3,sp,12 800ada0: fb ff ef 0b calli 80069cc <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 800ada4: 2b 82 00 0c lw r2,(sp+12) 800ada8: 5c 40 00 20 bne r2,r0,800ae28 case OBJECTS_LOCAL: dst = statistics; src = &the_period->Statistics; dst->count = src->count; 800adac: 28 22 00 54 lw r2,(r1+84) 800adb0: 59 62 00 00 sw (r11+0),r2 dst->missed_count = src->missed_count; 800adb4: 28 22 00 58 lw r2,(r1+88) 800adb8: 59 62 00 04 sw (r11+4),r2 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_To_timespec( &src->min_cpu_time, &dst->min_cpu_time ); 800adbc: 28 22 00 5c lw r2,(r1+92) 800adc0: 59 62 00 08 sw (r11+8),r2 800adc4: 28 22 00 60 lw r2,(r1+96) 800adc8: 59 62 00 0c sw (r11+12),r2 _Timestamp_To_timespec( &src->max_cpu_time, &dst->max_cpu_time ); 800adcc: 28 22 00 64 lw r2,(r1+100) 800add0: 59 62 00 10 sw (r11+16),r2 800add4: 28 22 00 68 lw r2,(r1+104) 800add8: 59 62 00 14 sw (r11+20),r2 _Timestamp_To_timespec( &src->total_cpu_time, &dst->total_cpu_time ); 800addc: 28 22 00 6c lw r2,(r1+108) 800ade0: 59 62 00 18 sw (r11+24),r2 800ade4: 28 22 00 70 lw r2,(r1+112) 800ade8: 59 62 00 1c sw (r11+28),r2 _Timestamp_To_timespec( &src->min_wall_time, &dst->min_wall_time ); 800adec: 28 22 00 74 lw r2,(r1+116) 800adf0: 59 62 00 20 sw (r11+32),r2 800adf4: 28 22 00 78 lw r2,(r1+120) 800adf8: 59 62 00 24 sw (r11+36),r2 _Timestamp_To_timespec( &src->max_wall_time, &dst->max_wall_time ); 800adfc: 28 22 00 7c lw r2,(r1+124) 800ae00: 59 62 00 28 sw (r11+40),r2 800ae04: 28 22 00 80 lw r2,(r1+128) 800ae08: 59 62 00 2c sw (r11+44),r2 _Timestamp_To_timespec( &src->total_wall_time, &dst->total_wall_time ); 800ae0c: 28 22 00 84 lw r2,(r1+132) 800ae10: 28 21 00 88 lw r1,(r1+136) 800ae14: 59 62 00 30 sw (r11+48),r2 800ae18: 59 61 00 34 sw (r11+52),r1 dst->min_wall_time = src->min_wall_time; dst->max_wall_time = src->max_wall_time; dst->total_wall_time = src->total_wall_time; #endif _Thread_Enable_dispatch(); 800ae1c: fb ff f1 5d calli 8007390 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 800ae20: 34 01 00 00 mvi r1,0 800ae24: e0 00 00 02 bi 800ae2c #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 800ae28: 34 01 00 04 mvi r1,4 } 800ae2c: 2b 9d 00 04 lw ra,(sp+4) 800ae30: 2b 8b 00 08 lw r11,(sp+8) 800ae34: 37 9c 00 0c addi sp,sp,12 800ae38: c3 a0 00 00 ret =============================================================================== 08004158 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 8004158: 37 9c ff e8 addi sp,sp,-24 800415c: 5b 8b 00 14 sw (sp+20),r11 8004160: 5b 8c 00 10 sw (sp+16),r12 8004164: 5b 8d 00 0c sw (sp+12),r13 8004168: 5b 8e 00 08 sw (sp+8),r14 800416c: 5b 9d 00 04 sw (sp+4),ra 8004170: b8 20 70 00 mv r14,r1 Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) _Objects_Get( &_Rate_monotonic_Information, id, location ); 8004174: 78 01 08 01 mvhi r1,0x801 8004178: b8 40 60 00 mv r12,r2 800417c: 38 21 f8 18 ori r1,r1,0xf818 8004180: b9 c0 10 00 mv r2,r14 8004184: 37 83 00 18 addi r3,sp,24 8004188: f8 00 0a 11 calli 80069cc <_Objects_Get> 800418c: b8 20 58 00 mv r11,r1 rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 8004190: 2b 81 00 18 lw r1,(sp+24) 8004194: 5c 20 00 5f bne r1,r0,8004310 RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 8004198: 78 03 08 01 mvhi r3,0x801 800419c: 38 63 fb 10 ori r3,r3,0xfb10 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 80041a0: 29 62 00 40 lw r2,(r11+64) 80041a4: 28 61 00 0c lw r1,(r3+12) 80041a8: 44 41 00 04 be r2,r1,80041b8 _Thread_Enable_dispatch(); 80041ac: f8 00 0c 79 calli 8007390 <_Thread_Enable_dispatch> return RTEMS_NOT_OWNER_OF_RESOURCE; 80041b0: 34 0b 00 17 mvi r11,23 80041b4: e0 00 00 58 bi 8004314 } if ( length == RTEMS_PERIOD_STATUS ) { 80041b8: 5d 80 00 0d bne r12,r0,80041ec switch ( the_period->state ) { 80041bc: 29 61 00 38 lw r1,(r11+56) 80041c0: 34 02 00 04 mvi r2,4 80041c4: 34 0b 00 00 mvi r11,0 80041c8: 54 22 00 07 bgu r1,r2,80041e4 <== NEVER TAKEN 80041cc: 78 0b 08 01 mvhi r11,0x801 80041d0: 34 02 00 02 mvi r2,2 80041d4: 39 6b cc c8 ori r11,r11,0xccc8 80041d8: fb ff f4 33 calli 80012a4 <__ashlsi3> 80041dc: b5 61 08 00 add r1,r11,r1 80041e0: 28 2b 00 00 lw r11,(r1+0) case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 80041e4: f8 00 0c 6b calli 8007390 <_Thread_Enable_dispatch> return( return_value ); 80041e8: e0 00 00 4b bi 8004314 } _ISR_Disable( level ); 80041ec: 90 00 68 00 rcsr r13,IE 80041f0: 34 01 ff fe mvi r1,-2 80041f4: a1 a1 08 00 and r1,r13,r1 80041f8: d0 01 00 00 wcsr IE,r1 switch ( the_period->state ) { 80041fc: 29 63 00 38 lw r3,(r11+56) 8004200: 34 01 00 02 mvi r1,2 8004204: 44 61 00 16 be r3,r1,800425c 8004208: 34 01 00 04 mvi r1,4 800420c: 44 61 00 33 be r3,r1,80042d8 8004210: 5c 60 00 40 bne r3,r0,8004310 <== NEVER TAKEN case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 8004214: d0 0d 00 00 wcsr IE,r13 /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 8004218: b9 60 08 00 mv r1,r11 800421c: fb ff ff 6a calli 8003fc4 <_Rate_monotonic_Initiate_statistics> the_period->state = RATE_MONOTONIC_ACTIVE; 8004220: 34 01 00 02 mvi r1,2 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 8004224: 78 03 08 00 mvhi r3,0x800 8004228: 59 61 00 38 sw (r11+56),r1 800422c: 38 63 46 98 ori r3,r3,0x4698 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8004230: 78 01 08 01 mvhi r1,0x801 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8004234: 59 60 00 18 sw (r11+24),r0 the_watchdog->routine = routine; 8004238: 59 63 00 2c sw (r11+44),r3 the_watchdog->id = id; 800423c: 59 6e 00 30 sw (r11+48),r14 the_watchdog->user_data = user_data; 8004240: 59 60 00 34 sw (r11+52),r0 _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; 8004244: 59 6c 00 3c sw (r11+60),r12 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8004248: 59 6c 00 1c sw (r11+28),r12 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800424c: 38 21 fa 08 ori r1,r1,0xfa08 8004250: 35 62 00 10 addi r2,r11,16 8004254: f8 00 12 2d calli 8008b08 <_Watchdog_Insert> 8004258: e0 00 00 1d bi 80042cc case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 800425c: b9 60 08 00 mv r1,r11 8004260: fb ff ff 7e calli 8004058 <_Rate_monotonic_Update_statistics> /* * This tells the _Rate_monotonic_Timeout that this task is * in the process of blocking on the period and that we * may be changing the length of the next period. */ the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; 8004264: 34 01 00 01 mvi r1,1 8004268: 59 61 00 38 sw (r11+56),r1 the_period->next_length = length; 800426c: 59 6c 00 3c sw (r11+60),r12 _ISR_Enable( level ); 8004270: d0 0d 00 00 wcsr IE,r13 _Thread_Executing->Wait.id = the_period->Object.id; 8004274: 78 01 08 01 mvhi r1,0x801 8004278: 38 21 fb 10 ori r1,r1,0xfb10 800427c: 29 62 00 08 lw r2,(r11+8) 8004280: 28 21 00 0c lw r1,(r1+12) 8004284: 58 22 00 20 sw (r1+32),r2 _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 8004288: 34 02 40 00 mvi r2,16384 800428c: f8 00 0f 12 calli 8007ed4 <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 8004290: 90 00 08 00 rcsr r1,IE 8004294: 34 02 ff fe mvi r2,-2 8004298: a0 22 10 00 and r2,r1,r2 800429c: d0 02 00 00 wcsr IE,r2 local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 80042a0: 34 03 00 02 mvi r3,2 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 80042a4: 29 62 00 38 lw r2,(r11+56) the_period->state = RATE_MONOTONIC_ACTIVE; 80042a8: 59 63 00 38 sw (r11+56),r3 _ISR_Enable( level ); 80042ac: d0 01 00 00 wcsr IE,r1 /* * If it did, then we want to unblock ourself and continue as * if nothing happen. The period was reset in the timeout routine. */ if ( local_state == RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING ) 80042b0: 34 01 00 03 mvi r1,3 80042b4: 5c 41 00 06 bne r2,r1,80042cc _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 80042b8: 78 01 08 01 mvhi r1,0x801 80042bc: 38 21 fb 10 ori r1,r1,0xfb10 80042c0: 28 21 00 0c lw r1,(r1+12) 80042c4: 34 02 40 00 mvi r2,16384 80042c8: f8 00 0b 55 calli 800701c <_Thread_Clear_state> _Thread_Enable_dispatch(); 80042cc: f8 00 0c 31 calli 8007390 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 80042d0: 34 0b 00 00 mvi r11,0 80042d4: e0 00 00 10 bi 8004314 case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 80042d8: b9 60 08 00 mv r1,r11 80042dc: fb ff ff 5f calli 8004058 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 80042e0: d0 0d 00 00 wcsr IE,r13 the_period->state = RATE_MONOTONIC_ACTIVE; 80042e4: 34 01 00 02 mvi r1,2 80042e8: 59 61 00 38 sw (r11+56),r1 80042ec: 78 01 08 01 mvhi r1,0x801 80042f0: 35 62 00 10 addi r2,r11,16 the_period->next_length = length; 80042f4: 59 6c 00 3c sw (r11+60),r12 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 80042f8: 59 6c 00 1c sw (r11+28),r12 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 80042fc: 38 21 fa 08 ori r1,r1,0xfa08 8004300: f8 00 12 02 calli 8008b08 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_TIMEOUT; 8004304: 34 0b 00 06 mvi r11,6 the_period->state = RATE_MONOTONIC_ACTIVE; the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 8004308: f8 00 0c 22 calli 8007390 <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 800430c: e0 00 00 02 bi 8004314 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 8004310: 34 0b 00 04 mvi r11,4 } 8004314: b9 60 08 00 mv r1,r11 8004318: 2b 9d 00 04 lw ra,(sp+4) 800431c: 2b 8b 00 14 lw r11,(sp+20) 8004320: 2b 8c 00 10 lw r12,(sp+16) 8004324: 2b 8d 00 0c lw r13,(sp+12) 8004328: 2b 8e 00 08 lw r14,(sp+8) 800432c: 37 9c 00 18 addi sp,sp,24 8004330: c3 a0 00 00 ret =============================================================================== 08004334 : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 8004334: 37 9c ff 5c addi sp,sp,-164 8004338: 5b 8b 00 44 sw (sp+68),r11 800433c: 5b 8c 00 40 sw (sp+64),r12 8004340: 5b 8d 00 3c sw (sp+60),r13 8004344: 5b 8e 00 38 sw (sp+56),r14 8004348: 5b 8f 00 34 sw (sp+52),r15 800434c: 5b 90 00 30 sw (sp+48),r16 8004350: 5b 91 00 2c sw (sp+44),r17 8004354: 5b 92 00 28 sw (sp+40),r18 8004358: 5b 93 00 24 sw (sp+36),r19 800435c: 5b 94 00 20 sw (sp+32),r20 8004360: 5b 95 00 1c sw (sp+28),r21 8004364: 5b 96 00 18 sw (sp+24),r22 8004368: 5b 97 00 14 sw (sp+20),r23 800436c: 5b 98 00 10 sw (sp+16),r24 8004370: 5b 99 00 0c sw (sp+12),r25 8004374: 5b 9b 00 08 sw (sp+8),fp 8004378: 5b 9d 00 04 sw (sp+4),ra 800437c: b8 20 60 00 mv r12,r1 8004380: b8 40 58 00 mv r11,r2 rtems_id id; rtems_rate_monotonic_period_statistics the_stats; rtems_rate_monotonic_period_status the_status; char name[5]; if ( !print ) 8004384: 44 40 00 72 be r2,r0,800454c <== NEVER TAKEN return; (*print)( context, "Period information by period\n" ); 8004388: 78 02 08 01 mvhi r2,0x801 800438c: 38 42 cc dc ori r2,r2,0xccdc 8004390: d9 60 00 00 call r11 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 8004394: 78 02 08 01 mvhi r2,0x801 8004398: 38 42 cc fc ori r2,r2,0xccfc 800439c: b9 80 08 00 mv r1,r12 80043a0: d9 60 00 00 call r11 (*print)( context, "--- Wall times are in seconds ---\n" ); 80043a4: 78 02 08 01 mvhi r2,0x801 80043a8: 38 42 cd 20 ori r2,r2,0xcd20 80043ac: b9 80 08 00 mv r1,r12 80043b0: d9 60 00 00 call r11 Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 80043b4: 78 02 08 01 mvhi r2,0x801 80043b8: 38 42 cd 44 ori r2,r2,0xcd44 80043bc: b9 80 08 00 mv r1,r12 80043c0: d9 60 00 00 call r11 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 80043c4: 78 02 08 01 mvhi r2,0x801 80043c8: b9 80 08 00 mv r1,r12 80043cc: 38 42 cd 90 ori r2,r2,0xcd90 80043d0: d9 60 00 00 call r11 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 80043d4: 78 01 08 01 mvhi r1,0x801 80043d8: 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, 80043dc: 78 11 08 01 mvhi r17,0x801 struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); (*print)( context, 80043e0: 78 10 08 01 mvhi r16,0x801 struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); (*print)( context, 80043e4: 78 0f 08 01 mvhi r15,0x801 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 80043e8: 78 0e 08 01 mvhi r14,0x801 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 80043ec: 28 2d 00 08 lw r13,(r1+8) id <= _Rate_monotonic_Information.maximum_id ; 80043f0: b8 20 a0 00 mv r20,r1 id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 80043f4: 37 99 00 48 addi r25,sp,72 if ( status != RTEMS_SUCCESSFUL ) continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 80043f8: 37 98 00 80 addi r24,sp,128 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 80043fc: 37 93 00 a0 addi r19,sp,160 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 8004400: 3a 31 cd dc ori r17,r17,0xcddc { #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; 8004404: 37 97 00 60 addi r23,sp,96 _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 8004408: 37 92 00 98 addi r18,sp,152 (*print)( context, 800440c: 3a 10 cd f4 ori r16,r16,0xcdf4 { #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ struct timespec wall_average; struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; 8004410: 37 96 00 78 addi r22,sp,120 _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); (*print)( context, 8004414: 39 ef ce 14 ori r15,r15,0xce14 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 8004418: 39 ce c3 20 ori r14,r14,0xc320 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 800441c: e0 00 00 4a bi 8004544 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 8004420: b9 a0 08 00 mv r1,r13 8004424: bb 20 10 00 mv r2,r25 8004428: f8 00 1a 53 calli 800ad74 800442c: b8 20 a8 00 mv r21,r1 if ( status != RTEMS_SUCCESSFUL ) 8004430: 5c 20 00 44 bne r1,r0,8004540 continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 8004434: bb 00 10 00 mv r2,r24 8004438: b9 a0 08 00 mv r1,r13 800443c: f8 00 1a 80 calli 800ae3c #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 8004440: 2b 81 00 80 lw r1,(sp+128) 8004444: 34 02 00 05 mvi r2,5 8004448: ba 60 18 00 mv r3,r19 800444c: f8 00 00 c3 calli 8004758 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 8004450: 2b 85 00 48 lw r5,(sp+72) 8004454: 2b 86 00 4c lw r6,(sp+76) 8004458: ba 20 10 00 mv r2,r17 800445c: b9 80 08 00 mv r1,r12 8004460: b9 a0 18 00 mv r3,r13 8004464: ba 60 20 00 mv r4,r19 8004468: d9 60 00 00 call r11 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 800446c: 2b 82 00 48 lw r2,(sp+72) 8004470: 5c 55 00 05 bne r2,r21,8004484 (*print)( context, "\n" ); 8004474: b9 80 08 00 mv r1,r12 8004478: b9 c0 10 00 mv r2,r14 800447c: d9 60 00 00 call r11 continue; 8004480: e0 00 00 30 bi 8004540 struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 8004484: ba 40 18 00 mv r3,r18 8004488: ba e0 08 00 mv r1,r23 800448c: f8 00 10 55 calli 80085e0 <_Timespec_Divide_by_integer> (*print)( context, 8004490: 2b 81 00 54 lw r1,(sp+84) 8004494: 34 02 03 e8 mvi r2,1000 8004498: f8 00 5c 0b calli 801b4c4 <__divsi3> 800449c: b8 20 d8 00 mv fp,r1 80044a0: 2b 81 00 5c lw r1,(sp+92) 80044a4: 34 02 03 e8 mvi r2,1000 80044a8: f8 00 5c 07 calli 801b4c4 <__divsi3> 80044ac: b8 20 a8 00 mv r21,r1 80044b0: 2b 81 00 9c lw r1,(sp+156) 80044b4: 34 02 03 e8 mvi r2,1000 80044b8: f8 00 5c 03 calli 801b4c4 <__divsi3> 80044bc: 2b 85 00 58 lw r5,(sp+88) 80044c0: 2b 87 00 98 lw r7,(sp+152) 80044c4: 2b 83 00 50 lw r3,(sp+80) 80044c8: b8 20 40 00 mv r8,r1 80044cc: bb 60 20 00 mv r4,fp 80044d0: ba a0 30 00 mv r6,r21 80044d4: ba 00 10 00 mv r2,r16 80044d8: b9 80 08 00 mv r1,r12 80044dc: d9 60 00 00 call r11 struct timespec wall_average; struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); 80044e0: 2b 82 00 48 lw r2,(sp+72) 80044e4: ba 40 18 00 mv r3,r18 80044e8: ba c0 08 00 mv r1,r22 80044ec: f8 00 10 3d calli 80085e0 <_Timespec_Divide_by_integer> (*print)( context, 80044f0: 2b 81 00 6c lw r1,(sp+108) 80044f4: 34 02 03 e8 mvi r2,1000 80044f8: f8 00 5b f3 calli 801b4c4 <__divsi3> 80044fc: b8 20 d8 00 mv fp,r1 8004500: 2b 81 00 74 lw r1,(sp+116) 8004504: 34 02 03 e8 mvi r2,1000 8004508: f8 00 5b ef calli 801b4c4 <__divsi3> 800450c: b8 20 a8 00 mv r21,r1 8004510: 2b 81 00 9c lw r1,(sp+156) 8004514: 34 02 03 e8 mvi r2,1000 8004518: f8 00 5b eb calli 801b4c4 <__divsi3> 800451c: 2b 83 00 68 lw r3,(sp+104) 8004520: 2b 85 00 70 lw r5,(sp+112) 8004524: 2b 87 00 98 lw r7,(sp+152) 8004528: b8 20 40 00 mv r8,r1 800452c: b9 e0 10 00 mv r2,r15 8004530: b9 80 08 00 mv r1,r12 8004534: bb 60 20 00 mv r4,fp 8004538: ba a0 30 00 mv r6,r21 800453c: d9 60 00 00 call r11 * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 8004540: 35 ad 00 01 addi r13,r13,1 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 8004544: 2a 81 00 0c lw r1,(r20+12) 8004548: 50 2d ff b6 bgeu r1,r13,8004420 the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall ); #endif } } } 800454c: 2b 9d 00 04 lw ra,(sp+4) 8004550: 2b 8b 00 44 lw r11,(sp+68) 8004554: 2b 8c 00 40 lw r12,(sp+64) 8004558: 2b 8d 00 3c lw r13,(sp+60) 800455c: 2b 8e 00 38 lw r14,(sp+56) 8004560: 2b 8f 00 34 lw r15,(sp+52) 8004564: 2b 90 00 30 lw r16,(sp+48) 8004568: 2b 91 00 2c lw r17,(sp+44) 800456c: 2b 92 00 28 lw r18,(sp+40) 8004570: 2b 93 00 24 lw r19,(sp+36) 8004574: 2b 94 00 20 lw r20,(sp+32) 8004578: 2b 95 00 1c lw r21,(sp+28) 800457c: 2b 96 00 18 lw r22,(sp+24) 8004580: 2b 97 00 14 lw r23,(sp+20) 8004584: 2b 98 00 10 lw r24,(sp+16) 8004588: 2b 99 00 0c lw r25,(sp+12) 800458c: 2b 9b 00 08 lw fp,(sp+8) 8004590: 37 9c 00 a4 addi sp,sp,164 8004594: c3 a0 00 00 ret =============================================================================== 0800281c : uint32_t count, rtems_attribute attribute_set, rtems_task_priority priority_ceiling, rtems_id *id ) { 800281c: 37 9c ff c8 addi sp,sp,-56 8002820: 5b 8b 00 20 sw (sp+32),r11 8002824: 5b 8c 00 1c sw (sp+28),r12 8002828: 5b 8d 00 18 sw (sp+24),r13 800282c: 5b 8e 00 14 sw (sp+20),r14 8002830: 5b 8f 00 10 sw (sp+16),r15 8002834: 5b 90 00 0c sw (sp+12),r16 8002838: 5b 91 00 08 sw (sp+8),r17 800283c: 5b 9d 00 04 sw (sp+4),ra 8002840: b8 20 80 00 mv r16,r1 8002844: b8 40 70 00 mv r14,r2 8002848: b8 60 60 00 mv r12,r3 800284c: b8 80 88 00 mv r17,r4 8002850: b8 a0 78 00 mv r15,r5 CORE_mutex_Attributes the_mutex_attr; CORE_semaphore_Attributes the_semaphore_attr; CORE_mutex_Status mutex_status; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; 8002854: 34 01 00 03 mvi r1,3 register Semaphore_Control *the_semaphore; CORE_mutex_Attributes the_mutex_attr; CORE_semaphore_Attributes the_semaphore_attr; CORE_mutex_Status mutex_status; if ( !rtems_is_name_valid( name ) ) 8002858: 46 00 00 64 be r16,r0,80029e8 <== NEVER TAKEN return RTEMS_INVALID_NAME; if ( !id ) return RTEMS_INVALID_ADDRESS; 800285c: 34 01 00 09 mvi r1,9 CORE_mutex_Status mutex_status; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !id ) 8002860: 44 a0 00 62 be r5,r0,80029e8 <== NEVER TAKEN * id - semaphore id * RTEMS_SUCCESSFUL - if successful * error code - if unsuccessful */ rtems_status_code rtems_semaphore_create( 8002864: 20 62 00 c0 andi r2,r3,0xc0 return RTEMS_NOT_DEFINED; } else #endif if ( _Attributes_Is_inherit_priority( attribute_set ) || 8002868: 44 40 00 09 be r2,r0,800288c */ RTEMS_INLINE_ROUTINE bool _Attributes_Is_binary_semaphore( rtems_attribute attribute_set ) { return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_BINARY_SEMAPHORE); 800286c: 20 64 00 30 andi r4,r3,0x30 _Attributes_Is_priority_ceiling( attribute_set ) ) { if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) && 8002870: 34 03 00 10 mvi r3,16 _Attributes_Is_priority( attribute_set ) ) ) return RTEMS_NOT_DEFINED; 8002874: 34 01 00 0b mvi r1,11 #endif if ( _Attributes_Is_inherit_priority( attribute_set ) || _Attributes_Is_priority_ceiling( attribute_set ) ) { if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) && 8002878: 5c 83 00 5c bne r4,r3,80029e8 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority( rtems_attribute attribute_set ) { return ( attribute_set & RTEMS_PRIORITY ) ? true : false; 800287c: 21 83 00 04 andi r3,r12,0x4 8002880: 44 60 00 5a be r3,r0,80029e8 <== NEVER TAKEN _Attributes_Is_priority( attribute_set ) ) ) return RTEMS_NOT_DEFINED; } if ( _Attributes_Is_inherit_priority( attribute_set ) && 8002884: 34 03 00 c0 mvi r3,192 8002888: 44 43 00 58 be r2,r3,80029e8 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE bool _Attributes_Is_counting_semaphore( rtems_attribute attribute_set ) { return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_COUNTING_SEMAPHORE); 800288c: 21 8d 00 30 andi r13,r12,0x30 _Attributes_Is_priority_ceiling( attribute_set ) ) return RTEMS_NOT_DEFINED; if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) ) 8002890: 45 a0 00 04 be r13,r0,80028a0 8002894: 34 02 00 01 mvi r2,1 return RTEMS_INVALID_NUMBER; 8002898: 34 01 00 0a mvi r1,10 if ( _Attributes_Is_inherit_priority( attribute_set ) && _Attributes_Is_priority_ceiling( attribute_set ) ) return RTEMS_NOT_DEFINED; if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) ) 800289c: 55 c2 00 53 bgu r14,r2,80029e8 <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 80028a0: 78 06 08 01 mvhi r6,0x801 80028a4: 38 c6 38 1c ori r6,r6,0x381c 80028a8: 28 c1 00 00 lw r1,(r6+0) 80028ac: 34 21 00 01 addi r1,r1,1 80028b0: 58 c1 00 00 sw (r6+0),r1 * This function allocates a semaphore control block from * the inactive chain of free semaphore control blocks. */ RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Allocate( void ) { return (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information ); 80028b4: 78 01 08 01 mvhi r1,0x801 80028b8: 38 21 37 30 ori r1,r1,0x3730 80028bc: f8 00 06 0a calli 80040e4 <_Objects_Allocate> 80028c0: b8 20 58 00 mv r11,r1 _Thread_Disable_dispatch(); /* prevents deletion */ the_semaphore = _Semaphore_Allocate(); if ( !the_semaphore ) { 80028c4: 5c 20 00 04 bne r1,r0,80028d4 _Thread_Enable_dispatch(); 80028c8: f8 00 09 f0 calli 8005088 <_Thread_Enable_dispatch> return RTEMS_TOO_MANY; 80028cc: 34 01 00 05 mvi r1,5 80028d0: e0 00 00 46 bi 80029e8 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_semaphore->attribute_set = attribute_set; 80028d4: 58 2c 00 10 sw (r1+16),r12 80028d8: 21 81 00 04 andi r1,r12,0x4 /* * Initialize it as a counting semaphore. */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { 80028dc: 5d a0 00 0f bne r13,r0,8002918 /* * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; 80028e0: 34 02 ff ff mvi r2,-1 80028e4: 5b 82 00 34 sw (sp+52),r2 if ( _Attributes_Is_priority( attribute_set ) ) 80028e8: 44 2d 00 04 be r1,r13,80028f8 the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY; 80028ec: 34 01 00 01 mvi r1,1 80028f0: 5b 81 00 38 sw (sp+56),r1 80028f4: e0 00 00 02 bi 80028fc else the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; 80028f8: 5b 80 00 38 sw (sp+56),r0 * The following are just to make Purify happy. */ the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM; _CORE_semaphore_Initialize( 80028fc: 35 61 00 14 addi r1,r11,20 8002900: 37 82 00 34 addi r2,sp,52 8002904: b9 c0 18 00 mv r3,r14 the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * The following are just to make Purify happy. */ the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; 8002908: 5b 80 00 24 sw (sp+36),r0 the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM; 800290c: 5b 80 00 30 sw (sp+48),r0 _CORE_semaphore_Initialize( 8002910: f8 00 04 05 calli 8003924 <_CORE_semaphore_Initialize> 8002914: e0 00 00 28 bi 80029b4 } else { /* * It is either simple binary semaphore or a more powerful mutex * style binary semaphore. This is the mutex style. */ if ( _Attributes_Is_priority( attribute_set ) ) 8002918: 44 20 00 04 be r1,r0,8002928 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY; 800291c: 34 01 00 01 mvi r1,1 8002920: 5b 81 00 2c sw (sp+44),r1 8002924: e0 00 00 02 bi 800292c else the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; 8002928: 5b 80 00 2c sw (sp+44),r0 if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { 800292c: 34 01 00 10 mvi r1,16 8002930: 5d a1 00 11 bne r13,r1,8002974 the_mutex_attr.priority_ceiling = priority_ceiling; the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.only_owner_release = false; if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { 8002934: 2b 82 00 2c lw r2,(sp+44) the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY; else the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { the_mutex_attr.priority_ceiling = priority_ceiling; 8002938: 5b 91 00 30 sw (sp+48),r17 the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; 800293c: 5b 80 00 24 sw (sp+36),r0 the_mutex_attr.only_owner_release = false; 8002940: 33 80 00 28 sb (sp+40),r0 if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { 8002944: 34 01 00 01 mvi r1,1 8002948: 5c 41 00 0e bne r2,r1,8002980 */ RTEMS_INLINE_ROUTINE bool _Attributes_Is_inherit_priority( rtems_attribute attribute_set ) { return ( attribute_set & RTEMS_INHERIT_PRIORITY ) ? true : false; 800294c: 21 81 00 40 andi r1,r12,0x40 if ( _Attributes_Is_inherit_priority( attribute_set ) ) { 8002950: 44 20 00 03 be r1,r0,800295c the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 8002954: 34 01 00 02 mvi r1,2 8002958: e0 00 00 04 bi 8002968 */ RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority_ceiling( rtems_attribute attribute_set ) { return ( attribute_set & RTEMS_PRIORITY_CEILING ) ? true : false; 800295c: 21 8c 00 80 andi r12,r12,0x80 the_mutex_attr.only_owner_release = true; } else if ( _Attributes_Is_priority_ceiling( attribute_set ) ) { 8002960: 45 81 00 08 be r12,r1,8002980 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; 8002964: 34 01 00 03 mvi r1,3 8002968: 5b 81 00 2c sw (sp+44),r1 the_mutex_attr.only_owner_release = true; 800296c: 33 82 00 28 sb (sp+40),r2 8002970: e0 00 00 04 bi 8002980 } } } else /* must be simple binary semaphore */ { the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_BLOCKS; 8002974: 34 01 00 02 mvi r1,2 8002978: 5b 81 00 24 sw (sp+36),r1 the_mutex_attr.only_owner_release = false; 800297c: 33 80 00 28 sb (sp+40),r0 } mutex_status = _CORE_mutex_Initialize( 8002980: 65 c3 00 01 cmpei r3,r14,1 8002984: 37 82 00 24 addi r2,sp,36 8002988: 35 61 00 14 addi r1,r11,20 800298c: f8 00 03 12 calli 80035d4 <_CORE_mutex_Initialize> &the_semaphore->Core_control.mutex, &the_mutex_attr, (count == 1) ? CORE_MUTEX_UNLOCKED : CORE_MUTEX_LOCKED ); if ( mutex_status == CORE_MUTEX_STATUS_CEILING_VIOLATED ) { 8002990: 34 02 00 06 mvi r2,6 8002994: 5c 22 00 08 bne r1,r2,80029b4 */ RTEMS_INLINE_ROUTINE void _Semaphore_Free ( Semaphore_Control *the_semaphore ) { _Objects_Free( &_Semaphore_Information, &the_semaphore->Object ); 8002998: 78 01 08 01 mvhi r1,0x801 800299c: 38 21 37 30 ori r1,r1,0x3730 80029a0: b9 60 10 00 mv r2,r11 80029a4: f8 00 06 cc calli 80044d4 <_Objects_Free> _Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 80029a8: f8 00 09 b8 calli 8005088 <_Thread_Enable_dispatch> return RTEMS_INVALID_PRIORITY; 80029ac: 34 01 00 13 mvi r1,19 80029b0: e0 00 00 0e bi 80029e8 Objects_Name name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 80029b4: 29 6c 00 08 lw r12,(r11+8) 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 80029b8: 78 02 08 01 mvhi r2,0x801 80029bc: 38 42 37 30 ori r2,r2,0x3730 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 80029c0: 28 4d 00 1c lw r13,(r2+28) 80029c4: 21 81 ff ff andi r1,r12,0xffff 80029c8: 34 02 00 02 mvi r2,2 80029cc: f8 00 37 a4 calli 801085c <__ashlsi3> 80029d0: b5 a1 08 00 add r1,r13,r1 80029d4: 58 2b 00 00 sw (r1+0),r11 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 80029d8: 59 70 00 0c sw (r11+12),r16 &_Semaphore_Information, &the_semaphore->Object, (Objects_Name) name ); *id = the_semaphore->Object.id; 80029dc: 59 ec 00 00 sw (r15+0),r12 the_semaphore->Object.id, name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 80029e0: f8 00 09 aa calli 8005088 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 80029e4: 34 01 00 00 mvi r1,0 } 80029e8: 2b 9d 00 04 lw ra,(sp+4) 80029ec: 2b 8b 00 20 lw r11,(sp+32) 80029f0: 2b 8c 00 1c lw r12,(sp+28) 80029f4: 2b 8d 00 18 lw r13,(sp+24) 80029f8: 2b 8e 00 14 lw r14,(sp+20) 80029fc: 2b 8f 00 10 lw r15,(sp+16) 8002a00: 2b 90 00 0c lw r16,(sp+12) 8002a04: 2b 91 00 08 lw r17,(sp+8) 8002a08: 37 9c 00 38 addi sp,sp,56 8002a0c: c3 a0 00 00 ret =============================================================================== 0801349c : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 801349c: 37 9c ff f4 addi sp,sp,-12 80134a0: 5b 8b 00 08 sw (sp+8),r11 80134a4: 5b 9d 00 04 sw (sp+4),ra Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; 80134a8: 34 03 00 0a mvi r3,10 rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 80134ac: b8 40 58 00 mv r11,r2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 80134b0: 44 40 00 29 be r2,r0,8013554 return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 80134b4: 37 82 00 0c addi r2,sp,12 80134b8: f8 00 13 df calli 8018434 <_Thread_Get> switch ( location ) { 80134bc: 2b 82 00 0c lw r2,(sp+12) case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 80134c0: 34 03 00 04 mvi r3,4 if ( !signal_set ) return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); switch ( location ) { 80134c4: 5c 40 00 24 bne r2,r0,8013554 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 80134c8: 28 23 01 24 lw r3,(r1+292) asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 80134cc: 28 64 00 0c lw r4,(r3+12) 80134d0: 44 82 00 1f be r4,r2,801354c if ( asr->is_enabled ) { 80134d4: 40 62 00 08 lbu r2,(r3+8) 80134d8: 44 40 00 12 be r2,r0,8013520 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 80134dc: 90 00 10 00 rcsr r2,IE 80134e0: 34 04 ff fe mvi r4,-2 80134e4: a0 44 20 00 and r4,r2,r4 80134e8: d0 04 00 00 wcsr IE,r4 *signal_set |= signals; 80134ec: 28 64 00 14 lw r4,(r3+20) 80134f0: b8 8b 58 00 or r11,r4,r11 80134f4: 58 6b 00 14 sw (r3+20),r11 _ISR_Enable( _level ); 80134f8: d0 02 00 00 wcsr IE,r2 _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 80134fc: 78 02 08 03 mvhi r2,0x803 8013500: 38 42 ee 00 ori r2,r2,0xee00 8013504: 28 43 00 08 lw r3,(r2+8) 8013508: 44 60 00 0e be r3,r0,8013540 801350c: 28 43 00 0c lw r3,(r2+12) 8013510: 5c 23 00 0c bne r1,r3,8013540 <== NEVER TAKEN _Context_Switch_necessary = true; 8013514: 34 01 00 01 mvi r1,1 8013518: 30 41 00 18 sb (r2+24),r1 801351c: e0 00 00 09 bi 8013540 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 8013520: 90 00 08 00 rcsr r1,IE 8013524: 34 02 ff fe mvi r2,-2 8013528: a0 22 10 00 and r2,r1,r2 801352c: d0 02 00 00 wcsr IE,r2 *signal_set |= signals; 8013530: 28 62 00 18 lw r2,(r3+24) 8013534: b8 4b 58 00 or r11,r2,r11 8013538: 58 6b 00 18 sw (r3+24),r11 _ISR_Enable( _level ); 801353c: d0 01 00 00 wcsr IE,r1 } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 8013540: f8 00 13 b0 calli 8018400 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8013544: 34 03 00 00 mvi r3,0 8013548: e0 00 00 03 bi 8013554 } _Thread_Enable_dispatch(); 801354c: f8 00 13 ad calli 8018400 <_Thread_Enable_dispatch> return RTEMS_NOT_DEFINED; 8013550: 34 03 00 0b mvi r3,11 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8013554: b8 60 08 00 mv r1,r3 8013558: 2b 9d 00 04 lw ra,(sp+4) 801355c: 2b 8b 00 08 lw r11,(sp+8) 8013560: 37 9c 00 0c addi sp,sp,12 8013564: c3 a0 00 00 ret =============================================================================== 080007f4 : Thread_Control *the_thread ) { Stack_check_Control *the_pattern; if ( the_thread->Object.id == 0 ) /* skip system tasks */ 80007f4: 28 22 00 08 lw r2,(r1+8) 80007f8: 44 40 00 0c be r2,r0,8000828 <== NEVER TAKEN return; the_pattern = Stack_check_Get_pattern_area(&the_thread->Start.Initial_stack); *the_pattern = Stack_check_Pattern; 80007fc: 28 22 00 c4 lw r2,(r1+196) 8000800: 78 01 08 01 mvhi r1,0x801 8000804: 38 21 36 b4 ori r1,r1,0x36b4 8000808: 28 25 00 00 lw r5,(r1+0) 800080c: 28 24 00 04 lw r4,(r1+4) 8000810: 28 23 00 08 lw r3,(r1+8) 8000814: 28 21 00 0c lw r1,(r1+12) 8000818: 58 45 00 08 sw (r2+8),r5 800081c: 58 44 00 0c sw (r2+12),r4 8000820: 58 43 00 10 sw (r2+16),r3 8000824: 58 41 00 14 sw (r2+20),r1 8000828: c3 a0 00 00 ret =============================================================================== 080007c4 : */ bool rtems_stack_checker_create_extension( Thread_Control *running __attribute__((unused)), Thread_Control *the_thread ) { 80007c4: 37 9c ff fc addi sp,sp,-4 80007c8: 5b 9d 00 04 sw (sp+4),ra 80007cc: b8 40 18 00 mv r3,r2 Stack_check_Initialize(); if (the_thread) 80007d0: 44 40 00 05 be r2,r0,80007e4 <== NEVER TAKEN Stack_check_Dope_stack(&the_thread->Start.Initial_stack); 80007d4: 28 41 00 c4 lw r1,(r2+196) 80007d8: 28 63 00 c0 lw r3,(r3+192) 80007dc: 34 02 00 a5 mvi r2,165 80007e0: f8 00 2d a9 calli 800be84 return true; } 80007e4: 34 01 00 01 mvi r1,1 80007e8: 2b 9d 00 04 lw ra,(sp+4) 80007ec: 37 9c 00 04 addi sp,sp,4 80007f0: c3 a0 00 00 ret =============================================================================== 0800095c : /* * Check if blown */ bool rtems_stack_checker_is_blown( void ) { 800095c: 37 9c ff f8 addi sp,sp,-8 8000960: 5b 9b 00 08 sw (sp+8),fp 8000964: 34 1b 00 08 mvi fp,8 8000968: b7 7c d8 00 add fp,fp,sp 800096c: 5b 9d 00 04 sw (sp+4),ra Stack_Control *the_stack = &_Thread_Executing->Start.Initial_stack; 8000970: 78 01 08 01 mvhi r1,0x801 8000974: 38 21 39 d8 ori r1,r1,0x39d8 8000978: 28 22 00 0c lw r2,(r1+12) ) { #if defined(__GNUC__) void *sp = __builtin_frame_address(0); if ( sp < the_stack->area ) { 800097c: 28 41 00 c4 lw r1,(r2+196) 8000980: 54 3b 00 04 bgu r1,fp,8000990 <== NEVER TAKEN return false; } if ( sp > (the_stack->area + the_stack->size) ) { 8000984: 28 42 00 c0 lw r2,(r2+192) 8000988: b4 22 08 00 add r1,r1,r2 800098c: 50 3b 00 06 bgeu r1,fp,80009a4 <== ALWAYS TAKEN /* * Let's report as much as we can. */ if ( !sp_ok || !pattern_ok ) { Stack_check_report_blown_task( _Thread_Executing, pattern_ok ); 8000990: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8000994: 38 21 39 d8 ori r1,r1,0x39d8 <== NOT EXECUTED 8000998: 28 21 00 0c lw r1,(r1+12) <== NOT EXECUTED 800099c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 80009a0: fb ff ff a3 calli 800082c <== NOT EXECUTED /* * The Stack Pointer and the Pattern Area are OK so return false. */ return false; } 80009a4: 34 01 00 00 mvi r1,0 80009a8: 2b 9d 00 04 lw ra,(sp+4) 80009ac: 2b 9b 00 08 lw fp,(sp+8) 80009b0: 37 9c 00 08 addi sp,sp,8 80009b4: c3 a0 00 00 ret =============================================================================== 080009b8 : void rtems_stack_checker_report_usage_with_plugin( void *context, rtems_printk_plugin_t print ) { 80009b8: 37 9c ff ec addi sp,sp,-20 80009bc: 5b 8b 00 14 sw (sp+20),r11 80009c0: 5b 8c 00 10 sw (sp+16),r12 80009c4: 5b 8d 00 0c sw (sp+12),r13 80009c8: 5b 8e 00 08 sw (sp+8),r14 80009cc: 5b 9d 00 04 sw (sp+4),ra 80009d0: b8 20 70 00 mv r14,r1 80009d4: b8 40 68 00 mv r13,r2 if ( !print ) 80009d8: 44 40 00 15 be r2,r0,8000a2c <== NEVER TAKEN return; print_context = context; print_handler = print; 80009dc: 78 0b 08 01 mvhi r11,0x801 80009e0: 39 6b 36 30 ori r11,r11,0x3630 ) { if ( !print ) return; print_context = context; 80009e4: 78 0c 08 01 mvhi r12,0x801 80009e8: 39 8c 36 2c ori r12,r12,0x362c print_handler = print; 80009ec: 59 62 00 00 sw (r11+0),r2 (*print)( context, "Stack usage by thread\n"); 80009f0: 78 02 08 01 mvhi r2,0x801 80009f4: 38 42 18 8c ori r2,r2,0x188c ) { if ( !print ) return; print_context = context; 80009f8: 59 81 00 00 sw (r12+0),r1 print_handler = print; (*print)( context, "Stack usage by thread\n"); 80009fc: d9 a0 00 00 call r13 (*print)( context, 8000a00: 78 02 08 01 mvhi r2,0x801 8000a04: 38 42 18 a4 ori r2,r2,0x18a4 8000a08: b9 c0 08 00 mv r1,r14 8000a0c: d9 a0 00 00 call r13 " ID NAME LOW HIGH CURRENT AVAILABLE USED\n" ); /* iterate over all threads and dump the usage */ rtems_iterate_over_all_threads( Stack_check_Dump_threads_usage ); 8000a10: 78 01 08 00 mvhi r1,0x800 8000a14: 38 21 06 a0 ori r1,r1,0x6a0 8000a18: f8 00 0d 4b calli 8003f44 #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) /* dump interrupt stack info if any */ Stack_check_Dump_threads_usage((Thread_Control *) -1); 8000a1c: 34 01 ff ff mvi r1,-1 8000a20: fb ff ff 20 calli 80006a0 #endif print_context = NULL; 8000a24: 59 80 00 00 sw (r12+0),r0 print_handler = NULL; 8000a28: 59 60 00 00 sw (r11+0),r0 } 8000a2c: 2b 9d 00 04 lw ra,(sp+4) 8000a30: 2b 8b 00 14 lw r11,(sp+20) 8000a34: 2b 8c 00 10 lw r12,(sp+16) 8000a38: 2b 8d 00 0c lw r13,(sp+12) 8000a3c: 2b 8e 00 08 lw r14,(sp+8) 8000a40: 37 9c 00 14 addi sp,sp,20 8000a44: c3 a0 00 00 ret =============================================================================== 080008e4 : */ void rtems_stack_checker_switch_extension( Thread_Control *running __attribute__((unused)), Thread_Control *heir __attribute__((unused)) ) { 80008e4: 37 9c ff f0 addi sp,sp,-16 80008e8: 5b 9b 00 08 sw (sp+8),fp 80008ec: 34 1b 00 10 mvi fp,16 80008f0: b7 7c d8 00 add fp,fp,sp 80008f4: 5b 8b 00 10 sw (sp+16),r11 80008f8: 5b 8c 00 0c sw (sp+12),r12 80008fc: 5b 9d 00 04 sw (sp+4),ra Stack_Control *the_stack = &running->Start.Initial_stack; void *pattern; bool sp_ok; bool pattern_ok = true; pattern = (void *) Stack_check_Get_pattern_area(the_stack)->pattern; 8000900: 28 22 00 c4 lw r2,(r1+196) */ void rtems_stack_checker_switch_extension( Thread_Control *running __attribute__((unused)), Thread_Control *heir __attribute__((unused)) ) { 8000904: b8 20 58 00 mv r11,r1 { #if defined(__GNUC__) void *sp = __builtin_frame_address(0); if ( sp < the_stack->area ) { return false; 8000908: 34 0c 00 00 mvi r12,0 Stack_Control *the_stack = &running->Start.Initial_stack; void *pattern; bool sp_ok; bool pattern_ok = true; pattern = (void *) Stack_check_Get_pattern_area(the_stack)->pattern; 800090c: 34 41 00 08 addi r1,r2,8 ) { #if defined(__GNUC__) void *sp = __builtin_frame_address(0); if ( sp < the_stack->area ) { 8000910: 54 5b 00 04 bgu r2,fp,8000920 <== NEVER TAKEN return false; } if ( sp > (the_stack->area + the_stack->size) ) { 8000914: 29 6c 00 c0 lw r12,(r11+192) } /* * rtems_stack_checker_switch_extension */ void rtems_stack_checker_switch_extension( 8000918: b4 4c 10 00 add r2,r2,r12 800091c: f0 5b 60 00 cmpgeu r12,r2,fp /* * Check for an out of bounds stack pointer or an overwrite */ sp_ok = Stack_check_Frame_pointer_in_range( the_stack ); pattern_ok = (!memcmp( pattern, 8000920: 78 02 08 01 mvhi r2,0x801 8000924: 38 42 36 b4 ori r2,r2,0x36b4 8000928: 34 03 00 10 mvi r3,16 800092c: f8 00 2c e9 calli 800bcd0 8000930: 64 22 00 00 cmpei r2,r1,0 (void *) Stack_check_Pattern.pattern, PATTERN_SIZE_BYTES)); if ( !sp_ok || !pattern_ok ) { 8000934: 45 80 00 02 be r12,r0,800093c 8000938: 5c 40 00 03 bne r2,r0,8000944 Stack_check_report_blown_task( running, pattern_ok ); 800093c: b9 60 08 00 mv r1,r11 8000940: fb ff ff bb calli 800082c } } 8000944: 2b 9d 00 04 lw ra,(sp+4) 8000948: 2b 8b 00 10 lw r11,(sp+16) 800094c: 2b 8c 00 0c lw r12,(sp+12) 8000950: 2b 9b 00 08 lw fp,(sp+8) 8000954: 37 9c 00 10 addi sp,sp,16 8000958: c3 a0 00 00 ret =============================================================================== 08008bcc : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008bcc: 37 9c ff e4 addi sp,sp,-28 8008bd0: 5b 8b 00 18 sw (sp+24),r11 8008bd4: 5b 8c 00 14 sw (sp+20),r12 8008bd8: 5b 8d 00 10 sw (sp+16),r13 8008bdc: 5b 8e 00 0c sw (sp+12),r14 8008be0: 5b 8f 00 08 sw (sp+8),r15 8008be4: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 8008be8: 34 04 00 09 mvi r4,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008bec: b8 20 70 00 mv r14,r1 8008bf0: b8 40 58 00 mv r11,r2 8008bf4: b8 60 78 00 mv r15,r3 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8008bf8: 44 40 00 21 be r2,r0,8008c7c return RTEMS_INVALID_ADDRESS; errno = 0; 8008bfc: f8 00 0c 8c calli 800be2c <__errno> 8008c00: 58 20 00 00 sw (r1+0),r0 *n = 0; 8008c04: 59 60 00 00 sw (r11+0),r0 8008c08: 59 60 00 04 sw (r11+4),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); 8008c0c: b9 c0 08 00 mv r1,r14 8008c10: 37 82 00 1c addi r2,sp,28 8008c14: f8 00 17 b5 calli 800eae8 8008c18: b8 20 68 00 mv r13,r1 8008c1c: 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 ) 8008c20: 45 e0 00 03 be r15,r0,8008c2c *endptr = end; 8008c24: 2b 81 00 1c lw r1,(sp+28) 8008c28: 59 e1 00 00 sw (r15+0),r1 /* nothing was converted */ if ( end == s ) 8008c2c: 2b 81 00 1c lw r1,(sp+28) return RTEMS_NOT_DEFINED; 8008c30: 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 ) 8008c34: 44 2e 00 12 be r1,r14,8008c7c return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8008c38: 78 04 08 01 mvhi r4,0x801 8008c3c: 38 84 eb 30 ori r4,r4,0xeb30 8008c40: 28 83 00 00 lw r3,(r4+0) 8008c44: b9 a0 08 00 mv r1,r13 8008c48: b9 80 10 00 mv r2,r12 8008c4c: 34 04 ff ff mvi r4,-1 8008c50: f8 00 44 ff calli 801a04c <__gedf2> 8008c54: 48 20 00 02 bg r1,r0,8008c5c 8008c58: e0 00 00 06 bi 8008c70 8008c5c: f8 00 0c 74 calli 800be2c <__errno> 8008c60: 28 22 00 00 lw r2,(r1+0) 8008c64: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 8008c68: 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)) 8008c6c: 44 41 00 04 be r2,r1,8008c7c <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 8008c70: 59 6d 00 00 sw (r11+0),r13 8008c74: 59 6c 00 04 sw (r11+4),r12 #endif return RTEMS_SUCCESSFUL; 8008c78: 34 04 00 00 mvi r4,0 } 8008c7c: b8 80 08 00 mv r1,r4 8008c80: 2b 9d 00 04 lw ra,(sp+4) 8008c84: 2b 8b 00 18 lw r11,(sp+24) 8008c88: 2b 8c 00 14 lw r12,(sp+20) 8008c8c: 2b 8d 00 10 lw r13,(sp+16) 8008c90: 2b 8e 00 0c lw r14,(sp+12) 8008c94: 2b 8f 00 08 lw r15,(sp+8) 8008c98: 37 9c 00 1c addi sp,sp,28 8008c9c: c3 a0 00 00 ret =============================================================================== 08008ca0 : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008ca0: 37 9c ff e8 addi sp,sp,-24 8008ca4: 5b 8b 00 14 sw (sp+20),r11 8008ca8: 5b 8c 00 10 sw (sp+16),r12 8008cac: 5b 8d 00 0c sw (sp+12),r13 8008cb0: 5b 8e 00 08 sw (sp+8),r14 8008cb4: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 8008cb8: 34 04 00 09 mvi r4,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008cbc: b8 20 68 00 mv r13,r1 8008cc0: b8 40 58 00 mv r11,r2 8008cc4: b8 60 70 00 mv r14,r3 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8008cc8: 44 40 00 1c be r2,r0,8008d38 return RTEMS_INVALID_ADDRESS; errno = 0; 8008ccc: f8 00 0c 58 calli 800be2c <__errno> 8008cd0: 58 20 00 00 sw (r1+0),r0 *n = 0; 8008cd4: 59 60 00 00 sw (r11+0),r0 #ifdef STRING_TO_FLOAT result = STRING_TO_METHOD( s, &end ); 8008cd8: b9 a0 08 00 mv r1,r13 8008cdc: 37 82 00 18 addi r2,sp,24 8008ce0: f8 00 17 8e calli 800eb18 8008ce4: 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 ) 8008ce8: 45 c0 00 03 be r14,r0,8008cf4 *endptr = end; 8008cec: 2b 81 00 18 lw r1,(sp+24) 8008cf0: 59 c1 00 00 sw (r14+0),r1 /* nothing was converted */ if ( end == s ) 8008cf4: 2b 81 00 18 lw r1,(sp+24) return RTEMS_NOT_DEFINED; 8008cf8: 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 ) 8008cfc: 44 2d 00 0f be r1,r13,8008d38 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8008d00: 78 03 08 01 mvhi r3,0x801 8008d04: 38 63 eb 34 ori r3,r3,0xeb34 8008d08: 28 62 00 00 lw r2,(r3+0) 8008d0c: b9 80 08 00 mv r1,r12 8008d10: f8 00 3e d7 calli 801886c <__gesf2> 8008d14: 48 20 00 02 bg r1,r0,8008d1c 8008d18: e0 00 00 06 bi 8008d30 8008d1c: f8 00 0c 44 calli 800be2c <__errno> 8008d20: 28 22 00 00 lw r2,(r1+0) 8008d24: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 8008d28: 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)) 8008d2c: 44 41 00 03 be r2,r1,8008d38 <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 8008d30: 59 6c 00 00 sw (r11+0),r12 #endif return RTEMS_SUCCESSFUL; 8008d34: 34 04 00 00 mvi r4,0 } 8008d38: b8 80 08 00 mv r1,r4 8008d3c: 2b 9d 00 04 lw ra,(sp+4) 8008d40: 2b 8b 00 14 lw r11,(sp+20) 8008d44: 2b 8c 00 10 lw r12,(sp+16) 8008d48: 2b 8d 00 0c lw r13,(sp+12) 8008d4c: 2b 8e 00 08 lw r14,(sp+8) 8008d50: 37 9c 00 18 addi sp,sp,24 8008d54: c3 a0 00 00 ret =============================================================================== 08008d58 : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008d58: 37 9c ff e8 addi sp,sp,-24 8008d5c: 5b 8b 00 14 sw (sp+20),r11 8008d60: 5b 8c 00 10 sw (sp+16),r12 8008d64: 5b 8d 00 0c sw (sp+12),r13 8008d68: 5b 8e 00 08 sw (sp+8),r14 8008d6c: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 8008d70: 34 05 00 09 mvi r5,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008d74: b8 20 68 00 mv r13,r1 8008d78: b8 40 58 00 mv r11,r2 8008d7c: b8 60 70 00 mv r14,r3 8008d80: b8 80 60 00 mv r12,r4 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8008d84: 44 40 00 1a be r2,r0,8008dec return RTEMS_INVALID_ADDRESS; errno = 0; 8008d88: f8 00 0c 29 calli 800be2c <__errno> 8008d8c: 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 ); 8008d90: b9 80 18 00 mv r3,r12 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 8008d94: 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 ); 8008d98: b9 a0 08 00 mv r1,r13 8008d9c: 37 82 00 18 addi r2,sp,24 8008da0: f8 00 18 11 calli 800ede4 8008da4: b8 20 60 00 mv r12,r1 #endif /* If the user wants the end pointer back, then return it. */ if ( endptr ) 8008da8: 45 c0 00 03 be r14,r0,8008db4 *endptr = end; 8008dac: 2b 81 00 18 lw r1,(sp+24) 8008db0: 59 c1 00 00 sw (r14+0),r1 /* nothing was converted */ if ( end == s ) 8008db4: 2b 81 00 18 lw r1,(sp+24) return RTEMS_NOT_DEFINED; 8008db8: 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 ) 8008dbc: 44 2d 00 0c be r1,r13,8008dec return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8008dc0: 78 02 08 01 mvhi r2,0x801 8008dc4: 38 42 eb 14 ori r2,r2,0xeb14 8008dc8: 28 41 00 00 lw r1,(r2+0) 8008dcc: 5d 81 00 06 bne r12,r1,8008de4 8008dd0: f8 00 0c 17 calli 800be2c <__errno> 8008dd4: 28 22 00 00 lw r2,(r1+0) 8008dd8: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 8008ddc: 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)) 8008de0: 44 41 00 03 be r2,r1,8008dec <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 8008de4: 59 6c 00 00 sw (r11+0),r12 #endif return RTEMS_SUCCESSFUL; 8008de8: 34 05 00 00 mvi r5,0 } 8008dec: b8 a0 08 00 mv r1,r5 8008df0: 2b 9d 00 04 lw ra,(sp+4) 8008df4: 2b 8b 00 14 lw r11,(sp+20) 8008df8: 2b 8c 00 10 lw r12,(sp+16) 8008dfc: 2b 8d 00 0c lw r13,(sp+12) 8008e00: 2b 8e 00 08 lw r14,(sp+8) 8008e04: 37 9c 00 18 addi sp,sp,24 8008e08: c3 a0 00 00 ret =============================================================================== 08008ee8 : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008ee8: 37 9c ff e8 addi sp,sp,-24 8008eec: 5b 8b 00 14 sw (sp+20),r11 8008ef0: 5b 8c 00 10 sw (sp+16),r12 8008ef4: 5b 8d 00 0c sw (sp+12),r13 8008ef8: 5b 8e 00 08 sw (sp+8),r14 8008efc: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 8008f00: 34 05 00 09 mvi r5,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008f04: b8 20 68 00 mv r13,r1 8008f08: b8 40 58 00 mv r11,r2 8008f0c: b8 60 70 00 mv r14,r3 8008f10: b8 80 60 00 mv r12,r4 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8008f14: 44 40 00 1c be r2,r0,8008f84 return RTEMS_INVALID_ADDRESS; errno = 0; 8008f18: f8 00 0b c5 calli 800be2c <__errno> 8008f1c: 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 ); 8008f20: b9 80 18 00 mv r3,r12 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 8008f24: 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 ); 8008f28: b9 a0 08 00 mv r1,r13 8008f2c: 37 82 00 18 addi r2,sp,24 8008f30: f8 00 17 ad calli 800ede4 8008f34: b8 20 60 00 mv r12,r1 #endif /* If the user wants the end pointer back, then return it. */ if ( endptr ) 8008f38: 45 c0 00 03 be r14,r0,8008f44 *endptr = end; 8008f3c: 2b 81 00 18 lw r1,(sp+24) 8008f40: 59 c1 00 00 sw (r14+0),r1 /* nothing was converted */ if ( end == s ) 8008f44: 2b 81 00 18 lw r1,(sp+24) return RTEMS_NOT_DEFINED; 8008f48: 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 ) 8008f4c: 44 2d 00 0e be r1,r13,8008f84 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8008f50: 78 02 08 01 mvhi r2,0x801 8008f54: 38 42 eb 14 ori r2,r2,0xeb14 8008f58: 28 41 00 00 lw r1,(r2+0) 8008f5c: 45 81 00 03 be r12,r1,8008f68 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MIN /* there was an underflow */ if ( (result == STRING_TO_MIN) && (errno == ERANGE)) 8008f60: 78 01 80 00 mvhi r1,0x8000 8008f64: 5d 81 00 06 bne r12,r1,8008f7c 8008f68: f8 00 0b b1 calli 800be2c <__errno> 8008f6c: 28 22 00 00 lw r2,(r1+0) 8008f70: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 8008f74: 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)) 8008f78: 44 41 00 03 be r2,r1,8008f84 <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 8008f7c: 59 6c 00 00 sw (r11+0),r12 #endif return RTEMS_SUCCESSFUL; 8008f80: 34 05 00 00 mvi r5,0 } 8008f84: b8 a0 08 00 mv r1,r5 8008f88: 2b 9d 00 04 lw ra,(sp+4) 8008f8c: 2b 8b 00 14 lw r11,(sp+20) 8008f90: 2b 8c 00 10 lw r12,(sp+16) 8008f94: 2b 8d 00 0c lw r13,(sp+12) 8008f98: 2b 8e 00 08 lw r14,(sp+8) 8008f9c: 37 9c 00 18 addi sp,sp,24 8008fa0: c3 a0 00 00 ret =============================================================================== 08008e0c : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008e0c: 37 9c ff e4 addi sp,sp,-28 8008e10: 5b 8b 00 18 sw (sp+24),r11 8008e14: 5b 8c 00 14 sw (sp+20),r12 8008e18: 5b 8d 00 10 sw (sp+16),r13 8008e1c: 5b 8e 00 0c sw (sp+12),r14 8008e20: 5b 8f 00 08 sw (sp+8),r15 8008e24: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 8008e28: 34 05 00 09 mvi r5,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008e2c: b8 20 70 00 mv r14,r1 8008e30: b8 40 58 00 mv r11,r2 8008e34: b8 60 78 00 mv r15,r3 8008e38: b8 80 60 00 mv r12,r4 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8008e3c: 44 40 00 22 be r2,r0,8008ec4 return RTEMS_INVALID_ADDRESS; errno = 0; 8008e40: f8 00 0b fb calli 800be2c <__errno> 8008e44: 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 ); 8008e48: b9 80 18 00 mv r3,r12 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 8008e4c: 59 60 00 00 sw (r11+0),r0 8008e50: 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 ); 8008e54: b9 c0 08 00 mv r1,r14 8008e58: 37 82 00 1c addi r2,sp,28 8008e5c: f8 00 17 f0 calli 800ee1c 8008e60: b8 20 68 00 mv r13,r1 8008e64: b8 40 60 00 mv r12,r2 #endif /* If the user wants the end pointer back, then return it. */ if ( endptr ) 8008e68: 45 e0 00 03 be r15,r0,8008e74 *endptr = end; 8008e6c: 2b 81 00 1c lw r1,(sp+28) 8008e70: 59 e1 00 00 sw (r15+0),r1 /* nothing was converted */ if ( end == s ) 8008e74: 2b 81 00 1c lw r1,(sp+28) return RTEMS_NOT_DEFINED; 8008e78: 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 ) 8008e7c: 44 2e 00 12 be r1,r14,8008ec4 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8008e80: 78 02 08 01 mvhi r2,0x801 8008e84: 38 42 eb 14 ori r2,r2,0xeb14 8008e88: 28 41 00 00 lw r1,(r2+0) 8008e8c: 5d a1 00 03 bne r13,r1,8008e98 8008e90: 34 01 ff ff mvi r1,-1 8008e94: 45 81 00 04 be r12,r1,8008ea4 <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MIN /* there was an underflow */ if ( (result == STRING_TO_MIN) && (errno == ERANGE)) 8008e98: 78 01 80 00 mvhi r1,0x8000 8008e9c: 5d a1 00 07 bne r13,r1,8008eb8 8008ea0: 5d 80 00 06 bne r12,r0,8008eb8 <== NEVER TAKEN 8008ea4: f8 00 0b e2 calli 800be2c <__errno> 8008ea8: 28 22 00 00 lw r2,(r1+0) 8008eac: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 8008eb0: 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)) 8008eb4: 44 41 00 04 be r2,r1,8008ec4 <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 8008eb8: 59 6d 00 00 sw (r11+0),r13 8008ebc: 59 6c 00 04 sw (r11+4),r12 #endif return RTEMS_SUCCESSFUL; 8008ec0: 34 05 00 00 mvi r5,0 } 8008ec4: b8 a0 08 00 mv r1,r5 8008ec8: 2b 9d 00 04 lw ra,(sp+4) 8008ecc: 2b 8b 00 18 lw r11,(sp+24) 8008ed0: 2b 8c 00 14 lw r12,(sp+20) 8008ed4: 2b 8d 00 10 lw r13,(sp+16) 8008ed8: 2b 8e 00 0c lw r14,(sp+12) 8008edc: 2b 8f 00 08 lw r15,(sp+8) 8008ee0: 37 9c 00 1c addi sp,sp,28 8008ee4: c3 a0 00 00 ret =============================================================================== 08008fa4 : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008fa4: 37 9c ff e8 addi sp,sp,-24 8008fa8: 5b 8b 00 14 sw (sp+20),r11 8008fac: 5b 8c 00 10 sw (sp+16),r12 8008fb0: 5b 8d 00 0c sw (sp+12),r13 8008fb4: 5b 8e 00 08 sw (sp+8),r14 8008fb8: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 8008fbc: 34 04 00 09 mvi r4,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8008fc0: b8 20 68 00 mv r13,r1 8008fc4: b8 40 58 00 mv r11,r2 8008fc8: b8 60 70 00 mv r14,r3 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8008fcc: 44 40 00 18 be r2,r0,800902c <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; errno = 0; 8008fd0: f8 00 0b 97 calli 800be2c <__errno> 8008fd4: 58 20 00 00 sw (r1+0),r0 *n = 0; 8008fd8: 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 ); 8008fdc: b9 a0 08 00 mv r1,r13 8008fe0: 37 82 00 18 addi r2,sp,24 8008fe4: 34 03 00 10 mvi r3,16 8008fe8: f8 00 18 f8 calli 800f3c8 8008fec: 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 ) 8008ff0: 45 c0 00 03 be r14,r0,8008ffc *endptr = end; 8008ff4: 2b 81 00 18 lw r1,(sp+24) 8008ff8: 59 c1 00 00 sw (r14+0),r1 /* nothing was converted */ if ( end == s ) 8008ffc: 2b 81 00 18 lw r1,(sp+24) return RTEMS_NOT_DEFINED; 8009000: 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 ) 8009004: 44 2d 00 0a be r1,r13,800902c return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8009008: 34 01 ff ff mvi r1,-1 800900c: 5d 81 00 06 bne r12,r1,8009024 <== ALWAYS TAKEN 8009010: f8 00 0b 87 calli 800be2c <__errno> <== NOT EXECUTED 8009014: 28 22 00 00 lw r2,(r1+0) <== NOT EXECUTED 8009018: 34 01 00 22 mvi r1,34 <== NOT EXECUTED return RTEMS_INVALID_NUMBER; 800901c: 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)) 8009020: 44 41 00 03 be r2,r1,800902c <== 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; 8009024: 59 6c 00 00 sw (r11+0),r12 #else *n = (STRING_TO_TYPE) result; #endif return RTEMS_SUCCESSFUL; 8009028: 34 04 00 00 mvi r4,0 } 800902c: b8 80 08 00 mv r1,r4 8009030: 2b 9d 00 04 lw ra,(sp+4) 8009034: 2b 8b 00 14 lw r11,(sp+20) 8009038: 2b 8c 00 10 lw r12,(sp+16) 800903c: 2b 8d 00 0c lw r13,(sp+12) 8009040: 2b 8e 00 08 lw r14,(sp+8) 8009044: 37 9c 00 18 addi sp,sp,24 8009048: c3 a0 00 00 ret =============================================================================== 080090dc : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 80090dc: 37 9c ff e8 addi sp,sp,-24 80090e0: 5b 8b 00 14 sw (sp+20),r11 80090e4: 5b 8c 00 10 sw (sp+16),r12 80090e8: 5b 8d 00 0c sw (sp+12),r13 80090ec: 5b 8e 00 08 sw (sp+8),r14 80090f0: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 80090f4: 34 05 00 09 mvi r5,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 80090f8: b8 20 68 00 mv r13,r1 80090fc: b8 40 58 00 mv r11,r2 8009100: b8 60 70 00 mv r14,r3 8009104: b8 80 60 00 mv r12,r4 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8009108: 44 40 00 18 be r2,r0,8009168 return RTEMS_INVALID_ADDRESS; errno = 0; 800910c: f8 00 0b 48 calli 800be2c <__errno> 8009110: 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 ); 8009114: b9 80 18 00 mv r3,r12 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 8009118: 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 ); 800911c: b9 a0 08 00 mv r1,r13 8009120: 37 82 00 18 addi r2,sp,24 8009124: f8 00 18 a9 calli 800f3c8 8009128: b8 20 60 00 mv r12,r1 #endif /* If the user wants the end pointer back, then return it. */ if ( endptr ) 800912c: 45 c0 00 03 be r14,r0,8009138 *endptr = end; 8009130: 2b 81 00 18 lw r1,(sp+24) 8009134: 59 c1 00 00 sw (r14+0),r1 /* nothing was converted */ if ( end == s ) 8009138: 2b 81 00 18 lw r1,(sp+24) return RTEMS_NOT_DEFINED; 800913c: 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 ) 8009140: 44 2d 00 0a be r1,r13,8009168 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 8009144: 34 01 ff ff mvi r1,-1 8009148: 5d 81 00 06 bne r12,r1,8009160 800914c: f8 00 0b 38 calli 800be2c <__errno> 8009150: 28 22 00 00 lw r2,(r1+0) 8009154: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 8009158: 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)) 800915c: 44 41 00 03 be r2,r1,8009168 <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 8009160: 59 6c 00 00 sw (r11+0),r12 #endif return RTEMS_SUCCESSFUL; 8009164: 34 05 00 00 mvi r5,0 } 8009168: b8 a0 08 00 mv r1,r5 800916c: 2b 9d 00 04 lw ra,(sp+4) 8009170: 2b 8b 00 14 lw r11,(sp+20) 8009174: 2b 8c 00 10 lw r12,(sp+16) 8009178: 2b 8d 00 0c lw r13,(sp+12) 800917c: 2b 8e 00 08 lw r14,(sp+8) 8009180: 37 9c 00 18 addi sp,sp,24 8009184: c3 a0 00 00 ret =============================================================================== 0800924c : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 800924c: 37 9c ff e8 addi sp,sp,-24 8009250: 5b 8b 00 14 sw (sp+20),r11 8009254: 5b 8c 00 10 sw (sp+16),r12 8009258: 5b 8d 00 0c sw (sp+12),r13 800925c: 5b 8e 00 08 sw (sp+8),r14 8009260: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 8009264: 34 05 00 09 mvi r5,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8009268: b8 20 68 00 mv r13,r1 800926c: b8 40 58 00 mv r11,r2 8009270: b8 60 70 00 mv r14,r3 8009274: b8 80 60 00 mv r12,r4 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 8009278: 44 40 00 18 be r2,r0,80092d8 return RTEMS_INVALID_ADDRESS; errno = 0; 800927c: f8 00 0a ec calli 800be2c <__errno> 8009280: 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 ); 8009284: b9 80 18 00 mv r3,r12 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 8009288: 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 ); 800928c: b9 a0 08 00 mv r1,r13 8009290: 37 82 00 18 addi r2,sp,24 8009294: f8 00 18 4d calli 800f3c8 8009298: b8 20 60 00 mv r12,r1 #endif /* If the user wants the end pointer back, then return it. */ if ( endptr ) 800929c: 45 c0 00 03 be r14,r0,80092a8 *endptr = end; 80092a0: 2b 81 00 18 lw r1,(sp+24) 80092a4: 59 c1 00 00 sw (r14+0),r1 /* nothing was converted */ if ( end == s ) 80092a8: 2b 81 00 18 lw r1,(sp+24) return RTEMS_NOT_DEFINED; 80092ac: 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 ) 80092b0: 44 2d 00 0a be r1,r13,80092d8 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 80092b4: 34 01 ff ff mvi r1,-1 80092b8: 5d 81 00 06 bne r12,r1,80092d0 80092bc: f8 00 0a dc calli 800be2c <__errno> 80092c0: 28 22 00 00 lw r2,(r1+0) 80092c4: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 80092c8: 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)) 80092cc: 44 41 00 03 be r2,r1,80092d8 <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 80092d0: 59 6c 00 00 sw (r11+0),r12 #endif return RTEMS_SUCCESSFUL; 80092d4: 34 05 00 00 mvi r5,0 } 80092d8: b8 a0 08 00 mv r1,r5 80092dc: 2b 9d 00 04 lw ra,(sp+4) 80092e0: 2b 8b 00 14 lw r11,(sp+20) 80092e4: 2b 8c 00 10 lw r12,(sp+16) 80092e8: 2b 8d 00 0c lw r13,(sp+12) 80092ec: 2b 8e 00 08 lw r14,(sp+8) 80092f0: 37 9c 00 18 addi sp,sp,24 80092f4: c3 a0 00 00 ret =============================================================================== 08009188 : #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 8009188: 37 9c ff e4 addi sp,sp,-28 800918c: 5b 8b 00 18 sw (sp+24),r11 8009190: 5b 8c 00 14 sw (sp+20),r12 8009194: 5b 8d 00 10 sw (sp+16),r13 8009198: 5b 8e 00 0c sw (sp+12),r14 800919c: 5b 8f 00 08 sw (sp+8),r15 80091a0: 5b 9d 00 04 sw (sp+4),ra STRING_TO_INPUT_TYPE result; char *end; if ( !n ) return RTEMS_INVALID_ADDRESS; 80091a4: 34 05 00 09 mvi r5,9 #if defined(STRING_TO_INTEGER) && !defined(STRING_TO_POINTER) , int base #endif ) { 80091a8: b8 20 70 00 mv r14,r1 80091ac: b8 40 58 00 mv r11,r2 80091b0: b8 60 78 00 mv r15,r3 80091b4: b8 80 60 00 mv r12,r4 STRING_TO_INPUT_TYPE result; char *end; if ( !n ) 80091b8: 44 40 00 1c be r2,r0,8009228 return RTEMS_INVALID_ADDRESS; errno = 0; 80091bc: f8 00 0b 1c calli 800be2c <__errno> 80091c0: 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 ); 80091c4: b9 80 18 00 mv r3,r12 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 80091c8: 59 60 00 00 sw (r11+0),r0 80091cc: 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 ); 80091d0: b9 c0 08 00 mv r1,r14 80091d4: 37 82 00 1c addi r2,sp,28 80091d8: f8 00 18 8a calli 800f400 80091dc: b8 20 60 00 mv r12,r1 80091e0: b8 40 68 00 mv r13,r2 #endif /* If the user wants the end pointer back, then return it. */ if ( endptr ) 80091e4: 45 e0 00 03 be r15,r0,80091f0 *endptr = end; 80091e8: 2b 81 00 1c lw r1,(sp+28) 80091ec: 59 e1 00 00 sw (r15+0),r1 /* nothing was converted */ if ( end == s ) 80091f0: 2b 81 00 1c lw r1,(sp+28) return RTEMS_NOT_DEFINED; 80091f4: 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 ) 80091f8: 44 2e 00 0c be r1,r14,8009228 return RTEMS_INVALID_NUMBER; #endif #ifdef STRING_TO_MAX /* there was an overflow */ if ( (result == STRING_TO_MAX) && (errno == ERANGE)) 80091fc: 34 01 ff ff mvi r1,-1 8009200: 5d 81 00 07 bne r12,r1,800921c 8009204: 5d ac 00 06 bne r13,r12,800921c <== NEVER TAKEN 8009208: f8 00 0b 09 calli 800be2c <__errno> 800920c: 28 22 00 00 lw r2,(r1+0) 8009210: 34 01 00 22 mvi r1,34 return RTEMS_INVALID_NUMBER; 8009214: 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)) 8009218: 44 41 00 04 be r2,r1,8009228 <== ALWAYS TAKEN #endif #if defined(STRING_TO_POINTER) *n = (STRING_TO_TYPE) (uintptr_t)result; #else *n = (STRING_TO_TYPE) result; 800921c: 59 6c 00 00 sw (r11+0),r12 8009220: 59 6d 00 04 sw (r11+4),r13 #endif return RTEMS_SUCCESSFUL; 8009224: 34 05 00 00 mvi r5,0 } 8009228: b8 a0 08 00 mv r1,r5 800922c: 2b 9d 00 04 lw ra,(sp+4) 8009230: 2b 8b 00 18 lw r11,(sp+24) 8009234: 2b 8c 00 14 lw r12,(sp+20) 8009238: 2b 8d 00 10 lw r13,(sp+16) 800923c: 2b 8e 00 0c lw r14,(sp+12) 8009240: 2b 8f 00 08 lw r15,(sp+8) 8009244: 37 9c 00 1c addi sp,sp,28 8009248: c3 a0 00 00 ret =============================================================================== 08000bf0 : int rtems_tarfs_load( char *mountpoint, uint8_t *tar_image, size_t tar_size ) { 8000bf0: 37 9c fe 20 addi sp,sp,-480 8000bf4: 5b 8b 00 44 sw (sp+68),r11 8000bf8: 5b 8c 00 40 sw (sp+64),r12 8000bfc: 5b 8d 00 3c sw (sp+60),r13 8000c00: 5b 8e 00 38 sw (sp+56),r14 8000c04: 5b 8f 00 34 sw (sp+52),r15 8000c08: 5b 90 00 30 sw (sp+48),r16 8000c0c: 5b 91 00 2c sw (sp+44),r17 8000c10: 5b 92 00 28 sw (sp+40),r18 8000c14: 5b 93 00 24 sw (sp+36),r19 8000c18: 5b 94 00 20 sw (sp+32),r20 8000c1c: 5b 95 00 1c sw (sp+28),r21 8000c20: 5b 96 00 18 sw (sp+24),r22 8000c24: 5b 97 00 14 sw (sp+20),r23 8000c28: 5b 98 00 10 sw (sp+16),r24 8000c2c: 5b 99 00 0c sw (sp+12),r25 8000c30: 5b 9b 00 08 sw (sp+8),fp 8000c34: 5b 9d 00 04 sw (sp+4),ra 8000c38: b8 20 98 00 mv r19,r1 8000c3c: b8 40 a0 00 mv r20,r2 8000c40: 5b 83 00 50 sw (sp+80),r3 int offset; unsigned long nblocks; IMFS_jnode_t *node; int status; status = rtems_filesystem_evaluate_path( 8000c44: f8 00 3a 10 calli 800f484 8000c48: b8 20 10 00 mv r2,r1 8000c4c: 34 03 00 00 mvi r3,0 8000c50: ba 60 08 00 mv r1,r19 8000c54: 37 84 01 cc addi r4,sp,460 8000c58: 34 05 00 00 mvi r5,0 8000c5c: f8 00 03 57 calli 80019b8 8000c60: b8 20 60 00 mv r12,r1 strlen(mountpoint), 0, &root_loc, 0 ); if (status != 0) 8000c64: 5c 20 00 71 bne r1,r0,8000e28 <== NEVER TAKEN return -1; if (root_loc.ops != &IMFS_ops 8000c68: 2b 81 01 d8 lw r1,(sp+472) 8000c6c: 78 04 08 01 mvhi r4,0x801 8000c70: 38 84 eb 80 ori r4,r4,0xeb80 8000c74: 34 0b 00 00 mvi r11,0 8000c78: 44 24 00 08 be r1,r4,8000c98 <== ALWAYS TAKEN && root_loc.ops != &fifoIMFS_ops) 8000c7c: 78 04 08 01 mvhi r4,0x801 <== NOT EXECUTED 8000c80: 38 84 f3 f8 ori r4,r4,0xf3f8 <== NOT EXECUTED 8000c84: b9 80 58 00 mv r11,r12 <== NOT EXECUTED 8000c88: 5c 24 00 68 bne r1,r4,8000e28 <== NOT EXECUTED 8000c8c: e0 00 00 03 bi 8000c98 <== NOT EXECUTED 8000c90: b9 c0 58 00 mv r11,r14 8000c94: e0 00 00 0c bi 8000cc4 /* * Read a header. */ hdr_ptr = (char *) &tar_image[offset]; offset += 512; if (strncmp(&hdr_ptr[257], "ustar ", 7)) 8000c98: 78 11 08 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, "/"); 8000c9c: 78 0f 08 01 mvhi r15,0x801 /* * Read a header. */ hdr_ptr = (char *) &tar_image[offset]; offset += 512; if (strncmp(&hdr_ptr[257], "ustar ", 7)) 8000ca0: 3a 31 eb c8 ori r17,r17,0xebc8 break; strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); 8000ca4: 37 90 01 54 addi r16,sp,340 * IMFS_create_node was ONLY passed a NULL when we created the * root node. We added a new IMFS_create_root_node() so this * path no longer existed. The result was simpler code which * should not have this path. */ else if (linkflag == REGTYPE) { 8000ca8: 34 1b 00 30 mvi fp,48 const char *name; loc = root_loc; if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { 8000cac: 37 92 01 b8 addi r18,sp,440 ); node->info.linearfile.size = file_size; node->info.linearfile.direct = &tar_image[offset]; } nblocks = (((file_size) + 511) & ~511) / 512; 8000cb0: 34 19 fe 00 mvi r25,-512 * - For directories, just create directories as usual. IMFS * will take care of the rest. * - For files, create a file node with special tarfs properties. */ if (linkflag == DIRTYPE) { strcpy(full_filename, mountpoint); 8000cb4: 37 8d 00 54 addi r13,sp,84 if (full_filename[strlen(full_filename)-1] != '/') 8000cb8: 37 98 00 53 addi r24,sp,83 8000cbc: 34 17 00 2f mvi r23,47 strcat(full_filename, "/"); 8000cc0: 39 ef c1 24 ori r15,r15,0xc124 /* * Create an IMFS node structure pointing to tar image memory. */ offset = 0; while (1) { if (offset + 512 > tar_size) 8000cc4: 2b 81 00 50 lw r1,(sp+80) 8000cc8: 35 6e 02 00 addi r14,r11,512 8000ccc: 55 c1 00 58 bgu r14,r1,8000e2c <== NEVER TAKEN break; /* * Read a header. */ hdr_ptr = (char *) &tar_image[offset]; 8000cd0: b6 8b 58 00 add r11,r20,r11 offset += 512; if (strncmp(&hdr_ptr[257], "ustar ", 7)) 8000cd4: 35 61 01 01 addi r1,r11,257 8000cd8: ba 20 10 00 mv r2,r17 8000cdc: 34 03 00 07 mvi r3,7 8000ce0: f8 00 3a 18 calli 800f540 8000ce4: 5c 20 00 52 bne r1,r0,8000e2c break; strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); 8000ce8: 34 03 00 63 mvi r3,99 8000cec: b9 60 10 00 mv r2,r11 8000cf0: ba 00 08 00 mv r1,r16 8000cf4: f8 00 3a 60 calli 800f674 filename[MAX_NAME_FIELD_SIZE] = '\0'; linkflag = hdr_ptr[156]; file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8); 8000cf8: 34 02 00 08 mvi r2,8 offset += 512; if (strncmp(&hdr_ptr[257], "ustar ", 7)) break; strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); filename[MAX_NAME_FIELD_SIZE] = '\0'; 8000cfc: 33 80 01 b7 sb (sp+439),r0 linkflag = hdr_ptr[156]; file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8); 8000d00: 35 61 00 64 addi r1,r11,100 break; strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); filename[MAX_NAME_FIELD_SIZE] = '\0'; linkflag = hdr_ptr[156]; 8000d04: 41 76 00 9c lbu r22,(r11+156) file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8); 8000d08: f8 00 19 93 calli 8007354 <_rtems_octal2ulong> 8000d0c: 5b 81 00 4c sw (sp+76),r1 file_size = _rtems_octal2ulong(&hdr_ptr[124], 12); 8000d10: 34 02 00 0c mvi r2,12 8000d14: 35 61 00 7c addi r1,r11,124 8000d18: f8 00 19 8f calli 8007354 <_rtems_octal2ulong> hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8); 8000d1c: 34 02 00 08 mvi r2,8 strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); filename[MAX_NAME_FIELD_SIZE] = '\0'; linkflag = hdr_ptr[156]; file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8); file_size = _rtems_octal2ulong(&hdr_ptr[124], 12); 8000d20: b8 20 a8 00 mv r21,r1 hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8); 8000d24: 35 61 00 94 addi r1,r11,148 8000d28: f8 00 19 8b calli 8007354 <_rtems_octal2ulong> 8000d2c: b8 20 10 00 mv r2,r1 if (_rtems_tar_header_checksum(hdr_ptr) != hdr_chksum) 8000d30: b9 60 08 00 mv r1,r11 8000d34: 5b 82 00 48 sw (sp+72),r2 8000d38: f8 00 19 a6 calli 80073d0 <_rtems_tar_header_checksum> 8000d3c: 2b 82 00 48 lw r2,(sp+72) 8000d40: 5c 22 00 3b bne r1,r2,8000e2c <== NEVER TAKEN * Generate an IMFS node depending on the file type. * - For directories, just create directories as usual. IMFS * will take care of the rest. * - For files, create a file node with special tarfs properties. */ if (linkflag == DIRTYPE) { 8000d44: 34 01 00 35 mvi r1,53 8000d48: 5e c1 00 13 bne r22,r1,8000d94 strcpy(full_filename, mountpoint); 8000d4c: ba 60 10 00 mv r2,r19 8000d50: b9 a0 08 00 mv r1,r13 8000d54: f8 00 38 98 calli 800efb4 if (full_filename[strlen(full_filename)-1] != '/') 8000d58: b9 a0 08 00 mv r1,r13 8000d5c: f8 00 39 ca calli 800f484 8000d60: b7 01 08 00 add r1,r24,r1 8000d64: 40 21 00 00 lbu r1,(r1+0) 8000d68: 44 37 00 04 be r1,r23,8000d78 <== ALWAYS TAKEN strcat(full_filename, "/"); 8000d6c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8000d70: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED 8000d74: f8 00 38 39 calli 800ee58 <== NOT EXECUTED strcat(full_filename, filename); 8000d78: ba 00 10 00 mv r2,r16 8000d7c: b9 a0 08 00 mv r1,r13 8000d80: f8 00 38 36 calli 800ee58 mkdir(full_filename, S_IRWXU | S_IRWXG | S_IRWXO); 8000d84: b9 a0 08 00 mv r1,r13 8000d88: 34 02 01 ff mvi r2,511 8000d8c: f8 00 05 bf calli 8002488 8000d90: e3 ff ff c0 bi 8000c90 * IMFS_create_node was ONLY passed a NULL when we created the * root node. We added a new IMFS_create_root_node() so this * path no longer existed. The result was simpler code which * should not have this path. */ else if (linkflag == REGTYPE) { 8000d94: 5e db ff bf bne r22,fp,8000c90 const char *name; loc = root_loc; 8000d98: 2b 81 01 cc lw r1,(sp+460) if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { 8000d9c: ba 40 10 00 mv r2,r18 8000da0: 37 83 01 e0 addi r3,sp,480 * should not have this path. */ else if (linkflag == REGTYPE) { const char *name; loc = root_loc; 8000da4: 5b 81 01 b8 sw (sp+440),r1 8000da8: 2b 81 01 d0 lw r1,(sp+464) 8000dac: 5b 81 01 bc sw (sp+444),r1 8000db0: 2b 81 01 d4 lw r1,(sp+468) 8000db4: 5b 81 01 c0 sw (sp+448),r1 8000db8: 2b 81 01 d8 lw r1,(sp+472) 8000dbc: 5b 81 01 c4 sw (sp+452),r1 8000dc0: 2b 81 01 dc lw r1,(sp+476) 8000dc4: 5b 81 01 c8 sw (sp+456),r1 if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { 8000dc8: ba 00 08 00 mv r1,r16 8000dcc: f8 00 1d 29 calli 8008270 8000dd0: 5c 20 00 0e bne r1,r0,8000e08 <== NEVER TAKEN node = IMFS_create_node( &loc, IMFS_LINEAR_FILE, (char *)name, (file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG, 8000dd4: 2b 81 00 4c lw r1,(sp+76) else if (linkflag == REGTYPE) { const char *name; loc = root_loc; if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { node = IMFS_create_node( 8000dd8: 2b 83 01 e0 lw r3,(sp+480) 8000ddc: 34 02 00 06 mvi r2,6 &loc, IMFS_LINEAR_FILE, (char *)name, (file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG, 8000de0: 20 24 01 ff andi r4,r1,0x1ff else if (linkflag == REGTYPE) { const char *name; loc = root_loc; if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { node = IMFS_create_node( 8000de4: 38 84 80 00 ori r4,r4,0x8000 8000de8: ba 40 08 00 mv r1,r18 8000dec: 34 05 00 00 mvi r5,0 8000df0: f8 00 1b 31 calli 8007ab4 8000df4: b8 20 20 00 mv r4,r1 &loc, IMFS_LINEAR_FILE, (char *)name, (file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG, NULL ); node->info.linearfile.size = file_size; 8000df8: 58 20 00 50 sw (r1+80),r0 8000dfc: 58 35 00 54 sw (r1+84),r21 node->info.linearfile.direct = &tar_image[offset]; 8000e00: b6 8e 08 00 add r1,r20,r14 8000e04: 58 81 00 58 sw (r4+88),r1 } nblocks = (((file_size) + 511) & ~511) / 512; 8000e08: 36 a1 01 ff addi r1,r21,511 8000e0c: 34 02 00 09 mvi r2,9 8000e10: a0 39 08 00 and r1,r1,r25 8000e14: f8 00 6a 24 calli 801b6a4 <__lshrsi3> offset += 512 * nblocks; 8000e18: 34 02 00 09 mvi r2,9 8000e1c: f8 00 69 d4 calli 801b56c <__ashlsi3> 8000e20: b4 2e 70 00 add r14,r1,r14 8000e24: e3 ff ff 9b bi 8000c90 if (status != 0) return -1; if (root_loc.ops != &IMFS_ops && root_loc.ops != &fifoIMFS_ops) return -1; 8000e28: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED nblocks = (((file_size) + 511) & ~511) / 512; offset += 512 * nblocks; } } return status; } 8000e2c: b9 80 08 00 mv r1,r12 8000e30: 2b 9d 00 04 lw ra,(sp+4) 8000e34: 2b 8b 00 44 lw r11,(sp+68) 8000e38: 2b 8c 00 40 lw r12,(sp+64) 8000e3c: 2b 8d 00 3c lw r13,(sp+60) 8000e40: 2b 8e 00 38 lw r14,(sp+56) 8000e44: 2b 8f 00 34 lw r15,(sp+52) 8000e48: 2b 90 00 30 lw r16,(sp+48) 8000e4c: 2b 91 00 2c lw r17,(sp+44) 8000e50: 2b 92 00 28 lw r18,(sp+40) 8000e54: 2b 93 00 24 lw r19,(sp+36) 8000e58: 2b 94 00 20 lw r20,(sp+32) 8000e5c: 2b 95 00 1c lw r21,(sp+28) 8000e60: 2b 96 00 18 lw r22,(sp+24) 8000e64: 2b 97 00 14 lw r23,(sp+20) 8000e68: 2b 98 00 10 lw r24,(sp+16) 8000e6c: 2b 99 00 0c lw r25,(sp+12) 8000e70: 2b 9b 00 08 lw fp,(sp+8) 8000e74: 37 9c 01 e0 addi sp,sp,480 8000e78: c3 a0 00 00 ret =============================================================================== 0800adc4 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 800adc4: 37 9c ff e0 addi sp,sp,-32 800adc8: 5b 8b 00 20 sw (sp+32),r11 800adcc: 5b 8c 00 1c sw (sp+28),r12 800add0: 5b 8d 00 18 sw (sp+24),r13 800add4: 5b 8e 00 14 sw (sp+20),r14 800add8: 5b 8f 00 10 sw (sp+16),r15 800addc: 5b 90 00 0c sw (sp+12),r16 800ade0: 5b 91 00 08 sw (sp+8),r17 800ade4: 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; 800ade8: 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 ) { 800adec: b8 20 68 00 mv r13,r1 800adf0: b8 40 70 00 mv r14,r2 800adf4: 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 ) 800adf8: 44 60 00 55 be r3,r0,800af4c return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 800adfc: 78 01 08 01 mvhi r1,0x801 800ae00: 38 21 39 e8 ori r1,r1,0x39e8 800ae04: 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; 800ae08: 41 8f 00 74 lbu r15,(r12+116) if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 800ae0c: 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 ]; 800ae10: 29 8b 01 24 lw r11,(r12+292) asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 800ae14: 65 ef 00 00 cmpei r15,r15,0 800ae18: c8 0f 78 00 sub r15,r0,r15 800ae1c: 21 ef 01 00 andi r15,r15,0x100 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 800ae20: 44 20 00 02 be r1,r0,800ae28 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 800ae24: 39 ef 02 00 ori r15,r15,0x200 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 800ae28: 41 71 00 08 lbu r17,(r11+8) old_mode |= _ISR_Get_level(); 800ae2c: fb ff ef 36 calli 8006b04 <_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; 800ae30: 66 31 00 00 cmpei r17,r17,0 800ae34: c8 11 88 00 sub r17,r0,r17 800ae38: 22 31 04 00 andi r17,r17,0x400 800ae3c: ba 21 08 00 or r1,r17,r1 old_mode |= _ISR_Get_level(); 800ae40: b8 2f 78 00 or r15,r1,r15 *previous_mode_set = old_mode; 800ae44: 5a 0f 00 00 sw (r16+0),r15 /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 800ae48: 21 c1 01 00 andi r1,r14,0x100 800ae4c: 44 20 00 04 be r1,r0,800ae5c */ RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt ( Modes_Control mode_set ) { return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT; 800ae50: 21 a1 01 00 andi r1,r13,0x100 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 800ae54: 64 21 00 00 cmpei r1,r1,0 800ae58: 31 81 00 74 sb (r12+116),r1 if ( mask & RTEMS_TIMESLICE_MASK ) { 800ae5c: 21 c1 02 00 andi r1,r14,0x200 800ae60: 44 20 00 0b be r1,r0,800ae8c */ RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice ( Modes_Control mode_set ) { return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE; 800ae64: 21 a1 02 00 andi r1,r13,0x200 if ( _Modes_Is_timeslice(mode_set) ) { 800ae68: 44 20 00 08 be r1,r0,800ae88 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 800ae6c: 34 01 00 01 mvi r1,1 800ae70: 59 81 00 7c sw (r12+124),r1 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 800ae74: 78 01 08 01 mvhi r1,0x801 800ae78: 38 21 37 b4 ori r1,r1,0x37b4 800ae7c: 28 21 00 00 lw r1,(r1+0) 800ae80: 59 81 00 78 sw (r12+120),r1 800ae84: e0 00 00 02 bi 800ae8c } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 800ae88: 59 80 00 7c sw (r12+124),r0 /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 800ae8c: 21 c1 00 01 andi r1,r14,0x1 800ae90: 44 20 00 04 be r1,r0,800aea0 */ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level ( Modes_Control mode_set ) { return ( mode_set & RTEMS_INTERRUPT_MASK ); 800ae94: 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 ) ); 800ae98: 64 21 00 00 cmpei r1,r1,0 800ae9c: d0 01 00 00 wcsr IE,r1 */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 800aea0: 21 ce 04 00 andi r14,r14,0x400 /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 800aea4: 34 03 00 00 mvi r3,0 if ( mask & RTEMS_ASR_MASK ) { 800aea8: 45 c0 00 11 be r14,r0,800aeec */ RTEMS_INLINE_ROUTINE bool _Modes_Is_asr_disabled ( Modes_Control mode_set ) { return (mode_set & RTEMS_ASR_MASK) == RTEMS_NO_ASR; 800aeac: 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 ) { 800aeb0: 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( 800aeb4: 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 ) { 800aeb8: 44 2d 00 0d be r1,r13,800aeec asr->is_enabled = is_asr_enabled; 800aebc: 31 6d 00 08 sb (r11+8),r13 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 800aec0: 90 00 08 00 rcsr r1,IE 800aec4: 34 02 ff fe mvi r2,-2 800aec8: a0 22 10 00 and r2,r1,r2 800aecc: d0 02 00 00 wcsr IE,r2 _signals = information->signals_pending; 800aed0: 29 62 00 18 lw r2,(r11+24) information->signals_pending = information->signals_posted; 800aed4: 29 63 00 14 lw r3,(r11+20) information->signals_posted = _signals; 800aed8: 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; 800aedc: 59 63 00 18 sw (r11+24),r3 information->signals_posted = _signals; _ISR_Enable( _level ); 800aee0: d0 01 00 00 wcsr IE,r1 _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { 800aee4: 29 63 00 14 lw r3,(r11+20) /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 800aee8: 7c 63 00 00 cmpnei r3,r3,0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) 800aeec: 78 01 08 01 mvhi r1,0x801 800aef0: 38 21 39 9c ori r1,r1,0x399c 800aef4: 28 22 00 00 lw r2,(r1+0) 800aef8: 34 01 00 03 mvi r1,3 if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) _Thread_Dispatch(); return RTEMS_SUCCESSFUL; 800aefc: 34 04 00 00 mvi r4,0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) 800af00: 5c 41 00 13 bne r2,r1,800af4c <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE bool _Thread_Evaluate_mode( void ) { Thread_Control *executing; executing = _Thread_Executing; 800af04: 78 02 08 01 mvhi r2,0x801 800af08: 38 42 39 e8 ori r2,r2,0x39e8 800af0c: 28 41 00 0c lw r1,(r2+12) if ( !_States_Is_ready( executing->current_state ) || 800af10: 28 24 00 10 lw r4,(r1+16) 800af14: 5c 80 00 05 bne r4,r0,800af28 <== NEVER TAKEN 800af18: 28 42 00 10 lw r2,(r2+16) 800af1c: 44 22 00 08 be r1,r2,800af3c ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { 800af20: 40 21 00 74 lbu r1,(r1+116) 800af24: 44 20 00 06 be r1,r0,800af3c <== NEVER TAKEN _Context_Switch_necessary = true; 800af28: 78 01 08 01 mvhi r1,0x801 800af2c: 38 21 39 e8 ori r1,r1,0x39e8 800af30: 34 02 00 01 mvi r2,1 800af34: 30 22 00 18 sb (r1+24),r2 800af38: e0 00 00 03 bi 800af44 if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) _Thread_Dispatch(); return RTEMS_SUCCESSFUL; 800af3c: 34 04 00 00 mvi r4,0 } } } if ( _System_state_Is_up( _System_state_Get() ) ) if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) 800af40: 44 60 00 03 be r3,r0,800af4c _Thread_Dispatch(); 800af44: fb ff e7 f1 calli 8004f08 <_Thread_Dispatch> return RTEMS_SUCCESSFUL; 800af48: 34 04 00 00 mvi r4,0 } 800af4c: b8 80 08 00 mv r1,r4 800af50: 2b 9d 00 04 lw ra,(sp+4) 800af54: 2b 8b 00 20 lw r11,(sp+32) 800af58: 2b 8c 00 1c lw r12,(sp+28) 800af5c: 2b 8d 00 18 lw r13,(sp+24) 800af60: 2b 8e 00 14 lw r14,(sp+20) 800af64: 2b 8f 00 10 lw r15,(sp+16) 800af68: 2b 90 00 0c lw r16,(sp+12) 800af6c: 2b 91 00 08 lw r17,(sp+8) 800af70: 37 9c 00 20 addi sp,sp,32 800af74: c3 a0 00 00 ret =============================================================================== 08008538 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 8008538: 37 9c ff f0 addi sp,sp,-16 800853c: 5b 8b 00 0c sw (sp+12),r11 8008540: 5b 8c 00 08 sw (sp+8),r12 8008544: 5b 9d 00 04 sw (sp+4),ra 8008548: b8 40 58 00 mv r11,r2 800854c: b8 60 60 00 mv r12,r3 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 8008550: 44 40 00 06 be r2,r0,8008568 RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && ( the_priority <= RTEMS_MAXIMUM_PRIORITY ) ); 8008554: 78 02 08 01 mvhi r2,0x801 8008558: 38 42 90 c0 ori r2,r2,0x90c0 800855c: 40 43 00 00 lbu r3,(r2+0) !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; 8008560: 34 02 00 13 mvi r2,19 ) { register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 8008564: 55 63 00 16 bgu r11,r3,80085bc !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) return RTEMS_INVALID_ADDRESS; 8008568: 34 02 00 09 mvi r2,9 if ( new_priority != RTEMS_CURRENT_PRIORITY && !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 800856c: 45 80 00 14 be r12,r0,80085bc return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 8008570: 37 82 00 10 addi r2,sp,16 8008574: f8 00 09 78 calli 800ab54 <_Thread_Get> switch ( location ) { 8008578: 2b 82 00 10 lw r2,(sp+16) 800857c: 5c 40 00 0f bne r2,r0,80085b8 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 8008580: 28 23 00 14 lw r3,(r1+20) 8008584: 59 83 00 00 sw (r12+0),r3 if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 8008588: 45 62 00 09 be r11,r2,80085ac the_thread->real_priority = new_priority; if ( the_thread->resource_count == 0 || 800858c: 28 22 00 1c lw r2,(r1+28) case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; if ( new_priority != RTEMS_CURRENT_PRIORITY ) { the_thread->real_priority = new_priority; 8008590: 58 2b 00 18 sw (r1+24),r11 if ( the_thread->resource_count == 0 || 8008594: 44 40 00 03 be r2,r0,80085a0 8008598: 28 22 00 14 lw r2,(r1+20) 800859c: 51 62 00 04 bgeu r11,r2,80085ac <== ALWAYS TAKEN the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 80085a0: b9 60 10 00 mv r2,r11 80085a4: 34 03 00 00 mvi r3,0 80085a8: f8 00 07 d9 calli 800a50c <_Thread_Change_priority> } _Thread_Enable_dispatch(); 80085ac: f8 00 09 5d calli 800ab20 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 80085b0: 34 02 00 00 mvi r2,0 80085b4: e0 00 00 02 bi 80085bc case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 80085b8: 34 02 00 04 mvi r2,4 } 80085bc: b8 40 08 00 mv r1,r2 80085c0: 2b 9d 00 04 lw ra,(sp+4) 80085c4: 2b 8b 00 0c lw r11,(sp+12) 80085c8: 2b 8c 00 08 lw r12,(sp+8) 80085cc: 37 9c 00 10 addi sp,sp,16 80085d0: c3 a0 00 00 ret =============================================================================== 08002f64 : rtems_status_code rtems_task_start( rtems_id id, rtems_task_entry entry_point, rtems_task_argument argument ) { 8002f64: 37 9c ff ec addi sp,sp,-20 8002f68: 5b 8b 00 10 sw (sp+16),r11 8002f6c: 5b 8c 00 0c sw (sp+12),r12 8002f70: 5b 8d 00 08 sw (sp+8),r13 8002f74: 5b 9d 00 04 sw (sp+4),ra register Thread_Control *the_thread; Objects_Locations location; if ( entry_point == NULL ) return RTEMS_INVALID_ADDRESS; 8002f78: 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 ) { 8002f7c: b8 40 60 00 mv r12,r2 8002f80: b8 60 68 00 mv r13,r3 register Thread_Control *the_thread; Objects_Locations location; if ( entry_point == NULL ) 8002f84: 44 40 00 11 be r2,r0,8002fc8 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 8002f88: 37 82 00 14 addi r2,sp,20 8002f8c: f8 00 08 4c calli 80050bc <_Thread_Get> switch ( location ) { 8002f90: 2b 8b 00 14 lw r11,(sp+20) case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 8002f94: 34 04 00 04 mvi r4,4 if ( entry_point == NULL ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); switch ( location ) { 8002f98: 5d 60 00 0c bne r11,r0,8002fc8 case OBJECTS_LOCAL: if ( _Thread_Start( 8002f9c: 34 02 00 00 mvi r2,0 8002fa0: b9 80 18 00 mv r3,r12 8002fa4: 34 04 00 00 mvi r4,0 8002fa8: b9 a0 28 00 mv r5,r13 8002fac: f8 00 0b f0 calli 8005f6c <_Thread_Start> 8002fb0: 44 2b 00 04 be r1,r11,8002fc0 the_thread, THREAD_START_NUMERIC, entry_point, NULL, argument ) ) { _Thread_Enable_dispatch(); 8002fb4: f8 00 08 35 calli 8005088 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8002fb8: 34 04 00 00 mvi r4,0 8002fbc: e0 00 00 03 bi 8002fc8 } _Thread_Enable_dispatch(); 8002fc0: f8 00 08 32 calli 8005088 <_Thread_Enable_dispatch> return RTEMS_INCORRECT_STATE; 8002fc4: 34 04 00 0e mvi r4,14 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8002fc8: b8 80 08 00 mv r1,r4 8002fcc: 2b 9d 00 04 lw ra,(sp+4) 8002fd0: 2b 8b 00 10 lw r11,(sp+16) 8002fd4: 2b 8c 00 0c lw r12,(sp+12) 8002fd8: 2b 8d 00 08 lw r13,(sp+8) 8002fdc: 37 9c 00 14 addi sp,sp,20 8002fe0: c3 a0 00 00 ret =============================================================================== 080043e8 : #include int rtems_termios_baud_to_index( rtems_termios_baud_t termios_baud ) { 80043e8: b8 20 10 00 mv r2,r1 case B134: baud_index = 4; break; case B150: baud_index = 5; break; case B200: baud_index = 6; break; case B300: baud_index = 7; break; case B600: baud_index = 8; break; case B1200: baud_index = 9; break; 80043ec: 34 01 00 09 mvi r1,9 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 80043f0: 44 41 00 38 be r2,r1,80044d0 80043f4: 48 41 00 19 bg r2,r1,8004458 case B0: baud_index = 0; break; case B50: baud_index = 1; break; case B75: baud_index = 2; break; case B110: baud_index = 3; break; case B134: baud_index = 4; break; 80043f8: 34 01 00 04 mvi r1,4 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 80043fc: 44 41 00 35 be r2,r1,80044d0 8004400: 48 41 00 0c bg r2,r1,8004430 case B0: baud_index = 0; break; case B50: baud_index = 1; break; 8004404: 34 01 00 01 mvi r1,1 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004408: 44 41 00 32 be r2,r1,80044d0 800440c: 48 41 00 04 bg r2,r1,800441c case B0: baud_index = 0; break; 8004410: 34 01 00 00 mvi r1,0 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004414: 5c 40 00 2e bne r2,r0,80044cc 8004418: c3 a0 00 00 ret case B0: baud_index = 0; break; case B50: baud_index = 1; break; case B75: baud_index = 2; break; 800441c: 34 01 00 02 mvi r1,2 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004420: 44 41 00 2c be r2,r1,80044d0 case B0: baud_index = 0; break; case B50: baud_index = 1; break; case B75: baud_index = 2; break; case B110: baud_index = 3; break; 8004424: 34 01 00 03 mvi r1,3 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004428: 5c 41 00 29 bne r2,r1,80044cc <== NEVER TAKEN 800442c: c3 a0 00 00 ret case B50: baud_index = 1; break; case B75: baud_index = 2; break; case B110: baud_index = 3; break; case B134: baud_index = 4; break; case B150: baud_index = 5; break; case B200: baud_index = 6; break; 8004430: 34 01 00 06 mvi r1,6 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004434: 44 41 00 27 be r2,r1,80044d0 8004438: 34 03 00 06 mvi r3,6 case B0: baud_index = 0; break; case B50: baud_index = 1; break; case B75: baud_index = 2; break; case B110: baud_index = 3; break; case B134: baud_index = 4; break; case B150: baud_index = 5; break; 800443c: 34 01 00 05 mvi r1,5 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004440: 48 62 00 24 bg r3,r2,80044d0 case B75: baud_index = 2; break; case B110: baud_index = 3; break; case B134: baud_index = 4; break; case B150: baud_index = 5; break; case B200: baud_index = 6; break; case B300: baud_index = 7; break; 8004444: 34 01 00 07 mvi r1,7 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004448: 44 41 00 22 be r2,r1,80044d0 case B110: baud_index = 3; break; case B134: baud_index = 4; break; case B150: baud_index = 5; break; case B200: baud_index = 6; break; case B300: baud_index = 7; break; case B600: baud_index = 8; break; 800444c: 34 01 00 08 mvi r1,8 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004450: 5c 41 00 1f bne r2,r1,80044cc <== NEVER TAKEN 8004454: c3 a0 00 00 ret case B1200: baud_index = 9; break; case B1800: baud_index = 10; break; case B2400: baud_index = 11; break; case B4800: baud_index = 12; break; case B9600: baud_index = 13; break; case B19200: baud_index = 14; break; 8004458: 34 01 00 0e mvi r1,14 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 800445c: 44 41 00 1d be r2,r1,80044d0 8004460: 48 41 00 0b bg r2,r1,800448c case B200: baud_index = 6; break; case B300: baud_index = 7; break; case B600: baud_index = 8; break; case B1200: baud_index = 9; break; case B1800: baud_index = 10; break; case B2400: baud_index = 11; break; 8004464: 34 01 00 0b mvi r1,11 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004468: 44 41 00 1a be r2,r1,80044d0 800446c: 34 03 00 0b mvi r3,11 case B150: baud_index = 5; break; case B200: baud_index = 6; break; case B300: baud_index = 7; break; case B600: baud_index = 8; break; case B1200: baud_index = 9; break; case B1800: baud_index = 10; break; 8004470: 34 01 00 0a mvi r1,10 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004474: 48 62 00 17 bg r3,r2,80044d0 case B300: baud_index = 7; break; case B600: baud_index = 8; break; case B1200: baud_index = 9; break; case B1800: baud_index = 10; break; case B2400: baud_index = 11; break; case B4800: baud_index = 12; break; 8004478: 34 01 00 0c mvi r1,12 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 800447c: 44 41 00 15 be r2,r1,80044d0 case B600: baud_index = 8; break; case B1200: baud_index = 9; break; case B1800: baud_index = 10; break; case B2400: baud_index = 11; break; case B4800: baud_index = 12; break; case B9600: baud_index = 13; break; 8004480: 34 01 00 0d mvi r1,13 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004484: 5c 41 00 12 bne r2,r1,80044cc <== NEVER TAKEN 8004488: c3 a0 00 00 ret 800448c: 34 03 10 02 mvi r3,4098 case B4800: baud_index = 12; break; case B9600: baud_index = 13; break; case B19200: baud_index = 14; break; case B38400: baud_index = 15; break; case B57600: baud_index = 16; break; case B115200: baud_index = 17; break; 8004490: 34 01 00 11 mvi r1,17 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 8004494: 44 43 00 0f be r2,r3,80044d0 8004498: 48 43 00 07 bg r2,r3,80044b4 case B1800: baud_index = 10; break; case B2400: baud_index = 11; break; case B4800: baud_index = 12; break; case B9600: baud_index = 13; break; case B19200: baud_index = 14; break; case B38400: baud_index = 15; break; 800449c: 34 01 00 0f mvi r1,15 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 80044a0: 44 41 00 0c be r2,r1,80044d0 80044a4: 34 03 10 01 mvi r3,4097 case B2400: baud_index = 11; break; case B4800: baud_index = 12; break; case B9600: baud_index = 13; break; case B19200: baud_index = 14; break; case B38400: baud_index = 15; break; case B57600: baud_index = 16; break; 80044a8: 34 01 00 10 mvi r1,16 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 80044ac: 5c 43 00 08 bne r2,r3,80044cc <== NEVER TAKEN 80044b0: c3 a0 00 00 ret 80044b4: 34 03 10 03 mvi r3,4099 case B9600: baud_index = 13; break; case B19200: baud_index = 14; break; case B38400: baud_index = 15; break; case B57600: baud_index = 16; break; case B115200: baud_index = 17; break; case B230400: baud_index = 18; break; 80044b8: 34 01 00 12 mvi r1,18 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 80044bc: 44 43 00 05 be r2,r3,80044d0 80044c0: 34 03 10 04 mvi r3,4100 case B19200: baud_index = 14; break; case B38400: baud_index = 15; break; case B57600: baud_index = 16; break; case B115200: baud_index = 17; break; case B230400: baud_index = 18; break; case B460800: baud_index = 19; break; 80044c4: 34 01 00 13 mvi r1,19 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 80044c8: 44 43 00 02 be r2,r3,80044d0 <== ALWAYS TAKEN case B38400: baud_index = 15; break; case B57600: baud_index = 16; break; case B115200: baud_index = 17; break; case B230400: baud_index = 18; break; case B460800: baud_index = 19; break; default: baud_index = -1; break; 80044cc: 34 01 ff ff mvi r1,-1 } return baud_index; } 80044d0: c3 a0 00 00 ret =============================================================================== 080044d4 : int termios_baud ) { int32_t baud; switch (termios_baud) { 80044d4: 34 03 00 09 mvi r3,9 case B134: baud = 134; break; case B150: baud = 150; break; case B200: baud = 200; break; case B300: baud = 300; break; case B600: baud = 600; break; case B1200: baud = 1200; break; 80044d8: 34 02 04 b0 mvi r2,1200 int termios_baud ) { int32_t baud; switch (termios_baud) { 80044dc: 44 23 00 44 be r1,r3,80045ec 80044e0: 48 23 00 1d bg r1,r3,8004554 80044e4: 34 03 00 04 mvi r3,4 case B0: baud = 0; break; case B50: baud = 50; break; case B75: baud = 75; break; case B110: baud = 110; break; case B134: baud = 134; break; 80044e8: 34 02 00 86 mvi r2,134 int termios_baud ) { int32_t baud; switch (termios_baud) { 80044ec: 44 23 00 40 be r1,r3,80045ec 80044f0: 48 23 00 0e bg r1,r3,8004528 80044f4: 34 03 00 01 mvi r3,1 case B0: baud = 0; break; case B50: baud = 50; break; 80044f8: 34 02 00 32 mvi r2,50 int termios_baud ) { int32_t baud; switch (termios_baud) { 80044fc: 44 23 00 3c be r1,r3,80045ec 8004500: 48 23 00 04 bg r1,r3,8004510 case B0: baud = 0; break; 8004504: 34 02 00 00 mvi r2,0 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004508: 5c 20 00 38 bne r1,r0,80045e8 800450c: e0 00 00 38 bi 80045ec 8004510: 34 03 00 02 mvi r3,2 case B0: baud = 0; break; case B50: baud = 50; break; case B75: baud = 75; break; 8004514: 34 02 00 4b mvi r2,75 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004518: 44 23 00 35 be r1,r3,80045ec case B0: baud = 0; break; case B50: baud = 50; break; case B75: baud = 75; break; case B110: baud = 110; break; 800451c: 34 02 00 6e mvi r2,110 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004520: 34 03 00 03 mvi r3,3 8004524: e0 00 00 30 bi 80045e4 8004528: 34 03 00 06 mvi r3,6 case B50: baud = 50; break; case B75: baud = 75; break; case B110: baud = 110; break; case B134: baud = 134; break; case B150: baud = 150; break; case B200: baud = 200; break; 800452c: 34 02 00 c8 mvi r2,200 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004530: 44 23 00 2f be r1,r3,80045ec case B0: baud = 0; break; case B50: baud = 50; break; case B75: baud = 75; break; case B110: baud = 110; break; case B134: baud = 134; break; case B150: baud = 150; break; 8004534: 34 02 00 96 mvi r2,150 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004538: 48 61 00 2d bg r3,r1,80045ec 800453c: 34 03 00 07 mvi r3,7 case B75: baud = 75; break; case B110: baud = 110; break; case B134: baud = 134; break; case B150: baud = 150; break; case B200: baud = 200; break; case B300: baud = 300; break; 8004540: 34 02 01 2c mvi r2,300 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004544: 44 23 00 2a be r1,r3,80045ec case B110: baud = 110; break; case B134: baud = 134; break; case B150: baud = 150; break; case B200: baud = 200; break; case B300: baud = 300; break; case B600: baud = 600; break; 8004548: 34 02 02 58 mvi r2,600 int termios_baud ) { int32_t baud; switch (termios_baud) { 800454c: 34 03 00 08 mvi r3,8 8004550: e0 00 00 25 bi 80045e4 8004554: 34 03 00 0e mvi r3,14 case B1200: baud = 1200; break; case B1800: baud = 1800; break; case B2400: baud = 2400; break; case B4800: baud = 4800; break; case B9600: baud = 9600; break; case B19200: baud = 19200; break; 8004558: 34 02 4b 00 mvi r2,19200 int termios_baud ) { int32_t baud; switch (termios_baud) { 800455c: 44 23 00 24 be r1,r3,80045ec 8004560: 48 23 00 0c bg r1,r3,8004590 8004564: 34 03 00 0b mvi r3,11 case B200: baud = 200; break; case B300: baud = 300; break; case B600: baud = 600; break; case B1200: baud = 1200; break; case B1800: baud = 1800; break; case B2400: baud = 2400; break; 8004568: 34 02 09 60 mvi r2,2400 int termios_baud ) { int32_t baud; switch (termios_baud) { 800456c: 44 23 00 20 be r1,r3,80045ec case B150: baud = 150; break; case B200: baud = 200; break; case B300: baud = 300; break; case B600: baud = 600; break; case B1200: baud = 1200; break; case B1800: baud = 1800; break; 8004570: 34 02 07 08 mvi r2,1800 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004574: 48 61 00 1e bg r3,r1,80045ec 8004578: 34 03 00 0c mvi r3,12 case B300: baud = 300; break; case B600: baud = 600; break; case B1200: baud = 1200; break; case B1800: baud = 1800; break; case B2400: baud = 2400; break; case B4800: baud = 4800; break; 800457c: 34 02 12 c0 mvi r2,4800 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004580: 44 23 00 1b be r1,r3,80045ec case B600: baud = 600; break; case B1200: baud = 1200; break; case B1800: baud = 1800; break; case B2400: baud = 2400; break; case B4800: baud = 4800; break; case B9600: baud = 9600; break; 8004584: 34 02 25 80 mvi r2,9600 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004588: 34 03 00 0d mvi r3,13 800458c: e0 00 00 16 bi 80045e4 case B4800: baud = 4800; break; case B9600: baud = 9600; break; case B19200: baud = 19200; break; case B38400: baud = 38400; break; case B57600: baud = 57600; break; case B115200: baud = 115200; break; 8004590: 78 04 08 01 mvhi r4,0x801 8004594: 38 84 ec a4 ori r4,r4,0xeca4 int termios_baud ) { int32_t baud; switch (termios_baud) { 8004598: 34 03 10 02 mvi r3,4098 case B4800: baud = 4800; break; case B9600: baud = 9600; break; case B19200: baud = 19200; break; case B38400: baud = 38400; break; case B57600: baud = 57600; break; case B115200: baud = 115200; break; 800459c: 28 82 00 00 lw r2,(r4+0) int termios_baud ) { int32_t baud; switch (termios_baud) { 80045a0: 44 23 00 13 be r1,r3,80045ec 80045a4: 48 23 00 07 bg r1,r3,80045c0 80045a8: 34 03 00 0f mvi r3,15 case B1800: baud = 1800; break; case B2400: baud = 2400; break; case B4800: baud = 4800; break; case B9600: baud = 9600; break; case B19200: baud = 19200; break; case B38400: baud = 38400; break; 80045ac: 38 02 96 00 mvu r2,0x9600 int termios_baud ) { int32_t baud; switch (termios_baud) { 80045b0: 44 23 00 0f be r1,r3,80045ec case B2400: baud = 2400; break; case B4800: baud = 4800; break; case B9600: baud = 9600; break; case B19200: baud = 19200; break; case B38400: baud = 38400; break; case B57600: baud = 57600; break; 80045b4: 34 42 4b 00 addi r2,r2,19200 int termios_baud ) { int32_t baud; switch (termios_baud) { 80045b8: 34 03 10 01 mvi r3,4097 80045bc: e0 00 00 0a bi 80045e4 case B9600: baud = 9600; break; case B19200: baud = 19200; break; case B38400: baud = 38400; break; case B57600: baud = 57600; break; case B115200: baud = 115200; break; case B230400: baud = 230400; break; 80045c0: 78 03 08 01 mvhi r3,0x801 80045c4: 38 63 f3 20 ori r3,r3,0xf320 80045c8: 28 62 00 00 lw r2,(r3+0) int termios_baud ) { int32_t baud; switch (termios_baud) { 80045cc: 34 03 10 03 mvi r3,4099 80045d0: 44 23 00 07 be r1,r3,80045ec case B19200: baud = 19200; break; case B38400: baud = 38400; break; case B57600: baud = 57600; break; case B115200: baud = 115200; break; case B230400: baud = 230400; break; case B460800: baud = 460800; break; 80045d4: 78 04 08 01 mvhi r4,0x801 80045d8: 38 84 f3 24 ori r4,r4,0xf324 80045dc: 28 82 00 00 lw r2,(r4+0) int termios_baud ) { int32_t baud; switch (termios_baud) { 80045e0: 34 03 10 04 mvi r3,4100 80045e4: 44 23 00 02 be r1,r3,80045ec <== ALWAYS TAKEN case B38400: baud = 38400; break; case B57600: baud = 57600; break; case B115200: baud = 115200; break; case B230400: baud = 230400; break; case B460800: baud = 460800; break; default: baud = -1; break; 80045e8: 34 02 ff ff mvi r2,-1 } return baud; } 80045ec: b8 40 08 00 mv r1,r2 80045f0: c3 a0 00 00 ret =============================================================================== 08004e74 : int cbufsize, int raw_input, int raw_output ) { rtems_termios_cbufsize = cbufsize; 8004e74: 78 04 08 02 mvhi r4,0x802 <== NOT EXECUTED 8004e78: 38 84 12 40 ori r4,r4,0x1240 <== NOT EXECUTED 8004e7c: 58 81 00 00 sw (r4+0),r1 <== NOT EXECUTED rtems_termios_raw_input_size = raw_input; 8004e80: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 8004e84: 38 21 12 44 ori r1,r1,0x1244 <== NOT EXECUTED 8004e88: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rtems_termios_raw_output_size = raw_output; 8004e8c: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 8004e90: 38 21 12 48 ori r1,r1,0x1248 <== NOT EXECUTED 8004e94: 58 23 00 00 sw (r1+0),r3 <== NOT EXECUTED return RTEMS_SUCCESSFUL; } 8004e98: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8004e9c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08004cbc : } } rtems_status_code rtems_termios_close (void *arg) { 8004cbc: 37 9c ff ec addi sp,sp,-20 8004cc0: 5b 8b 00 14 sw (sp+20),r11 8004cc4: 5b 8c 00 10 sw (sp+16),r12 8004cc8: 5b 8d 00 0c sw (sp+12),r13 8004ccc: 5b 8e 00 08 sw (sp+8),r14 8004cd0: 5b 9d 00 04 sw (sp+4),ra 8004cd4: b8 20 70 00 mv r14,r1 rtems_libio_open_close_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8004cd8: 28 21 00 00 lw r1,(r1+0) rtems_status_code sc; sc = rtems_semaphore_obtain( 8004cdc: 78 02 08 02 mvhi r2,0x802 8004ce0: 38 42 19 50 ori r2,r2,0x1950 rtems_status_code rtems_termios_close (void *arg) { rtems_libio_open_close_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8004ce4: 28 2b 00 38 lw r11,(r1+56) rtems_status_code sc; sc = rtems_semaphore_obtain( 8004ce8: 28 41 00 00 lw r1,(r2+0) 8004cec: 34 03 00 00 mvi r3,0 8004cf0: 34 02 00 00 mvi r2,0 8004cf4: f8 00 08 bf calli 8006ff0 rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 8004cf8: 5c 20 00 23 bne r1,r0,8004d84 <== NEVER TAKEN rtems_fatal_error_occurred (sc); if (--tty->refcount == 0) { 8004cfc: 29 6d 00 08 lw r13,(r11+8) 8004d00: 35 ad ff ff addi r13,r13,-1 8004d04: 59 6d 00 08 sw (r11+8),r13 8004d08: 5d a1 00 4f bne r13,r1,8004e44 <== NEVER TAKEN if (rtems_termios_linesw[tty->t_line].l_close != NULL) { 8004d0c: 29 61 00 cc lw r1,(r11+204) 8004d10: 78 0c 08 02 mvhi r12,0x802 8004d14: 34 02 00 05 mvi r2,5 8004d18: 39 8c 17 84 ori r12,r12,0x1784 8004d1c: fb ff f2 d6 calli 8001874 <__ashlsi3> 8004d20: b5 81 08 00 add r1,r12,r1 8004d24: 28 2c 00 04 lw r12,(r1+4) 8004d28: 45 8d 00 04 be r12,r13,8004d38 /* * call discipline-specific close */ sc = rtems_termios_linesw[tty->t_line].l_close(tty); 8004d2c: b9 60 08 00 mv r1,r11 8004d30: d9 80 00 00 call r12 8004d34: e0 00 00 08 bi 8004d54 } else { /* * default: just flush output buffer */ sc = rtems_semaphore_obtain(tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8004d38: 29 61 00 18 lw r1,(r11+24) 8004d3c: 34 02 00 00 mvi r2,0 8004d40: 34 03 00 00 mvi r3,0 8004d44: f8 00 08 ab calli 8006ff0 if (sc != RTEMS_SUCCESSFUL) { 8004d48: 5d 81 00 0f bne r12,r1,8004d84 <== NEVER TAKEN rtems_fatal_error_occurred (sc); } drainOutput (tty); 8004d4c: b9 60 08 00 mv r1,r11 8004d50: fb ff fe 89 calli 8004774 } if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 8004d54: 29 62 00 b4 lw r2,(r11+180) 8004d58: 34 01 00 02 mvi r1,2 8004d5c: 5c 41 00 0b bne r2,r1,8004d88 /* * send "terminate" to I/O tasks */ sc = rtems_event_send( tty->rxTaskId, TERMIOS_RX_TERMINATE_EVENT ); 8004d60: 29 61 00 c4 lw r1,(r11+196) 8004d64: 34 02 00 01 mvi r2,1 8004d68: f8 00 07 56 calli 8006ac0 8004d6c: b8 20 60 00 mv r12,r1 if (sc != RTEMS_SUCCESSFUL) 8004d70: 5c 20 00 05 bne r1,r0,8004d84 <== NEVER TAKEN rtems_fatal_error_occurred (sc); sc = rtems_event_send( tty->txTaskId, TERMIOS_TX_TERMINATE_EVENT ); 8004d74: 29 61 00 c8 lw r1,(r11+200) 8004d78: 34 02 00 01 mvi r2,1 8004d7c: f8 00 07 51 calli 8006ac0 if (sc != RTEMS_SUCCESSFUL) 8004d80: 44 2c 00 02 be r1,r12,8004d88 <== ALWAYS TAKEN rtems_fatal_error_occurred (sc); 8004d84: f8 00 0a 77 calli 8007760 <== NOT EXECUTED } if (tty->device.lastClose) 8004d88: 29 64 00 9c lw r4,(r11+156) 8004d8c: 44 80 00 05 be r4,r0,8004da0 <== ALWAYS TAKEN (*tty->device.lastClose)(tty->major, tty->minor, arg); 8004d90: 29 61 00 0c lw r1,(r11+12) <== NOT EXECUTED 8004d94: 29 62 00 10 lw r2,(r11+16) <== NOT EXECUTED 8004d98: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED 8004d9c: d8 80 00 00 call r4 <== NOT EXECUTED if (tty->forw == NULL) { 8004da0: 29 62 00 00 lw r2,(r11+0) 8004da4: 29 61 00 04 lw r1,(r11+4) 8004da8: 5c 40 00 07 bne r2,r0,8004dc4 <== NEVER TAKEN rtems_termios_ttyTail = tty->back; 8004dac: 78 03 08 02 mvhi r3,0x802 8004db0: 38 63 19 54 ori r3,r3,0x1954 8004db4: 58 61 00 00 sw (r3+0),r1 if ( rtems_termios_ttyTail != NULL ) { 8004db8: 44 22 00 04 be r1,r2,8004dc8 <== ALWAYS TAKEN rtems_termios_ttyTail->forw = NULL; 8004dbc: 58 20 00 00 sw (r1+0),r0 <== NOT EXECUTED 8004dc0: e0 00 00 02 bi 8004dc8 <== NOT EXECUTED } } else { tty->forw->back = tty->back; 8004dc4: 58 41 00 04 sw (r2+4),r1 <== NOT EXECUTED } if (tty->back == NULL) { 8004dc8: 29 62 00 04 lw r2,(r11+4) 8004dcc: 29 61 00 00 lw r1,(r11+0) 8004dd0: 5c 40 00 07 bne r2,r0,8004dec <== NEVER TAKEN rtems_termios_ttyHead = tty->forw; 8004dd4: 78 03 08 02 mvhi r3,0x802 8004dd8: 38 63 19 58 ori r3,r3,0x1958 8004ddc: 58 61 00 00 sw (r3+0),r1 if ( rtems_termios_ttyHead != NULL ) { 8004de0: 44 22 00 04 be r1,r2,8004df0 <== ALWAYS TAKEN rtems_termios_ttyHead->back = NULL; 8004de4: 58 20 00 04 sw (r1+4),r0 <== NOT EXECUTED 8004de8: e0 00 00 02 bi 8004df0 <== NOT EXECUTED } } else { tty->back->forw = tty->forw; 8004dec: 58 41 00 00 sw (r2+0),r1 <== NOT EXECUTED } rtems_semaphore_delete (tty->isem); 8004df0: 29 61 00 14 lw r1,(r11+20) 8004df4: f8 00 08 50 calli 8006f34 rtems_semaphore_delete (tty->osem); 8004df8: 29 61 00 18 lw r1,(r11+24) 8004dfc: f8 00 08 4e calli 8006f34 rtems_semaphore_delete (tty->rawOutBuf.Semaphore); 8004e00: 29 61 00 8c lw r1,(r11+140) 8004e04: f8 00 08 4c calli 8006f34 if ((tty->device.pollRead == NULL) || 8004e08: 29 61 00 a0 lw r1,(r11+160) 8004e0c: 44 20 00 04 be r1,r0,8004e1c 8004e10: 29 62 00 b4 lw r2,(r11+180) 8004e14: 34 01 00 02 mvi r1,2 8004e18: 5c 41 00 03 bne r2,r1,8004e24 (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)) rtems_semaphore_delete (tty->rawInBuf.Semaphore); 8004e1c: 29 61 00 68 lw r1,(r11+104) 8004e20: f8 00 08 45 calli 8006f34 free (tty->rawInBuf.theBuf); 8004e24: 29 61 00 58 lw r1,(r11+88) 8004e28: fb ff f8 42 calli 8002f30 free (tty->rawOutBuf.theBuf); 8004e2c: 29 61 00 7c lw r1,(r11+124) 8004e30: fb ff f8 40 calli 8002f30 free (tty->cbuf); 8004e34: 29 61 00 1c lw r1,(r11+28) 8004e38: fb ff f8 3e calli 8002f30 free (tty); 8004e3c: b9 60 08 00 mv r1,r11 8004e40: fb ff f8 3c calli 8002f30 } rtems_semaphore_release (rtems_termios_ttyMutex); 8004e44: 78 01 08 02 mvhi r1,0x802 8004e48: 38 21 19 50 ori r1,r1,0x1950 8004e4c: 28 21 00 00 lw r1,(r1+0) 8004e50: f8 00 08 b8 calli 8007130 return RTEMS_SUCCESSFUL; } 8004e54: 34 01 00 00 mvi r1,0 8004e58: 2b 9d 00 04 lw ra,(sp+4) 8004e5c: 2b 8b 00 14 lw r11,(sp+20) 8004e60: 2b 8c 00 10 lw r12,(sp+16) 8004e64: 2b 8d 00 0c lw r13,(sp+12) 8004e68: 2b 8e 00 08 lw r14,(sp+8) 8004e6c: 37 9c 00 14 addi sp,sp,20 8004e70: c3 a0 00 00 ret =============================================================================== 08006478 : * for each transmitted character. * It returns number of characters left to transmit */ int rtems_termios_dequeue_characters (void *ttyp, int len) { 8006478: 37 9c ff f8 addi sp,sp,-8 800647c: 5b 8b 00 08 sw (sp+8),r11 8006480: 5b 9d 00 04 sw (sp+4),ra rtems_status_code sc; /* * sum up character count already sent */ tty->t_dqlen += len; 8006484: 28 24 00 90 lw r4,(r1+144) 8006488: b4 82 10 00 add r2,r4,r2 if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 800648c: 28 24 00 b4 lw r4,(r1+180) rtems_status_code sc; /* * sum up character count already sent */ tty->t_dqlen += len; 8006490: 58 22 00 90 sw (r1+144),r2 if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 8006494: 34 02 00 02 mvi r2,2 8006498: 5c 82 00 06 bne r4,r2,80064b0 /* * send wake up to transmitter task */ sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT); 800649c: 28 21 00 c8 lw r1,(r1+200) if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); return 0; /* nothing to output in IRQ... */ 80064a0: 34 0b 00 00 mvi r11,0 if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { /* * send wake up to transmitter task */ sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT); 80064a4: f8 00 01 87 calli 8006ac0 if (sc != RTEMS_SUCCESSFUL) 80064a8: 44 20 00 0e be r1,r0,80064e0 <== ALWAYS TAKEN rtems_fatal_error_occurred (sc); 80064ac: f8 00 04 ad calli 8007760 <== NOT EXECUTED return 0; /* nothing to output in IRQ... */ } if (tty->t_line == PPPDISC ) { 80064b0: 28 23 00 cc lw r3,(r1+204) 80064b4: 34 02 00 05 mvi r2,5 80064b8: 5c 62 00 08 bne r3,r2,80064d8 /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 80064bc: 78 02 08 02 mvhi r2,0x802 80064c0: 38 42 17 84 ori r2,r2,0x1784 80064c4: 28 42 00 b4 lw r2,(r2+180) rtems_termios_linesw[tty->t_line].l_start(tty); } return 0; /* nothing to output in IRQ... */ 80064c8: 34 0b 00 00 mvi r11,0 if (tty->t_line == PPPDISC ) { /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 80064cc: 44 40 00 05 be r2,r0,80064e0 <== NEVER TAKEN rtems_termios_linesw[tty->t_line].l_start(tty); 80064d0: d8 40 00 00 call r2 80064d4: e0 00 00 03 bi 80064e0 } return 0; /* nothing to output in IRQ... */ } return rtems_termios_refill_transmitter(tty); 80064d8: fb ff ff 4a calli 8006200 80064dc: b8 20 58 00 mv r11,r1 } 80064e0: b9 60 08 00 mv r1,r11 80064e4: 2b 9d 00 04 lw ra,(sp+4) 80064e8: 2b 8b 00 08 lw r11,(sp+8) 80064ec: 37 9c 00 08 addi sp,sp,8 80064f0: c3 a0 00 00 ret =============================================================================== 08005e60 : * device receive interrupt handler. * Returns the number of characters dropped because of overflow. */ int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len) { 8005e60: 37 9c ff bc addi sp,sp,-68 8005e64: 5b 8b 00 44 sw (sp+68),r11 8005e68: 5b 8c 00 40 sw (sp+64),r12 8005e6c: 5b 8d 00 3c sw (sp+60),r13 8005e70: 5b 8e 00 38 sw (sp+56),r14 8005e74: 5b 8f 00 34 sw (sp+52),r15 8005e78: 5b 90 00 30 sw (sp+48),r16 8005e7c: 5b 91 00 2c sw (sp+44),r17 8005e80: 5b 92 00 28 sw (sp+40),r18 8005e84: 5b 93 00 24 sw (sp+36),r19 8005e88: 5b 94 00 20 sw (sp+32),r20 8005e8c: 5b 95 00 1c sw (sp+28),r21 8005e90: 5b 96 00 18 sw (sp+24),r22 8005e94: 5b 97 00 14 sw (sp+20),r23 8005e98: 5b 98 00 10 sw (sp+16),r24 8005e9c: 5b 99 00 0c sw (sp+12),r25 8005ea0: 5b 9b 00 08 sw (sp+8),fp 8005ea4: 5b 9d 00 04 sw (sp+4),ra 8005ea8: b8 20 58 00 mv r11,r1 char c; int dropped = 0; bool flow_rcv = false; /* true, if flow control char received */ rtems_interrupt_level level; if (rtems_termios_linesw[tty->t_line].l_rint != NULL) { 8005eac: 28 21 00 cc lw r1,(r1+204) * device receive interrupt handler. * Returns the number of characters dropped because of overflow. */ int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len) { 8005eb0: b8 40 68 00 mv r13,r2 char c; int dropped = 0; bool flow_rcv = false; /* true, if flow control char received */ rtems_interrupt_level level; if (rtems_termios_linesw[tty->t_line].l_rint != NULL) { 8005eb4: 78 0c 08 02 mvhi r12,0x802 8005eb8: 34 02 00 05 mvi r2,5 * device receive interrupt handler. * Returns the number of characters dropped because of overflow. */ int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len) { 8005ebc: b8 60 78 00 mv r15,r3 char c; int dropped = 0; bool flow_rcv = false; /* true, if flow control char received */ rtems_interrupt_level level; if (rtems_termios_linesw[tty->t_line].l_rint != NULL) { 8005ec0: 39 8c 17 84 ori r12,r12,0x1784 8005ec4: fb ff ee 6c calli 8001874 <__ashlsi3> 8005ec8: b5 81 08 00 add r1,r12,r1 8005ecc: 28 21 00 10 lw r1,(r1+16) 8005ed0: b9 e0 70 00 mv r14,r15 8005ed4: 5c 20 00 17 bne r1,r0,8005f30 8005ed8: 34 12 00 00 mvi r18,0 8005edc: 34 0c 00 00 mvi r12,0 flow_rcv = true; } } if (flow_rcv) { /* restart output according to FL_ORCVXOF flag */ if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) { 8005ee0: 34 1b 00 20 mvi fp,32 /* disable interrupts */ rtems_interrupt_disable(level); 8005ee4: 34 11 ff fe mvi r17,-2 tty->flow_ctrl &= ~FL_OSTOP; 8005ee8: 34 19 ff df mvi r25,-33 /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); 8005eec: 35 78 00 30 addi r24,r11,48 if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size) % tty->rawInBuf.Size) > tty->highwater) && !(tty->flow_ctrl & FL_IREQXOF)) { /* incoming data stream should be stopped */ tty->flow_ctrl |= FL_IREQXOF; if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF)) 8005ef0: 34 17 04 00 mvi r23,1024 /* call write function here */ tty->flow_ctrl |= FL_ISNTXOF; (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1); } } else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) { 8005ef4: 34 16 01 00 mvi r22,256 if ((tty->flow_ctrl & FL_OSTOP) || (tty->rawOutBufState == rob_idle)) { /* if tx is stopped due to XOFF or out of data */ /* call write function here */ tty->flow_ctrl |= FL_ISNTXOF; (*tty->device.write)(tty->minor, 8005ef8: 35 75 00 4a addi r21,r11,74 flow_rcv = true; } else if (c == tty->termios.c_cc[VSTART]) { /* VSTART received */ /* restart output */ tty->flow_ctrl &= ~FL_ORCVXOF; 8005efc: 34 14 ff ef mvi r20,-17 8005f00: e0 00 00 87 bi 800611c rtems_interrupt_level level; if (rtems_termios_linesw[tty->t_line].l_rint != NULL) { while (len--) { c = *buf++; rtems_termios_linesw[tty->t_line].l_rint(c,tty); 8005f04: 29 61 00 cc lw r1,(r11+204) 8005f08: 34 02 00 05 mvi r2,5 bool flow_rcv = false; /* true, if flow control char received */ rtems_interrupt_level level; if (rtems_termios_linesw[tty->t_line].l_rint != NULL) { while (len--) { c = *buf++; 8005f0c: 41 af 00 00 lbu r15,(r13+0) rtems_termios_linesw[tty->t_line].l_rint(c,tty); 8005f10: fb ff ee 59 calli 8001874 <__ashlsi3> 8005f14: b5 81 10 00 add r2,r12,r1 8005f18: 28 43 00 10 lw r3,(r2+16) 8005f1c: b9 e0 08 00 mv r1,r15 8005f20: b9 60 10 00 mv r2,r11 bool flow_rcv = false; /* true, if flow control char received */ rtems_interrupt_level level; if (rtems_termios_linesw[tty->t_line].l_rint != NULL) { while (len--) { c = *buf++; 8005f24: 35 ad 00 01 addi r13,r13,1 rtems_termios_linesw[tty->t_line].l_rint(c,tty); 8005f28: d8 60 00 00 call r3 8005f2c: 35 ce ff ff addi r14,r14,-1 int dropped = 0; bool flow_rcv = false; /* true, if flow control char received */ rtems_interrupt_level level; if (rtems_termios_linesw[tty->t_line].l_rint != NULL) { while (len--) { 8005f30: 5d c0 ff f5 bne r14,r0,8005f04 } /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { 8005f34: 29 61 00 e4 lw r1,(r11+228) (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); tty->tty_rcvwakeup = 1; } return 0; 8005f38: 34 0c 00 00 mvi r12,0 } /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { 8005f3c: 5c 2c 00 7e bne r1,r12,8006134 <== NEVER TAKEN 8005f40: 29 63 00 dc lw r3,(r11+220) (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); tty->tty_rcvwakeup = 1; } return 0; 8005f44: b9 c0 60 00 mv r12,r14 } /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { 8005f48: 44 60 00 7b be r3,r0,8006134 <== ALWAYS TAKEN (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); 8005f4c: 29 62 00 e0 lw r2,(r11+224) <== NOT EXECUTED 8005f50: 35 61 00 30 addi r1,r11,48 <== NOT EXECUTED 8005f54: d8 60 00 00 call r3 <== NOT EXECUTED tty->tty_rcvwakeup = 1; 8005f58: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8005f5c: 59 61 00 e4 sw (r11+228),r1 <== NOT EXECUTED 8005f60: e0 00 00 75 bi 8006134 <== NOT EXECUTED while (len--) { c = *buf++; /* FIXME: implement IXANY: any character restarts output */ /* if incoming XON/XOFF controls outgoing stream: */ if (tty->flow_ctrl & FL_MDXON) { 8005f64: 29 61 00 b8 lw r1,(r11+184) } return 0; } while (len--) { c = *buf++; 8005f68: 41 b0 00 00 lbu r16,(r13+0) 8005f6c: 35 ad 00 01 addi r13,r13,1 /* FIXME: implement IXANY: any character restarts output */ /* if incoming XON/XOFF controls outgoing stream: */ if (tty->flow_ctrl & FL_MDXON) { 8005f70: 20 21 02 00 andi r1,r1,0x200 8005f74: 44 20 00 11 be r1,r0,8005fb8 /* if received char is V_STOP and V_START (both are equal value) */ if (c == tty->termios.c_cc[VSTOP]) { 8005f78: 41 64 00 4a lbu r4,(r11+74) 8005f7c: 41 63 00 49 lbu r3,(r11+73) 8005f80: 5c 90 00 0a bne r4,r16,8005fa8 <== ALWAYS TAKEN if (c == tty->termios.c_cc[VSTART]) { 8005f84: 5c 64 00 04 bne r3,r4,8005f94 <== NOT EXECUTED /* received VSTOP and VSTART==VSTOP? */ /* then toggle "stop output" status */ tty->flow_ctrl = tty->flow_ctrl ^ FL_ORCVXOF; 8005f88: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8005f8c: 18 21 00 10 xori r1,r1,0x10 <== NOT EXECUTED 8005f90: e0 00 00 03 bi 8005f9c <== NOT EXECUTED } else { /* VSTOP received (other code than VSTART) */ /* stop output */ tty->flow_ctrl |= FL_ORCVXOF; 8005f94: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8005f98: 38 21 00 10 ori r1,r1,0x10 <== NOT EXECUTED 8005f9c: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED * device receive interrupt handler. * Returns the number of characters dropped because of overflow. */ int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len) { 8005fa0: 34 12 00 01 mvi r18,1 <== NOT EXECUTED 8005fa4: e0 00 00 06 bi 8005fbc <== NOT EXECUTED /* stop output */ tty->flow_ctrl |= FL_ORCVXOF; } flow_rcv = true; } else if (c == tty->termios.c_cc[VSTART]) { 8005fa8: 5c 70 00 04 bne r3,r16,8005fb8 <== ALWAYS TAKEN /* VSTART received */ /* restart output */ tty->flow_ctrl &= ~FL_ORCVXOF; 8005fac: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8005fb0: a0 34 08 00 and r1,r1,r20 <== NOT EXECUTED 8005fb4: e3 ff ff fa bi 8005f9c <== NOT EXECUTED flow_rcv = true; } } if (flow_rcv) { 8005fb8: 46 40 00 15 be r18,r0,800600c <== ALWAYS TAKEN /* restart output according to FL_ORCVXOF flag */ if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) { 8005fbc: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8005fc0: 20 21 00 30 andi r1,r1,0x30 <== NOT EXECUTED 8005fc4: 5c 3b 00 55 bne r1,fp,8006118 <== NOT EXECUTED /* disable interrupts */ rtems_interrupt_disable(level); 8005fc8: 90 00 70 00 rcsr r14,IE <== NOT EXECUTED 8005fcc: a1 d1 08 00 and r1,r14,r17 <== NOT EXECUTED 8005fd0: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED tty->flow_ctrl &= ~FL_OSTOP; 8005fd4: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8005fd8: a0 39 08 00 and r1,r1,r25 <== NOT EXECUTED 8005fdc: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { 8005fe0: 29 61 00 94 lw r1,(r11+148) <== NOT EXECUTED 8005fe4: 44 20 00 08 be r1,r0,8006004 <== NOT EXECUTED /* if chars available, call write function... */ (*tty->device.write)( tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1); 8005fe8: 29 63 00 84 lw r3,(r11+132) <== NOT EXECUTED rtems_interrupt_disable(level); tty->flow_ctrl &= ~FL_OSTOP; /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { /* if chars available, call write function... */ (*tty->device.write)( 8005fec: 29 62 00 7c lw r2,(r11+124) <== NOT EXECUTED 8005ff0: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED 8005ff4: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8005ff8: b4 43 10 00 add r2,r2,r3 <== NOT EXECUTED 8005ffc: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 8006000: d8 80 00 00 call r4 <== NOT EXECUTED tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1); } /* reenable interrupts */ rtems_interrupt_enable(level); 8006004: d0 0e 00 00 wcsr IE,r14 <== NOT EXECUTED 8006008: e0 00 00 44 bi 8006118 <== NOT EXECUTED } } else { newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size; 800600c: 29 63 00 60 lw r3,(r11+96) 8006010: 29 62 00 64 lw r2,(r11+100) 8006014: 34 61 00 01 addi r1,r3,1 8006018: f8 00 5d a6 calli 801d6b0 <__umodsi3> 800601c: b8 20 70 00 mv r14,r1 /* if chars_in_buffer > highwater */ rtems_interrupt_disable(level); 8006020: 90 00 98 00 rcsr r19,IE 8006024: a2 71 08 00 and r1,r19,r17 8006028: d0 01 00 00 wcsr IE,r1 if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size) 800602c: 29 61 00 5c lw r1,(r11+92) 8006030: 29 63 00 64 lw r3,(r11+100) % tty->rawInBuf.Size) > tty->highwater) && 8006034: 29 62 00 64 lw r2,(r11+100) } } else { newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size; /* if chars_in_buffer > highwater */ rtems_interrupt_disable(level); if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size) 8006038: c8 61 18 00 sub r3,r3,r1 % tty->rawInBuf.Size) > tty->highwater) && 800603c: b4 6e 08 00 add r1,r3,r14 8006040: f8 00 5d 9c calli 801d6b0 <__umodsi3> } } else { newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size; /* if chars_in_buffer > highwater */ rtems_interrupt_disable(level); if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size) 8006044: 29 62 00 c0 lw r2,(r11+192) 8006048: 50 41 00 22 bgeu r2,r1,80060d0 <== ALWAYS TAKEN % tty->rawInBuf.Size) > tty->highwater) && !(tty->flow_ctrl & FL_IREQXOF)) { 800604c: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8006050: 20 21 00 01 andi r1,r1,0x1 <== NOT EXECUTED } else { newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size; /* if chars_in_buffer > highwater */ rtems_interrupt_disable(level); if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size) % tty->rawInBuf.Size) > tty->highwater) && 8006054: 5c 20 00 1f bne r1,r0,80060d0 <== NOT EXECUTED !(tty->flow_ctrl & FL_IREQXOF)) { /* incoming data stream should be stopped */ tty->flow_ctrl |= FL_IREQXOF; 8006058: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 800605c: 38 21 00 01 ori r1,r1,0x1 <== NOT EXECUTED 8006060: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF)) 8006064: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8006068: 20 21 04 02 andi r1,r1,0x402 <== NOT EXECUTED 800606c: 5c 37 00 0f bne r1,r23,80060a8 <== NOT EXECUTED == (FL_MDXOF ) ) { if ((tty->flow_ctrl & FL_OSTOP) || 8006070: 29 63 00 b8 lw r3,(r11+184) <== NOT EXECUTED 8006074: 20 63 00 20 andi r3,r3,0x20 <== NOT EXECUTED 8006078: 5c 60 00 03 bne r3,r0,8006084 <== NOT EXECUTED 800607c: 29 61 00 94 lw r1,(r11+148) <== NOT EXECUTED 8006080: 5c 23 00 14 bne r1,r3,80060d0 <== NOT EXECUTED (tty->rawOutBufState == rob_idle)) { /* if tx is stopped due to XOFF or out of data */ /* call write function here */ tty->flow_ctrl |= FL_ISNTXOF; 8006084: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED (*tty->device.write)(tty->minor, 8006088: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED 800608c: ba a0 10 00 mv r2,r21 <== NOT EXECUTED == (FL_MDXOF ) ) { if ((tty->flow_ctrl & FL_OSTOP) || (tty->rawOutBufState == rob_idle)) { /* if tx is stopped due to XOFF or out of data */ /* call write function here */ tty->flow_ctrl |= FL_ISNTXOF; 8006090: 38 21 00 02 ori r1,r1,0x2 <== NOT EXECUTED 8006094: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED (*tty->device.write)(tty->minor, 8006098: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 800609c: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 80060a0: d8 80 00 00 call r4 <== NOT EXECUTED 80060a4: e0 00 00 0b bi 80060d0 <== NOT EXECUTED (void *)&(tty->termios.c_cc[VSTOP]), 1); } } else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) { 80060a8: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 80060ac: 20 21 01 04 andi r1,r1,0x104 <== NOT EXECUTED 80060b0: 5c 36 00 08 bne r1,r22,80060d0 <== NOT EXECUTED tty->flow_ctrl |= FL_IRTSOFF; 80060b4: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED /* deactivate RTS line */ if (tty->device.stopRemoteTx != NULL) { 80060b8: 29 63 00 ac lw r3,(r11+172) <== NOT EXECUTED tty->flow_ctrl |= FL_ISNTXOF; (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1); } } else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) { tty->flow_ctrl |= FL_IRTSOFF; 80060bc: 38 21 00 04 ori r1,r1,0x4 <== NOT EXECUTED 80060c0: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* deactivate RTS line */ if (tty->device.stopRemoteTx != NULL) { 80060c4: 44 60 00 03 be r3,r0,80060d0 <== NOT EXECUTED tty->device.stopRemoteTx(tty->minor); 80060c8: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 80060cc: d8 60 00 00 call r3 <== NOT EXECUTED } } } /* reenable interrupts */ rtems_interrupt_enable(level); 80060d0: d0 13 00 00 wcsr IE,r19 if (newTail == tty->rawInBuf.Head) { 80060d4: 29 61 00 5c lw r1,(r11+92) 80060d8: 5d c1 00 03 bne r14,r1,80060e4 <== ALWAYS TAKEN dropped++; 80060dc: 35 8c 00 01 addi r12,r12,1 <== NOT EXECUTED 80060e0: e0 00 00 0e bi 8006118 <== NOT EXECUTED } else { tty->rawInBuf.theBuf[newTail] = c; 80060e4: 29 61 00 58 lw r1,(r11+88) 80060e8: b4 2e 08 00 add r1,r1,r14 80060ec: 30 30 00 00 sb (r1+0),r16 tty->rawInBuf.Tail = newTail; /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { 80060f0: 29 64 00 e4 lw r4,(r11+228) if (newTail == tty->rawInBuf.Head) { dropped++; } else { tty->rawInBuf.theBuf[newTail] = c; tty->rawInBuf.Tail = newTail; 80060f4: 59 6e 00 60 sw (r11+96),r14 /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { 80060f8: 5c 80 00 08 bne r4,r0,8006118 <== NEVER TAKEN 80060fc: 29 63 00 dc lw r3,(r11+220) 8006100: 44 64 00 06 be r3,r4,8006118 <== ALWAYS TAKEN (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); 8006104: 29 62 00 e0 lw r2,(r11+224) <== NOT EXECUTED 8006108: bb 00 08 00 mv r1,r24 <== NOT EXECUTED 800610c: d8 60 00 00 call r3 <== NOT EXECUTED tty->tty_rcvwakeup = 1; 8006110: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8006114: 59 61 00 e4 sw (r11+228),r1 <== NOT EXECUTED 8006118: 35 ef ff ff addi r15,r15,-1 tty->tty_rcvwakeup = 1; } return 0; } while (len--) { 800611c: 5d e0 ff 92 bne r15,r0,8005f64 } } } } tty->rawInBufDropped += dropped; 8006120: 29 61 00 78 lw r1,(r11+120) 8006124: b4 2c 08 00 add r1,r1,r12 8006128: 59 61 00 78 sw (r11+120),r1 rtems_semaphore_release (tty->rawInBuf.Semaphore); 800612c: 29 61 00 68 lw r1,(r11+104) 8006130: f8 00 04 00 calli 8007130 return dropped; } 8006134: b9 80 08 00 mv r1,r12 8006138: 2b 9d 00 04 lw ra,(sp+4) 800613c: 2b 8b 00 44 lw r11,(sp+68) 8006140: 2b 8c 00 40 lw r12,(sp+64) 8006144: 2b 8d 00 3c lw r13,(sp+60) 8006148: 2b 8e 00 38 lw r14,(sp+56) 800614c: 2b 8f 00 34 lw r15,(sp+52) 8006150: 2b 90 00 30 lw r16,(sp+48) 8006154: 2b 91 00 2c lw r17,(sp+44) 8006158: 2b 92 00 28 lw r18,(sp+40) 800615c: 2b 93 00 24 lw r19,(sp+36) 8006160: 2b 94 00 20 lw r20,(sp+32) 8006164: 2b 95 00 1c lw r21,(sp+28) 8006168: 2b 96 00 18 lw r22,(sp+24) 800616c: 2b 97 00 14 lw r23,(sp+20) 8006170: 2b 98 00 10 lw r24,(sp+16) 8006174: 2b 99 00 0c lw r25,(sp+12) 8006178: 2b 9b 00 08 lw fp,(sp+8) 800617c: 37 9c 00 44 addi sp,sp,68 8006180: c3 a0 00 00 ret =============================================================================== 080045f4 : struct rtems_termios_tty *rtems_termios_ttyTail; rtems_id rtems_termios_ttyMutex; void rtems_termios_initialize (void) { 80045f4: 37 9c ff f8 addi sp,sp,-8 80045f8: 5b 8b 00 08 sw (sp+8),r11 80045fc: 5b 9d 00 04 sw (sp+4),ra rtems_status_code sc; /* * Create the mutex semaphore for the tty list */ if (!rtems_termios_ttyMutex) { 8004600: 78 05 08 02 mvhi r5,0x802 8004604: 38 a5 19 50 ori r5,r5,0x1950 8004608: 28 ab 00 00 lw r11,(r5+0) 800460c: 5d 60 00 0a bne r11,r0,8004634 <== NEVER TAKEN sc = rtems_semaphore_create ( 8004610: 78 02 08 01 mvhi r2,0x801 8004614: 38 42 f3 28 ori r2,r2,0xf328 8004618: 28 41 00 00 lw r1,(r2+0) 800461c: 34 03 00 54 mvi r3,84 8004620: 34 02 00 01 mvi r2,1 8004624: 34 04 00 00 mvi r4,0 8004628: f8 00 09 c6 calli 8006d40 rtems_build_name ('T', 'R', 'm', 'i'), 1, RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &rtems_termios_ttyMutex); if (sc != RTEMS_SUCCESSFUL) 800462c: 44 2b 00 02 be r1,r11,8004634 <== ALWAYS TAKEN rtems_fatal_error_occurred (sc); 8004630: f8 00 0c 4c calli 8007760 <== NOT EXECUTED } } 8004634: 2b 9d 00 04 lw ra,(sp+4) 8004638: 2b 8b 00 08 lw r11,(sp+8) 800463c: 37 9c 00 08 addi sp,sp,8 8004640: c3 a0 00 00 ret =============================================================================== 08004ea0 : } } rtems_status_code rtems_termios_ioctl (void *arg) { 8004ea0: 37 9c ff e8 addi sp,sp,-24 8004ea4: 5b 8b 00 18 sw (sp+24),r11 8004ea8: 5b 8c 00 14 sw (sp+20),r12 8004eac: 5b 8d 00 10 sw (sp+16),r13 8004eb0: 5b 8e 00 0c sw (sp+12),r14 8004eb4: 5b 8f 00 08 sw (sp+8),r15 8004eb8: 5b 9d 00 04 sw (sp+4),ra 8004ebc: b8 20 60 00 mv r12,r1 rtems_libio_ioctl_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8004ec0: 28 21 00 00 lw r1,(r1+0) struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer; rtems_status_code sc; args->ioctl_return = 0; sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8004ec4: 34 02 00 00 mvi r2,0 8004ec8: 34 03 00 00 mvi r3,0 rtems_status_code rtems_termios_ioctl (void *arg) { rtems_libio_ioctl_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8004ecc: 28 2b 00 38 lw r11,(r1+56) struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer; rtems_status_code sc; args->ioctl_return = 0; 8004ed0: 59 80 00 0c sw (r12+12),r0 rtems_status_code rtems_termios_ioctl (void *arg) { rtems_libio_ioctl_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer; 8004ed4: 29 8e 00 08 lw r14,(r12+8) rtems_status_code sc; args->ioctl_return = 0; sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8004ed8: 29 61 00 18 lw r1,(r11+24) 8004edc: f8 00 08 45 calli 8006ff0 8004ee0: b8 20 68 00 mv r13,r1 if (sc != RTEMS_SUCCESSFUL) { 8004ee4: 5c 20 00 da bne r1,r0,800524c <== NEVER TAKEN args->ioctl_return = sc; return sc; } switch (args->command) { 8004ee8: 29 82 00 04 lw r2,(r12+4) 8004eec: 34 01 00 04 mvi r1,4 8004ef0: 44 41 00 a6 be r2,r1,8005188 <== NEVER TAKEN 8004ef4: 54 41 00 07 bgu r2,r1,8004f10 8004ef8: 34 01 00 02 mvi r1,2 8004efc: 44 41 00 27 be r2,r1,8004f98 8004f00: 54 41 00 9a bgu r2,r1,8005168 <== NEVER TAKEN 8004f04: 34 01 00 01 mvi r1,1 8004f08: 5c 41 00 12 bne r2,r1,8004f50 <== NEVER TAKEN 8004f0c: e0 00 00 1e bi 8004f84 8004f10: 78 03 08 01 mvhi r3,0x801 8004f14: 38 63 f3 44 ori r3,r3,0xf344 8004f18: 28 61 00 00 lw r1,(r3+0) 8004f1c: 44 41 00 be be r2,r1,8005214 <== NEVER TAKEN 8004f20: 54 41 00 04 bgu r2,r1,8004f30 8004f24: 34 01 00 05 mvi r1,5 8004f28: 5c 41 00 0a bne r2,r1,8004f50 <== ALWAYS TAKEN 8004f2c: e0 00 00 92 bi 8005174 <== NOT EXECUTED 8004f30: 78 03 08 01 mvhi r3,0x801 8004f34: 38 63 f3 48 ori r3,r3,0xf348 8004f38: 28 61 00 00 lw r1,(r3+0) 8004f3c: 44 41 00 b2 be r2,r1,8005204 <== NEVER TAKEN 8004f40: 78 03 08 01 mvhi r3,0x801 8004f44: 38 63 f3 4c ori r3,r3,0xf34c 8004f48: 28 61 00 00 lw r1,(r3+0) 8004f4c: 44 41 00 94 be r2,r1,800519c <== ALWAYS TAKEN default: if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) { 8004f50: 29 61 00 cc lw r1,(r11+204) 8004f54: 78 0d 08 02 mvhi r13,0x802 8004f58: 34 02 00 05 mvi r2,5 8004f5c: 39 ad 17 84 ori r13,r13,0x1784 8004f60: fb ff f2 45 calli 8001874 <__ashlsi3> 8004f64: b5 a1 08 00 add r1,r13,r1 8004f68: 28 23 00 18 lw r3,(r1+24) sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args); } else { sc = RTEMS_INVALID_NUMBER; 8004f6c: 34 0d 00 0a mvi r13,10 args->ioctl_return = sc; return sc; } switch (args->command) { default: if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) { 8004f70: 44 60 00 b5 be r3,r0,8005244 <== NEVER TAKEN sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args); 8004f74: b9 60 08 00 mv r1,r11 8004f78: b9 80 10 00 mv r2,r12 8004f7c: d8 60 00 00 call r3 8004f80: e0 00 00 9f bi 80051fc sc = RTEMS_INVALID_NUMBER; } break; case RTEMS_IO_GET_ATTRIBUTES: *(struct termios *)args->buffer = tty->termios; 8004f84: 29 81 00 08 lw r1,(r12+8) 8004f88: 35 62 00 30 addi r2,r11,48 8004f8c: 34 03 00 24 mvi r3,36 8004f90: f8 00 2d 22 calli 8010418 break; 8004f94: e0 00 00 ac bi 8005244 case RTEMS_IO_SET_ATTRIBUTES: tty->termios = *(struct termios *)args->buffer; 8004f98: 29 82 00 08 lw r2,(r12+8) 8004f9c: 35 61 00 30 addi r1,r11,48 8004fa0: 34 03 00 24 mvi r3,36 8004fa4: f8 00 2d 1d calli 8010418 /* * check for flow control options to be switched off */ /* check for outgoing XON/XOFF flow control switched off */ if (( tty->flow_ctrl & FL_MDXON) && 8004fa8: 29 61 00 b8 lw r1,(r11+184) 8004fac: 20 21 02 00 andi r1,r1,0x200 8004fb0: 44 20 00 1d be r1,r0,8005024 !(tty->termios.c_iflag & IXON)) { 8004fb4: 29 61 00 30 lw r1,(r11+48) 8004fb8: 20 21 04 00 andi r1,r1,0x400 /* * check for flow control options to be switched off */ /* check for outgoing XON/XOFF flow control switched off */ if (( tty->flow_ctrl & FL_MDXON) && 8004fbc: 5c 20 00 1a bne r1,r0,8005024 <== ALWAYS TAKEN !(tty->termios.c_iflag & IXON)) { /* clear related flags in flow_ctrl */ tty->flow_ctrl &= ~(FL_MDXON | FL_ORCVXOF); 8004fc0: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 8004fc4: 34 01 fd ef mvi r1,-529 <== NOT EXECUTED 8004fc8: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED 8004fcc: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* has output been stopped due to received XOFF? */ if (tty->flow_ctrl & FL_OSTOP) { 8004fd0: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8004fd4: 20 21 00 20 andi r1,r1,0x20 <== NOT EXECUTED 8004fd8: 44 20 00 13 be r1,r0,8005024 <== NOT EXECUTED /* disable interrupts */ rtems_interrupt_disable(level); 8004fdc: 90 00 70 00 rcsr r14,IE <== NOT EXECUTED 8004fe0: 34 01 ff fe mvi r1,-2 <== NOT EXECUTED 8004fe4: a1 c1 08 00 and r1,r14,r1 <== NOT EXECUTED 8004fe8: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED tty->flow_ctrl &= ~FL_OSTOP; 8004fec: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 8004ff0: 34 01 ff df mvi r1,-33 <== NOT EXECUTED 8004ff4: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED 8004ff8: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { 8004ffc: 29 61 00 94 lw r1,(r11+148) <== NOT EXECUTED 8005000: 44 20 00 08 be r1,r0,8005020 <== NOT EXECUTED /* if chars available, call write function... */ (*tty->device.write)( 8005004: 29 63 00 7c lw r3,(r11+124) <== NOT EXECUTED tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); 8005008: 29 62 00 84 lw r2,(r11+132) <== NOT EXECUTED rtems_interrupt_disable(level); tty->flow_ctrl &= ~FL_OSTOP; /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { /* if chars available, call write function... */ (*tty->device.write)( 800500c: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED 8005010: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8005014: b4 62 10 00 add r2,r3,r2 <== NOT EXECUTED 8005018: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 800501c: d8 80 00 00 call r4 <== NOT EXECUTED tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); } /* reenable interrupts */ rtems_interrupt_enable(level); 8005020: d0 0e 00 00 wcsr IE,r14 <== NOT EXECUTED } } /* check for incoming XON/XOFF flow control switched off */ if (( tty->flow_ctrl & FL_MDXOF) && !(tty->termios.c_iflag & IXOFF)) { 8005024: 29 61 00 b8 lw r1,(r11+184) 8005028: 20 21 04 00 andi r1,r1,0x400 800502c: 44 20 00 0c be r1,r0,800505c <== ALWAYS TAKEN 8005030: 29 61 00 30 lw r1,(r11+48) <== NOT EXECUTED 8005034: 20 21 10 00 andi r1,r1,0x1000 <== NOT EXECUTED 8005038: 5c 20 00 09 bne r1,r0,800505c <== NOT EXECUTED /* clear related flags in flow_ctrl */ tty->flow_ctrl &= ~(FL_MDXOF); 800503c: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 8005040: 34 01 fb ff mvi r1,-1025 <== NOT EXECUTED 8005044: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED 8005048: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* FIXME: what happens, if we had sent XOFF but not yet XON? */ tty->flow_ctrl &= ~(FL_ISNTXOF); 800504c: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 8005050: 34 01 ff fd mvi r1,-3 <== NOT EXECUTED 8005054: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED 8005058: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED } /* check for incoming RTS/CTS flow control switched off */ if (( tty->flow_ctrl & FL_MDRTS) && !(tty->termios.c_cflag & CRTSCTS)) { 800505c: 29 61 00 b8 lw r1,(r11+184) 8005060: 20 21 01 00 andi r1,r1,0x100 8005064: 44 20 00 12 be r1,r0,80050ac <== ALWAYS TAKEN 8005068: 29 61 00 38 lw r1,(r11+56) <== NOT EXECUTED 800506c: 48 01 00 10 bg r0,r1,80050ac <== NOT EXECUTED /* clear related flags in flow_ctrl */ tty->flow_ctrl &= ~(FL_MDRTS); 8005070: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 8005074: 34 01 fe ff mvi r1,-257 <== NOT EXECUTED 8005078: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED 800507c: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* restart remote Tx, if it was stopped */ if ((tty->flow_ctrl & FL_IRTSOFF) && (tty->device.startRemoteTx != NULL)) { 8005080: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8005084: 20 21 00 04 andi r1,r1,0x4 <== NOT EXECUTED 8005088: 44 20 00 05 be r1,r0,800509c <== NOT EXECUTED 800508c: 29 62 00 b0 lw r2,(r11+176) <== NOT EXECUTED 8005090: 44 40 00 03 be r2,r0,800509c <== NOT EXECUTED tty->device.startRemoteTx(tty->minor); 8005094: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8005098: d8 40 00 00 call r2 <== NOT EXECUTED } tty->flow_ctrl &= ~(FL_IRTSOFF); 800509c: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 80050a0: 34 01 ff fb mvi r1,-5 <== NOT EXECUTED 80050a4: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED 80050a8: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* * check for flow control options to be switched on */ /* check for incoming RTS/CTS flow control switched on */ if (tty->termios.c_cflag & CRTSCTS) { 80050ac: 29 61 00 38 lw r1,(r11+56) 80050b0: 4c 20 00 04 bge r1,r0,80050c0 <== ALWAYS TAKEN tty->flow_ctrl |= FL_MDRTS; 80050b4: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 80050b8: 38 21 01 00 ori r1,r1,0x100 <== NOT EXECUTED 80050bc: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED } /* check for incoming XON/XOF flow control switched on */ if (tty->termios.c_iflag & IXOFF) { 80050c0: 29 61 00 30 lw r1,(r11+48) 80050c4: 20 22 10 00 andi r2,r1,0x1000 80050c8: 44 40 00 04 be r2,r0,80050d8 <== ALWAYS TAKEN tty->flow_ctrl |= FL_MDXOF; 80050cc: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 80050d0: 38 42 04 00 ori r2,r2,0x400 <== NOT EXECUTED 80050d4: 59 62 00 b8 sw (r11+184),r2 <== NOT EXECUTED } /* check for outgoing XON/XOF flow control switched on */ if (tty->termios.c_iflag & IXON) { 80050d8: 20 21 04 00 andi r1,r1,0x400 80050dc: 44 20 00 04 be r1,r0,80050ec <== NEVER TAKEN tty->flow_ctrl |= FL_MDXON; 80050e0: 29 61 00 b8 lw r1,(r11+184) 80050e4: 38 21 02 00 ori r1,r1,0x200 80050e8: 59 61 00 b8 sw (r11+184),r1 tty->termios = *(struct termios *)args->buffer; /* check for and process change in flow control options */ termios_set_flowctrl(tty); if (tty->termios.c_lflag & ICANON) { 80050ec: 29 6e 00 3c lw r14,(r11+60) 80050f0: 21 ce 00 02 andi r14,r14,0x2 80050f4: 5d c0 00 11 bne r14,r0,8005138 <== ALWAYS TAKEN tty->rawInBufSemaphoreOptions = RTEMS_WAIT; tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT; tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; } else { tty->vtimeTicks = tty->termios.c_cc[VTIME] * 80050f8: 41 6f 00 46 lbu r15,(r11+70) <== NOT EXECUTED rtems_clock_get_ticks_per_second() / 10; 80050fc: f8 00 05 e8 calli 800689c <== NOT EXECUTED if (tty->termios.c_lflag & ICANON) { tty->rawInBufSemaphoreOptions = RTEMS_WAIT; tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT; tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; } else { tty->vtimeTicks = tty->termios.c_cc[VTIME] * 8005100: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED 8005104: f8 00 60 f6 calli 801d4dc <__mulsi3> <== NOT EXECUTED rtems_clock_get_ticks_per_second() / 10; 8005108: 34 02 00 0a mvi r2,10 <== NOT EXECUTED 800510c: f8 00 61 59 calli 801d670 <__udivsi3> <== NOT EXECUTED if (tty->termios.c_cc[VTIME]) { 8005110: 41 62 00 46 lbu r2,(r11+70) <== NOT EXECUTED if (tty->termios.c_lflag & ICANON) { tty->rawInBufSemaphoreOptions = RTEMS_WAIT; tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT; tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; } else { tty->vtimeTicks = tty->termios.c_cc[VTIME] * 8005114: 59 61 00 54 sw (r11+84),r1 <== NOT EXECUTED 8005118: 41 63 00 47 lbu r3,(r11+71) <== NOT EXECUTED rtems_clock_get_ticks_per_second() / 10; if (tty->termios.c_cc[VTIME]) { 800511c: 44 4e 00 06 be r2,r14,8005134 <== NOT EXECUTED tty->rawInBufSemaphoreOptions = RTEMS_WAIT; 8005120: 59 60 00 6c sw (r11+108),r0 <== NOT EXECUTED tty->rawInBufSemaphoreTimeout = tty->vtimeTicks; 8005124: 59 61 00 70 sw (r11+112),r1 <== NOT EXECUTED if (tty->termios.c_cc[VMIN]) 8005128: 5c 60 00 06 bne r3,r0,8005140 <== NOT EXECUTED tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; else tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks; 800512c: 59 61 00 74 sw (r11+116),r1 <== NOT EXECUTED 8005130: e0 00 00 08 bi 8005150 <== NOT EXECUTED } else { if (tty->termios.c_cc[VMIN]) { 8005134: 44 62 00 05 be r3,r2,8005148 <== NOT EXECUTED tty->rawInBufSemaphoreOptions = RTEMS_WAIT; 8005138: 59 60 00 6c sw (r11+108),r0 tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT; 800513c: 59 60 00 70 sw (r11+112),r0 tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; 8005140: 59 60 00 74 sw (r11+116),r0 8005144: e0 00 00 03 bi 8005150 } else { tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT; 8005148: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 800514c: 59 61 00 6c sw (r11+108),r1 <== NOT EXECUTED } } } if (tty->device.setAttributes) 8005150: 29 63 00 a8 lw r3,(r11+168) 8005154: 44 60 00 3c be r3,r0,8005244 <== NEVER TAKEN (*tty->device.setAttributes)(tty->minor, &tty->termios); 8005158: 29 61 00 10 lw r1,(r11+16) 800515c: 35 62 00 30 addi r2,r11,48 8005160: d8 60 00 00 call r3 8005164: e0 00 00 38 bi 8005244 break; case RTEMS_IO_TCDRAIN: drainOutput (tty); 8005168: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 800516c: fb ff fd 82 calli 8004774 <== NOT EXECUTED break; 8005170: e0 00 00 35 bi 8005244 <== NOT EXECUTED case RTEMS_IO_SNDWAKEUP: tty->tty_snd = *wakeup; 8005174: 29 c1 00 00 lw r1,(r14+0) <== NOT EXECUTED 8005178: 59 61 00 d4 sw (r11+212),r1 <== NOT EXECUTED 800517c: 29 c1 00 04 lw r1,(r14+4) <== NOT EXECUTED 8005180: 59 61 00 d8 sw (r11+216),r1 <== NOT EXECUTED break; 8005184: e0 00 00 30 bi 8005244 <== NOT EXECUTED case RTEMS_IO_RCVWAKEUP: tty->tty_rcv = *wakeup; 8005188: 29 c1 00 00 lw r1,(r14+0) <== NOT EXECUTED 800518c: 59 61 00 dc sw (r11+220),r1 <== NOT EXECUTED 8005190: 29 c1 00 04 lw r1,(r14+4) <== NOT EXECUTED 8005194: 59 61 00 e0 sw (r11+224),r1 <== NOT EXECUTED break; 8005198: e0 00 00 2b bi 8005244 <== NOT EXECUTED #if 1 /* FIXME */ case TIOCSETD: /* * close old line discipline */ if (rtems_termios_linesw[tty->t_line].l_close != NULL) { 800519c: 29 61 00 cc lw r1,(r11+204) 80051a0: 34 02 00 05 mvi r2,5 80051a4: 78 0e 08 02 mvhi r14,0x802 80051a8: fb ff f1 b3 calli 8001874 <__ashlsi3> 80051ac: 39 ce 17 84 ori r14,r14,0x1784 80051b0: b5 c1 08 00 add r1,r14,r1 80051b4: 28 22 00 04 lw r2,(r1+4) 80051b8: 44 40 00 04 be r2,r0,80051c8 sc = rtems_termios_linesw[tty->t_line].l_close(tty); 80051bc: b9 60 08 00 mv r1,r11 80051c0: d8 40 00 00 call r2 80051c4: b8 20 68 00 mv r13,r1 } tty->t_line=*(int*)(args->buffer); 80051c8: 29 81 00 08 lw r1,(r12+8) tty->t_sc = NULL; /* ensure that no more valid data */ /* * open new line discipline */ if (rtems_termios_linesw[tty->t_line].l_open != NULL) { 80051cc: 34 02 00 05 mvi r2,5 80051d0: 78 0e 08 02 mvhi r14,0x802 * close old line discipline */ if (rtems_termios_linesw[tty->t_line].l_close != NULL) { sc = rtems_termios_linesw[tty->t_line].l_close(tty); } tty->t_line=*(int*)(args->buffer); 80051d4: 28 21 00 00 lw r1,(r1+0) tty->t_sc = NULL; /* ensure that no more valid data */ 80051d8: 59 60 00 d0 sw (r11+208),r0 /* * open new line discipline */ if (rtems_termios_linesw[tty->t_line].l_open != NULL) { 80051dc: 39 ce 17 84 ori r14,r14,0x1784 * close old line discipline */ if (rtems_termios_linesw[tty->t_line].l_close != NULL) { sc = rtems_termios_linesw[tty->t_line].l_close(tty); } tty->t_line=*(int*)(args->buffer); 80051e0: 59 61 00 cc sw (r11+204),r1 tty->t_sc = NULL; /* ensure that no more valid data */ /* * open new line discipline */ if (rtems_termios_linesw[tty->t_line].l_open != NULL) { 80051e4: fb ff f1 a4 calli 8001874 <__ashlsi3> 80051e8: b5 c1 08 00 add r1,r14,r1 80051ec: 28 22 00 00 lw r2,(r1+0) 80051f0: 44 40 00 15 be r2,r0,8005244 <== NEVER TAKEN sc = rtems_termios_linesw[tty->t_line].l_open(tty); 80051f4: b9 60 08 00 mv r1,r11 80051f8: d8 40 00 00 call r2 80051fc: b8 20 68 00 mv r13,r1 8005200: e0 00 00 11 bi 8005244 } break; case TIOCGETD: *(int*)(args->buffer)=tty->t_line; 8005204: 29 81 00 08 lw r1,(r12+8) 8005208: 29 62 00 cc lw r2,(r11+204) 800520c: 58 22 00 00 sw (r1+0),r2 break; 8005210: e0 00 00 0d bi 8005244 #endif case FIONREAD: { int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head; 8005214: 29 62 00 60 lw r2,(r11+96) <== NOT EXECUTED 8005218: 29 61 00 5c lw r1,(r11+92) <== NOT EXECUTED 800521c: c8 41 08 00 sub r1,r2,r1 <== NOT EXECUTED if ( rawnc < 0 ) 8005220: 4c 20 00 03 bge r1,r0,800522c <== NOT EXECUTED rawnc += tty->rawInBuf.Size; 8005224: 29 62 00 64 lw r2,(r11+100) <== NOT EXECUTED 8005228: b4 22 08 00 add r1,r1,r2 <== NOT EXECUTED /* Half guess that this is the right operation */ *(int *)args->buffer = tty->ccount - tty->cindex + rawnc; 800522c: 29 64 00 20 lw r4,(r11+32) <== NOT EXECUTED 8005230: 29 62 00 24 lw r2,(r11+36) <== NOT EXECUTED 8005234: 29 83 00 08 lw r3,(r12+8) <== NOT EXECUTED 8005238: c8 82 10 00 sub r2,r4,r2 <== NOT EXECUTED 800523c: b4 41 08 00 add r1,r2,r1 <== NOT EXECUTED 8005240: 58 61 00 00 sw (r3+0),r1 <== NOT EXECUTED } break; } rtems_semaphore_release (tty->osem); 8005244: 29 61 00 18 lw r1,(r11+24) 8005248: f8 00 07 ba calli 8007130 args->ioctl_return = sc; return sc; } 800524c: b9 a0 08 00 mv r1,r13 } break; } rtems_semaphore_release (tty->osem); args->ioctl_return = sc; 8005250: 59 8d 00 0c sw (r12+12),r13 return sc; } 8005254: 2b 9d 00 04 lw ra,(sp+4) 8005258: 2b 8b 00 18 lw r11,(sp+24) 800525c: 2b 8c 00 14 lw r12,(sp+20) 8005260: 2b 8d 00 10 lw r13,(sp+16) 8005264: 2b 8e 00 0c lw r14,(sp+12) 8005268: 2b 8f 00 08 lw r15,(sp+8) 800526c: 37 9c 00 18 addi sp,sp,24 8005270: c3 a0 00 00 ret =============================================================================== 08004644 : int32_t baud ) { int termios_baud; switch (baud) { 8004644: 34 03 04 b0 mvi r3,1200 case 134: termios_baud = B134; break; case 150: termios_baud = B150; break; case 200: termios_baud = B200; break; case 300: termios_baud = B300; break; case 600: termios_baud = B600; break; case 1200: termios_baud = B1200; break; 8004648: 34 02 00 09 mvi r2,9 int32_t baud ) { int termios_baud; switch (baud) { 800464c: 44 23 00 48 be r1,r3,800476c 8004650: 48 23 00 1f bg r1,r3,80046cc 8004654: 34 03 00 86 mvi r3,134 case 0: termios_baud = B0; break; case 50: termios_baud = B50; break; case 75: termios_baud = B75; break; case 110: termios_baud = B110; break; case 134: termios_baud = B134; break; 8004658: 34 02 00 04 mvi r2,4 int32_t baud ) { int termios_baud; switch (baud) { 800465c: 44 23 00 44 be r1,r3,800476c 8004660: 48 23 00 0e bg r1,r3,8004698 8004664: 34 03 00 32 mvi r3,50 case 0: termios_baud = B0; break; case 50: termios_baud = B50; break; 8004668: 34 02 00 01 mvi r2,1 int32_t baud ) { int termios_baud; switch (baud) { 800466c: 44 23 00 40 be r1,r3,800476c 8004670: 48 23 00 04 bg r1,r3,8004680 case 0: termios_baud = B0; break; 8004674: 34 02 00 00 mvi r2,0 int32_t baud ) { int termios_baud; switch (baud) { 8004678: 5c 20 00 3c bne r1,r0,8004768 800467c: e0 00 00 3c bi 800476c 8004680: 34 03 00 4b mvi r3,75 case 0: termios_baud = B0; break; case 50: termios_baud = B50; break; case 75: termios_baud = B75; break; 8004684: 34 02 00 02 mvi r2,2 int32_t baud ) { int termios_baud; switch (baud) { 8004688: 44 23 00 39 be r1,r3,800476c case 0: termios_baud = B0; break; case 50: termios_baud = B50; break; case 75: termios_baud = B75; break; case 110: termios_baud = B110; break; 800468c: 34 02 00 03 mvi r2,3 int32_t baud ) { int termios_baud; switch (baud) { 8004690: 34 03 00 6e mvi r3,110 8004694: e0 00 00 34 bi 8004764 8004698: 34 03 00 c8 mvi r3,200 case 50: termios_baud = B50; break; case 75: termios_baud = B75; break; case 110: termios_baud = B110; break; case 134: termios_baud = B134; break; case 150: termios_baud = B150; break; case 200: termios_baud = B200; break; 800469c: 34 02 00 06 mvi r2,6 int32_t baud ) { int termios_baud; switch (baud) { 80046a0: 44 23 00 33 be r1,r3,800476c 80046a4: 48 23 00 04 bg r1,r3,80046b4 case 0: termios_baud = B0; break; case 50: termios_baud = B50; break; case 75: termios_baud = B75; break; case 110: termios_baud = B110; break; case 134: termios_baud = B134; break; case 150: termios_baud = B150; break; 80046a8: 34 02 00 05 mvi r2,5 int32_t baud ) { int termios_baud; switch (baud) { 80046ac: 34 03 00 96 mvi r3,150 80046b0: e0 00 00 2d bi 8004764 80046b4: 34 03 01 2c mvi r3,300 case 75: termios_baud = B75; break; case 110: termios_baud = B110; break; case 134: termios_baud = B134; break; case 150: termios_baud = B150; break; case 200: termios_baud = B200; break; case 300: termios_baud = B300; break; 80046b8: 34 02 00 07 mvi r2,7 int32_t baud ) { int termios_baud; switch (baud) { 80046bc: 44 23 00 2c be r1,r3,800476c case 110: termios_baud = B110; break; case 134: termios_baud = B134; break; case 150: termios_baud = B150; break; case 200: termios_baud = B200; break; case 300: termios_baud = B300; break; case 600: termios_baud = B600; break; 80046c0: 34 02 00 08 mvi r2,8 int32_t baud ) { int termios_baud; switch (baud) { 80046c4: 34 03 02 58 mvi r3,600 80046c8: e0 00 00 27 bi 8004764 80046cc: 34 03 4b 00 mvi r3,19200 case 1200: termios_baud = B1200; break; case 1800: termios_baud = B1800; break; case 2400: termios_baud = B2400; break; case 4800: termios_baud = B4800; break; case 9600: termios_baud = B9600; break; case 19200: termios_baud = B19200; break; 80046d0: 34 02 00 0e mvi r2,14 int32_t baud ) { int termios_baud; switch (baud) { 80046d4: 44 23 00 26 be r1,r3,800476c 80046d8: 48 23 00 0e bg r1,r3,8004710 80046dc: 34 03 09 60 mvi r3,2400 case 200: termios_baud = B200; break; case 300: termios_baud = B300; break; case 600: termios_baud = B600; break; case 1200: termios_baud = B1200; break; case 1800: termios_baud = B1800; break; case 2400: termios_baud = B2400; break; 80046e0: 34 02 00 0b mvi r2,11 int32_t baud ) { int termios_baud; switch (baud) { 80046e4: 44 23 00 22 be r1,r3,800476c 80046e8: 48 23 00 04 bg r1,r3,80046f8 case 150: termios_baud = B150; break; case 200: termios_baud = B200; break; case 300: termios_baud = B300; break; case 600: termios_baud = B600; break; case 1200: termios_baud = B1200; break; case 1800: termios_baud = B1800; break; 80046ec: 34 02 00 0a mvi r2,10 int32_t baud ) { int termios_baud; switch (baud) { 80046f0: 34 03 07 08 mvi r3,1800 80046f4: e0 00 00 1c bi 8004764 80046f8: 34 03 12 c0 mvi r3,4800 case 300: termios_baud = B300; break; case 600: termios_baud = B600; break; case 1200: termios_baud = B1200; break; case 1800: termios_baud = B1800; break; case 2400: termios_baud = B2400; break; case 4800: termios_baud = B4800; break; 80046fc: 34 02 00 0c mvi r2,12 int32_t baud ) { int termios_baud; switch (baud) { 8004700: 44 23 00 1b be r1,r3,800476c case 600: termios_baud = B600; break; case 1200: termios_baud = B1200; break; case 1800: termios_baud = B1800; break; case 2400: termios_baud = B2400; break; case 4800: termios_baud = B4800; break; case 9600: termios_baud = B9600; break; 8004704: 34 02 00 0d mvi r2,13 int32_t baud ) { int termios_baud; switch (baud) { 8004708: 34 03 25 80 mvi r3,9600 800470c: e0 00 00 16 bi 8004764 8004710: 78 02 08 01 mvhi r2,0x801 8004714: 38 42 ec a4 ori r2,r2,0xeca4 8004718: 28 43 00 00 lw r3,(r2+0) case 4800: termios_baud = B4800; break; case 9600: termios_baud = B9600; break; case 19200: termios_baud = B19200; break; case 38400: termios_baud = B38400; break; case 57600: termios_baud = B57600; break; case 115200: termios_baud = B115200; break; 800471c: 34 02 10 02 mvi r2,4098 int32_t baud ) { int termios_baud; switch (baud) { 8004720: 44 23 00 13 be r1,r3,800476c 8004724: 48 23 00 07 bg r1,r3,8004740 8004728: 38 03 96 00 mvu r3,0x9600 case 1800: termios_baud = B1800; break; case 2400: termios_baud = B2400; break; case 4800: termios_baud = B4800; break; case 9600: termios_baud = B9600; break; case 19200: termios_baud = B19200; break; case 38400: termios_baud = B38400; break; 800472c: 34 02 00 0f mvi r2,15 int32_t baud ) { int termios_baud; switch (baud) { 8004730: 44 23 00 0f be r1,r3,800476c case 2400: termios_baud = B2400; break; case 4800: termios_baud = B4800; break; case 9600: termios_baud = B9600; break; case 19200: termios_baud = B19200; break; case 38400: termios_baud = B38400; break; case 57600: termios_baud = B57600; break; 8004734: 34 02 10 01 mvi r2,4097 int32_t baud ) { int termios_baud; switch (baud) { 8004738: 34 63 4b 00 addi r3,r3,19200 800473c: e0 00 00 0a bi 8004764 8004740: 78 04 08 01 mvhi r4,0x801 8004744: 38 84 f3 20 ori r4,r4,0xf320 8004748: 28 83 00 00 lw r3,(r4+0) case 9600: termios_baud = B9600; break; case 19200: termios_baud = B19200; break; case 38400: termios_baud = B38400; break; case 57600: termios_baud = B57600; break; case 115200: termios_baud = B115200; break; case 230400: termios_baud = B230400; break; 800474c: 34 02 10 03 mvi r2,4099 int32_t baud ) { int termios_baud; switch (baud) { 8004750: 44 23 00 07 be r1,r3,800476c 8004754: 78 04 08 01 mvhi r4,0x801 8004758: 38 84 f3 24 ori r4,r4,0xf324 800475c: 28 83 00 00 lw r3,(r4+0) case 19200: termios_baud = B19200; break; case 38400: termios_baud = B38400; break; case 57600: termios_baud = B57600; break; case 115200: termios_baud = B115200; break; case 230400: termios_baud = B230400; break; case 460800: termios_baud = B460800; break; 8004760: 34 02 10 04 mvi r2,4100 int32_t baud ) { int termios_baud; switch (baud) { 8004764: 44 23 00 02 be r1,r3,800476c <== ALWAYS TAKEN case 38400: termios_baud = B38400; break; case 57600: termios_baud = B57600; break; case 115200: termios_baud = B115200; break; case 230400: termios_baud = B230400; break; case 460800: termios_baud = B460800; break; default: termios_baud = -1; break; 8004768: 34 02 ff ff mvi r2,-1 } return termios_baud; } 800476c: b8 40 08 00 mv r1,r2 8004770: c3 a0 00 00 ret =============================================================================== 08004804 : rtems_device_major_number major, rtems_device_minor_number minor, void *arg, const rtems_termios_callbacks *callbacks ) { 8004804: 37 9c ff d4 addi sp,sp,-44 8004808: 5b 8b 00 2c sw (sp+44),r11 800480c: 5b 8c 00 28 sw (sp+40),r12 8004810: 5b 8d 00 24 sw (sp+36),r13 8004814: 5b 8e 00 20 sw (sp+32),r14 8004818: 5b 8f 00 1c sw (sp+28),r15 800481c: 5b 90 00 18 sw (sp+24),r16 8004820: 5b 91 00 14 sw (sp+20),r17 8004824: 5b 92 00 10 sw (sp+16),r18 8004828: 5b 93 00 0c sw (sp+12),r19 800482c: 5b 94 00 08 sw (sp+8),r20 8004830: 5b 9d 00 04 sw (sp+4),ra 8004834: b8 20 88 00 mv r17,r1 struct rtems_termios_tty *tty; /* * See if the device has already been opened */ sc = rtems_semaphore_obtain( 8004838: 78 01 08 02 mvhi r1,0x802 800483c: 38 21 19 50 ori r1,r1,0x1950 8004840: 28 21 00 00 lw r1,(r1+0) rtems_device_major_number major, rtems_device_minor_number minor, void *arg, const rtems_termios_callbacks *callbacks ) { 8004844: b8 40 90 00 mv r18,r2 8004848: b8 60 a0 00 mv r20,r3 struct rtems_termios_tty *tty; /* * See if the device has already been opened */ sc = rtems_semaphore_obtain( 800484c: 34 02 00 00 mvi r2,0 8004850: 34 03 00 00 mvi r3,0 rtems_device_major_number major, rtems_device_minor_number minor, void *arg, const rtems_termios_callbacks *callbacks ) { 8004854: b8 80 68 00 mv r13,r4 struct rtems_termios_tty *tty; /* * See if the device has already been opened */ sc = rtems_semaphore_obtain( 8004858: f8 00 09 e6 calli 8006ff0 800485c: b8 20 78 00 mv r15,r1 rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 8004860: 5c 20 01 02 bne r1,r0,8004c68 <== NEVER TAKEN return sc; for (tty = rtems_termios_ttyHead ; tty != NULL ; tty = tty->forw) { 8004864: 78 01 08 02 mvhi r1,0x802 8004868: 38 21 19 58 ori r1,r1,0x1958 800486c: 28 2e 00 00 lw r14,(r1+0) 8004870: b9 c0 60 00 mv r12,r14 8004874: e0 00 00 06 bi 800488c if ((tty->major == major) && (tty->minor == minor)) 8004878: 29 81 00 0c lw r1,(r12+12) <== NOT EXECUTED 800487c: 5c 31 00 03 bne r1,r17,8004888 <== NOT EXECUTED 8004880: 29 81 00 10 lw r1,(r12+16) <== NOT EXECUTED 8004884: 44 32 00 d8 be r1,r18,8004be4 <== NOT EXECUTED sc = rtems_semaphore_obtain( rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) return sc; for (tty = rtems_termios_ttyHead ; tty != NULL ; tty = tty->forw) { 8004888: 29 8c 00 00 lw r12,(r12+0) <== NOT EXECUTED 800488c: 5d 80 ff fb bne r12,r0,8004878 <== NEVER TAKEN 8004890: e0 00 01 04 bi 8004ca0 return RTEMS_NO_MEMORY; } /* * allocate raw input buffer */ tty->rawInBuf.Size = RAW_INPUT_BUFFER_SIZE; 8004894: 78 01 08 02 mvhi r1,0x802 8004898: 38 21 12 44 ori r1,r1,0x1244 800489c: 28 21 00 00 lw r1,(r1+0) 80048a0: 59 81 00 64 sw (r12+100),r1 tty->rawInBuf.theBuf = malloc (tty->rawInBuf.Size); 80048a4: 29 81 00 64 lw r1,(r12+100) 80048a8: fb ff fb 5a calli 8003610 80048ac: 59 81 00 58 sw (r12+88),r1 80048b0: b8 20 80 00 mv r16,r1 if (tty->rawInBuf.theBuf == NULL) { 80048b4: 5c 20 00 09 bne r1,r0,80048d8 <== ALWAYS TAKEN free(tty); 80048b8: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 80048bc: fb ff f9 9d calli 8002f30 <== NOT EXECUTED rtems_semaphore_release (rtems_termios_ttyMutex); 80048c0: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 80048c4: 38 21 19 50 ori r1,r1,0x1950 <== NOT EXECUTED 80048c8: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED return RTEMS_NO_MEMORY; 80048cc: 34 0f 00 1a mvi r15,26 <== NOT EXECUTED */ tty->rawInBuf.Size = RAW_INPUT_BUFFER_SIZE; tty->rawInBuf.theBuf = malloc (tty->rawInBuf.Size); if (tty->rawInBuf.theBuf == NULL) { free(tty); rtems_semaphore_release (rtems_termios_ttyMutex); 80048d0: f8 00 0a 18 calli 8007130 <== NOT EXECUTED return RTEMS_NO_MEMORY; 80048d4: e0 00 00 e5 bi 8004c68 <== NOT EXECUTED } /* * allocate raw output buffer */ tty->rawOutBuf.Size = RAW_OUTPUT_BUFFER_SIZE; 80048d8: 78 01 08 02 mvhi r1,0x802 80048dc: 38 21 12 48 ori r1,r1,0x1248 80048e0: 28 21 00 00 lw r1,(r1+0) 80048e4: 59 81 00 88 sw (r12+136),r1 tty->rawOutBuf.theBuf = malloc (tty->rawOutBuf.Size); 80048e8: 29 81 00 88 lw r1,(r12+136) 80048ec: fb ff fb 49 calli 8003610 80048f0: 59 81 00 7c sw (r12+124),r1 80048f4: b8 20 98 00 mv r19,r1 if (tty->rawOutBuf.theBuf == NULL) { 80048f8: 44 20 00 09 be r1,r0,800491c <== NEVER TAKEN return RTEMS_NO_MEMORY; } /* * allocate cooked buffer */ tty->cbuf = malloc (CBUFSIZE); 80048fc: 78 01 08 02 mvhi r1,0x802 8004900: 38 21 12 40 ori r1,r1,0x1240 8004904: 28 21 00 00 lw r1,(r1+0) 8004908: fb ff fb 42 calli 8003610 800490c: 59 81 00 1c sw (r12+28),r1 if (tty->cbuf == NULL) { 8004910: 5c 20 00 06 bne r1,r0,8004928 <== ALWAYS TAKEN free((void *)(tty->rawOutBuf.theBuf)); 8004914: ba 60 08 00 mv r1,r19 <== NOT EXECUTED 8004918: fb ff f9 86 calli 8002f30 <== NOT EXECUTED free((void *)(tty->rawInBuf.theBuf)); 800491c: ba 00 08 00 mv r1,r16 <== NOT EXECUTED 8004920: fb ff f9 84 calli 8002f30 <== NOT EXECUTED 8004924: e3 ff ff e5 bi 80048b8 <== NOT EXECUTED return RTEMS_NO_MEMORY; } /* * Initialize wakeup callbacks */ tty->tty_snd.sw_pfn = NULL; 8004928: 59 80 00 d4 sw (r12+212),r0 tty->tty_snd.sw_arg = NULL; 800492c: 59 80 00 d8 sw (r12+216),r0 tty->tty_rcv.sw_pfn = NULL; 8004930: 59 80 00 dc sw (r12+220),r0 tty->tty_rcv.sw_arg = NULL; 8004934: 59 80 00 e0 sw (r12+224),r0 tty->tty_rcvwakeup = 0; 8004938: 59 80 00 e4 sw (r12+228),r0 /* * link tty */ tty->forw = rtems_termios_ttyHead; 800493c: 59 8e 00 00 sw (r12+0),r14 tty->back = NULL; 8004940: 59 80 00 04 sw (r12+4),r0 if (rtems_termios_ttyHead != NULL) 8004944: 45 c0 00 02 be r14,r0,800494c <== ALWAYS TAKEN rtems_termios_ttyHead->back = tty; 8004948: 59 cc 00 04 sw (r14+4),r12 <== NOT EXECUTED rtems_termios_ttyHead = tty; 800494c: 78 01 08 02 mvhi r1,0x802 if (rtems_termios_ttyTail == NULL) 8004950: 78 04 08 02 mvhi r4,0x802 */ tty->forw = rtems_termios_ttyHead; tty->back = NULL; if (rtems_termios_ttyHead != NULL) rtems_termios_ttyHead->back = tty; rtems_termios_ttyHead = tty; 8004954: 38 21 19 58 ori r1,r1,0x1958 if (rtems_termios_ttyTail == NULL) 8004958: 38 84 19 54 ori r4,r4,0x1954 */ tty->forw = rtems_termios_ttyHead; tty->back = NULL; if (rtems_termios_ttyHead != NULL) rtems_termios_ttyHead->back = tty; rtems_termios_ttyHead = tty; 800495c: 58 2b 00 00 sw (r1+0),r11 if (rtems_termios_ttyTail == NULL) 8004960: 28 81 00 00 lw r1,(r4+0) 8004964: 5c 20 00 02 bne r1,r0,800496c <== NEVER TAKEN rtems_termios_ttyTail = tty; 8004968: 58 8b 00 00 sw (r4+0),r11 /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( rtems_build_name ('T', 'R', 'i', c), 800496c: 78 0e 08 02 mvhi r14,0x802 tty->major = major; /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( 8004970: 78 03 08 01 mvhi r3,0x801 8004974: 38 63 f3 2c ori r3,r3,0xf32c rtems_build_name ('T', 'R', 'i', c), 8004978: 39 ce 12 4c ori r14,r14,0x124c 800497c: 41 c2 00 00 lbu r2,(r14+0) tty->major = major; /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( 8004980: 28 61 00 00 lw r1,(r3+0) rtems_termios_ttyHead->back = tty; rtems_termios_ttyHead = tty; if (rtems_termios_ttyTail == NULL) rtems_termios_ttyTail = tty; tty->minor = minor; 8004984: 59 72 00 10 sw (r11+16),r18 tty->major = major; 8004988: 59 71 00 0c sw (r11+12),r17 /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( 800498c: b8 41 08 00 or r1,r2,r1 8004990: 34 03 00 54 mvi r3,84 8004994: 34 02 00 01 mvi r2,1 8004998: 34 04 00 00 mvi r4,0 800499c: 35 65 00 14 addi r5,r11,20 80049a0: f8 00 08 e8 calli 8006d40 80049a4: b8 20 80 00 mv r16,r1 rtems_build_name ('T', 'R', 'i', c), 1, RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &tty->isem); if (sc != RTEMS_SUCCESSFUL) 80049a8: 5c 20 00 ab bne r1,r0,8004c54 <== NEVER TAKEN rtems_fatal_error_occurred (sc); sc = rtems_semaphore_create ( 80049ac: 78 03 08 01 mvhi r3,0x801 80049b0: 38 63 f3 30 ori r3,r3,0xf330 rtems_build_name ('T', 'R', 'o', c), 80049b4: 41 c2 00 00 lbu r2,(r14+0) RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &tty->isem); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); sc = rtems_semaphore_create ( 80049b8: 28 61 00 00 lw r1,(r3+0) 80049bc: 34 04 00 00 mvi r4,0 80049c0: 34 03 00 54 mvi r3,84 80049c4: b8 41 08 00 or r1,r2,r1 80049c8: 35 65 00 18 addi r5,r11,24 80049cc: 34 02 00 01 mvi r2,1 80049d0: f8 00 08 dc calli 8006d40 80049d4: b8 20 98 00 mv r19,r1 rtems_build_name ('T', 'R', 'o', c), 1, RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &tty->osem); if (sc != RTEMS_SUCCESSFUL) 80049d8: 5c 30 00 9f bne r1,r16,8004c54 <== NEVER TAKEN rtems_fatal_error_occurred (sc); sc = rtems_semaphore_create ( 80049dc: 78 03 08 01 mvhi r3,0x801 80049e0: 38 63 f3 34 ori r3,r3,0xf334 rtems_build_name ('T', 'R', 'x', c), 80049e4: 41 c2 00 00 lbu r2,(r14+0) RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &tty->osem); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); sc = rtems_semaphore_create ( 80049e8: 28 61 00 00 lw r1,(r3+0) 80049ec: 34 04 00 00 mvi r4,0 80049f0: 34 03 00 20 mvi r3,32 80049f4: b8 41 08 00 or r1,r2,r1 80049f8: 35 65 00 8c addi r5,r11,140 80049fc: 34 02 00 00 mvi r2,0 8004a00: f8 00 08 d0 calli 8006d40 8004a04: b8 20 80 00 mv r16,r1 rtems_build_name ('T', 'R', 'x', c), 0, RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_FIFO, RTEMS_NO_PRIORITY, &tty->rawOutBuf.Semaphore); if (sc != RTEMS_SUCCESSFUL) 8004a08: 5c 33 00 93 bne r1,r19,8004c54 <== NEVER TAKEN tty->rawOutBufState = rob_idle; /* * Set callbacks */ tty->device = *callbacks; 8004a0c: 29 a2 00 18 lw r2,(r13+24) 8004a10: 29 a8 00 00 lw r8,(r13+0) 8004a14: 29 a7 00 04 lw r7,(r13+4) 8004a18: 29 a6 00 08 lw r6,(r13+8) 8004a1c: 29 a5 00 0c lw r5,(r13+12) 8004a20: 29 a4 00 10 lw r4,(r13+16) 8004a24: 29 a3 00 14 lw r3,(r13+20) 8004a28: 29 a1 00 1c lw r1,(r13+28) RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_FIFO, RTEMS_NO_PRIORITY, &tty->rawOutBuf.Semaphore); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); tty->rawOutBufState = rob_idle; 8004a2c: 59 60 00 94 sw (r11+148),r0 /* * Set callbacks */ tty->device = *callbacks; 8004a30: 59 62 00 b0 sw (r11+176),r2 8004a34: 59 68 00 98 sw (r11+152),r8 8004a38: 59 67 00 9c sw (r11+156),r7 8004a3c: 59 66 00 a0 sw (r11+160),r6 8004a40: 59 65 00 a4 sw (r11+164),r5 8004a44: 59 64 00 a8 sw (r11+168),r4 8004a48: 59 63 00 ac sw (r11+172),r3 8004a4c: 59 61 00 b4 sw (r11+180),r1 /* * Create I/O tasks */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 8004a50: 34 02 00 02 mvi r2,2 8004a54: 5c 22 00 1a bne r1,r2,8004abc sc = rtems_task_create ( 8004a58: 78 03 08 01 mvhi r3,0x801 8004a5c: 38 63 f3 38 ori r3,r3,0xf338 rtems_build_name ('T', 'x', 'T', c), 8004a60: 41 c2 00 00 lbu r2,(r14+0) /* * Create I/O tasks */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { sc = rtems_task_create ( 8004a64: 28 61 00 00 lw r1,(r3+0) 8004a68: 34 04 05 00 mvi r4,1280 8004a6c: 34 03 04 00 mvi r3,1024 8004a70: b8 41 08 00 or r1,r2,r1 8004a74: 34 05 00 00 mvi r5,0 8004a78: 34 02 00 0a mvi r2,10 8004a7c: 35 66 00 c8 addi r6,r11,200 8004a80: f8 00 09 ea calli 8007228 8004a84: b8 20 68 00 mv r13,r1 TERMIOS_TXTASK_STACKSIZE, RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, &tty->txTaskId); if (sc != RTEMS_SUCCESSFUL) 8004a88: 5c 30 00 73 bne r1,r16,8004c54 <== NEVER TAKEN rtems_fatal_error_occurred (sc); sc = rtems_task_create ( 8004a8c: 78 03 08 01 mvhi r3,0x801 8004a90: 38 63 f3 3c ori r3,r3,0xf33c rtems_build_name ('R', 'x', 'T', c), 8004a94: 41 c2 00 00 lbu r2,(r14+0) RTEMS_NO_ASR, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, &tty->txTaskId); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); sc = rtems_task_create ( 8004a98: 28 61 00 00 lw r1,(r3+0) 8004a9c: 34 04 05 00 mvi r4,1280 8004aa0: 34 03 04 00 mvi r3,1024 8004aa4: b8 41 08 00 or r1,r2,r1 8004aa8: 34 05 00 00 mvi r5,0 8004aac: 34 02 00 09 mvi r2,9 8004ab0: 35 66 00 c4 addi r6,r11,196 8004ab4: f8 00 09 dd calli 8007228 TERMIOS_RXTASK_STACKSIZE, RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, &tty->rxTaskId); if (sc != RTEMS_SUCCESSFUL) 8004ab8: 5c 2d 00 67 bne r1,r13,8004c54 <== NEVER TAKEN rtems_fatal_error_occurred (sc); } if ((tty->device.pollRead == NULL) || 8004abc: 29 61 00 a0 lw r1,(r11+160) 8004ac0: 44 20 00 04 be r1,r0,8004ad0 8004ac4: 29 62 00 b4 lw r2,(r11+180) 8004ac8: 34 01 00 02 mvi r1,2 8004acc: 5c 41 00 0e bne r2,r1,8004b04 (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){ sc = rtems_semaphore_create ( rtems_build_name ('T', 'R', 'r', c), 8004ad0: 78 01 08 02 mvhi r1,0x802 rtems_fatal_error_occurred (sc); } if ((tty->device.pollRead == NULL) || (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){ sc = rtems_semaphore_create ( 8004ad4: 78 03 08 01 mvhi r3,0x801 rtems_build_name ('T', 'R', 'r', c), 8004ad8: 38 21 12 4c ori r1,r1,0x124c rtems_fatal_error_occurred (sc); } if ((tty->device.pollRead == NULL) || (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){ sc = rtems_semaphore_create ( 8004adc: 38 63 f3 40 ori r3,r3,0xf340 rtems_build_name ('T', 'R', 'r', c), 8004ae0: 40 22 00 00 lbu r2,(r1+0) rtems_fatal_error_occurred (sc); } if ((tty->device.pollRead == NULL) || (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){ sc = rtems_semaphore_create ( 8004ae4: 28 61 00 00 lw r1,(r3+0) 8004ae8: 34 04 00 00 mvi r4,0 8004aec: 34 03 00 24 mvi r3,36 8004af0: b8 41 08 00 or r1,r2,r1 8004af4: 35 65 00 68 addi r5,r11,104 8004af8: 34 02 00 00 mvi r2,0 8004afc: f8 00 08 91 calli 8006d40 rtems_build_name ('T', 'R', 'r', c), 0, RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &tty->rawInBuf.Semaphore); if (sc != RTEMS_SUCCESSFUL) 8004b00: 5c 20 00 55 bne r1,r0,8004c54 <== NEVER TAKEN } /* * Set default parameters */ tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL; 8004b04: 34 01 25 02 mvi r1,9474 8004b08: 59 61 00 30 sw (r11+48),r1 tty->termios.c_oflag = OPOST | ONLCR | XTABS; 8004b0c: 34 01 18 05 mvi r1,6149 8004b10: 59 61 00 34 sw (r11+52),r1 tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL; 8004b14: 34 01 08 bd mvi r1,2237 8004b18: 59 61 00 38 sw (r11+56),r1 tty->termios.c_lflag = 8004b1c: 34 21 79 7e addi r1,r1,31102 8004b20: 59 61 00 3c sw (r11+60),r1 ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL; tty->termios.c_cc[VINTR] = '\003'; 8004b24: 34 01 00 03 mvi r1,3 8004b28: 31 61 00 41 sb (r11+65),r1 tty->termios.c_cc[VQUIT] = '\034'; 8004b2c: 34 01 00 1c mvi r1,28 8004b30: 31 61 00 42 sb (r11+66),r1 tty->termios.c_cc[VERASE] = '\177'; 8004b34: 34 01 00 7f mvi r1,127 8004b38: 31 61 00 43 sb (r11+67),r1 tty->termios.c_cc[VKILL] = '\025'; 8004b3c: 34 01 00 15 mvi r1,21 8004b40: 31 61 00 44 sb (r11+68),r1 tty->termios.c_cc[VEOF] = '\004'; 8004b44: 34 01 00 04 mvi r1,4 8004b48: 31 61 00 45 sb (r11+69),r1 tty->termios.c_cc[VEOL] = '\000'; tty->termios.c_cc[VEOL2] = '\000'; tty->termios.c_cc[VSTART] = '\021'; 8004b4c: 34 01 00 11 mvi r1,17 8004b50: 31 61 00 49 sb (r11+73),r1 tty->termios.c_cc[VSTOP] = '\023'; 8004b54: 34 01 00 13 mvi r1,19 8004b58: 31 61 00 4a sb (r11+74),r1 tty->termios.c_cc[VSUSP] = '\032'; 8004b5c: 34 01 00 1a mvi r1,26 8004b60: 31 61 00 4b sb (r11+75),r1 tty->termios.c_cc[VREPRINT] = '\022'; 8004b64: 34 01 00 12 mvi r1,18 8004b68: 31 61 00 4d sb (r11+77),r1 tty->termios.c_cc[VDISCARD] = '\017'; 8004b6c: 34 01 00 0f mvi r1,15 8004b70: 31 61 00 4e sb (r11+78),r1 tty->termios.c_cc[VWERASE] = '\027'; 8004b74: 34 01 00 17 mvi r1,23 8004b78: 31 61 00 4f sb (r11+79),r1 tty->termios.c_cc[VLNEXT] = '\026'; /* start with no flow control, clear flow control flags */ tty->flow_ctrl = 0; 8004b7c: 59 60 00 b8 sw (r11+184),r0 tty->termios.c_cc[VSTOP] = '\023'; tty->termios.c_cc[VSUSP] = '\032'; tty->termios.c_cc[VREPRINT] = '\022'; tty->termios.c_cc[VDISCARD] = '\017'; tty->termios.c_cc[VWERASE] = '\027'; tty->termios.c_cc[VLNEXT] = '\026'; 8004b80: 34 01 00 16 mvi r1,22 8004b84: 31 61 00 50 sb (r11+80),r1 /* start with no flow control, clear flow control flags */ tty->flow_ctrl = 0; /* * set low/highwater mark for XON/XOFF support */ tty->lowwater = tty->rawInBuf.Size * 1/2; 8004b88: 29 61 00 64 lw r1,(r11+100) 8004b8c: 34 02 00 01 mvi r2,1 tty->termios.c_cc[VINTR] = '\003'; tty->termios.c_cc[VQUIT] = '\034'; tty->termios.c_cc[VERASE] = '\177'; tty->termios.c_cc[VKILL] = '\025'; tty->termios.c_cc[VEOF] = '\004'; tty->termios.c_cc[VEOL] = '\000'; 8004b90: 31 60 00 4c sb (r11+76),r0 tty->termios.c_cc[VEOL2] = '\000'; 8004b94: 31 60 00 51 sb (r11+81),r0 /* start with no flow control, clear flow control flags */ tty->flow_ctrl = 0; /* * set low/highwater mark for XON/XOFF support */ tty->lowwater = tty->rawInBuf.Size * 1/2; 8004b98: f8 00 62 2a calli 801d440 <__lshrsi3> tty->highwater = tty->rawInBuf.Size * 3/4; 8004b9c: 29 6d 00 64 lw r13,(r11+100) /* start with no flow control, clear flow control flags */ tty->flow_ctrl = 0; /* * set low/highwater mark for XON/XOFF support */ tty->lowwater = tty->rawInBuf.Size * 1/2; 8004ba0: 59 61 00 bc sw (r11+188),r1 tty->highwater = tty->rawInBuf.Size * 3/4; 8004ba4: 34 02 00 01 mvi r2,1 8004ba8: b9 a0 08 00 mv r1,r13 8004bac: fb ff f3 32 calli 8001874 <__ashlsi3> 8004bb0: 34 02 00 02 mvi r2,2 8004bb4: b4 2d 08 00 add r1,r1,r13 8004bb8: f8 00 62 22 calli 801d440 <__lshrsi3> /* * Bump name characer */ if (c++ == 'z') 8004bbc: 78 04 08 02 mvhi r4,0x802 8004bc0: 38 84 12 4c ori r4,r4,0x124c tty->flow_ctrl = 0; /* * set low/highwater mark for XON/XOFF support */ tty->lowwater = tty->rawInBuf.Size * 1/2; tty->highwater = tty->rawInBuf.Size * 3/4; 8004bc4: 59 61 00 c0 sw (r11+192),r1 /* * Bump name characer */ if (c++ == 'z') 8004bc8: 40 81 00 00 lbu r1,(r4+0) 8004bcc: 34 22 00 01 addi r2,r1,1 8004bd0: 30 82 00 00 sb (r4+0),r2 8004bd4: 34 02 00 7a mvi r2,122 8004bd8: 5c 22 00 03 bne r1,r2,8004be4 <== ALWAYS TAKEN c = 'a'; 8004bdc: 34 01 00 61 mvi r1,97 <== NOT EXECUTED 8004be0: 30 81 00 00 sb (r4+0),r1 <== NOT EXECUTED } args->iop->data1 = tty; 8004be4: 2a 81 00 00 lw r1,(r20+0) if (!tty->refcount++) { 8004be8: 29 82 00 08 lw r2,(r12+8) */ if (c++ == 'z') c = 'a'; } args->iop->data1 = tty; 8004bec: 58 2c 00 38 sw (r1+56),r12 if (!tty->refcount++) { 8004bf0: 34 41 00 01 addi r1,r2,1 8004bf4: 59 81 00 08 sw (r12+8),r1 8004bf8: 5c 40 00 18 bne r2,r0,8004c58 <== NEVER TAKEN if (tty->device.firstOpen) 8004bfc: 29 84 00 98 lw r4,(r12+152) 8004c00: 44 82 00 05 be r4,r2,8004c14 <== ALWAYS TAKEN (*tty->device.firstOpen)(major, minor, arg); 8004c04: ba 20 08 00 mv r1,r17 <== NOT EXECUTED 8004c08: ba 40 10 00 mv r2,r18 <== NOT EXECUTED 8004c0c: ba 80 18 00 mv r3,r20 <== NOT EXECUTED 8004c10: d8 80 00 00 call r4 <== NOT EXECUTED /* * start I/O tasks, if needed */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 8004c14: 29 82 00 b4 lw r2,(r12+180) 8004c18: 34 01 00 02 mvi r1,2 8004c1c: 5c 41 00 0f bne r2,r1,8004c58 sc = rtems_task_start( 8004c20: 29 81 00 c4 lw r1,(r12+196) 8004c24: 78 02 08 00 mvhi r2,0x800 8004c28: 38 42 61 84 ori r2,r2,0x6184 8004c2c: b9 80 18 00 mv r3,r12 8004c30: f8 00 0a 26 calli 80074c8 8004c34: b8 20 58 00 mv r11,r1 tty->rxTaskId, rtems_termios_rxdaemon, (rtems_task_argument)tty); if (sc != RTEMS_SUCCESSFUL) 8004c38: 5c 20 00 07 bne r1,r0,8004c54 <== NEVER TAKEN rtems_fatal_error_occurred (sc); sc = rtems_task_start( 8004c3c: 29 81 00 c8 lw r1,(r12+200) 8004c40: 78 02 08 00 mvhi r2,0x800 8004c44: 38 42 64 04 ori r2,r2,0x6404 8004c48: b9 80 18 00 mv r3,r12 8004c4c: f8 00 0a 1f calli 80074c8 tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty); if (sc != RTEMS_SUCCESSFUL) 8004c50: 44 2b 00 02 be r1,r11,8004c58 <== ALWAYS TAKEN rtems_fatal_error_occurred (sc); 8004c54: f8 00 0a c3 calli 8007760 <== NOT EXECUTED } } rtems_semaphore_release (rtems_termios_ttyMutex); 8004c58: 78 01 08 02 mvhi r1,0x802 8004c5c: 38 21 19 50 ori r1,r1,0x1950 8004c60: 28 21 00 00 lw r1,(r1+0) 8004c64: f8 00 09 33 calli 8007130 return RTEMS_SUCCESSFUL; } 8004c68: b9 e0 08 00 mv r1,r15 8004c6c: 2b 9d 00 04 lw ra,(sp+4) 8004c70: 2b 8b 00 2c lw r11,(sp+44) 8004c74: 2b 8c 00 28 lw r12,(sp+40) 8004c78: 2b 8d 00 24 lw r13,(sp+36) 8004c7c: 2b 8e 00 20 lw r14,(sp+32) 8004c80: 2b 8f 00 1c lw r15,(sp+28) 8004c84: 2b 90 00 18 lw r16,(sp+24) 8004c88: 2b 91 00 14 lw r17,(sp+20) 8004c8c: 2b 92 00 10 lw r18,(sp+16) 8004c90: 2b 93 00 0c lw r19,(sp+12) 8004c94: 2b 94 00 08 lw r20,(sp+8) 8004c98: 37 9c 00 2c addi sp,sp,44 8004c9c: c3 a0 00 00 ret static char c = 'a'; /* * Create a new device */ tty = calloc (1, sizeof (struct rtems_termios_tty)); 8004ca0: 34 01 00 01 mvi r1,1 8004ca4: 34 02 00 e8 mvi r2,232 8004ca8: fb ff f6 e6 calli 8002840 8004cac: b8 20 60 00 mv r12,r1 8004cb0: b8 20 58 00 mv r11,r1 if (tty == NULL) { 8004cb4: 5c 20 fe f8 bne r1,r0,8004894 <== ALWAYS TAKEN 8004cb8: e3 ff ff 02 bi 80048c0 <== NOT EXECUTED =============================================================================== 08005274 : * Send characters to device-specific code */ void rtems_termios_puts ( const void *_buf, int len, struct rtems_termios_tty *tty) { 8005274: 37 9c ff dc addi sp,sp,-36 8005278: 5b 8b 00 24 sw (sp+36),r11 800527c: 5b 8c 00 20 sw (sp+32),r12 8005280: 5b 8d 00 1c sw (sp+28),r13 8005284: 5b 8e 00 18 sw (sp+24),r14 8005288: 5b 8f 00 14 sw (sp+20),r15 800528c: 5b 90 00 10 sw (sp+16),r16 8005290: 5b 91 00 0c sw (sp+12),r17 8005294: 5b 92 00 08 sw (sp+8),r18 8005298: 5b 9d 00 04 sw (sp+4),ra 800529c: b8 20 20 00 mv r4,r1 const unsigned char *buf = _buf; 80052a0: b8 20 68 00 mv r13,r1 unsigned int newHead; rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) { 80052a4: 28 61 00 b4 lw r1,(r3+180) * Send characters to device-specific code */ void rtems_termios_puts ( const void *_buf, int len, struct rtems_termios_tty *tty) { 80052a8: b8 40 70 00 mv r14,r2 80052ac: b8 60 58 00 mv r11,r3 const unsigned char *buf = _buf; unsigned int newHead; rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) { 80052b0: 5c 20 00 07 bne r1,r0,80052cc (*tty->device.write)(tty->minor, (void *)buf, len); 80052b4: 28 65 00 a4 lw r5,(r3+164) 80052b8: 28 61 00 10 lw r1,(r3+16) 80052bc: b8 80 10 00 mv r2,r4 80052c0: b9 c0 18 00 mv r3,r14 80052c4: d8 a0 00 00 call r5 return; 80052c8: e0 00 00 36 bi 80053a0 } newHead = tty->rawOutBuf.Head; 80052cc: 28 6c 00 80 lw r12,(r3+128) * * To minimize latency, the memcpy should be done * with interrupts enabled. */ newHead = (newHead + 1) % tty->rawOutBuf.Size; rtems_interrupt_disable (level); 80052d0: 34 10 ff fe mvi r16,-2 while (newHead == tty->rawOutBuf.Tail) { tty->rawOutBufState = rob_wait; 80052d4: 34 12 00 02 mvi r18,2 (char *)&tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); } else { /* remember that output has been stopped due to flow ctrl*/ tty->flow_ctrl |= FL_OSTOP; } tty->rawOutBufState = rob_busy; 80052d8: 34 11 00 01 mvi r17,1 if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) { (*tty->device.write)(tty->minor, (void *)buf, len); return; } newHead = tty->rawOutBuf.Head; while (len) { 80052dc: e0 00 00 30 bi 800539c * len -= ncopy * * To minimize latency, the memcpy should be done * with interrupts enabled. */ newHead = (newHead + 1) % tty->rawOutBuf.Size; 80052e0: 29 62 00 88 lw r2,(r11+136) 80052e4: 35 81 00 01 addi r1,r12,1 80052e8: f8 00 60 f2 calli 801d6b0 <__umodsi3> 80052ec: b8 20 60 00 mv r12,r1 rtems_interrupt_disable (level); 80052f0: 90 00 78 00 rcsr r15,IE 80052f4: a1 f0 08 00 and r1,r15,r16 80052f8: d0 01 00 00 wcsr IE,r1 while (newHead == tty->rawOutBuf.Tail) { 80052fc: e0 00 00 0c bi 800532c tty->rawOutBufState = rob_wait; 8005300: 59 72 00 94 sw (r11+148),r18 rtems_interrupt_enable (level); 8005304: d0 0f 00 00 wcsr IE,r15 sc = rtems_semaphore_obtain( 8005308: 29 61 00 8c lw r1,(r11+140) 800530c: 34 02 00 00 mvi r2,0 8005310: 34 03 00 00 mvi r3,0 8005314: f8 00 07 37 calli 8006ff0 tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 8005318: 44 20 00 02 be r1,r0,8005320 <== ALWAYS TAKEN rtems_fatal_error_occurred (sc); 800531c: f8 00 09 11 calli 8007760 <== NOT EXECUTED rtems_interrupt_disable (level); 8005320: 90 00 78 00 rcsr r15,IE 8005324: a1 f0 08 00 and r1,r15,r16 8005328: d0 01 00 00 wcsr IE,r1 * To minimize latency, the memcpy should be done * with interrupts enabled. */ newHead = (newHead + 1) % tty->rawOutBuf.Size; rtems_interrupt_disable (level); while (newHead == tty->rawOutBuf.Tail) { 800532c: 29 61 00 84 lw r1,(r11+132) 8005330: 45 81 ff f4 be r12,r1,8005300 tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } tty->rawOutBuf.theBuf[tty->rawOutBuf.Head] = *buf++; 8005334: 29 61 00 80 lw r1,(r11+128) 8005338: 29 62 00 7c lw r2,(r11+124) 800533c: b4 41 08 00 add r1,r2,r1 8005340: 41 a2 00 00 lbu r2,(r13+0) 8005344: 35 ad 00 01 addi r13,r13,1 8005348: 30 22 00 00 sb (r1+0),r2 tty->rawOutBuf.Head = newHead; if (tty->rawOutBufState == rob_idle) { 800534c: 29 61 00 94 lw r1,(r11+148) if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } tty->rawOutBuf.theBuf[tty->rawOutBuf.Head] = *buf++; tty->rawOutBuf.Head = newHead; 8005350: 59 6c 00 80 sw (r11+128),r12 if (tty->rawOutBufState == rob_idle) { 8005354: 5c 20 00 10 bne r1,r0,8005394 /* check, whether XOFF has been received */ if (!(tty->flow_ctrl & FL_ORCVXOF)) { 8005358: 29 62 00 b8 lw r2,(r11+184) 800535c: 20 42 00 10 andi r2,r2,0x10 8005360: 5c 41 00 09 bne r2,r1,8005384 <== NEVER TAKEN (*tty->device.write)(tty->minor, 8005364: 29 63 00 7c lw r3,(r11+124) (char *)&tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); 8005368: 29 62 00 84 lw r2,(r11+132) tty->rawOutBuf.theBuf[tty->rawOutBuf.Head] = *buf++; tty->rawOutBuf.Head = newHead; if (tty->rawOutBufState == rob_idle) { /* check, whether XOFF has been received */ if (!(tty->flow_ctrl & FL_ORCVXOF)) { (*tty->device.write)(tty->minor, 800536c: 29 64 00 a4 lw r4,(r11+164) 8005370: 29 61 00 10 lw r1,(r11+16) 8005374: b4 62 10 00 add r2,r3,r2 8005378: 34 03 00 01 mvi r3,1 800537c: d8 80 00 00 call r4 8005380: e0 00 00 04 bi 8005390 (char *)&tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); } else { /* remember that output has been stopped due to flow ctrl*/ tty->flow_ctrl |= FL_OSTOP; 8005384: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8005388: 38 21 00 20 ori r1,r1,0x20 <== NOT EXECUTED 800538c: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED } tty->rawOutBufState = rob_busy; 8005390: 59 71 00 94 sw (r11+148),r17 } rtems_interrupt_enable (level); 8005394: d0 0f 00 00 wcsr IE,r15 len--; 8005398: 35 ce ff ff addi r14,r14,-1 if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) { (*tty->device.write)(tty->minor, (void *)buf, len); return; } newHead = tty->rawOutBuf.Head; while (len) { 800539c: 5d c0 ff d1 bne r14,r0,80052e0 tty->rawOutBufState = rob_busy; } rtems_interrupt_enable (level); len--; } } 80053a0: 2b 9d 00 04 lw ra,(sp+4) 80053a4: 2b 8b 00 24 lw r11,(sp+36) 80053a8: 2b 8c 00 20 lw r12,(sp+32) 80053ac: 2b 8d 00 1c lw r13,(sp+28) 80053b0: 2b 8e 00 18 lw r14,(sp+24) 80053b4: 2b 8f 00 14 lw r15,(sp+20) 80053b8: 2b 90 00 10 lw r16,(sp+16) 80053bc: 2b 91 00 0c lw r17,(sp+12) 80053c0: 2b 92 00 08 lw r18,(sp+8) 80053c4: 37 9c 00 24 addi sp,sp,36 80053c8: c3 a0 00 00 ret =============================================================================== 08005aec : return RTEMS_SUCCESSFUL; } rtems_status_code rtems_termios_read (void *arg) { 8005aec: 37 9c ff cc addi sp,sp,-52 8005af0: 5b 8b 00 34 sw (sp+52),r11 8005af4: 5b 8c 00 30 sw (sp+48),r12 8005af8: 5b 8d 00 2c sw (sp+44),r13 8005afc: 5b 8e 00 28 sw (sp+40),r14 8005b00: 5b 8f 00 24 sw (sp+36),r15 8005b04: 5b 90 00 20 sw (sp+32),r16 8005b08: 5b 91 00 1c sw (sp+28),r17 8005b0c: 5b 92 00 18 sw (sp+24),r18 8005b10: 5b 93 00 14 sw (sp+20),r19 8005b14: 5b 94 00 10 sw (sp+16),r20 8005b18: 5b 95 00 0c sw (sp+12),r21 8005b1c: 5b 96 00 08 sw (sp+8),r22 8005b20: 5b 9d 00 04 sw (sp+4),ra 8005b24: b8 20 60 00 mv r12,r1 rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8005b28: 28 21 00 00 lw r1,(r1+0) uint32_t count = args->count; char *buffer = args->buffer; rtems_status_code sc; sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8005b2c: 34 02 00 00 mvi r2,0 8005b30: 34 03 00 00 mvi r3,0 rtems_status_code rtems_termios_read (void *arg) { rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8005b34: 28 2b 00 38 lw r11,(r1+56) uint32_t count = args->count; 8005b38: 29 8f 00 14 lw r15,(r12+20) char *buffer = args->buffer; 8005b3c: 29 91 00 10 lw r17,(r12+16) rtems_status_code sc; sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8005b40: 29 61 00 14 lw r1,(r11+20) 8005b44: f8 00 05 2b calli 8006ff0 8005b48: b8 20 70 00 mv r14,r1 if (sc != RTEMS_SUCCESSFUL) 8005b4c: 5c 20 00 ad bne r1,r0,8005e00 <== NEVER TAKEN return sc; if (rtems_termios_linesw[tty->t_line].l_read != NULL) { 8005b50: 29 61 00 cc lw r1,(r11+204) 8005b54: 78 0d 08 02 mvhi r13,0x802 8005b58: 34 02 00 05 mvi r2,5 8005b5c: fb ff ef 46 calli 8001874 <__ashlsi3> 8005b60: 39 ad 17 84 ori r13,r13,0x1784 8005b64: b5 a1 08 00 add r1,r13,r1 8005b68: 28 23 00 08 lw r3,(r1+8) 8005b6c: 44 6e 00 06 be r3,r14,8005b84 sc = rtems_termios_linesw[tty->t_line].l_read(tty,args); 8005b70: b9 60 08 00 mv r1,r11 8005b74: b9 80 10 00 mv r2,r12 8005b78: d8 60 00 00 call r3 8005b7c: b8 20 70 00 mv r14,r1 8005b80: e0 00 00 9d bi 8005df4 tty->tty_rcvwakeup = 0; rtems_semaphore_release (tty->isem); return sc; } if (tty->cindex == tty->ccount) { 8005b84: 29 62 00 24 lw r2,(r11+36) 8005b88: 29 61 00 20 lw r1,(r11+32) 8005b8c: 5c 41 00 93 bne r2,r1,8005dd8 <== NEVER TAKEN tty->cindex = tty->ccount = 0; tty->read_start_column = tty->column; 8005b90: 29 61 00 28 lw r1,(r11+40) rtems_semaphore_release (tty->isem); return sc; } if (tty->cindex == tty->ccount) { tty->cindex = tty->ccount = 0; 8005b94: 59 60 00 20 sw (r11+32),r0 8005b98: 59 60 00 24 sw (r11+36),r0 tty->read_start_column = tty->column; 8005b9c: 59 61 00 2c sw (r11+44),r1 if (tty->device.pollRead != NULL && 8005ba0: 29 61 00 a0 lw r1,(r11+160) 8005ba4: 44 20 00 31 be r1,r0,8005c68 8005ba8: 29 61 00 b4 lw r1,(r11+180) 8005bac: 5c 20 00 2f bne r1,r0,8005c68 static rtems_status_code fillBufferPoll (struct rtems_termios_tty *tty) { int n; if (tty->termios.c_lflag & ICANON) { 8005bb0: 29 61 00 3c lw r1,(r11+60) 8005bb4: 20 21 00 02 andi r1,r1,0x2 8005bb8: 44 20 00 0d be r1,r0,8005bec <== NEVER TAKEN for (;;) { n = (*tty->device.pollRead)(tty->minor); 8005bbc: 29 62 00 a0 lw r2,(r11+160) 8005bc0: 29 61 00 10 lw r1,(r11+16) 8005bc4: d8 40 00 00 call r2 if (n < 0) { 8005bc8: 4c 20 00 04 bge r1,r0,8005bd8 rtems_task_wake_after (1); 8005bcc: 34 01 00 01 mvi r1,1 8005bd0: f8 00 06 5e calli 8007548 8005bd4: e3 ff ff fa bi 8005bbc } else { if (siproc (n, tty)) 8005bd8: 20 21 00 ff andi r1,r1,0xff 8005bdc: b9 60 10 00 mv r2,r11 8005be0: fb ff ff 6b calli 800598c 8005be4: 44 20 ff f6 be r1,r0,8005bbc 8005be8: e0 00 00 7c bi 8005dd8 } } } else { rtems_interval then, now; then = rtems_clock_get_ticks_since_boot(); 8005bec: f8 00 03 38 calli 80068cc <== NOT EXECUTED 8005bf0: b8 20 68 00 mv r13,r1 <== NOT EXECUTED for (;;) { n = (*tty->device.pollRead)(tty->minor); 8005bf4: 29 62 00 a0 lw r2,(r11+160) <== NOT EXECUTED 8005bf8: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8005bfc: d8 40 00 00 call r2 <== NOT EXECUTED if (n < 0) { 8005c00: 4c 20 00 10 bge r1,r0,8005c40 <== NOT EXECUTED if (tty->termios.c_cc[VMIN]) { 8005c04: 41 61 00 47 lbu r1,(r11+71) <== NOT EXECUTED 8005c08: 41 62 00 46 lbu r2,(r11+70) <== NOT EXECUTED 8005c0c: 44 20 00 05 be r1,r0,8005c20 <== NOT EXECUTED if (tty->termios.c_cc[VTIME] && tty->ccount) { 8005c10: 44 40 00 09 be r2,r0,8005c34 <== NOT EXECUTED 8005c14: 29 61 00 20 lw r1,(r11+32) <== NOT EXECUTED 8005c18: 44 20 00 07 be r1,r0,8005c34 <== NOT EXECUTED 8005c1c: e0 00 00 02 bi 8005c24 <== NOT EXECUTED if ((now - then) > tty->vtimeTicks) { break; } } } else { if (!tty->termios.c_cc[VTIME]) 8005c20: 44 41 00 6e be r2,r1,8005dd8 <== NOT EXECUTED break; now = rtems_clock_get_ticks_since_boot(); 8005c24: f8 00 03 2a calli 80068cc <== NOT EXECUTED if ((now - then) > tty->vtimeTicks) { 8005c28: 29 62 00 54 lw r2,(r11+84) <== NOT EXECUTED 8005c2c: c8 2d 08 00 sub r1,r1,r13 <== NOT EXECUTED 8005c30: 54 22 00 6a bgu r1,r2,8005dd8 <== NOT EXECUTED break; } } rtems_task_wake_after (1); 8005c34: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8005c38: f8 00 06 44 calli 8007548 <== NOT EXECUTED 8005c3c: e3 ff ff ee bi 8005bf4 <== NOT EXECUTED } else { siproc (n, tty); 8005c40: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8005c44: 20 21 00 ff andi r1,r1,0xff <== NOT EXECUTED 8005c48: fb ff ff 51 calli 800598c <== NOT EXECUTED if (tty->ccount >= tty->termios.c_cc[VMIN]) 8005c4c: 41 61 00 47 lbu r1,(r11+71) <== NOT EXECUTED 8005c50: 29 62 00 20 lw r2,(r11+32) <== NOT EXECUTED 8005c54: 4c 41 00 61 bge r2,r1,8005dd8 <== NOT EXECUTED break; if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME]) 8005c58: 44 20 ff e7 be r1,r0,8005bf4 <== NOT EXECUTED 8005c5c: 41 61 00 46 lbu r1,(r11+70) <== NOT EXECUTED 8005c60: 44 20 ff e5 be r1,r0,8005bf4 <== NOT EXECUTED 8005c64: e3 ff ff e2 bi 8005bec <== NOT EXECUTED while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && (tty->ccount < (CBUFSIZE-1))) { 8005c68: 78 10 08 02 mvhi r16,0x802 * Fill the input buffer from the raw input queue */ static rtems_status_code fillBufferQueue (struct rtems_termios_tty *tty) { rtems_interval timeout = tty->rawInBufSemaphoreFirstTimeout; 8005c6c: 29 72 00 74 lw r18,(r11+116) rtems_status_code sc; int wait = (int)1; 8005c70: 34 0d 00 01 mvi r13,1 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && (tty->ccount < (CBUFSIZE-1))) { 8005c74: 3a 10 12 40 ori r16,r16,0x1240 c = tty->rawInBuf.theBuf[newHead]; tty->rawInBuf.Head = newHead; if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size) % tty->rawInBuf.Size) < tty->lowwater) { tty->flow_ctrl &= ~FL_IREQXOF; 8005c78: 34 16 ff fe mvi r22,-2 /* if tx stopped and XON should be sent... */ if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF)) 8005c7c: 34 15 02 02 mvi r21,514 || (tty->flow_ctrl & FL_OSTOP))) { /* XON should be sent now... */ (*tty->device.write)( tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1); } else if (tty->flow_ctrl & FL_MDRTS) { tty->flow_ctrl &= ~FL_IRTSOFF; 8005c80: 34 14 ff fb mvi r20,-5 if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF)) == (FL_MDXON | FL_ISNTXOF)) && ((tty->rawOutBufState == rob_idle) || (tty->flow_ctrl & FL_OSTOP))) { /* XON should be sent now... */ (*tty->device.write)( 8005c84: 35 73 00 49 addi r19,r11,73 8005c88: e0 00 00 3e bi 8005d80 while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && (tty->ccount < (CBUFSIZE-1))) { unsigned char c; unsigned int newHead; newHead = (tty->rawInBuf.Head + 1) % tty->rawInBuf.Size; 8005c8c: 29 61 00 5c lw r1,(r11+92) 8005c90: 29 62 00 64 lw r2,(r11+100) 8005c94: 34 21 00 01 addi r1,r1,1 8005c98: f8 00 5e 86 calli 801d6b0 <__umodsi3> 8005c9c: b8 20 18 00 mv r3,r1 c = tty->rawInBuf.theBuf[newHead]; 8005ca0: 29 61 00 58 lw r1,(r11+88) 8005ca4: b4 23 08 00 add r1,r1,r3 8005ca8: 40 32 00 00 lbu r18,(r1+0) tty->rawInBuf.Head = newHead; 8005cac: 59 63 00 5c sw (r11+92),r3 if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size) 8005cb0: 29 61 00 60 lw r1,(r11+96) 8005cb4: 29 64 00 64 lw r4,(r11+100) % tty->rawInBuf.Size) 8005cb8: 29 62 00 64 lw r2,(r11+100) unsigned int newHead; newHead = (tty->rawInBuf.Head + 1) % tty->rawInBuf.Size; c = tty->rawInBuf.theBuf[newHead]; tty->rawInBuf.Head = newHead; if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size) 8005cbc: b4 81 08 00 add r1,r4,r1 % tty->rawInBuf.Size) 8005cc0: c8 23 08 00 sub r1,r1,r3 8005cc4: f8 00 5e 7b calli 801d6b0 <__umodsi3> unsigned int newHead; newHead = (tty->rawInBuf.Head + 1) % tty->rawInBuf.Size; c = tty->rawInBuf.theBuf[newHead]; tty->rawInBuf.Head = newHead; if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size) 8005cc8: 29 62 00 bc lw r2,(r11+188) 8005ccc: 50 22 00 1c bgeu r1,r2,8005d3c <== NEVER TAKEN % tty->rawInBuf.Size) < tty->lowwater) { tty->flow_ctrl &= ~FL_IREQXOF; 8005cd0: 29 61 00 b8 lw r1,(r11+184) 8005cd4: a0 36 08 00 and r1,r1,r22 8005cd8: 59 61 00 b8 sw (r11+184),r1 /* if tx stopped and XON should be sent... */ if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF)) 8005cdc: 29 61 00 b8 lw r1,(r11+184) 8005ce0: 20 21 02 02 andi r1,r1,0x202 8005ce4: 5c 35 00 0c bne r1,r21,8005d14 <== ALWAYS TAKEN == (FL_MDXON | FL_ISNTXOF)) && ((tty->rawOutBufState == rob_idle) 8005ce8: 29 61 00 94 lw r1,(r11+148) <== NOT EXECUTED 8005cec: 44 20 00 04 be r1,r0,8005cfc <== NOT EXECUTED || (tty->flow_ctrl & FL_OSTOP))) { 8005cf0: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED 8005cf4: 20 21 00 20 andi r1,r1,0x20 <== NOT EXECUTED 8005cf8: 44 20 00 07 be r1,r0,8005d14 <== NOT EXECUTED /* XON should be sent now... */ (*tty->device.write)( 8005cfc: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED 8005d00: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8005d04: ba 60 10 00 mv r2,r19 <== NOT EXECUTED 8005d08: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 8005d0c: d8 80 00 00 call r4 <== NOT EXECUTED 8005d10: e0 00 00 0b bi 8005d3c <== NOT EXECUTED tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1); } else if (tty->flow_ctrl & FL_MDRTS) { 8005d14: 29 61 00 b8 lw r1,(r11+184) 8005d18: 20 21 01 00 andi r1,r1,0x100 8005d1c: 44 20 00 08 be r1,r0,8005d3c <== ALWAYS TAKEN tty->flow_ctrl &= ~FL_IRTSOFF; 8005d20: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED /* activate RTS line */ if (tty->device.startRemoteTx != NULL) { 8005d24: 29 63 00 b0 lw r3,(r11+176) <== NOT EXECUTED || (tty->flow_ctrl & FL_OSTOP))) { /* XON should be sent now... */ (*tty->device.write)( tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1); } else if (tty->flow_ctrl & FL_MDRTS) { tty->flow_ctrl &= ~FL_IRTSOFF; 8005d28: a0 34 08 00 and r1,r1,r20 <== NOT EXECUTED 8005d2c: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED /* activate RTS line */ if (tty->device.startRemoteTx != NULL) { 8005d30: 44 60 00 03 be r3,r0,8005d3c <== NOT EXECUTED tty->device.startRemoteTx(tty->minor); 8005d34: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8005d38: d8 60 00 00 call r3 <== NOT EXECUTED } } } /* continue processing new character */ if (tty->termios.c_lflag & ICANON) { 8005d3c: 29 61 00 3c lw r1,(r11+60) 8005d40: 20 21 00 02 andi r1,r1,0x2 8005d44: 44 20 00 06 be r1,r0,8005d5c <== NEVER TAKEN if (siproc (c, tty)) 8005d48: ba 40 08 00 mv r1,r18 8005d4c: b9 60 10 00 mv r2,r11 8005d50: fb ff ff 0f calli 800598c wait = 0; 8005d54: 64 21 00 00 cmpei r1,r1,0 8005d58: e0 00 00 07 bi 8005d74 } else { siproc (c, tty); 8005d5c: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8005d60: ba 40 08 00 mv r1,r18 <== NOT EXECUTED 8005d64: fb ff ff 0a calli 800598c <== NOT EXECUTED if (tty->ccount >= tty->termios.c_cc[VMIN]) 8005d68: 41 61 00 47 lbu r1,(r11+71) <== NOT EXECUTED 8005d6c: 29 62 00 20 lw r2,(r11+32) <== NOT EXECUTED wait = 0; 8005d70: e8 22 08 00 cmpg r1,r1,r2 <== NOT EXECUTED } timeout = tty->rawInBufSemaphoreTimeout; 8005d74: 29 72 00 70 lw r18,(r11+112) if (siproc (c, tty)) wait = 0; } else { siproc (c, tty); if (tty->ccount >= tty->termios.c_cc[VMIN]) wait = 0; 8005d78: c8 01 08 00 sub r1,r0,r1 8005d7c: a1 a1 68 00 and r13,r13,r1 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 8005d80: 29 62 00 5c lw r2,(r11+92) 8005d84: 29 61 00 60 lw r1,(r11+96) 8005d88: 44 41 00 05 be r2,r1,8005d9c (tty->ccount < (CBUFSIZE-1))) { 8005d8c: 2a 01 00 00 lw r1,(r16+0) while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 8005d90: 29 62 00 20 lw r2,(r11+32) (tty->ccount < (CBUFSIZE-1))) { 8005d94: 34 21 ff ff addi r1,r1,-1 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 8005d98: 48 22 ff bd bg r1,r2,8005c8c <== ALWAYS TAKEN } /* * Wait for characters */ if ( wait ) { 8005d9c: 45 a0 00 0f be r13,r0,8005dd8 sc = rtems_semaphore_obtain( 8005da0: 29 61 00 68 lw r1,(r11+104) 8005da4: 29 62 00 6c lw r2,(r11+108) 8005da8: ba 40 18 00 mv r3,r18 8005dac: f8 00 04 91 calli 8006ff0 tty->rawInBuf.Semaphore, tty->rawInBufSemaphoreOptions, timeout); if (sc != RTEMS_SUCCESSFUL) 8005db0: 44 20 ff f4 be r1,r0,8005d80 <== ALWAYS TAKEN 8005db4: e0 00 00 09 bi 8005dd8 <== NOT EXECUTED if (sc != RTEMS_SUCCESSFUL) tty->cindex = tty->ccount = 0; } while (count && (tty->cindex < tty->ccount)) { *buffer++ = tty->cbuf[tty->cindex++]; 8005db8: 29 62 00 1c lw r2,(r11+28) count--; 8005dbc: 35 ef ff ff addi r15,r15,-1 if (sc != RTEMS_SUCCESSFUL) tty->cindex = tty->ccount = 0; } while (count && (tty->cindex < tty->ccount)) { *buffer++ = tty->cbuf[tty->cindex++]; 8005dc0: b4 41 10 00 add r2,r2,r1 8005dc4: 40 42 00 00 lbu r2,(r2+0) 8005dc8: 34 21 00 01 addi r1,r1,1 8005dcc: 32 22 00 00 sb (r17+0),r2 8005dd0: 59 61 00 24 sw (r11+36),r1 8005dd4: 36 31 00 01 addi r17,r17,1 sc = fillBufferQueue (tty); if (sc != RTEMS_SUCCESSFUL) tty->cindex = tty->ccount = 0; } while (count && (tty->cindex < tty->ccount)) { 8005dd8: 45 e0 00 04 be r15,r0,8005de8 <== NEVER TAKEN 8005ddc: 29 61 00 24 lw r1,(r11+36) 8005de0: 29 62 00 20 lw r2,(r11+32) 8005de4: 48 41 ff f5 bg r2,r1,8005db8 *buffer++ = tty->cbuf[tty->cindex++]; count--; } args->bytes_moved = args->count - count; 8005de8: 29 81 00 14 lw r1,(r12+20) 8005dec: c8 2f 78 00 sub r15,r1,r15 8005df0: 59 8f 00 1c sw (r12+28),r15 tty->tty_rcvwakeup = 0; rtems_semaphore_release (tty->isem); 8005df4: 29 61 00 14 lw r1,(r11+20) while (count && (tty->cindex < tty->ccount)) { *buffer++ = tty->cbuf[tty->cindex++]; count--; } args->bytes_moved = args->count - count; tty->tty_rcvwakeup = 0; 8005df8: 59 60 00 e4 sw (r11+228),r0 rtems_semaphore_release (tty->isem); 8005dfc: f8 00 04 cd calli 8007130 return sc; } 8005e00: b9 c0 08 00 mv r1,r14 8005e04: 2b 9d 00 04 lw ra,(sp+4) 8005e08: 2b 8b 00 34 lw r11,(sp+52) 8005e0c: 2b 8c 00 30 lw r12,(sp+48) 8005e10: 2b 8d 00 2c lw r13,(sp+44) 8005e14: 2b 8e 00 28 lw r14,(sp+40) 8005e18: 2b 8f 00 24 lw r15,(sp+36) 8005e1c: 2b 90 00 20 lw r16,(sp+32) 8005e20: 2b 91 00 1c lw r17,(sp+28) 8005e24: 2b 92 00 18 lw r18,(sp+24) 8005e28: 2b 93 00 14 lw r19,(sp+20) 8005e2c: 2b 94 00 10 lw r20,(sp+16) 8005e30: 2b 95 00 0c lw r21,(sp+12) 8005e34: 2b 96 00 08 lw r22,(sp+8) 8005e38: 37 9c 00 34 addi sp,sp,52 8005e3c: c3 a0 00 00 ret =============================================================================== 08006200 : * in task-driven mode, this function is called in Tx task context * in interrupt-driven mode, this function is called in TxIRQ context */ int rtems_termios_refill_transmitter (struct rtems_termios_tty *tty) { 8006200: 37 9c ff f0 addi sp,sp,-16 8006204: 5b 8b 00 10 sw (sp+16),r11 8006208: 5b 8c 00 0c sw (sp+12),r12 800620c: 5b 8d 00 08 sw (sp+8),r13 8006210: 5b 9d 00 04 sw (sp+4),ra int nToSend; rtems_interrupt_level level; int len; /* check for XOF/XON to send */ if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF)) 8006214: 28 22 00 b8 lw r2,(r1+184) * in task-driven mode, this function is called in Tx task context * in interrupt-driven mode, this function is called in TxIRQ context */ int rtems_termios_refill_transmitter (struct rtems_termios_tty *tty) { 8006218: b8 20 58 00 mv r11,r1 int nToSend; rtems_interrupt_level level; int len; /* check for XOF/XON to send */ if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF)) 800621c: 34 01 04 01 mvi r1,1025 8006220: 20 42 04 03 andi r2,r2,0x403 8006224: 5c 41 00 12 bne r2,r1,800626c <== ALWAYS TAKEN == (FL_MDXOF | FL_IREQXOF)) { /* XOFF should be sent now... */ (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1); 8006228: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED 800622c: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8006230: 35 62 00 4a addi r2,r11,74 <== NOT EXECUTED 8006234: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 8006238: d8 80 00 00 call r4 <== NOT EXECUTED rtems_interrupt_disable(level); 800623c: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED 8006240: 34 02 ff fe mvi r2,-2 <== NOT EXECUTED 8006244: a0 22 10 00 and r2,r1,r2 <== NOT EXECUTED 8006248: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED tty->t_dqlen--; 800624c: 29 62 00 90 lw r2,(r11+144) <== NOT EXECUTED 8006250: 34 42 ff ff addi r2,r2,-1 <== NOT EXECUTED 8006254: 59 62 00 90 sw (r11+144),r2 <== NOT EXECUTED tty->flow_ctrl |= FL_ISNTXOF; 8006258: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 800625c: 38 42 00 02 ori r2,r2,0x2 <== NOT EXECUTED 8006260: 59 62 00 b8 sw (r11+184),r2 <== NOT EXECUTED rtems_interrupt_enable(level); 8006264: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED 8006268: e0 00 00 16 bi 80062c0 <== NOT EXECUTED nToSend = 1; } else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) { 800626c: 29 62 00 b8 lw r2,(r11+184) 8006270: 34 01 00 02 mvi r1,2 8006274: 20 42 00 03 andi r2,r2,0x3 8006278: 5c 41 00 14 bne r2,r1,80062c8 <== ALWAYS TAKEN * FIXME: this .write call will generate another * dequeue callback. This will advance the "Tail" in the data * buffer, although the corresponding data is not yet out! * Therefore the dequeue "length" should be reduced by 1 */ (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1); 800627c: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED 8006280: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED 8006284: 35 62 00 49 addi r2,r11,73 <== NOT EXECUTED 8006288: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 800628c: d8 80 00 00 call r4 <== NOT EXECUTED rtems_interrupt_disable(level); 8006290: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED 8006294: 34 02 ff fe mvi r2,-2 <== NOT EXECUTED 8006298: a0 22 10 00 and r2,r1,r2 <== NOT EXECUTED 800629c: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED tty->t_dqlen--; 80062a0: 29 62 00 90 lw r2,(r11+144) <== NOT EXECUTED tty->flow_ctrl &= ~FL_ISNTXOF; 80062a4: 29 63 00 b8 lw r3,(r11+184) <== NOT EXECUTED * Therefore the dequeue "length" should be reduced by 1 */ (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1); rtems_interrupt_disable(level); tty->t_dqlen--; 80062a8: 34 42 ff ff addi r2,r2,-1 <== NOT EXECUTED 80062ac: 59 62 00 90 sw (r11+144),r2 <== NOT EXECUTED tty->flow_ctrl &= ~FL_ISNTXOF; 80062b0: 34 02 ff fd mvi r2,-3 <== NOT EXECUTED 80062b4: a0 62 10 00 and r2,r3,r2 <== NOT EXECUTED 80062b8: 59 62 00 b8 sw (r11+184),r2 <== NOT EXECUTED rtems_interrupt_enable(level); 80062bc: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED nToSend = 1; 80062c0: 34 0c 00 01 mvi r12,1 <== NOT EXECUTED 80062c4: e0 00 00 49 bi 80063e8 <== NOT EXECUTED } else { if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) { 80062c8: 29 63 00 80 lw r3,(r11+128) 80062cc: 29 62 00 84 lw r2,(r11+132) 80062d0: 5c 62 00 07 bne r3,r2,80062ec /* * buffer was empty */ if (tty->rawOutBufState == rob_wait) { 80062d4: 29 62 00 94 lw r2,(r11+148) /* * this should never happen... */ rtems_semaphore_release (tty->rawOutBuf.Semaphore); } return 0; 80062d8: 34 0c 00 00 mvi r12,0 } else { if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) { /* * buffer was empty */ if (tty->rawOutBufState == rob_wait) { 80062dc: 5c 41 00 43 bne r2,r1,80063e8 <== ALWAYS TAKEN /* * this should never happen... */ rtems_semaphore_release (tty->rawOutBuf.Semaphore); 80062e0: 29 61 00 8c lw r1,(r11+140) <== NOT EXECUTED 80062e4: f8 00 03 93 calli 8007130 <== NOT EXECUTED 80062e8: e0 00 00 40 bi 80063e8 <== NOT EXECUTED } return 0; } rtems_interrupt_disable(level); 80062ec: 90 00 10 00 rcsr r2,IE 80062f0: 34 01 ff fe mvi r1,-2 80062f4: a0 41 08 00 and r1,r2,r1 80062f8: d0 01 00 00 wcsr IE,r1 len = tty->t_dqlen; 80062fc: 29 63 00 90 lw r3,(r11+144) tty->t_dqlen = 0; 8006300: 59 60 00 90 sw (r11+144),r0 rtems_interrupt_enable(level); 8006304: d0 02 00 00 wcsr IE,r2 newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size; 8006308: 29 61 00 84 lw r1,(r11+132) 800630c: 29 62 00 88 lw r2,(r11+136) 8006310: b4 61 08 00 add r1,r3,r1 8006314: f8 00 5c e7 calli 801d6b0 <__umodsi3> tty->rawOutBuf.Tail = newTail; if (tty->rawOutBufState == rob_wait) { 8006318: 29 62 00 94 lw r2,(r11+148) rtems_interrupt_disable(level); len = tty->t_dqlen; tty->t_dqlen = 0; rtems_interrupt_enable(level); newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size; 800631c: b8 20 68 00 mv r13,r1 tty->rawOutBuf.Tail = newTail; 8006320: 59 61 00 84 sw (r11+132),r1 if (tty->rawOutBufState == rob_wait) { 8006324: 34 01 00 02 mvi r1,2 8006328: 5c 41 00 03 bne r2,r1,8006334 /* * wake up any pending writer task */ rtems_semaphore_release (tty->rawOutBuf.Semaphore); 800632c: 29 61 00 8c lw r1,(r11+140) 8006330: f8 00 03 80 calli 8007130 } if (newTail == tty->rawOutBuf.Head) { 8006334: 29 61 00 80 lw r1,(r11+128) 8006338: 5d a1 00 09 bne r13,r1,800635c nToSend = 0; /* * check to see if snd wakeup callback was set */ if ( tty->tty_snd.sw_pfn != NULL) { 800633c: 29 63 00 d4 lw r3,(r11+212) if (newTail == tty->rawOutBuf.Head) { /* * Buffer has become empty */ tty->rawOutBufState = rob_idle; 8006340: 59 60 00 94 sw (r11+148),r0 nToSend = 0; 8006344: 34 0c 00 00 mvi r12,0 /* * check to see if snd wakeup callback was set */ if ( tty->tty_snd.sw_pfn != NULL) { 8006348: 44 60 00 27 be r3,r0,80063e4 <== ALWAYS TAKEN (*tty->tty_snd.sw_pfn)(&tty->termios, tty->tty_snd.sw_arg); 800634c: 29 62 00 d8 lw r2,(r11+216) <== NOT EXECUTED 8006350: 35 61 00 30 addi r1,r11,48 <== NOT EXECUTED 8006354: d8 60 00 00 call r3 <== NOT EXECUTED 8006358: e0 00 00 23 bi 80063e4 <== NOT EXECUTED } } /* check, whether output should stop due to received XOFF */ else if ((tty->flow_ctrl & (FL_MDXON | FL_ORCVXOF)) 800635c: 29 62 00 b8 lw r2,(r11+184) 8006360: 34 01 02 10 mvi r1,528 8006364: 20 42 02 10 andi r2,r2,0x210 8006368: 5c 41 00 0d bne r2,r1,800639c <== ALWAYS TAKEN == (FL_MDXON | FL_ORCVXOF)) { /* Buffer not empty, but output stops due to XOFF */ /* set flag, that output has been stopped */ rtems_interrupt_disable(level); 800636c: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED 8006370: 34 02 ff fe mvi r2,-2 <== NOT EXECUTED 8006374: a0 22 10 00 and r2,r1,r2 <== NOT EXECUTED 8006378: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED tty->flow_ctrl |= FL_OSTOP; 800637c: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED 8006380: 38 42 00 20 ori r2,r2,0x20 <== NOT EXECUTED 8006384: 59 62 00 b8 sw (r11+184),r2 <== NOT EXECUTED tty->rawOutBufState = rob_busy; /*apm*/ 8006388: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 800638c: 59 62 00 94 sw (r11+148),r2 <== NOT EXECUTED rtems_interrupt_enable(level); 8006390: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED nToSend = 0; 8006394: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED 8006398: e0 00 00 13 bi 80063e4 <== NOT EXECUTED } else { /* * Buffer not empty, start tranmitter */ if (newTail > tty->rawOutBuf.Head) 800639c: 29 61 00 80 lw r1,(r11+128) 80063a0: 50 2d 00 03 bgeu r1,r13,80063ac nToSend = tty->rawOutBuf.Size - newTail; 80063a4: 29 6c 00 88 lw r12,(r11+136) 80063a8: e0 00 00 02 bi 80063b0 else nToSend = tty->rawOutBuf.Head - newTail; 80063ac: 29 6c 00 80 lw r12,(r11+128) /* when flow control XON or XOF, don't send blocks of data */ /* to allow fast reaction on incoming flow ctrl and low latency*/ /* for outgoing flow control */ if (tty->flow_ctrl & (FL_MDXON | FL_MDXOF)) { 80063b0: 29 61 00 b8 lw r1,(r11+184) * Buffer not empty, start tranmitter */ if (newTail > tty->rawOutBuf.Head) nToSend = tty->rawOutBuf.Size - newTail; else nToSend = tty->rawOutBuf.Head - newTail; 80063b4: c9 8d 60 00 sub r12,r12,r13 /* when flow control XON or XOF, don't send blocks of data */ /* to allow fast reaction on incoming flow ctrl and low latency*/ /* for outgoing flow control */ if (tty->flow_ctrl & (FL_MDXON | FL_MDXOF)) { 80063b8: 20 21 06 00 andi r1,r1,0x600 80063bc: 44 20 00 02 be r1,r0,80063c4 nToSend = 1; 80063c0: 34 0c 00 01 mvi r12,1 } tty->rawOutBufState = rob_busy; /*apm*/ 80063c4: 34 01 00 01 mvi r1,1 (*tty->device.write)( 80063c8: 29 62 00 7c lw r2,(r11+124) /* to allow fast reaction on incoming flow ctrl and low latency*/ /* for outgoing flow control */ if (tty->flow_ctrl & (FL_MDXON | FL_MDXOF)) { nToSend = 1; } tty->rawOutBufState = rob_busy; /*apm*/ 80063cc: 59 61 00 94 sw (r11+148),r1 (*tty->device.write)( 80063d0: 29 64 00 a4 lw r4,(r11+164) 80063d4: 29 61 00 10 lw r1,(r11+16) 80063d8: b4 4d 10 00 add r2,r2,r13 80063dc: b9 80 18 00 mv r3,r12 80063e0: d8 80 00 00 call r4 tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend); } tty->rawOutBuf.Tail = newTail; /*apm*/ 80063e4: 59 6d 00 84 sw (r11+132),r13 } return nToSend; } 80063e8: b9 80 08 00 mv r1,r12 80063ec: 2b 9d 00 04 lw ra,(sp+4) 80063f0: 2b 8b 00 10 lw r11,(sp+16) 80063f4: 2b 8c 00 0c lw r12,(sp+12) 80063f8: 2b 8d 00 08 lw r13,(sp+8) 80063fc: 37 9c 00 10 addi sp,sp,16 8006400: c3 a0 00 00 ret =============================================================================== 08006184 : /* * this task actually processes any receive events */ static rtems_task rtems_termios_rxdaemon(rtems_task_argument argument) { 8006184: 37 9c ff e4 addi sp,sp,-28 8006188: 5b 8b 00 14 sw (sp+20),r11 800618c: 5b 8c 00 10 sw (sp+16),r12 8006190: 5b 8d 00 0c sw (sp+12),r13 8006194: 5b 8e 00 08 sw (sp+8),r14 8006198: 5b 9d 00 04 sw (sp+4),ra /* * do something */ c = tty->device.pollRead(tty->minor); if (c != EOF) { 800619c: 34 0d ff ff mvi r13,-1 /* * this task actually processes any receive events */ static rtems_task rtems_termios_rxdaemon(rtems_task_argument argument) { 80061a0: b8 20 58 00 mv r11,r1 while (1) { /* * wait for rtems event */ rtems_event_receive( 80061a4: 37 8e 00 18 addi r14,sp,24 if (c != EOF) { /* * pollRead did call enqueue on its own */ c_buf = c; rtems_termios_enqueue_raw_characters ( tty,&c_buf,1); 80061a8: 37 8c 00 1f addi r12,sp,31 while (1) { /* * wait for rtems event */ rtems_event_receive( 80061ac: 34 01 00 03 mvi r1,3 80061b0: 34 02 00 02 mvi r2,2 80061b4: 34 03 00 00 mvi r3,0 80061b8: b9 c0 20 00 mv r4,r14 80061bc: f8 00 01 dd calli 8006930 (TERMIOS_RX_PROC_EVENT | TERMIOS_RX_TERMINATE_EVENT), RTEMS_EVENT_ANY | RTEMS_WAIT, RTEMS_NO_TIMEOUT, &the_event ); if ((the_event & TERMIOS_RX_TERMINATE_EVENT) != 0) { 80061c0: 2b 81 00 18 lw r1,(sp+24) 80061c4: 20 21 00 01 andi r1,r1,0x1 80061c8: 44 20 00 04 be r1,r0,80061d8 <== ALWAYS TAKEN tty->rxTaskId = 0; 80061cc: 59 60 00 c4 sw (r11+196),r0 <== NOT EXECUTED rtems_task_delete(RTEMS_SELF); 80061d0: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 80061d4: f8 00 04 6c calli 8007384 <== NOT EXECUTED } /* * do something */ c = tty->device.pollRead(tty->minor); 80061d8: 29 62 00 a0 lw r2,(r11+160) 80061dc: 29 61 00 10 lw r1,(r11+16) 80061e0: d8 40 00 00 call r2 if (c != EOF) { 80061e4: 44 2d ff f2 be r1,r13,80061ac /* * pollRead did call enqueue on its own */ c_buf = c; 80061e8: 33 81 00 1f sb (sp+31),r1 rtems_termios_enqueue_raw_characters ( tty,&c_buf,1); 80061ec: b9 80 10 00 mv r2,r12 80061f0: b9 60 08 00 mv r1,r11 80061f4: 34 03 00 01 mvi r3,1 80061f8: fb ff ff 1a calli 8005e60 80061fc: e3 ff ff ec bi 80061ac =============================================================================== 080064f4 : int rtems_termios_set_initial_baud( struct rtems_termios_tty *ttyp, int32_t baud ) { 80064f4: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED 80064f8: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED 80064fc: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED 8006500: b8 20 58 00 mv r11,r1 <== NOT EXECUTED int cflags_baud; cflags_baud = rtems_termios_number_to_baud(baud); 8006504: b8 40 08 00 mv r1,r2 <== NOT EXECUTED 8006508: fb ff f8 4f calli 8004644 <== NOT EXECUTED if ( cflags_baud == -1 ) return -1; 800650c: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED ) { int cflags_baud; cflags_baud = rtems_termios_number_to_baud(baud); if ( cflags_baud == -1 ) 8006510: 44 22 00 07 be r1,r2,800652c <== NOT EXECUTED return -1; ttyp->termios.c_cflag = (ttyp->termios.c_cflag & ~CBAUD) | cflags_baud; 8006514: 29 63 00 38 lw r3,(r11+56) <== NOT EXECUTED 8006518: 34 02 ef f0 mvi r2,-4112 <== NOT EXECUTED 800651c: a0 43 10 00 and r2,r2,r3 <== NOT EXECUTED 8006520: b8 22 08 00 or r1,r1,r2 <== NOT EXECUTED 8006524: 59 61 00 38 sw (r11+56),r1 <== NOT EXECUTED return 0; 8006528: 34 02 00 00 mvi r2,0 <== NOT EXECUTED } 800652c: b8 40 08 00 mv r1,r2 <== NOT EXECUTED 8006530: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8006534: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 8006538: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 800653c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08006404 : /* * this task actually processes any transmit events */ static rtems_task rtems_termios_txdaemon(rtems_task_argument argument) { 8006404: 37 9c ff f0 addi sp,sp,-16 8006408: 5b 8b 00 0c sw (sp+12),r11 800640c: 5b 8c 00 08 sw (sp+8),r12 8006410: 5b 9d 00 04 sw (sp+4),ra } /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 8006414: 78 0c 08 02 mvhi r12,0x802 /* * this task actually processes any transmit events */ static rtems_task rtems_termios_txdaemon(rtems_task_argument argument) { 8006418: b8 20 58 00 mv r11,r1 } /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 800641c: 39 8c 17 84 ori r12,r12,0x1784 while (1) { /* * wait for rtems event */ rtems_event_receive( 8006420: 34 01 00 03 mvi r1,3 8006424: 34 02 00 02 mvi r2,2 8006428: 34 03 00 00 mvi r3,0 800642c: 37 84 00 10 addi r4,sp,16 8006430: f8 00 01 40 calli 8006930 (TERMIOS_TX_START_EVENT | TERMIOS_TX_TERMINATE_EVENT), RTEMS_EVENT_ANY | RTEMS_WAIT, RTEMS_NO_TIMEOUT, &the_event ); if ((the_event & TERMIOS_TX_TERMINATE_EVENT) != 0) { 8006434: 2b 81 00 10 lw r1,(sp+16) 8006438: 20 21 00 01 andi r1,r1,0x1 800643c: 44 20 00 04 be r1,r0,800644c <== ALWAYS TAKEN tty->txTaskId = 0; 8006440: 59 60 00 c8 sw (r11+200),r0 <== NOT EXECUTED rtems_task_delete(RTEMS_SELF); 8006444: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8006448: f8 00 03 cf calli 8007384 <== NOT EXECUTED } /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 800644c: 29 61 00 cc lw r1,(r11+204) 8006450: 34 02 00 05 mvi r2,5 8006454: fb ff ed 08 calli 8001874 <__ashlsi3> 8006458: b5 81 08 00 add r1,r12,r1 800645c: 28 22 00 14 lw r2,(r1+20) 8006460: 44 40 00 03 be r2,r0,800646c <== ALWAYS TAKEN rtems_termios_linesw[tty->t_line].l_start(tty); 8006464: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8006468: d8 40 00 00 call r2 <== NOT EXECUTED } /* * try to push further characters to device */ rtems_termios_refill_transmitter(tty); 800646c: b9 60 08 00 mv r1,r11 8006470: fb ff ff 64 calli 8006200 } 8006474: e3 ff ff eb bi 8006420 =============================================================================== 08005a00 : rtems_termios_puts (&c, 1, tty); } rtems_status_code rtems_termios_write (void *arg) { 8005a00: 37 9c ff e8 addi sp,sp,-24 8005a04: 5b 8b 00 18 sw (sp+24),r11 8005a08: 5b 8c 00 14 sw (sp+20),r12 8005a0c: 5b 8d 00 10 sw (sp+16),r13 8005a10: 5b 8e 00 0c sw (sp+12),r14 8005a14: 5b 8f 00 08 sw (sp+8),r15 8005a18: 5b 9d 00 04 sw (sp+4),ra 8005a1c: b8 20 58 00 mv r11,r1 rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8005a20: 28 21 00 00 lw r1,(r1+0) rtems_status_code sc; sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8005a24: 34 02 00 00 mvi r2,0 8005a28: 34 03 00 00 mvi r3,0 rtems_status_code rtems_termios_write (void *arg) { rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 8005a2c: 28 2c 00 38 lw r12,(r1+56) rtems_status_code sc; sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 8005a30: 29 81 00 18 lw r1,(r12+24) 8005a34: f8 00 05 6f calli 8006ff0 8005a38: b8 20 68 00 mv r13,r1 if (sc != RTEMS_SUCCESSFUL) 8005a3c: 5c 20 00 23 bne r1,r0,8005ac8 <== NEVER TAKEN return sc; if (rtems_termios_linesw[tty->t_line].l_write != NULL) { 8005a40: 29 81 00 cc lw r1,(r12+204) 8005a44: 78 0e 08 02 mvhi r14,0x802 8005a48: 34 02 00 05 mvi r2,5 8005a4c: fb ff ef 8a calli 8001874 <__ashlsi3> 8005a50: 39 ce 17 84 ori r14,r14,0x1784 8005a54: b5 c1 08 00 add r1,r14,r1 8005a58: 28 23 00 0c lw r3,(r1+12) 8005a5c: 44 6d 00 06 be r3,r13,8005a74 sc = rtems_termios_linesw[tty->t_line].l_write(tty,args); 8005a60: b9 80 08 00 mv r1,r12 8005a64: b9 60 10 00 mv r2,r11 8005a68: d8 60 00 00 call r3 8005a6c: b8 20 68 00 mv r13,r1 8005a70: e0 00 00 14 bi 8005ac0 rtems_semaphore_release (tty->osem); return sc; } if (tty->termios.c_oflag & OPOST) { 8005a74: 29 83 00 34 lw r3,(r12+52) 8005a78: 29 62 00 14 lw r2,(r11+20) 8005a7c: 29 61 00 10 lw r1,(r11+16) 8005a80: 20 63 00 01 andi r3,r3,0x1 uint32_t count = args->count; 8005a84: b8 40 78 00 mv r15,r2 char *buffer = args->buffer; 8005a88: b8 20 70 00 mv r14,r1 if (rtems_termios_linesw[tty->t_line].l_write != NULL) { sc = rtems_termios_linesw[tty->t_line].l_write(tty,args); rtems_semaphore_release (tty->osem); return sc; } if (tty->termios.c_oflag & OPOST) { 8005a8c: 5c 60 00 07 bne r3,r0,8005aa8 <== ALWAYS TAKEN 8005a90: e0 00 00 08 bi 8005ab0 <== NOT EXECUTED uint32_t count = args->count; char *buffer = args->buffer; while (count--) oproc (*buffer++, tty); 8005a94: 41 c1 00 00 lbu r1,(r14+0) 8005a98: b9 80 10 00 mv r2,r12 8005a9c: 35 ce 00 01 addi r14,r14,1 8005aa0: fb ff fe 4b calli 80053cc 8005aa4: 35 ef ff ff addi r15,r15,-1 return sc; } if (tty->termios.c_oflag & OPOST) { uint32_t count = args->count; char *buffer = args->buffer; while (count--) 8005aa8: 5d e0 ff fb bne r15,r0,8005a94 8005aac: e0 00 00 03 bi 8005ab8 oproc (*buffer++, tty); args->bytes_moved = args->count; } else { rtems_termios_puts (args->buffer, args->count, tty); 8005ab0: b9 80 18 00 mv r3,r12 <== NOT EXECUTED 8005ab4: fb ff fd f0 calli 8005274 <== NOT EXECUTED args->bytes_moved = args->count; 8005ab8: 29 61 00 14 lw r1,(r11+20) 8005abc: 59 61 00 1c sw (r11+28),r1 } rtems_semaphore_release (tty->osem); 8005ac0: 29 81 00 18 lw r1,(r12+24) 8005ac4: f8 00 05 9b calli 8007130 return sc; } 8005ac8: b9 a0 08 00 mv r1,r13 8005acc: 2b 9d 00 04 lw ra,(sp+4) 8005ad0: 2b 8b 00 18 lw r11,(sp+24) 8005ad4: 2b 8c 00 14 lw r12,(sp+20) 8005ad8: 2b 8d 00 10 lw r13,(sp+16) 8005adc: 2b 8e 00 0c lw r14,(sp+12) 8005ae0: 2b 8f 00 08 lw r15,(sp+8) 8005ae4: 37 9c 00 18 addi sp,sp,24 8005ae8: c3 a0 00 00 ret =============================================================================== 08013fd0 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 8013fd0: 37 9c ff f8 addi sp,sp,-8 8013fd4: 5b 9d 00 04 sw (sp+4),ra 8013fd8: b8 20 10 00 mv r2,r1 Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) _Objects_Get( &_Timer_Information, id, location ); 8013fdc: 78 01 08 03 mvhi r1,0x803 8013fe0: 38 21 ee 68 ori r1,r1,0xee68 8013fe4: 37 83 00 08 addi r3,sp,8 8013fe8: f8 00 0e 49 calli 801790c <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 8013fec: 2b 82 00 08 lw r2,(sp+8) 8013ff0: 5c 40 00 09 bne r2,r0,8014014 <== NEVER TAKEN case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 8013ff4: 28 23 00 38 lw r3,(r1+56) 8013ff8: 34 02 00 04 mvi r2,4 8013ffc: 44 62 00 03 be r3,r2,8014008 <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 8014000: 34 21 00 10 addi r1,r1,16 8014004: f8 00 18 0a calli 801a02c <_Watchdog_Remove> _Thread_Enable_dispatch(); 8014008: f8 00 10 fe calli 8018400 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 801400c: 34 01 00 00 mvi r1,0 8014010: e0 00 00 02 bi 8014018 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 8014014: 34 01 00 04 mvi r1,4 } 8014018: 2b 9d 00 04 lw ra,(sp+4) 801401c: 37 9c 00 08 addi sp,sp,8 8014020: c3 a0 00 00 ret =============================================================================== 080145ec : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 80145ec: 37 9c ff dc addi sp,sp,-36 80145f0: 5b 8b 00 20 sw (sp+32),r11 80145f4: 5b 8c 00 1c sw (sp+28),r12 80145f8: 5b 8d 00 18 sw (sp+24),r13 80145fc: 5b 8e 00 14 sw (sp+20),r14 8014600: 5b 8f 00 10 sw (sp+16),r15 8014604: 5b 90 00 0c sw (sp+12),r16 8014608: 5b 91 00 08 sw (sp+8),r17 801460c: 5b 9d 00 04 sw (sp+4),ra Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 8014610: 78 05 08 03 mvhi r5,0x803 8014614: 38 a5 ee a8 ori r5,r5,0xeea8 8014618: 28 ad 00 00 lw r13,(r5+0) rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 801461c: b8 20 78 00 mv r15,r1 8014620: b8 40 60 00 mv r12,r2 8014624: b8 60 80 00 mv r16,r3 8014628: b8 80 88 00 mv r17,r4 Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; 801462c: 34 0b 00 0e mvi r11,14 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) 8014630: 45 a0 00 2e be r13,r0,80146e8 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 8014634: 78 05 08 03 mvhi r5,0x803 8014638: 38 a5 ec 3c ori r5,r5,0xec3c 801463c: 40 a1 00 00 lbu r1,(r5+0) return RTEMS_NOT_DEFINED; 8014640: 34 0b 00 0b mvi r11,11 Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 8014644: 44 20 00 29 be r1,r0,80146e8 <== NEVER TAKEN return RTEMS_NOT_DEFINED; if ( !routine ) return RTEMS_INVALID_ADDRESS; 8014648: 34 0b 00 09 mvi r11,9 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; if ( !routine ) 801464c: 44 60 00 27 be r3,r0,80146e8 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 8014650: b8 40 08 00 mv r1,r2 8014654: fb ff f1 bc calli 8010d44 <_TOD_Validate> return RTEMS_INVALID_CLOCK; 8014658: 34 0b 00 14 mvi r11,20 return RTEMS_NOT_DEFINED; if ( !routine ) return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 801465c: 44 20 00 23 be r1,r0,80146e8 return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 8014660: b9 80 08 00 mv r1,r12 if ( seconds <= _TOD_Seconds_since_epoch() ) 8014664: 78 0c 08 03 mvhi r12,0x803 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 8014668: fb ff f1 77 calli 8010c44 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 801466c: 39 8c 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 ); 8014670: b8 20 70 00 mv r14,r1 if ( seconds <= _TOD_Seconds_since_epoch() ) 8014674: 29 81 00 00 lw r1,(r12+0) 8014678: 50 2e 00 1c bgeu r1,r14,80146e8 801467c: 78 01 08 03 mvhi r1,0x803 8014680: 38 21 ee 68 ori r1,r1,0xee68 8014684: b9 e0 10 00 mv r2,r15 8014688: 37 83 00 24 addi r3,sp,36 801468c: f8 00 0c a0 calli 801790c <_Objects_Get> 8014690: b8 20 58 00 mv r11,r1 return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 8014694: 2b 81 00 24 lw r1,(sp+36) 8014698: 5c 20 00 13 bne r1,r0,80146e4 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 801469c: 35 61 00 10 addi r1,r11,16 80146a0: f8 00 16 63 calli 801a02c <_Watchdog_Remove> the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 80146a4: 34 01 00 03 mvi r1,3 80146a8: 59 61 00 38 sw (r11+56),r1 _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 80146ac: 29 81 00 00 lw r1,(r12+0) (*timer_server->schedule_operation)( timer_server, the_timer ); 80146b0: 29 a3 00 04 lw r3,(r13+4) 80146b4: b9 60 10 00 mv r2,r11 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 80146b8: c9 c1 70 00 sub r14,r14,r1 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 80146bc: 59 60 00 18 sw (r11+24),r0 the_watchdog->routine = routine; 80146c0: 59 70 00 2c sw (r11+44),r16 the_watchdog->id = id; 80146c4: 59 6f 00 30 sw (r11+48),r15 the_watchdog->user_data = user_data; 80146c8: 59 71 00 34 sw (r11+52),r17 80146cc: 59 6e 00 1c sw (r11+28),r14 (*timer_server->schedule_operation)( timer_server, the_timer ); 80146d0: b9 a0 08 00 mv r1,r13 80146d4: d8 60 00 00 call r3 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 80146d8: 34 0b 00 00 mvi r11,0 _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); (*timer_server->schedule_operation)( timer_server, the_timer ); _Thread_Enable_dispatch(); 80146dc: f8 00 0f 49 calli 8018400 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 80146e0: e0 00 00 02 bi 80146e8 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 80146e4: 34 0b 00 04 mvi r11,4 } 80146e8: b9 60 08 00 mv r1,r11 80146ec: 2b 9d 00 04 lw ra,(sp+4) 80146f0: 2b 8b 00 20 lw r11,(sp+32) 80146f4: 2b 8c 00 1c lw r12,(sp+28) 80146f8: 2b 8d 00 18 lw r13,(sp+24) 80146fc: 2b 8e 00 14 lw r14,(sp+20) 8014700: 2b 8f 00 10 lw r15,(sp+16) 8014704: 2b 90 00 0c lw r16,(sp+12) 8014708: 2b 91 00 08 lw r17,(sp+8) 801470c: 37 9c 00 24 addi sp,sp,36 8014710: c3 a0 00 00 ret =============================================================================== 08006aec : static int rtems_verror( rtems_error_code_t error_flag, const char *printf_format, va_list arglist ) { 8006aec: 37 9c ff e4 addi sp,sp,-28 8006af0: 5b 8b 00 1c sw (sp+28),r11 8006af4: 5b 8c 00 18 sw (sp+24),r12 8006af8: 5b 8d 00 14 sw (sp+20),r13 8006afc: 5b 8e 00 10 sw (sp+16),r14 8006b00: 5b 8f 00 0c sw (sp+12),r15 8006b04: 5b 90 00 08 sw (sp+8),r16 8006b08: 5b 9d 00 04 sw (sp+4),ra 8006b0c: b8 20 60 00 mv r12,r1 int local_errno = 0; int chars_written = 0; rtems_status_code status; if (error_flag & RTEMS_ERROR_PANIC) { 8006b10: 78 01 20 00 mvhi r1,0x2000 8006b14: a1 81 08 00 and r1,r12,r1 static int rtems_verror( rtems_error_code_t error_flag, const char *printf_format, va_list arglist ) { 8006b18: b8 40 80 00 mv r16,r2 8006b1c: b8 60 78 00 mv r15,r3 int local_errno = 0; int chars_written = 0; rtems_status_code status; if (error_flag & RTEMS_ERROR_PANIC) { 8006b20: 44 20 00 12 be r1,r0,8006b68 if (rtems_panic_in_progress++) 8006b24: 78 04 08 02 mvhi r4,0x802 8006b28: 38 84 78 1c ori r4,r4,0x781c 8006b2c: 28 81 00 00 lw r1,(r4+0) 8006b30: 34 22 00 01 addi r2,r1,1 8006b34: 58 82 00 00 sw (r4+0),r2 8006b38: 44 20 00 06 be r1,r0,8006b50 <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8006b3c: 78 04 08 02 mvhi r4,0x802 <== NOT EXECUTED 8006b40: 38 84 79 9c ori r4,r4,0x799c <== NOT EXECUTED 8006b44: 28 81 00 00 lw r1,(r4+0) <== NOT EXECUTED 8006b48: 34 21 00 01 addi r1,r1,1 <== NOT EXECUTED 8006b4c: 58 81 00 00 sw (r4+0),r1 <== NOT EXECUTED _Thread_Disable_dispatch(); /* disable task switches */ /* don't aggravate things */ if (rtems_panic_in_progress > 2) 8006b50: 78 01 08 02 mvhi r1,0x802 8006b54: 38 21 78 1c ori r1,r1,0x781c 8006b58: 28 22 00 00 lw r2,(r1+0) 8006b5c: 34 01 00 02 mvi r1,2 return 0; 8006b60: 34 0b 00 00 mvi r11,0 if (error_flag & RTEMS_ERROR_PANIC) { if (rtems_panic_in_progress++) _Thread_Disable_dispatch(); /* disable task switches */ /* don't aggravate things */ if (rtems_panic_in_progress > 2) 8006b64: 48 41 00 48 bg r2,r1,8006c84 <== NEVER TAKEN return 0; } (void) fflush(stdout); /* in case stdout/stderr same */ 8006b68: 78 01 08 02 mvhi r1,0x802 8006b6c: 38 21 71 e8 ori r1,r1,0x71e8 8006b70: 28 21 00 00 lw r1,(r1+0) 8006b74: 28 21 00 08 lw r1,(r1+8) 8006b78: f8 00 2d db calli 80122e4 status = error_flag & ~RTEMS_ERROR_MASK; 8006b7c: 78 01 08 02 mvhi r1,0x802 8006b80: 38 21 4f 48 ori r1,r1,0x4f48 8006b84: 28 2e 00 00 lw r14,(r1+0) if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */ 8006b88: 78 01 40 00 mvhi r1,0x4000 8006b8c: a1 81 08 00 and r1,r12,r1 return 0; } (void) fflush(stdout); /* in case stdout/stderr same */ status = error_flag & ~RTEMS_ERROR_MASK; 8006b90: a1 8e 70 00 and r14,r12,r14 rtems_error_code_t error_flag, const char *printf_format, va_list arglist ) { int local_errno = 0; 8006b94: 34 0c 00 00 mvi r12,0 } (void) fflush(stdout); /* in case stdout/stderr same */ status = error_flag & ~RTEMS_ERROR_MASK; if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */ 8006b98: 44 20 00 03 be r1,r0,8006ba4 local_errno = errno; 8006b9c: f8 00 2c d1 calli 8011ee0 <__errno> 8006ba0: 28 2c 00 00 lw r12,(r1+0) #if defined(RTEMS_MULTIPROCESSING) if (_System_state_Is_multiprocessing) fprintf(stderr, "[%" PRIu32 "] ", _Configuration_MP_table->node); #endif chars_written += vfprintf(stderr, printf_format, arglist); 8006ba4: 78 0d 08 02 mvhi r13,0x802 8006ba8: 39 ad 71 e8 ori r13,r13,0x71e8 8006bac: 29 a1 00 00 lw r1,(r13+0) 8006bb0: ba 00 10 00 mv r2,r16 8006bb4: b9 e0 18 00 mv r3,r15 8006bb8: 28 21 00 0c lw r1,(r1+12) 8006bbc: f8 00 44 90 calli 8017dfc 8006bc0: b8 20 58 00 mv r11,r1 if (status) 8006bc4: 45 c0 00 0b be r14,r0,8006bf0 chars_written += fprintf(stderr, " (status: %s)", rtems_status_text(status)); 8006bc8: 29 a1 00 00 lw r1,(r13+0) 8006bcc: 28 2d 00 0c lw r13,(r1+12) 8006bd0: b9 c0 08 00 mv r1,r14 8006bd4: fb ff ff bd calli 8006ac8 8006bd8: 78 02 08 02 mvhi r2,0x802 8006bdc: b8 20 18 00 mv r3,r1 8006be0: 38 42 4c 04 ori r2,r2,0x4c04 8006be4: b9 a0 08 00 mv r1,r13 8006be8: f8 00 2e f7 calli 80127c4 #endif chars_written += vfprintf(stderr, printf_format, arglist); if (status) chars_written += 8006bec: b5 61 58 00 add r11,r11,r1 fprintf(stderr, " (status: %s)", rtems_status_text(status)); if (local_errno) { 8006bf0: 45 80 00 1a be r12,r0,8006c58 if ((local_errno > 0) && *strerror(local_errno)) 8006bf4: 4c 0c 00 10 bge r0,r12,8006c34 8006bf8: b9 80 08 00 mv r1,r12 8006bfc: f8 00 32 9d calli 8013670 8006c00: 40 21 00 00 lbu r1,(r1+0) 8006c04: 44 20 00 0c be r1,r0,8006c34 <== NEVER TAKEN chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno)); 8006c08: 78 01 08 02 mvhi r1,0x802 8006c0c: 38 21 71 e8 ori r1,r1,0x71e8 8006c10: 28 21 00 00 lw r1,(r1+0) 8006c14: 28 2d 00 0c lw r13,(r1+12) 8006c18: b9 80 08 00 mv r1,r12 8006c1c: f8 00 32 95 calli 8013670 8006c20: 78 02 08 02 mvhi r2,0x802 8006c24: b8 20 18 00 mv r3,r1 8006c28: 38 42 4c 14 ori r2,r2,0x4c14 8006c2c: b9 a0 08 00 mv r1,r13 8006c30: e0 00 00 08 bi 8006c50 else chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno); 8006c34: 78 01 08 02 mvhi r1,0x802 8006c38: 38 21 71 e8 ori r1,r1,0x71e8 8006c3c: 28 21 00 00 lw r1,(r1+0) 8006c40: 78 02 08 02 mvhi r2,0x802 8006c44: 38 42 4c 24 ori r2,r2,0x4c24 8006c48: 28 21 00 0c lw r1,(r1+12) 8006c4c: b9 80 18 00 mv r3,r12 8006c50: f8 00 2e dd calli 80127c4 8006c54: b5 61 58 00 add r11,r11,r1 } chars_written += fprintf(stderr, "\n"); 8006c58: 78 0c 08 02 mvhi r12,0x802 8006c5c: 39 8c 71 e8 ori r12,r12,0x71e8 8006c60: 29 81 00 00 lw r1,(r12+0) 8006c64: 78 02 08 02 mvhi r2,0x802 8006c68: 38 42 43 78 ori r2,r2,0x4378 8006c6c: 28 21 00 0c lw r1,(r1+12) 8006c70: f8 00 2e d5 calli 80127c4 8006c74: b4 2b 58 00 add r11,r1,r11 (void) fflush(stderr); 8006c78: 29 81 00 00 lw r1,(r12+0) 8006c7c: 28 21 00 0c lw r1,(r1+12) 8006c80: f8 00 2d 99 calli 80122e4 return chars_written; } 8006c84: b9 60 08 00 mv r1,r11 8006c88: 2b 9d 00 04 lw ra,(sp+4) 8006c8c: 2b 8b 00 1c lw r11,(sp+28) 8006c90: 2b 8c 00 18 lw r12,(sp+24) 8006c94: 2b 8d 00 14 lw r13,(sp+20) 8006c98: 2b 8e 00 10 lw r14,(sp+16) 8006c9c: 2b 8f 00 0c lw r15,(sp+12) 8006ca0: 2b 90 00 08 lw r16,(sp+8) 8006ca4: 37 9c 00 1c addi sp,sp,28 8006ca8: c3 a0 00 00 ret =============================================================================== 08001bb8 : /* * Extract an integer value from the database */ static int scanInt(FILE *fp, int *val) { 8001bb8: 37 9c ff d4 addi sp,sp,-44 8001bbc: 5b 8b 00 2c sw (sp+44),r11 8001bc0: 5b 8c 00 28 sw (sp+40),r12 8001bc4: 5b 8d 00 24 sw (sp+36),r13 8001bc8: 5b 8e 00 20 sw (sp+32),r14 8001bcc: 5b 8f 00 1c sw (sp+28),r15 8001bd0: 5b 90 00 18 sw (sp+24),r16 8001bd4: 5b 91 00 14 sw (sp+20),r17 8001bd8: 5b 92 00 10 sw (sp+16),r18 8001bdc: 5b 93 00 0c sw (sp+12),r19 8001be0: 5b 94 00 08 sw (sp+8),r20 8001be4: 5b 9d 00 04 sw (sp+4),ra 8001be8: b8 20 58 00 mv r11,r1 int c; unsigned int i = 0; unsigned int limit = INT_MAX; 8001bec: 78 01 08 01 mvhi r1,0x801 8001bf0: 38 21 37 54 ori r1,r1,0x3754 8001bf4: 28 2e 00 00 lw r14,(r1+0) int sign = 0; int d; for (;;) { c = getc(fp); 8001bf8: 78 11 08 01 mvhi r17,0x801 limit++; continue; } sign = 1; } if (!isdigit(c)) 8001bfc: 78 10 08 01 mvhi r16,0x801 /* * Extract an integer value from the database */ static int scanInt(FILE *fp, int *val) { 8001c00: b8 40 90 00 mv r18,r2 int c; unsigned int i = 0; unsigned int limit = INT_MAX; int sign = 0; 8001c04: 34 0d 00 00 mvi r13,0 */ static int scanInt(FILE *fp, int *val) { int c; unsigned int i = 0; 8001c08: 34 0c 00 00 mvi r12,0 unsigned int limit = INT_MAX; int sign = 0; int d; for (;;) { c = getc(fp); 8001c0c: 3a 31 51 78 ori r17,r17,0x5178 if (c == ':') 8001c10: 34 14 00 3a mvi r20,58 limit++; continue; } sign = 1; } if (!isdigit(c)) 8001c14: 3a 10 51 70 ori r16,r16,0x5170 for (;;) { c = getc(fp); if (c == ':') break; if (sign == 0) { if (c == '-') { 8001c18: 34 13 00 2d mvi r19,45 unsigned int limit = INT_MAX; int sign = 0; int d; for (;;) { c = getc(fp); 8001c1c: 29 61 00 04 lw r1,(r11+4) 8001c20: 34 21 ff ff addi r1,r1,-1 8001c24: 59 61 00 04 sw (r11+4),r1 8001c28: 4c 20 00 06 bge r1,r0,8001c40 <== ALWAYS TAKEN 8001c2c: 2a 21 00 00 lw r1,(r17+0) <== NOT EXECUTED 8001c30: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8001c34: f8 00 32 3f calli 800e530 <__srget_r> <== NOT EXECUTED 8001c38: b8 20 78 00 mv r15,r1 <== NOT EXECUTED 8001c3c: e0 00 00 05 bi 8001c50 <== NOT EXECUTED 8001c40: 29 61 00 00 lw r1,(r11+0) 8001c44: 40 2f 00 00 lbu r15,(r1+0) 8001c48: 34 21 00 01 addi r1,r1,1 8001c4c: 59 61 00 00 sw (r11+0),r1 if (c == ':') 8001c50: 45 f4 00 1f be r15,r20,8001ccc break; if (sign == 0) { 8001c54: 5d a0 00 06 bne r13,r0,8001c6c if (c == '-') { sign = -1; limit++; continue; } sign = 1; 8001c58: 34 0d 00 01 mvi r13,1 for (;;) { c = getc(fp); if (c == ':') break; if (sign == 0) { if (c == '-') { 8001c5c: 5d f3 00 04 bne r15,r19,8001c6c sign = -1; limit++; 8001c60: 35 ce 00 01 addi r14,r14,1 c = getc(fp); if (c == ':') break; if (sign == 0) { if (c == '-') { sign = -1; 8001c64: 34 0d ff ff mvi r13,-1 limit++; continue; 8001c68: e3 ff ff ed bi 8001c1c } sign = 1; } if (!isdigit(c)) 8001c6c: 2a 01 00 00 lw r1,(r16+0) 8001c70: b4 2f 08 00 add r1,r1,r15 8001c74: 40 21 00 01 lbu r1,(r1+1) 8001c78: 20 21 00 04 andi r1,r1,0x4 8001c7c: 44 20 00 1c be r1,r0,8001cec return 0; d = c - '0'; if ((i > (limit / 10)) 8001c80: b9 c0 08 00 mv r1,r14 8001c84: 34 02 00 0a mvi r2,10 8001c88: f8 00 42 4c calli 80125b8 <__udivsi3> 8001c8c: 55 81 00 18 bgu r12,r1,8001cec <== NEVER TAKEN } sign = 1; } if (!isdigit(c)) return 0; d = c - '0'; 8001c90: 35 ef ff d0 addi r15,r15,-48 if ((i > (limit / 10)) || ((i == (limit / 10)) && (d > (limit % 10)))) 8001c94: 5d 81 00 05 bne r12,r1,8001ca8 <== ALWAYS TAKEN 8001c98: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 8001c9c: 34 02 00 0a mvi r2,10 <== NOT EXECUTED 8001ca0: f8 00 42 56 calli 80125f8 <__umodsi3> <== NOT EXECUTED 8001ca4: 55 e1 00 12 bgu r15,r1,8001cec <== NOT EXECUTED return 0; i = i * 10 + d; 8001ca8: b9 80 08 00 mv r1,r12 8001cac: 34 02 00 01 mvi r2,1 8001cb0: f8 00 41 68 calli 8012250 <__ashlsi3> 8001cb4: 34 02 00 02 mvi r2,2 8001cb8: b8 20 60 00 mv r12,r1 8001cbc: f8 00 41 65 calli 8012250 <__ashlsi3> 8001cc0: b5 81 08 00 add r1,r12,r1 8001cc4: b5 e1 60 00 add r12,r15,r1 8001cc8: e3 ff ff d5 bi 8001c1c } if (sign == 0) return 0; 8001ccc: 34 03 00 00 mvi r3,0 if ((i > (limit / 10)) || ((i == (limit / 10)) && (d > (limit % 10)))) return 0; i = i * 10 + d; } if (sign == 0) 8001cd0: 45 a0 00 08 be r13,r0,8001cf0 <== NEVER TAKEN return 0; *val = i * sign; 8001cd4: b9 a0 08 00 mv r1,r13 8001cd8: b9 80 10 00 mv r2,r12 8001cdc: f8 00 41 d2 calli 8012424 <__mulsi3> 8001ce0: 5a 41 00 00 sw (r18+0),r1 return 1; 8001ce4: 34 03 00 01 mvi r3,1 8001ce8: e0 00 00 02 bi 8001cf0 if (!isdigit(c)) return 0; d = c - '0'; if ((i > (limit / 10)) || ((i == (limit / 10)) && (d > (limit % 10)))) return 0; 8001cec: 34 03 00 00 mvi r3,0 } if (sign == 0) return 0; *val = i * sign; return 1; } 8001cf0: b8 60 08 00 mv r1,r3 8001cf4: 2b 9d 00 04 lw ra,(sp+4) 8001cf8: 2b 8b 00 2c lw r11,(sp+44) 8001cfc: 2b 8c 00 28 lw r12,(sp+40) 8001d00: 2b 8d 00 24 lw r13,(sp+36) 8001d04: 2b 8e 00 20 lw r14,(sp+32) 8001d08: 2b 8f 00 1c lw r15,(sp+28) 8001d0c: 2b 90 00 18 lw r16,(sp+24) 8001d10: 2b 91 00 14 lw r17,(sp+20) 8001d14: 2b 92 00 10 lw r18,(sp+16) 8001d18: 2b 93 00 0c lw r19,(sp+12) 8001d1c: 2b 94 00 08 lw r20,(sp+8) 8001d20: 37 9c 00 2c addi sp,sp,44 8001d24: c3 a0 00 00 ret =============================================================================== 08001d28 : /* * Extract a string value from the database */ static int scanString(FILE *fp, char **name, char **bufp, size_t *nleft, int nlFlag) { 8001d28: 37 9c ff d8 addi sp,sp,-40 8001d2c: 5b 8b 00 28 sw (sp+40),r11 8001d30: 5b 8c 00 24 sw (sp+36),r12 8001d34: 5b 8d 00 20 sw (sp+32),r13 8001d38: 5b 8e 00 1c sw (sp+28),r14 8001d3c: 5b 8f 00 18 sw (sp+24),r15 8001d40: 5b 90 00 14 sw (sp+20),r16 8001d44: 5b 91 00 10 sw (sp+16),r17 8001d48: 5b 92 00 0c sw (sp+12),r18 8001d4c: 5b 93 00 08 sw (sp+8),r19 8001d50: 5b 9d 00 04 sw (sp+4),ra 8001d54: b8 20 68 00 mv r13,r1 int c; *name = *bufp; 8001d58: 28 61 00 00 lw r1,(r3+0) for (;;) { c = getc(fp); 8001d5c: 78 0e 08 01 mvhi r14,0x801 /* * Extract a string value from the database */ static int scanString(FILE *fp, char **name, char **bufp, size_t *nleft, int nlFlag) { 8001d60: b8 60 58 00 mv r11,r3 8001d64: b8 80 60 00 mv r12,r4 8001d68: b8 a0 78 00 mv r15,r5 int c; *name = *bufp; 8001d6c: 58 41 00 00 sw (r2+0),r1 for (;;) { c = getc(fp); 8001d70: 39 ce 51 78 ori r14,r14,0x5178 if (c == ':') { 8001d74: 34 13 00 3a mvi r19,58 if (nlFlag) return 0; break; } if (c == '\n') { 8001d78: 34 12 00 0a mvi r18,10 if (!nlFlag) return 0; break; } if (c == EOF) 8001d7c: 34 11 ff ff mvi r17,-1 return 0; if (*nleft < 2) 8001d80: 34 10 00 01 mvi r16,1 { int c; *name = *bufp; for (;;) { c = getc(fp); 8001d84: 29 a1 00 04 lw r1,(r13+4) 8001d88: 34 21 ff ff addi r1,r1,-1 8001d8c: 59 a1 00 04 sw (r13+4),r1 8001d90: 4c 20 00 05 bge r1,r0,8001da4 8001d94: 29 c1 00 00 lw r1,(r14+0) 8001d98: b9 a0 10 00 mv r2,r13 8001d9c: f8 00 31 e5 calli 800e530 <__srget_r> 8001da0: e0 00 00 05 bi 8001db4 8001da4: 29 a2 00 00 lw r2,(r13+0) 8001da8: 40 41 00 00 lbu r1,(r2+0) 8001dac: 34 42 00 01 addi r2,r2,1 8001db0: 59 a2 00 00 sw (r13+0),r2 if (c == ':') { 8001db4: 5c 33 00 04 bne r1,r19,8001dc4 if (nlFlag) return 0; 8001db8: 34 01 00 00 mvi r1,0 *name = *bufp; for (;;) { c = getc(fp); if (c == ':') { if (nlFlag) 8001dbc: 45 e0 00 12 be r15,r0,8001e04 8001dc0: e0 00 00 1c bi 8001e30 return 0; break; } if (c == '\n') { 8001dc4: 5c 32 00 04 bne r1,r18,8001dd4 if (!nlFlag) return 0; 8001dc8: 34 01 00 00 mvi r1,0 if (nlFlag) return 0; break; } if (c == '\n') { if (!nlFlag) 8001dcc: 5d e0 00 0e bne r15,r0,8001e04 8001dd0: e0 00 00 18 bi 8001e30 return 0; break; } if (c == EOF) 8001dd4: 44 31 00 16 be r1,r17,8001e2c return 0; if (*nleft < 2) 8001dd8: 29 82 00 00 lw r2,(r12+0) 8001ddc: 52 02 00 14 bgeu r16,r2,8001e2c <== NEVER TAKEN return 0; **bufp = c; 8001de0: 29 62 00 00 lw r2,(r11+0) 8001de4: 30 41 00 00 sb (r2+0),r1 ++(*bufp); 8001de8: 29 61 00 00 lw r1,(r11+0) 8001dec: 34 21 00 01 addi r1,r1,1 8001df0: 59 61 00 00 sw (r11+0),r1 --(*nleft); 8001df4: 29 81 00 00 lw r1,(r12+0) 8001df8: 34 21 ff ff addi r1,r1,-1 8001dfc: 59 81 00 00 sw (r12+0),r1 } 8001e00: e3 ff ff e1 bi 8001d84 **bufp = '\0'; 8001e04: 29 61 00 00 lw r1,(r11+0) 8001e08: 30 20 00 00 sb (r1+0),r0 ++(*bufp); 8001e0c: 29 61 00 00 lw r1,(r11+0) 8001e10: 34 21 00 01 addi r1,r1,1 8001e14: 59 61 00 00 sw (r11+0),r1 --(*nleft); 8001e18: 29 81 00 00 lw r1,(r12+0) 8001e1c: 34 21 ff ff addi r1,r1,-1 8001e20: 59 81 00 00 sw (r12+0),r1 return 1; 8001e24: 34 01 00 01 mvi r1,1 8001e28: e0 00 00 02 bi 8001e30 break; } if (c == EOF) return 0; if (*nleft < 2) return 0; 8001e2c: 34 01 00 00 mvi r1,0 } **bufp = '\0'; ++(*bufp); --(*nleft); return 1; } 8001e30: 2b 9d 00 04 lw ra,(sp+4) 8001e34: 2b 8b 00 28 lw r11,(sp+40) 8001e38: 2b 8c 00 24 lw r12,(sp+36) 8001e3c: 2b 8d 00 20 lw r13,(sp+32) 8001e40: 2b 8e 00 1c lw r14,(sp+28) 8001e44: 2b 8f 00 18 lw r15,(sp+24) 8001e48: 2b 90 00 14 lw r16,(sp+20) 8001e4c: 2b 91 00 10 lw r17,(sp+16) 8001e50: 2b 92 00 0c lw r18,(sp+12) 8001e54: 2b 93 00 08 lw r19,(sp+8) 8001e58: 37 9c 00 28 addi sp,sp,40 8001e5c: c3 a0 00 00 ret =============================================================================== 08001e60 : FILE *fp, struct group *grp, char *buffer, size_t bufsize ) { 8001e60: 37 9c ff d8 addi sp,sp,-40 8001e64: 5b 8b 00 18 sw (sp+24),r11 8001e68: 5b 8c 00 14 sw (sp+20),r12 8001e6c: 5b 8d 00 10 sw (sp+16),r13 8001e70: 5b 8e 00 0c sw (sp+12),r14 8001e74: 5b 8f 00 08 sw (sp+8),r15 8001e78: 5b 9d 00 04 sw (sp+4),ra int grgid; char *grmem, *cp; int memcount; if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0) 8001e7c: 37 8e 00 20 addi r14,sp,32 8001e80: 37 8d 00 1c addi r13,sp,28 FILE *fp, struct group *grp, char *buffer, size_t bufsize ) { 8001e84: 5b 83 00 20 sw (sp+32),r3 8001e88: 5b 84 00 1c sw (sp+28),r4 int grgid; char *grmem, *cp; int memcount; if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0) 8001e8c: b9 c0 18 00 mv r3,r14 8001e90: b9 a0 20 00 mv r4,r13 8001e94: 34 05 00 00 mvi r5,0 FILE *fp, struct group *grp, char *buffer, size_t bufsize ) { 8001e98: b8 20 78 00 mv r15,r1 8001e9c: b8 40 58 00 mv r11,r2 int grgid; char *grmem, *cp; int memcount; if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0) 8001ea0: fb ff ff a2 calli 8001d28 || !scanString(fp, &grp->gr_passwd, &buffer, &bufsize, 0) || !scanInt(fp, &grgid) || !scanString(fp, &grmem, &buffer, &bufsize, 1)) return 0; 8001ea4: 34 0c 00 00 mvi r12,0 { int grgid; char *grmem, *cp; int memcount; if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0) 8001ea8: 44 20 00 43 be r1,r0,8001fb4 || !scanString(fp, &grp->gr_passwd, &buffer, &bufsize, 0) 8001eac: b9 e0 08 00 mv r1,r15 8001eb0: 35 62 00 04 addi r2,r11,4 8001eb4: b9 c0 18 00 mv r3,r14 8001eb8: b9 a0 20 00 mv r4,r13 8001ebc: 34 05 00 00 mvi r5,0 8001ec0: fb ff ff 9a calli 8001d28 8001ec4: 44 20 00 3c be r1,r0,8001fb4 <== NEVER TAKEN || !scanInt(fp, &grgid) 8001ec8: b9 e0 08 00 mv r1,r15 8001ecc: 37 82 00 28 addi r2,sp,40 8001ed0: fb ff ff 3a calli 8001bb8 8001ed4: 44 20 00 38 be r1,r0,8001fb4 <== NEVER TAKEN || !scanString(fp, &grmem, &buffer, &bufsize, 1)) 8001ed8: b9 e0 08 00 mv r1,r15 8001edc: 37 82 00 24 addi r2,sp,36 8001ee0: b9 c0 18 00 mv r3,r14 8001ee4: b9 a0 20 00 mv r4,r13 8001ee8: 34 05 00 01 mvi r5,1 8001eec: fb ff ff 8f calli 8001d28 8001ef0: 44 20 00 31 be r1,r0,8001fb4 <== NEVER TAKEN return 0; grp->gr_gid = grgid; 8001ef4: 2b 81 00 28 lw r1,(sp+40) /* * Determine number of members */ for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 8001ef8: 2b 8d 00 24 lw r13,(sp+36) if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0) || !scanString(fp, &grp->gr_passwd, &buffer, &bufsize, 0) || !scanInt(fp, &grgid) || !scanString(fp, &grmem, &buffer, &bufsize, 1)) return 0; grp->gr_gid = grgid; 8001efc: 0d 61 00 08 sh (r11+8),r1 /* * Determine number of members */ for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 8001f00: b9 a0 10 00 mv r2,r13 8001f04: 34 01 00 01 mvi r1,1 8001f08: e0 00 00 04 bi 8001f18 if(*cp == ',') memcount++; 8001f0c: 64 63 00 2c cmpei r3,r3,44 grp->gr_gid = grgid; /* * Determine number of members */ for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 8001f10: 34 42 00 01 addi r2,r2,1 if(*cp == ',') memcount++; 8001f14: b4 23 08 00 add r1,r1,r3 grp->gr_gid = grgid; /* * Determine number of members */ for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 8001f18: 40 43 00 00 lbu r3,(r2+0) 8001f1c: 5c 60 ff fc bne r3,r0,8001f0c } /* * Hack to produce (hopefully) a suitably-aligned array of pointers */ if (bufsize < (((memcount+1)*sizeof(char *)) + 15)) 8001f20: 34 02 00 02 mvi r2,2 8001f24: 34 21 00 01 addi r1,r1,1 8001f28: f8 00 40 ca calli 8012250 <__ashlsi3> 8001f2c: 2b 82 00 1c lw r2,(sp+28) 8001f30: 34 21 00 0f addi r1,r1,15 return 0; 8001f34: 34 0c 00 00 mvi r12,0 } /* * Hack to produce (hopefully) a suitably-aligned array of pointers */ if (bufsize < (((memcount+1)*sizeof(char *)) + 15)) 8001f38: 54 22 00 1f bgu r1,r2,8001fb4 <== NEVER TAKEN return 0; grp->gr_mem = (char **)(((uintptr_t)buffer + 15) & ~15); 8001f3c: 2b 81 00 20 lw r1,(sp+32) 8001f40: 34 02 ff f0 mvi r2,-16 /* * Fill in pointer array */ grp->gr_mem[0] = grmem; for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { if(*cp == ',') { 8001f44: 34 0e 00 2c mvi r14,44 /* * Hack to produce (hopefully) a suitably-aligned array of pointers */ if (bufsize < (((memcount+1)*sizeof(char *)) + 15)) return 0; grp->gr_mem = (char **)(((uintptr_t)buffer + 15) & ~15); 8001f48: 34 21 00 0f addi r1,r1,15 8001f4c: a0 22 08 00 and r1,r1,r2 8001f50: 59 61 00 0c sw (r11+12),r1 /* * Fill in pointer array */ grp->gr_mem[0] = grmem; 8001f54: 58 2d 00 00 sw (r1+0),r13 } /* * Extract a single group record from the database */ static int scangr( 8001f58: 2b 8c 00 24 lw r12,(sp+36) /* * Fill in pointer array */ grp->gr_mem[0] = grmem; for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 8001f5c: 34 0d 00 01 mvi r13,1 } /* * Extract a single group record from the database */ static int scangr( 8001f60: 35 8c 00 01 addi r12,r12,1 /* * Fill in pointer array */ grp->gr_mem[0] = grmem; for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 8001f64: e0 00 00 0b bi 8001f90 if(*cp == ',') { 8001f68: 5c 2e 00 09 bne r1,r14,8001f8c *cp = '\0'; 8001f6c: 31 80 ff ff sb (r12+-1),r0 grp->gr_mem[memcount++] = cp + 1; 8001f70: 29 6f 00 0c lw r15,(r11+12) 8001f74: b9 a0 08 00 mv r1,r13 8001f78: 34 02 00 02 mvi r2,2 8001f7c: f8 00 40 b5 calli 8012250 <__ashlsi3> 8001f80: b5 e1 08 00 add r1,r15,r1 8001f84: 58 2c 00 00 sw (r1+0),r12 8001f88: 35 ad 00 01 addi r13,r13,1 8001f8c: 35 8c 00 01 addi r12,r12,1 /* * Fill in pointer array */ grp->gr_mem[0] = grmem; for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 8001f90: 41 81 ff ff lbu r1,(r12+-1) 8001f94: 5c 20 ff f5 bne r1,r0,8001f68 if(*cp == ',') { *cp = '\0'; grp->gr_mem[memcount++] = cp + 1; } } grp->gr_mem[memcount] = NULL; 8001f98: 29 6b 00 0c lw r11,(r11+12) 8001f9c: b9 a0 08 00 mv r1,r13 8001fa0: 34 02 00 02 mvi r2,2 8001fa4: f8 00 40 ab calli 8012250 <__ashlsi3> 8001fa8: b5 61 08 00 add r1,r11,r1 8001fac: 58 20 00 00 sw (r1+0),r0 return 1; 8001fb0: 34 0c 00 01 mvi r12,1 } 8001fb4: b9 80 08 00 mv r1,r12 8001fb8: 2b 9d 00 04 lw ra,(sp+4) 8001fbc: 2b 8b 00 18 lw r11,(sp+24) 8001fc0: 2b 8c 00 14 lw r12,(sp+20) 8001fc4: 2b 8d 00 10 lw r13,(sp+16) 8001fc8: 2b 8e 00 0c lw r14,(sp+12) 8001fcc: 2b 8f 00 08 lw r15,(sp+8) 8001fd0: 37 9c 00 28 addi sp,sp,40 8001fd4: c3 a0 00 00 ret =============================================================================== 08001fd8 : FILE *fp, struct passwd *pwd, char *buffer, size_t bufsize ) { 8001fd8: 37 9c ff d8 addi sp,sp,-40 8001fdc: 5b 8b 00 18 sw (sp+24),r11 8001fe0: 5b 8c 00 14 sw (sp+20),r12 8001fe4: 5b 8d 00 10 sw (sp+16),r13 8001fe8: 5b 8e 00 0c sw (sp+12),r14 8001fec: 5b 8f 00 08 sw (sp+8),r15 8001ff0: 5b 9d 00 04 sw (sp+4),ra int pwuid, pwgid; if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0) 8001ff4: 37 8e 00 20 addi r14,sp,32 8001ff8: 37 8d 00 1c addi r13,sp,28 FILE *fp, struct passwd *pwd, char *buffer, size_t bufsize ) { 8001ffc: 5b 83 00 20 sw (sp+32),r3 8002000: 5b 84 00 1c sw (sp+28),r4 int pwuid, pwgid; if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0) 8002004: b9 c0 18 00 mv r3,r14 8002008: b9 a0 20 00 mv r4,r13 800200c: 34 05 00 00 mvi r5,0 FILE *fp, struct passwd *pwd, char *buffer, size_t bufsize ) { 8002010: b8 20 60 00 mv r12,r1 8002014: b8 40 58 00 mv r11,r2 int pwuid, pwgid; if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0) 8002018: fb ff ff 44 calli 8001d28 || !scanInt(fp, &pwgid) || !scanString(fp, &pwd->pw_comment, &buffer, &bufsize, 0) || !scanString(fp, &pwd->pw_gecos, &buffer, &bufsize, 0) || !scanString(fp, &pwd->pw_dir, &buffer, &bufsize, 0) || !scanString(fp, &pwd->pw_shell, &buffer, &bufsize, 1)) return 0; 800201c: 34 0f 00 00 mvi r15,0 size_t bufsize ) { int pwuid, pwgid; if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0) 8002020: 44 20 00 31 be r1,r0,80020e4 || !scanString(fp, &pwd->pw_passwd, &buffer, &bufsize, 0) 8002024: b9 80 08 00 mv r1,r12 8002028: 35 62 00 04 addi r2,r11,4 800202c: b9 c0 18 00 mv r3,r14 8002030: b9 a0 20 00 mv r4,r13 8002034: 34 05 00 00 mvi r5,0 8002038: fb ff ff 3c calli 8001d28 800203c: 44 20 00 2a be r1,r0,80020e4 <== NEVER TAKEN || !scanInt(fp, &pwuid) 8002040: b9 80 08 00 mv r1,r12 8002044: 37 82 00 28 addi r2,sp,40 8002048: fb ff fe dc calli 8001bb8 800204c: 44 20 00 26 be r1,r0,80020e4 <== NEVER TAKEN || !scanInt(fp, &pwgid) 8002050: b9 80 08 00 mv r1,r12 8002054: 37 82 00 24 addi r2,sp,36 8002058: fb ff fe d8 calli 8001bb8 800205c: 44 20 00 22 be r1,r0,80020e4 <== NEVER TAKEN || !scanString(fp, &pwd->pw_comment, &buffer, &bufsize, 0) 8002060: b9 80 08 00 mv r1,r12 8002064: 35 62 00 0c addi r2,r11,12 8002068: b9 c0 18 00 mv r3,r14 800206c: b9 a0 20 00 mv r4,r13 8002070: 34 05 00 00 mvi r5,0 8002074: fb ff ff 2d calli 8001d28 8002078: 44 20 00 1b be r1,r0,80020e4 <== NEVER TAKEN || !scanString(fp, &pwd->pw_gecos, &buffer, &bufsize, 0) 800207c: b9 80 08 00 mv r1,r12 8002080: 35 62 00 10 addi r2,r11,16 8002084: b9 c0 18 00 mv r3,r14 8002088: b9 a0 20 00 mv r4,r13 800208c: 34 05 00 00 mvi r5,0 8002090: fb ff ff 26 calli 8001d28 8002094: 44 20 00 14 be r1,r0,80020e4 <== NEVER TAKEN || !scanString(fp, &pwd->pw_dir, &buffer, &bufsize, 0) 8002098: b9 80 08 00 mv r1,r12 800209c: 35 62 00 14 addi r2,r11,20 80020a0: b9 c0 18 00 mv r3,r14 80020a4: b9 a0 20 00 mv r4,r13 80020a8: 34 05 00 00 mvi r5,0 80020ac: fb ff ff 1f calli 8001d28 80020b0: 44 20 00 0d be r1,r0,80020e4 <== NEVER TAKEN || !scanString(fp, &pwd->pw_shell, &buffer, &bufsize, 1)) 80020b4: b9 80 08 00 mv r1,r12 80020b8: 35 62 00 18 addi r2,r11,24 80020bc: b9 c0 18 00 mv r3,r14 80020c0: b9 a0 20 00 mv r4,r13 80020c4: 34 05 00 01 mvi r5,1 80020c8: fb ff ff 18 calli 8001d28 80020cc: 44 20 00 06 be r1,r0,80020e4 return 0; pwd->pw_uid = pwuid; 80020d0: 2b 81 00 28 lw r1,(sp+40) pwd->pw_gid = pwgid; return 1; 80020d4: 34 0f 00 01 mvi r15,1 || !scanString(fp, &pwd->pw_comment, &buffer, &bufsize, 0) || !scanString(fp, &pwd->pw_gecos, &buffer, &bufsize, 0) || !scanString(fp, &pwd->pw_dir, &buffer, &bufsize, 0) || !scanString(fp, &pwd->pw_shell, &buffer, &bufsize, 1)) return 0; pwd->pw_uid = pwuid; 80020d8: 0d 61 00 08 sh (r11+8),r1 pwd->pw_gid = pwgid; 80020dc: 2b 81 00 24 lw r1,(sp+36) 80020e0: 0d 61 00 0a sh (r11+10),r1 return 1; } 80020e4: b9 e0 08 00 mv r1,r15 80020e8: 2b 9d 00 04 lw ra,(sp+4) 80020ec: 2b 8b 00 18 lw r11,(sp+24) 80020f0: 2b 8c 00 14 lw r12,(sp+20) 80020f4: 2b 8d 00 10 lw r13,(sp+16) 80020f8: 2b 8e 00 0c lw r14,(sp+12) 80020fc: 2b 8f 00 08 lw r15,(sp+8) 8002100: 37 9c 00 28 addi sp,sp,40 8002104: c3 a0 00 00 ret =============================================================================== 0800598c : /* * Process input character, with semaphore. */ static int siproc (unsigned char c, struct rtems_termios_tty *tty) { 800598c: 37 9c ff f4 addi sp,sp,-12 8005990: 5b 8b 00 0c sw (sp+12),r11 8005994: 5b 8c 00 08 sw (sp+8),r12 8005998: 5b 9d 00 04 sw (sp+4),ra 800599c: b8 20 60 00 mv r12,r1 int i; /* * Obtain output semaphore if character will be echoed */ if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) { 80059a0: 28 41 00 3c lw r1,(r2+60) /* * Process input character, with semaphore. */ static int siproc (unsigned char c, struct rtems_termios_tty *tty) { 80059a4: b8 40 58 00 mv r11,r2 int i; /* * Obtain output semaphore if character will be echoed */ if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) { 80059a8: 20 21 0e 78 andi r1,r1,0xe78 80059ac: 44 20 00 0c be r1,r0,80059dc <== NEVER TAKEN rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 80059b0: 28 41 00 18 lw r1,(r2+24) 80059b4: 34 03 00 00 mvi r3,0 80059b8: 34 02 00 00 mvi r2,0 80059bc: f8 00 05 8d calli 8006ff0 i = iproc (c, tty); 80059c0: b9 80 08 00 mv r1,r12 80059c4: b9 60 10 00 mv r2,r11 80059c8: fb ff ff 84 calli 80057d8 80059cc: b8 20 60 00 mv r12,r1 rtems_semaphore_release (tty->osem); 80059d0: 29 61 00 18 lw r1,(r11+24) 80059d4: f8 00 05 d7 calli 8007130 80059d8: e0 00 00 04 bi 80059e8 } else { i = iproc (c, tty); 80059dc: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 80059e0: fb ff ff 7e calli 80057d8 <== NOT EXECUTED 80059e4: b8 20 60 00 mv r12,r1 <== NOT EXECUTED } return i; } 80059e8: b9 80 08 00 mv r1,r12 80059ec: 2b 9d 00 04 lw ra,(sp+4) 80059f0: 2b 8b 00 0c lw r11,(sp+12) 80059f4: 2b 8c 00 08 lw r12,(sp+8) 80059f8: 37 9c 00 0c addi sp,sp,12 80059fc: c3 a0 00 00 ret =============================================================================== 0800509c : #include int statvfs (const char *path, struct statvfs *sb) { 800509c: 37 9c ff dc addi sp,sp,-36 80050a0: 5b 8b 00 10 sw (sp+16),r11 80050a4: 5b 8c 00 0c sw (sp+12),r12 80050a8: 5b 8d 00 08 sw (sp+8),r13 80050ac: 5b 9d 00 04 sw (sp+4),ra 80050b0: b8 20 58 00 mv r11,r1 80050b4: b8 40 68 00 mv r13,r2 * The root node of the mounted filesytem. * The node for the directory that the fileystem is mounted on. * The mount entry that is being refered to. */ if ( rtems_filesystem_evaluate_path( path, strlen( path ), 0x0, &loc, true ) ) 80050b8: 37 8c 00 14 addi r12,sp,20 80050bc: f8 00 2d 9c calli 801072c 80050c0: b8 20 10 00 mv r2,r1 80050c4: 34 03 00 00 mvi r3,0 80050c8: b9 60 08 00 mv r1,r11 80050cc: b9 80 20 00 mv r4,r12 80050d0: 34 05 00 01 mvi r5,1 80050d4: fb ff fa 27 calli 8003970 return -1; 80050d8: 34 0b ff ff mvi r11,-1 * The root node of the mounted filesytem. * The node for the directory that the fileystem is mounted on. * The mount entry that is being refered to. */ if ( rtems_filesystem_evaluate_path( path, strlen( path ), 0x0, &loc, true ) ) 80050dc: 5c 20 00 0e bne r1,r0,8005114 <== NEVER TAKEN return -1; mt_entry = loc.mt_entry; 80050e0: 2b 8b 00 24 lw r11,(sp+36) fs_mount_root = &mt_entry->mt_fs_root; memset (sb, 0, sizeof (struct statvfs)); 80050e4: 34 02 00 00 mvi r2,0 80050e8: 34 03 00 38 mvi r3,56 80050ec: b9 a0 08 00 mv r1,r13 80050f0: f8 00 28 e3 calli 800f47c result = ( fs_mount_root->ops->statvfs_h )( fs_mount_root, sb ); 80050f4: 29 61 00 28 lw r1,(r11+40) 80050f8: b9 a0 10 00 mv r2,r13 80050fc: 28 23 00 44 lw r3,(r1+68) 8005100: 35 61 00 1c addi r1,r11,28 8005104: d8 60 00 00 call r3 8005108: b8 20 58 00 mv r11,r1 rtems_filesystem_freenode( &loc ); 800510c: b9 80 08 00 mv r1,r12 8005110: fb ff fa 6a calli 8003ab8 return result; } 8005114: b9 60 08 00 mv r1,r11 8005118: 2b 9d 00 04 lw ra,(sp+4) 800511c: 2b 8b 00 10 lw r11,(sp+16) 8005120: 2b 8c 00 0c lw r12,(sp+12) 8005124: 2b 8d 00 08 lw r13,(sp+8) 8005128: 37 9c 00 24 addi sp,sp,36 800512c: c3 a0 00 00 ret =============================================================================== 080039ac : fdatasync(fn); } /* iterate over all FILE *'s for this thread */ static void sync_per_thread(Thread_Control *t) { 80039ac: 37 9c ff f4 addi sp,sp,-12 80039b0: 5b 8b 00 0c sw (sp+12),r11 80039b4: 5b 8c 00 08 sw (sp+8),r12 80039b8: 5b 9d 00 04 sw (sp+4),ra /* * The sync_wrapper() function will operate on the current thread's * reent structure so we will temporarily use that. */ this_reent = t->libc_reent; 80039bc: 28 22 01 20 lw r2,(r1+288) if ( this_reent ) { 80039c0: 44 40 00 0c be r2,r0,80039f0 <== NEVER TAKEN current_reent = _Thread_Executing->libc_reent; 80039c4: 78 0b 08 01 mvhi r11,0x801 80039c8: 39 6b 59 a8 ori r11,r11,0x59a8 80039cc: 29 63 00 0c lw r3,(r11+12) 80039d0: 28 6c 01 20 lw r12,(r3+288) _Thread_Executing->libc_reent = this_reent; 80039d4: 58 62 01 20 sw (r3+288),r2 _fwalk (t->libc_reent, sync_wrapper); 80039d8: 28 21 01 20 lw r1,(r1+288) 80039dc: 78 02 08 00 mvhi r2,0x800 80039e0: 38 42 3a 04 ori r2,r2,0x3a04 80039e4: f8 00 26 cd calli 800d518 <_fwalk> _Thread_Executing->libc_reent = current_reent; 80039e8: 29 61 00 0c lw r1,(r11+12) 80039ec: 58 2c 01 20 sw (r1+288),r12 } } 80039f0: 2b 9d 00 04 lw ra,(sp+4) 80039f4: 2b 8b 00 0c lw r11,(sp+12) 80039f8: 2b 8c 00 08 lw r12,(sp+8) 80039fc: 37 9c 00 0c addi sp,sp,12 8003a00: c3 a0 00 00 ret =============================================================================== 080022d0 : int tcflow ( int fd __attribute__((unused)), int action ) { 80022d0: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 80022d4: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED case TCOOFF: case TCOON: case TCIOFF: case TCION: default: rtems_set_errno_and_return_minus_one( EINVAL ); 80022d8: f8 00 1a ed calli 8008e8c <__errno> <== NOT EXECUTED 80022dc: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 80022e0: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED /* fd is not validated */ /* When this is supported, implement it here */ rtems_set_errno_and_return_minus_one( ENOTSUP ); } 80022e4: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 80022e8: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80022ec: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 80022f0: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080022f4 : int tcflush ( int fd __attribute__((unused)), int queue ) { 80022f4: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 80022f8: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED switch (queue) { case TCIFLUSH: case TCOFLUSH: case TCIOFLUSH: default: rtems_set_errno_and_return_minus_one( EINVAL ); 80022fc: f8 00 1a e4 calli 8008e8c <__errno> <== NOT EXECUTED 8002300: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8002304: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED /* fd is not validated */ /* When this is supported, implement it here */ rtems_set_errno_and_return_minus_one( ENOTSUP ); return 0; } 8002308: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800230c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8002310: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 8002314: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08002318 : #include #include pid_t tcgetpgrp(int fd __attribute__((unused))) { 8002318: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 800231c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED return getpid(); 8002320: fb ff fc 83 calli 800152c <== NOT EXECUTED } 8002324: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8002328: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 800232c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08002330 : int tcsendbreak ( int fd __attribute__((unused)), int duration __attribute__((unused)) ) { return 0; } 8002330: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8002334: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08004370 : int tcsetattr( int fd, int opt, struct termios *tp ) { 8004370: 37 9c ff f4 addi sp,sp,-12 8004374: 5b 8b 00 0c sw (sp+12),r11 8004378: 5b 8c 00 08 sw (sp+8),r12 800437c: 5b 9d 00 04 sw (sp+4),ra 8004380: b8 20 60 00 mv r12,r1 8004384: b8 60 58 00 mv r11,r3 switch (opt) { 8004388: 44 40 00 0d be r2,r0,80043bc 800438c: 34 03 00 01 mvi r3,1 8004390: 44 43 00 06 be r2,r3,80043a8 default: rtems_set_errno_and_return_minus_one( ENOTSUP ); 8004394: f8 00 2d 49 calli 800f8b8 <__errno> 8004398: 34 02 00 86 mvi r2,134 800439c: 58 22 00 00 sw (r1+0),r2 80043a0: 34 02 ff ff mvi r2,-1 80043a4: e0 00 00 0b bi 80043d0 case TCSADRAIN: if (ioctl( fd, RTEMS_IO_TCDRAIN, NULL ) < 0) 80043a8: 34 02 00 03 mvi r2,3 80043ac: 34 03 00 00 mvi r3,0 80043b0: f8 00 21 a7 calli 800ca4c return -1; 80043b4: 34 02 ff ff mvi r2,-1 switch (opt) { default: rtems_set_errno_and_return_minus_one( ENOTSUP ); case TCSADRAIN: if (ioctl( fd, RTEMS_IO_TCDRAIN, NULL ) < 0) 80043b8: 48 01 00 06 bg r0,r1,80043d0 <== NEVER TAKEN return -1; /* * Fall through to.... */ case TCSANOW: return ioctl( fd, RTEMS_IO_SET_ATTRIBUTES, tp ); 80043bc: 34 02 00 02 mvi r2,2 80043c0: b9 80 08 00 mv r1,r12 80043c4: b9 60 18 00 mv r3,r11 80043c8: f8 00 21 a1 calli 800ca4c 80043cc: b8 20 10 00 mv r2,r1 } } 80043d0: b8 40 08 00 mv r1,r2 80043d4: 2b 9d 00 04 lw ra,(sp+4) 80043d8: 2b 8b 00 0c lw r11,(sp+12) 80043dc: 2b 8c 00 08 lw r12,(sp+8) 80043e0: 37 9c 00 0c addi sp,sp,12 80043e4: c3 a0 00 00 ret =============================================================================== 08002338 : int tcsetpgrp( int fd __attribute__((unused)), pid_t pid __attribute__((unused)) ) { return 0; } 8002338: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 800233c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 0800390c : #include int unlink( const char *path ) { 800390c: 37 9c ff c0 addi sp,sp,-64 8003910: 5b 8b 00 14 sw (sp+20),r11 8003914: 5b 8c 00 10 sw (sp+16),r12 8003918: 5b 8d 00 0c sw (sp+12),r13 800391c: 5b 8e 00 08 sw (sp+8),r14 8003920: 5b 9d 00 04 sw (sp+4),ra 8003924: b8 20 70 00 mv r14,r1 /* * Get the node to be unlinked. Find the parent path first. */ parentpathlen = rtems_filesystem_dirname ( path ); 8003928: fb ff fb 54 calli 8002678 800392c: b8 20 58 00 mv r11,r1 8003930: 37 84 00 2c addi r4,sp,44 if ( parentpathlen == 0 ) 8003934: 5c 20 00 07 bne r1,r0,8003950 rtems_filesystem_get_start_loc( path, &i, &parentloc ); 8003938: b9 c0 08 00 mv r1,r14 800393c: 37 82 00 40 addi r2,sp,64 8003940: b8 80 18 00 mv r3,r4 8003944: fb ff ff c0 calli 8003844 const char *name; rtems_filesystem_location_info_t parentloc; rtems_filesystem_location_info_t loc; int i; int result; bool free_parentloc = false; 8003948: 34 0d 00 00 mvi r13,0 800394c: e0 00 00 09 bi 8003970 parentpathlen = rtems_filesystem_dirname ( path ); if ( parentpathlen == 0 ) rtems_filesystem_get_start_loc( path, &i, &parentloc ); else { result = rtems_filesystem_evaluate_path( path, parentpathlen, 8003950: b9 c0 08 00 mv r1,r14 8003954: b9 60 10 00 mv r2,r11 8003958: 34 03 00 02 mvi r3,2 800395c: 34 05 00 00 mvi r5,0 8003960: fb ff fb 21 calli 80025e4 RTEMS_LIBIO_PERMS_WRITE, &parentloc, false ); if ( result != 0 ) return -1; 8003964: 34 0c ff ff mvi r12,-1 else { result = rtems_filesystem_evaluate_path( path, parentpathlen, RTEMS_LIBIO_PERMS_WRITE, &parentloc, false ); if ( result != 0 ) 8003968: 5c 20 00 3d bne r1,r0,8003a5c <== NEVER TAKEN return -1; free_parentloc = true; 800396c: 34 0d 00 01 mvi r13,1 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 8003970: 2b 81 00 2c lw r1,(sp+44) name = path + parentpathlen; 8003974: b5 cb 58 00 add r11,r14,r11 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 8003978: 5b 81 00 18 sw (sp+24),r1 800397c: 2b 81 00 30 lw r1,(sp+48) 8003980: 5b 81 00 1c sw (sp+28),r1 8003984: 2b 81 00 34 lw r1,(sp+52) 8003988: 5b 81 00 20 sw (sp+32),r1 800398c: 2b 81 00 38 lw r1,(sp+56) 8003990: 5b 81 00 24 sw (sp+36),r1 8003994: 2b 81 00 3c lw r1,(sp+60) 8003998: 5b 81 00 28 sw (sp+40),r1 name = path + parentpathlen; name += rtems_filesystem_prefix_separators( name, strlen( name ) ); 800399c: b9 60 08 00 mv r1,r11 80039a0: f8 00 36 98 calli 8011400 80039a4: b8 20 10 00 mv r2,r1 80039a8: b9 60 08 00 mv r1,r11 80039ac: fb ff fb 47 calli 80026c8 80039b0: b5 61 60 00 add r12,r11,r1 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 80039b4: b9 80 08 00 mv r1,r12 80039b8: f8 00 36 92 calli 8011400 80039bc: 37 8b 00 18 addi r11,sp,24 80039c0: b8 20 10 00 mv r2,r1 80039c4: 34 03 00 00 mvi r3,0 80039c8: b9 80 08 00 mv r1,r12 80039cc: b9 60 20 00 mv r4,r11 80039d0: 34 05 00 00 mvi r5,0 80039d4: fb ff fa d8 calli 8002534 0, &loc, false ); if ( result != 0 ) { 80039d8: 44 20 00 05 be r1,r0,80039ec if ( free_parentloc ) rtems_filesystem_freenode( &parentloc ); return -1; 80039dc: 34 0c ff ff mvi r12,-1 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 0, &loc, false ); if ( result != 0 ) { if ( free_parentloc ) rtems_filesystem_freenode( &parentloc ); 80039e0: 37 81 00 2c addi r1,sp,44 name += rtems_filesystem_prefix_separators( name, strlen( name ) ); result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 0, &loc, false ); if ( result != 0 ) { if ( free_parentloc ) 80039e4: 45 a0 00 1e be r13,r0,8003a5c <== NEVER TAKEN 80039e8: e0 00 00 1c bi 8003a58 rtems_filesystem_freenode( &parentloc ); return -1; } if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) { 80039ec: 2b 81 00 24 lw r1,(sp+36) 80039f0: 28 22 00 10 lw r2,(r1+16) 80039f4: b9 60 08 00 mv r1,r11 80039f8: d8 40 00 00 call r2 80039fc: 34 02 00 01 mvi r2,1 8003a00: 5c 22 00 0b bne r1,r2,8003a2c rtems_filesystem_freenode( &loc ); 8003a04: b9 60 08 00 mv r1,r11 8003a08: fb ff fb 49 calli 800272c if ( free_parentloc ) 8003a0c: 45 a0 00 03 be r13,r0,8003a18 <== ALWAYS TAKEN rtems_filesystem_freenode( &parentloc ); 8003a10: 37 81 00 2c addi r1,sp,44 <== NOT EXECUTED 8003a14: fb ff fb 46 calli 800272c <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EISDIR ); 8003a18: f8 00 32 0e calli 8010250 <__errno> 8003a1c: 34 02 00 15 mvi r2,21 8003a20: 58 22 00 00 sw (r1+0),r2 8003a24: 34 0c ff ff mvi r12,-1 8003a28: e0 00 00 0d bi 8003a5c } result = (*loc.ops->unlink_h)( &parentloc, &loc ); 8003a2c: 2b 81 00 24 lw r1,(sp+36) 8003a30: 37 8e 00 2c addi r14,sp,44 8003a34: b9 60 10 00 mv r2,r11 8003a38: 28 23 00 0c lw r3,(r1+12) 8003a3c: b9 c0 08 00 mv r1,r14 8003a40: d8 60 00 00 call r3 8003a44: b8 20 60 00 mv r12,r1 rtems_filesystem_freenode( &loc ); 8003a48: b9 60 08 00 mv r1,r11 8003a4c: fb ff fb 38 calli 800272c if ( free_parentloc ) 8003a50: 45 a0 00 03 be r13,r0,8003a5c rtems_filesystem_freenode( &parentloc ); 8003a54: b9 c0 08 00 mv r1,r14 8003a58: fb ff fb 35 calli 800272c return result; } 8003a5c: b9 80 08 00 mv r1,r12 8003a60: 2b 9d 00 04 lw ra,(sp+4) 8003a64: 2b 8b 00 14 lw r11,(sp+20) 8003a68: 2b 8c 00 10 lw r12,(sp+16) 8003a6c: 2b 8d 00 0c lw r13,(sp+12) 8003a70: 2b 8e 00 08 lw r14,(sp+8) 8003a74: 37 9c 00 40 addi sp,sp,64 8003a78: c3 a0 00 00 ret =============================================================================== 08003988 : */ int unmount( const char *path ) { 8003988: 37 9c ff dc addi sp,sp,-36 800398c: 5b 8b 00 10 sw (sp+16),r11 8003990: 5b 8c 00 0c sw (sp+12),r12 8003994: 5b 8d 00 08 sw (sp+8),r13 8003998: 5b 9d 00 04 sw (sp+4),ra 800399c: b8 20 58 00 mv r11,r1 * The root node of the mounted filesytem. * The node for the directory that the fileystem is mounted on. * The mount entry that is being refered to. */ if ( rtems_filesystem_evaluate_path( path, strlen( path ), 0x0, &loc, true ) ) 80039a0: 37 8c 00 14 addi r12,sp,20 80039a4: f8 00 27 8f calli 800d7e0 80039a8: b8 20 10 00 mv r2,r1 80039ac: 34 03 00 00 mvi r3,0 80039b0: b9 60 08 00 mv r1,r11 80039b4: b9 80 20 00 mv r4,r12 80039b8: 34 05 00 01 mvi r5,1 80039bc: fb ff fa 18 calli 800221c 80039c0: 5c 20 00 41 bne r1,r0,8003ac4 return -1; mt_entry = loc.mt_entry; 80039c4: 2b 8b 00 24 lw r11,(sp+36) /* * Verify this is the root node for the file system to be unmounted. */ if ( fs_root_loc->node_access != loc.node_access ){ 80039c8: 2b 81 00 14 lw r1,(sp+20) 80039cc: 29 62 00 1c lw r2,(r11+28) 80039d0: 44 41 00 06 be r2,r1,80039e8 rtems_filesystem_freenode( &loc ); 80039d4: b9 80 08 00 mv r1,r12 80039d8: fb ff fa 63 calli 8002364 rtems_set_errno_and_return_minus_one( EACCES ); 80039dc: f8 00 21 db calli 800c148 <__errno> 80039e0: 34 02 00 0d mvi r2,13 80039e4: e0 00 00 13 bi 8003a30 /* * Free the loc node and just use the nodes from the mt_entry . */ rtems_filesystem_freenode( &loc ); 80039e8: b9 80 08 00 mv r1,r12 80039ec: fb ff fa 5e calli 8002364 * that made the current node thread based instead * of system based? I thought it was but it doesn't * look like it in this version. */ if ( rtems_filesystem_current.mt_entry == mt_entry ) 80039f0: 78 01 08 01 mvhi r1,0x801 80039f4: 38 21 51 a0 ori r1,r1,0x51a0 80039f8: 28 21 00 00 lw r1,(r1+0) 80039fc: 28 21 00 14 lw r1,(r1+20) 8003a00: 44 2b 00 0a be r1,r11,8003a28 /* * Verify there are no file systems below the path specified */ if ( rtems_filesystem_mount_iterate( is_fs_below_mount_point, 8003a04: 29 62 00 2c lw r2,(r11+44) 8003a08: 78 01 08 00 mvhi r1,0x800 8003a0c: 38 21 39 7c ori r1,r1,0x397c 8003a10: fb ff fc ef calli 8002dcc 8003a14: 5c 20 00 05 bne r1,r0,8003a28 * Run the file descriptor table to determine if there are any file * descriptors that are currently active and reference nodes in the * file system that we are trying to unmount */ if ( rtems_libio_is_open_files_in_fs( mt_entry ) == 1 ) 8003a18: b9 60 08 00 mv r1,r11 8003a1c: fb ff fb 6c calli 80027cc 8003a20: 34 02 00 01 mvi r2,1 8003a24: 5c 22 00 05 bne r1,r2,8003a38 rtems_set_errno_and_return_minus_one( EBUSY ); 8003a28: f8 00 21 c8 calli 800c148 <__errno> 8003a2c: 34 02 00 10 mvi r2,16 8003a30: 58 22 00 00 sw (r1+0),r2 8003a34: e0 00 00 24 bi 8003ac4 * Allow the file system being unmounted on to do its cleanup. * If it fails it will set the errno to the approprate value * and the fileystem will not be modified. */ if (( fs_mount_loc->ops->unmount_h )( mt_entry ) != 0 ) 8003a38: 29 61 00 14 lw r1,(r11+20) return -1; 8003a3c: 34 0c ff ff mvi r12,-1 * Allow the file system being unmounted on to do its cleanup. * If it fails it will set the errno to the approprate value * and the fileystem will not be modified. */ if (( fs_mount_loc->ops->unmount_h )( mt_entry ) != 0 ) 8003a40: 28 22 00 28 lw r2,(r1+40) 8003a44: b9 60 08 00 mv r1,r11 8003a48: d8 40 00 00 call r2 8003a4c: b8 20 68 00 mv r13,r1 8003a50: 5c 20 00 1e bne r1,r0,8003ac8 <== NEVER TAKEN * NOTE: Fatal error is called in a case which should never happen * This was response was questionable but the best we could * come up with. */ if ((fs_root_loc->ops->fsunmount_me_h )( mt_entry ) != 0){ 8003a54: 29 61 00 28 lw r1,(r11+40) 8003a58: 28 22 00 2c lw r2,(r1+44) 8003a5c: b9 60 08 00 mv r1,r11 8003a60: d8 40 00 00 call r2 8003a64: 44 2d 00 08 be r1,r13,8003a84 <== ALWAYS TAKEN if (( fs_mount_loc->ops->mount_h )( mt_entry ) != 0 ) 8003a68: 29 61 00 14 lw r1,(r11+20) <== NOT EXECUTED 8003a6c: 28 22 00 20 lw r2,(r1+32) <== NOT EXECUTED 8003a70: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8003a74: d8 40 00 00 call r2 <== NOT EXECUTED 8003a78: 44 20 00 14 be r1,r0,8003ac8 <== NOT EXECUTED rtems_fatal_error_occurred( 0 ); 8003a7c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8003a80: f8 00 02 c9 calli 80045a4 <== NOT EXECUTED rtems_status_code rtems_libio_set_private_env(void); rtems_status_code rtems_libio_share_private_env(rtems_id task_id) ; static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 8003a84: 78 0c 08 01 mvhi r12,0x801 8003a88: 39 8c 57 c4 ori r12,r12,0x57c4 8003a8c: 29 81 00 00 lw r1,(r12+0) 8003a90: 34 02 00 00 mvi r2,0 8003a94: 34 03 00 00 mvi r3,0 8003a98: f8 00 01 96 calli 80040f0 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 8003a9c: b9 60 08 00 mv r1,r11 8003aa0: f8 00 03 b3 calli 800496c <_Chain_Extract> } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 8003aa4: 29 81 00 00 lw r1,(r12+0) */ rtems_filesystem_freenode( fs_mount_loc ); free( mt_entry ); return 0; 8003aa8: 34 0c 00 00 mvi r12,0 8003aac: f8 00 01 e1 calli 8004230 /* * Free the memory node that was allocated in mount * Free the memory associated with the extracted mount table entry. */ rtems_filesystem_freenode( fs_mount_loc ); 8003ab0: 35 61 00 08 addi r1,r11,8 8003ab4: fb ff fa 2c calli 8002364 free( mt_entry ); 8003ab8: b9 60 08 00 mv r1,r11 8003abc: fb ff fa 32 calli 8002384 return 0; 8003ac0: e0 00 00 02 bi 8003ac8 * The node for the directory that the fileystem is mounted on. * The mount entry that is being refered to. */ if ( rtems_filesystem_evaluate_path( path, strlen( path ), 0x0, &loc, true ) ) return -1; 8003ac4: 34 0c ff ff mvi r12,-1 rtems_filesystem_freenode( fs_mount_loc ); free( mt_entry ); return 0; } 8003ac8: b9 80 08 00 mv r1,r12 8003acc: 2b 9d 00 04 lw ra,(sp+4) 8003ad0: 2b 8b 00 10 lw r11,(sp+16) 8003ad4: 2b 8c 00 0c lw r12,(sp+12) 8003ad8: 2b 8d 00 08 lw r13,(sp+8) 8003adc: 37 9c 00 24 addi sp,sp,36 8003ae0: c3 a0 00 00 ret =============================================================================== 08003a88 : int utime( const char *path, const struct utimbuf *times ) { 8003a88: 37 9c ff d4 addi sp,sp,-44 8003a8c: 5b 8b 00 10 sw (sp+16),r11 8003a90: 5b 8c 00 0c sw (sp+12),r12 8003a94: 5b 8d 00 08 sw (sp+8),r13 8003a98: 5b 9d 00 04 sw (sp+4),ra 8003a9c: b8 20 60 00 mv r12,r1 8003aa0: b8 40 58 00 mv r11,r2 rtems_filesystem_location_info_t temp_loc; int result; struct utimbuf now; if ( rtems_filesystem_evaluate_path( path, strlen( path ), 0x00, &temp_loc, true ) ) 8003aa4: f8 00 2a 8f calli 800e4e0 8003aa8: b8 20 10 00 mv r2,r1 8003aac: 34 03 00 00 mvi r3,0 8003ab0: b9 80 08 00 mv r1,r12 8003ab4: 37 84 00 14 addi r4,sp,20 8003ab8: 34 05 00 01 mvi r5,1 8003abc: fb ff f8 93 calli 8001d08 return -1; 8003ac0: 34 0c ff ff mvi r12,-1 { rtems_filesystem_location_info_t temp_loc; int result; struct utimbuf now; if ( rtems_filesystem_evaluate_path( path, strlen( path ), 0x00, &temp_loc, true ) ) 8003ac4: 5c 20 00 10 bne r1,r0,8003b04 return -1; if ( times == NULL ) { 8003ac8: 5d 61 00 05 bne r11,r1,8003adc <== ALWAYS TAKEN now.actime = now.modtime = time( NULL ); 8003acc: f8 00 2a e7 calli 800e668