=============================================================================== 0200ad74 : { IMFS_jnode_t *node = loc->node_access; IMFS_fs_info_t *fs_info; fs_info = loc->mt_entry->fs_info; switch( node->type ) { 200ad74: c2 02 00 00 ld [ %o0 ], %g1 ) { IMFS_jnode_t *node = loc->node_access; IMFS_fs_info_t *fs_info; fs_info = loc->mt_entry->fs_info; 200ad78: c4 02 20 10 ld [ %o0 + 0x10 ], %g2 switch( node->type ) { 200ad7c: c2 00 60 4c ld [ %g1 + 0x4c ], %g1 200ad80: 80 a0 60 07 cmp %g1, 7 200ad84: 18 80 00 0a bgu 200adac <== NEVER TAKEN 200ad88: c4 00 a0 34 ld [ %g2 + 0x34 ], %g2 200ad8c: 83 28 60 02 sll %g1, 2, %g1 200ad90: 07 00 80 2b sethi %hi(0x200ac00), %g3 200ad94: 86 10 e0 f8 or %g3, 0xf8, %g3 ! 200acf8 200ad98: c2 00 c0 01 ld [ %g3 + %g1 ], %g1 200ad9c: 81 c0 40 00 jmp %g1 200ada0: 01 00 00 00 nop case IMFS_DIRECTORY: loc->handlers = fs_info->directory_handlers; 200ada4: c2 00 a0 0c ld [ %g2 + 0xc ], %g1 200ada8: c2 22 20 08 st %g1, [ %o0 + 8 ] loc->handlers = fs_info->fifo_handlers; break; } return 0; } 200adac: 81 c3 e0 08 retl 200adb0: 90 10 20 00 clr %o0 break; case IMFS_LINEAR_FILE: loc->handlers = fs_info->memfile_handlers; break; case IMFS_MEMORY_FILE: loc->handlers = fs_info->memfile_handlers; 200adb4: c2 00 a0 08 ld [ %g2 + 8 ], %g1 200adb8: c2 22 20 08 st %g1, [ %o0 + 8 ] loc->handlers = fs_info->fifo_handlers; break; } return 0; } 200adbc: 81 c3 e0 08 retl 200adc0: 90 10 20 00 clr %o0 case IMFS_DEVICE: loc->handlers = &IMFS_device_handlers; break; case IMFS_SYM_LINK: case IMFS_HARD_LINK: loc->handlers = &IMFS_link_handlers; 200adc4: 03 00 80 6e sethi %hi(0x201b800), %g1 200adc8: 82 10 62 ec or %g1, 0x2ec, %g1 ! 201baec 200adcc: c2 22 20 08 st %g1, [ %o0 + 8 ] loc->handlers = fs_info->fifo_handlers; break; } return 0; } 200add0: 81 c3 e0 08 retl 200add4: 90 10 20 00 clr %o0 break; case IMFS_MEMORY_FILE: loc->handlers = fs_info->memfile_handlers; break; case IMFS_FIFO: loc->handlers = fs_info->fifo_handlers; 200add8: c2 00 a0 10 ld [ %g2 + 0x10 ], %g1 200addc: c2 22 20 08 st %g1, [ %o0 + 8 ] break; } return 0; } 200ade0: 81 c3 e0 08 retl 200ade4: 90 10 20 00 clr %o0 switch( node->type ) { case IMFS_DIRECTORY: loc->handlers = fs_info->directory_handlers; break; case IMFS_DEVICE: loc->handlers = &IMFS_device_handlers; 200ade8: 03 00 80 6e sethi %hi(0x201b800), %g1 200adec: 82 10 62 7c or %g1, 0x27c, %g1 ! 201ba7c 200adf0: c2 22 20 08 st %g1, [ %o0 + 8 ] loc->handlers = fs_info->fifo_handlers; break; } return 0; } 200adf4: 81 c3 e0 08 retl 200adf8: 90 10 20 00 clr %o0 =============================================================================== 0200ab84 : IMFS_jnode_types_t type, const char *name, mode_t mode, const IMFS_types_union *info ) { 200ab84: 9d e3 bf a0 save %sp, -96, %sp 200ab88: 82 10 00 18 mov %i0, %g1 IMFS_fs_info_t *fs_info; /* * MUST have a parent node to call this routine. */ if ( parent_loc == NULL ) 200ab8c: 80 a0 60 00 cmp %g1, 0 200ab90: 02 80 00 2b be 200ac3c <== NEVER TAKEN 200ab94: b0 10 20 00 clr %i0 return NULL; parent = parent_loc->node_access; fs_info = parent_loc->mt_entry->fs_info; 200ab98: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 * MUST have a parent node to call this routine. */ if ( parent_loc == NULL ) return NULL; parent = parent_loc->node_access; 200ab9c: e0 00 40 00 ld [ %g1 ], %l0 fs_info = parent_loc->mt_entry->fs_info; /* * Reject creation of FIFOs if support is disabled. */ if ( type == IMFS_FIFO && 200aba0: 80 a6 60 07 cmp %i1, 7 200aba4: 02 80 00 28 be 200ac44 200aba8: fa 00 a0 34 ld [ %g2 + 0x34 ], %i5 return NULL; /* * Allocate filesystem node and fill in basic information */ node = IMFS_allocate_node( type, name, mode & ~rtems_filesystem_umask ); 200abac: 03 00 80 73 sethi %hi(0x201cc00), %g1 200abb0: c2 00 61 f0 ld [ %g1 + 0x1f0 ], %g1 ! 201cdf0 200abb4: 90 10 00 19 mov %i1, %o0 200abb8: d4 00 60 2c ld [ %g1 + 0x2c ], %o2 200abbc: 92 10 00 1a mov %i2, %o1 200abc0: 7f ff ff d6 call 200ab18 200abc4: 94 2e c0 0a andn %i3, %o2, %o2 if ( !node ) 200abc8: b0 92 20 00 orcc %o0, 0, %i0 200abcc: 02 80 00 1c be 200ac3c 200abd0: 80 a6 60 01 cmp %i1, 1 return NULL; /* * Set the type specific information */ if ( type == IMFS_DIRECTORY ) { 200abd4: 02 80 00 24 be 200ac64 200abd8: 80 a6 60 03 cmp %i1, 3 rtems_chain_initialize_empty(&node->info.directory.Entries); } else if ( type == IMFS_HARD_LINK ) { 200abdc: 02 80 00 0e be 200ac14 200abe0: 80 a6 60 04 cmp %i1, 4 node->info.hard_link.link_node = info->hard_link.link_node; } else if ( type == IMFS_SYM_LINK ) { 200abe4: 02 80 00 0c be 200ac14 200abe8: 80 a6 60 02 cmp %i1, 2 node->info.sym_link.name = info->sym_link.name; } else if ( type == IMFS_DEVICE ) { 200abec: 02 80 00 28 be 200ac8c 200abf0: 80 a6 60 06 cmp %i1, 6 node->info.device.major = info->device.major; node->info.device.minor = info->device.minor; } else if ( type == IMFS_LINEAR_FILE ) { 200abf4: 02 80 00 22 be 200ac7c 200abf8: 80 a6 60 05 cmp %i1, 5 node->info.linearfile.size = 0; node->info.linearfile.direct = 0; } else if ( type == IMFS_MEMORY_FILE ) { 200abfc: 02 80 00 29 be 200aca0 200ac00: 80 a6 60 07 cmp %i1, 7 node->info.file.size = 0; node->info.file.indirect = 0; node->info.file.doubly_indirect = 0; node->info.file.triply_indirect = 0; } else if ( type == IMFS_FIFO ) { 200ac04: 22 80 00 06 be,a 200ac1c <== ALWAYS TAKEN 200ac08: c0 26 20 50 clr [ %i0 + 0x50 ] /* * This node MUST have a parent, so put it in that directory list. */ node->Parent = parent; node->st_ino = ++fs_info->ino_count; 200ac0c: 10 80 00 05 b 200ac20 <== NOT EXECUTED 200ac10: c2 07 60 04 ld [ %i5 + 4 ], %g1 <== NOT EXECUTED if ( type == IMFS_DIRECTORY ) { rtems_chain_initialize_empty(&node->info.directory.Entries); } else if ( type == IMFS_HARD_LINK ) { node->info.hard_link.link_node = info->hard_link.link_node; } else if ( type == IMFS_SYM_LINK ) { node->info.sym_link.name = info->sym_link.name; 200ac14: c2 07 00 00 ld [ %i4 ], %g1 200ac18: c2 26 20 50 st %g1, [ %i0 + 0x50 ] /* * This node MUST have a parent, so put it in that directory list. */ node->Parent = parent; node->st_ino = ++fs_info->ino_count; 200ac1c: c2 07 60 04 ld [ %i5 + 4 ], %g1 } /* * This node MUST have a parent, so put it in that directory list. */ node->Parent = parent; 200ac20: e0 26 20 08 st %l0, [ %i0 + 8 ] node->st_ino = ++fs_info->ino_count; 200ac24: 82 00 60 01 inc %g1 200ac28: c2 27 60 04 st %g1, [ %i5 + 4 ] 200ac2c: c2 26 20 38 st %g1, [ %i0 + 0x38 ] 200ac30: 90 04 20 50 add %l0, 0x50, %o0 200ac34: 7f ff f1 d9 call 2007398 <_Chain_Append> 200ac38: 92 10 00 18 mov %i0, %o1 rtems_chain_append( &parent->info.directory.Entries, &node->Node ); return node; } 200ac3c: 81 c7 e0 08 ret 200ac40: 81 e8 00 00 restore fs_info = parent_loc->mt_entry->fs_info; /* * Reject creation of FIFOs if support is disabled. */ if ( type == IMFS_FIFO && 200ac44: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 200ac48: 03 00 80 6e sethi %hi(0x201b800), %g1 200ac4c: 82 10 61 f4 or %g1, 0x1f4, %g1 ! 201b9f4 200ac50: 80 a0 80 01 cmp %g2, %g1 200ac54: 12 bf ff d7 bne 200abb0 200ac58: 03 00 80 73 sethi %hi(0x201cc00), %g1 node->st_ino = ++fs_info->ino_count; rtems_chain_append( &parent->info.directory.Entries, &node->Node ); return node; } 200ac5c: 81 c7 e0 08 ret 200ac60: 81 e8 00 00 restore RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 200ac64: 82 06 20 50 add %i0, 0x50, %g1 200ac68: 84 06 20 54 add %i0, 0x54, %g2 head->next = tail; head->previous = NULL; 200ac6c: c0 26 20 54 clr [ %i0 + 0x54 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 200ac70: c4 26 20 50 st %g2, [ %i0 + 0x50 ] head->previous = NULL; tail->previous = head; 200ac74: 10 bf ff ea b 200ac1c 200ac78: c2 26 20 58 st %g1, [ %i0 + 0x58 ] node->info.sym_link.name = info->sym_link.name; } else if ( type == IMFS_DEVICE ) { node->info.device.major = info->device.major; node->info.device.minor = info->device.minor; } else if ( type == IMFS_LINEAR_FILE ) { node->info.linearfile.size = 0; 200ac7c: c0 26 20 50 clr [ %i0 + 0x50 ] 200ac80: c0 26 20 54 clr [ %i0 + 0x54 ] node->info.linearfile.direct = 0; 200ac84: 10 bf ff e6 b 200ac1c 200ac88: c0 26 20 58 clr [ %i0 + 0x58 ] } else if ( type == IMFS_HARD_LINK ) { node->info.hard_link.link_node = info->hard_link.link_node; } else if ( type == IMFS_SYM_LINK ) { node->info.sym_link.name = info->sym_link.name; } else if ( type == IMFS_DEVICE ) { node->info.device.major = info->device.major; 200ac8c: c4 07 00 00 ld [ %i4 ], %g2 node->info.device.minor = info->device.minor; 200ac90: c2 07 20 04 ld [ %i4 + 4 ], %g1 } else if ( type == IMFS_HARD_LINK ) { node->info.hard_link.link_node = info->hard_link.link_node; } else if ( type == IMFS_SYM_LINK ) { node->info.sym_link.name = info->sym_link.name; } else if ( type == IMFS_DEVICE ) { node->info.device.major = info->device.major; 200ac94: c4 26 20 50 st %g2, [ %i0 + 0x50 ] node->info.device.minor = info->device.minor; 200ac98: 10 bf ff e1 b 200ac1c 200ac9c: c2 26 20 54 st %g1, [ %i0 + 0x54 ] } else if ( type == IMFS_LINEAR_FILE ) { node->info.linearfile.size = 0; node->info.linearfile.direct = 0; } else if ( type == IMFS_MEMORY_FILE ) { node->info.file.size = 0; 200aca0: c0 26 20 50 clr [ %i0 + 0x50 ] 200aca4: c0 26 20 54 clr [ %i0 + 0x54 ] node->info.file.indirect = 0; 200aca8: c0 26 20 58 clr [ %i0 + 0x58 ] node->info.file.doubly_indirect = 0; 200acac: c0 26 20 5c clr [ %i0 + 0x5c ] node->info.file.triply_indirect = 0; 200acb0: 10 bf ff db b 200ac1c 200acb4: c0 26 20 60 clr [ %i0 + 0x60 ] =============================================================================== 02005110 : */ void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { 2005110: 9d e3 bf a0 save %sp, -96, %sp */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 2005114: fa 06 20 50 ld [ %i0 + 0x50 ], %i5 RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Tail(the_chain)); 2005118: b8 06 20 54 add %i0, 0x54, %i4 IMFS_assert( level >= 0 ); IMFS_assert( the_directory->type == IMFS_DIRECTORY ); the_chain = &the_directory->info.directory.Entries; for ( the_node = rtems_chain_first( the_chain ); 200511c: 80 a7 40 1c cmp %i5, %i4 2005120: 02 80 00 1e be 2005198 2005124: 31 00 80 94 sethi %hi(0x2025000), %i0 2005128: 21 00 80 9c sethi %hi(0x2027000), %l0 the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); 200512c: b0 16 22 a0 or %i0, 0x2a0, %i0 IMFS_print_jnode( the_jnode ); if ( the_jnode->type == IMFS_DIRECTORY ) IMFS_dump_directory( the_jnode, level + 1 ); 2005130: a2 06 60 01 add %i1, 1, %l1 !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) 2005134: 80 a6 60 00 cmp %i1, 0 2005138: 06 80 00 0e bl 2005170 <== NEVER TAKEN 200513c: 01 00 00 00 nop 2005140: b6 10 20 00 clr %i3 ! 0 2005144: b4 14 22 28 or %l0, 0x228, %i2 fprintf(stdout, "...." ); 2005148: c2 06 80 00 ld [ %i2 ], %g1 200514c: 90 10 00 18 mov %i0, %o0 2005150: d6 00 60 08 ld [ %g1 + 8 ], %o3 2005154: 92 10 20 01 mov 1, %o1 2005158: 40 00 3f dd call 20150cc 200515c: 94 10 20 04 mov 4, %o2 !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) 2005160: b6 06 e0 01 inc %i3 2005164: 80 a6 40 1b cmp %i1, %i3 2005168: 36 bf ff f9 bge,a 200514c 200516c: c2 06 80 00 ld [ %i2 ], %g1 fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); 2005170: 7f ff ff a2 call 2004ff8 2005174: 90 10 00 1d mov %i5, %o0 if ( the_jnode->type == IMFS_DIRECTORY ) 2005178: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 200517c: 80 a0 60 01 cmp %g1, 1 2005180: 22 80 00 08 be,a 20051a0 2005184: 90 10 00 1d mov %i5, %o0 the_chain = &the_directory->info.directory.Entries; for ( the_node = rtems_chain_first( the_chain ); !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { 2005188: fa 07 40 00 ld [ %i5 ], %i5 IMFS_assert( level >= 0 ); IMFS_assert( the_directory->type == IMFS_DIRECTORY ); the_chain = &the_directory->info.directory.Entries; for ( the_node = rtems_chain_first( the_chain ); 200518c: 80 a7 40 1c cmp %i5, %i4 2005190: 12 bf ff ea bne 2005138 2005194: 80 a6 60 00 cmp %i1, 0 2005198: 81 c7 e0 08 ret 200519c: 81 e8 00 00 restore for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( the_jnode->type == IMFS_DIRECTORY ) IMFS_dump_directory( the_jnode, level + 1 ); 20051a0: 7f ff ff dc call 2005110 20051a4: 92 10 00 11 mov %l1, %o1 the_chain = &the_directory->info.directory.Entries; for ( the_node = rtems_chain_first( the_chain ); !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { 20051a8: 10 bf ff f9 b 200518c 20051ac: fa 07 40 00 ld [ %i5 ], %i5 =============================================================================== 0200aefc : const char *pathname, /* IN */ size_t pathnamelen, /* IN */ int flags, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { 200aefc: 9d e3 bf 70 save %sp, -144, %sp int i = 0; 200af00: c0 27 bf f8 clr [ %fp + -8 ] const char *pathname, /* IN */ size_t pathnamelen, /* IN */ int flags, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { 200af04: f2 27 a0 48 st %i1, [ %fp + 0x48 ] 200af08: 92 10 00 19 mov %i1, %o1 IMFS_token_types type = IMFS_CURRENT_DIR; char token[ IMFS_NAME_MAX + 1 ]; IMFS_jnode_t *node; int result; if ( !rtems_libio_is_valid_perms( flags ) ) { 200af0c: 80 8e bf f8 btst -8, %i2 200af10: 12 80 00 c1 bne 200b214 <== NEVER TAKEN 200af14: ba 10 00 18 mov %i0, %i5 /* * This was filled in by the caller and is valid in the * mount table. */ node = pathloc->node_access; 200af18: f8 06 c0 00 ld [ %i3 ], %i4 200af1c: 90 10 20 00 clr %o0 case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 200af20: 21 00 80 73 sethi %hi(0x201cc00), %l0 * 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 ); 200af24: 90 07 40 08 add %i5, %o0, %o0 200af28: 94 07 bf d0 add %fp, -48, %o2 200af2c: 40 00 02 93 call 200b978 200af30: 96 07 bf fc add %fp, -4, %o3 pathnamelen -= len; 200af34: c2 07 bf fc ld [ %fp + -4 ], %g1 200af38: d2 07 a0 48 ld [ %fp + 0x48 ], %o1 i += len; 200af3c: c4 07 bf f8 ld [ %fp + -8 ], %g2 * 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 ); 200af40: b2 10 00 08 mov %o0, %i1 pathnamelen -= len; i += len; if ( !pathloc->node_access ) 200af44: d0 06 c0 00 ld [ %i3 ], %o0 */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { type = IMFS_get_token( &pathname[i], pathnamelen, token, &len ); pathnamelen -= len; 200af48: 92 22 40 01 sub %o1, %g1, %o1 i += len; 200af4c: 82 00 80 01 add %g2, %g1, %g1 */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { type = IMFS_get_token( &pathname[i], pathnamelen, token, &len ); pathnamelen -= len; 200af50: d2 27 a0 48 st %o1, [ %fp + 0x48 ] i += len; if ( !pathloc->node_access ) 200af54: 80 a2 20 00 cmp %o0, 0 200af58: 02 80 00 99 be 200b1bc <== NEVER TAKEN 200af5c: c2 27 bf f8 st %g1, [ %fp + -8 ] rtems_set_errno_and_return_minus_one( ENOENT ); /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) 200af60: 80 a6 60 00 cmp %i1, 0 200af64: 32 80 00 15 bne,a 200afb8 200af68: c2 07 20 4c ld [ %i4 + 0x4c ], %g1 * 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 ) { 200af6c: c2 02 20 4c ld [ %o0 + 0x4c ], %g1 200af70: 80 a0 60 01 cmp %g1, 1 200af74: 22 80 00 98 be,a 200b1d4 200af78: c6 02 20 5c ld [ %o0 + 0x5c ], %g3 flags, pathloc ); } else { result = IMFS_Set_handlers( pathloc ); } } else { result = IMFS_Set_handlers( pathloc ); 200af7c: 7f ff ff 7e call 200ad74 200af80: 90 10 00 1b mov %i3, %o0 /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( pathloc, flags ) ) 200af84: 92 10 00 1a mov %i2, %o1 flags, pathloc ); } else { result = IMFS_Set_handlers( pathloc ); } } else { result = IMFS_Set_handlers( pathloc ); 200af88: b0 10 00 08 mov %o0, %i0 /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( pathloc, flags ) ) 200af8c: 7f ff ff 9c call 200adfc 200af90: 90 10 00 1b mov %i3, %o0 200af94: 80 a2 20 00 cmp %o0, 0 200af98: 12 80 00 c6 bne 200b2b0 200af9c: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EACCES ); 200afa0: 40 00 12 63 call 200f92c <__errno> 200afa4: b0 10 3f ff mov -1, %i0 ! ffffffff 200afa8: 82 10 20 0d mov 0xd, %g1 200afac: c2 22 00 00 st %g1, [ %o0 ] return result; } 200afb0: 81 c7 e0 08 ret 200afb4: 81 e8 00 00 restore /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) if ( node->type == IMFS_DIRECTORY ) 200afb8: 80 a0 60 01 cmp %g1, 1 200afbc: 22 80 00 53 be,a 200b108 200afc0: 90 10 00 1b mov %i3, %o0 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; switch( type ) { 200afc4: 80 a6 60 03 cmp %i1, 3 200afc8: 02 80 00 0b be 200aff4 200afcc: 80 a6 60 04 cmp %i1, 4 200afd0: 02 80 00 30 be 200b090 200afd4: 80 a6 60 02 cmp %i1, 2 200afd8: 02 80 00 1c be 200b048 200afdc: 80 a6 60 04 cmp %i1, 4 /* * Evaluate all tokens until we are done or an error occurs. */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { 200afe0: 02 bf ff e3 be 200af6c <== NEVER TAKEN 200afe4: d2 07 a0 48 ld [ %fp + 0x48 ], %o1 200afe8: b8 10 00 08 mov %o0, %i4 200afec: 10 bf ff ce b 200af24 200aff0: d0 07 bf f8 ld [ %fp + -8 ], %o0 case IMFS_NAME: /* * If we are at a link follow it. */ if ( node->type == IMFS_HARD_LINK ) { 200aff4: c2 02 20 4c ld [ %o0 + 0x4c ], %g1 200aff8: 80 a0 60 03 cmp %g1, 3 200affc: 02 80 00 4d be 200b130 200b000: 80 a0 60 04 cmp %g1, 4 * It would be a design error if we evaluated the link and * was broken. */ IMFS_assert( node ); } else if ( node->type == IMFS_SYM_LINK ) { 200b004: 22 80 00 66 be,a 200b19c 200b008: 90 10 00 1b mov %i3, %o0 } /* * Only a directory can be decended into. */ if ( node->type != IMFS_DIRECTORY ) 200b00c: 80 a0 60 01 cmp %g1, 1 200b010: 12 80 00 87 bne 200b22c 200b014: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOTDIR ); /* * Find the token name in the current node. */ node = IMFS_find_match_in_dir( node, token ); 200b018: 40 00 02 35 call 200b8ec 200b01c: 92 07 bf d0 add %fp, -48, %o1 if ( !node ) 200b020: b8 92 20 00 orcc %o0, 0, %i4 200b024: 02 80 00 66 be 200b1bc 200b028: 01 00 00 00 nop * file system and not the IMFS. For example the IMFS length is * limited. If the token is a parent directory move back up otherwise * set loc to the new fs root node and let them finish evaluating the * path. */ if (( node->type == IMFS_DIRECTORY ) && ( node->info.directory.mt_fs != NULL )) { 200b02c: c2 07 20 4c ld [ %i4 + 0x4c ], %g1 200b030: 80 a0 60 01 cmp %g1, 1 200b034: 02 80 00 1d be 200b0a8 200b038: d2 07 a0 48 ld [ %fp + 0x48 ], %o1 } /* * Set the node access to the point we have found. */ pathloc->node_access = node; 200b03c: f8 26 c0 00 st %i4, [ %i3 ] /* * Evaluate all tokens until we are done or an error occurs. */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { 200b040: 10 bf ff b9 b 200af24 200b044: d0 07 bf f8 ld [ %fp + -8 ], %o0 case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 200b048: c2 04 21 f0 ld [ %l0 + 0x1f0 ], %g1 200b04c: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 200b050: 80 a0 40 08 cmp %g1, %o0 200b054: 02 80 00 34 be 200b124 200b058: b8 10 00 08 mov %o0, %i4 /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access) { 200b05c: c6 06 e0 10 ld [ %i3 + 0x10 ], %g3 /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == 200b060: c2 00 e0 1c ld [ %g3 + 0x1c ], %g1 200b064: 80 a0 40 08 cmp %g1, %o0 200b068: 22 80 00 38 be,a 200b148 200b06c: c2 00 e0 08 ld [ %g3 + 8 ], %g1 pathnamelen+len, flags,pathloc); } } else { if ( !node->Parent ) 200b070: f8 02 20 08 ld [ %o0 + 8 ], %i4 200b074: 80 a7 20 00 cmp %i4, 0 200b078: 02 80 00 73 be 200b244 200b07c: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOENT ); node = node->Parent; pathloc->node_access = node; 200b080: f8 26 c0 00 st %i4, [ %i3 ] 200b084: d2 07 a0 48 ld [ %fp + 0x48 ], %o1 /* * Evaluate all tokens until we are done or an error occurs. */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { 200b088: 10 bf ff a7 b 200af24 200b08c: d0 07 bf f8 ld [ %fp + -8 ], %o0 case IMFS_NO_MORE_PATH: case IMFS_CURRENT_DIR: break; case IMFS_INVALID_TOKEN: rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); 200b090: 40 00 12 27 call 200f92c <__errno> 200b094: b0 10 3f ff mov -1, %i0 200b098: 82 10 20 5b mov 0x5b, %g1 200b09c: c2 22 00 00 st %g1, [ %o0 ] 200b0a0: 81 c7 e0 08 ret 200b0a4: 81 e8 00 00 restore * file system and not the IMFS. For example the IMFS length is * limited. If the token is a parent directory move back up otherwise * set loc to the new fs root node and let them finish evaluating the * path. */ if (( node->type == IMFS_DIRECTORY ) && ( node->info.directory.mt_fs != NULL )) { 200b0a8: c2 07 20 5c ld [ %i4 + 0x5c ], %g1 200b0ac: 80 a0 60 00 cmp %g1, 0 200b0b0: 22 bf ff e4 be,a 200b040 200b0b4: f8 26 c0 00 st %i4, [ %i3 ] IMFS_skip_separator( pathname, &pathnamelen, &i); 200b0b8: 90 10 00 1d mov %i5, %o0 200b0bc: 92 07 a0 48 add %fp, 0x48, %o1 200b0c0: 7f ff ff 16 call 200ad18 200b0c4: 94 07 bf f8 add %fp, -8, %o2 if ((pathname[i] != '.') || (pathname[i + 1] != '.')) { 200b0c8: c2 07 bf f8 ld [ %fp + -8 ], %g1 200b0cc: c4 4f 40 01 ldsb [ %i5 + %g1 ], %g2 200b0d0: 80 a0 a0 2e cmp %g2, 0x2e 200b0d4: 12 80 00 61 bne 200b258 200b0d8: 90 07 40 01 add %i5, %g1, %o0 200b0dc: c4 4a 20 01 ldsb [ %o0 + 1 ], %g2 200b0e0: 80 a0 a0 2e cmp %g2, 0x2e 200b0e4: 12 80 00 5d bne 200b258 200b0e8: d2 07 a0 48 ld [ %fp + 0x48 ], %o1 pathnamelen, flags, pathloc ); } i += 2; pathnamelen -= 2; node = node->Parent; 200b0ec: f8 07 20 08 ld [ %i4 + 8 ], %i4 *pathloc = node->info.directory.mt_fs->mt_fs_root; return (*pathloc->ops->evalpath_h)( &pathname[i], pathnamelen, flags, pathloc ); } i += 2; 200b0f0: 82 00 60 02 add %g1, 2, %g1 pathnamelen -= 2; 200b0f4: 92 02 7f fe add %o1, -2, %o1 *pathloc = node->info.directory.mt_fs->mt_fs_root; return (*pathloc->ops->evalpath_h)( &pathname[i], pathnamelen, flags, pathloc ); } i += 2; 200b0f8: c2 27 bf f8 st %g1, [ %fp + -8 ] pathnamelen -= 2; 200b0fc: d2 27 a0 48 st %o1, [ %fp + 0x48 ] } /* * Set the node access to the point we have found. */ pathloc->node_access = node; 200b100: 10 bf ff d0 b 200b040 200b104: f8 26 c0 00 st %i4, [ %i3 ] /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) if ( node->type == IMFS_DIRECTORY ) if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 200b108: 7f ff ff 3d call 200adfc 200b10c: 92 10 20 01 mov 1, %o1 200b110: 80 a2 20 00 cmp %o0, 0 200b114: 02 80 00 63 be 200b2a0 200b118: 01 00 00 00 nop 200b11c: 10 bf ff aa b 200afc4 200b120: d0 06 c0 00 ld [ %i3 ], %o0 200b124: d2 07 a0 48 ld [ %fp + 0x48 ], %o1 /* * Evaluate all tokens until we are done or an error occurs. */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { 200b128: 10 bf ff 7f b 200af24 200b12c: d0 07 bf f8 ld [ %fp + -8 ], %o0 case IMFS_NAME: /* * If we are at a link follow it. */ if ( node->type == IMFS_HARD_LINK ) { IMFS_evaluate_hard_link( pathloc, 0 ); 200b130: 90 10 00 1b mov %i3, %o0 200b134: 7f ff ff 5d call 200aea8 200b138: 92 10 20 00 clr %o1 node = pathloc->node_access; 200b13c: d0 06 c0 00 ld [ %i3 ], %o0 200b140: 10 bf ff b3 b 200b00c 200b144: c2 02 20 4c ld [ %o0 + 0x4c ], %g1 if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; /* Throw out the .. in this case */ } else { *pathloc = pathloc->mt_entry->mt_point_node; return (*pathloc->ops->evalpath_h)(&(pathname[i-len]), 200b148: c4 07 bf fc ld [ %fp + -4 ], %g2 */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; /* Throw out the .. in this case */ } else { *pathloc = pathloc->mt_entry->mt_point_node; 200b14c: c2 26 c0 00 st %g1, [ %i3 ] 200b150: c2 00 e0 0c ld [ %g3 + 0xc ], %g1 return (*pathloc->ops->evalpath_h)(&(pathname[i-len]), 200b154: d0 07 bf f8 ld [ %fp + -8 ], %o0 */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; /* Throw out the .. in this case */ } else { *pathloc = pathloc->mt_entry->mt_point_node; 200b158: c2 26 e0 04 st %g1, [ %i3 + 4 ] 200b15c: c2 00 e0 10 ld [ %g3 + 0x10 ], %g1 return (*pathloc->ops->evalpath_h)(&(pathname[i-len]), 200b160: 90 22 00 02 sub %o0, %g2, %o0 */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; /* Throw out the .. in this case */ } else { *pathloc = pathloc->mt_entry->mt_point_node; 200b164: c2 26 e0 08 st %g1, [ %i3 + 8 ] 200b168: c2 00 e0 14 ld [ %g3 + 0x14 ], %g1 200b16c: c2 26 e0 0c st %g1, [ %i3 + 0xc ] return (*pathloc->ops->evalpath_h)(&(pathname[i-len]), 200b170: c2 00 40 00 ld [ %g1 ], %g1 */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; /* Throw out the .. in this case */ } else { *pathloc = pathloc->mt_entry->mt_point_node; 200b174: c6 00 e0 18 ld [ %g3 + 0x18 ], %g3 */ if ( node->type == IMFS_DIRECTORY ) { if ( node->info.directory.mt_fs != NULL ) { *pathloc = node->info.directory.mt_fs->mt_fs_root; return (*pathloc->ops->evalpath_h)( &pathname[i-len], 200b178: d2 07 a0 48 ld [ %fp + 0x48 ], %o1 200b17c: 90 07 40 08 add %i5, %o0, %o0 * NOTE: The behavior of stat() on a mount point appears to be questionable. */ if ( node->type == IMFS_DIRECTORY ) { if ( node->info.directory.mt_fs != NULL ) { *pathloc = node->info.directory.mt_fs->mt_fs_root; 200b180: c6 26 e0 10 st %g3, [ %i3 + 0x10 ] return (*pathloc->ops->evalpath_h)( &pathname[i-len], 200b184: 92 00 80 09 add %g2, %o1, %o1 200b188: 94 10 00 1a mov %i2, %o2 200b18c: 9f c0 40 00 call %g1 200b190: 96 10 00 1b mov %i3, %o3 200b194: 81 c7 e0 08 ret 200b198: 91 e8 00 08 restore %g0, %o0, %o0 * was broken. */ IMFS_assert( node ); } else if ( node->type == IMFS_SYM_LINK ) { result = IMFS_evaluate_sym_link( pathloc, 0 ); 200b19c: 40 00 00 47 call 200b2b8 200b1a0: 92 10 20 00 clr %o1 200b1a4: b0 10 00 08 mov %o0, %i0 /* * In contrast to a hard link, it is possible to have a broken * symbolic link. */ node = pathloc->node_access; if ( result == -1 ) 200b1a8: 80 a6 3f ff cmp %i0, -1 200b1ac: 02 bf ff 81 be 200afb0 <== NEVER TAKEN 200b1b0: d0 06 c0 00 ld [ %i3 ], %o0 200b1b4: 10 bf ff 96 b 200b00c 200b1b8: c2 02 20 4c ld [ %o0 + 0x4c ], %g1 /* * Find the token name in the current node. */ node = IMFS_find_match_in_dir( node, token ); if ( !node ) rtems_set_errno_and_return_minus_one( ENOENT ); 200b1bc: 40 00 11 dc call 200f92c <__errno> 200b1c0: b0 10 3f ff mov -1, %i0 200b1c4: 82 10 20 02 mov 2, %g1 200b1c8: c2 22 00 00 st %g1, [ %o0 ] 200b1cc: 81 c7 e0 08 ret 200b1d0: 81 e8 00 00 restore * * NOTE: The behavior of stat() on a mount point appears to be questionable. */ if ( node->type == IMFS_DIRECTORY ) { if ( node->info.directory.mt_fs != NULL ) { 200b1d4: 80 a0 e0 00 cmp %g3, 0 200b1d8: 02 bf ff 69 be 200af7c <== ALWAYS TAKEN 200b1dc: c4 07 bf fc ld [ %fp + -4 ], %g2 *pathloc = node->info.directory.mt_fs->mt_fs_root; 200b1e0: c2 00 e0 1c ld [ %g3 + 0x1c ], %g1 <== NOT EXECUTED 200b1e4: c2 26 c0 00 st %g1, [ %i3 ] <== NOT EXECUTED 200b1e8: c2 00 e0 20 ld [ %g3 + 0x20 ], %g1 <== NOT EXECUTED return (*pathloc->ops->evalpath_h)( &pathname[i-len], 200b1ec: d0 07 bf f8 ld [ %fp + -8 ], %o0 <== NOT EXECUTED * NOTE: The behavior of stat() on a mount point appears to be questionable. */ if ( node->type == IMFS_DIRECTORY ) { if ( node->info.directory.mt_fs != NULL ) { *pathloc = node->info.directory.mt_fs->mt_fs_root; 200b1f0: c2 26 e0 04 st %g1, [ %i3 + 4 ] <== NOT EXECUTED 200b1f4: c2 00 e0 24 ld [ %g3 + 0x24 ], %g1 <== NOT EXECUTED return (*pathloc->ops->evalpath_h)( &pathname[i-len], 200b1f8: 90 22 00 02 sub %o0, %g2, %o0 <== NOT EXECUTED * NOTE: The behavior of stat() on a mount point appears to be questionable. */ if ( node->type == IMFS_DIRECTORY ) { if ( node->info.directory.mt_fs != NULL ) { *pathloc = node->info.directory.mt_fs->mt_fs_root; 200b1fc: c2 26 e0 08 st %g1, [ %i3 + 8 ] <== NOT EXECUTED 200b200: c2 00 e0 28 ld [ %g3 + 0x28 ], %g1 <== NOT EXECUTED 200b204: c2 26 e0 0c st %g1, [ %i3 + 0xc ] <== NOT EXECUTED return (*pathloc->ops->evalpath_h)( &pathname[i-len], 200b208: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED * NOTE: The behavior of stat() on a mount point appears to be questionable. */ if ( node->type == IMFS_DIRECTORY ) { if ( node->info.directory.mt_fs != NULL ) { *pathloc = node->info.directory.mt_fs->mt_fs_root; 200b20c: 10 bf ff db b 200b178 <== NOT EXECUTED 200b210: c6 00 e0 2c ld [ %g3 + 0x2c ], %g3 <== NOT EXECUTED char token[ IMFS_NAME_MAX + 1 ]; IMFS_jnode_t *node; int result; if ( !rtems_libio_is_valid_perms( flags ) ) { rtems_set_errno_and_return_minus_one( EIO ); 200b214: 40 00 11 c6 call 200f92c <__errno> <== NOT EXECUTED 200b218: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 200b21c: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 200b220: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 200b224: 81 c7 e0 08 ret <== NOT EXECUTED 200b228: 81 e8 00 00 restore <== NOT EXECUTED /* * Only a directory can be decended into. */ if ( node->type != IMFS_DIRECTORY ) rtems_set_errno_and_return_minus_one( ENOTDIR ); 200b22c: 40 00 11 c0 call 200f92c <__errno> 200b230: b0 10 3f ff mov -1, %i0 200b234: 82 10 20 14 mov 0x14, %g1 200b238: c2 22 00 00 st %g1, [ %o0 ] 200b23c: 81 c7 e0 08 ret 200b240: 81 e8 00 00 restore flags,pathloc); } } else { if ( !node->Parent ) rtems_set_errno_and_return_minus_one( ENOENT ); 200b244: 40 00 11 ba call 200f92c <__errno> 200b248: b0 10 3f ff mov -1, %i0 200b24c: f2 22 00 00 st %i1, [ %o0 ] 200b250: 81 c7 e0 08 ret 200b254: 81 e8 00 00 restore * path. */ if (( node->type == IMFS_DIRECTORY ) && ( node->info.directory.mt_fs != NULL )) { IMFS_skip_separator( pathname, &pathnamelen, &i); if ((pathname[i] != '.') || (pathname[i + 1] != '.')) { *pathloc = node->info.directory.mt_fs->mt_fs_root; 200b258: c4 07 20 5c ld [ %i4 + 0x5c ], %g2 return (*pathloc->ops->evalpath_h)( &pathname[i], 200b25c: d2 07 a0 48 ld [ %fp + 0x48 ], %o1 * path. */ if (( node->type == IMFS_DIRECTORY ) && ( node->info.directory.mt_fs != NULL )) { IMFS_skip_separator( pathname, &pathnamelen, &i); if ((pathname[i] != '.') || (pathname[i + 1] != '.')) { *pathloc = node->info.directory.mt_fs->mt_fs_root; 200b260: c2 00 a0 1c ld [ %g2 + 0x1c ], %g1 return (*pathloc->ops->evalpath_h)( &pathname[i], 200b264: 94 10 00 1a mov %i2, %o2 * path. */ if (( node->type == IMFS_DIRECTORY ) && ( node->info.directory.mt_fs != NULL )) { IMFS_skip_separator( pathname, &pathnamelen, &i); if ((pathname[i] != '.') || (pathname[i + 1] != '.')) { *pathloc = node->info.directory.mt_fs->mt_fs_root; 200b268: c2 26 c0 00 st %g1, [ %i3 ] 200b26c: c2 00 a0 20 ld [ %g2 + 0x20 ], %g1 return (*pathloc->ops->evalpath_h)( &pathname[i], 200b270: 96 10 00 1b mov %i3, %o3 * path. */ if (( node->type == IMFS_DIRECTORY ) && ( node->info.directory.mt_fs != NULL )) { IMFS_skip_separator( pathname, &pathnamelen, &i); if ((pathname[i] != '.') || (pathname[i + 1] != '.')) { *pathloc = node->info.directory.mt_fs->mt_fs_root; 200b274: c2 26 e0 04 st %g1, [ %i3 + 4 ] 200b278: c2 00 a0 24 ld [ %g2 + 0x24 ], %g1 200b27c: c2 26 e0 08 st %g1, [ %i3 + 8 ] 200b280: c2 00 a0 28 ld [ %g2 + 0x28 ], %g1 200b284: c2 26 e0 0c st %g1, [ %i3 + 0xc ] return (*pathloc->ops->evalpath_h)( &pathname[i], 200b288: c2 00 40 00 ld [ %g1 ], %g1 * path. */ if (( node->type == IMFS_DIRECTORY ) && ( node->info.directory.mt_fs != NULL )) { IMFS_skip_separator( pathname, &pathnamelen, &i); if ((pathname[i] != '.') || (pathname[i + 1] != '.')) { *pathloc = node->info.directory.mt_fs->mt_fs_root; 200b28c: c4 00 a0 2c ld [ %g2 + 0x2c ], %g2 return (*pathloc->ops->evalpath_h)( &pathname[i], 200b290: 9f c0 40 00 call %g1 200b294: c4 26 e0 10 st %g2, [ %i3 + 0x10 ] 200b298: 81 c7 e0 08 ret 200b29c: 91 e8 00 08 restore %g0, %o0, %o0 * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) if ( node->type == IMFS_DIRECTORY ) if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) rtems_set_errno_and_return_minus_one( EACCES ); 200b2a0: 40 00 11 a3 call 200f92c <__errno> 200b2a4: b0 10 3f ff mov -1, %i0 200b2a8: 82 10 20 0d mov 0xd, %g1 200b2ac: c2 22 00 00 st %g1, [ %o0 ] 200b2b0: 81 c7 e0 08 ret 200b2b4: 81 e8 00 00 restore =============================================================================== 0200b424 : int IMFS_evaluate_for_make( const char *path, /* IN */ rtems_filesystem_location_info_t *pathloc, /* IN/OUT */ const char **name /* OUT */ ) { 200b424: 9d e3 bf 70 save %sp, -144, %sp /* * This was filled in by the caller and is valid in the * mount table. */ node = pathloc->node_access; 200b428: fa 06 40 00 ld [ %i1 ], %i5 const char *path, /* IN */ rtems_filesystem_location_info_t *pathloc, /* IN/OUT */ const char **name /* OUT */ ) { int i = 0; 200b42c: c0 27 bf f4 clr [ %fp + -12 ] node = pathloc->node_access; /* * Get the path length. */ pathlen = strlen( path ); 200b430: 40 00 16 ce call 2010f68 200b434: 90 10 00 18 mov %i0, %o0 int IMFS_evaluate_for_make( const char *path, /* IN */ rtems_filesystem_location_info_t *pathloc, /* IN/OUT */ const char **name /* OUT */ ) { 200b438: b8 10 00 18 mov %i0, %i4 node = pathloc->node_access; /* * Get the path length. */ pathlen = strlen( path ); 200b43c: 92 10 00 08 mov %o0, %o1 200b440: 82 10 20 00 clr %g1 200b444: d0 27 bf fc st %o0, [ %fp + -4 ] case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 200b448: 37 00 80 73 sethi %hi(0x201cc00), %i3 * Evaluate all tokens until we are done or an error occurs. */ while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); 200b44c: 90 07 00 01 add %i4, %g1, %o0 200b450: 94 07 bf d0 add %fp, -48, %o2 200b454: 40 00 01 49 call 200b978 200b458: 96 07 bf f8 add %fp, -8, %o3 pathlen -= len; 200b45c: c2 07 bf f8 ld [ %fp + -8 ], %g1 200b460: c4 07 bf fc ld [ %fp + -4 ], %g2 i += len; 200b464: c6 07 bf f4 ld [ %fp + -12 ], %g3 * Evaluate all tokens until we are done or an error occurs. */ while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); 200b468: a0 10 00 08 mov %o0, %l0 pathlen -= len; i += len; if ( !pathloc->node_access ) 200b46c: d0 06 40 00 ld [ %i1 ], %o0 */ while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); pathlen -= len; 200b470: 84 20 80 01 sub %g2, %g1, %g2 i += len; 200b474: 82 00 c0 01 add %g3, %g1, %g1 */ while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); pathlen -= len; 200b478: c4 27 bf fc st %g2, [ %fp + -4 ] i += len; if ( !pathloc->node_access ) 200b47c: 80 a2 20 00 cmp %o0, 0 200b480: 02 80 00 a1 be 200b704 <== NEVER TAKEN 200b484: c2 27 bf f4 st %g1, [ %fp + -12 ] /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) 200b488: 80 a4 20 00 cmp %l0, 0 200b48c: 32 80 00 08 bne,a 200b4ac 200b490: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 pathloc->node_access = node; } break; case IMFS_NO_MORE_PATH: rtems_set_errno_and_return_minus_one( EEXIST ); 200b494: 40 00 11 26 call 200f92c <__errno> 200b498: b0 10 3f ff mov -1, %i0 200b49c: 82 10 20 11 mov 0x11, %g1 200b4a0: c2 22 00 00 st %g1, [ %o0 ] 200b4a4: 81 c7 e0 08 ret 200b4a8: 81 e8 00 00 restore /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) if ( node->type == IMFS_DIRECTORY ) 200b4ac: 80 a0 60 01 cmp %g1, 1 200b4b0: 22 80 00 5e be,a 200b628 200b4b4: 90 10 00 19 mov %i1, %o0 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; switch( type ) { 200b4b8: 80 a4 20 02 cmp %l0, 2 200b4bc: 02 80 00 1a be 200b524 200b4c0: c2 06 e1 f0 ld [ %i3 + 0x1f0 ], %g1 200b4c4: 08 80 00 0a bleu 200b4ec 200b4c8: 80 a4 20 00 cmp %l0, 0 200b4cc: 80 a4 20 03 cmp %l0, 3 200b4d0: 02 80 00 26 be 200b568 200b4d4: 80 a4 20 04 cmp %l0, 4 200b4d8: 02 80 00 0d be 200b50c <== ALWAYS TAKEN 200b4dc: c2 07 bf f4 ld [ %fp + -12 ], %g1 200b4e0: d2 07 bf fc ld [ %fp + -4 ], %o1 200b4e4: 10 bf ff da b 200b44c 200b4e8: ba 10 00 08 mov %o0, %i5 200b4ec: 12 bf ff fd bne 200b4e0 <== ALWAYS TAKEN 200b4f0: c2 07 bf f4 ld [ %fp + -12 ], %g1 pathloc->node_access = node; } break; case IMFS_NO_MORE_PATH: rtems_set_errno_and_return_minus_one( EEXIST ); 200b4f4: 40 00 11 0e call 200f92c <__errno> <== NOT EXECUTED 200b4f8: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 200b4fc: 82 10 20 11 mov 0x11, %g1 <== NOT EXECUTED 200b500: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 200b504: 81 c7 e0 08 ret <== NOT EXECUTED 200b508: 81 e8 00 00 restore <== NOT EXECUTED break; case IMFS_INVALID_TOKEN: rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); 200b50c: 40 00 11 08 call 200f92c <__errno> 200b510: b0 10 3f ff mov -1, %i0 200b514: 82 10 20 5b mov 0x5b, %g1 200b518: c2 22 00 00 st %g1, [ %o0 ] 200b51c: 81 c7 e0 08 ret 200b520: 81 e8 00 00 restore case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) 200b524: fa 00 60 18 ld [ %g1 + 0x18 ], %i5 200b528: 80 a7 40 08 cmp %i5, %o0 200b52c: 02 80 00 7c be 200b71c 200b530: c2 07 bf f4 ld [ %fp + -12 ], %g1 /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access){ 200b534: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 200b538: c2 00 a0 1c ld [ %g2 + 0x1c ], %g1 200b53c: 80 a0 40 08 cmp %g1, %o0 200b540: 22 80 00 79 be,a 200b724 200b544: c2 00 a0 08 ld [ %g2 + 8 ], %g1 *pathloc = pathloc->mt_entry->mt_point_node; return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); } } else { if ( !node->Parent ) 200b548: fa 02 20 08 ld [ %o0 + 8 ], %i5 200b54c: 80 a7 60 00 cmp %i5, 0 200b550: 02 80 00 8e be 200b788 200b554: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOENT ); node = node->Parent; } pathloc->node_access = node; 200b558: fa 26 40 00 st %i5, [ %i1 ] 200b55c: c2 07 bf f4 ld [ %fp + -12 ], %g1 break; 200b560: 10 bf ff bb b 200b44c 200b564: d2 07 bf fc ld [ %fp + -4 ], %o1 case IMFS_NAME: if ( node->type == IMFS_HARD_LINK ) { 200b568: c2 02 20 4c ld [ %o0 + 0x4c ], %g1 200b56c: 80 a0 60 03 cmp %g1, 3 200b570: 02 80 00 35 be 200b644 200b574: 80 a0 60 04 cmp %g1, 4 result = IMFS_evaluate_link( pathloc, 0 ); if ( result == -1 ) return -1; } else if ( node->type == IMFS_SYM_LINK ) { 200b578: 22 80 00 34 be,a 200b648 200b57c: 90 10 00 19 mov %i1, %o0 if ( result == -1 ) return -1; } node = pathloc->node_access; if ( !node ) 200b580: 80 a2 20 00 cmp %o0, 0 200b584: 02 80 00 7b be 200b770 <== NEVER TAKEN 200b588: 01 00 00 00 nop /* * Only a directory can be decended into. */ if ( node->type != IMFS_DIRECTORY ) 200b58c: c2 02 20 4c ld [ %o0 + 0x4c ], %g1 200b590: 80 a0 60 01 cmp %g1, 1 200b594: 12 80 00 77 bne 200b770 200b598: 01 00 00 00 nop /* * Find the token name in the present location. */ node = IMFS_find_match_in_dir( node, token ); 200b59c: 40 00 00 d4 call 200b8ec 200b5a0: 92 07 bf d0 add %fp, -48, %o1 /* * If there is no node we have found the name of the node we * wish to create. */ if ( ! node ) 200b5a4: ba 92 20 00 orcc %o0, 0, %i5 200b5a8: 02 80 00 42 be 200b6b0 200b5ac: c2 07 bf f4 ld [ %fp + -12 ], %g1 done = true; else { if (( node->type == IMFS_DIRECTORY ) && ( node->info.directory.mt_fs != NULL )) { 200b5b0: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 200b5b4: 80 a0 60 01 cmp %g1, 1 200b5b8: 22 80 00 06 be,a 200b5d0 200b5bc: c2 07 60 5c ld [ %i5 + 0x5c ], %g1 200b5c0: c2 07 bf f4 ld [ %fp + -12 ], %g1 200b5c4: d2 07 bf fc ld [ %fp + -4 ], %o1 } i += 2; pathlen -= 2; node = node->Parent; } pathloc->node_access = node; 200b5c8: 10 bf ff a1 b 200b44c 200b5cc: fa 26 40 00 st %i5, [ %i1 ] */ if ( ! node ) done = true; else { if (( node->type == IMFS_DIRECTORY ) && ( node->info.directory.mt_fs != NULL )) { 200b5d0: 80 a0 60 00 cmp %g1, 0 200b5d4: 02 bf ff fb be 200b5c0 200b5d8: 90 10 00 1c mov %i4, %o0 IMFS_skip_separator( path, &pathlen, &i); 200b5dc: 92 07 bf fc add %fp, -4, %o1 200b5e0: 7f ff fd ce call 200ad18 200b5e4: 94 07 bf f4 add %fp, -12, %o2 if ((path[i] != '.') || (path[i + 1] != '.')) { 200b5e8: c2 07 bf f4 ld [ %fp + -12 ], %g1 200b5ec: c4 4f 00 01 ldsb [ %i4 + %g1 ], %g2 200b5f0: 80 a0 a0 2e cmp %g2, 0x2e 200b5f4: 12 80 00 70 bne 200b7b4 200b5f8: 90 07 00 01 add %i4, %g1, %o0 200b5fc: c4 4a 20 01 ldsb [ %o0 + 1 ], %g2 200b600: 80 a0 a0 2e cmp %g2, 0x2e 200b604: 12 80 00 6c bne 200b7b4 <== NEVER TAKEN 200b608: d2 07 bf fc ld [ %fp + -4 ], %o1 pathloc, name ); } i += 2; pathlen -= 2; node = node->Parent; 200b60c: fa 07 60 08 ld [ %i5 + 8 ], %i5 *pathloc = node->info.directory.mt_fs->mt_fs_root; return (*pathloc->ops->evalformake_h)( &path[i], pathloc, name ); } i += 2; 200b610: 82 00 60 02 add %g1, 2, %g1 pathlen -= 2; 200b614: 92 02 7f fe add %o1, -2, %o1 *pathloc = node->info.directory.mt_fs->mt_fs_root; return (*pathloc->ops->evalformake_h)( &path[i], pathloc, name ); } i += 2; 200b618: c2 27 bf f4 st %g1, [ %fp + -12 ] pathlen -= 2; 200b61c: d2 27 bf fc st %o1, [ %fp + -4 ] node = node->Parent; } pathloc->node_access = node; 200b620: 10 bf ff 8b b 200b44c 200b624: fa 26 40 00 st %i5, [ %i1 ] * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) if ( node->type == IMFS_DIRECTORY ) if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 200b628: 7f ff fd f5 call 200adfc 200b62c: 92 10 20 01 mov 1, %o1 200b630: 80 a2 20 00 cmp %o0, 0 200b634: 02 80 00 5a be 200b79c 200b638: 01 00 00 00 nop 200b63c: 10 bf ff 9f b 200b4b8 200b640: d0 06 40 00 ld [ %i1 ], %o0 if ( result == -1 ) return -1; } else if ( node->type == IMFS_SYM_LINK ) { result = IMFS_evaluate_link( pathloc, 0 ); 200b644: 90 10 00 19 mov %i1, %o0 200b648: 7f ff ff 40 call 200b348 200b64c: 92 10 20 00 clr %o1 if ( result == -1 ) 200b650: 80 a2 3f ff cmp %o0, -1 200b654: 02 bf ff 94 be 200b4a4 <== NEVER TAKEN 200b658: b0 10 00 08 mov %o0, %i0 200b65c: 10 bf ff c9 b 200b580 200b660: d0 06 40 00 ld [ %i1 ], %o0 /* * Verify we can execute and write to this directory. */ result = IMFS_Set_handlers( pathloc ); 200b664: 7f ff fd c4 call 200ad74 200b668: 90 10 00 19 mov %i1, %o0 /* * The returned node must be a directory */ node = pathloc->node_access; if ( node->type != IMFS_DIRECTORY ) 200b66c: c2 06 40 00 ld [ %i1 ], %g1 200b670: c2 00 60 4c ld [ %g1 + 0x4c ], %g1 200b674: 80 a0 60 01 cmp %g1, 1 200b678: 12 80 00 3e bne 200b770 <== NEVER TAKEN 200b67c: b0 10 00 08 mov %o0, %i0 /* * We must have Write and execute permission on the returned node. */ if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) ) 200b680: 90 10 00 19 mov %i1, %o0 200b684: 7f ff fd de call 200adfc 200b688: 92 10 20 03 mov 3, %o1 200b68c: 80 a2 20 00 cmp %o0, 0 200b690: 12 80 00 47 bne 200b7ac 200b694: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EACCES ); 200b698: 40 00 10 a5 call 200f92c <__errno> 200b69c: b0 10 3f ff mov -1, %i0 ! ffffffff 200b6a0: 82 10 20 0d mov 0xd, %g1 200b6a4: c2 22 00 00 st %g1, [ %o0 ] return result; } 200b6a8: 81 c7 e0 08 ret 200b6ac: 81 e8 00 00 restore case IMFS_CURRENT_DIR: break; } } *name = &path[ i - len ]; 200b6b0: c4 07 bf f8 ld [ %fp + -8 ], %g2 200b6b4: 84 20 40 02 sub %g1, %g2, %g2 200b6b8: 84 07 00 02 add %i4, %g2, %g2 200b6bc: c4 26 80 00 st %g2, [ %i2 ] /* * 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++) { 200b6c0: d0 0f 00 01 ldub [ %i4 + %g1 ], %o0 200b6c4: 91 2a 20 18 sll %o0, 0x18, %o0 200b6c8: 80 a2 20 00 cmp %o0, 0 200b6cc: 12 80 00 09 bne 200b6f0 200b6d0: 01 00 00 00 nop 200b6d4: 30 bf ff e4 b,a 200b664 200b6d8: 82 00 60 01 inc %g1 200b6dc: d0 0f 00 01 ldub [ %i4 + %g1 ], %o0 200b6e0: 91 2a 20 18 sll %o0, 0x18, %o0 200b6e4: 80 a2 20 00 cmp %o0, 0 200b6e8: 02 bf ff df be 200b664 200b6ec: c2 27 bf f4 st %g1, [ %fp + -12 ] if ( !IMFS_is_separator( path[ i ] ) ) 200b6f0: 7f ff e1 ef call 2003eac 200b6f4: 91 3a 20 18 sra %o0, 0x18, %o0 200b6f8: 80 a2 20 00 cmp %o0, 0 200b6fc: 12 bf ff f7 bne 200b6d8 200b700: c2 07 bf f4 ld [ %fp + -12 ], %g1 rtems_set_errno_and_return_minus_one( ENOENT ); 200b704: 40 00 10 8a call 200f92c <__errno> 200b708: b0 10 3f ff mov -1, %i0 200b70c: 82 10 20 02 mov 2, %g1 200b710: c2 22 00 00 st %g1, [ %o0 ] 200b714: 81 c7 e0 08 ret 200b718: 81 e8 00 00 restore /* * We must have Write and execute permission on the returned node. */ if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) ) rtems_set_errno_and_return_minus_one( EACCES ); 200b71c: 10 bf ff 4c b 200b44c 200b720: d2 07 bf fc ld [ %fp + -4 ], %o1 if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; } else { *pathloc = pathloc->mt_entry->mt_point_node; return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); 200b724: c6 07 bf f8 ld [ %fp + -8 ], %g3 if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; } else { *pathloc = pathloc->mt_entry->mt_point_node; 200b728: c2 26 40 00 st %g1, [ %i1 ] 200b72c: c2 00 a0 0c ld [ %g2 + 0xc ], %g1 return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); 200b730: d0 07 bf f4 ld [ %fp + -12 ], %o0 if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; } else { *pathloc = pathloc->mt_entry->mt_point_node; 200b734: c2 26 60 04 st %g1, [ %i1 + 4 ] 200b738: c2 00 a0 10 ld [ %g2 + 0x10 ], %g1 return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); 200b73c: 90 22 00 03 sub %o0, %g3, %o0 if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; } else { *pathloc = pathloc->mt_entry->mt_point_node; 200b740: c2 26 60 08 st %g1, [ %i1 + 8 ] 200b744: c2 00 a0 14 ld [ %g2 + 0x14 ], %g1 return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); 200b748: 90 07 00 08 add %i4, %o0, %o0 if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; } else { *pathloc = pathloc->mt_entry->mt_point_node; 200b74c: c2 26 60 0c st %g1, [ %i1 + 0xc ] return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); 200b750: c2 00 60 04 ld [ %g1 + 4 ], %g1 if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; } else { *pathloc = pathloc->mt_entry->mt_point_node; 200b754: c4 00 a0 18 ld [ %g2 + 0x18 ], %g2 return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); 200b758: 92 10 00 19 mov %i1, %o1 if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; } else { *pathloc = pathloc->mt_entry->mt_point_node; 200b75c: c4 26 60 10 st %g2, [ %i1 + 0x10 ] return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); 200b760: 9f c0 40 00 call %g1 200b764: 94 10 00 1a mov %i2, %o2 200b768: 81 c7 e0 08 ret 200b76c: 91 e8 00 08 restore %g0, %o0, %o0 /* * The returned node must be a directory */ node = pathloc->node_access; if ( node->type != IMFS_DIRECTORY ) rtems_set_errno_and_return_minus_one( ENOTDIR ); 200b770: 40 00 10 6f call 200f92c <__errno> 200b774: b0 10 3f ff mov -1, %i0 200b778: 82 10 20 14 mov 0x14, %g1 200b77c: c2 22 00 00 st %g1, [ %o0 ] 200b780: 81 c7 e0 08 ret 200b784: 81 e8 00 00 restore return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); } } else { if ( !node->Parent ) rtems_set_errno_and_return_minus_one( ENOENT ); 200b788: 40 00 10 69 call 200f92c <__errno> 200b78c: b0 10 3f ff mov -1, %i0 200b790: e0 22 00 00 st %l0, [ %o0 ] 200b794: 81 c7 e0 08 ret 200b798: 81 e8 00 00 restore */ 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 ); 200b79c: 40 00 10 64 call 200f92c <__errno> 200b7a0: b0 10 3f ff mov -1, %i0 200b7a4: 82 10 20 0d mov 0xd, %g1 200b7a8: c2 22 00 00 st %g1, [ %o0 ] 200b7ac: 81 c7 e0 08 ret 200b7b0: 81 e8 00 00 restore done = true; else { if (( node->type == IMFS_DIRECTORY ) && ( node->info.directory.mt_fs != NULL )) { IMFS_skip_separator( path, &pathlen, &i); if ((path[i] != '.') || (path[i + 1] != '.')) { *pathloc = node->info.directory.mt_fs->mt_fs_root; 200b7b4: c4 07 60 5c ld [ %i5 + 0x5c ], %g2 return (*pathloc->ops->evalformake_h)( &path[i], 200b7b8: 92 10 00 19 mov %i1, %o1 done = true; else { if (( node->type == IMFS_DIRECTORY ) && ( node->info.directory.mt_fs != NULL )) { IMFS_skip_separator( path, &pathlen, &i); if ((path[i] != '.') || (path[i + 1] != '.')) { *pathloc = node->info.directory.mt_fs->mt_fs_root; 200b7bc: c2 00 a0 1c ld [ %g2 + 0x1c ], %g1 return (*pathloc->ops->evalformake_h)( &path[i], 200b7c0: 94 10 00 1a mov %i2, %o2 done = true; else { if (( node->type == IMFS_DIRECTORY ) && ( node->info.directory.mt_fs != NULL )) { IMFS_skip_separator( path, &pathlen, &i); if ((path[i] != '.') || (path[i + 1] != '.')) { *pathloc = node->info.directory.mt_fs->mt_fs_root; 200b7c4: c2 26 40 00 st %g1, [ %i1 ] 200b7c8: c2 00 a0 20 ld [ %g2 + 0x20 ], %g1 200b7cc: c2 26 60 04 st %g1, [ %i1 + 4 ] 200b7d0: c2 00 a0 24 ld [ %g2 + 0x24 ], %g1 200b7d4: c2 26 60 08 st %g1, [ %i1 + 8 ] 200b7d8: c2 00 a0 28 ld [ %g2 + 0x28 ], %g1 200b7dc: c2 26 60 0c st %g1, [ %i1 + 0xc ] return (*pathloc->ops->evalformake_h)( &path[i], 200b7e0: c2 00 60 04 ld [ %g1 + 4 ], %g1 done = true; else { if (( node->type == IMFS_DIRECTORY ) && ( node->info.directory.mt_fs != NULL )) { IMFS_skip_separator( path, &pathlen, &i); if ((path[i] != '.') || (path[i + 1] != '.')) { *pathloc = node->info.directory.mt_fs->mt_fs_root; 200b7e4: c4 00 a0 2c ld [ %g2 + 0x2c ], %g2 return (*pathloc->ops->evalformake_h)( &path[i], 200b7e8: 9f c0 40 00 call %g1 200b7ec: c4 26 60 10 st %g2, [ %i1 + 0x10 ] 200b7f0: 81 c7 e0 08 ret 200b7f4: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 0200b348 : */ int IMFS_evaluate_link( rtems_filesystem_location_info_t *node, /* IN/OUT */ int flags /* IN */ ) { 200b348: 9d e3 bf a0 save %sp, -96, %sp */ rtems_filesystem_link_counts ++; if ( rtems_filesystem_link_counts > MAXSYMLINK ) { rtems_filesystem_link_counts = 0; rtems_set_errno_and_return_minus_one( ELOOP ); 200b34c: 3b 00 80 73 sethi %hi(0x201cc00), %i5 */ int IMFS_evaluate_link( rtems_filesystem_location_info_t *node, /* IN/OUT */ int flags /* IN */ ) { 200b350: b8 10 00 18 mov %i0, %i4 */ rtems_filesystem_link_counts ++; if ( rtems_filesystem_link_counts > MAXSYMLINK ) { rtems_filesystem_link_counts = 0; rtems_set_errno_and_return_minus_one( ELOOP ); 200b354: 10 80 00 07 b 200b370 200b358: c2 07 61 f0 ld [ %i5 + 0x1f0 ], %g1 */ if ( jnode->type == IMFS_HARD_LINK ) result = IMFS_evaluate_hard_link( node, flags ); else if (jnode->type == IMFS_SYM_LINK ) 200b35c: 02 80 00 21 be 200b3e0 200b360: 84 00 bf fd add %g2, -3, %g2 result = IMFS_evaluate_sym_link( node, flags ); } while ( ( result == 0 ) && ( ( jnode->type == IMFS_SYM_LINK ) || 200b364: 80 a0 a0 01 cmp %g2, 1 200b368: 38 80 00 1c bgu,a 200b3d8 <== ALWAYS TAKEN 200b36c: c0 30 60 30 clrh [ %g1 + 0x30 ] /* * Increment and check the link counter. */ rtems_filesystem_link_counts ++; 200b370: c4 10 60 30 lduh [ %g1 + 0x30 ], %g2 { IMFS_jnode_t *jnode; int result = 0; do { jnode = node->node_access; 200b374: f6 07 00 00 ld [ %i4 ], %i3 /* * Increment and check the link counter. */ rtems_filesystem_link_counts ++; 200b378: 84 00 a0 01 inc %g2 200b37c: c4 30 60 30 sth %g2, [ %g1 + 0x30 ] if ( rtems_filesystem_link_counts > MAXSYMLINK ) { 200b380: 85 28 a0 10 sll %g2, 0x10, %g2 200b384: 85 30 a0 10 srl %g2, 0x10, %g2 200b388: 80 a0 a0 05 cmp %g2, 5 200b38c: 18 80 00 20 bgu 200b40c 200b390: 01 00 00 00 nop /* * Follow the Link node. */ if ( jnode->type == IMFS_HARD_LINK ) 200b394: c4 06 e0 4c ld [ %i3 + 0x4c ], %g2 200b398: 80 a0 a0 03 cmp %g2, 3 200b39c: 12 bf ff f0 bne 200b35c 200b3a0: 80 a0 a0 04 cmp %g2, 4 result = IMFS_evaluate_hard_link( node, flags ); 200b3a4: 90 10 00 1c mov %i4, %o0 200b3a8: 7f ff fe c0 call 200aea8 200b3ac: 92 10 00 19 mov %i1, %o1 200b3b0: b0 10 00 08 mov %o0, %i0 else if (jnode->type == IMFS_SYM_LINK ) result = IMFS_evaluate_sym_link( node, flags ); } while ( ( result == 0 ) && ( ( jnode->type == IMFS_SYM_LINK ) || ( jnode->type == IMFS_HARD_LINK ) ) ); 200b3b4: 80 a6 20 00 cmp %i0, 0 200b3b8: 12 80 00 12 bne 200b400 200b3bc: c2 07 61 f0 ld [ %i5 + 0x1f0 ], %g1 200b3c0: c4 06 e0 4c ld [ %i3 + 0x4c ], %g2 result = IMFS_evaluate_hard_link( node, flags ); else if (jnode->type == IMFS_SYM_LINK ) result = IMFS_evaluate_sym_link( node, flags ); } while ( ( result == 0 ) && ( ( jnode->type == IMFS_SYM_LINK ) || 200b3c4: 84 00 bf fd add %g2, -3, %g2 200b3c8: 80 a0 a0 01 cmp %g2, 1 200b3cc: 08 bf ff e9 bleu 200b370 <== ALWAYS TAKEN 200b3d0: c2 07 61 f0 ld [ %i5 + 0x1f0 ], %g1 /* * Clear link counter. */ rtems_filesystem_link_counts = 0; 200b3d4: c0 30 60 30 clrh [ %g1 + 0x30 ] <== NOT EXECUTED return result; } 200b3d8: 81 c7 e0 08 ret 200b3dc: 91 e8 20 00 restore %g0, 0, %o0 if ( jnode->type == IMFS_HARD_LINK ) result = IMFS_evaluate_hard_link( node, flags ); else if (jnode->type == IMFS_SYM_LINK ) result = IMFS_evaluate_sym_link( node, flags ); 200b3e0: 90 10 00 1c mov %i4, %o0 200b3e4: 7f ff ff b5 call 200b2b8 200b3e8: 92 10 00 19 mov %i1, %o1 200b3ec: b0 10 00 08 mov %o0, %i0 } while ( ( result == 0 ) && ( ( jnode->type == IMFS_SYM_LINK ) || ( jnode->type == IMFS_HARD_LINK ) ) ); 200b3f0: 80 a6 20 00 cmp %i0, 0 200b3f4: 22 bf ff f4 be,a 200b3c4 200b3f8: c4 06 e0 4c ld [ %i3 + 0x4c ], %g2 200b3fc: c2 07 61 f0 ld [ %i5 + 0x1f0 ], %g1 /* * Clear link counter. */ rtems_filesystem_link_counts = 0; 200b400: c0 30 60 30 clrh [ %g1 + 0x30 ] return result; } 200b404: 81 c7 e0 08 ret 200b408: 81 e8 00 00 restore */ rtems_filesystem_link_counts ++; if ( rtems_filesystem_link_counts > MAXSYMLINK ) { rtems_filesystem_link_counts = 0; rtems_set_errno_and_return_minus_one( ELOOP ); 200b40c: 40 00 11 48 call 200f92c <__errno> 200b410: c0 30 60 30 clrh [ %g1 + 0x30 ] 200b414: 82 10 20 5c mov 0x5c, %g1 200b418: c2 22 00 00 st %g1, [ %o0 ] 200b41c: 81 c7 e0 08 ret 200b420: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 0200adfc : */ int IMFS_evaluate_permission( rtems_filesystem_location_info_t *node, int flags ) { 200adfc: 9d e3 bf a0 save %sp, -96, %sp uid_t st_uid; gid_t st_gid; IMFS_jnode_t *jnode; int flags_to_test; if ( !rtems_libio_is_valid_perms( flags ) ) 200ae00: 80 8e 7f f8 btst -8, %i1 200ae04: 12 80 00 23 bne 200ae90 <== NEVER TAKEN 200ae08: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EPERM ); jnode = node->node_access; #if defined(RTEMS_POSIX_API) st_uid = geteuid(); 200ae0c: 40 00 04 20 call 200be8c 200ae10: fa 06 00 00 ld [ %i0 ], %i5 st_gid = getegid(); 200ae14: 40 00 04 1a call 200be7c 200ae18: b8 10 00 08 mov %o0, %i4 * Check if I am owner or a group member or someone else. */ flags_to_test = flags; if ( st_uid == jnode->st_uid ) 200ae1c: c2 17 60 3c lduh [ %i5 + 0x3c ], %g1 200ae20: b9 2f 20 10 sll %i4, 0x10, %i4 200ae24: b9 37 20 10 srl %i4, 0x10, %i4 200ae28: 80 a0 40 1c cmp %g1, %i4 200ae2c: 02 80 00 0c be 200ae5c 200ae30: 91 2a 20 10 sll %o0, 0x10, %o0 flags_to_test <<= 6; else if ( st_gid == jnode->st_gid ) 200ae34: c2 17 60 3e lduh [ %i5 + 0x3e ], %g1 200ae38: 91 32 20 10 srl %o0, 0x10, %o0 200ae3c: 80 a0 40 08 cmp %g1, %o0 200ae40: 02 80 00 0e be 200ae78 <== ALWAYS TAKEN 200ae44: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 /* * If all of the flags are set we have permission * to do this. */ if ( ( flags_to_test & jnode->st_mode) == flags_to_test ) return 1; 200ae48: b2 2e 40 01 andn %i1, %g1, %i1 <== NOT EXECUTED 200ae4c: 80 a0 00 19 cmp %g0, %i1 <== NOT EXECUTED 200ae50: b0 60 3f ff subx %g0, -1, %i0 <== NOT EXECUTED return 0; } 200ae54: 81 c7 e0 08 ret <== NOT EXECUTED 200ae58: 81 e8 00 00 restore <== NOT EXECUTED /* * If all of the flags are set we have permission * to do this. */ if ( ( flags_to_test & jnode->st_mode) == flags_to_test ) 200ae5c: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 */ flags_to_test = flags; if ( st_uid == jnode->st_uid ) flags_to_test <<= 6; 200ae60: b3 2e 60 06 sll %i1, 6, %i1 /* * If all of the flags are set we have permission * to do this. */ if ( ( flags_to_test & jnode->st_mode) == flags_to_test ) return 1; 200ae64: b2 2e 40 01 andn %i1, %g1, %i1 200ae68: 80 a0 00 19 cmp %g0, %i1 200ae6c: b0 60 3f ff subx %g0, -1, %i0 return 0; } 200ae70: 81 c7 e0 08 ret 200ae74: 81 e8 00 00 restore flags_to_test = flags; if ( st_uid == jnode->st_uid ) flags_to_test <<= 6; else if ( st_gid == jnode->st_gid ) flags_to_test <<= 3; 200ae78: b3 2e 60 03 sll %i1, 3, %i1 /* * If all of the flags are set we have permission * to do this. */ if ( ( flags_to_test & jnode->st_mode) == flags_to_test ) return 1; 200ae7c: b2 2e 40 01 andn %i1, %g1, %i1 200ae80: 80 a0 00 19 cmp %g0, %i1 200ae84: b0 60 3f ff subx %g0, -1, %i0 return 0; } 200ae88: 81 c7 e0 08 ret 200ae8c: 81 e8 00 00 restore gid_t st_gid; IMFS_jnode_t *jnode; int flags_to_test; if ( !rtems_libio_is_valid_perms( flags ) ) rtems_set_errno_and_return_minus_one( EPERM ); 200ae90: 40 00 12 a7 call 200f92c <__errno> <== NOT EXECUTED 200ae94: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 200ae98: 82 10 20 01 mov 1, %g1 <== NOT EXECUTED 200ae9c: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 200aea0: 81 c7 e0 08 ret <== NOT EXECUTED 200aea4: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 02003830 : rtems_off64_t IMFS_fifo_lseek( rtems_libio_t *iop, rtems_off64_t offset, int whence ) { 2003830: 9d e3 bf a0 save %sp, -96, %sp off_t err = pipe_lseek(LIBIO2PIPE(iop), offset, whence, iop); 2003834: c2 06 20 1c ld [ %i0 + 0x1c ], %g1 2003838: 92 10 00 19 mov %i1, %o1 200383c: d0 00 60 50 ld [ %g1 + 0x50 ], %o0 2003840: 98 10 00 18 mov %i0, %o4 2003844: 94 10 00 1a mov %i2, %o2 2003848: 40 00 2a 7e call 200e240 200384c: 96 10 00 1b mov %i3, %o3 2003850: b1 3a 20 1f sra %o0, 0x1f, %i0 IMFS_FIFO_RETURN(err); 2003854: 80 a6 20 00 cmp %i0, 0 2003858: 06 80 00 04 bl 2003868 <== ALWAYS TAKEN 200385c: b2 10 00 08 mov %o0, %i1 } 2003860: 81 c7 e0 08 ret <== NOT EXECUTED 2003864: 81 e8 00 00 restore <== NOT EXECUTED rtems_off64_t offset, int whence ) { off_t err = pipe_lseek(LIBIO2PIPE(iop), offset, whence, iop); IMFS_FIFO_RETURN(err); 2003868: 40 00 37 db call 20117d4 <__errno> 200386c: 31 3f ff ff sethi %hi(0xfffffc00), %i0 2003870: 82 20 00 19 neg %i1, %g1 2003874: c2 22 00 00 st %g1, [ %o0 ] 2003878: b0 16 23 ff or %i0, 0x3ff, %i0 } 200387c: 81 c7 e0 08 ret 2003880: 93 e8 00 18 restore %g0, %i0, %o1 =============================================================================== 02003884 : ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 2003884: 9d e3 bf 98 save %sp, -104, %sp IMFS_jnode_t *jnode = iop->pathinfo.node_access; 2003888: fa 06 20 1c ld [ %i0 + 0x1c ], %i5 ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 200388c: 96 10 00 18 mov %i0, %o3 IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); 2003890: d0 07 60 50 ld [ %i5 + 0x50 ], %o0 2003894: 92 10 00 19 mov %i1, %o1 2003898: 40 00 29 cc call 200dfc8 200389c: 94 10 00 1a mov %i2, %o2 if (err > 0) { 20038a0: b0 92 20 00 orcc %o0, 0, %i0 20038a4: 04 80 00 09 ble 20038c8 20038a8: 90 07 bf f8 add %fp, -8, %o0 IMFS_mtime_ctime_update(jnode); 20038ac: 40 00 04 70 call 2004a6c 20038b0: 92 10 20 00 clr %o1 20038b4: c2 07 bf f8 ld [ %fp + -8 ], %g1 20038b8: c2 27 60 44 st %g1, [ %i5 + 0x44 ] 20038bc: c2 27 60 48 st %g1, [ %i5 + 0x48 ] 20038c0: 81 c7 e0 08 ret 20038c4: 81 e8 00 00 restore } IMFS_FIFO_RETURN(err); 20038c8: 80 a6 20 00 cmp %i0, 0 20038cc: 12 80 00 04 bne 20038dc <== ALWAYS TAKEN 20038d0: 01 00 00 00 nop } 20038d4: 81 c7 e0 08 ret <== NOT EXECUTED 20038d8: 81 e8 00 00 restore <== NOT EXECUTED int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); if (err > 0) { IMFS_mtime_ctime_update(jnode); } IMFS_FIFO_RETURN(err); 20038dc: 40 00 37 be call 20117d4 <__errno> 20038e0: 01 00 00 00 nop 20038e4: 82 20 00 18 neg %i0, %g1 20038e8: c2 22 00 00 st %g1, [ %o0 ] } 20038ec: 81 c7 e0 08 ret 20038f0: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 0200b8ec : IMFS_jnode_t *IMFS_find_match_in_dir( IMFS_jnode_t *directory, char *name ) { 200b8ec: 9d e3 bf a0 save %sp, -96, %sp /* * Check for "." and ".." */ if ( !strcmp( name, dotname ) ) 200b8f0: 13 00 80 6e sethi %hi(0x201b800), %o1 200b8f4: 90 10 00 19 mov %i1, %o0 200b8f8: 40 00 13 ad call 20107ac 200b8fc: 92 12 62 60 or %o1, 0x260, %o1 200b900: 80 a2 20 00 cmp %o0, 0 200b904: 02 80 00 19 be 200b968 <== NEVER TAKEN 200b908: 90 10 00 19 mov %i1, %o0 return directory; if ( !strcmp( name, dotdotname ) ) 200b90c: 13 00 80 6e sethi %hi(0x201b800), %o1 200b910: 40 00 13 a7 call 20107ac 200b914: 92 12 62 68 or %o1, 0x268, %o1 ! 201ba68 200b918: 80 a2 20 00 cmp %o0, 0 200b91c: 02 80 00 12 be 200b964 <== NEVER TAKEN 200b920: b8 06 20 54 add %i0, 0x54, %i4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 200b924: fa 06 20 50 ld [ %i0 + 0x50 ], %i5 return directory->Parent; the_chain = &directory->info.directory.Entries; for ( the_node = rtems_chain_first( the_chain ); 200b928: 80 a7 40 1c cmp %i5, %i4 200b92c: 12 80 00 06 bne 200b944 200b930: b0 10 20 00 clr %i0 200b934: 30 80 00 0d b,a 200b968 200b938: 80 a7 40 1c cmp %i5, %i4 200b93c: 02 80 00 0d be 200b970 200b940: 01 00 00 00 nop !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 ) ) 200b944: 92 07 60 0c add %i5, 0xc, %o1 200b948: 40 00 13 99 call 20107ac 200b94c: 90 10 00 19 mov %i1, %o0 200b950: 80 a2 20 00 cmp %o0, 0 200b954: 32 bf ff f9 bne,a 200b938 200b958: fa 07 40 00 ld [ %i5 ], %i5 return the_jnode; } return 0; } 200b95c: 81 c7 e0 08 ret 200b960: 91 e8 00 1d restore %g0, %i5, %o0 if ( !strcmp( name, dotname ) ) return directory; if ( !strcmp( name, dotdotname ) ) return directory->Parent; 200b964: f0 06 20 08 ld [ %i0 + 8 ], %i0 <== NOT EXECUTED 200b968: 81 c7 e0 08 ret 200b96c: 81 e8 00 00 restore if ( !strcmp( name, the_jnode->name ) ) return the_jnode; } return 0; 200b970: 81 c7 e0 08 ret 200b974: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 0200b7f8 : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) int IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 200b7f8: 9d e3 bf 88 save %sp, -120, %sp /* * 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; 200b7fc: f8 06 20 1c ld [ %i0 + 0x1c ], %i4 loc = temp_mt_entry->mt_fs_root; 200b800: c8 06 20 20 ld [ %i0 + 0x20 ], %g4 200b804: c6 06 20 24 ld [ %i0 + 0x24 ], %g3 200b808: c4 06 20 28 ld [ %i0 + 0x28 ], %g2 200b80c: c2 06 20 2c ld [ %i0 + 0x2c ], %g1 200b810: f8 27 bf ec st %i4, [ %fp + -20 ] 200b814: c8 27 bf f0 st %g4, [ %fp + -16 ] 200b818: c6 27 bf f4 st %g3, [ %fp + -12 ] 200b81c: c4 27 bf f8 st %g2, [ %fp + -8 ] 200b820: c2 27 bf fc st %g1, [ %fp + -4 ] /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root.node_access = NULL; 200b824: c0 26 20 1c clr [ %i0 + 0x1c ] do { next = jnode->Parent; 200b828: fa 07 20 08 ld [ %i4 + 8 ], %i5 loc.node_access = (void *)jnode; 200b82c: f8 27 bf ec st %i4, [ %fp + -20 ] IMFS_Set_handlers( &loc ); 200b830: 7f ff fd 51 call 200ad74 200b834: 90 07 bf ec add %fp, -20, %o0 if ( jnode->type != IMFS_DIRECTORY ) { 200b838: c2 07 20 4c ld [ %i4 + 0x4c ], %g1 200b83c: 80 a0 60 01 cmp %g1, 1 200b840: 32 80 00 1d bne,a 200b8b4 <== NEVER TAKEN 200b844: 90 10 20 00 clr %o0 <== NOT EXECUTED result = IMFS_unlink( NULL, &loc ); if (result != 0) return -1; jnode = next; } else if ( jnode_has_no_children( jnode ) ) { 200b848: c4 07 20 50 ld [ %i4 + 0x50 ], %g2 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 200b84c: 82 07 20 54 add %i4, 0x54, %g1 200b850: 80 a0 80 01 cmp %g2, %g1 200b854: 02 80 00 17 be 200b8b0 200b858: 80 a7 20 00 cmp %i4, 0 result = IMFS_unlink( NULL, &loc ); if (result != 0) return -1; jnode = next; } if ( jnode != NULL ) { 200b85c: 02 80 00 1e be 200b8d4 <== NEVER TAKEN 200b860: 01 00 00 00 nop if ( jnode->type == IMFS_DIRECTORY ) { 200b864: c2 07 20 4c ld [ %i4 + 0x4c ], %g1 200b868: 80 a0 60 01 cmp %g1, 1 200b86c: 32 bf ff f0 bne,a 200b82c <== NEVER TAKEN 200b870: fa 07 20 08 ld [ %i4 + 8 ], %i5 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 200b874: c2 07 20 50 ld [ %i4 + 0x50 ], %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 200b878: 84 07 20 54 add %i4, 0x54, %g2 if ( jnode_has_children( jnode ) ) 200b87c: 80 a0 40 02 cmp %g1, %g2 200b880: 02 bf ff ea be 200b828 200b884: 80 a0 60 00 cmp %g1, 0 jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); 200b888: 02 80 00 17 be 200b8e4 <== NEVER TAKEN 200b88c: b8 10 00 01 mov %g1, %i4 temp_mt_entry->mt_fs_root.node_access = NULL; do { next = jnode->Parent; loc.node_access = (void *)jnode; IMFS_Set_handlers( &loc ); 200b890: 90 07 bf ec add %fp, -20, %o0 */ temp_mt_entry->mt_fs_root.node_access = NULL; do { next = jnode->Parent; 200b894: fa 07 20 08 ld [ %i4 + 8 ], %i5 loc.node_access = (void *)jnode; IMFS_Set_handlers( &loc ); 200b898: 7f ff fd 37 call 200ad74 200b89c: f8 27 bf ec st %i4, [ %fp + -20 ] if ( jnode->type != IMFS_DIRECTORY ) { 200b8a0: c2 07 20 4c ld [ %i4 + 0x4c ], %g1 200b8a4: 80 a0 60 01 cmp %g1, 1 200b8a8: 22 bf ff e9 be,a 200b84c 200b8ac: c4 07 20 50 ld [ %i4 + 0x50 ], %g2 result = IMFS_unlink( NULL, &loc ); if (result != 0) return -1; jnode = next; } else if ( jnode_has_no_children( jnode ) ) { result = IMFS_unlink( NULL, &loc ); 200b8b0: 90 10 20 00 clr %o0 200b8b4: 7f ff db 94 call 2002704 200b8b8: 92 07 bf ec add %fp, -20, %o1 if (result != 0) 200b8bc: 80 a2 20 00 cmp %o0, 0 200b8c0: 12 80 00 07 bne 200b8dc <== NEVER TAKEN 200b8c4: b8 10 00 1d mov %i5, %i4 return -1; jnode = next; } if ( jnode != NULL ) { 200b8c8: 80 a7 20 00 cmp %i4, 0 200b8cc: 32 bf ff e7 bne,a 200b868 200b8d0: c2 07 20 4c ld [ %i4 + 0x4c ], %g1 } } } while (jnode != NULL); return 0; } 200b8d4: 81 c7 e0 08 ret 200b8d8: 91 e8 20 00 restore %g0, 0, %o0 return -1; jnode = next; } else if ( jnode_has_no_children( jnode ) ) { result = IMFS_unlink( NULL, &loc ); if (result != 0) return -1; 200b8dc: 81 c7 e0 08 ret <== NOT EXECUTED 200b8e0: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); return 0; 200b8e4: 81 c7 e0 08 ret <== NOT EXECUTED 200b8e8: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED =============================================================================== 0200b978 : const char *path, int pathlen, char *token, int *token_len ) { 200b978: 9d e3 bf a0 save %sp, -96, %sp register int i = 0; 200b97c: ba 10 20 00 clr %i5 /* * Copy a name into token. (Remember NULL is a token.) */ c = path[i]; while ( (!IMFS_is_separator(c)) && (i < pathlen) && (i <= IMFS_NAME_MAX) ) { 200b980: 10 80 00 08 b 200b9a0 200b984: f8 0e 00 00 ldub [ %i0 ], %i4 200b988: 16 80 00 0c bge 200b9b8 <== NEVER TAKEN 200b98c: 80 a7 60 20 cmp %i5, 0x20 token[i] = c; 200b990: f8 2e 80 1d stb %i4, [ %i2 + %i5 ] if ( i == IMFS_NAME_MAX ) 200b994: 02 80 00 25 be 200ba28 200b998: ba 07 60 01 inc %i5 return IMFS_INVALID_TOKEN; if ( !IMFS_is_valid_name_char(c) ) type = IMFS_INVALID_TOKEN; c = path [++i]; 200b99c: f8 0e 00 1d ldub [ %i0 + %i5 ], %i4 /* * Copy a name into token. (Remember NULL is a token.) */ c = path[i]; while ( (!IMFS_is_separator(c)) && (i < pathlen) && (i <= IMFS_NAME_MAX) ) { 200b9a0: a1 2f 20 18 sll %i4, 0x18, %l0 200b9a4: 7f ff e1 42 call 2003eac 200b9a8: 91 3c 20 18 sra %l0, 0x18, %o0 200b9ac: 80 a2 20 00 cmp %o0, 0 200b9b0: 02 bf ff f6 be 200b988 200b9b4: 80 a7 40 19 cmp %i5, %i1 /* * Copy a seperator into token. */ if ( i == 0 ) { 200b9b8: 80 a7 60 00 cmp %i5, 0 200b9bc: 12 80 00 0c bne 200b9ec 200b9c0: 82 06 80 1d add %i2, %i5, %g1 token[i] = c; if ( (token[i] != '\0') && pathlen ) { 200b9c4: 80 a4 20 00 cmp %l0, 0 200b9c8: 02 80 00 1a be 200ba30 200b9cc: f8 2e 80 00 stb %i4, [ %i2 ] 200b9d0: 80 a6 60 00 cmp %i1, 0 200b9d4: 22 80 00 18 be,a 200ba34 200b9d8: fa 26 c0 00 st %i5, [ %i3 ] i++; 200b9dc: ba 10 20 01 mov 1, %i5 /* * Set token_len to the number of characters copied. */ *token_len = i; 200b9e0: fa 26 c0 00 st %i5, [ %i3 ] if ( i == 0 ) { token[i] = c; if ( (token[i] != '\0') && pathlen ) { i++; type = IMFS_CURRENT_DIR; 200b9e4: 81 c7 e0 08 ret 200b9e8: 91 e8 20 01 restore %g0, 1, %o0 } else { type = IMFS_NO_MORE_PATH; } } else if (token[ i-1 ] != '\0') { 200b9ec: c2 48 7f ff ldsb [ %g1 + -1 ], %g1 200b9f0: 80 a0 60 00 cmp %g1, 0 200b9f4: 32 80 00 02 bne,a 200b9fc <== ALWAYS TAKEN 200b9f8: c0 2e 80 1d clrb [ %i2 + %i5 ] /* * Set token_len to the number of characters copied. */ *token_len = i; 200b9fc: fa 26 c0 00 st %i5, [ %i3 ] * If we copied something that was not a seperator see if * it was a special name. */ if ( type == IMFS_NAME ) { if ( strcmp( token, "..") == 0 ) 200ba00: 90 10 00 1a mov %i2, %o0 200ba04: 13 00 80 6e sethi %hi(0x201b800), %o1 type = IMFS_UP_DIR; 200ba08: b0 10 20 02 mov 2, %i0 * If we copied something that was not a seperator see if * it was a special name. */ if ( type == IMFS_NAME ) { if ( strcmp( token, "..") == 0 ) 200ba0c: 40 00 13 68 call 20107ac 200ba10: 92 12 62 78 or %o1, 0x278, %o1 200ba14: 80 a2 20 00 cmp %o0, 0 200ba18: 12 80 00 09 bne 200ba3c 200ba1c: 90 10 00 1a mov %i2, %o0 else if ( strcmp( token, "." ) == 0 ) type = IMFS_CURRENT_DIR; } return type; } 200ba20: 81 c7 e0 08 ret 200ba24: 81 e8 00 00 restore 200ba28: 81 c7 e0 08 ret 200ba2c: 91 e8 20 04 restore %g0, 4, %o0 /* * Set token_len to the number of characters copied. */ *token_len = i; 200ba30: fa 26 c0 00 st %i5, [ %i3 ] if ( (token[i] != '\0') && pathlen ) { i++; type = IMFS_CURRENT_DIR; } else { type = IMFS_NO_MORE_PATH; 200ba34: 81 c7 e0 08 ret 200ba38: 91 e8 20 00 restore %g0, 0, %o0 */ if ( type == IMFS_NAME ) { if ( strcmp( token, "..") == 0 ) type = IMFS_UP_DIR; else if ( strcmp( token, "." ) == 0 ) 200ba3c: 13 00 80 6e sethi %hi(0x201b800), %o1 200ba40: 40 00 13 5b call 20107ac 200ba44: 92 12 62 70 or %o1, 0x270, %o1 ! 201ba70 200ba48: 80 a0 00 08 cmp %g0, %o0 200ba4c: b0 40 3f ff addx %g0, -1, %i0 200ba50: b0 0e 3f fe and %i0, -2, %i0 200ba54: 81 c7 e0 08 ret 200ba58: 91 ee 20 03 restore %i0, 3, %o0 =============================================================================== 020022f0 : 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 ) { 20022f0: 9d e3 bf a0 save %sp, -96, %sp IMFS_jnode_t *jnode; /* * determine/check value for imfs_memfile_bytes_per_block */ IMFS_determine_bytes_per_block(&imfs_memfile_bytes_per_block, 20022f4: 03 00 80 73 sethi %hi(0x201cc00), %g1 20022f8: c2 00 61 08 ld [ %g1 + 0x108 ], %g1 ! 201cd08 /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { if (bit_mask == requested_bytes_per_block) { 20022fc: 80 a0 60 10 cmp %g1, 0x10 2002300: 02 80 00 0d be 2002334 2002304: 86 10 20 05 mov 5, %g3 is_valid = true; break; } if(bit_mask > requested_bytes_per_block) 2002308: 80 a0 60 0f cmp %g1, 0xf 200230c: 04 80 00 09 ble 2002330 2002310: 84 10 20 20 mov 0x20, %g2 /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { if (bit_mask == requested_bytes_per_block) { 2002314: 80 a0 40 02 cmp %g1, %g2 2002318: 22 80 00 08 be,a 2002338 200231c: 05 00 80 75 sethi %hi(0x201d400), %g2 is_valid = true; break; } if(bit_mask > requested_bytes_per_block) 2002320: 06 80 00 04 bl 2002330 <== NEVER TAKEN 2002324: 86 80 ff ff addcc %g3, -1, %g3 int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 2002328: 12 bf ff fb bne 2002314 <== ALWAYS TAKEN 200232c: 85 28 a0 01 sll %g2, 1, %g2 if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) ? requested_bytes_per_block : default_bytes_per_block); 2002330: 82 10 20 80 mov 0x80, %g1 break; } if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) 2002334: 05 00 80 75 sethi %hi(0x201d400), %g2 /* * 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(); 2002338: 40 00 22 60 call 200acb8 200233c: c2 20 a0 f8 st %g1, [ %g2 + 0xf8 ] ! 201d4f8 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; 2002340: 94 10 20 30 mov 0x30, %o2 /* * 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(); 2002344: d0 26 20 1c st %o0, [ %i0 + 0x1c ] 2002348: ba 10 00 08 mov %o0, %i5 temp_mt_entry->mt_fs_root.handlers = directory_handlers; 200234c: f6 26 20 24 st %i3, [ %i0 + 0x24 ] temp_mt_entry->mt_fs_root.ops = op_table; 2002350: f2 26 20 28 st %i1, [ %i0 + 0x28 ] temp_mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS; 2002354: 90 06 20 38 add %i0, 0x38, %o0 2002358: 13 00 80 6e sethi %hi(0x201b800), %o1 200235c: 40 00 37 c9 call 2010280 2002360: 92 12 62 2c or %o1, 0x22c, %o1 ! 201ba2c /* * Create custom file system data. */ fs_info = calloc( 1, sizeof( IMFS_fs_info_t ) ); 2002364: 90 10 20 01 mov 1, %o0 2002368: 40 00 01 c6 call 2002a80 200236c: 92 10 20 14 mov 0x14, %o1 if ( !fs_info ) { 2002370: 80 a2 20 00 cmp %o0, 0 2002374: 02 80 00 0f be 20023b0 2002378: 03 00 80 75 sethi %hi(0x201d400), %g1 /* * Set st_ino for the root to 1. */ fs_info->instance = imfs_instance++; 200237c: c6 00 60 fc ld [ %g1 + 0xfc ], %g3 ! 201d4fc 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; 2002380: d0 26 20 34 st %o0, [ %i0 + 0x34 ] /* * Set st_ino for the root to 1. */ fs_info->instance = imfs_instance++; fs_info->ino_count = 1; 2002384: 84 10 20 01 mov 1, %g2 /* * Set st_ino for the root to 1. */ fs_info->instance = imfs_instance++; 2002388: c6 22 00 00 st %g3, [ %o0 ] fs_info->ino_count = 1; 200238c: c4 22 20 04 st %g2, [ %o0 + 4 ] fs_info->memfile_handlers = memfile_handlers; 2002390: f4 22 20 08 st %i2, [ %o0 + 8 ] fs_info->directory_handlers = directory_handlers; 2002394: f6 22 20 0c st %i3, [ %o0 + 0xc ] fs_info->fifo_handlers = fifo_handlers; 2002398: f8 22 20 10 st %i4, [ %o0 + 0x10 ] /* * Set st_ino for the root to 1. */ fs_info->instance = imfs_instance++; 200239c: 86 00 e0 01 inc %g3 fs_info->memfile_handlers = memfile_handlers; fs_info->directory_handlers = directory_handlers; fs_info->fifo_handlers = fifo_handlers; jnode = temp_mt_entry->mt_fs_root.node_access; jnode->st_ino = fs_info->ino_count; 20023a0: c4 27 60 38 st %g2, [ %i5 + 0x38 ] /* * Set st_ino for the root to 1. */ fs_info->instance = imfs_instance++; 20023a4: c6 20 60 fc st %g3, [ %g1 + 0xfc ] jnode = temp_mt_entry->mt_fs_root.node_access; jnode->st_ino = fs_info->ino_count; return 0; } 20023a8: 81 c7 e0 08 ret 20023ac: 91 e8 20 00 restore %g0, 0, %o0 /* * Create custom file system data. */ fs_info = calloc( 1, sizeof( IMFS_fs_info_t ) ); if ( !fs_info ) { free(temp_mt_entry->mt_fs_root.node_access); 20023b0: 40 00 02 c1 call 2002eb4 20023b4: 90 10 00 1d mov %i5, %o0 rtems_set_errno_and_return_minus_one(ENOMEM); 20023b8: 40 00 35 5d call 200f92c <__errno> 20023bc: b0 10 3f ff mov -1, %i0 20023c0: 82 10 20 0c mov 0xc, %g1 20023c4: c2 22 00 00 st %g1, [ %o0 ] 20023c8: 81 c7 e0 08 ret 20023cc: 81 e8 00 00 restore =============================================================================== 0200e338 : */ MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, off_t new_length ) { 200e338: 9d e3 bf a0 save %sp, -96, %sp IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 200e33c: 03 00 80 75 sethi %hi(0x201d400), %g1 200e340: fa 00 60 f8 ld [ %g1 + 0xf8 ], %i5 ! 201d4f8 200e344: b9 37 60 02 srl %i5, 2, %i4 200e348: 92 10 00 1c mov %i4, %o1 200e34c: 40 00 28 da call 20186b4 <.umul> 200e350: 90 07 20 01 add %i4, 1, %o0 200e354: 92 10 00 1c mov %i4, %o1 200e358: 40 00 28 d7 call 20186b4 <.umul> 200e35c: 90 02 20 01 inc %o0 200e360: 92 10 00 1d mov %i5, %o1 200e364: 40 00 28 d4 call 20186b4 <.umul> 200e368: 90 02 3f ff add %o0, -1, %o0 200e36c: 82 10 20 00 clr %g1 200e370: 80 a0 40 19 cmp %g1, %i1 200e374: 04 80 00 38 ble 200e454 <== ALWAYS TAKEN 200e378: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) 200e37c: f6 06 20 50 ld [ %i0 + 0x50 ], %i3 <== NOT EXECUTED 200e380: 80 a6 40 1b cmp %i1, %i3 200e384: 04 80 00 2a ble 200e42c <== ALWAYS TAKEN 200e388: e0 06 20 54 ld [ %i0 + 0x54 ], %l0 return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; 200e38c: a3 3f 60 1f sra %i5, 0x1f, %l1 <== NOT EXECUTED 200e390: 96 10 00 1d mov %i5, %o3 200e394: 94 10 00 11 mov %l1, %o2 200e398: 90 10 00 19 mov %i1, %o0 200e39c: 40 00 2a 58 call 2018cfc <__divdi3> 200e3a0: 92 10 00 1a mov %i2, %o1 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 200e3a4: 90 10 00 1b mov %i3, %o0 return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; 200e3a8: b8 10 00 09 mov %o1, %i4 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 200e3ac: 94 10 00 11 mov %l1, %o2 200e3b0: 92 10 00 10 mov %l0, %o1 200e3b4: 40 00 2a 52 call 2018cfc <__divdi3> 200e3b8: 96 10 00 1d mov %i5, %o3 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { 200e3bc: 80 a7 00 09 cmp %i4, %o1 200e3c0: 0a 80 00 21 bcs 200e444 <== NEVER TAKEN 200e3c4: b6 10 00 09 mov %o1, %i3 200e3c8: 10 80 00 05 b 200e3dc 200e3cc: ba 10 00 09 mov %o1, %i5 200e3d0: 80 a7 00 1d cmp %i4, %i5 200e3d4: 2a 80 00 1d bcs,a 200e448 200e3d8: f2 26 20 50 st %i1, [ %i0 + 0x50 ] if ( IMFS_memfile_addblock( the_jnode, block ) ) { 200e3dc: 92 10 00 1d mov %i5, %o1 200e3e0: 7f ff ff 39 call 200e0c4 200e3e4: 90 10 00 18 mov %i0, %o0 200e3e8: 80 a2 20 00 cmp %o0, 0 200e3ec: 22 bf ff f9 be,a 200e3d0 200e3f0: ba 07 60 01 inc %i5 for ( ; block>=old_blocks ; block-- ) { 200e3f4: 10 80 00 06 b 200e40c 200e3f8: 80 a6 c0 1d cmp %i3, %i5 IMFS_memfile_remove_block( the_jnode, block ); 200e3fc: 90 10 00 18 mov %i0, %o0 200e400: 7f ff ff c2 call 200e308 200e404: ba 07 7f ff add %i5, -1, %i5 /* * 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-- ) { 200e408: 80 a6 c0 1d cmp %i3, %i5 200e40c: 08 bf ff fc bleu 200e3fc 200e410: 92 10 00 1d mov %i5, %o1 IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); 200e414: 40 00 05 46 call 200f92c <__errno> 200e418: b0 10 3f ff mov -1, %i0 200e41c: 82 10 20 1c mov 0x1c, %g1 200e420: c2 22 00 00 st %g1, [ %o0 ] 200e424: 81 c7 e0 08 ret 200e428: 81 e8 00 00 restore rtems_set_errno_and_return_minus_one( EINVAL ); /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) 200e42c: 12 80 00 04 bne 200e43c <== NEVER TAKEN 200e430: 80 a6 80 10 cmp %i2, %l0 200e434: 18 bf ff d7 bgu 200e390 200e438: a3 3f 60 1f sra %i5, 0x1f, %l1 /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; return 0; } 200e43c: 81 c7 e0 08 ret 200e440: 91 e8 20 00 restore %g0, 0, %o0 } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; 200e444: f2 26 20 50 st %i1, [ %i0 + 0x50 ] <== NOT EXECUTED 200e448: f4 26 20 54 st %i2, [ %i0 + 0x54 ] return 0; 200e44c: 81 c7 e0 08 ret 200e450: 91 e8 20 00 restore %g0, 0, %o0 IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 200e454: 12 80 00 04 bne 200e464 <== NEVER TAKEN 200e458: 80 a2 00 1a cmp %o0, %i2 200e45c: 38 bf ff c9 bgu,a 200e380 200e460: f6 06 20 50 ld [ %i0 + 0x50 ], %i3 rtems_set_errno_and_return_minus_one( EINVAL ); 200e464: 40 00 05 32 call 200f92c <__errno> 200e468: b0 10 3f ff mov -1, %i0 200e46c: 82 10 20 16 mov 0x16, %g1 200e470: c2 22 00 00 st %g1, [ %o0 ] 200e474: 81 c7 e0 08 ret 200e478: 81 e8 00 00 restore =============================================================================== 0200dbe8 : #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 200dbe8: 9d e3 bf a0 save %sp, -96, %sp my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 200dbec: 03 00 80 75 sethi %hi(0x201d400), %g1 200dbf0: fa 00 60 f8 ld [ %g1 + 0xf8 ], %i5 ! 201d4f8 200dbf4: bb 37 60 02 srl %i5, 2, %i5 200dbf8: 82 07 7f ff add %i5, -1, %g1 200dbfc: 80 a6 40 01 cmp %i1, %g1 200dc00: 18 80 00 0b bgu 200dc2c 200dc04: b8 10 00 18 mov %i0, %i4 p = info->indirect; if ( malloc_it ) { 200dc08: 80 a6 a0 00 cmp %i2, 0 200dc0c: 12 80 00 50 bne 200dd4c 200dc10: d0 06 20 58 ld [ %i0 + 0x58 ], %o0 info->indirect = p; } return &info->indirect[ my_block ]; } if ( !p ) 200dc14: 80 a2 20 00 cmp %o0, 0 200dc18: 02 80 00 64 be 200dda8 <== NEVER TAKEN 200dc1c: b0 10 20 00 clr %i0 return 0; return &info->indirect[ my_block ]; 200dc20: b3 2e 60 02 sll %i1, 2, %i1 200dc24: 81 c7 e0 08 ret 200dc28: 91 ea 00 19 restore %o0, %i1, %o0 /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { 200dc2c: 90 07 60 01 add %i5, 1, %o0 200dc30: 40 00 2a a1 call 20186b4 <.umul> 200dc34: 92 10 00 1d mov %i5, %o1 200dc38: 82 02 3f ff add %o0, -1, %g1 200dc3c: 80 a6 40 01 cmp %i1, %g1 200dc40: 08 80 00 2c bleu 200dcf0 200dc44: b6 10 00 08 mov %o0, %i3 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 200dc48: 90 02 20 01 inc %o0 200dc4c: 40 00 2a 9a call 20186b4 <.umul> 200dc50: 92 10 00 1d mov %i5, %o1 200dc54: 90 02 3f ff add %o0, -1, %o0 200dc58: 80 a6 40 08 cmp %i1, %o0 200dc5c: 18 80 00 53 bgu 200dda8 <== NEVER TAKEN 200dc60: b0 10 20 00 clr %i0 my_block -= FIRST_TRIPLY_INDIRECT; 200dc64: b2 26 40 1b sub %i1, %i3, %i1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 200dc68: 92 10 00 1d mov %i5, %o1 200dc6c: 40 00 2b 78 call 2018a4c <.urem> 200dc70: 90 10 00 19 mov %i1, %o0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 200dc74: 92 10 00 1d mov %i5, %o1 * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 200dc78: a0 10 00 08 mov %o0, %l0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 200dc7c: 40 00 2a c8 call 201879c <.udiv> 200dc80: 90 10 00 19 mov %i1, %o0 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 200dc84: 92 10 00 1d mov %i5, %o1 200dc88: 40 00 2a c5 call 201879c <.udiv> 200dc8c: b6 10 00 08 mov %o0, %i3 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 200dc90: 92 10 00 1d mov %i5, %o1 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; 200dc94: b2 10 00 08 mov %o0, %i1 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 200dc98: 40 00 2b 6d call 2018a4c <.urem> 200dc9c: 90 10 00 1b mov %i3, %o0 p = info->triply_indirect; 200dca0: c2 07 20 60 ld [ %i4 + 0x60 ], %g1 if ( malloc_it ) { 200dca4: 80 a6 a0 00 cmp %i2, 0 200dca8: 02 80 00 33 be 200dd74 200dcac: ba 10 00 08 mov %o0, %i5 if ( !p ) { 200dcb0: 80 a0 60 00 cmp %g1, 0 200dcb4: 02 80 00 66 be 200de4c 200dcb8: 01 00 00 00 nop if ( !p ) return 0; info->triply_indirect = p; } p1 = (block_p *) p[ triply ]; 200dcbc: b3 2e 60 02 sll %i1, 2, %i1 200dcc0: c4 00 40 19 ld [ %g1 + %i1 ], %g2 if ( !p1 ) { 200dcc4: 80 a0 a0 00 cmp %g2, 0 200dcc8: 02 80 00 5a be 200de30 200dccc: b2 00 40 19 add %g1, %i1, %i1 if ( !p1 ) return 0; p[ triply ] = (block_p) p1; } p2 = (block_p *)p1[ doubly ]; 200dcd0: bb 2f 60 02 sll %i5, 2, %i5 200dcd4: d0 00 80 1d ld [ %g2 + %i5 ], %o0 if ( !p2 ) { 200dcd8: 80 a2 20 00 cmp %o0, 0 200dcdc: 02 80 00 47 be 200ddf8 200dce0: ba 00 80 1d add %g2, %i5, %i5 p2 = memfile_alloc_block(); if ( !p2 ) return 0; p1[ doubly ] = (block_p) p2; } return (block_p *)&p2[ singly ]; 200dce4: b1 2c 20 02 sll %l0, 2, %i0 200dce8: 81 c7 e0 08 ret 200dcec: 91 ea 00 18 restore %o0, %i0, %o0 /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; 200dcf0: b2 26 40 1d sub %i1, %i5, %i1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 200dcf4: 92 10 00 1d mov %i5, %o1 200dcf8: 40 00 2b 55 call 2018a4c <.urem> 200dcfc: 90 10 00 19 mov %i1, %o0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 200dd00: 92 10 00 1d mov %i5, %o1 */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 200dd04: b6 10 00 08 mov %o0, %i3 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 200dd08: 40 00 2a a5 call 201879c <.udiv> 200dd0c: 90 10 00 19 mov %i1, %o0 p = info->doubly_indirect; 200dd10: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 if ( malloc_it ) { 200dd14: 80 a6 a0 00 cmp %i2, 0 200dd18: 02 80 00 26 be 200ddb0 200dd1c: ba 10 00 08 mov %o0, %i5 if ( !p ) { 200dd20: 80 a0 60 00 cmp %g1, 0 200dd24: 02 80 00 3c be 200de14 200dd28: 01 00 00 00 nop if ( !p ) return 0; info->doubly_indirect = p; } p1 = (block_p *)p[ doubly ]; 200dd2c: bb 2f 60 02 sll %i5, 2, %i5 200dd30: d0 00 40 1d ld [ %g1 + %i5 ], %o0 if ( !p1 ) { 200dd34: 80 a2 20 00 cmp %o0, 0 200dd38: 02 80 00 29 be 200dddc 200dd3c: ba 00 40 1d add %g1, %i5, %i5 if ( !p1 ) return 0; p[ doubly ] = (block_p) p1; } return (block_p *)&p1[ singly ]; 200dd40: b1 2e e0 02 sll %i3, 2, %i0 200dd44: 81 c7 e0 08 ret 200dd48: 91 ea 00 18 restore %o0, %i0, %o0 if ( my_block <= LAST_INDIRECT ) { p = info->indirect; if ( malloc_it ) { if ( !p ) { 200dd4c: 80 a2 20 00 cmp %o0, 0 200dd50: 32 bf ff b5 bne,a 200dc24 200dd54: b3 2e 60 02 sll %i1, 2, %i1 p = memfile_alloc_block(); 200dd58: 7f ff ff 97 call 200dbb4 200dd5c: b0 10 20 00 clr %i0 if ( !p ) 200dd60: 80 a2 20 00 cmp %o0, 0 200dd64: 02 80 00 11 be 200dda8 <== NEVER TAKEN 200dd68: 01 00 00 00 nop return 0; info->indirect = p; 200dd6c: 10 bf ff ad b 200dc20 200dd70: d0 27 20 58 st %o0, [ %i4 + 0x58 ] p1[ doubly ] = (block_p) p2; } return (block_p *)&p2[ singly ]; } if ( !p ) 200dd74: 80 a0 60 00 cmp %g1, 0 200dd78: 02 80 00 0c be 200dda8 <== NEVER TAKEN 200dd7c: b3 2e 60 02 sll %i1, 2, %i1 return 0; p1 = (block_p *) p[ triply ]; 200dd80: c2 00 40 19 ld [ %g1 + %i1 ], %g1 if ( !p1 ) 200dd84: 80 a0 60 00 cmp %g1, 0 200dd88: 02 80 00 08 be 200dda8 <== NEVER TAKEN 200dd8c: bb 2a 20 02 sll %o0, 2, %i5 return 0; p2 = (block_p *)p1[ doubly ]; 200dd90: c2 00 40 1d ld [ %g1 + %i5 ], %g1 if ( !p2 ) 200dd94: 80 a0 60 00 cmp %g1, 0 200dd98: 02 80 00 04 be 200dda8 <== NEVER TAKEN 200dd9c: 01 00 00 00 nop return 0; return (block_p *)&p2[ singly ]; 200dda0: b1 2c 20 02 sll %l0, 2, %i0 200dda4: b0 00 40 18 add %g1, %i0, %i0 /* * This means the requested block number is out of range. */ return 0; } 200dda8: 81 c7 e0 08 ret 200ddac: 81 e8 00 00 restore } return (block_p *)&p1[ singly ]; } if ( !p ) 200ddb0: 80 a0 60 00 cmp %g1, 0 200ddb4: 02 bf ff fd be 200dda8 <== NEVER TAKEN 200ddb8: b0 10 20 00 clr %i0 return 0; p = (block_p *)p[ doubly ]; 200ddbc: bb 2a 20 02 sll %o0, 2, %i5 200ddc0: c2 00 40 1d ld [ %g1 + %i5 ], %g1 if ( !p ) 200ddc4: 80 a0 60 00 cmp %g1, 0 200ddc8: 02 bf ff f8 be 200dda8 <== NEVER TAKEN 200ddcc: 01 00 00 00 nop return 0; return (block_p *)&p[ singly ]; 200ddd0: b1 2e e0 02 sll %i3, 2, %i0 200ddd4: 81 c7 e0 08 ret 200ddd8: 91 e8 40 18 restore %g1, %i0, %o0 info->doubly_indirect = p; } p1 = (block_p *)p[ doubly ]; if ( !p1 ) { p1 = memfile_alloc_block(); 200dddc: 7f ff ff 76 call 200dbb4 200dde0: b0 10 20 00 clr %i0 if ( !p1 ) 200dde4: 80 a2 20 00 cmp %o0, 0 200dde8: 02 bf ff f0 be 200dda8 <== NEVER TAKEN 200ddec: 01 00 00 00 nop return 0; p[ doubly ] = (block_p) p1; 200ddf0: 10 bf ff d4 b 200dd40 200ddf4: d0 27 40 00 st %o0, [ %i5 ] p[ triply ] = (block_p) p1; } p2 = (block_p *)p1[ doubly ]; if ( !p2 ) { p2 = memfile_alloc_block(); 200ddf8: 7f ff ff 6f call 200dbb4 200ddfc: b0 10 20 00 clr %i0 if ( !p2 ) 200de00: 80 a2 20 00 cmp %o0, 0 200de04: 02 bf ff e9 be 200dda8 <== NEVER TAKEN 200de08: 01 00 00 00 nop return 0; p1[ doubly ] = (block_p) p2; 200de0c: 10 bf ff b6 b 200dce4 200de10: d0 27 40 00 st %o0, [ %i5 ] p = info->doubly_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); 200de14: 7f ff ff 68 call 200dbb4 200de18: b0 10 20 00 clr %i0 if ( !p ) 200de1c: 80 a2 20 00 cmp %o0, 0 200de20: 02 bf ff e2 be 200dda8 <== NEVER TAKEN 200de24: 82 10 00 08 mov %o0, %g1 return 0; info->doubly_indirect = p; 200de28: 10 bf ff c1 b 200dd2c 200de2c: d0 27 20 5c st %o0, [ %i4 + 0x5c ] info->triply_indirect = p; } p1 = (block_p *) p[ triply ]; if ( !p1 ) { p1 = memfile_alloc_block(); 200de30: 7f ff ff 61 call 200dbb4 200de34: b0 10 20 00 clr %i0 if ( !p1 ) 200de38: 80 a2 20 00 cmp %o0, 0 200de3c: 02 bf ff db be 200dda8 <== NEVER TAKEN 200de40: 84 10 00 08 mov %o0, %g2 return 0; p[ triply ] = (block_p) p1; 200de44: 10 bf ff a3 b 200dcd0 200de48: d0 26 40 00 st %o0, [ %i1 ] p = info->triply_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); 200de4c: 7f ff ff 5a call 200dbb4 200de50: 01 00 00 00 nop if ( !p ) 200de54: 82 92 20 00 orcc %o0, 0, %g1 200de58: 02 bf ff d4 be 200dda8 <== NEVER TAKEN 200de5c: 01 00 00 00 nop return 0; info->triply_indirect = p; 200de60: 10 bf ff 97 b 200dcbc 200de64: c2 27 20 60 st %g1, [ %i4 + 0x60 ] =============================================================================== 0200de68 : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 200de68: 9d e3 bf 98 save %sp, -104, %sp * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; if (the_jnode->type == IMFS_LINEAR_FILE) { 200de6c: c2 06 20 4c ld [ %i0 + 0x4c ], %g1 IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 200de70: ba 10 00 18 mov %i0, %i5 200de74: a0 10 00 19 mov %i1, %l0 * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; if (the_jnode->type == IMFS_LINEAR_FILE) { 200de78: 80 a0 60 06 cmp %g1, 6 200de7c: 02 80 00 64 be 200e00c 200de80: a2 10 00 1a mov %i2, %l1 /* * If the last byte we are supposed to read is past the end of this * in memory file, then shorten the length to read. */ last_byte = start + length; if ( last_byte > the_jnode->info.file.size ) 200de84: c4 06 20 50 ld [ %i0 + 0x50 ], %g2 /* * 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; 200de88: 82 10 00 1a mov %i2, %g1 if ( last_byte > the_jnode->info.file.size ) 200de8c: 86 10 20 00 clr %g3 200de90: c8 06 20 54 ld [ %i0 + 0x54 ], %g4 200de94: 80 a0 c0 02 cmp %g3, %g2 200de98: 04 80 00 41 ble 200df9c <== ALWAYS TAKEN 200de9c: b4 07 00 1a add %i4, %i2, %i2 my_length = the_jnode->info.file.size - start; 200dea0: b8 21 00 01 sub %g4, %g1, %i4 <== NOT EXECUTED */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 200dea4: 33 00 80 75 sethi %hi(0x201d400), %i1 <== NOT EXECUTED 200dea8: f4 06 60 f8 ld [ %i1 + 0xf8 ], %i2 ! 201d4f8 200deac: 90 10 00 10 mov %l0, %o0 200deb0: b1 3e a0 1f sra %i2, 0x1f, %i0 200deb4: 92 10 00 11 mov %l1, %o1 200deb8: 94 10 00 18 mov %i0, %o2 200debc: 40 00 2c 76 call 2019094 <__moddi3> 200dec0: 96 10 00 1a mov %i2, %o3 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 200dec4: 90 10 00 10 mov %l0, %o0 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 200dec8: a4 10 00 09 mov %o1, %l2 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 200decc: 94 10 00 18 mov %i0, %o2 200ded0: 92 10 00 11 mov %l1, %o1 200ded4: 40 00 2b 8a call 2018cfc <__divdi3> 200ded8: 96 10 00 1a mov %i2, %o3 unsigned int last_byte; unsigned int copied; unsigned int start_offset; unsigned char *dest; dest = destination; 200dedc: a2 10 00 1b mov %i3, %l1 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 200dee0: a0 10 00 09 mov %o1, %l0 if ( start_offset ) { 200dee4: 80 a4 a0 00 cmp %l2, 0 200dee8: 02 80 00 14 be 200df38 200deec: b0 10 20 00 clr %i0 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 ); 200def0: 90 10 00 1d mov %i5, %o0 200def4: 7f ff ff 3d call 200dbe8 200def8: 94 10 20 00 clr %o2 if ( !block_ptr ) 200defc: 80 a2 20 00 cmp %o0, 0 200df00: 02 80 00 25 be 200df94 <== NEVER TAKEN 200df04: b4 26 80 12 sub %i2, %l2, %i2 * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; 200df08: 80 a7 00 1a cmp %i4, %i2 200df0c: 18 80 00 53 bgu 200e058 200df10: b0 10 00 1c mov %i4, %i0 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 ); 200df14: d2 02 00 00 ld [ %o0 ], %o1 200df18: 94 10 00 18 mov %i0, %o2 200df1c: 90 10 00 1b mov %i3, %o0 200df20: 40 00 08 d8 call 2010280 200df24: 92 02 40 12 add %o1, %l2, %o1 dest += to_copy; block++; my_length -= to_copy; 200df28: f4 06 60 f8 ld [ %i1 + 0xf8 ], %i2 to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); dest += to_copy; 200df2c: a2 06 c0 18 add %i3, %i0, %l1 block++; 200df30: a0 04 20 01 inc %l0 my_length -= to_copy; 200df34: b8 27 00 18 sub %i4, %i0, %i4 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 200df38: 80 a7 00 1a cmp %i4, %i2 200df3c: 1a 80 00 0e bcc 200df74 200df40: 94 10 20 00 clr %o2 /* * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { 200df44: 10 80 00 1e b 200dfbc 200df48: 80 a7 20 00 cmp %i4, 0 to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 200df4c: d2 00 40 00 ld [ %g1 ], %o1 200df50: 40 00 08 cc call 2010280 200df54: b8 27 00 1a sub %i4, %i2, %i4 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 200df58: c2 06 60 f8 ld [ %i1 + 0xf8 ], %g1 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); dest += to_copy; 200df5c: a2 04 40 1a add %l1, %i2, %l1 block++; 200df60: a0 04 20 01 inc %l0 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 200df64: 80 a0 40 1c cmp %g1, %i4 200df68: 18 80 00 14 bgu 200dfb8 200df6c: b0 06 00 1a add %i0, %i2, %i0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 200df70: 94 10 20 00 clr %o2 200df74: 92 10 00 10 mov %l0, %o1 200df78: 7f ff ff 1c call 200dbe8 200df7c: 90 10 00 1d mov %i5, %o0 if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 200df80: 94 10 00 1a mov %i2, %o2 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 200df84: 82 10 00 08 mov %o0, %g1 if ( !block_ptr ) 200df88: 80 a0 60 00 cmp %g1, 0 200df8c: 12 bf ff f0 bne 200df4c <== ALWAYS TAKEN 200df90: 90 10 00 11 mov %l1, %o0 } IMFS_update_atime( the_jnode ); return copied; } 200df94: 81 c7 e0 08 ret <== NOT EXECUTED 200df98: 81 e8 00 00 restore <== NOT EXECUTED /* * If the last byte we are supposed to read is past the end of this * in memory file, then shorten the length to read. */ last_byte = start + length; if ( last_byte > the_jnode->info.file.size ) 200df9c: 12 bf ff c3 bne 200dea8 <== NEVER TAKEN 200dfa0: 33 00 80 75 sethi %hi(0x201d400), %i1 200dfa4: 80 a6 80 04 cmp %i2, %g4 200dfa8: 08 bf ff c1 bleu 200deac 200dfac: f4 06 60 f8 ld [ %i1 + 0xf8 ], %i2 my_length = the_jnode->info.file.size - start; 200dfb0: 10 bf ff be b 200dea8 200dfb4: b8 21 00 01 sub %g4, %g1, %i4 /* * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { 200dfb8: 80 a7 20 00 cmp %i4, 0 200dfbc: 02 80 00 0e be 200dff4 200dfc0: 90 07 bf f8 add %fp, -8, %o0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 200dfc4: 90 10 00 1d mov %i5, %o0 200dfc8: 92 10 00 10 mov %l0, %o1 200dfcc: 7f ff ff 07 call 200dbe8 200dfd0: 94 10 20 00 clr %o2 if ( !block_ptr ) 200dfd4: 80 a2 20 00 cmp %o0, 0 200dfd8: 02 bf ff ef be 200df94 <== NEVER TAKEN 200dfdc: 94 10 00 1c mov %i4, %o2 return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); 200dfe0: d2 02 00 00 ld [ %o0 ], %o1 200dfe4: 90 10 00 11 mov %l1, %o0 200dfe8: 40 00 08 a6 call 2010280 200dfec: b0 06 00 1c add %i0, %i4, %i0 copied += my_length; } IMFS_update_atime( the_jnode ); 200dff0: 90 07 bf f8 add %fp, -8, %o0 200dff4: 7f ff d3 da call 2002f5c 200dff8: 92 10 20 00 clr %o1 200dffc: c2 07 bf f8 ld [ %fp + -8 ], %g1 200e000: c2 27 60 40 st %g1, [ %i5 + 0x40 ] return copied; } 200e004: 81 c7 e0 08 ret 200e008: 81 e8 00 00 restore if (the_jnode->type == IMFS_LINEAR_FILE) { unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) 200e00c: d8 1e 20 50 ldd [ %i0 + 0x50 ], %o4 200e010: 82 10 20 00 clr %g1 200e014: 86 a3 40 1a subcc %o5, %i2, %g3 200e018: 84 63 00 19 subx %o4, %i1, %g2 200e01c: 80 a0 40 02 cmp %g1, %g2 200e020: 04 80 00 10 ble 200e060 <== ALWAYS TAKEN 200e024: d2 06 20 58 ld [ %i0 + 0x58 ], %o1 my_length = the_jnode->info.linearfile.size - start; 200e028: b0 23 40 11 sub %o5, %l1, %i0 <== NOT EXECUTED memcpy(dest, &file_ptr[start], my_length); 200e02c: 92 02 40 11 add %o1, %l1, %o1 200e030: 94 10 00 18 mov %i0, %o2 200e034: 40 00 08 93 call 2010280 200e038: 90 10 00 1b mov %i3, %o0 IMFS_update_atime( the_jnode ); 200e03c: 90 07 bf f8 add %fp, -8, %o0 200e040: 7f ff d3 c7 call 2002f5c 200e044: 92 10 20 00 clr %o1 200e048: c2 07 bf f8 ld [ %fp + -8 ], %g1 200e04c: c2 27 60 40 st %g1, [ %i5 + 0x40 ] return my_length; 200e050: 81 c7 e0 08 ret 200e054: 81 e8 00 00 restore * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; 200e058: 10 bf ff af b 200df14 200e05c: b0 10 00 1a mov %i2, %i0 if (the_jnode->type == IMFS_LINEAR_FILE) { unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) 200e060: 12 80 00 04 bne 200e070 <== NEVER TAKEN 200e064: 80 a7 00 03 cmp %i4, %g3 200e068: 38 bf ff f1 bgu,a 200e02c <== ALWAYS TAKEN 200e06c: b0 23 40 11 sub %o5, %l1, %i0 my_length = the_jnode->info.linearfile.size - start; memcpy(dest, &file_ptr[start], my_length); 200e070: 92 02 40 11 add %o1, %l1, %o1 <== NOT EXECUTED /* * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; 200e074: b0 10 00 1c mov %i4, %i0 <== NOT EXECUTED file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) my_length = the_jnode->info.linearfile.size - start; memcpy(dest, &file_ptr[start], my_length); 200e078: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED 200e07c: 40 00 08 81 call 2010280 <== NOT EXECUTED 200e080: 94 10 00 18 mov %i0, %o2 <== NOT EXECUTED IMFS_update_atime( the_jnode ); 200e084: 90 07 bf f8 add %fp, -8, %o0 <== NOT EXECUTED 200e088: 7f ff d3 b5 call 2002f5c <== NOT EXECUTED 200e08c: 92 10 20 00 clr %o1 <== NOT EXECUTED 200e090: c2 07 bf f8 ld [ %fp + -8 ], %g1 <== NOT EXECUTED 200e094: c2 27 60 40 st %g1, [ %i5 + 0x40 ] <== NOT EXECUTED return my_length; 200e098: 81 c7 e0 08 ret <== NOT EXECUTED 200e09c: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 0200e190 : * is better to stick to simple, easy to understand algorithms. */ int IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { 200e190: 9d e3 bf a0 save %sp, -96, %sp /* * 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; 200e194: 39 00 80 75 sethi %hi(0x201d400), %i4 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 200e198: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 /* * 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; 200e19c: f4 07 20 f8 ld [ %i4 + 0xf8 ], %i2 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 200e1a0: 80 a0 60 00 cmp %g1, 0 200e1a4: 02 80 00 05 be 200e1b8 200e1a8: b5 36 a0 02 srl %i2, 2, %i2 memfile_free_blocks_in_table( &info->indirect, to_free ); 200e1ac: 90 06 20 58 add %i0, 0x58, %o0 200e1b0: 7f ff ff e2 call 200e138 200e1b4: 92 10 00 1a mov %i2, %o1 } if ( info->doubly_indirect ) { 200e1b8: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 200e1bc: 80 a0 60 00 cmp %g1, 0 200e1c0: 02 80 00 1b be 200e22c 200e1c4: c4 07 20 f8 ld [ %i4 + 0xf8 ], %g2 for ( i=0 ; i <== NEVER TAKEN 200e1d4: 90 10 20 00 clr %o0 200e1d8: 37 00 80 75 sethi %hi(0x201d400), %i3 200e1dc: ba 10 20 00 clr %i5 200e1e0: 10 80 00 03 b 200e1ec 200e1e4: b6 16 e0 f8 or %i3, 0xf8, %i3 200e1e8: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 if ( info->doubly_indirect[i] ) { 200e1ec: 91 2a 20 02 sll %o0, 2, %o0 200e1f0: c4 00 40 08 ld [ %g1 + %o0 ], %g2 200e1f4: 80 a0 a0 00 cmp %g2, 0 200e1f8: 02 80 00 04 be 200e208 <== NEVER TAKEN 200e1fc: 90 00 40 08 add %g1, %o0, %o0 memfile_free_blocks_in_table( 200e200: 7f ff ff ce call 200e138 200e204: 92 10 00 1a mov %i2, %o1 if ( info->indirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; i 200e21c: 90 10 00 1d mov %i5, %o0 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 ); 200e220: 90 06 20 5c add %i0, 0x5c, %o0 200e224: 7f ff ff c5 call 200e138 200e228: 92 10 00 1a mov %i2, %o1 } if ( info->triply_indirect ) { 200e22c: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 200e230: 80 a2 20 00 cmp %o0, 0 200e234: 02 80 00 33 be 200e300 200e238: c2 07 20 f8 ld [ %i4 + 0xf8 ], %g1 for ( i=0 ; i <== NEVER TAKEN 200e248: 90 06 20 60 add %i0, 0x60, %o0 <== NOT EXECUTED p = (block_p *) info->triply_indirect[i]; 200e24c: f8 02 00 00 ld [ %o0 ], %i4 if ( !p ) /* ensure we have a valid pointer */ 200e250: 80 a7 20 00 cmp %i4, 0 200e254: 22 80 00 29 be,a 200e2f8 <== NEVER TAKEN 200e258: 90 06 20 60 add %i0, 0x60, %o0 <== NOT EXECUTED 200e25c: 37 00 80 75 sethi %hi(0x201d400), %i3 } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; 200e260: a0 10 20 00 clr %l0 if ( !p ) /* ensure we have a valid pointer */ 200e264: b2 10 20 00 clr %i1 200e268: b6 16 e0 f8 or %i3, 0xf8, %i3 break; for ( j=0 ; j <== NEVER TAKEN 200e274: 90 02 00 10 add %o0, %l0, %o0 <== NOT EXECUTED 200e278: 90 10 20 00 clr %o0 200e27c: ba 10 20 00 clr %i5 if ( p[j] ) { 200e280: 91 2a 20 02 sll %o0, 2, %o0 200e284: c2 07 00 08 ld [ %i4 + %o0 ], %g1 200e288: 80 a0 60 00 cmp %g1, 0 200e28c: 02 80 00 04 be 200e29c <== NEVER TAKEN 200e290: 90 07 00 08 add %i4, %o0, %o0 memfile_free_blocks_in_table( (block_p **)&p[j], to_free); 200e294: 7f ff ff a9 call 200e138 200e298: 92 10 00 1a mov %i2, %o1 if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j 200e2b0: 90 10 00 1d mov %i5, %o0 200e2b4: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 if ( p[j] ) { memfile_free_blocks_in_table( (block_p **)&p[j], to_free); } } memfile_free_blocks_in_table( 200e2b8: 90 02 00 10 add %o0, %l0, %o0 200e2bc: 7f ff ff 9f call 200e138 200e2c0: 92 10 00 1a mov %i2, %o1 memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i 200e2d8: 90 06 20 60 add %i0, 0x60, %o0 p = (block_p *) info->triply_indirect[i]; 200e2dc: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 * a significant difference in the performance of this routine. * * Regardless until the IMFS implementation is proven, it * is better to stick to simple, easy to understand algorithms. */ int IMFS_memfile_remove( 200e2e0: a1 2e 60 02 sll %i1, 2, %l0 } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; 200e2e4: f8 02 00 10 ld [ %o0 + %l0 ], %i4 if ( !p ) /* ensure we have a valid pointer */ 200e2e8: 80 a7 20 00 cmp %i4, 0 200e2ec: 12 bf ff e1 bne 200e270 <== ALWAYS TAKEN 200e2f0: 80 a0 60 00 cmp %g1, 0 } } memfile_free_blocks_in_table( (block_p **)&info->triply_indirect[i], to_free ); } memfile_free_blocks_in_table( 200e2f4: 90 06 20 60 add %i0, 0x60, %o0 <== NOT EXECUTED 200e2f8: 7f ff ff 90 call 200e138 200e2fc: 92 10 00 1a mov %i2, %o1 (block_p **)&info->triply_indirect, to_free ); } return 0; } 200e300: 81 c7 e0 08 ret 200e304: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 0200e47c : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 200e47c: 9d e3 bf 98 save %sp, -104, %sp * If the last byte we are supposed to write is past the end of this * in memory file, then extend the length. */ last_byte = start + my_length; if ( last_byte > the_jnode->info.file.size ) { 200e480: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 200e484: ba 10 00 18 mov %i0, %i5 * If the last byte we are supposed to write is past the end of this * in memory file, then extend the length. */ last_byte = start + my_length; if ( last_byte > the_jnode->info.file.size ) { 200e488: 80 a0 60 00 cmp %g1, 0 200e48c: 06 80 00 5c bl 200e5fc <== NEVER TAKEN 200e490: 94 07 00 1a add %i4, %i2, %o2 200e494: 80 a0 60 00 cmp %g1, 0 200e498: 22 80 00 56 be,a 200e5f0 <== ALWAYS TAKEN 200e49c: c2 06 20 54 ld [ %i0 + 0x54 ], %g1 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 200e4a0: 23 00 80 75 sethi %hi(0x201d400), %l1 <== NOT EXECUTED 200e4a4: e0 04 60 f8 ld [ %l1 + 0xf8 ], %l0 ! 201d4f8 200e4a8: 92 10 00 1a mov %i2, %o1 200e4ac: b1 3c 20 1f sra %l0, 0x1f, %i0 200e4b0: 96 10 00 10 mov %l0, %o3 200e4b4: 94 10 00 18 mov %i0, %o2 200e4b8: 40 00 2a f7 call 2019094 <__moddi3> 200e4bc: 90 10 00 19 mov %i1, %o0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 200e4c0: 94 10 00 18 mov %i0, %o2 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 200e4c4: a4 10 00 09 mov %o1, %l2 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 200e4c8: 90 10 00 19 mov %i1, %o0 200e4cc: 92 10 00 1a mov %i2, %o1 200e4d0: 40 00 2a 0b call 2018cfc <__divdi3> 200e4d4: 96 10 00 10 mov %l0, %o3 status = IMFS_memfile_extend( the_jnode, last_byte ); if ( status ) rtems_set_errno_and_return_minus_one( ENOSPC ); } copied = 0; 200e4d8: b0 10 20 00 clr %i0 /* * 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 ) { 200e4dc: 80 a4 a0 00 cmp %l2, 0 200e4e0: 12 80 00 1a bne 200e548 200e4e4: b4 10 00 09 mov %o1, %i2 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 200e4e8: 80 a7 00 10 cmp %i4, %l0 200e4ec: 1a 80 00 0e bcc 200e524 200e4f0: 92 10 00 1a mov %i2, %o1 * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); to_copy = my_length; if ( my_length ) { 200e4f4: 10 80 00 2a b 200e59c 200e4f8: 80 a7 20 00 cmp %i4, 0 if ( !block_ptr ) return copied; #if 0 fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src ); #endif memcpy( &(*block_ptr)[ 0 ], src, to_copy ); 200e4fc: d0 02 00 00 ld [ %o0 ], %o0 200e500: 40 00 07 60 call 2010280 200e504: b8 27 00 10 sub %i4, %l0, %i4 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 200e508: c2 04 60 f8 ld [ %l1 + 0xf8 ], %g1 return copied; #if 0 fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src ); #endif memcpy( &(*block_ptr)[ 0 ], src, to_copy ); src += to_copy; 200e50c: b6 06 c0 10 add %i3, %l0, %i3 block++; 200e510: b4 06 a0 01 inc %i2 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 200e514: 80 a0 40 1c cmp %g1, %i4 200e518: 18 80 00 20 bgu 200e598 200e51c: b0 06 00 10 add %i0, %l0, %i0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 200e520: 92 10 00 1a mov %i2, %o1 200e524: 94 10 20 00 clr %o2 200e528: 7f ff fd b0 call 200dbe8 200e52c: 90 10 00 1d mov %i5, %o0 if ( !block_ptr ) return copied; #if 0 fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src ); #endif memcpy( &(*block_ptr)[ 0 ], src, to_copy ); 200e530: 92 10 00 1b mov %i3, %o1 */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) 200e534: 80 a2 20 00 cmp %o0, 0 200e538: 12 bf ff f1 bne 200e4fc <== ALWAYS TAKEN 200e53c: 94 10 00 10 mov %l0, %o2 } IMFS_mtime_ctime_update( the_jnode ); return copied; } 200e540: 81 c7 e0 08 ret <== NOT EXECUTED 200e544: 81 e8 00 00 restore <== NOT EXECUTED block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 200e548: 90 10 00 1d mov %i5, %o0 200e54c: 94 10 20 00 clr %o2 200e550: 7f ff fd a6 call 200dbe8 200e554: b0 10 20 00 clr %i0 if ( !block_ptr ) 200e558: 80 a2 20 00 cmp %o0, 0 200e55c: 02 80 00 32 be 200e624 <== NEVER TAKEN 200e560: 01 00 00 00 nop * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; 200e564: b0 24 00 12 sub %l0, %l2, %i0 200e568: 80 a6 00 1c cmp %i0, %i4 200e56c: 18 80 00 30 bgu 200e62c 200e570: d0 02 00 00 ld [ %o0 ], %o0 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); 200e574: 92 10 00 1b mov %i3, %o1 200e578: 90 02 00 12 add %o0, %l2, %o0 200e57c: 94 10 00 18 mov %i0, %o2 200e580: 40 00 07 40 call 2010280 200e584: b6 06 c0 18 add %i3, %i0, %i3 src += to_copy; block++; 200e588: b4 06 a0 01 inc %i2 my_length -= to_copy; 200e58c: b8 27 00 18 sub %i4, %i0, %i4 copied += to_copy; 200e590: 10 bf ff d6 b 200e4e8 200e594: e0 04 60 f8 ld [ %l1 + 0xf8 ], %l0 * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); to_copy = my_length; if ( my_length ) { 200e598: 80 a7 20 00 cmp %i4, 0 200e59c: 02 80 00 0e be 200e5d4 200e5a0: 90 07 bf f8 add %fp, -8, %o0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 200e5a4: 90 10 00 1d mov %i5, %o0 200e5a8: 92 10 00 1a mov %i2, %o1 200e5ac: 7f ff fd 8f call 200dbe8 200e5b0: 94 10 20 00 clr %o2 if ( !block_ptr ) 200e5b4: 80 a2 20 00 cmp %o0, 0 200e5b8: 02 bf ff e2 be 200e540 <== NEVER TAKEN 200e5bc: 92 10 00 1b mov %i3, %o1 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 ); 200e5c0: d0 02 00 00 ld [ %o0 ], %o0 200e5c4: 94 10 00 1c mov %i4, %o2 200e5c8: 40 00 07 2e call 2010280 200e5cc: b0 06 00 1c add %i0, %i4, %i0 my_length = 0; copied += to_copy; } IMFS_mtime_ctime_update( the_jnode ); 200e5d0: 90 07 bf f8 add %fp, -8, %o0 200e5d4: 7f ff d2 62 call 2002f5c 200e5d8: 92 10 20 00 clr %o1 200e5dc: c2 07 bf f8 ld [ %fp + -8 ], %g1 200e5e0: c2 27 60 44 st %g1, [ %i5 + 0x44 ] 200e5e4: c2 27 60 48 st %g1, [ %i5 + 0x48 ] return copied; } 200e5e8: 81 c7 e0 08 ret 200e5ec: 81 e8 00 00 restore * If the last byte we are supposed to write is past the end of this * in memory file, then extend the length. */ last_byte = start + my_length; if ( last_byte > the_jnode->info.file.size ) { 200e5f0: 80 a0 40 0a cmp %g1, %o2 200e5f4: 1a bf ff ac bcc 200e4a4 <== NEVER TAKEN 200e5f8: 23 00 80 75 sethi %hi(0x201d400), %l1 status = IMFS_memfile_extend( the_jnode, last_byte ); 200e5fc: 90 10 00 1d mov %i5, %o0 200e600: 7f ff ff 4e call 200e338 200e604: 92 10 20 00 clr %o1 if ( status ) 200e608: 80 a2 20 00 cmp %o0, 0 200e60c: 02 bf ff a6 be 200e4a4 200e610: 23 00 80 75 sethi %hi(0x201d400), %l1 rtems_set_errno_and_return_minus_one( ENOSPC ); 200e614: 40 00 04 c6 call 200f92c <__errno> 200e618: b0 10 3f ff mov -1, %i0 200e61c: 82 10 20 1c mov 0x1c, %g1 200e620: c2 22 00 00 st %g1, [ %o0 ] 200e624: 81 c7 e0 08 ret 200e628: 81 e8 00 00 restore * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; 200e62c: b0 10 00 1c mov %i4, %i0 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); 200e630: 92 10 00 1b mov %i3, %o1 200e634: 90 02 00 12 add %o0, %l2, %o0 200e638: 94 10 00 18 mov %i0, %o2 200e63c: 40 00 07 11 call 2010280 200e640: b6 06 c0 18 add %i3, %i0, %i3 src += to_copy; block++; 200e644: b4 06 a0 01 inc %i2 my_length -= to_copy; 200e648: b8 27 00 18 sub %i4, %i0, %i4 copied += to_copy; 200e64c: 10 bf ff a7 b 200e4e8 200e650: e0 04 60 f8 ld [ %l1 + 0xf8 ], %l0 =============================================================================== 02002488 : const char *token, /* IN */ mode_t mode, /* IN */ dev_t dev, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { 2002488: 9d e3 bf 58 save %sp, -168, %sp 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 ); 200248c: 40 00 3a b7 call 2010f68 2002490: 90 10 00 18 mov %i0, %o0 2002494: 96 07 bf fc add %fp, -4, %o3 2002498: 92 10 00 08 mov %o0, %o1 200249c: 94 07 bf b8 add %fp, -72, %o2 20024a0: 40 00 25 36 call 200b978 20024a4: 90 10 00 18 mov %i0, %o0 /* * Figure out what type of IMFS node this is. */ if ( S_ISDIR(mode) ) 20024a8: 03 00 00 3c sethi %hi(0xf000), %g1 20024ac: 05 00 00 10 sethi %hi(0x4000), %g2 20024b0: 82 0e 40 01 and %i1, %g1, %g1 const char *token, /* IN */ mode_t mode, /* IN */ dev_t dev, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { 20024b4: 96 10 00 19 mov %i1, %o3 20024b8: 90 10 00 1c mov %i4, %o0 IMFS_get_token( token, strlen( token ), new_name, &result ); /* * Figure out what type of IMFS node this is. */ if ( S_ISDIR(mode) ) 20024bc: 80 a0 40 02 cmp %g1, %g2 20024c0: 02 80 00 0c be 20024f0 20024c4: 92 10 20 01 mov 1, %o1 type = IMFS_DIRECTORY; else if ( S_ISREG(mode) ) 20024c8: 05 00 00 20 sethi %hi(0x8000), %g2 20024cc: 80 a0 40 02 cmp %g1, %g2 20024d0: 02 80 00 08 be 20024f0 20024d4: 92 10 20 05 mov 5, %o1 type = IMFS_MEMORY_FILE; else if ( S_ISBLK(mode) || S_ISCHR(mode) ) { 20024d8: 05 00 00 08 sethi %hi(0x2000), %g2 20024dc: 80 a0 40 02 cmp %g1, %g2 20024e0: 12 80 00 0d bne 2002514 20024e4: 05 00 00 18 sethi %hi(0x6000), %g2 type = IMFS_DEVICE; rtems_filesystem_split_dev_t( dev, info.device.major, info.device.minor ); 20024e8: f4 3f bf e0 std %i2, [ %fp + -32 ] 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; 20024ec: 92 10 20 02 mov 2, %o1 * 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( pathloc, type, new_name, mode, &info ); 20024f0: 94 07 bf b8 add %fp, -72, %o2 20024f4: 98 07 bf e0 add %fp, -32, %o4 20024f8: 40 00 21 a3 call 200ab84 20024fc: b0 10 20 00 clr %i0 if ( !new_node ) 2002500: 80 a2 20 00 cmp %o0, 0 2002504: 02 80 00 13 be 2002550 <== NEVER TAKEN 2002508: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOMEM ); return 0; } 200250c: 81 c7 e0 08 ret 2002510: 81 e8 00 00 restore */ if ( S_ISDIR(mode) ) type = IMFS_DIRECTORY; else if ( S_ISREG(mode) ) type = IMFS_MEMORY_FILE; else if ( S_ISBLK(mode) || S_ISCHR(mode) ) { 2002514: 80 a0 40 02 cmp %g1, %g2 2002518: 22 bf ff f5 be,a 20024ec 200251c: f4 3f bf e0 std %i2, [ %fp + -32 ] type = IMFS_DEVICE; rtems_filesystem_split_dev_t( dev, info.device.major, info.device.minor ); } else if (S_ISFIFO(mode)) 2002520: 05 00 00 04 sethi %hi(0x1000), %g2 mode_t mode, /* IN */ dev_t dev, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { IMFS_token_types type = 0; 2002524: 82 18 40 02 xor %g1, %g2, %g1 2002528: 80 a0 00 01 cmp %g0, %g1 * 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( pathloc, type, new_name, mode, &info ); 200252c: 94 07 bf b8 add %fp, -72, %o2 mode_t mode, /* IN */ dev_t dev, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { IMFS_token_types type = 0; 2002530: 92 40 3f ff addx %g0, -1, %o1 * 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( pathloc, type, new_name, mode, &info ); 2002534: 98 07 bf e0 add %fp, -32, %o4 mode_t mode, /* IN */ dev_t dev, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { IMFS_token_types type = 0; 2002538: 92 0a 60 07 and %o1, 7, %o1 * 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( pathloc, type, new_name, mode, &info ); 200253c: 40 00 21 92 call 200ab84 2002540: b0 10 20 00 clr %i0 if ( !new_node ) 2002544: 80 a2 20 00 cmp %o0, 0 2002548: 12 80 00 06 bne 2002560 200254c: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOMEM ); 2002550: 40 00 34 f7 call 200f92c <__errno> 2002554: b0 10 3f ff mov -1, %i0 ! ffffffff 2002558: 82 10 20 0c mov 0xc, %g1 200255c: c2 22 00 00 st %g1, [ %o0 ] return 0; } 2002560: 81 c7 e0 08 ret 2002564: 81 e8 00 00 restore =============================================================================== 02002568 : #include int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 2002568: 9d e3 bf a0 save %sp, -96, %sp IMFS_jnode_t *node; node = mt_entry->mt_point_node.node_access; 200256c: c2 06 20 08 ld [ %i0 + 8 ], %g1 /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) 2002570: c4 00 60 4c ld [ %g1 + 0x4c ], %g2 2002574: 80 a0 a0 01 cmp %g2, 1 2002578: 12 80 00 05 bne 200258c <== NEVER TAKEN 200257c: 01 00 00 00 nop /* * Set mt_fs pointer to point to the mount table entry for * the mounted file system. */ node->info.directory.mt_fs = mt_entry; 2002580: f0 20 60 5c st %i0, [ %g1 + 0x5c ] return 0; } 2002584: 81 c7 e0 08 ret 2002588: 91 e8 20 00 restore %g0, 0, %o0 /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) rtems_set_errno_and_return_minus_one( ENOTDIR ); 200258c: 40 00 34 e8 call 200f92c <__errno> <== NOT EXECUTED 2002590: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 2002594: 82 10 20 14 mov 0x14, %g1 <== NOT EXECUTED 2002598: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 200259c: 81 c7 e0 08 ret <== NOT EXECUTED 20025a0: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 02004ff8 : * This routine prints the contents of the specified jnode. */ void IMFS_print_jnode( IMFS_jnode_t *the_jnode ) { 2004ff8: 9d e3 bf a0 save %sp, -96, %sp IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); 2004ffc: 3b 00 80 9c sethi %hi(0x2027000), %i5 2005000: c2 07 62 28 ld [ %i5 + 0x228 ], %g1 ! 2027228 <_impure_ptr> 2005004: 90 06 20 0c add %i0, 0xc, %o0 2005008: 40 00 3d 0b call 2014434 200500c: d2 00 60 08 ld [ %g1 + 8 ], %o1 switch( the_jnode->type ) { 2005010: f4 06 20 4c ld [ %i0 + 0x4c ], %i2 2005014: 80 a6 a0 07 cmp %i2, 7 2005018: 08 80 00 07 bleu 2005034 <== ALWAYS TAKEN 200501c: 83 2e a0 02 sll %i2, 2, %g1 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", the_jnode->type ); 2005020: c2 07 62 28 ld [ %i5 + 0x228 ], %g1 <== NOT EXECUTED 2005024: 33 00 80 94 sethi %hi(0x2025000), %i1 <== NOT EXECUTED 2005028: f0 00 60 08 ld [ %g1 + 8 ], %i0 <== NOT EXECUTED 200502c: 40 00 3c b1 call 20142f0 <== NOT EXECUTED 2005030: 93 ee 62 90 restore %i1, 0x290, %o1 <== NOT EXECUTED ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( the_jnode->type ) { 2005034: 05 00 80 13 sethi %hi(0x2004c00), %g2 2005038: 84 10 a3 d8 or %g2, 0x3d8, %g2 ! 2004fd8 200503c: c2 00 80 01 ld [ %g2 + %g1 ], %g1 2005040: 81 c0 40 00 jmp %g1 2005044: 01 00 00 00 nop case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 2005048: c2 07 62 28 ld [ %i5 + 0x228 ], %g1 200504c: 31 00 80 94 sethi %hi(0x2025000), %i0 2005050: f6 00 60 08 ld [ %g1 + 8 ], %i3 2005054: b0 16 22 60 or %i0, 0x260, %i0 2005058: b2 10 20 01 mov 1, %i1 200505c: 40 00 40 1c call 20150cc 2005060: 95 e8 20 13 restore %g0, 0x13, %o2 return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 2005064: c2 07 62 28 ld [ %i5 + 0x228 ], %g1 2005068: 31 00 80 94 sethi %hi(0x2025000), %i0 200506c: f6 00 60 08 ld [ %g1 + 8 ], %i3 2005070: b0 16 22 78 or %i0, 0x278, %i0 2005074: b2 10 20 01 mov 1, %i1 2005078: 40 00 40 15 call 20150cc 200507c: 95 e8 20 12 restore %g0, 0x12, %o2 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 2005080: c2 07 62 28 ld [ %i5 + 0x228 ], %g1 2005084: d4 06 20 54 ld [ %i0 + 0x54 ], %o2 2005088: d0 00 60 08 ld [ %g1 + 8 ], %o0 200508c: 13 00 80 94 sethi %hi(0x2025000), %o1 2005090: 40 00 3c 98 call 20142f0 2005094: 92 12 62 50 or %o1, 0x250, %o1 ! 2025250 default: fprintf(stdout, " bad type %d\n", the_jnode->type ); return; } puts(""); 2005098: 31 00 80 94 sethi %hi(0x2025000), %i0 200509c: 40 00 44 08 call 20160bc 20050a0: 91 ee 21 d8 restore %i0, 0x1d8, %o0 fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", the_jnode->info.device.major, the_jnode->info.device.minor ); break; case IMFS_LINEAR_FILE: fprintf(stdout, " (file %" PRId32 " %p)", 20050a4: c2 07 62 28 ld [ %i5 + 0x228 ], %g1 20050a8: d4 06 20 54 ld [ %i0 + 0x54 ], %o2 20050ac: d6 06 20 58 ld [ %i0 + 0x58 ], %o3 20050b0: d0 00 60 08 ld [ %g1 + 8 ], %o0 20050b4: 13 00 80 94 sethi %hi(0x2025000), %o1 20050b8: 40 00 3c 8e call 20142f0 20050bc: 92 12 62 40 or %o1, 0x240, %o1 ! 2025240 default: fprintf(stdout, " bad type %d\n", the_jnode->type ); return; } puts(""); 20050c0: 31 00 80 94 sethi %hi(0x2025000), %i0 20050c4: 40 00 43 fe call 20160bc 20050c8: 91 ee 21 d8 restore %i0, 0x1d8, %o0 IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( the_jnode->type ) { case IMFS_DIRECTORY: fprintf(stdout, "/" ); 20050cc: c2 07 62 28 ld [ %i5 + 0x228 ], %g1 20050d0: 90 10 20 2f mov 0x2f, %o0 20050d4: d2 00 60 08 ld [ %g1 + 8 ], %o1 20050d8: 40 00 3c a2 call 2014360 20050dc: 31 00 80 94 sethi %hi(0x2025000), %i0 default: fprintf(stdout, " bad type %d\n", the_jnode->type ); return; } puts(""); 20050e0: 40 00 43 f7 call 20160bc 20050e4: 91 ee 21 d8 restore %i0, 0x1d8, %o0 case IMFS_DIRECTORY: fprintf(stdout, "/" ); break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 20050e8: c2 07 62 28 ld [ %i5 + 0x228 ], %g1 20050ec: d4 06 20 50 ld [ %i0 + 0x50 ], %o2 20050f0: d6 06 20 54 ld [ %i0 + 0x54 ], %o3 20050f4: d0 00 60 08 ld [ %g1 + 8 ], %o0 20050f8: 13 00 80 94 sethi %hi(0x2025000), %o1 20050fc: 40 00 3c 7d call 20142f0 2005100: 92 12 62 28 or %o1, 0x228, %o1 ! 2025228 default: fprintf(stdout, " bad type %d\n", the_jnode->type ); return; } puts(""); 2005104: 31 00 80 94 sethi %hi(0x2025000), %i0 2005108: 40 00 43 ed call 20160bc 200510c: 91 ee 21 d8 restore %i0, 0x1d8, %o0 =============================================================================== 020025b0 : ) { IMFS_jnode_t *node; ssize_t i; node = loc->node_access; 20025b0: c8 02 00 00 ld [ %o0 ], %g4 IMFS_assert( node->type == IMFS_SYM_LINK ); for( i=0; ((iinfo.sym_link.name[i] != '\0')); i++ ) 20025b4: 80 a2 a0 00 cmp %o2, 0 20025b8: 02 80 00 13 be 2002604 <== NEVER TAKEN 20025bc: 90 10 20 00 clr %o0 20025c0: c2 01 20 50 ld [ %g4 + 0x50 ], %g1 20025c4: c4 48 40 00 ldsb [ %g1 ], %g2 20025c8: 80 a0 a0 00 cmp %g2, 0 20025cc: 02 80 00 0e be 2002604 <== NEVER TAKEN 20025d0: c2 08 40 00 ldub [ %g1 ], %g1 20025d4: 10 80 00 07 b 20025f0 20025d8: 84 10 20 00 clr %g2 20025dc: c2 01 20 50 ld [ %g4 + 0x50 ], %g1 20025e0: c6 48 40 08 ldsb [ %g1 + %o0 ], %g3 20025e4: 80 a0 e0 00 cmp %g3, 0 20025e8: 02 80 00 07 be 2002604 20025ec: c2 08 40 08 ldub [ %g1 + %o0 ], %g1 buf[i] = node->info.sym_link.name[i]; 20025f0: c2 2a 40 02 stb %g1, [ %o1 + %g2 ] node = loc->node_access; IMFS_assert( node->type == IMFS_SYM_LINK ); for( i=0; ((iinfo.sym_link.name[i] != '\0')); i++ ) 20025f4: 90 02 20 01 inc %o0 20025f8: 80 a2 00 0a cmp %o0, %o2 20025fc: 12 bf ff f8 bne 20025dc 2002600: 84 10 00 08 mov %o0, %g2 buf[i] = node->info.sym_link.name[i]; return i; } 2002604: 81 c3 e0 08 retl =============================================================================== 0200260c : 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 */ ) { 200260c: 9d e3 bf 98 save %sp, -104, %sp IMFS_jnode_t *the_jnode; IMFS_jnode_t *new_parent; the_jnode = old_loc->node_access; 2002610: fa 06 40 00 ld [ %i1 ], %i5 strncpy( the_jnode->name, new_name, IMFS_NAME_MAX ); 2002614: 92 10 00 1b mov %i3, %o1 2002618: 90 07 60 0c add %i5, 0xc, %o0 200261c: 40 00 3a 89 call 2011040 2002620: 94 10 20 20 mov 0x20, %o2 if ( the_jnode->Parent != NULL ) 2002624: c2 07 60 08 ld [ %i5 + 8 ], %g1 2002628: 80 a0 60 00 cmp %g1, 0 200262c: 22 80 00 05 be,a 2002640 <== NEVER TAKEN 2002630: c2 06 80 00 ld [ %i2 ], %g1 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 2002634: 40 00 13 64 call 20073c4 <_Chain_Extract> 2002638: 90 10 00 1d mov %i5, %o0 rtems_chain_extract( (rtems_chain_node *) the_jnode ); new_parent = new_parent_loc->node_access; 200263c: c2 06 80 00 ld [ %i2 ], %g1 RTEMS_INLINE_ROUTINE void rtems_chain_append( rtems_chain_control *the_chain, rtems_chain_node *the_node ) { _Chain_Append( the_chain, the_node ); 2002640: 92 10 00 1d mov %i5, %o1 2002644: 90 00 60 50 add %g1, 0x50, %o0 2002648: 40 00 13 54 call 2007398 <_Chain_Append> 200264c: c2 27 60 08 st %g1, [ %i5 + 8 ] rtems_chain_append( &new_parent->info.directory.Entries, &the_jnode->Node ); /* * Update the time. */ IMFS_update_ctime( the_jnode ); 2002650: 90 07 bf f8 add %fp, -8, %o0 2002654: 40 00 02 42 call 2002f5c 2002658: 92 10 20 00 clr %o1 200265c: c2 07 bf f8 ld [ %fp + -8 ], %g1 2002660: c2 27 60 48 st %g1, [ %i5 + 0x48 ] return 0; } 2002664: 81 c7 e0 08 ret 2002668: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 0200ad18 : static void IMFS_skip_separator ( const char *path, /* IN */ size_t *len, /* IN/OUT */ int *index /* IN/OUT */ ) { 200ad18: 9d e3 bf a0 save %sp, -96, %sp while ( IMFS_is_separator( path[*index] ) && path[*index] && *len ) { 200ad1c: 10 80 00 0f b 200ad58 200ad20: c2 06 80 00 ld [ %i2 ], %g1 200ad24: c4 4e 00 01 ldsb [ %i0 + %g1 ], %g2 200ad28: 80 a0 a0 00 cmp %g2, 0 200ad2c: 02 80 00 10 be 200ad6c 200ad30: 82 00 60 01 inc %g1 200ad34: c4 06 40 00 ld [ %i1 ], %g2 200ad38: 80 a0 a0 00 cmp %g2, 0 200ad3c: 02 80 00 0c be 200ad6c <== NEVER TAKEN 200ad40: 01 00 00 00 nop ++(*index); 200ad44: c2 26 80 00 st %g1, [ %i2 ] --(*len); 200ad48: c2 06 40 00 ld [ %i1 ], %g1 200ad4c: 82 00 7f ff add %g1, -1, %g1 200ad50: c2 26 40 00 st %g1, [ %i1 ] const char *path, /* IN */ size_t *len, /* IN/OUT */ int *index /* IN/OUT */ ) { while ( IMFS_is_separator( path[*index] ) && path[*index] && *len ) { 200ad54: c2 06 80 00 ld [ %i2 ], %g1 200ad58: 7f ff e4 55 call 2003eac 200ad5c: d0 4e 00 01 ldsb [ %i0 + %g1 ], %o0 200ad60: 80 a2 20 00 cmp %o0, 0 200ad64: 32 bf ff f0 bne,a 200ad24 200ad68: c2 06 80 00 ld [ %i2 ], %g1 200ad6c: 81 c7 e0 08 ret 200ad70: 81 e8 00 00 restore =============================================================================== 0200bb70 : int IMFS_stat( rtems_filesystem_location_info_t *loc, struct stat *buf ) { 200bb70: 9d e3 bf a0 save %sp, -96, %sp IMFS_fs_info_t *fs_info; IMFS_jnode_t *the_jnode; IMFS_device_t *io; the_jnode = loc->node_access; 200bb74: c2 06 00 00 ld [ %i0 ], %g1 switch ( the_jnode->type ) { 200bb78: c4 00 60 4c ld [ %g1 + 0x4c ], %g2 200bb7c: 80 a0 a0 07 cmp %g2, 7 200bb80: 08 80 00 08 bleu 200bba0 <== ALWAYS TAKEN 200bb84: 85 28 a0 02 sll %g2, 2, %g2 case IMFS_FIFO: buf->st_size = 0; break; default: rtems_set_errno_and_return_minus_one( ENOTSUP ); 200bb88: 40 00 0f 69 call 200f92c <__errno> 200bb8c: b0 10 3f ff mov -1, %i0 200bb90: 82 10 20 86 mov 0x86, %g1 200bb94: c2 22 00 00 st %g1, [ %o0 ] 200bb98: 81 c7 e0 08 ret 200bb9c: 81 e8 00 00 restore IMFS_device_t *io; the_jnode = loc->node_access; switch ( the_jnode->type ) { 200bba0: 07 00 80 2e sethi %hi(0x200b800), %g3 200bba4: 86 10 e3 50 or %g3, 0x350, %g3 ! 200bb50 200bba8: c4 00 c0 02 ld [ %g3 + %g2 ], %g2 200bbac: 81 c0 80 00 jmp %g2 200bbb0: 01 00 00 00 nop case IMFS_SYM_LINK: buf->st_size = 0; break; case IMFS_FIFO: buf->st_size = 0; 200bbb4: c0 26 60 20 clr [ %i1 + 0x20 ] 200bbb8: c0 26 60 24 clr [ %i1 + 0x24 ] /* * The device number of the IMFS is the major number and the minor is the * instance. */ fs_info = loc->mt_entry->fs_info; 200bbbc: c4 06 20 10 ld [ %i0 + 0x10 ], %g2 buf->st_dev = rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); buf->st_mode = the_jnode->st_mode; 200bbc0: d8 00 60 30 ld [ %g1 + 0x30 ], %o4 * 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 = rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); 200bbc4: c4 00 a0 34 ld [ %g2 + 0x34 ], %g2 buf->st_mode = the_jnode->st_mode; buf->st_nlink = the_jnode->st_nlink; buf->st_ino = the_jnode->st_ino; buf->st_uid = the_jnode->st_uid; 200bbc8: f0 10 60 3c lduh [ %g1 + 0x3c ], %i0 fs_info = loc->mt_entry->fs_info; buf->st_dev = rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); buf->st_mode = the_jnode->st_mode; buf->st_nlink = the_jnode->st_nlink; 200bbcc: da 10 60 34 lduh [ %g1 + 0x34 ], %o5 * 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 = rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); 200bbd0: d6 00 80 00 ld [ %g2 ], %o3 buf->st_mode = the_jnode->st_mode; buf->st_nlink = the_jnode->st_nlink; buf->st_ino = the_jnode->st_ino; 200bbd4: de 00 60 38 ld [ %g1 + 0x38 ], %o7 buf->st_uid = the_jnode->st_uid; buf->st_gid = the_jnode->st_gid; 200bbd8: c8 10 60 3e lduh [ %g1 + 0x3e ], %g4 buf->st_atime = the_jnode->stat_atime; 200bbdc: c6 00 60 40 ld [ %g1 + 0x40 ], %g3 buf->st_mtime = the_jnode->stat_mtime; 200bbe0: c4 00 60 44 ld [ %g1 + 0x44 ], %g2 buf->st_ctime = the_jnode->stat_ctime; 200bbe4: c2 00 60 48 ld [ %g1 + 0x48 ], %g1 */ fs_info = loc->mt_entry->fs_info; buf->st_dev = rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); buf->st_mode = the_jnode->st_mode; 200bbe8: d8 26 60 0c st %o4, [ %i1 + 0xc ] buf->st_nlink = the_jnode->st_nlink; buf->st_ino = the_jnode->st_ino; buf->st_uid = the_jnode->st_uid; 200bbec: f0 36 60 12 sth %i0, [ %i1 + 0x12 ] /* * 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 = 200bbf0: d6 26 60 04 st %o3, [ %i1 + 4 ] 200bbf4: 19 00 00 3f sethi %hi(0xfc00), %o4 rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); buf->st_mode = the_jnode->st_mode; buf->st_nlink = the_jnode->st_nlink; 200bbf8: da 36 60 10 sth %o5, [ %i1 + 0x10 ] /* * 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 = 200bbfc: 98 13 23 fe or %o4, 0x3fe, %o4 rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); buf->st_mode = the_jnode->st_mode; buf->st_nlink = the_jnode->st_nlink; buf->st_ino = the_jnode->st_ino; 200bc00: de 26 60 08 st %o7, [ %i1 + 8 ] /* * 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 = 200bc04: d8 26 40 00 st %o4, [ %i1 ] buf->st_mode = the_jnode->st_mode; buf->st_nlink = the_jnode->st_nlink; buf->st_ino = the_jnode->st_ino; buf->st_uid = the_jnode->st_uid; buf->st_gid = the_jnode->st_gid; 200bc08: c8 36 60 14 sth %g4, [ %i1 + 0x14 ] buf->st_atime = the_jnode->stat_atime; 200bc0c: c6 26 60 28 st %g3, [ %i1 + 0x28 ] buf->st_mtime = the_jnode->stat_mtime; 200bc10: c4 26 60 30 st %g2, [ %i1 + 0x30 ] buf->st_ctime = the_jnode->stat_ctime; 200bc14: c2 26 60 38 st %g1, [ %i1 + 0x38 ] return 0; } 200bc18: 81 c7 e0 08 ret 200bc1c: 91 e8 20 00 restore %g0, 0, %o0 switch ( the_jnode->type ) { case IMFS_DEVICE: io = &the_jnode->info.device; buf->st_rdev = rtems_filesystem_make_dev_t( io->major, io->minor ); 200bc20: c6 00 60 54 ld [ %g1 + 0x54 ], %g3 rtems_device_minor_number _minor ) { union __rtems_dev_t temp; temp.__overlay.major = _major; 200bc24: c4 00 60 50 ld [ %g1 + 0x50 ], %g2 break; 200bc28: 10 bf ff e5 b 200bbbc 200bc2c: c4 3e 60 18 std %g2, [ %i1 + 0x18 ] case IMFS_LINEAR_FILE: case IMFS_MEMORY_FILE: buf->st_size = the_jnode->info.file.size; 200bc30: c4 18 60 50 ldd [ %g1 + 0x50 ], %g2 break; 200bc34: 10 bf ff e2 b 200bbbc 200bc38: c4 3e 60 20 std %g2, [ %i1 + 0x20 ] =============================================================================== 02002704 : int IMFS_unlink( rtems_filesystem_location_info_t *parentloc, /* IN */ rtems_filesystem_location_info_t *loc /* IN */ ) { 2002704: 9d e3 bf 80 save %sp, -128, %sp IMFS_jnode_t *node; rtems_filesystem_location_info_t the_link; int result = 0; node = loc->node_access; 2002708: fa 06 40 00 ld [ %i1 ], %i5 /* * If this is the last last pointer to the node * free the node. */ if ( node->type == IMFS_HARD_LINK ) { 200270c: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 2002710: 80 a0 60 03 cmp %g1, 3 2002714: 02 80 00 09 be 2002738 2002718: b8 10 00 18 mov %i0, %i4 /* * Now actually free the node we were asked to free. */ result = (*loc->handlers->rmnod_h)( parentloc, loc ); 200271c: c2 06 60 08 ld [ %i1 + 8 ], %g1 2002720: 90 10 00 1c mov %i4, %o0 2002724: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 2002728: 9f c0 40 00 call %g1 200272c: 92 10 00 19 mov %i1, %o1 return result; } 2002730: 81 c7 e0 08 ret 2002734: 91 e8 00 08 restore %g0, %o0, %o0 * free the node. */ if ( node->type == IMFS_HARD_LINK ) { if ( !node->info.hard_link.link_node ) 2002738: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 200273c: 80 a0 60 00 cmp %g1, 0 2002740: 02 80 00 2b be 20027ec <== NEVER TAKEN 2002744: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); the_link = *loc; 2002748: c6 06 60 0c ld [ %i1 + 0xc ], %g3 200274c: f0 06 60 04 ld [ %i1 + 4 ], %i0 2002750: c8 06 60 08 ld [ %i1 + 8 ], %g4 2002754: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 2002758: c6 27 bf f0 st %g3, [ %fp + -16 ] the_link.node_access = node->info.hard_link.link_node; 200275c: c2 27 bf e4 st %g1, [ %fp + -28 ] if ( node->type == IMFS_HARD_LINK ) { if ( !node->info.hard_link.link_node ) rtems_set_errno_and_return_minus_one( EINVAL ); the_link = *loc; 2002760: f0 27 bf e8 st %i0, [ %fp + -24 ] 2002764: c8 27 bf ec st %g4, [ %fp + -20 ] 2002768: c4 27 bf f4 st %g2, [ %fp + -12 ] the_link.node_access = node->info.hard_link.link_node; IMFS_Set_handlers( &the_link ); 200276c: 40 00 21 82 call 200ad74 2002770: 90 07 bf e4 add %fp, -28, %o0 /* * 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) 2002774: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 2002778: c6 10 60 34 lduh [ %g1 + 0x34 ], %g3 200277c: 80 a0 e0 01 cmp %g3, 1 2002780: 02 80 00 10 be 20027c0 2002784: 84 00 ff ff add %g3, -1, %g2 return -1; } else { node->info.hard_link.link_node->st_nlink --; IMFS_update_ctime( node->info.hard_link.link_node ); 2002788: 90 07 bf f8 add %fp, -8, %o0 if ( result != 0 ) return -1; } else { node->info.hard_link.link_node->st_nlink --; 200278c: c4 30 60 34 sth %g2, [ %g1 + 0x34 ] IMFS_update_ctime( node->info.hard_link.link_node ); 2002790: 40 00 01 f3 call 2002f5c 2002794: 92 10 20 00 clr %o1 2002798: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 200279c: c4 07 bf f8 ld [ %fp + -8 ], %g2 /* * Now actually free the node we were asked to free. */ result = (*loc->handlers->rmnod_h)( parentloc, loc ); 20027a0: 90 10 00 1c mov %i4, %o0 return -1; } else { node->info.hard_link.link_node->st_nlink --; IMFS_update_ctime( node->info.hard_link.link_node ); 20027a4: c4 20 60 48 st %g2, [ %g1 + 0x48 ] /* * Now actually free the node we were asked to free. */ result = (*loc->handlers->rmnod_h)( parentloc, loc ); 20027a8: c2 06 60 08 ld [ %i1 + 8 ], %g1 20027ac: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 20027b0: 9f c0 40 00 call %g1 20027b4: 92 10 00 19 mov %i1, %o1 return result; } 20027b8: 81 c7 e0 08 ret 20027bc: 91 e8 00 08 restore %g0, %o0, %o0 * to remove the node that is a link and the node itself. */ if ( node->info.hard_link.link_node->st_nlink == 1) { result = (*the_link.handlers->rmnod_h)( parentloc, &the_link ); 20027c0: c2 07 bf ec ld [ %fp + -20 ], %g1 20027c4: 90 10 00 1c mov %i4, %o0 20027c8: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 20027cc: 92 07 bf e4 add %fp, -28, %o1 20027d0: 9f c0 40 00 call %g1 20027d4: b0 10 3f ff mov -1, %i0 if ( result != 0 ) 20027d8: 80 a2 20 00 cmp %o0, 0 20027dc: 22 bf ff d1 be,a 2002720 20027e0: c2 06 60 08 ld [ %i1 + 8 ], %g1 20027e4: 81 c7 e0 08 ret 20027e8: 81 e8 00 00 restore */ if ( node->type == IMFS_HARD_LINK ) { if ( !node->info.hard_link.link_node ) rtems_set_errno_and_return_minus_one( EINVAL ); 20027ec: 40 00 34 50 call 200f92c <__errno> <== NOT EXECUTED 20027f0: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 20027f4: 82 10 20 16 mov 0x16, %g1 <== NOT EXECUTED 20027f8: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 20027fc: 81 c7 e0 08 ret <== NOT EXECUTED 2002800: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 02002804 : #include int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 2002804: 9d e3 bf a0 save %sp, -96, %sp IMFS_jnode_t *node; node = mt_entry->mt_point_node.node_access; 2002808: c2 06 20 08 ld [ %i0 + 8 ], %g1 /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) 200280c: c4 00 60 4c ld [ %g1 + 0x4c ], %g2 2002810: 80 a0 a0 01 cmp %g2, 1 2002814: 12 80 00 09 bne 2002838 <== NEVER TAKEN 2002818: 01 00 00 00 nop /* * Did the node indicate that there was a directory mounted here? */ if ( node->info.directory.mt_fs == NULL ) 200281c: c4 00 60 5c ld [ %g1 + 0x5c ], %g2 2002820: 80 a0 a0 00 cmp %g2, 0 2002824: 02 80 00 0b be 2002850 <== NEVER TAKEN 2002828: 01 00 00 00 nop /* * 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; 200282c: c0 20 60 5c clr [ %g1 + 0x5c ] return 0; } 2002830: 81 c7 e0 08 ret 2002834: 91 e8 20 00 restore %g0, 0, %o0 /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) rtems_set_errno_and_return_minus_one( ENOTDIR ); 2002838: 40 00 34 3d call 200f92c <__errno> <== NOT EXECUTED 200283c: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 2002840: 82 10 20 14 mov 0x14, %g1 <== NOT EXECUTED 2002844: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 2002848: 81 c7 e0 08 ret <== NOT EXECUTED 200284c: 81 e8 00 00 restore <== NOT EXECUTED /* * Did the node indicate that there was a directory mounted here? */ if ( node->info.directory.mt_fs == NULL ) rtems_set_errno_and_return_minus_one( EINVAL ); /* XXX */ 2002850: 40 00 34 37 call 200f92c <__errno> <== NOT EXECUTED 2002854: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 2002858: 82 10 20 16 mov 0x16, %g1 <== NOT EXECUTED 200285c: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 2002860: 81 c7 e0 08 ret <== NOT EXECUTED 2002864: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 02003150 : void RTEMS_Malloc_Initialize( void *heap_begin, uintptr_t heap_size, size_t sbrk_amount ) { 2003150: 9d e3 bf a0 save %sp, -96, %sp /* * If configured, initialize the statistics support */ if ( rtems_malloc_statistics_helpers != NULL ) { 2003154: 03 00 80 75 sethi %hi(0x201d400), %g1 2003158: c2 00 60 e4 ld [ %g1 + 0xe4 ], %g1 ! 201d4e4 200315c: 80 a0 60 00 cmp %g1, 0 2003160: 02 80 00 05 be 2003174 2003164: 01 00 00 00 nop (*rtems_malloc_statistics_helpers->initialize)(); 2003168: c2 00 40 00 ld [ %g1 ], %g1 200316c: 9f c0 40 00 call %g1 2003170: 01 00 00 00 nop } /* * Initialize the garbage collection list to start with nothing on it. */ malloc_deferred_frees_initialize(); 2003174: 7f ff ff dd call 20030e8 2003178: 01 00 00 00 nop /* * Initialize the optional sbrk support for extending the heap */ if ( rtems_malloc_sbrk_helpers != NULL ) { 200317c: 03 00 80 75 sethi %hi(0x201d400), %g1 2003180: c2 00 60 e0 ld [ %g1 + 0xe0 ], %g1 ! 201d4e0 2003184: 80 a0 60 00 cmp %g1, 0 2003188: 02 80 00 07 be 20031a4 200318c: 90 10 00 18 mov %i0, %o0 heap_begin = (*rtems_malloc_sbrk_helpers->initialize)( 2003190: c2 00 40 00 ld [ %g1 ], %g1 2003194: 92 10 00 1a mov %i2, %o1 2003198: 9f c0 40 00 call %g1 200319c: b2 10 00 1a mov %i2, %i1 20031a0: b0 10 00 08 mov %o0, %i0 * of the time under UNIX because zero'ing memory when it is first * given to a process eliminates the chance of a process seeing data * left over from another process. This would be a security violation. */ if ( 20031a4: 39 00 80 75 sethi %hi(0x201d400), %i4 20031a8: c2 0f 20 e8 ldub [ %i4 + 0xe8 ], %g1 ! 201d4e8 20031ac: 80 a0 60 00 cmp %g1, 0 20031b0: 12 80 00 10 bne 20031f0 20031b4: 3b 00 80 73 sethi %hi(0x201cc00), %i5 !rtems_unified_work_area && rtems_configuration_get_do_zero_of_workspace() 20031b8: 03 00 80 73 sethi %hi(0x201cc00), %g1 20031bc: c2 08 60 14 ldub [ %g1 + 0x14 ], %g1 ! 201cc14 20031c0: 80 a0 60 00 cmp %g1, 0 20031c4: 12 80 00 13 bne 2003210 20031c8: 90 10 00 18 mov %i0, %o0 void *area_begin, uintptr_t area_size, uintptr_t page_size ) { return _Heap_Initialize( heap, area_begin, area_size, page_size ); 20031cc: 3b 00 80 73 sethi %hi(0x201cc00), %i5 20031d0: d0 07 60 d0 ld [ %i5 + 0xd0 ], %o0 ! 201ccd0 20031d4: 92 10 00 18 mov %i0, %o1 20031d8: 94 10 00 19 mov %i1, %o2 20031dc: 40 00 12 48 call 2007afc <_Heap_Initialize> 20031e0: 96 10 20 08 mov 8, %o3 RTEMS_Malloc_Heap, heap_begin, heap_size, CPU_HEAP_ALIGNMENT ); if ( status == 0 ) { 20031e4: 80 a2 20 00 cmp %o0, 0 20031e8: 02 80 00 13 be 2003234 20031ec: 01 00 00 00 nop rtems_fatal_error_occurred( RTEMS_NO_MEMORY ); } } MSBUMP( space_available, _Protected_heap_Get_size(RTEMS_Malloc_Heap) ); 20031f0: 39 00 80 75 sethi %hi(0x201d400), %i4 20031f4: d0 07 60 d0 ld [ %i5 + 0xd0 ], %o0 20031f8: 40 00 15 4d call 200872c <_Protected_heap_Get_size> 20031fc: fa 07 23 a0 ld [ %i4 + 0x3a0 ], %i5 2003200: ba 02 00 1d add %o0, %i5, %i5 2003204: fa 27 23 a0 st %i5, [ %i4 + 0x3a0 ] } 2003208: 81 c7 e0 08 ret 200320c: 81 e8 00 00 restore if ( !rtems_unified_work_area && rtems_configuration_get_do_zero_of_workspace() ) { memset( heap_begin, 0, heap_size ); 2003210: 92 10 20 00 clr %o1 2003214: 40 00 34 57 call 2010370 2003218: 94 10 00 19 mov %i1, %o2 * Unfortunately we cannot use assert if this fails because if this * has failed we do not have a heap and if we do not have a heap * STDIO cannot work because there will be no buffers. */ if ( !rtems_unified_work_area ) { 200321c: c2 0f 20 e8 ldub [ %i4 + 0xe8 ], %g1 2003220: 80 a0 60 00 cmp %g1, 0 2003224: 22 bf ff eb be,a 20031d0 <== ALWAYS TAKEN 2003228: 3b 00 80 73 sethi %hi(0x201cc00), %i5 if ( status == 0 ) { rtems_fatal_error_occurred( RTEMS_NO_MEMORY ); } } MSBUMP( space_available, _Protected_heap_Get_size(RTEMS_Malloc_Heap) ); 200322c: 10 bf ff f2 b 20031f4 <== NOT EXECUTED 2003230: 39 00 80 75 sethi %hi(0x201d400), %i4 <== NOT EXECUTED heap_begin, heap_size, CPU_HEAP_ALIGNMENT ); if ( status == 0 ) { rtems_fatal_error_occurred( RTEMS_NO_MEMORY ); 2003234: 40 00 0f 6e call 2006fec 2003238: 90 10 20 1a mov 0x1a, %o0 =============================================================================== 02002790 : static rtems_printk_plugin_t print_handler; void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 2002790: 9d e3 bf 98 save %sp, -104, %sp /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { 2002794: 80 a6 3f ff cmp %i0, -1 2002798: 02 80 00 5e be 2002910 200279c: b6 06 20 b8 add %i0, 0xb8, %i3 current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); 20027a0: e0 06 21 40 ld [ %i0 + 0x140 ], %l0 20027a4: f2 06 20 bc ld [ %i0 + 0xbc ], %i1 } low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); 20027a8: f8 06 c0 00 ld [ %i3 ], %i4 /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; 20027ac: 82 06 60 20 add %i1, 0x20, %g1 stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); 20027b0: b8 07 3f f0 add %i4, -16, %i4 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 20027b4: 88 0f 3f fc and %i4, -4, %g4 20027b8: 88 00 40 04 add %g1, %g4, %g4 20027bc: 80 a0 40 04 cmp %g1, %g4 20027c0: 1a 80 00 12 bcc 2002808 <== NEVER TAKEN 20027c4: ba 10 20 00 clr %i5 if (*base != U32_PATTERN) 20027c8: f4 06 60 20 ld [ %i1 + 0x20 ], %i2 20027cc: 05 29 69 69 sethi %hi(0xa5a5a400), %g2 20027d0: 84 10 a1 a5 or %g2, 0x1a5, %g2 ! a5a5a5a5 20027d4: 80 a6 80 02 cmp %i2, %g2 20027d8: 22 80 00 08 be,a 20027f8 <== ALWAYS TAKEN 20027dc: 84 00 60 04 add %g1, 4, %g2 20027e0: 10 80 00 35 b 20028b4 <== NOT EXECUTED 20027e4: 84 10 00 01 mov %g1, %g2 <== NOT EXECUTED 20027e8: 80 a0 c0 1a cmp %g3, %i2 20027ec: 12 80 00 32 bne 20028b4 20027f0: 82 10 00 02 mov %g2, %g1 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 20027f4: 84 00 60 04 add %g1, 4, %g2 20027f8: 80 a1 00 02 cmp %g4, %g2 20027fc: 38 bf ff fb bgu,a 20027e8 <== ALWAYS TAKEN 2002800: c6 00 60 04 ld [ %g1 + 4 ], %g3 high_water_mark = Stack_check_find_high_water_mark(low, size); if ( high_water_mark ) used = Stack_check_Calculate_used( low, size, high_water_mark ); else used = 0; 2002804: ba 10 20 00 clr %i5 <== NOT EXECUTED #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) 2002808: 80 a6 20 00 cmp %i0, 0 <== NOT EXECUTED 200280c: 02 80 00 33 be 20028d8 <== NOT EXECUTED 2002810: 33 00 80 66 sethi %hi(0x2019800), %i1 <== NOT EXECUTED #endif { (*print_handler)( 2002814: e2 06 20 08 ld [ %i0 + 8 ], %l1 2002818: 35 00 80 66 sethi %hi(0x2019800), %i2 200281c: 33 00 80 66 sethi %hi(0x2019800), %i1 2002820: e4 06 a0 34 ld [ %i2 + 0x34 ], %l2 2002824: f0 06 60 30 ld [ %i1 + 0x30 ], %i0 2002828: 94 07 bf f8 add %fp, -8, %o2 200282c: 92 10 20 05 mov 5, %o1 2002830: 40 00 19 5a call 2008d98 2002834: 90 10 00 11 mov %l1, %o0 2002838: 13 00 80 60 sethi %hi(0x2018000), %o1 200283c: 96 10 00 08 mov %o0, %o3 2002840: 94 10 00 11 mov %l1, %o2 2002844: 90 10 00 12 mov %l2, %o0 2002848: 9f c6 00 00 call %i0 200284c: 92 12 61 80 or %o1, 0x180, %o1 (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 2002850: d4 06 e0 04 ld [ %i3 + 4 ], %o2 2002854: d6 06 c0 00 ld [ %i3 ], %o3 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 2002858: c2 06 60 30 ld [ %i1 + 0x30 ], %g1 200285c: d0 06 a0 34 ld [ %i2 + 0x34 ], %o0 print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 2002860: 96 02 ff ff add %o3, -1, %o3 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 2002864: 13 00 80 60 sethi %hi(0x2018000), %o1 2002868: 96 02 80 0b add %o2, %o3, %o3 200286c: 92 12 61 a0 or %o1, 0x1a0, %o1 2002870: 98 10 00 10 mov %l0, %o4 2002874: 9f c0 40 00 call %g1 2002878: 9a 10 00 1c mov %i4, %o5 stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 200287c: 03 00 80 66 sethi %hi(0x2019800), %g1 2002880: c2 00 60 2c ld [ %g1 + 0x2c ], %g1 ! 201982c else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 2002884: 07 00 80 66 sethi %hi(0x2019800), %g3 2002888: 05 00 80 66 sethi %hi(0x2019800), %g2 stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 200288c: 80 a0 60 00 cmp %g1, 0 (*print_handler)( print_context, "Unavailable\n" ); 2002890: d0 00 a0 34 ld [ %g2 + 0x34 ], %o0 stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 2002894: 02 80 00 1a be 20028fc <== NEVER TAKEN 2002898: c2 00 e0 30 ld [ %g3 + 0x30 ], %g1 (*print_handler)( print_context, "Unavailable\n" ); } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 200289c: 94 10 00 1d mov %i5, %o2 20028a0: 13 00 80 60 sethi %hi(0x2018000), %o1 20028a4: 9f c0 40 00 call %g1 20028a8: 92 12 61 d0 or %o1, 0x1d0, %o1 ! 20181d0 20028ac: 81 c7 e0 08 ret 20028b0: 81 e8 00 00 restore low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); high_water_mark = Stack_check_find_high_water_mark(low, size); if ( high_water_mark ) 20028b4: 80 a0 a0 00 cmp %g2, 0 20028b8: 02 bf ff d4 be 2002808 <== NEVER TAKEN 20028bc: ba 10 20 00 clr %i5 { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 20028c0: ba 06 60 10 add %i1, 0x10, %i5 else used = 0; #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) 20028c4: 80 a6 20 00 cmp %i0, 0 size = Stack_check_usable_stack_size(stack); high_water_mark = Stack_check_find_high_water_mark(low, size); if ( high_water_mark ) used = Stack_check_Calculate_used( low, size, high_water_mark ); 20028c8: ba 07 40 1c add %i5, %i4, %i5 else used = 0; #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) 20028cc: 12 bf ff d2 bne 2002814 20028d0: ba 27 40 02 sub %i5, %g2, %i5 rtems_object_get_name( the_thread->Object.id, sizeof(name), name ) ); } #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); 20028d4: 33 00 80 66 sethi %hi(0x2019800), %i1 20028d8: 35 00 80 66 sethi %hi(0x2019800), %i2 20028dc: c2 06 60 30 ld [ %i1 + 0x30 ], %g1 20028e0: d0 06 a0 34 ld [ %i2 + 0x34 ], %o0 20028e4: 94 10 3f ff mov -1, %o2 20028e8: 13 00 80 60 sethi %hi(0x2018000), %o1 20028ec: 9f c0 40 00 call %g1 20028f0: 92 12 61 90 or %o1, 0x190, %o1 ! 2018190 (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 20028f4: 10 bf ff d8 b 2002854 20028f8: d4 06 e0 04 ld [ %i3 + 4 ], %o2 current, size ); if (Stack_check_Initialized == 0) { (*print_handler)( print_context, "Unavailable\n" ); 20028fc: 13 00 80 60 sethi %hi(0x2018000), %o1 <== NOT EXECUTED 2002900: 9f c0 40 00 call %g1 <== NOT EXECUTED 2002904: 92 12 61 c0 or %o1, 0x1c0, %o1 ! 20181c0 <== NOT EXECUTED 2002908: 81 c7 e0 08 ret <== NOT EXECUTED 200290c: 81 e8 00 00 restore <== NOT EXECUTED /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { if (!Stack_check_Interrupt_stack.area) 2002910: 37 00 80 66 sethi %hi(0x2019800), %i3 2002914: b6 16 e2 d4 or %i3, 0x2d4, %i3 ! 2019ad4 2002918: f2 06 e0 04 ld [ %i3 + 4 ], %i1 return; stack = &Stack_check_Interrupt_stack; the_thread = 0; current = 0; 200291c: a0 10 20 00 clr %l0 /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { if (!Stack_check_Interrupt_stack.area) 2002920: 80 a6 60 00 cmp %i1, 0 2002924: 12 bf ff a1 bne 20027a8 <== ALWAYS TAKEN 2002928: b0 10 20 00 clr %i0 200292c: 81 c7 e0 08 ret <== NOT EXECUTED 2002930: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 02002934 : /* * Stack_check_Initialize */ void Stack_check_Initialize( void ) { 2002934: 9d e3 bf a0 save %sp, -96, %sp static uint32_t pattern[ 4 ] = { 0xFEEDF00D, 0x0BAD0D06, /* FEED FOOD to BAD DOG */ 0xDEADF00D, 0x600D0D06 /* DEAD FOOD but GOOD DOG */ }; if ( Stack_check_Initialized ) 2002938: 3b 00 80 66 sethi %hi(0x2019800), %i5 200293c: c2 07 60 2c ld [ %i5 + 0x2c ], %g1 ! 201982c 2002940: 80 a0 60 00 cmp %g1, 0 2002944: 12 80 00 20 bne 20029c4 2002948: 07 00 80 66 sethi %hi(0x2019800), %g3 /* * Dope the pattern and fill areas */ p = Stack_check_Pattern.pattern; for ( i = 0; i < PATTERN_SIZE_WORDS; i++ ) { p[i] = pattern[ i%4 ]; 200294c: 09 3f bb 7c sethi %hi(0xfeedf000), %g4 2002950: 82 10 e2 c4 or %g3, 0x2c4, %g1 2002954: 88 11 20 0d or %g4, 0xd, %g4 2002958: c8 20 e2 c4 st %g4, [ %g3 + 0x2c4 ] 200295c: 07 02 eb 43 sethi %hi(0xbad0c00), %g3 2002960: 86 10 e1 06 or %g3, 0x106, %g3 ! bad0d06 /* * If appropriate, setup the interrupt stack for high water testing * also. */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (_CPU_Interrupt_stack_low && _CPU_Interrupt_stack_high) { 2002964: 05 00 80 68 sethi %hi(0x201a000), %g2 2002968: d0 00 a2 48 ld [ %g2 + 0x248 ], %o0 ! 201a248 <_Per_CPU_Information> /* * Dope the pattern and fill areas */ p = Stack_check_Pattern.pattern; for ( i = 0; i < PATTERN_SIZE_WORDS; i++ ) { p[i] = pattern[ i%4 ]; 200296c: c6 20 60 04 st %g3, [ %g1 + 4 ] 2002970: 07 37 ab 7c sethi %hi(0xdeadf000), %g3 2002974: 86 10 e0 0d or %g3, 0xd, %g3 ! deadf00d 2002978: c6 20 60 08 st %g3, [ %g1 + 8 ] 200297c: 07 18 03 43 sethi %hi(0x600d0c00), %g3 2002980: 86 10 e1 06 or %g3, 0x106, %g3 ! 600d0d06 2002984: c6 20 60 0c st %g3, [ %g1 + 0xc ] /* * If appropriate, setup the interrupt stack for high water testing * also. */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (_CPU_Interrupt_stack_low && _CPU_Interrupt_stack_high) { 2002988: 80 a2 20 00 cmp %o0, 0 200298c: 02 80 00 0c be 20029bc <== NEVER TAKEN 2002990: 84 10 a2 48 or %g2, 0x248, %g2 2002994: d4 00 a0 04 ld [ %g2 + 4 ], %o2 2002998: 80 a2 a0 00 cmp %o2, 0 200299c: 02 80 00 08 be 20029bc <== NEVER TAKEN 20029a0: 03 00 80 66 sethi %hi(0x2019800), %g1 Stack_check_Interrupt_stack.area = _CPU_Interrupt_stack_low; 20029a4: 84 10 62 d4 or %g1, 0x2d4, %g2 ! 2019ad4 Stack_check_Interrupt_stack.size = (char *) _CPU_Interrupt_stack_high - 20029a8: 94 22 80 08 sub %o2, %o0, %o2 * If appropriate, setup the interrupt stack for high water testing * also. */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (_CPU_Interrupt_stack_low && _CPU_Interrupt_stack_high) { Stack_check_Interrupt_stack.area = _CPU_Interrupt_stack_low; 20029ac: d0 20 a0 04 st %o0, [ %g2 + 4 ] Stack_check_Interrupt_stack.size = (char *) _CPU_Interrupt_stack_high - 20029b0: d4 20 62 d4 st %o2, [ %g1 + 0x2d4 ] (char *) _CPU_Interrupt_stack_low; Stack_check_Dope_stack(&Stack_check_Interrupt_stack); 20029b4: 40 00 40 4a call 2012adc 20029b8: 92 10 20 a5 mov 0xa5, %o1 } #endif Stack_check_Initialized = 1; 20029bc: 82 10 20 01 mov 1, %g1 20029c0: c2 27 60 2c st %g1, [ %i5 + 0x2c ] 20029c4: 81 c7 e0 08 ret 20029c8: 81 e8 00 00 restore =============================================================================== 02002a3c : Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { 2002a3c: 9d e3 bf 80 save %sp, -128, %sp Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); char name[32]; printk("BLOWN STACK!!!\n"); 2002a40: 11 00 80 60 sethi %hi(0x2018000), %o0 ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); 2002a44: fa 06 20 bc ld [ %i0 + 0xbc ], %i5 char name[32]; printk("BLOWN STACK!!!\n"); 2002a48: 40 00 07 95 call 200489c 2002a4c: 90 12 21 d8 or %o0, 0x1d8, %o0 printk("task control block: 0x%08" PRIxPTR "\n", running); 2002a50: 92 10 00 18 mov %i0, %o1 2002a54: 11 00 80 60 sethi %hi(0x2018000), %o0 2002a58: 40 00 07 91 call 200489c 2002a5c: 90 12 21 e8 or %o0, 0x1e8, %o0 ! 20181e8 printk("task ID: 0x%08lx\n", (unsigned long) running->Object.id); 2002a60: d2 06 20 08 ld [ %i0 + 8 ], %o1 2002a64: 11 00 80 60 sethi %hi(0x2018000), %o0 2002a68: 40 00 07 8d call 200489c 2002a6c: 90 12 22 08 or %o0, 0x208, %o0 ! 2018208 printk( 2002a70: d2 06 20 0c ld [ %i0 + 0xc ], %o1 2002a74: 11 00 80 60 sethi %hi(0x2018000), %o0 2002a78: 40 00 07 89 call 200489c 2002a7c: 90 12 22 20 or %o0, 0x220, %o0 ! 2018220 "task name: 0x%08" PRIx32 "\n", running->Object.name.name_u32 ); printk( 2002a80: d0 06 20 08 ld [ %i0 + 8 ], %o0 2002a84: 94 07 bf e0 add %fp, -32, %o2 2002a88: 40 00 18 c4 call 2008d98 2002a8c: 92 10 20 20 mov 0x20, %o1 2002a90: 92 10 00 08 mov %o0, %o1 2002a94: 11 00 80 60 sethi %hi(0x2018000), %o0 2002a98: 40 00 07 81 call 200489c 2002a9c: 90 12 22 38 or %o0, 0x238, %o0 ! 2018238 ); printk( "task stack area (%lu Bytes): 0x%08" PRIxPTR " .. 0x%08" PRIxPTR "\n", (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) 2002aa0: d4 06 20 bc ld [ %i0 + 0xbc ], %o2 2002aa4: d2 06 20 b8 ld [ %i0 + 0xb8 ], %o1 ); printk( "task name string: %s\n", rtems_object_get_name(running->Object.id, sizeof(name), name) ); printk( 2002aa8: 11 00 80 60 sethi %hi(0x2018000), %o0 2002aac: 96 02 80 09 add %o2, %o1, %o3 2002ab0: 40 00 07 7b call 200489c 2002ab4: 90 12 22 50 or %o0, 0x250, %o0 "task stack area (%lu Bytes): 0x%08" PRIxPTR " .. 0x%08" PRIxPTR "\n", (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) ); if (!pattern_ok) { 2002ab8: 80 a6 60 00 cmp %i1, 0 2002abc: 02 80 00 04 be 2002acc <== ALWAYS TAKEN 2002ac0: 92 10 20 10 mov 0x10, %o1 rtems_configuration_get_user_multiprocessing_table()->node ); } #endif rtems_fatal_error_occurred(0x81); 2002ac4: 40 00 1a d2 call 200960c 2002ac8: 90 10 20 81 mov 0x81, %o0 (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) ); if (!pattern_ok) { printk( 2002acc: 11 00 80 60 sethi %hi(0x2018000), %o0 2002ad0: 94 07 60 08 add %i5, 8, %o2 2002ad4: 90 12 22 88 or %o0, 0x288, %o0 2002ad8: 40 00 07 71 call 200489c 2002adc: 96 07 60 18 add %i5, 0x18, %o3 2002ae0: 30 bf ff f9 b,a 2002ac4 =============================================================================== 02007228 <_API_extensions_Run_postdriver>: * * _API_extensions_Run_postdriver */ void _API_extensions_Run_postdriver( void ) { 2007228: 9d e3 bf a0 save %sp, -96, %sp */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 200722c: 39 00 80 76 sethi %hi(0x201d800), %i4 2007230: fa 07 23 44 ld [ %i4 + 0x344 ], %i5 ! 201db44 <_API_extensions_List> 2007234: b8 17 23 44 or %i4, 0x344, %i4 Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); 2007238: b8 07 20 04 add %i4, 4, %i4 200723c: 80 a7 40 1c cmp %i5, %i4 2007240: 02 80 00 09 be 2007264 <_API_extensions_Run_postdriver+0x3c><== NEVER TAKEN 2007244: 01 00 00 00 nop * Currently all APIs configure this hook so it is always non-NULL. */ #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); 2007248: c2 07 60 08 ld [ %i5 + 8 ], %g1 200724c: 9f c0 40 00 call %g1 2007250: 01 00 00 00 nop Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { 2007254: fa 07 40 00 ld [ %i5 ], %i5 void _API_extensions_Run_postdriver( void ) { Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); 2007258: 80 a7 40 1c cmp %i5, %i4 200725c: 32 bf ff fc bne,a 200724c <_API_extensions_Run_postdriver+0x24> 2007260: c2 07 60 08 ld [ %i5 + 8 ], %g1 2007264: 81 c7 e0 08 ret 2007268: 81 e8 00 00 restore =============================================================================== 0200726c <_API_extensions_Run_postswitch>: * * _API_extensions_Run_postswitch */ void _API_extensions_Run_postswitch( void ) { 200726c: 9d e3 bf a0 save %sp, -96, %sp 2007270: 39 00 80 76 sethi %hi(0x201d800), %i4 2007274: fa 07 23 44 ld [ %i4 + 0x344 ], %i5 ! 201db44 <_API_extensions_List> 2007278: b8 17 23 44 or %i4, 0x344, %i4 Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); 200727c: b8 07 20 04 add %i4, 4, %i4 2007280: 80 a7 40 1c cmp %i5, %i4 2007284: 02 80 00 0a be 20072ac <_API_extensions_Run_postswitch+0x40><== NEVER TAKEN 2007288: 37 00 80 77 sethi %hi(0x201dc00), %i3 200728c: b6 16 e2 88 or %i3, 0x288, %i3 ! 201de88 <_Per_CPU_Information> !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (API_extensions_Control *) the_node; (*the_extension->postswitch_hook)( _Thread_Executing ); 2007290: c2 07 60 0c ld [ %i5 + 0xc ], %g1 2007294: 9f c0 40 00 call %g1 2007298: d0 06 e0 0c ld [ %i3 + 0xc ], %o0 Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { 200729c: fa 07 40 00 ld [ %i5 ], %i5 void _API_extensions_Run_postswitch( void ) { Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); 20072a0: 80 a7 40 1c cmp %i5, %i4 20072a4: 32 bf ff fc bne,a 2007294 <_API_extensions_Run_postswitch+0x28> 20072a8: c2 07 60 0c ld [ %i5 + 0xc ], %g1 20072ac: 81 c7 e0 08 ret 20072b0: 81 e8 00 00 restore =============================================================================== 020094f4 <_CORE_RWLock_Release>: */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 20094f4: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Thread_Control *executing = _Thread_Executing; 20094f8: 03 00 80 6b sethi %hi(0x201ac00), %g1 * Otherwise, we have to block. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 20094fc: 7f ff e8 0e call 2003534 2009500: fa 00 62 74 ld [ %g1 + 0x274 ], %i5 ! 201ae74 <_Per_CPU_Information+0xc> 2009504: 84 10 00 08 mov %o0, %g2 if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 2009508: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 200950c: 80 a0 60 00 cmp %g1, 0 2009510: 02 80 00 2b be 20095bc <_CORE_RWLock_Release+0xc8> 2009514: 80 a0 60 01 cmp %g1, 1 _ISR_Enable( level ); executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; return CORE_RWLOCK_SUCCESSFUL; } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 2009518: 22 80 00 22 be,a 20095a0 <_CORE_RWLock_Release+0xac> 200951c: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 return CORE_RWLOCK_SUCCESSFUL; } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 2009520: c0 27 60 34 clr [ %i5 + 0x34 ] /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; 2009524: c0 26 20 44 clr [ %i0 + 0x44 ] _ISR_Enable( level ); 2009528: 7f ff e8 07 call 2003544 200952c: 90 10 00 02 mov %g2, %o0 next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 2009530: 40 00 07 c4 call 200b440 <_Thread_queue_Dequeue> 2009534: 90 10 00 18 mov %i0, %o0 if ( next ) { 2009538: 80 a2 20 00 cmp %o0, 0 200953c: 22 80 00 24 be,a 20095cc <_CORE_RWLock_Release+0xd8> 2009540: b0 10 20 00 clr %i0 if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 2009544: c2 02 20 30 ld [ %o0 + 0x30 ], %g1 2009548: 80 a0 60 01 cmp %g1, 1 200954c: 02 80 00 22 be 20095d4 <_CORE_RWLock_Release+0xe0> 2009550: 84 10 20 01 mov 1, %g2 } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 2009554: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 2009558: 82 00 60 01 inc %g1 the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 200955c: c4 26 20 44 st %g2, [ %i0 + 0x44 ] } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 2009560: 10 80 00 09 b 2009584 <_CORE_RWLock_Release+0x90> 2009564: c2 26 20 48 st %g1, [ %i0 + 0x48 ] /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); if ( !next || 2009568: 80 a0 60 01 cmp %g1, 1 200956c: 02 80 00 0b be 2009598 <_CORE_RWLock_Release+0xa4> <== NEVER TAKEN 2009570: 90 10 00 18 mov %i0, %o0 next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 2009574: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 2009578: 82 00 60 01 inc %g1 _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 200957c: 40 00 08 c1 call 200b880 <_Thread_queue_Extract> 2009580: c2 26 20 48 st %g1, [ %i0 + 0x48 ] /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 2009584: 40 00 09 10 call 200b9c4 <_Thread_queue_First> 2009588: 90 10 00 18 mov %i0, %o0 if ( !next || 200958c: 92 92 20 00 orcc %o0, 0, %o1 2009590: 32 bf ff f6 bne,a 2009568 <_CORE_RWLock_Release+0x74> 2009594: c2 02 60 30 ld [ %o1 + 0x30 ], %g1 } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 2009598: 81 c7 e0 08 ret 200959c: 91 e8 20 00 restore %g0, 0, %o0 _ISR_Enable( level ); executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; return CORE_RWLOCK_SUCCESSFUL; } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { the_rwlock->number_of_readers -= 1; 20095a0: 82 00 7f ff add %g1, -1, %g1 if ( the_rwlock->number_of_readers != 0 ) { 20095a4: 80 a0 60 00 cmp %g1, 0 20095a8: 02 bf ff de be 2009520 <_CORE_RWLock_Release+0x2c> 20095ac: c2 26 20 48 st %g1, [ %i0 + 0x48 ] /* must be unlocked again */ _ISR_Enable( level ); 20095b0: 7f ff e7 e5 call 2003544 20095b4: b0 10 20 00 clr %i0 return CORE_RWLOCK_SUCCESSFUL; 20095b8: 30 80 00 05 b,a 20095cc <_CORE_RWLock_Release+0xd8> * If any thread is waiting, then we wait. */ _ISR_Disable( level ); if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ _ISR_Enable( level ); 20095bc: 7f ff e7 e2 call 2003544 20095c0: b0 10 20 00 clr %i0 executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 20095c4: 82 10 20 02 mov 2, %g1 20095c8: c2 27 60 34 st %g1, [ %i5 + 0x34 ] } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 20095cc: 81 c7 e0 08 ret 20095d0: 81 e8 00 00 restore next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); if ( next ) { if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 20095d4: 82 10 20 02 mov 2, %g1 20095d8: c2 26 20 44 st %g1, [ %i0 + 0x44 ] } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 20095dc: 81 c7 e0 08 ret 20095e0: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 020095e4 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 20095e4: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 20095e8: 90 10 00 18 mov %i0, %o0 20095ec: 40 00 06 be call 200b0e4 <_Thread_Get> 20095f0: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 20095f4: c2 07 bf fc ld [ %fp + -4 ], %g1 20095f8: 80 a0 60 00 cmp %g1, 0 20095fc: 12 80 00 09 bne 2009620 <_CORE_RWLock_Timeout+0x3c> <== NEVER TAKEN 2009600: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 2009604: 40 00 09 32 call 200bacc <_Thread_queue_Process_timeout> 2009608: 01 00 00 00 nop /** * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 200960c: 03 00 80 6a sethi %hi(0x201a800), %g1 2009610: c4 00 61 30 ld [ %g1 + 0x130 ], %g2 ! 201a930 <_Thread_Dispatch_disable_level> 2009614: 84 00 bf ff add %g2, -1, %g2 2009618: c4 20 61 30 st %g2, [ %g1 + 0x130 ] return _Thread_Dispatch_disable_level; 200961c: c2 00 61 30 ld [ %g1 + 0x130 ], %g1 2009620: 81 c7 e0 08 ret 2009624: 81 e8 00 00 restore =============================================================================== 02010ad4 <_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 ) { 2010ad4: 9d e3 bf a0 save %sp, -96, %sp 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; 2010ad8: c0 26 20 48 clr [ %i0 + 0x48 ] ) { size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 2010adc: f4 26 20 44 st %i2, [ %i0 + 0x44 ] the_message_queue->number_of_pending_messages = 0; the_message_queue->maximum_message_size = maximum_message_size; 2010ae0: f6 26 20 4c st %i3, [ %i0 + 0x4c ] CORE_message_queue_Control *the_message_queue, CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; 2010ae4: c0 26 20 60 clr [ %i0 + 0x60 ] the_message_queue->notify_argument = the_argument; 2010ae8: c0 26 20 64 clr [ %i0 + 0x64 ] /* * 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)) { 2010aec: 80 8e e0 03 btst 3, %i3 2010af0: 02 80 00 0a be 2010b18 <_CORE_message_queue_Initialize+0x44> 2010af4: a0 10 00 1b mov %i3, %l0 allocated_message_size += sizeof(uint32_t); 2010af8: a0 06 e0 04 add %i3, 4, %l0 allocated_message_size &= ~(sizeof(uint32_t) - 1); 2010afc: a0 0c 3f fc and %l0, -4, %l0 } if (allocated_message_size < maximum_message_size) 2010b00: 80 a6 c0 10 cmp %i3, %l0 2010b04: 08 80 00 05 bleu 2010b18 <_CORE_message_queue_Initialize+0x44><== ALWAYS TAKEN 2010b08: ba 10 20 00 clr %i5 STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } 2010b0c: b0 0f 60 01 and %i5, 1, %i0 2010b10: 81 c7 e0 08 ret 2010b14: 81 e8 00 00 restore /* * 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)); 2010b18: b8 04 20 14 add %l0, 0x14, %i4 /* * 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 * 2010b1c: 92 10 00 1a mov %i2, %o1 2010b20: 90 10 00 1c mov %i4, %o0 2010b24: 40 00 43 c5 call 2021a38 <.umul> 2010b28: ba 10 20 00 clr %i5 (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 2010b2c: 80 a2 00 10 cmp %o0, %l0 2010b30: 2a bf ff f8 bcs,a 2010b10 <_CORE_message_queue_Initialize+0x3c><== NEVER TAKEN 2010b34: b0 0f 60 01 and %i5, 1, %i0 <== NOT EXECUTED /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); 2010b38: 40 00 0d 27 call 2013fd4 <_Workspace_Allocate> 2010b3c: 01 00 00 00 nop return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 2010b40: d0 26 20 5c st %o0, [ %i0 + 0x5c ] _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 2010b44: 80 a2 20 00 cmp %o0, 0 2010b48: 02 bf ff f1 be 2010b0c <_CORE_message_queue_Initialize+0x38> 2010b4c: 92 10 00 08 mov %o0, %o1 /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 2010b50: 90 06 20 68 add %i0, 0x68, %o0 2010b54: 94 10 00 1a mov %i2, %o2 2010b58: 40 00 17 e4 call 2016ae8 <_Chain_Initialize> 2010b5c: 96 10 00 1c mov %i4, %o3 allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 2010b60: c4 06 40 00 ld [ %i1 ], %g2 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 2010b64: 82 06 20 50 add %i0, 0x50, %g1 2010b68: 84 18 a0 01 xor %g2, 1, %g2 2010b6c: 80 a0 00 02 cmp %g0, %g2 2010b70: 84 06 20 54 add %i0, 0x54, %g2 head->next = tail; head->previous = NULL; tail->previous = head; 2010b74: c2 26 20 58 st %g1, [ %i0 + 0x58 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 2010b78: c4 26 20 50 st %g2, [ %i0 + 0x50 ] 2010b7c: 90 10 00 18 mov %i0, %o0 head->previous = NULL; 2010b80: c0 26 20 54 clr [ %i0 + 0x54 ] 2010b84: 92 60 3f ff subx %g0, -1, %o1 2010b88: 94 10 20 80 mov 0x80, %o2 2010b8c: 96 10 20 06 mov 6, %o3 2010b90: 40 00 0a 51 call 20134d4 <_Thread_queue_Initialize> 2010b94: ba 10 20 01 mov 1, %i5 STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } 2010b98: b0 0f 60 01 and %i5, 1, %i0 2010b9c: 81 c7 e0 08 ret 2010ba0: 81 e8 00 00 restore =============================================================================== 0200757c <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 200757c: 9d e3 bf a0 save %sp, -96, %sp * This routine returns true if thread dispatch indicates * that we are in a critical section. */ RTEMS_INLINE_ROUTINE bool _Thread_Dispatch_in_critical_section(void) { if ( _Thread_Dispatch_disable_level == 0 ) 2007580: 3b 00 80 76 sethi %hi(0x201d800), %i5 2007584: c2 07 61 50 ld [ %i5 + 0x150 ], %g1 ! 201d950 <_Thread_Dispatch_disable_level> 2007588: 80 a0 60 00 cmp %g1, 0 200758c: 02 80 00 05 be 20075a0 <_CORE_mutex_Seize+0x24> 2007590: f8 27 a0 54 st %i4, [ %fp + 0x54 ] _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 2007594: 80 a6 a0 00 cmp %i2, 0 2007598: 12 80 00 1b bne 2007604 <_CORE_mutex_Seize+0x88> <== ALWAYS TAKEN 200759c: 03 00 80 76 sethi %hi(0x201d800), %g1 20075a0: 90 10 00 18 mov %i0, %o0 20075a4: 40 00 17 11 call 200d1e8 <_CORE_mutex_Seize_interrupt_trylock> 20075a8: 92 07 a0 54 add %fp, 0x54, %o1 20075ac: 80 a2 20 00 cmp %o0, 0 20075b0: 02 80 00 13 be 20075fc <_CORE_mutex_Seize+0x80> 20075b4: 80 a6 a0 00 cmp %i2, 0 20075b8: 02 80 00 1b be 2007624 <_CORE_mutex_Seize+0xa8> 20075bc: 01 00 00 00 nop /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 20075c0: c4 07 61 50 ld [ %i5 + 0x150 ], %g2 20075c4: 03 00 80 77 sethi %hi(0x201dc00), %g1 20075c8: c2 00 62 94 ld [ %g1 + 0x294 ], %g1 ! 201de94 <_Per_CPU_Information+0xc> 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; 20075cc: 86 10 20 01 mov 1, %g3 20075d0: c6 26 20 30 st %g3, [ %i0 + 0x30 ] 20075d4: f0 20 60 44 st %i0, [ %g1 + 0x44 ] 20075d8: f2 20 60 20 st %i1, [ %g1 + 0x20 ] 20075dc: 82 00 a0 01 add %g2, 1, %g1 20075e0: c2 27 61 50 st %g1, [ %i5 + 0x150 ] return _Thread_Dispatch_disable_level; 20075e4: c2 07 61 50 ld [ %i5 + 0x150 ], %g1 20075e8: 7f ff ea ec call 2002198 20075ec: d0 07 a0 54 ld [ %fp + 0x54 ], %o0 20075f0: 90 10 00 18 mov %i0, %o0 20075f4: 7f ff ff c0 call 20074f4 <_CORE_mutex_Seize_interrupt_blocking> 20075f8: 92 10 00 1b mov %i3, %o1 20075fc: 81 c7 e0 08 ret 2007600: 81 e8 00 00 restore 2007604: c2 00 62 ac ld [ %g1 + 0x2ac ], %g1 2007608: 80 a0 60 01 cmp %g1, 1 200760c: 28 bf ff e6 bleu,a 20075a4 <_CORE_mutex_Seize+0x28> 2007610: 90 10 00 18 mov %i0, %o0 2007614: 90 10 20 00 clr %o0 2007618: 92 10 20 00 clr %o1 200761c: 40 00 01 dc call 2007d8c <_Internal_error_Occurred> 2007620: 94 10 20 12 mov 0x12, %o2 2007624: 7f ff ea dd call 2002198 2007628: d0 07 a0 54 ld [ %fp + 0x54 ], %o0 200762c: 03 00 80 77 sethi %hi(0x201dc00), %g1 2007630: c2 00 62 94 ld [ %g1 + 0x294 ], %g1 ! 201de94 <_Per_CPU_Information+0xc> 2007634: 84 10 20 01 mov 1, %g2 2007638: c4 20 60 34 st %g2, [ %g1 + 0x34 ] 200763c: 81 c7 e0 08 ret 2007640: 81 e8 00 00 restore =============================================================================== 020077b8 <_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 ) { 20077b8: 9d e3 bf a0 save %sp, -96, %sp 20077bc: ba 10 00 18 mov %i0, %i5 Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 20077c0: b0 10 20 00 clr %i0 if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 20077c4: 40 00 07 95 call 2009618 <_Thread_queue_Dequeue> 20077c8: 90 10 00 1d mov %i5, %o0 20077cc: 80 a2 20 00 cmp %o0, 0 20077d0: 02 80 00 04 be 20077e0 <_CORE_semaphore_Surrender+0x28> 20077d4: 01 00 00 00 nop status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 20077d8: 81 c7 e0 08 ret 20077dc: 81 e8 00 00 restore if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 20077e0: 7f ff ea 6a call 2002188 20077e4: 01 00 00 00 nop if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 20077e8: c2 07 60 48 ld [ %i5 + 0x48 ], %g1 20077ec: c4 07 60 40 ld [ %i5 + 0x40 ], %g2 20077f0: 80 a0 40 02 cmp %g1, %g2 20077f4: 1a 80 00 05 bcc 2007808 <_CORE_semaphore_Surrender+0x50> <== NEVER TAKEN 20077f8: b0 10 20 04 mov 4, %i0 the_semaphore->count += 1; 20077fc: 82 00 60 01 inc %g1 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 2007800: b0 10 20 00 clr %i0 #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; 2007804: c2 27 60 48 st %g1, [ %i5 + 0x48 ] else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 2007808: 7f ff ea 64 call 2002198 200780c: 01 00 00 00 nop } return status; } 2007810: 81 c7 e0 08 ret 2007814: 81 e8 00 00 restore =============================================================================== 0200d180 <_Chain_Initialize>: Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { 200d180: 9d e3 bf a0 save %sp, -96, %sp Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; 200d184: c0 26 20 04 clr [ %i0 + 4 ] size_t node_size ) { size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 200d188: ba 06 20 04 add %i0, 4, %i5 Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 200d18c: 80 a6 a0 00 cmp %i2, 0 200d190: 02 80 00 12 be 200d1d8 <_Chain_Initialize+0x58> <== NEVER TAKEN 200d194: 90 10 00 18 mov %i0, %o0 200d198: b4 06 bf ff add %i2, -1, %i2 { size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; Chain_Node *next = starting_address; 200d19c: 82 10 00 19 mov %i1, %g1 head->previous = NULL; while ( count-- ) { 200d1a0: 92 10 00 1a mov %i2, %o1 ) { size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; 200d1a4: 10 80 00 05 b 200d1b8 <_Chain_Initialize+0x38> 200d1a8: 84 10 00 18 mov %i0, %g2 Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 200d1ac: 84 10 00 01 mov %g1, %g2 200d1b0: b4 06 bf ff add %i2, -1, %i2 current->next = next; next->previous = current; current = next; next = (Chain_Node *) 200d1b4: 82 10 00 03 mov %g3, %g1 Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { current->next = next; 200d1b8: c2 20 80 00 st %g1, [ %g2 ] next->previous = current; 200d1bc: c4 20 60 04 st %g2, [ %g1 + 4 ] Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 200d1c0: 80 a6 a0 00 cmp %i2, 0 200d1c4: 12 bf ff fa bne 200d1ac <_Chain_Initialize+0x2c> 200d1c8: 86 00 40 1b add %g1, %i3, %g3 * node_size - size of node in bytes * * Output parameters: NONE */ void _Chain_Initialize( 200d1cc: 40 00 2d 3a call 20186b4 <.umul> 200d1d0: 90 10 00 1b mov %i3, %o0 Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 200d1d4: 90 06 40 08 add %i1, %o0, %o0 current = next; next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } current->next = tail; 200d1d8: fa 22 00 00 st %i5, [ %o0 ] tail->previous = current; 200d1dc: d0 26 20 08 st %o0, [ %i0 + 8 ] } 200d1e0: 81 c7 e0 08 ret 200d1e4: 81 e8 00 00 restore =============================================================================== 02006458 <_Event_Surrender>: */ void _Event_Surrender( Thread_Control *the_thread ) { 2006458: 9d e3 bf a0 save %sp, -96, %sp 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 ]; 200645c: fa 06 21 58 ld [ %i0 + 0x158 ], %i5 option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); 2006460: 7f ff ef 4a call 2002188 2006464: f8 06 20 30 ld [ %i0 + 0x30 ], %i4 pending_events = api->pending_events; 2006468: c4 07 40 00 ld [ %i5 ], %g2 event_condition = (rtems_event_set) the_thread->Wait.count; 200646c: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 2006470: 86 88 40 02 andcc %g1, %g2, %g3 2006474: 02 80 00 39 be 2006558 <_Event_Surrender+0x100> 2006478: 09 00 80 77 sethi %hi(0x201dc00), %g4 /* * 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() && 200647c: 88 11 22 88 or %g4, 0x288, %g4 ! 201de88 <_Per_CPU_Information> 2006480: f2 01 20 08 ld [ %g4 + 8 ], %i1 2006484: 80 a6 60 00 cmp %i1, 0 2006488: 32 80 00 1c bne,a 20064f8 <_Event_Surrender+0xa0> 200648c: c8 01 20 0c ld [ %g4 + 0xc ], %g4 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_event ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_EVENT); 2006490: c8 06 20 10 ld [ %i0 + 0x10 ], %g4 } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 2006494: 80 89 21 00 btst 0x100, %g4 2006498: 02 80 00 30 be 2006558 <_Event_Surrender+0x100> 200649c: 80 a0 40 03 cmp %g1, %g3 if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 20064a0: 02 80 00 04 be 20064b0 <_Event_Surrender+0x58> 20064a4: 80 8f 20 02 btst 2, %i4 20064a8: 02 80 00 2c be 2006558 <_Event_Surrender+0x100> <== NEVER TAKEN 20064ac: 01 00 00 00 nop 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; 20064b0: c2 06 20 28 ld [ %i0 + 0x28 ], %g1 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) ); 20064b4: 84 28 80 03 andn %g2, %g3, %g2 /* * 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 ); 20064b8: c4 27 40 00 st %g2, [ %i5 ] the_thread->Wait.count = 0; 20064bc: c0 26 20 24 clr [ %i0 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 20064c0: c6 20 40 00 st %g3, [ %g1 ] _ISR_Flash( level ); 20064c4: 7f ff ef 35 call 2002198 20064c8: 01 00 00 00 nop 20064cc: 7f ff ef 2f call 2002188 20064d0: 01 00 00 00 nop if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 20064d4: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 20064d8: 80 a0 60 02 cmp %g1, 2 20064dc: 02 80 00 21 be 2006560 <_Event_Surrender+0x108> 20064e0: 82 10 20 03 mov 3, %g1 _ISR_Enable( level ); 20064e4: 7f ff ef 2d call 2002198 20064e8: 33 04 00 ff sethi %hi(0x1003fc00), %i1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 20064ec: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1003fff8 20064f0: 40 00 0a 74 call 2008ec0 <_Thread_Clear_state> 20064f4: 81 e8 00 00 restore /* * 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() && 20064f8: 80 a6 00 04 cmp %i0, %g4 20064fc: 32 bf ff e6 bne,a 2006494 <_Event_Surrender+0x3c> 2006500: c8 06 20 10 ld [ %i0 + 0x10 ], %g4 _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 2006504: 09 00 80 78 sethi %hi(0x201e000), %g4 2006508: f2 01 22 80 ld [ %g4 + 0x280 ], %i1 ! 201e280 <_Event_Sync_state> /* * 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 ) && 200650c: 80 a6 60 02 cmp %i1, 2 2006510: 02 80 00 07 be 200652c <_Event_Surrender+0xd4> <== NEVER TAKEN 2006514: 80 a0 40 03 cmp %g1, %g3 ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 2006518: f2 01 22 80 ld [ %g4 + 0x280 ], %i1 * 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) || 200651c: 80 a6 60 01 cmp %i1, 1 2006520: 32 bf ff dd bne,a 2006494 <_Event_Surrender+0x3c> 2006524: c8 06 20 10 ld [ %i0 + 0x10 ], %g4 (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 2006528: 80 a0 40 03 cmp %g1, %g3 200652c: 02 80 00 04 be 200653c <_Event_Surrender+0xe4> 2006530: 80 8f 20 02 btst 2, %i4 2006534: 02 80 00 09 be 2006558 <_Event_Surrender+0x100> <== NEVER TAKEN 2006538: 01 00 00 00 nop 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; 200653c: c2 06 20 28 ld [ %i0 + 0x28 ], %g1 2006540: 84 28 80 03 andn %g2, %g3, %g2 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 ); 2006544: c4 27 40 00 st %g2, [ %i5 ] the_thread->Wait.count = 0; 2006548: c0 26 20 24 clr [ %i0 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 200654c: c6 20 40 00 st %g3, [ %g1 ] _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 2006550: 82 10 20 03 mov 3, %g1 2006554: c2 21 22 80 st %g1, [ %g4 + 0x280 ] _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 2006558: 7f ff ef 10 call 2002198 200655c: 91 e8 00 08 restore %g0, %o0, %o0 RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 2006560: c2 26 20 50 st %g1, [ %i0 + 0x50 ] if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { _ISR_Enable( level ); _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 2006564: 7f ff ef 0d call 2002198 2006568: 33 04 00 ff sethi %hi(0x1003fc00), %i1 (void) _Watchdog_Remove( &the_thread->Timer ); 200656c: 40 00 0f 95 call 200a3c0 <_Watchdog_Remove> 2006570: 90 06 20 48 add %i0, 0x48, %o0 2006574: b2 16 63 f8 or %i1, 0x3f8, %i1 2006578: 40 00 0a 52 call 2008ec0 <_Thread_Clear_state> 200657c: 81 e8 00 00 restore =============================================================================== 02006580 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 2006580: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 2006584: 90 10 00 18 mov %i0, %o0 2006588: 40 00 0b 4d call 20092bc <_Thread_Get> 200658c: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 2006590: c2 07 bf fc ld [ %fp + -4 ], %g1 2006594: 80 a0 60 00 cmp %g1, 0 2006598: 12 80 00 16 bne 20065f0 <_Event_Timeout+0x70> <== NEVER TAKEN 200659c: ba 10 00 08 mov %o0, %i5 * * 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 ); 20065a0: 7f ff ee fa call 2002188 20065a4: 01 00 00 00 nop RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 20065a8: 03 00 80 77 sethi %hi(0x201dc00), %g1 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 20065ac: c2 00 62 94 ld [ %g1 + 0x294 ], %g1 ! 201de94 <_Per_CPU_Information+0xc> 20065b0: 80 a7 40 01 cmp %i5, %g1 20065b4: 02 80 00 11 be 20065f8 <_Event_Timeout+0x78> 20065b8: c0 27 60 24 clr [ %i5 + 0x24 ] if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } the_thread->Wait.return_code = RTEMS_TIMEOUT; 20065bc: 82 10 20 06 mov 6, %g1 20065c0: c2 27 60 34 st %g1, [ %i5 + 0x34 ] _ISR_Enable( level ); 20065c4: 7f ff ee f5 call 2002198 20065c8: 01 00 00 00 nop RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 20065cc: 90 10 00 1d mov %i5, %o0 20065d0: 13 04 00 ff sethi %hi(0x1003fc00), %o1 20065d4: 40 00 0a 3b call 2008ec0 <_Thread_Clear_state> 20065d8: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1003fff8 /** * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 20065dc: 03 00 80 76 sethi %hi(0x201d800), %g1 20065e0: c4 00 61 50 ld [ %g1 + 0x150 ], %g2 ! 201d950 <_Thread_Dispatch_disable_level> 20065e4: 84 00 bf ff add %g2, -1, %g2 20065e8: c4 20 61 50 st %g2, [ %g1 + 0x150 ] return _Thread_Dispatch_disable_level; 20065ec: c2 00 61 50 ld [ %g1 + 0x150 ], %g1 20065f0: 81 c7 e0 08 ret 20065f4: 81 e8 00 00 restore } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 20065f8: 03 00 80 78 sethi %hi(0x201e000), %g1 20065fc: c4 00 62 80 ld [ %g1 + 0x280 ], %g2 ! 201e280 <_Event_Sync_state> 2006600: 80 a0 a0 01 cmp %g2, 1 2006604: 32 bf ff ef bne,a 20065c0 <_Event_Timeout+0x40> 2006608: 82 10 20 06 mov 6, %g1 _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 200660c: 84 10 20 02 mov 2, %g2 2006610: c4 20 62 80 st %g2, [ %g1 + 0x280 ] } the_thread->Wait.return_code = RTEMS_TIMEOUT; 2006614: 10 bf ff eb b 20065c0 <_Event_Timeout+0x40> 2006618: 82 10 20 06 mov 6, %g1 =============================================================================== 0200d3b8 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 200d3b8: 9d e3 bf 98 save %sp, -104, %sp 200d3bc: ba 10 00 18 mov %i0, %i5 Heap_Statistics *const stats = &heap->stats; uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE 200d3c0: a0 06 60 04 add %i1, 4, %l0 - HEAP_ALLOC_BONUS; uintptr_t const page_size = heap->page_size; 200d3c4: ec 06 20 10 ld [ %i0 + 0x10 ], %l6 Heap_Block *block = NULL; uintptr_t alloc_begin = 0; uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { 200d3c8: 80 a6 40 10 cmp %i1, %l0 200d3cc: 18 80 00 23 bgu 200d458 <_Heap_Allocate_aligned_with_boundary+0xa0> 200d3d0: b0 10 20 00 clr %i0 /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 200d3d4: 80 a6 e0 00 cmp %i3, 0 200d3d8: 12 80 00 7d bne 200d5cc <_Heap_Allocate_aligned_with_boundary+0x214> 200d3dc: 80 a6 40 1b cmp %i1, %i3 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 200d3e0: e2 07 60 08 ld [ %i5 + 8 ], %l1 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 200d3e4: 80 a7 40 11 cmp %i5, %l1 200d3e8: 02 80 00 18 be 200d448 <_Heap_Allocate_aligned_with_boundary+0x90> 200d3ec: b8 10 20 00 clr %i4 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 200d3f0: 82 05 a0 07 add %l6, 7, %g1 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; 200d3f4: ae 10 20 04 mov 4, %l7 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 200d3f8: c2 27 bf fc st %g1, [ %fp + -4 ] + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; 200d3fc: 10 80 00 0b b 200d428 <_Heap_Allocate_aligned_with_boundary+0x70> 200d400: ae 25 c0 19 sub %l7, %i1, %l7 * 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 ) { if ( alignment == 0 ) { 200d404: 12 80 00 17 bne 200d460 <_Heap_Allocate_aligned_with_boundary+0xa8> 200d408: b0 04 60 08 add %l1, 8, %i0 } /* Statistics */ ++search_count; if ( alloc_begin != 0 ) { 200d40c: 80 a6 20 00 cmp %i0, 0 200d410: 12 80 00 5b bne 200d57c <_Heap_Allocate_aligned_with_boundary+0x1c4> 200d414: b8 07 20 01 inc %i4 break; } block = block->next; 200d418: e2 04 60 08 ld [ %l1 + 8 ], %l1 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 200d41c: 80 a7 40 11 cmp %i5, %l1 200d420: 22 80 00 0b be,a 200d44c <_Heap_Allocate_aligned_with_boundary+0x94> 200d424: c2 07 60 44 ld [ %i5 + 0x44 ], %g1 /* * 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 ) { 200d428: e4 04 60 04 ld [ %l1 + 4 ], %l2 200d42c: 80 a4 00 12 cmp %l0, %l2 200d430: 0a bf ff f5 bcs 200d404 <_Heap_Allocate_aligned_with_boundary+0x4c> 200d434: 80 a6 a0 00 cmp %i2, 0 if ( alloc_begin != 0 ) { break; } block = block->next; 200d438: e2 04 60 08 ld [ %l1 + 8 ], %l1 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 200d43c: 80 a7 40 11 cmp %i5, %l1 200d440: 12 bf ff fa bne 200d428 <_Heap_Allocate_aligned_with_boundary+0x70> 200d444: b8 07 20 01 inc %i4 boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { 200d448: c2 07 60 44 ld [ %i5 + 0x44 ], %g1 200d44c: 80 a0 40 1c cmp %g1, %i4 200d450: 0a 80 00 5a bcs 200d5b8 <_Heap_Allocate_aligned_with_boundary+0x200> 200d454: b0 10 20 00 clr %i0 stats->max_search = search_count; } return (void *) alloc_begin; } 200d458: 81 c7 e0 08 ret 200d45c: 81 e8 00 00 restore uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 200d460: c4 07 bf fc ld [ %fp + -4 ], %g2 if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 200d464: ea 07 60 14 ld [ %i5 + 0x14 ], %l5 - 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; 200d468: a4 0c bf fe and %l2, -2, %l2 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 200d46c: 82 20 80 15 sub %g2, %l5, %g1 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; 200d470: a4 04 40 12 add %l1, %l2, %l2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 200d474: 92 10 00 1a mov %i2, %o1 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_ALLOC_BONUS; uintptr_t alloc_begin = alloc_end - alloc_size; 200d478: b0 05 c0 12 add %l7, %l2, %i0 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 200d47c: a4 00 40 12 add %g1, %l2, %l2 200d480: 40 00 2d 73 call 2018a4c <.urem> 200d484: 90 10 00 18 mov %i0, %o0 200d488: b0 26 00 08 sub %i0, %o0, %i0 uintptr_t alloc_begin = alloc_end - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { 200d48c: 80 a4 80 18 cmp %l2, %i0 200d490: 1a 80 00 06 bcc 200d4a8 <_Heap_Allocate_aligned_with_boundary+0xf0> 200d494: a8 04 60 08 add %l1, 8, %l4 200d498: 90 10 00 12 mov %l2, %o0 200d49c: 40 00 2d 6c call 2018a4c <.urem> 200d4a0: 92 10 00 1a mov %i2, %o1 200d4a4: b0 24 80 08 sub %l2, %o0, %i0 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 200d4a8: 80 a6 e0 00 cmp %i3, 0 200d4ac: 02 80 00 24 be 200d53c <_Heap_Allocate_aligned_with_boundary+0x184> 200d4b0: 80 a5 00 18 cmp %l4, %i0 /* 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; 200d4b4: a4 06 00 19 add %i0, %i1, %l2 200d4b8: 92 10 00 1b mov %i3, %o1 200d4bc: 40 00 2d 64 call 2018a4c <.urem> 200d4c0: 90 10 00 12 mov %l2, %o0 200d4c4: 90 24 80 08 sub %l2, %o0, %o0 /* 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 ) { 200d4c8: 80 a6 00 08 cmp %i0, %o0 200d4cc: 1a 80 00 1b bcc 200d538 <_Heap_Allocate_aligned_with_boundary+0x180> 200d4d0: 80 a2 00 12 cmp %o0, %l2 200d4d4: 1a 80 00 1a bcc 200d53c <_Heap_Allocate_aligned_with_boundary+0x184> 200d4d8: 80 a5 00 18 cmp %l4, %i0 alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 200d4dc: a6 05 00 19 add %l4, %i1, %l3 uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 200d4e0: 80 a4 c0 08 cmp %l3, %o0 200d4e4: 08 80 00 08 bleu 200d504 <_Heap_Allocate_aligned_with_boundary+0x14c> 200d4e8: b0 10 20 00 clr %i0 } /* Statistics */ ++search_count; if ( alloc_begin != 0 ) { 200d4ec: 10 bf ff c9 b 200d410 <_Heap_Allocate_aligned_with_boundary+0x58> 200d4f0: 80 a6 20 00 cmp %i0, 0 /* 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 ) { 200d4f4: 1a 80 00 11 bcc 200d538 <_Heap_Allocate_aligned_with_boundary+0x180> 200d4f8: 80 a4 c0 08 cmp %l3, %o0 if ( boundary_line < boundary_floor ) { 200d4fc: 18 bf ff c4 bgu 200d40c <_Heap_Allocate_aligned_with_boundary+0x54><== NEVER TAKEN 200d500: b0 10 20 00 clr %i0 return 0; } alloc_begin = boundary_line - alloc_size; 200d504: b0 22 00 19 sub %o0, %i1, %i0 200d508: 92 10 00 1a mov %i2, %o1 200d50c: 40 00 2d 50 call 2018a4c <.urem> 200d510: 90 10 00 18 mov %i0, %o0 200d514: 92 10 00 1b mov %i3, %o1 200d518: b0 26 00 08 sub %i0, %o0, %i0 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 200d51c: a4 06 00 19 add %i0, %i1, %l2 200d520: 40 00 2d 4b call 2018a4c <.urem> 200d524: 90 10 00 12 mov %l2, %o0 200d528: 90 24 80 08 sub %l2, %o0, %o0 /* 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 ) { 200d52c: 80 a2 00 12 cmp %o0, %l2 200d530: 0a bf ff f1 bcs 200d4f4 <_Heap_Allocate_aligned_with_boundary+0x13c> 200d534: 80 a6 00 08 cmp %i0, %o0 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 ) { 200d538: 80 a5 00 18 cmp %l4, %i0 200d53c: 18 80 00 22 bgu 200d5c4 <_Heap_Allocate_aligned_with_boundary+0x20c> 200d540: 82 10 3f f8 mov -8, %g1 200d544: 90 10 00 18 mov %i0, %o0 200d548: a4 20 40 11 sub %g1, %l1, %l2 200d54c: 92 10 00 16 mov %l6, %o1 200d550: 40 00 2d 3f call 2018a4c <.urem> 200d554: a4 04 80 18 add %l2, %i0, %l2 uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; if ( free_size >= min_block_size || free_size == 0 ) { 200d558: 90 a4 80 08 subcc %l2, %o0, %o0 200d55c: 02 bf ff ad be 200d410 <_Heap_Allocate_aligned_with_boundary+0x58> 200d560: 80 a6 20 00 cmp %i0, 0 200d564: 80 a2 00 15 cmp %o0, %l5 return alloc_begin; } } return 0; 200d568: 82 40 3f ff addx %g0, -1, %g1 200d56c: b0 0e 00 01 and %i0, %g1, %i0 } /* Statistics */ ++search_count; if ( alloc_begin != 0 ) { 200d570: 80 a6 20 00 cmp %i0, 0 200d574: 02 bf ff a9 be 200d418 <_Heap_Allocate_aligned_with_boundary+0x60> 200d578: b8 07 20 01 inc %i4 search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; 200d57c: c4 07 60 48 ld [ %i5 + 0x48 ], %g2 stats->searches += search_count; 200d580: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; 200d584: 84 00 a0 01 inc %g2 stats->searches += search_count; 200d588: 82 00 40 1c add %g1, %i4, %g1 search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; 200d58c: c4 27 60 48 st %g2, [ %i5 + 0x48 ] stats->searches += search_count; 200d590: c2 27 60 4c st %g1, [ %i5 + 0x4c ] block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 200d594: 90 10 00 1d mov %i5, %o0 200d598: 92 10 00 11 mov %l1, %o1 200d59c: 94 10 00 18 mov %i0, %o2 200d5a0: 7f ff e9 ab call 2007c4c <_Heap_Block_allocate> 200d5a4: 96 10 00 19 mov %i1, %o3 boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { 200d5a8: c2 07 60 44 ld [ %i5 + 0x44 ], %g1 200d5ac: 80 a0 40 1c cmp %g1, %i4 200d5b0: 1a 80 00 03 bcc 200d5bc <_Heap_Allocate_aligned_with_boundary+0x204> 200d5b4: 01 00 00 00 nop stats->max_search = search_count; 200d5b8: f8 27 60 44 st %i4, [ %i5 + 0x44 ] } return (void *) alloc_begin; } 200d5bc: 81 c7 e0 08 ret 200d5c0: 81 e8 00 00 restore if ( free_size >= min_block_size || free_size == 0 ) { return alloc_begin; } } return 0; 200d5c4: 10 bf ff 92 b 200d40c <_Heap_Allocate_aligned_with_boundary+0x54> 200d5c8: b0 10 20 00 clr %i0 /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { 200d5cc: 18 bf ff a3 bgu 200d458 <_Heap_Allocate_aligned_with_boundary+0xa0> 200d5d0: 80 a6 a0 00 cmp %i2, 0 return NULL; } if ( alignment == 0 ) { 200d5d4: 22 bf ff 83 be,a 200d3e0 <_Heap_Allocate_aligned_with_boundary+0x28> 200d5d8: b4 10 00 16 mov %l6, %i2 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 200d5dc: 10 bf ff 82 b 200d3e4 <_Heap_Allocate_aligned_with_boundary+0x2c> 200d5e0: e2 07 60 08 ld [ %i5 + 8 ], %l1 =============================================================================== 0200d3dc <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { 200d3dc: 9d e3 bf 98 save %sp, -104, %sp 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; 200d3e0: c0 27 bf f8 clr [ %fp + -8 ] Heap_Block *extend_last_block = NULL; 200d3e4: c0 27 bf fc clr [ %fp + -4 ] 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; 200d3e8: ba 06 40 1a add %i1, %i2, %i5 uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 200d3ec: f8 06 20 20 ld [ %i0 + 0x20 ], %i4 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; 200d3f0: e0 06 20 10 ld [ %i0 + 0x10 ], %l0 uintptr_t const min_block_size = heap->min_block_size; 200d3f4: d6 06 20 14 ld [ %i0 + 0x14 ], %o3 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; 200d3f8: e4 06 20 30 ld [ %i0 + 0x30 ], %l2 uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { 200d3fc: 80 a6 40 1d cmp %i1, %i5 200d400: 08 80 00 05 bleu 200d414 <_Heap_Extend+0x38> 200d404: a2 10 20 00 clr %l1 if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; } 200d408: b0 0c 60 01 and %l1, 1, %i0 200d40c: 81 c7 e0 08 ret 200d410: 81 e8 00 00 restore if ( extend_area_end < extend_area_begin ) { return false; } extend_area_ok = _Heap_Get_first_and_last_block( 200d414: 90 10 00 19 mov %i1, %o0 200d418: 92 10 00 1a mov %i2, %o1 200d41c: 94 10 00 10 mov %l0, %o2 200d420: 98 07 bf f8 add %fp, -8, %o4 200d424: 7f ff e9 58 call 2007984 <_Heap_Get_first_and_last_block> 200d428: 9a 07 bf fc add %fp, -4, %o5 page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 200d42c: 80 8a 20 ff btst 0xff, %o0 200d430: 02 bf ff f6 be 200d408 <_Heap_Extend+0x2c> 200d434: aa 10 20 00 clr %l5 200d438: a2 10 00 1c mov %i4, %l1 200d43c: ac 10 20 00 clr %l6 200d440: a6 10 20 00 clr %l3 200d444: 10 80 00 14 b 200d494 <_Heap_Extend+0xb8> 200d448: a8 10 20 00 clr %l4 return false; } if ( extend_area_end == sub_area_begin ) { merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 200d44c: 2a 80 00 02 bcs,a 200d454 <_Heap_Extend+0x78> 200d450: ac 10 00 11 mov %l1, %l6 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 200d454: 90 10 00 1a mov %i2, %o0 200d458: 40 00 18 07 call 2013474 <.urem> 200d45c: 92 10 00 10 mov %l0, %o1 200d460: 82 06 bf f8 add %i2, -8, %g1 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 200d464: 80 a6 80 19 cmp %i2, %i1 200d468: 02 80 00 1c be 200d4d8 <_Heap_Extend+0xfc> 200d46c: 82 20 40 08 sub %g1, %o0, %g1 start_block->prev_size = extend_area_end; merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 200d470: 80 a6 40 1a cmp %i1, %i2 200d474: 38 80 00 02 bgu,a 200d47c <_Heap_Extend+0xa0> 200d478: aa 10 00 01 mov %g1, %l5 - 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; 200d47c: e2 00 60 04 ld [ %g1 + 4 ], %l1 200d480: a2 0c 7f fe and %l1, -2, %l1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 200d484: a2 04 40 01 add %l1, %g1, %l1 link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 200d488: 80 a7 00 11 cmp %i4, %l1 200d48c: 22 80 00 1b be,a 200d4f8 <_Heap_Extend+0x11c> 200d490: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 return false; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 200d494: 80 a4 40 1c cmp %l1, %i4 200d498: 02 80 00 66 be 200d630 <_Heap_Extend+0x254> 200d49c: 82 10 00 11 mov %l1, %g1 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 ( 200d4a0: 80 a0 40 1d cmp %g1, %i5 200d4a4: 0a 80 00 70 bcs 200d664 <_Heap_Extend+0x288> 200d4a8: f4 04 40 00 ld [ %l1 ], %i2 sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 200d4ac: 80 a0 40 1d cmp %g1, %i5 200d4b0: 12 bf ff e7 bne 200d44c <_Heap_Extend+0x70> 200d4b4: 80 a7 40 1a cmp %i5, %i2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 200d4b8: 90 10 00 1a mov %i2, %o0 200d4bc: 40 00 17 ee call 2013474 <.urem> 200d4c0: 92 10 00 10 mov %l0, %o1 200d4c4: 82 06 bf f8 add %i2, -8, %g1 200d4c8: a8 10 00 11 mov %l1, %l4 merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 200d4cc: 80 a6 80 19 cmp %i2, %i1 200d4d0: 12 bf ff e8 bne 200d470 <_Heap_Extend+0x94> <== ALWAYS TAKEN 200d4d4: 82 20 40 08 sub %g1, %o0, %g1 start_block->prev_size = extend_area_end; 200d4d8: fa 24 40 00 st %i5, [ %l1 ] - 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; 200d4dc: e2 00 60 04 ld [ %g1 + 4 ], %l1 200d4e0: a2 0c 7f fe and %l1, -2, %l1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 200d4e4: a2 04 40 01 add %l1, %g1, %l1 } else if ( sub_area_end < extend_area_begin ) { link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 200d4e8: 80 a7 00 11 cmp %i4, %l1 200d4ec: 12 bf ff ea bne 200d494 <_Heap_Extend+0xb8> <== NEVER TAKEN 200d4f0: a6 10 00 01 mov %g1, %l3 if ( extend_area_begin < heap->area_begin ) { 200d4f4: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 200d4f8: 80 a6 40 01 cmp %i1, %g1 200d4fc: 3a 80 00 55 bcc,a 200d650 <_Heap_Extend+0x274> 200d500: c2 06 20 1c ld [ %i0 + 0x1c ], %g1 heap->area_begin = extend_area_begin; 200d504: f2 26 20 18 st %i1, [ %i0 + 0x18 ] } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 200d508: c2 07 bf f8 ld [ %fp + -8 ], %g1 200d50c: c4 07 bf fc ld [ %fp + -4 ], %g2 extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 200d510: c8 06 20 20 ld [ %i0 + 0x20 ], %g4 heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 200d514: 86 20 80 01 sub %g2, %g1, %g3 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; 200d518: fa 20 40 00 st %i5, [ %g1 ] extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 200d51c: b8 10 e0 01 or %g3, 1, %i4 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 = 200d520: f8 20 60 04 st %i4, [ %g1 + 4 ] extend_first_block_size | HEAP_PREV_BLOCK_USED; _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; 200d524: c6 20 80 00 st %g3, [ %g2 ] extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 200d528: 80 a1 00 01 cmp %g4, %g1 200d52c: 08 80 00 43 bleu 200d638 <_Heap_Extend+0x25c> 200d530: c0 20 a0 04 clr [ %g2 + 4 ] heap->first_block = extend_first_block; 200d534: c2 26 20 20 st %g1, [ %i0 + 0x20 ] } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { 200d538: 80 a5 20 00 cmp %l4, 0 200d53c: 02 80 00 63 be 200d6c8 <_Heap_Extend+0x2ec> 200d540: b2 06 60 08 add %i1, 8, %i1 Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; 200d544: f8 06 20 10 ld [ %i0 + 0x10 ], %i4 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 200d548: 92 10 00 1c mov %i4, %o1 200d54c: 40 00 17 ca call 2013474 <.urem> 200d550: 90 10 00 19 mov %i1, %o0 if ( remainder != 0 ) { 200d554: 80 a2 20 00 cmp %o0, 0 200d558: 02 80 00 04 be 200d568 <_Heap_Extend+0x18c> 200d55c: c4 05 00 00 ld [ %l4 ], %g2 return value - remainder + alignment; 200d560: b2 06 40 1c add %i1, %i4, %i1 200d564: b2 26 40 08 sub %i1, %o0, %i1 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 = 200d568: 82 06 7f f8 add %i1, -8, %g1 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; 200d56c: c4 26 7f f8 st %g2, [ %i1 + -8 ] 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 = 200d570: 84 25 00 01 sub %l4, %g1, %g2 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; 200d574: 84 10 a0 01 or %g2, 1, %g2 _Heap_Free_block( heap, new_first_block ); 200d578: 90 10 00 18 mov %i0, %o0 200d57c: 92 10 00 01 mov %g1, %o1 200d580: 7f ff ff 8d call 200d3b4 <_Heap_Free_block> 200d584: c4 26 7f fc st %g2, [ %i1 + -4 ] link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 200d588: 80 a4 e0 00 cmp %l3, 0 200d58c: 02 80 00 3b be 200d678 <_Heap_Extend+0x29c> 200d590: ba 07 7f f8 add %i5, -8, %i5 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 200d594: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 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( 200d598: ba 27 40 13 sub %i5, %l3, %i5 200d59c: 40 00 17 b6 call 2013474 <.urem> 200d5a0: 90 10 00 1d mov %i5, %o0 ); 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) 200d5a4: c2 04 e0 04 ld [ %l3 + 4 ], %g1 200d5a8: ba 27 40 08 sub %i5, %o0, %i5 200d5ac: 82 20 40 1d sub %g1, %i5, %g1 | HEAP_PREV_BLOCK_USED; 200d5b0: 82 10 60 01 or %g1, 1, %g1 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = 200d5b4: 84 07 40 13 add %i5, %l3, %g2 200d5b8: c2 20 a0 04 st %g1, [ %g2 + 4 ] 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; 200d5bc: c2 04 e0 04 ld [ %l3 + 4 ], %g1 (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 ); 200d5c0: 90 10 00 18 mov %i0, %o0 200d5c4: 82 08 60 01 and %g1, 1, %g1 200d5c8: 92 10 00 13 mov %l3, %o1 block->size_and_flag = size | flag; 200d5cc: ba 17 40 01 or %i5, %g1, %i5 200d5d0: 7f ff ff 79 call 200d3b4 <_Heap_Free_block> 200d5d4: fa 24 e0 04 st %i5, [ %l3 + 4 ] extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 200d5d8: 80 a4 e0 00 cmp %l3, 0 200d5dc: 02 80 00 34 be 200d6ac <_Heap_Extend+0x2d0> 200d5e0: 80 a5 20 00 cmp %l4, 0 if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; } 200d5e4: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 * 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( 200d5e8: c6 06 20 20 ld [ %i0 + 0x20 ], %g3 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; 200d5ec: c4 00 60 04 ld [ %g1 + 4 ], %g2 * 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( 200d5f0: 86 20 c0 01 sub %g3, %g1, %g3 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; 200d5f4: 84 08 a0 01 and %g2, 1, %g2 block->size_and_flag = size | flag; 200d5f8: 84 10 80 03 or %g2, %g3, %g2 200d5fc: c4 20 60 04 st %g2, [ %g1 + 4 ] _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; /* Statistics */ stats->size += extended_size; 200d600: c2 06 20 2c ld [ %i0 + 0x2c ], %g1 _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 200d604: c4 06 20 30 ld [ %i0 + 0x30 ], %g2 stats->size += extended_size; if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; 200d608: a2 10 20 01 mov 1, %l1 _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 200d60c: a4 20 80 12 sub %g2, %l2, %l2 /* Statistics */ stats->size += extended_size; 200d610: 82 00 40 12 add %g1, %l2, %g1 if ( extended_size_ptr != NULL ) 200d614: 80 a6 e0 00 cmp %i3, 0 200d618: 02 bf ff 7c be 200d408 <_Heap_Extend+0x2c> <== NEVER TAKEN 200d61c: c2 26 20 2c st %g1, [ %i0 + 0x2c ] *extended_size_ptr = extended_size; 200d620: e4 26 c0 00 st %l2, [ %i3 ] return true; } 200d624: b0 0c 60 01 and %l1, 1, %i0 200d628: 81 c7 e0 08 ret 200d62c: 81 e8 00 00 restore return false; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 200d630: 10 bf ff 9c b 200d4a0 <_Heap_Extend+0xc4> 200d634: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { heap->first_block = extend_first_block; } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 200d638: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 200d63c: 80 a0 40 02 cmp %g1, %g2 200d640: 2a bf ff be bcs,a 200d538 <_Heap_Extend+0x15c> 200d644: c4 26 20 24 st %g2, [ %i0 + 0x24 ] heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { 200d648: 10 bf ff bd b 200d53c <_Heap_Extend+0x160> 200d64c: 80 a5 20 00 cmp %l4, 0 start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); if ( extend_area_begin < heap->area_begin ) { heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { 200d650: 80 a7 40 01 cmp %i5, %g1 200d654: 38 bf ff ad bgu,a 200d508 <_Heap_Extend+0x12c> 200d658: fa 26 20 1c st %i5, [ %i0 + 0x1c ] heap->area_end = extend_area_end; } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 200d65c: 10 bf ff ac b 200d50c <_Heap_Extend+0x130> 200d660: c2 07 bf f8 ld [ %fp + -8 ], %g1 (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 ( 200d664: 80 a6 40 1a cmp %i1, %i2 200d668: 1a bf ff 92 bcc 200d4b0 <_Heap_Extend+0xd4> 200d66c: 80 a0 40 1d cmp %g1, %i5 sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; 200d670: 10 bf ff 66 b 200d408 <_Heap_Extend+0x2c> 200d674: a2 10 20 00 clr %l1 ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 200d678: 80 a5 60 00 cmp %l5, 0 200d67c: 02 bf ff d7 be 200d5d8 <_Heap_Extend+0x1fc> 200d680: c4 07 bf f8 ld [ %fp + -8 ], %g2 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; 200d684: c6 05 60 04 ld [ %l5 + 4 ], %g3 _Heap_Link_above( 200d688: c2 07 bf fc ld [ %fp + -4 ], %g1 200d68c: 86 08 e0 01 and %g3, 1, %g3 ) { 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 ); 200d690: 84 20 80 15 sub %g2, %l5, %g2 block->size_and_flag = size | flag; 200d694: 84 10 c0 02 or %g3, %g2, %g2 200d698: c4 25 60 04 st %g2, [ %l5 + 4 ] last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 200d69c: c4 00 60 04 ld [ %g1 + 4 ], %g2 200d6a0: 84 10 a0 01 or %g2, 1, %g2 200d6a4: 10 bf ff cd b 200d5d8 <_Heap_Extend+0x1fc> 200d6a8: c4 20 60 04 st %g2, [ %g1 + 4 ] extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 200d6ac: 32 bf ff cf bne,a 200d5e8 <_Heap_Extend+0x20c> 200d6b0: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 _Heap_Free_block( heap, extend_first_block ); 200d6b4: d2 07 bf f8 ld [ %fp + -8 ], %o1 200d6b8: 7f ff ff 3f call 200d3b4 <_Heap_Free_block> 200d6bc: 90 10 00 18 mov %i0, %o0 if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; } 200d6c0: 10 bf ff ca b 200d5e8 <_Heap_Extend+0x20c> 200d6c4: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 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 ) { 200d6c8: 80 a5 a0 00 cmp %l6, 0 200d6cc: 02 bf ff b0 be 200d58c <_Heap_Extend+0x1b0> 200d6d0: 80 a4 e0 00 cmp %l3, 0 { 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; 200d6d4: ac 25 80 02 sub %l6, %g2, %l6 200d6d8: ac 15 a0 01 or %l6, 1, %l6 ) { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = 200d6dc: 10 bf ff ac b 200d58c <_Heap_Extend+0x1b0> 200d6e0: ec 20 a0 04 st %l6, [ %g2 + 4 ] =============================================================================== 0200d5e4 <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 200d5e4: 9d e3 bf a0 save %sp, -96, %sp /* * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { 200d5e8: 80 a6 60 00 cmp %i1, 0 200d5ec: 02 80 00 56 be 200d744 <_Heap_Free+0x160> 200d5f0: 84 10 20 01 mov 1, %g2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 200d5f4: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 200d5f8: 40 00 2d 15 call 2018a4c <.urem> 200d5fc: 90 10 00 19 mov %i1, %o0 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 200d600: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 200d604: ba 06 7f f8 add %i1, -8, %i5 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 200d608: ba 27 40 08 sub %i5, %o0, %i5 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; 200d60c: 80 a7 40 01 cmp %i5, %g1 200d610: 0a 80 00 4d bcs 200d744 <_Heap_Free+0x160> 200d614: 84 10 20 00 clr %g2 200d618: c8 06 20 24 ld [ %i0 + 0x24 ], %g4 200d61c: 80 a7 40 04 cmp %i5, %g4 200d620: 38 80 00 4a bgu,a 200d748 <_Heap_Free+0x164> 200d624: b0 08 a0 01 and %g2, 1, %i0 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 200d628: de 07 60 04 ld [ %i5 + 4 ], %o7 - 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; 200d62c: b2 0b ff fe and %o7, -2, %i1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 200d630: 86 06 40 1d add %i1, %i5, %g3 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; 200d634: 80 a0 40 03 cmp %g1, %g3 200d638: 38 80 00 44 bgu,a 200d748 <_Heap_Free+0x164> <== NEVER TAKEN 200d63c: b0 08 a0 01 and %g2, 1, %i0 <== NOT EXECUTED 200d640: 80 a1 00 03 cmp %g4, %g3 200d644: 2a 80 00 41 bcs,a 200d748 <_Heap_Free+0x164> <== NEVER TAKEN 200d648: b0 08 a0 01 and %g2, 1, %i0 <== NOT EXECUTED 200d64c: da 00 e0 04 ld [ %g3 + 4 ], %o5 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 200d650: 80 8b 60 01 btst 1, %o5 200d654: 02 80 00 3c be 200d744 <_Heap_Free+0x160> <== NEVER TAKEN 200d658: 98 0b 7f fe and %o5, -2, %o4 return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 200d65c: 80 a1 00 03 cmp %g4, %g3 200d660: 02 80 00 06 be 200d678 <_Heap_Free+0x94> 200d664: 9a 10 20 00 clr %o5 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 200d668: 84 00 c0 0c add %g3, %o4, %g2 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; 200d66c: da 00 a0 04 ld [ %g2 + 4 ], %o5 200d670: 9a 0b 60 01 and %o5, 1, %o5 return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 200d674: 9a 1b 60 01 xor %o5, 1, %o5 next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 200d678: 80 8b e0 01 btst 1, %o7 200d67c: 12 80 00 1c bne 200d6ec <_Heap_Free+0x108> 200d680: 80 8b 60 ff btst 0xff, %o5 uintptr_t const prev_size = block->prev_size; 200d684: d6 07 40 00 ld [ %i5 ], %o3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 200d688: 9e 27 40 0b sub %i5, %o3, %o7 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; 200d68c: 80 a0 40 0f cmp %g1, %o7 200d690: 18 80 00 2d bgu 200d744 <_Heap_Free+0x160> <== NEVER TAKEN 200d694: 84 10 20 00 clr %g2 200d698: 80 a1 00 0f cmp %g4, %o7 200d69c: 2a 80 00 2b bcs,a 200d748 <_Heap_Free+0x164> <== NEVER TAKEN 200d6a0: b0 08 a0 01 and %g2, 1, %i0 <== NOT EXECUTED 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; 200d6a4: c2 03 e0 04 ld [ %o7 + 4 ], %g1 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) ) { 200d6a8: 80 88 60 01 btst 1, %g1 200d6ac: 02 80 00 26 be 200d744 <_Heap_Free+0x160> <== NEVER TAKEN 200d6b0: 80 8b 60 ff btst 0xff, %o5 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 200d6b4: 02 80 00 39 be 200d798 <_Heap_Free+0x1b4> 200d6b8: 96 06 40 0b add %i1, %o3, %o3 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 200d6bc: c2 00 e0 08 ld [ %g3 + 8 ], %g1 200d6c0: c4 00 e0 0c ld [ %g3 + 0xc ], %g2 } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 200d6c4: c6 06 20 38 ld [ %i0 + 0x38 ], %g3 RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 200d6c8: c2 20 a0 08 st %g1, [ %g2 + 8 ] next->prev = prev; 200d6cc: c4 20 60 0c st %g2, [ %g1 + 0xc ] 200d6d0: 82 00 ff ff add %g3, -1, %g1 200d6d4: c2 26 20 38 st %g1, [ %i0 + 0x38 ] _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; 200d6d8: 98 02 c0 0c add %o3, %o4, %o4 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 200d6dc: 82 13 20 01 or %o4, 1, %g1 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 200d6e0: d8 23 00 0f st %o4, [ %o4 + %o7 ] if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 200d6e4: 10 80 00 0e b 200d71c <_Heap_Free+0x138> 200d6e8: c2 23 e0 04 st %g1, [ %o7 + 4 ] uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 200d6ec: 22 80 00 19 be,a 200d750 <_Heap_Free+0x16c> 200d6f0: c4 06 20 08 ld [ %i0 + 8 ], %g2 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 200d6f4: c4 00 e0 08 ld [ %g3 + 8 ], %g2 200d6f8: c2 00 e0 0c ld [ %g3 + 0xc ], %g1 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 200d6fc: c4 27 60 08 st %g2, [ %i5 + 8 ] new_block->prev = prev; 200d700: c2 27 60 0c st %g1, [ %i5 + 0xc ] prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; 200d704: 98 03 00 19 add %o4, %i1, %o4 next->prev = new_block; 200d708: fa 20 a0 0c st %i5, [ %g2 + 0xc ] prev->next = new_block; 200d70c: fa 20 60 08 st %i5, [ %g1 + 8 ] _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 200d710: 84 13 20 01 or %o4, 1, %g2 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 200d714: d8 23 00 1d st %o4, [ %o4 + %i5 ] next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 200d718: c4 27 60 04 st %g2, [ %i5 + 4 ] stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 200d71c: c4 06 20 40 ld [ %i0 + 0x40 ], %g2 ++stats->frees; 200d720: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 stats->free_size += block_size; 200d724: c6 06 20 30 ld [ %i0 + 0x30 ], %g3 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 200d728: 84 00 bf ff add %g2, -1, %g2 ++stats->frees; 200d72c: 82 00 60 01 inc %g1 stats->free_size += block_size; 200d730: b2 00 c0 19 add %g3, %i1, %i1 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 200d734: c4 26 20 40 st %g2, [ %i0 + 0x40 ] ++stats->frees; 200d738: c2 26 20 50 st %g1, [ %i0 + 0x50 ] stats->free_size += block_size; 200d73c: f2 26 20 30 st %i1, [ %i0 + 0x30 ] return( true ); 200d740: 84 10 20 01 mov 1, %g2 } 200d744: b0 08 a0 01 and %g2, 1, %i0 200d748: 81 c7 e0 08 ret 200d74c: 81 e8 00 00 restore 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; 200d750: 82 16 60 01 or %i1, 1, %g1 200d754: c2 27 60 04 st %g1, [ %i5 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 200d758: c8 00 e0 04 ld [ %g3 + 4 ], %g4 ) { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; 200d75c: f0 27 60 0c st %i0, [ %i5 + 0xc ] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 200d760: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 200d764: c4 27 60 08 st %g2, [ %i5 + 8 ] new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 200d768: fa 20 a0 0c st %i5, [ %g2 + 0xc ] } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 200d76c: 84 09 3f fe and %g4, -2, %g2 next_block->prev_size = block_size; 200d770: f2 26 40 1d st %i1, [ %i1 + %i5 ] } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 200d774: c4 20 e0 04 st %g2, [ %g3 + 4 ] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { 200d778: c4 06 20 3c ld [ %i0 + 0x3c ], %g2 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; 200d77c: 82 00 60 01 inc %g1 { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 200d780: fa 26 20 08 st %i5, [ %i0 + 8 ] if ( stats->max_free_blocks < stats->free_blocks ) { 200d784: 80 a0 40 02 cmp %g1, %g2 200d788: 08 bf ff e5 bleu 200d71c <_Heap_Free+0x138> 200d78c: c2 26 20 38 st %g1, [ %i0 + 0x38 ] stats->max_free_blocks = stats->free_blocks; 200d790: 10 bf ff e3 b 200d71c <_Heap_Free+0x138> 200d794: c2 26 20 3c st %g1, [ %i0 + 0x3c ] next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 200d798: 82 12 e0 01 or %o3, 1, %g1 200d79c: c2 23 e0 04 st %g1, [ %o7 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 200d7a0: c2 00 e0 04 ld [ %g3 + 4 ], %g1 next_block->prev_size = size; 200d7a4: d6 26 40 1d st %o3, [ %i1 + %i5 ] _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; 200d7a8: 82 08 7f fe and %g1, -2, %g1 200d7ac: 10 bf ff dc b 200d71c <_Heap_Free+0x138> 200d7b0: c2 20 e0 04 st %g1, [ %g3 + 4 ] =============================================================================== 0200dcf0 <_Heap_Get_information>: void _Heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { 200dcf0: 9d e3 bf a0 save %sp, -96, %sp Heap_Block *the_block = the_heap->first_block; 200dcf4: fa 06 20 20 ld [ %i0 + 0x20 ], %i5 Heap_Block *const end = the_heap->last_block; 200dcf8: f8 06 20 24 ld [ %i0 + 0x24 ], %i4 memset(the_info, 0, sizeof(*the_info)); 200dcfc: 92 10 20 00 clr %o1 200dd00: 90 10 00 19 mov %i1, %o0 200dd04: 40 00 0a 5c call 2010674 200dd08: 94 10 20 18 mov 0x18, %o2 while ( the_block != end ) { 200dd0c: 80 a7 40 1c cmp %i5, %i4 200dd10: 02 80 00 17 be 200dd6c <_Heap_Get_information+0x7c> <== NEVER TAKEN 200dd14: 01 00 00 00 nop 200dd18: c6 07 60 04 ld [ %i5 + 4 ], %g3 - 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; 200dd1c: 84 08 ff fe and %g3, -2, %g2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 200dd20: ba 07 40 02 add %i5, %g2, %i5 if ( info->largest < the_size ) info->largest = the_size; the_block = next_block; } } 200dd24: c6 07 60 04 ld [ %i5 + 4 ], %g3 while ( the_block != end ) { uintptr_t const the_size = _Heap_Block_size(the_block); Heap_Block *const next_block = _Heap_Block_at(the_block, the_size); Heap_Information *info; if ( _Heap_Is_prev_used(next_block) ) 200dd28: 80 88 e0 01 btst 1, %g3 200dd2c: 02 80 00 03 be 200dd38 <_Heap_Get_information+0x48> 200dd30: 82 10 00 19 mov %i1, %g1 info = &the_info->Used; 200dd34: 82 06 60 0c add %i1, 0xc, %g1 else info = &the_info->Free; info->number++; 200dd38: de 00 40 00 ld [ %g1 ], %o7 info->total += the_size; 200dd3c: f0 00 60 08 ld [ %g1 + 8 ], %i0 if ( info->largest < the_size ) 200dd40: c8 00 60 04 ld [ %g1 + 4 ], %g4 if ( _Heap_Is_prev_used(next_block) ) info = &the_info->Used; else info = &the_info->Free; info->number++; 200dd44: 9e 03 e0 01 inc %o7 info->total += the_size; 200dd48: b0 06 00 02 add %i0, %g2, %i0 if ( _Heap_Is_prev_used(next_block) ) info = &the_info->Used; else info = &the_info->Free; info->number++; 200dd4c: de 20 40 00 st %o7, [ %g1 ] info->total += the_size; if ( info->largest < the_size ) 200dd50: 80 a1 00 02 cmp %g4, %g2 200dd54: 1a 80 00 03 bcc 200dd60 <_Heap_Get_information+0x70> 200dd58: f0 20 60 08 st %i0, [ %g1 + 8 ] info->largest = the_size; 200dd5c: c4 20 60 04 st %g2, [ %g1 + 4 ] Heap_Block *the_block = the_heap->first_block; Heap_Block *const end = the_heap->last_block; memset(the_info, 0, sizeof(*the_info)); while ( the_block != end ) { 200dd60: 80 a7 00 1d cmp %i4, %i5 200dd64: 12 bf ff ef bne 200dd20 <_Heap_Get_information+0x30> 200dd68: 84 08 ff fe and %g3, -2, %g2 200dd6c: 81 c7 e0 08 ret 200dd70: 81 e8 00 00 restore =============================================================================== 0201aafc <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 201aafc: 9d e3 bf a0 save %sp, -96, %sp RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 201ab00: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 201ab04: 7f ff f7 d2 call 2018a4c <.urem> 201ab08: 90 10 00 19 mov %i1, %o0 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 201ab0c: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 201ab10: 84 06 7f f8 add %i1, -8, %g2 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 201ab14: 84 20 80 08 sub %g2, %o0, %g2 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; 201ab18: 80 a0 80 01 cmp %g2, %g1 201ab1c: 0a 80 00 16 bcs 201ab74 <_Heap_Size_of_alloc_area+0x78> 201ab20: 86 10 20 00 clr %g3 201ab24: c8 06 20 24 ld [ %i0 + 0x24 ], %g4 201ab28: 80 a0 80 04 cmp %g2, %g4 201ab2c: 18 80 00 13 bgu 201ab78 <_Heap_Size_of_alloc_area+0x7c> <== NEVER TAKEN 201ab30: b0 08 e0 01 and %g3, 1, %i0 - 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; 201ab34: f0 00 a0 04 ld [ %g2 + 4 ], %i0 201ab38: b0 0e 3f fe and %i0, -2, %i0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 201ab3c: 84 06 00 02 add %i0, %g2, %g2 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; 201ab40: 80 a0 40 02 cmp %g1, %g2 201ab44: 18 80 00 0d bgu 201ab78 <_Heap_Size_of_alloc_area+0x7c> <== NEVER TAKEN 201ab48: b0 08 e0 01 and %g3, 1, %i0 201ab4c: 80 a1 00 02 cmp %g4, %g2 201ab50: 0a 80 00 0a bcs 201ab78 <_Heap_Size_of_alloc_area+0x7c> <== NEVER TAKEN 201ab54: 01 00 00 00 nop 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; 201ab58: c2 00 a0 04 ld [ %g2 + 4 ], %g1 block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 201ab5c: 80 88 60 01 btst 1, %g1 201ab60: 02 80 00 06 be 201ab78 <_Heap_Size_of_alloc_area+0x7c> <== NEVER TAKEN 201ab64: 84 20 80 19 sub %g2, %i1, %g2 return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; 201ab68: 86 10 20 01 mov 1, %g3 || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 201ab6c: 84 00 a0 04 add %g2, 4, %g2 201ab70: c4 26 80 00 st %g2, [ %i2 ] return true; } 201ab74: b0 08 e0 01 and %g3, 1, %i0 201ab78: 81 c7 e0 08 ret 201ab7c: 81 e8 00 00 restore =============================================================================== 02008704 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 2008704: 9d e3 bf 80 save %sp, -128, %sp 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; 2008708: 3b 00 80 21 sethi %hi(0x2008400), %i5 Heap_Control *heap, int source, bool dump ) { uintptr_t const page_size = heap->page_size; 200870c: e0 06 20 10 ld [ %i0 + 0x10 ], %l0 uintptr_t const min_block_size = heap->min_block_size; 2008710: f6 06 20 14 ld [ %i0 + 0x14 ], %i3 Heap_Block *const first_block = heap->first_block; 2008714: f8 06 20 20 ld [ %i0 + 0x20 ], %i4 Heap_Block *const last_block = heap->last_block; 2008718: e2 06 20 24 ld [ %i0 + 0x24 ], %l1 Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 200871c: 80 a6 a0 00 cmp %i2, 0 2008720: 02 80 00 04 be 2008730 <_Heap_Walk+0x2c> 2008724: ba 17 62 98 or %i5, 0x298, %i5 2008728: 3b 00 80 21 sethi %hi(0x2008400), %i5 200872c: ba 17 62 a0 or %i5, 0x2a0, %i5 ! 20086a0 <_Heap_Walk_print> if ( !_System_state_Is_up( _System_state_Get() ) ) { 2008730: 03 00 80 64 sethi %hi(0x2019000), %g1 2008734: c4 00 63 ec ld [ %g1 + 0x3ec ], %g2 ! 20193ec <_System_state_Current> 2008738: 80 a0 a0 03 cmp %g2, 3 200873c: 02 80 00 05 be 2008750 <_Heap_Walk+0x4c> 2008740: 82 10 20 01 mov 1, %g1 block = next_block; } while ( block != first_block ); return true; } 2008744: b0 08 60 01 and %g1, 1, %i0 2008748: 81 c7 e0 08 ret 200874c: 81 e8 00 00 restore 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)( 2008750: da 06 20 18 ld [ %i0 + 0x18 ], %o5 2008754: c6 06 20 1c ld [ %i0 + 0x1c ], %g3 2008758: c4 06 20 08 ld [ %i0 + 8 ], %g2 200875c: c2 06 20 0c ld [ %i0 + 0xc ], %g1 2008760: 90 10 00 19 mov %i1, %o0 2008764: c6 23 a0 5c st %g3, [ %sp + 0x5c ] 2008768: f8 23 a0 60 st %i4, [ %sp + 0x60 ] 200876c: e2 23 a0 64 st %l1, [ %sp + 0x64 ] 2008770: c4 23 a0 68 st %g2, [ %sp + 0x68 ] 2008774: c2 23 a0 6c st %g1, [ %sp + 0x6c ] 2008778: 92 10 20 00 clr %o1 200877c: 96 10 00 10 mov %l0, %o3 2008780: 15 00 80 59 sethi %hi(0x2016400), %o2 2008784: 98 10 00 1b mov %i3, %o4 2008788: 9f c7 40 00 call %i5 200878c: 94 12 a3 58 or %o2, 0x358, %o2 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 2008790: 80 a4 20 00 cmp %l0, 0 2008794: 02 80 00 28 be 2008834 <_Heap_Walk+0x130> 2008798: 80 8c 20 07 btst 7, %l0 (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 200879c: 12 80 00 2d bne 2008850 <_Heap_Walk+0x14c> 20087a0: 90 10 00 1b mov %i3, %o0 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 20087a4: 7f ff e4 ca call 2001acc <.urem> 20087a8: 92 10 00 10 mov %l0, %o1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 20087ac: 80 a2 20 00 cmp %o0, 0 20087b0: 12 80 00 30 bne 2008870 <_Heap_Walk+0x16c> 20087b4: 90 07 20 08 add %i4, 8, %o0 20087b8: 7f ff e4 c5 call 2001acc <.urem> 20087bc: 92 10 00 10 mov %l0, %o1 ); return false; } if ( 20087c0: 80 a2 20 00 cmp %o0, 0 20087c4: 32 80 00 33 bne,a 2008890 <_Heap_Walk+0x18c> 20087c8: 90 10 00 19 mov %i1, %o0 block = next_block; } while ( block != first_block ); return true; } 20087cc: e8 07 20 04 ld [ %i4 + 4 ], %l4 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 20087d0: 80 8d 20 01 btst 1, %l4 20087d4: 22 80 00 36 be,a 20088ac <_Heap_Walk+0x1a8> 20087d8: 90 10 00 19 mov %i1, %o0 - 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; 20087dc: c2 04 60 04 ld [ %l1 + 4 ], %g1 20087e0: 82 08 7f fe and %g1, -2, %g1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 20087e4: 82 04 40 01 add %l1, %g1, %g1 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; 20087e8: c4 00 60 04 ld [ %g1 + 4 ], %g2 ); return false; } if ( _Heap_Is_free( last_block ) ) { 20087ec: 80 88 a0 01 btst 1, %g2 20087f0: 02 80 00 0a be 2008818 <_Heap_Walk+0x114> 20087f4: 80 a7 00 01 cmp %i4, %g1 ); return false; } if ( 20087f8: 02 80 00 33 be 20088c4 <_Heap_Walk+0x1c0> 20087fc: 90 10 00 19 mov %i1, %o0 _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 2008800: 92 10 20 01 mov 1, %o1 2008804: 15 00 80 5a sethi %hi(0x2016800), %o2 2008808: 9f c7 40 00 call %i5 200880c: 94 12 a0 d0 or %o2, 0xd0, %o2 ! 20168d0 <_Status_Object_name_errors_to_status+0x1f0> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 2008810: 10 bf ff cd b 2008744 <_Heap_Walk+0x40> 2008814: 82 10 20 00 clr %g1 return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)( 2008818: 90 10 00 19 mov %i1, %o0 200881c: 92 10 20 01 mov 1, %o1 2008820: 15 00 80 5a sethi %hi(0x2016800), %o2 2008824: 9f c7 40 00 call %i5 2008828: 94 12 a0 b8 or %o2, 0xb8, %o2 ! 20168b8 <_Status_Object_name_errors_to_status+0x1d8> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 200882c: 10 bf ff c6 b 2008744 <_Heap_Walk+0x40> 2008830: 82 10 20 00 clr %g1 first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { (*printer)( source, true, "page size is zero\n" ); 2008834: 90 10 00 19 mov %i1, %o0 2008838: 92 10 20 01 mov 1, %o1 200883c: 15 00 80 59 sethi %hi(0x2016400), %o2 2008840: 9f c7 40 00 call %i5 2008844: 94 12 a3 f0 or %o2, 0x3f0, %o2 ! 20167f0 <_Status_Object_name_errors_to_status+0x110> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 2008848: 10 bf ff bf b 2008744 <_Heap_Walk+0x40> 200884c: 82 10 20 00 clr %g1 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)( 2008850: 90 10 00 19 mov %i1, %o0 2008854: 92 10 20 01 mov 1, %o1 2008858: 96 10 00 10 mov %l0, %o3 200885c: 15 00 80 5a sethi %hi(0x2016800), %o2 2008860: 9f c7 40 00 call %i5 2008864: 94 12 a0 08 or %o2, 8, %o2 ! 2016808 <_Status_Object_name_errors_to_status+0x128> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 2008868: 10 bf ff b7 b 2008744 <_Heap_Walk+0x40> 200886c: 82 10 20 00 clr %g1 return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)( 2008870: 90 10 00 19 mov %i1, %o0 2008874: 92 10 20 01 mov 1, %o1 2008878: 96 10 00 1b mov %i3, %o3 200887c: 15 00 80 5a sethi %hi(0x2016800), %o2 2008880: 9f c7 40 00 call %i5 2008884: 94 12 a0 28 or %o2, 0x28, %o2 ! 2016828 <_Status_Object_name_errors_to_status+0x148> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 2008888: 10 bf ff af b 2008744 <_Heap_Walk+0x40> 200888c: 82 10 20 00 clr %g1 } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 2008890: 92 10 20 01 mov 1, %o1 2008894: 96 10 00 1c mov %i4, %o3 2008898: 15 00 80 5a sethi %hi(0x2016800), %o2 200889c: 9f c7 40 00 call %i5 20088a0: 94 12 a0 50 or %o2, 0x50, %o2 ! 2016850 <_Status_Object_name_errors_to_status+0x170> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 20088a4: 10 bf ff a8 b 2008744 <_Heap_Walk+0x40> 20088a8: 82 10 20 00 clr %g1 return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 20088ac: 92 10 20 01 mov 1, %o1 20088b0: 15 00 80 5a sethi %hi(0x2016800), %o2 20088b4: 9f c7 40 00 call %i5 20088b8: 94 12 a0 88 or %o2, 0x88, %o2 ! 2016888 <_Status_Object_name_errors_to_status+0x1a8> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 20088bc: 10 bf ff a2 b 2008744 <_Heap_Walk+0x40> 20088c0: 82 10 20 00 clr %g1 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 20088c4: f4 06 20 08 ld [ %i0 + 8 ], %i2 int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 20088c8: ea 06 20 10 ld [ %i0 + 0x10 ], %l5 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 ) { 20088cc: 80 a6 00 1a cmp %i0, %i2 20088d0: 02 80 00 0d be 2008904 <_Heap_Walk+0x200> 20088d4: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 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; 20088d8: 80 a0 40 1a cmp %g1, %i2 20088dc: 28 80 00 bc bleu,a 2008bcc <_Heap_Walk+0x4c8> <== ALWAYS TAKEN 20088e0: e6 06 20 24 ld [ %i0 + 0x24 ], %l3 if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { (*printer)( 20088e4: 90 10 00 19 mov %i1, %o0 <== NOT EXECUTED 20088e8: 92 10 20 01 mov 1, %o1 20088ec: 96 10 00 1a mov %i2, %o3 20088f0: 15 00 80 5a sethi %hi(0x2016800), %o2 20088f4: 9f c7 40 00 call %i5 20088f8: 94 12 a1 00 or %o2, 0x100, %o2 ! 2016900 <_Status_Object_name_errors_to_status+0x220> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 20088fc: 10 bf ff 92 b 2008744 <_Heap_Walk+0x40> 2008900: 82 10 20 00 clr %g1 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 2008904: 2d 00 80 5a sethi %hi(0x2016800), %l6 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( 2008908: 2f 00 80 5a sethi %hi(0x2016800), %l7 ); return false; } if ( _Heap_Is_used( free_block ) ) { 200890c: a4 10 00 1c mov %i4, %l2 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 2008910: ac 15 a3 30 or %l6, 0x330, %l6 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( 2008914: ae 15 e3 18 or %l7, 0x318, %l7 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 2008918: 2b 00 80 5a sethi %hi(0x2016800), %l5 - 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; 200891c: a6 0d 3f fe and %l4, -2, %l3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 2008920: b4 04 c0 12 add %l3, %l2, %i2 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; 2008924: 80 a0 40 1a cmp %g1, %i2 2008928: 28 80 00 0b bleu,a 2008954 <_Heap_Walk+0x250> <== ALWAYS TAKEN 200892c: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { (*printer)( 2008930: 90 10 00 19 mov %i1, %o0 <== NOT EXECUTED 2008934: 92 10 20 01 mov 1, %o1 2008938: 96 10 00 12 mov %l2, %o3 200893c: 15 00 80 5a sethi %hi(0x2016800), %o2 2008940: 98 10 00 1a mov %i2, %o4 2008944: 9f c7 40 00 call %i5 2008948: 94 12 a1 a8 or %o2, 0x1a8, %o2 "block 0x%08x: next block 0x%08x not in heap\n", block, next_block ); return false; 200894c: 10 bf ff 7e b 2008744 <_Heap_Walk+0x40> 2008950: 82 10 20 00 clr %g1 2008954: 80 a0 40 1a cmp %g1, %i2 2008958: 0a bf ff f7 bcs 2008934 <_Heap_Walk+0x230> 200895c: 90 10 00 19 mov %i1, %o0 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; 2008960: 82 1c 80 11 xor %l2, %l1, %g1 2008964: 80 a0 00 01 cmp %g0, %g1 2008968: 82 40 20 00 addx %g0, 0, %g1 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 200896c: 90 10 00 13 mov %l3, %o0 2008970: c2 27 bf fc st %g1, [ %fp + -4 ] 2008974: 7f ff e4 56 call 2001acc <.urem> 2008978: 92 10 00 10 mov %l0, %o1 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 200897c: 80 a2 20 00 cmp %o0, 0 2008980: 02 80 00 05 be 2008994 <_Heap_Walk+0x290> 2008984: c2 07 bf fc ld [ %fp + -4 ], %g1 2008988: 80 88 60 ff btst 0xff, %g1 200898c: 12 80 00 76 bne 2008b64 <_Heap_Walk+0x460> 2008990: 90 10 00 19 mov %i1, %o0 ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 2008994: 80 a6 c0 13 cmp %i3, %l3 2008998: 08 80 00 05 bleu 20089ac <_Heap_Walk+0x2a8> 200899c: 80 a4 80 1a cmp %l2, %i2 20089a0: 80 88 60 ff btst 0xff, %g1 20089a4: 12 80 00 78 bne 2008b84 <_Heap_Walk+0x480> <== ALWAYS TAKEN 20089a8: 80 a4 80 1a cmp %l2, %i2 ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 20089ac: 2a 80 00 06 bcs,a 20089c4 <_Heap_Walk+0x2c0> 20089b0: c2 06 a0 04 ld [ %i2 + 4 ], %g1 20089b4: 80 88 60 ff btst 0xff, %g1 20089b8: 12 80 00 7d bne 2008bac <_Heap_Walk+0x4a8> 20089bc: 90 10 00 19 mov %i1, %o0 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; 20089c0: c2 06 a0 04 ld [ %i2 + 4 ], %g1 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 20089c4: 80 88 60 01 btst 1, %g1 20089c8: 02 80 00 19 be 2008a2c <_Heap_Walk+0x328> 20089cc: a8 0d 20 01 and %l4, 1, %l4 if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 20089d0: 80 a5 20 00 cmp %l4, 0 20089d4: 22 80 00 0e be,a 2008a0c <_Heap_Walk+0x308> 20089d8: da 04 80 00 ld [ %l2 ], %o5 (*printer)( 20089dc: 90 10 00 19 mov %i1, %o0 20089e0: 92 10 20 00 clr %o1 20089e4: 94 10 00 17 mov %l7, %o2 20089e8: 96 10 00 12 mov %l2, %o3 20089ec: 9f c7 40 00 call %i5 20089f0: 98 10 00 13 mov %l3, %o4 block->prev_size ); } block = next_block; } while ( block != first_block ); 20089f4: 80 a7 00 1a cmp %i4, %i2 20089f8: 02 80 00 42 be 2008b00 <_Heap_Walk+0x3fc> 20089fc: a4 10 00 1a mov %i2, %l2 2008a00: e8 06 a0 04 ld [ %i2 + 4 ], %l4 2008a04: 10 bf ff c6 b 200891c <_Heap_Walk+0x218> 2008a08: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 2008a0c: 96 10 00 12 mov %l2, %o3 2008a10: 90 10 00 19 mov %i1, %o0 2008a14: 92 10 20 00 clr %o1 2008a18: 94 10 00 16 mov %l6, %o2 2008a1c: 9f c7 40 00 call %i5 2008a20: 98 10 00 13 mov %l3, %o4 block->prev_size ); } block = next_block; } while ( block != first_block ); 2008a24: 10 bf ff f5 b 20089f8 <_Heap_Walk+0x2f4> 2008a28: 80 a7 00 1a cmp %i4, %i2 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 ? 2008a2c: da 04 a0 0c ld [ %l2 + 0xc ], %o5 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)( 2008a30: c2 06 20 08 ld [ %i0 + 8 ], %g1 2008a34: 05 00 80 59 sethi %hi(0x2016400), %g2 return _Heap_Free_list_head(heap)->next; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 2008a38: c8 06 20 0c ld [ %i0 + 0xc ], %g4 2008a3c: 80 a0 40 0d cmp %g1, %o5 2008a40: 02 80 00 05 be 2008a54 <_Heap_Walk+0x350> 2008a44: 86 10 a3 18 or %g2, 0x318, %g3 block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 2008a48: 80 a6 00 0d cmp %i0, %o5 2008a4c: 02 80 00 3c be 2008b3c <_Heap_Walk+0x438> 2008a50: 86 15 62 e0 or %l5, 0x2e0, %g3 block->next, block->next == last_free_block ? 2008a54: c2 04 a0 08 ld [ %l2 + 8 ], %g1 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)( 2008a58: 1f 00 80 59 sethi %hi(0x2016400), %o7 2008a5c: 80 a1 00 01 cmp %g4, %g1 2008a60: 02 80 00 05 be 2008a74 <_Heap_Walk+0x370> 2008a64: 84 13 e3 38 or %o7, 0x338, %g2 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 2008a68: 80 a6 00 01 cmp %i0, %g1 2008a6c: 02 80 00 31 be 2008b30 <_Heap_Walk+0x42c> 2008a70: 84 15 62 e0 or %l5, 0x2e0, %g2 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)( 2008a74: c6 23 a0 5c st %g3, [ %sp + 0x5c ] 2008a78: c2 23 a0 60 st %g1, [ %sp + 0x60 ] 2008a7c: c4 23 a0 64 st %g2, [ %sp + 0x64 ] 2008a80: 90 10 00 19 mov %i1, %o0 2008a84: 92 10 20 00 clr %o1 2008a88: 15 00 80 5a sethi %hi(0x2016800), %o2 2008a8c: 96 10 00 12 mov %l2, %o3 2008a90: 94 12 a2 70 or %o2, 0x270, %o2 2008a94: 9f c7 40 00 call %i5 2008a98: 98 10 00 13 mov %l3, %o4 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 2008a9c: da 06 80 00 ld [ %i2 ], %o5 2008aa0: 80 a4 c0 0d cmp %l3, %o5 2008aa4: 12 80 00 19 bne 2008b08 <_Heap_Walk+0x404> 2008aa8: 80 a5 20 00 cmp %l4, 0 ); return false; } if ( !prev_used ) { 2008aac: 02 80 00 27 be 2008b48 <_Heap_Walk+0x444> 2008ab0: 90 10 00 19 mov %i1, %o0 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 2008ab4: c2 06 20 08 ld [ %i0 + 8 ], %g1 ) { 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 ) { 2008ab8: 80 a6 00 01 cmp %i0, %g1 2008abc: 02 80 00 0b be 2008ae8 <_Heap_Walk+0x3e4> <== NEVER TAKEN 2008ac0: 92 10 20 01 mov 1, %o1 if ( free_block == block ) { 2008ac4: 80 a4 80 01 cmp %l2, %g1 2008ac8: 02 bf ff cc be 20089f8 <_Heap_Walk+0x2f4> 2008acc: 80 a7 00 1a cmp %i4, %i2 return true; } free_block = free_block->next; 2008ad0: c2 00 60 08 ld [ %g1 + 8 ], %g1 ) { 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 ) { 2008ad4: 80 a6 00 01 cmp %i0, %g1 2008ad8: 12 bf ff fc bne 2008ac8 <_Heap_Walk+0x3c4> 2008adc: 80 a4 80 01 cmp %l2, %g1 return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 2008ae0: 90 10 00 19 mov %i1, %o0 2008ae4: 92 10 20 01 mov 1, %o1 2008ae8: 96 10 00 12 mov %l2, %o3 2008aec: 15 00 80 5a sethi %hi(0x2016800), %o2 2008af0: 9f c7 40 00 call %i5 2008af4: 94 12 a3 58 or %o2, 0x358, %o2 ! 2016b58 <_Status_Object_name_errors_to_status+0x478> return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 2008af8: 10 bf ff 13 b 2008744 <_Heap_Walk+0x40> 2008afc: 82 10 20 00 clr %g1 } block = next_block; } while ( block != first_block ); return true; 2008b00: 10 bf ff 11 b 2008744 <_Heap_Walk+0x40> 2008b04: 82 10 20 01 mov 1, %g1 " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { (*printer)( 2008b08: f4 23 a0 5c st %i2, [ %sp + 0x5c ] 2008b0c: 90 10 00 19 mov %i1, %o0 2008b10: 92 10 20 01 mov 1, %o1 2008b14: 96 10 00 12 mov %l2, %o3 2008b18: 15 00 80 5a sethi %hi(0x2016800), %o2 2008b1c: 98 10 00 13 mov %l3, %o4 2008b20: 9f c7 40 00 call %i5 2008b24: 94 12 a2 a8 or %o2, 0x2a8, %o2 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 2008b28: 10 bf ff 07 b 2008744 <_Heap_Walk+0x40> 2008b2c: 82 10 20 00 clr %g1 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 2008b30: 05 00 80 59 sethi %hi(0x2016400), %g2 2008b34: 10 bf ff d0 b 2008a74 <_Heap_Walk+0x370> 2008b38: 84 10 a3 48 or %g2, 0x348, %g2 ! 2016748 <_Status_Object_name_errors_to_status+0x68> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 2008b3c: 07 00 80 59 sethi %hi(0x2016400), %g3 2008b40: 10 bf ff c5 b 2008a54 <_Heap_Walk+0x350> 2008b44: 86 10 e3 28 or %g3, 0x328, %g3 ! 2016728 <_Status_Object_name_errors_to_status+0x48> return false; } if ( !prev_used ) { (*printer)( 2008b48: 92 10 20 01 mov 1, %o1 2008b4c: 96 10 00 12 mov %l2, %o3 2008b50: 15 00 80 5a sethi %hi(0x2016800), %o2 2008b54: 9f c7 40 00 call %i5 2008b58: 94 12 a2 e8 or %o2, 0x2e8, %o2 ! 2016ae8 <_Status_Object_name_errors_to_status+0x408> return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 2008b5c: 10 bf fe fa b 2008744 <_Heap_Walk+0x40> 2008b60: 82 10 20 00 clr %g1 return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { (*printer)( 2008b64: 92 10 20 01 mov 1, %o1 2008b68: 96 10 00 12 mov %l2, %o3 2008b6c: 15 00 80 5a sethi %hi(0x2016800), %o2 2008b70: 98 10 00 13 mov %l3, %o4 2008b74: 9f c7 40 00 call %i5 2008b78: 94 12 a1 d8 or %o2, 0x1d8, %o2 "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 2008b7c: 10 bf fe f2 b 2008744 <_Heap_Walk+0x40> 2008b80: 82 10 20 00 clr %g1 } if ( block_size < min_block_size && is_not_last_block ) { (*printer)( 2008b84: 90 10 00 19 mov %i1, %o0 2008b88: 92 10 20 01 mov 1, %o1 2008b8c: 96 10 00 12 mov %l2, %o3 2008b90: 15 00 80 5a sethi %hi(0x2016800), %o2 2008b94: 98 10 00 13 mov %l3, %o4 2008b98: 94 12 a2 08 or %o2, 0x208, %o2 2008b9c: 9f c7 40 00 call %i5 2008ba0: 9a 10 00 1b mov %i3, %o5 block, block_size, min_block_size ); return false; 2008ba4: 10 bf fe e8 b 2008744 <_Heap_Walk+0x40> 2008ba8: 82 10 20 00 clr %g1 } if ( next_block_begin <= block_begin && is_not_last_block ) { (*printer)( 2008bac: 92 10 20 01 mov 1, %o1 2008bb0: 96 10 00 12 mov %l2, %o3 2008bb4: 15 00 80 5a sethi %hi(0x2016800), %o2 2008bb8: 98 10 00 1a mov %i2, %o4 2008bbc: 9f c7 40 00 call %i5 2008bc0: 94 12 a2 38 or %o2, 0x238, %o2 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 2008bc4: 10 bf fe e0 b 2008744 <_Heap_Walk+0x40> 2008bc8: 82 10 20 00 clr %g1 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; 2008bcc: 80 a6 80 13 cmp %i2, %l3 2008bd0: 18 bf ff 46 bgu 20088e8 <_Heap_Walk+0x1e4> <== NEVER TAKEN 2008bd4: 90 10 00 19 mov %i1, %o0 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 2008bd8: c2 27 bf fc st %g1, [ %fp + -4 ] 2008bdc: 90 06 a0 08 add %i2, 8, %o0 2008be0: 7f ff e3 bb call 2001acc <.urem> 2008be4: 92 10 00 15 mov %l5, %o1 ); return false; } if ( 2008be8: 80 a2 20 00 cmp %o0, 0 2008bec: 12 80 00 36 bne 2008cc4 <_Heap_Walk+0x5c0> <== NEVER TAKEN 2008bf0: c2 07 bf fc ld [ %fp + -4 ], %g1 - 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; 2008bf4: c4 06 a0 04 ld [ %i2 + 4 ], %g2 2008bf8: 84 08 bf fe and %g2, -2, %g2 block = next_block; } while ( block != first_block ); return true; } 2008bfc: 84 06 80 02 add %i2, %g2, %g2 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; 2008c00: c4 00 a0 04 ld [ %g2 + 4 ], %g2 ); return false; } if ( _Heap_Is_used( free_block ) ) { 2008c04: 80 88 a0 01 btst 1, %g2 2008c08: 12 80 00 27 bne 2008ca4 <_Heap_Walk+0x5a0> <== NEVER TAKEN 2008c0c: 84 10 00 18 mov %i0, %g2 2008c10: 10 80 00 19 b 2008c74 <_Heap_Walk+0x570> 2008c14: a4 10 00 1a mov %i2, %l2 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 ) { 2008c18: 80 a6 00 1a cmp %i0, %i2 2008c1c: 02 bf ff 3a be 2008904 <_Heap_Walk+0x200> 2008c20: 80 a6 80 01 cmp %i2, %g1 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; 2008c24: 0a bf ff 31 bcs 20088e8 <_Heap_Walk+0x1e4> 2008c28: 90 10 00 19 mov %i1, %o0 2008c2c: 80 a6 80 13 cmp %i2, %l3 2008c30: 18 bf ff 2f bgu 20088ec <_Heap_Walk+0x1e8> <== NEVER TAKEN 2008c34: 92 10 20 01 mov 1, %o1 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 2008c38: c2 27 bf fc st %g1, [ %fp + -4 ] 2008c3c: 90 06 a0 08 add %i2, 8, %o0 2008c40: 7f ff e3 a3 call 2001acc <.urem> 2008c44: 92 10 00 15 mov %l5, %o1 ); return false; } if ( 2008c48: 80 a2 20 00 cmp %o0, 0 2008c4c: 12 80 00 1e bne 2008cc4 <_Heap_Walk+0x5c0> 2008c50: c2 07 bf fc ld [ %fp + -4 ], %g1 - 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; 2008c54: c6 06 a0 04 ld [ %i2 + 4 ], %g3 ); return false; } if ( _Heap_Is_used( free_block ) ) { 2008c58: 84 10 00 12 mov %l2, %g2 2008c5c: 86 08 ff fe and %g3, -2, %g3 block = next_block; } while ( block != first_block ); return true; } 2008c60: 86 06 80 03 add %i2, %g3, %g3 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; 2008c64: c6 00 e0 04 ld [ %g3 + 4 ], %g3 ); return false; } if ( _Heap_Is_used( free_block ) ) { 2008c68: 80 88 e0 01 btst 1, %g3 2008c6c: 12 80 00 0e bne 2008ca4 <_Heap_Walk+0x5a0> 2008c70: a4 10 00 1a mov %i2, %l2 ); return false; } if ( free_block->prev != prev_block ) { 2008c74: d8 06 a0 0c ld [ %i2 + 0xc ], %o4 2008c78: 80 a3 00 02 cmp %o4, %g2 2008c7c: 22 bf ff e7 be,a 2008c18 <_Heap_Walk+0x514> 2008c80: f4 06 a0 08 ld [ %i2 + 8 ], %i2 (*printer)( 2008c84: 90 10 00 19 mov %i1, %o0 2008c88: 92 10 20 01 mov 1, %o1 2008c8c: 96 10 00 1a mov %i2, %o3 2008c90: 15 00 80 5a sethi %hi(0x2016800), %o2 2008c94: 9f c7 40 00 call %i5 2008c98: 94 12 a1 70 or %o2, 0x170, %o2 ! 2016970 <_Status_Object_name_errors_to_status+0x290> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 2008c9c: 10 bf fe aa b 2008744 <_Heap_Walk+0x40> 2008ca0: 82 10 20 00 clr %g1 return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)( 2008ca4: 90 10 00 19 mov %i1, %o0 2008ca8: 92 10 20 01 mov 1, %o1 2008cac: 96 10 00 1a mov %i2, %o3 2008cb0: 15 00 80 5a sethi %hi(0x2016800), %o2 2008cb4: 9f c7 40 00 call %i5 2008cb8: 94 12 a1 50 or %o2, 0x150, %o2 ! 2016950 <_Status_Object_name_errors_to_status+0x270> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 2008cbc: 10 bf fe a2 b 2008744 <_Heap_Walk+0x40> 2008cc0: 82 10 20 00 clr %g1 } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 2008cc4: 90 10 00 19 mov %i1, %o0 2008cc8: 92 10 20 01 mov 1, %o1 2008ccc: 96 10 00 1a mov %i2, %o3 2008cd0: 15 00 80 5a sethi %hi(0x2016800), %o2 2008cd4: 9f c7 40 00 call %i5 2008cd8: 94 12 a1 20 or %o2, 0x120, %o2 ! 2016920 <_Status_Object_name_errors_to_status+0x240> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 2008cdc: 10 bf fe 9a b 2008744 <_Heap_Walk+0x40> 2008ce0: 82 10 20 00 clr %g1 =============================================================================== 020070dc <_IO_Initialize_all_drivers>: * * Output Parameters: NONE */ void _IO_Initialize_all_drivers( void ) { 20070dc: 9d e3 bf a0 save %sp, -96, %sp rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 20070e0: 39 00 80 78 sethi %hi(0x201e000), %i4 20070e4: c2 07 22 c4 ld [ %i4 + 0x2c4 ], %g1 ! 201e2c4 <_IO_Number_of_drivers> 20070e8: 80 a0 60 00 cmp %g1, 0 20070ec: 02 80 00 0c be 200711c <_IO_Initialize_all_drivers+0x40> <== NEVER TAKEN 20070f0: ba 10 20 00 clr %i5 20070f4: b8 17 22 c4 or %i4, 0x2c4, %i4 (void) rtems_io_initialize( major, 0, NULL ); 20070f8: 90 10 00 1d mov %i5, %o0 20070fc: 92 10 20 00 clr %o1 2007100: 40 00 18 08 call 200d120 2007104: 94 10 20 00 clr %o2 void _IO_Initialize_all_drivers( void ) { rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 2007108: c2 07 00 00 ld [ %i4 ], %g1 200710c: ba 07 60 01 inc %i5 2007110: 80 a0 40 1d cmp %g1, %i5 2007114: 18 bf ff fa bgu 20070fc <_IO_Initialize_all_drivers+0x20> 2007118: 90 10 00 1d mov %i5, %o0 200711c: 81 c7 e0 08 ret 2007120: 81 e8 00 00 restore =============================================================================== 02007010 <_IO_Manager_initialization>: * workspace. * */ void _IO_Manager_initialization(void) { 2007010: 9d e3 bf a0 save %sp, -96, %sp 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; 2007014: 03 00 80 72 sethi %hi(0x201c800), %g1 2007018: 82 10 63 ec or %g1, 0x3ec, %g1 ! 201cbec drivers_in_table = Configuration.number_of_device_drivers; 200701c: f8 00 60 30 ld [ %g1 + 0x30 ], %i4 number_of_drivers = Configuration.maximum_drivers; 2007020: f2 00 60 2c ld [ %g1 + 0x2c ], %i1 /* * 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 ) 2007024: 80 a7 00 19 cmp %i4, %i1 2007028: 0a 80 00 08 bcs 2007048 <_IO_Manager_initialization+0x38> 200702c: fa 00 60 34 ld [ %g1 + 0x34 ], %i5 * 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; 2007030: 03 00 80 78 sethi %hi(0x201e000), %g1 2007034: fa 20 62 c8 st %i5, [ %g1 + 0x2c8 ] ! 201e2c8 <_IO_Driver_address_table> _IO_Number_of_drivers = number_of_drivers; 2007038: 03 00 80 78 sethi %hi(0x201e000), %g1 200703c: f8 20 62 c4 st %i4, [ %g1 + 0x2c4 ] ! 201e2c4 <_IO_Number_of_drivers> return; 2007040: 81 c7 e0 08 ret 2007044: 81 e8 00 00 restore * 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 ) 2007048: 83 2e 60 03 sll %i1, 3, %g1 200704c: b5 2e 60 05 sll %i1, 5, %i2 2007050: b4 26 80 01 sub %i2, %g1, %i2 * 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( 2007054: 40 00 0d 65 call 200a5e8 <_Workspace_Allocate_or_fatal_error> 2007058: 90 10 00 1a mov %i2, %o0 sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 200705c: 03 00 80 78 sethi %hi(0x201e000), %g1 /* * 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 *) 2007060: 37 00 80 78 sethi %hi(0x201e000), %i3 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 2007064: f2 20 62 c4 st %i1, [ %g1 + 0x2c4 ] /* * 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 *) 2007068: d0 26 e2 c8 st %o0, [ %i3 + 0x2c8 ] _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 200706c: 92 10 20 00 clr %o1 2007070: 40 00 24 c0 call 2010370 2007074: 94 10 00 1a mov %i2, %o2 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 2007078: 80 a7 20 00 cmp %i4, 0 200707c: 02 bf ff f1 be 2007040 <_IO_Manager_initialization+0x30> <== NEVER TAKEN 2007080: f6 06 e2 c8 ld [ %i3 + 0x2c8 ], %i3 2007084: 82 10 20 00 clr %g1 2007088: 88 10 20 00 clr %g4 _IO_Driver_address_table[index] = driver_table[index]; 200708c: c4 07 40 01 ld [ %i5 + %g1 ], %g2 2007090: 86 07 40 01 add %i5, %g1, %g3 2007094: c4 26 c0 01 st %g2, [ %i3 + %g1 ] 2007098: f4 00 e0 04 ld [ %g3 + 4 ], %i2 200709c: 84 06 c0 01 add %i3, %g1, %g2 20070a0: f4 20 a0 04 st %i2, [ %g2 + 4 ] 20070a4: f4 00 e0 08 ld [ %g3 + 8 ], %i2 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 20070a8: 88 01 20 01 inc %g4 _IO_Driver_address_table[index] = driver_table[index]; 20070ac: f4 20 a0 08 st %i2, [ %g2 + 8 ] 20070b0: f4 00 e0 0c ld [ %g3 + 0xc ], %i2 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 20070b4: 82 00 60 18 add %g1, 0x18, %g1 _IO_Driver_address_table[index] = driver_table[index]; 20070b8: f4 20 a0 0c st %i2, [ %g2 + 0xc ] 20070bc: f4 00 e0 10 ld [ %g3 + 0x10 ], %i2 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 20070c0: 80 a1 00 1c cmp %g4, %i4 _IO_Driver_address_table[index] = driver_table[index]; 20070c4: f4 20 a0 10 st %i2, [ %g2 + 0x10 ] 20070c8: c6 00 e0 14 ld [ %g3 + 0x14 ], %g3 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 20070cc: 12 bf ff f0 bne 200708c <_IO_Manager_initialization+0x7c> 20070d0: c6 20 a0 14 st %g3, [ %g2 + 0x14 ] 20070d4: 81 c7 e0 08 ret 20070d8: 81 e8 00 00 restore =============================================================================== 02007e40 <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 2007e40: 9d e3 bf a0 save %sp, -96, %sp * 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 ) 2007e44: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 2007e48: ba 10 00 18 mov %i0, %i5 * 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 ) 2007e4c: 80 a0 60 00 cmp %g1, 0 2007e50: 02 80 00 19 be 2007eb4 <_Objects_Allocate+0x74> <== NEVER TAKEN 2007e54: b0 10 20 00 clr %i0 /* * 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 ); 2007e58: b8 07 60 20 add %i5, 0x20, %i4 2007e5c: 7f ff fd 63 call 20073e8 <_Chain_Get> 2007e60: 90 10 00 1c mov %i4, %o0 if ( information->auto_extend ) { 2007e64: c2 0f 60 12 ldub [ %i5 + 0x12 ], %g1 2007e68: 80 a0 60 00 cmp %g1, 0 2007e6c: 02 80 00 12 be 2007eb4 <_Objects_Allocate+0x74> 2007e70: b0 10 00 08 mov %o0, %i0 /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 2007e74: 80 a2 20 00 cmp %o0, 0 2007e78: 02 80 00 11 be 2007ebc <_Objects_Allocate+0x7c> 2007e7c: 01 00 00 00 nop } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 2007e80: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 2007e84: d0 16 20 0a lduh [ %i0 + 0xa ], %o0 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 2007e88: d2 17 60 14 lduh [ %i5 + 0x14 ], %o1 2007e8c: 40 00 42 44 call 201879c <.udiv> 2007e90: 90 22 00 01 sub %o0, %g1, %o0 information->inactive_per_block[ block ]--; 2007e94: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 2007e98: 91 2a 20 02 sll %o0, 2, %o0 2007e9c: c6 00 40 08 ld [ %g1 + %o0 ], %g3 information->inactive--; 2007ea0: c4 17 60 2c lduh [ %i5 + 0x2c ], %g2 block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 2007ea4: 86 00 ff ff add %g3, -1, %g3 2007ea8: c6 20 40 08 st %g3, [ %g1 + %o0 ] information->inactive--; 2007eac: 82 00 bf ff add %g2, -1, %g1 2007eb0: c2 37 60 2c sth %g1, [ %i5 + 0x2c ] ); } #endif return the_object; } 2007eb4: 81 c7 e0 08 ret 2007eb8: 81 e8 00 00 restore * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { _Objects_Extend_information( information ); 2007ebc: 40 00 00 10 call 2007efc <_Objects_Extend_information> 2007ec0: 90 10 00 1d mov %i5, %o0 the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 2007ec4: 7f ff fd 49 call 20073e8 <_Chain_Get> 2007ec8: 90 10 00 1c mov %i4, %o0 } if ( the_object ) { 2007ecc: b0 92 20 00 orcc %o0, 0, %i0 2007ed0: 32 bf ff ed bne,a 2007e84 <_Objects_Allocate+0x44> 2007ed4: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 ); } #endif return the_object; } 2007ed8: 81 c7 e0 08 ret 2007edc: 81 e8 00 00 restore =============================================================================== 02007efc <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 2007efc: 9d e3 bf 90 save %sp, -112, %sp minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 2007f00: e0 06 20 34 ld [ %i0 + 0x34 ], %l0 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 2007f04: f8 16 20 0a lduh [ %i0 + 0xa ], %i4 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 2007f08: 80 a4 20 00 cmp %l0, 0 2007f0c: 02 80 00 a6 be 20081a4 <_Objects_Extend_information+0x2a8> 2007f10: f2 16 20 10 lduh [ %i0 + 0x10 ], %i1 block_count = 0; else { block_count = information->maximum / information->allocation_size; 2007f14: f4 16 20 14 lduh [ %i0 + 0x14 ], %i2 2007f18: b3 2e 60 10 sll %i1, 0x10, %i1 2007f1c: 92 10 00 1a mov %i2, %o1 2007f20: 40 00 42 1f call 201879c <.udiv> 2007f24: 91 36 60 10 srl %i1, 0x10, %o0 2007f28: a7 2a 20 10 sll %o0, 0x10, %l3 2007f2c: a7 34 e0 10 srl %l3, 0x10, %l3 for ( ; block < block_count; block++ ) { 2007f30: 80 a4 e0 00 cmp %l3, 0 2007f34: 02 80 00 a3 be 20081c0 <_Objects_Extend_information+0x2c4><== NEVER TAKEN 2007f38: 90 10 00 1a mov %i2, %o0 if ( information->object_blocks[ block ] == NULL ) { 2007f3c: c2 04 00 00 ld [ %l0 ], %g1 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 2007f40: ba 10 00 1c mov %i4, %i5 block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { 2007f44: 80 a0 60 00 cmp %g1, 0 2007f48: 12 80 00 08 bne 2007f68 <_Objects_Extend_information+0x6c><== ALWAYS TAKEN 2007f4c: b6 10 20 00 clr %i3 do_extend = false; 2007f50: 10 80 00 a0 b 20081d0 <_Objects_Extend_information+0x2d4> <== NOT EXECUTED 2007f54: b4 10 20 00 clr %i2 <== NOT EXECUTED block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { 2007f58: c2 04 00 01 ld [ %l0 + %g1 ], %g1 2007f5c: 80 a0 60 00 cmp %g1, 0 2007f60: 22 80 00 08 be,a 2007f80 <_Objects_Extend_information+0x84> 2007f64: b4 10 20 00 clr %i2 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 2007f68: b6 06 e0 01 inc %i3 if ( information->object_blocks[ block ] == NULL ) { do_extend = false; break; } else index_base += information->allocation_size; 2007f6c: ba 07 40 1a add %i5, %i2, %i5 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 2007f70: 80 a4 c0 1b cmp %l3, %i3 2007f74: 18 bf ff f9 bgu 2007f58 <_Objects_Extend_information+0x5c> 2007f78: 83 2e e0 02 sll %i3, 2, %g1 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 2007f7c: b4 10 20 01 mov 1, %i2 } else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 2007f80: b3 36 60 10 srl %i1, 0x10, %i1 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 2007f84: 03 00 00 3f sethi %hi(0xfc00), %g1 } else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 2007f88: b2 06 40 08 add %i1, %o0, %i1 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 2007f8c: 82 10 63 ff or %g1, 0x3ff, %g1 2007f90: 80 a6 40 01 cmp %i1, %g1 2007f94: 18 80 00 93 bgu 20081e0 <_Objects_Extend_information+0x2e4> 2007f98: 01 00 00 00 nop /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; 2007f9c: 40 00 41 c6 call 20186b4 <.umul> 2007fa0: d2 06 20 18 ld [ %i0 + 0x18 ], %o1 if ( information->auto_extend ) { 2007fa4: c2 0e 20 12 ldub [ %i0 + 0x12 ], %g1 2007fa8: 80 a0 60 00 cmp %g1, 0 2007fac: 02 80 00 6a be 2008154 <_Objects_Extend_information+0x258> 2007fb0: 01 00 00 00 nop new_object_block = _Workspace_Allocate( block_size ); 2007fb4: 40 00 09 7f call 200a5b0 <_Workspace_Allocate> 2007fb8: 01 00 00 00 nop if ( !new_object_block ) 2007fbc: a0 92 20 00 orcc %o0, 0, %l0 2007fc0: 02 80 00 88 be 20081e0 <_Objects_Extend_information+0x2e4> 2007fc4: 01 00 00 00 nop } /* * Do we need to grow the tables? */ if ( do_extend ) { 2007fc8: 80 8e a0 ff btst 0xff, %i2 2007fcc: 22 80 00 3f be,a 20080c8 <_Objects_Extend_information+0x1cc> 2007fd0: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 */ /* * Up the block count and maximum */ block_count++; 2007fd4: b4 04 e0 01 add %l3, 1, %i2 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 2007fd8: 91 2e a0 01 sll %i2, 1, %o0 2007fdc: 90 02 00 1a add %o0, %i2, %o0 ((maximum + minimum_index) * sizeof(Objects_Control *)); 2007fe0: 90 06 40 08 add %i1, %o0, %o0 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 2007fe4: 90 02 00 1c add %o0, %i4, %o0 ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 2007fe8: 40 00 09 72 call 200a5b0 <_Workspace_Allocate> 2007fec: 91 2a 20 02 sll %o0, 2, %o0 if ( !object_blocks ) { 2007ff0: a2 92 20 00 orcc %o0, 0, %l1 2007ff4: 02 80 00 79 be 20081d8 <_Objects_Extend_information+0x2dc> 2007ff8: b5 2e a0 02 sll %i2, 2, %i2 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 2007ffc: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 2008000: 80 a7 00 01 cmp %i4, %g1 2008004: a4 04 40 1a add %l1, %i2, %l2 2008008: 0a 80 00 57 bcs 2008164 <_Objects_Extend_information+0x268> 200800c: b4 04 80 1a add %l2, %i2, %i2 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 2008010: 80 a7 20 00 cmp %i4, 0 2008014: 02 80 00 07 be 2008030 <_Objects_Extend_information+0x134><== NEVER TAKEN 2008018: 82 10 20 00 clr %g1 * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 200801c: 85 28 60 02 sll %g1, 2, %g2 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 2008020: 82 00 60 01 inc %g1 2008024: 80 a7 00 01 cmp %i4, %g1 2008028: 18 bf ff fd bgu 200801c <_Objects_Extend_information+0x120><== NEVER TAKEN 200802c: c0 20 80 1a clr [ %g2 + %i2 ] 2008030: a7 2c e0 02 sll %l3, 2, %l3 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 2008034: c6 16 20 14 lduh [ %i0 + 0x14 ], %g3 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 2008038: c0 24 40 13 clr [ %l1 + %l3 ] inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 200803c: 86 07 40 03 add %i5, %g3, %g3 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 2008040: 80 a7 40 03 cmp %i5, %g3 2008044: 1a 80 00 0a bcc 200806c <_Objects_Extend_information+0x170><== NEVER TAKEN 2008048: c0 24 80 13 clr [ %l2 + %l3 ] * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 200804c: 83 2f 60 02 sll %i5, 2, %g1 2008050: 84 10 00 1d mov %i5, %g2 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 2008054: 82 06 80 01 add %i2, %g1, %g1 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 2008058: c0 20 40 00 clr [ %g1 ] object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { 200805c: 84 00 a0 01 inc %g2 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 2008060: 80 a0 c0 02 cmp %g3, %g2 2008064: 18 bf ff fd bgu 2008058 <_Objects_Extend_information+0x15c> 2008068: 82 00 60 04 add %g1, 4, %g1 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 200806c: 7f ff e8 47 call 2002188 2008070: 01 00 00 00 nop uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 2008074: c6 06 00 00 ld [ %i0 ], %g3 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 2008078: c4 16 20 04 lduh [ %i0 + 4 ], %g2 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 200807c: f8 06 20 34 ld [ %i0 + 0x34 ], %i4 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; 2008080: f2 36 20 10 sth %i1, [ %i0 + 0x10 ] 2008084: 87 28 e0 18 sll %g3, 0x18, %g3 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 2008088: 85 28 a0 1b sll %g2, 0x1b, %g2 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 200808c: e2 26 20 34 st %l1, [ %i0 + 0x34 ] information->inactive_per_block = inactive_per_block; 2008090: e4 26 20 30 st %l2, [ %i0 + 0x30 ] information->local_table = local_table; 2008094: f4 26 20 1c st %i2, [ %i0 + 0x1c ] information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 2008098: b3 2e 60 10 sll %i1, 0x10, %i1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 200809c: 03 00 00 40 sethi %hi(0x10000), %g1 20080a0: b3 36 60 10 srl %i1, 0x10, %i1 20080a4: 82 10 c0 01 or %g3, %g1, %g1 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 20080a8: 82 10 40 02 or %g1, %g2, %g1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 20080ac: 82 10 40 19 or %g1, %i1, %g1 20080b0: c2 26 20 0c st %g1, [ %i0 + 0xc ] information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 20080b4: 7f ff e8 39 call 2002198 20080b8: 01 00 00 00 nop _Workspace_Free( old_tables ); 20080bc: 40 00 09 45 call 200a5d0 <_Workspace_Free> 20080c0: 90 10 00 1c mov %i4, %o0 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 20080c4: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 20080c8: b7 2e e0 02 sll %i3, 2, %i3 20080cc: e0 20 40 1b st %l0, [ %g1 + %i3 ] /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 20080d0: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 20080d4: d4 16 20 14 lduh [ %i0 + 0x14 ], %o2 20080d8: d2 00 40 1b ld [ %g1 + %i3 ], %o1 20080dc: d6 06 20 18 ld [ %i0 + 0x18 ], %o3 20080e0: 90 07 bf f4 add %fp, -12, %o0 20080e4: 40 00 14 27 call 200d180 <_Chain_Initialize> 20080e8: 39 00 00 40 sethi %hi(0x10000), %i4 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 20080ec: 10 80 00 0d b 2008120 <_Objects_Extend_information+0x224> 20080f0: b4 06 20 20 add %i0, 0x20, %i2 the_object->id = _Objects_Build_id( 20080f4: c6 16 20 04 lduh [ %i0 + 4 ], %g3 20080f8: 85 28 a0 18 sll %g2, 0x18, %g2 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 20080fc: 87 28 e0 1b sll %g3, 0x1b, %g3 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 2008100: 84 10 80 1c or %g2, %i4, %g2 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 2008104: 84 10 80 03 or %g2, %g3, %g2 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 2008108: 84 10 80 1d or %g2, %i5, %g2 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 200810c: 90 10 00 1a mov %i2, %o0 2008110: 92 10 00 01 mov %g1, %o1 index++; 2008114: ba 07 60 01 inc %i5 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 2008118: 7f ff fc a0 call 2007398 <_Chain_Append> 200811c: c4 20 60 08 st %g2, [ %g1 + 8 ] /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 2008120: 7f ff fc b2 call 20073e8 <_Chain_Get> 2008124: 90 07 bf f4 add %fp, -12, %o0 2008128: 82 92 20 00 orcc %o0, 0, %g1 200812c: 32 bf ff f2 bne,a 20080f4 <_Objects_Extend_information+0x1f8> 2008130: c4 06 00 00 ld [ %i0 ], %g2 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 2008134: c8 16 20 14 lduh [ %i0 + 0x14 ], %g4 2008138: c6 06 20 30 ld [ %i0 + 0x30 ], %g3 information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 200813c: c4 16 20 2c lduh [ %i0 + 0x2c ], %g2 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 2008140: c8 20 c0 1b st %g4, [ %g3 + %i3 ] information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 2008144: 82 00 80 04 add %g2, %g4, %g1 index++; } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = 2008148: c2 36 20 2c sth %g1, [ %i0 + 0x2c ] 200814c: 81 c7 e0 08 ret 2008150: 81 e8 00 00 restore if ( information->auto_extend ) { new_object_block = _Workspace_Allocate( block_size ); if ( !new_object_block ) return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 2008154: 40 00 09 25 call 200a5e8 <_Workspace_Allocate_or_fatal_error> 2008158: 01 00 00 00 nop 200815c: 10 bf ff 9b b 2007fc8 <_Objects_Extend_information+0xcc> 2008160: a0 10 00 08 mov %o0, %l0 /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 2008164: d2 06 20 34 ld [ %i0 + 0x34 ], %o1 information->object_blocks, block_count * sizeof(void*) ); 2008168: a7 2c e0 02 sll %l3, 2, %l3 /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 200816c: 40 00 20 45 call 2010280 2008170: 94 10 00 13 mov %l3, %o2 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 2008174: d2 06 20 30 ld [ %i0 + 0x30 ], %o1 2008178: 94 10 00 13 mov %l3, %o2 200817c: 40 00 20 41 call 2010280 2008180: 90 10 00 12 mov %l2, %o0 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 2008184: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 2008188: d2 06 20 1c ld [ %i0 + 0x1c ], %o1 information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 200818c: b8 07 00 01 add %i4, %g1, %i4 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 2008190: 90 10 00 1a mov %i2, %o0 2008194: 40 00 20 3b call 2010280 2008198: 95 2f 20 02 sll %i4, 2, %o2 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 200819c: 10 bf ff a7 b 2008038 <_Objects_Extend_information+0x13c> 20081a0: c6 16 20 14 lduh [ %i0 + 0x14 ], %g3 minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 20081a4: d0 16 20 14 lduh [ %i0 + 0x14 ], %o0 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 20081a8: ba 10 00 1c mov %i4, %i5 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 20081ac: b4 10 20 01 mov 1, %i2 minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 20081b0: b6 10 20 00 clr %i3 /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; 20081b4: a6 10 20 00 clr %l3 20081b8: 10 bf ff 72 b 2007f80 <_Objects_Extend_information+0x84> 20081bc: b3 2e 60 10 sll %i1, 0x10, %i1 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 20081c0: ba 10 00 1c mov %i4, %i5 <== NOT EXECUTED /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 20081c4: b4 10 20 01 mov 1, %i2 <== NOT EXECUTED minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 20081c8: 10 bf ff 6e b 2007f80 <_Objects_Extend_information+0x84> <== NOT EXECUTED 20081cc: b6 10 20 00 clr %i3 <== NOT EXECUTED 20081d0: 10 bf ff 6c b 2007f80 <_Objects_Extend_information+0x84> <== NOT EXECUTED 20081d4: b6 10 20 00 clr %i3 <== NOT EXECUTED (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); if ( !object_blocks ) { _Workspace_Free( new_object_block ); 20081d8: 40 00 08 fe call 200a5d0 <_Workspace_Free> 20081dc: 90 10 00 10 mov %l0, %o0 return; 20081e0: 81 c7 e0 08 ret 20081e4: 81 e8 00 00 restore =============================================================================== 0200828c <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 200828c: 9d e3 bf a0 save %sp, -96, %sp Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 2008290: 80 a6 60 00 cmp %i1, 0 2008294: 02 80 00 17 be 20082f0 <_Objects_Get_information+0x64> 2008298: ba 10 20 00 clr %i5 /* * 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 ); 200829c: 40 00 15 46 call 200d7b4 <_Objects_API_maximum_class> 20082a0: 90 10 00 18 mov %i0, %o0 if ( the_class_api_maximum == 0 ) 20082a4: 80 a2 20 00 cmp %o0, 0 20082a8: 02 80 00 12 be 20082f0 <_Objects_Get_information+0x64> 20082ac: 80 a2 00 19 cmp %o0, %i1 return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 20082b0: 0a 80 00 10 bcs 20082f0 <_Objects_Get_information+0x64> 20082b4: 03 00 80 76 sethi %hi(0x201d800), %g1 return NULL; if ( !_Objects_Information_table[ the_api ] ) 20082b8: b1 2e 20 02 sll %i0, 2, %i0 20082bc: 82 10 60 b8 or %g1, 0xb8, %g1 20082c0: c2 00 40 18 ld [ %g1 + %i0 ], %g1 20082c4: 80 a0 60 00 cmp %g1, 0 20082c8: 02 80 00 0a be 20082f0 <_Objects_Get_information+0x64> <== NEVER TAKEN 20082cc: b3 2e 60 02 sll %i1, 2, %i1 return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 20082d0: fa 00 40 19 ld [ %g1 + %i1 ], %i5 if ( !info ) 20082d4: 80 a7 60 00 cmp %i5, 0 20082d8: 02 80 00 06 be 20082f0 <_Objects_Get_information+0x64> <== NEVER TAKEN 20082dc: 01 00 00 00 nop * 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 ) 20082e0: c2 17 60 10 lduh [ %i5 + 0x10 ], %g1 return NULL; 20082e4: 80 a0 00 01 cmp %g0, %g1 20082e8: 82 60 20 00 subx %g0, 0, %g1 20082ec: ba 0f 40 01 and %i5, %g1, %i5 #endif return info; } 20082f0: 81 c7 e0 08 ret 20082f4: 91 e8 00 1d restore %g0, %i5, %o0 =============================================================================== 02009ac8 <_Objects_Get_name_as_string>: char *_Objects_Get_name_as_string( Objects_Id id, size_t length, char *name ) { 2009ac8: 9d e3 bf 90 save %sp, -112, %sp char lname[5]; Objects_Control *the_object; Objects_Locations location; Objects_Id tmpId; if ( length == 0 ) 2009acc: 80 a6 60 00 cmp %i1, 0 2009ad0: 02 80 00 41 be 2009bd4 <_Objects_Get_name_as_string+0x10c> 2009ad4: 80 a6 a0 00 cmp %i2, 0 return NULL; if ( name == NULL ) 2009ad8: 02 80 00 3a be 2009bc0 <_Objects_Get_name_as_string+0xf8> 2009adc: 80 a6 20 00 cmp %i0, 0 return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 2009ae0: 02 80 00 3a be 2009bc8 <_Objects_Get_name_as_string+0x100> 2009ae4: 03 00 80 82 sethi %hi(0x2020800), %g1 information = _Objects_Get_information_id( tmpId ); 2009ae8: 7f ff ff ba call 20099d0 <_Objects_Get_information_id> 2009aec: 90 10 00 18 mov %i0, %o0 if ( !information ) 2009af0: ba 92 20 00 orcc %o0, 0, %i5 2009af4: 02 80 00 38 be 2009bd4 <_Objects_Get_name_as_string+0x10c> 2009af8: 92 10 00 18 mov %i0, %o1 return NULL; the_object = _Objects_Get( information, tmpId, &location ); 2009afc: 40 00 00 3f call 2009bf8 <_Objects_Get> 2009b00: 94 07 bf fc add %fp, -4, %o2 switch ( location ) { 2009b04: c2 07 bf fc ld [ %fp + -4 ], %g1 2009b08: 80 a0 60 00 cmp %g1, 0 2009b0c: 32 80 00 33 bne,a 2009bd8 <_Objects_Get_name_as_string+0x110> 2009b10: b4 10 20 00 clr %i2 return NULL; case OBJECTS_LOCAL: #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 2009b14: c2 0f 60 38 ldub [ %i5 + 0x38 ], %g1 2009b18: 80 a0 60 00 cmp %g1, 0 2009b1c: 32 80 00 31 bne,a 2009be0 <_Objects_Get_name_as_string+0x118> 2009b20: c4 02 20 0c ld [ %o0 + 0xc ], %g2 s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; 2009b24: c2 02 20 0c ld [ %o0 + 0xc ], %g1 lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 2009b28: c0 2f bf f4 clrb [ %fp + -12 ] { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 2009b2c: 85 30 60 08 srl %g1, 8, %g2 } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; 2009b30: 89 30 60 18 srl %g1, 0x18, %g4 lname[ 1 ] = (u32_name >> 16) & 0xff; 2009b34: 87 30 60 10 srl %g1, 0x10, %g3 lname[ 2 ] = (u32_name >> 8) & 0xff; 2009b38: c4 2f bf f2 stb %g2, [ %fp + -14 ] } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; 2009b3c: c8 2f bf f0 stb %g4, [ %fp + -16 ] lname[ 1 ] = (u32_name >> 16) & 0xff; 2009b40: c6 2f bf f1 stb %g3, [ %fp + -15 ] lname[ 2 ] = (u32_name >> 8) & 0xff; lname[ 3 ] = (u32_name >> 0) & 0xff; 2009b44: c2 2f bf f3 stb %g1, [ %fp + -13 ] lname[ 4 ] = '\0'; s = lname; 2009b48: 84 07 bf f0 add %fp, -16, %g2 } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 2009b4c: b2 86 7f ff addcc %i1, -1, %i1 2009b50: 02 80 00 1a be 2009bb8 <_Objects_Get_name_as_string+0xf0> <== NEVER TAKEN 2009b54: 82 10 00 1a mov %i2, %g1 2009b58: c8 48 80 00 ldsb [ %g2 ], %g4 2009b5c: 80 a1 20 00 cmp %g4, 0 2009b60: 02 80 00 16 be 2009bb8 <_Objects_Get_name_as_string+0xf0> 2009b64: c6 08 80 00 ldub [ %g2 ], %g3 2009b68: 31 00 80 7d sethi %hi(0x201f400), %i0 * This method objects the name of an object and returns its name * in the form of a C string. It attempts to be careful about * overflowing the user's string and about returning unprintable characters. */ char *_Objects_Get_name_as_string( 2009b6c: b2 06 80 19 add %i2, %i1, %i1 2009b70: 10 80 00 05 b 2009b84 <_Objects_Get_name_as_string+0xbc> 2009b74: b0 16 22 c4 or %i0, 0x2c4, %i0 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 2009b78: 80 a1 20 00 cmp %g4, 0 2009b7c: 02 80 00 0f be 2009bb8 <_Objects_Get_name_as_string+0xf0> 2009b80: c6 08 80 00 ldub [ %g2 ], %g3 *d = (isprint((unsigned char)*s)) ? *s : '*'; 2009b84: fa 06 00 00 ld [ %i0 ], %i5 2009b88: 88 08 e0 ff and %g3, 0xff, %g4 2009b8c: 88 07 40 04 add %i5, %g4, %g4 2009b90: c8 49 20 01 ldsb [ %g4 + 1 ], %g4 2009b94: 80 89 20 97 btst 0x97, %g4 2009b98: 12 80 00 03 bne 2009ba4 <_Objects_Get_name_as_string+0xdc> 2009b9c: 84 00 a0 01 inc %g2 2009ba0: 86 10 20 2a mov 0x2a, %g3 2009ba4: c6 28 40 00 stb %g3, [ %g1 ] s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 2009ba8: 82 00 60 01 inc %g1 2009bac: 80 a0 40 19 cmp %g1, %i1 2009bb0: 32 bf ff f2 bne,a 2009b78 <_Objects_Get_name_as_string+0xb0> 2009bb4: c8 48 80 00 ldsb [ %g2 ], %g4 *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; _Thread_Enable_dispatch(); 2009bb8: 40 00 03 ac call 200aa68 <_Thread_Enable_dispatch> 2009bbc: c0 28 40 00 clrb [ %g1 ] return name; } return NULL; /* unreachable path */ } 2009bc0: 81 c7 e0 08 ret 2009bc4: 91 e8 00 1a restore %g0, %i2, %o0 return NULL; if ( name == NULL ) return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 2009bc8: c2 00 61 b4 ld [ %g1 + 0x1b4 ], %g1 2009bcc: 10 bf ff c7 b 2009ae8 <_Objects_Get_name_as_string+0x20> 2009bd0: f0 00 60 08 ld [ %g1 + 8 ], %i0 #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* not supported */ #endif case OBJECTS_ERROR: return NULL; 2009bd4: b4 10 20 00 clr %i2 _Thread_Enable_dispatch(); return name; } return NULL; /* unreachable path */ } 2009bd8: 81 c7 e0 08 ret 2009bdc: 91 e8 00 1a restore %g0, %i2, %o0 lname[ 4 ] = '\0'; s = lname; } d = name; if ( s ) { 2009be0: 80 a0 a0 00 cmp %g2, 0 2009be4: 12 bf ff da bne 2009b4c <_Objects_Get_name_as_string+0x84> 2009be8: 82 10 00 1a mov %i2, %g1 *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; _Thread_Enable_dispatch(); 2009bec: 40 00 03 9f call 200aa68 <_Thread_Enable_dispatch> 2009bf0: c0 28 40 00 clrb [ %g1 ] 2009bf4: 30 bf ff f3 b,a 2009bc0 <_Objects_Get_name_as_string+0xf8> =============================================================================== 02007fa4 <_Objects_Get_next>: Objects_Information *information, Objects_Id id, Objects_Locations *location_p, Objects_Id *next_id_p ) { 2007fa4: 9d e3 bf a0 save %sp, -96, %sp Objects_Control *object; Objects_Id next_id; if ( !information ) return NULL; 2007fa8: 90 10 20 00 clr %o0 ) { Objects_Control *object; Objects_Id next_id; if ( !information ) 2007fac: 80 a6 20 00 cmp %i0, 0 2007fb0: 02 80 00 19 be 2008014 <_Objects_Get_next+0x70> 2007fb4: ba 10 00 18 mov %i0, %i5 return NULL; if ( !location_p ) 2007fb8: 80 a6 a0 00 cmp %i2, 0 2007fbc: 02 80 00 16 be 2008014 <_Objects_Get_next+0x70> 2007fc0: 80 a6 e0 00 cmp %i3, 0 return NULL; if ( !next_id_p ) 2007fc4: 02 80 00 14 be 2008014 <_Objects_Get_next+0x70> 2007fc8: 83 2e 60 10 sll %i1, 0x10, %g1 return NULL; if (_Objects_Get_index(id) == OBJECTS_ID_INITIAL_INDEX) 2007fcc: 80 a0 60 00 cmp %g1, 0 2007fd0: 22 80 00 13 be,a 200801c <_Objects_Get_next+0x78> 2007fd4: f2 06 20 08 ld [ %i0 + 8 ], %i1 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) 2007fd8: c4 17 60 10 lduh [ %i5 + 0x10 ], %g2 2007fdc: 83 2e 60 10 sll %i1, 0x10, %g1 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 2007fe0: 92 10 00 19 mov %i1, %o1 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) 2007fe4: 83 30 60 10 srl %g1, 0x10, %g1 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 2007fe8: 90 10 00 1d mov %i5, %o0 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) 2007fec: 80 a0 80 01 cmp %g2, %g1 2007ff0: 0a 80 00 13 bcs 200803c <_Objects_Get_next+0x98> 2007ff4: 94 10 00 1a mov %i2, %o2 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 2007ff8: 40 00 00 18 call 2008058 <_Objects_Get> 2007ffc: b2 06 60 01 inc %i1 next_id++; } while (*location_p != OBJECTS_LOCAL); 2008000: c2 06 80 00 ld [ %i2 ], %g1 2008004: 80 a0 60 00 cmp %g1, 0 2008008: 32 bf ff f5 bne,a 2007fdc <_Objects_Get_next+0x38> 200800c: c4 17 60 10 lduh [ %i5 + 0x10 ], %g2 *next_id_p = next_id; 2008010: f2 26 c0 00 st %i1, [ %i3 ] return object; final: *next_id_p = OBJECTS_ID_FINAL; return 0; } 2008014: 81 c7 e0 08 ret 2008018: 91 e8 00 08 restore %g0, %o0, %o0 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) 200801c: c4 17 60 10 lduh [ %i5 + 0x10 ], %g2 2008020: 83 2e 60 10 sll %i1, 0x10, %g1 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 2008024: 92 10 00 19 mov %i1, %o1 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) 2008028: 83 30 60 10 srl %g1, 0x10, %g1 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 200802c: 90 10 00 1d mov %i5, %o0 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) 2008030: 80 a0 80 01 cmp %g2, %g1 2008034: 1a bf ff f1 bcc 2007ff8 <_Objects_Get_next+0x54> <== ALWAYS TAKEN 2008038: 94 10 00 1a mov %i2, %o2 { *location_p = OBJECTS_ERROR; 200803c: 82 10 20 01 mov 1, %g1 2008040: c2 26 80 00 st %g1, [ %i2 ] *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; return 0; 2008044: 90 10 20 00 clr %o0 *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; 2008048: 82 10 3f ff mov -1, %g1 200804c: c2 26 c0 00 st %g1, [ %i3 ] return 0; } 2008050: 81 c7 e0 08 ret 2008054: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 020095c4 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 20095c4: 9d e3 bf 98 save %sp, -104, %sp /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 20095c8: 80 a6 20 00 cmp %i0, 0 20095cc: 12 80 00 06 bne 20095e4 <_Objects_Id_to_name+0x20> 20095d0: 83 36 20 18 srl %i0, 0x18, %g1 20095d4: 03 00 80 7d sethi %hi(0x201f400), %g1 20095d8: c2 00 62 84 ld [ %g1 + 0x284 ], %g1 ! 201f684 <_Per_CPU_Information+0xc> 20095dc: f0 00 60 08 ld [ %g1 + 8 ], %i0 20095e0: 83 36 20 18 srl %i0, 0x18, %g1 20095e4: 82 08 60 07 and %g1, 7, %g1 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 20095e8: 84 00 7f ff add %g1, -1, %g2 20095ec: 80 a0 a0 02 cmp %g2, 2 20095f0: 18 80 00 12 bgu 2009638 <_Objects_Id_to_name+0x74> 20095f4: ba 10 20 03 mov 3, %i5 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 20095f8: 83 28 60 02 sll %g1, 2, %g1 20095fc: 05 00 80 7c sethi %hi(0x201f000), %g2 2009600: 84 10 a0 a8 or %g2, 0xa8, %g2 ! 201f0a8 <_Objects_Information_table> 2009604: c2 00 80 01 ld [ %g2 + %g1 ], %g1 2009608: 80 a0 60 00 cmp %g1, 0 200960c: 02 80 00 0b be 2009638 <_Objects_Id_to_name+0x74> 2009610: 85 36 20 1b srl %i0, 0x1b, %g2 return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 2009614: 85 28 a0 02 sll %g2, 2, %g2 2009618: d0 00 40 02 ld [ %g1 + %g2 ], %o0 if ( !information ) 200961c: 80 a2 20 00 cmp %o0, 0 2009620: 02 80 00 06 be 2009638 <_Objects_Id_to_name+0x74> <== NEVER TAKEN 2009624: 01 00 00 00 nop return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 2009628: c2 0a 20 38 ldub [ %o0 + 0x38 ], %g1 200962c: 80 a0 60 00 cmp %g1, 0 2009630: 02 80 00 04 be 2009640 <_Objects_Id_to_name+0x7c> <== ALWAYS TAKEN 2009634: 92 10 00 18 mov %i0, %o1 return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 2009638: 81 c7 e0 08 ret 200963c: 91 e8 00 1d restore %g0, %i5, %o0 #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 ); 2009640: 7f ff ff c3 call 200954c <_Objects_Get> 2009644: 94 07 bf fc add %fp, -4, %o2 if ( !the_object ) 2009648: 80 a2 20 00 cmp %o0, 0 200964c: 02 bf ff fb be 2009638 <_Objects_Id_to_name+0x74> 2009650: 01 00 00 00 nop return OBJECTS_INVALID_ID; *name = the_object->name; 2009654: c2 02 20 0c ld [ %o0 + 0xc ], %g1 _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 2009658: ba 10 20 00 clr %i5 the_object = _Objects_Get( information, tmpId, &ignored_location ); if ( !the_object ) return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); 200965c: 40 00 03 ad call 200a510 <_Thread_Enable_dispatch> 2009660: c2 26 40 00 st %g1, [ %i1 ] return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 2009664: 30 bf ff f5 b,a 2009638 <_Objects_Id_to_name+0x74> =============================================================================== 020085c8 <_Objects_Shrink_information>: */ void _Objects_Shrink_information( Objects_Information *information ) { 20085c8: 9d e3 bf a0 save %sp, -96, %sp /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 20085cc: fa 16 20 0a lduh [ %i0 + 0xa ], %i5 block_count = (information->maximum - index_base) / 20085d0: f8 16 20 14 lduh [ %i0 + 0x14 ], %i4 20085d4: d0 16 20 10 lduh [ %i0 + 0x10 ], %o0 20085d8: 92 10 00 1c mov %i4, %o1 20085dc: 40 00 40 70 call 201879c <.udiv> 20085e0: 90 22 00 1d sub %o0, %i5, %o0 information->allocation_size; for ( block = 0; block < block_count; block++ ) { 20085e4: 80 a2 20 00 cmp %o0, 0 20085e8: 02 80 00 34 be 20086b8 <_Objects_Shrink_information+0xf0> <== NEVER TAKEN 20085ec: 01 00 00 00 nop if ( information->inactive_per_block[ block ] == 20085f0: c8 06 20 30 ld [ %i0 + 0x30 ], %g4 20085f4: c2 01 00 00 ld [ %g4 ], %g1 20085f8: 80 a7 00 01 cmp %i4, %g1 20085fc: 02 80 00 0f be 2008638 <_Objects_Shrink_information+0x70> <== NEVER TAKEN 2008600: 82 10 20 00 clr %g1 2008604: 10 80 00 07 b 2008620 <_Objects_Shrink_information+0x58> 2008608: b6 10 20 04 mov 4, %i3 200860c: 86 06 e0 04 add %i3, 4, %g3 2008610: 80 a7 00 02 cmp %i4, %g2 2008614: 02 80 00 0a be 200863c <_Objects_Shrink_information+0x74> 2008618: ba 07 40 1c add %i5, %i4, %i5 200861c: b6 10 00 03 mov %g3, %i3 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 2008620: 82 00 60 01 inc %g1 2008624: 80 a0 40 08 cmp %g1, %o0 2008628: 32 bf ff f9 bne,a 200860c <_Objects_Shrink_information+0x44> 200862c: c4 01 00 1b ld [ %g4 + %i3 ], %g2 2008630: 81 c7 e0 08 ret 2008634: 81 e8 00 00 restore if ( information->inactive_per_block[ block ] == 2008638: b6 10 20 00 clr %i3 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 200863c: 10 80 00 06 b 2008654 <_Objects_Shrink_information+0x8c> 2008640: d0 06 20 20 ld [ %i0 + 0x20 ], %o0 if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); } } while ( the_object ); 2008644: 80 a7 20 00 cmp %i4, 0 2008648: 22 80 00 12 be,a 2008690 <_Objects_Shrink_information+0xc8> 200864c: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 index = _Objects_Get_index( the_object->id ); /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 2008650: 90 10 00 1c mov %i4, %o0 * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) _Chain_First( &information->Inactive ); do { index = _Objects_Get_index( the_object->id ); 2008654: c2 12 20 0a lduh [ %o0 + 0xa ], %g1 /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && 2008658: 80 a0 40 1d cmp %g1, %i5 200865c: 0a bf ff fa bcs 2008644 <_Objects_Shrink_information+0x7c> 2008660: f8 02 00 00 ld [ %o0 ], %i4 (index < (index_base + information->allocation_size))) { 2008664: c4 16 20 14 lduh [ %i0 + 0x14 ], %g2 2008668: 84 07 40 02 add %i5, %g2, %g2 /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && 200866c: 80 a0 40 02 cmp %g1, %g2 2008670: 1a bf ff f6 bcc 2008648 <_Objects_Shrink_information+0x80> 2008674: 80 a7 20 00 cmp %i4, 0 (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); 2008678: 7f ff fb 53 call 20073c4 <_Chain_Extract> 200867c: 01 00 00 00 nop } } while ( the_object ); 2008680: 80 a7 20 00 cmp %i4, 0 2008684: 12 bf ff f4 bne 2008654 <_Objects_Shrink_information+0x8c><== ALWAYS TAKEN 2008688: 90 10 00 1c mov %i4, %o0 /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 200868c: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 <== NOT EXECUTED 2008690: 40 00 07 d0 call 200a5d0 <_Workspace_Free> 2008694: d0 00 40 1b ld [ %g1 + %i3 ], %o0 information->object_blocks[ block ] = NULL; 2008698: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 200869c: c4 16 20 2c lduh [ %i0 + 0x2c ], %g2 /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; 20086a0: c0 20 40 1b clr [ %g1 + %i3 ] information->inactive_per_block[ block ] = 0; 20086a4: c6 06 20 30 ld [ %i0 + 0x30 ], %g3 information->inactive -= information->allocation_size; 20086a8: c2 16 20 14 lduh [ %i0 + 0x14 ], %g1 * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; 20086ac: c0 20 c0 1b clr [ %g3 + %i3 ] information->inactive -= information->allocation_size; 20086b0: 82 20 80 01 sub %g2, %g1, %g1 20086b4: c2 36 20 2c sth %g1, [ %i0 + 0x2c ] return; 20086b8: 81 c7 e0 08 ret 20086bc: 81 e8 00 00 restore =============================================================================== 0200b29c <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 200b29c: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd ( mqd_t id, Objects_Locations *location ) { return (POSIX_Message_queue_Control_fd *) _Objects_Get( 200b2a0: 11 00 80 9e sethi %hi(0x2027800), %o0 200b2a4: 92 10 00 18 mov %i0, %o1 200b2a8: 90 12 20 ec or %o0, 0xec, %o0 200b2ac: 40 00 0d 13 call 200e6f8 <_Objects_Get> 200b2b0: 94 07 bf f8 add %fp, -8, %o2 Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 200b2b4: c2 07 bf f8 ld [ %fp + -8 ], %g1 200b2b8: 80 a0 60 00 cmp %g1, 0 200b2bc: 22 80 00 08 be,a 200b2dc <_POSIX_Message_queue_Receive_support+0x40> 200b2c0: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 200b2c4: 40 00 2c ec call 2016674 <__errno> 200b2c8: b0 10 3f ff mov -1, %i0 200b2cc: 82 10 20 09 mov 9, %g1 200b2d0: c2 22 00 00 st %g1, [ %o0 ] } 200b2d4: 81 c7 e0 08 ret 200b2d8: 81 e8 00 00 restore the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 200b2dc: 84 08 60 03 and %g1, 3, %g2 200b2e0: 80 a0 a0 01 cmp %g2, 1 200b2e4: 02 80 00 37 be 200b3c0 <_POSIX_Message_queue_Receive_support+0x124> 200b2e8: 01 00 00 00 nop _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 200b2ec: d0 02 20 10 ld [ %o0 + 0x10 ], %o0 if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 200b2f0: c4 02 20 68 ld [ %o0 + 0x68 ], %g2 200b2f4: 80 a0 80 1a cmp %g2, %i2 200b2f8: 18 80 00 21 bgu 200b37c <_POSIX_Message_queue_Receive_support+0xe0> 200b2fc: 84 10 3f ff mov -1, %g2 /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 200b300: c4 27 bf fc st %g2, [ %fp + -4 ] /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 200b304: 80 a7 20 00 cmp %i4, 0 200b308: 12 80 00 18 bne 200b368 <_POSIX_Message_queue_Receive_support+0xcc><== ALWAYS TAKEN 200b30c: 98 10 20 00 clr %o4 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 200b310: 9a 10 00 1d mov %i5, %o5 200b314: 90 02 20 1c add %o0, 0x1c, %o0 200b318: 92 10 00 18 mov %i0, %o1 200b31c: 94 10 00 19 mov %i1, %o2 200b320: 96 07 bf fc add %fp, -4, %o3 200b324: 40 00 08 90 call 200d564 <_CORE_message_queue_Seize> 200b328: 98 0b 20 01 and %o4, 1, %o4 &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 200b32c: 40 00 10 ae call 200f5e4 <_Thread_Enable_dispatch> 200b330: 3b 00 80 9e sethi %hi(0x2027800), %i5 *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 200b334: ba 17 61 58 or %i5, 0x158, %i5 ! 2027958 <_Per_CPU_Information> 200b338: c2 07 60 0c ld [ %i5 + 0xc ], %g1 RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core( CORE_message_queue_Submit_types priority ) { /* absolute value without a library dependency */ return ((priority >= 0) ? priority : -priority); 200b33c: c4 00 60 24 ld [ %g1 + 0x24 ], %g2 if ( !_Thread_Executing->Wait.return_code ) 200b340: c6 00 60 34 ld [ %g1 + 0x34 ], %g3 200b344: 83 38 a0 1f sra %g2, 0x1f, %g1 200b348: 84 18 40 02 xor %g1, %g2, %g2 200b34c: 82 20 80 01 sub %g2, %g1, %g1 200b350: 80 a0 e0 00 cmp %g3, 0 200b354: 12 80 00 12 bne 200b39c <_POSIX_Message_queue_Receive_support+0x100> 200b358: c2 26 c0 00 st %g1, [ %i3 ] return length_out; 200b35c: f0 07 bf fc ld [ %fp + -4 ], %i0 200b360: 81 c7 e0 08 ret 200b364: 81 e8 00 00 restore /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 200b368: 05 00 00 10 sethi %hi(0x4000), %g2 200b36c: 82 08 40 02 and %g1, %g2, %g1 200b370: 80 a0 00 01 cmp %g0, %g1 200b374: 10 bf ff e7 b 200b310 <_POSIX_Message_queue_Receive_support+0x74> 200b378: 98 60 3f ff subx %g0, -1, %o4 } the_mq = the_mq_fd->Queue; if ( msg_len < the_mq->Message_queue.maximum_message_size ) { _Thread_Enable_dispatch(); 200b37c: 40 00 10 9a call 200f5e4 <_Thread_Enable_dispatch> 200b380: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one( EMSGSIZE ); 200b384: 40 00 2c bc call 2016674 <__errno> 200b388: 01 00 00 00 nop 200b38c: 82 10 20 7a mov 0x7a, %g1 ! 7a 200b390: c2 22 00 00 st %g1, [ %o0 ] 200b394: 81 c7 e0 08 ret 200b398: 81 e8 00 00 restore _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) return length_out; rtems_set_errno_and_return_minus_one( 200b39c: 40 00 2c b6 call 2016674 <__errno> 200b3a0: b0 10 3f ff mov -1, %i0 200b3a4: c2 07 60 0c ld [ %i5 + 0xc ], %g1 200b3a8: b6 10 00 08 mov %o0, %i3 200b3ac: 40 00 00 a3 call 200b638 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 200b3b0: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 200b3b4: d0 26 c0 00 st %o0, [ %i3 ] 200b3b8: 81 c7 e0 08 ret 200b3bc: 81 e8 00 00 restore the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { _Thread_Enable_dispatch(); 200b3c0: 40 00 10 89 call 200f5e4 <_Thread_Enable_dispatch> 200b3c4: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one( EBADF ); 200b3c8: 40 00 2c ab call 2016674 <__errno> 200b3cc: 01 00 00 00 nop 200b3d0: 82 10 20 09 mov 9, %g1 ! 9 200b3d4: c2 22 00 00 st %g1, [ %o0 ] 200b3d8: 81 c7 e0 08 ret 200b3dc: 81 e8 00 00 restore =============================================================================== 0200c1e8 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: Thread_Control *the_thread ) { POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 200c1e8: c2 02 21 5c ld [ %o0 + 0x15c ], %g1 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 200c1ec: c4 00 60 d8 ld [ %g1 + 0xd8 ], %g2 200c1f0: 80 a0 a0 00 cmp %g2, 0 200c1f4: 12 80 00 06 bne 200c20c <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x24><== NEVER TAKEN 200c1f8: 01 00 00 00 nop 200c1fc: c4 00 60 dc ld [ %g1 + 0xdc ], %g2 200c200: 80 a0 a0 01 cmp %g2, 1 200c204: 22 80 00 05 be,a 200c218 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x30> 200c208: c2 00 60 e0 ld [ %g1 + 0xe0 ], %g1 thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); } else _Thread_Enable_dispatch(); 200c20c: 82 13 c0 00 mov %o7, %g1 200c210: 7f ff f3 a6 call 20090a8 <_Thread_Enable_dispatch> 200c214: 9e 10 40 00 mov %g1, %o7 POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 200c218: 80 a0 60 00 cmp %g1, 0 200c21c: 02 bf ff fc be 200c20c <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x24> 200c220: 01 00 00 00 nop /** * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 200c224: 03 00 80 5f sethi %hi(0x2017c00), %g1 200c228: c4 00 63 a0 ld [ %g1 + 0x3a0 ], %g2 ! 2017fa0 <_Thread_Dispatch_disable_level> thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 200c22c: 92 10 3f ff mov -1, %o1 200c230: 84 00 bf ff add %g2, -1, %g2 200c234: c4 20 63 a0 st %g2, [ %g1 + 0x3a0 ] return _Thread_Dispatch_disable_level; 200c238: c2 00 63 a0 ld [ %g1 + 0x3a0 ], %g1 200c23c: 82 13 c0 00 mov %o7, %g1 200c240: 40 00 01 d7 call 200c99c <_POSIX_Thread_Exit> 200c244: 9e 10 40 00 mov %g1, %o7 =============================================================================== 0200d648 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 200d648: 9d e3 bf a0 save %sp, -96, %sp if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 200d64c: d0 06 40 00 ld [ %i1 ], %o0 200d650: 7f ff ff f1 call 200d614 <_POSIX_Priority_Is_valid> 200d654: ba 10 00 18 mov %i0, %i5 200d658: 80 8a 20 ff btst 0xff, %o0 200d65c: 02 80 00 34 be 200d72c <_POSIX_Thread_Translate_sched_param+0xe4><== NEVER TAKEN 200d660: b0 10 20 16 mov 0x16, %i0 return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 200d664: c0 26 80 00 clr [ %i2 ] *budget_callout = NULL; 200d668: c0 26 c0 00 clr [ %i3 ] if ( policy == SCHED_OTHER ) { 200d66c: 80 a7 60 00 cmp %i5, 0 200d670: 02 80 00 2d be 200d724 <_POSIX_Thread_Translate_sched_param+0xdc> 200d674: b0 10 20 00 clr %i0 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; return 0; } if ( policy == SCHED_FIFO ) { 200d678: 80 a7 60 01 cmp %i5, 1 200d67c: 02 80 00 2c be 200d72c <_POSIX_Thread_Translate_sched_param+0xe4> 200d680: 80 a7 60 02 cmp %i5, 2 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 200d684: 02 80 00 2c be 200d734 <_POSIX_Thread_Translate_sched_param+0xec> 200d688: 80 a7 60 04 cmp %i5, 4 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; return 0; } if ( policy == SCHED_SPORADIC ) { 200d68c: 12 80 00 28 bne 200d72c <_POSIX_Thread_Translate_sched_param+0xe4> 200d690: b0 10 20 16 mov 0x16, %i0 if ( (param->sched_ss_repl_period.tv_sec == 0) && 200d694: c2 06 60 08 ld [ %i1 + 8 ], %g1 200d698: 80 a0 60 00 cmp %g1, 0 200d69c: 32 80 00 07 bne,a 200d6b8 <_POSIX_Thread_Translate_sched_param+0x70> 200d6a0: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 200d6a4: c2 06 60 0c ld [ %i1 + 0xc ], %g1 200d6a8: 80 a0 60 00 cmp %g1, 0 200d6ac: 02 80 00 23 be 200d738 <_POSIX_Thread_Translate_sched_param+0xf0> 200d6b0: 01 00 00 00 nop (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 200d6b4: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 200d6b8: 80 a0 60 00 cmp %g1, 0 200d6bc: 12 80 00 06 bne 200d6d4 <_POSIX_Thread_Translate_sched_param+0x8c> 200d6c0: 01 00 00 00 nop 200d6c4: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 200d6c8: 80 a0 60 00 cmp %g1, 0 200d6cc: 02 80 00 18 be 200d72c <_POSIX_Thread_Translate_sched_param+0xe4> 200d6d0: b0 10 20 16 mov 0x16, %i0 (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 200d6d4: 7f ff f5 2d call 200ab88 <_Timespec_To_ticks> 200d6d8: 90 06 60 08 add %i1, 8, %o0 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; 200d6dc: b0 10 20 16 mov 0x16, %i0 if ( (param->sched_ss_init_budget.tv_sec == 0) && (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 200d6e0: ba 10 00 08 mov %o0, %i5 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 200d6e4: 7f ff f5 29 call 200ab88 <_Timespec_To_ticks> 200d6e8: 90 06 60 10 add %i1, 0x10, %o0 if ( (param->sched_ss_init_budget.tv_sec == 0) && (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 200d6ec: 80 a7 40 08 cmp %i5, %o0 200d6f0: 0a 80 00 12 bcs 200d738 <_POSIX_Thread_Translate_sched_param+0xf0> 200d6f4: 01 00 00 00 nop _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) 200d6f8: 7f ff ff c7 call 200d614 <_POSIX_Priority_Is_valid> 200d6fc: d0 06 60 04 ld [ %i1 + 4 ], %o0 200d700: 80 8a 20 ff btst 0xff, %o0 200d704: 02 80 00 0a be 200d72c <_POSIX_Thread_Translate_sched_param+0xe4> 200d708: 82 10 20 03 mov 3, %g1 return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 200d70c: c2 26 80 00 st %g1, [ %i2 ] *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 200d710: 03 00 80 1a sethi %hi(0x2006800), %g1 200d714: 82 10 63 98 or %g1, 0x398, %g1 ! 2006b98 <_POSIX_Threads_Sporadic_budget_callout> 200d718: c2 26 c0 00 st %g1, [ %i3 ] return 0; } return EINVAL; } 200d71c: 81 c7 e0 08 ret 200d720: 91 e8 20 00 restore %g0, 0, %o0 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; *budget_callout = NULL; if ( policy == SCHED_OTHER ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 200d724: 82 10 20 01 mov 1, %g1 200d728: c2 26 80 00 st %g1, [ %i2 ] return 0; 200d72c: 81 c7 e0 08 ret 200d730: 81 e8 00 00 restore *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 200d734: fa 26 80 00 st %i5, [ %i2 ] return 0; 200d738: 81 c7 e0 08 ret 200d73c: 81 e8 00 00 restore =============================================================================== 02006898 <_POSIX_Threads_Initialize_user_threads_body>: * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { 2006898: 9d e3 bf 58 save %sp, -168, %sp uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; 200689c: 03 00 80 75 sethi %hi(0x201d400), %g1 20068a0: 82 10 62 d4 or %g1, 0x2d4, %g1 ! 201d6d4 maximum = Configuration_POSIX_API.number_of_initialization_threads; 20068a4: f6 00 60 30 ld [ %g1 + 0x30 ], %i3 if ( !user_threads || maximum == 0 ) 20068a8: 80 a6 e0 00 cmp %i3, 0 20068ac: 02 80 00 18 be 200690c <_POSIX_Threads_Initialize_user_threads_body+0x74><== NEVER TAKEN 20068b0: fa 00 60 34 ld [ %g1 + 0x34 ], %i5 20068b4: 80 a7 60 00 cmp %i5, 0 20068b8: 02 80 00 15 be 200690c <_POSIX_Threads_Initialize_user_threads_body+0x74><== NEVER TAKEN 20068bc: b8 10 20 00 clr %i4 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 20068c0: 40 00 1b a0 call 200d740 20068c4: 90 07 bf bc add %fp, -68, %o0 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 20068c8: 92 10 20 02 mov 2, %o1 20068cc: 40 00 1b a9 call 200d770 20068d0: 90 07 bf bc add %fp, -68, %o0 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 20068d4: d2 07 60 04 ld [ %i5 + 4 ], %o1 20068d8: 40 00 1b b6 call 200d7b0 20068dc: 90 07 bf bc add %fp, -68, %o0 status = pthread_create( 20068e0: d4 07 40 00 ld [ %i5 ], %o2 20068e4: 90 07 bf fc add %fp, -4, %o0 20068e8: 92 07 bf bc add %fp, -68, %o1 20068ec: 7f ff ff 28 call 200658c 20068f0: 96 10 20 00 clr %o3 &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 20068f4: 94 92 20 00 orcc %o0, 0, %o2 20068f8: 12 80 00 07 bne 2006914 <_POSIX_Threads_Initialize_user_threads_body+0x7c> 20068fc: b8 07 20 01 inc %i4 * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { 2006900: 80 a6 c0 1c cmp %i3, %i4 2006904: 18 bf ff ef bgu 20068c0 <_POSIX_Threads_Initialize_user_threads_body+0x28><== NEVER TAKEN 2006908: ba 07 60 08 add %i5, 8, %i5 200690c: 81 c7 e0 08 ret 2006910: 81 e8 00 00 restore &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 2006914: 90 10 20 02 mov 2, %o0 2006918: 40 00 08 4a call 2008a40 <_Internal_error_Occurred> 200691c: 92 10 20 01 mov 1, %o1 =============================================================================== 0200ca9c <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 200ca9c: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *the_thread; POSIX_API_Control *api; the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 200caa0: fa 06 61 5c ld [ %i1 + 0x15c ], %i5 /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 200caa4: 40 00 04 09 call 200dac8 <_Timespec_To_ticks> 200caa8: 90 07 60 98 add %i5, 0x98, %o0 RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 200caac: c4 07 60 88 ld [ %i5 + 0x88 ], %g2 200cab0: 03 00 80 73 sethi %hi(0x201cc00), %g1 200cab4: d2 08 60 2c ldub [ %g1 + 0x2c ], %o1 ! 201cc2c */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 200cab8: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 200cabc: 92 22 40 02 sub %o1, %g2, %o1 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); the_thread->cpu_time_budget = ticks; 200cac0: d0 26 60 78 st %o0, [ %i1 + 0x78 ] */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 200cac4: 80 a0 60 00 cmp %g1, 0 200cac8: 12 80 00 06 bne 200cae0 <_POSIX_Threads_Sporadic_budget_TSR+0x44><== NEVER TAKEN 200cacc: d2 26 60 18 st %o1, [ %i1 + 0x18 ] /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { 200cad0: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 200cad4: 80 a0 40 09 cmp %g1, %o1 200cad8: 38 80 00 09 bgu,a 200cafc <_POSIX_Threads_Sporadic_budget_TSR+0x60> 200cadc: 90 10 00 19 mov %i1, %o0 #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); 200cae0: 40 00 03 fa call 200dac8 <_Timespec_To_ticks> 200cae4: 90 07 60 90 add %i5, 0x90, %o0 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 200cae8: 31 00 80 76 sethi %hi(0x201d800), %i0 200caec: b2 07 60 a8 add %i5, 0xa8, %i1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 200caf0: d0 27 60 b4 st %o0, [ %i5 + 0xb4 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 200caf4: 7f ff f5 d1 call 200a238 <_Watchdog_Insert> 200caf8: 91 ee 22 14 restore %i0, 0x214, %o0 if ( the_thread->resource_count == 0 ) { /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { _Thread_Change_priority( the_thread, new_priority, true ); 200cafc: 7f ff f0 a6 call 2008d94 <_Thread_Change_priority> 200cb00: 94 10 20 01 mov 1, %o2 #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); 200cb04: 40 00 03 f1 call 200dac8 <_Timespec_To_ticks> 200cb08: 90 07 60 90 add %i5, 0x90, %o0 200cb0c: 31 00 80 76 sethi %hi(0x201d800), %i0 200cb10: b2 07 60 a8 add %i5, 0xa8, %i1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 200cb14: d0 27 60 b4 st %o0, [ %i5 + 0xb4 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 200cb18: 7f ff f5 c8 call 200a238 <_Watchdog_Insert> 200cb1c: 91 ee 22 14 restore %i0, 0x214, %o0 =============================================================================== 0200cb20 <_POSIX_Threads_Sporadic_budget_callout>: ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 200cb20: c4 02 21 5c ld [ %o0 + 0x15c ], %g2 200cb24: c6 00 a0 8c ld [ %g2 + 0x8c ], %g3 200cb28: 05 00 80 73 sethi %hi(0x201cc00), %g2 200cb2c: d2 08 a0 2c ldub [ %g2 + 0x2c ], %o1 ! 201cc2c */ #if 0 printk( "callout %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 200cb30: c4 02 20 1c ld [ %o0 + 0x1c ], %g2 200cb34: 92 22 40 03 sub %o1, %g3, %o1 /* * This will prevent the thread from consuming its entire "budget" * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ 200cb38: 86 10 3f ff mov -1, %g3 new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority); the_thread->real_priority = new_priority; 200cb3c: d2 22 20 18 st %o1, [ %o0 + 0x18 ] */ #if 0 printk( "callout %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 200cb40: 80 a0 a0 00 cmp %g2, 0 200cb44: 12 80 00 06 bne 200cb5c <_POSIX_Threads_Sporadic_budget_callout+0x3c><== NEVER TAKEN 200cb48: c6 22 20 78 st %g3, [ %o0 + 0x78 ] /* * Make sure we are actually lowering it. If they have lowered it * to logically lower than sched_ss_low_priority, then we do not want to * change it. */ if ( the_thread->current_priority < new_priority ) { 200cb4c: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 200cb50: 80 a0 40 09 cmp %g1, %o1 200cb54: 0a 80 00 04 bcs 200cb64 <_POSIX_Threads_Sporadic_budget_callout+0x44><== ALWAYS TAKEN 200cb58: 94 10 20 01 mov 1, %o2 200cb5c: 81 c3 e0 08 retl <== NOT EXECUTED 200cb60: 01 00 00 00 nop <== NOT EXECUTED _Thread_Change_priority( the_thread, new_priority, true ); 200cb64: 82 13 c0 00 mov %o7, %g1 200cb68: 7f ff f0 8b call 2008d94 <_Thread_Change_priority> 200cb6c: 9e 10 40 00 mov %g1, %o7 =============================================================================== 0200ef50 <_POSIX_Threads_cancel_run>: #include void _POSIX_Threads_cancel_run( Thread_Control *the_thread ) { 200ef50: 9d e3 bf a0 save %sp, -96, %sp POSIX_Cancel_Handler_control *handler; Chain_Control *handler_stack; POSIX_API_Control *thread_support; ISR_Level level; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 200ef54: f8 06 21 5c ld [ %i0 + 0x15c ], %i4 handler_stack = &thread_support->Cancellation_Handlers; thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; 200ef58: 84 10 20 01 mov 1, %g2 while ( !_Chain_Is_empty( handler_stack ) ) { 200ef5c: c2 07 20 e4 ld [ %i4 + 0xe4 ], %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 200ef60: b6 07 20 e8 add %i4, 0xe8, %i3 200ef64: 80 a0 40 1b cmp %g1, %i3 200ef68: 02 80 00 14 be 200efb8 <_POSIX_Threads_cancel_run+0x68> 200ef6c: c4 27 20 d8 st %g2, [ %i4 + 0xd8 ] _ISR_Disable( level ); 200ef70: 7f ff cc 86 call 2002188 200ef74: 01 00 00 00 nop handler = (POSIX_Cancel_Handler_control *) 200ef78: fa 07 20 ec ld [ %i4 + 0xec ], %i5 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 200ef7c: c4 07 40 00 ld [ %i5 ], %g2 previous = the_node->previous; 200ef80: c2 07 60 04 ld [ %i5 + 4 ], %g1 next->previous = previous; 200ef84: c2 20 a0 04 st %g1, [ %g2 + 4 ] previous->next = next; 200ef88: c4 20 40 00 st %g2, [ %g1 ] _Chain_Tail( handler_stack )->previous; _Chain_Extract_unprotected( &handler->Node ); _ISR_Enable( level ); 200ef8c: 7f ff cc 83 call 2002198 200ef90: 01 00 00 00 nop (*handler->routine)( handler->arg ); 200ef94: c2 07 60 08 ld [ %i5 + 8 ], %g1 200ef98: 9f c0 40 00 call %g1 200ef9c: d0 07 60 0c ld [ %i5 + 0xc ], %o0 _Workspace_Free( handler ); 200efa0: 7f ff ed 8c call 200a5d0 <_Workspace_Free> 200efa4: 90 10 00 1d mov %i5, %o0 handler_stack = &thread_support->Cancellation_Handlers; thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; while ( !_Chain_Is_empty( handler_stack ) ) { 200efa8: c2 07 20 e4 ld [ %i4 + 0xe4 ], %g1 200efac: 80 a0 40 1b cmp %g1, %i3 200efb0: 12 bf ff f0 bne 200ef70 <_POSIX_Threads_cancel_run+0x20> <== NEVER TAKEN 200efb4: 01 00 00 00 nop 200efb8: 81 c7 e0 08 ret 200efbc: 81 e8 00 00 restore =============================================================================== 0200665c <_POSIX_Timer_TSR>: * This is the operation that is run when a timer expires */ void _POSIX_Timer_TSR( Objects_Id timer __attribute__((unused)), void *data) { 200665c: 9d e3 bf a0 save %sp, -96, %sp bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 2006660: c4 06 60 68 ld [ %i1 + 0x68 ], %g2 /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 2006664: c2 06 60 54 ld [ %i1 + 0x54 ], %g1 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 2006668: 84 00 a0 01 inc %g2 /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 200666c: 80 a0 60 00 cmp %g1, 0 2006670: 12 80 00 0e bne 20066a8 <_POSIX_Timer_TSR+0x4c> 2006674: c4 26 60 68 st %g2, [ %i1 + 0x68 ] 2006678: c2 06 60 58 ld [ %i1 + 0x58 ], %g1 200667c: 80 a0 60 00 cmp %g1, 0 2006680: 32 80 00 0b bne,a 20066ac <_POSIX_Timer_TSR+0x50> <== ALWAYS TAKEN 2006684: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 2006688: 82 10 20 04 mov 4, %g1 <== NOT EXECUTED 200668c: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] <== NOT EXECUTED /* * The sending of the signal to the process running the handling function * specified for that signal is simulated */ if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) { 2006690: d0 06 60 38 ld [ %i1 + 0x38 ], %o0 2006694: 40 00 1a 27 call 200cf30 2006698: d2 06 60 44 ld [ %i1 + 0x44 ], %o1 } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 200669c: c0 26 60 68 clr [ %i1 + 0x68 ] 20066a0: 81 c7 e0 08 ret 20066a4: 81 e8 00 00 restore ptimer->overrun = ptimer->overrun + 1; /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 20066a8: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 20066ac: d4 06 60 08 ld [ %i1 + 8 ], %o2 20066b0: 90 06 60 10 add %i1, 0x10, %o0 20066b4: 98 10 00 19 mov %i1, %o4 20066b8: 17 00 80 19 sethi %hi(0x2006400), %o3 20066bc: 40 00 1b 44 call 200d3cc <_POSIX_Timer_Insert_helper> 20066c0: 96 12 e2 5c or %o3, 0x25c, %o3 ! 200665c <_POSIX_Timer_TSR> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 20066c4: 80 8a 20 ff btst 0xff, %o0 20066c8: 02 bf ff f6 be 20066a0 <_POSIX_Timer_TSR+0x44> <== NEVER TAKEN 20066cc: 01 00 00 00 nop return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); 20066d0: 40 00 05 de call 2007e48 <_TOD_Get> 20066d4: 90 06 60 6c add %i1, 0x6c, %o0 /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 20066d8: 82 10 20 03 mov 3, %g1 20066dc: 10 bf ff ed b 2006690 <_POSIX_Timer_TSR+0x34> 20066e0: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] =============================================================================== 0200f078 <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 200f078: 9d e3 bf 68 save %sp, -152, %sp siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 200f07c: 98 10 20 01 mov 1, %o4 200f080: 90 10 00 18 mov %i0, %o0 200f084: 92 10 00 19 mov %i1, %o1 200f088: 94 07 bf f4 add %fp, -12, %o2 200f08c: 40 00 00 2e call 200f144 <_POSIX_signals_Clear_signals> 200f090: 96 10 00 1a mov %i2, %o3 200f094: 80 8a 20 ff btst 0xff, %o0 200f098: 02 80 00 23 be 200f124 <_POSIX_signals_Check_signal+0xac> 200f09c: 82 10 20 00 clr %g1 #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 200f0a0: 85 2e 60 02 sll %i1, 2, %g2 200f0a4: 37 00 80 77 sethi %hi(0x201dc00), %i3 200f0a8: b9 2e 60 04 sll %i1, 4, %i4 200f0ac: b6 16 e2 e0 or %i3, 0x2e0, %i3 200f0b0: b8 27 00 02 sub %i4, %g2, %i4 200f0b4: 84 06 c0 1c add %i3, %i4, %g2 200f0b8: fa 00 a0 08 ld [ %g2 + 8 ], %i5 200f0bc: 80 a7 60 01 cmp %i5, 1 200f0c0: 02 80 00 19 be 200f124 <_POSIX_signals_Check_signal+0xac> <== NEVER TAKEN 200f0c4: 21 00 80 77 sethi %hi(0x201dc00), %l0 return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 200f0c8: f4 06 20 d0 ld [ %i0 + 0xd0 ], %i2 api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 200f0cc: c2 00 a0 04 ld [ %g2 + 4 ], %g1 /* * We have to save the blocking information of the current wait queue * because the signal handler may subsequently go on and put the thread * on a wait queue, for its own purposes. */ memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait, 200f0d0: a0 14 22 88 or %l0, 0x288, %l0 200f0d4: d2 04 20 0c ld [ %l0 + 0xc ], %o1 /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 200f0d8: 82 10 40 1a or %g1, %i2, %g1 /* * We have to save the blocking information of the current wait queue * because the signal handler may subsequently go on and put the thread * on a wait queue, for its own purposes. */ memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait, 200f0dc: 90 07 bf cc add %fp, -52, %o0 /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 200f0e0: c2 26 20 d0 st %g1, [ %i0 + 0xd0 ] /* * We have to save the blocking information of the current wait queue * because the signal handler may subsequently go on and put the thread * on a wait queue, for its own purposes. */ memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait, 200f0e4: 92 02 60 20 add %o1, 0x20, %o1 200f0e8: 40 00 04 66 call 2010280 200f0ec: 94 10 20 28 mov 0x28, %o2 sizeof( Thread_Wait_information )); /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 200f0f0: c2 06 c0 1c ld [ %i3 + %i4 ], %g1 200f0f4: 80 a0 60 02 cmp %g1, 2 200f0f8: 02 80 00 0e be 200f130 <_POSIX_signals_Check_signal+0xb8> 200f0fc: 90 10 00 19 mov %i1, %o0 &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 200f100: 9f c7 40 00 call %i5 200f104: 01 00 00 00 nop } /* * Restore the blocking information */ memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information, 200f108: d0 04 20 0c ld [ %l0 + 0xc ], %o0 200f10c: 92 07 bf cc add %fp, -52, %o1 200f110: 90 02 20 20 add %o0, 0x20, %o0 200f114: 40 00 04 5b call 2010280 200f118: 94 10 20 28 mov 0x28, %o2 /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; 200f11c: 82 10 20 01 mov 1, %g1 sizeof( Thread_Wait_information )); /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 200f120: f4 26 20 d0 st %i2, [ %i0 + 0xd0 ] return true; } 200f124: b0 08 60 01 and %g1, 1, %i0 200f128: 81 c7 e0 08 ret 200f12c: 81 e8 00 00 restore /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 200f130: 92 07 bf f4 add %fp, -12, %o1 200f134: 9f c7 40 00 call %i5 200f138: 94 10 20 00 clr %o2 signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 200f13c: 10 bf ff f4 b 200f10c <_POSIX_signals_Check_signal+0x94> 200f140: d0 04 20 0c ld [ %l0 + 0xc ], %o0 =============================================================================== 0200f880 <_POSIX_signals_Clear_process_signals>: */ void _POSIX_signals_Clear_process_signals( int signo ) { 200f880: 9d e3 bf a0 save %sp, -96, %sp clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 200f884: 7f ff ca 41 call 2002188 200f888: 01 00 00 00 nop if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 200f88c: 85 2e 20 04 sll %i0, 4, %g2 200f890: 83 2e 20 02 sll %i0, 2, %g1 200f894: 82 20 80 01 sub %g2, %g1, %g1 200f898: 05 00 80 77 sethi %hi(0x201dc00), %g2 200f89c: 84 10 a2 e0 or %g2, 0x2e0, %g2 ! 201dee0 <_POSIX_signals_Vectors> 200f8a0: c4 00 80 01 ld [ %g2 + %g1 ], %g2 200f8a4: 80 a0 a0 02 cmp %g2, 2 200f8a8: 02 80 00 0b be 200f8d4 <_POSIX_signals_Clear_process_signals+0x54> 200f8ac: 05 00 80 78 sethi %hi(0x201e000), %g2 if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 200f8b0: 03 00 80 78 sethi %hi(0x201e000), %g1 200f8b4: c4 00 60 d4 ld [ %g1 + 0xd4 ], %g2 ! 201e0d4 <_POSIX_signals_Pending> 200f8b8: 86 10 20 01 mov 1, %g3 200f8bc: b0 06 3f ff add %i0, -1, %i0 200f8c0: b1 28 c0 18 sll %g3, %i0, %i0 200f8c4: b0 28 80 18 andn %g2, %i0, %i0 200f8c8: f0 20 60 d4 st %i0, [ %g1 + 0xd4 ] } _ISR_Enable( level ); 200f8cc: 7f ff ca 33 call 2002198 200f8d0: 91 e8 00 08 restore %g0, %o0, %o0 ISR_Level level; _ISR_Disable( level ); if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 200f8d4: 84 10 a0 d8 or %g2, 0xd8, %g2 200f8d8: c6 00 40 02 ld [ %g1 + %g2 ], %g3 200f8dc: 82 00 40 02 add %g1, %g2, %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 200f8e0: 82 00 60 04 add %g1, 4, %g1 200f8e4: 80 a0 c0 01 cmp %g3, %g1 200f8e8: 02 bf ff f3 be 200f8b4 <_POSIX_signals_Clear_process_signals+0x34><== ALWAYS TAKEN 200f8ec: 03 00 80 78 sethi %hi(0x201e000), %g1 clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; } _ISR_Enable( level ); 200f8f0: 7f ff ca 2a call 2002198 <== NOT EXECUTED 200f8f4: 91 e8 00 08 restore %g0, %o0, %o0 <== NOT EXECUTED =============================================================================== 020070c4 <_POSIX_signals_Get_lowest>: sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 20070c4: 82 10 20 1b mov 0x1b, %g1 20070c8: 86 10 20 01 mov 1, %g3 #include #include #include #include int _POSIX_signals_Get_lowest( 20070cc: 84 00 7f ff add %g1, -1, %g2 20070d0: 85 28 c0 02 sll %g3, %g2, %g2 ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 20070d4: 80 88 80 08 btst %g2, %o0 20070d8: 12 80 00 11 bne 200711c <_POSIX_signals_Get_lowest+0x58> <== NEVER TAKEN 20070dc: 01 00 00 00 nop sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 20070e0: 82 00 60 01 inc %g1 20070e4: 80 a0 60 20 cmp %g1, 0x20 20070e8: 12 bf ff fa bne 20070d0 <_POSIX_signals_Get_lowest+0xc> 20070ec: 84 00 7f ff add %g1, -1, %g2 20070f0: 82 10 20 01 mov 1, %g1 20070f4: 10 80 00 05 b 2007108 <_POSIX_signals_Get_lowest+0x44> 20070f8: 86 10 20 01 mov 1, %g3 */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 20070fc: 80 a0 60 1b cmp %g1, 0x1b 2007100: 02 80 00 07 be 200711c <_POSIX_signals_Get_lowest+0x58> <== NEVER TAKEN 2007104: 01 00 00 00 nop #include #include #include #include int _POSIX_signals_Get_lowest( 2007108: 84 00 7f ff add %g1, -1, %g2 200710c: 85 28 c0 02 sll %g3, %g2, %g2 #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 2007110: 80 88 80 08 btst %g2, %o0 2007114: 22 bf ff fa be,a 20070fc <_POSIX_signals_Get_lowest+0x38> 2007118: 82 00 60 01 inc %g1 * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } 200711c: 81 c3 e0 08 retl 2007120: 90 10 00 01 mov %g1, %o0 =============================================================================== 0200c658 <_POSIX_signals_Post_switch_extension>: */ void _POSIX_signals_Post_switch_extension( Thread_Control *the_thread ) { 200c658: 9d e3 bf a0 save %sp, -96, %sp POSIX_API_Control *api; int signo; ISR_Level level; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 200c65c: f8 06 21 5c ld [ %i0 + 0x15c ], %i4 /* * api may be NULL in case of a thread close in progress */ if ( !api ) 200c660: 80 a7 20 00 cmp %i4, 0 200c664: 02 80 00 34 be 200c734 <_POSIX_signals_Post_switch_extension+0xdc> 200c668: 01 00 00 00 nop * * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); 200c66c: 7f ff d6 c7 call 2002188 200c670: 37 00 80 78 sethi %hi(0x201e000), %i3 200c674: b0 10 00 08 mov %o0, %i0 200c678: b6 16 e0 d4 or %i3, 0xd4, %i3 if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 200c67c: c6 06 c0 00 ld [ %i3 ], %g3 200c680: c2 07 20 d4 ld [ %i4 + 0xd4 ], %g1 * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & 200c684: c4 07 20 d0 ld [ %i4 + 0xd0 ], %g2 (api->signals_pending | _POSIX_signals_Pending)) ) { 200c688: 82 10 c0 01 or %g3, %g1, %g1 * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & 200c68c: 80 a8 40 02 andncc %g1, %g2, %g0 200c690: 02 80 00 27 be 200c72c <_POSIX_signals_Post_switch_extension+0xd4> 200c694: 01 00 00 00 nop (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); break; } _ISR_Enable( level ); 200c698: 7f ff d6 c0 call 2002198 200c69c: ba 10 20 1b mov 0x1b, %i5 ! 1b for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 200c6a0: 92 10 00 1d mov %i5, %o1 200c6a4: 94 10 20 00 clr %o2 200c6a8: 40 00 0a 74 call 200f078 <_POSIX_signals_Check_signal> 200c6ac: 90 10 00 1c mov %i4, %o0 _POSIX_signals_Check_signal( api, signo, true ); 200c6b0: 92 10 00 1d mov %i5, %o1 200c6b4: 90 10 00 1c mov %i4, %o0 200c6b8: 40 00 0a 70 call 200f078 <_POSIX_signals_Check_signal> 200c6bc: 94 10 20 01 mov 1, %o2 _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 200c6c0: ba 07 60 01 inc %i5 200c6c4: 80 a7 60 20 cmp %i5, 0x20 200c6c8: 12 bf ff f7 bne 200c6a4 <_POSIX_signals_Post_switch_extension+0x4c> 200c6cc: 92 10 00 1d mov %i5, %o1 200c6d0: ba 10 20 01 mov 1, %i5 _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 200c6d4: 92 10 00 1d mov %i5, %o1 200c6d8: 94 10 20 00 clr %o2 200c6dc: 40 00 0a 67 call 200f078 <_POSIX_signals_Check_signal> 200c6e0: 90 10 00 1c mov %i4, %o0 _POSIX_signals_Check_signal( api, signo, true ); 200c6e4: 92 10 00 1d mov %i5, %o1 200c6e8: 90 10 00 1c mov %i4, %o0 200c6ec: 40 00 0a 63 call 200f078 <_POSIX_signals_Check_signal> 200c6f0: 94 10 20 01 mov 1, %o2 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 200c6f4: ba 07 60 01 inc %i5 200c6f8: 80 a7 60 1b cmp %i5, 0x1b 200c6fc: 12 bf ff f7 bne 200c6d8 <_POSIX_signals_Post_switch_extension+0x80> 200c700: 92 10 00 1d mov %i5, %o1 * * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); 200c704: 7f ff d6 a1 call 2002188 200c708: 01 00 00 00 nop 200c70c: b0 10 00 08 mov %o0, %i0 if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 200c710: c6 06 c0 00 ld [ %i3 ], %g3 200c714: c2 07 20 d4 ld [ %i4 + 0xd4 ], %g1 * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & 200c718: c4 07 20 d0 ld [ %i4 + 0xd0 ], %g2 (api->signals_pending | _POSIX_signals_Pending)) ) { 200c71c: 82 10 c0 01 or %g3, %g1, %g1 * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & 200c720: 80 a8 40 02 andncc %g1, %g2, %g0 200c724: 12 bf ff dd bne 200c698 <_POSIX_signals_Post_switch_extension+0x40><== NEVER TAKEN 200c728: 01 00 00 00 nop (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); 200c72c: 7f ff d6 9b call 2002198 200c730: 81 e8 00 00 restore 200c734: 81 c7 e0 08 ret 200c738: 81 e8 00 00 restore =============================================================================== 0201a70c <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 201a70c: 9d e3 bf a0 save %sp, -96, %sp /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 201a710: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 201a714: 05 04 00 20 sethi %hi(0x10008000), %g2 201a718: 86 10 20 01 mov 1, %g3 201a71c: ba 06 7f ff add %i1, -1, %i5 201a720: 88 08 40 02 and %g1, %g2, %g4 { POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 201a724: da 06 21 5c ld [ %i0 + 0x15c ], %o5 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 201a728: 80 a1 00 02 cmp %g4, %g2 201a72c: 02 80 00 1c be 201a79c <_POSIX_signals_Unblock_thread+0x90> 201a730: 9f 28 c0 1d sll %g3, %i5, %o7 } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 201a734: c4 03 60 d0 ld [ %o5 + 0xd0 ], %g2 201a738: 80 ab c0 02 andncc %o7, %g2, %g0 201a73c: 02 80 00 15 be 201a790 <_POSIX_signals_Unblock_thread+0x84> 201a740: ba 10 20 00 clr %i5 201a744: 05 04 00 00 sethi %hi(0x10000000), %g2 * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) { 201a748: 80 88 40 02 btst %g1, %g2 201a74c: 02 80 00 29 be 201a7f0 <_POSIX_signals_Unblock_thread+0xe4> 201a750: 80 a0 60 00 cmp %g1, 0 the_thread->Wait.return_code = EINTR; 201a754: 84 10 20 04 mov 4, %g2 201a758: c4 26 20 34 st %g2, [ %i0 + 0x34 ] */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 201a75c: 05 00 00 ef sethi %hi(0x3bc00), %g2 201a760: 84 10 a2 e0 or %g2, 0x2e0, %g2 ! 3bee0 /* * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) 201a764: 80 88 40 02 btst %g1, %g2 201a768: 12 80 00 36 bne 201a840 <_POSIX_signals_Unblock_thread+0x134> 201a76c: 80 88 60 08 btst 8, %g1 _Thread_queue_Extract_with_proxy( the_thread ); else if ( _States_Is_delaying(the_thread->current_state) ) { 201a770: 22 80 00 09 be,a 201a794 <_POSIX_signals_Unblock_thread+0x88><== NEVER TAKEN 201a774: b0 0f 60 01 and %i5, 1, %i0 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 201a778: 7f ff bf 12 call 200a3c0 <_Watchdog_Remove> 201a77c: 90 06 20 48 add %i0, 0x48, %o0 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 201a780: 13 04 00 ff sethi %hi(0x1003fc00), %o1 201a784: 90 10 00 18 mov %i0, %o0 201a788: 7f ff b9 ce call 2008ec0 <_Thread_Clear_state> 201a78c: 92 12 63 f8 or %o1, 0x3f8, %o1 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; } 201a790: b0 0f 60 01 and %i5, 1, %i0 201a794: 81 c7 e0 08 ret 201a798: 81 e8 00 00 restore * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 201a79c: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 201a7a0: 80 8b c0 01 btst %o7, %g1 201a7a4: 22 80 00 21 be,a 201a828 <_POSIX_signals_Unblock_thread+0x11c> 201a7a8: c2 03 60 d0 ld [ %o5 + 0xd0 ], %g1 the_thread->Wait.return_code = EINTR; 201a7ac: 82 10 20 04 mov 4, %g1 201a7b0: c2 26 20 34 st %g1, [ %i0 + 0x34 ] the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 201a7b4: 80 a6 a0 00 cmp %i2, 0 201a7b8: 02 80 00 27 be 201a854 <_POSIX_signals_Unblock_thread+0x148> 201a7bc: c2 06 20 28 ld [ %i0 + 0x28 ], %g1 the_info->si_signo = signo; the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; } else { *the_info = *info; 201a7c0: c4 06 80 00 ld [ %i2 ], %g2 201a7c4: c4 20 40 00 st %g2, [ %g1 ] 201a7c8: c4 06 a0 04 ld [ %i2 + 4 ], %g2 201a7cc: c4 20 60 04 st %g2, [ %g1 + 4 ] 201a7d0: c4 06 a0 08 ld [ %i2 + 8 ], %g2 201a7d4: c4 20 60 08 st %g2, [ %g1 + 8 ] } _Thread_queue_Extract_with_proxy( the_thread ); 201a7d8: 90 10 00 18 mov %i0, %o0 201a7dc: 7f ff bc 9f call 2009a58 <_Thread_queue_Extract_with_proxy> 201a7e0: ba 10 20 01 mov 1, %i5 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; } 201a7e4: b0 0f 60 01 and %i5, 1, %i0 201a7e8: 81 c7 e0 08 ret 201a7ec: 81 e8 00 00 restore else if ( _States_Is_delaying(the_thread->current_state) ) { (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 201a7f0: 12 bf ff e8 bne 201a790 <_POSIX_signals_Unblock_thread+0x84><== NEVER TAKEN 201a7f4: 03 00 80 77 sethi %hi(0x201dc00), %g1 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 201a7f8: 82 10 62 88 or %g1, 0x288, %g1 ! 201de88 <_Per_CPU_Information> 201a7fc: c4 00 60 08 ld [ %g1 + 8 ], %g2 201a800: 80 a0 a0 00 cmp %g2, 0 201a804: 22 bf ff e4 be,a 201a794 <_POSIX_signals_Unblock_thread+0x88> 201a808: b0 0f 60 01 and %i5, 1, %i0 201a80c: c4 00 60 0c ld [ %g1 + 0xc ], %g2 201a810: 80 a6 00 02 cmp %i0, %g2 201a814: 22 bf ff df be,a 201a790 <_POSIX_signals_Unblock_thread+0x84><== ALWAYS TAKEN 201a818: c6 28 60 18 stb %g3, [ %g1 + 0x18 ] 201a81c: b0 0f 60 01 and %i5, 1, %i0 <== NOT EXECUTED 201a820: 81 c7 e0 08 ret <== NOT EXECUTED 201a824: 81 e8 00 00 restore <== NOT EXECUTED * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 201a828: 80 ab c0 01 andncc %o7, %g1, %g0 201a82c: 12 bf ff e0 bne 201a7ac <_POSIX_signals_Unblock_thread+0xa0> 201a830: ba 10 20 00 clr %i5 201a834: b0 0f 60 01 and %i5, 1, %i0 201a838: 81 c7 e0 08 ret 201a83c: 81 e8 00 00 restore /* * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) _Thread_queue_Extract_with_proxy( the_thread ); 201a840: 7f ff bc 86 call 2009a58 <_Thread_queue_Extract_with_proxy> 201a844: 90 10 00 18 mov %i0, %o0 201a848: b0 0f 60 01 and %i5, 1, %i0 201a84c: 81 c7 e0 08 ret 201a850: 81 e8 00 00 restore the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; the_info->si_code = SI_USER; 201a854: 84 10 20 01 mov 1, %g2 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; 201a858: f2 20 40 00 st %i1, [ %g1 ] the_info->si_code = SI_USER; 201a85c: c4 20 60 04 st %g2, [ %g1 + 4 ] the_info->si_value.sival_int = 0; 201a860: 10 bf ff de b 201a7d8 <_POSIX_signals_Unblock_thread+0xcc> 201a864: c0 20 60 08 clr [ %g1 + 8 ] =============================================================================== 02008e54 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 2008e54: 9d e3 bf a0 save %sp, -96, %sp RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if(!the_node) return; 2008e58: 80 a6 60 00 cmp %i1, 0 2008e5c: 02 80 00 4c be 2008f8c <_RBTree_Extract_unprotected+0x138> 2008e60: 01 00 00 00 nop /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 2008e64: c2 06 20 08 ld [ %i0 + 8 ], %g1 2008e68: 80 a0 40 19 cmp %g1, %i1 2008e6c: 02 80 00 61 be 2008ff0 <_RBTree_Extract_unprotected+0x19c> 2008e70: c2 06 60 08 ld [ %i1 + 8 ], %g1 the_rbtree->first[RBT_LEFT])) the_rbtree->first[RBT_LEFT] = NULL; } } /* check if max needs to be updated: note, min can equal max (1 element) */ if (the_node == the_rbtree->first[RBT_RIGHT]) { 2008e74: c4 06 20 0c ld [ %i0 + 0xc ], %g2 2008e78: 80 a0 80 19 cmp %g2, %i1 2008e7c: 02 80 00 51 be 2008fc0 <_RBTree_Extract_unprotected+0x16c> 2008e80: f8 06 60 04 ld [ %i1 + 4 ], %i4 * either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT], * and replace the_node with the target node. This maintains the binary * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { 2008e84: ba 97 20 00 orcc %i4, 0, %i5 2008e88: 22 80 00 54 be,a 2008fd8 <_RBTree_Extract_unprotected+0x184><== ALWAYS TAKEN 2008e8c: b8 90 60 00 orcc %g1, 0, %i4 2008e90: 80 a0 60 00 cmp %g1, 0 2008e94: 32 80 00 05 bne,a 2008ea8 <_RBTree_Extract_unprotected+0x54><== NEVER TAKEN 2008e98: c2 07 60 08 ld [ %i5 + 8 ], %g1 <== NOT EXECUTED * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { leaf->parent = the_node->parent; 2008e9c: 10 80 00 3e b 2008f94 <_RBTree_Extract_unprotected+0x140> 2008ea0: c2 06 40 00 ld [ %i1 ], %g1 * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; 2008ea4: c2 07 60 08 ld [ %i5 + 8 ], %g1 <== NOT EXECUTED 2008ea8: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 2008eac: 32 bf ff fe bne,a 2008ea4 <_RBTree_Extract_unprotected+0x50><== NOT EXECUTED 2008eb0: ba 10 00 01 mov %g1, %i5 <== NOT EXECUTED * target's position (target is the right child of target->parent) * when target vacates it. if there is no child, then target->parent * should become NULL. This may cause the coloring to be violated. * For now we store the color of the node being deleted in victim_color. */ leaf = target->child[RBT_LEFT]; 2008eb4: f8 07 60 04 ld [ %i5 + 4 ], %i4 <== NOT EXECUTED if(leaf) { 2008eb8: 80 a7 20 00 cmp %i4, 0 <== NOT EXECUTED 2008ebc: 02 80 00 52 be 2009004 <_RBTree_Extract_unprotected+0x1b0><== NOT EXECUTED 2008ec0: 01 00 00 00 nop <== NOT EXECUTED leaf->parent = target->parent; 2008ec4: c2 07 40 00 ld [ %i5 ], %g1 <== NOT EXECUTED 2008ec8: c2 27 00 00 st %g1, [ %i4 ] <== NOT EXECUTED } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; dir = target != target->parent->child[0]; 2008ecc: c4 07 40 00 ld [ %i5 ], %g2 <== NOT EXECUTED target->parent->child[dir] = leaf; /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 2008ed0: c2 06 40 00 ld [ %i1 ], %g1 <== NOT EXECUTED } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; dir = target != target->parent->child[0]; 2008ed4: c8 00 a0 04 ld [ %g2 + 4 ], %g4 <== NOT EXECUTED * replaced the_node, and target's child has moved up the tree if needed. * the_node is no longer part of the tree, although it has valid pointers * still. */ target->parent = the_node->parent; target->color = the_node->color; 2008ed8: c6 06 60 10 ld [ %i1 + 0x10 ], %g3 <== NOT EXECUTED } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; dir = target != target->parent->child[0]; 2008edc: 88 19 00 1d xor %g4, %i5, %g4 <== NOT EXECUTED 2008ee0: 80 a0 00 04 cmp %g0, %g4 <== NOT EXECUTED 2008ee4: 88 40 20 00 addx %g0, 0, %g4 <== NOT EXECUTED target->parent->child[dir] = leaf; 2008ee8: 89 29 20 02 sll %g4, 2, %g4 <== NOT EXECUTED 2008eec: 84 00 80 04 add %g2, %g4, %g2 <== NOT EXECUTED 2008ef0: f8 20 a0 04 st %i4, [ %g2 + 4 ] <== NOT EXECUTED /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 2008ef4: c8 00 60 04 ld [ %g1 + 4 ], %g4 <== NOT EXECUTED leaf->parent = target->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; 2008ef8: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 <== NOT EXECUTED dir = target != target->parent->child[0]; target->parent->child[dir] = leaf; /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 2008efc: 88 19 00 19 xor %g4, %i1, %g4 <== NOT EXECUTED 2008f00: 80 a0 00 04 cmp %g0, %g4 <== NOT EXECUTED 2008f04: 88 40 20 00 addx %g0, 0, %g4 <== NOT EXECUTED the_node->parent->child[dir] = target; 2008f08: 89 29 20 02 sll %g4, 2, %g4 <== NOT EXECUTED 2008f0c: 82 00 40 04 add %g1, %g4, %g1 <== NOT EXECUTED 2008f10: fa 20 60 04 st %i5, [ %g1 + 4 ] <== NOT EXECUTED /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; 2008f14: c2 06 60 08 ld [ %i1 + 8 ], %g1 <== NOT EXECUTED * replaced the_node, and target's child has moved up the tree if needed. * the_node is no longer part of the tree, although it has valid pointers * still. */ target->parent = the_node->parent; target->color = the_node->color; 2008f18: c6 27 60 10 st %g3, [ %i5 + 0x10 ] <== NOT EXECUTED /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; the_node->parent->child[dir] = target; /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; 2008f1c: c2 27 60 08 st %g1, [ %i5 + 8 ] <== NOT EXECUTED the_node->child[RBT_RIGHT]->parent = target; target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 2008f20: c2 06 60 04 ld [ %i1 + 4 ], %g1 <== NOT EXECUTED dir = the_node != the_node->parent->child[0]; the_node->parent->child[dir] = target; /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; the_node->child[RBT_RIGHT]->parent = target; 2008f24: c6 06 60 08 ld [ %i1 + 8 ], %g3 <== NOT EXECUTED target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 2008f28: c2 27 60 04 st %g1, [ %i5 + 4 ] <== NOT EXECUTED the_node->child[RBT_LEFT]->parent = target; 2008f2c: c2 06 60 04 ld [ %i1 + 4 ], %g1 <== NOT EXECUTED dir = the_node != the_node->parent->child[0]; the_node->parent->child[dir] = target; /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; the_node->child[RBT_RIGHT]->parent = target; 2008f30: fa 20 c0 00 st %i5, [ %g3 ] <== NOT EXECUTED target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; the_node->child[RBT_LEFT]->parent = target; 2008f34: fa 20 40 00 st %i5, [ %g1 ] <== NOT EXECUTED /* finally, update the parent node and recolor. target has completely * replaced the_node, and target's child has moved up the tree if needed. * the_node is no longer part of the tree, although it has valid pointers * still. */ target->parent = the_node->parent; 2008f38: c2 06 40 00 ld [ %i1 ], %g1 <== NOT EXECUTED 2008f3c: c2 27 40 00 st %g1, [ %i5 ] <== NOT EXECUTED * 1. Deleted a red node, its child must be black. Nothing must be done. * 2. Deleted a black node and the child is red. Paint child black. * 3. Deleted a black node and its child is black. This requires some * care and rotations. */ if (victim_color == RBT_BLACK) { /* eliminate case 1 */ 2008f40: 80 a0 a0 00 cmp %g2, 0 2008f44: 32 80 00 0c bne,a 2008f74 <_RBTree_Extract_unprotected+0x120> 2008f48: c2 06 20 04 ld [ %i0 + 4 ], %g1 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 2008f4c: 80 a7 20 00 cmp %i4, 0 2008f50: 22 80 00 09 be,a 2008f74 <_RBTree_Extract_unprotected+0x120> 2008f54: c2 06 20 04 ld [ %i0 + 4 ], %g1 2008f58: c2 07 20 10 ld [ %i4 + 0x10 ], %g1 2008f5c: 80 a0 60 01 cmp %g1, 1 2008f60: 22 80 00 04 be,a 2008f70 <_RBTree_Extract_unprotected+0x11c><== ALWAYS TAKEN 2008f64: c0 27 20 10 clr [ %i4 + 0x10 ] if (_RBTree_Is_red(leaf)) leaf->color = RBT_BLACK; /* case 2 */ else if(leaf) _RBTree_Extract_validate_unprotected(leaf); /* case 3 */ 2008f68: 7f ff fe e8 call 2008b08 <_RBTree_Extract_validate_unprotected><== NOT EXECUTED 2008f6c: 90 10 00 1c mov %i4, %o0 <== NOT EXECUTED /* Wipe the_node */ _RBTree_Set_off_rbtree(the_node); /* set root to black, if it exists */ if (the_rbtree->root) the_rbtree->root->color = RBT_BLACK; 2008f70: c2 06 20 04 ld [ %i0 + 4 ], %g1 */ RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree( RBTree_Node *node ) { node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL; 2008f74: c0 26 60 08 clr [ %i1 + 8 ] 2008f78: c0 26 60 04 clr [ %i1 + 4 ] 2008f7c: 80 a0 60 00 cmp %g1, 0 2008f80: 02 80 00 03 be 2008f8c <_RBTree_Extract_unprotected+0x138> 2008f84: c0 26 40 00 clr [ %i1 ] 2008f88: c0 20 60 10 clr [ %g1 + 0x10 ] 2008f8c: 81 c7 e0 08 ret 2008f90: 81 e8 00 00 restore * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { leaf->parent = the_node->parent; 2008f94: c2 27 00 00 st %g1, [ %i4 ] _RBTree_Extract_validate_unprotected(the_node); } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 2008f98: c2 06 40 00 ld [ %i1 ], %g1 leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); } victim_color = the_node->color; 2008f9c: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 2008fa0: c6 00 60 04 ld [ %g1 + 4 ], %g3 2008fa4: 86 18 c0 19 xor %g3, %i1, %g3 2008fa8: 80 a0 00 03 cmp %g0, %g3 2008fac: 86 40 20 00 addx %g0, 0, %g3 the_node->parent->child[dir] = leaf; 2008fb0: 87 28 e0 02 sll %g3, 2, %g3 2008fb4: 82 00 40 03 add %g1, %g3, %g1 2008fb8: 10 bf ff e2 b 2008f40 <_RBTree_Extract_unprotected+0xec> 2008fbc: f8 20 60 04 st %i4, [ %g1 + 4 ] the_rbtree->first[RBT_LEFT] = NULL; } } /* check if max needs to be updated: note, min can equal max (1 element) */ if (the_node == the_rbtree->first[RBT_RIGHT]) { if (the_node->child[RBT_LEFT]) 2008fc0: 80 a7 20 00 cmp %i4, 0 2008fc4: 02 80 00 19 be 2009028 <_RBTree_Extract_unprotected+0x1d4> 2008fc8: ba 97 20 00 orcc %i4, 0, %i5 * either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT], * and replace the_node with the target node. This maintains the binary * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { 2008fcc: 12 bf ff b1 bne 2008e90 <_RBTree_Extract_unprotected+0x3c><== ALWAYS TAKEN 2008fd0: f8 26 20 0c st %i4, [ %i0 + 0xc ] * violated. We will fix it later. * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { 2008fd4: b8 90 60 00 orcc %g1, 0, %i4 <== NOT EXECUTED 2008fd8: 32 bf ff ef bne,a 2008f94 <_RBTree_Extract_unprotected+0x140> 2008fdc: c2 06 40 00 ld [ %i1 ], %g1 leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 2008fe0: 7f ff fe ca call 2008b08 <_RBTree_Extract_validate_unprotected> 2008fe4: 90 10 00 19 mov %i1, %o0 } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 2008fe8: 10 bf ff ed b 2008f9c <_RBTree_Extract_unprotected+0x148> 2008fec: c2 06 40 00 ld [ %i1 ], %g1 if(!the_node) return; /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { if (the_node->child[RBT_RIGHT]) 2008ff0: 80 a0 60 00 cmp %g1, 0 2008ff4: 22 80 00 08 be,a 2009014 <_RBTree_Extract_unprotected+0x1c0> 2008ff8: c4 06 40 00 ld [ %i1 ], %g2 the_rbtree->first[RBT_LEFT] = the_node->child[RBT_RIGHT]; 2008ffc: 10 bf ff 9e b 2008e74 <_RBTree_Extract_unprotected+0x20> 2009000: c2 26 20 08 st %g1, [ %i0 + 8 ] leaf = target->child[RBT_LEFT]; if(leaf) { leaf->parent = target->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 2009004: 7f ff fe c1 call 2008b08 <_RBTree_Extract_validate_unprotected><== NOT EXECUTED 2009008: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED } victim_color = target->color; dir = target != target->parent->child[0]; 200900c: 10 bf ff b1 b 2008ed0 <_RBTree_Extract_unprotected+0x7c> <== NOT EXECUTED 2009010: c4 07 40 00 ld [ %i5 ], %g2 <== NOT EXECUTED if (the_node == the_rbtree->first[RBT_LEFT]) { if (the_node->child[RBT_RIGHT]) the_rbtree->first[RBT_LEFT] = the_node->child[RBT_RIGHT]; else { the_rbtree->first[RBT_LEFT] = the_node->parent; if(_RBTree_Are_nodes_equal((RBTree_Node *)the_rbtree, 2009014: 80 a6 00 02 cmp %i0, %g2 2009018: 12 bf ff 97 bne 2008e74 <_RBTree_Extract_unprotected+0x20> 200901c: c4 26 20 08 st %g2, [ %i0 + 8 ] the_rbtree->first[RBT_LEFT])) the_rbtree->first[RBT_LEFT] = NULL; 2009020: 10 bf ff 95 b 2008e74 <_RBTree_Extract_unprotected+0x20> 2009024: c0 26 20 08 clr [ %i0 + 8 ] /* check if max needs to be updated: note, min can equal max (1 element) */ if (the_node == the_rbtree->first[RBT_RIGHT]) { if (the_node->child[RBT_LEFT]) the_rbtree->first[RBT_RIGHT] = the_node->child[RBT_LEFT]; else { the_rbtree->first[RBT_RIGHT] = the_node->parent; 2009028: c4 06 40 00 ld [ %i1 ], %g2 if(_RBTree_Are_nodes_equal((RBTree_Node *)the_rbtree, 200902c: 80 a6 00 02 cmp %i0, %g2 2009030: 12 bf ff 95 bne 2008e84 <_RBTree_Extract_unprotected+0x30> 2009034: c4 26 20 0c st %g2, [ %i0 + 0xc ] the_rbtree->first[RBT_RIGHT])) the_rbtree->first[RBT_RIGHT] = NULL; 2009038: 10 bf ff 93 b 2008e84 <_RBTree_Extract_unprotected+0x30> 200903c: c0 26 20 0c clr [ %i0 + 0xc ] =============================================================================== 02008b08 <_RBTree_Extract_validate_unprotected>: * of the extract operation. */ void _RBTree_Extract_validate_unprotected( RBTree_Node *the_node ) { 2008b08: 9d e3 bf a0 save %sp, -96, %sp RBTree_Node *parent, *sibling; RBTree_Direction dir; parent = the_node->parent; 2008b0c: c4 06 00 00 ld [ %i0 ], %g2 if(!parent->parent) return; 2008b10: c2 00 80 00 ld [ %g2 ], %g1 2008b14: 80 a0 60 00 cmp %g1, 0 2008b18: 02 80 00 cd be 2008e4c <_RBTree_Extract_validate_unprotected+0x344> 2008b1c: 01 00 00 00 nop { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) 2008b20: c2 00 a0 04 ld [ %g2 + 4 ], %g1 2008b24: 80 a6 00 01 cmp %i0, %g1 2008b28: 22 80 00 02 be,a 2008b30 <_RBTree_Extract_validate_unprotected+0x28> 2008b2c: c2 00 a0 08 ld [ %g2 + 8 ], %g1 /* sibling is black, see if both of its children are also black. */ if (sibling && !_RBTree_Is_red(sibling->child[RBT_RIGHT]) && !_RBTree_Is_red(sibling->child[RBT_LEFT])) { sibling->color = RBT_RED; 2008b30: 96 10 20 01 mov 1, %o3 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 2008b34: 80 a6 20 00 cmp %i0, 0 2008b38: 22 80 00 07 be,a 2008b54 <_RBTree_Extract_validate_unprotected+0x4c><== NEVER TAKEN 2008b3c: c6 00 80 00 ld [ %g2 ], %g3 <== NOT EXECUTED 2008b40: c6 06 20 10 ld [ %i0 + 0x10 ], %g3 2008b44: 80 a0 e0 01 cmp %g3, 1 2008b48: 22 80 00 5b be,a 2008cb4 <_RBTree_Extract_validate_unprotected+0x1ac> 2008b4c: c2 06 00 00 ld [ %i0 ], %g1 if(!parent->parent) return; sibling = _RBTree_Sibling(the_node); /* continue to correct tree as long as the_node is black and not the root */ while (!_RBTree_Is_red(the_node) && parent->parent) { 2008b50: c6 00 80 00 ld [ %g2 ], %g3 2008b54: 80 a0 e0 00 cmp %g3, 0 2008b58: 02 80 00 56 be 2008cb0 <_RBTree_Extract_validate_unprotected+0x1a8> 2008b5c: 80 a0 60 00 cmp %g1, 0 2008b60: 02 bf ff f6 be 2008b38 <_RBTree_Extract_validate_unprotected+0x30><== NEVER TAKEN 2008b64: 80 a6 20 00 cmp %i0, 0 2008b68: c8 00 60 10 ld [ %g1 + 0x10 ], %g4 2008b6c: 80 a1 20 01 cmp %g4, 1 2008b70: 22 80 00 27 be,a 2008c0c <_RBTree_Extract_validate_unprotected+0x104> 2008b74: de 00 a0 04 ld [ %g2 + 4 ], %o7 sibling = parent->child[!dir]; } /* sibling is black, see if both of its children are also black. */ if (sibling && !_RBTree_Is_red(sibling->child[RBT_RIGHT]) && 2008b78: c6 00 60 08 ld [ %g1 + 8 ], %g3 2008b7c: 80 a0 e0 00 cmp %g3, 0 2008b80: 22 80 00 07 be,a 2008b9c <_RBTree_Extract_validate_unprotected+0x94> 2008b84: c6 00 60 04 ld [ %g1 + 4 ], %g3 2008b88: c6 00 e0 10 ld [ %g3 + 0x10 ], %g3 2008b8c: 80 a0 e0 01 cmp %g3, 1 2008b90: 22 80 00 57 be,a 2008cec <_RBTree_Extract_validate_unprotected+0x1e4> 2008b94: c6 00 a0 04 ld [ %g2 + 4 ], %g3 !_RBTree_Is_red(sibling->child[RBT_LEFT])) { 2008b98: c6 00 60 04 ld [ %g1 + 4 ], %g3 2008b9c: 80 a0 e0 00 cmp %g3, 0 2008ba0: 22 80 00 07 be,a 2008bbc <_RBTree_Extract_validate_unprotected+0xb4> 2008ba4: d6 20 60 10 st %o3, [ %g1 + 0x10 ] 2008ba8: c6 00 e0 10 ld [ %g3 + 0x10 ], %g3 2008bac: 80 a0 e0 01 cmp %g3, 1 2008bb0: 22 80 00 4f be,a 2008cec <_RBTree_Extract_validate_unprotected+0x1e4> 2008bb4: c6 00 a0 04 ld [ %g2 + 4 ], %g3 sibling->color = RBT_RED; 2008bb8: d6 20 60 10 st %o3, [ %g1 + 0x10 ] 2008bbc: c2 00 a0 10 ld [ %g2 + 0x10 ], %g1 2008bc0: 80 a0 60 01 cmp %g1, 1 2008bc4: 22 80 00 3b be,a 2008cb0 <_RBTree_Extract_validate_unprotected+0x1a8> 2008bc8: c0 20 a0 10 clr [ %g2 + 0x10 ] if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; break; } the_node = parent; /* done if parent is red */ parent = the_node->parent; 2008bcc: c6 00 80 00 ld [ %g2 ], %g3 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 2008bd0: 80 a0 e0 00 cmp %g3, 0 2008bd4: 02 80 00 3e be 2008ccc <_RBTree_Extract_validate_unprotected+0x1c4><== NEVER TAKEN 2008bd8: b0 10 00 02 mov %g2, %i0 if(!(the_node->parent->parent)) return NULL; 2008bdc: c2 00 c0 00 ld [ %g3 ], %g1 2008be0: 80 a0 60 00 cmp %g1, 0 2008be4: 02 80 00 3d be 2008cd8 <_RBTree_Extract_validate_unprotected+0x1d0> 2008be8: 82 10 20 00 clr %g1 if(the_node == the_node->parent->child[RBT_LEFT]) 2008bec: c2 00 e0 04 ld [ %g3 + 4 ], %g1 2008bf0: 80 a0 80 01 cmp %g2, %g1 2008bf4: 02 80 00 3b be 2008ce0 <_RBTree_Extract_validate_unprotected+0x1d8> 2008bf8: 80 a6 20 00 cmp %i0, 0 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 2008bfc: 12 bf ff d1 bne 2008b40 <_RBTree_Extract_validate_unprotected+0x38><== ALWAYS TAKEN 2008c00: 84 10 00 03 mov %g3, %g2 if(!parent->parent) return; sibling = _RBTree_Sibling(the_node); /* continue to correct tree as long as the_node is black and not the root */ while (!_RBTree_Is_red(the_node) && parent->parent) { 2008c04: 10 bf ff d4 b 2008b54 <_RBTree_Extract_validate_unprotected+0x4c><== NOT EXECUTED 2008c08: c6 00 80 00 ld [ %g2 ], %g3 <== NOT EXECUTED * then rotate parent left, making the sibling be the_node's grandparent. * Now the_node has a black sibling and red parent. After rotation, * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; 2008c0c: c8 20 a0 10 st %g4, [ %g2 + 0x10 ] sibling->color = RBT_BLACK; dir = the_node != parent->child[0]; 2008c10: 9e 1b c0 18 xor %o7, %i0, %o7 2008c14: 80 a0 00 0f cmp %g0, %o7 2008c18: 9a 40 20 00 addx %g0, 0, %o5 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[(1-dir)] == NULL) return; 2008c1c: 88 21 00 0d sub %g4, %o5, %g4 2008c20: 89 29 20 02 sll %g4, 2, %g4 2008c24: 88 00 80 04 add %g2, %g4, %g4 2008c28: de 01 20 04 ld [ %g4 + 4 ], %o7 2008c2c: 80 a3 e0 00 cmp %o7, 0 2008c30: 02 80 00 16 be 2008c88 <_RBTree_Extract_validate_unprotected+0x180><== NEVER TAKEN 2008c34: c0 20 60 10 clr [ %g1 + 0x10 ] c = the_node->child[(1-dir)]; the_node->child[(1-dir)] = c->child[dir]; 2008c38: 83 2b 60 02 sll %o5, 2, %g1 2008c3c: 98 03 c0 01 add %o7, %g1, %o4 2008c40: d4 03 20 04 ld [ %o4 + 4 ], %o2 2008c44: d4 21 20 04 st %o2, [ %g4 + 4 ] if (c->child[dir]) 2008c48: c8 03 20 04 ld [ %o4 + 4 ], %g4 2008c4c: 80 a1 20 00 cmp %g4, 0 2008c50: 02 80 00 04 be 2008c60 <_RBTree_Extract_validate_unprotected+0x158><== NEVER TAKEN 2008c54: 82 03 c0 01 add %o7, %g1, %g1 c->child[dir]->parent = the_node; 2008c58: c4 21 00 00 st %g2, [ %g4 ] 2008c5c: c6 00 80 00 ld [ %g2 ], %g3 c->child[dir] = the_node; 2008c60: c4 20 60 04 st %g2, [ %g1 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 2008c64: c2 00 e0 04 ld [ %g3 + 4 ], %g1 c->parent = the_node->parent; 2008c68: c6 23 c0 00 st %g3, [ %o7 ] if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 2008c6c: 82 18 80 01 xor %g2, %g1, %g1 c->parent = the_node->parent; the_node->parent = c; 2008c70: de 20 80 00 st %o7, [ %g2 ] if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 2008c74: 80 a0 00 01 cmp %g0, %g1 2008c78: 82 40 20 00 addx %g0, 0, %g1 2008c7c: 83 28 60 02 sll %g1, 2, %g1 2008c80: 86 00 c0 01 add %g3, %g1, %g3 2008c84: de 20 e0 04 st %o7, [ %g3 + 4 ] _RBTree_Rotate(parent, dir); sibling = parent->child[!dir]; 2008c88: 80 a0 00 0d cmp %g0, %o5 2008c8c: 82 60 3f ff subx %g0, -1, %g1 2008c90: 83 28 60 02 sll %g1, 2, %g1 2008c94: 82 00 80 01 add %g2, %g1, %g1 2008c98: c2 00 60 04 ld [ %g1 + 4 ], %g1 } /* sibling is black, see if both of its children are also black. */ if (sibling && 2008c9c: 80 a0 60 00 cmp %g1, 0 2008ca0: 32 bf ff b7 bne,a 2008b7c <_RBTree_Extract_validate_unprotected+0x74><== ALWAYS TAKEN 2008ca4: c6 00 60 08 ld [ %g1 + 8 ], %g3 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 2008ca8: 10 bf ff a4 b 2008b38 <_RBTree_Extract_validate_unprotected+0x30><== NOT EXECUTED 2008cac: 80 a6 20 00 cmp %i0, 0 <== NOT EXECUTED sibling->child[!dir]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 2008cb0: c2 06 00 00 ld [ %i0 ], %g1 2008cb4: c2 00 40 00 ld [ %g1 ], %g1 2008cb8: 80 a0 60 00 cmp %g1, 0 2008cbc: 22 80 00 02 be,a 2008cc4 <_RBTree_Extract_validate_unprotected+0x1bc> 2008cc0: c0 26 20 10 clr [ %i0 + 0x10 ] 2008cc4: 81 c7 e0 08 ret 2008cc8: 81 e8 00 00 restore RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 2008ccc: 82 10 20 00 clr %g1 <== NOT EXECUTED 2008cd0: 10 bf ff 99 b 2008b34 <_RBTree_Extract_validate_unprotected+0x2c><== NOT EXECUTED 2008cd4: 84 10 20 00 clr %g2 <== NOT EXECUTED if(!(the_node->parent->parent)) return NULL; 2008cd8: 10 bf ff 97 b 2008b34 <_RBTree_Extract_validate_unprotected+0x2c> 2008cdc: 84 10 00 03 mov %g3, %g2 if(the_node == the_node->parent->child[RBT_LEFT]) return the_node->parent->child[RBT_RIGHT]; 2008ce0: c2 00 e0 08 ld [ %g3 + 8 ], %g1 2008ce4: 10 bf ff 94 b 2008b34 <_RBTree_Extract_validate_unprotected+0x2c> 2008ce8: 84 10 00 03 mov %g3, %g2 * cases, either the_node is to the left or the right of the parent. * In both cases, first check if one of sibling's children is black, * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; 2008cec: 86 18 c0 18 xor %g3, %i0, %g3 2008cf0: 80 a0 00 03 cmp %g0, %g3 2008cf4: 86 40 20 00 addx %g0, 0, %g3 if (!_RBTree_Is_red(sibling->child[!dir])) { 2008cf8: 80 a0 00 03 cmp %g0, %g3 2008cfc: 9e 60 3f ff subx %g0, -1, %o7 2008d00: 9f 2b e0 02 sll %o7, 2, %o7 2008d04: 88 00 40 0f add %g1, %o7, %g4 2008d08: c8 01 20 04 ld [ %g4 + 4 ], %g4 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 2008d0c: 80 a1 20 00 cmp %g4, 0 2008d10: 22 80 00 07 be,a 2008d2c <_RBTree_Extract_validate_unprotected+0x224> 2008d14: 89 28 e0 02 sll %g3, 2, %g4 2008d18: da 01 20 10 ld [ %g4 + 0x10 ], %o5 2008d1c: 80 a3 60 01 cmp %o5, 1 2008d20: 22 80 00 28 be,a 2008dc0 <_RBTree_Extract_validate_unprotected+0x2b8> 2008d24: de 00 a0 10 ld [ %g2 + 0x10 ], %o7 sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; 2008d28: 89 28 e0 02 sll %g3, 2, %g4 2008d2c: 88 00 40 04 add %g1, %g4, %g4 _RBTree_Rotate(sibling, !dir); 2008d30: 98 18 e0 01 xor %g3, 1, %o4 * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[!dir])) { sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; 2008d34: d6 01 20 04 ld [ %g4 + 4 ], %o3 * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[!dir])) { sibling->color = RBT_RED; 2008d38: 88 10 20 01 mov 1, %g4 2008d3c: c8 20 60 10 st %g4, [ %g1 + 0x10 ] RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[(1-dir)] == NULL) return; 2008d40: 88 21 00 0c sub %g4, %o4, %g4 2008d44: 9b 29 20 02 sll %g4, 2, %o5 2008d48: 9a 00 40 0d add %g1, %o5, %o5 2008d4c: c8 03 60 04 ld [ %o5 + 4 ], %g4 2008d50: 80 a1 20 00 cmp %g4, 0 2008d54: 02 80 00 16 be 2008dac <_RBTree_Extract_validate_unprotected+0x2a4><== NEVER TAKEN 2008d58: c0 22 e0 10 clr [ %o3 + 0x10 ] c = the_node->child[(1-dir)]; the_node->child[(1-dir)] = c->child[dir]; 2008d5c: 99 2b 20 02 sll %o4, 2, %o4 2008d60: 96 01 00 0c add %g4, %o4, %o3 2008d64: d4 02 e0 04 ld [ %o3 + 4 ], %o2 2008d68: d4 23 60 04 st %o2, [ %o5 + 4 ] if (c->child[dir]) 2008d6c: da 02 e0 04 ld [ %o3 + 4 ], %o5 2008d70: 80 a3 60 00 cmp %o5, 0 2008d74: 32 80 00 02 bne,a 2008d7c <_RBTree_Extract_validate_unprotected+0x274> 2008d78: c2 23 40 00 st %g1, [ %o5 ] c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 2008d7c: da 00 40 00 ld [ %g1 ], %o5 the_node->child[(1-dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 2008d80: 98 01 00 0c add %g4, %o4, %o4 2008d84: c2 23 20 04 st %g1, [ %o4 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 2008d88: d8 03 60 04 ld [ %o5 + 4 ], %o4 c->parent = the_node->parent; 2008d8c: da 21 00 00 st %o5, [ %g4 ] if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 2008d90: 98 18 40 0c xor %g1, %o4, %o4 c->parent = the_node->parent; the_node->parent = c; 2008d94: c8 20 40 00 st %g4, [ %g1 ] if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 2008d98: 80 a0 00 0c cmp %g0, %o4 2008d9c: 82 40 20 00 addx %g0, 0, %g1 2008da0: 83 28 60 02 sll %g1, 2, %g1 2008da4: 9a 03 40 01 add %o5, %g1, %o5 2008da8: c8 23 60 04 st %g4, [ %o5 + 4 ] sibling->child[dir]->color = RBT_BLACK; _RBTree_Rotate(sibling, !dir); sibling = parent->child[!dir]; 2008dac: 82 00 80 0f add %g2, %o7, %g1 2008db0: c2 00 60 04 ld [ %g1 + 4 ], %g1 2008db4: 9e 00 40 0f add %g1, %o7, %o7 2008db8: c8 03 e0 04 ld [ %o7 + 4 ], %g4 } sibling->color = parent->color; 2008dbc: de 00 a0 10 ld [ %g2 + 0x10 ], %o7 2008dc0: de 20 60 10 st %o7, [ %g1 + 0x10 ] parent->color = RBT_BLACK; 2008dc4: c0 20 a0 10 clr [ %g2 + 0x10 ] RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[(1-dir)] == NULL) return; 2008dc8: 9e 10 20 01 mov 1, %o7 2008dcc: 9e 23 c0 03 sub %o7, %g3, %o7 2008dd0: 9f 2b e0 02 sll %o7, 2, %o7 2008dd4: 9e 00 80 0f add %g2, %o7, %o7 2008dd8: c2 03 e0 04 ld [ %o7 + 4 ], %g1 2008ddc: 80 a0 60 00 cmp %g1, 0 2008de0: 02 bf ff b4 be 2008cb0 <_RBTree_Extract_validate_unprotected+0x1a8><== NEVER TAKEN 2008de4: c0 21 20 10 clr [ %g4 + 0x10 ] c = the_node->child[(1-dir)]; the_node->child[(1-dir)] = c->child[dir]; 2008de8: 87 28 e0 02 sll %g3, 2, %g3 2008dec: 88 00 40 03 add %g1, %g3, %g4 2008df0: da 01 20 04 ld [ %g4 + 4 ], %o5 2008df4: da 23 e0 04 st %o5, [ %o7 + 4 ] if (c->child[dir]) 2008df8: c8 01 20 04 ld [ %g4 + 4 ], %g4 2008dfc: 80 a1 20 00 cmp %g4, 0 2008e00: 32 80 00 02 bne,a 2008e08 <_RBTree_Extract_validate_unprotected+0x300> 2008e04: c4 21 00 00 st %g2, [ %g4 ] c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 2008e08: c8 00 80 00 ld [ %g2 ], %g4 the_node->child[(1-dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 2008e0c: 86 00 40 03 add %g1, %g3, %g3 2008e10: c4 20 e0 04 st %g2, [ %g3 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 2008e14: c6 01 20 04 ld [ %g4 + 4 ], %g3 c->parent = the_node->parent; 2008e18: c8 20 40 00 st %g4, [ %g1 ] the_node->parent = c; 2008e1c: c2 20 80 00 st %g1, [ %g2 ] if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 2008e20: 86 18 c0 02 xor %g3, %g2, %g3 2008e24: 80 a0 00 03 cmp %g0, %g3 2008e28: 84 40 20 00 addx %g0, 0, %g2 2008e2c: 85 28 a0 02 sll %g2, 2, %g2 2008e30: 88 01 00 02 add %g4, %g2, %g4 2008e34: c2 21 20 04 st %g1, [ %g4 + 4 ] sibling->child[!dir]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 2008e38: c2 06 00 00 ld [ %i0 ], %g1 2008e3c: c2 00 40 00 ld [ %g1 ], %g1 2008e40: 80 a0 60 00 cmp %g1, 0 2008e44: 22 bf ff a0 be,a 2008cc4 <_RBTree_Extract_validate_unprotected+0x1bc><== NEVER TAKEN 2008e48: c0 26 20 10 clr [ %i0 + 0x10 ] <== NOT EXECUTED 2008e4c: 81 c7 e0 08 ret 2008e50: 81 e8 00 00 restore =============================================================================== 020090b4 <_RBTree_Find>: RBTree_Node *_RBTree_Find( RBTree_Control *the_rbtree, unsigned int the_value ) { 20090b4: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; RBTree_Node *return_node; return_node = NULL; _ISR_Disable( level ); 20090b8: 7f ff e6 54 call 2002a08 20090bc: 01 00 00 00 nop return_node = _RBTree_Find_unprotected( the_rbtree, the_value ); _ISR_Enable( level ); return return_node; } 20090c0: f0 06 20 04 ld [ %i0 + 4 ], %i0 RBTree_Control *the_rbtree, unsigned int the_value ) { RBTree_Node* iter_node = the_rbtree->root; while (iter_node) { 20090c4: 80 a6 20 00 cmp %i0, 0 20090c8: 32 80 00 0b bne,a 20090f4 <_RBTree_Find+0x40> <== ALWAYS TAKEN 20090cc: c2 06 20 0c ld [ %i0 + 0xc ], %g1 20090d0: 30 80 00 0c b,a 2009100 <_RBTree_Find+0x4c> <== NOT EXECUTED if (the_value == iter_node->value) return(iter_node); RBTree_Direction dir = the_value > iter_node->value; 20090d4: 82 40 20 00 addx %g0, 0, %g1 iter_node = iter_node->child[dir]; 20090d8: 83 28 60 02 sll %g1, 2, %g1 20090dc: b0 06 00 01 add %i0, %g1, %i0 20090e0: f0 06 20 04 ld [ %i0 + 4 ], %i0 RBTree_Control *the_rbtree, unsigned int the_value ) { RBTree_Node* iter_node = the_rbtree->root; while (iter_node) { 20090e4: 80 a6 20 00 cmp %i0, 0 20090e8: 02 80 00 06 be 2009100 <_RBTree_Find+0x4c> <== NEVER TAKEN 20090ec: 01 00 00 00 nop if (the_value == iter_node->value) return(iter_node); 20090f0: c2 06 20 0c ld [ %i0 + 0xc ], %g1 20090f4: 80 a6 40 01 cmp %i1, %g1 20090f8: 12 bf ff f7 bne 20090d4 <_RBTree_Find+0x20> 20090fc: 80 a0 40 19 cmp %g1, %i1 RBTree_Node *return_node; return_node = NULL; _ISR_Disable( level ); return_node = _RBTree_Find_unprotected( the_rbtree, the_value ); _ISR_Enable( level ); 2009100: 7f ff e6 46 call 2002a18 2009104: 01 00 00 00 nop return return_node; } 2009108: 81 c7 e0 08 ret 200910c: 81 e8 00 00 restore =============================================================================== 02009068 <_RBTree_Find_header>: */ RBTree_Control *_RBTree_Find_header( RBTree_Node *the_node ) { 2009068: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; RBTree_Control *return_header; return_header = NULL; _ISR_Disable( level ); 200906c: 7f ff e6 67 call 2002a08 2009070: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE RBTree_Control *_RBTree_Find_header_unprotected( RBTree_Node *the_node ) { if(!the_node) return NULL; 2009074: 80 a6 20 00 cmp %i0, 0 2009078: 02 80 00 0b be 20090a4 <_RBTree_Find_header+0x3c> <== NEVER TAKEN 200907c: ba 10 20 00 clr %i5 if(!(the_node->parent)) return NULL; 2009080: fa 06 00 00 ld [ %i0 ], %i5 2009084: 80 a7 60 00 cmp %i5, 0 2009088: 32 80 00 04 bne,a 2009098 <_RBTree_Find_header+0x30> <== ALWAYS TAKEN 200908c: c2 07 40 00 ld [ %i5 ], %g1 2009090: 30 80 00 05 b,a 20090a4 <_RBTree_Find_header+0x3c> <== NOT EXECUTED 2009094: c2 07 40 00 ld [ %i5 ], %g1 while(the_node->parent) the_node = the_node->parent; 2009098: 80 a0 60 00 cmp %g1, 0 200909c: 32 bf ff fe bne,a 2009094 <_RBTree_Find_header+0x2c> 20090a0: ba 10 00 01 mov %g1, %i5 return_header = _RBTree_Find_header_unprotected( the_node ); _ISR_Enable( level ); 20090a4: 7f ff e6 5d call 2002a18 20090a8: b0 10 00 1d mov %i5, %i0 return return_header; } 20090ac: 81 c7 e0 08 ret 20090b0: 81 e8 00 00 restore =============================================================================== 020092fc <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 20092fc: 9d e3 bf a0 save %sp, -96, %sp if(!the_node) return (RBTree_Node*)-1; 2009300: 80 a6 60 00 cmp %i1, 0 2009304: 02 80 00 14 be 2009354 <_RBTree_Insert_unprotected+0x58> <== NEVER TAKEN 2009308: 82 10 3f ff mov -1, %g1 RBTree_Node *iter_node = the_rbtree->root; 200930c: c2 06 20 04 ld [ %i0 + 4 ], %g1 if (!iter_node) { /* special case: first node inserted */ 2009310: 80 a0 60 00 cmp %g1, 0 2009314: 22 80 00 23 be,a 20093a0 <_RBTree_Insert_unprotected+0xa4> 2009318: c0 26 60 10 clr [ %i1 + 0x10 ] the_node->color = RBT_RED; iter_node->child[dir] = the_node; the_node->parent = iter_node; /* update min/max */ if (_RBTree_Is_first(the_rbtree, iter_node, dir)) { the_rbtree->first[dir] = the_node; 200931c: 10 80 00 0a b 2009344 <_RBTree_Insert_unprotected+0x48> 2009320: c6 06 60 0c ld [ %i1 + 0xc ], %g3 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { if(the_node->value == iter_node->value) return(iter_node); RBTree_Direction dir = the_node->value > iter_node->value; 2009324: 9e 40 20 00 addx %g0, 0, %o7 if (!iter_node->child[dir]) { 2009328: 89 2b e0 02 sll %o7, 2, %g4 200932c: 88 00 40 04 add %g1, %g4, %g4 2009330: c4 01 20 04 ld [ %g4 + 4 ], %g2 2009334: 80 a0 a0 00 cmp %g2, 0 2009338: 22 80 00 09 be,a 200935c <_RBTree_Insert_unprotected+0x60> 200933c: c0 26 60 08 clr [ %i1 + 8 ] 2009340: 82 10 00 02 mov %g2, %g1 the_node->parent = (RBTree_Node *) the_rbtree; the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { if(the_node->value == iter_node->value) return(iter_node); 2009344: c4 00 60 0c ld [ %g1 + 0xc ], %g2 2009348: 80 a0 c0 02 cmp %g3, %g2 200934c: 12 bf ff f6 bne 2009324 <_RBTree_Insert_unprotected+0x28> 2009350: 80 a0 80 03 cmp %g2, %g3 /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 2009354: 81 c7 e0 08 ret 2009358: 91 e8 00 01 restore %g0, %g1, %o0 /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { if(the_node->value == iter_node->value) return(iter_node); RBTree_Direction dir = the_node->value > iter_node->value; if (!iter_node->child[dir]) { the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 200935c: c0 26 60 04 clr [ %i1 + 4 ] RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 2009360: 9e 03 e0 02 add %o7, 2, %o7 2009364: 9f 2b e0 02 sll %o7, 2, %o7 the_node->color = RBT_RED; iter_node->child[dir] = the_node; the_node->parent = iter_node; /* update min/max */ if (_RBTree_Is_first(the_rbtree, iter_node, dir)) { 2009368: c4 06 00 0f ld [ %i0 + %o7 ], %g2 while (iter_node) { if(the_node->value == iter_node->value) return(iter_node); RBTree_Direction dir = the_node->value > iter_node->value; if (!iter_node->child[dir]) { the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; the_node->color = RBT_RED; 200936c: 86 10 20 01 mov 1, %g3 iter_node->child[dir] = the_node; 2009370: f2 21 20 04 st %i1, [ %g4 + 4 ] while (iter_node) { if(the_node->value == iter_node->value) return(iter_node); RBTree_Direction dir = the_node->value > iter_node->value; if (!iter_node->child[dir]) { the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; the_node->color = RBT_RED; 2009374: c6 26 60 10 st %g3, [ %i1 + 0x10 ] iter_node->child[dir] = the_node; the_node->parent = iter_node; /* update min/max */ if (_RBTree_Is_first(the_rbtree, iter_node, dir)) { 2009378: 80 a0 40 02 cmp %g1, %g2 200937c: 02 80 00 07 be 2009398 <_RBTree_Insert_unprotected+0x9c> 2009380: c2 26 40 00 st %g1, [ %i1 ] } } /* while(iter_node) */ /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); 2009384: 7f ff ff 72 call 200914c <_RBTree_Validate_insert_unprotected> 2009388: 90 10 00 19 mov %i1, %o0 } return (RBTree_Node*)0; 200938c: 82 10 20 00 clr %g1 } 2009390: 81 c7 e0 08 ret 2009394: 91 e8 00 01 restore %g0, %g1, %o0 the_node->color = RBT_RED; iter_node->child[dir] = the_node; the_node->parent = iter_node; /* update min/max */ if (_RBTree_Is_first(the_rbtree, iter_node, dir)) { the_rbtree->first[dir] = the_node; 2009398: 10 bf ff fb b 2009384 <_RBTree_Insert_unprotected+0x88> 200939c: f2 26 00 0f st %i1, [ %i0 + %o7 ] RBTree_Node *iter_node = the_rbtree->root; if (!iter_node) { /* special case: first node inserted */ the_node->color = RBT_BLACK; the_rbtree->root = the_node; 20093a0: f2 26 20 04 st %i1, [ %i0 + 4 ] the_rbtree->first[0] = the_rbtree->first[1] = the_node; 20093a4: f2 26 20 0c st %i1, [ %i0 + 0xc ] 20093a8: f2 26 20 08 st %i1, [ %i0 + 8 ] the_node->parent = (RBTree_Node *) the_rbtree; 20093ac: f0 26 40 00 st %i0, [ %i1 ] the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 20093b0: c0 26 60 08 clr [ %i1 + 8 ] 20093b4: 10 bf ff e8 b 2009354 <_RBTree_Insert_unprotected+0x58> 20093b8: c0 26 60 04 clr [ %i1 + 4 ] =============================================================================== 0200914c <_RBTree_Validate_insert_unprotected>: * append operation. */ void _RBTree_Validate_insert_unprotected( RBTree_Node *the_node ) { 200914c: 9d e3 bf a0 save %sp, -96, %sp } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { 2009150: 96 10 20 01 mov 1, %o3 ISR_Level level; _ISR_Disable( level ); _RBTree_Insert_unprotected( tree, node ); _ISR_Enable( level ); } 2009154: c2 06 00 00 ld [ %i0 ], %g1 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 2009158: c4 00 40 00 ld [ %g1 ], %g2 200915c: 86 90 a0 00 orcc %g2, 0, %g3 2009160: 22 80 00 06 be,a 2009178 <_RBTree_Validate_insert_unprotected+0x2c> 2009164: c0 26 20 10 clr [ %i0 + 0x10 ] */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 2009168: c8 00 60 10 ld [ %g1 + 0x10 ], %g4 200916c: 80 a1 20 01 cmp %g4, 1 2009170: 22 80 00 04 be,a 2009180 <_RBTree_Validate_insert_unprotected+0x34> 2009174: c8 00 80 00 ld [ %g2 ], %g4 2009178: 81 c7 e0 08 ret 200917c: 81 e8 00 00 restore ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(!(the_node->parent->parent->parent)) return NULL; 2009180: 80 a1 20 00 cmp %g4, 0 2009184: 02 80 00 0c be 20091b4 <_RBTree_Validate_insert_unprotected+0x68><== NEVER TAKEN 2009188: de 00 a0 04 ld [ %g2 + 4 ], %o7 { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) 200918c: 80 a0 40 0f cmp %g1, %o7 2009190: 02 80 00 59 be 20092f4 <_RBTree_Validate_insert_unprotected+0x1a8> 2009194: 88 10 00 0f mov %o7, %g4 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 2009198: 80 a1 20 00 cmp %g4, 0 200919c: 22 80 00 07 be,a 20091b8 <_RBTree_Validate_insert_unprotected+0x6c> 20091a0: c8 00 60 04 ld [ %g1 + 4 ], %g4 20091a4: da 01 20 10 ld [ %g4 + 0x10 ], %o5 20091a8: 80 a3 60 01 cmp %o5, 1 20091ac: 22 80 00 4c be,a 20092dc <_RBTree_Validate_insert_unprotected+0x190> 20091b0: c0 20 60 10 clr [ %g1 + 0x10 ] the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; 20091b4: c8 00 60 04 ld [ %g1 + 4 ], %g4 RBTree_Direction pdir = the_node->parent != g->child[0]; 20091b8: 9e 18 40 0f xor %g1, %o7, %o7 the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; 20091bc: 88 19 00 18 xor %g4, %i0, %g4 20091c0: 80 a0 00 04 cmp %g0, %g4 20091c4: 9a 40 20 00 addx %g0, 0, %o5 RBTree_Direction pdir = the_node->parent != g->child[0]; 20091c8: 80 a0 00 0f cmp %g0, %o7 20091cc: 88 40 20 00 addx %g0, 0, %g4 /* ensure node is on the same branch direction as parent */ if (dir != pdir) { 20091d0: 80 a3 40 04 cmp %o5, %g4 20091d4: 02 80 00 46 be 20092ec <_RBTree_Validate_insert_unprotected+0x1a0> 20091d8: 98 22 c0 0d sub %o3, %o5, %o4 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[(1-dir)] == NULL) return; 20091dc: 98 22 c0 04 sub %o3, %g4, %o4 20091e0: 9b 2b 20 02 sll %o4, 2, %o5 20091e4: 9a 00 40 0d add %g1, %o5, %o5 20091e8: de 03 60 04 ld [ %o5 + 4 ], %o7 20091ec: 80 a3 e0 00 cmp %o7, 0 20091f0: 02 80 00 16 be 2009248 <_RBTree_Validate_insert_unprotected+0xfc><== NEVER TAKEN 20091f4: 89 29 20 02 sll %g4, 2, %g4 c = the_node->child[(1-dir)]; the_node->child[(1-dir)] = c->child[dir]; 20091f8: 94 03 c0 04 add %o7, %g4, %o2 20091fc: d2 02 a0 04 ld [ %o2 + 4 ], %o1 2009200: d2 23 60 04 st %o1, [ %o5 + 4 ] if (c->child[dir]) 2009204: da 02 a0 04 ld [ %o2 + 4 ], %o5 2009208: 80 a3 60 00 cmp %o5, 0 200920c: 22 80 00 05 be,a 2009220 <_RBTree_Validate_insert_unprotected+0xd4> 2009210: 9a 03 c0 04 add %o7, %g4, %o5 c->child[dir]->parent = the_node; 2009214: c2 23 40 00 st %g1, [ %o5 ] 2009218: c4 00 40 00 ld [ %g1 ], %g2 c->child[dir] = the_node; 200921c: 9a 03 c0 04 add %o7, %g4, %o5 2009220: c2 23 60 04 st %g1, [ %o5 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 2009224: da 00 a0 04 ld [ %g2 + 4 ], %o5 c->parent = the_node->parent; 2009228: c4 23 c0 00 st %g2, [ %o7 ] if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 200922c: 9a 18 40 0d xor %g1, %o5, %o5 c->parent = the_node->parent; the_node->parent = c; 2009230: de 20 40 00 st %o7, [ %g1 ] if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 2009234: 80 a0 00 0d cmp %g0, %o5 2009238: 82 40 20 00 addx %g0, 0, %g1 200923c: 83 28 60 02 sll %g1, 2, %g1 2009240: 84 00 80 01 add %g2, %g1, %g2 2009244: de 20 a0 04 st %o7, [ %g2 + 4 ] _RBTree_Rotate(the_node->parent, pdir); the_node = the_node->child[pdir]; 2009248: b0 06 00 04 add %i0, %g4, %i0 200924c: f0 06 20 04 ld [ %i0 + 4 ], %i0 2009250: c2 06 00 00 ld [ %i0 ], %g1 } the_node->parent->color = RBT_BLACK; 2009254: c0 20 60 10 clr [ %g1 + 0x10 ] RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[(1-dir)] == NULL) return; 2009258: 88 00 c0 04 add %g3, %g4, %g4 200925c: c2 01 20 04 ld [ %g4 + 4 ], %g1 2009260: 80 a0 60 00 cmp %g1, 0 2009264: 02 bf ff bc be 2009154 <_RBTree_Validate_insert_unprotected+0x8><== NEVER TAKEN 2009268: d6 20 e0 10 st %o3, [ %g3 + 0x10 ] c = the_node->child[(1-dir)]; the_node->child[(1-dir)] = c->child[dir]; 200926c: 99 2b 20 02 sll %o4, 2, %o4 2009270: 84 00 40 0c add %g1, %o4, %g2 2009274: de 00 a0 04 ld [ %g2 + 4 ], %o7 2009278: de 21 20 04 st %o7, [ %g4 + 4 ] if (c->child[dir]) 200927c: c4 00 a0 04 ld [ %g2 + 4 ], %g2 2009280: 80 a0 a0 00 cmp %g2, 0 2009284: 32 80 00 02 bne,a 200928c <_RBTree_Validate_insert_unprotected+0x140> 2009288: c6 20 80 00 st %g3, [ %g2 ] c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 200928c: c4 00 c0 00 ld [ %g3 ], %g2 the_node->child[(1-dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 2009290: 98 00 40 0c add %g1, %o4, %o4 2009294: c6 23 20 04 st %g3, [ %o4 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 2009298: c8 00 a0 04 ld [ %g2 + 4 ], %g4 c->parent = the_node->parent; 200929c: c4 20 40 00 st %g2, [ %g1 ] the_node->parent = c; 20092a0: c2 20 c0 00 st %g1, [ %g3 ] if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 20092a4: 88 19 00 03 xor %g4, %g3, %g4 20092a8: 80 a0 00 04 cmp %g0, %g4 20092ac: 86 40 20 00 addx %g0, 0, %g3 20092b0: 87 28 e0 02 sll %g3, 2, %g3 20092b4: 84 00 80 03 add %g2, %g3, %g2 20092b8: c2 20 a0 04 st %g1, [ %g2 + 4 ] ISR_Level level; _ISR_Disable( level ); _RBTree_Insert_unprotected( tree, node ); _ISR_Enable( level ); } 20092bc: c2 06 00 00 ld [ %i0 ], %g1 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 20092c0: c4 00 40 00 ld [ %g1 ], %g2 20092c4: 86 90 a0 00 orcc %g2, 0, %g3 20092c8: 32 bf ff a9 bne,a 200916c <_RBTree_Validate_insert_unprotected+0x20><== ALWAYS TAKEN 20092cc: c8 00 60 10 ld [ %g1 + 0x10 ], %g4 /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); } } if(!the_node->parent->parent) the_node->color = RBT_BLACK; 20092d0: c0 26 20 10 clr [ %i0 + 0x10 ] <== NOT EXECUTED 20092d4: 81 c7 e0 08 ret <== NOT EXECUTED 20092d8: 81 e8 00 00 restore <== NOT EXECUTED g = the_node->parent->parent; /* if uncle is red, repaint uncle/parent black and grandparent red */ if(_RBTree_Is_red(u)) { the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; 20092dc: c0 21 20 10 clr [ %g4 + 0x10 ] g->color = RBT_RED; 20092e0: da 20 a0 10 st %o5, [ %g2 + 0x10 ] 20092e4: 10 bf ff 9c b 2009154 <_RBTree_Validate_insert_unprotected+0x8> 20092e8: b0 10 00 02 mov %g2, %i0 20092ec: 10 bf ff da b 2009254 <_RBTree_Validate_insert_unprotected+0x108> 20092f0: 89 2b 60 02 sll %o5, 2, %g4 if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) return the_node->parent->child[RBT_RIGHT]; 20092f4: 10 bf ff a9 b 2009198 <_RBTree_Validate_insert_unprotected+0x4c> 20092f8: c8 00 a0 08 ld [ %g2 + 8 ], %g4 =============================================================================== 02006cd0 <_RTEMS_tasks_Initialize_user_tasks_body>: * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { 2006cd0: 9d e3 bf 98 save %sp, -104, %sp rtems_initialization_tasks_table *user_tasks; /* * Move information into local variables */ user_tasks = Configuration_RTEMS_API.User_initialization_tasks_table; 2006cd4: 03 00 80 73 sethi %hi(0x201cc00), %g1 2006cd8: 82 10 60 34 or %g1, 0x34, %g1 ! 201cc34 2006cdc: fa 00 60 2c ld [ %g1 + 0x2c ], %i5 maximum = Configuration_RTEMS_API.number_of_initialization_tasks; /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) 2006ce0: 80 a7 60 00 cmp %i5, 0 2006ce4: 02 80 00 18 be 2006d44 <_RTEMS_tasks_Initialize_user_tasks_body+0x74> 2006ce8: f6 00 60 28 ld [ %g1 + 0x28 ], %i3 return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 2006cec: 80 a6 e0 00 cmp %i3, 0 2006cf0: 02 80 00 15 be 2006d44 <_RTEMS_tasks_Initialize_user_tasks_body+0x74><== NEVER TAKEN 2006cf4: b8 10 20 00 clr %i4 return_value = rtems_task_create( 2006cf8: d4 07 60 04 ld [ %i5 + 4 ], %o2 2006cfc: d0 07 40 00 ld [ %i5 ], %o0 2006d00: d2 07 60 08 ld [ %i5 + 8 ], %o1 2006d04: d6 07 60 14 ld [ %i5 + 0x14 ], %o3 2006d08: d8 07 60 0c ld [ %i5 + 0xc ], %o4 2006d0c: 7f ff ff 70 call 2006acc 2006d10: 9a 07 bf fc add %fp, -4, %o5 user_tasks[ index ].stack_size, user_tasks[ index ].mode_set, user_tasks[ index ].attribute_set, &id ); if ( !rtems_is_status_successful( return_value ) ) 2006d14: 94 92 20 00 orcc %o0, 0, %o2 2006d18: 12 80 00 0d bne 2006d4c <_RTEMS_tasks_Initialize_user_tasks_body+0x7c> 2006d1c: d0 07 bf fc ld [ %fp + -4 ], %o0 _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 2006d20: d4 07 60 18 ld [ %i5 + 0x18 ], %o2 2006d24: 40 00 00 0e call 2006d5c 2006d28: d2 07 60 10 ld [ %i5 + 0x10 ], %o1 id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) 2006d2c: 94 92 20 00 orcc %o0, 0, %o2 2006d30: 12 80 00 07 bne 2006d4c <_RTEMS_tasks_Initialize_user_tasks_body+0x7c> 2006d34: b8 07 20 01 inc %i4 return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 2006d38: 80 a7 00 1b cmp %i4, %i3 2006d3c: 12 bf ff ef bne 2006cf8 <_RTEMS_tasks_Initialize_user_tasks_body+0x28><== NEVER TAKEN 2006d40: ba 07 60 1c add %i5, 0x1c, %i5 2006d44: 81 c7 e0 08 ret 2006d48: 81 e8 00 00 restore id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 2006d4c: 90 10 20 01 mov 1, %o0 2006d50: 40 00 04 0f call 2007d8c <_Internal_error_Occurred> 2006d54: 92 10 20 01 mov 1, %o1 =============================================================================== 0200ce48 <_RTEMS_tasks_Switch_extension>: /* * Per Task Variables */ tvp = executing->task_variables; 200ce48: c2 02 21 64 ld [ %o0 + 0x164 ], %g1 while (tvp) { 200ce4c: 80 a0 60 00 cmp %g1, 0 200ce50: 22 80 00 0c be,a 200ce80 <_RTEMS_tasks_Switch_extension+0x38> 200ce54: c2 02 61 64 ld [ %o1 + 0x164 ], %g1 tvp->tval = *tvp->ptr; 200ce58: c4 00 60 04 ld [ %g1 + 4 ], %g2 *tvp->ptr = tvp->gval; 200ce5c: c6 00 60 08 ld [ %g1 + 8 ], %g3 * Per Task Variables */ tvp = executing->task_variables; while (tvp) { tvp->tval = *tvp->ptr; 200ce60: c8 00 80 00 ld [ %g2 ], %g4 200ce64: c8 20 60 0c st %g4, [ %g1 + 0xc ] *tvp->ptr = tvp->gval; 200ce68: c6 20 80 00 st %g3, [ %g2 ] tvp = (rtems_task_variable_t *)tvp->next; 200ce6c: c2 00 40 00 ld [ %g1 ], %g1 /* * Per Task Variables */ tvp = executing->task_variables; while (tvp) { 200ce70: 80 a0 60 00 cmp %g1, 0 200ce74: 32 bf ff fa bne,a 200ce5c <_RTEMS_tasks_Switch_extension+0x14><== NEVER TAKEN 200ce78: c4 00 60 04 ld [ %g1 + 4 ], %g2 <== NOT EXECUTED tvp->tval = *tvp->ptr; *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; 200ce7c: c2 02 61 64 ld [ %o1 + 0x164 ], %g1 while (tvp) { 200ce80: 80 a0 60 00 cmp %g1, 0 200ce84: 02 80 00 0b be 200ceb0 <_RTEMS_tasks_Switch_extension+0x68> 200ce88: 01 00 00 00 nop tvp->gval = *tvp->ptr; 200ce8c: c4 00 60 04 ld [ %g1 + 4 ], %g2 *tvp->ptr = tvp->tval; 200ce90: c6 00 60 0c ld [ %g1 + 0xc ], %g3 tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { tvp->gval = *tvp->ptr; 200ce94: c8 00 80 00 ld [ %g2 ], %g4 200ce98: c8 20 60 08 st %g4, [ %g1 + 8 ] *tvp->ptr = tvp->tval; 200ce9c: c6 20 80 00 st %g3, [ %g2 ] tvp = (rtems_task_variable_t *)tvp->next; 200cea0: c2 00 40 00 ld [ %g1 ], %g1 *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { 200cea4: 80 a0 60 00 cmp %g1, 0 200cea8: 32 bf ff fa bne,a 200ce90 <_RTEMS_tasks_Switch_extension+0x48><== NEVER TAKEN 200ceac: c4 00 60 04 ld [ %g1 + 4 ], %g2 <== NOT EXECUTED 200ceb0: 81 c3 e0 08 retl =============================================================================== 02007a70 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 2007a70: 9d e3 bf 98 save %sp, -104, %sp 2007a74: 11 00 80 7d sethi %hi(0x201f400), %o0 2007a78: 92 10 00 18 mov %i0, %o1 2007a7c: 90 12 22 74 or %o0, 0x274, %o0 2007a80: 40 00 08 47 call 2009b9c <_Objects_Get> 2007a84: 94 07 bf fc add %fp, -4, %o2 /* * 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 ) { 2007a88: c2 07 bf fc ld [ %fp + -4 ], %g1 2007a8c: 80 a0 60 00 cmp %g1, 0 2007a90: 12 80 00 17 bne 2007aec <_Rate_monotonic_Timeout+0x7c> <== NEVER TAKEN 2007a94: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: the_thread = the_period->owner; 2007a98: d0 02 20 40 ld [ %o0 + 0x40 ], %o0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 2007a9c: 03 00 00 10 sethi %hi(0x4000), %g1 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_period ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_PERIOD); 2007aa0: c4 02 20 10 ld [ %o0 + 0x10 ], %g2 2007aa4: 80 88 80 01 btst %g2, %g1 2007aa8: 22 80 00 08 be,a 2007ac8 <_Rate_monotonic_Timeout+0x58> 2007aac: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 2007ab0: c4 02 20 20 ld [ %o0 + 0x20 ], %g2 2007ab4: c2 07 60 08 ld [ %i5 + 8 ], %g1 2007ab8: 80 a0 80 01 cmp %g2, %g1 2007abc: 02 80 00 1a be 2007b24 <_Rate_monotonic_Timeout+0xb4> 2007ac0: 13 04 00 ff sethi %hi(0x1003fc00), %o1 _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 ) { 2007ac4: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 2007ac8: 80 a0 60 01 cmp %g1, 1 2007acc: 02 80 00 0a be 2007af4 <_Rate_monotonic_Timeout+0x84> 2007ad0: 82 10 20 04 mov 4, %g1 _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 2007ad4: c2 27 60 38 st %g1, [ %i5 + 0x38 ] /** * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 2007ad8: 03 00 80 7d sethi %hi(0x201f400), %g1 2007adc: c4 00 63 e0 ld [ %g1 + 0x3e0 ], %g2 ! 201f7e0 <_Thread_Dispatch_disable_level> 2007ae0: 84 00 bf ff add %g2, -1, %g2 2007ae4: c4 20 63 e0 st %g2, [ %g1 + 0x3e0 ] return _Thread_Dispatch_disable_level; 2007ae8: c2 00 63 e0 ld [ %g1 + 0x3e0 ], %g1 2007aec: 81 c7 e0 08 ret 2007af0: 81 e8 00 00 restore _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 ) { the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 2007af4: 82 10 20 03 mov 3, %g1 _Rate_monotonic_Initiate_statistics( the_period ); 2007af8: 90 10 00 1d mov %i5, %o0 _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 ) { the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 2007afc: c2 27 60 38 st %g1, [ %i5 + 0x38 ] _Rate_monotonic_Initiate_statistics( the_period ); 2007b00: 7f ff fe 5a call 2007468 <_Rate_monotonic_Initiate_statistics> 2007b04: 01 00 00 00 nop Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 2007b08: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 2007b0c: 11 00 80 7e sethi %hi(0x201f800), %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 2007b10: c2 27 60 1c st %g1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 2007b14: 90 12 20 a4 or %o0, 0xa4, %o0 2007b18: 40 00 10 3a call 200bc00 <_Watchdog_Insert> 2007b1c: 92 07 60 10 add %i5, 0x10, %o1 2007b20: 30 bf ff ee b,a 2007ad8 <_Rate_monotonic_Timeout+0x68> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 2007b24: 40 00 0a f3 call 200a6f0 <_Thread_Clear_state> 2007b28: 92 12 63 f8 or %o1, 0x3f8, %o1 the_thread = the_period->owner; if ( _States_Is_waiting_for_period( the_thread->current_state ) && the_thread->Wait.id == the_period->Object.id ) { _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); 2007b2c: 10 bf ff f5 b 2007b00 <_Rate_monotonic_Timeout+0x90> 2007b30: 90 10 00 1d mov %i5, %o0 =============================================================================== 02009234 <_Scheduler_simple_Ready_queue_Enqueue_first>: { Chain_Control *ready; Chain_Node *the_node; Thread_Control *current; ready = (Chain_Control *)_Scheduler.information; 2009234: 03 00 80 76 sethi %hi(0x201d800), %g1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 2009238: c2 00 63 b4 ld [ %g1 + 0x3b4 ], %g1 ! 201dbb4 <_Scheduler> */ for ( the_node = _Chain_First(ready) ; ; the_node = the_node->next ) { current = (Thread_Control *) the_node; /* break when AT HEAD OF (or PAST) our priority */ if ( the_thread->current_priority <= current->current_priority ) { 200923c: c6 02 20 14 ld [ %o0 + 0x14 ], %g3 2009240: c2 00 40 00 ld [ %g1 ], %g1 2009244: c4 00 60 14 ld [ %g1 + 0x14 ], %g2 2009248: 80 a0 80 03 cmp %g2, %g3 200924c: 3a 80 00 08 bcc,a 200926c <_Scheduler_simple_Ready_queue_Enqueue_first+0x38> 2009250: c2 00 60 04 ld [ %g1 + 4 ], %g1 * Do NOT need to check for end of chain because there is always * at least one task on the ready chain -- the IDLE task. It can * never block, should never attempt to obtain a semaphore or mutex, * and thus will always be there. */ for ( the_node = _Chain_First(ready) ; ; the_node = the_node->next ) { 2009254: c2 00 40 00 ld [ %g1 ], %g1 current = (Thread_Control *) the_node; /* break when AT HEAD OF (or PAST) our priority */ if ( the_thread->current_priority <= current->current_priority ) { 2009258: c4 00 60 14 ld [ %g1 + 0x14 ], %g2 200925c: 80 a0 80 03 cmp %g2, %g3 2009260: 2a bf ff fe bcs,a 2009258 <_Scheduler_simple_Ready_queue_Enqueue_first+0x24><== NEVER TAKEN 2009264: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED current = (Thread_Control *)current->Object.Node.previous; 2009268: c2 00 60 04 ld [ %g1 + 4 ], %g1 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 200926c: c4 00 40 00 ld [ %g1 ], %g2 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 2009270: c2 22 20 04 st %g1, [ %o0 + 4 ] before_node = after_node->next; after_node->next = the_node; 2009274: d0 20 40 00 st %o0, [ %g1 ] the_node->next = before_node; 2009278: c4 22 00 00 st %g2, [ %o0 ] } } /* enqueue */ _Chain_Insert_unprotected( (Chain_Node *)current, &the_thread->Object.Node ); } 200927c: 81 c3 e0 08 retl 2009280: d0 20 a0 04 st %o0, [ %g2 + 4 ] =============================================================================== 0200748c <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 200748c: 9d e3 bf a0 save %sp, -96, %sp uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 2007490: 03 00 80 7c sethi %hi(0x201f000), %g1 (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; 2007494: ba 10 20 00 clr %i5 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) || 2007498: 80 a6 20 00 cmp %i0, 0 200749c: 02 80 00 2c be 200754c <_TOD_Validate+0xc0> <== NEVER TAKEN 20074a0: d2 00 63 08 ld [ %g1 + 0x308 ], %o1 ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 20074a4: 11 00 03 d0 sethi %hi(0xf4000), %o0 20074a8: 40 00 4c cf call 201a7e4 <.udiv> 20074ac: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 20074b0: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 20074b4: 80 a2 00 01 cmp %o0, %g1 20074b8: 28 80 00 26 bleu,a 2007550 <_TOD_Validate+0xc4> 20074bc: b0 0f 60 01 and %i5, 1, %i0 (the_tod->ticks >= ticks_per_second) || 20074c0: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 20074c4: 80 a0 60 3b cmp %g1, 0x3b 20074c8: 38 80 00 22 bgu,a 2007550 <_TOD_Validate+0xc4> 20074cc: b0 0f 60 01 and %i5, 1, %i0 (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 20074d0: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 20074d4: 80 a0 60 3b cmp %g1, 0x3b 20074d8: 38 80 00 1e bgu,a 2007550 <_TOD_Validate+0xc4> 20074dc: b0 0f 60 01 and %i5, 1, %i0 (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 20074e0: c2 06 20 0c ld [ %i0 + 0xc ], %g1 20074e4: 80 a0 60 17 cmp %g1, 0x17 20074e8: 38 80 00 1a bgu,a 2007550 <_TOD_Validate+0xc4> 20074ec: b0 0f 60 01 and %i5, 1, %i0 (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 20074f0: c2 06 20 04 ld [ %i0 + 4 ], %g1 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) || 20074f4: 80 a0 60 00 cmp %g1, 0 20074f8: 02 80 00 15 be 200754c <_TOD_Validate+0xc0> <== NEVER TAKEN 20074fc: 80 a0 60 0c cmp %g1, 0xc (the_tod->month == 0) || 2007500: 38 80 00 14 bgu,a 2007550 <_TOD_Validate+0xc4> 2007504: b0 0f 60 01 and %i5, 1, %i0 (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 2007508: c4 06 00 00 ld [ %i0 ], %g2 (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) || 200750c: 80 a0 a7 c3 cmp %g2, 0x7c3 2007510: 28 80 00 10 bleu,a 2007550 <_TOD_Validate+0xc4> 2007514: b0 0f 60 01 and %i5, 1, %i0 (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 2007518: c6 06 20 08 ld [ %i0 + 8 ], %g3 (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) || 200751c: 80 a0 e0 00 cmp %g3, 0 2007520: 02 80 00 0b be 200754c <_TOD_Validate+0xc0> <== NEVER TAKEN 2007524: 80 88 a0 03 btst 3, %g2 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 2007528: 32 80 00 0c bne,a 2007558 <_TOD_Validate+0xcc> 200752c: 83 28 60 02 sll %g1, 2, %g1 days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 2007530: 82 00 60 0d add %g1, 0xd, %g1 2007534: 05 00 80 77 sethi %hi(0x201dc00), %g2 2007538: 83 28 60 02 sll %g1, 2, %g1 200753c: 84 10 a2 60 or %g2, 0x260, %g2 2007540: c2 00 80 01 ld [ %g2 + %g1 ], %g1 * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 2007544: 80 a0 40 03 cmp %g1, %g3 2007548: ba 60 3f ff subx %g0, -1, %i5 if ( the_tod->day > days_in_month ) return false; return true; } 200754c: b0 0f 60 01 and %i5, 1, %i0 2007550: 81 c7 e0 08 ret 2007554: 81 e8 00 00 restore return false; if ( (the_tod->year % 4) == 0 ) days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 2007558: 05 00 80 77 sethi %hi(0x201dc00), %g2 200755c: 84 10 a2 60 or %g2, 0x260, %g2 ! 201de60 <_TOD_Days_per_month> 2007560: c2 00 80 01 ld [ %g2 + %g1 ], %g1 * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 2007564: 80 a0 40 03 cmp %g1, %g3 2007568: 10 bf ff f9 b 200754c <_TOD_Validate+0xc0> 200756c: ba 60 3f ff subx %g0, -1, %i5 =============================================================================== 02008d94 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 2008d94: 9d e3 bf a0 save %sp, -96, %sp States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 2008d98: f8 06 20 10 ld [ %i0 + 0x10 ], %i4 /* * 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 ); 2008d9c: 40 00 03 a9 call 2009c40 <_Thread_Set_transient> 2008da0: 90 10 00 18 mov %i0, %o0 /* * Do not bother recomputing all the priority related information if * we are not REALLY changing priority. */ if ( the_thread->current_priority != new_priority ) 2008da4: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 2008da8: 80 a0 40 19 cmp %g1, %i1 2008dac: 02 80 00 05 be 2008dc0 <_Thread_Change_priority+0x2c> 2008db0: ba 10 00 18 mov %i0, %i5 _Thread_Set_priority( the_thread, new_priority ); 2008db4: 90 10 00 18 mov %i0, %o0 2008db8: 40 00 03 88 call 2009bd8 <_Thread_Set_priority> 2008dbc: 92 10 00 19 mov %i1, %o1 _ISR_Disable( level ); 2008dc0: 7f ff e4 f2 call 2002188 2008dc4: 01 00 00 00 nop 2008dc8: b2 10 00 08 mov %o0, %i1 /* * 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; 2008dcc: f6 07 60 10 ld [ %i5 + 0x10 ], %i3 if ( state != STATES_TRANSIENT ) { 2008dd0: 80 a6 e0 04 cmp %i3, 4 2008dd4: 02 80 00 18 be 2008e34 <_Thread_Change_priority+0xa0> 2008dd8: 80 8f 20 04 btst 4, %i4 /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 2008ddc: 02 80 00 0b be 2008e08 <_Thread_Change_priority+0x74> <== ALWAYS TAKEN 2008de0: 82 0e ff fb and %i3, -5, %g1 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 2008de4: 7f ff e4 ed call 2002198 <== NOT EXECUTED 2008de8: 90 10 00 19 mov %i1, %o0 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 2008dec: 03 00 00 ef sethi %hi(0x3bc00), %g1 <== NOT EXECUTED 2008df0: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 <== NOT EXECUTED if ( _States_Is_waiting_on_thread_queue( state ) ) { 2008df4: 80 8e c0 01 btst %i3, %g1 <== NOT EXECUTED 2008df8: 32 80 00 0d bne,a 2008e2c <_Thread_Change_priority+0x98> <== NOT EXECUTED 2008dfc: f0 07 60 44 ld [ %i5 + 0x44 ], %i0 <== NOT EXECUTED 2008e00: 81 c7 e0 08 ret 2008e04: 81 e8 00 00 restore */ state = the_thread->current_state; if ( state != STATES_TRANSIENT ) { /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 2008e08: c2 27 60 10 st %g1, [ %i5 + 0x10 ] _ISR_Enable( level ); 2008e0c: 7f ff e4 e3 call 2002198 2008e10: 90 10 00 19 mov %i1, %o0 2008e14: 03 00 00 ef sethi %hi(0x3bc00), %g1 2008e18: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 2008e1c: 80 8e c0 01 btst %i3, %g1 2008e20: 02 bf ff f8 be 2008e00 <_Thread_Change_priority+0x6c> 2008e24: 01 00 00 00 nop _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 2008e28: f0 07 60 44 ld [ %i5 + 0x44 ], %i0 2008e2c: 40 00 03 3a call 2009b14 <_Thread_queue_Requeue> 2008e30: 93 e8 00 1d restore %g0, %i5, %o1 2008e34: 39 00 80 73 sethi %hi(0x201cc00), %i4 } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 2008e38: 12 80 00 08 bne 2008e58 <_Thread_Change_priority+0xc4> <== NEVER TAKEN 2008e3c: b8 17 20 d4 or %i4, 0xd4, %i4 ! 201ccd4 <_Scheduler> * 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 ); if ( prepend_it ) 2008e40: 80 a6 a0 00 cmp %i2, 0 2008e44: 02 80 00 1b be 2008eb0 <_Thread_Change_priority+0x11c> 2008e48: c0 27 60 10 clr [ %i5 + 0x10 ] */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 2008e4c: c2 07 20 28 ld [ %i4 + 0x28 ], %g1 2008e50: 9f c0 40 00 call %g1 2008e54: 90 10 00 1d mov %i5, %o0 _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 2008e58: 7f ff e4 d0 call 2002198 2008e5c: 90 10 00 19 mov %i1, %o0 2008e60: 7f ff e4 ca call 2002188 2008e64: 01 00 00 00 nop 2008e68: b0 10 00 08 mov %o0, %i0 * This kernel routine implements the scheduling decision logic for * the scheduler. It does NOT dispatch. */ RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( void ) { _Scheduler.Operations.schedule(); 2008e6c: c2 07 20 08 ld [ %i4 + 8 ], %g1 2008e70: 9f c0 40 00 call %g1 2008e74: 01 00 00 00 nop * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 2008e78: 03 00 80 77 sethi %hi(0x201dc00), %g1 2008e7c: 82 10 62 88 or %g1, 0x288, %g1 ! 201de88 <_Per_CPU_Information> 2008e80: c4 00 60 0c ld [ %g1 + 0xc ], %g2 * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Scheduler_Schedule(); if ( !_Thread_Is_executing_also_the_heir() && 2008e84: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 2008e88: 80 a0 80 03 cmp %g2, %g3 2008e8c: 02 80 00 07 be 2008ea8 <_Thread_Change_priority+0x114> 2008e90: 01 00 00 00 nop 2008e94: c4 08 a0 74 ldub [ %g2 + 0x74 ], %g2 2008e98: 80 a0 a0 00 cmp %g2, 0 2008e9c: 02 80 00 03 be 2008ea8 <_Thread_Change_priority+0x114> 2008ea0: 84 10 20 01 mov 1, %g2 _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 2008ea4: c4 28 60 18 stb %g2, [ %g1 + 0x18 ] _ISR_Enable( level ); 2008ea8: 7f ff e4 bc call 2002198 2008eac: 81 e8 00 00 restore */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 2008eb0: c2 07 20 24 ld [ %i4 + 0x24 ], %g1 2008eb4: 9f c0 40 00 call %g1 2008eb8: 90 10 00 1d mov %i5, %o0 2008ebc: 30 bf ff e7 b,a 2008e58 <_Thread_Change_priority+0xc4> =============================================================================== 020090d8 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 20090d8: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 20090dc: 90 10 00 18 mov %i0, %o0 20090e0: 40 00 00 77 call 20092bc <_Thread_Get> 20090e4: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 20090e8: c2 07 bf fc ld [ %fp + -4 ], %g1 20090ec: 80 a0 60 00 cmp %g1, 0 20090f0: 12 80 00 09 bne 2009114 <_Thread_Delay_ended+0x3c> <== NEVER TAKEN 20090f4: 13 04 00 00 sethi %hi(0x10000000), %o1 #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 20090f8: 7f ff ff 72 call 2008ec0 <_Thread_Clear_state> 20090fc: 92 12 60 18 or %o1, 0x18, %o1 ! 10000018 /** * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 2009100: 03 00 80 76 sethi %hi(0x201d800), %g1 2009104: c4 00 61 50 ld [ %g1 + 0x150 ], %g2 ! 201d950 <_Thread_Dispatch_disable_level> 2009108: 84 00 bf ff add %g2, -1, %g2 200910c: c4 20 61 50 st %g2, [ %g1 + 0x150 ] return _Thread_Dispatch_disable_level; 2009110: c2 00 61 50 ld [ %g1 + 0x150 ], %g1 2009114: 81 c7 e0 08 ret 2009118: 81 e8 00 00 restore =============================================================================== 0200911c <_Thread_Dispatch>: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 200911c: 9d e3 bf 90 save %sp, -112, %sp Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 2009120: 37 00 80 77 sethi %hi(0x201dc00), %i3 2009124: b6 16 e2 88 or %i3, 0x288, %i3 ! 201de88 <_Per_CPU_Information> _ISR_Disable( level ); 2009128: 7f ff e4 18 call 2002188 200912c: fa 06 e0 0c ld [ %i3 + 0xc ], %i5 while ( _Thread_Dispatch_necessary == true ) { 2009130: c2 0e e0 18 ldub [ %i3 + 0x18 ], %g1 2009134: 80 a0 60 00 cmp %g1, 0 2009138: 02 80 00 4e be 2009270 <_Thread_Dispatch+0x154> 200913c: 31 00 80 76 sethi %hi(0x201d800), %i0 heir = _Thread_Heir; 2009140: f8 06 e0 10 ld [ %i3 + 0x10 ], %i4 * This routine sets thread dispatch level to the * value passed in. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_set_disable_level(uint32_t value) { _Thread_Dispatch_disable_level = value; 2009144: 82 10 20 01 mov 1, %g1 2009148: c2 26 21 50 st %g1, [ %i0 + 0x150 ] _Thread_Dispatch_set_disable_level( 1 ); _Thread_Dispatch_necessary = false; 200914c: c0 2e e0 18 clrb [ %i3 + 0x18 ] /* * 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 ) 2009150: 80 a7 40 1c cmp %i5, %i4 2009154: 02 80 00 47 be 2009270 <_Thread_Dispatch+0x154> 2009158: f8 26 e0 0c st %i4, [ %i3 + 0xc ] 200915c: 35 00 80 76 sethi %hi(0x201d800), %i2 2009160: 23 00 80 76 sethi %hi(0x201d800), %l1 2009164: b4 16 a2 00 or %i2, 0x200, %i2 2009168: a2 14 61 d8 or %l1, 0x1d8, %l1 #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; 200916c: 27 00 80 76 sethi %hi(0x201d800), %l3 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 2009170: a0 10 00 1a mov %i2, %l0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Allocated_fp ); 2009174: 33 00 80 76 sethi %hi(0x201d800), %i1 * This routine sets thread dispatch level to the * value passed in. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_set_disable_level(uint32_t value) { _Thread_Dispatch_disable_level = value; 2009178: 10 80 00 38 b 2009258 <_Thread_Dispatch+0x13c> 200917c: a4 10 20 01 mov 1, %l2 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; _ISR_Enable( level ); 2009180: 7f ff e4 06 call 2002198 2009184: 01 00 00 00 nop #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 2009188: 40 00 10 71 call 200d34c <_TOD_Get_uptime> 200918c: 90 07 bf f0 add %fp, -16, %o0 _Timestamp_Subtract( 2009190: 90 10 00 10 mov %l0, %o0 2009194: 92 07 bf f0 add %fp, -16, %o1 2009198: 40 00 03 52 call 2009ee0 <_Timespec_Subtract> 200919c: 94 07 bf f8 add %fp, -8, %o2 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 20091a0: 90 07 60 84 add %i5, 0x84, %o0 20091a4: 40 00 03 36 call 2009e7c <_Timespec_Add_to> 20091a8: 92 07 bf f8 add %fp, -8, %o1 _Thread_Time_of_last_context_switch = uptime; 20091ac: c4 07 bf f0 ld [ %fp + -16 ], %g2 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 20091b0: c2 04 40 00 ld [ %l1 ], %g1 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 20091b4: c4 26 80 00 st %g2, [ %i2 ] 20091b8: c4 07 bf f4 ld [ %fp + -12 ], %g2 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 20091bc: 80 a0 60 00 cmp %g1, 0 20091c0: 02 80 00 06 be 20091d8 <_Thread_Dispatch+0xbc> <== NEVER TAKEN 20091c4: c4 26 a0 04 st %g2, [ %i2 + 4 ] executing->libc_reent = *_Thread_libc_reent; 20091c8: c4 00 40 00 ld [ %g1 ], %g2 20091cc: c4 27 61 54 st %g2, [ %i5 + 0x154 ] *_Thread_libc_reent = heir->libc_reent; 20091d0: c4 07 21 54 ld [ %i4 + 0x154 ], %g2 20091d4: c4 20 40 00 st %g2, [ %g1 ] } _User_extensions_Thread_switch( executing, heir ); 20091d8: 90 10 00 1d mov %i5, %o0 20091dc: 40 00 04 05 call 200a1f0 <_User_extensions_Thread_switch> 20091e0: 92 10 00 1c mov %i4, %o1 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 20091e4: 90 07 60 c8 add %i5, 0xc8, %o0 20091e8: 40 00 05 49 call 200a70c <_CPU_Context_switch> 20091ec: 92 07 20 c8 add %i4, 0xc8, %o1 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 20091f0: c2 07 61 50 ld [ %i5 + 0x150 ], %g1 20091f4: 80 a0 60 00 cmp %g1, 0 20091f8: 02 80 00 0c be 2009228 <_Thread_Dispatch+0x10c> 20091fc: d0 06 61 d4 ld [ %i1 + 0x1d4 ], %o0 2009200: 80 a7 40 08 cmp %i5, %o0 2009204: 02 80 00 09 be 2009228 <_Thread_Dispatch+0x10c> 2009208: 80 a2 20 00 cmp %o0, 0 !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 200920c: 02 80 00 04 be 200921c <_Thread_Dispatch+0x100> 2009210: 01 00 00 00 nop _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 2009214: 40 00 05 04 call 200a624 <_CPU_Context_save_fp> 2009218: 90 02 21 50 add %o0, 0x150, %o0 _Context_Restore_fp( &executing->fp_context ); 200921c: 40 00 05 1f call 200a698 <_CPU_Context_restore_fp> 2009220: 90 07 61 50 add %i5, 0x150, %o0 _Thread_Allocated_fp = executing; 2009224: fa 26 61 d4 st %i5, [ %i1 + 0x1d4 ] #endif #endif executing = _Thread_Executing; _ISR_Disable( level ); 2009228: 7f ff e3 d8 call 2002188 200922c: fa 06 e0 0c ld [ %i3 + 0xc ], %i5 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 2009230: c2 0e e0 18 ldub [ %i3 + 0x18 ], %g1 2009234: 80 a0 60 00 cmp %g1, 0 2009238: 02 80 00 0e be 2009270 <_Thread_Dispatch+0x154> 200923c: 01 00 00 00 nop heir = _Thread_Heir; 2009240: f8 06 e0 10 ld [ %i3 + 0x10 ], %i4 2009244: e4 26 21 50 st %l2, [ %i0 + 0x150 ] _Thread_Dispatch_set_disable_level( 1 ); _Thread_Dispatch_necessary = false; 2009248: c0 2e e0 18 clrb [ %i3 + 0x18 ] /* * 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 ) 200924c: 80 a7 00 1d cmp %i4, %i5 2009250: 02 80 00 08 be 2009270 <_Thread_Dispatch+0x154> <== NEVER TAKEN 2009254: f8 26 e0 0c st %i4, [ %i3 + 0xc ] */ #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 ) 2009258: c2 07 20 7c ld [ %i4 + 0x7c ], %g1 200925c: 80 a0 60 01 cmp %g1, 1 2009260: 12 bf ff c8 bne 2009180 <_Thread_Dispatch+0x64> 2009264: c2 04 e0 b4 ld [ %l3 + 0xb4 ], %g1 heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 2009268: 10 bf ff c6 b 2009180 <_Thread_Dispatch+0x64> 200926c: c2 27 20 78 st %g1, [ %i4 + 0x78 ] 2009270: c0 26 21 50 clr [ %i0 + 0x150 ] } post_switch: _Thread_Dispatch_set_disable_level( 0 ); _ISR_Enable( level ); 2009274: 7f ff e3 c9 call 2002198 2009278: 01 00 00 00 nop _API_extensions_Run_postswitch(); 200927c: 7f ff f7 fc call 200726c <_API_extensions_Run_postswitch> 2009280: 01 00 00 00 nop } 2009284: 81 c7 e0 08 ret 2009288: 81 e8 00 00 restore =============================================================================== 0200f6c4 <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 200f6c4: 9d e3 bf a0 save %sp, -96, %sp #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 200f6c8: 03 00 80 77 sethi %hi(0x201dc00), %g1 200f6cc: fa 00 62 94 ld [ %g1 + 0x294 ], %i5 ! 201de94 <_Per_CPU_Information+0xc> /* * Some CPUs need to tinker with the call frame or registers when the * thread actually begins to execute for the first time. This is a * hook point where the port gets a shot at doing whatever it requires. */ _Context_Initialization_at_thread_begin(); 200f6d0: 3f 00 80 3d sethi %hi(0x200f400), %i7 200f6d4: be 17 e2 c4 or %i7, 0x2c4, %i7 ! 200f6c4 <_Thread_Handler> /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 200f6d8: d0 07 60 ac ld [ %i5 + 0xac ], %o0 _ISR_Set_level(level); 200f6dc: 7f ff ca af call 2002198 200f6e0: 91 2a 20 08 sll %o0, 8, %o0 doneConstructors = 1; #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 200f6e4: c4 07 61 50 ld [ %i5 + 0x150 ], %g2 level = executing->Start.isr_level; _ISR_Set_level(level); #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 200f6e8: 03 00 80 75 sethi %hi(0x201d400), %g1 doneConstructors = 1; 200f6ec: 86 10 20 01 mov 1, %g3 level = executing->Start.isr_level; _ISR_Set_level(level); #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 200f6f0: f6 08 62 0c ldub [ %g1 + 0x20c ], %i3 doneConstructors = 1; #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 200f6f4: 80 a0 a0 00 cmp %g2, 0 200f6f8: 02 80 00 0c be 200f728 <_Thread_Handler+0x64> 200f6fc: c6 28 62 0c stb %g3, [ %g1 + 0x20c ] #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Allocated_fp ); 200f700: 39 00 80 76 sethi %hi(0x201d800), %i4 200f704: d0 07 21 d4 ld [ %i4 + 0x1d4 ], %o0 ! 201d9d4 <_Thread_Allocated_fp> 200f708: 80 a7 40 08 cmp %i5, %o0 200f70c: 02 80 00 07 be 200f728 <_Thread_Handler+0x64> 200f710: 80 a2 20 00 cmp %o0, 0 !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 200f714: 22 80 00 05 be,a 200f728 <_Thread_Handler+0x64> 200f718: fa 27 21 d4 st %i5, [ %i4 + 0x1d4 ] _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 200f71c: 7f ff eb c2 call 200a624 <_CPU_Context_save_fp> 200f720: 90 02 21 50 add %o0, 0x150, %o0 _Thread_Allocated_fp = executing; 200f724: fa 27 21 d4 st %i5, [ %i4 + 0x1d4 ] /* * 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 ); 200f728: 7f ff ea 30 call 2009fe8 <_User_extensions_Thread_begin> 200f72c: 90 10 00 1d mov %i5, %o0 /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 200f730: 7f ff e6 d7 call 200928c <_Thread_Enable_dispatch> 200f734: b7 2e e0 18 sll %i3, 0x18, %i3 /* * _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) */ { 200f738: 80 a6 e0 00 cmp %i3, 0 200f73c: 02 80 00 0e be 200f774 <_Thread_Handler+0xb0> 200f740: 01 00 00 00 nop INIT_NAME (); } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 200f744: c2 07 60 94 ld [ %i5 + 0x94 ], %g1 200f748: 80 a0 60 00 cmp %g1, 0 200f74c: 02 80 00 0e be 200f784 <_Thread_Handler+0xc0> 200f750: 80 a0 60 01 cmp %g1, 1 (*(Thread_Entry_numeric) executing->Start.entry_point)( executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 200f754: 22 80 00 11 be,a 200f798 <_Thread_Handler+0xd4> <== ALWAYS TAKEN 200f758: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 * 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 ); 200f75c: 7f ff ea 37 call 200a038 <_User_extensions_Thread_exitted> 200f760: 90 10 00 1d mov %i5, %o0 _Internal_error_Occurred( 200f764: 90 10 20 00 clr %o0 200f768: 92 10 20 01 mov 1, %o1 200f76c: 7f ff e1 88 call 2007d8c <_Internal_error_Occurred> 200f770: 94 10 20 05 mov 5, %o2 * _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) */ { INIT_NAME (); 200f774: 40 00 35 0f call 201cbb0 <_init> 200f778: 01 00 00 00 nop } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 200f77c: 10 bf ff f3 b 200f748 <_Thread_Handler+0x84> 200f780: c2 07 60 94 ld [ %i5 + 0x94 ], %g1 executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 200f784: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 200f788: 9f c0 40 00 call %g1 200f78c: d0 07 60 9c ld [ %i5 + 0x9c ], %o0 INIT_NAME (); } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 200f790: 10 bf ff f3 b 200f75c <_Thread_Handler+0x98> 200f794: d0 27 60 28 st %o0, [ %i5 + 0x28 ] ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 200f798: 9f c0 40 00 call %g1 200f79c: d0 07 60 98 ld [ %i5 + 0x98 ], %o0 executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 200f7a0: 10 bf ff ef b 200f75c <_Thread_Handler+0x98> 200f7a4: d0 27 60 28 st %o0, [ %i5 + 0x28 ] =============================================================================== 0200936c <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 200936c: 9d e3 bf a0 save %sp, -96, %sp 2009370: c2 07 a0 6c ld [ %fp + 0x6c ], %g1 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 2009374: c0 26 61 58 clr [ %i1 + 0x158 ] 2009378: c0 26 61 5c clr [ %i1 + 0x15c ] extensions_area = NULL; the_thread->libc_reent = NULL; 200937c: c0 26 61 54 clr [ %i1 + 0x154 ] Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 2009380: e0 07 a0 60 ld [ %fp + 0x60 ], %l0 2009384: e4 00 40 00 ld [ %g1 ], %l2 if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { 2009388: 80 a6 a0 00 cmp %i2, 0 200938c: 02 80 00 6b be 2009538 <_Thread_Initialize+0x1cc> 2009390: e2 0f a0 5f ldub [ %fp + 0x5f ], %l1 stack = the_thread->Start.stack; the_thread->Start.core_allocated_stack = true; } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; 2009394: c0 2e 60 b4 clrb [ %i1 + 0xb4 ] 2009398: 90 10 00 1b mov %i3, %o0 Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 200939c: f4 26 60 bc st %i2, [ %i1 + 0xbc ] the_stack->size = size; 20093a0: d0 26 60 b8 st %o0, [ %i1 + 0xb8 ] /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { 20093a4: 80 a7 20 00 cmp %i4, 0 20093a8: 12 80 00 48 bne 20094c8 <_Thread_Initialize+0x15c> 20093ac: b6 10 20 00 clr %i3 #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 20093b0: 39 00 80 76 sethi %hi(0x201d800), %i4 20093b4: c2 07 21 e4 ld [ %i4 + 0x1e4 ], %g1 ! 201d9e4 <_Thread_Maximum_extensions> fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); if ( !fp_area ) goto failed; fp_area = _Context_Fp_start( fp_area, 0 ); } the_thread->fp_context = fp_area; 20093b8: f6 26 61 50 st %i3, [ %i1 + 0x150 ] the_thread->Start.fp_context = fp_area; 20093bc: f6 26 60 c0 st %i3, [ %i1 + 0xc0 ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 20093c0: c0 26 60 50 clr [ %i1 + 0x50 ] the_watchdog->routine = routine; 20093c4: c0 26 60 64 clr [ %i1 + 0x64 ] the_watchdog->id = id; 20093c8: c0 26 60 68 clr [ %i1 + 0x68 ] #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 20093cc: 80 a0 60 00 cmp %g1, 0 20093d0: 12 80 00 46 bne 20094e8 <_Thread_Initialize+0x17c> 20093d4: c0 26 60 6c clr [ %i1 + 0x6c ] (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) goto failed; } the_thread->extensions = (void **) extensions_area; 20093d8: c0 26 61 60 clr [ %i1 + 0x160 ] * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; extensions_area = NULL; 20093dc: b4 10 20 00 clr %i2 * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 20093e0: c2 07 a0 64 ld [ %fp + 0x64 ], %g1 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 20093e4: e2 2e 60 a0 stb %l1, [ %i1 + 0xa0 ] the_thread->Start.budget_algorithm = budget_algorithm; 20093e8: e0 26 60 a4 st %l0, [ %i1 + 0xa4 ] the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 20093ec: 80 a4 20 02 cmp %l0, 2 20093f0: 12 80 00 05 bne 2009404 <_Thread_Initialize+0x98> 20093f4: c2 26 60 a8 st %g1, [ %i1 + 0xa8 ] case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 20093f8: 03 00 80 76 sethi %hi(0x201d800), %g1 20093fc: c2 00 60 b4 ld [ %g1 + 0xb4 ], %g1 ! 201d8b4 <_Thread_Ticks_per_timeslice> 2009400: c2 26 60 78 st %g1, [ %i1 + 0x78 ] case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 2009404: c4 07 a0 68 ld [ %fp + 0x68 ], %g2 */ RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate( Thread_Control *the_thread ) { return _Scheduler.Operations.allocate( the_thread ); 2009408: 03 00 80 73 sethi %hi(0x201cc00), %g1 200940c: c2 00 60 ec ld [ %g1 + 0xec ], %g1 ! 201ccec <_Scheduler+0x18> 2009410: c4 26 60 ac st %g2, [ %i1 + 0xac ] the_thread->current_state = STATES_DORMANT; 2009414: 84 10 20 01 mov 1, %g2 the_thread->Wait.queue = NULL; 2009418: c0 26 60 44 clr [ %i1 + 0x44 ] #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 200941c: c4 26 60 10 st %g2, [ %i1 + 0x10 ] the_thread->Wait.queue = NULL; the_thread->resource_count = 0; 2009420: c0 26 60 1c clr [ %i1 + 0x1c ] the_thread->real_priority = priority; 2009424: fa 26 60 18 st %i5, [ %i1 + 0x18 ] the_thread->Start.initial_priority = priority; 2009428: fa 26 60 b0 st %i5, [ %i1 + 0xb0 ] 200942c: 9f c0 40 00 call %g1 2009430: 90 10 00 19 mov %i1, %o0 sched =_Scheduler_Allocate( the_thread ); if ( !sched ) 2009434: b8 92 20 00 orcc %o0, 0, %i4 2009438: 22 80 00 13 be,a 2009484 <_Thread_Initialize+0x118> 200943c: d0 06 61 54 ld [ %i1 + 0x154 ], %o0 goto failed; _Thread_Set_priority( the_thread, priority ); 2009440: 90 10 00 19 mov %i1, %o0 2009444: 40 00 01 e5 call 2009bd8 <_Thread_Set_priority> 2009448: 92 10 00 1d mov %i5, %o1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 200944c: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 2009450: c2 16 60 0a lduh [ %i1 + 0xa ], %g1 /* * Initialize the CPU usage statistics */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Set_to_zero( &the_thread->cpu_time_used ); 2009454: c0 26 60 84 clr [ %i1 + 0x84 ] 2009458: c0 26 60 88 clr [ %i1 + 0x88 ] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 200945c: 83 28 60 02 sll %g1, 2, %g1 2009460: f2 20 80 01 st %i1, [ %g2 + %g1 ] information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 2009464: e4 26 60 0c st %l2, [ %i1 + 0xc ] * 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 ); 2009468: 90 10 00 19 mov %i1, %o0 200946c: 40 00 03 1a call 200a0d4 <_User_extensions_Thread_create> 2009470: b0 10 20 01 mov 1, %i0 if ( extension_status ) 2009474: 80 8a 20 ff btst 0xff, %o0 2009478: 32 80 00 12 bne,a 20094c0 <_Thread_Initialize+0x154> 200947c: b0 0e 20 01 and %i0, 1, %i0 return true; failed: _Workspace_Free( the_thread->libc_reent ); 2009480: d0 06 61 54 ld [ %i1 + 0x154 ], %o0 2009484: 40 00 04 53 call 200a5d0 <_Workspace_Free> 2009488: b0 10 20 00 clr %i0 for ( i=0 ; i <= THREAD_API_LAST ; i++ ) _Workspace_Free( the_thread->API_Extensions[i] ); 200948c: 40 00 04 51 call 200a5d0 <_Workspace_Free> 2009490: d0 06 61 58 ld [ %i1 + 0x158 ], %o0 2009494: 40 00 04 4f call 200a5d0 <_Workspace_Free> 2009498: d0 06 61 5c ld [ %i1 + 0x15c ], %o0 _Workspace_Free( extensions_area ); 200949c: 40 00 04 4d call 200a5d0 <_Workspace_Free> 20094a0: 90 10 00 1a mov %i2, %o0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); 20094a4: 40 00 04 4b call 200a5d0 <_Workspace_Free> 20094a8: 90 10 00 1b mov %i3, %o0 #endif _Workspace_Free( sched ); 20094ac: 40 00 04 49 call 200a5d0 <_Workspace_Free> 20094b0: 90 10 00 1c mov %i4, %o0 _Thread_Stack_Free( the_thread ); 20094b4: 40 00 02 0d call 2009ce8 <_Thread_Stack_Free> 20094b8: 90 10 00 19 mov %i1, %o0 return false; } 20094bc: b0 0e 20 01 and %i0, 1, %i0 20094c0: 81 c7 e0 08 ret 20094c4: 81 e8 00 00 restore /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); 20094c8: 40 00 04 3a call 200a5b0 <_Workspace_Allocate> 20094cc: 90 10 20 88 mov 0x88, %o0 if ( !fp_area ) 20094d0: b6 92 20 00 orcc %o0, 0, %i3 20094d4: 32 bf ff b8 bne,a 20093b4 <_Thread_Initialize+0x48> 20094d8: 39 00 80 76 sethi %hi(0x201d800), %i4 * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; extensions_area = NULL; 20094dc: b4 10 20 00 clr %i2 size_t actual_stack_size = 0; void *stack = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) void *fp_area; #endif void *sched = NULL; 20094e0: 10 bf ff e8 b 2009480 <_Thread_Initialize+0x114> 20094e4: b8 10 20 00 clr %i4 /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( 20094e8: 82 00 60 01 inc %g1 20094ec: 40 00 04 31 call 200a5b0 <_Workspace_Allocate> 20094f0: 91 28 60 02 sll %g1, 2, %o0 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 20094f4: b4 92 20 00 orcc %o0, 0, %i2 20094f8: 02 80 00 1d be 200956c <_Thread_Initialize+0x200> 20094fc: 86 10 00 1a mov %i2, %g3 goto failed; } the_thread->extensions = (void **) extensions_area; 2009500: f4 26 61 60 st %i2, [ %i1 + 0x160 ] 2009504: c8 07 21 e4 ld [ %i4 + 0x1e4 ], %g4 * 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++ ) 2009508: 84 10 20 00 clr %g2 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) goto failed; } the_thread->extensions = (void **) extensions_area; 200950c: 10 80 00 03 b 2009518 <_Thread_Initialize+0x1ac> 2009510: 82 10 20 00 clr %g1 2009514: c6 06 61 60 ld [ %i1 + 0x160 ], %g3 * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) the_thread->extensions[i] = NULL; 2009518: 85 28 a0 02 sll %g2, 2, %g2 200951c: c0 20 c0 02 clr [ %g3 + %g2 ] * 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++ ) 2009520: 82 00 60 01 inc %g1 2009524: 80 a0 40 04 cmp %g1, %g4 2009528: 08 bf ff fb bleu 2009514 <_Thread_Initialize+0x1a8> 200952c: 84 10 00 01 mov %g1, %g2 * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 2009530: 10 bf ff ad b 20093e4 <_Thread_Initialize+0x78> 2009534: c2 07 a0 64 ld [ %fp + 0x64 ], %g1 return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 2009538: 90 10 00 19 mov %i1, %o0 200953c: 40 00 01 d0 call 2009c7c <_Thread_Stack_Allocate> 2009540: 92 10 00 1b mov %i3, %o1 if ( !actual_stack_size || actual_stack_size < stack_size ) 2009544: 80 a2 00 1b cmp %o0, %i3 2009548: 0a 80 00 07 bcs 2009564 <_Thread_Initialize+0x1f8> 200954c: 80 a2 20 00 cmp %o0, 0 2009550: 02 80 00 05 be 2009564 <_Thread_Initialize+0x1f8> <== NEVER TAKEN 2009554: 82 10 20 01 mov 1, %g1 return false; /* stack allocation failed */ stack = the_thread->Start.stack; 2009558: f4 06 60 c4 ld [ %i1 + 0xc4 ], %i2 the_thread->Start.core_allocated_stack = true; 200955c: 10 bf ff 90 b 200939c <_Thread_Initialize+0x30> 2009560: c2 2e 60 b4 stb %g1, [ %i1 + 0xb4 ] stack = the_thread->Start.stack; #else if ( !stack_area ) { actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ 2009564: 10 bf ff d6 b 20094bc <_Thread_Initialize+0x150> 2009568: b0 10 20 00 clr %i0 size_t actual_stack_size = 0; void *stack = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) void *fp_area; #endif void *sched = NULL; 200956c: 10 bf ff c5 b 2009480 <_Thread_Initialize+0x114> 2009570: b8 10 20 00 clr %i4 =============================================================================== 02009dc8 <_Thread_Tickle_timeslice>: * * Output parameters: NONE */ void _Thread_Tickle_timeslice( void ) { 2009dc8: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *executing; executing = _Thread_Executing; 2009dcc: 03 00 80 77 sethi %hi(0x201dc00), %g1 2009dd0: d0 00 62 94 ld [ %g1 + 0x294 ], %o0 ! 201de94 <_Per_CPU_Information+0xc> /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 2009dd4: c2 0a 20 74 ldub [ %o0 + 0x74 ], %g1 2009dd8: 80 a0 60 00 cmp %g1, 0 2009ddc: 02 80 00 26 be 2009e74 <_Thread_Tickle_timeslice+0xac> 2009de0: 01 00 00 00 nop return; if ( !_States_Is_ready( executing->current_state ) ) 2009de4: c2 02 20 10 ld [ %o0 + 0x10 ], %g1 2009de8: 80 a0 60 00 cmp %g1, 0 2009dec: 12 80 00 22 bne 2009e74 <_Thread_Tickle_timeslice+0xac> 2009df0: 01 00 00 00 nop /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 2009df4: c2 02 20 7c ld [ %o0 + 0x7c ], %g1 2009df8: 80 a0 60 01 cmp %g1, 1 2009dfc: 0a 80 00 07 bcs 2009e18 <_Thread_Tickle_timeslice+0x50> 2009e00: 80 a0 60 02 cmp %g1, 2 2009e04: 28 80 00 10 bleu,a 2009e44 <_Thread_Tickle_timeslice+0x7c> 2009e08: c2 02 20 78 ld [ %o0 + 0x78 ], %g1 2009e0c: 80 a0 60 03 cmp %g1, 3 2009e10: 22 80 00 04 be,a 2009e20 <_Thread_Tickle_timeslice+0x58> <== ALWAYS TAKEN 2009e14: c2 02 20 78 ld [ %o0 + 0x78 ], %g1 2009e18: 81 c7 e0 08 ret 2009e1c: 81 e8 00 00 restore } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 2009e20: 82 00 7f ff add %g1, -1, %g1 2009e24: 80 a0 60 00 cmp %g1, 0 2009e28: 12 bf ff fc bne 2009e18 <_Thread_Tickle_timeslice+0x50> 2009e2c: c2 22 20 78 st %g1, [ %o0 + 0x78 ] (*executing->budget_callout)( executing ); 2009e30: c2 02 20 80 ld [ %o0 + 0x80 ], %g1 2009e34: 9f c0 40 00 call %g1 2009e38: 01 00 00 00 nop 2009e3c: 81 c7 e0 08 ret 2009e40: 81 e8 00 00 restore case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: #endif if ( (int)(--executing->cpu_time_budget) <= 0 ) { 2009e44: 82 00 7f ff add %g1, -1, %g1 2009e48: 80 a0 60 00 cmp %g1, 0 2009e4c: 14 bf ff f3 bg 2009e18 <_Thread_Tickle_timeslice+0x50> 2009e50: c2 22 20 78 st %g1, [ %o0 + 0x78 ] * always operates on the scheduler that 'owns' the currently executing * thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void ) { _Scheduler.Operations.yield(); 2009e54: 03 00 80 73 sethi %hi(0x201cc00), %g1 2009e58: c2 00 60 e0 ld [ %g1 + 0xe0 ], %g1 ! 201cce0 <_Scheduler+0xc> 2009e5c: 9f c0 40 00 call %g1 2009e60: d0 27 bf fc st %o0, [ %fp + -4 ] * executing thread's timeslice is reset. Otherwise, the * currently executing thread is placed at the rear of the * FIFO for this priority and a new heir is selected. */ _Scheduler_Yield( ); executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 2009e64: 03 00 80 76 sethi %hi(0x201d800), %g1 2009e68: d0 07 bf fc ld [ %fp + -4 ], %o0 2009e6c: c2 00 60 b4 ld [ %g1 + 0xb4 ], %g1 2009e70: c2 22 20 78 st %g1, [ %o0 + 0x78 ] 2009e74: 81 c7 e0 08 ret 2009e78: 81 e8 00 00 restore =============================================================================== 0200985c <_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 ) { 200985c: 9d e3 bf a0 save %sp, -96, %sp Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 2009860: fa 06 60 14 ld [ %i1 + 0x14 ], %i5 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 2009864: 82 06 60 38 add %i1, 0x38, %g1 2009868: 84 06 60 3c add %i1, 0x3c, %g2 head->next = tail; head->previous = NULL; tail->previous = head; 200986c: c2 26 60 40 st %g1, [ %i1 + 0x40 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 2009870: c4 26 60 38 st %g2, [ %i1 + 0x38 ] head->previous = NULL; 2009874: c0 26 60 3c clr [ %i1 + 0x3c ] Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 2009878: b8 10 00 18 mov %i0, %i4 RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number ( Priority_Control the_priority ) { return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER); 200987c: 83 37 60 06 srl %i5, 6, %g1 2009880: 25 00 80 73 sethi %hi(0x201cc00), %l2 _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 ]; 2009884: 85 28 60 02 sll %g1, 2, %g2 block_state = the_thread_queue->state; 2009888: f0 06 20 38 ld [ %i0 + 0x38 ], %i0 _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 ]; 200988c: 83 28 60 04 sll %g1, 4, %g1 2009890: a4 14 a0 2c or %l2, 0x2c, %l2 2009894: 82 20 40 02 sub %g1, %g2, %g1 block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 2009898: 80 8f 60 20 btst 0x20, %i5 200989c: 12 80 00 26 bne 2009934 <_Thread_queue_Enqueue_priority+0xd8> 20098a0: a2 07 00 01 add %i4, %g1, %l1 20098a4: a4 04 60 04 add %l1, 4, %l2 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 20098a8: 7f ff e2 38 call 2002188 20098ac: 01 00 00 00 nop 20098b0: 82 10 00 08 mov %o0, %g1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 20098b4: f6 04 40 00 ld [ %l1 ], %i3 search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 20098b8: 80 a6 c0 12 cmp %i3, %l2 20098bc: 32 80 00 12 bne,a 2009904 <_Thread_queue_Enqueue_priority+0xa8> 20098c0: e0 06 e0 14 ld [ %i3 + 0x14 ], %l0 if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; 20098c4: 10 80 00 63 b 2009a50 <_Thread_queue_Enqueue_priority+0x1f4> 20098c8: a0 10 3f ff mov -1, %l0 break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 20098cc: 7f ff e2 33 call 2002198 20098d0: 90 10 00 01 mov %g1, %o0 20098d4: 7f ff e2 2d call 2002188 20098d8: 01 00 00 00 nop 20098dc: 82 10 00 08 mov %o0, %g1 RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 20098e0: c4 06 e0 10 ld [ %i3 + 0x10 ], %g2 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 20098e4: 80 8e 00 02 btst %i0, %g2 20098e8: 02 80 00 3f be 20099e4 <_Thread_queue_Enqueue_priority+0x188> 20098ec: 01 00 00 00 nop _ISR_Enable( level ); goto restart_forward_search; } search_thread = 20098f0: f6 06 c0 00 ld [ %i3 ], %i3 restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 20098f4: 80 a6 c0 12 cmp %i3, %l2 20098f8: 22 80 00 07 be,a 2009914 <_Thread_queue_Enqueue_priority+0xb8> 20098fc: f0 07 20 30 ld [ %i4 + 0x30 ], %i0 search_priority = search_thread->current_priority; 2009900: e0 06 e0 14 ld [ %i3 + 0x14 ], %l0 if ( priority <= search_priority ) 2009904: 80 a7 40 10 cmp %i5, %l0 2009908: 18 bf ff f1 bgu 20098cc <_Thread_queue_Enqueue_priority+0x70> 200990c: 01 00 00 00 nop } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 2009910: f0 07 20 30 ld [ %i4 + 0x30 ], %i0 2009914: 80 a6 20 01 cmp %i0, 1 2009918: 02 80 00 36 be 20099f0 <_Thread_queue_Enqueue_priority+0x194><== ALWAYS TAKEN 200991c: 80 a7 40 10 cmp %i5, %l0 * 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; 2009920: c2 26 80 00 st %g1, [ %i2 ] <== NOT EXECUTED return the_thread_queue->sync_state; } 2009924: 81 c7 e0 08 ret <== NOT EXECUTED 2009928: 81 e8 00 00 restore <== NOT EXECUTED if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); 200992c: 7f ff e2 1b call 2002198 2009930: 01 00 00 00 nop return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 2009934: 7f ff e2 15 call 2002188 2009938: e0 0c 80 00 ldub [ %l2 ], %l0 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 200993c: a0 04 20 01 inc %l0 _ISR_Disable( level ); 2009940: 82 10 00 08 mov %o0, %g1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last( Chain_Control *the_chain ) { return _Chain_Tail( the_chain )->previous; 2009944: f6 04 60 08 ld [ %l1 + 8 ], %i3 search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 2009948: 80 a6 c0 11 cmp %i3, %l1 200994c: 32 80 00 12 bne,a 2009994 <_Thread_queue_Enqueue_priority+0x138> 2009950: e0 06 e0 14 ld [ %i3 + 0x14 ], %l0 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 2009954: 10 80 00 14 b 20099a4 <_Thread_queue_Enqueue_priority+0x148> 2009958: f0 07 20 30 ld [ %i4 + 0x30 ], %i0 break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 200995c: 7f ff e2 0f call 2002198 2009960: 90 10 00 01 mov %g1, %o0 2009964: 7f ff e2 09 call 2002188 2009968: 01 00 00 00 nop 200996c: 82 10 00 08 mov %o0, %g1 2009970: c4 06 e0 10 ld [ %i3 + 0x10 ], %g2 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 2009974: 80 8e 00 02 btst %i0, %g2 2009978: 02 bf ff ed be 200992c <_Thread_queue_Enqueue_priority+0xd0> 200997c: 01 00 00 00 nop _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) 2009980: f6 06 e0 04 ld [ %i3 + 4 ], %i3 restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 2009984: 80 a6 c0 11 cmp %i3, %l1 2009988: 22 80 00 07 be,a 20099a4 <_Thread_queue_Enqueue_priority+0x148> 200998c: f0 07 20 30 ld [ %i4 + 0x30 ], %i0 search_priority = search_thread->current_priority; 2009990: e0 06 e0 14 ld [ %i3 + 0x14 ], %l0 if ( priority >= search_priority ) 2009994: 80 a7 40 10 cmp %i5, %l0 2009998: 0a bf ff f1 bcs 200995c <_Thread_queue_Enqueue_priority+0x100> 200999c: 01 00 00 00 nop } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 20099a0: f0 07 20 30 ld [ %i4 + 0x30 ], %i0 20099a4: 80 a6 20 01 cmp %i0, 1 20099a8: 32 bf ff df bne,a 2009924 <_Thread_queue_Enqueue_priority+0xc8><== NEVER TAKEN 20099ac: c2 26 80 00 st %g1, [ %i2 ] <== NOT EXECUTED THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) 20099b0: 80 a7 40 10 cmp %i5, %l0 20099b4: 02 80 00 1b be 2009a20 <_Thread_queue_Enqueue_priority+0x1c4> 20099b8: c0 27 20 30 clr [ %i4 + 0x30 ] goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 20099bc: c4 06 c0 00 ld [ %i3 ], %g2 the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 20099c0: f6 26 60 04 st %i3, [ %i1 + 4 ] search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 20099c4: c4 26 40 00 st %g2, [ %i1 ] the_node->previous = search_node; search_node->next = the_node; 20099c8: f2 26 c0 00 st %i1, [ %i3 ] next_node->previous = the_node; 20099cc: f2 20 a0 04 st %i1, [ %g2 + 4 ] the_thread->Wait.queue = the_thread_queue; 20099d0: f8 26 60 44 st %i4, [ %i1 + 0x44 ] _ISR_Enable( level ); 20099d4: 7f ff e1 f1 call 2002198 20099d8: 90 10 00 01 mov %g1, %o0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 20099dc: 81 c7 e0 08 ret 20099e0: 81 e8 00 00 restore if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); 20099e4: 7f ff e1 ed call 2002198 20099e8: 01 00 00 00 nop goto restart_forward_search; 20099ec: 30 bf ff af b,a 20098a8 <_Thread_queue_Enqueue_priority+0x4c> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) 20099f0: 02 80 00 0c be 2009a20 <_Thread_queue_Enqueue_priority+0x1c4> 20099f4: c0 27 20 30 clr [ %i4 + 0x30 ] goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 20099f8: c4 06 e0 04 ld [ %i3 + 4 ], %g2 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 20099fc: f6 26 40 00 st %i3, [ %i1 ] the_node->previous = previous_node; 2009a00: c4 26 60 04 st %g2, [ %i1 + 4 ] previous_node->next = the_node; 2009a04: f2 20 80 00 st %i1, [ %g2 ] search_node->previous = the_node; 2009a08: f2 26 e0 04 st %i1, [ %i3 + 4 ] the_thread->Wait.queue = the_thread_queue; 2009a0c: f8 26 60 44 st %i4, [ %i1 + 0x44 ] _ISR_Enable( level ); 2009a10: 7f ff e1 e2 call 2002198 2009a14: 90 10 00 01 mov %g1, %o0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 2009a18: 81 c7 e0 08 ret 2009a1c: 81 e8 00 00 restore _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 2009a20: c4 06 e0 40 ld [ %i3 + 0x40 ], %g2 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); 2009a24: 86 06 e0 3c add %i3, 0x3c, %g3 previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; 2009a28: c4 26 60 04 st %g2, [ %i1 + 4 ] equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; 2009a2c: c6 26 40 00 st %g3, [ %i1 ] the_node->previous = previous_node; previous_node->next = the_node; 2009a30: f2 20 80 00 st %i1, [ %g2 ] search_node->previous = the_node; 2009a34: f2 26 e0 40 st %i1, [ %i3 + 0x40 ] the_thread->Wait.queue = the_thread_queue; 2009a38: f8 26 60 44 st %i4, [ %i1 + 0x44 ] _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 2009a3c: b0 10 20 01 mov 1, %i0 the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 2009a40: 7f ff e1 d6 call 2002198 2009a44: 90 10 00 01 mov %g1, %o0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 2009a48: 81 c7 e0 08 ret 2009a4c: 81 e8 00 00 restore } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 2009a50: 10 bf ff b1 b 2009914 <_Thread_queue_Enqueue_priority+0xb8> 2009a54: f0 07 20 30 ld [ %i4 + 0x30 ], %i0 =============================================================================== 02009b14 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 2009b14: 9d e3 bf 98 save %sp, -104, %sp /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 2009b18: 80 a6 20 00 cmp %i0, 0 2009b1c: 02 80 00 13 be 2009b68 <_Thread_queue_Requeue+0x54> <== NEVER TAKEN 2009b20: 01 00 00 00 nop /* * 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 ) { 2009b24: f8 06 20 34 ld [ %i0 + 0x34 ], %i4 2009b28: 80 a7 20 01 cmp %i4, 1 2009b2c: 02 80 00 04 be 2009b3c <_Thread_queue_Requeue+0x28> <== ALWAYS TAKEN 2009b30: 01 00 00 00 nop 2009b34: 81 c7 e0 08 ret <== NOT EXECUTED 2009b38: 81 e8 00 00 restore <== NOT EXECUTED Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 2009b3c: 7f ff e1 93 call 2002188 2009b40: 01 00 00 00 nop 2009b44: ba 10 00 08 mov %o0, %i5 2009b48: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 2009b4c: 03 00 00 ef sethi %hi(0x3bc00), %g1 2009b50: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 2009b54: 80 88 80 01 btst %g2, %g1 2009b58: 12 80 00 06 bne 2009b70 <_Thread_queue_Requeue+0x5c> <== ALWAYS TAKEN 2009b5c: 90 10 00 18 mov %i0, %o0 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); 2009b60: 7f ff e1 8e call 2002198 2009b64: 90 10 00 1d mov %i5, %o0 2009b68: 81 c7 e0 08 ret 2009b6c: 81 e8 00 00 restore ISR_Level level_ignored; _ISR_Disable( level ); if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 2009b70: 92 10 00 19 mov %i1, %o1 2009b74: 94 10 20 01 mov 1, %o2 2009b78: 40 00 0f 78 call 200d958 <_Thread_queue_Extract_priority_helper> 2009b7c: f8 26 20 30 st %i4, [ %i0 + 0x30 ] (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 2009b80: 90 10 00 18 mov %i0, %o0 2009b84: 92 10 00 19 mov %i1, %o1 2009b88: 7f ff ff 35 call 200985c <_Thread_queue_Enqueue_priority> 2009b8c: 94 07 bf fc add %fp, -4, %o2 2009b90: 30 bf ff f4 b,a 2009b60 <_Thread_queue_Requeue+0x4c> =============================================================================== 02009b94 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 2009b94: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 2009b98: 90 10 00 18 mov %i0, %o0 2009b9c: 7f ff fd c8 call 20092bc <_Thread_Get> 2009ba0: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 2009ba4: c2 07 bf fc ld [ %fp + -4 ], %g1 2009ba8: 80 a0 60 00 cmp %g1, 0 2009bac: 12 80 00 09 bne 2009bd0 <_Thread_queue_Timeout+0x3c> <== NEVER TAKEN 2009bb0: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 2009bb4: 40 00 0f a2 call 200da3c <_Thread_queue_Process_timeout> 2009bb8: 01 00 00 00 nop /** * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 2009bbc: 03 00 80 76 sethi %hi(0x201d800), %g1 2009bc0: c4 00 61 50 ld [ %g1 + 0x150 ], %g2 ! 201d950 <_Thread_Dispatch_disable_level> 2009bc4: 84 00 bf ff add %g2, -1, %g2 2009bc8: c4 20 61 50 st %g2, [ %g1 + 0x150 ] return _Thread_Dispatch_disable_level; 2009bcc: c2 00 61 50 ld [ %g1 + 0x150 ], %g1 2009bd0: 81 c7 e0 08 ret 2009bd4: 81 e8 00 00 restore =============================================================================== 02016488 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 2016488: 9d e3 bf 88 save %sp, -120, %sp 201648c: 23 00 80 f7 sethi %hi(0x203dc00), %l1 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 2016490: a6 07 bf e8 add %fp, -24, %l3 2016494: b2 07 bf ec add %fp, -20, %i1 2016498: b6 07 bf f4 add %fp, -12, %i3 201649c: a4 07 bf f8 add %fp, -8, %l2 20164a0: 21 00 80 f7 sethi %hi(0x203dc00), %l0 20164a4: 29 00 80 f7 sethi %hi(0x203dc00), %l4 20164a8: f2 27 bf e8 st %i1, [ %fp + -24 ] head->previous = NULL; 20164ac: c0 27 bf ec clr [ %fp + -20 ] tail->previous = head; 20164b0: e6 27 bf f0 st %l3, [ %fp + -16 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 20164b4: e4 27 bf f4 st %l2, [ %fp + -12 ] head->previous = NULL; 20164b8: c0 27 bf f8 clr [ %fp + -8 ] tail->previous = head; 20164bc: f6 27 bf fc st %i3, [ %fp + -4 ] 20164c0: a2 14 61 d4 or %l1, 0x1d4, %l1 20164c4: b8 06 20 30 add %i0, 0x30, %i4 20164c8: a0 14 21 4c or %l0, 0x14c, %l0 20164cc: b4 06 20 68 add %i0, 0x68, %i2 20164d0: a8 15 20 c0 or %l4, 0xc0, %l4 20164d4: ae 06 20 08 add %i0, 8, %l7 20164d8: ac 06 20 40 add %i0, 0x40, %l6 _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; 20164dc: aa 10 20 01 mov 1, %l5 { /* * 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; 20164e0: e6 26 20 78 st %l3, [ %i0 + 0x78 ] static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 20164e4: c2 04 40 00 ld [ %l1 ], %g1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 20164e8: d2 06 20 3c ld [ %i0 + 0x3c ], %o1 watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 20164ec: 94 10 00 1b mov %i3, %o2 20164f0: 90 10 00 1c mov %i4, %o0 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 20164f4: c2 26 20 3c st %g1, [ %i0 + 0x3c ] _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 20164f8: 40 00 13 35 call 201b1cc <_Watchdog_Adjust_to_chain> 20164fc: 92 20 40 09 sub %g1, %o1, %o1 Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 2016500: d4 06 20 74 ld [ %i0 + 0x74 ], %o2 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 2016504: fa 04 00 00 ld [ %l0 ], %i5 /* * 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 ) { 2016508: 80 a7 40 0a cmp %i5, %o2 201650c: 18 80 00 2e bgu 20165c4 <_Timer_server_Body+0x13c> 2016510: 92 27 40 0a sub %i5, %o2, %o1 * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); } else if ( snapshot < last_snapshot ) { 2016514: 80 a7 40 0a cmp %i5, %o2 2016518: 0a 80 00 2f bcs 20165d4 <_Timer_server_Body+0x14c> 201651c: 90 10 00 1a mov %i2, %o0 */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 2016520: fa 26 20 74 st %i5, [ %i0 + 0x74 ] } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 2016524: d0 06 20 78 ld [ %i0 + 0x78 ], %o0 2016528: 40 00 03 1b call 2017194 <_Chain_Get> 201652c: 01 00 00 00 nop if ( timer == NULL ) { 2016530: 92 92 20 00 orcc %o0, 0, %o1 2016534: 02 80 00 10 be 2016574 <_Timer_server_Body+0xec> 2016538: 01 00 00 00 nop static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 201653c: c2 02 60 38 ld [ %o1 + 0x38 ], %g1 2016540: 80 a0 60 01 cmp %g1, 1 2016544: 02 80 00 28 be 20165e4 <_Timer_server_Body+0x15c> 2016548: 80 a0 60 03 cmp %g1, 3 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 201654c: 12 bf ff f6 bne 2016524 <_Timer_server_Body+0x9c> <== NEVER TAKEN 2016550: 92 02 60 10 add %o1, 0x10, %o1 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 2016554: 40 00 13 4f call 201b290 <_Watchdog_Insert> 2016558: 90 10 00 1a mov %i2, %o0 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 201655c: d0 06 20 78 ld [ %i0 + 0x78 ], %o0 2016560: 40 00 03 0d call 2017194 <_Chain_Get> 2016564: 01 00 00 00 nop if ( timer == NULL ) { 2016568: 92 92 20 00 orcc %o0, 0, %o1 201656c: 32 bf ff f5 bne,a 2016540 <_Timer_server_Body+0xb8> <== NEVER TAKEN 2016570: c2 02 60 38 ld [ %o1 + 0x38 ], %g1 <== 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 ); 2016574: 7f ff e2 29 call 200ee18 2016578: 01 00 00 00 nop if ( _Chain_Is_empty( insert_chain ) ) { 201657c: c2 07 bf e8 ld [ %fp + -24 ], %g1 2016580: 80 a0 40 19 cmp %g1, %i1 2016584: 02 80 00 1c be 20165f4 <_Timer_server_Body+0x16c> <== ALWAYS TAKEN 2016588: 01 00 00 00 nop ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 201658c: 7f ff e2 27 call 200ee28 <== NOT EXECUTED 2016590: 01 00 00 00 nop <== NOT EXECUTED static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 2016594: c2 04 40 00 ld [ %l1 ], %g1 <== NOT EXECUTED /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 2016598: d2 06 20 3c ld [ %i0 + 0x3c ], %o1 <== NOT EXECUTED watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 201659c: 94 10 00 1b mov %i3, %o2 <== NOT EXECUTED 20165a0: 90 10 00 1c mov %i4, %o0 <== NOT EXECUTED /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 20165a4: c2 26 20 3c st %g1, [ %i0 + 0x3c ] <== NOT EXECUTED _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 20165a8: 40 00 13 09 call 201b1cc <_Watchdog_Adjust_to_chain> <== NOT EXECUTED 20165ac: 92 20 40 09 sub %g1, %o1, %o1 <== NOT EXECUTED Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 20165b0: d4 06 20 74 ld [ %i0 + 0x74 ], %o2 <== NOT EXECUTED static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 20165b4: fa 04 00 00 ld [ %l0 ], %i5 <== NOT EXECUTED /* * 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 ) { 20165b8: 80 a7 40 0a cmp %i5, %o2 <== NOT EXECUTED 20165bc: 08 bf ff d7 bleu 2016518 <_Timer_server_Body+0x90> <== NOT EXECUTED 20165c0: 92 27 40 0a sub %i5, %o2, %o1 <== NOT EXECUTED /* * 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 ); 20165c4: 90 10 00 1a mov %i2, %o0 20165c8: 40 00 13 01 call 201b1cc <_Watchdog_Adjust_to_chain> 20165cc: 94 10 00 1b mov %i3, %o2 20165d0: 30 bf ff d4 b,a 2016520 <_Timer_server_Body+0x98> /* * 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 ); 20165d4: 92 10 20 01 mov 1, %o1 20165d8: 40 00 12 ce call 201b110 <_Watchdog_Adjust> 20165dc: 94 22 80 1d sub %o2, %i5, %o2 20165e0: 30 bf ff d0 b,a 2016520 <_Timer_server_Body+0x98> Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 20165e4: 90 10 00 1c mov %i4, %o0 20165e8: 40 00 13 2a call 201b290 <_Watchdog_Insert> 20165ec: 92 02 60 10 add %o1, 0x10, %o1 20165f0: 30 bf ff cd b,a 2016524 <_Timer_server_Body+0x9c> */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; 20165f4: c0 26 20 78 clr [ %i0 + 0x78 ] _ISR_Enable( level ); 20165f8: 7f ff e2 0c call 200ee28 20165fc: 01 00 00 00 nop _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 ) ) { 2016600: c2 07 bf f4 ld [ %fp + -12 ], %g1 2016604: 80 a0 40 12 cmp %g1, %l2 2016608: 12 80 00 0c bne 2016638 <_Timer_server_Body+0x1b0> 201660c: 01 00 00 00 nop 2016610: 30 80 00 13 b,a 201665c <_Timer_server_Body+0x1d4> Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; new_first->previous = head; 2016614: f6 20 60 04 st %i3, [ %g1 + 4 ] { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 2016618: c2 27 bf f4 st %g1, [ %fp + -12 ] * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 201661c: c0 27 60 08 clr [ %i5 + 8 ] _ISR_Enable( level ); 2016620: 7f ff e2 02 call 200ee28 2016624: 01 00 00 00 nop /* * 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 ); 2016628: d0 07 60 20 ld [ %i5 + 0x20 ], %o0 201662c: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 2016630: 9f c0 40 00 call %g1 2016634: d2 07 60 24 ld [ %i5 + 0x24 ], %o1 /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 2016638: 7f ff e1 f8 call 200ee18 201663c: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 2016640: fa 07 bf f4 ld [ %fp + -12 ], %i5 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 2016644: 80 a7 40 12 cmp %i5, %l2 2016648: 32 bf ff f3 bne,a 2016614 <_Timer_server_Body+0x18c> 201664c: c2 07 40 00 ld [ %i5 ], %g1 watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 2016650: 7f ff e1 f6 call 200ee28 2016654: 01 00 00 00 nop 2016658: 30 bf ff a2 b,a 20164e0 <_Timer_server_Body+0x58> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 201665c: c0 2e 20 7c clrb [ %i0 + 0x7c ] /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 2016660: c2 05 00 00 ld [ %l4 ], %g1 2016664: 82 00 60 01 inc %g1 2016668: c2 25 00 00 st %g1, [ %l4 ] return _Thread_Dispatch_disable_level; 201666c: c2 05 00 00 ld [ %l4 ], %g1 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 2016670: d0 06 00 00 ld [ %i0 ], %o0 2016674: 40 00 10 de call 201a9ec <_Thread_Set_state> 2016678: 92 10 20 08 mov 8, %o1 _Timer_server_Reset_interval_system_watchdog( ts ); 201667c: 7f ff ff 5b call 20163e8 <_Timer_server_Reset_interval_system_watchdog> 2016680: 90 10 00 18 mov %i0, %o0 _Timer_server_Reset_tod_system_watchdog( ts ); 2016684: 7f ff ff 6d call 2016438 <_Timer_server_Reset_tod_system_watchdog> 2016688: 90 10 00 18 mov %i0, %o0 _Thread_Enable_dispatch(); 201668c: 40 00 0e 59 call 2019ff0 <_Thread_Enable_dispatch> 2016690: 01 00 00 00 nop static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 2016694: 90 10 00 17 mov %l7, %o0 _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; 2016698: ea 2e 20 7c stb %l5, [ %i0 + 0x7c ] static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 201669c: 40 00 13 5f call 201b418 <_Watchdog_Remove> 20166a0: 01 00 00 00 nop static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 20166a4: 40 00 13 5d call 201b418 <_Watchdog_Remove> 20166a8: 90 10 00 16 mov %l6, %o0 20166ac: 30 bf ff 8d b,a 20164e0 <_Timer_server_Body+0x58> =============================================================================== 020166b0 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 20166b0: 9d e3 bf a0 save %sp, -96, %sp if ( ts->insert_chain == NULL ) { 20166b4: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 20166b8: 80 a0 60 00 cmp %g1, 0 20166bc: 02 80 00 05 be 20166d0 <_Timer_server_Schedule_operation_method+0x20> 20166c0: ba 10 00 19 mov %i1, %i5 * 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 ); 20166c4: f0 06 20 78 ld [ %i0 + 0x78 ], %i0 20166c8: 40 00 02 9f call 2017144 <_Chain_Append> 20166cc: 81 e8 00 00 restore /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 20166d0: 03 00 80 f7 sethi %hi(0x203dc00), %g1 20166d4: c4 00 60 c0 ld [ %g1 + 0xc0 ], %g2 ! 203dcc0 <_Thread_Dispatch_disable_level> 20166d8: 84 00 a0 01 inc %g2 20166dc: c4 20 60 c0 st %g2, [ %g1 + 0xc0 ] return _Thread_Dispatch_disable_level; 20166e0: c2 00 60 c0 ld [ %g1 + 0xc0 ], %g1 * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 20166e4: c2 06 60 38 ld [ %i1 + 0x38 ], %g1 20166e8: 80 a0 60 01 cmp %g1, 1 20166ec: 02 80 00 28 be 201678c <_Timer_server_Schedule_operation_method+0xdc> 20166f0: 80 a0 60 03 cmp %g1, 3 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); if ( !ts->active ) { _Timer_server_Reset_interval_system_watchdog( ts ); } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 20166f4: 02 80 00 04 be 2016704 <_Timer_server_Schedule_operation_method+0x54> 20166f8: 01 00 00 00 nop if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 20166fc: 40 00 0e 3d call 2019ff0 <_Thread_Enable_dispatch> 2016700: 81 e8 00 00 restore } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 2016704: 7f ff e1 c5 call 200ee18 2016708: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 201670c: c4 06 20 68 ld [ %i0 + 0x68 ], %g2 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; 2016710: c6 06 20 74 ld [ %i0 + 0x74 ], %g3 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 2016714: 88 06 20 6c add %i0, 0x6c, %g4 /* * 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(); 2016718: 03 00 80 f7 sethi %hi(0x203dc00), %g1 last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 201671c: 80 a0 80 04 cmp %g2, %g4 2016720: 02 80 00 0d be 2016754 <_Timer_server_Schedule_operation_method+0xa4> 2016724: c2 00 61 4c ld [ %g1 + 0x14c ], %g1 first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 2016728: de 00 a0 10 ld [ %g2 + 0x10 ], %o7 if ( snapshot > last_snapshot ) { 201672c: 80 a0 40 03 cmp %g1, %g3 } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 2016730: 88 03 c0 03 add %o7, %g3, %g4 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 ) { 2016734: 08 80 00 07 bleu 2016750 <_Timer_server_Schedule_operation_method+0xa0> 2016738: 88 21 00 01 sub %g4, %g1, %g4 /* * We advanced in time. */ delta = snapshot - last_snapshot; 201673c: 86 20 40 03 sub %g1, %g3, %g3 if (delta_interval > delta) { 2016740: 80 a3 c0 03 cmp %o7, %g3 2016744: 08 80 00 03 bleu 2016750 <_Timer_server_Schedule_operation_method+0xa0><== NEVER TAKEN 2016748: 88 10 20 00 clr %g4 delta_interval -= delta; 201674c: 88 23 c0 03 sub %o7, %g3, %g4 * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 2016750: c8 20 a0 10 st %g4, [ %g2 + 0x10 ] } ts->TOD_watchdogs.last_snapshot = snapshot; 2016754: c2 26 20 74 st %g1, [ %i0 + 0x74 ] _ISR_Enable( level ); 2016758: 7f ff e1 b4 call 200ee28 201675c: 01 00 00 00 nop _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 2016760: 90 06 20 68 add %i0, 0x68, %o0 2016764: 40 00 12 cb call 201b290 <_Watchdog_Insert> 2016768: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 201676c: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 2016770: 80 a0 60 00 cmp %g1, 0 2016774: 12 bf ff e2 bne 20166fc <_Timer_server_Schedule_operation_method+0x4c> 2016778: 01 00 00 00 nop _Timer_server_Reset_tod_system_watchdog( ts ); 201677c: 7f ff ff 2f call 2016438 <_Timer_server_Reset_tod_system_watchdog> 2016780: 90 10 00 18 mov %i0, %o0 } } _Thread_Enable_dispatch(); 2016784: 40 00 0e 1b call 2019ff0 <_Thread_Enable_dispatch> 2016788: 81 e8 00 00 restore if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 201678c: 7f ff e1 a3 call 200ee18 2016790: 01 00 00 00 nop snapshot = _Watchdog_Ticks_since_boot; 2016794: 05 00 80 f7 sethi %hi(0x203dc00), %g2 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 2016798: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 201679c: c4 00 a1 d4 ld [ %g2 + 0x1d4 ], %g2 last_snapshot = ts->Interval_watchdogs.last_snapshot; 20167a0: c8 06 20 3c ld [ %i0 + 0x3c ], %g4 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 20167a4: 86 06 20 34 add %i0, 0x34, %g3 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 20167a8: 80 a0 40 03 cmp %g1, %g3 20167ac: 02 80 00 08 be 20167cc <_Timer_server_Schedule_operation_method+0x11c> 20167b0: 88 20 80 04 sub %g2, %g4, %g4 /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 20167b4: de 00 60 10 ld [ %g1 + 0x10 ], %o7 if (delta_interval > delta) { 20167b8: 80 a1 00 0f cmp %g4, %o7 20167bc: 1a 80 00 03 bcc 20167c8 <_Timer_server_Schedule_operation_method+0x118> 20167c0: 86 10 20 00 clr %g3 delta_interval -= delta; 20167c4: 86 23 c0 04 sub %o7, %g4, %g3 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 20167c8: c6 20 60 10 st %g3, [ %g1 + 0x10 ] } ts->Interval_watchdogs.last_snapshot = snapshot; 20167cc: c4 26 20 3c st %g2, [ %i0 + 0x3c ] _ISR_Enable( level ); 20167d0: 7f ff e1 96 call 200ee28 20167d4: 01 00 00 00 nop _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 20167d8: 90 06 20 30 add %i0, 0x30, %o0 20167dc: 40 00 12 ad call 201b290 <_Watchdog_Insert> 20167e0: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 20167e4: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 20167e8: 80 a0 60 00 cmp %g1, 0 20167ec: 12 bf ff c4 bne 20166fc <_Timer_server_Schedule_operation_method+0x4c> 20167f0: 01 00 00 00 nop _Timer_server_Reset_interval_system_watchdog( ts ); 20167f4: 7f ff fe fd call 20163e8 <_Timer_server_Reset_interval_system_watchdog> 20167f8: 90 10 00 18 mov %i0, %o0 if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 20167fc: 40 00 0d fd call 2019ff0 <_Thread_Enable_dispatch> 2016800: 81 e8 00 00 restore =============================================================================== 0200a084 <_User_extensions_Fatal>: void _User_extensions_Fatal ( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 200a084: 9d e3 bf a0 save %sp, -96, %sp 200a088: 39 00 80 76 sethi %hi(0x201d800), %i4 200a08c: b8 17 23 38 or %i4, 0x338, %i4 ! 201db38 <_User_extensions_List> 200a090: fa 07 20 08 ld [ %i4 + 8 ], %i5 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); 200a094: 80 a7 40 1c cmp %i5, %i4 200a098: 02 80 00 0d be 200a0cc <_User_extensions_Fatal+0x48> <== NEVER TAKEN 200a09c: 01 00 00 00 nop !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.fatal != NULL ) 200a0a0: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 200a0a4: 80 a0 60 00 cmp %g1, 0 200a0a8: 02 80 00 05 be 200a0bc <_User_extensions_Fatal+0x38> 200a0ac: 90 10 00 18 mov %i0, %o0 (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); 200a0b0: 92 10 00 19 mov %i1, %o1 200a0b4: 9f c0 40 00 call %g1 200a0b8: 94 10 00 1a mov %i2, %o2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { 200a0bc: fa 07 60 04 ld [ %i5 + 4 ], %i5 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); 200a0c0: 80 a7 40 1c cmp %i5, %i4 200a0c4: 32 bf ff f8 bne,a 200a0a4 <_User_extensions_Fatal+0x20> 200a0c8: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 200a0cc: 81 c7 e0 08 ret 200a0d0: 81 e8 00 00 restore =============================================================================== 02009f30 <_User_extensions_Handler_initialization>: #include #include #include void _User_extensions_Handler_initialization(void) { 2009f30: 9d e3 bf a0 save %sp, -96, %sp 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; 2009f34: 07 00 80 72 sethi %hi(0x201c800), %g3 2009f38: 86 10 e3 ec or %g3, 0x3ec, %g3 ! 201cbec initial_extensions = Configuration.User_extension_table; 2009f3c: f6 00 e0 3c ld [ %g3 + 0x3c ], %i3 2009f40: 3b 00 80 76 sethi %hi(0x201d800), %i5 2009f44: 09 00 80 76 sethi %hi(0x201d800), %g4 2009f48: 84 17 63 38 or %i5, 0x338, %g2 2009f4c: 82 11 21 54 or %g4, 0x154, %g1 2009f50: b4 00 a0 04 add %g2, 4, %i2 2009f54: b8 00 60 04 add %g1, 4, %i4 2009f58: f4 27 63 38 st %i2, [ %i5 + 0x338 ] head->previous = NULL; 2009f5c: c0 20 a0 04 clr [ %g2 + 4 ] tail->previous = head; 2009f60: c4 20 a0 08 st %g2, [ %g2 + 8 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 2009f64: f8 21 21 54 st %i4, [ %g4 + 0x154 ] head->previous = NULL; 2009f68: c0 20 60 04 clr [ %g1 + 4 ] tail->previous = head; 2009f6c: c2 20 60 08 st %g1, [ %g1 + 8 ] _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { 2009f70: 80 a6 e0 00 cmp %i3, 0 2009f74: 02 80 00 1b be 2009fe0 <_User_extensions_Handler_initialization+0xb0><== NEVER TAKEN 2009f78: f4 00 e0 38 ld [ %g3 + 0x38 ], %i2 extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) 2009f7c: 83 2e a0 02 sll %i2, 2, %g1 2009f80: b9 2e a0 04 sll %i2, 4, %i4 2009f84: b8 27 00 01 sub %i4, %g1, %i4 2009f88: b8 07 00 1a add %i4, %i2, %i4 2009f8c: b9 2f 20 02 sll %i4, 2, %i4 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { extension = (User_extensions_Control *) 2009f90: 40 00 01 96 call 200a5e8 <_Workspace_Allocate_or_fatal_error> 2009f94: 90 10 00 1c mov %i4, %o0 _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 2009f98: 92 10 20 00 clr %o1 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { extension = (User_extensions_Control *) 2009f9c: ba 10 00 08 mov %o0, %i5 _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 2009fa0: 40 00 18 f4 call 2010370 2009fa4: 94 10 00 1c mov %i4, %o2 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 2009fa8: 80 a6 a0 00 cmp %i2, 0 2009fac: 02 80 00 0d be 2009fe0 <_User_extensions_Handler_initialization+0xb0><== NEVER TAKEN 2009fb0: b8 10 20 00 clr %i4 RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 2009fb4: 92 10 00 1b mov %i3, %o1 2009fb8: 94 10 20 20 mov 0x20, %o2 2009fbc: 40 00 18 b1 call 2010280 2009fc0: 90 07 60 14 add %i5, 0x14, %o0 _User_extensions_Add_set( extension ); 2009fc4: 40 00 0e df call 200db40 <_User_extensions_Add_set> 2009fc8: 90 10 00 1d mov %i5, %o0 2009fcc: b8 07 20 01 inc %i4 _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; 2009fd0: ba 07 60 34 add %i5, 0x34, %i5 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 2009fd4: 80 a7 00 1a cmp %i4, %i2 2009fd8: 12 bf ff f7 bne 2009fb4 <_User_extensions_Handler_initialization+0x84> 2009fdc: b6 06 e0 20 add %i3, 0x20, %i3 2009fe0: 81 c7 e0 08 ret 2009fe4: 81 e8 00 00 restore =============================================================================== 02009fe8 <_User_extensions_Thread_begin>: #include void _User_extensions_Thread_begin ( Thread_Control *executing ) { 2009fe8: 9d e3 bf a0 save %sp, -96, %sp */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 2009fec: 39 00 80 76 sethi %hi(0x201d800), %i4 2009ff0: fa 07 23 38 ld [ %i4 + 0x338 ], %i5 ! 201db38 <_User_extensions_List> 2009ff4: b8 17 23 38 or %i4, 0x338, %i4 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_First( &_User_extensions_List ); 2009ff8: b8 07 20 04 add %i4, 4, %i4 2009ffc: 80 a7 40 1c cmp %i5, %i4 200a000: 02 80 00 0c be 200a030 <_User_extensions_Thread_begin+0x48><== NEVER TAKEN 200a004: 01 00 00 00 nop !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_begin != NULL ) 200a008: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 200a00c: 80 a0 60 00 cmp %g1, 0 200a010: 02 80 00 04 be 200a020 <_User_extensions_Thread_begin+0x38> 200a014: 90 10 00 18 mov %i0, %o0 (*the_extension->Callouts.thread_begin)( executing ); 200a018: 9f c0 40 00 call %g1 200a01c: 01 00 00 00 nop Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_First( &_User_extensions_List ); !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 200a020: fa 07 40 00 ld [ %i5 ], %i5 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_First( &_User_extensions_List ); 200a024: 80 a7 40 1c cmp %i5, %i4 200a028: 32 bf ff f9 bne,a 200a00c <_User_extensions_Thread_begin+0x24> 200a02c: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 200a030: 81 c7 e0 08 ret 200a034: 81 e8 00 00 restore =============================================================================== 0200a0d4 <_User_extensions_Thread_create>: #include bool _User_extensions_Thread_create ( Thread_Control *the_thread ) { 200a0d4: 9d e3 bf a0 save %sp, -96, %sp */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 200a0d8: 39 00 80 76 sethi %hi(0x201d800), %i4 200a0dc: fa 07 23 38 ld [ %i4 + 0x338 ], %i5 ! 201db38 <_User_extensions_List> 200a0e0: b8 17 23 38 or %i4, 0x338, %i4 Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _Chain_First( &_User_extensions_List ); 200a0e4: b8 07 20 04 add %i4, 4, %i4 200a0e8: 80 a7 40 1c cmp %i5, %i4 200a0ec: 02 80 00 12 be 200a134 <_User_extensions_Thread_create+0x60><== NEVER TAKEN 200a0f0: 82 10 20 01 mov 1, %g1 the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_create != NULL ) { status = (*the_extension->Callouts.thread_create)( 200a0f4: 37 00 80 77 sethi %hi(0x201dc00), %i3 !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_create != NULL ) { 200a0f8: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 200a0fc: 80 a0 60 00 cmp %g1, 0 200a100: 02 80 00 08 be 200a120 <_User_extensions_Thread_create+0x4c> 200a104: 84 16 e2 88 or %i3, 0x288, %g2 status = (*the_extension->Callouts.thread_create)( 200a108: d0 00 a0 0c ld [ %g2 + 0xc ], %o0 200a10c: 9f c0 40 00 call %g1 200a110: 92 10 00 18 mov %i0, %o1 _Thread_Executing, the_thread ); if ( !status ) 200a114: 80 8a 20 ff btst 0xff, %o0 200a118: 02 80 00 0a be 200a140 <_User_extensions_Thread_create+0x6c> 200a11c: 82 10 20 00 clr %g1 User_extensions_Control *the_extension; bool status; for ( the_node = _Chain_First( &_User_extensions_List ); !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 200a120: fa 07 40 00 ld [ %i5 ], %i5 { Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _Chain_First( &_User_extensions_List ); 200a124: 80 a7 40 1c cmp %i5, %i4 200a128: 32 bf ff f5 bne,a 200a0fc <_User_extensions_Thread_create+0x28> 200a12c: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 if ( !status ) return false; } } return true; 200a130: 82 10 20 01 mov 1, %g1 } 200a134: b0 08 60 01 and %g1, 1, %i0 200a138: 81 c7 e0 08 ret 200a13c: 81 e8 00 00 restore 200a140: b0 08 60 01 and %g1, 1, %i0 200a144: 81 c7 e0 08 ret 200a148: 81 e8 00 00 restore =============================================================================== 0200a14c <_User_extensions_Thread_delete>: #include void _User_extensions_Thread_delete ( Thread_Control *the_thread ) { 200a14c: 9d e3 bf a0 save %sp, -96, %sp */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last( Chain_Control *the_chain ) { return _Chain_Tail( the_chain )->previous; 200a150: 39 00 80 76 sethi %hi(0x201d800), %i4 200a154: b8 17 23 38 or %i4, 0x338, %i4 ! 201db38 <_User_extensions_List> 200a158: fa 07 20 08 ld [ %i4 + 8 ], %i5 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); 200a15c: 80 a7 40 1c cmp %i5, %i4 200a160: 02 80 00 0d be 200a194 <_User_extensions_Thread_delete+0x48><== NEVER TAKEN 200a164: 37 00 80 77 sethi %hi(0x201dc00), %i3 !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_delete != NULL ) 200a168: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 200a16c: 80 a0 60 00 cmp %g1, 0 200a170: 02 80 00 05 be 200a184 <_User_extensions_Thread_delete+0x38> 200a174: 84 16 e2 88 or %i3, 0x288, %g2 (*the_extension->Callouts.thread_delete)( 200a178: d0 00 a0 0c ld [ %g2 + 0xc ], %o0 200a17c: 9f c0 40 00 call %g1 200a180: 92 10 00 18 mov %i0, %o1 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { 200a184: fa 07 60 04 ld [ %i5 + 4 ], %i5 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); 200a188: 80 a7 40 1c cmp %i5, %i4 200a18c: 32 bf ff f8 bne,a 200a16c <_User_extensions_Thread_delete+0x20> 200a190: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 200a194: 81 c7 e0 08 ret 200a198: 81 e8 00 00 restore =============================================================================== 0200a038 <_User_extensions_Thread_exitted>: } void _User_extensions_Thread_exitted ( Thread_Control *executing ) { 200a038: 9d e3 bf a0 save %sp, -96, %sp */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last( Chain_Control *the_chain ) { return _Chain_Tail( the_chain )->previous; 200a03c: 39 00 80 76 sethi %hi(0x201d800), %i4 200a040: b8 17 23 38 or %i4, 0x338, %i4 ! 201db38 <_User_extensions_List> 200a044: fa 07 20 08 ld [ %i4 + 8 ], %i5 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); 200a048: 80 a7 40 1c cmp %i5, %i4 200a04c: 02 80 00 0c be 200a07c <_User_extensions_Thread_exitted+0x44><== NEVER TAKEN 200a050: 01 00 00 00 nop !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_exitted != NULL ) 200a054: c2 07 60 2c ld [ %i5 + 0x2c ], %g1 200a058: 80 a0 60 00 cmp %g1, 0 200a05c: 02 80 00 04 be 200a06c <_User_extensions_Thread_exitted+0x34> 200a060: 90 10 00 18 mov %i0, %o0 (*the_extension->Callouts.thread_exitted)( executing ); 200a064: 9f c0 40 00 call %g1 200a068: 01 00 00 00 nop Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { 200a06c: fa 07 60 04 ld [ %i5 + 4 ], %i5 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); 200a070: 80 a7 40 1c cmp %i5, %i4 200a074: 32 bf ff f9 bne,a 200a058 <_User_extensions_Thread_exitted+0x20> 200a078: c2 07 60 2c ld [ %i5 + 0x2c ], %g1 200a07c: 81 c7 e0 08 ret 200a080: 81 e8 00 00 restore =============================================================================== 0200a978 <_User_extensions_Thread_restart>: #include void _User_extensions_Thread_restart ( Thread_Control *the_thread ) { 200a978: 9d e3 bf a0 save %sp, -96, %sp */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 200a97c: 39 00 80 79 sethi %hi(0x201e400), %i4 200a980: fa 07 21 f8 ld [ %i4 + 0x1f8 ], %i5 ! 201e5f8 <_User_extensions_List> 200a984: b8 17 21 f8 or %i4, 0x1f8, %i4 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_First( &_User_extensions_List ); 200a988: b8 07 20 04 add %i4, 4, %i4 200a98c: 80 a7 40 1c cmp %i5, %i4 200a990: 02 80 00 0d be 200a9c4 <_User_extensions_Thread_restart+0x4c><== NEVER TAKEN 200a994: 37 00 80 7a sethi %hi(0x201e800), %i3 !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_restart != NULL ) 200a998: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 200a99c: 80 a0 60 00 cmp %g1, 0 200a9a0: 02 80 00 05 be 200a9b4 <_User_extensions_Thread_restart+0x3c> 200a9a4: 84 16 e1 48 or %i3, 0x148, %g2 (*the_extension->Callouts.thread_restart)( 200a9a8: d0 00 a0 0c ld [ %g2 + 0xc ], %o0 200a9ac: 9f c0 40 00 call %g1 200a9b0: 92 10 00 18 mov %i0, %o1 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_First( &_User_extensions_List ); !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 200a9b4: fa 07 40 00 ld [ %i5 ], %i5 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_First( &_User_extensions_List ); 200a9b8: 80 a7 40 1c cmp %i5, %i4 200a9bc: 32 bf ff f8 bne,a 200a99c <_User_extensions_Thread_restart+0x24> 200a9c0: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 200a9c4: 81 c7 e0 08 ret 200a9c8: 81 e8 00 00 restore =============================================================================== 0200a19c <_User_extensions_Thread_start>: #include void _User_extensions_Thread_start ( Thread_Control *the_thread ) { 200a19c: 9d e3 bf a0 save %sp, -96, %sp */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 200a1a0: 39 00 80 76 sethi %hi(0x201d800), %i4 200a1a4: fa 07 23 38 ld [ %i4 + 0x338 ], %i5 ! 201db38 <_User_extensions_List> 200a1a8: b8 17 23 38 or %i4, 0x338, %i4 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_First( &_User_extensions_List ); 200a1ac: b8 07 20 04 add %i4, 4, %i4 200a1b0: 80 a7 40 1c cmp %i5, %i4 200a1b4: 02 80 00 0d be 200a1e8 <_User_extensions_Thread_start+0x4c><== NEVER TAKEN 200a1b8: 37 00 80 77 sethi %hi(0x201dc00), %i3 !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_start != NULL ) 200a1bc: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 200a1c0: 80 a0 60 00 cmp %g1, 0 200a1c4: 02 80 00 05 be 200a1d8 <_User_extensions_Thread_start+0x3c> 200a1c8: 84 16 e2 88 or %i3, 0x288, %g2 (*the_extension->Callouts.thread_start)( 200a1cc: d0 00 a0 0c ld [ %g2 + 0xc ], %o0 200a1d0: 9f c0 40 00 call %g1 200a1d4: 92 10 00 18 mov %i0, %o1 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_First( &_User_extensions_List ); !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 200a1d8: fa 07 40 00 ld [ %i5 ], %i5 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_First( &_User_extensions_List ); 200a1dc: 80 a7 40 1c cmp %i5, %i4 200a1e0: 32 bf ff f8 bne,a 200a1c0 <_User_extensions_Thread_start+0x24> 200a1e4: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 200a1e8: 81 c7 e0 08 ret 200a1ec: 81 e8 00 00 restore =============================================================================== 0200a1f0 <_User_extensions_Thread_switch>: void _User_extensions_Thread_switch ( Thread_Control *executing, Thread_Control *heir ) { 200a1f0: 9d e3 bf a0 save %sp, -96, %sp 200a1f4: 39 00 80 76 sethi %hi(0x201d800), %i4 200a1f8: fa 07 21 54 ld [ %i4 + 0x154 ], %i5 ! 201d954 <_User_extensions_Switches_list> 200a1fc: b8 17 21 54 or %i4, 0x154, %i4 Chain_Node *the_node; User_extensions_Switch_control *the_extension_switch; for ( the_node = _Chain_First( &_User_extensions_Switches_list ); 200a200: b8 07 20 04 add %i4, 4, %i4 200a204: 80 a7 40 1c cmp %i5, %i4 200a208: 02 80 00 0a be 200a230 <_User_extensions_Thread_switch+0x40><== NEVER TAKEN 200a20c: 01 00 00 00 nop !_Chain_Is_tail( &_User_extensions_Switches_list, the_node ) ; the_node = the_node->next ) { the_extension_switch = (User_extensions_Switch_control *) the_node; (*the_extension_switch->thread_switch)( executing, heir ); 200a210: c2 07 60 08 ld [ %i5 + 8 ], %g1 200a214: 90 10 00 18 mov %i0, %o0 200a218: 9f c0 40 00 call %g1 200a21c: 92 10 00 19 mov %i1, %o1 Chain_Node *the_node; User_extensions_Switch_control *the_extension_switch; for ( the_node = _Chain_First( &_User_extensions_Switches_list ); !_Chain_Is_tail( &_User_extensions_Switches_list, the_node ) ; the_node = the_node->next ) { 200a220: fa 07 40 00 ld [ %i5 ], %i5 ) { Chain_Node *the_node; User_extensions_Switch_control *the_extension_switch; for ( the_node = _Chain_First( &_User_extensions_Switches_list ); 200a224: 80 a7 40 1c cmp %i5, %i4 200a228: 32 bf ff fb bne,a 200a214 <_User_extensions_Thread_switch+0x24> 200a22c: c2 07 60 08 ld [ %i5 + 8 ], %g1 200a230: 81 c7 e0 08 ret 200a234: 81 e8 00 00 restore =============================================================================== 0200bcb8 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 200bcb8: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; _ISR_Disable( level ); 200bcbc: 7f ff dc 83 call 2002ec8 200bcc0: ba 10 00 18 mov %i0, %i5 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 200bcc4: c2 06 00 00 ld [ %i0 ], %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 200bcc8: b6 06 20 04 add %i0, 4, %i3 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 200bccc: 80 a0 40 1b cmp %g1, %i3 200bcd0: 02 80 00 1e be 200bd48 <_Watchdog_Adjust+0x90> 200bcd4: 80 a6 60 00 cmp %i1, 0 switch ( direction ) { 200bcd8: 12 80 00 1e bne 200bd50 <_Watchdog_Adjust+0x98> 200bcdc: 80 a6 60 01 cmp %i1, 1 case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 200bce0: 80 a6 a0 00 cmp %i2, 0 200bce4: 02 80 00 19 be 200bd48 <_Watchdog_Adjust+0x90> <== NEVER TAKEN 200bce8: 01 00 00 00 nop if ( units < _Watchdog_First( header )->delta_interval ) { 200bcec: f8 00 60 10 ld [ %g1 + 0x10 ], %i4 200bcf0: 80 a6 80 1c cmp %i2, %i4 200bcf4: 1a 80 00 0a bcc 200bd1c <_Watchdog_Adjust+0x64> <== ALWAYS TAKEN 200bcf8: b2 10 20 01 mov 1, %i1 _Watchdog_First( header )->delta_interval -= units; 200bcfc: 10 80 00 1c b 200bd6c <_Watchdog_Adjust+0xb4> <== NOT EXECUTED 200bd00: b8 27 00 1a sub %i4, %i2, %i4 <== NOT EXECUTED switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 200bd04: 02 80 00 11 be 200bd48 <_Watchdog_Adjust+0x90> <== NEVER TAKEN 200bd08: 01 00 00 00 nop if ( units < _Watchdog_First( header )->delta_interval ) { 200bd0c: f8 00 60 10 ld [ %g1 + 0x10 ], %i4 200bd10: 80 a7 00 1a cmp %i4, %i2 200bd14: 38 80 00 16 bgu,a 200bd6c <_Watchdog_Adjust+0xb4> 200bd18: b8 27 00 1a sub %i4, %i2, %i4 _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 200bd1c: f2 20 60 10 st %i1, [ %g1 + 0x10 ] _ISR_Enable( level ); 200bd20: 7f ff dc 6e call 2002ed8 200bd24: 01 00 00 00 nop _Watchdog_Tickle( header ); 200bd28: 40 00 00 ab call 200bfd4 <_Watchdog_Tickle> 200bd2c: 90 10 00 1d mov %i5, %o0 _ISR_Disable( level ); 200bd30: 7f ff dc 66 call 2002ec8 200bd34: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 200bd38: c2 07 40 00 ld [ %i5 ], %g1 if ( _Chain_Is_empty( header ) ) 200bd3c: 80 a6 c0 01 cmp %i3, %g1 200bd40: 32 bf ff f1 bne,a 200bd04 <_Watchdog_Adjust+0x4c> 200bd44: b4 a6 80 1c subcc %i2, %i4, %i2 } break; } } _ISR_Enable( level ); 200bd48: 7f ff dc 64 call 2002ed8 200bd4c: 91 e8 00 08 restore %g0, %o0, %o0 * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { 200bd50: 12 bf ff fe bne 200bd48 <_Watchdog_Adjust+0x90> <== NEVER TAKEN 200bd54: 01 00 00 00 nop case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 200bd58: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 200bd5c: b4 00 80 1a add %g2, %i2, %i2 200bd60: f4 20 60 10 st %i2, [ %g1 + 0x10 ] } break; } } _ISR_Enable( level ); 200bd64: 7f ff dc 5d call 2002ed8 200bd68: 91 e8 00 08 restore %g0, %o0, %o0 break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; 200bd6c: 10 bf ff f7 b 200bd48 <_Watchdog_Adjust+0x90> 200bd70: f8 20 60 10 st %i4, [ %g1 + 0x10 ] =============================================================================== 0200a3c0 <_Watchdog_Remove>: */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 200a3c0: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 200a3c4: 7f ff df 71 call 2002188 200a3c8: 01 00 00 00 nop previous_state = the_watchdog->state; 200a3cc: fa 06 20 08 ld [ %i0 + 8 ], %i5 switch ( previous_state ) { 200a3d0: 80 a7 60 01 cmp %i5, 1 200a3d4: 02 80 00 2a be 200a47c <_Watchdog_Remove+0xbc> 200a3d8: 03 00 80 76 sethi %hi(0x201d800), %g1 200a3dc: 1a 80 00 09 bcc 200a400 <_Watchdog_Remove+0x40> 200a3e0: 80 a7 60 03 cmp %i5, 3 _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 200a3e4: 03 00 80 76 sethi %hi(0x201d800), %g1 200a3e8: c2 00 62 64 ld [ %g1 + 0x264 ], %g1 ! 201da64 <_Watchdog_Ticks_since_boot> 200a3ec: c2 26 20 18 st %g1, [ %i0 + 0x18 ] _ISR_Enable( level ); 200a3f0: 7f ff df 6a call 2002198 200a3f4: b0 10 00 1d mov %i5, %i0 return( previous_state ); } 200a3f8: 81 c7 e0 08 ret 200a3fc: 81 e8 00 00 restore Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); previous_state = the_watchdog->state; switch ( previous_state ) { 200a400: 18 bf ff fa bgu 200a3e8 <_Watchdog_Remove+0x28> <== NEVER TAKEN 200a404: 03 00 80 76 sethi %hi(0x201d800), %g1 } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 200a408: c2 06 00 00 ld [ %i0 ], %g1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 200a40c: c0 26 20 08 clr [ %i0 + 8 ] next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 200a410: c4 00 40 00 ld [ %g1 ], %g2 200a414: 80 a0 a0 00 cmp %g2, 0 200a418: 02 80 00 07 be 200a434 <_Watchdog_Remove+0x74> 200a41c: 05 00 80 76 sethi %hi(0x201d800), %g2 next_watchdog->delta_interval += the_watchdog->delta_interval; 200a420: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 200a424: c4 06 20 10 ld [ %i0 + 0x10 ], %g2 200a428: 84 00 c0 02 add %g3, %g2, %g2 200a42c: c4 20 60 10 st %g2, [ %g1 + 0x10 ] if ( _Watchdog_Sync_count ) 200a430: 05 00 80 76 sethi %hi(0x201d800), %g2 200a434: c4 00 a2 60 ld [ %g2 + 0x260 ], %g2 ! 201da60 <_Watchdog_Sync_count> 200a438: 80 a0 a0 00 cmp %g2, 0 200a43c: 22 80 00 07 be,a 200a458 <_Watchdog_Remove+0x98> 200a440: c4 06 20 04 ld [ %i0 + 4 ], %g2 _Watchdog_Sync_level = _ISR_Nest_level; 200a444: 05 00 80 77 sethi %hi(0x201dc00), %g2 200a448: c6 00 a2 90 ld [ %g2 + 0x290 ], %g3 ! 201de90 <_Per_CPU_Information+0x8> 200a44c: 05 00 80 76 sethi %hi(0x201d800), %g2 200a450: c6 20 a1 f8 st %g3, [ %g2 + 0x1f8 ] ! 201d9f8 <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 200a454: c4 06 20 04 ld [ %i0 + 4 ], %g2 next->previous = previous; 200a458: c4 20 60 04 st %g2, [ %g1 + 4 ] previous->next = next; 200a45c: c2 20 80 00 st %g1, [ %g2 ] _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 200a460: 03 00 80 76 sethi %hi(0x201d800), %g1 200a464: c2 00 62 64 ld [ %g1 + 0x264 ], %g1 ! 201da64 <_Watchdog_Ticks_since_boot> 200a468: c2 26 20 18 st %g1, [ %i0 + 0x18 ] _ISR_Enable( level ); 200a46c: 7f ff df 4b call 2002198 200a470: b0 10 00 1d mov %i5, %i0 return( previous_state ); } 200a474: 81 c7 e0 08 ret 200a478: 81 e8 00 00 restore _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 200a47c: c2 00 62 64 ld [ %g1 + 0x264 ], %g1 /* * 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; 200a480: c0 26 20 08 clr [ %i0 + 8 ] _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 200a484: c2 26 20 18 st %g1, [ %i0 + 0x18 ] _ISR_Enable( level ); 200a488: 7f ff df 44 call 2002198 200a48c: b0 10 00 1d mov %i5, %i0 return( previous_state ); } 200a490: 81 c7 e0 08 ret 200a494: 81 e8 00 00 restore =============================================================================== 0200b49c <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 200b49c: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 200b4a0: 7f ff dd 5e call 2002a18 200b4a4: 01 00 00 00 nop 200b4a8: ba 10 00 08 mov %o0, %i5 printk( "Watchdog Chain: %s %p\n", name, header ); 200b4ac: 11 00 80 75 sethi %hi(0x201d400), %o0 200b4b0: 94 10 00 19 mov %i1, %o2 200b4b4: 92 10 00 18 mov %i0, %o1 200b4b8: 7f ff e4 73 call 2004684 200b4bc: 90 12 22 f8 or %o0, 0x2f8, %o0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 200b4c0: f8 06 40 00 ld [ %i1 ], %i4 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 200b4c4: b2 06 60 04 add %i1, 4, %i1 if ( !_Chain_Is_empty( header ) ) { 200b4c8: 80 a7 00 19 cmp %i4, %i1 200b4cc: 02 80 00 0f be 200b508 <_Watchdog_Report_chain+0x6c> 200b4d0: 11 00 80 75 sethi %hi(0x201d400), %o0 node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 200b4d4: 92 10 00 1c mov %i4, %o1 200b4d8: 40 00 00 0f call 200b514 <_Watchdog_Report> 200b4dc: 90 10 20 00 clr %o0 _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; node != _Chain_Tail(header) ; node = node->next ) 200b4e0: f8 07 00 00 ld [ %i4 ], %i4 Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; 200b4e4: 80 a7 00 19 cmp %i4, %i1 200b4e8: 12 bf ff fc bne 200b4d8 <_Watchdog_Report_chain+0x3c> <== NEVER TAKEN 200b4ec: 92 10 00 1c mov %i4, %o1 { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 200b4f0: 11 00 80 75 sethi %hi(0x201d400), %o0 200b4f4: 92 10 00 18 mov %i0, %o1 200b4f8: 7f ff e4 63 call 2004684 200b4fc: 90 12 23 10 or %o0, 0x310, %o0 } else { printk( "Chain is empty\n" ); } _ISR_Enable( level ); 200b500: 7f ff dd 4a call 2002a28 200b504: 91 e8 00 1d restore %g0, %i5, %o0 _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); 200b508: 7f ff e4 5f call 2004684 200b50c: 90 12 23 20 or %o0, 0x320, %o0 200b510: 30 bf ff fc b,a 200b500 <_Watchdog_Report_chain+0x64> =============================================================================== 020076e4 <_rename_r>: int _rename_r( struct _reent *ptr __attribute__((unused)), const char *old, const char *new ) { 20076e4: 9d e3 bf 58 save %sp, -168, %sp /* * Get the parent node of the old path to be renamed. Find the parent path. */ old_parent_pathlen = rtems_filesystem_dirname ( old ); 20076e8: 7f ff f9 fe call 2005ee0 20076ec: 90 10 00 19 mov %i1, %o0 if ( old_parent_pathlen == 0 ) 20076f0: 80 a2 20 00 cmp %o0, 0 20076f4: 12 80 00 2b bne 20077a0 <_rename_r+0xbc> 20076f8: b8 10 00 08 mov %o0, %i4 rtems_filesystem_get_start_loc( old, &i, &old_parent_loc ); 20076fc: ba 07 bf d0 add %fp, -48, %i5 2007700: 90 10 00 19 mov %i1, %o0 2007704: 92 07 bf f8 add %fp, -8, %o1 2007708: 94 10 00 1d mov %i5, %o2 200770c: 40 00 01 00 call 2007b0c 2007710: b8 10 20 00 clr %i4 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; 2007714: b6 10 20 00 clr %i3 /* * Start from the parent to find the node that should be under it. */ old_loc = old_parent_loc; 2007718: c2 07 bf d0 ld [ %fp + -48 ], %g1 name = old + old_parent_pathlen; 200771c: b2 06 40 1c add %i1, %i4, %i1 /* * Start from the parent to find the node that should be under it. */ old_loc = old_parent_loc; 2007720: c2 27 bf bc st %g1, [ %fp + -68 ] 2007724: c2 07 bf d4 ld [ %fp + -44 ], %g1 name = old + old_parent_pathlen; 2007728: f2 27 bf fc st %i1, [ %fp + -4 ] /* * Start from the parent to find the node that should be under it. */ old_loc = old_parent_loc; 200772c: c2 27 bf c0 st %g1, [ %fp + -64 ] 2007730: c2 07 bf d8 ld [ %fp + -40 ], %g1 name = old + old_parent_pathlen; name += rtems_filesystem_prefix_separators( name, strlen( name ) ); 2007734: 90 10 00 19 mov %i1, %o0 /* * Start from the parent to find the node that should be under it. */ old_loc = old_parent_loc; 2007738: c2 27 bf c4 st %g1, [ %fp + -60 ] 200773c: c2 07 bf dc ld [ %fp + -36 ], %g1 2007740: c2 27 bf c8 st %g1, [ %fp + -56 ] 2007744: c2 07 bf e0 ld [ %fp + -32 ], %g1 name = old + old_parent_pathlen; name += rtems_filesystem_prefix_separators( name, strlen( name ) ); 2007748: 40 00 3d b6 call 2016e20 200774c: c2 27 bf cc st %g1, [ %fp + -52 ] 2007750: 92 10 00 08 mov %o0, %o1 2007754: 7f ff f9 f2 call 2005f1c 2007758: 90 10 00 19 mov %i1, %o0 200775c: b2 06 40 08 add %i1, %o0, %i1 2007760: f2 27 bf fc st %i1, [ %fp + -4 ] result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 2007764: 40 00 3d af call 2016e20 2007768: 90 10 00 19 mov %i1, %o0 200776c: 94 10 20 00 clr %o2 2007770: 92 10 00 08 mov %o0, %o1 2007774: 96 07 bf bc add %fp, -68, %o3 2007778: 90 10 00 19 mov %i1, %o0 200777c: 7f ff f9 ad call 2005e30 2007780: 98 10 20 00 clr %o4 0, &old_loc, false ); if ( result != 0 ) { 2007784: 80 a2 20 00 cmp %o0, 0 2007788: 02 80 00 17 be 20077e4 <_rename_r+0x100> 200778c: 80 8e e0 ff btst 0xff, %i3 if ( free_old_parentloc ) 2007790: 12 80 00 11 bne 20077d4 <_rename_r+0xf0> <== ALWAYS TAKEN 2007794: b0 10 3f ff mov -1, %i0 if ( free_old_parentloc ) rtems_filesystem_freenode( &old_parent_loc ); rtems_filesystem_freenode( &old_loc ); return result; } 2007798: 81 c7 e0 08 ret <== NOT EXECUTED 200779c: 81 e8 00 00 restore <== NOT EXECUTED 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, 20077a0: ba 07 bf d0 add %fp, -48, %i5 20077a4: 90 10 00 19 mov %i1, %o0 20077a8: 92 10 00 1c mov %i4, %o1 20077ac: 94 10 20 02 mov 2, %o2 20077b0: 96 10 00 1d mov %i5, %o3 20077b4: 98 10 20 00 clr %o4 20077b8: 7f ff f9 bb call 2005ea4 20077bc: b0 10 3f ff mov -1, %i0 RTEMS_LIBIO_PERMS_WRITE, &old_parent_loc, false ); if ( result != 0 ) 20077c0: 80 a2 20 00 cmp %o0, 0 20077c4: 12 bf ff f5 bne 2007798 <_rename_r+0xb4> <== NEVER TAKEN 20077c8: b6 10 20 01 mov 1, %i3 /* * Start from the parent to find the node that should be under it. */ old_loc = old_parent_loc; 20077cc: 10 bf ff d4 b 200771c <_rename_r+0x38> 20077d0: c2 07 bf d0 ld [ %fp + -48 ], %g1 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 ); 20077d4: 7f ff fa 7b call 20061c0 20077d8: 90 10 00 1d mov %i5, %o0 20077dc: 81 c7 e0 08 ret 20077e0: 81 e8 00 00 restore /* * Get the parent of the new node we are renaming to. */ rtems_filesystem_get_start_loc( new, &i, &new_parent_loc ); 20077e4: 90 10 00 1a mov %i2, %o0 20077e8: 92 07 bf f8 add %fp, -8, %o1 20077ec: 40 00 00 c8 call 2007b0c 20077f0: 94 07 bf e4 add %fp, -28, %o2 result = (*new_parent_loc.ops->evalformake_h)( &new[i], &new_parent_loc, &name ); 20077f4: c2 07 bf f0 ld [ %fp + -16 ], %g1 20077f8: d0 07 bf f8 ld [ %fp + -8 ], %o0 20077fc: c2 00 60 04 ld [ %g1 + 4 ], %g1 2007800: 90 06 80 08 add %i2, %o0, %o0 2007804: 92 07 bf e4 add %fp, -28, %o1 2007808: 9f c0 40 00 call %g1 200780c: 94 07 bf fc add %fp, -4, %o2 if ( result != 0 ) { 2007810: 80 a2 20 00 cmp %o0, 0 2007814: 12 80 00 29 bne 20078b8 <_rename_r+0x1d4> 2007818: c2 07 bf f4 ld [ %fp + -12 ], %g1 /* * 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 ) { 200781c: c4 07 bf e0 ld [ %fp + -32 ], %g2 2007820: 80 a0 80 01 cmp %g2, %g1 2007824: 12 80 00 15 bne 2007878 <_rename_r+0x194> 2007828: c2 07 bf f0 ld [ %fp + -16 ], %g1 rtems_filesystem_freenode( &old_parent_loc ); rtems_filesystem_freenode( &old_loc ); rtems_set_errno_and_return_minus_one( EXDEV ); } result = (*new_parent_loc.ops->rename_h)( &old_parent_loc, &old_loc, &new_parent_loc, name ); 200782c: d6 07 bf fc ld [ %fp + -4 ], %o3 2007830: c2 00 60 40 ld [ %g1 + 0x40 ], %g1 2007834: 92 07 bf bc add %fp, -68, %o1 2007838: 94 07 bf e4 add %fp, -28, %o2 200783c: 9f c0 40 00 call %g1 2007840: 90 10 00 1d mov %i5, %o0 2007844: b0 10 00 08 mov %o0, %i0 rtems_filesystem_freenode( &new_parent_loc ); 2007848: 7f ff fa 5e call 20061c0 200784c: 90 07 bf e4 add %fp, -28, %o0 if ( free_old_parentloc ) 2007850: 80 8e e0 ff btst 0xff, %i3 2007854: 12 80 00 06 bne 200786c <_rename_r+0x188> 2007858: 01 00 00 00 nop rtems_filesystem_freenode( &old_parent_loc ); rtems_filesystem_freenode( &old_loc ); 200785c: 7f ff fa 59 call 20061c0 2007860: 90 07 bf bc add %fp, -68, %o0 return result; } 2007864: 81 c7 e0 08 ret 2007868: 81 e8 00 00 restore result = (*new_parent_loc.ops->rename_h)( &old_parent_loc, &old_loc, &new_parent_loc, name ); rtems_filesystem_freenode( &new_parent_loc ); if ( free_old_parentloc ) rtems_filesystem_freenode( &old_parent_loc ); 200786c: 7f ff fa 55 call 20061c0 2007870: 90 10 00 1d mov %i5, %o0 2007874: 30 bf ff fa b,a 200785c <_rename_r+0x178> * Check to see if the caller is trying to rename across file system * boundaries. */ if ( old_parent_loc.mt_entry != new_parent_loc.mt_entry ) { rtems_filesystem_freenode( &new_parent_loc ); 2007878: 7f ff fa 52 call 20061c0 200787c: 90 07 bf e4 add %fp, -28, %o0 if ( free_old_parentloc ) 2007880: 80 8e e0 ff btst 0xff, %i3 2007884: 12 80 00 0a bne 20078ac <_rename_r+0x1c8> 2007888: 01 00 00 00 nop rtems_filesystem_freenode( &old_parent_loc ); rtems_filesystem_freenode( &old_loc ); 200788c: 7f ff fa 4d call 20061c0 2007890: 90 07 bf bc add %fp, -68, %o0 rtems_set_errno_and_return_minus_one( EXDEV ); 2007894: 40 00 30 09 call 20138b8 <__errno> 2007898: b0 10 3f ff mov -1, %i0 200789c: 82 10 20 12 mov 0x12, %g1 20078a0: c2 22 00 00 st %g1, [ %o0 ] 20078a4: 81 c7 e0 08 ret 20078a8: 81 e8 00 00 restore */ if ( old_parent_loc.mt_entry != new_parent_loc.mt_entry ) { rtems_filesystem_freenode( &new_parent_loc ); if ( free_old_parentloc ) rtems_filesystem_freenode( &old_parent_loc ); 20078ac: 7f ff fa 45 call 20061c0 20078b0: 90 10 00 1d mov %i5, %o0 20078b4: 30 bf ff f6 b,a 200788c <_rename_r+0x1a8> rtems_filesystem_get_start_loc( new, &i, &new_parent_loc ); result = (*new_parent_loc.ops->evalformake_h)( &new[i], &new_parent_loc, &name ); if ( result != 0 ) { rtems_filesystem_freenode( &new_parent_loc ); 20078b8: 7f ff fa 42 call 20061c0 20078bc: 90 07 bf e4 add %fp, -28, %o0 if ( free_old_parentloc ) 20078c0: 80 8e e0 ff btst 0xff, %i3 20078c4: 02 80 00 05 be 20078d8 <_rename_r+0x1f4> <== NEVER TAKEN 20078c8: 90 07 bf bc add %fp, -68, %o0 rtems_filesystem_freenode( &old_parent_loc ); 20078cc: 7f ff fa 3d call 20061c0 20078d0: 90 10 00 1d mov %i5, %o0 rtems_filesystem_freenode( &old_loc ); 20078d4: 90 07 bf bc add %fp, -68, %o0 20078d8: 7f ff fa 3a call 20061c0 20078dc: b0 10 3f ff mov -1, %i0 return -1; 20078e0: 81 c7 e0 08 ret 20078e4: 81 e8 00 00 restore =============================================================================== 02006434 : int adjtime( struct timeval *delta, struct timeval *olddelta ) { 2006434: 9d e3 bf 98 save %sp, -104, %sp long adjustment; /* * Simple validations */ if ( !delta ) 2006438: ba 96 20 00 orcc %i0, 0, %i5 200643c: 02 80 00 54 be 200658c 2006440: 03 00 03 d0 sethi %hi(0xf4000), %g1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) 2006444: c4 07 60 04 ld [ %i5 + 4 ], %g2 2006448: 82 10 62 3f or %g1, 0x23f, %g1 200644c: 80 a0 80 01 cmp %g2, %g1 2006450: 18 80 00 4f bgu 200658c 2006454: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( olddelta ) { 2006458: 22 80 00 06 be,a 2006470 200645c: c2 07 40 00 ld [ %i5 ], %g1 olddelta->tv_sec = 0; olddelta->tv_usec = 0; 2006460: c0 26 60 04 clr [ %i1 + 4 ] 2006464: c4 07 60 04 ld [ %i5 + 4 ], %g2 if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( olddelta ) { olddelta->tv_sec = 0; 2006468: c0 26 40 00 clr [ %i1 ] olddelta->tv_usec = 0; } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); 200646c: c2 07 40 00 ld [ %i5 ], %g1 adjustment += delta->tv_usec; /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) 2006470: 07 00 80 76 sethi %hi(0x201d800), %g3 2006474: c8 00 e2 38 ld [ %g3 + 0x238 ], %g4 ! 201da38 olddelta->tv_sec = 0; olddelta->tv_usec = 0; } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); 2006478: 9f 28 60 08 sll %g1, 8, %o7 200647c: 87 28 60 03 sll %g1, 3, %g3 2006480: 86 23 c0 03 sub %o7, %g3, %g3 2006484: 9f 28 e0 06 sll %g3, 6, %o7 2006488: 86 23 c0 03 sub %o7, %g3, %g3 200648c: 82 00 c0 01 add %g3, %g1, %g1 2006490: 83 28 60 06 sll %g1, 6, %g1 adjustment += delta->tv_usec; 2006494: 84 00 40 02 add %g1, %g2, %g2 /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) 2006498: 80 a0 80 04 cmp %g2, %g4 200649c: 0a 80 00 3a bcs 2006584 20064a0: b0 10 20 00 clr %i0 /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 20064a4: 03 00 80 7a sethi %hi(0x201e800), %g1 20064a8: c4 00 60 90 ld [ %g1 + 0x90 ], %g2 ! 201e890 <_Thread_Dispatch_disable_level> 20064ac: 84 00 a0 01 inc %g2 20064b0: c4 20 60 90 st %g2, [ %g1 + 0x90 ] return _Thread_Dispatch_disable_level; 20064b4: c2 00 60 90 ld [ %g1 + 0x90 ], %g1 * This prevents context switches while we are adjusting the TOD */ _Thread_Disable_dispatch(); _TOD_Get( &ts ); 20064b8: 40 00 06 6a call 2007e60 <_TOD_Get> 20064bc: 90 07 bf f8 add %fp, -8, %o0 ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 20064c0: c2 07 60 04 ld [ %i5 + 4 ], %g1 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; 20064c4: c8 07 bf f8 ld [ %fp + -8 ], %g4 20064c8: c4 07 40 00 ld [ %i5 ], %g2 ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 20064cc: 87 28 60 02 sll %g1, 2, %g3 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; 20064d0: 84 01 00 02 add %g4, %g2, %g2 ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 20064d4: 89 28 60 07 sll %g1, 7, %g4 20064d8: 86 21 00 03 sub %g4, %g3, %g3 20064dc: 82 00 c0 01 add %g3, %g1, %g1 20064e0: c6 07 bf fc ld [ %fp + -4 ], %g3 20064e4: 83 28 60 03 sll %g1, 3, %g1 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; 20064e8: c4 27 bf f8 st %g2, [ %fp + -8 ] ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 20064ec: 82 00 40 03 add %g1, %g3, %g1 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 20064f0: 07 0e e6 b2 sethi %hi(0x3b9ac800), %g3 20064f4: 86 10 e1 ff or %g3, 0x1ff, %g3 ! 3b9ac9ff 20064f8: 80 a0 40 03 cmp %g1, %g3 20064fc: 08 80 00 0a bleu 2006524 2006500: c2 27 bf fc st %g1, [ %fp + -4 ] ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; 2006504: 09 31 19 4d sethi %hi(0xc4653400), %g4 2006508: 88 11 22 00 or %g4, 0x200, %g4 ! c4653600 200650c: 82 00 40 04 add %g1, %g4, %g1 ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 2006510: 80 a0 40 03 cmp %g1, %g3 2006514: 18 bf ff fe bgu 200650c <== NEVER TAKEN 2006518: 84 00 a0 01 inc %g2 200651c: c2 27 bf fc st %g1, [ %fp + -4 ] 2006520: c4 27 bf f8 st %g2, [ %fp + -8 ] ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; ts.tv_sec++; } /* if adjustment is too much negative */ while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) { 2006524: 09 31 19 4d sethi %hi(0xc4653400), %g4 2006528: 88 11 22 00 or %g4, 0x200, %g4 ! c4653600 200652c: 80 a0 40 04 cmp %g1, %g4 2006530: 18 80 00 0a bgu 2006558 <== NEVER TAKEN 2006534: c4 07 bf f8 ld [ %fp + -8 ], %g2 ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; 2006538: 07 0e e6 b2 sethi %hi(0x3b9ac800), %g3 200653c: 86 10 e2 00 or %g3, 0x200, %g3 ! 3b9aca00 2006540: 82 00 40 03 add %g1, %g3, %g1 ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; ts.tv_sec++; } /* if adjustment is too much negative */ while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) { 2006544: 80 a0 40 04 cmp %g1, %g4 2006548: 08 bf ff fe bleu 2006540 200654c: 84 00 bf ff add %g2, -1, %g2 2006550: c2 27 bf fc st %g1, [ %fp + -4 ] 2006554: c4 27 bf f8 st %g2, [ %fp + -8 ] ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; ts.tv_sec--; } _TOD_Set( &ts ); 2006558: 40 00 06 6c call 2007f08 <_TOD_Set> 200655c: 90 07 bf f8 add %fp, -8, %o0 _Thread_Enable_dispatch(); 2006560: 40 00 0c da call 20098c8 <_Thread_Enable_dispatch> 2006564: b0 10 20 00 clr %i0 /* set the user's output */ if ( olddelta ) 2006568: 80 a6 60 00 cmp %i1, 0 200656c: 02 80 00 0c be 200659c 2006570: 01 00 00 00 nop *olddelta = *delta; 2006574: c2 07 40 00 ld [ %i5 ], %g1 2006578: c2 26 40 00 st %g1, [ %i1 ] 200657c: c2 07 60 04 ld [ %i5 + 4 ], %g1 2006580: c2 26 60 04 st %g1, [ %i1 + 4 ] return 0; } 2006584: 81 c7 e0 08 ret 2006588: 81 e8 00 00 restore */ if ( !delta ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) rtems_set_errno_and_return_minus_one( EINVAL ); 200658c: 40 00 26 b9 call 2010070 <__errno> 2006590: b0 10 3f ff mov -1, %i0 2006594: 82 10 20 16 mov 0x16, %g1 2006598: c2 22 00 00 st %g1, [ %o0 ] 200659c: 81 c7 e0 08 ret 20065a0: 81 e8 00 00 restore =============================================================================== 02006ca4 : * operation(s) cannot be canceled */ int aio_cancel(int fildes, struct aiocb *aiocbp) { 2006ca4: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 2006ca8: 3b 00 80 66 sethi %hi(0x2019800), %i5 2006cac: 40 00 04 91 call 2007ef0 2006cb0: 90 17 63 7c or %i5, 0x37c, %o0 ! 2019b7c if (fcntl (fildes, F_GETFD) < 0) { 2006cb4: 90 10 00 18 mov %i0, %o0 2006cb8: 40 00 1e 90 call 200e6f8 2006cbc: 92 10 20 01 mov 1, %o1 2006cc0: 80 a2 20 00 cmp %o0, 0 2006cc4: 06 80 00 6c bl 2006e74 2006cc8: 80 a6 60 00 cmp %i1, 0 pthread_mutex_unlock(&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EBADF); } /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { 2006ccc: 02 80 00 3b be 2006db8 2006cd0: 92 10 00 18 mov %i0, %o1 pthread_mutex_unlock (&aio_request_queue.mutex); return AIO_CANCELED; } else { AIO_printf ("Cancel request\n"); if (aiocbp->aio_fildes != fildes) { 2006cd4: f8 06 40 00 ld [ %i1 ], %i4 2006cd8: 80 a7 00 18 cmp %i4, %i0 2006cdc: 12 80 00 2f bne 2006d98 2006ce0: 90 17 63 7c or %i5, 0x37c, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EINVAL); } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 2006ce4: 92 10 00 1c mov %i4, %o1 2006ce8: 11 00 80 66 sethi %hi(0x2019800), %o0 2006cec: 94 10 20 00 clr %o2 2006cf0: 40 00 00 cc call 2007020 2006cf4: 90 12 23 c4 or %o0, 0x3c4, %o0 if (r_chain == NULL) { 2006cf8: b0 92 20 00 orcc %o0, 0, %i0 2006cfc: 22 80 00 0f be,a 2006d38 2006d00: ba 17 63 7c or %i5, 0x37c, %i5 return AIO_ALLDONE; } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 2006d04: b8 06 20 1c add %i0, 0x1c, %i4 2006d08: 40 00 04 7a call 2007ef0 2006d0c: 90 10 00 1c mov %i4, %o0 result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 2006d10: 92 10 00 19 mov %i1, %o1 2006d14: 40 00 01 e4 call 20074a4 2006d18: 90 06 20 08 add %i0, 8, %o0 2006d1c: b0 10 00 08 mov %o0, %i0 pthread_mutex_unlock (&r_chain->mutex); 2006d20: 40 00 04 94 call 2007f70 2006d24: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 2006d28: 40 00 04 92 call 2007f70 2006d2c: 90 17 63 7c or %i5, 0x37c, %o0 return result; } return AIO_ALLDONE; } 2006d30: 81 c7 e0 08 ret 2006d34: 81 e8 00 00 restore rtems_set_errno_and_return_minus_one (EINVAL); } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); if (r_chain == NULL) { if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 2006d38: c4 07 60 54 ld [ %i5 + 0x54 ], %g2 2006d3c: 82 07 60 58 add %i5, 0x58, %g1 2006d40: 80 a0 80 01 cmp %g2, %g1 2006d44: 02 80 00 0f be 2006d80 <== NEVER TAKEN 2006d48: 90 07 60 54 add %i5, 0x54, %o0 r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 2006d4c: 92 10 00 1c mov %i4, %o1 2006d50: 40 00 00 b4 call 2007020 2006d54: 94 10 20 00 clr %o2 if (r_chain == NULL) { 2006d58: 80 a2 20 00 cmp %o0, 0 2006d5c: 02 80 00 0e be 2006d94 2006d60: 92 10 00 19 mov %i1, %o1 rtems_set_errno_and_return_minus_one (EINVAL); } AIO_printf ("Request on [IQ]\n"); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 2006d64: 40 00 01 d0 call 20074a4 2006d68: 90 02 20 08 add %o0, 8, %o0 2006d6c: b0 10 00 08 mov %o0, %i0 pthread_mutex_unlock (&aio_request_queue.mutex); 2006d70: 40 00 04 80 call 2007f70 2006d74: 90 10 00 1d mov %i5, %o0 return result; 2006d78: 81 c7 e0 08 ret 2006d7c: 81 e8 00 00 restore } else { pthread_mutex_unlock (&aio_request_queue.mutex); 2006d80: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 2006d84: 40 00 04 7b call 2007f70 2006d88: b0 10 20 02 mov 2, %i0 return AIO_ALLDONE; 2006d8c: 81 c7 e0 08 ret 2006d90: 81 e8 00 00 restore r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); if (r_chain == NULL) { if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); if (r_chain == NULL) { pthread_mutex_unlock (&aio_request_queue.mutex); 2006d94: 90 10 00 1d mov %i5, %o0 2006d98: 40 00 04 76 call 2007f70 2006d9c: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one (EINVAL); 2006da0: 40 00 2c aa call 2012048 <__errno> 2006da4: 01 00 00 00 nop 2006da8: 82 10 20 16 mov 0x16, %g1 ! 16 2006dac: c2 22 00 00 st %g1, [ %o0 ] 2006db0: 81 c7 e0 08 ret 2006db4: 81 e8 00 00 restore /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { AIO_printf ("Cancel all requests\n"); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 2006db8: 11 00 80 66 sethi %hi(0x2019800), %o0 2006dbc: 94 10 20 00 clr %o2 2006dc0: 40 00 00 98 call 2007020 2006dc4: 90 12 23 c4 or %o0, 0x3c4, %o0 if (r_chain == NULL) { 2006dc8: b8 92 20 00 orcc %o0, 0, %i4 2006dcc: 02 80 00 0f be 2006e08 2006dd0: b2 07 20 1c add %i4, 0x1c, %i1 return AIO_ALLDONE; } AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 2006dd4: 40 00 04 47 call 2007ef0 2006dd8: 90 10 00 19 mov %i1, %o0 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 2006ddc: 40 00 0b 02 call 20099e4 <_Chain_Extract> 2006de0: 90 10 00 1c mov %i4, %o0 rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 2006de4: 40 00 01 9c call 2007454 2006de8: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&r_chain->mutex); 2006dec: 40 00 04 61 call 2007f70 2006df0: 90 10 00 19 mov %i1, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 2006df4: 90 17 63 7c or %i5, 0x37c, %o0 2006df8: 40 00 04 5e call 2007f70 2006dfc: b0 10 20 00 clr %i0 return AIO_CANCELED; 2006e00: 81 c7 e0 08 ret 2006e04: 81 e8 00 00 restore */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 2006e08: ba 17 63 7c or %i5, 0x37c, %i5 r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); if (r_chain == NULL) { AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 2006e0c: c4 07 60 54 ld [ %i5 + 0x54 ], %g2 2006e10: 82 07 60 58 add %i5, 0x58, %g1 2006e14: 80 a0 80 01 cmp %g2, %g1 2006e18: 02 bf ff da be 2006d80 <== NEVER TAKEN 2006e1c: 90 07 60 54 add %i5, 0x54, %o0 r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 2006e20: 92 10 00 18 mov %i0, %o1 2006e24: 40 00 00 7f call 2007020 2006e28: 94 10 20 00 clr %o2 if (r_chain == NULL) { 2006e2c: b8 92 20 00 orcc %o0, 0, %i4 2006e30: 22 bf ff d5 be,a 2006d84 2006e34: 90 10 00 1d mov %i5, %o0 2006e38: 40 00 0a eb call 20099e4 <_Chain_Extract> 2006e3c: b2 07 20 1c add %i4, 0x1c, %i1 } AIO_printf ("Request chain on [IQ]\n"); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 2006e40: 40 00 01 85 call 2007454 2006e44: 90 10 00 1c mov %i4, %o0 pthread_mutex_destroy (&r_chain->mutex); 2006e48: 40 00 03 7f call 2007c44 2006e4c: 90 10 00 19 mov %i1, %o0 pthread_cond_destroy (&r_chain->mutex); 2006e50: 40 00 02 9e call 20078c8 2006e54: 90 10 00 19 mov %i1, %o0 free (r_chain); 2006e58: 7f ff f2 03 call 2003664 2006e5c: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); return AIO_CANCELED; 2006e60: b0 10 20 00 clr %i0 rtems_aio_remove_fd (r_chain); pthread_mutex_destroy (&r_chain->mutex); pthread_cond_destroy (&r_chain->mutex); free (r_chain); pthread_mutex_unlock (&aio_request_queue.mutex); 2006e64: 40 00 04 43 call 2007f70 2006e68: 90 10 00 1d mov %i5, %o0 return AIO_CANCELED; 2006e6c: 81 c7 e0 08 ret 2006e70: 81 e8 00 00 restore int result; pthread_mutex_lock (&aio_request_queue.mutex); if (fcntl (fildes, F_GETFD) < 0) { pthread_mutex_unlock(&aio_request_queue.mutex); 2006e74: 40 00 04 3f call 2007f70 2006e78: 90 17 63 7c or %i5, 0x37c, %o0 rtems_set_errno_and_return_minus_one (EBADF); 2006e7c: 40 00 2c 73 call 2012048 <__errno> 2006e80: b0 10 3f ff mov -1, %i0 2006e84: 82 10 20 09 mov 9, %g1 2006e88: c2 22 00 00 st %g1, [ %o0 ] 2006e8c: 81 c7 e0 08 ret 2006e90: 81 e8 00 00 restore =============================================================================== 02006e9c : int aio_fsync( int op, struct aiocb *aiocbp ) { 2006e9c: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; if (op != O_SYNC) 2006ea0: 03 00 00 08 sethi %hi(0x2000), %g1 2006ea4: 80 a6 00 01 cmp %i0, %g1 2006ea8: 12 80 00 14 bne 2006ef8 2006eac: ba 10 20 16 mov 0x16, %i5 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); 2006eb0: d0 06 40 00 ld [ %i1 ], %o0 2006eb4: 40 00 1e 11 call 200e6f8 2006eb8: 92 10 20 03 mov 3, %o1 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 2006ebc: 90 0a 20 03 and %o0, 3, %o0 2006ec0: 90 02 3f ff add %o0, -1, %o0 2006ec4: 80 a2 20 01 cmp %o0, 1 2006ec8: 18 80 00 0c bgu 2006ef8 2006ecc: ba 10 20 09 mov 9, %i5 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); 2006ed0: 7f ff f3 70 call 2003c90 2006ed4: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 2006ed8: 80 a2 20 00 cmp %o0, 0 2006edc: 02 80 00 06 be 2006ef4 <== NEVER TAKEN 2006ee0: 82 10 20 03 mov 3, %g1 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 2006ee4: f2 22 20 14 st %i1, [ %o0 + 0x14 ] req->aiocbp->aio_lio_opcode = LIO_SYNC; 2006ee8: c2 26 60 30 st %g1, [ %i1 + 0x30 ] return rtems_aio_enqueue (req); 2006eec: 40 00 01 8a call 2007514 2006ef0: 91 e8 00 08 restore %g0, %o0, %o0 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 2006ef4: ba 10 20 0b mov 0xb, %i5 <== NOT EXECUTED 2006ef8: 82 10 3f ff mov -1, %g1 2006efc: fa 26 60 34 st %i5, [ %i1 + 0x34 ] 2006f00: c2 26 60 38 st %g1, [ %i1 + 0x38 ] 2006f04: 40 00 2c 51 call 2012048 <__errno> 2006f08: b0 10 3f ff mov -1, %i0 2006f0c: fa 22 00 00 st %i5, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); } 2006f10: 81 c7 e0 08 ret 2006f14: 81 e8 00 00 restore =============================================================================== 020076f8 : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 20076f8: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 20076fc: d0 06 00 00 ld [ %i0 ], %o0 2007700: 40 00 1b fe call 200e6f8 2007704: 92 10 20 03 mov 3, %o1 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 2007708: 90 0a 20 03 and %o0, 3, %o0 200770c: 80 a2 20 02 cmp %o0, 2 2007710: 12 80 00 1b bne 200777c 2007714: 80 a2 20 00 cmp %o0, 0 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 2007718: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 200771c: 80 a0 60 00 cmp %g1, 0 2007720: 12 80 00 0f bne 200775c 2007724: ba 10 20 16 mov 0x16, %i5 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 2007728: c2 06 20 08 ld [ %i0 + 8 ], %g1 200772c: 80 a0 60 00 cmp %g1, 0 2007730: 06 80 00 0c bl 2007760 2007734: 82 10 3f ff mov -1, %g1 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 2007738: 7f ff f1 56 call 2003c90 200773c: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 2007740: 80 a2 20 00 cmp %o0, 0 2007744: 02 80 00 12 be 200778c <== NEVER TAKEN 2007748: 82 10 20 01 mov 1, %g1 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 200774c: f0 22 20 14 st %i0, [ %o0 + 0x14 ] req->aiocbp->aio_lio_opcode = LIO_READ; 2007750: c2 26 20 30 st %g1, [ %i0 + 0x30 ] return rtems_aio_enqueue (req); 2007754: 7f ff ff 70 call 2007514 2007758: 91 e8 00 08 restore %g0, %o0, %o0 if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 200775c: 82 10 3f ff mov -1, %g1 2007760: fa 26 20 34 st %i5, [ %i0 + 0x34 ] 2007764: c2 26 20 38 st %g1, [ %i0 + 0x38 ] 2007768: 40 00 2a 38 call 2012048 <__errno> 200776c: b0 10 3f ff mov -1, %i0 2007770: fa 22 00 00 st %i5, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); } 2007774: 81 c7 e0 08 ret 2007778: 81 e8 00 00 restore { rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 200777c: 02 bf ff e7 be 2007718 <== NEVER TAKEN 2007780: ba 10 20 09 mov 9, %i5 if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 2007784: 10 bf ff f7 b 2007760 2007788: 82 10 3f ff mov -1, %g1 200778c: 10 bf ff f4 b 200775c <== NOT EXECUTED 2007790: ba 10 20 0b mov 0xb, %i5 <== NOT EXECUTED =============================================================================== 0200779c : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 200779c: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 20077a0: d0 06 00 00 ld [ %i0 ], %o0 20077a4: 40 00 1b d5 call 200e6f8 20077a8: 92 10 20 03 mov 3, %o1 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 20077ac: 90 0a 20 03 and %o0, 3, %o0 20077b0: 90 02 3f ff add %o0, -1, %o0 20077b4: 80 a2 20 01 cmp %o0, 1 20077b8: 18 80 00 14 bgu 2007808 20077bc: ba 10 20 09 mov 9, %i5 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 20077c0: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 20077c4: 80 a0 60 00 cmp %g1, 0 20077c8: 12 80 00 10 bne 2007808 20077cc: ba 10 20 16 mov 0x16, %i5 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 20077d0: c2 06 20 08 ld [ %i0 + 8 ], %g1 20077d4: 80 a0 60 00 cmp %g1, 0 20077d8: 06 80 00 0d bl 200780c 20077dc: 82 10 3f ff mov -1, %g1 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 20077e0: 7f ff f1 2c call 2003c90 20077e4: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 20077e8: 80 a2 20 00 cmp %o0, 0 20077ec: 02 80 00 06 be 2007804 <== NEVER TAKEN 20077f0: 82 10 20 02 mov 2, %g1 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 20077f4: f0 22 20 14 st %i0, [ %o0 + 0x14 ] req->aiocbp->aio_lio_opcode = LIO_WRITE; 20077f8: c2 26 20 30 st %g1, [ %i0 + 0x30 ] return rtems_aio_enqueue (req); 20077fc: 7f ff ff 46 call 2007514 2007800: 91 e8 00 08 restore %g0, %o0, %o0 if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 2007804: ba 10 20 0b mov 0xb, %i5 <== NOT EXECUTED 2007808: 82 10 3f ff mov -1, %g1 200780c: fa 26 20 34 st %i5, [ %i0 + 0x34 ] 2007810: c2 26 20 38 st %g1, [ %i0 + 0x38 ] 2007814: 40 00 2a 0d call 2012048 <__errno> 2007818: b0 10 3f ff mov -1, %i0 200781c: fa 22 00 00 st %i5, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); } 2007820: 81 c7 e0 08 ret 2007824: 81 e8 00 00 restore =============================================================================== 02002afc : #include int chroot( const char *pathname ) { 2002afc: 9d e3 bf 88 save %sp, -120, %sp 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) { 2002b00: 3b 00 80 59 sethi %hi(0x2016400), %i5 2002b04: f8 07 60 a8 ld [ %i5 + 0xa8 ], %i4 ! 20164a8 2002b08: 03 00 80 5b sethi %hi(0x2016c00), %g1 2002b0c: 82 10 62 64 or %g1, 0x264, %g1 ! 2016e64 2002b10: 80 a7 00 01 cmp %i4, %g1 2002b14: 02 80 00 20 be 2002b94 2002b18: 01 00 00 00 nop rtems_libio_set_private_env(); /* try to set a new private env*/ if (rtems_current_user_env == &rtems_global_user_env) /* not ok */ rtems_set_errno_and_return_minus_one( ENOTSUP ); } result = chdir(pathname); 2002b1c: 40 00 24 87 call 200bd38 2002b20: 90 10 00 18 mov %i0, %o0 if (result) { 2002b24: 80 a2 20 00 cmp %o0, 0 2002b28: 12 80 00 27 bne 2002bc4 2002b2c: 92 10 20 01 mov 1, %o1 rtems_set_errno_and_return_minus_one( errno ); } /* clone the new root location */ if (rtems_filesystem_evaluate_path(".", 1, 0, &loc, 0)) { 2002b30: 11 00 80 55 sethi %hi(0x2015400), %o0 2002b34: 94 10 20 00 clr %o2 2002b38: 90 12 23 30 or %o0, 0x330, %o0 2002b3c: 96 07 bf ec add %fp, -20, %o3 2002b40: 40 00 00 68 call 2002ce0 2002b44: 98 10 20 00 clr %o4 2002b48: 80 a2 20 00 cmp %o0, 0 2002b4c: 12 80 00 1e bne 2002bc4 <== NEVER TAKEN 2002b50: d0 07 60 a8 ld [ %i5 + 0xa8 ], %o0 rtems_set_errno_and_return_minus_one( errno ); } rtems_filesystem_freenode(&rtems_filesystem_root); rtems_filesystem_root = loc; return 0; 2002b54: b0 10 20 00 clr %i0 /* clone the new root location */ if (rtems_filesystem_evaluate_path(".", 1, 0, &loc, 0)) { /* our cwd has changed, though - but there is no easy way of return :-( */ rtems_set_errno_and_return_minus_one( errno ); } rtems_filesystem_freenode(&rtems_filesystem_root); 2002b58: 40 00 00 9c call 2002dc8 2002b5c: 90 02 20 18 add %o0, 0x18, %o0 rtems_filesystem_root = loc; 2002b60: c2 07 60 a8 ld [ %i5 + 0xa8 ], %g1 2002b64: c4 07 bf ec ld [ %fp + -20 ], %g2 2002b68: c4 20 60 18 st %g2, [ %g1 + 0x18 ] 2002b6c: c4 07 bf f0 ld [ %fp + -16 ], %g2 2002b70: c4 20 60 1c st %g2, [ %g1 + 0x1c ] 2002b74: c4 07 bf f4 ld [ %fp + -12 ], %g2 2002b78: c4 20 60 20 st %g2, [ %g1 + 0x20 ] 2002b7c: c4 07 bf f8 ld [ %fp + -8 ], %g2 2002b80: c4 20 60 24 st %g2, [ %g1 + 0x24 ] 2002b84: c4 07 bf fc ld [ %fp + -4 ], %g2 2002b88: c4 20 60 28 st %g2, [ %g1 + 0x28 ] return 0; } 2002b8c: 81 c7 e0 08 ret 2002b90: 81 e8 00 00 restore int result; rtems_filesystem_location_info_t loc; /* an automatic call to new private env the first time */ if (rtems_current_user_env == &rtems_global_user_env) { rtems_libio_set_private_env(); /* try to set a new private env*/ 2002b94: 40 00 05 0c call 2003fc4 2002b98: 01 00 00 00 nop if (rtems_current_user_env == &rtems_global_user_env) /* not ok */ 2002b9c: c2 07 60 a8 ld [ %i5 + 0xa8 ], %g1 2002ba0: 80 a0 40 1c cmp %g1, %i4 2002ba4: 12 bf ff de bne 2002b1c 2002ba8: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOTSUP ); 2002bac: 40 00 33 45 call 200f8c0 <__errno> 2002bb0: b0 10 3f ff mov -1, %i0 ! ffffffff 2002bb4: 82 10 20 86 mov 0x86, %g1 2002bb8: c2 22 00 00 st %g1, [ %o0 ] 2002bbc: 81 c7 e0 08 ret 2002bc0: 81 e8 00 00 restore } /* clone the new root location */ if (rtems_filesystem_evaluate_path(".", 1, 0, &loc, 0)) { /* our cwd has changed, though - but there is no easy way of return :-( */ rtems_set_errno_and_return_minus_one( errno ); 2002bc4: 40 00 33 3f call 200f8c0 <__errno> 2002bc8: b0 10 3f ff mov -1, %i0 2002bcc: 40 00 33 3d call 200f8c0 <__errno> 2002bd0: ba 10 00 08 mov %o0, %i5 2002bd4: c2 02 00 00 ld [ %o0 ], %g1 2002bd8: c2 27 40 00 st %g1, [ %i5 ] 2002bdc: 81 c7 e0 08 ret 2002be0: 81 e8 00 00 restore =============================================================================== 0200629c : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 200629c: 9d e3 bf a0 save %sp, -96, %sp if ( !tp ) 20062a0: 80 a6 60 00 cmp %i1, 0 20062a4: 02 80 00 20 be 2006324 20062a8: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 20062ac: 02 80 00 19 be 2006310 20062b0: 80 a6 20 04 cmp %i0, 4 _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 20062b4: 02 80 00 12 be 20062fc <== NEVER TAKEN 20062b8: 80 a6 20 02 cmp %i0, 2 return 0; } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { 20062bc: 02 80 00 10 be 20062fc 20062c0: 80 a6 20 03 cmp %i0, 3 return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) 20062c4: 02 80 00 08 be 20062e4 20062c8: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); #endif rtems_set_errno_and_return_minus_one( EINVAL ); 20062cc: 40 00 28 f2 call 2010694 <__errno> 20062d0: b0 10 3f ff mov -1, %i0 ! ffffffff 20062d4: 82 10 20 16 mov 0x16, %g1 20062d8: c2 22 00 00 st %g1, [ %o0 ] return 0; } 20062dc: 81 c7 e0 08 ret 20062e0: 81 e8 00 00 restore } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) rtems_set_errno_and_return_minus_one( ENOSYS ); 20062e4: 40 00 28 ec call 2010694 <__errno> 20062e8: b0 10 3f ff mov -1, %i0 20062ec: 82 10 20 58 mov 0x58, %g1 20062f0: c2 22 00 00 st %g1, [ %o0 ] 20062f4: 81 c7 e0 08 ret 20062f8: 81 e8 00 00 restore } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { _TOD_Get_uptime_as_timespec( tp ); 20062fc: 90 10 00 19 mov %i1, %o0 2006300: 40 00 08 35 call 20083d4 <_TOD_Get_uptime_as_timespec> 2006304: b0 10 20 00 clr %i0 return 0; 2006308: 81 c7 e0 08 ret 200630c: 81 e8 00 00 restore { if ( !tp ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { _TOD_Get(tp); 2006310: 90 10 00 19 mov %i1, %o0 2006314: 40 00 08 15 call 2008368 <_TOD_Get> 2006318: b0 10 20 00 clr %i0 return 0; 200631c: 81 c7 e0 08 ret 2006320: 81 e8 00 00 restore clockid_t clock_id, struct timespec *tp ) { if ( !tp ) rtems_set_errno_and_return_minus_one( EINVAL ); 2006324: 40 00 28 dc call 2010694 <__errno> 2006328: b0 10 3f ff mov -1, %i0 200632c: 82 10 20 16 mov 0x16, %g1 2006330: c2 22 00 00 st %g1, [ %o0 ] 2006334: 81 c7 e0 08 ret 2006338: 81 e8 00 00 restore =============================================================================== 0200633c : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 200633c: 9d e3 bf a0 save %sp, -96, %sp if ( !tp ) 2006340: 80 a6 60 00 cmp %i1, 0 2006344: 02 80 00 25 be 20063d8 <== NEVER TAKEN 2006348: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 200634c: 02 80 00 0c be 200637c 2006350: 80 a6 20 02 cmp %i0, 2 _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME ) 2006354: 02 80 00 1b be 20063c0 2006358: 80 a6 20 03 cmp %i0, 3 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) 200635c: 02 80 00 19 be 20063c0 2006360: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 2006364: 40 00 28 cc call 2010694 <__errno> 2006368: b0 10 3f ff mov -1, %i0 ! ffffffff 200636c: 82 10 20 16 mov 0x16, %g1 2006370: c2 22 00 00 st %g1, [ %o0 ] return 0; } 2006374: 81 c7 e0 08 ret 2006378: 81 e8 00 00 restore { if ( !tp ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 200637c: c4 06 40 00 ld [ %i1 ], %g2 2006380: 03 08 76 b9 sethi %hi(0x21dae400), %g1 2006384: 82 10 60 ff or %g1, 0xff, %g1 ! 21dae4ff 2006388: 80 a0 80 01 cmp %g2, %g1 200638c: 08 80 00 13 bleu 20063d8 2006390: 03 00 80 7d sethi %hi(0x201f400), %g1 /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 2006394: c4 00 60 20 ld [ %g1 + 0x20 ], %g2 ! 201f420 <_Thread_Dispatch_disable_level> 2006398: 84 00 a0 01 inc %g2 200639c: c4 20 60 20 st %g2, [ %g1 + 0x20 ] return _Thread_Dispatch_disable_level; 20063a0: c2 00 60 20 ld [ %g1 + 0x20 ], %g1 rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); 20063a4: 90 10 00 19 mov %i1, %o0 20063a8: 40 00 08 23 call 2008434 <_TOD_Set> 20063ac: b0 10 20 00 clr %i0 _Thread_Enable_dispatch(); 20063b0: 40 00 0e 91 call 2009df4 <_Thread_Enable_dispatch> 20063b4: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 20063b8: 81 c7 e0 08 ret 20063bc: 81 e8 00 00 restore else if ( clock_id == CLOCK_PROCESS_CPUTIME ) rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) rtems_set_errno_and_return_minus_one( ENOSYS ); 20063c0: 40 00 28 b5 call 2010694 <__errno> 20063c4: b0 10 3f ff mov -1, %i0 20063c8: 82 10 20 58 mov 0x58, %g1 20063cc: c2 22 00 00 st %g1, [ %o0 ] 20063d0: 81 c7 e0 08 ret 20063d4: 81 e8 00 00 restore if ( !tp ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) rtems_set_errno_and_return_minus_one( EINVAL ); 20063d8: 40 00 28 af call 2010694 <__errno> 20063dc: b0 10 3f ff mov -1, %i0 20063e0: 82 10 20 16 mov 0x16, %g1 20063e4: c2 22 00 00 st %g1, [ %o0 ] 20063e8: 81 c7 e0 08 ret 20063ec: 81 e8 00 00 restore =============================================================================== 0200a888 : const char *pathname, size_t pathnamelen, int flags, rtems_filesystem_location_info_t *pathloc ) { 200a888: 9d e3 bf a0 save %sp, -96, %sp int i; rtems_device_name_t *device_name_table; /* see if 'flags' is valid */ if ( !rtems_libio_is_valid_perms( flags ) ) 200a88c: 80 8e bf f8 btst -8, %i2 200a890: 12 80 00 33 bne 200a95c <== NEVER TAKEN 200a894: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EPERM ); /* get the device name table */ device_name_table = (rtems_device_name_t *)pathloc->node_access; 200a898: f4 06 c0 00 ld [ %i3 ], %i2 if (!device_name_table) 200a89c: 80 a6 a0 00 cmp %i2, 0 200a8a0: 02 80 00 35 be 200a974 200a8a4: 03 00 80 63 sethi %hi(0x2018c00), %g1 rtems_set_errno_and_return_minus_one( EFAULT ); for (i = 0; i < rtems_device_table_size; i++) { 200a8a8: e0 00 62 60 ld [ %g1 + 0x260 ], %l0 ! 2018e60 * handlers. */ extern rtems_filesystem_file_handlers_r devFS_file_handlers; int devFS_evaluate_path( 200a8ac: ba 10 20 00 clr %i5 /* 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++) { 200a8b0: 80 a4 20 00 cmp %l0, 0 200a8b4: 02 80 00 18 be 200a914 <== NEVER TAKEN 200a8b8: 82 10 20 00 clr %g1 if (!device_name_table[i].device_name) 200a8bc: a3 28 60 02 sll %g1, 2, %l1 200a8c0: 83 28 60 04 sll %g1, 4, %g1 200a8c4: a2 04 40 01 add %l1, %g1, %l1 200a8c8: f8 06 80 11 ld [ %i2 + %l1 ], %i4 200a8cc: 80 a7 20 00 cmp %i4, 0 200a8d0: 02 80 00 0d be 200a904 200a8d4: a2 06 80 11 add %i2, %l1, %l1 continue; if (strncmp(pathname, device_name_table[i].device_name, pathnamelen) != 0) 200a8d8: 90 10 00 18 mov %i0, %o0 200a8dc: 92 10 00 1c mov %i4, %o1 200a8e0: 40 00 0f 53 call 200e62c 200a8e4: 94 10 00 19 mov %i1, %o2 200a8e8: 80 a2 20 00 cmp %o0, 0 200a8ec: 32 80 00 07 bne,a 200a908 200a8f0: ba 07 60 01 inc %i5 continue; if (device_name_table[i].device_name[pathnamelen] != '\0') 200a8f4: c2 4f 00 19 ldsb [ %i4 + %i1 ], %g1 200a8f8: 80 a0 60 00 cmp %g1, 0 200a8fc: 02 80 00 0c be 200a92c 200a900: 03 00 80 63 sethi %hi(0x2018c00), %g1 /* 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++) { 200a904: ba 07 60 01 inc %i5 200a908: 80 a7 40 10 cmp %i5, %l0 200a90c: 12 bf ff ec bne 200a8bc 200a910: 82 10 00 1d mov %i5, %g1 pathloc->mt_entry = rtems_filesystem_root.mt_entry; return 0; } /* no such file or directory */ rtems_set_errno_and_return_minus_one( ENOENT ); 200a914: 40 00 0b 99 call 200d778 <__errno> 200a918: b0 10 3f ff mov -1, %i0 200a91c: 82 10 20 02 mov 2, %g1 200a920: c2 22 00 00 st %g1, [ %o0 ] } 200a924: 81 c7 e0 08 ret 200a928: 81 e8 00 00 restore /* find the device, set proper values */ pathloc->node_access = (void *)&device_name_table[i]; pathloc->handlers = &devFS_file_handlers; pathloc->ops = &devFS_ops; pathloc->mt_entry = rtems_filesystem_root.mt_entry; 200a92c: c2 00 63 c8 ld [ %g1 + 0x3c8 ], %g1 if (device_name_table[i].device_name[pathnamelen] != '\0') continue; /* find the device, set proper values */ pathloc->node_access = (void *)&device_name_table[i]; pathloc->handlers = &devFS_file_handlers; 200a930: 05 00 80 63 sethi %hi(0x2018c00), %g2 pathloc->ops = &devFS_ops; pathloc->mt_entry = rtems_filesystem_root.mt_entry; 200a934: c2 00 60 28 ld [ %g1 + 0x28 ], %g1 if (device_name_table[i].device_name[pathnamelen] != '\0') continue; /* find the device, set proper values */ pathloc->node_access = (void *)&device_name_table[i]; pathloc->handlers = &devFS_file_handlers; 200a938: 84 10 a3 28 or %g2, 0x328, %g2 if (device_name_table[i].device_name[pathnamelen] != '\0') continue; /* find the device, set proper values */ pathloc->node_access = (void *)&device_name_table[i]; 200a93c: e2 26 c0 00 st %l1, [ %i3 ] pathloc->handlers = &devFS_file_handlers; 200a940: c4 26 e0 08 st %g2, [ %i3 + 8 ] pathloc->ops = &devFS_ops; pathloc->mt_entry = rtems_filesystem_root.mt_entry; 200a944: c2 26 e0 10 st %g1, [ %i3 + 0x10 ] continue; /* find the device, set proper values */ pathloc->node_access = (void *)&device_name_table[i]; pathloc->handlers = &devFS_file_handlers; pathloc->ops = &devFS_ops; 200a948: 05 00 80 63 sethi %hi(0x2018c00), %g2 200a94c: 84 10 a3 60 or %g2, 0x360, %g2 ! 2018f60 200a950: c4 26 e0 0c st %g2, [ %i3 + 0xc ] pathloc->mt_entry = rtems_filesystem_root.mt_entry; return 0; 200a954: 81 c7 e0 08 ret 200a958: 91 e8 20 00 restore %g0, 0, %o0 int i; rtems_device_name_t *device_name_table; /* see if 'flags' is valid */ if ( !rtems_libio_is_valid_perms( flags ) ) rtems_set_errno_and_return_minus_one( EPERM ); 200a95c: 40 00 0b 87 call 200d778 <__errno> <== NOT EXECUTED 200a960: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 200a964: 82 10 20 01 mov 1, %g1 <== NOT EXECUTED 200a968: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 200a96c: 81 c7 e0 08 ret <== NOT EXECUTED 200a970: 81 e8 00 00 restore <== NOT EXECUTED /* 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 ); 200a974: 40 00 0b 81 call 200d778 <__errno> 200a978: b0 10 3f ff mov -1, %i0 200a97c: 82 10 20 0e mov 0xe, %g1 200a980: c2 22 00 00 st %g1, [ %o0 ] 200a984: 81 c7 e0 08 ret 200a988: 81 e8 00 00 restore =============================================================================== 02002df8 : const char *path, mode_t mode, dev_t dev, rtems_filesystem_location_info_t *pathloc ) { 2002df8: 9d e3 bf a0 save %sp, -96, %sp * 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') && 2002dfc: c2 4e 00 00 ldsb [ %i0 ], %g1 2002e00: 80 a0 60 64 cmp %g1, 0x64 2002e04: 02 80 00 43 be 2002f10 2002e08: ba 10 00 18 mov %i0, %i5 (path[2] == 'v') && (path[3] == '\0')) return 0; /* must be a character device or a block device */ if (!S_ISBLK(mode) && !S_ISCHR(mode)) 2002e0c: 03 00 00 3c sethi %hi(0xf000), %g1 2002e10: 05 00 00 08 sethi %hi(0x2000), %g2 2002e14: 82 0e 40 01 and %i1, %g1, %g1 2002e18: 80 a0 40 02 cmp %g1, %g2 2002e1c: 12 80 00 4b bne 2002f48 2002e20: 05 00 00 18 sethi %hi(0x6000), %g2 rtems_set_errno_and_return_minus_one( EINVAL ); else rtems_filesystem_split_dev_t(dev, major, minor); /* Find an empty slot in device name table */ device_name_table = (rtems_device_name_t *)pathloc->node_access; 2002e24: f0 07 00 00 ld [ %i4 ], %i0 if (!device_name_table) 2002e28: 80 a6 20 00 cmp %i0, 0 2002e2c: 02 80 00 56 be 2002f84 2002e30: 03 00 80 63 sethi %hi(0x2018c00), %g1 rtems_set_errno_and_return_minus_one( EFAULT ); for (slot = -1, i = 0; i < rtems_device_table_size; i++){ 2002e34: e0 00 62 60 ld [ %g1 + 0x260 ], %l0 ! 2018e60 2002e38: 80 a4 20 00 cmp %l0, 0 2002e3c: 02 80 00 4c be 2002f6c 2002e40: 82 10 20 00 clr %g1 #include #include #include "devfs.h" int devFS_mknod( 2002e44: a2 10 3f ff mov -1, %l1 2002e48: 10 80 00 0a b 2002e70 2002e4c: b8 10 20 00 clr %i4 for (slot = -1, i = 0; i < rtems_device_table_size; i++){ if (device_name_table[i].device_name == NULL) slot = i; else if (strcmp(path, device_name_table[i].device_name) == 0) 2002e50: 40 00 2d 87 call 200e46c 2002e54: 01 00 00 00 nop 2002e58: 80 a2 20 00 cmp %o0, 0 2002e5c: 02 80 00 27 be 2002ef8 2002e60: b8 07 20 01 inc %i4 /* 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++){ 2002e64: 80 a7 00 10 cmp %i4, %l0 2002e68: 02 80 00 0e be 2002ea0 2002e6c: 82 10 00 1c mov %i4, %g1 if (device_name_table[i].device_name == NULL) 2002e70: 85 28 60 02 sll %g1, 2, %g2 2002e74: 83 28 60 04 sll %g1, 4, %g1 2002e78: 82 00 80 01 add %g2, %g1, %g1 2002e7c: d2 06 00 01 ld [ %i0 + %g1 ], %o1 2002e80: 80 a2 60 00 cmp %o1, 0 2002e84: 12 bf ff f3 bne 2002e50 2002e88: 90 10 00 1d mov %i5, %o0 2002e8c: a2 10 00 1c mov %i4, %l1 /* 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++){ 2002e90: b8 07 20 01 inc %i4 2002e94: 80 a7 00 10 cmp %i4, %l0 2002e98: 12 bf ff f6 bne 2002e70 2002e9c: 82 10 00 1c mov %i4, %g1 else if (strcmp(path, device_name_table[i].device_name) == 0) rtems_set_errno_and_return_minus_one( EEXIST ); } if (slot == -1) 2002ea0: 80 a4 7f ff cmp %l1, -1 2002ea4: 02 80 00 32 be 2002f6c <== NEVER TAKEN 2002ea8: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOMEM ); _ISR_Disable(level); 2002eac: 7f ff ff 44 call 2002bbc 2002eb0: 01 00 00 00 nop 2002eb4: a0 10 00 08 mov %o0, %l0 device_name_table[slot].device_name = (char *)path; 2002eb8: 83 2c 60 02 sll %l1, 2, %g1 device_name_table[slot].device_name_length = strlen(path); 2002ebc: 90 10 00 1d mov %i5, %o0 if (slot == -1) rtems_set_errno_and_return_minus_one( ENOMEM ); _ISR_Disable(level); device_name_table[slot].device_name = (char *)path; 2002ec0: a3 2c 60 04 sll %l1, 4, %l1 2002ec4: a2 00 40 11 add %g1, %l1, %l1 2002ec8: b8 06 00 11 add %i0, %l1, %i4 device_name_table[slot].device_name_length = strlen(path); 2002ecc: 40 00 2d a2 call 200e554 2002ed0: fa 26 00 11 st %i5, [ %i0 + %l1 ] device_name_table[slot].major = major; 2002ed4: f4 27 20 08 st %i2, [ %i4 + 8 ] if (slot == -1) rtems_set_errno_and_return_minus_one( ENOMEM ); _ISR_Disable(level); device_name_table[slot].device_name = (char *)path; device_name_table[slot].device_name_length = strlen(path); 2002ed8: d0 27 20 04 st %o0, [ %i4 + 4 ] device_name_table[slot].major = major; device_name_table[slot].minor = minor; 2002edc: f6 27 20 0c st %i3, [ %i4 + 0xc ] device_name_table[slot].mode = mode; 2002ee0: f2 27 20 10 st %i1, [ %i4 + 0x10 ] _ISR_Enable(level); return 0; 2002ee4: b0 10 20 00 clr %i0 device_name_table[slot].device_name = (char *)path; device_name_table[slot].device_name_length = strlen(path); device_name_table[slot].major = major; device_name_table[slot].minor = minor; device_name_table[slot].mode = mode; _ISR_Enable(level); 2002ee8: 7f ff ff 39 call 2002bcc 2002eec: 90 10 00 10 mov %l0, %o0 return 0; } 2002ef0: 81 c7 e0 08 ret 2002ef4: 81 e8 00 00 restore for (slot = -1, i = 0; i < rtems_device_table_size; i++){ if (device_name_table[i].device_name == NULL) slot = i; else if (strcmp(path, device_name_table[i].device_name) == 0) rtems_set_errno_and_return_minus_one( EEXIST ); 2002ef8: 40 00 2a 20 call 200d778 <__errno> 2002efc: b0 10 3f ff mov -1, %i0 2002f00: 82 10 20 11 mov 0x11, %g1 2002f04: c2 22 00 00 st %g1, [ %o0 ] 2002f08: 81 c7 e0 08 ret 2002f0c: 81 e8 00 00 restore * 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') && 2002f10: c2 4e 20 01 ldsb [ %i0 + 1 ], %g1 2002f14: 80 a0 60 65 cmp %g1, 0x65 2002f18: 12 bf ff be bne 2002e10 <== NEVER TAKEN 2002f1c: 03 00 00 3c sethi %hi(0xf000), %g1 2002f20: c2 4e 20 02 ldsb [ %i0 + 2 ], %g1 2002f24: 80 a0 60 76 cmp %g1, 0x76 2002f28: 12 bf ff ba bne 2002e10 <== NEVER TAKEN 2002f2c: 03 00 00 3c sethi %hi(0xf000), %g1 (path[2] == 'v') && (path[3] == '\0')) 2002f30: c2 4e 20 03 ldsb [ %i0 + 3 ], %g1 2002f34: 80 a0 60 00 cmp %g1, 0 2002f38: 12 bf ff b5 bne 2002e0c 2002f3c: b0 10 20 00 clr %i0 device_name_table[slot].minor = minor; device_name_table[slot].mode = mode; _ISR_Enable(level); return 0; } 2002f40: 81 c7 e0 08 ret 2002f44: 81 e8 00 00 restore if ((path[0] == 'd') && (path[1] == 'e') && (path[2] == 'v') && (path[3] == '\0')) return 0; /* must be a character device or a block device */ if (!S_ISBLK(mode) && !S_ISCHR(mode)) 2002f48: 80 a0 40 02 cmp %g1, %g2 2002f4c: 22 bf ff b7 be,a 2002e28 2002f50: f0 07 00 00 ld [ %i4 ], %i0 rtems_set_errno_and_return_minus_one( EINVAL ); 2002f54: 40 00 2a 09 call 200d778 <__errno> 2002f58: b0 10 3f ff mov -1, %i0 2002f5c: 82 10 20 16 mov 0x16, %g1 2002f60: c2 22 00 00 st %g1, [ %o0 ] 2002f64: 81 c7 e0 08 ret 2002f68: 81 e8 00 00 restore if (strcmp(path, device_name_table[i].device_name) == 0) rtems_set_errno_and_return_minus_one( EEXIST ); } if (slot == -1) rtems_set_errno_and_return_minus_one( ENOMEM ); 2002f6c: 40 00 2a 03 call 200d778 <__errno> 2002f70: b0 10 3f ff mov -1, %i0 2002f74: 82 10 20 0c mov 0xc, %g1 2002f78: c2 22 00 00 st %g1, [ %o0 ] 2002f7c: 81 c7 e0 08 ret 2002f80: 81 e8 00 00 restore 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 ); 2002f84: 40 00 29 fd call 200d778 <__errno> 2002f88: b0 10 3f ff mov -1, %i0 2002f8c: 82 10 20 0e mov 0xe, %g1 2002f90: c2 22 00 00 st %g1, [ %o0 ] 2002f94: 81 c7 e0 08 ret 2002f98: 81 e8 00 00 restore =============================================================================== 02003f20 : /* * Drain output queue */ static void drainOutput (struct rtems_termios_tty *tty) 2003f20: 9d e3 bf a0 save %sp, -96, %sp { rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); 2003f24: 7f ff f8 99 call 2002188 2003f28: ba 10 00 18 mov %i0, %i5 while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { 2003f2c: c4 06 20 84 ld [ %i0 + 0x84 ], %g2 2003f30: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 2003f34: 80 a0 80 01 cmp %g2, %g1 2003f38: 02 80 00 14 be 2003f88 <== ALWAYS TAKEN 2003f3c: 01 00 00 00 nop tty->rawOutBufState = rob_wait; 2003f40: b8 10 20 02 mov 2, %i4 ! 2 <== NOT EXECUTED 2003f44: f8 27 60 94 st %i4, [ %i5 + 0x94 ] <== NOT EXECUTED rtems_interrupt_enable (level); 2003f48: 7f ff f8 94 call 2002198 <== NOT EXECUTED 2003f4c: 01 00 00 00 nop <== NOT EXECUTED sc = rtems_semaphore_obtain( 2003f50: d0 07 60 8c ld [ %i5 + 0x8c ], %o0 <== NOT EXECUTED 2003f54: 92 10 20 00 clr %o1 <== NOT EXECUTED 2003f58: 40 00 0a 68 call 20068f8 <== NOT EXECUTED 2003f5c: 94 10 20 00 clr %o2 <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 2003f60: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 2003f64: 12 80 00 0b bne 2003f90 <== NOT EXECUTED 2003f68: 01 00 00 00 nop <== NOT EXECUTED rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); 2003f6c: 7f ff f8 87 call 2002188 <== NOT EXECUTED 2003f70: 01 00 00 00 nop <== 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) { 2003f74: c4 07 60 84 ld [ %i5 + 0x84 ], %g2 <== NOT EXECUTED 2003f78: c2 07 60 80 ld [ %i5 + 0x80 ], %g1 <== NOT EXECUTED 2003f7c: 80 a0 80 01 cmp %g2, %g1 <== NOT EXECUTED 2003f80: 32 bf ff f2 bne,a 2003f48 <== NOT EXECUTED 2003f84: f8 27 60 94 st %i4, [ %i5 + 0x94 ] <== NOT EXECUTED 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); 2003f88: 7f ff f8 84 call 2002198 2003f8c: 91 e8 00 08 restore %g0, %o0, %o0 tty->rawOutBufState = rob_wait; rtems_interrupt_enable (level); sc = rtems_semaphore_obtain( tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); 2003f90: 40 00 0c 17 call 2006fec <== NOT EXECUTED =============================================================================== 02004cc4 : /* * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { 2004cc4: 9d e3 bf 98 save %sp, -104, %sp if ((tty->termios.c_lflag & ECHOCTL) && 2004cc8: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 2004ccc: 80 88 62 00 btst 0x200, %g1 2004cd0: 02 80 00 08 be 2004cf0 <== NEVER TAKEN 2004cd4: 03 00 80 73 sethi %hi(0x201cc00), %g1 iscntrl(c) && (c != '\t') && (c != '\n')) { 2004cd8: c2 00 63 b4 ld [ %g1 + 0x3b4 ], %g1 ! 201cfb4 <__ctype_ptr__> 2004cdc: 82 00 40 18 add %g1, %i0, %g1 2004ce0: c2 08 60 01 ldub [ %g1 + 1 ], %g1 2004ce4: 80 88 60 20 btst 0x20, %g1 2004ce8: 12 80 00 07 bne 2004d04 2004cec: 80 a6 20 09 cmp %i0, 9 echobuf[0] = '^'; echobuf[1] = c ^ 0x40; rtems_termios_puts (echobuf, 2, tty); tty->column += 2; } else { oproc (c, tty); 2004cf0: 90 10 00 18 mov %i0, %o0 2004cf4: 7f ff ff 8d call 2004b28 2004cf8: 92 10 00 19 mov %i1, %o1 2004cfc: 81 c7 e0 08 ret 2004d00: 81 e8 00 00 restore */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { 2004d04: 02 bf ff fc be 2004cf4 2004d08: 90 10 00 18 mov %i0, %o0 2004d0c: 80 a6 20 0a cmp %i0, 0xa 2004d10: 02 bf ff f9 be 2004cf4 2004d14: 82 10 20 5e mov 0x5e, %g1 char echobuf[2]; echobuf[0] = '^'; echobuf[1] = c ^ 0x40; 2004d18: b0 1e 20 40 xor %i0, 0x40, %i0 { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { char echobuf[2]; echobuf[0] = '^'; 2004d1c: c2 2f bf f8 stb %g1, [ %fp + -8 ] echobuf[1] = c ^ 0x40; 2004d20: f0 2f bf f9 stb %i0, [ %fp + -7 ] rtems_termios_puts (echobuf, 2, tty); 2004d24: 90 07 bf f8 add %fp, -8, %o0 2004d28: 92 10 20 02 mov 2, %o1 2004d2c: 7f ff ff 2f call 20049e8 2004d30: 94 10 00 19 mov %i1, %o2 tty->column += 2; 2004d34: c2 06 60 28 ld [ %i1 + 0x28 ], %g1 2004d38: 82 00 60 02 add %g1, 2, %g1 2004d3c: c2 26 60 28 st %g1, [ %i1 + 0x28 ] 2004d40: 81 c7 e0 08 ret 2004d44: 81 e8 00 00 restore =============================================================================== 02003bcc : void endgrent(void) { if (group_fp != NULL) 2003bcc: 03 00 80 61 sethi %hi(0x2018400), %g1 2003bd0: d0 00 61 90 ld [ %g1 + 0x190 ], %o0 ! 2018590 2003bd4: 80 a2 20 00 cmp %o0, 0 2003bd8: 02 80 00 05 be 2003bec <== NEVER TAKEN 2003bdc: 01 00 00 00 nop fclose(group_fp); 2003be0: 82 13 c0 00 mov %o7, %g1 2003be4: 40 00 32 56 call 201053c 2003be8: 9e 10 40 00 mov %g1, %o7 2003bec: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 02003a40 : void endpwent(void) { if (passwd_fp != NULL) 2003a40: 03 00 80 61 sethi %hi(0x2018400), %g1 2003a44: d0 00 60 b0 ld [ %g1 + 0xb0 ], %o0 ! 20184b0 2003a48: 80 a2 20 00 cmp %o0, 0 2003a4c: 02 80 00 05 be 2003a60 <== NEVER TAKEN 2003a50: 01 00 00 00 nop fclose(passwd_fp); 2003a54: 82 13 c0 00 mov %o7, %g1 2003a58: 40 00 32 b9 call 201053c 2003a5c: 9e 10 40 00 mov %g1, %o7 2003a60: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 02004d48 : * 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) { 2004d48: 9d e3 bf a0 save %sp, -96, %sp if (tty->ccount == 0) 2004d4c: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 2004d50: 80 a0 60 00 cmp %g1, 0 2004d54: 02 80 00 37 be 2004e30 2004d58: ba 10 00 18 mov %i0, %i5 return; if (lineFlag) { if (!(tty->termios.c_lflag & ECHO)) { 2004d5c: c6 06 20 3c ld [ %i0 + 0x3c ], %g3 static void erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) return; if (lineFlag) { 2004d60: 80 a6 60 00 cmp %i1, 0 2004d64: 12 80 00 35 bne 2004e38 2004d68: 84 08 e0 08 and %g3, 8, %g2 tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); 2004d6c: 31 00 80 6e sethi %hi(0x201b800), %i0 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 2004d70: 37 00 80 6e sethi %hi(0x201b800), %i3 tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 2004d74: 35 00 80 73 sethi %hi(0x201cc00), %i2 rtems_termios_puts ("\b \b", 3, tty); 2004d78: b0 16 20 30 or %i0, 0x30, %i0 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 2004d7c: 10 80 00 0d b 2004db0 2004d80: b6 16 e0 28 or %i3, 0x28, %i3 tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 2004d84: 12 80 00 6b bne 2004f30 <== NOT EXECUTED 2004d88: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED if (tty->column) tty->column--; } } } if (!lineFlag) 2004d8c: 80 a6 60 00 cmp %i1, 0 <== NOT EXECUTED 2004d90: 02 80 00 66 be 2004f28 <== NEVER TAKEN 2004d94: 01 00 00 00 nop echo ('\n', tty); return; } } while (tty->ccount) { 2004d98: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 2004d9c: 80 a0 60 00 cmp %g1, 0 2004da0: 02 80 00 62 be 2004f28 2004da4: 01 00 00 00 nop } if (!(tty->termios.c_lflag & ECHOE)) { tty->ccount = 0; echo (tty->termios.c_cc[VKILL], tty); if (tty->termios.c_lflag & ECHOK) echo ('\n', tty); 2004da8: c6 07 60 3c ld [ %i5 + 0x3c ], %g3 2004dac: 84 08 e0 08 and %g3, 8, %g2 return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 2004db0: c8 07 60 1c ld [ %i5 + 0x1c ], %g4 2004db4: 82 00 7f ff add %g1, -1, %g1 2004db8: c2 27 60 20 st %g1, [ %i5 + 0x20 ] if (tty->termios.c_lflag & ECHO) { 2004dbc: 80 a0 a0 00 cmp %g2, 0 2004dc0: 02 bf ff f3 be 2004d8c <== NEVER TAKEN 2004dc4: f8 09 00 01 ldub [ %g4 + %g1 ], %i4 if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { 2004dc8: 80 a6 60 00 cmp %i1, 0 2004dcc: 12 80 00 05 bne 2004de0 2004dd0: b8 0f 20 ff and %i4, 0xff, %i4 2004dd4: 80 88 e0 10 btst 0x10, %g3 2004dd8: 22 80 00 52 be,a 2004f20 <== NEVER TAKEN 2004ddc: f0 0f 60 43 ldub [ %i5 + 0x43 ], %i0 <== NOT EXECUTED echo (tty->termios.c_cc[VERASE], tty); } else if (c == '\t') { 2004de0: 80 a7 20 09 cmp %i4, 9 2004de4: 02 80 00 25 be 2004e78 2004de8: b8 07 20 01 inc %i4 rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 2004dec: c2 06 a3 b4 ld [ %i2 + 0x3b4 ], %g1 2004df0: c2 08 40 1c ldub [ %g1 + %i4 ], %g1 2004df4: 80 88 60 20 btst 0x20, %g1 2004df8: 12 bf ff e3 bne 2004d84 <== NEVER TAKEN 2004dfc: 80 88 e2 00 btst 0x200, %g3 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); 2004e00: 11 00 80 6e sethi %hi(0x201b800), %o0 2004e04: 92 10 20 03 mov 3, %o1 2004e08: 90 12 20 30 or %o0, 0x30, %o0 2004e0c: 7f ff fe f7 call 20049e8 2004e10: 94 10 00 1d mov %i5, %o2 if (tty->column) 2004e14: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 2004e18: 80 a0 60 00 cmp %g1, 0 2004e1c: 02 bf ff dd be 2004d90 <== NEVER TAKEN 2004e20: 80 a6 60 00 cmp %i1, 0 tty->column--; 2004e24: 82 00 7f ff add %g1, -1, %g1 } } } if (!lineFlag) 2004e28: 12 bf ff dc bne 2004d98 2004e2c: c2 27 60 28 st %g1, [ %i5 + 0x28 ] 2004e30: 81 c7 e0 08 ret 2004e34: 81 e8 00 00 restore erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) return; if (lineFlag) { if (!(tty->termios.c_lflag & ECHO)) { 2004e38: 84 88 e0 08 andcc %g3, 8, %g2 2004e3c: 22 bf ff fd be,a 2004e30 <== NEVER TAKEN 2004e40: c0 26 20 20 clr [ %i0 + 0x20 ] <== NOT EXECUTED tty->ccount = 0; return; } if (!(tty->termios.c_lflag & ECHOE)) { 2004e44: 80 88 e0 10 btst 0x10, %g3 2004e48: 32 bf ff ca bne,a 2004d70 <== ALWAYS TAKEN 2004e4c: 31 00 80 6e sethi %hi(0x201b800), %i0 tty->ccount = 0; echo (tty->termios.c_cc[VKILL], tty); 2004e50: d0 0e 20 44 ldub [ %i0 + 0x44 ], %o0 ! 201b844 <== NOT EXECUTED if (!(tty->termios.c_lflag & ECHO)) { tty->ccount = 0; return; } if (!(tty->termios.c_lflag & ECHOE)) { tty->ccount = 0; 2004e54: c0 26 20 20 clr [ %i0 + 0x20 ] <== NOT EXECUTED echo (tty->termios.c_cc[VKILL], tty); 2004e58: 7f ff ff 9b call 2004cc4 <== NOT EXECUTED 2004e5c: 92 10 00 18 mov %i0, %o1 <== NOT EXECUTED if (tty->termios.c_lflag & ECHOK) 2004e60: c2 06 20 3c ld [ %i0 + 0x3c ], %g1 <== NOT EXECUTED 2004e64: 80 88 60 20 btst 0x20, %g1 <== NOT EXECUTED 2004e68: 02 bf ff f2 be 2004e30 <== NOT EXECUTED 2004e6c: b0 10 20 0a mov 0xa, %i0 <== NOT EXECUTED echo ('\n', tty); 2004e70: 7f ff ff 95 call 2004cc4 <== NOT EXECUTED 2004e74: 93 e8 00 1d restore %g0, %i5, %o1 <== NOT EXECUTED int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 2004e78: 80 a0 60 00 cmp %g1, 0 2004e7c: 02 80 00 17 be 2004ed8 2004e80: f8 07 60 2c ld [ %i5 + 0x2c ], %i4 c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { 2004e84: da 06 a3 b4 ld [ %i2 + 0x3b4 ], %o5 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; 2004e88: 84 10 20 00 clr %g2 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) 2004e8c: 10 80 00 07 b 2004ea8 2004e90: 98 08 e2 00 and %g3, 0x200, %o4 2004e94: 32 80 00 02 bne,a 2004e9c <== NOT EXECUTED 2004e98: b8 07 20 02 add %i4, 2, %i4 <== NOT EXECUTED int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 2004e9c: 80 a0 40 02 cmp %g1, %g2 2004ea0: 22 80 00 0f be,a 2004edc <== NEVER TAKEN 2004ea4: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 <== NOT EXECUTED c = tty->cbuf[i++]; 2004ea8: c6 09 00 02 ldub [ %g4 + %g2 ], %g3 2004eac: 84 00 a0 01 inc %g2 if (c == '\t') { 2004eb0: 80 a0 e0 09 cmp %g3, 9 2004eb4: 02 80 00 18 be 2004f14 2004eb8: 9e 03 40 03 add %o5, %g3, %o7 col = (col | 7) + 1; } else if (iscntrl (c)) { 2004ebc: de 0b e0 01 ldub [ %o7 + 1 ], %o7 2004ec0: 80 8b e0 20 btst 0x20, %o7 2004ec4: 12 bf ff f4 bne 2004e94 <== NEVER TAKEN 2004ec8: 80 a3 20 00 cmp %o4, 0 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 2004ecc: 80 a0 40 02 cmp %g1, %g2 2004ed0: 12 bf ff f6 bne 2004ea8 2004ed4: b8 07 20 01 inc %i4 } /* * Back up over the tab */ while (tty->column > col) { 2004ed8: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 2004edc: 80 a7 00 01 cmp %i4, %g1 2004ee0: 16 bf ff ac bge 2004d90 <== NEVER TAKEN 2004ee4: 80 a6 60 00 cmp %i1, 0 rtems_termios_puts ("\b", 1, tty); 2004ee8: 90 10 00 1b mov %i3, %o0 2004eec: 92 10 20 01 mov 1, %o1 2004ef0: 7f ff fe be call 20049e8 2004ef4: 94 10 00 1d mov %i5, %o2 tty->column--; 2004ef8: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 2004efc: 82 00 7f ff add %g1, -1, %g1 } /* * Back up over the tab */ while (tty->column > col) { 2004f00: 80 a0 40 1c cmp %g1, %i4 2004f04: 14 bf ff f9 bg 2004ee8 2004f08: c2 27 60 28 st %g1, [ %i5 + 0x28 ] if (tty->column) tty->column--; } } } if (!lineFlag) 2004f0c: 10 bf ff a1 b 2004d90 2004f10: 80 a6 60 00 cmp %i1, 0 * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; 2004f14: b8 17 20 07 or %i4, 7, %i4 2004f18: 10 bf ff e1 b 2004e9c 2004f1c: b8 07 20 01 inc %i4 while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { echo (tty->termios.c_cc[VERASE], tty); 2004f20: 7f ff ff 69 call 2004cc4 <== NOT EXECUTED 2004f24: 93 e8 00 1d restore %g0, %i5, %o1 <== NOT EXECUTED 2004f28: 81 c7 e0 08 ret 2004f2c: 81 e8 00 00 restore tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); 2004f30: 92 10 20 03 mov 3, %o1 <== NOT EXECUTED 2004f34: 7f ff fe ad call 20049e8 <== NOT EXECUTED 2004f38: 94 10 00 1d mov %i5, %o2 <== NOT EXECUTED if (tty->column) 2004f3c: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 <== NOT EXECUTED 2004f40: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 2004f44: 22 80 00 05 be,a 2004f58 <== NOT EXECUTED 2004f48: c2 06 a3 b4 ld [ %i2 + 0x3b4 ], %g1 <== NOT EXECUTED tty->column--; 2004f4c: 82 00 7f ff add %g1, -1, %g1 <== NOT EXECUTED 2004f50: c2 27 60 28 st %g1, [ %i5 + 0x28 ] <== NOT EXECUTED } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { 2004f54: c2 06 a3 b4 ld [ %i2 + 0x3b4 ], %g1 <== NOT EXECUTED 2004f58: c2 08 40 1c ldub [ %g1 + %i4 ], %g1 <== NOT EXECUTED 2004f5c: 80 88 60 20 btst 0x20, %g1 <== NOT EXECUTED 2004f60: 02 bf ff a9 be 2004e04 <== NOT EXECUTED 2004f64: 11 00 80 6e sethi %hi(0x201b800), %o0 <== NOT EXECUTED 2004f68: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 <== NOT EXECUTED 2004f6c: 80 88 62 00 btst 0x200, %g1 <== NOT EXECUTED 2004f70: 12 bf ff a6 bne 2004e08 <== NOT EXECUTED 2004f74: 92 10 20 03 mov 3, %o1 <== NOT EXECUTED if (tty->column) tty->column--; } } } if (!lineFlag) 2004f78: 10 bf ff 86 b 2004d90 <== NOT EXECUTED 2004f7c: 80 a6 60 00 cmp %i1, 0 <== NOT EXECUTED =============================================================================== 0200344c : int fcntl( int fd, int cmd, ... ) { 200344c: 9d e3 bf 90 save %sp, -112, %sp int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 2003450: 03 00 80 5e sethi %hi(0x2017800), %g1 2003454: c4 00 63 dc ld [ %g1 + 0x3dc ], %g2 ! 2017bdc ... ) { int ret; va_list ap; va_start( ap, cmd ); 2003458: f4 27 a0 4c st %i2, [ %fp + 0x4c ] 200345c: 82 07 a0 4c add %fp, 0x4c, %g1 2003460: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 2003464: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 2003468: fa 27 a0 58 st %i5, [ %fp + 0x58 ] int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 200346c: 80 a6 00 02 cmp %i0, %g2 2003470: 1a 80 00 65 bcc 2003604 2003474: c2 27 bf fc st %g1, [ %fp + -4 ] iop = rtems_libio_iop( fd ); 2003478: 3b 00 80 61 sethi %hi(0x2018400), %i5 200347c: c6 07 62 30 ld [ %i5 + 0x230 ], %g3 ! 2018630 2003480: 93 2e 20 06 sll %i0, 6, %o1 2003484: 92 00 c0 09 add %g3, %o1, %o1 rtems_libio_check_is_open(iop); 2003488: d0 02 60 18 ld [ %o1 + 0x18 ], %o0 200348c: 80 8a 21 00 btst 0x100, %o0 2003490: 02 80 00 5d be 2003604 2003494: 80 a6 60 09 cmp %i1, 9 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 2003498: 08 80 00 08 bleu 20034b8 200349c: 89 2e 60 02 sll %i1, 2, %g4 errno = ENOTSUP; ret = -1; break; default: errno = EINVAL; 20034a0: 40 00 34 23 call 201052c <__errno> 20034a4: b0 10 3f ff mov -1, %i0 20034a8: 82 10 20 16 mov 0x16, %g1 20034ac: c2 22 00 00 st %g1, [ %o0 ] 20034b0: 81 c7 e0 08 ret 20034b4: 81 e8 00 00 restore /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 20034b8: 31 00 80 0d sethi %hi(0x2003400), %i0 20034bc: b0 16 20 24 or %i0, 0x24, %i0 ! 2003424 20034c0: c8 06 00 04 ld [ %i0 + %g4 ], %g4 20034c4: 81 c1 00 00 jmp %g4 20034c8: 01 00 00 00 nop errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 20034cc: 40 00 34 18 call 201052c <__errno> 20034d0: 01 00 00 00 nop 20034d4: 82 10 20 86 mov 0x86, %g1 ! 86 20034d8: c2 22 00 00 st %g1, [ %o0 ] int mask; int ret = 0; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); 20034dc: 81 c7 e0 08 ret 20034e0: 91 e8 3f ff restore %g0, -1, %o0 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 ) ); 20034e4: d0 00 40 00 ld [ %g1 ], %o0 20034e8: 40 00 01 aa call 2003b90 20034ec: d2 27 bf f4 st %o1, [ %fp + -12 ] /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); 20034f0: d2 07 bf f4 ld [ %fp + -12 ], %o1 20034f4: 90 0a 22 01 and %o0, 0x201, %o0 20034f8: c2 02 60 18 ld [ %o1 + 0x18 ], %g1 rtems_libio_t *iop; rtems_libio_t *diop; int fd2; int flags; int mask; int ret = 0; 20034fc: b0 10 20 00 clr %i0 /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); 2003500: 82 08 7d fe and %g1, -514, %g1 2003504: 82 12 00 01 or %o0, %g1, %g1 2003508: c2 22 60 18 st %g1, [ %o1 + 0x18 ] * 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 ); 200350c: c2 02 60 24 ld [ %o1 + 0x24 ], %g1 2003510: c2 00 60 30 ld [ %g1 + 0x30 ], %g1 2003514: 9f c0 40 00 call %g1 2003518: 90 10 00 19 mov %i1, %o0 if (err) { 200351c: b2 92 20 00 orcc %o0, 0, %i1 2003520: 12 80 00 04 bne 2003530 <== NEVER TAKEN 2003524: 01 00 00 00 nop va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 2003528: 81 c7 e0 08 ret 200352c: 81 e8 00 00 restore */ if (ret >= 0) { int err = (*iop->pathinfo.handlers->fcntl_h)( cmd, iop ); if (err) { errno = err; 2003530: 40 00 33 ff call 201052c <__errno> <== NOT EXECUTED 2003534: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 2003538: f2 22 00 00 st %i1, [ %o0 ] <== NOT EXECUTED va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 200353c: 81 c7 e0 08 ret <== NOT EXECUTED 2003540: 81 e8 00 00 restore <== NOT EXECUTED else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); 2003544: 40 00 01 a0 call 2003bc4 2003548: d2 27 bf f4 st %o1, [ %fp + -12 ] 200354c: d2 07 bf f4 ld [ %fp + -12 ], %o1 2003550: b0 10 00 08 mov %o0, %i0 /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 2003554: 80 a6 20 00 cmp %i0, 0 2003558: 36 bf ff ee bge,a 2003510 <== ALWAYS TAKEN 200355c: c2 02 60 24 ld [ %o1 + 0x24 ], %g1 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 2003560: 81 c7 e0 08 ret <== NOT EXECUTED 2003564: 81 e8 00 00 restore <== NOT EXECUTED * 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 ) ) 2003568: c2 00 40 00 ld [ %g1 ], %g1 200356c: 80 a0 60 00 cmp %g1, 0 2003570: 22 80 00 22 be,a 20035f8 2003574: 90 0a 37 ff and %o0, -2049, %o0 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 2003578: 90 12 28 00 or %o0, 0x800, %o0 rtems_libio_t *iop; rtems_libio_t *diop; int fd2; int flags; int mask; int ret = 0; 200357c: b0 10 20 00 clr %i0 * processes, then we can ignore this one except to make * F_GETFD work. */ if ( va_arg( ap, int ) ) iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 2003580: 10 bf ff e3 b 200350c 2003584: d0 22 60 18 st %o0, [ %o1 + 0x18 ] diop->pathinfo = iop->pathinfo; ret = (int) (diop - rtems_libio_iops); break; case F_GETFD: /* get f_flags */ ret = ((iop->flags & LIBIO_FLAGS_CLOSE_ON_EXEC) != 0); 2003588: 90 0a 28 00 and %o0, 0x800, %o0 200358c: 80 a0 00 08 cmp %g0, %o0 2003590: 10 bf ff df b 200350c 2003594: b0 40 20 00 addx %g0, 0, %i0 * This switch should contain all the cases from POSIX. */ switch ( cmd ) { case F_DUPFD: /* dup */ fd2 = va_arg( ap, int ); 2003598: c8 00 40 00 ld [ %g1 ], %g4 if ( fd2 ) 200359c: 80 a1 20 00 cmp %g4, 0 20035a0: 02 80 00 1f be 200361c 20035a4: b0 10 20 00 clr %i0 diop = rtems_libio_iop( fd2 ); 20035a8: 80 a0 80 04 cmp %g2, %g4 20035ac: 08 80 00 05 bleu 20035c0 <== NEVER TAKEN 20035b0: 82 10 20 00 clr %g1 20035b4: 83 29 20 06 sll %g4, 6, %g1 20035b8: 82 00 c0 01 add %g3, %g1, %g1 20035bc: b0 10 00 01 mov %g1, %i0 break; } } diop->flags = iop->flags; diop->pathinfo = iop->pathinfo; 20035c0: c4 02 60 1c ld [ %o1 + 0x1c ], %g2 ret = (int) (diop - rtems_libio_iops); 20035c4: b0 26 00 03 sub %i0, %g3, %i0 break; } } diop->flags = iop->flags; diop->pathinfo = iop->pathinfo; 20035c8: c4 20 60 1c st %g2, [ %g1 + 0x1c ] 20035cc: c4 02 60 20 ld [ %o1 + 0x20 ], %g2 ret = -1; break; } } diop->flags = iop->flags; 20035d0: d0 20 60 18 st %o0, [ %g1 + 0x18 ] diop->pathinfo = iop->pathinfo; 20035d4: c4 20 60 20 st %g2, [ %g1 + 0x20 ] 20035d8: c4 02 60 24 ld [ %o1 + 0x24 ], %g2 ret = (int) (diop - rtems_libio_iops); 20035dc: b1 3e 20 06 sra %i0, 6, %i0 break; } } diop->flags = iop->flags; diop->pathinfo = iop->pathinfo; 20035e0: c4 20 60 24 st %g2, [ %g1 + 0x24 ] 20035e4: c4 02 60 28 ld [ %o1 + 0x28 ], %g2 20035e8: c4 20 60 28 st %g2, [ %g1 + 0x28 ] 20035ec: c4 02 60 2c ld [ %o1 + 0x2c ], %g2 20035f0: 10 bf ff d9 b 2003554 20035f4: c4 20 60 2c st %g2, [ %g1 + 0x2c ] rtems_libio_t *iop; rtems_libio_t *diop; int fd2; int flags; int mask; int ret = 0; 20035f8: b0 10 20 00 clr %i0 */ if ( va_arg( ap, int ) ) iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 20035fc: 10 bf ff c4 b 200350c 2003600: d0 22 60 18 st %o0, [ %o1 + 0x18 ] int mask; int ret = 0; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); 2003604: 40 00 33 ca call 201052c <__errno> 2003608: b0 10 3f ff mov -1, %i0 200360c: 82 10 20 09 mov 9, %g1 2003610: c2 22 00 00 st %g1, [ %o0 ] 2003614: 81 c7 e0 08 ret 2003618: 81 e8 00 00 restore fd2 = va_arg( ap, int ); if ( fd2 ) diop = rtems_libio_iop( fd2 ); else { /* allocate a file control block */ diop = rtems_libio_allocate(); 200361c: 40 00 01 81 call 2003c20 2003620: d2 27 bf f4 st %o1, [ %fp + -12 ] if ( diop == 0 ) { 2003624: 82 92 20 00 orcc %o0, 0, %g1 2003628: 02 bf ff ad be 20034dc <== NEVER TAKEN 200362c: d2 07 bf f4 ld [ %fp + -12 ], %o1 2003630: d0 02 60 18 ld [ %o1 + 0x18 ], %o0 2003634: c6 07 62 30 ld [ %i5 + 0x230 ], %g3 2003638: 10 bf ff e2 b 20035c0 200363c: b0 10 00 01 mov %g1, %i0 =============================================================================== 0200d94c : */ int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 200d94c: 9d e3 bf 98 save %sp, -104, %sp static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 200d950: 3b 00 80 88 sethi %hi(0x2022000), %i5 200d954: d0 07 62 2c ld [ %i5 + 0x22c ], %o0 ! 202222c */ int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 200d958: b8 10 00 18 mov %i0, %i4 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 200d95c: 80 a2 20 00 cmp %o0, 0 200d960: 02 80 00 54 be 200dab0 200d964: b4 17 62 2c or %i5, 0x22c, %i2 rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 200d968: 92 10 20 00 clr %o1 200d96c: 94 10 20 00 clr %o2 200d970: 7f ff eb d8 call 20088d0 200d974: b0 10 3f f4 mov -12, %i0 } if (sc == RTEMS_SUCCESSFUL) { 200d978: 80 a2 20 00 cmp %o0, 0 200d97c: 12 80 01 18 bne 200dddc <== NEVER TAKEN 200d980: 01 00 00 00 nop err = pipe_lock(); if (err) return err; pipe = *pipep; 200d984: f6 07 00 00 ld [ %i4 ], %i3 if (pipe == NULL) { 200d988: 80 a6 e0 00 cmp %i3, 0 200d98c: 02 80 00 91 be 200dbd0 200d990: 01 00 00 00 nop err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 200d994: d0 06 e0 28 ld [ %i3 + 0x28 ], %o0 200d998: 92 10 20 00 clr %o1 200d99c: 7f ff eb cd call 20088d0 200d9a0: 94 10 20 00 clr %o2 err = -EINTR; if (*pipep == NULL) { 200d9a4: c2 07 00 00 ld [ %i4 ], %g1 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 200d9a8: 80 a0 00 08 cmp %g0, %o0 200d9ac: b0 60 20 00 subx %g0, 0, %i0 err = -EINTR; if (*pipep == NULL) { 200d9b0: 80 a0 60 00 cmp %g1, 0 200d9b4: 02 80 00 d9 be 200dd18 200d9b8: b0 0e 3f fc and %i0, -4, %i0 static void pipe_unlock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_release(pipe_semaphore); 200d9bc: 7f ff ec 0f call 20089f8 200d9c0: d0 07 62 2c ld [ %i5 + 0x22c ], %o0 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) 200d9c4: 80 a6 20 00 cmp %i0, 0 200d9c8: 12 80 01 05 bne 200dddc <== NEVER TAKEN 200d9cc: 01 00 00 00 nop return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { 200d9d0: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 200d9d4: 82 08 60 06 and %g1, 6, %g1 200d9d8: 80 a0 60 04 cmp %g1, 4 200d9dc: 02 80 00 42 be 200dae4 200d9e0: fa 07 00 00 ld [ %i4 ], %i5 200d9e4: 80 a0 60 06 cmp %g1, 6 200d9e8: 02 80 00 65 be 200db7c 200d9ec: 80 a0 60 02 cmp %g1, 2 200d9f0: 22 80 00 07 be,a 200da0c <== ALWAYS TAKEN 200d9f4: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); break; } PIPE_UNLOCK(pipe); 200d9f8: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED 200d9fc: 7f ff eb ff call 20089f8 200da00: b0 10 20 00 clr %i0 return 0; 200da04: 81 c7 e0 08 ret 200da08: 81 e8 00 00 restore return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; 200da0c: c4 07 60 20 ld [ %i5 + 0x20 ], %g2 if (pipe->Readers ++ == 0) 200da10: 86 00 60 01 add %g1, 1, %g3 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; 200da14: 84 00 a0 01 inc %g2 if (pipe->Readers ++ == 0) 200da18: c6 27 60 10 st %g3, [ %i5 + 0x10 ] 200da1c: 80 a0 60 00 cmp %g1, 0 200da20: 02 80 00 d4 be 200dd70 <== ALWAYS TAKEN 200da24: c4 27 60 20 st %g2, [ %i5 + 0x20 ] PIPE_WAKEUPWRITERS(pipe); if (pipe->Writers == 0) { 200da28: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 <== NOT EXECUTED 200da2c: 80 a0 60 00 cmp %g1, 0 200da30: 32 bf ff f3 bne,a 200d9fc 200da34: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 /* Not an error */ if (LIBIO_NODELAY(iop)) 200da38: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 200da3c: 80 88 60 01 btst 1, %g1 200da40: 32 bf ff ef bne,a 200d9fc 200da44: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 break; prevCounter = pipe->writerCounter; 200da48: 10 80 00 0c b 200da78 200da4c: f6 07 60 24 ld [ %i5 + 0x24 ], %i3 /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) goto out_error; if (! PIPE_LOCK(pipe)) 200da50: 92 10 20 00 clr %o1 200da54: 7f ff eb 9f call 20088d0 200da58: 94 10 20 00 clr %o2 200da5c: 80 a2 20 00 cmp %o0, 0 200da60: 12 80 00 0f bne 200da9c <== NEVER TAKEN 200da64: b0 10 3f fc mov -4, %i0 goto out_error; } while (prevCounter == pipe->writerCounter); 200da68: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 200da6c: 80 a0 40 1b cmp %g1, %i3 200da70: 32 bf ff e3 bne,a 200d9fc <== ALWAYS TAKEN 200da74: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 prevCounter = pipe->writerCounter; err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); 200da78: 7f ff eb e0 call 20089f8 200da7c: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 if (! PIPE_READWAIT(pipe)) 200da80: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 200da84: 40 00 07 12 call 200f6cc 200da88: 92 10 20 00 clr %o1 200da8c: 80 a2 20 00 cmp %o0, 0 200da90: 22 bf ff f0 be,a 200da50 <== ALWAYS TAKEN 200da94: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; 200da98: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); 200da9c: 90 10 00 1c mov %i4, %o0 <== NOT EXECUTED 200daa0: 7f ff ff 68 call 200d840 200daa4: 92 10 00 19 mov %i1, %o1 return err; } 200daa8: 81 c7 e0 08 ret 200daac: 81 e8 00 00 restore 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 ); 200dab0: 37 00 80 88 sethi %hi(0x2022000), %i3 200dab4: d0 06 e3 ac ld [ %i3 + 0x3ac ], %o0 ! 20223ac 200dab8: 92 10 20 00 clr %o1 200dabc: 7f ff eb 85 call 20088d0 200dac0: 94 10 20 00 clr %o2 rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { 200dac4: c2 07 62 2c ld [ %i5 + 0x22c ], %g1 200dac8: 80 a0 60 00 cmp %g1, 0 200dacc: 02 80 00 9a be 200dd34 <== ALWAYS TAKEN 200dad0: 98 10 00 1a mov %i2, %o4 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 200dad4: 7f ff eb c9 call 20089f8 <== NOT EXECUTED 200dad8: d0 06 e3 ac ld [ %i3 + 0x3ac ], %o0 <== NOT EXECUTED 200dadc: 10 bf ff a3 b 200d968 <== NOT EXECUTED 200dae0: d0 07 62 2c ld [ %i5 + 0x22c ], %o0 <== NOT EXECUTED break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; if (pipe->Writers ++ == 0) 200dae4: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 200dae8: c4 07 60 24 ld [ %i5 + 0x24 ], %g2 if (pipe->Writers ++ == 0) 200daec: 86 00 60 01 add %g1, 1, %g3 } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 200daf0: 84 00 a0 01 inc %g2 if (pipe->Writers ++ == 0) 200daf4: c6 27 60 14 st %g3, [ %i5 + 0x14 ] 200daf8: 80 a0 60 00 cmp %g1, 0 200dafc: 02 80 00 a7 be 200dd98 <== ALWAYS TAKEN 200db00: c4 27 60 24 st %g2, [ %i5 + 0x24 ] PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { 200db04: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 <== NOT EXECUTED 200db08: 80 a0 60 00 cmp %g1, 0 200db0c: 32 bf ff bc bne,a 200d9fc 200db10: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 200db14: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 200db18: 80 88 60 01 btst 1, %g1 200db1c: 32 80 00 b2 bne,a 200dde4 200db20: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 err = -ENXIO; goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; 200db24: 10 80 00 0c b 200db54 200db28: f6 07 60 20 ld [ %i5 + 0x20 ], %i3 err = -EINTR; do { PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) goto out_error; if (! PIPE_LOCK(pipe)) 200db2c: 92 10 20 00 clr %o1 200db30: 7f ff eb 68 call 20088d0 200db34: 94 10 20 00 clr %o2 200db38: 80 a2 20 00 cmp %o0, 0 200db3c: 12 bf ff d8 bne 200da9c <== NEVER TAKEN 200db40: b0 10 3f fc mov -4, %i0 goto out_error; } while (prevCounter == pipe->readerCounter); 200db44: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 200db48: 80 a0 40 1b cmp %g1, %i3 200db4c: 32 bf ff ac bne,a 200d9fc <== ALWAYS TAKEN 200db50: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); 200db54: 7f ff eb a9 call 20089f8 200db58: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 if (! PIPE_WRITEWAIT(pipe)) 200db5c: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 200db60: 40 00 06 db call 200f6cc 200db64: 92 10 20 00 clr %o1 200db68: 80 a2 20 00 cmp %o0, 0 200db6c: 22 bf ff f0 be,a 200db2c <== ALWAYS TAKEN 200db70: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; 200db74: 10 bf ff ca b 200da9c <== NOT EXECUTED 200db78: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) 200db7c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 200db80: c4 07 60 20 ld [ %i5 + 0x20 ], %g2 if (pipe->Readers ++ == 0) 200db84: 86 00 60 01 add %g1, 1, %g3 } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 200db88: 84 00 a0 01 inc %g2 if (pipe->Readers ++ == 0) 200db8c: c6 27 60 10 st %g3, [ %i5 + 0x10 ] 200db90: 80 a0 60 00 cmp %g1, 0 200db94: 02 80 00 7c be 200dd84 <== ALWAYS TAKEN 200db98: c4 27 60 20 st %g2, [ %i5 + 0x20 ] PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; if (pipe->Writers ++ == 0) 200db9c: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 <== NOT EXECUTED case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; 200dba0: c4 07 60 24 ld [ %i5 + 0x24 ], %g2 if (pipe->Writers ++ == 0) 200dba4: 86 00 60 01 add %g1, 1, %g3 case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; 200dba8: 84 00 a0 01 inc %g2 if (pipe->Writers ++ == 0) 200dbac: c6 27 60 14 st %g3, [ %i5 + 0x14 ] 200dbb0: 80 a0 60 00 cmp %g1, 0 200dbb4: 12 bf ff 91 bne 200d9f8 <== NEVER TAKEN 200dbb8: c4 27 60 24 st %g2, [ %i5 + 0x24 ] PIPE_WAKEUPREADERS(pipe); 200dbbc: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 200dbc0: 40 00 06 ac call 200f670 200dbc4: 92 07 bf f8 add %fp, -8, %o1 break; } PIPE_UNLOCK(pipe); 200dbc8: 10 bf ff 8d b 200d9fc 200dbcc: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); 200dbd0: 7f ff dd 75 call 20051a4 200dbd4: 90 10 20 34 mov 0x34, %o0 if (pipe == NULL) 200dbd8: b6 92 20 00 orcc %o0, 0, %i3 200dbdc: 02 80 00 8e be 200de14 200dbe0: 82 10 22 00 mov 0x200, %g1 return err; memset(pipe, 0, sizeof(pipe_control_t)); 200dbe4: c0 26 c0 00 clr [ %i3 ] 200dbe8: c0 26 e0 08 clr [ %i3 + 8 ] 200dbec: c0 26 e0 0c clr [ %i3 + 0xc ] 200dbf0: c0 26 e0 10 clr [ %i3 + 0x10 ] 200dbf4: c0 26 e0 14 clr [ %i3 + 0x14 ] 200dbf8: c0 26 e0 18 clr [ %i3 + 0x18 ] 200dbfc: c0 26 e0 1c clr [ %i3 + 0x1c ] 200dc00: c0 26 e0 20 clr [ %i3 + 0x20 ] 200dc04: c0 26 e0 24 clr [ %i3 + 0x24 ] 200dc08: c0 26 e0 28 clr [ %i3 + 0x28 ] 200dc0c: c0 26 e0 2c clr [ %i3 + 0x2c ] 200dc10: c0 26 e0 30 clr [ %i3 + 0x30 ] pipe->Size = PIPE_BUF; pipe->Buffer = malloc(pipe->Size); 200dc14: 90 10 22 00 mov 0x200, %o0 200dc18: 7f ff dd 63 call 20051a4 200dc1c: c2 26 e0 04 st %g1, [ %i3 + 4 ] if (! pipe->Buffer) 200dc20: 80 a2 20 00 cmp %o0, 0 200dc24: 02 80 00 7a be 200de0c <== NEVER TAKEN 200dc28: d0 26 c0 00 st %o0, [ %i3 ] goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), 200dc2c: 35 00 80 86 sethi %hi(0x2021800), %i2 200dc30: d0 4e a2 28 ldsb [ %i2 + 0x228 ], %o0 ! 2021a28 if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 200dc34: 31 14 12 5c sethi %hi(0x50497000), %i0 200dc38: 82 16 22 00 or %i0, 0x200, %g1 ! 50497200 200dc3c: 92 10 20 00 clr %o1 200dc40: 94 10 20 00 clr %o2 200dc44: 90 12 00 01 or %o0, %g1, %o0 200dc48: 40 00 06 30 call 200f508 200dc4c: 96 06 e0 2c add %i3, 0x2c, %o3 200dc50: 80 a2 20 00 cmp %o0, 0 200dc54: 12 80 00 6c bne 200de04 200dc58: d0 4e a2 28 ldsb [ %i2 + 0x228 ], %o0 rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( 200dc5c: 03 14 12 5d sethi %hi(0x50497400), %g1 200dc60: 82 10 63 00 or %g1, 0x300, %g1 ! 50497700 200dc64: 92 10 20 00 clr %o1 200dc68: 94 10 20 00 clr %o2 200dc6c: 90 12 00 01 or %o0, %g1, %o0 200dc70: 40 00 06 26 call 200f508 200dc74: 96 06 e0 30 add %i3, 0x30, %o3 200dc78: 80 a2 20 00 cmp %o0, 0 200dc7c: 12 80 00 60 bne 200ddfc 200dc80: d0 4e a2 28 ldsb [ %i2 + 0x228 ], %o0 rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( 200dc84: b0 16 23 00 or %i0, 0x300, %i0 200dc88: 92 10 20 01 mov 1, %o1 200dc8c: 90 12 00 18 or %o0, %i0, %o0 200dc90: 94 10 20 10 mov 0x10, %o2 200dc94: 96 10 20 00 clr %o3 200dc98: 7f ff ea 67 call 2008634 200dc9c: 98 06 e0 28 add %i3, 0x28, %o4 200dca0: 80 a2 20 00 cmp %o0, 0 200dca4: 12 80 00 54 bne 200ddf4 200dca8: 94 07 bf fc add %fp, -4, %o2 RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get ( Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) 200dcac: d2 06 e0 2c ld [ %i3 + 0x2c ], %o1 200dcb0: 21 00 80 8b sethi %hi(0x2022c00), %l0 200dcb4: 7f ff f1 7d call 200a2a8 <_Objects_Get> 200dcb8: 90 14 22 a0 or %l0, 0x2a0, %o0 ! 2022ea0 <_Barrier_Information> static void pipe_interruptible(pipe_control_t *pipe) { Objects_Locations location; _Barrier_Get(pipe->readBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; 200dcbc: c2 02 20 4c ld [ %o0 + 0x4c ], %g1 200dcc0: 31 04 00 00 sethi %hi(0x10000000), %i0 200dcc4: 82 10 40 18 or %g1, %i0, %g1 _Thread_Enable_dispatch(); 200dcc8: 7f ff f5 20 call 200b148 <_Thread_Enable_dispatch> 200dccc: c2 22 20 4c st %g1, [ %o0 + 0x4c ] 200dcd0: d2 06 e0 30 ld [ %i3 + 0x30 ], %o1 200dcd4: 94 07 bf fc add %fp, -4, %o2 200dcd8: 7f ff f1 74 call 200a2a8 <_Objects_Get> 200dcdc: 90 14 22 a0 or %l0, 0x2a0, %o0 _Barrier_Get(pipe->writeBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; 200dce0: c2 02 20 4c ld [ %o0 + 0x4c ], %g1 200dce4: b0 10 40 18 or %g1, %i0, %i0 _Thread_Enable_dispatch(); 200dce8: 7f ff f5 18 call 200b148 <_Thread_Enable_dispatch> 200dcec: f0 22 20 4c st %i0, [ %o0 + 0x4c ] #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 200dcf0: c2 0e a2 28 ldub [ %i2 + 0x228 ], %g1 200dcf4: 84 00 60 01 add %g1, 1, %g2 200dcf8: 83 28 60 18 sll %g1, 0x18, %g1 200dcfc: 83 38 60 18 sra %g1, 0x18, %g1 200dd00: 80 a0 60 7a cmp %g1, 0x7a 200dd04: 12 bf ff 24 bne 200d994 200dd08: c4 2e a2 28 stb %g2, [ %i2 + 0x228 ] c = 'a'; 200dd0c: 82 10 20 61 mov 0x61, %g1 200dd10: 10 bf ff 21 b 200d994 200dd14: c2 2e a2 28 stb %g1, [ %i2 + 0x228 ] if (! PIPE_LOCK(pipe)) err = -EINTR; if (*pipep == NULL) { if (err) 200dd18: 80 a6 20 00 cmp %i0, 0 200dd1c: 12 80 00 24 bne 200ddac <== NEVER TAKEN 200dd20: d0 07 62 2c ld [ %i5 + 0x22c ], %o0 static void pipe_unlock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_release(pipe_semaphore); 200dd24: 7f ff eb 35 call 20089f8 200dd28: f6 27 00 00 st %i3, [ %i4 ] err = pipe_new(pipep); if (err) return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { 200dd2c: 10 bf ff 2a b 200d9d4 200dd30: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { sc = rtems_semaphore_create( 200dd34: 92 10 20 01 mov 1, %o1 200dd38: 94 10 20 54 mov 0x54, %o2 200dd3c: 96 10 20 00 clr %o3 200dd40: 11 14 12 54 sethi %hi(0x50495000), %o0 200dd44: 7f ff ea 3c call 2008634 200dd48: 90 12 20 45 or %o0, 0x45, %o0 ! 50495045 200dd4c: b4 10 00 08 mov %o0, %i2 200dd50: d0 06 e3 ac ld [ %i3 + 0x3ac ], %o0 200dd54: 7f ff eb 29 call 20089f8 200dd58: b0 10 3f f4 mov -12, %i0 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { 200dd5c: 80 a6 a0 00 cmp %i2, 0 200dd60: 12 bf ff 29 bne 200da04 200dd64: d0 07 62 2c ld [ %i5 + 0x22c ], %o0 sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 200dd68: 10 bf ff 01 b 200d96c 200dd6c: 92 10 20 00 clr %o1 switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); 200dd70: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 200dd74: 40 00 06 3f call 200f670 200dd78: 92 07 bf f8 add %fp, -8, %o1 if (pipe->Writers == 0) { 200dd7c: 10 bf ff 2c b 200da2c 200dd80: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); 200dd84: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 200dd88: 40 00 06 3a call 200f670 200dd8c: 92 07 bf f8 add %fp, -8, %o1 pipe->writerCounter ++; if (pipe->Writers ++ == 0) 200dd90: 10 bf ff 84 b 200dba0 200dd94: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); 200dd98: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 200dd9c: 40 00 06 35 call 200f670 200dda0: 92 07 bf f8 add %fp, -8, %o1 if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { 200dda4: 10 bf ff 59 b 200db08 200dda8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 /* Called with pipe_semaphore held. */ static inline void pipe_free( pipe_control_t *pipe ) { rtems_barrier_delete(pipe->readBarrier); 200ddac: 40 00 06 08 call 200f5cc <== NOT EXECUTED 200ddb0: d0 06 e0 2c ld [ %i3 + 0x2c ], %o0 <== NOT EXECUTED rtems_barrier_delete(pipe->writeBarrier); 200ddb4: 40 00 06 06 call 200f5cc <== NOT EXECUTED 200ddb8: d0 06 e0 30 ld [ %i3 + 0x30 ], %o0 <== NOT EXECUTED rtems_semaphore_delete(pipe->Semaphore); 200ddbc: 7f ff ea 8e call 20087f4 <== NOT EXECUTED 200ddc0: d0 06 e0 28 ld [ %i3 + 0x28 ], %o0 <== NOT EXECUTED free(pipe->Buffer); 200ddc4: 7f ff da f8 call 20049a4 <== NOT EXECUTED 200ddc8: d0 06 c0 00 ld [ %i3 ], %o0 <== NOT EXECUTED free(pipe); 200ddcc: 7f ff da f6 call 20049a4 <== NOT EXECUTED 200ddd0: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED static void pipe_unlock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_release(pipe_semaphore); 200ddd4: 7f ff eb 09 call 20089f8 200ddd8: d0 07 62 2c ld [ %i5 + 0x22c ], %o0 200dddc: 81 c7 e0 08 ret 200dde0: 81 e8 00 00 restore if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { PIPE_UNLOCK(pipe); 200dde4: 7f ff eb 05 call 20089f8 200dde8: b0 10 3f fa mov -6, %i0 err = -ENXIO; goto out_error; 200ddec: 10 bf ff 2d b 200daa0 200ddf0: 90 10 00 1c mov %i4, %o0 if (c ++ == 'z') c = 'a'; return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); 200ddf4: 40 00 05 f6 call 200f5cc 200ddf8: d0 06 e0 30 ld [ %i3 + 0x30 ], %o0 err_wbar: rtems_barrier_delete(pipe->readBarrier); 200ddfc: 40 00 05 f4 call 200f5cc 200de00: d0 06 e0 2c ld [ %i3 + 0x2c ], %o0 err_rbar: free(pipe->Buffer); 200de04: 7f ff da e8 call 20049a4 200de08: d0 06 c0 00 ld [ %i3 ], %o0 err_buf: free(pipe); 200de0c: 7f ff da e6 call 20049a4 200de10: 90 10 00 1b mov %i3, %o0 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { 200de14: 10 bf ff f0 b 200ddd4 200de18: b0 10 3f f4 mov -12, %i0 =============================================================================== 0200370c : long fpathconf( int fd, int name ) { 200370c: 9d e3 bf a0 save %sp, -96, %sp long return_value; rtems_libio_t *iop; rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); 2003710: 03 00 80 5e sethi %hi(0x2017800), %g1 2003714: c2 00 63 dc ld [ %g1 + 0x3dc ], %g1 ! 2017bdc 2003718: 80 a6 00 01 cmp %i0, %g1 200371c: 1a 80 00 3d bcc 2003810 2003720: 03 00 80 61 sethi %hi(0x2018400), %g1 iop = rtems_libio_iop(fd); 2003724: c2 00 62 30 ld [ %g1 + 0x230 ], %g1 ! 2018630 2003728: b1 2e 20 06 sll %i0, 6, %i0 200372c: b0 00 40 18 add %g1, %i0, %i0 rtems_libio_check_is_open(iop); 2003730: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 2003734: 80 88 61 00 btst 0x100, %g1 2003738: 02 80 00 36 be 2003810 <== NEVER TAKEN 200373c: 80 88 60 02 btst 2, %g1 rtems_libio_check_permissions(iop, LIBIO_FLAGS_READ); 2003740: 02 80 00 3a be 2003828 2003744: 80 a6 60 0b cmp %i1, 0xb * Now process the information request. */ the_limits = &iop->pathinfo.mt_entry->pathconf_limits_and_options; switch ( name ) { 2003748: 08 80 00 08 bleu 2003768 200374c: c2 06 20 2c ld [ %i0 + 0x2c ], %g1 break; case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 2003750: 40 00 33 77 call 201052c <__errno> 2003754: b0 10 3f ff mov -1, %i0 2003758: 82 10 20 16 mov 0x16, %g1 200375c: c2 22 00 00 st %g1, [ %o0 ] break; } return return_value; } 2003760: 81 c7 e0 08 ret 2003764: 81 e8 00 00 restore * Now process the information request. */ the_limits = &iop->pathinfo.mt_entry->pathconf_limits_and_options; switch ( name ) { 2003768: b3 2e 60 02 sll %i1, 2, %i1 200376c: 05 00 80 0d sethi %hi(0x2003400), %g2 2003770: 84 10 a2 dc or %g2, 0x2dc, %g2 ! 20036dc 2003774: c4 00 80 19 ld [ %g2 + %i1 ], %g2 2003778: 81 c0 80 00 jmp %g2 200377c: 01 00 00 00 nop break; case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; break; case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 2003780: f0 00 60 5c ld [ %g1 + 0x5c ], %i0 break; 2003784: 81 c7 e0 08 ret 2003788: 81 e8 00 00 restore break; case _PC_VDISABLE: return_value = the_limits->posix_vdisable; break; case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 200378c: f0 00 60 50 ld [ %g1 + 0x50 ], %i0 break; 2003790: 81 c7 e0 08 ret 2003794: 81 e8 00 00 restore break; case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; break; case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 2003798: f0 00 60 64 ld [ %g1 + 0x64 ], %i0 break; 200379c: 81 c7 e0 08 ret 20037a0: 81 e8 00 00 restore break; case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; break; case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 20037a4: f0 00 60 58 ld [ %g1 + 0x58 ], %i0 break; 20037a8: 81 c7 e0 08 ret 20037ac: 81 e8 00 00 restore break; case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; break; case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 20037b0: f0 00 60 54 ld [ %g1 + 0x54 ], %i0 break; 20037b4: 81 c7 e0 08 ret 20037b8: 81 e8 00 00 restore break; case _PC_PATH_MAX: return_value = the_limits->path_max; break; case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 20037bc: f0 00 60 4c ld [ %g1 + 0x4c ], %i0 break; 20037c0: 81 c7 e0 08 ret 20037c4: 81 e8 00 00 restore break; case _PC_NAME_MAX: return_value = the_limits->name_max; break; case _PC_PATH_MAX: return_value = the_limits->path_max; 20037c8: f0 00 60 48 ld [ %g1 + 0x48 ], %i0 break; 20037cc: 81 c7 e0 08 ret 20037d0: 81 e8 00 00 restore break; case _PC_MAX_INPUT: return_value = the_limits->max_input; break; case _PC_NAME_MAX: return_value = the_limits->name_max; 20037d4: f0 00 60 44 ld [ %g1 + 0x44 ], %i0 break; 20037d8: 81 c7 e0 08 ret 20037dc: 81 e8 00 00 restore break; case _PC_MAX_CANON: return_value = the_limits->max_canon; break; case _PC_MAX_INPUT: return_value = the_limits->max_input; 20037e0: f0 00 60 40 ld [ %g1 + 0x40 ], %i0 break; 20037e4: 81 c7 e0 08 ret 20037e8: 81 e8 00 00 restore switch ( name ) { case _PC_LINK_MAX: return_value = the_limits->link_max; break; case _PC_MAX_CANON: return_value = the_limits->max_canon; 20037ec: f0 00 60 3c ld [ %g1 + 0x3c ], %i0 break; 20037f0: 81 c7 e0 08 ret 20037f4: 81 e8 00 00 restore the_limits = &iop->pathinfo.mt_entry->pathconf_limits_and_options; switch ( name ) { case _PC_LINK_MAX: return_value = the_limits->link_max; 20037f8: f0 00 60 38 ld [ %g1 + 0x38 ], %i0 break; 20037fc: 81 c7 e0 08 ret 2003800: 81 e8 00 00 restore break; case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; break; case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 2003804: f0 00 60 60 ld [ %g1 + 0x60 ], %i0 break; 2003808: 81 c7 e0 08 ret 200380c: 81 e8 00 00 restore rtems_libio_t *iop; rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); iop = rtems_libio_iop(fd); rtems_libio_check_is_open(iop); 2003810: 40 00 33 47 call 201052c <__errno> 2003814: b0 10 3f ff mov -1, %i0 2003818: 82 10 20 09 mov 9, %g1 200381c: c2 22 00 00 st %g1, [ %o0 ] 2003820: 81 c7 e0 08 ret 2003824: 81 e8 00 00 restore rtems_libio_check_permissions(iop, LIBIO_FLAGS_READ); 2003828: 40 00 33 41 call 201052c <__errno> 200382c: b0 10 3f ff mov -1, %i0 2003830: 82 10 20 16 mov 0x16, %g1 2003834: c2 22 00 00 st %g1, [ %o0 ] 2003838: 81 c7 e0 08 ret 200383c: 81 e8 00 00 restore =============================================================================== 02002eb4 : #include void free( void *ptr ) { 2002eb4: 9d e3 bf a0 save %sp, -96, %sp MSBUMP(free_calls, 1); 2002eb8: 03 00 80 75 sethi %hi(0x201d400), %g1 2002ebc: 82 10 63 a0 or %g1, 0x3a0, %g1 ! 201d7a0 2002ec0: c4 00 60 0c ld [ %g1 + 0xc ], %g2 #include void free( void *ptr ) { 2002ec4: b2 10 00 18 mov %i0, %i1 MSBUMP(free_calls, 1); 2002ec8: 84 00 a0 01 inc %g2 if ( !ptr ) 2002ecc: 80 a6 20 00 cmp %i0, 0 2002ed0: 02 80 00 15 be 2002f24 2002ed4: c4 20 60 0c st %g2, [ %g1 + 0xc ] return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 2002ed8: 03 00 80 76 sethi %hi(0x201d800), %g1 2002edc: c2 00 62 ac ld [ %g1 + 0x2ac ], %g1 ! 201daac <_System_state_Current> 2002ee0: 80 a0 60 03 cmp %g1, 3 2002ee4: 02 80 00 17 be 2002f40 <== ALWAYS TAKEN 2002ee8: 03 00 80 75 sethi %hi(0x201d400), %g1 } /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 2002eec: c2 00 60 e4 ld [ %g1 + 0xe4 ], %g1 ! 201d4e4 2002ef0: 80 a0 60 00 cmp %g1, 0 2002ef4: 02 80 00 06 be 2002f0c 2002ef8: 3b 00 80 73 sethi %hi(0x201cc00), %i5 (*rtems_malloc_statistics_helpers->at_free)(ptr); 2002efc: c2 00 60 08 ld [ %g1 + 8 ], %g1 2002f00: 9f c0 40 00 call %g1 2002f04: 90 10 00 19 mov %i1, %o0 if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { 2002f08: 3b 00 80 73 sethi %hi(0x201cc00), %i5 2002f0c: d0 07 60 d0 ld [ %i5 + 0xd0 ], %o0 ! 201ccd0 2002f10: 40 00 15 fa call 20086f8 <_Protected_heap_Free> 2002f14: 92 10 00 19 mov %i1, %o1 2002f18: 80 8a 20 ff btst 0xff, %o0 2002f1c: 22 80 00 04 be,a 2002f2c 2002f20: c2 07 60 d0 ld [ %i5 + 0xd0 ], %g1 2002f24: 81 c7 e0 08 ret 2002f28: 81 e8 00 00 restore printk( "Program heap: free of bad pointer %p -- range %p - %p \n", 2002f2c: 31 00 80 6d sethi %hi(0x201b400), %i0 2002f30: f4 00 60 18 ld [ %g1 + 0x18 ], %i2 2002f34: f6 00 60 1c ld [ %g1 + 0x1c ], %i3 2002f38: 40 00 03 af call 2003df4 2002f3c: 91 ee 23 a0 restore %i0, 0x3a0, %o0 /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && !malloc_is_system_state_OK() ) { 2002f40: 40 00 00 5f call 20030bc 2002f44: 01 00 00 00 nop return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 2002f48: 80 8a 20 ff btst 0xff, %o0 2002f4c: 12 bf ff e8 bne 2002eec 2002f50: 03 00 80 75 sethi %hi(0x201d400), %g1 !malloc_is_system_state_OK() ) { malloc_deferred_free(ptr); 2002f54: 40 00 00 79 call 2003138 2002f58: 81 e8 00 00 restore =============================================================================== 02003f8c : * NOTE: this must be called with * thread dispatching disabled! */ static void free_user_env(void *venv) { 2003f8c: 9d e3 bf a0 save %sp, -96, %sp rtems_user_env_t *env = (rtems_user_env_t*) venv ; if (env != &rtems_global_user_env 2003f90: 03 00 80 5b sethi %hi(0x2016c00), %g1 2003f94: 82 10 62 64 or %g1, 0x264, %g1 ! 2016e64 2003f98: 80 a6 00 01 cmp %i0, %g1 2003f9c: 02 80 00 08 be 2003fbc <== NEVER TAKEN 2003fa0: 01 00 00 00 nop #ifdef HAVE_USERENV_REFCNT && --env->refcnt <= 0 #endif ) { rtems_filesystem_freenode( &env->current_directory); 2003fa4: 7f ff fb 89 call 2002dc8 2003fa8: 90 06 20 04 add %i0, 4, %o0 rtems_filesystem_freenode( &env->root_directory); 2003fac: 7f ff fb 87 call 2002dc8 2003fb0: 90 06 20 18 add %i0, 0x18, %o0 free(env); 2003fb4: 7f ff fb 8c call 2002de4 2003fb8: 81 e8 00 00 restore 2003fbc: 81 c7 e0 08 ret <== NOT EXECUTED 2003fc0: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 02015d5c : int getdents( int dd_fd, char *dd_buf, int dd_len ) { 2015d5c: 9d e3 bf 88 save %sp, -120, %sp rtems_filesystem_location_info_t loc; /* * Get the file control block structure associated with the file descriptor */ iop = rtems_libio_iop( dd_fd ); 2015d60: 03 00 80 62 sethi %hi(0x2018800), %g1 2015d64: c2 00 62 c4 ld [ %g1 + 0x2c4 ], %g1 ! 2018ac4 2015d68: 80 a6 00 01 cmp %i0, %g1 2015d6c: 1a 80 00 06 bcc 2015d84 <== NEVER TAKEN 2015d70: ba 10 20 00 clr %i5 2015d74: 03 00 80 65 sethi %hi(0x2019400), %g1 2015d78: fa 00 62 4c ld [ %g1 + 0x24c ], %i5 ! 201964c 2015d7c: b1 2e 20 06 sll %i0, 6, %i0 2015d80: ba 07 40 18 add %i5, %i0, %i5 /* * Make sure we are working on a directory */ loc = iop->pathinfo; 2015d84: c4 07 60 28 ld [ %i5 + 0x28 ], %g2 2015d88: de 07 60 1c ld [ %i5 + 0x1c ], %o7 if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) 2015d8c: c2 00 a0 10 ld [ %g2 + 0x10 ], %g1 iop = rtems_libio_iop( dd_fd ); /* * Make sure we are working on a directory */ loc = iop->pathinfo; 2015d90: f0 07 60 20 ld [ %i5 + 0x20 ], %i0 2015d94: c8 07 60 24 ld [ %i5 + 0x24 ], %g4 2015d98: c6 07 60 2c ld [ %i5 + 0x2c ], %g3 2015d9c: de 27 bf ec st %o7, [ %fp + -20 ] 2015da0: f0 27 bf f0 st %i0, [ %fp + -16 ] 2015da4: c8 27 bf f4 st %g4, [ %fp + -12 ] 2015da8: c4 27 bf f8 st %g2, [ %fp + -8 ] 2015dac: c6 27 bf fc st %g3, [ %fp + -4 ] if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) 2015db0: 9f c0 40 00 call %g1 2015db4: 90 07 bf ec add %fp, -20, %o0 2015db8: 80 a2 20 01 cmp %o0, 1 2015dbc: 12 80 00 09 bne 2015de0 2015dc0: 90 10 00 1d mov %i5, %o0 /* * 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 ); 2015dc4: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 2015dc8: c2 00 60 08 ld [ %g1 + 8 ], %g1 2015dcc: 92 10 00 19 mov %i1, %o1 2015dd0: 9f c0 40 00 call %g1 2015dd4: 94 10 00 1a mov %i2, %o2 } 2015dd8: 81 c7 e0 08 ret 2015ddc: 91 e8 00 08 restore %g0, %o0, %o0 /* * Make sure we are working on a directory */ loc = iop->pathinfo; if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) rtems_set_errno_and_return_minus_one( ENOTDIR ); 2015de0: 7f ff e8 bf call 20100dc <__errno> 2015de4: b0 10 3f ff mov -1, %i0 2015de8: 82 10 20 14 mov 0x14, %g1 2015dec: c2 22 00 00 st %g1, [ %o0 ] 2015df0: 81 c7 e0 08 ret 2015df4: 81 e8 00 00 restore =============================================================================== 0200ea8c : 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 ) 200ea8c: c4 02 20 1c ld [ %o0 + 0x1c ], %g2 200ea90: c4 00 a0 4c ld [ %g2 + 0x4c ], %g2 200ea94: 80 a0 a0 01 cmp %g2, 1 200ea98: 12 80 00 05 bne 200eaac <== NEVER TAKEN 200ea9c: 82 10 3f ff mov -1, %g1 return -1; /* It wasn't a directory --> return error */ iop->offset = 0; 200eaa0: c0 22 20 10 clr [ %o0 + 0x10 ] 200eaa4: c0 22 20 14 clr [ %o0 + 0x14 ] return 0; 200eaa8: 82 10 20 00 clr %g1 } 200eaac: 81 c3 e0 08 retl 200eab0: 90 10 00 01 mov %g1, %o0 =============================================================================== 0200eab4 : ssize_t imfs_dir_read( rtems_libio_t *iop, void *buffer, size_t count ) { 200eab4: 9d e3 be 88 save %sp, -376, %sp int current_entry; int first_entry; int last_entry; struct dirent tmp_dirent; the_jnode = (IMFS_jnode_t *)iop->pathinfo.node_access; 200eab8: f6 06 20 1c ld [ %i0 + 0x1c ], %i3 ssize_t imfs_dir_read( rtems_libio_t *iop, void *buffer, size_t count ) { 200eabc: ba 10 00 18 mov %i0, %i5 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 200eac0: f8 06 e0 50 ld [ %i3 + 0x50 ], %i4 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 200eac4: b6 06 e0 54 add %i3, 0x54, %i3 struct dirent tmp_dirent; the_jnode = (IMFS_jnode_t *)iop->pathinfo.node_access; the_chain = &the_jnode->info.directory.Entries; if ( rtems_chain_is_empty( the_chain ) ) 200eac8: 80 a7 00 1b cmp %i4, %i3 200eacc: 02 80 00 34 be 200eb9c 200ead0: b0 10 20 00 clr %i0 /* Move to the first of the desired directory entries */ the_node = rtems_chain_first( the_chain ); bytes_transferred = 0; first_entry = iop->offset; 200ead4: e0 07 60 14 ld [ %i5 + 0x14 ], %l0 /* protect against using sizes that are not exact multiples of the */ /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count/sizeof(struct dirent)) * sizeof(struct dirent); 200ead8: 90 10 00 1a mov %i2, %o0 200eadc: 40 00 27 30 call 201879c <.udiv> 200eae0: 92 10 21 18 mov 0x118, %o1 for ( current_entry = 0; current_entry < last_entry; current_entry = current_entry + sizeof(struct dirent) ){ if ( rtems_chain_is_tail( the_chain, the_node ) ){ 200eae4: b4 10 20 00 clr %i2 bytes_transferred = 0; first_entry = iop->offset; /* protect against using sizes that are not exact multiples of the */ /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count/sizeof(struct dirent)) * sizeof(struct dirent); 200eae8: 83 2a 20 03 sll %o0, 3, %g1 200eaec: 91 2a 20 05 sll %o0, 5, %o0 200eaf0: 82 00 40 08 add %g1, %o0, %g1 200eaf4: a3 28 60 03 sll %g1, 3, %l1 200eaf8: a2 24 40 01 sub %l1, %g1, %l1 200eafc: a2 04 40 10 add %l1, %l0, %l1 /* The directory was not empty so try to move to the desired entry in chain*/ for ( 200eb00: 80 a4 60 00 cmp %l1, 0 200eb04: 14 80 00 09 bg 200eb28 <== ALWAYS TAKEN 200eb08: a4 10 21 18 mov 0x118, %l2 200eb0c: 30 80 00 24 b,a 200eb9c <== NOT EXECUTED 200eb10: 80 a4 40 1a cmp %l1, %i2 200eb14: 04 80 00 22 ble 200eb9c <== NEVER TAKEN 200eb18: f8 07 00 00 ld [ %i4 ], %i4 current_entry = 0; current_entry < last_entry; current_entry = current_entry + sizeof(struct dirent) ){ if ( rtems_chain_is_tail( the_chain, the_node ) ){ 200eb1c: 80 a7 00 1b cmp %i4, %i3 200eb20: 02 80 00 1f be 200eb9c 200eb24: 01 00 00 00 nop /* entry in the read */ return bytes_transferred; /* Indicate that there are no more */ /* entries to return */ } if( current_entry >= first_entry ) { 200eb28: 80 a4 00 1a cmp %l0, %i2 200eb2c: 34 bf ff f9 bg,a 200eb10 200eb30: b4 06 a1 18 add %i2, 0x118, %i2 /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; tmp_dirent.d_reclen = sizeof( struct dirent ); the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->st_ino; 200eb34: c2 07 20 38 ld [ %i4 + 0x38 ], %g1 /* entries to return */ } if( current_entry >= first_entry ) { /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; 200eb38: 85 3e a0 1f sra %i2, 0x1f, %g2 tmp_dirent.d_reclen = sizeof( struct dirent ); the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->st_ino; tmp_dirent.d_namlen = strlen( the_jnode->name ); 200eb3c: a6 07 20 0c add %i4, 0xc, %l3 /* entries to return */ } if( current_entry >= first_entry ) { /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; 200eb40: c4 27 be f0 st %g2, [ %fp + -272 ] tmp_dirent.d_reclen = sizeof( struct dirent ); the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->st_ino; 200eb44: c2 27 be e8 st %g1, [ %fp + -280 ] /* entries to return */ } if( current_entry >= first_entry ) { /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; 200eb48: f4 27 be f4 st %i2, [ %fp + -268 ] tmp_dirent.d_reclen = sizeof( struct dirent ); 200eb4c: e4 37 be f8 sth %l2, [ %fp + -264 ] the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->st_ino; tmp_dirent.d_namlen = strlen( the_jnode->name ); 200eb50: 40 00 09 06 call 2010f68 200eb54: 90 10 00 13 mov %l3, %o0 strcpy( tmp_dirent.d_name, the_jnode->name ); 200eb58: 92 10 00 13 mov %l3, %o1 /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; tmp_dirent.d_reclen = sizeof( struct dirent ); the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->st_ino; tmp_dirent.d_namlen = strlen( the_jnode->name ); 200eb5c: d0 37 be fa sth %o0, [ %fp + -262 ] strcpy( tmp_dirent.d_name, the_jnode->name ); 200eb60: 40 00 07 4d call 2010894 200eb64: 90 07 be fc add %fp, -260, %o0 memcpy( 200eb68: 90 06 40 18 add %i1, %i0, %o0 200eb6c: 92 07 be e8 add %fp, -280, %o1 200eb70: 40 00 05 c4 call 2010280 200eb74: 94 10 21 18 mov 0x118, %o2 buffer + bytes_transferred, (void *)&tmp_dirent, sizeof( struct dirent ) ); iop->offset = iop->offset + sizeof(struct dirent); 200eb78: c4 1f 60 10 ldd [ %i5 + 0x10 ], %g2 * to the end of the exisiting file, the remaining entries will be placed in * the buffer and the returned value will be equal to -m actual- times the * size of a directory entry. */ ssize_t imfs_dir_read( 200eb7c: b4 06 a1 18 add %i2, 0x118, %i2 memcpy( buffer + bytes_transferred, (void *)&tmp_dirent, sizeof( struct dirent ) ); iop->offset = iop->offset + sizeof(struct dirent); 200eb80: 86 80 e1 18 addcc %g3, 0x118, %g3 200eb84: 84 40 a0 00 addx %g2, 0, %g2 200eb88: c4 3f 60 10 std %g2, [ %i5 + 0x10 ] bytes_transferred = bytes_transferred + sizeof( struct dirent ); 200eb8c: b0 06 21 18 add %i0, 0x118, %i0 /* protect against using sizes that are not exact multiples of the */ /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count/sizeof(struct dirent)) * sizeof(struct dirent); /* The directory was not empty so try to move to the desired entry in chain*/ for ( 200eb90: 80 a4 40 1a cmp %l1, %i2 200eb94: 14 bf ff e2 bg 200eb1c <== NEVER TAKEN 200eb98: f8 07 00 00 ld [ %i4 ], %i4 the_node = the_node->next; } /* Success */ return bytes_transferred; } 200eb9c: 81 c7 e0 08 ret 200eba0: 81 e8 00 00 restore =============================================================================== 0200ecfc : int imfs_dir_rmnod( rtems_filesystem_location_info_t *parent_pathloc, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN */ ) { 200ecfc: 9d e3 bf a0 save %sp, -96, %sp IMFS_jnode_t *the_jnode; the_jnode = (IMFS_jnode_t *) pathloc->node_access; 200ed00: fa 06 40 00 ld [ %i1 ], %i5 /* * You cannot remove a node that still has children */ if ( ! rtems_chain_is_empty( &the_jnode->info.directory.Entries ) ) 200ed04: c4 07 60 50 ld [ %i5 + 0x50 ], %g2 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 200ed08: 82 07 60 54 add %i5, 0x54, %g1 200ed0c: 80 a0 80 01 cmp %g2, %g1 200ed10: 12 80 00 18 bne 200ed70 200ed14: 01 00 00 00 nop /* * You cannot remove the file system root node. */ if ( pathloc->mt_entry->mt_fs_root.node_access == pathloc->node_access ) 200ed18: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 200ed1c: c2 00 60 1c ld [ %g1 + 0x1c ], %g1 200ed20: 80 a7 40 01 cmp %i5, %g1 200ed24: 02 80 00 0d be 200ed58 200ed28: 01 00 00 00 nop /* * You cannot remove a mountpoint. */ if ( the_jnode->info.directory.mt_fs != NULL ) 200ed2c: c2 07 60 5c ld [ %i5 + 0x5c ], %g1 200ed30: 80 a0 60 00 cmp %g1, 0 200ed34: 12 80 00 09 bne 200ed58 <== NEVER TAKEN 200ed38: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EBUSY ); IMFS_create_orphan( the_jnode ); 200ed3c: 7f ff f3 48 call 200ba5c 200ed40: 90 10 00 1d mov %i5, %o0 IMFS_check_node_remove( the_jnode ); 200ed44: 90 10 00 1d mov %i5, %o0 200ed48: 7f ff f3 57 call 200baa4 200ed4c: b0 10 20 00 clr %i0 return 0; } 200ed50: 81 c7 e0 08 ret 200ed54: 81 e8 00 00 restore /* * You cannot remove a mountpoint. */ if ( the_jnode->info.directory.mt_fs != NULL ) rtems_set_errno_and_return_minus_one( EBUSY ); 200ed58: 40 00 02 f5 call 200f92c <__errno> 200ed5c: b0 10 3f ff mov -1, %i0 200ed60: 82 10 20 10 mov 0x10, %g1 200ed64: c2 22 00 00 st %g1, [ %o0 ] 200ed68: 81 c7 e0 08 ret 200ed6c: 81 e8 00 00 restore /* * You cannot remove a node that still has children */ if ( ! rtems_chain_is_empty( &the_jnode->info.directory.Entries ) ) rtems_set_errno_and_return_minus_one( ENOTEMPTY ); 200ed70: 40 00 02 ef call 200f92c <__errno> 200ed74: b0 10 3f ff mov -1, %i0 200ed78: 82 10 20 5a mov 0x5a, %g1 200ed7c: c2 22 00 00 st %g1, [ %o0 ] 200ed80: 81 c7 e0 08 ret 200ed84: 81 e8 00 00 restore =============================================================================== 02003630 : /* * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { 2003630: 9d e3 bf a0 save %sp, -96, %sp FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) 2003634: 03 00 80 60 sethi %hi(0x2018000), %g1 2003638: c4 48 63 c8 ldsb [ %g1 + 0x3c8 ], %g2 ! 20183c8 200363c: 80 a0 a0 00 cmp %g2, 0 2003640: 22 80 00 04 be,a 2003650 2003644: 84 10 20 01 mov 1, %g2 2003648: 81 c7 e0 08 ret 200364c: 81 e8 00 00 restore return; etc_passwd_initted = 1; mkdir("/etc", 0777); 2003650: 92 10 21 ff mov 0x1ff, %o1 FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; 2003654: c4 28 63 c8 stb %g2, [ %g1 + 0x3c8 ] mkdir("/etc", 0777); 2003658: 11 00 80 5b sethi %hi(0x2016c00), %o0 200365c: 40 00 02 6e call 2004014 2003660: 90 12 22 a8 or %o0, 0x2a8, %o0 ! 2016ea8 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { 2003664: 39 00 80 5b sethi %hi(0x2016c00), %i4 2003668: 3b 00 80 5b sethi %hi(0x2016c00), %i5 200366c: 90 17 22 b0 or %i4, 0x2b0, %o0 2003670: 40 00 35 8b call 2010c9c 2003674: 92 17 62 c0 or %i5, 0x2c0, %o1 2003678: 80 a2 20 00 cmp %o0, 0 200367c: 22 80 00 0d be,a 20036b0 2003680: 90 17 22 b0 or %i4, 0x2b0, %o0 } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); 2003684: 40 00 33 ae call 201053c 2003688: 01 00 00 00 nop } /* * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { 200368c: 39 00 80 5b sethi %hi(0x2016c00), %i4 2003690: 92 17 62 c0 or %i5, 0x2c0, %o1 2003694: 40 00 35 82 call 2010c9c 2003698: 90 17 23 38 or %i4, 0x338, %o0 200369c: 80 a2 20 00 cmp %o0, 0 20036a0: 22 80 00 11 be,a 20036e4 20036a4: 90 17 23 38 or %i4, 0x338, %o0 fclose(fp); 20036a8: 40 00 33 a5 call 201053c 20036ac: 91 e8 00 08 restore %g0, %o0, %o0 * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { fclose(fp); } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { 20036b0: 13 00 80 5b sethi %hi(0x2016c00), %o1 20036b4: 40 00 35 7a call 2010c9c 20036b8: 92 12 62 c8 or %o1, 0x2c8, %o1 ! 2016ec8 20036bc: b0 92 20 00 orcc %o0, 0, %i0 20036c0: 02 bf ff f3 be 200368c <== NEVER TAKEN 20036c4: 92 10 20 01 mov 1, %o1 fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" 20036c8: 94 10 20 66 mov 0x66, %o2 20036cc: 96 10 00 18 mov %i0, %o3 20036d0: 11 00 80 5b sethi %hi(0x2016c00), %o0 20036d4: 40 00 37 5c call 2011444 20036d8: 90 12 22 d0 or %o0, 0x2d0, %o0 ! 2016ed0 "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); 20036dc: 10 bf ff ea b 2003684 20036e0: 90 10 00 18 mov %i0, %o0 * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { fclose(fp); } else if ((fp = fopen("/etc/group", "w")) != NULL) { 20036e4: 13 00 80 5b sethi %hi(0x2016c00), %o1 20036e8: 40 00 35 6d call 2010c9c 20036ec: 92 12 62 c8 or %o1, 0x2c8, %o1 ! 2016ec8 20036f0: b0 92 20 00 orcc %o0, 0, %i0 20036f4: 02 bf ff d5 be 2003648 <== NEVER TAKEN 20036f8: 01 00 00 00 nop fprintf( fp, "root:x:0:root\n" 20036fc: 92 10 20 01 mov 1, %o1 ! 1 2003700: 11 00 80 5b sethi %hi(0x2016c00), %o0 2003704: 94 10 20 2a mov 0x2a, %o2 2003708: 96 10 00 18 mov %i0, %o3 200370c: 40 00 37 4e call 2011444 2003710: 90 12 23 48 or %o0, 0x348, %o0 "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); 2003714: 40 00 33 8a call 201053c 2003718: 81 e8 00 00 restore =============================================================================== 02004f80 : /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 2004f80: 9d e3 bf a0 save %sp, -96, %sp if (tty->termios.c_iflag & ISTRIP) 2004f84: c2 06 60 30 ld [ %i1 + 0x30 ], %g1 2004f88: 80 88 60 20 btst 0x20, %g1 2004f8c: 02 80 00 03 be 2004f98 <== ALWAYS TAKEN 2004f90: ba 10 00 18 mov %i0, %i5 c &= 0x7f; 2004f94: ba 0e 20 7f and %i0, 0x7f, %i5 <== NOT EXECUTED if (tty->termios.c_iflag & IUCLC) 2004f98: 80 88 62 00 btst 0x200, %g1 2004f9c: 02 80 00 0d be 2004fd0 2004fa0: 80 a7 60 0d cmp %i5, 0xd c = tolower (c); 2004fa4: 05 00 80 73 sethi %hi(0x201cc00), %g2 2004fa8: c6 00 a3 b4 ld [ %g2 + 0x3b4 ], %g3 ! 201cfb4 <__ctype_ptr__> 2004fac: 84 10 00 1d mov %i5, %g2 2004fb0: ba 00 c0 1d add %g3, %i5, %i5 2004fb4: c6 0f 60 01 ldub [ %i5 + 1 ], %g3 2004fb8: 86 08 e0 03 and %g3, 3, %g3 2004fbc: 80 a0 e0 01 cmp %g3, 1 2004fc0: 22 80 00 02 be,a 2004fc8 2004fc4: 84 00 a0 20 add %g2, 0x20, %g2 2004fc8: ba 08 a0 ff and %g2, 0xff, %i5 if (c == '\r') { 2004fcc: 80 a7 60 0d cmp %i5, 0xd 2004fd0: 02 80 00 17 be 200502c 2004fd4: 80 a7 60 0a cmp %i5, 0xa if (tty->termios.c_iflag & IGNCR) return 0; if (tty->termios.c_iflag & ICRNL) c = '\n'; } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { 2004fd8: 02 80 00 40 be 20050d8 2004fdc: 80 a7 60 00 cmp %i5, 0 c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 2004fe0: 32 80 00 1a bne,a 2005048 <== ALWAYS TAKEN 2004fe4: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 2004fe8: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED 2004fec: 05 00 80 73 sethi %hi(0x201cc00), %g2 2004ff0: c4 00 a1 e8 ld [ %g2 + 0x1e8 ], %g2 ! 201cde8 2004ff4: 84 00 bf ff add %g2, -1, %g2 2004ff8: 80 a0 40 02 cmp %g1, %g2 2004ffc: 16 80 00 46 bge 2005114 <== NEVER TAKEN 2005000: b0 10 20 00 clr %i0 if (tty->termios.c_lflag & ECHO) 2005004: c4 06 60 3c ld [ %i1 + 0x3c ], %g2 2005008: 80 88 a0 08 btst 8, %g2 200500c: 12 80 00 38 bne 20050ec <== ALWAYS TAKEN 2005010: 90 10 00 1d mov %i5, %o0 echo (c, tty); tty->cbuf[tty->ccount++] = c; 2005014: c6 06 60 1c ld [ %i1 + 0x1c ], %g3 2005018: 84 00 60 01 add %g1, 1, %g2 200501c: fa 28 c0 01 stb %i5, [ %g3 + %g1 ] 2005020: c4 26 60 20 st %g2, [ %i1 + 0x20 ] } return 0; } 2005024: 81 c7 e0 08 ret 2005028: 91 e8 20 00 restore %g0, 0, %o0 if (tty->termios.c_iflag & IUCLC) c = tolower (c); if (c == '\r') { if (tty->termios.c_iflag & IGNCR) 200502c: 80 88 60 80 btst 0x80, %g1 2005030: 12 80 00 39 bne 2005114 <== NEVER TAKEN 2005034: b0 10 20 00 clr %i0 return 0; if (tty->termios.c_iflag & ICRNL) 2005038: 80 88 61 00 btst 0x100, %g1 200503c: 32 80 00 02 bne,a 2005044 <== ALWAYS TAKEN 2005040: ba 10 20 0a mov 0xa, %i5 c = '\n'; } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 2005044: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 2005048: 80 88 60 02 btst 2, %g1 200504c: 22 bf ff e8 be,a 2004fec 2005050: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 if (c == tty->termios.c_cc[VERASE]) { 2005054: c4 0e 60 43 ldub [ %i1 + 0x43 ], %g2 2005058: 80 a0 80 1d cmp %g2, %i5 200505c: 02 80 00 3d be 2005150 2005060: 90 10 00 19 mov %i1, %o0 erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { 2005064: c4 0e 60 44 ldub [ %i1 + 0x44 ], %g2 2005068: 80 a0 80 1d cmp %g2, %i5 200506c: 02 80 00 28 be 200510c 2005070: 92 10 20 01 mov 1, %o1 erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { 2005074: c4 0e 60 45 ldub [ %i1 + 0x45 ], %g2 2005078: 80 a0 80 1d cmp %g2, %i5 200507c: 02 80 00 26 be 2005114 <== NEVER TAKEN 2005080: b0 10 20 01 mov 1, %i0 return 1; } else if (c == '\n') { 2005084: 80 a7 60 0a cmp %i5, 0xa 2005088: 02 80 00 25 be 200511c 200508c: 80 88 60 48 btst 0x48, %g1 if (tty->termios.c_lflag & (ECHO | ECHONL)) echo (c, tty); tty->cbuf[tty->ccount++] = c; return 1; } else if ((c == tty->termios.c_cc[VEOL]) || 2005090: c4 0e 60 4c ldub [ %i1 + 0x4c ], %g2 2005094: 80 a0 80 1d cmp %g2, %i5 2005098: 02 80 00 07 be 20050b4 <== NEVER TAKEN 200509c: 80 88 60 08 btst 8, %g1 20050a0: c4 0e 60 51 ldub [ %i1 + 0x51 ], %g2 20050a4: 80 a0 80 1d cmp %g2, %i5 20050a8: 32 bf ff d1 bne,a 2004fec <== ALWAYS TAKEN 20050ac: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) 20050b0: 80 88 60 08 btst 8, %g1 <== NOT EXECUTED 20050b4: 32 80 00 12 bne,a 20050fc <== NOT EXECUTED 20050b8: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED echo (c, tty); tty->cbuf[tty->ccount++] = c; 20050bc: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED 20050c0: c6 06 60 1c ld [ %i1 + 0x1c ], %g3 <== NOT EXECUTED 20050c4: 84 00 60 01 add %g1, 1, %g2 <== NOT EXECUTED 20050c8: fa 28 c0 01 stb %i5, [ %g3 + %g1 ] <== NOT EXECUTED 20050cc: c4 26 60 20 st %g2, [ %i1 + 0x20 ] <== NOT EXECUTED return 1; 20050d0: 81 c7 e0 08 ret <== NOT EXECUTED 20050d4: 91 e8 20 01 restore %g0, 1, %o0 <== NOT EXECUTED if (c == '\r') { if (tty->termios.c_iflag & IGNCR) return 0; if (tty->termios.c_iflag & ICRNL) c = '\n'; } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { 20050d8: 80 88 60 40 btst 0x40, %g1 20050dc: 32 bf ff da bne,a 2005044 <== NEVER TAKEN 20050e0: ba 10 20 0d mov 0xd, %i5 <== NOT EXECUTED c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 20050e4: 10 bf ff d9 b 2005048 20050e8: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { if (tty->termios.c_lflag & ECHO) echo (c, tty); 20050ec: 7f ff fe f6 call 2004cc4 20050f0: 92 10 00 19 mov %i1, %o1 20050f4: 10 bf ff c8 b 2005014 20050f8: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 tty->cbuf[tty->ccount++] = c; return 1; } else if ((c == tty->termios.c_cc[VEOL]) || (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) echo (c, tty); 20050fc: 7f ff fe f2 call 2004cc4 <== NOT EXECUTED 2005100: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED tty->cbuf[tty->ccount++] = c; 2005104: 10 bf ff ef b 20050c0 <== NOT EXECUTED 2005108: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED if (c == tty->termios.c_cc[VERASE]) { erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); 200510c: 7f ff ff 0f call 2004d48 2005110: b0 10 20 00 clr %i0 return 0; 2005114: 81 c7 e0 08 ret 2005118: 81 e8 00 00 restore } else if (c == tty->termios.c_cc[VEOF]) { return 1; } else if (c == '\n') { if (tty->termios.c_lflag & (ECHO | ECHONL)) 200511c: 22 80 00 06 be,a 2005134 <== NEVER TAKEN 2005120: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED echo (c, tty); 2005124: 90 10 20 0a mov 0xa, %o0 2005128: 7f ff fe e7 call 2004cc4 200512c: 92 10 00 19 mov %i1, %o1 tty->cbuf[tty->ccount++] = c; 2005130: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 2005134: c4 06 60 1c ld [ %i1 + 0x1c ], %g2 2005138: 86 10 20 0a mov 0xa, %g3 200513c: c6 28 80 01 stb %g3, [ %g2 + %g1 ] 2005140: 82 00 60 01 inc %g1 2005144: c2 26 60 20 st %g1, [ %i1 + 0x20 ] return 1; 2005148: 81 c7 e0 08 ret 200514c: 91 e8 20 01 restore %g0, 1, %o0 c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { if (c == tty->termios.c_cc[VERASE]) { erase (tty, 0); 2005150: 92 10 20 00 clr %o1 2005154: 7f ff fe fd call 2004d48 2005158: b0 10 20 00 clr %i0 return 0; 200515c: 81 c7 e0 08 ret 2005160: 81 e8 00 00 restore =============================================================================== 0201a3cc : int killinfo( pid_t pid, int sig, const union sigval *value ) { 201a3cc: 9d e3 bf 90 save %sp, -112, %sp POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 201a3d0: 7f ff fe e2 call 2019f58 201a3d4: 01 00 00 00 nop 201a3d8: 80 a2 00 18 cmp %o0, %i0 201a3dc: 12 80 00 af bne 201a698 201a3e0: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); /* * Validate the signal passed. */ if ( !sig ) 201a3e4: 02 80 00 b3 be 201a6b0 201a3e8: 82 06 7f ff add %i1, -1, %g1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 201a3ec: 80 a0 60 1f cmp %g1, 0x1f 201a3f0: 18 80 00 b0 bgu 201a6b0 201a3f4: b7 2e 60 02 sll %i1, 2, %i3 rtems_set_errno_and_return_minus_one( EINVAL ); /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 201a3f8: 39 00 80 77 sethi %hi(0x201dc00), %i4 201a3fc: a1 2e 60 04 sll %i1, 4, %l0 201a400: b8 17 22 e0 or %i4, 0x2e0, %i4 201a404: 84 24 00 1b sub %l0, %i3, %g2 201a408: 84 07 00 02 add %i4, %g2, %g2 201a40c: c4 00 a0 08 ld [ %g2 + 8 ], %g2 201a410: 80 a0 a0 01 cmp %g2, 1 201a414: 02 80 00 3f be 201a510 201a418: b0 10 20 00 clr %i0 /* * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) 201a41c: 80 a6 60 04 cmp %i1, 4 201a420: 02 80 00 3e be 201a518 201a424: 80 a6 60 08 cmp %i1, 8 201a428: 02 80 00 3c be 201a518 201a42c: 80 a6 60 0b cmp %i1, 0xb 201a430: 02 80 00 3a be 201a518 201a434: ba 10 20 01 mov 1, %i5 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 201a438: f2 27 bf f4 st %i1, [ %fp + -12 ] siginfo->si_code = SI_USER; 201a43c: fa 27 bf f8 st %i5, [ %fp + -8 ] if ( !value ) { 201a440: 80 a6 a0 00 cmp %i2, 0 201a444: 02 80 00 3b be 201a530 201a448: bb 2f 40 01 sll %i5, %g1, %i5 siginfo->si_value.sival_int = 0; } else { siginfo->si_value = *value; 201a44c: c2 06 80 00 ld [ %i2 ], %g1 201a450: c2 27 bf fc st %g1, [ %fp + -4 ] /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 201a454: 03 00 80 76 sethi %hi(0x201d800), %g1 201a458: c4 00 61 50 ld [ %g1 + 0x150 ], %g2 ! 201d950 <_Thread_Dispatch_disable_level> 201a45c: 84 00 a0 01 inc %g2 201a460: c4 20 61 50 st %g2, [ %g1 + 0x150 ] return _Thread_Dispatch_disable_level; 201a464: c2 00 61 50 ld [ %g1 + 0x150 ], %g1 /* * Is the currently executing thread interested? If so then it will * get it an execute it as soon as the dispatcher executes. */ the_thread = _Thread_Executing; 201a468: 03 00 80 77 sethi %hi(0x201dc00), %g1 201a46c: d0 00 62 94 ld [ %g1 + 0x294 ], %o0 ! 201de94 <_Per_CPU_Information+0xc> api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 201a470: c2 02 21 5c ld [ %o0 + 0x15c ], %g1 201a474: c2 00 60 d0 ld [ %g1 + 0xd0 ], %g1 201a478: 80 af 40 01 andncc %i5, %g1, %g0 201a47c: 12 80 00 16 bne 201a4d4 201a480: 07 00 80 78 sethi %hi(0x201e000), %g3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 201a484: d0 00 e0 6c ld [ %g3 + 0x6c ], %o0 ! 201e06c <_POSIX_signals_Wait_queue> 201a488: 86 10 e0 6c or %g3, 0x6c, %g3 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 201a48c: 86 00 e0 04 add %g3, 4, %g3 201a490: 80 a2 00 03 cmp %o0, %g3 201a494: 32 80 00 0d bne,a 201a4c8 201a498: c2 02 20 30 ld [ %o0 + 0x30 ], %g1 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 201a49c: 10 80 00 27 b 201a538 201a4a0: 03 00 80 73 sethi %hi(0x201cc00), %g1 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 201a4a4: c2 00 a0 d0 ld [ %g2 + 0xd0 ], %g1 201a4a8: 80 af 40 01 andncc %i5, %g1, %g0 201a4ac: 12 80 00 0b bne 201a4d8 201a4b0: 92 10 00 19 mov %i1, %o1 the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 201a4b4: d0 02 00 00 ld [ %o0 ], %o0 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 201a4b8: 80 a2 00 03 cmp %o0, %g3 201a4bc: 02 80 00 1f be 201a538 <== ALWAYS TAKEN 201a4c0: 03 00 80 73 sethi %hi(0x201cc00), %g1 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 201a4c4: c2 02 20 30 ld [ %o0 + 0x30 ], %g1 <== NOT EXECUTED 201a4c8: 80 8f 40 01 btst %i5, %g1 201a4cc: 02 bf ff f6 be 201a4a4 201a4d0: c4 02 21 5c ld [ %o0 + 0x15c ], %g2 /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { 201a4d4: 92 10 00 19 mov %i1, %o1 201a4d8: 40 00 00 8d call 201a70c <_POSIX_signals_Unblock_thread> 201a4dc: 94 07 bf f4 add %fp, -12, %o2 201a4e0: 80 8a 20 ff btst 0xff, %o0 201a4e4: 12 80 00 5a bne 201a64c 201a4e8: 01 00 00 00 nop /* * We may have woken up a thread but we definitely need to post the * signal to the process wide information set. */ _POSIX_signals_Set_process_signals( mask ); 201a4ec: 40 00 00 7f call 201a6e8 <_POSIX_signals_Set_process_signals> 201a4f0: 90 10 00 1d mov %i5, %o0 if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 201a4f4: b6 24 00 1b sub %l0, %i3, %i3 201a4f8: c2 07 00 1b ld [ %i4 + %i3 ], %g1 201a4fc: 80 a0 60 02 cmp %g1, 2 201a500: 02 80 00 57 be 201a65c 201a504: 11 00 80 78 sethi %hi(0x201e000), %o0 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 201a508: 7f ff bb 61 call 200928c <_Thread_Enable_dispatch> 201a50c: b0 10 20 00 clr %i0 return 0; } 201a510: 81 c7 e0 08 ret 201a514: 81 e8 00 00 restore * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) return pthread_kill( pthread_self(), sig ); 201a518: 40 00 01 0f call 201a954 201a51c: 01 00 00 00 nop 201a520: 40 00 00 d2 call 201a868 201a524: 92 10 00 19 mov %i1, %o1 201a528: 81 c7 e0 08 ret 201a52c: 91 e8 00 08 restore %g0, %o0, %o0 */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; if ( !value ) { siginfo->si_value.sival_int = 0; 201a530: 10 bf ff c9 b 201a454 201a534: c0 27 bf fc clr [ %fp + -4 ] * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 201a538: c8 08 60 2c ldub [ %g1 + 0x2c ], %g4 201a53c: 1b 00 80 76 sethi %hi(0x201d800), %o5 201a540: 88 01 20 01 inc %g4 201a544: 9a 13 60 c0 or %o5, 0xc0, %o5 * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 201a548: 90 10 20 00 clr %o0 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 201a54c: 98 03 60 08 add %o5, 8, %o4 */ RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal ( States_Control the_states ) { return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL); 201a550: 15 04 00 00 sethi %hi(0x10000000), %o2 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and an API is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 201a554: c2 03 40 00 ld [ %o5 ], %g1 201a558: 80 a0 60 00 cmp %g1, 0 201a55c: 22 80 00 31 be,a 201a620 <== NEVER TAKEN 201a560: 9a 03 60 04 add %o5, 4, %o5 <== NOT EXECUTED continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 201a564: c2 00 60 04 ld [ %g1 + 4 ], %g1 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 201a568: f4 10 60 10 lduh [ %g1 + 0x10 ], %i2 object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 201a56c: 80 a6 a0 00 cmp %i2, 0 201a570: 02 80 00 2b be 201a61c 201a574: f0 00 60 1c ld [ %g1 + 0x1c ], %i0 201a578: 82 10 20 01 mov 1, %g1 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 201a57c: 85 28 60 02 sll %g1, 2, %g2 maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { the_thread = (Thread_Control *) object_table[ index ]; 201a580: c4 06 00 02 ld [ %i0 + %g2 ], %g2 if ( !the_thread ) 201a584: 80 a0 a0 00 cmp %g2, 0 201a588: 22 80 00 22 be,a 201a610 201a58c: 82 00 60 01 inc %g1 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 201a590: c6 00 a0 14 ld [ %g2 + 0x14 ], %g3 201a594: 80 a0 c0 04 cmp %g3, %g4 201a598: 38 80 00 1e bgu,a 201a610 201a59c: 82 00 60 01 inc %g1 #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 201a5a0: de 00 a1 5c ld [ %g2 + 0x15c ], %o7 201a5a4: de 03 e0 d0 ld [ %o7 + 0xd0 ], %o7 201a5a8: 80 af 40 0f andncc %i5, %o7, %g0 201a5ac: 22 80 00 19 be,a 201a610 201a5b0: 82 00 60 01 inc %g1 * * NOTE: We initialized interested_priority to PRIORITY_MAXIMUM + 1 * so we never have to worry about deferencing a NULL * interested thread. */ if ( the_thread->current_priority < interested_priority ) { 201a5b4: 80 a0 c0 04 cmp %g3, %g4 201a5b8: 2a 80 00 14 bcs,a 201a608 201a5bc: 88 10 00 03 mov %g3, %g4 * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( interested && !_States_Is_ready( interested->current_state ) ) { 201a5c0: 80 a2 20 00 cmp %o0, 0 201a5c4: 22 80 00 13 be,a 201a610 <== NEVER TAKEN 201a5c8: 82 00 60 01 inc %g1 <== NOT EXECUTED 201a5cc: de 02 20 10 ld [ %o0 + 0x10 ], %o7 201a5d0: 80 a3 e0 00 cmp %o7, 0 201a5d4: 22 80 00 0f be,a 201a610 <== NEVER TAKEN 201a5d8: 82 00 60 01 inc %g1 <== NOT EXECUTED /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 201a5dc: d6 00 a0 10 ld [ %g2 + 0x10 ], %o3 201a5e0: 80 a2 e0 00 cmp %o3, 0 201a5e4: 22 80 00 09 be,a 201a608 201a5e8: 88 10 00 03 mov %g3, %g4 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 201a5ec: 80 8b c0 0a btst %o7, %o2 201a5f0: 32 80 00 08 bne,a 201a610 201a5f4: 82 00 60 01 inc %g1 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 201a5f8: 80 8a c0 0a btst %o3, %o2 201a5fc: 22 80 00 05 be,a 201a610 201a600: 82 00 60 01 inc %g1 */ if ( interested && !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 201a604: 88 10 00 03 mov %g3, %g4 201a608: 90 10 00 02 mov %g2, %o0 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 201a60c: 82 00 60 01 inc %g1 201a610: 80 a6 80 01 cmp %i2, %g1 201a614: 1a bf ff db bcc 201a580 201a618: 85 28 60 02 sll %g1, 2, %g2 201a61c: 9a 03 60 04 add %o5, 4, %o5 * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 201a620: 80 a3 40 0c cmp %o5, %o4 201a624: 32 bf ff cd bne,a 201a558 201a628: c2 03 40 00 ld [ %o5 ], %g1 } } } } if ( interested ) { 201a62c: 80 a2 20 00 cmp %o0, 0 201a630: 02 bf ff af be 201a4ec 201a634: 92 10 00 19 mov %i1, %o1 /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { 201a638: 40 00 00 35 call 201a70c <_POSIX_signals_Unblock_thread> 201a63c: 94 07 bf f4 add %fp, -12, %o2 201a640: 80 8a 20 ff btst 0xff, %o0 201a644: 02 bf ff aa be 201a4ec <== ALWAYS TAKEN 201a648: 01 00 00 00 nop _Thread_Enable_dispatch(); 201a64c: 7f ff bb 10 call 200928c <_Thread_Enable_dispatch> 201a650: b0 10 20 00 clr %i0 ! 0 return 0; 201a654: 81 c7 e0 08 ret 201a658: 81 e8 00 00 restore */ _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) 201a65c: 7f ff b3 63 call 20073e8 <_Chain_Get> 201a660: 90 12 20 60 or %o0, 0x60, %o0 _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 201a664: 92 92 20 00 orcc %o0, 0, %o1 201a668: 02 80 00 18 be 201a6c8 201a66c: c2 07 bf f4 ld [ %fp + -12 ], %g1 rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 201a670: 11 00 80 78 sethi %hi(0x201e000), %o0 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 201a674: c2 22 60 08 st %g1, [ %o1 + 8 ] 201a678: c2 07 bf f8 ld [ %fp + -8 ], %g1 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 201a67c: 90 12 20 d8 or %o0, 0xd8, %o0 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 201a680: c2 22 60 0c st %g1, [ %o1 + 0xc ] 201a684: c2 07 bf fc ld [ %fp + -4 ], %g1 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 201a688: 90 02 00 1b add %o0, %i3, %o0 201a68c: 7f ff b3 43 call 2007398 <_Chain_Append> 201a690: c2 22 60 10 st %g1, [ %o1 + 0x10 ] 201a694: 30 bf ff 9d b,a 201a508 /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) rtems_set_errno_and_return_minus_one( ESRCH ); 201a698: 7f ff d4 a5 call 200f92c <__errno> 201a69c: b0 10 3f ff mov -1, %i0 201a6a0: 82 10 20 03 mov 3, %g1 201a6a4: c2 22 00 00 st %g1, [ %o0 ] 201a6a8: 81 c7 e0 08 ret 201a6ac: 81 e8 00 00 restore */ if ( !sig ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) rtems_set_errno_and_return_minus_one( EINVAL ); 201a6b0: 7f ff d4 9f call 200f92c <__errno> 201a6b4: b0 10 3f ff mov -1, %i0 201a6b8: 82 10 20 16 mov 0x16, %g1 201a6bc: c2 22 00 00 st %g1, [ %o0 ] 201a6c0: 81 c7 e0 08 ret 201a6c4: 81 e8 00 00 restore if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { _Thread_Enable_dispatch(); 201a6c8: 7f ff ba f1 call 200928c <_Thread_Enable_dispatch> 201a6cc: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one( EAGAIN ); 201a6d0: 7f ff d4 97 call 200f92c <__errno> 201a6d4: 01 00 00 00 nop 201a6d8: 82 10 20 0b mov 0xb, %g1 ! b 201a6dc: c2 22 00 00 st %g1, [ %o0 ] 201a6e0: 81 c7 e0 08 ret 201a6e4: 81 e8 00 00 restore =============================================================================== 020037ec : extern void _wrapup_reent(struct _reent *); extern void _reclaim_reent(struct _reent *); void libc_wrapup(void) { 20037ec: 9d e3 bf a0 save %sp, -96, %sp /* * In case RTEMS is already down, don't do this. It could be * dangerous. */ if (!_System_state_Is_up(_System_state_Get())) 20037f0: 03 00 80 76 sethi %hi(0x201d800), %g1 20037f4: c2 00 62 ac ld [ %g1 + 0x2ac ], %g1 ! 201daac <_System_state_Current> 20037f8: 80 a0 60 03 cmp %g1, 3 20037fc: 02 80 00 04 be 200380c <== ALWAYS TAKEN 2003800: 3b 00 80 73 sethi %hi(0x201cc00), %i5 2003804: 81 c7 e0 08 ret <== NOT EXECUTED 2003808: 81 e8 00 00 restore <== NOT EXECUTED /* * This was already done if the user called exit() directly . _wrapup_reent(0); */ if (_REENT != _global_impure_ptr) { 200380c: 05 00 80 70 sethi %hi(0x201c000), %g2 2003810: c2 07 63 b8 ld [ %i5 + 0x3b8 ], %g1 2003814: f8 00 a1 78 ld [ %g2 + 0x178 ], %i4 2003818: 80 a0 40 1c cmp %g1, %i4 200381c: 02 80 00 05 be 2003830 2003820: 01 00 00 00 nop _wrapup_reent(_global_impure_ptr); 2003824: 40 00 33 77 call 2010600 <_wrapup_reent> 2003828: 90 10 00 1c mov %i4, %o0 /* 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; 200382c: f8 27 63 b8 st %i4, [ %i5 + 0x3b8 ] * * Should this be changed to do *all* file streams? * _fwalk (_REENT, fclose); */ fclose (stdin); 2003830: 40 00 30 91 call 200fa74 2003834: d0 07 20 04 ld [ %i4 + 4 ], %o0 fclose (stdout); 2003838: c2 07 63 b8 ld [ %i5 + 0x3b8 ], %g1 200383c: 40 00 30 8e call 200fa74 2003840: d0 00 60 08 ld [ %g1 + 8 ], %o0 fclose (stderr); 2003844: c2 07 63 b8 ld [ %i5 + 0x3b8 ], %g1 2003848: f0 00 60 0c ld [ %g1 + 0xc ], %i0 200384c: 40 00 30 8a call 200fa74 2003850: 81 e8 00 00 restore =============================================================================== 02019f78 : off_t lseek( int fd, off_t offset, int whence ) { 2019f78: 9d e3 bf a0 save %sp, -96, %sp rtems_libio_t *iop; off_t old_offset; off_t status; rtems_libio_check_fd( fd ); 2019f7c: 03 00 80 73 sethi %hi(0x201cc00), %g1 2019f80: c2 00 61 0c ld [ %g1 + 0x10c ], %g1 ! 201cd0c off_t lseek( int fd, off_t offset, int whence ) { 2019f84: 98 10 00 19 mov %i1, %o4 rtems_libio_t *iop; off_t old_offset; off_t status; rtems_libio_check_fd( fd ); 2019f88: 80 a6 00 01 cmp %i0, %g1 2019f8c: 1a 80 00 32 bcc 201a054 2019f90: 9a 10 00 1a mov %i2, %o5 iop = rtems_libio_iop( fd ); 2019f94: 03 00 80 75 sethi %hi(0x201d400), %g1 2019f98: fa 00 63 84 ld [ %g1 + 0x384 ], %i5 ! 201d784 2019f9c: b1 2e 20 06 sll %i0, 6, %i0 2019fa0: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open(iop); 2019fa4: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 2019fa8: 80 88 61 00 btst 0x100, %g1 2019fac: 02 80 00 2a be 201a054 2019fb0: 80 a6 e0 01 cmp %i3, 1 /* * Now process the lseek(). */ old_offset = iop->offset; switch ( whence ) { 2019fb4: 02 80 00 24 be 201a044 2019fb8: e0 1f 60 10 ldd [ %i5 + 0x10 ], %l0 2019fbc: 80 a6 e0 02 cmp %i3, 2 2019fc0: 02 80 00 15 be 201a014 2019fc4: 80 a6 e0 00 cmp %i3, 0 2019fc8: 12 80 00 18 bne 201a028 2019fcc: 01 00 00 00 nop case SEEK_SET: iop->offset = offset; 2019fd0: d8 3f 60 10 std %o4, [ %i5 + 0x10 ] /* * At this time, handlers assume iop->offset has the desired * new offset. */ status = (*iop->pathinfo.handlers->lseek_h)( iop, offset, whence ); 2019fd4: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 2019fd8: 90 10 00 1d mov %i5, %o0 2019fdc: c2 00 60 14 ld [ %g1 + 0x14 ], %g1 2019fe0: 92 10 00 0c mov %o4, %o1 2019fe4: 94 10 00 0d mov %o5, %o2 2019fe8: 9f c0 40 00 call %g1 2019fec: 96 10 00 1b mov %i3, %o3 2019ff0: b0 10 00 08 mov %o0, %i0 if ( status == (off_t) -1 ) 2019ff4: 80 a6 3f ff cmp %i0, -1 2019ff8: 12 80 00 05 bne 201a00c 2019ffc: b2 10 00 09 mov %o1, %i1 201a000: 80 a2 7f ff cmp %o1, -1 201a004: 22 80 00 02 be,a 201a00c <== ALWAYS TAKEN 201a008: e0 3f 60 10 std %l0, [ %i5 + 0x10 ] /* * So if the operation failed, we have to restore iop->offset. */ return status; } 201a00c: 81 c7 e0 08 ret 201a010: 81 e8 00 00 restore case SEEK_CUR: iop->offset += offset; break; case SEEK_END: iop->offset = iop->size + offset; 201a014: c4 1f 60 08 ldd [ %i5 + 8 ], %g2 201a018: 86 80 c0 1a addcc %g3, %i2, %g3 201a01c: 84 40 80 19 addx %g2, %i1, %g2 break; 201a020: 10 bf ff ed b 2019fd4 201a024: c4 3f 60 10 std %g2, [ %i5 + 0x10 ] default: rtems_set_errno_and_return_minus_one( EINVAL ); 201a028: 7f ff d6 41 call 200f92c <__errno> 201a02c: 31 3f ff ff sethi %hi(0xfffffc00), %i0 201a030: 82 10 20 16 mov 0x16, %g1 201a034: b0 16 23 ff or %i0, 0x3ff, %i0 201a038: c2 22 00 00 st %g1, [ %o0 ] 201a03c: 81 c7 e0 08 ret 201a040: 93 e8 00 18 restore %g0, %i0, %o1 case SEEK_SET: iop->offset = offset; break; case SEEK_CUR: iop->offset += offset; 201a044: 86 84 40 1a addcc %l1, %i2, %g3 201a048: 84 44 00 19 addx %l0, %i1, %g2 break; 201a04c: 10 bf ff e2 b 2019fd4 201a050: c4 3f 60 10 std %g2, [ %i5 + 0x10 ] off_t old_offset; off_t status; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); 201a054: 7f ff d6 36 call 200f92c <__errno> 201a058: 31 3f ff ff sethi %hi(0xfffffc00), %i0 201a05c: 82 10 20 09 mov 9, %g1 201a060: b0 16 23 ff or %i0, 0x3ff, %i0 201a064: c2 22 00 00 st %g1, [ %o0 ] 201a068: 81 c7 e0 08 ret 201a06c: 93 e8 00 18 restore %g0, %i0, %o1 =============================================================================== 02003240 : #include "malloc_p.h" void *malloc( size_t size ) { 2003240: 9d e3 bf a0 save %sp, -96, %sp void *return_this; MSBUMP(malloc_calls, 1); 2003244: 03 00 80 75 sethi %hi(0x201d400), %g1 2003248: 82 10 63 a0 or %g1, 0x3a0, %g1 ! 201d7a0 200324c: c4 00 60 04 ld [ %g1 + 4 ], %g2 #include "malloc_p.h" void *malloc( size_t size ) { 2003250: ba 10 00 18 mov %i0, %i5 void *return_this; MSBUMP(malloc_calls, 1); 2003254: 84 00 a0 01 inc %g2 /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); 2003258: 7f ff ff ab call 2003104 200325c: c4 20 60 04 st %g2, [ %g1 + 4 ] /* * Validate the parameters */ if ( !size ) 2003260: 80 a7 60 00 cmp %i5, 0 2003264: 02 80 00 1e be 20032dc 2003268: b0 10 20 00 clr %i0 return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 200326c: 03 00 80 76 sethi %hi(0x201d800), %g1 2003270: c2 00 62 ac ld [ %g1 + 0x2ac ], %g1 ! 201daac <_System_state_Current> 2003274: 80 a0 60 03 cmp %g1, 3 2003278: 02 80 00 1b be 20032e4 200327c: 03 00 80 73 sethi %hi(0x201cc00), %g1 RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 2003280: d0 00 60 d0 ld [ %g1 + 0xd0 ], %o0 ! 201ccd0 2003284: 92 10 00 1d mov %i5, %o1 2003288: 94 10 20 00 clr %o2 200328c: 40 00 15 0d call 20086c0 <_Protected_heap_Allocate_aligned_with_boundary> 2003290: 96 10 20 00 clr %o3 * If this fails then return a NULL pointer. */ return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); if ( !return_this ) { 2003294: b0 92 20 00 orcc %o0, 0, %i0 2003298: 02 80 00 21 be 200331c <== NEVER TAKEN 200329c: 03 00 80 75 sethi %hi(0x201d400), %g1 } /* * If the user wants us to dirty the allocated memory, then do it. */ if ( rtems_malloc_dirty_helper ) 20032a0: 03 00 80 75 sethi %hi(0x201d400), %g1 20032a4: c2 00 60 dc ld [ %g1 + 0xdc ], %g1 ! 201d4dc 20032a8: 80 a0 60 00 cmp %g1, 0 20032ac: 02 80 00 04 be 20032bc 20032b0: 90 10 00 18 mov %i0, %o0 (*rtems_malloc_dirty_helper)( return_this, size ); 20032b4: 9f c0 40 00 call %g1 20032b8: 92 10 00 1d mov %i5, %o1 /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 20032bc: 03 00 80 75 sethi %hi(0x201d400), %g1 20032c0: c2 00 60 e4 ld [ %g1 + 0xe4 ], %g1 ! 201d4e4 20032c4: 80 a0 60 00 cmp %g1, 0 20032c8: 02 80 00 25 be 200335c 20032cc: 01 00 00 00 nop (*rtems_malloc_statistics_helpers->at_malloc)(return_this); 20032d0: c2 00 60 04 ld [ %g1 + 4 ], %g1 20032d4: 9f c0 40 00 call %g1 20032d8: 90 10 00 18 mov %i0, %o0 return return_this; } 20032dc: 81 c7 e0 08 ret 20032e0: 81 e8 00 00 restore /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && !malloc_is_system_state_OK() ) 20032e4: 7f ff ff 76 call 20030bc 20032e8: 01 00 00 00 nop return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 20032ec: 80 8a 20 ff btst 0xff, %o0 20032f0: 02 bf ff fb be 20032dc <== NEVER TAKEN 20032f4: 03 00 80 73 sethi %hi(0x201cc00), %g1 20032f8: d0 00 60 d0 ld [ %g1 + 0xd0 ], %o0 ! 201ccd0 20032fc: 92 10 00 1d mov %i5, %o1 2003300: 94 10 20 00 clr %o2 2003304: 40 00 14 ef call 20086c0 <_Protected_heap_Allocate_aligned_with_boundary> 2003308: 96 10 20 00 clr %o3 * If this fails then return a NULL pointer. */ return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); if ( !return_this ) { 200330c: b0 92 20 00 orcc %o0, 0, %i0 2003310: 12 bf ff e5 bne 20032a4 2003314: 03 00 80 75 sethi %hi(0x201d400), %g1 if (rtems_malloc_sbrk_helpers) 2003318: 03 00 80 75 sethi %hi(0x201d400), %g1 200331c: c2 00 60 e0 ld [ %g1 + 0xe0 ], %g1 ! 201d4e0 2003320: 80 a0 60 00 cmp %g1, 0 2003324: 02 80 00 0a be 200334c 2003328: 01 00 00 00 nop return_this = (*rtems_malloc_sbrk_helpers->extend)( size ); 200332c: c2 00 60 04 ld [ %g1 + 4 ], %g1 2003330: 9f c0 40 00 call %g1 2003334: 90 10 00 1d mov %i5, %o0 if ( !return_this ) { 2003338: 80 a2 20 00 cmp %o0, 0 200333c: 02 80 00 04 be 200334c 2003340: 01 00 00 00 nop 2003344: 10 bf ff d7 b 20032a0 2003348: b0 10 00 08 mov %o0, %i0 errno = ENOMEM; 200334c: 40 00 31 78 call 200f92c <__errno> 2003350: 01 00 00 00 nop 2003354: 82 10 20 0c mov 0xc, %g1 ! c 2003358: c2 22 00 00 st %g1, [ %o0 ] return (void *) 0; 200335c: 81 c7 e0 08 ret 2003360: 81 e8 00 00 restore =============================================================================== 020032a4 : } void *malloc_sbrk_extend_and_allocate( size_t size ) { 20032a4: 9d e3 bf a0 save %sp, -96, %sp * 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; 20032a8: 03 00 80 5c sethi %hi(0x2017000), %g1 20032ac: fa 00 62 38 ld [ %g1 + 0x238 ], %i5 ! 2017238 if ( sbrk_amount == 0 ) 20032b0: 80 a7 60 00 cmp %i5, 0 20032b4: 02 80 00 20 be 2003334 <== NEVER TAKEN 20032b8: b2 10 00 18 mov %i0, %i1 return (void *) 0; the_size = ((size + sbrk_amount) / sbrk_amount * sbrk_amount); 20032bc: 92 10 00 1d mov %i5, %o1 20032c0: 40 00 3f c1 call 20131c4 <.udiv> 20032c4: 90 06 00 1d add %i0, %i5, %o0 20032c8: 40 00 3f 85 call 20130dc <.umul> 20032cc: 92 10 00 1d mov %i5, %o1 starting_address = (void *) sbrk(the_size); 20032d0: 7f ff f8 c7 call 20015ec 20032d4: ba 10 00 08 mov %o0, %i5 if ( starting_address == (void*) -1 ) 20032d8: 80 a2 3f ff cmp %o0, -1 20032dc: 02 80 00 16 be 2003334 20032e0: 92 10 00 08 mov %o0, %o1 return (void *) 0; if ( !_Protected_heap_Extend( 20032e4: 39 00 80 59 sethi %hi(0x2016400), %i4 20032e8: d0 07 22 20 ld [ %i4 + 0x220 ], %o0 ! 2016620 20032ec: 40 00 14 9c call 200855c <_Protected_heap_Extend> 20032f0: 94 10 00 1d mov %i5, %o2 20032f4: 80 8a 20 ff btst 0xff, %o0 20032f8: 02 80 00 09 be 200331c 20032fc: 03 00 80 5c sethi %hi(0x2017000), %g1 2003300: f0 07 22 20 ld [ %i4 + 0x220 ], %i0 sbrk(-the_size); errno = ENOMEM; return (void *) 0; } MSBUMP(space_available, the_size); 2003304: c4 00 62 08 ld [ %g1 + 0x208 ], %g2 2003308: b4 10 20 00 clr %i2 200330c: ba 07 40 02 add %i5, %g2, %i5 2003310: fa 20 62 08 st %i5, [ %g1 + 0x208 ] 2003314: 40 00 14 84 call 2008524 <_Protected_heap_Allocate_aligned_with_boundary> 2003318: 97 e8 20 00 restore %g0, 0, %o3 if ( starting_address == (void*) -1 ) return (void *) 0; if ( !_Protected_heap_Extend( RTEMS_Malloc_Heap, starting_address, the_size) ) { sbrk(-the_size); 200331c: 7f ff f8 b4 call 20015ec 2003320: 90 20 00 1d neg %i5, %o0 errno = ENOMEM; 2003324: 40 00 31 e1 call 200faa8 <__errno> 2003328: 01 00 00 00 nop 200332c: 82 10 20 0c mov 0xc, %g1 ! c 2003330: c2 22 00 00 st %g1, [ %o0 ] MSBUMP(space_available, the_size); return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); return return_this; } 2003334: 81 c7 e0 08 ret 2003338: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 0200e138 : */ void memfile_free_blocks_in_table( block_p **block_table, int entries ) { 200e138: 9d e3 bf a0 save %sp, -96, %sp /* * Now go through all the slots in the table and free the memory. */ b = *block_table; for ( i=0 ; i<== NEVER TAKEN 200e144: d0 06 00 00 ld [ %i0 ], %o0 200e148: ba 10 00 08 mov %o0, %i5 200e14c: b8 10 20 00 clr %i4 if ( b[i] ) { 200e150: d0 07 40 00 ld [ %i5 ], %o0 200e154: 80 a2 20 00 cmp %o0, 0 200e158: 02 80 00 05 be 200e16c 200e15c: b8 07 20 01 inc %i4 memfile_free_block( b[i] ); 200e160: 7f ff ff ed call 200e114 200e164: 01 00 00 00 nop b[i] = 0; 200e168: c0 27 40 00 clr [ %i5 ] /* * Now go through all the slots in the table and free the memory. */ b = *block_table; for ( i=0 ; i 200e174: ba 07 60 04 add %i5, 4, %i5 200e178: d0 06 00 00 ld [ %i0 ], %o0 /* * Now that all the blocks in the block table are free, we can * free the block table itself. */ memfile_free_block( *block_table ); 200e17c: 7f ff ff e6 call 200e114 200e180: 01 00 00 00 nop *block_table = 0; 200e184: c0 26 00 00 clr [ %i0 ] } 200e188: 81 c7 e0 08 ret 200e18c: 81 e8 00 00 restore =============================================================================== 0200e73c : */ int memfile_ftruncate( rtems_libio_t *iop, rtems_off64_t length ) { 200e73c: 9d e3 bf 98 save %sp, -104, %sp IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 200e740: fa 06 20 1c ld [ %i0 + 0x1c ], %i5 * 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 ) 200e744: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 200e748: 80 a0 40 19 cmp %g1, %i1 200e74c: 06 80 00 13 bl 200e798 <== NEVER TAKEN 200e750: 90 10 00 1d mov %i5, %o0 200e754: 22 80 00 0d be,a 200e788 <== ALWAYS TAKEN 200e758: c2 07 60 54 ld [ %i5 + 0x54 ], %g1 /* * 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; 200e75c: f2 27 60 50 st %i1, [ %i5 + 0x50 ] <== NOT EXECUTED 200e760: f4 27 60 54 st %i2, [ %i5 + 0x54 ] iop->size = the_jnode->info.file.size; 200e764: f2 26 20 08 st %i1, [ %i0 + 8 ] 200e768: f4 26 20 0c st %i2, [ %i0 + 0xc ] IMFS_update_atime( the_jnode ); 200e76c: 90 07 bf f8 add %fp, -8, %o0 200e770: 7f ff d1 fb call 2002f5c 200e774: 92 10 20 00 clr %o1 200e778: c2 07 bf f8 ld [ %fp + -8 ], %g1 200e77c: c2 27 60 40 st %g1, [ %i5 + 0x40 ] return 0; } 200e780: 81 c7 e0 08 ret 200e784: 91 e8 20 00 restore %g0, 0, %o0 * 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 ) 200e788: 80 a0 40 1a cmp %g1, %i2 200e78c: 3a bf ff f5 bcc,a 200e760 200e790: f2 27 60 50 st %i1, [ %i5 + 0x50 ] return IMFS_memfile_extend( the_jnode, length ); 200e794: 90 10 00 1d mov %i5, %o0 200e798: 92 10 00 19 mov %i1, %o1 200e79c: 7f ff fe e7 call 200e338 200e7a0: 94 10 00 1a mov %i2, %o2 200e7a4: 81 c7 e0 08 ret 200e7a8: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 0200e7ac : rtems_off64_t memfile_lseek( rtems_libio_t *iop, rtems_off64_t offset, int whence ) { 200e7ac: 9d e3 bf a0 save %sp, -96, %sp IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 200e7b0: fa 06 20 1c ld [ %i0 + 0x1c ], %i5 if (the_jnode->type == IMFS_LINEAR_FILE) { 200e7b4: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 200e7b8: 80 a0 60 06 cmp %g1, 6 200e7bc: 02 80 00 0f be 200e7f8 200e7c0: c4 1e 20 10 ldd [ %i0 + 0x10 ], %g2 if (iop->offset > the_jnode->info.linearfile.size) iop->offset = the_jnode->info.linearfile.size; } else { /* Must be a block file (IMFS_MEMORY_FILE). */ if (IMFS_memfile_extend( the_jnode, iop->offset )) 200e7c4: 90 10 00 1d mov %i5, %o0 200e7c8: 92 10 00 02 mov %g2, %o1 200e7cc: 7f ff fe db call 200e338 200e7d0: 94 10 00 03 mov %g3, %o2 200e7d4: 80 a2 20 00 cmp %o0, 0 200e7d8: 12 80 00 19 bne 200e83c 200e7dc: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSPC ); iop->size = the_jnode->info.file.size; 200e7e0: d8 1f 60 50 ldd [ %i5 + 0x50 ], %o4 200e7e4: c4 1e 20 10 ldd [ %i0 + 0x10 ], %g2 200e7e8: d8 3e 20 08 std %o4, [ %i0 + 8 ] } return iop->offset; } 200e7ec: b0 10 00 02 mov %g2, %i0 200e7f0: 81 c7 e0 08 ret 200e7f4: 93 e8 00 03 restore %g0, %g3, %o1 IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; if (the_jnode->type == IMFS_LINEAR_FILE) { if (iop->offset > the_jnode->info.linearfile.size) 200e7f8: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 200e7fc: 80 a0 80 01 cmp %g2, %g1 200e800: 14 80 00 08 bg 200e820 <== NEVER TAKEN 200e804: c8 07 60 54 ld [ %i5 + 0x54 ], %g4 200e808: 80 a0 80 01 cmp %g2, %g1 200e80c: 32 bf ff f9 bne,a 200e7f0 <== NEVER TAKEN 200e810: b0 10 00 02 mov %g2, %i0 <== NOT EXECUTED 200e814: 80 a0 c0 04 cmp %g3, %g4 200e818: 28 bf ff f6 bleu,a 200e7f0 <== ALWAYS TAKEN 200e81c: b0 10 00 02 mov %g2, %i0 iop->offset = the_jnode->info.linearfile.size; 200e820: c2 26 20 10 st %g1, [ %i0 + 0x10 ] <== NOT EXECUTED 200e824: 84 10 00 01 mov %g1, %g2 <== NOT EXECUTED 200e828: c8 26 20 14 st %g4, [ %i0 + 0x14 ] <== NOT EXECUTED 200e82c: 86 10 00 04 mov %g4, %g3 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOSPC ); iop->size = the_jnode->info.file.size; } return iop->offset; } 200e830: b0 10 00 02 mov %g2, %i0 <== NOT EXECUTED 200e834: 81 c7 e0 08 ret <== NOT EXECUTED 200e838: 93 e8 00 03 restore %g0, %g3, %o1 <== NOT EXECUTED if (iop->offset > the_jnode->info.linearfile.size) iop->offset = the_jnode->info.linearfile.size; } else { /* Must be a block file (IMFS_MEMORY_FILE). */ if (IMFS_memfile_extend( the_jnode, iop->offset )) rtems_set_errno_and_return_minus_one( ENOSPC ); 200e83c: 40 00 04 3c call 200f92c <__errno> 200e840: 01 00 00 00 nop 200e844: 05 3f ff ff sethi %hi(0xfffffc00), %g2 200e848: 82 10 20 1c mov 0x1c, %g1 200e84c: 84 10 a3 ff or %g2, 0x3ff, %g2 200e850: c2 22 00 00 st %g1, [ %o0 ] 200e854: 10 bf ff e6 b 200e7ec 200e858: 86 10 00 02 mov %g2, %g3 =============================================================================== 0200e68c : rtems_libio_t *iop, const char *pathname, uint32_t flag, uint32_t mode ) { 200e68c: 9d e3 bf a0 save %sp, -96, %sp the_jnode = iop->pathinfo.node_access; /* * Perform 'copy on write' for linear files */ if ((iop->flags & (LIBIO_FLAGS_WRITE | LIBIO_FLAGS_APPEND)) 200e690: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 rtems_libio_t *iop, const char *pathname, uint32_t flag, uint32_t mode ) { 200e694: ba 10 00 18 mov %i0, %i5 the_jnode = iop->pathinfo.node_access; /* * Perform 'copy on write' for linear files */ if ((iop->flags & (LIBIO_FLAGS_WRITE | LIBIO_FLAGS_APPEND)) 200e698: 80 88 62 04 btst 0x204, %g1 200e69c: 02 80 00 06 be 200e6b4 200e6a0: f8 06 20 1c ld [ %i0 + 0x1c ], %i4 && (the_jnode->type == IMFS_LINEAR_FILE)) { 200e6a4: c4 07 20 4c ld [ %i4 + 0x4c ], %g2 200e6a8: 80 a0 a0 06 cmp %g2, 6 200e6ac: 22 80 00 0c be,a 200e6dc <== NEVER TAKEN 200e6b0: d8 07 20 54 ld [ %i4 + 0x54 ], %o4 <== 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)) 200e6b4: c4 1f 20 50 ldd [ %i4 + 0x50 ], %g2 return -1; } if (iop->flags & LIBIO_FLAGS_APPEND) 200e6b8: 80 88 62 00 btst 0x200, %g1 200e6bc: 22 80 00 05 be,a 200e6d0 200e6c0: c4 3f 60 08 std %g2, [ %i5 + 8 ] iop->offset = the_jnode->info.file.size; 200e6c4: c4 3f 60 10 std %g2, [ %i5 + 0x10 ] 200e6c8: c4 1f 20 50 ldd [ %i4 + 0x50 ], %g2 iop->size = the_jnode->info.file.size; 200e6cc: c4 3f 60 08 std %g2, [ %i5 + 8 ] return 0; 200e6d0: b0 10 20 00 clr %i0 } 200e6d4: 81 c7 e0 08 ret 200e6d8: 81 e8 00 00 restore * 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; 200e6dc: d6 07 20 58 ld [ %i4 + 0x58 ], %o3 <== NOT EXECUTED the_jnode->type = IMFS_MEMORY_FILE; 200e6e0: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED the_jnode->info.file.size = 0; 200e6e4: c0 27 20 50 clr [ %i4 + 0x50 ] <== NOT EXECUTED 200e6e8: c0 27 20 54 clr [ %i4 + 0x54 ] <== NOT EXECUTED if ((iop->flags & (LIBIO_FLAGS_WRITE | LIBIO_FLAGS_APPEND)) && (the_jnode->type == IMFS_LINEAR_FILE)) { uint32_t count = the_jnode->info.linearfile.size; const unsigned char *buffer = the_jnode->info.linearfile.direct; the_jnode->type = IMFS_MEMORY_FILE; 200e6ec: c2 27 20 4c st %g1, [ %i4 + 0x4c ] <== NOT EXECUTED the_jnode->info.file.size = 0; the_jnode->info.file.indirect = 0; 200e6f0: c0 27 20 58 clr [ %i4 + 0x58 ] <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; 200e6f4: c0 27 20 5c clr [ %i4 + 0x5c ] <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; if ((count != 0) 200e6f8: 80 a3 20 00 cmp %o4, 0 <== NOT EXECUTED 200e6fc: 12 80 00 06 bne 200e714 <== NOT EXECUTED 200e700: c0 27 20 60 clr [ %i4 + 0x60 ] <== NOT EXECUTED 200e704: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 <== NOT EXECUTED 200e708: 84 10 20 00 clr %g2 <== NOT EXECUTED 200e70c: 10 bf ff eb b 200e6b8 <== NOT EXECUTED 200e710: 86 10 20 00 clr %g3 <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) 200e714: 90 10 00 1c mov %i4, %o0 <== NOT EXECUTED 200e718: 92 10 20 00 clr %o1 <== NOT EXECUTED 200e71c: 94 10 20 00 clr %o2 <== NOT EXECUTED 200e720: 7f ff ff 57 call 200e47c <== NOT EXECUTED 200e724: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 200e728: 80 a2 3f ff cmp %o0, -1 <== NOT EXECUTED 200e72c: 02 bf ff ea be 200e6d4 <== NOT EXECUTED 200e730: 01 00 00 00 nop <== NOT EXECUTED 200e734: 10 bf ff e0 b 200e6b4 <== NOT EXECUTED 200e738: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 <== NOT EXECUTED =============================================================================== 02003380 : int mknod( const char *pathname, mode_t mode, dev_t dev ) { 2003380: 9d e3 bf 80 save %sp, -128, %sp int result; /* * The file type is field within the mode. Check we have a sane mode set. */ switch (mode & S_IFMT) 2003384: 05 00 00 10 sethi %hi(0x4000), %g2 2003388: 03 00 00 3c sethi %hi(0xf000), %g1 200338c: 82 0e 40 01 and %i1, %g1, %g1 2003390: 80 a0 40 02 cmp %g1, %g2 2003394: 02 80 00 18 be 20033f4 2003398: 90 10 00 18 mov %i0, %o0 200339c: 08 80 00 0f bleu 20033d8 20033a0: 05 00 00 04 sethi %hi(0x1000), %g2 20033a4: 05 00 00 18 sethi %hi(0x6000), %g2 20033a8: 80 a0 40 02 cmp %g1, %g2 20033ac: 02 80 00 12 be 20033f4 20033b0: 05 00 00 20 sethi %hi(0x8000), %g2 20033b4: 80 a0 40 02 cmp %g1, %g2 20033b8: 02 80 00 10 be 20033f8 <== ALWAYS TAKEN 20033bc: 92 07 bf f8 add %fp, -8, %o1 case S_IFBLK: case S_IFREG: case S_IFIFO: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 20033c0: 40 00 31 5b call 200f92c <__errno> 20033c4: b0 10 3f ff mov -1, %i0 20033c8: 82 10 20 16 mov 0x16, %g1 20033cc: c2 22 00 00 st %g1, [ %o0 ] 20033d0: 81 c7 e0 08 ret 20033d4: 81 e8 00 00 restore int result; /* * The file type is field within the mode. Check we have a sane mode set. */ switch (mode & S_IFMT) 20033d8: 80 a0 40 02 cmp %g1, %g2 20033dc: 02 80 00 05 be 20033f0 20033e0: 05 00 00 08 sethi %hi(0x2000), %g2 20033e4: 80 a0 40 02 cmp %g1, %g2 20033e8: 12 bf ff f6 bne 20033c0 20033ec: 01 00 00 00 nop break; default: rtems_set_errno_and_return_minus_one( EINVAL ); } rtems_filesystem_get_start_loc( pathname, &i, &temp_loc ); 20033f0: 90 10 00 18 mov %i0, %o0 20033f4: 92 07 bf f8 add %fp, -8, %o1 20033f8: 40 00 02 8b call 2003e24 20033fc: 94 07 bf e4 add %fp, -28, %o2 result = (*temp_loc.ops->evalformake_h)( 2003400: c2 07 bf f0 ld [ %fp + -16 ], %g1 2003404: d0 07 bf f8 ld [ %fp + -8 ], %o0 2003408: c2 00 60 04 ld [ %g1 + 4 ], %g1 200340c: 90 06 00 08 add %i0, %o0, %o0 2003410: 92 07 bf e4 add %fp, -28, %o1 2003414: 94 07 bf fc add %fp, -4, %o2 2003418: 9f c0 40 00 call %g1 200341c: b0 10 3f ff mov -1, %i0 &pathname[i], &temp_loc, &name_start ); if ( result != 0 ) 2003420: 80 a2 20 00 cmp %o0, 0 2003424: 12 bf ff eb bne 20033d0 2003428: c2 07 bf f0 ld [ %fp + -16 ], %g1 return -1; result = (*temp_loc.ops->mknod_h)( name_start, mode, dev, &temp_loc ); 200342c: d0 07 bf fc ld [ %fp + -4 ], %o0 2003430: c2 00 60 14 ld [ %g1 + 0x14 ], %g1 2003434: 92 10 00 19 mov %i1, %o1 2003438: 94 10 00 1a mov %i2, %o2 200343c: 96 10 00 1b mov %i3, %o3 2003440: 9f c0 40 00 call %g1 2003444: 98 07 bf e4 add %fp, -28, %o4 2003448: b0 10 00 08 mov %o0, %i0 rtems_filesystem_freenode( &temp_loc ); 200344c: 7f ff fe 93 call 2002e98 2003450: 90 07 bf e4 add %fp, -28, %o0 return result; } 2003454: 81 c7 e0 08 ret 2003458: 81 e8 00 00 restore =============================================================================== 020034e4 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 20034e4: 9d e3 bf 88 save %sp, -120, %sp /* * Are the file system options valid? */ if ( options != RTEMS_FILESYSTEM_READ_ONLY && 20034e8: 80 a6 e0 01 cmp %i3, 1 20034ec: 18 80 00 85 bgu 2003700 20034f0: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); /* * Get mount handler */ mount_h = rtems_filesystem_get_mount_handler( filesystemtype ); 20034f4: 40 00 23 54 call 200c244 20034f8: 90 10 00 1a mov %i2, %o0 if ( !mount_h ) 20034fc: a2 92 20 00 orcc %o0, 0, %l1 2003500: 02 80 00 80 be 2003700 2003504: 80 a0 00 19 cmp %g0, %i1 const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; 2003508: a0 40 20 00 addx %g0, 0, %l0 200350c: 80 a4 20 00 cmp %l0, 0 2003510: 02 80 00 77 be 20036ec 2003514: 90 10 00 19 mov %i1, %o0 * 4) The mount point exists with the proper permissions to allow mounting * 5) The selected mount point already has a file system mounted to it * */ int mount( 2003518: 40 00 36 94 call 2010f68 200351c: ae 10 00 19 mov %i1, %l7 2003520: ac 10 00 08 mov %o0, %l6 2003524: a8 02 20 01 add %o0, 1, %l4 const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; size_t filesystemtype_size = strlen( filesystemtype ) + 1; 2003528: 40 00 36 90 call 2010f68 200352c: 90 10 00 1a mov %i2, %o0 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 2003530: a4 10 20 00 clr %l2 2003534: 80 a6 20 00 cmp %i0, 0 2003538: 02 80 00 05 be 200354c 200353c: aa 10 00 08 mov %o0, %l5 2003540: 40 00 36 8a call 2010f68 2003544: 90 10 00 18 mov %i0, %o0 2003548: a4 02 20 01 add %o0, 1, %l2 size_t target_size = strlen( target ) + 1; size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size; 200354c: 92 05 40 14 add %l5, %l4, %o1 rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); 2003550: 90 10 20 01 mov 1, %o0 size_t filesystemtype_size = strlen( filesystemtype ) + 1; size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; size_t target_size = strlen( target ) + 1; size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size; 2003554: 92 02 60 75 add %o1, 0x75, %o1 rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); 2003558: 7f ff fd 4a call 2002a80 200355c: 92 02 40 12 add %o1, %l2, %o1 if ( mt_entry != NULL ) { 2003560: ba 92 20 00 orcc %o0, 0, %i5 2003564: 02 80 00 5c be 20036d4 <== NEVER TAKEN 2003568: a6 07 60 74 add %i5, 0x74, %l3 char *str = (char *) mt_entry + sizeof( *mt_entry ); memcpy( str, filesystemtype, filesystemtype_size ); 200356c: 92 10 00 1a mov %i2, %o1 const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; size_t filesystemtype_size = strlen( filesystemtype ) + 1; 2003570: aa 05 60 01 inc %l5 rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); if ( mt_entry != NULL ) { char *str = (char *) mt_entry + sizeof( *mt_entry ); memcpy( str, filesystemtype, filesystemtype_size ); 2003574: 90 10 00 13 mov %l3, %o0 2003578: 40 00 33 42 call 2010280 200357c: 94 10 00 15 mov %l5, %o2 mt_entry->type = str; str += filesystemtype_size; 2003580: b4 04 c0 15 add %l3, %l5, %i2 memcpy( str, source_or_null, source_size ); 2003584: 94 10 00 12 mov %l2, %o2 2003588: 92 10 00 18 mov %i0, %o1 if ( mt_entry != NULL ) { char *str = (char *) mt_entry + sizeof( *mt_entry ); memcpy( str, filesystemtype, filesystemtype_size ); mt_entry->type = str; 200358c: e6 27 60 6c st %l3, [ %i5 + 0x6c ] str += filesystemtype_size; memcpy( str, source_or_null, source_size ); 2003590: 40 00 33 3c call 2010280 2003594: 90 10 00 1a mov %i2, %o0 mt_entry->dev = str; str += source_size; 2003598: a4 06 80 12 add %i2, %l2, %l2 memcpy( str, target, target_size ); 200359c: 92 10 00 17 mov %l7, %o1 20035a0: 94 10 00 14 mov %l4, %o2 memcpy( str, filesystemtype, filesystemtype_size ); mt_entry->type = str; str += filesystemtype_size; memcpy( str, source_or_null, source_size ); mt_entry->dev = str; 20035a4: f4 27 60 70 st %i2, [ %i5 + 0x70 ] str += source_size; memcpy( str, target, target_size ); 20035a8: 40 00 33 36 call 2010280 20035ac: 90 10 00 12 mov %l2, %o0 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; 20035b0: 90 07 60 38 add %i5, 0x38, %o0 memcpy( str, source_or_null, source_size ); mt_entry->dev = str; str += source_size; memcpy( str, target, target_size ); mt_entry->target = str; 20035b4: e4 27 60 68 st %l2, [ %i5 + 0x68 ] &target_length ); if ( !mt_entry ) rtems_set_errno_and_return_minus_one( ENOMEM ); mt_entry->mt_fs_root.mt_entry = mt_entry; 20035b8: fa 27 60 2c st %i5, [ %i5 + 0x2c ] mt_entry->options = options; 20035bc: f6 27 60 30 st %i3, [ %i5 + 0x30 ] mt_entry->pathconf_limits_and_options = rtems_filesystem_default_pathconf; 20035c0: 94 10 20 30 mov 0x30, %o2 20035c4: 13 00 80 6d sethi %hi(0x201b400), %o1 20035c8: 40 00 33 2e call 2010280 20035cc: 92 12 63 d8 or %o1, 0x3d8, %o1 ! 201b7d8 /* * The mount_point should be a directory with read/write/execute * permissions in the existing tree. */ if ( has_target ) { 20035d0: 80 a4 20 00 cmp %l0, 0 20035d4: 12 80 00 11 bne 2003618 20035d8: 03 00 80 73 sethi %hi(0x201cc00), %g1 } } else { /* * Do we already have a base file system ? */ if ( !rtems_chain_is_empty( &mount_chain ) ) { 20035dc: c4 00 61 d0 ld [ %g1 + 0x1d0 ], %g2 ! 201cdd0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 20035e0: 82 10 61 d0 or %g1, 0x1d0, %g1 20035e4: 82 00 60 04 add %g1, 4, %g1 20035e8: 80 a0 80 01 cmp %g2, %g1 20035ec: 02 80 00 26 be 2003684 <== ALWAYS TAKEN 20035f0: b6 10 20 00 clr %i3 errno = EINVAL; 20035f4: 40 00 30 ce call 200f92c <__errno> <== NOT EXECUTED 20035f8: 01 00 00 00 nop <== NOT EXECUTED 20035fc: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED 2003600: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED return 0; cleanup_and_bail: free( mt_entry ); 2003604: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 2003608: 7f ff fe 2b call 2002eb4 <== NOT EXECUTED 200360c: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 2003610: 81 c7 e0 08 ret 2003614: 81 e8 00 00 restore * The mount_point should be a directory with read/write/execute * permissions in the existing tree. */ if ( has_target ) { if ( rtems_filesystem_evaluate_path( 2003618: 90 10 00 19 mov %i1, %o0 200361c: 92 10 00 16 mov %l6, %o1 2003620: 94 10 20 07 mov 7, %o2 2003624: 96 07 bf ec add %fp, -20, %o3 2003628: 7f ff fd e2 call 2002db0 200362c: 98 10 20 01 mov 1, %o4 2003630: 80 a2 3f ff cmp %o0, -1 2003634: 02 bf ff f4 be 2003604 <== NEVER TAKEN 2003638: c2 07 bf f8 ld [ %fp + -8 ], %g1 /* * Test to see if it is a directory */ if ( loc.ops->node_type_h( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 200363c: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 2003640: 9f c0 40 00 call %g1 2003644: 90 07 bf ec add %fp, -20, %o0 2003648: 80 a2 20 01 cmp %o0, 1 200364c: 02 80 00 4e be 2003784 2003650: d2 07 bf ec ld [ %fp + -20 ], %o1 errno = ENOTDIR; 2003654: 40 00 30 b6 call 200f92c <__errno> 2003658: 01 00 00 00 nop 200365c: 82 10 20 14 mov 0x14, %g1 ! 14 2003660: c2 22 00 00 st %g1, [ %o0 ] return 0; cleanup_and_bail: free( mt_entry ); 2003664: 7f ff fe 14 call 2002eb4 2003668: 90 10 00 1d mov %i5, %o0 if ( has_target ) { if ( rtems_filesystem_evaluate_path( target, target_length, RTEMS_LIBIO_PERMS_RWX, &loc, true ) == -1 ) goto cleanup_and_bail; loc_to_free = &loc; 200366c: b6 07 bf ec add %fp, -20, %i3 free( mt_entry ); if ( loc_to_free ) rtems_filesystem_freenode( loc_to_free ); return -1; 2003670: b0 10 3f ff mov -1, %i0 cleanup_and_bail: free( mt_entry ); if ( loc_to_free ) rtems_filesystem_freenode( loc_to_free ); 2003674: 7f ff fe 09 call 2002e98 2003678: 90 10 00 1b mov %i3, %o0 return -1; } 200367c: 81 c7 e0 08 ret 2003680: 81 e8 00 00 restore * 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 ) ) { 2003684: 90 10 00 1d mov %i5, %o0 2003688: 9f c4 40 00 call %l1 200368c: 92 10 00 1c mov %i4, %o1 2003690: 80 a2 20 00 cmp %o0, 0 2003694: 22 80 00 21 be,a 2003718 2003698: 39 00 80 75 sethi %hi(0x201d400), %i4 /* * Try to undo the mount operation */ loc.ops->unmount_h( mt_entry ); 200369c: c2 07 bf f8 ld [ %fp + -8 ], %g1 20036a0: 90 10 00 1d mov %i5, %o0 20036a4: c2 00 60 28 ld [ %g1 + 0x28 ], %g1 20036a8: 9f c0 40 00 call %g1 20036ac: b0 10 3f ff mov -1, %i0 return 0; cleanup_and_bail: free( mt_entry ); 20036b0: 7f ff fe 01 call 2002eb4 20036b4: 90 10 00 1d mov %i5, %o0 if ( loc_to_free ) 20036b8: 80 a6 e0 00 cmp %i3, 0 20036bc: 02 bf ff d5 be 2003610 <== NEVER TAKEN 20036c0: 90 10 00 1b mov %i3, %o0 rtems_filesystem_freenode( loc_to_free ); 20036c4: 7f ff fd f5 call 2002e98 20036c8: b0 10 3f ff mov -1, %i0 return -1; } 20036cc: 81 c7 e0 08 ret 20036d0: 81 e8 00 00 restore target, filesystemtype, &target_length ); if ( !mt_entry ) rtems_set_errno_and_return_minus_one( ENOMEM ); 20036d4: 40 00 30 96 call 200f92c <__errno> <== NOT EXECUTED 20036d8: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 20036dc: 82 10 20 0c mov 0xc, %g1 <== NOT EXECUTED 20036e0: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 20036e4: 81 c7 e0 08 ret <== NOT EXECUTED 20036e8: 81 e8 00 00 restore <== NOT EXECUTED const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; 20036ec: 2f 00 80 6c sethi %hi(0x201b000), %l7 20036f0: a8 10 20 02 mov 2, %l4 20036f4: ac 10 20 01 mov 1, %l6 20036f8: 10 bf ff 8c b 2003528 20036fc: ae 15 e2 a8 or %l7, 0x2a8, %l7 /* * Get mount handler */ mount_h = rtems_filesystem_get_mount_handler( filesystemtype ); if ( !mount_h ) rtems_set_errno_and_return_minus_one( EINVAL ); 2003700: 40 00 30 8b call 200f92c <__errno> 2003704: b0 10 3f ff mov -1, %i0 2003708: 82 10 20 16 mov 0x16, %g1 200370c: c2 22 00 00 st %g1, [ %o0 ] 2003710: 81 c7 e0 08 ret 2003714: 81 e8 00 00 restore 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 ); 2003718: d0 07 23 8c ld [ %i4 + 0x38c ], %o0 200371c: 94 10 20 00 clr %o2 2003720: 40 00 0c 76 call 20068f8 2003724: 92 10 20 00 clr %o1 2003728: 92 10 00 1d mov %i5, %o1 200372c: 11 00 80 73 sethi %hi(0x201cc00), %o0 2003730: 40 00 0f 1a call 2007398 <_Chain_Append> 2003734: 90 12 21 d0 or %o0, 0x1d0, %o0 ! 201cdd0 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 2003738: d0 07 23 8c ld [ %i4 + 0x38c ], %o0 200373c: 40 00 0c b9 call 2006a20 2003740: b0 10 20 00 clr %i0 */ rtems_libio_lock(); rtems_chain_append( &mount_chain, &mt_entry->Node ); rtems_libio_unlock(); if ( !has_target ) 2003744: 80 a4 20 00 cmp %l0, 0 2003748: 12 bf ff b2 bne 2003610 200374c: 03 00 80 73 sethi %hi(0x201cc00), %g1 rtems_filesystem_root = mt_entry->mt_fs_root; 2003750: f6 07 60 1c ld [ %i5 + 0x1c ], %i3 2003754: f8 07 60 20 ld [ %i5 + 0x20 ], %i4 2003758: c8 07 60 24 ld [ %i5 + 0x24 ], %g4 200375c: c6 07 60 28 ld [ %i5 + 0x28 ], %g3 2003760: c4 07 60 2c ld [ %i5 + 0x2c ], %g2 2003764: c2 00 61 f0 ld [ %g1 + 0x1f0 ], %g1 2003768: f6 20 60 18 st %i3, [ %g1 + 0x18 ] 200376c: f8 20 60 1c st %i4, [ %g1 + 0x1c ] 2003770: c8 20 60 20 st %g4, [ %g1 + 0x20 ] 2003774: c6 20 60 24 st %g3, [ %g1 + 0x24 ] 2003778: c4 20 60 28 st %g2, [ %g1 + 0x28 ] 200377c: 81 c7 e0 08 ret 2003780: 81 e8 00 00 restore /* * You can only mount one file system onto a single mount point. */ if ( rtems_filesystem_mount_iterate( is_node_fs_root, loc.node_access ) ) { 2003784: 11 00 80 0d sethi %hi(0x2003400), %o0 2003788: 7f ff ff 3a call 2003470 200378c: 90 12 20 5c or %o0, 0x5c, %o0 ! 200345c 2003790: 80 8a 20 ff btst 0xff, %o0 2003794: 02 80 00 07 be 20037b0 2003798: c4 07 bf f8 ld [ %fp + -8 ], %g2 errno = EBUSY; 200379c: 40 00 30 64 call 200f92c <__errno> 20037a0: 01 00 00 00 nop 20037a4: 82 10 20 10 mov 0x10, %g1 ! 10 goto cleanup_and_bail; 20037a8: 10 bf ff af b 2003664 20037ac: c2 22 00 00 st %g1, [ %o0 ] * 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; 20037b0: c6 07 bf ec ld [ %fp + -20 ], %g3 /* * 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 ) ) { 20037b4: c2 00 a0 20 ld [ %g2 + 0x20 ], %g1 * 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; 20037b8: c6 27 60 08 st %g3, [ %i5 + 8 ] mt_entry->mt_point_node.handlers = loc.handlers; mt_entry->mt_point_node.ops = loc.ops; 20037bc: c4 27 60 14 st %g2, [ %i5 + 0x14 ] * 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; 20037c0: c6 07 bf f4 ld [ %fp + -12 ], %g3 mt_entry->mt_point_node.ops = loc.ops; mt_entry->mt_point_node.mt_entry = loc.mt_entry; 20037c4: c4 07 bf fc ld [ %fp + -4 ], %g2 * 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; 20037c8: c6 27 60 10 st %g3, [ %i5 + 0x10 ] mt_entry->mt_point_node.ops = loc.ops; mt_entry->mt_point_node.mt_entry = loc.mt_entry; 20037cc: c4 27 60 18 st %g2, [ %i5 + 0x18 ] /* * 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 ) ) { 20037d0: 90 10 00 1d mov %i5, %o0 20037d4: 9f c0 40 00 call %g1 20037d8: b6 07 bf ec add %fp, -20, %i3 20037dc: 80 a2 20 00 cmp %o0, 0 20037e0: 02 bf ff aa be 2003688 <== ALWAYS TAKEN 20037e4: 90 10 00 1d mov %i5, %o0 20037e8: 30 bf ff 9f b,a 2003664 <== NOT EXECUTED =============================================================================== 02003620 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 2003620: 9d e3 bf a0 save %sp, -96, %sp int rv = -1; if (target != NULL) { 2003624: 90 96 60 00 orcc %i1, 0, %o0 2003628: 02 80 00 0b be 2003654 200362c: 01 00 00 00 nop rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); 2003630: 40 00 02 5f call 2003fac 2003634: 92 10 21 ff mov 0x1ff, %o1 ! 1ff if (rv == 0) { 2003638: 82 92 20 00 orcc %o0, 0, %g1 200363c: 02 80 00 04 be 200364c <== ALWAYS TAKEN 2003640: 01 00 00 00 nop } else { errno = EINVAL; } return rv; } 2003644: 81 c7 e0 08 ret 2003648: 91 e8 00 01 restore %g0, %g1, %o0 int rv = -1; if (target != NULL) { rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); if (rv == 0) { rv = mount( 200364c: 40 00 00 2a call 20036f4 2003650: 81 e8 00 00 restore options, data ); } } else { errno = EINVAL; 2003654: 40 00 30 35 call 200f728 <__errno> 2003658: 01 00 00 00 nop 200365c: 84 10 20 16 mov 0x16, %g2 ! 16 const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { int rv = -1; 2003660: 82 10 3f ff mov -1, %g1 options, data ); } } else { errno = EINVAL; 2003664: 10 bf ff f8 b 2003644 2003668: c4 22 00 00 st %g2, [ %o0 ] =============================================================================== 0200b0a8 : int oflag, ... /* mode_t mode, */ /* struct mq_attr attr */ ) { 200b0a8: 9d e3 bf 90 save %sp, -112, %sp /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 200b0ac: 03 00 80 9d sethi %hi(0x2027400), %g1 200b0b0: c4 00 60 20 ld [ %g1 + 0x20 ], %g2 ! 2027420 <_Thread_Dispatch_disable_level> Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); 200b0b4: f4 27 a0 4c st %i2, [ %fp + 0x4c ] 200b0b8: 84 00 a0 01 inc %g2 200b0bc: c4 20 60 20 st %g2, [ %g1 + 0x20 ] return _Thread_Dispatch_disable_level; 200b0c0: c2 00 60 20 ld [ %g1 + 0x20 ], %g1 200b0c4: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 200b0c8: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 200b0cc: fa 27 a0 58 st %i5, [ %fp + 0x58 ] POSIX_Message_queue_Control_fd *the_mq_fd; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 200b0d0: a0 8e 62 00 andcc %i1, 0x200, %l0 200b0d4: 12 80 00 34 bne 200b1a4 200b0d8: b4 10 20 00 clr %i2 */ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd * _POSIX_Message_queue_Allocate_fd( void ) { return (POSIX_Message_queue_Control_fd *) 200b0dc: 39 00 80 9e sethi %hi(0x2027800), %i4 200b0e0: 40 00 0c 3b call 200e1cc <_Objects_Allocate> 200b0e4: 90 17 20 ec or %i4, 0xec, %o0 ! 20278ec <_POSIX_Message_queue_Information_fds> attr = (struct mq_attr *) va_arg( arg, struct mq_attr * ); va_end(arg); } the_mq_fd = _POSIX_Message_queue_Allocate_fd(); if ( !the_mq_fd ) { 200b0e8: ba 92 20 00 orcc %o0, 0, %i5 200b0ec: 02 80 00 37 be 200b1c8 <== NEVER TAKEN 200b0f0: 01 00 00 00 nop _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENFILE ); } the_mq_fd->oflag = oflag; 200b0f4: f2 27 60 14 st %i1, [ %i5 + 0x14 ] status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id ); 200b0f8: 90 10 00 18 mov %i0, %o0 200b0fc: 40 00 1e ae call 2012bb4 <_POSIX_Message_queue_Name_to_id> 200b100: 92 07 bf f4 add %fp, -12, %o1 * If the name to id translation worked, then the message queue exists * and we can just return a pointer to the id. Otherwise we may * need to check to see if this is a "message queue does not exist" * or some other miscellaneous error on the name. */ if ( status ) { 200b104: b6 92 20 00 orcc %o0, 0, %i3 200b108: 22 80 00 0f be,a 200b144 200b10c: b2 0e 6a 00 and %i1, 0xa00, %i1 /* * Unless provided a valid name that did not already exist * and we are willing to create then it is an error. */ if ( !( status == ENOENT && (oflag & O_CREAT) ) ) { 200b110: 80 a6 e0 02 cmp %i3, 2 200b114: 02 80 00 40 be 200b214 200b118: 80 a4 20 00 cmp %l0, 0 RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free_fd ( POSIX_Message_queue_Control_fd *the_mq_fd ) { _Objects_Free( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object ); 200b11c: 90 17 20 ec or %i4, 0xec, %o0 200b120: 40 00 0d 15 call 200e574 <_Objects_Free> 200b124: 92 10 00 1d mov %i5, %o1 _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 200b128: 40 00 11 2f call 200f5e4 <_Thread_Enable_dispatch> 200b12c: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one_cast( status, mqd_t ); 200b130: 40 00 2d 51 call 2016674 <__errno> 200b134: 01 00 00 00 nop 200b138: f6 22 00 00 st %i3, [ %o0 ] 200b13c: 81 c7 e0 08 ret 200b140: 81 e8 00 00 restore } else { /* name -> ID translation succeeded */ /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 200b144: 80 a6 6a 00 cmp %i1, 0xa00 200b148: 02 80 00 28 be 200b1e8 200b14c: d2 07 bf f4 ld [ %fp + -12 ], %o1 RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get ( Objects_Id id, Objects_Locations *location ) { return (POSIX_Message_queue_Control *) 200b150: 94 07 bf fc add %fp, -4, %o2 200b154: 11 00 80 9d sethi %hi(0x2027400), %o0 200b158: 40 00 0d 68 call 200e6f8 <_Objects_Get> 200b15c: 90 12 23 60 or %o0, 0x360, %o0 ! 2027760 <_POSIX_Message_queue_Information> /* * In this case we need to do an ID->pointer conversion to * check the mode. */ the_mq = _POSIX_Message_queue_Get( the_mq_id, &location ); the_mq->open_count += 1; 200b160: c4 02 20 18 ld [ %o0 + 0x18 ], %g2 Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( 200b164: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 200b168: 84 00 a0 01 inc %g2 ); _Thread_Enable_dispatch(); return (mqd_t) the_mq_fd->Object.id; } 200b16c: b8 17 20 ec or %i4, 0xec, %i4 /* * In this case we need to do an ID->pointer conversion to * check the mode. */ the_mq = _POSIX_Message_queue_Get( the_mq_id, &location ); the_mq->open_count += 1; 200b170: c4 22 20 18 st %g2, [ %o0 + 0x18 ] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 200b174: c4 07 20 1c ld [ %i4 + 0x1c ], %g2 /* * In this case we need to do an ID->pointer conversion to * check the mode. */ the_mq = _POSIX_Message_queue_Get( the_mq_id, &location ); 200b178: d0 27 bf f8 st %o0, [ %fp + -8 ] the_mq->open_count += 1; the_mq_fd->Queue = the_mq; 200b17c: d0 27 60 10 st %o0, [ %i5 + 0x10 ] 200b180: 83 28 60 02 sll %g1, 2, %g1 200b184: fa 20 80 01 st %i5, [ %g2 + %g1 ] _Objects_Open_string( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object, NULL ); _Thread_Enable_dispatch(); 200b188: 40 00 11 17 call 200f5e4 <_Thread_Enable_dispatch> 200b18c: c0 27 60 0c clr [ %i5 + 0xc ] _Thread_Enable_dispatch(); 200b190: 40 00 11 15 call 200f5e4 <_Thread_Enable_dispatch> 200b194: 01 00 00 00 nop return (mqd_t)the_mq_fd->Object.id; 200b198: f0 07 60 08 ld [ %i5 + 8 ], %i0 200b19c: 81 c7 e0 08 ret 200b1a0: 81 e8 00 00 restore _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); mode = (mode_t) va_arg( arg, unsigned int ); attr = (struct mq_attr *) va_arg( arg, struct mq_attr * ); 200b1a4: 82 07 a0 54 add %fp, 0x54, %g1 200b1a8: f4 07 a0 50 ld [ %fp + 0x50 ], %i2 200b1ac: c2 27 bf f0 st %g1, [ %fp + -16 ] */ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd * _POSIX_Message_queue_Allocate_fd( void ) { return (POSIX_Message_queue_Control_fd *) 200b1b0: 39 00 80 9e sethi %hi(0x2027800), %i4 200b1b4: 40 00 0c 06 call 200e1cc <_Objects_Allocate> 200b1b8: 90 17 20 ec or %i4, 0xec, %o0 ! 20278ec <_POSIX_Message_queue_Information_fds> va_end(arg); } the_mq_fd = _POSIX_Message_queue_Allocate_fd(); if ( !the_mq_fd ) { 200b1bc: ba 92 20 00 orcc %o0, 0, %i5 200b1c0: 32 bf ff ce bne,a 200b0f8 200b1c4: f2 27 60 14 st %i1, [ %i5 + 0x14 ] _Thread_Enable_dispatch(); 200b1c8: 40 00 11 07 call 200f5e4 <_Thread_Enable_dispatch> 200b1cc: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one( ENFILE ); 200b1d0: 40 00 2d 29 call 2016674 <__errno> 200b1d4: 01 00 00 00 nop 200b1d8: 82 10 20 17 mov 0x17, %g1 ! 17 200b1dc: c2 22 00 00 st %g1, [ %o0 ] 200b1e0: 81 c7 e0 08 ret 200b1e4: 81 e8 00 00 restore RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free_fd ( POSIX_Message_queue_Control_fd *the_mq_fd ) { _Objects_Free( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object ); 200b1e8: 90 17 20 ec or %i4, 0xec, %o0 200b1ec: 40 00 0c e2 call 200e574 <_Objects_Free> 200b1f0: 92 10 00 1d mov %i5, %o1 /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 200b1f4: 40 00 10 fc call 200f5e4 <_Thread_Enable_dispatch> 200b1f8: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one_cast( EEXIST, mqd_t ); 200b1fc: 40 00 2d 1e call 2016674 <__errno> 200b200: 01 00 00 00 nop 200b204: 82 10 20 11 mov 0x11, %g1 ! 11 200b208: c2 22 00 00 st %g1, [ %o0 ] 200b20c: 81 c7 e0 08 ret 200b210: 81 e8 00 00 restore if ( status ) { /* * Unless provided a valid name that did not already exist * and we are willing to create then it is an error. */ if ( !( status == ENOENT && (oflag & O_CREAT) ) ) { 200b214: 02 bf ff c3 be 200b120 200b218: 90 17 20 ec or %i4, 0xec, %o0 /* * At this point, the message queue does not exist and everything has been * checked. We should go ahead and create a message queue. */ status = _POSIX_Message_queue_Create_support( 200b21c: 90 10 00 18 mov %i0, %o0 200b220: 92 10 20 01 mov 1, %o1 200b224: 94 10 00 1a mov %i2, %o2 200b228: 40 00 1d fe call 2012a20 <_POSIX_Message_queue_Create_support> 200b22c: 96 07 bf f8 add %fp, -8, %o3 ); /* * errno was set by Create_support, so don't set it again. */ if ( status == -1 ) { 200b230: 80 a2 3f ff cmp %o0, -1 200b234: 02 80 00 0d be 200b268 200b238: c6 07 bf f8 ld [ %fp + -8 ], %g3 Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( 200b23c: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 ); _Thread_Enable_dispatch(); return (mqd_t) the_mq_fd->Object.id; } 200b240: b8 17 20 ec or %i4, 0xec, %i4 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 200b244: c4 07 20 1c ld [ %i4 + 0x1c ], %g2 _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); return (mqd_t) -1; } the_mq_fd->Queue = the_mq; 200b248: c6 27 60 10 st %g3, [ %i5 + 0x10 ] 200b24c: 83 28 60 02 sll %g1, 2, %g1 200b250: fa 20 80 01 st %i5, [ %g2 + %g1 ] &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object, NULL ); _Thread_Enable_dispatch(); 200b254: 40 00 10 e4 call 200f5e4 <_Thread_Enable_dispatch> 200b258: c0 27 60 0c clr [ %i5 + 0xc ] return (mqd_t) the_mq_fd->Object.id; 200b25c: f0 07 60 08 ld [ %i5 + 8 ], %i0 } 200b260: 81 c7 e0 08 ret 200b264: 81 e8 00 00 restore 200b268: 90 17 20 ec or %i4, 0xec, %o0 200b26c: 92 10 00 1d mov %i5, %o1 200b270: 40 00 0c c1 call 200e574 <_Objects_Free> 200b274: b0 10 3f ff mov -1, %i0 /* * errno was set by Create_support, so don't set it again. */ if ( status == -1 ) { _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 200b278: 40 00 10 db call 200f5e4 <_Thread_Enable_dispatch> 200b27c: 01 00 00 00 nop return (mqd_t) -1; 200b280: 81 c7 e0 08 ret 200b284: 81 e8 00 00 restore =============================================================================== 02003a8c : void newlib_delete_hook( rtems_tcb *current_task, rtems_tcb *deleted_task ) { 2003a8c: 9d e3 bf a0 save %sp, -96, %sp /* * The reentrancy structure was allocated by newlib using malloc() */ if (current_task == deleted_task) { ptr = _REENT; 2003a90: 03 00 80 73 sethi %hi(0x201cc00), %g1 /* * The reentrancy structure was allocated by newlib using malloc() */ if (current_task == deleted_task) { 2003a94: 80 a6 00 19 cmp %i0, %i1 2003a98: 02 80 00 03 be 2003aa4 2003a9c: fa 00 63 b8 ld [ %g1 + 0x3b8 ], %i5 ptr = _REENT; } else { ptr = deleted_task->libc_reent; 2003aa0: fa 06 61 54 ld [ %i1 + 0x154 ], %i5 } if (ptr && ptr != _global_impure_ptr) { 2003aa4: 80 a7 60 00 cmp %i5, 0 2003aa8: 02 80 00 0b be 2003ad4 <== NEVER TAKEN 2003aac: 03 00 80 70 sethi %hi(0x201c000), %g1 2003ab0: c2 00 61 78 ld [ %g1 + 0x178 ], %g1 ! 201c178 <_global_impure_ptr> 2003ab4: 80 a7 40 01 cmp %i5, %g1 2003ab8: 02 80 00 07 be 2003ad4 2003abc: 13 00 80 0e sethi %hi(0x2003800), %o1 _reclaim_reent(ptr); */ /* * Just in case there are some buffers lying around. */ _fwalk(ptr, newlib_free_buffers); 2003ac0: 90 10 00 1d mov %i5, %o0 2003ac4: 40 00 31 aa call 201016c <_fwalk> 2003ac8: 92 12 60 7c or %o1, 0x7c, %o1 #if REENT_MALLOCED free(ptr); #else _Workspace_Free(ptr); 2003acc: 40 00 1a c1 call 200a5d0 <_Workspace_Free> 2003ad0: 90 10 00 1d mov %i5, %o0 /* * Require the switch back to another task to install its own */ if ( current_task == deleted_task ) { 2003ad4: 80 a6 00 19 cmp %i0, %i1 2003ad8: 12 80 00 04 bne 2003ae8 2003adc: c0 26 61 54 clr [ %i1 + 0x154 ] _REENT = 0; 2003ae0: 03 00 80 73 sethi %hi(0x201cc00), %g1 2003ae4: c0 20 63 b8 clr [ %g1 + 0x3b8 ] ! 201cfb8 <_impure_ptr> 2003ae8: 81 c7 e0 08 ret 2003aec: 81 e8 00 00 restore =============================================================================== 0200387c : */ int newlib_free_buffers( FILE *fp ) { 200387c: 9d e3 bf a0 save %sp, -96, %sp switch ( fileno(fp) ) { 2003880: 40 00 31 4a call 200fda8 2003884: 90 10 00 18 mov %i0, %o0 2003888: 80 a2 20 02 cmp %o0, 2 200388c: 28 80 00 06 bleu,a 20038a4 <== ALWAYS TAKEN 2003890: c2 16 20 0c lduh [ %i0 + 0xc ], %g1 fp->_flags &= ~__SMBF; fp->_bf._base = fp->_p = (unsigned char *) NULL; } break; default: fclose(fp); 2003894: 40 00 30 78 call 200fa74 <== NOT EXECUTED 2003898: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED } return 0; } 200389c: 81 c7 e0 08 ret 20038a0: 91 e8 20 00 restore %g0, 0, %o0 { switch ( fileno(fp) ) { case 0: case 1: case 2: if (fp->_flags & __SMBF) { 20038a4: 80 88 60 80 btst 0x80, %g1 20038a8: 02 bf ff fd be 200389c <== ALWAYS TAKEN 20038ac: 01 00 00 00 nop free( fp->_bf._base ); 20038b0: 7f ff fd 81 call 2002eb4 <== NOT EXECUTED 20038b4: d0 06 20 10 ld [ %i0 + 0x10 ], %o0 <== NOT EXECUTED fp->_flags &= ~__SMBF; 20038b8: c2 16 20 0c lduh [ %i0 + 0xc ], %g1 <== NOT EXECUTED fp->_bf._base = fp->_p = (unsigned char *) NULL; 20038bc: c0 26 00 00 clr [ %i0 ] <== NOT EXECUTED case 0: case 1: case 2: if (fp->_flags & __SMBF) { free( fp->_bf._base ); fp->_flags &= ~__SMBF; 20038c0: 82 08 7f 7f and %g1, -129, %g1 <== NOT EXECUTED fp->_bf._base = fp->_p = (unsigned char *) NULL; 20038c4: c0 26 20 10 clr [ %i0 + 0x10 ] <== NOT EXECUTED case 0: case 1: case 2: if (fp->_flags & __SMBF) { free( fp->_bf._base ); fp->_flags &= ~__SMBF; 20038c8: c2 36 20 0c sth %g1, [ %i0 + 0xc ] <== NOT EXECUTED break; default: fclose(fp); } return 0; } 20038cc: 81 c7 e0 08 ret <== NOT EXECUTED 20038d0: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED =============================================================================== 02003b64 : int open( const char *pathname, int flags, ... ) { 2003b64: 9d e3 bf 88 save %sp, -120, %sp if ( ( status & _FREAD ) == _FREAD ) eval_flags |= RTEMS_LIBIO_PERMS_READ; if ( ( status & _FWRITE ) == _FWRITE ) eval_flags |= RTEMS_LIBIO_PERMS_WRITE; va_start(ap, flags); 2003b68: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 2003b6c: f4 27 a0 4c st %i2, [ %fp + 0x4c ] 2003b70: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 2003b74: fa 27 a0 58 st %i5, [ %fp + 0x58 ] /* * Set the Evaluation flags */ eval_flags = 0; status = flags + 1; 2003b78: 82 06 60 01 add %i1, 1, %g1 if ( ( status & _FREAD ) == _FREAD ) eval_flags |= RTEMS_LIBIO_PERMS_READ; 2003b7c: b6 08 60 01 and %g1, 1, %i3 if ( ( status & _FWRITE ) == _FWRITE ) 2003b80: 80 88 60 02 btst 2, %g1 2003b84: 02 80 00 03 be 2003b90 2003b88: b7 2e e0 02 sll %i3, 2, %i3 eval_flags |= RTEMS_LIBIO_PERMS_WRITE; 2003b8c: b6 16 e0 02 or %i3, 2, %i3 va_start(ap, flags); mode = va_arg( ap, int ); 2003b90: 82 07 a0 50 add %fp, 0x50, %g1 2003b94: f8 07 a0 4c ld [ %fp + 0x4c ], %i4 * 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(); 2003b98: 40 00 20 e5 call 200bf2c 2003b9c: c2 27 bf fc st %g1, [ %fp + -4 ] if ( iop == 0 ) { 2003ba0: ba 92 20 00 orcc %o0, 0, %i5 2003ba4: 22 80 00 2f be,a 2003c60 2003ba8: b6 10 20 17 mov 0x17, %i3 } /* * See if the file exists. */ status = rtems_filesystem_evaluate_path( 2003bac: 40 00 34 ef call 2010f68 2003bb0: 90 10 00 18 mov %i0, %o0 2003bb4: 94 10 00 1b mov %i3, %o2 2003bb8: 92 10 00 08 mov %o0, %o1 2003bbc: 96 07 bf e8 add %fp, -24, %o3 2003bc0: 90 10 00 18 mov %i0, %o0 2003bc4: 7f ff fc 7b call 2002db0 2003bc8: 98 10 20 01 mov 1, %o4 pathname, strlen( pathname ), eval_flags, &loc, true ); if ( status == -1 ) { 2003bcc: 80 a2 3f ff cmp %o0, -1 2003bd0: 02 80 00 40 be 2003cd0 2003bd4: 82 0e 6a 00 and %i1, 0xa00, %g1 if ( status != 0 ) { /* The file did not exist */ rc = EACCES; goto done; } } else if ((flags & (O_EXCL|O_CREAT)) == (O_EXCL|O_CREAT)) { 2003bd8: 80 a0 6a 00 cmp %g1, 0xa00 2003bdc: 02 80 00 26 be 2003c74 2003be0: b4 07 bf e8 add %fp, -24, %i2 /* * Fill in the file control block based on the loc structure * returned by successful path evaluation. */ iop->flags |= rtems_libio_fcntl_flags( flags ); 2003be4: f6 07 60 18 ld [ %i5 + 0x18 ], %i3 2003be8: 40 00 20 ad call 200be9c 2003bec: 90 10 00 19 mov %i1, %o0 iop->pathinfo = loc; 2003bf0: c4 07 bf f0 ld [ %fp + -16 ], %g2 2003bf4: c6 07 bf e8 ld [ %fp + -24 ], %g3 rc = (*iop->pathinfo.handlers->open_h)( iop, pathname, flags, mode ); 2003bf8: c2 00 80 00 ld [ %g2 ], %g1 /* * 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; 2003bfc: c4 27 60 24 st %g2, [ %i5 + 0x24 ] 2003c00: c4 07 bf f4 ld [ %fp + -12 ], %g2 2003c04: c6 27 60 1c st %g3, [ %i5 + 0x1c ] 2003c08: c4 27 60 28 st %g2, [ %i5 + 0x28 ] 2003c0c: c6 07 bf ec ld [ %fp + -20 ], %g3 2003c10: c4 07 bf f8 ld [ %fp + -8 ], %g2 /* * Fill in the file control block based on the loc structure * returned by successful path evaluation. */ iop->flags |= rtems_libio_fcntl_flags( flags ); 2003c14: b6 12 00 1b or %o0, %i3, %i3 iop->pathinfo = loc; 2003c18: c6 27 60 20 st %g3, [ %i5 + 0x20 ] /* * Fill in the file control block based on the loc structure * returned by successful path evaluation. */ iop->flags |= rtems_libio_fcntl_flags( flags ); 2003c1c: f6 27 60 18 st %i3, [ %i5 + 0x18 ] iop->pathinfo = loc; 2003c20: c4 27 60 2c st %g2, [ %i5 + 0x2c ] rc = (*iop->pathinfo.handlers->open_h)( iop, pathname, flags, mode ); 2003c24: 90 10 00 1d mov %i5, %o0 2003c28: 92 10 00 18 mov %i0, %o1 2003c2c: 94 10 00 19 mov %i1, %o2 2003c30: 9f c0 40 00 call %g1 2003c34: 96 10 00 1c mov %i4, %o3 if ( rc ) { 2003c38: 80 a2 20 00 cmp %o0, 0 2003c3c: 12 80 00 1a bne 2003ca4 2003c40: 80 8e 64 00 btst 0x400, %i1 } /* * Optionally truncate the file. */ if ( (flags & O_TRUNC) == O_TRUNC ) { 2003c44: 12 80 00 2d bne 2003cf8 2003c48: 39 00 80 75 sethi %hi(0x201d400), %i4 if ( loc_to_free ) rtems_filesystem_freenode( loc_to_free ); rtems_set_errno_and_return_minus_one( rc ); } return iop - rtems_libio_iops; 2003c4c: f0 07 23 84 ld [ %i4 + 0x384 ], %i0 ! 201d784 2003c50: ba 27 40 18 sub %i5, %i0, %i5 2003c54: b1 3f 60 06 sra %i5, 6, %i0 } 2003c58: 81 c7 e0 08 ret 2003c5c: 81 e8 00 00 restore if ( rc ) { if ( iop ) rtems_libio_free( iop ); if ( loc_to_free ) rtems_filesystem_freenode( loc_to_free ); rtems_set_errno_and_return_minus_one( rc ); 2003c60: 40 00 2f 33 call 200f92c <__errno> 2003c64: b0 10 3f ff mov -1, %i0 2003c68: f6 22 00 00 st %i3, [ %o0 ] 2003c6c: 81 c7 e0 08 ret 2003c70: 81 e8 00 00 restore 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; 2003c74: b6 10 20 11 mov 0x11, %i3 */ done: va_end(ap); if ( rc ) { if ( iop ) 2003c78: 80 a7 60 00 cmp %i5, 0 2003c7c: 02 80 00 05 be 2003c90 2003c80: 80 a6 a0 00 cmp %i2, 0 rtems_libio_free( iop ); 2003c84: 40 00 20 d2 call 200bfcc 2003c88: 90 10 00 1d mov %i5, %o0 if ( loc_to_free ) 2003c8c: 80 a6 a0 00 cmp %i2, 0 2003c90: 02 bf ff f4 be 2003c60 2003c94: 01 00 00 00 nop rtems_filesystem_freenode( loc_to_free ); 2003c98: 7f ff fc 80 call 2002e98 2003c9c: 90 10 00 1a mov %i2, %o0 2003ca0: 30 bf ff f0 b,a 2003c60 iop->flags |= rtems_libio_fcntl_flags( flags ); iop->pathinfo = loc; rc = (*iop->pathinfo.handlers->open_h)( iop, pathname, flags, mode ); if ( rc ) { rc = errno; 2003ca4: 40 00 2f 22 call 200f92c <__errno> 2003ca8: b4 07 bf e8 add %fp, -24, %i2 2003cac: f6 02 00 00 ld [ %o0 ], %i3 2003cb0: 39 00 80 75 sethi %hi(0x201d400), %i4 * Single exit and clean up path. */ done: va_end(ap); if ( rc ) { 2003cb4: 80 a6 e0 00 cmp %i3, 0 2003cb8: 12 bf ff f0 bne 2003c78 <== ALWAYS TAKEN 2003cbc: f0 07 23 84 ld [ %i4 + 0x384 ], %i0 if ( loc_to_free ) rtems_filesystem_freenode( loc_to_free ); rtems_set_errno_and_return_minus_one( rc ); } return iop - rtems_libio_iops; 2003cc0: ba 27 40 18 sub %i5, %i0, %i5 <== NOT EXECUTED 2003cc4: b1 3f 60 06 sra %i5, 6, %i0 <== NOT EXECUTED } 2003cc8: 81 c7 e0 08 ret <== NOT EXECUTED 2003ccc: 81 e8 00 00 restore <== NOT EXECUTED */ status = rtems_filesystem_evaluate_path( pathname, strlen( pathname ), eval_flags, &loc, true ); if ( status == -1 ) { if ( errno != ENOENT ) { 2003cd0: 40 00 2f 17 call 200f92c <__errno> 2003cd4: 01 00 00 00 nop 2003cd8: c2 02 00 00 ld [ %o0 ], %g1 2003cdc: 80 a0 60 02 cmp %g1, 2 2003ce0: 02 80 00 1d be 2003d54 2003ce4: b4 10 20 00 clr %i2 rc = errno; 2003ce8: 40 00 2f 11 call 200f92c <__errno> 2003cec: 01 00 00 00 nop goto done; 2003cf0: 10 bf ff f0 b 2003cb0 2003cf4: f6 02 00 00 ld [ %o0 ], %i3 /* * Optionally truncate the file. */ if ( (flags & O_TRUNC) == O_TRUNC ) { rc = ftruncate( iop - rtems_libio_iops, 0 ); 2003cf8: d0 07 23 84 ld [ %i4 + 0x384 ], %o0 2003cfc: 92 10 20 00 clr %o1 2003d00: 94 10 20 00 clr %o2 2003d04: 90 27 40 08 sub %i5, %o0, %o0 2003d08: 40 00 20 23 call 200bd94 2003d0c: 91 3a 20 06 sra %o0, 6, %o0 if ( rc ) { 2003d10: b6 92 20 00 orcc %o0, 0, %i3 2003d14: 02 bf ff cf be 2003c50 2003d18: f0 07 23 84 ld [ %i4 + 0x384 ], %i0 if(errno) rc = errno; 2003d1c: 40 00 2f 04 call 200f92c <__errno> 2003d20: 01 00 00 00 nop 2003d24: c2 02 00 00 ld [ %o0 ], %g1 2003d28: 80 a0 60 00 cmp %g1, 0 2003d2c: 12 80 00 1a bne 2003d94 <== ALWAYS TAKEN 2003d30: 01 00 00 00 nop close( iop - rtems_libio_iops ); 2003d34: d0 07 23 84 ld [ %i4 + 0x384 ], %o0 /* those are released by close(): */ iop = 0; loc_to_free = NULL; 2003d38: b4 10 20 00 clr %i2 */ if ( (flags & O_TRUNC) == O_TRUNC ) { rc = ftruncate( iop - rtems_libio_iops, 0 ); if ( rc ) { if(errno) rc = errno; close( iop - rtems_libio_iops ); 2003d3c: 90 27 40 08 sub %i5, %o0, %o0 /* those are released by close(): */ iop = 0; 2003d40: ba 10 20 00 clr %i5 */ if ( (flags & O_TRUNC) == O_TRUNC ) { rc = ftruncate( iop - rtems_libio_iops, 0 ); if ( rc ) { if(errno) rc = errno; close( iop - rtems_libio_iops ); 2003d44: 40 00 1f f2 call 200bd0c 2003d48: 91 3a 20 06 sra %o0, 6, %o0 2003d4c: 10 bf ff da b 2003cb4 2003d50: 39 00 80 75 sethi %hi(0x201d400), %i4 rc = errno; goto done; } /* If the file does not exist and we are not trying to create it--> error */ if ( !(flags & O_CREAT) ) { 2003d54: 80 8e 62 00 btst 0x200, %i1 2003d58: 02 bf ff c8 be 2003c78 2003d5c: b6 10 20 02 mov 2, %i3 rc = ENOENT; goto done; } /* Create the node for the new regular file */ rc = mknod( pathname, S_IFREG | mode, 0LL ); 2003d60: 90 10 00 18 mov %i0, %o0 2003d64: 13 00 00 20 sethi %hi(0x8000), %o1 2003d68: 94 10 20 00 clr %o2 2003d6c: 92 17 00 09 or %i4, %o1, %o1 2003d70: 7f ff fd 84 call 2003380 2003d74: 96 10 20 00 clr %o3 if ( rc ) { 2003d78: 80 a2 20 00 cmp %o0, 0 2003d7c: 02 80 00 0a be 2003da4 <== ALWAYS TAKEN 2003d80: 01 00 00 00 nop rc = errno; 2003d84: 40 00 2e ea call 200f92c <__errno> <== NOT EXECUTED 2003d88: 39 00 80 75 sethi %hi(0x201d400), %i4 <== NOT EXECUTED goto done; 2003d8c: 10 bf ff ca b 2003cb4 <== NOT EXECUTED 2003d90: f6 02 00 00 ld [ %o0 ], %i3 <== NOT EXECUTED * Optionally truncate the file. */ if ( (flags & O_TRUNC) == O_TRUNC ) { rc = ftruncate( iop - rtems_libio_iops, 0 ); if ( rc ) { if(errno) rc = errno; 2003d94: 40 00 2e e6 call 200f92c <__errno> 2003d98: 01 00 00 00 nop 2003d9c: 10 bf ff e6 b 2003d34 2003da0: f6 02 00 00 ld [ %o0 ], %i3 /* * 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( 2003da4: 40 00 34 71 call 2010f68 2003da8: 90 10 00 18 mov %i0, %o0 2003dac: 94 10 20 00 clr %o2 2003db0: 92 10 00 08 mov %o0, %o1 2003db4: 96 07 bf e8 add %fp, -24, %o3 2003db8: 90 10 00 18 mov %i0, %o0 2003dbc: 98 10 20 01 mov 1, %o4 2003dc0: 7f ff fb fc call 2002db0 2003dc4: b6 10 20 0d mov 0xd, %i3 pathname, strlen( pathname ), 0x0, &loc, true ); if ( status != 0 ) { /* The file did not exist */ 2003dc8: 80 a2 20 00 cmp %o0, 0 2003dcc: 12 bf ff ac bne 2003c7c <== NEVER TAKEN 2003dd0: 80 a7 60 00 cmp %i5, 0 /* * Fill in the file control block based on the loc structure * returned by successful path evaluation. */ iop->flags |= rtems_libio_fcntl_flags( flags ); 2003dd4: 10 bf ff 85 b 2003be8 2003dd8: f6 07 60 18 ld [ %i5 + 0x18 ], %i3 =============================================================================== 02004b28 : /* * Handle output processing */ static void oproc (unsigned char c, struct rtems_termios_tty *tty) { 2004b28: 9d e3 bf a0 save %sp, -96, %sp int i; if (tty->termios.c_oflag & OPOST) { 2004b2c: c2 06 60 34 ld [ %i1 + 0x34 ], %g1 2004b30: 80 88 60 01 btst 1, %g1 2004b34: 02 80 00 21 be 2004bb8 <== NEVER TAKEN 2004b38: f0 2f a0 44 stb %i0, [ %fp + 0x44 ] switch (c) { 2004b3c: 80 a6 20 09 cmp %i0, 9 2004b40: 22 80 00 3d be,a 2004c34 2004b44: c6 06 60 28 ld [ %i1 + 0x28 ], %g3 2004b48: 08 80 00 22 bleu 2004bd0 <== NEVER TAKEN 2004b4c: 80 a6 20 08 cmp %i0, 8 2004b50: 80 a6 20 0a cmp %i0, 0xa 2004b54: 02 80 00 2b be 2004c00 2004b58: 80 a6 20 0d cmp %i0, 0xd 2004b5c: 02 80 00 44 be 2004c6c <== NEVER TAKEN 2004b60: 80 88 60 10 btst 0x10, %g1 if (tty->column > 0) tty->column--; break; default: if (tty->termios.c_oflag & OLCUC) 2004b64: 80 88 60 02 btst 2, %g1 c = toupper(c); 2004b68: 03 00 80 73 sethi %hi(0x201cc00), %g1 if (tty->column > 0) tty->column--; break; default: if (tty->termios.c_oflag & OLCUC) 2004b6c: 02 80 00 0b be 2004b98 <== ALWAYS TAKEN 2004b70: c2 00 63 b4 ld [ %g1 + 0x3b4 ], %g1 ! 201cfb4 <__ctype_ptr__> c = toupper(c); 2004b74: 84 10 00 18 mov %i0, %g2 <== NOT EXECUTED 2004b78: b0 00 40 18 add %g1, %i0, %i0 <== NOT EXECUTED 2004b7c: c6 0e 20 01 ldub [ %i0 + 1 ], %g3 <== NOT EXECUTED 2004b80: 86 08 e0 03 and %g3, 3, %g3 <== NOT EXECUTED 2004b84: 80 a0 e0 02 cmp %g3, 2 <== NOT EXECUTED 2004b88: 22 80 00 02 be,a 2004b90 <== NOT EXECUTED 2004b8c: 84 00 bf e0 add %g2, -32, %g2 <== NOT EXECUTED 2004b90: c4 2f a0 44 stb %g2, [ %fp + 0x44 ] <== NOT EXECUTED 2004b94: b0 08 a0 ff and %g2, 0xff, %i0 <== NOT EXECUTED if (!iscntrl(c)) 2004b98: b0 00 40 18 add %g1, %i0, %i0 2004b9c: c2 0e 20 01 ldub [ %i0 + 1 ], %g1 2004ba0: 80 88 60 20 btst 0x20, %g1 2004ba4: 12 80 00 06 bne 2004bbc <== NEVER TAKEN 2004ba8: 90 07 a0 44 add %fp, 0x44, %o0 tty->column++; 2004bac: c2 06 60 28 ld [ %i1 + 0x28 ], %g1 2004bb0: 82 00 60 01 inc %g1 2004bb4: c2 26 60 28 st %g1, [ %i1 + 0x28 ] break; } } rtems_termios_puts (&c, 1, tty); 2004bb8: 90 07 a0 44 add %fp, 0x44, %o0 2004bbc: 92 10 20 01 mov 1, %o1 2004bc0: 7f ff ff 8a call 20049e8 2004bc4: 94 10 00 19 mov %i1, %o2 2004bc8: 81 c7 e0 08 ret 2004bcc: 81 e8 00 00 restore oproc (unsigned char c, struct rtems_termios_tty *tty) { int i; if (tty->termios.c_oflag & OPOST) { switch (c) { 2004bd0: 12 bf ff e6 bne 2004b68 <== NOT EXECUTED 2004bd4: 80 88 60 02 btst 2, %g1 <== NOT EXECUTED } tty->column += i; break; case '\b': if (tty->column > 0) 2004bd8: c2 06 60 28 ld [ %i1 + 0x28 ], %g1 <== NOT EXECUTED 2004bdc: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 2004be0: 04 bf ff f6 ble 2004bb8 <== NOT EXECUTED 2004be4: 82 00 7f ff add %g1, -1, %g1 <== NOT EXECUTED if (!iscntrl(c)) tty->column++; break; } } rtems_termios_puts (&c, 1, tty); 2004be8: 90 07 a0 44 add %fp, 0x44, %o0 <== NOT EXECUTED tty->column += i; break; case '\b': if (tty->column > 0) tty->column--; 2004bec: c2 26 60 28 st %g1, [ %i1 + 0x28 ] <== NOT EXECUTED if (!iscntrl(c)) tty->column++; break; } } rtems_termios_puts (&c, 1, tty); 2004bf0: 92 10 20 01 mov 1, %o1 <== NOT EXECUTED 2004bf4: 7f ff ff 7d call 20049e8 <== NOT EXECUTED 2004bf8: 94 10 00 19 mov %i1, %o2 <== NOT EXECUTED 2004bfc: 30 80 00 30 b,a 2004cbc <== NOT EXECUTED int i; if (tty->termios.c_oflag & OPOST) { switch (c) { case '\n': if (tty->termios.c_oflag & ONLRET) 2004c00: 80 88 60 20 btst 0x20, %g1 2004c04: 32 80 00 02 bne,a 2004c0c <== NEVER TAKEN 2004c08: c0 26 60 28 clr [ %i1 + 0x28 ] <== NOT EXECUTED tty->column = 0; if (tty->termios.c_oflag & ONLCR) { 2004c0c: 80 88 60 04 btst 4, %g1 2004c10: 22 bf ff eb be,a 2004bbc <== NEVER TAKEN 2004c14: 90 07 a0 44 add %fp, 0x44, %o0 <== NOT EXECUTED rtems_termios_puts ("\r", 1, tty); 2004c18: 92 10 20 01 mov 1, %o1 2004c1c: 11 00 80 6e sethi %hi(0x201b800), %o0 2004c20: 94 10 00 19 mov %i1, %o2 2004c24: 7f ff ff 71 call 20049e8 2004c28: 90 12 20 10 or %o0, 0x10, %o0 tty->column = 0; 2004c2c: 10 bf ff e3 b 2004bb8 2004c30: c0 26 60 28 clr [ %i1 + 0x28 ] tty->column = 0; break; case '\t': i = 8 - (tty->column & 7); if ((tty->termios.c_oflag & TABDLY) == XTABS) { 2004c34: 05 00 00 06 sethi %hi(0x1800), %g2 } tty->column = 0; break; case '\t': i = 8 - (tty->column & 7); 2004c38: 88 08 e0 07 and %g3, 7, %g4 if ((tty->termios.c_oflag & TABDLY) == XTABS) { 2004c3c: 82 08 40 02 and %g1, %g2, %g1 } tty->column = 0; break; case '\t': i = 8 - (tty->column & 7); 2004c40: 92 10 20 08 mov 8, %o1 if ((tty->termios.c_oflag & TABDLY) == XTABS) { 2004c44: 80 a0 40 02 cmp %g1, %g2 2004c48: 02 80 00 17 be 2004ca4 <== ALWAYS TAKEN 2004c4c: 92 22 40 04 sub %o1, %g4, %o1 tty->column += i; rtems_termios_puts ( " ", i, tty); return; } tty->column += i; 2004c50: 92 00 c0 09 add %g3, %o1, %o1 <== NOT EXECUTED if (!iscntrl(c)) tty->column++; break; } } rtems_termios_puts (&c, 1, tty); 2004c54: 90 07 a0 44 add %fp, 0x44, %o0 <== NOT EXECUTED if ((tty->termios.c_oflag & TABDLY) == XTABS) { tty->column += i; rtems_termios_puts ( " ", i, tty); return; } tty->column += i; 2004c58: d2 26 60 28 st %o1, [ %i1 + 0x28 ] <== NOT EXECUTED if (!iscntrl(c)) tty->column++; break; } } rtems_termios_puts (&c, 1, tty); 2004c5c: 94 10 00 19 mov %i1, %o2 <== NOT EXECUTED 2004c60: 7f ff ff 62 call 20049e8 <== NOT EXECUTED 2004c64: 92 10 20 01 mov 1, %o1 <== NOT EXECUTED 2004c68: 30 80 00 15 b,a 2004cbc <== NOT EXECUTED tty->column = 0; } break; case '\r': if ((tty->termios.c_oflag & ONOCR) && (tty->column == 0)) 2004c6c: 02 80 00 06 be 2004c84 <== NOT EXECUTED 2004c70: 80 88 60 08 btst 8, %g1 <== NOT EXECUTED 2004c74: c4 06 60 28 ld [ %i1 + 0x28 ], %g2 <== NOT EXECUTED 2004c78: 80 a0 a0 00 cmp %g2, 0 <== NOT EXECUTED 2004c7c: 02 bf ff d3 be 2004bc8 <== NOT EXECUTED 2004c80: 80 88 60 08 btst 8, %g1 <== NOT EXECUTED return; if (tty->termios.c_oflag & OCRNL) { 2004c84: 22 bf ff cd be,a 2004bb8 <== NOT EXECUTED 2004c88: c0 26 60 28 clr [ %i1 + 0x28 ] <== NOT EXECUTED c = '\n'; 2004c8c: 84 10 20 0a mov 0xa, %g2 <== NOT EXECUTED if (tty->termios.c_oflag & ONLRET) 2004c90: 80 88 60 20 btst 0x20, %g1 <== NOT EXECUTED 2004c94: 02 bf ff c9 be 2004bb8 <== NOT EXECUTED 2004c98: c4 2f a0 44 stb %g2, [ %fp + 0x44 ] <== NOT EXECUTED tty->column = 0; break; } tty->column = 0; break; 2004c9c: 10 bf ff c7 b 2004bb8 <== NOT EXECUTED 2004ca0: c0 26 60 28 clr [ %i1 + 0x28 ] <== NOT EXECUTED case '\t': i = 8 - (tty->column & 7); if ((tty->termios.c_oflag & TABDLY) == XTABS) { tty->column += i; 2004ca4: 86 00 c0 09 add %g3, %o1, %g3 rtems_termios_puts ( " ", i, tty); 2004ca8: 11 00 80 6e sethi %hi(0x201b800), %o0 break; case '\t': i = 8 - (tty->column & 7); if ((tty->termios.c_oflag & TABDLY) == XTABS) { tty->column += i; 2004cac: c6 26 60 28 st %g3, [ %i1 + 0x28 ] rtems_termios_puts ( " ", i, tty); 2004cb0: 90 12 20 18 or %o0, 0x18, %o0 2004cb4: 7f ff ff 4d call 20049e8 2004cb8: 94 10 00 19 mov %i1, %o2 return; 2004cbc: 81 c7 e0 08 ret 2004cc0: 81 e8 00 00 restore =============================================================================== 0200cba8 : * Called by pipe() to create an anonymous pipe. */ int pipe_create( int filsdes[2] ) { 200cba8: 9d e3 bf 90 save %sp, -112, %sp rtems_libio_t *iop; int err = 0; if (rtems_mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO) != 0) 200cbac: 92 10 21 ff mov 0x1ff, %o1 200cbb0: 11 00 80 75 sethi %hi(0x201d400), %o0 return -1; 200cbb4: ba 10 3f ff mov -1, %i5 ) { rtems_libio_t *iop; int err = 0; if (rtems_mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO) != 0) 200cbb8: 40 00 06 1a call 200e420 200cbbc: 90 12 23 28 or %o0, 0x328, %o0 200cbc0: 80 a2 20 00 cmp %o0, 0 200cbc4: 12 80 00 33 bne 200cc90 <== NEVER TAKEN 200cbc8: 03 00 80 7a sethi %hi(0x201e800), %g1 return -1; /* /tmp/.fifoXXXX */ char fifopath[15]; memcpy(fifopath, "/tmp/.fifo", 10); sprintf(fifopath + 10, "%04x", rtems_pipe_no ++); 200cbcc: d4 10 62 fc lduh [ %g1 + 0x2fc ], %o2 ! 201eafc if (rtems_mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO) != 0) return -1; /* /tmp/.fifoXXXX */ char fifopath[15]; memcpy(fifopath, "/tmp/.fifo", 10); 200cbd0: 05 0b dd 1b sethi %hi(0x2f746c00), %g2 sprintf(fifopath + 10, "%04x", rtems_pipe_no ++); 200cbd4: 88 02 a0 01 add %o2, 1, %g4 if (rtems_mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO) != 0) return -1; /* /tmp/.fifoXXXX */ char fifopath[15]; memcpy(fifopath, "/tmp/.fifo", 10); 200cbd8: 84 10 a1 70 or %g2, 0x170, %g2 sprintf(fifopath + 10, "%04x", rtems_pipe_no ++); 200cbdc: c8 30 62 fc sth %g4, [ %g1 + 0x2fc ] if (rtems_mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO) != 0) return -1; /* /tmp/.fifoXXXX */ char fifopath[15]; memcpy(fifopath, "/tmp/.fifo", 10); 200cbe0: 07 0b cb 99 sethi %hi(0x2f2e6400), %g3 200cbe4: 03 00 00 19 sethi %hi(0x6400), %g1 200cbe8: 86 10 e2 69 or %g3, 0x269, %g3 200cbec: 82 10 62 6f or %g1, 0x26f, %g1 200cbf0: c4 3f bf f0 std %g2, [ %fp + -16 ] 200cbf4: c2 37 bf f8 sth %g1, [ %fp + -8 ] sprintf(fifopath + 10, "%04x", rtems_pipe_no ++); 200cbf8: 95 2a a0 10 sll %o2, 0x10, %o2 200cbfc: 90 07 bf fa add %fp, -6, %o0 200cc00: 95 32 a0 10 srl %o2, 0x10, %o2 200cc04: 13 00 80 75 sethi %hi(0x201d400), %o1 200cc08: 40 00 14 3b call 2011cf4 200cc0c: 92 12 63 30 or %o1, 0x330, %o1 ! 201d730 <_CPU_Trap_slot_template+0x1c> /* Try creating FIFO file until find an available file name */ while (mkfifo(fifopath, S_IRUSR|S_IWUSR) != 0) { 200cc10: 90 07 bf f0 add %fp, -16, %o0 200cc14: 40 00 05 49 call 200e138 200cc18: 92 10 21 80 mov 0x180, %o1 200cc1c: 80 a2 20 00 cmp %o0, 0 200cc20: 12 80 00 31 bne 200cce4 200cc24: 90 07 bf f0 add %fp, -16, %o0 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); 200cc28: 7f ff e0 c8 call 2004f48 200cc2c: 13 00 00 10 sethi %hi(0x4000), %o1 if (filsdes[0] < 0) { 200cc30: 80 a2 20 00 cmp %o0, 0 200cc34: 06 80 00 1f bl 200ccb0 200cc38: d0 26 00 00 st %o0, [ %i0 ] the file node will be deleted after it is closed by all. */ unlink(fifopath); } else { /* Reset open file to blocking mode */ iop = rtems_libio_iop(filsdes[0]); 200cc3c: 03 00 80 78 sethi %hi(0x201e000), %g1 200cc40: c4 00 62 0c ld [ %g1 + 0x20c ], %g2 ! 201e20c 200cc44: 80 a2 00 02 cmp %o0, %g2 200cc48: 0a 80 00 15 bcs 200cc9c <== ALWAYS TAKEN 200cc4c: 82 10 20 00 clr %g1 iop->flags &= ~LIBIO_FLAGS_NO_DELAY; 200cc50: c4 00 60 18 ld [ %g1 + 0x18 ], %g2 filsdes[1] = open(fifopath, O_WRONLY); 200cc54: 90 07 bf f0 add %fp, -16, %o0 unlink(fifopath); } else { /* Reset open file to blocking mode */ iop = rtems_libio_iop(filsdes[0]); iop->flags &= ~LIBIO_FLAGS_NO_DELAY; 200cc58: 84 08 bf fe and %g2, -2, %g2 filsdes[1] = open(fifopath, O_WRONLY); 200cc5c: 92 10 20 01 mov 1, %o1 200cc60: 7f ff e0 ba call 2004f48 200cc64: c4 20 60 18 st %g2, [ %g1 + 0x18 ] 200cc68: d0 26 20 04 st %o0, [ %i0 + 4 ] if (filsdes[1] < 0) { 200cc6c: 80 a2 20 00 cmp %o0, 0 200cc70: 06 80 00 17 bl 200cccc 200cc74: b8 10 20 00 clr %i4 err = errno; close(filsdes[0]); } unlink(fifopath); 200cc78: 7f ff e9 50 call 20071b8 200cc7c: 90 07 bf f0 add %fp, -16, %o0 } if(err != 0) rtems_set_errno_and_return_minus_one(err); return 0; 200cc80: ba 10 20 00 clr %i5 err = errno; close(filsdes[0]); } unlink(fifopath); } if(err != 0) 200cc84: 80 a7 20 00 cmp %i4, 0 200cc88: 12 80 00 1a bne 200ccf0 200cc8c: 01 00 00 00 nop rtems_set_errno_and_return_minus_one(err); return 0; } 200cc90: b0 10 00 1d mov %i5, %i0 200cc94: 81 c7 e0 08 ret 200cc98: 81 e8 00 00 restore the file node will be deleted after it is closed by all. */ unlink(fifopath); } else { /* Reset open file to blocking mode */ iop = rtems_libio_iop(filsdes[0]); 200cc9c: 03 00 80 7b sethi %hi(0x201ec00), %g1 200cca0: c2 00 60 78 ld [ %g1 + 0x78 ], %g1 ! 201ec78 200cca4: 91 2a 20 06 sll %o0, 6, %o0 200cca8: 10 bf ff ea b 200cc50 200ccac: 82 00 40 08 add %g1, %o0, %g1 } /* Non-blocking open to avoid waiting for writers */ filsdes[0] = open(fifopath, O_RDONLY | O_NONBLOCK); if (filsdes[0] < 0) { err = errno; 200ccb0: 40 00 11 3d call 20111a4 <__errno> 200ccb4: ba 10 20 00 clr %i5 200ccb8: f8 02 00 00 ld [ %o0 ], %i4 /* 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); 200ccbc: 7f ff e9 3f call 20071b8 200ccc0: 90 07 bf f0 add %fp, -16, %o0 err = errno; close(filsdes[0]); } unlink(fifopath); } if(err != 0) 200ccc4: 10 bf ff f1 b 200cc88 200ccc8: 80 a7 20 00 cmp %i4, 0 iop->flags &= ~LIBIO_FLAGS_NO_DELAY; filsdes[1] = open(fifopath, O_WRONLY); if (filsdes[1] < 0) { err = errno; 200cccc: 40 00 11 36 call 20111a4 <__errno> 200ccd0: 01 00 00 00 nop 200ccd4: f8 02 00 00 ld [ %o0 ], %i4 close(filsdes[0]); 200ccd8: 7f ff dc 5a call 2003e40 200ccdc: d0 06 00 00 ld [ %i0 ], %o0 200cce0: 30 bf ff e6 b,a 200cc78 memcpy(fifopath, "/tmp/.fifo", 10); sprintf(fifopath + 10, "%04x", rtems_pipe_no ++); /* Try creating FIFO file until find an available file name */ while (mkfifo(fifopath, S_IRUSR|S_IWUSR) != 0) { if (errno != EEXIST){ 200cce4: 40 00 11 30 call 20111a4 <__errno> 200cce8: b0 10 00 1d mov %i5, %i0 200ccec: 30 bf ff ea b,a 200cc94 close(filsdes[0]); } unlink(fifopath); } if(err != 0) rtems_set_errno_and_return_minus_one(err); 200ccf0: 40 00 11 2d call 20111a4 <__errno> 200ccf4: ba 10 3f ff mov -1, %i5 200ccf8: 10 bf ff e6 b 200cc90 200ccfc: f8 22 00 00 st %i4, [ %o0 ] =============================================================================== 0200e1dc : pipe_control_t *pipe, uint32_t cmd, void *buffer, rtems_libio_t *iop ) { 200e1dc: 9d e3 bf a0 save %sp, -96, %sp if (cmd == FIONREAD) { 200e1e0: 03 10 01 19 sethi %hi(0x40046400), %g1 pipe_control_t *pipe, uint32_t cmd, void *buffer, rtems_libio_t *iop ) { 200e1e4: ba 10 00 18 mov %i0, %i5 if (cmd == FIONREAD) { 200e1e8: 82 10 62 7f or %g1, 0x27f, %g1 200e1ec: 80 a6 40 01 cmp %i1, %g1 200e1f0: 12 80 00 12 bne 200e238 200e1f4: b0 10 3f ea mov -22, %i0 if (buffer == NULL) 200e1f8: 80 a6 a0 00 cmp %i2, 0 200e1fc: 02 80 00 0f be 200e238 200e200: b0 10 3f f2 mov -14, %i0 return -EFAULT; if (! PIPE_LOCK(pipe)) 200e204: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 200e208: 92 10 20 00 clr %o1 200e20c: 94 10 20 00 clr %o2 200e210: 7f ff e9 b0 call 20088d0 200e214: b0 10 3f fc mov -4, %i0 200e218: 80 a2 20 00 cmp %o0, 0 200e21c: 12 80 00 07 bne 200e238 <== NEVER TAKEN 200e220: 01 00 00 00 nop return -EINTR; /* Return length of pipe */ *(unsigned int *)buffer = pipe->Length; 200e224: c2 07 60 0c ld [ %i5 + 0xc ], %g1 PIPE_UNLOCK(pipe); 200e228: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 return 0; 200e22c: b0 10 20 00 clr %i0 if (! PIPE_LOCK(pipe)) return -EINTR; /* Return length of pipe */ *(unsigned int *)buffer = pipe->Length; PIPE_UNLOCK(pipe); 200e230: 7f ff e9 f2 call 20089f8 200e234: c2 26 80 00 st %g1, [ %i2 ] return 0; } return -EINVAL; } 200e238: 81 c7 e0 08 ret 200e23c: 81 e8 00 00 restore =============================================================================== 0200de1c : pipe_control_t *pipe, void *buffer, size_t count, rtems_libio_t *iop ) { 200de1c: 9d e3 bf 98 save %sp, -104, %sp int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) 200de20: d0 06 20 28 ld [ %i0 + 0x28 ], %o0 pipe_control_t *pipe, void *buffer, size_t count, rtems_libio_t *iop ) { 200de24: ba 10 00 18 mov %i0, %i5 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) 200de28: 92 10 20 00 clr %o1 200de2c: 94 10 20 00 clr %o2 200de30: 7f ff ea a8 call 20088d0 200de34: b0 10 3f fc mov -4, %i0 200de38: 80 a2 20 00 cmp %o0, 0 200de3c: 12 80 00 2c bne 200deec <== NEVER TAKEN 200de40: a0 10 20 00 clr %l0 return -EINTR; while (read < count) { 200de44: 80 a6 a0 00 cmp %i2, 0 200de48: 02 80 00 52 be 200df90 <== NEVER TAKEN 200de4c: b0 10 20 00 clr %i0 while (PIPE_EMPTY(pipe)) { 200de50: f8 07 60 0c ld [ %i5 + 0xc ], %i4 200de54: 80 a7 20 00 cmp %i4, 0 200de58: 12 80 00 29 bne 200defc 200de5c: 82 26 80 10 sub %i2, %l0, %g1 /* Not an error */ if (pipe->Writers == 0) 200de60: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 200de64: 80 a0 60 00 cmp %g1, 0 200de68: 22 80 00 1c be,a 200ded8 200de6c: b8 10 20 00 clr %i4 goto out_locked; if (LIBIO_NODELAY(iop)) { 200de70: c2 06 e0 18 ld [ %i3 + 0x18 ], %g1 200de74: 80 88 60 01 btst 1, %g1 200de78: 32 80 00 18 bne,a 200ded8 200de7c: b8 10 3f f5 mov -11, %i4 ret = -EAGAIN; goto out_locked; } /* Wait until pipe is no more empty or no writer exists */ pipe->waitingReaders ++; 200de80: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 PIPE_UNLOCK(pipe); 200de84: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 ret = -EAGAIN; goto out_locked; } /* Wait until pipe is no more empty or no writer exists */ pipe->waitingReaders ++; 200de88: 82 00 60 01 inc %g1 PIPE_UNLOCK(pipe); 200de8c: 7f ff ea db call 20089f8 200de90: c2 27 60 18 st %g1, [ %i5 + 0x18 ] if (! PIPE_READWAIT(pipe)) 200de94: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 200de98: 40 00 06 0d call 200f6cc 200de9c: 92 10 20 00 clr %o1 200dea0: 80 a0 00 08 cmp %g0, %o0 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 200dea4: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 } /* Wait until pipe is no more empty or no writer exists */ pipe->waitingReaders ++; PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) 200dea8: b8 60 20 00 subx %g0, 0, %i4 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 200deac: 92 10 20 00 clr %o1 200deb0: 94 10 20 00 clr %o2 200deb4: 7f ff ea 87 call 20088d0 200deb8: b8 0f 3f fc and %i4, -4, %i4 200debc: 80 a2 20 00 cmp %o0, 0 200dec0: 12 80 00 36 bne 200df98 <== NEVER TAKEN 200dec4: 80 a7 20 00 cmp %i4, 0 /* WARN waitingReaders not restored! */ ret = -EINTR; goto out_nolock; } pipe->waitingReaders --; 200dec8: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 200decc: 82 00 7f ff add %g1, -1, %g1 if (ret != 0) 200ded0: 02 bf ff e0 be 200de50 <== ALWAYS TAKEN 200ded4: c2 27 60 18 st %g1, [ %i5 + 0x18 ] PIPE_WAKEUPWRITERS(pipe); read += chunk; } out_locked: PIPE_UNLOCK(pipe); 200ded8: 7f ff ea c8 call 20089f8 200dedc: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 out_nolock: if (read > 0) 200dee0: 80 a6 20 00 cmp %i0, 0 200dee4: 04 80 00 04 ble 200def4 200dee8: 01 00 00 00 nop return read; return ret; } 200deec: 81 c7 e0 08 ret 200def0: 81 e8 00 00 restore 200def4: 81 c7 e0 08 ret 200def8: 91 e8 00 1c restore %g0, %i4, %o0 if (ret != 0) goto out_locked; } /* Read chunk bytes */ chunk = MIN(count - read, pipe->Length); 200defc: 80 a7 00 01 cmp %i4, %g1 200df00: 38 80 00 02 bgu,a 200df08 200df04: b8 10 00 01 mov %g1, %i4 chunk1 = pipe->Size - pipe->Start; 200df08: c2 07 60 08 ld [ %i5 + 8 ], %g1 200df0c: e2 07 60 04 ld [ %i5 + 4 ], %l1 200df10: a2 24 40 01 sub %l1, %g1, %l1 if (chunk > chunk1) { 200df14: 80 a7 00 11 cmp %i4, %l1 200df18: 04 80 00 22 ble 200dfa0 200df1c: d2 07 40 00 ld [ %i5 ], %o1 memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk1); 200df20: 94 10 00 11 mov %l1, %o2 200df24: 92 02 40 01 add %o1, %g1, %o1 200df28: 40 00 12 83 call 2012934 200df2c: 90 06 40 10 add %i1, %l0, %o0 memcpy(buffer + read + chunk1, pipe->Buffer, chunk - chunk1); 200df30: d2 07 40 00 ld [ %i5 ], %o1 200df34: 90 04 00 11 add %l0, %l1, %o0 200df38: 94 27 00 11 sub %i4, %l1, %o2 200df3c: 40 00 12 7e call 2012934 200df40: 90 06 40 08 add %i1, %o0, %o0 } else memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk); pipe->Start += chunk; 200df44: d0 07 60 08 ld [ %i5 + 8 ], %o0 pipe->Start %= pipe->Size; 200df48: d2 07 60 04 ld [ %i5 + 4 ], %o1 200df4c: 40 00 40 52 call 201e094 <.urem> 200df50: 90 07 00 08 add %i4, %o0, %o0 pipe->Length -= chunk; 200df54: c2 07 60 0c ld [ %i5 + 0xc ], %g1 } else memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk); pipe->Start += chunk; pipe->Start %= pipe->Size; 200df58: d0 27 60 08 st %o0, [ %i5 + 8 ] pipe->Length -= chunk; 200df5c: 82 20 40 1c sub %g1, %i4, %g1 /* For buffering optimization */ if (PIPE_EMPTY(pipe)) 200df60: 80 a0 60 00 cmp %g1, 0 200df64: 12 80 00 03 bne 200df70 200df68: c2 27 60 0c st %g1, [ %i5 + 0xc ] pipe->Start = 0; 200df6c: c0 27 60 08 clr [ %i5 + 8 ] if (pipe->waitingWriters > 0) 200df70: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 200df74: 80 a0 60 00 cmp %g1, 0 200df78: 32 80 00 10 bne,a 200dfb8 200df7c: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 PIPE_WAKEUPWRITERS(pipe); read += chunk; 200df80: b0 06 00 1c add %i0, %i4, %i0 int chunk, chunk1, read = 0, ret = 0; if (! PIPE_LOCK(pipe)) return -EINTR; while (read < count) { 200df84: 80 a6 00 1a cmp %i0, %i2 200df88: 0a bf ff b2 bcs 200de50 <== NEVER TAKEN 200df8c: a0 10 00 18 mov %i0, %l0 while (PIPE_EMPTY(pipe)) { /* Not an error */ if (pipe->Writers == 0) 200df90: 10 bf ff d2 b 200ded8 200df94: b8 10 20 00 clr %i4 PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) ret = -EINTR; if (! PIPE_LOCK(pipe)) { /* WARN waitingReaders not restored! */ ret = -EINTR; 200df98: 10 bf ff d2 b 200dee0 <== NOT EXECUTED 200df9c: b8 10 3f fc mov -4, %i4 <== NOT EXECUTED 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); 200dfa0: 90 06 40 10 add %i1, %l0, %o0 200dfa4: 92 02 40 01 add %o1, %g1, %o1 200dfa8: 40 00 12 63 call 2012934 200dfac: 94 10 00 1c mov %i4, %o2 pipe->Start += chunk; 200dfb0: 10 bf ff e6 b 200df48 200dfb4: d0 07 60 08 ld [ %i5 + 8 ], %o0 /* For buffering optimization */ if (PIPE_EMPTY(pipe)) pipe->Start = 0; if (pipe->waitingWriters > 0) PIPE_WAKEUPWRITERS(pipe); 200dfb8: 40 00 05 ae call 200f670 200dfbc: 92 07 bf fc add %fp, -4, %o1 read += chunk; 200dfc0: 10 bf ff f1 b 200df84 200dfc4: b0 06 00 1c add %i0, %i4, %i0 =============================================================================== 0200d840 : */ void pipe_release( pipe_control_t **pipep, rtems_libio_t *iop ) { 200d840: 9d e3 bf 98 save %sp, -104, %sp /* WARN pipe not released! */ if (!PIPE_LOCK(pipe)) rtems_fatal_error_occurred(0xdeadbeef); #endif mode = LIBIO_ACCMODE(iop); 200d844: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 void pipe_release( pipe_control_t **pipep, rtems_libio_t *iop ) { pipe_control_t *pipe = *pipep; 200d848: fa 06 00 00 ld [ %i0 ], %i5 if (!PIPE_LOCK(pipe)) rtems_fatal_error_occurred(0xdeadbeef); #endif mode = LIBIO_ACCMODE(iop); if (mode & LIBIO_FLAGS_READ) 200d84c: 80 88 60 02 btst 2, %g1 200d850: 02 80 00 05 be 200d864 200d854: b8 08 60 06 and %g1, 6, %i4 pipe->Readers --; 200d858: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 200d85c: 82 00 7f ff add %g1, -1, %g1 200d860: c2 27 60 10 st %g1, [ %i5 + 0x10 ] if (mode & LIBIO_FLAGS_WRITE) 200d864: 80 8f 20 04 btst 4, %i4 200d868: 02 80 00 05 be 200d87c 200d86c: 01 00 00 00 nop pipe->Writers --; 200d870: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 200d874: 82 00 7f ff add %g1, -1, %g1 200d878: c2 27 60 14 st %g1, [ %i5 + 0x14 ] PIPE_UNLOCK(pipe); 200d87c: 7f ff ec 5f call 20089f8 200d880: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 if (pipe->Readers == 0 && pipe->Writers == 0) { 200d884: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 200d888: 80 a0 60 00 cmp %g1, 0 200d88c: 12 80 00 0c bne 200d8bc 200d890: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 200d894: 80 a0 60 00 cmp %g1, 0 200d898: 02 80 00 1d be 200d90c 200d89c: 80 a7 20 04 cmp %i4, 4 delfile = TRUE; #endif pipe_free(pipe); *pipep = NULL; } else if (pipe->Readers == 0 && mode != LIBIO_FLAGS_WRITE) 200d8a0: 32 80 00 14 bne,a 200d8f0 <== ALWAYS TAKEN 200d8a4: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 static void pipe_unlock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_release(pipe_semaphore); 200d8a8: 03 00 80 88 sethi %hi(0x2022000), %g1 <== NOT EXECUTED 200d8ac: 7f ff ec 53 call 20089f8 <== NOT EXECUTED 200d8b0: d0 00 62 2c ld [ %g1 + 0x22c ], %o0 ! 202222c <== NOT EXECUTED iop->flags &= ~LIBIO_FLAGS_OPEN; if(iop->pathinfo.ops->unlink_h(&iop->pathinfo)) return; #endif } 200d8b4: 81 c7 e0 08 ret <== NOT EXECUTED 200d8b8: 81 e8 00 00 restore <== NOT EXECUTED *pipep = NULL; } else if (pipe->Readers == 0 && mode != LIBIO_FLAGS_WRITE) /* Notify waiting Writers that all their partners left */ PIPE_WAKEUPWRITERS(pipe); else if (pipe->Writers == 0 && mode != LIBIO_FLAGS_READ) 200d8bc: 80 a0 60 00 cmp %g1, 0 200d8c0: 12 bf ff fa bne 200d8a8 <== NEVER TAKEN 200d8c4: 80 a7 20 02 cmp %i4, 2 200d8c8: 02 bf ff f9 be 200d8ac <== NEVER TAKEN 200d8cc: 03 00 80 88 sethi %hi(0x2022000), %g1 PIPE_WAKEUPREADERS(pipe); 200d8d0: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 200d8d4: 40 00 07 67 call 200f670 200d8d8: 92 07 bf fc add %fp, -4, %o1 static void pipe_unlock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_release(pipe_semaphore); 200d8dc: 03 00 80 88 sethi %hi(0x2022000), %g1 200d8e0: 7f ff ec 46 call 20089f8 200d8e4: d0 00 62 2c ld [ %g1 + 0x22c ], %o0 ! 202222c iop->flags &= ~LIBIO_FLAGS_OPEN; if(iop->pathinfo.ops->unlink_h(&iop->pathinfo)) return; #endif } 200d8e8: 81 c7 e0 08 ret 200d8ec: 81 e8 00 00 restore pipe_free(pipe); *pipep = NULL; } else if (pipe->Readers == 0 && mode != LIBIO_FLAGS_WRITE) /* Notify waiting Writers that all their partners left */ PIPE_WAKEUPWRITERS(pipe); 200d8f0: 40 00 07 60 call 200f670 200d8f4: 92 07 bf fc add %fp, -4, %o1 static void pipe_unlock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_release(pipe_semaphore); 200d8f8: 03 00 80 88 sethi %hi(0x2022000), %g1 200d8fc: 7f ff ec 3f call 20089f8 200d900: d0 00 62 2c ld [ %g1 + 0x22c ], %o0 ! 202222c iop->flags &= ~LIBIO_FLAGS_OPEN; if(iop->pathinfo.ops->unlink_h(&iop->pathinfo)) return; #endif } 200d904: 81 c7 e0 08 ret 200d908: 81 e8 00 00 restore /* Called with pipe_semaphore held. */ static inline void pipe_free( pipe_control_t *pipe ) { rtems_barrier_delete(pipe->readBarrier); 200d90c: 40 00 07 30 call 200f5cc 200d910: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 rtems_barrier_delete(pipe->writeBarrier); 200d914: 40 00 07 2e call 200f5cc 200d918: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 rtems_semaphore_delete(pipe->Semaphore); 200d91c: 7f ff eb b6 call 20087f4 200d920: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 free(pipe->Buffer); 200d924: 7f ff dc 20 call 20049a4 200d928: d0 07 40 00 ld [ %i5 ], %o0 free(pipe); 200d92c: 7f ff dc 1e call 20049a4 200d930: 90 10 00 1d mov %i5, %o0 static void pipe_unlock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_release(pipe_semaphore); 200d934: 03 00 80 88 sethi %hi(0x2022000), %g1 200d938: d0 00 62 2c ld [ %g1 + 0x22c ], %o0 ! 202222c 200d93c: 7f ff ec 2f call 20089f8 200d940: c0 26 00 00 clr [ %i0 ] iop->flags &= ~LIBIO_FLAGS_OPEN; if(iop->pathinfo.ops->unlink_h(&iop->pathinfo)) return; #endif } 200d944: 81 c7 e0 08 ret 200d948: 81 e8 00 00 restore =============================================================================== 0200dfc8 : pipe_control_t *pipe, const void *buffer, size_t count, rtems_libio_t *iop ) { 200dfc8: 9d e3 bf 98 save %sp, -104, %sp 200dfcc: ba 10 00 18 mov %i0, %i5 int chunk, chunk1, written = 0, ret = 0; /* Write nothing */ if (count == 0) 200dfd0: 80 a6 a0 00 cmp %i2, 0 200dfd4: 12 80 00 04 bne 200dfe4 <== ALWAYS TAKEN 200dfd8: b0 10 20 00 clr %i0 #endif if (written > 0) return written; return ret; } 200dfdc: 81 c7 e0 08 ret 200dfe0: 81 e8 00 00 restore /* Write nothing */ if (count == 0) return 0; if (! PIPE_LOCK(pipe)) 200dfe4: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 200dfe8: 92 10 20 00 clr %o1 200dfec: 94 10 20 00 clr %o2 200dff0: 7f ff ea 38 call 20088d0 200dff4: b0 10 3f fc mov -4, %i0 200dff8: 80 a2 20 00 cmp %o0, 0 200dffc: 12 bf ff f8 bne 200dfdc <== NEVER TAKEN 200e000: 01 00 00 00 nop return -EINTR; if (pipe->Readers == 0) { 200e004: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 200e008: 80 a0 60 00 cmp %g1, 0 200e00c: 02 80 00 60 be 200e18c 200e010: b8 10 3f e0 mov -32, %i4 ret = -EPIPE; goto out_locked; } /* Write of PIPE_BUF bytes or less shall not be interleaved */ chunk = count <= pipe->Size ? count : 1; 200e014: e4 07 60 04 ld [ %i5 + 4 ], %l2 200e018: 80 a6 80 12 cmp %i2, %l2 200e01c: 08 80 00 5a bleu 200e184 <== ALWAYS TAKEN 200e020: a0 10 20 01 mov 1, %l0 200e024: a2 10 20 00 clr %l1 200e028: b0 10 20 00 clr %i0 while (written < count) { while (PIPE_SPACE(pipe) < chunk) { 200e02c: c2 07 60 0c ld [ %i5 + 0xc ], %g1 200e030: b8 24 80 01 sub %l2, %g1, %i4 200e034: 80 a7 00 10 cmp %i4, %l0 200e038: 1a 80 00 27 bcc 200e0d4 200e03c: 84 26 80 11 sub %i2, %l1, %g2 if (LIBIO_NODELAY(iop)) { 200e040: c2 06 e0 18 ld [ %i3 + 0x18 ], %g1 200e044: 80 88 60 01 btst 1, %g1 200e048: 32 80 00 45 bne,a 200e15c 200e04c: b8 10 3f f5 mov -11, %i4 ret = -EAGAIN; goto out_locked; } /* Wait until there is chunk bytes space or no reader exists */ pipe->waitingWriters ++; 200e050: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 PIPE_UNLOCK(pipe); 200e054: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 ret = -EAGAIN; goto out_locked; } /* Wait until there is chunk bytes space or no reader exists */ pipe->waitingWriters ++; 200e058: 82 00 60 01 inc %g1 PIPE_UNLOCK(pipe); 200e05c: 7f ff ea 67 call 20089f8 200e060: c2 27 60 1c st %g1, [ %i5 + 0x1c ] if (! PIPE_WRITEWAIT(pipe)) 200e064: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 200e068: 40 00 05 99 call 200f6cc 200e06c: 92 10 20 00 clr %o1 200e070: 80 a0 00 08 cmp %g0, %o0 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 200e074: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 } /* Wait until there is chunk bytes space or no reader exists */ pipe->waitingWriters ++; PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) 200e078: b8 60 20 00 subx %g0, 0, %i4 ret = -EINTR; if (! PIPE_LOCK(pipe)) { 200e07c: 92 10 20 00 clr %o1 200e080: 94 10 20 00 clr %o2 200e084: 7f ff ea 13 call 20088d0 200e088: b8 0f 3f fc and %i4, -4, %i4 200e08c: 80 a2 20 00 cmp %o0, 0 200e090: 12 80 00 47 bne 200e1ac <== NEVER TAKEN 200e094: 80 a7 20 00 cmp %i4, 0 /* WARN waitingWriters not restored! */ ret = -EINTR; goto out_nolock; } pipe->waitingWriters --; 200e098: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 200e09c: 82 00 7f ff add %g1, -1, %g1 if (ret != 0) 200e0a0: 12 80 00 2f bne 200e15c <== NEVER TAKEN 200e0a4: c2 27 60 1c st %g1, [ %i5 + 0x1c ] goto out_locked; if (pipe->Readers == 0) { 200e0a8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 200e0ac: 80 a0 60 00 cmp %g1, 0 200e0b0: 02 80 00 2b be 200e15c <== NEVER TAKEN 200e0b4: b8 10 3f e0 mov -32, %i4 200e0b8: e4 07 60 04 ld [ %i5 + 4 ], %l2 /* 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) { 200e0bc: c2 07 60 0c ld [ %i5 + 0xc ], %g1 200e0c0: b8 24 80 01 sub %l2, %g1, %i4 200e0c4: 80 a7 00 10 cmp %i4, %l0 200e0c8: 2a bf ff df bcs,a 200e044 <== NEVER TAKEN 200e0cc: c2 06 e0 18 ld [ %i3 + 0x18 ], %g1 <== NOT EXECUTED ret = -EPIPE; goto out_locked; } } chunk = MIN(count - written, PIPE_SPACE(pipe)); 200e0d0: 84 26 80 11 sub %i2, %l1, %g2 200e0d4: 80 a7 00 02 cmp %i4, %g2 200e0d8: 38 80 00 02 bgu,a 200e0e0 200e0dc: b8 10 00 02 mov %g2, %i4 chunk1 = pipe->Size - PIPE_WSTART(pipe); 200e0e0: d0 07 60 08 ld [ %i5 + 8 ], %o0 200e0e4: 92 10 00 12 mov %l2, %o1 200e0e8: 40 00 3f eb call 201e094 <.urem> 200e0ec: 90 00 40 08 add %g1, %o0, %o0 if (chunk > chunk1) { memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk1); 200e0f0: c2 07 40 00 ld [ %i5 ], %g1 goto out_locked; } } chunk = MIN(count - written, PIPE_SPACE(pipe)); chunk1 = pipe->Size - PIPE_WSTART(pipe); 200e0f4: a0 24 80 08 sub %l2, %o0, %l0 if (chunk > chunk1) { 200e0f8: 80 a7 00 10 cmp %i4, %l0 200e0fc: 04 80 00 2e ble 200e1b4 200e100: 92 06 40 11 add %i1, %l1, %o1 memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk1); 200e104: 94 10 00 10 mov %l0, %o2 200e108: 40 00 12 0b call 2012934 200e10c: 90 00 40 08 add %g1, %o0, %o0 memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1); 200e110: d0 07 40 00 ld [ %i5 ], %o0 200e114: 92 04 00 11 add %l0, %l1, %o1 200e118: 94 27 00 10 sub %i4, %l0, %o2 200e11c: 40 00 12 06 call 2012934 200e120: 92 06 40 09 add %i1, %o1, %o1 } else memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk); pipe->Length += chunk; 200e124: c4 07 60 0c ld [ %i5 + 0xc ], %g2 if (pipe->waitingReaders > 0) 200e128: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1); } else memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk); pipe->Length += chunk; 200e12c: 84 00 80 1c add %g2, %i4, %g2 if (pipe->waitingReaders > 0) 200e130: 80 a0 60 00 cmp %g1, 0 200e134: 12 80 00 25 bne 200e1c8 200e138: c4 27 60 0c st %g2, [ %i5 + 0xc ] PIPE_WAKEUPREADERS(pipe); written += chunk; 200e13c: b0 06 00 1c add %i0, %i4, %i0 } /* Write of PIPE_BUF bytes or less shall not be interleaved */ chunk = count <= pipe->Size ? count : 1; while (written < count) { 200e140: 80 a6 80 18 cmp %i2, %i0 200e144: 08 80 00 05 bleu 200e158 <== ALWAYS TAKEN 200e148: a2 10 00 18 mov %i0, %l1 200e14c: e4 07 60 04 ld [ %i5 + 4 ], %l2 <== NOT EXECUTED pipe->Length += chunk; if (pipe->waitingReaders > 0) PIPE_WAKEUPREADERS(pipe); written += chunk; /* Write of more than PIPE_BUF bytes can be interleaved */ chunk = 1; 200e150: 10 bf ff b7 b 200e02c <== NOT EXECUTED 200e154: a0 10 20 01 mov 1, %l0 <== NOT EXECUTED } /* Write of PIPE_BUF bytes or less shall not be interleaved */ chunk = count <= pipe->Size ? count : 1; while (written < count) { 200e158: b8 10 20 00 clr %i4 /* Write of more than PIPE_BUF bytes can be interleaved */ chunk = 1; } out_locked: PIPE_UNLOCK(pipe); 200e15c: 7f ff ea 27 call 20089f8 200e160: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 out_nolock: #ifdef RTEMS_POSIX_API /* Signal SIGPIPE */ if (ret == -EPIPE) 200e164: 80 a7 3f e0 cmp %i4, -32 200e168: 02 80 00 0b be 200e194 200e16c: 01 00 00 00 nop kill(getpid(), SIGPIPE); #endif if (written > 0) 200e170: 80 a6 20 00 cmp %i0, 0 200e174: 14 bf ff 9a bg 200dfdc 200e178: 01 00 00 00 nop return written; return ret; } 200e17c: 81 c7 e0 08 ret 200e180: 91 e8 00 1c restore %g0, %i4, %o0 ret = -EPIPE; goto out_locked; } /* Write of PIPE_BUF bytes or less shall not be interleaved */ chunk = count <= pipe->Size ? count : 1; 200e184: 10 bf ff a8 b 200e024 200e188: a0 10 00 1a mov %i2, %l0 const void *buffer, size_t count, rtems_libio_t *iop ) { int chunk, chunk1, written = 0, ret = 0; 200e18c: 10 bf ff f4 b 200e15c 200e190: b0 10 20 00 clr %i0 out_nolock: #ifdef RTEMS_POSIX_API /* Signal SIGPIPE */ if (ret == -EPIPE) kill(getpid(), SIGPIPE); 200e194: 40 00 02 25 call 200ea28 200e198: 01 00 00 00 nop 200e19c: 40 00 03 03 call 200eda8 200e1a0: 92 10 20 0d mov 0xd, %o1 ! d #endif if (written > 0) 200e1a4: 10 bf ff f4 b 200e174 200e1a8: 80 a6 20 00 cmp %i0, 0 PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) ret = -EINTR; if (! PIPE_LOCK(pipe)) { /* WARN waitingWriters not restored! */ ret = -EINTR; 200e1ac: 10 bf ff f1 b 200e170 <== NOT EXECUTED 200e1b0: b8 10 3f fc mov -4, %i4 <== NOT EXECUTED if (chunk > chunk1) { memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk1); memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1); } else memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk); 200e1b4: 90 00 40 08 add %g1, %o0, %o0 200e1b8: 40 00 11 df call 2012934 200e1bc: 94 10 00 1c mov %i4, %o2 pipe->Length += chunk; 200e1c0: 10 bf ff da b 200e128 200e1c4: c4 07 60 0c ld [ %i5 + 0xc ], %g2 if (pipe->waitingReaders > 0) PIPE_WAKEUPREADERS(pipe); 200e1c8: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 200e1cc: 40 00 05 29 call 200f670 200e1d0: 92 07 bf fc add %fp, -4, %o1 written += chunk; 200e1d4: 10 bf ff db b 200e140 200e1d8: b0 06 00 1c add %i0, %i4, %i0 =============================================================================== 0200748c : ) { /* * Update call statistics */ MSBUMP(memalign_calls, 1); 200748c: 05 00 80 90 sethi %hi(0x2024000), %g2 2007490: 84 10 a3 e8 or %g2, 0x3e8, %g2 ! 20243e8 2007494: c6 00 a0 08 ld [ %g2 + 8 ], %g3 2007498: 86 00 e0 01 inc %g3 200749c: c6 20 a0 08 st %g3, [ %g2 + 8 ] if (((alignment - 1) & alignment) != 0 || (alignment < sizeof(void *))) 20074a0: 84 02 7f ff add %o1, -1, %g2 20074a4: 80 88 80 09 btst %g2, %o1 20074a8: 22 80 00 04 be,a 20074b8 <== ALWAYS TAKEN 20074ac: 80 a2 60 03 cmp %o1, 3 /* * rtems_memalign does all of the error checking work EXCEPT * for adding restrictionso on the alignment. */ return rtems_memalign( pointer, alignment, size ); } 20074b0: 81 c3 e0 08 retl 20074b4: 90 10 20 16 mov 0x16, %o0 /* * Update call statistics */ MSBUMP(memalign_calls, 1); if (((alignment - 1) & alignment) != 0 || (alignment < sizeof(void *))) 20074b8: 08 bf ff fe bleu 20074b0 20074bc: 01 00 00 00 nop /* * rtems_memalign does all of the error checking work EXCEPT * for adding restrictionso on the alignment. */ return rtems_memalign( pointer, alignment, size ); 20074c0: 82 13 c0 00 mov %o7, %g1 20074c4: 40 00 00 8c call 20076f4 20074c8: 9e 10 40 00 mov %g1, %o7 =============================================================================== 0200b90c : int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { 200b90c: 82 10 00 08 mov %o0, %g1 if ( !attr || !attr->is_initialized ) 200b910: 80 a0 60 00 cmp %g1, 0 200b914: 02 80 00 06 be 200b92c 200b918: 90 10 20 16 mov 0x16, %o0 200b91c: c4 00 40 00 ld [ %g1 ], %g2 200b920: 80 a0 a0 00 cmp %g2, 0 200b924: 12 80 00 04 bne 200b934 200b928: 80 a2 60 04 cmp %o1, 4 return 0; default: return ENOTSUP; } } 200b92c: 81 c3 e0 08 retl 200b930: 01 00 00 00 nop ) { if ( !attr || !attr->is_initialized ) return EINVAL; switch ( policy ) { 200b934: 18 80 00 09 bgu 200b958 200b938: 84 10 20 01 mov 1, %g2 ! 1 200b93c: 85 28 80 09 sll %g2, %o1, %g2 200b940: 80 88 a0 17 btst 0x17, %g2 200b944: 02 80 00 05 be 200b958 <== NEVER TAKEN 200b948: 01 00 00 00 nop case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; 200b94c: d2 20 60 14 st %o1, [ %g1 + 0x14 ] return 0; 200b950: 81 c3 e0 08 retl 200b954: 90 10 20 00 clr %o0 default: return ENOTSUP; } } 200b958: 81 c3 e0 08 retl 200b95c: 90 10 20 86 mov 0x86, %o0 =============================================================================== 02006848 : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 2006848: 9d e3 bf 90 save %sp, -112, %sp 200684c: ba 10 00 18 mov %i0, %i5 const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 2006850: 80 a7 60 00 cmp %i5, 0 2006854: 02 80 00 27 be 20068f0 2006858: b0 10 20 16 mov 0x16, %i0 return EINVAL; if ( count == 0 ) 200685c: 80 a6 a0 00 cmp %i2, 0 2006860: 02 80 00 24 be 20068f0 2006864: 80 a6 60 00 cmp %i1, 0 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 2006868: 02 80 00 24 be 20068f8 200686c: 90 07 bf f8 add %fp, -8, %o0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 2006870: c2 06 40 00 ld [ %i1 ], %g1 2006874: 80 a0 60 00 cmp %g1, 0 2006878: 02 80 00 1e be 20068f0 200687c: b0 10 20 16 mov 0x16, %i0 return EINVAL; switch ( the_attr->process_shared ) { 2006880: c2 06 60 04 ld [ %i1 + 4 ], %g1 2006884: 80 a0 60 00 cmp %g1, 0 2006888: 12 80 00 1a bne 20068f0 <== NEVER TAKEN 200688c: 03 00 80 60 sethi %hi(0x2018000), %g1 /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 2006890: c4 00 63 e0 ld [ %g1 + 0x3e0 ], %g2 ! 20183e0 <_Thread_Dispatch_disable_level> } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 2006894: c0 27 bf f0 clr [ %fp + -16 ] 2006898: 84 00 a0 01 inc %g2 the_attributes.maximum_count = count; 200689c: f4 27 bf f4 st %i2, [ %fp + -12 ] 20068a0: c4 20 63 e0 st %g2, [ %g1 + 0x3e0 ] return _Thread_Dispatch_disable_level; 20068a4: c2 00 63 e0 ld [ %g1 + 0x3e0 ], %g1 * This function allocates a barrier control block from * the inactive chain of free barrier control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Allocate( void ) { return (POSIX_Barrier_Control *) 20068a8: 37 00 80 61 sethi %hi(0x2018400), %i3 20068ac: 40 00 08 bd call 2008ba0 <_Objects_Allocate> 20068b0: 90 16 e3 a0 or %i3, 0x3a0, %o0 ! 20187a0 <_POSIX_Barrier_Information> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 20068b4: b8 92 20 00 orcc %o0, 0, %i4 20068b8: 02 80 00 14 be 2006908 20068bc: 90 07 20 10 add %i4, 0x10, %o0 _Thread_Enable_dispatch(); return EAGAIN; } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 20068c0: 40 00 06 04 call 20080d0 <_CORE_barrier_Initialize> 20068c4: 92 07 bf f0 add %fp, -16, %o1 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 20068c8: c4 17 20 0a lduh [ %i4 + 0xa ], %g2 * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; _Thread_Enable_dispatch(); return 0; } 20068cc: b6 16 e3 a0 or %i3, 0x3a0, %i3 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 20068d0: c6 06 e0 1c ld [ %i3 + 0x1c ], %g3 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 20068d4: c2 07 20 08 ld [ %i4 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 20068d8: 85 28 a0 02 sll %g2, 2, %g2 20068dc: f8 20 c0 02 st %i4, [ %g3 + %g2 ] _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 20068e0: c0 27 20 0c clr [ %i4 + 0xc ] ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 20068e4: c2 27 40 00 st %g1, [ %i5 ] _Thread_Enable_dispatch(); 20068e8: 40 00 0d 95 call 2009f3c <_Thread_Enable_dispatch> 20068ec: b0 10 20 00 clr %i0 return 0; } 20068f0: 81 c7 e0 08 ret 20068f4: 81 e8 00 00 restore * If the user passed in NULL, use the default attributes */ if ( attr ) { the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 20068f8: 7f ff ff 9c call 2006768 20068fc: b2 07 bf f8 add %fp, -8, %i1 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 2006900: 10 bf ff dd b 2006874 2006904: c2 06 40 00 ld [ %i1 ], %g1 _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { _Thread_Enable_dispatch(); 2006908: 40 00 0d 8d call 2009f3c <_Thread_Enable_dispatch> 200690c: b0 10 20 0b mov 0xb, %i0 return EAGAIN; 2006910: 81 c7 e0 08 ret 2006914: 81 e8 00 00 restore =============================================================================== 020060c8 : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { 20060c8: 9d e3 bf a0 save %sp, -96, %sp /* * The POSIX standard does not address what to do when the routine * is NULL. It also does not address what happens when we cannot * allocate memory or anything else bad happens. */ if ( !routine ) 20060cc: 80 a6 20 00 cmp %i0, 0 20060d0: 02 80 00 16 be 2006128 20060d4: 01 00 00 00 nop /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 20060d8: 03 00 80 62 sethi %hi(0x2018800), %g1 20060dc: c4 00 60 50 ld [ %g1 + 0x50 ], %g2 ! 2018850 <_Thread_Dispatch_disable_level> 20060e0: 84 00 a0 01 inc %g2 20060e4: c4 20 60 50 st %g2, [ %g1 + 0x50 ] return _Thread_Dispatch_disable_level; 20060e8: c2 00 60 50 ld [ %g1 + 0x50 ], %g1 return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); 20060ec: 40 00 12 c9 call 200ac10 <_Workspace_Allocate> 20060f0: 90 10 20 10 mov 0x10, %o0 if ( handler ) { 20060f4: 80 a2 20 00 cmp %o0, 0 20060f8: 02 80 00 0a be 2006120 <== NEVER TAKEN 20060fc: 01 00 00 00 nop thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 2006100: 03 00 80 63 sethi %hi(0x2018c00), %g1 2006104: c2 00 61 94 ld [ %g1 + 0x194 ], %g1 ! 2018d94 <_Per_CPU_Information+0xc> handler_stack = &thread_support->Cancellation_Handlers; handler->routine = routine; handler->arg = arg; _Chain_Append( handler_stack, &handler->Node ); 2006108: 92 10 00 08 mov %o0, %o1 handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); if ( handler ) { thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 200610c: c2 00 61 5c ld [ %g1 + 0x15c ], %g1 handler->routine = routine; 2006110: f0 22 20 08 st %i0, [ %o0 + 8 ] handler->arg = arg; 2006114: f2 22 20 0c st %i1, [ %o0 + 0xc ] _Chain_Append( handler_stack, &handler->Node ); 2006118: 40 00 06 36 call 20079f0 <_Chain_Append> 200611c: 90 00 60 e4 add %g1, 0xe4, %o0 } _Thread_Enable_dispatch(); 2006120: 40 00 0d c5 call 2009834 <_Thread_Enable_dispatch> 2006124: 81 e8 00 00 restore 2006128: 81 c7 e0 08 ret 200612c: 81 e8 00 00 restore =============================================================================== 02007050 : int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 2007050: 9d e3 bf a0 save %sp, -96, %sp POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; 2007054: 80 a6 60 00 cmp %i1, 0 2007058: 02 80 00 27 be 20070f4 200705c: ba 10 00 18 mov %i0, %i5 else the_attr = &_POSIX_Condition_variables_Default_attributes; /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 2007060: c2 06 60 04 ld [ %i1 + 4 ], %g1 2007064: 80 a0 60 01 cmp %g1, 1 2007068: 02 80 00 21 be 20070ec <== NEVER TAKEN 200706c: b0 10 20 16 mov 0x16, %i0 return EINVAL; if ( !the_attr->is_initialized ) 2007070: c2 06 40 00 ld [ %i1 ], %g1 2007074: 80 a0 60 00 cmp %g1, 0 2007078: 02 80 00 1d be 20070ec 200707c: 03 00 80 65 sethi %hi(0x2019400), %g1 /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 2007080: c4 00 61 10 ld [ %g1 + 0x110 ], %g2 ! 2019510 <_Thread_Dispatch_disable_level> 2007084: 84 00 a0 01 inc %g2 2007088: c4 20 61 10 st %g2, [ %g1 + 0x110 ] return _Thread_Dispatch_disable_level; 200708c: c2 00 61 10 ld [ %g1 + 0x110 ], %g1 */ RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) 2007090: 37 00 80 66 sethi %hi(0x2019800), %i3 2007094: 40 00 0a 2b call 2009940 <_Objects_Allocate> 2007098: 90 16 e1 68 or %i3, 0x168, %o0 ! 2019968 <_POSIX_Condition_variables_Information> _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 200709c: b8 92 20 00 orcc %o0, 0, %i4 20070a0: 02 80 00 18 be 2007100 20070a4: 90 07 20 18 add %i4, 0x18, %o0 _Thread_Enable_dispatch(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; 20070a8: c2 06 60 04 ld [ %i1 + 4 ], %g1 the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; _Thread_queue_Initialize( 20070ac: 92 10 20 00 clr %o1 20070b0: 15 04 00 02 sethi %hi(0x10000800), %o2 20070b4: 96 10 20 74 mov 0x74, %o3 if ( !the_cond ) { _Thread_Enable_dispatch(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; 20070b8: c2 27 20 10 st %g1, [ %i4 + 0x10 ] the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; _Thread_queue_Initialize( 20070bc: 40 00 11 32 call 200b584 <_Thread_queue_Initialize> 20070c0: c0 27 20 14 clr [ %i4 + 0x14 ] Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 20070c4: c4 17 20 0a lduh [ %i4 + 0xa ], %g2 *cond = the_cond->Object.id; _Thread_Enable_dispatch(); return 0; } 20070c8: b6 16 e1 68 or %i3, 0x168, %i3 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 20070cc: c6 06 e0 1c ld [ %i3 + 0x1c ], %g3 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 20070d0: c2 07 20 08 ld [ %i4 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 20070d4: 85 28 a0 02 sll %g2, 2, %g2 20070d8: f8 20 c0 02 st %i4, [ %g3 + %g2 ] _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 20070dc: c0 27 20 0c clr [ %i4 + 0xc ] &_POSIX_Condition_variables_Information, &the_cond->Object, 0 ); *cond = the_cond->Object.id; 20070e0: c2 27 40 00 st %g1, [ %i5 ] _Thread_Enable_dispatch(); 20070e4: 40 00 0e fe call 200acdc <_Thread_Enable_dispatch> 20070e8: b0 10 20 00 clr %i0 return 0; } 20070ec: 81 c7 e0 08 ret 20070f0: 81 e8 00 00 restore { POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; else the_attr = &_POSIX_Condition_variables_Default_attributes; 20070f4: 33 00 80 5f sethi %hi(0x2017c00), %i1 20070f8: 10 bf ff da b 2007060 20070fc: b2 16 60 dc or %i1, 0xdc, %i1 ! 2017cdc <_POSIX_Condition_variables_Default_attributes> _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { _Thread_Enable_dispatch(); 2007100: 40 00 0e f7 call 200acdc <_Thread_Enable_dispatch> 2007104: b0 10 20 0c mov 0xc, %i0 return ENOMEM; 2007108: 81 c7 e0 08 ret 200710c: 81 e8 00 00 restore =============================================================================== 02006eb4 : */ int pthread_condattr_destroy( pthread_condattr_t *attr ) { 2006eb4: 82 10 00 08 mov %o0, %g1 if ( !attr || attr->is_initialized == false ) 2006eb8: 80 a0 60 00 cmp %g1, 0 2006ebc: 02 80 00 06 be 2006ed4 2006ec0: 90 10 20 16 mov 0x16, %o0 2006ec4: c4 00 40 00 ld [ %g1 ], %g2 2006ec8: 80 a0 a0 00 cmp %g2, 0 2006ecc: 32 80 00 04 bne,a 2006edc <== ALWAYS TAKEN 2006ed0: c0 20 40 00 clr [ %g1 ] return EINVAL; attr->is_initialized = false; return 0; } 2006ed4: 81 c3 e0 08 retl 2006ed8: 01 00 00 00 nop 2006edc: 81 c3 e0 08 retl 2006ee0: 90 10 20 00 clr %o0 ! 0 =============================================================================== 0200658c : pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { 200658c: 9d e3 bf 58 save %sp, -168, %sp 2006590: ba 10 00 18 mov %i0, %i5 int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) 2006594: 80 a6 a0 00 cmp %i2, 0 2006598: 02 80 00 63 be 2006724 200659c: b0 10 20 0e mov 0xe, %i0 return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 20065a0: 80 a6 60 00 cmp %i1, 0 20065a4: 22 80 00 62 be,a 200672c 20065a8: 33 00 80 72 sethi %hi(0x201c800), %i1 if ( !the_attr->is_initialized ) 20065ac: c2 06 40 00 ld [ %i1 ], %g1 20065b0: 80 a0 60 00 cmp %g1, 0 20065b4: 02 80 00 5c be 2006724 20065b8: b0 10 20 16 mov 0x16, %i0 * stack space if it is allowed to allocate it itself. * * NOTE: If the user provides the stack we will let it drop below * twice the minimum. */ if ( the_attr->stackaddr && !_Stack_Is_enough(the_attr->stacksize) ) 20065bc: c2 06 60 04 ld [ %i1 + 4 ], %g1 20065c0: 80 a0 60 00 cmp %g1, 0 20065c4: 02 80 00 07 be 20065e0 20065c8: 03 00 80 75 sethi %hi(0x201d400), %g1 20065cc: c4 06 60 08 ld [ %i1 + 8 ], %g2 20065d0: c2 00 62 d0 ld [ %g1 + 0x2d0 ], %g1 20065d4: 80 a0 80 01 cmp %g2, %g1 20065d8: 0a 80 00 83 bcs 20067e4 20065dc: 01 00 00 00 nop * If inheritsched is set to PTHREAD_INHERIT_SCHED, then this thread * inherits scheduling attributes from the creating thread. If it is * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the * attributes structure. */ switch ( the_attr->inheritsched ) { 20065e0: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 20065e4: 80 a0 60 01 cmp %g1, 1 20065e8: 02 80 00 53 be 2006734 20065ec: 80 a0 60 02 cmp %g1, 2 20065f0: 12 80 00 4d bne 2006724 20065f4: b0 10 20 16 mov 0x16, %i0 schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; 20065f8: da 06 60 18 ld [ %i1 + 0x18 ], %o5 20065fc: de 06 60 1c ld [ %i1 + 0x1c ], %o7 2006600: f0 06 60 20 ld [ %i1 + 0x20 ], %i0 2006604: c8 06 60 24 ld [ %i1 + 0x24 ], %g4 2006608: c6 06 60 28 ld [ %i1 + 0x28 ], %g3 200660c: c4 06 60 2c ld [ %i1 + 0x2c ], %g2 2006610: c2 06 60 30 ld [ %i1 + 0x30 ], %g1 schedpolicy = api->schedpolicy; schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; 2006614: f8 06 60 14 ld [ %i1 + 0x14 ], %i4 schedparam = the_attr->schedparam; 2006618: da 27 bf dc st %o5, [ %fp + -36 ] 200661c: de 27 bf e0 st %o7, [ %fp + -32 ] 2006620: f0 27 bf e4 st %i0, [ %fp + -28 ] 2006624: c8 27 bf e8 st %g4, [ %fp + -24 ] 2006628: c6 27 bf ec st %g3, [ %fp + -20 ] 200662c: c4 27 bf f0 st %g2, [ %fp + -16 ] 2006630: c2 27 bf f4 st %g1, [ %fp + -12 ] /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) 2006634: c2 06 60 0c ld [ %i1 + 0xc ], %g1 2006638: 80 a0 60 00 cmp %g1, 0 200663c: 12 80 00 3a bne 2006724 2006640: b0 10 20 86 mov 0x86, %i0 return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 2006644: d0 07 bf dc ld [ %fp + -36 ], %o0 2006648: 40 00 1b f3 call 200d614 <_POSIX_Priority_Is_valid> 200664c: b0 10 20 16 mov 0x16, %i0 2006650: 80 8a 20 ff btst 0xff, %o0 2006654: 02 80 00 34 be 2006724 <== NEVER TAKEN 2006658: 03 00 80 75 sethi %hi(0x201d400), %g1 return EINVAL; core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); 200665c: e4 07 bf dc ld [ %fp + -36 ], %l2 RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 2006660: e6 08 62 cc ldub [ %g1 + 0x2cc ], %l3 /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 2006664: 90 10 00 1c mov %i4, %o0 2006668: 92 07 bf dc add %fp, -36, %o1 200666c: 94 07 bf f8 add %fp, -8, %o2 2006670: 40 00 1b f6 call 200d648 <_POSIX_Thread_Translate_sched_param> 2006674: 96 07 bf fc add %fp, -4, %o3 schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) 2006678: b0 92 20 00 orcc %o0, 0, %i0 200667c: 12 80 00 2a bne 2006724 2006680: 23 00 80 79 sethi %hi(0x201e400), %l1 #endif /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 2006684: d0 04 60 54 ld [ %l1 + 0x54 ], %o0 ! 201e454 <_RTEMS_Allocator_Mutex> 2006688: 40 00 06 50 call 2007fc8 <_API_Mutex_Lock> 200668c: 29 00 80 79 sethi %hi(0x201e400), %l4 * _POSIX_Threads_Allocate */ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ) { return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ); 2006690: 40 00 09 19 call 2008af4 <_Objects_Allocate> 2006694: 90 15 21 f0 or %l4, 0x1f0, %o0 ! 201e5f0 <_POSIX_Threads_Information> * Allocate the thread control block. * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { 2006698: a0 92 20 00 orcc %o0, 0, %l0 200669c: 02 80 00 1f be 2006718 20066a0: 05 00 80 75 sethi %hi(0x201d400), %g2 /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 20066a4: c2 06 60 08 ld [ %i1 + 8 ], %g1 static inline size_t _POSIX_Threads_Ensure_minimum_stack ( size_t size ) { if ( size >= PTHREAD_MINIMUM_STACK_SIZE ) 20066a8: d6 00 a2 d0 ld [ %g2 + 0x2d0 ], %o3 /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 20066ac: c0 27 bf d4 clr [ %fp + -44 ] static inline size_t _POSIX_Threads_Ensure_minimum_stack ( size_t size ) { if ( size >= PTHREAD_MINIMUM_STACK_SIZE ) 20066b0: 97 2a e0 01 sll %o3, 1, %o3 /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 20066b4: 80 a2 c0 01 cmp %o3, %g1 20066b8: 1a 80 00 03 bcc 20066c4 20066bc: d4 06 60 04 ld [ %i1 + 4 ], %o2 20066c0: 96 10 00 01 mov %g1, %o3 20066c4: c2 07 bf f8 ld [ %fp + -8 ], %g1 20066c8: 9a 0c e0 ff and %l3, 0xff, %o5 20066cc: c2 23 a0 60 st %g1, [ %sp + 0x60 ] 20066d0: 82 10 20 01 mov 1, %g1 20066d4: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 20066d8: c2 07 bf fc ld [ %fp + -4 ], %g1 20066dc: c0 23 a0 68 clr [ %sp + 0x68 ] 20066e0: c2 23 a0 64 st %g1, [ %sp + 0x64 ] 20066e4: 82 07 bf d4 add %fp, -44, %g1 20066e8: 90 15 21 f0 or %l4, 0x1f0, %o0 20066ec: c2 23 a0 6c st %g1, [ %sp + 0x6c ] 20066f0: 92 10 00 10 mov %l0, %o1 20066f4: 98 10 20 01 mov 1, %o4 20066f8: 40 00 0e 1e call 2009f70 <_Thread_Initialize> 20066fc: 9a 23 40 12 sub %o5, %l2, %o5 budget_callout, 0, /* isr level */ name /* posix threads don't have a name */ ); if ( !status ) { 2006700: 80 8a 20 ff btst 0xff, %o0 2006704: 12 80 00 1f bne 2006780 2006708: 11 00 80 79 sethi %hi(0x201e400), %o0 RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( Thread_Control *the_pthread ) { _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object ); 200670c: 92 10 00 10 mov %l0, %o1 2006710: 40 00 09 e3 call 2008e9c <_Objects_Free> 2006714: 90 12 21 f0 or %o0, 0x1f0, %o0 _POSIX_Threads_Free( the_thread ); _RTEMS_Unlock_allocator(); 2006718: d0 04 60 54 ld [ %l1 + 0x54 ], %o0 200671c: 40 00 06 40 call 200801c <_API_Mutex_Unlock> 2006720: b0 10 20 0b mov 0xb, %i0 return EAGAIN; 2006724: 81 c7 e0 08 ret 2006728: 81 e8 00 00 restore int rc; if ( !start_routine ) return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 200672c: 10 bf ff a0 b 20065ac 2006730: b2 16 61 94 or %i1, 0x194, %i1 * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the * attributes structure. */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 2006734: 03 00 80 7a sethi %hi(0x201e800), %g1 2006738: c2 00 60 f4 ld [ %g1 + 0xf4 ], %g1 ! 201e8f4 <_Per_CPU_Information+0xc> 200673c: c2 00 61 5c ld [ %g1 + 0x15c ], %g1 schedpolicy = api->schedpolicy; schedparam = api->schedparam; 2006740: d8 00 60 88 ld [ %g1 + 0x88 ], %o4 2006744: da 00 60 8c ld [ %g1 + 0x8c ], %o5 2006748: de 00 60 90 ld [ %g1 + 0x90 ], %o7 200674c: f0 00 60 94 ld [ %g1 + 0x94 ], %i0 2006750: c8 00 60 98 ld [ %g1 + 0x98 ], %g4 2006754: c6 00 60 9c ld [ %g1 + 0x9c ], %g3 2006758: c4 00 60 a0 ld [ %g1 + 0xa0 ], %g2 * attributes structure. */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; schedpolicy = api->schedpolicy; 200675c: f8 00 60 84 ld [ %g1 + 0x84 ], %i4 schedparam = api->schedparam; 2006760: d8 27 bf dc st %o4, [ %fp + -36 ] 2006764: da 27 bf e0 st %o5, [ %fp + -32 ] 2006768: de 27 bf e4 st %o7, [ %fp + -28 ] 200676c: f0 27 bf e8 st %i0, [ %fp + -24 ] 2006770: c8 27 bf ec st %g4, [ %fp + -20 ] 2006774: c6 27 bf f0 st %g3, [ %fp + -16 ] break; 2006778: 10 bf ff af b 2006634 200677c: c4 27 bf f4 st %g2, [ %fp + -12 ] } /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 2006780: e4 04 21 5c ld [ %l0 + 0x15c ], %l2 api->Attributes = *the_attr; 2006784: 92 10 00 19 mov %i1, %o1 2006788: 94 10 20 40 mov 0x40, %o2 200678c: 40 00 28 d2 call 2010ad4 2006790: 90 10 00 12 mov %l2, %o0 api->detachstate = the_attr->detachstate; 2006794: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 api->schedpolicy = schedpolicy; api->schedparam = schedparam; 2006798: 92 07 bf dc add %fp, -36, %o1 200679c: 94 10 20 1c mov 0x1c, %o2 * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; 20067a0: c2 24 a0 40 st %g1, [ %l2 + 0x40 ] api->schedpolicy = schedpolicy; 20067a4: f8 24 a0 84 st %i4, [ %l2 + 0x84 ] api->schedparam = schedparam; 20067a8: 40 00 28 cb call 2010ad4 20067ac: 90 04 a0 88 add %l2, 0x88, %o0 /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 20067b0: 90 10 00 10 mov %l0, %o0 20067b4: 92 10 20 01 mov 1, %o1 20067b8: 94 10 00 1a mov %i2, %o2 20067bc: 96 10 00 1b mov %i3, %o3 20067c0: 40 00 10 70 call 200a980 <_Thread_Start> 20067c4: 98 10 20 00 clr %o4 _RTEMS_Unlock_allocator(); return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { 20067c8: 80 a7 20 04 cmp %i4, 4 20067cc: 02 80 00 08 be 20067ec 20067d0: 01 00 00 00 nop } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 20067d4: c2 04 20 08 ld [ %l0 + 8 ], %g1 _RTEMS_Unlock_allocator(); 20067d8: d0 04 60 54 ld [ %l1 + 0x54 ], %o0 20067dc: 40 00 06 10 call 200801c <_API_Mutex_Unlock> 20067e0: c2 27 40 00 st %g1, [ %i5 ] return 0; 20067e4: 81 c7 e0 08 ret 20067e8: 81 e8 00 00 restore return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { _Watchdog_Insert_ticks( 20067ec: 40 00 10 e7 call 200ab88 <_Timespec_To_ticks> 20067f0: 90 04 a0 90 add %l2, 0x90, %o0 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 20067f4: 92 04 a0 a8 add %l2, 0xa8, %o1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 20067f8: d0 24 a0 b4 st %o0, [ %l2 + 0xb4 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 20067fc: 11 00 80 79 sethi %hi(0x201e400), %o0 2006800: 40 00 11 d2 call 200af48 <_Watchdog_Insert> 2006804: 90 12 20 74 or %o0, 0x74, %o0 ! 201e474 <_Watchdog_Ticks_chain> } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 2006808: 10 bf ff f4 b 20067d8 200680c: c2 04 20 08 ld [ %l0 + 8 ], %g1 =============================================================================== 0201a868 : int pthread_kill( pthread_t thread, int sig ) { 201a868: 9d e3 bf 98 save %sp, -104, %sp POSIX_API_Control *api; Thread_Control *the_thread; Objects_Locations location; if ( !sig ) 201a86c: 80 a6 60 00 cmp %i1, 0 201a870: 02 80 00 2d be 201a924 201a874: b6 06 7f ff add %i1, -1, %i3 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 201a878: 80 a6 e0 1f cmp %i3, 0x1f 201a87c: 18 80 00 2a bgu 201a924 201a880: 90 10 00 18 mov %i0, %o0 rtems_set_errno_and_return_minus_one( EINVAL ); the_thread = _Thread_Get( thread, &location ); 201a884: 7f ff ba 8e call 20092bc <_Thread_Get> 201a888: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 201a88c: c2 07 bf fc ld [ %fp + -4 ], %g1 201a890: 80 a0 60 00 cmp %g1, 0 201a894: 12 80 00 2a bne 201a93c <== NEVER TAKEN 201a898: ba 10 00 08 mov %o0, %i5 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( sig ) { if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) { 201a89c: 83 2e 60 02 sll %i1, 2, %g1 201a8a0: 85 2e 60 04 sll %i1, 4, %g2 201a8a4: 84 20 80 01 sub %g2, %g1, %g2 201a8a8: 03 00 80 77 sethi %hi(0x201dc00), %g1 201a8ac: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 201dee0 <_POSIX_signals_Vectors> 201a8b0: 82 00 40 02 add %g1, %g2, %g1 201a8b4: c4 00 60 08 ld [ %g1 + 8 ], %g2 201a8b8: 80 a0 a0 01 cmp %g2, 1 201a8bc: 02 80 00 14 be 201a90c 201a8c0: c2 02 21 5c ld [ %o0 + 0x15c ], %g1 return 0; } /* XXX critical section */ api->signals_pending |= signo_to_mask( sig ); 201a8c4: c4 00 60 d4 ld [ %g1 + 0xd4 ], %g2 201a8c8: b8 10 20 01 mov 1, %i4 (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); 201a8cc: 92 10 00 19 mov %i1, %o1 201a8d0: b7 2f 00 1b sll %i4, %i3, %i3 201a8d4: 94 10 20 00 clr %o2 return 0; } /* XXX critical section */ api->signals_pending |= signo_to_mask( sig ); 201a8d8: b6 10 80 1b or %g2, %i3, %i3 (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); 201a8dc: 7f ff ff 8c call 201a70c <_POSIX_signals_Unblock_thread> 201a8e0: f6 20 60 d4 st %i3, [ %g1 + 0xd4 ] if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 201a8e4: 03 00 80 77 sethi %hi(0x201dc00), %g1 201a8e8: 82 10 62 88 or %g1, 0x288, %g1 ! 201de88 <_Per_CPU_Information> 201a8ec: c4 00 60 08 ld [ %g1 + 8 ], %g2 201a8f0: 80 a0 a0 00 cmp %g2, 0 201a8f4: 02 80 00 06 be 201a90c 201a8f8: 01 00 00 00 nop 201a8fc: c4 00 60 0c ld [ %g1 + 0xc ], %g2 201a900: 80 a7 40 02 cmp %i5, %g2 201a904: 02 80 00 06 be 201a91c 201a908: 01 00 00 00 nop _Thread_Dispatch_necessary = true; } _Thread_Enable_dispatch(); 201a90c: 7f ff ba 60 call 200928c <_Thread_Enable_dispatch> 201a910: b0 10 20 00 clr %i0 ! 0 return 0; 201a914: 81 c7 e0 08 ret 201a918: 81 e8 00 00 restore api->signals_pending |= signo_to_mask( sig ); (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; 201a91c: f8 28 60 18 stb %i4, [ %g1 + 0x18 ] 201a920: 30 bf ff fb b,a 201a90c if ( !sig ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) rtems_set_errno_and_return_minus_one( EINVAL ); 201a924: 7f ff d4 02 call 200f92c <__errno> 201a928: b0 10 3f ff mov -1, %i0 201a92c: 82 10 20 16 mov 0x16, %g1 201a930: c2 22 00 00 st %g1, [ %o0 ] 201a934: 81 c7 e0 08 ret 201a938: 81 e8 00 00 restore #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( ESRCH ); 201a93c: 7f ff d3 fc call 200f92c <__errno> <== NOT EXECUTED 201a940: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 201a944: 82 10 20 03 mov 3, %g1 <== NOT EXECUTED 201a948: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED } 201a94c: 81 c7 e0 08 ret <== NOT EXECUTED 201a950: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 02008518 : int pthread_mutex_timedlock( pthread_mutex_t *mutex, const struct timespec *abstime ) { 2008518: 9d e3 bf 98 save %sp, -104, %sp * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 200851c: 90 10 00 19 mov %i1, %o0 2008520: 40 00 00 37 call 20085fc <_POSIX_Absolute_timeout_to_ticks> 2008524: 92 07 bf fc add %fp, -4, %o1 if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks ); 2008528: d4 07 bf fc ld [ %fp + -4 ], %o2 * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 200852c: ba 10 00 08 mov %o0, %i5 if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 2008530: 80 a7 60 03 cmp %i5, 3 2008534: 02 80 00 09 be 2008558 2008538: 90 10 00 18 mov %i0, %o0 do_wait = false; lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks ); 200853c: 7f ff ff be call 2008434 <_POSIX_Mutex_Lock_support> 2008540: 92 10 20 00 clr %o1 * This service only gives us the option to block. We used a polling * attempt to lock if the abstime was not in the future. If we did * not obtain the mutex, then not look at the status immediately, * make sure the right reason is returned. */ if ( !do_wait && (lock_status == EBUSY) ) { 2008544: 80 a2 20 10 cmp %o0, 0x10 2008548: 02 80 00 08 be 2008568 <== ALWAYS TAKEN 200854c: 80 a7 60 00 cmp %i5, 0 status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return lock_status; } 2008550: 81 c7 e0 08 ret 2008554: 91 e8 00 08 restore %g0, %o0, %o0 */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks ); 2008558: 7f ff ff b7 call 2008434 <_POSIX_Mutex_Lock_support> 200855c: 92 10 20 01 mov 1, %o1 status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return lock_status; } 2008560: 81 c7 e0 08 ret 2008564: 91 e8 00 08 restore %g0, %o0, %o0 * attempt to lock if the abstime was not in the future. If we did * not obtain the mutex, then not look at the status immediately, * make sure the right reason is returned. */ if ( !do_wait && (lock_status == EBUSY) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 2008568: 32 80 00 04 bne,a 2008578 <== ALWAYS TAKEN 200856c: ba 07 7f ff add %i5, -1, %i5 return EINVAL; 2008570: 10 bf ff f8 b 2008550 <== NOT EXECUTED 2008574: 90 10 20 16 mov 0x16, %o0 <== NOT EXECUTED if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 2008578: 80 a7 60 01 cmp %i5, 1 200857c: 28 bf ff f5 bleu,a 2008550 <== ALWAYS TAKEN 2008580: 90 10 20 74 mov 0x74, %o0 2008584: 30 bf ff f3 b,a 2008550 <== NOT EXECUTED =============================================================================== 02005e0c : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_gettype( const pthread_mutexattr_t *attr, int *type ) { 2005e0c: 82 10 00 08 mov %o0, %g1 if ( !attr ) 2005e10: 80 a0 60 00 cmp %g1, 0 2005e14: 02 80 00 06 be 2005e2c 2005e18: 90 10 20 16 mov 0x16, %o0 return EINVAL; if ( !attr->is_initialized ) 2005e1c: c4 00 40 00 ld [ %g1 ], %g2 2005e20: 80 a0 a0 00 cmp %g2, 0 2005e24: 12 80 00 04 bne 2005e34 2005e28: 80 a2 60 00 cmp %o1, 0 if ( !type ) return EINVAL; *type = attr->type; return 0; } 2005e2c: 81 c3 e0 08 retl 2005e30: 01 00 00 00 nop return EINVAL; if ( !attr->is_initialized ) return EINVAL; if ( !type ) 2005e34: 02 bf ff fe be 2005e2c <== NEVER TAKEN 2005e38: 01 00 00 00 nop return EINVAL; *type = attr->type; 2005e3c: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 return 0; 2005e40: 90 10 20 00 clr %o0 } 2005e44: 81 c3 e0 08 retl 2005e48: c2 22 40 00 st %g1, [ %o1 ] =============================================================================== 020080ec : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { 20080ec: 82 10 00 08 mov %o0, %g1 if ( !attr || !attr->is_initialized ) 20080f0: 80 a0 60 00 cmp %g1, 0 20080f4: 02 80 00 06 be 200810c 20080f8: 90 10 20 16 mov 0x16, %o0 20080fc: c4 00 40 00 ld [ %g1 ], %g2 2008100: 80 a0 a0 00 cmp %g2, 0 2008104: 12 80 00 04 bne 2008114 2008108: 80 a2 60 01 cmp %o1, 1 return 0; default: return EINVAL; } } 200810c: 81 c3 e0 08 retl 2008110: 01 00 00 00 nop ) { if ( !attr || !attr->is_initialized ) return EINVAL; switch ( pshared ) { 2008114: 18 bf ff fe bgu 200810c <== NEVER TAKEN 2008118: 01 00 00 00 nop case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 200811c: d2 20 60 04 st %o1, [ %g1 + 4 ] return 0; default: return EINVAL; } } 2008120: 81 c3 e0 08 retl 2008124: 90 10 20 00 clr %o0 =============================================================================== 02005ea0 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { 2005ea0: 82 10 00 08 mov %o0, %g1 if ( !attr || !attr->is_initialized ) 2005ea4: 80 a0 60 00 cmp %g1, 0 2005ea8: 02 80 00 06 be 2005ec0 2005eac: 90 10 20 16 mov 0x16, %o0 2005eb0: c4 00 40 00 ld [ %g1 ], %g2 2005eb4: 80 a0 a0 00 cmp %g2, 0 2005eb8: 12 80 00 04 bne 2005ec8 <== ALWAYS TAKEN 2005ebc: 80 a2 60 03 cmp %o1, 3 return 0; default: return EINVAL; } } 2005ec0: 81 c3 e0 08 retl 2005ec4: 01 00 00 00 nop ) { if ( !attr || !attr->is_initialized ) return EINVAL; switch ( type ) { 2005ec8: 18 bf ff fe bgu 2005ec0 2005ecc: 01 00 00 00 nop case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 2005ed0: d2 20 60 10 st %o1, [ %g1 + 0x10 ] return 0; default: return EINVAL; } } 2005ed4: 81 c3 e0 08 retl 2005ed8: 90 10 20 00 clr %o0 =============================================================================== 02006c30 : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 2006c30: 9d e3 bf 98 save %sp, -104, %sp if ( !once_control || !init_routine ) 2006c34: 80 a6 60 00 cmp %i1, 0 2006c38: 12 80 00 04 bne 2006c48 2006c3c: ba 10 00 18 mov %i0, %i5 (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); } return 0; } 2006c40: 81 c7 e0 08 ret 2006c44: 91 e8 20 16 restore %g0, 0x16, %o0 int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { if ( !once_control || !init_routine ) 2006c48: 80 a6 20 00 cmp %i0, 0 2006c4c: 22 80 00 13 be,a 2006c98 2006c50: b0 10 20 16 mov 0x16, %i0 return EINVAL; if ( !once_control->init_executed ) { 2006c54: c2 06 20 04 ld [ %i0 + 4 ], %g1 2006c58: 80 a0 60 00 cmp %g1, 0 2006c5c: 12 80 00 0f bne 2006c98 2006c60: b0 10 20 00 clr %i0 rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 2006c64: 90 10 21 00 mov 0x100, %o0 2006c68: 92 10 21 00 mov 0x100, %o1 2006c6c: 40 00 03 0c call 200789c 2006c70: 94 07 bf fc add %fp, -4, %o2 if ( !once_control->init_executed ) { 2006c74: c2 07 60 04 ld [ %i5 + 4 ], %g1 2006c78: 80 a0 60 00 cmp %g1, 0 2006c7c: 02 80 00 09 be 2006ca0 <== ALWAYS TAKEN 2006c80: 82 10 20 01 mov 1, %g1 once_control->is_initialized = true; once_control->init_executed = true; (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 2006c84: d0 07 bf fc ld [ %fp + -4 ], %o0 <== NOT EXECUTED 2006c88: 92 10 21 00 mov 0x100, %o1 2006c8c: 94 07 bf fc add %fp, -4, %o2 2006c90: 40 00 03 03 call 200789c 2006c94: b0 10 20 00 clr %i0 2006c98: 81 c7 e0 08 ret 2006c9c: 81 e8 00 00 restore if ( !once_control->init_executed ) { rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); if ( !once_control->init_executed ) { once_control->is_initialized = true; 2006ca0: c2 27 40 00 st %g1, [ %i5 ] once_control->init_executed = true; (*init_routine)(); 2006ca4: 9f c6 40 00 call %i1 2006ca8: c2 27 60 04 st %g1, [ %i5 + 4 ] } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 2006cac: 10 bf ff f7 b 2006c88 2006cb0: d0 07 bf fc ld [ %fp + -4 ], %o0 =============================================================================== 020073a8 : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 20073a8: 9d e3 bf 90 save %sp, -112, %sp 20073ac: ba 10 00 18 mov %i0, %i5 const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 20073b0: 80 a7 60 00 cmp %i5, 0 20073b4: 02 80 00 24 be 2007444 20073b8: b0 10 20 16 mov 0x16, %i0 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 20073bc: 80 a6 60 00 cmp %i1, 0 20073c0: 02 80 00 23 be 200744c 20073c4: 90 07 bf f4 add %fp, -12, %o0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 20073c8: c2 06 40 00 ld [ %i1 ], %g1 20073cc: 80 a0 60 00 cmp %g1, 0 20073d0: 02 80 00 1d be 2007444 <== NEVER TAKEN 20073d4: b0 10 20 16 mov 0x16, %i0 return EINVAL; switch ( the_attr->process_shared ) { 20073d8: c2 06 60 04 ld [ %i1 + 4 ], %g1 20073dc: 80 a0 60 00 cmp %g1, 0 20073e0: 12 80 00 19 bne 2007444 <== NEVER TAKEN 20073e4: 03 00 80 6a sethi %hi(0x201a800), %g1 /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 20073e8: c4 00 61 30 ld [ %g1 + 0x130 ], %g2 ! 201a930 <_Thread_Dispatch_disable_level> */ RTEMS_INLINE_ROUTINE void _CORE_RWLock_Initialize_attributes( CORE_RWLock_Attributes *the_attributes ) { the_attributes->XXX = 0; 20073ec: c0 27 bf fc clr [ %fp + -4 ] 20073f0: 84 00 a0 01 inc %g2 20073f4: c4 20 61 30 st %g2, [ %g1 + 0x130 ] return _Thread_Dispatch_disable_level; 20073f8: c2 00 61 30 ld [ %g1 + 0x130 ], %g1 * This function allocates a RWLock control block from * the inactive chain of free RWLock control blocks. */ RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Allocate( void ) { return (POSIX_RWLock_Control *) 20073fc: 37 00 80 6a sethi %hi(0x201a800), %i3 2007400: 40 00 0a 46 call 2009d18 <_Objects_Allocate> 2007404: 90 16 e3 30 or %i3, 0x330, %o0 ! 201ab30 <_POSIX_RWLock_Information> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 2007408: b8 92 20 00 orcc %o0, 0, %i4 200740c: 02 80 00 14 be 200745c 2007410: 90 07 20 10 add %i4, 0x10, %o0 _Thread_Enable_dispatch(); return EAGAIN; } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 2007414: 40 00 07 d6 call 200936c <_CORE_RWLock_Initialize> 2007418: 92 07 bf fc add %fp, -4, %o1 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 200741c: c4 17 20 0a lduh [ %i4 + 0xa ], %g2 *rwlock = the_rwlock->Object.id; _Thread_Enable_dispatch(); return 0; } 2007420: b6 16 e3 30 or %i3, 0x330, %i3 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 2007424: c6 06 e0 1c ld [ %i3 + 0x1c ], %g3 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 2007428: c2 07 20 08 ld [ %i4 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 200742c: 85 28 a0 02 sll %g2, 2, %g2 2007430: f8 20 c0 02 st %i4, [ %g3 + %g2 ] _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 2007434: c0 27 20 0c clr [ %i4 + 0xc ] &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; 2007438: c2 27 40 00 st %g1, [ %i5 ] _Thread_Enable_dispatch(); 200743c: 40 00 0f 1e call 200b0b4 <_Thread_Enable_dispatch> 2007440: b0 10 20 00 clr %i0 return 0; } 2007444: 81 c7 e0 08 ret 2007448: 81 e8 00 00 restore * If the user passed in NULL, use the default attributes */ if ( attr ) { the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); 200744c: 40 00 02 6c call 2007dfc 2007450: b2 07 bf f4 add %fp, -12, %i1 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 2007454: 10 bf ff de b 20073cc 2007458: c2 06 40 00 ld [ %i1 ], %g1 _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { _Thread_Enable_dispatch(); 200745c: 40 00 0f 16 call 200b0b4 <_Thread_Enable_dispatch> 2007460: b0 10 20 0b mov 0xb, %i0 return EAGAIN; 2007464: 81 c7 e0 08 ret 2007468: 81 e8 00 00 restore =============================================================================== 020074dc : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 20074dc: 9d e3 bf 98 save %sp, -104, %sp Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 20074e0: 80 a6 20 00 cmp %i0, 0 20074e4: 02 80 00 24 be 2007574 20074e8: ba 10 20 16 mov 0x16, %i5 * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 20074ec: 92 07 bf fc add %fp, -4, %o1 20074f0: 40 00 1c 92 call 200e738 <_POSIX_Absolute_timeout_to_ticks> 20074f4: 90 10 00 19 mov %i1, %o0 20074f8: d2 06 00 00 ld [ %i0 ], %o1 20074fc: b8 10 00 08 mov %o0, %i4 2007500: 94 07 bf f8 add %fp, -8, %o2 2007504: 11 00 80 6a sethi %hi(0x201a800), %o0 2007508: 40 00 0b 4f call 200a244 <_Objects_Get> 200750c: 90 12 23 30 or %o0, 0x330, %o0 ! 201ab30 <_POSIX_RWLock_Information> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 2007510: c2 07 bf f8 ld [ %fp + -8 ], %g1 2007514: 80 a0 60 00 cmp %g1, 0 2007518: 12 80 00 17 bne 2007574 200751c: d6 07 bf fc ld [ %fp + -4 ], %o3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 2007520: d2 06 00 00 ld [ %i0 ], %o1 int _EXFUN(pthread_rwlock_init, (pthread_rwlock_t *__rwlock, _CONST pthread_rwlockattr_t *__attr)); int _EXFUN(pthread_rwlock_destroy, (pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_rdlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_tryrdlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_timedrdlock, 2007524: 82 1f 20 03 xor %i4, 3, %g1 2007528: 90 02 20 10 add %o0, 0x10, %o0 200752c: 80 a0 00 01 cmp %g0, %g1 2007530: 98 10 20 00 clr %o4 2007534: b6 60 3f ff subx %g0, -1, %i3 2007538: 40 00 07 97 call 2009394 <_CORE_RWLock_Obtain_for_reading> 200753c: 94 10 00 1b mov %i3, %o2 do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 2007540: 40 00 0e dd call 200b0b4 <_Thread_Enable_dispatch> 2007544: 01 00 00 00 nop if ( !do_wait ) { if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 2007548: 03 00 80 6b sethi %hi(0x201ac00), %g1 200754c: c2 00 62 74 ld [ %g1 + 0x274 ], %g1 ! 201ae74 <_Per_CPU_Information+0xc> ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait ) { 2007550: 80 a6 e0 00 cmp %i3, 0 2007554: 12 80 00 05 bne 2007568 2007558: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 200755c: 80 a2 20 02 cmp %o0, 2 2007560: 02 80 00 07 be 200757c 2007564: 80 a7 20 00 cmp %i4, 0 status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 2007568: 40 00 00 39 call 200764c <_POSIX_RWLock_Translate_core_RWLock_return_code> 200756c: 01 00 00 00 nop 2007570: ba 10 00 08 mov %o0, %i5 case OBJECTS_ERROR: break; } return EINVAL; } 2007574: 81 c7 e0 08 ret 2007578: 91 e8 00 1d restore %g0, %i5, %o0 ); _Thread_Enable_dispatch(); if ( !do_wait ) { if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 200757c: 02 bf ff fe be 2007574 <== NEVER TAKEN 2007580: b8 07 3f ff add %i4, -1, %i4 return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 2007584: 80 a7 20 01 cmp %i4, 1 2007588: 18 bf ff f8 bgu 2007568 <== NEVER TAKEN 200758c: ba 10 20 74 mov 0x74, %i5 2007590: 30 bf ff f9 b,a 2007574 =============================================================================== 02007594 : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 2007594: 9d e3 bf 98 save %sp, -104, %sp Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 2007598: 80 a6 20 00 cmp %i0, 0 200759c: 02 80 00 24 be 200762c 20075a0: ba 10 20 16 mov 0x16, %i5 * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 20075a4: 92 07 bf fc add %fp, -4, %o1 20075a8: 40 00 1c 64 call 200e738 <_POSIX_Absolute_timeout_to_ticks> 20075ac: 90 10 00 19 mov %i1, %o0 20075b0: d2 06 00 00 ld [ %i0 ], %o1 20075b4: b8 10 00 08 mov %o0, %i4 20075b8: 94 07 bf f8 add %fp, -8, %o2 20075bc: 11 00 80 6a sethi %hi(0x201a800), %o0 20075c0: 40 00 0b 21 call 200a244 <_Objects_Get> 20075c4: 90 12 23 30 or %o0, 0x330, %o0 ! 201ab30 <_POSIX_RWLock_Information> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 20075c8: c2 07 bf f8 ld [ %fp + -8 ], %g1 20075cc: 80 a0 60 00 cmp %g1, 0 20075d0: 12 80 00 17 bne 200762c 20075d4: d6 07 bf fc ld [ %fp + -4 ], %o3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 20075d8: d2 06 00 00 ld [ %i0 ], %o1 (pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime)); int _EXFUN(pthread_rwlock_unlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_wrlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_trywrlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_timedwrlock, 20075dc: 82 1f 20 03 xor %i4, 3, %g1 20075e0: 90 02 20 10 add %o0, 0x10, %o0 20075e4: 80 a0 00 01 cmp %g0, %g1 20075e8: 98 10 20 00 clr %o4 20075ec: b6 60 3f ff subx %g0, -1, %i3 20075f0: 40 00 07 9f call 200946c <_CORE_RWLock_Obtain_for_writing> 20075f4: 94 10 00 1b mov %i3, %o2 do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 20075f8: 40 00 0e af call 200b0b4 <_Thread_Enable_dispatch> 20075fc: 01 00 00 00 nop if ( !do_wait && (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 2007600: 03 00 80 6b sethi %hi(0x201ac00), %g1 2007604: c2 00 62 74 ld [ %g1 + 0x274 ], %g1 ! 201ae74 <_Per_CPU_Information+0xc> ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait && 2007608: 80 a6 e0 00 cmp %i3, 0 200760c: 12 80 00 05 bne 2007620 2007610: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 2007614: 80 a2 20 02 cmp %o0, 2 2007618: 02 80 00 07 be 2007634 200761c: 80 a7 20 00 cmp %i4, 0 if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return _POSIX_RWLock_Translate_core_RWLock_return_code( 2007620: 40 00 00 0b call 200764c <_POSIX_RWLock_Translate_core_RWLock_return_code> 2007624: 01 00 00 00 nop 2007628: ba 10 00 08 mov %o0, %i5 case OBJECTS_ERROR: break; } return EINVAL; } 200762c: 81 c7 e0 08 ret 2007630: 91 e8 00 1d restore %g0, %i5, %o0 ); _Thread_Enable_dispatch(); if ( !do_wait && (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 2007634: 02 bf ff fe be 200762c <== NEVER TAKEN 2007638: b8 07 3f ff add %i4, -1, %i4 return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 200763c: 80 a7 20 01 cmp %i4, 1 2007640: 18 bf ff f8 bgu 2007620 <== NEVER TAKEN 2007644: ba 10 20 74 mov 0x74, %i5 2007648: 30 bf ff f9 b,a 200762c =============================================================================== 02007e24 : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { 2007e24: 82 10 00 08 mov %o0, %g1 if ( !attr ) 2007e28: 80 a0 60 00 cmp %g1, 0 2007e2c: 02 80 00 06 be 2007e44 2007e30: 90 10 20 16 mov 0x16, %o0 return EINVAL; if ( !attr->is_initialized ) 2007e34: c4 00 40 00 ld [ %g1 ], %g2 2007e38: 80 a0 a0 00 cmp %g2, 0 2007e3c: 12 80 00 04 bne 2007e4c 2007e40: 80 a2 60 01 cmp %o1, 1 return 0; default: return EINVAL; } } 2007e44: 81 c3 e0 08 retl 2007e48: 01 00 00 00 nop return EINVAL; if ( !attr->is_initialized ) return EINVAL; switch ( pshared ) { 2007e4c: 18 bf ff fe bgu 2007e44 <== NEVER TAKEN 2007e50: 01 00 00 00 nop case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 2007e54: d2 20 60 04 st %o1, [ %g1 + 4 ] return 0; default: return EINVAL; } } 2007e58: 81 c3 e0 08 retl 2007e5c: 90 10 20 00 clr %o0 =============================================================================== 02008df0 : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 2008df0: 9d e3 bf 90 save %sp, -112, %sp 2008df4: ba 10 00 18 mov %i0, %i5 int rc; /* * Check all the parameters */ if ( !param ) 2008df8: 80 a6 a0 00 cmp %i2, 0 2008dfc: 02 80 00 38 be 2008edc 2008e00: b0 10 20 16 mov 0x16, %i0 return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 2008e04: 90 10 00 19 mov %i1, %o0 2008e08: 92 10 00 1a mov %i2, %o1 2008e0c: 94 07 bf f4 add %fp, -12, %o2 2008e10: 40 00 1a 57 call 200f76c <_POSIX_Thread_Translate_sched_param> 2008e14: 96 07 bf f8 add %fp, -8, %o3 policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 2008e18: b0 92 20 00 orcc %o0, 0, %i0 2008e1c: 12 80 00 30 bne 2008edc 2008e20: 90 10 00 1d mov %i5, %o0 return rc; /* * Actually change the scheduling policy and parameters */ the_thread = _Thread_Get( thread, &location ); 2008e24: 40 00 0c 40 call 200bf24 <_Thread_Get> 2008e28: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 2008e2c: c2 07 bf fc ld [ %fp + -4 ], %g1 2008e30: 80 a0 60 00 cmp %g1, 0 2008e34: 12 80 00 2c bne 2008ee4 2008e38: b8 10 00 08 mov %o0, %i4 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 2008e3c: fa 02 21 5c ld [ %o0 + 0x15c ], %i5 if ( api->schedpolicy == SCHED_SPORADIC ) 2008e40: c2 07 60 84 ld [ %i5 + 0x84 ], %g1 2008e44: 80 a0 60 04 cmp %g1, 4 2008e48: 02 80 00 33 be 2008f14 2008e4c: 01 00 00 00 nop (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; 2008e50: f2 27 60 84 st %i1, [ %i5 + 0x84 ] api->schedparam = *param; 2008e54: c2 06 80 00 ld [ %i2 ], %g1 the_thread->budget_algorithm = budget_algorithm; the_thread->budget_callout = budget_callout; switch ( api->schedpolicy ) { 2008e58: 80 a6 60 00 cmp %i1, 0 if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; 2008e5c: c2 27 60 88 st %g1, [ %i5 + 0x88 ] 2008e60: c4 06 a0 04 ld [ %i2 + 4 ], %g2 2008e64: c4 27 60 8c st %g2, [ %i5 + 0x8c ] 2008e68: c4 06 a0 08 ld [ %i2 + 8 ], %g2 2008e6c: c4 27 60 90 st %g2, [ %i5 + 0x90 ] 2008e70: c4 06 a0 0c ld [ %i2 + 0xc ], %g2 2008e74: c4 27 60 94 st %g2, [ %i5 + 0x94 ] 2008e78: c4 06 a0 10 ld [ %i2 + 0x10 ], %g2 2008e7c: c4 27 60 98 st %g2, [ %i5 + 0x98 ] 2008e80: c4 06 a0 14 ld [ %i2 + 0x14 ], %g2 2008e84: c4 27 60 9c st %g2, [ %i5 + 0x9c ] 2008e88: c4 06 a0 18 ld [ %i2 + 0x18 ], %g2 2008e8c: c4 27 60 a0 st %g2, [ %i5 + 0xa0 ] the_thread->budget_algorithm = budget_algorithm; 2008e90: c4 07 bf f4 ld [ %fp + -12 ], %g2 2008e94: c4 27 20 7c st %g2, [ %i4 + 0x7c ] the_thread->budget_callout = budget_callout; 2008e98: c4 07 bf f8 ld [ %fp + -8 ], %g2 switch ( api->schedpolicy ) { 2008e9c: 06 80 00 0e bl 2008ed4 <== NEVER TAKEN 2008ea0: c4 27 20 80 st %g2, [ %i4 + 0x80 ] 2008ea4: 80 a6 60 02 cmp %i1, 2 2008ea8: 04 80 00 11 ble 2008eec 2008eac: 07 00 80 6c sethi %hi(0x201b000), %g3 2008eb0: 80 a6 60 04 cmp %i1, 4 2008eb4: 12 80 00 08 bne 2008ed4 <== NEVER TAKEN 2008eb8: 01 00 00 00 nop true ); break; case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 2008ebc: c2 27 60 a4 st %g1, [ %i5 + 0xa4 ] _Watchdog_Remove( &api->Sporadic_timer ); 2008ec0: 40 00 10 da call 200d228 <_Watchdog_Remove> 2008ec4: 90 07 60 a8 add %i5, 0xa8, %o0 _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 2008ec8: 90 10 20 00 clr %o0 2008ecc: 7f ff ff 7e call 2008cc4 <_POSIX_Threads_Sporadic_budget_TSR> 2008ed0: 92 10 00 1c mov %i4, %o1 break; } _Thread_Enable_dispatch(); 2008ed4: 40 00 0c 08 call 200bef4 <_Thread_Enable_dispatch> 2008ed8: 01 00 00 00 nop return 0; 2008edc: 81 c7 e0 08 ret 2008ee0: 81 e8 00 00 restore case OBJECTS_ERROR: break; } return ESRCH; } 2008ee4: 81 c7 e0 08 ret 2008ee8: 91 e8 20 03 restore %g0, 3, %o0 switch ( api->schedpolicy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 2008eec: 05 00 80 70 sethi %hi(0x201c000), %g2 2008ef0: d2 08 e3 6c ldub [ %g3 + 0x36c ], %o1 2008ef4: c4 00 a0 14 ld [ %g2 + 0x14 ], %g2 2008ef8: 92 22 40 01 sub %o1, %g1, %o1 2008efc: c4 27 20 78 st %g2, [ %i4 + 0x78 ] the_thread->real_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 2008f00: 90 10 00 1c mov %i4, %o0 case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; the_thread->real_priority = 2008f04: d2 27 20 18 st %o1, [ %i4 + 0x18 ] _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 2008f08: 40 00 0a bd call 200b9fc <_Thread_Change_priority> 2008f0c: 94 10 20 01 mov 1, %o2 the_thread, the_thread->real_priority, true ); break; 2008f10: 30 bf ff f1 b,a 2008ed4 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); 2008f14: 40 00 10 c5 call 200d228 <_Watchdog_Remove> 2008f18: 90 07 60 a8 add %i5, 0xa8, %o0 api->schedpolicy = policy; 2008f1c: 10 bf ff ce b 2008e54 2008f20: f2 27 60 84 st %i1, [ %i5 + 0x84 ] =============================================================================== 020068d0 : * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 20068d0: 9d e3 bf a0 save %sp, -96, %sp * Don't even think about deleting a resource from an ISR. * Besides this request is supposed to be for _Thread_Executing * and the ISR context is not a thread. */ if ( _ISR_Is_in_progress() ) 20068d4: 3b 00 80 63 sethi %hi(0x2018c00), %i5 20068d8: ba 17 61 88 or %i5, 0x188, %i5 ! 2018d88 <_Per_CPU_Information> 20068dc: c2 07 60 08 ld [ %i5 + 8 ], %g1 20068e0: 80 a0 60 00 cmp %g1, 0 20068e4: 12 80 00 16 bne 200693c <== NEVER TAKEN 20068e8: 01 00 00 00 nop /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 20068ec: 03 00 80 62 sethi %hi(0x2018800), %g1 return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 20068f0: c4 07 60 0c ld [ %i5 + 0xc ], %g2 20068f4: c6 00 60 50 ld [ %g1 + 0x50 ], %g3 20068f8: c4 00 a1 5c ld [ %g2 + 0x15c ], %g2 20068fc: 86 00 e0 01 inc %g3 2006900: c6 20 60 50 st %g3, [ %g1 + 0x50 ] return _Thread_Dispatch_disable_level; 2006904: c2 00 60 50 ld [ %g1 + 0x50 ], %g1 _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 2006908: c2 00 a0 d8 ld [ %g2 + 0xd8 ], %g1 200690c: 80 a0 60 00 cmp %g1, 0 2006910: 12 80 00 0d bne 2006944 <== NEVER TAKEN 2006914: 01 00 00 00 nop 2006918: c2 00 a0 e0 ld [ %g2 + 0xe0 ], %g1 200691c: 80 a0 60 00 cmp %g1, 0 2006920: 02 80 00 09 be 2006944 2006924: 01 00 00 00 nop thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 2006928: 40 00 0b c3 call 2009834 <_Thread_Enable_dispatch> 200692c: b2 10 3f ff mov -1, %i1 ! ffffffff if ( cancel ) _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 2006930: f0 07 60 0c ld [ %i5 + 0xc ], %i0 2006934: 40 00 1a 1f call 200d1b0 <_POSIX_Thread_Exit> 2006938: 81 e8 00 00 restore 200693c: 81 c7 e0 08 ret <== NOT EXECUTED 2006940: 81 e8 00 00 restore <== NOT EXECUTED _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 2006944: 40 00 0b bc call 2009834 <_Thread_Enable_dispatch> 2006948: 81 e8 00 00 restore =============================================================================== 0201a0a0 : ssize_t read( int fd, void *buffer, size_t count ) { 201a0a0: 9d e3 bf a0 save %sp, -96, %sp ssize_t rc; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 201a0a4: 03 00 80 73 sethi %hi(0x201cc00), %g1 201a0a8: c2 00 61 0c ld [ %g1 + 0x10c ], %g1 ! 201cd0c 201a0ac: 80 a6 00 01 cmp %i0, %g1 201a0b0: 1a 80 00 1e bcc 201a128 <== NEVER TAKEN 201a0b4: 03 00 80 75 sethi %hi(0x201d400), %g1 iop = rtems_libio_iop( fd ); 201a0b8: fa 00 63 84 ld [ %g1 + 0x384 ], %i5 ! 201d784 201a0bc: b1 2e 20 06 sll %i0, 6, %i0 201a0c0: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open( iop ); 201a0c4: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 201a0c8: 80 88 61 00 btst 0x100, %g1 201a0cc: 02 80 00 17 be 201a128 201a0d0: 80 a6 60 00 cmp %i1, 0 rtems_libio_check_buffer( buffer ); 201a0d4: 02 80 00 1b be 201a140 <== NEVER TAKEN 201a0d8: 80 a6 a0 00 cmp %i2, 0 rtems_libio_check_count( count ); 201a0dc: 02 80 00 11 be 201a120 201a0e0: b0 10 20 00 clr %i0 rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ ); 201a0e4: 80 88 60 02 btst 2, %g1 201a0e8: 02 80 00 16 be 201a140 201a0ec: 90 10 00 1d mov %i5, %o0 /* * Now process the read(). */ rc = (*iop->pathinfo.handlers->read_h)( iop, buffer, count ); 201a0f0: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 201a0f4: c2 00 60 08 ld [ %g1 + 8 ], %g1 201a0f8: 92 10 00 19 mov %i1, %o1 201a0fc: 9f c0 40 00 call %g1 201a100: 94 10 00 1a mov %i2, %o2 if ( rc > 0 ) 201a104: b0 92 20 00 orcc %o0, 0, %i0 201a108: 04 80 00 06 ble 201a120 201a10c: 85 3e 20 1f sra %i0, 0x1f, %g2 iop->offset += rc; 201a110: d8 1f 60 10 ldd [ %i5 + 0x10 ], %o4 201a114: 86 83 40 18 addcc %o5, %i0, %g3 201a118: 84 43 00 02 addx %o4, %g2, %g2 201a11c: c4 3f 60 10 std %g2, [ %i5 + 0x10 ] return rc; } 201a120: 81 c7 e0 08 ret 201a124: 81 e8 00 00 restore ssize_t rc; rtems_libio_t *iop; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open( iop ); 201a128: 7f ff d6 01 call 200f92c <__errno> 201a12c: b0 10 3f ff mov -1, %i0 201a130: 82 10 20 09 mov 9, %g1 201a134: c2 22 00 00 st %g1, [ %o0 ] 201a138: 81 c7 e0 08 ret 201a13c: 81 e8 00 00 restore rtems_libio_check_buffer( buffer ); rtems_libio_check_count( count ); rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ ); 201a140: 7f ff d5 fb call 200f92c <__errno> 201a144: b0 10 3f ff mov -1, %i0 201a148: 82 10 20 16 mov 0x16, %g1 201a14c: c2 22 00 00 st %g1, [ %o0 ] 201a150: 81 c7 e0 08 ret 201a154: 81 e8 00 00 restore =============================================================================== 02005fd0 : ssize_t readlink( const char *pathname, char *buf, size_t bufsize ) { 2005fd0: 9d e3 bf 88 save %sp, -120, %sp rtems_filesystem_location_info_t loc; int result; if (!buf) 2005fd4: 80 a6 60 00 cmp %i1, 0 2005fd8: 02 80 00 26 be 2006070 2005fdc: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EFAULT ); result = rtems_filesystem_evaluate_path( pathname, strlen( pathname ), 2005fe0: 40 00 38 26 call 2014078 2005fe4: 90 10 00 18 mov %i0, %o0 2005fe8: 94 10 20 00 clr %o2 2005fec: 92 10 00 08 mov %o0, %o1 2005ff0: 96 07 bf ec add %fp, -20, %o3 2005ff4: 90 10 00 18 mov %i0, %o0 2005ff8: 98 10 20 00 clr %o4 2005ffc: 7f ff fb 5f call 2004d78 2006000: b0 10 3f ff mov -1, %i0 0, &loc, false ); if ( result != 0 ) 2006004: 80 a2 20 00 cmp %o0, 0 2006008: 12 80 00 10 bne 2006048 <== NEVER TAKEN 200600c: c2 07 bf f8 ld [ %fp + -8 ], %g1 return -1; if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){ 2006010: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 2006014: 9f c0 40 00 call %g1 2006018: 90 07 bf ec add %fp, -20, %o0 200601c: 80 a2 20 04 cmp %o0, 4 2006020: 12 80 00 0c bne 2006050 2006024: c2 07 bf f8 ld [ %fp + -8 ], %g1 rtems_filesystem_freenode( &loc ); rtems_set_errno_and_return_minus_one( EINVAL ); } result = (*loc.ops->readlink_h)( &loc, buf, bufsize ); 2006028: 92 10 00 19 mov %i1, %o1 200602c: c2 00 60 3c ld [ %g1 + 0x3c ], %g1 2006030: 94 10 00 1a mov %i2, %o2 2006034: 9f c0 40 00 call %g1 2006038: 90 07 bf ec add %fp, -20, %o0 200603c: b0 10 00 08 mov %o0, %i0 rtems_filesystem_freenode( &loc ); 2006040: 7f ff fb 88 call 2004e60 2006044: 90 07 bf ec add %fp, -20, %o0 return result; } 2006048: 81 c7 e0 08 ret 200604c: 81 e8 00 00 restore 0, &loc, false ); if ( result != 0 ) return -1; if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){ rtems_filesystem_freenode( &loc ); 2006050: 7f ff fb 84 call 2004e60 2006054: 90 07 bf ec add %fp, -20, %o0 rtems_set_errno_and_return_minus_one( EINVAL ); 2006058: 40 00 31 06 call 2012470 <__errno> 200605c: 01 00 00 00 nop 2006060: 82 10 20 16 mov 0x16, %g1 ! 16 2006064: c2 22 00 00 st %g1, [ %o0 ] 2006068: 81 c7 e0 08 ret 200606c: 81 e8 00 00 restore { rtems_filesystem_location_info_t loc; int result; if (!buf) rtems_set_errno_and_return_minus_one( EFAULT ); 2006070: 40 00 31 00 call 2012470 <__errno> 2006074: b0 10 3f ff mov -1, %i0 2006078: 82 10 20 0e mov 0xe, %g1 200607c: c2 22 00 00 st %g1, [ %o0 ] 2006080: 81 c7 e0 08 ret 2006084: 81 e8 00 00 restore =============================================================================== 02004a4c : ssize_t readv( int fd, const struct iovec *iov, int iovcnt ) { 2004a4c: 9d e3 bf a0 save %sp, -96, %sp int v; int bytes; rtems_libio_t *iop; bool all_zeros; rtems_libio_check_fd( fd ); 2004a50: 03 00 80 5e sethi %hi(0x2017800), %g1 2004a54: c2 00 61 4c ld [ %g1 + 0x14c ], %g1 ! 201794c 2004a58: 80 a6 00 01 cmp %i0, %g1 2004a5c: 1a 80 00 48 bcc 2004b7c 2004a60: 03 00 80 60 sethi %hi(0x2018000), %g1 iop = rtems_libio_iop( fd ); 2004a64: f8 00 63 a0 ld [ %g1 + 0x3a0 ], %i4 ! 20183a0 2004a68: b1 2e 20 06 sll %i0, 6, %i0 2004a6c: b8 07 00 18 add %i4, %i0, %i4 rtems_libio_check_is_open( iop ); 2004a70: c2 07 20 18 ld [ %i4 + 0x18 ], %g1 2004a74: 80 88 61 00 btst 0x100, %g1 2004a78: 02 80 00 41 be 2004b7c 2004a7c: 80 88 60 02 btst 2, %g1 rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ ); 2004a80: 02 80 00 39 be 2004b64 <== NEVER TAKEN 2004a84: 80 a6 60 00 cmp %i1, 0 /* * Argument validation on IO vector */ if ( !iov ) 2004a88: 02 80 00 37 be 2004b64 2004a8c: 80 a6 a0 00 cmp %i2, 0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( iovcnt <= 0 ) 2004a90: 04 80 00 35 ble 2004b64 2004a94: 80 a6 a4 00 cmp %i2, 0x400 rtems_set_errno_and_return_minus_one( EINVAL ); if ( iovcnt > IOV_MAX ) 2004a98: 14 80 00 33 bg 2004b64 <== NEVER TAKEN 2004a9c: b5 2e a0 03 sll %i2, 3, %i2 #include #include #include ssize_t readv( 2004aa0: 82 10 20 00 clr %g1 2004aa4: ba 10 20 01 mov 1, %i5 2004aa8: 10 80 00 03 b 2004ab4 2004aac: 84 10 20 00 clr %g2 if ( iov[v].iov_base == 0 ) rtems_set_errno_and_return_minus_one( EINVAL ); /* check for wrap */ old = total; total += iov[v].iov_len; 2004ab0: 84 10 00 04 mov %g4, %g2 /* * iov[v].iov_len cannot be less than 0 because size_t is unsigned. * So we only check for zero. */ if ( iov[v].iov_base == 0 ) 2004ab4: c6 06 40 01 ld [ %i1 + %g1 ], %g3 2004ab8: 80 a0 e0 00 cmp %g3, 0 2004abc: 02 80 00 2a be 2004b64 2004ac0: 88 06 40 01 add %i1, %g1, %g4 rtems_set_errno_and_return_minus_one( EINVAL ); /* check for wrap */ old = total; total += iov[v].iov_len; 2004ac4: c6 01 20 04 ld [ %g4 + 4 ], %g3 2004ac8: 88 00 c0 02 add %g3, %g2, %g4 if ( total < old ) 2004acc: 80 a1 00 02 cmp %g4, %g2 2004ad0: 06 80 00 25 bl 2004b64 2004ad4: 82 00 60 08 add %g1, 8, %g1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( iov[v].iov_len ) all_zeros = false; 2004ad8: 80 a0 00 03 cmp %g0, %g3 2004adc: 84 40 3f ff addx %g0, -1, %g2 * 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++ ) { 2004ae0: 80 a0 40 1a cmp %g1, %i2 2004ae4: 12 bf ff f3 bne 2004ab0 2004ae8: ba 0f 40 02 and %i5, %g2, %i5 /* * 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 ) { 2004aec: 80 8f 60 ff btst 0xff, %i5 2004af0: 12 80 00 1b bne 2004b5c 2004af4: b0 10 20 00 clr %i0 2004af8: ba 10 20 00 clr %i5 /* * Now process the readv(). */ for ( total=0, v=0 ; v < iovcnt ; v++ ) { bytes = (*iop->pathinfo.handlers->read_h)( 2004afc: c2 07 20 24 ld [ %i4 + 0x24 ], %g1 #include #include #include ssize_t readv( 2004b00: b6 06 40 1d add %i1, %i5, %i3 /* * Now process the readv(). */ for ( total=0, v=0 ; v < iovcnt ; v++ ) { bytes = (*iop->pathinfo.handlers->read_h)( 2004b04: d2 06 40 1d ld [ %i1 + %i5 ], %o1 2004b08: c2 00 60 08 ld [ %g1 + 8 ], %g1 2004b0c: d4 06 e0 04 ld [ %i3 + 4 ], %o2 2004b10: 9f c0 40 00 call %g1 2004b14: 90 10 00 1c mov %i4, %o0 iop, iov[v].iov_base, iov[v].iov_len ); if ( bytes < 0 ) 2004b18: 80 a2 20 00 cmp %o0, 0 2004b1c: 26 80 00 10 bl,a 2004b5c <== NEVER TAKEN 2004b20: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED return -1; if ( bytes > 0 ) { 2004b24: 02 80 00 07 be 2004b40 <== NEVER TAKEN 2004b28: a1 3a 20 1f sra %o0, 0x1f, %l0 iop->offset += bytes; 2004b2c: c4 1f 20 10 ldd [ %i4 + 0x10 ], %g2 2004b30: 86 80 c0 08 addcc %g3, %o0, %g3 total += bytes; 2004b34: b0 06 00 08 add %i0, %o0, %i0 if ( bytes < 0 ) return -1; if ( bytes > 0 ) { iop->offset += bytes; 2004b38: 84 40 80 10 addx %g2, %l0, %g2 2004b3c: c4 3f 20 10 std %g2, [ %i4 + 0x10 ] total += bytes; } if (bytes != iov[ v ].iov_len) 2004b40: c2 06 e0 04 ld [ %i3 + 4 ], %g1 2004b44: 80 a2 00 01 cmp %o0, %g1 2004b48: 12 80 00 05 bne 2004b5c <== NEVER TAKEN 2004b4c: ba 07 60 08 add %i5, 8, %i5 } /* * Now process the readv(). */ for ( total=0, v=0 ; v < iovcnt ; v++ ) { 2004b50: 80 a7 40 1a cmp %i5, %i2 2004b54: 32 bf ff eb bne,a 2004b00 2004b58: c2 07 20 24 ld [ %i4 + 0x24 ], %g1 2004b5c: 81 c7 e0 08 ret 2004b60: 81 e8 00 00 restore /* check for wrap */ old = total; total += iov[v].iov_len; if ( total < old ) rtems_set_errno_and_return_minus_one( EINVAL ); 2004b64: 40 00 2d ec call 2010314 <__errno> 2004b68: b0 10 3f ff mov -1, %i0 2004b6c: 82 10 20 16 mov 0x16, %g1 2004b70: c2 22 00 00 st %g1, [ %o0 ] 2004b74: 81 c7 e0 08 ret 2004b78: 81 e8 00 00 restore rtems_libio_t *iop; bool all_zeros; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open( iop ); 2004b7c: 40 00 2d e6 call 2010314 <__errno> 2004b80: b0 10 3f ff mov -1, %i0 2004b84: 82 10 20 09 mov 9, %g1 2004b88: c2 22 00 00 st %g1, [ %o0 ] 2004b8c: 81 c7 e0 08 ret 2004b90: 81 e8 00 00 restore =============================================================================== 0201a1b4 : void *realloc( void *ptr, size_t size ) { 201a1b4: 9d e3 bf 98 save %sp, -104, %sp uintptr_t old_size; char *new_area; MSBUMP(realloc_calls, 1); 201a1b8: 3b 00 80 75 sethi %hi(0x201d400), %i5 201a1bc: ba 17 63 a0 or %i5, 0x3a0, %i5 ! 201d7a0 201a1c0: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 /* * Do not attempt to allocate memory if in a critical section or ISR. */ if (_System_state_Is_up(_System_state_Get())) { 201a1c4: 03 00 80 76 sethi %hi(0x201d800), %g1 201a1c8: c2 00 62 ac ld [ %g1 + 0x2ac ], %g1 ! 201daac <_System_state_Current> ) { uintptr_t old_size; char *new_area; MSBUMP(realloc_calls, 1); 201a1cc: 84 00 a0 01 inc %g2 /* * Do not attempt to allocate memory if in a critical section or ISR. */ if (_System_state_Is_up(_System_state_Get())) { 201a1d0: 80 a0 60 03 cmp %g1, 3 201a1d4: 02 80 00 2c be 201a284 <== ALWAYS TAKEN 201a1d8: c4 27 60 10 st %g2, [ %i5 + 0x10 ] } /* * Continue with realloc(). */ if ( !ptr ) 201a1dc: 80 a6 20 00 cmp %i0, 0 <== NOT EXECUTED 201a1e0: 02 80 00 49 be 201a304 201a1e4: 01 00 00 00 nop return malloc( size ); if ( !size ) { 201a1e8: 80 a6 60 00 cmp %i1, 0 201a1ec: 02 80 00 3b be 201a2d8 <== NEVER TAKEN 201a1f0: 39 00 80 73 sethi %hi(0x201cc00), %i4 free( ptr ); return (void *) 0; } if ( !_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, ptr, &old_size) ) { 201a1f4: d0 07 20 d0 ld [ %i4 + 0xd0 ], %o0 ! 201ccd0 201a1f8: 92 10 00 18 mov %i0, %o1 201a1fc: 40 00 01 da call 201a964 <_Protected_heap_Get_block_size> 201a200: 94 07 bf fc add %fp, -4, %o2 201a204: 80 8a 20 ff btst 0xff, %o0 201a208: 02 80 00 39 be 201a2ec 201a20c: 01 00 00 00 nop } /* * Now resize it. */ if ( _Protected_heap_Resize_block( RTEMS_Malloc_Heap, ptr, size ) ) { 201a210: d0 07 20 d0 ld [ %i4 + 0xd0 ], %o0 201a214: 92 10 00 18 mov %i0, %o1 201a218: 40 00 01 e1 call 201a99c <_Protected_heap_Resize_block> 201a21c: 94 10 00 19 mov %i1, %o2 201a220: 80 8a 20 ff btst 0xff, %o0 201a224: 02 80 00 04 be 201a234 201a228: 01 00 00 00 nop memcpy( new_area, ptr, (size < old_size) ? size : old_size ); free( ptr ); return new_area; } 201a22c: 81 c7 e0 08 ret 201a230: 81 e8 00 00 restore * 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 ); 201a234: 7f ff a4 03 call 2003240 201a238: 90 10 00 19 mov %i1, %o0 MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */ 201a23c: c2 07 60 04 ld [ %i5 + 4 ], %g1 * 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 ); 201a240: b8 10 00 08 mov %o0, %i4 MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */ 201a244: 82 00 7f ff add %g1, -1, %g1 if ( !new_area ) { 201a248: 80 a2 20 00 cmp %o0, 0 201a24c: 02 80 00 30 be 201a30c 201a250: c2 27 60 04 st %g1, [ %i5 + 4 ] return (void *) 0; } memcpy( new_area, ptr, (size < old_size) ? size : old_size ); 201a254: c2 07 bf fc ld [ %fp + -4 ], %g1 201a258: 80 a6 40 01 cmp %i1, %g1 201a25c: 18 80 00 16 bgu 201a2b4 <== ALWAYS TAKEN 201a260: 94 10 00 19 mov %i1, %o2 201a264: 92 10 00 18 mov %i0, %o1 <== NOT EXECUTED 201a268: 7f ff d8 06 call 2010280 <== NOT EXECUTED 201a26c: 90 10 00 1c mov %i4, %o0 <== NOT EXECUTED free( ptr ); 201a270: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 201a274: 7f ff a3 10 call 2002eb4 <== NOT EXECUTED 201a278: b0 10 00 1c mov %i4, %i0 <== NOT EXECUTED return new_area; 201a27c: 81 c7 e0 08 ret <== NOT EXECUTED 201a280: 81 e8 00 00 restore <== NOT EXECUTED * This routine returns true if thread dispatch indicates * that we are in a critical section. */ RTEMS_INLINE_ROUTINE bool _Thread_Dispatch_in_critical_section(void) { if ( _Thread_Dispatch_disable_level == 0 ) 201a284: 03 00 80 76 sethi %hi(0x201d800), %g1 201a288: c2 00 61 50 ld [ %g1 + 0x150 ], %g1 ! 201d950 <_Thread_Dispatch_disable_level> 201a28c: 80 a0 60 00 cmp %g1, 0 201a290: 12 80 00 07 bne 201a2ac <== NEVER TAKEN 201a294: 01 00 00 00 nop if (_System_state_Is_up(_System_state_Get())) { if (_Thread_Dispatch_in_critical_section()) return (void *) 0; if (_ISR_Nest_level > 0) 201a298: 03 00 80 77 sethi %hi(0x201dc00), %g1 201a29c: c2 00 62 90 ld [ %g1 + 0x290 ], %g1 ! 201de90 <_Per_CPU_Information+0x8> 201a2a0: 80 a0 60 00 cmp %g1, 0 201a2a4: 22 bf ff cf be,a 201a1e0 <== ALWAYS TAKEN 201a2a8: 80 a6 20 00 cmp %i0, 0 return (void *) 0; 201a2ac: 81 c7 e0 08 ret <== NOT EXECUTED 201a2b0: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED if ( !new_area ) { return (void *) 0; } memcpy( new_area, ptr, (size < old_size) ? size : old_size ); 201a2b4: 92 10 00 18 mov %i0, %o1 201a2b8: 94 10 00 01 mov %g1, %o2 201a2bc: 7f ff d7 f1 call 2010280 201a2c0: 90 10 00 1c mov %i4, %o0 free( ptr ); 201a2c4: 90 10 00 18 mov %i0, %o0 201a2c8: 7f ff a2 fb call 2002eb4 201a2cc: b0 10 00 1c mov %i4, %i0 return new_area; 201a2d0: 81 c7 e0 08 ret 201a2d4: 81 e8 00 00 restore */ if ( !ptr ) return malloc( size ); if ( !size ) { free( ptr ); 201a2d8: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 201a2dc: 7f ff a2 f6 call 2002eb4 <== NOT EXECUTED 201a2e0: b0 10 20 00 clr %i0 <== NOT EXECUTED return (void *) 0; 201a2e4: 81 c7 e0 08 ret <== NOT EXECUTED 201a2e8: 81 e8 00 00 restore <== NOT EXECUTED } if ( !_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, ptr, &old_size) ) { errno = EINVAL; 201a2ec: 7f ff d5 90 call 200f92c <__errno> 201a2f0: b0 10 20 00 clr %i0 201a2f4: 82 10 20 16 mov 0x16, %g1 201a2f8: c2 22 00 00 st %g1, [ %o0 ] return (void *) 0; 201a2fc: 81 c7 e0 08 ret 201a300: 81 e8 00 00 restore /* * Continue with realloc(). */ if ( !ptr ) return malloc( size ); 201a304: 7f ff a3 cf call 2003240 201a308: 91 e8 00 19 restore %g0, %i1, %o0 memcpy( new_area, ptr, (size < old_size) ? size : old_size ); free( ptr ); return new_area; } 201a30c: 81 c7 e0 08 ret 201a310: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 02003e04 : #include int rmdir( const char *pathname ) { 2003e04: 9d e3 bf 70 save %sp, -144, %sp /* * Get the parent node of the node we wish to remove. Find the parent path. */ parentpathlen = rtems_filesystem_dirname ( pathname ); 2003e08: 90 10 00 18 mov %i0, %o0 2003e0c: 7f ff fc 12 call 2002e54 2003e10: ba 10 00 18 mov %i0, %i5 if ( parentpathlen == 0 ) 2003e14: 80 a2 20 00 cmp %o0, 0 2003e18: 12 80 00 29 bne 2003ebc 2003e1c: b6 10 00 08 mov %o0, %i3 rtems_filesystem_get_start_loc( pathname, &i, &parentloc ); 2003e20: b8 07 bf d4 add %fp, -44, %i4 2003e24: 90 10 00 18 mov %i0, %o0 2003e28: 92 07 bf fc add %fp, -4, %o1 2003e2c: 94 10 00 1c mov %i4, %o2 2003e30: 40 00 00 56 call 2003f88 2003e34: b6 10 20 00 clr %i3 const char *name; rtems_filesystem_location_info_t parentloc; rtems_filesystem_location_info_t loc; int i; int result; bool free_parentloc = false; 2003e38: b4 10 20 00 clr %i2 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 2003e3c: c2 07 bf d4 ld [ %fp + -44 ], %g1 name = pathname + parentpathlen; 2003e40: ba 07 40 1b add %i5, %i3, %i5 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 2003e44: c2 27 bf e8 st %g1, [ %fp + -24 ] 2003e48: c2 07 bf d8 ld [ %fp + -40 ], %g1 name = pathname + parentpathlen; name += rtems_filesystem_prefix_separators( name, strlen( name ) ); 2003e4c: 90 10 00 1d mov %i5, %o0 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 2003e50: c2 27 bf ec st %g1, [ %fp + -20 ] 2003e54: c2 07 bf dc ld [ %fp + -36 ], %g1 2003e58: c2 27 bf f0 st %g1, [ %fp + -16 ] 2003e5c: c2 07 bf e0 ld [ %fp + -32 ], %g1 2003e60: c2 27 bf f4 st %g1, [ %fp + -12 ] 2003e64: c2 07 bf e4 ld [ %fp + -28 ], %g1 name = pathname + parentpathlen; name += rtems_filesystem_prefix_separators( name, strlen( name ) ); 2003e68: 40 00 33 03 call 2010a74 2003e6c: c2 27 bf f8 st %g1, [ %fp + -8 ] 2003e70: 92 10 00 08 mov %o0, %o1 2003e74: 7f ff fc 07 call 2002e90 2003e78: 90 10 00 1d mov %i5, %o0 2003e7c: ba 07 40 08 add %i5, %o0, %i5 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 2003e80: 40 00 32 fd call 2010a74 2003e84: 90 10 00 1d mov %i5, %o0 2003e88: 94 10 20 00 clr %o2 2003e8c: 92 10 00 08 mov %o0, %o1 2003e90: 96 07 bf e8 add %fp, -24, %o3 2003e94: 90 10 00 1d mov %i5, %o0 2003e98: 7f ff fb c3 call 2002da4 2003e9c: 98 10 20 00 clr %o4 0, &loc, false ); if ( result != 0 ) { 2003ea0: 80 a2 20 00 cmp %o0, 0 2003ea4: 02 80 00 17 be 2003f00 2003ea8: 80 8e a0 ff btst 0xff, %i2 if ( free_parentloc ) 2003eac: 12 80 00 11 bne 2003ef0 2003eb0: b0 10 3f ff mov -1, %i0 rtems_filesystem_freenode( &loc ); if ( free_parentloc ) rtems_filesystem_freenode( &parentloc ); return result; } 2003eb4: 81 c7 e0 08 ret 2003eb8: 81 e8 00 00 restore parentpathlen = rtems_filesystem_dirname ( pathname ); if ( parentpathlen == 0 ) rtems_filesystem_get_start_loc( pathname, &i, &parentloc ); else { result = rtems_filesystem_evaluate_path(pathname, parentpathlen, 2003ebc: b8 07 bf d4 add %fp, -44, %i4 2003ec0: 90 10 00 18 mov %i0, %o0 2003ec4: 92 10 00 1b mov %i3, %o1 2003ec8: 94 10 20 02 mov 2, %o2 2003ecc: 96 10 00 1c mov %i4, %o3 2003ed0: 98 10 20 00 clr %o4 2003ed4: 7f ff fb d1 call 2002e18 2003ed8: b0 10 3f ff mov -1, %i0 RTEMS_LIBIO_PERMS_WRITE, &parentloc, false ); if ( result != 0 ) 2003edc: 80 a2 20 00 cmp %o0, 0 2003ee0: 12 bf ff f5 bne 2003eb4 <== NEVER TAKEN 2003ee4: b4 10 20 01 mov 1, %i2 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 2003ee8: 10 bf ff d6 b 2003e40 2003eec: c2 07 bf d4 ld [ %fp + -44 ], %g1 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 0, &loc, false ); if ( result != 0 ) { if ( free_parentloc ) rtems_filesystem_freenode( &parentloc ); 2003ef0: 7f ff fc 04 call 2002f00 2003ef4: 90 10 00 1c mov %i4, %o0 2003ef8: 81 c7 e0 08 ret 2003efc: 81 e8 00 00 restore } /* * Verify you can remove this node as a directory. */ if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 2003f00: c2 07 bf f4 ld [ %fp + -12 ], %g1 2003f04: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 2003f08: 9f c0 40 00 call %g1 2003f0c: 90 07 bf e8 add %fp, -24, %o0 2003f10: 80 a2 20 01 cmp %o0, 1 2003f14: 12 80 00 10 bne 2003f54 2003f18: c2 07 bf f0 ld [ %fp + -16 ], %g1 /* * Use the filesystems rmnod to remove the node. */ result = (*loc.handlers->rmnod_h)( &parentloc, &loc ); 2003f1c: 92 07 bf e8 add %fp, -24, %o1 2003f20: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 2003f24: 9f c0 40 00 call %g1 2003f28: 90 10 00 1c mov %i4, %o0 2003f2c: b0 10 00 08 mov %o0, %i0 rtems_filesystem_freenode( &loc ); 2003f30: 7f ff fb f4 call 2002f00 2003f34: 90 07 bf e8 add %fp, -24, %o0 if ( free_parentloc ) 2003f38: 80 8e a0 ff btst 0xff, %i2 2003f3c: 02 80 00 11 be 2003f80 2003f40: 01 00 00 00 nop rtems_filesystem_freenode( &parentloc ); 2003f44: 7f ff fb ef call 2002f00 2003f48: 90 10 00 1c mov %i4, %o0 return result; } 2003f4c: 81 c7 e0 08 ret 2003f50: 81 e8 00 00 restore /* * Verify you can remove this node as a directory. */ if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { rtems_filesystem_freenode( &loc ); 2003f54: 7f ff fb eb call 2002f00 2003f58: 90 07 bf e8 add %fp, -24, %o0 if ( free_parentloc ) 2003f5c: 80 8e a0 ff btst 0xff, %i2 2003f60: 02 80 00 04 be 2003f70 <== NEVER TAKEN 2003f64: 01 00 00 00 nop rtems_filesystem_freenode( &parentloc ); 2003f68: 7f ff fb e6 call 2002f00 2003f6c: 90 10 00 1c mov %i4, %o0 rtems_set_errno_and_return_minus_one( ENOTDIR ); 2003f70: 40 00 2f 4a call 200fc98 <__errno> 2003f74: b0 10 3f ff mov -1, %i0 2003f78: 82 10 20 14 mov 0x14, %g1 2003f7c: c2 22 00 00 st %g1, [ %o0 ] 2003f80: 81 c7 e0 08 ret 2003f84: 81 e8 00 00 restore =============================================================================== 02007514 : * errno - otherwise */ int rtems_aio_enqueue (rtems_aio_request *req) { 2007514: 9d e3 bf 78 save %sp, -136, %sp struct sched_param param; /* The queue should be initialized */ AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED); result = pthread_mutex_lock (&aio_request_queue.mutex); 2007518: 3b 00 80 66 sethi %hi(0x2019800), %i5 200751c: 40 00 02 75 call 2007ef0 2007520: 90 17 63 7c or %i5, 0x37c, %o0 ! 2019b7c if (result != 0) { 2007524: b8 92 20 00 orcc %o0, 0, %i4 2007528: 12 80 00 31 bne 20075ec <== NEVER TAKEN 200752c: 90 10 00 18 mov %i0, %o0 return result; } /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); 2007530: 40 00 04 a5 call 20087c4 2007534: b6 17 63 7c or %i5, 0x37c, %i3 2007538: 92 07 bf fc add %fp, -4, %o1 200753c: 40 00 03 93 call 2008388 2007540: 94 07 bf dc add %fp, -36, %o2 req->caller_thread = pthread_self (); 2007544: 40 00 04 a0 call 20087c4 2007548: 01 00 00 00 nop req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 200754c: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 req->policy = policy; 2007550: c6 07 bf fc ld [ %fp + -4 ], %g3 /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); req->caller_thread = pthread_self (); req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 2007554: c4 00 60 18 ld [ %g1 + 0x18 ], %g2 req->policy = policy; 2007558: c6 26 20 08 st %g3, [ %i0 + 8 ] /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); req->caller_thread = pthread_self (); req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 200755c: c6 07 bf dc ld [ %fp + -36 ], %g3 /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); req->caller_thread = pthread_self (); 2007560: d0 26 20 10 st %o0, [ %i0 + 0x10 ] req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 2007564: 84 20 c0 02 sub %g3, %g2, %g2 2007568: c4 26 20 0c st %g2, [ %i0 + 0xc ] req->policy = policy; req->aiocbp->error_code = EINPROGRESS; req->aiocbp->return_value = 0; if ((aio_request_queue.idle_threads == 0) && 200756c: c4 06 e0 68 ld [ %i3 + 0x68 ], %g2 pthread_getschedparam (pthread_self(), &policy, ¶m); req->caller_thread = pthread_self (); req->priority = param.sched_priority - req->aiocbp->aio_reqprio; req->policy = policy; req->aiocbp->error_code = EINPROGRESS; 2007570: 86 10 20 77 mov 0x77, %g3 req->aiocbp->return_value = 0; 2007574: c0 20 60 38 clr [ %g1 + 0x38 ] pthread_getschedparam (pthread_self(), &policy, ¶m); req->caller_thread = pthread_self (); req->priority = param.sched_priority - req->aiocbp->aio_reqprio; req->policy = policy; req->aiocbp->error_code = EINPROGRESS; 2007578: c6 20 60 34 st %g3, [ %g1 + 0x34 ] req->aiocbp->return_value = 0; if ((aio_request_queue.idle_threads == 0) && 200757c: 80 a0 a0 00 cmp %g2, 0 2007580: 12 80 00 06 bne 2007598 <== NEVER TAKEN 2007584: d2 00 40 00 ld [ %g1 ], %o1 2007588: c4 06 e0 64 ld [ %i3 + 0x64 ], %g2 200758c: 80 a0 a0 04 cmp %g2, 4 2007590: 24 80 00 1b ble,a 20075fc 2007594: 90 06 e0 48 add %i3, 0x48, %o0 else { /* the maximum number of threads has been already created even though some of them might be idle. The request belongs to one of the active fd chain */ r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, 2007598: 94 10 20 00 clr %o2 200759c: 11 00 80 66 sethi %hi(0x2019800), %o0 20075a0: 7f ff fe a0 call 2007020 20075a4: 90 12 23 c4 or %o0, 0x3c4, %o0 ! 2019bc4 req->aiocbp->aio_fildes, 0); if (r_chain != NULL) 20075a8: b4 92 20 00 orcc %o0, 0, %i2 20075ac: 22 80 00 31 be,a 2007670 20075b0: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 { pthread_mutex_lock (&r_chain->mutex); 20075b4: b6 06 a0 1c add %i2, 0x1c, %i3 20075b8: 40 00 02 4e call 2007ef0 20075bc: 90 10 00 1b mov %i3, %o0 rtems_aio_insert_prio (&r_chain->perfd, req); 20075c0: 90 06 a0 08 add %i2, 8, %o0 20075c4: 7f ff ff 89 call 20073e8 20075c8: 92 10 00 18 mov %i0, %o1 pthread_cond_signal (&r_chain->cond); 20075cc: 40 00 01 25 call 2007a60 20075d0: 90 06 a0 20 add %i2, 0x20, %o0 pthread_mutex_unlock (&r_chain->mutex); 20075d4: 40 00 02 67 call 2007f70 20075d8: 90 10 00 1b mov %i3, %o0 if (aio_request_queue.idle_threads > 0) pthread_cond_signal (&aio_request_queue.new_req); } } pthread_mutex_unlock (&aio_request_queue.mutex); 20075dc: 40 00 02 65 call 2007f70 20075e0: 90 17 63 7c or %i5, 0x37c, %o0 return 0; } 20075e4: 81 c7 e0 08 ret 20075e8: 91 e8 00 1c restore %g0, %i4, %o0 /* The queue should be initialized */ AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED); result = pthread_mutex_lock (&aio_request_queue.mutex); if (result != 0) { free (req); 20075ec: 7f ff f0 1e call 2003664 <== NOT EXECUTED 20075f0: b0 10 00 1c mov %i4, %i0 <== NOT EXECUTED } } pthread_mutex_unlock (&aio_request_queue.mutex); return 0; } 20075f4: 81 c7 e0 08 ret <== NOT EXECUTED 20075f8: 81 e8 00 00 restore <== NOT EXECUTED if ((aio_request_queue.idle_threads == 0) && aio_request_queue.active_threads < AIO_MAX_THREADS) /* we still have empty places on the active_threads chain */ { chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 20075fc: 7f ff fe 89 call 2007020 2007600: 94 10 20 01 mov 1, %o2 if (r_chain->new_fd == 1) { 2007604: c2 02 20 18 ld [ %o0 + 0x18 ], %g1 2007608: 80 a0 60 01 cmp %g1, 1 200760c: 12 bf ff ea bne 20075b4 2007610: b4 10 00 08 mov %o0, %i2 RTEMS_INLINE_ROUTINE void _Chain_Prepend( Chain_Control *the_chain, Chain_Node *the_node ) { _Chain_Insert(_Chain_Head(the_chain), the_node); 2007614: 90 02 20 08 add %o0, 8, %o0 2007618: 40 00 09 0b call 2009a44 <_Chain_Insert> 200761c: 92 10 00 18 mov %i0, %o1 rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; pthread_mutex_init (&r_chain->mutex, NULL); 2007620: 92 10 20 00 clr %o1 chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); if (r_chain->new_fd == 1) { rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; 2007624: c0 26 a0 18 clr [ %i2 + 0x18 ] pthread_mutex_init (&r_chain->mutex, NULL); 2007628: 40 00 01 da call 2007d90 200762c: 90 06 a0 1c add %i2, 0x1c, %o0 pthread_cond_init (&r_chain->cond, NULL); 2007630: 92 10 20 00 clr %o1 2007634: 40 00 00 db call 20079a0 2007638: 90 06 a0 20 add %i2, 0x20, %o0 AIO_printf ("New thread \n"); result = pthread_create (&thid, &aio_request_queue.attr, 200763c: 90 07 bf f8 add %fp, -8, %o0 2007640: 92 06 e0 08 add %i3, 8, %o1 2007644: 96 10 00 1a mov %i2, %o3 2007648: 15 00 80 1c sethi %hi(0x2007000), %o2 200764c: 40 00 02 ae call 2008104 2007650: 94 12 a1 7c or %o2, 0x17c, %o2 ! 200717c rtems_aio_handle, (void *) r_chain); if (result != 0) { 2007654: 82 92 20 00 orcc %o0, 0, %g1 2007658: 12 80 00 25 bne 20076ec <== NEVER TAKEN 200765c: 90 10 00 1b mov %i3, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); return result; } ++aio_request_queue.active_threads; 2007660: c2 06 e0 64 ld [ %i3 + 0x64 ], %g1 2007664: 82 00 60 01 inc %g1 2007668: 10 bf ff dd b 20075dc 200766c: c2 26 e0 64 st %g1, [ %i3 + 0x64 ] } else { /* or to the idle chain */ chain = &aio_request_queue.idle_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 2007670: 11 00 80 66 sethi %hi(0x2019800), %o0 2007674: d2 00 40 00 ld [ %g1 ], %o1 2007678: 90 12 23 d0 or %o0, 0x3d0, %o0 200767c: 7f ff fe 69 call 2007020 2007680: 94 10 20 01 mov 1, %o2 if (r_chain->new_fd == 1) { 2007684: c2 02 20 18 ld [ %o0 + 0x18 ], %g1 } else { /* or to the idle chain */ chain = &aio_request_queue.idle_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 2007688: b4 10 00 08 mov %o0, %i2 200768c: 92 10 00 18 mov %i0, %o1 if (r_chain->new_fd == 1) { 2007690: 80 a0 60 01 cmp %g1, 1 2007694: 02 80 00 0b be 20076c0 2007698: 90 02 20 08 add %o0, 8, %o0 r_chain->new_fd = 0; pthread_mutex_init (&r_chain->mutex, NULL); pthread_cond_init (&r_chain->cond, NULL); } else /* just insert the request in the existing fd chain */ rtems_aio_insert_prio (&r_chain->perfd, req); 200769c: 7f ff ff 53 call 20073e8 20076a0: 01 00 00 00 nop if (aio_request_queue.idle_threads > 0) 20076a4: c2 06 e0 68 ld [ %i3 + 0x68 ], %g1 20076a8: 80 a0 60 00 cmp %g1, 0 20076ac: 04 bf ff cc ble 20075dc <== ALWAYS TAKEN 20076b0: 01 00 00 00 nop pthread_cond_signal (&aio_request_queue.new_req); 20076b4: 40 00 00 eb call 2007a60 <== NOT EXECUTED 20076b8: 90 06 e0 04 add %i3, 4, %o0 <== NOT EXECUTED 20076bc: 30 bf ff c8 b,a 20075dc <== NOT EXECUTED 20076c0: 40 00 08 e1 call 2009a44 <_Chain_Insert> 20076c4: 01 00 00 00 nop /* If this is a new fd chain we signal the idle threads that might be waiting for requests */ AIO_printf (" New chain on waiting queue \n "); rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; pthread_mutex_init (&r_chain->mutex, NULL); 20076c8: 90 06 a0 1c add %i2, 0x1c, %o0 if (r_chain->new_fd == 1) { /* If this is a new fd chain we signal the idle threads that might be waiting for requests */ AIO_printf (" New chain on waiting queue \n "); rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; 20076cc: c0 26 a0 18 clr [ %i2 + 0x18 ] pthread_mutex_init (&r_chain->mutex, NULL); 20076d0: 40 00 01 b0 call 2007d90 20076d4: 92 10 20 00 clr %o1 pthread_cond_init (&r_chain->cond, NULL); 20076d8: 90 06 a0 20 add %i2, 0x20, %o0 20076dc: 40 00 00 b1 call 20079a0 20076e0: 92 10 20 00 clr %o1 } else /* just insert the request in the existing fd chain */ rtems_aio_insert_prio (&r_chain->perfd, req); if (aio_request_queue.idle_threads > 0) 20076e4: 10 bf ff f1 b 20076a8 20076e8: c2 06 e0 68 ld [ %i3 + 0x68 ], %g1 AIO_printf ("New thread \n"); result = pthread_create (&thid, &aio_request_queue.attr, rtems_aio_handle, (void *) r_chain); if (result != 0) { pthread_mutex_unlock (&aio_request_queue.mutex); 20076ec: 40 00 02 21 call 2007f70 <== NOT EXECUTED 20076f0: b8 10 00 01 mov %g1, %i4 <== NOT EXECUTED return result; 20076f4: 30 bf ff bc b,a 20075e4 <== NOT EXECUTED =============================================================================== 0200717c : * NULL - if error */ static void * rtems_aio_handle (void *arg) { 200717c: 9d e3 bf 78 save %sp, -136, %sp struct timespec timeout; AIO_printf ("Chain is empty [WQ], wait for work\n"); pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_lock (&aio_request_queue.mutex); 2007180: 37 00 80 66 sethi %hi(0x2019800), %i3 2007184: b8 06 20 1c add %i0, 0x1c, %i4 2007188: b6 16 e3 7c or %i3, 0x37c, %i3 if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 200718c: b4 10 00 1b mov %i3, %i2 pthread_cond_destroy (&r_chain->cond); free (r_chain); /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { 2007190: b2 06 e0 58 add %i3, 0x58, %i1 --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 2007194: a0 06 e0 04 add %i3, 4, %l0 /* acquire the mutex of the current fd chain. we don't need to lock the queue mutex since we can add requests to idle fd chains or even active ones if the working request has been extracted from the chain */ result = pthread_mutex_lock (&r_chain->mutex); 2007198: 40 00 03 56 call 2007ef0 200719c: 90 10 00 1c mov %i4, %o0 if (result != 0) 20071a0: 80 a2 20 00 cmp %o0, 0 20071a4: 12 80 00 2b bne 2007250 <== NEVER TAKEN 20071a8: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 20071ac: fa 06 20 08 ld [ %i0 + 8 ], %i5 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 20071b0: 82 06 20 0c add %i0, 0xc, %g1 /* If the locked chain is not empty, take the first request extract it, unlock the chain and process the request, in this way the user can supply more requests to this fd chain */ if (!rtems_chain_is_empty (chain)) { 20071b4: 80 a7 40 01 cmp %i5, %g1 20071b8: 02 80 00 41 be 20072bc 20071bc: 01 00 00 00 nop node = rtems_chain_first (chain); req = (rtems_aio_request *) node; /* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING discussion in rtems_aio_enqueue () */ pthread_getschedparam (pthread_self(), &policy, ¶m); 20071c0: 40 00 05 81 call 20087c4 20071c4: 01 00 00 00 nop 20071c8: 92 07 bf fc add %fp, -4, %o1 20071cc: 40 00 04 6f call 2008388 20071d0: 94 07 bf d8 add %fp, -40, %o2 param.sched_priority = req->priority; 20071d4: c2 07 60 0c ld [ %i5 + 0xc ], %g1 pthread_setschedparam (pthread_self(), req->policy, ¶m); 20071d8: 40 00 05 7b call 20087c4 20071dc: c2 27 bf d8 st %g1, [ %fp + -40 ] 20071e0: d2 07 60 08 ld [ %i5 + 8 ], %o1 20071e4: 40 00 05 7c call 20087d4 20071e8: 94 07 bf d8 add %fp, -40, %o2 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 20071ec: 40 00 09 fe call 20099e4 <_Chain_Extract> 20071f0: 90 10 00 1d mov %i5, %o0 rtems_chain_extract (node); pthread_mutex_unlock (&r_chain->mutex); 20071f4: 40 00 03 5f call 2007f70 20071f8: 90 10 00 1c mov %i4, %o0 switch (req->aiocbp->aio_lio_opcode) { 20071fc: e2 07 60 14 ld [ %i5 + 0x14 ], %l1 2007200: c2 04 60 30 ld [ %l1 + 0x30 ], %g1 2007204: 80 a0 60 02 cmp %g1, 2 2007208: 22 80 00 25 be,a 200729c 200720c: c4 1c 60 08 ldd [ %l1 + 8 ], %g2 2007210: 80 a0 60 03 cmp %g1, 3 2007214: 02 80 00 1e be 200728c <== NEVER TAKEN 2007218: 01 00 00 00 nop 200721c: 80 a0 60 01 cmp %g1, 1 2007220: 22 80 00 0e be,a 2007258 <== ALWAYS TAKEN 2007224: c4 1c 60 08 ldd [ %l1 + 8 ], %g2 default: result = -1; } if (result == -1) { req->aiocbp->return_value = -1; 2007228: 82 10 3f ff mov -1, %g1 <== NOT EXECUTED req->aiocbp->error_code = errno; 200722c: 40 00 2b 87 call 2012048 <__errno> <== NOT EXECUTED 2007230: c2 24 60 38 st %g1, [ %l1 + 0x38 ] <== NOT EXECUTED 2007234: c2 02 00 00 ld [ %o0 ], %g1 <== NOT EXECUTED /* acquire the mutex of the current fd chain. we don't need to lock the queue mutex since we can add requests to idle fd chains or even active ones if the working request has been extracted from the chain */ result = pthread_mutex_lock (&r_chain->mutex); 2007238: 90 10 00 1c mov %i4, %o0 <== NOT EXECUTED 200723c: 40 00 03 2d call 2007ef0 <== NOT EXECUTED 2007240: c2 24 60 34 st %g1, [ %l1 + 0x34 ] <== NOT EXECUTED if (result != 0) 2007244: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 2007248: 22 bf ff da be,a 20071b0 <== NOT EXECUTED 200724c: fa 06 20 08 ld [ %i0 + 8 ], %i5 <== NOT EXECUTED } } AIO_printf ("Thread finished\n"); return NULL; } 2007250: 81 c7 e0 08 ret 2007254: 91 e8 20 00 restore %g0, 0, %o0 pthread_mutex_unlock (&r_chain->mutex); switch (req->aiocbp->aio_lio_opcode) { case LIO_READ: AIO_printf ("read\n"); result = pread (req->aiocbp->aio_fildes, 2007258: d0 04 40 00 ld [ %l1 ], %o0 200725c: d2 04 60 10 ld [ %l1 + 0x10 ], %o1 2007260: d4 04 60 14 ld [ %l1 + 0x14 ], %o2 2007264: 96 10 00 02 mov %g2, %o3 2007268: 40 00 2e 94 call 2012cb8 200726c: 98 10 00 03 mov %g3, %o4 break; default: result = -1; } if (result == -1) { 2007270: 80 a2 3f ff cmp %o0, -1 2007274: 22 bf ff ed be,a 2007228 <== NEVER TAKEN 2007278: e2 07 60 14 ld [ %i5 + 0x14 ], %l1 <== NOT EXECUTED req->aiocbp->return_value = -1; req->aiocbp->error_code = errno; } else { req->aiocbp->return_value = result; 200727c: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 2007280: d0 20 60 38 st %o0, [ %g1 + 0x38 ] req->aiocbp->error_code = 0; 2007284: 10 bf ff c5 b 2007198 2007288: c0 20 60 34 clr [ %g1 + 0x34 ] req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; case LIO_SYNC: AIO_printf ("sync\n"); result = fsync (req->aiocbp->aio_fildes); 200728c: 40 00 1d 9e call 200e904 <== NOT EXECUTED 2007290: d0 04 40 00 ld [ %l1 ], %o0 <== NOT EXECUTED break; 2007294: 10 bf ff f8 b 2007274 <== NOT EXECUTED 2007298: 80 a2 3f ff cmp %o0, -1 <== NOT EXECUTED req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; case LIO_WRITE: AIO_printf ("write\n"); result = pwrite (req->aiocbp->aio_fildes, 200729c: d0 04 40 00 ld [ %l1 ], %o0 20072a0: d2 04 60 10 ld [ %l1 + 0x10 ], %o1 20072a4: d4 04 60 14 ld [ %l1 + 0x14 ], %o2 20072a8: 96 10 00 02 mov %g2, %o3 20072ac: 40 00 2e c1 call 2012db0 20072b0: 98 10 00 03 mov %g3, %o4 (void *) req->aiocbp->aio_buf, req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; 20072b4: 10 bf ff f0 b 2007274 20072b8: 80 a2 3f ff cmp %o0, -1 struct timespec timeout; AIO_printf ("Chain is empty [WQ], wait for work\n"); pthread_mutex_unlock (&r_chain->mutex); 20072bc: 40 00 03 2d call 2007f70 20072c0: 90 10 00 1c mov %i4, %o0 pthread_mutex_lock (&aio_request_queue.mutex); 20072c4: 40 00 03 0b call 2007ef0 20072c8: 90 10 00 1b mov %i3, %o0 if (rtems_chain_is_empty (chain)) 20072cc: c2 06 20 08 ld [ %i0 + 8 ], %g1 20072d0: 80 a7 40 01 cmp %i5, %g1 20072d4: 02 80 00 05 be 20072e8 <== ALWAYS TAKEN 20072d8: 92 07 bf f4 add %fp, -12, %o1 } } /* If there was a request added in the initial fd chain then release the mutex and process it */ pthread_mutex_unlock (&aio_request_queue.mutex); 20072dc: 40 00 03 25 call 2007f70 20072e0: 90 10 00 1b mov %i3, %o0 20072e4: 30 bf ff ad b,a 2007198 pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); 20072e8: 40 00 01 50 call 2007828 20072ec: 90 10 20 01 mov 1, %o0 timeout.tv_sec += 3; 20072f0: c2 07 bf f4 ld [ %fp + -12 ], %g1 timeout.tv_nsec = 0; 20072f4: c0 27 bf f8 clr [ %fp + -8 ] pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 20072f8: 82 00 60 03 add %g1, 3, %g1 timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 20072fc: ba 06 20 20 add %i0, 0x20, %i5 pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 2007300: c2 27 bf f4 st %g1, [ %fp + -12 ] timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 2007304: 90 10 00 1d mov %i5, %o0 2007308: 92 10 00 1a mov %i2, %o1 200730c: 40 00 01 f4 call 2007adc 2007310: 94 07 bf f4 add %fp, -12, %o2 &aio_request_queue.mutex, &timeout); /* If no requests were added to the chain we delete the fd chain from the queue and start working with idle fd chains */ if (result == ETIMEDOUT) { 2007314: 80 a2 20 74 cmp %o0, 0x74 2007318: 12 bf ff f1 bne 20072dc <== NEVER TAKEN 200731c: 01 00 00 00 nop 2007320: 40 00 09 b1 call 20099e4 <_Chain_Extract> 2007324: 90 10 00 18 mov %i0, %o0 rtems_chain_extract (&r_chain->next_fd); pthread_mutex_destroy (&r_chain->mutex); 2007328: 40 00 02 47 call 2007c44 200732c: 90 10 00 1c mov %i4, %o0 pthread_cond_destroy (&r_chain->cond); 2007330: 40 00 01 66 call 20078c8 2007334: 90 10 00 1d mov %i5, %o0 free (r_chain); 2007338: 7f ff f0 cb call 2003664 200733c: 90 10 00 18 mov %i0, %o0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 2007340: f0 06 e0 54 ld [ %i3 + 0x54 ], %i0 /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { 2007344: 80 a6 00 19 cmp %i0, %i1 2007348: 22 80 00 0e be,a 2007380 200734c: c4 06 e0 68 ld [ %i3 + 0x68 ], %g2 } } /* Otherwise move this chain to the working chain and start the loop all over again */ AIO_printf ("Work on idle\n"); --aio_request_queue.idle_threads; 2007350: c4 06 a0 68 ld [ %i2 + 0x68 ], %g2 ++aio_request_queue.active_threads; 2007354: c2 06 a0 64 ld [ %i2 + 0x64 ], %g1 } } /* Otherwise move this chain to the working chain and start the loop all over again */ AIO_printf ("Work on idle\n"); --aio_request_queue.idle_threads; 2007358: 84 00 bf ff add %g2, -1, %g2 ++aio_request_queue.active_threads; 200735c: 82 00 60 01 inc %g1 2007360: 90 10 00 18 mov %i0, %o0 } } /* Otherwise move this chain to the working chain and start the loop all over again */ AIO_printf ("Work on idle\n"); --aio_request_queue.idle_threads; 2007364: c4 26 a0 68 st %g2, [ %i2 + 0x68 ] 2007368: 40 00 09 9f call 20099e4 <_Chain_Extract> 200736c: c2 26 a0 64 st %g1, [ %i2 + 0x64 ] 2007370: b8 06 20 1c add %i0, 0x1c, %i4 node = rtems_chain_first (&aio_request_queue.idle_req); rtems_chain_extract (node); r_chain = (rtems_aio_request_chain *) node; rtems_aio_move_to_work (r_chain); 2007374: 7f ff ff 64 call 2007104 2007378: 90 10 00 18 mov %i0, %o0 200737c: 30 bf ff d8 b,a 20072dc signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; 2007380: c2 06 e0 64 ld [ %i3 + 0x64 ], %g1 /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; 2007384: 84 00 a0 01 inc %g2 --aio_request_queue.active_threads; 2007388: 82 00 7f ff add %g1, -1, %g1 clock_gettime (CLOCK_REALTIME, &timeout); 200738c: 92 07 bf f4 add %fp, -12, %o1 /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; 2007390: c4 26 e0 68 st %g2, [ %i3 + 0x68 ] --aio_request_queue.active_threads; 2007394: c2 26 e0 64 st %g1, [ %i3 + 0x64 ] clock_gettime (CLOCK_REALTIME, &timeout); 2007398: 40 00 01 24 call 2007828 200739c: 90 10 20 01 mov 1, %o0 timeout.tv_sec += 3; 20073a0: c2 07 bf f4 ld [ %fp + -12 ], %g1 timeout.tv_nsec = 0; 20073a4: c0 27 bf f8 clr [ %fp + -8 ] AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 20073a8: 82 00 60 03 add %g1, 3, %g1 timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 20073ac: 90 10 00 10 mov %l0, %o0 AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 20073b0: c2 27 bf f4 st %g1, [ %fp + -12 ] timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 20073b4: 92 10 00 1b mov %i3, %o1 20073b8: 40 00 01 c9 call 2007adc 20073bc: 94 07 bf f4 add %fp, -12, %o2 &aio_request_queue.mutex, &timeout); /* If no new fd chain was added in the idle requests then this thread is finished */ if (result == ETIMEDOUT) { 20073c0: 80 a2 20 74 cmp %o0, 0x74 20073c4: 22 80 00 04 be,a 20073d4 <== ALWAYS TAKEN 20073c8: c2 06 e0 68 ld [ %i3 + 0x68 ], %g1 20073cc: 10 bf ff e1 b 2007350 <== NOT EXECUTED 20073d0: f0 06 e0 54 ld [ %i3 + 0x54 ], %i0 <== NOT EXECUTED AIO_printf ("Etimeout\n"); --aio_request_queue.idle_threads; pthread_mutex_unlock (&aio_request_queue.mutex); 20073d4: 90 10 00 1b mov %i3, %o0 /* If no new fd chain was added in the idle requests then this thread is finished */ if (result == ETIMEDOUT) { AIO_printf ("Etimeout\n"); --aio_request_queue.idle_threads; 20073d8: 82 00 7f ff add %g1, -1, %g1 pthread_mutex_unlock (&aio_request_queue.mutex); 20073dc: 40 00 02 e5 call 2007f70 20073e0: c2 26 e0 68 st %g1, [ %i3 + 0x68 ] return NULL; 20073e4: 30 bf ff 9b b,a 2007250 =============================================================================== 02006f18 : * 0 - if initialization succeeded */ int rtems_aio_init (void) { 2006f18: 9d e3 bf a0 save %sp, -96, %sp int result = 0; result = pthread_attr_init (&aio_request_queue.attr); 2006f1c: 3b 00 80 66 sethi %hi(0x2019800), %i5 2006f20: 40 00 04 5e call 2008098 2006f24: 90 17 63 84 or %i5, 0x384, %o0 ! 2019b84 if (result != 0) 2006f28: b0 92 20 00 orcc %o0, 0, %i0 2006f2c: 12 80 00 23 bne 2006fb8 <== NEVER TAKEN 2006f30: 90 17 63 84 or %i5, 0x384, %o0 return result; result = 2006f34: 40 00 04 65 call 20080c8 2006f38: 92 10 20 00 clr %o1 pthread_attr_setdetachstate (&aio_request_queue.attr, PTHREAD_CREATE_DETACHED); if (result != 0) 2006f3c: 80 a2 20 00 cmp %o0, 0 2006f40: 12 80 00 20 bne 2006fc0 <== NEVER TAKEN 2006f44: 39 00 80 66 sethi %hi(0x2019800), %i4 pthread_attr_destroy (&aio_request_queue.attr); result = pthread_mutex_init (&aio_request_queue.mutex, NULL); 2006f48: 92 10 20 00 clr %o1 2006f4c: 40 00 03 91 call 2007d90 2006f50: 90 17 23 7c or %i4, 0x37c, %o0 if (result != 0) 2006f54: 80 a2 20 00 cmp %o0, 0 2006f58: 12 80 00 23 bne 2006fe4 <== NEVER TAKEN 2006f5c: 92 10 20 00 clr %o1 pthread_attr_destroy (&aio_request_queue.attr); result = pthread_cond_init (&aio_request_queue.new_req, NULL); 2006f60: 11 00 80 66 sethi %hi(0x2019800), %o0 2006f64: 40 00 02 8f call 20079a0 2006f68: 90 12 23 80 or %o0, 0x380, %o0 ! 2019b80 if (result != 0) { 2006f6c: b0 92 20 00 orcc %o0, 0, %i0 2006f70: 12 80 00 26 bne 2007008 <== NEVER TAKEN 2006f74: 01 00 00 00 nop ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 2006f78: b8 17 23 7c or %i4, 0x37c, %i4 head->previous = NULL; tail->previous = head; 2006f7c: 82 07 20 54 add %i4, 0x54, %g1 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 2006f80: 88 07 20 4c add %i4, 0x4c, %g4 head->previous = NULL; tail->previous = head; 2006f84: 86 07 20 48 add %i4, 0x48, %g3 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 2006f88: 84 07 20 58 add %i4, 0x58, %g2 head->previous = NULL; tail->previous = head; 2006f8c: c2 27 20 5c st %g1, [ %i4 + 0x5c ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 2006f90: c8 27 20 48 st %g4, [ %i4 + 0x48 ] head->previous = NULL; 2006f94: c0 27 20 4c clr [ %i4 + 0x4c ] tail->previous = head; 2006f98: c6 27 20 50 st %g3, [ %i4 + 0x50 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 2006f9c: c4 27 20 54 st %g2, [ %i4 + 0x54 ] head->previous = NULL; 2006fa0: c0 27 20 58 clr [ %i4 + 0x58 ] } rtems_chain_initialize_empty (&aio_request_queue.work_req); rtems_chain_initialize_empty (&aio_request_queue.idle_req); aio_request_queue.active_threads = 0; 2006fa4: c0 27 20 64 clr [ %i4 + 0x64 ] aio_request_queue.idle_threads = 0; 2006fa8: c0 27 20 68 clr [ %i4 + 0x68 ] aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 2006fac: 03 00 00 2c sethi %hi(0xb000), %g1 2006fb0: 82 10 60 0b or %g1, 0xb, %g1 ! b00b 2006fb4: c2 27 20 60 st %g1, [ %i4 + 0x60 ] return result; } 2006fb8: 81 c7 e0 08 ret 2006fbc: 81 e8 00 00 restore result = pthread_attr_setdetachstate (&aio_request_queue.attr, PTHREAD_CREATE_DETACHED); if (result != 0) pthread_attr_destroy (&aio_request_queue.attr); 2006fc0: 40 00 04 2a call 2008068 <== NOT EXECUTED 2006fc4: 90 17 63 84 or %i5, 0x384, %o0 <== NOT EXECUTED result = pthread_mutex_init (&aio_request_queue.mutex, NULL); 2006fc8: 39 00 80 66 sethi %hi(0x2019800), %i4 <== NOT EXECUTED 2006fcc: 92 10 20 00 clr %o1 <== NOT EXECUTED 2006fd0: 40 00 03 70 call 2007d90 <== NOT EXECUTED 2006fd4: 90 17 23 7c or %i4, 0x37c, %o0 <== NOT EXECUTED if (result != 0) 2006fd8: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 2006fdc: 02 bf ff e1 be 2006f60 <== NOT EXECUTED 2006fe0: 92 10 20 00 clr %o1 <== NOT EXECUTED pthread_attr_destroy (&aio_request_queue.attr); 2006fe4: 40 00 04 21 call 2008068 <== NOT EXECUTED 2006fe8: 90 17 63 84 or %i5, 0x384, %o0 <== NOT EXECUTED result = pthread_cond_init (&aio_request_queue.new_req, NULL); 2006fec: 92 10 20 00 clr %o1 <== NOT EXECUTED 2006ff0: 11 00 80 66 sethi %hi(0x2019800), %o0 <== NOT EXECUTED 2006ff4: 40 00 02 6b call 20079a0 <== NOT EXECUTED 2006ff8: 90 12 23 80 or %o0, 0x380, %o0 ! 2019b80 <== NOT EXECUTED if (result != 0) { 2006ffc: b0 92 20 00 orcc %o0, 0, %i0 <== NOT EXECUTED 2007000: 22 bf ff df be,a 2006f7c <== NOT EXECUTED 2007004: b8 17 23 7c or %i4, 0x37c, %i4 <== NOT EXECUTED pthread_mutex_destroy (&aio_request_queue.mutex); 2007008: 40 00 03 0f call 2007c44 <== NOT EXECUTED 200700c: 90 17 23 7c or %i4, 0x37c, %o0 <== NOT EXECUTED pthread_attr_destroy (&aio_request_queue.attr); 2007010: 40 00 04 16 call 2008068 <== NOT EXECUTED 2007014: 90 17 63 84 or %i5, 0x384, %o0 <== NOT EXECUTED ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 2007018: 10 bf ff d9 b 2006f7c <== NOT EXECUTED 200701c: b8 17 23 7c or %i4, 0x37c, %i4 <== NOT EXECUTED =============================================================================== 020073e8 : * NONE */ void rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req) { 20073e8: 9d e3 bf a0 save %sp, -96, %sp */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 20073ec: c2 06 00 00 ld [ %i0 ], %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 20073f0: 84 06 20 04 add %i0, 4, %g2 rtems_chain_node *node; AIO_printf ("FD exists \n"); node = rtems_chain_first (chain); if (rtems_chain_is_empty (chain)) { 20073f4: 80 a0 40 02 cmp %g1, %g2 20073f8: 02 80 00 15 be 200744c <== NEVER TAKEN 20073fc: 86 10 00 19 mov %i1, %g3 rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; while (req->aiocbp->aio_reqprio > prio && 2007400: de 06 60 14 ld [ %i1 + 0x14 ], %o7 if (rtems_chain_is_empty (chain)) { AIO_printf ("First in chain \n"); rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 2007404: c8 00 60 14 ld [ %g1 + 0x14 ], %g4 while (req->aiocbp->aio_reqprio > prio && 2007408: de 03 e0 18 ld [ %o7 + 0x18 ], %o7 200740c: c8 01 20 18 ld [ %g4 + 0x18 ], %g4 2007410: 80 a1 00 0f cmp %g4, %o7 2007414: 26 80 00 07 bl,a 2007430 <== NEVER TAKEN 2007418: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED RTEMS_INLINE_ROUTINE void rtems_chain_insert( rtems_chain_node *after_node, rtems_chain_node *the_node ) { _Chain_Insert( after_node, the_node ); 200741c: 10 80 00 0b b 2007448 2007420: f0 00 60 04 ld [ %g1 + 4 ], %i0 2007424: 22 80 00 09 be,a 2007448 <== NOT EXECUTED 2007428: f0 00 60 04 ld [ %g1 + 4 ], %i0 <== NOT EXECUTED } } AIO_printf ("Thread finished\n"); return NULL; } 200742c: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; while (req->aiocbp->aio_reqprio > prio && !rtems_chain_is_tail (chain, node)) { node = rtems_chain_next (node); prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 2007430: c8 00 60 14 ld [ %g1 + 0x14 ], %g4 <== NOT EXECUTED rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; while (req->aiocbp->aio_reqprio > prio && 2007434: c8 01 20 18 ld [ %g4 + 0x18 ], %g4 <== NOT EXECUTED 2007438: 80 a1 00 0f cmp %g4, %o7 <== NOT EXECUTED 200743c: 06 bf ff fa bl 2007424 <== NOT EXECUTED 2007440: 80 a0 40 02 cmp %g1, %g2 <== NOT EXECUTED 2007444: f0 00 60 04 ld [ %g1 + 4 ], %i0 <== NOT EXECUTED 2007448: b2 10 00 03 mov %g3, %i1 200744c: 40 00 09 7e call 2009a44 <_Chain_Insert> 2007450: 81 e8 00 00 restore =============================================================================== 02007104 : * NONE */ void rtems_aio_move_to_work (rtems_aio_request_chain *r_chain) { 2007104: 9d e3 bf a0 save %sp, -96, %sp */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 2007108: 05 00 80 66 sethi %hi(0x2019800), %g2 200710c: 84 10 a3 7c or %g2, 0x37c, %g2 ! 2019b7c 2007110: c2 00 a0 48 ld [ %g2 + 0x48 ], %g1 rtems_chain_node *node; node = rtems_chain_first (&aio_request_queue.work_req); temp = (rtems_aio_request_chain *) node; while (temp->fildes < r_chain->fildes && 2007114: de 06 20 14 ld [ %i0 + 0x14 ], %o7 2007118: c8 00 60 14 ld [ %g1 + 0x14 ], %g4 * NONE */ void rtems_aio_move_to_work (rtems_aio_request_chain *r_chain) { 200711c: b2 10 00 18 mov %i0, %i1 rtems_chain_node *node; node = rtems_chain_first (&aio_request_queue.work_req); temp = (rtems_aio_request_chain *) node; while (temp->fildes < r_chain->fildes && 2007120: 80 a1 00 0f cmp %g4, %o7 2007124: 16 80 00 10 bge 2007164 <== NEVER TAKEN 2007128: 86 10 00 01 mov %g1, %g3 200712c: 84 00 a0 4c add %g2, 0x4c, %g2 2007130: 80 a0 40 02 cmp %g1, %g2 2007134: 32 80 00 08 bne,a 2007154 <== ALWAYS TAKEN 2007138: c6 00 40 00 ld [ %g1 ], %g3 200713c: 10 80 00 0b b 2007168 <== NOT EXECUTED 2007140: f0 00 e0 04 ld [ %g3 + 4 ], %i0 <== NOT EXECUTED 2007144: 80 a0 c0 02 cmp %g3, %g2 2007148: 02 80 00 0a be 2007170 <== NEVER TAKEN 200714c: 86 10 00 02 mov %g2, %g3 } } AIO_printf ("Thread finished\n"); return NULL; } 2007150: c6 00 40 00 ld [ %g1 ], %g3 rtems_chain_node *node; node = rtems_chain_first (&aio_request_queue.work_req); temp = (rtems_aio_request_chain *) node; while (temp->fildes < r_chain->fildes && 2007154: c8 00 e0 14 ld [ %g3 + 0x14 ], %g4 2007158: 80 a1 00 0f cmp %g4, %o7 200715c: 06 bf ff fa bl 2007144 2007160: 82 10 00 03 mov %g3, %g1 2007164: f0 00 e0 04 ld [ %g3 + 4 ], %i0 2007168: 40 00 0a 37 call 2009a44 <_Chain_Insert> 200716c: 81 e8 00 00 restore 2007170: f0 00 e0 04 ld [ %g3 + 4 ], %i0 <== NOT EXECUTED 2007174: 40 00 0a 34 call 2009a44 <_Chain_Insert> <== NOT EXECUTED 2007178: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 02007454 : * Output parameters: * NONE */ void rtems_aio_remove_fd (rtems_aio_request_chain *r_chain) { 2007454: 9d e3 bf a0 save %sp, -96, %sp */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 2007458: fa 06 20 08 ld [ %i0 + 8 ], %i5 while (!rtems_chain_is_tail (chain, node)) { rtems_chain_extract (node); rtems_aio_request *req = (rtems_aio_request *) node; node = rtems_chain_next (node); req->aiocbp->error_code = ECANCELED; 200745c: b4 10 20 8c mov 0x8c, %i2 RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Tail(the_chain)); 2007460: b0 06 20 0c add %i0, 0xc, %i0 rtems_chain_control *chain; rtems_chain_node *node; chain = &r_chain->perfd; node = rtems_chain_first (chain); while (!rtems_chain_is_tail (chain, node)) 2007464: 80 a7 40 18 cmp %i5, %i0 2007468: 02 80 00 0d be 200749c <== NEVER TAKEN 200746c: b6 10 3f ff mov -1, %i3 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 2007470: 40 00 09 5d call 20099e4 <_Chain_Extract> 2007474: 90 10 00 1d mov %i5, %o0 { rtems_chain_extract (node); rtems_aio_request *req = (rtems_aio_request *) node; node = rtems_chain_next (node); req->aiocbp->error_code = ECANCELED; 2007478: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 } } AIO_printf ("Thread finished\n"); return NULL; } 200747c: f8 07 40 00 ld [ %i5 ], %i4 rtems_chain_extract (node); rtems_aio_request *req = (rtems_aio_request *) node; node = rtems_chain_next (node); req->aiocbp->error_code = ECANCELED; req->aiocbp->return_value = -1; free (req); 2007480: 90 10 00 1d mov %i5, %o0 while (!rtems_chain_is_tail (chain, node)) { rtems_chain_extract (node); rtems_aio_request *req = (rtems_aio_request *) node; node = rtems_chain_next (node); req->aiocbp->error_code = ECANCELED; 2007484: f4 20 60 34 st %i2, [ %g1 + 0x34 ] req->aiocbp->return_value = -1; free (req); 2007488: 7f ff f0 77 call 2003664 200748c: f6 20 60 38 st %i3, [ %g1 + 0x38 ] rtems_chain_control *chain; rtems_chain_node *node; chain = &r_chain->perfd; node = rtems_chain_first (chain); while (!rtems_chain_is_tail (chain, node)) 2007490: 80 a7 00 18 cmp %i4, %i0 2007494: 12 bf ff f7 bne 2007470 2007498: ba 10 00 1c mov %i4, %i5 200749c: 81 c7 e0 08 ret 20074a0: 81 e8 00 00 restore =============================================================================== 020074a4 : * AIO_NOTCANCELED - if request was not canceled * AIO_CANCELED - if request was canceled */ int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp) { 20074a4: 9d e3 bf a0 save %sp, -96, %sp */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 20074a8: fa 06 00 00 ld [ %i0 ], %i5 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 20074ac: 82 06 20 04 add %i0, 4, %g1 if (rtems_chain_is_empty (chain)) 20074b0: 80 a7 40 01 cmp %i5, %g1 20074b4: 12 80 00 06 bne 20074cc 20074b8: b0 10 20 02 mov 2, %i0 20074bc: 30 80 00 14 b,a 200750c rtems_chain_node *node = rtems_chain_first (chain); rtems_aio_request *current; current = (rtems_aio_request *) node; while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) { 20074c0: 80 a7 40 01 cmp %i5, %g1 <== NOT EXECUTED 20074c4: 02 80 00 10 be 2007504 <== NOT EXECUTED 20074c8: b0 10 20 01 mov 1, %i0 <== NOT EXECUTED 20074cc: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 20074d0: 80 a0 80 19 cmp %g2, %i1 20074d4: 32 bf ff fb bne,a 20074c0 <== NEVER TAKEN 20074d8: fa 07 40 00 ld [ %i5 ], %i5 <== NOT EXECUTED 20074dc: 40 00 09 42 call 20099e4 <_Chain_Extract> 20074e0: 90 10 00 1d mov %i5, %o0 if (rtems_chain_is_tail (chain, node)) return AIO_NOTCANCELED; else { rtems_chain_extract (node); current->aiocbp->error_code = ECANCELED; 20074e4: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 20074e8: 84 10 20 8c mov 0x8c, %g2 20074ec: c4 20 60 34 st %g2, [ %g1 + 0x34 ] current->aiocbp->return_value = -1; 20074f0: 84 10 3f ff mov -1, %g2 free (current); 20074f4: 90 10 00 1d mov %i5, %o0 return AIO_NOTCANCELED; else { rtems_chain_extract (node); current->aiocbp->error_code = ECANCELED; current->aiocbp->return_value = -1; 20074f8: c4 20 60 38 st %g2, [ %g1 + 0x38 ] free (current); 20074fc: 7f ff f0 5a call 2003664 2007500: b0 10 20 00 clr %i0 } return AIO_CANCELED; 2007504: 81 c7 e0 08 ret 2007508: 81 e8 00 00 restore } 200750c: 81 c7 e0 08 ret 2007510: 81 e8 00 00 restore =============================================================================== 0200ee04 : uint32_t rtems_assoc_local_by_remote_bitfield( const rtems_assoc_t *ap, uint32_t remote_value ) { 200ee04: 9d e3 bf a0 save %sp, -96, %sp 200ee08: b6 10 20 20 mov 0x20, %i3 200ee0c: ba 10 00 18 mov %i0, %i5 uint32_t b; uint32_t local_value = 0; for (b = 1; b; b <<= 1) { 200ee10: b8 10 20 01 mov 1, %i4 const rtems_assoc_t *ap, uint32_t remote_value ) { uint32_t b; uint32_t local_value = 0; 200ee14: 10 80 00 04 b 200ee24 200ee18: b0 10 20 00 clr %i0 for (b = 1; b; b <<= 1) { 200ee1c: 02 80 00 0c be 200ee4c 200ee20: b9 2f 20 01 sll %i4, 1, %i4 if (b & remote_value) 200ee24: 80 8f 00 19 btst %i4, %i1 200ee28: 22 bf ff fd be,a 200ee1c 200ee2c: b6 86 ff ff addcc %i3, -1, %i3 local_value |= rtems_assoc_local_by_remote(ap, b); 200ee30: 92 10 00 1c mov %i4, %o1 200ee34: 40 00 00 08 call 200ee54 200ee38: 90 10 00 1d mov %i5, %o0 ) { uint32_t b; uint32_t local_value = 0; for (b = 1; b; b <<= 1) { 200ee3c: b9 2f 20 01 sll %i4, 1, %i4 200ee40: b6 86 ff ff addcc %i3, -1, %i3 200ee44: 12 bf ff f8 bne 200ee24 <== ALWAYS TAKEN 200ee48: b0 16 00 08 or %i0, %o0, %i0 if (b & remote_value) local_value |= rtems_assoc_local_by_remote(ap, b); } return local_value; } 200ee4c: 81 c7 e0 08 ret 200ee50: 81 e8 00 00 restore =============================================================================== 0200bc6c : const rtems_assoc_t *rtems_assoc_ptr_by_local( const rtems_assoc_t *ap, uint32_t local_value ) { 200bc6c: 9d e3 bf a0 save %sp, -96, %sp const rtems_assoc_t *default_ap = 0; if (rtems_assoc_is_default(ap)) 200bc70: d0 06 00 00 ld [ %i0 ], %o0 const rtems_assoc_t *rtems_assoc_ptr_by_local( const rtems_assoc_t *ap, uint32_t local_value ) { 200bc74: ba 10 00 18 mov %i0, %i5 const rtems_assoc_t *default_ap = 0; if (rtems_assoc_is_default(ap)) 200bc78: 80 a2 20 00 cmp %o0, 0 200bc7c: 02 80 00 1b be 200bce8 200bc80: b0 10 20 00 clr %i0 200bc84: 13 00 80 6e sethi %hi(0x201b800), %o1 200bc88: 40 00 12 c9 call 20107ac 200bc8c: 92 12 63 60 or %o1, 0x360, %o1 ! 201bb60 200bc90: 80 a2 20 00 cmp %o0, 0 200bc94: 02 80 00 17 be 200bcf0 200bc98: 82 10 20 00 clr %g1 default_ap = ap++; for ( ; ap->name; ap++) if (ap->local_value == local_value) 200bc9c: c4 07 60 04 ld [ %i5 + 4 ], %g2 200bca0: 80 a0 80 19 cmp %g2, %i1 200bca4: 02 80 00 11 be 200bce8 200bca8: b0 10 00 1d mov %i5, %i0 200bcac: 86 07 60 0c add %i5, 0xc, %g3 200bcb0: 10 80 00 06 b 200bcc8 200bcb4: 84 20 00 1d neg %i5, %g2 200bcb8: c8 07 7f f8 ld [ %i5 + -8 ], %g4 200bcbc: 80 a1 00 19 cmp %g4, %i1 200bcc0: 02 80 00 0a be 200bce8 200bcc4: 01 00 00 00 nop #include #include #include /* strcat, strcmp */ const rtems_assoc_t *rtems_assoc_ptr_by_local( 200bcc8: 88 06 00 02 add %i0, %g2, %g4 const rtems_assoc_t *default_ap = 0; if (rtems_assoc_is_default(ap)) default_ap = ap++; for ( ; ap->name; ap++) 200bccc: c8 00 c0 04 ld [ %g3 + %g4 ], %g4 200bcd0: b0 06 20 0c add %i0, 0xc, %i0 200bcd4: 80 a1 20 00 cmp %g4, 0 if (ap->local_value == local_value) 200bcd8: ba 06 00 02 add %i0, %g2, %i5 const rtems_assoc_t *default_ap = 0; if (rtems_assoc_is_default(ap)) default_ap = ap++; for ( ; ap->name; ap++) 200bcdc: 12 bf ff f7 bne 200bcb8 200bce0: ba 00 c0 1d add %g3, %i5, %i5 200bce4: b0 10 00 01 mov %g1, %i0 if (ap->local_value == local_value) return ap; return default_ap; } 200bce8: 81 c7 e0 08 ret 200bcec: 81 e8 00 00 restore const rtems_assoc_t *default_ap = 0; if (rtems_assoc_is_default(ap)) default_ap = ap++; for ( ; ap->name; ap++) 200bcf0: c2 07 60 0c ld [ %i5 + 0xc ], %g1 200bcf4: 80 a0 60 00 cmp %g1, 0 200bcf8: 02 bf ff fc be 200bce8 <== NEVER TAKEN 200bcfc: b0 10 00 1d mov %i5, %i0 ) { const rtems_assoc_t *default_ap = 0; if (rtems_assoc_is_default(ap)) default_ap = ap++; 200bd00: 82 10 00 1d mov %i5, %g1 200bd04: 10 bf ff e6 b 200bc9c 200bd08: ba 07 60 0c add %i5, 0xc, %i5 =============================================================================== 020034f8 : const rtems_assoc_t *rtems_assoc_ptr_by_name( const rtems_assoc_t *ap, const char *name ) { 20034f8: 9d e3 bf a0 save %sp, -96, %sp const rtems_assoc_t *default_ap = 0; if (rtems_assoc_is_default(ap)) 20034fc: fa 06 00 00 ld [ %i0 ], %i5 2003500: 80 a7 60 00 cmp %i5, 0 2003504: 02 80 00 21 be 2003588 2003508: b8 10 20 00 clr %i4 200350c: 90 10 00 1d mov %i5, %o0 2003510: 13 00 80 58 sethi %hi(0x2016000), %o1 const rtems_assoc_t *rtems_assoc_ptr_by_name( const rtems_assoc_t *ap, const char *name ) { const rtems_assoc_t *default_ap = 0; 2003514: b6 10 20 00 clr %i3 if (rtems_assoc_is_default(ap)) 2003518: 40 00 35 f2 call 2010ce0 200351c: 92 12 61 60 or %o1, 0x160, %o1 2003520: 80 a2 20 00 cmp %o0, 0 2003524: 12 80 00 12 bne 200356c 2003528: b8 10 00 18 mov %i0, %i4 default_ap = ap++; for ( ; ap->name; ap++) 200352c: fa 06 20 0c ld [ %i0 + 0xc ], %i5 2003530: 80 a7 60 00 cmp %i5, 0 2003534: 02 80 00 15 be 2003588 <== NEVER TAKEN 2003538: b6 10 00 18 mov %i0, %i3 if (strcmp(ap->name, name) == 0) 200353c: 90 10 00 1d mov %i5, %o0 ) { const rtems_assoc_t *default_ap = 0; if (rtems_assoc_is_default(ap)) default_ap = ap++; 2003540: b0 06 20 0c add %i0, 0xc, %i0 for ( ; ap->name; ap++) if (strcmp(ap->name, name) == 0) 2003544: 92 10 00 19 mov %i1, %o1 2003548: 40 00 35 e6 call 2010ce0 200354c: b8 10 00 18 mov %i0, %i4 2003550: 80 a2 20 00 cmp %o0, 0 2003554: 02 80 00 0d be 2003588 <== NEVER TAKEN 2003558: b0 06 20 0c add %i0, 0xc, %i0 const rtems_assoc_t *default_ap = 0; if (rtems_assoc_is_default(ap)) default_ap = ap++; for ( ; ap->name; ap++) 200355c: fa 06 00 00 ld [ %i0 ], %i5 2003560: 80 a7 60 00 cmp %i5, 0 2003564: 02 80 00 0b be 2003590 2003568: b8 10 00 18 mov %i0, %i4 if (strcmp(ap->name, name) == 0) 200356c: 90 10 00 1d mov %i5, %o0 2003570: 92 10 00 19 mov %i1, %o1 2003574: 40 00 35 db call 2010ce0 2003578: b0 06 20 0c add %i0, 0xc, %i0 200357c: 80 a2 20 00 cmp %o0, 0 2003580: 32 bf ff f8 bne,a 2003560 2003584: fa 06 00 00 ld [ %i0 ], %i5 return ap; return default_ap; } 2003588: 81 c7 e0 08 ret 200358c: 91 e8 00 1c restore %g0, %i4, %o0 const rtems_assoc_t *default_ap = 0; if (rtems_assoc_is_default(ap)) default_ap = ap++; for ( ; ap->name; ap++) 2003590: b8 10 00 1b mov %i3, %i4 if (strcmp(ap->name, name) == 0) return ap; return default_ap; } 2003594: 81 c7 e0 08 ret 2003598: 91 e8 00 1c restore %g0, %i4, %o0 =============================================================================== 0200ee88 : const rtems_assoc_t *rtems_assoc_ptr_by_remote( const rtems_assoc_t *ap, uint32_t remote_value ) { 200ee88: 9d e3 bf a0 save %sp, -96, %sp const rtems_assoc_t *default_ap = 0; if (rtems_assoc_is_default(ap)) 200ee8c: d0 06 00 00 ld [ %i0 ], %o0 const rtems_assoc_t *rtems_assoc_ptr_by_remote( const rtems_assoc_t *ap, uint32_t remote_value ) { 200ee90: ba 10 00 18 mov %i0, %i5 const rtems_assoc_t *default_ap = 0; if (rtems_assoc_is_default(ap)) 200ee94: 80 a2 20 00 cmp %o0, 0 200ee98: 02 80 00 1b be 200ef04 200ee9c: b0 10 20 00 clr %i0 200eea0: 13 00 80 6e sethi %hi(0x201b800), %o1 200eea4: 40 00 06 42 call 20107ac 200eea8: 92 12 63 60 or %o1, 0x360, %o1 ! 201bb60 200eeac: 80 a2 20 00 cmp %o0, 0 200eeb0: 02 80 00 17 be 200ef0c 200eeb4: 82 10 20 00 clr %g1 default_ap = ap++; for ( ; ap->name; ap++) if (ap->remote_value == remote_value) 200eeb8: c4 07 60 08 ld [ %i5 + 8 ], %g2 200eebc: 80 a0 80 19 cmp %g2, %i1 200eec0: 02 80 00 11 be 200ef04 200eec4: b0 10 00 1d mov %i5, %i0 200eec8: 86 07 60 0c add %i5, 0xc, %g3 200eecc: 10 80 00 06 b 200eee4 200eed0: 84 20 00 1d neg %i5, %g2 200eed4: c8 07 7f fc ld [ %i5 + -4 ], %g4 200eed8: 80 a1 00 19 cmp %g4, %i1 200eedc: 02 80 00 0a be 200ef04 200eee0: 01 00 00 00 nop #include #include #include /* strcat, strcmp */ const rtems_assoc_t *rtems_assoc_ptr_by_remote( 200eee4: 88 06 00 02 add %i0, %g2, %g4 const rtems_assoc_t *default_ap = 0; if (rtems_assoc_is_default(ap)) default_ap = ap++; for ( ; ap->name; ap++) 200eee8: c8 00 c0 04 ld [ %g3 + %g4 ], %g4 200eeec: b0 06 20 0c add %i0, 0xc, %i0 200eef0: 80 a1 20 00 cmp %g4, 0 if (ap->remote_value == remote_value) 200eef4: ba 06 00 02 add %i0, %g2, %i5 const rtems_assoc_t *default_ap = 0; if (rtems_assoc_is_default(ap)) default_ap = ap++; for ( ; ap->name; ap++) 200eef8: 12 bf ff f7 bne 200eed4 200eefc: ba 00 c0 1d add %g3, %i5, %i5 200ef00: b0 10 00 01 mov %g1, %i0 if (ap->remote_value == remote_value) return ap; return default_ap; } 200ef04: 81 c7 e0 08 ret 200ef08: 81 e8 00 00 restore const rtems_assoc_t *default_ap = 0; if (rtems_assoc_is_default(ap)) default_ap = ap++; for ( ; ap->name; ap++) 200ef0c: c2 07 60 0c ld [ %i5 + 0xc ], %g1 200ef10: 80 a0 60 00 cmp %g1, 0 200ef14: 02 bf ff fc be 200ef04 <== NEVER TAKEN 200ef18: b0 10 00 1d mov %i5, %i0 ) { const rtems_assoc_t *default_ap = 0; if (rtems_assoc_is_default(ap)) default_ap = ap++; 200ef1c: 82 10 00 1d mov %i5, %g1 200ef20: 10 bf ff e6 b 200eeb8 200ef24: ba 07 60 0c add %i5, 0xc, %i5 =============================================================================== 0200363c : uint32_t rtems_assoc_remote_by_local_bitfield( const rtems_assoc_t *ap, uint32_t local_value ) { 200363c: 9d e3 bf a0 save %sp, -96, %sp 2003640: b6 10 20 20 mov 0x20, %i3 2003644: ba 10 00 18 mov %i0, %i5 uint32_t b; uint32_t remote_value = 0; for (b = 1; b; b <<= 1) 2003648: b8 10 20 01 mov 1, %i4 const rtems_assoc_t *ap, uint32_t local_value ) { uint32_t b; uint32_t remote_value = 0; 200364c: 10 80 00 04 b 200365c 2003650: b0 10 20 00 clr %i0 for (b = 1; b; b <<= 1) 2003654: 02 80 00 0c be 2003684 2003658: b9 2f 20 01 sll %i4, 1, %i4 if (b & local_value) 200365c: 80 8f 00 19 btst %i4, %i1 2003660: 22 bf ff fd be,a 2003654 2003664: b6 86 ff ff addcc %i3, -1, %i3 remote_value |= rtems_assoc_remote_by_local(ap, b); 2003668: 92 10 00 1c mov %i4, %o1 200366c: 40 00 00 08 call 200368c 2003670: 90 10 00 1d mov %i5, %o0 ) { uint32_t b; uint32_t remote_value = 0; for (b = 1; b; b <<= 1) 2003674: b9 2f 20 01 sll %i4, 1, %i4 2003678: b6 86 ff ff addcc %i3, -1, %i3 200367c: 12 bf ff f8 bne 200365c <== ALWAYS TAKEN 2003680: b0 16 00 08 or %i0, %o0, %i0 if (b & local_value) remote_value |= rtems_assoc_remote_by_local(ap, b); return remote_value; } 2003684: 81 c7 e0 08 ret 2003688: 81 e8 00 00 restore =============================================================================== 020024ac : const char *rtems_bsp_cmdline_get_param( const char *name, char *value, size_t length ) { 20024ac: 9d e3 bf a0 save %sp, -96, %sp const char *p; if ( !name ) 20024b0: 80 a6 20 00 cmp %i0, 0 20024b4: 02 80 00 35 be 2002588 20024b8: 80 a6 60 00 cmp %i1, 0 return NULL; if ( !value ) 20024bc: 02 80 00 31 be 2002580 20024c0: 80 a6 a0 00 cmp %i2, 0 return NULL; if ( !length ) 20024c4: 22 80 00 32 be,a 200258c 20024c8: b2 10 20 00 clr %i1 return NULL; value[0] = '\0'; 20024cc: c0 2e 40 00 clrb [ %i1 ] p = rtems_bsp_cmdline_get_param_raw( name ); 20024d0: 40 00 00 31 call 2002594 20024d4: 90 10 00 18 mov %i0, %o0 if ( !p ) 20024d8: 80 a2 20 00 cmp %o0, 0 20024dc: 22 80 00 2c be,a 200258c 20024e0: b2 10 20 00 clr %i1 int i; int quotes; const char *p = start; quotes=0; for (i=0 ; *p && i <== NEVER TAKEN 20024f4: b4 86 bf ff addcc %i2, -1, %i2 20024f8: 02 80 00 22 be 2002580 <== NEVER TAKEN 20024fc: 88 10 20 00 clr %g4 2002500: 82 10 20 00 clr %g1 2002504: 10 80 00 12 b 200254c 2002508: b0 10 20 00 clr %i0 if ( *p == '\"' ) { quotes++; } else if ( ((quotes % 2) == 0) && *p == ' ' ) 200250c: 32 80 00 06 bne,a 2002524 2002510: c6 2e 40 04 stb %g3, [ %i1 + %g4 ] 2002514: 80 a0 a0 20 cmp %g2, 0x20 2002518: 02 80 00 1a be 2002580 200251c: 01 00 00 00 nop break; value[i++] = *p++; 2002520: c6 2e 40 04 stb %g3, [ %i1 + %g4 ] 2002524: 82 00 60 01 inc %g1 value[i] = '\0'; 2002528: c0 2e 40 01 clrb [ %i1 + %g1 ] int i; int quotes; const char *p = start; quotes=0; for (i=0 ; *p && i 200253c: 88 10 00 01 mov %g1, %g4 2002540: 80 a6 80 01 cmp %i2, %g1 2002544: 08 80 00 0f bleu 2002580 2002548: 90 02 20 01 inc %o0 if ( *p == '\"' ) { 200254c: 85 38 a0 18 sra %g2, 0x18, %g2 2002550: 80 a0 a0 22 cmp %g2, 0x22 2002554: 12 bf ff ee bne 200250c 2002558: 80 8e 20 01 btst 1, %i0 quotes++; } else if ( ((quotes % 2) == 0) && *p == ' ' ) break; value[i++] = *p++; 200255c: c6 2e 40 04 stb %g3, [ %i1 + %g4 ] 2002560: 82 00 60 01 inc %g1 value[i] = '\0'; 2002564: c0 2e 40 01 clrb [ %i1 + %g1 ] int i; int quotes; const char *p = start; quotes=0; for (i=0 ; *p && i<== ALWAYS TAKEN 200257c: 88 10 00 01 mov %g1, %g4 return NULL; copy_string( p, value, length ); return value; } 2002580: 81 c7 e0 08 ret 2002584: 91 e8 00 19 restore %g0, %i1, %o0 value[0] = '\0'; p = rtems_bsp_cmdline_get_param_raw( name ); if ( !p ) return NULL; 2002588: b2 10 20 00 clr %i1 copy_string( p, value, length ); return value; } 200258c: 81 c7 e0 08 ret 2002590: 91 e8 00 19 restore %g0, %i1, %o0 =============================================================================== 02007144 : rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 2007144: 9d e3 bf 98 save %sp, -104, %sp 2007148: ba 10 00 18 mov %i0, %i5 */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 200714c: 40 00 01 9c call 20077bc <_Chain_Get> 2007150: 90 10 00 1d mov %i5, %o0 while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL ) { rtems_event_set out; sc = rtems_event_receive( 2007154: 92 10 20 00 clr %o1 2007158: b8 10 00 08 mov %o0, %i4 200715c: 94 10 00 1a mov %i2, %o2 2007160: 90 10 00 19 mov %i1, %o0 rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 2007164: 80 a7 20 00 cmp %i4, 0 2007168: 12 80 00 0a bne 2007190 200716c: 96 07 bf fc add %fp, -4, %o3 ) { rtems_event_set out; sc = rtems_event_receive( 2007170: 7f ff fc f4 call 2006540 2007174: 01 00 00 00 nop ) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( 2007178: 80 a2 20 00 cmp %o0, 0 200717c: 02 bf ff f4 be 200714c <== NEVER TAKEN 2007180: b0 10 00 08 mov %o0, %i0 timeout, &out ); } *node_ptr = node; 2007184: f8 26 c0 00 st %i4, [ %i3 ] return sc; } 2007188: 81 c7 e0 08 ret 200718c: 81 e8 00 00 restore rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 2007190: 90 10 20 00 clr %o0 timeout, &out ); } *node_ptr = node; 2007194: f8 26 c0 00 st %i4, [ %i3 ] return sc; } 2007198: 81 c7 e0 08 ret 200719c: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 02003004 : void rtems_cpu_usage_report_with_plugin( void *context, rtems_printk_plugin_t print ) { 2003004: 9d e3 bf 58 save %sp, -168, %sp Timestamp_Control uptime, total, ran, uptime_at_last_reset; #else uint32_t total_units = 0; #endif if ( !print ) 2003008: 80 a6 60 00 cmp %i1, 0 200300c: 02 80 00 76 be 20031e4 <== NEVER TAKEN 2003010: 03 00 80 82 sethi %hi(0x2020800), %g1 * 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__ _Timestamp_Set_to_zero( &total ); uptime_at_last_reset = CPU_usage_Uptime_at_last_reset; 2003014: c4 00 62 00 ld [ %g1 + 0x200 ], %g2 ! 2020a00 2003018: 86 10 62 00 or %g1, 0x200, %g3 200301c: c2 00 e0 04 ld [ %g3 + 4 ], %g1 * 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__ _Timestamp_Set_to_zero( &total ); 2003020: c0 27 bf d0 clr [ %fp + -48 ] 2003024: c0 27 bf d4 clr [ %fp + -44 ] uptime_at_last_reset = CPU_usage_Uptime_at_last_reset; 2003028: c4 27 bf e0 st %g2, [ %fp + -32 ] 200302c: c2 27 bf e4 st %g1, [ %fp + -28 ] } } } #endif (*print)( 2003030: 90 10 00 18 mov %i0, %o0 2003034: 13 00 80 75 sethi %hi(0x201d400), %o1 2003038: 21 00 80 80 sethi %hi(0x2020000), %l0 200303c: 92 12 61 a0 or %o1, 0x1a0, %o1 2003040: a0 14 23 9c or %l0, 0x39c, %l0 if ( !the_thread ) continue; rtems_object_get_name( the_thread->Object.id, sizeof(name), name ); (*print)( 2003044: 35 00 80 75 sethi %hi(0x201d400), %i2 } } } #endif (*print)( 2003048: 9f c6 40 00 call %i1 200304c: 37 00 80 75 sethi %hi(0x201d400), %i3 /*PAGE * * rtems_cpu_usage_report */ void rtems_cpu_usage_report_with_plugin( 2003050: a2 04 20 0c add %l0, 0xc, %l1 if ( !the_thread ) continue; rtems_object_get_name( the_thread->Object.id, sizeof(name), name ); (*print)( 2003054: b4 16 a3 18 or %i2, 0x318, %i2 /* * Print the information */ (*print)( context, 2003058: b6 16 e3 30 or %i3, 0x330, %i3 #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 200305c: c2 04 00 00 ld [ %l0 ], %g1 2003060: f8 00 60 04 ld [ %g1 + 4 ], %i4 if ( information ) { 2003064: 80 a7 20 00 cmp %i4, 0 2003068: 22 80 00 52 be,a 20031b0 <== NEVER TAKEN 200306c: a0 04 20 04 add %l0, 4, %l0 <== NOT EXECUTED for ( i=1 ; i <= information->maximum ; i++ ) { 2003070: c2 17 20 10 lduh [ %i4 + 0x10 ], %g1 2003074: 86 90 60 00 orcc %g1, 0, %g3 2003078: 02 80 00 4d be 20031ac 200307c: ba 10 20 01 mov 1, %i5 the_thread = (Thread_Control *)information->local_table[ i ]; 2003080: 10 80 00 1f b 20030fc 2003084: c4 07 20 1c ld [ %i4 + 0x1c ], %g2 Timestamp_Control last = _Thread_Time_of_last_context_switch; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( &last, &uptime, &used ); _Timestamp_Add_to( &ran, &used ); } else { _TOD_Get_uptime( &uptime ); 2003088: 40 00 17 6e call 2008e40 <_TOD_Get_uptime> 200308c: 90 10 00 13 mov %l3, %o0 } _Timestamp_Subtract( &uptime_at_last_reset, &uptime, &total ); 2003090: 90 07 bf e0 add %fp, -32, %o0 2003094: 92 10 00 13 mov %l3, %o1 2003098: 40 00 22 22 call 200b920 <_Timespec_Subtract> 200309c: 94 07 bf d0 add %fp, -48, %o2 _Timestamp_Divide( &ran, &total, &ival, &fval ); 20030a0: 94 07 bf f8 add %fp, -8, %o2 20030a4: 96 07 bf fc add %fp, -4, %o3 20030a8: 90 10 00 14 mov %l4, %o0 20030ac: 40 00 21 84 call 200b6bc <_Timespec_Divide> 20030b0: 92 07 bf d0 add %fp, -48, %o1 /* * Print the information */ (*print)( context, 20030b4: d0 07 bf dc ld [ %fp + -36 ], %o0 20030b8: 40 00 5d cb call 201a7e4 <.udiv> 20030bc: 92 10 23 e8 mov 0x3e8, %o1 20030c0: e4 07 bf d8 ld [ %fp + -40 ], %l2 20030c4: d8 1f bf f8 ldd [ %fp + -8 ], %o4 20030c8: 96 10 00 08 mov %o0, %o3 20030cc: 92 10 00 1b mov %i3, %o1 20030d0: 90 10 00 18 mov %i0, %o0 20030d4: 9f c6 40 00 call %i1 20030d8: 94 10 00 12 mov %l2, %o2 20030dc: c6 17 20 10 lduh [ %i4 + 0x10 ], %g3 continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; if ( information ) { for ( i=1 ; i <= information->maximum ; i++ ) { 20030e0: ba 07 60 01 inc %i5 20030e4: 83 28 e0 10 sll %g3, 0x10, %g1 20030e8: 83 30 60 10 srl %g1, 0x10, %g1 20030ec: 80 a0 40 1d cmp %g1, %i5 20030f0: 2a 80 00 30 bcs,a 20031b0 20030f4: a0 04 20 04 add %l0, 4, %l0 the_thread = (Thread_Control *)information->local_table[ i ]; 20030f8: c4 07 20 1c ld [ %i4 + 0x1c ], %g2 20030fc: 83 2f 60 02 sll %i5, 2, %g1 2003100: e4 00 80 01 ld [ %g2 + %g1 ], %l2 if ( !the_thread ) continue; rtems_object_get_name( the_thread->Object.id, sizeof(name), name ); 2003104: 94 07 bf b8 add %fp, -72, %o2 2003108: 92 10 20 0d mov 0xd, %o1 information = _Objects_Information_table[ api_index ][ 1 ]; if ( information ) { for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; if ( !the_thread ) 200310c: 80 a4 a0 00 cmp %l2, 0 2003110: 02 bf ff f4 be 20030e0 <== NEVER TAKEN 2003114: a6 07 bf c8 add %fp, -56, %l3 continue; rtems_object_get_name( the_thread->Object.id, sizeof(name), name ); 2003118: d0 04 a0 08 ld [ %l2 + 8 ], %o0 200311c: 40 00 12 10 call 200795c 2003120: a8 07 bf d8 add %fp, -40, %l4 (*print)( 2003124: d4 04 a0 08 ld [ %l2 + 8 ], %o2 2003128: 90 10 00 18 mov %i0, %o0 200312c: 92 10 00 1a mov %i2, %o1 2003130: 9f c6 40 00 call %i1 2003134: 96 07 bf b8 add %fp, -72, %o3 /* * 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 ) { 2003138: 03 00 80 82 sethi %hi(0x2020800), %g1 200313c: c2 00 61 b4 ld [ %g1 + 0x1b4 ], %g1 ! 20209b4 <_Per_CPU_Information+0xc> #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; 2003140: c8 04 a0 84 ld [ %l2 + 0x84 ], %g4 2003144: c6 04 a0 88 ld [ %l2 + 0x88 ], %g3 if ( _Thread_Executing->Object.id == the_thread->Object.id ) { 2003148: c4 00 60 08 ld [ %g1 + 8 ], %g2 200314c: c2 04 a0 08 ld [ %l2 + 8 ], %g1 #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; 2003150: c8 27 bf d8 st %g4, [ %fp + -40 ] if ( _Thread_Executing->Object.id == the_thread->Object.id ) { 2003154: 80 a0 80 01 cmp %g2, %g1 2003158: 12 bf ff cc bne 2003088 200315c: c6 27 bf dc st %g3, [ %fp + -36 ] Timestamp_Control used; Timestamp_Control last = _Thread_Time_of_last_context_switch; 2003160: 03 00 80 81 sethi %hi(0x2020400), %g1 2003164: c4 00 60 e0 ld [ %g1 + 0xe0 ], %g2 ! 20204e0 <_Thread_Time_of_last_context_switch> 2003168: 86 10 60 e0 or %g1, 0xe0, %g3 200316c: c2 00 e0 04 ld [ %g3 + 4 ], %g1 _TOD_Get_uptime( &uptime ); 2003170: a6 07 bf c8 add %fp, -56, %l3 * since the last context switch. */ ran = the_thread->cpu_time_used; if ( _Thread_Executing->Object.id == the_thread->Object.id ) { Timestamp_Control used; Timestamp_Control last = _Thread_Time_of_last_context_switch; 2003174: c4 27 bf f0 st %g2, [ %fp + -16 ] _TOD_Get_uptime( &uptime ); 2003178: 90 10 00 13 mov %l3, %o0 200317c: 40 00 17 31 call 2008e40 <_TOD_Get_uptime> 2003180: c2 27 bf f4 st %g1, [ %fp + -12 ] _Timestamp_Subtract( &last, &uptime, &used ); 2003184: 90 07 bf f0 add %fp, -16, %o0 2003188: 92 10 00 13 mov %l3, %o1 200318c: 40 00 21 e5 call 200b920 <_Timespec_Subtract> 2003190: 94 07 bf e8 add %fp, -24, %o2 _Timestamp_Add_to( &ran, &used ); 2003194: a8 07 bf d8 add %fp, -40, %l4 2003198: 92 07 bf e8 add %fp, -24, %o1 200319c: 40 00 21 2f call 200b658 <_Timespec_Add_to> 20031a0: 90 10 00 14 mov %l4, %o0 } else { _TOD_Get_uptime( &uptime ); } _Timestamp_Subtract( &uptime_at_last_reset, &uptime, &total ); 20031a4: 10 bf ff bc b 2003094 20031a8: 90 07 bf e0 add %fp, -32, %o0 continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; if ( information ) { for ( i=1 ; i <= information->maximum ; i++ ) { 20031ac: a0 04 20 04 add %l0, 4, %l0 " ID | NAME | TICKS | PERCENT\n" #endif "------------+----------------------------------------+---------------+---------\n" ); for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 20031b0: 80 a4 00 11 cmp %l0, %l1 20031b4: 32 bf ff ab bne,a 2003060 20031b8: c2 04 00 00 ld [ %l0 ], %g1 } } } #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( 20031bc: d0 07 bf d4 ld [ %fp + -44 ], %o0 20031c0: fa 07 bf d0 ld [ %fp + -48 ], %i5 20031c4: 40 00 5d 88 call 201a7e4 <.udiv> 20031c8: 92 10 23 e8 mov 0x3e8, %o1 20031cc: 13 00 80 75 sethi %hi(0x201d400), %o1 20031d0: 96 10 00 08 mov %o0, %o3 20031d4: 94 10 00 1d mov %i5, %o2 20031d8: 90 10 00 18 mov %i0, %o0 20031dc: 9f c6 40 00 call %i1 20031e0: 92 12 63 48 or %o1, 0x348, %o1 20031e4: 81 c7 e0 08 ret 20031e8: 81 e8 00 00 restore =============================================================================== 0200f838 : [RTEMS_IO_ERROR] = EIO, [RTEMS_PROXY_BLOCKING] = EIO }; int rtems_deviceio_errno(rtems_status_code sc) { 200f838: 9d e3 bf a0 save %sp, -96, %sp if (sc == RTEMS_SUCCESSFUL) { 200f83c: 80 a6 20 00 cmp %i0, 0 200f840: 12 80 00 04 bne 200f850 200f844: 82 10 20 00 clr %g1 errno = eno; return -1; } } 200f848: 81 c7 e0 08 ret 200f84c: 91 e8 00 01 restore %g0, %g1, %o0 if (sc == RTEMS_SUCCESSFUL) { return 0; } else { int eno = EINVAL; if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) { 200f850: 80 a6 20 1c cmp %i0, 0x1c 200f854: 18 80 00 06 bgu 200f86c <== NEVER TAKEN 200f858: ba 10 20 16 mov 0x16, %i5 eno = status_code_to_errno [sc]; 200f85c: b1 2e 20 02 sll %i0, 2, %i0 200f860: 03 00 80 6f sethi %hi(0x201bc00), %g1 200f864: 82 10 62 78 or %g1, 0x278, %g1 ! 201be78 200f868: fa 00 40 18 ld [ %g1 + %i0 ], %i5 } errno = eno; 200f86c: 40 00 00 30 call 200f92c <__errno> 200f870: 01 00 00 00 nop return -1; 200f874: 82 10 3f ff mov -1, %g1 ! ffffffff 200f878: 10 bf ff f4 b 200f848 200f87c: fa 22 00 00 st %i5, [ %o0 ] =============================================================================== 0200c244 : rtems_filesystem_fsmount_me_t rtems_filesystem_get_mount_handler( const char *type ) { 200c244: 9d e3 bf 98 save %sp, -104, %sp find_arg fa = { 200c248: f0 27 bf f8 st %i0, [ %fp + -8 ] 200c24c: c0 27 bf fc clr [ %fp + -4 ] rtems_filesystem_fsmount_me_t rtems_filesystem_get_mount_handler( const char *type ) { 200c250: 82 10 00 18 mov %i0, %g1 find_arg fa = { .type = type, .mount_h = NULL }; if ( type != NULL ) { 200c254: 80 a0 60 00 cmp %g1, 0 200c258: 02 80 00 07 be 200c274 <== NEVER TAKEN 200c25c: b0 10 20 00 clr %i0 rtems_filesystem_iterate( find_handler, &fa ); 200c260: 92 07 bf f8 add %fp, -8, %o1 200c264: 11 00 80 30 sethi %hi(0x200c000), %o0 200c268: 7f ff ff c2 call 200c170 200c26c: 90 12 21 3c or %o0, 0x13c, %o0 ! 200c13c 200c270: f0 07 bf fc ld [ %fp + -4 ], %i0 } return fa.mount_h; } 200c274: 81 c7 e0 08 ret 200c278: 81 e8 00 00 restore =============================================================================== 02002958 : * configuration is a single instantiation of the IMFS or miniIMFS with * a single "/dev" directory in it. */ void rtems_filesystem_initialize( void ) { 2002958: 9d e3 bf 88 save %sp, -120, %sp /* * Set the default umask to "022". */ rtems_filesystem_umask = 022; 200295c: 3b 00 80 73 sethi %hi(0x201cc00), %i5 2002960: c2 07 61 f0 ld [ %i5 + 0x1f0 ], %g1 ! 201cdf0 2002964: 84 10 20 12 mov 0x12, %g2 2002968: c4 20 60 2c st %g2, [ %g1 + 0x2c ] /* * mount the first filesystem. */ if ( rtems_filesystem_mount_table_size == 0 ) 200296c: 03 00 80 6b sethi %hi(0x201ac00), %g1 2002970: c2 00 62 08 ld [ %g1 + 0x208 ], %g1 ! 201ae08 2002974: 80 a0 60 00 cmp %g1, 0 2002978: 02 80 00 39 be 2002a5c <== NEVER TAKEN 200297c: 03 00 80 73 sethi %hi(0x201cc00), %g1 rtems_fatal_error_occurred( 0xABCD0001 ); mt = &rtems_filesystem_mount_table[0]; 2002980: c2 00 61 04 ld [ %g1 + 0x104 ], %g1 ! 201cd04 status = mount( mt->device, mt->mount_point, mt->type, mt->fsoptions, NULL ); 2002984: 98 10 20 00 clr %o4 2002988: d0 00 60 08 ld [ %g1 + 8 ], %o0 200298c: d2 00 60 0c ld [ %g1 + 0xc ], %o1 2002990: d4 00 40 00 ld [ %g1 ], %o2 2002994: 40 00 02 d4 call 20034e4 2002998: d6 00 60 04 ld [ %g1 + 4 ], %o3 if ( status == -1 ) 200299c: 80 a2 3f ff cmp %o0, -1 20029a0: 02 80 00 34 be 2002a70 <== NEVER TAKEN 20029a4: c2 07 61 f0 ld [ %i5 + 0x1f0 ], %g1 * gonna hit performance. * * Till Straumann, 10/25/2002 */ /* Clone the root pathloc */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 20029a8: 39 00 80 6c sethi %hi(0x201b000), %i4 20029ac: 92 10 20 01 mov 1, %o1 20029b0: 94 10 20 00 clr %o2 20029b4: 96 07 bf ec add %fp, -20, %o3 20029b8: 98 10 20 00 clr %o4 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; 20029bc: c0 30 60 30 clrh [ %g1 + 0x30 ] * gonna hit performance. * * Till Straumann, 10/25/2002 */ /* Clone the root pathloc */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 20029c0: 40 00 00 fc call 2002db0 20029c4: 90 17 22 a8 or %i4, 0x2a8, %o0 rtems_filesystem_root = loc; 20029c8: c2 07 61 f0 ld [ %i5 + 0x1f0 ], %g1 20029cc: c4 07 bf ec ld [ %fp + -20 ], %g2 /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 20029d0: 92 10 20 01 mov 1, %o1 * * Till Straumann, 10/25/2002 */ /* Clone the root pathloc */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_root = loc; 20029d4: c4 20 60 18 st %g2, [ %g1 + 0x18 ] 20029d8: c4 07 bf f0 ld [ %fp + -16 ], %g2 /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 20029dc: 94 10 20 00 clr %o2 * * Till Straumann, 10/25/2002 */ /* Clone the root pathloc */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_root = loc; 20029e0: c4 20 60 1c st %g2, [ %g1 + 0x1c ] 20029e4: c4 07 bf f4 ld [ %fp + -12 ], %g2 /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 20029e8: 96 07 bf ec add %fp, -20, %o3 * * Till Straumann, 10/25/2002 */ /* Clone the root pathloc */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_root = loc; 20029ec: c4 20 60 20 st %g2, [ %g1 + 0x20 ] 20029f0: c4 07 bf f8 ld [ %fp + -8 ], %g2 /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 20029f4: 98 10 20 00 clr %o4 * * Till Straumann, 10/25/2002 */ /* Clone the root pathloc */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_root = loc; 20029f8: c4 20 60 24 st %g2, [ %g1 + 0x24 ] 20029fc: c4 07 bf fc ld [ %fp + -4 ], %g2 /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); 2002a00: 90 17 22 a8 or %i4, 0x2a8, %o0 2002a04: 40 00 00 eb call 2002db0 2002a08: c4 20 60 28 st %g2, [ %g1 + 0x28 ] rtems_filesystem_current = loc; 2002a0c: c2 07 61 f0 ld [ %i5 + 0x1f0 ], %g1 2002a10: c4 07 bf ec ld [ %fp + -20 ], %g2 * * 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); 2002a14: 92 10 21 ff mov 0x1ff, %o1 /* Clone the root pathloc */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_root = loc; /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_current = loc; 2002a18: c4 20 60 04 st %g2, [ %g1 + 4 ] 2002a1c: c4 07 bf f0 ld [ %fp + -16 ], %g2 * * 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); 2002a20: 11 00 80 6c sethi %hi(0x201b000), %o0 /* Clone the root pathloc */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_root = loc; /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_current = loc; 2002a24: c4 20 60 08 st %g2, [ %g1 + 8 ] 2002a28: c4 07 bf f4 ld [ %fp + -12 ], %g2 * * 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); 2002a2c: 90 12 22 b0 or %o0, 0x2b0, %o0 /* Clone the root pathloc */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_root = loc; /* One more clone for the current node */ rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0); rtems_filesystem_current = loc; 2002a30: c4 20 60 0c st %g2, [ %g1 + 0xc ] 2002a34: c4 07 bf f8 ld [ %fp + -8 ], %g2 2002a38: c4 20 60 10 st %g2, [ %g1 + 0x10 ] 2002a3c: c4 07 bf fc ld [ %fp + -4 ], %g2 * * 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); 2002a40: 40 00 02 49 call 2003364 2002a44: c4 20 60 14 st %g2, [ %g1 + 0x14 ] if ( status != 0 ) 2002a48: 80 a2 20 00 cmp %o0, 0 2002a4c: 12 80 00 07 bne 2002a68 <== NEVER TAKEN 2002a50: 11 2a f3 40 sethi %hi(0xabcd0000), %o0 2002a54: 81 c7 e0 08 ret 2002a58: 81 e8 00 00 restore /* * mount the first filesystem. */ if ( rtems_filesystem_mount_table_size == 0 ) rtems_fatal_error_occurred( 0xABCD0001 ); 2002a5c: 11 2a f3 40 sethi %hi(0xabcd0000), %o0 <== NOT EXECUTED 2002a60: 40 00 11 63 call 2006fec <== NOT EXECUTED 2002a64: 90 12 20 01 or %o0, 1, %o0 ! abcd0001 <== NOT EXECUTED * created that way by the IMFS. */ status = mkdir( "/dev", 0777); if ( status != 0 ) rtems_fatal_error_occurred( 0xABCD0003 ); 2002a68: 40 00 11 61 call 2006fec <== NOT EXECUTED 2002a6c: 90 12 20 03 or %o0, 3, %o0 <== NOT EXECUTED mt = &rtems_filesystem_mount_table[0]; status = mount( mt->device, mt->mount_point, mt->type, mt->fsoptions, NULL ); if ( status == -1 ) rtems_fatal_error_occurred( 0xABCD0002 ); 2002a70: 11 2a f3 40 sethi %hi(0xabcd0000), %o0 <== NOT EXECUTED 2002a74: 40 00 11 5e call 2006fec <== NOT EXECUTED 2002a78: 90 12 20 02 or %o0, 2, %o0 ! abcd0002 <== NOT EXECUTED =============================================================================== 0200c170 : bool rtems_filesystem_iterate( rtems_per_filesystem_routine routine, void *routine_arg ) { 200c170: 9d e3 bf a0 save %sp, -96, %sp const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0]; rtems_chain_node *node = NULL; bool stop = false; while ( table_entry->type && !stop ) { 200c174: 37 00 80 6b sethi %hi(0x201ac00), %i3 200c178: c2 06 e2 1c ld [ %i3 + 0x21c ], %g1 ! 201ae1c bool rtems_filesystem_iterate( rtems_per_filesystem_routine routine, void *routine_arg ) { 200c17c: ba 10 00 18 mov %i0, %i5 const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0]; rtems_chain_node *node = NULL; bool stop = false; while ( table_entry->type && !stop ) { 200c180: 80 a0 60 00 cmp %g1, 0 200c184: 02 80 00 13 be 200c1d0 <== NEVER TAKEN 200c188: b6 16 e2 1c or %i3, 0x21c, %i3 200c18c: b8 10 00 1b mov %i3, %i4 200c190: 10 80 00 05 b 200c1a4 200c194: b4 06 e0 08 add %i3, 8, %i2 200c198: b0 8a 20 ff andcc %o0, 0xff, %i0 200c19c: 12 80 00 28 bne 200c23c 200c1a0: 01 00 00 00 nop stop = (*routine)( table_entry, routine_arg ); 200c1a4: 90 10 00 1c mov %i4, %o0 200c1a8: 9f c7 40 00 call %i5 200c1ac: 92 10 00 19 mov %i1, %o1 rtems_filesystem_table_t entry; } filesystem_node; static RTEMS_CHAIN_DEFINE_EMPTY(filesystem_chain); bool rtems_filesystem_iterate( 200c1b0: 82 27 00 1b sub %i4, %i3, %g1 { const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0]; rtems_chain_node *node = NULL; bool stop = false; while ( table_entry->type && !stop ) { 200c1b4: c2 06 80 01 ld [ %i2 + %g1 ], %g1 200c1b8: 80 a0 60 00 cmp %g1, 0 200c1bc: 12 bf ff f7 bne 200c198 200c1c0: b8 07 20 08 add %i4, 8, %i4 stop = (*routine)( table_entry, routine_arg ); ++table_entry; } if ( !stop ) { 200c1c4: b0 8a 20 ff andcc %o0, 0xff, %i0 200c1c8: 12 80 00 1d bne 200c23c 200c1cc: 01 00 00 00 nop 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 ); 200c1d0: 39 00 80 75 sethi %hi(0x201d400), %i4 200c1d4: d0 07 23 8c ld [ %i4 + 0x38c ], %o0 ! 201d78c */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 200c1d8: 35 00 80 73 sethi %hi(0x201cc00), %i2 200c1dc: 92 10 20 00 clr %o1 200c1e0: 7f ff e9 c6 call 20068f8 200c1e4: 94 10 20 00 clr %o2 200c1e8: f6 06 a1 f8 ld [ %i2 + 0x1f8 ], %i3 200c1ec: b4 16 a1 f8 or %i2, 0x1f8, %i2 rtems_libio_lock(); for ( 200c1f0: b4 06 a0 04 add %i2, 4, %i2 200c1f4: 80 a6 c0 1a cmp %i3, %i2 200c1f8: 12 80 00 05 bne 200c20c 200c1fc: b0 10 20 00 clr %i0 200c200: 30 80 00 0b b,a 200c22c node = rtems_chain_first( &filesystem_chain ); !rtems_chain_is_tail( &filesystem_chain, node ) && !stop; 200c204: 12 80 00 0a bne 200c22c <== NEVER TAKEN 200c208: 01 00 00 00 nop node = rtems_chain_next( node ) ) { const filesystem_node *fsn = (filesystem_node *) node; stop = (*routine)( &fsn->entry, routine_arg ); 200c20c: 90 06 e0 08 add %i3, 8, %o0 200c210: 9f c7 40 00 call %i5 200c214: 92 10 00 19 mov %i1, %o1 } } rtems_libio_unlock(); rtems_set_errno_and_return_minus_one( ENOENT ); } 200c218: f6 06 c0 00 ld [ %i3 ], %i3 ++table_entry; } if ( !stop ) { rtems_libio_lock(); for ( 200c21c: 80 a6 c0 1a cmp %i3, %i2 200c220: 32 bf ff f9 bne,a 200c204 200c224: b0 8a 20 ff andcc %o0, 0xff, %i0 200c228: b0 0a 20 ff and %o0, 0xff, %i0 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 200c22c: 7f ff e9 fd call 2006a20 200c230: d0 07 23 8c ld [ %i4 + 0x38c ], %o0 } rtems_libio_unlock(); } return stop; } 200c234: 81 c7 e0 08 ret 200c238: 81 e8 00 00 restore 200c23c: 81 c7 e0 08 ret 200c240: 81 e8 00 00 restore =============================================================================== 02003470 : bool rtems_filesystem_mount_iterate( rtems_per_filesystem_mount_routine routine, void *routine_arg ) { 2003470: 9d e3 bf a0 save %sp, -96, %sp 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 ); 2003474: 3b 00 80 75 sethi %hi(0x201d400), %i5 2003478: d0 07 63 8c ld [ %i5 + 0x38c ], %o0 ! 201d78c */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 200347c: 37 00 80 73 sethi %hi(0x201cc00), %i3 2003480: 92 10 20 00 clr %o1 2003484: 40 00 0d 1d call 20068f8 2003488: 94 10 20 00 clr %o2 200348c: f8 06 e1 d0 ld [ %i3 + 0x1d0 ], %i4 2003490: b4 10 00 18 mov %i0, %i2 2003494: b6 16 e1 d0 or %i3, 0x1d0, %i3 rtems_chain_node *node = NULL; bool stop = false; rtems_libio_lock(); for ( 2003498: b6 06 e0 04 add %i3, 4, %i3 200349c: 80 a7 00 1b cmp %i4, %i3 20034a0: 12 80 00 05 bne 20034b4 <== ALWAYS TAKEN 20034a4: b0 10 20 00 clr %i0 20034a8: 30 80 00 0b b,a 20034d4 <== NOT EXECUTED node = rtems_chain_first( &mount_chain ); !rtems_chain_is_tail( &mount_chain, node ) && !stop; 20034ac: 12 80 00 0a bne 20034d4 <== NEVER TAKEN 20034b0: 01 00 00 00 nop 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 ); 20034b4: 90 10 00 1c mov %i4, %o0 20034b8: 9f c6 80 00 call %i2 20034bc: 92 10 00 19 mov %i1, %o1 } rtems_libio_unlock(); return stop; } 20034c0: f8 07 00 00 ld [ %i4 ], %i4 { rtems_chain_node *node = NULL; bool stop = false; rtems_libio_lock(); for ( 20034c4: 80 a7 00 1b cmp %i4, %i3 20034c8: 32 bf ff f9 bne,a 20034ac 20034cc: b0 8a 20 ff andcc %o0, 0xff, %i0 20034d0: b0 0a 20 ff and %o0, 0xff, %i0 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 20034d4: 40 00 0d 53 call 2006a20 20034d8: d0 07 63 8c ld [ %i5 + 0x38c ], %o0 stop = (*routine)( mt_entry, routine_arg ); } rtems_libio_unlock(); return stop; } 20034dc: 81 c7 e0 08 ret 20034e0: 81 e8 00 00 restore =============================================================================== 02002e28 : int rtems_filesystem_prefix_separators( const char *pathname, int pathnamelen ) { 2002e28: 9d e3 bf a0 save %sp, -96, %sp /* * Eat any separators at start of the path. */ int stripped = 0; while ( *pathname && pathnamelen && rtems_filesystem_is_separator( *pathname ) ) 2002e2c: 80 a6 60 00 cmp %i1, 0 2002e30: 02 80 00 17 be 2002e8c <== NEVER TAKEN 2002e34: d0 0e 00 00 ldub [ %i0 ], %o0 2002e38: 91 2a 20 18 sll %o0, 0x18, %o0 2002e3c: ba 10 00 18 mov %i0, %i5 2002e40: 80 a2 20 00 cmp %o0, 0 2002e44: 12 80 00 0b bne 2002e70 <== ALWAYS TAKEN 2002e48: b0 10 20 00 clr %i0 2002e4c: 30 80 00 11 b,a 2002e90 <== NOT EXECUTED { pathname++; pathnamelen--; stripped++; 2002e50: b0 06 20 01 inc %i0 { /* * Eat any separators at start of the path. */ int stripped = 0; while ( *pathname && pathnamelen && rtems_filesystem_is_separator( *pathname ) ) 2002e54: 80 a6 40 18 cmp %i1, %i0 2002e58: 02 80 00 0b be 2002e84 <== NEVER TAKEN 2002e5c: ba 07 60 01 inc %i5 2002e60: 91 2a 20 18 sll %o0, 0x18, %o0 2002e64: 80 a2 20 00 cmp %o0, 0 2002e68: 02 80 00 0a be 2002e90 <== NEVER TAKEN 2002e6c: 01 00 00 00 nop 2002e70: 40 00 04 0f call 2003eac 2002e74: 91 3a 20 18 sra %o0, 0x18, %o0 2002e78: 80 a2 20 00 cmp %o0, 0 2002e7c: 32 bf ff f5 bne,a 2002e50 2002e80: d0 0f 60 01 ldub [ %i5 + 1 ], %o0 2002e84: 81 c7 e0 08 ret 2002e88: 81 e8 00 00 restore ) { /* * Eat any separators at start of the path. */ int stripped = 0; 2002e8c: b0 10 20 00 clr %i0 <== NOT EXECUTED pathname++; pathnamelen--; stripped++; } return stripped; } 2002e90: 81 c7 e0 08 ret <== NOT EXECUTED 2002e94: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 0200c344 : int rtems_filesystem_unregister( const char *type ) { 200c344: 9d e3 bf a0 save %sp, -96, %sp rtems_chain_node *node = NULL; if ( type == NULL ) { 200c348: 80 a6 20 00 cmp %i0, 0 200c34c: 02 80 00 29 be 200c3f0 200c350: 3b 00 80 75 sethi %hi(0x201d400), %i5 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 ); 200c354: d0 07 63 8c ld [ %i5 + 0x38c ], %o0 ! 201d78c 200c358: 37 00 80 73 sethi %hi(0x201cc00), %i3 200c35c: 92 10 20 00 clr %o1 200c360: 7f ff e9 66 call 20068f8 200c364: 94 10 20 00 clr %o2 200c368: f8 06 e1 f8 ld [ %i3 + 0x1f8 ], %i4 200c36c: b6 16 e1 f8 or %i3, 0x1f8, %i3 rtems_set_errno_and_return_minus_one( EINVAL ); } rtems_libio_lock(); for ( 200c370: b6 06 e0 04 add %i3, 4, %i3 200c374: 80 a7 00 1b cmp %i4, %i3 200c378: 32 80 00 08 bne,a 200c398 200c37c: d0 07 20 08 ld [ %i4 + 8 ], %o0 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 200c380: 10 80 00 14 b 200c3d0 200c384: d0 07 63 8c ld [ %i5 + 0x38c ], %o0 200c388: 80 a7 00 1b cmp %i4, %i3 200c38c: 02 80 00 11 be 200c3d0 <== ALWAYS TAKEN 200c390: d0 07 63 8c ld [ %i5 + 0x38c ], %o0 !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 ) { 200c394: d0 07 20 08 ld [ %i4 + 8 ], %o0 <== NOT EXECUTED 200c398: 40 00 11 05 call 20107ac 200c39c: 92 10 00 18 mov %i0, %o1 200c3a0: 80 a2 20 00 cmp %o0, 0 200c3a4: 32 bf ff f9 bne,a 200c388 200c3a8: f8 07 00 00 ld [ %i4 ], %i4 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 200c3ac: 7f ff ec 06 call 20073c4 <_Chain_Extract> 200c3b0: 90 10 00 1c mov %i4, %o0 rtems_chain_extract( node ); free( fsn ); 200c3b4: 7f ff da c0 call 2002eb4 200c3b8: 90 10 00 1c mov %i4, %o0 200c3bc: d0 07 63 8c ld [ %i5 + 0x38c ], %o0 200c3c0: 7f ff e9 98 call 2006a20 200c3c4: b0 10 20 00 clr %i0 200c3c8: 81 c7 e0 08 ret 200c3cc: 81 e8 00 00 restore 200c3d0: 7f ff e9 94 call 2006a20 200c3d4: b0 10 3f ff mov -1, %i0 return 0; } } rtems_libio_unlock(); rtems_set_errno_and_return_minus_one( ENOENT ); 200c3d8: 40 00 0d 55 call 200f92c <__errno> 200c3dc: 01 00 00 00 nop 200c3e0: 82 10 20 02 mov 2, %g1 ! 2 200c3e4: c2 22 00 00 st %g1, [ %o0 ] } 200c3e8: 81 c7 e0 08 ret 200c3ec: 81 e8 00 00 restore ) { rtems_chain_node *node = NULL; if ( type == NULL ) { rtems_set_errno_and_return_minus_one( EINVAL ); 200c3f0: 40 00 0d 4f call 200f92c <__errno> 200c3f4: b0 10 3f ff mov -1, %i0 200c3f8: 82 10 20 16 mov 0x16, %g1 200c3fc: c2 22 00 00 st %g1, [ %o0 ] 200c400: 81 c7 e0 08 ret 200c404: 81 e8 00 00 restore =============================================================================== 02003474 : int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *)) { 2003474: 9d e3 bf a0 save %sp, -96, %sp * pointer to the buffer that will hold the value of the key itself. * We have to to this, because the others functions on this interface * deal with the value of the key, as used with the POSIX API. */ /* Do not pull your hair, trust me this works. :-) */ __gthread_key_t new_key = (__gthread_key_t) malloc( sizeof( *new_key ) ); 2003478: 40 00 01 1e call 20038f0 200347c: 90 10 20 08 mov 8, %o0 *key = new_key; new_key->val = NULL; 2003480: c0 22 00 00 clr [ %o0 ] * We have to to this, because the others functions on this interface * deal with the value of the key, as used with the POSIX API. */ /* Do not pull your hair, trust me this works. :-) */ __gthread_key_t new_key = (__gthread_key_t) malloc( sizeof( *new_key ) ); *key = new_key; 2003484: d0 26 00 00 st %o0, [ %i0 ] * pointer to the buffer that will hold the value of the key itself. * We have to to this, because the others functions on this interface * deal with the value of the key, as used with the POSIX API. */ /* Do not pull your hair, trust me this works. :-) */ __gthread_key_t new_key = (__gthread_key_t) malloc( sizeof( *new_key ) ); 2003488: ba 10 00 08 mov %o0, %i5 } return 0; } int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *)) { 200348c: 94 10 00 19 mov %i1, %o2 */ /* Do not pull your hair, trust me this works. :-) */ __gthread_key_t new_key = (__gthread_key_t) malloc( sizeof( *new_key ) ); *key = new_key; new_key->val = NULL; new_key->dtor = dtor; 2003490: f2 27 60 04 st %i1, [ %i5 + 4 ] "gxx_wrappers: create key=%x, dtor=%x, new_key=%x\n", key, dtor, new_key ); #endif /* register with RTEMS the buffer that will hold the key values */ status = rtems_task_variable_add( RTEMS_SELF, (void **)new_key, dtor ); 2003494: 90 10 20 00 clr %o0 2003498: 92 10 00 1d mov %i5, %o1 200349c: 40 00 10 29 call 2007540 20034a0: b0 10 20 00 clr %i0 if ( status == RTEMS_SUCCESSFUL ) 20034a4: 80 a2 20 00 cmp %o0, 0 20034a8: 02 80 00 04 be 20034b8 <== ALWAYS TAKEN 20034ac: 90 10 00 1d mov %i5, %o0 return 0; free( new_key ); 20034b0: 7f ff ff 89 call 20032d4 <== NOT EXECUTED 20034b4: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED return -1; } 20034b8: 81 c7 e0 08 ret 20034bc: 81 e8 00 00 restore =============================================================================== 020034cc : int rtems_gxx_key_delete (__gthread_key_t key) { 20034cc: 9d e3 bf a0 save %sp, -96, %sp #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 ); 20034d0: 90 10 20 00 clr %o0 20034d4: 40 00 10 4c call 2007604 20034d8: 92 10 00 18 mov %i0, %o1 if ( status == RTEMS_SUCCESSFUL ) { 20034dc: 80 a2 20 00 cmp %o0, 0 20034e0: 12 80 00 06 bne 20034f8 <== NEVER TAKEN 20034e4: 80 a6 20 00 cmp %i0, 0 /* Hmm - hopefully all tasks using this key have gone away... */ if ( key ) free( *(void **)key ); 20034e8: 02 80 00 04 be 20034f8 <== NEVER TAKEN 20034ec: 01 00 00 00 nop 20034f0: 7f ff ff 79 call 20032d4 20034f4: d0 06 00 00 ld [ %i0 ], %o0 return 0; } key = NULL; return 0; } 20034f8: 81 c7 e0 08 ret 20034fc: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 02003404 : /* uncomment this if you need to debug this interface */ /*#define DEBUG_GXX_WRAPPERS 1*/ int rtems_gxx_once(__gthread_once_t *once, void (*func) (void)) { 2003404: 9d e3 bf 98 save %sp, -104, %sp #ifdef DEBUG_GXX_WRAPPERS printk( "gxx_wrappers: once=%x, func=%x\n", *once, func ); #endif if ( *(volatile __gthread_once_t *)once == 0 ) { 2003408: c2 06 00 00 ld [ %i0 ], %g1 200340c: 80 a0 60 00 cmp %g1, 0 2003410: 02 80 00 04 be 2003420 2003414: 92 10 21 00 mov 0x100, %o1 rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); if ( o == 0 ) (*func)(); } return 0; } 2003418: 81 c7 e0 08 ret 200341c: 91 e8 20 00 restore %g0, 0, %o0 if ( *(volatile __gthread_once_t *)once == 0 ) { rtems_mode saveMode; __gthread_once_t o; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 2003420: 94 07 bf fc add %fp, -4, %o2 2003424: 40 00 0f c0 call 2007324 2003428: 90 10 21 00 mov 0x100, %o0 if ( (o = *(volatile __gthread_once_t *)once) == 0 ) { 200342c: c2 06 00 00 ld [ %i0 ], %g1 *(volatile __gthread_once_t *)once = 1; } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 2003430: d0 07 bf fc ld [ %fp + -4 ], %o0 2003434: 92 10 21 00 mov 0x100, %o1 if ( *(volatile __gthread_once_t *)once == 0 ) { rtems_mode saveMode; __gthread_once_t o; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); if ( (o = *(volatile __gthread_once_t *)once) == 0 ) { 2003438: 80 a0 60 00 cmp %g1, 0 200343c: 12 80 00 0a bne 2003464 <== NEVER TAKEN 2003440: 94 07 bf fc add %fp, -4, %o2 *(volatile __gthread_once_t *)once = 1; 2003444: 82 10 20 01 mov 1, %g1 2003448: c2 26 00 00 st %g1, [ %i0 ] } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 200344c: 40 00 0f b6 call 2007324 2003450: b0 10 20 00 clr %i0 if ( o == 0 ) (*func)(); 2003454: 9f c6 40 00 call %i1 2003458: 01 00 00 00 nop } return 0; } 200345c: 81 c7 e0 08 ret 2003460: 81 e8 00 00 restore rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); if ( (o = *(volatile __gthread_once_t *)once) == 0 ) { *(volatile __gthread_once_t *)once = 1; } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 2003464: 40 00 0f b0 call 2007324 <== NOT EXECUTED 2003468: b0 10 20 00 clr %i0 <== NOT EXECUTED if ( o == 0 ) (*func)(); } return 0; } 200346c: 81 c7 e0 08 ret <== NOT EXECUTED 2003470: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 02003568 : #endif return p; } int rtems_gxx_setspecific(__gthread_key_t key, const void *ptr) { 2003568: 9d e3 bf a0 save %sp, -96, %sp 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 ); 200356c: d4 06 20 04 ld [ %i0 + 4 ], %o2 2003570: 92 10 00 18 mov %i0, %o1 #endif return p; } int rtems_gxx_setspecific(__gthread_key_t key, const void *ptr) { 2003574: ba 10 00 18 mov %i0, %i5 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 ); 2003578: 90 10 20 00 clr %o0 200357c: 40 00 0f f1 call 2007540 2003580: b0 10 3f ff mov -1, %i0 if ( status == RTEMS_SUCCESSFUL ) { 2003584: 80 a2 20 00 cmp %o0, 0 2003588: 12 80 00 04 bne 2003598 <== NEVER TAKEN 200358c: 01 00 00 00 nop /* now let's set the proper value */ key->val = (void *)ptr; 2003590: f2 27 40 00 st %i1, [ %i5 ] return 0; 2003594: b0 10 20 00 clr %i0 } return -1; } 2003598: 81 c7 e0 08 ret 200359c: 81 e8 00 00 restore =============================================================================== 020076a0 : void *rtems_heap_allocate_aligned_with_boundary( size_t size, uintptr_t alignment, uintptr_t boundary ) { 20076a0: 9d e3 bf a0 save %sp, -96, %sp if ( 20076a4: 03 00 80 91 sethi %hi(0x2024400), %g1 20076a8: c2 00 62 ec ld [ %g1 + 0x2ec ], %g1 ! 20246ec <_System_state_Current> void *rtems_heap_allocate_aligned_with_boundary( size_t size, uintptr_t alignment, uintptr_t boundary ) { 20076ac: b8 10 00 18 mov %i0, %i4 20076b0: ba 10 00 19 mov %i1, %i5 if ( 20076b4: 80 a0 60 03 cmp %g1, 3 20076b8: 02 80 00 08 be 20076d8 <== ALWAYS TAKEN 20076bc: b6 10 00 1a mov %i2, %i3 && !malloc_is_system_state_OK() ) { return NULL; } malloc_deferred_frees_process(); 20076c0: 7f ff fb 8f call 20064fc 20076c4: b2 10 00 1c mov %i4, %i1 /* FIXME: Statistics, boundary checks */ return _Protected_heap_Allocate_aligned_with_boundary( 20076c8: 03 00 80 8c sethi %hi(0x2023000), %g1 20076cc: f0 00 60 34 ld [ %g1 + 0x34 ], %i0 ! 2023034 20076d0: 40 00 16 1c call 200cf40 <_Protected_heap_Allocate_aligned_with_boundary> 20076d4: 95 e8 00 1d restore %g0, %i5, %o2 uintptr_t boundary ) { if ( _System_state_Is_up( _System_state_Get() ) && !malloc_is_system_state_OK() 20076d8: 7f ff fb 77 call 20064b4 20076dc: 01 00 00 00 nop 20076e0: 80 8a 20 ff btst 0xff, %o0 20076e4: 12 bf ff f7 bne 20076c0 20076e8: b0 10 20 00 clr %i0 RTEMS_Malloc_Heap, size, alignment, boundary ); } 20076ec: 81 c7 e0 08 ret 20076f0: 81 e8 00 00 restore =============================================================================== 020028c0 : rtems_status_code rtems_io_lookup_name( const char *name, rtems_driver_name_t *device_info ) { 20028c0: 9d e3 bf 88 save %sp, -120, %sp IMFS_jnode_t *the_jnode; rtems_filesystem_location_info_t loc; int result; rtems_filesystem_node_types_t node_type; result = rtems_filesystem_evaluate_path( 20028c4: 40 00 39 a9 call 2010f68 20028c8: 90 10 00 18 mov %i0, %o0 20028cc: 94 10 20 00 clr %o2 20028d0: 92 10 00 08 mov %o0, %o1 20028d4: 96 07 bf ec add %fp, -20, %o3 20028d8: 98 10 20 01 mov 1, %o4 20028dc: 40 00 01 35 call 2002db0 20028e0: 90 10 00 18 mov %i0, %o0 name, strlen( name ), 0x00, &loc, true ); the_jnode = loc.node_access; node_type = (*loc.ops->node_type_h)( &loc ); 20028e4: c2 07 bf f8 ld [ %fp + -8 ], %g1 IMFS_jnode_t *the_jnode; rtems_filesystem_location_info_t loc; int result; rtems_filesystem_node_types_t node_type; result = rtems_filesystem_evaluate_path( 20028e8: b8 10 00 08 mov %o0, %i4 name, strlen( name ), 0x00, &loc, true ); the_jnode = loc.node_access; node_type = (*loc.ops->node_type_h)( &loc ); 20028ec: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 int result; rtems_filesystem_node_types_t node_type; result = rtems_filesystem_evaluate_path( name, strlen( name ), 0x00, &loc, true ); the_jnode = loc.node_access; 20028f0: fa 07 bf ec ld [ %fp + -20 ], %i5 node_type = (*loc.ops->node_type_h)( &loc ); 20028f4: 9f c0 40 00 call %g1 20028f8: 90 07 bf ec add %fp, -20, %o0 if ( (result != 0) || node_type != RTEMS_FILESYSTEM_DEVICE ) { 20028fc: 80 a2 20 02 cmp %o0, 2 2002900: 02 80 00 07 be 200291c 2002904: 80 a7 20 00 cmp %i4, 0 rtems_filesystem_freenode( &loc ); 2002908: 90 07 bf ec add %fp, -20, %o0 200290c: 40 00 01 63 call 2002e98 2002910: b0 10 20 0d mov 0xd, %i0 return RTEMS_UNSATISFIED; 2002914: 81 c7 e0 08 ret 2002918: 81 e8 00 00 restore name, strlen( name ), 0x00, &loc, true ); the_jnode = loc.node_access; node_type = (*loc.ops->node_type_h)( &loc ); if ( (result != 0) || node_type != RTEMS_FILESYSTEM_DEVICE ) { 200291c: 12 bf ff fc bne 200290c <== NEVER TAKEN 2002920: 90 07 bf ec add %fp, -20, %o0 rtems_filesystem_freenode( &loc ); return RTEMS_UNSATISFIED; } device_info->device_name = (char *) name; 2002924: f0 26 40 00 st %i0, [ %i1 ] device_info->device_name_length = strlen( name ); 2002928: 40 00 39 90 call 2010f68 200292c: 90 10 00 18 mov %i0, %o0 2002930: d0 26 60 04 st %o0, [ %i1 + 4 ] device_info->major = the_jnode->info.device.major; 2002934: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 device_info->minor = the_jnode->info.device.minor; rtems_filesystem_freenode( &loc ); 2002938: 90 07 bf ec add %fp, -20, %o0 return RTEMS_UNSATISFIED; } device_info->device_name = (char *) name; device_info->device_name_length = strlen( name ); device_info->major = the_jnode->info.device.major; 200293c: c2 26 60 08 st %g1, [ %i1 + 8 ] device_info->minor = the_jnode->info.device.minor; 2002940: c2 07 60 54 ld [ %i5 + 0x54 ], %g1 rtems_filesystem_freenode( &loc ); return RTEMS_SUCCESSFUL; 2002944: b0 10 20 00 clr %i0 device_info->device_name = (char *) name; device_info->device_name_length = strlen( name ); device_info->major = the_jnode->info.device.major; device_info->minor = the_jnode->info.device.minor; rtems_filesystem_freenode( &loc ); 2002948: 40 00 01 54 call 2002e98 200294c: c2 26 60 0c st %g1, [ %i1 + 0xc ] return RTEMS_SUCCESSFUL; } 2002950: 81 c7 e0 08 ret 2002954: 81 e8 00 00 restore =============================================================================== 02007dc8 : rtems_status_code rtems_io_register_driver( rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { 2007dc8: 9d e3 bf a0 save %sp, -96, %sp rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 2007dcc: 03 00 80 6c sethi %hi(0x201b000), %g1 2007dd0: c4 00 61 40 ld [ %g1 + 0x140 ], %g2 ! 201b140 <_Per_CPU_Information+0x8> rtems_status_code rtems_io_register_driver( rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { 2007dd4: 86 10 00 19 mov %i1, %g3 rtems_device_major_number major_limit = _IO_Number_of_drivers; 2007dd8: 03 00 80 6d sethi %hi(0x201b400), %g1 if ( rtems_interrupt_is_in_progress() ) return RTEMS_CALLED_FROM_ISR; 2007ddc: 88 10 20 12 mov 0x12, %g4 rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 2007de0: 80 a0 a0 00 cmp %g2, 0 2007de4: 02 80 00 04 be 2007df4 2007de8: de 00 61 74 ld [ %g1 + 0x174 ], %o7 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 2007dec: 81 c7 e0 08 ret 2007df0: 91 e8 00 04 restore %g0, %g4, %o0 rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 2007df4: 80 a6 a0 00 cmp %i2, 0 2007df8: 02 80 00 40 be 2007ef8 2007dfc: 80 a6 60 00 cmp %i1, 0 return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; if ( driver_table == NULL ) 2007e00: 02 80 00 3e be 2007ef8 2007e04: de 26 80 00 st %o7, [ %i2 ] static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 2007e08: c4 06 40 00 ld [ %i1 ], %g2 2007e0c: 80 a0 a0 00 cmp %g2, 0 2007e10: 22 80 00 37 be,a 2007eec 2007e14: c4 06 60 04 ld [ %i1 + 4 ], %g2 return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 2007e18: 80 a3 c0 18 cmp %o7, %i0 2007e1c: 08 bf ff f4 bleu 2007dec 2007e20: 88 10 20 0a mov 0xa, %g4 /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 2007e24: 05 00 80 6b sethi %hi(0x201ac00), %g2 2007e28: c8 00 a0 00 ld [ %g2 ], %g4 2007e2c: 88 01 20 01 inc %g4 2007e30: c8 20 a0 00 st %g4, [ %g2 ] return _Thread_Dispatch_disable_level; 2007e34: c4 00 a0 00 ld [ %g2 ], %g2 return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 2007e38: 80 a6 20 00 cmp %i0, 0 2007e3c: 12 80 00 32 bne 2007f04 2007e40: 1f 00 80 6d sethi %hi(0x201b400), %o7 static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 2007e44: c8 00 61 74 ld [ %g1 + 0x174 ], %g4 rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 2007e48: 80 a1 20 00 cmp %g4, 0 2007e4c: 02 80 00 45 be 2007f60 <== NEVER TAKEN 2007e50: c2 03 e1 78 ld [ %o7 + 0x178 ], %g1 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 2007e54: 10 80 00 06 b 2007e6c 2007e58: c4 00 40 00 ld [ %g1 ], %g2 rtems_device_major_number n = _IO_Number_of_drivers; rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 2007e5c: 80 a6 00 04 cmp %i0, %g4 2007e60: 02 80 00 35 be 2007f34 2007e64: 82 00 60 18 add %g1, 0x18, %g1 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 2007e68: c4 00 40 00 ld [ %g1 ], %g2 2007e6c: 80 a0 a0 00 cmp %g2, 0 2007e70: 32 bf ff fb bne,a 2007e5c 2007e74: b0 06 20 01 inc %i0 2007e78: c4 00 60 04 ld [ %g1 + 4 ], %g2 2007e7c: 80 a0 a0 00 cmp %g2, 0 2007e80: 32 bf ff f7 bne,a 2007e5c 2007e84: b0 06 20 01 inc %i0 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 2007e88: f0 26 80 00 st %i0, [ %i2 ] 2007e8c: 83 2e 20 03 sll %i0, 3, %g1 if ( m != n ) 2007e90: 80 a1 00 18 cmp %g4, %i0 2007e94: 02 80 00 29 be 2007f38 <== NEVER TAKEN 2007e98: 9b 2e 20 05 sll %i0, 5, %o5 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 2007e9c: c8 00 c0 00 ld [ %g3 ], %g4 2007ea0: c4 03 e1 78 ld [ %o7 + 0x178 ], %g2 2007ea4: 82 23 40 01 sub %o5, %g1, %g1 2007ea8: c8 20 80 01 st %g4, [ %g2 + %g1 ] 2007eac: c8 00 e0 04 ld [ %g3 + 4 ], %g4 2007eb0: 82 00 80 01 add %g2, %g1, %g1 2007eb4: c8 20 60 04 st %g4, [ %g1 + 4 ] 2007eb8: c4 00 e0 08 ld [ %g3 + 8 ], %g2 _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 2007ebc: b2 10 20 00 clr %i1 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 2007ec0: c4 20 60 08 st %g2, [ %g1 + 8 ] 2007ec4: c4 00 e0 0c ld [ %g3 + 0xc ], %g2 _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 2007ec8: b4 10 20 00 clr %i2 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 2007ecc: c4 20 60 0c st %g2, [ %g1 + 0xc ] 2007ed0: c4 00 e0 10 ld [ %g3 + 0x10 ], %g2 2007ed4: c4 20 60 10 st %g2, [ %g1 + 0x10 ] 2007ed8: c4 00 e0 14 ld [ %g3 + 0x14 ], %g2 _Thread_Enable_dispatch(); 2007edc: 40 00 08 12 call 2009f24 <_Thread_Enable_dispatch> 2007ee0: c4 20 60 14 st %g2, [ %g1 + 0x14 ] return rtems_io_initialize( major, 0, NULL ); 2007ee4: 40 00 23 61 call 2010c68 2007ee8: 81 e8 00 00 restore static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 2007eec: 80 a0 a0 00 cmp %g2, 0 2007ef0: 12 bf ff cb bne 2007e1c 2007ef4: 80 a3 c0 18 cmp %o7, %i0 if ( driver_table == NULL ) return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; 2007ef8: 88 10 20 09 mov 9, %g4 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 2007efc: 81 c7 e0 08 ret 2007f00: 91 e8 00 04 restore %g0, %g4, %o0 _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 2007f04: c8 03 e1 78 ld [ %o7 + 0x178 ], %g4 2007f08: 83 2e 20 03 sll %i0, 3, %g1 2007f0c: 9b 2e 20 05 sll %i0, 5, %o5 2007f10: 84 23 40 01 sub %o5, %g1, %g2 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 2007f14: d8 01 00 02 ld [ %g4 + %g2 ], %o4 2007f18: 80 a3 20 00 cmp %o4, 0 2007f1c: 02 80 00 0b be 2007f48 2007f20: 84 01 00 02 add %g4, %g2, %g2 major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); 2007f24: 40 00 08 00 call 2009f24 <_Thread_Enable_dispatch> 2007f28: 01 00 00 00 nop return RTEMS_RESOURCE_IN_USE; 2007f2c: 10 bf ff b0 b 2007dec 2007f30: 88 10 20 0c mov 0xc, %g4 ! c if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 2007f34: f0 26 80 00 st %i0, [ %i2 ] if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 2007f38: 40 00 07 fb call 2009f24 <_Thread_Enable_dispatch> 2007f3c: 01 00 00 00 nop return sc; 2007f40: 10 bf ff ab b 2007dec 2007f44: 88 10 20 05 mov 5, %g4 ! 5 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 2007f48: c4 00 a0 04 ld [ %g2 + 4 ], %g2 2007f4c: 80 a0 a0 00 cmp %g2, 0 2007f50: 12 bf ff f5 bne 2007f24 2007f54: 01 00 00 00 nop if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } *registered_major = major; 2007f58: 10 bf ff d1 b 2007e9c 2007f5c: f0 26 80 00 st %i0, [ %i2 ] if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 2007f60: 10 bf ff f6 b 2007f38 <== NOT EXECUTED 2007f64: c0 26 80 00 clr [ %i2 ] <== NOT EXECUTED =============================================================================== 0200950c : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 200950c: 9d e3 bf a0 save %sp, -96, %sp uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 2009510: 80 a6 20 00 cmp %i0, 0 2009514: 02 80 00 20 be 2009594 <== NEVER TAKEN 2009518: 37 00 80 80 sethi %hi(0x2020000), %i3 200951c: b6 16 e3 9c or %i3, 0x39c, %i3 ! 202039c <_Objects_Information_table+0x4> #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 2009520: b4 06 e0 0c add %i3, 0xc, %i2 #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 2009524: c2 06 c0 00 ld [ %i3 ], %g1 2009528: f8 00 60 04 ld [ %g1 + 4 ], %i4 if ( !information ) 200952c: 80 a7 20 00 cmp %i4, 0 2009530: 22 80 00 16 be,a 2009588 2009534: b6 06 e0 04 add %i3, 4, %i3 continue; for ( i=1 ; i <= information->maximum ; i++ ) { 2009538: c2 17 20 10 lduh [ %i4 + 0x10 ], %g1 200953c: 84 90 60 00 orcc %g1, 0, %g2 2009540: 22 80 00 12 be,a 2009588 2009544: b6 06 e0 04 add %i3, 4, %i3 2009548: ba 10 20 01 mov 1, %i5 the_thread = (Thread_Control *)information->local_table[ i ]; 200954c: c6 07 20 1c ld [ %i4 + 0x1c ], %g3 2009550: 83 2f 60 02 sll %i5, 2, %g1 2009554: c2 00 c0 01 ld [ %g3 + %g1 ], %g1 if ( !the_thread ) 2009558: 90 90 60 00 orcc %g1, 0, %o0 200955c: 02 80 00 05 be 2009570 2009560: ba 07 60 01 inc %i5 continue; (*routine)(the_thread); 2009564: 9f c6 00 00 call %i0 2009568: 01 00 00 00 nop 200956c: c4 17 20 10 lduh [ %i4 + 0x10 ], %g2 information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 2009570: 83 28 a0 10 sll %g2, 0x10, %g1 2009574: 83 30 60 10 srl %g1, 0x10, %g1 2009578: 80 a0 40 1d cmp %g1, %i5 200957c: 3a bf ff f5 bcc,a 2009550 2009580: c6 07 20 1c ld [ %i4 + 0x1c ], %g3 2009584: b6 06 e0 04 add %i3, 4, %i3 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 2009588: 80 a6 c0 1a cmp %i3, %i2 200958c: 32 bf ff e7 bne,a 2009528 2009590: c2 06 c0 00 ld [ %i3 ], %g1 2009594: 81 c7 e0 08 ret 2009598: 81 e8 00 00 restore =============================================================================== 0200bfcc : */ void rtems_libio_free( rtems_libio_t *iop ) { 200bfcc: 9d e3 bf a0 save %sp, -96, %sp 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 ); 200bfd0: 39 00 80 75 sethi %hi(0x201d400), %i4 200bfd4: d0 07 23 8c ld [ %i4 + 0x38c ], %o0 ! 201d78c 200bfd8: 92 10 20 00 clr %o1 200bfdc: 7f ff ea 47 call 20068f8 200bfe0: 94 10 20 00 clr %o2 rtems_libio_lock(); if (iop->sem) 200bfe4: d0 06 20 30 ld [ %i0 + 0x30 ], %o0 200bfe8: 80 a2 20 00 cmp %o0, 0 200bfec: 02 80 00 04 be 200bffc <== NEVER TAKEN 200bff0: ba 10 00 18 mov %i0, %i5 rtems_semaphore_delete(iop->sem); 200bff4: 7f ff ea 0a call 200681c 200bff8: 01 00 00 00 nop iop->flags &= ~LIBIO_FLAGS_OPEN; 200bffc: c4 07 60 18 ld [ %i5 + 0x18 ], %g2 iop->data1 = rtems_libio_iop_freelist; 200c000: 03 00 80 75 sethi %hi(0x201d400), %g1 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 200c004: f0 07 23 8c ld [ %i4 + 0x38c ], %i0 200c008: c6 00 63 88 ld [ %g1 + 0x388 ], %g3 rtems_libio_lock(); if (iop->sem) rtems_semaphore_delete(iop->sem); iop->flags &= ~LIBIO_FLAGS_OPEN; 200c00c: 84 08 be ff and %g2, -257, %g2 iop->data1 = rtems_libio_iop_freelist; 200c010: c6 27 60 38 st %g3, [ %i5 + 0x38 ] rtems_libio_lock(); if (iop->sem) rtems_semaphore_delete(iop->sem); iop->flags &= ~LIBIO_FLAGS_OPEN; 200c014: c4 27 60 18 st %g2, [ %i5 + 0x18 ] iop->data1 = rtems_libio_iop_freelist; rtems_libio_iop_freelist = iop; 200c018: fa 20 63 88 st %i5, [ %g1 + 0x388 ] 200c01c: 7f ff ea 81 call 2006a20 200c020: 81 e8 00 00 restore =============================================================================== 02002fe4 : * * Called by BSP startup code to initialize the libio subsystem. */ void rtems_libio_init( void ) { 2002fe4: 9d e3 bf a0 save %sp, -96, %sp rtems_status_code rc; uint32_t i; rtems_libio_t *iop; if (rtems_libio_number_iops > 0) 2002fe8: 03 00 80 73 sethi %hi(0x201cc00), %g1 2002fec: fa 00 61 0c ld [ %g1 + 0x10c ], %i5 ! 201cd0c 2002ff0: 80 a7 60 00 cmp %i5, 0 2002ff4: 02 80 00 11 be 2003038 <== NEVER TAKEN 2002ff8: 92 10 20 01 mov 1, %o1 { rtems_libio_iops = (rtems_libio_t *) calloc(rtems_libio_number_iops, 2002ffc: 90 10 00 1d mov %i5, %o0 2003000: 7f ff fe a0 call 2002a80 2003004: 92 10 20 40 mov 0x40, %o1 2003008: 03 00 80 75 sethi %hi(0x201d400), %g1 sizeof(rtems_libio_t)); if (rtems_libio_iops == NULL) 200300c: 80 a2 20 00 cmp %o0, 0 2003010: 02 80 00 28 be 20030b0 2003014: d0 20 63 84 st %o0, [ %g1 + 0x384 ] rtems_fatal_error_occurred(RTEMS_NO_MEMORY); iop = rtems_libio_iop_freelist = rtems_libio_iops; 2003018: 03 00 80 75 sethi %hi(0x201d400), %g1 200301c: d0 20 63 88 st %o0, [ %g1 + 0x388 ] ! 201d788 for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++) 2003020: 84 10 00 08 mov %o0, %g2 2003024: 80 a7 60 01 cmp %i5, 1 2003028: 18 80 00 17 bgu 2003084 <== ALWAYS TAKEN 200302c: 82 10 20 01 mov 1, %g1 iop->data1 = iop + 1; iop->data1 = NULL; 2003030: c0 22 20 38 clr [ %o0 + 0x38 ] /* * Create the binary semaphore used to provide mutual exclusion * on the IOP Table. */ rc = rtems_semaphore_create( 2003034: 92 10 20 01 mov 1, %o1 2003038: 11 13 10 92 sethi %hi(0x4c424800), %o0 200303c: 94 10 20 54 mov 0x54, %o2 2003040: 90 12 21 4f or %o0, 0x14f, %o0 2003044: 96 10 20 00 clr %o3 2003048: 19 00 80 75 sethi %hi(0x201d400), %o4 200304c: 40 00 0d 84 call 200665c 2003050: 98 13 23 8c or %o4, 0x38c, %o4 ! 201d78c 1, RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &rtems_libio_semaphore ); if ( rc != RTEMS_SUCCESSFUL ) 2003054: 80 a2 20 00 cmp %o0, 0 2003058: 12 80 00 14 bne 20030a8 <== NEVER TAKEN 200305c: 03 00 80 73 sethi %hi(0x201cc00), %g1 /* * Initialize the base file system infrastructure. */ if (rtems_fs_init_helper) 2003060: c2 00 61 10 ld [ %g1 + 0x110 ], %g1 ! 201cd10 2003064: 80 a0 60 00 cmp %g1, 0 2003068: 02 80 00 04 be 2003078 <== NEVER TAKEN 200306c: 01 00 00 00 nop (* rtems_fs_init_helper)(); 2003070: 9f c0 40 00 call %g1 2003074: 01 00 00 00 nop 2003078: 81 c7 e0 08 ret 200307c: 81 e8 00 00 restore 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++) 2003080: 84 10 00 03 mov %g3, %g2 iop->data1 = iop + 1; 2003084: 86 00 a0 40 add %g2, 0x40, %g3 2003088: 82 00 60 01 inc %g1 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++) 200308c: 80 a0 40 1d cmp %g1, %i5 2003090: 12 bf ff fc bne 2003080 2003094: c6 20 a0 38 st %g3, [ %g2 + 0x38 ] * rtems_libio_init * * Called by BSP startup code to initialize the libio subsystem. */ void rtems_libio_init( void ) 2003098: 82 00 7f ff add %g1, -1, %g1 200309c: 83 28 60 06 sll %g1, 6, %g1 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++) 20030a0: 10 bf ff e4 b 2003030 20030a4: 90 02 00 01 add %o0, %g1, %o0 RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &rtems_libio_semaphore ); if ( rc != RTEMS_SUCCESSFUL ) rtems_fatal_error_occurred( rc ); 20030a8: 40 00 0f d1 call 2006fec <== NOT EXECUTED 20030ac: 01 00 00 00 nop <== NOT EXECUTED if (rtems_libio_number_iops > 0) { rtems_libio_iops = (rtems_libio_t *) calloc(rtems_libio_number_iops, sizeof(rtems_libio_t)); if (rtems_libio_iops == NULL) rtems_fatal_error_occurred(RTEMS_NO_MEMORY); 20030b0: 40 00 0f cf call 2006fec 20030b4: 90 10 20 1a mov 0x1a, %o0 ! 1a =============================================================================== 0200c0b0 : */ int rtems_libio_is_file_open( void *node_access ) { 200c0b0: 9d e3 bf a0 save %sp, -96, %sp 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 ); 200c0b4: 3b 00 80 75 sethi %hi(0x201d400), %i5 200c0b8: d0 07 63 8c ld [ %i5 + 0x38c ], %o0 ! 201d78c 200c0bc: 92 10 20 00 clr %o1 200c0c0: 7f ff ea 0e call 20068f8 200c0c4: 94 10 20 00 clr %o2 /* * Look for any active file descriptor entry. */ for (iop=rtems_libio_iops,i=0; i < rtems_libio_number_iops; iop++, i++){ 200c0c8: 03 00 80 73 sethi %hi(0x201cc00), %g1 200c0cc: c2 00 61 0c ld [ %g1 + 0x10c ], %g1 ! 201cd0c 200c0d0: 05 00 80 75 sethi %hi(0x201d400), %g2 int rtems_libio_is_file_open( void *node_access ) { rtems_libio_t *iop; int result=0; 200c0d4: b8 10 20 00 clr %i4 /* * Look for any active file descriptor entry. */ for (iop=rtems_libio_iops,i=0; i < rtems_libio_number_iops; iop++, i++){ 200c0d8: 80 a0 60 00 cmp %g1, 0 200c0dc: 02 80 00 0f be 200c118 <== NEVER TAKEN 200c0e0: c4 00 a3 84 ld [ %g2 + 0x384 ], %g2 200c0e4: 86 10 20 00 clr %g3 if ((iop->flags & LIBIO_FLAGS_OPEN) != 0) { 200c0e8: c8 00 a0 18 ld [ %g2 + 0x18 ], %g4 200c0ec: 80 89 21 00 btst 0x100, %g4 200c0f0: 02 80 00 06 be 200c108 200c0f4: 86 00 e0 01 inc %g3 /* * Check if this node is under the file system that we * are trying to dismount. */ if ( iop->pathinfo.node_access == node_access ) { 200c0f8: c8 00 a0 1c ld [ %g2 + 0x1c ], %g4 200c0fc: 80 a1 00 18 cmp %g4, %i0 200c100: 02 80 00 0b be 200c12c 200c104: d0 07 63 8c ld [ %i5 + 0x38c ], %o0 /* * Look for any active file descriptor entry. */ for (iop=rtems_libio_iops,i=0; i < rtems_libio_number_iops; iop++, i++){ 200c108: 80 a0 c0 01 cmp %g3, %g1 200c10c: 12 bf ff f7 bne 200c0e8 200c110: 84 00 a0 40 add %g2, 0x40, %g2 int rtems_libio_is_file_open( void *node_access ) { rtems_libio_t *iop; int result=0; 200c114: b8 10 20 00 clr %i4 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 200c118: d0 07 63 8c ld [ %i5 + 0x38c ], %o0 200c11c: 7f ff ea 41 call 2006a20 200c120: b0 10 00 1c mov %i4, %i0 } rtems_libio_unlock(); return result; } 200c124: 81 c7 e0 08 ret 200c128: 81 e8 00 00 restore 200c12c: 7f ff ea 3d call 2006a20 200c130: b8 10 20 01 mov 1, %i4 200c134: 81 c7 e0 08 ret 200c138: 91 e8 00 1c restore %g0, %i4, %o0 =============================================================================== 0200c024 : */ int rtems_libio_is_open_files_in_fs( rtems_filesystem_mount_table_entry_t * fs_mt_entry ) { 200c024: 9d e3 bf a0 save %sp, -96, %sp 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 ); 200c028: 3b 00 80 75 sethi %hi(0x201d400), %i5 200c02c: d0 07 63 8c ld [ %i5 + 0x38c ], %o0 ! 201d78c 200c030: 92 10 20 00 clr %o1 200c034: 7f ff ea 31 call 20068f8 200c038: 94 10 20 00 clr %o2 /* * Look for any active file descriptor entry. */ for (iop=rtems_libio_iops,i=0; i < rtems_libio_number_iops; iop++, i++){ 200c03c: 03 00 80 73 sethi %hi(0x201cc00), %g1 200c040: c2 00 61 0c ld [ %g1 + 0x10c ], %g1 ! 201cd0c 200c044: 05 00 80 75 sethi %hi(0x201d400), %g2 int rtems_libio_is_open_files_in_fs( rtems_filesystem_mount_table_entry_t * fs_mt_entry ) { rtems_libio_t *iop; int result = 0; 200c048: b8 10 20 00 clr %i4 /* * Look for any active file descriptor entry. */ for (iop=rtems_libio_iops,i=0; i < rtems_libio_number_iops; iop++, i++){ 200c04c: 80 a0 60 00 cmp %g1, 0 200c050: 02 80 00 0f be 200c08c <== NEVER TAKEN 200c054: c4 00 a3 84 ld [ %g2 + 0x384 ], %g2 200c058: 86 10 20 00 clr %g3 if ((iop->flags & LIBIO_FLAGS_OPEN) != 0) { 200c05c: c8 00 a0 18 ld [ %g2 + 0x18 ], %g4 200c060: 80 89 21 00 btst 0x100, %g4 200c064: 02 80 00 06 be 200c07c 200c068: 86 00 e0 01 inc %g3 /* * Check if this node is under the file system that we * are trying to dismount. */ if ( iop->pathinfo.mt_entry == fs_mt_entry ) { 200c06c: c8 00 a0 2c ld [ %g2 + 0x2c ], %g4 200c070: 80 a1 00 18 cmp %g4, %i0 200c074: 02 80 00 0b be 200c0a0 200c078: d0 07 63 8c ld [ %i5 + 0x38c ], %o0 /* * Look for any active file descriptor entry. */ for (iop=rtems_libio_iops,i=0; i < rtems_libio_number_iops; iop++, i++){ 200c07c: 80 a0 c0 01 cmp %g3, %g1 200c080: 12 bf ff f7 bne 200c05c 200c084: 84 00 a0 40 add %g2, 0x40, %g2 int rtems_libio_is_open_files_in_fs( rtems_filesystem_mount_table_entry_t * fs_mt_entry ) { rtems_libio_t *iop; int result = 0; 200c088: b8 10 20 00 clr %i4 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 200c08c: d0 07 63 8c ld [ %i5 + 0x38c ], %o0 200c090: 7f ff ea 64 call 2006a20 200c094: b0 10 00 1c mov %i4, %i0 } rtems_libio_unlock(); return result; } 200c098: 81 c7 e0 08 ret 200c09c: 81 e8 00 00 restore 200c0a0: 7f ff ea 60 call 2006a20 200c0a4: b8 10 20 01 mov 1, %i4 200c0a8: 81 c7 e0 08 ret 200c0ac: 91 e8 00 1c restore %g0, %i4, %o0 =============================================================================== 02003fc4 : } } rtems_status_code rtems_libio_set_private_env(void) { 2003fc4: 9d e3 bf 78 save %sp, -136, %sp rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_id task_id = rtems_task_self(); 2003fc8: 40 00 0c 2e call 2007080 2003fcc: 3b 00 80 55 sethi %hi(0x2015400), %i5 2003fd0: b8 10 00 08 mov %o0, %i4 rtems_filesystem_location_info_t root_loc; rtems_filesystem_location_info_t current_loc; rtems_user_env_t *new_env = NULL; int rv = 0; rv = rtems_filesystem_evaluate_path("/", 1, 0, &root_loc, 0); 2003fd4: 92 10 20 01 mov 1, %o1 2003fd8: 90 17 63 20 or %i5, 0x320, %o0 2003fdc: 94 10 20 00 clr %o2 2003fe0: 96 07 bf d8 add %fp, -40, %o3 2003fe4: 98 10 20 00 clr %o4 2003fe8: 7f ff fb 3e call 2002ce0 2003fec: b0 10 20 1a mov 0x1a, %i0 if (rv != 0) 2003ff0: 80 a2 20 00 cmp %o0, 0 2003ff4: 12 80 00 43 bne 2004100 <== NEVER TAKEN 2003ff8: 90 17 63 20 or %i5, 0x320, %o0 goto error_0; rv = rtems_filesystem_evaluate_path("/", 1, 0, ¤t_loc, 0); 2003ffc: 92 10 20 01 mov 1, %o1 2004000: 94 10 20 00 clr %o2 2004004: 96 07 bf ec add %fp, -20, %o3 2004008: 7f ff fb 36 call 2002ce0 200400c: 98 10 20 00 clr %o4 if (rv != 0) 2004010: 80 a2 20 00 cmp %o0, 0 2004014: 12 80 00 38 bne 20040f4 <== NEVER TAKEN 2004018: 35 00 80 59 sethi %hi(0x2016400), %i2 * Bharath: I'm not sure if the check can be reduced to * if( rtems_current_user_env->task_id != task_id ) { */ if ( rtems_current_user_env == &rtems_global_user_env 200401c: fa 06 a0 a8 ld [ %i2 + 0xa8 ], %i5 ! 20164a8 /* * Bharath: I'm not sure if the check can be reduced to * if( rtems_current_user_env->task_id != task_id ) { */ if ( 2004020: 37 00 80 5b sethi %hi(0x2016c00), %i3 2004024: b6 16 e2 64 or %i3, 0x264, %i3 ! 2016e64 2004028: 80 a7 40 1b cmp %i5, %i3 200402c: 02 80 00 06 be 2004044 2004030: 01 00 00 00 nop rtems_current_user_env == &rtems_global_user_env || rtems_current_user_env->task_id != task_id 2004034: c2 07 40 00 ld [ %i5 ], %g1 2004038: 80 a0 40 1c cmp %g1, %i4 200403c: 02 80 00 10 be 200407c 2004040: 90 10 00 1d mov %i5, %o0 ) { new_env = malloc(sizeof(rtems_user_env_t)); 2004044: 7f ff fc fb call 2003430 2004048: 90 10 20 48 mov 0x48, %o0 if (new_env == NULL) 200404c: ba 92 20 00 orcc %o0, 0, %i5 2004050: 02 80 00 27 be 20040ec 2004054: 90 10 20 00 clr %o0 #ifdef HAVE_USERENV_REFCNT new_env->refcnt = 1; #endif sc = rtems_task_variable_add( 2004058: 92 16 a0 a8 or %i2, 0xa8, %o1 200405c: 15 00 80 0f sethi %hi(0x2003c00), %o2 2004060: 40 00 0c 27 call 20070fc 2004064: 94 12 a3 8c or %o2, 0x38c, %o2 ! 2003f8c RTEMS_SELF, (void*)&rtems_current_user_env, (void(*)(void *))free_user_env ); if (sc != RTEMS_SUCCESSFUL) 2004068: 80 a2 20 00 cmp %o0, 0 200406c: 12 80 00 1e bne 20040e4 2004070: 03 00 80 59 sethi %hi(0x2016400), %g1 goto error_3; rtems_current_user_env = new_env; 2004074: fa 20 60 a8 st %i5, [ %g1 + 0xa8 ] ! 20164a8 } /* Inherit the global values */ *rtems_current_user_env = rtems_global_user_env; 2004078: 90 10 00 1d mov %i5, %o0 200407c: 92 10 00 1b mov %i3, %o1 2004080: 40 00 30 4b call 20101ac 2004084: 94 10 20 48 mov 0x48, %o2 * Clone the pathlocs. In contrast to most other code we must _not_ free the * original locs because what we are trying to do here is forking off clones. * The reason is a pathloc can be allocated by the file system and needs to * be freed when deleting the environment. */ rtems_filesystem_root = root_loc; 2004088: c2 07 bf d8 ld [ %fp + -40 ], %g1 } /* Inherit the global values */ *rtems_current_user_env = rtems_global_user_env; rtems_current_user_env->task_id = task_id; 200408c: f8 27 40 00 st %i4, [ %i5 ] * Clone the pathlocs. In contrast to most other code we must _not_ free the * original locs because what we are trying to do here is forking off clones. * The reason is a pathloc can be allocated by the file system and needs to * be freed when deleting the environment. */ rtems_filesystem_root = root_loc; 2004090: c2 27 60 18 st %g1, [ %i5 + 0x18 ] 2004094: c2 07 bf dc ld [ %fp + -36 ], %g1 2004098: c2 27 60 1c st %g1, [ %i5 + 0x1c ] 200409c: c2 07 bf e0 ld [ %fp + -32 ], %g1 20040a0: c2 27 60 20 st %g1, [ %i5 + 0x20 ] 20040a4: c2 07 bf e4 ld [ %fp + -28 ], %g1 20040a8: c2 27 60 24 st %g1, [ %i5 + 0x24 ] 20040ac: c2 07 bf e8 ld [ %fp + -24 ], %g1 20040b0: c2 27 60 28 st %g1, [ %i5 + 0x28 ] rtems_filesystem_current = current_loc; 20040b4: c2 07 bf ec ld [ %fp + -20 ], %g1 20040b8: c2 27 60 04 st %g1, [ %i5 + 4 ] 20040bc: c2 07 bf f0 ld [ %fp + -16 ], %g1 20040c0: c2 27 60 08 st %g1, [ %i5 + 8 ] 20040c4: c2 07 bf f4 ld [ %fp + -12 ], %g1 20040c8: c2 27 60 0c st %g1, [ %i5 + 0xc ] 20040cc: c2 07 bf f8 ld [ %fp + -8 ], %g1 20040d0: c2 27 60 10 st %g1, [ %i5 + 0x10 ] 20040d4: c2 07 bf fc ld [ %fp + -4 ], %g1 20040d8: c2 27 60 14 st %g1, [ %i5 + 0x14 ] return RTEMS_SUCCESSFUL; 20040dc: 81 c7 e0 08 ret 20040e0: 91 e8 20 00 restore %g0, 0, %o0 error_3: free(new_env); 20040e4: 7f ff fb 40 call 2002de4 20040e8: 90 10 00 1d mov %i5, %o0 error_2: rtems_filesystem_freenode(¤t_loc); 20040ec: 7f ff fb 37 call 2002dc8 20040f0: 90 07 bf ec add %fp, -20, %o0 error_1: rtems_filesystem_freenode(&root_loc); 20040f4: 90 07 bf d8 add %fp, -40, %o0 20040f8: 7f ff fb 34 call 2002dc8 20040fc: b0 10 20 1a mov 0x1a, %i0 error_0: return RTEMS_NO_MEMORY; } 2004100: 81 c7 e0 08 ret 2004104: 81 e8 00 00 restore =============================================================================== 02004108 : * b) mutex access to rtems_filesystem_current, rtems_filesytem_root * while changing any of those (chdir(), chroot()). */ rtems_status_code rtems_libio_share_private_env(rtems_id task_id) { 2004108: 9d e3 bf 98 save %sp, -104, %sp rtems_id current_task_id; /* * get current task id */ current_task_id = rtems_task_self(); 200410c: 40 00 0b dd call 2007080 2004110: b6 10 20 00 clr %i3 /* * If this was an attempt to share the task with self, * if somebody wanted to do it... Lets tell them, its shared */ if( task_id == current_task_id ) 2004114: 80 a6 00 08 cmp %i0, %o0 2004118: 02 80 00 10 be 2004158 <== NEVER TAKEN 200411c: ba 10 00 08 mov %o0, %i5 return RTEMS_SUCCESSFUL; /* * Try to get the requested user environment */ sc = rtems_task_variable_get( 2004120: 90 10 00 18 mov %i0, %o0 2004124: 39 00 80 59 sethi %hi(0x2016400), %i4 2004128: 94 07 bf fc add %fp, -4, %o2 200412c: 40 00 0c 25 call 20071c0 2004130: 92 17 20 a8 or %i4, 0xa8, %o1 (void*)&shared_user_env ); /* * If it was not successful, return the error code */ if (sc != RTEMS_SUCCESSFUL) 2004134: b6 92 20 00 orcc %o0, 0, %i3 2004138: 12 80 00 09 bne 200415c 200413c: b0 10 00 1b mov %i3, %i0 * If we have a current environment in place, we need to * free it, since we will be sharing the variable with the * shared_user_env */ if (rtems_current_user_env->task_id==current_task_id) { 2004140: d0 07 20 a8 ld [ %i4 + 0xa8 ], %o0 2004144: c2 02 00 00 ld [ %o0 ], %g1 2004148: 80 a0 40 1d cmp %g1, %i5 200414c: 02 80 00 06 be 2004164 2004150: c2 07 bf fc ld [ %fp + -4 ], %g1 rtems_user_env_t *tmp = rtems_current_user_env; free_user_env( tmp ); } /* the current_user_env is the same pointer that remote env */ rtems_current_user_env = shared_user_env; 2004154: c2 27 20 a8 st %g1, [ %i4 + 0xa8 ] #ifdef HAVE_USERENV_REFCNT rtems_current_user_env->refcnt++; #endif return RTEMS_SUCCESSFUL; } 2004158: b0 10 00 1b mov %i3, %i0 200415c: 81 c7 e0 08 ret 2004160: 81 e8 00 00 restore * shared_user_env */ if (rtems_current_user_env->task_id==current_task_id) { rtems_user_env_t *tmp = rtems_current_user_env; free_user_env( tmp ); 2004164: 7f ff ff 8a call 2003f8c 2004168: b0 10 00 1b mov %i3, %i0 } /* the current_user_env is the same pointer that remote env */ rtems_current_user_env = shared_user_env; 200416c: c2 07 bf fc ld [ %fp + -4 ], %g1 2004170: c2 27 20 a8 st %g1, [ %i4 + 0xa8 ] 2004174: 81 c7 e0 08 ret 2004178: 81 e8 00 00 restore =============================================================================== 0200bed0 : uint32_t flags ) { uint32_t fcntl_flags = 0; if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) { 200bed0: 84 0a 20 06 and %o0, 6, %g2 200bed4: 80 a0 a0 06 cmp %g2, 6 200bed8: 02 80 00 05 be 200beec 200bedc: 82 10 20 02 mov 2, %g1 fcntl_flags |= O_RDWR; } else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) { 200bee0: 80 8a 20 02 btst 2, %o0 200bee4: 02 80 00 0e be 200bf1c <== NEVER TAKEN 200bee8: 82 10 20 00 clr %g1 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 ) { 200beec: 80 8a 20 01 btst 1, %o0 200bef0: 02 80 00 04 be 200bf00 200bef4: 80 8a 22 00 btst 0x200, %o0 fcntl_flags |= O_NONBLOCK; 200bef8: 05 00 00 10 sethi %hi(0x4000), %g2 200befc: 82 10 40 02 or %g1, %g2, %g1 } if ( (flags & LIBIO_FLAGS_APPEND) == LIBIO_FLAGS_APPEND ) { 200bf00: 32 80 00 02 bne,a 200bf08 200bf04: 82 10 60 08 or %g1, 8, %g1 fcntl_flags |= O_APPEND; } if ( (flags & LIBIO_FLAGS_CREATE) == LIBIO_FLAGS_CREATE ) { 200bf08: 80 8a 24 00 btst 0x400, %o0 200bf0c: 32 80 00 02 bne,a 200bf14 200bf10: 82 10 62 00 or %g1, 0x200, %g1 fcntl_flags |= O_CREAT; } return fcntl_flags; } 200bf14: 81 c3 e0 08 retl 200bf18: 90 10 00 01 mov %g1, %o0 if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) { fcntl_flags |= O_RDWR; } else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) { fcntl_flags |= O_RDONLY; } else if ( (flags & LIBIO_FLAGS_WRITE) == LIBIO_FLAGS_WRITE) { 200bf1c: 82 0a 20 04 and %o0, 4, %g1 <== NOT EXECUTED ) { uint32_t fcntl_flags = 0; if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) { fcntl_flags |= O_RDWR; 200bf20: 80 a0 00 01 cmp %g0, %g1 <== NOT EXECUTED 200bf24: 10 bf ff f2 b 200beec <== NOT EXECUTED 200bf28: 82 40 20 00 addx %g0, 0, %g1 <== NOT EXECUTED =============================================================================== 020068f8 : * size and thus we skip updating the statistics. */ static void rtems_malloc_statistics_at_free( void *pointer ) { 20068f8: 9d e3 bf 98 save %sp, -104, %sp uintptr_t size; if (_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, pointer, &size) ) { 20068fc: 03 00 80 8c sethi %hi(0x2023000), %g1 2006900: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 ! 2023034 2006904: 92 10 00 18 mov %i0, %o1 2006908: 40 00 19 b8 call 200cfe8 <_Protected_heap_Get_block_size> 200690c: 94 07 bf fc add %fp, -4, %o2 2006910: 80 8a 20 ff btst 0xff, %o0 2006914: 02 80 00 08 be 2006934 <== NEVER TAKEN 2006918: c4 07 bf fc ld [ %fp + -4 ], %g2 MSBUMP(lifetime_freed, size); 200691c: 03 00 80 90 sethi %hi(0x2024000), %g1 2006920: 82 10 63 e8 or %g1, 0x3e8, %g1 ! 20243e8 2006924: d8 18 60 28 ldd [ %g1 + 0x28 ], %o4 2006928: 86 83 40 02 addcc %o5, %g2, %g3 200692c: 84 43 20 00 addx %o4, 0, %g2 2006930: c4 38 60 28 std %g2, [ %g1 + 0x28 ] 2006934: 81 c7 e0 08 ret 2006938: 81 e8 00 00 restore =============================================================================== 0200693c : } static void rtems_malloc_statistics_at_malloc( void *pointer ) { 200693c: 9d e3 bf 98 save %sp, -104, %sp uintptr_t actual_size = 0; uint32_t current_depth; rtems_malloc_statistics_t *s = &rtems_malloc_statistics; if ( !pointer ) 2006940: 80 a6 20 00 cmp %i0, 0 2006944: 02 80 00 14 be 2006994 <== NEVER TAKEN 2006948: c0 27 bf fc clr [ %fp + -4 ] return; _Protected_heap_Get_block_size(RTEMS_Malloc_Heap, pointer, &actual_size); 200694c: 03 00 80 8c sethi %hi(0x2023000), %g1 2006950: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 ! 2023034 2006954: 92 10 00 18 mov %i0, %o1 2006958: 40 00 19 a4 call 200cfe8 <_Protected_heap_Get_block_size> 200695c: 94 07 bf fc add %fp, -4, %o2 MSBUMP(lifetime_allocated, actual_size); 2006960: c4 07 bf fc ld [ %fp + -4 ], %g2 2006964: 03 00 80 90 sethi %hi(0x2024000), %g1 2006968: 82 10 63 e8 or %g1, 0x3e8, %g1 ! 20243e8 200696c: d8 18 60 20 ldd [ %g1 + 0x20 ], %o4 current_depth = (uint32_t) (s->lifetime_allocated - s->lifetime_freed); 2006970: f0 00 60 2c ld [ %g1 + 0x2c ], %i0 if (current_depth > s->max_depth) 2006974: c8 00 60 18 ld [ %g1 + 0x18 ], %g4 if ( !pointer ) return; _Protected_heap_Get_block_size(RTEMS_Malloc_Heap, pointer, &actual_size); MSBUMP(lifetime_allocated, actual_size); 2006978: 86 83 40 02 addcc %o5, %g2, %g3 200697c: 84 43 20 00 addx %o4, 0, %g2 2006980: c4 38 60 20 std %g2, [ %g1 + 0x20 ] current_depth = (uint32_t) (s->lifetime_allocated - s->lifetime_freed); 2006984: 84 20 c0 18 sub %g3, %i0, %g2 if (current_depth > s->max_depth) 2006988: 80 a0 80 04 cmp %g2, %g4 200698c: 38 80 00 02 bgu,a 2006994 2006990: c4 20 60 18 st %g2, [ %g1 + 0x18 ] 2006994: 81 c7 e0 08 ret 2006998: 81 e8 00 00 restore =============================================================================== 0200fc80 : int rtems_memalign( void **pointer, size_t alignment, size_t size ) { 200fc80: 9d e3 bf a0 save %sp, -96, %sp 200fc84: ba 10 00 18 mov %i0, %i5 void *return_this; /* * Parameter error checks */ if ( !pointer ) 200fc88: 80 a7 60 00 cmp %i5, 0 200fc8c: 02 80 00 22 be 200fd14 200fc90: b0 10 20 16 mov 0x16, %i0 *pointer = NULL; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 200fc94: 03 00 80 6b sethi %hi(0x201ac00), %g1 200fc98: c2 00 61 5c ld [ %g1 + 0x15c ], %g1 ! 201ad5c <_System_state_Current> 200fc9c: 80 a0 60 03 cmp %g1, 3 200fca0: 02 80 00 18 be 200fd00 <== ALWAYS TAKEN 200fca4: c0 27 40 00 clr [ %i5 ] return EINVAL; /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); 200fca8: 7f ff cf e9 call 2003c4c 200fcac: b0 10 20 0c mov 0xc, %i0 Heap_Control *heap, uintptr_t size, uintptr_t alignment ) { return 200fcb0: 03 00 80 67 sethi %hi(0x2019c00), %g1 200fcb4: d0 00 62 d8 ld [ %g1 + 0x2d8 ], %o0 ! 2019ed8 200fcb8: 94 10 00 19 mov %i1, %o2 200fcbc: 92 10 00 1a mov %i2, %o1 200fcc0: 7f ff e5 e3 call 200944c <_Protected_heap_Allocate_aligned_with_boundary> 200fcc4: 96 10 20 00 clr %o3 return_this = _Protected_heap_Allocate_aligned( RTEMS_Malloc_Heap, size, alignment ); if ( !return_this ) 200fcc8: 80 a2 20 00 cmp %o0, 0 200fccc: 02 80 00 12 be 200fd14 200fcd0: b2 10 00 08 mov %o0, %i1 return ENOMEM; /* * If configured, update the more involved statistics */ if ( rtems_malloc_statistics_helpers ) 200fcd4: 03 00 80 69 sethi %hi(0x201a400), %g1 200fcd8: c2 00 63 04 ld [ %g1 + 0x304 ], %g1 ! 201a704 200fcdc: 80 a0 60 00 cmp %g1, 0 200fce0: 22 80 00 06 be,a 200fcf8 200fce4: f2 27 40 00 st %i1, [ %i5 ] (*rtems_malloc_statistics_helpers->at_malloc)(pointer); 200fce8: c2 00 60 04 ld [ %g1 + 4 ], %g1 200fcec: 9f c0 40 00 call %g1 200fcf0: 90 10 00 1d mov %i5, %o0 *pointer = return_this; 200fcf4: f2 27 40 00 st %i1, [ %i5 ] return 0; } 200fcf8: 81 c7 e0 08 ret 200fcfc: 91 e8 20 00 restore %g0, 0, %o0 /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && !malloc_is_system_state_OK() ) 200fd00: 7f ff cf c1 call 2003c04 200fd04: 01 00 00 00 nop *pointer = NULL; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 200fd08: 80 8a 20 ff btst 0xff, %o0 200fd0c: 12 bf ff e7 bne 200fca8 <== ALWAYS TAKEN 200fd10: 01 00 00 00 nop if ( rtems_malloc_statistics_helpers ) (*rtems_malloc_statistics_helpers->at_malloc)(pointer); *pointer = return_this; return 0; } 200fd14: 81 c7 e0 08 ret 200fd18: 81 e8 00 00 restore =============================================================================== 0200e420 : return (retval); } int rtems_mkdir(const char *path, mode_t mode) { 200e420: 9d e3 bf 58 save %sp, -168, %sp int success = 0; char *dup_path = strdup(path); 200e424: 90 10 00 18 mov %i0, %o0 200e428: 40 00 0e f4 call 2011ff8 200e42c: b0 10 3f ff mov -1, %i0 if (dup_path != NULL) { 200e430: 80 a2 20 00 cmp %o0, 0 200e434: 02 80 00 2e be 200e4ec <== NEVER TAKEN 200e438: ba 10 00 08 mov %o0, %i5 char *p; p = path; oumask = 0; retval = 1; if (p[0] == '/') /* Skip leading '/'. */ 200e43c: c2 0a 00 00 ldub [ %o0 ], %g1 200e440: 83 28 60 18 sll %g1, 0x18, %g1 200e444: 85 38 60 18 sra %g1, 0x18, %g2 200e448: 80 a0 a0 2f cmp %g2, 0x2f 200e44c: 02 80 00 58 be 200e5ac 200e450: b8 10 00 08 mov %o0, %i4 ++p; for (first = 1, last = 0; !last ; ++p) { if (p[0] == '\0') 200e454: 83 38 60 18 sra %g1, 0x18, %g1 char *p; p = path; oumask = 0; retval = 1; if (p[0] == '/') /* Skip leading '/'. */ 200e458: b4 10 20 00 clr %i2 200e45c: 84 10 20 01 mov 1, %g2 retval = 0; break; } } if (!last) *p = '/'; 200e460: b0 10 20 2f mov 0x2f, %i0 if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) { if (errno == EEXIST || errno == EISDIR) { if (stat(path, &sb) < 0) { retval = 0; break; } else if (!S_ISDIR(sb.st_mode)) { 200e464: 23 00 00 3c sethi %hi(0xf000), %l1 oumask = 0; retval = 1; if (p[0] == '/') /* Skip leading '/'. */ ++p; for (first = 1, last = 0; !last ; ++p) { if (p[0] == '\0') 200e468: 80 a0 60 00 cmp %g1, 0 200e46c: 02 80 00 0b be 200e498 <== NEVER TAKEN 200e470: 21 00 00 10 sethi %hi(0x4000), %l0 last = 1; else if (p[0] != '/') 200e474: 80 a0 60 2f cmp %g1, 0x2f 200e478: 22 80 00 49 be,a 200e59c 200e47c: c2 4f 20 01 ldsb [ %i4 + 1 ], %g1 retval = 0; break; } } if (!last) *p = '/'; 200e480: c2 0f 20 01 ldub [ %i4 + 1 ], %g1 200e484: 83 28 60 18 sll %g1, 0x18, %g1 oumask = 0; retval = 1; if (p[0] == '/') /* Skip leading '/'. */ ++p; for (first = 1, last = 0; !last ; ++p) { if (p[0] == '\0') 200e488: 83 38 60 18 sra %g1, 0x18, %g1 200e48c: 80 a0 60 00 cmp %g1, 0 200e490: 12 bf ff f9 bne 200e474 200e494: b8 07 20 01 inc %i4 last = 1; else if (p[0] != '/') continue; *p = '\0'; 200e498: c0 2f 00 00 clrb [ %i4 ] 200e49c: b6 10 20 01 mov 1, %i3 if (!last && p[1] == '\0') last = 1; if (first) { 200e4a0: 80 a0 a0 00 cmp %g2, 0 200e4a4: 12 80 00 37 bne 200e580 200e4a8: 01 00 00 00 nop oumask = umask(0); numask = oumask & ~(S_IWUSR | S_IXUSR); (void)umask(numask); first = 0; } if (last) 200e4ac: 80 a6 e0 00 cmp %i3, 0 200e4b0: 12 80 00 13 bne 200e4fc 200e4b4: 92 10 21 ff mov 0x1ff, %o1 (void)umask(oumask); if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) { 200e4b8: 7f ff d8 c6 call 20047d0 200e4bc: 90 10 00 1d mov %i5, %o0 200e4c0: 80 a2 20 00 cmp %o0, 0 200e4c4: 06 80 00 16 bl 200e51c 200e4c8: 80 a6 e0 00 cmp %i3, 0 } else { retval = 0; break; } } if (!last) 200e4cc: 22 80 00 0a be,a 200e4f4 200e4d0: f0 2f 00 00 stb %i0, [ %i4 ] 200e4d4: b8 10 20 01 mov 1, %i4 int success = 0; char *dup_path = strdup(path); if (dup_path != NULL) { success = build(dup_path, mode); free(dup_path); 200e4d8: 7f ff d6 da call 2004040 200e4dc: 90 10 00 1d mov %i5, %o0 } return success != 0 ? 0 : -1; 200e4e0: 80 a7 20 00 cmp %i4, 0 200e4e4: 02 80 00 48 be 200e604 <== NEVER TAKEN 200e4e8: b0 10 20 00 clr %i0 } 200e4ec: 81 c7 e0 08 ret 200e4f0: 81 e8 00 00 restore retval = 0; break; } } if (!last) *p = '/'; 200e4f4: 10 bf ff e3 b 200e480 200e4f8: 84 10 20 00 clr %g2 numask = oumask & ~(S_IWUSR | S_IXUSR); (void)umask(numask); first = 0; } if (last) (void)umask(oumask); 200e4fc: 40 00 00 7d call 200e6f0 200e500: 90 10 00 1a mov %i2, %o0 if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) { 200e504: 92 10 00 19 mov %i1, %o1 200e508: 7f ff d8 b2 call 20047d0 200e50c: 90 10 00 1d mov %i5, %o0 200e510: 80 a2 20 00 cmp %o0, 0 200e514: 16 bf ff ee bge 200e4cc 200e518: 80 a6 e0 00 cmp %i3, 0 if (errno == EEXIST || errno == EISDIR) { 200e51c: 40 00 0b 22 call 20111a4 <__errno> 200e520: 01 00 00 00 nop 200e524: c2 02 00 00 ld [ %o0 ], %g1 200e528: 80 a0 60 11 cmp %g1, 0x11 200e52c: 02 80 00 08 be 200e54c 200e530: 90 10 00 1d mov %i5, %o0 200e534: 40 00 0b 1c call 20111a4 <__errno> 200e538: 01 00 00 00 nop 200e53c: c2 02 00 00 ld [ %o0 ], %g1 200e540: 80 a0 60 15 cmp %g1, 0x15 200e544: 12 80 00 32 bne 200e60c <== ALWAYS TAKEN 200e548: 90 10 00 1d mov %i5, %o0 if (stat(path, &sb) < 0) { 200e54c: 40 00 00 34 call 200e61c 200e550: 92 07 bf b8 add %fp, -72, %o1 200e554: 80 a2 20 00 cmp %o0, 0 200e558: 06 80 00 2d bl 200e60c <== NEVER TAKEN 200e55c: c2 07 bf c4 ld [ %fp + -60 ], %g1 retval = 0; break; } else if (!S_ISDIR(sb.st_mode)) { 200e560: 82 08 40 11 and %g1, %l1, %g1 200e564: 80 a0 40 10 cmp %g1, %l0 200e568: 12 80 00 15 bne 200e5bc 200e56c: 80 a6 e0 00 cmp %i3, 0 else errno = ENOTDIR; retval = 0; break; } if (last) 200e570: 22 bf ff e1 be,a 200e4f4 200e574: f0 2f 00 00 stb %i0, [ %i4 ] retval = 2; 200e578: 10 bf ff d8 b 200e4d8 200e57c: b8 10 20 02 mov 2, %i4 * mkdir [-m mode] dir * * We change the user's umask and then restore it, * instead of doing chmod's. */ oumask = umask(0); 200e580: 40 00 00 5c call 200e6f0 200e584: 90 10 20 00 clr %o0 200e588: b4 10 00 08 mov %o0, %i2 numask = oumask & ~(S_IWUSR | S_IXUSR); (void)umask(numask); 200e58c: 40 00 00 59 call 200e6f0 200e590: 90 0a 3f 3f and %o0, -193, %o0 first = 0; } if (last) 200e594: 10 bf ff c7 b 200e4b0 200e598: 80 a6 e0 00 cmp %i3, 0 for (first = 1, last = 0; !last ; ++p) { if (p[0] == '\0') last = 1; else if (p[0] != '/') continue; *p = '\0'; 200e59c: c0 2f 00 00 clrb [ %i4 ] if (!last && p[1] == '\0') 200e5a0: 80 a0 00 01 cmp %g0, %g1 200e5a4: 10 bf ff bf b 200e4a0 200e5a8: b6 60 3f ff subx %g0, -1, %i3 p = path; oumask = 0; retval = 1; if (p[0] == '/') /* Skip leading '/'. */ ++p; 200e5ac: c2 0a 20 01 ldub [ %o0 + 1 ], %g1 200e5b0: b8 02 20 01 add %o0, 1, %i4 200e5b4: 10 bf ff a8 b 200e454 200e5b8: 83 28 60 18 sll %g1, 0x18, %g1 if (errno == EEXIST || errno == EISDIR) { if (stat(path, &sb) < 0) { retval = 0; break; } else if (!S_ISDIR(sb.st_mode)) { if (last) 200e5bc: 02 80 00 0a be 200e5e4 200e5c0: 01 00 00 00 nop errno = EEXIST; 200e5c4: 40 00 0a f8 call 20111a4 <__errno> 200e5c8: b0 10 3f ff mov -1, %i0 ! ffffffff 200e5cc: 82 10 20 11 mov 0x11, %g1 200e5d0: c2 22 00 00 st %g1, [ %o0 ] int success = 0; char *dup_path = strdup(path); if (dup_path != NULL) { success = build(dup_path, mode); free(dup_path); 200e5d4: 7f ff d6 9b call 2004040 200e5d8: 90 10 00 1d mov %i5, %o0 200e5dc: 81 c7 e0 08 ret 200e5e0: 81 e8 00 00 restore break; } else if (!S_ISDIR(sb.st_mode)) { if (last) errno = EEXIST; else errno = ENOTDIR; 200e5e4: 40 00 0a f0 call 20111a4 <__errno> 200e5e8: 01 00 00 00 nop 200e5ec: 82 10 20 14 mov 0x14, %g1 ! 14 200e5f0: c2 22 00 00 st %g1, [ %o0 ] } if (!last) *p = '/'; } if (!first && !last) (void)umask(oumask); 200e5f4: 40 00 00 3f call 200e6f0 200e5f8: 90 10 00 1a mov %i2, %o0 int success = 0; char *dup_path = strdup(path); if (dup_path != NULL) { success = build(dup_path, mode); free(dup_path); 200e5fc: 7f ff d6 91 call 2004040 200e600: 90 10 00 1d mov %i5, %o0 } return success != 0 ? 0 : -1; } 200e604: 81 c7 e0 08 ret 200e608: 91 e8 3f ff restore %g0, -1, %o0 } } if (!last) *p = '/'; } if (!first && !last) 200e60c: 80 a6 e0 00 cmp %i3, 0 200e610: 02 bf ff f9 be 200e5f4 <== NEVER TAKEN 200e614: 01 00 00 00 nop 200e618: 30 bf ff f9 b,a 200e5fc =============================================================================== 0200815c : rtems_status_code rtems_object_get_class_information( int the_api, int the_class, rtems_object_api_class_information *info ) { 200815c: 9d e3 bf a0 save %sp, -96, %sp 2008160: 90 10 00 18 mov %i0, %o0 int i; /* * Validate parameters and look up information structure. */ if ( !info ) 2008164: 80 a6 a0 00 cmp %i2, 0 2008168: 02 80 00 21 be 20081ec 200816c: b0 10 20 09 mov 9, %i0 return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); 2008170: 93 2e 60 10 sll %i1, 0x10, %o1 if ( !obj_info ) return RTEMS_INVALID_NUMBER; 2008174: b0 10 20 0a mov 0xa, %i0 * Validate parameters and look up information structure. */ if ( !info ) return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); 2008178: 40 00 07 76 call 2009f50 <_Objects_Get_information> 200817c: 93 32 60 10 srl %o1, 0x10, %o1 if ( !obj_info ) 2008180: 80 a2 20 00 cmp %o0, 0 2008184: 02 80 00 1a be 20081ec 2008188: 01 00 00 00 nop /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; 200818c: c4 02 20 0c ld [ %o0 + 0xc ], %g2 info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; 2008190: c8 12 20 10 lduh [ %o0 + 0x10 ], %g4 return RTEMS_INVALID_NUMBER; /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; 2008194: c6 02 20 08 ld [ %o0 + 8 ], %g3 info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; 2008198: c2 0a 20 12 ldub [ %o0 + 0x12 ], %g1 /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; 200819c: c4 26 a0 04 st %g2, [ %i2 + 4 ] return RTEMS_INVALID_NUMBER; /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; 20081a0: c6 26 80 00 st %g3, [ %i2 ] info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; 20081a4: c2 2e a0 0c stb %g1, [ %i2 + 0xc ] info->maximum = obj_info->maximum; 20081a8: c8 26 a0 08 st %g4, [ %i2 + 8 ] for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 20081ac: 80 a1 20 00 cmp %g4, 0 20081b0: 02 80 00 0d be 20081e4 <== NEVER TAKEN 20081b4: 84 10 20 00 clr %g2 20081b8: de 02 20 1c ld [ %o0 + 0x1c ], %o7 20081bc: 86 10 20 01 mov 1, %g3 20081c0: 82 10 20 01 mov 1, %g1 if ( !obj_info->local_table[i] ) 20081c4: 87 28 e0 02 sll %g3, 2, %g3 20081c8: c6 03 c0 03 ld [ %o7 + %g3 ], %g3 info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 20081cc: 82 00 60 01 inc %g1 if ( !obj_info->local_table[i] ) unallocated++; 20081d0: 80 a0 00 03 cmp %g0, %g3 20081d4: 84 60 bf ff subx %g2, -1, %g2 info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 20081d8: 80 a1 00 01 cmp %g4, %g1 20081dc: 1a bf ff fa bcc 20081c4 20081e0: 86 10 00 01 mov %g1, %g3 if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; 20081e4: c4 26 a0 10 st %g2, [ %i2 + 0x10 ] return RTEMS_SUCCESSFUL; 20081e8: b0 10 20 00 clr %i0 } 20081ec: 81 c7 e0 08 ret 20081f0: 81 e8 00 00 restore =============================================================================== 02013db8 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 2013db8: 9d e3 bf a0 save %sp, -96, %sp register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 2013dbc: 80 a6 20 00 cmp %i0, 0 2013dc0: 12 80 00 04 bne 2013dd0 2013dc4: 82 10 20 03 mov 3, %g1 ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 2013dc8: 81 c7 e0 08 ret 2013dcc: 91 e8 00 01 restore %g0, %g1, %o0 register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !starting_address ) 2013dd0: 80 a6 60 00 cmp %i1, 0 2013dd4: 02 bf ff fd be 2013dc8 2013dd8: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; if ( !id ) 2013ddc: 80 a7 60 00 cmp %i5, 0 2013de0: 02 bf ff fa be 2013dc8 <== NEVER TAKEN 2013de4: 80 a6 e0 00 cmp %i3, 0 return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 2013de8: 02 bf ff f8 be 2013dc8 2013dec: 82 10 20 08 mov 8, %g1 2013df0: 80 a6 a0 00 cmp %i2, 0 2013df4: 02 bf ff f5 be 2013dc8 2013df8: 80 a6 80 1b cmp %i2, %i3 2013dfc: 0a bf ff f3 bcs 2013dc8 2013e00: 80 8e e0 07 btst 7, %i3 2013e04: 12 bf ff f1 bne 2013dc8 2013e08: 80 8e 60 07 btst 7, %i1 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 2013e0c: 12 bf ff ef bne 2013dc8 2013e10: 82 10 20 09 mov 9, %g1 /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 2013e14: 03 00 80 f7 sethi %hi(0x203dc00), %g1 2013e18: c4 00 60 c0 ld [ %g1 + 0xc0 ], %g2 ! 203dcc0 <_Thread_Dispatch_disable_level> 2013e1c: 84 00 a0 01 inc %g2 2013e20: c4 20 60 c0 st %g2, [ %g1 + 0xc0 ] return _Thread_Dispatch_disable_level; 2013e24: c2 00 60 c0 ld [ %g1 + 0xc0 ], %g1 * 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 ); 2013e28: 23 00 80 f6 sethi %hi(0x203d800), %l1 2013e2c: 40 00 13 4e call 2018b64 <_Objects_Allocate> 2013e30: 90 14 62 d4 or %l1, 0x2d4, %o0 ! 203dad4 <_Partition_Information> _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 2013e34: a0 92 20 00 orcc %o0, 0, %l0 2013e38: 02 80 00 1a be 2013ea0 2013e3c: 92 10 00 1b mov %i3, %o1 #endif the_partition->starting_address = starting_address; the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; 2013e40: f8 24 20 1c st %i4, [ %l0 + 0x1c ] _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 2013e44: f2 24 20 10 st %i1, [ %l0 + 0x10 ] the_partition->length = length; 2013e48: f4 24 20 14 st %i2, [ %l0 + 0x14 ] the_partition->buffer_size = buffer_size; 2013e4c: f6 24 20 18 st %i3, [ %l0 + 0x18 ] the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; 2013e50: c0 24 20 20 clr [ %l0 + 0x20 ] _Chain_Initialize( &the_partition->Memory, starting_address, length / buffer_size, buffer_size ); 2013e54: 40 00 65 d3 call 202d5a0 <.udiv> 2013e58: 90 10 00 1a mov %i2, %o0 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, 2013e5c: 92 10 00 19 mov %i1, %o1 length / buffer_size, buffer_size ); 2013e60: 94 10 00 08 mov %o0, %o2 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, 2013e64: 96 10 00 1b mov %i3, %o3 2013e68: b8 04 20 24 add %l0, 0x24, %i4 2013e6c: 40 00 0c d9 call 20171d0 <_Chain_Initialize> 2013e70: 90 10 00 1c mov %i4, %o0 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 2013e74: c4 14 20 0a lduh [ %l0 + 0xa ], %g2 ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 2013e78: a2 14 62 d4 or %l1, 0x2d4, %l1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 2013e7c: c6 04 60 1c ld [ %l1 + 0x1c ], %g3 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 2013e80: c2 04 20 08 ld [ %l0 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 2013e84: 85 28 a0 02 sll %g2, 2, %g2 2013e88: e0 20 c0 02 st %l0, [ %g3 + %g2 ] information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 2013e8c: f0 24 20 0c st %i0, [ %l0 + 0xc ] name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 2013e90: 40 00 18 58 call 2019ff0 <_Thread_Enable_dispatch> 2013e94: c2 27 40 00 st %g1, [ %i5 ] return RTEMS_SUCCESSFUL; 2013e98: 10 bf ff cc b 2013dc8 2013e9c: 82 10 20 00 clr %g1 _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { _Thread_Enable_dispatch(); 2013ea0: 40 00 18 54 call 2019ff0 <_Thread_Enable_dispatch> 2013ea4: 01 00 00 00 nop return RTEMS_TOO_MANY; 2013ea8: 10 bf ff c8 b 2013dc8 2013eac: 82 10 20 05 mov 5, %g1 ! 5 =============================================================================== 020075c8 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 20075c8: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get ( Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) 20075cc: 11 00 80 7d sethi %hi(0x201f400), %o0 20075d0: 92 10 00 18 mov %i0, %o1 20075d4: 90 12 22 74 or %o0, 0x274, %o0 20075d8: 40 00 09 71 call 2009b9c <_Objects_Get> 20075dc: 94 07 bf fc add %fp, -4, %o2 rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 20075e0: c2 07 bf fc ld [ %fp + -4 ], %g1 20075e4: 80 a0 60 00 cmp %g1, 0 20075e8: 12 80 00 0d bne 200761c 20075ec: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 20075f0: c4 02 20 40 ld [ %o0 + 0x40 ], %g2 RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 20075f4: 39 00 80 7f sethi %hi(0x201fc00), %i4 20075f8: b8 17 21 18 or %i4, 0x118, %i4 ! 201fd18 <_Per_CPU_Information> 20075fc: c2 07 20 0c ld [ %i4 + 0xc ], %g1 2007600: 80 a0 80 01 cmp %g2, %g1 2007604: 02 80 00 08 be 2007624 2007608: 80 a6 60 00 cmp %i1, 0 _Thread_Enable_dispatch(); 200760c: 40 00 0d 2c call 200aabc <_Thread_Enable_dispatch> 2007610: b0 10 20 17 mov 0x17, %i0 return RTEMS_NOT_OWNER_OF_RESOURCE; 2007614: 81 c7 e0 08 ret 2007618: 81 e8 00 00 restore case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 200761c: 81 c7 e0 08 ret 2007620: 91 e8 20 04 restore %g0, 4, %o0 if ( !_Thread_Is_executing( the_period->owner ) ) { _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { 2007624: 12 80 00 0e bne 200765c 2007628: 01 00 00 00 nop switch ( the_period->state ) { 200762c: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 2007630: 80 a0 60 04 cmp %g1, 4 2007634: 18 80 00 06 bgu 200764c <== NEVER TAKEN 2007638: b0 10 20 00 clr %i0 200763c: 83 28 60 02 sll %g1, 2, %g1 2007640: 05 00 80 75 sethi %hi(0x201d400), %g2 2007644: 84 10 a0 6c or %g2, 0x6c, %g2 ! 201d46c 2007648: f0 00 80 01 ld [ %g2 + %g1 ], %i0 the_period->state = RATE_MONOTONIC_ACTIVE; the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 200764c: 40 00 0d 1c call 200aabc <_Thread_Enable_dispatch> 2007650: 01 00 00 00 nop return RTEMS_TIMEOUT; 2007654: 81 c7 e0 08 ret 2007658: 81 e8 00 00 restore } _Thread_Enable_dispatch(); return( return_value ); } _ISR_Disable( level ); 200765c: 7f ff ed e3 call 2002de8 2007660: 01 00 00 00 nop 2007664: b4 10 00 08 mov %o0, %i2 if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { 2007668: f6 07 60 38 ld [ %i5 + 0x38 ], %i3 200766c: 80 a6 e0 00 cmp %i3, 0 2007670: 02 80 00 14 be 20076c0 2007674: 80 a6 e0 02 cmp %i3, 2 _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { 2007678: 02 80 00 29 be 200771c 200767c: 80 a6 e0 04 cmp %i3, 4 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_EXPIRED ) { 2007680: 12 bf ff e5 bne 2007614 <== NEVER TAKEN 2007684: b0 10 20 04 mov 4, %i0 /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 2007688: 7f ff ff 92 call 20074d0 <_Rate_monotonic_Update_statistics> 200768c: 90 10 00 1d mov %i5, %o0 _ISR_Enable( level ); 2007690: 7f ff ed da call 2002df8 2007694: 90 10 00 1a mov %i2, %o0 the_period->state = RATE_MONOTONIC_ACTIVE; 2007698: 82 10 20 02 mov 2, %g1 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 200769c: 92 07 60 10 add %i5, 0x10, %o1 20076a0: 11 00 80 7e sethi %hi(0x201f800), %o0 the_period->next_length = length; 20076a4: f2 27 60 3c st %i1, [ %i5 + 0x3c ] 20076a8: 90 12 20 a4 or %o0, 0xa4, %o0 */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 20076ac: c2 27 60 38 st %g1, [ %i5 + 0x38 ] Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 20076b0: f2 27 60 1c st %i1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 20076b4: 40 00 11 53 call 200bc00 <_Watchdog_Insert> 20076b8: b0 10 20 06 mov 6, %i0 20076bc: 30 bf ff e4 b,a 200764c return( return_value ); } _ISR_Disable( level ); if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { _ISR_Enable( level ); 20076c0: 7f ff ed ce call 2002df8 20076c4: 01 00 00 00 nop /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 20076c8: 7f ff ff 68 call 2007468 <_Rate_monotonic_Initiate_statistics> 20076cc: 90 10 00 1d mov %i5, %o0 the_period->state = RATE_MONOTONIC_ACTIVE; 20076d0: 82 10 20 02 mov 2, %g1 20076d4: 92 07 60 10 add %i5, 0x10, %o1 20076d8: c2 27 60 38 st %g1, [ %i5 + 0x38 ] 20076dc: 11 00 80 7e sethi %hi(0x201f800), %o0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 20076e0: 03 00 80 1e sethi %hi(0x2007800), %g1 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 20076e4: 90 12 20 a4 or %o0, 0xa4, %o0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 20076e8: 82 10 62 70 or %g1, 0x270, %g1 the_watchdog->id = id; 20076ec: f0 27 60 30 st %i0, [ %i5 + 0x30 ] Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 20076f0: c2 27 60 2c st %g1, [ %i5 + 0x2c ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 20076f4: c0 27 60 18 clr [ %i5 + 0x18 ] the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 20076f8: c0 27 60 34 clr [ %i5 + 0x34 ] _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; 20076fc: f2 27 60 3c st %i1, [ %i5 + 0x3c ] Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 2007700: f2 27 60 1c st %i1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 2007704: 40 00 11 3f call 200bc00 <_Watchdog_Insert> 2007708: b0 10 20 00 clr %i0 _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 200770c: 40 00 0c ec call 200aabc <_Thread_Enable_dispatch> 2007710: 01 00 00 00 nop return RTEMS_SUCCESSFUL; 2007714: 81 c7 e0 08 ret 2007718: 81 e8 00 00 restore if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 200771c: 7f ff ff 6d call 20074d0 <_Rate_monotonic_Update_statistics> 2007720: 90 10 00 1d mov %i5, %o0 /* * 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; 2007724: 82 10 20 01 mov 1, %g1 the_period->next_length = length; 2007728: f2 27 60 3c st %i1, [ %i5 + 0x3c ] /* * 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; 200772c: c2 27 60 38 st %g1, [ %i5 + 0x38 ] the_period->next_length = length; _ISR_Enable( level ); 2007730: 7f ff ed b2 call 2002df8 2007734: 90 10 00 1a mov %i2, %o0 _Thread_Executing->Wait.id = the_period->Object.id; 2007738: c2 07 20 0c ld [ %i4 + 0xc ], %g1 200773c: c4 07 60 08 ld [ %i5 + 8 ], %g2 _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 2007740: 90 10 00 01 mov %g1, %o0 2007744: 13 00 00 10 sethi %hi(0x4000), %o1 2007748: 40 00 0f 38 call 200b428 <_Thread_Set_state> 200774c: c4 20 60 20 st %g2, [ %g1 + 0x20 ] /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 2007750: 7f ff ed a6 call 2002de8 2007754: 01 00 00 00 nop local_state = the_period->state; 2007758: f4 07 60 38 ld [ %i5 + 0x38 ], %i2 the_period->state = RATE_MONOTONIC_ACTIVE; 200775c: f6 27 60 38 st %i3, [ %i5 + 0x38 ] _ISR_Enable( level ); 2007760: 7f ff ed a6 call 2002df8 2007764: 01 00 00 00 nop /* * 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 ) 2007768: 80 a6 a0 03 cmp %i2, 3 200776c: 22 80 00 06 be,a 2007784 2007770: d0 07 20 0c ld [ %i4 + 0xc ], %o0 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); _Thread_Enable_dispatch(); 2007774: 40 00 0c d2 call 200aabc <_Thread_Enable_dispatch> 2007778: b0 10 20 00 clr %i0 return RTEMS_SUCCESSFUL; 200777c: 81 c7 e0 08 ret 2007780: 81 e8 00 00 restore /* * 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 ) _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 2007784: 40 00 0b db call 200a6f0 <_Thread_Clear_state> 2007788: 13 00 00 10 sethi %hi(0x4000), %o1 200778c: 30 bf ff fa b,a 2007774 =============================================================================== 02007790 : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 2007790: 9d e3 bf 38 save %sp, -200, %sp rtems_id id; rtems_rate_monotonic_period_statistics the_stats; rtems_rate_monotonic_period_status the_status; char name[5]; if ( !print ) 2007794: 80 a6 60 00 cmp %i1, 0 2007798: 02 80 00 48 be 20078b8 <== NEVER TAKEN 200779c: 90 10 00 18 mov %i0, %o0 return; (*print)( context, "Period information by period\n" ); 20077a0: 13 00 80 75 sethi %hi(0x201d400), %o1 20077a4: 9f c6 40 00 call %i1 20077a8: 92 12 60 80 or %o1, 0x80, %o1 ! 201d480 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 20077ac: 90 10 00 18 mov %i0, %o0 20077b0: 13 00 80 75 sethi %hi(0x201d400), %o1 20077b4: 9f c6 40 00 call %i1 20077b8: 92 12 60 a0 or %o1, 0xa0, %o1 ! 201d4a0 (*print)( context, "--- Wall times are in seconds ---\n" ); 20077bc: 90 10 00 18 mov %i0, %o0 20077c0: 13 00 80 75 sethi %hi(0x201d400), %o1 20077c4: 9f c6 40 00 call %i1 20077c8: 92 12 60 c8 or %o1, 0xc8, %o1 ! 201d4c8 Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 20077cc: 90 10 00 18 mov %i0, %o0 20077d0: 13 00 80 75 sethi %hi(0x201d400), %o1 20077d4: 9f c6 40 00 call %i1 20077d8: 92 12 60 f0 or %o1, 0xf0, %o1 ! 201d4f0 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 20077dc: 90 10 00 18 mov %i0, %o0 20077e0: 13 00 80 75 sethi %hi(0x201d400), %o1 20077e4: 9f c6 40 00 call %i1 20077e8: 92 12 61 40 or %o1, 0x140, %o1 ! 201d540 /* * 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 ; 20077ec: 39 00 80 7d sethi %hi(0x201f400), %i4 20077f0: b8 17 22 74 or %i4, 0x274, %i4 ! 201f674 <_Rate_monotonic_Information> 20077f4: fa 07 20 08 ld [ %i4 + 8 ], %i5 20077f8: c2 07 20 0c ld [ %i4 + 0xc ], %g1 20077fc: 80 a7 40 01 cmp %i5, %g1 2007800: 18 80 00 2e bgu 20078b8 <== NEVER TAKEN 2007804: 35 00 80 75 sethi %hi(0x201d400), %i2 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, 2007808: 23 00 80 75 sethi %hi(0x201d400), %l1 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, 200780c: 21 00 80 75 sethi %hi(0x201d400), %l0 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 2007810: 37 00 80 71 sethi %hi(0x201c400), %i3 rtems_object_get_name( the_status.owner, sizeof(name), name ); /* * Print part of report line that is not dependent on granularity */ (*print)( context, 2007814: b4 16 a1 90 or %i2, 0x190, %i2 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, 2007818: a2 14 61 a8 or %l1, 0x1a8, %l1 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, 200781c: a0 14 21 c8 or %l0, 0x1c8, %l0 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 2007820: 10 80 00 06 b 2007838 2007824: b6 16 e2 f0 or %i3, 0x2f0, %i3 * 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++ ) { 2007828: ba 07 60 01 inc %i5 /* * 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 ; 200782c: 80 a0 40 1d cmp %g1, %i5 2007830: 0a 80 00 22 bcs 20078b8 2007834: 01 00 00 00 nop id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 2007838: 90 10 00 1d mov %i5, %o0 200783c: 40 00 1b c2 call 200e744 2007840: 92 07 bf a0 add %fp, -96, %o1 if ( status != RTEMS_SUCCESSFUL ) 2007844: 80 a2 20 00 cmp %o0, 0 2007848: 32 bf ff f8 bne,a 2007828 200784c: c2 07 20 0c ld [ %i4 + 0xc ], %g1 #if defined(RTEMS_DEBUG) status = rtems_rate_monotonic_get_status( id, &the_status ); if ( status != RTEMS_SUCCESSFUL ) continue; #else (void) rtems_rate_monotonic_get_status( id, &the_status ); 2007850: 92 07 bf d8 add %fp, -40, %o1 2007854: 40 00 1b eb call 200e800 2007858: 90 10 00 1d mov %i5, %o0 #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 200785c: d0 07 bf d8 ld [ %fp + -40 ], %o0 2007860: 92 10 20 05 mov 5, %o1 2007864: 40 00 00 b4 call 2007b34 2007868: 94 07 bf f8 add %fp, -8, %o2 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 200786c: d8 1f bf a0 ldd [ %fp + -96 ], %o4 2007870: 92 10 00 1a mov %i2, %o1 2007874: 94 10 00 1d mov %i5, %o2 2007878: 90 10 00 18 mov %i0, %o0 200787c: 9f c6 40 00 call %i1 2007880: 96 07 bf f8 add %fp, -8, %o3 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 2007884: c2 07 bf a0 ld [ %fp + -96 ], %g1 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 ); 2007888: 94 07 bf f0 add %fp, -16, %o2 200788c: 90 07 bf b8 add %fp, -72, %o0 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 2007890: 80 a0 60 00 cmp %g1, 0 2007894: 12 80 00 0b bne 20078c0 2007898: 92 10 00 1b mov %i3, %o1 (*print)( context, "\n" ); 200789c: 9f c6 40 00 call %i1 20078a0: 90 10 00 18 mov %i0, %o0 /* * 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 ; 20078a4: c2 07 20 0c ld [ %i4 + 0xc ], %g1 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 20078a8: ba 07 60 01 inc %i5 /* * 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 ; 20078ac: 80 a0 40 1d cmp %g1, %i5 20078b0: 1a bf ff e3 bcc 200783c <== ALWAYS TAKEN 20078b4: 90 10 00 1d mov %i5, %o0 20078b8: 81 c7 e0 08 ret 20078bc: 81 e8 00 00 restore 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 ); 20078c0: 40 00 0f 94 call 200b710 <_Timespec_Divide_by_integer> 20078c4: 92 10 00 01 mov %g1, %o1 (*print)( context, 20078c8: d0 07 bf ac ld [ %fp + -84 ], %o0 20078cc: 40 00 4a 0e call 201a104 <.div> 20078d0: 92 10 23 e8 mov 0x3e8, %o1 20078d4: aa 10 00 08 mov %o0, %l5 20078d8: d0 07 bf b4 ld [ %fp + -76 ], %o0 20078dc: 40 00 4a 0a call 201a104 <.div> 20078e0: 92 10 23 e8 mov 0x3e8, %o1 20078e4: c2 07 bf f0 ld [ %fp + -16 ], %g1 20078e8: a6 10 00 08 mov %o0, %l3 20078ec: d0 07 bf f4 ld [ %fp + -12 ], %o0 20078f0: e4 07 bf a8 ld [ %fp + -88 ], %l2 20078f4: e8 07 bf b0 ld [ %fp + -80 ], %l4 20078f8: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 20078fc: 40 00 4a 02 call 201a104 <.div> 2007900: 92 10 23 e8 mov 0x3e8, %o1 2007904: 96 10 00 15 mov %l5, %o3 2007908: 98 10 00 14 mov %l4, %o4 200790c: 9a 10 00 13 mov %l3, %o5 2007910: d0 23 a0 60 st %o0, [ %sp + 0x60 ] 2007914: 92 10 00 11 mov %l1, %o1 2007918: 94 10 00 12 mov %l2, %o2 200791c: 9f c6 40 00 call %i1 2007920: 90 10 00 18 mov %i0, %o0 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); 2007924: d2 07 bf a0 ld [ %fp + -96 ], %o1 2007928: 94 07 bf f0 add %fp, -16, %o2 200792c: 40 00 0f 79 call 200b710 <_Timespec_Divide_by_integer> 2007930: 90 07 bf d0 add %fp, -48, %o0 (*print)( context, 2007934: d0 07 bf c4 ld [ %fp + -60 ], %o0 2007938: 40 00 49 f3 call 201a104 <.div> 200793c: 92 10 23 e8 mov 0x3e8, %o1 2007940: a8 10 00 08 mov %o0, %l4 2007944: d0 07 bf cc ld [ %fp + -52 ], %o0 2007948: 40 00 49 ef call 201a104 <.div> 200794c: 92 10 23 e8 mov 0x3e8, %o1 2007950: c2 07 bf f0 ld [ %fp + -16 ], %g1 2007954: a4 10 00 08 mov %o0, %l2 2007958: d0 07 bf f4 ld [ %fp + -12 ], %o0 200795c: ea 07 bf c0 ld [ %fp + -64 ], %l5 2007960: e6 07 bf c8 ld [ %fp + -56 ], %l3 2007964: 92 10 23 e8 mov 0x3e8, %o1 2007968: 40 00 49 e7 call 201a104 <.div> 200796c: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 2007970: 92 10 00 10 mov %l0, %o1 2007974: d0 23 a0 60 st %o0, [ %sp + 0x60 ] 2007978: 94 10 00 15 mov %l5, %o2 200797c: 90 10 00 18 mov %i0, %o0 2007980: 96 10 00 14 mov %l4, %o3 2007984: 98 10 00 13 mov %l3, %o4 2007988: 9f c6 40 00 call %i1 200798c: 9a 10 00 12 mov %l2, %o5 /* * 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 ; 2007990: 10 bf ff a6 b 2007828 2007994: c2 07 20 0c ld [ %i4 + 0xc ], %g1 =============================================================================== 020079b0 : /* * rtems_rate_monotonic_reset_all_statistics */ void rtems_rate_monotonic_reset_all_statistics( void ) { 20079b0: 9d e3 bf a0 save %sp, -96, %sp /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 20079b4: 03 00 80 7d sethi %hi(0x201f400), %g1 20079b8: c4 00 63 e0 ld [ %g1 + 0x3e0 ], %g2 ! 201f7e0 <_Thread_Dispatch_disable_level> 20079bc: 84 00 a0 01 inc %g2 20079c0: c4 20 63 e0 st %g2, [ %g1 + 0x3e0 ] return _Thread_Dispatch_disable_level; 20079c4: c2 00 63 e0 ld [ %g1 + 0x3e0 ], %g1 /* * Cycle through all possible ids and try to reset 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 ; 20079c8: 39 00 80 7d sethi %hi(0x201f400), %i4 20079cc: b8 17 22 74 or %i4, 0x274, %i4 ! 201f674 <_Rate_monotonic_Information> 20079d0: fa 07 20 08 ld [ %i4 + 8 ], %i5 20079d4: c2 07 20 0c ld [ %i4 + 0xc ], %g1 20079d8: 80 a7 40 01 cmp %i5, %g1 20079dc: 18 80 00 09 bgu 2007a00 <== NEVER TAKEN 20079e0: 01 00 00 00 nop id <= _Rate_monotonic_Information.maximum_id ; id++ ) { (void) rtems_rate_monotonic_reset_statistics( id ); 20079e4: 40 00 00 09 call 2007a08 20079e8: 90 10 00 1d mov %i5, %o0 /* * Cycle through all possible ids and try to reset 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 ; 20079ec: c2 07 20 0c ld [ %i4 + 0xc ], %g1 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 20079f0: ba 07 60 01 inc %i5 /* * Cycle through all possible ids and try to reset 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 ; 20079f4: 80 a0 40 1d cmp %g1, %i5 20079f8: 1a bf ff fb bcc 20079e4 20079fc: 01 00 00 00 nop } /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); 2007a00: 40 00 0c 2f call 200aabc <_Thread_Enable_dispatch> 2007a04: 81 e8 00 00 restore =============================================================================== 02015374 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 2015374: 9d e3 bf 98 save %sp, -104, %sp register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 2015378: 80 a6 60 00 cmp %i1, 0 201537c: 12 80 00 04 bne 201538c 2015380: 82 10 20 0a mov 0xa, %g1 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 2015384: 81 c7 e0 08 ret 2015388: 91 e8 00 01 restore %g0, %g1, %o0 ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 201538c: 90 10 00 18 mov %i0, %o0 2015390: 40 00 13 24 call 201a020 <_Thread_Get> 2015394: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 2015398: c2 07 bf fc ld [ %fp + -4 ], %g1 201539c: 80 a0 60 00 cmp %g1, 0 20153a0: 12 80 00 20 bne 2015420 20153a4: b8 10 00 08 mov %o0, %i4 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 20153a8: fa 02 21 58 ld [ %o0 + 0x158 ], %i5 asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 20153ac: c2 07 60 0c ld [ %i5 + 0xc ], %g1 20153b0: 80 a0 60 00 cmp %g1, 0 20153b4: 02 80 00 1e be 201542c 20153b8: 01 00 00 00 nop if ( asr->is_enabled ) { 20153bc: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 20153c0: 80 a0 60 00 cmp %g1, 0 20153c4: 02 80 00 1e be 201543c 20153c8: 01 00 00 00 nop rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 20153cc: 7f ff e6 93 call 200ee18 20153d0: 01 00 00 00 nop *signal_set |= signals; 20153d4: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 20153d8: b2 10 40 19 or %g1, %i1, %i1 20153dc: f2 27 60 14 st %i1, [ %i5 + 0x14 ] _ISR_Enable( _level ); 20153e0: 7f ff e6 92 call 200ee28 20153e4: 01 00 00 00 nop _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 20153e8: 03 00 80 f8 sethi %hi(0x203e000), %g1 20153ec: 82 10 62 00 or %g1, 0x200, %g1 ! 203e200 <_Per_CPU_Information> 20153f0: c4 00 60 08 ld [ %g1 + 8 ], %g2 20153f4: 80 a0 a0 00 cmp %g2, 0 20153f8: 02 80 00 06 be 2015410 20153fc: 01 00 00 00 nop 2015400: c4 00 60 0c ld [ %g1 + 0xc ], %g2 2015404: 80 a7 00 02 cmp %i4, %g2 2015408: 02 80 00 15 be 201545c <== ALWAYS TAKEN 201540c: 84 10 20 01 mov 1, %g2 _Thread_Dispatch_necessary = true; } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 2015410: 40 00 12 f8 call 2019ff0 <_Thread_Enable_dispatch> 2015414: 01 00 00 00 nop return RTEMS_SUCCESSFUL; 2015418: 10 bf ff db b 2015384 201541c: 82 10 20 00 clr %g1 ! 0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 2015420: 82 10 20 04 mov 4, %g1 } 2015424: 81 c7 e0 08 ret 2015428: 91 e8 00 01 restore %g0, %g1, %o0 _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 201542c: 40 00 12 f1 call 2019ff0 <_Thread_Enable_dispatch> 2015430: 01 00 00 00 nop return RTEMS_NOT_DEFINED; 2015434: 10 bf ff d4 b 2015384 2015438: 82 10 20 0b mov 0xb, %g1 ! b rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 201543c: 7f ff e6 77 call 200ee18 2015440: 01 00 00 00 nop *signal_set |= signals; 2015444: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 2015448: b2 10 40 19 or %g1, %i1, %i1 201544c: f2 27 60 18 st %i1, [ %i5 + 0x18 ] _ISR_Enable( _level ); 2015450: 7f ff e6 76 call 200ee28 2015454: 01 00 00 00 nop 2015458: 30 bf ff ee b,a 2015410 if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; 201545c: c4 28 60 18 stb %g2, [ %g1 + 0x18 ] 2015460: 30 bf ff ec b,a 2015410 =============================================================================== 020029fc : Thread_Control *the_thread ) { Stack_check_Control *the_pattern; if ( the_thread->Object.id == 0 ) /* skip system tasks */ 20029fc: c2 02 20 08 ld [ %o0 + 8 ], %g1 2002a00: 80 a0 60 00 cmp %g1, 0 2002a04: 02 80 00 0c be 2002a34 <== NEVER TAKEN 2002a08: 05 00 80 66 sethi %hi(0x2019800), %g2 return; the_pattern = Stack_check_Get_pattern_area(&the_thread->Start.Initial_stack); *the_pattern = Stack_check_Pattern; 2002a0c: c2 02 20 bc ld [ %o0 + 0xbc ], %g1 2002a10: c6 00 a2 c4 ld [ %g2 + 0x2c4 ], %g3 2002a14: 84 10 a2 c4 or %g2, 0x2c4, %g2 2002a18: c6 20 60 08 st %g3, [ %g1 + 8 ] 2002a1c: c6 00 a0 04 ld [ %g2 + 4 ], %g3 2002a20: c6 20 60 0c st %g3, [ %g1 + 0xc ] 2002a24: c6 00 a0 08 ld [ %g2 + 8 ], %g3 2002a28: c6 20 60 10 st %g3, [ %g1 + 0x10 ] 2002a2c: c4 00 a0 0c ld [ %g2 + 0xc ], %g2 2002a30: c4 20 60 14 st %g2, [ %g1 + 0x14 ] 2002a34: 81 c3 e0 08 retl =============================================================================== 020029cc : */ bool rtems_stack_checker_create_extension( Thread_Control *running __attribute__((unused)), Thread_Control *the_thread ) { 20029cc: 9d e3 bf a0 save %sp, -96, %sp Stack_check_Initialize(); 20029d0: 7f ff ff d9 call 2002934 20029d4: 01 00 00 00 nop if (the_thread) 20029d8: 80 a6 60 00 cmp %i1, 0 20029dc: 02 80 00 06 be 20029f4 <== NEVER TAKEN 20029e0: 01 00 00 00 nop Stack_check_Dope_stack(&the_thread->Start.Initial_stack); 20029e4: d0 06 60 bc ld [ %i1 + 0xbc ], %o0 20029e8: d4 06 60 b8 ld [ %i1 + 0xb8 ], %o2 20029ec: 40 00 40 3c call 2012adc 20029f0: 92 10 20 a5 mov 0xa5, %o1 return true; } 20029f4: 81 c7 e0 08 ret 20029f8: 91 e8 20 01 restore %g0, 1, %o0 =============================================================================== 02002b50 : /* * Check if blown */ bool rtems_stack_checker_is_blown( void ) { 2002b50: 9d e3 bf a0 save %sp, -96, %sp Stack_Control *the_stack = &_Thread_Executing->Start.Initial_stack; 2002b54: 39 00 80 68 sethi %hi(0x201a000), %i4 2002b58: b8 17 22 48 or %i4, 0x248, %i4 ! 201a248 <_Per_CPU_Information> 2002b5c: c2 07 20 0c ld [ %i4 + 0xc ], %g1 ) { #if defined(__GNUC__) void *sp = __builtin_frame_address(0); if ( sp < the_stack->area ) { 2002b60: d0 00 60 bc ld [ %g1 + 0xbc ], %o0 2002b64: 80 a7 80 08 cmp %fp, %o0 2002b68: 0a 80 00 06 bcs 2002b80 <== NEVER TAKEN 2002b6c: ba 10 20 00 clr %i5 return false; } if ( sp > (the_stack->area + the_stack->size) ) { 2002b70: c2 00 60 b8 ld [ %g1 + 0xb8 ], %g1 2002b74: 82 02 00 01 add %o0, %g1, %g1 } /* * Check if blown */ bool rtems_stack_checker_is_blown( void ) 2002b78: 80 a0 40 1e cmp %g1, %fp 2002b7c: ba 60 3f ff subx %g0, -1, %i5 /* * The stack checker must be initialized before the pattern is there * to check. */ if ( Stack_check_Initialized ) { 2002b80: 03 00 80 66 sethi %hi(0x2019800), %g1 2002b84: c2 00 60 2c ld [ %g1 + 0x2c ], %g1 ! 201982c 2002b88: 80 a0 60 00 cmp %g1, 0 2002b8c: 02 80 00 09 be 2002bb0 <== NEVER TAKEN 2002b90: 92 10 20 01 mov 1, %o1 pattern_ok = (!memcmp( 2002b94: 90 02 20 08 add %o0, 8, %o0 2002b98: 94 10 20 10 mov 0x10, %o2 2002b9c: 13 00 80 66 sethi %hi(0x2019800), %o1 2002ba0: 40 00 3f 65 call 2012934 2002ba4: 92 12 62 c4 or %o1, 0x2c4, %o1 ! 2019ac4 2002ba8: 80 a0 00 08 cmp %g0, %o0 2002bac: 92 60 3f ff subx %g0, -1, %o1 /* * Let's report as much as we can. */ if ( !sp_ok || !pattern_ok ) { 2002bb0: 80 8f 60 ff btst 0xff, %i5 2002bb4: 22 80 00 07 be,a 2002bd0 <== NEVER TAKEN 2002bb8: 92 0a 60 ff and %o1, 0xff, %o1 <== NOT EXECUTED 2002bbc: 92 8a 60 ff andcc %o1, 0xff, %o1 2002bc0: 02 80 00 04 be 2002bd0 <== NEVER TAKEN 2002bc4: b0 10 20 00 clr %i0 /* * The Stack Pointer and the Pattern Area are OK so return false. */ return false; } 2002bc8: 81 c7 e0 08 ret 2002bcc: 81 e8 00 00 restore /* * Let's report as much as we can. */ if ( !sp_ok || !pattern_ok ) { Stack_check_report_blown_task( _Thread_Executing, pattern_ok ); 2002bd0: 7f ff ff 9b call 2002a3c <== NOT EXECUTED 2002bd4: d0 07 20 0c ld [ %i4 + 0xc ], %o0 <== NOT EXECUTED =============================================================================== 02002bdc : void rtems_stack_checker_report_usage_with_plugin( void *context, rtems_printk_plugin_t print ) { 2002bdc: 9d e3 bf a0 save %sp, -96, %sp if ( !print ) 2002be0: 80 a6 60 00 cmp %i1, 0 2002be4: 02 80 00 14 be 2002c34 <== NEVER TAKEN 2002be8: 39 00 80 66 sethi %hi(0x2019800), %i4 return; print_context = context; print_handler = print; 2002bec: 3b 00 80 66 sethi %hi(0x2019800), %i5 ) { if ( !print ) return; print_context = context; 2002bf0: f0 27 20 34 st %i0, [ %i4 + 0x34 ] print_handler = print; 2002bf4: f2 27 60 30 st %i1, [ %i5 + 0x30 ] (*print)( context, "Stack usage by thread\n"); 2002bf8: 90 10 00 18 mov %i0, %o0 2002bfc: 13 00 80 60 sethi %hi(0x2018000), %o1 2002c00: 9f c6 40 00 call %i1 2002c04: 92 12 62 c0 or %o1, 0x2c0, %o1 ! 20182c0 (*print)( context, 2002c08: 90 10 00 18 mov %i0, %o0 2002c0c: 13 00 80 60 sethi %hi(0x2018000), %o1 2002c10: 9f c6 40 00 call %i1 2002c14: 92 12 62 d8 or %o1, 0x2d8, %o1 ! 20182d8 " 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 ); 2002c18: 11 00 80 09 sethi %hi(0x2002400), %o0 2002c1c: 40 00 1e 24 call 200a4ac 2002c20: 90 12 23 90 or %o0, 0x390, %o0 ! 2002790 #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) /* dump interrupt stack info if any */ Stack_check_Dump_threads_usage((Thread_Control *) -1); 2002c24: 7f ff fe db call 2002790 2002c28: 90 10 3f ff mov -1, %o0 #endif print_context = NULL; 2002c2c: c0 27 20 34 clr [ %i4 + 0x34 ] print_handler = NULL; 2002c30: c0 27 60 30 clr [ %i5 + 0x30 ] 2002c34: 81 c7 e0 08 ret 2002c38: 81 e8 00 00 restore =============================================================================== 02002ae4 : */ void rtems_stack_checker_switch_extension( Thread_Control *running __attribute__((unused)), Thread_Control *heir __attribute__((unused)) ) { 2002ae4: 9d e3 bf a0 save %sp, -96, %sp Stack_Control *the_stack = &running->Start.Initial_stack; void *pattern; bool sp_ok; bool pattern_ok = true; pattern = Stack_check_Get_pattern_area(the_stack); 2002ae8: c2 06 20 bc ld [ %i0 + 0xbc ], %g1 /* * 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, 2002aec: 13 00 80 66 sethi %hi(0x2019800), %o1 Stack_Control *the_stack = &running->Start.Initial_stack; void *pattern; bool sp_ok; bool pattern_ok = true; pattern = Stack_check_Get_pattern_area(the_stack); 2002af0: 90 00 60 08 add %g1, 8, %o0 /* * 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, 2002af4: 94 10 20 10 mov 0x10, %o2 ) { #if defined(__GNUC__) void *sp = __builtin_frame_address(0); if ( sp < the_stack->area ) { 2002af8: 80 a7 80 01 cmp %fp, %g1 2002afc: 0a 80 00 07 bcs 2002b18 <== NEVER TAKEN 2002b00: 92 12 62 c4 or %o1, 0x2c4, %o1 return false; } if ( sp > (the_stack->area + the_stack->size) ) { 2002b04: c4 06 20 b8 ld [ %i0 + 0xb8 ], %g2 2002b08: 82 00 40 02 add %g1, %g2, %g1 2002b0c: 80 a7 80 01 cmp %fp, %g1 2002b10: 08 80 00 09 bleu 2002b34 <== ALWAYS TAKEN 2002b14: 01 00 00 00 nop /* * 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, 2002b18: 40 00 3f 87 call 2012934 <== NOT EXECUTED 2002b1c: 01 00 00 00 nop <== NOT EXECUTED 2002b20: 80 a0 00 08 cmp %g0, %o0 <== NOT EXECUTED 2002b24: 92 60 3f ff subx %g0, -1, %o1 <== NOT EXECUTED (void *) Stack_check_Pattern.pattern, PATTERN_SIZE_BYTES)); if ( !sp_ok || !pattern_ok ) { Stack_check_report_blown_task( running, pattern_ok ); 2002b28: 90 10 00 18 mov %i0, %o0 2002b2c: 7f ff ff c4 call 2002a3c 2002b30: 92 0a 60 01 and %o1, 1, %o1 /* * 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, 2002b34: 40 00 3f 80 call 2012934 2002b38: 01 00 00 00 nop (void *) Stack_check_Pattern.pattern, PATTERN_SIZE_BYTES)); if ( !sp_ok || !pattern_ok ) { 2002b3c: 80 a2 20 00 cmp %o0, 0 2002b40: 12 bf ff fa bne 2002b28 2002b44: 92 10 20 00 clr %o1 2002b48: 81 c7 e0 08 ret 2002b4c: 81 e8 00 00 restore =============================================================================== 0200c404 : rtems_status_code rtems_string_to_double ( const char *s, double *n, char **endptr ) { 200c404: 9d e3 bf 90 save %sp, -112, %sp 200c408: ba 10 00 18 mov %i0, %i5 double result; char *end; if ( !n ) 200c40c: 80 a6 60 00 cmp %i1, 0 200c410: 02 80 00 2d be 200c4c4 200c414: b0 10 20 09 mov 9, %i0 return RTEMS_INVALID_ADDRESS; errno = 0; 200c418: 40 00 0d df call 200fb94 <__errno> 200c41c: 01 00 00 00 nop 200c420: c0 22 00 00 clr [ %o0 ] *n = 0; 200c424: c0 26 40 00 clr [ %i1 ] 200c428: c0 26 60 04 clr [ %i1 + 4 ] result = strtod( s, &end ); 200c42c: 90 10 00 1d mov %i5, %o0 200c430: 40 00 19 4d call 2012964 200c434: 92 07 bf fc add %fp, -4, %o1 if ( endptr ) 200c438: 80 a6 a0 00 cmp %i2, 0 200c43c: 02 80 00 03 be 200c448 200c440: c2 07 bf fc ld [ %fp + -4 ], %g1 *endptr = end; 200c444: c2 26 80 00 st %g1, [ %i2 ] if ( end == s ) 200c448: 80 a7 40 01 cmp %i5, %g1 200c44c: 02 80 00 1e be 200c4c4 200c450: b0 10 20 0b mov 0xb, %i0 return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c454: c1 27 bf f4 st %f0, [ %fp + -12 ] 200c458: 40 00 0d cf call 200fb94 <__errno> 200c45c: c3 27 bf f0 st %f1, [ %fp + -16 ] 200c460: c2 02 00 00 ld [ %o0 ], %g1 200c464: c1 07 bf f4 ld [ %fp + -12 ], %f0 200c468: 80 a0 60 22 cmp %g1, 0x22 200c46c: 02 80 00 05 be 200c480 200c470: c3 07 bf f0 ld [ %fp + -16 ], %f1 (( result == 0 ) || ( result == HUGE_VAL ) || ( result == -HUGE_VAL ))) return RTEMS_INVALID_NUMBER; *n = result; 200c474: c1 3e 40 00 std %f0, [ %i1 ] return RTEMS_SUCCESSFUL; } 200c478: 81 c7 e0 08 ret 200c47c: 91 e8 20 00 restore %g0, 0, %o0 *endptr = end; if ( end == s ) return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c480: 03 00 80 7b sethi %hi(0x201ec00), %g1 200c484: d1 18 61 58 ldd [ %g1 + 0x158 ], %f8 ! 201ed58 <_rodata_start+0x16f8> 200c488: 81 a8 0a 48 fcmpd %f0, %f8 200c48c: 01 00 00 00 nop 200c490: 13 80 00 0d fbe 200c4c4 200c494: b0 10 20 0a mov 0xa, %i0 ! a (( result == 0 ) || ( result == HUGE_VAL ) || ( result == -HUGE_VAL ))) 200c498: 03 00 80 7d sethi %hi(0x201f400), %g1 200c49c: d1 18 63 f8 ldd [ %g1 + 0x3f8 ], %f8 ! 201f7f8 <_CPU_Trap_slot_template+0x14> 200c4a0: 81 a8 0a c8 fcmped %f0, %f8 200c4a4: 01 00 00 00 nop 200c4a8: 0d 80 00 07 fbg 200c4c4 200c4ac: 03 00 80 7e sethi %hi(0x201f800), %g1 200c4b0: d1 18 60 00 ldd [ %g1 ], %f8 <== NOT EXECUTED 200c4b4: 81 a8 0a c8 fcmped %f0, %f8 <== NOT EXECUTED 200c4b8: 01 00 00 00 nop <== NOT EXECUTED 200c4bc: 19 bf ff ee fbuge 200c474 <== NOT EXECUTED 200c4c0: 01 00 00 00 nop <== NOT EXECUTED return RTEMS_INVALID_NUMBER; *n = result; return RTEMS_SUCCESSFUL; } 200c4c4: 81 c7 e0 08 ret 200c4c8: 81 e8 00 00 restore =============================================================================== 0200c4cc : rtems_status_code rtems_string_to_float ( const char *s, float *n, char **endptr ) { 200c4cc: 9d e3 bf 90 save %sp, -112, %sp 200c4d0: ba 10 00 18 mov %i0, %i5 float result; char *end; if ( !n ) 200c4d4: 80 a6 60 00 cmp %i1, 0 200c4d8: 02 80 00 2a be 200c580 200c4dc: b0 10 20 09 mov 9, %i0 return RTEMS_INVALID_ADDRESS; errno = 0; 200c4e0: 40 00 0d ad call 200fb94 <__errno> 200c4e4: 01 00 00 00 nop 200c4e8: c0 22 00 00 clr [ %o0 ] *n = 0; 200c4ec: c0 26 40 00 clr [ %i1 ] result = strtof( s, &end ); 200c4f0: 90 10 00 1d mov %i5, %o0 200c4f4: 40 00 19 23 call 2012980 200c4f8: 92 07 bf fc add %fp, -4, %o1 if ( endptr ) 200c4fc: 80 a6 a0 00 cmp %i2, 0 200c500: 02 80 00 03 be 200c50c 200c504: c2 07 bf fc ld [ %fp + -4 ], %g1 *endptr = end; 200c508: c2 26 80 00 st %g1, [ %i2 ] if ( end == s ) 200c50c: 80 a7 40 01 cmp %i5, %g1 200c510: 02 80 00 1c be 200c580 200c514: b0 10 20 0b mov 0xb, %i0 return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c518: 40 00 0d 9f call 200fb94 <__errno> 200c51c: c1 27 bf f4 st %f0, [ %fp + -12 ] 200c520: c2 02 00 00 ld [ %o0 ], %g1 200c524: 80 a0 60 22 cmp %g1, 0x22 200c528: 02 80 00 05 be 200c53c 200c52c: c1 07 bf f4 ld [ %fp + -12 ], %f0 (( result == 0 ) || ( result == HUGE_VALF ) || ( result == -HUGE_VALF ))) return RTEMS_INVALID_NUMBER; *n = result; 200c530: c1 26 40 00 st %f0, [ %i1 ] return RTEMS_SUCCESSFUL; } 200c534: 81 c7 e0 08 ret 200c538: 91 e8 20 00 restore %g0, 0, %o0 *endptr = end; if ( end == s ) return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c53c: 03 00 80 7b sethi %hi(0x201ec00), %g1 200c540: d1 00 61 4c ld [ %g1 + 0x14c ], %f8 ! 201ed4c <_rodata_start+0x16ec> 200c544: 81 a8 0a 28 fcmps %f0, %f8 200c548: 01 00 00 00 nop 200c54c: 13 80 00 0d fbe 200c580 200c550: b0 10 20 0a mov 0xa, %i0 ! a (( result == 0 ) || ( result == HUGE_VALF ) || ( result == -HUGE_VALF ))) 200c554: 03 00 80 7e sethi %hi(0x201f800), %g1 200c558: d1 00 60 08 ld [ %g1 + 8 ], %f8 ! 201f808 <_CPU_Trap_slot_template+0x24> 200c55c: 81 a8 0a a8 fcmpes %f0, %f8 200c560: 01 00 00 00 nop 200c564: 0d 80 00 07 fbg 200c580 200c568: 03 00 80 7e sethi %hi(0x201f800), %g1 200c56c: d1 00 60 0c ld [ %g1 + 0xc ], %f8 ! 201f80c <_CPU_Trap_slot_template+0x28><== NOT EXECUTED 200c570: 81 a8 0a a8 fcmpes %f0, %f8 <== NOT EXECUTED 200c574: 01 00 00 00 nop <== NOT EXECUTED 200c578: 19 bf ff ee fbuge 200c530 <== NOT EXECUTED 200c57c: 01 00 00 00 nop <== NOT EXECUTED return RTEMS_INVALID_NUMBER; *n = result; return RTEMS_SUCCESSFUL; } 200c580: 81 c7 e0 08 ret 200c584: 81 e8 00 00 restore =============================================================================== 0200c588 : const char *s, int *n, char **endptr, int base ) { 200c588: 9d e3 bf 98 save %sp, -104, %sp 200c58c: ba 10 00 18 mov %i0, %i5 long result; char *end; if ( !n ) 200c590: 80 a6 60 00 cmp %i1, 0 200c594: 02 80 00 1f be 200c610 200c598: b0 10 20 09 mov 9, %i0 return RTEMS_INVALID_ADDRESS; errno = 0; 200c59c: 40 00 0d 7e call 200fb94 <__errno> 200c5a0: 01 00 00 00 nop 200c5a4: c0 22 00 00 clr [ %o0 ] *n = 0; result = strtol( s, &end, base ); 200c5a8: 94 10 00 1b mov %i3, %o2 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 200c5ac: c0 26 40 00 clr [ %i1 ] result = strtol( s, &end, base ); 200c5b0: 90 10 00 1d mov %i5, %o0 200c5b4: 40 00 19 95 call 2012c08 200c5b8: 92 07 bf fc add %fp, -4, %o1 if ( endptr ) *endptr = end; 200c5bc: c2 07 bf fc ld [ %fp + -4 ], %g1 errno = 0; *n = 0; result = strtol( s, &end, base ); if ( endptr ) 200c5c0: 80 a6 a0 00 cmp %i2, 0 200c5c4: 02 80 00 03 be 200c5d0 200c5c8: b6 10 00 08 mov %o0, %i3 *endptr = end; 200c5cc: c2 26 80 00 st %g1, [ %i2 ] if ( end == s ) 200c5d0: 80 a7 40 01 cmp %i5, %g1 200c5d4: 02 80 00 0f be 200c610 200c5d8: b0 10 20 0b mov 0xb, %i0 return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c5dc: 40 00 0d 6e call 200fb94 <__errno> 200c5e0: 01 00 00 00 nop 200c5e4: c2 02 00 00 ld [ %o0 ], %g1 200c5e8: 80 a0 60 22 cmp %g1, 0x22 200c5ec: 02 80 00 05 be 200c600 200c5f0: 03 20 00 00 sethi %hi(0x80000000), %g1 errno = ERANGE; return RTEMS_INVALID_NUMBER; } #endif *n = result; 200c5f4: f6 26 40 00 st %i3, [ %i1 ] return RTEMS_SUCCESSFUL; 200c5f8: 81 c7 e0 08 ret 200c5fc: 91 e8 20 00 restore %g0, 0, %o0 if ( end == s ) return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && (( result == 0 ) || ( result == LONG_MAX ) || ( result == LONG_MIN ))) 200c600: 82 38 40 1b xnor %g1, %i3, %g1 *endptr = end; if ( end == s ) return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c604: 80 a0 60 00 cmp %g1, 0 200c608: 12 80 00 04 bne 200c618 <== NEVER TAKEN 200c60c: b0 10 20 0a mov 0xa, %i0 #endif *n = result; return RTEMS_SUCCESSFUL; } 200c610: 81 c7 e0 08 ret 200c614: 81 e8 00 00 restore *endptr = end; if ( end == s ) return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c618: 80 a6 e0 00 cmp %i3, 0 <== NOT EXECUTED 200c61c: 02 bf ff fd be 200c610 <== NOT EXECUTED 200c620: 03 20 00 00 sethi %hi(0x80000000), %g1 <== NOT EXECUTED (( result == 0 ) || ( result == LONG_MAX ) || ( result == LONG_MIN ))) 200c624: 80 a6 c0 01 cmp %i3, %g1 <== NOT EXECUTED 200c628: 32 bf ff f4 bne,a 200c5f8 <== NOT EXECUTED 200c62c: f6 26 40 00 st %i3, [ %i1 ] <== NOT EXECUTED 200c630: 30 bf ff f8 b,a 200c610 <== NOT EXECUTED =============================================================================== 0200c70c : const char *s, long *n, char **endptr, int base ) { 200c70c: 9d e3 bf 98 save %sp, -104, %sp 200c710: ba 10 00 18 mov %i0, %i5 long result; char *end; if ( !n ) 200c714: 80 a6 60 00 cmp %i1, 0 200c718: 02 80 00 1f be 200c794 200c71c: b0 10 20 09 mov 9, %i0 return RTEMS_INVALID_ADDRESS; errno = 0; 200c720: 40 00 0d 1d call 200fb94 <__errno> 200c724: 01 00 00 00 nop 200c728: c0 22 00 00 clr [ %o0 ] *n = 0; result = strtol( s, &end, base ); 200c72c: 94 10 00 1b mov %i3, %o2 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 200c730: c0 26 40 00 clr [ %i1 ] result = strtol( s, &end, base ); 200c734: 90 10 00 1d mov %i5, %o0 200c738: 40 00 19 34 call 2012c08 200c73c: 92 07 bf fc add %fp, -4, %o1 if ( endptr ) *endptr = end; 200c740: c2 07 bf fc ld [ %fp + -4 ], %g1 errno = 0; *n = 0; result = strtol( s, &end, base ); if ( endptr ) 200c744: 80 a6 a0 00 cmp %i2, 0 200c748: 02 80 00 03 be 200c754 200c74c: b6 10 00 08 mov %o0, %i3 *endptr = end; 200c750: c2 26 80 00 st %g1, [ %i2 ] if ( end == s ) 200c754: 80 a7 40 01 cmp %i5, %g1 200c758: 02 80 00 0f be 200c794 200c75c: b0 10 20 0b mov 0xb, %i0 return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c760: 40 00 0d 0d call 200fb94 <__errno> 200c764: 01 00 00 00 nop 200c768: c2 02 00 00 ld [ %o0 ], %g1 200c76c: 80 a0 60 22 cmp %g1, 0x22 200c770: 02 80 00 05 be 200c784 200c774: 03 20 00 00 sethi %hi(0x80000000), %g1 (( result == 0 ) || ( result == LONG_MAX ) || ( result == LONG_MIN ))) return RTEMS_INVALID_NUMBER; *n = result; 200c778: f6 26 40 00 st %i3, [ %i1 ] return RTEMS_SUCCESSFUL; 200c77c: 81 c7 e0 08 ret 200c780: 91 e8 20 00 restore %g0, 0, %o0 if ( end == s ) return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && (( result == 0 ) || ( result == LONG_MAX ) || ( result == LONG_MIN ))) 200c784: 82 38 40 1b xnor %g1, %i3, %g1 *endptr = end; if ( end == s ) return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c788: 80 a0 60 00 cmp %g1, 0 200c78c: 12 80 00 04 bne 200c79c 200c790: b0 10 20 0a mov 0xa, %i0 return RTEMS_INVALID_NUMBER; *n = result; return RTEMS_SUCCESSFUL; } 200c794: 81 c7 e0 08 ret 200c798: 81 e8 00 00 restore *endptr = end; if ( end == s ) return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c79c: 80 a6 e0 00 cmp %i3, 0 200c7a0: 02 bf ff fd be 200c794 <== NEVER TAKEN 200c7a4: 03 20 00 00 sethi %hi(0x80000000), %g1 (( result == 0 ) || ( result == LONG_MAX ) || ( result == LONG_MIN ))) 200c7a8: 80 a6 c0 01 cmp %i3, %g1 200c7ac: 32 bf ff f4 bne,a 200c77c <== NEVER TAKEN 200c7b0: f6 26 40 00 st %i3, [ %i1 ] <== NOT EXECUTED 200c7b4: 30 bf ff f8 b,a 200c794 =============================================================================== 0200c634 : const char *s, long long *n, char **endptr, int base ) { 200c634: 9d e3 bf 98 save %sp, -104, %sp long long result; char *end; if ( !n ) 200c638: 80 a6 60 00 cmp %i1, 0 200c63c: 02 80 00 1c be 200c6ac 200c640: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; errno = 0; 200c644: 40 00 0d 54 call 200fb94 <__errno> 200c648: 01 00 00 00 nop 200c64c: c0 22 00 00 clr [ %o0 ] *n = 0; 200c650: c0 26 40 00 clr [ %i1 ] 200c654: c0 26 60 04 clr [ %i1 + 4 ] result = strtoll( s, &end, base ); 200c658: 90 10 00 18 mov %i0, %o0 200c65c: 92 07 bf fc add %fp, -4, %o1 200c660: 40 00 19 73 call 2012c2c 200c664: 94 10 00 1b mov %i3, %o2 if ( endptr ) *endptr = end; 200c668: c4 07 bf fc ld [ %fp + -4 ], %g2 return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; result = strtoll( s, &end, base ); 200c66c: b8 10 00 08 mov %o0, %i4 if ( endptr ) 200c670: 80 a6 a0 00 cmp %i2, 0 200c674: 02 80 00 03 be 200c680 200c678: ba 10 00 09 mov %o1, %i5 *endptr = end; 200c67c: c4 26 80 00 st %g2, [ %i2 ] if ( end == s ) 200c680: 80 a6 00 02 cmp %i0, %g2 200c684: 02 80 00 0a be 200c6ac 200c688: 82 10 20 0b mov 0xb, %g1 return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c68c: 40 00 0d 42 call 200fb94 <__errno> 200c690: 01 00 00 00 nop 200c694: c2 02 00 00 ld [ %o0 ], %g1 200c698: 80 a0 60 22 cmp %g1, 0x22 200c69c: 02 80 00 06 be 200c6b4 200c6a0: 05 1f ff ff sethi %hi(0x7ffffc00), %g2 (( result == 0 ) || ( result == LONG_LONG_MAX ) || ( result == LONG_LONG_MIN ))) return RTEMS_INVALID_NUMBER; *n = result; 200c6a4: f8 3e 40 00 std %i4, [ %i1 ] return RTEMS_SUCCESSFUL; 200c6a8: 82 10 20 00 clr %g1 } 200c6ac: 81 c7 e0 08 ret 200c6b0: 91 e8 00 01 restore %g0, %g1, %o0 if ( end == s ) return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && (( result == 0 ) || ( result == LONG_LONG_MAX ) || ( result == LONG_LONG_MIN ))) 200c6b4: 07 3f ff ff sethi %hi(0xfffffc00), %g3 200c6b8: 84 10 a3 ff or %g2, 0x3ff, %g2 200c6bc: 86 10 e3 ff or %g3, 0x3ff, %g3 200c6c0: 84 1f 00 02 xor %i4, %g2, %g2 200c6c4: 86 1f 40 03 xor %i5, %g3, %g3 *endptr = end; if ( end == s ) return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c6c8: 80 90 80 03 orcc %g2, %g3, %g0 200c6cc: 12 80 00 04 bne 200c6dc 200c6d0: 80 97 00 1d orcc %i4, %i5, %g0 (( result == 0 ) || ( result == LONG_LONG_MAX ) || ( result == LONG_LONG_MIN ))) return RTEMS_INVALID_NUMBER; 200c6d4: 10 bf ff f6 b 200c6ac 200c6d8: 82 10 20 0a mov 0xa, %g1 *endptr = end; if ( end == s ) return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c6dc: 02 bf ff f4 be 200c6ac <== NEVER TAKEN 200c6e0: 82 10 20 0a mov 0xa, %g1 (( result == 0 ) || ( result == LONG_LONG_MAX ) || ( result == LONG_LONG_MIN ))) 200c6e4: 03 20 00 00 sethi %hi(0x80000000), %g1 200c6e8: 80 a7 00 01 cmp %i4, %g1 200c6ec: 32 bf ff ef bne,a 200c6a8 <== NEVER TAKEN 200c6f0: f8 3e 40 00 std %i4, [ %i1 ] <== NOT EXECUTED 200c6f4: 80 a7 60 00 cmp %i5, 0 200c6f8: 22 bf ff ed be,a 200c6ac <== ALWAYS TAKEN 200c6fc: 82 10 20 0a mov 0xa, %g1 return RTEMS_INVALID_NUMBER; *n = result; 200c700: f8 3e 40 00 std %i4, [ %i1 ] <== NOT EXECUTED return RTEMS_SUCCESSFUL; 200c704: 10 bf ff ea b 200c6ac <== NOT EXECUTED 200c708: 82 10 20 00 clr %g1 <== NOT EXECUTED =============================================================================== 0200c7c8 : const char *s, unsigned char *n, char **endptr, int base ) { 200c7c8: 9d e3 bf 98 save %sp, -104, %sp 200c7cc: ba 10 00 18 mov %i0, %i5 unsigned long result; char *end; if ( !n ) 200c7d0: 80 a6 60 00 cmp %i1, 0 200c7d4: 02 80 00 22 be 200c85c 200c7d8: b0 10 20 09 mov 9, %i0 return RTEMS_INVALID_ADDRESS; errno = 0; 200c7dc: 40 00 0c ee call 200fb94 <__errno> 200c7e0: 01 00 00 00 nop 200c7e4: c0 22 00 00 clr [ %o0 ] *n = 0; result = strtoul( s, &end, base ); 200c7e8: 94 10 00 1b mov %i3, %o2 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 200c7ec: c0 2e 40 00 clrb [ %i1 ] result = strtoul( s, &end, base ); 200c7f0: 90 10 00 1d mov %i5, %o0 200c7f4: 40 00 1a 5e call 201316c 200c7f8: 92 07 bf fc add %fp, -4, %o1 if ( endptr ) *endptr = end; 200c7fc: c2 07 bf fc ld [ %fp + -4 ], %g1 errno = 0; *n = 0; result = strtoul( s, &end, base ); if ( endptr ) 200c800: 80 a6 a0 00 cmp %i2, 0 200c804: 02 80 00 03 be 200c810 200c808: b6 10 00 08 mov %o0, %i3 *endptr = end; 200c80c: c2 26 80 00 st %g1, [ %i2 ] if ( end == s ) 200c810: 80 a7 40 01 cmp %i5, %g1 200c814: 02 80 00 12 be 200c85c 200c818: b0 10 20 0b mov 0xb, %i0 return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c81c: 40 00 0c de call 200fb94 <__errno> 200c820: 01 00 00 00 nop 200c824: c2 02 00 00 ld [ %o0 ], %g1 200c828: 80 a0 60 22 cmp %g1, 0x22 200c82c: 02 80 00 0e be 200c864 <== NEVER TAKEN 200c830: 82 06 ff ff add %i3, -1, %g1 (( result == 0 ) || ( result == ULONG_MAX ))) return RTEMS_INVALID_NUMBER; #if (UCHAR_MAX < ULONG_MAX) if ( result > UCHAR_MAX ) { 200c834: 80 a6 e0 ff cmp %i3, 0xff 200c838: 18 80 00 05 bgu 200c84c <== NEVER TAKEN 200c83c: 01 00 00 00 nop errno = ERANGE; return RTEMS_INVALID_NUMBER; } #endif *n = result; 200c840: f6 2e 40 00 stb %i3, [ %i1 ] return RTEMS_SUCCESSFUL; } 200c844: 81 c7 e0 08 ret 200c848: 91 e8 20 00 restore %g0, 0, %o0 (( result == 0 ) || ( result == ULONG_MAX ))) return RTEMS_INVALID_NUMBER; #if (UCHAR_MAX < ULONG_MAX) if ( result > UCHAR_MAX ) { errno = ERANGE; 200c84c: 40 00 0c d2 call 200fb94 <__errno> <== NOT EXECUTED 200c850: b0 10 20 0a mov 0xa, %i0 <== NOT EXECUTED 200c854: 82 10 20 22 mov 0x22, %g1 <== NOT EXECUTED 200c858: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED return RTEMS_INVALID_NUMBER; 200c85c: 81 c7 e0 08 ret 200c860: 81 e8 00 00 restore *endptr = end; if ( end == s ) return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c864: 80 a0 7f fd cmp %g1, -3 <== NOT EXECUTED 200c868: 08 bf ff f3 bleu 200c834 <== NOT EXECUTED 200c86c: b0 10 20 0a mov 0xa, %i0 <== NOT EXECUTED #endif *n = result; return RTEMS_SUCCESSFUL; } 200c870: 81 c7 e0 08 ret <== NOT EXECUTED 200c874: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 0200c878 : const char *s, unsigned int *n, char **endptr, int base ) { 200c878: 9d e3 bf 98 save %sp, -104, %sp 200c87c: ba 10 00 18 mov %i0, %i5 unsigned long result; char *end; if ( !n ) 200c880: 80 a6 60 00 cmp %i1, 0 200c884: 02 80 00 1e be 200c8fc 200c888: b0 10 20 09 mov 9, %i0 return RTEMS_INVALID_ADDRESS; errno = 0; 200c88c: 40 00 0c c2 call 200fb94 <__errno> 200c890: 01 00 00 00 nop 200c894: c0 22 00 00 clr [ %o0 ] *n = 0; result = strtoul( s, &end, base ); 200c898: 94 10 00 1b mov %i3, %o2 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 200c89c: c0 26 40 00 clr [ %i1 ] result = strtoul( s, &end, base ); 200c8a0: 90 10 00 1d mov %i5, %o0 200c8a4: 40 00 1a 32 call 201316c 200c8a8: 92 07 bf fc add %fp, -4, %o1 if ( endptr ) *endptr = end; 200c8ac: c2 07 bf fc ld [ %fp + -4 ], %g1 errno = 0; *n = 0; result = strtoul( s, &end, base ); if ( endptr ) 200c8b0: 80 a6 a0 00 cmp %i2, 0 200c8b4: 02 80 00 03 be 200c8c0 200c8b8: b6 10 00 08 mov %o0, %i3 *endptr = end; 200c8bc: c2 26 80 00 st %g1, [ %i2 ] if ( end == s ) 200c8c0: 80 a7 40 01 cmp %i5, %g1 200c8c4: 02 80 00 0e be 200c8fc 200c8c8: b0 10 20 0b mov 0xb, %i0 return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c8cc: 40 00 0c b2 call 200fb94 <__errno> 200c8d0: 01 00 00 00 nop 200c8d4: c2 02 00 00 ld [ %o0 ], %g1 200c8d8: 80 a0 60 22 cmp %g1, 0x22 200c8dc: 02 80 00 05 be 200c8f0 200c8e0: 82 06 ff ff add %i3, -1, %g1 errno = ERANGE; return RTEMS_INVALID_NUMBER; } #endif *n = result; 200c8e4: f6 26 40 00 st %i3, [ %i1 ] return RTEMS_SUCCESSFUL; } 200c8e8: 81 c7 e0 08 ret 200c8ec: 91 e8 20 00 restore %g0, 0, %o0 *endptr = end; if ( end == s ) return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c8f0: 80 a0 7f fd cmp %g1, -3 200c8f4: 08 bf ff fc bleu 200c8e4 <== NEVER TAKEN 200c8f8: b0 10 20 0a mov 0xa, %i0 #endif *n = result; return RTEMS_SUCCESSFUL; } 200c8fc: 81 c7 e0 08 ret 200c900: 81 e8 00 00 restore =============================================================================== 0200c9a4 : const char *s, unsigned long *n, char **endptr, int base ) { 200c9a4: 9d e3 bf 98 save %sp, -104, %sp 200c9a8: ba 10 00 18 mov %i0, %i5 unsigned long result; char *end; if ( !n ) 200c9ac: 80 a6 60 00 cmp %i1, 0 200c9b0: 02 80 00 1e be 200ca28 200c9b4: b0 10 20 09 mov 9, %i0 return RTEMS_INVALID_ADDRESS; errno = 0; 200c9b8: 40 00 0c 77 call 200fb94 <__errno> 200c9bc: 01 00 00 00 nop 200c9c0: c0 22 00 00 clr [ %o0 ] *n = 0; result = strtoul( s, &end, base ); 200c9c4: 94 10 00 1b mov %i3, %o2 if ( !n ) return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; 200c9c8: c0 26 40 00 clr [ %i1 ] result = strtoul( s, &end, base ); 200c9cc: 90 10 00 1d mov %i5, %o0 200c9d0: 40 00 19 e7 call 201316c 200c9d4: 92 07 bf fc add %fp, -4, %o1 if ( endptr ) *endptr = end; 200c9d8: c2 07 bf fc ld [ %fp + -4 ], %g1 errno = 0; *n = 0; result = strtoul( s, &end, base ); if ( endptr ) 200c9dc: 80 a6 a0 00 cmp %i2, 0 200c9e0: 02 80 00 03 be 200c9ec 200c9e4: b6 10 00 08 mov %o0, %i3 *endptr = end; 200c9e8: c2 26 80 00 st %g1, [ %i2 ] if ( end == s ) 200c9ec: 80 a7 40 01 cmp %i5, %g1 200c9f0: 02 80 00 0e be 200ca28 200c9f4: b0 10 20 0b mov 0xb, %i0 return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c9f8: 40 00 0c 67 call 200fb94 <__errno> 200c9fc: 01 00 00 00 nop 200ca00: c2 02 00 00 ld [ %o0 ], %g1 200ca04: 80 a0 60 22 cmp %g1, 0x22 200ca08: 02 80 00 05 be 200ca1c 200ca0c: 82 06 ff ff add %i3, -1, %g1 (( result == 0 ) || ( result == ULONG_MAX ))) return RTEMS_INVALID_NUMBER; *n = result; 200ca10: f6 26 40 00 st %i3, [ %i1 ] return RTEMS_SUCCESSFUL; } 200ca14: 81 c7 e0 08 ret 200ca18: 91 e8 20 00 restore %g0, 0, %o0 *endptr = end; if ( end == s ) return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200ca1c: 80 a0 7f fd cmp %g1, -3 200ca20: 08 bf ff fc bleu 200ca10 <== NEVER TAKEN 200ca24: b0 10 20 0a mov 0xa, %i0 return RTEMS_INVALID_NUMBER; *n = result; return RTEMS_SUCCESSFUL; } 200ca28: 81 c7 e0 08 ret 200ca2c: 81 e8 00 00 restore =============================================================================== 0200c904 : const char *s, unsigned long long *n, char **endptr, int base ) { 200c904: 9d e3 bf 98 save %sp, -104, %sp unsigned long long result; char *end; if ( !n ) 200c908: 80 a6 60 00 cmp %i1, 0 200c90c: 02 80 00 1c be 200c97c 200c910: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; errno = 0; 200c914: 40 00 0c a0 call 200fb94 <__errno> 200c918: 01 00 00 00 nop 200c91c: c0 22 00 00 clr [ %o0 ] *n = 0; 200c920: c0 26 40 00 clr [ %i1 ] 200c924: c0 26 60 04 clr [ %i1 + 4 ] result = strtoull( s, &end, base ); 200c928: 90 10 00 18 mov %i0, %o0 200c92c: 92 07 bf fc add %fp, -4, %o1 200c930: 40 00 1a 18 call 2013190 200c934: 94 10 00 1b mov %i3, %o2 if ( endptr ) *endptr = end; 200c938: c4 07 bf fc ld [ %fp + -4 ], %g2 return RTEMS_INVALID_ADDRESS; errno = 0; *n = 0; result = strtoull( s, &end, base ); 200c93c: b8 10 00 08 mov %o0, %i4 if ( endptr ) 200c940: 80 a6 a0 00 cmp %i2, 0 200c944: 02 80 00 03 be 200c950 200c948: ba 10 00 09 mov %o1, %i5 *endptr = end; 200c94c: c4 26 80 00 st %g2, [ %i2 ] if ( end == s ) 200c950: 80 a6 00 02 cmp %i0, %g2 200c954: 02 80 00 0a be 200c97c 200c958: 82 10 20 0b mov 0xb, %g1 return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c95c: 40 00 0c 8e call 200fb94 <__errno> 200c960: 01 00 00 00 nop 200c964: c2 02 00 00 ld [ %o0 ], %g1 200c968: 80 a0 60 22 cmp %g1, 0x22 200c96c: 02 80 00 06 be 200c984 200c970: 86 87 7f ff addcc %i5, -1, %g3 (( result == 0 ) || ( result == ULONG_LONG_MAX ))) return RTEMS_INVALID_NUMBER; *n = result; 200c974: f8 3e 40 00 std %i4, [ %i1 ] return RTEMS_SUCCESSFUL; 200c978: 82 10 20 00 clr %g1 } 200c97c: 81 c7 e0 08 ret 200c980: 91 e8 00 01 restore %g0, %g1, %o0 if ( end == s ) return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && (( result == 0 ) || ( result == ULONG_LONG_MAX ))) 200c984: 84 47 3f ff addx %i4, -1, %g2 *endptr = end; if ( end == s ) return RTEMS_NOT_DEFINED; if ( ( errno == ERANGE ) && 200c988: 80 a0 bf ff cmp %g2, -1 200c98c: 12 bf ff fa bne 200c974 <== NEVER TAKEN 200c990: 80 a0 ff fd cmp %g3, -3 200c994: 18 bf ff fa bgu 200c97c <== ALWAYS TAKEN 200c998: 82 10 20 0a mov 0xa, %g1 (( result == 0 ) || ( result == ULONG_LONG_MAX ))) return RTEMS_INVALID_NUMBER; *n = result; 200c99c: 10 bf ff f7 b 200c978 <== NOT EXECUTED 200c9a0: f8 3e 40 00 std %i4, [ %i1 ] <== NOT EXECUTED =============================================================================== 02002650 : int rtems_tarfs_load( char *mountpoint, uint8_t *tar_image, size_t tar_size ) { 2002650: 9d e3 be 10 save %sp, -496, %sp int offset; unsigned long nblocks; IMFS_jnode_t *node; int status; status = rtems_filesystem_evaluate_path( 2002654: 40 00 47 58 call 20143b4 2002658: 90 10 00 18 mov %i0, %o0 int rtems_tarfs_load( char *mountpoint, uint8_t *tar_image, size_t tar_size ) { 200265c: ba 10 00 18 mov %i0, %i5 int offset; unsigned long nblocks; IMFS_jnode_t *node; int status; status = rtems_filesystem_evaluate_path( 2002660: 92 10 00 08 mov %o0, %o1 2002664: 94 10 20 00 clr %o2 2002668: 90 10 00 18 mov %i0, %o0 200266c: 96 07 bf d4 add %fp, -44, %o3 2002670: 40 00 02 e6 call 2003208 2002674: 98 10 20 00 clr %o4 strlen(mountpoint), 0, &root_loc, 0 ); if (status != 0) 2002678: b0 92 20 00 orcc %o0, 0, %i0 200267c: 12 80 00 75 bne 2002850 2002680: c2 07 bf e0 ld [ %fp + -32 ], %g1 return -1; if (root_loc.ops != &IMFS_ops && root_loc.ops != &fifoIMFS_ops) 2002684: 05 00 80 7f sethi %hi(0x201fc00), %g2 2002688: 84 10 a3 c0 or %g2, 0x3c0, %g2 ! 201ffc0 200268c: 80 a0 40 02 cmp %g1, %g2 2002690: 02 80 00 06 be 20026a8 2002694: 05 00 80 82 sethi %hi(0x2020800), %g2 2002698: 84 10 a0 7c or %g2, 0x7c, %g2 ! 202087c 200269c: 80 a0 40 02 cmp %g1, %g2 20026a0: 12 80 00 6a bne 2002848 <== ALWAYS TAKEN 20026a4: 01 00 00 00 nop 20026a8: a6 10 20 00 clr %l3 ! 0 /* * Read a header. */ hdr_ptr = (char *) &tar_image[offset]; offset += 512; if (strncmp(&hdr_ptr[257], "ustar", 5)) 20026ac: 21 00 80 80 sethi %hi(0x2020000), %l0 /* * Create an IMFS node structure pointing to tar image memory. */ offset = 0; while (1) { if (offset + 512 > tar_size) 20026b0: b8 04 e2 00 add %l3, 0x200, %i4 /* * Read a header. */ hdr_ptr = (char *) &tar_image[offset]; offset += 512; if (strncmp(&hdr_ptr[257], "ustar", 5)) 20026b4: a0 14 20 08 or %l0, 8, %l0 else if (linkflag == REGTYPE) { const char *name; loc = root_loc; if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { node = IMFS_create_node( 20026b8: 25 00 00 20 sethi %hi(0x8000), %l2 /* * Create an IMFS node structure pointing to tar image memory. */ offset = 0; while (1) { if (offset + 512 > tar_size) 20026bc: 80 a7 00 1a cmp %i4, %i2 20026c0: 18 80 00 29 bgu 2002764 <== NEVER TAKEN 20026c4: a2 10 20 2f mov 0x2f, %l1 break; /* * Read a header. */ hdr_ptr = (char *) &tar_image[offset]; 20026c8: a6 06 40 13 add %i1, %l3, %l3 offset += 512; if (strncmp(&hdr_ptr[257], "ustar", 5)) 20026cc: 92 10 00 10 mov %l0, %o1 20026d0: 90 04 e1 01 add %l3, 0x101, %o0 20026d4: 40 00 47 6e call 201448c 20026d8: 94 10 20 05 mov 5, %o2 20026dc: 80 a2 20 00 cmp %o0, 0 20026e0: 12 80 00 21 bne 2002764 20026e4: 94 10 20 63 mov 0x63, %o2 break; strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); 20026e8: 92 10 00 13 mov %l3, %o1 20026ec: 40 00 47 c7 call 2014608 20026f0: 90 07 bf 70 add %fp, -144, %o0 filename[MAX_NAME_FIELD_SIZE] = '\0'; linkflag = hdr_ptr[156]; file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8); 20026f4: 92 10 20 08 mov 8, %o1 offset += 512; if (strncmp(&hdr_ptr[257], "ustar", 5)) break; strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE); filename[MAX_NAME_FIELD_SIZE] = '\0'; 20026f8: c0 2f bf d3 clrb [ %fp + -45 ] linkflag = hdr_ptr[156]; 20026fc: ea 0c e0 9c ldub [ %l3 + 0x9c ], %l5 file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8); 2002700: 40 00 21 95 call 200ad54 <_rtems_octal2ulong> 2002704: 90 04 e0 64 add %l3, 0x64, %o0 file_size = _rtems_octal2ulong(&hdr_ptr[124], 12); 2002708: 92 10 20 0c mov 0xc, %o1 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); 200270c: a8 10 00 08 mov %o0, %l4 file_size = _rtems_octal2ulong(&hdr_ptr[124], 12); 2002710: 40 00 21 91 call 200ad54 <_rtems_octal2ulong> 2002714: 90 04 e0 7c add %l3, 0x7c, %o0 hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8); 2002718: 92 10 20 08 mov 8, %o1 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); 200271c: b6 10 00 08 mov %o0, %i3 hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8); 2002720: 40 00 21 8d call 200ad54 <_rtems_octal2ulong> 2002724: 90 04 e0 94 add %l3, 0x94, %o0 2002728: ac 10 00 08 mov %o0, %l6 if (_rtems_tar_header_checksum(hdr_ptr) != hdr_chksum) 200272c: 40 00 22 dc call 200b29c <_rtems_tar_header_checksum> 2002730: 90 10 00 13 mov %l3, %o0 2002734: 80 a2 00 16 cmp %o0, %l6 2002738: 12 80 00 0b bne 2002764 <== NEVER TAKEN 200273c: aa 0d 60 ff and %l5, 0xff, %l5 * 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) { 2002740: 80 a5 60 35 cmp %l5, 0x35 2002744: 02 80 00 20 be 20027c4 2002748: 80 a5 60 30 cmp %l5, 0x30 * 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) { 200274c: 02 80 00 08 be 200276c 2002750: a6 10 00 1c mov %i4, %l3 /* * Create an IMFS node structure pointing to tar image memory. */ offset = 0; while (1) { if (offset + 512 > tar_size) 2002754: b8 04 e2 00 add %l3, 0x200, %i4 2002758: 80 a7 00 1a cmp %i4, %i2 200275c: 08 bf ff dc bleu 20026cc <== ALWAYS TAKEN 2002760: a6 06 40 13 add %i1, %l3, %l3 nblocks = (((file_size) + 511) & ~511) / 512; offset += 512 * nblocks; } } return status; } 2002764: 81 c7 e0 08 ret 2002768: 81 e8 00 00 restore * should not have this path. */ else if (linkflag == REGTYPE) { const char *name; loc = root_loc; 200276c: c2 07 bf d4 ld [ %fp + -44 ], %g1 if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { 2002770: 90 07 bf 70 add %fp, -144, %o0 * should not have this path. */ else if (linkflag == REGTYPE) { const char *name; loc = root_loc; 2002774: c2 27 bf e8 st %g1, [ %fp + -24 ] 2002778: c2 07 bf d8 ld [ %fp + -40 ], %g1 if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { 200277c: 92 07 bf e8 add %fp, -24, %o1 * should not have this path. */ else if (linkflag == REGTYPE) { const char *name; loc = root_loc; 2002780: c2 27 bf ec st %g1, [ %fp + -20 ] 2002784: c2 07 bf dc ld [ %fp + -36 ], %g1 if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { 2002788: 94 07 bf fc add %fp, -4, %o2 * should not have this path. */ else if (linkflag == REGTYPE) { const char *name; loc = root_loc; 200278c: c2 27 bf f0 st %g1, [ %fp + -16 ] 2002790: c2 07 bf e0 ld [ %fp + -32 ], %g1 2002794: c2 27 bf f4 st %g1, [ %fp + -12 ] 2002798: c2 07 bf e4 ld [ %fp + -28 ], %g1 if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { 200279c: 40 00 25 6d call 200bd50 20027a0: c2 27 bf f8 st %g1, [ %fp + -8 ] 20027a4: 80 a2 20 00 cmp %o0, 0 20027a8: 02 80 00 1d be 200281c <== ALWAYS TAKEN 20027ac: d4 07 bf fc ld [ %fp + -4 ], %o2 ); node->info.linearfile.size = file_size; node->info.linearfile.direct = &tar_image[offset]; } nblocks = (((file_size) + 511) & ~511) / 512; 20027b0: b6 06 e1 ff add %i3, 0x1ff, %i3 offset += 512 * nblocks; 20027b4: b6 0e fe 00 and %i3, -512, %i3 20027b8: b8 06 c0 1c add %i3, %i4, %i4 0 ); if (status != 0) return -1; if (root_loc.ops != &IMFS_ops && root_loc.ops != &fifoIMFS_ops) 20027bc: 10 bf ff e6 b 2002754 20027c0: a6 10 00 1c mov %i4, %l3 * - 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); 20027c4: 92 10 00 1d mov %i5, %o1 20027c8: 40 00 45 46 call 2013ce0 20027cc: 90 07 be 70 add %fp, -400, %o0 if (full_filename[strlen(full_filename)-1] != '/') 20027d0: 40 00 46 f9 call 20143b4 20027d4: 90 07 be 70 add %fp, -400, %o0 20027d8: 82 07 80 08 add %fp, %o0, %g1 20027dc: c2 48 7e 6f ldsb [ %g1 + -401 ], %g1 20027e0: 80 a0 60 2f cmp %g1, 0x2f 20027e4: 02 80 00 05 be 20027f8 <== ALWAYS TAKEN 20027e8: 82 07 be 70 add %fp, -400, %g1 strcat(full_filename, "/"); 20027ec: e2 28 40 08 stb %l1, [ %g1 + %o0 ] <== NOT EXECUTED 20027f0: 90 00 40 08 add %g1, %o0, %o0 <== NOT EXECUTED 20027f4: c0 2a 20 01 clrb [ %o0 + 1 ] <== NOT EXECUTED strcat(full_filename, filename); 20027f8: 92 07 bf 70 add %fp, -144, %o1 20027fc: 40 00 44 de call 2013b74 2002800: 90 07 be 70 add %fp, -400, %o0 mkdir(full_filename, S_IRWXU | S_IRWXG | S_IRWXO); 2002804: 90 07 be 70 add %fp, -400, %o0 2002808: 92 10 21 ff mov 0x1ff, %o1 200280c: 40 00 04 da call 2003b74 2002810: a6 10 00 1c mov %i4, %l3 /* * Create an IMFS node structure pointing to tar image memory. */ offset = 0; while (1) { if (offset + 512 > tar_size) 2002814: 10 bf ff d1 b 2002758 2002818: b8 04 e2 00 add %l3, 0x200, %i4 loc = root_loc; if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { node = IMFS_create_node( &loc, IMFS_LINEAR_FILE, (char *)name, (file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG, 200281c: 96 0d 21 ff and %l4, 0x1ff, %o3 else if (linkflag == REGTYPE) { const char *name; loc = root_loc; if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) { node = IMFS_create_node( 2002820: 90 07 bf e8 add %fp, -24, %o0 2002824: 92 10 20 06 mov 6, %o1 2002828: 96 12 c0 12 or %o3, %l2, %o3 200282c: 40 00 23 21 call 200b4b0 2002830: 98 10 20 00 clr %o4 IMFS_LINEAR_FILE, (char *)name, (file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG, NULL ); node->info.linearfile.size = file_size; node->info.linearfile.direct = &tar_image[offset]; 2002834: 82 06 40 1c add %i1, %i4, %g1 &loc, IMFS_LINEAR_FILE, (char *)name, (file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG, NULL ); node->info.linearfile.size = file_size; 2002838: c0 22 20 50 clr [ %o0 + 0x50 ] 200283c: f6 22 20 54 st %i3, [ %o0 + 0x54 ] node->info.linearfile.direct = &tar_image[offset]; 2002840: 10 bf ff dc b 20027b0 2002844: c2 22 20 58 st %g1, [ %o0 + 0x58 ] nblocks = (((file_size) + 511) & ~511) / 512; offset += 512 * nblocks; } } return status; } 2002848: 81 c7 e0 08 ret 200284c: 91 e8 3f ff restore %g0, -1, %o0 0, &root_loc, 0 ); if (status != 0) return -1; 2002850: 81 c7 e0 08 ret 2002854: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 0200f300 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 200f300: 9d e3 bf a0 save %sp, -96, %sp ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) 200f304: 80 a6 a0 00 cmp %i2, 0 200f308: 02 80 00 3b be 200f3f4 200f30c: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 200f310: 21 00 80 77 sethi %hi(0x201dc00), %l0 200f314: a0 14 22 88 or %l0, 0x288, %l0 ! 201de88 <_Per_CPU_Information> 200f318: fa 04 20 0c ld [ %l0 + 0xc ], %i5 api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 200f31c: c4 0f 60 74 ldub [ %i5 + 0x74 ], %g2 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 200f320: c2 07 60 7c ld [ %i5 + 0x7c ], %g1 executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 200f324: 80 a0 00 02 cmp %g0, %g2 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 200f328: f8 07 61 58 ld [ %i5 + 0x158 ], %i4 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 200f32c: b6 60 3f ff subx %g0, -1, %i3 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 200f330: 80 a0 60 00 cmp %g1, 0 200f334: 12 80 00 40 bne 200f434 200f338: b7 2e e0 08 sll %i3, 8, %i3 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 200f33c: c2 0f 20 08 ldub [ %i4 + 8 ], %g1 200f340: 80 a0 00 01 cmp %g0, %g1 old_mode |= _ISR_Get_level(); 200f344: 7f ff ed 4d call 200a878 <_CPU_ISR_Get_level> 200f348: a2 60 3f ff subx %g0, -1, %l1 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; 200f34c: a3 2c 60 0a sll %l1, 0xa, %l1 200f350: a2 14 40 08 or %l1, %o0, %l1 old_mode |= _ISR_Get_level(); 200f354: b6 14 40 1b or %l1, %i3, %i3 *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 200f358: 80 8e 61 00 btst 0x100, %i1 200f35c: 02 80 00 06 be 200f374 200f360: f6 26 80 00 st %i3, [ %i2 ] */ RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt ( Modes_Control mode_set ) { return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT; 200f364: 82 0e 21 00 and %i0, 0x100, %g1 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 200f368: 80 a0 00 01 cmp %g0, %g1 200f36c: 82 60 3f ff subx %g0, -1, %g1 200f370: c2 2f 60 74 stb %g1, [ %i5 + 0x74 ] if ( mask & RTEMS_TIMESLICE_MASK ) { 200f374: 80 8e 62 00 btst 0x200, %i1 200f378: 12 80 00 21 bne 200f3fc 200f37c: 80 8e 22 00 btst 0x200, %i0 } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 200f380: 80 8e 60 0f btst 0xf, %i1 200f384: 12 80 00 27 bne 200f420 200f388: 01 00 00 00 nop * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 200f38c: 80 8e 64 00 btst 0x400, %i1 200f390: 02 80 00 14 be 200f3e0 200f394: 86 10 20 00 clr %g3 is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 200f398: c4 0f 20 08 ldub [ %i4 + 8 ], %g2 */ RTEMS_INLINE_ROUTINE bool _Modes_Is_asr_disabled ( Modes_Control mode_set ) { return (mode_set & RTEMS_ASR_MASK) == RTEMS_NO_ASR; 200f39c: b0 0e 24 00 and %i0, 0x400, %i0 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 200f3a0: 80 a0 00 18 cmp %g0, %i0 200f3a4: 82 60 3f ff subx %g0, -1, %g1 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 ) { 200f3a8: 80 a0 80 01 cmp %g2, %g1 200f3ac: 22 80 00 0e be,a 200f3e4 200f3b0: 03 00 80 76 sethi %hi(0x201d800), %g1 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 200f3b4: 7f ff cb 75 call 2002188 200f3b8: c2 2f 20 08 stb %g1, [ %i4 + 8 ] _signals = information->signals_pending; 200f3bc: c4 07 20 18 ld [ %i4 + 0x18 ], %g2 information->signals_pending = information->signals_posted; 200f3c0: c2 07 20 14 ld [ %i4 + 0x14 ], %g1 information->signals_posted = _signals; 200f3c4: c4 27 20 14 st %g2, [ %i4 + 0x14 ] rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); _signals = information->signals_pending; information->signals_pending = information->signals_posted; 200f3c8: c2 27 20 18 st %g1, [ %i4 + 0x18 ] information->signals_posted = _signals; _ISR_Enable( _level ); 200f3cc: 7f ff cb 73 call 2002198 200f3d0: 01 00 00 00 nop asr->is_enabled = is_asr_enabled; _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { 200f3d4: c2 07 20 14 ld [ %i4 + 0x14 ], %g1 /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 200f3d8: 80 a0 00 01 cmp %g0, %g1 200f3dc: 86 40 20 00 addx %g0, 0, %g3 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 200f3e0: 03 00 80 76 sethi %hi(0x201d800), %g1 200f3e4: c4 00 62 ac ld [ %g1 + 0x2ac ], %g2 ! 201daac <_System_state_Current> 200f3e8: 80 a0 a0 03 cmp %g2, 3 200f3ec: 02 80 00 1f be 200f468 200f3f0: 82 10 20 00 clr %g1 if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; } 200f3f4: 81 c7 e0 08 ret 200f3f8: 91 e8 00 01 restore %g0, %g1, %o0 */ if ( mask & RTEMS_PREEMPT_MASK ) executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { 200f3fc: 22 bf ff e1 be,a 200f380 200f400: c0 27 60 7c clr [ %i5 + 0x7c ] executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 200f404: 03 00 80 76 sethi %hi(0x201d800), %g1 200f408: c2 00 60 b4 ld [ %g1 + 0xb4 ], %g1 ! 201d8b4 <_Thread_Ticks_per_timeslice> } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 200f40c: 80 8e 60 0f btst 0xf, %i1 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 200f410: c2 27 60 78 st %g1, [ %i5 + 0x78 ] if ( mask & RTEMS_PREEMPT_MASK ) executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 200f414: 82 10 20 01 mov 1, %g1 } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 200f418: 02 bf ff dd be 200f38c 200f41c: c2 27 60 7c st %g1, [ %i5 + 0x7c ] */ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level ( Modes_Control mode_set ) { return ( mode_set & RTEMS_INTERRUPT_MASK ); 200f420: 90 0e 20 0f and %i0, 0xf, %o0 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 200f424: 7f ff cb 5d call 2002198 200f428: 91 2a 20 08 sll %o0, 8, %o0 * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 200f42c: 10 bf ff d9 b 200f390 200f430: 80 8e 64 00 btst 0x400, %i1 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; 200f434: c2 0f 20 08 ldub [ %i4 + 8 ], %g1 old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 200f438: b6 16 e2 00 or %i3, 0x200, %i3 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 200f43c: 80 a0 00 01 cmp %g0, %g1 old_mode |= _ISR_Get_level(); 200f440: 7f ff ed 0e call 200a878 <_CPU_ISR_Get_level> 200f444: a2 60 3f ff subx %g0, -1, %l1 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; 200f448: a3 2c 60 0a sll %l1, 0xa, %l1 200f44c: a2 14 40 08 or %l1, %o0, %l1 old_mode |= _ISR_Get_level(); 200f450: b6 14 40 1b or %l1, %i3, %i3 *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 200f454: 80 8e 61 00 btst 0x100, %i1 200f458: 02 bf ff c7 be 200f374 200f45c: f6 26 80 00 st %i3, [ %i2 ] */ RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt ( Modes_Control mode_set ) { return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT; 200f460: 10 bf ff c2 b 200f368 200f464: 82 0e 21 00 and %i0, 0x100, %g1 { Thread_Control *executing; executing = _Thread_Executing; if ( are_signals_pending || 200f468: 80 88 e0 ff btst 0xff, %g3 200f46c: 12 80 00 0a bne 200f494 200f470: c4 04 20 0c ld [ %l0 + 0xc ], %g2 200f474: c6 04 20 10 ld [ %l0 + 0x10 ], %g3 200f478: 80 a0 80 03 cmp %g2, %g3 200f47c: 02 bf ff de be 200f3f4 200f480: 01 00 00 00 nop (!_Thread_Is_heir( executing ) && executing->is_preemptible) ) { 200f484: c4 08 a0 74 ldub [ %g2 + 0x74 ], %g2 200f488: 80 a0 a0 00 cmp %g2, 0 200f48c: 02 bf ff da be 200f3f4 <== NEVER TAKEN 200f490: 01 00 00 00 nop _Thread_Dispatch_necessary = true; 200f494: 82 10 20 01 mov 1, %g1 ! 1 200f498: c2 2c 20 18 stb %g1, [ %l0 + 0x18 ] } } if ( _System_state_Is_up( _System_state_Get() ) ) { if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); 200f49c: 7f ff e7 20 call 200911c <_Thread_Dispatch> 200f4a0: 01 00 00 00 nop } return RTEMS_SUCCESSFUL; 200f4a4: 82 10 20 00 clr %g1 ! 0 } 200f4a8: 81 c7 e0 08 ret 200f4ac: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 0200b1ac : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 200b1ac: 9d e3 bf 98 save %sp, -104, %sp register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 200b1b0: 80 a6 60 00 cmp %i1, 0 200b1b4: 02 80 00 07 be 200b1d0 200b1b8: 90 10 00 18 mov %i0, %o0 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 ) ); 200b1bc: 03 00 80 69 sethi %hi(0x201a400), %g1 200b1c0: c2 08 63 cc ldub [ %g1 + 0x3cc ], %g1 ! 201a7cc */ RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && 200b1c4: 80 a6 40 01 cmp %i1, %g1 200b1c8: 18 80 00 1c bgu 200b238 200b1cc: b0 10 20 13 mov 0x13, %i0 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 200b1d0: 80 a6 a0 00 cmp %i2, 0 200b1d4: 02 80 00 19 be 200b238 200b1d8: b0 10 20 09 mov 9, %i0 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 200b1dc: 40 00 09 df call 200d958 <_Thread_Get> 200b1e0: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 200b1e4: c2 07 bf fc ld [ %fp + -4 ], %g1 200b1e8: 80 a0 60 00 cmp %g1, 0 200b1ec: 12 80 00 13 bne 200b238 200b1f0: b0 10 20 04 mov 4, %i0 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 200b1f4: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 200b1f8: 80 a6 60 00 cmp %i1, 0 200b1fc: 02 80 00 0d be 200b230 200b200: c2 26 80 00 st %g1, [ %i2 ] the_thread->real_priority = new_priority; if ( the_thread->resource_count == 0 || 200b204: c2 02 20 1c ld [ %o0 + 0x1c ], %g1 200b208: 80 a0 60 00 cmp %g1, 0 200b20c: 02 80 00 06 be 200b224 200b210: f2 22 20 18 st %i1, [ %o0 + 0x18 ] 200b214: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 200b218: 80 a6 40 01 cmp %i1, %g1 200b21c: 1a 80 00 05 bcc 200b230 <== ALWAYS TAKEN 200b220: 01 00 00 00 nop the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 200b224: 92 10 00 19 mov %i1, %o1 200b228: 40 00 08 82 call 200d430 <_Thread_Change_priority> 200b22c: 94 10 20 00 clr %o2 } _Thread_Enable_dispatch(); 200b230: 40 00 09 be call 200d928 <_Thread_Enable_dispatch> 200b234: b0 10 20 00 clr %i0 return RTEMS_SUCCESSFUL; 200b238: 81 c7 e0 08 ret 200b23c: 81 e8 00 00 restore =============================================================================== 02007604 : rtems_status_code rtems_task_variable_delete( rtems_id tid, void **ptr ) { 2007604: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp, *prev; if ( !ptr ) 2007608: 80 a6 60 00 cmp %i1, 0 200760c: 02 80 00 1e be 2007684 2007610: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; prev = NULL; the_thread = _Thread_Get (tid, &location); 2007614: 90 10 00 18 mov %i0, %o0 2007618: 40 00 09 62 call 2009ba0 <_Thread_Get> 200761c: 92 07 bf fc add %fp, -4, %o1 switch (location) { 2007620: c2 07 bf fc ld [ %fp + -4 ], %g1 2007624: 80 a0 60 00 cmp %g1, 0 2007628: 12 80 00 19 bne 200768c 200762c: 82 10 20 04 mov 4, %g1 case OBJECTS_LOCAL: tvp = the_thread->task_variables; 2007630: c2 02 21 64 ld [ %o0 + 0x164 ], %g1 while (tvp) { 2007634: 80 a0 60 00 cmp %g1, 0 2007638: 02 80 00 10 be 2007678 200763c: 01 00 00 00 nop if (tvp->ptr == ptr) { 2007640: c4 00 60 04 ld [ %g1 + 4 ], %g2 2007644: 80 a0 80 19 cmp %g2, %i1 2007648: 32 80 00 09 bne,a 200766c 200764c: d2 00 40 00 ld [ %g1 ], %o1 if (prev) prev->next = tvp->next; else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; 2007650: 10 80 00 18 b 20076b0 2007654: c4 00 40 00 ld [ %g1 ], %g2 switch (location) { case OBJECTS_LOCAL: tvp = the_thread->task_variables; while (tvp) { if (tvp->ptr == ptr) { 2007658: 80 a0 80 19 cmp %g2, %i1 200765c: 22 80 00 0e be,a 2007694 2007660: c4 02 40 00 ld [ %o1 ], %g2 2007664: 82 10 00 09 mov %o1, %g1 _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; 2007668: d2 00 40 00 ld [ %g1 ], %o1 the_thread = _Thread_Get (tid, &location); switch (location) { case OBJECTS_LOCAL: tvp = the_thread->task_variables; while (tvp) { 200766c: 80 a2 60 00 cmp %o1, 0 2007670: 32 bf ff fa bne,a 2007658 <== ALWAYS TAKEN 2007674: c4 02 60 04 ld [ %o1 + 4 ], %g2 return RTEMS_SUCCESSFUL; } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 2007678: 40 00 09 3e call 2009b70 <_Thread_Enable_dispatch> 200767c: 01 00 00 00 nop return RTEMS_INVALID_ADDRESS; 2007680: 82 10 20 09 mov 9, %g1 ! 9 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 2007684: 81 c7 e0 08 ret 2007688: 91 e8 00 01 restore %g0, %g1, %o0 200768c: 81 c7 e0 08 ret 2007690: 91 e8 00 01 restore %g0, %g1, %o0 case OBJECTS_LOCAL: tvp = the_thread->task_variables; while (tvp) { if (tvp->ptr == ptr) { if (prev) prev->next = tvp->next; 2007694: c4 20 40 00 st %g2, [ %g1 ] else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); 2007698: 40 00 00 2d call 200774c <_RTEMS_Tasks_Invoke_task_variable_dtor> 200769c: 01 00 00 00 nop _Thread_Enable_dispatch(); 20076a0: 40 00 09 34 call 2009b70 <_Thread_Enable_dispatch> 20076a4: 01 00 00 00 nop return RTEMS_SUCCESSFUL; 20076a8: 10 bf ff f7 b 2007684 20076ac: 82 10 20 00 clr %g1 ! 0 while (tvp) { if (tvp->ptr == ptr) { if (prev) prev->next = tvp->next; else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; 20076b0: 92 10 00 01 mov %g1, %o1 20076b4: 10 bf ff f9 b 2007698 20076b8: c4 22 21 64 st %g2, [ %o0 + 0x164 ] =============================================================================== 020076bc : rtems_status_code rtems_task_variable_get( rtems_id tid, void **ptr, void **result ) { 20076bc: 9d e3 bf 98 save %sp, -104, %sp 20076c0: 90 10 00 18 mov %i0, %o0 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp; if ( !ptr ) 20076c4: 80 a6 60 00 cmp %i1, 0 20076c8: 02 80 00 1b be 2007734 20076cc: b0 10 20 09 mov 9, %i0 return RTEMS_INVALID_ADDRESS; if ( !result ) 20076d0: 80 a6 a0 00 cmp %i2, 0 20076d4: 02 80 00 1c be 2007744 20076d8: 01 00 00 00 nop return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 20076dc: 40 00 09 31 call 2009ba0 <_Thread_Get> 20076e0: 92 07 bf fc add %fp, -4, %o1 switch (location) { 20076e4: c2 07 bf fc ld [ %fp + -4 ], %g1 20076e8: 80 a0 60 00 cmp %g1, 0 20076ec: 12 80 00 12 bne 2007734 20076f0: b0 10 20 04 mov 4, %i0 case OBJECTS_LOCAL: /* * Figure out if the variable is in this task's list. */ tvp = the_thread->task_variables; 20076f4: c2 02 21 64 ld [ %o0 + 0x164 ], %g1 while (tvp) { 20076f8: 80 a0 60 00 cmp %g1, 0 20076fc: 32 80 00 07 bne,a 2007718 2007700: c4 00 60 04 ld [ %g1 + 4 ], %g2 2007704: 30 80 00 0e b,a 200773c 2007708: 80 a0 60 00 cmp %g1, 0 200770c: 02 80 00 0c be 200773c <== NEVER TAKEN 2007710: 01 00 00 00 nop if (tvp->ptr == ptr) { 2007714: c4 00 60 04 ld [ %g1 + 4 ], %g2 2007718: 80 a0 80 19 cmp %g2, %i1 200771c: 32 bf ff fb bne,a 2007708 2007720: c2 00 40 00 ld [ %g1 ], %g1 /* * Should this return the current (i.e not the * saved) value if `tid' is the current task? */ *result = tvp->tval; 2007724: c2 00 60 0c ld [ %g1 + 0xc ], %g1 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 2007728: b0 10 20 00 clr %i0 /* * Should this return the current (i.e not the * saved) value if `tid' is the current task? */ *result = tvp->tval; _Thread_Enable_dispatch(); 200772c: 40 00 09 11 call 2009b70 <_Thread_Enable_dispatch> 2007730: c2 26 80 00 st %g1, [ %i2 ] return RTEMS_SUCCESSFUL; 2007734: 81 c7 e0 08 ret 2007738: 81 e8 00 00 restore } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 200773c: 40 00 09 0d call 2009b70 <_Thread_Enable_dispatch> 2007740: b0 10 20 09 mov 9, %i0 return RTEMS_INVALID_ADDRESS; 2007744: 81 c7 e0 08 ret 2007748: 81 e8 00 00 restore =============================================================================== 020057d0 : #include int rtems_termios_baud_to_index( rtems_termios_baud_t termios_baud ) { 20057d0: 82 10 00 08 mov %o0, %g1 int baud_index; switch (termios_baud) { 20057d4: 80 a0 60 09 cmp %g1, 9 20057d8: 02 80 00 2d be 200588c 20057dc: 90 10 20 09 mov 9, %o0 20057e0: 80 a0 60 09 cmp %g1, 9 20057e4: 04 80 00 1a ble 200584c 20057e8: 80 a0 60 04 cmp %g1, 4 20057ec: 80 a0 60 0e cmp %g1, 0xe 20057f0: 02 80 00 27 be 200588c 20057f4: 90 10 20 0e mov 0xe, %o0 20057f8: 80 a0 60 0e cmp %g1, 0xe 20057fc: 04 80 00 26 ble 2005894 2005800: 80 a0 60 0b cmp %g1, 0xb 2005804: 05 00 00 04 sethi %hi(0x1000), %g2 2005808: 86 10 a0 02 or %g2, 2, %g3 ! 1002 200580c: 80 a0 40 03 cmp %g1, %g3 2005810: 02 80 00 1f be 200588c 2005814: 90 10 20 11 mov 0x11, %o0 2005818: 80 a0 40 03 cmp %g1, %g3 200581c: 04 80 00 38 ble 20058fc 2005820: 80 a0 60 0f cmp %g1, 0xf 2005824: 86 10 a0 03 or %g2, 3, %g3 2005828: 80 a0 40 03 cmp %g1, %g3 200582c: 02 80 00 18 be 200588c 2005830: 90 10 20 12 mov 0x12, %o0 2005834: 84 10 a0 04 or %g2, 4, %g2 2005838: 80 a0 40 02 cmp %g1, %g2 200583c: 02 80 00 14 be 200588c <== ALWAYS TAKEN 2005840: 90 10 20 13 mov 0x13, %o0 case B460800: baud_index = 19; break; default: baud_index = -1; break; } return baud_index; } 2005844: 81 c3 e0 08 retl 2005848: 90 10 3f ff mov -1, %o0 rtems_termios_baud_t termios_baud ) { int baud_index; switch (termios_baud) { 200584c: 02 80 00 10 be 200588c 2005850: 90 10 20 04 mov 4, %o0 2005854: 80 a0 60 04 cmp %g1, 4 2005858: 14 80 00 1c bg 20058c8 200585c: 80 a0 60 06 cmp %g1, 6 2005860: 80 a0 60 01 cmp %g1, 1 2005864: 02 80 00 0a be 200588c 2005868: 90 10 20 01 mov 1, %o0 200586c: 80 a0 60 01 cmp %g1, 1 2005870: 04 80 00 2b ble 200591c 2005874: 80 a0 60 02 cmp %g1, 2 2005878: 02 80 00 05 be 200588c 200587c: 90 10 20 02 mov 2, %o0 2005880: 80 a0 60 03 cmp %g1, 3 2005884: 12 bf ff f0 bne 2005844 <== NEVER TAKEN 2005888: 90 10 20 03 mov 3, %o0 200588c: 81 c3 e0 08 retl 2005890: 01 00 00 00 nop 2005894: 02 bf ff fe be 200588c 2005898: 90 10 20 0b mov 0xb, %o0 ! b 200589c: 80 a0 60 0b cmp %g1, 0xb 20058a0: 06 bf ff fb bl 200588c 20058a4: 90 10 20 0a mov 0xa, %o0 20058a8: 80 a0 60 0c cmp %g1, 0xc 20058ac: 02 bf ff f8 be 200588c 20058b0: 90 10 20 0c mov 0xc, %o0 20058b4: 80 a0 60 0d cmp %g1, 0xd 20058b8: 12 bf ff e3 bne 2005844 <== NEVER TAKEN 20058bc: 90 10 20 0d mov 0xd, %o0 20058c0: 81 c3 e0 08 retl 20058c4: 01 00 00 00 nop 20058c8: 02 bf ff f1 be 200588c 20058cc: 90 10 20 06 mov 6, %o0 ! 6 20058d0: 80 a0 60 06 cmp %g1, 6 20058d4: 06 bf ff ee bl 200588c 20058d8: 90 10 20 05 mov 5, %o0 20058dc: 80 a0 60 07 cmp %g1, 7 20058e0: 02 bf ff eb be 200588c 20058e4: 90 10 20 07 mov 7, %o0 20058e8: 80 a0 60 08 cmp %g1, 8 20058ec: 12 bf ff d6 bne 2005844 <== NEVER TAKEN 20058f0: 90 10 20 08 mov 8, %o0 20058f4: 81 c3 e0 08 retl 20058f8: 01 00 00 00 nop 20058fc: 02 bf ff e4 be 200588c 2005900: 90 10 20 0f mov 0xf, %o0 ! f 2005904: 84 10 a0 01 or %g2, 1, %g2 2005908: 80 a0 40 02 cmp %g1, %g2 200590c: 12 bf ff ce bne 2005844 <== NEVER TAKEN 2005910: 90 10 20 10 mov 0x10, %o0 2005914: 81 c3 e0 08 retl 2005918: 01 00 00 00 nop 200591c: 80 a0 60 00 cmp %g1, 0 2005920: 12 bf ff c9 bne 2005844 2005924: 90 10 20 00 clr %o0 case B460800: baud_index = 19; break; default: baud_index = -1; break; } return baud_index; } 2005928: 81 c3 e0 08 retl =============================================================================== 020043c4 : } } rtems_status_code rtems_termios_close (void *arg) { 20043c4: 9d e3 bf a0 save %sp, -96, %sp rtems_libio_open_close_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; rtems_status_code sc; sc = rtems_semaphore_obtain( 20043c8: 39 00 80 75 sethi %hi(0x201d400), %i4 rtems_status_code rtems_termios_close (void *arg) { rtems_libio_open_close_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 20043cc: c2 06 00 00 ld [ %i0 ], %g1 rtems_status_code sc; sc = rtems_semaphore_obtain( 20043d0: d0 07 23 d0 ld [ %i4 + 0x3d0 ], %o0 rtems_status_code rtems_termios_close (void *arg) { rtems_libio_open_close_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 20043d4: fa 00 60 38 ld [ %g1 + 0x38 ], %i5 rtems_status_code sc; sc = rtems_semaphore_obtain( 20043d8: 92 10 20 00 clr %o1 20043dc: 40 00 09 47 call 20068f8 20043e0: 94 10 20 00 clr %o2 rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 20043e4: 80 a2 20 00 cmp %o0, 0 20043e8: 12 80 00 6f bne 20045a4 <== NEVER TAKEN 20043ec: 01 00 00 00 nop rtems_fatal_error_occurred (sc); if (--tty->refcount == 0) { 20043f0: c2 07 60 08 ld [ %i5 + 8 ], %g1 20043f4: 82 00 7f ff add %g1, -1, %g1 20043f8: 80 a0 60 00 cmp %g1, 0 20043fc: 12 80 00 39 bne 20044e0 2004400: c2 27 60 08 st %g1, [ %i5 + 8 ] if (rtems_termios_linesw[tty->t_line].l_close != NULL) { 2004404: c4 07 60 cc ld [ %i5 + 0xcc ], %g2 2004408: 03 00 80 75 sethi %hi(0x201d400), %g1 200440c: 85 28 a0 05 sll %g2, 5, %g2 2004410: 82 10 61 00 or %g1, 0x100, %g1 2004414: 82 00 40 02 add %g1, %g2, %g1 2004418: c2 00 60 04 ld [ %g1 + 4 ], %g1 200441c: 80 a0 60 00 cmp %g1, 0 2004420: 22 80 00 45 be,a 2004534 2004424: d0 07 60 18 ld [ %i5 + 0x18 ], %o0 /* * call discipline-specific close */ sc = rtems_termios_linesw[tty->t_line].l_close(tty); 2004428: 9f c0 40 00 call %g1 200442c: 90 10 00 1d mov %i5, %o0 } drainOutput (tty); rtems_semaphore_release (tty->osem); } if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 2004430: c2 07 60 b4 ld [ %i5 + 0xb4 ], %g1 2004434: 80 a0 60 02 cmp %g1, 2 2004438: 22 80 00 50 be,a 2004578 <== NEVER TAKEN 200443c: d0 07 60 c4 ld [ %i5 + 0xc4 ], %o0 <== NOT EXECUTED rtems_fatal_error_occurred (sc); sc = rtems_event_send( tty->txTaskId, TERMIOS_TX_TERMINATE_EVENT ); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); } if (tty->device.lastClose) 2004440: c2 07 60 9c ld [ %i5 + 0x9c ], %g1 2004444: 80 a0 60 00 cmp %g1, 0 2004448: 22 80 00 07 be,a 2004464 <== ALWAYS TAKEN 200444c: c2 07 40 00 ld [ %i5 ], %g1 (*tty->device.lastClose)(tty->major, tty->minor, arg); 2004450: d0 07 60 0c ld [ %i5 + 0xc ], %o0 <== NOT EXECUTED 2004454: d2 07 60 10 ld [ %i5 + 0x10 ], %o1 <== NOT EXECUTED 2004458: 9f c0 40 00 call %g1 <== NOT EXECUTED 200445c: 94 10 00 18 mov %i0, %o2 <== NOT EXECUTED if (tty->forw == NULL) { 2004460: c2 07 40 00 ld [ %i5 ], %g1 <== NOT EXECUTED 2004464: 80 a0 60 00 cmp %g1, 0 2004468: 02 80 00 2c be 2004518 200446c: c4 07 60 04 ld [ %i5 + 4 ], %g2 rtems_termios_ttyTail = tty->back; if ( rtems_termios_ttyTail != NULL ) { rtems_termios_ttyTail->forw = NULL; } } else { tty->forw->back = tty->back; 2004470: c4 20 60 04 st %g2, [ %g1 + 4 ] 2004474: c4 07 60 04 ld [ %i5 + 4 ], %g2 } if (tty->back == NULL) { 2004478: 80 a0 a0 00 cmp %g2, 0 200447c: 22 80 00 22 be,a 2004504 <== ALWAYS TAKEN 2004480: 05 00 80 75 sethi %hi(0x201d400), %g2 rtems_termios_ttyHead = tty->forw; if ( rtems_termios_ttyHead != NULL ) { rtems_termios_ttyHead->back = NULL; } } else { tty->back->forw = tty->forw; 2004484: c2 20 80 00 st %g1, [ %g2 ] } rtems_semaphore_delete (tty->isem); 2004488: 40 00 08 e5 call 200681c 200448c: d0 07 60 14 ld [ %i5 + 0x14 ], %o0 rtems_semaphore_delete (tty->osem); 2004490: 40 00 08 e3 call 200681c 2004494: d0 07 60 18 ld [ %i5 + 0x18 ], %o0 rtems_semaphore_delete (tty->rawOutBuf.Semaphore); 2004498: 40 00 08 e1 call 200681c 200449c: d0 07 60 8c ld [ %i5 + 0x8c ], %o0 if ((tty->device.pollRead == NULL) || 20044a0: c2 07 60 a0 ld [ %i5 + 0xa0 ], %g1 20044a4: 80 a0 60 00 cmp %g1, 0 20044a8: 02 80 00 13 be 20044f4 20044ac: 01 00 00 00 nop 20044b0: c2 07 60 b4 ld [ %i5 + 0xb4 ], %g1 20044b4: 80 a0 60 02 cmp %g1, 2 20044b8: 02 80 00 0f be 20044f4 20044bc: 01 00 00 00 nop (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)) rtems_semaphore_delete (tty->rawInBuf.Semaphore); free (tty->rawInBuf.theBuf); 20044c0: 7f ff fa 7d call 2002eb4 20044c4: d0 07 60 58 ld [ %i5 + 0x58 ], %o0 free (tty->rawOutBuf.theBuf); 20044c8: 7f ff fa 7b call 2002eb4 20044cc: d0 07 60 7c ld [ %i5 + 0x7c ], %o0 free (tty->cbuf); 20044d0: 7f ff fa 79 call 2002eb4 20044d4: d0 07 60 1c ld [ %i5 + 0x1c ], %o0 free (tty); 20044d8: 7f ff fa 77 call 2002eb4 20044dc: 90 10 00 1d mov %i5, %o0 } rtems_semaphore_release (rtems_termios_ttyMutex); 20044e0: d0 07 23 d0 ld [ %i4 + 0x3d0 ], %o0 20044e4: 40 00 09 4f call 2006a20 20044e8: b0 10 20 00 clr %i0 return RTEMS_SUCCESSFUL; } 20044ec: 81 c7 e0 08 ret 20044f0: 81 e8 00 00 restore rtems_semaphore_delete (tty->isem); rtems_semaphore_delete (tty->osem); rtems_semaphore_delete (tty->rawOutBuf.Semaphore); if ((tty->device.pollRead == NULL) || (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)) rtems_semaphore_delete (tty->rawInBuf.Semaphore); 20044f4: 40 00 08 ca call 200681c 20044f8: d0 07 60 68 ld [ %i5 + 0x68 ], %o0 20044fc: 30 bf ff f1 b,a 20044c0 } else { tty->forw->back = tty->back; } if (tty->back == NULL) { rtems_termios_ttyHead = tty->forw; 2004500: 05 00 80 75 sethi %hi(0x201d400), %g2 if ( rtems_termios_ttyHead != NULL ) { 2004504: 80 a0 60 00 cmp %g1, 0 2004508: 02 bf ff e0 be 2004488 200450c: c2 20 a3 d8 st %g1, [ %g2 + 0x3d8 ] rtems_termios_ttyHead->back = NULL; 2004510: 10 bf ff de b 2004488 2004514: c0 20 60 04 clr [ %g1 + 4 ] rtems_fatal_error_occurred (sc); } if (tty->device.lastClose) (*tty->device.lastClose)(tty->major, tty->minor, arg); if (tty->forw == NULL) { rtems_termios_ttyTail = tty->back; 2004518: 07 00 80 75 sethi %hi(0x201d400), %g3 if ( rtems_termios_ttyTail != NULL ) { 200451c: 80 a0 a0 00 cmp %g2, 0 2004520: 02 bf ff f8 be 2004500 2004524: c4 20 e3 d4 st %g2, [ %g3 + 0x3d4 ] rtems_termios_ttyTail->forw = NULL; 2004528: c0 20 80 00 clr [ %g2 ] 200452c: 10 bf ff d6 b 2004484 2004530: c2 07 40 00 ld [ %i5 ], %g1 sc = rtems_termios_linesw[tty->t_line].l_close(tty); } else { /* * default: just flush output buffer */ sc = rtems_semaphore_obtain(tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 2004534: 92 10 20 00 clr %o1 2004538: 40 00 08 f0 call 20068f8 200453c: 94 10 20 00 clr %o2 if (sc != RTEMS_SUCCESSFUL) { 2004540: 80 a2 20 00 cmp %o0, 0 2004544: 12 80 00 18 bne 20045a4 <== NEVER TAKEN 2004548: 01 00 00 00 nop drainOutput (struct rtems_termios_tty *tty) { rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { 200454c: c2 07 60 b4 ld [ %i5 + 0xb4 ], %g1 2004550: 80 a0 60 00 cmp %g1, 0 2004554: 12 80 00 16 bne 20045ac 2004558: 01 00 00 00 nop sc = rtems_semaphore_obtain(tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) { rtems_fatal_error_occurred (sc); } drainOutput (tty); rtems_semaphore_release (tty->osem); 200455c: 40 00 09 31 call 2006a20 2004560: d0 07 60 18 ld [ %i5 + 0x18 ], %o0 } if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 2004564: c2 07 60 b4 ld [ %i5 + 0xb4 ], %g1 2004568: 80 a0 60 02 cmp %g1, 2 200456c: 32 bf ff b6 bne,a 2004444 2004570: c2 07 60 9c ld [ %i5 + 0x9c ], %g1 /* * send "terminate" to I/O tasks */ sc = rtems_event_send( tty->rxTaskId, TERMIOS_RX_TERMINATE_EVENT ); 2004574: d0 07 60 c4 ld [ %i5 + 0xc4 ], %o0 2004578: 40 00 07 a1 call 20063fc 200457c: 92 10 20 01 mov 1, %o1 if (sc != RTEMS_SUCCESSFUL) 2004580: 80 a2 20 00 cmp %o0, 0 2004584: 12 80 00 08 bne 20045a4 <== NEVER TAKEN 2004588: 01 00 00 00 nop rtems_fatal_error_occurred (sc); sc = rtems_event_send( tty->txTaskId, TERMIOS_TX_TERMINATE_EVENT ); 200458c: d0 07 60 c8 ld [ %i5 + 0xc8 ], %o0 2004590: 40 00 07 9b call 20063fc 2004594: 92 10 20 01 mov 1, %o1 if (sc != RTEMS_SUCCESSFUL) 2004598: 80 a2 20 00 cmp %o0, 0 200459c: 22 bf ff aa be,a 2004444 <== ALWAYS TAKEN 20045a0: c2 07 60 9c ld [ %i5 + 0x9c ], %g1 rtems_fatal_error_occurred (sc); 20045a4: 40 00 0a 92 call 2006fec <== NOT EXECUTED 20045a8: 01 00 00 00 nop <== NOT EXECUTED drainOutput (struct rtems_termios_tty *tty) { rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { 20045ac: 7f ff fe 5d call 2003f20 20045b0: 90 10 00 1d mov %i5, %o0 20045b4: 30 bf ff ea b,a 200455c =============================================================================== 02005c8c : * for each transmitted character. * It returns number of characters left to transmit */ int rtems_termios_dequeue_characters (void *ttyp, int len) { 2005c8c: 9d e3 bf a0 save %sp, -96, %sp rtems_status_code sc; /* * sum up character count already sent */ tty->t_dqlen += len; 2005c90: c4 06 20 90 ld [ %i0 + 0x90 ], %g2 if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 2005c94: c2 06 20 b4 ld [ %i0 + 0xb4 ], %g1 rtems_status_code sc; /* * sum up character count already sent */ tty->t_dqlen += len; 2005c98: 84 00 80 19 add %g2, %i1, %g2 2005c9c: c4 26 20 90 st %g2, [ %i0 + 0x90 ] if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 2005ca0: 80 a0 60 02 cmp %g1, 2 2005ca4: 02 80 00 10 be 2005ce4 2005ca8: 90 10 00 18 mov %i0, %o0 if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); return 0; /* nothing to output in IRQ... */ } if (tty->t_line == PPPDISC ) { 2005cac: c2 06 20 cc ld [ %i0 + 0xcc ], %g1 2005cb0: 80 a0 60 05 cmp %g1, 5 2005cb4: 02 80 00 04 be 2005cc4 2005cb8: 03 00 80 75 sethi %hi(0x201d400), %g1 rtems_termios_linesw[tty->t_line].l_start(tty); } return 0; /* nothing to output in IRQ... */ } return rtems_termios_refill_transmitter(tty); 2005cbc: 7f ff ff 58 call 2005a1c 2005cc0: 81 e8 00 00 restore if (tty->t_line == PPPDISC ) { /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 2005cc4: c2 00 61 b4 ld [ %g1 + 0x1b4 ], %g1 2005cc8: 80 a0 60 00 cmp %g1, 0 2005ccc: 02 80 00 04 be 2005cdc <== NEVER TAKEN 2005cd0: 01 00 00 00 nop rtems_termios_linesw[tty->t_line].l_start(tty); 2005cd4: 9f c0 40 00 call %g1 2005cd8: 01 00 00 00 nop } return 0; /* nothing to output in IRQ... */ } return rtems_termios_refill_transmitter(tty); } 2005cdc: 81 c7 e0 08 ret 2005ce0: 91 e8 20 00 restore %g0, 0, %o0 if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { /* * send wake up to transmitter task */ sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT); 2005ce4: d0 06 20 c8 ld [ %i0 + 0xc8 ], %o0 2005ce8: 40 00 01 c5 call 20063fc 2005cec: 92 10 20 02 mov 2, %o1 if (sc != RTEMS_SUCCESSFUL) 2005cf0: 80 a2 20 00 cmp %o0, 0 2005cf4: 02 bf ff fa be 2005cdc <== ALWAYS TAKEN 2005cf8: 01 00 00 00 nop rtems_fatal_error_occurred (sc); 2005cfc: 40 00 04 bc call 2006fec <== NOT EXECUTED =============================================================================== 02005684 : * 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) { 2005684: 9d e3 bf a0 save %sp, -96, %sp 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) { 2005688: c2 06 20 cc ld [ %i0 + 0xcc ], %g1 200568c: 39 00 80 75 sethi %hi(0x201d400), %i4 2005690: 83 28 60 05 sll %g1, 5, %g1 2005694: b8 17 21 00 or %i4, 0x100, %i4 2005698: 82 07 00 01 add %i4, %g1, %g1 200569c: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 20056a0: 80 a0 60 00 cmp %g1, 0 20056a4: 02 80 00 27 be 2005740 20056a8: ba 10 00 18 mov %i0, %i5 while (len--) { 20056ac: 80 a6 a0 00 cmp %i2, 0 20056b0: 22 80 00 10 be,a 20056f0 <== NEVER TAKEN 20056b4: c2 07 60 e4 ld [ %i5 + 0xe4 ], %g1 <== NOT EXECUTED * NOTE: This routine runs in the context of the * 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) 20056b8: b4 06 bf ff add %i2, -1, %i2 20056bc: 10 80 00 06 b 20056d4 20056c0: b6 10 20 00 clr %i3 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--) { 20056c4: b6 06 e0 01 inc %i3 20056c8: 83 28 60 05 sll %g1, 5, %g1 20056cc: 82 07 00 01 add %i4, %g1, %g1 20056d0: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 c = *buf++; rtems_termios_linesw[tty->t_line].l_rint(c,tty); 20056d4: d0 4e 40 1b ldsb [ %i1 + %i3 ], %o0 20056d8: 9f c0 40 00 call %g1 20056dc: 92 10 00 1d mov %i5, %o1 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--) { 20056e0: 80 a6 c0 1a cmp %i3, %i2 20056e4: 32 bf ff f8 bne,a 20056c4 20056e8: c2 07 60 cc ld [ %i5 + 0xcc ], %g1 } /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { 20056ec: c2 07 60 e4 ld [ %i5 + 0xe4 ], %g1 20056f0: 80 a0 60 00 cmp %g1, 0 20056f4: 12 80 00 0b bne 2005720 <== NEVER TAKEN 20056f8: b0 10 20 00 clr %i0 20056fc: c2 07 60 dc ld [ %i5 + 0xdc ], %g1 2005700: 80 a0 60 00 cmp %g1, 0 2005704: 02 80 00 0d be 2005738 2005708: 01 00 00 00 nop (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); 200570c: d2 07 60 e0 ld [ %i5 + 0xe0 ], %o1 2005710: 9f c0 40 00 call %g1 2005714: 90 07 60 30 add %i5, 0x30, %o0 tty->tty_rcvwakeup = 1; 2005718: 82 10 20 01 mov 1, %g1 200571c: c2 27 60 e4 st %g1, [ %i5 + 0xe4 ] 2005720: 81 c7 e0 08 ret 2005724: 81 e8 00 00 restore } } } tty->rawInBufDropped += dropped; rtems_semaphore_release (tty->rawInBuf.Semaphore); 2005728: d0 07 60 68 ld [ %i5 + 0x68 ], %o0 } } } } tty->rawInBufDropped += dropped; 200572c: 82 00 40 18 add %g1, %i0, %g1 rtems_semaphore_release (tty->rawInBuf.Semaphore); 2005730: 40 00 04 bc call 2006a20 2005734: c2 27 60 78 st %g1, [ %i5 + 0x78 ] return dropped; } 2005738: 81 c7 e0 08 ret 200573c: 81 e8 00 00 restore * NOTE: This routine runs in the context of the * 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) 2005740: b4 06 40 1a add %i1, %i2, %i2 2005744: a0 10 20 00 clr %l0 2005748: b0 10 20 00 clr %i0 /* * 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); 200574c: a4 07 60 30 add %i5, 0x30, %l2 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, 2005750: a6 07 60 4a add %i5, 0x4a, %l3 tty->tty_rcvwakeup = 1; } return 0; } while (len--) { 2005754: 80 a6 40 1a cmp %i1, %i2 2005758: 22 bf ff f4 be,a 2005728 200575c: c2 07 60 78 ld [ %i5 + 0x78 ], %g1 c = *buf++; /* FIXME: implement IXANY: any character restarts output */ /* if incoming XON/XOFF controls outgoing stream: */ if (tty->flow_ctrl & FL_MDXON) { 2005760: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 } return 0; } while (len--) { c = *buf++; 2005764: f8 0e 40 00 ldub [ %i1 ], %i4 /* FIXME: implement IXANY: any character restarts output */ /* if incoming XON/XOFF controls outgoing stream: */ if (tty->flow_ctrl & FL_MDXON) { 2005768: 80 88 62 00 btst 0x200, %g1 200576c: 02 80 00 0b be 2005798 2005770: b2 06 60 01 inc %i1 /* if received char is V_STOP and V_START (both are equal value) */ if (c == tty->termios.c_cc[VSTOP]) { 2005774: c4 0f 60 4a ldub [ %i5 + 0x4a ], %g2 2005778: 83 2f 20 18 sll %i4, 0x18, %g1 200577c: 83 38 60 18 sra %g1, 0x18, %g1 2005780: 80 a0 40 02 cmp %g1, %g2 2005784: 02 80 00 54 be 20058d4 2005788: c4 0f 60 49 ldub [ %i5 + 0x49 ], %g2 /* stop output */ tty->flow_ctrl |= FL_ORCVXOF; } flow_rcv = true; } else if (c == tty->termios.c_cc[VSTART]) { 200578c: 80 a0 40 02 cmp %g1, %g2 2005790: 02 80 00 59 be 20058f4 <== NEVER TAKEN 2005794: 01 00 00 00 nop /* restart output */ tty->flow_ctrl &= ~FL_ORCVXOF; flow_rcv = true; } } if (flow_rcv) { 2005798: 80 8c 20 ff btst 0xff, %l0 200579c: 02 80 00 15 be 20057f0 <== ALWAYS TAKEN 20057a0: 01 00 00 00 nop /* restart output according to FL_ORCVXOF flag */ if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) { 20057a4: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 20057a8: 82 08 60 30 and %g1, 0x30, %g1 20057ac: 80 a0 60 20 cmp %g1, 0x20 20057b0: 12 bf ff ea bne 2005758 <== ALWAYS TAKEN 20057b4: 80 a6 40 1a cmp %i1, %i2 /* disable interrupts */ rtems_interrupt_disable(level); 20057b8: 7f ff f2 74 call 2002188 <== NOT EXECUTED 20057bc: 01 00 00 00 nop <== NOT EXECUTED 20057c0: b8 10 00 08 mov %o0, %i4 <== NOT EXECUTED tty->flow_ctrl &= ~FL_OSTOP; 20057c4: c4 07 60 b8 ld [ %i5 + 0xb8 ], %g2 <== NOT EXECUTED /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { 20057c8: c2 07 60 94 ld [ %i5 + 0x94 ], %g1 <== NOT EXECUTED if (flow_rcv) { /* restart output according to FL_ORCVXOF flag */ if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) { /* disable interrupts */ rtems_interrupt_disable(level); tty->flow_ctrl &= ~FL_OSTOP; 20057cc: 84 08 bf df and %g2, -33, %g2 <== NOT EXECUTED 20057d0: c4 27 60 b8 st %g2, [ %i5 + 0xb8 ] <== NOT EXECUTED /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { 20057d4: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 20057d8: 12 80 00 4f bne 2005914 <== NOT EXECUTED 20057dc: 01 00 00 00 nop <== NOT EXECUTED /* if chars available, call write function... */ (*tty->device.write)( tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1); } /* reenable interrupts */ rtems_interrupt_enable(level); 20057e0: 7f ff f2 6e call 2002198 <== NOT EXECUTED 20057e4: 90 10 00 1c mov %i4, %o0 <== NOT EXECUTED tty->tty_rcvwakeup = 1; } return 0; } while (len--) { 20057e8: 10 bf ff dc b 2005758 <== NOT EXECUTED 20057ec: 80 a6 40 1a cmp %i1, %i2 <== NOT EXECUTED } /* reenable interrupts */ rtems_interrupt_enable(level); } } else { newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size; 20057f0: d0 07 60 60 ld [ %i5 + 0x60 ], %o0 20057f4: d2 07 60 64 ld [ %i5 + 0x64 ], %o1 20057f8: 40 00 4c 95 call 2018a4c <.urem> 20057fc: 90 02 20 01 inc %o0 /* if chars_in_buffer > highwater */ rtems_interrupt_disable(level); 2005800: 7f ff f2 62 call 2002188 2005804: b6 10 00 08 mov %o0, %i3 2005808: a2 10 00 08 mov %o0, %l1 if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size) 200580c: c2 07 60 5c ld [ %i5 + 0x5c ], %g1 2005810: d0 07 60 64 ld [ %i5 + 0x64 ], %o0 % tty->rawInBuf.Size) > tty->highwater) && 2005814: d2 07 60 64 ld [ %i5 + 0x64 ], %o1 } } 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) 2005818: 90 22 00 01 sub %o0, %g1, %o0 % tty->rawInBuf.Size) > tty->highwater) && 200581c: 40 00 4c 8c call 2018a4c <.urem> 2005820: 90 02 00 1b add %o0, %i3, %o0 } } 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) 2005824: c2 07 60 c0 ld [ %i5 + 0xc0 ], %g1 2005828: 80 a2 00 01 cmp %o0, %g1 200582c: 08 80 00 13 bleu 2005878 <== ALWAYS TAKEN 2005830: 01 00 00 00 nop % tty->rawInBuf.Size) > tty->highwater) && !(tty->flow_ctrl & FL_IREQXOF)) { 2005834: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 <== 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) && 2005838: 80 88 60 01 btst 1, %g1 <== NOT EXECUTED 200583c: 12 80 00 0f bne 2005878 <== NOT EXECUTED 2005840: 01 00 00 00 nop <== NOT EXECUTED !(tty->flow_ctrl & FL_IREQXOF)) { /* incoming data stream should be stopped */ tty->flow_ctrl |= FL_IREQXOF; 2005844: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 <== NOT EXECUTED 2005848: 82 10 60 01 or %g1, 1, %g1 <== NOT EXECUTED 200584c: c2 27 60 b8 st %g1, [ %i5 + 0xb8 ] <== NOT EXECUTED if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF)) 2005850: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 <== NOT EXECUTED 2005854: 82 08 64 02 and %g1, 0x402, %g1 <== NOT EXECUTED 2005858: 80 a0 64 00 cmp %g1, 0x400 <== NOT EXECUTED == (FL_MDXOF ) ) { if ((tty->flow_ctrl & FL_OSTOP) || 200585c: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 <== NOT EXECUTED 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)) 2005860: 02 80 00 35 be 2005934 <== NOT EXECUTED 2005864: 80 88 60 20 btst 0x20, %g1 <== NOT EXECUTED /* call write function here */ tty->flow_ctrl |= FL_ISNTXOF; (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1); } } else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) { 2005868: 82 08 61 04 and %g1, 0x104, %g1 <== NOT EXECUTED 200586c: 80 a0 61 00 cmp %g1, 0x100 <== NOT EXECUTED 2005870: 02 80 00 40 be 2005970 <== NOT EXECUTED 2005874: 01 00 00 00 nop <== NOT EXECUTED } } } /* reenable interrupts */ rtems_interrupt_enable(level); 2005878: 7f ff f2 48 call 2002198 200587c: 90 10 00 11 mov %l1, %o0 if (newTail == tty->rawInBuf.Head) { 2005880: c2 07 60 5c ld [ %i5 + 0x5c ], %g1 2005884: 80 a0 40 1b cmp %g1, %i3 2005888: 22 bf ff b3 be,a 2005754 <== NEVER TAKEN 200588c: b0 06 20 01 inc %i0 <== NOT EXECUTED dropped++; } else { tty->rawInBuf.theBuf[newTail] = c; 2005890: c2 07 60 58 ld [ %i5 + 0x58 ], %g1 2005894: f8 28 40 1b stb %i4, [ %g1 + %i3 ] tty->rawInBuf.Tail = newTail; /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { 2005898: c2 07 60 e4 ld [ %i5 + 0xe4 ], %g1 if (newTail == tty->rawInBuf.Head) { dropped++; } else { tty->rawInBuf.theBuf[newTail] = c; tty->rawInBuf.Tail = newTail; 200589c: f6 27 60 60 st %i3, [ %i5 + 0x60 ] /* * check to see if rcv wakeup callback was set */ if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) { 20058a0: 80 a0 60 00 cmp %g1, 0 20058a4: 12 bf ff ad bne 2005758 <== NEVER TAKEN 20058a8: 80 a6 40 1a cmp %i1, %i2 20058ac: c2 07 60 dc ld [ %i5 + 0xdc ], %g1 20058b0: 80 a0 60 00 cmp %g1, 0 20058b4: 02 bf ff a9 be 2005758 <== ALWAYS TAKEN 20058b8: 80 a6 40 1a cmp %i1, %i2 (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); 20058bc: d2 07 60 e0 ld [ %i5 + 0xe0 ], %o1 <== NOT EXECUTED 20058c0: 9f c0 40 00 call %g1 <== NOT EXECUTED 20058c4: 90 10 00 12 mov %l2, %o0 <== NOT EXECUTED tty->tty_rcvwakeup = 1; 20058c8: 82 10 20 01 mov 1, %g1 <== NOT EXECUTED 20058cc: 10 bf ff a2 b 2005754 <== NOT EXECUTED 20058d0: c2 27 60 e4 st %g1, [ %i5 + 0xe4 ] <== NOT EXECUTED /* FIXME: implement IXANY: any character restarts output */ /* if incoming XON/XOFF controls outgoing stream: */ if (tty->flow_ctrl & FL_MDXON) { /* if received char is V_STOP and V_START (both are equal value) */ if (c == tty->termios.c_cc[VSTOP]) { if (c == tty->termios.c_cc[VSTART]) { 20058d4: 80 a0 40 02 cmp %g1, %g2 /* received VSTOP and VSTART==VSTOP? */ /* then toggle "stop output" status */ tty->flow_ctrl = tty->flow_ctrl ^ FL_ORCVXOF; 20058d8: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 /* FIXME: implement IXANY: any character restarts output */ /* if incoming XON/XOFF controls outgoing stream: */ if (tty->flow_ctrl & FL_MDXON) { /* if received char is V_STOP and V_START (both are equal value) */ if (c == tty->termios.c_cc[VSTOP]) { if (c == tty->termios.c_cc[VSTART]) { 20058dc: 22 80 00 0b be,a 2005908 <== NEVER TAKEN 20058e0: 82 18 60 10 xor %g1, 0x10, %g1 <== NOT EXECUTED tty->flow_ctrl = tty->flow_ctrl ^ FL_ORCVXOF; } else { /* VSTOP received (other code than VSTART) */ /* stop output */ tty->flow_ctrl |= FL_ORCVXOF; 20058e4: 82 10 60 10 or %g1, 0x10, %g1 * NOTE: This routine runs in the context of the * 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) 20058e8: a0 10 20 01 mov 1, %l0 tty->flow_ctrl = tty->flow_ctrl ^ FL_ORCVXOF; } else { /* VSTOP received (other code than VSTART) */ /* stop output */ tty->flow_ctrl |= FL_ORCVXOF; 20058ec: c2 27 60 b8 st %g1, [ %i5 + 0xb8 ] 20058f0: 30 bf ff ad b,a 20057a4 flow_rcv = true; } else if (c == tty->termios.c_cc[VSTART]) { /* VSTART received */ /* restart output */ tty->flow_ctrl &= ~FL_ORCVXOF; 20058f4: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 <== NOT EXECUTED * NOTE: This routine runs in the context of the * 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) 20058f8: a0 10 20 01 mov 1, %l0 <== NOT EXECUTED flow_rcv = true; } else if (c == tty->termios.c_cc[VSTART]) { /* VSTART received */ /* restart output */ tty->flow_ctrl &= ~FL_ORCVXOF; 20058fc: 82 08 7f ef and %g1, -17, %g1 <== NOT EXECUTED 2005900: c2 27 60 b8 st %g1, [ %i5 + 0xb8 ] <== NOT EXECUTED 2005904: 30 bf ff a8 b,a 20057a4 <== NOT EXECUTED * NOTE: This routine runs in the context of the * 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) 2005908: a0 10 20 01 mov 1, %l0 <== NOT EXECUTED /* if received char is V_STOP and V_START (both are equal value) */ if (c == tty->termios.c_cc[VSTOP]) { if (c == tty->termios.c_cc[VSTART]) { /* received VSTOP and VSTART==VSTOP? */ /* then toggle "stop output" status */ tty->flow_ctrl = tty->flow_ctrl ^ FL_ORCVXOF; 200590c: c2 27 60 b8 st %g1, [ %i5 + 0xb8 ] <== NOT EXECUTED 2005910: 30 bf ff a5 b,a 20057a4 <== NOT EXECUTED tty->flow_ctrl &= ~FL_OSTOP; /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { /* if chars available, call write function... */ (*tty->device.write)( tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1); 2005914: c4 07 60 84 ld [ %i5 + 0x84 ], %g2 <== 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)( 2005918: d2 07 60 7c ld [ %i5 + 0x7c ], %o1 <== NOT EXECUTED 200591c: c2 07 60 a4 ld [ %i5 + 0xa4 ], %g1 <== NOT EXECUTED 2005920: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 <== NOT EXECUTED 2005924: 92 02 40 02 add %o1, %g2, %o1 <== NOT EXECUTED 2005928: 9f c0 40 00 call %g1 <== NOT EXECUTED 200592c: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 2005930: 30 bf ff ac b,a 20057e0 <== NOT EXECUTED !(tty->flow_ctrl & FL_IREQXOF)) { /* incoming data stream should be stopped */ tty->flow_ctrl |= FL_IREQXOF; if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF)) == (FL_MDXOF ) ) { if ((tty->flow_ctrl & FL_OSTOP) || 2005934: 12 80 00 06 bne 200594c <== NOT EXECUTED 2005938: 01 00 00 00 nop <== NOT EXECUTED 200593c: c2 07 60 94 ld [ %i5 + 0x94 ], %g1 <== NOT EXECUTED 2005940: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 2005944: 12 bf ff cd bne 2005878 <== NOT EXECUTED 2005948: 01 00 00 00 nop <== 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; 200594c: c4 07 60 b8 ld [ %i5 + 0xb8 ], %g2 <== NOT EXECUTED (*tty->device.write)(tty->minor, 2005950: c2 07 60 a4 ld [ %i5 + 0xa4 ], %g1 <== NOT EXECUTED 2005954: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 <== 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; 2005958: 84 10 a0 02 or %g2, 2, %g2 <== NOT EXECUTED (*tty->device.write)(tty->minor, 200595c: 92 10 00 13 mov %l3, %o1 <== 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; 2005960: c4 27 60 b8 st %g2, [ %i5 + 0xb8 ] <== NOT EXECUTED (*tty->device.write)(tty->minor, 2005964: 9f c0 40 00 call %g1 <== NOT EXECUTED 2005968: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 200596c: 30 bf ff c3 b,a 2005878 <== NOT EXECUTED (void *)&(tty->termios.c_cc[VSTOP]), 1); } } else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) { tty->flow_ctrl |= FL_IRTSOFF; 2005970: c4 07 60 b8 ld [ %i5 + 0xb8 ], %g2 <== NOT EXECUTED /* deactivate RTS line */ if (tty->device.stopRemoteTx != NULL) { 2005974: c2 07 60 ac ld [ %i5 + 0xac ], %g1 <== 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; 2005978: 84 10 a0 04 or %g2, 4, %g2 <== NOT EXECUTED 200597c: c4 27 60 b8 st %g2, [ %i5 + 0xb8 ] <== NOT EXECUTED /* deactivate RTS line */ if (tty->device.stopRemoteTx != NULL) { 2005980: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 2005984: 02 bf ff bd be 2005878 <== NOT EXECUTED 2005988: 01 00 00 00 nop <== NOT EXECUTED tty->device.stopRemoteTx(tty->minor); 200598c: 9f c0 40 00 call %g1 <== NOT EXECUTED 2005990: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 <== NOT EXECUTED 2005994: 30 bf ff b9 b,a 2005878 <== NOT EXECUTED =============================================================================== 020045d8 : } } rtems_status_code rtems_termios_ioctl (void *arg) { 20045d8: 9d e3 bf a0 save %sp, -96, %sp rtems_libio_ioctl_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 20045dc: c2 06 00 00 ld [ %i0 ], %g1 struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer; 20045e0: f6 06 20 08 ld [ %i0 + 8 ], %i3 rtems_status_code rtems_termios_ioctl (void *arg) { rtems_libio_ioctl_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 20045e4: fa 00 60 38 ld [ %g1 + 0x38 ], %i5 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); 20045e8: 92 10 20 00 clr %o1 20045ec: d0 07 60 18 ld [ %i5 + 0x18 ], %o0 20045f0: 94 10 20 00 clr %o2 20045f4: 40 00 08 c1 call 20068f8 20045f8: c0 26 20 0c clr [ %i0 + 0xc ] if (sc != RTEMS_SUCCESSFUL) { 20045fc: b8 92 20 00 orcc %o0, 0, %i4 2004600: 32 80 00 1a bne,a 2004668 <== NEVER TAKEN 2004604: f8 26 20 0c st %i4, [ %i0 + 0xc ] <== NOT EXECUTED args->ioctl_return = sc; return sc; } switch (args->command) { 2004608: c2 06 20 04 ld [ %i0 + 4 ], %g1 200460c: 80 a0 60 04 cmp %g1, 4 2004610: 22 80 00 10 be,a 2004650 2004614: c2 06 c0 00 ld [ %i3 ], %g1 2004618: 18 80 00 16 bgu 2004670 200461c: 05 10 01 19 sethi %hi(0x40046400), %g2 2004620: 80 a0 60 02 cmp %g1, 2 2004624: 22 80 00 2a be,a 20046cc 2004628: d2 06 20 08 ld [ %i0 + 8 ], %o1 200462c: 08 80 00 99 bleu 2004890 2004630: 80 a0 60 01 cmp %g1, 1 drainOutput (struct rtems_termios_tty *tty) { rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { 2004634: c2 07 60 b4 ld [ %i5 + 0xb4 ], %g1 2004638: 80 a0 60 00 cmp %g1, 0 200463c: 02 80 00 08 be 200465c <== ALWAYS TAKEN 2004640: 01 00 00 00 nop 2004644: 7f ff fe 37 call 2003f20 <== NOT EXECUTED 2004648: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 200464c: 30 80 00 04 b,a 200465c <== NOT EXECUTED case RTEMS_IO_SNDWAKEUP: tty->tty_snd = *wakeup; break; case RTEMS_IO_RCVWAKEUP: tty->tty_rcv = *wakeup; 2004650: c2 27 60 dc st %g1, [ %i5 + 0xdc ] 2004654: c2 06 e0 04 ld [ %i3 + 4 ], %g1 2004658: c2 27 60 e0 st %g1, [ %i5 + 0xe0 ] *(int *)args->buffer = tty->ccount - tty->cindex + rawnc; } break; } rtems_semaphore_release (tty->osem); 200465c: 40 00 08 f1 call 2006a20 2004660: d0 07 60 18 ld [ %i5 + 0x18 ], %o0 args->ioctl_return = sc; 2004664: f8 26 20 0c st %i4, [ %i0 + 0xc ] return sc; } 2004668: 81 c7 e0 08 ret 200466c: 91 e8 00 1c restore %g0, %i4, %o0 sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) { args->ioctl_return = sc; return sc; } switch (args->command) { 2004670: 84 10 a2 7f or %g2, 0x27f, %g2 2004674: 80 a0 40 02 cmp %g1, %g2 2004678: 02 80 00 7a be 2004860 <== NEVER TAKEN 200467c: 01 00 00 00 nop 2004680: 18 80 00 8b bgu 20048ac 2004684: 05 10 01 1d sethi %hi(0x40047400), %g2 2004688: 80 a0 60 05 cmp %g1, 5 200468c: 22 80 00 ac be,a 200493c 2004690: c2 06 c0 00 ld [ %i3 ], %g1 default: if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) { 2004694: c4 07 60 cc ld [ %i5 + 0xcc ], %g2 2004698: 03 00 80 75 sethi %hi(0x201d400), %g1 200469c: 85 28 a0 05 sll %g2, 5, %g2 20046a0: 82 10 61 00 or %g1, 0x100, %g1 20046a4: 82 00 40 02 add %g1, %g2, %g1 20046a8: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 20046ac: 80 a0 60 00 cmp %g1, 0 20046b0: 02 bf ff eb be 200465c <== NEVER TAKEN 20046b4: b8 10 20 0a mov 0xa, %i4 sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args); 20046b8: 90 10 00 1d mov %i5, %o0 20046bc: 9f c0 40 00 call %g1 20046c0: 92 10 00 18 mov %i0, %o1 20046c4: 10 bf ff e6 b 200465c 20046c8: b8 10 00 08 mov %o0, %i4 case RTEMS_IO_GET_ATTRIBUTES: *(struct termios *)args->buffer = tty->termios; break; case RTEMS_IO_SET_ATTRIBUTES: tty->termios = *(struct termios *)args->buffer; 20046cc: b6 07 60 30 add %i5, 0x30, %i3 20046d0: 94 10 20 24 mov 0x24, %o2 20046d4: 40 00 2e eb call 2010280 20046d8: 90 10 00 1b mov %i3, %o0 /* * check for flow control options to be switched off */ /* check for outgoing XON/XOFF flow control switched off */ if (( tty->flow_ctrl & FL_MDXON) && 20046dc: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 20046e0: 80 88 62 00 btst 0x200, %g1 20046e4: 02 80 00 19 be 2004748 20046e8: 01 00 00 00 nop !(tty->termios.c_iflag & IXON)) { 20046ec: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 /* * check for flow control options to be switched off */ /* check for outgoing XON/XOFF flow control switched off */ if (( tty->flow_ctrl & FL_MDXON) && 20046f0: 80 88 64 00 btst 0x400, %g1 20046f4: 12 80 00 15 bne 2004748 20046f8: 01 00 00 00 nop !(tty->termios.c_iflag & IXON)) { /* clear related flags in flow_ctrl */ tty->flow_ctrl &= ~(FL_MDXON | FL_ORCVXOF); 20046fc: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 2004700: 82 08 7d ef and %g1, -529, %g1 2004704: c2 27 60 b8 st %g1, [ %i5 + 0xb8 ] /* has output been stopped due to received XOFF? */ if (tty->flow_ctrl & FL_OSTOP) { 2004708: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 200470c: 80 88 60 20 btst 0x20, %g1 2004710: 02 80 00 0e be 2004748 <== ALWAYS TAKEN 2004714: 01 00 00 00 nop /* disable interrupts */ rtems_interrupt_disable(level); 2004718: 7f ff f6 9c call 2002188 <== NOT EXECUTED 200471c: 01 00 00 00 nop <== NOT EXECUTED 2004720: b4 10 00 08 mov %o0, %i2 <== NOT EXECUTED tty->flow_ctrl &= ~FL_OSTOP; 2004724: c4 07 60 b8 ld [ %i5 + 0xb8 ], %g2 <== NOT EXECUTED /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { 2004728: c2 07 60 94 ld [ %i5 + 0x94 ], %g1 <== NOT EXECUTED /* has output been stopped due to received XOFF? */ if (tty->flow_ctrl & FL_OSTOP) { /* disable interrupts */ rtems_interrupt_disable(level); tty->flow_ctrl &= ~FL_OSTOP; 200472c: 84 08 bf df and %g2, -33, %g2 <== NOT EXECUTED 2004730: c4 27 60 b8 st %g2, [ %i5 + 0xb8 ] <== NOT EXECUTED /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { 2004734: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 2004738: 12 80 00 a4 bne 20049c8 <== NOT EXECUTED 200473c: 01 00 00 00 nop <== NOT EXECUTED /* if chars available, call write function... */ (*tty->device.write)( tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); } /* reenable interrupts */ rtems_interrupt_enable(level); 2004740: 7f ff f6 96 call 2002198 <== NOT EXECUTED 2004744: 90 10 00 1a mov %i2, %o0 <== NOT EXECUTED } } /* check for incoming XON/XOFF flow control switched off */ if (( tty->flow_ctrl & FL_MDXOF) && !(tty->termios.c_iflag & IXOFF)) { 2004748: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 200474c: 80 88 64 00 btst 0x400, %g1 2004750: 02 80 00 0c be 2004780 2004754: 03 00 00 04 sethi %hi(0x1000), %g1 2004758: c4 07 60 30 ld [ %i5 + 0x30 ], %g2 200475c: 80 88 80 01 btst %g2, %g1 2004760: 12 80 00 08 bne 2004780 <== NEVER TAKEN 2004764: 01 00 00 00 nop /* clear related flags in flow_ctrl */ tty->flow_ctrl &= ~(FL_MDXOF); 2004768: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 200476c: 82 08 7b ff and %g1, -1025, %g1 2004770: c2 27 60 b8 st %g1, [ %i5 + 0xb8 ] /* FIXME: what happens, if we had sent XOFF but not yet XON? */ tty->flow_ctrl &= ~(FL_ISNTXOF); 2004774: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 2004778: 82 08 7f fd and %g1, -3, %g1 200477c: c2 27 60 b8 st %g1, [ %i5 + 0xb8 ] } /* check for incoming RTS/CTS flow control switched off */ if (( tty->flow_ctrl & FL_MDRTS) && !(tty->termios.c_cflag & CRTSCTS)) { 2004780: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 2004784: 80 88 61 00 btst 0x100, %g1 2004788: 02 80 00 16 be 20047e0 <== ALWAYS TAKEN 200478c: c4 07 60 38 ld [ %i5 + 0x38 ], %g2 2004790: 80 a0 a0 00 cmp %g2, 0 <== NOT EXECUTED 2004794: 06 80 00 82 bl 200499c <== NOT EXECUTED 2004798: 01 00 00 00 nop <== NOT EXECUTED /* clear related flags in flow_ctrl */ tty->flow_ctrl &= ~(FL_MDRTS); 200479c: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 <== NOT EXECUTED 20047a0: 82 08 7e ff and %g1, -257, %g1 <== NOT EXECUTED 20047a4: c2 27 60 b8 st %g1, [ %i5 + 0xb8 ] <== NOT EXECUTED /* restart remote Tx, if it was stopped */ if ((tty->flow_ctrl & FL_IRTSOFF) && (tty->device.startRemoteTx != NULL)) { 20047a8: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 <== NOT EXECUTED 20047ac: 80 88 60 04 btst 4, %g1 <== NOT EXECUTED 20047b0: 02 80 00 09 be 20047d4 <== NOT EXECUTED 20047b4: 01 00 00 00 nop <== NOT EXECUTED 20047b8: c2 07 60 b0 ld [ %i5 + 0xb0 ], %g1 <== NOT EXECUTED 20047bc: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 20047c0: 02 80 00 05 be 20047d4 <== NOT EXECUTED 20047c4: 01 00 00 00 nop <== NOT EXECUTED tty->device.startRemoteTx(tty->minor); 20047c8: 9f c0 40 00 call %g1 <== NOT EXECUTED 20047cc: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 <== NOT EXECUTED 20047d0: c4 07 60 38 ld [ %i5 + 0x38 ], %g2 <== NOT EXECUTED } tty->flow_ctrl &= ~(FL_IRTSOFF); 20047d4: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 <== NOT EXECUTED 20047d8: 82 08 7f fb and %g1, -5, %g1 <== NOT EXECUTED 20047dc: c2 27 60 b8 st %g1, [ %i5 + 0xb8 ] <== NOT EXECUTED /* * check for flow control options to be switched on */ /* check for incoming RTS/CTS flow control switched on */ if (tty->termios.c_cflag & CRTSCTS) { 20047e0: 80 a0 a0 00 cmp %g2, 0 20047e4: 06 80 00 6e bl 200499c <== NEVER TAKEN 20047e8: 01 00 00 00 nop tty->flow_ctrl |= FL_MDRTS; } /* check for incoming XON/XOF flow control switched on */ if (tty->termios.c_iflag & IXOFF) { 20047ec: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 20047f0: 05 00 00 04 sethi %hi(0x1000), %g2 20047f4: 80 88 40 02 btst %g1, %g2 20047f8: 02 80 00 06 be 2004810 20047fc: 80 88 64 00 btst 0x400, %g1 tty->flow_ctrl |= FL_MDXOF; 2004800: c4 07 60 b8 ld [ %i5 + 0xb8 ], %g2 2004804: 84 10 a4 00 or %g2, 0x400, %g2 2004808: c4 27 60 b8 st %g2, [ %i5 + 0xb8 ] } /* check for outgoing XON/XOF flow control switched on */ if (tty->termios.c_iflag & IXON) { 200480c: 80 88 64 00 btst 0x400, %g1 2004810: 22 80 00 06 be,a 2004828 2004814: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 tty->flow_ctrl |= FL_MDXON; 2004818: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 200481c: 82 10 62 00 or %g1, 0x200, %g1 2004820: c2 27 60 b8 st %g1, [ %i5 + 0xb8 ] tty->termios = *(struct termios *)args->buffer; /* check for and process change in flow control options */ termios_set_flowctrl(tty); if (tty->termios.c_lflag & ICANON) { 2004824: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 2004828: 80 88 60 02 btst 2, %g1 200482c: 02 80 00 48 be 200494c 2004830: 01 00 00 00 nop tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; else tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks; } else { if (tty->termios.c_cc[VMIN]) { tty->rawInBufSemaphoreOptions = RTEMS_WAIT; 2004834: c0 27 60 6c clr [ %i5 + 0x6c ] tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT; 2004838: c0 27 60 70 clr [ %i5 + 0x70 ] tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; 200483c: c0 27 60 74 clr [ %i5 + 0x74 ] } else { tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT; } } } if (tty->device.setAttributes) 2004840: c2 07 60 a8 ld [ %i5 + 0xa8 ], %g1 2004844: 80 a0 60 00 cmp %g1, 0 2004848: 02 bf ff 85 be 200465c <== NEVER TAKEN 200484c: 01 00 00 00 nop (*tty->device.setAttributes)(tty->minor, &tty->termios); 2004850: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 2004854: 9f c0 40 00 call %g1 2004858: 92 10 00 1b mov %i3, %o1 200485c: 30 bf ff 80 b,a 200465c case TIOCGETD: *(int*)(args->buffer)=tty->t_line; break; #endif case FIONREAD: { int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head; 2004860: c4 07 60 60 ld [ %i5 + 0x60 ], %g2 <== NOT EXECUTED 2004864: c2 07 60 5c ld [ %i5 + 0x5c ], %g1 <== NOT EXECUTED if ( rawnc < 0 ) 2004868: 82 a0 80 01 subcc %g2, %g1, %g1 <== NOT EXECUTED 200486c: 0c 80 00 49 bneg 2004990 <== NOT EXECUTED 2004870: 01 00 00 00 nop <== NOT EXECUTED rawnc += tty->rawInBuf.Size; /* Half guess that this is the right operation */ *(int *)args->buffer = tty->ccount - tty->cindex + rawnc; 2004874: c8 07 60 20 ld [ %i5 + 0x20 ], %g4 <== NOT EXECUTED 2004878: c4 07 60 24 ld [ %i5 + 0x24 ], %g2 <== NOT EXECUTED 200487c: c6 06 20 08 ld [ %i0 + 8 ], %g3 <== NOT EXECUTED 2004880: 84 21 00 02 sub %g4, %g2, %g2 <== NOT EXECUTED 2004884: 82 00 80 01 add %g2, %g1, %g1 <== NOT EXECUTED } break; 2004888: 10 bf ff 75 b 200465c <== NOT EXECUTED 200488c: c2 20 c0 00 st %g1, [ %g3 ] <== NOT EXECUTED sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) { args->ioctl_return = sc; return sc; } switch (args->command) { 2004890: 32 bf ff 82 bne,a 2004698 <== NEVER TAKEN 2004894: c4 07 60 cc ld [ %i5 + 0xcc ], %g2 <== NOT EXECUTED sc = RTEMS_INVALID_NUMBER; } break; case RTEMS_IO_GET_ATTRIBUTES: *(struct termios *)args->buffer = tty->termios; 2004898: d0 06 20 08 ld [ %i0 + 8 ], %o0 200489c: 92 07 60 30 add %i5, 0x30, %o1 20048a0: 40 00 2e 78 call 2010280 20048a4: 94 10 20 24 mov 0x24, %o2 break; 20048a8: 30 bf ff 6d b,a 200465c sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) { args->ioctl_return = sc; return sc; } switch (args->command) { 20048ac: 84 10 a0 1a or %g2, 0x1a, %g2 20048b0: 80 a0 40 02 cmp %g1, %g2 20048b4: 02 80 00 1e be 200492c 20048b8: 05 20 01 1d sethi %hi(0x80047400), %g2 20048bc: 84 10 a0 1b or %g2, 0x1b, %g2 ! 8004741b 20048c0: 80 a0 40 02 cmp %g1, %g2 20048c4: 32 bf ff 75 bne,a 2004698 <== NEVER TAKEN 20048c8: c4 07 60 cc ld [ %i5 + 0xcc ], %g2 <== NOT EXECUTED #if 1 /* FIXME */ case TIOCSETD: /* * close old line discipline */ if (rtems_termios_linesw[tty->t_line].l_close != NULL) { 20048cc: c2 07 60 cc ld [ %i5 + 0xcc ], %g1 20048d0: 37 00 80 75 sethi %hi(0x201d400), %i3 20048d4: 83 28 60 05 sll %g1, 5, %g1 20048d8: b6 16 e1 00 or %i3, 0x100, %i3 20048dc: 82 06 c0 01 add %i3, %g1, %g1 20048e0: c2 00 60 04 ld [ %g1 + 4 ], %g1 20048e4: 80 a0 60 00 cmp %g1, 0 20048e8: 22 80 00 06 be,a 2004900 20048ec: c2 06 20 08 ld [ %i0 + 8 ], %g1 sc = rtems_termios_linesw[tty->t_line].l_close(tty); 20048f0: 9f c0 40 00 call %g1 20048f4: 90 10 00 1d mov %i5, %o0 20048f8: b8 10 00 08 mov %o0, %i4 } tty->t_line=*(int*)(args->buffer); 20048fc: c2 06 20 08 ld [ %i0 + 8 ], %g1 2004900: c4 00 40 00 ld [ %g1 ], %g2 tty->t_sc = NULL; /* ensure that no more valid data */ 2004904: c0 27 60 d0 clr [ %i5 + 0xd0 ] /* * open new line discipline */ if (rtems_termios_linesw[tty->t_line].l_open != NULL) { 2004908: 83 28 a0 05 sll %g2, 5, %g1 200490c: c2 06 c0 01 ld [ %i3 + %g1 ], %g1 2004910: 80 a0 60 00 cmp %g1, 0 2004914: 02 bf ff 52 be 200465c 2004918: c4 27 60 cc st %g2, [ %i5 + 0xcc ] sc = rtems_termios_linesw[tty->t_line].l_open(tty); 200491c: 9f c0 40 00 call %g1 2004920: 90 10 00 1d mov %i5, %o0 2004924: 10 bf ff 4e b 200465c 2004928: b8 10 00 08 mov %o0, %i4 } break; case TIOCGETD: *(int*)(args->buffer)=tty->t_line; 200492c: c4 07 60 cc ld [ %i5 + 0xcc ], %g2 2004930: c2 06 20 08 ld [ %i0 + 8 ], %g1 break; 2004934: 10 bf ff 4a b 200465c 2004938: c4 20 40 00 st %g2, [ %g1 ] case RTEMS_IO_TCDRAIN: drainOutput (tty); break; case RTEMS_IO_SNDWAKEUP: tty->tty_snd = *wakeup; 200493c: c2 27 60 d4 st %g1, [ %i5 + 0xd4 ] 2004940: c2 06 e0 04 ld [ %i3 + 4 ], %g1 break; 2004944: 10 bf ff 46 b 200465c 2004948: c2 27 60 d8 st %g1, [ %i5 + 0xd8 ] tty->rawInBufSemaphoreOptions = RTEMS_WAIT; tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT; tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; } else { tty->vtimeTicks = tty->termios.c_cc[VTIME] * rtems_clock_get_ticks_per_second() / 10; 200494c: 40 00 06 20 call 20061cc 2004950: f4 0f 60 46 ldub [ %i5 + 0x46 ], %i2 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] * 2004954: 40 00 4f 58 call 20186b4 <.umul> 2004958: 92 10 00 1a mov %i2, %o1 rtems_clock_get_ticks_per_second() / 10; 200495c: 40 00 4f 90 call 201879c <.udiv> 2004960: 92 10 20 0a mov 0xa, %o1 if (tty->termios.c_cc[VTIME]) { 2004964: c2 0f 60 46 ldub [ %i5 + 0x46 ], %g1 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] * 2004968: d0 27 60 54 st %o0, [ %i5 + 0x54 ] rtems_clock_get_ticks_per_second() / 10; if (tty->termios.c_cc[VTIME]) { 200496c: 80 a0 60 00 cmp %g1, 0 2004970: 02 80 00 10 be 20049b0 2004974: c2 0f 60 47 ldub [ %i5 + 0x47 ], %g1 tty->rawInBufSemaphoreOptions = RTEMS_WAIT; 2004978: c0 27 60 6c clr [ %i5 + 0x6c ] tty->rawInBufSemaphoreTimeout = tty->vtimeTicks; if (tty->termios.c_cc[VMIN]) 200497c: 80 a0 60 00 cmp %g1, 0 2004980: 12 bf ff af bne 200483c 2004984: d0 27 60 70 st %o0, [ %i5 + 0x70 ] tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; else tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks; 2004988: 10 bf ff ae b 2004840 200498c: d0 27 60 74 st %o0, [ %i5 + 0x74 ] break; #endif case FIONREAD: { int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head; if ( rawnc < 0 ) rawnc += tty->rawInBuf.Size; 2004990: c4 07 60 64 ld [ %i5 + 0x64 ], %g2 <== NOT EXECUTED 2004994: 10 bf ff b8 b 2004874 <== NOT EXECUTED 2004998: 82 00 40 02 add %g1, %g2, %g1 <== NOT EXECUTED /* * check for flow control options to be switched on */ /* check for incoming RTS/CTS flow control switched on */ if (tty->termios.c_cflag & CRTSCTS) { tty->flow_ctrl |= FL_MDRTS; 200499c: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 <== NOT EXECUTED 20049a0: 82 10 61 00 or %g1, 0x100, %g1 <== NOT EXECUTED 20049a4: c2 27 60 b8 st %g1, [ %i5 + 0xb8 ] <== NOT EXECUTED } /* check for incoming XON/XOF flow control switched on */ if (tty->termios.c_iflag & IXOFF) { 20049a8: 10 bf ff 92 b 20047f0 <== NOT EXECUTED 20049ac: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 <== NOT EXECUTED if (tty->termios.c_cc[VMIN]) tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; else tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks; } else { if (tty->termios.c_cc[VMIN]) { 20049b0: 80 a0 60 00 cmp %g1, 0 20049b4: 32 bf ff a1 bne,a 2004838 <== NEVER TAKEN 20049b8: c0 27 60 6c clr [ %i5 + 0x6c ] <== NOT EXECUTED tty->rawInBufSemaphoreOptions = RTEMS_WAIT; tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT; tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT; } else { tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT; 20049bc: 82 10 20 01 mov 1, %g1 20049c0: 10 bf ff a0 b 2004840 20049c4: c2 27 60 6c st %g1, [ %i5 + 0x6c ] tty->flow_ctrl &= ~FL_OSTOP; /* check for chars in output buffer (or rob_state?) */ if (tty->rawOutBufState != rob_idle) { /* if chars available, call write function... */ (*tty->device.write)( tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); 20049c8: c4 07 60 84 ld [ %i5 + 0x84 ], %g2 <== 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)( 20049cc: d2 07 60 7c ld [ %i5 + 0x7c ], %o1 <== NOT EXECUTED 20049d0: c2 07 60 a4 ld [ %i5 + 0xa4 ], %g1 <== NOT EXECUTED 20049d4: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 <== NOT EXECUTED 20049d8: 92 02 40 02 add %o1, %g2, %o1 <== NOT EXECUTED 20049dc: 9f c0 40 00 call %g1 <== NOT EXECUTED 20049e0: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 20049e4: 30 bf ff 57 b,a 2004740 <== NOT EXECUTED =============================================================================== 02003f9c : rtems_device_major_number major, rtems_device_minor_number minor, void *arg, const rtems_termios_callbacks *callbacks ) { 2003f9c: 9d e3 bf a0 save %sp, -96, %sp struct rtems_termios_tty *tty; /* * See if the device has already been opened */ sc = rtems_semaphore_obtain( 2003fa0: 39 00 80 75 sethi %hi(0x201d400), %i4 2003fa4: d0 07 23 d0 ld [ %i4 + 0x3d0 ], %o0 ! 201d7d0 2003fa8: 92 10 20 00 clr %o1 2003fac: 40 00 0a 53 call 20068f8 2003fb0: 94 10 20 00 clr %o2 rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 2003fb4: ba 92 20 00 orcc %o0, 0, %i5 2003fb8: 12 80 00 27 bne 2004054 <== NEVER TAKEN 2003fbc: 25 00 80 75 sethi %hi(0x201d400), %l2 return sc; for (tty = rtems_termios_ttyHead ; tty != NULL ; tty = tty->forw) { 2003fc0: e2 04 a3 d8 ld [ %l2 + 0x3d8 ], %l1 ! 201d7d8 2003fc4: 80 a4 60 00 cmp %l1, 0 2003fc8: 02 80 00 34 be 2004098 2003fcc: a0 10 00 11 mov %l1, %l0 if ((tty->major == major) && (tty->minor == minor)) 2003fd0: 10 80 00 06 b 2003fe8 2003fd4: c2 04 20 0c ld [ %l0 + 0xc ], %g1 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) { 2003fd8: 80 a4 20 00 cmp %l0, 0 2003fdc: 02 80 00 30 be 200409c <== ALWAYS TAKEN 2003fe0: 90 10 20 01 mov 1, %o0 if ((tty->major == major) && (tty->minor == minor)) 2003fe4: c2 04 20 0c ld [ %l0 + 0xc ], %g1 <== NOT EXECUTED 2003fe8: 80 a0 40 18 cmp %g1, %i0 2003fec: 32 bf ff fb bne,a 2003fd8 2003ff0: e0 04 00 00 ld [ %l0 ], %l0 2003ff4: c2 04 20 10 ld [ %l0 + 0x10 ], %g1 2003ff8: 80 a0 40 19 cmp %g1, %i1 2003ffc: 32 bf ff f7 bne,a 2003fd8 <== NEVER TAKEN 2004000: e0 04 00 00 ld [ %l0 ], %l0 <== NOT EXECUTED */ if (c++ == 'z') c = 'a'; } args->iop->data1 = tty; 2004004: c4 06 80 00 ld [ %i2 ], %g2 if (!tty->refcount++) { 2004008: c2 04 20 08 ld [ %l0 + 8 ], %g1 */ if (c++ == 'z') c = 'a'; } args->iop->data1 = tty; 200400c: e0 20 a0 38 st %l0, [ %g2 + 0x38 ] if (!tty->refcount++) { 2004010: 84 00 60 01 add %g1, 1, %g2 2004014: 80 a0 60 00 cmp %g1, 0 2004018: 12 80 00 0d bne 200404c 200401c: c4 24 20 08 st %g2, [ %l0 + 8 ] if (tty->device.firstOpen) 2004020: c2 04 20 98 ld [ %l0 + 0x98 ], %g1 2004024: 80 a0 60 00 cmp %g1, 0 2004028: 02 80 00 05 be 200403c 200402c: 90 10 00 18 mov %i0, %o0 (*tty->device.firstOpen)(major, minor, arg); 2004030: 92 10 00 19 mov %i1, %o1 2004034: 9f c0 40 00 call %g1 2004038: 94 10 00 1a mov %i2, %o2 /* * start I/O tasks, if needed */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 200403c: c2 04 20 b4 ld [ %l0 + 0xb4 ], %g1 2004040: 80 a0 60 02 cmp %g1, 2 2004044: 22 80 00 06 be,a 200405c 2004048: d0 04 20 c4 ld [ %l0 + 0xc4 ], %o0 tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); } } rtems_semaphore_release (rtems_termios_ttyMutex); 200404c: 40 00 0a 75 call 2006a20 2004050: d0 07 23 d0 ld [ %i4 + 0x3d0 ], %o0 return RTEMS_SUCCESSFUL; } 2004054: 81 c7 e0 08 ret 2004058: 91 e8 00 1d restore %g0, %i5, %o0 /* * start I/O tasks, if needed */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { sc = rtems_task_start( 200405c: 94 10 00 10 mov %l0, %o2 2004060: 13 00 80 16 sethi %hi(0x2005800), %o1 2004064: 40 00 0b 3e call 2006d5c 2004068: 92 12 61 98 or %o1, 0x198, %o1 ! 2005998 tty->rxTaskId, rtems_termios_rxdaemon, (rtems_task_argument)tty); if (sc != RTEMS_SUCCESSFUL) 200406c: 80 a2 20 00 cmp %o0, 0 2004070: 12 80 00 ba bne 2004358 <== NEVER TAKEN 2004074: 94 10 00 10 mov %l0, %o2 rtems_fatal_error_occurred (sc); sc = rtems_task_start( 2004078: d0 04 20 c8 ld [ %l0 + 0xc8 ], %o0 200407c: 13 00 80 17 sethi %hi(0x2005c00), %o1 2004080: 40 00 0b 37 call 2006d5c 2004084: 92 12 60 1c or %o1, 0x1c, %o1 ! 2005c1c tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty); if (sc != RTEMS_SUCCESSFUL) 2004088: 80 a2 20 00 cmp %o0, 0 200408c: 02 bf ff f0 be 200404c <== ALWAYS TAKEN 2004090: 01 00 00 00 nop 2004094: 30 80 00 b1 b,a 2004358 <== NOT EXECUTED static char c = 'a'; /* * Create a new device */ tty = calloc (1, sizeof (struct rtems_termios_tty)); 2004098: 90 10 20 01 mov 1, %o0 ! 1 200409c: 7f ff fa 79 call 2002a80 20040a0: 92 10 20 e8 mov 0xe8, %o1 if (tty == NULL) { 20040a4: a0 92 20 00 orcc %o0, 0, %l0 20040a8: 02 80 00 9d be 200431c 20040ac: 03 00 80 73 sethi %hi(0x201cc00), %g1 return RTEMS_NO_MEMORY; } /* * allocate raw input buffer */ tty->rawInBuf.Size = RAW_INPUT_BUFFER_SIZE; 20040b0: c2 00 61 e0 ld [ %g1 + 0x1e0 ], %g1 ! 201cde0 20040b4: c2 24 20 64 st %g1, [ %l0 + 0x64 ] tty->rawInBuf.theBuf = malloc (tty->rawInBuf.Size); 20040b8: d0 04 20 64 ld [ %l0 + 0x64 ], %o0 20040bc: 7f ff fc 61 call 2003240 20040c0: 01 00 00 00 nop 20040c4: d0 24 20 58 st %o0, [ %l0 + 0x58 ] if (tty->rawInBuf.theBuf == NULL) { 20040c8: 80 a2 20 00 cmp %o0, 0 20040cc: 02 80 00 92 be 2004314 20040d0: a6 10 00 08 mov %o0, %l3 return RTEMS_NO_MEMORY; } /* * allocate raw output buffer */ tty->rawOutBuf.Size = RAW_OUTPUT_BUFFER_SIZE; 20040d4: 03 00 80 73 sethi %hi(0x201cc00), %g1 20040d8: c2 00 61 e4 ld [ %g1 + 0x1e4 ], %g1 ! 201cde4 20040dc: c2 24 20 88 st %g1, [ %l0 + 0x88 ] tty->rawOutBuf.theBuf = malloc (tty->rawOutBuf.Size); 20040e0: d0 04 20 88 ld [ %l0 + 0x88 ], %o0 20040e4: 7f ff fc 57 call 2003240 20040e8: 01 00 00 00 nop 20040ec: d0 24 20 7c st %o0, [ %l0 + 0x7c ] if (tty->rawOutBuf.theBuf == NULL) { 20040f0: 80 a2 20 00 cmp %o0, 0 20040f4: 02 80 00 86 be 200430c 20040f8: a8 10 00 08 mov %o0, %l4 return RTEMS_NO_MEMORY; } /* * allocate cooked buffer */ tty->cbuf = malloc (CBUFSIZE); 20040fc: 03 00 80 73 sethi %hi(0x201cc00), %g1 2004100: 7f ff fc 50 call 2003240 2004104: d0 00 61 e8 ld [ %g1 + 0x1e8 ], %o0 ! 201cde8 if (tty->cbuf == NULL) { 2004108: 80 a2 20 00 cmp %o0, 0 200410c: 02 80 00 7e be 2004304 <== NEVER TAKEN 2004110: d0 24 20 1c st %o0, [ %l0 + 0x1c ] return RTEMS_NO_MEMORY; } /* * Initialize wakeup callbacks */ tty->tty_snd.sw_pfn = NULL; 2004114: c0 24 20 d4 clr [ %l0 + 0xd4 ] tty->tty_snd.sw_arg = NULL; 2004118: c0 24 20 d8 clr [ %l0 + 0xd8 ] tty->tty_rcv.sw_pfn = NULL; 200411c: c0 24 20 dc clr [ %l0 + 0xdc ] tty->tty_rcv.sw_arg = NULL; 2004120: c0 24 20 e0 clr [ %l0 + 0xe0 ] tty->tty_rcvwakeup = 0; 2004124: c0 24 20 e4 clr [ %l0 + 0xe4 ] /* * link tty */ tty->forw = rtems_termios_ttyHead; 2004128: e2 24 00 00 st %l1, [ %l0 ] tty->back = NULL; if (rtems_termios_ttyHead != NULL) 200412c: 80 a4 60 00 cmp %l1, 0 2004130: 02 80 00 03 be 200413c 2004134: c0 24 20 04 clr [ %l0 + 4 ] rtems_termios_ttyHead->back = tty; 2004138: e0 24 60 04 st %l0, [ %l1 + 4 ] rtems_termios_ttyHead = tty; if (rtems_termios_ttyTail == NULL) 200413c: 03 00 80 75 sethi %hi(0x201d400), %g1 2004140: c4 00 63 d4 ld [ %g1 + 0x3d4 ], %g2 ! 201d7d4 2004144: 80 a0 a0 00 cmp %g2, 0 2004148: 02 80 00 9d be 20043bc 200414c: e0 24 a3 d8 st %l0, [ %l2 + 0x3d8 ] /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( rtems_build_name ('T', 'R', 'i', c), 2004150: 23 00 80 73 sethi %hi(0x201cc00), %l1 2004154: d0 4c 61 ec ldsb [ %l1 + 0x1ec ], %o0 ! 201cdec tty->major = major; /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( 2004158: 03 15 14 9a sethi %hi(0x54526800), %g1 200415c: 82 10 61 00 or %g1, 0x100, %g1 ! 54526900 rtems_termios_ttyHead->back = tty; rtems_termios_ttyHead = tty; if (rtems_termios_ttyTail == NULL) rtems_termios_ttyTail = tty; tty->minor = minor; 2004160: f2 24 20 10 st %i1, [ %l0 + 0x10 ] tty->major = major; 2004164: f0 24 20 0c st %i0, [ %l0 + 0xc ] /* * Set up mutex semaphores */ sc = rtems_semaphore_create ( 2004168: 92 10 20 01 mov 1, %o1 200416c: 94 10 20 54 mov 0x54, %o2 2004170: 90 12 00 01 or %o0, %g1, %o0 2004174: 96 10 20 00 clr %o3 2004178: 40 00 09 39 call 200665c 200417c: 98 04 20 14 add %l0, 0x14, %o4 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) 2004180: 80 a2 20 00 cmp %o0, 0 2004184: 12 80 00 75 bne 2004358 2004188: 03 15 14 9b sethi %hi(0x54526c00), %g1 rtems_fatal_error_occurred (sc); sc = rtems_semaphore_create ( rtems_build_name ('T', 'R', 'o', c), 200418c: d0 4c 61 ec ldsb [ %l1 + 0x1ec ], %o0 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 ( 2004190: 82 10 63 00 or %g1, 0x300, %g1 2004194: 92 10 20 01 mov 1, %o1 2004198: 94 10 20 54 mov 0x54, %o2 200419c: 90 12 00 01 or %o0, %g1, %o0 20041a0: 96 10 20 00 clr %o3 20041a4: 40 00 09 2e call 200665c 20041a8: 98 04 20 18 add %l0, 0x18, %o4 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) 20041ac: 80 a2 20 00 cmp %o0, 0 20041b0: 12 80 00 6a bne 2004358 20041b4: 03 15 14 9e sethi %hi(0x54527800), %g1 rtems_fatal_error_occurred (sc); sc = rtems_semaphore_create ( rtems_build_name ('T', 'R', 'x', c), 20041b8: d0 4c 61 ec ldsb [ %l1 + 0x1ec ], %o0 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 ( 20041bc: 92 10 20 00 clr %o1 20041c0: 90 12 00 01 or %o0, %g1, %o0 20041c4: 94 10 20 20 mov 0x20, %o2 20041c8: 96 10 20 00 clr %o3 20041cc: 40 00 09 24 call 200665c 20041d0: 98 04 20 8c add %l0, 0x8c, %o4 rtems_build_name ('T', 'R', 'x', c), 0, RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_FIFO, RTEMS_NO_PRIORITY, &tty->rawOutBuf.Semaphore); if (sc != RTEMS_SUCCESSFUL) 20041d4: 80 a2 20 00 cmp %o0, 0 20041d8: 12 80 00 60 bne 2004358 20041dc: 92 10 00 1b mov %i3, %o1 rtems_fatal_error_occurred (sc); tty->rawOutBufState = rob_idle; 20041e0: c0 24 20 94 clr [ %l0 + 0x94 ] /* * Set callbacks */ tty->device = *callbacks; 20041e4: 90 04 20 98 add %l0, 0x98, %o0 20041e8: 40 00 30 26 call 2010280 20041ec: 94 10 20 20 mov 0x20, %o2 /* * Create I/O tasks */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { 20041f0: c2 04 20 b4 ld [ %l0 + 0xb4 ], %g1 20041f4: 80 a0 60 02 cmp %g1, 2 20041f8: 02 80 00 5a be 2004360 20041fc: d0 4c 61 ec ldsb [ %l1 + 0x1ec ], %o0 &tty->rxTaskId); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); } if ((tty->device.pollRead == NULL) || 2004200: c2 04 20 a0 ld [ %l0 + 0xa0 ], %g1 2004204: 80 a0 60 00 cmp %g1, 0 2004208: 02 80 00 49 be 200432c 200420c: d0 4c 61 ec ldsb [ %l1 + 0x1ec ], %o0 2004210: c2 04 20 b4 ld [ %l0 + 0xb4 ], %g1 2004214: 80 a0 60 02 cmp %g1, 2 2004218: 02 80 00 46 be 2004330 200421c: 03 15 14 9c sethi %hi(0x54527000), %g1 tty->termios.c_cc[VDISCARD] = '\017'; tty->termios.c_cc[VWERASE] = '\027'; tty->termios.c_cc[VLNEXT] = '\026'; /* start with no flow control, clear flow control flags */ tty->flow_ctrl = 0; 2004220: c0 24 20 b8 clr [ %l0 + 0xb8 ] /* * set low/highwater mark for XON/XOFF support */ tty->lowwater = tty->rawInBuf.Size * 1/2; 2004224: c8 04 20 64 ld [ %l0 + 0x64 ], %g4 tty->highwater = tty->rawInBuf.Size * 3/4; 2004228: c4 04 20 64 ld [ %l0 + 0x64 ], %g2 /* * Bump name characer */ if (c++ == 'z') 200422c: c2 0c 61 ec ldub [ %l1 + 0x1ec ], %g1 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; 2004230: b7 28 a0 01 sll %g2, 1, %i3 2004234: 84 06 c0 02 add %i3, %g2, %g2 } /* * Set default parameters */ tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL; 2004238: 37 00 00 09 sethi %hi(0x2400), %i3 200423c: b6 16 e1 02 or %i3, 0x102, %i3 ! 2502 2004240: f6 24 20 30 st %i3, [ %l0 + 0x30 ] tty->termios.c_oflag = OPOST | ONLCR | XTABS; 2004244: 37 00 00 06 sethi %hi(0x1800), %i3 2004248: b6 16 e0 05 or %i3, 5, %i3 ! 1805 200424c: f6 24 20 34 st %i3, [ %l0 + 0x34 ] tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL; 2004250: b6 10 28 bd mov 0x8bd, %i3 2004254: f6 24 20 38 st %i3, [ %l0 + 0x38 ] tty->termios.c_lflag = 2004258: 37 00 00 20 sethi %hi(0x8000), %i3 200425c: b6 16 e2 3b or %i3, 0x23b, %i3 ! 823b 2004260: f6 24 20 3c st %i3, [ %l0 + 0x3c ] ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL; tty->termios.c_cc[VINTR] = '\003'; 2004264: b6 10 20 03 mov 3, %i3 2004268: f6 2c 20 41 stb %i3, [ %l0 + 0x41 ] tty->termios.c_cc[VQUIT] = '\034'; 200426c: b6 10 20 1c mov 0x1c, %i3 2004270: f6 2c 20 42 stb %i3, [ %l0 + 0x42 ] tty->termios.c_cc[VERASE] = '\177'; 2004274: b6 10 20 7f mov 0x7f, %i3 2004278: f6 2c 20 43 stb %i3, [ %l0 + 0x43 ] tty->termios.c_cc[VKILL] = '\025'; 200427c: b6 10 20 15 mov 0x15, %i3 2004280: f6 2c 20 44 stb %i3, [ %l0 + 0x44 ] tty->termios.c_cc[VEOF] = '\004'; 2004284: b6 10 20 04 mov 4, %i3 2004288: f6 2c 20 45 stb %i3, [ %l0 + 0x45 ] tty->termios.c_cc[VEOL] = '\000'; tty->termios.c_cc[VEOL2] = '\000'; tty->termios.c_cc[VSTART] = '\021'; 200428c: b6 10 20 11 mov 0x11, %i3 2004290: f6 2c 20 49 stb %i3, [ %l0 + 0x49 ] tty->termios.c_cc[VSTOP] = '\023'; 2004294: b6 10 20 13 mov 0x13, %i3 2004298: f6 2c 20 4a stb %i3, [ %l0 + 0x4a ] tty->termios.c_cc[VSUSP] = '\032'; 200429c: b6 10 20 1a mov 0x1a, %i3 20042a0: f6 2c 20 4b stb %i3, [ %l0 + 0x4b ] tty->termios.c_cc[VREPRINT] = '\022'; 20042a4: b6 10 20 12 mov 0x12, %i3 20042a8: f6 2c 20 4d stb %i3, [ %l0 + 0x4d ] tty->termios.c_cc[VDISCARD] = '\017'; 20042ac: b6 10 20 0f mov 0xf, %i3 20042b0: f6 2c 20 4e stb %i3, [ %l0 + 0x4e ] tty->termios.c_cc[VWERASE] = '\027'; 20042b4: b6 10 20 17 mov 0x17, %i3 tty->lowwater = tty->rawInBuf.Size * 1/2; tty->highwater = tty->rawInBuf.Size * 3/4; /* * Bump name characer */ if (c++ == 'z') 20042b8: 86 00 60 01 add %g1, 1, %g3 /* 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; 20042bc: 89 31 20 01 srl %g4, 1, %g4 tty->highwater = tty->rawInBuf.Size * 3/4; 20042c0: 85 30 a0 02 srl %g2, 2, %g2 tty->termios.c_cc[VSTART] = '\021'; tty->termios.c_cc[VSTOP] = '\023'; tty->termios.c_cc[VSUSP] = '\032'; tty->termios.c_cc[VREPRINT] = '\022'; tty->termios.c_cc[VDISCARD] = '\017'; tty->termios.c_cc[VWERASE] = '\027'; 20042c4: f6 2c 20 4f stb %i3, [ %l0 + 0x4f ] tty->termios.c_cc[VINTR] = '\003'; tty->termios.c_cc[VQUIT] = '\034'; tty->termios.c_cc[VERASE] = '\177'; tty->termios.c_cc[VKILL] = '\025'; tty->termios.c_cc[VEOF] = '\004'; tty->termios.c_cc[VEOL] = '\000'; 20042c8: c0 2c 20 4c clrb [ %l0 + 0x4c ] 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'; 20042cc: b6 10 20 16 mov 0x16, %i3 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'; tty->termios.c_cc[VEOL2] = '\000'; 20042d0: c0 2c 20 51 clrb [ %l0 + 0x51 ] 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'; 20042d4: f6 2c 20 50 stb %i3, [ %l0 + 0x50 ] /* 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; 20042d8: c8 24 20 bc st %g4, [ %l0 + 0xbc ] tty->highwater = tty->rawInBuf.Size * 3/4; 20042dc: c4 24 20 c0 st %g2, [ %l0 + 0xc0 ] /* * Bump name characer */ if (c++ == 'z') 20042e0: 83 28 60 18 sll %g1, 0x18, %g1 20042e4: 83 38 60 18 sra %g1, 0x18, %g1 20042e8: 80 a0 60 7a cmp %g1, 0x7a 20042ec: 12 bf ff 46 bne 2004004 20042f0: c6 2c 61 ec stb %g3, [ %l1 + 0x1ec ] c = 'a'; 20042f4: 84 10 20 61 mov 0x61, %g2 20042f8: 03 00 80 73 sethi %hi(0x201cc00), %g1 20042fc: 10 bf ff 42 b 2004004 2004300: c4 28 61 ec stb %g2, [ %g1 + 0x1ec ] ! 201cdec /* * allocate cooked buffer */ tty->cbuf = malloc (CBUFSIZE); if (tty->cbuf == NULL) { free((void *)(tty->rawOutBuf.theBuf)); 2004304: 7f ff fa ec call 2002eb4 <== NOT EXECUTED 2004308: 90 10 00 14 mov %l4, %o0 <== NOT EXECUTED free((void *)(tty->rawInBuf.theBuf)); 200430c: 7f ff fa ea call 2002eb4 2004310: 90 10 00 13 mov %l3, %o0 free(tty); 2004314: 7f ff fa e8 call 2002eb4 2004318: 90 10 00 10 mov %l0, %o0 rtems_semaphore_release (rtems_termios_ttyMutex); 200431c: d0 07 23 d0 ld [ %i4 + 0x3d0 ], %o0 2004320: 40 00 09 c0 call 2006a20 2004324: ba 10 20 1a mov 0x1a, %i5 return RTEMS_NO_MEMORY; 2004328: 30 bf ff 4b b,a 2004054 rtems_fatal_error_occurred (sc); } if ((tty->device.pollRead == NULL) || (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){ sc = rtems_semaphore_create ( 200432c: 03 15 14 9c sethi %hi(0x54527000), %g1 2004330: 82 10 62 00 or %g1, 0x200, %g1 ! 54527200 2004334: 92 10 20 00 clr %o1 2004338: 94 10 20 24 mov 0x24, %o2 200433c: 90 12 00 01 or %o0, %g1, %o0 2004340: 96 10 20 00 clr %o3 2004344: 40 00 08 c6 call 200665c 2004348: 98 04 20 68 add %l0, 0x68, %o4 rtems_build_name ('T', 'R', 'r', c), 0, RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_PRIORITY, RTEMS_NO_PRIORITY, &tty->rawInBuf.Semaphore); if (sc != RTEMS_SUCCESSFUL) 200434c: 80 a2 20 00 cmp %o0, 0 2004350: 02 bf ff b4 be 2004220 <== ALWAYS TAKEN 2004354: 01 00 00 00 nop rtems_fatal_error_occurred (sc); sc = rtems_task_start( tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); 2004358: 40 00 0b 25 call 2006fec 200435c: 01 00 00 00 nop /* * Create I/O tasks */ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) { sc = rtems_task_create ( 2004360: 03 15 1e 15 sethi %hi(0x54785400), %g1 2004364: 92 10 20 0a mov 0xa, %o1 2004368: 90 12 00 01 or %o0, %g1, %o0 200436c: 94 10 24 00 mov 0x400, %o2 2004370: 96 10 25 00 mov 0x500, %o3 2004374: 98 10 20 00 clr %o4 2004378: 40 00 09 d5 call 2006acc 200437c: 9a 04 20 c8 add %l0, 0xc8, %o5 TERMIOS_TXTASK_STACKSIZE, RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, &tty->txTaskId); if (sc != RTEMS_SUCCESSFUL) 2004380: 80 a2 20 00 cmp %o0, 0 2004384: 12 bf ff f5 bne 2004358 <== NEVER TAKEN 2004388: 03 14 9e 15 sethi %hi(0x52785400), %g1 rtems_fatal_error_occurred (sc); sc = rtems_task_create ( rtems_build_name ('R', 'x', 'T', c), 200438c: d0 4c 61 ec ldsb [ %l1 + 0x1ec ], %o0 RTEMS_NO_ASR, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, &tty->txTaskId); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); sc = rtems_task_create ( 2004390: 92 10 20 09 mov 9, %o1 2004394: 90 12 00 01 or %o0, %g1, %o0 2004398: 94 10 24 00 mov 0x400, %o2 200439c: 96 10 25 00 mov 0x500, %o3 20043a0: 98 10 20 00 clr %o4 20043a4: 40 00 09 ca call 2006acc 20043a8: 9a 04 20 c4 add %l0, 0xc4, %o5 TERMIOS_RXTASK_STACKSIZE, RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, &tty->rxTaskId); if (sc != RTEMS_SUCCESSFUL) 20043ac: 80 a2 20 00 cmp %o0, 0 20043b0: 22 bf ff 95 be,a 2004204 <== ALWAYS TAKEN 20043b4: c2 04 20 a0 ld [ %l0 + 0xa0 ], %g1 20043b8: 30 bf ff e8 b,a 2004358 <== NOT EXECUTED tty->back = NULL; if (rtems_termios_ttyHead != NULL) rtems_termios_ttyHead->back = tty; rtems_termios_ttyHead = tty; if (rtems_termios_ttyTail == NULL) rtems_termios_ttyTail = tty; 20043bc: 10 bf ff 65 b 2004150 20043c0: e0 20 63 d4 st %l0, [ %g1 + 0x3d4 ] =============================================================================== 020049e8 : * Send characters to device-specific code */ void rtems_termios_puts ( const void *_buf, int len, struct rtems_termios_tty *tty) { 20049e8: 9d e3 bf a0 save %sp, -96, %sp const unsigned char *buf = _buf; unsigned int newHead; rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) { 20049ec: c2 06 a0 b4 ld [ %i2 + 0xb4 ], %g1 20049f0: 80 a0 60 00 cmp %g1, 0 20049f4: 22 80 00 44 be,a 2004b04 20049f8: c2 06 a0 a4 ld [ %i2 + 0xa4 ], %g1 (*tty->device.write)(tty->minor, (void *)buf, len); return; } newHead = tty->rawOutBuf.Head; 20049fc: e0 06 a0 80 ld [ %i2 + 0x80 ], %l0 while (len) { 2004a00: 80 a6 60 00 cmp %i1, 0 2004a04: 02 80 00 35 be 2004ad8 <== NEVER TAKEN 2004a08: b6 10 20 02 mov 2, %i3 (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; 2004a0c: a2 10 20 01 mov 1, %l1 * len -= ncopy * * To minimize latency, the memcpy should be done * with interrupts enabled. */ newHead = (newHead + 1) % tty->rawOutBuf.Size; 2004a10: d2 06 a0 88 ld [ %i2 + 0x88 ], %o1 2004a14: 40 00 50 0e call 2018a4c <.urem> 2004a18: 90 04 20 01 add %l0, 1, %o0 rtems_interrupt_disable (level); 2004a1c: 7f ff f5 db call 2002188 2004a20: a0 10 00 08 mov %o0, %l0 2004a24: ba 10 00 08 mov %o0, %i5 while (newHead == tty->rawOutBuf.Tail) { 2004a28: f8 06 a0 84 ld [ %i2 + 0x84 ], %i4 2004a2c: 80 a7 00 10 cmp %i4, %l0 2004a30: 32 80 00 14 bne,a 2004a80 2004a34: c6 0e 00 00 ldub [ %i0 ], %g3 tty->rawOutBufState = rob_wait; 2004a38: f6 26 a0 94 st %i3, [ %i2 + 0x94 ] rtems_interrupt_enable (level); 2004a3c: 7f ff f5 d7 call 2002198 2004a40: 90 10 00 1d mov %i5, %o0 sc = rtems_semaphore_obtain( 2004a44: d0 06 a0 8c ld [ %i2 + 0x8c ], %o0 2004a48: 92 10 20 00 clr %o1 2004a4c: 40 00 07 ab call 20068f8 2004a50: 94 10 20 00 clr %o2 tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 2004a54: 80 a2 20 00 cmp %o0, 0 2004a58: 12 80 00 31 bne 2004b1c <== NEVER TAKEN 2004a5c: 01 00 00 00 nop rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); 2004a60: 7f ff f5 ca call 2002188 2004a64: 01 00 00 00 nop 2004a68: ba 10 00 08 mov %o0, %i5 * 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) { 2004a6c: c2 06 a0 84 ld [ %i2 + 0x84 ], %g1 2004a70: 80 a0 40 1c cmp %g1, %i4 2004a74: 22 bf ff f2 be,a 2004a3c <== NEVER TAKEN 2004a78: f6 26 a0 94 st %i3, [ %i2 + 0x94 ] <== NOT EXECUTED 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++; 2004a7c: c6 0e 00 00 ldub [ %i0 ], %g3 2004a80: c2 06 a0 80 ld [ %i2 + 0x80 ], %g1 2004a84: c4 06 a0 7c ld [ %i2 + 0x7c ], %g2 2004a88: b0 06 20 01 inc %i0 2004a8c: c6 28 80 01 stb %g3, [ %g2 + %g1 ] tty->rawOutBuf.Head = newHead; if (tty->rawOutBufState == rob_idle) { 2004a90: c2 06 a0 94 ld [ %i2 + 0x94 ], %g1 if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } tty->rawOutBuf.theBuf[tty->rawOutBuf.Head] = *buf++; tty->rawOutBuf.Head = newHead; 2004a94: e0 26 a0 80 st %l0, [ %i2 + 0x80 ] if (tty->rawOutBufState == rob_idle) { 2004a98: 80 a0 60 00 cmp %g1, 0 2004a9c: 12 80 00 0a bne 2004ac4 2004aa0: 01 00 00 00 nop /* check, whether XOFF has been received */ if (!(tty->flow_ctrl & FL_ORCVXOF)) { 2004aa4: c2 06 a0 b8 ld [ %i2 + 0xb8 ], %g1 2004aa8: 80 88 60 10 btst 0x10, %g1 2004aac: 02 80 00 0d be 2004ae0 <== ALWAYS TAKEN 2004ab0: 01 00 00 00 nop (*tty->device.write)(tty->minor, (char *)&tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); } else { /* remember that output has been stopped due to flow ctrl*/ tty->flow_ctrl |= FL_OSTOP; 2004ab4: c2 06 a0 b8 ld [ %i2 + 0xb8 ], %g1 <== NOT EXECUTED 2004ab8: 82 10 60 20 or %g1, 0x20, %g1 <== NOT EXECUTED 2004abc: c2 26 a0 b8 st %g1, [ %i2 + 0xb8 ] <== NOT EXECUTED } tty->rawOutBufState = rob_busy; 2004ac0: e2 26 a0 94 st %l1, [ %i2 + 0x94 ] <== NOT EXECUTED } rtems_interrupt_enable (level); 2004ac4: 7f ff f5 b5 call 2002198 2004ac8: 90 10 00 1d mov %i5, %o0 if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) { (*tty->device.write)(tty->minor, (void *)buf, len); return; } newHead = tty->rawOutBuf.Head; while (len) { 2004acc: b2 86 7f ff addcc %i1, -1, %i1 2004ad0: 12 bf ff d0 bne 2004a10 2004ad4: 01 00 00 00 nop 2004ad8: 81 c7 e0 08 ret 2004adc: 81 e8 00 00 restore tty->rawOutBuf.Head = newHead; if (tty->rawOutBufState == rob_idle) { /* check, whether XOFF has been received */ if (!(tty->flow_ctrl & FL_ORCVXOF)) { (*tty->device.write)(tty->minor, (char *)&tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1); 2004ae0: c4 06 a0 84 ld [ %i2 + 0x84 ], %g2 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, 2004ae4: d2 06 a0 7c ld [ %i2 + 0x7c ], %o1 2004ae8: c2 06 a0 a4 ld [ %i2 + 0xa4 ], %g1 2004aec: d0 06 a0 10 ld [ %i2 + 0x10 ], %o0 2004af0: 92 02 40 02 add %o1, %g2, %o1 2004af4: 9f c0 40 00 call %g1 2004af8: 94 10 20 01 mov 1, %o2 (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; 2004afc: 10 bf ff f2 b 2004ac4 2004b00: e2 26 a0 94 st %l1, [ %i2 + 0x94 ] unsigned int newHead; rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) { (*tty->device.write)(tty->minor, (void *)buf, len); 2004b04: d0 06 a0 10 ld [ %i2 + 0x10 ], %o0 2004b08: 92 10 00 18 mov %i0, %o1 2004b0c: 9f c0 40 00 call %g1 2004b10: 94 10 00 19 mov %i1, %o2 return; 2004b14: 81 c7 e0 08 ret 2004b18: 81 e8 00 00 restore tty->rawOutBufState = rob_wait; rtems_interrupt_enable (level); sc = rtems_semaphore_obtain( tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); 2004b1c: 40 00 09 34 call 2006fec <== NOT EXECUTED =============================================================================== 02005278 : return RTEMS_SUCCESSFUL; } rtems_status_code rtems_termios_read (void *arg) { 2005278: 9d e3 bf a0 save %sp, -96, %sp rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 200527c: c2 06 00 00 ld [ %i0 ], %g1 uint32_t count = args->count; 2005280: f4 06 20 14 ld [ %i0 + 0x14 ], %i2 rtems_status_code rtems_termios_read (void *arg) { rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 2005284: fa 00 60 38 ld [ %g1 + 0x38 ], %i5 uint32_t count = args->count; char *buffer = args->buffer; 2005288: e4 06 20 10 ld [ %i0 + 0x10 ], %l2 rtems_status_code sc; sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 200528c: d0 07 60 14 ld [ %i5 + 0x14 ], %o0 2005290: 92 10 20 00 clr %o1 2005294: 40 00 05 99 call 20068f8 2005298: 94 10 20 00 clr %o2 if (sc != RTEMS_SUCCESSFUL) 200529c: a0 92 20 00 orcc %o0, 0, %l0 20052a0: 12 80 00 10 bne 20052e0 <== NEVER TAKEN 20052a4: 03 00 80 75 sethi %hi(0x201d400), %g1 return sc; if (rtems_termios_linesw[tty->t_line].l_read != NULL) { 20052a8: c4 07 60 cc ld [ %i5 + 0xcc ], %g2 20052ac: 85 28 a0 05 sll %g2, 5, %g2 20052b0: 82 10 61 00 or %g1, 0x100, %g1 20052b4: 82 00 40 02 add %g1, %g2, %g1 20052b8: c2 00 60 08 ld [ %g1 + 8 ], %g1 20052bc: 80 a0 60 00 cmp %g1, 0 20052c0: 02 80 00 0a be 20052e8 20052c4: 90 10 00 1d mov %i5, %o0 sc = rtems_termios_linesw[tty->t_line].l_read(tty,args); 20052c8: 9f c0 40 00 call %g1 20052cc: 92 10 00 18 mov %i0, %o1 20052d0: a0 10 00 08 mov %o0, %l0 tty->tty_rcvwakeup = 0; rtems_semaphore_release (tty->isem); 20052d4: d0 07 60 14 ld [ %i5 + 0x14 ], %o0 20052d8: 40 00 05 d2 call 2006a20 20052dc: c0 27 60 e4 clr [ %i5 + 0xe4 ] } args->bytes_moved = args->count - count; tty->tty_rcvwakeup = 0; rtems_semaphore_release (tty->isem); return sc; } 20052e0: 81 c7 e0 08 ret 20052e4: 91 e8 00 10 restore %g0, %l0, %o0 tty->tty_rcvwakeup = 0; rtems_semaphore_release (tty->isem); return sc; } if (tty->cindex == tty->ccount) { 20052e8: c4 07 60 24 ld [ %i5 + 0x24 ], %g2 20052ec: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 20052f0: 80 a0 80 01 cmp %g2, %g1 20052f4: 22 80 00 20 be,a 2005374 <== ALWAYS TAKEN 20052f8: c4 07 60 28 ld [ %i5 + 0x28 ], %g2 sc = fillBufferQueue (tty); if (sc != RTEMS_SUCCESSFUL) tty->cindex = tty->ccount = 0; } while (count && (tty->cindex < tty->ccount)) { 20052fc: 80 a6 a0 00 cmp %i2, 0 <== NOT EXECUTED 2005300: 22 80 00 15 be,a 2005354 <== NEVER TAKEN 2005304: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 <== NOT EXECUTED 2005308: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 200530c: c4 07 60 20 ld [ %i5 + 0x20 ], %g2 2005310: 80 a0 40 02 cmp %g1, %g2 2005314: 36 80 00 10 bge,a 2005354 <== NEVER TAKEN 2005318: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 <== NOT EXECUTED 200531c: 10 80 00 06 b 2005334 2005320: a4 24 80 01 sub %l2, %g1, %l2 2005324: c4 07 60 20 ld [ %i5 + 0x20 ], %g2 2005328: 80 a0 80 01 cmp %g2, %g1 200532c: 24 80 00 0a ble,a 2005354 2005330: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 *buffer++ = tty->cbuf[tty->cindex++]; 2005334: c4 07 60 1c ld [ %i5 + 0x1c ], %g2 sc = fillBufferQueue (tty); if (sc != RTEMS_SUCCESSFUL) tty->cindex = tty->ccount = 0; } while (count && (tty->cindex < tty->ccount)) { 2005338: b4 86 bf ff addcc %i2, -1, %i2 *buffer++ = tty->cbuf[tty->cindex++]; 200533c: c4 08 80 01 ldub [ %g2 + %g1 ], %g2 2005340: c4 2c 80 01 stb %g2, [ %l2 + %g1 ] 2005344: 82 00 60 01 inc %g1 sc = fillBufferQueue (tty); if (sc != RTEMS_SUCCESSFUL) tty->cindex = tty->ccount = 0; } while (count && (tty->cindex < tty->ccount)) { 2005348: 12 bf ff f7 bne 2005324 200534c: c2 27 60 24 st %g1, [ %i5 + 0x24 ] *buffer++ = tty->cbuf[tty->cindex++]; count--; } args->bytes_moved = args->count - count; 2005350: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 tty->tty_rcvwakeup = 0; rtems_semaphore_release (tty->isem); 2005354: d0 07 60 14 ld [ %i5 + 0x14 ], %o0 } while (count && (tty->cindex < tty->ccount)) { *buffer++ = tty->cbuf[tty->cindex++]; count--; } args->bytes_moved = args->count - count; 2005358: b4 20 40 1a sub %g1, %i2, %i2 200535c: f4 26 20 1c st %i2, [ %i0 + 0x1c ] tty->tty_rcvwakeup = 0; 2005360: c0 27 60 e4 clr [ %i5 + 0xe4 ] rtems_semaphore_release (tty->isem); 2005364: 40 00 05 af call 2006a20 2005368: b0 10 00 10 mov %l0, %i0 return sc; } 200536c: 81 c7 e0 08 ret 2005370: 81 e8 00 00 restore } if (tty->cindex == tty->ccount) { tty->cindex = tty->ccount = 0; tty->read_start_column = tty->column; if (tty->device.pollRead != NULL && 2005374: c2 07 60 a0 ld [ %i5 + 0xa0 ], %g1 rtems_semaphore_release (tty->isem); return sc; } if (tty->cindex == tty->ccount) { tty->cindex = tty->ccount = 0; 2005378: c0 27 60 20 clr [ %i5 + 0x20 ] 200537c: c0 27 60 24 clr [ %i5 + 0x24 ] tty->read_start_column = tty->column; if (tty->device.pollRead != NULL && 2005380: 80 a0 60 00 cmp %g1, 0 2005384: 02 80 00 06 be 200539c 2005388: c4 27 60 2c st %g2, [ %i5 + 0x2c ] 200538c: c4 07 60 b4 ld [ %i5 + 0xb4 ], %g2 2005390: 80 a0 a0 00 cmp %g2, 0 2005394: 22 80 00 73 be,a 2005560 2005398: c4 07 60 3c ld [ %i5 + 0x3c ], %g2 * Fill the input buffer from the raw input queue */ static rtems_status_code fillBufferQueue (struct rtems_termios_tty *tty) { rtems_interval timeout = tty->rawInBufSemaphoreFirstTimeout; 200539c: f8 07 60 74 ld [ %i5 + 0x74 ], %i4 rtems_status_code sc; int wait = (int)1; 20053a0: b6 10 20 01 mov 1, %i3 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && (tty->ccount < (CBUFSIZE-1))) { 20053a4: 23 00 80 73 sethi %hi(0x201cc00), %l1 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)( 20053a8: a6 07 60 49 add %i5, 0x49, %l3 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 20053ac: c4 07 60 5c ld [ %i5 + 0x5c ], %g2 20053b0: c2 07 60 60 ld [ %i5 + 0x60 ], %g1 20053b4: 80 a0 80 01 cmp %g2, %g1 20053b8: 02 80 00 51 be 20054fc 20053bc: c4 04 61 e8 ld [ %l1 + 0x1e8 ], %g2 20053c0: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 (tty->ccount < (CBUFSIZE-1))) { 20053c4: 84 00 bf ff add %g2, -1, %g2 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 20053c8: 80 a0 80 01 cmp %g2, %g1 20053cc: 14 80 00 14 bg 200541c <== ALWAYS TAKEN 20053d0: b2 14 61 e8 or %l1, 0x1e8, %i1 } /* * Wait for characters */ if ( wait ) { 20053d4: 10 80 00 4b b 2005500 <== NOT EXECUTED 20053d8: 80 a6 e0 00 cmp %i3, 0 <== NOT EXECUTED } } /* continue processing new character */ if (tty->termios.c_lflag & ICANON) { if (siproc (c, tty)) 20053dc: 7f ff ff 62 call 2005164 20053e0: 01 00 00 00 nop wait = 0; 20053e4: 80 a0 00 08 cmp %g0, %o0 20053e8: 82 40 3f ff addx %g0, -1, %g1 20053ec: b6 0e c0 01 and %i3, %g1, %i3 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 20053f0: c4 07 60 5c ld [ %i5 + 0x5c ], %g2 20053f4: c2 07 60 60 ld [ %i5 + 0x60 ], %g1 20053f8: 80 a0 80 01 cmp %g2, %g1 20053fc: 02 80 00 40 be 20054fc 2005400: f8 07 60 70 ld [ %i5 + 0x70 ], %i4 (tty->ccount < (CBUFSIZE-1))) { 2005404: c2 06 40 00 ld [ %i1 ], %g1 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 2005408: c4 07 60 20 ld [ %i5 + 0x20 ], %g2 (tty->ccount < (CBUFSIZE-1))) { 200540c: 82 00 7f ff add %g1, -1, %g1 while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 2005410: 80 a0 80 01 cmp %g2, %g1 2005414: 16 80 00 3b bge 2005500 <== NEVER TAKEN 2005418: 80 a6 e0 00 cmp %i3, 0 (tty->ccount < (CBUFSIZE-1))) { unsigned char c; unsigned int newHead; newHead = (tty->rawInBuf.Head + 1) % tty->rawInBuf.Size; 200541c: d0 07 60 5c ld [ %i5 + 0x5c ], %o0 2005420: d2 07 60 64 ld [ %i5 + 0x64 ], %o1 2005424: 40 00 4d 8a call 2018a4c <.urem> 2005428: 90 02 20 01 inc %o0 c = tty->rawInBuf.theBuf[newHead]; 200542c: c2 07 60 58 ld [ %i5 + 0x58 ], %g1 2005430: f8 08 40 08 ldub [ %g1 + %o0 ], %i4 tty->rawInBuf.Head = newHead; 2005434: d0 27 60 5c st %o0, [ %i5 + 0x5c ] if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size) 2005438: c2 07 60 60 ld [ %i5 + 0x60 ], %g1 200543c: c4 07 60 64 ld [ %i5 + 0x64 ], %g2 % tty->rawInBuf.Size) 2005440: d2 07 60 64 ld [ %i5 + 0x64 ], %o1 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) 2005444: 82 00 80 01 add %g2, %g1, %g1 % tty->rawInBuf.Size) 2005448: 40 00 4d 81 call 2018a4c <.urem> 200544c: 90 20 40 08 sub %g1, %o0, %o0 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) 2005450: c2 07 60 bc ld [ %i5 + 0xbc ], %g1 2005454: 80 a2 00 01 cmp %o0, %g1 2005458: 3a 80 00 18 bcc,a 20054b8 <== NEVER TAKEN 200545c: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 <== NOT EXECUTED % tty->rawInBuf.Size) < tty->lowwater) { tty->flow_ctrl &= ~FL_IREQXOF; 2005460: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 2005464: 82 08 7f fe and %g1, -2, %g1 2005468: c2 27 60 b8 st %g1, [ %i5 + 0xb8 ] /* if tx stopped and XON should be sent... */ if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF)) 200546c: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 2005470: 82 08 62 02 and %g1, 0x202, %g1 2005474: 80 a0 62 02 cmp %g1, 0x202 2005478: 22 80 00 2c be,a 2005528 <== NEVER TAKEN 200547c: c2 07 60 94 ld [ %i5 + 0x94 ], %g1 <== NOT EXECUTED && ((tty->rawOutBufState == rob_idle) || (tty->flow_ctrl & FL_OSTOP))) { /* XON should be sent now... */ (*tty->device.write)( tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1); } else if (tty->flow_ctrl & FL_MDRTS) { 2005480: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 2005484: 80 88 61 00 btst 0x100, %g1 2005488: 22 80 00 0c be,a 20054b8 <== ALWAYS TAKEN 200548c: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 tty->flow_ctrl &= ~FL_IRTSOFF; 2005490: c4 07 60 b8 ld [ %i5 + 0xb8 ], %g2 <== NOT EXECUTED /* activate RTS line */ if (tty->device.startRemoteTx != NULL) { 2005494: c2 07 60 b0 ld [ %i5 + 0xb0 ], %g1 <== 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; 2005498: 84 08 bf fb and %g2, -5, %g2 <== NOT EXECUTED 200549c: c4 27 60 b8 st %g2, [ %i5 + 0xb8 ] <== NOT EXECUTED /* activate RTS line */ if (tty->device.startRemoteTx != NULL) { 20054a0: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 20054a4: 22 80 00 05 be,a 20054b8 <== NOT EXECUTED 20054a8: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 <== NOT EXECUTED tty->device.startRemoteTx(tty->minor); 20054ac: 9f c0 40 00 call %g1 <== NOT EXECUTED 20054b0: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 <== NOT EXECUTED } } } /* continue processing new character */ if (tty->termios.c_lflag & ICANON) { 20054b4: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 <== NOT EXECUTED if (siproc (c, tty)) 20054b8: 90 0f 20 ff and %i4, 0xff, %o0 } } } /* continue processing new character */ if (tty->termios.c_lflag & ICANON) { 20054bc: 80 88 60 02 btst 2, %g1 20054c0: 12 bf ff c7 bne 20053dc <== ALWAYS TAKEN 20054c4: 92 10 00 1d mov %i5, %o1 if (siproc (c, tty)) wait = 0; } else { siproc (c, tty); 20054c8: 7f ff ff 27 call 2005164 <== NOT EXECUTED 20054cc: 01 00 00 00 nop <== NOT EXECUTED if (tty->ccount >= tty->termios.c_cc[VMIN]) 20054d0: c2 0f 60 47 ldub [ %i5 + 0x47 ], %g1 <== NOT EXECUTED 20054d4: c4 07 60 20 ld [ %i5 + 0x20 ], %g2 <== NOT EXECUTED 20054d8: 80 a0 80 01 cmp %g2, %g1 <== NOT EXECUTED 20054dc: 06 bf ff c5 bl 20053f0 <== NOT EXECUTED 20054e0: 01 00 00 00 nop <== NOT EXECUTED while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 20054e4: c4 07 60 5c ld [ %i5 + 0x5c ], %g2 <== NOT EXECUTED 20054e8: c2 07 60 60 ld [ %i5 + 0x60 ], %g1 <== NOT EXECUTED if (siproc (c, tty)) wait = 0; } else { siproc (c, tty); if (tty->ccount >= tty->termios.c_cc[VMIN]) wait = 0; 20054ec: b6 10 20 00 clr %i3 <== NOT EXECUTED while ( wait ) { /* * Process characters read from raw queue */ while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && 20054f0: 80 a0 80 01 cmp %g2, %g1 <== NOT EXECUTED 20054f4: 12 bf ff c4 bne 2005404 <== NOT EXECUTED 20054f8: f8 07 60 70 ld [ %i5 + 0x70 ], %i4 <== NOT EXECUTED } /* * Wait for characters */ if ( wait ) { 20054fc: 80 a6 e0 00 cmp %i3, 0 2005500: 02 bf ff 80 be 2005300 2005504: 80 a6 a0 00 cmp %i2, 0 sc = rtems_semaphore_obtain( 2005508: d0 07 60 68 ld [ %i5 + 0x68 ], %o0 200550c: d2 07 60 6c ld [ %i5 + 0x6c ], %o1 2005510: 40 00 04 fa call 20068f8 2005514: 94 10 00 1c mov %i4, %o2 tty->rawInBuf.Semaphore, tty->rawInBufSemaphoreOptions, timeout); if (sc != RTEMS_SUCCESSFUL) 2005518: 80 a2 20 00 cmp %o0, 0 200551c: 02 bf ff a4 be 20053ac <== ALWAYS TAKEN 2005520: 80 a6 a0 00 cmp %i2, 0 2005524: 30 bf ff 77 b,a 2005300 <== NOT EXECUTED < tty->lowwater) { tty->flow_ctrl &= ~FL_IREQXOF; /* if tx stopped and XON should be sent... */ if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF)) == (FL_MDXON | FL_ISNTXOF)) && ((tty->rawOutBufState == rob_idle) 2005528: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 200552c: 22 80 00 07 be,a 2005548 <== NOT EXECUTED 2005530: c2 07 60 a4 ld [ %i5 + 0xa4 ], %g1 <== NOT EXECUTED || (tty->flow_ctrl & FL_OSTOP))) { 2005534: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 <== NOT EXECUTED 2005538: 80 88 60 20 btst 0x20, %g1 <== NOT EXECUTED 200553c: 02 bf ff d1 be 2005480 <== NOT EXECUTED 2005540: 01 00 00 00 nop <== NOT EXECUTED /* XON should be sent now... */ (*tty->device.write)( 2005544: c2 07 60 a4 ld [ %i5 + 0xa4 ], %g1 <== NOT EXECUTED 2005548: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 <== NOT EXECUTED 200554c: 92 10 00 13 mov %l3, %o1 <== NOT EXECUTED 2005550: 9f c0 40 00 call %g1 <== NOT EXECUTED 2005554: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED } } } /* continue processing new character */ if (tty->termios.c_lflag & ICANON) { 2005558: 10 bf ff d8 b 20054b8 <== NOT EXECUTED 200555c: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 <== NOT EXECUTED static rtems_status_code fillBufferPoll (struct rtems_termios_tty *tty) { int n; if (tty->termios.c_lflag & ICANON) { 2005560: 80 88 a0 02 btst 2, %g2 2005564: 02 80 00 0e be 200559c 2005568: 01 00 00 00 nop for (;;) { n = (*tty->device.pollRead)(tty->minor); 200556c: 9f c0 40 00 call %g1 2005570: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 if (n < 0) { 2005574: 80 a2 20 00 cmp %o0, 0 2005578: 06 80 00 3a bl 2005660 200557c: 90 0a 20 ff and %o0, 0xff, %o0 rtems_task_wake_after (1); } else { if (siproc (n, tty)) 2005580: 7f ff fe f9 call 2005164 2005584: 92 10 00 1d mov %i5, %o1 2005588: 80 a2 20 00 cmp %o0, 0 200558c: 12 bf ff 5d bne 2005300 2005590: 80 a6 a0 00 cmp %i2, 0 static rtems_status_code fillBufferPoll (struct rtems_termios_tty *tty) { int n; if (tty->termios.c_lflag & ICANON) { 2005594: 10 bf ff f6 b 200556c 2005598: c2 07 60 a0 ld [ %i5 + 0xa0 ], %g1 } } } else { rtems_interval then, now; then = rtems_clock_get_ticks_since_boot(); 200559c: 40 00 03 14 call 20061ec 20055a0: 01 00 00 00 nop 20055a4: b8 10 00 08 mov %o0, %i4 for (;;) { n = (*tty->device.pollRead)(tty->minor); 20055a8: c2 07 60 a0 ld [ %i5 + 0xa0 ], %g1 20055ac: 9f c0 40 00 call %g1 20055b0: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 if (n < 0) { 20055b4: 80 a2 20 00 cmp %o0, 0 20055b8: 06 80 00 10 bl 20055f8 20055bc: 90 0a 20 ff and %o0, 0xff, %o0 break; } } rtems_task_wake_after (1); } else { siproc (n, tty); 20055c0: 7f ff fe e9 call 2005164 20055c4: 92 10 00 1d mov %i5, %o1 if (tty->ccount >= tty->termios.c_cc[VMIN]) 20055c8: c2 0f 60 47 ldub [ %i5 + 0x47 ], %g1 20055cc: c4 07 60 20 ld [ %i5 + 0x20 ], %g2 20055d0: 80 a0 80 01 cmp %g2, %g1 20055d4: 16 bf ff 4a bge 20052fc <== NEVER TAKEN 20055d8: 80 a0 60 00 cmp %g1, 0 break; if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME]) 20055dc: 22 bf ff f4 be,a 20055ac <== NEVER TAKEN 20055e0: c2 07 60 a0 ld [ %i5 + 0xa0 ], %g1 <== NOT EXECUTED 20055e4: c2 0f 60 46 ldub [ %i5 + 0x46 ], %g1 20055e8: 80 a0 60 00 cmp %g1, 0 20055ec: 22 bf ff f0 be,a 20055ac <== NEVER TAKEN 20055f0: c2 07 60 a0 ld [ %i5 + 0xa0 ], %g1 <== NOT EXECUTED 20055f4: 30 bf ff ea b,a 200559c then = rtems_clock_get_ticks_since_boot(); for (;;) { n = (*tty->device.pollRead)(tty->minor); if (n < 0) { if (tty->termios.c_cc[VMIN]) { 20055f8: c2 0f 60 47 ldub [ %i5 + 0x47 ], %g1 20055fc: 80 a0 60 00 cmp %g1, 0 2005600: 02 80 00 0d be 2005634 <== NEVER TAKEN 2005604: c2 0f 60 46 ldub [ %i5 + 0x46 ], %g1 if (tty->termios.c_cc[VTIME] && tty->ccount) { 2005608: 80 a0 60 00 cmp %g1, 0 200560c: 02 80 00 06 be 2005624 <== NEVER TAKEN 2005610: 01 00 00 00 nop 2005614: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 2005618: 80 a0 60 00 cmp %g1, 0 200561c: 12 80 00 09 bne 2005640 2005620: 01 00 00 00 nop now = rtems_clock_get_ticks_since_boot(); if ((now - then) > tty->vtimeTicks) { break; } } rtems_task_wake_after (1); 2005624: 40 00 05 e9 call 2006dc8 2005628: 90 10 20 01 mov 1, %o0 ! 1 } else { rtems_interval then, now; then = rtems_clock_get_ticks_since_boot(); for (;;) { n = (*tty->device.pollRead)(tty->minor); 200562c: 10 bf ff e0 b 20055ac 2005630: c2 07 60 a0 ld [ %i5 + 0xa0 ], %g1 if ((now - then) > tty->vtimeTicks) { break; } } } else { if (!tty->termios.c_cc[VTIME]) 2005634: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 2005638: 02 bf ff 32 be 2005300 <== NOT EXECUTED 200563c: 80 a6 a0 00 cmp %i2, 0 <== NOT EXECUTED break; now = rtems_clock_get_ticks_since_boot(); 2005640: 40 00 02 eb call 20061ec 2005644: 01 00 00 00 nop if ((now - then) > tty->vtimeTicks) { 2005648: c2 07 60 54 ld [ %i5 + 0x54 ], %g1 200564c: 90 22 00 1c sub %o0, %i4, %o0 2005650: 80 a2 00 01 cmp %o0, %g1 2005654: 08 bf ff f4 bleu 2005624 2005658: 80 a6 a0 00 cmp %i2, 0 200565c: 30 bf ff 29 b,a 2005300 if (tty->termios.c_lflag & ICANON) { for (;;) { n = (*tty->device.pollRead)(tty->minor); if (n < 0) { rtems_task_wake_after (1); 2005660: 40 00 05 da call 2006dc8 2005664: 90 10 20 01 mov 1, %o0 static rtems_status_code fillBufferPoll (struct rtems_termios_tty *tty) { int n; if (tty->termios.c_lflag & ICANON) { 2005668: 10 bf ff c1 b 200556c 200566c: c2 07 60 a0 ld [ %i5 + 0xa0 ], %g1 =============================================================================== 02005a1c : * 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) { 2005a1c: 9d e3 bf a0 save %sp, -96, %sp int nToSend; rtems_interrupt_level level; int len; /* check for XOF/XON to send */ if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF)) 2005a20: c2 06 20 b8 ld [ %i0 + 0xb8 ], %g1 2005a24: 82 08 64 03 and %g1, 0x403, %g1 2005a28: 80 a0 64 01 cmp %g1, 0x401 2005a2c: 02 80 00 44 be 2005b3c <== NEVER TAKEN 2005a30: ba 10 00 18 mov %i0, %i5 tty->flow_ctrl |= FL_ISNTXOF; rtems_interrupt_enable(level); nToSend = 1; } else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) { 2005a34: c2 06 20 b8 ld [ %i0 + 0xb8 ], %g1 2005a38: 82 08 60 03 and %g1, 3, %g1 2005a3c: 80 a0 60 02 cmp %g1, 2 2005a40: 22 80 00 50 be,a 2005b80 <== NEVER TAKEN 2005a44: c2 06 20 a4 ld [ %i0 + 0xa4 ], %g1 <== NOT EXECUTED tty->flow_ctrl &= ~FL_ISNTXOF; rtems_interrupt_enable(level); nToSend = 1; } else { if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) { 2005a48: c4 06 20 80 ld [ %i0 + 0x80 ], %g2 2005a4c: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 2005a50: 80 a0 80 01 cmp %g2, %g1 2005a54: 22 80 00 30 be,a 2005b14 2005a58: c2 06 20 94 ld [ %i0 + 0x94 ], %g1 rtems_semaphore_release (tty->rawOutBuf.Semaphore); } return 0; } rtems_interrupt_disable(level); 2005a5c: 7f ff f1 cb call 2002188 2005a60: 01 00 00 00 nop len = tty->t_dqlen; 2005a64: f8 06 20 90 ld [ %i0 + 0x90 ], %i4 tty->t_dqlen = 0; 2005a68: c0 26 20 90 clr [ %i0 + 0x90 ] rtems_interrupt_enable(level); 2005a6c: 7f ff f1 cb call 2002198 2005a70: 01 00 00 00 nop newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size; 2005a74: d0 06 20 84 ld [ %i0 + 0x84 ], %o0 2005a78: d2 06 20 88 ld [ %i0 + 0x88 ], %o1 2005a7c: 40 00 4b f4 call 2018a4c <.urem> 2005a80: 90 07 00 08 add %i4, %o0, %o0 tty->rawOutBuf.Tail = newTail; if (tty->rawOutBufState == rob_wait) { 2005a84: c2 06 20 94 ld [ %i0 + 0x94 ], %g1 len = tty->t_dqlen; tty->t_dqlen = 0; rtems_interrupt_enable(level); newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size; tty->rawOutBuf.Tail = newTail; 2005a88: d0 27 60 84 st %o0, [ %i5 + 0x84 ] if (tty->rawOutBufState == rob_wait) { 2005a8c: 80 a0 60 02 cmp %g1, 2 2005a90: 02 80 00 55 be 2005be4 2005a94: b8 10 00 08 mov %o0, %i4 * wake up any pending writer task */ rtems_semaphore_release (tty->rawOutBuf.Semaphore); } if (newTail == tty->rawOutBuf.Head) { 2005a98: c2 07 60 80 ld [ %i5 + 0x80 ], %g1 2005a9c: 80 a0 40 1c cmp %g1, %i4 2005aa0: 22 80 00 48 be,a 2005bc0 2005aa4: c2 07 60 d4 ld [ %i5 + 0xd4 ], %g1 if ( tty->tty_snd.sw_pfn != NULL) { (*tty->tty_snd.sw_pfn)(&tty->termios, tty->tty_snd.sw_arg); } } /* check, whether output should stop due to received XOFF */ else if ((tty->flow_ctrl & (FL_MDXON | FL_ORCVXOF)) 2005aa8: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 2005aac: 82 08 62 10 and %g1, 0x210, %g1 2005ab0: 80 a0 62 10 cmp %g1, 0x210 2005ab4: 02 80 00 4f be 2005bf0 <== NEVER TAKEN 2005ab8: 01 00 00 00 nop nToSend = 0; } else { /* * Buffer not empty, start tranmitter */ if (newTail > tty->rawOutBuf.Head) 2005abc: c2 07 60 80 ld [ %i5 + 0x80 ], %g1 2005ac0: 80 a7 00 01 cmp %i4, %g1 2005ac4: 18 80 00 1b bgu 2005b30 2005ac8: 01 00 00 00 nop nToSend = tty->rawOutBuf.Size - newTail; else nToSend = tty->rawOutBuf.Head - newTail; 2005acc: f0 07 60 80 ld [ %i5 + 0x80 ], %i0 2005ad0: b0 26 00 1c sub %i0, %i4, %i0 /* 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)) { 2005ad4: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 2005ad8: 80 88 66 00 btst 0x600, %g1 2005adc: 02 80 00 04 be 2005aec 2005ae0: 94 10 00 18 mov %i0, %o2 2005ae4: 94 10 20 01 mov 1, %o2 nToSend = 1; 2005ae8: b0 10 20 01 mov 1, %i0 } tty->rawOutBufState = rob_busy; /*apm*/ (*tty->device.write)( 2005aec: d2 07 60 7c ld [ %i5 + 0x7c ], %o1 2005af0: c2 07 60 a4 ld [ %i5 + 0xa4 ], %g1 2005af4: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 /* 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*/ 2005af8: 84 10 20 01 mov 1, %g2 (*tty->device.write)( 2005afc: 92 02 40 1c add %o1, %i4, %o1 2005b00: 9f c0 40 00 call %g1 2005b04: c4 27 60 94 st %g2, [ %i5 + 0x94 ] tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend); } tty->rawOutBuf.Tail = newTail; /*apm*/ 2005b08: f8 27 60 84 st %i4, [ %i5 + 0x84 ] } return nToSend; } 2005b0c: 81 c7 e0 08 ret 2005b10: 81 e8 00 00 restore } else { if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) { /* * buffer was empty */ if (tty->rawOutBufState == rob_wait) { 2005b14: 80 a0 60 02 cmp %g1, 2 2005b18: 12 bf ff fd bne 2005b0c <== ALWAYS TAKEN 2005b1c: b0 10 20 00 clr %i0 /* * this should never happen... */ rtems_semaphore_release (tty->rawOutBuf.Semaphore); 2005b20: 40 00 03 c0 call 2006a20 <== NOT EXECUTED 2005b24: d0 07 60 8c ld [ %i5 + 0x8c ], %o0 <== NOT EXECUTED 2005b28: 81 c7 e0 08 ret <== NOT EXECUTED 2005b2c: 81 e8 00 00 restore <== NOT EXECUTED } else { /* * Buffer not empty, start tranmitter */ if (newTail > tty->rawOutBuf.Head) nToSend = tty->rawOutBuf.Size - newTail; 2005b30: f0 07 60 88 ld [ %i5 + 0x88 ], %i0 2005b34: 10 bf ff e8 b 2005ad4 2005b38: b0 26 00 1c sub %i0, %i4, %i0 /* check for XOF/XON to send */ if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF)) == (FL_MDXOF | FL_IREQXOF)) { /* XOFF should be sent now... */ (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1); 2005b3c: c2 06 20 a4 ld [ %i0 + 0xa4 ], %g1 <== NOT EXECUTED 2005b40: d0 06 20 10 ld [ %i0 + 0x10 ], %o0 <== NOT EXECUTED 2005b44: 92 06 20 4a add %i0, 0x4a, %o1 <== NOT EXECUTED 2005b48: 9f c0 40 00 call %g1 <== NOT EXECUTED 2005b4c: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED rtems_interrupt_disable(level); 2005b50: 7f ff f1 8e call 2002188 <== NOT EXECUTED 2005b54: 01 00 00 00 nop <== NOT EXECUTED tty->t_dqlen--; 2005b58: c4 06 20 90 ld [ %i0 + 0x90 ], %g2 <== NOT EXECUTED tty->flow_ctrl |= FL_ISNTXOF; 2005b5c: c2 06 20 b8 ld [ %i0 + 0xb8 ], %g1 <== NOT EXECUTED == (FL_MDXOF | FL_IREQXOF)) { /* XOFF should be sent now... */ (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1); rtems_interrupt_disable(level); tty->t_dqlen--; 2005b60: 84 00 bf ff add %g2, -1, %g2 <== NOT EXECUTED tty->flow_ctrl |= FL_ISNTXOF; 2005b64: 82 10 60 02 or %g1, 2, %g1 <== 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--; 2005b68: c4 27 60 90 st %g2, [ %i5 + 0x90 ] <== NOT EXECUTED tty->flow_ctrl &= ~FL_ISNTXOF; 2005b6c: c2 27 60 b8 st %g1, [ %i5 + 0xb8 ] <== NOT EXECUTED rtems_interrupt_enable(level); 2005b70: 7f ff f1 8a call 2002198 <== NOT EXECUTED 2005b74: b0 10 20 01 mov 1, %i0 <== NOT EXECUTED 2005b78: 81 c7 e0 08 ret <== NOT EXECUTED 2005b7c: 81 e8 00 00 restore <== NOT EXECUTED * FIXME: this .write call will generate another * dequeue callback. This will advance the "Tail" in the data * buffer, although the corresponding data is not yet out! * Therefore the dequeue "length" should be reduced by 1 */ (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1); 2005b80: d0 06 20 10 ld [ %i0 + 0x10 ], %o0 <== NOT EXECUTED 2005b84: 92 06 20 49 add %i0, 0x49, %o1 <== NOT EXECUTED 2005b88: 9f c0 40 00 call %g1 <== NOT EXECUTED 2005b8c: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED rtems_interrupt_disable(level); 2005b90: 7f ff f1 7e call 2002188 <== NOT EXECUTED 2005b94: 01 00 00 00 nop <== NOT EXECUTED tty->t_dqlen--; 2005b98: c4 06 20 90 ld [ %i0 + 0x90 ], %g2 <== NOT EXECUTED tty->flow_ctrl &= ~FL_ISNTXOF; 2005b9c: c2 06 20 b8 ld [ %i0 + 0xb8 ], %g1 <== 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--; 2005ba0: 84 00 bf ff add %g2, -1, %g2 <== NOT EXECUTED tty->flow_ctrl &= ~FL_ISNTXOF; 2005ba4: 82 08 7f fd and %g1, -3, %g1 <== 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--; 2005ba8: c4 27 60 90 st %g2, [ %i5 + 0x90 ] <== NOT EXECUTED tty->flow_ctrl &= ~FL_ISNTXOF; 2005bac: c2 27 60 b8 st %g1, [ %i5 + 0xb8 ] <== NOT EXECUTED rtems_interrupt_enable(level); 2005bb0: 7f ff f1 7a call 2002198 <== NOT EXECUTED 2005bb4: b0 10 20 01 mov 1, %i0 <== NOT EXECUTED 2005bb8: 81 c7 e0 08 ret <== NOT EXECUTED 2005bbc: 81 e8 00 00 restore <== NOT EXECUTED if (newTail == tty->rawOutBuf.Head) { /* * Buffer has become empty */ tty->rawOutBufState = rob_idle; 2005bc0: c0 27 60 94 clr [ %i5 + 0x94 ] nToSend = 0; /* * check to see if snd wakeup callback was set */ if ( tty->tty_snd.sw_pfn != NULL) { 2005bc4: 80 a0 60 00 cmp %g1, 0 2005bc8: 02 bf ff d0 be 2005b08 <== ALWAYS TAKEN 2005bcc: b0 10 20 00 clr %i0 (*tty->tty_snd.sw_pfn)(&tty->termios, tty->tty_snd.sw_arg); 2005bd0: d2 07 60 d8 ld [ %i5 + 0xd8 ], %o1 <== NOT EXECUTED 2005bd4: 9f c0 40 00 call %g1 <== NOT EXECUTED 2005bd8: 90 07 60 30 add %i5, 0x30, %o0 <== NOT EXECUTED } tty->rawOutBufState = rob_busy; /*apm*/ (*tty->device.write)( tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend); } tty->rawOutBuf.Tail = newTail; /*apm*/ 2005bdc: f8 27 60 84 st %i4, [ %i5 + 0x84 ] <== NOT EXECUTED 2005be0: 30 bf ff f6 b,a 2005bb8 <== NOT EXECUTED tty->rawOutBuf.Tail = newTail; if (tty->rawOutBufState == rob_wait) { /* * wake up any pending writer task */ rtems_semaphore_release (tty->rawOutBuf.Semaphore); 2005be4: 40 00 03 8f call 2006a20 2005be8: d0 06 20 8c ld [ %i0 + 0x8c ], %o0 2005bec: 30 bf ff ab b,a 2005a98 /* check, whether output should stop due to received XOFF */ else if ((tty->flow_ctrl & (FL_MDXON | FL_ORCVXOF)) == (FL_MDXON | FL_ORCVXOF)) { /* Buffer not empty, but output stops due to XOFF */ /* set flag, that output has been stopped */ rtems_interrupt_disable(level); 2005bf0: 7f ff f1 66 call 2002188 <== NOT EXECUTED 2005bf4: 01 00 00 00 nop <== NOT EXECUTED tty->flow_ctrl |= FL_OSTOP; 2005bf8: c2 07 60 b8 ld [ %i5 + 0xb8 ], %g1 <== NOT EXECUTED tty->rawOutBufState = rob_busy; /*apm*/ 2005bfc: 84 10 20 01 mov 1, %g2 <== NOT EXECUTED else if ((tty->flow_ctrl & (FL_MDXON | FL_ORCVXOF)) == (FL_MDXON | FL_ORCVXOF)) { /* Buffer not empty, but output stops due to XOFF */ /* set flag, that output has been stopped */ rtems_interrupt_disable(level); tty->flow_ctrl |= FL_OSTOP; 2005c00: 82 10 60 20 or %g1, 0x20, %g1 <== NOT EXECUTED tty->rawOutBufState = rob_busy; /*apm*/ 2005c04: c4 27 60 94 st %g2, [ %i5 + 0x94 ] <== NOT EXECUTED else if ((tty->flow_ctrl & (FL_MDXON | FL_ORCVXOF)) == (FL_MDXON | FL_ORCVXOF)) { /* Buffer not empty, but output stops due to XOFF */ /* set flag, that output has been stopped */ rtems_interrupt_disable(level); tty->flow_ctrl |= FL_OSTOP; 2005c08: c2 27 60 b8 st %g1, [ %i5 + 0xb8 ] <== NOT EXECUTED tty->rawOutBufState = rob_busy; /*apm*/ rtems_interrupt_enable(level); 2005c0c: 7f ff f1 63 call 2002198 <== NOT EXECUTED 2005c10: b0 10 20 00 clr %i0 <== NOT EXECUTED } tty->rawOutBufState = rob_busy; /*apm*/ (*tty->device.write)( tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend); } tty->rawOutBuf.Tail = newTail; /*apm*/ 2005c14: f8 27 60 84 st %i4, [ %i5 + 0x84 ] <== NOT EXECUTED 2005c18: 30 bf ff e8 b,a 2005bb8 <== NOT EXECUTED =============================================================================== 02005998 : /* * this task actually processes any receive events */ static rtems_task rtems_termios_rxdaemon(rtems_task_argument argument) { 2005998: 9d e3 bf 98 save %sp, -104, %sp while (1) { /* * wait for rtems event */ rtems_event_receive( 200599c: 10 80 00 08 b 20059bc 20059a0: 96 07 bf f8 add %fp, -8, %o3 } /* * do something */ c = tty->device.pollRead(tty->minor); 20059a4: 9f c0 40 00 call %g1 20059a8: d0 06 20 10 ld [ %i0 + 0x10 ], %o0 if (c != EOF) { 20059ac: 80 a2 3f ff cmp %o0, -1 20059b0: 32 80 00 15 bne,a 2005a04 20059b4: d0 2f bf ff stb %o0, [ %fp + -1 ] while (1) { /* * wait for rtems event */ rtems_event_receive( 20059b8: 96 07 bf f8 add %fp, -8, %o3 20059bc: 92 10 20 02 mov 2, %o1 20059c0: 94 10 20 00 clr %o2 20059c4: 40 00 02 2b call 2006270 20059c8: 90 10 20 03 mov 3, %o0 (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) { 20059cc: c2 07 bf f8 ld [ %fp + -8 ], %g1 20059d0: 80 88 60 01 btst 1, %g1 20059d4: 22 bf ff f4 be,a 20059a4 <== ALWAYS TAKEN 20059d8: c2 06 20 a0 ld [ %i0 + 0xa0 ], %g1 tty->rxTaskId = 0; 20059dc: c0 26 20 c4 clr [ %i0 + 0xc4 ] <== NOT EXECUTED rtems_task_delete(RTEMS_SELF); 20059e0: 40 00 04 85 call 2006bf4 <== NOT EXECUTED 20059e4: 90 10 20 00 clr %o0 <== NOT EXECUTED } /* * do something */ c = tty->device.pollRead(tty->minor); 20059e8: c2 06 20 a0 ld [ %i0 + 0xa0 ], %g1 <== NOT EXECUTED 20059ec: 9f c0 40 00 call %g1 <== NOT EXECUTED 20059f0: d0 06 20 10 ld [ %i0 + 0x10 ], %o0 <== NOT EXECUTED if (c != EOF) { 20059f4: 80 a2 3f ff cmp %o0, -1 <== NOT EXECUTED 20059f8: 22 bf ff f1 be,a 20059bc <== NOT EXECUTED 20059fc: 96 07 bf f8 add %fp, -8, %o3 <== NOT EXECUTED /* * pollRead did call enqueue on its own */ c_buf = c; 2005a00: d0 2f bf ff stb %o0, [ %fp + -1 ] <== NOT EXECUTED rtems_termios_enqueue_raw_characters ( tty,&c_buf,1); 2005a04: 92 07 bf ff add %fp, -1, %o1 2005a08: 90 10 00 18 mov %i0, %o0 2005a0c: 7f ff ff 1e call 2005684 2005a10: 94 10 20 01 mov 1, %o2 while (1) { /* * wait for rtems event */ rtems_event_receive( 2005a14: 10 bf ff ea b 20059bc 2005a18: 96 07 bf f8 add %fp, -8, %o3 =============================================================================== 02005c1c : /* * this task actually processes any transmit events */ static rtems_task rtems_termios_txdaemon(rtems_task_argument argument) { 2005c1c: 9d e3 bf 98 save %sp, -104, %sp 2005c20: 3b 00 80 75 sethi %hi(0x201d400), %i5 2005c24: 10 80 00 0c b 2005c54 2005c28: ba 17 61 00 or %i5, 0x100, %i5 ! 201d500 } /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 2005c2c: 83 28 60 05 sll %g1, 5, %g1 2005c30: 82 07 40 01 add %i5, %g1, %g1 2005c34: c2 00 60 14 ld [ %g1 + 0x14 ], %g1 2005c38: 80 a0 60 00 cmp %g1, 0 2005c3c: 02 80 00 04 be 2005c4c <== ALWAYS TAKEN 2005c40: 90 10 00 18 mov %i0, %o0 rtems_termios_linesw[tty->t_line].l_start(tty); 2005c44: 9f c0 40 00 call %g1 <== NOT EXECUTED 2005c48: 01 00 00 00 nop <== NOT EXECUTED } /* * try to push further characters to device */ rtems_termios_refill_transmitter(tty); 2005c4c: 7f ff ff 74 call 2005a1c 2005c50: 90 10 00 18 mov %i0, %o0 while (1) { /* * wait for rtems event */ rtems_event_receive( 2005c54: 92 10 20 02 mov 2, %o1 2005c58: 94 10 20 00 clr %o2 2005c5c: 96 07 bf fc add %fp, -4, %o3 2005c60: 40 00 01 84 call 2006270 2005c64: 90 10 20 03 mov 3, %o0 (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) { 2005c68: c2 07 bf fc ld [ %fp + -4 ], %g1 2005c6c: 80 88 60 01 btst 1, %g1 2005c70: 22 bf ff ef be,a 2005c2c <== ALWAYS TAKEN 2005c74: c2 06 20 cc ld [ %i0 + 0xcc ], %g1 tty->txTaskId = 0; 2005c78: c0 26 20 c8 clr [ %i0 + 0xc8 ] <== NOT EXECUTED rtems_task_delete(RTEMS_SELF); 2005c7c: 40 00 03 de call 2006bf4 <== NOT EXECUTED 2005c80: 90 10 20 00 clr %o0 <== NOT EXECUTED } /* * call any line discipline start function */ if (rtems_termios_linesw[tty->t_line].l_start != NULL) { 2005c84: 10 bf ff ea b 2005c2c <== NOT EXECUTED 2005c88: c2 06 20 cc ld [ %i0 + 0xcc ], %g1 <== NOT EXECUTED =============================================================================== 020051ac : rtems_termios_puts (&c, 1, tty); } rtems_status_code rtems_termios_write (void *arg) { 20051ac: 9d e3 bf a0 save %sp, -96, %sp rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 20051b0: c2 06 00 00 ld [ %i0 ], %g1 rtems_status_code sc; sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 20051b4: 92 10 20 00 clr %o1 rtems_status_code rtems_termios_write (void *arg) { rtems_libio_rw_args_t *args = arg; struct rtems_termios_tty *tty = args->iop->data1; 20051b8: fa 00 60 38 ld [ %g1 + 0x38 ], %i5 rtems_status_code sc; sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 20051bc: 94 10 20 00 clr %o2 20051c0: 40 00 05 ce call 20068f8 20051c4: d0 07 60 18 ld [ %i5 + 0x18 ], %o0 if (sc != RTEMS_SUCCESSFUL) 20051c8: b8 92 20 00 orcc %o0, 0, %i4 20051cc: 12 80 00 0f bne 2005208 <== NEVER TAKEN 20051d0: 03 00 80 75 sethi %hi(0x201d400), %g1 return sc; if (rtems_termios_linesw[tty->t_line].l_write != NULL) { 20051d4: c4 07 60 cc ld [ %i5 + 0xcc ], %g2 20051d8: 85 28 a0 05 sll %g2, 5, %g2 20051dc: 82 10 61 00 or %g1, 0x100, %g1 20051e0: 82 00 40 02 add %g1, %g2, %g1 20051e4: c2 00 60 0c ld [ %g1 + 0xc ], %g1 20051e8: 80 a0 60 00 cmp %g1, 0 20051ec: 02 80 00 09 be 2005210 20051f0: 90 10 00 1d mov %i5, %o0 sc = rtems_termios_linesw[tty->t_line].l_write(tty,args); 20051f4: 9f c0 40 00 call %g1 20051f8: 92 10 00 18 mov %i0, %o1 20051fc: b8 10 00 08 mov %o0, %i4 rtems_semaphore_release (tty->osem); 2005200: 40 00 06 08 call 2006a20 2005204: d0 07 60 18 ld [ %i5 + 0x18 ], %o0 rtems_termios_puts (args->buffer, args->count, tty); args->bytes_moved = args->count; } rtems_semaphore_release (tty->osem); return sc; } 2005208: 81 c7 e0 08 ret 200520c: 91 e8 00 1c restore %g0, %i4, %o0 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) { 2005210: c2 07 60 34 ld [ %i5 + 0x34 ], %g1 2005214: 80 88 60 01 btst 1, %g1 2005218: 22 80 00 14 be,a 2005268 <== NEVER TAKEN 200521c: d0 1e 20 10 ldd [ %i0 + 0x10 ], %o0 <== NOT EXECUTED uint32_t count = args->count; char *buffer = args->buffer; 2005220: f4 1e 20 10 ldd [ %i0 + 0x10 ], %i2 while (count--) 2005224: 80 a6 e0 00 cmp %i3, 0 2005228: 02 80 00 0a be 2005250 <== NEVER TAKEN 200522c: 82 10 20 00 clr %g1 oproc (*buffer++, tty); 2005230: d0 0e 80 00 ldub [ %i2 ], %o0 2005234: 92 10 00 1d mov %i5, %o1 2005238: 7f ff fe 3c call 2004b28 200523c: 90 0a 20 ff and %o0, 0xff, %o0 return sc; } if (tty->termios.c_oflag & OPOST) { uint32_t count = args->count; char *buffer = args->buffer; while (count--) 2005240: b6 86 ff ff addcc %i3, -1, %i3 2005244: 12 bf ff fb bne 2005230 2005248: b4 06 a0 01 inc %i2 oproc (*buffer++, tty); args->bytes_moved = args->count; } else { rtems_termios_puts (args->buffer, args->count, tty); args->bytes_moved = args->count; 200524c: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 } rtems_semaphore_release (tty->osem); 2005250: d0 07 60 18 ld [ %i5 + 0x18 ], %o0 while (count--) oproc (*buffer++, tty); args->bytes_moved = args->count; } else { rtems_termios_puts (args->buffer, args->count, tty); args->bytes_moved = args->count; 2005254: c2 26 20 1c st %g1, [ %i0 + 0x1c ] } rtems_semaphore_release (tty->osem); 2005258: 40 00 05 f2 call 2006a20 200525c: b0 10 00 1c mov %i4, %i0 return sc; } 2005260: 81 c7 e0 08 ret 2005264: 81 e8 00 00 restore char *buffer = args->buffer; while (count--) oproc (*buffer++, tty); args->bytes_moved = args->count; } else { rtems_termios_puts (args->buffer, args->count, tty); 2005268: 7f ff fd e0 call 20049e8 <== NOT EXECUTED 200526c: 94 10 00 1d mov %i5, %o2 <== NOT EXECUTED args->bytes_moved = args->count; 2005270: 10 bf ff f8 b 2005250 <== NOT EXECUTED 2005274: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 <== NOT EXECUTED =============================================================================== 02015dd4 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 2015dd4: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 2015dd8: 11 00 80 f9 sethi %hi(0x203e400), %o0 2015ddc: 92 10 00 18 mov %i0, %o1 2015de0: 90 12 22 34 or %o0, 0x234, %o0 2015de4: 40 00 0c bb call 20190d0 <_Objects_Get> 2015de8: 94 07 bf fc add %fp, -4, %o2 Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 2015dec: c2 07 bf fc ld [ %fp + -4 ], %g1 2015df0: 80 a0 60 00 cmp %g1, 0 2015df4: 12 80 00 0c bne 2015e24 2015df8: 01 00 00 00 nop case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 2015dfc: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 2015e00: 80 a0 60 04 cmp %g1, 4 2015e04: 02 80 00 04 be 2015e14 <== NEVER TAKEN 2015e08: 01 00 00 00 nop (void) _Watchdog_Remove( &the_timer->Ticker ); 2015e0c: 40 00 15 83 call 201b418 <_Watchdog_Remove> 2015e10: 90 02 20 10 add %o0, 0x10, %o0 _Thread_Enable_dispatch(); 2015e14: 40 00 10 77 call 2019ff0 <_Thread_Enable_dispatch> 2015e18: b0 10 20 00 clr %i0 return RTEMS_SUCCESSFUL; 2015e1c: 81 c7 e0 08 ret 2015e20: 81 e8 00 00 restore case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 2015e24: 81 c7 e0 08 ret 2015e28: 91 e8 20 04 restore %g0, 4, %o0 =============================================================================== 020162fc : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 20162fc: 9d e3 bf 98 save %sp, -104, %sp Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 2016300: 03 00 80 f9 sethi %hi(0x203e400), %g1 2016304: fa 00 62 74 ld [ %g1 + 0x274 ], %i5 ! 203e674 <_Timer_server> rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 2016308: b8 10 00 18 mov %i0, %i4 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) 201630c: 80 a7 60 00 cmp %i5, 0 2016310: 02 80 00 32 be 20163d8 2016314: b0 10 20 0e mov 0xe, %i0 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 2016318: 03 00 80 f7 sethi %hi(0x203dc00), %g1 201631c: c2 08 60 d0 ldub [ %g1 + 0xd0 ], %g1 ! 203dcd0 <_TOD_Is_set> 2016320: 80 a0 60 00 cmp %g1, 0 2016324: 02 80 00 2d be 20163d8 <== NEVER TAKEN 2016328: b0 10 20 0b mov 0xb, %i0 return RTEMS_NOT_DEFINED; if ( !routine ) 201632c: 80 a6 a0 00 cmp %i2, 0 2016330: 02 80 00 2a be 20163d8 2016334: b0 10 20 09 mov 9, %i0 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 2016338: 90 10 00 19 mov %i1, %o0 201633c: 7f ff f3 d5 call 2013290 <_TOD_Validate> 2016340: b0 10 20 14 mov 0x14, %i0 2016344: 80 8a 20 ff btst 0xff, %o0 2016348: 02 80 00 24 be 20163d8 201634c: 01 00 00 00 nop return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 2016350: 7f ff f3 9c call 20131c0 <_TOD_To_seconds> 2016354: 90 10 00 19 mov %i1, %o0 if ( seconds <= _TOD_Seconds_since_epoch() ) 2016358: 21 00 80 f7 sethi %hi(0x203dc00), %l0 201635c: c2 04 21 4c ld [ %l0 + 0x14c ], %g1 ! 203dd4c <_TOD_Now> 2016360: 80 a2 00 01 cmp %o0, %g1 2016364: 08 80 00 1d bleu 20163d8 2016368: b2 10 00 08 mov %o0, %i1 201636c: 92 10 00 1c mov %i4, %o1 2016370: 11 00 80 f9 sethi %hi(0x203e400), %o0 2016374: 94 07 bf fc add %fp, -4, %o2 2016378: 40 00 0b 56 call 20190d0 <_Objects_Get> 201637c: 90 12 22 34 or %o0, 0x234, %o0 return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 2016380: c2 07 bf fc ld [ %fp + -4 ], %g1 2016384: 80 a0 60 00 cmp %g1, 0 2016388: 12 80 00 16 bne 20163e0 201638c: b0 10 00 08 mov %o0, %i0 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 2016390: 40 00 14 22 call 201b418 <_Watchdog_Remove> 2016394: 90 02 20 10 add %o0, 0x10, %o0 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(); 2016398: c4 04 21 4c ld [ %l0 + 0x14c ], %g2 (*timer_server->schedule_operation)( timer_server, the_timer ); 201639c: c2 07 60 04 ld [ %i5 + 4 ], %g1 20163a0: 92 10 00 18 mov %i0, %o1 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(); 20163a4: b2 26 40 02 sub %i1, %g2, %i1 (*timer_server->schedule_operation)( timer_server, the_timer ); 20163a8: 90 10 00 1d mov %i5, %o0 the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 20163ac: 84 10 20 03 mov 3, %g2 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 20163b0: f4 26 20 2c st %i2, [ %i0 + 0x2c ] 20163b4: c4 26 20 38 st %g2, [ %i0 + 0x38 ] the_watchdog->id = id; 20163b8: f8 26 20 30 st %i4, [ %i0 + 0x30 ] the_watchdog->user_data = user_data; 20163bc: f6 26 20 34 st %i3, [ %i0 + 0x34 ] _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 20163c0: f2 26 20 1c st %i1, [ %i0 + 0x1c ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 20163c4: c0 26 20 18 clr [ %i0 + 0x18 ] (*timer_server->schedule_operation)( timer_server, the_timer ); 20163c8: 9f c0 40 00 call %g1 20163cc: b0 10 20 00 clr %i0 _Thread_Enable_dispatch(); 20163d0: 40 00 0f 08 call 2019ff0 <_Thread_Enable_dispatch> 20163d4: 01 00 00 00 nop return RTEMS_SUCCESSFUL; 20163d8: 81 c7 e0 08 ret 20163dc: 81 e8 00 00 restore case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 20163e0: 81 c7 e0 08 ret 20163e4: 91 e8 20 04 restore %g0, 4, %o0 =============================================================================== 02002aec : static int rtems_verror( rtems_error_code_t error_flag, const char *printf_format, va_list arglist ) { 2002aec: 9d e3 bf a0 save %sp, -96, %sp int local_errno = 0; int chars_written = 0; rtems_status_code status; if (error_flag & RTEMS_ERROR_PANIC) { 2002af0: 03 08 00 00 sethi %hi(0x20000000), %g1 2002af4: 80 8e 00 01 btst %i0, %g1 2002af8: 02 80 00 11 be 2002b3c 2002afc: b8 10 00 18 mov %i0, %i4 if (rtems_panic_in_progress++) 2002b00: 05 00 80 75 sethi %hi(0x201d400), %g2 2002b04: c6 00 a3 80 ld [ %g2 + 0x380 ], %g3 ! 201d780 2002b08: 82 00 e0 01 add %g3, 1, %g1 2002b0c: 80 a0 e0 00 cmp %g3, 0 2002b10: 02 80 00 08 be 2002b30 <== ALWAYS TAKEN 2002b14: c2 20 a3 80 st %g1, [ %g2 + 0x380 ] /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 2002b18: 03 00 80 76 sethi %hi(0x201d800), %g1 <== NOT EXECUTED 2002b1c: c6 00 61 50 ld [ %g1 + 0x150 ], %g3 ! 201d950 <_Thread_Dispatch_disable_level><== NOT EXECUTED 2002b20: 86 00 e0 01 inc %g3 <== NOT EXECUTED 2002b24: c6 20 61 50 st %g3, [ %g1 + 0x150 ] <== NOT EXECUTED return _Thread_Dispatch_disable_level; 2002b28: c2 00 61 50 ld [ %g1 + 0x150 ], %g1 <== NOT EXECUTED void _Thread_Disable_dispatch( void ); #else RTEMS_INLINE_ROUTINE void _Thread_Disable_dispatch( void ) { _Thread_Dispatch_increment_disable_level(); RTEMS_COMPILER_MEMORY_BARRIER(); 2002b2c: c2 00 a3 80 ld [ %g2 + 0x380 ], %g1 <== NOT EXECUTED _Thread_Disable_dispatch(); /* disable task switches */ /* don't aggravate things */ if (rtems_panic_in_progress > 2) 2002b30: 80 a0 60 02 cmp %g1, 2 2002b34: 14 80 00 2f bg 2002bf0 <== NEVER TAKEN 2002b38: b0 10 20 00 clr %i0 return 0; } (void) fflush(stdout); /* in case stdout/stderr same */ 2002b3c: 3b 00 80 73 sethi %hi(0x201cc00), %i5 2002b40: c2 07 63 b8 ld [ %i5 + 0x3b8 ], %g1 ! 201cfb8 <_impure_ptr> status = error_flag & ~RTEMS_ERROR_MASK; 2002b44: 21 1c 00 00 sethi %hi(0x70000000), %l0 /* don't aggravate things */ if (rtems_panic_in_progress > 2) return 0; } (void) fflush(stdout); /* in case stdout/stderr same */ 2002b48: d0 00 60 08 ld [ %g1 + 8 ], %o0 2002b4c: 40 00 34 88 call 200fd6c 2002b50: b6 10 20 00 clr %i3 status = error_flag & ~RTEMS_ERROR_MASK; if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */ 2002b54: 03 10 00 00 sethi %hi(0x40000000), %g1 2002b58: 80 8f 00 01 btst %i4, %g1 2002b5c: 12 80 00 33 bne 2002c28 2002b60: a0 2f 00 10 andn %i4, %l0, %l0 #if defined(RTEMS_MULTIPROCESSING) if (_System_state_Is_multiprocessing) fprintf(stderr, "[%" PRIu32 "] ", _Configuration_MP_table->node); #endif chars_written += vfprintf(stderr, printf_format, arglist); 2002b64: c2 07 63 b8 ld [ %i5 + 0x3b8 ], %g1 2002b68: 92 10 00 19 mov %i1, %o1 2002b6c: d0 00 60 0c ld [ %g1 + 0xc ], %o0 2002b70: 40 00 48 8a call 2014d98 2002b74: 94 10 00 1a mov %i2, %o2 if (status) 2002b78: 80 a4 20 00 cmp %l0, 0 2002b7c: 12 80 00 1f bne 2002bf8 2002b80: b0 10 00 08 mov %o0, %i0 chars_written += fprintf(stderr, " (status: %s)", rtems_status_text(status)); if (local_errno) { 2002b84: 80 a6 e0 00 cmp %i3, 0 2002b88: 02 80 00 12 be 2002bd0 2002b8c: c2 07 63 b8 ld [ %i5 + 0x3b8 ], %g1 if ((local_errno > 0) && *strerror(local_errno)) 2002b90: 80 a6 e0 00 cmp %i3, 0 2002b94: 04 80 00 09 ble 2002bb8 2002b98: 13 00 80 6c sethi %hi(0x201b000), %o1 2002b9c: 40 00 38 06 call 2010bb4 2002ba0: 90 10 00 1b mov %i3, %o0 2002ba4: c2 4a 00 00 ldsb [ %o0 ], %g1 2002ba8: 80 a0 60 00 cmp %g1, 0 2002bac: 12 80 00 23 bne 2002c38 <== ALWAYS TAKEN 2002bb0: c2 07 63 b8 ld [ %i5 + 0x3b8 ], %g1 chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno)); else chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno); 2002bb4: 13 00 80 6c sethi %hi(0x201b000), %o1 <== NOT EXECUTED 2002bb8: d0 00 60 0c ld [ %g1 + 0xc ], %o0 2002bbc: 92 12 62 d8 or %o1, 0x2d8, %o1 2002bc0: 40 00 35 5d call 2010134 2002bc4: 94 10 00 1b mov %i3, %o2 2002bc8: b0 06 00 08 add %i0, %o0, %i0 } chars_written += fprintf(stderr, "\n"); 2002bcc: c2 07 63 b8 ld [ %i5 + 0x3b8 ], %g1 2002bd0: 13 00 80 6c sethi %hi(0x201b000), %o1 2002bd4: d0 00 60 0c ld [ %g1 + 0xc ], %o0 2002bd8: 40 00 35 57 call 2010134 2002bdc: 92 12 61 60 or %o1, 0x160, %o1 (void) fflush(stderr); 2002be0: c2 07 63 b8 ld [ %i5 + 0x3b8 ], %g1 chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno)); else chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno); } chars_written += fprintf(stderr, "\n"); 2002be4: b0 02 00 18 add %o0, %i0, %i0 (void) fflush(stderr); 2002be8: 40 00 34 61 call 200fd6c 2002bec: d0 00 60 0c ld [ %g1 + 0xc ], %o0 return chars_written; } 2002bf0: 81 c7 e0 08 ret 2002bf4: 81 e8 00 00 restore chars_written += vfprintf(stderr, printf_format, arglist); if (status) chars_written += fprintf(stderr, " (status: %s)", rtems_status_text(status)); 2002bf8: 03 00 80 73 sethi %hi(0x201cc00), %g1 2002bfc: c2 00 63 b8 ld [ %g1 + 0x3b8 ], %g1 ! 201cfb8 <_impure_ptr> 2002c00: 90 10 00 10 mov %l0, %o0 2002c04: 7f ff ff b4 call 2002ad4 2002c08: f8 00 60 0c ld [ %g1 + 0xc ], %i4 2002c0c: 13 00 80 6c sethi %hi(0x201b000), %o1 2002c10: 94 10 00 08 mov %o0, %o2 2002c14: 92 12 62 b8 or %o1, 0x2b8, %o1 2002c18: 40 00 35 47 call 2010134 2002c1c: 90 10 00 1c mov %i4, %o0 #endif chars_written += vfprintf(stderr, printf_format, arglist); if (status) chars_written += 2002c20: 10 bf ff d9 b 2002b84 2002c24: b0 06 00 08 add %i0, %o0, %i0 (void) fflush(stdout); /* in case stdout/stderr same */ status = error_flag & ~RTEMS_ERROR_MASK; if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */ local_errno = errno; 2002c28: 40 00 33 41 call 200f92c <__errno> 2002c2c: 01 00 00 00 nop 2002c30: 10 bf ff cd b 2002b64 2002c34: f6 02 00 00 ld [ %o0 ], %i3 chars_written += fprintf(stderr, " (status: %s)", rtems_status_text(status)); if (local_errno) { if ((local_errno > 0) && *strerror(local_errno)) chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno)); 2002c38: 90 10 00 1b mov %i3, %o0 2002c3c: 40 00 37 de call 2010bb4 2002c40: f8 00 60 0c ld [ %g1 + 0xc ], %i4 2002c44: 13 00 80 6c sethi %hi(0x201b000), %o1 2002c48: 94 10 00 08 mov %o0, %o2 2002c4c: 92 12 62 c8 or %o1, 0x2c8, %o1 2002c50: 40 00 35 39 call 2010134 2002c54: 90 10 00 1c mov %i4, %o0 2002c58: 10 bf ff dd b 2002bcc 2002c5c: b0 06 00 08 add %i0, %o0, %i0 =============================================================================== 0200316c : /* * Extract an integer value from the database */ static int scanInt(FILE *fp, int *val) { 200316c: 9d e3 bf a0 save %sp, -96, %sp int c; unsigned int i = 0; unsigned int limit = INT_MAX; 2003170: 35 1f ff ff sethi %hi(0x7ffffc00), %i2 int sign = 0; 2003174: b6 10 20 00 clr %i3 static int scanInt(FILE *fp, int *val) { int c; unsigned int i = 0; unsigned int limit = INT_MAX; 2003178: b4 16 a3 ff or %i2, 0x3ff, %i2 */ static int scanInt(FILE *fp, int *val) { int c; unsigned int i = 0; 200317c: b8 10 20 00 clr %i4 unsigned int limit = INT_MAX; int sign = 0; int d; for (;;) { c = getc(fp); 2003180: 23 00 80 5f sethi %hi(0x2017c00), %l1 limit++; continue; } sign = 1; } if (!isdigit(c)) 2003184: 21 00 80 5f sethi %hi(0x2017c00), %l0 unsigned int limit = INT_MAX; int sign = 0; int d; for (;;) { c = getc(fp); 2003188: c2 06 20 04 ld [ %i0 + 4 ], %g1 200318c: 82 00 7f ff add %g1, -1, %g1 2003190: 80 a0 60 00 cmp %g1, 0 2003194: 06 80 00 24 bl 2003224 <== NEVER TAKEN 2003198: c2 26 20 04 st %g1, [ %i0 + 4 ] 200319c: c2 06 00 00 ld [ %i0 ], %g1 20031a0: fa 08 40 00 ldub [ %g1 ], %i5 20031a4: 82 00 60 01 inc %g1 if (c == ':') 20031a8: 80 a7 60 3a cmp %i5, 0x3a 20031ac: 02 80 00 25 be 2003240 20031b0: c2 26 00 00 st %g1, [ %i0 ] break; if (sign == 0) { 20031b4: 80 a6 e0 00 cmp %i3, 0 20031b8: 12 80 00 06 bne 20031d0 20031bc: c2 04 22 68 ld [ %l0 + 0x268 ], %g1 if (c == '-') { 20031c0: 80 a7 60 2d cmp %i5, 0x2d 20031c4: 02 80 00 32 be 200328c 20031c8: b6 10 20 01 mov 1, %i3 limit++; continue; } sign = 1; } if (!isdigit(c)) 20031cc: c2 04 22 68 ld [ %l0 + 0x268 ], %g1 20031d0: 82 00 40 1d add %g1, %i5, %g1 20031d4: c2 08 60 01 ldub [ %g1 + 1 ], %g1 20031d8: 80 88 60 04 btst 4, %g1 20031dc: 02 80 00 2f be 2003298 20031e0: 90 10 00 1a mov %i2, %o0 return 0; d = c - '0'; if ((i > (limit / 10)) 20031e4: 40 00 45 03 call 20145f0 <.udiv> 20031e8: 92 10 20 0a mov 0xa, %o1 20031ec: 80 a7 00 08 cmp %i4, %o0 20031f0: 18 80 00 2a bgu 2003298 20031f4: 01 00 00 00 nop || ((i == (limit / 10)) && (d > (limit % 10)))) 20031f8: 02 80 00 1c be 2003268 20031fc: ba 07 7f d0 add %i5, -48, %i5 return 0; i = i * 10 + d; 2003200: 83 2f 20 01 sll %i4, 1, %g1 2003204: b9 2f 20 03 sll %i4, 3, %i4 2003208: b8 00 40 1c add %g1, %i4, %i4 unsigned int limit = INT_MAX; int sign = 0; int d; for (;;) { c = getc(fp); 200320c: c2 06 20 04 ld [ %i0 + 4 ], %g1 return 0; d = c - '0'; if ((i > (limit / 10)) || ((i == (limit / 10)) && (d > (limit % 10)))) return 0; i = i * 10 + d; 2003210: b8 07 40 1c add %i5, %i4, %i4 unsigned int limit = INT_MAX; int sign = 0; int d; for (;;) { c = getc(fp); 2003214: 82 00 7f ff add %g1, -1, %g1 2003218: 80 a0 60 00 cmp %g1, 0 200321c: 16 bf ff e0 bge 200319c <== ALWAYS TAKEN 2003220: c2 26 20 04 st %g1, [ %i0 + 4 ] 2003224: d0 04 62 70 ld [ %l1 + 0x270 ], %o0 <== NOT EXECUTED 2003228: 40 00 39 ff call 2011a24 <__srget_r> <== NOT EXECUTED 200322c: 92 10 00 18 mov %i0, %o1 <== NOT EXECUTED 2003230: ba 10 00 08 mov %o0, %i5 <== NOT EXECUTED if (c == ':') 2003234: 80 a7 60 3a cmp %i5, 0x3a <== NOT EXECUTED 2003238: 12 bf ff e0 bne 20031b8 <== NOT EXECUTED 200323c: 80 a6 e0 00 cmp %i3, 0 <== NOT EXECUTED if ((i > (limit / 10)) || ((i == (limit / 10)) && (d > (limit % 10)))) return 0; i = i * 10 + d; } if (sign == 0) 2003240: 80 a6 e0 00 cmp %i3, 0 2003244: 02 80 00 07 be 2003260 <== NEVER TAKEN 2003248: b0 10 20 00 clr %i0 return 0; *val = i * sign; 200324c: 90 10 00 1b mov %i3, %o0 2003250: 92 10 00 1c mov %i4, %o1 2003254: 40 00 44 ad call 2014508 <.umul> 2003258: b0 10 20 01 mov 1, %i0 200325c: d0 26 40 00 st %o0, [ %i1 ] return 1; 2003260: 81 c7 e0 08 ret 2003264: 81 e8 00 00 restore } if (!isdigit(c)) return 0; d = c - '0'; if ((i > (limit / 10)) || ((i == (limit / 10)) && (d > (limit % 10)))) 2003268: 90 10 00 1a mov %i2, %o0 200326c: 40 00 45 8d call 20148a0 <.urem> 2003270: 92 10 20 0a mov 0xa, %o1 2003274: 80 a7 40 08 cmp %i5, %o0 2003278: 08 bf ff e3 bleu 2003204 <== NEVER TAKEN 200327c: 83 2f 20 01 sll %i4, 1, %g1 return 0; 2003280: b0 10 20 00 clr %i0 } if (sign == 0) return 0; *val = i * sign; return 1; } 2003284: 81 c7 e0 08 ret 2003288: 81 e8 00 00 restore if (c == ':') break; if (sign == 0) { if (c == '-') { sign = -1; limit++; 200328c: b4 06 a0 01 inc %i2 continue; 2003290: 10 bf ff be b 2003188 2003294: b6 10 3f ff mov -1, %i3 if (!isdigit(c)) return 0; d = c - '0'; if ((i > (limit / 10)) || ((i == (limit / 10)) && (d > (limit % 10)))) return 0; 2003298: 81 c7 e0 08 ret 200329c: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 020032a0 : /* * Extract a string value from the database */ static int scanString(FILE *fp, char **name, char **bufp, size_t *nleft, int nlFlag) { 20032a0: 9d e3 bf a0 save %sp, -96, %sp int c; *name = *bufp; 20032a4: c2 06 80 00 ld [ %i2 ], %g1 for (;;) { c = getc(fp); 20032a8: 3b 00 80 5f sethi %hi(0x2017c00), %i5 static int scanString(FILE *fp, char **name, char **bufp, size_t *nleft, int nlFlag) { int c; *name = *bufp; 20032ac: 10 80 00 19 b 2003310 20032b0: c2 26 40 00 st %g1, [ %i1 ] for (;;) { c = getc(fp); 20032b4: c2 06 00 00 ld [ %i0 ], %g1 20032b8: d0 08 40 00 ldub [ %g1 ], %o0 20032bc: 82 00 60 01 inc %g1 if (c == ':') { 20032c0: 80 a2 20 3a cmp %o0, 0x3a 20032c4: 02 80 00 1e be 200333c 20032c8: c2 26 00 00 st %g1, [ %i0 ] if (nlFlag) return 0; break; } if (c == '\n') { 20032cc: 80 a2 20 0a cmp %o0, 0xa 20032d0: 02 80 00 28 be 2003370 20032d4: 80 a2 3f ff cmp %o0, -1 if (!nlFlag) return 0; break; } if (c == EOF) 20032d8: 02 80 00 2b be 2003384 20032dc: 01 00 00 00 nop return 0; if (*nleft < 2) 20032e0: c2 06 c0 00 ld [ %i3 ], %g1 20032e4: 80 a0 60 01 cmp %g1, 1 20032e8: 08 80 00 29 bleu 200338c 20032ec: 01 00 00 00 nop return 0; **bufp = c; 20032f0: c2 06 80 00 ld [ %i2 ], %g1 20032f4: d0 28 40 00 stb %o0, [ %g1 ] ++(*bufp); 20032f8: c4 06 80 00 ld [ %i2 ], %g2 --(*nleft); 20032fc: c2 06 c0 00 ld [ %i3 ], %g1 if (c == EOF) return 0; if (*nleft < 2) return 0; **bufp = c; ++(*bufp); 2003300: 84 00 a0 01 inc %g2 2003304: c4 26 80 00 st %g2, [ %i2 ] --(*nleft); 2003308: 82 00 7f ff add %g1, -1, %g1 200330c: c2 26 c0 00 st %g1, [ %i3 ] { int c; *name = *bufp; for (;;) { c = getc(fp); 2003310: c2 06 20 04 ld [ %i0 + 4 ], %g1 2003314: 82 00 7f ff add %g1, -1, %g1 2003318: 80 a0 60 00 cmp %g1, 0 200331c: 16 bf ff e6 bge 20032b4 2003320: c2 26 20 04 st %g1, [ %i0 + 4 ] 2003324: d0 07 62 70 ld [ %i5 + 0x270 ], %o0 2003328: 40 00 39 bf call 2011a24 <__srget_r> 200332c: 92 10 00 18 mov %i0, %o1 if (c == ':') { 2003330: 80 a2 20 3a cmp %o0, 0x3a 2003334: 12 bf ff e7 bne 20032d0 <== ALWAYS TAKEN 2003338: 80 a2 20 0a cmp %o0, 0xa if (nlFlag) 200333c: 80 a7 20 00 cmp %i4, 0 2003340: 12 80 00 0f bne 200337c 2003344: b0 10 20 00 clr %i0 return 0; **bufp = c; ++(*bufp); --(*nleft); } **bufp = '\0'; 2003348: c2 06 80 00 ld [ %i2 ], %g1 200334c: c0 28 40 00 clrb [ %g1 ] ++(*bufp); 2003350: c4 06 80 00 ld [ %i2 ], %g2 --(*nleft); 2003354: c2 06 c0 00 ld [ %i3 ], %g1 **bufp = c; ++(*bufp); --(*nleft); } **bufp = '\0'; ++(*bufp); 2003358: 84 00 a0 01 inc %g2 200335c: c4 26 80 00 st %g2, [ %i2 ] --(*nleft); 2003360: 82 00 7f ff add %g1, -1, %g1 2003364: c2 26 c0 00 st %g1, [ %i3 ] return 1; 2003368: 81 c7 e0 08 ret 200336c: 91 e8 20 01 restore %g0, 1, %o0 if (nlFlag) return 0; break; } if (c == '\n') { if (!nlFlag) 2003370: 80 a7 20 00 cmp %i4, 0 2003374: 12 bf ff f5 bne 2003348 2003378: b0 10 20 00 clr %i0 200337c: 81 c7 e0 08 ret 2003380: 81 e8 00 00 restore return 0; break; } if (c == EOF) return 0; 2003384: 81 c7 e0 08 ret 2003388: 91 e8 20 00 restore %g0, 0, %o0 } **bufp = '\0'; ++(*bufp); --(*nleft); return 1; } 200338c: 81 c7 e0 08 ret 2003390: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 02003394 : FILE *fp, struct group *grp, char *buffer, size_t bufsize ) { 2003394: 9d e3 bf 98 save %sp, -104, %sp int grgid; char *grmem, *cp; int memcount; if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0) 2003398: 98 10 20 00 clr %o4 200339c: 90 10 00 18 mov %i0, %o0 FILE *fp, struct group *grp, char *buffer, size_t bufsize ) { 20033a0: ba 10 00 18 mov %i0, %i5 20033a4: f4 27 a0 4c st %i2, [ %fp + 0x4c ] 20033a8: f6 27 a0 50 st %i3, [ %fp + 0x50 ] int grgid; char *grmem, *cp; int memcount; if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0) 20033ac: 92 10 00 19 mov %i1, %o1 20033b0: 94 07 a0 4c add %fp, 0x4c, %o2 20033b4: 96 07 a0 50 add %fp, 0x50, %o3 20033b8: 7f ff ff ba call 20032a0 20033bc: b0 10 20 00 clr %i0 20033c0: 80 a2 20 00 cmp %o0, 0 20033c4: 12 80 00 04 bne 20033d4 20033c8: 90 10 00 1d mov %i5, %o0 grp->gr_mem[memcount++] = cp + 1; } } grp->gr_mem[memcount] = NULL; return 1; } 20033cc: 81 c7 e0 08 ret 20033d0: 81 e8 00 00 restore int grgid; char *grmem, *cp; int memcount; if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0) || !scanString(fp, &grp->gr_passwd, &buffer, &bufsize, 0) 20033d4: 92 06 60 04 add %i1, 4, %o1 20033d8: 94 07 a0 4c add %fp, 0x4c, %o2 20033dc: 96 07 a0 50 add %fp, 0x50, %o3 20033e0: 7f ff ff b0 call 20032a0 20033e4: 98 10 20 00 clr %o4 20033e8: 80 a2 20 00 cmp %o0, 0 20033ec: 02 bf ff f8 be 20033cc <== NEVER TAKEN 20033f0: 90 10 00 1d mov %i5, %o0 || !scanInt(fp, &grgid) 20033f4: 7f ff ff 5e call 200316c 20033f8: 92 07 bf f8 add %fp, -8, %o1 20033fc: 80 a2 20 00 cmp %o0, 0 2003400: 02 bf ff f3 be 20033cc <== NEVER TAKEN 2003404: 90 10 00 1d mov %i5, %o0 || !scanString(fp, &grmem, &buffer, &bufsize, 1)) 2003408: 92 07 bf fc add %fp, -4, %o1 200340c: 94 07 a0 4c add %fp, 0x4c, %o2 2003410: 96 07 a0 50 add %fp, 0x50, %o3 2003414: 7f ff ff a3 call 20032a0 2003418: 98 10 20 01 mov 1, %o4 200341c: 80 a2 20 00 cmp %o0, 0 2003420: 02 bf ff eb be 20033cc <== NEVER TAKEN 2003424: c2 07 bf f8 ld [ %fp + -8 ], %g1 grp->gr_gid = grgid; /* * Determine number of members */ for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 2003428: fa 07 bf fc ld [ %fp + -4 ], %i5 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; 200342c: c2 36 60 08 sth %g1, [ %i1 + 8 ] /* * Determine number of members */ for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 2003430: c6 0f 40 00 ldub [ %i5 ], %g3 2003434: 83 28 e0 18 sll %g3, 0x18, %g1 2003438: 80 a0 60 00 cmp %g1, 0 200343c: 02 80 00 10 be 200347c <== NEVER TAKEN 2003440: 88 10 20 17 mov 0x17, %g4 2003444: 84 10 00 1d mov %i5, %g2 2003448: 88 10 20 01 mov 1, %g4 if(*cp == ',') memcount++; 200344c: 84 00 a0 01 inc %g2 grp->gr_gid = grgid; /* * Determine number of members */ for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 2003450: c6 08 80 00 ldub [ %g2 ], %g3 if(*cp == ',') 2003454: 83 38 60 18 sra %g1, 0x18, %g1 memcount++; 2003458: 82 18 60 2c xor %g1, 0x2c, %g1 200345c: 80 a0 00 01 cmp %g0, %g1 grp->gr_gid = grgid; /* * Determine number of members */ for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 2003460: 83 28 e0 18 sll %g3, 0x18, %g1 if(*cp == ',') memcount++; 2003464: 88 61 3f ff subx %g4, -1, %g4 grp->gr_gid = grgid; /* * Determine number of members */ for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 2003468: 80 a0 60 00 cmp %g1, 0 200346c: 32 bf ff f9 bne,a 2003450 2003470: 84 00 a0 01 inc %g2 2003474: 89 29 20 02 sll %g4, 2, %g4 2003478: 88 01 20 13 add %g4, 0x13, %g4 } /* * Hack to produce (hopefully) a suitably-aligned array of pointers */ if (bufsize < (((memcount+1)*sizeof(char *)) + 15)) 200347c: c2 07 a0 50 ld [ %fp + 0x50 ], %g1 2003480: 80 a0 40 04 cmp %g1, %g4 2003484: 0a bf ff d2 bcs 20033cc <== NEVER TAKEN 2003488: b0 10 20 00 clr %i0 return 0; grp->gr_mem = (char **)(((uintptr_t)buffer + 15) & ~15); 200348c: c2 07 a0 4c ld [ %fp + 0x4c ], %g1 2003490: 82 00 60 0f add %g1, 0xf, %g1 2003494: 82 08 7f f0 and %g1, -16, %g1 2003498: c2 26 60 0c st %g1, [ %i1 + 0xc ] /* * Fill in pointer array */ grp->gr_mem[0] = grmem; 200349c: fa 20 40 00 st %i5, [ %g1 ] for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 20034a0: c2 07 bf fc ld [ %fp + -4 ], %g1 20034a4: c4 08 40 00 ldub [ %g1 ], %g2 20034a8: 85 28 a0 18 sll %g2, 0x18, %g2 20034ac: 80 a0 a0 00 cmp %g2, 0 20034b0: 02 80 00 15 be 2003504 <== NEVER TAKEN 20034b4: 86 10 20 04 mov 4, %g3 } /* * Extract a single group record from the database */ static int scangr( 20034b8: 82 00 60 01 inc %g1 /* * Fill in pointer array */ grp->gr_mem[0] = grmem; for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 20034bc: 10 80 00 08 b 20034dc 20034c0: 86 10 20 01 mov 1, %g3 if(*cp == ',') { *cp = '\0'; grp->gr_mem[memcount++] = cp + 1; 20034c4: 82 00 60 01 inc %g1 /* * Fill in pointer array */ grp->gr_mem[0] = grmem; for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) { 20034c8: c4 08 7f ff ldub [ %g1 + -1 ], %g2 20034cc: 85 28 a0 18 sll %g2, 0x18, %g2 20034d0: 80 a0 a0 00 cmp %g2, 0 20034d4: 22 80 00 0c be,a 2003504 20034d8: 87 28 e0 02 sll %g3, 2, %g3 if(*cp == ',') { 20034dc: 85 38 a0 18 sra %g2, 0x18, %g2 20034e0: 80 a0 a0 2c cmp %g2, 0x2c 20034e4: 32 bf ff f9 bne,a 20034c8 20034e8: 82 00 60 01 inc %g1 *cp = '\0'; 20034ec: c0 28 7f ff clrb [ %g1 + -1 ] grp->gr_mem[memcount++] = cp + 1; 20034f0: c8 06 60 0c ld [ %i1 + 0xc ], %g4 20034f4: 85 28 e0 02 sll %g3, 2, %g2 20034f8: 86 00 e0 01 inc %g3 20034fc: 10 bf ff f2 b 20034c4 2003500: c2 21 00 02 st %g1, [ %g4 + %g2 ] } } grp->gr_mem[memcount] = NULL; 2003504: c2 06 60 0c ld [ %i1 + 0xc ], %g1 2003508: c0 20 40 03 clr [ %g1 + %g3 ] return 1; } 200350c: 81 c7 e0 08 ret 2003510: 91 e8 20 01 restore %g0, 1, %o0 =============================================================================== 02003514 : FILE *fp, struct passwd *pwd, char *buffer, size_t bufsize ) { 2003514: 9d e3 bf 98 save %sp, -104, %sp int pwuid, pwgid; if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0) 2003518: 98 10 20 00 clr %o4 200351c: 90 10 00 18 mov %i0, %o0 FILE *fp, struct passwd *pwd, char *buffer, size_t bufsize ) { 2003520: ba 10 00 18 mov %i0, %i5 2003524: f4 27 a0 4c st %i2, [ %fp + 0x4c ] 2003528: f6 27 a0 50 st %i3, [ %fp + 0x50 ] int pwuid, pwgid; if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0) 200352c: 92 10 00 19 mov %i1, %o1 2003530: 94 07 a0 4c add %fp, 0x4c, %o2 2003534: 96 07 a0 50 add %fp, 0x50, %o3 2003538: 7f ff ff 5a call 20032a0 200353c: b0 10 20 00 clr %i0 2003540: 80 a2 20 00 cmp %o0, 0 2003544: 12 80 00 04 bne 2003554 2003548: 90 10 00 1d mov %i5, %o0 || !scanString(fp, &pwd->pw_shell, &buffer, &bufsize, 1)) return 0; pwd->pw_uid = pwuid; pwd->pw_gid = pwgid; return 1; } 200354c: 81 c7 e0 08 ret 2003550: 81 e8 00 00 restore ) { int pwuid, pwgid; if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0) || !scanString(fp, &pwd->pw_passwd, &buffer, &bufsize, 0) 2003554: 92 06 60 04 add %i1, 4, %o1 2003558: 94 07 a0 4c add %fp, 0x4c, %o2 200355c: 96 07 a0 50 add %fp, 0x50, %o3 2003560: 7f ff ff 50 call 20032a0 2003564: 98 10 20 00 clr %o4 2003568: 80 a2 20 00 cmp %o0, 0 200356c: 02 bf ff f8 be 200354c <== NEVER TAKEN 2003570: 90 10 00 1d mov %i5, %o0 || !scanInt(fp, &pwuid) 2003574: 7f ff fe fe call 200316c 2003578: 92 07 bf f8 add %fp, -8, %o1 200357c: 80 a2 20 00 cmp %o0, 0 2003580: 02 bf ff f3 be 200354c 2003584: 90 10 00 1d mov %i5, %o0 || !scanInt(fp, &pwgid) 2003588: 7f ff fe f9 call 200316c 200358c: 92 07 bf fc add %fp, -4, %o1 2003590: 80 a2 20 00 cmp %o0, 0 2003594: 02 bf ff ee be 200354c 2003598: 90 10 00 1d mov %i5, %o0 || !scanString(fp, &pwd->pw_comment, &buffer, &bufsize, 0) 200359c: 92 06 60 0c add %i1, 0xc, %o1 20035a0: 94 07 a0 4c add %fp, 0x4c, %o2 20035a4: 96 07 a0 50 add %fp, 0x50, %o3 20035a8: 7f ff ff 3e call 20032a0 20035ac: 98 10 20 00 clr %o4 20035b0: 80 a2 20 00 cmp %o0, 0 20035b4: 02 bf ff e6 be 200354c <== NEVER TAKEN 20035b8: 90 10 00 1d mov %i5, %o0 || !scanString(fp, &pwd->pw_gecos, &buffer, &bufsize, 0) 20035bc: 92 06 60 10 add %i1, 0x10, %o1 20035c0: 94 07 a0 4c add %fp, 0x4c, %o2 20035c4: 96 07 a0 50 add %fp, 0x50, %o3 20035c8: 7f ff ff 36 call 20032a0 20035cc: 98 10 20 00 clr %o4 20035d0: 80 a2 20 00 cmp %o0, 0 20035d4: 02 bf ff de be 200354c <== NEVER TAKEN 20035d8: 90 10 00 1d mov %i5, %o0 || !scanString(fp, &pwd->pw_dir, &buffer, &bufsize, 0) 20035dc: 92 06 60 14 add %i1, 0x14, %o1 20035e0: 94 07 a0 4c add %fp, 0x4c, %o2 20035e4: 96 07 a0 50 add %fp, 0x50, %o3 20035e8: 7f ff ff 2e call 20032a0 20035ec: 98 10 20 00 clr %o4 20035f0: 80 a2 20 00 cmp %o0, 0 20035f4: 02 bf ff d6 be 200354c <== NEVER TAKEN 20035f8: 90 10 00 1d mov %i5, %o0 || !scanString(fp, &pwd->pw_shell, &buffer, &bufsize, 1)) 20035fc: 92 06 60 18 add %i1, 0x18, %o1 2003600: 94 07 a0 4c add %fp, 0x4c, %o2 2003604: 96 07 a0 50 add %fp, 0x50, %o3 2003608: 7f ff ff 26 call 20032a0 200360c: 98 10 20 01 mov 1, %o4 2003610: 80 a2 20 00 cmp %o0, 0 2003614: 02 bf ff ce be 200354c 2003618: c2 07 bf f8 ld [ %fp + -8 ], %g1 return 0; pwd->pw_uid = pwuid; 200361c: c2 36 60 08 sth %g1, [ %i1 + 8 ] pwd->pw_gid = pwgid; 2003620: c2 07 bf fc ld [ %fp + -4 ], %g1 2003624: c2 36 60 0a sth %g1, [ %i1 + 0xa ] return 1; } 2003628: 81 c7 e0 08 ret 200362c: 91 e8 20 01 restore %g0, 1, %o0 =============================================================================== 02006cc4 : #include int sched_get_priority_max( int policy ) { 2006cc4: 9d e3 bf a0 save %sp, -96, %sp switch ( policy ) { 2006cc8: 80 a6 20 04 cmp %i0, 4 2006ccc: 08 80 00 08 bleu 2006cec 2006cd0: 82 10 20 01 mov 1, %g1 case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 2006cd4: 40 00 25 45 call 20101e8 <__errno> 2006cd8: b0 10 3f ff mov -1, %i0 2006cdc: 82 10 20 16 mov 0x16, %g1 2006ce0: c2 22 00 00 st %g1, [ %o0 ] 2006ce4: 81 c7 e0 08 ret 2006ce8: 81 e8 00 00 restore int sched_get_priority_max( int policy ) { switch ( policy ) { 2006cec: b1 28 40 18 sll %g1, %i0, %i0 2006cf0: 80 8e 20 17 btst 0x17, %i0 2006cf4: 02 bf ff f8 be 2006cd4 <== NEVER TAKEN 2006cf8: 03 00 80 75 sethi %hi(0x201d400), %g1 default: rtems_set_errno_and_return_minus_one( EINVAL ); } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 2006cfc: f0 08 62 cc ldub [ %g1 + 0x2cc ], %i0 ! 201d6cc } 2006d00: 81 c7 e0 08 ret 2006d04: 91 ee 3f ff restore %i0, -1, %o0 =============================================================================== 02006d08 : #include int sched_get_priority_min( int policy ) { 2006d08: 9d e3 bf a0 save %sp, -96, %sp switch ( policy ) { 2006d0c: 80 a6 20 04 cmp %i0, 4 2006d10: 08 80 00 09 bleu 2006d34 2006d14: 84 10 20 01 mov 1, %g2 case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 2006d18: 40 00 25 34 call 20101e8 <__errno> 2006d1c: 01 00 00 00 nop 2006d20: 82 10 3f ff mov -1, %g1 ! ffffffff 2006d24: 84 10 20 16 mov 0x16, %g2 2006d28: c4 22 00 00 st %g2, [ %o0 ] } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } 2006d2c: 81 c7 e0 08 ret 2006d30: 91 e8 00 01 restore %g0, %g1, %o0 int sched_get_priority_min( int policy ) { switch ( policy ) { 2006d34: b1 28 80 18 sll %g2, %i0, %i0 2006d38: 80 8e 20 17 btst 0x17, %i0 2006d3c: 02 bf ff f7 be 2006d18 <== NEVER TAKEN 2006d40: 82 10 20 01 mov 1, %g1 default: rtems_set_errno_and_return_minus_one( EINVAL ); } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } 2006d44: 81 c7 e0 08 ret 2006d48: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 02006d4c : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 2006d4c: 9d e3 bf a0 save %sp, -96, %sp /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 2006d50: 80 a6 20 00 cmp %i0, 0 2006d54: 12 80 00 0a bne 2006d7c <== ALWAYS TAKEN 2006d58: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); if ( !interval ) 2006d5c: 02 80 00 13 be 2006da8 2006d60: 03 00 80 78 sethi %hi(0x201e000), %g1 rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 2006d64: d0 00 63 14 ld [ %g1 + 0x314 ], %o0 ! 201e314 <_Thread_Ticks_per_timeslice> 2006d68: 92 10 00 19 mov %i1, %o1 2006d6c: 40 00 0f 5e call 200aae4 <_Timespec_From_ticks> 2006d70: b0 10 20 00 clr %i0 return 0; } 2006d74: 81 c7 e0 08 ret 2006d78: 81 e8 00 00 restore { /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 2006d7c: 7f ff f1 5c call 20032ec 2006d80: 01 00 00 00 nop 2006d84: 80 a2 00 18 cmp %o0, %i0 2006d88: 02 bf ff f5 be 2006d5c 2006d8c: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); 2006d90: 40 00 25 16 call 20101e8 <__errno> 2006d94: b0 10 3f ff mov -1, %i0 2006d98: 82 10 20 03 mov 3, %g1 2006d9c: c2 22 00 00 st %g1, [ %o0 ] 2006da0: 81 c7 e0 08 ret 2006da4: 81 e8 00 00 restore if ( !interval ) rtems_set_errno_and_return_minus_one( EINVAL ); 2006da8: 40 00 25 10 call 20101e8 <__errno> 2006dac: b0 10 3f ff mov -1, %i0 2006db0: 82 10 20 16 mov 0x16, %g1 2006db4: c2 22 00 00 st %g1, [ %o0 ] 2006db8: 81 c7 e0 08 ret 2006dbc: 81 e8 00 00 restore =============================================================================== 02009608 : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 2009608: 9d e3 bf 90 save %sp, -112, %sp /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 200960c: 03 00 80 8c sethi %hi(0x2023000), %g1 2009610: c4 00 63 60 ld [ %g1 + 0x360 ], %g2 ! 2023360 <_Thread_Dispatch_disable_level> Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); 2009614: f4 27 a0 4c st %i2, [ %fp + 0x4c ] 2009618: 84 00 a0 01 inc %g2 200961c: c4 20 63 60 st %g2, [ %g1 + 0x360 ] return _Thread_Dispatch_disable_level; 2009620: c2 00 63 60 ld [ %g1 + 0x360 ], %g1 2009624: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 2009628: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 200962c: fa 27 a0 58 st %i5, [ %fp + 0x58 ] POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 2009630: b8 8e 62 00 andcc %i1, 0x200, %i4 2009634: 12 80 00 25 bne 20096c8 2009638: ba 10 20 00 clr %i5 mode = (mode_t) va_arg( arg, unsigned int ); value = va_arg( arg, unsigned int ); va_end(arg); } status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); 200963c: 90 10 00 18 mov %i0, %o0 2009640: 40 00 1b fd call 2010634 <_POSIX_Semaphore_Name_to_id> 2009644: 92 07 bf f4 add %fp, -12, %o1 * and we can just return a pointer to the id. Otherwise we may * need to check to see if this is a "semaphore does not exist" * or some other miscellaneous error on the name. */ if ( status ) { 2009648: b6 92 20 00 orcc %o0, 0, %i3 200964c: 22 80 00 0e be,a 2009684 2009650: b2 0e 6a 00 and %i1, 0xa00, %i1 /* * Unless provided a valid name that did not already exist * and we are willing to create then it is an error. */ if ( !( status == ENOENT && (oflag & O_CREAT) ) ) { 2009654: 80 a6 e0 02 cmp %i3, 2 2009658: 12 80 00 04 bne 2009668 <== NEVER TAKEN 200965c: 80 a7 20 00 cmp %i4, 0 2009660: 12 80 00 1e bne 20096d8 2009664: 94 10 00 1d mov %i5, %o2 _Thread_Enable_dispatch(); 2009668: 40 00 0c 83 call 200c874 <_Thread_Enable_dispatch> 200966c: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 2009670: 40 00 28 89 call 2013894 <__errno> 2009674: 01 00 00 00 nop 2009678: f6 22 00 00 st %i3, [ %o0 ] 200967c: 81 c7 e0 08 ret 2009680: 81 e8 00 00 restore /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 2009684: 80 a6 6a 00 cmp %i1, 0xa00 2009688: 02 80 00 20 be 2009708 200968c: d2 07 bf f4 ld [ %fp + -12 ], %o1 2009690: 94 07 bf fc add %fp, -4, %o2 2009694: 11 00 80 8d sethi %hi(0x2023400), %o0 2009698: 40 00 08 bc call 200b988 <_Objects_Get> 200969c: 90 12 22 20 or %o0, 0x220, %o0 ! 2023620 <_POSIX_Semaphore_Information> _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); the_semaphore->open_count += 1; 20096a0: c2 02 20 18 ld [ %o0 + 0x18 ], %g1 if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); 20096a4: d0 27 bf f8 st %o0, [ %fp + -8 ] the_semaphore->open_count += 1; 20096a8: 82 00 60 01 inc %g1 _Thread_Enable_dispatch(); 20096ac: 40 00 0c 72 call 200c874 <_Thread_Enable_dispatch> 20096b0: c2 22 20 18 st %g1, [ %o0 + 0x18 ] _Thread_Enable_dispatch(); 20096b4: 40 00 0c 70 call 200c874 <_Thread_Enable_dispatch> 20096b8: 01 00 00 00 nop the_semaphore->Semaphore_id = the_semaphore->Object.id; id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; #endif return id; 20096bc: f0 07 bf f8 ld [ %fp + -8 ], %i0 } 20096c0: 81 c7 e0 08 ret 20096c4: 91 ee 20 08 restore %i0, 8, %o0 _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); mode = (mode_t) va_arg( arg, unsigned int ); value = va_arg( arg, unsigned int ); 20096c8: 82 07 a0 54 add %fp, 0x54, %g1 20096cc: fa 07 a0 50 ld [ %fp + 0x50 ], %i5 20096d0: 10 bf ff db b 200963c 20096d4: c2 27 bf f0 st %g1, [ %fp + -16 ] /* * At this point, the semaphore does not exist and everything has been * checked. We should go ahead and create a semaphore. */ status =_POSIX_Semaphore_Create_support( 20096d8: 92 10 20 00 clr %o1 20096dc: 96 07 bf f8 add %fp, -8, %o3 20096e0: 40 00 1b 79 call 20104c4 <_POSIX_Semaphore_Create_support> 20096e4: 90 10 00 18 mov %i0, %o0 /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); 20096e8: 40 00 0c 63 call 200c874 <_Thread_Enable_dispatch> 20096ec: ba 10 00 08 mov %o0, %i5 if ( status == -1 ) 20096f0: 80 a7 7f ff cmp %i5, -1 20096f4: 02 bf ff e2 be 200967c 20096f8: b0 10 3f ff mov -1, %i0 the_semaphore->Semaphore_id = the_semaphore->Object.id; id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; #endif return id; 20096fc: f0 07 bf f8 ld [ %fp + -8 ], %i0 2009700: 81 c7 e0 08 ret 2009704: 91 ee 20 08 restore %i0, 8, %o0 /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { _Thread_Enable_dispatch(); 2009708: 40 00 0c 5b call 200c874 <_Thread_Enable_dispatch> 200970c: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 2009710: 40 00 28 61 call 2013894 <__errno> 2009714: 01 00 00 00 nop 2009718: 82 10 20 11 mov 0x11, %g1 ! 11 200971c: c2 22 00 00 st %g1, [ %o0 ] 2009720: 81 c7 e0 08 ret 2009724: 81 e8 00 00 restore =============================================================================== 02009784 : int sem_timedwait( sem_t *sem, const struct timespec *abstime ) { 2009784: 9d e3 bf 98 save %sp, -104, %sp * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 2009788: 90 10 00 19 mov %i1, %o0 200978c: 40 00 18 e7 call 200fb28 <_POSIX_Absolute_timeout_to_ticks> 2009790: 92 07 bf fc add %fp, -4, %o1 if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 2009794: d4 07 bf fc ld [ %fp + -4 ], %o2 * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 2009798: 80 a2 20 03 cmp %o0, 3 200979c: 02 80 00 06 be 20097b4 <== ALWAYS TAKEN 20097a0: 90 10 00 18 mov %i0, %o0 do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 20097a4: 40 00 1b c6 call 20106bc <_POSIX_Semaphore_Wait_support> <== NOT EXECUTED 20097a8: 92 10 20 00 clr %o1 <== NOT EXECUTED 20097ac: 81 c7 e0 08 ret <== NOT EXECUTED 20097b0: 91 e8 00 08 restore %g0, %o0, %o0 <== NOT EXECUTED 20097b4: 40 00 1b c2 call 20106bc <_POSIX_Semaphore_Wait_support> 20097b8: 92 10 20 01 mov 1, %o1 lock_status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) rtems_set_errno_and_return_minus_one( ETIMEDOUT ); } return lock_status; } 20097bc: 81 c7 e0 08 ret 20097c0: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 02006c3c : int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 2006c3c: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; if ( oact ) 2006c40: 80 a6 a0 00 cmp %i2, 0 2006c44: 02 80 00 0d be 2006c78 2006c48: 87 2e 20 02 sll %i0, 2, %g3 *oact = _POSIX_signals_Vectors[ sig ]; 2006c4c: 05 00 80 7e sethi %hi(0x201f800), %g2 2006c50: 83 2e 20 04 sll %i0, 4, %g1 2006c54: 84 10 a1 b0 or %g2, 0x1b0, %g2 2006c58: 82 20 40 03 sub %g1, %g3, %g1 2006c5c: c6 00 80 01 ld [ %g2 + %g1 ], %g3 2006c60: 82 00 80 01 add %g2, %g1, %g1 2006c64: c6 26 80 00 st %g3, [ %i2 ] 2006c68: c4 00 60 04 ld [ %g1 + 4 ], %g2 2006c6c: c4 26 a0 04 st %g2, [ %i2 + 4 ] 2006c70: c2 00 60 08 ld [ %g1 + 8 ], %g1 2006c74: c2 26 a0 08 st %g1, [ %i2 + 8 ] if ( !sig ) 2006c78: 80 a6 20 00 cmp %i0, 0 2006c7c: 02 80 00 33 be 2006d48 2006c80: 01 00 00 00 nop static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 2006c84: 82 06 3f ff add %i0, -1, %g1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 2006c88: 80 a0 60 1f cmp %g1, 0x1f 2006c8c: 18 80 00 2f bgu 2006d48 2006c90: 80 a6 20 09 cmp %i0, 9 * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 2006c94: 02 80 00 2d be 2006d48 2006c98: 80 a6 60 00 cmp %i1, 0 /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 2006c9c: 02 80 00 1a be 2006d04 <== NEVER TAKEN 2006ca0: 82 10 20 00 clr %g1 /* * Unless the user is installing the default signal actions, then * we can just copy the provided sigaction structure into the vectors. */ _ISR_Disable( level ); 2006ca4: 7f ff ee 29 call 2002548 2006ca8: 01 00 00 00 nop 2006cac: b4 10 00 08 mov %o0, %i2 if ( act->sa_handler == SIG_DFL ) { 2006cb0: c2 06 60 08 ld [ %i1 + 8 ], %g1 2006cb4: 80 a0 60 00 cmp %g1, 0 2006cb8: 02 80 00 15 be 2006d0c 2006cbc: 83 2e 20 02 sll %i0, 2, %g1 _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; } else { _POSIX_signals_Clear_process_signals( sig ); 2006cc0: 40 00 19 d5 call 200d414 <_POSIX_signals_Clear_process_signals> 2006cc4: 90 10 00 18 mov %i0, %o0 _POSIX_signals_Vectors[ sig ] = *act; 2006cc8: c4 06 40 00 ld [ %i1 ], %g2 2006ccc: 87 2e 20 02 sll %i0, 2, %g3 2006cd0: 03 00 80 7e sethi %hi(0x201f800), %g1 2006cd4: b1 2e 20 04 sll %i0, 4, %i0 2006cd8: 82 10 61 b0 or %g1, 0x1b0, %g1 2006cdc: b0 26 00 03 sub %i0, %g3, %i0 2006ce0: c4 20 40 18 st %g2, [ %g1 + %i0 ] 2006ce4: c4 06 60 04 ld [ %i1 + 4 ], %g2 2006ce8: b0 00 40 18 add %g1, %i0, %i0 2006cec: c4 26 20 04 st %g2, [ %i0 + 4 ] 2006cf0: c2 06 60 08 ld [ %i1 + 8 ], %g1 2006cf4: c2 26 20 08 st %g1, [ %i0 + 8 ] } _ISR_Enable( level ); 2006cf8: 7f ff ee 18 call 2002558 2006cfc: 90 10 00 1a mov %i2, %o0 * now (signals not posted when SIG_IGN). * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; 2006d00: 82 10 20 00 clr %g1 } 2006d04: 81 c7 e0 08 ret 2006d08: 91 e8 00 01 restore %g0, %g1, %o0 * we can just copy the provided sigaction structure into the vectors. */ _ISR_Disable( level ); if ( act->sa_handler == SIG_DFL ) { _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; 2006d0c: b1 2e 20 04 sll %i0, 4, %i0 2006d10: b0 26 00 01 sub %i0, %g1, %i0 2006d14: 03 00 80 77 sethi %hi(0x201dc00), %g1 2006d18: 82 10 60 74 or %g1, 0x74, %g1 ! 201dc74 <_POSIX_signals_Default_vectors> 2006d1c: c8 00 40 18 ld [ %g1 + %i0 ], %g4 2006d20: 82 00 40 18 add %g1, %i0, %g1 2006d24: c6 00 60 04 ld [ %g1 + 4 ], %g3 2006d28: c4 00 60 08 ld [ %g1 + 8 ], %g2 2006d2c: 03 00 80 7e sethi %hi(0x201f800), %g1 2006d30: 82 10 61 b0 or %g1, 0x1b0, %g1 ! 201f9b0 <_POSIX_signals_Vectors> 2006d34: c8 20 40 18 st %g4, [ %g1 + %i0 ] 2006d38: b0 00 40 18 add %g1, %i0, %i0 2006d3c: c6 26 20 04 st %g3, [ %i0 + 4 ] 2006d40: 10 bf ff ee b 2006cf8 2006d44: c4 26 20 08 st %g2, [ %i0 + 8 ] * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) rtems_set_errno_and_return_minus_one( EINVAL ); 2006d48: 40 00 26 53 call 2010694 <__errno> 2006d4c: 01 00 00 00 nop 2006d50: 84 10 20 16 mov 0x16, %g2 ! 16 2006d54: 82 10 3f ff mov -1, %g1 2006d58: 10 bf ff eb b 2006d04 2006d5c: c4 22 00 00 st %g2, [ %o0 ] =============================================================================== 02007124 : int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { 2007124: 9d e3 bf 90 save %sp, -112, %sp ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) 2007128: ba 96 20 00 orcc %i0, 0, %i5 200712c: 02 80 00 84 be 200733c 2007130: 80 a6 a0 00 cmp %i2, 0 /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; if ( timeout ) { 2007134: 02 80 00 5c be 20072a4 2007138: 80 a6 60 00 cmp %i1, 0 if ( !_Timespec_Is_valid( timeout ) ) 200713c: 40 00 0f 87 call 200af58 <_Timespec_Is_valid> 2007140: 90 10 00 1a mov %i2, %o0 2007144: 80 8a 20 ff btst 0xff, %o0 2007148: 02 80 00 7d be 200733c 200714c: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); 2007150: 40 00 0f a7 call 200afec <_Timespec_To_ticks> 2007154: 90 10 00 1a mov %i2, %o0 if ( !interval ) 2007158: a0 92 20 00 orcc %o0, 0, %l0 200715c: 02 80 00 78 be 200733c <== NEVER TAKEN 2007160: 80 a6 60 00 cmp %i1, 0 /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 2007164: 02 80 00 53 be 20072b0 <== NEVER TAKEN 2007168: 39 00 80 80 sethi %hi(0x2020000), %i4 the_thread = _Thread_Executing; 200716c: 39 00 80 80 sethi %hi(0x2020000), %i4 2007170: b8 17 21 c8 or %i4, 0x1c8, %i4 ! 20201c8 <_Per_CPU_Information> 2007174: f0 07 20 0c ld [ %i4 + 0xc ], %i0 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 2007178: 7f ff ed cf call 20028b4 200717c: f4 06 21 5c ld [ %i0 + 0x15c ], %i2 2007180: b6 10 00 08 mov %o0, %i3 if ( *set & api->signals_pending ) { 2007184: c2 07 40 00 ld [ %i5 ], %g1 2007188: c4 06 a0 d4 ld [ %i2 + 0xd4 ], %g2 200718c: 80 88 40 02 btst %g1, %g2 2007190: 12 80 00 53 bne 20072dc 2007194: 01 00 00 00 nop return the_info->si_signo; } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { 2007198: 05 00 80 81 sethi %hi(0x2020400), %g2 200719c: c4 00 a0 14 ld [ %g2 + 0x14 ], %g2 ! 2020414 <_POSIX_signals_Pending> 20071a0: 80 88 40 02 btst %g1, %g2 20071a4: 12 80 00 2f bne 2007260 20071a8: 03 00 80 7f sethi %hi(0x201fc00), %g1 /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 20071ac: c4 00 60 90 ld [ %g1 + 0x90 ], %g2 ! 201fc90 <_Thread_Dispatch_disable_level> the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; return signo; } the_info->si_signo = -1; 20071b0: 86 10 3f ff mov -1, %g3 20071b4: c6 26 40 00 st %g3, [ %i1 ] 20071b8: 84 00 a0 01 inc %g2 20071bc: c4 20 60 90 st %g2, [ %g1 + 0x90 ] return _Thread_Dispatch_disable_level; 20071c0: c2 00 60 90 ld [ %g1 + 0x90 ], %g1 _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; 20071c4: 82 10 20 04 mov 4, %g1 20071c8: c2 26 20 34 st %g1, [ %i0 + 0x34 ] the_thread->Wait.option = *set; 20071cc: c2 07 40 00 ld [ %i5 ], %g1 the_thread->Wait.return_argument = the_info; 20071d0: f2 26 20 28 st %i1, [ %i0 + 0x28 ] the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; the_thread->Wait.option = *set; 20071d4: c2 26 20 30 st %g1, [ %i0 + 0x30 ] 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; 20071d8: b6 10 20 01 mov 1, %i3 } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 20071dc: 23 00 80 80 sethi %hi(0x2020000), %l1 20071e0: a2 14 63 ac or %l1, 0x3ac, %l1 ! 20203ac <_POSIX_signals_Wait_queue> 20071e4: e2 26 20 44 st %l1, [ %i0 + 0x44 ] 20071e8: f6 24 60 30 st %i3, [ %l1 + 0x30 ] the_thread->Wait.return_code = EINTR; the_thread->Wait.option = *set; the_thread->Wait.return_argument = the_info; _Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue ); _ISR_Enable( level ); 20071ec: 7f ff ed b6 call 20028c4 20071f0: 01 00 00 00 nop _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 20071f4: 90 10 00 11 mov %l1, %o0 20071f8: 92 10 00 10 mov %l0, %o1 20071fc: 15 00 80 2b sethi %hi(0x200ac00), %o2 2007200: 40 00 0d 8b call 200a82c <_Thread_queue_Enqueue_with_handler> 2007204: 94 12 a0 0c or %o2, 0xc, %o2 ! 200ac0c <_Thread_queue_Timeout> _Thread_Enable_dispatch(); 2007208: 40 00 0c 3f call 200a304 <_Thread_Enable_dispatch> 200720c: 01 00 00 00 nop /* * When the thread is set free by a signal, it is need to eliminate * the signal. */ _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, false, false ); 2007210: d2 06 40 00 ld [ %i1 ], %o1 2007214: 90 10 00 1a mov %i2, %o0 2007218: 94 10 00 19 mov %i1, %o2 200721c: 96 10 20 00 clr %o3 2007220: 40 00 1a 91 call 200dc64 <_POSIX_signals_Clear_signals> 2007224: 98 10 20 00 clr %o4 /* Set errno only if return code is not EINTR or * if EINTR was caused by a signal being caught, which * was not in our set. */ if ( (_Thread_Executing->Wait.return_code != EINTR) 2007228: c2 07 20 0c ld [ %i4 + 0xc ], %g1 200722c: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 2007230: 80 a0 60 04 cmp %g1, 4 2007234: 12 80 00 3b bne 2007320 2007238: 01 00 00 00 nop || !(*set & signo_to_mask( the_info->si_signo )) ) { 200723c: f0 06 40 00 ld [ %i1 ], %i0 2007240: c2 07 40 00 ld [ %i5 ], %g1 2007244: 84 06 3f ff add %i0, -1, %g2 2007248: b7 2e c0 02 sll %i3, %g2, %i3 200724c: 80 8e c0 01 btst %i3, %g1 2007250: 02 80 00 34 be 2007320 2007254: 01 00 00 00 nop errno = _Thread_Executing->Wait.return_code; return -1; } return the_info->si_signo; } 2007258: 81 c7 e0 08 ret 200725c: 81 e8 00 00 restore } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending ); 2007260: 7f ff ff 99 call 20070c4 <_POSIX_signals_Get_lowest> 2007264: 90 10 00 02 mov %g2, %o0 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 2007268: 94 10 00 19 mov %i1, %o2 } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending ); 200726c: b0 10 00 08 mov %o0, %i0 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 2007270: 96 10 20 01 mov 1, %o3 2007274: 90 10 00 1a mov %i2, %o0 2007278: 92 10 00 18 mov %i0, %o1 200727c: 40 00 1a 7a call 200dc64 <_POSIX_signals_Clear_signals> 2007280: 98 10 20 00 clr %o4 _ISR_Enable( level ); 2007284: 7f ff ed 90 call 20028c4 2007288: 90 10 00 1b mov %i3, %o0 the_info->si_signo = signo; the_info->si_code = SI_USER; 200728c: 82 10 20 01 mov 1, %g1 if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending ); _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); _ISR_Enable( level ); the_info->si_signo = signo; 2007290: f0 26 40 00 st %i0, [ %i1 ] the_info->si_code = SI_USER; 2007294: c2 26 60 04 st %g1, [ %i1 + 4 ] the_info->si_value.sival_int = 0; 2007298: c0 26 60 08 clr [ %i1 + 8 ] return signo; 200729c: 81 c7 e0 08 ret 20072a0: 81 e8 00 00 restore /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 20072a4: 12 bf ff b2 bne 200716c 20072a8: a0 10 20 00 clr %l0 the_thread = _Thread_Executing; 20072ac: 39 00 80 80 sethi %hi(0x2020000), %i4 20072b0: b8 17 21 c8 or %i4, 0x1c8, %i4 ! 20201c8 <_Per_CPU_Information> 20072b4: f0 07 20 0c ld [ %i4 + 0xc ], %i0 /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 20072b8: b2 07 bf f4 add %fp, -12, %i1 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 20072bc: 7f ff ed 7e call 20028b4 20072c0: f4 06 21 5c ld [ %i0 + 0x15c ], %i2 20072c4: b6 10 00 08 mov %o0, %i3 if ( *set & api->signals_pending ) { 20072c8: c2 07 40 00 ld [ %i5 ], %g1 20072cc: c4 06 a0 d4 ld [ %i2 + 0xd4 ], %g2 20072d0: 80 88 40 02 btst %g1, %g2 20072d4: 22 bf ff b2 be,a 200719c 20072d8: 05 00 80 81 sethi %hi(0x2020400), %g2 /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending ); 20072dc: 7f ff ff 7a call 20070c4 <_POSIX_signals_Get_lowest> 20072e0: 90 10 00 02 mov %g2, %o0 _POSIX_signals_Clear_signals( 20072e4: 94 10 00 19 mov %i1, %o2 /* API signals pending? */ _ISR_Disable( level ); if ( *set & api->signals_pending ) { /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending ); 20072e8: 92 10 00 08 mov %o0, %o1 20072ec: d0 26 40 00 st %o0, [ %i1 ] _POSIX_signals_Clear_signals( 20072f0: 96 10 20 00 clr %o3 20072f4: 90 10 00 1a mov %i2, %o0 20072f8: 40 00 1a 5b call 200dc64 <_POSIX_signals_Clear_signals> 20072fc: 98 10 20 00 clr %o4 the_info->si_signo, the_info, false, false ); _ISR_Enable( level ); 2007300: 7f ff ed 71 call 20028c4 2007304: 90 10 00 1b mov %i3, %o0 the_info->si_code = SI_USER; 2007308: 82 10 20 01 mov 1, %g1 the_info->si_value.sival_int = 0; 200730c: c0 26 60 08 clr [ %i1 + 8 ] false, false ); _ISR_Enable( level ); the_info->si_code = SI_USER; 2007310: c2 26 60 04 st %g1, [ %i1 + 4 ] the_info->si_value.sival_int = 0; return the_info->si_signo; 2007314: f0 06 40 00 ld [ %i1 ], %i0 2007318: 81 c7 e0 08 ret 200731c: 81 e8 00 00 restore * was not in our set. */ if ( (_Thread_Executing->Wait.return_code != EINTR) || !(*set & signo_to_mask( the_info->si_signo )) ) { errno = _Thread_Executing->Wait.return_code; 2007320: 40 00 26 be call 2010e18 <__errno> 2007324: b0 10 3f ff mov -1, %i0 2007328: c2 07 20 0c ld [ %i4 + 0xc ], %g1 200732c: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 2007330: c2 22 00 00 st %g1, [ %o0 ] return -1; } return the_info->si_signo; } 2007334: 81 c7 e0 08 ret 2007338: 81 e8 00 00 restore rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); if ( !interval ) rtems_set_errno_and_return_minus_one( EINVAL ); 200733c: 40 00 26 b7 call 2010e18 <__errno> 2007340: b0 10 3f ff mov -1, %i0 2007344: 82 10 20 16 mov 0x16, %g1 2007348: c2 22 00 00 st %g1, [ %o0 ] 200734c: 81 c7 e0 08 ret 2007350: 81 e8 00 00 restore =============================================================================== 02008f88 : int sigwait( const sigset_t *set, int *sig ) { 2008f88: 9d e3 bf a0 save %sp, -96, %sp int status; status = sigtimedwait( set, NULL, NULL ); 2008f8c: 92 10 20 00 clr %o1 2008f90: 90 10 00 18 mov %i0, %o0 2008f94: 7f ff ff 6d call 2008d48 2008f98: 94 10 20 00 clr %o2 if ( status != -1 ) { 2008f9c: 80 a2 3f ff cmp %o0, -1 2008fa0: 02 80 00 07 be 2008fbc 2008fa4: 80 a6 60 00 cmp %i1, 0 if ( sig ) 2008fa8: 02 80 00 03 be 2008fb4 <== NEVER TAKEN 2008fac: b0 10 20 00 clr %i0 *sig = status; 2008fb0: d0 26 40 00 st %o0, [ %i1 ] 2008fb4: 81 c7 e0 08 ret 2008fb8: 81 e8 00 00 restore return 0; } return errno; 2008fbc: 40 00 25 e4 call 201274c <__errno> 2008fc0: 01 00 00 00 nop 2008fc4: f0 02 00 00 ld [ %o0 ], %i0 } 2008fc8: 81 c7 e0 08 ret 2008fcc: 81 e8 00 00 restore =============================================================================== 02005164 : /* * Process input character, with semaphore. */ static int siproc (unsigned char c, struct rtems_termios_tty *tty) { 2005164: 9d e3 bf a0 save %sp, -96, %sp int i; /* * Obtain output semaphore if character will be echoed */ if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) { 2005168: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 200516c: 80 88 6e 78 btst 0xe78, %g1 2005170: 32 80 00 04 bne,a 2005180 <== ALWAYS TAKEN 2005174: d0 06 60 18 ld [ %i1 + 0x18 ], %o0 rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); i = iproc (c, tty); rtems_semaphore_release (tty->osem); } else { i = iproc (c, tty); 2005178: 7f ff ff 82 call 2004f80 <== NOT EXECUTED 200517c: 81 e8 00 00 restore <== NOT EXECUTED /* * Obtain output semaphore if character will be echoed */ if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) { rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 2005180: 94 10 20 00 clr %o2 2005184: 40 00 05 dd call 20068f8 2005188: 92 10 20 00 clr %o1 i = iproc (c, tty); 200518c: 90 10 00 18 mov %i0, %o0 2005190: 7f ff ff 7c call 2004f80 2005194: 92 10 00 19 mov %i1, %o1 2005198: b0 10 00 08 mov %o0, %i0 rtems_semaphore_release (tty->osem); 200519c: 40 00 06 21 call 2006a20 20051a0: d0 06 60 18 ld [ %i1 + 0x18 ], %o0 } else { i = iproc (c, tty); } return i; } 20051a4: 81 c7 e0 08 ret 20051a8: 81 e8 00 00 restore =============================================================================== 020062ac : #include int statvfs (const char *path, struct statvfs *sb) { 20062ac: 9d e3 bf 88 save %sp, -120, %sp * 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 ) ) 20062b0: 40 00 37 72 call 2014078 20062b4: 90 10 00 18 mov %i0, %o0 20062b8: 94 10 20 00 clr %o2 20062bc: 92 10 00 08 mov %o0, %o1 20062c0: 96 07 bf ec add %fp, -20, %o3 20062c4: 90 10 00 18 mov %i0, %o0 20062c8: 98 10 20 01 mov 1, %o4 20062cc: 7f ff fa ab call 2004d78 20062d0: b0 10 3f ff mov -1, %i0 20062d4: 80 a2 20 00 cmp %o0, 0 20062d8: 12 80 00 0e bne 2006310 <== NEVER TAKEN 20062dc: fa 07 bf fc ld [ %fp + -4 ], %i5 return -1; mt_entry = loc.mt_entry; fs_mount_root = &mt_entry->mt_fs_root; memset (sb, 0, sizeof (struct statvfs)); 20062e0: 92 10 20 00 clr %o1 20062e4: 94 10 20 38 mov 0x38, %o2 20062e8: 40 00 32 e7 call 2012e84 20062ec: 90 10 00 19 mov %i1, %o0 result = ( fs_mount_root->ops->statvfs_h )( fs_mount_root, sb ); 20062f0: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 20062f4: 92 10 00 19 mov %i1, %o1 20062f8: c2 00 60 44 ld [ %g1 + 0x44 ], %g1 20062fc: 9f c0 40 00 call %g1 2006300: 90 07 60 1c add %i5, 0x1c, %o0 2006304: b0 10 00 08 mov %o0, %i0 rtems_filesystem_freenode( &loc ); 2006308: 7f ff fa d6 call 2004e60 200630c: 90 07 bf ec add %fp, -20, %o0 return result; } 2006310: 81 c7 e0 08 ret 2006314: 81 e8 00 00 restore =============================================================================== 02004db0 : fdatasync(fn); } /* iterate over all FILE *'s for this thread */ static void sync_per_thread(Thread_Control *t) { 2004db0: 9d e3 bf a0 save %sp, -96, %sp /* * The sync_wrapper() function will operate on the current thread's * reent structure so we will temporarily use that. */ this_reent = t->libc_reent; 2004db4: c2 06 21 54 ld [ %i0 + 0x154 ], %g1 if ( this_reent ) { 2004db8: 80 a0 60 00 cmp %g1, 0 2004dbc: 02 80 00 0c be 2004dec <== NEVER TAKEN 2004dc0: 3b 00 80 63 sethi %hi(0x2018c00), %i5 current_reent = _Thread_Executing->libc_reent; 2004dc4: ba 17 61 28 or %i5, 0x128, %i5 ! 2018d28 <_Per_CPU_Information> 2004dc8: c4 07 60 0c ld [ %i5 + 0xc ], %g2 _Thread_Executing->libc_reent = this_reent; _fwalk (t->libc_reent, sync_wrapper); 2004dcc: 13 00 80 13 sethi %hi(0x2004c00), %o1 * The sync_wrapper() function will operate on the current thread's * reent structure so we will temporarily use that. */ this_reent = t->libc_reent; if ( this_reent ) { current_reent = _Thread_Executing->libc_reent; 2004dd0: f8 00 a1 54 ld [ %g2 + 0x154 ], %i4 _Thread_Executing->libc_reent = this_reent; 2004dd4: c2 20 a1 54 st %g1, [ %g2 + 0x154 ] _fwalk (t->libc_reent, sync_wrapper); 2004dd8: d0 06 21 54 ld [ %i0 + 0x154 ], %o0 2004ddc: 40 00 31 93 call 2011428 <_fwalk> 2004de0: 92 12 61 f4 or %o1, 0x1f4, %o1 _Thread_Executing->libc_reent = current_reent; 2004de4: c2 07 60 0c ld [ %i5 + 0xc ], %g1 2004de8: f8 20 61 54 st %i4, [ %g1 + 0x154 ] 2004dec: 81 c7 e0 08 ret 2004df0: 81 e8 00 00 restore =============================================================================== 02005f38 : */ long sysconf( int name ) { 2005f38: 9d e3 bf a0 save %sp, -96, %sp if ( name == _SC_CLK_TCK ) 2005f3c: 80 a6 20 02 cmp %i0, 2 2005f40: 02 80 00 10 be 2005f80 2005f44: 03 00 80 5c sethi %hi(0x2017000), %g1 return (TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick()); if ( name == _SC_OPEN_MAX ) 2005f48: 80 a6 20 04 cmp %i0, 4 2005f4c: 02 80 00 0b be 2005f78 2005f50: c2 00 62 50 ld [ %g1 + 0x250 ], %g1 return rtems_libio_number_iops; if ( name == _SC_GETPW_R_SIZE_MAX ) 2005f54: 80 a6 20 33 cmp %i0, 0x33 2005f58: 02 80 00 08 be 2005f78 2005f5c: 82 10 24 00 mov 0x400, %g1 return 1024; if ( name == _SC_PAGESIZE ) 2005f60: 80 a6 20 08 cmp %i0, 8 2005f64: 02 80 00 05 be 2005f78 2005f68: 03 00 00 04 sethi %hi(0x1000), %g1 return PAGE_SIZE; #if defined(__sparc__) if ( name == 515 ) /* Solaris _SC_STACK_PROT */ 2005f6c: 80 a6 22 03 cmp %i0, 0x203 2005f70: 12 80 00 0c bne 2005fa0 <== ALWAYS TAKEN 2005f74: 82 10 20 00 clr %g1 return 0; #endif rtems_set_errno_and_return_minus_one( EINVAL ); } 2005f78: 81 c7 e0 08 ret 2005f7c: 91 e8 00 01 restore %g0, %g1, %o0 int name ) { if ( name == _SC_CLK_TCK ) return (TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick()); 2005f80: 03 00 80 5c sethi %hi(0x2017000), %g1 long sysconf( int name ) { if ( name == _SC_CLK_TCK ) return (TOD_MICROSECONDS_PER_SECOND / 2005f84: d2 00 61 18 ld [ %g1 + 0x118 ], %o1 ! 2017118 2005f88: 11 00 03 d0 sethi %hi(0xf4000), %o0 2005f8c: 40 00 35 b9 call 2013670 <.udiv> 2005f90: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 2005f94: 82 10 00 08 mov %o0, %g1 if ( name == 515 ) /* Solaris _SC_STACK_PROT */ return 0; #endif rtems_set_errno_and_return_minus_one( EINVAL ); } 2005f98: 81 c7 e0 08 ret 2005f9c: 91 e8 00 01 restore %g0, %g1, %o0 #if defined(__sparc__) if ( name == 515 ) /* Solaris _SC_STACK_PROT */ return 0; #endif rtems_set_errno_and_return_minus_one( EINVAL ); 2005fa0: 40 00 26 6f call 200f95c <__errno> 2005fa4: 01 00 00 00 nop 2005fa8: 84 10 20 16 mov 0x16, %g2 ! 16 2005fac: 82 10 3f ff mov -1, %g1 2005fb0: 10 bf ff f2 b 2005f78 2005fb4: c4 22 00 00 st %g2, [ %o0 ] =============================================================================== 0200d2e4 : int tcsetattr( int fd, int opt, struct termios *tp ) { 200d2e4: 9d e3 bf a0 save %sp, -96, %sp switch (opt) { 200d2e8: 80 a6 60 00 cmp %i1, 0 200d2ec: 02 80 00 10 be 200d32c 200d2f0: 80 a6 60 01 cmp %i1, 1 200d2f4: 22 80 00 08 be,a 200d314 200d2f8: 90 10 00 18 mov %i0, %o0 default: rtems_set_errno_and_return_minus_one( ENOTSUP ); 200d2fc: 40 00 10 31 call 20113c0 <__errno> 200d300: 01 00 00 00 nop 200d304: 82 10 20 86 mov 0x86, %g1 ! 86 200d308: c2 22 00 00 st %g1, [ %o0 ] * Fall through to.... */ case TCSANOW: return ioctl( fd, RTEMS_IO_SET_ATTRIBUTES, tp ); } } 200d30c: 81 c7 e0 08 ret 200d310: 91 e8 3f ff restore %g0, -1, %o0 switch (opt) { default: rtems_set_errno_and_return_minus_one( ENOTSUP ); case TCSADRAIN: if (ioctl( fd, RTEMS_IO_TCDRAIN, NULL ) < 0) 200d314: 92 10 20 03 mov 3, %o1 200d318: 7f ff fe f8 call 200cef8 200d31c: 94 10 20 00 clr %o2 200d320: 80 a2 20 00 cmp %o0, 0 200d324: 06 bf ff fa bl 200d30c <== NEVER TAKEN 200d328: 01 00 00 00 nop return -1; /* * Fall through to.... */ case TCSANOW: return ioctl( fd, RTEMS_IO_SET_ATTRIBUTES, tp ); 200d32c: 7f ff fe f3 call 200cef8 200d330: 93 e8 20 02 restore %g0, 2, %o1 =============================================================================== 020062e4 : int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 20062e4: 9d e3 bf a0 save %sp, -96, %sp POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 20062e8: 80 a6 20 01 cmp %i0, 1 20062ec: 12 80 00 3e bne 20063e4 20062f0: 80 a6 a0 00 cmp %i2, 0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) 20062f4: 02 80 00 3c be 20063e4 20062f8: 80 a6 60 00 cmp %i1, 0 /* * The data of the structure evp are checked in order to verify if they * are coherent. */ if (evp != NULL) { 20062fc: 02 80 00 0e be 2006334 2006300: 03 00 80 78 sethi %hi(0x201e000), %g1 /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 2006304: c2 06 40 00 ld [ %i1 ], %g1 2006308: 82 00 7f ff add %g1, -1, %g1 200630c: 80 a0 60 01 cmp %g1, 1 2006310: 18 80 00 35 bgu 20063e4 <== NEVER TAKEN 2006314: 01 00 00 00 nop ( evp->sigev_notify != SIGEV_SIGNAL ) ) { /* The value of the field sigev_notify is not valid */ rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !evp->sigev_signo ) 2006318: c2 06 60 04 ld [ %i1 + 4 ], %g1 200631c: 80 a0 60 00 cmp %g1, 0 2006320: 02 80 00 31 be 20063e4 <== NEVER TAKEN 2006324: 82 00 7f ff add %g1, -1, %g1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) 2006328: 80 a0 60 1f cmp %g1, 0x1f 200632c: 18 80 00 2e bgu 20063e4 <== NEVER TAKEN 2006330: 03 00 80 78 sethi %hi(0x201e000), %g1 /** * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 2006334: c4 00 63 c0 ld [ %g1 + 0x3c0 ], %g2 ! 201e3c0 <_Thread_Dispatch_disable_level> 2006338: 84 00 a0 01 inc %g2 200633c: c4 20 63 c0 st %g2, [ %g1 + 0x3c0 ] return _Thread_Dispatch_disable_level; 2006340: c2 00 63 c0 ld [ %g1 + 0x3c0 ], %g1 * the inactive chain of free timer control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Allocate( void ) { return (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information ); 2006344: 3b 00 80 79 sethi %hi(0x201e400), %i5 2006348: 40 00 08 4a call 2008470 <_Objects_Allocate> 200634c: 90 17 62 c0 or %i5, 0x2c0, %o0 ! 201e6c0 <_POSIX_Timer_Information> /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 2006350: 80 a2 20 00 cmp %o0, 0 2006354: 02 80 00 2a be 20063fc 2006358: 82 10 20 02 mov 2, %g1 rtems_set_errno_and_return_minus_one( EAGAIN ); } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 200635c: c2 2a 20 3c stb %g1, [ %o0 + 0x3c ] ptimer->thread_id = _Thread_Executing->Object.id; 2006360: 03 00 80 7a sethi %hi(0x201e800), %g1 2006364: c2 00 61 04 ld [ %g1 + 0x104 ], %g1 ! 201e904 <_Per_CPU_Information+0xc> if ( evp != NULL ) { 2006368: 80 a6 60 00 cmp %i1, 0 } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; ptimer->thread_id = _Thread_Executing->Object.id; 200636c: c2 00 60 08 ld [ %g1 + 8 ], %g1 if ( evp != NULL ) { 2006370: 02 80 00 08 be 2006390 2006374: c2 22 20 38 st %g1, [ %o0 + 0x38 ] ptimer->inf.sigev_notify = evp->sigev_notify; 2006378: c6 06 40 00 ld [ %i1 ], %g3 ptimer->inf.sigev_signo = evp->sigev_signo; 200637c: c4 06 60 04 ld [ %i1 + 4 ], %g2 ptimer->inf.sigev_value = evp->sigev_value; 2006380: c2 06 60 08 ld [ %i1 + 8 ], %g1 ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; ptimer->thread_id = _Thread_Executing->Object.id; if ( evp != NULL ) { ptimer->inf.sigev_notify = evp->sigev_notify; 2006384: c6 22 20 40 st %g3, [ %o0 + 0x40 ] ptimer->inf.sigev_signo = evp->sigev_signo; 2006388: c4 22 20 44 st %g2, [ %o0 + 0x44 ] ptimer->inf.sigev_value = evp->sigev_value; 200638c: c2 22 20 48 st %g1, [ %o0 + 0x48 ] Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 2006390: c4 12 20 0a lduh [ %o0 + 0xa ], %g2 _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; _Thread_Enable_dispatch(); return 0; } 2006394: ba 17 62 c0 or %i5, 0x2c0, %i5 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 2006398: c6 07 60 1c ld [ %i5 + 0x1c ], %g3 ptimer->inf.sigev_notify = evp->sigev_notify; ptimer->inf.sigev_signo = evp->sigev_signo; ptimer->inf.sigev_value = evp->sigev_value; } ptimer->overrun = 0; 200639c: c0 22 20 68 clr [ %o0 + 0x68 ] ptimer->timer_data.it_value.tv_sec = 0; 20063a0: c0 22 20 5c clr [ %o0 + 0x5c ] ptimer->timer_data.it_value.tv_nsec = 0; 20063a4: c0 22 20 60 clr [ %o0 + 0x60 ] ptimer->timer_data.it_interval.tv_sec = 0; 20063a8: c0 22 20 54 clr [ %o0 + 0x54 ] ptimer->timer_data.it_interval.tv_nsec = 0; 20063ac: c0 22 20 58 clr [ %o0 + 0x58 ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 20063b0: c0 22 20 18 clr [ %o0 + 0x18 ] the_watchdog->routine = routine; 20063b4: c0 22 20 2c clr [ %o0 + 0x2c ] the_watchdog->id = id; 20063b8: c0 22 20 30 clr [ %o0 + 0x30 ] the_watchdog->user_data = user_data; 20063bc: c0 22 20 34 clr [ %o0 + 0x34 ] Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 20063c0: c2 02 20 08 ld [ %o0 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 20063c4: 85 28 a0 02 sll %g2, 2, %g2 20063c8: d0 20 c0 02 st %o0, [ %g3 + %g2 ] _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 20063cc: c0 22 20 0c clr [ %o0 + 0xc ] _Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL ); _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; 20063d0: c2 26 80 00 st %g1, [ %i2 ] _Thread_Enable_dispatch(); 20063d4: 40 00 0d 0e call 200980c <_Thread_Enable_dispatch> 20063d8: b0 10 20 00 clr %i0 return 0; } 20063dc: 81 c7 e0 08 ret 20063e0: 81 e8 00 00 restore if ( !evp->sigev_signo ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) rtems_set_errno_and_return_minus_one( EINVAL ); 20063e4: 40 00 27 84 call 20101f4 <__errno> 20063e8: b0 10 3f ff mov -1, %i0 20063ec: 82 10 20 16 mov 0x16, %g1 20063f0: c2 22 00 00 st %g1, [ %o0 ] 20063f4: 81 c7 e0 08 ret 20063f8: 81 e8 00 00 restore /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { _Thread_Enable_dispatch(); 20063fc: 40 00 0d 04 call 200980c <_Thread_Enable_dispatch> 2006400: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one( EAGAIN ); 2006404: 40 00 27 7c call 20101f4 <__errno> 2006408: 01 00 00 00 nop 200640c: 82 10 20 0b mov 0xb, %g1 ! b 2006410: c2 22 00 00 st %g1, [ %o0 ] 2006414: 81 c7 e0 08 ret 2006418: 81 e8 00 00 restore =============================================================================== 0200641c : timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue ) { 200641c: 9d e3 bf 80 save %sp, -128, %sp Objects_Locations location; bool activated; uint32_t initial_period; struct itimerspec normalize; if ( !value ) 2006420: 80 a6 a0 00 cmp %i2, 0 2006424: 02 80 00 88 be 2006644 <== NEVER TAKEN 2006428: 01 00 00 00 nop /* * First, it verifies if the structure "value" is correct * if the number of nanoseconds is not correct return EINVAL */ if ( !_Timespec_Is_valid( &(value->it_value) ) ) { 200642c: 40 00 10 1f call 200a4a8 <_Timespec_Is_valid> 2006430: 90 06 a0 08 add %i2, 8, %o0 2006434: 80 8a 20 ff btst 0xff, %o0 2006438: 02 80 00 83 be 2006644 200643c: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !_Timespec_Is_valid( &(value->it_interval) ) ) { 2006440: 40 00 10 1a call 200a4a8 <_Timespec_Is_valid> 2006444: 90 10 00 1a mov %i2, %o0 2006448: 80 8a 20 ff btst 0xff, %o0 200644c: 02 80 00 7e be 2006644 <== NEVER TAKEN 2006450: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( EINVAL ); } if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { 2006454: 12 80 00 7a bne 200663c 2006458: 80 a6 60 04 cmp %i1, 4 rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 200645c: c8 06 80 00 ld [ %i2 ], %g4 2006460: c6 06 a0 04 ld [ %i2 + 4 ], %g3 2006464: c4 06 a0 08 ld [ %i2 + 8 ], %g2 2006468: c2 06 a0 0c ld [ %i2 + 0xc ], %g1 200646c: c8 27 bf e4 st %g4, [ %fp + -28 ] 2006470: c6 27 bf e8 st %g3, [ %fp + -24 ] 2006474: c4 27 bf ec st %g2, [ %fp + -20 ] /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { 2006478: 80 a6 60 04 cmp %i1, 4 200647c: 02 80 00 3b be 2006568 2006480: c2 27 bf f0 st %g1, [ %fp + -16 ] RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get ( timer_t id, Objects_Locations *location ) { return (POSIX_Timer_Control *) 2006484: 92 10 00 18 mov %i0, %o1 2006488: 11 00 80 79 sethi %hi(0x201e400), %o0 200648c: 94 07 bf fc add %fp, -4, %o2 2006490: 40 00 09 43 call 200899c <_Objects_Get> 2006494: 90 12 22 c0 or %o0, 0x2c0, %o0 * something with the structure of times of the timer: to stop, start * or start it again */ ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { 2006498: c2 07 bf fc ld [ %fp + -4 ], %g1 200649c: 80 a0 60 00 cmp %g1, 0 20064a0: 12 80 00 46 bne 20065b8 <== NEVER TAKEN 20064a4: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: /* First, it verifies if the timer must be stopped */ if ( normalize.it_value.tv_sec == 0 && normalize.it_value.tv_nsec == 0 ) { 20064a8: c2 07 bf ec ld [ %fp + -20 ], %g1 20064ac: 80 a0 60 00 cmp %g1, 0 20064b0: 12 80 00 05 bne 20064c4 20064b4: c2 07 bf f0 ld [ %fp + -16 ], %g1 20064b8: 80 a0 60 00 cmp %g1, 0 20064bc: 02 80 00 45 be 20065d0 20064c0: 01 00 00 00 nop _Thread_Enable_dispatch(); return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); 20064c4: 40 00 10 1e call 200a53c <_Timespec_To_ticks> 20064c8: 90 10 00 1a mov %i2, %o0 20064cc: d0 27 60 64 st %o0, [ %i5 + 0x64 ] initial_period = _Timespec_To_ticks( &normalize.it_value ); 20064d0: 40 00 10 1b call 200a53c <_Timespec_To_ticks> 20064d4: 90 07 bf ec add %fp, -20, %o0 activated = _POSIX_Timer_Insert_helper( 20064d8: d4 07 60 08 ld [ %i5 + 8 ], %o2 return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); initial_period = _Timespec_To_ticks( &normalize.it_value ); 20064dc: 92 10 00 08 mov %o0, %o1 activated = _POSIX_Timer_Insert_helper( 20064e0: 98 10 00 1d mov %i5, %o4 20064e4: 90 07 60 10 add %i5, 0x10, %o0 20064e8: 17 00 80 19 sethi %hi(0x2006400), %o3 20064ec: 40 00 1b b8 call 200d3cc <_POSIX_Timer_Insert_helper> 20064f0: 96 12 e2 5c or %o3, 0x25c, %o3 ! 200665c <_POSIX_Timer_TSR> initial_period, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { 20064f4: 80 8a 20 ff btst 0xff, %o0 20064f8: 02 80 00 18 be 2006558 20064fc: 80 a6 e0 00 cmp %i3, 0 /* * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) 2006500: 02 80 00 0b be 200652c 2006504: c2 07 bf e4 ld [ %fp + -28 ], %g1 *ovalue = ptimer->timer_data; 2006508: c2 07 60 54 ld [ %i5 + 0x54 ], %g1 200650c: c2 26 c0 00 st %g1, [ %i3 ] 2006510: c2 07 60 58 ld [ %i5 + 0x58 ], %g1 2006514: c2 26 e0 04 st %g1, [ %i3 + 4 ] 2006518: c2 07 60 5c ld [ %i5 + 0x5c ], %g1 200651c: c2 26 e0 08 st %g1, [ %i3 + 8 ] 2006520: c2 07 60 60 ld [ %i5 + 0x60 ], %g1 2006524: c2 26 e0 0c st %g1, [ %i3 + 0xc ] ptimer->timer_data = normalize; 2006528: c2 07 bf e4 ld [ %fp + -28 ], %g1 /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; _TOD_Get( &ptimer->time ); 200652c: 90 07 60 6c add %i5, 0x6c, %o0 * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) *ovalue = ptimer->timer_data; ptimer->timer_data = normalize; 2006530: c2 27 60 54 st %g1, [ %i5 + 0x54 ] 2006534: c2 07 bf e8 ld [ %fp + -24 ], %g1 2006538: c2 27 60 58 st %g1, [ %i5 + 0x58 ] 200653c: c2 07 bf ec ld [ %fp + -20 ], %g1 2006540: c2 27 60 5c st %g1, [ %i5 + 0x5c ] 2006544: c2 07 bf f0 ld [ %fp + -16 ], %g1 2006548: c2 27 60 60 st %g1, [ %i5 + 0x60 ] /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 200654c: 82 10 20 03 mov 3, %g1 _TOD_Get( &ptimer->time ); 2006550: 40 00 06 3e call 2007e48 <_TOD_Get> 2006554: c2 2f 60 3c stb %g1, [ %i5 + 0x3c ] _Thread_Enable_dispatch(); 2006558: 40 00 0c ad call 200980c <_Thread_Enable_dispatch> 200655c: b0 10 20 00 clr %i0 return 0; 2006560: 81 c7 e0 08 ret 2006564: 81 e8 00 00 restore normalize = *value; /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { struct timespec now; _TOD_Get( &now ); 2006568: 40 00 06 38 call 2007e48 <_TOD_Get> 200656c: 90 07 bf f4 add %fp, -12, %o0 /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 2006570: 90 07 bf f4 add %fp, -12, %o0 2006574: 40 00 0f bb call 200a460 <_Timespec_Greater_than> 2006578: 92 07 bf ec add %fp, -20, %o1 200657c: 80 8a 20 ff btst 0xff, %o0 2006580: 12 80 00 31 bne 2006644 2006584: 92 07 bf ec add %fp, -20, %o1 rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value ); 2006588: 90 07 bf f4 add %fp, -12, %o0 200658c: 40 00 0f d8 call 200a4ec <_Timespec_Subtract> 2006590: 94 10 00 09 mov %o1, %o2 2006594: 92 10 00 18 mov %i0, %o1 2006598: 11 00 80 79 sethi %hi(0x201e400), %o0 200659c: 94 07 bf fc add %fp, -4, %o2 20065a0: 40 00 08 ff call 200899c <_Objects_Get> 20065a4: 90 12 22 c0 or %o0, 0x2c0, %o0 * something with the structure of times of the timer: to stop, start * or start it again */ ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { 20065a8: c2 07 bf fc ld [ %fp + -4 ], %g1 20065ac: 80 a0 60 00 cmp %g1, 0 20065b0: 02 bf ff be be 20064a8 20065b4: ba 10 00 08 mov %o0, %i5 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 20065b8: 40 00 27 0f call 20101f4 <__errno> 20065bc: b0 10 3f ff mov -1, %i0 20065c0: 82 10 20 16 mov 0x16, %g1 20065c4: c2 22 00 00 st %g1, [ %o0 ] } 20065c8: 81 c7 e0 08 ret 20065cc: 81 e8 00 00 restore case OBJECTS_LOCAL: /* First, it verifies if the timer must be stopped */ if ( normalize.it_value.tv_sec == 0 && normalize.it_value.tv_nsec == 0 ) { /* Stop the timer */ (void) _Watchdog_Remove( &ptimer->Timer ); 20065d0: 40 00 11 1d call 200aa44 <_Watchdog_Remove> 20065d4: 90 02 20 10 add %o0, 0x10, %o0 /* The old data of the timer are returned */ if ( ovalue ) 20065d8: 80 a6 e0 00 cmp %i3, 0 20065dc: 02 80 00 0b be 2006608 20065e0: c2 07 bf e4 ld [ %fp + -28 ], %g1 *ovalue = ptimer->timer_data; 20065e4: c2 07 60 54 ld [ %i5 + 0x54 ], %g1 20065e8: c2 26 c0 00 st %g1, [ %i3 ] 20065ec: c2 07 60 58 ld [ %i5 + 0x58 ], %g1 20065f0: c2 26 e0 04 st %g1, [ %i3 + 4 ] 20065f4: c2 07 60 5c ld [ %i5 + 0x5c ], %g1 20065f8: c2 26 e0 08 st %g1, [ %i3 + 8 ] 20065fc: c2 07 60 60 ld [ %i5 + 0x60 ], %g1 2006600: c2 26 e0 0c st %g1, [ %i3 + 0xc ] /* The new data are set */ ptimer->timer_data = normalize; 2006604: c2 07 bf e4 ld [ %fp + -28 ], %g1 /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; /* Returns with success */ _Thread_Enable_dispatch(); return 0; 2006608: b0 10 20 00 clr %i0 (void) _Watchdog_Remove( &ptimer->Timer ); /* The old data of the timer are returned */ if ( ovalue ) *ovalue = ptimer->timer_data; /* The new data are set */ ptimer->timer_data = normalize; 200660c: c2 27 60 54 st %g1, [ %i5 + 0x54 ] 2006610: c2 07 bf e8 ld [ %fp + -24 ], %g1 2006614: c2 27 60 58 st %g1, [ %i5 + 0x58 ] 2006618: c2 07 bf ec ld [ %fp + -20 ], %g1 200661c: c2 27 60 5c st %g1, [ %i5 + 0x5c ] 2006620: c2 07 bf f0 ld [ %fp + -16 ], %g1 2006624: c2 27 60 60 st %g1, [ %i5 + 0x60 ] /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 2006628: 82 10 20 04 mov 4, %g1 /* Returns with success */ _Thread_Enable_dispatch(); 200662c: 40 00 0c 78 call 200980c <_Thread_Enable_dispatch> 2006630: c2 2f 60 3c stb %g1, [ %i5 + 0x3c ] return 0; 2006634: 81 c7 e0 08 ret 2006638: 81 e8 00 00 restore } if ( !_Timespec_Is_valid( &(value->it_interval) ) ) { rtems_set_errno_and_return_minus_one( EINVAL ); } if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { 200663c: 22 bf ff 89 be,a 2006460 2006640: c8 06 80 00 ld [ %i2 ], %g4 if (flags == TIMER_ABSTIME) { struct timespec now; _TOD_Get( &now ); /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) rtems_set_errno_and_return_minus_one( EINVAL ); 2006644: 40 00 26 ec call 20101f4 <__errno> 2006648: b0 10 3f ff mov -1, %i0 200664c: 82 10 20 16 mov 0x16, %g1 2006650: c2 22 00 00 st %g1, [ %o0 ] 2006654: 81 c7 e0 08 ret 2006658: 81 e8 00 00 restore =============================================================================== 020062c8 : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 20062c8: 9d e3 bf 98 save %sp, -104, %sp /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 20062cc: 3b 00 80 65 sethi %hi(0x2019400), %i5 20062d0: ba 17 63 48 or %i5, 0x348, %i5 ! 2019748 <_POSIX_signals_Ualarm_timer> 20062d4: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 20062d8: 80 a0 60 00 cmp %g1, 0 20062dc: 02 80 00 24 be 200636c 20062e0: b8 10 00 18 mov %i0, %i4 _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 20062e4: 40 00 10 d0 call 200a624 <_Watchdog_Remove> 20062e8: 90 10 00 1d mov %i5, %o0 if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 20062ec: 90 02 3f fe add %o0, -2, %o0 20062f0: 80 a2 20 01 cmp %o0, 1 20062f4: 08 80 00 26 bleu 200638c <== ALWAYS TAKEN 20062f8: b0 10 20 00 clr %i0 /* * If useconds is non-zero, then the caller wants to schedule * the alarm repeatedly at that interval. If the interval is * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { 20062fc: 80 a7 20 00 cmp %i4, 0 2006300: 02 80 00 19 be 2006364 2006304: 37 00 03 d0 sethi %hi(0xf4000), %i3 Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 2006308: 90 10 00 1c mov %i4, %o0 200630c: 40 00 3a 20 call 2014b8c <.udiv> 2006310: 92 16 e2 40 or %i3, 0x240, %o1 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 2006314: 92 16 e2 40 or %i3, 0x240, %o1 * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 2006318: d0 27 bf f8 st %o0, [ %fp + -8 ] tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 200631c: 40 00 3a c8 call 2014e3c <.urem> 2006320: 90 10 00 1c mov %i4, %o0 2006324: 87 2a 20 07 sll %o0, 7, %g3 2006328: 82 10 00 08 mov %o0, %g1 200632c: 85 2a 20 02 sll %o0, 2, %g2 2006330: 84 20 c0 02 sub %g3, %g2, %g2 2006334: 82 00 80 01 add %g2, %g1, %g1 2006338: 83 28 60 03 sll %g1, 3, %g1 ticks = _Timespec_To_ticks( &tp ); 200633c: 90 07 bf f8 add %fp, -8, %o0 2006340: 40 00 0f 48 call 200a060 <_Timespec_To_ticks> 2006344: c2 27 bf fc st %g1, [ %fp + -4 ] if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 2006348: 40 00 0f 46 call 200a060 <_Timespec_To_ticks> 200634c: 90 07 bf f8 add %fp, -8, %o0 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 2006350: 92 10 00 1d mov %i5, %o1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 2006354: d0 27 60 0c st %o0, [ %i5 + 0xc ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 2006358: 11 00 80 63 sethi %hi(0x2018c00), %o0 200635c: 40 00 10 50 call 200a49c <_Watchdog_Insert> 2006360: 90 12 23 04 or %o0, 0x304, %o0 ! 2018f04 <_Watchdog_Ticks_chain> } return remaining; } 2006364: 81 c7 e0 08 ret 2006368: 81 e8 00 00 restore Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 200636c: 03 00 80 18 sethi %hi(0x2006000), %g1 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 2006370: c0 27 60 08 clr [ %i5 + 8 ] the_watchdog->routine = routine; 2006374: 82 10 62 9c or %g1, 0x29c, %g1 the_watchdog->id = id; 2006378: c0 27 60 20 clr [ %i5 + 0x20 ] Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 200637c: c2 27 60 1c st %g1, [ %i5 + 0x1c ] the_watchdog->id = id; the_watchdog->user_data = user_data; 2006380: c0 27 60 24 clr [ %i5 + 0x24 ] useconds_t ualarm( useconds_t useconds, useconds_t interval ) { useconds_t remaining = 0; 2006384: 10 bf ff de b 20062fc 2006388: b0 10 20 00 clr %i0 * boot. Since alarm() is dealing in seconds, we must account for * this. */ ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); 200638c: c4 07 60 0c ld [ %i5 + 0xc ], %g2 2006390: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 2006394: d0 07 60 14 ld [ %i5 + 0x14 ], %o0 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 2006398: 92 07 bf f8 add %fp, -8, %o1 * boot. Since alarm() is dealing in seconds, we must account for * this. */ ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); 200639c: 90 02 00 02 add %o0, %g2, %o0 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 20063a0: 40 00 0f 07 call 2009fbc <_Timespec_From_ticks> 20063a4: 90 22 00 01 sub %o0, %g1, %o0 remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 20063a8: c2 07 bf f8 ld [ %fp + -8 ], %g1 remaining += tp.tv_nsec / 1000; 20063ac: d0 07 bf fc ld [ %fp + -4 ], %o0 ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 20063b0: 85 28 60 03 sll %g1, 3, %g2 20063b4: 87 28 60 08 sll %g1, 8, %g3 20063b8: 84 20 c0 02 sub %g3, %g2, %g2 remaining += tp.tv_nsec / 1000; 20063bc: 92 10 23 e8 mov 0x3e8, %o1 ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 20063c0: b1 28 a0 06 sll %g2, 6, %i0 20063c4: b0 26 00 02 sub %i0, %g2, %i0 remaining += tp.tv_nsec / 1000; 20063c8: 40 00 39 f3 call 2014b94 <.div> 20063cc: b0 06 00 01 add %i0, %g1, %i0 ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 20063d0: b1 2e 20 06 sll %i0, 6, %i0 remaining += tp.tv_nsec / 1000; 20063d4: 10 bf ff ca b 20062fc 20063d8: b0 02 00 18 add %o0, %i0, %i0 =============================================================================== 02006964 : #include int unlink( const char *path ) { 2006964: 9d e3 bf 70 save %sp, -144, %sp /* * Get the node to be unlinked. Find the parent path first. */ parentpathlen = rtems_filesystem_dirname ( path ); 2006968: 90 10 00 18 mov %i0, %o0 200696c: 7f ff f3 f2 call 2003934 2006970: ba 10 00 18 mov %i0, %i5 if ( parentpathlen == 0 ) 2006974: 80 a2 20 00 cmp %o0, 0 2006978: 12 80 00 29 bne 2006a1c 200697c: b6 10 00 08 mov %o0, %i3 rtems_filesystem_get_start_loc( path, &i, &parentloc ); 2006980: b8 07 bf d4 add %fp, -44, %i4 2006984: 90 10 00 18 mov %i0, %o0 2006988: 92 07 bf fc add %fp, -4, %o1 200698c: 94 10 00 1c mov %i4, %o2 2006990: 7f ff f8 2d call 2004a44 2006994: b6 10 20 00 clr %i3 const char *name; rtems_filesystem_location_info_t parentloc; rtems_filesystem_location_info_t loc; int i; int result; bool free_parentloc = false; 2006998: b4 10 20 00 clr %i2 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 200699c: c2 07 bf d4 ld [ %fp + -44 ], %g1 name = path + parentpathlen; 20069a0: ba 07 40 1b add %i5, %i3, %i5 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 20069a4: c2 27 bf e8 st %g1, [ %fp + -24 ] 20069a8: c2 07 bf d8 ld [ %fp + -40 ], %g1 name = path + parentpathlen; name += rtems_filesystem_prefix_separators( name, strlen( name ) ); 20069ac: 90 10 00 1d mov %i5, %o0 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 20069b0: c2 27 bf ec st %g1, [ %fp + -20 ] 20069b4: c2 07 bf dc ld [ %fp + -36 ], %g1 20069b8: c2 27 bf f0 st %g1, [ %fp + -16 ] 20069bc: c2 07 bf e0 ld [ %fp + -32 ], %g1 20069c0: c2 27 bf f4 st %g1, [ %fp + -12 ] 20069c4: c2 07 bf e4 ld [ %fp + -28 ], %g1 name = path + parentpathlen; name += rtems_filesystem_prefix_separators( name, strlen( name ) ); 20069c8: 40 00 36 c2 call 20144d0 20069cc: c2 27 bf f8 st %g1, [ %fp + -8 ] 20069d0: 92 10 00 08 mov %o0, %o1 20069d4: 7f ff f3 e7 call 2003970 20069d8: 90 10 00 1d mov %i5, %o0 20069dc: ba 07 40 08 add %i5, %o0, %i5 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 20069e0: 40 00 36 bc call 20144d0 20069e4: 90 10 00 1d mov %i5, %o0 20069e8: 94 10 20 00 clr %o2 20069ec: 92 10 00 08 mov %o0, %o1 20069f0: 96 07 bf e8 add %fp, -24, %o3 20069f4: 90 10 00 1d mov %i5, %o0 20069f8: 7f ff f3 a3 call 2003884 20069fc: 98 10 20 00 clr %o4 0, &loc, false ); if ( result != 0 ) { 2006a00: 80 a2 20 00 cmp %o0, 0 2006a04: 02 80 00 17 be 2006a60 2006a08: 80 8e a0 ff btst 0xff, %i2 if ( free_parentloc ) 2006a0c: 12 80 00 11 bne 2006a50 <== ALWAYS TAKEN 2006a10: b0 10 3f ff mov -1, %i0 rtems_filesystem_freenode( &loc ); if ( free_parentloc ) rtems_filesystem_freenode( &parentloc ); return result; } 2006a14: 81 c7 e0 08 ret <== NOT EXECUTED 2006a18: 81 e8 00 00 restore <== NOT EXECUTED parentpathlen = rtems_filesystem_dirname ( path ); if ( parentpathlen == 0 ) rtems_filesystem_get_start_loc( path, &i, &parentloc ); else { result = rtems_filesystem_evaluate_path( path, parentpathlen, 2006a1c: b8 07 bf d4 add %fp, -44, %i4 2006a20: 90 10 00 18 mov %i0, %o0 2006a24: 92 10 00 1b mov %i3, %o1 2006a28: 94 10 20 02 mov 2, %o2 2006a2c: 96 10 00 1c mov %i4, %o3 2006a30: 98 10 20 00 clr %o4 2006a34: 7f ff f3 b1 call 20038f8 2006a38: b0 10 3f ff mov -1, %i0 RTEMS_LIBIO_PERMS_WRITE, &parentloc, false ); if ( result != 0 ) 2006a3c: 80 a2 20 00 cmp %o0, 0 2006a40: 12 bf ff f5 bne 2006a14 <== NEVER TAKEN 2006a44: b4 10 20 01 mov 1, %i2 /* * Start from the parent to find the node that should be under it. */ loc = parentloc; 2006a48: 10 bf ff d6 b 20069a0 2006a4c: c2 07 bf d4 ld [ %fp + -44 ], %g1 result = rtems_filesystem_evaluate_relative_path( name , strlen( name ), 0, &loc, false ); if ( result != 0 ) { if ( free_parentloc ) rtems_filesystem_freenode( &parentloc ); 2006a50: 7f ff f3 e4 call 20039e0 2006a54: 90 10 00 1c mov %i4, %o0 2006a58: 81 c7 e0 08 ret 2006a5c: 81 e8 00 00 restore return -1; } if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) { 2006a60: c2 07 bf f4 ld [ %fp + -12 ], %g1 2006a64: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 2006a68: 9f c0 40 00 call %g1 2006a6c: 90 07 bf e8 add %fp, -24, %o0 2006a70: 80 a2 20 01 cmp %o0, 1 2006a74: 02 80 00 10 be 2006ab4 2006a78: c2 07 bf f4 ld [ %fp + -12 ], %g1 if ( free_parentloc ) rtems_filesystem_freenode( &parentloc ); rtems_set_errno_and_return_minus_one( EISDIR ); } result = (*loc.ops->unlink_h)( &parentloc, &loc ); 2006a7c: 92 07 bf e8 add %fp, -24, %o1 2006a80: c2 00 60 0c ld [ %g1 + 0xc ], %g1 2006a84: 9f c0 40 00 call %g1 2006a88: 90 10 00 1c mov %i4, %o0 2006a8c: b0 10 00 08 mov %o0, %i0 rtems_filesystem_freenode( &loc ); 2006a90: 7f ff f3 d4 call 20039e0 2006a94: 90 07 bf e8 add %fp, -24, %o0 if ( free_parentloc ) 2006a98: 80 8e a0 ff btst 0xff, %i2 2006a9c: 02 80 00 11 be 2006ae0 2006aa0: 01 00 00 00 nop rtems_filesystem_freenode( &parentloc ); 2006aa4: 7f ff f3 cf call 20039e0 2006aa8: 90 10 00 1c mov %i4, %o0 return result; } 2006aac: 81 c7 e0 08 ret 2006ab0: 81 e8 00 00 restore rtems_filesystem_freenode( &parentloc ); return -1; } if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) { rtems_filesystem_freenode( &loc ); 2006ab4: 7f ff f3 cb call 20039e0 2006ab8: 90 07 bf e8 add %fp, -24, %o0 if ( free_parentloc ) 2006abc: 80 8e a0 ff btst 0xff, %i2 2006ac0: 02 80 00 04 be 2006ad0 2006ac4: 01 00 00 00 nop rtems_filesystem_freenode( &parentloc ); 2006ac8: 7f ff f3 c6 call 20039e0 2006acc: 90 10 00 1c mov %i4, %o0 rtems_set_errno_and_return_minus_one( EISDIR ); 2006ad0: 40 00 33 09 call 20136f4 <__errno> 2006ad4: b0 10 3f ff mov -1, %i0 2006ad8: 82 10 20 15 mov 0x15, %g1 2006adc: c2 22 00 00 st %g1, [ %o0 ] 2006ae0: 81 c7 e0 08 ret 2006ae4: 81 e8 00 00 restore =============================================================================== 02005de0 : */ int unmount( const char *path ) { 2005de0: 9d e3 bf 88 save %sp, -120, %sp * 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 ) ) 2005de4: 40 00 29 34 call 20102b4 2005de8: 90 10 00 18 mov %i0, %o0 2005dec: 94 10 20 00 clr %o2 2005df0: 92 10 00 08 mov %o0, %o1 2005df4: 96 07 bf ec add %fp, -20, %o3 2005df8: 90 10 00 18 mov %i0, %o0 2005dfc: 7f ff f3 55 call 2002b50 2005e00: 98 10 20 01 mov 1, %o4 2005e04: 80 a2 20 00 cmp %o0, 0 2005e08: 12 80 00 53 bne 2005f54 2005e0c: fa 07 bf fc ld [ %fp + -4 ], %i5 /* * Verify this is the root node for the file system to be unmounted. */ if ( fs_root_loc->node_access != loc.node_access ){ 2005e10: c2 07 bf ec ld [ %fp + -20 ], %g1 2005e14: c4 07 60 1c ld [ %i5 + 0x1c ], %g2 2005e18: 80 a0 80 01 cmp %g2, %g1 2005e1c: 12 80 00 3c bne 2005f0c 2005e20: 90 07 bf ec add %fp, -20, %o0 /* * Free the loc node and just use the nodes from the mt_entry . */ rtems_filesystem_freenode( &loc ); 2005e24: 7f ff f3 85 call 2002c38 2005e28: 01 00 00 00 nop * 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 ) 2005e2c: 03 00 80 58 sethi %hi(0x2016000), %g1 2005e30: c2 00 61 cc ld [ %g1 + 0x1cc ], %g1 ! 20161cc 2005e34: c2 00 60 14 ld [ %g1 + 0x14 ], %g1 2005e38: 80 a0 40 1d cmp %g1, %i5 2005e3c: 02 80 00 40 be 2005f3c 2005e40: 11 00 80 17 sethi %hi(0x2005c00), %o0 /* * Verify there are no file systems below the path specified */ if ( rtems_filesystem_mount_iterate( is_fs_below_mount_point, 2005e44: d2 07 60 2c ld [ %i5 + 0x2c ], %o1 2005e48: 7f ff f5 9a call 20034b0 2005e4c: 90 12 21 cc or %o0, 0x1cc, %o0 2005e50: 80 8a 20 ff btst 0xff, %o0 2005e54: 12 80 00 3a bne 2005f3c 2005e58: 01 00 00 00 nop * 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 ) 2005e5c: 7f ff f4 62 call 2002fe4 2005e60: 90 10 00 1d mov %i5, %o0 2005e64: 80 a2 20 01 cmp %o0, 1 2005e68: 02 80 00 35 be 2005f3c 2005e6c: 01 00 00 00 nop * 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 ) 2005e70: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 2005e74: c2 00 60 28 ld [ %g1 + 0x28 ], %g1 2005e78: 9f c0 40 00 call %g1 2005e7c: 90 10 00 1d mov %i5, %o0 2005e80: 80 a2 20 00 cmp %o0, 0 2005e84: 12 80 00 2a bne 2005f2c <== NEVER TAKEN 2005e88: 01 00 00 00 nop * 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){ 2005e8c: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 2005e90: c2 00 60 2c ld [ %g1 + 0x2c ], %g1 2005e94: 9f c0 40 00 call %g1 2005e98: 90 10 00 1d mov %i5, %o0 2005e9c: 80 a2 20 00 cmp %o0, 0 2005ea0: 02 80 00 0c be 2005ed0 <== ALWAYS TAKEN 2005ea4: 39 00 80 5a sethi %hi(0x2016800), %i4 if (( fs_mount_loc->ops->mount_h )( mt_entry ) != 0 ) 2005ea8: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 <== NOT EXECUTED 2005eac: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 2005eb0: c2 00 60 20 ld [ %g1 + 0x20 ], %g1 <== NOT EXECUTED 2005eb4: 9f c0 40 00 call %g1 <== NOT EXECUTED 2005eb8: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 2005ebc: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 2005ec0: 12 80 00 1d bne 2005f34 <== NOT EXECUTED 2005ec4: 01 00 00 00 nop <== NOT EXECUTED rtems_filesystem_freenode( fs_mount_loc ); free( mt_entry ); return 0; } 2005ec8: 81 c7 e0 08 ret <== NOT EXECUTED 2005ecc: 81 e8 00 00 restore <== 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 ); 2005ed0: d0 07 23 34 ld [ %i4 + 0x334 ], %o0 2005ed4: 92 10 20 00 clr %o1 2005ed8: 40 00 03 1f call 2006b54 2005edc: 94 10 20 00 clr %o2 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 2005ee0: 40 00 05 a9 call 2007584 <_Chain_Extract> 2005ee4: 90 10 00 1d mov %i5, %o0 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 2005ee8: d0 07 23 34 ld [ %i4 + 0x334 ], %o0 2005eec: 40 00 03 64 call 2006c7c 2005ef0: b0 10 20 00 clr %i0 /* * 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 ); 2005ef4: 7f ff f3 51 call 2002c38 2005ef8: 90 07 60 08 add %i5, 8, %o0 free( mt_entry ); 2005efc: 7f ff f3 56 call 2002c54 2005f00: 90 10 00 1d mov %i5, %o0 return 0; 2005f04: 81 c7 e0 08 ret 2005f08: 81 e8 00 00 restore /* * Verify this is the root node for the file system to be unmounted. */ if ( fs_root_loc->node_access != loc.node_access ){ rtems_filesystem_freenode( &loc ); 2005f0c: 7f ff f3 4b call 2002c38 2005f10: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one( EACCES ); 2005f14: 40 00 25 71 call 200f4d8 <__errno> 2005f18: 01 00 00 00 nop 2005f1c: 82 10 20 0d mov 0xd, %g1 ! d 2005f20: c2 22 00 00 st %g1, [ %o0 ] 2005f24: 81 c7 e0 08 ret 2005f28: 81 e8 00 00 restore rtems_filesystem_freenode( fs_mount_loc ); free( mt_entry ); return 0; } 2005f2c: 81 c7 e0 08 ret <== NOT EXECUTED 2005f30: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED * come up with. */ if ((fs_root_loc->ops->fsunmount_me_h )( mt_entry ) != 0){ if (( fs_mount_loc->ops->mount_h )( mt_entry ) != 0 ) rtems_fatal_error_occurred( 0 ); 2005f34: 40 00 04 9e call 20071ac <== NOT EXECUTED 2005f38: 90 10 20 00 clr %o0 <== NOT EXECUTED * descriptors that are currently active and reference nodes in the * file system that we are trying to unmount */ if ( rtems_libio_is_open_files_in_fs( mt_entry ) == 1 ) rtems_set_errno_and_return_minus_one( EBUSY ); 2005f3c: 40 00 25 67 call 200f4d8 <__errno> 2005f40: b0 10 3f ff mov -1, %i0 2005f44: 82 10 20 10 mov 0x10, %g1 2005f48: c2 22 00 00 st %g1, [ %o0 ] 2005f4c: 81 c7 e0 08 ret 2005f50: 81 e8 00 00 restore * 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; 2005f54: 81 c7 e0 08 ret 2005f58: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 02005d44 : */ void vprintk( const char *fmt, va_list ap ) { 2005d44: 9d e3 bf 88 save %sp, -120, %sp for (; *fmt != '\0'; fmt++) { 2005d48: c2 0e 00 00 ldub [ %i0 ], %g1 2005d4c: 83 28 60 18 sll %g1, 0x18, %g1 2005d50: 80 a0 60 00 cmp %g1, 0 2005d54: 02 80 00 83 be 2005f60 <== NEVER TAKEN 2005d58: 29 00 80 73 sethi %hi(0x201cc00), %l4 * console is not yet initialized or in ISR's. * * Arguments: * as in printf: fmt - format string, ... - unnamed arguments. */ void vprintk( 2005d5c: a2 07 bf e8 add %fp, -24, %l1 2005d60: a6 07 bf e7 add %fp, -25, %l3 2005d64: 2d 00 80 6e sethi %hi(0x201b800), %l6 char *s, *str; str = va_arg(ap, char *); if ( str == NULL ) { str = ""; 2005d68: 2f 00 80 6c sethi %hi(0x201b000), %l7 bool minus = false; bool sign = false; char lead = ' '; char c; if (*fmt != '%') { 2005d6c: 91 38 60 18 sra %g1, 0x18, %o0 2005d70: 80 a2 20 25 cmp %o0, 0x25 2005d74: 12 80 00 93 bne 2005fc0 2005d78: c2 05 21 cc ld [ %l4 + 0x1cc ], %g1 BSP_output_char(*fmt); continue; } fmt++; if (*fmt == '0' ) { 2005d7c: c2 0e 20 01 ldub [ %i0 + 1 ], %g1 2005d80: 87 28 60 18 sll %g1, 0x18, %g3 2005d84: 85 38 e0 18 sra %g3, 0x18, %g2 2005d88: 80 a0 a0 30 cmp %g2, 0x30 2005d8c: 22 80 00 9c be,a 2005ffc 2005d90: c2 0e 20 02 ldub [ %i0 + 2 ], %g1 if (*fmt != '%') { BSP_output_char(*fmt); continue; } fmt++; 2005d94: 84 06 20 01 add %i0, 1, %g2 unsigned base = 0; unsigned width = 0; bool lflag = false; bool minus = false; bool sign = false; char lead = ' '; 2005d98: aa 10 20 20 mov 0x20, %l5 fmt++; if (*fmt == '0' ) { lead = '0'; fmt++; } if (*fmt == '-' ) { 2005d9c: 89 38 e0 18 sra %g3, 0x18, %g4 2005da0: 80 a1 20 2d cmp %g4, 0x2d 2005da4: 02 80 00 91 be 2005fe8 2005da8: a4 10 20 00 clr %l2 minus = true; fmt++; } while (*fmt >= '0' && *fmt <= '9' ) { 2005dac: 82 00 7f d0 add %g1, -48, %g1 2005db0: b0 10 00 02 mov %g2, %i0 2005db4: 82 08 60 ff and %g1, 0xff, %g1 2005db8: 80 a0 60 09 cmp %g1, 9 2005dbc: 08 80 00 06 bleu 2005dd4 2005dc0: ba 10 20 00 clr %i5 width *= 10; width += ((unsigned) *fmt - '0'); fmt++; } if ((c = *fmt) == 'l') { 2005dc4: 10 80 00 12 b 2005e0c 2005dc8: 83 38 e0 18 sra %g3, 0x18, %g1 } if (*fmt == '-' ) { minus = true; fmt++; } while (*fmt >= '0' && *fmt <= '9' ) { 2005dcc: 84 10 00 18 mov %i0, %g2 2005dd0: 87 28 60 18 sll %g1, 0x18, %g3 2005dd4: c2 08 a0 01 ldub [ %g2 + 1 ], %g1 width *= 10; 2005dd8: 89 2f 60 01 sll %i5, 1, %g4 width += ((unsigned) *fmt - '0'); 2005ddc: 87 38 e0 18 sra %g3, 0x18, %g3 if (*fmt == '-' ) { minus = true; fmt++; } while (*fmt >= '0' && *fmt <= '9' ) { width *= 10; 2005de0: bb 2f 60 03 sll %i5, 3, %i5 width += ((unsigned) *fmt - '0'); fmt++; 2005de4: b0 00 a0 01 add %g2, 1, %i0 if (*fmt == '-' ) { minus = true; fmt++; } while (*fmt >= '0' && *fmt <= '9' ) { width *= 10; 2005de8: ba 01 00 1d add %g4, %i5, %i5 } if (*fmt == '-' ) { minus = true; fmt++; } while (*fmt >= '0' && *fmt <= '9' ) { 2005dec: 84 00 7f d0 add %g1, -48, %g2 width *= 10; width += ((unsigned) *fmt - '0'); 2005df0: ba 07 40 03 add %i5, %g3, %i5 } if (*fmt == '-' ) { minus = true; fmt++; } while (*fmt >= '0' && *fmt <= '9' ) { 2005df4: 84 08 a0 ff and %g2, 0xff, %g2 2005df8: 80 a0 a0 09 cmp %g2, 9 2005dfc: 08 bf ff f4 bleu 2005dcc 2005e00: ba 07 7f d0 add %i5, -48, %i5 2005e04: 87 28 60 18 sll %g1, 0x18, %g3 width *= 10; width += ((unsigned) *fmt - '0'); fmt++; } if ((c = *fmt) == 'l') { 2005e08: 83 38 e0 18 sra %g3, 0x18, %g1 2005e0c: 80 a0 60 6c cmp %g1, 0x6c 2005e10: 02 80 00 7f be 200600c 2005e14: 83 38 e0 18 sra %g3, 0x18, %g1 lflag = true; c = *++fmt; } if ( c == 'c' ) { 2005e18: 80 a0 60 63 cmp %g1, 0x63 2005e1c: 22 80 00 83 be,a 2006028 2005e20: d0 06 40 00 ld [ %i1 ], %o0 /* need a cast here since va_arg() only takes fully promoted types */ char chr = (char) va_arg(ap, int); BSP_output_char(chr); continue; } if ( c == 's' ) { 2005e24: 80 a0 60 73 cmp %g1, 0x73 2005e28: 02 80 00 8b be 2006054 2005e2c: 80 a0 60 4f cmp %g1, 0x4f continue; } /* must be a numeric format or something unsupported */ if ( c == 'o' || c == 'O' ) { 2005e30: 22 80 00 6c be,a 2005fe0 2005e34: 82 10 20 00 clr %g1 2005e38: 80 a0 60 6f cmp %g1, 0x6f 2005e3c: 22 80 00 69 be,a 2005fe0 2005e40: 82 10 20 00 clr %g1 base = 8; sign = false; } else if ( c == 'i' || c == 'I' || 2005e44: 80 a0 60 49 cmp %g1, 0x49 2005e48: 22 80 00 06 be,a 2005e60 2005e4c: 82 10 20 01 mov 1, %g1 2005e50: 80 a0 60 69 cmp %g1, 0x69 2005e54: 12 80 00 45 bne 2005f68 2005e58: 80 a0 60 44 cmp %g1, 0x44 c == 'd' || c == 'D' ) { base = 10; sign = true; 2005e5c: 82 10 20 01 mov 1, %g1 2005e60: a0 10 20 0a mov 0xa, %l0 } else { BSP_output_char(c); continue; } printNum( 2005e64: f4 06 40 00 ld [ %i1 ], %i2 unsigned long unsigned_num; unsigned long n; unsigned count; char toPrint[20]; if ( sign && (num < 0) ) { 2005e68: 80 88 60 ff btst 0xff, %g1 2005e6c: 02 80 00 05 be 2005e80 2005e70: b2 06 60 04 add %i1, 4, %i1 2005e74: 80 a6 a0 00 cmp %i2, 0 2005e78: 06 80 00 bf bl 2006174 2005e7c: c2 05 21 cc ld [ %l4 + 0x1cc ], %g1 } else { unsigned_num = (unsigned long) num; } count = 0; while ((n = unsigned_num / base) > 0) { 2005e80: 90 10 00 1a mov %i2, %o0 2005e84: 92 10 00 10 mov %l0, %o1 2005e88: 40 00 4a 45 call 201879c <.udiv> 2005e8c: a4 10 00 10 mov %l0, %l2 2005e90: b8 92 20 00 orcc %o0, 0, %i4 2005e94: 12 80 00 06 bne 2005eac 2005e98: b6 10 20 00 clr %i3 2005e9c: 10 80 00 c4 b 20061ac 2005ea0: b8 10 00 1a mov %i2, %i4 2005ea4: b4 10 00 1c mov %i4, %i2 2005ea8: b8 10 00 08 mov %o0, %i4 toPrint[count++] = (char) (unsigned_num - (n * base)); 2005eac: 92 10 00 1c mov %i4, %o1 2005eb0: 40 00 4a 01 call 20186b4 <.umul> 2005eb4: 90 10 00 12 mov %l2, %o0 } else { unsigned_num = (unsigned long) num; } count = 0; while ((n = unsigned_num / base) > 0) { 2005eb8: 92 10 00 10 mov %l0, %o1 toPrint[count++] = (char) (unsigned_num - (n * base)); 2005ebc: b4 26 80 08 sub %i2, %o0, %i2 } else { unsigned_num = (unsigned long) num; } count = 0; while ((n = unsigned_num / base) > 0) { 2005ec0: 90 10 00 1c mov %i4, %o0 2005ec4: 40 00 4a 36 call 201879c <.udiv> 2005ec8: f4 2c 40 1b stb %i2, [ %l1 + %i3 ] 2005ecc: 80 a2 20 00 cmp %o0, 0 2005ed0: 12 bf ff f5 bne 2005ea4 2005ed4: b6 06 e0 01 inc %i3 2005ed8: b4 06 e0 01 add %i3, 1, %i2 toPrint[count++] = (char) (unsigned_num - (n * base)); unsigned_num = n; } toPrint[count++] = (char) unsigned_num; 2005edc: b6 07 80 1b add %fp, %i3, %i3 for (n=maxwidth ; n > count; n-- ) 2005ee0: 80 a7 40 1a cmp %i5, %i2 2005ee4: 08 80 00 0b bleu 2005f10 2005ee8: f8 2e ff e8 stb %i4, [ %i3 + -24 ] 2005eec: b8 15 21 cc or %l4, 0x1cc, %i4 BSP_output_char(lead); 2005ef0: aa 0d 60 30 and %l5, 0x30, %l5 2005ef4: c2 07 00 00 ld [ %i4 ], %g1 2005ef8: 9f c0 40 00 call %g1 2005efc: 90 10 00 15 mov %l5, %o0 toPrint[count++] = (char) (unsigned_num - (n * base)); unsigned_num = n; } toPrint[count++] = (char) unsigned_num; for (n=maxwidth ; n > count; n-- ) 2005f00: ba 07 7f ff add %i5, -1, %i5 2005f04: 80 a7 40 1a cmp %i5, %i2 2005f08: 38 bf ff fc bgu,a 2005ef8 2005f0c: c2 07 00 00 ld [ %i4 ], %g1 BSP_output_char(lead); for (n = 0; n < count; n++) { 2005f10: 80 a6 a0 00 cmp %i2, 0 2005f14: 22 80 00 0f be,a 2005f50 <== NEVER TAKEN 2005f18: c2 0e 20 01 ldub [ %i0 + 1 ], %g1 <== NOT EXECUTED BSP_output_char("0123456789ABCDEF"[(int)(toPrint[count-(n+1)])]); 2005f1c: ba 06 bf ff add %i2, -1, %i5 2005f20: b8 15 21 cc or %l4, 0x1cc, %i4 * console is not yet initialized or in ISR's. * * Arguments: * as in printf: fmt - format string, ... - unnamed arguments. */ void vprintk( 2005f24: ba 04 40 1d add %l1, %i5, %i5 2005f28: b6 15 a0 38 or %l6, 0x38, %i3 for (n=maxwidth ; n > count; n-- ) BSP_output_char(lead); for (n = 0; n < count; n++) { BSP_output_char("0123456789ABCDEF"[(int)(toPrint[count-(n+1)])]); 2005f2c: c4 4f 40 00 ldsb [ %i5 ], %g2 2005f30: c2 07 00 00 ld [ %i4 ], %g1 2005f34: d0 4e c0 02 ldsb [ %i3 + %g2 ], %o0 2005f38: 9f c0 40 00 call %g1 2005f3c: ba 07 7f ff add %i5, -1, %i5 toPrint[count++] = (char) unsigned_num; for (n=maxwidth ; n > count; n-- ) BSP_output_char(lead); for (n = 0; n < count; n++) { 2005f40: 80 a7 40 13 cmp %i5, %l3 2005f44: 32 bf ff fb bne,a 2005f30 2005f48: c4 4f 40 00 ldsb [ %i5 ], %g2 void vprintk( const char *fmt, va_list ap ) { for (; *fmt != '\0'; fmt++) { 2005f4c: c2 0e 20 01 ldub [ %i0 + 1 ], %g1 2005f50: 83 28 60 18 sll %g1, 0x18, %g1 2005f54: 80 a0 60 00 cmp %g1, 0 2005f58: 12 bf ff 85 bne 2005d6c 2005f5c: b0 06 20 01 inc %i0 2005f60: 81 c7 e0 08 ret 2005f64: 81 e8 00 00 restore /* must be a numeric format or something unsupported */ if ( c == 'o' || c == 'O' ) { base = 8; sign = false; } else if ( c == 'i' || c == 'I' || c == 'd' || c == 'D' ) { 2005f68: 22 bf ff be be,a 2005e60 2005f6c: 82 10 20 01 mov 1, %g1 2005f70: 80 a0 60 64 cmp %g1, 0x64 2005f74: 22 bf ff bb be,a 2005e60 2005f78: 82 10 20 01 mov 1, %g1 base = 10; sign = true; } else if ( c == 'u' || c == 'U' ) { 2005f7c: 80 a0 60 55 cmp %g1, 0x55 2005f80: 22 80 00 8d be,a 20061b4 2005f84: 82 10 20 00 clr %g1 2005f88: 80 a0 60 75 cmp %g1, 0x75 2005f8c: 02 80 00 8a be 20061b4 2005f90: 82 10 20 00 clr %g1 base = 10; sign = false; } else if ( c == 'x' || c == 'X' ) { 2005f94: 91 38 e0 18 sra %g3, 0x18, %o0 2005f98: 80 a2 20 58 cmp %o0, 0x58 2005f9c: 02 80 00 88 be 20061bc 2005fa0: 01 00 00 00 nop 2005fa4: 80 a2 20 78 cmp %o0, 0x78 2005fa8: 02 bf ff af be 2005e64 2005fac: a0 10 20 10 mov 0x10, %l0 base = 16; sign = false; } else if ( c == 'p' ) { 2005fb0: 80 a2 20 70 cmp %o0, 0x70 2005fb4: 02 bf ff ac be 2005e64 2005fb8: 01 00 00 00 nop base = 16; sign = false; lflag = true; } else { BSP_output_char(c); 2005fbc: c2 05 21 cc ld [ %l4 + 0x1cc ], %g1 2005fc0: 9f c0 40 00 call %g1 2005fc4: 01 00 00 00 nop void vprintk( const char *fmt, va_list ap ) { for (; *fmt != '\0'; fmt++) { 2005fc8: c2 0e 20 01 ldub [ %i0 + 1 ], %g1 2005fcc: 83 28 60 18 sll %g1, 0x18, %g1 2005fd0: 80 a0 60 00 cmp %g1, 0 2005fd4: 12 bf ff 66 bne 2005d6c 2005fd8: b0 06 20 01 inc %i0 2005fdc: 30 80 00 64 b,a 200616c continue; } /* must be a numeric format or something unsupported */ if ( c == 'o' || c == 'O' ) { base = 8; sign = false; 2005fe0: 10 bf ff a1 b 2005e64 2005fe4: a0 10 20 08 mov 8, %l0 lead = '0'; fmt++; } if (*fmt == '-' ) { minus = true; fmt++; 2005fe8: c2 08 a0 01 ldub [ %g2 + 1 ], %g1 if (*fmt == '0' ) { lead = '0'; fmt++; } if (*fmt == '-' ) { minus = true; 2005fec: a4 10 20 01 mov 1, %l2 fmt++; 2005ff0: 84 00 a0 01 inc %g2 2005ff4: 10 bf ff 6e b 2005dac 2005ff8: 87 28 60 18 sll %g1, 0x18, %g3 continue; } fmt++; if (*fmt == '0' ) { lead = '0'; fmt++; 2005ffc: 84 06 20 02 add %i0, 2, %g2 BSP_output_char(*fmt); continue; } fmt++; if (*fmt == '0' ) { lead = '0'; 2006000: aa 10 20 30 mov 0x30, %l5 2006004: 10 bf ff 66 b 2005d9c 2006008: 87 28 60 18 sll %g1, 0x18, %g3 fmt++; } if ((c = *fmt) == 'l') { lflag = true; c = *++fmt; 200600c: c2 0e 20 01 ldub [ %i0 + 1 ], %g1 2006010: 87 28 60 18 sll %g1, 0x18, %g3 } if ( c == 'c' ) { 2006014: 83 38 e0 18 sra %g3, 0x18, %g1 2006018: 80 a0 60 63 cmp %g1, 0x63 200601c: 12 bf ff 82 bne 2005e24 <== ALWAYS TAKEN 2006020: b0 06 20 01 inc %i0 /* need a cast here since va_arg() only takes fully promoted types */ char chr = (char) va_arg(ap, int); 2006024: d0 06 40 00 ld [ %i1 ], %o0 <== NOT EXECUTED BSP_output_char(chr); 2006028: c2 05 21 cc ld [ %l4 + 0x1cc ], %g1 200602c: 91 2a 20 18 sll %o0, 0x18, %o0 2006030: 9f c0 40 00 call %g1 2006034: 91 3a 20 18 sra %o0, 0x18, %o0 void vprintk( const char *fmt, va_list ap ) { for (; *fmt != '\0'; fmt++) { 2006038: c2 0e 20 01 ldub [ %i0 + 1 ], %g1 lflag = true; c = *++fmt; } if ( c == 'c' ) { /* need a cast here since va_arg() only takes fully promoted types */ char chr = (char) va_arg(ap, int); 200603c: b2 06 60 04 add %i1, 4, %i1 void vprintk( const char *fmt, va_list ap ) { for (; *fmt != '\0'; fmt++) { 2006040: 83 28 60 18 sll %g1, 0x18, %g1 2006044: 80 a0 60 00 cmp %g1, 0 2006048: 12 bf ff 49 bne 2005d6c <== ALWAYS TAKEN 200604c: b0 06 20 01 inc %i0 2006050: 30 80 00 47 b,a 200616c <== NOT EXECUTED } if ( c == 's' ) { unsigned i, len; char *s, *str; str = va_arg(ap, char *); 2006054: f6 06 40 00 ld [ %i1 ], %i3 if ( str == NULL ) { 2006058: 80 a6 e0 00 cmp %i3, 0 200605c: 02 80 00 5a be 20061c4 2006060: b2 06 60 04 add %i1, 4, %i1 str = ""; } /* calculate length of string */ for ( len=0, s=str ; *s ; len++, s++ ) 2006064: c2 4e c0 00 ldsb [ %i3 ], %g1 2006068: 80 a0 60 00 cmp %g1, 0 200606c: 02 80 00 08 be 200608c 2006070: b4 10 20 00 clr %i2 2006074: 82 10 00 1b mov %i3, %g1 2006078: 82 00 60 01 inc %g1 200607c: c4 48 40 00 ldsb [ %g1 ], %g2 2006080: 80 a0 a0 00 cmp %g2, 0 2006084: 12 bf ff fd bne 2006078 2006088: b4 06 a0 01 inc %i2 ; /* leading spaces */ if ( !minus ) 200608c: a4 8c a0 ff andcc %l2, 0xff, %l2 2006090: 12 80 00 0f bne 20060cc 2006094: 80 a7 60 00 cmp %i5, 0 for ( i=len ; i 20060a0: 80 a7 60 00 cmp %i5, 0 20060a4: a0 10 00 1a mov %i2, %l0 20060a8: b8 15 21 cc or %l4, 0x1cc, %i4 BSP_output_char(' '); 20060ac: c2 07 00 00 ld [ %i4 ], %g1 20060b0: 9f c0 40 00 call %g1 20060b4: 90 10 20 20 mov 0x20, %o0 for ( len=0, s=str ; *s ; len++, s++ ) ; /* leading spaces */ if ( !minus ) for ( i=len ; i 20060c4: c2 07 00 00 ld [ %i4 ], %g1 BSP_output_char(' '); /* no width option */ if (width == 0) { 20060c8: 80 a7 60 00 cmp %i5, 0 20060cc: 32 80 00 07 bne,a 20060e8 20060d0: d0 4e c0 00 ldsb [ %i3 ], %o0 width = len; } /* output the string */ for ( i=0 ; i 20060dc: 80 a4 a0 00 cmp %l2, 0 20060e0: ba 10 00 1a mov %i2, %i5 20060e4: d0 4e c0 00 ldsb [ %i3 ], %o0 20060e8: 80 a2 20 00 cmp %o0, 0 20060ec: 02 80 00 0d be 2006120 <== NEVER TAKEN 20060f0: c2 05 21 cc ld [ %l4 + 0x1cc ], %g1 BSP_output_char(*str); 20060f4: 9f c0 40 00 call %g1 20060f8: b8 15 21 cc or %l4, 0x1cc, %i4 if (width == 0) { width = len; } /* output the string */ for ( i=0 ; i 2006100: b6 06 e0 01 inc %i3 BSP_output_char(*str); 2006104: c2 07 00 00 ld [ %i4 ], %g1 2006108: 9f c0 40 00 call %g1 200610c: 01 00 00 00 nop if (width == 0) { width = len; } /* output the string */ for ( i=0 ; i 200611c: b6 06 e0 01 inc %i3 BSP_output_char(*str); /* trailing spaces */ if ( minus ) 2006120: 80 a4 a0 00 cmp %l2, 0 2006124: 22 bf ff 8b be,a 2005f50 2006128: c2 0e 20 01 ldub [ %i0 + 1 ], %g1 for ( i=len ; i 2006134: c2 0e 20 01 ldub [ %i0 + 1 ], %g1 2006138: b8 15 21 cc or %l4, 0x1cc, %i4 BSP_output_char(' '); 200613c: c2 07 00 00 ld [ %i4 ], %g1 2006140: 9f c0 40 00 call %g1 2006144: 90 10 20 20 mov 0x20, %o0 for ( i=0 ; i 2006154: c2 07 00 00 ld [ %i4 ], %g1 void vprintk( const char *fmt, va_list ap ) { for (; *fmt != '\0'; fmt++) { 2006158: c2 0e 20 01 ldub [ %i0 + 1 ], %g1 200615c: 83 28 60 18 sll %g1, 0x18, %g1 2006160: 80 a0 60 00 cmp %g1, 0 2006164: 12 bf ff 02 bne 2005d6c <== ALWAYS TAKEN 2006168: b0 06 20 01 inc %i0 200616c: 81 c7 e0 08 ret 2006170: 81 e8 00 00 restore unsigned long n; unsigned count; char toPrint[20]; if ( sign && (num < 0) ) { BSP_output_char('-'); 2006174: 9f c0 40 00 call %g1 2006178: 90 10 20 2d mov 0x2d, %o0 unsigned_num = (unsigned long) -num; if (maxwidth) maxwidth--; 200617c: 80 a0 00 1d cmp %g0, %i5 unsigned count; char toPrint[20]; if ( sign && (num < 0) ) { BSP_output_char('-'); unsigned_num = (unsigned long) -num; 2006180: b4 20 00 1a neg %i2 if (maxwidth) maxwidth--; 2006184: ba 67 60 00 subx %i5, 0, %i5 } else { unsigned_num = (unsigned long) num; } count = 0; while ((n = unsigned_num / base) > 0) { 2006188: 90 10 00 1a mov %i2, %o0 200618c: 92 10 00 10 mov %l0, %o1 2006190: 40 00 49 83 call 201879c <.udiv> 2006194: a4 10 00 10 mov %l0, %l2 2006198: b8 92 20 00 orcc %o0, 0, %i4 200619c: 12 bf ff 44 bne 2005eac <== ALWAYS TAKEN 20061a0: b6 10 20 00 clr %i3 20061a4: b8 10 00 1a mov %i2, %i4 <== NOT EXECUTED if (maxwidth) maxwidth--; } else { unsigned_num = (unsigned long) num; } count = 0; 20061a8: b6 10 20 00 clr %i3 <== NOT EXECUTED while ((n = unsigned_num / base) > 0) { 20061ac: 10 bf ff 4c b 2005edc 20061b0: b4 10 20 01 mov 1, %i2 base = 8; sign = false; } else if ( c == 'i' || c == 'I' || c == 'd' || c == 'D' ) { base = 10; sign = true; } else if ( c == 'u' || c == 'U' ) { base = 10; sign = false; 20061b4: 10 bf ff 2c b 2005e64 20061b8: a0 10 20 0a mov 0xa, %l0 } else if ( c == 'x' || c == 'X' ) { base = 16; sign = false; } else if ( c == 'p' ) { base = 16; sign = false; lflag = true; 20061bc: 10 bf ff 2a b 2005e64 20061c0: a0 10 20 10 mov 0x10, %l0 char *s, *str; str = va_arg(ap, char *); if ( str == NULL ) { str = ""; 20061c4: 10 bf ff a8 b 2006064 20061c8: b6 15 e2 10 or %l7, 0x210, %i3 =============================================================================== 0201a314 : ssize_t write( int fd, const void *buffer, size_t count ) { 201a314: 9d e3 bf a0 save %sp, -96, %sp ssize_t rc; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 201a318: 03 00 80 73 sethi %hi(0x201cc00), %g1 201a31c: c2 00 61 0c ld [ %g1 + 0x10c ], %g1 ! 201cd0c 201a320: 80 a6 00 01 cmp %i0, %g1 201a324: 1a 80 00 1e bcc 201a39c 201a328: 03 00 80 75 sethi %hi(0x201d400), %g1 iop = rtems_libio_iop( fd ); 201a32c: fa 00 63 84 ld [ %g1 + 0x384 ], %i5 ! 201d784 201a330: b1 2e 20 06 sll %i0, 6, %i0 201a334: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open( iop ); 201a338: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 201a33c: 80 88 61 00 btst 0x100, %g1 201a340: 02 80 00 17 be 201a39c 201a344: 80 a6 60 00 cmp %i1, 0 rtems_libio_check_buffer( buffer ); 201a348: 02 80 00 1b be 201a3b4 <== NEVER TAKEN 201a34c: 80 a6 a0 00 cmp %i2, 0 rtems_libio_check_count( count ); 201a350: 02 80 00 11 be 201a394 201a354: b0 10 20 00 clr %i0 rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); 201a358: 80 88 60 04 btst 4, %g1 201a35c: 02 80 00 16 be 201a3b4 201a360: 90 10 00 1d mov %i5, %o0 /* * Now process the write() request. */ rc = (*iop->pathinfo.handlers->write_h)( iop, buffer, count ); 201a364: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 201a368: c2 00 60 0c ld [ %g1 + 0xc ], %g1 201a36c: 92 10 00 19 mov %i1, %o1 201a370: 9f c0 40 00 call %g1 201a374: 94 10 00 1a mov %i2, %o2 if ( rc > 0 ) 201a378: b0 92 20 00 orcc %o0, 0, %i0 201a37c: 04 80 00 06 ble 201a394 201a380: 85 3e 20 1f sra %i0, 0x1f, %g2 iop->offset += rc; 201a384: d8 1f 60 10 ldd [ %i5 + 0x10 ], %o4 201a388: 86 83 40 18 addcc %o5, %i0, %g3 201a38c: 84 43 00 02 addx %o4, %g2, %g2 201a390: c4 3f 60 10 std %g2, [ %i5 + 0x10 ] return rc; } 201a394: 81 c7 e0 08 ret 201a398: 81 e8 00 00 restore ssize_t rc; rtems_libio_t *iop; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open( iop ); 201a39c: 7f ff d5 64 call 200f92c <__errno> 201a3a0: b0 10 3f ff mov -1, %i0 201a3a4: 82 10 20 09 mov 9, %g1 201a3a8: c2 22 00 00 st %g1, [ %o0 ] 201a3ac: 81 c7 e0 08 ret 201a3b0: 81 e8 00 00 restore rtems_libio_check_buffer( buffer ); rtems_libio_check_count( count ); rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); 201a3b4: 7f ff d5 5e call 200f92c <__errno> 201a3b8: b0 10 3f ff mov -1, %i0 201a3bc: 82 10 20 16 mov 0x16, %g1 201a3c0: c2 22 00 00 st %g1, [ %o0 ] 201a3c4: 81 c7 e0 08 ret 201a3c8: 81 e8 00 00 restore =============================================================================== 02006ff4 : ssize_t writev( int fd, const struct iovec *iov, int iovcnt ) { 2006ff4: 9d e3 bf a0 save %sp, -96, %sp int bytes; rtems_libio_t *iop; ssize_t old; bool all_zeros; rtems_libio_check_fd( fd ); 2006ff8: 03 00 80 5e sethi %hi(0x2017800), %g1 2006ffc: c2 00 61 4c ld [ %g1 + 0x14c ], %g1 ! 201794c 2007000: 80 a6 00 01 cmp %i0, %g1 2007004: 1a 80 00 50 bcc 2007144 2007008: 03 00 80 60 sethi %hi(0x2018000), %g1 iop = rtems_libio_iop( fd ); 200700c: f6 00 63 a0 ld [ %g1 + 0x3a0 ], %i3 ! 20183a0 2007010: b1 2e 20 06 sll %i0, 6, %i0 2007014: b6 06 c0 18 add %i3, %i0, %i3 rtems_libio_check_is_open( iop ); 2007018: c2 06 e0 18 ld [ %i3 + 0x18 ], %g1 200701c: 80 88 61 00 btst 0x100, %g1 2007020: 02 80 00 49 be 2007144 2007024: 80 88 60 04 btst 4, %g1 rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); 2007028: 02 80 00 41 be 200712c <== NEVER TAKEN 200702c: 80 a6 60 00 cmp %i1, 0 /* * Argument validation on IO vector */ if ( !iov ) 2007030: 02 80 00 3f be 200712c 2007034: 80 a6 a0 00 cmp %i2, 0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( iovcnt <= 0 ) 2007038: 04 80 00 3d ble 200712c 200703c: 80 a6 a4 00 cmp %i2, 0x400 rtems_set_errno_and_return_minus_one( EINVAL ); if ( iovcnt > IOV_MAX ) 2007040: 14 80 00 3b bg 200712c <== NEVER TAKEN 2007044: b5 2e a0 03 sll %i2, 3, %i2 #include #include #include ssize_t writev( 2007048: 82 10 20 00 clr %g1 200704c: ba 10 20 01 mov 1, %i5 2007050: 84 10 20 00 clr %g2 /* * iov[v].iov_len cannot be less than 0 because size_t is unsigned. * So we only check for zero. */ if ( iov[v].iov_base == 0 ) 2007054: c6 06 40 01 ld [ %i1 + %g1 ], %g3 rtems_set_errno_and_return_minus_one( EINVAL ); if ( iov[v].iov_len ) 2007058: b8 06 40 01 add %i1, %g1, %i4 /* * iov[v].iov_len cannot be less than 0 because size_t is unsigned. * So we only check for zero. */ if ( iov[v].iov_base == 0 ) 200705c: 80 a0 e0 00 cmp %g3, 0 2007060: 02 80 00 33 be 200712c 2007064: 88 10 20 01 mov 1, %g4 rtems_set_errno_and_return_minus_one( EINVAL ); if ( iov[v].iov_len ) 2007068: c6 07 20 04 ld [ %i4 + 4 ], %g3 /* check for wrap */ old = total; total += iov[v].iov_len; if ( total < old || total > SSIZE_MAX ) rtems_set_errno_and_return_minus_one( EINVAL ); 200706c: 82 00 60 08 add %g1, 8, %g1 */ if ( iov[v].iov_base == 0 ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( iov[v].iov_len ) all_zeros = false; 2007070: 80 a0 00 03 cmp %g0, %g3 2007074: b8 40 3f ff addx %g0, -1, %i4 /* check for wrap */ old = total; total += iov[v].iov_len; if ( total < old || total > SSIZE_MAX ) 2007078: 86 80 c0 02 addcc %g3, %g2, %g3 200707c: 0c 80 00 2c bneg 200712c 2007080: ba 0f 40 1c and %i5, %i4, %i5 2007084: 80 a0 80 03 cmp %g2, %g3 2007088: 24 80 00 02 ble,a 2007090 200708c: 88 10 20 00 clr %g4 2007090: 80 89 20 ff btst 0xff, %g4 2007094: 12 80 00 26 bne 200712c 2007098: 80 a0 40 1a cmp %g1, %i2 * this loop does that check as well and sets "all-zero" appropriately. * The variable "all_zero" is used as an early exit point before * entering the write loop. */ all_zeros = true; for ( old=0, total=0, v=0 ; v < iovcnt ; v++ ) { 200709c: 12 bf ff ee bne 2007054 20070a0: 84 10 00 03 mov %g3, %g2 } /* * A writev with all zeros is supposed to have no effect per OpenGroup. */ if ( all_zeros == true ) { 20070a4: 80 8f 60 ff btst 0xff, %i5 20070a8: 12 80 00 1f bne 2007124 20070ac: b0 10 20 00 clr %i0 20070b0: 10 80 00 05 b 20070c4 20070b4: ba 10 20 00 clr %i5 } /* * Now process the writev(). */ for ( total=0, v=0 ; v < iovcnt ; v++ ) { 20070b8: 80 a7 40 1a cmp %i5, %i2 20070bc: 02 80 00 26 be 2007154 20070c0: 01 00 00 00 nop #include #include #include ssize_t writev( 20070c4: b8 06 40 1d add %i1, %i5, %i4 /* * Now process the writev(). */ for ( total=0, v=0 ; v < iovcnt ; v++ ) { /* all zero lengths has no effect */ if ( iov[v].iov_len == 0 ) 20070c8: d4 07 20 04 ld [ %i4 + 4 ], %o2 20070cc: 80 a2 a0 00 cmp %o2, 0 20070d0: 22 bf ff fa be,a 20070b8 <== NEVER TAKEN 20070d4: ba 07 60 08 add %i5, 8, %i5 <== NOT EXECUTED continue; bytes = (*iop->pathinfo.handlers->write_h)( 20070d8: c2 06 e0 24 ld [ %i3 + 0x24 ], %g1 20070dc: d2 06 40 1d ld [ %i1 + %i5 ], %o1 20070e0: c2 00 60 0c ld [ %g1 + 0xc ], %g1 20070e4: 9f c0 40 00 call %g1 20070e8: 90 10 00 1b mov %i3, %o0 iop, iov[v].iov_base, iov[v].iov_len ); if ( bytes < 0 ) 20070ec: 80 a2 20 00 cmp %o0, 0 20070f0: 06 80 00 1b bl 200715c <== NEVER TAKEN 20070f4: 01 00 00 00 nop return -1; if ( bytes > 0 ) { 20070f8: 02 80 00 07 be 2007114 <== NEVER TAKEN 20070fc: a1 3a 20 1f sra %o0, 0x1f, %l0 iop->offset += bytes; 2007100: c4 1e e0 10 ldd [ %i3 + 0x10 ], %g2 2007104: 86 80 c0 08 addcc %g3, %o0, %g3 total += bytes; 2007108: b0 06 00 08 add %i0, %o0, %i0 if ( bytes < 0 ) return -1; if ( bytes > 0 ) { iop->offset += bytes; 200710c: 84 40 80 10 addx %g2, %l0, %g2 2007110: c4 3e e0 10 std %g2, [ %i3 + 0x10 ] total += bytes; } if (bytes != iov[ v ].iov_len) 2007114: c2 07 20 04 ld [ %i4 + 4 ], %g1 2007118: 80 a2 00 01 cmp %o0, %g1 200711c: 02 bf ff e7 be 20070b8 <== ALWAYS TAKEN 2007120: ba 07 60 08 add %i5, 8, %i5 break; } return total; } 2007124: 81 c7 e0 08 ret 2007128: 81 e8 00 00 restore /* check for wrap */ old = total; total += iov[v].iov_len; if ( total < old || total > SSIZE_MAX ) rtems_set_errno_and_return_minus_one( EINVAL ); 200712c: 40 00 24 7a call 2010314 <__errno> 2007130: b0 10 3f ff mov -1, %i0 2007134: 82 10 20 16 mov 0x16, %g1 2007138: c2 22 00 00 st %g1, [ %o0 ] 200713c: 81 c7 e0 08 ret 2007140: 81 e8 00 00 restore ssize_t old; bool all_zeros; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open( iop ); 2007144: 40 00 24 74 call 2010314 <__errno> 2007148: b0 10 3f ff mov -1, %i0 200714c: 82 10 20 09 mov 9, %g1 2007150: c2 22 00 00 st %g1, [ %o0 ] 2007154: 81 c7 e0 08 ret 2007158: 81 e8 00 00 restore if (bytes != iov[ v ].iov_len) break; } return total; } 200715c: 81 c7 e0 08 ret <== NOT EXECUTED 2007160: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED