=============================================================================== 40008f78 <_API_extensions_Add_post_switch>: */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 40008f78: c2 02 00 00 ld [ %o0 ], %g1 40008f7c: 80 a0 60 00 cmp %g1, 0 40008f80: 22 80 00 04 be,a 40008f90 <_API_extensions_Add_post_switch+0x18> 40008f84: c2 02 20 04 ld [ %o0 + 4 ], %g1 40008f88: 81 c3 e0 08 retl 40008f8c: 01 00 00 00 nop 40008f90: 80 a0 60 00 cmp %g1, 0 40008f94: 12 bf ff fd bne 40008f88 <_API_extensions_Add_post_switch+0x10><== NEVER TAKEN 40008f98: 03 10 00 80 sethi %hi(0x40020000), %g1 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 40008f9c: 82 10 63 20 or %g1, 0x320, %g1 ! 40020320 <_API_extensions_Post_switch_list> 40008fa0: c4 00 60 08 ld [ %g1 + 8 ], %g2 the_node->next = tail; 40008fa4: 86 00 60 04 add %g1, 4, %g3 tail->previous = the_node; 40008fa8: d0 20 60 08 st %o0, [ %g1 + 8 ] ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; 40008fac: c6 22 00 00 st %g3, [ %o0 ] tail->previous = the_node; old_last->next = the_node; 40008fb0: d0 20 80 00 st %o0, [ %g2 ] the_node->previous = old_last; 40008fb4: 81 c3 e0 08 retl 40008fb8: c4 22 20 04 st %g2, [ %o0 + 4 ] =============================================================================== 40008fbc <_API_extensions_Run_postdriver>: } } #endif void _API_extensions_Run_postdriver( void ) { 40008fbc: 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; 40008fc0: 39 10 00 81 sethi %hi(0x40020400), %i4 40008fc4: fa 07 20 68 ld [ %i4 + 0x68 ], %i5 ! 40020468 <_API_extensions_List> 40008fc8: b8 17 20 68 or %i4, 0x68, %i4 Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); 40008fcc: b8 07 20 04 add %i4, 4, %i4 40008fd0: 80 a7 40 1c cmp %i5, %i4 40008fd4: 02 80 00 09 be 40008ff8 <_API_extensions_Run_postdriver+0x3c><== NEVER TAKEN 40008fd8: 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)(); 40008fdc: c2 07 60 08 ld [ %i5 + 8 ], %g1 40008fe0: 9f c0 40 00 call %g1 40008fe4: 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 ) { 40008fe8: 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 ); 40008fec: 80 a7 40 1c cmp %i5, %i4 40008ff0: 32 bf ff fc bne,a 40008fe0 <_API_extensions_Run_postdriver+0x24> 40008ff4: c2 07 60 08 ld [ %i5 + 8 ], %g1 40008ff8: 81 c7 e0 08 ret 40008ffc: 81 e8 00 00 restore =============================================================================== 4000b32c <_CORE_RWLock_Release>: #include CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 4000b32c: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Thread_Control *executing = _Thread_Executing; 4000b330: 03 10 00 70 sethi %hi(0x4001c000), %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 ); 4000b334: 7f ff e1 51 call 40003878 4000b338: fa 00 60 f0 ld [ %g1 + 0xf0 ], %i5 ! 4001c0f0 <_Per_CPU_Information+0x10> 4000b33c: 84 10 00 08 mov %o0, %g2 if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 4000b340: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 4000b344: 80 a0 60 00 cmp %g1, 0 4000b348: 02 80 00 2b be 4000b3f4 <_CORE_RWLock_Release+0xc8> 4000b34c: 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 ) { 4000b350: 22 80 00 22 be,a 4000b3d8 <_CORE_RWLock_Release+0xac> 4000b354: 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; 4000b358: 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; 4000b35c: c0 26 20 44 clr [ %i0 + 0x44 ] _ISR_Enable( level ); 4000b360: 7f ff e1 4a call 40003888 4000b364: 90 10 00 02 mov %g2, %o0 next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 4000b368: 40 00 07 e0 call 4000d2e8 <_Thread_queue_Dequeue> 4000b36c: 90 10 00 18 mov %i0, %o0 if ( next ) { 4000b370: 80 a2 20 00 cmp %o0, 0 4000b374: 22 80 00 24 be,a 4000b404 <_CORE_RWLock_Release+0xd8> 4000b378: b0 10 20 00 clr %i0 if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 4000b37c: c2 02 20 30 ld [ %o0 + 0x30 ], %g1 4000b380: 80 a0 60 01 cmp %g1, 1 4000b384: 02 80 00 22 be 4000b40c <_CORE_RWLock_Release+0xe0> 4000b388: 84 10 20 01 mov 1, %g2 } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 4000b38c: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 4000b390: 82 00 60 01 inc %g1 the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 4000b394: c4 26 20 44 st %g2, [ %i0 + 0x44 ] } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 4000b398: 10 80 00 09 b 4000b3bc <_CORE_RWLock_Release+0x90> 4000b39c: 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 || 4000b3a0: 80 a0 60 01 cmp %g1, 1 4000b3a4: 02 80 00 0b be 4000b3d0 <_CORE_RWLock_Release+0xa4> <== NEVER TAKEN 4000b3a8: 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; 4000b3ac: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 4000b3b0: 82 00 60 01 inc %g1 _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 4000b3b4: 40 00 08 dd call 4000d728 <_Thread_queue_Extract> 4000b3b8: 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 ); 4000b3bc: 40 00 09 2c call 4000d86c <_Thread_queue_First> 4000b3c0: 90 10 00 18 mov %i0, %o0 if ( !next || 4000b3c4: 92 92 20 00 orcc %o0, 0, %o1 4000b3c8: 32 bf ff f6 bne,a 4000b3a0 <_CORE_RWLock_Release+0x74> 4000b3cc: c2 02 60 30 ld [ %o1 + 0x30 ], %g1 } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 4000b3d0: 81 c7 e0 08 ret 4000b3d4: 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; 4000b3d8: 82 00 7f ff add %g1, -1, %g1 if ( the_rwlock->number_of_readers != 0 ) { 4000b3dc: 80 a0 60 00 cmp %g1, 0 4000b3e0: 02 bf ff de be 4000b358 <_CORE_RWLock_Release+0x2c> 4000b3e4: c2 26 20 48 st %g1, [ %i0 + 0x48 ] /* must be unlocked again */ _ISR_Enable( level ); 4000b3e8: 7f ff e1 28 call 40003888 4000b3ec: b0 10 20 00 clr %i0 return CORE_RWLOCK_SUCCESSFUL; 4000b3f0: 30 80 00 05 b,a 4000b404 <_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 ); 4000b3f4: 7f ff e1 25 call 40003888 4000b3f8: b0 10 20 00 clr %i0 executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 4000b3fc: 82 10 20 02 mov 2, %g1 4000b400: c2 27 60 34 st %g1, [ %i5 + 0x34 ] } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 4000b404: 81 c7 e0 08 ret 4000b408: 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; 4000b40c: 82 10 20 02 mov 2, %g1 4000b410: c2 26 20 44 st %g1, [ %i0 + 0x44 ] } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 4000b414: 81 c7 e0 08 ret 4000b418: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000b41c <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 4000b41c: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000b420: 90 10 00 18 mov %i0, %o0 4000b424: 40 00 06 e4 call 4000cfb4 <_Thread_Get> 4000b428: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000b42c: c2 07 bf fc ld [ %fp + -4 ], %g1 4000b430: 80 a0 60 00 cmp %g1, 0 4000b434: 12 80 00 08 bne 4000b454 <_CORE_RWLock_Timeout+0x38> <== NEVER TAKEN 4000b438: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 4000b43c: 40 00 09 4d call 4000d970 <_Thread_queue_Process_timeout> 4000b440: 01 00 00 00 nop * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4000b444: 03 10 00 6e sethi %hi(0x4001b800), %g1 4000b448: c4 00 63 d0 ld [ %g1 + 0x3d0 ], %g2 ! 4001bbd0 <_Thread_Dispatch_disable_level> --level; 4000b44c: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000b450: c4 20 63 d0 st %g2, [ %g1 + 0x3d0 ] 4000b454: 81 c7 e0 08 ret 4000b458: 81 e8 00 00 restore =============================================================================== 4000931c <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 4000931c: 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 ) 40009320: 3b 10 00 80 sethi %hi(0x40020000), %i5 40009324: c2 07 62 b0 ld [ %i5 + 0x2b0 ], %g1 ! 400202b0 <_Thread_Dispatch_disable_level> 40009328: 80 a0 60 00 cmp %g1, 0 4000932c: 02 80 00 1f be 400093a8 <_CORE_mutex_Seize+0x8c> 40009330: f8 27 a0 54 st %i4, [ %fp + 0x54 ] _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 40009334: 80 a6 a0 00 cmp %i2, 0 40009338: 02 80 00 2c be 400093e8 <_CORE_mutex_Seize+0xcc> 4000933c: 90 10 00 18 mov %i0, %o0 40009340: 03 10 00 81 sethi %hi(0x40020400), %g1 40009344: c2 00 63 b8 ld [ %g1 + 0x3b8 ], %g1 ! 400207b8 <_System_state_Current> 40009348: 80 a0 60 01 cmp %g1, 1 4000934c: 38 80 00 2e bgu,a 40009404 <_CORE_mutex_Seize+0xe8> 40009350: 90 10 20 00 clr %o0 40009354: 40 00 14 9a call 4000e5bc <_CORE_mutex_Seize_interrupt_trylock> 40009358: 92 07 a0 54 add %fp, 0x54, %o1 4000935c: 80 a2 20 00 cmp %o0, 0 40009360: 02 80 00 27 be 400093fc <_CORE_mutex_Seize+0xe0> <== ALWAYS TAKEN 40009364: 01 00 00 00 nop * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40009368: c4 07 62 b0 ld [ %i5 + 0x2b0 ], %g2 4000936c: 03 10 00 81 sethi %hi(0x40020400), %g1 40009370: c2 00 63 d0 ld [ %g1 + 0x3d0 ], %g1 ! 400207d0 <_Per_CPU_Information+0x10> 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; 40009374: 86 10 20 01 mov 1, %g3 40009378: c6 26 20 30 st %g3, [ %i0 + 0x30 ] 4000937c: f0 20 60 44 st %i0, [ %g1 + 0x44 ] 40009380: f2 20 60 20 st %i1, [ %g1 + 0x20 ] ++level; 40009384: 82 00 a0 01 add %g2, 1, %g1 _Thread_Dispatch_disable_level = level; 40009388: c2 27 62 b0 st %g1, [ %i5 + 0x2b0 ] 4000938c: 7f ff e4 55 call 400024e0 40009390: d0 07 a0 54 ld [ %fp + 0x54 ], %o0 40009394: 90 10 00 18 mov %i0, %o0 40009398: 7f ff ff ba call 40009280 <_CORE_mutex_Seize_interrupt_blocking> 4000939c: 92 10 00 1b mov %i3, %o1 400093a0: 81 c7 e0 08 ret 400093a4: 81 e8 00 00 restore 400093a8: 90 10 00 18 mov %i0, %o0 400093ac: 40 00 14 84 call 4000e5bc <_CORE_mutex_Seize_interrupt_trylock> 400093b0: 92 07 a0 54 add %fp, 0x54, %o1 400093b4: 80 a2 20 00 cmp %o0, 0 400093b8: 02 bf ff fa be 400093a0 <_CORE_mutex_Seize+0x84> 400093bc: 80 a6 a0 00 cmp %i2, 0 400093c0: 12 bf ff ea bne 40009368 <_CORE_mutex_Seize+0x4c> 400093c4: 01 00 00 00 nop 400093c8: 7f ff e4 46 call 400024e0 400093cc: d0 07 a0 54 ld [ %fp + 0x54 ], %o0 400093d0: 03 10 00 81 sethi %hi(0x40020400), %g1 400093d4: c2 00 63 d0 ld [ %g1 + 0x3d0 ], %g1 ! 400207d0 <_Per_CPU_Information+0x10> 400093d8: 84 10 20 01 mov 1, %g2 400093dc: c4 20 60 34 st %g2, [ %g1 + 0x34 ] 400093e0: 81 c7 e0 08 ret 400093e4: 81 e8 00 00 restore 400093e8: 40 00 14 75 call 4000e5bc <_CORE_mutex_Seize_interrupt_trylock> 400093ec: 92 07 a0 54 add %fp, 0x54, %o1 400093f0: 80 a2 20 00 cmp %o0, 0 400093f4: 12 bf ff f5 bne 400093c8 <_CORE_mutex_Seize+0xac> <== NEVER TAKEN 400093f8: 01 00 00 00 nop 400093fc: 81 c7 e0 08 ret 40009400: 81 e8 00 00 restore 40009404: 92 10 20 00 clr %o1 40009408: 40 00 01 c1 call 40009b0c <_Internal_error_Occurred> 4000940c: 94 10 20 12 mov 0x12, %o2 =============================================================================== 4000958c <_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 ) { 4000958c: 9d e3 bf a0 save %sp, -96, %sp 40009590: ba 10 00 18 mov %i0, %i5 Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 40009594: b0 10 20 00 clr %i0 if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 40009598: 40 00 07 a5 call 4000b42c <_Thread_queue_Dequeue> 4000959c: 90 10 00 1d mov %i5, %o0 400095a0: 80 a2 20 00 cmp %o0, 0 400095a4: 02 80 00 04 be 400095b4 <_CORE_semaphore_Surrender+0x28> 400095a8: 01 00 00 00 nop status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 400095ac: 81 c7 e0 08 ret 400095b0: 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 ); 400095b4: 7f ff e3 c7 call 400024d0 400095b8: 01 00 00 00 nop if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 400095bc: c2 07 60 48 ld [ %i5 + 0x48 ], %g1 400095c0: c4 07 60 40 ld [ %i5 + 0x40 ], %g2 400095c4: 80 a0 40 02 cmp %g1, %g2 400095c8: 1a 80 00 05 bcc 400095dc <_CORE_semaphore_Surrender+0x50> <== NEVER TAKEN 400095cc: b0 10 20 04 mov 4, %i0 the_semaphore->count += 1; 400095d0: 82 00 60 01 inc %g1 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 400095d4: b0 10 20 00 clr %i0 #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; 400095d8: c2 27 60 48 st %g1, [ %i5 + 0x48 ] else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 400095dc: 7f ff e3 c1 call 400024e0 400095e0: 01 00 00 00 nop } return status; } 400095e4: 81 c7 e0 08 ret 400095e8: 81 e8 00 00 restore =============================================================================== 4000914c <_Chain_Initialize>: Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { 4000914c: 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; 40009150: 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 ); 40009154: ba 06 20 04 add %i0, 4, %i5 Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 40009158: 80 a6 a0 00 cmp %i2, 0 4000915c: 02 80 00 13 be 400091a8 <_Chain_Initialize+0x5c> <== NEVER TAKEN 40009160: 92 06 bf ff add %i2, -1, %o1 40009164: 86 10 00 09 mov %o1, %g3 40009168: 82 10 00 19 mov %i1, %g1 4000916c: 84 10 00 18 mov %i0, %g2 current->next = next; 40009170: c2 20 80 00 st %g1, [ %g2 ] next->previous = current; 40009174: c4 20 60 04 st %g2, [ %g1 + 4 ] Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 40009178: 86 00 ff ff add %g3, -1, %g3 4000917c: 84 10 00 01 mov %g1, %g2 40009180: 80 a0 ff ff cmp %g3, -1 40009184: 12 bf ff fb bne 40009170 <_Chain_Initialize+0x24> 40009188: 82 00 40 1b add %g1, %i3, %g1 #include #include #include #include void _Chain_Initialize( 4000918c: 40 00 42 00 call 4001998c <.umul> 40009190: 90 10 00 1b mov %i3, %o0 40009194: 90 06 40 08 add %i1, %o0, %o0 current = next; next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } current->next = tail; 40009198: fa 22 00 00 st %i5, [ %o0 ] tail->previous = current; 4000919c: d0 26 20 08 st %o0, [ %i0 + 8 ] 400091a0: 81 c7 e0 08 ret 400091a4: 81 e8 00 00 restore ) { size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; 400091a8: 10 bf ff fc b 40009198 <_Chain_Initialize+0x4c> <== NOT EXECUTED 400091ac: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED =============================================================================== 400080f8 <_Event_Surrender>: rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 400080f8: 9d e3 bf a0 save %sp, -96, %sp rtems_event_set seized_events; rtems_option option_set; option_set = the_thread->Wait.option; _ISR_Disable( level ); 400080fc: 7f ff e8 f5 call 400024d0 40008100: fa 06 20 30 ld [ %i0 + 0x30 ], %i5 RTEMS_INLINE_ROUTINE void _Event_sets_Post( rtems_event_set the_new_events, rtems_event_set *the_event_set ) { *the_event_set |= the_new_events; 40008104: c2 06 80 00 ld [ %i2 ], %g1 40008108: b2 16 40 01 or %i1, %g1, %i1 4000810c: f2 26 80 00 st %i1, [ %i2 ] _Event_sets_Post( event_in, &event->pending_events ); pending_events = event->pending_events; event_condition = the_thread->Wait.count; 40008110: 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 ) ) { 40008114: 84 8e 40 01 andcc %i1, %g1, %g2 40008118: 02 80 00 35 be 400081ec <_Event_Surrender+0xf4> 4000811c: 07 10 00 81 sethi %hi(0x40020400), %g3 /* * 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() && 40008120: 86 10 e3 c0 or %g3, 0x3c0, %g3 ! 400207c0 <_Per_CPU_Information> 40008124: c8 00 e0 08 ld [ %g3 + 8 ], %g4 40008128: 80 a1 20 00 cmp %g4, 0 4000812c: 32 80 00 1c bne,a 4000819c <_Event_Surrender+0xa4> 40008130: c6 00 e0 10 ld [ %g3 + 0x10 ], %g3 RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 40008134: c6 06 20 10 ld [ %i0 + 0x10 ], %g3 } /* * Otherwise, this is a normal send to another thread */ if ( _States_Are_set( the_thread->current_state, wait_state ) ) { 40008138: 80 8f 00 03 btst %i4, %g3 4000813c: 02 80 00 2c be 400081ec <_Event_Surrender+0xf4> 40008140: 80 a0 40 02 cmp %g1, %g2 if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 40008144: 02 80 00 04 be 40008154 <_Event_Surrender+0x5c> 40008148: 80 8f 60 02 btst 2, %i5 4000814c: 02 80 00 28 be 400081ec <_Event_Surrender+0xf4> <== NEVER TAKEN 40008150: 01 00 00 00 nop event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 40008154: 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) ); 40008158: b2 2e 40 02 andn %i1, %g2, %i1 /* * Otherwise, this is a normal send to another thread */ if ( _States_Are_set( the_thread->current_state, wait_state ) ) { if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { event->pending_events = _Event_sets_Clear( 4000815c: f2 26 80 00 st %i1, [ %i2 ] pending_events, seized_events ); the_thread->Wait.count = 0; 40008160: c0 26 20 24 clr [ %i0 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 40008164: c4 20 40 00 st %g2, [ %g1 ] _ISR_Flash( level ); 40008168: 7f ff e8 de call 400024e0 4000816c: 01 00 00 00 nop 40008170: 7f ff e8 d8 call 400024d0 40008174: 01 00 00 00 nop if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 40008178: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 4000817c: 80 a0 60 02 cmp %g1, 2 40008180: 02 80 00 1d be 400081f4 <_Event_Surrender+0xfc> 40008184: 82 10 20 03 mov 3, %g1 _ISR_Enable( level ); 40008188: 7f ff e8 d6 call 400024e0 4000818c: 33 04 01 ff sethi %hi(0x1007fc00), %i1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 40008190: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1007fff8 40008194: 40 00 0a e0 call 4000ad14 <_Thread_Clear_state> 40008198: 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() && 4000819c: 80 a6 00 03 cmp %i0, %g3 400081a0: 32 bf ff e6 bne,a 40008138 <_Event_Surrender+0x40> 400081a4: c6 06 20 10 ld [ %i0 + 0x10 ], %g3 _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 400081a8: c6 06 c0 00 ld [ %i3 ], %g3 400081ac: 86 00 ff ff add %g3, -1, %g3 /* * 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 ) && 400081b0: 80 a0 e0 01 cmp %g3, 1 400081b4: 38 bf ff e1 bgu,a 40008138 <_Event_Surrender+0x40> 400081b8: c6 06 20 10 ld [ %i0 + 0x10 ], %g3 ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 400081bc: 80 a0 40 02 cmp %g1, %g2 400081c0: 02 80 00 04 be 400081d0 <_Event_Surrender+0xd8> 400081c4: 80 8f 60 02 btst 2, %i5 400081c8: 02 80 00 09 be 400081ec <_Event_Surrender+0xf4> <== NEVER TAKEN 400081cc: 01 00 00 00 nop event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 400081d0: c2 06 20 28 ld [ %i0 + 0x28 ], %g1 400081d4: b2 2e 40 02 andn %i1, %g2, %i1 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { event->pending_events = _Event_sets_Clear( 400081d8: f2 26 80 00 st %i1, [ %i2 ] pending_events, seized_events ); the_thread->Wait.count = 0; 400081dc: c0 26 20 24 clr [ %i0 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 400081e0: c4 20 40 00 st %g2, [ %g1 ] *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 400081e4: 82 10 20 03 mov 3, %g1 400081e8: c2 26 c0 00 st %g1, [ %i3 ] _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 400081ec: 7f ff e8 bd call 400024e0 400081f0: 91 e8 00 08 restore %g0, %o0, %o0 RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 400081f4: 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 ); 400081f8: 7f ff e8 ba call 400024e0 400081fc: 33 04 01 ff sethi %hi(0x1007fc00), %i1 (void) _Watchdog_Remove( &the_thread->Timer ); 40008200: 40 00 0f 4d call 4000bf34 <_Watchdog_Remove> 40008204: 90 06 20 48 add %i0, 0x48, %o0 40008208: b2 16 63 f8 or %i1, 0x3f8, %i1 4000820c: 40 00 0a c2 call 4000ad14 <_Thread_Clear_state> 40008210: 81 e8 00 00 restore =============================================================================== 40008214 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *arg ) { 40008214: 9d e3 bf 98 save %sp, -104, %sp ISR_Level level; Thread_blocking_operation_States *sync_state; sync_state = arg; the_thread = _Thread_Get( id, &location ); 40008218: 90 10 00 18 mov %i0, %o0 4000821c: 40 00 0b b7 call 4000b0f8 <_Thread_Get> 40008220: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40008224: c2 07 bf fc ld [ %fp + -4 ], %g1 40008228: 80 a0 60 00 cmp %g1, 0 4000822c: 12 80 00 15 bne 40008280 <_Event_Timeout+0x6c> <== NEVER TAKEN 40008230: 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 ); 40008234: 7f ff e8 a7 call 400024d0 40008238: 01 00 00 00 nop RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 4000823c: 03 10 00 81 sethi %hi(0x40020400), %g1 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 40008240: c2 00 63 d0 ld [ %g1 + 0x3d0 ], %g1 ! 400207d0 <_Per_CPU_Information+0x10> 40008244: 80 a7 40 01 cmp %i5, %g1 40008248: 02 80 00 10 be 40008288 <_Event_Timeout+0x74> 4000824c: c0 27 60 24 clr [ %i5 + 0x24 ] if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } the_thread->Wait.return_code = RTEMS_TIMEOUT; 40008250: 82 10 20 06 mov 6, %g1 40008254: c2 27 60 34 st %g1, [ %i5 + 0x34 ] _ISR_Enable( level ); 40008258: 7f ff e8 a2 call 400024e0 4000825c: 01 00 00 00 nop RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 40008260: 90 10 00 1d mov %i5, %o0 40008264: 13 04 01 ff sethi %hi(0x1007fc00), %o1 40008268: 40 00 0a ab call 4000ad14 <_Thread_Clear_state> 4000826c: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40008270: 03 10 00 80 sethi %hi(0x40020000), %g1 40008274: c4 00 62 b0 ld [ %g1 + 0x2b0 ], %g2 ! 400202b0 <_Thread_Dispatch_disable_level> --level; 40008278: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000827c: c4 20 62 b0 st %g2, [ %g1 + 0x2b0 ] 40008280: 81 c7 e0 08 ret 40008284: 81 e8 00 00 restore } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 40008288: c2 06 40 00 ld [ %i1 ], %g1 4000828c: 80 a0 60 01 cmp %g1, 1 40008290: 12 bf ff f1 bne 40008254 <_Event_Timeout+0x40> 40008294: 82 10 20 06 mov 6, %g1 *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 40008298: 82 10 20 02 mov 2, %g1 4000829c: 10 bf ff ed b 40008250 <_Event_Timeout+0x3c> 400082a0: c2 26 40 00 st %g1, [ %i1 ] =============================================================================== 4000e71c <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4000e71c: 9d e3 bf 98 save %sp, -104, %sp Heap_Statistics *const stats = &heap->stats; uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE 4000e720: a2 06 60 04 add %i1, 4, %l1 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4000e724: a0 10 00 18 mov %i0, %l0 Heap_Block *block = NULL; uintptr_t alloc_begin = 0; uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { 4000e728: 80 a6 40 11 cmp %i1, %l1 4000e72c: 18 80 00 85 bgu 4000e940 <_Heap_Allocate_aligned_with_boundary+0x224> 4000e730: ea 06 20 10 ld [ %i0 + 0x10 ], %l5 /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 4000e734: 80 a6 e0 00 cmp %i3, 0 4000e738: 12 80 00 7c bne 4000e928 <_Heap_Allocate_aligned_with_boundary+0x20c> 4000e73c: 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; 4000e740: fa 04 20 08 ld [ %l0 + 8 ], %i5 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 4000e744: 80 a4 00 1d cmp %l0, %i5 4000e748: 02 80 00 18 be 4000e7a8 <_Heap_Allocate_aligned_with_boundary+0x8c> 4000e74c: b8 10 20 00 clr %i4 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; 4000e750: ac 10 20 04 mov 4, %l6 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 4000e754: ae 05 60 07 add %l5, 7, %l7 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; 4000e758: ac 25 80 19 sub %l6, %i1, %l6 4000e75c: 10 80 00 0b b 4000e788 <_Heap_Allocate_aligned_with_boundary+0x6c> 4000e760: ec 27 bf fc st %l6, [ %fp + -4 ] * 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 ) { 4000e764: 12 80 00 18 bne 4000e7c4 <_Heap_Allocate_aligned_with_boundary+0xa8> 4000e768: b0 07 60 08 add %i5, 8, %i0 } /* Statistics */ ++search_count; if ( alloc_begin != 0 ) { 4000e76c: 80 a6 20 00 cmp %i0, 0 4000e770: 12 80 00 4d bne 4000e8a4 <_Heap_Allocate_aligned_with_boundary+0x188><== ALWAYS TAKEN 4000e774: b8 07 20 01 inc %i4 break; } block = block->next; 4000e778: fa 07 60 08 ld [ %i5 + 8 ], %i5 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 4000e77c: 80 a4 00 1d cmp %l0, %i5 4000e780: 22 80 00 0b be,a 4000e7ac <_Heap_Allocate_aligned_with_boundary+0x90> 4000e784: c2 04 20 44 ld [ %l0 + 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 ) { 4000e788: c2 07 60 04 ld [ %i5 + 4 ], %g1 4000e78c: 80 a4 40 01 cmp %l1, %g1 4000e790: 0a bf ff f5 bcs 4000e764 <_Heap_Allocate_aligned_with_boundary+0x48> 4000e794: 80 a6 a0 00 cmp %i2, 0 if ( alloc_begin != 0 ) { break; } block = block->next; 4000e798: fa 07 60 08 ld [ %i5 + 8 ], %i5 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 4000e79c: 80 a4 00 1d cmp %l0, %i5 4000e7a0: 12 bf ff fa bne 4000e788 <_Heap_Allocate_aligned_with_boundary+0x6c> 4000e7a4: b8 07 20 01 inc %i4 boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { 4000e7a8: c2 04 20 44 ld [ %l0 + 0x44 ], %g1 4000e7ac: 80 a0 40 1c cmp %g1, %i4 4000e7b0: 1a 80 00 03 bcc 4000e7bc <_Heap_Allocate_aligned_with_boundary+0xa0> 4000e7b4: b0 10 20 00 clr %i0 stats->max_search = search_count; 4000e7b8: f8 24 20 44 st %i4, [ %l0 + 0x44 ] } return (void *) alloc_begin; 4000e7bc: 81 c7 e0 08 ret 4000e7c0: 81 e8 00 00 restore uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 4000e7c4: e8 04 20 14 ld [ %l0 + 0x14 ], %l4 - 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; 4000e7c8: a4 08 7f fe and %g1, -2, %l2 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; 4000e7cc: c2 07 bf fc ld [ %fp + -4 ], %g1 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; 4000e7d0: 84 25 c0 14 sub %l7, %l4, %g2 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; 4000e7d4: a4 07 40 12 add %i5, %l2, %l2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4000e7d8: 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; 4000e7dc: b0 00 40 12 add %g1, %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 4000e7e0: a4 00 80 12 add %g2, %l2, %l2 4000e7e4: 40 00 2d 50 call 40019d24 <.urem> 4000e7e8: 90 10 00 18 mov %i0, %o0 4000e7ec: 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 ) { 4000e7f0: 80 a4 80 18 cmp %l2, %i0 4000e7f4: 1a 80 00 06 bcc 4000e80c <_Heap_Allocate_aligned_with_boundary+0xf0> 4000e7f8: a6 07 60 08 add %i5, 8, %l3 4000e7fc: 90 10 00 12 mov %l2, %o0 4000e800: 40 00 2d 49 call 40019d24 <.urem> 4000e804: 92 10 00 1a mov %i2, %o1 4000e808: b0 24 80 08 sub %l2, %o0, %i0 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 4000e80c: 80 a6 e0 00 cmp %i3, 0 4000e810: 02 80 00 37 be 4000e8ec <_Heap_Allocate_aligned_with_boundary+0x1d0> 4000e814: 80 a4 c0 18 cmp %l3, %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; 4000e818: 86 06 00 19 add %i0, %i1, %g3 4000e81c: 92 10 00 1b mov %i3, %o1 4000e820: 90 10 00 03 mov %g3, %o0 4000e824: 40 00 2d 40 call 40019d24 <.urem> 4000e828: c6 27 bf f8 st %g3, [ %fp + -8 ] 4000e82c: c6 07 bf f8 ld [ %fp + -8 ], %g3 4000e830: 90 20 c0 08 sub %g3, %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 ) { 4000e834: 80 a6 00 08 cmp %i0, %o0 4000e838: 1a 80 00 2c bcc 4000e8e8 <_Heap_Allocate_aligned_with_boundary+0x1cc> 4000e83c: a4 04 c0 19 add %l3, %i1, %l2 4000e840: 80 a2 00 03 cmp %o0, %g3 4000e844: 2a 80 00 12 bcs,a 4000e88c <_Heap_Allocate_aligned_with_boundary+0x170> 4000e848: 80 a4 80 08 cmp %l2, %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 ) { 4000e84c: 10 80 00 28 b 4000e8ec <_Heap_Allocate_aligned_with_boundary+0x1d0> 4000e850: 80 a4 c0 18 cmp %l3, %i0 4000e854: 92 10 00 1a mov %i2, %o1 4000e858: 40 00 2d 33 call 40019d24 <.urem> 4000e85c: 90 10 00 18 mov %i0, %o0 4000e860: 92 10 00 1b mov %i3, %o1 4000e864: b0 26 00 08 sub %i0, %o0, %i0 if ( boundary_line < boundary_floor ) { return 0; } alloc_begin = boundary_line - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 4000e868: ac 06 00 19 add %i0, %i1, %l6 4000e86c: 40 00 2d 2e call 40019d24 <.urem> 4000e870: 90 10 00 16 mov %l6, %o0 4000e874: 90 25 80 08 sub %l6, %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 ) { 4000e878: 80 a2 00 16 cmp %o0, %l6 4000e87c: 1a 80 00 1b bcc 4000e8e8 <_Heap_Allocate_aligned_with_boundary+0x1cc> 4000e880: 80 a6 00 08 cmp %i0, %o0 4000e884: 1a 80 00 19 bcc 4000e8e8 <_Heap_Allocate_aligned_with_boundary+0x1cc> 4000e888: 80 a4 80 08 cmp %l2, %o0 if ( boundary_line < boundary_floor ) { 4000e88c: 08 bf ff f2 bleu 4000e854 <_Heap_Allocate_aligned_with_boundary+0x138> 4000e890: b0 22 00 19 sub %o0, %i1, %i0 return 0; 4000e894: b0 10 20 00 clr %i0 } /* Statistics */ ++search_count; if ( alloc_begin != 0 ) { 4000e898: 80 a6 20 00 cmp %i0, 0 4000e89c: 02 bf ff b7 be 4000e778 <_Heap_Allocate_aligned_with_boundary+0x5c><== ALWAYS TAKEN 4000e8a0: 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; 4000e8a4: c6 04 20 48 ld [ %l0 + 0x48 ], %g3 stats->searches += search_count; 4000e8a8: c4 04 20 4c ld [ %l0 + 0x4c ], %g2 search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; 4000e8ac: 86 00 e0 01 inc %g3 stats->searches += search_count; 4000e8b0: 84 00 80 1c add %g2, %i4, %g2 search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; 4000e8b4: c6 24 20 48 st %g3, [ %l0 + 0x48 ] stats->searches += search_count; 4000e8b8: c4 24 20 4c st %g2, [ %l0 + 0x4c ] block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4000e8bc: 90 10 00 10 mov %l0, %o0 4000e8c0: 92 10 00 1d mov %i5, %o1 4000e8c4: 94 10 00 18 mov %i0, %o2 4000e8c8: 7f ff ec 45 call 400099dc <_Heap_Block_allocate> 4000e8cc: 96 10 00 19 mov %i1, %o3 boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { 4000e8d0: c2 04 20 44 ld [ %l0 + 0x44 ], %g1 4000e8d4: 80 a0 40 1c cmp %g1, %i4 4000e8d8: 2a bf ff b9 bcs,a 4000e7bc <_Heap_Allocate_aligned_with_boundary+0xa0> 4000e8dc: f8 24 20 44 st %i4, [ %l0 + 0x44 ] stats->max_search = search_count; } return (void *) alloc_begin; } 4000e8e0: 81 c7 e0 08 ret 4000e8e4: 81 e8 00 00 restore 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 ) { 4000e8e8: 80 a4 c0 18 cmp %l3, %i0 4000e8ec: 18 bf ff ea bgu 4000e894 <_Heap_Allocate_aligned_with_boundary+0x178> 4000e8f0: 82 10 3f f8 mov -8, %g1 4000e8f4: 90 10 00 18 mov %i0, %o0 4000e8f8: a4 20 40 1d sub %g1, %i5, %l2 4000e8fc: 92 10 00 15 mov %l5, %o1 4000e900: 40 00 2d 09 call 40019d24 <.urem> 4000e904: 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 ) { 4000e908: 90 a4 80 08 subcc %l2, %o0, %o0 4000e90c: 02 bf ff 99 be 4000e770 <_Heap_Allocate_aligned_with_boundary+0x54> 4000e910: 80 a6 20 00 cmp %i0, 0 4000e914: 80 a2 00 14 cmp %o0, %l4 4000e918: 1a bf ff 96 bcc 4000e770 <_Heap_Allocate_aligned_with_boundary+0x54> 4000e91c: 80 a6 20 00 cmp %i0, 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 ) { if ( boundary_line < boundary_floor ) { return 0; 4000e920: 10 bf ff de b 4000e898 <_Heap_Allocate_aligned_with_boundary+0x17c> 4000e924: b0 10 20 00 clr %i0 /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { 4000e928: 18 80 00 06 bgu 4000e940 <_Heap_Allocate_aligned_with_boundary+0x224> 4000e92c: 80 a6 a0 00 cmp %i2, 0 return NULL; } if ( alignment == 0 ) { 4000e930: 22 bf ff 84 be,a 4000e740 <_Heap_Allocate_aligned_with_boundary+0x24> 4000e934: b4 10 00 15 mov %l5, %i2 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4000e938: 10 bf ff 83 b 4000e744 <_Heap_Allocate_aligned_with_boundary+0x28> 4000e93c: fa 04 20 08 ld [ %l0 + 8 ], %i5 uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { /* Integer overflow occured */ return NULL; 4000e940: 81 c7 e0 08 ret 4000e944: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000e55c <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t unused __attribute__((unused)) ) { 4000e55c: 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; 4000e560: c0 27 bf f8 clr [ %fp + -8 ] Heap_Block *extend_last_block = NULL; 4000e564: c0 27 bf fc clr [ %fp + -4 ] Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t unused __attribute__((unused)) ) { 4000e568: b8 10 00 18 mov %i0, %i4 Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 4000e56c: e2 06 20 20 ld [ %i0 + 0x20 ], %l1 Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; 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; 4000e570: a0 06 40 1a add %i1, %i2, %l0 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; 4000e574: e4 06 20 10 ld [ %i0 + 0x10 ], %l2 uintptr_t const min_block_size = heap->min_block_size; 4000e578: d6 06 20 14 ld [ %i0 + 0x14 ], %o3 uintptr_t const free_size = stats->free_size; uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { 4000e57c: 80 a6 40 10 cmp %i1, %l0 4000e580: 08 80 00 04 bleu 4000e590 <_Heap_Extend+0x34> 4000e584: f0 06 20 30 ld [ %i0 + 0x30 ], %i0 return 0; 4000e588: 81 c7 e0 08 ret 4000e58c: 91 e8 20 00 restore %g0, 0, %o0 } extend_area_ok = _Heap_Get_first_and_last_block( 4000e590: 90 10 00 19 mov %i1, %o0 4000e594: 92 10 00 1a mov %i2, %o1 4000e598: 94 10 00 12 mov %l2, %o2 4000e59c: 98 07 bf f8 add %fp, -8, %o4 4000e5a0: 7f ff eb d6 call 400094f8 <_Heap_Get_first_and_last_block> 4000e5a4: 9a 07 bf fc add %fp, -4, %o5 page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 4000e5a8: 80 8a 20 ff btst 0xff, %o0 4000e5ac: 02 bf ff f7 be 4000e588 <_Heap_Extend+0x2c> 4000e5b0: ba 10 00 11 mov %l1, %i5 4000e5b4: aa 10 20 00 clr %l5 4000e5b8: ac 10 20 00 clr %l6 4000e5bc: a6 10 20 00 clr %l3 4000e5c0: 10 80 00 10 b 4000e600 <_Heap_Extend+0xa4> 4000e5c4: a8 10 20 00 clr %l4 return 0; } if ( extend_area_end == sub_area_begin ) { merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 4000e5c8: 2a 80 00 02 bcs,a 4000e5d0 <_Heap_Extend+0x74> 4000e5cc: ac 10 00 1d mov %i5, %l6 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 4000e5d0: 80 a6 c0 19 cmp %i3, %i1 4000e5d4: 22 80 00 1e be,a 4000e64c <_Heap_Extend+0xf0> 4000e5d8: e0 27 40 00 st %l0, [ %i5 ] start_block->prev_size = extend_area_end; merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 4000e5dc: 80 a6 40 1b cmp %i1, %i3 4000e5e0: 38 80 00 02 bgu,a 4000e5e8 <_Heap_Extend+0x8c> 4000e5e4: aa 10 00 08 mov %o0, %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; 4000e5e8: fa 02 20 04 ld [ %o0 + 4 ], %i5 4000e5ec: ba 0f 7f fe and %i5, -2, %i5 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4000e5f0: ba 02 00 1d add %o0, %i5, %i5 link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 4000e5f4: 80 a4 40 1d cmp %l1, %i5 4000e5f8: 22 80 00 1c be,a 4000e668 <_Heap_Extend+0x10c> 4000e5fc: c2 07 20 18 ld [ %i4 + 0x18 ], %g1 return 0; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 4000e600: 80 a7 40 11 cmp %i5, %l1 4000e604: 22 80 00 03 be,a 4000e610 <_Heap_Extend+0xb4> 4000e608: f4 07 20 18 ld [ %i4 + 0x18 ], %i2 4000e60c: b4 10 00 1d mov %i5, %i2 uintptr_t const sub_area_end = start_block->prev_size; 4000e610: f6 07 40 00 ld [ %i5 ], %i3 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4000e614: 92 10 00 12 mov %l2, %o1 4000e618: 40 00 16 eb call 400141c4 <.urem> 4000e61c: 90 10 00 1b mov %i3, %o0 4000e620: 82 06 ff f8 add %i3, -8, %g1 Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( 4000e624: 80 a6 80 10 cmp %i2, %l0 4000e628: 0a 80 00 64 bcs 4000e7b8 <_Heap_Extend+0x25c> 4000e62c: 90 20 40 08 sub %g1, %o0, %o0 sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return 0; } if ( extend_area_end == sub_area_begin ) { 4000e630: 80 a6 80 10 cmp %i2, %l0 4000e634: 12 bf ff e5 bne 4000e5c8 <_Heap_Extend+0x6c> 4000e638: 80 a4 00 1b cmp %l0, %i3 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 ) { 4000e63c: 80 a6 c0 19 cmp %i3, %i1 4000e640: 12 bf ff e7 bne 4000e5dc <_Heap_Extend+0x80> <== ALWAYS TAKEN 4000e644: a8 10 00 1d mov %i5, %l4 start_block->prev_size = extend_area_end; 4000e648: e0 27 40 00 st %l0, [ %i5 ] <== NOT EXECUTED - 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; 4000e64c: fa 02 20 04 ld [ %o0 + 4 ], %i5 4000e650: ba 0f 7f fe and %i5, -2, %i5 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4000e654: ba 02 00 1d add %o0, %i5, %i5 } 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 ); 4000e658: 80 a4 40 1d cmp %l1, %i5 4000e65c: 12 bf ff e9 bne 4000e600 <_Heap_Extend+0xa4> <== NEVER TAKEN 4000e660: a6 10 00 08 mov %o0, %l3 if ( extend_area_begin < heap->area_begin ) { 4000e664: c2 07 20 18 ld [ %i4 + 0x18 ], %g1 4000e668: 80 a6 40 01 cmp %i1, %g1 4000e66c: 3a 80 00 4e bcc,a 4000e7a4 <_Heap_Extend+0x248> 4000e670: c2 07 20 1c ld [ %i4 + 0x1c ], %g1 heap->area_begin = extend_area_begin; 4000e674: f2 27 20 18 st %i1, [ %i4 + 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; 4000e678: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000e67c: 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 ) { 4000e680: c8 07 20 20 ld [ %i4 + 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 = 4000e684: 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; 4000e688: e0 20 40 00 st %l0, [ %g1 ] extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4000e68c: ba 10 e0 01 or %g3, 1, %i5 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 = 4000e690: fa 20 60 04 st %i5, [ %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; 4000e694: 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 ) { 4000e698: 80 a1 00 01 cmp %g4, %g1 4000e69c: 08 80 00 3c bleu 4000e78c <_Heap_Extend+0x230> 4000e6a0: c0 20 a0 04 clr [ %g2 + 4 ] heap->first_block = extend_first_block; 4000e6a4: c2 27 20 20 st %g1, [ %i4 + 0x20 ] } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { 4000e6a8: 80 a5 20 00 cmp %l4, 0 4000e6ac: 02 80 00 47 be 4000e7c8 <_Heap_Extend+0x26c> 4000e6b0: 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; 4000e6b4: fa 07 20 10 ld [ %i4 + 0x10 ], %i5 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 4000e6b8: 92 10 00 1d mov %i5, %o1 4000e6bc: 40 00 16 c2 call 400141c4 <.urem> 4000e6c0: 90 10 00 19 mov %i1, %o0 if ( remainder != 0 ) { 4000e6c4: 80 a2 20 00 cmp %o0, 0 4000e6c8: 02 80 00 04 be 4000e6d8 <_Heap_Extend+0x17c> 4000e6cc: c4 05 00 00 ld [ %l4 ], %g2 return value - remainder + alignment; 4000e6d0: b2 06 40 1d add %i1, %i5, %i1 4000e6d4: 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 = 4000e6d8: 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; 4000e6dc: 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 = 4000e6e0: 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; 4000e6e4: 84 10 a0 01 or %g2, 1, %g2 _Heap_Free_block( heap, new_first_block ); 4000e6e8: 90 10 00 1c mov %i4, %o0 4000e6ec: 92 10 00 01 mov %g1, %o1 4000e6f0: 7f ff ff 85 call 4000e504 <_Heap_Free_block> 4000e6f4: c4 26 7f fc st %g2, [ %i1 + -4 ] link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 4000e6f8: 80 a4 e0 00 cmp %l3, 0 4000e6fc: 02 80 00 3a be 4000e7e4 <_Heap_Extend+0x288> 4000e700: a0 04 3f f8 add %l0, -8, %l0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4000e704: d2 07 20 10 ld [ %i4 + 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( 4000e708: a0 24 00 13 sub %l0, %l3, %l0 4000e70c: 40 00 16 ae call 400141c4 <.urem> 4000e710: 90 10 00 10 mov %l0, %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) 4000e714: c2 04 e0 04 ld [ %l3 + 4 ], %g1 4000e718: a0 24 00 08 sub %l0, %o0, %l0 4000e71c: 82 20 40 10 sub %g1, %l0, %g1 | HEAP_PREV_BLOCK_USED; 4000e720: 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 = 4000e724: 84 04 00 13 add %l0, %l3, %g2 4000e728: 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; 4000e72c: 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 ); 4000e730: 90 10 00 1c mov %i4, %o0 4000e734: 82 08 60 01 and %g1, 1, %g1 4000e738: 92 10 00 13 mov %l3, %o1 block->size_and_flag = size | flag; 4000e73c: a0 14 00 01 or %l0, %g1, %l0 4000e740: 7f ff ff 71 call 4000e504 <_Heap_Free_block> 4000e744: e0 24 e0 04 st %l0, [ %l3 + 4 ] extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 4000e748: 80 a4 e0 00 cmp %l3, 0 4000e74c: 02 80 00 33 be 4000e818 <_Heap_Extend+0x2bc> 4000e750: 80 a5 20 00 cmp %l4, 0 */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( heap->last_block, (uintptr_t) heap->first_block - (uintptr_t) heap->last_block 4000e754: c2 07 20 24 ld [ %i4 + 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( 4000e758: fa 07 20 20 ld [ %i4 + 0x20 ], %i5 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; 4000e75c: c8 00 60 04 ld [ %g1 + 4 ], %g4 _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; /* Statistics */ stats->size += extended_size; 4000e760: c4 07 20 2c ld [ %i4 + 0x2c ], %g2 _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 4000e764: c6 07 20 30 ld [ %i4 + 0x30 ], %g3 * 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( 4000e768: ba 27 40 01 sub %i5, %g1, %i5 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; 4000e76c: 88 09 20 01 and %g4, 1, %g4 block->size_and_flag = size | flag; 4000e770: 88 17 40 04 or %i5, %g4, %g4 4000e774: c8 20 60 04 st %g4, [ %g1 + 4 ] 4000e778: b0 20 c0 18 sub %g3, %i0, %i0 /* Statistics */ stats->size += extended_size; 4000e77c: 82 00 80 18 add %g2, %i0, %g1 4000e780: c2 27 20 2c st %g1, [ %i4 + 0x2c ] return extended_size; } 4000e784: 81 c7 e0 08 ret 4000e788: 81 e8 00 00 restore 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 ) { 4000e78c: c2 07 20 24 ld [ %i4 + 0x24 ], %g1 4000e790: 80 a0 40 02 cmp %g1, %g2 4000e794: 2a bf ff c5 bcs,a 4000e6a8 <_Heap_Extend+0x14c> 4000e798: c4 27 20 24 st %g2, [ %i4 + 0x24 ] heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { 4000e79c: 10 bf ff c4 b 4000e6ac <_Heap_Extend+0x150> 4000e7a0: 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 ) { 4000e7a4: 80 a4 00 01 cmp %l0, %g1 4000e7a8: 38 bf ff b4 bgu,a 4000e678 <_Heap_Extend+0x11c> 4000e7ac: e0 27 20 1c st %l0, [ %i4 + 0x1c ] heap->area_end = extend_area_end; } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 4000e7b0: 10 bf ff b3 b 4000e67c <_Heap_Extend+0x120> 4000e7b4: 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 ( 4000e7b8: 80 a6 40 1b cmp %i1, %i3 4000e7bc: 1a bf ff 9e bcc 4000e634 <_Heap_Extend+0xd8> 4000e7c0: 80 a6 80 10 cmp %i2, %l0 4000e7c4: 30 bf ff 71 b,a 4000e588 <_Heap_Extend+0x2c> 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 ) { 4000e7c8: 80 a5 a0 00 cmp %l6, 0 4000e7cc: 02 bf ff cc be 4000e6fc <_Heap_Extend+0x1a0> 4000e7d0: 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; 4000e7d4: ac 25 80 02 sub %l6, %g2, %l6 4000e7d8: 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 = 4000e7dc: 10 bf ff c8 b 4000e6fc <_Heap_Extend+0x1a0> 4000e7e0: ec 20 a0 04 st %l6, [ %g2 + 4 ] ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 4000e7e4: 80 a5 60 00 cmp %l5, 0 4000e7e8: 02 bf ff d8 be 4000e748 <_Heap_Extend+0x1ec> 4000e7ec: 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; 4000e7f0: c6 05 60 04 ld [ %l5 + 4 ], %g3 _Heap_Link_above( 4000e7f4: c2 07 bf fc ld [ %fp + -4 ], %g1 4000e7f8: 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 ); 4000e7fc: 84 20 80 15 sub %g2, %l5, %g2 block->size_and_flag = size | flag; 4000e800: 84 10 80 03 or %g2, %g3, %g2 4000e804: c4 25 60 04 st %g2, [ %l5 + 4 ] last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 4000e808: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000e80c: 84 10 a0 01 or %g2, 1, %g2 4000e810: 10 bf ff ce b 4000e748 <_Heap_Extend+0x1ec> 4000e814: c4 20 60 04 st %g2, [ %g1 + 4 ] extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 4000e818: 32 bf ff d0 bne,a 4000e758 <_Heap_Extend+0x1fc> 4000e81c: c2 07 20 24 ld [ %i4 + 0x24 ], %g1 _Heap_Free_block( heap, extend_first_block ); 4000e820: d2 07 bf f8 ld [ %fp + -8 ], %o1 4000e824: 7f ff ff 38 call 4000e504 <_Heap_Free_block> 4000e828: 90 10 00 1c mov %i4, %o0 */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( heap->last_block, (uintptr_t) heap->first_block - (uintptr_t) heap->last_block 4000e82c: 10 bf ff cb b 4000e758 <_Heap_Extend+0x1fc> 4000e830: c2 07 20 24 ld [ %i4 + 0x24 ], %g1 =============================================================================== 4000e948 <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4000e948: 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 ) { 4000e94c: 80 a6 60 00 cmp %i1, 0 4000e950: 02 80 00 3c be 4000ea40 <_Heap_Free+0xf8> 4000e954: 82 10 20 01 mov 1, %g1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4000e958: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 4000e95c: 40 00 2c f2 call 40019d24 <.urem> 4000e960: 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 4000e964: c4 06 20 20 ld [ %i0 + 0x20 ], %g2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4000e968: 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); 4000e96c: 90 27 40 08 sub %i5, %o0, %o0 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; 4000e970: 80 a2 00 02 cmp %o0, %g2 4000e974: 0a 80 00 30 bcs 4000ea34 <_Heap_Free+0xec> 4000e978: 82 10 20 00 clr %g1 4000e97c: c8 06 20 24 ld [ %i0 + 0x24 ], %g4 4000e980: 80 a2 00 04 cmp %o0, %g4 4000e984: 38 80 00 2d bgu,a 4000ea38 <_Heap_Free+0xf0> <== NEVER TAKEN 4000e988: b0 08 60 ff and %g1, 0xff, %i0 <== NOT EXECUTED - 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; 4000e98c: f6 02 20 04 ld [ %o0 + 4 ], %i3 4000e990: ba 0e ff fe and %i3, -2, %i5 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4000e994: 86 02 00 1d add %o0, %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; 4000e998: 80 a0 80 03 cmp %g2, %g3 4000e99c: 38 80 00 27 bgu,a 4000ea38 <_Heap_Free+0xf0> <== NEVER TAKEN 4000e9a0: b0 08 60 ff and %g1, 0xff, %i0 <== NOT EXECUTED 4000e9a4: 80 a1 00 03 cmp %g4, %g3 4000e9a8: 2a 80 00 24 bcs,a 4000ea38 <_Heap_Free+0xf0> <== NEVER TAKEN 4000e9ac: b0 08 60 ff and %g1, 0xff, %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; 4000e9b0: f8 00 e0 04 ld [ %g3 + 4 ], %i4 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 4000e9b4: 80 8f 20 01 btst 1, %i4 4000e9b8: 02 80 00 1f be 4000ea34 <_Heap_Free+0xec> <== NEVER TAKEN 4000e9bc: 80 a1 00 03 cmp %g4, %g3 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 )); 4000e9c0: 02 80 00 23 be 4000ea4c <_Heap_Free+0x104> 4000e9c4: b8 0f 3f fe and %i4, -2, %i4 4000e9c8: 82 00 c0 1c add %g3, %i4, %g1 4000e9cc: c2 00 60 04 ld [ %g1 + 4 ], %g1 4000e9d0: 80 88 60 01 btst 1, %g1 4000e9d4: 12 80 00 1f bne 4000ea50 <_Heap_Free+0x108> 4000e9d8: 80 8e e0 01 btst 1, %i3 if ( !_Heap_Is_prev_used( block ) ) { 4000e9dc: 02 80 00 20 be 4000ea5c <_Heap_Free+0x114> 4000e9e0: b2 10 20 01 mov 1, %i1 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 4000e9e4: c4 00 e0 08 ld [ %g3 + 8 ], %g2 Heap_Block *prev = old_block->prev; 4000e9e8: c2 00 e0 0c ld [ %g3 + 0xc ], %g1 new_block->next = next; 4000e9ec: c4 22 20 08 st %g2, [ %o0 + 8 ] new_block->prev = prev; 4000e9f0: c2 22 20 0c st %g1, [ %o0 + 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; 4000e9f4: b8 07 00 1d add %i4, %i5, %i4 next->prev = new_block; 4000e9f8: d0 20 a0 0c st %o0, [ %g2 + 0xc ] prev->next = new_block; 4000e9fc: d0 20 60 08 st %o0, [ %g1 + 8 ] _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4000ea00: 84 17 20 01 or %i4, 1, %g2 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4000ea04: f8 22 00 1c st %i4, [ %o0 + %i4 ] 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; 4000ea08: c4 22 20 04 st %g2, [ %o0 + 4 ] } } /* Statistics */ --stats->used_blocks; ++stats->frees; 4000ea0c: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4000ea10: c4 06 20 40 ld [ %i0 + 0x40 ], %g2 ++stats->frees; stats->free_size += block_size; 4000ea14: c6 06 20 30 ld [ %i0 + 0x30 ], %g3 } } /* Statistics */ --stats->used_blocks; ++stats->frees; 4000ea18: 82 00 60 01 inc %g1 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4000ea1c: 84 00 bf ff add %g2, -1, %g2 ++stats->frees; stats->free_size += block_size; 4000ea20: ba 00 c0 1d add %g3, %i5, %i5 } } /* Statistics */ --stats->used_blocks; ++stats->frees; 4000ea24: c2 26 20 50 st %g1, [ %i0 + 0x50 ] stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4000ea28: c4 26 20 40 st %g2, [ %i0 + 0x40 ] ++stats->frees; stats->free_size += block_size; 4000ea2c: fa 26 20 30 st %i5, [ %i0 + 0x30 ] return( true ); 4000ea30: 82 10 20 01 mov 1, %g1 4000ea34: b0 08 60 ff and %g1, 0xff, %i0 4000ea38: 81 c7 e0 08 ret 4000ea3c: 81 e8 00 00 restore 4000ea40: b0 08 60 ff and %g1, 0xff, %i0 4000ea44: 81 c7 e0 08 ret 4000ea48: 81 e8 00 00 restore 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 ) ) { 4000ea4c: 80 8e e0 01 btst 1, %i3 4000ea50: 32 80 00 1e bne,a 4000eac8 <_Heap_Free+0x180> 4000ea54: c4 06 20 08 ld [ %i0 + 8 ], %g2 if ( !_Heap_Protection_determine_block_free( heap, block ) ) { return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4000ea58: b2 10 20 00 clr %i1 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { uintptr_t const prev_size = block->prev_size; 4000ea5c: f4 02 00 00 ld [ %o0 ], %i2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4000ea60: b6 22 00 1a sub %o0, %i2, %i3 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; 4000ea64: 80 a0 80 1b cmp %g2, %i3 4000ea68: 18 bf ff f3 bgu 4000ea34 <_Heap_Free+0xec> <== NEVER TAKEN 4000ea6c: 82 10 20 00 clr %g1 4000ea70: 80 a1 00 1b cmp %g4, %i3 4000ea74: 2a bf ff f1 bcs,a 4000ea38 <_Heap_Free+0xf0> <== NEVER TAKEN 4000ea78: b0 08 60 ff and %g1, 0xff, %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; 4000ea7c: c4 06 e0 04 ld [ %i3 + 4 ], %g2 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) ) { 4000ea80: 80 88 a0 01 btst 1, %g2 4000ea84: 02 bf ff ec be 4000ea34 <_Heap_Free+0xec> <== NEVER TAKEN 4000ea88: 80 8e 60 ff btst 0xff, %i1 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4000ea8c: 22 80 00 21 be,a 4000eb10 <_Heap_Free+0x1c8> 4000ea90: b4 07 40 1a add %i5, %i2, %i2 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 4000ea94: c2 00 e0 08 ld [ %g3 + 8 ], %g1 Heap_Block *prev = block->prev; 4000ea98: c4 00 e0 0c ld [ %g3 + 0xc ], %g2 uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4000ea9c: c6 06 20 38 ld [ %i0 + 0x38 ], %g3 prev->next = next; 4000eaa0: c2 20 a0 08 st %g1, [ %g2 + 8 ] next->prev = prev; 4000eaa4: c4 20 60 0c st %g2, [ %g1 + 0xc ] 4000eaa8: 82 00 ff ff add %g3, -1, %g1 4000eaac: 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; 4000eab0: b8 07 40 1c add %i5, %i4, %i4 4000eab4: b4 07 00 1a add %i4, %i2, %i2 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4000eab8: 82 16 a0 01 or %i2, 1, %g1 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 4000eabc: f4 26 c0 1a st %i2, [ %i3 + %i2 ] 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; 4000eac0: 10 bf ff d3 b 4000ea0c <_Heap_Free+0xc4> 4000eac4: c2 26 e0 04 st %g1, [ %i3 + 4 ] 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; 4000eac8: 82 17 60 01 or %i5, 1, %g1 4000eacc: c2 22 20 04 st %g1, [ %o0 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000ead0: c8 00 e0 04 ld [ %g3 + 4 ], %g4 ) { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; 4000ead4: f0 22 20 0c st %i0, [ %o0 + 0xc ] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4000ead8: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 4000eadc: c4 22 20 08 st %g2, [ %o0 + 8 ] new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 4000eae0: d0 20 a0 0c st %o0, [ %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; 4000eae4: 84 09 3f fe and %g4, -2, %g2 next_block->prev_size = block_size; 4000eae8: fa 22 00 1d st %i5, [ %o0 + %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; 4000eaec: 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 ) { 4000eaf0: 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; 4000eaf4: 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; 4000eaf8: d0 26 20 08 st %o0, [ %i0 + 8 ] if ( stats->max_free_blocks < stats->free_blocks ) { 4000eafc: 80 a0 40 02 cmp %g1, %g2 4000eb00: 08 bf ff c3 bleu 4000ea0c <_Heap_Free+0xc4> 4000eb04: c2 26 20 38 st %g1, [ %i0 + 0x38 ] stats->max_free_blocks = stats->free_blocks; 4000eb08: 10 bf ff c1 b 4000ea0c <_Heap_Free+0xc4> 4000eb0c: 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; 4000eb10: 82 16 a0 01 or %i2, 1, %g1 4000eb14: c2 26 e0 04 st %g1, [ %i3 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000eb18: c2 00 e0 04 ld [ %g3 + 4 ], %g1 next_block->prev_size = size; 4000eb1c: f4 22 00 1d st %i2, [ %o0 + %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; 4000eb20: 82 08 7f fe and %g1, -2, %g1 4000eb24: 10 bf ff ba b 4000ea0c <_Heap_Free+0xc4> 4000eb28: c2 20 e0 04 st %g1, [ %g3 + 4 ] =============================================================================== 40014614 <_Heap_Get_free_information>: return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 40014614: c2 02 20 08 ld [ %o0 + 8 ], %g1 ) { Heap_Block *the_block; Heap_Block *const tail = _Heap_Free_list_tail(the_heap); info->number = 0; 40014618: c0 22 40 00 clr [ %o1 ] info->largest = 0; 4001461c: c0 22 60 04 clr [ %o1 + 4 ] info->total = 0; 40014620: c0 22 60 08 clr [ %o1 + 8 ] for(the_block = _Heap_Free_list_first(the_heap); 40014624: 88 10 20 01 mov 1, %g4 40014628: 9a 10 20 00 clr %o5 4001462c: 80 a2 00 01 cmp %o0, %g1 40014630: 12 80 00 04 bne 40014640 <_Heap_Get_free_information+0x2c><== ALWAYS TAKEN 40014634: 86 10 20 00 clr %g3 40014638: 30 80 00 10 b,a 40014678 <_Heap_Get_free_information+0x64><== NOT EXECUTED 4001463c: 88 10 00 0c mov %o4, %g4 - 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; 40014640: c4 00 60 04 ld [ %g1 + 4 ], %g2 40014644: 98 01 20 01 add %g4, 1, %o4 40014648: 84 08 bf fe and %g2, -2, %g2 /* As we always coalesce free blocks, prev block must have been used. */ _HAssert(_Heap_Is_prev_used(the_block)); info->number++; info->total += the_size; if ( info->largest < the_size ) 4001464c: 80 a0 80 0d cmp %g2, %o5 40014650: 08 80 00 03 bleu 4001465c <_Heap_Get_free_information+0x48> 40014654: 86 00 c0 02 add %g3, %g2, %g3 info->largest = the_size; 40014658: c4 22 60 04 st %g2, [ %o1 + 4 ] info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); the_block != tail; the_block = the_block->next) 4001465c: c2 00 60 08 ld [ %g1 + 8 ], %g1 info->number = 0; info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); 40014660: 80 a2 00 01 cmp %o0, %g1 40014664: 32 bf ff f6 bne,a 4001463c <_Heap_Get_free_information+0x28> 40014668: da 02 60 04 ld [ %o1 + 4 ], %o5 4001466c: c8 22 40 00 st %g4, [ %o1 ] 40014670: 81 c3 e0 08 retl 40014674: c6 22 60 08 st %g3, [ %o1 + 8 ] 40014678: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 4000b818 <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 4000b818: 9d e3 bf a0 save %sp, -96, %sp Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 4000b81c: 80 a6 a0 00 cmp %i2, 0 4000b820: 02 80 00 35 be 4000b8f4 <_Heap_Greedy_allocate+0xdc> 4000b824: b8 10 00 18 mov %i0, %i4 4000b828: ba 10 20 00 clr %i5 4000b82c: b6 10 20 00 clr %i3 #include "config.h" #endif #include Heap_Block *_Heap_Greedy_allocate( 4000b830: 83 2f 60 02 sll %i5, 2, %g1 * @brief See _Heap_Allocate_aligned_with_boundary() with alignment and * boundary equals zero. */ RTEMS_INLINE_ROUTINE void *_Heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 4000b834: d2 06 40 01 ld [ %i1 + %g1 ], %o1 4000b838: 94 10 20 00 clr %o2 4000b83c: 96 10 20 00 clr %o3 4000b840: 40 00 1f ca call 40013768 <_Heap_Allocate_aligned_with_boundary> 4000b844: 90 10 00 1c mov %i4, %o0 size_t i; for (i = 0; i < block_count; ++i) { void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 4000b848: 82 92 20 00 orcc %o0, 0, %g1 4000b84c: 22 80 00 09 be,a 4000b870 <_Heap_Greedy_allocate+0x58> <== NEVER TAKEN 4000b850: ba 07 60 01 inc %i5 <== NOT EXECUTED RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4000b854: d2 07 20 10 ld [ %i4 + 0x10 ], %o1 4000b858: 40 00 37 13 call 400194a4 <.urem> 4000b85c: b0 00 7f f8 add %g1, -8, %i0 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4000b860: 90 26 00 08 sub %i0, %o0, %o0 Heap_Block *next_block = _Heap_Block_of_alloc_area( (uintptr_t) next, heap->page_size ); next_block->next = allocated_blocks; 4000b864: f6 22 20 08 st %i3, [ %o0 + 8 ] 4000b868: b6 10 00 08 mov %o0, %i3 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 4000b86c: ba 07 60 01 inc %i5 4000b870: 80 a7 40 1a cmp %i5, %i2 4000b874: 12 bf ff f0 bne 4000b834 <_Heap_Greedy_allocate+0x1c> 4000b878: 83 2f 60 02 sll %i5, 2, %g1 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4000b87c: fa 07 20 08 ld [ %i4 + 8 ], %i5 next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 4000b880: 80 a7 00 1d cmp %i4, %i5 4000b884: 02 80 00 17 be 4000b8e0 <_Heap_Greedy_allocate+0xc8> <== NEVER TAKEN 4000b888: b0 10 20 00 clr %i0 4000b88c: 10 80 00 03 b 4000b898 <_Heap_Greedy_allocate+0x80> 4000b890: b4 10 20 00 clr %i2 4000b894: ba 10 00 01 mov %g1, %i5 - 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; 4000b898: d6 07 60 04 ld [ %i5 + 4 ], %o3 _Heap_Block_allocate( 4000b89c: 92 10 00 1d mov %i5, %o1 4000b8a0: 96 0a ff fe and %o3, -2, %o3 4000b8a4: 94 07 60 08 add %i5, 8, %o2 4000b8a8: 90 10 00 1c mov %i4, %o0 4000b8ac: 40 00 00 e0 call 4000bc2c <_Heap_Block_allocate> 4000b8b0: 96 02 ff f8 add %o3, -8, %o3 current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; 4000b8b4: f4 27 60 08 st %i2, [ %i5 + 8 ] return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4000b8b8: c2 07 20 08 ld [ %i4 + 8 ], %g1 next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 4000b8bc: 80 a7 00 01 cmp %i4, %g1 4000b8c0: 12 bf ff f5 bne 4000b894 <_Heap_Greedy_allocate+0x7c> 4000b8c4: b4 10 00 1d mov %i5, %i2 4000b8c8: 10 80 00 06 b 4000b8e0 <_Heap_Greedy_allocate+0xc8> 4000b8cc: b0 10 00 1d mov %i5, %i0 } while ( allocated_blocks != NULL ) { current = allocated_blocks; allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 4000b8d0: 92 06 e0 08 add %i3, 8, %o1 4000b8d4: 90 10 00 1c mov %i4, %o0 4000b8d8: 40 00 20 2f call 40013994 <_Heap_Free> 4000b8dc: b6 10 00 1a mov %i2, %i3 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 4000b8e0: 80 a6 e0 00 cmp %i3, 0 4000b8e4: 32 bf ff fb bne,a 4000b8d0 <_Heap_Greedy_allocate+0xb8> 4000b8e8: f4 06 e0 08 ld [ %i3 + 8 ], %i2 allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } 4000b8ec: 81 c7 e0 08 ret 4000b8f0: 81 e8 00 00 restore const uintptr_t *block_sizes, size_t block_count ) { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *allocated_blocks = NULL; 4000b8f4: 10 bf ff e2 b 4000b87c <_Heap_Greedy_allocate+0x64> 4000b8f8: b6 10 20 00 clr %i3 =============================================================================== 4000b8fc <_Heap_Greedy_free>: void _Heap_Greedy_free( Heap_Control *heap, Heap_Block *blocks ) { 4000b8fc: 9d e3 bf a0 save %sp, -96, %sp while ( blocks != NULL ) { 4000b900: 80 a6 60 00 cmp %i1, 0 4000b904: 02 80 00 09 be 4000b928 <_Heap_Greedy_free+0x2c> <== NEVER TAKEN 4000b908: 01 00 00 00 nop Heap_Block *current = blocks; blocks = blocks->next; 4000b90c: fa 06 60 08 ld [ %i1 + 8 ], %i5 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 4000b910: 92 06 60 08 add %i1, 8, %o1 4000b914: 40 00 20 20 call 40013994 <_Heap_Free> 4000b918: 90 10 00 18 mov %i0, %o0 void _Heap_Greedy_free( Heap_Control *heap, Heap_Block *blocks ) { while ( blocks != NULL ) { 4000b91c: b2 97 60 00 orcc %i5, 0, %i1 4000b920: 32 bf ff fc bne,a 4000b910 <_Heap_Greedy_free+0x14> 4000b924: fa 06 60 08 ld [ %i1 + 8 ], %i5 4000b928: 81 c7 e0 08 ret 4000b92c: 81 e8 00 00 restore =============================================================================== 400146e0 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 400146e0: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED Heap_Block *current = heap->first_block; 400146e4: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 <== NOT EXECUTED Heap_Block *end = heap->last_block; 400146e8: f8 06 20 24 ld [ %i0 + 0x24 ], %i4 <== NOT EXECUTED bool stop = false; while ( !stop && current != end ) { 400146ec: 80 a0 40 1c cmp %g1, %i4 <== NOT EXECUTED 400146f0: 32 80 00 08 bne,a 40014710 <_Heap_Iterate+0x30> <== NOT EXECUTED 400146f4: d2 00 60 04 ld [ %g1 + 4 ], %o1 <== NOT EXECUTED 400146f8: 30 80 00 10 b,a 40014738 <_Heap_Iterate+0x58> <== NOT EXECUTED 400146fc: 90 1a 20 01 xor %o0, 1, %o0 <== NOT EXECUTED 40014700: 80 8a 20 ff btst 0xff, %o0 <== NOT EXECUTED 40014704: 02 80 00 0d be 40014738 <_Heap_Iterate+0x58> <== NOT EXECUTED 40014708: 01 00 00 00 nop <== NOT EXECUTED 4001470c: d2 00 60 04 ld [ %g1 + 4 ], %o1 <== NOT EXECUTED uintptr_t size = _Heap_Block_size( current ); Heap_Block *next = _Heap_Block_at( current, size ); bool used = _Heap_Is_prev_used( next ); stop = (*visitor)( current, size, used, visitor_arg ); 40014710: 90 10 00 01 mov %g1, %o0 <== NOT EXECUTED 40014714: 92 0a 7f fe and %o1, -2, %o1 <== NOT EXECUTED RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 40014718: ba 00 40 09 add %g1, %o1, %i5 <== 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; 4001471c: d4 07 60 04 ld [ %i5 + 4 ], %o2 <== NOT EXECUTED 40014720: 96 10 00 1a mov %i2, %o3 <== NOT EXECUTED 40014724: 9f c6 40 00 call %i1 <== NOT EXECUTED 40014728: 94 0a a0 01 and %o2, 1, %o2 <== NOT EXECUTED { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 4001472c: 80 a7 00 1d cmp %i4, %i5 <== NOT EXECUTED 40014730: 12 bf ff f3 bne 400146fc <_Heap_Iterate+0x1c> <== NOT EXECUTED 40014734: 82 10 00 1d mov %i5, %g1 <== NOT EXECUTED 40014738: 81 c7 e0 08 ret <== NOT EXECUTED 4001473c: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4001d30c <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 4001d30c: 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); 4001d310: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 4001d314: 7f ff f2 84 call 40019d24 <.urem> 4001d318: 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 4001d31c: 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); 4001d320: 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); 4001d324: 90 20 80 08 sub %g2, %o0, %o0 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; 4001d328: 80 a2 00 01 cmp %o0, %g1 4001d32c: 0a 80 00 16 bcs 4001d384 <_Heap_Size_of_alloc_area+0x78> 4001d330: 84 10 20 00 clr %g2 4001d334: c6 06 20 24 ld [ %i0 + 0x24 ], %g3 4001d338: 80 a2 00 03 cmp %o0, %g3 4001d33c: 18 80 00 13 bgu 4001d388 <_Heap_Size_of_alloc_area+0x7c> <== NEVER TAKEN 4001d340: b0 08 a0 ff and %g2, 0xff, %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; 4001d344: c8 02 20 04 ld [ %o0 + 4 ], %g4 4001d348: 88 09 3f fe and %g4, -2, %g4 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4001d34c: 90 02 00 04 add %o0, %g4, %o0 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; 4001d350: 80 a0 40 08 cmp %g1, %o0 4001d354: 18 80 00 0d bgu 4001d388 <_Heap_Size_of_alloc_area+0x7c> <== NEVER TAKEN 4001d358: 01 00 00 00 nop 4001d35c: 80 a0 c0 08 cmp %g3, %o0 4001d360: 0a 80 00 0a bcs 4001d388 <_Heap_Size_of_alloc_area+0x7c> <== NEVER TAKEN 4001d364: 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; 4001d368: c2 02 20 04 ld [ %o0 + 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 ) 4001d36c: 80 88 60 01 btst 1, %g1 4001d370: 02 80 00 06 be 4001d388 <_Heap_Size_of_alloc_area+0x7c> <== NEVER TAKEN 4001d374: 90 22 00 19 sub %o0, %i1, %o0 return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; 4001d378: 84 10 20 01 mov 1, %g2 || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 4001d37c: 90 02 20 04 add %o0, 4, %o0 4001d380: d0 26 80 00 st %o0, [ %i2 ] 4001d384: b0 08 a0 ff and %g2, 0xff, %i0 4001d388: 81 c7 e0 08 ret 4001d38c: 81 e8 00 00 restore =============================================================================== 4000a474 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 4000a474: 9d e3 bf 80 save %sp, -128, %sp uintptr_t const page_size = heap->page_size; 4000a478: f6 06 20 10 ld [ %i0 + 0x10 ], %i3 uintptr_t const min_block_size = heap->min_block_size; 4000a47c: e0 06 20 14 ld [ %i0 + 0x14 ], %l0 Heap_Block *const first_block = heap->first_block; 4000a480: f8 06 20 20 ld [ %i0 + 0x20 ], %i4 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; 4000a484: 80 a6 a0 00 cmp %i2, 0 4000a488: 02 80 00 0c be 4000a4b8 <_Heap_Walk+0x44> 4000a48c: e2 06 20 24 ld [ %i0 + 0x24 ], %l1 if ( !_System_state_Is_up( _System_state_Get() ) ) { 4000a490: 03 10 00 6a sethi %hi(0x4001a800), %g1 4000a494: c4 00 60 c8 ld [ %g1 + 0xc8 ], %g2 ! 4001a8c8 <_System_state_Current> 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; 4000a498: 07 10 00 29 sethi %hi(0x4000a400), %g3 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; 4000a49c: 82 10 20 01 mov 1, %g1 Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { 4000a4a0: 80 a0 a0 03 cmp %g2, 3 4000a4a4: 02 80 00 0c be 4000a4d4 <_Heap_Walk+0x60> <== ALWAYS TAKEN 4000a4a8: ae 10 e0 10 or %g3, 0x10, %l7 4000a4ac: b0 08 60 ff and %g1, 0xff, %i0 4000a4b0: 81 c7 e0 08 ret 4000a4b4: 81 e8 00 00 restore 4000a4b8: 03 10 00 6a sethi %hi(0x4001a800), %g1 4000a4bc: c4 00 60 c8 ld [ %g1 + 0xc8 ], %g2 ! 4001a8c8 <_System_state_Current> 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; 4000a4c0: 07 10 00 29 sethi %hi(0x4000a400), %g3 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; 4000a4c4: 82 10 20 01 mov 1, %g1 Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { 4000a4c8: 80 a0 a0 03 cmp %g2, 3 4000a4cc: 12 bf ff f8 bne 4000a4ac <_Heap_Walk+0x38> 4000a4d0: ae 10 e0 08 or %g3, 8, %l7 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)( 4000a4d4: da 06 20 18 ld [ %i0 + 0x18 ], %o5 4000a4d8: c8 06 20 1c ld [ %i0 + 0x1c ], %g4 4000a4dc: c4 06 20 08 ld [ %i0 + 8 ], %g2 4000a4e0: c2 06 20 0c ld [ %i0 + 0xc ], %g1 4000a4e4: 90 10 00 19 mov %i1, %o0 4000a4e8: c8 23 a0 5c st %g4, [ %sp + 0x5c ] 4000a4ec: f8 23 a0 60 st %i4, [ %sp + 0x60 ] 4000a4f0: e2 23 a0 64 st %l1, [ %sp + 0x64 ] 4000a4f4: c4 23 a0 68 st %g2, [ %sp + 0x68 ] 4000a4f8: c2 23 a0 6c st %g1, [ %sp + 0x6c ] 4000a4fc: 92 10 20 00 clr %o1 4000a500: 96 10 00 1b mov %i3, %o3 4000a504: 15 10 00 5e sethi %hi(0x40017800), %o2 4000a508: 98 10 00 10 mov %l0, %o4 4000a50c: 9f c5 c0 00 call %l7 4000a510: 94 12 a0 70 or %o2, 0x70, %o2 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 4000a514: 80 a6 e0 00 cmp %i3, 0 4000a518: 02 80 00 2a be 4000a5c0 <_Heap_Walk+0x14c> 4000a51c: 80 8e e0 07 btst 7, %i3 (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 4000a520: 12 80 00 2f bne 4000a5dc <_Heap_Walk+0x168> 4000a524: 90 10 00 10 mov %l0, %o0 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 4000a528: 7f ff dd 92 call 40001b70 <.urem> 4000a52c: 92 10 00 1b mov %i3, %o1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 4000a530: 80 a2 20 00 cmp %o0, 0 4000a534: 12 80 00 32 bne 4000a5fc <_Heap_Walk+0x188> 4000a538: 90 07 20 08 add %i4, 8, %o0 4000a53c: 7f ff dd 8d call 40001b70 <.urem> 4000a540: 92 10 00 1b mov %i3, %o1 ); return false; } if ( 4000a544: 80 a2 20 00 cmp %o0, 0 4000a548: 32 80 00 35 bne,a 4000a61c <_Heap_Walk+0x1a8> 4000a54c: 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; 4000a550: ec 07 20 04 ld [ %i4 + 4 ], %l6 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 4000a554: b4 8d a0 01 andcc %l6, 1, %i2 4000a558: 22 80 00 38 be,a 4000a638 <_Heap_Walk+0x1c4> 4000a55c: 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; 4000a560: c2 04 60 04 ld [ %l1 + 4 ], %g1 4000a564: 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); 4000a568: 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; 4000a56c: fa 00 60 04 ld [ %g1 + 4 ], %i5 ); return false; } if ( _Heap_Is_free( last_block ) ) { 4000a570: 80 8f 60 01 btst 1, %i5 4000a574: 02 80 00 0c be 4000a5a4 <_Heap_Walk+0x130> 4000a578: 80 a7 00 01 cmp %i4, %g1 ); return false; } if ( 4000a57c: 02 80 00 35 be 4000a650 <_Heap_Walk+0x1dc> 4000a580: 90 10 00 19 mov %i1, %o0 _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 4000a584: 92 10 20 01 mov 1, %o1 4000a588: 15 10 00 5e sethi %hi(0x40017800), %o2 4000a58c: 9f c5 c0 00 call %l7 4000a590: 94 12 a1 e8 or %o2, 0x1e8, %o2 ! 400179e8 <__log2table+0x2d8> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4000a594: 82 10 20 00 clr %g1 4000a598: b0 08 60 ff and %g1, 0xff, %i0 4000a59c: 81 c7 e0 08 ret 4000a5a0: 81 e8 00 00 restore return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)( 4000a5a4: 90 10 00 19 mov %i1, %o0 4000a5a8: 92 10 20 01 mov 1, %o1 4000a5ac: 15 10 00 5e sethi %hi(0x40017800), %o2 4000a5b0: 9f c5 c0 00 call %l7 4000a5b4: 94 12 a1 d0 or %o2, 0x1d0, %o2 ! 400179d0 <__log2table+0x2c0> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4000a5b8: 10 bf ff f8 b 4000a598 <_Heap_Walk+0x124> 4000a5bc: 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" ); 4000a5c0: 90 10 00 19 mov %i1, %o0 4000a5c4: 92 10 20 01 mov 1, %o1 4000a5c8: 15 10 00 5e sethi %hi(0x40017800), %o2 4000a5cc: 9f c5 c0 00 call %l7 4000a5d0: 94 12 a1 08 or %o2, 0x108, %o2 ! 40017908 <__log2table+0x1f8> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4000a5d4: 10 bf ff f1 b 4000a598 <_Heap_Walk+0x124> 4000a5d8: 82 10 20 00 clr %g1 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)( 4000a5dc: 90 10 00 19 mov %i1, %o0 4000a5e0: 92 10 20 01 mov 1, %o1 4000a5e4: 15 10 00 5e sethi %hi(0x40017800), %o2 4000a5e8: 96 10 00 1b mov %i3, %o3 4000a5ec: 9f c5 c0 00 call %l7 4000a5f0: 94 12 a1 20 or %o2, 0x120, %o2 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4000a5f4: 10 bf ff e9 b 4000a598 <_Heap_Walk+0x124> 4000a5f8: 82 10 20 00 clr %g1 return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)( 4000a5fc: 90 10 00 19 mov %i1, %o0 4000a600: 92 10 20 01 mov 1, %o1 4000a604: 15 10 00 5e sethi %hi(0x40017800), %o2 4000a608: 96 10 00 10 mov %l0, %o3 4000a60c: 9f c5 c0 00 call %l7 4000a610: 94 12 a1 40 or %o2, 0x140, %o2 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4000a614: 10 bf ff e1 b 4000a598 <_Heap_Walk+0x124> 4000a618: 82 10 20 00 clr %g1 } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 4000a61c: 92 10 20 01 mov 1, %o1 4000a620: 15 10 00 5e sethi %hi(0x40017800), %o2 4000a624: 96 10 00 1c mov %i4, %o3 4000a628: 9f c5 c0 00 call %l7 4000a62c: 94 12 a1 68 or %o2, 0x168, %o2 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4000a630: 10 bf ff da b 4000a598 <_Heap_Walk+0x124> 4000a634: 82 10 20 00 clr %g1 return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 4000a638: 92 10 20 01 mov 1, %o1 4000a63c: 15 10 00 5e sethi %hi(0x40017800), %o2 4000a640: 9f c5 c0 00 call %l7 4000a644: 94 12 a1 a0 or %o2, 0x1a0, %o2 ! 400179a0 <__log2table+0x290> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4000a648: 10 bf ff d4 b 4000a598 <_Heap_Walk+0x124> 4000a64c: 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; 4000a650: fa 06 20 08 ld [ %i0 + 8 ], %i5 int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 4000a654: e8 06 20 10 ld [ %i0 + 0x10 ], %l4 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 ) { 4000a658: 80 a6 00 1d cmp %i0, %i5 4000a65c: 02 80 00 0d be 4000a690 <_Heap_Walk+0x21c> 4000a660: da 06 20 20 ld [ %i0 + 0x20 ], %o5 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; 4000a664: 80 a3 40 1d cmp %o5, %i5 4000a668: 28 80 00 bf bleu,a 4000a964 <_Heap_Walk+0x4f0> <== ALWAYS TAKEN 4000a66c: e6 06 20 24 ld [ %i0 + 0x24 ], %l3 if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { (*printer)( 4000a670: 90 10 00 19 mov %i1, %o0 <== NOT EXECUTED 4000a674: 92 10 20 01 mov 1, %o1 4000a678: 15 10 00 5e sethi %hi(0x40017800), %o2 4000a67c: 96 10 00 1d mov %i5, %o3 4000a680: 9f c5 c0 00 call %l7 4000a684: 94 12 a2 18 or %o2, 0x218, %o2 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4000a688: 10 bf ff c4 b 4000a598 <_Heap_Walk+0x124> 4000a68c: 82 10 20 00 clr %g1 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 4000a690: 27 10 00 5f sethi %hi(0x40017c00), %l3 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( 4000a694: 25 10 00 5f sethi %hi(0x40017c00), %l2 ); return false; } if ( _Heap_Is_used( free_block ) ) { 4000a698: aa 10 00 1c mov %i4, %l5 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 4000a69c: a6 14 e0 48 or %l3, 0x48, %l3 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( 4000a6a0: a4 14 a0 30 or %l2, 0x30, %l2 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 4000a6a4: 29 10 00 5e sethi %hi(0x40017800), %l4 - 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; 4000a6a8: ac 0d bf fe and %l6, -2, %l6 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4000a6ac: ba 05 80 15 add %l6, %l5, %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; 4000a6b0: 80 a3 40 1d cmp %o5, %i5 4000a6b4: 28 80 00 0b bleu,a 4000a6e0 <_Heap_Walk+0x26c> <== ALWAYS TAKEN 4000a6b8: de 06 20 24 ld [ %i0 + 0x24 ], %o7 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)( 4000a6bc: 90 10 00 19 mov %i1, %o0 <== NOT EXECUTED 4000a6c0: 92 10 20 01 mov 1, %o1 4000a6c4: 96 10 00 15 mov %l5, %o3 4000a6c8: 15 10 00 5e sethi %hi(0x40017800), %o2 4000a6cc: 98 10 00 1d mov %i5, %o4 4000a6d0: 9f c5 c0 00 call %l7 4000a6d4: 94 12 a2 c0 or %o2, 0x2c0, %o2 "block 0x%08x: next block 0x%08x not in heap\n", block, next_block ); return false; 4000a6d8: 10 bf ff 75 b 4000a4ac <_Heap_Walk+0x38> 4000a6dc: 82 10 20 00 clr %g1 4000a6e0: 80 a3 c0 1d cmp %o7, %i5 4000a6e4: 0a bf ff f7 bcs 4000a6c0 <_Heap_Walk+0x24c> 4000a6e8: 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; 4000a6ec: 9e 1d 40 11 xor %l5, %l1, %o7 4000a6f0: 80 a0 00 0f cmp %g0, %o7 4000a6f4: 9a 40 20 00 addx %g0, 0, %o5 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 4000a6f8: 90 10 00 16 mov %l6, %o0 4000a6fc: da 27 bf fc st %o5, [ %fp + -4 ] 4000a700: 7f ff dd 1c call 40001b70 <.urem> 4000a704: 92 10 00 1b mov %i3, %o1 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 4000a708: 80 a2 20 00 cmp %o0, 0 4000a70c: 02 80 00 18 be 4000a76c <_Heap_Walk+0x2f8> 4000a710: da 07 bf fc ld [ %fp + -4 ], %o5 4000a714: 80 8b 60 ff btst 0xff, %o5 4000a718: 12 80 00 8b bne 4000a944 <_Heap_Walk+0x4d0> 4000a71c: 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; 4000a720: de 07 60 04 ld [ %i5 + 4 ], %o7 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 4000a724: 80 8b e0 01 btst 1, %o7 4000a728: 02 80 00 2b be 4000a7d4 <_Heap_Walk+0x360> 4000a72c: 80 a6 a0 00 cmp %i2, 0 if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 4000a730: 22 80 00 21 be,a 4000a7b4 <_Heap_Walk+0x340> 4000a734: da 05 40 00 ld [ %l5 ], %o5 (*printer)( 4000a738: 90 10 00 19 mov %i1, %o0 4000a73c: 92 10 20 00 clr %o1 4000a740: 94 10 00 12 mov %l2, %o2 4000a744: 96 10 00 15 mov %l5, %o3 4000a748: 9f c5 c0 00 call %l7 4000a74c: 98 10 00 16 mov %l6, %o4 block->prev_size ); } block = next_block; } while ( block != first_block ); 4000a750: 80 a7 00 1d cmp %i4, %i5 4000a754: 02 80 00 51 be 4000a898 <_Heap_Walk+0x424> 4000a758: aa 10 00 1d mov %i5, %l5 4000a75c: ec 07 60 04 ld [ %i5 + 4 ], %l6 4000a760: da 06 20 20 ld [ %i0 + 0x20 ], %o5 4000a764: 10 bf ff d1 b 4000a6a8 <_Heap_Walk+0x234> 4000a768: b4 0d a0 01 and %l6, 1, %i2 ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 4000a76c: 80 a5 80 10 cmp %l6, %l0 4000a770: 0a 80 00 69 bcs 4000a914 <_Heap_Walk+0x4a0> 4000a774: 80 8b 60 ff btst 0xff, %o5 ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 4000a778: 80 a5 40 1d cmp %l5, %i5 4000a77c: 2a bf ff ea bcs,a 4000a724 <_Heap_Walk+0x2b0> 4000a780: de 07 60 04 ld [ %i5 + 4 ], %o7 4000a784: 80 8b 60 ff btst 0xff, %o5 4000a788: 22 bf ff e7 be,a 4000a724 <_Heap_Walk+0x2b0> 4000a78c: de 07 60 04 ld [ %i5 + 4 ], %o7 (*printer)( 4000a790: 90 10 00 19 mov %i1, %o0 4000a794: 92 10 20 01 mov 1, %o1 4000a798: 96 10 00 15 mov %l5, %o3 4000a79c: 15 10 00 5e sethi %hi(0x40017800), %o2 4000a7a0: 98 10 00 1d mov %i5, %o4 4000a7a4: 9f c5 c0 00 call %l7 4000a7a8: 94 12 a3 50 or %o2, 0x350, %o2 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 4000a7ac: 10 bf ff 40 b 4000a4ac <_Heap_Walk+0x38> 4000a7b0: 82 10 20 00 clr %g1 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 4000a7b4: 96 10 00 15 mov %l5, %o3 4000a7b8: 90 10 00 19 mov %i1, %o0 4000a7bc: 92 10 20 00 clr %o1 4000a7c0: 94 10 00 13 mov %l3, %o2 4000a7c4: 9f c5 c0 00 call %l7 4000a7c8: 98 10 00 16 mov %l6, %o4 block->prev_size ); } block = next_block; } while ( block != first_block ); 4000a7cc: 10 bf ff e2 b 4000a754 <_Heap_Walk+0x2e0> 4000a7d0: 80 a7 00 1d cmp %i4, %i5 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 ? 4000a7d4: da 05 60 0c ld [ %l5 + 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)( 4000a7d8: de 06 20 08 ld [ %i0 + 8 ], %o7 4000a7dc: 80 a3 c0 0d cmp %o7, %o5 4000a7e0: 02 80 00 3d be 4000a8d4 <_Heap_Walk+0x460> 4000a7e4: d8 06 20 0c ld [ %i0 + 0xc ], %o4 block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 4000a7e8: 80 a6 00 0d cmp %i0, %o5 4000a7ec: 02 80 00 40 be 4000a8ec <_Heap_Walk+0x478> 4000a7f0: 96 15 23 f8 or %l4, 0x3f8, %o3 block->next, block->next == last_free_block ? 4000a7f4: de 05 60 08 ld [ %l5 + 8 ], %o7 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)( 4000a7f8: 80 a3 00 0f cmp %o4, %o7 4000a7fc: 02 80 00 33 be 4000a8c8 <_Heap_Walk+0x454> 4000a800: 80 a6 00 0f cmp %i0, %o7 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 4000a804: 02 80 00 37 be 4000a8e0 <_Heap_Walk+0x46c> 4000a808: 98 15 23 f8 or %l4, 0x3f8, %o4 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)( 4000a80c: d6 23 a0 5c st %o3, [ %sp + 0x5c ] 4000a810: d8 23 a0 64 st %o4, [ %sp + 0x64 ] 4000a814: de 23 a0 60 st %o7, [ %sp + 0x60 ] 4000a818: 90 10 00 19 mov %i1, %o0 4000a81c: 92 10 20 00 clr %o1 4000a820: 15 10 00 5e sethi %hi(0x40017800), %o2 4000a824: 96 10 00 15 mov %l5, %o3 4000a828: 94 12 a3 88 or %o2, 0x388, %o2 4000a82c: 9f c5 c0 00 call %l7 4000a830: 98 10 00 16 mov %l6, %o4 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 4000a834: da 07 40 00 ld [ %i5 ], %o5 4000a838: 80 a5 80 0d cmp %l6, %o5 4000a83c: 12 80 00 19 bne 4000a8a0 <_Heap_Walk+0x42c> 4000a840: 80 a6 a0 00 cmp %i2, 0 ); return false; } if ( !prev_used ) { 4000a844: 02 80 00 2d be 4000a8f8 <_Heap_Walk+0x484> 4000a848: 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; 4000a84c: c4 06 20 08 ld [ %i0 + 8 ], %g2 ) { 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 ) { 4000a850: 80 a6 00 02 cmp %i0, %g2 4000a854: 02 80 00 0b be 4000a880 <_Heap_Walk+0x40c> <== NEVER TAKEN 4000a858: 92 10 20 01 mov 1, %o1 if ( free_block == block ) { 4000a85c: 80 a5 40 02 cmp %l5, %g2 4000a860: 02 bf ff bd be 4000a754 <_Heap_Walk+0x2e0> 4000a864: 80 a7 00 1d cmp %i4, %i5 return true; } free_block = free_block->next; 4000a868: c4 00 a0 08 ld [ %g2 + 8 ], %g2 ) { 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 ) { 4000a86c: 80 a6 00 02 cmp %i0, %g2 4000a870: 12 bf ff fc bne 4000a860 <_Heap_Walk+0x3ec> 4000a874: 80 a5 40 02 cmp %l5, %g2 return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 4000a878: 90 10 00 19 mov %i1, %o0 4000a87c: 92 10 20 01 mov 1, %o1 4000a880: 15 10 00 5f sethi %hi(0x40017c00), %o2 4000a884: 96 10 00 15 mov %l5, %o3 4000a888: 9f c5 c0 00 call %l7 4000a88c: 94 12 a0 70 or %o2, 0x70, %o2 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4000a890: 10 bf ff 42 b 4000a598 <_Heap_Walk+0x124> 4000a894: 82 10 20 00 clr %g1 } block = next_block; } while ( block != first_block ); return true; 4000a898: 10 bf ff 05 b 4000a4ac <_Heap_Walk+0x38> 4000a89c: 82 10 20 01 mov 1, %g1 " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { (*printer)( 4000a8a0: fa 23 a0 5c st %i5, [ %sp + 0x5c ] 4000a8a4: 90 10 00 19 mov %i1, %o0 4000a8a8: 92 10 20 01 mov 1, %o1 4000a8ac: 15 10 00 5e sethi %hi(0x40017800), %o2 4000a8b0: 96 10 00 15 mov %l5, %o3 4000a8b4: 94 12 a3 c0 or %o2, 0x3c0, %o2 4000a8b8: 9f c5 c0 00 call %l7 4000a8bc: 98 10 00 16 mov %l6, %o4 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4000a8c0: 10 bf ff 36 b 4000a598 <_Heap_Walk+0x124> 4000a8c4: 82 10 20 00 clr %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)( 4000a8c8: 03 10 00 5e sethi %hi(0x40017800), %g1 4000a8cc: 10 bf ff d0 b 4000a80c <_Heap_Walk+0x398> 4000a8d0: 98 10 60 50 or %g1, 0x50, %o4 ! 40017850 <__log2table+0x140> 4000a8d4: 03 10 00 5e sethi %hi(0x40017800), %g1 4000a8d8: 10 bf ff c7 b 4000a7f4 <_Heap_Walk+0x380> 4000a8dc: 96 10 60 30 or %g1, 0x30, %o3 ! 40017830 <__log2table+0x120> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 4000a8e0: 03 10 00 5e sethi %hi(0x40017800), %g1 4000a8e4: 10 bf ff ca b 4000a80c <_Heap_Walk+0x398> 4000a8e8: 98 10 60 60 or %g1, 0x60, %o4 ! 40017860 <__log2table+0x150> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 4000a8ec: 17 10 00 5e sethi %hi(0x40017800), %o3 4000a8f0: 10 bf ff c1 b 4000a7f4 <_Heap_Walk+0x380> 4000a8f4: 96 12 e0 40 or %o3, 0x40, %o3 ! 40017840 <__log2table+0x130> return false; } if ( !prev_used ) { (*printer)( 4000a8f8: 92 10 20 01 mov 1, %o1 4000a8fc: 15 10 00 5f sethi %hi(0x40017c00), %o2 4000a900: 96 10 00 15 mov %l5, %o3 4000a904: 9f c5 c0 00 call %l7 4000a908: 94 12 a0 00 mov %o2, %o2 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4000a90c: 10 bf ff 23 b 4000a598 <_Heap_Walk+0x124> 4000a910: 82 10 20 00 clr %g1 ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 4000a914: 02 bf ff 9a be 4000a77c <_Heap_Walk+0x308> <== NEVER TAKEN 4000a918: 80 a5 40 1d cmp %l5, %i5 (*printer)( 4000a91c: 90 10 00 19 mov %i1, %o0 4000a920: 92 10 20 01 mov 1, %o1 4000a924: 96 10 00 15 mov %l5, %o3 4000a928: 15 10 00 5e sethi %hi(0x40017800), %o2 4000a92c: 98 10 00 16 mov %l6, %o4 4000a930: 94 12 a3 20 or %o2, 0x320, %o2 4000a934: 9f c5 c0 00 call %l7 4000a938: 9a 10 00 10 mov %l0, %o5 block, block_size, min_block_size ); return false; 4000a93c: 10 bf fe dc b 4000a4ac <_Heap_Walk+0x38> 4000a940: 82 10 20 00 clr %g1 return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { (*printer)( 4000a944: 92 10 20 01 mov 1, %o1 4000a948: 96 10 00 15 mov %l5, %o3 4000a94c: 15 10 00 5e sethi %hi(0x40017800), %o2 4000a950: 98 10 00 16 mov %l6, %o4 4000a954: 9f c5 c0 00 call %l7 4000a958: 94 12 a2 f0 or %o2, 0x2f0, %o2 "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 4000a95c: 10 bf fe d4 b 4000a4ac <_Heap_Walk+0x38> 4000a960: 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; 4000a964: 80 a4 c0 1d cmp %l3, %i5 4000a968: 0a bf ff 43 bcs 4000a674 <_Heap_Walk+0x200> <== NEVER TAKEN 4000a96c: 90 10 00 19 mov %i1, %o0 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 4000a970: da 27 bf fc st %o5, [ %fp + -4 ] 4000a974: 90 07 60 08 add %i5, 8, %o0 4000a978: 7f ff dc 7e call 40001b70 <.urem> 4000a97c: 92 10 00 14 mov %l4, %o1 ); return false; } if ( 4000a980: 80 a2 20 00 cmp %o0, 0 4000a984: 12 80 00 36 bne 4000aa5c <_Heap_Walk+0x5e8> <== NEVER TAKEN 4000a988: da 07 bf fc ld [ %fp + -4 ], %o5 - 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; 4000a98c: c2 07 60 04 ld [ %i5 + 4 ], %g1 4000a990: 82 08 7f fe and %g1, -2, %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; 4000a994: 82 07 40 01 add %i5, %g1, %g1 4000a998: c2 00 60 04 ld [ %g1 + 4 ], %g1 ); return false; } if ( _Heap_Is_used( free_block ) ) { 4000a99c: 80 88 60 01 btst 1, %g1 4000a9a0: 12 80 00 27 bne 4000aa3c <_Heap_Walk+0x5c8> <== NEVER TAKEN 4000a9a4: a4 10 00 1d mov %i5, %l2 4000a9a8: 10 80 00 19 b 4000aa0c <_Heap_Walk+0x598> 4000a9ac: 82 10 00 18 mov %i0, %g1 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 ) { 4000a9b0: 80 a6 00 1d cmp %i0, %i5 4000a9b4: 02 bf ff 37 be 4000a690 <_Heap_Walk+0x21c> 4000a9b8: 80 a7 40 0d cmp %i5, %o5 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; 4000a9bc: 0a bf ff 2e bcs 4000a674 <_Heap_Walk+0x200> 4000a9c0: 90 10 00 19 mov %i1, %o0 4000a9c4: 80 a7 40 13 cmp %i5, %l3 4000a9c8: 18 bf ff 2c bgu 4000a678 <_Heap_Walk+0x204> <== NEVER TAKEN 4000a9cc: 92 10 20 01 mov 1, %o1 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 4000a9d0: da 27 bf fc st %o5, [ %fp + -4 ] 4000a9d4: 90 07 60 08 add %i5, 8, %o0 4000a9d8: 7f ff dc 66 call 40001b70 <.urem> 4000a9dc: 92 10 00 14 mov %l4, %o1 ); return false; } if ( 4000a9e0: 80 a2 20 00 cmp %o0, 0 4000a9e4: 12 80 00 1e bne 4000aa5c <_Heap_Walk+0x5e8> 4000a9e8: da 07 bf fc ld [ %fp + -4 ], %o5 - 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; 4000a9ec: de 07 60 04 ld [ %i5 + 4 ], %o7 4000a9f0: 82 10 00 12 mov %l2, %g1 4000a9f4: 9e 0b ff fe and %o7, -2, %o7 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; 4000a9f8: 9e 03 c0 1d add %o7, %i5, %o7 4000a9fc: de 03 e0 04 ld [ %o7 + 4 ], %o7 ); return false; } if ( _Heap_Is_used( free_block ) ) { 4000aa00: 80 8b e0 01 btst 1, %o7 4000aa04: 12 80 00 0e bne 4000aa3c <_Heap_Walk+0x5c8> 4000aa08: a4 10 00 1d mov %i5, %l2 ); return false; } if ( free_block->prev != prev_block ) { 4000aa0c: d8 07 60 0c ld [ %i5 + 0xc ], %o4 4000aa10: 80 a3 00 01 cmp %o4, %g1 4000aa14: 22 bf ff e7 be,a 4000a9b0 <_Heap_Walk+0x53c> 4000aa18: fa 07 60 08 ld [ %i5 + 8 ], %i5 (*printer)( 4000aa1c: 90 10 00 19 mov %i1, %o0 4000aa20: 92 10 20 01 mov 1, %o1 4000aa24: 15 10 00 5e sethi %hi(0x40017800), %o2 4000aa28: 96 10 00 1d mov %i5, %o3 4000aa2c: 9f c5 c0 00 call %l7 4000aa30: 94 12 a2 88 or %o2, 0x288, %o2 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4000aa34: 10 bf fe d9 b 4000a598 <_Heap_Walk+0x124> 4000aa38: 82 10 20 00 clr %g1 return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)( 4000aa3c: 90 10 00 19 mov %i1, %o0 4000aa40: 92 10 20 01 mov 1, %o1 4000aa44: 15 10 00 5e sethi %hi(0x40017800), %o2 4000aa48: 96 10 00 1d mov %i5, %o3 4000aa4c: 9f c5 c0 00 call %l7 4000aa50: 94 12 a2 68 or %o2, 0x268, %o2 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4000aa54: 10 bf fe d1 b 4000a598 <_Heap_Walk+0x124> 4000aa58: 82 10 20 00 clr %g1 } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 4000aa5c: 90 10 00 19 mov %i1, %o0 4000aa60: 92 10 20 01 mov 1, %o1 4000aa64: 15 10 00 5e sethi %hi(0x40017800), %o2 4000aa68: 96 10 00 1d mov %i5, %o3 4000aa6c: 9f c5 c0 00 call %l7 4000aa70: 94 12 a2 38 or %o2, 0x238, %o2 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4000aa74: 10 bf fe c9 b 4000a598 <_Heap_Walk+0x124> 4000aa78: 82 10 20 00 clr %g1 =============================================================================== 40008e14 <_IO_Initialize_all_drivers>: _IO_Driver_address_table[index] = driver_table[index]; } void _IO_Initialize_all_drivers( void ) { 40008e14: 9d e3 bf a0 save %sp, -96, %sp rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 40008e18: 39 10 00 83 sethi %hi(0x40020c00), %i4 40008e1c: c2 07 20 08 ld [ %i4 + 8 ], %g1 ! 40020c08 <_IO_Number_of_drivers> 40008e20: ba 10 20 00 clr %i5 40008e24: 80 a0 60 00 cmp %g1, 0 40008e28: 02 80 00 0b be 40008e54 <_IO_Initialize_all_drivers+0x40> <== NEVER TAKEN 40008e2c: b8 17 20 08 or %i4, 8, %i4 (void) rtems_io_initialize( major, 0, NULL ); 40008e30: 90 10 00 1d mov %i5, %o0 40008e34: 92 10 20 00 clr %o1 40008e38: 40 00 15 c1 call 4000e53c 40008e3c: 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 ++ ) 40008e40: c2 07 00 00 ld [ %i4 ], %g1 40008e44: ba 07 60 01 inc %i5 40008e48: 80 a0 40 1d cmp %g1, %i5 40008e4c: 18 bf ff fa bgu 40008e34 <_IO_Initialize_all_drivers+0x20> 40008e50: 90 10 00 1d mov %i5, %o0 40008e54: 81 c7 e0 08 ret 40008e58: 81 e8 00 00 restore =============================================================================== 40008d44 <_IO_Manager_initialization>: #include #include void _IO_Manager_initialization(void) { 40008d44: 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 = rtems_configuration_get_device_driver_table(); 40008d48: 03 10 00 75 sethi %hi(0x4001d400), %g1 40008d4c: 82 10 62 18 or %g1, 0x218, %g1 ! 4001d618 drivers_in_table = rtems_configuration_get_number_of_device_drivers(); 40008d50: f8 00 60 38 ld [ %g1 + 0x38 ], %i4 number_of_drivers = rtems_configuration_get_maximum_drivers(); 40008d54: f6 00 60 34 ld [ %g1 + 0x34 ], %i3 /* * 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 ) 40008d58: 80 a7 00 1b cmp %i4, %i3 40008d5c: 0a 80 00 08 bcs 40008d7c <_IO_Manager_initialization+0x38> 40008d60: fa 00 60 3c ld [ %g1 + 0x3c ], %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; 40008d64: 03 10 00 83 sethi %hi(0x40020c00), %g1 40008d68: fa 20 60 0c st %i5, [ %g1 + 0xc ] ! 40020c0c <_IO_Driver_address_table> _IO_Number_of_drivers = number_of_drivers; 40008d6c: 03 10 00 83 sethi %hi(0x40020c00), %g1 40008d70: f8 20 60 08 st %i4, [ %g1 + 8 ] ! 40020c08 <_IO_Number_of_drivers> return; 40008d74: 81 c7 e0 08 ret 40008d78: 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 ) 40008d7c: 83 2e e0 03 sll %i3, 3, %g1 40008d80: b5 2e e0 05 sll %i3, 5, %i2 40008d84: 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( 40008d88: 40 00 0d 2f call 4000c244 <_Workspace_Allocate_or_fatal_error> 40008d8c: 90 10 00 1a mov %i2, %o0 sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 40008d90: 03 10 00 83 sethi %hi(0x40020c00), %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 *) 40008d94: 33 10 00 83 sethi %hi(0x40020c00), %i1 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 40008d98: f6 20 60 08 st %i3, [ %g1 + 8 ] /* * 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 *) 40008d9c: d0 26 60 0c st %o0, [ %i1 + 0xc ] _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 40008da0: 92 10 20 00 clr %o1 40008da4: 40 00 21 75 call 40011378 40008da8: 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++ ) 40008dac: 80 a7 20 00 cmp %i4, 0 40008db0: 02 bf ff f1 be 40008d74 <_IO_Manager_initialization+0x30> <== NEVER TAKEN 40008db4: c8 06 60 0c ld [ %i1 + 0xc ], %g4 #include #include #include void _IO_Manager_initialization(void) 40008db8: 85 2f 20 03 sll %i4, 3, %g2 40008dbc: b7 2f 20 05 sll %i4, 5, %i3 40008dc0: 82 10 20 00 clr %g1 40008dc4: b6 26 c0 02 sub %i3, %g2, %i3 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; 40008dc8: c4 07 40 01 ld [ %i5 + %g1 ], %g2 40008dcc: 86 07 40 01 add %i5, %g1, %g3 40008dd0: c4 21 00 01 st %g2, [ %g4 + %g1 ] 40008dd4: f8 00 e0 04 ld [ %g3 + 4 ], %i4 40008dd8: 84 01 00 01 add %g4, %g1, %g2 40008ddc: f8 20 a0 04 st %i4, [ %g2 + 4 ] 40008de0: f8 00 e0 08 ld [ %g3 + 8 ], %i4 40008de4: 82 00 60 18 add %g1, 0x18, %g1 40008de8: f8 20 a0 08 st %i4, [ %g2 + 8 ] 40008dec: f8 00 e0 0c ld [ %g3 + 0xc ], %i4 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 40008df0: 80 a0 40 1b cmp %g1, %i3 _IO_Driver_address_table[index] = driver_table[index]; 40008df4: f8 20 a0 0c st %i4, [ %g2 + 0xc ] 40008df8: f8 00 e0 10 ld [ %g3 + 0x10 ], %i4 40008dfc: f8 20 a0 10 st %i4, [ %g2 + 0x10 ] 40008e00: 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++ ) 40008e04: 12 bf ff f1 bne 40008dc8 <_IO_Manager_initialization+0x84> 40008e08: c6 20 a0 14 st %g3, [ %g2 + 0x14 ] 40008e0c: 81 c7 e0 08 ret 40008e10: 81 e8 00 00 restore =============================================================================== 40009b0c <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 40009b0c: 9d e3 bf 90 save %sp, -112, %sp Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 40009b10: 13 10 00 2f sethi %hi(0x4000bc00), %o1 40009b14: 90 07 bf f4 add %fp, -12, %o0 40009b18: 92 12 60 7c or %o1, 0x7c, %o1 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 40009b1c: f0 27 bf f4 st %i0, [ %fp + -12 ] 40009b20: f2 2f bf f8 stb %i1, [ %fp + -8 ] _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 40009b24: 40 00 08 61 call 4000bca8 <_User_extensions_Iterate> 40009b28: f4 27 bf fc st %i2, [ %fp + -4 ] _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; 40009b2c: 05 10 00 81 sethi %hi(0x40020400), %g2 <== NOT EXECUTED 40009b30: 82 10 a3 ac or %g2, 0x3ac, %g1 ! 400207ac <_Internal_errors_What_happened><== NOT EXECUTED 40009b34: f0 20 a3 ac st %i0, [ %g2 + 0x3ac ] <== NOT EXECUTED _Internal_errors_What_happened.is_internal = is_internal; 40009b38: f2 28 60 04 stb %i1, [ %g1 + 4 ] <== NOT EXECUTED _Internal_errors_What_happened.the_error = the_error; 40009b3c: f4 20 60 08 st %i2, [ %g1 + 8 ] <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 40009b40: 84 10 20 05 mov 5, %g2 <== NOT EXECUTED 40009b44: 03 10 00 81 sethi %hi(0x40020400), %g1 <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 40009b48: 7f ff e2 62 call 400024d0 <== NOT EXECUTED 40009b4c: c4 20 63 b8 st %g2, [ %g1 + 0x3b8 ] ! 400207b8 <_System_state_Current><== NOT EXECUTED 40009b50: 82 10 00 08 mov %o0, %g1 <== NOT EXECUTED 40009b54: 30 80 00 00 b,a 40009b54 <_Internal_error_Occurred+0x48> <== NOT EXECUTED =============================================================================== 40009bc4 <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { 40009bc4: 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 ) 40009bc8: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 40009bcc: 80 a0 60 00 cmp %g1, 0 40009bd0: 02 80 00 26 be 40009c68 <_Objects_Allocate+0xa4> <== NEVER TAKEN 40009bd4: ba 10 00 18 mov %i0, %i5 /* * 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 ); 40009bd8: b8 06 20 20 add %i0, 0x20, %i4 40009bdc: 7f ff fd 4c call 4000910c <_Chain_Get> 40009be0: 90 10 00 1c mov %i4, %o0 if ( information->auto_extend ) { 40009be4: c2 0f 60 12 ldub [ %i5 + 0x12 ], %g1 40009be8: 80 a0 60 00 cmp %g1, 0 40009bec: 02 80 00 16 be 40009c44 <_Objects_Allocate+0x80> 40009bf0: 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 ) { 40009bf4: 80 a2 20 00 cmp %o0, 0 40009bf8: 02 80 00 15 be 40009c4c <_Objects_Allocate+0x88> 40009bfc: 01 00 00 00 nop } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 40009c00: c4 07 60 08 ld [ %i5 + 8 ], %g2 40009c04: d0 06 20 08 ld [ %i0 + 8 ], %o0 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 40009c08: d2 17 60 14 lduh [ %i5 + 0x14 ], %o1 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 40009c0c: 03 00 00 3f sethi %hi(0xfc00), %g1 40009c10: 82 10 63 ff or %g1, 0x3ff, %g1 ! ffff 40009c14: 90 0a 00 01 and %o0, %g1, %o0 40009c18: 82 08 80 01 and %g2, %g1, %g1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 40009c1c: 40 00 3f 96 call 40019a74 <.udiv> 40009c20: 90 22 00 01 sub %o0, %g1, %o0 information->inactive_per_block[ block ]--; 40009c24: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 40009c28: 91 2a 20 02 sll %o0, 2, %o0 40009c2c: c6 00 40 08 ld [ %g1 + %o0 ], %g3 information->inactive--; 40009c30: 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 ]--; 40009c34: 86 00 ff ff add %g3, -1, %g3 40009c38: c6 20 40 08 st %g3, [ %g1 + %o0 ] information->inactive--; 40009c3c: 82 00 bf ff add %g2, -1, %g1 40009c40: c2 37 60 2c sth %g1, [ %i5 + 0x2c ] ); } #endif return the_object; } 40009c44: 81 c7 e0 08 ret 40009c48: 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 ); 40009c4c: 40 00 00 10 call 40009c8c <_Objects_Extend_information> 40009c50: 90 10 00 1d mov %i5, %o0 the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 40009c54: 7f ff fd 2e call 4000910c <_Chain_Get> 40009c58: 90 10 00 1c mov %i4, %o0 } if ( the_object ) { 40009c5c: b0 92 20 00 orcc %o0, 0, %i0 40009c60: 32 bf ff e9 bne,a 40009c04 <_Objects_Allocate+0x40> 40009c64: c4 07 60 08 ld [ %i5 + 8 ], %g2 * 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 ) return NULL; 40009c68: 81 c7 e0 08 ret 40009c6c: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 40009c8c <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 40009c8c: 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 ) 40009c90: f2 06 20 34 ld [ %i0 + 0x34 ], %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 ); 40009c94: e0 16 20 0a lduh [ %i0 + 0xa ], %l0 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 40009c98: 80 a6 60 00 cmp %i1, 0 40009c9c: 02 80 00 a1 be 40009f20 <_Objects_Extend_information+0x294> 40009ca0: e2 16 20 10 lduh [ %i0 + 0x10 ], %l1 block_count = 0; else { block_count = information->maximum / information->allocation_size; 40009ca4: f6 16 20 14 lduh [ %i0 + 0x14 ], %i3 40009ca8: a3 2c 60 10 sll %l1, 0x10, %l1 40009cac: 92 10 00 1b mov %i3, %o1 40009cb0: 40 00 3f 71 call 40019a74 <.udiv> 40009cb4: 91 34 60 10 srl %l1, 0x10, %o0 40009cb8: 91 2a 20 10 sll %o0, 0x10, %o0 40009cbc: b5 32 20 10 srl %o0, 0x10, %i2 for ( ; block < block_count; block++ ) { 40009cc0: 80 a6 a0 00 cmp %i2, 0 40009cc4: 02 80 00 af be 40009f80 <_Objects_Extend_information+0x2f4><== NEVER TAKEN 40009cc8: 90 10 00 1b mov %i3, %o0 if ( information->object_blocks[ block ] == NULL ) { 40009ccc: c2 06 40 00 ld [ %i1 ], %g1 40009cd0: 80 a0 60 00 cmp %g1, 0 40009cd4: 02 80 00 b1 be 40009f98 <_Objects_Extend_information+0x30c><== NEVER TAKEN 40009cd8: b8 10 00 10 mov %l0, %i4 * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 40009cdc: 10 80 00 06 b 40009cf4 <_Objects_Extend_information+0x68> 40009ce0: ba 10 20 00 clr %i5 block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { 40009ce4: c2 06 40 01 ld [ %i1 + %g1 ], %g1 40009ce8: 80 a0 60 00 cmp %g1, 0 40009cec: 22 80 00 08 be,a 40009d0c <_Objects_Extend_information+0x80> 40009cf0: b6 10 20 00 clr %i3 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 40009cf4: ba 07 60 01 inc %i5 if ( information->object_blocks[ block ] == NULL ) { do_extend = false; break; } else index_base += information->allocation_size; 40009cf8: b8 07 00 1b add %i4, %i3, %i4 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 40009cfc: 80 a6 80 1d cmp %i2, %i5 40009d00: 18 bf ff f9 bgu 40009ce4 <_Objects_Extend_information+0x58> 40009d04: 83 2f 60 02 sll %i5, 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; 40009d08: b6 10 20 01 mov 1, %i3 } else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 40009d0c: b3 34 60 10 srl %l1, 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 ) { 40009d10: 03 00 00 3f sethi %hi(0xfc00), %g1 } else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 40009d14: 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 ) { 40009d18: 82 10 63 ff or %g1, 0x3ff, %g1 40009d1c: 80 a6 40 01 cmp %i1, %g1 40009d20: 18 80 00 9c bgu 40009f90 <_Objects_Extend_information+0x304> 40009d24: 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; 40009d28: 40 00 3f 19 call 4001998c <.umul> 40009d2c: d2 06 20 18 ld [ %i0 + 0x18 ], %o1 if ( information->auto_extend ) { 40009d30: c2 0e 20 12 ldub [ %i0 + 0x12 ], %g1 40009d34: 80 a0 60 00 cmp %g1, 0 40009d38: 02 80 00 6d be 40009eec <_Objects_Extend_information+0x260> 40009d3c: 01 00 00 00 nop new_object_block = _Workspace_Allocate( block_size ); 40009d40: 40 00 09 33 call 4000c20c <_Workspace_Allocate> 40009d44: 01 00 00 00 nop if ( !new_object_block ) 40009d48: a2 92 20 00 orcc %o0, 0, %l1 40009d4c: 02 80 00 91 be 40009f90 <_Objects_Extend_information+0x304> 40009d50: 01 00 00 00 nop } /* * Do we need to grow the tables? */ if ( do_extend ) { 40009d54: 80 8e e0 ff btst 0xff, %i3 40009d58: 22 80 00 42 be,a 40009e60 <_Objects_Extend_information+0x1d4> 40009d5c: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { 40009d60: c2 0e 20 12 ldub [ %i0 + 0x12 ], %g1 */ /* * Up the block count and maximum */ block_count++; 40009d64: b6 06 a0 01 add %i2, 1, %i3 * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { 40009d68: 80 a0 60 00 cmp %g1, 0 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 40009d6c: 91 2e e0 01 sll %i3, 1, %o0 40009d70: 90 02 00 1b add %o0, %i3, %o0 ((maximum + minimum_index) * sizeof(Objects_Control *)); 40009d74: 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 *)) + 40009d78: 90 02 00 10 add %o0, %l0, %o0 ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { 40009d7c: 12 80 00 60 bne 40009efc <_Objects_Extend_information+0x270> 40009d80: 91 2a 20 02 sll %o0, 2, %o0 if ( !object_blocks ) { _Workspace_Free( new_object_block ); return; } } else { object_blocks = _Workspace_Allocate_or_fatal_error( block_size ); 40009d84: 40 00 09 30 call 4000c244 <_Workspace_Allocate_or_fatal_error> 40009d88: 01 00 00 00 nop 40009d8c: a4 10 00 08 mov %o0, %l2 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 40009d90: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( object_blocks, block_count * sizeof(void*) ); 40009d94: b7 2e e0 02 sll %i3, 2, %i3 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 40009d98: 80 a4 00 01 cmp %l0, %g1 40009d9c: a6 04 80 1b add %l2, %i3, %l3 40009da0: 0a 80 00 67 bcs 40009f3c <_Objects_Extend_information+0x2b0> 40009da4: b6 04 c0 1b add %l3, %i3, %i3 * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 40009da8: 85 2c 20 02 sll %l0, 2, %g2 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 40009dac: 80 a4 20 00 cmp %l0, 0 40009db0: 02 80 00 07 be 40009dcc <_Objects_Extend_information+0x140><== NEVER TAKEN 40009db4: 82 10 20 00 clr %g1 local_table[ index ] = NULL; 40009db8: c0 20 40 1b clr [ %g1 + %i3 ] 40009dbc: 82 00 60 04 add %g1, 4, %g1 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 40009dc0: 80 a0 40 02 cmp %g1, %g2 40009dc4: 32 bf ff fe bne,a 40009dbc <_Objects_Extend_information+0x130><== NEVER TAKEN 40009dc8: c0 20 40 1b clr [ %g1 + %i3 ] <== NOT EXECUTED 40009dcc: b5 2e a0 02 sll %i2, 2, %i2 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 40009dd0: c6 16 20 14 lduh [ %i0 + 0x14 ], %g3 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 40009dd4: c0 24 80 1a clr [ %l2 + %i2 ] inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 40009dd8: 82 07 00 03 add %i4, %g3, %g1 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 40009ddc: 80 a7 00 01 cmp %i4, %g1 40009de0: 1a 80 00 0b bcc 40009e0c <_Objects_Extend_information+0x180><== NEVER TAKEN 40009de4: c0 24 c0 1a clr [ %l3 + %i2 ] * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 40009de8: 85 2f 20 02 sll %i4, 2, %g2 40009dec: 87 28 e0 02 sll %g3, 2, %g3 40009df0: 84 06 c0 02 add %i3, %g2, %g2 40009df4: 82 10 20 00 clr %g1 inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 40009df8: c0 20 80 01 clr [ %g2 + %g1 ] 40009dfc: 82 00 60 04 add %g1, 4, %g1 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 40009e00: 80 a0 40 03 cmp %g1, %g3 40009e04: 32 bf ff fe bne,a 40009dfc <_Objects_Extend_information+0x170> 40009e08: c0 20 80 01 clr [ %g2 + %g1 ] index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 40009e0c: 7f ff e1 b1 call 400024d0 40009e10: 01 00 00 00 nop uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 40009e14: 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( 40009e18: c4 16 20 04 lduh [ %i0 + 4 ], %g2 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 40009e1c: f4 06 20 34 ld [ %i0 + 0x34 ], %i2 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; 40009e20: f2 36 20 10 sth %i1, [ %i0 + 0x10 ] 40009e24: 87 28 e0 18 sll %g3, 0x18, %g3 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 40009e28: 85 28 a0 1b sll %g2, 0x1b, %g2 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 40009e2c: e4 26 20 34 st %l2, [ %i0 + 0x34 ] information->inactive_per_block = inactive_per_block; 40009e30: e6 26 20 30 st %l3, [ %i0 + 0x30 ] information->local_table = local_table; 40009e34: f6 26 20 1c st %i3, [ %i0 + 0x1c ] uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 40009e38: 03 00 00 40 sethi %hi(0x10000), %g1 40009e3c: 82 10 c0 01 or %g3, %g1, %g1 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 40009e40: 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) | 40009e44: b2 10 40 19 or %g1, %i1, %i1 information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 40009e48: f2 26 20 0c st %i1, [ %i0 + 0xc ] information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 40009e4c: 7f ff e1 a5 call 400024e0 40009e50: 01 00 00 00 nop _Workspace_Free( old_tables ); 40009e54: 40 00 08 f6 call 4000c22c <_Workspace_Free> 40009e58: 90 10 00 1a mov %i2, %o0 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 40009e5c: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 40009e60: bb 2f 60 02 sll %i5, 2, %i5 40009e64: e2 20 40 1d st %l1, [ %g1 + %i5 ] /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 40009e68: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 40009e6c: d4 16 20 14 lduh [ %i0 + 0x14 ], %o2 40009e70: d2 00 40 1d ld [ %g1 + %i5 ], %o1 40009e74: d6 06 20 18 ld [ %i0 + 0x18 ], %o3 40009e78: 90 07 bf f4 add %fp, -12, %o0 40009e7c: 7f ff fc b4 call 4000914c <_Chain_Initialize> 40009e80: 35 00 00 40 sethi %hi(0x10000), %i2 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 40009e84: 10 80 00 0d b 40009eb8 <_Objects_Extend_information+0x22c> 40009e88: b6 06 20 20 add %i0, 0x20, %i3 the_object->id = _Objects_Build_id( 40009e8c: c6 16 20 04 lduh [ %i0 + 4 ], %g3 40009e90: 85 28 a0 18 sll %g2, 0x18, %g2 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 40009e94: 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) | 40009e98: 84 10 80 1a or %g2, %i2, %g2 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 40009e9c: 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) | 40009ea0: 84 10 80 1c or %g2, %i4, %g2 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 40009ea4: 90 10 00 1b mov %i3, %o0 40009ea8: 92 10 00 01 mov %g1, %o1 index++; 40009eac: b8 07 20 01 inc %i4 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 40009eb0: 7f ff fc 8c call 400090e0 <_Chain_Append> 40009eb4: 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 ) { 40009eb8: 7f ff fc 95 call 4000910c <_Chain_Get> 40009ebc: 90 07 bf f4 add %fp, -12, %o0 40009ec0: 82 92 20 00 orcc %o0, 0, %g1 40009ec4: 32 bf ff f2 bne,a 40009e8c <_Objects_Extend_information+0x200> 40009ec8: c4 06 00 00 ld [ %i0 ], %g2 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 40009ecc: c8 16 20 14 lduh [ %i0 + 0x14 ], %g4 40009ed0: c6 06 20 30 ld [ %i0 + 0x30 ], %g3 information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 40009ed4: c4 16 20 2c lduh [ %i0 + 0x2c ], %g2 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 40009ed8: c8 20 c0 1d st %g4, [ %g3 + %i5 ] information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 40009edc: 82 00 80 04 add %g2, %g4, %g1 index++; } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = 40009ee0: c2 36 20 2c sth %g1, [ %i0 + 0x2c ] 40009ee4: 81 c7 e0 08 ret 40009ee8: 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 ); 40009eec: 40 00 08 d6 call 4000c244 <_Workspace_Allocate_or_fatal_error> 40009ef0: 01 00 00 00 nop 40009ef4: 10 bf ff 98 b 40009d54 <_Objects_Extend_information+0xc8> 40009ef8: a2 10 00 08 mov %o0, %l1 */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { object_blocks = _Workspace_Allocate( block_size ); 40009efc: 40 00 08 c4 call 4000c20c <_Workspace_Allocate> 40009f00: 01 00 00 00 nop if ( !object_blocks ) { 40009f04: a4 92 20 00 orcc %o0, 0, %l2 40009f08: 32 bf ff a3 bne,a 40009d94 <_Objects_Extend_information+0x108> 40009f0c: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 _Workspace_Free( new_object_block ); 40009f10: 40 00 08 c7 call 4000c22c <_Workspace_Free> 40009f14: 90 10 00 11 mov %l1, %o0 40009f18: 81 c7 e0 08 ret 40009f1c: 81 e8 00 00 restore 40009f20: 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 ); 40009f24: b8 10 00 10 mov %l0, %i4 /* * 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; 40009f28: b6 10 20 01 mov 1, %i3 minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 40009f2c: ba 10 20 00 clr %i5 /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; 40009f30: b4 10 20 00 clr %i2 40009f34: 10 bf ff 76 b 40009d0c <_Objects_Extend_information+0x80> 40009f38: a3 2c 60 10 sll %l1, 0x10, %l1 /* * 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, 40009f3c: d2 06 20 34 ld [ %i0 + 0x34 ], %o1 information->object_blocks, block_count * sizeof(void*) ); 40009f40: b5 2e a0 02 sll %i2, 2, %i2 /* * 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, 40009f44: 90 10 00 12 mov %l2, %o0 40009f48: 40 00 1c cf call 40011284 40009f4c: 94 10 00 1a mov %i2, %o2 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 40009f50: d2 06 20 30 ld [ %i0 + 0x30 ], %o1 40009f54: 94 10 00 1a mov %i2, %o2 40009f58: 40 00 1c cb call 40011284 40009f5c: 90 10 00 13 mov %l3, %o0 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 40009f60: d4 16 20 10 lduh [ %i0 + 0x10 ], %o2 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 40009f64: d2 06 20 1c ld [ %i0 + 0x1c ], %o1 information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 40009f68: 94 02 80 10 add %o2, %l0, %o2 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 40009f6c: 90 10 00 1b mov %i3, %o0 40009f70: 40 00 1c c5 call 40011284 40009f74: 95 2a a0 02 sll %o2, 2, %o2 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 40009f78: 10 bf ff 97 b 40009dd4 <_Objects_Extend_information+0x148> 40009f7c: c6 16 20 14 lduh [ %i0 + 0x14 ], %g3 /* * 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 ); 40009f80: b8 10 00 10 mov %l0, %i4 <== 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; 40009f84: b6 10 20 01 mov 1, %i3 <== NOT EXECUTED minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 40009f88: 10 bf ff 61 b 40009d0c <_Objects_Extend_information+0x80> <== NOT EXECUTED 40009f8c: ba 10 20 00 clr %i5 <== NOT EXECUTED 40009f90: 81 c7 e0 08 ret 40009f94: 81 e8 00 00 restore else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { do_extend = false; 40009f98: b6 10 20 00 clr %i3 <== NOT EXECUTED * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 40009f9c: 10 bf ff 5c b 40009d0c <_Objects_Extend_information+0x80> <== NOT EXECUTED 40009fa0: ba 10 20 00 clr %i5 <== NOT EXECUTED =============================================================================== 4000a054 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 4000a054: 9d e3 bf a0 save %sp, -96, %sp Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 4000a058: 80 a6 60 00 cmp %i1, 0 4000a05c: 02 80 00 19 be 4000a0c0 <_Objects_Get_information+0x6c> 4000a060: 01 00 00 00 nop /* * 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 ); 4000a064: 40 00 12 b2 call 4000eb2c <_Objects_API_maximum_class> 4000a068: 90 10 00 18 mov %i0, %o0 if ( the_class_api_maximum == 0 ) 4000a06c: 80 a2 20 00 cmp %o0, 0 4000a070: 02 80 00 14 be 4000a0c0 <_Objects_Get_information+0x6c> 4000a074: 80 a2 00 19 cmp %o0, %i1 return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 4000a078: 0a 80 00 12 bcs 4000a0c0 <_Objects_Get_information+0x6c> 4000a07c: 03 10 00 80 sethi %hi(0x40020000), %g1 return NULL; if ( !_Objects_Information_table[ the_api ] ) 4000a080: b1 2e 20 02 sll %i0, 2, %i0 4000a084: 82 10 62 14 or %g1, 0x214, %g1 4000a088: c2 00 40 18 ld [ %g1 + %i0 ], %g1 4000a08c: 80 a0 60 00 cmp %g1, 0 4000a090: 02 80 00 0c be 4000a0c0 <_Objects_Get_information+0x6c> <== NEVER TAKEN 4000a094: b3 2e 60 02 sll %i1, 2, %i1 return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 4000a098: f0 00 40 19 ld [ %g1 + %i1 ], %i0 if ( !info ) 4000a09c: 80 a6 20 00 cmp %i0, 0 4000a0a0: 02 80 00 08 be 4000a0c0 <_Objects_Get_information+0x6c> <== NEVER TAKEN 4000a0a4: 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 ) 4000a0a8: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 4000a0ac: 80 a0 60 00 cmp %g1, 0 4000a0b0: 02 80 00 04 be 4000a0c0 <_Objects_Get_information+0x6c> 4000a0b4: 01 00 00 00 nop return NULL; #endif return info; } 4000a0b8: 81 c7 e0 08 ret 4000a0bc: 81 e8 00 00 restore { Objects_Information *info; int the_class_api_maximum; if ( !the_class ) return NULL; 4000a0c0: 81 c7 e0 08 ret 4000a0c4: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 400185e8 <_Objects_Get_name_as_string>: char *_Objects_Get_name_as_string( Objects_Id id, size_t length, char *name ) { 400185e8: 9d e3 bf 90 save %sp, -112, %sp char lname[5]; Objects_Control *the_object; Objects_Locations location; Objects_Id tmpId; if ( length == 0 ) 400185ec: 80 a6 60 00 cmp %i1, 0 400185f0: 02 80 00 11 be 40018634 <_Objects_Get_name_as_string+0x4c> 400185f4: 80 a6 a0 00 cmp %i2, 0 return NULL; if ( name == NULL ) 400185f8: 02 80 00 0f be 40018634 <_Objects_Get_name_as_string+0x4c> 400185fc: ba 96 20 00 orcc %i0, 0, %i5 return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 40018600: 02 80 00 3d be 400186f4 <_Objects_Get_name_as_string+0x10c> 40018604: 03 10 00 cf sethi %hi(0x40033c00), %g1 information = _Objects_Get_information_id( tmpId ); 40018608: 7f ff e0 5e call 40010780 <_Objects_Get_information_id> 4001860c: 90 10 00 1d mov %i5, %o0 if ( !information ) 40018610: b8 92 20 00 orcc %o0, 0, %i4 40018614: 02 80 00 08 be 40018634 <_Objects_Get_name_as_string+0x4c> 40018618: 92 10 00 1d mov %i5, %o1 return NULL; the_object = _Objects_Get( information, tmpId, &location ); 4001861c: 7f ff e0 99 call 40010880 <_Objects_Get> 40018620: 94 07 bf f4 add %fp, -12, %o2 switch ( location ) { 40018624: c2 07 bf f4 ld [ %fp + -12 ], %g1 40018628: 80 a0 60 00 cmp %g1, 0 4001862c: 22 80 00 05 be,a 40018640 <_Objects_Get_name_as_string+0x58> 40018630: c2 0f 20 38 ldub [ %i4 + 0x38 ], %g1 #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* not supported */ #endif case OBJECTS_ERROR: return NULL; 40018634: b4 10 20 00 clr %i2 _Thread_Enable_dispatch(); return name; } return NULL; /* unreachable path */ } 40018638: 81 c7 e0 08 ret 4001863c: 91 e8 00 1a restore %g0, %i2, %o0 return NULL; case OBJECTS_LOCAL: #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 40018640: 80 a0 60 00 cmp %g1, 0 40018644: 12 80 00 2f bne 40018700 <_Objects_Get_name_as_string+0x118> 40018648: c2 02 20 0c ld [ %o0 + 0xc ], %g1 } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; 4001864c: 89 30 60 18 srl %g1, 0x18, %g4 lname[ 1 ] = (u32_name >> 16) & 0xff; 40018650: 87 30 60 10 srl %g1, 0x10, %g3 lname[ 2 ] = (u32_name >> 8) & 0xff; 40018654: 85 30 60 08 srl %g1, 8, %g2 lname[ 3 ] = (u32_name >> 0) & 0xff; 40018658: c2 2f bf fb stb %g1, [ %fp + -5 ] lname[ 4 ] = '\0'; 4001865c: c0 2f bf fc clrb [ %fp + -4 ] } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; 40018660: c8 2f bf f8 stb %g4, [ %fp + -8 ] lname[ 1 ] = (u32_name >> 16) & 0xff; 40018664: c6 2f bf f9 stb %g3, [ %fp + -7 ] lname[ 2 ] = (u32_name >> 8) & 0xff; 40018668: c4 2f bf fa stb %g2, [ %fp + -6 ] lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; s = lname; 4001866c: 82 07 bf f8 add %fp, -8, %g1 } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 40018670: 80 a6 60 01 cmp %i1, 1 40018674: 02 80 00 27 be 40018710 <_Objects_Get_name_as_string+0x128><== NEVER TAKEN 40018678: 86 10 00 1a mov %i2, %g3 4001867c: c6 48 40 00 ldsb [ %g1 ], %g3 40018680: 80 a0 e0 00 cmp %g3, 0 40018684: 02 80 00 22 be 4001870c <_Objects_Get_name_as_string+0x124> 40018688: c4 08 40 00 ldub [ %g1 ], %g2 * 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( 4001868c: b6 06 7f ff add %i1, -1, %i3 40018690: 39 10 00 c9 sethi %hi(0x40032400), %i4 40018694: b6 00 40 1b add %g1, %i3, %i3 40018698: 86 10 00 1a mov %i2, %g3 4001869c: 10 80 00 06 b 400186b4 <_Objects_Get_name_as_string+0xcc> 400186a0: b8 17 20 58 or %i4, 0x58, %i4 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 400186a4: c8 48 40 00 ldsb [ %g1 ], %g4 400186a8: 80 a1 20 00 cmp %g4, 0 400186ac: 02 80 00 0e be 400186e4 <_Objects_Get_name_as_string+0xfc> 400186b0: c4 08 40 00 ldub [ %g1 ], %g2 *d = (isprint((unsigned char)*s)) ? *s : '*'; 400186b4: fa 07 00 00 ld [ %i4 ], %i5 400186b8: 88 08 a0 ff and %g2, 0xff, %g4 400186bc: 88 07 40 04 add %i5, %g4, %g4 400186c0: c8 49 20 01 ldsb [ %g4 + 1 ], %g4 400186c4: 80 89 20 97 btst 0x97, %g4 400186c8: 12 80 00 03 bne 400186d4 <_Objects_Get_name_as_string+0xec> 400186cc: 82 00 60 01 inc %g1 400186d0: 84 10 20 2a mov 0x2a, %g2 400186d4: c4 28 c0 00 stb %g2, [ %g3 ] s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 400186d8: 80 a0 40 1b cmp %g1, %i3 400186dc: 12 bf ff f2 bne 400186a4 <_Objects_Get_name_as_string+0xbc> 400186e0: 86 00 e0 01 inc %g3 *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; _Thread_Enable_dispatch(); 400186e4: 7f ff e4 73 call 400118b0 <_Thread_Enable_dispatch> 400186e8: c0 28 c0 00 clrb [ %g3 ] return name; } return NULL; /* unreachable path */ } 400186ec: 81 c7 e0 08 ret 400186f0: 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; 400186f4: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 400186f8: 10 bf ff c4 b 40018608 <_Objects_Get_name_as_string+0x20> 400186fc: fa 00 60 08 ld [ %g1 + 8 ], %i5 lname[ 4 ] = '\0'; s = lname; } d = name; if ( s ) { 40018700: 80 a0 60 00 cmp %g1, 0 40018704: 12 bf ff dc bne 40018674 <_Objects_Get_name_as_string+0x8c> 40018708: 80 a6 60 01 cmp %i1, 1 for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { *d = (isprint((unsigned char)*s)) ? *s : '*'; 4001870c: 86 10 00 1a mov %i2, %g3 } } *d = '\0'; _Thread_Enable_dispatch(); 40018710: 7f ff e4 68 call 400118b0 <_Thread_Enable_dispatch> 40018714: c0 28 c0 00 clrb [ %g3 ] 40018718: 30 bf ff f5 b,a 400186ec <_Objects_Get_name_as_string+0x104> =============================================================================== 4001b3f8 <_Objects_Get_next>: Objects_Information *information, Objects_Id id, Objects_Locations *location_p, Objects_Id *next_id_p ) { 4001b3f8: 9d e3 bf a0 save %sp, -96, %sp Objects_Control *object; Objects_Id next_id; if ( !information ) 4001b3fc: 80 a6 20 00 cmp %i0, 0 4001b400: 02 80 00 29 be 4001b4a4 <_Objects_Get_next+0xac> 4001b404: 80 a6 a0 00 cmp %i2, 0 return NULL; if ( !location_p ) 4001b408: 02 80 00 27 be 4001b4a4 <_Objects_Get_next+0xac> 4001b40c: 80 a6 e0 00 cmp %i3, 0 return NULL; if ( !next_id_p ) 4001b410: 02 80 00 25 be 4001b4a4 <_Objects_Get_next+0xac> 4001b414: 83 2e 60 10 sll %i1, 0x10, %g1 return NULL; if (_Objects_Get_index(id) == OBJECTS_ID_INITIAL_INDEX) 4001b418: 80 a0 60 00 cmp %g1, 0 4001b41c: 22 80 00 13 be,a 4001b468 <_Objects_Get_next+0x70> 4001b420: 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) 4001b424: c4 16 20 10 lduh [ %i0 + 0x10 ], %g2 4001b428: 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); 4001b42c: 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) 4001b430: 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); 4001b434: 90 10 00 18 mov %i0, %o0 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) 4001b438: 80 a0 80 01 cmp %g2, %g1 4001b43c: 0a 80 00 13 bcs 4001b488 <_Objects_Get_next+0x90> 4001b440: 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); 4001b444: 7f ff d5 0f call 40010880 <_Objects_Get> 4001b448: b2 06 60 01 inc %i1 next_id++; } while (*location_p != OBJECTS_LOCAL); 4001b44c: c2 06 80 00 ld [ %i2 ], %g1 4001b450: 80 a0 60 00 cmp %g1, 0 4001b454: 32 bf ff f5 bne,a 4001b428 <_Objects_Get_next+0x30> 4001b458: c4 16 20 10 lduh [ %i0 + 0x10 ], %g2 *next_id_p = next_id; 4001b45c: f2 26 c0 00 st %i1, [ %i3 ] return object; final: *next_id_p = OBJECTS_ID_FINAL; return 0; } 4001b460: 81 c7 e0 08 ret 4001b464: 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) 4001b468: c4 16 20 10 lduh [ %i0 + 0x10 ], %g2 4001b46c: 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); 4001b470: 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) 4001b474: 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); 4001b478: 90 10 00 18 mov %i0, %o0 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) 4001b47c: 80 a0 80 01 cmp %g2, %g1 4001b480: 1a bf ff f1 bcc 4001b444 <_Objects_Get_next+0x4c> <== ALWAYS TAKEN 4001b484: 94 10 00 1a mov %i2, %o2 { *location_p = OBJECTS_ERROR; 4001b488: 82 10 20 01 mov 1, %g1 4001b48c: c2 26 80 00 st %g1, [ %i2 ] *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; return 0; 4001b490: 90 10 20 00 clr %o0 *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; 4001b494: 82 10 3f ff mov -1, %g1 4001b498: c2 26 c0 00 st %g1, [ %i3 ] return 0; } 4001b49c: 81 c7 e0 08 ret 4001b4a0: 91 e8 00 08 restore %g0, %o0, %o0 { Objects_Control *object; Objects_Id next_id; if ( !information ) return NULL; 4001b4a4: 10 bf ff ef b 4001b460 <_Objects_Get_next+0x68> 4001b4a8: 90 10 20 00 clr %o0 =============================================================================== 4001b63c <_Objects_Get_no_protection>: /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 4001b63c: c4 02 20 08 ld [ %o0 + 8 ], %g2 if ( information->maximum >= index ) { 4001b640: c2 12 20 10 lduh [ %o0 + 0x10 ], %g1 /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 4001b644: 92 22 40 02 sub %o1, %g2, %o1 4001b648: 92 02 60 01 inc %o1 if ( information->maximum >= index ) { 4001b64c: 80 a2 40 01 cmp %o1, %g1 4001b650: 18 80 00 09 bgu 4001b674 <_Objects_Get_no_protection+0x38> 4001b654: 93 2a 60 02 sll %o1, 2, %o1 if ( (the_object = information->local_table[ index ]) != NULL ) { 4001b658: c2 02 20 1c ld [ %o0 + 0x1c ], %g1 4001b65c: d0 00 40 09 ld [ %g1 + %o1 ], %o0 4001b660: 80 a2 20 00 cmp %o0, 0 4001b664: 02 80 00 05 be 4001b678 <_Objects_Get_no_protection+0x3c> <== NEVER TAKEN 4001b668: 82 10 20 01 mov 1, %g1 *location = OBJECTS_LOCAL; return the_object; 4001b66c: 81 c3 e0 08 retl 4001b670: c0 22 80 00 clr [ %o2 ] /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 4001b674: 82 10 20 01 mov 1, %g1 return NULL; 4001b678: 90 10 20 00 clr %o0 } 4001b67c: 81 c3 e0 08 retl 4001b680: c2 22 80 00 st %g1, [ %o2 ] =============================================================================== 400108f4 <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 400108f4: 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; 400108f8: 80 a6 20 00 cmp %i0, 0 400108fc: 12 80 00 06 bne 40010914 <_Objects_Id_to_name+0x20> 40010900: 83 36 20 18 srl %i0, 0x18, %g1 40010904: 03 10 00 cf sethi %hi(0x40033c00), %g1 40010908: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 ! 40033c10 <_Per_CPU_Information+0x10> 4001090c: f0 00 60 08 ld [ %g1 + 8 ], %i0 40010910: 83 36 20 18 srl %i0, 0x18, %g1 40010914: 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 ) 40010918: 84 00 7f ff add %g1, -1, %g2 4001091c: 80 a0 a0 02 cmp %g2, 2 40010920: 18 80 00 11 bgu 40010964 <_Objects_Id_to_name+0x70> 40010924: 83 28 60 02 sll %g1, 2, %g1 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 40010928: 05 10 00 cd sethi %hi(0x40033400), %g2 4001092c: 84 10 a2 14 or %g2, 0x214, %g2 ! 40033614 <_Objects_Information_table> 40010930: c2 00 80 01 ld [ %g2 + %g1 ], %g1 40010934: 80 a0 60 00 cmp %g1, 0 40010938: 02 80 00 0b be 40010964 <_Objects_Id_to_name+0x70> 4001093c: 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 ]; 40010940: 85 28 a0 02 sll %g2, 2, %g2 40010944: d0 00 40 02 ld [ %g1 + %g2 ], %o0 if ( !information ) 40010948: 80 a2 20 00 cmp %o0, 0 4001094c: 02 80 00 06 be 40010964 <_Objects_Id_to_name+0x70> <== NEVER TAKEN 40010950: 01 00 00 00 nop return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 40010954: c2 0a 20 38 ldub [ %o0 + 0x38 ], %g1 40010958: 80 a0 60 00 cmp %g1, 0 4001095c: 02 80 00 04 be 4001096c <_Objects_Id_to_name+0x78> <== ALWAYS TAKEN 40010960: 92 10 00 18 mov %i0, %o1 tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 40010964: 81 c7 e0 08 ret 40010968: 91 e8 20 03 restore %g0, 3, %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 ); 4001096c: 7f ff ff c5 call 40010880 <_Objects_Get> 40010970: 94 07 bf fc add %fp, -4, %o2 if ( !the_object ) 40010974: 80 a2 20 00 cmp %o0, 0 40010978: 02 bf ff fb be 40010964 <_Objects_Id_to_name+0x70> 4001097c: 01 00 00 00 nop return OBJECTS_INVALID_ID; *name = the_object->name; 40010980: c2 02 20 0c ld [ %o0 + 0xc ], %g1 _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 40010984: b0 10 20 00 clr %i0 the_object = _Objects_Get( information, tmpId, &ignored_location ); if ( !the_object ) return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); 40010988: 40 00 03 ca call 400118b0 <_Thread_Enable_dispatch> 4001098c: c2 26 40 00 st %g1, [ %i1 ] 40010990: 81 c7 e0 08 ret 40010994: 81 e8 00 00 restore =============================================================================== 4000a364 <_Objects_Shrink_information>: #include void _Objects_Shrink_information( Objects_Information *information ) { 4000a364: 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 ); 4000a368: f8 16 20 0a lduh [ %i0 + 0xa ], %i4 block_count = (information->maximum - index_base) / 4000a36c: f6 16 20 14 lduh [ %i0 + 0x14 ], %i3 4000a370: d0 16 20 10 lduh [ %i0 + 0x10 ], %o0 4000a374: 92 10 00 1b mov %i3, %o1 4000a378: 40 00 3d bf call 40019a74 <.udiv> 4000a37c: 90 22 00 1c sub %o0, %i4, %o0 information->allocation_size; for ( block = 0; block < block_count; block++ ) { 4000a380: 80 a2 20 00 cmp %o0, 0 4000a384: 02 80 00 36 be 4000a45c <_Objects_Shrink_information+0xf8><== NEVER TAKEN 4000a388: 01 00 00 00 nop if ( information->inactive_per_block[ block ] == 4000a38c: c8 06 20 30 ld [ %i0 + 0x30 ], %g4 4000a390: c2 01 00 00 ld [ %g4 ], %g1 4000a394: 80 a6 c0 01 cmp %i3, %g1 4000a398: 02 80 00 0f be 4000a3d4 <_Objects_Shrink_information+0x70><== NEVER TAKEN 4000a39c: 82 10 20 00 clr %g1 4000a3a0: 10 80 00 07 b 4000a3bc <_Objects_Shrink_information+0x58> 4000a3a4: ba 10 20 04 mov 4, %i5 4000a3a8: c4 01 00 1d ld [ %g4 + %i5 ], %g2 4000a3ac: 80 a6 c0 02 cmp %i3, %g2 4000a3b0: 02 80 00 0a be 4000a3d8 <_Objects_Shrink_information+0x74> 4000a3b4: 86 07 60 04 add %i5, 4, %g3 4000a3b8: ba 10 00 03 mov %g3, %i5 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 4000a3bc: 82 00 60 01 inc %g1 4000a3c0: 80 a0 40 08 cmp %g1, %o0 4000a3c4: 12 bf ff f9 bne 4000a3a8 <_Objects_Shrink_information+0x44> 4000a3c8: b8 07 00 1b add %i4, %i3, %i4 4000a3cc: 81 c7 e0 08 ret 4000a3d0: 81 e8 00 00 restore if ( information->inactive_per_block[ block ] == 4000a3d4: ba 10 20 00 clr %i5 <== NOT EXECUTED * 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 ); 4000a3d8: 35 00 00 3f sethi %hi(0xfc00), %i2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000a3dc: d0 06 20 20 ld [ %i0 + 0x20 ], %o0 4000a3e0: 10 80 00 05 b 4000a3f4 <_Objects_Shrink_information+0x90> 4000a3e4: b4 16 a3 ff or %i2, 0x3ff, %i2 if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); } } while ( the_object ); 4000a3e8: 90 96 e0 00 orcc %i3, 0, %o0 4000a3ec: 22 80 00 12 be,a 4000a434 <_Objects_Shrink_information+0xd0> 4000a3f0: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 * 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 ); 4000a3f4: c2 02 20 08 ld [ %o0 + 8 ], %g1 4000a3f8: 82 08 40 1a and %g1, %i2, %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) && 4000a3fc: 80 a0 40 1c cmp %g1, %i4 4000a400: 0a bf ff fa bcs 4000a3e8 <_Objects_Shrink_information+0x84> 4000a404: f6 02 00 00 ld [ %o0 ], %i3 (index < (index_base + information->allocation_size))) { 4000a408: c4 16 20 14 lduh [ %i0 + 0x14 ], %g2 4000a40c: 84 07 00 02 add %i4, %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) && 4000a410: 80 a0 40 02 cmp %g1, %g2 4000a414: 3a bf ff f6 bcc,a 4000a3ec <_Objects_Shrink_information+0x88> 4000a418: 90 96 e0 00 orcc %i3, 0, %o0 (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); 4000a41c: 40 00 10 5f call 4000e598 <_Chain_Extract> 4000a420: 01 00 00 00 nop } } while ( the_object ); 4000a424: 90 96 e0 00 orcc %i3, 0, %o0 4000a428: 32 bf ff f4 bne,a 4000a3f8 <_Objects_Shrink_information+0x94><== ALWAYS TAKEN 4000a42c: c2 02 20 08 ld [ %o0 + 8 ], %g1 /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 4000a430: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 <== NOT EXECUTED 4000a434: 40 00 07 7e call 4000c22c <_Workspace_Free> 4000a438: d0 00 40 1d ld [ %g1 + %i5 ], %o0 information->object_blocks[ block ] = NULL; 4000a43c: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 4000a440: 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; 4000a444: c0 20 40 1d clr [ %g1 + %i5 ] information->inactive_per_block[ block ] = 0; 4000a448: c6 06 20 30 ld [ %i0 + 0x30 ], %g3 information->inactive -= information->allocation_size; 4000a44c: 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; 4000a450: c0 20 c0 1d clr [ %g3 + %i5 ] information->inactive -= information->allocation_size; 4000a454: 82 20 80 01 sub %g2, %g1, %g1 4000a458: c2 36 20 2c sth %g1, [ %i0 + 0x2c ] return; 4000a45c: 81 c7 e0 08 ret 4000a460: 81 e8 00 00 restore =============================================================================== 40010114 <_POSIX_Keys_Run_destructors>: */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { 40010114: 9d e3 bf a0 save %sp, -96, %sp Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id ); 40010118: c2 06 20 08 ld [ %i0 + 8 ], %g1 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 4001011c: 35 00 00 3f sethi %hi(0xfc00), %i2 40010120: b3 30 60 18 srl %g1, 0x18, %i1 40010124: b4 16 a3 ff or %i2, 0x3ff, %i2 40010128: b2 0e 60 07 and %i1, 7, %i1 4001012c: b4 08 40 1a and %g1, %i2, %i2 40010130: b2 06 60 04 add %i1, 4, %i1 40010134: 3b 10 00 81 sethi %hi(0x40020400), %i5 40010138: b5 2e a0 02 sll %i2, 2, %i2 4001013c: ba 17 62 8c or %i5, 0x28c, %i5 40010140: b3 2e 60 02 sll %i1, 2, %i1 Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 40010144: c2 17 60 10 lduh [ %i5 + 0x10 ], %g1 40010148: 80 a0 60 00 cmp %g1, 0 4001014c: 02 80 00 21 be 400101d0 <_POSIX_Keys_Run_destructors+0xbc> 40010150: b8 10 20 01 mov 1, %i4 40010154: 86 10 20 01 mov 1, %g3 40010158: b6 10 00 01 mov %g1, %i3 POSIX_Keys_Control *key = (POSIX_Keys_Control *) 4001015c: c8 07 60 1c ld [ %i5 + 0x1c ], %g4 _POSIX_Keys_Information.local_table [ index ]; 40010160: 85 2f 20 10 sll %i4, 0x10, %g2 Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) 40010164: 85 30 a0 0e srl %g2, 0xe, %g2 40010168: c4 01 00 02 ld [ %g4 + %g2 ], %g2 _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { 4001016c: 80 a0 a0 00 cmp %g2, 0 40010170: 02 80 00 10 be 400101b0 <_POSIX_Keys_Run_destructors+0x9c> 40010174: 82 00 80 19 add %g2, %i1, %g1 40010178: c8 00 a0 10 ld [ %g2 + 0x10 ], %g4 4001017c: 80 a1 20 00 cmp %g4, 0 40010180: 22 80 00 0d be,a 400101b4 <_POSIX_Keys_Run_destructors+0xa0> 40010184: b8 07 20 01 inc %i4 void *value = key->Values [ thread_api ][ thread_index ]; 40010188: c8 00 60 04 ld [ %g1 + 4 ], %g4 4001018c: d0 01 00 1a ld [ %g4 + %i2 ], %o0 if ( value != NULL ) { 40010190: 80 a2 20 00 cmp %o0, 0 40010194: 22 80 00 08 be,a 400101b4 <_POSIX_Keys_Run_destructors+0xa0><== ALWAYS TAKEN 40010198: b8 07 20 01 inc %i4 key->Values [ thread_api ][ thread_index ] = NULL; 4001019c: c0 21 00 1a clr [ %g4 + %i2 ] <== NOT EXECUTED (*key->destructor)( value ); 400101a0: c2 00 a0 10 ld [ %g2 + 0x10 ], %g1 <== NOT EXECUTED 400101a4: 9f c0 40 00 call %g1 <== NOT EXECUTED 400101a8: 01 00 00 00 nop <== NOT EXECUTED done = false; 400101ac: 86 10 20 00 clr %g3 ! 0 <== NOT EXECUTED Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 400101b0: b8 07 20 01 inc %i4 400101b4: 85 2f 20 10 sll %i4, 0x10, %g2 400101b8: 85 30 a0 10 srl %g2, 0x10, %g2 400101bc: 80 a6 c0 02 cmp %i3, %g2 400101c0: 1a bf ff e7 bcc 4001015c <_POSIX_Keys_Run_destructors+0x48> 400101c4: 80 88 e0 ff btst 0xff, %g3 * number of iterations. An infinite loop may happen if destructors set * thread specific data. This can be considered dubious. * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { 400101c8: 22 bf ff e0 be,a 40010148 <_POSIX_Keys_Run_destructors+0x34><== NEVER TAKEN 400101cc: c2 17 60 10 lduh [ %i5 + 0x10 ], %g1 <== NOT EXECUTED 400101d0: 81 c7 e0 08 ret 400101d4: 81 e8 00 00 restore =============================================================================== 4000d428 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 4000d428: 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( 4000d42c: 11 10 00 a8 sethi %hi(0x4002a000), %o0 4000d430: 92 10 00 18 mov %i0, %o1 4000d434: 90 12 23 b0 or %o0, 0x3b0, %o0 4000d438: 40 00 0d 8d call 40010a6c <_Objects_Get> 4000d43c: 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 ) { 4000d440: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000d444: 80 a0 60 00 cmp %g1, 0 4000d448: 22 80 00 08 be,a 4000d468 <_POSIX_Message_queue_Receive_support+0x40> 4000d44c: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4000d450: 40 00 29 59 call 400179b4 <__errno> 4000d454: b0 10 3f ff mov -1, %i0 4000d458: 82 10 20 09 mov 9, %g1 4000d45c: c2 22 00 00 st %g1, [ %o0 ] } 4000d460: 81 c7 e0 08 ret 4000d464: 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 ) { 4000d468: 84 08 60 03 and %g1, 3, %g2 4000d46c: 80 a0 a0 01 cmp %g2, 1 4000d470: 02 80 00 39 be 4000d554 <_POSIX_Message_queue_Receive_support+0x12c> 4000d474: 01 00 00 00 nop _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 4000d478: d0 02 20 10 ld [ %o0 + 0x10 ], %o0 if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 4000d47c: c4 02 20 68 ld [ %o0 + 0x68 ], %g2 4000d480: 80 a0 80 1a cmp %g2, %i2 4000d484: 18 80 00 23 bgu 4000d510 <_POSIX_Message_queue_Receive_support+0xe8> 4000d488: 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; 4000d48c: c4 27 bf fc st %g2, [ %fp + -4 ] /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4000d490: 80 a7 20 00 cmp %i4, 0 4000d494: 12 80 00 1b bne 4000d500 <_POSIX_Message_queue_Receive_support+0xd8> 4000d498: 98 10 20 00 clr %o4 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4000d49c: 9a 10 00 1d mov %i5, %o5 4000d4a0: 90 02 20 1c add %o0, 0x1c, %o0 4000d4a4: 92 10 00 18 mov %i0, %o1 4000d4a8: 94 10 00 19 mov %i1, %o2 4000d4ac: 96 07 bf fc add %fp, -4, %o3 4000d4b0: 40 00 08 f2 call 4000f878 <_CORE_message_queue_Seize> 4000d4b4: 98 0b 20 01 and %o4, 1, %o4 &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 4000d4b8: 40 00 11 48 call 400119d8 <_Thread_Enable_dispatch> 4000d4bc: 3b 10 00 a9 sethi %hi(0x4002a400), %i5 if (msg_prio) { 4000d4c0: 80 a6 e0 00 cmp %i3, 0 *msg_prio = _POSIX_Message_queue_Priority_from_core( _Thread_Executing->Wait.count 4000d4c4: ba 17 60 30 or %i5, 0x30, %i5 do_wait, timeout ); _Thread_Enable_dispatch(); if (msg_prio) { 4000d4c8: 02 80 00 07 be 4000d4e4 <_POSIX_Message_queue_Receive_support+0xbc><== NEVER TAKEN 4000d4cc: c2 07 60 10 ld [ %i5 + 0x10 ], %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 (unsigned int) ((priority >= 0) ? priority : -priority); 4000d4d0: c6 00 60 24 ld [ %g1 + 0x24 ], %g3 4000d4d4: 85 38 e0 1f sra %g3, 0x1f, %g2 4000d4d8: 86 18 80 03 xor %g2, %g3, %g3 4000d4dc: 84 20 c0 02 sub %g3, %g2, %g2 *msg_prio = _POSIX_Message_queue_Priority_from_core( 4000d4e0: c4 26 c0 00 st %g2, [ %i3 ] _Thread_Executing->Wait.count ); } if ( !_Thread_Executing->Wait.return_code ) 4000d4e4: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 4000d4e8: 80 a0 60 00 cmp %g1, 0 4000d4ec: 12 80 00 11 bne 4000d530 <_POSIX_Message_queue_Receive_support+0x108> 4000d4f0: 01 00 00 00 nop return length_out; 4000d4f4: f0 07 bf fc ld [ %fp + -4 ], %i0 4000d4f8: 81 c7 e0 08 ret 4000d4fc: 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; 4000d500: 99 30 60 0e srl %g1, 0xe, %o4 4000d504: 98 1b 20 01 xor %o4, 1, %o4 4000d508: 10 bf ff e5 b 4000d49c <_POSIX_Message_queue_Receive_support+0x74> 4000d50c: 98 0b 20 01 and %o4, 1, %o4 } the_mq = the_mq_fd->Queue; if ( msg_len < the_mq->Message_queue.maximum_message_size ) { _Thread_Enable_dispatch(); 4000d510: 40 00 11 32 call 400119d8 <_Thread_Enable_dispatch> 4000d514: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one( EMSGSIZE ); 4000d518: 40 00 29 27 call 400179b4 <__errno> 4000d51c: 01 00 00 00 nop 4000d520: 82 10 20 7a mov 0x7a, %g1 ! 7a 4000d524: c2 22 00 00 st %g1, [ %o0 ] 4000d528: 81 c7 e0 08 ret 4000d52c: 81 e8 00 00 restore } if ( !_Thread_Executing->Wait.return_code ) return length_out; rtems_set_errno_and_return_minus_one( 4000d530: 40 00 29 21 call 400179b4 <__errno> 4000d534: b0 10 3f ff mov -1, %i0 4000d538: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000d53c: b8 10 00 08 mov %o0, %i4 4000d540: 40 00 00 a2 call 4000d7c8 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 4000d544: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 4000d548: d0 27 00 00 st %o0, [ %i4 ] 4000d54c: 81 c7 e0 08 ret 4000d550: 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(); 4000d554: 40 00 11 21 call 400119d8 <_Thread_Enable_dispatch> 4000d558: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one( EBADF ); 4000d55c: 40 00 29 16 call 400179b4 <__errno> 4000d560: 01 00 00 00 nop 4000d564: 82 10 20 09 mov 9, %g1 ! 9 4000d568: c2 22 00 00 st %g1, [ %o0 ] 4000d56c: 81 c7 e0 08 ret 4000d570: 81 e8 00 00 restore =============================================================================== 4000ffb0 <_POSIX_Semaphore_Create_support>: size_t name_len, int pshared, unsigned int value, POSIX_Semaphore_Control **the_sem ) { 4000ffb0: 9d e3 bf a0 save %sp, -96, %sp POSIX_Semaphore_Control *the_semaphore; CORE_semaphore_Attributes *the_sem_attr; char *name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) 4000ffb4: 80 a6 a0 00 cmp %i2, 0 4000ffb8: 12 80 00 2f bne 40010074 <_POSIX_Semaphore_Create_support+0xc4> 4000ffbc: 03 10 00 93 sethi %hi(0x40024c00), %g1 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4000ffc0: c4 00 60 b0 ld [ %g1 + 0xb0 ], %g2 ! 40024cb0 <_Thread_Dispatch_disable_level> ++level; 4000ffc4: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 4000ffc8: c4 20 60 b0 st %g2, [ %g1 + 0xb0 ] * _POSIX_Semaphore_Allocate */ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ) { return (POSIX_Semaphore_Control *) 4000ffcc: 35 10 00 93 sethi %hi(0x40024c00), %i2 4000ffd0: 7f ff ee 18 call 4000b830 <_Objects_Allocate> 4000ffd4: 90 16 a3 74 or %i2, 0x374, %o0 ! 40024f74 <_POSIX_Semaphore_Information> rtems_set_errno_and_return_minus_one( ENOSYS ); _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { 4000ffd8: ba 92 20 00 orcc %o0, 0, %i5 4000ffdc: 02 80 00 2c be 4001008c <_POSIX_Semaphore_Create_support+0xdc> 4000ffe0: 80 a6 20 00 cmp %i0, 0 /* * Make a copy of the user's string for name just in case it was * dynamically constructed. */ if ( name_arg != NULL ) { 4000ffe4: 02 80 00 1e be 4001005c <_POSIX_Semaphore_Create_support+0xac> 4000ffe8: 92 10 00 19 mov %i1, %o1 name = _Workspace_String_duplicate( name_arg, name_len ); 4000ffec: 40 00 04 10 call 4001102c <_Workspace_String_duplicate> 4000fff0: 90 10 00 18 mov %i0, %o0 if ( !name ) { 4000fff4: b2 92 20 00 orcc %o0, 0, %i1 4000fff8: 02 80 00 2d be 400100ac <_POSIX_Semaphore_Create_support+0xfc><== NEVER TAKEN 4000fffc: 82 10 20 01 mov 1, %g1 } the_semaphore->process_shared = pshared; if ( name ) { the_semaphore->named = true; 40010000: 84 10 20 01 mov 1, %g2 } } else { name = NULL; } the_semaphore->process_shared = pshared; 40010004: c0 27 60 10 clr [ %i5 + 0x10 ] if ( name ) { the_semaphore->named = true; 40010008: c4 2f 60 14 stb %g2, [ %i5 + 0x14 ] the_semaphore->open_count = 1; 4001000c: c2 27 60 18 st %g1, [ %i5 + 0x18 ] the_semaphore->linked = true; 40010010: c2 2f 60 15 stb %g1, [ %i5 + 0x15 ] the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 40010014: 82 10 3f ff mov -1, %g1 _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 40010018: 90 07 60 1c add %i5, 0x1c, %o0 4001001c: 92 07 60 5c add %i5, 0x5c, %o1 40010020: 94 10 00 1b mov %i3, %o2 the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 40010024: c2 27 60 5c st %g1, [ %i5 + 0x5c ] _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 40010028: 7f ff ec 5f call 4000b1a4 <_CORE_semaphore_Initialize> 4001002c: c0 27 60 60 clr [ %i5 + 0x60 ] Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( 40010030: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40010034: b4 16 a3 74 or %i2, 0x374, %i2 40010038: c4 06 a0 1c ld [ %i2 + 0x1c ], %g2 4001003c: 83 28 60 02 sll %g1, 2, %g1 40010040: fa 20 80 01 st %i5, [ %g2 + %g1 ] the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 40010044: f2 27 60 0c st %i1, [ %i5 + 0xc ] &_POSIX_Semaphore_Information, &the_semaphore->Object, name ); *the_sem = the_semaphore; 40010048: fa 27 00 00 st %i5, [ %i4 ] _Thread_Enable_dispatch(); 4001004c: 7f ff f3 45 call 4000cd60 <_Thread_Enable_dispatch> 40010050: b0 10 20 00 clr %i0 return 0; 40010054: 81 c7 e0 08 ret 40010058: 81 e8 00 00 restore } } else { name = NULL; } the_semaphore->process_shared = pshared; 4001005c: c0 27 60 10 clr [ %i5 + 0x10 ] if ( name ) { the_semaphore->named = true; the_semaphore->open_count = 1; the_semaphore->linked = true; } else { the_semaphore->named = false; 40010060: c0 2f 60 14 clrb [ %i5 + 0x14 ] the_semaphore->open_count = 0; 40010064: c0 27 60 18 clr [ %i5 + 0x18 ] the_semaphore->linked = false; 40010068: c0 2f 60 15 clrb [ %i5 + 0x15 ] _POSIX_Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENOMEM ); } } else { name = NULL; 4001006c: 10 bf ff ea b 40010014 <_POSIX_Semaphore_Create_support+0x64> 40010070: b2 10 20 00 clr %i1 CORE_semaphore_Attributes *the_sem_attr; char *name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) rtems_set_errno_and_return_minus_one( ENOSYS ); 40010074: 40 00 09 fa call 4001285c <__errno> 40010078: b0 10 3f ff mov -1, %i0 4001007c: 82 10 20 58 mov 0x58, %g1 40010080: c2 22 00 00 st %g1, [ %o0 ] 40010084: 81 c7 e0 08 ret 40010088: 81 e8 00 00 restore _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { _Thread_Enable_dispatch(); 4001008c: 7f ff f3 35 call 4000cd60 <_Thread_Enable_dispatch> 40010090: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one( ENOSPC ); 40010094: 40 00 09 f2 call 4001285c <__errno> 40010098: 01 00 00 00 nop 4001009c: 82 10 20 1c mov 0x1c, %g1 ! 1c 400100a0: c2 22 00 00 st %g1, [ %o0 ] 400100a4: 81 c7 e0 08 ret 400100a8: 81 e8 00 00 restore RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free ( POSIX_Semaphore_Control *the_semaphore ) { _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object ); 400100ac: 90 16 a3 74 or %i2, 0x374, %o0 <== NOT EXECUTED 400100b0: 7f ff ee d8 call 4000bc10 <_Objects_Free> <== NOT EXECUTED 400100b4: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED */ if ( name_arg != NULL ) { name = _Workspace_String_duplicate( name_arg, name_len ); if ( !name ) { _POSIX_Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 400100b8: 7f ff f3 2a call 4000cd60 <_Thread_Enable_dispatch> <== NOT EXECUTED 400100bc: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 400100c0: 40 00 09 e7 call 4001285c <__errno> <== NOT EXECUTED 400100c4: 01 00 00 00 nop <== NOT EXECUTED 400100c8: 82 10 20 0c mov 0xc, %g1 ! c <== NOT EXECUTED 400100cc: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 400100d0: 81 c7 e0 08 ret <== NOT EXECUTED 400100d4: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4000d664 <_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 ]; 4000d664: c2 02 21 50 ld [ %o0 + 0x150 ], %g1 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 4000d668: c4 00 60 d8 ld [ %g1 + 0xd8 ], %g2 4000d66c: 80 a0 a0 00 cmp %g2, 0 4000d670: 12 80 00 06 bne 4000d688 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x24><== NEVER TAKEN 4000d674: 01 00 00 00 nop 4000d678: c4 00 60 dc ld [ %g1 + 0xdc ], %g2 4000d67c: 80 a0 a0 01 cmp %g2, 1 4000d680: 22 80 00 05 be,a 4000d694 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x30> 4000d684: 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(); 4000d688: 82 13 c0 00 mov %o7, %g1 4000d68c: 7f ff f6 0c call 4000aebc <_Thread_Enable_dispatch> 4000d690: 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 && 4000d694: 80 a0 60 00 cmp %g1, 0 4000d698: 02 bf ff fc be 4000d688 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x24> 4000d69c: 01 00 00 00 nop * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4000d6a0: 03 10 00 64 sethi %hi(0x40019000), %g1 4000d6a4: c4 00 60 e0 ld [ %g1 + 0xe0 ], %g2 ! 400190e0 <_Thread_Dispatch_disable_level> thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 4000d6a8: 92 10 3f ff mov -1, %o1 --level; 4000d6ac: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000d6b0: c4 20 60 e0 st %g2, [ %g1 + 0xe0 ] 4000d6b4: 82 13 c0 00 mov %o7, %g1 4000d6b8: 40 00 01 d9 call 4000de1c <_POSIX_Thread_Exit> 4000d6bc: 9e 10 40 00 mov %g1, %o7 =============================================================================== 4000eb60 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4000eb60: 9d e3 bf a0 save %sp, -96, %sp if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4000eb64: 7f ff ff f2 call 4000eb2c <_POSIX_Priority_Is_valid> 4000eb68: d0 06 40 00 ld [ %i1 ], %o0 4000eb6c: 80 8a 20 ff btst 0xff, %o0 4000eb70: 32 80 00 04 bne,a 4000eb80 <_POSIX_Thread_Translate_sched_param+0x20><== ALWAYS TAKEN 4000eb74: c0 26 80 00 clr [ %i2 ] return EINVAL; 4000eb78: 81 c7 e0 08 ret 4000eb7c: 91 e8 20 16 restore %g0, 0x16, %o0 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; *budget_callout = NULL; if ( policy == SCHED_OTHER ) { 4000eb80: 80 a6 20 00 cmp %i0, 0 4000eb84: 02 80 00 2c be 4000ec34 <_POSIX_Thread_Translate_sched_param+0xd4> 4000eb88: c0 26 c0 00 clr [ %i3 ] *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; return 0; } if ( policy == SCHED_FIFO ) { 4000eb8c: 80 a6 20 01 cmp %i0, 1 4000eb90: 02 80 00 2d be 4000ec44 <_POSIX_Thread_Translate_sched_param+0xe4> 4000eb94: 80 a6 20 02 cmp %i0, 2 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 4000eb98: 02 80 00 2d be 4000ec4c <_POSIX_Thread_Translate_sched_param+0xec> 4000eb9c: 80 a6 20 04 cmp %i0, 4 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; return 0; } if ( policy == SCHED_SPORADIC ) { 4000eba0: 12 bf ff f6 bne 4000eb78 <_POSIX_Thread_Translate_sched_param+0x18> 4000eba4: 01 00 00 00 nop if ( (param->sched_ss_repl_period.tv_sec == 0) && 4000eba8: c2 06 60 08 ld [ %i1 + 8 ], %g1 4000ebac: 80 a0 60 00 cmp %g1, 0 4000ebb0: 32 80 00 07 bne,a 4000ebcc <_POSIX_Thread_Translate_sched_param+0x6c> 4000ebb4: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000ebb8: c2 06 60 0c ld [ %i1 + 0xc ], %g1 4000ebbc: 80 a0 60 00 cmp %g1, 0 4000ebc0: 02 bf ff ee be 4000eb78 <_POSIX_Thread_Translate_sched_param+0x18> 4000ebc4: 01 00 00 00 nop (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 4000ebc8: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000ebcc: 80 a0 60 00 cmp %g1, 0 4000ebd0: 12 80 00 06 bne 4000ebe8 <_POSIX_Thread_Translate_sched_param+0x88> 4000ebd4: 01 00 00 00 nop 4000ebd8: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 4000ebdc: 80 a0 60 00 cmp %g1, 0 4000ebe0: 02 bf ff e6 be 4000eb78 <_POSIX_Thread_Translate_sched_param+0x18> 4000ebe4: 01 00 00 00 nop (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4000ebe8: 7f ff f7 15 call 4000c83c <_Timespec_To_ticks> 4000ebec: 90 06 60 08 add %i1, 8, %o0 4000ebf0: ba 10 00 08 mov %o0, %i5 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 4000ebf4: 7f ff f7 12 call 4000c83c <_Timespec_To_ticks> 4000ebf8: 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 ) < 4000ebfc: 80 a7 40 08 cmp %i5, %o0 4000ec00: 0a bf ff de bcs 4000eb78 <_POSIX_Thread_Translate_sched_param+0x18> 4000ec04: 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 ) ) 4000ec08: 7f ff ff c9 call 4000eb2c <_POSIX_Priority_Is_valid> 4000ec0c: d0 06 60 04 ld [ %i1 + 4 ], %o0 4000ec10: 80 8a 20 ff btst 0xff, %o0 4000ec14: 02 bf ff d9 be 4000eb78 <_POSIX_Thread_Translate_sched_param+0x18> 4000ec18: 82 10 20 03 mov 3, %g1 return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4000ec1c: c2 26 80 00 st %g1, [ %i2 ] *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4000ec20: 03 10 00 22 sethi %hi(0x40008800), %g1 4000ec24: 82 10 60 ac or %g1, 0xac, %g1 ! 400088ac <_POSIX_Threads_Sporadic_budget_callout> 4000ec28: c2 26 c0 00 st %g1, [ %i3 ] return 0; 4000ec2c: 81 c7 e0 08 ret 4000ec30: 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; 4000ec34: 82 10 20 01 mov 1, %g1 4000ec38: c2 26 80 00 st %g1, [ %i2 ] return 0; 4000ec3c: 81 c7 e0 08 ret 4000ec40: 81 e8 00 00 restore *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; } 4000ec44: 81 c7 e0 08 ret 4000ec48: 91 e8 20 00 restore %g0, 0, %o0 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 4000ec4c: f0 26 80 00 st %i0, [ %i2 ] return 0; 4000ec50: 81 c7 e0 08 ret 4000ec54: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000dd9c <_POSIX_Threads_Delete_extension>: */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { 4000dd9c: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *the_thread; POSIX_API_Control *api; void **value_ptr; api = deleted->API_Extensions[ THREAD_API_POSIX ]; 4000dda0: f0 06 61 50 ld [ %i1 + 0x150 ], %i0 /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); 4000dda4: 40 00 08 c0 call 400100a4 <_POSIX_Threads_cancel_run> 4000dda8: 90 10 00 19 mov %i1, %o0 /* * Run all the key destructors */ _POSIX_Keys_Run_destructors( deleted ); 4000ddac: 90 10 00 19 mov %i1, %o0 4000ddb0: 40 00 08 d9 call 40010114 <_POSIX_Keys_Run_destructors> 4000ddb4: ba 06 20 44 add %i0, 0x44, %i5 /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 4000ddb8: 10 80 00 03 b 4000ddc4 <_POSIX_Threads_Delete_extension+0x28> 4000ddbc: f8 06 60 28 ld [ %i1 + 0x28 ], %i4 *(void **)the_thread->Wait.return_argument = value_ptr; 4000ddc0: f8 20 40 00 st %i4, [ %g1 ] <== NOT EXECUTED /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 4000ddc4: 7f ff f5 9a call 4000b42c <_Thread_queue_Dequeue> 4000ddc8: 90 10 00 1d mov %i5, %o0 4000ddcc: 80 a2 20 00 cmp %o0, 0 4000ddd0: 32 bf ff fc bne,a 4000ddc0 <_POSIX_Threads_Delete_extension+0x24><== NEVER TAKEN 4000ddd4: c2 02 20 28 ld [ %o0 + 0x28 ], %g1 <== NOT EXECUTED *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) 4000ddd8: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 4000dddc: 80 a0 60 04 cmp %g1, 4 4000dde0: 02 80 00 05 be 4000ddf4 <_POSIX_Threads_Delete_extension+0x58> 4000dde4: 01 00 00 00 nop (void) _Watchdog_Remove( &api->Sporadic_timer ); deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; 4000dde8: c0 26 61 50 clr [ %i1 + 0x150 ] _Workspace_Free( api ); 4000ddec: 7f ff f9 10 call 4000c22c <_Workspace_Free> 4000ddf0: 81 e8 00 00 restore while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); 4000ddf4: 7f ff f8 50 call 4000bf34 <_Watchdog_Remove> 4000ddf8: 90 06 20 a8 add %i0, 0xa8, %o0 deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; 4000ddfc: c0 26 61 50 clr [ %i1 + 0x150 ] _Workspace_Free( api ); 4000de00: 7f ff f9 0b call 4000c22c <_Workspace_Free> 4000de04: 81 e8 00 00 restore =============================================================================== 400085c0 <_POSIX_Threads_Initialize_user_threads_body>: #include #include #include void _POSIX_Threads_Initialize_user_threads_body(void) { 400085c0: 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; 400085c4: 03 10 00 80 sethi %hi(0x40020000), %g1 400085c8: 82 10 60 04 or %g1, 4, %g1 ! 40020004 maximum = Configuration_POSIX_API.number_of_initialization_threads; 400085cc: f6 00 60 30 ld [ %g1 + 0x30 ], %i3 if ( !user_threads || maximum == 0 ) 400085d0: 80 a6 e0 00 cmp %i3, 0 400085d4: 02 80 00 18 be 40008634 <_POSIX_Threads_Initialize_user_threads_body+0x74><== NEVER TAKEN 400085d8: fa 00 60 34 ld [ %g1 + 0x34 ], %i5 400085dc: 80 a7 60 00 cmp %i5, 0 400085e0: 02 80 00 15 be 40008634 <_POSIX_Threads_Initialize_user_threads_body+0x74><== NEVER TAKEN 400085e4: 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 ); 400085e8: 40 00 19 9c call 4000ec58 400085ec: 90 07 bf c0 add %fp, -64, %o0 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 400085f0: 92 10 20 02 mov 2, %o1 400085f4: 40 00 19 a5 call 4000ec88 400085f8: 90 07 bf c0 add %fp, -64, %o0 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 400085fc: d2 07 60 04 ld [ %i5 + 4 ], %o1 40008600: 40 00 19 b2 call 4000ecc8 40008604: 90 07 bf c0 add %fp, -64, %o0 status = pthread_create( 40008608: d4 07 40 00 ld [ %i5 ], %o2 4000860c: 90 07 bf bc add %fp, -68, %o0 40008610: 92 07 bf c0 add %fp, -64, %o1 40008614: 7f ff ff 00 call 40008214 40008618: 96 10 20 00 clr %o3 &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 4000861c: 94 92 20 00 orcc %o0, 0, %o2 40008620: 12 80 00 07 bne 4000863c <_POSIX_Threads_Initialize_user_threads_body+0x7c> 40008624: 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++ ) { 40008628: 80 a7 00 1b cmp %i4, %i3 4000862c: 12 bf ff ef bne 400085e8 <_POSIX_Threads_Initialize_user_threads_body+0x28><== NEVER TAKEN 40008630: ba 07 60 08 add %i5, 8, %i5 40008634: 81 c7 e0 08 ret 40008638: 81 e8 00 00 restore &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 4000863c: 90 10 20 02 mov 2, %o0 40008640: 40 00 08 79 call 4000a824 <_Internal_error_Occurred> 40008644: 92 10 20 01 mov 1, %o1 =============================================================================== 4000df28 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 4000df28: 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 ]; 4000df2c: fa 06 61 50 ld [ %i1 + 0x150 ], %i5 /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 4000df30: 40 00 03 bb call 4000ee1c <_Timespec_To_ticks> 4000df34: 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); 4000df38: c4 07 60 88 ld [ %i5 + 0x88 ], %g2 4000df3c: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000df40: d2 08 60 dc ldub [ %g1 + 0xdc ], %o1 ! 4001f4dc */ #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 ) { 4000df44: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 4000df48: 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; 4000df4c: d0 26 60 74 st %o0, [ %i1 + 0x74 ] */ #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 ) { 4000df50: 80 a0 60 00 cmp %g1, 0 4000df54: 12 80 00 06 bne 4000df6c <_POSIX_Threads_Sporadic_budget_TSR+0x44><== NEVER TAKEN 4000df58: 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 ) { 4000df5c: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 4000df60: 80 a0 40 09 cmp %g1, %o1 4000df64: 18 80 00 09 bgu 4000df88 <_POSIX_Threads_Sporadic_budget_TSR+0x60> 4000df68: 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 ); 4000df6c: 90 07 60 90 add %i5, 0x90, %o0 4000df70: 40 00 03 ab call 4000ee1c <_Timespec_To_ticks> 4000df74: 31 10 00 80 sethi %hi(0x40020000), %i0 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000df78: b2 07 60 a8 add %i5, 0xa8, %i1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4000df7c: d0 27 60 b4 st %o0, [ %i5 + 0xb4 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000df80: 7f ff f7 8e call 4000bdb8 <_Watchdog_Insert> 4000df84: 91 ee 23 48 restore %i0, 0x348, %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 ); 4000df88: 7f ff f3 16 call 4000abe0 <_Thread_Change_priority> 4000df8c: 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 ); 4000df90: 90 07 60 90 add %i5, 0x90, %o0 4000df94: 40 00 03 a2 call 4000ee1c <_Timespec_To_ticks> 4000df98: 31 10 00 80 sethi %hi(0x40020000), %i0 4000df9c: b2 07 60 a8 add %i5, 0xa8, %i1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4000dfa0: d0 27 60 b4 st %o0, [ %i5 + 0xb4 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000dfa4: 7f ff f7 85 call 4000bdb8 <_Watchdog_Insert> 4000dfa8: 91 ee 23 48 restore %i0, 0x348, %o0 =============================================================================== 4000dfac <_POSIX_Threads_Sporadic_budget_callout>: ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000dfac: c4 02 21 50 ld [ %o0 + 0x150 ], %g2 4000dfb0: c6 00 a0 8c ld [ %g2 + 0x8c ], %g3 4000dfb4: 05 10 00 7d sethi %hi(0x4001f400), %g2 4000dfb8: d2 08 a0 dc ldub [ %g2 + 0xdc ], %o1 ! 4001f4dc */ #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 ) { 4000dfbc: c4 02 20 1c ld [ %o0 + 0x1c ], %g2 4000dfc0: 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 */ 4000dfc4: 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; 4000dfc8: 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 ) { 4000dfcc: 80 a0 a0 00 cmp %g2, 0 4000dfd0: 12 80 00 06 bne 4000dfe8 <_POSIX_Threads_Sporadic_budget_callout+0x3c><== NEVER TAKEN 4000dfd4: c6 22 20 74 st %g3, [ %o0 + 0x74 ] /* * 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 ) { 4000dfd8: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000dfdc: 80 a0 40 09 cmp %g1, %o1 4000dfe0: 0a 80 00 04 bcs 4000dff0 <_POSIX_Threads_Sporadic_budget_callout+0x44><== ALWAYS TAKEN 4000dfe4: 94 10 20 01 mov 1, %o2 4000dfe8: 81 c3 e0 08 retl <== NOT EXECUTED 4000dfec: 01 00 00 00 nop <== NOT EXECUTED _Thread_Change_priority( the_thread, new_priority, true ); 4000dff0: 82 13 c0 00 mov %o7, %g1 4000dff4: 7f ff f2 fb call 4000abe0 <_Thread_Change_priority> 4000dff8: 9e 10 40 00 mov %g1, %o7 =============================================================================== 400100a4 <_POSIX_Threads_cancel_run>: #include void _POSIX_Threads_cancel_run( Thread_Control *the_thread ) { 400100a4: 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 ]; 400100a8: f8 06 21 50 ld [ %i0 + 0x150 ], %i4 handler_stack = &thread_support->Cancellation_Handlers; thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; 400100ac: 84 10 20 01 mov 1, %g2 while ( !_Chain_Is_empty( handler_stack ) ) { 400100b0: 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 ); 400100b4: b6 07 20 e8 add %i4, 0xe8, %i3 400100b8: 80 a0 40 1b cmp %g1, %i3 400100bc: 02 80 00 14 be 4001010c <_POSIX_Threads_cancel_run+0x68> 400100c0: c4 27 20 d8 st %g2, [ %i4 + 0xd8 ] _ISR_Disable( level ); 400100c4: 7f ff c9 03 call 400024d0 400100c8: 01 00 00 00 nop handler = (POSIX_Cancel_Handler_control *) 400100cc: fa 07 20 ec ld [ %i4 + 0xec ], %i5 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 400100d0: c4 07 40 00 ld [ %i5 ], %g2 previous = the_node->previous; 400100d4: c2 07 60 04 ld [ %i5 + 4 ], %g1 next->previous = previous; 400100d8: c2 20 a0 04 st %g1, [ %g2 + 4 ] previous->next = next; 400100dc: c4 20 40 00 st %g2, [ %g1 ] _Chain_Tail( handler_stack )->previous; _Chain_Extract_unprotected( &handler->Node ); _ISR_Enable( level ); 400100e0: 7f ff c9 00 call 400024e0 400100e4: 01 00 00 00 nop (*handler->routine)( handler->arg ); 400100e8: c2 07 60 08 ld [ %i5 + 8 ], %g1 400100ec: 9f c0 40 00 call %g1 400100f0: d0 07 60 0c ld [ %i5 + 0xc ], %o0 _Workspace_Free( handler ); 400100f4: 7f ff f0 4e call 4000c22c <_Workspace_Free> 400100f8: 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 ) ) { 400100fc: c2 07 20 e4 ld [ %i4 + 0xe4 ], %g1 40010100: 80 a0 40 1b cmp %g1, %i3 40010104: 12 bf ff f0 bne 400100c4 <_POSIX_Threads_cancel_run+0x20> <== NEVER TAKEN 40010108: 01 00 00 00 nop 4001010c: 81 c7 e0 08 ret 40010110: 81 e8 00 00 restore =============================================================================== 4000834c <_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) { 4000834c: 9d e3 bf 98 save %sp, -104, %sp bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 40008350: c4 06 60 68 ld [ %i1 + 0x68 ], %g2 /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 40008354: 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; 40008358: 84 00 a0 01 inc %g2 /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 4000835c: 80 a0 60 00 cmp %g1, 0 40008360: 12 80 00 0e bne 40008398 <_POSIX_Timer_TSR+0x4c> 40008364: c4 26 60 68 st %g2, [ %i1 + 0x68 ] 40008368: c2 06 60 58 ld [ %i1 + 0x58 ], %g1 4000836c: 80 a0 60 00 cmp %g1, 0 40008370: 32 80 00 0b bne,a 4000839c <_POSIX_Timer_TSR+0x50> <== ALWAYS TAKEN 40008374: 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; 40008378: 82 10 20 04 mov 4, %g1 <== NOT EXECUTED 4000837c: 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 ) ) { 40008380: d0 06 60 38 ld [ %i1 + 0x38 ], %o0 40008384: 40 00 18 4c call 4000e4b4 40008388: 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; 4000838c: c0 26 60 68 clr [ %i1 + 0x68 ] 40008390: 81 c7 e0 08 ret 40008394: 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( 40008398: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 4000839c: d4 06 60 08 ld [ %i1 + 8 ], %o2 400083a0: 90 06 60 10 add %i1, 0x10, %o0 400083a4: 98 10 00 19 mov %i1, %o4 400083a8: 17 10 00 20 sethi %hi(0x40008000), %o3 400083ac: 40 00 19 69 call 4000e950 <_POSIX_Timer_Insert_helper> 400083b0: 96 12 e3 4c or %o3, 0x34c, %o3 ! 4000834c <_POSIX_Timer_TSR> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 400083b4: 80 8a 20 ff btst 0xff, %o0 400083b8: 02 bf ff f6 be 40008390 <_POSIX_Timer_TSR+0x44> <== NEVER TAKEN 400083bc: 90 07 bf f8 add %fp, -8, %o0 400083c0: 13 10 00 83 sethi %hi(0x40020c00), %o1 400083c4: 40 00 06 3b call 40009cb0 <_TOD_Get_with_nanoseconds> 400083c8: 92 12 61 48 or %o1, 0x148, %o1 ! 40020d48 <_TOD> /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; } 400083cc: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 400083d0: 94 10 20 00 clr %o2 400083d4: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400083d8: 90 10 00 1c mov %i4, %o0 400083dc: 96 12 e2 00 or %o3, 0x200, %o3 400083e0: 40 00 4a 34 call 4001acb0 <__divdi3> 400083e4: 92 10 00 1d mov %i5, %o1 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 400083e8: 94 10 20 00 clr %o2 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 400083ec: d2 26 60 6c st %o1, [ %i1 + 0x6c ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 400083f0: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400083f4: 90 10 00 1c mov %i4, %o0 400083f8: 96 12 e2 00 or %o3, 0x200, %o3 400083fc: 40 00 4b 18 call 4001b05c <__moddi3> 40008400: 92 10 00 1d mov %i5, %o1 /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 40008404: 82 10 20 03 mov 3, %g1 40008408: d2 26 60 70 st %o1, [ %i1 + 0x70 ] 4000840c: 10 bf ff dd b 40008380 <_POSIX_Timer_TSR+0x34> 40008410: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] =============================================================================== 400101d8 <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 400101d8: 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, 400101dc: 98 10 20 01 mov 1, %o4 400101e0: 90 10 00 18 mov %i0, %o0 400101e4: 92 10 00 19 mov %i1, %o1 400101e8: 94 07 bf cc add %fp, -52, %o2 400101ec: 40 00 00 2e call 400102a4 <_POSIX_signals_Clear_signals> 400101f0: 96 10 00 1a mov %i2, %o3 400101f4: 80 8a 20 ff btst 0xff, %o0 400101f8: 02 80 00 23 be 40010284 <_POSIX_signals_Check_signal+0xac> 400101fc: 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 ) 40010200: 85 2e 60 02 sll %i1, 2, %g2 40010204: 37 10 00 82 sethi %hi(0x40020800), %i3 40010208: b9 2e 60 04 sll %i1, 4, %i4 4001020c: b6 16 e0 20 or %i3, 0x20, %i3 40010210: b8 27 00 02 sub %i4, %g2, %i4 40010214: 84 06 c0 1c add %i3, %i4, %g2 40010218: fa 00 a0 08 ld [ %g2 + 8 ], %i5 4001021c: 80 a7 60 01 cmp %i5, 1 40010220: 02 80 00 19 be 40010284 <_POSIX_signals_Check_signal+0xac><== NEVER TAKEN 40010224: 21 10 00 81 sethi %hi(0x40020400), %l0 return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 40010228: f4 06 20 d0 ld [ %i0 + 0xd0 ], %i2 api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4001022c: 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, 40010230: a0 14 23 c0 or %l0, 0x3c0, %l0 40010234: d2 04 20 10 ld [ %l0 + 0x10 ], %o1 /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 40010238: 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, 4001023c: 90 07 bf d8 add %fp, -40, %o0 /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 40010240: 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, 40010244: 92 02 60 20 add %o1, 0x20, %o1 40010248: 40 00 04 0f call 40011284 4001024c: 94 10 20 28 mov 0x28, %o2 sizeof( Thread_Wait_information )); /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 40010250: c2 06 c0 1c ld [ %i3 + %i4 ], %g1 40010254: 80 a0 60 02 cmp %g1, 2 40010258: 02 80 00 0e be 40010290 <_POSIX_signals_Check_signal+0xb8> 4001025c: 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 ); 40010260: 9f c7 40 00 call %i5 40010264: 01 00 00 00 nop } /* * Restore the blocking information */ memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information, 40010268: d0 04 20 10 ld [ %l0 + 0x10 ], %o0 4001026c: 92 07 bf d8 add %fp, -40, %o1 40010270: 90 02 20 20 add %o0, 0x20, %o0 40010274: 40 00 04 04 call 40011284 40010278: 94 10 20 28 mov 0x28, %o2 /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; 4001027c: 82 10 20 01 mov 1, %g1 sizeof( Thread_Wait_information )); /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 40010280: f4 26 20 d0 st %i2, [ %i0 + 0xd0 ] return true; } 40010284: b0 08 60 01 and %g1, 1, %i0 40010288: 81 c7 e0 08 ret 4001028c: 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)( 40010290: 92 07 bf cc add %fp, -52, %o1 40010294: 9f c7 40 00 call %i5 40010298: 94 10 20 00 clr %o2 signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 4001029c: 10 bf ff f4 b 4001026c <_POSIX_signals_Check_signal+0x94> 400102a0: d0 04 20 10 ld [ %l0 + 0x10 ], %o0 =============================================================================== 40010898 <_POSIX_signals_Clear_process_signals>: */ void _POSIX_signals_Clear_process_signals( int signo ) { 40010898: 9d e3 bf a0 save %sp, -96, %sp 4001089c: 84 10 20 01 mov 1, %g2 400108a0: 82 06 3f ff add %i0, -1, %g1 clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 400108a4: 7f ff c7 0b call 400024d0 400108a8: bb 28 80 01 sll %g2, %g1, %i5 if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 400108ac: 05 10 00 82 sethi %hi(0x40020800), %g2 400108b0: 83 2e 20 02 sll %i0, 2, %g1 400108b4: 84 10 a0 20 or %g2, 0x20, %g2 400108b8: b1 2e 20 04 sll %i0, 4, %i0 400108bc: 82 26 00 01 sub %i0, %g1, %g1 400108c0: c4 00 80 01 ld [ %g2 + %g1 ], %g2 400108c4: 80 a0 a0 02 cmp %g2, 2 400108c8: 02 80 00 08 be 400108e8 <_POSIX_signals_Clear_process_signals+0x50> 400108cc: 31 10 00 82 sethi %hi(0x40020800), %i0 if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 400108d0: 03 10 00 82 sethi %hi(0x40020800), %g1 400108d4: c4 00 62 14 ld [ %g1 + 0x214 ], %g2 ! 40020a14 <_POSIX_signals_Pending> 400108d8: ba 28 80 1d andn %g2, %i5, %i5 400108dc: fa 20 62 14 st %i5, [ %g1 + 0x214 ] } _ISR_Enable( level ); 400108e0: 7f ff c7 00 call 400024e0 400108e4: 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 ] ) ) 400108e8: b0 16 22 18 or %i0, 0x218, %i0 400108ec: c4 00 40 18 ld [ %g1 + %i0 ], %g2 400108f0: b0 00 40 18 add %g1, %i0, %i0 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 400108f4: b0 06 20 04 add %i0, 4, %i0 400108f8: 80 a0 80 18 cmp %g2, %i0 400108fc: 02 bf ff f6 be 400108d4 <_POSIX_signals_Clear_process_signals+0x3c><== ALWAYS TAKEN 40010900: 03 10 00 82 sethi %hi(0x40020800), %g1 clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; } _ISR_Enable( level ); 40010904: 7f ff c6 f7 call 400024e0 <== NOT EXECUTED 40010908: 91 e8 00 08 restore %g0, %o0, %o0 <== NOT EXECUTED =============================================================================== 40008ec0 <_POSIX_signals_Get_lowest>: sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 40008ec0: 82 10 20 1b mov 0x1b, %g1 40008ec4: 86 10 20 01 mov 1, %g3 #include #include #include #include static int _POSIX_signals_Get_lowest( 40008ec8: 84 00 7f ff add %g1, -1, %g2 40008ecc: 85 28 c0 02 sll %g3, %g2, %g2 ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 40008ed0: 80 88 80 08 btst %g2, %o0 40008ed4: 12 80 00 11 bne 40008f18 <_POSIX_signals_Get_lowest+0x58> <== NEVER TAKEN 40008ed8: 01 00 00 00 nop sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 40008edc: 82 00 60 01 inc %g1 40008ee0: 80 a0 60 20 cmp %g1, 0x20 40008ee4: 12 bf ff fa bne 40008ecc <_POSIX_signals_Get_lowest+0xc> 40008ee8: 84 00 7f ff add %g1, -1, %g2 40008eec: 82 10 20 01 mov 1, %g1 40008ef0: 10 80 00 05 b 40008f04 <_POSIX_signals_Get_lowest+0x44> 40008ef4: 86 10 20 01 mov 1, %g3 */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 40008ef8: 80 a0 60 1b cmp %g1, 0x1b 40008efc: 02 80 00 07 be 40008f18 <_POSIX_signals_Get_lowest+0x58> <== NEVER TAKEN 40008f00: 01 00 00 00 nop #include #include #include #include static int _POSIX_signals_Get_lowest( 40008f04: 84 00 7f ff add %g1, -1, %g2 40008f08: 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 ) ) { 40008f0c: 80 88 80 08 btst %g2, %o0 40008f10: 22 bf ff fa be,a 40008ef8 <_POSIX_signals_Get_lowest+0x38> 40008f14: 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; } 40008f18: 81 c3 e0 08 retl 40008f1c: 90 10 00 01 mov %g1, %o0 =============================================================================== 4000dadc <_POSIX_signals_Post_switch_hook>: */ static void _POSIX_signals_Post_switch_hook( Thread_Control *the_thread ) { 4000dadc: 9d e3 bf a0 save %sp, -96, %sp /* * We need to ensure that if the signal handler executes a call * which overwrites the unblocking status, we restore it. */ hold_errno = _Thread_Executing->Wait.return_code; 4000dae0: 35 10 00 81 sethi %hi(0x40020400), %i2 POSIX_API_Control *api; int signo; ISR_Level level; int hold_errno; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000dae4: f8 06 21 50 ld [ %i0 + 0x150 ], %i4 /* * We need to ensure that if the signal handler executes a call * which overwrites the unblocking status, we restore it. */ hold_errno = _Thread_Executing->Wait.return_code; 4000dae8: b4 16 a3 c0 or %i2, 0x3c0, %i2 4000daec: c2 06 a0 10 ld [ %i2 + 0x10 ], %g1 /* * api may be NULL in case of a thread close in progress */ if ( !api ) 4000daf0: 80 a7 20 00 cmp %i4, 0 4000daf4: 02 80 00 34 be 4000dbc4 <_POSIX_signals_Post_switch_hook+0xe8><== NEVER TAKEN 4000daf8: f2 00 60 34 ld [ %g1 + 0x34 ], %i1 * * 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 ); 4000dafc: 7f ff d2 75 call 400024d0 4000db00: 37 10 00 82 sethi %hi(0x40020800), %i3 4000db04: b6 16 e2 14 or %i3, 0x214, %i3 ! 40020a14 <_POSIX_signals_Pending> if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 4000db08: c6 06 c0 00 ld [ %i3 ], %g3 4000db0c: 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 & 4000db10: c4 07 20 d0 ld [ %i4 + 0xd0 ], %g2 (api->signals_pending | _POSIX_signals_Pending)) ) { 4000db14: 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 & 4000db18: 80 a8 40 02 andncc %g1, %g2, %g0 4000db1c: 02 80 00 26 be 4000dbb4 <_POSIX_signals_Post_switch_hook+0xd8> 4000db20: 01 00 00 00 nop (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); break; } _ISR_Enable( level ); 4000db24: 7f ff d2 6f call 400024e0 4000db28: ba 10 20 1b mov 0x1b, %i5 ! 1b for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 4000db2c: 92 10 00 1d mov %i5, %o1 4000db30: 94 10 20 00 clr %o2 4000db34: 40 00 09 a9 call 400101d8 <_POSIX_signals_Check_signal> 4000db38: 90 10 00 1c mov %i4, %o0 _POSIX_signals_Check_signal( api, signo, true ); 4000db3c: 92 10 00 1d mov %i5, %o1 4000db40: 90 10 00 1c mov %i4, %o0 4000db44: 40 00 09 a5 call 400101d8 <_POSIX_signals_Check_signal> 4000db48: 94 10 20 01 mov 1, %o2 _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4000db4c: ba 07 60 01 inc %i5 4000db50: 80 a7 60 20 cmp %i5, 0x20 4000db54: 12 bf ff f7 bne 4000db30 <_POSIX_signals_Post_switch_hook+0x54> 4000db58: 92 10 00 1d mov %i5, %o1 4000db5c: 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 ); 4000db60: 92 10 00 1d mov %i5, %o1 4000db64: 94 10 20 00 clr %o2 4000db68: 40 00 09 9c call 400101d8 <_POSIX_signals_Check_signal> 4000db6c: 90 10 00 1c mov %i4, %o0 _POSIX_signals_Check_signal( api, signo, true ); 4000db70: 92 10 00 1d mov %i5, %o1 4000db74: 90 10 00 1c mov %i4, %o0 4000db78: 40 00 09 98 call 400101d8 <_POSIX_signals_Check_signal> 4000db7c: 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++ ) { 4000db80: ba 07 60 01 inc %i5 4000db84: 80 a7 60 1b cmp %i5, 0x1b 4000db88: 12 bf ff f7 bne 4000db64 <_POSIX_signals_Post_switch_hook+0x88> 4000db8c: 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 ); 4000db90: 7f ff d2 50 call 400024d0 4000db94: 01 00 00 00 nop if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 4000db98: c6 06 c0 00 ld [ %i3 ], %g3 4000db9c: 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 & 4000dba0: c4 07 20 d0 ld [ %i4 + 0xd0 ], %g2 (api->signals_pending | _POSIX_signals_Pending)) ) { 4000dba4: 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 & 4000dba8: 80 a8 40 02 andncc %g1, %g2, %g0 4000dbac: 12 bf ff de bne 4000db24 <_POSIX_signals_Post_switch_hook+0x48><== NEVER TAKEN 4000dbb0: 01 00 00 00 nop (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); 4000dbb4: 7f ff d2 4b call 400024e0 4000dbb8: 01 00 00 00 nop _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } } _Thread_Executing->Wait.return_code = hold_errno; 4000dbbc: c2 06 a0 10 ld [ %i2 + 0x10 ], %g1 4000dbc0: f2 20 60 34 st %i1, [ %g1 + 0x34 ] 4000dbc4: 81 c7 e0 08 ret 4000dbc8: 81 e8 00 00 restore =============================================================================== 4001cef8 <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4001cef8: 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 ) ) { 4001cefc: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4001cf00: 05 04 00 20 sethi %hi(0x10008000), %g2 4001cf04: 88 10 20 01 mov 1, %g4 4001cf08: 86 06 7f ff add %i1, -1, %g3 4001cf0c: ba 08 40 02 and %g1, %g2, %i5 { POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4001cf10: f8 06 21 50 ld [ %i0 + 0x150 ], %i4 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4001cf14: 80 a7 40 02 cmp %i5, %g2 4001cf18: 02 80 00 2c be 4001cfc8 <_POSIX_signals_Unblock_thread+0xd0> 4001cf1c: 87 29 00 03 sll %g4, %g3, %g3 } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 4001cf20: c4 07 20 d0 ld [ %i4 + 0xd0 ], %g2 4001cf24: 80 a8 c0 02 andncc %g3, %g2, %g0 4001cf28: 02 80 00 24 be 4001cfb8 <_POSIX_signals_Unblock_thread+0xc0> 4001cf2c: 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 ) ) { 4001cf30: 80 88 40 02 btst %g1, %g2 4001cf34: 02 80 00 15 be 4001cf88 <_POSIX_signals_Unblock_thread+0x90> 4001cf38: 80 a0 60 00 cmp %g1, 0 the_thread->Wait.return_code = EINTR; 4001cf3c: 84 10 20 04 mov 4, %g2 4001cf40: 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); 4001cf44: 05 00 00 ef sethi %hi(0x3bc00), %g2 4001cf48: 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) ) 4001cf4c: 80 88 40 02 btst %g1, %g2 4001cf50: 12 80 00 38 bne 4001d030 <_POSIX_signals_Unblock_thread+0x138> 4001cf54: 80 88 60 08 btst 8, %g1 _Thread_queue_Extract_with_proxy( the_thread ); else if ( _States_Is_delaying(the_thread->current_state) ) { 4001cf58: 22 80 00 19 be,a 4001cfbc <_POSIX_signals_Unblock_thread+0xc4><== NEVER TAKEN 4001cf5c: b0 10 20 00 clr %i0 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 4001cf60: 7f ff bb f5 call 4000bf34 <_Watchdog_Remove> 4001cf64: 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 ); 4001cf68: 90 10 00 18 mov %i0, %o0 4001cf6c: 13 04 01 ff sethi %hi(0x1007fc00), %o1 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 4001cf70: b0 10 20 00 clr %i0 4001cf74: 7f ff b7 68 call 4000ad14 <_Thread_Clear_state> 4001cf78: 92 12 63 f8 or %o1, 0x3f8, %o1 4001cf7c: b0 0e 20 01 and %i0, 1, %i0 4001cf80: 81 c7 e0 08 ret 4001cf84: 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 ) { 4001cf88: 32 80 00 0d bne,a 4001cfbc <_POSIX_signals_Unblock_thread+0xc4><== NEVER TAKEN 4001cf8c: b0 10 20 00 clr %i0 <== NOT EXECUTED if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4001cf90: 03 10 00 81 sethi %hi(0x40020400), %g1 4001cf94: 82 10 63 c0 or %g1, 0x3c0, %g1 ! 400207c0 <_Per_CPU_Information> 4001cf98: c4 00 60 08 ld [ %g1 + 8 ], %g2 4001cf9c: 80 a0 a0 00 cmp %g2, 0 4001cfa0: 22 80 00 07 be,a 4001cfbc <_POSIX_signals_Unblock_thread+0xc4> 4001cfa4: b0 10 20 00 clr %i0 4001cfa8: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4001cfac: 80 a6 00 02 cmp %i0, %g2 4001cfb0: 22 80 00 02 be,a 4001cfb8 <_POSIX_signals_Unblock_thread+0xc0><== ALWAYS TAKEN 4001cfb4: c8 28 60 0c stb %g4, [ %g1 + 0xc ] _Thread_Dispatch_necessary = true; } } return false; 4001cfb8: b0 10 20 00 clr %i0 } 4001cfbc: b0 0e 20 01 and %i0, 1, %i0 4001cfc0: 81 c7 e0 08 ret 4001cfc4: 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) ) { 4001cfc8: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 4001cfcc: 80 88 c0 01 btst %g3, %g1 4001cfd0: 22 80 00 13 be,a 4001d01c <_POSIX_signals_Unblock_thread+0x124> 4001cfd4: c2 07 20 d0 ld [ %i4 + 0xd0 ], %g1 the_thread->Wait.return_code = EINTR; 4001cfd8: 82 10 20 04 mov 4, %g1 4001cfdc: c2 26 20 34 st %g1, [ %i0 + 0x34 ] the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 4001cfe0: 80 a6 a0 00 cmp %i2, 0 4001cfe4: 02 80 00 19 be 4001d048 <_POSIX_signals_Unblock_thread+0x150> 4001cfe8: 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; 4001cfec: c4 06 80 00 ld [ %i2 ], %g2 4001cff0: c4 20 40 00 st %g2, [ %g1 ] 4001cff4: c4 06 a0 04 ld [ %i2 + 4 ], %g2 4001cff8: c4 20 60 04 st %g2, [ %g1 + 4 ] 4001cffc: c4 06 a0 08 ld [ %i2 + 8 ], %g2 4001d000: c4 20 60 08 st %g2, [ %g1 + 8 ] } _Thread_queue_Extract_with_proxy( the_thread ); 4001d004: 90 10 00 18 mov %i0, %o0 4001d008: 7f ff ba 19 call 4000b86c <_Thread_queue_Extract_with_proxy> 4001d00c: b0 10 20 01 mov 1, %i0 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; } 4001d010: b0 0e 20 01 and %i0, 1, %i0 4001d014: 81 c7 e0 08 ret 4001d018: 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) ) { 4001d01c: 80 a8 c0 01 andncc %g3, %g1, %g0 4001d020: 32 bf ff ef bne,a 4001cfdc <_POSIX_signals_Unblock_thread+0xe4> 4001d024: 82 10 20 04 mov 4, %g1 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 4001d028: 10 bf ff e5 b 4001cfbc <_POSIX_signals_Unblock_thread+0xc4> 4001d02c: b0 10 20 00 clr %i0 /* * 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 ); 4001d030: 90 10 00 18 mov %i0, %o0 4001d034: 7f ff ba 0e call 4000b86c <_Thread_queue_Extract_with_proxy> 4001d038: b0 10 20 00 clr %i0 4001d03c: b0 0e 20 01 and %i0, 1, %i0 4001d040: 81 c7 e0 08 ret 4001d044: 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; 4001d048: 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; 4001d04c: f2 20 40 00 st %i1, [ %g1 ] the_info->si_code = SI_USER; 4001d050: c4 20 60 04 st %g2, [ %g1 + 4 ] the_info->si_value.sival_int = 0; 4001d054: 10 bf ff ec b 4001d004 <_POSIX_signals_Unblock_thread+0x10c> 4001d058: c0 20 60 08 clr [ %g1 + 8 ] =============================================================================== 4000aff4 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 4000aff4: 9d e3 bf a0 save %sp, -96, %sp RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 4000aff8: 80 a6 60 00 cmp %i1, 0 4000affc: 02 80 00 4c be 4000b12c <_RBTree_Extract_unprotected+0x138> 4000b000: 01 00 00 00 nop /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 4000b004: c2 06 20 08 ld [ %i0 + 8 ], %g1 4000b008: 80 a0 40 19 cmp %g1, %i1 4000b00c: 02 80 00 56 be 4000b164 <_RBTree_Extract_unprotected+0x170> 4000b010: 90 10 00 19 mov %i1, %o0 the_rbtree->first[RBT_LEFT] = next; } /* Check if max needs to be updated. min=max for 1 element trees so * do not use else if here. */ if (the_node == the_rbtree->first[RBT_RIGHT]) { 4000b014: c2 06 20 0c ld [ %i0 + 0xc ], %g1 4000b018: 80 a0 40 19 cmp %g1, %i1 4000b01c: 02 80 00 56 be 4000b174 <_RBTree_Extract_unprotected+0x180> 4000b020: 90 10 00 19 mov %i1, %o0 * 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]) { 4000b024: fa 06 60 04 ld [ %i1 + 4 ], %i5 4000b028: 80 a7 60 00 cmp %i5, 0 4000b02c: 22 80 00 5a be,a 4000b194 <_RBTree_Extract_unprotected+0x1a0> 4000b030: f8 06 60 08 ld [ %i1 + 8 ], %i4 4000b034: c2 06 60 08 ld [ %i1 + 8 ], %g1 4000b038: 80 a0 60 00 cmp %g1, 0 4000b03c: 32 80 00 05 bne,a 4000b050 <_RBTree_Extract_unprotected+0x5c> 4000b040: c2 07 60 08 ld [ %i5 + 8 ], %g1 4000b044: 10 80 00 3c b 4000b134 <_RBTree_Extract_unprotected+0x140> 4000b048: b8 10 00 1d mov %i5, %i4 target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; 4000b04c: c2 07 60 08 ld [ %i5 + 8 ], %g1 4000b050: 80 a0 60 00 cmp %g1, 0 4000b054: 32 bf ff fe bne,a 4000b04c <_RBTree_Extract_unprotected+0x58> 4000b058: ba 10 00 01 mov %g1, %i5 * 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]; 4000b05c: f8 07 60 04 ld [ %i5 + 4 ], %i4 if(leaf) { 4000b060: 80 a7 20 00 cmp %i4, 0 4000b064: 02 80 00 48 be 4000b184 <_RBTree_Extract_unprotected+0x190> 4000b068: 01 00 00 00 nop leaf->parent = target->parent; 4000b06c: c2 07 40 00 ld [ %i5 ], %g1 4000b070: c2 27 00 00 st %g1, [ %i4 ] } 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]; 4000b074: c4 07 40 00 ld [ %i5 ], %g2 target->parent->child[dir] = leaf; /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 4000b078: c2 06 40 00 ld [ %i1 ], %g1 } 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]; 4000b07c: c8 00 a0 04 ld [ %g2 + 4 ], %g4 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; 4000b080: c6 07 60 0c ld [ %i5 + 0xc ], %g3 dir = target != target->parent->child[0]; 4000b084: 88 1f 40 04 xor %i5, %g4, %g4 4000b088: 80 a0 00 04 cmp %g0, %g4 4000b08c: 88 40 20 00 addx %g0, 0, %g4 target->parent->child[dir] = leaf; 4000b090: 89 29 20 02 sll %g4, 2, %g4 4000b094: 84 00 80 04 add %g2, %g4, %g2 4000b098: f8 20 a0 04 st %i4, [ %g2 + 4 ] /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 4000b09c: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000b0a0: 84 18 80 19 xor %g2, %i1, %g2 4000b0a4: 80 a0 00 02 cmp %g0, %g2 4000b0a8: 84 40 20 00 addx %g0, 0, %g2 the_node->parent->child[dir] = target; 4000b0ac: 85 28 a0 02 sll %g2, 2, %g2 4000b0b0: 82 00 40 02 add %g1, %g2, %g1 4000b0b4: fa 20 60 04 st %i5, [ %g1 + 4 ] /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; 4000b0b8: c2 06 60 08 ld [ %i1 + 8 ], %g1 4000b0bc: c2 27 60 08 st %g1, [ %i5 + 8 ] if (the_node->child[RBT_RIGHT]) 4000b0c0: c2 06 60 08 ld [ %i1 + 8 ], %g1 4000b0c4: 80 a0 60 00 cmp %g1, 0 4000b0c8: 32 80 00 02 bne,a 4000b0d0 <_RBTree_Extract_unprotected+0xdc><== ALWAYS TAKEN 4000b0cc: fa 20 40 00 st %i5, [ %g1 ] the_node->child[RBT_RIGHT]->parent = target; target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 4000b0d0: c2 06 60 04 ld [ %i1 + 4 ], %g1 4000b0d4: c2 27 60 04 st %g1, [ %i5 + 4 ] if (the_node->child[RBT_LEFT]) 4000b0d8: c2 06 60 04 ld [ %i1 + 4 ], %g1 4000b0dc: 80 a0 60 00 cmp %g1, 0 4000b0e0: 32 80 00 02 bne,a 4000b0e8 <_RBTree_Extract_unprotected+0xf4> 4000b0e4: fa 20 40 00 st %i5, [ %g1 ] /* 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; 4000b0e8: c4 06 40 00 ld [ %i1 ], %g2 target->color = the_node->color; 4000b0ec: c2 06 60 0c ld [ %i1 + 0xc ], %g1 /* 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; 4000b0f0: c4 27 40 00 st %g2, [ %i5 ] target->color = the_node->color; 4000b0f4: c2 27 60 0c st %g1, [ %i5 + 0xc ] /* fix coloring. leaf has moved up the tree. The color of the deleted * node is in victim_color. There are two cases: * 1. Deleted a red node, its child must be black. Nothing must be done. * 2. Deleted a black node, its child must be red. Paint child black. */ if (victim_color == RBT_BLACK) { /* eliminate case 1 */ 4000b0f8: 80 a0 e0 00 cmp %g3, 0 4000b0fc: 32 80 00 06 bne,a 4000b114 <_RBTree_Extract_unprotected+0x120> 4000b100: c2 06 20 04 ld [ %i0 + 4 ], %g1 if (leaf) { 4000b104: 80 a7 20 00 cmp %i4, 0 4000b108: 32 80 00 02 bne,a 4000b110 <_RBTree_Extract_unprotected+0x11c> 4000b10c: c0 27 20 0c clr [ %i4 + 0xc ] /* 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; 4000b110: 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; 4000b114: c0 26 60 08 clr [ %i1 + 8 ] 4000b118: c0 26 60 04 clr [ %i1 + 4 ] 4000b11c: 80 a0 60 00 cmp %g1, 0 4000b120: 02 80 00 03 be 4000b12c <_RBTree_Extract_unprotected+0x138> 4000b124: c0 26 40 00 clr [ %i1 ] 4000b128: c0 20 60 0c clr [ %g1 + 0xc ] 4000b12c: 81 c7 e0 08 ret 4000b130: 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; 4000b134: c2 06 40 00 ld [ %i1 ], %g1 4000b138: 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]; 4000b13c: 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; 4000b140: c6 06 60 0c ld [ %i1 + 0xc ], %g3 /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 4000b144: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000b148: 84 18 80 19 xor %g2, %i1, %g2 4000b14c: 80 a0 00 02 cmp %g0, %g2 4000b150: 84 40 20 00 addx %g0, 0, %g2 the_node->parent->child[dir] = leaf; 4000b154: 85 28 a0 02 sll %g2, 2, %g2 4000b158: 82 00 40 02 add %g1, %g2, %g1 4000b15c: 10 bf ff e7 b 4000b0f8 <_RBTree_Extract_unprotected+0x104> 4000b160: f8 20 60 04 st %i4, [ %g1 + 4 ] */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_RIGHT ); 4000b164: 40 00 00 eb call 4000b510 <_RBTree_Next_unprotected> 4000b168: 92 10 20 01 mov 1, %o1 /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; 4000b16c: 10 bf ff aa b 4000b014 <_RBTree_Extract_unprotected+0x20> 4000b170: d0 26 20 08 st %o0, [ %i0 + 8 ] */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_LEFT ); 4000b174: 40 00 00 e7 call 4000b510 <_RBTree_Next_unprotected> 4000b178: 92 10 20 00 clr %o1 /* Check if max needs to be updated. min=max for 1 element trees so * do not use else if here. */ if (the_node == the_rbtree->first[RBT_RIGHT]) { RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; 4000b17c: 10 bf ff aa b 4000b024 <_RBTree_Extract_unprotected+0x30> 4000b180: d0 26 20 0c st %o0, [ %i0 + 0xc ] 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); 4000b184: 7f ff fe d3 call 4000acd0 <_RBTree_Extract_validate_unprotected> 4000b188: 90 10 00 1d mov %i5, %o0 } victim_color = target->color; dir = target != target->parent->child[0]; 4000b18c: 10 bf ff bb b 4000b078 <_RBTree_Extract_unprotected+0x84> 4000b190: c4 07 40 00 ld [ %i5 ], %g2 * 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 ) { 4000b194: 80 a7 20 00 cmp %i4, 0 4000b198: 32 bf ff e8 bne,a 4000b138 <_RBTree_Extract_unprotected+0x144> 4000b19c: 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); 4000b1a0: 7f ff fe cc call 4000acd0 <_RBTree_Extract_validate_unprotected> 4000b1a4: 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]; 4000b1a8: 10 bf ff e6 b 4000b140 <_RBTree_Extract_unprotected+0x14c> 4000b1ac: c2 06 40 00 ld [ %i1 ], %g1 =============================================================================== 4000acd0 <_RBTree_Extract_validate_unprotected>: ) { RBTree_Node *parent, *sibling; RBTree_Direction dir; parent = the_node->parent; 4000acd0: c2 02 00 00 ld [ %o0 ], %g1 if(!parent->parent) return; 4000acd4: c4 00 40 00 ld [ %g1 ], %g2 4000acd8: 80 a0 a0 00 cmp %g2, 0 4000acdc: 02 80 00 3f be 4000add8 <_RBTree_Extract_validate_unprotected+0x108> 4000ace0: 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]) 4000ace4: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000ace8: 80 a2 00 02 cmp %o0, %g2 4000acec: 22 80 00 02 be,a 4000acf4 <_RBTree_Extract_validate_unprotected+0x24> 4000acf0: c4 00 60 08 ld [ %g1 + 8 ], %g2 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 4000acf4: c6 02 20 0c ld [ %o0 + 0xc ], %g3 4000acf8: 80 a0 e0 01 cmp %g3, 1 4000acfc: 02 80 00 32 be 4000adc4 <_RBTree_Extract_validate_unprotected+0xf4> 4000ad00: 9a 10 20 01 mov 1, %o5 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) { 4000ad04: c6 00 40 00 ld [ %g1 ], %g3 4000ad08: 80 a0 e0 00 cmp %g3, 0 4000ad0c: 02 80 00 2e be 4000adc4 <_RBTree_Extract_validate_unprotected+0xf4> 4000ad10: 80 a0 a0 00 cmp %g2, 0 4000ad14: 22 80 00 07 be,a 4000ad30 <_RBTree_Extract_validate_unprotected+0x60><== NEVER TAKEN 4000ad18: c6 00 a0 08 ld [ %g2 + 8 ], %g3 <== NOT EXECUTED 4000ad1c: c8 00 a0 0c ld [ %g2 + 0xc ], %g4 4000ad20: 80 a1 20 01 cmp %g4, 1 4000ad24: 22 80 00 63 be,a 4000aeb0 <_RBTree_Extract_validate_unprotected+0x1e0> 4000ad28: d8 00 60 04 ld [ %g1 + 4 ], %o4 _RBTree_Rotate(parent, dir); sibling = parent->child[_RBTree_Opposite_direction(dir)]; } /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && 4000ad2c: c6 00 a0 08 ld [ %g2 + 8 ], %g3 4000ad30: 80 a0 e0 00 cmp %g3, 0 4000ad34: 22 80 00 07 be,a 4000ad50 <_RBTree_Extract_validate_unprotected+0x80> 4000ad38: c6 00 a0 04 ld [ %g2 + 4 ], %g3 4000ad3c: c6 00 e0 0c ld [ %g3 + 0xc ], %g3 4000ad40: 80 a0 e0 01 cmp %g3, 1 4000ad44: 22 80 00 29 be,a 4000ade8 <_RBTree_Extract_validate_unprotected+0x118> 4000ad48: c6 00 60 04 ld [ %g1 + 4 ], %g3 !_RBTree_Is_red(sibling->child[RBT_LEFT])) { 4000ad4c: c6 00 a0 04 ld [ %g2 + 4 ], %g3 4000ad50: 80 a0 e0 00 cmp %g3, 0 4000ad54: 22 80 00 07 be,a 4000ad70 <_RBTree_Extract_validate_unprotected+0xa0> 4000ad58: da 20 a0 0c st %o5, [ %g2 + 0xc ] 4000ad5c: c6 00 e0 0c ld [ %g3 + 0xc ], %g3 4000ad60: 80 a0 e0 01 cmp %g3, 1 4000ad64: 22 80 00 21 be,a 4000ade8 <_RBTree_Extract_validate_unprotected+0x118> 4000ad68: c6 00 60 04 ld [ %g1 + 4 ], %g3 sibling->color = RBT_RED; 4000ad6c: da 20 a0 0c st %o5, [ %g2 + 0xc ] 4000ad70: c4 00 60 0c ld [ %g1 + 0xc ], %g2 4000ad74: 80 a0 a0 01 cmp %g2, 1 4000ad78: 22 80 00 99 be,a 4000afdc <_RBTree_Extract_validate_unprotected+0x30c> 4000ad7c: c0 20 60 0c clr [ %g1 + 0xc ] if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; break; } the_node = parent; /* done if parent is red */ parent = the_node->parent; 4000ad80: c6 00 40 00 ld [ %g1 ], %g3 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 4000ad84: 80 a0 e0 00 cmp %g3, 0 4000ad88: 02 80 00 6c be 4000af38 <_RBTree_Extract_validate_unprotected+0x268><== NEVER TAKEN 4000ad8c: 90 10 00 01 mov %g1, %o0 if(!(the_node->parent->parent)) return NULL; 4000ad90: c4 00 c0 00 ld [ %g3 ], %g2 4000ad94: 80 a0 a0 00 cmp %g2, 0 4000ad98: 02 80 00 69 be 4000af3c <_RBTree_Extract_validate_unprotected+0x26c> 4000ad9c: 84 10 20 00 clr %g2 if(the_node == the_node->parent->child[RBT_LEFT]) 4000ada0: c4 00 e0 04 ld [ %g3 + 4 ], %g2 4000ada4: 80 a0 40 02 cmp %g1, %g2 4000ada8: 22 80 00 0e be,a 4000ade0 <_RBTree_Extract_validate_unprotected+0x110> 4000adac: c4 00 e0 08 ld [ %g3 + 8 ], %g2 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 4000adb0: 82 10 00 03 mov %g3, %g1 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 4000adb4: c6 02 20 0c ld [ %o0 + 0xc ], %g3 4000adb8: 80 a0 e0 01 cmp %g3, 1 4000adbc: 32 bf ff d3 bne,a 4000ad08 <_RBTree_Extract_validate_unprotected+0x38><== ALWAYS TAKEN 4000adc0: c6 00 40 00 ld [ %g1 ], %g3 sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 4000adc4: c2 02 00 00 ld [ %o0 ], %g1 4000adc8: c2 00 40 00 ld [ %g1 ], %g1 4000adcc: 80 a0 60 00 cmp %g1, 0 4000add0: 02 80 00 5f be 4000af4c <_RBTree_Extract_validate_unprotected+0x27c> 4000add4: 01 00 00 00 nop 4000add8: 81 c3 e0 08 retl 4000addc: 01 00 00 00 nop RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 4000ade0: 10 bf ff f5 b 4000adb4 <_RBTree_Extract_validate_unprotected+0xe4> 4000ade4: 82 10 00 03 mov %g3, %g1 * 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]; 4000ade8: 86 1a 00 03 xor %o0, %g3, %g3 4000adec: 80 a0 00 03 cmp %g0, %g3 4000adf0: 9a 40 20 00 addx %g0, 0, %o5 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 4000adf4: 86 1b 60 01 xor %o5, 1, %g3 if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { 4000adf8: 87 28 e0 02 sll %g3, 2, %g3 4000adfc: 88 00 80 03 add %g2, %g3, %g4 4000ae00: 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); 4000ae04: 80 a1 20 00 cmp %g4, 0 4000ae08: 22 80 00 07 be,a 4000ae24 <_RBTree_Extract_validate_unprotected+0x154> 4000ae0c: 9b 2b 60 02 sll %o5, 2, %o5 4000ae10: d8 01 20 0c ld [ %g4 + 0xc ], %o4 4000ae14: 80 a3 20 01 cmp %o4, 1 4000ae18: 22 80 00 4f be,a 4000af54 <_RBTree_Extract_validate_unprotected+0x284> 4000ae1c: d6 00 60 0c ld [ %g1 + 0xc ], %o3 sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; 4000ae20: 9b 2b 60 02 sll %o5, 2, %o5 4000ae24: 98 00 80 0d add %g2, %o5, %o4 4000ae28: c8 03 20 04 ld [ %o4 + 4 ], %g4 * 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[_RBTree_Opposite_direction(dir)])) { sibling->color = RBT_RED; 4000ae2c: 96 10 20 01 mov 1, %o3 4000ae30: d6 20 a0 0c st %o3, [ %g2 + 0xc ] RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 4000ae34: 80 a1 20 00 cmp %g4, 0 4000ae38: 02 80 00 15 be 4000ae8c <_RBTree_Extract_validate_unprotected+0x1bc><== NEVER TAKEN 4000ae3c: c0 21 20 0c clr [ %g4 + 0xc ] c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 4000ae40: 96 01 00 03 add %g4, %g3, %o3 4000ae44: d4 02 e0 04 ld [ %o3 + 4 ], %o2 4000ae48: d4 23 20 04 st %o2, [ %o4 + 4 ] if (c->child[dir]) 4000ae4c: d8 02 e0 04 ld [ %o3 + 4 ], %o4 4000ae50: 80 a3 20 00 cmp %o4, 0 4000ae54: 32 80 00 02 bne,a 4000ae5c <_RBTree_Extract_validate_unprotected+0x18c> 4000ae58: c4 23 00 00 st %g2, [ %o4 ] c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4000ae5c: d8 00 80 00 ld [ %g2 ], %o4 the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 4000ae60: 96 01 00 03 add %g4, %g3, %o3 4000ae64: c4 22 e0 04 st %g2, [ %o3 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4000ae68: d6 03 20 04 ld [ %o4 + 4 ], %o3 c->parent = the_node->parent; 4000ae6c: d8 21 00 00 st %o4, [ %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; 4000ae70: 96 18 80 0b xor %g2, %o3, %o3 c->parent = the_node->parent; the_node->parent = c; 4000ae74: c8 20 80 00 st %g4, [ %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; 4000ae78: 80 a0 00 0b cmp %g0, %o3 4000ae7c: 84 40 20 00 addx %g0, 0, %g2 4000ae80: 85 28 a0 02 sll %g2, 2, %g2 4000ae84: 98 03 00 02 add %o4, %g2, %o4 4000ae88: c8 23 20 04 st %g4, [ %o4 + 4 ] sibling->child[dir]->color = RBT_BLACK; _RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir)); sibling = parent->child[_RBTree_Opposite_direction(dir)]; } sibling->color = parent->color; 4000ae8c: c8 00 60 0c ld [ %g1 + 0xc ], %g4 dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; _RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir)); sibling = parent->child[_RBTree_Opposite_direction(dir)]; 4000ae90: 84 00 40 03 add %g1, %g3, %g2 4000ae94: c4 00 a0 04 ld [ %g2 + 4 ], %g2 } sibling->color = parent->color; 4000ae98: c8 20 a0 0c st %g4, [ %g2 + 0xc ] 4000ae9c: 88 00 80 03 add %g2, %g3, %g4 4000aea0: c8 01 20 04 ld [ %g4 + 4 ], %g4 parent->color = RBT_BLACK; 4000aea4: c0 20 60 0c clr [ %g1 + 0xc ] sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; 4000aea8: 10 80 00 33 b 4000af74 <_RBTree_Extract_validate_unprotected+0x2a4> 4000aeac: c0 21 20 0c clr [ %g4 + 0xc ] * 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; 4000aeb0: c8 20 60 0c st %g4, [ %g1 + 0xc ] sibling->color = RBT_BLACK; dir = the_node != parent->child[0]; 4000aeb4: 88 1b 00 08 xor %o4, %o0, %g4 4000aeb8: 80 a0 00 04 cmp %g0, %g4 4000aebc: 94 40 20 00 addx %g0, 0, %o2 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 4000aec0: 96 1a a0 01 xor %o2, 1, %o3 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 4000aec4: 97 2a e0 02 sll %o3, 2, %o3 4000aec8: 98 00 40 0b add %g1, %o3, %o4 4000aecc: c8 03 20 04 ld [ %o4 + 4 ], %g4 4000aed0: 80 a1 20 00 cmp %g4, 0 4000aed4: 02 80 00 1c be 4000af44 <_RBTree_Extract_validate_unprotected+0x274><== NEVER TAKEN 4000aed8: c0 20 a0 0c clr [ %g2 + 0xc ] c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 4000aedc: 95 2a a0 02 sll %o2, 2, %o2 4000aee0: 84 01 00 0a add %g4, %o2, %g2 4000aee4: d2 00 a0 04 ld [ %g2 + 4 ], %o1 4000aee8: d2 23 20 04 st %o1, [ %o4 + 4 ] if (c->child[dir]) 4000aeec: c4 00 a0 04 ld [ %g2 + 4 ], %g2 4000aef0: 80 a0 a0 00 cmp %g2, 0 4000aef4: 02 80 00 04 be 4000af04 <_RBTree_Extract_validate_unprotected+0x234><== NEVER TAKEN 4000aef8: 94 01 00 0a add %g4, %o2, %o2 c->child[dir]->parent = the_node; 4000aefc: c2 20 80 00 st %g1, [ %g2 ] 4000af00: c6 00 40 00 ld [ %g1 ], %g3 c->child[dir] = the_node; 4000af04: c2 22 a0 04 st %g1, [ %o2 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4000af08: c4 00 e0 04 ld [ %g3 + 4 ], %g2 c->parent = the_node->parent; 4000af0c: c6 21 00 00 st %g3, [ %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; 4000af10: 84 18 40 02 xor %g1, %g2, %g2 4000af14: 80 a0 00 02 cmp %g0, %g2 4000af18: 84 40 20 00 addx %g0, 0, %g2 4000af1c: 85 28 a0 02 sll %g2, 2, %g2 4000af20: 96 00 40 0b add %g1, %o3, %o3 4000af24: 86 00 c0 02 add %g3, %g2, %g3 c->parent = the_node->parent; the_node->parent = c; 4000af28: 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; 4000af2c: c8 20 e0 04 st %g4, [ %g3 + 4 ] 4000af30: 10 bf ff 7f b 4000ad2c <_RBTree_Extract_validate_unprotected+0x5c> 4000af34: c4 02 e0 04 ld [ %o3 + 4 ], %g2 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 4000af38: 84 10 20 00 clr %g2 <== NOT EXECUTED 4000af3c: 10 bf ff 9e b 4000adb4 <_RBTree_Extract_validate_unprotected+0xe4> 4000af40: 82 10 00 03 mov %g3, %g1 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 4000af44: 10 bf ff 7a b 4000ad2c <_RBTree_Extract_validate_unprotected+0x5c><== NOT EXECUTED 4000af48: 84 10 20 00 clr %g2 <== NOT EXECUTED sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 4000af4c: 81 c3 e0 08 retl 4000af50: c0 22 20 0c clr [ %o0 + 0xc ] 4000af54: 98 00 40 03 add %g1, %g3, %o4 sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; _RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir)); sibling = parent->child[_RBTree_Opposite_direction(dir)]; } sibling->color = parent->color; 4000af58: d6 20 a0 0c st %o3, [ %g2 + 0xc ] parent->color = RBT_BLACK; 4000af5c: c0 20 60 0c clr [ %g1 + 0xc ] 4000af60: c4 03 20 04 ld [ %o4 + 4 ], %g2 4000af64: 80 a0 a0 00 cmp %g2, 0 4000af68: 02 bf ff 97 be 4000adc4 <_RBTree_Extract_validate_unprotected+0xf4><== NEVER TAKEN 4000af6c: c0 21 20 0c clr [ %g4 + 0xc ] 4000af70: 9b 2b 60 02 sll %o5, 2, %o5 c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 4000af74: 88 00 80 0d add %g2, %o5, %g4 4000af78: d8 01 20 04 ld [ %g4 + 4 ], %o4 4000af7c: 86 00 40 03 add %g1, %g3, %g3 4000af80: d8 20 e0 04 st %o4, [ %g3 + 4 ] if (c->child[dir]) 4000af84: c6 01 20 04 ld [ %g4 + 4 ], %g3 4000af88: 80 a0 e0 00 cmp %g3, 0 4000af8c: 32 80 00 02 bne,a 4000af94 <_RBTree_Extract_validate_unprotected+0x2c4> 4000af90: c2 20 c0 00 st %g1, [ %g3 ] c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4000af94: c6 00 40 00 ld [ %g1 ], %g3 the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 4000af98: 9a 00 80 0d add %g2, %o5, %o5 4000af9c: c2 23 60 04 st %g1, [ %o5 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4000afa0: c8 00 e0 04 ld [ %g3 + 4 ], %g4 c->parent = the_node->parent; 4000afa4: c6 20 80 00 st %g3, [ %g2 ] the_node->parent = c; 4000afa8: c4 20 40 00 st %g2, [ %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; 4000afac: 88 18 40 04 xor %g1, %g4, %g4 4000afb0: 80 a0 00 04 cmp %g0, %g4 4000afb4: 82 40 20 00 addx %g0, 0, %g1 4000afb8: 83 28 60 02 sll %g1, 2, %g1 4000afbc: 86 00 c0 01 add %g3, %g1, %g3 sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 4000afc0: c2 02 00 00 ld [ %o0 ], %g1 4000afc4: c4 20 e0 04 st %g2, [ %g3 + 4 ] 4000afc8: c2 00 40 00 ld [ %g1 ], %g1 4000afcc: 80 a0 60 00 cmp %g1, 0 4000afd0: 12 bf ff 82 bne 4000add8 <_RBTree_Extract_validate_unprotected+0x108><== ALWAYS TAKEN 4000afd4: 01 00 00 00 nop 4000afd8: 30 bf ff dd b,a 4000af4c <_RBTree_Extract_validate_unprotected+0x27c><== NOT EXECUTED 4000afdc: c2 02 00 00 ld [ %o0 ], %g1 4000afe0: c2 00 40 00 ld [ %g1 ], %g1 4000afe4: 80 a0 60 00 cmp %g1, 0 4000afe8: 12 bf ff 7c bne 4000add8 <_RBTree_Extract_validate_unprotected+0x108><== ALWAYS TAKEN 4000afec: 01 00 00 00 nop 4000aff0: 30 bf ff d7 b,a 4000af4c <_RBTree_Extract_validate_unprotected+0x27c><== NOT EXECUTED =============================================================================== 4000be8c <_RBTree_Find>: RBTree_Node *_RBTree_Find( RBTree_Control *the_rbtree, RBTree_Node *search_node ) { 4000be8c: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; RBTree_Node *return_node; return_node = NULL; _ISR_Disable( level ); 4000be90: 7f ff df 23 call 40003b1c 4000be94: b8 10 00 18 mov %i0, %i4 4000be98: b6 10 00 08 mov %o0, %i3 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; 4000be9c: fa 06 20 04 ld [ %i0 + 4 ], %i5 RBTree_Node* found = NULL; int compare_result; while (iter_node) { 4000bea0: 80 a7 60 00 cmp %i5, 0 4000bea4: 02 80 00 15 be 4000bef8 <_RBTree_Find+0x6c> <== NEVER TAKEN 4000bea8: b0 10 20 00 clr %i0 compare_result = the_rbtree->compare_function(the_node, iter_node); 4000beac: c2 07 20 10 ld [ %i4 + 0x10 ], %g1 4000beb0: 92 10 00 1d mov %i5, %o1 4000beb4: 9f c0 40 00 call %g1 4000beb8: 90 10 00 19 mov %i1, %o0 RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater( int compare_result ) { return compare_result > 0; 4000bebc: 83 3a 20 1f sra %o0, 0x1f, %g1 RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( _RBTree_Is_equal( compare_result ) ) { 4000bec0: 80 a2 20 00 cmp %o0, 0 RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater( int compare_result ) { return compare_result > 0; 4000bec4: 82 20 40 08 sub %g1, %o0, %g1 4000bec8: 83 30 60 1f srl %g1, 0x1f, %g1 break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; 4000becc: 83 28 60 02 sll %g1, 2, %g1 RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( _RBTree_Is_equal( compare_result ) ) { 4000bed0: 12 80 00 06 bne 4000bee8 <_RBTree_Find+0x5c> 4000bed4: 82 07 40 01 add %i5, %g1, %g1 found = iter_node; if ( the_rbtree->is_unique ) 4000bed8: c4 0f 20 14 ldub [ %i4 + 0x14 ], %g2 4000bedc: 80 a0 a0 00 cmp %g2, 0 4000bee0: 12 80 00 0a bne 4000bf08 <_RBTree_Find+0x7c> 4000bee4: b0 10 00 1d mov %i5, %i0 break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; 4000bee8: fa 00 60 04 ld [ %g1 + 4 ], %i5 ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { 4000beec: 80 a7 60 00 cmp %i5, 0 4000bef0: 32 bf ff f0 bne,a 4000beb0 <_RBTree_Find+0x24> 4000bef4: c2 07 20 10 ld [ %i4 + 0x10 ], %g1 return_node = _RBTree_Find_unprotected( the_rbtree, search_node ); _ISR_Enable( level ); 4000bef8: 7f ff df 0d call 40003b2c 4000befc: 90 10 00 1b mov %i3, %o0 return return_node; } 4000bf00: 81 c7 e0 08 ret 4000bf04: 81 e8 00 00 restore RBTree_Node *return_node; return_node = NULL; _ISR_Disable( level ); return_node = _RBTree_Find_unprotected( the_rbtree, search_node ); _ISR_Enable( level ); 4000bf08: 7f ff df 09 call 40003b2c 4000bf0c: 90 10 00 1b mov %i3, %o0 return return_node; } 4000bf10: 81 c7 e0 08 ret 4000bf14: 81 e8 00 00 restore =============================================================================== 4000c2f8 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 4000c2f8: 9d e3 bf a0 save %sp, -96, %sp size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 4000c2fc: 80 a6 20 00 cmp %i0, 0 4000c300: 02 80 00 0f be 4000c33c <_RBTree_Initialize+0x44> <== NEVER TAKEN 4000c304: 80 a6 e0 00 cmp %i3, 0 RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 4000c308: c0 26 00 00 clr [ %i0 ] the_rbtree->root = NULL; 4000c30c: c0 26 20 04 clr [ %i0 + 4 ] the_rbtree->first[0] = NULL; 4000c310: c0 26 20 08 clr [ %i0 + 8 ] the_rbtree->first[1] = NULL; 4000c314: c0 26 20 0c clr [ %i0 + 0xc ] the_rbtree->compare_function = compare_function; 4000c318: f2 26 20 10 st %i1, [ %i0 + 0x10 ] /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 4000c31c: 02 80 00 08 be 4000c33c <_RBTree_Initialize+0x44> <== NEVER TAKEN 4000c320: fa 2e 20 14 stb %i5, [ %i0 + 0x14 ] _RBTree_Insert_unprotected(the_rbtree, next); 4000c324: 92 10 00 1a mov %i2, %o1 4000c328: 7f ff ff 0b call 4000bf54 <_RBTree_Insert_unprotected> 4000c32c: 90 10 00 18 mov %i0, %o0 /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 4000c330: b6 86 ff ff addcc %i3, -1, %i3 4000c334: 12 bf ff fc bne 4000c324 <_RBTree_Initialize+0x2c> 4000c338: b4 06 80 1c add %i2, %i4, %i2 4000c33c: 81 c7 e0 08 ret 4000c340: 81 e8 00 00 restore =============================================================================== 4000b1d4 <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 4000b1d4: 9d e3 bf a0 save %sp, -96, %sp if(!the_node) return (RBTree_Node*)-1; 4000b1d8: 80 a6 60 00 cmp %i1, 0 4000b1dc: 02 80 00 9c be 4000b44c <_RBTree_Insert_unprotected+0x278> 4000b1e0: b8 10 00 18 mov %i0, %i4 RBTree_Node *iter_node = the_rbtree->root; 4000b1e4: fa 06 20 04 ld [ %i0 + 4 ], %i5 int compare_result; if (!iter_node) { /* special case: first node inserted */ 4000b1e8: 80 a7 60 00 cmp %i5, 0 4000b1ec: 32 80 00 05 bne,a 4000b200 <_RBTree_Insert_unprotected+0x2c> 4000b1f0: c2 07 20 10 ld [ %i4 + 0x10 ], %g1 the_node->color = RBT_BLACK; 4000b1f4: 10 80 00 9a b 4000b45c <_RBTree_Insert_unprotected+0x288> 4000b1f8: c0 26 60 0c clr [ %i1 + 0xc ] 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) { compare_result = the_rbtree->compare_function(the_node, iter_node); 4000b1fc: c2 07 20 10 ld [ %i4 + 0x10 ], %g1 4000b200: 92 10 00 1d mov %i5, %o1 4000b204: 9f c0 40 00 call %g1 4000b208: 90 10 00 19 mov %i1, %o0 if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 4000b20c: c4 0f 20 14 ldub [ %i4 + 0x14 ], %g2 return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 4000b210: b6 38 00 08 xnor %g0, %o0, %i3 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) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 4000b214: 80 a0 a0 00 cmp %g2, 0 return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 4000b218: b7 36 e0 1f srl %i3, 0x1f, %i3 if (!iter_node->child[dir]) { 4000b21c: 83 2e e0 02 sll %i3, 2, %g1 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) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 4000b220: 02 80 00 05 be 4000b234 <_RBTree_Insert_unprotected+0x60> 4000b224: 82 07 40 01 add %i5, %g1, %g1 4000b228: 80 a2 20 00 cmp %o0, 0 4000b22c: 02 80 00 8a be 4000b454 <_RBTree_Insert_unprotected+0x280> 4000b230: 01 00 00 00 nop return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); if (!iter_node->child[dir]) { 4000b234: f0 00 60 04 ld [ %g1 + 4 ], %i0 4000b238: 80 a6 20 00 cmp %i0, 0 4000b23c: 32 bf ff f0 bne,a 4000b1fc <_RBTree_Insert_unprotected+0x28> 4000b240: ba 10 00 18 mov %i0, %i5 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; the_node->color = RBT_RED; iter_node->child[dir] = the_node; the_node->parent = iter_node; /* update min/max */ compare_result = the_rbtree->compare_function( 4000b244: c4 07 20 10 ld [ %i4 + 0x10 ], %g2 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 4000b248: b4 06 e0 02 add %i3, 2, %i2 4000b24c: 87 2e a0 02 sll %i2, 2, %g3 4000b250: d2 07 00 03 ld [ %i4 + %g3 ], %o1 compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); if (!iter_node->child[dir]) { the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 4000b254: c0 26 60 08 clr [ %i1 + 8 ] 4000b258: c0 26 60 04 clr [ %i1 + 4 ] the_node->color = RBT_RED; iter_node->child[dir] = the_node; 4000b25c: f2 20 60 04 st %i1, [ %g1 + 4 ] if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); if (!iter_node->child[dir]) { the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; the_node->color = RBT_RED; 4000b260: 82 10 20 01 mov 1, %g1 iter_node->child[dir] = the_node; the_node->parent = iter_node; 4000b264: fa 26 40 00 st %i5, [ %i1 ] if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); if (!iter_node->child[dir]) { the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; the_node->color = RBT_RED; 4000b268: c2 26 60 0c st %g1, [ %i1 + 0xc ] iter_node->child[dir] = the_node; the_node->parent = iter_node; /* update min/max */ compare_result = the_rbtree->compare_function( 4000b26c: 9f c0 80 00 call %g2 4000b270: 90 10 00 19 mov %i1, %o0 the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 4000b274: 80 a6 e0 00 cmp %i3, 0 4000b278: 12 80 00 10 bne 4000b2b8 <_RBTree_Insert_unprotected+0xe4> 4000b27c: 80 a2 20 00 cmp %o0, 0 4000b280: 06 80 00 10 bl 4000b2c0 <_RBTree_Insert_unprotected+0xec> 4000b284: b5 2e a0 02 sll %i2, 2, %i2 4000b288: c2 06 40 00 ld [ %i1 ], %g1 if (dir != pdir) { _RBTree_Rotate(the_node->parent, pdir); the_node = the_node->child[pdir]; } the_node->parent->color = RBT_BLACK; g->color = RBT_RED; 4000b28c: b4 10 20 01 mov 1, %i2 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 4000b290: c4 00 40 00 ld [ %g1 ], %g2 4000b294: 86 90 a0 00 orcc %g2, 0, %g3 4000b298: 22 80 00 06 be,a 4000b2b0 <_RBTree_Insert_unprotected+0xdc> 4000b29c: c0 26 60 0c clr [ %i1 + 0xc ] */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 4000b2a0: c8 00 60 0c ld [ %g1 + 0xc ], %g4 4000b2a4: 80 a1 20 01 cmp %g4, 1 4000b2a8: 22 80 00 08 be,a 4000b2c8 <_RBTree_Insert_unprotected+0xf4> 4000b2ac: f6 00 80 00 ld [ %g2 ], %i3 /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 4000b2b0: 81 c7 e0 08 ret 4000b2b4: 81 e8 00 00 restore compare_result = the_rbtree->compare_function( the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || (dir && _RBTree_Is_greater(compare_result)) ) { 4000b2b8: 04 bf ff f4 ble 4000b288 <_RBTree_Insert_unprotected+0xb4> 4000b2bc: b5 2e a0 02 sll %i2, 2, %i2 the_rbtree->first[dir] = the_node; 4000b2c0: 10 bf ff f2 b 4000b288 <_RBTree_Insert_unprotected+0xb4> 4000b2c4: f2 27 00 1a st %i1, [ %i4 + %i2 ] ) { 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; 4000b2c8: 80 a6 e0 00 cmp %i3, 0 4000b2cc: 02 80 00 0c be 4000b2fc <_RBTree_Insert_unprotected+0x128><== NEVER TAKEN 4000b2d0: c8 00 a0 04 ld [ %g2 + 4 ], %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]) 4000b2d4: 80 a1 00 01 cmp %g4, %g1 4000b2d8: 02 80 00 5b be 4000b444 <_RBTree_Insert_unprotected+0x270> 4000b2dc: ba 10 00 04 mov %g4, %i5 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 4000b2e0: 80 a7 60 00 cmp %i5, 0 4000b2e4: 22 80 00 07 be,a 4000b300 <_RBTree_Insert_unprotected+0x12c> 4000b2e8: fa 00 60 04 ld [ %g1 + 4 ], %i5 4000b2ec: f8 07 60 0c ld [ %i5 + 0xc ], %i4 4000b2f0: 80 a7 20 01 cmp %i4, 1 4000b2f4: 22 80 00 4f be,a 4000b430 <_RBTree_Insert_unprotected+0x25c> 4000b2f8: c0 20 60 0c clr [ %g1 + 0xc ] 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]; 4000b2fc: fa 00 60 04 ld [ %g1 + 4 ], %i5 RBTree_Direction pdir = the_node->parent != g->child[0]; 4000b300: 88 18 40 04 xor %g1, %g4, %g4 4000b304: 80 a0 00 04 cmp %g0, %g4 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]; 4000b308: ba 1e 40 1d xor %i1, %i5, %i5 RBTree_Direction pdir = the_node->parent != g->child[0]; 4000b30c: 88 40 20 00 addx %g0, 0, %g4 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]; 4000b310: 80 a0 00 1d cmp %g0, %i5 4000b314: ba 40 20 00 addx %g0, 0, %i5 RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { 4000b318: 80 a7 40 04 cmp %i5, %g4 4000b31c: 02 80 00 20 be 4000b39c <_RBTree_Insert_unprotected+0x1c8> 4000b320: 80 a0 00 04 cmp %g0, %g4 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 4000b324: b6 60 3f ff subx %g0, -1, %i3 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 4000b328: b7 2e e0 02 sll %i3, 2, %i3 4000b32c: b6 00 40 1b add %g1, %i3, %i3 4000b330: fa 06 e0 04 ld [ %i3 + 4 ], %i5 4000b334: 80 a7 60 00 cmp %i5, 0 4000b338: 02 80 00 16 be 4000b390 <_RBTree_Insert_unprotected+0x1bc><== NEVER TAKEN 4000b33c: b9 29 20 02 sll %g4, 2, %i4 c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 4000b340: 9e 07 40 1c add %i5, %i4, %o7 4000b344: da 03 e0 04 ld [ %o7 + 4 ], %o5 4000b348: da 26 e0 04 st %o5, [ %i3 + 4 ] if (c->child[dir]) 4000b34c: f6 03 e0 04 ld [ %o7 + 4 ], %i3 4000b350: 80 a6 e0 00 cmp %i3, 0 4000b354: 22 80 00 05 be,a 4000b368 <_RBTree_Insert_unprotected+0x194> 4000b358: b6 07 40 1c add %i5, %i4, %i3 c->child[dir]->parent = the_node; 4000b35c: c2 26 c0 00 st %g1, [ %i3 ] 4000b360: c4 00 40 00 ld [ %g1 ], %g2 c->child[dir] = the_node; 4000b364: b6 07 40 1c add %i5, %i4, %i3 4000b368: c2 26 e0 04 st %g1, [ %i3 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4000b36c: f6 00 a0 04 ld [ %g2 + 4 ], %i3 c->parent = the_node->parent; 4000b370: c4 27 40 00 st %g2, [ %i5 ] 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; 4000b374: b6 1e c0 01 xor %i3, %g1, %i3 c->parent = the_node->parent; the_node->parent = c; 4000b378: fa 20 40 00 st %i5, [ %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; 4000b37c: 80 a0 00 1b cmp %g0, %i3 4000b380: 82 40 20 00 addx %g0, 0, %g1 4000b384: 83 28 60 02 sll %g1, 2, %g1 4000b388: 84 00 80 01 add %g2, %g1, %g2 4000b38c: fa 20 a0 04 st %i5, [ %g2 + 4 ] _RBTree_Rotate(the_node->parent, pdir); the_node = the_node->child[pdir]; 4000b390: b2 06 40 1c add %i1, %i4, %i1 4000b394: f2 06 60 04 ld [ %i1 + 4 ], %i1 4000b398: c2 06 40 00 ld [ %i1 ], %g1 } the_node->parent->color = RBT_BLACK; 4000b39c: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 4000b3a0: 88 26 80 04 sub %i2, %g4, %g4 4000b3a4: ba 19 20 01 xor %g4, 1, %i5 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 4000b3a8: bb 2f 60 02 sll %i5, 2, %i5 4000b3ac: ba 00 c0 1d add %g3, %i5, %i5 4000b3b0: c4 07 60 04 ld [ %i5 + 4 ], %g2 4000b3b4: 80 a0 a0 00 cmp %g2, 0 4000b3b8: 02 bf ff b6 be 4000b290 <_RBTree_Insert_unprotected+0xbc> <== NEVER TAKEN 4000b3bc: f4 20 e0 0c st %i2, [ %g3 + 0xc ] c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 4000b3c0: 89 29 20 02 sll %g4, 2, %g4 4000b3c4: 82 00 80 04 add %g2, %g4, %g1 4000b3c8: f8 00 60 04 ld [ %g1 + 4 ], %i4 4000b3cc: f8 27 60 04 st %i4, [ %i5 + 4 ] if (c->child[dir]) 4000b3d0: c2 00 60 04 ld [ %g1 + 4 ], %g1 4000b3d4: 80 a0 60 00 cmp %g1, 0 4000b3d8: 32 80 00 02 bne,a 4000b3e0 <_RBTree_Insert_unprotected+0x20c> 4000b3dc: c6 20 40 00 st %g3, [ %g1 ] c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4000b3e0: fa 00 c0 00 ld [ %g3 ], %i5 the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 4000b3e4: 88 00 80 04 add %g2, %g4, %g4 the_node->parent->child[the_node != the_node->parent->child[0]] = c; c->parent = the_node->parent; 4000b3e8: fa 20 80 00 st %i5, [ %g2 ] the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 4000b3ec: c6 21 20 04 st %g3, [ %g4 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4000b3f0: c8 07 60 04 ld [ %i5 + 4 ], %g4 c->parent = the_node->parent; the_node->parent = c; 4000b3f4: c4 20 c0 00 st %g2, [ %g3 ] 4000b3f8: c2 06 40 00 ld [ %i1 ], %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; 4000b3fc: 86 18 c0 04 xor %g3, %g4, %g3 4000b400: 80 a0 00 03 cmp %g0, %g3 4000b404: 86 40 20 00 addx %g0, 0, %g3 4000b408: 87 28 e0 02 sll %g3, 2, %g3 4000b40c: ba 07 40 03 add %i5, %g3, %i5 4000b410: c4 27 60 04 st %g2, [ %i5 + 4 ] */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 4000b414: c4 00 40 00 ld [ %g1 ], %g2 4000b418: 86 90 a0 00 orcc %g2, 0, %g3 4000b41c: 32 bf ff a2 bne,a 4000b2a4 <_RBTree_Insert_unprotected+0xd0><== ALWAYS TAKEN 4000b420: c8 00 60 0c ld [ %g1 + 0xc ], %g4 } } if(!the_node->parent->parent) the_node->color = RBT_BLACK; 4000b424: c0 26 60 0c clr [ %i1 + 0xc ] <== NOT EXECUTED /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 4000b428: 81 c7 e0 08 ret <== NOT EXECUTED 4000b42c: 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; 4000b430: c0 27 60 0c clr [ %i5 + 0xc ] g->color = RBT_RED; 4000b434: f8 20 a0 0c st %i4, [ %g2 + 0xc ] 4000b438: 82 10 00 1b mov %i3, %g1 4000b43c: 10 bf ff 95 b 4000b290 <_RBTree_Insert_unprotected+0xbc> 4000b440: b2 10 00 02 mov %g2, %i1 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]; 4000b444: 10 bf ff a7 b 4000b2e0 <_RBTree_Insert_unprotected+0x10c> 4000b448: fa 00 a0 08 ld [ %g2 + 8 ], %i5 RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { if(!the_node) return (RBTree_Node*)-1; 4000b44c: 81 c7 e0 08 ret 4000b450: 91 e8 3f ff restore %g0, -1, %o0 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) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 4000b454: 81 c7 e0 08 ret 4000b458: 91 e8 00 1d restore %g0, %i5, %o0 RBTree_Node *iter_node = the_rbtree->root; int compare_result; if (!iter_node) { /* special case: first node inserted */ the_node->color = RBT_BLACK; the_rbtree->root = the_node; 4000b45c: f2 26 20 04 st %i1, [ %i0 + 4 ] the_rbtree->first[0] = the_rbtree->first[1] = the_node; 4000b460: f2 26 20 0c st %i1, [ %i0 + 0xc ] 4000b464: f2 26 20 08 st %i1, [ %i0 + 8 ] the_node->parent = (RBTree_Node *) the_rbtree; 4000b468: f0 26 40 00 st %i0, [ %i1 ] the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 4000b46c: c0 26 60 08 clr [ %i1 + 8 ] 4000b470: c0 26 60 04 clr [ %i1 + 4 ] } /* while(iter_node) */ /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; 4000b474: 81 c7 e0 08 ret 4000b478: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000b4ac <_RBTree_Iterate_unprotected>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 4000b4ac: 9d e3 bf a0 save %sp, -96, %sp */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 4000b4b0: 80 a0 00 19 cmp %g0, %i1 4000b4b4: 82 60 3f ff subx %g0, -1, %g1 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 4000b4b8: 82 00 60 02 add %g1, 2, %g1 4000b4bc: 83 28 60 02 sll %g1, 2, %g1 4000b4c0: fa 06 00 01 ld [ %i0 + %g1 ], %i5 RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { 4000b4c4: 80 a7 60 00 cmp %i5, 0 4000b4c8: 12 80 00 06 bne 4000b4e0 <_RBTree_Iterate_unprotected+0x34><== ALWAYS TAKEN 4000b4cc: 94 10 00 1b mov %i3, %o2 4000b4d0: 30 80 00 0e b,a 4000b508 <_RBTree_Iterate_unprotected+0x5c><== NOT EXECUTED 4000b4d4: 80 8f 20 ff btst 0xff, %i4 4000b4d8: 02 80 00 0c be 4000b508 <_RBTree_Iterate_unprotected+0x5c><== NEVER TAKEN 4000b4dc: 94 10 00 1b mov %i3, %o2 stop = (*visitor)( current, dir, visitor_arg ); 4000b4e0: 90 10 00 1d mov %i5, %o0 4000b4e4: 9f c6 80 00 call %i2 4000b4e8: 92 10 00 19 mov %i1, %o1 current = _RBTree_Next_unprotected( current, dir ); 4000b4ec: 92 10 00 19 mov %i1, %o1 RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { stop = (*visitor)( current, dir, visitor_arg ); 4000b4f0: b8 10 00 08 mov %o0, %i4 current = _RBTree_Next_unprotected( current, dir ); 4000b4f4: 40 00 00 07 call 4000b510 <_RBTree_Next_unprotected> 4000b4f8: 90 10 00 1d mov %i5, %o0 { RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { 4000b4fc: ba 92 20 00 orcc %o0, 0, %i5 4000b500: 12 bf ff f5 bne 4000b4d4 <_RBTree_Iterate_unprotected+0x28> 4000b504: b8 1f 20 01 xor %i4, 1, %i4 4000b508: 81 c7 e0 08 ret 4000b50c: 81 e8 00 00 restore =============================================================================== 40009618 <_RTEMS_signal_Post_switch_hook>: #include #include #include static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing ) { 40009618: 9d e3 bf 98 save %sp, -104, %sp RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4000961c: fa 06 21 4c ld [ %i0 + 0x14c ], %i5 if ( !api ) 40009620: 80 a7 60 00 cmp %i5, 0 40009624: 02 80 00 1e be 4000969c <_RTEMS_signal_Post_switch_hook+0x84><== NEVER TAKEN 40009628: 01 00 00 00 nop * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 4000962c: 7f ff e7 52 call 40003374 40009630: 01 00 00 00 nop signal_set = asr->signals_posted; 40009634: f8 07 60 14 ld [ %i5 + 0x14 ], %i4 asr->signals_posted = 0; 40009638: c0 27 60 14 clr [ %i5 + 0x14 ] _ISR_Enable( level ); 4000963c: 7f ff e7 52 call 40003384 40009640: 01 00 00 00 nop if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 40009644: 80 a7 20 00 cmp %i4, 0 40009648: 32 80 00 04 bne,a 40009658 <_RTEMS_signal_Post_switch_hook+0x40> 4000964c: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 40009650: 81 c7 e0 08 ret 40009654: 81 e8 00 00 restore return; asr->nest_level += 1; rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 40009658: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 4000965c: 82 00 60 01 inc %g1 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 40009660: 94 07 bf fc add %fp, -4, %o2 40009664: 37 00 00 3f sethi %hi(0xfc00), %i3 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 40009668: c2 27 60 1c st %g1, [ %i5 + 0x1c ] rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000966c: 40 00 01 07 call 40009a88 40009670: 92 16 e3 ff or %i3, 0x3ff, %o1 (*asr->handler)( signal_set ); 40009674: c2 07 60 0c ld [ %i5 + 0xc ], %g1 40009678: 9f c0 40 00 call %g1 4000967c: 90 10 00 1c mov %i4, %o0 asr->nest_level -= 1; 40009680: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 40009684: d0 07 bf fc ld [ %fp + -4 ], %o0 asr->nest_level += 1; rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); (*asr->handler)( signal_set ); asr->nest_level -= 1; 40009688: 82 00 7f ff add %g1, -1, %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000968c: 92 16 e3 ff or %i3, 0x3ff, %o1 40009690: 94 07 bf fc add %fp, -4, %o2 40009694: 40 00 00 fd call 40009a88 40009698: c2 27 60 1c st %g1, [ %i5 + 0x1c ] 4000969c: 81 c7 e0 08 ret 400096a0: 81 e8 00 00 restore =============================================================================== 400089cc <_RTEMS_tasks_Initialize_user_tasks_body>: * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { 400089cc: 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; 400089d0: 03 10 00 7d sethi %hi(0x4001f400), %g1 400089d4: 82 10 60 e4 or %g1, 0xe4, %g1 ! 4001f4e4 400089d8: 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 ) 400089dc: 80 a7 60 00 cmp %i5, 0 400089e0: 02 80 00 18 be 40008a40 <_RTEMS_tasks_Initialize_user_tasks_body+0x74> 400089e4: 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++ ) { 400089e8: 80 a6 e0 00 cmp %i3, 0 400089ec: 02 80 00 15 be 40008a40 <_RTEMS_tasks_Initialize_user_tasks_body+0x74><== NEVER TAKEN 400089f0: b8 10 20 00 clr %i4 return_value = rtems_task_create( 400089f4: d4 07 60 04 ld [ %i5 + 4 ], %o2 400089f8: d0 07 40 00 ld [ %i5 ], %o0 400089fc: d2 07 60 08 ld [ %i5 + 8 ], %o1 40008a00: d6 07 60 14 ld [ %i5 + 0x14 ], %o3 40008a04: d8 07 60 0c ld [ %i5 + 0xc ], %o4 40008a08: 7f ff ff 70 call 400087c8 40008a0c: 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 ) ) 40008a10: 94 92 20 00 orcc %o0, 0, %o2 40008a14: 12 80 00 0d bne 40008a48 <_RTEMS_tasks_Initialize_user_tasks_body+0x7c> 40008a18: d0 07 bf fc ld [ %fp + -4 ], %o0 _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 40008a1c: d4 07 60 18 ld [ %i5 + 0x18 ], %o2 40008a20: 40 00 00 0e call 40008a58 40008a24: 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 ) ) 40008a28: 94 92 20 00 orcc %o0, 0, %o2 40008a2c: 12 80 00 07 bne 40008a48 <_RTEMS_tasks_Initialize_user_tasks_body+0x7c> 40008a30: b8 07 20 01 inc %i4 return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 40008a34: 80 a7 00 1b cmp %i4, %i3 40008a38: 12 bf ff ef bne 400089f4 <_RTEMS_tasks_Initialize_user_tasks_body+0x28><== NEVER TAKEN 40008a3c: ba 07 60 1c add %i5, 0x1c, %i5 40008a40: 81 c7 e0 08 ret 40008a44: 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 ); 40008a48: 90 10 20 01 mov 1, %o0 40008a4c: 40 00 04 30 call 40009b0c <_Internal_error_Occurred> 40008a50: 92 10 20 01 mov 1, %o1 =============================================================================== 4000e2e0 <_RTEMS_tasks_Switch_extension>: /* * Per Task Variables */ tvp = executing->task_variables; 4000e2e0: c2 02 21 58 ld [ %o0 + 0x158 ], %g1 while (tvp) { 4000e2e4: 80 a0 60 00 cmp %g1, 0 4000e2e8: 22 80 00 0c be,a 4000e318 <_RTEMS_tasks_Switch_extension+0x38> 4000e2ec: c2 02 61 58 ld [ %o1 + 0x158 ], %g1 tvp->tval = *tvp->ptr; 4000e2f0: c4 00 60 04 ld [ %g1 + 4 ], %g2 *tvp->ptr = tvp->gval; 4000e2f4: c6 00 60 08 ld [ %g1 + 8 ], %g3 * Per Task Variables */ tvp = executing->task_variables; while (tvp) { tvp->tval = *tvp->ptr; 4000e2f8: c8 00 80 00 ld [ %g2 ], %g4 4000e2fc: c8 20 60 0c st %g4, [ %g1 + 0xc ] *tvp->ptr = tvp->gval; 4000e300: c6 20 80 00 st %g3, [ %g2 ] tvp = (rtems_task_variable_t *)tvp->next; 4000e304: c2 00 40 00 ld [ %g1 ], %g1 /* * Per Task Variables */ tvp = executing->task_variables; while (tvp) { 4000e308: 80 a0 60 00 cmp %g1, 0 4000e30c: 32 bf ff fa bne,a 4000e2f4 <_RTEMS_tasks_Switch_extension+0x14><== NEVER TAKEN 4000e310: 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; 4000e314: c2 02 61 58 ld [ %o1 + 0x158 ], %g1 while (tvp) { 4000e318: 80 a0 60 00 cmp %g1, 0 4000e31c: 02 80 00 0d be 4000e350 <_RTEMS_tasks_Switch_extension+0x70> 4000e320: 01 00 00 00 nop tvp->gval = *tvp->ptr; 4000e324: c4 00 60 04 ld [ %g1 + 4 ], %g2 *tvp->ptr = tvp->tval; 4000e328: 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; 4000e32c: c8 00 80 00 ld [ %g2 ], %g4 4000e330: c8 20 60 08 st %g4, [ %g1 + 8 ] *tvp->ptr = tvp->tval; 4000e334: c6 20 80 00 st %g3, [ %g2 ] tvp = (rtems_task_variable_t *)tvp->next; 4000e338: c2 00 40 00 ld [ %g1 ], %g1 *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { 4000e33c: 80 a0 60 00 cmp %g1, 0 4000e340: 32 bf ff fa bne,a 4000e328 <_RTEMS_tasks_Switch_extension+0x48><== NEVER TAKEN 4000e344: c4 00 60 04 ld [ %g1 + 4 ], %g2 <== NOT EXECUTED 4000e348: 81 c3 e0 08 retl 4000e34c: 01 00 00 00 nop 4000e350: 81 c3 e0 08 retl =============================================================================== 4003888c <_Rate_monotonic_Get_status>: bool _Rate_monotonic_Get_status( Rate_monotonic_Control *the_period, Rate_monotonic_Period_time_t *wall_since_last_period, Thread_CPU_usage_t *cpu_since_last_period ) { 4003888c: 9d e3 bf 98 save %sp, -104, %sp */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 40038890: 13 10 01 a5 sethi %hi(0x40069400), %o1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 40038894: f6 06 20 40 ld [ %i0 + 0x40 ], %i3 40038898: 90 07 bf f8 add %fp, -8, %o0 4003889c: 7f ff 41 e1 call 40009020 <_TOD_Get_with_nanoseconds> 400388a0: 92 12 63 e0 or %o1, 0x3e0, %o1 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 400388a4: c4 1f bf f8 ldd [ %fp + -8 ], %g2 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 400388a8: f8 1e 20 50 ldd [ %i0 + 0x50 ], %i4 * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 400388ac: 03 10 01 a7 sethi %hi(0x40069c00), %g1 400388b0: 82 10 61 a0 or %g1, 0x1a0, %g1 ! 40069da0 <_Per_CPU_Information> 400388b4: de 00 60 10 ld [ %g1 + 0x10 ], %o7 400388b8: ba a0 c0 1d subcc %g3, %i5, %i5 400388bc: b8 60 80 1c subx %g2, %i4, %i4 400388c0: f8 3e 40 00 std %i4, [ %i1 ] if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 400388c4: 88 10 20 01 mov 1, %g4 * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 400388c8: 80 a3 c0 1b cmp %o7, %i3 400388cc: 02 80 00 05 be 400388e0 <_Rate_monotonic_Get_status+0x54> 400388d0: f8 1e e0 80 ldd [ %i3 + 0x80 ], %i4 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 400388d4: b0 09 20 01 and %g4, 1, %i0 400388d8: 81 c7 e0 08 ret 400388dc: 81 e8 00 00 restore 400388e0: d8 18 60 20 ldd [ %g1 + 0x20 ], %o4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 400388e4: f0 1e 20 48 ldd [ %i0 + 0x48 ], %i0 400388e8: 86 a0 c0 0d subcc %g3, %o5, %g3 400388ec: 84 60 80 0c subx %g2, %o4, %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 400388f0: 9a 87 40 03 addcc %i5, %g3, %o5 400388f4: 98 47 00 02 addx %i4, %g2, %o4 /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 400388f8: 80 a6 00 0c cmp %i0, %o4 400388fc: 14 bf ff f6 bg 400388d4 <_Rate_monotonic_Get_status+0x48> <== NEVER TAKEN 40038900: 88 10 20 00 clr %g4 40038904: 02 80 00 09 be 40038928 <_Rate_monotonic_Get_status+0x9c> 40038908: 80 a6 40 0d cmp %i1, %o5 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 4003890c: 9a a3 40 19 subcc %o5, %i1, %o5 if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 40038910: 88 10 20 01 mov 1, %g4 40038914: 98 63 00 18 subx %o4, %i0, %o4 } 40038918: b0 09 20 01 and %g4, 1, %i0 4003891c: d8 3e 80 00 std %o4, [ %i2 ] 40038920: 81 c7 e0 08 ret 40038924: 81 e8 00 00 restore /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 40038928: 28 bf ff fa bleu,a 40038910 <_Rate_monotonic_Get_status+0x84> 4003892c: 9a a3 40 19 subcc %o5, %i1, %o5 return false; 40038930: 10 bf ff e9 b 400388d4 <_Rate_monotonic_Get_status+0x48> 40038934: 88 10 20 00 clr %g4 =============================================================================== 40038cdc <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 40038cdc: 9d e3 bf 98 save %sp, -104, %sp 40038ce0: 11 10 01 a8 sethi %hi(0x4006a000), %o0 40038ce4: 92 10 00 18 mov %i0, %o1 40038ce8: 90 12 23 68 or %o0, 0x368, %o0 40038cec: 7f ff 43 a1 call 40009b70 <_Objects_Get> 40038cf0: 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 ) { 40038cf4: c2 07 bf fc ld [ %fp + -4 ], %g1 40038cf8: 80 a0 60 00 cmp %g1, 0 40038cfc: 12 80 00 16 bne 40038d54 <_Rate_monotonic_Timeout+0x78> <== NEVER TAKEN 40038d00: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: the_thread = the_period->owner; 40038d04: d0 02 20 40 ld [ %o0 + 0x40 ], %o0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 40038d08: 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); 40038d0c: c4 02 20 10 ld [ %o0 + 0x10 ], %g2 40038d10: 80 88 80 01 btst %g2, %g1 40038d14: 22 80 00 08 be,a 40038d34 <_Rate_monotonic_Timeout+0x58> 40038d18: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 40038d1c: c4 02 20 20 ld [ %o0 + 0x20 ], %g2 40038d20: c2 07 60 08 ld [ %i5 + 8 ], %g1 40038d24: 80 a0 80 01 cmp %g2, %g1 40038d28: 02 80 00 19 be 40038d8c <_Rate_monotonic_Timeout+0xb0> 40038d2c: 13 04 01 ff sethi %hi(0x1007fc00), %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 ) { 40038d30: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 40038d34: 80 a0 60 01 cmp %g1, 1 40038d38: 02 80 00 09 be 40038d5c <_Rate_monotonic_Timeout+0x80> 40038d3c: 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; 40038d40: 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) { uint32_t level = _Thread_Dispatch_disable_level; 40038d44: 03 10 01 a6 sethi %hi(0x40069800), %g1 40038d48: c4 00 60 90 ld [ %g1 + 0x90 ], %g2 ! 40069890 <_Thread_Dispatch_disable_level> --level; 40038d4c: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 40038d50: c4 20 60 90 st %g2, [ %g1 + 0x90 ] 40038d54: 81 c7 e0 08 ret 40038d58: 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; 40038d5c: 82 10 20 03 mov 3, %g1 _Rate_monotonic_Initiate_statistics( the_period ); 40038d60: 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; 40038d64: c2 27 60 38 st %g1, [ %i5 + 0x38 ] _Rate_monotonic_Initiate_statistics( the_period ); 40038d68: 7f ff ff 43 call 40038a74 <_Rate_monotonic_Initiate_statistics> 40038d6c: 01 00 00 00 nop Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40038d70: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40038d74: 11 10 01 a6 sethi %hi(0x40069800), %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40038d78: c2 27 60 1c st %g1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40038d7c: 90 12 21 28 or %o0, 0x128, %o0 40038d80: 7f ff 4a 6f call 4000b73c <_Watchdog_Insert> 40038d84: 92 07 60 10 add %i5, 0x10, %o1 40038d88: 30 bf ff ef b,a 40038d44 <_Rate_monotonic_Timeout+0x68> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 40038d8c: 7f ff 46 43 call 4000a698 <_Thread_Clear_state> 40038d90: 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 ); 40038d94: 10 bf ff f5 b 40038d68 <_Rate_monotonic_Timeout+0x8c> 40038d98: 90 10 00 1d mov %i5, %o0 =============================================================================== 40038938 <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 40038938: 9d e3 bf 90 save %sp, -112, %sp /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 4003893c: c4 06 20 58 ld [ %i0 + 0x58 ], %g2 if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 40038940: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 40038944: 84 00 a0 01 inc %g2 if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 40038948: 80 a0 60 04 cmp %g1, 4 4003894c: 02 80 00 32 be 40038a14 <_Rate_monotonic_Update_statistics+0xdc> 40038950: c4 26 20 58 st %g2, [ %i0 + 0x58 ] stats->missed_count++; /* * Grab status for time statistics. */ valid_status = 40038954: 90 10 00 18 mov %i0, %o0 40038958: 92 07 bf f8 add %fp, -8, %o1 4003895c: 7f ff ff cc call 4003888c <_Rate_monotonic_Get_status> 40038960: 94 07 bf f0 add %fp, -16, %o2 _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 40038964: 80 8a 20 ff btst 0xff, %o0 40038968: 02 80 00 21 be 400389ec <_Rate_monotonic_Update_statistics+0xb4> 4003896c: c4 1f bf f0 ldd [ %fp + -16 ], %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 40038970: f8 1e 20 70 ldd [ %i0 + 0x70 ], %i4 * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 40038974: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 40038978: b6 87 40 03 addcc %i5, %g3, %i3 4003897c: b4 47 00 02 addx %i4, %g2, %i2 40038980: 80 a0 40 02 cmp %g1, %g2 40038984: 04 80 00 1c ble 400389f4 <_Rate_monotonic_Update_statistics+0xbc> 40038988: f4 3e 20 70 std %i2, [ %i0 + 0x70 ] stats->min_cpu_time = executed; 4003898c: c4 3e 20 60 std %g2, [ %i0 + 0x60 ] if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 40038990: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 40038994: 80 a0 40 02 cmp %g1, %g2 40038998: 26 80 00 05 bl,a 400389ac <_Rate_monotonic_Update_statistics+0x74><== NEVER TAKEN 4003899c: c4 3e 20 68 std %g2, [ %i0 + 0x68 ] <== NOT EXECUTED 400389a0: 80 a0 40 02 cmp %g1, %g2 400389a4: 22 80 00 28 be,a 40038a44 <_Rate_monotonic_Update_statistics+0x10c><== ALWAYS TAKEN 400389a8: c2 06 20 6c ld [ %i0 + 0x6c ], %g1 /* * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); 400389ac: c4 1f bf f8 ldd [ %fp + -8 ], %g2 400389b0: f8 1e 20 88 ldd [ %i0 + 0x88 ], %i4 if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 400389b4: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 400389b8: b6 87 40 03 addcc %i5, %g3, %i3 400389bc: b4 47 00 02 addx %i4, %g2, %i2 400389c0: 80 a0 40 02 cmp %g1, %g2 400389c4: 14 80 00 1b bg 40038a30 <_Rate_monotonic_Update_statistics+0xf8> 400389c8: f4 3e 20 88 std %i2, [ %i0 + 0x88 ] 400389cc: 80 a0 40 02 cmp %g1, %g2 400389d0: 22 80 00 15 be,a 40038a24 <_Rate_monotonic_Update_statistics+0xec><== ALWAYS TAKEN 400389d4: c2 06 20 7c ld [ %i0 + 0x7c ], %g1 stats->min_wall_time = since_last_period; if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 400389d8: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 400389dc: 80 a0 40 02 cmp %g1, %g2 400389e0: 16 80 00 1e bge 40038a58 <_Rate_monotonic_Update_statistics+0x120><== ALWAYS TAKEN 400389e4: 01 00 00 00 nop stats->max_wall_time = since_last_period; 400389e8: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] <== NOT EXECUTED 400389ec: 81 c7 e0 08 ret 400389f0: 81 e8 00 00 restore * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 400389f4: 32 bf ff e8 bne,a 40038994 <_Rate_monotonic_Update_statistics+0x5c><== NEVER TAKEN 400389f8: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 <== NOT EXECUTED 400389fc: c2 06 20 64 ld [ %i0 + 0x64 ], %g1 40038a00: 80 a0 40 03 cmp %g1, %g3 40038a04: 28 bf ff e4 bleu,a 40038994 <_Rate_monotonic_Update_statistics+0x5c> 40038a08: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 stats->min_cpu_time = executed; 40038a0c: 10 bf ff e1 b 40038990 <_Rate_monotonic_Update_statistics+0x58> 40038a10: c4 3e 20 60 std %g2, [ %i0 + 0x60 ] */ stats = &the_period->Statistics; stats->count++; if ( the_period->state == RATE_MONOTONIC_EXPIRED ) stats->missed_count++; 40038a14: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 40038a18: 82 00 60 01 inc %g1 40038a1c: 10 bf ff ce b 40038954 <_Rate_monotonic_Update_statistics+0x1c> 40038a20: c2 26 20 5c st %g1, [ %i0 + 0x5c ] * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 40038a24: 80 a0 40 03 cmp %g1, %g3 40038a28: 28 bf ff ed bleu,a 400389dc <_Rate_monotonic_Update_statistics+0xa4> 40038a2c: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 stats->min_wall_time = since_last_period; if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 40038a30: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 40038a34: 80 a0 40 02 cmp %g1, %g2 40038a38: 06 bf ff ec bl 400389e8 <_Rate_monotonic_Update_statistics+0xb0><== NEVER TAKEN 40038a3c: c4 3e 20 78 std %g2, [ %i0 + 0x78 ] 40038a40: 30 80 00 06 b,a 40038a58 <_Rate_monotonic_Update_statistics+0x120> _Timestamp_Add_to( &stats->total_cpu_time, &executed ); if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) stats->min_cpu_time = executed; if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 40038a44: 80 a0 40 03 cmp %g1, %g3 40038a48: 3a bf ff da bcc,a 400389b0 <_Rate_monotonic_Update_statistics+0x78> 40038a4c: c4 1f bf f8 ldd [ %fp + -8 ], %g2 stats->max_cpu_time = executed; 40038a50: 10 bf ff d7 b 400389ac <_Rate_monotonic_Update_statistics+0x74> 40038a54: c4 3e 20 68 std %g2, [ %i0 + 0x68 ] _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) stats->min_wall_time = since_last_period; if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 40038a58: 12 bf ff e5 bne 400389ec <_Rate_monotonic_Update_statistics+0xb4><== NEVER TAKEN 40038a5c: 01 00 00 00 nop 40038a60: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 40038a64: 80 a0 40 03 cmp %g1, %g3 40038a68: 2a bf ff e1 bcs,a 400389ec <_Rate_monotonic_Update_statistics+0xb4> 40038a6c: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] 40038a70: 30 bf ff df b,a 400389ec <_Rate_monotonic_Update_statistics+0xb4> =============================================================================== 4000afbc <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 4000afbc: 9d e3 bf a0 save %sp, -96, %sp void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 4000afc0: 40 00 07 11 call 4000cc04 <_Workspace_Allocate> 4000afc4: 90 10 20 1c mov 0x1c, %o0 if ( sched ) { 4000afc8: 80 a2 20 00 cmp %o0, 0 4000afcc: 02 80 00 06 be 4000afe4 <_Scheduler_CBS_Allocate+0x28> <== NEVER TAKEN 4000afd0: 82 10 20 02 mov 2, %g1 the_thread->scheduler_info = sched; 4000afd4: d0 26 20 88 st %o0, [ %i0 + 0x88 ] schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; 4000afd8: f0 22 00 00 st %i0, [ %o0 ] schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 4000afdc: c2 22 20 14 st %g1, [ %o0 + 0x14 ] schinfo->cbs_server = NULL; 4000afe0: c0 22 20 18 clr [ %o0 + 0x18 ] } return sched; } 4000afe4: 81 c7 e0 08 ret 4000afe8: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000c390 <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 4000c390: 9d e3 bf 98 save %sp, -104, %sp Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server_id server_id; /* Put violating task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 4000c394: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 4000c398: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 4000c39c: 80 a0 40 09 cmp %g1, %o1 4000c3a0: 32 80 00 02 bne,a 4000c3a8 <_Scheduler_CBS_Budget_callout+0x18><== ALWAYS TAKEN 4000c3a4: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 4000c3a8: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000c3ac: 80 a0 40 09 cmp %g1, %o1 4000c3b0: 02 80 00 04 be 4000c3c0 <_Scheduler_CBS_Budget_callout+0x30><== NEVER TAKEN 4000c3b4: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 4000c3b8: 40 00 01 92 call 4000ca00 <_Thread_Change_priority> 4000c3bc: 94 10 20 01 mov 1, %o2 /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; 4000c3c0: fa 06 20 88 ld [ %i0 + 0x88 ], %i5 if ( sched_info->cbs_server->cbs_budget_overrun ) { 4000c3c4: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 4000c3c8: c4 00 60 0c ld [ %g1 + 0xc ], %g2 4000c3cc: 80 a0 a0 00 cmp %g2, 0 4000c3d0: 02 80 00 09 be 4000c3f4 <_Scheduler_CBS_Budget_callout+0x64><== NEVER TAKEN 4000c3d4: 01 00 00 00 nop _Scheduler_CBS_Get_server_id( 4000c3d8: d0 00 40 00 ld [ %g1 ], %o0 4000c3dc: 7f ff ff d5 call 4000c330 <_Scheduler_CBS_Get_server_id> 4000c3e0: 92 07 bf fc add %fp, -4, %o1 sched_info->cbs_server->task_id, &server_id ); sched_info->cbs_server->cbs_budget_overrun( server_id ); 4000c3e4: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 4000c3e8: c2 00 60 0c ld [ %g1 + 0xc ], %g1 4000c3ec: 9f c0 40 00 call %g1 4000c3f0: d0 07 bf fc ld [ %fp + -4 ], %o0 4000c3f4: 81 c7 e0 08 ret 4000c3f8: 81 e8 00 00 restore =============================================================================== 4000bee8 <_Scheduler_CBS_Cleanup>: #include #include #include int _Scheduler_CBS_Cleanup (void) { 4000bee8: 9d e3 bf a0 save %sp, -96, %sp unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 4000beec: 39 10 00 8b sethi %hi(0x40022c00), %i4 4000bef0: c2 07 21 20 ld [ %i4 + 0x120 ], %g1 ! 40022d20 <_Scheduler_CBS_Maximum_servers> 4000bef4: 80 a0 60 00 cmp %g1, 0 4000bef8: 02 80 00 18 be 4000bf58 <_Scheduler_CBS_Cleanup+0x70> <== NEVER TAKEN 4000befc: 03 10 00 90 sethi %hi(0x40024000), %g1 4000bf00: 37 10 00 90 sethi %hi(0x40024000), %i3 4000bf04: c4 06 e0 28 ld [ %i3 + 0x28 ], %g2 ! 40024028 <_Scheduler_CBS_Server_list> 4000bf08: ba 10 20 00 clr %i5 4000bf0c: b8 17 21 20 or %i4, 0x120, %i4 if ( _Scheduler_CBS_Server_list[ i ] ) 4000bf10: 83 2f 60 02 sll %i5, 2, %g1 4000bf14: c2 00 80 01 ld [ %g2 + %g1 ], %g1 4000bf18: 80 a0 60 00 cmp %g1, 0 4000bf1c: 02 80 00 05 be 4000bf30 <_Scheduler_CBS_Cleanup+0x48> 4000bf20: 90 10 00 1d mov %i5, %o0 _Scheduler_CBS_Destroy_server( i ); 4000bf24: 40 00 00 46 call 4000c03c <_Scheduler_CBS_Destroy_server> 4000bf28: 01 00 00 00 nop 4000bf2c: c4 06 e0 28 ld [ %i3 + 0x28 ], %g2 int _Scheduler_CBS_Cleanup (void) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 4000bf30: c2 07 00 00 ld [ %i4 ], %g1 4000bf34: ba 07 60 01 inc %i5 4000bf38: 80 a0 40 1d cmp %g1, %i5 4000bf3c: 18 bf ff f6 bgu 4000bf14 <_Scheduler_CBS_Cleanup+0x2c> 4000bf40: 83 2f 60 02 sll %i5, 2, %g1 if ( _Scheduler_CBS_Server_list[ i ] ) _Scheduler_CBS_Destroy_server( i ); } _Workspace_Free( _Scheduler_CBS_Server_list ); return SCHEDULER_CBS_OK; } 4000bf44: b0 10 20 00 clr %i0 for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( _Scheduler_CBS_Server_list[ i ] ) _Scheduler_CBS_Destroy_server( i ); } _Workspace_Free( _Scheduler_CBS_Server_list ); 4000bf48: 40 00 08 41 call 4000e04c <_Workspace_Free> 4000bf4c: 90 10 00 02 mov %g2, %o0 return SCHEDULER_CBS_OK; } 4000bf50: 81 c7 e0 08 ret 4000bf54: 81 e8 00 00 restore 4000bf58: 10 bf ff fb b 4000bf44 <_Scheduler_CBS_Cleanup+0x5c> <== NOT EXECUTED 4000bf5c: c4 00 60 28 ld [ %g1 + 0x28 ], %g2 <== NOT EXECUTED =============================================================================== 4000bf60 <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 4000bf60: 9d e3 bf a0 save %sp, -96, %sp unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 4000bf64: c2 06 20 04 ld [ %i0 + 4 ], %g1 4000bf68: 80 a0 60 00 cmp %g1, 0 4000bf6c: 04 80 00 30 ble 4000c02c <_Scheduler_CBS_Create_server+0xcc> 4000bf70: b8 10 00 18 mov %i0, %i4 4000bf74: c2 06 00 00 ld [ %i0 ], %g1 4000bf78: 80 a0 60 00 cmp %g1, 0 4000bf7c: 04 80 00 2c ble 4000c02c <_Scheduler_CBS_Create_server+0xcc> 4000bf80: 03 10 00 8b sethi %hi(0x40022c00), %g1 params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 4000bf84: c8 00 61 20 ld [ %g1 + 0x120 ], %g4 ! 40022d20 <_Scheduler_CBS_Maximum_servers> 4000bf88: 80 a1 20 00 cmp %g4, 0 4000bf8c: 02 80 00 11 be 4000bfd0 <_Scheduler_CBS_Create_server+0x70><== NEVER TAKEN 4000bf90: 37 10 00 90 sethi %hi(0x40024000), %i3 if ( !_Scheduler_CBS_Server_list[i] ) 4000bf94: fa 06 e0 28 ld [ %i3 + 0x28 ], %i5 ! 40024028 <_Scheduler_CBS_Server_list> 4000bf98: c2 07 40 00 ld [ %i5 ], %g1 4000bf9c: 80 a0 60 00 cmp %g1, 0 4000bfa0: 02 80 00 21 be 4000c024 <_Scheduler_CBS_Create_server+0xc4> 4000bfa4: b0 10 20 00 clr %i0 4000bfa8: 10 80 00 06 b 4000bfc0 <_Scheduler_CBS_Create_server+0x60> 4000bfac: 82 10 20 00 clr %g1 4000bfb0: c6 07 40 02 ld [ %i5 + %g2 ], %g3 4000bfb4: 80 a0 e0 00 cmp %g3, 0 4000bfb8: 02 80 00 08 be 4000bfd8 <_Scheduler_CBS_Create_server+0x78> 4000bfbc: b0 10 00 02 mov %g2, %i0 params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 4000bfc0: 82 00 60 01 inc %g1 4000bfc4: 80 a0 40 04 cmp %g1, %g4 4000bfc8: 12 bf ff fa bne 4000bfb0 <_Scheduler_CBS_Create_server+0x50> 4000bfcc: 85 28 60 02 sll %g1, 2, %g2 if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 4000bfd0: 81 c7 e0 08 ret 4000bfd4: 91 e8 3f e6 restore %g0, -26, %o0 *server_id = i; 4000bfd8: c2 26 80 00 st %g1, [ %i2 ] _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 4000bfdc: 40 00 08 14 call 4000e02c <_Workspace_Allocate> 4000bfe0: 90 10 20 10 mov 0x10, %o0 the_server = _Scheduler_CBS_Server_list[*server_id]; 4000bfe4: c2 06 80 00 ld [ %i2 ], %g1 if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 4000bfe8: d0 27 40 18 st %o0, [ %i5 + %i0 ] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 4000bfec: c4 06 e0 28 ld [ %i3 + 0x28 ], %g2 4000bff0: 83 28 60 02 sll %g1, 2, %g1 4000bff4: c2 00 80 01 ld [ %g2 + %g1 ], %g1 if ( !the_server ) 4000bff8: 80 a0 60 00 cmp %g1, 0 4000bffc: 02 80 00 0e be 4000c034 <_Scheduler_CBS_Create_server+0xd4><== NEVER TAKEN 4000c000: 86 10 3f ff mov -1, %g3 return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 4000c004: c4 07 00 00 ld [ %i4 ], %g2 4000c008: c4 20 60 04 st %g2, [ %g1 + 4 ] 4000c00c: c4 07 20 04 ld [ %i4 + 4 ], %g2 the_server->task_id = -1; 4000c010: c6 20 40 00 st %g3, [ %g1 ] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 4000c014: c4 20 60 08 st %g2, [ %g1 + 8 ] the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; 4000c018: f2 20 60 0c st %i1, [ %g1 + 0xc ] return SCHEDULER_CBS_OK; 4000c01c: 81 c7 e0 08 ret 4000c020: 91 e8 20 00 restore %g0, 0, %o0 params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( !_Scheduler_CBS_Server_list[i] ) 4000c024: 10 bf ff ed b 4000bfd8 <_Scheduler_CBS_Create_server+0x78> 4000c028: 82 10 20 00 clr %g1 if ( params->budget <= 0 || params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 4000c02c: 81 c7 e0 08 ret 4000c030: 91 e8 3f ee restore %g0, -18, %o0 the_server->parameters = *params; the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } 4000c034: 81 c7 e0 08 ret <== NOT EXECUTED 4000c038: 91 e8 3f ef restore %g0, -17, %o0 <== NOT EXECUTED =============================================================================== 4000c0bc <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 4000c0bc: 9d e3 bf 98 save %sp, -104, %sp Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); 4000c0c0: 92 07 bf fc add %fp, -4, %o1 4000c0c4: 40 00 03 95 call 4000cf18 <_Thread_Get> 4000c0c8: 90 10 00 19 mov %i1, %o0 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 4000c0cc: ba 92 20 00 orcc %o0, 0, %i5 4000c0d0: 02 80 00 1e be 4000c148 <_Scheduler_CBS_Detach_thread+0x8c> 4000c0d4: 01 00 00 00 nop _Thread_Enable_dispatch(); 4000c0d8: 40 00 03 84 call 4000cee8 <_Thread_Enable_dispatch> 4000c0dc: 01 00 00 00 nop } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 4000c0e0: 03 10 00 8b sethi %hi(0x40022c00), %g1 4000c0e4: c2 00 61 20 ld [ %g1 + 0x120 ], %g1 ! 40022d20 <_Scheduler_CBS_Maximum_servers> 4000c0e8: 80 a6 00 01 cmp %i0, %g1 4000c0ec: 1a 80 00 17 bcc 4000c148 <_Scheduler_CBS_Detach_thread+0x8c> 4000c0f0: 03 10 00 90 sethi %hi(0x40024000), %g1 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 4000c0f4: c2 00 60 28 ld [ %g1 + 0x28 ], %g1 ! 40024028 <_Scheduler_CBS_Server_list> 4000c0f8: b1 2e 20 02 sll %i0, 2, %i0 4000c0fc: c2 00 40 18 ld [ %g1 + %i0 ], %g1 4000c100: 80 a0 60 00 cmp %g1, 0 4000c104: 02 80 00 13 be 4000c150 <_Scheduler_CBS_Detach_thread+0x94> 4000c108: 01 00 00 00 nop return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) 4000c10c: c4 00 40 00 ld [ %g1 ], %g2 4000c110: 80 a0 80 19 cmp %g2, %i1 4000c114: 12 80 00 0d bne 4000c148 <_Scheduler_CBS_Detach_thread+0x8c><== NEVER TAKEN 4000c118: 84 10 3f ff mov -1, %g2 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 4000c11c: c8 07 60 88 ld [ %i5 + 0x88 ], %g4 the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 4000c120: c6 07 60 a0 ld [ %i5 + 0xa0 ], %g3 return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; 4000c124: c4 20 40 00 st %g2, [ %g1 ] sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; 4000c128: c4 07 60 a4 ld [ %i5 + 0xa4 ], %g2 the_thread->is_preemptible = the_thread->Start.is_preemptible; 4000c12c: c2 0f 60 9c ldub [ %i5 + 0x9c ], %g1 if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 4000c130: c0 21 20 18 clr [ %g4 + 0x18 ] the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 4000c134: c6 27 60 78 st %g3, [ %i5 + 0x78 ] the_thread->budget_callout = the_thread->Start.budget_callout; 4000c138: c4 27 60 7c st %g2, [ %i5 + 0x7c ] the_thread->is_preemptible = the_thread->Start.is_preemptible; 4000c13c: c2 2f 60 70 stb %g1, [ %i5 + 0x70 ] return SCHEDULER_CBS_OK; 4000c140: 81 c7 e0 08 ret 4000c144: 91 e8 20 00 restore %g0, 0, %o0 if ( the_thread ) { _Thread_Enable_dispatch(); } if ( server_id >= _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 4000c148: 81 c7 e0 08 ret 4000c14c: 91 e8 3f ee restore %g0, -18, %o0 the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->is_preemptible = the_thread->Start.is_preemptible; return SCHEDULER_CBS_OK; } 4000c150: 81 c7 e0 08 ret 4000c154: 91 e8 3f e7 restore %g0, -25, %o0 =============================================================================== 4000c330 <_Scheduler_CBS_Get_server_id>: rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 4000c330: 03 10 00 8b sethi %hi(0x40022c00), %g1 4000c334: c6 00 61 20 ld [ %g1 + 0x120 ], %g3 ! 40022d20 <_Scheduler_CBS_Maximum_servers> 4000c338: 80 a0 e0 00 cmp %g3, 0 4000c33c: 02 80 00 11 be 4000c380 <_Scheduler_CBS_Get_server_id+0x50><== NEVER TAKEN 4000c340: 03 10 00 90 sethi %hi(0x40024000), %g1 4000c344: c8 00 60 28 ld [ %g1 + 0x28 ], %g4 ! 40024028 <_Scheduler_CBS_Server_list> 4000c348: 82 10 20 00 clr %g1 #include #include #include #include int _Scheduler_CBS_Get_server_id ( 4000c34c: 85 28 60 02 sll %g1, 2, %g2 Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( _Scheduler_CBS_Server_list[i] && 4000c350: c4 01 00 02 ld [ %g4 + %g2 ], %g2 4000c354: 80 a0 a0 00 cmp %g2, 0 4000c358: 22 80 00 07 be,a 4000c374 <_Scheduler_CBS_Get_server_id+0x44> 4000c35c: 82 00 60 01 inc %g1 4000c360: c4 00 80 00 ld [ %g2 ], %g2 4000c364: 80 a0 80 08 cmp %g2, %o0 4000c368: 22 80 00 08 be,a 4000c388 <_Scheduler_CBS_Get_server_id+0x58> 4000c36c: c2 22 40 00 st %g1, [ %o1 ] rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 4000c370: 82 00 60 01 inc %g1 4000c374: 80 a0 40 03 cmp %g1, %g3 4000c378: 12 bf ff f6 bne 4000c350 <_Scheduler_CBS_Get_server_id+0x20> 4000c37c: 85 28 60 02 sll %g1, 2, %g2 *server_id = i; return SCHEDULER_CBS_OK; } } return SCHEDULER_CBS_ERROR_NOSERVER; } 4000c380: 81 c3 e0 08 retl 4000c384: 90 10 3f e7 mov -25, %o0 unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( _Scheduler_CBS_Server_list[i] && _Scheduler_CBS_Server_list[i]->task_id == task_id ) { *server_id = i; return SCHEDULER_CBS_OK; 4000c388: 81 c3 e0 08 retl 4000c38c: 90 10 20 00 clr %o0 =============================================================================== 4000c3fc <_Scheduler_CBS_Initialize>: } } int _Scheduler_CBS_Initialize(void) { 4000c3fc: 9d e3 bf a0 save %sp, -96, %sp unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); 4000c400: 3b 10 00 8b sethi %hi(0x40022c00), %i5 4000c404: d0 07 61 20 ld [ %i5 + 0x120 ], %o0 ! 40022d20 <_Scheduler_CBS_Maximum_servers> } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 4000c408: 40 00 07 09 call 4000e02c <_Workspace_Allocate> 4000c40c: 91 2a 20 02 sll %o0, 2, %o0 4000c410: 09 10 00 90 sethi %hi(0x40024000), %g4 _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 4000c414: 80 a2 20 00 cmp %o0, 0 4000c418: 02 80 00 10 be 4000c458 <_Scheduler_CBS_Initialize+0x5c> <== NEVER TAKEN 4000c41c: d0 21 20 28 st %o0, [ %g4 + 0x28 ] return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 4000c420: c6 07 61 20 ld [ %i5 + 0x120 ], %g3 4000c424: 80 a0 e0 00 cmp %g3, 0 4000c428: 12 80 00 05 bne 4000c43c <_Scheduler_CBS_Initialize+0x40> <== ALWAYS TAKEN 4000c42c: 82 10 20 00 clr %g1 _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 4000c430: 81 c7 e0 08 ret <== NOT EXECUTED 4000c434: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED 4000c438: d0 01 20 28 ld [ %g4 + 0x28 ], %o0 _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { _Scheduler_CBS_Server_list[i] = NULL; 4000c43c: 85 28 60 02 sll %g1, 2, %g2 unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 4000c440: 82 00 60 01 inc %g1 4000c444: 80 a0 40 03 cmp %g1, %g3 4000c448: 12 bf ff fc bne 4000c438 <_Scheduler_CBS_Initialize+0x3c> 4000c44c: c0 22 00 02 clr [ %o0 + %g2 ] _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 4000c450: 81 c7 e0 08 ret 4000c454: 91 e8 20 00 restore %g0, 0, %o0 { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 4000c458: b0 10 3f ef mov -17, %i0 <== NOT EXECUTED for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; } 4000c45c: 81 c7 e0 08 ret <== NOT EXECUTED 4000c460: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4000afec <_Scheduler_CBS_Release_job>: { Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; Scheduler_CBS_Server *serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 4000afec: c2 02 20 88 ld [ %o0 + 0x88 ], %g1 if (deadline) { 4000aff0: 80 a2 60 00 cmp %o1, 0 4000aff4: 02 80 00 11 be 4000b038 <_Scheduler_CBS_Release_job+0x4c> 4000aff8: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 /* Initializing or shifting deadline. */ if (serv_info) 4000affc: 80 a0 60 00 cmp %g1, 0 4000b000: 02 80 00 13 be 4000b04c <_Scheduler_CBS_Release_job+0x60> 4000b004: 07 10 00 87 sethi %hi(0x40021c00), %g3 new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 4000b008: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000b00c: d2 00 e3 f8 ld [ %g3 + 0x3f8 ], %o1 4000b010: 92 02 40 02 add %o1, %g2, %o1 4000b014: 05 20 00 00 sethi %hi(0x80000000), %g2 4000b018: 92 2a 40 02 andn %o1, %g2, %o1 new_priority = the_thread->Start.initial_priority; } /* Budget replenishment for the next job. */ if (serv_info) the_thread->cpu_time_budget = serv_info->parameters.budget; 4000b01c: c2 00 60 08 ld [ %g1 + 8 ], %g1 4000b020: c2 22 20 74 st %g1, [ %o0 + 0x74 ] the_thread->real_priority = new_priority; 4000b024: d2 22 20 18 st %o1, [ %o0 + 0x18 ] _Thread_Change_priority(the_thread, new_priority, true); 4000b028: 94 10 20 01 mov 1, %o2 4000b02c: 82 13 c0 00 mov %o7, %g1 4000b030: 40 00 01 3a call 4000b518 <_Thread_Change_priority> 4000b034: 9e 10 40 00 mov %g1, %o7 /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; } /* Budget replenishment for the next job. */ if (serv_info) 4000b038: 80 a0 60 00 cmp %g1, 0 4000b03c: 12 bf ff f8 bne 4000b01c <_Scheduler_CBS_Release_job+0x30><== ALWAYS TAKEN 4000b040: d2 02 20 ac ld [ %o0 + 0xac ], %o1 the_thread->cpu_time_budget = serv_info->parameters.budget; the_thread->real_priority = new_priority; 4000b044: 10 bf ff f9 b 4000b028 <_Scheduler_CBS_Release_job+0x3c> <== NOT EXECUTED 4000b048: d2 22 20 18 st %o1, [ %o0 + 0x18 ] <== NOT EXECUTED /* Initializing or shifting deadline. */ if (serv_info) new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 4000b04c: 03 10 00 87 sethi %hi(0x40021c00), %g1 4000b050: c2 00 63 f8 ld [ %g1 + 0x3f8 ], %g1 ! 40021ff8 <_Watchdog_Ticks_since_boot> 4000b054: 92 02 40 01 add %o1, %g1, %o1 4000b058: 03 20 00 00 sethi %hi(0x80000000), %g1 4000b05c: 10 bf ff f2 b 4000b024 <_Scheduler_CBS_Release_job+0x38> 4000b060: 92 2a 40 01 andn %o1, %g1, %o1 =============================================================================== 4000b064 <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { 4000b064: 9d e3 bf a0 save %sp, -96, %sp Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server *serv_info; Priority_Control new_priority; _Scheduler_EDF_Enqueue(the_thread); 4000b068: 40 00 00 50 call 4000b1a8 <_Scheduler_EDF_Enqueue> 4000b06c: 90 10 00 18 mov %i0, %o0 /* TODO: flash critical section? */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 4000b070: c2 06 20 88 ld [ %i0 + 0x88 ], %g1 4000b074: fa 00 60 18 ld [ %g1 + 0x18 ], %i5 * Late unblock rule for deadline-driven tasks. The remaining time to * deadline must be sufficient to serve the remaining computation time * without increased utilization of this task. It might cause a deadline * miss of another task. */ if (serv_info) { 4000b078: 80 a7 60 00 cmp %i5, 0 4000b07c: 02 80 00 19 be 4000b0e0 <_Scheduler_CBS_Unblock+0x7c> 4000b080: 03 10 00 87 sethi %hi(0x40021c00), %g1 time_t budget = serv_info->parameters.budget; time_t deadline_left = the_thread->cpu_time_budget; time_t budget_left = the_thread->real_priority - _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 4000b084: d2 07 60 04 ld [ %i5 + 4 ], %o1 */ if (serv_info) { time_t deadline = serv_info->parameters.deadline; time_t budget = serv_info->parameters.budget; time_t deadline_left = the_thread->cpu_time_budget; time_t budget_left = the_thread->real_priority - 4000b088: d0 00 63 f8 ld [ %g1 + 0x3f8 ], %o0 4000b08c: f8 06 20 18 ld [ %i0 + 0x18 ], %i4 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 4000b090: 40 00 40 c1 call 4001b394 <.umul> 4000b094: 90 27 00 08 sub %i4, %o0, %o0 4000b098: d2 06 20 74 ld [ %i0 + 0x74 ], %o1 4000b09c: b6 10 00 08 mov %o0, %i3 4000b0a0: 40 00 40 bd call 4001b394 <.umul> 4000b0a4: d0 07 60 08 ld [ %i5 + 8 ], %o0 4000b0a8: 80 a6 c0 08 cmp %i3, %o0 4000b0ac: 24 80 00 0e ble,a 4000b0e4 <_Scheduler_CBS_Unblock+0x80> 4000b0b0: d0 06 20 14 ld [ %i0 + 0x14 ], %o0 /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 4000b0b4: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 4000b0b8: 80 a7 00 09 cmp %i4, %o1 4000b0bc: 32 80 00 02 bne,a 4000b0c4 <_Scheduler_CBS_Unblock+0x60> 4000b0c0: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 4000b0c4: d0 06 20 14 ld [ %i0 + 0x14 ], %o0 4000b0c8: 80 a2 00 09 cmp %o0, %o1 4000b0cc: 02 80 00 07 be 4000b0e8 <_Scheduler_CBS_Unblock+0x84> 4000b0d0: 3b 10 00 89 sethi %hi(0x40022400), %i5 _Thread_Change_priority(the_thread, new_priority, true); 4000b0d4: 90 10 00 18 mov %i0, %o0 4000b0d8: 40 00 01 10 call 4000b518 <_Thread_Change_priority> 4000b0dc: 94 10 20 01 mov 1, %o2 4000b0e0: d0 06 20 14 ld [ %i0 + 0x14 ], %o0 * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority, 4000b0e4: 3b 10 00 89 sethi %hi(0x40022400), %i5 4000b0e8: ba 17 60 20 or %i5, 0x20, %i5 ! 40022420 <_Per_CPU_Information> 4000b0ec: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000b0f0: d2 00 60 14 ld [ %g1 + 0x14 ], %o1 4000b0f4: 03 10 00 84 sethi %hi(0x40021000), %g1 4000b0f8: c2 00 61 74 ld [ %g1 + 0x174 ], %g1 ! 40021174 <_Scheduler+0x30> 4000b0fc: 9f c0 40 00 call %g1 4000b100: 01 00 00 00 nop 4000b104: 80 a2 20 00 cmp %o0, 0 4000b108: 04 80 00 0a ble 4000b130 <_Scheduler_CBS_Unblock+0xcc> 4000b10c: 01 00 00 00 nop _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4000b110: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority, _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; 4000b114: f0 27 60 14 st %i0, [ %i5 + 0x14 ] if ( _Thread_Executing->is_preemptible || 4000b118: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 4000b11c: 80 a0 60 00 cmp %g1, 0 4000b120: 22 80 00 06 be,a 4000b138 <_Scheduler_CBS_Unblock+0xd4> 4000b124: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 4000b128: 82 10 20 01 mov 1, %g1 4000b12c: c2 2f 60 0c stb %g1, [ %i5 + 0xc ] 4000b130: 81 c7 e0 08 ret 4000b134: 81 e8 00 00 restore * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority, _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4000b138: 80 a0 60 00 cmp %g1, 0 4000b13c: 12 bf ff fd bne 4000b130 <_Scheduler_CBS_Unblock+0xcc> <== ALWAYS TAKEN 4000b140: 82 10 20 01 mov 1, %g1 the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 4000b144: c2 2f 60 0c stb %g1, [ %i5 + 0xc ] <== NOT EXECUTED 4000b148: 30 bf ff fa b,a 4000b130 <_Scheduler_CBS_Unblock+0xcc> <== NOT EXECUTED =============================================================================== 4000afbc <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 4000afbc: 9d e3 bf a0 save %sp, -96, %sp void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 4000afc0: 40 00 06 e8 call 4000cb60 <_Workspace_Allocate> 4000afc4: 90 10 20 18 mov 0x18, %o0 if ( sched ) { 4000afc8: 80 a2 20 00 cmp %o0, 0 4000afcc: 02 80 00 05 be 4000afe0 <_Scheduler_EDF_Allocate+0x24> <== NEVER TAKEN 4000afd0: 82 10 20 02 mov 2, %g1 the_thread->scheduler_info = sched; 4000afd4: d0 26 20 88 st %o0, [ %i0 + 0x88 ] schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 4000afd8: f0 22 00 00 st %i0, [ %o0 ] schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 4000afdc: c2 22 20 14 st %g1, [ %o0 + 0x14 ] } return sched; } 4000afe0: 81 c7 e0 08 ret 4000afe4: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000b1a0 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 4000b1a0: 9d e3 bf a0 save %sp, -96, %sp _Scheduler_EDF_Enqueue(the_thread); 4000b1a4: 7f ff ff a8 call 4000b044 <_Scheduler_EDF_Enqueue> 4000b1a8: 90 10 00 18 mov %i0, %o0 * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( 4000b1ac: 3b 10 00 88 sethi %hi(0x40022000), %i5 4000b1b0: ba 17 63 80 or %i5, 0x380, %i5 ! 40022380 <_Per_CPU_Information> 4000b1b4: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000b1b8: d0 00 60 14 ld [ %g1 + 0x14 ], %o0 4000b1bc: 03 10 00 84 sethi %hi(0x40021000), %g1 4000b1c0: c2 00 60 d4 ld [ %g1 + 0xd4 ], %g1 ! 400210d4 <_Scheduler+0x30> 4000b1c4: 9f c0 40 00 call %g1 4000b1c8: d2 06 20 14 ld [ %i0 + 0x14 ], %o1 4000b1cc: 80 a2 20 00 cmp %o0, 0 4000b1d0: 26 80 00 04 bl,a 4000b1e0 <_Scheduler_EDF_Unblock+0x40> 4000b1d4: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000b1d8: 81 c7 e0 08 ret 4000b1dc: 81 e8 00 00 restore _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; 4000b1e0: f0 27 60 14 st %i0, [ %i5 + 0x14 ] if ( _Thread_Executing->is_preemptible || 4000b1e4: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 4000b1e8: 80 a0 60 00 cmp %g1, 0 4000b1ec: 22 80 00 06 be,a 4000b204 <_Scheduler_EDF_Unblock+0x64> 4000b1f0: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 4000b1f4: 82 10 20 01 mov 1, %g1 4000b1f8: c2 2f 60 0c stb %g1, [ %i5 + 0xc ] 4000b1fc: 81 c7 e0 08 ret 4000b200: 81 e8 00 00 restore */ if ( _Scheduler_Is_priority_lower_than( _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4000b204: 80 a0 60 00 cmp %g1, 0 4000b208: 12 bf ff f4 bne 4000b1d8 <_Scheduler_EDF_Unblock+0x38> <== ALWAYS TAKEN 4000b20c: 82 10 20 01 mov 1, %g1 the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 4000b210: c2 2f 60 0c stb %g1, [ %i5 + 0xc ] <== NOT EXECUTED 4000b214: 30 bf ff fa b,a 4000b1fc <_Scheduler_EDF_Unblock+0x5c> <== NOT EXECUTED =============================================================================== 4000a910 <_Scheduler_priority_Tick>: #include #include void _Scheduler_priority_Tick( void ) { 4000a910: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *executing; executing = _Thread_Executing; 4000a914: 03 10 00 81 sethi %hi(0x40020400), %g1 4000a918: d0 00 63 d0 ld [ %g1 + 0x3d0 ], %o0 ! 400207d0 <_Per_CPU_Information+0x10> /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 4000a91c: c2 0a 20 70 ldub [ %o0 + 0x70 ], %g1 4000a920: 80 a0 60 00 cmp %g1, 0 4000a924: 02 80 00 26 be 4000a9bc <_Scheduler_priority_Tick+0xac> 4000a928: 01 00 00 00 nop return; if ( !_States_Is_ready( executing->current_state ) ) 4000a92c: c2 02 20 10 ld [ %o0 + 0x10 ], %g1 4000a930: 80 a0 60 00 cmp %g1, 0 4000a934: 12 80 00 22 bne 4000a9bc <_Scheduler_priority_Tick+0xac> 4000a938: 01 00 00 00 nop /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 4000a93c: c2 02 20 78 ld [ %o0 + 0x78 ], %g1 4000a940: 80 a0 60 01 cmp %g1, 1 4000a944: 0a 80 00 07 bcs 4000a960 <_Scheduler_priority_Tick+0x50> 4000a948: 80 a0 60 02 cmp %g1, 2 4000a94c: 28 80 00 10 bleu,a 4000a98c <_Scheduler_priority_Tick+0x7c> 4000a950: c2 02 20 74 ld [ %o0 + 0x74 ], %g1 4000a954: 80 a0 60 03 cmp %g1, 3 4000a958: 22 80 00 04 be,a 4000a968 <_Scheduler_priority_Tick+0x58><== ALWAYS TAKEN 4000a95c: c2 02 20 74 ld [ %o0 + 0x74 ], %g1 4000a960: 81 c7 e0 08 ret 4000a964: 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 ) 4000a968: 82 00 7f ff add %g1, -1, %g1 4000a96c: 80 a0 60 00 cmp %g1, 0 4000a970: 12 bf ff fc bne 4000a960 <_Scheduler_priority_Tick+0x50> 4000a974: c2 22 20 74 st %g1, [ %o0 + 0x74 ] (*executing->budget_callout)( executing ); 4000a978: c2 02 20 7c ld [ %o0 + 0x7c ], %g1 4000a97c: 9f c0 40 00 call %g1 4000a980: 01 00 00 00 nop 4000a984: 81 c7 e0 08 ret 4000a988: 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 ) { 4000a98c: 82 00 7f ff add %g1, -1, %g1 4000a990: 80 a0 60 00 cmp %g1, 0 4000a994: 14 bf ff f3 bg 4000a960 <_Scheduler_priority_Tick+0x50> 4000a998: c2 22 20 74 st %g1, [ %o0 + 0x74 ] * always operates on the scheduler that 'owns' the currently executing * thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void ) { _Scheduler.Operations.yield(); 4000a99c: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000a9a0: c2 00 61 70 ld [ %g1 + 0x170 ], %g1 ! 4001f570 <_Scheduler+0xc> 4000a9a4: 9f c0 40 00 call %g1 4000a9a8: 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; 4000a9ac: 03 10 00 80 sethi %hi(0x40020000), %g1 4000a9b0: d0 07 bf fc ld [ %fp + -4 ], %o0 4000a9b4: c2 00 62 10 ld [ %g1 + 0x210 ], %g1 4000a9b8: c2 22 20 74 st %g1, [ %o0 + 0x74 ] 4000a9bc: 81 c7 e0 08 ret 4000a9c0: 81 e8 00 00 restore =============================================================================== 4000b1b8 <_Scheduler_simple_Ready_queue_enqueue_first>: { Chain_Control *ready; Chain_Node *the_node; Thread_Control *current; ready = (Chain_Control *)_Scheduler.information; 4000b1b8: 03 10 00 81 sethi %hi(0x40020400), %g1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000b1bc: c2 00 61 64 ld [ %g1 + 0x164 ], %g1 ! 40020564 <_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 ) { 4000b1c0: c6 02 20 14 ld [ %o0 + 0x14 ], %g3 4000b1c4: c2 00 40 00 ld [ %g1 ], %g1 4000b1c8: c4 00 60 14 ld [ %g1 + 0x14 ], %g2 4000b1cc: 80 a0 80 03 cmp %g2, %g3 4000b1d0: 3a 80 00 08 bcc,a 4000b1f0 <_Scheduler_simple_Ready_queue_enqueue_first+0x38> 4000b1d4: 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 ) { 4000b1d8: 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 ) { 4000b1dc: c4 00 60 14 ld [ %g1 + 0x14 ], %g2 4000b1e0: 80 a0 80 03 cmp %g2, %g3 4000b1e4: 2a bf ff fe bcs,a 4000b1dc <_Scheduler_simple_Ready_queue_enqueue_first+0x24><== NEVER TAKEN 4000b1e8: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED current = (Thread_Control *)current->Object.Node.previous; 4000b1ec: c2 00 60 04 ld [ %g1 + 4 ], %g1 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 4000b1f0: c4 00 40 00 ld [ %g1 ], %g2 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 4000b1f4: c2 22 20 04 st %g1, [ %o0 + 4 ] before_node = after_node->next; after_node->next = the_node; 4000b1f8: d0 20 40 00 st %o0, [ %g1 ] the_node->next = before_node; 4000b1fc: c4 22 00 00 st %g2, [ %o0 ] before_node->previous = the_node; 4000b200: 81 c3 e0 08 retl 4000b204: d0 20 a0 04 st %o0, [ %g2 + 4 ] =============================================================================== 40009234 <_TOD_Validate>: }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 40009234: 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(); 40009238: 03 10 00 7e sethi %hi(0x4001f800), %g1 ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 4000923c: d2 00 60 7c ld [ %g1 + 0x7c ], %o1 ! 4001f87c 40009240: 11 00 03 d0 sethi %hi(0xf4000), %o0 40009244: 40 00 4a 77 call 4001bc20 <.udiv> 40009248: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 4000924c: 80 a6 20 00 cmp %i0, 0 40009250: 02 80 00 2c be 40009300 <_TOD_Validate+0xcc> <== NEVER TAKEN 40009254: 82 10 20 00 clr %g1 40009258: c4 06 20 18 ld [ %i0 + 0x18 ], %g2 4000925c: 80 a2 00 02 cmp %o0, %g2 40009260: 28 80 00 26 bleu,a 400092f8 <_TOD_Validate+0xc4> 40009264: b0 08 60 01 and %g1, 1, %i0 (the_tod->ticks >= ticks_per_second) || 40009268: c4 06 20 14 ld [ %i0 + 0x14 ], %g2 4000926c: 80 a0 a0 3b cmp %g2, 0x3b 40009270: 38 80 00 22 bgu,a 400092f8 <_TOD_Validate+0xc4> 40009274: b0 08 60 01 and %g1, 1, %i0 (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 40009278: c4 06 20 10 ld [ %i0 + 0x10 ], %g2 4000927c: 80 a0 a0 3b cmp %g2, 0x3b 40009280: 38 80 00 1e bgu,a 400092f8 <_TOD_Validate+0xc4> 40009284: b0 08 60 01 and %g1, 1, %i0 (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 40009288: c4 06 20 0c ld [ %i0 + 0xc ], %g2 4000928c: 80 a0 a0 17 cmp %g2, 0x17 40009290: 38 80 00 1a bgu,a 400092f8 <_TOD_Validate+0xc4> 40009294: b0 08 60 01 and %g1, 1, %i0 (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 40009298: c4 06 20 04 ld [ %i0 + 4 ], %g2 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) || 4000929c: 80 a0 a0 00 cmp %g2, 0 400092a0: 02 80 00 15 be 400092f4 <_TOD_Validate+0xc0> <== NEVER TAKEN 400092a4: 80 a0 a0 0c cmp %g2, 0xc (the_tod->month == 0) || 400092a8: 38 80 00 14 bgu,a 400092f8 <_TOD_Validate+0xc4> 400092ac: b0 08 60 01 and %g1, 1, %i0 (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 400092b0: c6 06 00 00 ld [ %i0 ], %g3 (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) || 400092b4: 80 a0 e7 c3 cmp %g3, 0x7c3 400092b8: 28 80 00 10 bleu,a 400092f8 <_TOD_Validate+0xc4> 400092bc: b0 08 60 01 and %g1, 1, %i0 (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 400092c0: c8 06 20 08 ld [ %i0 + 8 ], %g4 (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) || 400092c4: 80 a1 20 00 cmp %g4, 0 400092c8: 02 80 00 0b be 400092f4 <_TOD_Validate+0xc0> <== NEVER TAKEN 400092cc: 80 88 e0 03 btst 3, %g3 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 400092d0: 32 80 00 0f bne,a 4000930c <_TOD_Validate+0xd8> 400092d4: 85 28 a0 02 sll %g2, 2, %g2 days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 400092d8: 82 00 a0 0d add %g2, 0xd, %g1 400092dc: 05 10 00 82 sethi %hi(0x40020800), %g2 400092e0: 83 28 60 02 sll %g1, 2, %g1 400092e4: 84 10 a1 68 or %g2, 0x168, %g2 400092e8: c2 00 80 01 ld [ %g2 + %g1 ], %g1 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; if ( the_tod->day > days_in_month ) 400092ec: 80 a0 40 04 cmp %g1, %g4 400092f0: 82 60 3f ff subx %g0, -1, %g1 return false; return true; } 400092f4: b0 08 60 01 and %g1, 1, %i0 400092f8: 81 c7 e0 08 ret 400092fc: 81 e8 00 00 restore 40009300: b0 08 60 01 and %g1, 1, %i0 <== NOT EXECUTED 40009304: 81 c7 e0 08 ret <== NOT EXECUTED 40009308: 81 e8 00 00 restore <== NOT EXECUTED 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 ]; 4000930c: 03 10 00 82 sethi %hi(0x40020800), %g1 40009310: 82 10 61 68 or %g1, 0x168, %g1 ! 40020968 <_TOD_Days_per_month> 40009314: c2 00 40 02 ld [ %g1 + %g2 ], %g1 if ( the_tod->day > days_in_month ) 40009318: 80 a0 40 04 cmp %g1, %g4 4000931c: 10 bf ff f6 b 400092f4 <_TOD_Validate+0xc0> 40009320: 82 60 3f ff subx %g0, -1, %g1 =============================================================================== 4000abe0 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 4000abe0: 9d e3 bf a0 save %sp, -96, %sp States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 4000abe4: f6 06 20 10 ld [ %i0 + 0x10 ], %i3 /* * 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 ); 4000abe8: 40 00 03 9a call 4000ba50 <_Thread_Set_transient> 4000abec: 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 ) 4000abf0: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000abf4: 80 a0 40 19 cmp %g1, %i1 4000abf8: 02 80 00 05 be 4000ac0c <_Thread_Change_priority+0x2c> 4000abfc: ba 10 00 18 mov %i0, %i5 _Thread_Set_priority( the_thread, new_priority ); 4000ac00: 90 10 00 18 mov %i0, %o0 4000ac04: 40 00 03 79 call 4000b9e8 <_Thread_Set_priority> 4000ac08: 92 10 00 19 mov %i1, %o1 _ISR_Disable( level ); 4000ac0c: 7f ff de 31 call 400024d0 4000ac10: 01 00 00 00 nop 4000ac14: 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; 4000ac18: f8 07 60 10 ld [ %i5 + 0x10 ], %i4 if ( state != STATES_TRANSIENT ) { 4000ac1c: 80 a7 20 04 cmp %i4, 4 4000ac20: 02 80 00 18 be 4000ac80 <_Thread_Change_priority+0xa0> 4000ac24: 80 8e e0 04 btst 4, %i3 /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 4000ac28: 02 80 00 0b be 4000ac54 <_Thread_Change_priority+0x74> <== ALWAYS TAKEN 4000ac2c: 82 0f 3f fb and %i4, -5, %g1 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 4000ac30: 7f ff de 2c call 400024e0 <== NOT EXECUTED 4000ac34: 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); 4000ac38: 03 00 00 ef sethi %hi(0x3bc00), %g1 <== NOT EXECUTED 4000ac3c: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 <== NOT EXECUTED if ( _States_Is_waiting_on_thread_queue( state ) ) { 4000ac40: 80 8f 00 01 btst %i4, %g1 <== NOT EXECUTED 4000ac44: 32 80 00 0d bne,a 4000ac78 <_Thread_Change_priority+0x98><== NOT EXECUTED 4000ac48: f0 07 60 44 ld [ %i5 + 0x44 ], %i0 <== NOT EXECUTED 4000ac4c: 81 c7 e0 08 ret 4000ac50: 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 ); 4000ac54: c2 27 60 10 st %g1, [ %i5 + 0x10 ] _ISR_Enable( level ); 4000ac58: 7f ff de 22 call 400024e0 4000ac5c: 90 10 00 19 mov %i1, %o0 4000ac60: 03 00 00 ef sethi %hi(0x3bc00), %g1 4000ac64: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 4000ac68: 80 8f 00 01 btst %i4, %g1 4000ac6c: 02 bf ff f8 be 4000ac4c <_Thread_Change_priority+0x6c> 4000ac70: 01 00 00 00 nop _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 4000ac74: f0 07 60 44 ld [ %i5 + 0x44 ], %i0 4000ac78: 40 00 03 2c call 4000b928 <_Thread_queue_Requeue> 4000ac7c: 93 e8 00 1d restore %g0, %i5, %o1 } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 4000ac80: 22 80 00 19 be,a 4000ace4 <_Thread_Change_priority+0x104><== ALWAYS TAKEN 4000ac84: c0 27 60 10 clr [ %i5 + 0x10 ] 4000ac88: 39 10 00 7d sethi %hi(0x4001f400), %i4 <== NOT EXECUTED 4000ac8c: b8 17 21 64 or %i4, 0x164, %i4 ! 4001f564 <_Scheduler> <== NOT EXECUTED _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 4000ac90: 7f ff de 14 call 400024e0 4000ac94: 90 10 00 19 mov %i1, %o0 4000ac98: 7f ff de 0e call 400024d0 4000ac9c: 01 00 00 00 nop 4000aca0: 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(); 4000aca4: c2 07 20 08 ld [ %i4 + 8 ], %g1 4000aca8: 9f c0 40 00 call %g1 4000acac: 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 ); 4000acb0: 03 10 00 81 sethi %hi(0x40020400), %g1 4000acb4: 82 10 63 c0 or %g1, 0x3c0, %g1 ! 400207c0 <_Per_CPU_Information> * 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() && 4000acb8: c4 18 60 10 ldd [ %g1 + 0x10 ], %g2 4000acbc: 80 a0 80 03 cmp %g2, %g3 4000acc0: 02 80 00 07 be 4000acdc <_Thread_Change_priority+0xfc> 4000acc4: 01 00 00 00 nop 4000acc8: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 4000accc: 80 a0 a0 00 cmp %g2, 0 4000acd0: 02 80 00 03 be 4000acdc <_Thread_Change_priority+0xfc> 4000acd4: 84 10 20 01 mov 1, %g2 _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 4000acd8: c4 28 60 0c stb %g2, [ %g1 + 0xc ] _ISR_Enable( level ); 4000acdc: 7f ff de 01 call 400024e0 4000ace0: 81 e8 00 00 restore */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 4000ace4: 39 10 00 7d sethi %hi(0x4001f400), %i4 * 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 ) 4000ace8: 80 a6 a0 00 cmp %i2, 0 4000acec: 02 80 00 06 be 4000ad04 <_Thread_Change_priority+0x124> 4000acf0: b8 17 21 64 or %i4, 0x164, %i4 4000acf4: c2 07 20 28 ld [ %i4 + 0x28 ], %g1 4000acf8: 9f c0 40 00 call %g1 4000acfc: 90 10 00 1d mov %i5, %o0 4000ad00: 30 bf ff e4 b,a 4000ac90 <_Thread_Change_priority+0xb0> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 4000ad04: c2 07 20 24 ld [ %i4 + 0x24 ], %g1 4000ad08: 9f c0 40 00 call %g1 4000ad0c: 90 10 00 1d mov %i5, %o0 4000ad10: 30 bf ff e0 b,a 4000ac90 <_Thread_Change_priority+0xb0> =============================================================================== 4000af00 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 4000af00: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000af04: 90 10 00 18 mov %i0, %o0 4000af08: 40 00 00 7c call 4000b0f8 <_Thread_Get> 4000af0c: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000af10: c2 07 bf fc ld [ %fp + -4 ], %g1 4000af14: 80 a0 60 00 cmp %g1, 0 4000af18: 12 80 00 08 bne 4000af38 <_Thread_Delay_ended+0x38> <== NEVER TAKEN 4000af1c: 13 04 00 00 sethi %hi(0x10000000), %o1 #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 4000af20: 7f ff ff 7d call 4000ad14 <_Thread_Clear_state> 4000af24: 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) { uint32_t level = _Thread_Dispatch_disable_level; 4000af28: 03 10 00 80 sethi %hi(0x40020000), %g1 4000af2c: c4 00 62 b0 ld [ %g1 + 0x2b0 ], %g2 ! 400202b0 <_Thread_Dispatch_disable_level> --level; 4000af30: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000af34: c4 20 62 b0 st %g2, [ %g1 + 0x2b0 ] 4000af38: 81 c7 e0 08 ret 4000af3c: 81 e8 00 00 restore =============================================================================== 4000af40 <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { 4000af40: 9d e3 bf 98 save %sp, -104, %sp #endif /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; 4000af44: 31 10 00 81 sethi %hi(0x40020400), %i0 4000af48: b0 16 23 c0 or %i0, 0x3c0, %i0 ! 400207c0 <_Per_CPU_Information> _ISR_Disable( level ); 4000af4c: 7f ff dd 61 call 400024d0 4000af50: f6 06 20 10 ld [ %i0 + 0x10 ], %i3 while ( _Thread_Dispatch_necessary == true ) { 4000af54: c2 0e 20 0c ldub [ %i0 + 0xc ], %g1 4000af58: 80 a0 60 00 cmp %g1, 0 4000af5c: 02 80 00 46 be 4000b074 <_Thread_Dispatch+0x134> 4000af60: 21 10 00 80 sethi %hi(0x40020000), %l0 heir = _Thread_Heir; 4000af64: f4 06 20 14 ld [ %i0 + 0x14 ], %i2 * 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; 4000af68: 82 10 20 01 mov 1, %g1 4000af6c: c2 24 22 b0 st %g1, [ %l0 + 0x2b0 ] #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 4000af70: c0 2e 20 0c clrb [ %i0 + 0xc ] /* * 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 ) 4000af74: 80 a6 c0 1a cmp %i3, %i2 4000af78: 02 80 00 3f be 4000b074 <_Thread_Dispatch+0x134> 4000af7c: f4 26 20 10 st %i2, [ %i0 + 0x10 ] 4000af80: 23 10 00 7d sethi %hi(0x4001f400), %l1 4000af84: 27 10 00 80 sethi %hi(0x40020000), %l3 4000af88: a2 14 62 90 or %l1, 0x290, %l1 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 4000af8c: 25 10 00 80 sethi %hi(0x40020000), %l2 4000af90: a6 14 e3 1c or %l3, 0x31c, %l3 4000af94: b2 04 60 04 add %l1, 4, %i1 #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; 4000af98: 2b 10 00 80 sethi %hi(0x40020000), %l5 4000af9c: a4 14 a2 00 or %l2, 0x200, %l2 4000afa0: a8 10 20 01 mov 1, %l4 */ #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 ) 4000afa4: c2 06 a0 78 ld [ %i2 + 0x78 ], %g1 4000afa8: 80 a0 60 01 cmp %g1, 1 4000afac: 02 80 00 45 be 4000b0c0 <_Thread_Dispatch+0x180> 4000afb0: c2 05 62 10 ld [ %l5 + 0x210 ], %g1 heir->cpu_time_budget = _Thread_Ticks_per_timeslice; _ISR_Enable( level ); 4000afb4: 7f ff dd 4b call 400024e0 4000afb8: 01 00 00 00 nop 4000afbc: 90 07 bf f8 add %fp, -8, %o0 4000afc0: 7f ff f9 8b call 400095ec <_TOD_Get_with_nanoseconds> 4000afc4: 92 10 00 12 mov %l2, %o1 4000afc8: c4 1e e0 80 ldd [ %i3 + 0x80 ], %g2 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 4000afcc: f8 1e 20 20 ldd [ %i0 + 0x20 ], %i4 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 4000afd0: d8 1f bf f8 ldd [ %fp + -8 ], %o4 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 4000afd4: c2 04 c0 00 ld [ %l3 ], %g1 4000afd8: ba a3 40 1d subcc %o5, %i5, %i5 4000afdc: b8 63 00 1c subx %o4, %i4, %i4 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 4000afe0: 96 80 c0 1d addcc %g3, %i5, %o3 4000afe4: 94 40 80 1c addx %g2, %i4, %o2 4000afe8: d4 3e e0 80 std %o2, [ %i3 + 0x80 ] 4000afec: 80 a0 60 00 cmp %g1, 0 4000aff0: 02 80 00 06 be 4000b008 <_Thread_Dispatch+0xc8> <== NEVER TAKEN 4000aff4: d8 3e 20 20 std %o4, [ %i0 + 0x20 ] executing->libc_reent = *_Thread_libc_reent; 4000aff8: c4 00 40 00 ld [ %g1 ], %g2 4000affc: c4 26 e1 48 st %g2, [ %i3 + 0x148 ] *_Thread_libc_reent = heir->libc_reent; 4000b000: c4 06 a1 48 ld [ %i2 + 0x148 ], %g2 4000b004: c4 20 40 00 st %g2, [ %g1 ] */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4000b008: fa 04 40 00 ld [ %l1 ], %i5 { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 4000b00c: 80 a7 40 19 cmp %i5, %i1 4000b010: 02 80 00 0b be 4000b03c <_Thread_Dispatch+0xfc> <== NEVER TAKEN 4000b014: 90 06 e0 c0 add %i3, 0xc0, %o0 const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); 4000b018: c2 07 60 08 ld [ %i5 + 8 ], %g1 4000b01c: 90 10 00 1b mov %i3, %o0 4000b020: 9f c0 40 00 call %g1 4000b024: 92 10 00 1a mov %i2, %o1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_next( const Chain_Node *the_node ) { return the_node->next; 4000b028: fa 07 40 00 ld [ %i5 ], %i5 { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 4000b02c: 80 a7 40 19 cmp %i5, %i1 4000b030: 32 bf ff fb bne,a 4000b01c <_Thread_Dispatch+0xdc> 4000b034: c2 07 60 08 ld [ %i5 + 8 ], %g1 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 4000b038: 90 06 e0 c0 add %i3, 0xc0, %o0 4000b03c: 40 00 04 91 call 4000c280 <_CPU_Context_switch> 4000b040: 92 06 a0 c0 add %i2, 0xc0, %o1 #endif #endif executing = _Thread_Executing; _ISR_Disable( level ); 4000b044: 7f ff dd 23 call 400024d0 4000b048: f6 06 20 10 ld [ %i0 + 0x10 ], %i3 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 4000b04c: c2 0e 20 0c ldub [ %i0 + 0xc ], %g1 4000b050: 80 a0 60 00 cmp %g1, 0 4000b054: 02 80 00 08 be 4000b074 <_Thread_Dispatch+0x134> 4000b058: 01 00 00 00 nop heir = _Thread_Heir; 4000b05c: f4 06 20 14 ld [ %i0 + 0x14 ], %i2 4000b060: e8 24 22 b0 st %l4, [ %l0 + 0x2b0 ] #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 4000b064: c0 2e 20 0c clrb [ %i0 + 0xc ] /* * 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 ) 4000b068: 80 a6 80 1b cmp %i2, %i3 4000b06c: 12 bf ff ce bne 4000afa4 <_Thread_Dispatch+0x64> <== ALWAYS TAKEN 4000b070: f4 26 20 10 st %i2, [ %i0 + 0x10 ] 4000b074: c0 24 22 b0 clr [ %l0 + 0x2b0 ] post_switch: #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 0 ); #endif _ISR_Enable( level ); 4000b078: 7f ff dd 1a call 400024e0 4000b07c: 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; 4000b080: 03 10 00 80 sethi %hi(0x40020000), %g1 4000b084: fa 00 63 20 ld [ %g1 + 0x320 ], %i5 ! 40020320 <_API_extensions_Post_switch_list> 4000b088: 82 10 63 20 or %g1, 0x320, %g1 { const Chain_Control *chain = &_API_extensions_Post_switch_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 4000b08c: b8 00 60 04 add %g1, 4, %i4 4000b090: 80 a7 40 1c cmp %i5, %i4 4000b094: 02 80 00 09 be 4000b0b8 <_Thread_Dispatch+0x178> 4000b098: 01 00 00 00 nop const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); 4000b09c: c2 07 60 08 ld [ %i5 + 8 ], %g1 4000b0a0: 9f c0 40 00 call %g1 4000b0a4: 90 10 00 1b mov %i3, %o0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_next( const Chain_Node *the_node ) { return the_node->next; 4000b0a8: fa 07 40 00 ld [ %i5 ], %i5 { const Chain_Control *chain = &_API_extensions_Post_switch_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 4000b0ac: 80 a7 40 1c cmp %i5, %i4 4000b0b0: 32 bf ff fc bne,a 4000b0a0 <_Thread_Dispatch+0x160> <== NEVER TAKEN 4000b0b4: c2 07 60 08 ld [ %i5 + 8 ], %g1 <== NOT EXECUTED 4000b0b8: 81 c7 e0 08 ret 4000b0bc: 81 e8 00 00 restore #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; 4000b0c0: 10 bf ff bd b 4000afb4 <_Thread_Dispatch+0x74> 4000b0c4: c2 26 a0 74 st %g1, [ %i2 + 0x74 ] =============================================================================== 40010704 <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { 40010704: 9d e3 bf a0 save %sp, -96, %sp #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 40010708: 03 10 00 81 sethi %hi(0x40020400), %g1 4001070c: fa 00 63 d0 ld [ %g1 + 0x3d0 ], %i5 ! 400207d0 <_Per_CPU_Information+0x10> /* * 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(); 40010710: 3f 10 00 41 sethi %hi(0x40010400), %i7 40010714: be 17 e3 04 or %i7, 0x304, %i7 ! 40010704 <_Thread_Handler> /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 40010718: d0 07 60 a8 ld [ %i5 + 0xa8 ], %o0 _ISR_Set_level(level); 4001071c: 7f ff c7 71 call 400024e0 40010720: 91 2a 20 08 sll %o0, 8, %o0 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; 40010724: 03 10 00 7f sethi %hi(0x4001fc00), %g1 doneConstructors = true; 40010728: 84 10 20 01 mov 1, %g2 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; 4001072c: f8 08 62 40 ldub [ %g1 + 0x240 ], %i4 ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( 40010730: 90 10 00 1d mov %i5, %o0 40010734: 13 10 00 2f sethi %hi(0x4000bc00), %o1 40010738: 92 12 60 34 or %o1, 0x34, %o1 ! 4000bc34 <_User_extensions_Thread_begin_visitor> 4001073c: 7f ff ed 5b call 4000bca8 <_User_extensions_Iterate> 40010740: c4 28 62 40 stb %g2, [ %g1 + 0x240 ] _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 40010744: 7f ff ea 61 call 4000b0c8 <_Thread_Enable_dispatch> 40010748: 01 00 00 00 nop /* * _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 (doCons) /* && (volatile void *)_init) */ { 4001074c: 80 8f 20 ff btst 0xff, %i4 40010750: 02 80 00 10 be 40010790 <_Thread_Handler+0x8c> 40010754: 01 00 00 00 nop _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 40010758: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 4001075c: 80 a0 60 00 cmp %g1, 0 40010760: 02 80 00 10 be 400107a0 <_Thread_Handler+0x9c> 40010764: 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 ) { 40010768: 22 80 00 13 be,a 400107b4 <_Thread_Handler+0xb0> <== ALWAYS TAKEN 4001076c: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( 40010770: 90 10 00 1d mov %i5, %o0 40010774: 13 10 00 2f sethi %hi(0x4000bc00), %o1 40010778: 7f ff ed 4c call 4000bca8 <_User_extensions_Iterate> 4001077c: 92 12 60 58 or %o1, 0x58, %o1 ! 4000bc58 <_User_extensions_Thread_exitted_visitor> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( 40010780: 90 10 20 00 clr %o0 40010784: 92 10 20 01 mov 1, %o1 40010788: 7f ff e4 e1 call 40009b0c <_Internal_error_Occurred> 4001078c: 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 (doCons) /* && (volatile void *)_init) */ { INIT_NAME (); 40010790: 40 00 3b 42 call 4001f498 <_init> 40010794: 01 00 00 00 nop _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 40010798: 10 bf ff f1 b 4001075c <_Thread_Handler+0x58> 4001079c: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 400107a0: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 400107a4: 9f c0 40 00 call %g1 400107a8: d0 07 60 98 ld [ %i5 + 0x98 ], %o0 #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 400107ac: 10 bf ff f1 b 40010770 <_Thread_Handler+0x6c> 400107b0: 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)( 400107b4: 9f c0 40 00 call %g1 400107b8: d0 07 60 94 ld [ %i5 + 0x94 ], %o0 executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 400107bc: 10 bf ff ed b 40010770 <_Thread_Handler+0x6c> 400107c0: d0 27 60 28 st %o0, [ %i5 + 0x28 ] =============================================================================== 4000b380 <_Thread_Handler_initialization>: #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { 4000b380: 9d e3 bf 98 save %sp, -104, %sp uint32_t ticks_per_timeslice = 4000b384: 03 10 00 75 sethi %hi(0x4001d400), %g1 4000b388: 82 10 62 18 or %g1, 0x218, %g1 ! 4001d618 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 4000b38c: c6 00 60 28 ld [ %g1 + 0x28 ], %g3 #include #endif void _Thread_Handler_initialization(void) { uint32_t ticks_per_timeslice = 4000b390: fa 00 60 14 ld [ %g1 + 0x14 ], %i5 rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = 4000b394: f8 00 60 08 ld [ %g1 + 8 ], %i4 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 4000b398: 80 a0 e0 00 cmp %g3, 0 4000b39c: 02 80 00 1f be 4000b418 <_Thread_Handler_initialization+0x98><== NEVER TAKEN 4000b3a0: c4 00 60 24 ld [ %g1 + 0x24 ], %g2 4000b3a4: c6 00 60 2c ld [ %g1 + 0x2c ], %g3 4000b3a8: 80 a0 e0 00 cmp %g3, 0 4000b3ac: 02 80 00 1b be 4000b418 <_Thread_Handler_initialization+0x98> 4000b3b0: 80 a0 a0 00 cmp %g2, 0 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 4000b3b4: 22 80 00 05 be,a 4000b3c8 <_Thread_Handler_initialization+0x48> 4000b3b8: 03 10 00 81 sethi %hi(0x40020400), %g1 (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 4000b3bc: 9f c0 80 00 call %g2 4000b3c0: d0 00 60 04 ld [ %g1 + 4 ], %o0 ! 40020404 <_CPU_Null_fp_context+0x24> _Thread_Dispatch_necessary = false; 4000b3c4: 03 10 00 81 sethi %hi(0x40020400), %g1 4000b3c8: 82 10 63 c0 or %g1, 0x3c0, %g1 ! 400207c0 <_Per_CPU_Information> 4000b3cc: c0 28 60 0c clrb [ %g1 + 0xc ] _Thread_Executing = NULL; 4000b3d0: c0 20 60 10 clr [ %g1 + 0x10 ] _Thread_Heir = NULL; 4000b3d4: c0 20 60 14 clr [ %g1 + 0x14 ] #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; 4000b3d8: 03 10 00 80 sethi %hi(0x40020000), %g1 4000b3dc: f8 20 63 2c st %i4, [ %g1 + 0x32c ] ! 4002032c <_Thread_Maximum_extensions> _Thread_Ticks_per_timeslice = ticks_per_timeslice; 4000b3e0: 03 10 00 80 sethi %hi(0x40020000), %g1 4000b3e4: fa 20 62 10 st %i5, [ %g1 + 0x210 ] ! 40020210 <_Thread_Ticks_per_timeslice> #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 4000b3e8: 82 10 20 08 mov 8, %g1 4000b3ec: 11 10 00 80 sethi %hi(0x40020000), %o0 4000b3f0: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 4000b3f4: 90 12 23 a0 or %o0, 0x3a0, %o0 4000b3f8: 92 10 20 01 mov 1, %o1 4000b3fc: 94 10 20 01 mov 1, %o2 4000b400: 96 10 20 01 mov 1, %o3 4000b404: 98 10 21 60 mov 0x160, %o4 4000b408: 7f ff fb 6a call 4000a1b0 <_Objects_Initialize_information> 4000b40c: 9a 10 20 00 clr %o5 4000b410: 81 c7 e0 08 ret 4000b414: 81 e8 00 00 restore _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( 4000b418: 90 10 20 00 clr %o0 4000b41c: 92 10 20 01 mov 1, %o1 4000b420: 7f ff f9 bb call 40009b0c <_Internal_error_Occurred> 4000b424: 94 10 20 0e mov 0xe, %o2 =============================================================================== 4000b1a4 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 4000b1a4: 9d e3 bf 98 save %sp, -104, %sp 4000b1a8: 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; 4000b1ac: c0 26 61 4c clr [ %i1 + 0x14c ] 4000b1b0: c0 26 61 50 clr [ %i1 + 0x150 ] extensions_area = NULL; the_thread->libc_reent = NULL; 4000b1b4: c0 26 61 48 clr [ %i1 + 0x148 ] Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 4000b1b8: f8 07 a0 60 ld [ %fp + 0x60 ], %i4 4000b1bc: e0 00 40 00 ld [ %g1 ], %l0 if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { 4000b1c0: 80 a6 a0 00 cmp %i2, 0 4000b1c4: 02 80 00 60 be 4000b344 <_Thread_Initialize+0x1a0> 4000b1c8: 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; 4000b1cc: c0 2e 60 b0 clrb [ %i1 + 0xb0 ] 4000b1d0: 90 10 00 1b mov %i3, %o0 #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 4000b1d4: 37 10 00 80 sethi %hi(0x40020000), %i3 4000b1d8: c2 06 e3 2c ld [ %i3 + 0x32c ], %g1 ! 4002032c <_Thread_Maximum_extensions> Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 4000b1dc: f4 26 60 b8 st %i2, [ %i1 + 0xb8 ] the_stack->size = size; 4000b1e0: d0 26 60 b4 st %o0, [ %i1 + 0xb4 ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 4000b1e4: c0 26 60 50 clr [ %i1 + 0x50 ] the_watchdog->routine = routine; 4000b1e8: c0 26 60 64 clr [ %i1 + 0x64 ] the_watchdog->id = id; 4000b1ec: c0 26 60 68 clr [ %i1 + 0x68 ] 4000b1f0: 80 a0 60 00 cmp %g1, 0 4000b1f4: 12 80 00 40 bne 4000b2f4 <_Thread_Initialize+0x150> 4000b1f8: c0 26 60 6c clr [ %i1 + 0x6c ] (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) goto failed; } the_thread->extensions = (void **) extensions_area; 4000b1fc: c0 26 61 54 clr [ %i1 + 0x154 ] * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; extensions_area = NULL; 4000b200: 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; 4000b204: c2 07 a0 64 ld [ %fp + 0x64 ], %g1 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 4000b208: e2 2e 60 9c stb %l1, [ %i1 + 0x9c ] the_thread->Start.budget_algorithm = budget_algorithm; 4000b20c: f8 26 60 a0 st %i4, [ %i1 + 0xa0 ] the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 4000b210: 80 a7 20 02 cmp %i4, 2 4000b214: 12 80 00 05 bne 4000b228 <_Thread_Initialize+0x84> 4000b218: c2 26 60 a4 st %g1, [ %i1 + 0xa4 ] 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; 4000b21c: 03 10 00 80 sethi %hi(0x40020000), %g1 4000b220: c2 00 62 10 ld [ %g1 + 0x210 ], %g1 ! 40020210 <_Thread_Ticks_per_timeslice> 4000b224: c2 26 60 74 st %g1, [ %i1 + 0x74 ] case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 4000b228: c4 07 a0 68 ld [ %fp + 0x68 ], %g2 */ RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate( Thread_Control *the_thread ) { return _Scheduler.Operations.allocate( the_thread ); 4000b22c: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000b230: c2 00 61 7c ld [ %g1 + 0x17c ], %g1 ! 4001f57c <_Scheduler+0x18> 4000b234: c4 26 60 a8 st %g2, [ %i1 + 0xa8 ] the_thread->current_state = STATES_DORMANT; 4000b238: b6 10 20 01 mov 1, %i3 the_thread->Wait.queue = NULL; 4000b23c: c0 26 60 44 clr [ %i1 + 0x44 ] #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 4000b240: f6 26 60 10 st %i3, [ %i1 + 0x10 ] the_thread->Wait.queue = NULL; the_thread->resource_count = 0; 4000b244: c0 26 60 1c clr [ %i1 + 0x1c ] the_thread->real_priority = priority; 4000b248: fa 26 60 18 st %i5, [ %i1 + 0x18 ] the_thread->Start.initial_priority = priority; 4000b24c: fa 26 60 ac st %i5, [ %i1 + 0xac ] 4000b250: 9f c0 40 00 call %g1 4000b254: 90 10 00 19 mov %i1, %o0 sched =_Scheduler_Allocate( the_thread ); if ( !sched ) 4000b258: b8 92 20 00 orcc %o0, 0, %i4 4000b25c: 22 80 00 17 be,a 4000b2b8 <_Thread_Initialize+0x114> 4000b260: d0 06 61 48 ld [ %i1 + 0x148 ], %o0 goto failed; _Thread_Set_priority( the_thread, priority ); 4000b264: 90 10 00 19 mov %i1, %o0 4000b268: 40 00 01 e0 call 4000b9e8 <_Thread_Set_priority> 4000b26c: 92 10 00 1d mov %i5, %o1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000b270: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 4000b274: c2 16 60 0a lduh [ %i1 + 0xa ], %g1 static inline void _Timestamp64_implementation_Set_to_zero( Timestamp64_Control *_time ) { *_time = 0; 4000b278: c0 26 60 80 clr [ %i1 + 0x80 ] 4000b27c: c0 26 60 84 clr [ %i1 + 0x84 ] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000b280: 83 28 60 02 sll %g1, 2, %g1 4000b284: f2 20 80 01 st %i1, [ %g2 + %g1 ] information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4000b288: e0 26 60 0c st %l0, [ %i1 + 0xc ] * @{ */ static inline bool _User_extensions_Thread_create( Thread_Control *created ) { User_extensions_Thread_create_context ctx = { created, true }; 4000b28c: f2 27 bf f8 st %i1, [ %fp + -8 ] 4000b290: f6 2f bf fc stb %i3, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor ); 4000b294: 90 07 bf f8 add %fp, -8, %o0 4000b298: 13 10 00 2e sethi %hi(0x4000b800), %o1 4000b29c: 40 00 02 83 call 4000bca8 <_User_extensions_Iterate> 4000b2a0: 92 12 63 80 or %o1, 0x380, %o1 ! 4000bb80 <_User_extensions_Thread_create_visitor> * user extensions with dispatching enabled. The Allocator * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) 4000b2a4: c2 0f bf fc ldub [ %fp + -4 ], %g1 4000b2a8: 80 a0 60 00 cmp %g1, 0 4000b2ac: 12 80 00 0f bne 4000b2e8 <_Thread_Initialize+0x144> 4000b2b0: b0 10 20 01 mov 1, %i0 return true; failed: _Workspace_Free( the_thread->libc_reent ); 4000b2b4: d0 06 61 48 ld [ %i1 + 0x148 ], %o0 4000b2b8: 40 00 03 dd call 4000c22c <_Workspace_Free> 4000b2bc: b0 10 20 00 clr %i0 for ( i=0 ; i <= THREAD_API_LAST ; i++ ) _Workspace_Free( the_thread->API_Extensions[i] ); 4000b2c0: 40 00 03 db call 4000c22c <_Workspace_Free> 4000b2c4: d0 06 61 4c ld [ %i1 + 0x14c ], %o0 4000b2c8: 40 00 03 d9 call 4000c22c <_Workspace_Free> 4000b2cc: d0 06 61 50 ld [ %i1 + 0x150 ], %o0 _Workspace_Free( extensions_area ); 4000b2d0: 40 00 03 d7 call 4000c22c <_Workspace_Free> 4000b2d4: 90 10 00 1a mov %i2, %o0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); #endif _Workspace_Free( sched ); 4000b2d8: 40 00 03 d5 call 4000c22c <_Workspace_Free> 4000b2dc: 90 10 00 1c mov %i4, %o0 _Thread_Stack_Free( the_thread ); 4000b2e0: 40 00 01 fb call 4000bacc <_Thread_Stack_Free> 4000b2e4: 90 10 00 19 mov %i1, %o0 4000b2e8: b0 0e 20 ff and %i0, 0xff, %i0 4000b2ec: 81 c7 e0 08 ret 4000b2f0: 81 e8 00 00 restore /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( 4000b2f4: 90 00 60 01 add %g1, 1, %o0 4000b2f8: 40 00 03 c5 call 4000c20c <_Workspace_Allocate> 4000b2fc: 91 2a 20 02 sll %o0, 2, %o0 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 4000b300: b4 92 20 00 orcc %o0, 0, %i2 4000b304: 02 80 00 1d be 4000b378 <_Thread_Initialize+0x1d4> 4000b308: 86 10 00 1a mov %i2, %g3 goto failed; } the_thread->extensions = (void **) extensions_area; 4000b30c: f4 26 61 54 st %i2, [ %i1 + 0x154 ] 4000b310: c8 06 e3 2c ld [ %i3 + 0x32c ], %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++ ) 4000b314: 84 10 20 00 clr %g2 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) goto failed; } the_thread->extensions = (void **) extensions_area; 4000b318: 10 80 00 03 b 4000b324 <_Thread_Initialize+0x180> 4000b31c: 82 10 20 00 clr %g1 4000b320: c6 06 61 54 ld [ %i1 + 0x154 ], %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; 4000b324: 85 28 a0 02 sll %g2, 2, %g2 4000b328: 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++ ) 4000b32c: 82 00 60 01 inc %g1 4000b330: 80 a0 40 04 cmp %g1, %g4 4000b334: 08 bf ff fb bleu 4000b320 <_Thread_Initialize+0x17c> 4000b338: 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; 4000b33c: 10 bf ff b3 b 4000b208 <_Thread_Initialize+0x64> 4000b340: 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 ); 4000b344: 90 10 00 19 mov %i1, %o0 4000b348: 40 00 01 d1 call 4000ba8c <_Thread_Stack_Allocate> 4000b34c: 92 10 00 1b mov %i3, %o1 if ( !actual_stack_size || actual_stack_size < stack_size ) 4000b350: 80 a2 00 1b cmp %o0, %i3 4000b354: 0a 80 00 07 bcs 4000b370 <_Thread_Initialize+0x1cc> 4000b358: 80 a2 20 00 cmp %o0, 0 4000b35c: 02 80 00 05 be 4000b370 <_Thread_Initialize+0x1cc> <== NEVER TAKEN 4000b360: 82 10 20 01 mov 1, %g1 return false; /* stack allocation failed */ stack = the_thread->Start.stack; 4000b364: f4 06 60 bc ld [ %i1 + 0xbc ], %i2 the_thread->Start.core_allocated_stack = true; 4000b368: 10 bf ff 9b b 4000b1d4 <_Thread_Initialize+0x30> 4000b36c: c2 2e 60 b0 stb %g1, [ %i1 + 0xb0 ] 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 */ 4000b370: 10 bf ff de b 4000b2e8 <_Thread_Initialize+0x144> 4000b374: 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; 4000b378: 10 bf ff cf b 4000b2b4 <_Thread_Initialize+0x110> 4000b37c: b8 10 20 00 clr %i4 =============================================================================== 4000bacc <_Thread_Stack_Free>: #include void _Thread_Stack_Free( Thread_Control *the_thread ) { 4000bacc: 9d e3 bf a0 save %sp, -96, %sp #if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) /* * If the API provided the stack space, then don't free it. */ if ( !the_thread->Start.core_allocated_stack ) 4000bad0: c2 0e 20 b0 ldub [ %i0 + 0xb0 ], %g1 4000bad4: 80 a0 60 00 cmp %g1, 0 void _Thread_Stack_Free( Thread_Control *the_thread ) { rtems_stack_free_hook stack_free_hook = 4000bad8: 03 10 00 75 sethi %hi(0x4001d400), %g1 #if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) /* * If the API provided the stack space, then don't free it. */ if ( !the_thread->Start.core_allocated_stack ) 4000badc: 02 80 00 04 be 4000baec <_Thread_Stack_Free+0x20> <== NEVER TAKEN 4000bae0: c2 00 62 44 ld [ %g1 + 0x244 ], %g1 ! 4001d644 * Call ONLY the CPU table stack free hook, or the * the RTEMS workspace free. This is so the free * routine properly matches the allocation of the stack. */ (*stack_free_hook)( the_thread->Start.Initial_stack.area ); 4000bae4: 9f c0 40 00 call %g1 4000bae8: d0 06 20 b8 ld [ %i0 + 0xb8 ], %o0 4000baec: 81 c7 e0 08 ret 4000baf0: 81 e8 00 00 restore =============================================================================== 400107c4 <_Thread_queue_Extract_fifo>: void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 400107c4: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED ISR_Level level; _ISR_Disable( level ); 400107c8: 7f ff c7 42 call 400024d0 <== NOT EXECUTED 400107cc: 01 00 00 00 nop <== NOT EXECUTED 400107d0: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED 400107d4: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 <== NOT EXECUTED 400107d8: 03 00 00 ef sethi %hi(0x3bc00), %g1 <== NOT EXECUTED 400107dc: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 <== NOT EXECUTED if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 400107e0: 80 88 80 01 btst %g2, %g1 <== NOT EXECUTED 400107e4: 02 80 00 1a be 4001084c <_Thread_queue_Extract_fifo+0x88> <== NOT EXECUTED 400107e8: 01 00 00 00 nop <== NOT EXECUTED ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 400107ec: c4 06 40 00 ld [ %i1 ], %g2 <== NOT EXECUTED previous = the_node->previous; 400107f0: c2 06 60 04 ld [ %i1 + 4 ], %g1 <== NOT EXECUTED _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 400107f4: c6 06 60 50 ld [ %i1 + 0x50 ], %g3 <== NOT EXECUTED next->previous = previous; 400107f8: c2 20 a0 04 st %g1, [ %g2 + 4 ] <== NOT EXECUTED previous->next = next; 400107fc: c4 20 40 00 st %g2, [ %g1 ] <== NOT EXECUTED 40010800: 80 a0 e0 02 cmp %g3, 2 <== NOT EXECUTED 40010804: 02 80 00 08 be 40010824 <_Thread_queue_Extract_fifo+0x60> <== NOT EXECUTED 40010808: c0 26 60 44 clr [ %i1 + 0x44 ] <== NOT EXECUTED _ISR_Enable( level ); 4001080c: 7f ff c7 35 call 400024e0 <== NOT EXECUTED 40010810: b0 10 00 19 mov %i1, %i0 <== NOT EXECUTED 40010814: 33 04 01 ff sethi %hi(0x1007fc00), %i1 <== NOT EXECUTED 40010818: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1007fff8 <== NOT EXECUTED 4001081c: 7f ff e9 3e call 4000ad14 <_Thread_Clear_state> <== NOT EXECUTED 40010820: 81 e8 00 00 restore <== NOT EXECUTED 40010824: 82 10 20 03 mov 3, %g1 <== NOT EXECUTED 40010828: c2 26 60 50 st %g1, [ %i1 + 0x50 ] <== NOT EXECUTED } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4001082c: 7f ff c7 2d call 400024e0 <== NOT EXECUTED 40010830: b0 10 00 19 mov %i1, %i0 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 40010834: 7f ff ed c0 call 4000bf34 <_Watchdog_Remove> <== NOT EXECUTED 40010838: 90 06 60 48 add %i1, 0x48, %o0 <== NOT EXECUTED 4001083c: 33 04 01 ff sethi %hi(0x1007fc00), %i1 <== NOT EXECUTED 40010840: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1007fff8 <== NOT EXECUTED 40010844: 7f ff e9 34 call 4000ad14 <_Thread_Clear_state> <== NOT EXECUTED 40010848: 81 e8 00 00 restore <== NOT EXECUTED ISR_Level level; _ISR_Disable( level ); if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { _ISR_Enable( level ); 4001084c: 7f ff c7 25 call 400024e0 <== NOT EXECUTED 40010850: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4000b928 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 4000b928: 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 ) 4000b92c: 80 a6 20 00 cmp %i0, 0 4000b930: 02 80 00 13 be 4000b97c <_Thread_queue_Requeue+0x54> <== NEVER TAKEN 4000b934: 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 ) { 4000b938: fa 06 20 34 ld [ %i0 + 0x34 ], %i5 4000b93c: 80 a7 60 01 cmp %i5, 1 4000b940: 02 80 00 04 be 4000b950 <_Thread_queue_Requeue+0x28> <== ALWAYS TAKEN 4000b944: 01 00 00 00 nop 4000b948: 81 c7 e0 08 ret <== NOT EXECUTED 4000b94c: 81 e8 00 00 restore <== NOT EXECUTED Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 4000b950: 7f ff da e0 call 400024d0 4000b954: 01 00 00 00 nop 4000b958: b8 10 00 08 mov %o0, %i4 4000b95c: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 4000b960: 03 00 00 ef sethi %hi(0x3bc00), %g1 4000b964: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4000b968: 80 88 80 01 btst %g2, %g1 4000b96c: 12 80 00 06 bne 4000b984 <_Thread_queue_Requeue+0x5c> <== ALWAYS TAKEN 4000b970: 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 ); 4000b974: 7f ff da db call 400024e0 4000b978: 90 10 00 1c mov %i4, %o0 4000b97c: 81 c7 e0 08 ret 4000b980: 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 ); 4000b984: 92 10 00 19 mov %i1, %o1 4000b988: 94 10 20 01 mov 1, %o2 4000b98c: 40 00 0c c8 call 4000ecac <_Thread_queue_Extract_priority_helper> 4000b990: fa 26 20 30 st %i5, [ %i0 + 0x30 ] (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 4000b994: 90 10 00 18 mov %i0, %o0 4000b998: 92 10 00 19 mov %i1, %o1 4000b99c: 7f ff ff 35 call 4000b670 <_Thread_queue_Enqueue_priority> 4000b9a0: 94 07 bf fc add %fp, -4, %o2 4000b9a4: 30 bf ff f4 b,a 4000b974 <_Thread_queue_Requeue+0x4c> =============================================================================== 4000b9a8 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 4000b9a8: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000b9ac: 90 10 00 18 mov %i0, %o0 4000b9b0: 7f ff fd d2 call 4000b0f8 <_Thread_Get> 4000b9b4: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000b9b8: c2 07 bf fc ld [ %fp + -4 ], %g1 4000b9bc: 80 a0 60 00 cmp %g1, 0 4000b9c0: 12 80 00 08 bne 4000b9e0 <_Thread_queue_Timeout+0x38> <== NEVER TAKEN 4000b9c4: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 4000b9c8: 40 00 0c f2 call 4000ed90 <_Thread_queue_Process_timeout> 4000b9cc: 01 00 00 00 nop * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4000b9d0: 03 10 00 80 sethi %hi(0x40020000), %g1 4000b9d4: c4 00 62 b0 ld [ %g1 + 0x2b0 ], %g2 ! 400202b0 <_Thread_Dispatch_disable_level> --level; 4000b9d8: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000b9dc: c4 20 62 b0 st %g2, [ %g1 + 0x2b0 ] 4000b9e0: 81 c7 e0 08 ret 4000b9e4: 81 e8 00 00 restore =============================================================================== 40018af0 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 40018af0: 9d e3 bf 88 save %sp, -120, %sp 40018af4: 21 10 00 fa sethi %hi(0x4003e800), %l0 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 40018af8: a4 07 bf e8 add %fp, -24, %l2 40018afc: b4 07 bf ec add %fp, -20, %i2 40018b00: b8 07 bf f4 add %fp, -12, %i4 40018b04: a2 07 bf f8 add %fp, -8, %l1 40018b08: 33 10 00 f9 sethi %hi(0x4003e400), %i1 40018b0c: 27 10 00 fa sethi %hi(0x4003e800), %l3 40018b10: f4 27 bf e8 st %i2, [ %fp + -24 ] head->previous = NULL; 40018b14: c0 27 bf ec clr [ %fp + -20 ] tail->previous = head; 40018b18: e4 27 bf f0 st %l2, [ %fp + -16 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 40018b1c: e2 27 bf f4 st %l1, [ %fp + -12 ] head->previous = NULL; 40018b20: c0 27 bf f8 clr [ %fp + -8 ] tail->previous = head; 40018b24: f8 27 bf fc st %i4, [ %fp + -4 ] 40018b28: a0 14 21 48 or %l0, 0x148, %l0 40018b2c: b6 06 20 30 add %i0, 0x30, %i3 40018b30: b2 16 63 a8 or %i1, 0x3a8, %i1 40018b34: ba 06 20 68 add %i0, 0x68, %i5 40018b38: a6 14 e0 60 or %l3, 0x60, %l3 40018b3c: ac 06 20 08 add %i0, 8, %l6 40018b40: aa 06 20 40 add %i0, 0x40, %l5 _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; 40018b44: a8 10 20 01 mov 1, %l4 { /* * 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; 40018b48: e4 26 20 78 st %l2, [ %i0 + 0x78 ] static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 40018b4c: c2 04 00 00 ld [ %l0 ], %g1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 40018b50: d2 06 20 3c ld [ %i0 + 0x3c ], %o1 watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40018b54: 90 10 00 1b mov %i3, %o0 40018b58: 92 20 40 09 sub %g1, %o1, %o1 40018b5c: 94 10 00 1c mov %i4, %o2 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 40018b60: c2 26 20 3c st %g1, [ %i0 + 0x3c ] _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40018b64: 40 00 12 35 call 4001d438 <_Watchdog_Adjust_to_chain> 40018b68: 01 00 00 00 nop 40018b6c: d0 1e 40 00 ldd [ %i1 ], %o0 40018b70: 94 10 20 00 clr %o2 40018b74: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40018b78: 40 00 51 6b call 4002d124 <__divdi3> 40018b7c: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 40018b80: d4 06 20 74 ld [ %i0 + 0x74 ], %o2 /* * 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 ) { 40018b84: 80 a2 40 0a cmp %o1, %o2 40018b88: 18 80 00 2b bgu 40018c34 <_Timer_server_Body+0x144> 40018b8c: ae 10 00 09 mov %o1, %l7 * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); } else if ( snapshot < last_snapshot ) { 40018b90: 80 a2 40 0a cmp %o1, %o2 40018b94: 0a 80 00 20 bcs 40018c14 <_Timer_server_Body+0x124> 40018b98: 90 10 00 1d mov %i5, %o0 */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 40018b9c: ee 26 20 74 st %l7, [ %i0 + 0x74 ] } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 40018ba0: d0 06 20 78 ld [ %i0 + 0x78 ], %o0 40018ba4: 40 00 02 c2 call 400196ac <_Chain_Get> 40018ba8: 01 00 00 00 nop if ( timer == NULL ) { 40018bac: 92 92 20 00 orcc %o0, 0, %o1 40018bb0: 02 80 00 10 be 40018bf0 <_Timer_server_Body+0x100> 40018bb4: 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 ) { 40018bb8: c2 02 60 38 ld [ %o1 + 0x38 ], %g1 40018bbc: 80 a0 60 01 cmp %g1, 1 40018bc0: 02 80 00 19 be 40018c24 <_Timer_server_Body+0x134> 40018bc4: 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 ) { 40018bc8: 12 bf ff f6 bne 40018ba0 <_Timer_server_Body+0xb0> <== NEVER TAKEN 40018bcc: 92 02 60 10 add %o1, 0x10, %o1 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 40018bd0: 40 00 12 46 call 4001d4e8 <_Watchdog_Insert> 40018bd4: 90 10 00 1d mov %i5, %o0 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 40018bd8: d0 06 20 78 ld [ %i0 + 0x78 ], %o0 40018bdc: 40 00 02 b4 call 400196ac <_Chain_Get> 40018be0: 01 00 00 00 nop if ( timer == NULL ) { 40018be4: 92 92 20 00 orcc %o0, 0, %o1 40018be8: 32 bf ff f5 bne,a 40018bbc <_Timer_server_Body+0xcc> <== NEVER TAKEN 40018bec: 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 ); 40018bf0: 7f ff da 73 call 4000f5bc 40018bf4: 01 00 00 00 nop if ( _Chain_Is_empty( insert_chain ) ) { 40018bf8: c2 07 bf e8 ld [ %fp + -24 ], %g1 40018bfc: 80 a0 40 1a cmp %g1, %i2 40018c00: 02 80 00 12 be 40018c48 <_Timer_server_Body+0x158> <== ALWAYS TAKEN 40018c04: 01 00 00 00 nop ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 40018c08: 7f ff da 71 call 4000f5cc <== NOT EXECUTED 40018c0c: 01 00 00 00 nop <== NOT EXECUTED 40018c10: 30 bf ff cf b,a 40018b4c <_Timer_server_Body+0x5c> <== NOT EXECUTED /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 40018c14: 92 10 20 01 mov 1, %o1 ! 1 40018c18: 40 00 11 d8 call 4001d378 <_Watchdog_Adjust> 40018c1c: 94 22 80 17 sub %o2, %l7, %o2 40018c20: 30 bf ff df b,a 40018b9c <_Timer_server_Body+0xac> Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 40018c24: 90 10 00 1b mov %i3, %o0 40018c28: 40 00 12 30 call 4001d4e8 <_Watchdog_Insert> 40018c2c: 92 02 60 10 add %o1, 0x10, %o1 40018c30: 30 bf ff dc b,a 40018ba0 <_Timer_server_Body+0xb0> /* * 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 ); 40018c34: 92 22 40 0a sub %o1, %o2, %o1 40018c38: 90 10 00 1d mov %i5, %o0 40018c3c: 40 00 11 ff call 4001d438 <_Watchdog_Adjust_to_chain> 40018c40: 94 10 00 1c mov %i4, %o2 40018c44: 30 bf ff d6 b,a 40018b9c <_Timer_server_Body+0xac> */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; 40018c48: c0 26 20 78 clr [ %i0 + 0x78 ] _ISR_Enable( level ); 40018c4c: 7f ff da 60 call 4000f5cc 40018c50: 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 ) ) { 40018c54: c2 07 bf f4 ld [ %fp + -12 ], %g1 40018c58: 80 a0 40 11 cmp %g1, %l1 40018c5c: 12 80 00 0c bne 40018c8c <_Timer_server_Body+0x19c> 40018c60: 01 00 00 00 nop 40018c64: 30 80 00 13 b,a 40018cb0 <_Timer_server_Body+0x1c0> 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; 40018c68: f8 20 60 04 st %i4, [ %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; 40018c6c: 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; 40018c70: c0 25 e0 08 clr [ %l7 + 8 ] _ISR_Enable( level ); 40018c74: 7f ff da 56 call 4000f5cc 40018c78: 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 ); 40018c7c: d0 05 e0 20 ld [ %l7 + 0x20 ], %o0 40018c80: c2 05 e0 1c ld [ %l7 + 0x1c ], %g1 40018c84: 9f c0 40 00 call %g1 40018c88: d2 05 e0 24 ld [ %l7 + 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 ); 40018c8c: 7f ff da 4c call 4000f5bc 40018c90: 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; 40018c94: ee 07 bf f4 ld [ %fp + -12 ], %l7 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 40018c98: 80 a5 c0 11 cmp %l7, %l1 40018c9c: 32 bf ff f3 bne,a 40018c68 <_Timer_server_Body+0x178> 40018ca0: c2 05 c0 00 ld [ %l7 ], %g1 watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 40018ca4: 7f ff da 4a call 4000f5cc 40018ca8: 01 00 00 00 nop 40018cac: 30 bf ff a7 b,a 40018b48 <_Timer_server_Body+0x58> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 40018cb0: 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) { uint32_t level = _Thread_Dispatch_disable_level; 40018cb4: c2 04 c0 00 ld [ %l3 ], %g1 ++level; 40018cb8: 82 00 60 01 inc %g1 _Thread_Dispatch_disable_level = level; 40018cbc: c2 24 c0 00 st %g1, [ %l3 ] /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 40018cc0: d0 06 00 00 ld [ %i0 ], %o0 40018cc4: 40 00 10 c1 call 4001cfc8 <_Thread_Set_state> 40018cc8: 92 10 20 08 mov 8, %o1 _Timer_server_Reset_interval_system_watchdog( ts ); 40018ccc: 7f ff ff 07 call 400188e8 <_Timer_server_Reset_interval_system_watchdog> 40018cd0: 90 10 00 18 mov %i0, %o0 _Timer_server_Reset_tod_system_watchdog( ts ); 40018cd4: 7f ff ff 19 call 40018938 <_Timer_server_Reset_tod_system_watchdog> 40018cd8: 90 10 00 18 mov %i0, %o0 _Thread_Enable_dispatch(); 40018cdc: 40 00 0e 4d call 4001c610 <_Thread_Enable_dispatch> 40018ce0: 01 00 00 00 nop static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 40018ce4: 90 10 00 16 mov %l6, %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; 40018ce8: e8 2e 20 7c stb %l4, [ %i0 + 0x7c ] static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 40018cec: 40 00 12 5e call 4001d664 <_Watchdog_Remove> 40018cf0: 01 00 00 00 nop static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 40018cf4: 40 00 12 5c call 4001d664 <_Watchdog_Remove> 40018cf8: 90 10 00 15 mov %l5, %o0 40018cfc: 30 bf ff 93 b,a 40018b48 <_Timer_server_Body+0x58> =============================================================================== 40018988 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 40018988: 9d e3 bf a0 save %sp, -96, %sp if ( ts->insert_chain == NULL ) { 4001898c: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 40018990: 80 a0 60 00 cmp %g1, 0 40018994: 02 80 00 05 be 400189a8 <_Timer_server_Schedule_operation_method+0x20> 40018998: 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 ); 4001899c: f0 06 20 78 ld [ %i0 + 0x78 ], %i0 400189a0: 40 00 03 38 call 40019680 <_Chain_Append> 400189a4: 81 e8 00 00 restore * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 400189a8: 03 10 00 fa sethi %hi(0x4003e800), %g1 400189ac: c4 00 60 60 ld [ %g1 + 0x60 ], %g2 ! 4003e860 <_Thread_Dispatch_disable_level> ++level; 400189b0: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 400189b4: c4 20 60 60 st %g2, [ %g1 + 0x60 ] * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 400189b8: c2 06 60 38 ld [ %i1 + 0x38 ], %g1 400189bc: 80 a0 60 01 cmp %g1, 1 400189c0: 02 80 00 2b be 40018a6c <_Timer_server_Schedule_operation_method+0xe4> 400189c4: 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 ) { 400189c8: 02 80 00 04 be 400189d8 <_Timer_server_Schedule_operation_method+0x50> 400189cc: 01 00 00 00 nop if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 400189d0: 40 00 0f 10 call 4001c610 <_Thread_Enable_dispatch> 400189d4: 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 ); 400189d8: 7f ff da f9 call 4000f5bc 400189dc: 01 00 00 00 nop 400189e0: b8 10 00 08 mov %o0, %i4 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 400189e4: 03 10 00 f9 sethi %hi(0x4003e400), %g1 400189e8: d0 18 63 a8 ldd [ %g1 + 0x3a8 ], %o0 ! 4003e7a8 <_TOD> 400189ec: 94 10 20 00 clr %o2 400189f0: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400189f4: 40 00 51 cc call 4002d124 <__divdi3> 400189f8: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 400189fc: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 last_snapshot = ts->TOD_watchdogs.last_snapshot; 40018a00: c4 06 20 74 ld [ %i0 + 0x74 ], %g2 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 40018a04: 86 06 20 6c add %i0, 0x6c, %g3 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 40018a08: 80 a0 40 03 cmp %g1, %g3 40018a0c: 02 80 00 0a be 40018a34 <_Timer_server_Schedule_operation_method+0xac> 40018a10: 80 a2 40 02 cmp %o1, %g2 first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; if ( snapshot > last_snapshot ) { 40018a14: 08 80 00 34 bleu 40018ae4 <_Timer_server_Schedule_operation_method+0x15c> 40018a18: c8 00 60 10 ld [ %g1 + 0x10 ], %g4 /* * We advanced in time. */ delta = snapshot - last_snapshot; 40018a1c: 84 22 40 02 sub %o1, %g2, %g2 if (delta_interval > delta) { 40018a20: 80 a1 00 02 cmp %g4, %g2 40018a24: 08 80 00 03 bleu 40018a30 <_Timer_server_Schedule_operation_method+0xa8><== NEVER TAKEN 40018a28: 86 10 20 00 clr %g3 delta_interval -= delta; 40018a2c: 86 21 00 02 sub %g4, %g2, %g3 * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 40018a30: c6 20 60 10 st %g3, [ %g1 + 0x10 ] } ts->TOD_watchdogs.last_snapshot = snapshot; 40018a34: d2 26 20 74 st %o1, [ %i0 + 0x74 ] _ISR_Enable( level ); 40018a38: 7f ff da e5 call 4000f5cc 40018a3c: 90 10 00 1c mov %i4, %o0 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 40018a40: 90 06 20 68 add %i0, 0x68, %o0 40018a44: 40 00 12 a9 call 4001d4e8 <_Watchdog_Insert> 40018a48: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 40018a4c: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 40018a50: 80 a0 60 00 cmp %g1, 0 40018a54: 12 bf ff df bne 400189d0 <_Timer_server_Schedule_operation_method+0x48> 40018a58: 01 00 00 00 nop _Timer_server_Reset_tod_system_watchdog( ts ); 40018a5c: 7f ff ff b7 call 40018938 <_Timer_server_Reset_tod_system_watchdog> 40018a60: 90 10 00 18 mov %i0, %o0 } } _Thread_Enable_dispatch(); 40018a64: 40 00 0e eb call 4001c610 <_Thread_Enable_dispatch> 40018a68: 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 ); 40018a6c: 7f ff da d4 call 4000f5bc 40018a70: 01 00 00 00 nop snapshot = _Watchdog_Ticks_since_boot; 40018a74: 05 10 00 fa sethi %hi(0x4003e800), %g2 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40018a78: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 40018a7c: c4 00 a1 48 ld [ %g2 + 0x148 ], %g2 last_snapshot = ts->Interval_watchdogs.last_snapshot; 40018a80: 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 ); 40018a84: 86 06 20 34 add %i0, 0x34, %g3 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 40018a88: 80 a0 40 03 cmp %g1, %g3 40018a8c: 02 80 00 08 be 40018aac <_Timer_server_Schedule_operation_method+0x124> 40018a90: 88 20 80 04 sub %g2, %g4, %g4 /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 40018a94: f8 00 60 10 ld [ %g1 + 0x10 ], %i4 if (delta_interval > delta) { 40018a98: 80 a1 00 1c cmp %g4, %i4 40018a9c: 1a 80 00 03 bcc 40018aa8 <_Timer_server_Schedule_operation_method+0x120> 40018aa0: 86 10 20 00 clr %g3 delta_interval -= delta; 40018aa4: 86 27 00 04 sub %i4, %g4, %g3 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 40018aa8: c6 20 60 10 st %g3, [ %g1 + 0x10 ] } ts->Interval_watchdogs.last_snapshot = snapshot; 40018aac: c4 26 20 3c st %g2, [ %i0 + 0x3c ] _ISR_Enable( level ); 40018ab0: 7f ff da c7 call 4000f5cc 40018ab4: 01 00 00 00 nop _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 40018ab8: 90 06 20 30 add %i0, 0x30, %o0 40018abc: 40 00 12 8b call 4001d4e8 <_Watchdog_Insert> 40018ac0: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 40018ac4: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 40018ac8: 80 a0 60 00 cmp %g1, 0 40018acc: 12 bf ff c1 bne 400189d0 <_Timer_server_Schedule_operation_method+0x48> 40018ad0: 01 00 00 00 nop _Timer_server_Reset_interval_system_watchdog( ts ); 40018ad4: 7f ff ff 85 call 400188e8 <_Timer_server_Reset_interval_system_watchdog> 40018ad8: 90 10 00 18 mov %i0, %o0 if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 40018adc: 40 00 0e cd call 4001c610 <_Thread_Enable_dispatch> 40018ae0: 81 e8 00 00 restore } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 40018ae4: 84 01 00 02 add %g4, %g2, %g2 delta_interval += delta; 40018ae8: 10 bf ff d2 b 40018a30 <_Timer_server_Schedule_operation_method+0xa8> 40018aec: 86 20 80 09 sub %g2, %o1, %g3 =============================================================================== 4000d698 <_Timespec_Add_to>: ) { uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; 4000d698: d8 02 00 00 ld [ %o0 ], %o4 uint32_t _Timespec_Add_to( struct timespec *time, const struct timespec *add ) { uint32_t seconds = add->tv_sec; 4000d69c: c4 02 40 00 ld [ %o1 ], %g2 /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; 4000d6a0: c6 02 20 04 ld [ %o0 + 4 ], %g3 4000d6a4: c2 02 60 04 ld [ %o1 + 4 ], %g1 ) { uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; 4000d6a8: 98 03 00 02 add %o4, %g2, %o4 time->tv_nsec += add->tv_nsec; 4000d6ac: 82 00 c0 01 add %g3, %g1, %g1 ) { uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; 4000d6b0: d8 22 00 00 st %o4, [ %o0 ] time->tv_nsec += add->tv_nsec; /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 4000d6b4: 09 0e e6 b2 sethi %hi(0x3b9ac800), %g4 4000d6b8: 88 11 21 ff or %g4, 0x1ff, %g4 ! 3b9ac9ff 4000d6bc: 80 a0 40 04 cmp %g1, %g4 4000d6c0: 08 80 00 0d bleu 4000d6f4 <_Timespec_Add_to+0x5c> 4000d6c4: c2 22 20 04 st %g1, [ %o0 + 4 ] 4000d6c8: 98 03 20 01 inc %o4 time->tv_nsec -= TOD_NANOSECONDS_PER_SECOND; 4000d6cc: 1b 31 19 4d sethi %hi(0xc4653400), %o5 #include #include #include #include uint32_t _Timespec_Add_to( 4000d6d0: 98 23 00 02 sub %o4, %g2, %o4 time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { time->tv_nsec -= TOD_NANOSECONDS_PER_SECOND; 4000d6d4: 9a 13 62 00 or %o5, 0x200, %o5 4000d6d8: 82 00 40 0d add %g1, %o5, %g1 #include #include #include #include uint32_t _Timespec_Add_to( 4000d6dc: 86 03 00 02 add %o4, %g2, %g3 /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 4000d6e0: 80 a0 40 04 cmp %g1, %g4 4000d6e4: 18 bf ff fd bgu 4000d6d8 <_Timespec_Add_to+0x40> <== NEVER TAKEN 4000d6e8: 84 00 a0 01 inc %g2 4000d6ec: c2 22 20 04 st %g1, [ %o0 + 4 ] 4000d6f0: c6 22 00 00 st %g3, [ %o0 ] time->tv_sec++; seconds++; } return seconds; } 4000d6f4: 81 c3 e0 08 retl 4000d6f8: 90 10 00 02 mov %g2, %o0 =============================================================================== 4000d430 <_Timestamp64_Divide>: const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 4000d430: 9d e3 bf a0 save %sp, -96, %sp Timestamp64_Control answer; if ( *_rhs == 0 ) { 4000d434: d4 1e 40 00 ldd [ %i1 ], %o2 4000d438: 80 92 80 0b orcc %o2, %o3, %g0 4000d43c: 22 80 00 2f be,a 4000d4f8 <_Timestamp64_Divide+0xc8> <== NEVER TAKEN 4000d440: c0 26 80 00 clr [ %i2 ] <== NOT EXECUTED * This looks odd but gives the results the proper precision. * * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; 4000d444: e0 1e 00 00 ldd [ %i0 ], %l0 4000d448: 83 2c 20 02 sll %l0, 2, %g1 4000d44c: 89 34 60 1e srl %l1, 0x1e, %g4 4000d450: 87 2c 60 02 sll %l1, 2, %g3 4000d454: 84 11 00 01 or %g4, %g1, %g2 4000d458: 83 30 e0 1b srl %g3, 0x1b, %g1 4000d45c: 9b 28 e0 05 sll %g3, 5, %o5 4000d460: 99 28 a0 05 sll %g2, 5, %o4 4000d464: 86 a3 40 03 subcc %o5, %g3, %g3 4000d468: 98 10 40 0c or %g1, %o4, %o4 4000d46c: 84 63 00 02 subx %o4, %g2, %g2 4000d470: 92 80 c0 11 addcc %g3, %l1, %o1 4000d474: 83 32 60 1e srl %o1, 0x1e, %g1 4000d478: 90 40 80 10 addx %g2, %l0, %o0 4000d47c: b3 2a 60 02 sll %o1, 2, %i1 4000d480: b1 2a 20 02 sll %o0, 2, %i0 4000d484: 86 82 40 19 addcc %o1, %i1, %g3 4000d488: b0 10 40 18 or %g1, %i0, %i0 4000d48c: 83 30 e0 1e srl %g3, 0x1e, %g1 4000d490: 84 42 00 18 addx %o0, %i0, %g2 4000d494: bb 28 e0 02 sll %g3, 2, %i5 4000d498: b9 28 a0 02 sll %g2, 2, %i4 4000d49c: 92 80 c0 1d addcc %g3, %i5, %o1 4000d4a0: b8 10 40 1c or %g1, %i4, %i4 4000d4a4: 87 32 60 1b srl %o1, 0x1b, %g3 4000d4a8: 90 40 80 1c addx %g2, %i4, %o0 4000d4ac: 83 2a 60 05 sll %o1, 5, %g1 4000d4b0: 85 2a 20 05 sll %o0, 5, %g2 4000d4b4: 92 10 00 01 mov %g1, %o1 4000d4b8: 40 00 3b 32 call 4001c180 <__divdi3> 4000d4bc: 90 10 c0 02 or %g3, %g2, %o0 *_ival_percentage = answer / 1000; 4000d4c0: 94 10 20 00 clr %o2 * This looks odd but gives the results the proper precision. * * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; 4000d4c4: b8 10 00 08 mov %o0, %i4 4000d4c8: ba 10 00 09 mov %o1, %i5 *_ival_percentage = answer / 1000; 4000d4cc: 40 00 3b 2d call 4001c180 <__divdi3> 4000d4d0: 96 10 23 e8 mov 0x3e8, %o3 *_fval_percentage = answer % 1000; 4000d4d4: 90 10 00 1c mov %i4, %o0 * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; 4000d4d8: d2 26 80 00 st %o1, [ %i2 ] *_fval_percentage = answer % 1000; 4000d4dc: 94 10 20 00 clr %o2 4000d4e0: 96 10 23 e8 mov 0x3e8, %o3 4000d4e4: 40 00 3c 12 call 4001c52c <__moddi3> 4000d4e8: 92 10 00 1d mov %i5, %o1 4000d4ec: d2 26 c0 00 st %o1, [ %i3 ] 4000d4f0: 81 c7 e0 08 ret 4000d4f4: 81 e8 00 00 restore { Timestamp64_Control answer; if ( *_rhs == 0 ) { *_ival_percentage = 0; *_fval_percentage = 0; 4000d4f8: c0 26 c0 00 clr [ %i3 ] <== NOT EXECUTED return; 4000d4fc: 81 c7 e0 08 ret <== NOT EXECUTED 4000d500: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4000bd78 <_User_extensions_Handler_initialization>: } } void _User_extensions_Handler_initialization(void) { 4000bd78: 9d e3 bf 98 save %sp, -104, %sp uint32_t number_of_initial_extensions = 4000bd7c: 03 10 00 75 sethi %hi(0x4001d400), %g1 4000bd80: c2 00 62 58 ld [ %g1 + 0x258 ], %g1 ! 4001d658 rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { 4000bd84: 80 a0 60 00 cmp %g1, 0 4000bd88: 02 80 00 0a be 4000bdb0 <_User_extensions_Handler_initialization+0x38><== NEVER TAKEN 4000bd8c: 91 28 60 02 sll %g1, 2, %o0 User_extensions_Switch_control *initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) 4000bd90: 83 28 60 04 sll %g1, 4, %g1 { uint32_t number_of_initial_extensions = rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { User_extensions_Switch_control *initial_extension_switch_controls = 4000bd94: 40 00 01 2c call 4000c244 <_Workspace_Allocate_or_fatal_error> 4000bd98: 90 20 40 08 sub %g1, %o0, %o0 number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) ); User_extensions_Switch_context ctx = { initial_extension_switch_controls }; _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 4000bd9c: 13 10 00 2f sethi %hi(0x4000bc00), %o1 User_extensions_Switch_control *initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) ); User_extensions_Switch_context ctx = { initial_extension_switch_controls }; 4000bda0: d0 27 bf fc st %o0, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 4000bda4: 92 12 61 34 or %o1, 0x134, %o1 4000bda8: 7f ff ff c0 call 4000bca8 <_User_extensions_Iterate> 4000bdac: 90 07 bf fc add %fp, -4, %o0 4000bdb0: 81 c7 e0 08 ret 4000bdb4: 81 e8 00 00 restore =============================================================================== 4000bca8 <_User_extensions_Iterate>: void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { 4000bca8: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *executing = _Thread_Executing; const User_extensions_Table *callouts_current = 4000bcac: 03 10 00 75 sethi %hi(0x4001d400), %g1 4000bcb0: 82 10 62 18 or %g1, 0x218, %g1 ! 4001d618 4000bcb4: fa 00 60 44 ld [ %g1 + 0x44 ], %i5 rtems_configuration_get_user_extension_table(); const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); 4000bcb8: f6 00 60 40 ld [ %g1 + 0x40 ], %i3 void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { Thread_Control *executing = _Thread_Executing; 4000bcbc: 03 10 00 81 sethi %hi(0x40020400), %g1 const User_extensions_Table *callouts_current = rtems_configuration_get_user_extension_table(); const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); 4000bcc0: b7 2e e0 05 sll %i3, 5, %i3 ) { Thread_Control *executing = _Thread_Executing; const User_extensions_Table *callouts_current = rtems_configuration_get_user_extension_table(); const User_extensions_Table *callouts_end = 4000bcc4: b6 07 40 1b add %i5, %i3, %i3 callouts_current + rtems_configuration_get_number_of_initial_extensions(); const Chain_Node *node; const Chain_Node *tail; while ( callouts_current != callouts_end ) { 4000bcc8: 80 a7 40 1b cmp %i5, %i3 4000bccc: 02 80 00 0a be 4000bcf4 <_User_extensions_Iterate+0x4c> <== NEVER TAKEN 4000bcd0: f8 00 63 d0 ld [ %g1 + 0x3d0 ], %i4 (*visitor)( executing, arg, callouts_current ); 4000bcd4: 94 10 00 1d mov %i5, %o2 4000bcd8: 90 10 00 1c mov %i4, %o0 4000bcdc: 9f c6 40 00 call %i1 4000bce0: 92 10 00 18 mov %i0, %o1 ++callouts_current; 4000bce4: ba 07 60 20 add %i5, 0x20, %i5 const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); const Chain_Node *node; const Chain_Node *tail; while ( callouts_current != callouts_end ) { 4000bce8: 80 a6 c0 1d cmp %i3, %i5 4000bcec: 12 bf ff fb bne 4000bcd8 <_User_extensions_Iterate+0x30> 4000bcf0: 94 10 00 1d mov %i5, %o2 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4000bcf4: 37 10 00 7d sethi %hi(0x4001f400), %i3 4000bcf8: fa 06 e2 84 ld [ %i3 + 0x284 ], %i5 ! 4001f684 <_User_extensions_List> 4000bcfc: b6 16 e2 84 or %i3, 0x284, %i3 ++callouts_current; } node = _Chain_Immutable_first( &_User_extensions_List ); tail = _Chain_Immutable_tail( &_User_extensions_List ); while ( node != tail ) { 4000bd00: b6 06 e0 04 add %i3, 4, %i3 4000bd04: 80 a7 40 1b cmp %i5, %i3 4000bd08: 02 80 00 09 be 4000bd2c <_User_extensions_Iterate+0x84> 4000bd0c: 94 07 60 14 add %i5, 0x14, %o2 const User_extensions_Control *extension = (const User_extensions_Control *) node; (*visitor)( executing, arg, &extension->Callouts ); 4000bd10: 90 10 00 1c mov %i4, %o0 4000bd14: 9f c6 40 00 call %i1 4000bd18: 92 10 00 18 mov %i0, %o1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_next( const Chain_Node *the_node ) { return the_node->next; 4000bd1c: fa 07 40 00 ld [ %i5 ], %i5 ++callouts_current; } node = _Chain_Immutable_first( &_User_extensions_List ); tail = _Chain_Immutable_tail( &_User_extensions_List ); while ( node != tail ) { 4000bd20: 80 a7 40 1b cmp %i5, %i3 4000bd24: 12 bf ff fb bne 4000bd10 <_User_extensions_Iterate+0x68> 4000bd28: 94 07 60 14 add %i5, 0x14, %o2 4000bd2c: 81 c7 e0 08 ret 4000bd30: 81 e8 00 00 restore =============================================================================== 4000d77c <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4000d77c: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; _ISR_Disable( level ); 4000d780: 7f ff d6 a2 call 40003208 4000d784: 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; 4000d788: 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 ); 4000d78c: b8 06 20 04 add %i0, 4, %i4 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 4000d790: 80 a0 40 1c cmp %g1, %i4 4000d794: 02 80 00 1f be 4000d810 <_Watchdog_Adjust+0x94> 4000d798: 80 a6 60 00 cmp %i1, 0 switch ( direction ) { 4000d79c: 12 80 00 1f bne 4000d818 <_Watchdog_Adjust+0x9c> 4000d7a0: 80 a6 60 01 cmp %i1, 1 case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4000d7a4: 80 a6 a0 00 cmp %i2, 0 4000d7a8: 02 80 00 1a be 4000d810 <_Watchdog_Adjust+0x94> <== NEVER TAKEN 4000d7ac: 01 00 00 00 nop if ( units < _Watchdog_First( header )->delta_interval ) { 4000d7b0: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000d7b4: 80 a6 80 02 cmp %i2, %g2 4000d7b8: 1a 80 00 0a bcc 4000d7e0 <_Watchdog_Adjust+0x64> <== ALWAYS TAKEN 4000d7bc: b6 10 20 01 mov 1, %i3 _Watchdog_First( header )->delta_interval -= units; 4000d7c0: 10 80 00 1d b 4000d834 <_Watchdog_Adjust+0xb8> <== NOT EXECUTED 4000d7c4: 84 20 80 1a sub %g2, %i2, %g2 <== NOT EXECUTED switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4000d7c8: 02 80 00 12 be 4000d810 <_Watchdog_Adjust+0x94> <== NEVER TAKEN 4000d7cc: 01 00 00 00 nop if ( units < _Watchdog_First( header )->delta_interval ) { 4000d7d0: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000d7d4: 80 a0 80 1a cmp %g2, %i2 4000d7d8: 38 80 00 17 bgu,a 4000d834 <_Watchdog_Adjust+0xb8> 4000d7dc: 84 20 80 1a sub %g2, %i2, %g2 _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 4000d7e0: f6 20 60 10 st %i3, [ %g1 + 0x10 ] while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 4000d7e4: b4 26 80 02 sub %i2, %g2, %i2 _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); 4000d7e8: 7f ff d6 8c call 40003218 4000d7ec: 01 00 00 00 nop _Watchdog_Tickle( header ); 4000d7f0: 40 00 00 a8 call 4000da90 <_Watchdog_Tickle> 4000d7f4: 90 10 00 18 mov %i0, %o0 _ISR_Disable( level ); 4000d7f8: 7f ff d6 84 call 40003208 4000d7fc: 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; 4000d800: c2 06 00 00 ld [ %i0 ], %g1 if ( _Chain_Is_empty( header ) ) 4000d804: 80 a7 00 01 cmp %i4, %g1 4000d808: 12 bf ff f0 bne 4000d7c8 <_Watchdog_Adjust+0x4c> 4000d80c: 80 a6 a0 00 cmp %i2, 0 } break; } } _ISR_Enable( level ); 4000d810: 7f ff d6 82 call 40003218 4000d814: 91 e8 00 08 restore %g0, %o0, %o0 * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { 4000d818: 12 bf ff fe bne 4000d810 <_Watchdog_Adjust+0x94> <== NEVER TAKEN 4000d81c: 01 00 00 00 nop case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4000d820: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000d824: b4 00 80 1a add %g2, %i2, %i2 4000d828: f4 20 60 10 st %i2, [ %g1 + 0x10 ] } break; } } _ISR_Enable( level ); 4000d82c: 7f ff d6 7b call 40003218 4000d830: 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; 4000d834: 10 bf ff f7 b 4000d810 <_Watchdog_Adjust+0x94> 4000d838: c4 20 60 10 st %g2, [ %g1 + 0x10 ] =============================================================================== 4001d438 <_Watchdog_Adjust_to_chain>: Chain_Control *header, Watchdog_Interval units_arg, Chain_Control *to_fire ) { 4001d438: 9d e3 bf a0 save %sp, -96, %sp Watchdog_Interval units = units_arg; ISR_Level level; Watchdog_Control *first; _ISR_Disable( level ); 4001d43c: 7f ff c8 60 call 4000f5bc 4001d440: 01 00 00 00 nop 4001d444: c2 06 00 00 ld [ %i0 ], %g1 4001d448: ba 06 20 04 add %i0, 4, %i5 4001d44c: b8 06 a0 04 add %i2, 4, %i4 while ( 1 ) { if ( _Chain_Is_empty( header ) ) { 4001d450: 80 a7 40 01 cmp %i5, %g1 4001d454: 02 80 00 20 be 4001d4d4 <_Watchdog_Adjust_to_chain+0x9c> 4001d458: 01 00 00 00 nop /* * If it is longer than "units" until the first element on the chain * fires, then bump it and quit. */ if ( units < first->delta_interval ) { 4001d45c: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4001d460: 80 a6 40 02 cmp %i1, %g2 4001d464: 2a 80 00 1e bcs,a 4001d4dc <_Watchdog_Adjust_to_chain+0xa4> 4001d468: 84 20 80 19 sub %g2, %i1, %g2 /* * The first set happens in less than units, so take all of them * off the chain and adjust units to reflect this. */ units -= first->delta_interval; 4001d46c: b2 26 40 02 sub %i1, %g2, %i1 first->delta_interval = 0; 4001d470: c0 20 60 10 clr [ %g1 + 0x10 ] { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4001d474: c4 00 60 04 ld [ %g1 + 4 ], %g2 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4001d478: c6 00 40 00 ld [ %g1 ], %g3 previous = the_node->previous; next->previous = previous; 4001d47c: c4 20 e0 04 st %g2, [ %g3 + 4 ] previous->next = next; 4001d480: c6 20 80 00 st %g3, [ %g2 ] Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 4001d484: c4 06 a0 08 ld [ %i2 + 8 ], %g2 the_node->next = tail; 4001d488: f8 20 40 00 st %i4, [ %g1 ] tail->previous = the_node; 4001d48c: c2 26 a0 08 st %g1, [ %i2 + 8 ] old_last->next = the_node; 4001d490: c2 20 80 00 st %g1, [ %g2 ] the_node->previous = old_last; 4001d494: c4 20 60 04 st %g2, [ %g1 + 4 ] while ( 1 ) { _Chain_Extract_unprotected( &first->Node ); _Chain_Append_unprotected( to_fire, &first->Node ); _ISR_Flash( level ); 4001d498: 7f ff c8 4d call 4000f5cc 4001d49c: 01 00 00 00 nop 4001d4a0: 7f ff c8 47 call 4000f5bc 4001d4a4: 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; 4001d4a8: c2 06 00 00 ld [ %i0 ], %g1 if ( _Chain_Is_empty( header ) ) 4001d4ac: 80 a7 40 01 cmp %i5, %g1 4001d4b0: 02 bf ff e9 be 4001d454 <_Watchdog_Adjust_to_chain+0x1c> 4001d4b4: 01 00 00 00 nop break; first = _Watchdog_First( header ); if ( first->delta_interval != 0 ) 4001d4b8: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4001d4bc: 80 a0 a0 00 cmp %g2, 0 4001d4c0: 22 bf ff ee be,a 4001d478 <_Watchdog_Adjust_to_chain+0x40> 4001d4c4: c4 00 60 04 ld [ %g1 + 4 ], %g2 Watchdog_Control *first; _ISR_Disable( level ); while ( 1 ) { if ( _Chain_Is_empty( header ) ) { 4001d4c8: 80 a7 40 01 cmp %i5, %g1 4001d4cc: 12 bf ff e6 bne 4001d464 <_Watchdog_Adjust_to_chain+0x2c> <== ALWAYS TAKEN 4001d4d0: 80 a6 40 02 cmp %i1, %g2 if ( first->delta_interval != 0 ) break; } } _ISR_Enable( level ); 4001d4d4: 7f ff c8 3e call 4000f5cc 4001d4d8: 91 e8 00 08 restore %g0, %o0, %o0 /* * If it is longer than "units" until the first element on the chain * fires, then bump it and quit. */ if ( units < first->delta_interval ) { first->delta_interval -= units; 4001d4dc: c4 20 60 10 st %g2, [ %g1 + 0x10 ] if ( first->delta_interval != 0 ) break; } } _ISR_Enable( level ); 4001d4e0: 7f ff c8 3b call 4000f5cc 4001d4e4: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000bf34 <_Watchdog_Remove>: #include Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 4000bf34: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4000bf38: 7f ff d9 66 call 400024d0 4000bf3c: 01 00 00 00 nop previous_state = the_watchdog->state; 4000bf40: fa 06 20 08 ld [ %i0 + 8 ], %i5 switch ( previous_state ) { 4000bf44: 80 a7 60 01 cmp %i5, 1 4000bf48: 02 80 00 2a be 4000bff0 <_Watchdog_Remove+0xbc> 4000bf4c: 03 10 00 80 sethi %hi(0x40020000), %g1 4000bf50: 1a 80 00 09 bcc 4000bf74 <_Watchdog_Remove+0x40> 4000bf54: 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; 4000bf58: 03 10 00 80 sethi %hi(0x40020000), %g1 4000bf5c: c2 00 63 98 ld [ %g1 + 0x398 ], %g1 ! 40020398 <_Watchdog_Ticks_since_boot> 4000bf60: c2 26 20 18 st %g1, [ %i0 + 0x18 ] _ISR_Enable( level ); 4000bf64: 7f ff d9 5f call 400024e0 4000bf68: b0 10 00 1d mov %i5, %i0 return( previous_state ); } 4000bf6c: 81 c7 e0 08 ret 4000bf70: 81 e8 00 00 restore Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); previous_state = the_watchdog->state; switch ( previous_state ) { 4000bf74: 18 bf ff fa bgu 4000bf5c <_Watchdog_Remove+0x28> <== NEVER TAKEN 4000bf78: 03 10 00 80 sethi %hi(0x40020000), %g1 RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 4000bf7c: c2 06 00 00 ld [ %i0 ], %g1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 4000bf80: c0 26 20 08 clr [ %i0 + 8 ] next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 4000bf84: c4 00 40 00 ld [ %g1 ], %g2 4000bf88: 80 a0 a0 00 cmp %g2, 0 4000bf8c: 02 80 00 07 be 4000bfa8 <_Watchdog_Remove+0x74> 4000bf90: 05 10 00 80 sethi %hi(0x40020000), %g2 next_watchdog->delta_interval += the_watchdog->delta_interval; 4000bf94: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 4000bf98: c4 06 20 10 ld [ %i0 + 0x10 ], %g2 4000bf9c: 84 00 c0 02 add %g3, %g2, %g2 4000bfa0: c4 20 60 10 st %g2, [ %g1 + 0x10 ] if ( _Watchdog_Sync_count ) 4000bfa4: 05 10 00 80 sethi %hi(0x40020000), %g2 4000bfa8: c4 00 a3 94 ld [ %g2 + 0x394 ], %g2 ! 40020394 <_Watchdog_Sync_count> 4000bfac: 80 a0 a0 00 cmp %g2, 0 4000bfb0: 22 80 00 07 be,a 4000bfcc <_Watchdog_Remove+0x98> 4000bfb4: c4 06 20 04 ld [ %i0 + 4 ], %g2 _Watchdog_Sync_level = _ISR_Nest_level; 4000bfb8: 05 10 00 81 sethi %hi(0x40020400), %g2 4000bfbc: c6 00 a3 c8 ld [ %g2 + 0x3c8 ], %g3 ! 400207c8 <_Per_CPU_Information+0x8> 4000bfc0: 05 10 00 80 sethi %hi(0x40020000), %g2 4000bfc4: c6 20 a3 34 st %g3, [ %g2 + 0x334 ] ! 40020334 <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4000bfc8: c4 06 20 04 ld [ %i0 + 4 ], %g2 next->previous = previous; 4000bfcc: c4 20 60 04 st %g2, [ %g1 + 4 ] previous->next = next; 4000bfd0: c2 20 80 00 st %g1, [ %g2 ] _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4000bfd4: 03 10 00 80 sethi %hi(0x40020000), %g1 4000bfd8: c2 00 63 98 ld [ %g1 + 0x398 ], %g1 ! 40020398 <_Watchdog_Ticks_since_boot> 4000bfdc: c2 26 20 18 st %g1, [ %i0 + 0x18 ] _ISR_Enable( level ); 4000bfe0: 7f ff d9 40 call 400024e0 4000bfe4: b0 10 00 1d mov %i5, %i0 return( previous_state ); } 4000bfe8: 81 c7 e0 08 ret 4000bfec: 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; 4000bff0: c2 00 63 98 ld [ %g1 + 0x398 ], %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; 4000bff4: 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; 4000bff8: c2 26 20 18 st %g1, [ %i0 + 0x18 ] _ISR_Enable( level ); 4000bffc: 7f ff d9 39 call 400024e0 4000c000: b0 10 00 1d mov %i5, %i0 return( previous_state ); } 4000c004: 81 c7 e0 08 ret 4000c008: 81 e8 00 00 restore =============================================================================== 4000d1bc <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 4000d1bc: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 4000d1c0: 7f ff d7 10 call 40002e00 4000d1c4: 01 00 00 00 nop 4000d1c8: b6 10 00 08 mov %o0, %i3 printk( "Watchdog Chain: %s %p\n", name, header ); 4000d1cc: 11 10 00 80 sethi %hi(0x40020000), %o0 4000d1d0: 94 10 00 19 mov %i1, %o2 4000d1d4: 92 10 00 18 mov %i0, %o1 4000d1d8: 7f ff e1 fa call 400059c0 4000d1dc: 90 12 22 38 or %o0, 0x238, %o0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4000d1e0: fa 06 40 00 ld [ %i1 ], %i5 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000d1e4: b2 06 60 04 add %i1, 4, %i1 if ( !_Chain_Is_empty( header ) ) { 4000d1e8: 80 a7 40 19 cmp %i5, %i1 4000d1ec: 02 80 00 0f be 4000d228 <_Watchdog_Report_chain+0x6c> 4000d1f0: 11 10 00 80 sethi %hi(0x40020000), %o0 node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 4000d1f4: 92 10 00 1d mov %i5, %o1 4000d1f8: 40 00 00 0f call 4000d234 <_Watchdog_Report> 4000d1fc: 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 ) 4000d200: fa 07 40 00 ld [ %i5 ], %i5 Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; 4000d204: 80 a7 40 19 cmp %i5, %i1 4000d208: 12 bf ff fc bne 4000d1f8 <_Watchdog_Report_chain+0x3c> <== NEVER TAKEN 4000d20c: 92 10 00 1d mov %i5, %o1 { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 4000d210: 11 10 00 80 sethi %hi(0x40020000), %o0 4000d214: 92 10 00 18 mov %i0, %o1 4000d218: 7f ff e1 ea call 400059c0 4000d21c: 90 12 22 50 or %o0, 0x250, %o0 } else { printk( "Chain is empty\n" ); } _ISR_Enable( level ); 4000d220: 7f ff d6 fc call 40002e10 4000d224: 91 e8 00 1b restore %g0, %i3, %o0 _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); 4000d228: 7f ff e1 e6 call 400059c0 4000d22c: 90 12 22 60 or %o0, 0x260, %o0 4000d230: 30 bf ff fc b,a 4000d220 <_Watchdog_Report_chain+0x64> =============================================================================== 4000c00c <_Watchdog_Tickle>: #include void _Watchdog_Tickle( Chain_Control *header ) { 4000c00c: 9d e3 bf a0 save %sp, -96, %sp * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 4000c010: 7f ff d9 30 call 400024d0 4000c014: 01 00 00 00 nop 4000c018: b8 10 00 08 mov %o0, %i4 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4000c01c: 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 ); 4000c020: b4 06 20 04 add %i0, 4, %i2 if ( _Chain_Is_empty( header ) ) 4000c024: 80 a7 40 1a cmp %i5, %i2 4000c028: 02 80 00 09 be 4000c04c <_Watchdog_Tickle+0x40> 4000c02c: 01 00 00 00 nop * to be inserted has already had its delta_interval adjusted to 0, and * so is added to the head of the chain with a delta_interval of 0. * * Steven Johnson - 12/2005 (gcc-3.2.3 -O3 on powerpc) */ if (the_watchdog->delta_interval != 0) { 4000c030: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000c034: 80 a0 60 00 cmp %g1, 0 4000c038: 02 80 00 15 be 4000c08c <_Watchdog_Tickle+0x80> <== NEVER TAKEN 4000c03c: 82 00 7f ff add %g1, -1, %g1 the_watchdog->delta_interval--; if ( the_watchdog->delta_interval != 0 ) 4000c040: 80 a0 60 00 cmp %g1, 0 4000c044: 02 80 00 12 be 4000c08c <_Watchdog_Tickle+0x80> 4000c048: c2 27 60 10 st %g1, [ %i5 + 0x10 ] the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 4000c04c: 7f ff d9 25 call 400024e0 4000c050: 91 e8 00 1c restore %g0, %i4, %o0 _ISR_Enable( level ); switch( watchdog_state ) { case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 4000c054: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 4000c058: 9f c0 40 00 call %g1 4000c05c: d2 07 60 24 ld [ %i5 + 0x24 ], %o1 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 4000c060: 7f ff d9 1c call 400024d0 4000c064: 01 00 00 00 nop 4000c068: b8 10 00 08 mov %o0, %i4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000c06c: fa 06 00 00 ld [ %i0 ], %i5 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 4000c070: 80 a6 80 1d cmp %i2, %i5 4000c074: 02 bf ff f6 be 4000c04c <_Watchdog_Tickle+0x40> 4000c078: 01 00 00 00 nop } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 4000c07c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000c080: 80 a0 60 00 cmp %g1, 0 4000c084: 12 bf ff f2 bne 4000c04c <_Watchdog_Tickle+0x40> 4000c088: 01 00 00 00 nop if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 4000c08c: 7f ff ff aa call 4000bf34 <_Watchdog_Remove> 4000c090: 90 10 00 1d mov %i5, %o0 4000c094: b6 10 00 08 mov %o0, %i3 _ISR_Enable( level ); 4000c098: 7f ff d9 12 call 400024e0 4000c09c: 90 10 00 1c mov %i4, %o0 switch( watchdog_state ) { 4000c0a0: 80 a6 e0 02 cmp %i3, 2 4000c0a4: 12 bf ff ef bne 4000c060 <_Watchdog_Tickle+0x54> 4000c0a8: 01 00 00 00 nop case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 4000c0ac: 10 bf ff ea b 4000c054 <_Watchdog_Tickle+0x48> 4000c0b0: d0 07 60 20 ld [ %i5 + 0x20 ], %o0 =============================================================================== 4000c0b4 <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 4000c0b4: 9d e3 bf 98 save %sp, -104, %sp Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 4000c0b8: 05 10 00 75 sethi %hi(0x4001d400), %g2 4000c0bc: 82 10 a2 18 or %g2, 0x218, %g1 ! 4001d618 4000c0c0: c6 08 60 32 ldub [ %g1 + 0x32 ], %g3 4000c0c4: f6 00 a2 18 ld [ %g2 + 0x218 ], %i3 4000c0c8: 80 a0 e0 00 cmp %g3, 0 4000c0cc: 12 80 00 03 bne 4000c0d8 <_Workspace_Handler_initialization+0x24> 4000c0d0: 84 10 20 00 clr %g2 4000c0d4: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000c0d8: b6 00 80 1b add %g2, %i3, %i3 bool do_zero = rtems_configuration_get_do_zero_of_workspace(); 4000c0dc: c4 08 60 30 ldub [ %g1 + 0x30 ], %g2 bool unified = rtems_configuration_get_unified_work_area(); 4000c0e0: c2 08 60 31 ldub [ %g1 + 0x31 ], %g1 Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); bool do_zero = rtems_configuration_get_do_zero_of_workspace(); 4000c0e4: c4 2f bf ff stb %g2, [ %fp + -1 ] bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 4000c0e8: 80 a6 60 00 cmp %i1, 0 4000c0ec: 02 80 00 3c be 4000c1dc <_Workspace_Handler_initialization+0x128><== NEVER TAKEN 4000c0f0: c2 2f bf fe stb %g1, [ %fp + -2 ] Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 4000c0f4: 23 10 00 26 sethi %hi(0x40009800), %l1 } else { size = 0; } } space_available = (*init_or_extend)( 4000c0f8: 27 10 00 80 sethi %hi(0x40020000), %l3 bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 4000c0fc: b8 10 20 00 clr %i4 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 4000c100: a2 14 60 98 or %l1, 0x98, %l1 4000c104: a0 08 a0 ff and %g2, 0xff, %l0 if ( area->size > overhead ) { uintptr_t space_available; uintptr_t size; if ( unified ) { 4000c108: a4 08 60 ff and %g1, 0xff, %l2 } else { size = 0; } } space_available = (*init_or_extend)( 4000c10c: 10 80 00 22 b 4000c194 <_Workspace_Handler_initialization+0xe0> 4000c110: a6 14 e2 c0 or %l3, 0x2c0, %l3 if ( do_zero ) { memset( area->begin, 0, area->size ); } if ( area->size > overhead ) { 4000c114: 80 a7 60 16 cmp %i5, 0x16 4000c118: 28 80 00 1c bleu,a 4000c188 <_Workspace_Handler_initialization+0xd4> 4000c11c: b8 07 20 01 inc %i4 uintptr_t space_available; uintptr_t size; if ( unified ) { 4000c120: 80 a4 a0 00 cmp %l2, 0 4000c124: 32 80 00 0a bne,a 4000c14c <_Workspace_Handler_initialization+0x98> 4000c128: d2 06 00 00 ld [ %i0 ], %o1 size = area->size; } else { if ( remaining > 0 ) { 4000c12c: 80 a6 e0 00 cmp %i3, 0 4000c130: 22 80 00 22 be,a 4000c1b8 <_Workspace_Handler_initialization+0x104><== NEVER TAKEN 4000c134: d2 06 00 00 ld [ %i0 ], %o1 <== NOT EXECUTED size = remaining < area->size - overhead ? 4000c138: 82 07 7f ea add %i5, -22, %g1 remaining + overhead : area->size; 4000c13c: 80 a0 40 1b cmp %g1, %i3 4000c140: 38 80 00 02 bgu,a 4000c148 <_Workspace_Handler_initialization+0x94><== ALWAYS TAKEN 4000c144: ba 06 e0 16 add %i3, 0x16, %i5 } else { size = 0; } } space_available = (*init_or_extend)( 4000c148: d2 06 00 00 ld [ %i0 ], %o1 4000c14c: 94 10 00 1d mov %i5, %o2 4000c150: 90 10 00 13 mov %l3, %o0 4000c154: 9f c4 40 00 call %l1 4000c158: 96 10 20 08 mov 8, %o3 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000c15c: c2 06 00 00 ld [ %i0 ], %g1 area->size -= size; 4000c160: c4 06 20 04 ld [ %i0 + 4 ], %g2 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000c164: 82 00 40 1d add %g1, %i5, %g1 area->size -= size; 4000c168: ba 20 80 1d sub %g2, %i5, %i5 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000c16c: c2 26 00 00 st %g1, [ %i0 ] area->size -= size; if ( space_available < remaining ) { 4000c170: 80 a2 00 1b cmp %o0, %i3 4000c174: 1a 80 00 1f bcc 4000c1f0 <_Workspace_Handler_initialization+0x13c><== ALWAYS TAKEN 4000c178: fa 26 20 04 st %i5, [ %i0 + 4 ] remaining -= space_available; 4000c17c: b6 26 c0 08 sub %i3, %o0, %i3 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; 4000c180: a2 10 00 1a mov %i2, %l1 <== NOT EXECUTED bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 4000c184: b8 07 20 01 inc %i4 4000c188: 80 a7 00 19 cmp %i4, %i1 4000c18c: 02 80 00 14 be 4000c1dc <_Workspace_Handler_initialization+0x128><== ALWAYS TAKEN 4000c190: b0 06 20 08 add %i0, 8, %i0 Heap_Area *area = &areas [i]; if ( do_zero ) { 4000c194: 80 a4 20 00 cmp %l0, 0 4000c198: 22 bf ff df be,a 4000c114 <_Workspace_Handler_initialization+0x60> 4000c19c: fa 06 20 04 ld [ %i0 + 4 ], %i5 memset( area->begin, 0, area->size ); 4000c1a0: d0 06 00 00 ld [ %i0 ], %o0 4000c1a4: d4 06 20 04 ld [ %i0 + 4 ], %o2 4000c1a8: 40 00 14 74 call 40011378 4000c1ac: 92 10 20 00 clr %o1 } if ( area->size > overhead ) { 4000c1b0: 10 bf ff d9 b 4000c114 <_Workspace_Handler_initialization+0x60> 4000c1b4: fa 06 20 04 ld [ %i0 + 4 ], %i5 } else { size = 0; } } space_available = (*init_or_extend)( 4000c1b8: 90 10 00 13 mov %l3, %o0 <== NOT EXECUTED 4000c1bc: 94 10 20 00 clr %o2 <== NOT EXECUTED 4000c1c0: 9f c4 40 00 call %l1 <== NOT EXECUTED 4000c1c4: 96 10 20 08 mov 8, %o3 <== NOT EXECUTED bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 4000c1c8: b8 07 20 01 inc %i4 <== NOT EXECUTED remaining -= space_available; } else { remaining = 0; } init_or_extend = extend; 4000c1cc: a2 10 00 1a mov %i2, %l1 <== NOT EXECUTED bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 4000c1d0: 80 a7 00 19 cmp %i4, %i1 <== NOT EXECUTED 4000c1d4: 12 bf ff f0 bne 4000c194 <_Workspace_Handler_initialization+0xe0><== NOT EXECUTED 4000c1d8: b0 06 20 08 add %i0, 8, %i0 <== NOT EXECUTED init_or_extend = extend; } } if ( remaining > 0 ) { 4000c1dc: 80 a6 e0 00 cmp %i3, 0 4000c1e0: 12 80 00 07 bne 4000c1fc <_Workspace_Handler_initialization+0x148> 4000c1e4: 90 10 20 00 clr %o0 4000c1e8: 81 c7 e0 08 ret 4000c1ec: 81 e8 00 00 restore remaining -= space_available; } else { remaining = 0; } init_or_extend = extend; 4000c1f0: a2 10 00 1a mov %i2, %l1 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; 4000c1f4: 10 bf ff e4 b 4000c184 <_Workspace_Handler_initialization+0xd0> 4000c1f8: b6 10 20 00 clr %i3 init_or_extend = extend; } } if ( remaining > 0 ) { _Internal_error_Occurred( 4000c1fc: 92 10 20 01 mov 1, %o1 4000c200: 7f ff f6 43 call 40009b0c <_Internal_error_Occurred> 4000c204: 94 10 20 02 mov 2, %o2 =============================================================================== 400080c0 : */ int adjtime( const struct timeval *delta, struct timeval *olddelta ) { 400080c0: 9d e3 bf 98 save %sp, -104, %sp long adjustment; /* * Simple validations */ if ( !delta ) 400080c4: 80 a6 20 00 cmp %i0, 0 400080c8: 02 80 00 8e be 40008300 400080cc: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) 400080d0: c4 06 20 04 ld [ %i0 + 4 ], %g2 400080d4: 03 00 03 d0 sethi %hi(0xf4000), %g1 400080d8: 82 10 62 3f or %g1, 0x23f, %g1 ! f423f 400080dc: 80 a0 80 01 cmp %g2, %g1 400080e0: 18 80 00 88 bgu 40008300 400080e4: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( olddelta ) { 400080e8: 22 80 00 06 be,a 40008100 400080ec: c2 06 00 00 ld [ %i0 ], %g1 olddelta->tv_sec = 0; olddelta->tv_usec = 0; 400080f0: c0 26 60 04 clr [ %i1 + 4 ] 400080f4: c4 06 20 04 ld [ %i0 + 4 ], %g2 if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( olddelta ) { olddelta->tv_sec = 0; 400080f8: c0 26 40 00 clr [ %i1 ] olddelta->tv_usec = 0; } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); 400080fc: c2 06 00 00 ld [ %i0 ], %g1 adjustment += delta->tv_usec; /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) 40008100: 07 10 00 61 sethi %hi(0x40018400), %g3 40008104: c8 00 e3 4c ld [ %g3 + 0x34c ], %g4 ! 4001874c olddelta->tv_sec = 0; olddelta->tv_usec = 0; } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); 40008108: bb 28 60 08 sll %g1, 8, %i5 4000810c: 87 28 60 03 sll %g1, 3, %g3 40008110: 86 27 40 03 sub %i5, %g3, %g3 40008114: bb 28 e0 06 sll %g3, 6, %i5 40008118: 86 27 40 03 sub %i5, %g3, %g3 4000811c: 82 00 c0 01 add %g3, %g1, %g1 40008120: 83 28 60 06 sll %g1, 6, %g1 adjustment += delta->tv_usec; 40008124: 84 00 40 02 add %g1, %g2, %g2 /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) 40008128: 80 a0 80 04 cmp %g2, %g4 4000812c: 1a 80 00 05 bcc 40008140 40008130: 03 10 00 6a sethi %hi(0x4001a800), %g1 return 0; 40008134: 82 10 20 00 clr %g1 /* set the user's output */ if ( olddelta ) *olddelta = *delta; return 0; } 40008138: 81 c7 e0 08 ret 4000813c: 91 e8 00 01 restore %g0, %g1, %o0 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40008140: c4 00 63 e0 ld [ %g1 + 0x3e0 ], %g2 ++level; 40008144: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40008148: c4 20 63 e0 st %g2, [ %g1 + 0x3e0 ] ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 4000814c: 13 10 00 6a sethi %hi(0x4001a800), %o1 40008150: 90 07 bf f8 add %fp, -8, %o0 40008154: 40 00 07 1c call 40009dc4 <_TOD_Get_with_nanoseconds> 40008158: 92 12 63 28 or %o1, 0x328, %o1 4000815c: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40008160: 94 10 20 00 clr %o2 40008164: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40008168: 90 10 00 1c mov %i4, %o0 4000816c: 96 12 e2 00 or %o3, 0x200, %o3 40008170: 40 00 3a 42 call 40016a78 <__divdi3> 40008174: 92 10 00 1d mov %i5, %o1 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; 40008178: f6 06 00 00 ld [ %i0 ], %i3 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 4000817c: 94 10 20 00 clr %o2 40008180: b6 06 c0 09 add %i3, %o1, %i3 40008184: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40008188: 90 10 00 1c mov %i4, %o0 4000818c: 96 12 e2 00 or %o3, 0x200, %o3 40008190: 40 00 3b 25 call 40016e24 <__moddi3> 40008194: 92 10 00 1d mov %i5, %o1 ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 40008198: c2 06 20 04 ld [ %i0 + 4 ], %g1 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; 4000819c: 09 31 19 4d sethi %hi(0xc4653400), %g4 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 400081a0: 87 28 60 07 sll %g1, 7, %g3 400081a4: 85 28 60 02 sll %g1, 2, %g2 400081a8: 84 20 c0 02 sub %g3, %g2, %g2 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; 400081ac: 88 11 22 00 or %g4, 0x200, %g4 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 400081b0: 82 00 80 01 add %g2, %g1, %g1 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 400081b4: 07 0e e6 b2 sethi %hi(0x3b9ac800), %g3 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 400081b8: 83 28 60 03 sll %g1, 3, %g1 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 400081bc: 86 10 e1 ff or %g3, 0x1ff, %g3 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 400081c0: 92 02 40 01 add %o1, %g1, %o1 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 400081c4: 80 a2 40 03 cmp %o1, %g3 400081c8: 08 80 00 07 bleu 400081e4 400081cc: 84 06 e0 01 add %i3, 1, %g2 ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; 400081d0: 92 02 40 04 add %o1, %g4, %o1 ts.tv_sec++; 400081d4: b6 10 00 02 mov %g2, %i3 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 ) { 400081d8: 80 a2 40 03 cmp %o1, %g3 400081dc: 18 bf ff fd bgu 400081d0 <== NEVER TAKEN 400081e0: 84 00 a0 01 inc %g2 ts.tv_sec++; } /* if adjustment is too much negative */ while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) { ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; 400081e4: 3b 0e e6 b2 sethi %hi(0x3b9ac800), %i5 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) ) { 400081e8: 07 31 19 4d sethi %hi(0xc4653400), %g3 400081ec: 82 10 00 09 mov %o1, %g1 int _EXFUN(setitimer, (int __which, const struct itimerval *__value, struct itimerval *__ovalue)); #if defined(__rtems__) /* BSD function used by RTEMS code */ int _EXFUN(adjtime,(const struct timeval *, struct timeval *)); 400081f0: 84 06 ff ff add %i3, -1, %g2 ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; 400081f4: ba 17 62 00 or %i5, 0x200, %i5 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) ) { 400081f8: 86 10 e2 00 or %g3, 0x200, %g3 ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; 400081fc: 82 00 40 1d add %g1, %i5, %g1 ts.tv_sec--; 40008200: 88 10 00 02 mov %g2, %g4 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) ) { 40008204: 80 a0 40 03 cmp %g1, %g3 40008208: 08 bf ff fd bleu 400081fc 4000820c: 84 00 bf ff add %g2, -1, %g2 const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 40008210: 85 39 20 1f sra %g4, 0x1f, %g2 40008214: a6 10 00 01 mov %g1, %l3 40008218: a5 38 60 1f sra %g1, 0x1f, %l2 Timestamp64_Control *_time, Timestamp64_Control _seconds, Timestamp64_Control _nanoseconds ) { *_time = _seconds * 1000000000L + _nanoseconds; 4000821c: 83 28 a0 03 sll %g2, 3, %g1 40008220: 86 10 00 04 mov %g4, %g3 40008224: 89 31 20 1d srl %g4, 0x1d, %g4 40008228: bb 28 e0 03 sll %g3, 3, %i5 4000822c: b8 11 00 01 or %g4, %g1, %i4 40008230: 83 37 60 1b srl %i5, 0x1b, %g1 40008234: a9 2f 20 05 sll %i4, 5, %l4 40008238: ab 2f 60 05 sll %i5, 5, %l5 4000823c: a8 10 40 14 or %g1, %l4, %l4 40008240: ba a5 40 1d subcc %l5, %i5, %i5 40008244: 83 37 60 1a srl %i5, 0x1a, %g1 40008248: b8 65 00 1c subx %l4, %i4, %i4 4000824c: a3 2f 60 06 sll %i5, 6, %l1 40008250: a1 2f 20 06 sll %i4, 6, %l0 40008254: ba a4 40 1d subcc %l1, %i5, %i5 40008258: a0 10 40 10 or %g1, %l0, %l0 4000825c: b8 64 00 1c subx %l0, %i4, %i4 40008260: ae 87 40 03 addcc %i5, %g3, %l7 40008264: 83 35 e0 1e srl %l7, 0x1e, %g1 40008268: ac 47 00 02 addx %i4, %g2, %l6 4000826c: 97 2d e0 02 sll %l7, 2, %o3 40008270: 95 2d a0 02 sll %l6, 2, %o2 40008274: 86 85 c0 0b addcc %l7, %o3, %g3 40008278: 94 10 40 0a or %g1, %o2, %o2 4000827c: 9b 28 e0 02 sll %g3, 2, %o5 40008280: 84 45 80 0a addx %l6, %o2, %g2 40008284: 83 30 e0 1e srl %g3, 0x1e, %g1 40008288: ba 80 c0 0d addcc %g3, %o5, %i5 4000828c: 99 28 a0 02 sll %g2, 2, %o4 40008290: b7 2f 60 02 sll %i5, 2, %i3 40008294: 98 10 40 0c or %g1, %o4, %o4 40008298: 83 37 60 1e srl %i5, 0x1e, %g1 4000829c: b8 40 80 0c addx %g2, %o4, %i4 400082a0: 86 87 40 1b addcc %i5, %i3, %g3 400082a4: b5 2f 20 02 sll %i4, 2, %i2 400082a8: bb 30 e0 17 srl %g3, 0x17, %i5 400082ac: b4 10 40 1a or %g1, %i2, %i2 400082b0: 84 47 00 1a addx %i4, %i2, %g2 400082b4: 83 28 e0 09 sll %g3, 9, %g1 400082b8: 89 28 a0 09 sll %g2, 9, %g4 &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 400082bc: 90 07 bf f8 add %fp, -8, %o0 400082c0: 84 17 40 04 or %i5, %g4, %g2 400082c4: ba 84 c0 01 addcc %l3, %g1, %i5 400082c8: b8 44 80 02 addx %l2, %g2, %i4 400082cc: 40 00 06 d9 call 40009e30 <_TOD_Set_with_timestamp> 400082d0: f8 3f bf f8 std %i4, [ %fp + -8 ] ts.tv_sec--; } _TOD_Set( &ts ); _Thread_Enable_dispatch(); 400082d4: 40 00 0d 7e call 4000b8cc <_Thread_Enable_dispatch> 400082d8: 01 00 00 00 nop /* set the user's output */ if ( olddelta ) 400082dc: 80 a6 60 00 cmp %i1, 0 400082e0: 02 bf ff 95 be 40008134 400082e4: 82 10 20 00 clr %g1 *olddelta = *delta; 400082e8: c4 06 00 00 ld [ %i0 ], %g2 400082ec: c4 26 40 00 st %g2, [ %i1 ] 400082f0: c4 06 20 04 ld [ %i0 + 4 ], %g2 400082f4: c4 26 60 04 st %g2, [ %i1 + 4 ] return 0; } 400082f8: 81 c7 e0 08 ret 400082fc: 91 e8 00 01 restore %g0, %g1, %o0 */ 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 ); 40008300: 40 00 23 b0 call 400111c0 <__errno> 40008304: 01 00 00 00 nop 40008308: 84 10 20 16 mov 0x16, %g2 ! 16 4000830c: 82 10 3f ff mov -1, %g1 40008310: 10 bf ff 8a b 40008138 40008314: c4 22 00 00 st %g2, [ %o0 ] =============================================================================== 400082cc : #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { 400082cc: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 400082d0: 3b 10 00 68 sethi %hi(0x4001a000), %i5 400082d4: 40 00 04 85 call 400094e8 400082d8: 90 17 63 cc or %i5, 0x3cc, %o0 ! 4001a3cc if (fcntl (fildes, F_GETFD) < 0) { 400082dc: 90 10 00 18 mov %i0, %o0 400082e0: 40 00 1b af call 4000f19c 400082e4: 92 10 20 01 mov 1, %o1 400082e8: 80 a2 20 00 cmp %o0, 0 400082ec: 06 80 00 6c bl 4000849c 400082f0: 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) { 400082f4: 02 80 00 3b be 400083e0 400082f8: 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) { 400082fc: f8 06 40 00 ld [ %i1 ], %i4 40008300: 80 a7 00 18 cmp %i4, %i0 40008304: 12 80 00 2f bne 400083c0 40008308: 90 17 63 cc or %i5, 0x3cc, %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); 4000830c: 92 10 00 1c mov %i4, %o1 40008310: 11 10 00 69 sethi %hi(0x4001a400), %o0 40008314: 94 10 20 00 clr %o2 40008318: 40 00 01 92 call 40008960 4000831c: 90 12 20 14 or %o0, 0x14, %o0 if (r_chain == NULL) { 40008320: b6 92 20 00 orcc %o0, 0, %i3 40008324: 22 80 00 0f be,a 40008360 40008328: b6 17 63 cc or %i5, 0x3cc, %i3 return AIO_ALLDONE; } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 4000832c: b8 06 e0 1c add %i3, 0x1c, %i4 40008330: 40 00 04 6e call 400094e8 40008334: 90 10 00 1c mov %i4, %o0 result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 40008338: 92 10 00 19 mov %i1, %o1 4000833c: 40 00 01 d2 call 40008a84 40008340: 90 06 e0 08 add %i3, 8, %o0 40008344: b0 10 00 08 mov %o0, %i0 pthread_mutex_unlock (&r_chain->mutex); 40008348: 40 00 04 88 call 40009568 4000834c: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 40008350: 40 00 04 86 call 40009568 40008354: 90 17 63 cc or %i5, 0x3cc, %o0 return result; } return AIO_ALLDONE; } 40008358: 81 c7 e0 08 ret 4000835c: 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)) { 40008360: c4 06 e0 54 ld [ %i3 + 0x54 ], %g2 40008364: 82 06 e0 58 add %i3, 0x58, %g1 40008368: 80 a0 80 01 cmp %g2, %g1 4000836c: 02 80 00 0f be 400083a8 <== NEVER TAKEN 40008370: 90 06 e0 54 add %i3, 0x54, %o0 r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 40008374: 92 10 00 1c mov %i4, %o1 40008378: 40 00 01 7a call 40008960 4000837c: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40008380: 80 a2 20 00 cmp %o0, 0 40008384: 02 80 00 0e be 400083bc 40008388: 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); 4000838c: 40 00 01 be call 40008a84 40008390: 90 02 20 08 add %o0, 8, %o0 40008394: b0 10 00 08 mov %o0, %i0 pthread_mutex_unlock (&aio_request_queue.mutex); 40008398: 40 00 04 74 call 40009568 4000839c: 90 10 00 1b mov %i3, %o0 return result; 400083a0: 81 c7 e0 08 ret 400083a4: 81 e8 00 00 restore 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); return AIO_ALLDONE; 400083a8: b0 10 20 02 mov 2, %i0 <== NOT EXECUTED AIO_printf ("Request chain not on [WQ]\n"); 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); 400083ac: 40 00 04 6f call 40009568 400083b0: 90 17 63 cc or %i5, 0x3cc, %o0 return AIO_ALLDONE; 400083b4: 81 c7 e0 08 ret 400083b8: 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); 400083bc: 90 10 00 1b mov %i3, %o0 400083c0: 40 00 04 6a call 40009568 400083c4: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one (EINVAL); 400083c8: 40 00 29 9e call 40012a40 <__errno> 400083cc: 01 00 00 00 nop 400083d0: 82 10 20 16 mov 0x16, %g1 ! 16 400083d4: c2 22 00 00 st %g1, [ %o0 ] 400083d8: 81 c7 e0 08 ret 400083dc: 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); 400083e0: 11 10 00 69 sethi %hi(0x4001a400), %o0 400083e4: 94 10 20 00 clr %o2 400083e8: 40 00 01 5e call 40008960 400083ec: 90 12 20 14 or %o0, 0x14, %o0 if (r_chain == NULL) { 400083f0: b8 92 20 00 orcc %o0, 0, %i4 400083f4: 02 80 00 0f be 40008430 400083f8: b6 07 20 1c add %i4, 0x1c, %i3 return AIO_ALLDONE; } AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 400083fc: 40 00 04 3b call 400094e8 40008400: 90 10 00 1b mov %i3, %o0 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 40008404: 40 00 0b 28 call 4000b0a4 <_Chain_Extract> 40008408: 90 10 00 1c mov %i4, %o0 rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 4000840c: 40 00 01 8a call 40008a34 40008410: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&r_chain->mutex); 40008414: 40 00 04 55 call 40009568 40008418: 90 10 00 1b mov %i3, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); return AIO_CANCELED; 4000841c: b0 10 20 00 clr %i0 pthread_mutex_lock (&r_chain->mutex); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_unlock (&aio_request_queue.mutex); 40008420: 40 00 04 52 call 40009568 40008424: 90 17 63 cc or %i5, 0x3cc, %o0 return AIO_CANCELED; 40008428: 81 c7 e0 08 ret 4000842c: 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; 40008430: b8 17 63 cc or %i5, 0x3cc, %i4 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)) { 40008434: c4 07 20 54 ld [ %i4 + 0x54 ], %g2 40008438: 82 07 20 58 add %i4, 0x58, %g1 4000843c: 80 a0 80 01 cmp %g2, %g1 40008440: 02 bf ff da be 400083a8 <== NEVER TAKEN 40008444: 90 07 20 54 add %i4, 0x54, %o0 r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 40008448: 92 10 00 18 mov %i0, %o1 4000844c: 40 00 01 45 call 40008960 40008450: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40008454: b6 92 20 00 orcc %o0, 0, %i3 40008458: 22 bf ff d5 be,a 400083ac 4000845c: b0 10 20 02 mov 2, %i0 40008460: 40 00 0b 11 call 4000b0a4 <_Chain_Extract> 40008464: ba 06 e0 1c add %i3, 0x1c, %i5 } AIO_printf ("Request chain on [IQ]\n"); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 40008468: 40 00 01 73 call 40008a34 4000846c: 90 10 00 1b mov %i3, %o0 pthread_mutex_destroy (&r_chain->mutex); 40008470: 40 00 03 72 call 40009238 40008474: 90 10 00 1d mov %i5, %o0 pthread_cond_destroy (&r_chain->mutex); 40008478: 40 00 02 94 call 40008ec8 4000847c: 90 10 00 1d mov %i5, %o0 free (r_chain); 40008480: 7f ff f0 17 call 400044dc 40008484: 90 10 00 1b mov %i3, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); return AIO_CANCELED; 40008488: 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); 4000848c: 40 00 04 37 call 40009568 40008490: 90 10 00 1c mov %i4, %o0 return AIO_CANCELED; 40008494: 81 c7 e0 08 ret 40008498: 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); 4000849c: 40 00 04 33 call 40009568 400084a0: 90 17 63 cc or %i5, 0x3cc, %o0 rtems_set_errno_and_return_minus_one (EBADF); 400084a4: 40 00 29 67 call 40012a40 <__errno> 400084a8: b0 10 3f ff mov -1, %i0 400084ac: 82 10 20 09 mov 9, %g1 400084b0: c2 22 00 00 st %g1, [ %o0 ] 400084b4: 81 c7 e0 08 ret 400084b8: 81 e8 00 00 restore =============================================================================== 400084c4 : int aio_fsync( int op, struct aiocb *aiocbp ) { 400084c4: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; if (op != O_SYNC) 400084c8: 03 00 00 08 sethi %hi(0x2000), %g1 400084cc: 80 a6 00 01 cmp %i0, %g1 400084d0: 12 80 00 14 bne 40008520 400084d4: ba 10 20 16 mov 0x16, %i5 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); 400084d8: d0 06 40 00 ld [ %i1 ], %o0 400084dc: 40 00 1b 30 call 4000f19c 400084e0: 92 10 20 03 mov 3, %o1 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 400084e4: 90 0a 20 03 and %o0, 3, %o0 400084e8: 90 02 3f ff add %o0, -1, %o0 400084ec: 80 a2 20 01 cmp %o0, 1 400084f0: 18 80 00 0c bgu 40008520 400084f4: ba 10 20 09 mov 9, %i5 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); 400084f8: 7f ff f1 20 call 40004978 400084fc: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 40008500: 80 a2 20 00 cmp %o0, 0 40008504: 02 80 00 06 be 4000851c <== NEVER TAKEN 40008508: 82 10 20 03 mov 3, %g1 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 4000850c: f2 22 20 14 st %i1, [ %o0 + 0x14 ] req->aiocbp->aio_lio_opcode = LIO_SYNC; 40008510: c2 26 60 30 st %g1, [ %i1 + 0x30 ] return rtems_aio_enqueue (req); 40008514: 40 00 01 78 call 40008af4 40008518: 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); 4000851c: ba 10 20 0b mov 0xb, %i5 <== NOT EXECUTED 40008520: 82 10 3f ff mov -1, %g1 40008524: fa 26 60 34 st %i5, [ %i1 + 0x34 ] 40008528: c2 26 60 38 st %g1, [ %i1 + 0x38 ] 4000852c: 40 00 29 45 call 40012a40 <__errno> 40008530: b0 10 3f ff mov -1, %i0 40008534: fa 22 00 00 st %i5, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); } 40008538: 81 c7 e0 08 ret 4000853c: 81 e8 00 00 restore =============================================================================== 40008cd8 : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 40008cd8: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 40008cdc: d0 06 00 00 ld [ %i0 ], %o0 40008ce0: 92 10 20 03 mov 3, %o1 40008ce4: 40 00 19 2e call 4000f19c 40008ce8: ba 10 20 09 mov 9, %i5 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 40008cec: 80 8a 20 01 btst 1, %o0 40008cf0: 12 80 00 0b bne 40008d1c 40008cf4: 82 10 3f ff mov -1, %g1 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 40008cf8: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 40008cfc: 80 a0 60 00 cmp %g1, 0 40008d00: 12 80 00 06 bne 40008d18 40008d04: ba 10 20 16 mov 0x16, %i5 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 40008d08: c2 06 20 08 ld [ %i0 + 8 ], %g1 40008d0c: 80 a0 60 00 cmp %g1, 0 40008d10: 16 80 00 0a bge 40008d38 40008d14: 01 00 00 00 nop 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); 40008d18: 82 10 3f ff mov -1, %g1 ! ffffffff 40008d1c: fa 26 20 34 st %i5, [ %i0 + 0x34 ] 40008d20: c2 26 20 38 st %g1, [ %i0 + 0x38 ] 40008d24: 40 00 27 47 call 40012a40 <__errno> 40008d28: b0 10 3f ff mov -1, %i0 40008d2c: fa 22 00 00 st %i5, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); } 40008d30: 81 c7 e0 08 ret 40008d34: 81 e8 00 00 restore rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 40008d38: 7f ff ef 10 call 40004978 40008d3c: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 40008d40: 80 a2 20 00 cmp %o0, 0 40008d44: 02 80 00 06 be 40008d5c <== NEVER TAKEN 40008d48: 82 10 20 01 mov 1, %g1 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 40008d4c: f0 22 20 14 st %i0, [ %o0 + 0x14 ] req->aiocbp->aio_lio_opcode = LIO_READ; 40008d50: c2 26 20 30 st %g1, [ %i0 + 0x30 ] return rtems_aio_enqueue (req); 40008d54: 7f ff ff 68 call 40008af4 40008d58: 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); 40008d5c: 10 bf ff ef b 40008d18 <== NOT EXECUTED 40008d60: ba 10 20 0b mov 0xb, %i5 <== NOT EXECUTED =============================================================================== 40008d6c : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 40008d6c: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 40008d70: d0 06 00 00 ld [ %i0 ], %o0 40008d74: 40 00 19 0a call 4000f19c 40008d78: 92 10 20 03 mov 3, %o1 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 40008d7c: 90 0a 20 03 and %o0, 3, %o0 40008d80: 90 02 3f ff add %o0, -1, %o0 40008d84: 80 a2 20 01 cmp %o0, 1 40008d88: 18 80 00 0a bgu 40008db0 40008d8c: 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) 40008d90: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 40008d94: 80 a0 60 00 cmp %g1, 0 40008d98: 12 80 00 06 bne 40008db0 40008d9c: ba 10 20 16 mov 0x16, %i5 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 40008da0: c2 06 20 08 ld [ %i0 + 8 ], %g1 40008da4: 80 a0 60 00 cmp %g1, 0 40008da8: 16 80 00 0a bge 40008dd0 40008dac: 01 00 00 00 nop 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); 40008db0: 82 10 3f ff mov -1, %g1 ! ffffffff 40008db4: fa 26 20 34 st %i5, [ %i0 + 0x34 ] 40008db8: c2 26 20 38 st %g1, [ %i0 + 0x38 ] 40008dbc: 40 00 27 21 call 40012a40 <__errno> 40008dc0: b0 10 3f ff mov -1, %i0 40008dc4: fa 22 00 00 st %i5, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); } 40008dc8: 81 c7 e0 08 ret 40008dcc: 81 e8 00 00 restore rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 40008dd0: 7f ff ee ea call 40004978 40008dd4: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 40008dd8: 80 a2 20 00 cmp %o0, 0 40008ddc: 02 80 00 06 be 40008df4 <== NEVER TAKEN 40008de0: 82 10 20 02 mov 2, %g1 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 40008de4: f0 22 20 14 st %i0, [ %o0 + 0x14 ] req->aiocbp->aio_lio_opcode = LIO_WRITE; 40008de8: c2 26 20 30 st %g1, [ %i0 + 0x30 ] return rtems_aio_enqueue (req); 40008dec: 7f ff ff 42 call 40008af4 40008df0: 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); 40008df4: 10 bf ff ef b 40008db0 <== NOT EXECUTED 40008df8: ba 10 20 0b mov 0xb, %i5 <== NOT EXECUTED =============================================================================== 4000932c : rtems_rbtree_control *chunk_tree, rtems_rbheap_chunk *a, rtems_rbheap_chunk *b ) { if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) { 4000932c: 80 a2 ff f8 cmp %o3, -8 40009330: 02 80 00 23 be 400093bc 40009334: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 40009338: c2 02 c0 00 ld [ %o3 ], %g1 4000933c: 80 a0 60 00 cmp %g1, 0 40009340: 22 80 00 1c be,a 400093b0 40009344: c4 02 e0 04 ld [ %o3 + 4 ], %g2 if (b->begin < a->begin) { 40009348: c6 02 e0 18 ld [ %o3 + 0x18 ], %g3 4000934c: c4 02 a0 18 ld [ %o2 + 0x18 ], %g2 40009350: 80 a0 c0 02 cmp %g3, %g2 40009354: 3a 80 00 07 bcc,a 40009370 40009358: c8 02 a0 1c ld [ %o2 + 0x1c ], %g4 4000935c: 84 10 00 0a mov %o2, %g2 40009360: c2 02 80 00 ld [ %o2 ], %g1 40009364: 94 10 00 0b mov %o3, %o2 40009368: 96 10 00 02 mov %g2, %o3 a = b; b = t; } a->size += b->size; 4000936c: c8 02 a0 1c ld [ %o2 + 0x1c ], %g4 40009370: c6 02 e0 1c ld [ %o3 + 0x1c ], %g3 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 40009374: c4 02 e0 04 ld [ %o3 + 4 ], %g2 40009378: 86 01 00 03 add %g4, %g3, %g3 4000937c: c6 22 a0 1c st %g3, [ %o2 + 0x1c ] next->previous = previous; previous->next = next; 40009380: c2 20 80 00 st %g1, [ %g2 ] Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 40009384: c4 20 60 04 st %g2, [ %g1 + 4 ] ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 40009388: c2 02 00 00 ld [ %o0 ], %g1 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 4000938c: d0 22 e0 04 st %o0, [ %o3 + 4 ] before_node = after_node->next; after_node->next = the_node; 40009390: d6 22 00 00 st %o3, [ %o0 ] the_node->next = before_node; 40009394: c2 22 c0 00 st %g1, [ %o3 ] rtems_chain_extract_unprotected(&b->chain_node); add_to_chain(free_chain, b); _RBTree_Extract_unprotected(chunk_tree, &b->tree_node); 40009398: 90 10 00 09 mov %o1, %o0 before_node->previous = the_node; 4000939c: d6 20 60 04 st %o3, [ %g1 + 4 ] 400093a0: 92 02 e0 08 add %o3, 8, %o1 400093a4: 82 13 c0 00 mov %o7, %g1 400093a8: 40 00 07 13 call 4000aff4 <_RBTree_Extract_unprotected> 400093ac: 9e 10 40 00 mov %g1, %o7 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 400093b0: 80 a0 a0 00 cmp %g2, 0 400093b4: 32 bf ff e6 bne,a 4000934c <== NEVER TAKEN 400093b8: c6 02 e0 18 ld [ %o3 + 0x18 ], %g3 <== NOT EXECUTED 400093bc: 81 c3 e0 08 retl =============================================================================== 40007f2c : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 40007f2c: 9d e3 bf 98 save %sp, -104, %sp if ( !tp ) 40007f30: 80 a6 60 00 cmp %i1, 0 40007f34: 02 80 00 0a be 40007f5c 40007f38: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 40007f3c: 02 80 00 19 be 40007fa0 40007f40: 80 a6 20 04 cmp %i0, 4 _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 40007f44: 02 80 00 12 be 40007f8c <== NEVER TAKEN 40007f48: 80 a6 20 02 cmp %i0, 2 return 0; } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) { 40007f4c: 02 80 00 10 be 40007f8c 40007f50: 80 a6 20 03 cmp %i0, 3 return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 40007f54: 02 80 00 08 be 40007f74 40007f58: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); #endif rtems_set_errno_and_return_minus_one( EINVAL ); 40007f5c: 40 00 25 fa call 40011744 <__errno> 40007f60: b0 10 3f ff mov -1, %i0 ! ffffffff 40007f64: 82 10 20 16 mov 0x16, %g1 40007f68: c2 22 00 00 st %g1, [ %o0 ] return 0; } 40007f6c: 81 c7 e0 08 ret 40007f70: 81 e8 00 00 restore } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) rtems_set_errno_and_return_minus_one( ENOSYS ); 40007f74: 40 00 25 f4 call 40011744 <__errno> 40007f78: b0 10 3f ff mov -1, %i0 40007f7c: 82 10 20 58 mov 0x58, %g1 40007f80: c2 22 00 00 st %g1, [ %o0 ] 40007f84: 81 c7 e0 08 ret 40007f88: 81 e8 00 00 restore _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { _TOD_Get_uptime_as_timespec( tp ); 40007f8c: 90 10 00 19 mov %i1, %o0 40007f90: 40 00 08 a4 call 4000a220 <_TOD_Get_uptime_as_timespec> 40007f94: b0 10 20 00 clr %i0 return 0; 40007f98: 81 c7 e0 08 ret 40007f9c: 81 e8 00 00 restore ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 40007fa0: 90 07 bf f8 add %fp, -8, %o0 40007fa4: 13 10 00 6d sethi %hi(0x4001b400), %o1 40007fa8: 40 00 08 8d call 4000a1dc <_TOD_Get_with_nanoseconds> 40007fac: 92 12 63 38 or %o1, 0x338, %o1 ! 4001b738 <_TOD> #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 40007fb0: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40007fb4: 94 10 20 00 clr %o2 40007fb8: 90 10 00 1c mov %i4, %o0 40007fbc: 92 10 00 1d mov %i5, %o1 40007fc0: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40007fc4: 40 00 3e 50 call 40017904 <__divdi3> 40007fc8: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40007fcc: 94 10 20 00 clr %o2 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40007fd0: d2 26 40 00 st %o1, [ %i1 ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40007fd4: 90 10 00 1c mov %i4, %o0 40007fd8: 92 10 00 1d mov %i5, %o1 40007fdc: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 if ( !tp ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { _TOD_Get(tp); return 0; 40007fe0: b0 10 20 00 clr %i0 40007fe4: 40 00 3f 33 call 40017cb0 <__moddi3> 40007fe8: 96 12 e2 00 or %o3, 0x200, %o3 40007fec: d2 26 60 04 st %o1, [ %i1 + 4 ] 40007ff0: 81 c7 e0 08 ret 40007ff4: 81 e8 00 00 restore =============================================================================== 40029a84 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 40029a84: 9d e3 bf 98 save %sp, -104, %sp if ( !tp ) 40029a88: 80 a6 60 00 cmp %i1, 0 40029a8c: 02 80 00 08 be 40029aac <== NEVER TAKEN 40029a90: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 40029a94: 02 80 00 0c be 40029ac4 40029a98: 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_ID ) 40029a9c: 02 80 00 49 be 40029bc0 40029aa0: 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_ID ) 40029aa4: 02 80 00 47 be 40029bc0 40029aa8: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 40029aac: 40 00 4b 2f call 4003c768 <__errno> 40029ab0: b0 10 3f ff mov -1, %i0 ! ffffffff 40029ab4: 82 10 20 16 mov 0x16, %g1 40029ab8: c2 22 00 00 st %g1, [ %o0 ] return 0; } 40029abc: 81 c7 e0 08 ret 40029ac0: 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 ) 40029ac4: c4 06 40 00 ld [ %i1 ], %g2 40029ac8: 03 08 76 b9 sethi %hi(0x21dae400), %g1 40029acc: 82 10 60 ff or %g1, 0xff, %g1 ! 21dae4ff 40029ad0: 80 a0 80 01 cmp %g2, %g1 40029ad4: 08 bf ff f6 bleu 40029aac 40029ad8: 03 10 01 a6 sethi %hi(0x40069800), %g1 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40029adc: c4 00 60 90 ld [ %g1 + 0x90 ], %g2 ! 40069890 <_Thread_Dispatch_disable_level> ++level; 40029ae0: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40029ae4: c4 20 60 90 st %g2, [ %g1 + 0x90 ] const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 40029ae8: c6 06 40 00 ld [ %i1 ], %g3 40029aec: e2 06 60 04 ld [ %i1 + 4 ], %l1 40029af0: 85 38 e0 1f sra %g3, 0x1f, %g2 Timestamp64_Control *_time, Timestamp64_Control _seconds, Timestamp64_Control _nanoseconds ) { *_time = _seconds * 1000000000L + _nanoseconds; 40029af4: 83 28 a0 03 sll %g2, 3, %g1 40029af8: bb 28 e0 03 sll %g3, 3, %i5 40029afc: 89 30 e0 1d srl %g3, 0x1d, %g4 40029b00: b8 11 00 01 or %g4, %g1, %i4 40029b04: 83 37 60 1b srl %i5, 0x1b, %g1 40029b08: a5 2f 20 05 sll %i4, 5, %l2 40029b0c: a7 2f 60 05 sll %i5, 5, %l3 40029b10: a4 10 40 12 or %g1, %l2, %l2 40029b14: ba a4 c0 1d subcc %l3, %i5, %i5 40029b18: 83 37 60 1a srl %i5, 0x1a, %g1 40029b1c: b8 64 80 1c subx %l2, %i4, %i4 40029b20: 97 2f 60 06 sll %i5, 6, %o3 40029b24: 95 2f 20 06 sll %i4, 6, %o2 40029b28: ba a2 c0 1d subcc %o3, %i5, %i5 40029b2c: 94 10 40 0a or %g1, %o2, %o2 40029b30: b8 62 80 1c subx %o2, %i4, %i4 40029b34: aa 87 40 03 addcc %i5, %g3, %l5 40029b38: 83 35 60 1e srl %l5, 0x1e, %g1 40029b3c: a8 47 00 02 addx %i4, %g2, %l4 40029b40: 9b 2d 60 02 sll %l5, 2, %o5 40029b44: 99 2d 20 02 sll %l4, 2, %o4 40029b48: 86 85 40 0d addcc %l5, %o5, %g3 40029b4c: 98 10 40 0c or %g1, %o4, %o4 40029b50: b3 28 e0 02 sll %g3, 2, %i1 40029b54: 84 45 00 0c addx %l4, %o4, %g2 40029b58: 83 30 e0 1e srl %g3, 0x1e, %g1 40029b5c: ba 80 c0 19 addcc %g3, %i1, %i5 40029b60: b1 28 a0 02 sll %g2, 2, %i0 40029b64: b7 2f 60 02 sll %i5, 2, %i3 40029b68: b0 10 40 18 or %g1, %i0, %i0 40029b6c: 83 37 60 1e srl %i5, 0x1e, %g1 40029b70: b8 40 80 18 addx %g2, %i0, %i4 40029b74: 86 87 40 1b addcc %i5, %i3, %g3 40029b78: b5 2f 20 02 sll %i4, 2, %i2 40029b7c: bb 30 e0 17 srl %g3, 0x17, %i5 40029b80: b4 10 40 1a or %g1, %i2, %i2 40029b84: 84 47 00 1a addx %i4, %i2, %g2 40029b88: 83 28 e0 09 sll %g3, 9, %g1 40029b8c: 89 28 a0 09 sll %g2, 9, %g4 &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 40029b90: 90 07 bf f8 add %fp, -8, %o0 40029b94: 84 17 40 04 or %i5, %g4, %g2 40029b98: ba 84 40 01 addcc %l1, %g1, %i5 const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 40029b9c: a1 3c 60 1f sra %l1, 0x1f, %l0 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 40029ba0: b0 10 20 00 clr %i0 40029ba4: b8 44 00 02 addx %l0, %g2, %i4 &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 40029ba8: 40 00 04 92 call 4002adf0 <_TOD_Set_with_timestamp> 40029bac: f8 3f bf f8 std %i4, [ %fp + -8 ] if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); 40029bb0: 7f ff 83 a7 call 4000aa4c <_Thread_Enable_dispatch> 40029bb4: 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; 40029bb8: 81 c7 e0 08 ret 40029bbc: 81 e8 00 00 restore else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) rtems_set_errno_and_return_minus_one( ENOSYS ); 40029bc0: 40 00 4a ea call 4003c768 <__errno> 40029bc4: b0 10 3f ff mov -1, %i0 40029bc8: 82 10 20 58 mov 0x58, %g1 40029bcc: c2 22 00 00 st %g1, [ %o0 ] 40029bd0: 81 c7 e0 08 ret 40029bd4: 81 e8 00 00 restore =============================================================================== 4001cbb8 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 4001cbb8: 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() ) 4001cbbc: 7f ff ff 10 call 4001c7fc 4001cbc0: 01 00 00 00 nop 4001cbc4: 80 a2 00 18 cmp %o0, %i0 4001cbc8: 12 80 00 af bne 4001ce84 4001cbcc: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); /* * Validate the signal passed. */ if ( !sig ) 4001cbd0: 02 80 00 b3 be 4001ce9c 4001cbd4: 82 06 7f ff add %i1, -1, %g1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 4001cbd8: 80 a0 60 1f cmp %g1, 0x1f 4001cbdc: 18 80 00 b0 bgu 4001ce9c 4001cbe0: a1 2e 60 02 sll %i1, 2, %l0 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 ) 4001cbe4: 31 10 00 82 sethi %hi(0x40020800), %i0 4001cbe8: a3 2e 60 04 sll %i1, 4, %l1 4001cbec: b0 16 20 20 or %i0, 0x20, %i0 4001cbf0: 84 24 40 10 sub %l1, %l0, %g2 4001cbf4: 84 06 00 02 add %i0, %g2, %g2 4001cbf8: c4 00 a0 08 ld [ %g2 + 8 ], %g2 4001cbfc: 80 a0 a0 01 cmp %g2, 1 4001cc00: 02 80 00 9f be 4001ce7c 4001cc04: 80 a6 60 04 cmp %i1, 4 /* * 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 ) ) 4001cc08: 02 80 00 41 be 4001cd0c 4001cc0c: 80 a6 60 08 cmp %i1, 8 4001cc10: 02 80 00 3f be 4001cd0c 4001cc14: 80 a6 60 0b cmp %i1, 0xb 4001cc18: 02 80 00 3d be 4001cd0c 4001cc1c: ba 10 20 01 mov 1, %i5 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 4001cc20: f2 27 bf f4 st %i1, [ %fp + -12 ] siginfo->si_code = SI_USER; 4001cc24: fa 27 bf f8 st %i5, [ %fp + -8 ] if ( !value ) { 4001cc28: 80 a6 a0 00 cmp %i2, 0 4001cc2c: 02 80 00 3e be 4001cd24 4001cc30: bb 2f 40 01 sll %i5, %g1, %i5 siginfo->si_value.sival_int = 0; } else { siginfo->si_value = *value; 4001cc34: c2 06 80 00 ld [ %i2 ], %g1 4001cc38: 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) { uint32_t level = _Thread_Dispatch_disable_level; 4001cc3c: 03 10 00 80 sethi %hi(0x40020000), %g1 4001cc40: c4 00 62 b0 ld [ %g1 + 0x2b0 ], %g2 ! 400202b0 <_Thread_Dispatch_disable_level> ++level; 4001cc44: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 4001cc48: c4 20 62 b0 st %g2, [ %g1 + 0x2b0 ] */ void _POSIX_signals_Manager_Initialization(void); static inline void _POSIX_signals_Add_post_switch_extension(void) { _API_extensions_Add_post_switch( &_POSIX_signals_Post_switch ); 4001cc4c: 11 10 00 7d sethi %hi(0x4001f400), %o0 4001cc50: 7f ff b0 ca call 40008f78 <_API_extensions_Add_post_switch> 4001cc54: 90 12 22 ac or %o0, 0x2ac, %o0 ! 4001f6ac <_POSIX_signals_Post_switch> /* * 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; 4001cc58: 03 10 00 81 sethi %hi(0x40020400), %g1 4001cc5c: d0 00 63 d0 ld [ %g1 + 0x3d0 ], %o0 ! 400207d0 <_Per_CPU_Information+0x10> api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 4001cc60: c2 02 21 50 ld [ %o0 + 0x150 ], %g1 4001cc64: c2 00 60 d0 ld [ %g1 + 0xd0 ], %g1 4001cc68: 80 af 40 01 andncc %i5, %g1, %g0 4001cc6c: 12 80 00 17 bne 4001ccc8 4001cc70: 09 10 00 82 sethi %hi(0x40020800), %g4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4001cc74: c2 01 21 ac ld [ %g4 + 0x1ac ], %g1 ! 400209ac <_POSIX_signals_Wait_queue> 4001cc78: 88 11 21 ac or %g4, 0x1ac, %g4 /* 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 ); 4001cc7c: 88 01 20 04 add %g4, 4, %g4 4001cc80: 80 a0 40 04 cmp %g1, %g4 4001cc84: 32 80 00 0d bne,a 4001ccb8 4001cc88: c4 00 60 30 ld [ %g1 + 0x30 ], %g2 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4001cc8c: 10 80 00 28 b 4001cd2c 4001cc90: 03 10 00 7d sethi %hi(0x4001f400), %g1 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 4001cc94: c4 00 e0 d0 ld [ %g3 + 0xd0 ], %g2 4001cc98: 80 af 40 02 andncc %i5, %g2, %g0 4001cc9c: 12 80 00 0b bne 4001ccc8 4001cca0: 90 10 00 01 mov %g1, %o0 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 ) { 4001cca4: c2 00 40 00 ld [ %g1 ], %g1 /* 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 ); 4001cca8: 80 a0 40 04 cmp %g1, %g4 4001ccac: 22 80 00 20 be,a 4001cd2c <== ALWAYS TAKEN 4001ccb0: 03 10 00 7d sethi %hi(0x4001f400), %g1 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4001ccb4: c4 00 60 30 ld [ %g1 + 0x30 ], %g2 ! 4001f430 <__clz_tab+0xc8><== NOT EXECUTED 4001ccb8: 80 8f 40 02 btst %i5, %g2 4001ccbc: 02 bf ff f6 be 4001cc94 4001ccc0: c6 00 61 50 ld [ %g1 + 0x150 ], %g3 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 ) { 4001ccc4: 90 10 00 01 mov %g1, %o0 /* * 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 ) ) { 4001ccc8: 92 10 00 19 mov %i1, %o1 4001cccc: 40 00 00 8b call 4001cef8 <_POSIX_signals_Unblock_thread> 4001ccd0: 94 07 bf f4 add %fp, -12, %o2 4001ccd4: 80 8a 20 ff btst 0xff, %o0 4001ccd8: 12 80 00 09 bne 4001ccfc 4001ccdc: 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 ); 4001cce0: 40 00 00 7d call 4001ced4 <_POSIX_signals_Set_process_signals> 4001cce4: 90 10 00 1d mov %i5, %o0 if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 4001cce8: a0 24 40 10 sub %l1, %l0, %l0 4001ccec: c2 06 00 10 ld [ %i0 + %l0 ], %g1 4001ccf0: 80 a0 60 02 cmp %g1, 2 4001ccf4: 02 80 00 4f be 4001ce30 4001ccf8: 11 10 00 82 sethi %hi(0x40020800), %o0 /* * 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 ) ) { _Thread_Enable_dispatch(); 4001ccfc: 7f ff b8 f3 call 4000b0c8 <_Thread_Enable_dispatch> 4001cd00: b0 10 20 00 clr %i0 4001cd04: 81 c7 e0 08 ret 4001cd08: 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 ); 4001cd0c: 40 00 01 13 call 4001d158 4001cd10: 01 00 00 00 nop 4001cd14: 40 00 00 d2 call 4001d05c 4001cd18: 92 10 00 19 mov %i1, %o1 4001cd1c: 81 c7 e0 08 ret 4001cd20: 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; 4001cd24: 10 bf ff c6 b 4001cc3c 4001cd28: c0 27 bf fc clr [ %fp + -4 ] * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4001cd2c: f8 08 60 dc ldub [ %g1 + 0xdc ], %i4 4001cd30: 1b 10 00 80 sethi %hi(0x40020000), %o5 4001cd34: b8 07 20 01 inc %i4 4001cd38: 9a 13 62 1c or %o5, 0x21c, %o5 * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 4001cd3c: 90 10 20 00 clr %o0 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 4001cd40: 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); 4001cd44: 17 04 00 00 sethi %hi(0x10000000), %o3 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 ] ) 4001cd48: c2 03 40 00 ld [ %o5 ], %g1 4001cd4c: 80 a0 60 00 cmp %g1, 0 4001cd50: 22 80 00 31 be,a 4001ce14 <== NEVER TAKEN 4001cd54: 9a 03 60 04 add %o5, 4, %o5 <== NOT EXECUTED continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 4001cd58: c2 00 60 04 ld [ %g1 + 4 ], %g1 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 4001cd5c: f6 10 60 10 lduh [ %g1 + 0x10 ], %i3 object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4001cd60: 80 a6 e0 00 cmp %i3, 0 4001cd64: 02 80 00 2b be 4001ce10 4001cd68: f4 00 60 1c ld [ %g1 + 0x1c ], %i2 4001cd6c: 84 10 20 01 mov 1, %g2 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 4001cd70: 87 28 a0 02 sll %g2, 2, %g3 maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { the_thread = (Thread_Control *) object_table[ index ]; 4001cd74: c6 06 80 03 ld [ %i2 + %g3 ], %g3 if ( !the_thread ) 4001cd78: 80 a0 e0 00 cmp %g3, 0 4001cd7c: 22 80 00 22 be,a 4001ce04 4001cd80: 84 00 a0 01 inc %g2 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 4001cd84: c8 00 e0 14 ld [ %g3 + 0x14 ], %g4 4001cd88: 80 a1 00 1c cmp %g4, %i4 4001cd8c: 38 80 00 1e bgu,a 4001ce04 4001cd90: 84 00 a0 01 inc %g2 #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 4001cd94: de 00 e1 50 ld [ %g3 + 0x150 ], %o7 4001cd98: de 03 e0 d0 ld [ %o7 + 0xd0 ], %o7 4001cd9c: 80 af 40 0f andncc %i5, %o7, %g0 4001cda0: 22 80 00 19 be,a 4001ce04 4001cda4: 84 00 a0 01 inc %g2 * * 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 ) { 4001cda8: 80 a1 00 1c cmp %g4, %i4 4001cdac: 2a 80 00 14 bcs,a 4001cdfc 4001cdb0: b8 10 00 04 mov %g4, %i4 * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( interested && !_States_Is_ready( interested->current_state ) ) { 4001cdb4: 80 a2 20 00 cmp %o0, 0 4001cdb8: 22 80 00 13 be,a 4001ce04 <== NEVER TAKEN 4001cdbc: 84 00 a0 01 inc %g2 <== NOT EXECUTED 4001cdc0: c2 02 20 10 ld [ %o0 + 0x10 ], %g1 4001cdc4: 80 a0 60 00 cmp %g1, 0 4001cdc8: 22 80 00 0f be,a 4001ce04 <== NEVER TAKEN 4001cdcc: 84 00 a0 01 inc %g2 <== NOT EXECUTED /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 4001cdd0: de 00 e0 10 ld [ %g3 + 0x10 ], %o7 4001cdd4: 80 a3 e0 00 cmp %o7, 0 4001cdd8: 22 80 00 09 be,a 4001cdfc 4001cddc: b8 10 00 04 mov %g4, %i4 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 4001cde0: 80 88 40 0b btst %g1, %o3 4001cde4: 32 80 00 08 bne,a 4001ce04 4001cde8: 84 00 a0 01 inc %g2 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 4001cdec: 80 8b c0 0b btst %o7, %o3 4001cdf0: 22 80 00 05 be,a 4001ce04 4001cdf4: 84 00 a0 01 inc %g2 */ if ( interested && !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 4001cdf8: b8 10 00 04 mov %g4, %i4 4001cdfc: 90 10 00 03 mov %g3, %o0 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4001ce00: 84 00 a0 01 inc %g2 4001ce04: 80 a6 c0 02 cmp %i3, %g2 4001ce08: 1a bf ff db bcc 4001cd74 4001ce0c: 87 28 a0 02 sll %g2, 2, %g3 4001ce10: 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++) { 4001ce14: 80 a3 40 0c cmp %o5, %o4 4001ce18: 32 bf ff cd bne,a 4001cd4c 4001ce1c: c2 03 40 00 ld [ %o5 ], %g1 } } } } if ( interested ) { 4001ce20: 80 a2 20 00 cmp %o0, 0 4001ce24: 12 bf ff aa bne 4001cccc 4001ce28: 92 10 00 19 mov %i1, %o1 4001ce2c: 30 bf ff ad b,a 4001cce0 */ _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) 4001ce30: 7f ff b0 b7 call 4000910c <_Chain_Get> 4001ce34: 90 12 21 a0 or %o0, 0x1a0, %o0 _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 4001ce38: 92 92 20 00 orcc %o0, 0, %o1 4001ce3c: 02 80 00 1e be 4001ceb4 4001ce40: 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 ); 4001ce44: 11 10 00 82 sethi %hi(0x40020800), %o0 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 4001ce48: c2 22 60 08 st %g1, [ %o1 + 8 ] 4001ce4c: c2 07 bf f8 ld [ %fp + -8 ], %g1 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4001ce50: 90 12 22 18 or %o0, 0x218, %o0 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 4001ce54: c2 22 60 0c st %g1, [ %o1 + 0xc ] 4001ce58: c2 07 bf fc ld [ %fp + -4 ], %g1 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4001ce5c: 90 02 00 10 add %o0, %l0, %o0 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 4001ce60: c2 22 60 10 st %g1, [ %o1 + 0x10 ] _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4001ce64: 7f ff b0 9f call 400090e0 <_Chain_Append> 4001ce68: b0 10 20 00 clr %i0 /* * 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 ) ) { _Thread_Enable_dispatch(); 4001ce6c: 7f ff b8 97 call 4000b0c8 <_Thread_Enable_dispatch> 4001ce70: 01 00 00 00 nop 4001ce74: 81 c7 e0 08 ret 4001ce78: 81 e8 00 00 restore } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4001ce7c: 81 c7 e0 08 ret 4001ce80: 91 e8 20 00 restore %g0, 0, %o0 /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) rtems_set_errno_and_return_minus_one( ESRCH ); 4001ce84: 7f ff ce af call 40010940 <__errno> 4001ce88: b0 10 3f ff mov -1, %i0 4001ce8c: 82 10 20 03 mov 3, %g1 4001ce90: c2 22 00 00 st %g1, [ %o0 ] 4001ce94: 81 c7 e0 08 ret 4001ce98: 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 ); 4001ce9c: 7f ff ce a9 call 40010940 <__errno> 4001cea0: b0 10 3f ff mov -1, %i0 4001cea4: 82 10 20 16 mov 0x16, %g1 4001cea8: c2 22 00 00 st %g1, [ %o0 ] 4001ceac: 81 c7 e0 08 ret 4001ceb0: 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(); 4001ceb4: 7f ff b8 85 call 4000b0c8 <_Thread_Enable_dispatch> 4001ceb8: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one( EAGAIN ); 4001cebc: 7f ff ce a1 call 40010940 <__errno> 4001cec0: 01 00 00 00 nop 4001cec4: 82 10 20 0b mov 0xb, %g1 ! b 4001cec8: c2 22 00 00 st %g1, [ %o0 ] 4001cecc: 81 c7 e0 08 ret 4001ced0: 81 e8 00 00 restore =============================================================================== 40008778 : int oflag, ... /* mode_t mode, */ /* struct mq_attr attr */ ) { 40008778: 9d e3 bf 88 save %sp, -120, %sp * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4000877c: 03 10 00 93 sethi %hi(0x40024c00), %g1 40008780: c4 00 60 b0 ld [ %g1 + 0xb0 ], %g2 ! 40024cb0 <_Thread_Dispatch_disable_level> size_t name_len; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); 40008784: f4 27 a0 4c st %i2, [ %fp + 0x4c ] ++level; 40008788: 84 00 a0 01 inc %g2 4000878c: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 40008790: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 40008794: fa 27 a0 58 st %i5, [ %fp + 0x58 ] _Thread_Dispatch_disable_level = level; 40008798: c4 20 60 b0 st %g2, [ %g1 + 0xb0 ] Objects_Locations location; size_t name_len; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 4000879c: a2 8e 62 00 andcc %i1, 0x200, %l1 400087a0: 12 80 00 36 bne 40008878 400087a4: a0 10 20 00 clr %l0 */ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd * _POSIX_Message_queue_Allocate_fd( void ) { return (POSIX_Message_queue_Control_fd *) 400087a8: 39 10 00 94 sethi %hi(0x40025000), %i4 400087ac: 40 00 0c 21 call 4000b830 <_Objects_Allocate> 400087b0: 90 17 21 80 or %i4, 0x180, %o0 ! 40025180 <_POSIX_Message_queue_Information_fds> attr = va_arg( arg, struct mq_attr * ); va_end(arg); } the_mq_fd = _POSIX_Message_queue_Allocate_fd(); if ( !the_mq_fd ) { 400087b4: ba 92 20 00 orcc %o0, 0, %i5 400087b8: 02 80 00 39 be 4000889c <== NEVER TAKEN 400087bc: 01 00 00 00 nop _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENFILE ); } the_mq_fd->oflag = oflag; 400087c0: f2 27 60 14 st %i1, [ %i5 + 0x14 ] const char *name, Objects_Id *id, size_t *len ) { return _POSIX_Name_to_id( &_POSIX_Message_queue_Information, name, id, len ); 400087c4: 35 10 00 93 sethi %hi(0x40024c00), %i2 400087c8: 92 10 00 18 mov %i0, %o1 400087cc: 90 16 a3 f4 or %i2, 0x3f4, %o0 400087d0: 94 07 bf f0 add %fp, -16, %o2 400087d4: 40 00 01 42 call 40008cdc <_POSIX_Name_to_id> 400087d8: 96 07 bf fc add %fp, -4, %o3 * 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 ) { 400087dc: b6 92 20 00 orcc %o0, 0, %i3 400087e0: 22 80 00 0f be,a 4000881c 400087e4: 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) ) ) { 400087e8: 80 a6 e0 02 cmp %i3, 2 400087ec: 02 80 00 3f be 400088e8 400087f0: 80 a4 60 00 cmp %l1, 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 ); 400087f4: 90 17 21 80 or %i4, 0x180, %o0 400087f8: 40 00 0d 06 call 4000bc10 <_Objects_Free> 400087fc: 92 10 00 1d mov %i5, %o1 _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 40008800: 40 00 11 58 call 4000cd60 <_Thread_Enable_dispatch> 40008804: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one_cast( status, mqd_t ); 40008808: 40 00 28 15 call 4001285c <__errno> 4000880c: 01 00 00 00 nop 40008810: f6 22 00 00 st %i3, [ %o0 ] 40008814: 81 c7 e0 08 ret 40008818: 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) ) { 4000881c: 80 a6 6a 00 cmp %i1, 0xa00 40008820: 02 80 00 27 be 400088bc 40008824: d2 07 bf f0 ld [ %fp + -16 ], %o1 RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get ( Objects_Id id, Objects_Locations *location ) { return (POSIX_Message_queue_Control *) 40008828: 94 07 bf f8 add %fp, -8, %o2 4000882c: 40 00 0d 5f call 4000bda8 <_Objects_Get> 40008830: 90 16 a3 f4 or %i2, 0x3f4, %o0 /* * 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; 40008834: c4 02 20 18 ld [ %o0 + 0x18 ], %g2 Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( 40008838: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 4000883c: 84 00 a0 01 inc %g2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40008840: b8 17 21 80 or %i4, 0x180, %i4 40008844: c4 22 20 18 st %g2, [ %o0 + 0x18 ] 40008848: 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 ); 4000884c: d0 27 bf f4 st %o0, [ %fp + -12 ] the_mq->open_count += 1; the_mq_fd->Queue = the_mq; 40008850: d0 27 60 10 st %o0, [ %i5 + 0x10 ] 40008854: 83 28 60 02 sll %g1, 2, %g1 40008858: fa 20 80 01 st %i5, [ %g2 + %g1 ] _Objects_Open_string( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object, NULL ); _Thread_Enable_dispatch(); 4000885c: 40 00 11 41 call 4000cd60 <_Thread_Enable_dispatch> 40008860: c0 27 60 0c clr [ %i5 + 0xc ] _Thread_Enable_dispatch(); 40008864: 40 00 11 3f call 4000cd60 <_Thread_Enable_dispatch> 40008868: 01 00 00 00 nop return (mqd_t)the_mq_fd->Object.id; 4000886c: f0 07 60 08 ld [ %i5 + 8 ], %i0 40008870: 81 c7 e0 08 ret 40008874: 81 e8 00 00 restore size_t name_len; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); 40008878: 82 07 a0 4c add %fp, 0x4c, %g1 mode = va_arg( arg, mode_t ); attr = va_arg( arg, struct mq_attr * ); 4000887c: e0 07 a0 50 ld [ %fp + 0x50 ], %l0 size_t name_len; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); 40008880: c2 27 bf ec st %g1, [ %fp + -20 ] */ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd * _POSIX_Message_queue_Allocate_fd( void ) { return (POSIX_Message_queue_Control_fd *) 40008884: 39 10 00 94 sethi %hi(0x40025000), %i4 40008888: 40 00 0b ea call 4000b830 <_Objects_Allocate> 4000888c: 90 17 21 80 or %i4, 0x180, %o0 ! 40025180 <_POSIX_Message_queue_Information_fds> attr = va_arg( arg, struct mq_attr * ); va_end(arg); } the_mq_fd = _POSIX_Message_queue_Allocate_fd(); if ( !the_mq_fd ) { 40008890: ba 92 20 00 orcc %o0, 0, %i5 40008894: 32 bf ff cc bne,a 400087c4 40008898: f2 27 60 14 st %i1, [ %i5 + 0x14 ] _Thread_Enable_dispatch(); 4000889c: 40 00 11 31 call 4000cd60 <_Thread_Enable_dispatch> 400088a0: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one( ENFILE ); 400088a4: 40 00 27 ee call 4001285c <__errno> 400088a8: 01 00 00 00 nop 400088ac: 82 10 20 17 mov 0x17, %g1 ! 17 400088b0: c2 22 00 00 st %g1, [ %o0 ] 400088b4: 81 c7 e0 08 ret 400088b8: 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 ); 400088bc: 90 17 21 80 or %i4, 0x180, %o0 400088c0: 40 00 0c d4 call 4000bc10 <_Objects_Free> 400088c4: 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(); 400088c8: 40 00 11 26 call 4000cd60 <_Thread_Enable_dispatch> 400088cc: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one_cast( EEXIST, mqd_t ); 400088d0: 40 00 27 e3 call 4001285c <__errno> 400088d4: 01 00 00 00 nop 400088d8: 82 10 20 11 mov 0x11, %g1 ! 11 400088dc: c2 22 00 00 st %g1, [ %o0 ] 400088e0: 81 c7 e0 08 ret 400088e4: 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) ) ) { 400088e8: 02 bf ff c4 be 400087f8 400088ec: 90 17 21 80 or %i4, 0x180, %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( 400088f0: d2 07 bf fc ld [ %fp + -4 ], %o1 400088f4: 90 10 00 18 mov %i0, %o0 400088f8: 94 10 20 01 mov 1, %o2 400088fc: 96 10 00 10 mov %l0, %o3 40008900: 40 00 1b d1 call 4000f844 <_POSIX_Message_queue_Create_support> 40008904: 98 07 bf f4 add %fp, -12, %o4 ); /* * errno was set by Create_support, so don't set it again. */ if ( status == -1 ) { 40008908: 80 a2 3f ff cmp %o0, -1 4000890c: 02 80 00 0d be 40008940 40008910: c6 07 bf f4 ld [ %fp + -12 ], %g3 Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( 40008914: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40008918: b8 17 21 80 or %i4, 0x180, %i4 4000891c: 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; 40008920: c6 27 60 10 st %g3, [ %i5 + 0x10 ] 40008924: 83 28 60 02 sll %g1, 2, %g1 40008928: fa 20 80 01 st %i5, [ %g2 + %g1 ] &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object, NULL ); _Thread_Enable_dispatch(); 4000892c: 40 00 11 0d call 4000cd60 <_Thread_Enable_dispatch> 40008930: c0 27 60 0c clr [ %i5 + 0xc ] return (mqd_t) the_mq_fd->Object.id; 40008934: f0 07 60 08 ld [ %i5 + 8 ], %i0 } 40008938: 81 c7 e0 08 ret 4000893c: 81 e8 00 00 restore 40008940: 90 17 21 80 or %i4, 0x180, %o0 40008944: 92 10 00 1d mov %i5, %o1 40008948: 40 00 0c b2 call 4000bc10 <_Objects_Free> 4000894c: 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(); 40008950: 40 00 11 04 call 4000cd60 <_Thread_Enable_dispatch> 40008954: 01 00 00 00 nop 40008958: 81 c7 e0 08 ret 4000895c: 81 e8 00 00 restore =============================================================================== 4000d040 : int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { 4000d040: 82 10 00 08 mov %o0, %g1 if ( !attr || !attr->is_initialized ) 4000d044: 80 a0 60 00 cmp %g1, 0 4000d048: 02 80 00 06 be 4000d060 4000d04c: 90 10 20 16 mov 0x16, %o0 4000d050: c4 00 40 00 ld [ %g1 ], %g2 4000d054: 80 a0 a0 00 cmp %g2, 0 4000d058: 12 80 00 04 bne 4000d068 4000d05c: 80 a2 60 04 cmp %o1, 4 return 0; default: return ENOTSUP; } } 4000d060: 81 c3 e0 08 retl 4000d064: 01 00 00 00 nop ) { if ( !attr || !attr->is_initialized ) return EINVAL; switch ( policy ) { 4000d068: 18 80 00 09 bgu 4000d08c 4000d06c: 84 10 20 01 mov 1, %g2 ! 1 4000d070: 85 28 80 09 sll %g2, %o1, %g2 4000d074: 80 88 a0 17 btst 0x17, %g2 4000d078: 02 80 00 05 be 4000d08c <== NEVER TAKEN 4000d07c: 01 00 00 00 nop case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; 4000d080: d2 20 60 14 st %o1, [ %g1 + 0x14 ] return 0; 4000d084: 81 c3 e0 08 retl 4000d088: 90 10 20 00 clr %o0 default: return ENOTSUP; } } 4000d08c: 81 c3 e0 08 retl 4000d090: 90 10 20 86 mov 0x86, %o0 =============================================================================== 400084d4 : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 400084d4: 9d e3 bf 90 save %sp, -112, %sp const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 400084d8: 80 a6 20 00 cmp %i0, 0 400084dc: 02 80 00 04 be 400084ec 400084e0: 80 a6 a0 00 cmp %i2, 0 return EINVAL; if ( count == 0 ) 400084e4: 12 80 00 04 bne 400084f4 400084e8: 80 a6 60 00 cmp %i1, 0 * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; _Thread_Enable_dispatch(); return 0; } 400084ec: 81 c7 e0 08 ret 400084f0: 91 e8 20 16 restore %g0, 0x16, %o0 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 400084f4: 02 80 00 23 be 40008580 400084f8: 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 ) 400084fc: c2 06 40 00 ld [ %i1 ], %g1 40008500: 80 a0 60 00 cmp %g1, 0 40008504: 02 bf ff fa be 400084ec 40008508: 01 00 00 00 nop return EINVAL; switch ( the_attr->process_shared ) { 4000850c: c2 06 60 04 ld [ %i1 + 4 ], %g1 40008510: 80 a0 60 00 cmp %g1, 0 40008514: 12 bf ff f6 bne 400084ec <== NEVER TAKEN 40008518: 03 10 00 65 sethi %hi(0x40019400), %g1 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4000851c: c4 00 60 e0 ld [ %g1 + 0xe0 ], %g2 ! 400194e0 <_Thread_Dispatch_disable_level> } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 40008520: c0 27 bf f0 clr [ %fp + -16 ] ++level; 40008524: 84 00 a0 01 inc %g2 the_attributes.maximum_count = count; 40008528: f4 27 bf f4 st %i2, [ %fp + -12 ] _Thread_Dispatch_disable_level = level; 4000852c: c4 20 60 e0 st %g2, [ %g1 + 0xe0 ] * 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 *) 40008530: 39 10 00 66 sethi %hi(0x40019800), %i4 40008534: 40 00 08 ee call 4000a8ec <_Objects_Allocate> 40008538: 90 17 20 64 or %i4, 0x64, %o0 ! 40019864 <_POSIX_Barrier_Information> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 4000853c: ba 92 20 00 orcc %o0, 0, %i5 40008540: 02 80 00 14 be 40008590 40008544: 90 07 60 10 add %i5, 0x10, %o0 _Thread_Enable_dispatch(); return EAGAIN; } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 40008548: 40 00 06 37 call 40009e24 <_CORE_barrier_Initialize> 4000854c: 92 07 bf f0 add %fp, -16, %o1 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 40008550: c4 17 60 0a lduh [ %i5 + 0xa ], %g2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40008554: b8 17 20 64 or %i4, 0x64, %i4 40008558: c6 07 20 1c ld [ %i4 + 0x1c ], %g3 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 4000855c: c2 07 60 08 ld [ %i5 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40008560: 85 28 a0 02 sll %g2, 2, %g2 40008564: fa 20 c0 02 st %i5, [ %g3 + %g2 ] _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 40008568: c0 27 60 0c clr [ %i5 + 0xc ] ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 4000856c: c2 26 00 00 st %g1, [ %i0 ] _Thread_Enable_dispatch(); 40008570: 40 00 0d f4 call 4000bd40 <_Thread_Enable_dispatch> 40008574: b0 10 20 00 clr %i0 40008578: 81 c7 e0 08 ret 4000857c: 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 ); 40008580: 7f ff ff 9c call 400083f0 40008584: 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 ) 40008588: 10 bf ff de b 40008500 4000858c: c2 06 40 00 ld [ %i1 ], %g1 _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { _Thread_Enable_dispatch(); 40008590: 40 00 0d ec call 4000bd40 <_Thread_Enable_dispatch> 40008594: b0 10 20 0b mov 0xb, %i0 40008598: 81 c7 e0 08 ret 4000859c: 81 e8 00 00 restore =============================================================================== 40007d68 : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { 40007d68: 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 ) 40007d6c: 80 a6 20 00 cmp %i0, 0 40007d70: 02 80 00 13 be 40007dbc 40007d74: 03 10 00 66 sethi %hi(0x40019800), %g1 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40007d78: c4 00 62 00 ld [ %g1 + 0x200 ], %g2 ! 40019a00 <_Thread_Dispatch_disable_level> ++level; 40007d7c: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40007d80: c4 20 62 00 st %g2, [ %g1 + 0x200 ] return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); 40007d84: 40 00 12 bc call 4000c874 <_Workspace_Allocate> 40007d88: 90 10 20 10 mov 0x10, %o0 if ( handler ) { 40007d8c: 80 a2 20 00 cmp %o0, 0 40007d90: 02 80 00 09 be 40007db4 <== NEVER TAKEN 40007d94: 03 10 00 67 sethi %hi(0x40019c00), %g1 thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 40007d98: c2 00 63 20 ld [ %g1 + 0x320 ], %g1 ! 40019f20 <_Per_CPU_Information+0x10> handler_stack = &thread_support->Cancellation_Handlers; handler->routine = routine; handler->arg = arg; _Chain_Append( handler_stack, &handler->Node ); 40007d9c: 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; 40007da0: c2 00 61 50 ld [ %g1 + 0x150 ], %g1 handler->routine = routine; 40007da4: f0 22 20 08 st %i0, [ %o0 + 8 ] handler->arg = arg; 40007da8: f2 22 20 0c st %i1, [ %o0 + 0xc ] _Chain_Append( handler_stack, &handler->Node ); 40007dac: 40 00 06 67 call 40009748 <_Chain_Append> 40007db0: 90 00 60 e4 add %g1, 0xe4, %o0 } _Thread_Enable_dispatch(); 40007db4: 40 00 0e 33 call 4000b680 <_Thread_Enable_dispatch> 40007db8: 81 e8 00 00 restore 40007dbc: 81 c7 e0 08 ret 40007dc0: 81 e8 00 00 restore =============================================================================== 40008d08 : */ int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 40008d08: 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; 40008d0c: 80 a6 60 00 cmp %i1, 0 40008d10: 22 80 00 27 be,a 40008dac 40008d14: 33 10 00 63 sethi %hi(0x40018c00), %i1 else the_attr = &_POSIX_Condition_variables_Default_attributes; /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 40008d18: c4 06 60 04 ld [ %i1 + 4 ], %g2 ! 40018c04 40008d1c: 80 a0 a0 01 cmp %g2, 1 40008d20: 02 80 00 06 be 40008d38 <== NEVER TAKEN 40008d24: 82 10 20 16 mov 0x16, %g1 return EINVAL; if ( !the_attr->is_initialized ) 40008d28: c4 06 40 00 ld [ %i1 ], %g2 40008d2c: 80 a0 a0 00 cmp %g2, 0 40008d30: 32 80 00 04 bne,a 40008d40 40008d34: 03 10 00 69 sethi %hi(0x4001a400), %g1 *cond = the_cond->Object.id; _Thread_Enable_dispatch(); return 0; } 40008d38: 81 c7 e0 08 ret 40008d3c: 91 e8 00 01 restore %g0, %g1, %o0 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40008d40: c4 00 63 20 ld [ %g1 + 0x320 ], %g2 ++level; 40008d44: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40008d48: c4 20 63 20 st %g2, [ %g1 + 0x320 ] */ RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) 40008d4c: 39 10 00 6a sethi %hi(0x4001a800), %i4 40008d50: 40 00 0a 9e call 4000b7c8 <_Objects_Allocate> 40008d54: 90 17 23 3c or %i4, 0x33c, %o0 ! 4001ab3c <_POSIX_Condition_variables_Information> _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 40008d58: ba 92 20 00 orcc %o0, 0, %i5 40008d5c: 02 80 00 16 be 40008db4 40008d60: 90 07 60 18 add %i5, 0x18, %o0 _Thread_Enable_dispatch(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; 40008d64: c2 06 60 04 ld [ %i1 + 4 ], %g1 the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; _Thread_queue_Initialize( 40008d68: 92 10 20 00 clr %o1 40008d6c: 15 04 00 02 sethi %hi(0x10000800), %o2 40008d70: 96 10 20 74 mov 0x74, %o3 if ( !the_cond ) { _Thread_Enable_dispatch(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; 40008d74: c2 27 60 10 st %g1, [ %i5 + 0x10 ] the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; _Thread_queue_Initialize( 40008d78: 40 00 11 c8 call 4000d498 <_Thread_queue_Initialize> 40008d7c: c0 27 60 14 clr [ %i5 + 0x14 ] Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 40008d80: c4 17 60 0a lduh [ %i5 + 0xa ], %g2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40008d84: b8 17 23 3c or %i4, 0x33c, %i4 40008d88: c6 07 20 1c ld [ %i4 + 0x1c ], %g3 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 40008d8c: c2 07 60 08 ld [ %i5 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40008d90: 85 28 a0 02 sll %g2, 2, %g2 40008d94: fa 20 c0 02 st %i5, [ %g3 + %g2 ] _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 40008d98: c0 27 60 0c clr [ %i5 + 0xc ] 0 ); *cond = the_cond->Object.id; _Thread_Enable_dispatch(); 40008d9c: 40 00 0f a0 call 4000cc1c <_Thread_Enable_dispatch> 40008da0: c2 26 00 00 st %g1, [ %i0 ] return 0; 40008da4: 10 bf ff e5 b 40008d38 40008da8: 82 10 20 00 clr %g1 { 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; 40008dac: 10 bf ff db b 40008d18 40008db0: b2 16 62 dc or %i1, 0x2dc, %i1 _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { _Thread_Enable_dispatch(); 40008db4: 40 00 0f 9a call 4000cc1c <_Thread_Enable_dispatch> 40008db8: 01 00 00 00 nop return ENOMEM; 40008dbc: 10 bf ff df b 40008d38 40008dc0: 82 10 20 0c mov 0xc, %g1 ! c =============================================================================== 40008b6c : */ int pthread_condattr_destroy( pthread_condattr_t *attr ) { 40008b6c: 82 10 00 08 mov %o0, %g1 if ( !attr || attr->is_initialized == false ) 40008b70: 80 a0 60 00 cmp %g1, 0 40008b74: 02 80 00 06 be 40008b8c 40008b78: 90 10 20 16 mov 0x16, %o0 40008b7c: c4 00 40 00 ld [ %g1 ], %g2 40008b80: 80 a0 a0 00 cmp %g2, 0 40008b84: 32 80 00 04 bne,a 40008b94 <== ALWAYS TAKEN 40008b88: c0 20 40 00 clr [ %g1 ] return EINVAL; attr->is_initialized = false; return 0; } 40008b8c: 81 c3 e0 08 retl 40008b90: 01 00 00 00 nop 40008b94: 81 c3 e0 08 retl 40008b98: 90 10 20 00 clr %o0 ! 0 =============================================================================== 40008214 : pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { 40008214: 9d e3 bf 58 save %sp, -168, %sp int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) 40008218: 80 a6 a0 00 cmp %i2, 0 4000821c: 02 80 00 0a be 40008244 40008220: ba 10 20 0e mov 0xe, %i5 return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 40008224: 80 a6 60 00 cmp %i1, 0 40008228: 22 80 00 63 be,a 400083b4 4000822c: 33 10 00 7c sethi %hi(0x4001f000), %i1 if ( !the_attr->is_initialized ) 40008230: c2 06 40 00 ld [ %i1 ], %g1 40008234: 80 a0 60 00 cmp %g1, 0 40008238: 32 80 00 05 bne,a 4000824c 4000823c: c2 06 60 04 ld [ %i1 + 4 ], %g1 schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; break; default: return EINVAL; 40008240: ba 10 20 16 mov 0x16, %i5 */ *thread = the_thread->Object.id; _RTEMS_Unlock_allocator(); return 0; } 40008244: 81 c7 e0 08 ret 40008248: 91 e8 00 1d restore %g0, %i5, %o0 * 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) ) 4000824c: 80 a0 60 00 cmp %g1, 0 40008250: 02 80 00 07 be 4000826c 40008254: 03 10 00 80 sethi %hi(0x40020000), %g1 40008258: c4 06 60 08 ld [ %i1 + 8 ], %g2 4000825c: c2 00 60 00 ld [ %g1 ], %g1 40008260: 80 a0 80 01 cmp %g2, %g1 40008264: 0a bf ff f8 bcs 40008244 40008268: ba 10 20 16 mov 0x16, %i5 * 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 ) { 4000826c: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 40008270: 80 a0 60 01 cmp %g1, 1 40008274: 02 80 00 52 be 400083bc 40008278: 80 a0 60 02 cmp %g1, 2 4000827c: 32 bf ff f2 bne,a 40008244 40008280: ba 10 20 16 mov 0x16, %i5 schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; 40008284: da 06 60 18 ld [ %i1 + 0x18 ], %o5 40008288: de 06 60 1c ld [ %i1 + 0x1c ], %o7 4000828c: fa 06 60 20 ld [ %i1 + 0x20 ], %i5 40008290: c8 06 60 24 ld [ %i1 + 0x24 ], %g4 40008294: c6 06 60 28 ld [ %i1 + 0x28 ], %g3 40008298: c4 06 60 2c ld [ %i1 + 0x2c ], %g2 4000829c: c2 06 60 30 ld [ %i1 + 0x30 ], %g1 schedpolicy = api->schedpolicy; schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; 400082a0: f8 06 60 14 ld [ %i1 + 0x14 ], %i4 schedparam = the_attr->schedparam; 400082a4: da 27 bf e4 st %o5, [ %fp + -28 ] 400082a8: de 27 bf e8 st %o7, [ %fp + -24 ] 400082ac: fa 27 bf ec st %i5, [ %fp + -20 ] 400082b0: c8 27 bf f0 st %g4, [ %fp + -16 ] 400082b4: c6 27 bf f4 st %g3, [ %fp + -12 ] 400082b8: c4 27 bf f8 st %g2, [ %fp + -8 ] 400082bc: c2 27 bf fc st %g1, [ %fp + -4 ] /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) 400082c0: c2 06 60 0c ld [ %i1 + 0xc ], %g1 400082c4: 80 a0 60 00 cmp %g1, 0 400082c8: 12 bf ff df bne 40008244 400082cc: ba 10 20 86 mov 0x86, %i5 return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 400082d0: 40 00 1a 17 call 4000eb2c <_POSIX_Priority_Is_valid> 400082d4: d0 07 bf e4 ld [ %fp + -28 ], %o0 400082d8: 80 8a 20 ff btst 0xff, %o0 400082dc: 02 bf ff da be 40008244 <== NEVER TAKEN 400082e0: ba 10 20 16 mov 0x16, %i5 RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 400082e4: 03 10 00 7f sethi %hi(0x4001fc00), %g1 return EINVAL; core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); 400082e8: e0 07 bf e4 ld [ %fp + -28 ], %l0 400082ec: e8 08 63 fc ldub [ %g1 + 0x3fc ], %l4 /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 400082f0: 90 10 00 1c mov %i4, %o0 400082f4: 92 07 bf e4 add %fp, -28, %o1 400082f8: 94 07 bf dc add %fp, -36, %o2 400082fc: 40 00 1a 19 call 4000eb60 <_POSIX_Thread_Translate_sched_param> 40008300: 96 07 bf e0 add %fp, -32, %o3 schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) 40008304: ba 92 20 00 orcc %o0, 0, %i5 40008308: 12 bf ff cf bne 40008244 4000830c: 25 10 00 83 sethi %hi(0x40020c00), %l2 #endif /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 40008310: d0 04 a2 20 ld [ %l2 + 0x220 ], %o0 ! 40020e20 <_RTEMS_Allocator_Mutex> 40008314: 40 00 06 99 call 40009d78 <_API_Mutex_Lock> 40008318: 27 10 00 83 sethi %hi(0x40020c00), %l3 * _POSIX_Threads_Allocate */ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ) { return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ); 4000831c: 40 00 09 70 call 4000a8dc <_Objects_Allocate> 40008320: 90 14 e3 a4 or %l3, 0x3a4, %o0 ! 40020fa4 <_POSIX_Threads_Information> * Allocate the thread control block. * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { 40008324: a2 92 20 00 orcc %o0, 0, %l1 40008328: 02 80 00 1f be 400083a4 4000832c: 05 10 00 80 sethi %hi(0x40020000), %g2 /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 40008330: 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 ) 40008334: d6 00 a0 00 ld [ %g2 ], %o3 /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 40008338: c0 27 bf d4 clr [ %fp + -44 ] 4000833c: 97 2a e0 01 sll %o3, 1, %o3 40008340: 80 a2 c0 01 cmp %o3, %g1 40008344: 1a 80 00 03 bcc 40008350 40008348: d4 06 60 04 ld [ %i1 + 4 ], %o2 4000834c: 96 10 00 01 mov %g1, %o3 40008350: c2 07 bf dc ld [ %fp + -36 ], %g1 40008354: 9a 0d 20 ff and %l4, 0xff, %o5 40008358: c2 23 a0 60 st %g1, [ %sp + 0x60 ] 4000835c: 82 10 20 01 mov 1, %g1 40008360: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 40008364: c2 07 bf e0 ld [ %fp + -32 ], %g1 40008368: c0 23 a0 68 clr [ %sp + 0x68 ] 4000836c: c2 23 a0 64 st %g1, [ %sp + 0x64 ] 40008370: 82 07 bf d4 add %fp, -44, %g1 40008374: 90 14 e3 a4 or %l3, 0x3a4, %o0 40008378: c2 23 a0 6c st %g1, [ %sp + 0x6c ] 4000837c: 92 10 00 11 mov %l1, %o1 40008380: 98 10 20 00 clr %o4 40008384: 40 00 0e a2 call 4000be0c <_Thread_Initialize> 40008388: 9a 23 40 10 sub %o5, %l0, %o5 budget_callout, 0, /* isr level */ name /* posix threads don't have a name */ ); if ( !status ) { 4000838c: 80 8a 20 ff btst 0xff, %o0 40008390: 12 80 00 1e bne 40008408 40008394: 11 10 00 83 sethi %hi(0x40020c00), %o0 RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( Thread_Control *the_pthread ) { _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object ); 40008398: 92 10 00 11 mov %l1, %o1 4000839c: 40 00 0a 48 call 4000acbc <_Objects_Free> 400083a0: 90 12 23 a4 or %o0, 0x3a4, %o0 _POSIX_Threads_Free( the_thread ); _RTEMS_Unlock_allocator(); 400083a4: d0 04 a2 20 ld [ %l2 + 0x220 ], %o0 400083a8: 40 00 06 89 call 40009dcc <_API_Mutex_Unlock> 400083ac: ba 10 20 0b mov 0xb, %i5 400083b0: 30 bf ff a5 b,a 40008244 int rc; if ( !start_routine ) return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 400083b4: 10 bf ff 9f b 40008230 400083b8: b2 16 63 dc or %i1, 0x3dc, %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 ]; 400083bc: 03 10 00 84 sethi %hi(0x40021000), %g1 400083c0: c2 00 62 c0 ld [ %g1 + 0x2c0 ], %g1 ! 400212c0 <_Per_CPU_Information+0x10> 400083c4: c2 00 61 50 ld [ %g1 + 0x150 ], %g1 schedpolicy = api->schedpolicy; schedparam = api->schedparam; 400083c8: d8 00 60 88 ld [ %g1 + 0x88 ], %o4 400083cc: da 00 60 8c ld [ %g1 + 0x8c ], %o5 400083d0: de 00 60 90 ld [ %g1 + 0x90 ], %o7 400083d4: fa 00 60 94 ld [ %g1 + 0x94 ], %i5 400083d8: c8 00 60 98 ld [ %g1 + 0x98 ], %g4 400083dc: c6 00 60 9c ld [ %g1 + 0x9c ], %g3 400083e0: 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; 400083e4: f8 00 60 84 ld [ %g1 + 0x84 ], %i4 schedparam = api->schedparam; 400083e8: d8 27 bf e4 st %o4, [ %fp + -28 ] 400083ec: da 27 bf e8 st %o5, [ %fp + -24 ] 400083f0: de 27 bf ec st %o7, [ %fp + -20 ] 400083f4: fa 27 bf f0 st %i5, [ %fp + -16 ] 400083f8: c8 27 bf f4 st %g4, [ %fp + -12 ] 400083fc: c6 27 bf f8 st %g3, [ %fp + -8 ] break; 40008400: 10 bf ff b0 b 400082c0 40008404: c4 27 bf fc st %g2, [ %fp + -4 ] } /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 40008408: e0 04 61 50 ld [ %l1 + 0x150 ], %l0 api->Attributes = *the_attr; 4000840c: 92 10 00 19 mov %i1, %o1 40008410: 94 10 20 40 mov 0x40, %o2 40008414: 40 00 25 ed call 40011bc8 40008418: 90 10 00 10 mov %l0, %o0 api->detachstate = the_attr->detachstate; 4000841c: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 api->schedpolicy = schedpolicy; api->schedparam = schedparam; 40008420: 92 07 bf e4 add %fp, -28, %o1 40008424: 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; 40008428: c2 24 20 40 st %g1, [ %l0 + 0x40 ] api->schedpolicy = schedpolicy; 4000842c: f8 24 20 84 st %i4, [ %l0 + 0x84 ] api->schedparam = schedparam; 40008430: 40 00 25 e6 call 40011bc8 40008434: 90 04 20 88 add %l0, 0x88, %o0 /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 40008438: 90 10 00 11 mov %l1, %o0 4000843c: 92 10 20 01 mov 1, %o1 40008440: 94 10 00 1a mov %i2, %o2 40008444: 96 10 00 1b mov %i3, %o3 40008448: 40 00 10 d3 call 4000c794 <_Thread_Start> 4000844c: 98 10 20 00 clr %o4 _RTEMS_Unlock_allocator(); return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { 40008450: 80 a7 20 04 cmp %i4, 4 40008454: 02 80 00 07 be 40008470 40008458: 01 00 00 00 nop } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 4000845c: c2 04 60 08 ld [ %l1 + 8 ], %g1 _RTEMS_Unlock_allocator(); 40008460: d0 04 a2 20 ld [ %l2 + 0x220 ], %o0 40008464: 40 00 06 5a call 40009dcc <_API_Mutex_Unlock> 40008468: c2 26 00 00 st %g1, [ %i0 ] 4000846c: 30 bf ff 76 b,a 40008244 return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { _Watchdog_Insert_ticks( 40008470: 40 00 10 f3 call 4000c83c <_Timespec_To_ticks> 40008474: 90 04 20 90 add %l0, 0x90, %o0 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40008478: 92 04 20 a8 add %l0, 0xa8, %o1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4000847c: d0 24 20 b4 st %o0, [ %l0 + 0xb4 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40008480: 11 10 00 83 sethi %hi(0x40020c00), %o0 40008484: 40 00 11 a8 call 4000cb24 <_Watchdog_Insert> 40008488: 90 12 22 38 or %o0, 0x238, %o0 ! 40020e38 <_Watchdog_Ticks_chain> } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 4000848c: 10 bf ff f5 b 40008460 40008490: c2 04 60 08 ld [ %l1 + 8 ], %g1 =============================================================================== 4001d05c : int pthread_kill( pthread_t thread, int sig ) { 4001d05c: 9d e3 bf 98 save %sp, -104, %sp POSIX_API_Control *api; Thread_Control *the_thread; Objects_Locations location; if ( !sig ) 4001d060: 80 a6 60 00 cmp %i1, 0 4001d064: 02 80 00 31 be 4001d128 4001d068: b8 06 7f ff add %i1, -1, %i4 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 4001d06c: 80 a7 20 1f cmp %i4, 0x1f 4001d070: 18 80 00 2e bgu 4001d128 4001d074: 90 10 00 18 mov %i0, %o0 rtems_set_errno_and_return_minus_one( EINVAL ); the_thread = _Thread_Get( thread, &location ); 4001d078: 7f ff b8 20 call 4000b0f8 <_Thread_Get> 4001d07c: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4001d080: c2 07 bf fc ld [ %fp + -4 ], %g1 4001d084: 80 a0 60 00 cmp %g1, 0 4001d088: 12 80 00 2e bne 4001d140 <== NEVER TAKEN 4001d08c: ba 10 00 08 mov %o0, %i5 4001d090: 11 10 00 7d sethi %hi(0x4001f400), %o0 4001d094: 7f ff af b9 call 40008f78 <_API_extensions_Add_post_switch> 4001d098: 90 12 22 ac or %o0, 0x2ac, %o0 ! 4001f6ac <_POSIX_signals_Post_switch> api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( sig ) { if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) { 4001d09c: 83 2e 60 02 sll %i1, 2, %g1 4001d0a0: 85 2e 60 04 sll %i1, 4, %g2 4001d0a4: 84 20 80 01 sub %g2, %g1, %g2 4001d0a8: 03 10 00 82 sethi %hi(0x40020800), %g1 4001d0ac: 82 10 60 20 or %g1, 0x20, %g1 ! 40020820 <_POSIX_signals_Vectors> 4001d0b0: 82 00 40 02 add %g1, %g2, %g1 4001d0b4: c4 00 60 08 ld [ %g1 + 8 ], %g2 4001d0b8: 80 a0 a0 01 cmp %g2, 1 4001d0bc: 02 80 00 15 be 4001d110 4001d0c0: c2 07 61 50 ld [ %i5 + 0x150 ], %g1 return 0; } /* XXX critical section */ api->signals_pending |= signo_to_mask( sig ); 4001d0c4: c4 00 60 d4 ld [ %g1 + 0xd4 ], %g2 4001d0c8: b6 10 20 01 mov 1, %i3 (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); 4001d0cc: 90 10 00 1d mov %i5, %o0 4001d0d0: b9 2e c0 1c sll %i3, %i4, %i4 4001d0d4: 92 10 00 19 mov %i1, %o1 return 0; } /* XXX critical section */ api->signals_pending |= signo_to_mask( sig ); 4001d0d8: b8 10 80 1c or %g2, %i4, %i4 (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); 4001d0dc: 94 10 20 00 clr %o2 4001d0e0: 7f ff ff 86 call 4001cef8 <_POSIX_signals_Unblock_thread> 4001d0e4: f8 20 60 d4 st %i4, [ %g1 + 0xd4 ] if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4001d0e8: 03 10 00 81 sethi %hi(0x40020400), %g1 4001d0ec: 82 10 63 c0 or %g1, 0x3c0, %g1 ! 400207c0 <_Per_CPU_Information> 4001d0f0: c4 00 60 08 ld [ %g1 + 8 ], %g2 4001d0f4: 80 a0 a0 00 cmp %g2, 0 4001d0f8: 02 80 00 06 be 4001d110 4001d0fc: 01 00 00 00 nop 4001d100: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4001d104: 80 a7 40 02 cmp %i5, %g2 4001d108: 02 80 00 06 be 4001d120 4001d10c: 01 00 00 00 nop api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( sig ) { if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) { _Thread_Enable_dispatch(); 4001d110: 7f ff b7 ee call 4000b0c8 <_Thread_Enable_dispatch> 4001d114: b0 10 20 00 clr %i0 ! 0 4001d118: 81 c7 e0 08 ret 4001d11c: 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; 4001d120: f6 28 60 0c stb %i3, [ %g1 + 0xc ] 4001d124: 30 bf ff fb b,a 4001d110 if ( !sig ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) rtems_set_errno_and_return_minus_one( EINVAL ); 4001d128: 7f ff ce 06 call 40010940 <__errno> 4001d12c: b0 10 3f ff mov -1, %i0 4001d130: 82 10 20 16 mov 0x16, %g1 4001d134: c2 22 00 00 st %g1, [ %o0 ] 4001d138: 81 c7 e0 08 ret 4001d13c: 81 e8 00 00 restore #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( ESRCH ); 4001d140: 7f ff ce 00 call 40010940 <__errno> <== NOT EXECUTED 4001d144: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 4001d148: 82 10 20 03 mov 3, %g1 <== NOT EXECUTED 4001d14c: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED } 4001d150: 81 c7 e0 08 ret <== NOT EXECUTED 4001d154: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4000a254 : */ int pthread_mutex_timedlock( pthread_mutex_t *mutex, const struct timespec *abstime ) { 4000a254: 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 ); 4000a258: 90 10 00 19 mov %i1, %o0 4000a25c: 40 00 00 38 call 4000a33c <_POSIX_Absolute_timeout_to_ticks> 4000a260: 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 ); 4000a264: 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 ); 4000a268: ba 10 00 08 mov %o0, %i5 if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 4000a26c: 80 a7 60 03 cmp %i5, 3 4000a270: 02 80 00 0c be 4000a2a0 4000a274: 90 10 00 18 mov %i0, %o0 do_wait = false; lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks ); 4000a278: 7f ff ff bd call 4000a16c <_POSIX_Mutex_Lock_support> 4000a27c: 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) ) { 4000a280: 80 a2 20 10 cmp %o0, 0x10 4000a284: 12 80 00 0a bne 4000a2ac 4000a288: b0 10 00 08 mov %o0, %i0 if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 4000a28c: 80 a7 60 00 cmp %i5, 0 4000a290: 12 80 00 09 bne 4000a2b4 <== ALWAYS TAKEN 4000a294: ba 07 7f ff add %i5, -1, %i5 return EINVAL; 4000a298: 81 c7 e0 08 ret <== NOT EXECUTED 4000a29c: 91 e8 20 16 restore %g0, 0x16, %o0 <== NOT EXECUTED */ 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 ); 4000a2a0: 7f ff ff b3 call 4000a16c <_POSIX_Mutex_Lock_support> 4000a2a4: 92 10 20 01 mov 1, %o1 4000a2a8: b0 10 00 08 mov %o0, %i0 status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return lock_status; } 4000a2ac: 81 c7 e0 08 ret 4000a2b0: 81 e8 00 00 restore * make sure the right reason is returned. */ if ( !do_wait && (lock_status == EBUSY) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 4000a2b4: 80 a7 60 01 cmp %i5, 1 4000a2b8: 18 bf ff fd bgu 4000a2ac <== NEVER TAKEN 4000a2bc: 01 00 00 00 nop status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; 4000a2c0: 81 c7 e0 08 ret 4000a2c4: 91 e8 20 74 restore %g0, 0x74, %o0 =============================================================================== 40007c34 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_gettype( const pthread_mutexattr_t *attr, int *type ) { 40007c34: 82 10 00 08 mov %o0, %g1 if ( !attr ) 40007c38: 80 a0 60 00 cmp %g1, 0 40007c3c: 02 80 00 06 be 40007c54 40007c40: 90 10 20 16 mov 0x16, %o0 return EINVAL; if ( !attr->is_initialized ) 40007c44: c4 00 40 00 ld [ %g1 ], %g2 40007c48: 80 a0 a0 00 cmp %g2, 0 40007c4c: 12 80 00 04 bne 40007c5c 40007c50: 80 a2 60 00 cmp %o1, 0 if ( !type ) return EINVAL; *type = attr->type; return 0; } 40007c54: 81 c3 e0 08 retl 40007c58: 01 00 00 00 nop return EINVAL; if ( !attr->is_initialized ) return EINVAL; if ( !type ) 40007c5c: 02 bf ff fe be 40007c54 <== NEVER TAKEN 40007c60: 01 00 00 00 nop return EINVAL; *type = attr->type; 40007c64: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 return 0; 40007c68: 90 10 20 00 clr %o0 } 40007c6c: 81 c3 e0 08 retl 40007c70: c2 22 40 00 st %g1, [ %o1 ] =============================================================================== 40009e20 : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { 40009e20: 82 10 00 08 mov %o0, %g1 if ( !attr || !attr->is_initialized ) 40009e24: 80 a0 60 00 cmp %g1, 0 40009e28: 02 80 00 06 be 40009e40 40009e2c: 90 10 20 16 mov 0x16, %o0 40009e30: c4 00 40 00 ld [ %g1 ], %g2 40009e34: 80 a0 a0 00 cmp %g2, 0 40009e38: 12 80 00 04 bne 40009e48 40009e3c: 80 a2 60 01 cmp %o1, 1 return 0; default: return EINVAL; } } 40009e40: 81 c3 e0 08 retl 40009e44: 01 00 00 00 nop ) { if ( !attr || !attr->is_initialized ) return EINVAL; switch ( pshared ) { 40009e48: 18 bf ff fe bgu 40009e40 <== NEVER TAKEN 40009e4c: 01 00 00 00 nop case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 40009e50: d2 20 60 04 st %o1, [ %g1 + 4 ] return 0; default: return EINVAL; } } 40009e54: 81 c3 e0 08 retl 40009e58: 90 10 20 00 clr %o0 =============================================================================== 40007cc8 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { 40007cc8: 82 10 00 08 mov %o0, %g1 if ( !attr || !attr->is_initialized ) 40007ccc: 80 a0 60 00 cmp %g1, 0 40007cd0: 02 80 00 06 be 40007ce8 40007cd4: 90 10 20 16 mov 0x16, %o0 40007cd8: c4 00 40 00 ld [ %g1 ], %g2 40007cdc: 80 a0 a0 00 cmp %g2, 0 40007ce0: 12 80 00 04 bne 40007cf0 <== ALWAYS TAKEN 40007ce4: 80 a2 60 03 cmp %o1, 3 return 0; default: return EINVAL; } } 40007ce8: 81 c3 e0 08 retl 40007cec: 01 00 00 00 nop ) { if ( !attr || !attr->is_initialized ) return EINVAL; switch ( type ) { 40007cf0: 18 bf ff fe bgu 40007ce8 40007cf4: 01 00 00 00 nop case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 40007cf8: d2 20 60 10 st %o1, [ %g1 + 0x10 ] return 0; default: return EINVAL; } } 40007cfc: 81 c3 e0 08 retl 40007d00: 90 10 20 00 clr %o0 =============================================================================== 40008948 : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 40008948: 9d e3 bf 98 save %sp, -104, %sp if ( !once_control || !init_routine ) 4000894c: 80 a6 60 00 cmp %i1, 0 40008950: 12 80 00 05 bne 40008964 40008954: 80 a6 20 00 cmp %i0, 0 return EINVAL; 40008958: 82 10 20 16 mov 0x16, %g1 (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); } return 0; } 4000895c: 81 c7 e0 08 ret 40008960: 91 e8 00 01 restore %g0, %g1, %o0 int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { if ( !once_control || !init_routine ) 40008964: 22 bf ff fe be,a 4000895c 40008968: 82 10 20 16 mov 0x16, %g1 return EINVAL; if ( !once_control->init_executed ) { 4000896c: c4 06 20 04 ld [ %i0 + 4 ], %g2 40008970: 80 a0 a0 00 cmp %g2, 0 40008974: 12 bf ff fa bne 4000895c 40008978: 82 10 20 00 clr %g1 rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 4000897c: 90 10 21 00 mov 0x100, %o0 40008980: 92 10 21 00 mov 0x100, %o1 40008984: 40 00 03 21 call 40009608 40008988: 94 07 bf fc add %fp, -4, %o2 if ( !once_control->init_executed ) { 4000898c: c2 06 20 04 ld [ %i0 + 4 ], %g1 40008990: 80 a0 60 00 cmp %g1, 0 40008994: 02 80 00 09 be 400089b8 <== ALWAYS TAKEN 40008998: 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); 4000899c: d0 07 bf fc ld [ %fp + -4 ], %o0 <== NOT EXECUTED 400089a0: 92 10 21 00 mov 0x100, %o1 400089a4: 40 00 03 19 call 40009608 400089a8: 94 07 bf fc add %fp, -4, %o2 } return 0; 400089ac: 82 10 20 00 clr %g1 } 400089b0: 81 c7 e0 08 ret 400089b4: 91 e8 00 01 restore %g0, %g1, %o0 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; 400089b8: c2 26 00 00 st %g1, [ %i0 ] once_control->init_executed = true; (*init_routine)(); 400089bc: 9f c6 40 00 call %i1 400089c0: c2 26 20 04 st %g1, [ %i0 + 4 ] } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 400089c4: 10 bf ff f7 b 400089a0 400089c8: d0 07 bf fc ld [ %fp + -4 ], %o0 =============================================================================== 40008b90 : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 40008b90: 9d e3 bf 90 save %sp, -112, %sp const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 40008b94: 80 a6 20 00 cmp %i0, 0 40008b98: 02 80 00 08 be 40008bb8 40008b9c: 80 a6 60 00 cmp %i1, 0 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 40008ba0: 02 80 00 23 be 40008c2c 40008ba4: 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 ) 40008ba8: c2 06 40 00 ld [ %i1 ], %g1 40008bac: 80 a0 60 00 cmp %g1, 0 40008bb0: 32 80 00 04 bne,a 40008bc0 <== ALWAYS TAKEN 40008bb4: c2 06 60 04 ld [ %i1 + 4 ], %g1 *rwlock = the_rwlock->Object.id; _Thread_Enable_dispatch(); return 0; } 40008bb8: 81 c7 e0 08 ret 40008bbc: 91 e8 20 16 restore %g0, 0x16, %o0 * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) return EINVAL; switch ( the_attr->process_shared ) { 40008bc0: 80 a0 60 00 cmp %g1, 0 40008bc4: 12 bf ff fd bne 40008bb8 <== NEVER TAKEN 40008bc8: 03 10 00 93 sethi %hi(0x40024c00), %g1 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40008bcc: c4 00 60 b0 ld [ %g1 + 0xb0 ], %g2 ! 40024cb0 <_Thread_Dispatch_disable_level> */ RTEMS_INLINE_ROUTINE void _CORE_RWLock_Initialize_attributes( CORE_RWLock_Attributes *the_attributes ) { the_attributes->XXX = 0; 40008bd0: c0 27 bf f4 clr [ %fp + -12 ] ++level; 40008bd4: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40008bd8: c4 20 60 b0 st %g2, [ %g1 + 0xb0 ] * 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 *) 40008bdc: 39 10 00 93 sethi %hi(0x40024c00), %i4 40008be0: 40 00 0b 14 call 4000b830 <_Objects_Allocate> 40008be4: 90 17 22 b4 or %i4, 0x2b4, %o0 ! 40024eb4 <_POSIX_RWLock_Information> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 40008be8: ba 92 20 00 orcc %o0, 0, %i5 40008bec: 02 80 00 14 be 40008c3c 40008bf0: 90 07 60 10 add %i5, 0x10, %o0 _Thread_Enable_dispatch(); return EAGAIN; } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 40008bf4: 40 00 09 5f call 4000b170 <_CORE_RWLock_Initialize> 40008bf8: 92 07 bf f4 add %fp, -12, %o1 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 40008bfc: c4 17 60 0a lduh [ %i5 + 0xa ], %g2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40008c00: b8 17 22 b4 or %i4, 0x2b4, %i4 40008c04: c6 07 20 1c ld [ %i4 + 0x1c ], %g3 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 40008c08: c2 07 60 08 ld [ %i5 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40008c0c: 85 28 a0 02 sll %g2, 2, %g2 40008c10: fa 20 c0 02 st %i5, [ %g3 + %g2 ] _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 40008c14: c0 27 60 0c clr [ %i5 + 0xc ] &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; 40008c18: c2 26 00 00 st %g1, [ %i0 ] _Thread_Enable_dispatch(); 40008c1c: 40 00 10 51 call 4000cd60 <_Thread_Enable_dispatch> 40008c20: b0 10 20 00 clr %i0 40008c24: 81 c7 e0 08 ret 40008c28: 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 ); 40008c2c: 40 00 01 b6 call 40009304 40008c30: 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 ) 40008c34: 10 bf ff de b 40008bac 40008c38: c2 06 40 00 ld [ %i1 ], %g1 _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { _Thread_Enable_dispatch(); 40008c3c: 40 00 10 49 call 4000cd60 <_Thread_Enable_dispatch> 40008c40: b0 10 20 0b mov 0xb, %i0 40008c44: 81 c7 e0 08 ret 40008c48: 81 e8 00 00 restore =============================================================================== 400091a0 : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 400091a0: 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 ) 400091a4: 80 a6 20 00 cmp %i0, 0 400091a8: 02 80 00 25 be 4000923c 400091ac: 92 07 bf fc add %fp, -4, %o1 * * 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 ); 400091b0: 40 00 1a b0 call 4000fc70 <_POSIX_Absolute_timeout_to_ticks> 400091b4: 90 10 00 19 mov %i1, %o0 400091b8: d2 06 00 00 ld [ %i0 ], %o1 400091bc: ba 10 00 08 mov %o0, %i5 400091c0: 94 07 bf f8 add %fp, -8, %o2 400091c4: 11 10 00 6f sethi %hi(0x4001bc00), %o0 400091c8: 40 00 0b b8 call 4000c0a8 <_Objects_Get> 400091cc: 90 12 21 94 or %o0, 0x194, %o0 ! 4001bd94 <_POSIX_RWLock_Information> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 400091d0: c2 07 bf f8 ld [ %fp + -8 ], %g1 400091d4: 80 a0 60 00 cmp %g1, 0 400091d8: 32 80 00 1a bne,a 40009240 400091dc: b0 10 20 16 mov 0x16, %i0 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 400091e0: d2 06 00 00 ld [ %i0 ], %o1 400091e4: d6 07 bf fc ld [ %fp + -4 ], %o3 * 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 ) 400091e8: 82 1f 60 03 xor %i5, 3, %g1 the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 400091ec: 90 02 20 10 add %o0, 0x10, %o0 400091f0: 80 a0 00 01 cmp %g0, %g1 400091f4: 98 10 20 00 clr %o4 400091f8: b8 60 3f ff subx %g0, -1, %i4 400091fc: 40 00 07 f6 call 4000b1d4 <_CORE_RWLock_Obtain_for_reading> 40009200: 94 10 00 1c mov %i4, %o2 do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 40009204: 40 00 0f 60 call 4000cf84 <_Thread_Enable_dispatch> 40009208: 01 00 00 00 nop if ( !do_wait ) { if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 4000920c: 03 10 00 70 sethi %hi(0x4001c000), %g1 40009210: c2 00 60 f0 ld [ %g1 + 0xf0 ], %g1 ! 4001c0f0 <_Per_CPU_Information+0x10> ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait ) { 40009214: 80 a7 20 00 cmp %i4, 0 40009218: 12 80 00 05 bne 4000922c 4000921c: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 40009220: 80 a2 20 02 cmp %o0, 2 40009224: 02 80 00 09 be 40009248 40009228: 80 a7 60 00 cmp %i5, 0 status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 4000922c: 40 00 00 3f call 40009328 <_POSIX_RWLock_Translate_core_RWLock_return_code> 40009230: 01 00 00 00 nop 40009234: 81 c7 e0 08 ret 40009238: 91 e8 00 08 restore %g0, %o0, %o0 #endif case OBJECTS_ERROR: break; } return EINVAL; 4000923c: b0 10 20 16 mov 0x16, %i0 } 40009240: 81 c7 e0 08 ret 40009244: 81 e8 00 00 restore ); _Thread_Enable_dispatch(); if ( !do_wait ) { if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 40009248: 22 bf ff fe be,a 40009240 <== NEVER TAKEN 4000924c: b0 10 20 16 mov 0x16, %i0 <== NOT EXECUTED return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 40009250: ba 07 7f ff add %i5, -1, %i5 40009254: 80 a7 60 01 cmp %i5, 1 40009258: 18 bf ff f5 bgu 4000922c <== NEVER TAKEN 4000925c: b0 10 20 74 mov 0x74, %i0 40009260: 30 bf ff f8 b,a 40009240 =============================================================================== 40009264 : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 40009264: 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 ) 40009268: 80 a6 20 00 cmp %i0, 0 4000926c: 02 80 00 25 be 40009300 40009270: 92 07 bf fc add %fp, -4, %o1 * * 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 ); 40009274: 40 00 1a 7f call 4000fc70 <_POSIX_Absolute_timeout_to_ticks> 40009278: 90 10 00 19 mov %i1, %o0 4000927c: d2 06 00 00 ld [ %i0 ], %o1 40009280: ba 10 00 08 mov %o0, %i5 40009284: 94 07 bf f8 add %fp, -8, %o2 40009288: 11 10 00 6f sethi %hi(0x4001bc00), %o0 4000928c: 40 00 0b 87 call 4000c0a8 <_Objects_Get> 40009290: 90 12 21 94 or %o0, 0x194, %o0 ! 4001bd94 <_POSIX_RWLock_Information> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 40009294: c2 07 bf f8 ld [ %fp + -8 ], %g1 40009298: 80 a0 60 00 cmp %g1, 0 4000929c: 32 80 00 1a bne,a 40009304 400092a0: b0 10 20 16 mov 0x16, %i0 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 400092a4: d2 06 00 00 ld [ %i0 ], %o1 400092a8: d6 07 bf fc ld [ %fp + -4 ], %o3 * 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 ) 400092ac: 82 1f 60 03 xor %i5, 3, %g1 the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 400092b0: 90 02 20 10 add %o0, 0x10, %o0 400092b4: 80 a0 00 01 cmp %g0, %g1 400092b8: 98 10 20 00 clr %o4 400092bc: b8 60 3f ff subx %g0, -1, %i4 400092c0: 40 00 07 fa call 4000b2a8 <_CORE_RWLock_Obtain_for_writing> 400092c4: 94 10 00 1c mov %i4, %o2 do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 400092c8: 40 00 0f 2f call 4000cf84 <_Thread_Enable_dispatch> 400092cc: 01 00 00 00 nop if ( !do_wait && (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 400092d0: 03 10 00 70 sethi %hi(0x4001c000), %g1 400092d4: c2 00 60 f0 ld [ %g1 + 0xf0 ], %g1 ! 4001c0f0 <_Per_CPU_Information+0x10> ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait && 400092d8: 80 a7 20 00 cmp %i4, 0 400092dc: 12 80 00 05 bne 400092f0 400092e0: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 400092e4: 80 a2 20 02 cmp %o0, 2 400092e8: 02 80 00 09 be 4000930c 400092ec: 80 a7 60 00 cmp %i5, 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( 400092f0: 40 00 00 0e call 40009328 <_POSIX_RWLock_Translate_core_RWLock_return_code> 400092f4: 01 00 00 00 nop 400092f8: 81 c7 e0 08 ret 400092fc: 91 e8 00 08 restore %g0, %o0, %o0 #endif case OBJECTS_ERROR: break; } return EINVAL; 40009300: b0 10 20 16 mov 0x16, %i0 } 40009304: 81 c7 e0 08 ret 40009308: 81 e8 00 00 restore ); _Thread_Enable_dispatch(); if ( !do_wait && (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 4000930c: 22 bf ff fe be,a 40009304 <== NEVER TAKEN 40009310: b0 10 20 16 mov 0x16, %i0 <== NOT EXECUTED return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 40009314: ba 07 7f ff add %i5, -1, %i5 40009318: 80 a7 60 01 cmp %i5, 1 4000931c: 18 bf ff f5 bgu 400092f0 <== NEVER TAKEN 40009320: b0 10 20 74 mov 0x74, %i0 40009324: 30 bf ff f8 b,a 40009304 =============================================================================== 40009b40 : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { 40009b40: 82 10 00 08 mov %o0, %g1 if ( !attr ) 40009b44: 80 a0 60 00 cmp %g1, 0 40009b48: 02 80 00 06 be 40009b60 40009b4c: 90 10 20 16 mov 0x16, %o0 return EINVAL; if ( !attr->is_initialized ) 40009b50: c4 00 40 00 ld [ %g1 ], %g2 40009b54: 80 a0 a0 00 cmp %g2, 0 40009b58: 12 80 00 04 bne 40009b68 40009b5c: 80 a2 60 01 cmp %o1, 1 return 0; default: return EINVAL; } } 40009b60: 81 c3 e0 08 retl 40009b64: 01 00 00 00 nop return EINVAL; if ( !attr->is_initialized ) return EINVAL; switch ( pshared ) { 40009b68: 18 bf ff fe bgu 40009b60 <== NEVER TAKEN 40009b6c: 01 00 00 00 nop case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 40009b70: d2 20 60 04 st %o1, [ %g1 + 4 ] return 0; default: return EINVAL; } } 40009b74: 81 c3 e0 08 retl 40009b78: 90 10 20 00 clr %o0 =============================================================================== 4000ac00 : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 4000ac00: 9d e3 bf 90 save %sp, -112, %sp int rc; /* * Check all the parameters */ if ( !param ) 4000ac04: 80 a6 a0 00 cmp %i2, 0 4000ac08: 02 80 00 0a be 4000ac30 4000ac0c: ba 10 20 16 mov 0x16, %i5 return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 4000ac10: 90 10 00 19 mov %i1, %o0 4000ac14: 92 10 00 1a mov %i2, %o1 4000ac18: 94 07 bf f4 add %fp, -12, %o2 4000ac1c: 40 00 18 82 call 40010e24 <_POSIX_Thread_Translate_sched_param> 4000ac20: 96 07 bf f8 add %fp, -8, %o3 policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 4000ac24: ba 92 20 00 orcc %o0, 0, %i5 4000ac28: 02 80 00 05 be 4000ac3c 4000ac2c: 90 10 00 18 mov %i0, %o0 case OBJECTS_ERROR: break; } return ESRCH; } 4000ac30: b0 10 00 1d mov %i5, %i0 4000ac34: 81 c7 e0 08 ret 4000ac38: 81 e8 00 00 restore return rc; /* * Actually change the scheduling policy and parameters */ the_thread = _Thread_Get( thread, &location ); 4000ac3c: 40 00 0c b3 call 4000df08 <_Thread_Get> 4000ac40: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000ac44: c2 07 bf fc ld [ %fp + -4 ], %g1 4000ac48: 80 a0 60 00 cmp %g1, 0 4000ac4c: 12 80 00 2b bne 4000acf8 4000ac50: b6 10 00 08 mov %o0, %i3 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000ac54: f8 02 21 50 ld [ %o0 + 0x150 ], %i4 if ( api->schedpolicy == SCHED_SPORADIC ) 4000ac58: c2 07 20 84 ld [ %i4 + 0x84 ], %g1 4000ac5c: 80 a0 60 04 cmp %g1, 4 4000ac60: 02 80 00 35 be 4000ad34 4000ac64: 01 00 00 00 nop (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; 4000ac68: c2 06 80 00 ld [ %i2 ], %g1 the_thread->budget_algorithm = budget_algorithm; the_thread->budget_callout = budget_callout; switch ( api->schedpolicy ) { 4000ac6c: 80 a6 60 00 cmp %i1, 0 if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; 4000ac70: c2 27 20 88 st %g1, [ %i4 + 0x88 ] 4000ac74: c4 06 a0 04 ld [ %i2 + 4 ], %g2 4000ac78: c4 27 20 8c st %g2, [ %i4 + 0x8c ] 4000ac7c: c4 06 a0 08 ld [ %i2 + 8 ], %g2 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; 4000ac80: f2 27 20 84 st %i1, [ %i4 + 0x84 ] api->schedparam = *param; 4000ac84: c4 27 20 90 st %g2, [ %i4 + 0x90 ] 4000ac88: c4 06 a0 0c ld [ %i2 + 0xc ], %g2 4000ac8c: c4 27 20 94 st %g2, [ %i4 + 0x94 ] 4000ac90: c4 06 a0 10 ld [ %i2 + 0x10 ], %g2 4000ac94: c4 27 20 98 st %g2, [ %i4 + 0x98 ] 4000ac98: c4 06 a0 14 ld [ %i2 + 0x14 ], %g2 4000ac9c: c4 27 20 9c st %g2, [ %i4 + 0x9c ] 4000aca0: c4 06 a0 18 ld [ %i2 + 0x18 ], %g2 4000aca4: c4 27 20 a0 st %g2, [ %i4 + 0xa0 ] the_thread->budget_algorithm = budget_algorithm; 4000aca8: c4 07 bf f4 ld [ %fp + -12 ], %g2 4000acac: c4 26 e0 78 st %g2, [ %i3 + 0x78 ] the_thread->budget_callout = budget_callout; 4000acb0: c4 07 bf f8 ld [ %fp + -8 ], %g2 switch ( api->schedpolicy ) { 4000acb4: 06 80 00 0e bl 4000acec <== NEVER TAKEN 4000acb8: c4 26 e0 7c st %g2, [ %i3 + 0x7c ] 4000acbc: 80 a6 60 02 cmp %i1, 2 4000acc0: 04 80 00 11 ble 4000ad04 4000acc4: 07 10 00 71 sethi %hi(0x4001c400), %g3 4000acc8: 80 a6 60 04 cmp %i1, 4 4000accc: 12 80 00 08 bne 4000acec <== NEVER TAKEN 4000acd0: 01 00 00 00 nop true ); break; case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 4000acd4: c2 27 20 a4 st %g1, [ %i4 + 0xa4 ] _Watchdog_Remove( &api->Sporadic_timer ); 4000acd8: 40 00 10 b0 call 4000ef98 <_Watchdog_Remove> 4000acdc: 90 07 20 a8 add %i4, 0xa8, %o0 _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 4000ace0: 90 10 20 00 clr %o0 4000ace4: 7f ff ff 7b call 4000aad0 <_POSIX_Threads_Sporadic_budget_TSR> 4000ace8: 92 10 00 1b mov %i3, %o1 break; } _Thread_Enable_dispatch(); 4000acec: 40 00 0c 7b call 4000ded8 <_Thread_Enable_dispatch> 4000acf0: b0 10 00 1d mov %i5, %i0 4000acf4: 30 bf ff d0 b,a 4000ac34 #endif case OBJECTS_ERROR: break; } return ESRCH; 4000acf8: ba 10 20 03 mov 3, %i5 } 4000acfc: 81 c7 e0 08 ret 4000ad00: 91 e8 00 1d restore %g0, %i5, %o0 4000ad04: d2 08 e2 6c ldub [ %g3 + 0x26c ], %o1 switch ( api->schedpolicy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 4000ad08: 05 10 00 74 sethi %hi(0x4001d000), %g2 4000ad0c: c4 00 a3 d0 ld [ %g2 + 0x3d0 ], %g2 ! 4001d3d0 <_Thread_Ticks_per_timeslice> 4000ad10: 92 22 40 01 sub %o1, %g1, %o1 the_thread->real_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 4000ad14: 90 10 00 1b mov %i3, %o0 4000ad18: 94 10 20 01 mov 1, %o2 switch ( api->schedpolicy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 4000ad1c: c4 26 e0 74 st %g2, [ %i3 + 0x74 ] the_thread->real_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 4000ad20: 40 00 0b 34 call 4000d9f0 <_Thread_Change_priority> 4000ad24: d2 26 e0 18 st %o1, [ %i3 + 0x18 ] _Watchdog_Remove( &api->Sporadic_timer ); _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); break; } _Thread_Enable_dispatch(); 4000ad28: 40 00 0c 6c call 4000ded8 <_Thread_Enable_dispatch> 4000ad2c: b0 10 00 1d mov %i5, %i0 4000ad30: 30 bf ff c1 b,a 4000ac34 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); 4000ad34: 40 00 10 99 call 4000ef98 <_Watchdog_Remove> 4000ad38: 90 07 20 a8 add %i4, 0xa8, %o0 api->schedpolicy = policy; api->schedparam = *param; 4000ad3c: 10 bf ff cc b 4000ac6c 4000ad40: c2 06 80 00 ld [ %i2 ], %g1 =============================================================================== 40008598 : /* * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 40008598: 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() ) 4000859c: 3b 10 00 67 sethi %hi(0x40019c00), %i5 400085a0: ba 17 63 10 or %i5, 0x310, %i5 ! 40019f10 <_Per_CPU_Information> 400085a4: c2 07 60 08 ld [ %i5 + 8 ], %g1 400085a8: 80 a0 60 00 cmp %g1, 0 400085ac: 12 80 00 16 bne 40008604 <== NEVER TAKEN 400085b0: 03 10 00 66 sethi %hi(0x40019800), %g1 return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 400085b4: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 400085b8: c6 00 62 00 ld [ %g1 + 0x200 ], %g3 400085bc: c4 00 a1 50 ld [ %g2 + 0x150 ], %g2 ++level; 400085c0: 86 00 e0 01 inc %g3 _Thread_Dispatch_disable_level = level; 400085c4: c6 20 62 00 st %g3, [ %g1 + 0x200 ] _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 400085c8: c2 00 a0 d8 ld [ %g2 + 0xd8 ], %g1 400085cc: 80 a0 60 00 cmp %g1, 0 400085d0: 12 80 00 0b bne 400085fc <== NEVER TAKEN 400085d4: 01 00 00 00 nop 400085d8: c2 00 a0 e0 ld [ %g2 + 0xe0 ], %g1 400085dc: 80 a0 60 00 cmp %g1, 0 400085e0: 02 80 00 07 be 400085fc 400085e4: 01 00 00 00 nop thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 400085e8: 40 00 0c 26 call 4000b680 <_Thread_Enable_dispatch> 400085ec: b2 10 3f ff mov -1, %i1 ! ffffffff if ( cancel ) _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 400085f0: f0 07 60 10 ld [ %i5 + 0x10 ], %i0 400085f4: 40 00 18 1f call 4000e670 <_POSIX_Thread_Exit> 400085f8: 81 e8 00 00 restore _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 400085fc: 40 00 0c 21 call 4000b680 <_Thread_Enable_dispatch> 40008600: 81 e8 00 00 restore 40008604: 81 c7 e0 08 ret <== NOT EXECUTED 40008608: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40008af4 : * errno - otherwise */ int rtems_aio_enqueue (rtems_aio_request *req) { 40008af4: 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); 40008af8: 39 10 00 68 sethi %hi(0x4001a000), %i4 40008afc: 40 00 02 7b call 400094e8 40008b00: 90 17 23 cc or %i4, 0x3cc, %o0 ! 4001a3cc if (result != 0) { 40008b04: b6 92 20 00 orcc %o0, 0, %i3 40008b08: 12 80 00 31 bne 40008bcc <== NEVER TAKEN 40008b0c: 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); 40008b10: 40 00 04 b6 call 40009de8 40008b14: b2 17 23 cc or %i4, 0x3cc, %i1 40008b18: 92 07 bf e0 add %fp, -32, %o1 40008b1c: 40 00 03 a8 call 400099bc 40008b20: 94 07 bf e4 add %fp, -28, %o2 req->caller_thread = pthread_self (); 40008b24: 40 00 04 b1 call 40009de8 40008b28: 01 00 00 00 nop req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 40008b2c: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 req->policy = policy; 40008b30: c6 07 bf e0 ld [ %fp + -32 ], %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; 40008b34: c4 00 60 18 ld [ %g1 + 0x18 ], %g2 req->policy = policy; 40008b38: 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; 40008b3c: c6 07 bf e4 ld [ %fp + -28 ], %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 (); 40008b40: d0 26 20 10 st %o0, [ %i0 + 0x10 ] req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 40008b44: 84 20 c0 02 sub %g3, %g2, %g2 40008b48: 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) && 40008b4c: c4 06 60 68 ld [ %i1 + 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; 40008b50: 86 10 20 77 mov 0x77, %g3 req->aiocbp->return_value = 0; 40008b54: 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; 40008b58: c6 20 60 34 st %g3, [ %g1 + 0x34 ] req->aiocbp->return_value = 0; if ((aio_request_queue.idle_threads == 0) && 40008b5c: 80 a0 a0 00 cmp %g2, 0 40008b60: 12 80 00 06 bne 40008b78 <== NEVER TAKEN 40008b64: d2 00 40 00 ld [ %g1 ], %o1 40008b68: c4 06 60 64 ld [ %i1 + 0x64 ], %g2 40008b6c: 80 a0 a0 04 cmp %g2, 4 40008b70: 24 80 00 1b ble,a 40008bdc 40008b74: 90 06 60 48 add %i1, 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, 40008b78: 94 10 20 00 clr %o2 40008b7c: 11 10 00 69 sethi %hi(0x4001a400), %o0 40008b80: 7f ff ff 78 call 40008960 40008b84: 90 12 20 14 or %o0, 0x14, %o0 ! 4001a414 req->aiocbp->aio_fildes, 0); if (r_chain != NULL) 40008b88: b4 92 20 00 orcc %o0, 0, %i2 40008b8c: 22 80 00 31 be,a 40008c50 40008b90: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 { pthread_mutex_lock (&r_chain->mutex); 40008b94: b2 06 a0 1c add %i2, 0x1c, %i1 40008b98: 40 00 02 54 call 400094e8 40008b9c: 90 10 00 19 mov %i1, %o0 rtems_aio_insert_prio (&r_chain->perfd, req); 40008ba0: 90 06 a0 08 add %i2, 8, %o0 40008ba4: 7f ff ff 12 call 400087ec 40008ba8: 92 10 00 18 mov %i0, %o1 pthread_cond_signal (&r_chain->cond); 40008bac: 40 00 01 2c call 4000905c 40008bb0: 90 06 a0 20 add %i2, 0x20, %o0 pthread_mutex_unlock (&r_chain->mutex); 40008bb4: 40 00 02 6d call 40009568 40008bb8: 90 10 00 19 mov %i1, %o0 if (aio_request_queue.idle_threads > 0) pthread_cond_signal (&aio_request_queue.new_req); } } pthread_mutex_unlock (&aio_request_queue.mutex); 40008bbc: 40 00 02 6b call 40009568 40008bc0: 90 17 23 cc or %i4, 0x3cc, %o0 return 0; } 40008bc4: 81 c7 e0 08 ret 40008bc8: 91 e8 00 1b restore %g0, %i3, %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); 40008bcc: 7f ff ee 44 call 400044dc <== NOT EXECUTED 40008bd0: b0 10 00 1b mov %i3, %i0 <== NOT EXECUTED } } pthread_mutex_unlock (&aio_request_queue.mutex); return 0; } 40008bd4: 81 c7 e0 08 ret <== NOT EXECUTED 40008bd8: 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); 40008bdc: 7f ff ff 61 call 40008960 40008be0: 94 10 20 01 mov 1, %o2 if (r_chain->new_fd == 1) { 40008be4: c2 02 20 18 ld [ %o0 + 0x18 ], %g1 40008be8: 80 a0 60 01 cmp %g1, 1 40008bec: 12 bf ff ea bne 40008b94 40008bf0: 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); 40008bf4: 90 02 20 08 add %o0, 8, %o0 40008bf8: 40 00 09 44 call 4000b108 <_Chain_Insert> 40008bfc: 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); 40008c00: 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; 40008c04: c0 26 a0 18 clr [ %i2 + 0x18 ] pthread_mutex_init (&r_chain->mutex, NULL); 40008c08: 40 00 01 df call 40009384 40008c0c: 90 06 a0 1c add %i2, 0x1c, %o0 pthread_cond_init (&r_chain->cond, NULL); 40008c10: 92 10 20 00 clr %o1 40008c14: 40 00 00 e3 call 40008fa0 40008c18: 90 06 a0 20 add %i2, 0x20, %o0 AIO_printf ("New thread \n"); result = pthread_create (&thid, &aio_request_queue.attr, 40008c1c: 90 07 bf dc add %fp, -36, %o0 40008c20: 92 06 60 08 add %i1, 8, %o1 40008c24: 96 10 00 1a mov %i2, %o3 40008c28: 15 10 00 21 sethi %hi(0x40008400), %o2 40008c2c: 40 00 02 c4 call 4000973c 40008c30: 94 12 a1 40 or %o2, 0x140, %o2 ! 40008540 rtems_aio_handle, (void *) r_chain); if (result != 0) { 40008c34: 82 92 20 00 orcc %o0, 0, %g1 40008c38: 12 80 00 25 bne 40008ccc <== NEVER TAKEN 40008c3c: 90 10 00 19 mov %i1, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); return result; } ++aio_request_queue.active_threads; 40008c40: c2 06 60 64 ld [ %i1 + 0x64 ], %g1 40008c44: 82 00 60 01 inc %g1 40008c48: 10 bf ff dd b 40008bbc 40008c4c: c2 26 60 64 st %g1, [ %i1 + 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); 40008c50: 11 10 00 69 sethi %hi(0x4001a400), %o0 40008c54: d2 00 40 00 ld [ %g1 ], %o1 40008c58: 90 12 20 20 or %o0, 0x20, %o0 40008c5c: 7f ff ff 41 call 40008960 40008c60: 94 10 20 01 mov 1, %o2 if (r_chain->new_fd == 1) { 40008c64: 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); 40008c68: b4 10 00 08 mov %o0, %i2 40008c6c: 92 10 00 18 mov %i0, %o1 if (r_chain->new_fd == 1) { 40008c70: 80 a0 60 01 cmp %g1, 1 40008c74: 02 80 00 0b be 40008ca0 40008c78: 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); 40008c7c: 7f ff fe dc call 400087ec 40008c80: 01 00 00 00 nop if (aio_request_queue.idle_threads > 0) 40008c84: c2 06 60 68 ld [ %i1 + 0x68 ], %g1 40008c88: 80 a0 60 00 cmp %g1, 0 40008c8c: 04 bf ff cc ble 40008bbc <== ALWAYS TAKEN 40008c90: 01 00 00 00 nop pthread_cond_signal (&aio_request_queue.new_req); 40008c94: 40 00 00 f2 call 4000905c <== NOT EXECUTED 40008c98: 90 06 60 04 add %i1, 4, %o0 <== NOT EXECUTED 40008c9c: 30 bf ff c8 b,a 40008bbc <== NOT EXECUTED 40008ca0: 40 00 09 1a call 4000b108 <_Chain_Insert> 40008ca4: 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); 40008ca8: 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; 40008cac: c0 26 a0 18 clr [ %i2 + 0x18 ] pthread_mutex_init (&r_chain->mutex, NULL); 40008cb0: 40 00 01 b5 call 40009384 40008cb4: 92 10 20 00 clr %o1 pthread_cond_init (&r_chain->cond, NULL); 40008cb8: 90 06 a0 20 add %i2, 0x20, %o0 40008cbc: 40 00 00 b9 call 40008fa0 40008cc0: 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) 40008cc4: 10 bf ff f1 b 40008c88 40008cc8: c2 06 60 68 ld [ %i1 + 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); 40008ccc: 40 00 02 27 call 40009568 <== NOT EXECUTED 40008cd0: b6 10 00 01 mov %g1, %i3 <== NOT EXECUTED 40008cd4: 30 bf ff bc b,a 40008bc4 <== NOT EXECUTED =============================================================================== 40008540 : * NULL - if error */ static void * rtems_aio_handle (void *arg) { 40008540: 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); 40008544: 35 10 00 68 sethi %hi(0x4001a000), %i2 40008548: b6 06 20 1c add %i0, 0x1c, %i3 4000854c: b4 16 a3 cc or %i2, 0x3cc, %i2 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, 40008550: a0 10 00 1a mov %i2, %l0 40008554: a2 10 00 1a mov %i2, %l1 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)) { 40008558: a4 06 a0 58 add %i2, 0x58, %l2 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 && 4000855c: b2 06 a0 4c add %i2, 0x4c, %i1 /* 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); 40008560: 40 00 03 e2 call 400094e8 40008564: 90 10 00 1b mov %i3, %o0 if (result != 0) 40008568: 80 a2 20 00 cmp %o0, 0 4000856c: 12 80 00 2b bne 40008618 <== NEVER TAKEN 40008570: 01 00 00 00 nop 40008574: 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 ); 40008578: 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)) { 4000857c: 80 a7 40 01 cmp %i5, %g1 40008580: 02 80 00 41 be 40008684 40008584: 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); 40008588: 40 00 06 18 call 40009de8 4000858c: 01 00 00 00 nop 40008590: 92 07 bf d8 add %fp, -40, %o1 40008594: 40 00 05 0a call 400099bc 40008598: 94 07 bf e4 add %fp, -28, %o2 param.sched_priority = req->priority; 4000859c: c2 07 60 0c ld [ %i5 + 0xc ], %g1 pthread_setschedparam (pthread_self(), req->policy, ¶m); 400085a0: 40 00 06 12 call 40009de8 400085a4: c2 27 bf e4 st %g1, [ %fp + -28 ] 400085a8: d2 07 60 08 ld [ %i5 + 8 ], %o1 400085ac: 40 00 06 13 call 40009df8 400085b0: 94 07 bf e4 add %fp, -28, %o2 400085b4: 40 00 0a bc call 4000b0a4 <_Chain_Extract> 400085b8: 90 10 00 1d mov %i5, %o0 rtems_chain_extract (node); pthread_mutex_unlock (&r_chain->mutex); 400085bc: 40 00 03 eb call 40009568 400085c0: 90 10 00 1b mov %i3, %o0 switch (req->aiocbp->aio_lio_opcode) { 400085c4: f8 07 60 14 ld [ %i5 + 0x14 ], %i4 400085c8: c2 07 20 30 ld [ %i4 + 0x30 ], %g1 400085cc: 80 a0 60 02 cmp %g1, 2 400085d0: 22 80 00 25 be,a 40008664 400085d4: c4 1f 20 08 ldd [ %i4 + 8 ], %g2 400085d8: 80 a0 60 03 cmp %g1, 3 400085dc: 02 80 00 1e be 40008654 <== NEVER TAKEN 400085e0: 01 00 00 00 nop 400085e4: 80 a0 60 01 cmp %g1, 1 400085e8: 22 80 00 0e be,a 40008620 <== ALWAYS TAKEN 400085ec: c4 1f 20 08 ldd [ %i4 + 8 ], %g2 default: result = -1; } if (result == -1) { req->aiocbp->return_value = -1; 400085f0: 82 10 3f ff mov -1, %g1 <== NOT EXECUTED req->aiocbp->error_code = errno; 400085f4: 40 00 29 13 call 40012a40 <__errno> <== NOT EXECUTED 400085f8: c2 27 20 38 st %g1, [ %i4 + 0x38 ] <== NOT EXECUTED 400085fc: 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); 40008600: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED 40008604: 40 00 03 b9 call 400094e8 <== NOT EXECUTED 40008608: c2 27 20 34 st %g1, [ %i4 + 0x34 ] <== NOT EXECUTED if (result != 0) 4000860c: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 40008610: 22 bf ff da be,a 40008578 <== NOT EXECUTED 40008614: fa 06 20 08 ld [ %i0 + 8 ], %i5 <== NOT EXECUTED } } AIO_printf ("Thread finished\n"); return NULL; } 40008618: 81 c7 e0 08 ret 4000861c: 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, 40008620: d0 07 00 00 ld [ %i4 ], %o0 40008624: d2 07 20 10 ld [ %i4 + 0x10 ], %o1 40008628: d4 07 20 14 ld [ %i4 + 0x14 ], %o2 4000862c: 96 10 00 02 mov %g2, %o3 40008630: 40 00 2b f0 call 400135f0 40008634: 98 10 00 03 mov %g3, %o4 break; default: result = -1; } if (result == -1) { 40008638: 80 a2 3f ff cmp %o0, -1 4000863c: 22 bf ff ed be,a 400085f0 <== NEVER TAKEN 40008640: f8 07 60 14 ld [ %i5 + 0x14 ], %i4 <== NOT EXECUTED req->aiocbp->return_value = -1; req->aiocbp->error_code = errno; } else { req->aiocbp->return_value = result; 40008644: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 40008648: d0 20 60 38 st %o0, [ %g1 + 0x38 ] req->aiocbp->error_code = 0; 4000864c: 10 bf ff c5 b 40008560 40008650: 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); 40008654: 40 00 1b 79 call 4000f438 <== NOT EXECUTED 40008658: d0 07 00 00 ld [ %i4 ], %o0 <== NOT EXECUTED break; 4000865c: 10 bf ff f8 b 4000863c <== NOT EXECUTED 40008660: 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, 40008664: d0 07 00 00 ld [ %i4 ], %o0 40008668: d2 07 20 10 ld [ %i4 + 0x10 ], %o1 4000866c: d4 07 20 14 ld [ %i4 + 0x14 ], %o2 40008670: 96 10 00 02 mov %g2, %o3 40008674: 40 00 2c 1d call 400136e8 40008678: 98 10 00 03 mov %g3, %o4 (void *) req->aiocbp->aio_buf, req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; 4000867c: 10 bf ff f0 b 4000863c 40008680: 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); 40008684: 40 00 03 b9 call 40009568 40008688: 90 10 00 1b mov %i3, %o0 pthread_mutex_lock (&aio_request_queue.mutex); 4000868c: 40 00 03 97 call 400094e8 40008690: 90 10 00 1a mov %i2, %o0 if (rtems_chain_is_empty (chain)) 40008694: c2 06 20 08 ld [ %i0 + 8 ], %g1 40008698: 80 a7 40 01 cmp %i5, %g1 4000869c: 02 80 00 05 be 400086b0 <== ALWAYS TAKEN 400086a0: 92 07 bf dc add %fp, -36, %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); 400086a4: 40 00 03 b1 call 40009568 400086a8: 90 10 00 1a mov %i2, %o0 400086ac: 30 bf ff ad b,a 40008560 pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); 400086b0: 40 00 01 d3 call 40008dfc 400086b4: 90 10 20 01 mov 1, %o0 timeout.tv_sec += 3; 400086b8: c2 07 bf dc ld [ %fp + -36 ], %g1 timeout.tv_nsec = 0; 400086bc: c0 27 bf e0 clr [ %fp + -32 ] pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 400086c0: 82 00 60 03 add %g1, 3, %g1 timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 400086c4: 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; 400086c8: c2 27 bf dc st %g1, [ %fp + -36 ] timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 400086cc: 90 10 00 1d mov %i5, %o0 400086d0: 92 10 00 10 mov %l0, %o1 400086d4: 40 00 02 7e call 400090cc 400086d8: 94 07 bf dc add %fp, -36, %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) { 400086dc: 80 a2 20 74 cmp %o0, 0x74 400086e0: 12 bf ff f1 bne 400086a4 <== NEVER TAKEN 400086e4: 01 00 00 00 nop 400086e8: 40 00 0a 6f call 4000b0a4 <_Chain_Extract> 400086ec: 90 10 00 18 mov %i0, %o0 rtems_chain_extract (&r_chain->next_fd); pthread_mutex_destroy (&r_chain->mutex); 400086f0: 40 00 02 d2 call 40009238 400086f4: 90 10 00 1b mov %i3, %o0 pthread_cond_destroy (&r_chain->cond); 400086f8: 40 00 01 f4 call 40008ec8 400086fc: 90 10 00 1d mov %i5, %o0 free (r_chain); 40008700: 7f ff ef 77 call 400044dc 40008704: 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; 40008708: f0 06 a0 54 ld [ %i2 + 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)) { 4000870c: 80 a6 00 12 cmp %i0, %l2 40008710: 22 80 00 1d be,a 40008784 40008714: c4 06 a0 68 ld [ %i2 + 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; 40008718: c4 04 60 68 ld [ %l1 + 0x68 ], %g2 ++aio_request_queue.active_threads; 4000871c: c2 04 60 64 ld [ %l1 + 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; 40008720: 84 00 bf ff add %g2, -1, %g2 ++aio_request_queue.active_threads; 40008724: 82 00 60 01 inc %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; 40008728: c4 24 60 68 st %g2, [ %l1 + 0x68 ] ++aio_request_queue.active_threads; 4000872c: c2 24 60 64 st %g1, [ %l1 + 0x64 ] 40008730: 40 00 0a 5d call 4000b0a4 <_Chain_Extract> 40008734: 90 10 00 18 mov %i0, %o0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 40008738: c2 04 60 48 ld [ %l1 + 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 && 4000873c: c6 06 20 14 ld [ %i0 + 0x14 ], %g3 40008740: c4 00 60 14 ld [ %g1 + 0x14 ], %g2 40008744: 80 a0 c0 02 cmp %g3, %g2 40008748: 14 80 00 08 bg 40008768 <== ALWAYS TAKEN 4000874c: 80 a0 40 19 cmp %g1, %i1 RTEMS_INLINE_ROUTINE void rtems_chain_insert( rtems_chain_node *after_node, rtems_chain_node *the_node ) { _Chain_Insert( after_node, the_node ); 40008750: 10 80 00 09 b 40008774 <== NOT EXECUTED 40008754: d0 00 60 04 ld [ %g1 + 4 ], %o0 <== NOT EXECUTED 40008758: c4 00 60 14 ld [ %g1 + 0x14 ], %g2 4000875c: 80 a0 80 03 cmp %g2, %g3 40008760: 16 80 00 04 bge 40008770 40008764: 80 a0 40 19 cmp %g1, %i1 40008768: 32 bf ff fc bne,a 40008758 <== ALWAYS TAKEN 4000876c: c2 00 40 00 ld [ %g1 ], %g1 40008770: d0 00 60 04 ld [ %g1 + 4 ], %o0 40008774: 92 10 00 18 mov %i0, %o1 40008778: 40 00 0a 64 call 4000b108 <_Chain_Insert> 4000877c: b6 06 20 1c add %i0, 0x1c, %i3 40008780: 30 bf ff c9 b,a 400086a4 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; 40008784: c2 06 a0 64 ld [ %i2 + 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; 40008788: 84 00 a0 01 inc %g2 --aio_request_queue.active_threads; 4000878c: 82 00 7f ff add %g1, -1, %g1 clock_gettime (CLOCK_REALTIME, &timeout); 40008790: 92 07 bf dc add %fp, -36, %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; 40008794: c4 26 a0 68 st %g2, [ %i2 + 0x68 ] --aio_request_queue.active_threads; 40008798: c2 26 a0 64 st %g1, [ %i2 + 0x64 ] clock_gettime (CLOCK_REALTIME, &timeout); 4000879c: 40 00 01 98 call 40008dfc 400087a0: 90 10 20 01 mov 1, %o0 timeout.tv_sec += 3; 400087a4: c2 07 bf dc ld [ %fp + -36 ], %g1 timeout.tv_nsec = 0; 400087a8: c0 27 bf e0 clr [ %fp + -32 ] 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; 400087ac: 82 00 60 03 add %g1, 3, %g1 timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 400087b0: 90 06 a0 04 add %i2, 4, %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; 400087b4: c2 27 bf dc st %g1, [ %fp + -36 ] timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 400087b8: 92 10 00 1a mov %i2, %o1 400087bc: 40 00 02 44 call 400090cc 400087c0: 94 07 bf dc add %fp, -36, %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) { 400087c4: 80 a2 20 74 cmp %o0, 0x74 400087c8: 22 80 00 04 be,a 400087d8 <== ALWAYS TAKEN 400087cc: c2 06 a0 68 ld [ %i2 + 0x68 ], %g1 400087d0: 10 bf ff d2 b 40008718 <== NOT EXECUTED 400087d4: f0 06 a0 54 ld [ %i2 + 0x54 ], %i0 <== NOT EXECUTED AIO_printf ("Etimeout\n"); --aio_request_queue.idle_threads; pthread_mutex_unlock (&aio_request_queue.mutex); 400087d8: 90 10 00 1a mov %i2, %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; 400087dc: 82 00 7f ff add %g1, -1, %g1 pthread_mutex_unlock (&aio_request_queue.mutex); 400087e0: 40 00 03 62 call 40009568 400087e4: c2 26 a0 68 st %g1, [ %i2 + 0x68 ] 400087e8: 30 bf ff 8c b,a 40008618 =============================================================================== 40008858 : * 0 - if initialization succeeded */ int rtems_aio_init (void) { 40008858: 9d e3 bf a0 save %sp, -96, %sp int result = 0; result = pthread_attr_init (&aio_request_queue.attr); 4000885c: 3b 10 00 68 sethi %hi(0x4001a000), %i5 40008860: 40 00 03 9c call 400096d0 40008864: 90 17 63 d4 or %i5, 0x3d4, %o0 ! 4001a3d4 if (result != 0) 40008868: b0 92 20 00 orcc %o0, 0, %i0 4000886c: 12 80 00 23 bne 400088f8 <== NEVER TAKEN 40008870: 90 17 63 d4 or %i5, 0x3d4, %o0 return result; result = 40008874: 40 00 03 a3 call 40009700 40008878: 92 10 20 00 clr %o1 pthread_attr_setdetachstate (&aio_request_queue.attr, PTHREAD_CREATE_DETACHED); if (result != 0) 4000887c: 80 a2 20 00 cmp %o0, 0 40008880: 12 80 00 20 bne 40008900 <== NEVER TAKEN 40008884: 39 10 00 68 sethi %hi(0x4001a000), %i4 pthread_attr_destroy (&aio_request_queue.attr); result = pthread_mutex_init (&aio_request_queue.mutex, NULL); 40008888: 92 10 20 00 clr %o1 4000888c: 40 00 02 be call 40009384 40008890: 90 17 23 cc or %i4, 0x3cc, %o0 if (result != 0) 40008894: 80 a2 20 00 cmp %o0, 0 40008898: 12 80 00 23 bne 40008924 <== NEVER TAKEN 4000889c: 92 10 20 00 clr %o1 pthread_attr_destroy (&aio_request_queue.attr); result = pthread_cond_init (&aio_request_queue.new_req, NULL); 400088a0: 11 10 00 68 sethi %hi(0x4001a000), %o0 400088a4: 40 00 01 bf call 40008fa0 400088a8: 90 12 23 d0 or %o0, 0x3d0, %o0 ! 4001a3d0 if (result != 0) { 400088ac: b0 92 20 00 orcc %o0, 0, %i0 400088b0: 12 80 00 26 bne 40008948 <== NEVER TAKEN 400088b4: 01 00 00 00 nop ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 400088b8: 82 17 23 cc or %i4, 0x3cc, %g1 head->previous = NULL; tail->previous = head; 400088bc: 84 00 60 54 add %g1, 0x54, %g2 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 400088c0: ba 00 60 4c add %g1, 0x4c, %i5 head->previous = NULL; tail->previous = head; 400088c4: 88 00 60 48 add %g1, 0x48, %g4 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 400088c8: 86 00 60 58 add %g1, 0x58, %g3 head->previous = NULL; tail->previous = head; 400088cc: c4 20 60 5c st %g2, [ %g1 + 0x5c ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 400088d0: fa 20 60 48 st %i5, [ %g1 + 0x48 ] head->previous = NULL; 400088d4: c0 20 60 4c clr [ %g1 + 0x4c ] tail->previous = head; 400088d8: c8 20 60 50 st %g4, [ %g1 + 0x50 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 400088dc: c6 20 60 54 st %g3, [ %g1 + 0x54 ] head->previous = NULL; 400088e0: c0 20 60 58 clr [ %g1 + 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; 400088e4: c0 20 60 64 clr [ %g1 + 0x64 ] aio_request_queue.idle_threads = 0; 400088e8: c0 20 60 68 clr [ %g1 + 0x68 ] aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 400088ec: 05 00 00 2c sethi %hi(0xb000), %g2 400088f0: 84 10 a0 0b or %g2, 0xb, %g2 ! b00b 400088f4: c4 20 60 60 st %g2, [ %g1 + 0x60 ] return result; } 400088f8: 81 c7 e0 08 ret 400088fc: 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); 40008900: 40 00 03 68 call 400096a0 <== NOT EXECUTED 40008904: 90 17 63 d4 or %i5, 0x3d4, %o0 <== NOT EXECUTED result = pthread_mutex_init (&aio_request_queue.mutex, NULL); 40008908: 39 10 00 68 sethi %hi(0x4001a000), %i4 <== NOT EXECUTED 4000890c: 92 10 20 00 clr %o1 <== NOT EXECUTED 40008910: 40 00 02 9d call 40009384 <== NOT EXECUTED 40008914: 90 17 23 cc or %i4, 0x3cc, %o0 <== NOT EXECUTED if (result != 0) 40008918: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 4000891c: 02 bf ff e1 be 400088a0 <== NOT EXECUTED 40008920: 92 10 20 00 clr %o1 <== NOT EXECUTED pthread_attr_destroy (&aio_request_queue.attr); 40008924: 40 00 03 5f call 400096a0 <== NOT EXECUTED 40008928: 90 17 63 d4 or %i5, 0x3d4, %o0 <== NOT EXECUTED result = pthread_cond_init (&aio_request_queue.new_req, NULL); 4000892c: 92 10 20 00 clr %o1 <== NOT EXECUTED 40008930: 11 10 00 68 sethi %hi(0x4001a000), %o0 <== NOT EXECUTED 40008934: 40 00 01 9b call 40008fa0 <== NOT EXECUTED 40008938: 90 12 23 d0 or %o0, 0x3d0, %o0 ! 4001a3d0 <== NOT EXECUTED if (result != 0) { 4000893c: b0 92 20 00 orcc %o0, 0, %i0 <== NOT EXECUTED 40008940: 22 bf ff df be,a 400088bc <== NOT EXECUTED 40008944: 82 17 23 cc or %i4, 0x3cc, %g1 <== NOT EXECUTED pthread_mutex_destroy (&aio_request_queue.mutex); 40008948: 40 00 02 3c call 40009238 <== NOT EXECUTED 4000894c: 90 17 23 cc or %i4, 0x3cc, %o0 <== NOT EXECUTED pthread_attr_destroy (&aio_request_queue.attr); 40008950: 40 00 03 54 call 400096a0 <== NOT EXECUTED 40008954: 90 17 63 d4 or %i5, 0x3d4, %o0 <== NOT EXECUTED ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 40008958: 10 bf ff d9 b 400088bc <== NOT EXECUTED 4000895c: 82 17 23 cc or %i4, 0x3cc, %g1 <== NOT EXECUTED =============================================================================== 400087ec : 400087ec: c2 02 00 00 ld [ %o0 ], %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 400087f0: 88 02 20 04 add %o0, 4, %g4 rtems_chain_node *node; AIO_printf ("FD exists \n"); node = rtems_chain_first (chain); if (rtems_chain_is_empty (chain)) { 400087f4: 80 a0 40 04 cmp %g1, %g4 400087f8: 02 80 00 15 be 4000884c <== NEVER TAKEN 400087fc: 9a 10 00 09 mov %o1, %o5 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 && 40008800: c6 02 60 14 ld [ %o1 + 0x14 ], %g3 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; 40008804: c4 00 60 14 ld [ %g1 + 0x14 ], %g2 while (req->aiocbp->aio_reqprio > prio && 40008808: c6 00 e0 18 ld [ %g3 + 0x18 ], %g3 4000880c: c4 00 a0 18 ld [ %g2 + 0x18 ], %g2 40008810: 80 a0 80 03 cmp %g2, %g3 40008814: 26 80 00 07 bl,a 40008830 <== NEVER TAKEN 40008818: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED 4000881c: 10 80 00 0b b 40008848 40008820: d0 00 60 04 ld [ %g1 + 4 ], %o0 40008824: 22 80 00 09 be,a 40008848 <== NOT EXECUTED 40008828: d0 00 60 04 ld [ %g1 + 4 ], %o0 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next( Chain_Node *the_node ) { return the_node->next; 4000882c: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED !rtems_chain_is_tail (chain, node)) { node = rtems_chain_next (node); prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 40008830: c4 00 60 14 ld [ %g1 + 0x14 ], %g2 <== 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 && 40008834: c4 00 a0 18 ld [ %g2 + 0x18 ], %g2 <== NOT EXECUTED 40008838: 80 a0 80 03 cmp %g2, %g3 <== NOT EXECUTED 4000883c: 06 bf ff fa bl 40008824 <== NOT EXECUTED 40008840: 80 a1 00 01 cmp %g4, %g1 <== NOT EXECUTED 40008844: d0 00 60 04 ld [ %g1 + 4 ], %o0 <== NOT EXECUTED 40008848: 92 10 00 0d mov %o5, %o1 4000884c: 82 13 c0 00 mov %o7, %g1 40008850: 40 00 0a 2e call 4000b108 <_Chain_Insert> 40008854: 9e 10 40 00 mov %g1, %o7 =============================================================================== 40008a34 : * Output parameters: * NONE */ void rtems_aio_remove_fd (rtems_aio_request_chain *r_chain) { 40008a34: 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; 40008a38: fa 06 20 08 ld [ %i0 + 8 ], %i5 RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( const Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Immutable_tail( the_chain )); 40008a3c: 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)) 40008a40: 80 a7 40 18 cmp %i5, %i0 40008a44: 02 80 00 0e be 40008a7c <== NEVER TAKEN 40008a48: b6 10 20 8c mov 0x8c, %i3 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 40008a4c: 40 00 09 96 call 4000b0a4 <_Chain_Extract> 40008a50: 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; 40008a54: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next( Chain_Node *the_node ) { return the_node->next; 40008a58: f8 07 40 00 ld [ %i5 ], %i4 req->aiocbp->return_value = -1; 40008a5c: 84 10 3f ff mov -1, %g2 free (req); 40008a60: 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; 40008a64: f6 20 60 34 st %i3, [ %g1 + 0x34 ] req->aiocbp->return_value = -1; free (req); 40008a68: 7f ff ee 9d call 400044dc 40008a6c: c4 20 60 38 st %g2, [ %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)) 40008a70: 80 a7 00 18 cmp %i4, %i0 40008a74: 12 bf ff f6 bne 40008a4c 40008a78: ba 10 00 1c mov %i4, %i5 40008a7c: 81 c7 e0 08 ret 40008a80: 81 e8 00 00 restore =============================================================================== 40008a84 : * 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) { 40008a84: 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; 40008a88: 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 ); 40008a8c: 84 06 20 04 add %i0, 4, %g2 if (rtems_chain_is_empty (chain)) 40008a90: 80 a7 40 02 cmp %i5, %g2 40008a94: 12 80 00 06 bne 40008aac 40008a98: b0 10 20 02 mov 2, %i0 40008a9c: 30 80 00 12 b,a 40008ae4 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) { 40008aa0: 80 a0 80 1d cmp %g2, %i5 <== NOT EXECUTED 40008aa4: 02 80 00 12 be 40008aec <== NOT EXECUTED 40008aa8: 01 00 00 00 nop <== NOT EXECUTED 40008aac: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 40008ab0: 80 a0 40 19 cmp %g1, %i1 40008ab4: 32 bf ff fb bne,a 40008aa0 <== NEVER TAKEN 40008ab8: fa 07 40 00 ld [ %i5 ], %i5 <== NOT EXECUTED 40008abc: 40 00 09 7a call 4000b0a4 <_Chain_Extract> 40008ac0: 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; 40008ac4: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 current->aiocbp->return_value = -1; 40008ac8: 84 10 3f ff mov -1, %g2 40008acc: c4 20 60 38 st %g2, [ %g1 + 0x38 ] if (rtems_chain_is_tail (chain, node)) return AIO_NOTCANCELED; else { rtems_chain_extract (node); current->aiocbp->error_code = ECANCELED; 40008ad0: 84 10 20 8c mov 0x8c, %g2 current->aiocbp->return_value = -1; free (current); 40008ad4: 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; 40008ad8: c4 20 60 34 st %g2, [ %g1 + 0x34 ] current->aiocbp->return_value = -1; free (current); 40008adc: 7f ff ee 80 call 400044dc 40008ae0: b0 10 20 00 clr %i0 } return AIO_CANCELED; } 40008ae4: 81 c7 e0 08 ret 40008ae8: 81 e8 00 00 restore node = rtems_chain_next (node); current = (rtems_aio_request *) node; } if (rtems_chain_is_tail (chain, node)) return AIO_NOTCANCELED; 40008aec: 81 c7 e0 08 ret <== NOT EXECUTED 40008af0: 91 e8 20 01 restore %g0, 1, %o0 <== NOT EXECUTED =============================================================================== 40008f10 : rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 40008f10: 9d e3 bf 98 save %sp, -104, %sp */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 40008f14: 40 00 01 a1 call 40009598 <_Chain_Get> 40008f18: 90 10 00 18 mov %i0, %o0 while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL ) { rtems_event_set out; sc = rtems_event_receive( 40008f1c: 92 10 20 00 clr %o1 40008f20: ba 10 00 08 mov %o0, %i5 40008f24: 94 10 00 1a mov %i2, %o2 40008f28: 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 40008f2c: 80 a7 60 00 cmp %i5, 0 40008f30: 12 80 00 0a bne 40008f58 40008f34: 96 07 bf fc add %fp, -4, %o3 ) { rtems_event_set out; sc = rtems_event_receive( 40008f38: 7f ff fc df call 400082b4 40008f3c: 01 00 00 00 nop ) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( 40008f40: 80 a2 20 00 cmp %o0, 0 40008f44: 02 bf ff f4 be 40008f14 <== NEVER TAKEN 40008f48: 01 00 00 00 nop timeout, &out ); } *node_ptr = node; 40008f4c: fa 26 c0 00 st %i5, [ %i3 ] return sc; } 40008f50: 81 c7 e0 08 ret 40008f54: 91 e8 00 08 restore %g0, %o0, %o0 rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 40008f58: 90 10 20 00 clr %o0 timeout, &out ); } *node_ptr = node; 40008f5c: fa 26 c0 00 st %i5, [ %i3 ] return sc; } 40008f60: 81 c7 e0 08 ret 40008f64: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40012900 : rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 40012900: 9d e3 bf 98 save %sp, -104, %sp rtems_status_code sc; if ( event_out != NULL ) { 40012904: 80 a6 e0 00 cmp %i3, 0 40012908: 02 80 00 0a be 40012930 <== NEVER TAKEN 4001290c: 82 10 20 09 mov 9, %g1 Thread_Control *executing = _Thread_Executing; 40012910: 03 10 00 73 sethi %hi(0x4001cc00), %g1 40012914: fa 00 63 c0 ld [ %g1 + 0x3c0 ], %i5 ! 4001cfc0 <_Per_CPU_Information+0x10> RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ]; Event_Control *event = &api->System_event; if ( !_Event_sets_Is_empty( event_in ) ) { 40012918: 80 a6 20 00 cmp %i0, 0 4001291c: 12 80 00 07 bne 40012938 <== ALWAYS TAKEN 40012920: da 07 61 4c ld [ %i5 + 0x14c ], %o5 ); _Thread_Enable_dispatch(); sc = executing->Wait.return_code; } else { *event_out = event->pending_events; 40012924: c4 03 60 04 ld [ %o5 + 4 ], %g2 <== NOT EXECUTED sc = RTEMS_SUCCESSFUL; 40012928: 82 10 20 00 clr %g1 <== NOT EXECUTED ); _Thread_Enable_dispatch(); sc = executing->Wait.return_code; } else { *event_out = event->pending_events; 4001292c: c4 26 c0 00 st %g2, [ %i3 ] <== NOT EXECUTED } else { sc = RTEMS_INVALID_ADDRESS; } return sc; } 40012930: 81 c7 e0 08 ret <== NOT EXECUTED 40012934: 91 e8 00 01 restore %g0, %g1, %o0 <== NOT EXECUTED * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40012938: 03 10 00 72 sethi %hi(0x4001c800), %g1 4001293c: c4 00 62 a0 ld [ %g1 + 0x2a0 ], %g2 ! 4001caa0 <_Thread_Dispatch_disable_level> ++level; 40012940: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40012944: c4 20 62 a0 st %g2, [ %g1 + 0x2a0 ] RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ]; Event_Control *event = &api->System_event; if ( !_Event_sets_Is_empty( event_in ) ) { _Thread_Disable_dispatch(); _Event_Seize( 40012948: 03 00 01 00 sethi %hi(0x40000), %g1 4001294c: 90 10 00 18 mov %i0, %o0 40012950: 92 10 00 19 mov %i1, %o1 40012954: 94 10 00 1a mov %i2, %o2 40012958: 96 10 00 1b mov %i3, %o3 4001295c: 98 10 00 1d mov %i5, %o4 40012960: 9a 03 60 04 add %o5, 4, %o5 40012964: c2 23 a0 60 st %g1, [ %sp + 0x60 ] 40012968: 03 10 00 74 sethi %hi(0x4001d000), %g1 4001296c: 82 10 63 b0 or %g1, 0x3b0, %g1 ! 4001d3b0 <_System_event_Sync_state> 40012970: 7f ff da a1 call 400093f4 <_Event_Seize> 40012974: c2 23 a0 5c st %g1, [ %sp + 0x5c ] executing, event, &_System_event_Sync_state, STATES_WAITING_FOR_SYSTEM_EVENT ); _Thread_Enable_dispatch(); 40012978: 7f ff e7 34 call 4000c648 <_Thread_Enable_dispatch> 4001297c: 01 00 00 00 nop sc = executing->Wait.return_code; 40012980: c2 07 60 34 ld [ %i5 + 0x34 ], %g1 } else { sc = RTEMS_INVALID_ADDRESS; } return sc; } 40012984: 81 c7 e0 08 ret 40012988: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 40008774 : rtems_status_code rtems_event_system_send( rtems_id id, rtems_event_set event_in ) { 40008774: 9d e3 bf 98 save %sp, -104, %sp rtems_status_code sc; Thread_Control *thread; Objects_Locations location; RTEMS_API_Control *api; thread = _Thread_Get( id, &location ); 40008778: 90 10 00 18 mov %i0, %o0 4000877c: 40 00 0a 5f call 4000b0f8 <_Thread_Get> 40008780: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40008784: c2 07 bf fc ld [ %fp + -4 ], %g1 40008788: 80 a0 60 00 cmp %g1, 0 4000878c: 12 80 00 0d bne 400087c0 <== NEVER TAKEN 40008790: 92 10 00 19 mov %i1, %o1 case OBJECTS_LOCAL: api = thread->API_Extensions[ THREAD_API_RTEMS ]; _Event_Surrender( 40008794: d4 02 21 4c ld [ %o0 + 0x14c ], %o2 40008798: 94 02 a0 04 add %o2, 4, %o2 4000879c: 19 00 01 00 sethi %hi(0x40000), %o4 400087a0: 17 10 00 82 sethi %hi(0x40020800), %o3 400087a4: 96 12 e3 c0 or %o3, 0x3c0, %o3 ! 40020bc0 <_System_event_Sync_state> 400087a8: 7f ff fe 54 call 400080f8 <_Event_Surrender> 400087ac: b0 10 20 00 clr %i0 event_in, &api->System_event, &_System_event_Sync_state, STATES_WAITING_FOR_SYSTEM_EVENT ); _Thread_Enable_dispatch(); 400087b0: 40 00 0a 46 call 4000b0c8 <_Thread_Enable_dispatch> 400087b4: 01 00 00 00 nop sc = RTEMS_SUCCESSFUL; break; 400087b8: 81 c7 e0 08 ret 400087bc: 81 e8 00 00 restore sc = RTEMS_INVALID_ID; break; } return sc; } 400087c0: 81 c7 e0 08 ret <== NOT EXECUTED 400087c4: 91 e8 20 04 restore %g0, 4, %o0 <== NOT EXECUTED =============================================================================== 4000a204 : 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 ) { 4000a204: 9d e3 bf a0 save %sp, -96, %sp rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 4000a208: 03 10 00 73 sethi %hi(0x4001cc00), %g1 4000a20c: c4 00 63 b8 ld [ %g1 + 0x3b8 ], %g2 ! 4001cfb8 <_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 ) { 4000a210: ba 10 00 18 mov %i0, %i5 rtems_device_major_number major_limit = _IO_Number_of_drivers; 4000a214: 03 10 00 74 sethi %hi(0x4001d000), %g1 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 ) { 4000a218: 86 10 00 19 mov %i1, %g3 rtems_device_major_number major_limit = _IO_Number_of_drivers; 4000a21c: c8 00 63 f8 ld [ %g1 + 0x3f8 ], %g4 if ( rtems_interrupt_is_in_progress() ) 4000a220: 80 a0 a0 00 cmp %g2, 0 4000a224: 12 80 00 1f bne 4000a2a0 4000a228: b0 10 20 12 mov 0x12, %i0 return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 4000a22c: 80 a6 a0 00 cmp %i2, 0 4000a230: 02 80 00 21 be 4000a2b4 4000a234: 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 ) 4000a238: 02 80 00 1f be 4000a2b4 4000a23c: c8 26 80 00 st %g4, [ %i2 ] static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 4000a240: c4 06 40 00 ld [ %i1 ], %g2 4000a244: 80 a0 a0 00 cmp %g2, 0 4000a248: 22 80 00 18 be,a 4000a2a8 4000a24c: 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 ) 4000a250: 80 a1 00 1d cmp %g4, %i5 4000a254: 08 80 00 13 bleu 4000a2a0 4000a258: b0 10 20 0a mov 0xa, %i0 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4000a25c: 05 10 00 72 sethi %hi(0x4001c800), %g2 4000a260: c8 00 a2 a0 ld [ %g2 + 0x2a0 ], %g4 ! 4001caa0 <_Thread_Dispatch_disable_level> ++level; 4000a264: 88 01 20 01 inc %g4 _Thread_Dispatch_disable_level = level; 4000a268: c8 20 a2 a0 st %g4, [ %g2 + 0x2a0 ] return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 4000a26c: 80 a7 60 00 cmp %i5, 0 4000a270: 02 80 00 13 be 4000a2bc 4000a274: 39 10 00 74 sethi %hi(0x4001d000), %i4 _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 4000a278: c8 07 23 fc ld [ %i4 + 0x3fc ], %g4 ! 4001d3fc <_IO_Driver_address_table> 4000a27c: 85 2f 60 03 sll %i5, 3, %g2 4000a280: b7 2f 60 05 sll %i5, 5, %i3 4000a284: 82 26 c0 02 sub %i3, %g2, %g1 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 4000a288: f2 01 00 01 ld [ %g4 + %g1 ], %i1 4000a28c: 80 a6 60 00 cmp %i1, 0 4000a290: 02 80 00 3a be 4000a378 4000a294: 82 01 00 01 add %g4, %g1, %g1 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(); 4000a298: 40 00 08 ec call 4000c648 <_Thread_Enable_dispatch> 4000a29c: b0 10 20 0c mov 0xc, %i0 return RTEMS_RESOURCE_IN_USE; 4000a2a0: 81 c7 e0 08 ret 4000a2a4: 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; 4000a2a8: 80 a0 a0 00 cmp %g2, 0 4000a2ac: 12 bf ff ea bne 4000a254 4000a2b0: 80 a1 00 1d cmp %g4, %i5 if ( driver_table == NULL ) return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; 4000a2b4: 81 c7 e0 08 ret 4000a2b8: 91 e8 20 09 restore %g0, 9, %o0 static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 4000a2bc: c8 00 63 f8 ld [ %g1 + 0x3f8 ], %g4 rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 4000a2c0: 80 a1 20 00 cmp %g4, 0 4000a2c4: 02 80 00 33 be 4000a390 <== NEVER TAKEN 4000a2c8: c2 07 23 fc ld [ %i4 + 0x3fc ], %g1 4000a2cc: 30 80 00 04 b,a 4000a2dc 4000a2d0: 80 a7 40 04 cmp %i5, %g4 4000a2d4: 02 80 00 24 be 4000a364 4000a2d8: 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; 4000a2dc: c4 00 40 00 ld [ %g1 ], %g2 4000a2e0: 80 a0 a0 00 cmp %g2, 0 4000a2e4: 32 bf ff fb bne,a 4000a2d0 4000a2e8: ba 07 60 01 inc %i5 4000a2ec: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000a2f0: 80 a0 a0 00 cmp %g2, 0 4000a2f4: 32 bf ff f7 bne,a 4000a2d0 4000a2f8: ba 07 60 01 inc %i5 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 4000a2fc: fa 26 80 00 st %i5, [ %i2 ] 4000a300: 85 2f 60 03 sll %i5, 3, %g2 if ( m != n ) 4000a304: 80 a1 00 1d cmp %g4, %i5 4000a308: 02 80 00 18 be 4000a368 <== NEVER TAKEN 4000a30c: b7 2f 60 05 sll %i5, 5, %i3 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 4000a310: c8 00 c0 00 ld [ %g3 ], %g4 4000a314: c2 07 23 fc ld [ %i4 + 0x3fc ], %g1 4000a318: 84 26 c0 02 sub %i3, %g2, %g2 4000a31c: c8 20 40 02 st %g4, [ %g1 + %g2 ] 4000a320: c8 00 e0 04 ld [ %g3 + 4 ], %g4 4000a324: 82 00 40 02 add %g1, %g2, %g1 4000a328: c8 20 60 04 st %g4, [ %g1 + 4 ] 4000a32c: c4 00 e0 08 ld [ %g3 + 8 ], %g2 _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 4000a330: b2 10 20 00 clr %i1 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 4000a334: c4 20 60 08 st %g2, [ %g1 + 8 ] 4000a338: c4 00 e0 0c ld [ %g3 + 0xc ], %g2 _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 4000a33c: b4 10 20 00 clr %i2 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 4000a340: c4 20 60 0c st %g2, [ %g1 + 0xc ] 4000a344: c4 00 e0 10 ld [ %g3 + 0x10 ], %g2 _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 4000a348: b0 10 00 1d mov %i5, %i0 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 4000a34c: c4 20 60 10 st %g2, [ %g1 + 0x10 ] 4000a350: c4 00 e0 14 ld [ %g3 + 0x14 ], %g2 _Thread_Enable_dispatch(); 4000a354: 40 00 08 bd call 4000c648 <_Thread_Enable_dispatch> 4000a358: c4 20 60 14 st %g2, [ %g1 + 0x14 ] return rtems_io_initialize( major, 0, NULL ); 4000a35c: 40 00 22 97 call 40012db8 4000a360: 81 e8 00 00 restore if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 4000a364: fa 26 80 00 st %i5, [ %i2 ] if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 4000a368: 40 00 08 b8 call 4000c648 <_Thread_Enable_dispatch> 4000a36c: b0 10 20 05 mov 5, %i0 return sc; 4000a370: 81 c7 e0 08 ret 4000a374: 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; 4000a378: c2 00 60 04 ld [ %g1 + 4 ], %g1 4000a37c: 80 a0 60 00 cmp %g1, 0 4000a380: 12 bf ff c6 bne 4000a298 4000a384: 01 00 00 00 nop if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } *registered_major = major; 4000a388: 10 bf ff e2 b 4000a310 4000a38c: fa 26 80 00 st %i5, [ %i2 ] if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 4000a390: 10 bf ff f6 b 4000a368 <== NOT EXECUTED 4000a394: c0 26 80 00 clr [ %i2 ] <== NOT EXECUTED =============================================================================== 4000b360 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 4000b360: 9d e3 bf a0 save %sp, -96, %sp uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 4000b364: 80 a6 20 00 cmp %i0, 0 4000b368: 02 80 00 20 be 4000b3e8 <== NEVER TAKEN 4000b36c: 37 10 00 8b sethi %hi(0x40022c00), %i3 4000b370: b6 16 e2 48 or %i3, 0x248, %i3 ! 40022e48 <_Objects_Information_table+0x4> #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 4000b374: 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 ]; 4000b378: c2 06 c0 00 ld [ %i3 ], %g1 4000b37c: f8 00 60 04 ld [ %g1 + 4 ], %i4 if ( !information ) 4000b380: 80 a7 20 00 cmp %i4, 0 4000b384: 22 80 00 16 be,a 4000b3dc 4000b388: b6 06 e0 04 add %i3, 4, %i3 continue; for ( i=1 ; i <= information->maximum ; i++ ) { 4000b38c: c2 17 20 10 lduh [ %i4 + 0x10 ], %g1 4000b390: 86 90 60 00 orcc %g1, 0, %g3 4000b394: 22 80 00 12 be,a 4000b3dc 4000b398: b6 06 e0 04 add %i3, 4, %i3 4000b39c: ba 10 20 01 mov 1, %i5 the_thread = (Thread_Control *)information->local_table[ i ]; 4000b3a0: c4 07 20 1c ld [ %i4 + 0x1c ], %g2 4000b3a4: 83 2f 60 02 sll %i5, 2, %g1 4000b3a8: c2 00 80 01 ld [ %g2 + %g1 ], %g1 if ( !the_thread ) 4000b3ac: 90 90 60 00 orcc %g1, 0, %o0 4000b3b0: 02 80 00 05 be 4000b3c4 <== NEVER TAKEN 4000b3b4: ba 07 60 01 inc %i5 continue; (*routine)(the_thread); 4000b3b8: 9f c6 00 00 call %i0 4000b3bc: 01 00 00 00 nop 4000b3c0: c6 17 20 10 lduh [ %i4 + 0x10 ], %g3 information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 4000b3c4: 83 28 e0 10 sll %g3, 0x10, %g1 4000b3c8: 83 30 60 10 srl %g1, 0x10, %g1 4000b3cc: 80 a0 40 1d cmp %g1, %i5 4000b3d0: 3a bf ff f5 bcc,a 4000b3a4 4000b3d4: c4 07 20 1c ld [ %i4 + 0x1c ], %g2 4000b3d8: 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++ ) { 4000b3dc: 80 a6 c0 1a cmp %i3, %i2 4000b3e0: 32 bf ff e7 bne,a 4000b37c 4000b3e4: c2 06 c0 00 ld [ %i3 ], %g1 4000b3e8: 81 c7 e0 08 ret 4000b3ec: 81 e8 00 00 restore =============================================================================== 40009f68 : rtems_status_code rtems_object_get_class_information( int the_api, int the_class, rtems_object_api_class_information *info ) { 40009f68: 9d e3 bf a0 save %sp, -96, %sp int i; /* * Validate parameters and look up information structure. */ if ( !info ) 40009f6c: 80 a6 a0 00 cmp %i2, 0 40009f70: 02 80 00 21 be 40009ff4 40009f74: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); 40009f78: 93 2e 60 10 sll %i1, 0x10, %o1 40009f7c: 90 10 00 18 mov %i0, %o0 40009f80: 40 00 07 cc call 4000beb0 <_Objects_Get_information> 40009f84: 93 32 60 10 srl %o1, 0x10, %o1 if ( !obj_info ) 40009f88: 80 a2 20 00 cmp %o0, 0 40009f8c: 02 80 00 1a be 40009ff4 40009f90: 82 10 20 0a mov 0xa, %g1 * Return information about this object class to the user. */ 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; 40009f94: 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; 40009f98: c6 02 20 08 ld [ %o0 + 8 ], %g3 info->maximum_id = obj_info->maximum_id; 40009f9c: c4 02 20 0c ld [ %o0 + 0xc ], %g2 info->auto_extend = obj_info->auto_extend; 40009fa0: c2 0a 20 12 ldub [ %o0 + 0x12 ], %g1 return RTEMS_INVALID_NUMBER; /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; 40009fa4: c6 26 80 00 st %g3, [ %i2 ] info->maximum_id = obj_info->maximum_id; 40009fa8: c4 26 a0 04 st %g2, [ %i2 + 4 ] info->auto_extend = obj_info->auto_extend; 40009fac: c2 2e a0 0c stb %g1, [ %i2 + 0xc ] info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 40009fb0: 80 a1 20 00 cmp %g4, 0 40009fb4: 02 80 00 12 be 40009ffc <== NEVER TAKEN 40009fb8: c8 26 a0 08 st %g4, [ %i2 + 8 ] 40009fbc: fa 02 20 1c ld [ %o0 + 0x1c ], %i5 40009fc0: 86 10 20 01 mov 1, %g3 40009fc4: 82 10 20 01 mov 1, %g1 40009fc8: 84 10 20 00 clr %g2 if ( !obj_info->local_table[i] ) 40009fcc: 87 28 e0 02 sll %g3, 2, %g3 40009fd0: c6 07 40 03 ld [ %i5 + %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++ ) 40009fd4: 82 00 60 01 inc %g1 if ( !obj_info->local_table[i] ) unallocated++; 40009fd8: 80 a0 00 03 cmp %g0, %g3 40009fdc: 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++ ) 40009fe0: 80 a1 00 01 cmp %g4, %g1 40009fe4: 1a bf ff fa bcc 40009fcc 40009fe8: 86 10 00 01 mov %g1, %g3 if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; 40009fec: c4 26 a0 10 st %g2, [ %i2 + 0x10 ] return RTEMS_SUCCESSFUL; 40009ff0: 82 10 20 00 clr %g1 } 40009ff4: 81 c7 e0 08 ret 40009ff8: 91 e8 00 01 restore %g0, %g1, %o0 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++ ) 40009ffc: 84 10 20 00 clr %g2 <== NOT EXECUTED if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; 4000a000: 82 10 20 00 clr %g1 <== NOT EXECUTED for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; 4000a004: 10 bf ff fc b 40009ff4 <== NOT EXECUTED 4000a008: c4 26 a0 10 st %g2, [ %i2 + 0x10 ] <== NOT EXECUTED =============================================================================== 40009a04 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 40009a04: 9d e3 bf a0 save %sp, -96, %sp register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 40009a08: 80 a6 20 00 cmp %i0, 0 40009a0c: 12 80 00 04 bne 40009a1c 40009a10: 82 10 20 03 mov 3, %g1 ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 40009a14: 81 c7 e0 08 ret 40009a18: 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 ) 40009a1c: 80 a6 60 00 cmp %i1, 0 40009a20: 02 bf ff fd be 40009a14 40009a24: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; if ( !id ) 40009a28: 80 a7 60 00 cmp %i5, 0 40009a2c: 02 bf ff fa be 40009a14 <== NEVER TAKEN 40009a30: 80 a6 e0 00 cmp %i3, 0 return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 40009a34: 02 bf ff f8 be 40009a14 40009a38: 82 10 20 08 mov 8, %g1 40009a3c: 80 a6 a0 00 cmp %i2, 0 40009a40: 02 bf ff f5 be 40009a14 40009a44: 80 a6 80 1b cmp %i2, %i3 40009a48: 0a bf ff f3 bcs 40009a14 40009a4c: 80 8e e0 07 btst 7, %i3 40009a50: 12 bf ff f1 bne 40009a14 40009a54: 80 8e 60 07 btst 7, %i1 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 40009a58: 12 bf ff ef bne 40009a14 40009a5c: 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) { uint32_t level = _Thread_Dispatch_disable_level; 40009a60: 03 10 00 93 sethi %hi(0x40024c00), %g1 40009a64: c4 00 60 b0 ld [ %g1 + 0xb0 ], %g2 ! 40024cb0 <_Thread_Dispatch_disable_level> ++level; 40009a68: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40009a6c: c4 20 60 b0 st %g2, [ %g1 + 0xb0 ] * 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 ); 40009a70: 23 10 00 92 sethi %hi(0x40024800), %l1 40009a74: 40 00 07 6f call 4000b830 <_Objects_Allocate> 40009a78: 90 14 62 ac or %l1, 0x2ac, %o0 ! 40024aac <_Partition_Information> _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 40009a7c: a0 92 20 00 orcc %o0, 0, %l0 40009a80: 02 80 00 1a be 40009ae8 40009a84: 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; 40009a88: f8 24 20 1c st %i4, [ %l0 + 0x1c ] _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 40009a8c: f2 24 20 10 st %i1, [ %l0 + 0x10 ] the_partition->length = length; 40009a90: f4 24 20 14 st %i2, [ %l0 + 0x14 ] the_partition->buffer_size = buffer_size; 40009a94: f6 24 20 18 st %i3, [ %l0 + 0x18 ] the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; 40009a98: c0 24 20 20 clr [ %l0 + 0x20 ] _Chain_Initialize( &the_partition->Memory, starting_address, length / buffer_size, buffer_size ); 40009a9c: 40 00 47 d1 call 4001b9e0 <.udiv> 40009aa0: 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, 40009aa4: 92 10 00 19 mov %i1, %o1 length / buffer_size, buffer_size ); 40009aa8: 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, 40009aac: 96 10 00 1b mov %i3, %o3 40009ab0: b8 04 20 24 add %l0, 0x24, %i4 40009ab4: 40 00 04 a5 call 4000ad48 <_Chain_Initialize> 40009ab8: 90 10 00 1c mov %i4, %o0 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 40009abc: c4 14 20 0a lduh [ %l0 + 0xa ], %g2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40009ac0: a2 14 62 ac or %l1, 0x2ac, %l1 40009ac4: c6 04 60 1c ld [ %l1 + 0x1c ], %g3 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 40009ac8: c2 04 20 08 ld [ %l0 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40009acc: 85 28 a0 02 sll %g2, 2, %g2 40009ad0: e0 20 c0 02 st %l0, [ %g3 + %g2 ] information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 40009ad4: f0 24 20 0c st %i0, [ %l0 + 0xc ] name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 40009ad8: 40 00 0c a2 call 4000cd60 <_Thread_Enable_dispatch> 40009adc: c2 27 40 00 st %g1, [ %i5 ] return RTEMS_SUCCESSFUL; 40009ae0: 10 bf ff cd b 40009a14 40009ae4: 82 10 20 00 clr %g1 _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { _Thread_Enable_dispatch(); 40009ae8: 40 00 0c 9e call 4000cd60 <_Thread_Enable_dispatch> 40009aec: 01 00 00 00 nop return RTEMS_TOO_MANY; 40009af0: 10 bf ff c9 b 40009a14 40009af4: 82 10 20 05 mov 5, %g1 ! 5 =============================================================================== 400161dc : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { 400161dc: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 400161e0: 11 10 00 f9 sethi %hi(0x4003e400), %o0 400161e4: 92 10 00 18 mov %i0, %o1 400161e8: 90 12 22 5c or %o0, 0x25c, %o0 400161ec: 40 00 15 26 call 4001b684 <_Objects_Get> 400161f0: 94 07 bf fc add %fp, -4, %o2 register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 400161f4: c2 07 bf fc ld [ %fp + -4 ], %g1 400161f8: 80 a0 60 00 cmp %g1, 0 400161fc: 12 80 00 19 bne 40016260 40016200: ba 10 00 08 mov %o0, %i5 ) { void *starting; void *ending; starting = the_partition->starting_address; 40016204: d0 02 20 10 ld [ %o0 + 0x10 ], %o0 40016208: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4001620c: 82 02 00 01 add %o0, %g1, %g1 ending = _Addresses_Add_offset( starting, the_partition->length ); return ( _Addresses_Is_in_range( the_buffer, starting, ending ) && 40016210: 80 a6 40 01 cmp %i1, %g1 40016214: 18 80 00 15 bgu 40016268 <== NEVER TAKEN 40016218: 80 a6 40 08 cmp %i1, %o0 4001621c: 0a 80 00 13 bcs 40016268 40016220: 01 00 00 00 nop offset = (uint32_t) _Addresses_Subtract( the_buffer, the_partition->starting_address ); return ((offset % the_partition->buffer_size) == 0); 40016224: d2 07 60 18 ld [ %i5 + 0x18 ], %o1 40016228: 40 00 5a e1 call 4002cdac <.urem> 4001622c: 90 26 40 08 sub %i1, %o0, %o0 starting = the_partition->starting_address; ending = _Addresses_Add_offset( starting, the_partition->length ); return ( _Addresses_Is_in_range( the_buffer, starting, ending ) && 40016230: 80 a2 20 00 cmp %o0, 0 40016234: 12 80 00 0d bne 40016268 40016238: 90 07 60 24 add %i5, 0x24, %o0 RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Partition_Control *the_partition, Chain_Node *the_buffer ) { _Chain_Append( &the_partition->Memory, the_buffer ); 4001623c: 40 00 0d 11 call 40019680 <_Chain_Append> 40016240: 92 10 00 19 mov %i1, %o1 case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; 40016244: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 40016248: b0 10 20 00 clr %i0 switch ( location ) { case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; 4001624c: 82 00 7f ff add %g1, -1, %g1 _Thread_Enable_dispatch(); 40016250: 40 00 18 f0 call 4001c610 <_Thread_Enable_dispatch> 40016254: c2 27 60 20 st %g1, [ %i5 + 0x20 ] 40016258: 81 c7 e0 08 ret 4001625c: 81 e8 00 00 restore case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 40016260: 81 c7 e0 08 ret 40016264: 91 e8 20 04 restore %g0, 4, %o0 _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 40016268: 40 00 18 ea call 4001c610 <_Thread_Enable_dispatch> 4001626c: b0 10 20 09 mov 9, %i0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 40016270: 81 c7 e0 08 ret 40016274: 81 e8 00 00 restore =============================================================================== 40038b00 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 40038b00: 9d e3 bf 98 save %sp, -104, %sp 40038b04: 11 10 01 a8 sethi %hi(0x4006a000), %o0 40038b08: 92 10 00 18 mov %i0, %o1 40038b0c: 90 12 23 68 or %o0, 0x368, %o0 40038b10: 7f ff 44 18 call 40009b70 <_Objects_Get> 40038b14: 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 ) { 40038b18: c2 07 bf fc ld [ %fp + -4 ], %g1 40038b1c: 80 a0 60 00 cmp %g1, 0 40038b20: 12 80 00 0d bne 40038b54 40038b24: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 40038b28: 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 ); 40038b2c: 39 10 01 a7 sethi %hi(0x40069c00), %i4 40038b30: b8 17 21 a0 or %i4, 0x1a0, %i4 ! 40069da0 <_Per_CPU_Information> 40038b34: c2 07 20 10 ld [ %i4 + 0x10 ], %g1 40038b38: 80 a0 80 01 cmp %g2, %g1 40038b3c: 02 80 00 08 be 40038b5c 40038b40: 80 a6 60 00 cmp %i1, 0 _Thread_Enable_dispatch(); 40038b44: 7f ff 47 c2 call 4000aa4c <_Thread_Enable_dispatch> 40038b48: b0 10 20 17 mov 0x17, %i0 40038b4c: 81 c7 e0 08 ret 40038b50: 81 e8 00 00 restore case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 40038b54: 81 c7 e0 08 ret 40038b58: 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 ) { 40038b5c: 12 80 00 0e bne 40038b94 40038b60: 01 00 00 00 nop switch ( the_period->state ) { 40038b64: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 40038b68: 80 a0 60 04 cmp %g1, 4 40038b6c: 18 80 00 06 bgu 40038b84 <== NEVER TAKEN 40038b70: b0 10 20 00 clr %i0 40038b74: 83 28 60 02 sll %g1, 2, %g1 40038b78: 05 10 01 8d sethi %hi(0x40063400), %g2 40038b7c: 84 10 a1 50 or %g2, 0x150, %g2 ! 40063550 40038b80: f0 00 80 01 ld [ %g2 + %g1 ], %i0 id, NULL ); _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 40038b84: 7f ff 47 b2 call 4000aa4c <_Thread_Enable_dispatch> 40038b88: 01 00 00 00 nop 40038b8c: 81 c7 e0 08 ret 40038b90: 81 e8 00 00 restore } _Thread_Enable_dispatch(); return( return_value ); } _ISR_Disable( level ); 40038b94: 7f ff 25 c3 call 400022a0 40038b98: 01 00 00 00 nop 40038b9c: b4 10 00 08 mov %o0, %i2 if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { 40038ba0: f6 07 60 38 ld [ %i5 + 0x38 ], %i3 40038ba4: 80 a6 e0 00 cmp %i3, 0 40038ba8: 02 80 00 1c be 40038c18 40038bac: 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 ) { 40038bb0: 02 80 00 2e be 40038c68 40038bb4: 80 a6 e0 04 cmp %i3, 4 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_EXPIRED ) { 40038bb8: 12 bf ff e5 bne 40038b4c <== NEVER TAKEN 40038bbc: b0 10 20 04 mov 4, %i0 /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 40038bc0: 7f ff ff 5e call 40038938 <_Rate_monotonic_Update_statistics> 40038bc4: 90 10 00 1d mov %i5, %o0 _ISR_Enable( level ); 40038bc8: 7f ff 25 ba call 400022b0 40038bcc: 90 10 00 1a mov %i2, %o0 the_period->state = RATE_MONOTONIC_ACTIVE; 40038bd0: 82 10 20 02 mov 2, %g1 40038bd4: 92 07 60 10 add %i5, 0x10, %o1 40038bd8: c2 27 60 38 st %g1, [ %i5 + 0x38 ] the_period->next_length = length; 40038bdc: f2 27 60 3c st %i1, [ %i5 + 0x3c ] Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40038be0: f2 27 60 1c st %i1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40038be4: 11 10 01 a6 sethi %hi(0x40069800), %o0 40038be8: 7f ff 4a d5 call 4000b73c <_Watchdog_Insert> 40038bec: 90 12 21 28 or %o0, 0x128, %o0 ! 40069928 <_Watchdog_Ticks_chain> 40038bf0: d0 07 60 40 ld [ %i5 + 0x40 ], %o0 40038bf4: d2 07 60 3c ld [ %i5 + 0x3c ], %o1 40038bf8: 03 10 01 95 sethi %hi(0x40065400), %g1 40038bfc: c2 00 60 14 ld [ %g1 + 0x14 ], %g1 ! 40065414 <_Scheduler+0x34> 40038c00: 9f c0 40 00 call %g1 40038c04: b0 10 20 06 mov 6, %i0 _Watchdog_Insert_ticks( &the_period->Timer, length ); _Scheduler_Release_job(the_period->owner, the_period->next_length); _Thread_Enable_dispatch(); 40038c08: 7f ff 47 91 call 4000aa4c <_Thread_Enable_dispatch> 40038c0c: 01 00 00 00 nop 40038c10: 81 c7 e0 08 ret 40038c14: 81 e8 00 00 restore return( return_value ); } _ISR_Disable( level ); if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { _ISR_Enable( level ); 40038c18: 7f ff 25 a6 call 400022b0 40038c1c: 01 00 00 00 nop the_period->next_length = length; /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 40038c20: 90 10 00 1d mov %i5, %o0 40038c24: 7f ff ff 94 call 40038a74 <_Rate_monotonic_Initiate_statistics> 40038c28: f2 27 60 3c st %i1, [ %i5 + 0x3c ] the_period->state = RATE_MONOTONIC_ACTIVE; 40038c2c: 82 10 20 02 mov 2, %g1 40038c30: c2 27 60 38 st %g1, [ %i5 + 0x38 ] Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 40038c34: 03 10 00 e3 sethi %hi(0x40038c00), %g1 40038c38: 82 10 60 dc or %g1, 0xdc, %g1 ! 40038cdc <_Rate_monotonic_Timeout> the_watchdog->id = id; 40038c3c: f0 27 60 30 st %i0, [ %i5 + 0x30 ] ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40038c40: 92 07 60 10 add %i5, 0x10, %o1 40038c44: 11 10 01 a6 sethi %hi(0x40069800), %o0 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 40038c48: c0 27 60 18 clr [ %i5 + 0x18 ] ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40038c4c: 90 12 21 28 or %o0, 0x128, %o0 ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 40038c50: c0 27 60 34 clr [ %i5 + 0x34 ] Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 40038c54: c2 27 60 2c st %g1, [ %i5 + 0x2c ] Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40038c58: f2 27 60 1c st %i1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40038c5c: 7f ff 4a b8 call 4000b73c <_Watchdog_Insert> 40038c60: b0 10 20 00 clr %i0 40038c64: 30 bf ff c8 b,a 40038b84 if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 40038c68: 7f ff ff 34 call 40038938 <_Rate_monotonic_Update_statistics> 40038c6c: 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; 40038c70: 82 10 20 01 mov 1, %g1 the_period->next_length = length; 40038c74: 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; 40038c78: c2 27 60 38 st %g1, [ %i5 + 0x38 ] the_period->next_length = length; _ISR_Enable( level ); 40038c7c: 7f ff 25 8d call 400022b0 40038c80: 90 10 00 1a mov %i2, %o0 _Thread_Executing->Wait.id = the_period->Object.id; 40038c84: c2 07 20 10 ld [ %i4 + 0x10 ], %g1 40038c88: c4 07 60 08 ld [ %i5 + 8 ], %g2 _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 40038c8c: 90 10 00 01 mov %g1, %o0 40038c90: 13 00 00 10 sethi %hi(0x4000), %o1 40038c94: 7f ff 49 be call 4000b38c <_Thread_Set_state> 40038c98: c4 20 60 20 st %g2, [ %g1 + 0x20 ] /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 40038c9c: 7f ff 25 81 call 400022a0 40038ca0: 01 00 00 00 nop local_state = the_period->state; 40038ca4: f4 07 60 38 ld [ %i5 + 0x38 ], %i2 the_period->state = RATE_MONOTONIC_ACTIVE; 40038ca8: f6 27 60 38 st %i3, [ %i5 + 0x38 ] _ISR_Enable( level ); 40038cac: 7f ff 25 81 call 400022b0 40038cb0: 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 ) 40038cb4: 80 a6 a0 03 cmp %i2, 3 40038cb8: 22 80 00 06 be,a 40038cd0 40038cbc: d0 07 20 10 ld [ %i4 + 0x10 ], %o0 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); _Thread_Enable_dispatch(); 40038cc0: 7f ff 47 63 call 4000aa4c <_Thread_Enable_dispatch> 40038cc4: b0 10 20 00 clr %i0 40038cc8: 81 c7 e0 08 ret 40038ccc: 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 ); 40038cd0: 7f ff 46 72 call 4000a698 <_Thread_Clear_state> 40038cd4: 13 00 00 10 sethi %hi(0x4000), %o1 40038cd8: 30 bf ff fa b,a 40038cc0 =============================================================================== 4002a580 : void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 4002a580: 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 ) 4002a584: 80 a6 60 00 cmp %i1, 0 4002a588: 02 80 00 48 be 4002a6a8 <== NEVER TAKEN 4002a58c: 90 10 00 18 mov %i0, %o0 return; (*print)( context, "Period information by period\n" ); 4002a590: 13 10 01 82 sethi %hi(0x40060800), %o1 4002a594: 9f c6 40 00 call %i1 4002a598: 92 12 60 28 or %o1, 0x28, %o1 ! 40060828 <_TOD_Days_per_month+0x68> #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 4002a59c: 90 10 00 18 mov %i0, %o0 4002a5a0: 13 10 01 82 sethi %hi(0x40060800), %o1 4002a5a4: 9f c6 40 00 call %i1 4002a5a8: 92 12 60 48 or %o1, 0x48, %o1 ! 40060848 <_TOD_Days_per_month+0x88> (*print)( context, "--- Wall times are in seconds ---\n" ); 4002a5ac: 90 10 00 18 mov %i0, %o0 4002a5b0: 13 10 01 82 sethi %hi(0x40060800), %o1 4002a5b4: 9f c6 40 00 call %i1 4002a5b8: 92 12 60 70 or %o1, 0x70, %o1 ! 40060870 <_TOD_Days_per_month+0xb0> Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 4002a5bc: 90 10 00 18 mov %i0, %o0 4002a5c0: 13 10 01 82 sethi %hi(0x40060800), %o1 4002a5c4: 9f c6 40 00 call %i1 4002a5c8: 92 12 60 98 or %o1, 0x98, %o1 ! 40060898 <_TOD_Days_per_month+0xd8> #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 4002a5cc: 90 10 00 18 mov %i0, %o0 4002a5d0: 13 10 01 82 sethi %hi(0x40060800), %o1 4002a5d4: 9f c6 40 00 call %i1 4002a5d8: 92 12 60 e8 or %o1, 0xe8, %o1 ! 400608e8 <_TOD_Days_per_month+0x128> /* * 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 ; 4002a5dc: 39 10 01 a8 sethi %hi(0x4006a000), %i4 4002a5e0: b8 17 23 68 or %i4, 0x368, %i4 ! 4006a368 <_Rate_monotonic_Information> 4002a5e4: fa 07 20 08 ld [ %i4 + 8 ], %i5 4002a5e8: c2 07 20 0c ld [ %i4 + 0xc ], %g1 4002a5ec: 80 a7 40 01 cmp %i5, %g1 4002a5f0: 18 80 00 2e bgu 4002a6a8 <== NEVER TAKEN 4002a5f4: 35 10 01 82 sethi %hi(0x40060800), %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, 4002a5f8: 27 10 01 82 sethi %hi(0x40060800), %l3 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, 4002a5fc: 25 10 01 82 sethi %hi(0x40060800), %l2 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 4002a600: 37 10 01 87 sethi %hi(0x40061c00), %i3 rtems_object_get_name( the_status.owner, sizeof(name), name ); /* * Print part of report line that is not dependent on granularity */ (*print)( context, 4002a604: b4 16 a1 38 or %i2, 0x138, %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, 4002a608: a6 14 e1 50 or %l3, 0x150, %l3 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, 4002a60c: a4 14 a1 70 or %l2, 0x170, %l2 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 4002a610: 10 80 00 06 b 4002a628 4002a614: b6 16 e2 00 or %i3, 0x200, %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++ ) { 4002a618: 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 ; 4002a61c: 80 a0 40 1d cmp %g1, %i5 4002a620: 0a 80 00 22 bcs 4002a6a8 4002a624: 01 00 00 00 nop id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 4002a628: 90 10 00 1d mov %i5, %o0 4002a62c: 40 00 37 df call 400385a8 4002a630: 92 07 bf c8 add %fp, -56, %o1 if ( status != RTEMS_SUCCESSFUL ) 4002a634: 80 a2 20 00 cmp %o0, 0 4002a638: 32 bf ff f8 bne,a 4002a618 4002a63c: 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 ); 4002a640: 92 07 bf b0 add %fp, -80, %o1 4002a644: 40 00 38 4b call 40038770 4002a648: 90 10 00 1d mov %i5, %o0 #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 4002a64c: d0 07 bf b0 ld [ %fp + -80 ], %o0 4002a650: 94 07 bf a0 add %fp, -96, %o2 4002a654: 7f ff 97 9e call 400104cc 4002a658: 92 10 20 05 mov 5, %o1 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 4002a65c: d8 1f bf c8 ldd [ %fp + -56 ], %o4 4002a660: 92 10 00 1a mov %i2, %o1 4002a664: 94 10 00 1d mov %i5, %o2 4002a668: 90 10 00 18 mov %i0, %o0 4002a66c: 9f c6 40 00 call %i1 4002a670: 96 07 bf a0 add %fp, -96, %o3 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 4002a674: c2 07 bf c8 ld [ %fp + -56 ], %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 ); 4002a678: 94 07 bf a8 add %fp, -88, %o2 4002a67c: 90 07 bf e0 add %fp, -32, %o0 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 4002a680: 80 a0 60 00 cmp %g1, 0 4002a684: 12 80 00 0b bne 4002a6b0 4002a688: 92 10 00 1b mov %i3, %o1 (*print)( context, "\n" ); 4002a68c: 9f c6 40 00 call %i1 4002a690: 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 ; 4002a694: c2 07 20 0c ld [ %i4 + 0xc ], %g1 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 4002a698: 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 ; 4002a69c: 80 a0 40 1d cmp %g1, %i5 4002a6a0: 1a bf ff e3 bcc 4002a62c <== ALWAYS TAKEN 4002a6a4: 90 10 00 1d mov %i5, %o0 4002a6a8: 81 c7 e0 08 ret 4002a6ac: 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 ); 4002a6b0: 40 00 03 5e call 4002b428 <_Timespec_Divide_by_integer> 4002a6b4: 92 10 00 01 mov %g1, %o1 (*print)( context, 4002a6b8: d0 07 bf d4 ld [ %fp + -44 ], %o0 4002a6bc: 40 00 ae e2 call 40056244 <.div> 4002a6c0: 92 10 23 e8 mov 0x3e8, %o1 4002a6c4: aa 10 00 08 mov %o0, %l5 4002a6c8: d0 07 bf dc ld [ %fp + -36 ], %o0 4002a6cc: 40 00 ae de call 40056244 <.div> 4002a6d0: 92 10 23 e8 mov 0x3e8, %o1 4002a6d4: c2 07 bf a8 ld [ %fp + -88 ], %g1 4002a6d8: a2 10 00 08 mov %o0, %l1 4002a6dc: d0 07 bf ac ld [ %fp + -84 ], %o0 4002a6e0: e0 07 bf d0 ld [ %fp + -48 ], %l0 4002a6e4: e8 07 bf d8 ld [ %fp + -40 ], %l4 4002a6e8: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 4002a6ec: 40 00 ae d6 call 40056244 <.div> 4002a6f0: 92 10 23 e8 mov 0x3e8, %o1 4002a6f4: 96 10 00 15 mov %l5, %o3 4002a6f8: 98 10 00 14 mov %l4, %o4 4002a6fc: 9a 10 00 11 mov %l1, %o5 4002a700: d0 23 a0 60 st %o0, [ %sp + 0x60 ] 4002a704: 92 10 00 13 mov %l3, %o1 4002a708: 94 10 00 10 mov %l0, %o2 4002a70c: 9f c6 40 00 call %i1 4002a710: 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); 4002a714: d2 07 bf c8 ld [ %fp + -56 ], %o1 4002a718: 94 07 bf a8 add %fp, -88, %o2 4002a71c: 40 00 03 43 call 4002b428 <_Timespec_Divide_by_integer> 4002a720: 90 07 bf f8 add %fp, -8, %o0 (*print)( context, 4002a724: d0 07 bf ec ld [ %fp + -20 ], %o0 4002a728: 40 00 ae c7 call 40056244 <.div> 4002a72c: 92 10 23 e8 mov 0x3e8, %o1 4002a730: a8 10 00 08 mov %o0, %l4 4002a734: d0 07 bf f4 ld [ %fp + -12 ], %o0 4002a738: 40 00 ae c3 call 40056244 <.div> 4002a73c: 92 10 23 e8 mov 0x3e8, %o1 4002a740: c2 07 bf a8 ld [ %fp + -88 ], %g1 4002a744: a0 10 00 08 mov %o0, %l0 4002a748: d0 07 bf ac ld [ %fp + -84 ], %o0 4002a74c: ea 07 bf e8 ld [ %fp + -24 ], %l5 4002a750: e2 07 bf f0 ld [ %fp + -16 ], %l1 4002a754: 92 10 23 e8 mov 0x3e8, %o1 4002a758: 40 00 ae bb call 40056244 <.div> 4002a75c: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 4002a760: 92 10 00 12 mov %l2, %o1 4002a764: d0 23 a0 60 st %o0, [ %sp + 0x60 ] 4002a768: 94 10 00 15 mov %l5, %o2 4002a76c: 90 10 00 18 mov %i0, %o0 4002a770: 96 10 00 14 mov %l4, %o3 4002a774: 98 10 00 11 mov %l1, %o4 4002a778: 9f c6 40 00 call %i1 4002a77c: 9a 10 00 10 mov %l0, %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 ; 4002a780: 10 bf ff a6 b 4002a618 4002a784: c2 07 20 0c ld [ %i4 + 0xc ], %g1 =============================================================================== 4002a7a0 : /* * rtems_rate_monotonic_reset_all_statistics */ void rtems_rate_monotonic_reset_all_statistics( void ) { 4002a7a0: 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) { uint32_t level = _Thread_Dispatch_disable_level; 4002a7a4: 03 10 01 a6 sethi %hi(0x40069800), %g1 4002a7a8: c4 00 60 90 ld [ %g1 + 0x90 ], %g2 ! 40069890 <_Thread_Dispatch_disable_level> ++level; 4002a7ac: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 4002a7b0: c4 20 60 90 st %g2, [ %g1 + 0x90 ] /* * 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 ; 4002a7b4: 39 10 01 a8 sethi %hi(0x4006a000), %i4 4002a7b8: b8 17 23 68 or %i4, 0x368, %i4 ! 4006a368 <_Rate_monotonic_Information> 4002a7bc: fa 07 20 08 ld [ %i4 + 8 ], %i5 4002a7c0: c2 07 20 0c ld [ %i4 + 0xc ], %g1 4002a7c4: 80 a7 40 01 cmp %i5, %g1 4002a7c8: 18 80 00 09 bgu 4002a7ec <== NEVER TAKEN 4002a7cc: 01 00 00 00 nop id <= _Rate_monotonic_Information.maximum_id ; id++ ) { (void) rtems_rate_monotonic_reset_statistics( id ); 4002a7d0: 40 00 00 09 call 4002a7f4 4002a7d4: 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 ; 4002a7d8: c2 07 20 0c ld [ %i4 + 0xc ], %g1 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 4002a7dc: 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 ; 4002a7e0: 80 a0 40 1d cmp %g1, %i5 4002a7e4: 1a bf ff fb bcc 4002a7d0 4002a7e8: 01 00 00 00 nop } /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); 4002a7ec: 7f ff 80 98 call 4000aa4c <_Thread_Enable_dispatch> 4002a7f0: 81 e8 00 00 restore =============================================================================== 400094f4 : return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { 400094f4: 9d e3 bf a0 save %sp, -96, %sp void *ptr = NULL; rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; uintptr_t alignment = control->alignment; 400094f8: fa 06 20 30 ld [ %i0 + 0x30 ], %i5 #include static uintptr_t align_up(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; 400094fc: 90 10 00 19 mov %i1, %o0 40009500: 40 00 2f 87 call 4001531c <.urem> 40009504: 92 10 00 1d mov %i5, %o1 if (excess > 0) { 40009508: 80 a2 20 00 cmp %o0, 0 4000950c: 02 80 00 26 be 400095a4 <== ALWAYS TAKEN 40009510: b6 10 00 19 mov %i1, %i3 value += alignment - excess; 40009514: ba 06 40 1d add %i1, %i5, %i5 <== NOT EXECUTED 40009518: b6 27 40 08 sub %i5, %o0, %i3 <== NOT EXECUTED 4000951c: 80 a6 c0 19 cmp %i3, %i1 <== NOT EXECUTED 40009520: 82 60 3f ff subx %g0, -1, %g1 <== NOT EXECUTED rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; uintptr_t alignment = control->alignment; uintptr_t aligned_size = align_up(alignment, size); if (size > 0 && size <= aligned_size) { 40009524: 80 88 60 ff btst 0xff, %g1 40009528: 02 80 00 1d be 4000959c <== NEVER TAKEN 4000952c: 80 a6 60 00 cmp %i1, 0 40009530: 02 80 00 1b be 4000959c 40009534: 82 06 20 04 add %i0, 4, %g1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 40009538: fa 06 00 00 ld [ %i0 ], %i5 { rtems_chain_node *current = rtems_chain_first(free_chain); const rtems_chain_node *tail = rtems_chain_tail(free_chain); rtems_rbheap_chunk *big_enough = NULL; while (current != tail && big_enough == NULL) { 4000953c: 80 a7 40 01 cmp %i5, %g1 40009540: 02 80 00 17 be 4000959c 40009544: 01 00 00 00 nop rtems_rbheap_chunk *free_chunk = (rtems_rbheap_chunk *) current; if (free_chunk->size >= size) { 40009548: f8 07 60 1c ld [ %i5 + 0x1c ], %i4 4000954c: 80 a6 c0 1c cmp %i3, %i4 40009550: 38 80 00 10 bgu,a 40009590 40009554: fa 07 40 00 ld [ %i5 ], %i5 uintptr_t aligned_size = align_up(alignment, size); if (size > 0 && size <= aligned_size) { rtems_rbheap_chunk *free_chunk = search_free_chunk(free_chain, aligned_size); if (free_chunk != NULL) { 40009558: 80 a7 60 00 cmp %i5, 0 4000955c: 02 80 00 10 be 4000959c <== NEVER TAKEN 40009560: 80 a7 00 1b cmp %i4, %i3 uintptr_t free_size = free_chunk->size; if (free_size > aligned_size) { 40009564: 18 80 00 12 bgu 400095ac 40009568: 01 00 00 00 nop ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4000956c: c4 07 40 00 ld [ %i5 ], %g2 previous = the_node->previous; 40009570: c2 07 60 04 ld [ %i5 + 4 ], %g1 ptr = (void *) new_chunk->begin; } } else { rtems_chain_extract_unprotected(&free_chunk->chain_node); rtems_chain_set_off_chain(&free_chunk->chain_node); ptr = (void *) free_chunk->begin; 40009574: f0 07 60 18 ld [ %i5 + 0x18 ], %i0 next->previous = previous; 40009578: c2 20 a0 04 st %g1, [ %g2 + 4 ] previous->next = next; 4000957c: c4 20 40 00 st %g2, [ %g1 ] */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = node->previous = NULL; 40009580: c0 27 60 04 clr [ %i5 + 4 ] 40009584: c0 27 40 00 clr [ %i5 ] } } } return ptr; } 40009588: 81 c7 e0 08 ret 4000958c: 81 e8 00 00 restore { rtems_chain_node *current = rtems_chain_first(free_chain); const rtems_chain_node *tail = rtems_chain_tail(free_chain); rtems_rbheap_chunk *big_enough = NULL; while (current != tail && big_enough == NULL) { 40009590: 80 a0 40 1d cmp %g1, %i5 40009594: 32 bf ff ee bne,a 4000954c <== NEVER TAKEN 40009598: f8 07 60 1c ld [ %i5 + 0x1c ], %i4 <== NOT EXECUTED return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { void *ptr = NULL; 4000959c: 81 c7 e0 08 ret 400095a0: 91 e8 20 00 restore %g0, 0, %o0 static uintptr_t align_up(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; if (excess > 0) { 400095a4: 10 bf ff e0 b 40009524 400095a8: 82 10 20 01 mov 1, %g1 if (free_chunk != NULL) { uintptr_t free_size = free_chunk->size; if (free_size > aligned_size) { rtems_rbheap_chunk *new_chunk = get_chunk(control); 400095ac: 7f ff ff 46 call 400092c4 400095b0: 90 10 00 18 mov %i0, %o0 if (new_chunk != NULL) { 400095b4: b4 92 20 00 orcc %o0, 0, %i2 400095b8: 02 bf ff f9 be 4000959c <== NEVER TAKEN 400095bc: b8 27 00 1b sub %i4, %i3, %i4 uintptr_t new_free_size = free_size - aligned_size; free_chunk->size = new_free_size; new_chunk->begin = free_chunk->begin + new_free_size; 400095c0: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 rtems_rbheap_chunk *new_chunk = get_chunk(control); if (new_chunk != NULL) { uintptr_t new_free_size = free_size - aligned_size; free_chunk->size = new_free_size; 400095c4: f8 27 60 1c st %i4, [ %i5 + 0x1c ] new_chunk->begin = free_chunk->begin + new_free_size; new_chunk->size = aligned_size; 400095c8: f6 26 a0 1c st %i3, [ %i2 + 0x1c ] if (new_chunk != NULL) { uintptr_t new_free_size = free_size - aligned_size; free_chunk->size = new_free_size; new_chunk->begin = free_chunk->begin + new_free_size; 400095cc: b8 07 00 01 add %i4, %g1, %i4 400095d0: c0 26 a0 04 clr [ %i2 + 4 ] 400095d4: f8 26 a0 18 st %i4, [ %i2 + 0x18 ] 400095d8: c0 26 80 00 clr [ %i2 ] static void insert_into_tree( rtems_rbtree_control *tree, rtems_rbheap_chunk *chunk ) { _RBTree_Insert_unprotected(tree, &chunk->tree_node); 400095dc: 90 06 20 18 add %i0, 0x18, %o0 400095e0: 40 00 06 fd call 4000b1d4 <_RBTree_Insert_unprotected> 400095e4: 92 06 a0 08 add %i2, 8, %o1 free_chunk->size = new_free_size; new_chunk->begin = free_chunk->begin + new_free_size; new_chunk->size = aligned_size; rtems_chain_set_off_chain(&new_chunk->chain_node); insert_into_tree(chunk_tree, new_chunk); ptr = (void *) new_chunk->begin; 400095e8: f0 06 a0 18 ld [ %i2 + 0x18 ], %i0 400095ec: 81 c7 e0 08 ret 400095f0: 81 e8 00 00 restore =============================================================================== 40009738 : /* Do nothing */ } void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control) { 40009738: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); 4000973c: 7f ff ec d6 call 40004a94 <== NOT EXECUTED 40009740: 90 10 20 20 mov 0x20, %o0 <== NOT EXECUTED if (chunk != NULL) { 40009744: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 40009748: 02 80 00 07 be 40009764 <== NOT EXECUTED 4000974c: 84 06 20 0c add %i0, 0xc, %g2 <== NOT EXECUTED ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 40009750: c2 06 20 0c ld [ %i0 + 0xc ], %g1 <== NOT EXECUTED after_node->next = the_node; 40009754: d0 26 20 0c st %o0, [ %i0 + 0xc ] <== NOT EXECUTED Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 40009758: c4 22 20 04 st %g2, [ %o0 + 4 ] <== NOT EXECUTED before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; 4000975c: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED before_node->previous = the_node; 40009760: d0 20 60 04 st %o0, [ %g1 + 4 ] <== NOT EXECUTED 40009764: 81 c7 e0 08 ret <== NOT EXECUTED 40009768: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 400095f4 : _RBTree_Extract_unprotected(chunk_tree, &b->tree_node); } } rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr) { 400095f4: 9d e3 bf 80 save %sp, -128, %sp 400095f8: b4 10 00 18 mov %i0, %i2 rtems_status_code sc = RTEMS_SUCCESSFUL; if (ptr != NULL) { 400095fc: 80 a6 60 00 cmp %i1, 0 40009600: 02 80 00 2a be 400096a8 40009604: b0 10 20 00 clr %i0 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; 40009608: fa 06 a0 1c ld [ %i2 + 0x1c ], %i5 #define NULL_PAGE rtems_rbheap_chunk_of_node(NULL) static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key) { rtems_rbheap_chunk chunk = { .begin = key }; 4000960c: c0 27 bf fc clr [ %fp + -4 ] 40009610: c0 27 bf e0 clr [ %fp + -32 ] 40009614: c0 27 bf e4 clr [ %fp + -28 ] 40009618: c0 27 bf e8 clr [ %fp + -24 ] 4000961c: c0 27 bf ec clr [ %fp + -20 ] 40009620: c0 27 bf f0 clr [ %fp + -16 ] 40009624: c0 27 bf f4 clr [ %fp + -12 ] 40009628: f2 27 bf f8 st %i1, [ %fp + -8 ] RBTree_Node* found = NULL; int compare_result; while (iter_node) { 4000962c: 80 a7 60 00 cmp %i5, 0 40009630: 02 80 00 3e be 40009728 <== NEVER TAKEN 40009634: b8 06 a0 18 add %i2, 0x18, %i4 40009638: b6 10 20 00 clr %i3 compare_result = the_rbtree->compare_function(the_node, iter_node); 4000963c: c2 07 20 10 ld [ %i4 + 0x10 ], %g1 40009640: 92 10 00 1d mov %i5, %o1 40009644: 9f c0 40 00 call %g1 40009648: 90 07 bf e8 add %fp, -24, %o0 RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater( int compare_result ) { return compare_result > 0; 4000964c: 83 3a 20 1f sra %o0, 0x1f, %g1 RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( _RBTree_Is_equal( compare_result ) ) { 40009650: 80 a2 20 00 cmp %o0, 0 RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater( int compare_result ) { return compare_result > 0; 40009654: 82 20 40 08 sub %g1, %o0, %g1 40009658: 83 30 60 1f srl %g1, 0x1f, %g1 break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; 4000965c: 83 28 60 02 sll %g1, 2, %g1 RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( _RBTree_Is_equal( compare_result ) ) { 40009660: 12 80 00 06 bne 40009678 40009664: 82 07 40 01 add %i5, %g1, %g1 found = iter_node; if ( the_rbtree->is_unique ) 40009668: c4 0f 20 14 ldub [ %i4 + 0x14 ], %g2 4000966c: 80 a0 a0 00 cmp %g2, 0 40009670: 12 80 00 10 bne 400096b0 <== ALWAYS TAKEN 40009674: b6 10 00 1d mov %i5, %i3 break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; 40009678: fa 00 60 04 ld [ %g1 + 4 ], %i5 ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { 4000967c: 80 a7 60 00 cmp %i5, 0 40009680: 32 bf ff f0 bne,a 40009640 40009684: c2 07 20 10 ld [ %i4 + 0x10 ], %g1 return rtems_rbheap_chunk_of_node( 40009688: ba 06 ff f8 add %i3, -8, %i5 if (ptr != NULL) { rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr); if (chunk != NULL_PAGE) { 4000968c: 80 a7 7f f8 cmp %i5, -8 40009690: 02 80 00 06 be 400096a8 40009694: b0 10 20 04 mov 4, %i0 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 40009698: c2 06 ff f8 ld [ %i3 + -8 ], %g1 4000969c: 80 a0 60 00 cmp %g1, 0 400096a0: 02 80 00 06 be 400096b8 400096a4: b0 10 20 0e mov 0xe, %i0 sc = RTEMS_INVALID_ID; } } return sc; } 400096a8: 81 c7 e0 08 ret 400096ac: 81 e8 00 00 restore static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key) { rtems_rbheap_chunk chunk = { .begin = key }; return rtems_rbheap_chunk_of_node( 400096b0: 10 bf ff f7 b 4000968c 400096b4: ba 06 ff f8 add %i3, -8, %i5 400096b8: c2 06 ff fc ld [ %i3 + -4 ], %g1 400096bc: 80 a0 60 00 cmp %g1, 0 400096c0: 12 bf ff fa bne 400096a8 <== NEVER TAKEN 400096c4: 92 10 20 00 clr %o1 static rtems_rbheap_chunk *get_next( const rtems_rbheap_chunk *chunk, RBTree_Direction dir ) { return rtems_rbheap_chunk_of_node( 400096c8: 40 00 07 92 call 4000b510 <_RBTree_Next_unprotected> 400096cc: 90 10 00 1b mov %i3, %o0 400096d0: 92 10 20 01 mov 1, %o1 400096d4: b2 10 00 08 mov %o0, %i1 400096d8: 40 00 07 8e call 4000b510 <_RBTree_Next_unprotected> 400096dc: 90 10 00 1b mov %i3, %o0 if (chunk != NULL_PAGE) { if (!rtems_rbheap_is_chunk_free(chunk)) { rtems_rbheap_chunk *pred = get_next(chunk, RBT_LEFT); rtems_rbheap_chunk *succ = get_next(chunk, RBT_RIGHT); check_and_merge(free_chain, chunk_tree, chunk, succ); 400096e0: 92 10 00 1c mov %i4, %o1 static rtems_rbheap_chunk *get_next( const rtems_rbheap_chunk *chunk, RBTree_Direction dir ) { return rtems_rbheap_chunk_of_node( 400096e4: 96 02 3f f8 add %o0, -8, %o3 if (chunk != NULL_PAGE) { if (!rtems_rbheap_is_chunk_free(chunk)) { rtems_rbheap_chunk *pred = get_next(chunk, RBT_LEFT); rtems_rbheap_chunk *succ = get_next(chunk, RBT_RIGHT); check_and_merge(free_chain, chunk_tree, chunk, succ); 400096e8: 94 10 00 1d mov %i5, %o2 400096ec: 7f ff ff 10 call 4000932c 400096f0: 90 10 00 1a mov %i2, %o0 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 400096f4: c2 06 80 00 ld [ %i2 ], %g1 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 400096f8: f4 26 ff fc st %i2, [ %i3 + -4 ] before_node = after_node->next; after_node->next = the_node; 400096fc: fa 26 80 00 st %i5, [ %i2 ] the_node->next = before_node; 40009700: c2 26 ff f8 st %g1, [ %i3 + -8 ] before_node->previous = the_node; 40009704: fa 20 60 04 st %i5, [ %g1 + 4 ] add_to_chain(free_chain, chunk); check_and_merge(free_chain, chunk_tree, chunk, pred); 40009708: 90 10 00 1a mov %i2, %o0 4000970c: 92 10 00 1c mov %i4, %o1 40009710: 94 10 00 1d mov %i5, %o2 40009714: 96 06 7f f8 add %i1, -8, %o3 40009718: 7f ff ff 05 call 4000932c 4000971c: b0 10 20 00 clr %i0 40009720: 81 c7 e0 08 ret 40009724: 81 e8 00 00 restore sc = RTEMS_INVALID_ID; } } return sc; } 40009728: 81 c7 e0 08 ret <== NOT EXECUTED 4000972c: 91 e8 20 04 restore %g0, 4, %o0 <== NOT EXECUTED =============================================================================== 400093c4 : uintptr_t area_size, uintptr_t alignment, rtems_rbheap_extend_descriptors extend_descriptors, void *handler_arg ) { 400093c4: 9d e3 bf a0 save %sp, -96, %sp rtems_status_code sc = RTEMS_SUCCESSFUL; if (alignment > 0) { 400093c8: 80 a6 e0 00 cmp %i3, 0 400093cc: 12 80 00 04 bne 400093dc 400093d0: 82 10 20 0a mov 0xa, %g1 } else { sc = RTEMS_INVALID_NUMBER; } return sc; } 400093d4: 81 c7 e0 08 ret 400093d8: 91 e8 00 01 restore %g0, %g1, %o0 #include static uintptr_t align_up(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; 400093dc: 90 10 00 19 mov %i1, %o0 400093e0: 92 10 00 1b mov %i3, %o1 400093e4: 40 00 2f ce call 4001531c <.urem> 400093e8: b4 06 40 1a add %i1, %i2, %i2 if (excess > 0) { 400093ec: 80 a2 20 00 cmp %o0, 0 400093f0: 32 80 00 09 bne,a 40009414 400093f4: a0 06 40 1b add %i1, %i3, %l0 400093f8: 82 10 20 01 mov 1, %g1 uintptr_t begin = (uintptr_t) area_begin; uintptr_t end = begin + area_size; uintptr_t aligned_begin = align_up(alignment, begin); uintptr_t aligned_end = align_down(alignment, end); if (begin < end && begin <= aligned_begin && aligned_begin < aligned_end) { 400093fc: 80 88 60 ff btst 0xff, %g1 40009400: 12 80 00 0b bne 4000942c <== ALWAYS TAKEN 40009404: a0 10 00 19 mov %i1, %l0 insert_into_tree(chunk_tree, first); } else { sc = RTEMS_NO_MEMORY; } } else { sc = RTEMS_INVALID_ADDRESS; 40009408: 82 10 20 09 mov 9, %g1 <== NOT EXECUTED } else { sc = RTEMS_INVALID_NUMBER; } return sc; } 4000940c: 81 c7 e0 08 ret 40009410: 91 e8 00 01 restore %g0, %g1, %o0 static uintptr_t align_up(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; if (excess > 0) { value += alignment - excess; 40009414: a0 24 00 08 sub %l0, %o0, %l0 40009418: 80 a4 00 19 cmp %l0, %i1 4000941c: 82 60 3f ff subx %g0, -1, %g1 uintptr_t begin = (uintptr_t) area_begin; uintptr_t end = begin + area_size; uintptr_t aligned_begin = align_up(alignment, begin); uintptr_t aligned_end = align_down(alignment, end); if (begin < end && begin <= aligned_begin && aligned_begin < aligned_end) { 40009420: 80 88 60 ff btst 0xff, %g1 40009424: 02 bf ff fa be 4000940c 40009428: 82 10 20 09 mov 9, %g1 4000942c: 80 a6 40 1a cmp %i1, %i2 40009430: 1a bf ff f7 bcc 4000940c 40009434: 82 10 20 09 mov 9, %g1 return value; } static uintptr_t align_down(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; 40009438: 90 10 00 1a mov %i2, %o0 4000943c: 40 00 2f b8 call 4001531c <.urem> 40009440: 92 10 00 1b mov %i3, %o1 return value - excess; 40009444: b4 26 80 08 sub %i2, %o0, %i2 uintptr_t begin = (uintptr_t) area_begin; uintptr_t end = begin + area_size; uintptr_t aligned_begin = align_up(alignment, begin); uintptr_t aligned_end = align_down(alignment, end); if (begin < end && begin <= aligned_begin && aligned_begin < aligned_end) { 40009448: 80 a4 00 1a cmp %l0, %i2 4000944c: 1a bf ff e2 bcc 400093d4 40009450: 82 10 20 09 mov 9, %g1 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 ); 40009454: 82 06 20 04 add %i0, 4, %g1 head->next = tail; 40009458: c2 26 00 00 st %g1, [ %i0 ] 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 ); 4000945c: 82 06 20 0c add %i0, 0xc, %g1 head->next = tail; head->previous = NULL; tail->previous = head; 40009460: c2 26 20 14 st %g1, [ %i0 + 0x14 ] the_rbtree->permanent_null = NULL; the_rbtree->root = NULL; the_rbtree->first[0] = NULL; the_rbtree->first[1] = NULL; the_rbtree->compare_function = compare_function; the_rbtree->is_unique = is_unique; 40009464: 82 10 20 01 mov 1, %g1 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 ); 40009468: 84 06 20 10 add %i0, 0x10, %g2 4000946c: c2 2e 20 2c stb %g1, [ %i0 + 0x2c ] { the_rbtree->permanent_null = NULL; the_rbtree->root = NULL; the_rbtree->first[0] = NULL; the_rbtree->first[1] = NULL; the_rbtree->compare_function = compare_function; 40009470: 03 10 00 24 sethi %hi(0x40009000), %g1 40009474: 82 10 62 b4 or %g1, 0x2b4, %g1 ! 400092b4 head->next = tail; head->previous = NULL; 40009478: c0 26 20 04 clr [ %i0 + 4 ] 4000947c: c2 26 20 28 st %g1, [ %i0 + 0x28 ] tail->previous = head; 40009480: f0 26 20 08 st %i0, [ %i0 + 8 ] { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 40009484: c0 26 20 10 clr [ %i0 + 0x10 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 40009488: c4 26 20 0c st %g2, [ %i0 + 0xc ] RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 4000948c: c0 26 20 18 clr [ %i0 + 0x18 ] the_rbtree->root = NULL; 40009490: c0 26 20 1c clr [ %i0 + 0x1c ] the_rbtree->first[0] = NULL; 40009494: c0 26 20 20 clr [ %i0 + 0x20 ] the_rbtree->first[1] = NULL; 40009498: c0 26 20 24 clr [ %i0 + 0x24 ] rtems_rbheap_chunk *first = NULL; rtems_chain_initialize_empty(free_chain); rtems_chain_initialize_empty(&control->spare_descriptor_chain); rtems_rbtree_initialize_empty(chunk_tree, chunk_compare, true); control->alignment = alignment; 4000949c: f6 26 20 30 st %i3, [ %i0 + 0x30 ] control->handler_arg = handler_arg; 400094a0: fa 26 20 38 st %i5, [ %i0 + 0x38 ] control->extend_descriptors = extend_descriptors; 400094a4: f8 26 20 34 st %i4, [ %i0 + 0x34 ] first = get_chunk(control); 400094a8: 7f ff ff 87 call 400092c4 400094ac: 90 10 00 18 mov %i0, %o0 first->begin = aligned_begin; first->size = aligned_end - aligned_begin; add_to_chain(free_chain, first); insert_into_tree(chunk_tree, first); } else { sc = RTEMS_NO_MEMORY; 400094b0: 82 10 20 1a mov 0x1a, %g1 control->alignment = alignment; control->handler_arg = handler_arg; control->extend_descriptors = extend_descriptors; first = get_chunk(control); if (first != NULL) { 400094b4: 80 a2 20 00 cmp %o0, 0 400094b8: 02 bf ff c7 be 400093d4 400094bc: 92 10 00 08 mov %o0, %o1 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 400094c0: c2 06 00 00 ld [ %i0 ], %g1 first->begin = aligned_begin; first->size = aligned_end - aligned_begin; 400094c4: b4 26 80 10 sub %i2, %l0, %i2 control->handler_arg = handler_arg; control->extend_descriptors = extend_descriptors; first = get_chunk(control); if (first != NULL) { first->begin = aligned_begin; 400094c8: e0 22 20 18 st %l0, [ %o0 + 0x18 ] first->size = aligned_end - aligned_begin; 400094cc: f4 22 20 1c st %i2, [ %o0 + 0x1c ] Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 400094d0: f0 22 20 04 st %i0, [ %o0 + 4 ] before_node = after_node->next; after_node->next = the_node; 400094d4: d0 26 00 00 st %o0, [ %i0 ] the_node->next = before_node; 400094d8: c2 22 00 00 st %g1, [ %o0 ] before_node->previous = the_node; 400094dc: d0 20 60 04 st %o0, [ %g1 + 4 ] static void insert_into_tree( rtems_rbtree_control *tree, rtems_rbheap_chunk *chunk ) { _RBTree_Insert_unprotected(tree, &chunk->tree_node); 400094e0: 92 02 60 08 add %o1, 8, %o1 400094e4: 40 00 07 3c call 4000b1d4 <_RBTree_Insert_unprotected> 400094e8: 90 06 20 18 add %i0, 0x18, %o0 uintptr_t alignment, rtems_rbheap_extend_descriptors extend_descriptors, void *handler_arg ) { rtems_status_code sc = RTEMS_SUCCESSFUL; 400094ec: 10 bf ff ba b 400093d4 400094f0: 82 10 20 00 clr %g1 =============================================================================== 40017790 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 40017790: 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 ) 40017794: 80 a6 60 00 cmp %i1, 0 40017798: 12 80 00 04 bne 400177a8 4001779c: 82 10 20 0a mov 0xa, %g1 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 400177a0: 81 c7 e0 08 ret 400177a4: 91 e8 00 01 restore %g0, %g1, %o0 ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 400177a8: 90 10 00 18 mov %i0, %o0 400177ac: 40 00 13 a5 call 4001c640 <_Thread_Get> 400177b0: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 400177b4: c2 07 bf fc ld [ %fp + -4 ], %g1 400177b8: 80 a0 60 00 cmp %g1, 0 400177bc: 12 80 00 20 bne 4001783c 400177c0: b8 10 00 08 mov %o0, %i4 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 400177c4: fa 02 21 4c ld [ %o0 + 0x14c ], %i5 asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 400177c8: c2 07 60 0c ld [ %i5 + 0xc ], %g1 400177cc: 80 a0 60 00 cmp %g1, 0 400177d0: 02 80 00 1e be 40017848 400177d4: 01 00 00 00 nop if ( asr->is_enabled ) { 400177d8: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 400177dc: 80 a0 60 00 cmp %g1, 0 400177e0: 02 80 00 1e be 40017858 400177e4: 01 00 00 00 nop rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 400177e8: 7f ff df 75 call 4000f5bc 400177ec: 01 00 00 00 nop *signal_set |= signals; 400177f0: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 400177f4: b2 10 40 19 or %g1, %i1, %i1 400177f8: f2 27 60 14 st %i1, [ %i5 + 0x14 ] _ISR_Enable( _level ); 400177fc: 7f ff df 74 call 4000f5cc 40017800: 01 00 00 00 nop _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 40017804: 03 10 00 fb sethi %hi(0x4003ec00), %g1 40017808: 82 10 61 80 or %g1, 0x180, %g1 ! 4003ed80 <_Per_CPU_Information> 4001780c: c4 00 60 08 ld [ %g1 + 8 ], %g2 40017810: 80 a0 a0 00 cmp %g2, 0 40017814: 02 80 00 06 be 4001782c 40017818: 01 00 00 00 nop 4001781c: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 40017820: 80 a7 00 02 cmp %i4, %g2 40017824: 02 80 00 15 be 40017878 <== ALWAYS TAKEN 40017828: 84 10 20 01 mov 1, %g2 _Thread_Dispatch_necessary = true; } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 4001782c: 40 00 13 79 call 4001c610 <_Thread_Enable_dispatch> 40017830: 01 00 00 00 nop return RTEMS_SUCCESSFUL; 40017834: 10 bf ff db b 400177a0 40017838: 82 10 20 00 clr %g1 ! 0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4001783c: 82 10 20 04 mov 4, %g1 } 40017840: 81 c7 e0 08 ret 40017844: 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(); 40017848: 40 00 13 72 call 4001c610 <_Thread_Enable_dispatch> 4001784c: 01 00 00 00 nop return RTEMS_NOT_DEFINED; 40017850: 10 bf ff d4 b 400177a0 40017854: 82 10 20 0b mov 0xb, %g1 ! b rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 40017858: 7f ff df 59 call 4000f5bc 4001785c: 01 00 00 00 nop *signal_set |= signals; 40017860: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 40017864: b2 10 40 19 or %g1, %i1, %i1 40017868: f2 27 60 18 st %i1, [ %i5 + 0x18 ] _ISR_Enable( _level ); 4001786c: 7f ff df 58 call 4000f5cc 40017870: 01 00 00 00 nop 40017874: 30 bf ff ee b,a 4001782c 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; 40017878: c4 28 60 0c stb %g2, [ %g1 + 0xc ] 4001787c: 30 bf ff ec b,a 4001782c =============================================================================== 4001298c : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 4001298c: 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 ) 40012990: 80 a6 a0 00 cmp %i2, 0 40012994: 02 80 00 3b be 40012a80 40012998: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 4001299c: 21 10 00 73 sethi %hi(0x4001cc00), %l0 400129a0: a0 14 23 b0 or %l0, 0x3b0, %l0 ! 4001cfb0 <_Per_CPU_Information> 400129a4: fa 04 20 10 ld [ %l0 + 0x10 ], %i5 api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 400129a8: c4 0f 60 70 ldub [ %i5 + 0x70 ], %g2 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 400129ac: c2 07 60 78 ld [ %i5 + 0x78 ], %g1 executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 400129b0: 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 ]; 400129b4: f8 07 61 4c ld [ %i5 + 0x14c ], %i4 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 400129b8: b6 60 3f ff subx %g0, -1, %i3 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 400129bc: 80 a0 60 00 cmp %g1, 0 400129c0: 12 80 00 40 bne 40012ac0 400129c4: 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; 400129c8: c2 0f 20 08 ldub [ %i4 + 8 ], %g1 400129cc: 80 a0 00 01 cmp %g0, %g1 old_mode |= _ISR_Get_level(); 400129d0: 7f ff eb e1 call 4000d954 <_CPU_ISR_Get_level> 400129d4: 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; 400129d8: a3 2c 60 0a sll %l1, 0xa, %l1 400129dc: 90 14 40 08 or %l1, %o0, %o0 old_mode |= _ISR_Get_level(); 400129e0: b6 12 00 1b or %o0, %i3, %i3 *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 400129e4: 80 8e 61 00 btst 0x100, %i1 400129e8: 02 80 00 06 be 40012a00 400129ec: 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; 400129f0: 83 36 20 08 srl %i0, 8, %g1 400129f4: 82 18 60 01 xor %g1, 1, %g1 400129f8: 82 08 60 01 and %g1, 1, %g1 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 400129fc: c2 2f 60 70 stb %g1, [ %i5 + 0x70 ] if ( mask & RTEMS_TIMESLICE_MASK ) { 40012a00: 80 8e 62 00 btst 0x200, %i1 40012a04: 12 80 00 21 bne 40012a88 40012a08: 80 8e 22 00 btst 0x200, %i0 } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 40012a0c: 80 8e 60 0f btst 0xf, %i1 40012a10: 12 80 00 27 bne 40012aac 40012a14: 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 ) { 40012a18: 80 8e 64 00 btst 0x400, %i1 40012a1c: 02 80 00 14 be 40012a6c 40012a20: 86 10 20 00 clr %g3 is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 40012a24: c2 0f 20 08 ldub [ %i4 + 8 ], %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; 40012a28: b1 36 20 0a srl %i0, 0xa, %i0 40012a2c: b0 1e 20 01 xor %i0, 1, %i0 40012a30: b0 0e 20 01 and %i0, 1, %i0 if ( is_asr_enabled != asr->is_enabled ) { 40012a34: 80 a6 00 01 cmp %i0, %g1 40012a38: 22 80 00 0e be,a 40012a70 40012a3c: 03 10 00 73 sethi %hi(0x4001cc00), %g1 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 40012a40: 7f ff c0 5e call 40002bb8 40012a44: f0 2f 20 08 stb %i0, [ %i4 + 8 ] _signals = information->signals_pending; 40012a48: c4 07 20 18 ld [ %i4 + 0x18 ], %g2 information->signals_pending = information->signals_posted; 40012a4c: c2 07 20 14 ld [ %i4 + 0x14 ], %g1 information->signals_posted = _signals; 40012a50: 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; 40012a54: c2 27 20 18 st %g1, [ %i4 + 0x18 ] information->signals_posted = _signals; _ISR_Enable( _level ); 40012a58: 7f ff c0 5c call 40002bc8 40012a5c: 01 00 00 00 nop asr->is_enabled = is_asr_enabled; _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { 40012a60: c2 07 20 14 ld [ %i4 + 0x14 ], %g1 40012a64: 80 a0 00 01 cmp %g0, %g1 40012a68: 86 40 20 00 addx %g0, 0, %g3 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 40012a6c: 03 10 00 73 sethi %hi(0x4001cc00), %g1 40012a70: c4 00 63 a8 ld [ %g1 + 0x3a8 ], %g2 ! 4001cfa8 <_System_state_Current> 40012a74: 80 a0 a0 03 cmp %g2, 3 40012a78: 02 80 00 1f be 40012af4 40012a7c: 82 10 20 00 clr %g1 if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; } 40012a80: 81 c7 e0 08 ret 40012a84: 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) ) { 40012a88: 22 bf ff e1 be,a 40012a0c 40012a8c: c0 27 60 78 clr [ %i5 + 0x78 ] executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 40012a90: 03 10 00 72 sethi %hi(0x4001c800), %g1 40012a94: c2 00 62 00 ld [ %g1 + 0x200 ], %g1 ! 4001ca00 <_Thread_Ticks_per_timeslice> } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 40012a98: 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; 40012a9c: c2 27 60 74 st %g1, [ %i5 + 0x74 ] 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; 40012aa0: 82 10 20 01 mov 1, %g1 } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 40012aa4: 02 bf ff dd be 40012a18 40012aa8: c2 27 60 78 st %g1, [ %i5 + 0x78 ] */ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level ( Modes_Control mode_set ) { return ( mode_set & RTEMS_INTERRUPT_MASK ); 40012aac: 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 ) ); 40012ab0: 7f ff c0 46 call 40002bc8 40012ab4: 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 ) { 40012ab8: 10 bf ff d9 b 40012a1c 40012abc: 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; 40012ac0: 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; 40012ac4: b6 16 e2 00 or %i3, 0x200, %i3 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 40012ac8: 80 a0 00 01 cmp %g0, %g1 old_mode |= _ISR_Get_level(); 40012acc: 7f ff eb a2 call 4000d954 <_CPU_ISR_Get_level> 40012ad0: 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; 40012ad4: a3 2c 60 0a sll %l1, 0xa, %l1 40012ad8: 90 14 40 08 or %l1, %o0, %o0 old_mode |= _ISR_Get_level(); 40012adc: b6 12 00 1b or %o0, %i3, %i3 *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 40012ae0: 80 8e 61 00 btst 0x100, %i1 40012ae4: 02 bf ff c7 be 40012a00 40012ae8: 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; 40012aec: 10 bf ff c2 b 400129f4 40012af0: 83 36 20 08 srl %i0, 8, %g1 { Thread_Control *executing; executing = _Thread_Executing; if ( are_signals_pending || 40012af4: 80 88 e0 ff btst 0xff, %g3 40012af8: 12 80 00 0a bne 40012b20 40012afc: c4 04 20 10 ld [ %l0 + 0x10 ], %g2 40012b00: c6 04 20 14 ld [ %l0 + 0x14 ], %g3 40012b04: 80 a0 80 03 cmp %g2, %g3 40012b08: 02 bf ff de be 40012a80 40012b0c: 01 00 00 00 nop (!_Thread_Is_heir( executing ) && executing->is_preemptible) ) { 40012b10: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 40012b14: 80 a0 a0 00 cmp %g2, 0 40012b18: 02 bf ff da be 40012a80 <== NEVER TAKEN 40012b1c: 01 00 00 00 nop _Thread_Dispatch_necessary = true; 40012b20: 82 10 20 01 mov 1, %g1 ! 1 40012b24: c2 2c 20 0c stb %g1, [ %l0 + 0xc ] } } if ( _System_state_Is_up( _System_state_Get() ) ) { if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); 40012b28: 7f ff e6 66 call 4000c4c0 <_Thread_Dispatch> 40012b2c: 01 00 00 00 nop } return RTEMS_SUCCESSFUL; 40012b30: 82 10 20 00 clr %g1 ! 0 } 40012b34: 81 c7 e0 08 ret 40012b38: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 4000cf44 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 4000cf44: 9d e3 bf 98 save %sp, -104, %sp register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 4000cf48: 80 a6 60 00 cmp %i1, 0 4000cf4c: 02 80 00 08 be 4000cf6c 4000cf50: 80 a6 a0 00 cmp %i2, 0 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 ) ); 4000cf54: 03 10 00 6e sethi %hi(0x4001b800), %g1 4000cf58: c4 08 63 8c ldub [ %g1 + 0x38c ], %g2 ! 4001bb8c */ RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && 4000cf5c: 80 a6 40 02 cmp %i1, %g2 4000cf60: 18 80 00 1e bgu 4000cfd8 4000cf64: 82 10 20 13 mov 0x13, %g1 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 4000cf68: 80 a6 a0 00 cmp %i2, 0 4000cf6c: 02 80 00 1b be 4000cfd8 4000cf70: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 4000cf74: 90 10 00 18 mov %i0, %o0 4000cf78: 40 00 0a 22 call 4000f800 <_Thread_Get> 4000cf7c: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000cf80: c2 07 bf fc ld [ %fp + -4 ], %g1 4000cf84: 80 a0 60 00 cmp %g1, 0 4000cf88: 12 80 00 16 bne 4000cfe0 4000cf8c: 82 10 20 04 mov 4, %g1 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 4000cf90: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 4000cf94: 80 a6 60 00 cmp %i1, 0 4000cf98: 02 80 00 0d be 4000cfcc 4000cf9c: c2 26 80 00 st %g1, [ %i2 ] the_thread->real_priority = new_priority; if ( the_thread->resource_count == 0 || 4000cfa0: c2 02 20 1c ld [ %o0 + 0x1c ], %g1 4000cfa4: 80 a0 60 00 cmp %g1, 0 4000cfa8: 02 80 00 06 be 4000cfc0 4000cfac: f2 22 20 18 st %i1, [ %o0 + 0x18 ] 4000cfb0: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000cfb4: 80 a6 40 01 cmp %i1, %g1 4000cfb8: 1a 80 00 05 bcc 4000cfcc <== ALWAYS TAKEN 4000cfbc: 01 00 00 00 nop the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 4000cfc0: 92 10 00 19 mov %i1, %o1 4000cfc4: 40 00 08 c9 call 4000f2e8 <_Thread_Change_priority> 4000cfc8: 94 10 20 00 clr %o2 } _Thread_Enable_dispatch(); 4000cfcc: 40 00 0a 01 call 4000f7d0 <_Thread_Enable_dispatch> 4000cfd0: 01 00 00 00 nop return RTEMS_SUCCESSFUL; 4000cfd4: 82 10 20 00 clr %g1 ! 0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4000cfd8: 81 c7 e0 08 ret 4000cfdc: 91 e8 00 01 restore %g0, %g1, %o0 4000cfe0: 81 c7 e0 08 ret 4000cfe4: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 4000716c : rtems_status_code rtems_task_variable_delete( rtems_id tid, void **ptr ) { 4000716c: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp, *prev; if ( !ptr ) 40007170: 80 a6 60 00 cmp %i1, 0 40007174: 02 80 00 1e be 400071ec 40007178: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; prev = NULL; the_thread = _Thread_Get (tid, &location); 4000717c: 90 10 00 18 mov %i0, %o0 40007180: 40 00 08 b1 call 40009444 <_Thread_Get> 40007184: 92 07 bf fc add %fp, -4, %o1 switch (location) { 40007188: c2 07 bf fc ld [ %fp + -4 ], %g1 4000718c: 80 a0 60 00 cmp %g1, 0 40007190: 12 80 00 19 bne 400071f4 40007194: 82 10 20 04 mov 4, %g1 case OBJECTS_LOCAL: tvp = the_thread->task_variables; 40007198: c2 02 21 58 ld [ %o0 + 0x158 ], %g1 while (tvp) { 4000719c: 80 a0 60 00 cmp %g1, 0 400071a0: 02 80 00 10 be 400071e0 400071a4: 01 00 00 00 nop if (tvp->ptr == ptr) { 400071a8: c4 00 60 04 ld [ %g1 + 4 ], %g2 400071ac: 80 a0 80 19 cmp %g2, %i1 400071b0: 32 80 00 09 bne,a 400071d4 400071b4: d2 00 40 00 ld [ %g1 ], %o1 if (prev) prev->next = tvp->next; else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; 400071b8: 10 80 00 18 b 40007218 400071bc: c4 00 40 00 ld [ %g1 ], %g2 switch (location) { case OBJECTS_LOCAL: tvp = the_thread->task_variables; while (tvp) { if (tvp->ptr == ptr) { 400071c0: 80 a0 80 19 cmp %g2, %i1 400071c4: 22 80 00 0e be,a 400071fc 400071c8: c4 02 40 00 ld [ %o1 ], %g2 400071cc: 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; 400071d0: 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) { 400071d4: 80 a2 60 00 cmp %o1, 0 400071d8: 32 bf ff fa bne,a 400071c0 <== ALWAYS TAKEN 400071dc: c4 02 60 04 ld [ %o1 + 4 ], %g2 return RTEMS_SUCCESSFUL; } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 400071e0: 40 00 08 8d call 40009414 <_Thread_Enable_dispatch> 400071e4: 01 00 00 00 nop return RTEMS_INVALID_ADDRESS; 400071e8: 82 10 20 09 mov 9, %g1 ! 9 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 400071ec: 81 c7 e0 08 ret 400071f0: 91 e8 00 01 restore %g0, %g1, %o0 400071f4: 81 c7 e0 08 ret 400071f8: 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; 400071fc: 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 ); 40007200: 40 00 00 2e call 400072b8 <_RTEMS_Tasks_Invoke_task_variable_dtor> 40007204: 01 00 00 00 nop _Thread_Enable_dispatch(); 40007208: 40 00 08 83 call 40009414 <_Thread_Enable_dispatch> 4000720c: 01 00 00 00 nop return RTEMS_SUCCESSFUL; 40007210: 10 bf ff f7 b 400071ec 40007214: 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; 40007218: 92 10 00 01 mov %g1, %o1 4000721c: 10 bf ff f9 b 40007200 40007220: c4 22 21 58 st %g2, [ %o0 + 0x158 ] =============================================================================== 40007224 : rtems_status_code rtems_task_variable_get( rtems_id tid, void **ptr, void **result ) { 40007224: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp; if ( !ptr ) 40007228: 80 a6 60 00 cmp %i1, 0 4000722c: 02 80 00 1b be 40007298 40007230: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; if ( !result ) 40007234: 80 a6 a0 00 cmp %i2, 0 40007238: 02 80 00 18 be 40007298 4000723c: 90 10 00 18 mov %i0, %o0 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 40007240: 40 00 08 81 call 40009444 <_Thread_Get> 40007244: 92 07 bf fc add %fp, -4, %o1 switch (location) { 40007248: c2 07 bf fc ld [ %fp + -4 ], %g1 4000724c: 80 a0 60 00 cmp %g1, 0 40007250: 12 80 00 14 bne 400072a0 40007254: 82 10 20 04 mov 4, %g1 case OBJECTS_LOCAL: /* * Figure out if the variable is in this task's list. */ tvp = the_thread->task_variables; 40007258: c2 02 21 58 ld [ %o0 + 0x158 ], %g1 while (tvp) { 4000725c: 80 a0 60 00 cmp %g1, 0 40007260: 32 80 00 07 bne,a 4000727c 40007264: c4 00 60 04 ld [ %g1 + 4 ], %g2 40007268: 30 80 00 10 b,a 400072a8 4000726c: 80 a0 60 00 cmp %g1, 0 40007270: 02 80 00 0e be 400072a8 <== NEVER TAKEN 40007274: 01 00 00 00 nop if (tvp->ptr == ptr) { 40007278: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000727c: 80 a0 80 19 cmp %g2, %i1 40007280: 32 bf ff fb bne,a 4000726c 40007284: 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; 40007288: c2 00 60 0c ld [ %g1 + 0xc ], %g1 _Thread_Enable_dispatch(); 4000728c: 40 00 08 62 call 40009414 <_Thread_Enable_dispatch> 40007290: c2 26 80 00 st %g1, [ %i2 ] return RTEMS_SUCCESSFUL; 40007294: 82 10 20 00 clr %g1 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 40007298: 81 c7 e0 08 ret 4000729c: 91 e8 00 01 restore %g0, %g1, %o0 400072a0: 81 c7 e0 08 ret 400072a4: 91 e8 00 01 restore %g0, %g1, %o0 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 400072a8: 40 00 08 5b call 40009414 <_Thread_Enable_dispatch> 400072ac: 01 00 00 00 nop return RTEMS_INVALID_ADDRESS; 400072b0: 10 bf ff fa b 40007298 400072b4: 82 10 20 09 mov 9, %g1 ! 9 =============================================================================== 4001827c : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 4001827c: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 40018280: 11 10 00 fc sethi %hi(0x4003f000), %o0 40018284: 92 10 00 18 mov %i0, %o1 40018288: 90 12 21 c8 or %o0, 0x1c8, %o0 4001828c: 40 00 0c fe call 4001b684 <_Objects_Get> 40018290: 94 07 bf fc add %fp, -4, %o2 Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 40018294: c2 07 bf fc ld [ %fp + -4 ], %g1 40018298: 80 a0 60 00 cmp %g1, 0 4001829c: 12 80 00 0c bne 400182cc 400182a0: 01 00 00 00 nop case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 400182a4: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 400182a8: 80 a0 60 04 cmp %g1, 4 400182ac: 02 80 00 04 be 400182bc <== NEVER TAKEN 400182b0: 01 00 00 00 nop (void) _Watchdog_Remove( &the_timer->Ticker ); 400182b4: 40 00 14 ec call 4001d664 <_Watchdog_Remove> 400182b8: 90 02 20 10 add %o0, 0x10, %o0 _Thread_Enable_dispatch(); 400182bc: 40 00 10 d5 call 4001c610 <_Thread_Enable_dispatch> 400182c0: b0 10 20 00 clr %i0 400182c4: 81 c7 e0 08 ret 400182c8: 81 e8 00 00 restore case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 400182cc: 81 c7 e0 08 ret 400182d0: 91 e8 20 04 restore %g0, 4, %o0 =============================================================================== 400187d4 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 400187d4: 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; 400187d8: 03 10 00 fc sethi %hi(0x4003f000), %g1 400187dc: fa 00 62 08 ld [ %g1 + 0x208 ], %i5 ! 4003f208 <_Timer_server> if ( !timer_server ) 400187e0: 80 a7 60 00 cmp %i5, 0 400187e4: 02 80 00 08 be 40018804 400187e8: 82 10 20 0e mov 0xe, %g1 return RTEMS_INCORRECT_STATE; if ( !_TOD.is_set ) 400187ec: 39 10 00 f9 sethi %hi(0x4003e400), %i4 400187f0: 82 17 23 a8 or %i4, 0x3a8, %g1 ! 4003e7a8 <_TOD> 400187f4: c4 08 60 14 ldub [ %g1 + 0x14 ], %g2 400187f8: 80 a0 a0 00 cmp %g2, 0 400187fc: 12 80 00 04 bne 4001880c <== ALWAYS TAKEN 40018800: 82 10 20 0b mov 0xb, %g1 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 40018804: 81 c7 e0 08 ret 40018808: 91 e8 00 01 restore %g0, %g1, %o0 return RTEMS_INCORRECT_STATE; if ( !_TOD.is_set ) return RTEMS_NOT_DEFINED; if ( !routine ) 4001880c: 80 a6 a0 00 cmp %i2, 0 40018810: 02 bf ff fd be 40018804 40018814: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 40018818: 7f ff f3 1e call 40015490 <_TOD_Validate> 4001881c: 90 10 00 19 mov %i1, %o0 40018820: 80 8a 20 ff btst 0xff, %o0 40018824: 12 80 00 04 bne 40018834 40018828: 82 10 20 14 mov 0x14, %g1 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4001882c: 81 c7 e0 08 ret 40018830: 91 e8 00 01 restore %g0, %g1, %o0 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 40018834: 7f ff f2 dd call 400153a8 <_TOD_To_seconds> 40018838: 90 10 00 19 mov %i1, %o0 4001883c: b2 10 00 08 mov %o0, %i1 40018840: d0 1f 23 a8 ldd [ %i4 + 0x3a8 ], %o0 40018844: 94 10 20 00 clr %o2 40018848: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 4001884c: 40 00 52 36 call 4002d124 <__divdi3> 40018850: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 if ( seconds <= _TOD_Seconds_since_epoch() ) 40018854: 80 a6 40 09 cmp %i1, %o1 40018858: 08 bf ff f5 bleu 4001882c 4001885c: 82 10 20 14 mov 0x14, %g1 40018860: 92 10 00 18 mov %i0, %o1 40018864: 11 10 00 fc sethi %hi(0x4003f000), %o0 40018868: 94 07 bf fc add %fp, -4, %o2 4001886c: 40 00 0b 86 call 4001b684 <_Objects_Get> 40018870: 90 12 21 c8 or %o0, 0x1c8, %o0 return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 40018874: c2 07 bf fc ld [ %fp + -4 ], %g1 40018878: 80 a0 60 00 cmp %g1, 0 4001887c: 12 80 00 19 bne 400188e0 40018880: a0 10 00 08 mov %o0, %l0 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 40018884: 40 00 13 78 call 4001d664 <_Watchdog_Remove> 40018888: 90 02 20 10 add %o0, 0x10, %o0 4001888c: d0 1f 23 a8 ldd [ %i4 + 0x3a8 ], %o0 the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 40018890: 82 10 20 03 mov 3, %g1 40018894: 94 10 20 00 clr %o2 40018898: c2 24 20 38 st %g1, [ %l0 + 0x38 ] 4001889c: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 400188a0: c0 24 20 18 clr [ %l0 + 0x18 ] 400188a4: 96 12 e2 00 or %o3, 0x200, %o3 the_watchdog->routine = routine; 400188a8: f4 24 20 2c st %i2, [ %l0 + 0x2c ] the_watchdog->id = id; 400188ac: f0 24 20 30 st %i0, [ %l0 + 0x30 ] 400188b0: 40 00 52 1d call 4002d124 <__divdi3> 400188b4: f6 24 20 34 st %i3, [ %l0 + 0x34 ] _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); (*timer_server->schedule_operation)( timer_server, the_timer ); 400188b8: c2 07 60 04 ld [ %i5 + 4 ], %g1 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(); 400188bc: b2 26 40 09 sub %i1, %o1, %i1 (*timer_server->schedule_operation)( timer_server, the_timer ); 400188c0: 90 10 00 1d mov %i5, %o0 400188c4: 92 10 00 10 mov %l0, %o1 400188c8: 9f c0 40 00 call %g1 400188cc: f2 24 20 1c st %i1, [ %l0 + 0x1c ] _Thread_Enable_dispatch(); 400188d0: 40 00 0f 50 call 4001c610 <_Thread_Enable_dispatch> 400188d4: 01 00 00 00 nop return RTEMS_SUCCESSFUL; 400188d8: 10 bf ff cb b 40018804 400188dc: 82 10 20 00 clr %g1 ! 0 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 400188e0: 10 bf ff c9 b 40018804 400188e4: 82 10 20 04 mov 4, %g1 =============================================================================== 400089dc : #include int sched_get_priority_max( int policy ) { 400089dc: 9d e3 bf a0 save %sp, -96, %sp switch ( policy ) { 400089e0: 80 a6 20 04 cmp %i0, 4 400089e4: 08 80 00 08 bleu 40008a04 400089e8: 82 10 20 01 mov 1, %g1 case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 400089ec: 40 00 22 40 call 400112ec <__errno> 400089f0: b0 10 3f ff mov -1, %i0 400089f4: 82 10 20 16 mov 0x16, %g1 400089f8: c2 22 00 00 st %g1, [ %o0 ] 400089fc: 81 c7 e0 08 ret 40008a00: 81 e8 00 00 restore int sched_get_priority_max( int policy ) { switch ( policy ) { 40008a04: b1 28 40 18 sll %g1, %i0, %i0 40008a08: 80 8e 20 17 btst 0x17, %i0 40008a0c: 02 bf ff f8 be 400089ec <== NEVER TAKEN 40008a10: 03 10 00 7f sethi %hi(0x4001fc00), %g1 default: rtems_set_errno_and_return_minus_one( EINVAL ); } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 40008a14: f0 08 63 fc ldub [ %g1 + 0x3fc ], %i0 ! 4001fffc } 40008a18: 81 c7 e0 08 ret 40008a1c: 91 ee 3f ff restore %i0, -1, %o0 =============================================================================== 40008a20 : * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 */ int sched_get_priority_min( int policy ) { 40008a20: 9d e3 bf a0 save %sp, -96, %sp switch ( policy ) { 40008a24: 80 a6 20 04 cmp %i0, 4 40008a28: 08 80 00 08 bleu 40008a48 40008a2c: 82 10 00 18 mov %i0, %g1 case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 40008a30: 40 00 22 2f call 400112ec <__errno> 40008a34: b0 10 3f ff mov -1, %i0 40008a38: 82 10 20 16 mov 0x16, %g1 40008a3c: c2 22 00 00 st %g1, [ %o0 ] } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } 40008a40: 81 c7 e0 08 ret 40008a44: 81 e8 00 00 restore */ int sched_get_priority_min( int policy ) { switch ( policy ) { 40008a48: 84 10 20 01 mov 1, %g2 40008a4c: 83 28 80 01 sll %g2, %g1, %g1 40008a50: 80 88 60 17 btst 0x17, %g1 40008a54: 02 bf ff f7 be 40008a30 <== NEVER TAKEN 40008a58: b0 10 20 01 mov 1, %i0 default: rtems_set_errno_and_return_minus_one( EINVAL ); } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } 40008a5c: 81 c7 e0 08 ret 40008a60: 81 e8 00 00 restore =============================================================================== 40008a64 : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 40008a64: 9d e3 bf a0 save %sp, -96, %sp /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 40008a68: 80 a6 20 00 cmp %i0, 0 40008a6c: 12 80 00 0a bne 40008a94 <== ALWAYS TAKEN 40008a70: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); if ( !interval ) 40008a74: 02 80 00 13 be 40008ac0 40008a78: 03 10 00 83 sethi %hi(0x40020c00), %g1 rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 40008a7c: d0 00 61 00 ld [ %g1 + 0x100 ], %o0 ! 40020d00 <_Thread_Ticks_per_timeslice> 40008a80: 92 10 00 19 mov %i1, %o1 40008a84: 40 00 0f 59 call 4000c7e8 <_Timespec_From_ticks> 40008a88: b0 10 20 00 clr %i0 return 0; } 40008a8c: 81 c7 e0 08 ret 40008a90: 81 e8 00 00 restore { /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 40008a94: 7f ff ee e5 call 40004628 40008a98: 01 00 00 00 nop 40008a9c: 80 a2 00 18 cmp %o0, %i0 40008aa0: 02 bf ff f5 be 40008a74 40008aa4: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); 40008aa8: 40 00 22 11 call 400112ec <__errno> 40008aac: b0 10 3f ff mov -1, %i0 40008ab0: 82 10 20 03 mov 3, %g1 40008ab4: c2 22 00 00 st %g1, [ %o0 ] 40008ab8: 81 c7 e0 08 ret 40008abc: 81 e8 00 00 restore if ( !interval ) rtems_set_errno_and_return_minus_one( EINVAL ); 40008ac0: 40 00 22 0b call 400112ec <__errno> 40008ac4: b0 10 3f ff mov -1, %i0 40008ac8: 82 10 20 16 mov 0x16, %g1 40008acc: c2 22 00 00 st %g1, [ %o0 ] 40008ad0: 81 c7 e0 08 ret 40008ad4: 81 e8 00 00 restore =============================================================================== 4000932c : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 4000932c: 9d e3 bf 88 save %sp, -120, %sp * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40009330: 03 10 00 93 sethi %hi(0x40024c00), %g1 40009334: c4 00 60 b0 ld [ %g1 + 0xb0 ], %g2 ! 40024cb0 <_Thread_Dispatch_disable_level> size_t name_len; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); 40009338: f4 27 a0 4c st %i2, [ %fp + 0x4c ] ++level; 4000933c: 84 00 a0 01 inc %g2 40009340: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 40009344: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 40009348: fa 27 a0 58 st %i5, [ %fp + 0x58 ] _Thread_Dispatch_disable_level = level; 4000934c: c4 20 60 b0 st %g2, [ %g1 + 0xb0 ] Objects_Locations location; size_t name_len; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 40009350: b4 8e 62 00 andcc %i1, 0x200, %i2 40009354: 12 80 00 27 bne 400093f0 40009358: b6 10 20 00 clr %i3 const char *name, Objects_Id *id, size_t *len ) { return _POSIX_Name_to_id( &_POSIX_Semaphore_Information, name, id, len ); 4000935c: 39 10 00 93 sethi %hi(0x40024c00), %i4 40009360: 92 10 00 18 mov %i0, %o1 40009364: 90 17 23 74 or %i4, 0x374, %o0 40009368: 94 07 bf f0 add %fp, -16, %o2 4000936c: 7f ff fe 5c call 40008cdc <_POSIX_Name_to_id> 40009370: 96 07 bf fc add %fp, -4, %o3 * 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 ) { 40009374: ba 92 20 00 orcc %o0, 0, %i5 40009378: 22 80 00 0e be,a 400093b0 4000937c: 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) ) ) { 40009380: 80 a7 60 02 cmp %i5, 2 40009384: 12 80 00 04 bne 40009394 40009388: 80 a6 a0 00 cmp %i2, 0 4000938c: 12 80 00 1d bne 40009400 40009390: d2 07 bf fc ld [ %fp + -4 ], %o1 _Thread_Enable_dispatch(); 40009394: 40 00 0e 73 call 4000cd60 <_Thread_Enable_dispatch> 40009398: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 4000939c: 40 00 25 30 call 4001285c <__errno> 400093a0: 01 00 00 00 nop 400093a4: fa 22 00 00 st %i5, [ %o0 ] 400093a8: 81 c7 e0 08 ret 400093ac: 81 e8 00 00 restore /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 400093b0: 80 a6 6a 00 cmp %i1, 0xa00 400093b4: 02 80 00 1f be 40009430 400093b8: d2 07 bf f0 ld [ %fp + -16 ], %o1 RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get ( sem_t *id, Objects_Locations *location ) { return (POSIX_Semaphore_Control *) 400093bc: 94 07 bf f8 add %fp, -8, %o2 400093c0: 40 00 0a 7a call 4000bda8 <_Objects_Get> 400093c4: 90 17 23 74 or %i4, 0x374, %o0 _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); } the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location ); the_semaphore->open_count += 1; 400093c8: 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( (sem_t *) &the_semaphore_id, &location ); 400093cc: d0 27 bf f4 st %o0, [ %fp + -12 ] the_semaphore->open_count += 1; 400093d0: 82 00 60 01 inc %g1 _Thread_Enable_dispatch(); 400093d4: 40 00 0e 63 call 4000cd60 <_Thread_Enable_dispatch> 400093d8: c2 22 20 18 st %g1, [ %o0 + 0x18 ] _Thread_Enable_dispatch(); 400093dc: 40 00 0e 61 call 4000cd60 <_Thread_Enable_dispatch> 400093e0: 01 00 00 00 nop return_id: #if defined(RTEMS_USE_16_BIT_OBJECT) the_semaphore->Semaphore_id = the_semaphore->Object.id; return &the_semaphore->Semaphore_id; #else return (sem_t *)&the_semaphore->Object.id; 400093e4: f0 07 bf f4 ld [ %fp + -12 ], %i0 400093e8: 81 c7 e0 08 ret 400093ec: 91 ee 20 08 restore %i0, 8, %o0 size_t name_len; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); 400093f0: 82 07 a0 4c add %fp, 0x4c, %g1 mode = va_arg( arg, mode_t ); value = va_arg( arg, unsigned int ); 400093f4: f6 07 a0 50 ld [ %fp + 0x50 ], %i3 size_t name_len; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); 400093f8: 10 bf ff d9 b 4000935c 400093fc: c2 27 bf ec st %g1, [ %fp + -20 ] /* * 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( 40009400: 94 10 20 00 clr %o2 40009404: 96 10 00 1b mov %i3, %o3 40009408: 98 07 bf f4 add %fp, -12, %o4 4000940c: 40 00 1a e9 call 4000ffb0 <_POSIX_Semaphore_Create_support> 40009410: 90 10 00 18 mov %i0, %o0 /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); 40009414: 40 00 0e 53 call 4000cd60 <_Thread_Enable_dispatch> 40009418: ba 10 00 08 mov %o0, %i5 if ( status == -1 ) 4000941c: 80 a7 7f ff cmp %i5, -1 40009420: 32 bf ff f2 bne,a 400093e8 <== ALWAYS TAKEN 40009424: f0 07 bf f4 ld [ %fp + -12 ], %i0 the_semaphore->Semaphore_id = the_semaphore->Object.id; return &the_semaphore->Semaphore_id; #else return (sem_t *)&the_semaphore->Object.id; #endif } 40009428: 81 c7 e0 08 ret <== NOT EXECUTED 4000942c: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { _Thread_Enable_dispatch(); 40009430: 40 00 0e 4c call 4000cd60 <_Thread_Enable_dispatch> 40009434: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 40009438: 40 00 25 09 call 4001285c <__errno> 4000943c: 01 00 00 00 nop 40009440: 82 10 20 11 mov 0x11, %g1 ! 11 40009444: c2 22 00 00 st %g1, [ %o0 ] 40009448: 81 c7 e0 08 ret 4000944c: 81 e8 00 00 restore =============================================================================== 4000b484 : int sem_timedwait( sem_t *sem, const struct timespec *abstime ) { 4000b484: 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 ); 4000b488: 90 10 00 19 mov %i1, %o0 4000b48c: 40 00 16 9f call 40010f08 <_POSIX_Absolute_timeout_to_ticks> 4000b490: 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 ); 4000b494: 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 ) 4000b498: 80 a2 20 03 cmp %o0, 3 4000b49c: 02 80 00 06 be 4000b4b4 <== ALWAYS TAKEN 4000b4a0: 90 10 00 18 mov %i0, %o0 do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 4000b4a4: 40 00 19 99 call 40011b08 <_POSIX_Semaphore_Wait_support> <== NOT EXECUTED 4000b4a8: 92 10 20 00 clr %o1 <== NOT EXECUTED 4000b4ac: 81 c7 e0 08 ret <== NOT EXECUTED 4000b4b0: 91 e8 00 08 restore %g0, %o0, %o0 <== NOT EXECUTED 4000b4b4: 40 00 19 95 call 40011b08 <_POSIX_Semaphore_Wait_support> 4000b4b8: 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; } 4000b4bc: 81 c7 e0 08 ret 4000b4c0: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40008990 : int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 40008990: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; if ( oact ) 40008994: 80 a6 a0 00 cmp %i2, 0 40008998: 02 80 00 0d be 400089cc 4000899c: 87 2e 20 02 sll %i0, 2, %g3 *oact = _POSIX_signals_Vectors[ sig ]; 400089a0: 05 10 00 6f sethi %hi(0x4001bc00), %g2 400089a4: 83 2e 20 04 sll %i0, 4, %g1 400089a8: 84 10 a1 60 or %g2, 0x160, %g2 400089ac: 82 20 40 03 sub %g1, %g3, %g1 400089b0: c6 00 80 01 ld [ %g2 + %g1 ], %g3 400089b4: 82 00 80 01 add %g2, %g1, %g1 400089b8: c6 26 80 00 st %g3, [ %i2 ] 400089bc: c4 00 60 04 ld [ %g1 + 4 ], %g2 400089c0: c4 26 a0 04 st %g2, [ %i2 + 4 ] 400089c4: c2 00 60 08 ld [ %g1 + 8 ], %g1 400089c8: c2 26 a0 08 st %g1, [ %i2 + 8 ] if ( !sig ) 400089cc: 80 a6 20 00 cmp %i0, 0 400089d0: 02 80 00 33 be 40008a9c 400089d4: 01 00 00 00 nop static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 400089d8: 82 06 3f ff add %i0, -1, %g1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 400089dc: 80 a0 60 1f cmp %g1, 0x1f 400089e0: 18 80 00 2f bgu 40008a9c 400089e4: 80 a6 20 09 cmp %i0, 9 * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 400089e8: 02 80 00 2d be 40008a9c 400089ec: 80 a6 60 00 cmp %i1, 0 /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 400089f0: 02 80 00 1a be 40008a58 <== NEVER TAKEN 400089f4: 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 ); 400089f8: 7f ff e7 a2 call 40002880 400089fc: 01 00 00 00 nop 40008a00: ba 10 00 08 mov %o0, %i5 if ( act->sa_handler == SIG_DFL ) { 40008a04: c2 06 60 08 ld [ %i1 + 8 ], %g1 40008a08: 80 a0 60 00 cmp %g1, 0 40008a0c: 02 80 00 15 be 40008a60 40008a10: 83 2e 20 02 sll %i0, 2, %g1 _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; } else { _POSIX_signals_Clear_process_signals( sig ); 40008a14: 40 00 17 f0 call 4000e9d4 <_POSIX_signals_Clear_process_signals> 40008a18: 90 10 00 18 mov %i0, %o0 _POSIX_signals_Vectors[ sig ] = *act; 40008a1c: c4 06 40 00 ld [ %i1 ], %g2 40008a20: 87 2e 20 02 sll %i0, 2, %g3 40008a24: 03 10 00 6f sethi %hi(0x4001bc00), %g1 40008a28: b1 2e 20 04 sll %i0, 4, %i0 40008a2c: 82 10 61 60 or %g1, 0x160, %g1 40008a30: b0 26 00 03 sub %i0, %g3, %i0 40008a34: c4 20 40 18 st %g2, [ %g1 + %i0 ] 40008a38: c4 06 60 04 ld [ %i1 + 4 ], %g2 40008a3c: b0 00 40 18 add %g1, %i0, %i0 40008a40: c4 26 20 04 st %g2, [ %i0 + 4 ] 40008a44: c2 06 60 08 ld [ %i1 + 8 ], %g1 40008a48: c2 26 20 08 st %g1, [ %i0 + 8 ] } _ISR_Enable( level ); 40008a4c: 7f ff e7 91 call 40002890 40008a50: 90 10 00 1d mov %i5, %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; 40008a54: 82 10 20 00 clr %g1 } 40008a58: 81 c7 e0 08 ret 40008a5c: 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 ]; 40008a60: b1 2e 20 04 sll %i0, 4, %i0 40008a64: b0 26 00 01 sub %i0, %g1, %i0 40008a68: 03 10 00 68 sethi %hi(0x4001a000), %g1 40008a6c: 82 10 62 5c or %g1, 0x25c, %g1 ! 4001a25c <_POSIX_signals_Default_vectors> 40008a70: c8 00 40 18 ld [ %g1 + %i0 ], %g4 40008a74: 82 00 40 18 add %g1, %i0, %g1 40008a78: c6 00 60 04 ld [ %g1 + 4 ], %g3 40008a7c: c4 00 60 08 ld [ %g1 + 8 ], %g2 40008a80: 03 10 00 6f sethi %hi(0x4001bc00), %g1 40008a84: 82 10 61 60 or %g1, 0x160, %g1 ! 4001bd60 <_POSIX_signals_Vectors> 40008a88: c8 20 40 18 st %g4, [ %g1 + %i0 ] 40008a8c: b0 00 40 18 add %g1, %i0, %i0 40008a90: c6 26 20 04 st %g3, [ %i0 + 4 ] 40008a94: 10 bf ff ee b 40008a4c 40008a98: 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 ); 40008a9c: 40 00 23 2a call 40011744 <__errno> 40008aa0: 01 00 00 00 nop 40008aa4: 84 10 20 16 mov 0x16, %g2 ! 16 40008aa8: 82 10 3f ff mov -1, %g1 40008aac: 10 bf ff eb b 40008a58 40008ab0: c4 22 00 00 st %g2, [ %o0 ] =============================================================================== 40008f20 : int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { 40008f20: 9d e3 bf 90 save %sp, -112, %sp ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) 40008f24: ba 96 20 00 orcc %i0, 0, %i5 40008f28: 02 80 00 83 be 40009134 40008f2c: 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 ) { 40008f30: 02 80 00 5b be 4000909c 40008f34: 80 a6 60 00 cmp %i1, 0 if ( !_Timespec_Is_valid( timeout ) ) 40008f38: 40 00 0f 9d call 4000cdac <_Timespec_Is_valid> 40008f3c: 90 10 00 1a mov %i2, %o0 40008f40: 80 8a 20 ff btst 0xff, %o0 40008f44: 02 80 00 7c be 40009134 40008f48: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); 40008f4c: 40 00 0f ab call 4000cdf8 <_Timespec_To_ticks> 40008f50: 90 10 00 1a mov %i2, %o0 if ( !interval ) 40008f54: b0 92 20 00 orcc %o0, 0, %i0 40008f58: 02 80 00 77 be 40009134 <== NEVER TAKEN 40008f5c: 80 a6 60 00 cmp %i1, 0 /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 40008f60: 02 80 00 52 be 400090a8 <== NEVER TAKEN 40008f64: 35 10 00 71 sethi %hi(0x4001c400), %i2 the_thread = _Thread_Executing; 40008f68: 35 10 00 71 sethi %hi(0x4001c400), %i2 40008f6c: b4 16 a1 60 or %i2, 0x160, %i2 ! 4001c560 <_Per_CPU_Information> 40008f70: f8 06 a0 10 ld [ %i2 + 0x10 ], %i4 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 40008f74: 7f ff e7 1e call 40002bec 40008f78: f6 07 21 50 ld [ %i4 + 0x150 ], %i3 40008f7c: a0 10 00 08 mov %o0, %l0 if ( *set & api->signals_pending ) { 40008f80: c2 07 40 00 ld [ %i5 ], %g1 40008f84: c4 06 e0 d4 ld [ %i3 + 0xd4 ], %g2 40008f88: 80 88 40 02 btst %g1, %g2 40008f8c: 12 80 00 52 bne 400090d4 40008f90: 01 00 00 00 nop return the_info->si_signo; } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { 40008f94: 05 10 00 71 sethi %hi(0x4001c400), %g2 40008f98: c4 00 a3 b4 ld [ %g2 + 0x3b4 ], %g2 ! 4001c7b4 <_POSIX_signals_Pending> 40008f9c: 80 88 40 02 btst %g1, %g2 40008fa0: 12 80 00 2e bne 40009058 40008fa4: 03 10 00 70 sethi %hi(0x4001c000), %g1 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40008fa8: c4 00 60 50 ld [ %g1 + 0x50 ], %g2 ! 4001c050 <_Thread_Dispatch_disable_level> the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; return signo; } the_info->si_signo = -1; 40008fac: 86 10 3f ff mov -1, %g3 40008fb0: c6 26 40 00 st %g3, [ %i1 ] ++level; 40008fb4: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40008fb8: c4 20 60 50 st %g2, [ %g1 + 0x50 ] _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; 40008fbc: 82 10 20 04 mov 4, %g1 40008fc0: c2 27 20 34 st %g1, [ %i4 + 0x34 ] the_thread->Wait.option = *set; 40008fc4: c2 07 40 00 ld [ %i5 ], %g1 the_thread->Wait.return_argument = the_info; 40008fc8: f2 27 20 28 st %i1, [ %i4 + 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; 40008fcc: c2 27 20 30 st %g1, [ %i4 + 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; 40008fd0: a2 10 20 01 mov 1, %l1 } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 40008fd4: 21 10 00 71 sethi %hi(0x4001c400), %l0 40008fd8: a0 14 23 4c or %l0, 0x34c, %l0 ! 4001c74c <_POSIX_signals_Wait_queue> 40008fdc: e0 27 20 44 st %l0, [ %i4 + 0x44 ] 40008fe0: e2 24 20 30 st %l1, [ %l0 + 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 ); 40008fe4: 7f ff e7 06 call 40002bfc 40008fe8: 01 00 00 00 nop _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 40008fec: 90 10 00 10 mov %l0, %o0 40008ff0: 92 10 00 18 mov %i0, %o1 40008ff4: 15 10 00 32 sethi %hi(0x4000c800), %o2 40008ff8: 40 00 0d ff call 4000c7f4 <_Thread_queue_Enqueue_with_handler> 40008ffc: 94 12 a3 d4 or %o2, 0x3d4, %o2 ! 4000cbd4 <_Thread_queue_Timeout> _Thread_Enable_dispatch(); 40009000: 40 00 0c bd call 4000c2f4 <_Thread_Enable_dispatch> 40009004: 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 ); 40009008: d2 06 40 00 ld [ %i1 ], %o1 4000900c: 90 10 00 1b mov %i3, %o0 40009010: 94 10 00 19 mov %i1, %o2 40009014: 96 10 20 00 clr %o3 40009018: 40 00 18 ac call 4000f2c8 <_POSIX_signals_Clear_signals> 4000901c: 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) 40009020: c2 06 a0 10 ld [ %i2 + 0x10 ], %g1 40009024: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 40009028: 80 a0 60 04 cmp %g1, 4 4000902c: 12 80 00 3b bne 40009118 40009030: 01 00 00 00 nop || !(*set & signo_to_mask( the_info->si_signo )) ) { 40009034: f0 06 40 00 ld [ %i1 ], %i0 40009038: c2 07 40 00 ld [ %i5 ], %g1 4000903c: 84 06 3f ff add %i0, -1, %g2 40009040: a3 2c 40 02 sll %l1, %g2, %l1 40009044: 80 8c 40 01 btst %l1, %g1 40009048: 02 80 00 34 be 40009118 4000904c: 01 00 00 00 nop errno = _Thread_Executing->Wait.return_code; return -1; } return the_info->si_signo; } 40009050: 81 c7 e0 08 ret 40009054: 81 e8 00 00 restore } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending ); 40009058: 7f ff ff 9a call 40008ec0 <_POSIX_signals_Get_lowest> 4000905c: 90 10 00 02 mov %g2, %o0 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 40009060: 94 10 00 19 mov %i1, %o2 } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending ); 40009064: b0 10 00 08 mov %o0, %i0 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 40009068: 96 10 20 01 mov 1, %o3 4000906c: 90 10 00 1b mov %i3, %o0 40009070: 92 10 00 18 mov %i0, %o1 40009074: 40 00 18 95 call 4000f2c8 <_POSIX_signals_Clear_signals> 40009078: 98 10 20 00 clr %o4 _ISR_Enable( level ); 4000907c: 7f ff e6 e0 call 40002bfc 40009080: 90 10 00 10 mov %l0, %o0 the_info->si_signo = signo; the_info->si_code = SI_USER; 40009084: 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; 40009088: f0 26 40 00 st %i0, [ %i1 ] the_info->si_code = SI_USER; 4000908c: c2 26 60 04 st %g1, [ %i1 + 4 ] the_info->si_value.sival_int = 0; 40009090: c0 26 60 08 clr [ %i1 + 8 ] 40009094: 81 c7 e0 08 ret 40009098: 81 e8 00 00 restore /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 4000909c: 12 bf ff b3 bne 40008f68 400090a0: b0 10 20 00 clr %i0 the_thread = _Thread_Executing; 400090a4: 35 10 00 71 sethi %hi(0x4001c400), %i2 400090a8: b4 16 a1 60 or %i2, 0x160, %i2 ! 4001c560 <_Per_CPU_Information> 400090ac: f8 06 a0 10 ld [ %i2 + 0x10 ], %i4 /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 400090b0: b2 07 bf f4 add %fp, -12, %i1 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 400090b4: 7f ff e6 ce call 40002bec 400090b8: f6 07 21 50 ld [ %i4 + 0x150 ], %i3 400090bc: a0 10 00 08 mov %o0, %l0 if ( *set & api->signals_pending ) { 400090c0: c2 07 40 00 ld [ %i5 ], %g1 400090c4: c4 06 e0 d4 ld [ %i3 + 0xd4 ], %g2 400090c8: 80 88 40 02 btst %g1, %g2 400090cc: 22 bf ff b3 be,a 40008f98 400090d0: 05 10 00 71 sethi %hi(0x4001c400), %g2 /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending ); 400090d4: 7f ff ff 7b call 40008ec0 <_POSIX_signals_Get_lowest> 400090d8: 90 10 00 02 mov %g2, %o0 _POSIX_signals_Clear_signals( 400090dc: 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 ); 400090e0: 92 10 00 08 mov %o0, %o1 400090e4: d0 26 40 00 st %o0, [ %i1 ] _POSIX_signals_Clear_signals( 400090e8: 96 10 20 00 clr %o3 400090ec: 90 10 00 1b mov %i3, %o0 400090f0: 40 00 18 76 call 4000f2c8 <_POSIX_signals_Clear_signals> 400090f4: 98 10 20 00 clr %o4 the_info->si_signo, the_info, false, false ); _ISR_Enable( level ); 400090f8: 7f ff e6 c1 call 40002bfc 400090fc: 90 10 00 10 mov %l0, %o0 the_info->si_code = SI_USER; 40009100: 82 10 20 01 mov 1, %g1 the_info->si_value.sival_int = 0; 40009104: c0 26 60 08 clr [ %i1 + 8 ] false, false ); _ISR_Enable( level ); the_info->si_code = SI_USER; 40009108: c2 26 60 04 st %g1, [ %i1 + 4 ] the_info->si_value.sival_int = 0; return the_info->si_signo; 4000910c: f0 06 40 00 ld [ %i1 ], %i0 40009110: 81 c7 e0 08 ret 40009114: 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; 40009118: 40 00 23 6d call 40011ecc <__errno> 4000911c: b0 10 3f ff mov -1, %i0 40009120: c2 06 a0 10 ld [ %i2 + 0x10 ], %g1 40009124: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 40009128: c2 22 00 00 st %g1, [ %o0 ] return -1; } return the_info->si_signo; } 4000912c: 81 c7 e0 08 ret 40009130: 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 ); 40009134: 40 00 23 66 call 40011ecc <__errno> 40009138: b0 10 3f ff mov -1, %i0 4000913c: 82 10 20 16 mov 0x16, %g1 40009140: c2 22 00 00 st %g1, [ %o0 ] 40009144: 81 c7 e0 08 ret 40009148: 81 e8 00 00 restore =============================================================================== 4000ad4c : int sigwait( const sigset_t *set, int *sig ) { 4000ad4c: 9d e3 bf a0 save %sp, -96, %sp int status; status = sigtimedwait( set, NULL, NULL ); 4000ad50: 92 10 20 00 clr %o1 4000ad54: 90 10 00 18 mov %i0, %o0 4000ad58: 7f ff ff 6e call 4000ab10 4000ad5c: 94 10 20 00 clr %o2 if ( status != -1 ) { 4000ad60: 80 a2 3f ff cmp %o0, -1 4000ad64: 02 80 00 07 be 4000ad80 4000ad68: 80 a6 60 00 cmp %i1, 0 if ( sig ) 4000ad6c: 02 80 00 0a be 4000ad94 <== NEVER TAKEN 4000ad70: 01 00 00 00 nop *sig = status; 4000ad74: d0 26 40 00 st %o0, [ %i1 ] return 0; 4000ad78: 81 c7 e0 08 ret 4000ad7c: 91 e8 20 00 restore %g0, 0, %o0 } return errno; 4000ad80: 40 00 22 86 call 40013798 <__errno> 4000ad84: 01 00 00 00 nop 4000ad88: f0 02 00 00 ld [ %o0 ], %i0 4000ad8c: 81 c7 e0 08 ret 4000ad90: 81 e8 00 00 restore } 4000ad94: 81 c7 e0 08 ret <== NOT EXECUTED 4000ad98: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED =============================================================================== 40007bc8 : */ long sysconf( int name ) { 40007bc8: 9d e3 bf a0 save %sp, -96, %sp if ( name == _SC_CLK_TCK ) 40007bcc: 80 a6 20 02 cmp %i0, 2 40007bd0: 02 80 00 12 be 40007c18 40007bd4: 82 10 00 18 mov %i0, %g1 return (TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick()); if ( name == _SC_OPEN_MAX ) 40007bd8: 80 a6 20 04 cmp %i0, 4 40007bdc: 02 80 00 16 be 40007c34 40007be0: 80 a0 60 33 cmp %g1, 0x33 return rtems_libio_number_iops; if ( name == _SC_GETPW_R_SIZE_MAX ) 40007be4: 02 80 00 0b be 40007c10 40007be8: b0 10 24 00 mov 0x400, %i0 return 1024; if ( name == _SC_PAGESIZE ) 40007bec: 80 a0 60 08 cmp %g1, 8 40007bf0: 02 80 00 08 be 40007c10 40007bf4: 31 00 00 04 sethi %hi(0x1000), %i0 return PAGE_SIZE; if ( name == _SC_SYMLOOP_MAX ) 40007bf8: 80 a0 60 4f cmp %g1, 0x4f 40007bfc: 02 80 00 05 be 40007c10 <== NEVER TAKEN 40007c00: b0 10 20 20 mov 0x20, %i0 return RTEMS_FILESYSTEM_SYMLOOP_MAX; #if defined(__sparc__) if ( name == 515 ) /* Solaris _SC_STACK_PROT */ 40007c04: 80 a0 62 03 cmp %g1, 0x203 40007c08: 12 80 00 0f bne 40007c44 <== ALWAYS TAKEN 40007c0c: b0 10 20 00 clr %i0 return 0; #endif rtems_set_errno_and_return_minus_one( EINVAL ); } 40007c10: 81 c7 e0 08 ret 40007c14: 81 e8 00 00 restore int name ) { if ( name == _SC_CLK_TCK ) return (TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick()); 40007c18: 03 10 00 5a sethi %hi(0x40016800), %g1 long sysconf( int name ) { if ( name == _SC_CLK_TCK ) return (TOD_MICROSECONDS_PER_SECOND / 40007c1c: d2 00 62 b4 ld [ %g1 + 0x2b4 ], %o1 ! 40016ab4 40007c20: 11 00 03 d0 sethi %hi(0xf4000), %o0 40007c24: 40 00 32 7c call 40014614 <.udiv> 40007c28: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 40007c2c: 81 c7 e0 08 ret 40007c30: 91 e8 00 08 restore %g0, %o0, %o0 rtems_configuration_get_microseconds_per_tick()); if ( name == _SC_OPEN_MAX ) return rtems_libio_number_iops; 40007c34: 03 10 00 60 sethi %hi(0x40018000), %g1 40007c38: f0 00 62 e8 ld [ %g1 + 0x2e8 ], %i0 ! 400182e8 40007c3c: 81 c7 e0 08 ret 40007c40: 81 e8 00 00 restore #if defined(__sparc__) if ( name == 515 ) /* Solaris _SC_STACK_PROT */ return 0; #endif rtems_set_errno_and_return_minus_one( EINVAL ); 40007c44: 40 00 23 23 call 400108d0 <__errno> 40007c48: b0 10 3f ff mov -1, %i0 40007c4c: 82 10 20 16 mov 0x16, %g1 40007c50: c2 22 00 00 st %g1, [ %o0 ] } 40007c54: 81 c7 e0 08 ret 40007c58: 81 e8 00 00 restore =============================================================================== 40009450 : int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 40009450: 9d e3 bf a0 save %sp, -96, %sp POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 40009454: 80 a6 20 01 cmp %i0, 1 40009458: 12 80 00 3d bne 4000954c 4000945c: 80 a6 a0 00 cmp %i2, 0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) 40009460: 02 80 00 3b be 4000954c 40009464: 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) { 40009468: 02 80 00 0e be 400094a0 4000946c: 03 10 00 93 sethi %hi(0x40024c00), %g1 /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 40009470: c2 06 40 00 ld [ %i1 ], %g1 40009474: 82 00 7f ff add %g1, -1, %g1 40009478: 80 a0 60 01 cmp %g1, 1 4000947c: 18 80 00 34 bgu 4000954c <== NEVER TAKEN 40009480: 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 ) 40009484: c2 06 60 04 ld [ %i1 + 4 ], %g1 40009488: 80 a0 60 00 cmp %g1, 0 4000948c: 02 80 00 30 be 4000954c <== NEVER TAKEN 40009490: 82 00 7f ff add %g1, -1, %g1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) 40009494: 80 a0 60 1f cmp %g1, 0x1f 40009498: 18 80 00 2d bgu 4000954c <== NEVER TAKEN 4000949c: 03 10 00 93 sethi %hi(0x40024c00), %g1 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 400094a0: c4 00 60 b0 ld [ %g1 + 0xb0 ], %g2 ! 40024cb0 <_Thread_Dispatch_disable_level> ++level; 400094a4: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 400094a8: c4 20 60 b0 st %g2, [ %g1 + 0xb0 ] * 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 ); 400094ac: 3b 10 00 93 sethi %hi(0x40024c00), %i5 400094b0: 40 00 08 e0 call 4000b830 <_Objects_Allocate> 400094b4: 90 17 63 b4 or %i5, 0x3b4, %o0 ! 40024fb4 <_POSIX_Timer_Information> /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 400094b8: 80 a2 20 00 cmp %o0, 0 400094bc: 02 80 00 2a be 40009564 400094c0: 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; 400094c4: c2 2a 20 3c stb %g1, [ %o0 + 0x3c ] ptimer->thread_id = _Thread_Executing->Object.id; 400094c8: 03 10 00 94 sethi %hi(0x40025000), %g1 400094cc: c2 00 62 10 ld [ %g1 + 0x210 ], %g1 ! 40025210 <_Per_CPU_Information+0x10> if ( evp != NULL ) { 400094d0: 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; 400094d4: c2 00 60 08 ld [ %g1 + 8 ], %g1 if ( evp != NULL ) { 400094d8: 02 80 00 08 be 400094f8 400094dc: c2 22 20 38 st %g1, [ %o0 + 0x38 ] ptimer->inf.sigev_notify = evp->sigev_notify; 400094e0: c6 06 40 00 ld [ %i1 ], %g3 ptimer->inf.sigev_signo = evp->sigev_signo; 400094e4: c4 06 60 04 ld [ %i1 + 4 ], %g2 ptimer->inf.sigev_value = evp->sigev_value; 400094e8: 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; 400094ec: c6 22 20 40 st %g3, [ %o0 + 0x40 ] ptimer->inf.sigev_signo = evp->sigev_signo; 400094f0: c4 22 20 44 st %g2, [ %o0 + 0x44 ] ptimer->inf.sigev_value = evp->sigev_value; 400094f4: c2 22 20 48 st %g1, [ %o0 + 0x48 ] Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 400094f8: c4 12 20 0a lduh [ %o0 + 0xa ], %g2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 400094fc: ba 17 63 b4 or %i5, 0x3b4, %i5 40009500: c6 07 60 1c ld [ %i5 + 0x1c ], %g3 } ptimer->overrun = 0; 40009504: c0 22 20 68 clr [ %o0 + 0x68 ] ptimer->timer_data.it_value.tv_sec = 0; 40009508: c0 22 20 5c clr [ %o0 + 0x5c ] ptimer->timer_data.it_value.tv_nsec = 0; 4000950c: c0 22 20 60 clr [ %o0 + 0x60 ] ptimer->timer_data.it_interval.tv_sec = 0; 40009510: c0 22 20 54 clr [ %o0 + 0x54 ] ptimer->timer_data.it_interval.tv_nsec = 0; 40009514: c0 22 20 58 clr [ %o0 + 0x58 ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 40009518: c0 22 20 18 clr [ %o0 + 0x18 ] the_watchdog->routine = routine; 4000951c: c0 22 20 2c clr [ %o0 + 0x2c ] the_watchdog->id = id; 40009520: c0 22 20 30 clr [ %o0 + 0x30 ] the_watchdog->user_data = user_data; 40009524: c0 22 20 34 clr [ %o0 + 0x34 ] Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 40009528: c2 02 20 08 ld [ %o0 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000952c: 85 28 a0 02 sll %g2, 2, %g2 40009530: 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; 40009534: 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; 40009538: c2 26 80 00 st %g1, [ %i2 ] _Thread_Enable_dispatch(); 4000953c: 40 00 0e 09 call 4000cd60 <_Thread_Enable_dispatch> 40009540: b0 10 20 00 clr %i0 return 0; } 40009544: 81 c7 e0 08 ret 40009548: 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 ); 4000954c: 40 00 24 c4 call 4001285c <__errno> 40009550: b0 10 3f ff mov -1, %i0 40009554: 82 10 20 16 mov 0x16, %g1 40009558: c2 22 00 00 st %g1, [ %o0 ] 4000955c: 81 c7 e0 08 ret 40009560: 81 e8 00 00 restore /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { _Thread_Enable_dispatch(); 40009564: 40 00 0d ff call 4000cd60 <_Thread_Enable_dispatch> 40009568: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one( EAGAIN ); 4000956c: 40 00 24 bc call 4001285c <__errno> 40009570: 01 00 00 00 nop 40009574: 82 10 20 0b mov 0xb, %g1 ! b 40009578: c2 22 00 00 st %g1, [ %o0 ] 4000957c: 81 c7 e0 08 ret 40009580: 81 e8 00 00 restore =============================================================================== 400080a8 : timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue ) { 400080a8: 9d e3 bf 78 save %sp, -136, %sp Objects_Locations location; bool activated; uint32_t initial_period; struct itimerspec normalize; if ( !value ) 400080ac: 80 a6 a0 00 cmp %i2, 0 400080b0: 02 80 00 86 be 400082c8 <== NEVER TAKEN 400080b4: 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) ) ) { 400080b8: 40 00 10 37 call 4000c194 <_Timespec_Is_valid> 400080bc: 90 06 a0 08 add %i2, 8, %o0 400080c0: 80 8a 20 ff btst 0xff, %o0 400080c4: 02 80 00 81 be 400082c8 400080c8: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !_Timespec_Is_valid( &(value->it_interval) ) ) { 400080cc: 40 00 10 32 call 4000c194 <_Timespec_Is_valid> 400080d0: 90 10 00 1a mov %i2, %o0 400080d4: 80 8a 20 ff btst 0xff, %o0 400080d8: 02 80 00 7c be 400082c8 <== NEVER TAKEN 400080dc: 80 8e 7f fb btst -5, %i1 rtems_set_errno_and_return_minus_one( EINVAL ); } if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { 400080e0: 12 80 00 7a bne 400082c8 400080e4: 80 a6 60 04 cmp %i1, 4 rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 400080e8: c8 06 80 00 ld [ %i2 ], %g4 400080ec: c6 06 a0 04 ld [ %i2 + 4 ], %g3 400080f0: c4 06 a0 08 ld [ %i2 + 8 ], %g2 400080f4: c2 06 a0 0c ld [ %i2 + 0xc ], %g1 400080f8: c8 27 bf f0 st %g4, [ %fp + -16 ] 400080fc: c6 27 bf f4 st %g3, [ %fp + -12 ] 40008100: c4 27 bf f8 st %g2, [ %fp + -8 ] /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { 40008104: 02 80 00 4c be 40008234 40008108: c2 27 bf fc st %g1, [ %fp + -4 ] RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get ( timer_t id, Objects_Locations *location ) { return (POSIX_Timer_Control *) 4000810c: 92 10 00 18 mov %i0, %o1 40008110: 11 10 00 84 sethi %hi(0x40021000), %o0 40008114: 94 07 bf dc add %fp, -36, %o2 40008118: 40 00 09 ba call 4000a800 <_Objects_Get> 4000811c: 90 12 20 c4 or %o0, 0xc4, %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 ) { 40008120: c2 07 bf dc ld [ %fp + -36 ], %g1 40008124: 80 a0 60 00 cmp %g1, 0 40008128: 12 80 00 68 bne 400082c8 <== NEVER TAKEN 4000812c: b2 10 00 08 mov %o0, %i1 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 ) { 40008130: c2 07 bf f8 ld [ %fp + -8 ], %g1 40008134: 80 a0 60 00 cmp %g1, 0 40008138: 12 80 00 05 bne 4000814c 4000813c: c2 07 bf fc ld [ %fp + -4 ], %g1 40008140: 80 a0 60 00 cmp %g1, 0 40008144: 02 80 00 67 be 400082e0 40008148: 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 ); 4000814c: 40 00 10 4b call 4000c278 <_Timespec_To_ticks> 40008150: 90 10 00 1a mov %i2, %o0 40008154: d0 26 60 64 st %o0, [ %i1 + 0x64 ] initial_period = _Timespec_To_ticks( &normalize.it_value ); 40008158: 40 00 10 48 call 4000c278 <_Timespec_To_ticks> 4000815c: 90 07 bf f8 add %fp, -8, %o0 activated = _POSIX_Timer_Insert_helper( 40008160: d4 06 60 08 ld [ %i1 + 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 ); 40008164: 92 10 00 08 mov %o0, %o1 activated = _POSIX_Timer_Insert_helper( 40008168: 98 10 00 19 mov %i1, %o4 4000816c: 90 06 60 10 add %i1, 0x10, %o0 40008170: 17 10 00 20 sethi %hi(0x40008000), %o3 40008174: 40 00 19 f7 call 4000e950 <_POSIX_Timer_Insert_helper> 40008178: 96 12 e3 4c or %o3, 0x34c, %o3 ! 4000834c <_POSIX_Timer_TSR> initial_period, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { 4000817c: 80 8a 20 ff btst 0xff, %o0 40008180: 02 80 00 29 be 40008224 40008184: 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 ) 40008188: 02 80 00 0b be 400081b4 4000818c: c2 07 bf f0 ld [ %fp + -16 ], %g1 *ovalue = ptimer->timer_data; 40008190: c2 06 60 54 ld [ %i1 + 0x54 ], %g1 40008194: c2 26 c0 00 st %g1, [ %i3 ] 40008198: c2 06 60 58 ld [ %i1 + 0x58 ], %g1 4000819c: c2 26 e0 04 st %g1, [ %i3 + 4 ] 400081a0: c2 06 60 5c ld [ %i1 + 0x5c ], %g1 400081a4: c2 26 e0 08 st %g1, [ %i3 + 8 ] 400081a8: c2 06 60 60 ld [ %i1 + 0x60 ], %g1 400081ac: c2 26 e0 0c st %g1, [ %i3 + 0xc ] ptimer->timer_data = normalize; 400081b0: c2 07 bf f0 ld [ %fp + -16 ], %g1 ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 400081b4: 90 07 bf e0 add %fp, -32, %o0 400081b8: c2 26 60 54 st %g1, [ %i1 + 0x54 ] 400081bc: c2 07 bf f4 ld [ %fp + -12 ], %g1 400081c0: 13 10 00 83 sethi %hi(0x40020c00), %o1 400081c4: c2 26 60 58 st %g1, [ %i1 + 0x58 ] 400081c8: c2 07 bf f8 ld [ %fp + -8 ], %g1 400081cc: 92 12 61 48 or %o1, 0x148, %o1 400081d0: c2 26 60 5c st %g1, [ %i1 + 0x5c ] 400081d4: c2 07 bf fc ld [ %fp + -4 ], %g1 400081d8: c2 26 60 60 st %g1, [ %i1 + 0x60 ] /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 400081dc: 82 10 20 03 mov 3, %g1 400081e0: 40 00 06 b4 call 40009cb0 <_TOD_Get_with_nanoseconds> 400081e4: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); } 400081e8: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 400081ec: 94 10 20 00 clr %o2 400081f0: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400081f4: 90 10 00 1c mov %i4, %o0 400081f8: 96 12 e2 00 or %o3, 0x200, %o3 400081fc: 40 00 4a ad call 4001acb0 <__divdi3> 40008200: 92 10 00 1d mov %i5, %o1 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40008204: 94 10 20 00 clr %o2 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40008208: d2 26 60 6c st %o1, [ %i1 + 0x6c ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 4000820c: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40008210: 90 10 00 1c mov %i4, %o0 40008214: 96 12 e2 00 or %o3, 0x200, %o3 40008218: 40 00 4b 91 call 4001b05c <__moddi3> 4000821c: 92 10 00 1d mov %i5, %o1 40008220: d2 26 60 70 st %o1, [ %i1 + 0x70 ] ptimer->timer_data = normalize; /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; _TOD_Get( &ptimer->time ); _Thread_Enable_dispatch(); 40008224: 40 00 0d 2e call 4000b6dc <_Thread_Enable_dispatch> 40008228: b0 10 20 00 clr %i0 4000822c: 81 c7 e0 08 ret 40008230: 81 e8 00 00 restore 40008234: 90 07 bf e0 add %fp, -32, %o0 40008238: 13 10 00 83 sethi %hi(0x40020c00), %o1 4000823c: 40 00 06 9d call 40009cb0 <_TOD_Get_with_nanoseconds> 40008240: 92 12 61 48 or %o1, 0x148, %o1 ! 40020d48 <_TOD> case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); } 40008244: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40008248: 94 10 20 00 clr %o2 4000824c: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40008250: 90 10 00 1c mov %i4, %o0 40008254: 96 12 e2 00 or %o3, 0x200, %o3 40008258: 40 00 4a 96 call 4001acb0 <__divdi3> 4000825c: 92 10 00 1d mov %i5, %o1 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40008260: 94 10 20 00 clr %o2 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40008264: d2 27 bf e8 st %o1, [ %fp + -24 ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40008268: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 4000826c: 90 10 00 1c mov %i4, %o0 40008270: 96 12 e2 00 or %o3, 0x200, %o3 40008274: 40 00 4b 7a call 4001b05c <__moddi3> 40008278: 92 10 00 1d mov %i5, %o1 /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { struct timespec now; _TOD_Get( &now ); /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 4000827c: 90 07 bf f8 add %fp, -8, %o0 40008280: d2 27 bf ec st %o1, [ %fp + -20 ] 40008284: 40 00 0f d7 call 4000c1e0 <_Timespec_Less_than> 40008288: 92 07 bf e8 add %fp, -24, %o1 4000828c: 80 8a 20 ff btst 0xff, %o0 40008290: 12 80 00 0e bne 400082c8 40008294: 92 07 bf f8 add %fp, -8, %o1 rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value ); 40008298: 90 07 bf e8 add %fp, -24, %o0 4000829c: 40 00 0f e3 call 4000c228 <_Timespec_Subtract> 400082a0: 94 10 00 09 mov %o1, %o2 400082a4: 92 10 00 18 mov %i0, %o1 400082a8: 11 10 00 84 sethi %hi(0x40021000), %o0 400082ac: 94 07 bf dc add %fp, -36, %o2 400082b0: 40 00 09 54 call 4000a800 <_Objects_Get> 400082b4: 90 12 20 c4 or %o0, 0xc4, %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 ) { 400082b8: c2 07 bf dc ld [ %fp + -36 ], %g1 400082bc: 80 a0 60 00 cmp %g1, 0 400082c0: 02 bf ff 9c be 40008130 400082c4: b2 10 00 08 mov %o0, %i1 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 400082c8: 40 00 24 11 call 4001130c <__errno> 400082cc: b0 10 3f ff mov -1, %i0 400082d0: 82 10 20 16 mov 0x16, %g1 400082d4: c2 22 00 00 st %g1, [ %o0 ] } 400082d8: 81 c7 e0 08 ret 400082dc: 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 ); 400082e0: 40 00 10 ef call 4000c69c <_Watchdog_Remove> 400082e4: 90 02 20 10 add %o0, 0x10, %o0 /* The old data of the timer are returned */ if ( ovalue ) 400082e8: 80 a6 e0 00 cmp %i3, 0 400082ec: 02 80 00 0b be 40008318 400082f0: c2 07 bf f0 ld [ %fp + -16 ], %g1 *ovalue = ptimer->timer_data; 400082f4: c2 06 60 54 ld [ %i1 + 0x54 ], %g1 400082f8: c2 26 c0 00 st %g1, [ %i3 ] 400082fc: c2 06 60 58 ld [ %i1 + 0x58 ], %g1 40008300: c2 26 e0 04 st %g1, [ %i3 + 4 ] 40008304: c2 06 60 5c ld [ %i1 + 0x5c ], %g1 40008308: c2 26 e0 08 st %g1, [ %i3 + 8 ] 4000830c: c2 06 60 60 ld [ %i1 + 0x60 ], %g1 40008310: c2 26 e0 0c st %g1, [ %i3 + 0xc ] /* The new data are set */ ptimer->timer_data = normalize; 40008314: c2 07 bf f0 ld [ %fp + -16 ], %g1 /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; /* Returns with success */ _Thread_Enable_dispatch(); return 0; 40008318: 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; 4000831c: c2 26 60 54 st %g1, [ %i1 + 0x54 ] 40008320: c2 07 bf f4 ld [ %fp + -12 ], %g1 40008324: c2 26 60 58 st %g1, [ %i1 + 0x58 ] 40008328: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000832c: c2 26 60 5c st %g1, [ %i1 + 0x5c ] 40008330: c2 07 bf fc ld [ %fp + -4 ], %g1 40008334: c2 26 60 60 st %g1, [ %i1 + 0x60 ] /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 40008338: 82 10 20 04 mov 4, %g1 /* Returns with success */ _Thread_Enable_dispatch(); 4000833c: 40 00 0c e8 call 4000b6dc <_Thread_Enable_dispatch> 40008340: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] 40008344: 81 c7 e0 08 ret 40008348: 81 e8 00 00 restore =============================================================================== 40007ff4 : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 40007ff4: 9d e3 bf 98 save %sp, -104, %sp /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 40007ff8: 3b 10 00 6a sethi %hi(0x4001a800), %i5 40007ffc: ba 17 62 48 or %i5, 0x248, %i5 ! 4001aa48 <_POSIX_signals_Ualarm_timer> 40008000: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 40008004: 80 a0 60 00 cmp %g1, 0 40008008: 02 80 00 24 be 40008098 4000800c: 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 ); 40008010: 40 00 10 8e call 4000c248 <_Watchdog_Remove> 40008014: 90 10 00 1d mov %i5, %o0 if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 40008018: 90 02 3f fe add %o0, -2, %o0 4000801c: 80 a2 20 01 cmp %o0, 1 40008020: 08 80 00 26 bleu 400080b8 <== ALWAYS TAKEN 40008024: 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 ) { 40008028: 80 a7 20 00 cmp %i4, 0 4000802c: 02 80 00 19 be 40008090 40008030: 37 00 03 d0 sethi %hi(0xf4000), %i3 Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 40008034: 90 10 00 1c mov %i4, %o0 40008038: 40 00 37 2b call 40015ce4 <.udiv> 4000803c: 92 16 e2 40 or %i3, 0x240, %o1 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 40008040: 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; 40008044: d0 27 bf f8 st %o0, [ %fp + -8 ] tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 40008048: 40 00 37 d3 call 40015f94 <.urem> 4000804c: 90 10 00 1c mov %i4, %o0 40008050: 87 2a 20 07 sll %o0, 7, %g3 40008054: 82 10 00 08 mov %o0, %g1 40008058: 85 2a 20 02 sll %o0, 2, %g2 4000805c: 84 20 c0 02 sub %g3, %g2, %g2 40008060: 82 00 80 01 add %g2, %g1, %g1 40008064: 83 28 60 03 sll %g1, 3, %g1 ticks = _Timespec_To_ticks( &tp ); 40008068: 90 07 bf f8 add %fp, -8, %o0 4000806c: 40 00 0f 3e call 4000bd64 <_Timespec_To_ticks> 40008070: c2 27 bf fc st %g1, [ %fp + -4 ] if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 40008074: 40 00 0f 3c call 4000bd64 <_Timespec_To_ticks> 40008078: 90 07 bf f8 add %fp, -8, %o0 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000807c: 92 10 00 1d mov %i5, %o1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40008080: d0 27 60 0c st %o0, [ %i5 + 0xc ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40008084: 11 10 00 68 sethi %hi(0x4001a000), %o0 40008088: 40 00 10 11 call 4000c0cc <_Watchdog_Insert> 4000808c: 90 12 21 f8 or %o0, 0x1f8, %o0 ! 4001a1f8 <_Watchdog_Ticks_chain> } return remaining; } 40008090: 81 c7 e0 08 ret 40008094: 81 e8 00 00 restore Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 40008098: 03 10 00 1f sethi %hi(0x40007c00), %g1 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 4000809c: c0 27 60 08 clr [ %i5 + 8 ] the_watchdog->routine = routine; 400080a0: 82 10 63 c4 or %g1, 0x3c4, %g1 the_watchdog->id = id; 400080a4: c0 27 60 20 clr [ %i5 + 0x20 ] Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 400080a8: c2 27 60 1c st %g1, [ %i5 + 0x1c ] the_watchdog->id = id; the_watchdog->user_data = user_data; 400080ac: c0 27 60 24 clr [ %i5 + 0x24 ] useconds_t ualarm( useconds_t useconds, useconds_t interval ) { useconds_t remaining = 0; 400080b0: 10 bf ff de b 40008028 400080b4: 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); 400080b8: c4 07 60 0c ld [ %i5 + 0xc ], %g2 400080bc: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 400080c0: d0 07 60 14 ld [ %i5 + 0x14 ], %o0 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 400080c4: 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); 400080c8: 90 02 00 02 add %o0, %g2, %o0 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 400080cc: 40 00 0f 11 call 4000bd10 <_Timespec_From_ticks> 400080d0: 90 22 00 01 sub %o0, %g1, %o0 remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 400080d4: c2 07 bf f8 ld [ %fp + -8 ], %g1 remaining += tp.tv_nsec / 1000; 400080d8: 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; 400080dc: 85 28 60 03 sll %g1, 3, %g2 400080e0: 87 28 60 08 sll %g1, 8, %g3 400080e4: 84 20 c0 02 sub %g3, %g2, %g2 remaining += tp.tv_nsec / 1000; 400080e8: 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; 400080ec: b1 28 a0 06 sll %g2, 6, %i0 400080f0: b0 26 00 02 sub %i0, %g2, %i0 remaining += tp.tv_nsec / 1000; 400080f4: 40 00 36 fe call 40015cec <.div> 400080f8: 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; 400080fc: b1 2e 20 06 sll %i0, 6, %i0 remaining += tp.tv_nsec / 1000; 40008100: 10 bf ff ca b 40008028 40008104: b0 02 00 18 add %o0, %i0, %i0