=============================================================================== 02010af4 <_CORE_message_queue_Initialize>: CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { 2010af4: 9d e3 bf a0 save %sp, -96, %sp size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 2010af8: f4 26 20 44 st %i2, [ %i0 + 0x44 ] the_message_queue->number_of_pending_messages = 0; 2010afc: c0 26 20 48 clr [ %i0 + 0x48 ] the_message_queue->maximum_message_size = maximum_message_size; 2010b00: f6 26 20 4c st %i3, [ %i0 + 0x4c ] /* * Round size up to multiple of a pointer for chain init and * check for overflow on adding overhead to each message. */ allocated_message_size = maximum_message_size; if (allocated_message_size & (sizeof(uint32_t) - 1)) { 2010b04: 80 8e e0 03 btst 3, %i3 2010b08: 02 80 00 07 be 2010b24 <_CORE_message_queue_Initialize+0x30> 2010b0c: ba 10 00 1b mov %i3, %i5 allocated_message_size += sizeof(uint32_t); 2010b10: ba 06 e0 04 add %i3, 4, %i5 allocated_message_size &= ~(sizeof(uint32_t) - 1); 2010b14: ba 0f 7f fc and %i5, -4, %i5 } if (allocated_message_size < maximum_message_size) 2010b18: 80 a7 40 1b cmp %i5, %i3 2010b1c: 0a 80 00 24 bcs 2010bac <_CORE_message_queue_Initialize+0xb8><== NEVER TAKEN 2010b20: b8 10 20 00 clr %i4 /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ if ( !size_t_mult32_with_overflow( 2010b24: ba 07 60 10 add %i5, 0x10, %i5 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; 2010b28: 90 10 20 00 clr %o0 2010b2c: 92 10 00 1a mov %i2, %o1 2010b30: 94 10 20 00 clr %o2 2010b34: 96 10 00 1d mov %i5, %o3 2010b38: 40 00 3f 8a call 2020960 <__muldi3> 2010b3c: b8 10 20 00 clr %i4 if ( x > SIZE_MAX ) 2010b40: 80 a2 20 00 cmp %o0, 0 2010b44: 34 80 00 1b bg,a 2010bb0 <_CORE_message_queue_Initialize+0xbc> 2010b48: b0 0f 20 01 and %i4, 1, %i0 /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); 2010b4c: 40 00 0b e5 call 2013ae0 <_Workspace_Allocate> 2010b50: 90 10 00 09 mov %o1, %o0 return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 2010b54: d0 26 20 5c st %o0, [ %i0 + 0x5c ] _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 2010b58: 80 a2 20 00 cmp %o0, 0 2010b5c: 02 80 00 14 be 2010bac <_CORE_message_queue_Initialize+0xb8><== NEVER TAKEN 2010b60: 92 10 00 08 mov %o0, %o1 /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 2010b64: 90 06 20 60 add %i0, 0x60, %o0 2010b68: 94 10 00 1a mov %i2, %o2 2010b6c: 7f ff ff d4 call 2010abc <_Chain_Initialize> 2010b70: 96 10 00 1d mov %i5, %o3 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 ); 2010b74: 82 06 20 50 add %i0, 0x50, %g1 head->next = tail; head->previous = NULL; tail->previous = head; 2010b78: c2 26 20 58 st %g1, [ %i0 + 0x58 ] allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 2010b7c: c2 06 40 00 ld [ %i1 ], %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 ); 2010b80: 84 06 20 54 add %i0, 0x54, %g2 2010b84: 82 18 60 01 xor %g1, 1, %g1 2010b88: 80 a0 00 01 cmp %g0, %g1 head->next = tail; 2010b8c: c4 26 20 50 st %g2, [ %i0 + 0x50 ] head->previous = NULL; 2010b90: c0 26 20 54 clr [ %i0 + 0x54 ] 2010b94: 90 10 00 18 mov %i0, %o0 2010b98: 92 60 3f ff subx %g0, -1, %o1 2010b9c: 94 10 20 80 mov 0x80, %o2 2010ba0: 96 10 20 06 mov 6, %o3 2010ba4: 40 00 09 aa call 201324c <_Thread_queue_Initialize> 2010ba8: b8 10 20 01 mov 1, %i4 STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } 2010bac: b0 0f 20 01 and %i4, 1, %i0 2010bb0: 81 c7 e0 08 ret 2010bb4: 81 e8 00 00 restore =============================================================================== 02008694 <_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 ) { 2008694: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 2008698: 90 10 00 18 mov %i0, %o0 200869c: 40 00 07 67 call 200a438 <_Thread_queue_Dequeue> 20086a0: ba 10 00 18 mov %i0, %i5 20086a4: 80 a2 20 00 cmp %o0, 0 20086a8: 12 80 00 0e bne 20086e0 <_CORE_semaphore_Surrender+0x4c> 20086ac: b0 10 20 00 clr %i0 if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 20086b0: 7f ff e7 cf call 20025ec 20086b4: 01 00 00 00 nop if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 20086b8: c2 07 60 48 ld [ %i5 + 0x48 ], %g1 20086bc: c4 07 60 40 ld [ %i5 + 0x40 ], %g2 20086c0: 80 a0 40 02 cmp %g1, %g2 20086c4: 1a 80 00 05 bcc 20086d8 <_CORE_semaphore_Surrender+0x44> <== NEVER TAKEN 20086c8: b0 10 20 04 mov 4, %i0 the_semaphore->count += 1; 20086cc: 82 00 60 01 inc %g1 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 20086d0: b0 10 20 00 clr %i0 #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; 20086d4: c2 27 60 48 st %g1, [ %i5 + 0x48 ] else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 20086d8: 7f ff e7 c9 call 20025fc 20086dc: 01 00 00 00 nop } return status; } 20086e0: 81 c7 e0 08 ret 20086e4: 81 e8 00 00 restore =============================================================================== 02007400 <_Event_Surrender>: */ void _Event_Surrender( Thread_Control *the_thread ) { 2007400: 9d e3 bf a0 save %sp, -96, %sp rtems_event_set event_condition; rtems_event_set seized_events; rtems_option option_set; RTEMS_API_Control *api; api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 2007404: f8 06 21 50 ld [ %i0 + 0x150 ], %i4 option_set = (rtems_option) the_thread->Wait.option; 2007408: f6 06 20 30 ld [ %i0 + 0x30 ], %i3 _ISR_Disable( level ); 200740c: 7f ff ec 78 call 20025ec 2007410: ba 10 00 18 mov %i0, %i5 2007414: b0 10 00 08 mov %o0, %i0 pending_events = api->pending_events; 2007418: c4 07 00 00 ld [ %i4 ], %g2 event_condition = (rtems_event_set) the_thread->Wait.count; 200741c: c6 07 60 24 ld [ %i5 + 0x24 ], %g3 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 2007420: 82 88 c0 02 andcc %g3, %g2, %g1 2007424: 02 80 00 43 be 2007530 <_Event_Surrender+0x130> 2007428: 01 00 00 00 nop /* * 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() && 200742c: 09 00 80 72 sethi %hi(0x201c800), %g4 2007430: 88 11 20 e0 or %g4, 0xe0, %g4 ! 201c8e0 <_Per_CPU_Information> 2007434: f2 01 20 08 ld [ %g4 + 8 ], %i1 2007438: 80 a6 60 00 cmp %i1, 0 200743c: 22 80 00 1d be,a 20074b0 <_Event_Surrender+0xb0> 2007440: c8 07 60 10 ld [ %i5 + 0x10 ], %g4 2007444: c8 01 20 0c ld [ %g4 + 0xc ], %g4 2007448: 80 a7 40 04 cmp %i5, %g4 200744c: 32 80 00 19 bne,a 20074b0 <_Event_Surrender+0xb0> 2007450: c8 07 60 10 ld [ %i5 + 0x10 ], %g4 _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 2007454: 09 00 80 72 sethi %hi(0x201c800), %g4 2007458: f2 01 21 40 ld [ %g4 + 0x140 ], %i1 ! 201c940 <_Event_Sync_state> /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && 200745c: 80 a6 60 02 cmp %i1, 2 2007460: 02 80 00 07 be 200747c <_Event_Surrender+0x7c> <== NEVER TAKEN 2007464: 80 a0 40 03 cmp %g1, %g3 ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 2007468: c8 01 21 40 ld [ %g4 + 0x140 ], %g4 * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 200746c: 80 a1 20 01 cmp %g4, 1 2007470: 32 80 00 10 bne,a 20074b0 <_Event_Surrender+0xb0> 2007474: c8 07 60 10 ld [ %i5 + 0x10 ], %g4 (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 2007478: 80 a0 40 03 cmp %g1, %g3 200747c: 02 80 00 04 be 200748c <_Event_Surrender+0x8c> 2007480: 80 8e e0 02 btst 2, %i3 2007484: 02 80 00 2b be 2007530 <_Event_Surrender+0x130> <== NEVER TAKEN 2007488: 01 00 00 00 nop 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) ); 200748c: 84 28 80 01 andn %g2, %g1, %g2 api->pending_events = _Event_sets_Clear( pending_events,seized_events ); 2007490: c4 27 00 00 st %g2, [ %i4 ] the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 2007494: c4 07 60 28 ld [ %i5 + 0x28 ], %g2 _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { api->pending_events = _Event_sets_Clear( pending_events,seized_events ); the_thread->Wait.count = 0; 2007498: c0 27 60 24 clr [ %i5 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 200749c: c2 20 80 00 st %g1, [ %g2 ] _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 20074a0: 84 10 20 03 mov 3, %g2 20074a4: 03 00 80 72 sethi %hi(0x201c800), %g1 20074a8: c4 20 61 40 st %g2, [ %g1 + 0x140 ] ! 201c940 <_Event_Sync_state> 20074ac: 30 80 00 21 b,a 2007530 <_Event_Surrender+0x130> } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 20074b0: 80 89 21 00 btst 0x100, %g4 20074b4: 02 80 00 1f be 2007530 <_Event_Surrender+0x130> 20074b8: 80 a0 40 03 cmp %g1, %g3 if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 20074bc: 02 80 00 04 be 20074cc <_Event_Surrender+0xcc> 20074c0: 80 8e e0 02 btst 2, %i3 20074c4: 02 80 00 1b be 2007530 <_Event_Surrender+0x130> <== NEVER TAKEN 20074c8: 01 00 00 00 nop 20074cc: 84 28 80 01 andn %g2, %g1, %g2 api->pending_events = _Event_sets_Clear( pending_events, seized_events ); 20074d0: c4 27 00 00 st %g2, [ %i4 ] the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 20074d4: c4 07 60 28 ld [ %i5 + 0x28 ], %g2 * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { api->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; 20074d8: c0 27 60 24 clr [ %i5 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 20074dc: c2 20 80 00 st %g1, [ %g2 ] _ISR_Flash( level ); 20074e0: 7f ff ec 47 call 20025fc 20074e4: 90 10 00 18 mov %i0, %o0 20074e8: 7f ff ec 41 call 20025ec 20074ec: 01 00 00 00 nop if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 20074f0: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 20074f4: 80 a0 60 02 cmp %g1, 2 20074f8: 02 80 00 06 be 2007510 <_Event_Surrender+0x110> 20074fc: 82 10 20 03 mov 3, %g1 _ISR_Enable( level ); 2007500: 7f ff ec 3f call 20025fc 2007504: 33 04 00 ff sethi %hi(0x1003fc00), %i1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 2007508: 10 80 00 08 b 2007528 <_Event_Surrender+0x128> 200750c: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1003fff8 RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 2007510: c2 27 60 50 st %g1, [ %i5 + 0x50 ] _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 2007514: 7f ff ec 3a call 20025fc 2007518: 33 04 00 ff sethi %hi(0x1003fc00), %i1 (void) _Watchdog_Remove( &the_thread->Timer ); 200751c: 40 00 0e 7f call 200af18 <_Watchdog_Remove> 2007520: 90 07 60 48 add %i5, 0x48, %o0 2007524: b2 16 63 f8 or %i1, 0x3f8, %i1 2007528: 40 00 0a 10 call 2009d68 <_Thread_Clear_state> 200752c: 91 e8 00 1d restore %g0, %i5, %o0 _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 2007530: 7f ff ec 33 call 20025fc 2007534: 81 e8 00 00 restore =============================================================================== 02007538 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 2007538: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 200753c: 90 10 00 18 mov %i0, %o0 2007540: 40 00 0a f6 call 200a118 <_Thread_Get> 2007544: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 2007548: c2 07 bf fc ld [ %fp + -4 ], %g1 200754c: 80 a0 60 00 cmp %g1, 0 2007550: 12 80 00 1d bne 20075c4 <_Event_Timeout+0x8c> <== NEVER TAKEN 2007554: 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 ); 2007558: 7f ff ec 25 call 20025ec 200755c: 01 00 00 00 nop RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 2007560: 03 00 80 72 sethi %hi(0x201c800), %g1 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 2007564: c2 00 60 ec ld [ %g1 + 0xec ], %g1 ! 201c8ec <_Per_CPU_Information+0xc> 2007568: 80 a7 40 01 cmp %i5, %g1 200756c: 12 80 00 09 bne 2007590 <_Event_Timeout+0x58> 2007570: c0 27 60 24 clr [ %i5 + 0x24 ] if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 2007574: 03 00 80 72 sethi %hi(0x201c800), %g1 2007578: c4 00 61 40 ld [ %g1 + 0x140 ], %g2 ! 201c940 <_Event_Sync_state> 200757c: 80 a0 a0 01 cmp %g2, 1 2007580: 32 80 00 05 bne,a 2007594 <_Event_Timeout+0x5c> 2007584: 82 10 20 06 mov 6, %g1 _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 2007588: 84 10 20 02 mov 2, %g2 200758c: c4 20 61 40 st %g2, [ %g1 + 0x140 ] } the_thread->Wait.return_code = RTEMS_TIMEOUT; 2007590: 82 10 20 06 mov 6, %g1 2007594: c2 27 60 34 st %g1, [ %i5 + 0x34 ] _ISR_Enable( level ); 2007598: 7f ff ec 19 call 20025fc 200759c: 01 00 00 00 nop RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 20075a0: 90 10 00 1d mov %i5, %o0 20075a4: 13 04 00 ff sethi %hi(0x1003fc00), %o1 20075a8: 40 00 09 f0 call 2009d68 <_Thread_Clear_state> 20075ac: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1003fff8 * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 20075b0: 03 00 80 71 sethi %hi(0x201c400), %g1 20075b4: c4 00 62 b0 ld [ %g1 + 0x2b0 ], %g2 ! 201c6b0 <_Thread_Dispatch_disable_level> 20075b8: 84 00 bf ff add %g2, -1, %g2 20075bc: c4 20 62 b0 st %g2, [ %g1 + 0x2b0 ] return _Thread_Dispatch_disable_level; 20075c0: c2 00 62 b0 ld [ %g1 + 0x2b0 ], %g1 20075c4: 81 c7 e0 08 ret 20075c8: 81 e8 00 00 restore =============================================================================== 0200cecc <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { 200cecc: 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; 200ced0: c0 27 bf f8 clr [ %fp + -8 ] Heap_Block *extend_last_block = NULL; 200ced4: c0 27 bf fc clr [ %fp + -4 ] uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; 200ced8: ba 06 40 1a add %i1, %i2, %i5 uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 200cedc: e0 06 20 20 ld [ %i0 + 0x20 ], %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; 200cee0: e2 06 20 10 ld [ %i0 + 0x10 ], %l1 uintptr_t const min_block_size = heap->min_block_size; 200cee4: d6 06 20 14 ld [ %i0 + 0x14 ], %o3 uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; uintptr_t const free_size = stats->free_size; 200cee8: e4 06 20 30 ld [ %i0 + 0x30 ], %l2 uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { 200ceec: 80 a7 40 19 cmp %i5, %i1 200cef0: 0a 80 00 9f bcs 200d16c <_Heap_Extend+0x2a0> 200cef4: b8 10 20 00 clr %i4 return false; } extend_area_ok = _Heap_Get_first_and_last_block( 200cef8: 90 10 00 19 mov %i1, %o0 200cefc: 92 10 00 1a mov %i2, %o1 200cf00: 94 10 00 11 mov %l1, %o2 200cf04: 98 07 bf f8 add %fp, -8, %o4 200cf08: 7f ff ee 91 call 200894c <_Heap_Get_first_and_last_block> 200cf0c: 9a 07 bf fc add %fp, -4, %o5 page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 200cf10: 80 8a 20 ff btst 0xff, %o0 200cf14: 02 80 00 96 be 200d16c <_Heap_Extend+0x2a0> 200cf18: b4 10 00 10 mov %l0, %i2 200cf1c: aa 10 20 00 clr %l5 200cf20: ac 10 20 00 clr %l6 200cf24: b8 10 20 00 clr %i4 200cf28: a8 10 20 00 clr %l4 200cf2c: c2 06 20 18 ld [ %i0 + 0x18 ], %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 ( 200cf30: 80 a0 40 1d cmp %g1, %i5 200cf34: 1a 80 00 05 bcc 200cf48 <_Heap_Extend+0x7c> 200cf38: e6 06 80 00 ld [ %i2 ], %l3 200cf3c: 80 a6 40 13 cmp %i1, %l3 200cf40: 2a 80 00 8b bcs,a 200d16c <_Heap_Extend+0x2a0> 200cf44: b8 10 20 00 clr %i4 sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 200cf48: 80 a7 40 01 cmp %i5, %g1 200cf4c: 02 80 00 06 be 200cf64 <_Heap_Extend+0x98> 200cf50: 80 a7 40 13 cmp %i5, %l3 merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 200cf54: 2a 80 00 05 bcs,a 200cf68 <_Heap_Extend+0x9c> 200cf58: ac 10 00 1a mov %i2, %l6 200cf5c: 10 80 00 04 b 200cf6c <_Heap_Extend+0xa0> 200cf60: 90 10 00 13 mov %l3, %o0 200cf64: a8 10 00 1a mov %i2, %l4 200cf68: 90 10 00 13 mov %l3, %o0 200cf6c: 40 00 2c 0d call 2017fa0 <.urem> 200cf70: 92 10 00 11 mov %l1, %o1 200cf74: ae 04 ff f8 add %l3, -8, %l7 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 200cf78: 80 a4 c0 19 cmp %l3, %i1 200cf7c: 12 80 00 05 bne 200cf90 <_Heap_Extend+0xc4> 200cf80: 90 25 c0 08 sub %l7, %o0, %o0 start_block->prev_size = extend_area_end; 200cf84: fa 26 80 00 st %i5, [ %i2 ] RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 200cf88: 10 80 00 04 b 200cf98 <_Heap_Extend+0xcc> 200cf8c: b8 10 00 08 mov %o0, %i4 merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 200cf90: 2a 80 00 02 bcs,a 200cf98 <_Heap_Extend+0xcc> 200cf94: 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; 200cf98: f4 02 20 04 ld [ %o0 + 4 ], %i2 200cf9c: b4 0e bf fe and %i2, -2, %i2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 200cfa0: b4 02 00 1a add %o0, %i2, %i2 link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 200cfa4: 80 a6 80 10 cmp %i2, %l0 200cfa8: 12 bf ff e2 bne 200cf30 <_Heap_Extend+0x64> 200cfac: 82 10 00 1a mov %i2, %g1 if ( extend_area_begin < heap->area_begin ) { 200cfb0: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 200cfb4: 80 a6 40 01 cmp %i1, %g1 200cfb8: 3a 80 00 04 bcc,a 200cfc8 <_Heap_Extend+0xfc> 200cfbc: c2 06 20 1c ld [ %i0 + 0x1c ], %g1 heap->area_begin = extend_area_begin; 200cfc0: 10 80 00 05 b 200cfd4 <_Heap_Extend+0x108> 200cfc4: f2 26 20 18 st %i1, [ %i0 + 0x18 ] } else if ( heap->area_end < extend_area_end ) { 200cfc8: 80 a0 40 1d cmp %g1, %i5 200cfcc: 2a 80 00 02 bcs,a 200cfd4 <_Heap_Extend+0x108> 200cfd0: fa 26 20 1c st %i5, [ %i0 + 0x1c ] heap->area_end = extend_area_end; } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 200cfd4: c4 07 bf f8 ld [ %fp + -8 ], %g2 200cfd8: c2 07 bf fc ld [ %fp + -4 ], %g1 extend_first_block->prev_size = extend_area_end; 200cfdc: fa 20 80 00 st %i5, [ %g2 ] heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 200cfe0: 86 20 40 02 sub %g1, %g2, %g3 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 200cfe4: 88 10 e0 01 or %g3, 1, %g4 _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; 200cfe8: c6 20 40 00 st %g3, [ %g1 ] 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 = 200cfec: c8 20 a0 04 st %g4, [ %g2 + 4 ] 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 ) { 200cff0: c6 06 20 20 ld [ %i0 + 0x20 ], %g3 200cff4: 80 a0 c0 02 cmp %g3, %g2 200cff8: 08 80 00 04 bleu 200d008 <_Heap_Extend+0x13c> 200cffc: c0 20 60 04 clr [ %g1 + 4 ] heap->first_block = extend_first_block; 200d000: 10 80 00 06 b 200d018 <_Heap_Extend+0x14c> 200d004: c4 26 20 20 st %g2, [ %i0 + 0x20 ] } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 200d008: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 200d00c: 80 a0 80 01 cmp %g2, %g1 200d010: 2a 80 00 02 bcs,a 200d018 <_Heap_Extend+0x14c> 200d014: c2 26 20 24 st %g1, [ %i0 + 0x24 ] heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { 200d018: 80 a5 20 00 cmp %l4, 0 200d01c: 02 80 00 14 be 200d06c <_Heap_Extend+0x1a0> 200d020: 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; 200d024: f4 06 20 10 ld [ %i0 + 0x10 ], %i2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 200d028: 92 10 00 1a mov %i2, %o1 200d02c: 40 00 2b dd call 2017fa0 <.urem> 200d030: 90 10 00 19 mov %i1, %o0 if ( remainder != 0 ) { 200d034: 80 a2 20 00 cmp %o0, 0 200d038: 02 80 00 04 be 200d048 <_Heap_Extend+0x17c> 200d03c: c2 05 00 00 ld [ %l4 ], %g1 return value - remainder + alignment; 200d040: b2 06 40 1a add %i1, %i2, %i1 200d044: 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 = 200d048: 92 06 7f f8 add %i1, -8, %o1 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; 200d04c: c2 26 7f f8 st %g1, [ %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 = 200d050: 82 25 00 09 sub %l4, %o1, %g1 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; 200d054: 82 10 60 01 or %g1, 1, %g1 _Heap_Free_block( heap, new_first_block ); 200d058: 90 10 00 18 mov %i0, %o0 200d05c: 7f ff ff 92 call 200cea4 <_Heap_Free_block> 200d060: c2 22 60 04 st %g1, [ %o1 + 4 ] link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 200d064: 10 80 00 08 b 200d084 <_Heap_Extend+0x1b8> 200d068: 80 a7 20 00 cmp %i4, 0 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 ) { 200d06c: 80 a5 a0 00 cmp %l6, 0 200d070: 02 80 00 04 be 200d080 <_Heap_Extend+0x1b4> 200d074: ac 25 80 01 sub %l6, %g1, %l6 { 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; 200d078: 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 = 200d07c: ec 20 60 04 st %l6, [ %g1 + 4 ] link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 200d080: 80 a7 20 00 cmp %i4, 0 200d084: 02 80 00 15 be 200d0d8 <_Heap_Extend+0x20c> 200d088: ba 07 7f f8 add %i5, -8, %i5 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 200d08c: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 uintptr_t extend_area_end ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( 200d090: ba 27 40 1c sub %i5, %i4, %i5 200d094: 40 00 2b c3 call 2017fa0 <.urem> 200d098: 90 10 00 1d mov %i5, %o0 ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) 200d09c: c4 07 20 04 ld [ %i4 + 4 ], %g2 200d0a0: ba 27 40 08 sub %i5, %o0, %i5 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = 200d0a4: 82 07 40 1c add %i5, %i4, %g1 (last_block->size_and_flag - last_block_new_size) 200d0a8: 84 20 80 1d sub %g2, %i5, %g2 | HEAP_PREV_BLOCK_USED; 200d0ac: 84 10 a0 01 or %g2, 1, %g2 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = 200d0b0: c4 20 60 04 st %g2, [ %g1 + 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; 200d0b4: c2 07 20 04 ld [ %i4 + 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 ); 200d0b8: 90 10 00 18 mov %i0, %o0 200d0bc: 82 08 60 01 and %g1, 1, %g1 200d0c0: 92 10 00 1c mov %i4, %o1 block->size_and_flag = size | flag; 200d0c4: ba 17 40 01 or %i5, %g1, %i5 200d0c8: 7f ff ff 77 call 200cea4 <_Heap_Free_block> 200d0cc: fa 27 20 04 st %i5, [ %i4 + 4 ] extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 200d0d0: 10 80 00 0f b 200d10c <_Heap_Extend+0x240> 200d0d4: 80 a7 20 00 cmp %i4, 0 ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 200d0d8: 80 a5 60 00 cmp %l5, 0 200d0dc: 02 80 00 0b be 200d108 <_Heap_Extend+0x23c> 200d0e0: c6 07 bf f8 ld [ %fp + -8 ], %g3 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 200d0e4: c4 05 60 04 ld [ %l5 + 4 ], %g2 _Heap_Link_above( 200d0e8: c2 07 bf fc ld [ %fp + -4 ], %g1 ) { 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 ); 200d0ec: 86 20 c0 15 sub %g3, %l5, %g3 200d0f0: 84 08 a0 01 and %g2, 1, %g2 block->size_and_flag = size | flag; 200d0f4: 84 10 c0 02 or %g3, %g2, %g2 200d0f8: c4 25 60 04 st %g2, [ %l5 + 4 ] last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 200d0fc: c4 00 60 04 ld [ %g1 + 4 ], %g2 200d100: 84 10 a0 01 or %g2, 1, %g2 200d104: c4 20 60 04 st %g2, [ %g1 + 4 ] extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 200d108: 80 a7 20 00 cmp %i4, 0 200d10c: 32 80 00 09 bne,a 200d130 <_Heap_Extend+0x264> 200d110: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 200d114: 80 a5 20 00 cmp %l4, 0 200d118: 32 80 00 06 bne,a 200d130 <_Heap_Extend+0x264> 200d11c: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 _Heap_Free_block( heap, extend_first_block ); 200d120: d2 07 bf f8 ld [ %fp + -8 ], %o1 200d124: 7f ff ff 60 call 200cea4 <_Heap_Free_block> 200d128: 90 10 00 18 mov %i0, %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 200d12c: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 200d130: c6 06 20 20 ld [ %i0 + 0x20 ], %g3 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 200d134: c4 00 60 04 ld [ %g1 + 4 ], %g2 * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 200d138: 86 20 c0 01 sub %g3, %g1, %g3 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 200d13c: 84 08 a0 01 and %g2, 1, %g2 block->size_and_flag = size | flag; 200d140: 84 10 c0 02 or %g3, %g2, %g2 200d144: c4 20 60 04 st %g2, [ %g1 + 4 ] } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 200d148: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 stats->size += extended_size; if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; 200d14c: b8 10 20 01 mov 1, %i4 _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 200d150: a4 20 40 12 sub %g1, %l2, %l2 /* Statistics */ stats->size += extended_size; 200d154: c2 06 20 2c ld [ %i0 + 0x2c ], %g1 if ( extended_size_ptr != NULL ) 200d158: 80 a6 e0 00 cmp %i3, 0 _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; /* Statistics */ stats->size += extended_size; 200d15c: 82 00 40 12 add %g1, %l2, %g1 if ( extended_size_ptr != NULL ) 200d160: 02 80 00 03 be 200d16c <_Heap_Extend+0x2a0> <== NEVER TAKEN 200d164: c2 26 20 2c st %g1, [ %i0 + 0x2c ] 200d168: e4 26 c0 00 st %l2, [ %i3 ] *extended_size_ptr = extended_size; return true; } 200d16c: b0 0f 20 01 and %i4, 1, %i0 200d170: 81 c7 e0 08 ret 200d174: 81 e8 00 00 restore =============================================================================== 0200cee8 <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 200cee8: 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 ) { return true; 200ceec: 88 10 20 01 mov 1, %g4 /* * 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 ) { 200cef0: 80 a6 60 00 cmp %i1, 0 200cef4: 02 80 00 78 be 200d0d4 <_Heap_Free+0x1ec> 200cef8: 90 10 00 19 mov %i1, %o0 200cefc: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 200cf00: 40 00 2b 84 call 2017d10 <.urem> 200cf04: ba 06 7f f8 add %i1, -8, %i5 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 200cf08: d8 06 20 20 ld [ %i0 + 0x20 ], %o4 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 200cf0c: ba 27 40 08 sub %i5, %o0, %i5 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 200cf10: 80 a7 40 0c cmp %i5, %o4 200cf14: 0a 80 00 05 bcs 200cf28 <_Heap_Free+0x40> 200cf18: 82 10 20 00 clr %g1 200cf1c: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 200cf20: 80 a0 40 1d cmp %g1, %i5 200cf24: 82 60 3f ff subx %g0, -1, %g1 } alloc_begin = (uintptr_t) alloc_begin_ptr; block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { 200cf28: 80 a0 60 00 cmp %g1, 0 200cf2c: 02 80 00 6a be 200d0d4 <_Heap_Free+0x1ec> 200cf30: 88 10 20 00 clr %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; 200cf34: da 07 60 04 ld [ %i5 + 4 ], %o5 200cf38: 84 0b 7f fe and %o5, -2, %g2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 200cf3c: 82 07 40 02 add %i5, %g2, %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; 200cf40: 80 a0 40 0c cmp %g1, %o4 200cf44: 0a 80 00 05 bcs 200cf58 <_Heap_Free+0x70> <== NEVER TAKEN 200cf48: 86 10 20 00 clr %g3 200cf4c: c6 06 20 24 ld [ %i0 + 0x24 ], %g3 200cf50: 80 a0 c0 01 cmp %g3, %g1 200cf54: 86 60 3f ff subx %g0, -1, %g3 _Heap_Protection_block_check( heap, block ); block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 200cf58: 80 a0 e0 00 cmp %g3, 0 200cf5c: 02 80 00 5e be 200d0d4 <_Heap_Free+0x1ec> <== NEVER TAKEN 200cf60: 88 10 20 00 clr %g4 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; 200cf64: de 00 60 04 ld [ %g1 + 4 ], %o7 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 200cf68: 80 8b e0 01 btst 1, %o7 200cf6c: 02 80 00 5a be 200d0d4 <_Heap_Free+0x1ec> <== NEVER TAKEN 200cf70: 9e 0b ff fe and %o7, -2, %o7 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 200cf74: c8 06 20 24 ld [ %i0 + 0x24 ], %g4 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 200cf78: 80 a0 40 04 cmp %g1, %g4 200cf7c: 02 80 00 07 be 200cf98 <_Heap_Free+0xb0> 200cf80: 96 10 20 00 clr %o3 200cf84: 86 00 40 0f add %g1, %o7, %g3 200cf88: c6 00 e0 04 ld [ %g3 + 4 ], %g3 200cf8c: 86 08 e0 01 and %g3, 1, %g3 200cf90: 80 a0 00 03 cmp %g0, %g3 200cf94: 96 60 3f ff subx %g0, -1, %o3 if ( !_Heap_Is_prev_used( block ) ) { 200cf98: 80 8b 60 01 btst 1, %o5 200cf9c: 12 80 00 26 bne 200d034 <_Heap_Free+0x14c> 200cfa0: 80 8a e0 ff btst 0xff, %o3 uintptr_t const prev_size = block->prev_size; 200cfa4: da 07 40 00 ld [ %i5 ], %o5 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 200cfa8: 86 27 40 0d sub %i5, %o5, %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; 200cfac: 80 a0 c0 0c cmp %g3, %o4 200cfb0: 0a 80 00 04 bcs 200cfc0 <_Heap_Free+0xd8> <== NEVER TAKEN 200cfb4: 94 10 20 00 clr %o2 200cfb8: 80 a1 00 03 cmp %g4, %g3 200cfbc: 94 60 3f ff subx %g0, -1, %o2 Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 200cfc0: 80 a2 a0 00 cmp %o2, 0 200cfc4: 02 80 00 44 be 200d0d4 <_Heap_Free+0x1ec> <== NEVER TAKEN 200cfc8: 88 10 20 00 clr %g4 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; 200cfcc: d8 00 e0 04 ld [ %g3 + 4 ], %o4 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) ) { 200cfd0: 80 8b 20 01 btst 1, %o4 200cfd4: 02 80 00 40 be 200d0d4 <_Heap_Free+0x1ec> <== NEVER TAKEN 200cfd8: 80 8a e0 ff btst 0xff, %o3 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 200cfdc: 22 80 00 0f be,a 200d018 <_Heap_Free+0x130> 200cfe0: 9a 00 80 0d add %g2, %o5, %o5 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 200cfe4: c8 00 60 08 ld [ %g1 + 8 ], %g4 Heap_Block *prev = block->prev; 200cfe8: c2 00 60 0c ld [ %g1 + 0xc ], %g1 uintptr_t const size = block_size + prev_size + next_block_size; 200cfec: 9e 00 80 0f add %g2, %o7, %o7 prev->next = next; 200cff0: c8 20 60 08 st %g4, [ %g1 + 8 ] next->prev = prev; 200cff4: c2 21 20 0c st %g1, [ %g4 + 0xc ] _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 200cff8: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; 200cffc: 9a 03 c0 0d add %o7, %o5, %o5 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 200d000: 82 00 7f ff add %g1, -1, %g1 200d004: c2 26 20 38 st %g1, [ %i0 + 0x38 ] prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 200d008: da 20 c0 0d st %o5, [ %g3 + %o5 ] 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; 200d00c: 82 13 60 01 or %o5, 1, %g1 200d010: 10 80 00 27 b 200d0ac <_Heap_Free+0x1c4> 200d014: c2 20 e0 04 st %g1, [ %g3 + 4 ] 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; 200d018: 88 13 60 01 or %o5, 1, %g4 200d01c: c8 20 e0 04 st %g4, [ %g3 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 200d020: c6 00 60 04 ld [ %g1 + 4 ], %g3 next_block->prev_size = size; 200d024: da 27 40 02 st %o5, [ %i5 + %g2 ] _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; 200d028: 86 08 ff fe and %g3, -2, %g3 200d02c: 10 80 00 20 b 200d0ac <_Heap_Free+0x1c4> 200d030: c6 20 60 04 st %g3, [ %g1 + 4 ] next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 200d034: 22 80 00 0d be,a 200d068 <_Heap_Free+0x180> 200d038: c6 06 20 08 ld [ %i0 + 8 ], %g3 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 200d03c: c8 00 60 08 ld [ %g1 + 8 ], %g4 Heap_Block *prev = old_block->prev; 200d040: c2 00 60 0c ld [ %g1 + 0xc ], %g1 new_block->next = next; 200d044: c8 27 60 08 st %g4, [ %i5 + 8 ] new_block->prev = prev; 200d048: c2 27 60 0c st %g1, [ %i5 + 0xc ] uintptr_t const size = block_size + next_block_size; 200d04c: 86 03 c0 02 add %o7, %g2, %g3 next->prev = new_block; prev->next = new_block; 200d050: fa 20 60 08 st %i5, [ %g1 + 8 ] Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; 200d054: fa 21 20 0c st %i5, [ %g4 + 0xc ] _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 200d058: 82 10 e0 01 or %g3, 1, %g1 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 200d05c: c6 27 40 03 st %g3, [ %i5 + %g3 ] 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; 200d060: 10 80 00 13 b 200d0ac <_Heap_Free+0x1c4> 200d064: c2 27 60 04 st %g1, [ %i5 + 4 ] ) { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; 200d068: f0 27 60 0c st %i0, [ %i5 + 0xc ] Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 200d06c: c6 27 60 08 st %g3, [ %i5 + 8 ] new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 200d070: fa 20 e0 0c st %i5, [ %g3 + 0xc ] 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; 200d074: 86 10 a0 01 or %g2, 1, %g3 200d078: c6 27 60 04 st %g3, [ %i5 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 200d07c: c6 00 60 04 ld [ %g1 + 4 ], %g3 next_block->prev_size = block_size; 200d080: c4 27 40 02 st %g2, [ %i5 + %g2 ] } 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; 200d084: 86 08 ff fe and %g3, -2, %g3 200d088: c6 20 60 04 st %g3, [ %g1 + 4 ] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 200d08c: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 if ( stats->max_free_blocks < stats->free_blocks ) { 200d090: c6 06 20 3c ld [ %i0 + 0x3c ], %g3 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; 200d094: 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; 200d098: fa 26 20 08 st %i5, [ %i0 + 8 ] if ( stats->max_free_blocks < stats->free_blocks ) { 200d09c: 80 a0 c0 01 cmp %g3, %g1 200d0a0: 1a 80 00 03 bcc 200d0ac <_Heap_Free+0x1c4> 200d0a4: c2 26 20 38 st %g1, [ %i0 + 0x38 ] stats->max_free_blocks = stats->free_blocks; 200d0a8: c2 26 20 3c st %g1, [ %i0 + 0x3c ] } } /* Statistics */ --stats->used_blocks; 200d0ac: c2 06 20 40 ld [ %i0 + 0x40 ], %g1 ++stats->frees; stats->free_size += block_size; return( true ); 200d0b0: 88 10 20 01 mov 1, %g4 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 200d0b4: 82 00 7f ff add %g1, -1, %g1 200d0b8: c2 26 20 40 st %g1, [ %i0 + 0x40 ] ++stats->frees; 200d0bc: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 200d0c0: 82 00 60 01 inc %g1 200d0c4: c2 26 20 50 st %g1, [ %i0 + 0x50 ] stats->free_size += block_size; 200d0c8: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 200d0cc: 84 00 40 02 add %g1, %g2, %g2 200d0d0: c4 26 20 30 st %g2, [ %i0 + 0x30 ] return( true ); } 200d0d4: b0 09 20 01 and %g4, 1, %i0 200d0d8: 81 c7 e0 08 ret 200d0dc: 81 e8 00 00 restore =============================================================================== 0203e0d0 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 203e0d0: 9d e3 bf a0 save %sp, -96, %sp Heap_Block *current = heap->first_block; 203e0d4: d0 06 20 20 ld [ %i0 + 0x20 ], %o0 Heap_Block *end = heap->last_block; 203e0d8: 10 80 00 0b b 203e104 <_Heap_Iterate+0x34> 203e0dc: f8 06 20 24 ld [ %i0 + 0x24 ], %i4 while ( !stop && current != end ) { 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 ); 203e0e0: 96 10 00 1a mov %i2, %o3 - 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; 203e0e4: 92 0a 7f fe and %o1, -2, %o1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 203e0e8: ba 02 00 09 add %o0, %o1, %i5 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; 203e0ec: d4 07 60 04 ld [ %i5 + 4 ], %o2 203e0f0: 9f c6 40 00 call %i1 203e0f4: 94 0a a0 01 and %o2, 1, %o2 { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 203e0f8: 80 8a 20 ff btst 0xff, %o0 203e0fc: 12 80 00 05 bne 203e110 <_Heap_Iterate+0x40> <== NEVER TAKEN 203e100: 90 10 00 1d mov %i5, %o0 203e104: 80 a2 00 1c cmp %o0, %i4 203e108: 32 bf ff f6 bne,a 203e0e0 <_Heap_Iterate+0x10> 203e10c: d2 02 20 04 ld [ %o0 + 4 ], %o1 203e110: 81 c7 e0 08 ret 203e114: 81 e8 00 00 restore =============================================================================== 0200d200 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 200d200: 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); 200d204: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 200d208: 40 00 2a c2 call 2017d10 <.urem> 200d20c: 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 200d210: c6 06 20 20 ld [ %i0 + 0x20 ], %g3 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 200d214: 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); 200d218: 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; 200d21c: 80 a2 00 03 cmp %o0, %g3 200d220: 0a 80 00 05 bcs 200d234 <_Heap_Size_of_alloc_area+0x34> 200d224: 84 10 20 00 clr %g2 200d228: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 200d22c: 80 a0 40 08 cmp %g1, %o0 200d230: 84 60 3f ff subx %g0, -1, %g2 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 200d234: 80 a0 a0 00 cmp %g2, 0 200d238: 02 80 00 15 be 200d28c <_Heap_Size_of_alloc_area+0x8c> 200d23c: 82 10 20 00 clr %g1 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 200d240: fa 02 20 04 ld [ %o0 + 4 ], %i5 200d244: 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); 200d248: ba 02 00 1d add %o0, %i5, %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; 200d24c: 80 a7 40 03 cmp %i5, %g3 200d250: 0a 80 00 05 bcs 200d264 <_Heap_Size_of_alloc_area+0x64> <== NEVER TAKEN 200d254: 84 10 20 00 clr %g2 200d258: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 200d25c: 80 a0 40 1d cmp %g1, %i5 200d260: 84 60 3f ff subx %g0, -1, %g2 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 200d264: 80 a0 a0 00 cmp %g2, 0 200d268: 02 80 00 09 be 200d28c <_Heap_Size_of_alloc_area+0x8c> <== NEVER TAKEN 200d26c: 82 10 20 00 clr %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; 200d270: c4 07 60 04 ld [ %i5 + 4 ], %g2 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 200d274: 80 88 a0 01 btst 1, %g2 200d278: 02 80 00 05 be 200d28c <_Heap_Size_of_alloc_area+0x8c> <== NEVER TAKEN 200d27c: ba 27 40 19 sub %i5, %i1, %i5 return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; 200d280: 82 10 20 01 mov 1, %g1 || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 200d284: ba 07 60 04 add %i5, 4, %i5 200d288: fa 26 80 00 st %i5, [ %i2 ] return true; } 200d28c: b0 08 60 01 and %g1, 1, %i0 200d290: 81 c7 e0 08 ret 200d294: 81 e8 00 00 restore =============================================================================== 02009808 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 2009808: 9d e3 bf 80 save %sp, -128, %sp uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 200980c: 3b 00 80 25 sethi %hi(0x2009400), %i5 Heap_Control *heap, int source, bool dump ) { uintptr_t const page_size = heap->page_size; 2009810: f8 06 20 10 ld [ %i0 + 0x10 ], %i4 uintptr_t const min_block_size = heap->min_block_size; 2009814: e0 06 20 14 ld [ %i0 + 0x14 ], %l0 Heap_Block *const first_block = heap->first_block; 2009818: f6 06 20 20 ld [ %i0 + 0x20 ], %i3 Heap_Block *const last_block = heap->last_block; 200981c: e2 06 20 24 ld [ %i0 + 0x24 ], %l1 Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 2009820: 80 a6 a0 00 cmp %i2, 0 2009824: 02 80 00 04 be 2009834 <_Heap_Walk+0x2c> 2009828: ba 17 63 b4 or %i5, 0x3b4, %i5 200982c: 3b 00 80 25 sethi %hi(0x2009400), %i5 2009830: ba 17 63 bc or %i5, 0x3bc, %i5 ! 20097bc <_Heap_Walk_print> if ( !_System_state_Is_up( _System_state_Get() ) ) { 2009834: 03 00 80 7a sethi %hi(0x201e800), %g1 2009838: c4 00 63 d8 ld [ %g1 + 0x3d8 ], %g2 ! 201ebd8 <_System_state_Current> 200983c: 80 a0 a0 03 cmp %g2, 3 2009840: 12 80 01 24 bne 2009cd0 <_Heap_Walk+0x4c8> 2009844: 82 10 20 01 mov 1, %g1 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)( 2009848: c2 06 20 1c ld [ %i0 + 0x1c ], %g1 200984c: da 06 20 18 ld [ %i0 + 0x18 ], %o5 2009850: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 2009854: f6 23 a0 60 st %i3, [ %sp + 0x60 ] 2009858: e2 23 a0 64 st %l1, [ %sp + 0x64 ] 200985c: c2 06 20 08 ld [ %i0 + 8 ], %g1 2009860: 90 10 00 19 mov %i1, %o0 2009864: c2 23 a0 68 st %g1, [ %sp + 0x68 ] 2009868: c2 06 20 0c ld [ %i0 + 0xc ], %g1 200986c: 92 10 20 00 clr %o1 2009870: c2 23 a0 6c st %g1, [ %sp + 0x6c ] 2009874: 15 00 80 6d sethi %hi(0x201b400), %o2 2009878: 96 10 00 1c mov %i4, %o3 200987c: 94 12 a2 f0 or %o2, 0x2f0, %o2 2009880: 9f c7 40 00 call %i5 2009884: 98 10 00 10 mov %l0, %o4 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 2009888: 80 a7 20 00 cmp %i4, 0 200988c: 12 80 00 07 bne 20098a8 <_Heap_Walk+0xa0> 2009890: 80 8f 20 07 btst 7, %i4 (*printer)( source, true, "page size is zero\n" ); 2009894: 15 00 80 6d sethi %hi(0x201b400), %o2 2009898: 90 10 00 19 mov %i1, %o0 200989c: 92 10 20 01 mov 1, %o1 20098a0: 10 80 00 32 b 2009968 <_Heap_Walk+0x160> 20098a4: 94 12 a3 88 or %o2, 0x388, %o2 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 20098a8: 22 80 00 08 be,a 20098c8 <_Heap_Walk+0xc0> 20098ac: 90 10 00 10 mov %l0, %o0 (*printer)( 20098b0: 15 00 80 6d sethi %hi(0x201b400), %o2 20098b4: 90 10 00 19 mov %i1, %o0 20098b8: 92 10 20 01 mov 1, %o1 20098bc: 94 12 a3 a0 or %o2, 0x3a0, %o2 20098c0: 10 80 01 0b b 2009cec <_Heap_Walk+0x4e4> 20098c4: 96 10 00 1c mov %i4, %o3 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 20098c8: 7f ff e0 86 call 2001ae0 <.urem> 20098cc: 92 10 00 1c mov %i4, %o1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 20098d0: 80 a2 20 00 cmp %o0, 0 20098d4: 22 80 00 08 be,a 20098f4 <_Heap_Walk+0xec> 20098d8: 90 06 e0 08 add %i3, 8, %o0 (*printer)( 20098dc: 15 00 80 6d sethi %hi(0x201b400), %o2 20098e0: 90 10 00 19 mov %i1, %o0 20098e4: 92 10 20 01 mov 1, %o1 20098e8: 94 12 a3 c0 or %o2, 0x3c0, %o2 20098ec: 10 80 01 00 b 2009cec <_Heap_Walk+0x4e4> 20098f0: 96 10 00 10 mov %l0, %o3 20098f4: 7f ff e0 7b call 2001ae0 <.urem> 20098f8: 92 10 00 1c mov %i4, %o1 ); return false; } if ( 20098fc: 80 a2 20 00 cmp %o0, 0 2009900: 22 80 00 08 be,a 2009920 <_Heap_Walk+0x118> 2009904: c2 06 e0 04 ld [ %i3 + 4 ], %g1 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 2009908: 15 00 80 6d sethi %hi(0x201b400), %o2 200990c: 90 10 00 19 mov %i1, %o0 2009910: 92 10 20 01 mov 1, %o1 2009914: 94 12 a3 e8 or %o2, 0x3e8, %o2 2009918: 10 80 00 f5 b 2009cec <_Heap_Walk+0x4e4> 200991c: 96 10 00 1b mov %i3, %o3 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 2009920: 80 88 60 01 btst 1, %g1 2009924: 32 80 00 07 bne,a 2009940 <_Heap_Walk+0x138> 2009928: f4 04 60 04 ld [ %l1 + 4 ], %i2 (*printer)( 200992c: 15 00 80 6e sethi %hi(0x201b800), %o2 2009930: 90 10 00 19 mov %i1, %o0 2009934: 92 10 20 01 mov 1, %o1 2009938: 10 80 00 0c b 2009968 <_Heap_Walk+0x160> 200993c: 94 12 a0 20 or %o2, 0x20, %o2 - 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; 2009940: b4 0e bf fe and %i2, -2, %i2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 2009944: b4 04 40 1a add %l1, %i2, %i2 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; 2009948: c2 06 a0 04 ld [ %i2 + 4 ], %g1 ); return false; } if ( _Heap_Is_free( last_block ) ) { 200994c: 80 88 60 01 btst 1, %g1 2009950: 12 80 00 0a bne 2009978 <_Heap_Walk+0x170> 2009954: 80 a6 80 1b cmp %i2, %i3 (*printer)( 2009958: 15 00 80 6e sethi %hi(0x201b800), %o2 200995c: 90 10 00 19 mov %i1, %o0 2009960: 92 10 20 01 mov 1, %o1 2009964: 94 12 a0 50 or %o2, 0x50, %o2 2009968: 9f c7 40 00 call %i5 200996c: 01 00 00 00 nop if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 2009970: 10 80 00 d8 b 2009cd0 <_Heap_Walk+0x4c8> 2009974: 82 10 20 00 clr %g1 ! 0 ); return false; } if ( 2009978: 02 80 00 06 be 2009990 <_Heap_Walk+0x188> 200997c: 15 00 80 6e sethi %hi(0x201b800), %o2 _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 2009980: 90 10 00 19 mov %i1, %o0 2009984: 92 10 20 01 mov 1, %o1 2009988: 10 bf ff f8 b 2009968 <_Heap_Walk+0x160> 200998c: 94 12 a0 68 or %o2, 0x68, %o2 int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 2009990: e6 06 20 10 ld [ %i0 + 0x10 ], %l3 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 2009994: d6 06 20 08 ld [ %i0 + 8 ], %o3 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 2009998: 10 80 00 33 b 2009a64 <_Heap_Walk+0x25c> 200999c: a4 10 00 18 mov %i0, %l2 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; 20099a0: 80 a0 80 0b cmp %g2, %o3 20099a4: 18 80 00 05 bgu 20099b8 <_Heap_Walk+0x1b0> 20099a8: 82 10 20 00 clr %g1 20099ac: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 20099b0: 80 a0 40 0b cmp %g1, %o3 20099b4: 82 60 3f ff subx %g0, -1, %g1 const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { 20099b8: 80 a0 60 00 cmp %g1, 0 20099bc: 32 80 00 07 bne,a 20099d8 <_Heap_Walk+0x1d0> 20099c0: 90 02 e0 08 add %o3, 8, %o0 (*printer)( 20099c4: 15 00 80 6e sethi %hi(0x201b800), %o2 20099c8: 90 10 00 19 mov %i1, %o0 20099cc: 92 10 20 01 mov 1, %o1 20099d0: 10 80 00 c7 b 2009cec <_Heap_Walk+0x4e4> 20099d4: 94 12 a0 98 or %o2, 0x98, %o2 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 20099d8: d6 27 bf f8 st %o3, [ %fp + -8 ] 20099dc: 7f ff e0 41 call 2001ae0 <.urem> 20099e0: 92 10 00 13 mov %l3, %o1 ); return false; } if ( 20099e4: 80 a2 20 00 cmp %o0, 0 20099e8: 02 80 00 07 be 2009a04 <_Heap_Walk+0x1fc> 20099ec: d6 07 bf f8 ld [ %fp + -8 ], %o3 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 20099f0: 15 00 80 6e sethi %hi(0x201b800), %o2 20099f4: 90 10 00 19 mov %i1, %o0 20099f8: 92 10 20 01 mov 1, %o1 20099fc: 10 80 00 bc b 2009cec <_Heap_Walk+0x4e4> 2009a00: 94 12 a0 b8 or %o2, 0xb8, %o2 - 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; 2009a04: c2 02 e0 04 ld [ %o3 + 4 ], %g1 2009a08: 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; 2009a0c: 82 02 c0 01 add %o3, %g1, %g1 2009a10: c2 00 60 04 ld [ %g1 + 4 ], %g1 ); return false; } if ( _Heap_Is_used( free_block ) ) { 2009a14: 80 88 60 01 btst 1, %g1 2009a18: 22 80 00 07 be,a 2009a34 <_Heap_Walk+0x22c> 2009a1c: d8 02 e0 0c ld [ %o3 + 0xc ], %o4 (*printer)( 2009a20: 15 00 80 6e sethi %hi(0x201b800), %o2 2009a24: 90 10 00 19 mov %i1, %o0 2009a28: 92 10 20 01 mov 1, %o1 2009a2c: 10 80 00 b0 b 2009cec <_Heap_Walk+0x4e4> 2009a30: 94 12 a0 e8 or %o2, 0xe8, %o2 ); return false; } if ( free_block->prev != prev_block ) { 2009a34: 80 a3 00 12 cmp %o4, %l2 2009a38: 22 80 00 0a be,a 2009a60 <_Heap_Walk+0x258> 2009a3c: a4 10 00 0b mov %o3, %l2 (*printer)( 2009a40: 15 00 80 6e sethi %hi(0x201b800), %o2 2009a44: 90 10 00 19 mov %i1, %o0 2009a48: 92 10 20 01 mov 1, %o1 2009a4c: 94 12 a1 08 or %o2, 0x108, %o2 2009a50: 9f c7 40 00 call %i5 2009a54: 01 00 00 00 nop if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 2009a58: 10 80 00 9e b 2009cd0 <_Heap_Walk+0x4c8> 2009a5c: 82 10 20 00 clr %g1 ! 0 return false; } prev_block = free_block; free_block = free_block->next; 2009a60: d6 02 e0 08 ld [ %o3 + 8 ], %o3 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 ) { 2009a64: 80 a2 c0 18 cmp %o3, %i0 2009a68: 32 bf ff ce bne,a 20099a0 <_Heap_Walk+0x198> 2009a6c: c4 06 20 20 ld [ %i0 + 0x20 ], %g2 2009a70: 2d 00 80 6e sethi %hi(0x201b800), %l6 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( 2009a74: 2f 00 80 6e sethi %hi(0x201b800), %l7 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 2009a78: ac 15 a2 c8 or %l6, 0x2c8, %l6 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( 2009a7c: ae 15 e2 b0 or %l7, 0x2b0, %l7 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 2009a80: 2b 00 80 6e sethi %hi(0x201b800), %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; 2009a84: c2 06 a0 04 ld [ %i2 + 4 ], %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; 2009a88: c6 06 20 20 ld [ %i0 + 0x20 ], %g3 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 2009a8c: a4 08 7f fe and %g1, -2, %l2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 2009a90: a6 06 80 12 add %i2, %l2, %l3 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; 2009a94: 80 a0 c0 13 cmp %g3, %l3 2009a98: 18 80 00 05 bgu 2009aac <_Heap_Walk+0x2a4> <== NEVER TAKEN 2009a9c: 84 10 20 00 clr %g2 2009aa0: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 2009aa4: 80 a0 80 13 cmp %g2, %l3 2009aa8: 84 60 3f ff subx %g0, -1, %g2 bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 2009aac: 80 a0 a0 00 cmp %g2, 0 2009ab0: 12 80 00 07 bne 2009acc <_Heap_Walk+0x2c4> 2009ab4: 84 1e 80 11 xor %i2, %l1, %g2 (*printer)( 2009ab8: 15 00 80 6e sethi %hi(0x201b800), %o2 2009abc: 90 10 00 19 mov %i1, %o0 2009ac0: 92 10 20 01 mov 1, %o1 2009ac4: 10 80 00 2c b 2009b74 <_Heap_Walk+0x36c> 2009ac8: 94 12 a1 40 or %o2, 0x140, %o2 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; 2009acc: 80 a0 00 02 cmp %g0, %g2 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 2009ad0: c2 27 bf fc st %g1, [ %fp + -4 ] 2009ad4: a8 40 20 00 addx %g0, 0, %l4 2009ad8: 90 10 00 12 mov %l2, %o0 2009adc: 7f ff e0 01 call 2001ae0 <.urem> 2009ae0: 92 10 00 1c mov %i4, %o1 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 2009ae4: 80 a2 20 00 cmp %o0, 0 2009ae8: 02 80 00 0c be 2009b18 <_Heap_Walk+0x310> 2009aec: c2 07 bf fc ld [ %fp + -4 ], %g1 2009af0: 80 8d 20 ff btst 0xff, %l4 2009af4: 02 80 00 0a be 2009b1c <_Heap_Walk+0x314> 2009af8: 80 a4 80 10 cmp %l2, %l0 (*printer)( 2009afc: 15 00 80 6e sethi %hi(0x201b800), %o2 2009b00: 90 10 00 19 mov %i1, %o0 2009b04: 92 10 20 01 mov 1, %o1 2009b08: 94 12 a1 70 or %o2, 0x170, %o2 2009b0c: 96 10 00 1a mov %i2, %o3 2009b10: 10 bf ff d0 b 2009a50 <_Heap_Walk+0x248> 2009b14: 98 10 00 12 mov %l2, %o4 ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 2009b18: 80 a4 80 10 cmp %l2, %l0 2009b1c: 1a 80 00 0d bcc 2009b50 <_Heap_Walk+0x348> 2009b20: 80 a4 c0 1a cmp %l3, %i2 2009b24: 80 8d 20 ff btst 0xff, %l4 2009b28: 02 80 00 0a be 2009b50 <_Heap_Walk+0x348> <== NEVER TAKEN 2009b2c: 80 a4 c0 1a cmp %l3, %i2 (*printer)( 2009b30: 15 00 80 6e sethi %hi(0x201b800), %o2 2009b34: 90 10 00 19 mov %i1, %o0 2009b38: 92 10 20 01 mov 1, %o1 2009b3c: 94 12 a1 a0 or %o2, 0x1a0, %o2 2009b40: 96 10 00 1a mov %i2, %o3 2009b44: 98 10 00 12 mov %l2, %o4 2009b48: 10 80 00 3d b 2009c3c <_Heap_Walk+0x434> 2009b4c: 9a 10 00 10 mov %l0, %o5 ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 2009b50: 38 80 00 0c bgu,a 2009b80 <_Heap_Walk+0x378> 2009b54: a8 08 60 01 and %g1, 1, %l4 2009b58: 80 8d 20 ff btst 0xff, %l4 2009b5c: 02 80 00 09 be 2009b80 <_Heap_Walk+0x378> 2009b60: a8 08 60 01 and %g1, 1, %l4 (*printer)( 2009b64: 15 00 80 6e sethi %hi(0x201b800), %o2 2009b68: 90 10 00 19 mov %i1, %o0 2009b6c: 92 10 20 01 mov 1, %o1 2009b70: 94 12 a1 d0 or %o2, 0x1d0, %o2 2009b74: 96 10 00 1a mov %i2, %o3 2009b78: 10 bf ff b6 b 2009a50 <_Heap_Walk+0x248> 2009b7c: 98 10 00 13 mov %l3, %o4 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; 2009b80: c2 04 e0 04 ld [ %l3 + 4 ], %g1 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 2009b84: 80 88 60 01 btst 1, %g1 2009b88: 12 80 00 40 bne 2009c88 <_Heap_Walk+0x480> 2009b8c: 90 10 00 19 mov %i1, %o0 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 ? 2009b90: da 06 a0 0c ld [ %i2 + 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)( 2009b94: c2 06 20 08 ld [ %i0 + 8 ], %g1 2009b98: 05 00 80 6d sethi %hi(0x201b400), %g2 return _Heap_Free_list_head(heap)->next; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 2009b9c: c8 06 20 0c ld [ %i0 + 0xc ], %g4 2009ba0: 80 a3 40 01 cmp %o5, %g1 2009ba4: 02 80 00 07 be 2009bc0 <_Heap_Walk+0x3b8> 2009ba8: 86 10 a2 b0 or %g2, 0x2b0, %g3 block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 2009bac: 80 a3 40 18 cmp %o5, %i0 2009bb0: 12 80 00 04 bne 2009bc0 <_Heap_Walk+0x3b8> 2009bb4: 86 15 62 78 or %l5, 0x278, %g3 2009bb8: 07 00 80 6d sethi %hi(0x201b400), %g3 2009bbc: 86 10 e2 c0 or %g3, 0x2c0, %g3 ! 201b6c0 <__log2table+0x130> block->next, block->next == last_free_block ? 2009bc0: c4 06 a0 08 ld [ %i2 + 8 ], %g2 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 2009bc4: 1f 00 80 6d sethi %hi(0x201b400), %o7 2009bc8: 80 a0 80 04 cmp %g2, %g4 2009bcc: 02 80 00 07 be 2009be8 <_Heap_Walk+0x3e0> 2009bd0: 82 13 e2 d0 or %o7, 0x2d0, %g1 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 2009bd4: 80 a0 80 18 cmp %g2, %i0 2009bd8: 12 80 00 04 bne 2009be8 <_Heap_Walk+0x3e0> 2009bdc: 82 15 62 78 or %l5, 0x278, %g1 2009be0: 03 00 80 6d sethi %hi(0x201b400), %g1 2009be4: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 201b6e0 <__log2table+0x150> 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)( 2009be8: c6 23 a0 5c st %g3, [ %sp + 0x5c ] 2009bec: c4 23 a0 60 st %g2, [ %sp + 0x60 ] 2009bf0: c2 23 a0 64 st %g1, [ %sp + 0x64 ] 2009bf4: 90 10 00 19 mov %i1, %o0 2009bf8: 92 10 20 00 clr %o1 2009bfc: 15 00 80 6e sethi %hi(0x201b800), %o2 2009c00: 96 10 00 1a mov %i2, %o3 2009c04: 94 12 a2 08 or %o2, 0x208, %o2 2009c08: 9f c7 40 00 call %i5 2009c0c: 98 10 00 12 mov %l2, %o4 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 2009c10: da 04 c0 00 ld [ %l3 ], %o5 2009c14: 80 a4 80 0d cmp %l2, %o5 2009c18: 02 80 00 0d be 2009c4c <_Heap_Walk+0x444> 2009c1c: 80 a5 20 00 cmp %l4, 0 (*printer)( 2009c20: 15 00 80 6e sethi %hi(0x201b800), %o2 2009c24: e6 23 a0 5c st %l3, [ %sp + 0x5c ] 2009c28: 90 10 00 19 mov %i1, %o0 2009c2c: 92 10 20 01 mov 1, %o1 2009c30: 94 12 a2 40 or %o2, 0x240, %o2 2009c34: 96 10 00 1a mov %i2, %o3 2009c38: 98 10 00 12 mov %l2, %o4 2009c3c: 9f c7 40 00 call %i5 2009c40: 01 00 00 00 nop 2009c44: 10 80 00 23 b 2009cd0 <_Heap_Walk+0x4c8> 2009c48: 82 10 20 00 clr %g1 ! 0 ); return false; } if ( !prev_used ) { 2009c4c: 32 80 00 0a bne,a 2009c74 <_Heap_Walk+0x46c> 2009c50: c2 06 20 08 ld [ %i0 + 8 ], %g1 (*printer)( 2009c54: 15 00 80 6e sethi %hi(0x201b800), %o2 2009c58: 90 10 00 19 mov %i1, %o0 2009c5c: 92 10 20 01 mov 1, %o1 2009c60: 10 80 00 22 b 2009ce8 <_Heap_Walk+0x4e0> 2009c64: 94 12 a2 80 or %o2, 0x280, %o2 { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { if ( free_block == block ) { 2009c68: 02 80 00 17 be 2009cc4 <_Heap_Walk+0x4bc> 2009c6c: 80 a4 c0 1b cmp %l3, %i3 return true; } free_block = free_block->next; 2009c70: c2 00 60 08 ld [ %g1 + 8 ], %g1 ) { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { 2009c74: 80 a0 40 18 cmp %g1, %i0 2009c78: 12 bf ff fc bne 2009c68 <_Heap_Walk+0x460> 2009c7c: 80 a0 40 1a cmp %g1, %i2 return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 2009c80: 10 80 00 17 b 2009cdc <_Heap_Walk+0x4d4> 2009c84: 15 00 80 6e sethi %hi(0x201b800), %o2 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 2009c88: 80 a5 20 00 cmp %l4, 0 2009c8c: 02 80 00 08 be 2009cac <_Heap_Walk+0x4a4> 2009c90: 92 10 20 00 clr %o1 (*printer)( 2009c94: 94 10 00 17 mov %l7, %o2 2009c98: 96 10 00 1a mov %i2, %o3 2009c9c: 9f c7 40 00 call %i5 2009ca0: 98 10 00 12 mov %l2, %o4 block->prev_size ); } block = next_block; } while ( block != first_block ); 2009ca4: 10 80 00 08 b 2009cc4 <_Heap_Walk+0x4bc> 2009ca8: 80 a4 c0 1b cmp %l3, %i3 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 2009cac: da 06 80 00 ld [ %i2 ], %o5 2009cb0: 94 10 00 16 mov %l6, %o2 2009cb4: 96 10 00 1a mov %i2, %o3 2009cb8: 9f c7 40 00 call %i5 2009cbc: 98 10 00 12 mov %l2, %o4 block->prev_size ); } block = next_block; } while ( block != first_block ); 2009cc0: 80 a4 c0 1b cmp %l3, %i3 2009cc4: 12 bf ff 70 bne 2009a84 <_Heap_Walk+0x27c> 2009cc8: b4 10 00 13 mov %l3, %i2 return true; 2009ccc: 82 10 20 01 mov 1, %g1 } 2009cd0: b0 08 60 01 and %g1, 1, %i0 2009cd4: 81 c7 e0 08 ret 2009cd8: 81 e8 00 00 restore return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 2009cdc: 90 10 00 19 mov %i1, %o0 2009ce0: 92 10 20 01 mov 1, %o1 2009ce4: 94 12 a2 f0 or %o2, 0x2f0, %o2 2009ce8: 96 10 00 1a mov %i2, %o3 2009cec: 9f c7 40 00 call %i5 2009cf0: 01 00 00 00 nop 2009cf4: 10 bf ff f7 b 2009cd0 <_Heap_Walk+0x4c8> 2009cf8: 82 10 20 00 clr %g1 ! 0 =============================================================================== 02008cac <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 2008cac: 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 ) 2008cb0: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 2008cb4: ba 10 00 18 mov %i0, %i5 * If the application is using the optional manager stubs and * still attempts to create the object, the information block * should be all zeroed out because it is in the BSS. So let's * check that code for this manager is even present. */ if ( information->size == 0 ) 2008cb8: 80 a0 60 00 cmp %g1, 0 2008cbc: 02 80 00 20 be 2008d3c <_Objects_Allocate+0x90> <== NEVER TAKEN 2008cc0: b0 10 20 00 clr %i0 /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 2008cc4: b8 07 60 20 add %i5, 0x20, %i4 2008cc8: 7f ff fd 76 call 20082a0 <_Chain_Get> 2008ccc: 90 10 00 1c mov %i4, %o0 if ( information->auto_extend ) { 2008cd0: c2 0f 60 12 ldub [ %i5 + 0x12 ], %g1 2008cd4: 80 a0 60 00 cmp %g1, 0 2008cd8: 02 80 00 19 be 2008d3c <_Objects_Allocate+0x90> 2008cdc: 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 ) { 2008ce0: 80 a2 20 00 cmp %o0, 0 2008ce4: 32 80 00 0a bne,a 2008d0c <_Objects_Allocate+0x60> 2008ce8: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 _Objects_Extend_information( information ); 2008cec: 40 00 00 1d call 2008d60 <_Objects_Extend_information> 2008cf0: 90 10 00 1d mov %i5, %o0 the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 2008cf4: 7f ff fd 6b call 20082a0 <_Chain_Get> 2008cf8: 90 10 00 1c mov %i4, %o0 } if ( the_object ) { 2008cfc: b0 92 20 00 orcc %o0, 0, %i0 2008d00: 02 80 00 0f be 2008d3c <_Objects_Allocate+0x90> 2008d04: 01 00 00 00 nop uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 2008d08: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 2008d0c: d0 16 20 0a lduh [ %i0 + 0xa ], %o0 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 2008d10: d2 17 60 14 lduh [ %i5 + 0x14 ], %o1 2008d14: 40 00 3b 53 call 2017a60 <.udiv> 2008d18: 90 22 00 01 sub %o0, %g1, %o0 information->inactive_per_block[ block ]--; 2008d1c: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 2008d20: 91 2a 20 02 sll %o0, 2, %o0 2008d24: c4 00 40 08 ld [ %g1 + %o0 ], %g2 2008d28: 84 00 bf ff add %g2, -1, %g2 2008d2c: c4 20 40 08 st %g2, [ %g1 + %o0 ] information->inactive--; 2008d30: c2 17 60 2c lduh [ %i5 + 0x2c ], %g1 2008d34: 82 00 7f ff add %g1, -1, %g1 2008d38: c2 37 60 2c sth %g1, [ %i5 + 0x2c ] ); } #endif return the_object; } 2008d3c: 81 c7 e0 08 ret 2008d40: 81 e8 00 00 restore =============================================================================== 020090b8 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 20090b8: 9d e3 bf a0 save %sp, -96, %sp Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 20090bc: 80 a6 60 00 cmp %i1, 0 20090c0: 02 80 00 17 be 200911c <_Objects_Get_information+0x64> 20090c4: ba 10 20 00 clr %i5 /* * This call implicitly validates the_api so we do not call * _Objects_Is_api_valid above here. */ the_class_api_maximum = _Objects_API_maximum_class( the_api ); 20090c8: 40 00 10 74 call 200d298 <_Objects_API_maximum_class> 20090cc: 90 10 00 18 mov %i0, %o0 if ( the_class_api_maximum == 0 ) 20090d0: 80 a2 20 00 cmp %o0, 0 20090d4: 02 80 00 12 be 200911c <_Objects_Get_information+0x64> 20090d8: 80 a6 40 08 cmp %i1, %o0 return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 20090dc: 18 80 00 10 bgu 200911c <_Objects_Get_information+0x64> 20090e0: 03 00 80 71 sethi %hi(0x201c400), %g1 return NULL; if ( !_Objects_Information_table[ the_api ] ) 20090e4: b1 2e 20 02 sll %i0, 2, %i0 20090e8: 82 10 62 18 or %g1, 0x218, %g1 20090ec: c2 00 40 18 ld [ %g1 + %i0 ], %g1 20090f0: 80 a0 60 00 cmp %g1, 0 20090f4: 02 80 00 0a be 200911c <_Objects_Get_information+0x64> <== NEVER TAKEN 20090f8: b3 2e 60 02 sll %i1, 2, %i1 return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 20090fc: fa 00 40 19 ld [ %g1 + %i1 ], %i5 if ( !info ) 2009100: 80 a7 60 00 cmp %i5, 0 2009104: 02 80 00 06 be 200911c <_Objects_Get_information+0x64> <== NEVER TAKEN 2009108: 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 ) 200910c: c2 17 60 10 lduh [ %i5 + 0x10 ], %g1 return NULL; 2009110: 80 a0 00 01 cmp %g0, %g1 2009114: 82 60 20 00 subx %g0, 0, %g1 2009118: ba 0f 40 01 and %i5, %g1, %i5 #endif return info; } 200911c: 81 c7 e0 08 ret 2009120: 91 e8 00 1d restore %g0, %i5, %o0 =============================================================================== 0200d134 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 200d134: 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; 200d138: 92 96 20 00 orcc %i0, 0, %o1 200d13c: 12 80 00 06 bne 200d154 <_Objects_Id_to_name+0x20> 200d140: 83 32 60 18 srl %o1, 0x18, %g1 200d144: 03 00 80 b2 sethi %hi(0x202c800), %g1 200d148: c2 00 61 5c ld [ %g1 + 0x15c ], %g1 ! 202c95c <_Per_CPU_Information+0xc> 200d14c: d2 00 60 08 ld [ %g1 + 8 ], %o1 200d150: 83 32 60 18 srl %o1, 0x18, %g1 200d154: 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 ) 200d158: 84 00 7f ff add %g1, -1, %g2 200d15c: 80 a0 a0 02 cmp %g2, 2 200d160: 18 80 00 12 bgu 200d1a8 <_Objects_Id_to_name+0x74> 200d164: ba 10 20 03 mov 3, %i5 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 200d168: 10 80 00 12 b 200d1b0 <_Objects_Id_to_name+0x7c> 200d16c: 83 28 60 02 sll %g1, 2, %g1 return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 200d170: 85 28 a0 02 sll %g2, 2, %g2 200d174: d0 00 40 02 ld [ %g1 + %g2 ], %o0 if ( !information ) 200d178: 80 a2 20 00 cmp %o0, 0 200d17c: 02 80 00 0b be 200d1a8 <_Objects_Id_to_name+0x74> <== NEVER TAKEN 200d180: 01 00 00 00 nop #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 ); 200d184: 7f ff ff ce call 200d0bc <_Objects_Get> 200d188: 94 07 bf fc add %fp, -4, %o2 if ( !the_object ) 200d18c: 80 a2 20 00 cmp %o0, 0 200d190: 02 80 00 06 be 200d1a8 <_Objects_Id_to_name+0x74> 200d194: 01 00 00 00 nop return OBJECTS_INVALID_ID; *name = the_object->name; 200d198: c2 02 20 0c ld [ %o0 + 0xc ], %g1 _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 200d19c: ba 10 20 00 clr %i5 the_object = _Objects_Get( information, tmpId, &ignored_location ); if ( !the_object ) return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); 200d1a0: 40 00 03 c0 call 200e0a0 <_Thread_Enable_dispatch> 200d1a4: c2 26 40 00 st %g1, [ %i1 ] return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 200d1a8: 81 c7 e0 08 ret 200d1ac: 91 e8 00 1d restore %g0, %i5, %o0 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 200d1b0: 05 00 80 b1 sethi %hi(0x202c400), %g2 200d1b4: 84 10 a2 48 or %g2, 0x248, %g2 ! 202c648 <_Objects_Information_table> 200d1b8: c2 00 80 01 ld [ %g2 + %g1 ], %g1 200d1bc: 80 a0 60 00 cmp %g1, 0 200d1c0: 12 bf ff ec bne 200d170 <_Objects_Id_to_name+0x3c> 200d1c4: 85 32 60 1b srl %o1, 0x1b, %g2 200d1c8: 30 bf ff f8 b,a 200d1a8 <_Objects_Id_to_name+0x74> =============================================================================== 0200a290 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 200a290: 9d e3 bf a0 save %sp, -96, %sp RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 200a294: 80 a6 60 00 cmp %i1, 0 200a298: 02 80 00 73 be 200a464 <_RBTree_Extract_unprotected+0x1d4> 200a29c: 01 00 00 00 nop /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 200a2a0: c2 06 20 08 ld [ %i0 + 8 ], %g1 200a2a4: 80 a6 40 01 cmp %i1, %g1 200a2a8: 32 80 00 0d bne,a 200a2dc <_RBTree_Extract_unprotected+0x4c> 200a2ac: c2 06 20 0c ld [ %i0 + 0xc ], %g1 if (the_node->child[RBT_RIGHT]) 200a2b0: c2 06 60 08 ld [ %i1 + 8 ], %g1 200a2b4: 80 a0 60 00 cmp %g1, 0 200a2b8: 22 80 00 04 be,a 200a2c8 <_RBTree_Extract_unprotected+0x38> 200a2bc: c2 06 40 00 ld [ %i1 ], %g1 the_rbtree->first[RBT_LEFT] = the_node->child[RBT_RIGHT]; 200a2c0: 10 80 00 06 b 200a2d8 <_RBTree_Extract_unprotected+0x48> 200a2c4: c2 26 20 08 st %g1, [ %i0 + 8 ] else { the_rbtree->first[RBT_LEFT] = the_node->parent; if(_RBTree_Are_nodes_equal((RBTree_Node *)the_rbtree, 200a2c8: 80 a6 00 01 cmp %i0, %g1 200a2cc: 12 80 00 03 bne 200a2d8 <_RBTree_Extract_unprotected+0x48> 200a2d0: c2 26 20 08 st %g1, [ %i0 + 8 ] the_rbtree->first[RBT_LEFT])) the_rbtree->first[RBT_LEFT] = NULL; 200a2d4: c0 26 20 08 clr [ %i0 + 8 ] } } /* check if max needs to be updated: note, min can equal max (1 element) */ if (the_node == the_rbtree->first[RBT_RIGHT]) { 200a2d8: c2 06 20 0c ld [ %i0 + 0xc ], %g1 200a2dc: 80 a6 40 01 cmp %i1, %g1 200a2e0: 12 80 00 0b bne 200a30c <_RBTree_Extract_unprotected+0x7c> 200a2e4: c2 06 60 04 ld [ %i1 + 4 ], %g1 if (the_node->child[RBT_LEFT]) 200a2e8: 80 a0 60 00 cmp %g1, 0 200a2ec: 22 80 00 04 be,a 200a2fc <_RBTree_Extract_unprotected+0x6c> 200a2f0: c4 06 40 00 ld [ %i1 ], %g2 the_rbtree->first[RBT_RIGHT] = the_node->child[RBT_LEFT]; 200a2f4: 10 80 00 06 b 200a30c <_RBTree_Extract_unprotected+0x7c> 200a2f8: c2 26 20 0c st %g1, [ %i0 + 0xc ] else { the_rbtree->first[RBT_RIGHT] = the_node->parent; if(_RBTree_Are_nodes_equal((RBTree_Node *)the_rbtree, 200a2fc: 80 a6 00 02 cmp %i0, %g2 200a300: 12 80 00 03 bne 200a30c <_RBTree_Extract_unprotected+0x7c> 200a304: c4 26 20 0c st %g2, [ %i0 + 0xc ] the_rbtree->first[RBT_RIGHT])) the_rbtree->first[RBT_RIGHT] = NULL; 200a308: c0 26 20 0c clr [ %i0 + 0xc ] * 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]) { 200a30c: ba 90 60 00 orcc %g1, 0, %i5 200a310: 02 80 00 36 be 200a3e8 <_RBTree_Extract_unprotected+0x158> 200a314: f8 06 60 08 ld [ %i1 + 8 ], %i4 200a318: 80 a7 20 00 cmp %i4, 0 200a31c: 32 80 00 05 bne,a 200a330 <_RBTree_Extract_unprotected+0xa0> 200a320: c2 07 60 08 ld [ %i5 + 8 ], %g1 200a324: 10 80 00 35 b 200a3f8 <_RBTree_Extract_unprotected+0x168> 200a328: b8 10 00 01 mov %g1, %i4 target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; 200a32c: c2 07 60 08 ld [ %i5 + 8 ], %g1 200a330: 80 a0 60 00 cmp %g1, 0 200a334: 32 bf ff fe bne,a 200a32c <_RBTree_Extract_unprotected+0x9c> 200a338: 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]; 200a33c: f8 07 60 04 ld [ %i5 + 4 ], %i4 if(leaf) { 200a340: 80 a7 20 00 cmp %i4, 0 200a344: 02 80 00 05 be 200a358 <_RBTree_Extract_unprotected+0xc8> 200a348: 01 00 00 00 nop leaf->parent = target->parent; 200a34c: c2 07 40 00 ld [ %i5 ], %g1 200a350: 10 80 00 04 b 200a360 <_RBTree_Extract_unprotected+0xd0> 200a354: c2 27 00 00 st %g1, [ %i4 ] } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 200a358: 7f ff ff 55 call 200a0ac <_RBTree_Extract_validate_unprotected> 200a35c: 90 10 00 1d mov %i5, %o0 } victim_color = target->color; dir = target != target->parent->child[0]; 200a360: c4 07 40 00 ld [ %i5 ], %g2 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; 200a364: c2 07 60 0c ld [ %i5 + 0xc ], %g1 dir = target != target->parent->child[0]; 200a368: c6 00 a0 04 ld [ %g2 + 4 ], %g3 200a36c: 86 1f 40 03 xor %i5, %g3, %g3 200a370: 80 a0 00 03 cmp %g0, %g3 200a374: 86 40 20 00 addx %g0, 0, %g3 target->parent->child[dir] = leaf; 200a378: 87 28 e0 02 sll %g3, 2, %g3 200a37c: 84 00 80 03 add %g2, %g3, %g2 200a380: f8 20 a0 04 st %i4, [ %g2 + 4 ] /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 200a384: c4 06 40 00 ld [ %i1 ], %g2 200a388: c6 00 a0 04 ld [ %g2 + 4 ], %g3 200a38c: 86 1e 40 03 xor %i1, %g3, %g3 200a390: 80 a0 00 03 cmp %g0, %g3 200a394: 86 40 20 00 addx %g0, 0, %g3 the_node->parent->child[dir] = target; 200a398: 87 28 e0 02 sll %g3, 2, %g3 200a39c: 84 00 80 03 add %g2, %g3, %g2 200a3a0: fa 20 a0 04 st %i5, [ %g2 + 4 ] /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; 200a3a4: c4 06 60 08 ld [ %i1 + 8 ], %g2 200a3a8: c4 27 60 08 st %g2, [ %i5 + 8 ] if (the_node->child[RBT_RIGHT]) 200a3ac: c4 06 60 08 ld [ %i1 + 8 ], %g2 200a3b0: 80 a0 a0 00 cmp %g2, 0 200a3b4: 32 80 00 02 bne,a 200a3bc <_RBTree_Extract_unprotected+0x12c><== ALWAYS TAKEN 200a3b8: fa 20 80 00 st %i5, [ %g2 ] the_node->child[RBT_RIGHT]->parent = target; target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 200a3bc: c4 06 60 04 ld [ %i1 + 4 ], %g2 200a3c0: c4 27 60 04 st %g2, [ %i5 + 4 ] if (the_node->child[RBT_LEFT]) 200a3c4: c4 06 60 04 ld [ %i1 + 4 ], %g2 200a3c8: 80 a0 a0 00 cmp %g2, 0 200a3cc: 32 80 00 02 bne,a 200a3d4 <_RBTree_Extract_unprotected+0x144> 200a3d0: fa 20 80 00 st %i5, [ %g2 ] /* 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; 200a3d4: c4 06 40 00 ld [ %i1 ], %g2 200a3d8: c4 27 40 00 st %g2, [ %i5 ] target->color = the_node->color; 200a3dc: c4 06 60 0c ld [ %i1 + 0xc ], %g2 200a3e0: 10 80 00 14 b 200a430 <_RBTree_Extract_unprotected+0x1a0> 200a3e4: c4 27 60 0c st %g2, [ %i5 + 0xc ] * violated. We will fix it later. * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { 200a3e8: 80 a7 20 00 cmp %i4, 0 200a3ec: 32 80 00 04 bne,a 200a3fc <_RBTree_Extract_unprotected+0x16c> 200a3f0: c2 06 40 00 ld [ %i1 ], %g1 200a3f4: 30 80 00 04 b,a 200a404 <_RBTree_Extract_unprotected+0x174> leaf->parent = the_node->parent; 200a3f8: c2 06 40 00 ld [ %i1 ], %g1 200a3fc: 10 80 00 04 b 200a40c <_RBTree_Extract_unprotected+0x17c> 200a400: c2 27 00 00 st %g1, [ %i4 ] } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 200a404: 7f ff ff 2a call 200a0ac <_RBTree_Extract_validate_unprotected> 200a408: 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]; 200a40c: c4 06 40 00 ld [ %i1 ], %g2 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; 200a410: c2 06 60 0c ld [ %i1 + 0xc ], %g1 /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 200a414: c6 00 a0 04 ld [ %g2 + 4 ], %g3 200a418: 86 1e 40 03 xor %i1, %g3, %g3 200a41c: 80 a0 00 03 cmp %g0, %g3 200a420: 86 40 20 00 addx %g0, 0, %g3 the_node->parent->child[dir] = leaf; 200a424: 87 28 e0 02 sll %g3, 2, %g3 200a428: 84 00 80 03 add %g2, %g3, %g2 200a42c: f8 20 a0 04 st %i4, [ %g2 + 4 ] /* 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 */ 200a430: 80 a0 60 00 cmp %g1, 0 200a434: 32 80 00 06 bne,a 200a44c <_RBTree_Extract_unprotected+0x1bc> 200a438: c2 06 20 04 ld [ %i0 + 4 ], %g1 if (leaf) { 200a43c: 80 a7 20 00 cmp %i4, 0 200a440: 32 80 00 02 bne,a 200a448 <_RBTree_Extract_unprotected+0x1b8> 200a444: 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; 200a448: 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; 200a44c: c0 26 60 08 clr [ %i1 + 8 ] 200a450: c0 26 60 04 clr [ %i1 + 4 ] 200a454: 80 a0 60 00 cmp %g1, 0 200a458: 02 80 00 03 be 200a464 <_RBTree_Extract_unprotected+0x1d4> 200a45c: c0 26 40 00 clr [ %i1 ] 200a460: c0 20 60 0c clr [ %g1 + 0xc ] 200a464: 81 c7 e0 08 ret 200a468: 81 e8 00 00 restore =============================================================================== 0200a0ac <_RBTree_Extract_validate_unprotected>: * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( RBTree_Node *the_node ) { 200a0ac: 9d e3 bf a0 save %sp, -96, %sp RBTree_Node *parent, *sibling; RBTree_Direction dir; parent = the_node->parent; 200a0b0: fa 06 00 00 ld [ %i0 ], %i5 if(!parent->parent) return; 200a0b4: c2 07 40 00 ld [ %i5 ], %g1 200a0b8: 80 a0 60 00 cmp %g1, 0 200a0bc: 02 80 00 6c be 200a26c <_RBTree_Extract_validate_unprotected+0x1c0> 200a0c0: 90 10 00 18 mov %i0, %o0 sibling = _RBTree_Sibling(the_node); 200a0c4: 7f ff ff ca call 2009fec <_RBTree_Sibling> 200a0c8: b6 10 20 01 mov 1, %i3 /* continue to correct tree as long as the_node is black and not the root */ while (!_RBTree_Is_red(the_node) && parent->parent) { 200a0cc: 10 80 00 5b b 200a238 <_RBTree_Extract_validate_unprotected+0x18c> 200a0d0: c2 06 20 0c ld [ %i0 + 0xc ], %g1 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 200a0d4: 22 80 00 14 be,a 200a124 <_RBTree_Extract_validate_unprotected+0x78><== NEVER TAKEN 200a0d8: c4 02 20 08 ld [ %o0 + 8 ], %g2 <== NOT EXECUTED 200a0dc: c2 02 20 0c ld [ %o0 + 0xc ], %g1 200a0e0: 80 a0 60 01 cmp %g1, 1 200a0e4: 32 80 00 10 bne,a 200a124 <_RBTree_Extract_validate_unprotected+0x78> 200a0e8: c4 02 20 08 ld [ %o0 + 8 ], %g2 * 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; 200a0ec: c2 27 60 0c st %g1, [ %i5 + 0xc ] sibling->color = RBT_BLACK; dir = the_node != parent->child[0]; 200a0f0: c2 07 60 04 ld [ %i5 + 4 ], %g1 * Now the_node has a black sibling and red parent. After rotation, * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; sibling->color = RBT_BLACK; 200a0f4: c0 22 20 0c clr [ %o0 + 0xc ] dir = the_node != parent->child[0]; 200a0f8: 82 1e 00 01 xor %i0, %g1, %g1 200a0fc: 80 a0 00 01 cmp %g0, %g1 _RBTree_Rotate(parent, dir); 200a100: 90 10 00 1d mov %i5, %o0 * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; sibling->color = RBT_BLACK; dir = the_node != parent->child[0]; 200a104: b8 40 20 00 addx %g0, 0, %i4 _RBTree_Rotate(parent, dir); 200a108: 7f ff ff ca call 200a030 <_RBTree_Rotate> 200a10c: 92 10 00 1c mov %i4, %o1 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 200a110: b8 1f 20 01 xor %i4, 1, %i4 sibling = parent->child[_RBTree_Opposite_direction(dir)]; 200a114: b9 2f 20 02 sll %i4, 2, %i4 200a118: b8 07 40 1c add %i5, %i4, %i4 200a11c: d0 07 20 04 ld [ %i4 + 4 ], %o0 } /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && 200a120: c4 02 20 08 ld [ %o0 + 8 ], %g2 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 200a124: 80 a0 a0 00 cmp %g2, 0 200a128: 02 80 00 06 be 200a140 <_RBTree_Extract_validate_unprotected+0x94> 200a12c: 82 10 20 00 clr %g1 * This function maintains the properties of the red-black tree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( 200a130: c2 00 a0 0c ld [ %g2 + 0xc ], %g1 200a134: 82 18 60 01 xor %g1, 1, %g1 200a138: 80 a0 00 01 cmp %g0, %g1 200a13c: 82 60 3f ff subx %g0, -1, %g1 _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]) && 200a140: 80 a0 60 00 cmp %g1, 0 200a144: 32 80 00 14 bne,a 200a194 <_RBTree_Extract_validate_unprotected+0xe8> 200a148: c2 07 60 04 ld [ %i5 + 4 ], %g1 !_RBTree_Is_red(sibling->child[RBT_LEFT])) { 200a14c: c4 02 20 04 ld [ %o0 + 4 ], %g2 200a150: 80 a0 a0 00 cmp %g2, 0 200a154: 02 80 00 07 be 200a170 <_RBTree_Extract_validate_unprotected+0xc4> 200a158: 80 a0 60 00 cmp %g1, 0 * This function maintains the properties of the red-black tree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( 200a15c: c2 00 a0 0c ld [ %g2 + 0xc ], %g1 200a160: 82 18 60 01 xor %g1, 1, %g1 200a164: 80 a0 00 01 cmp %g0, %g1 200a168: 82 60 3f ff subx %g0, -1, %g1 _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]) && 200a16c: 80 a0 60 00 cmp %g1, 0 200a170: 32 80 00 09 bne,a 200a194 <_RBTree_Extract_validate_unprotected+0xe8> 200a174: c2 07 60 04 ld [ %i5 + 4 ], %g1 !_RBTree_Is_red(sibling->child[RBT_LEFT])) { sibling->color = RBT_RED; 200a178: f6 22 20 0c st %i3, [ %o0 + 0xc ] 200a17c: c2 07 60 0c ld [ %i5 + 0xc ], %g1 200a180: 80 a0 60 01 cmp %g1, 1 200a184: 32 80 00 3c bne,a 200a274 <_RBTree_Extract_validate_unprotected+0x1c8> 200a188: f4 07 40 00 ld [ %i5 ], %i2 if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; break; 200a18c: 10 80 00 32 b 200a254 <_RBTree_Extract_validate_unprotected+0x1a8> 200a190: c0 27 60 0c clr [ %i5 + 0xc ] * 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]; 200a194: 82 1e 00 01 xor %i0, %g1, %g1 200a198: 80 a0 00 01 cmp %g0, %g1 200a19c: b6 40 20 00 addx %g0, 0, %i3 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 200a1a0: b8 1e e0 01 xor %i3, 1, %i4 if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { 200a1a4: 83 2f 20 02 sll %i4, 2, %g1 200a1a8: 82 02 00 01 add %o0, %g1, %g1 200a1ac: c4 00 60 04 ld [ %g1 + 4 ], %g2 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 200a1b0: 80 a0 a0 00 cmp %g2, 0 200a1b4: 02 80 00 06 be 200a1cc <_RBTree_Extract_validate_unprotected+0x120> 200a1b8: 82 10 20 00 clr %g1 * This function maintains the properties of the red-black tree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( 200a1bc: c2 00 a0 0c ld [ %g2 + 0xc ], %g1 200a1c0: 82 18 60 01 xor %g1, 1, %g1 200a1c4: 80 a0 00 01 cmp %g0, %g1 200a1c8: 82 60 3f ff subx %g0, -1, %g1 * 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]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { 200a1cc: 80 a0 60 00 cmp %g1, 0 200a1d0: 32 80 00 0e bne,a 200a208 <_RBTree_Extract_validate_unprotected+0x15c> 200a1d4: c2 07 60 0c ld [ %i5 + 0xc ], %g1 sibling->color = RBT_RED; 200a1d8: 82 10 20 01 mov 1, %g1 200a1dc: c2 22 20 0c st %g1, [ %o0 + 0xc ] sibling->child[dir]->color = RBT_BLACK; 200a1e0: 83 2e e0 02 sll %i3, 2, %g1 200a1e4: 82 02 00 01 add %o0, %g1, %g1 200a1e8: c2 00 60 04 ld [ %g1 + 4 ], %g1 _RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir)); 200a1ec: 92 10 00 1c mov %i4, %o1 200a1f0: 7f ff ff 90 call 200a030 <_RBTree_Rotate> 200a1f4: c0 20 60 0c clr [ %g1 + 0xc ] sibling = parent->child[_RBTree_Opposite_direction(dir)]; 200a1f8: 83 2f 20 02 sll %i4, 2, %g1 200a1fc: 82 07 40 01 add %i5, %g1, %g1 200a200: d0 00 60 04 ld [ %g1 + 4 ], %o0 } sibling->color = parent->color; 200a204: c2 07 60 0c ld [ %i5 + 0xc ], %g1 parent->color = RBT_BLACK; sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; 200a208: b9 2f 20 02 sll %i4, 2, %i4 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; 200a20c: c2 22 20 0c st %g1, [ %o0 + 0xc ] parent->color = RBT_BLACK; sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; 200a210: 90 02 00 1c add %o0, %i4, %o0 200a214: c2 02 20 04 ld [ %o0 + 4 ], %g1 sibling->child[dir]->color = RBT_BLACK; _RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir)); sibling = parent->child[_RBTree_Opposite_direction(dir)]; } sibling->color = parent->color; parent->color = RBT_BLACK; 200a218: c0 27 60 0c clr [ %i5 + 0xc ] sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; 200a21c: c0 20 60 0c clr [ %g1 + 0xc ] _RBTree_Rotate(parent, dir); 200a220: 90 10 00 1d mov %i5, %o0 200a224: 7f ff ff 83 call 200a030 <_RBTree_Rotate> 200a228: 92 10 00 1b mov %i3, %o1 break; /* done */ 200a22c: 10 80 00 0b b 200a258 <_RBTree_Extract_validate_unprotected+0x1ac> 200a230: c2 06 00 00 ld [ %i0 ], %g1 if(!parent->parent) return; sibling = _RBTree_Sibling(the_node); /* continue to correct tree as long as the_node is black and not the root */ while (!_RBTree_Is_red(the_node) && parent->parent) { 200a234: c2 06 20 0c ld [ %i0 + 0xc ], %g1 200a238: 80 a0 60 01 cmp %g1, 1 200a23c: 22 80 00 07 be,a 200a258 <_RBTree_Extract_validate_unprotected+0x1ac> 200a240: c2 06 00 00 ld [ %i0 ], %g1 200a244: c2 07 40 00 ld [ %i5 ], %g1 200a248: 80 a0 60 00 cmp %g1, 0 200a24c: 12 bf ff a2 bne 200a0d4 <_RBTree_Extract_validate_unprotected+0x28> 200a250: 80 a2 20 00 cmp %o0, 0 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; 200a254: c2 06 00 00 ld [ %i0 ], %g1 200a258: c2 00 40 00 ld [ %g1 ], %g1 200a25c: 80 a0 60 00 cmp %g1, 0 200a260: 12 80 00 0a bne 200a288 <_RBTree_Extract_validate_unprotected+0x1dc> 200a264: 01 00 00 00 nop 200a268: c0 26 20 0c clr [ %i0 + 0xc ] 200a26c: 81 c7 e0 08 ret 200a270: 81 e8 00 00 restore parent->color = RBT_BLACK; break; } the_node = parent; /* done if parent is red */ parent = the_node->parent; sibling = _RBTree_Sibling(the_node); 200a274: 90 10 00 1d mov %i5, %o0 200a278: 7f ff ff 5d call 2009fec <_RBTree_Sibling> 200a27c: b0 10 00 1d mov %i5, %i0 200a280: 10 bf ff ed b 200a234 <_RBTree_Extract_validate_unprotected+0x188> 200a284: ba 10 00 1a mov %i2, %i5 200a288: 81 c7 e0 08 ret 200a28c: 81 e8 00 00 restore =============================================================================== 0200b44c <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 200b44c: 9d e3 bf a0 save %sp, -96, %sp size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 200b450: 80 a6 20 00 cmp %i0, 0 200b454: 02 80 00 10 be 200b494 <_RBTree_Initialize+0x48> <== NEVER TAKEN 200b458: 01 00 00 00 nop RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 200b45c: c0 26 00 00 clr [ %i0 ] the_rbtree->root = NULL; 200b460: c0 26 20 04 clr [ %i0 + 4 ] the_rbtree->first[0] = NULL; 200b464: c0 26 20 08 clr [ %i0 + 8 ] the_rbtree->first[1] = NULL; 200b468: c0 26 20 0c clr [ %i0 + 0xc ] the_rbtree->compare_function = compare_function; 200b46c: 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-- ) { 200b470: 10 80 00 06 b 200b488 <_RBTree_Initialize+0x3c> 200b474: fa 2e 20 14 stb %i5, [ %i0 + 0x14 ] _RBTree_Insert(the_rbtree, next); 200b478: 90 10 00 18 mov %i0, %o0 200b47c: 7f ff ff ba call 200b364 <_RBTree_Insert> 200b480: b4 06 80 1c add %i2, %i4, %i2 * node_size - size of node in bytes * * Output parameters: NONE */ void _RBTree_Initialize( 200b484: b6 06 ff ff add %i3, -1, %i3 /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 200b488: 80 a6 e0 00 cmp %i3, 0 200b48c: 12 bf ff fb bne 200b478 <_RBTree_Initialize+0x2c> 200b490: 92 10 00 1a mov %i2, %o1 200b494: 81 c7 e0 08 ret 200b498: 81 e8 00 00 restore =============================================================================== 0200a50c <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 200a50c: 9d e3 bf a0 save %sp, -96, %sp 200a510: ba 10 00 18 mov %i0, %i5 if(!the_node) return (RBTree_Node*)-1; 200a514: 80 a6 60 00 cmp %i1, 0 200a518: 02 80 00 0d be 200a54c <_RBTree_Insert_unprotected+0x40> 200a51c: b0 10 3f ff mov -1, %i0 RBTree_Node *iter_node = the_rbtree->root; 200a520: f0 07 60 04 ld [ %i5 + 4 ], %i0 int compare_result; if (!iter_node) { /* special case: first node inserted */ 200a524: b8 96 20 00 orcc %i0, 0, %i4 200a528: 32 80 00 22 bne,a 200a5b0 <_RBTree_Insert_unprotected+0xa4> 200a52c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 the_node->color = RBT_BLACK; 200a530: c0 26 60 0c clr [ %i1 + 0xc ] the_rbtree->root = the_node; 200a534: f2 27 60 04 st %i1, [ %i5 + 4 ] the_rbtree->first[0] = the_rbtree->first[1] = the_node; 200a538: f2 27 60 0c st %i1, [ %i5 + 0xc ] 200a53c: f2 27 60 08 st %i1, [ %i5 + 8 ] the_node->parent = (RBTree_Node *) the_rbtree; 200a540: fa 26 40 00 st %i5, [ %i1 ] the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 200a544: c0 26 60 08 clr [ %i1 + 8 ] 200a548: c0 26 60 04 clr [ %i1 + 4 ] 200a54c: 81 c7 e0 08 ret 200a550: 81 e8 00 00 restore } 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 ) ) 200a554: 02 bf ff fe be 200a54c <_RBTree_Insert_unprotected+0x40> 200a558: 82 38 00 08 xnor %g0, %o0, %g1 return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 200a55c: 83 30 60 1f srl %g1, 0x1f, %g1 if (!iter_node->child[dir]) { 200a560: 85 28 60 02 sll %g1, 2, %g2 200a564: 84 06 00 02 add %i0, %g2, %g2 200a568: f0 00 a0 04 ld [ %g2 + 4 ], %i0 200a56c: 80 a6 20 00 cmp %i0, 0 200a570: 32 80 00 0f bne,a 200a5ac <_RBTree_Insert_unprotected+0xa0> 200a574: b8 10 00 18 mov %i0, %i4 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 200a578: c0 26 60 08 clr [ %i1 + 8 ] 200a57c: c0 26 60 04 clr [ %i1 + 4 ] the_node->color = RBT_RED; iter_node->child[dir] = the_node; 200a580: f2 20 a0 04 st %i1, [ %g2 + 4 ] RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 200a584: 82 00 60 02 add %g1, 2, %g1 200a588: 83 28 60 02 sll %g1, 2, %g1 the_node->parent = iter_node; /* update min/max */ if (_RBTree_Is_first(the_rbtree, iter_node, dir)) { 200a58c: c4 07 40 01 ld [ %i5 + %g1 ], %g2 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; 200a590: 86 10 20 01 mov 1, %g3 iter_node->child[dir] = the_node; the_node->parent = iter_node; 200a594: f8 26 40 00 st %i4, [ %i1 ] /* update min/max */ if (_RBTree_Is_first(the_rbtree, iter_node, dir)) { 200a598: 80 a7 00 02 cmp %i4, %g2 200a59c: 12 80 00 2d bne 200a650 <_RBTree_Insert_unprotected+0x144> 200a5a0: c6 26 60 0c st %g3, [ %i1 + 0xc ] the_rbtree->first[dir] = the_node; 200a5a4: 10 80 00 2b b 200a650 <_RBTree_Insert_unprotected+0x144> 200a5a8: f2 27 40 01 st %i1, [ %i5 + %g1 ] the_node->parent = (RBTree_Node *) the_rbtree; the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); 200a5ac: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 200a5b0: 90 10 00 19 mov %i1, %o0 200a5b4: 9f c0 40 00 call %g1 200a5b8: 92 10 00 18 mov %i0, %o1 if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 200a5bc: c2 0f 60 14 ldub [ %i5 + 0x14 ], %g1 200a5c0: 80 a0 60 00 cmp %g1, 0 200a5c4: 12 bf ff e4 bne 200a554 <_RBTree_Insert_unprotected+0x48> 200a5c8: 80 a2 20 00 cmp %o0, 0 return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 200a5cc: 10 bf ff e4 b 200a55c <_RBTree_Insert_unprotected+0x50> 200a5d0: 82 38 00 08 xnor %g0, %o0, %g1 ) { 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; 200a5d4: 80 a0 60 00 cmp %g1, 0 200a5d8: 02 80 00 2c be 200a688 <_RBTree_Insert_unprotected+0x17c> <== NEVER TAKEN 200a5dc: c2 07 60 04 ld [ %i5 + 4 ], %g1 { 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]) 200a5e0: 80 a2 00 01 cmp %o0, %g1 200a5e4: 22 80 00 02 be,a 200a5ec <_RBTree_Insert_unprotected+0xe0> 200a5e8: c2 07 60 08 ld [ %i5 + 8 ], %g1 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 200a5ec: 80 a0 60 00 cmp %g1, 0 200a5f0: 22 80 00 26 be,a 200a688 <_RBTree_Insert_unprotected+0x17c> 200a5f4: c2 07 60 04 ld [ %i5 + 4 ], %g1 200a5f8: c4 00 60 0c ld [ %g1 + 0xc ], %g2 200a5fc: 80 a0 a0 01 cmp %g2, 1 200a600: 32 80 00 22 bne,a 200a688 <_RBTree_Insert_unprotected+0x17c> 200a604: c2 07 60 04 ld [ %i5 + 4 ], %g1 u = _RBTree_Parent_sibling(the_node); 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; 200a608: c0 22 20 0c clr [ %o0 + 0xc ] u->color = RBT_BLACK; 200a60c: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 200a610: c4 27 60 0c st %g2, [ %i5 + 0xc ] 200a614: 10 80 00 10 b 200a654 <_RBTree_Insert_unprotected+0x148> 200a618: b2 10 00 1d mov %i5, %i1 RBTree_Direction dir = the_node != the_node->parent->child[0]; RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { _RBTree_Rotate(the_node->parent, pdir); 200a61c: 7f ff ff 9d call 200a490 <_RBTree_Rotate> 200a620: 92 10 00 1c mov %i4, %o1 the_node = the_node->child[pdir]; 200a624: 83 2f 20 02 sll %i4, 2, %g1 200a628: b2 06 40 01 add %i1, %g1, %i1 200a62c: f2 06 60 04 ld [ %i1 + 4 ], %i1 } the_node->parent->color = RBT_BLACK; 200a630: c2 06 40 00 ld [ %i1 ], %g1 g->color = RBT_RED; /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 200a634: 90 10 00 1d mov %i5, %o0 /* ensure node is on the same branch direction as parent */ if (dir != pdir) { _RBTree_Rotate(the_node->parent, pdir); the_node = the_node->child[pdir]; } the_node->parent->color = RBT_BLACK; 200a638: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 200a63c: f6 27 60 0c st %i3, [ %i5 + 0xc ] /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 200a640: 7f ff ff 94 call 200a490 <_RBTree_Rotate> 200a644: 92 26 c0 1c sub %i3, %i4, %o1 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 200a648: 10 80 00 04 b 200a658 <_RBTree_Insert_unprotected+0x14c> 200a64c: d0 06 40 00 ld [ %i1 ], %o0 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; 200a650: b6 10 20 01 mov 1, %i3 200a654: d0 06 40 00 ld [ %i1 ], %o0 200a658: fa 02 00 00 ld [ %o0 ], %i5 200a65c: 80 a7 60 00 cmp %i5, 0 200a660: 22 bf ff bb be,a 200a54c <_RBTree_Insert_unprotected+0x40> 200a664: 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); 200a668: c2 02 20 0c ld [ %o0 + 0xc ], %g1 200a66c: 80 a0 60 01 cmp %g1, 1 200a670: 12 80 00 04 bne 200a680 <_RBTree_Insert_unprotected+0x174> 200a674: 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->parent->parent->parent)) return NULL; 200a678: 10 bf ff d7 b 200a5d4 <_RBTree_Insert_unprotected+0xc8> 200a67c: c2 07 40 00 ld [ %i5 ], %g1 /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 200a680: 81 c7 e0 08 ret 200a684: 81 e8 00 00 restore 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]; RBTree_Direction pdir = the_node->parent != g->child[0]; 200a688: 82 1a 00 01 xor %o0, %g1, %g1 200a68c: 80 a0 00 01 cmp %g0, %g1 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]; 200a690: c2 02 20 04 ld [ %o0 + 4 ], %g1 RBTree_Direction pdir = the_node->parent != g->child[0]; 200a694: b8 40 20 00 addx %g0, 0, %i4 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]; 200a698: 82 1e 40 01 xor %i1, %g1, %g1 200a69c: 80 a0 00 01 cmp %g0, %g1 200a6a0: 82 40 20 00 addx %g0, 0, %g1 RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { 200a6a4: 80 a0 40 1c cmp %g1, %i4 200a6a8: 12 bf ff dd bne 200a61c <_RBTree_Insert_unprotected+0x110> 200a6ac: 01 00 00 00 nop _RBTree_Rotate(the_node->parent, pdir); the_node = the_node->child[pdir]; } the_node->parent->color = RBT_BLACK; 200a6b0: 10 bf ff e1 b 200a634 <_RBTree_Insert_unprotected+0x128> 200a6b4: c2 06 40 00 ld [ %i1 ], %g1 =============================================================================== 0200a6cc <_RBTree_Iterate_unprotected>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 200a6cc: 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); 200a6d0: 80 a0 00 19 cmp %g0, %i1 200a6d4: 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]; 200a6d8: 82 00 60 02 add %g1, 2, %g1 200a6dc: 83 28 60 02 sll %g1, 2, %g1 200a6e0: 10 80 00 0d b 200a714 <_RBTree_Iterate_unprotected+0x48> 200a6e4: 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 ) { stop = (*visitor)( current, dir, visitor_arg ); 200a6e8: 92 10 00 19 mov %i1, %o1 200a6ec: 9f c6 80 00 call %i2 200a6f0: 94 10 00 1b mov %i3, %o2 current = _RBTree_Next_unprotected( rbtree, current, dir ); 200a6f4: 92 10 00 1d mov %i5, %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 ); 200a6f8: b8 10 00 08 mov %o0, %i4 current = _RBTree_Next_unprotected( rbtree, current, dir ); 200a6fc: 94 10 00 19 mov %i1, %o2 200a700: 40 00 00 0a call 200a728 <_RBTree_Next_unprotected> 200a704: 90 10 00 18 mov %i0, %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 ) { 200a708: 80 8f 20 ff btst 0xff, %i4 200a70c: 12 80 00 05 bne 200a720 <_RBTree_Iterate_unprotected+0x54><== NEVER TAKEN 200a710: ba 10 00 08 mov %o0, %i5 200a714: 80 a7 60 00 cmp %i5, 0 200a718: 12 bf ff f4 bne 200a6e8 <_RBTree_Iterate_unprotected+0x1c> 200a71c: 90 10 00 1d mov %i5, %o0 200a720: 81 c7 e0 08 ret 200a724: 81 e8 00 00 restore =============================================================================== 02009fec <_RBTree_Sibling>: */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; 2009fec: 80 a2 20 00 cmp %o0, 0 2009ff0: 02 80 00 0e be 200a028 <_RBTree_Sibling+0x3c> 2009ff4: 82 10 20 00 clr %g1 if(!(the_node->parent)) return NULL; 2009ff8: c4 02 00 00 ld [ %o0 ], %g2 2009ffc: 80 a0 a0 00 cmp %g2, 0 200a000: 02 80 00 0a be 200a028 <_RBTree_Sibling+0x3c> <== NEVER TAKEN 200a004: 01 00 00 00 nop if(!(the_node->parent->parent)) return NULL; 200a008: c6 00 80 00 ld [ %g2 ], %g3 200a00c: 80 a0 e0 00 cmp %g3, 0 200a010: 02 80 00 06 be 200a028 <_RBTree_Sibling+0x3c> 200a014: 01 00 00 00 nop if(the_node == the_node->parent->child[RBT_LEFT]) 200a018: c2 00 a0 04 ld [ %g2 + 4 ], %g1 200a01c: 80 a2 00 01 cmp %o0, %g1 200a020: 22 80 00 02 be,a 200a028 <_RBTree_Sibling+0x3c> 200a024: c2 00 a0 08 ld [ %g2 + 8 ], %g1 return the_node->parent->child[RBT_RIGHT]; else return the_node->parent->child[RBT_LEFT]; } 200a028: 81 c3 e0 08 retl 200a02c: 90 10 00 01 mov %g1, %o0 =============================================================================== 0200c9dc <_RTEMS_tasks_Post_switch_extension>: */ static void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 200c9dc: 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 ]; 200c9e0: fa 06 21 50 ld [ %i0 + 0x150 ], %i5 if ( !api ) 200c9e4: 80 a7 60 00 cmp %i5, 0 200c9e8: 02 80 00 1c be 200ca58 <_RTEMS_tasks_Post_switch_extension+0x7c><== NEVER TAKEN 200c9ec: 01 00 00 00 nop * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 200c9f0: 7f ff d6 ff call 20025ec 200c9f4: 01 00 00 00 nop signal_set = asr->signals_posted; 200c9f8: f6 07 60 14 ld [ %i5 + 0x14 ], %i3 asr->signals_posted = 0; 200c9fc: c0 27 60 14 clr [ %i5 + 0x14 ] _ISR_Enable( level ); 200ca00: 7f ff d6 ff call 20025fc 200ca04: 01 00 00 00 nop if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 200ca08: 80 a6 e0 00 cmp %i3, 0 200ca0c: 02 80 00 13 be 200ca58 <_RTEMS_tasks_Post_switch_extension+0x7c> 200ca10: 94 07 bf fc add %fp, -4, %o2 return; asr->nest_level += 1; 200ca14: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 200ca18: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 200ca1c: 82 00 60 01 inc %g1 200ca20: c2 27 60 1c st %g1, [ %i5 + 0x1c ] rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 200ca24: 39 00 00 3f sethi %hi(0xfc00), %i4 200ca28: 40 00 06 e9 call 200e5cc 200ca2c: 92 17 23 ff or %i4, 0x3ff, %o1 ! ffff (*asr->handler)( signal_set ); 200ca30: c2 07 60 0c ld [ %i5 + 0xc ], %g1 200ca34: 9f c0 40 00 call %g1 200ca38: 90 10 00 1b mov %i3, %o0 asr->nest_level -= 1; 200ca3c: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 200ca40: 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; 200ca44: 82 00 7f ff add %g1, -1, %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 200ca48: 92 17 23 ff or %i4, 0x3ff, %o1 asr->nest_level += 1; rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); (*asr->handler)( signal_set ); asr->nest_level -= 1; 200ca4c: c2 27 60 1c st %g1, [ %i5 + 0x1c ] rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 200ca50: 40 00 06 df call 200e5cc 200ca54: 94 07 bf fc add %fp, -4, %o2 200ca58: 81 c7 e0 08 ret 200ca5c: 81 e8 00 00 restore =============================================================================== 0203d9e4 <_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 ) { 203d9e4: 9d e3 bf 98 save %sp, -104, %sp #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 203d9e8: fa 06 20 40 ld [ %i0 + 0x40 ], %i5 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); 203d9ec: 7f ff b2 8b call 202a418 <_TOD_Get_uptime> 203d9f0: 90 07 bf f8 add %fp, -8, %o0 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 203d9f4: c4 1e 20 50 ldd [ %i0 + 0x50 ], %g2 _Timestamp_Subtract( 203d9f8: d8 1f bf f8 ldd [ %fp + -8 ], %o4 if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 203d9fc: 82 10 20 01 mov 1, %g1 203da00: 86 a3 40 03 subcc %o5, %g3, %g3 203da04: 84 63 00 02 subx %o4, %g2, %g2 203da08: c4 3e 40 00 std %g2, [ %i1 ] * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 203da0c: 05 00 81 b7 sethi %hi(0x206dc00), %g2 203da10: 84 10 a2 70 or %g2, 0x270, %g2 ! 206de70 <_Per_CPU_Information> 203da14: c6 00 a0 0c ld [ %g2 + 0xc ], %g3 203da18: 80 a7 40 03 cmp %i5, %g3 203da1c: 12 80 00 15 bne 203da70 <_Rate_monotonic_Get_status+0x8c> 203da20: d4 1f 60 80 ldd [ %i5 + 0x80 ], %o2 203da24: c4 18 a0 20 ldd [ %g2 + 0x20 ], %g2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 203da28: f0 1e 20 48 ldd [ %i0 + 0x48 ], %i0 203da2c: 86 a3 40 03 subcc %o5, %g3, %g3 203da30: 84 63 00 02 subx %o4, %g2, %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 203da34: 96 82 c0 03 addcc %o3, %g3, %o3 203da38: 94 42 80 02 addx %o2, %g2, %o2 /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 203da3c: 80 a6 00 0a cmp %i0, %o2 203da40: 34 80 00 0c bg,a 203da70 <_Rate_monotonic_Get_status+0x8c><== NEVER TAKEN 203da44: 82 10 20 00 clr %g1 <== NOT EXECUTED 203da48: 32 80 00 06 bne,a 203da60 <_Rate_monotonic_Get_status+0x7c> 203da4c: 96 a2 c0 19 subcc %o3, %i1, %o3 203da50: 80 a6 40 0b cmp %i1, %o3 203da54: 18 80 00 06 bgu 203da6c <_Rate_monotonic_Get_status+0x88> 203da58: 96 a2 c0 19 subcc %o3, %i1, %o3 if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 203da5c: 82 10 20 01 mov 1, %g1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 203da60: 94 62 80 18 subx %o2, %i0, %o2 203da64: 10 80 00 03 b 203da70 <_Rate_monotonic_Get_status+0x8c> 203da68: d4 3e 80 00 std %o2, [ %i2 ] /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) return false; 203da6c: 82 10 20 00 clr %g1 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 203da70: b0 08 60 01 and %g1, 1, %i0 203da74: 81 c7 e0 08 ret 203da78: 81 e8 00 00 restore =============================================================================== 0203dddc <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 203dddc: 9d e3 bf 98 save %sp, -104, %sp 203dde0: 11 00 81 b8 sethi %hi(0x206e000), %o0 203dde4: 92 10 00 18 mov %i0, %o1 203dde8: 90 12 21 40 or %o0, 0x140, %o0 203ddec: 7f ff 44 38 call 200eecc <_Objects_Get> 203ddf0: 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 ) { 203ddf4: c2 07 bf fc ld [ %fp + -4 ], %g1 203ddf8: 80 a0 60 00 cmp %g1, 0 203ddfc: 12 80 00 25 bne 203de90 <_Rate_monotonic_Timeout+0xb4> <== NEVER TAKEN 203de00: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: the_thread = the_period->owner; 203de04: d0 02 20 40 ld [ %o0 + 0x40 ], %o0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 203de08: 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); 203de0c: c4 02 20 10 ld [ %o0 + 0x10 ], %g2 203de10: 80 88 80 01 btst %g2, %g1 203de14: 22 80 00 0b be,a 203de40 <_Rate_monotonic_Timeout+0x64> 203de18: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 203de1c: c4 02 20 20 ld [ %o0 + 0x20 ], %g2 203de20: c2 07 60 08 ld [ %i5 + 8 ], %g1 203de24: 80 a0 80 01 cmp %g2, %g1 203de28: 32 80 00 06 bne,a 203de40 <_Rate_monotonic_Timeout+0x64> 203de2c: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 203de30: 13 04 00 ff sethi %hi(0x1003fc00), %o1 203de34: 7f ff 46 fb call 200fa20 <_Thread_Clear_state> 203de38: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1003fff8 203de3c: 30 80 00 06 b,a 203de54 <_Rate_monotonic_Timeout+0x78> _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 ) { 203de40: 80 a0 60 01 cmp %g1, 1 203de44: 12 80 00 0d bne 203de78 <_Rate_monotonic_Timeout+0x9c> 203de48: 82 10 20 04 mov 4, %g1 the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 203de4c: 82 10 20 03 mov 3, %g1 203de50: c2 27 60 38 st %g1, [ %i5 + 0x38 ] _Rate_monotonic_Initiate_statistics( the_period ); 203de54: 7f ff ff 53 call 203dba0 <_Rate_monotonic_Initiate_statistics> 203de58: 90 10 00 1d mov %i5, %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 203de5c: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 203de60: 11 00 81 b7 sethi %hi(0x206dc00), %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 203de64: c2 27 60 1c st %g1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 203de68: 90 12 21 00 or %o0, 0x100, %o0 203de6c: 7f ff 4a ff call 2010a68 <_Watchdog_Insert> 203de70: 92 07 60 10 add %i5, 0x10, %o1 203de74: 30 80 00 02 b,a 203de7c <_Rate_monotonic_Timeout+0xa0> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 203de78: c2 27 60 38 st %g1, [ %i5 + 0x38 ] * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 203de7c: 03 00 81 b7 sethi %hi(0x206dc00), %g1 203de80: c4 00 60 40 ld [ %g1 + 0x40 ], %g2 ! 206dc40 <_Thread_Dispatch_disable_level> 203de84: 84 00 bf ff add %g2, -1, %g2 203de88: c4 20 60 40 st %g2, [ %g1 + 0x40 ] return _Thread_Dispatch_disable_level; 203de8c: c2 00 60 40 ld [ %g1 + 0x40 ], %g1 203de90: 81 c7 e0 08 ret 203de94: 81 e8 00 00 restore =============================================================================== 0203da7c <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 203da7c: 9d e3 bf 90 save %sp, -112, %sp /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 203da80: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 203da84: 82 00 60 01 inc %g1 203da88: c2 26 20 58 st %g1, [ %i0 + 0x58 ] if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 203da8c: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 203da90: 80 a0 60 04 cmp %g1, 4 203da94: 12 80 00 05 bne 203daa8 <_Rate_monotonic_Update_statistics+0x2c> 203da98: 90 10 00 18 mov %i0, %o0 stats->missed_count++; 203da9c: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 203daa0: 82 00 60 01 inc %g1 203daa4: c2 26 20 5c st %g1, [ %i0 + 0x5c ] /* * Grab status for time statistics. */ valid_status = 203daa8: 92 07 bf f8 add %fp, -8, %o1 203daac: 7f ff ff ce call 203d9e4 <_Rate_monotonic_Get_status> 203dab0: 94 07 bf f0 add %fp, -16, %o2 _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 203dab4: 80 8a 20 ff btst 0xff, %o0 203dab8: 02 80 00 38 be 203db98 <_Rate_monotonic_Update_statistics+0x11c> 203dabc: c4 1f bf f0 ldd [ %fp + -16 ], %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 203dac0: d8 1e 20 70 ldd [ %i0 + 0x70 ], %o4 * 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 ) ) 203dac4: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 203dac8: 9a 83 40 03 addcc %o5, %g3, %o5 203dacc: 98 43 00 02 addx %o4, %g2, %o4 203dad0: 80 a0 40 02 cmp %g1, %g2 203dad4: 14 80 00 09 bg 203daf8 <_Rate_monotonic_Update_statistics+0x7c> 203dad8: d8 3e 20 70 std %o4, [ %i0 + 0x70 ] 203dadc: 80 a0 40 02 cmp %g1, %g2 203dae0: 32 80 00 08 bne,a 203db00 <_Rate_monotonic_Update_statistics+0x84><== NEVER TAKEN 203dae4: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 <== NOT EXECUTED 203dae8: c2 06 20 64 ld [ %i0 + 0x64 ], %g1 203daec: 80 a0 40 03 cmp %g1, %g3 203daf0: 28 80 00 04 bleu,a 203db00 <_Rate_monotonic_Update_statistics+0x84> 203daf4: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 stats->min_cpu_time = executed; 203daf8: c4 3e 20 60 std %g2, [ %i0 + 0x60 ] if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 203dafc: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 203db00: 80 a0 40 02 cmp %g1, %g2 203db04: 26 80 00 0a bl,a 203db2c <_Rate_monotonic_Update_statistics+0xb0><== NEVER TAKEN 203db08: c4 3e 20 68 std %g2, [ %i0 + 0x68 ] <== NOT EXECUTED 203db0c: 80 a0 40 02 cmp %g1, %g2 203db10: 32 80 00 08 bne,a 203db30 <_Rate_monotonic_Update_statistics+0xb4><== NEVER TAKEN 203db14: c4 1f bf f8 ldd [ %fp + -8 ], %g2 <== NOT EXECUTED 203db18: c2 06 20 6c ld [ %i0 + 0x6c ], %g1 203db1c: 80 a0 40 03 cmp %g1, %g3 203db20: 3a 80 00 04 bcc,a 203db30 <_Rate_monotonic_Update_statistics+0xb4> 203db24: c4 1f bf f8 ldd [ %fp + -8 ], %g2 stats->max_cpu_time = executed; 203db28: c4 3e 20 68 std %g2, [ %i0 + 0x68 ] /* * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); 203db2c: c4 1f bf f8 ldd [ %fp + -8 ], %g2 203db30: d8 1e 20 88 ldd [ %i0 + 0x88 ], %o4 if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 203db34: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 203db38: 9a 83 40 03 addcc %o5, %g3, %o5 203db3c: 98 43 00 02 addx %o4, %g2, %o4 203db40: 80 a0 40 02 cmp %g1, %g2 203db44: 14 80 00 09 bg 203db68 <_Rate_monotonic_Update_statistics+0xec> 203db48: d8 3e 20 88 std %o4, [ %i0 + 0x88 ] 203db4c: 80 a0 40 02 cmp %g1, %g2 203db50: 32 80 00 08 bne,a 203db70 <_Rate_monotonic_Update_statistics+0xf4><== NEVER TAKEN 203db54: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 203db58: c2 06 20 7c ld [ %i0 + 0x7c ], %g1 203db5c: 80 a0 40 03 cmp %g1, %g3 203db60: 28 80 00 04 bleu,a 203db70 <_Rate_monotonic_Update_statistics+0xf4> 203db64: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 stats->min_wall_time = since_last_period; 203db68: c4 3e 20 78 std %g2, [ %i0 + 0x78 ] if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 203db6c: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 203db70: 80 a0 40 02 cmp %g1, %g2 203db74: 26 80 00 09 bl,a 203db98 <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 203db78: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] <== NOT EXECUTED 203db7c: 80 a0 40 02 cmp %g1, %g2 203db80: 12 80 00 06 bne 203db98 <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 203db84: 01 00 00 00 nop 203db88: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 203db8c: 80 a0 40 03 cmp %g1, %g3 203db90: 2a 80 00 02 bcs,a 203db98 <_Rate_monotonic_Update_statistics+0x11c> 203db94: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] 203db98: 81 c7 e0 08 ret 203db9c: 81 e8 00 00 restore =============================================================================== 0200b448 <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 200b448: 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; 200b44c: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 200b450: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 200b454: 80 a0 40 09 cmp %g1, %o1 200b458: 32 80 00 02 bne,a 200b460 <_Scheduler_CBS_Budget_callout+0x18><== ALWAYS TAKEN 200b45c: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 200b460: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 200b464: 80 a0 40 09 cmp %g1, %o1 200b468: 02 80 00 04 be 200b478 <_Scheduler_CBS_Budget_callout+0x30><== NEVER TAKEN 200b46c: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 200b470: 40 00 01 8e call 200baa8 <_Thread_Change_priority> 200b474: 94 10 20 01 mov 1, %o2 /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; 200b478: f0 06 20 88 ld [ %i0 + 0x88 ], %i0 if ( sched_info->cbs_server->cbs_budget_overrun ) { 200b47c: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 200b480: c4 00 60 0c ld [ %g1 + 0xc ], %g2 200b484: 80 a0 a0 00 cmp %g2, 0 200b488: 02 80 00 09 be 200b4ac <_Scheduler_CBS_Budget_callout+0x64><== NEVER TAKEN 200b48c: 01 00 00 00 nop _Scheduler_CBS_Get_server_id( 200b490: d0 00 40 00 ld [ %g1 ], %o0 200b494: 7f ff ff d7 call 200b3f0 <_Scheduler_CBS_Get_server_id> 200b498: 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 ); 200b49c: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 200b4a0: c2 00 60 0c ld [ %g1 + 0xc ], %g1 200b4a4: 9f c0 40 00 call %g1 200b4a8: d0 07 bf fc ld [ %fp + -4 ], %o0 200b4ac: 81 c7 e0 08 ret 200b4b0: 81 e8 00 00 restore =============================================================================== 0200b064 <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 200b064: 9d e3 bf a0 save %sp, -96, %sp unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 200b068: c2 06 20 04 ld [ %i0 + 4 ], %g1 int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 200b06c: ba 10 00 18 mov %i0, %i5 unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 200b070: 80 a0 60 00 cmp %g1, 0 200b074: 04 80 00 1c ble 200b0e4 <_Scheduler_CBS_Create_server+0x80> 200b078: b0 10 3f ee mov -18, %i0 200b07c: c2 07 40 00 ld [ %i5 ], %g1 200b080: 80 a0 60 00 cmp %g1, 0 200b084: 04 80 00 18 ble 200b0e4 <_Scheduler_CBS_Create_server+0x80> 200b088: 03 00 80 7c sethi %hi(0x201f000), %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++ ) { 200b08c: c6 00 60 78 ld [ %g1 + 0x78 ], %g3 ! 201f078 <_Scheduler_CBS_Maximum_servers> if ( !_Scheduler_CBS_Server_list[i] ) 200b090: 03 00 80 7f sethi %hi(0x201fc00), %g1 200b094: c4 00 63 c8 ld [ %g1 + 0x3c8 ], %g2 ! 201ffc8 <_Scheduler_CBS_Server_list> 200b098: 10 80 00 15 b 200b0ec <_Scheduler_CBS_Create_server+0x88> 200b09c: 82 10 20 00 clr %g1 200b0a0: c8 00 80 1b ld [ %g2 + %i3 ], %g4 200b0a4: 80 a1 20 00 cmp %g4, 0 200b0a8: 32 80 00 11 bne,a 200b0ec <_Scheduler_CBS_Create_server+0x88> 200b0ac: 82 00 60 01 inc %g1 if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 200b0b0: 39 00 80 7f sethi %hi(0x201fc00), %i4 200b0b4: f0 07 23 c8 ld [ %i4 + 0x3c8 ], %i0 ! 201ffc8 <_Scheduler_CBS_Server_list> } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 200b0b8: c2 26 80 00 st %g1, [ %i2 ] _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 200b0bc: 40 00 07 9d call 200cf30 <_Workspace_Allocate> 200b0c0: 90 10 20 10 mov 0x10, %o0 the_server = _Scheduler_CBS_Server_list[*server_id]; 200b0c4: 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 *) 200b0c8: d0 26 00 1b st %o0, [ %i0 + %i3 ] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 200b0cc: c4 07 23 c8 ld [ %i4 + 0x3c8 ], %g2 200b0d0: 83 28 60 02 sll %g1, 2, %g1 200b0d4: c2 00 80 01 ld [ %g2 + %g1 ], %g1 if ( !the_server ) 200b0d8: 80 a0 60 00 cmp %g1, 0 200b0dc: 12 80 00 09 bne 200b100 <_Scheduler_CBS_Create_server+0x9c><== ALWAYS TAKEN 200b0e0: b0 10 3f ef mov -17, %i0 200b0e4: 81 c7 e0 08 ret 200b0e8: 81 e8 00 00 restore 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++ ) { 200b0ec: 80 a0 40 03 cmp %g1, %g3 200b0f0: 12 bf ff ec bne 200b0a0 <_Scheduler_CBS_Create_server+0x3c> 200b0f4: b7 28 60 02 sll %g1, 2, %i3 if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 200b0f8: 81 c7 e0 08 ret 200b0fc: 91 e8 3f e6 restore %g0, -26, %o0 _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; 200b100: c4 07 40 00 ld [ %i5 ], %g2 the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; 200b104: b0 10 20 00 clr %i0 _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; 200b108: c4 20 60 04 st %g2, [ %g1 + 4 ] 200b10c: c4 07 60 04 ld [ %i5 + 4 ], %g2 the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; 200b110: f2 20 60 0c st %i1, [ %g1 + 0xc ] _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; 200b114: c4 20 60 08 st %g2, [ %g1 + 8 ] the_server->task_id = -1; 200b118: 84 10 3f ff mov -1, %g2 200b11c: c4 20 40 00 st %g2, [ %g1 ] the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } 200b120: 81 c7 e0 08 ret 200b124: 81 e8 00 00 restore =============================================================================== 0200b19c <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 200b19c: 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); 200b1a0: 90 10 00 19 mov %i1, %o0 200b1a4: 40 00 03 73 call 200bf70 <_Thread_Get> 200b1a8: 92 07 bf fc add %fp, -4, %o1 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 200b1ac: ba 92 20 00 orcc %o0, 0, %i5 200b1b0: 22 80 00 05 be,a 200b1c4 <_Scheduler_CBS_Detach_thread+0x28> 200b1b4: 03 00 80 7c sethi %hi(0x201f000), %g1 _Thread_Enable_dispatch(); 200b1b8: 40 00 03 61 call 200bf3c <_Thread_Enable_dispatch> 200b1bc: 01 00 00 00 nop } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 200b1c0: 03 00 80 7c sethi %hi(0x201f000), %g1 200b1c4: c4 00 60 78 ld [ %g1 + 0x78 ], %g2 ! 201f078 <_Scheduler_CBS_Maximum_servers> 200b1c8: 80 a6 00 02 cmp %i0, %g2 200b1cc: 1a 80 00 1b bcc 200b238 <_Scheduler_CBS_Detach_thread+0x9c> 200b1d0: 82 10 3f ee mov -18, %g1 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) 200b1d4: 80 a7 60 00 cmp %i5, 0 200b1d8: 02 80 00 18 be 200b238 <_Scheduler_CBS_Detach_thread+0x9c> 200b1dc: 01 00 00 00 nop return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 200b1e0: 03 00 80 7f sethi %hi(0x201fc00), %g1 200b1e4: c2 00 63 c8 ld [ %g1 + 0x3c8 ], %g1 ! 201ffc8 <_Scheduler_CBS_Server_list> 200b1e8: b1 2e 20 02 sll %i0, 2, %i0 200b1ec: c4 00 40 18 ld [ %g1 + %i0 ], %g2 200b1f0: 80 a0 a0 00 cmp %g2, 0 200b1f4: 02 80 00 11 be 200b238 <_Scheduler_CBS_Detach_thread+0x9c> 200b1f8: 82 10 3f e7 mov -25, %g1 return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) 200b1fc: c6 00 80 00 ld [ %g2 ], %g3 200b200: 80 a0 c0 19 cmp %g3, %i1 200b204: 12 80 00 0d bne 200b238 <_Scheduler_CBS_Detach_thread+0x9c><== NEVER TAKEN 200b208: 82 10 3f ee mov -18, %g1 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; 200b20c: 82 10 3f ff mov -1, %g1 200b210: c2 20 80 00 st %g1, [ %g2 ] sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 200b214: c2 07 60 88 ld [ %i5 + 0x88 ], %g1 200b218: c0 20 60 18 clr [ %g1 + 0x18 ] the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 200b21c: c2 07 60 a0 ld [ %i5 + 0xa0 ], %g1 200b220: c2 27 60 78 st %g1, [ %i5 + 0x78 ] the_thread->budget_callout = the_thread->Start.budget_callout; 200b224: c2 07 60 a4 ld [ %i5 + 0xa4 ], %g1 200b228: c2 27 60 7c st %g1, [ %i5 + 0x7c ] the_thread->is_preemptible = the_thread->Start.is_preemptible; 200b22c: c2 0f 60 9c ldub [ %i5 + 0x9c ], %g1 200b230: c2 2f 60 70 stb %g1, [ %i5 + 0x70 ] return SCHEDULER_CBS_OK; 200b234: 82 10 20 00 clr %g1 } 200b238: 81 c7 e0 08 ret 200b23c: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 0200b4b4 <_Scheduler_CBS_Initialize>: } } int _Scheduler_CBS_Initialize(void) { 200b4b4: 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*) ); 200b4b8: 3b 00 80 7c sethi %hi(0x201f000), %i5 200b4bc: d0 07 60 78 ld [ %i5 + 0x78 ], %o0 ! 201f078 <_Scheduler_CBS_Maximum_servers> if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 200b4c0: b0 10 3f ef mov -17, %i0 } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 200b4c4: 40 00 06 9b call 200cf30 <_Workspace_Allocate> 200b4c8: 91 2a 20 02 sll %o0, 2, %o0 200b4cc: 05 00 80 7f sethi %hi(0x201fc00), %g2 _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 200b4d0: 80 a2 20 00 cmp %o0, 0 200b4d4: 02 80 00 0c be 200b504 <_Scheduler_CBS_Initialize+0x50> <== NEVER TAKEN 200b4d8: d0 20 a3 c8 st %o0, [ %g2 + 0x3c8 ] return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 200b4dc: c6 07 60 78 ld [ %i5 + 0x78 ], %g3 200b4e0: 10 80 00 05 b 200b4f4 <_Scheduler_CBS_Initialize+0x40> 200b4e4: 82 10 20 00 clr %g1 _Scheduler_CBS_Server_list[i] = NULL; 200b4e8: 89 28 60 02 sll %g1, 2, %g4 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++) { 200b4ec: 82 00 60 01 inc %g1 _Scheduler_CBS_Server_list[i] = NULL; 200b4f0: c0 27 40 04 clr [ %i5 + %g4 ] 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++) { 200b4f4: 80 a0 40 03 cmp %g1, %g3 200b4f8: 12 bf ff fc bne 200b4e8 <_Scheduler_CBS_Initialize+0x34> 200b4fc: fa 00 a3 c8 ld [ %g2 + 0x3c8 ], %i5 _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 200b500: b0 10 20 00 clr %i0 } 200b504: 81 c7 e0 08 ret 200b508: 81 e8 00 00 restore =============================================================================== 0200a0b0 <_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; 200a0b0: c2 02 20 88 ld [ %o0 + 0x88 ], %g1 if (deadline) { 200a0b4: 80 a2 60 00 cmp %o1, 0 200a0b8: 02 80 00 10 be 200a0f8 <_Scheduler_CBS_Release_job+0x48> 200a0bc: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 /* Initializing or shifting deadline. */ if (serv_info) 200a0c0: 80 a0 60 00 cmp %g1, 0 200a0c4: 02 80 00 08 be 200a0e4 <_Scheduler_CBS_Release_job+0x34> 200a0c8: 05 00 80 78 sethi %hi(0x201e000), %g2 new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 200a0cc: d2 00 a2 e0 ld [ %g2 + 0x2e0 ], %o1 ! 201e2e0 <_Watchdog_Ticks_since_boot> 200a0d0: c4 00 60 04 ld [ %g1 + 4 ], %g2 200a0d4: 92 02 40 02 add %o1, %g2, %o1 200a0d8: 05 20 00 00 sethi %hi(0x80000000), %g2 200a0dc: 10 80 00 0a b 200a104 <_Scheduler_CBS_Release_job+0x54> 200a0e0: 92 2a 40 02 andn %o1, %g2, %o1 & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 200a0e4: c2 00 a2 e0 ld [ %g2 + 0x2e0 ], %g1 200a0e8: 92 02 40 01 add %o1, %g1, %o1 200a0ec: 03 20 00 00 sethi %hi(0x80000000), %g1 200a0f0: 10 80 00 07 b 200a10c <_Scheduler_CBS_Release_job+0x5c> 200a0f4: 92 2a 40 01 andn %o1, %g1, %o1 /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; } /* Budget replenishment for the next job. */ if (serv_info) 200a0f8: 80 a0 60 00 cmp %g1, 0 200a0fc: 02 80 00 04 be 200a10c <_Scheduler_CBS_Release_job+0x5c> <== NEVER TAKEN 200a100: d2 02 20 ac ld [ %o0 + 0xac ], %o1 the_thread->cpu_time_budget = serv_info->parameters.budget; 200a104: c2 00 60 08 ld [ %g1 + 8 ], %g1 200a108: c2 22 20 74 st %g1, [ %o0 + 0x74 ] the_thread->real_priority = new_priority; 200a10c: d2 22 20 18 st %o1, [ %o0 + 0x18 ] _Thread_Change_priority(the_thread, new_priority, true); 200a110: 94 10 20 01 mov 1, %o2 200a114: 82 13 c0 00 mov %o7, %g1 200a118: 40 00 01 33 call 200a5e4 <_Thread_Change_priority> 200a11c: 9e 10 40 00 mov %g1, %o7 =============================================================================== 0200a120 <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { 200a120: 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); 200a124: 40 00 00 57 call 200a280 <_Scheduler_EDF_Enqueue> 200a128: 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; 200a12c: c2 06 20 88 ld [ %i0 + 0x88 ], %g1 200a130: 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) { 200a134: 80 a7 60 00 cmp %i5, 0 200a138: 02 80 00 18 be 200a198 <_Scheduler_CBS_Unblock+0x78> 200a13c: 03 00 80 78 sethi %hi(0x201e000), %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 ) { 200a140: 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 - 200a144: d0 00 62 e0 ld [ %g1 + 0x2e0 ], %o0 200a148: f8 06 20 18 ld [ %i0 + 0x18 ], %i4 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 200a14c: 40 00 3c 39 call 2019230 <.umul> 200a150: 90 27 00 08 sub %i4, %o0, %o0 200a154: d2 06 20 74 ld [ %i0 + 0x74 ], %o1 200a158: b6 10 00 08 mov %o0, %i3 200a15c: 40 00 3c 35 call 2019230 <.umul> 200a160: d0 07 60 08 ld [ %i5 + 8 ], %o0 200a164: 80 a6 c0 08 cmp %i3, %o0 200a168: 24 80 00 0d ble,a 200a19c <_Scheduler_CBS_Unblock+0x7c> 200a16c: 3b 00 80 79 sethi %hi(0x201e400), %i5 /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 200a170: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 200a174: 80 a7 00 09 cmp %i4, %o1 200a178: 32 80 00 02 bne,a 200a180 <_Scheduler_CBS_Unblock+0x60> 200a17c: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 200a180: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 200a184: 80 a0 40 09 cmp %g1, %o1 200a188: 02 80 00 04 be 200a198 <_Scheduler_CBS_Unblock+0x78> 200a18c: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 200a190: 40 00 01 15 call 200a5e4 <_Thread_Change_priority> 200a194: 94 10 20 01 mov 1, %o2 * 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, 200a198: 3b 00 80 79 sethi %hi(0x201e400), %i5 200a19c: ba 17 60 00 mov %i5, %i5 ! 201e400 <_Per_CPU_Information> 200a1a0: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 200a1a4: 03 00 80 75 sethi %hi(0x201d400), %g1 200a1a8: d0 06 20 14 ld [ %i0 + 0x14 ], %o0 200a1ac: c2 00 61 0c ld [ %g1 + 0x10c ], %g1 200a1b0: 9f c0 40 00 call %g1 200a1b4: d2 00 a0 14 ld [ %g2 + 0x14 ], %o1 200a1b8: 80 a2 20 00 cmp %o0, 0 200a1bc: 04 80 00 0f ble 200a1f8 <_Scheduler_CBS_Unblock+0xd8> 200a1c0: 01 00 00 00 nop _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 200a1c4: c2 07 60 0c ld [ %i5 + 0xc ], %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; 200a1c8: f0 27 60 10 st %i0, [ %i5 + 0x10 ] if ( _Thread_Executing->is_preemptible || 200a1cc: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 200a1d0: 80 a0 60 00 cmp %g1, 0 200a1d4: 12 80 00 06 bne 200a1ec <_Scheduler_CBS_Unblock+0xcc> 200a1d8: 84 10 20 01 mov 1, %g2 200a1dc: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 200a1e0: 80 a0 60 00 cmp %g1, 0 200a1e4: 12 80 00 05 bne 200a1f8 <_Scheduler_CBS_Unblock+0xd8> <== ALWAYS TAKEN 200a1e8: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 200a1ec: 03 00 80 79 sethi %hi(0x201e400), %g1 200a1f0: 82 10 60 00 mov %g1, %g1 ! 201e400 <_Per_CPU_Information> 200a1f4: c4 28 60 18 stb %g2, [ %g1 + 0x18 ] 200a1f8: 81 c7 e0 08 ret 200a1fc: 81 e8 00 00 restore =============================================================================== 0200a200 <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 200a200: 9d e3 bf a0 save %sp, -96, %sp void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 200a204: 40 00 06 41 call 200bb08 <_Workspace_Allocate> 200a208: 90 10 20 18 mov 0x18, %o0 if ( sched ) { 200a20c: 80 a2 20 00 cmp %o0, 0 200a210: 02 80 00 05 be 200a224 <_Scheduler_EDF_Allocate+0x24> <== NEVER TAKEN 200a214: 82 10 20 02 mov 2, %g1 the_thread->scheduler_info = sched; 200a218: d0 26 20 88 st %o0, [ %i0 + 0x88 ] schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 200a21c: f0 22 00 00 st %i0, [ %o0 ] schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 200a220: c2 22 20 14 st %g1, [ %o0 + 0x14 ] } return sched; } 200a224: 81 c7 e0 08 ret 200a228: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 0200a288 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 200a288: 9d e3 bf a0 save %sp, -96, %sp _Scheduler_EDF_Enqueue(the_thread); 200a28c: 7f ff ff a9 call 200a130 <_Scheduler_EDF_Enqueue> 200a290: 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( 200a294: 3b 00 80 78 sethi %hi(0x201e000), %i5 200a298: ba 17 63 60 or %i5, 0x360, %i5 ! 201e360 <_Per_CPU_Information> 200a29c: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 200a2a0: 03 00 80 75 sethi %hi(0x201d400), %g1 200a2a4: d0 00 a0 14 ld [ %g2 + 0x14 ], %o0 200a2a8: c2 00 60 6c ld [ %g1 + 0x6c ], %g1 200a2ac: 9f c0 40 00 call %g1 200a2b0: d2 06 20 14 ld [ %i0 + 0x14 ], %o1 200a2b4: 80 a2 20 00 cmp %o0, 0 200a2b8: 16 80 00 0f bge 200a2f4 <_Scheduler_EDF_Unblock+0x6c> 200a2bc: 01 00 00 00 nop _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 200a2c0: c2 07 60 0c ld [ %i5 + 0xc ], %g1 * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; 200a2c4: f0 27 60 10 st %i0, [ %i5 + 0x10 ] if ( _Thread_Executing->is_preemptible || 200a2c8: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 200a2cc: 80 a0 60 00 cmp %g1, 0 200a2d0: 12 80 00 06 bne 200a2e8 <_Scheduler_EDF_Unblock+0x60> 200a2d4: 84 10 20 01 mov 1, %g2 200a2d8: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 200a2dc: 80 a0 60 00 cmp %g1, 0 200a2e0: 12 80 00 05 bne 200a2f4 <_Scheduler_EDF_Unblock+0x6c> <== ALWAYS TAKEN 200a2e4: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 200a2e8: 03 00 80 78 sethi %hi(0x201e000), %g1 200a2ec: 82 10 63 60 or %g1, 0x360, %g1 ! 201e360 <_Per_CPU_Information> 200a2f0: c4 28 60 18 stb %g2, [ %g1 + 0x18 ] 200a2f4: 81 c7 e0 08 ret 200a2f8: 81 e8 00 00 restore =============================================================================== 02008760 <_TOD_Tickle_ticks>: * * Output parameters: NONE */ void _TOD_Tickle_ticks( void ) { 2008760: 9d e3 bf a0 save %sp, -96, %sp Timestamp_Control tick; uint32_t seconds; /* Convert the tick quantum to a timestamp */ _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() ); 2008764: 03 00 80 6e sethi %hi(0x201b800), %g1 2008768: c2 00 61 5c ld [ %g1 + 0x15c ], %g1 ! 201b95c const Timestamp64_Control *_add ) { Timestamp64_Control _start = *_time / 1000000000L; *_time += *_add; if ( ((*_time) / 1000000000L) != _start ) { 200876c: 94 10 20 00 clr %o2 2008770: 85 28 60 02 sll %g1, 2, %g2 2008774: 91 28 60 07 sll %g1, 7, %o0 2008778: 90 22 00 02 sub %o0, %g2, %o0 200877c: 90 02 00 01 add %o0, %g1, %o0 /* Update the counter of ticks since boot */ _Watchdog_Ticks_since_boot += 1; 2008780: 03 00 80 71 sethi %hi(0x201c400), %g1 2008784: c4 00 63 c0 ld [ %g1 + 0x3c0 ], %g2 ! 201c7c0 <_Watchdog_Ticks_since_boot> { Timestamp_Control tick; uint32_t seconds; /* Convert the tick quantum to a timestamp */ _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() ); 2008788: 91 2a 20 03 sll %o0, 3, %o0 /* Update the counter of ticks since boot */ _Watchdog_Ticks_since_boot += 1; 200878c: 84 00 a0 01 inc %g2 2008790: c4 20 63 c0 st %g2, [ %g1 + 0x3c0 ] static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 2008794: 03 00 80 71 sethi %hi(0x201c400), %g1 2008798: c4 18 63 30 ldd [ %g1 + 0x330 ], %g2 ! 201c730 <_TOD_Uptime> { Timestamp_Control tick; uint32_t seconds; /* Convert the tick quantum to a timestamp */ _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() ); 200879c: 92 10 00 08 mov %o0, %o1 20087a0: 90 10 20 00 clr %o0 20087a4: 86 80 c0 09 addcc %g3, %o1, %g3 20087a8: 84 40 80 08 addx %g2, %o0, %g2 20087ac: c4 38 63 30 std %g2, [ %g1 + 0x330 ] static inline uint32_t _Timestamp64_Add_to_at_tick( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { Timestamp64_Control _start = *_time / 1000000000L; 20087b0: 03 00 80 71 sethi %hi(0x201c400), %g1 20087b4: f8 18 63 40 ldd [ %g1 + 0x340 ], %i4 ! 201c740 <_TOD_Now> *_time += *_add; if ( ((*_time) / 1000000000L) != _start ) { 20087b8: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 Timestamp64_Control *_time, const Timestamp64_Control *_add ) { Timestamp64_Control _start = *_time / 1000000000L; *_time += *_add; 20087bc: 92 87 40 09 addcc %i5, %o1, %o1 if ( ((*_time) / 1000000000L) != _start ) { 20087c0: 96 12 e2 00 or %o3, 0x200, %o3 Timestamp64_Control *_time, const Timestamp64_Control *_add ) { Timestamp64_Control _start = *_time / 1000000000L; *_time += *_add; 20087c4: 90 47 00 08 addx %i4, %o0, %o0 if ( ((*_time) / 1000000000L) != _start ) { 20087c8: 40 00 3d fe call 2017fc0 <__divdi3> 20087cc: d0 38 63 40 std %o0, [ %g1 + 0x340 ] static inline uint32_t _Timestamp64_Add_to_at_tick( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { Timestamp64_Control _start = *_time / 1000000000L; 20087d0: 94 10 20 00 clr %o2 *_time += *_add; if ( ((*_time) / 1000000000L) != _start ) { 20087d4: b4 10 00 08 mov %o0, %i2 20087d8: b6 10 00 09 mov %o1, %i3 static inline uint32_t _Timestamp64_Add_to_at_tick( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { Timestamp64_Control _start = *_time / 1000000000L; 20087dc: 90 10 00 1c mov %i4, %o0 20087e0: 92 10 00 1d mov %i5, %o1 20087e4: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 20087e8: 40 00 3d f6 call 2017fc0 <__divdi3> 20087ec: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _Timestamp_Add_to( &_TOD_Uptime, &tick ); /* we do not care how much the uptime changed */ /* Update the timespec format TOD */ seconds = _Timestamp_Add_to_at_tick( &_TOD_Now, &tick ); while ( seconds ) { 20087f0: 80 a6 80 08 cmp %i2, %o0 20087f4: 12 80 00 05 bne 2008808 <_TOD_Tickle_ticks+0xa8> <== NEVER TAKEN 20087f8: 31 00 80 71 sethi %hi(0x201c400), %i0 20087fc: 80 a6 c0 09 cmp %i3, %o1 2008800: 02 80 00 04 be 2008810 <_TOD_Tickle_ticks+0xb0> 2008804: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE void _Watchdog_Tickle_seconds( void ) { _Watchdog_Tickle( &_Watchdog_Seconds_chain ); 2008808: 40 00 09 ed call 200afbc <_Watchdog_Tickle> 200880c: 91 ee 23 64 restore %i0, 0x364, %o0 2008810: 81 c7 e0 08 ret 2008814: 81 e8 00 00 restore =============================================================================== 02008670 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 2008670: 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(); 2008674: 03 00 80 78 sethi %hi(0x201e000), %g1 (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; 2008678: ba 10 20 00 clr %i5 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 200867c: 80 a6 20 00 cmp %i0, 0 2008680: 02 80 00 2b be 200872c <_TOD_Validate+0xbc> <== NEVER TAKEN 2008684: d2 00 60 ac ld [ %g1 + 0xac ], %o1 ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 2008688: 11 00 03 d0 sethi %hi(0xf4000), %o0 200868c: 40 00 45 19 call 2019af0 <.udiv> 2008690: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 2008694: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 2008698: 80 a0 40 08 cmp %g1, %o0 200869c: 3a 80 00 25 bcc,a 2008730 <_TOD_Validate+0xc0> 20086a0: b0 0f 60 01 and %i5, 1, %i0 (the_tod->ticks >= ticks_per_second) || 20086a4: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 20086a8: 80 a0 60 3b cmp %g1, 0x3b 20086ac: 38 80 00 21 bgu,a 2008730 <_TOD_Validate+0xc0> 20086b0: b0 0f 60 01 and %i5, 1, %i0 (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 20086b4: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 20086b8: 80 a0 60 3b cmp %g1, 0x3b 20086bc: 38 80 00 1d bgu,a 2008730 <_TOD_Validate+0xc0> 20086c0: b0 0f 60 01 and %i5, 1, %i0 (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 20086c4: c2 06 20 0c ld [ %i0 + 0xc ], %g1 20086c8: 80 a0 60 17 cmp %g1, 0x17 20086cc: 38 80 00 19 bgu,a 2008730 <_TOD_Validate+0xc0> 20086d0: b0 0f 60 01 and %i5, 1, %i0 (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 20086d4: c2 06 20 04 ld [ %i0 + 4 ], %g1 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || 20086d8: 80 a0 60 00 cmp %g1, 0 20086dc: 02 80 00 14 be 200872c <_TOD_Validate+0xbc> <== NEVER TAKEN 20086e0: 80 a0 60 0c cmp %g1, 0xc (the_tod->month == 0) || 20086e4: 38 80 00 13 bgu,a 2008730 <_TOD_Validate+0xc0> 20086e8: b0 0f 60 01 and %i5, 1, %i0 (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 20086ec: 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) || 20086f0: 80 a0 e7 c3 cmp %g3, 0x7c3 20086f4: 28 80 00 0f bleu,a 2008730 <_TOD_Validate+0xc0> 20086f8: b0 0f 60 01 and %i5, 1, %i0 (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 20086fc: c4 06 20 08 ld [ %i0 + 8 ], %g2 (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) || 2008700: 80 a0 a0 00 cmp %g2, 0 2008704: 02 80 00 0a be 200872c <_TOD_Validate+0xbc> <== NEVER TAKEN 2008708: 80 88 e0 03 btst 3, %g3 200870c: 07 00 80 73 sethi %hi(0x201cc00), %g3 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 2008710: 12 80 00 03 bne 200871c <_TOD_Validate+0xac> 2008714: 86 10 e0 a8 or %g3, 0xa8, %g3 ! 201cca8 <_TOD_Days_per_month> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 2008718: 82 00 60 0d add %g1, 0xd, %g1 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 200871c: 83 28 60 02 sll %g1, 2, %g1 2008720: c2 00 c0 01 ld [ %g3 + %g1 ], %g1 * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 2008724: 80 a0 40 02 cmp %g1, %g2 2008728: ba 60 3f ff subx %g0, -1, %i5 if ( the_tod->day > days_in_month ) return false; return true; } 200872c: b0 0f 60 01 and %i5, 1, %i0 2008730: 81 c7 e0 08 ret 2008734: 81 e8 00 00 restore =============================================================================== 02009c50 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 2009c50: 9d e3 bf a0 save %sp, -96, %sp States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 2009c54: f8 06 20 10 ld [ %i0 + 0x10 ], %i4 /* * Set a transient state for the thread so it is pulled off the Ready chains. * This will prevent it from being scheduled no matter what happens in an * ISR. */ _Thread_Set_transient( the_thread ); 2009c58: 40 00 03 5b call 200a9c4 <_Thread_Set_transient> 2009c5c: 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 ) 2009c60: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 2009c64: 80 a0 40 19 cmp %g1, %i1 2009c68: 02 80 00 05 be 2009c7c <_Thread_Change_priority+0x2c> 2009c6c: ba 10 00 18 mov %i0, %i5 _Thread_Set_priority( the_thread, new_priority ); 2009c70: 90 10 00 18 mov %i0, %o0 2009c74: 40 00 03 3b call 200a960 <_Thread_Set_priority> 2009c78: 92 10 00 19 mov %i1, %o1 _ISR_Disable( level ); 2009c7c: 7f ff e2 5c call 20025ec 2009c80: 01 00 00 00 nop 2009c84: b6 10 00 08 mov %o0, %i3 /* * 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; 2009c88: f2 07 60 10 ld [ %i5 + 0x10 ], %i1 if ( state != STATES_TRANSIENT ) { 2009c8c: 80 a6 60 04 cmp %i1, 4 2009c90: 02 80 00 10 be 2009cd0 <_Thread_Change_priority+0x80> 2009c94: b8 0f 20 04 and %i4, 4, %i4 /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 2009c98: 80 a7 20 00 cmp %i4, 0 2009c9c: 12 80 00 03 bne 2009ca8 <_Thread_Change_priority+0x58> <== NEVER TAKEN 2009ca0: 82 0e 7f fb and %i1, -5, %g1 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 2009ca4: c2 27 60 10 st %g1, [ %i5 + 0x10 ] _ISR_Enable( level ); 2009ca8: 7f ff e2 55 call 20025fc 2009cac: 90 10 00 1b mov %i3, %o0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 2009cb0: 03 00 00 ef sethi %hi(0x3bc00), %g1 2009cb4: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 2009cb8: 80 8e 40 01 btst %i1, %g1 2009cbc: 02 80 00 29 be 2009d60 <_Thread_Change_priority+0x110> 2009cc0: 01 00 00 00 nop _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 2009cc4: f0 07 60 44 ld [ %i5 + 0x44 ], %i0 2009cc8: 40 00 02 f8 call 200a8a8 <_Thread_queue_Requeue> 2009ccc: 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 ) ) { 2009cd0: 80 a7 20 00 cmp %i4, 0 2009cd4: 12 80 00 0b bne 2009d00 <_Thread_Change_priority+0xb0> <== NEVER TAKEN 2009cd8: 03 00 80 6e sethi %hi(0x201b800), %g1 * Interrupts are STILL disabled. * We now know the thread will be in the READY state when we remove * the TRANSIENT state. So we have to place it on the appropriate * Ready Queue with interrupts off. */ the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 2009cdc: c0 27 60 10 clr [ %i5 + 0x10 ] if ( prepend_it ) 2009ce0: 80 a6 a0 00 cmp %i2, 0 2009ce4: 02 80 00 04 be 2009cf4 <_Thread_Change_priority+0xa4> 2009ce8: 82 10 62 3c or %g1, 0x23c, %g1 */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 2009cec: 10 80 00 03 b 2009cf8 <_Thread_Change_priority+0xa8> 2009cf0: c2 00 60 28 ld [ %g1 + 0x28 ], %g1 */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 2009cf4: c2 00 60 24 ld [ %g1 + 0x24 ], %g1 2009cf8: 9f c0 40 00 call %g1 2009cfc: 90 10 00 1d mov %i5, %o0 _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 2009d00: 7f ff e2 3f call 20025fc 2009d04: 90 10 00 1b mov %i3, %o0 2009d08: 7f ff e2 39 call 20025ec 2009d0c: 01 00 00 00 nop 2009d10: 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(); 2009d14: 03 00 80 6e sethi %hi(0x201b800), %g1 2009d18: c2 00 62 44 ld [ %g1 + 0x244 ], %g1 ! 201ba44 <_Scheduler+0x8> 2009d1c: 9f c0 40 00 call %g1 2009d20: 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 ); 2009d24: 03 00 80 72 sethi %hi(0x201c800), %g1 2009d28: 82 10 60 e0 or %g1, 0xe0, %g1 ! 201c8e0 <_Per_CPU_Information> 2009d2c: c4 00 60 0c ld [ %g1 + 0xc ], %g2 * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Scheduler_Schedule(); if ( !_Thread_Is_executing_also_the_heir() && 2009d30: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 2009d34: 80 a0 80 03 cmp %g2, %g3 2009d38: 02 80 00 08 be 2009d58 <_Thread_Change_priority+0x108> 2009d3c: 01 00 00 00 nop 2009d40: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 2009d44: 80 a0 a0 00 cmp %g2, 0 2009d48: 02 80 00 04 be 2009d58 <_Thread_Change_priority+0x108> 2009d4c: 01 00 00 00 nop _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 2009d50: 84 10 20 01 mov 1, %g2 ! 1 2009d54: c4 28 60 18 stb %g2, [ %g1 + 0x18 ] _ISR_Enable( level ); 2009d58: 7f ff e2 29 call 20025fc 2009d5c: 81 e8 00 00 restore 2009d60: 81 c7 e0 08 ret 2009d64: 81 e8 00 00 restore =============================================================================== 02009f54 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 2009f54: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 2009f58: 90 10 00 18 mov %i0, %o0 2009f5c: 40 00 00 6f call 200a118 <_Thread_Get> 2009f60: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 2009f64: c2 07 bf fc ld [ %fp + -4 ], %g1 2009f68: 80 a0 60 00 cmp %g1, 0 2009f6c: 12 80 00 09 bne 2009f90 <_Thread_Delay_ended+0x3c> <== NEVER TAKEN 2009f70: 13 04 00 00 sethi %hi(0x10000000), %o1 #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 2009f74: 7f ff ff 7d call 2009d68 <_Thread_Clear_state> 2009f78: 92 12 60 18 or %o1, 0x18, %o1 ! 10000018 * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 2009f7c: 03 00 80 71 sethi %hi(0x201c400), %g1 2009f80: c4 00 62 b0 ld [ %g1 + 0x2b0 ], %g2 ! 201c6b0 <_Thread_Dispatch_disable_level> 2009f84: 84 00 bf ff add %g2, -1, %g2 2009f88: c4 20 62 b0 st %g2, [ %g1 + 0x2b0 ] return _Thread_Dispatch_disable_level; 2009f8c: c2 00 62 b0 ld [ %g1 + 0x2b0 ], %g1 2009f90: 81 c7 e0 08 ret 2009f94: 81 e8 00 00 restore =============================================================================== 02009f98 <_Thread_Dispatch>: * INTERRUPT LATENCY: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 2009f98: 9d e3 bf 98 save %sp, -104, %sp * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 2009f9c: 03 00 80 71 sethi %hi(0x201c400), %g1 2009fa0: c4 00 62 b0 ld [ %g1 + 0x2b0 ], %g2 ! 201c6b0 <_Thread_Dispatch_disable_level> 2009fa4: 84 00 a0 01 inc %g2 2009fa8: c4 20 62 b0 st %g2, [ %g1 + 0x2b0 ] return _Thread_Dispatch_disable_level; 2009fac: c2 00 62 b0 ld [ %g1 + 0x2b0 ], %g1 #endif /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; 2009fb0: 37 00 80 72 sethi %hi(0x201c800), %i3 2009fb4: 82 16 e0 e0 or %i3, 0xe0, %g1 ! 201c8e0 <_Per_CPU_Information> _ISR_Disable( level ); 2009fb8: 7f ff e1 8d call 20025ec 2009fbc: fa 00 60 0c ld [ %g1 + 0xc ], %i5 #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; 2009fc0: 35 00 80 71 sethi %hi(0x201c400), %i2 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 2009fc4: 31 00 80 71 sethi %hi(0x201c400), %i0 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 2009fc8: 10 80 00 37 b 200a0a4 <_Thread_Dispatch+0x10c> 2009fcc: 33 00 80 71 sethi %hi(0x201c400), %i1 heir = _Thread_Heir; _Thread_Dispatch_necessary = false; 2009fd0: c0 28 60 18 clrb [ %g1 + 0x18 ] /* * When the heir and executing are the same, then we are being * requested to do the post switch dispatching. This is normally * done to dispatch signals. */ if ( heir == executing ) 2009fd4: 80 a7 00 1d cmp %i4, %i5 2009fd8: 02 80 00 38 be 200a0b8 <_Thread_Dispatch+0x120> 2009fdc: f8 20 60 0c st %i4, [ %g1 + 0xc ] */ #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) 2009fe0: c2 07 20 78 ld [ %i4 + 0x78 ], %g1 2009fe4: 80 a0 60 01 cmp %g1, 1 2009fe8: 12 80 00 03 bne 2009ff4 <_Thread_Dispatch+0x5c> 2009fec: c2 06 a2 14 ld [ %i2 + 0x214 ], %g1 heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 2009ff0: c2 27 20 74 st %g1, [ %i4 + 0x74 ] _ISR_Enable( level ); 2009ff4: 7f ff e1 82 call 20025fc 2009ff8: 01 00 00 00 nop #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 2009ffc: 40 00 0b 38 call 200ccdc <_TOD_Get_uptime> 200a000: 90 07 bf f8 add %fp, -8, %o0 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 200a004: c4 1f 60 80 ldd [ %i5 + 0x80 ], %g2 _Timestamp_Subtract( 200a008: d4 1f bf f8 ldd [ %fp + -8 ], %o2 200a00c: 82 16 e0 e0 or %i3, 0xe0, %g1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 200a010: d8 18 60 20 ldd [ %g1 + 0x20 ], %o4 200a014: 9a a2 c0 0d subcc %o3, %o5, %o5 200a018: 98 62 80 0c subx %o2, %o4, %o4 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 200a01c: 86 80 c0 0d addcc %g3, %o5, %g3 200a020: 84 40 80 0c addx %g2, %o4, %g2 200a024: c4 3f 60 80 std %g2, [ %i5 + 0x80 ] &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 200a028: d4 38 60 20 std %o2, [ %g1 + 0x20 ] #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 200a02c: c2 06 23 3c ld [ %i0 + 0x33c ], %g1 200a030: 80 a0 60 00 cmp %g1, 0 200a034: 02 80 00 06 be 200a04c <_Thread_Dispatch+0xb4> <== NEVER TAKEN 200a038: 90 10 00 1d mov %i5, %o0 executing->libc_reent = *_Thread_libc_reent; 200a03c: c4 00 40 00 ld [ %g1 ], %g2 200a040: c4 27 61 4c st %g2, [ %i5 + 0x14c ] *_Thread_libc_reent = heir->libc_reent; 200a044: c4 07 21 4c ld [ %i4 + 0x14c ], %g2 200a048: c4 20 40 00 st %g2, [ %g1 ] } _User_extensions_Thread_switch( executing, heir ); 200a04c: 40 00 03 4a call 200ad74 <_User_extensions_Thread_switch> 200a050: 92 10 00 1c mov %i4, %o1 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 200a054: 90 07 60 c0 add %i5, 0xc0, %o0 200a058: 40 00 04 76 call 200b230 <_CPU_Context_switch> 200a05c: 92 07 20 c0 add %i4, 0xc0, %o1 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 200a060: c2 07 61 48 ld [ %i5 + 0x148 ], %g1 200a064: 80 a0 60 00 cmp %g1, 0 200a068: 02 80 00 0c be 200a098 <_Thread_Dispatch+0x100> 200a06c: d0 06 63 38 ld [ %i1 + 0x338 ], %o0 200a070: 80 a7 40 08 cmp %i5, %o0 200a074: 02 80 00 09 be 200a098 <_Thread_Dispatch+0x100> 200a078: 80 a2 20 00 cmp %o0, 0 !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 200a07c: 02 80 00 04 be 200a08c <_Thread_Dispatch+0xf4> 200a080: 01 00 00 00 nop _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 200a084: 40 00 04 31 call 200b148 <_CPU_Context_save_fp> 200a088: 90 02 21 48 add %o0, 0x148, %o0 _Context_Restore_fp( &executing->fp_context ); 200a08c: 40 00 04 4c call 200b1bc <_CPU_Context_restore_fp> 200a090: 90 07 61 48 add %i5, 0x148, %o0 _Thread_Allocated_fp = executing; 200a094: fa 26 63 38 st %i5, [ %i1 + 0x338 ] if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 200a098: 82 16 e0 e0 or %i3, 0xe0, %g1 _ISR_Disable( level ); 200a09c: 7f ff e1 54 call 20025ec 200a0a0: fa 00 60 0c ld [ %g1 + 0xc ], %i5 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 200a0a4: 82 16 e0 e0 or %i3, 0xe0, %g1 200a0a8: c4 08 60 18 ldub [ %g1 + 0x18 ], %g2 200a0ac: 80 a0 a0 00 cmp %g2, 0 200a0b0: 32 bf ff c8 bne,a 2009fd0 <_Thread_Dispatch+0x38> 200a0b4: f8 00 60 10 ld [ %g1 + 0x10 ], %i4 _ISR_Disable( level ); } post_switch: _ISR_Enable( level ); 200a0b8: 7f ff e1 51 call 20025fc 200a0bc: 01 00 00 00 nop * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 200a0c0: 03 00 80 71 sethi %hi(0x201c400), %g1 200a0c4: c4 00 62 b0 ld [ %g1 + 0x2b0 ], %g2 ! 201c6b0 <_Thread_Dispatch_disable_level> 200a0c8: 84 00 bf ff add %g2, -1, %g2 200a0cc: c4 20 62 b0 st %g2, [ %g1 + 0x2b0 ] return _Thread_Dispatch_disable_level; 200a0d0: c2 00 62 b0 ld [ %g1 + 0x2b0 ], %g1 _Thread_Unnest_dispatch(); _API_extensions_Run_postswitch(); 200a0d4: 7f ff f8 1f call 2008150 <_API_extensions_Run_postswitch> 200a0d8: 01 00 00 00 nop } 200a0dc: 81 c7 e0 08 ret 200a0e0: 81 e8 00 00 restore =============================================================================== 0200e8fc <_Thread_Handler>: * Input parameters: NONE * * Output parameters: NONE */ void _Thread_Handler( void ) { 200e8fc: 9d e3 bf a0 save %sp, -96, %sp #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 200e900: 03 00 80 72 sethi %hi(0x201c800), %g1 200e904: fa 00 60 ec ld [ %g1 + 0xec ], %i5 ! 201c8ec <_Per_CPU_Information+0xc> /* * Some CPUs need to tinker with the call frame or registers when the * thread actually begins to execute for the first time. This is a * hook point where the port gets a shot at doing whatever it requires. */ _Context_Initialization_at_thread_begin(); 200e908: 3f 00 80 3a sethi %hi(0x200e800), %i7 200e90c: be 17 e0 fc or %i7, 0xfc, %i7 ! 200e8fc <_Thread_Handler> /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 200e910: d0 07 60 a8 ld [ %i5 + 0xa8 ], %o0 _ISR_Set_level(level); 200e914: 7f ff cf 3a call 20025fc 200e918: 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; 200e91c: 03 00 80 70 sethi %hi(0x201c000), %g1 doneConstructors = true; 200e920: 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; 200e924: f8 08 62 d8 ldub [ %g1 + 0x2d8 ], %i4 doneConstructors = true; 200e928: c4 28 62 d8 stb %g2, [ %g1 + 0x2d8 ] #endif #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 200e92c: c2 07 61 48 ld [ %i5 + 0x148 ], %g1 200e930: 80 a0 60 00 cmp %g1, 0 200e934: 02 80 00 0c be 200e964 <_Thread_Handler+0x68> 200e938: 03 00 80 71 sethi %hi(0x201c400), %g1 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Allocated_fp ); 200e93c: d0 00 63 38 ld [ %g1 + 0x338 ], %o0 ! 201c738 <_Thread_Allocated_fp> 200e940: 80 a7 40 08 cmp %i5, %o0 200e944: 02 80 00 08 be 200e964 <_Thread_Handler+0x68> 200e948: 80 a2 20 00 cmp %o0, 0 !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 200e94c: 22 80 00 06 be,a 200e964 <_Thread_Handler+0x68> 200e950: fa 20 63 38 st %i5, [ %g1 + 0x338 ] _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 200e954: 7f ff f1 fd call 200b148 <_CPU_Context_save_fp> 200e958: 90 02 21 48 add %o0, 0x148, %o0 _Thread_Allocated_fp = executing; 200e95c: 03 00 80 71 sethi %hi(0x201c400), %g1 200e960: fa 20 63 38 st %i5, [ %g1 + 0x338 ] ! 201c738 <_Thread_Allocated_fp> /* * Take care that 'begin' extensions get to complete before * 'switch' extensions can run. This means must keep dispatch * disabled until all 'begin' extensions complete. */ _User_extensions_Thread_begin( executing ); 200e964: 7f ff f0 95 call 200abb8 <_User_extensions_Thread_begin> 200e968: 90 10 00 1d mov %i5, %o0 /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 200e96c: 7f ff ed de call 200a0e4 <_Thread_Enable_dispatch> 200e970: 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) */ { 200e974: 80 8f 20 ff btst 0xff, %i4 200e978: 32 80 00 05 bne,a 200e98c <_Thread_Handler+0x90> 200e97c: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 INIT_NAME (); 200e980: 40 00 33 e4 call 201b910 <_init> 200e984: 01 00 00 00 nop _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 200e988: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 200e98c: 80 a0 60 00 cmp %g1, 0 200e990: 12 80 00 06 bne 200e9a8 <_Thread_Handler+0xac> <== NEVER TAKEN 200e994: 01 00 00 00 nop executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 200e998: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 200e99c: 9f c0 40 00 call %g1 200e9a0: d0 07 60 98 ld [ %i5 + 0x98 ], %o0 #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 200e9a4: d0 27 60 28 st %o0, [ %i5 + 0x28 ] * was placed in return_argument. This assumed that if it returned * anything (which is not supporting in all APIs), then it would be * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); 200e9a8: 7f ff f0 95 call 200abfc <_User_extensions_Thread_exitted> 200e9ac: 90 10 00 1d mov %i5, %o0 _Internal_error_Occurred( 200e9b0: 90 10 20 00 clr %o0 200e9b4: 92 10 20 01 mov 1, %o1 200e9b8: 7f ff e8 91 call 2008bfc <_Internal_error_Occurred> 200e9bc: 94 10 20 05 mov 5, %o2 =============================================================================== 0200a388 <_Thread_Handler_initialization>: * * Output parameters: NONE */ void _Thread_Handler_initialization(void) { 200a388: 9d e3 bf 98 save %sp, -104, %sp uint32_t ticks_per_timeslice = 200a38c: 05 00 80 6e sethi %hi(0x201b800), %g2 200a390: 84 10 a1 4c or %g2, 0x14c, %g2 ! 201b94c #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 200a394: c6 00 a0 28 ld [ %g2 + 0x28 ], %g3 * Output parameters: NONE */ void _Thread_Handler_initialization(void) { uint32_t ticks_per_timeslice = 200a398: fa 00 a0 14 ld [ %g2 + 0x14 ], %i5 rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = 200a39c: f8 00 a0 0c ld [ %g2 + 0xc ], %i4 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 200a3a0: 80 a0 e0 00 cmp %g3, 0 200a3a4: 02 80 00 06 be 200a3bc <_Thread_Handler_initialization+0x34> 200a3a8: c2 00 a0 24 ld [ %g2 + 0x24 ], %g1 200a3ac: c6 00 a0 2c ld [ %g2 + 0x2c ], %g3 200a3b0: 80 a0 e0 00 cmp %g3, 0 200a3b4: 12 80 00 06 bne 200a3cc <_Thread_Handler_initialization+0x44><== ALWAYS TAKEN 200a3b8: 80 a0 60 00 cmp %g1, 0 rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( 200a3bc: 90 10 20 00 clr %o0 200a3c0: 92 10 20 01 mov 1, %o1 200a3c4: 7f ff fa 0e call 2008bfc <_Internal_error_Occurred> 200a3c8: 94 10 20 0e mov 0xe, %o2 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 200a3cc: 22 80 00 05 be,a 200a3e0 <_Thread_Handler_initialization+0x58> 200a3d0: 03 00 80 72 sethi %hi(0x201c800), %g1 (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 200a3d4: 9f c0 40 00 call %g1 200a3d8: d0 00 a0 08 ld [ %g2 + 8 ], %o0 _Thread_Dispatch_necessary = false; 200a3dc: 03 00 80 72 sethi %hi(0x201c800), %g1 200a3e0: 82 10 60 e0 or %g1, 0xe0, %g1 ! 201c8e0 <_Per_CPU_Information> 200a3e4: c0 28 60 18 clrb [ %g1 + 0x18 ] _Thread_Executing = NULL; 200a3e8: c0 20 60 0c clr [ %g1 + 0xc ] _Thread_Heir = NULL; 200a3ec: c0 20 60 10 clr [ %g1 + 0x10 ] #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; 200a3f0: 03 00 80 71 sethi %hi(0x201c400), %g1 200a3f4: c0 20 63 38 clr [ %g1 + 0x338 ] ! 201c738 <_Thread_Allocated_fp> #endif _Thread_Maximum_extensions = maximum_extensions; 200a3f8: 03 00 80 71 sethi %hi(0x201c400), %g1 200a3fc: f8 20 63 48 st %i4, [ %g1 + 0x348 ] ! 201c748 <_Thread_Maximum_extensions> _Thread_Ticks_per_timeslice = ticks_per_timeslice; 200a400: 03 00 80 71 sethi %hi(0x201c400), %g1 200a404: fa 20 62 14 st %i5, [ %g1 + 0x214 ] ! 201c614 <_Thread_Ticks_per_timeslice> #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 200a408: 82 10 20 08 mov 8, %g1 200a40c: 11 00 80 71 sethi %hi(0x201c400), %o0 200a410: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 200a414: 90 12 23 c8 or %o0, 0x3c8, %o0 200a418: 92 10 20 01 mov 1, %o1 200a41c: 94 10 20 01 mov 1, %o2 200a420: 96 10 20 01 mov 1, %o3 200a424: 98 10 21 60 mov 0x160, %o4 200a428: 7f ff fb 7a call 2009210 <_Objects_Initialize_information> 200a42c: 9a 10 20 00 clr %o5 false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } 200a430: 81 c7 e0 08 ret 200a434: 81 e8 00 00 restore =============================================================================== 0200a1c8 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 200a1c8: 9d e3 bf a0 save %sp, -96, %sp 200a1cc: c2 07 a0 6c ld [ %fp + 0x6c ], %g1 200a1d0: f4 0f a0 5f ldub [ %fp + 0x5f ], %i2 200a1d4: e0 00 40 00 ld [ %g1 ], %l0 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 200a1d8: c0 26 61 50 clr [ %i1 + 0x150 ] 200a1dc: c0 26 61 54 clr [ %i1 + 0x154 ] extensions_area = NULL; the_thread->libc_reent = NULL; 200a1e0: c0 26 61 4c clr [ %i1 + 0x14c ] /* * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 200a1e4: 90 10 00 19 mov %i1, %o0 200a1e8: 40 00 02 06 call 200aa00 <_Thread_Stack_Allocate> 200a1ec: 92 10 00 1b mov %i3, %o1 if ( !actual_stack_size || actual_stack_size < stack_size ) 200a1f0: 80 a2 00 1b cmp %o0, %i3 200a1f4: 0a 80 00 61 bcs 200a378 <_Thread_Initialize+0x1b0> 200a1f8: 80 a2 20 00 cmp %o0, 0 200a1fc: 02 80 00 5f be 200a378 <_Thread_Initialize+0x1b0> <== NEVER TAKEN 200a200: 80 a7 20 00 cmp %i4, 0 Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 200a204: c2 06 60 bc ld [ %i1 + 0xbc ], %g1 the_stack->size = size; 200a208: d0 26 60 b0 st %o0, [ %i1 + 0xb0 ] Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 200a20c: c2 26 60 b4 st %g1, [ %i1 + 0xb4 ] /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { 200a210: 02 80 00 07 be 200a22c <_Thread_Initialize+0x64> 200a214: b6 10 20 00 clr %i3 fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); 200a218: 40 00 03 b0 call 200b0d8 <_Workspace_Allocate> 200a21c: 90 10 20 88 mov 0x88, %o0 if ( !fp_area ) 200a220: b6 92 20 00 orcc %o0, 0, %i3 200a224: 02 80 00 46 be 200a33c <_Thread_Initialize+0x174> 200a228: b8 10 20 00 clr %i4 #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 200a22c: 03 00 80 71 sethi %hi(0x201c400), %g1 200a230: d0 00 63 48 ld [ %g1 + 0x348 ], %o0 ! 201c748 <_Thread_Maximum_extensions> fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); if ( !fp_area ) goto failed; fp_area = _Context_Fp_start( fp_area, 0 ); } the_thread->fp_context = fp_area; 200a234: f6 26 61 48 st %i3, [ %i1 + 0x148 ] the_thread->Start.fp_context = fp_area; 200a238: f6 26 60 b8 st %i3, [ %i1 + 0xb8 ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 200a23c: c0 26 60 50 clr [ %i1 + 0x50 ] the_watchdog->routine = routine; 200a240: c0 26 60 64 clr [ %i1 + 0x64 ] the_watchdog->id = id; 200a244: c0 26 60 68 clr [ %i1 + 0x68 ] the_watchdog->user_data = user_data; 200a248: c0 26 60 6c clr [ %i1 + 0x6c ] #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 200a24c: 80 a2 20 00 cmp %o0, 0 200a250: 02 80 00 08 be 200a270 <_Thread_Initialize+0xa8> 200a254: b8 10 20 00 clr %i4 extensions_area = _Workspace_Allocate( 200a258: 90 02 20 01 inc %o0 200a25c: 40 00 03 9f call 200b0d8 <_Workspace_Allocate> 200a260: 91 2a 20 02 sll %o0, 2, %o0 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 200a264: b8 92 20 00 orcc %o0, 0, %i4 200a268: 22 80 00 36 be,a 200a340 <_Thread_Initialize+0x178> 200a26c: b4 10 20 00 clr %i2 * if they are linked to the thread. An extension user may * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { 200a270: 80 a7 20 00 cmp %i4, 0 200a274: 02 80 00 0c be 200a2a4 <_Thread_Initialize+0xdc> 200a278: f8 26 61 58 st %i4, [ %i1 + 0x158 ] for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 200a27c: 03 00 80 71 sethi %hi(0x201c400), %g1 200a280: c4 00 63 48 ld [ %g1 + 0x348 ], %g2 ! 201c748 <_Thread_Maximum_extensions> 200a284: 10 80 00 05 b 200a298 <_Thread_Initialize+0xd0> 200a288: 82 10 20 00 clr %g1 the_thread->extensions[i] = NULL; 200a28c: 87 28 60 02 sll %g1, 2, %g3 * 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++ ) 200a290: 82 00 60 01 inc %g1 the_thread->extensions[i] = NULL; 200a294: c0 21 00 03 clr [ %g4 + %g3 ] * 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++ ) 200a298: 80 a0 40 02 cmp %g1, %g2 200a29c: 28 bf ff fc bleu,a 200a28c <_Thread_Initialize+0xc4> 200a2a0: c8 06 61 58 ld [ %i1 + 0x158 ], %g4 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; 200a2a4: c2 07 a0 60 ld [ %fp + 0x60 ], %g1 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 200a2a8: f4 2e 60 9c stb %i2, [ %i1 + 0x9c ] the_thread->Start.budget_algorithm = budget_algorithm; 200a2ac: c2 26 60 a0 st %g1, [ %i1 + 0xa0 ] the_thread->Start.budget_callout = budget_callout; 200a2b0: c2 07 a0 64 ld [ %fp + 0x64 ], %g1 } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; the_thread->Wait.queue = NULL; 200a2b4: c0 26 60 44 clr [ %i1 + 0x44 ] * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 200a2b8: c2 26 60 a4 st %g1, [ %i1 + 0xa4 ] case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 200a2bc: c2 07 a0 68 ld [ %fp + 0x68 ], %g1 the_thread->current_state = STATES_DORMANT; the_thread->Wait.queue = NULL; the_thread->resource_count = 0; 200a2c0: c0 26 60 1c clr [ %i1 + 0x1c ] case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 200a2c4: c2 26 60 a8 st %g1, [ %i1 + 0xa8 ] the_thread->current_state = STATES_DORMANT; 200a2c8: 82 10 20 01 mov 1, %g1 200a2cc: c2 26 60 10 st %g1, [ %i1 + 0x10 ] */ RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate( Thread_Control *the_thread ) { return _Scheduler.Operations.allocate( the_thread ); 200a2d0: 03 00 80 6e sethi %hi(0x201b800), %g1 200a2d4: c2 00 62 54 ld [ %g1 + 0x254 ], %g1 ! 201ba54 <_Scheduler+0x18> the_thread->Wait.queue = NULL; the_thread->resource_count = 0; the_thread->real_priority = priority; 200a2d8: fa 26 60 18 st %i5, [ %i1 + 0x18 ] the_thread->Start.initial_priority = priority; 200a2dc: fa 26 60 ac st %i5, [ %i1 + 0xac ] 200a2e0: 9f c0 40 00 call %g1 200a2e4: 90 10 00 19 mov %i1, %o0 sched =_Scheduler_Allocate( the_thread ); if ( !sched ) 200a2e8: b4 92 20 00 orcc %o0, 0, %i2 200a2ec: 02 80 00 15 be 200a340 <_Thread_Initialize+0x178> 200a2f0: 90 10 00 19 mov %i1, %o0 goto failed; _Thread_Set_priority( the_thread, priority ); 200a2f4: 40 00 01 9b call 200a960 <_Thread_Set_priority> 200a2f8: 92 10 00 1d mov %i5, %o1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 200a2fc: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 200a300: c2 16 60 0a lduh [ %i1 + 0xa ], %g1 static inline void _Timestamp64_implementation_Set_to_zero( Timestamp64_Control *_time ) { *_time = 0; 200a304: c0 26 60 80 clr [ %i1 + 0x80 ] 200a308: c0 26 60 84 clr [ %i1 + 0x84 ] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 200a30c: 83 28 60 02 sll %g1, 2, %g1 200a310: f2 20 80 01 st %i1, [ %g2 + %g1 ] information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 200a314: e0 26 60 0c st %l0, [ %i1 + 0xc ] * enabled when we get here. We want to be able to run the * user extensions with dispatching enabled. The Allocator * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); 200a318: 90 10 00 19 mov %i1, %o0 200a31c: 40 00 02 59 call 200ac80 <_User_extensions_Thread_create> 200a320: b0 10 20 01 mov 1, %i0 if ( extension_status ) 200a324: 80 8a 20 ff btst 0xff, %o0 200a328: 02 80 00 06 be 200a340 <_Thread_Initialize+0x178> 200a32c: 01 00 00 00 nop 200a330: b0 0e 20 01 and %i0, 1, %i0 200a334: 81 c7 e0 08 ret 200a338: 81 e8 00 00 restore 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; 200a33c: b4 10 20 00 clr %i2 extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; failed: _Workspace_Free( the_thread->libc_reent ); 200a340: 40 00 03 6e call 200b0f8 <_Workspace_Free> 200a344: d0 06 61 4c ld [ %i1 + 0x14c ], %o0 for ( i=0 ; i <= THREAD_API_LAST ; i++ ) _Workspace_Free( the_thread->API_Extensions[i] ); 200a348: 40 00 03 6c call 200b0f8 <_Workspace_Free> 200a34c: d0 06 61 50 ld [ %i1 + 0x150 ], %o0 200a350: 40 00 03 6a call 200b0f8 <_Workspace_Free> 200a354: d0 06 61 54 ld [ %i1 + 0x154 ], %o0 _Workspace_Free( extensions_area ); 200a358: 40 00 03 68 call 200b0f8 <_Workspace_Free> 200a35c: 90 10 00 1c mov %i4, %o0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); 200a360: 40 00 03 66 call 200b0f8 <_Workspace_Free> 200a364: 90 10 00 1b mov %i3, %o0 #endif _Workspace_Free( sched ); 200a368: 40 00 03 64 call 200b0f8 <_Workspace_Free> 200a36c: 90 10 00 1a mov %i2, %o0 _Thread_Stack_Free( the_thread ); 200a370: 40 00 01 b5 call 200aa44 <_Thread_Stack_Free> 200a374: 90 10 00 19 mov %i1, %o0 * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ 200a378: b0 10 20 00 clr %i0 _Workspace_Free( sched ); _Thread_Stack_Free( the_thread ); return false; } 200a37c: b0 0e 20 01 and %i0, 1, %i0 200a380: 81 c7 e0 08 ret 200a384: 81 e8 00 00 restore =============================================================================== 0200a8a8 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 200a8a8: 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 ) 200a8ac: 80 a6 20 00 cmp %i0, 0 200a8b0: 02 80 00 19 be 200a914 <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN 200a8b4: 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 ) { 200a8b8: f8 06 20 34 ld [ %i0 + 0x34 ], %i4 200a8bc: 80 a7 20 01 cmp %i4, 1 200a8c0: 12 80 00 15 bne 200a914 <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN 200a8c4: 01 00 00 00 nop Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 200a8c8: 7f ff df 49 call 20025ec 200a8cc: 01 00 00 00 nop 200a8d0: ba 10 00 08 mov %o0, %i5 200a8d4: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 200a8d8: 03 00 00 ef sethi %hi(0x3bc00), %g1 200a8dc: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 200a8e0: 80 88 80 01 btst %g2, %g1 200a8e4: 02 80 00 0a be 200a90c <_Thread_queue_Requeue+0x64> <== NEVER TAKEN 200a8e8: 90 10 00 18 mov %i0, %o0 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 200a8ec: 92 10 00 19 mov %i1, %o1 200a8f0: 94 10 20 01 mov 1, %o2 200a8f4: 40 00 0a cf call 200d430 <_Thread_queue_Extract_priority_helper> 200a8f8: f8 26 20 30 st %i4, [ %i0 + 0x30 ] (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 200a8fc: 90 10 00 18 mov %i0, %o0 200a900: 92 10 00 19 mov %i1, %o1 200a904: 7f ff ff 50 call 200a644 <_Thread_queue_Enqueue_priority> 200a908: 94 07 bf fc add %fp, -4, %o2 } _ISR_Enable( level ); 200a90c: 7f ff df 3c call 20025fc 200a910: 90 10 00 1d mov %i5, %o0 200a914: 81 c7 e0 08 ret 200a918: 81 e8 00 00 restore =============================================================================== 0200a91c <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 200a91c: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 200a920: 90 10 00 18 mov %i0, %o0 200a924: 7f ff fd fd call 200a118 <_Thread_Get> 200a928: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 200a92c: c2 07 bf fc ld [ %fp + -4 ], %g1 200a930: 80 a0 60 00 cmp %g1, 0 200a934: 12 80 00 09 bne 200a958 <_Thread_queue_Timeout+0x3c> <== NEVER TAKEN 200a938: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 200a93c: 40 00 0a f4 call 200d50c <_Thread_queue_Process_timeout> 200a940: 01 00 00 00 nop * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 200a944: 03 00 80 71 sethi %hi(0x201c400), %g1 200a948: c4 00 62 b0 ld [ %g1 + 0x2b0 ], %g2 ! 201c6b0 <_Thread_Dispatch_disable_level> 200a94c: 84 00 bf ff add %g2, -1, %g2 200a950: c4 20 62 b0 st %g2, [ %g1 + 0x2b0 ] return _Thread_Dispatch_disable_level; 200a954: c2 00 62 b0 ld [ %g1 + 0x2b0 ], %g1 200a958: 81 c7 e0 08 ret 200a95c: 81 e8 00 00 restore =============================================================================== 020188e0 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 20188e0: 9d e3 bf 88 save %sp, -120, %sp static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 20188e4: 25 00 80 ed sethi %hi(0x203b400), %l2 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 20188e8: a6 07 bf e8 add %fp, -24, %l3 20188ec: a2 07 bf ec add %fp, -20, %l1 20188f0: b8 07 bf f4 add %fp, -12, %i4 20188f4: b6 07 bf f8 add %fp, -8, %i3 20188f8: e2 27 bf e8 st %l1, [ %fp + -24 ] head->previous = NULL; 20188fc: c0 27 bf ec clr [ %fp + -20 ] tail->previous = head; 2018900: e6 27 bf f0 st %l3, [ %fp + -16 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 2018904: f6 27 bf f4 st %i3, [ %fp + -12 ] head->previous = NULL; 2018908: c0 27 bf f8 clr [ %fp + -8 ] tail->previous = head; 201890c: f8 27 bf fc st %i4, [ %fp + -4 ] */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 2018910: b4 06 20 30 add %i0, 0x30, %i2 /* * 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 ); 2018914: ba 06 20 68 add %i0, 0x68, %i5 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 2018918: a0 06 20 08 add %i0, 8, %l0 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 201891c: b2 06 20 40 add %i0, 0x40, %i1 { /* * 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; 2018920: e6 26 20 78 st %l3, [ %i0 + 0x78 ] 2018924: 29 00 80 ed sethi %hi(0x203b400), %l4 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 2018928: c2 04 a2 90 ld [ %l2 + 0x290 ], %g1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 201892c: d2 06 20 3c ld [ %i0 + 0x3c ], %o1 watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 2018930: 90 10 00 1a mov %i2, %o0 2018934: 92 20 40 09 sub %g1, %o1, %o1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 2018938: c2 26 20 3c st %g1, [ %i0 + 0x3c ] _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 201893c: 40 00 11 77 call 201cf18 <_Watchdog_Adjust_to_chain> 2018940: 94 10 00 1c mov %i4, %o2 2018944: d0 1d 22 10 ldd [ %l4 + 0x210 ], %o0 2018948: 94 10 20 00 clr %o2 201894c: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 2018950: 40 00 4b b2 call 202b818 <__divdi3> 2018954: 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; 2018958: 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 ) { 201895c: 80 a2 40 0a cmp %o1, %o2 2018960: 08 80 00 07 bleu 201897c <_Timer_server_Body+0x9c> 2018964: aa 10 00 09 mov %o1, %l5 /* * 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 ); 2018968: 92 22 40 0a sub %o1, %o2, %o1 201896c: 90 10 00 1d mov %i5, %o0 2018970: 40 00 11 6a call 201cf18 <_Watchdog_Adjust_to_chain> 2018974: 94 10 00 1c mov %i4, %o2 2018978: 30 80 00 06 b,a 2018990 <_Timer_server_Body+0xb0> } else if ( snapshot < last_snapshot ) { 201897c: 1a 80 00 05 bcc 2018990 <_Timer_server_Body+0xb0> 2018980: 90 10 00 1d mov %i5, %o0 /* * 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 ); 2018984: 92 10 20 01 mov 1, %o1 2018988: 40 00 11 3d call 201ce7c <_Watchdog_Adjust> 201898c: 94 22 80 15 sub %o2, %l5, %o2 } watchdogs->last_snapshot = snapshot; 2018990: ea 26 20 74 st %l5, [ %i0 + 0x74 ] } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 2018994: d0 06 20 78 ld [ %i0 + 0x78 ], %o0 2018998: 40 00 02 bf call 2019494 <_Chain_Get> 201899c: 01 00 00 00 nop if ( timer == NULL ) { 20189a0: 92 92 20 00 orcc %o0, 0, %o1 20189a4: 02 80 00 0c be 20189d4 <_Timer_server_Body+0xf4> 20189a8: 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 ) { 20189ac: c2 02 60 38 ld [ %o1 + 0x38 ], %g1 20189b0: 80 a0 60 01 cmp %g1, 1 20189b4: 02 80 00 05 be 20189c8 <_Timer_server_Body+0xe8> 20189b8: 90 10 00 1a mov %i2, %o0 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 20189bc: 80 a0 60 03 cmp %g1, 3 20189c0: 12 bf ff f5 bne 2018994 <_Timer_server_Body+0xb4> <== NEVER TAKEN 20189c4: 90 10 00 1d mov %i5, %o0 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 20189c8: 40 00 11 86 call 201cfe0 <_Watchdog_Insert> 20189cc: 92 02 60 10 add %o1, 0x10, %o1 20189d0: 30 bf ff f1 b,a 2018994 <_Timer_server_Body+0xb4> * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 20189d4: 7f ff de df call 2010550 20189d8: 01 00 00 00 nop if ( _Chain_Is_empty( insert_chain ) ) { 20189dc: c2 07 bf e8 ld [ %fp + -24 ], %g1 20189e0: 80 a0 40 11 cmp %g1, %l1 20189e4: 12 80 00 0a bne 2018a0c <_Timer_server_Body+0x12c> <== NEVER TAKEN 20189e8: 01 00 00 00 nop ts->insert_chain = NULL; 20189ec: c0 26 20 78 clr [ %i0 + 0x78 ] _ISR_Enable( level ); 20189f0: 7f ff de dc call 2010560 20189f4: 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 ) ) { 20189f8: c2 07 bf f4 ld [ %fp + -12 ], %g1 20189fc: 80 a0 40 1b cmp %g1, %i3 2018a00: 12 80 00 06 bne 2018a18 <_Timer_server_Body+0x138> 2018a04: 01 00 00 00 nop 2018a08: 30 80 00 18 b,a 2018a68 <_Timer_server_Body+0x188> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 2018a0c: 7f ff de d5 call 2010560 <== NOT EXECUTED 2018a10: 01 00 00 00 nop <== NOT EXECUTED 2018a14: 30 bf ff c5 b,a 2018928 <_Timer_server_Body+0x48> <== NOT EXECUTED /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 2018a18: 7f ff de ce call 2010550 2018a1c: 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; 2018a20: e8 07 bf f4 ld [ %fp + -12 ], %l4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 2018a24: 80 a5 00 1b cmp %l4, %i3 2018a28: 02 80 00 0d be 2018a5c <_Timer_server_Body+0x17c> 2018a2c: 01 00 00 00 nop Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 2018a30: c2 05 00 00 ld [ %l4 ], %g1 head->next = new_first; new_first->previous = head; 2018a34: 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; 2018a38: c2 27 bf f4 st %g1, [ %fp + -12 ] watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 2018a3c: c0 25 20 08 clr [ %l4 + 8 ] _ISR_Enable( level ); 2018a40: 7f ff de c8 call 2010560 2018a44: 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 ); 2018a48: c2 05 20 1c ld [ %l4 + 0x1c ], %g1 2018a4c: d0 05 20 20 ld [ %l4 + 0x20 ], %o0 2018a50: 9f c0 40 00 call %g1 2018a54: d2 05 20 24 ld [ %l4 + 0x24 ], %o1 } 2018a58: 30 bf ff f0 b,a 2018a18 <_Timer_server_Body+0x138> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 2018a5c: 7f ff de c1 call 2010560 2018a60: 01 00 00 00 nop 2018a64: 30 bf ff af b,a 2018920 <_Timer_server_Body+0x40> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 2018a68: c0 2e 20 7c clrb [ %i0 + 0x7c ] /* * Block until there is something to do. */ _Thread_Disable_dispatch(); 2018a6c: 7f ff ff 6e call 2018824 <_Thread_Disable_dispatch> 2018a70: 01 00 00 00 nop _Thread_Set_state( ts->thread, STATES_DELAYING ); 2018a74: d0 06 00 00 ld [ %i0 ], %o0 2018a78: 40 00 0f e2 call 201ca00 <_Thread_Set_state> 2018a7c: 92 10 20 08 mov 8, %o1 _Timer_server_Reset_interval_system_watchdog( ts ); 2018a80: 7f ff ff 70 call 2018840 <_Timer_server_Reset_interval_system_watchdog> 2018a84: 90 10 00 18 mov %i0, %o0 _Timer_server_Reset_tod_system_watchdog( ts ); 2018a88: 7f ff ff 82 call 2018890 <_Timer_server_Reset_tod_system_watchdog> 2018a8c: 90 10 00 18 mov %i0, %o0 _Thread_Enable_dispatch(); 2018a90: 40 00 0d 92 call 201c0d8 <_Thread_Enable_dispatch> 2018a94: 01 00 00 00 nop ts->active = true; 2018a98: 82 10 20 01 mov 1, %g1 ! 1 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 2018a9c: 90 10 00 10 mov %l0, %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; 2018aa0: c2 2e 20 7c stb %g1, [ %i0 + 0x7c ] static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 2018aa4: 40 00 11 a9 call 201d148 <_Watchdog_Remove> 2018aa8: 01 00 00 00 nop static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 2018aac: 40 00 11 a7 call 201d148 <_Watchdog_Remove> 2018ab0: 90 10 00 19 mov %i1, %o0 2018ab4: 30 bf ff 9b b,a 2018920 <_Timer_server_Body+0x40> =============================================================================== 02018ab8 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 2018ab8: 9d e3 bf a0 save %sp, -96, %sp if ( ts->insert_chain == NULL ) { 2018abc: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 2018ac0: 80 a0 60 00 cmp %g1, 0 2018ac4: 12 80 00 4e bne 2018bfc <_Timer_server_Schedule_operation_method+0x144> 2018ac8: ba 10 00 19 mov %i1, %i5 * is the reference point for the delta chain. Thus if we do not update the * reference point we have to add DT to the initial delta of the watchdog * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); 2018acc: 7f ff ff 56 call 2018824 <_Thread_Disable_dispatch> 2018ad0: 01 00 00 00 nop if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 2018ad4: c2 06 60 38 ld [ %i1 + 0x38 ], %g1 2018ad8: 80 a0 60 01 cmp %g1, 1 2018adc: 12 80 00 1f bne 2018b58 <_Timer_server_Schedule_operation_method+0xa0> 2018ae0: 80 a0 60 03 cmp %g1, 3 /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 2018ae4: 7f ff de 9b call 2010550 2018ae8: 01 00 00 00 nop snapshot = _Watchdog_Ticks_since_boot; 2018aec: 03 00 80 ed sethi %hi(0x203b400), %g1 2018af0: c4 00 62 90 ld [ %g1 + 0x290 ], %g2 ! 203b690 <_Watchdog_Ticks_since_boot> */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 2018af4: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 2018af8: 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 ); 2018afc: 86 06 20 34 add %i0, 0x34, %g3 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 2018b00: 80 a0 40 03 cmp %g1, %g3 2018b04: 02 80 00 08 be 2018b24 <_Timer_server_Schedule_operation_method+0x6c> 2018b08: 88 20 80 04 sub %g2, %g4, %g4 /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 2018b0c: f8 00 60 10 ld [ %g1 + 0x10 ], %i4 if (delta_interval > delta) { 2018b10: 80 a7 00 04 cmp %i4, %g4 2018b14: 08 80 00 03 bleu 2018b20 <_Timer_server_Schedule_operation_method+0x68> 2018b18: 86 10 20 00 clr %g3 delta_interval -= delta; 2018b1c: 86 27 00 04 sub %i4, %g4, %g3 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 2018b20: c6 20 60 10 st %g3, [ %g1 + 0x10 ] } ts->Interval_watchdogs.last_snapshot = snapshot; 2018b24: c4 26 20 3c st %g2, [ %i0 + 0x3c ] _ISR_Enable( level ); 2018b28: 7f ff de 8e call 2010560 2018b2c: 01 00 00 00 nop _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 2018b30: 90 06 20 30 add %i0, 0x30, %o0 2018b34: 40 00 11 2b call 201cfe0 <_Watchdog_Insert> 2018b38: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 2018b3c: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 2018b40: 80 a0 60 00 cmp %g1, 0 2018b44: 12 80 00 2c bne 2018bf4 <_Timer_server_Schedule_operation_method+0x13c> 2018b48: 01 00 00 00 nop _Timer_server_Reset_interval_system_watchdog( ts ); 2018b4c: 7f ff ff 3d call 2018840 <_Timer_server_Reset_interval_system_watchdog> 2018b50: 90 10 00 18 mov %i0, %o0 2018b54: 30 80 00 28 b,a 2018bf4 <_Timer_server_Schedule_operation_method+0x13c> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 2018b58: 12 80 00 27 bne 2018bf4 <_Timer_server_Schedule_operation_method+0x13c> 2018b5c: 01 00 00 00 nop /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 2018b60: 7f ff de 7c call 2010550 2018b64: 01 00 00 00 nop 2018b68: b8 10 00 08 mov %o0, %i4 2018b6c: 03 00 80 ed sethi %hi(0x203b400), %g1 2018b70: d0 18 62 10 ldd [ %g1 + 0x210 ], %o0 ! 203b610 <_TOD_Now> 2018b74: 94 10 20 00 clr %o2 2018b78: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 2018b7c: 40 00 4b 27 call 202b818 <__divdi3> 2018b80: 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; 2018b84: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; 2018b88: c8 06 20 74 ld [ %i0 + 0x74 ], %g4 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 2018b8c: 84 06 20 6c add %i0, 0x6c, %g2 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 2018b90: 80 a0 40 02 cmp %g1, %g2 2018b94: 02 80 00 0c be 2018bc4 <_Timer_server_Schedule_operation_method+0x10c> 2018b98: 80 a2 40 04 cmp %o1, %g4 first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 2018b9c: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 2018ba0: 84 00 c0 04 add %g3, %g4, %g2 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; if ( snapshot > last_snapshot ) { 2018ba4: 08 80 00 07 bleu 2018bc0 <_Timer_server_Schedule_operation_method+0x108> 2018ba8: 84 20 80 09 sub %g2, %o1, %g2 /* * We advanced in time. */ delta = snapshot - last_snapshot; 2018bac: 88 22 40 04 sub %o1, %g4, %g4 if (delta_interval > delta) { 2018bb0: 80 a0 c0 04 cmp %g3, %g4 2018bb4: 08 80 00 03 bleu 2018bc0 <_Timer_server_Schedule_operation_method+0x108><== NEVER TAKEN 2018bb8: 84 10 20 00 clr %g2 delta_interval -= delta; 2018bbc: 84 20 c0 04 sub %g3, %g4, %g2 * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 2018bc0: c4 20 60 10 st %g2, [ %g1 + 0x10 ] } ts->TOD_watchdogs.last_snapshot = snapshot; 2018bc4: d2 26 20 74 st %o1, [ %i0 + 0x74 ] _ISR_Enable( level ); 2018bc8: 7f ff de 66 call 2010560 2018bcc: 90 10 00 1c mov %i4, %o0 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 2018bd0: 90 06 20 68 add %i0, 0x68, %o0 2018bd4: 40 00 11 03 call 201cfe0 <_Watchdog_Insert> 2018bd8: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 2018bdc: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 2018be0: 80 a0 60 00 cmp %g1, 0 2018be4: 12 80 00 04 bne 2018bf4 <_Timer_server_Schedule_operation_method+0x13c> 2018be8: 01 00 00 00 nop _Timer_server_Reset_tod_system_watchdog( ts ); 2018bec: 7f ff ff 29 call 2018890 <_Timer_server_Reset_tod_system_watchdog> 2018bf0: 90 10 00 18 mov %i0, %o0 } } _Thread_Enable_dispatch(); 2018bf4: 40 00 0d 39 call 201c0d8 <_Thread_Enable_dispatch> 2018bf8: 81 e8 00 00 restore * 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 ); 2018bfc: f0 06 20 78 ld [ %i0 + 0x78 ], %i0 2018c00: 40 00 02 1a call 2019468 <_Chain_Append> 2018c04: 81 e8 00 00 restore =============================================================================== 0200a46c <_Timespec_Divide>: const struct timespec *lhs, const struct timespec *rhs, uint32_t *ival_percentage, uint32_t *fval_percentage ) { 200a46c: 9d e3 bf a0 save %sp, -96, %sp * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; left += lhs->tv_nsec; right = rhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 200a470: d6 06 40 00 ld [ %i1 ], %o3 const struct timespec *lhs, const struct timespec *rhs, uint32_t *ival_percentage, uint32_t *fval_percentage ) { 200a474: a0 10 00 1a mov %i2, %l0 * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; left += lhs->tv_nsec; right = rhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 200a478: 95 3a e0 1f sra %o3, 0x1f, %o2 200a47c: b9 2a a0 03 sll %o2, 3, %i4 200a480: 87 2a e0 03 sll %o3, 3, %g3 200a484: b5 32 e0 1d srl %o3, 0x1d, %i2 200a488: 9b 28 e0 05 sll %g3, 5, %o5 200a48c: 84 16 80 1c or %i2, %i4, %g2 200a490: b9 30 e0 1b srl %g3, 0x1b, %i4 200a494: 99 28 a0 05 sll %g2, 5, %o4 200a498: 86 a3 40 03 subcc %o5, %g3, %g3 200a49c: 98 17 00 0c or %i4, %o4, %o4 200a4a0: 84 63 00 02 subx %o4, %g2, %g2 200a4a4: b9 30 e0 1a srl %g3, 0x1a, %i4 200a4a8: 99 28 a0 06 sll %g2, 6, %o4 200a4ac: 9b 28 e0 06 sll %g3, 6, %o5 200a4b0: 98 17 00 0c or %i4, %o4, %o4 200a4b4: 9a a3 40 03 subcc %o5, %g3, %o5 200a4b8: 98 63 00 02 subx %o4, %g2, %o4 200a4bc: 96 83 40 0b addcc %o5, %o3, %o3 200a4c0: 85 32 e0 1e srl %o3, 0x1e, %g2 200a4c4: 94 43 00 0a addx %o4, %o2, %o2 const struct timespec *lhs, const struct timespec *rhs, uint32_t *ival_percentage, uint32_t *fval_percentage ) { 200a4c8: a2 10 00 1b mov %i3, %l1 * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; left += lhs->tv_nsec; right = rhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 200a4cc: b5 2a a0 02 sll %o2, 2, %i2 200a4d0: b7 2a e0 02 sll %o3, 2, %i3 200a4d4: b4 10 80 1a or %g2, %i2, %i2 200a4d8: 96 82 c0 1b addcc %o3, %i3, %o3 200a4dc: 94 42 80 1a addx %o2, %i2, %o2 200a4e0: 85 32 e0 1e srl %o3, 0x1e, %g2 200a4e4: b9 2a a0 02 sll %o2, 2, %i4 200a4e8: bb 2a e0 02 sll %o3, 2, %i5 200a4ec: b8 10 80 1c or %g2, %i4, %i4 200a4f0: 96 82 c0 1d addcc %o3, %i5, %o3 200a4f4: 94 42 80 1c addx %o2, %i4, %o2 200a4f8: 85 32 e0 1e srl %o3, 0x1e, %g2 200a4fc: b9 2a a0 02 sll %o2, 2, %i4 200a500: bb 2a e0 02 sll %o3, 2, %i5 200a504: b8 10 80 1c or %g2, %i4, %i4 200a508: 96 82 c0 1d addcc %o3, %i5, %o3 200a50c: 94 42 80 1c addx %o2, %i4, %o2 200a510: 87 2a a0 09 sll %o2, 9, %g3 200a514: b9 32 e0 17 srl %o3, 0x17, %i4 200a518: 94 17 00 03 or %i4, %g3, %o2 right += rhs->tv_nsec; 200a51c: c6 06 60 04 ld [ %i1 + 4 ], %g3 * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; left += lhs->tv_nsec; right = rhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 200a520: 85 2a e0 09 sll %o3, 9, %g2 /* * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 200a524: c2 06 00 00 ld [ %i0 ], %g1 left += lhs->tv_nsec; right = rhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 200a528: 96 10 00 02 mov %g2, %o3 /* * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; left += lhs->tv_nsec; 200a52c: c8 06 20 04 ld [ %i0 + 4 ], %g4 right = rhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; right += rhs->tv_nsec; 200a530: b2 82 c0 03 addcc %o3, %g3, %i1 200a534: 85 38 e0 1f sra %g3, 0x1f, %g2 200a538: b0 42 80 02 addx %o2, %g2, %i0 if ( right == 0 ) { 200a53c: 80 96 00 19 orcc %i0, %i1, %g0 200a540: 32 80 00 06 bne,a 200a558 <_Timespec_Divide+0xec> <== NEVER TAKEN 200a544: 96 10 00 01 mov %g1, %o3 <== NOT EXECUTED *ival_percentage = 0; 200a548: c0 24 00 00 clr [ %l0 ] *fval_percentage = 0; 200a54c: c0 24 40 00 clr [ %l1 ] return; 200a550: 81 c7 e0 08 ret 200a554: 81 e8 00 00 restore /* * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 200a558: 95 38 60 1f sra %g1, 0x1f, %o2 <== NOT EXECUTED 200a55c: b9 30 60 1d srl %g1, 0x1d, %i4 <== NOT EXECUTED 200a560: 83 2a a0 03 sll %o2, 3, %g1 <== NOT EXECUTED 200a564: 87 2a e0 03 sll %o3, 3, %g3 <== NOT EXECUTED 200a568: 84 17 00 01 or %i4, %g1, %g2 <== NOT EXECUTED 200a56c: 83 30 e0 1b srl %g3, 0x1b, %g1 <== NOT EXECUTED 200a570: 99 28 a0 05 sll %g2, 5, %o4 <== NOT EXECUTED 200a574: 9b 28 e0 05 sll %g3, 5, %o5 <== NOT EXECUTED 200a578: 98 10 40 0c or %g1, %o4, %o4 <== NOT EXECUTED 200a57c: 9a a3 40 03 subcc %o5, %g3, %o5 <== NOT EXECUTED 200a580: 83 33 60 1a srl %o5, 0x1a, %g1 <== NOT EXECUTED 200a584: 98 63 00 02 subx %o4, %g2, %o4 <== NOT EXECUTED 200a588: 87 2b 60 06 sll %o5, 6, %g3 <== NOT EXECUTED 200a58c: 85 2b 20 06 sll %o4, 6, %g2 <== NOT EXECUTED 200a590: 92 a0 c0 0d subcc %g3, %o5, %o1 <== NOT EXECUTED 200a594: 84 10 40 02 or %g1, %g2, %g2 <== NOT EXECUTED 200a598: 90 60 80 0c subx %g2, %o4, %o0 <== NOT EXECUTED 200a59c: 92 82 40 0b addcc %o1, %o3, %o1 <== NOT EXECUTED 200a5a0: 83 32 60 1e srl %o1, 0x1e, %g1 <== NOT EXECUTED 200a5a4: 90 42 00 0a addx %o0, %o2, %o0 <== NOT EXECUTED 200a5a8: b7 2a 60 02 sll %o1, 2, %i3 <== NOT EXECUTED 200a5ac: b5 2a 20 02 sll %o0, 2, %i2 <== NOT EXECUTED 200a5b0: 92 82 40 1b addcc %o1, %i3, %o1 <== NOT EXECUTED 200a5b4: b4 10 40 1a or %g1, %i2, %i2 <== NOT EXECUTED 200a5b8: 83 32 60 1e srl %o1, 0x1e, %g1 <== NOT EXECUTED 200a5bc: 90 42 00 1a addx %o0, %i2, %o0 <== NOT EXECUTED 200a5c0: bb 2a 60 02 sll %o1, 2, %i5 <== NOT EXECUTED 200a5c4: b9 2a 20 02 sll %o0, 2, %i4 <== NOT EXECUTED 200a5c8: 92 82 40 1d addcc %o1, %i5, %o1 <== NOT EXECUTED 200a5cc: b8 10 40 1c or %g1, %i4, %i4 <== NOT EXECUTED 200a5d0: 83 32 60 1e srl %o1, 0x1e, %g1 <== NOT EXECUTED 200a5d4: 90 42 00 1c addx %o0, %i4, %o0 <== NOT EXECUTED 200a5d8: bb 2a 60 02 sll %o1, 2, %i5 <== NOT EXECUTED 200a5dc: b9 2a 20 02 sll %o0, 2, %i4 <== NOT EXECUTED 200a5e0: 92 82 40 1d addcc %o1, %i5, %o1 <== NOT EXECUTED 200a5e4: b8 10 40 1c or %g1, %i4, %i4 <== NOT EXECUTED 200a5e8: 83 2a 60 09 sll %o1, 9, %g1 <== NOT EXECUTED 200a5ec: 90 42 00 1c addx %o0, %i4, %o0 <== NOT EXECUTED left += lhs->tv_nsec; 200a5f0: 95 39 20 1f sra %g4, 0x1f, %o2 <== NOT EXECUTED 200a5f4: 96 80 40 04 addcc %g1, %g4, %o3 <== NOT EXECUTED /* * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 200a5f8: 87 32 60 17 srl %o1, 0x17, %g3 <== NOT EXECUTED 200a5fc: 85 2a 20 09 sll %o0, 9, %g2 <== NOT EXECUTED 200a600: 90 10 c0 02 or %g3, %g2, %o0 <== NOT EXECUTED left += lhs->tv_nsec; 200a604: 94 42 00 0a addx %o0, %o2, %o2 <== NOT EXECUTED * Put it back in the timespec result. * * TODO: Rounding on the last digit of the fval. */ answer = (left * 100000) / right; 200a608: 83 2a a0 02 sll %o2, 2, %g1 <== NOT EXECUTED 200a60c: 9b 2a e0 02 sll %o3, 2, %o5 <== NOT EXECUTED 200a610: 85 32 e0 1e srl %o3, 0x1e, %g2 <== NOT EXECUTED 200a614: 98 10 80 01 or %g2, %g1, %o4 <== NOT EXECUTED 200a618: 83 33 60 1b srl %o5, 0x1b, %g1 <== NOT EXECUTED 200a61c: 85 2b 20 05 sll %o4, 5, %g2 <== NOT EXECUTED 200a620: 87 2b 60 05 sll %o5, 5, %g3 <== NOT EXECUTED 200a624: 84 10 40 02 or %g1, %g2, %g2 <== NOT EXECUTED 200a628: 86 a0 c0 0d subcc %g3, %o5, %g3 <== NOT EXECUTED 200a62c: 84 60 80 0c subx %g2, %o4, %g2 <== NOT EXECUTED 200a630: 96 80 c0 0b addcc %g3, %o3, %o3 <== NOT EXECUTED 200a634: 83 32 e0 1e srl %o3, 0x1e, %g1 <== NOT EXECUTED 200a638: 94 40 80 0a addx %g2, %o2, %o2 <== NOT EXECUTED 200a63c: bb 2a e0 02 sll %o3, 2, %i5 <== NOT EXECUTED 200a640: b9 2a a0 02 sll %o2, 2, %i4 <== NOT EXECUTED 200a644: ba 82 c0 1d addcc %o3, %i5, %i5 <== NOT EXECUTED 200a648: b8 10 40 1c or %g1, %i4, %i4 <== NOT EXECUTED 200a64c: 83 37 60 1e srl %i5, 0x1e, %g1 <== NOT EXECUTED 200a650: b8 42 80 1c addx %o2, %i4, %i4 <== NOT EXECUTED 200a654: 93 2f 60 02 sll %i5, 2, %o1 <== NOT EXECUTED 200a658: 91 2f 20 02 sll %i4, 2, %o0 <== NOT EXECUTED 200a65c: 92 87 40 09 addcc %i5, %o1, %o1 <== NOT EXECUTED 200a660: 90 10 40 08 or %g1, %o0, %o0 <== NOT EXECUTED 200a664: 87 32 60 1b srl %o1, 0x1b, %g3 <== NOT EXECUTED 200a668: 90 47 00 08 addx %i4, %o0, %o0 <== NOT EXECUTED 200a66c: 83 2a 60 05 sll %o1, 5, %g1 <== NOT EXECUTED 200a670: 85 2a 20 05 sll %o0, 5, %g2 <== NOT EXECUTED 200a674: 92 10 00 01 mov %g1, %o1 <== NOT EXECUTED 200a678: 90 10 c0 02 or %g3, %g2, %o0 <== NOT EXECUTED 200a67c: 94 10 00 18 mov %i0, %o2 <== NOT EXECUTED 200a680: 40 00 37 12 call 20182c8 <__udivdi3> <== NOT EXECUTED 200a684: 96 10 00 19 mov %i1, %o3 <== NOT EXECUTED *ival_percentage = answer / 1000; 200a688: 94 10 20 00 clr %o2 <== NOT EXECUTED * Put it back in the timespec result. * * TODO: Rounding on the last digit of the fval. */ answer = (left * 100000) / right; 200a68c: b4 10 00 08 mov %o0, %i2 <== NOT EXECUTED 200a690: b8 10 00 09 mov %o1, %i4 <== NOT EXECUTED *ival_percentage = answer / 1000; 200a694: 40 00 37 0d call 20182c8 <__udivdi3> <== NOT EXECUTED 200a698: 96 10 23 e8 mov 0x3e8, %o3 <== NOT EXECUTED *fval_percentage = answer % 1000; 200a69c: 90 10 00 1a mov %i2, %o0 <== NOT EXECUTED * TODO: Rounding on the last digit of the fval. */ answer = (left * 100000) / right; *ival_percentage = answer / 1000; 200a6a0: d2 24 00 00 st %o1, [ %l0 ] <== NOT EXECUTED *fval_percentage = answer % 1000; 200a6a4: 94 10 20 00 clr %o2 <== NOT EXECUTED 200a6a8: 92 10 00 1c mov %i4, %o1 <== NOT EXECUTED 200a6ac: 40 00 37 dc call 201861c <__umoddi3> <== NOT EXECUTED 200a6b0: 96 10 23 e8 mov 0x3e8, %o3 <== NOT EXECUTED 200a6b4: d2 24 40 00 st %o1, [ %l1 ] <== NOT EXECUTED 200a6b8: 81 c7 e0 08 ret <== NOT EXECUTED 200a6bc: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 0200a6c0 <_Timespec_Less_than>: bool _Timespec_Less_than( const struct timespec *lhs, const struct timespec *rhs ) { if ( lhs->tv_sec < rhs->tv_sec ) 200a6c0: c6 02 00 00 ld [ %o0 ], %g3 200a6c4: c4 02 40 00 ld [ %o1 ], %g2 200a6c8: 80 a0 c0 02 cmp %g3, %g2 200a6cc: 06 80 00 0b bl 200a6f8 <_Timespec_Less_than+0x38> <== NEVER TAKEN 200a6d0: 82 10 20 01 mov 1, %g1 return true; if ( lhs->tv_sec > rhs->tv_sec ) 200a6d4: 80 a0 c0 02 cmp %g3, %g2 200a6d8: 14 80 00 08 bg 200a6f8 <_Timespec_Less_than+0x38> 200a6dc: 82 10 20 00 clr %g1 #include #include #include bool _Timespec_Less_than( 200a6e0: c6 02 20 04 ld [ %o0 + 4 ], %g3 200a6e4: c4 02 60 04 ld [ %o1 + 4 ], %g2 200a6e8: 80 a0 c0 02 cmp %g3, %g2 200a6ec: 06 80 00 03 bl 200a6f8 <_Timespec_Less_than+0x38> <== NEVER TAKEN 200a6f0: 82 10 20 01 mov 1, %g1 200a6f4: 82 10 20 00 clr %g1 /* ASSERT: lhs->tv_sec == rhs->tv_sec */ if ( lhs->tv_nsec < rhs->tv_nsec ) return true; return false; } 200a6f8: 81 c3 e0 08 retl 200a6fc: 90 08 60 01 and %g1, 1, %o0 =============================================================================== 0200b8b4 <_Timespec_Subtract>: const struct timespec *end, struct timespec *result ) { if (end->tv_nsec < start->tv_nsec) { 200b8b4: c4 02 60 04 ld [ %o1 + 4 ], %g2 200b8b8: c2 02 20 04 ld [ %o0 + 4 ], %g1 200b8bc: c8 02 40 00 ld [ %o1 ], %g4 200b8c0: c6 02 00 00 ld [ %o0 ], %g3 200b8c4: 80 a0 80 01 cmp %g2, %g1 200b8c8: 16 80 00 08 bge 200b8e8 <_Timespec_Subtract+0x34> <== ALWAYS TAKEN 200b8cc: 86 21 00 03 sub %g4, %g3, %g3 result->tv_sec = end->tv_sec - start->tv_sec - 1; 200b8d0: 86 00 ff ff add %g3, -1, %g3 <== NOT EXECUTED 200b8d4: c6 22 80 00 st %g3, [ %o2 ] <== NOT EXECUTED result->tv_nsec = (TOD_NANOSECONDS_PER_SECOND - start->tv_nsec) + end->tv_nsec; 200b8d8: 07 0e e6 b2 sethi %hi(0x3b9ac800), %g3 <== NOT EXECUTED 200b8dc: 86 10 e2 00 or %g3, 0x200, %g3 ! 3b9aca00 <== NOT EXECUTED 200b8e0: 10 80 00 03 b 200b8ec <_Timespec_Subtract+0x38> <== NOT EXECUTED 200b8e4: 84 00 80 03 add %g2, %g3, %g2 <== NOT EXECUTED } else { result->tv_sec = end->tv_sec - start->tv_sec; 200b8e8: c6 22 80 00 st %g3, [ %o2 ] result->tv_nsec = end->tv_nsec - start->tv_nsec; 200b8ec: 82 20 80 01 sub %g2, %g1, %g1 200b8f0: 81 c3 e0 08 retl 200b8f4: c2 22 a0 04 st %g1, [ %o2 + 4 ] =============================================================================== 0200c45c <_Timestamp64_Divide>: const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 200c45c: 9d e3 bf a0 save %sp, -96, %sp Timestamp64_Control answer; if ( *_rhs == 0 ) { 200c460: d4 1e 40 00 ldd [ %i1 ], %o2 const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 200c464: a2 10 00 1a mov %i2, %l1 Timestamp64_Control answer; if ( *_rhs == 0 ) { 200c468: 80 92 80 0b orcc %o2, %o3, %g0 200c46c: 12 80 00 06 bne 200c484 <_Timestamp64_Divide+0x28> <== ALWAYS TAKEN 200c470: a0 10 00 1b mov %i3, %l0 *_ival_percentage = 0; 200c474: c0 26 80 00 clr [ %i2 ] <== NOT EXECUTED *_fval_percentage = 0; 200c478: c0 26 c0 00 clr [ %i3 ] <== NOT EXECUTED return; 200c47c: 81 c7 e0 08 ret <== NOT EXECUTED 200c480: 81 e8 00 00 restore <== 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; 200c484: d0 1e 00 00 ldd [ %i0 ], %o0 200c488: 83 2a 20 02 sll %o0, 2, %g1 200c48c: 89 32 60 1e srl %o1, 0x1e, %g4 200c490: 87 2a 60 02 sll %o1, 2, %g3 200c494: 84 11 00 01 or %g4, %g1, %g2 200c498: 83 30 e0 1b srl %g3, 0x1b, %g1 200c49c: 9b 28 e0 05 sll %g3, 5, %o5 200c4a0: 99 28 a0 05 sll %g2, 5, %o4 200c4a4: 86 a3 40 03 subcc %o5, %g3, %g3 200c4a8: 98 10 40 0c or %g1, %o4, %o4 200c4ac: 84 63 00 02 subx %o4, %g2, %g2 200c4b0: 92 80 c0 09 addcc %g3, %o1, %o1 200c4b4: 83 32 60 1e srl %o1, 0x1e, %g1 200c4b8: 90 40 80 08 addx %g2, %o0, %o0 200c4bc: b7 2a 60 02 sll %o1, 2, %i3 200c4c0: b5 2a 20 02 sll %o0, 2, %i2 200c4c4: b6 82 40 1b addcc %o1, %i3, %i3 200c4c8: b4 10 40 1a or %g1, %i2, %i2 200c4cc: 83 36 e0 1e srl %i3, 0x1e, %g1 200c4d0: b4 42 00 1a addx %o0, %i2, %i2 200c4d4: bb 2e e0 02 sll %i3, 2, %i5 200c4d8: b9 2e a0 02 sll %i2, 2, %i4 200c4dc: 92 86 c0 1d addcc %i3, %i5, %o1 200c4e0: b8 10 40 1c or %g1, %i4, %i4 200c4e4: 87 32 60 1b srl %o1, 0x1b, %g3 200c4e8: 90 46 80 1c addx %i2, %i4, %o0 200c4ec: 83 2a 60 05 sll %o1, 5, %g1 200c4f0: 85 2a 20 05 sll %o0, 5, %g2 200c4f4: 92 10 00 01 mov %g1, %o1 200c4f8: 40 00 36 d6 call 201a050 <__divdi3> 200c4fc: 90 10 c0 02 or %g3, %g2, %o0 *_ival_percentage = answer / 1000; 200c500: 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; 200c504: b4 10 00 08 mov %o0, %i2 200c508: b8 10 00 09 mov %o1, %i4 *_ival_percentage = answer / 1000; 200c50c: 40 00 36 d1 call 201a050 <__divdi3> 200c510: 96 10 23 e8 mov 0x3e8, %o3 *_fval_percentage = answer % 1000; 200c514: 90 10 00 1a mov %i2, %o0 * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; 200c518: d2 24 40 00 st %o1, [ %l1 ] *_fval_percentage = answer % 1000; 200c51c: 94 10 20 00 clr %o2 200c520: 92 10 00 1c mov %i4, %o1 200c524: 40 00 37 b1 call 201a3e8 <__moddi3> 200c528: 96 10 23 e8 mov 0x3e8, %o3 200c52c: d2 24 00 00 st %o1, [ %l0 ] 200c530: 81 c7 e0 08 ret 200c534: 81 e8 00 00 restore =============================================================================== 0200ab00 <_User_extensions_Handler_initialization>: #include #include #include void _User_extensions_Handler_initialization(void) { 200ab00: 9d e3 bf a0 save %sp, -96, %sp User_extensions_Control *extension; uint32_t i; uint32_t number_of_extensions; User_extensions_Table *initial_extensions; number_of_extensions = Configuration.number_of_initial_extensions; 200ab04: 03 00 80 6e sethi %hi(0x201b800), %g1 200ab08: 82 10 61 4c or %g1, 0x14c, %g1 ! 201b94c ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 200ab0c: 05 00 80 72 sethi %hi(0x201c800), %g2 initial_extensions = Configuration.User_extension_table; 200ab10: f4 00 60 44 ld [ %g1 + 0x44 ], %i2 User_extensions_Control *extension; uint32_t i; uint32_t number_of_extensions; User_extensions_Table *initial_extensions; number_of_extensions = Configuration.number_of_initial_extensions; 200ab14: f6 00 60 40 ld [ %g1 + 0x40 ], %i3 200ab18: 82 10 a0 98 or %g2, 0x98, %g1 200ab1c: 86 00 60 04 add %g1, 4, %g3 head->previous = NULL; 200ab20: c0 20 60 04 clr [ %g1 + 4 ] tail->previous = head; 200ab24: c2 20 60 08 st %g1, [ %g1 + 8 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 200ab28: c6 20 a0 98 st %g3, [ %g2 + 0x98 ] 200ab2c: 05 00 80 71 sethi %hi(0x201c400), %g2 200ab30: 82 10 a2 b4 or %g2, 0x2b4, %g1 ! 201c6b4 <_User_extensions_Switches_list> 200ab34: 86 00 60 04 add %g1, 4, %g3 head->previous = NULL; 200ab38: c0 20 60 04 clr [ %g1 + 4 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 200ab3c: c6 20 a2 b4 st %g3, [ %g2 + 0x2b4 ] initial_extensions = Configuration.User_extension_table; _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { 200ab40: 80 a6 a0 00 cmp %i2, 0 200ab44: 02 80 00 1b be 200abb0 <_User_extensions_Handler_initialization+0xb0><== NEVER TAKEN 200ab48: c2 20 60 08 st %g1, [ %g1 + 8 ] extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) 200ab4c: 83 2e e0 02 sll %i3, 2, %g1 200ab50: bb 2e e0 04 sll %i3, 4, %i5 200ab54: ba 27 40 01 sub %i5, %g1, %i5 200ab58: ba 07 40 1b add %i5, %i3, %i5 200ab5c: bb 2f 60 02 sll %i5, 2, %i5 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { extension = (User_extensions_Control *) 200ab60: 40 00 01 6c call 200b110 <_Workspace_Allocate_or_fatal_error> 200ab64: 90 10 00 1d mov %i5, %o0 _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 200ab68: 94 10 00 1d mov %i5, %o2 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { extension = (User_extensions_Control *) 200ab6c: b8 10 00 08 mov %o0, %i4 _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 200ab70: 92 10 20 00 clr %o1 200ab74: 40 00 12 6b call 200f520 200ab78: ba 10 20 00 clr %i5 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 200ab7c: 10 80 00 0b b 200aba8 <_User_extensions_Handler_initialization+0xa8> 200ab80: 80 a7 40 1b cmp %i5, %i3 RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 200ab84: 90 07 20 14 add %i4, 0x14, %o0 200ab88: 92 06 80 09 add %i2, %o1, %o1 200ab8c: 40 00 12 29 call 200f430 200ab90: 94 10 20 20 mov 0x20, %o2 _User_extensions_Add_set( extension ); 200ab94: 90 10 00 1c mov %i4, %o0 200ab98: 40 00 0a 81 call 200d59c <_User_extensions_Add_set> 200ab9c: ba 07 60 01 inc %i5 _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; 200aba0: b8 07 20 34 add %i4, 0x34, %i4 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 200aba4: 80 a7 40 1b cmp %i5, %i3 200aba8: 12 bf ff f7 bne 200ab84 <_User_extensions_Handler_initialization+0x84> 200abac: 93 2f 60 05 sll %i5, 5, %o1 200abb0: 81 c7 e0 08 ret 200abb4: 81 e8 00 00 restore =============================================================================== 0200c828 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 200c828: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; _ISR_Disable( level ); 200c82c: 7f ff db 0f call 2003468 200c830: ba 10 00 18 mov %i0, %i5 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 200c834: 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 ); 200c838: 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 ) ) { 200c83c: 80 a0 40 1c cmp %g1, %i4 200c840: 02 80 00 1f be 200c8bc <_Watchdog_Adjust+0x94> 200c844: 80 a6 60 00 cmp %i1, 0 switch ( direction ) { 200c848: 02 80 00 1a be 200c8b0 <_Watchdog_Adjust+0x88> 200c84c: b6 10 20 01 mov 1, %i3 200c850: 80 a6 60 01 cmp %i1, 1 200c854: 12 80 00 1a bne 200c8bc <_Watchdog_Adjust+0x94> <== NEVER TAKEN 200c858: 01 00 00 00 nop case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 200c85c: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 200c860: 10 80 00 07 b 200c87c <_Watchdog_Adjust+0x54> 200c864: b4 00 80 1a add %g2, %i2, %i2 break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 200c868: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 200c86c: 80 a6 80 02 cmp %i2, %g2 200c870: 3a 80 00 05 bcc,a 200c884 <_Watchdog_Adjust+0x5c> 200c874: f6 20 60 10 st %i3, [ %g1 + 0x10 ] _Watchdog_First( header )->delta_interval -= units; 200c878: b4 20 80 1a sub %g2, %i2, %i2 break; 200c87c: 10 80 00 10 b 200c8bc <_Watchdog_Adjust+0x94> 200c880: f4 20 60 10 st %i2, [ %g1 + 0x10 ] } else { units -= _Watchdog_First( header )->delta_interval; 200c884: b4 26 80 02 sub %i2, %g2, %i2 _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); 200c888: 7f ff da fc call 2003478 200c88c: 01 00 00 00 nop _Watchdog_Tickle( header ); 200c890: 40 00 00 90 call 200cad0 <_Watchdog_Tickle> 200c894: 90 10 00 1d mov %i5, %o0 _ISR_Disable( level ); 200c898: 7f ff da f4 call 2003468 200c89c: 01 00 00 00 nop if ( _Chain_Is_empty( header ) ) 200c8a0: c2 07 40 00 ld [ %i5 ], %g1 200c8a4: 80 a0 40 1c cmp %g1, %i4 200c8a8: 02 80 00 05 be 200c8bc <_Watchdog_Adjust+0x94> 200c8ac: 01 00 00 00 nop switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 200c8b0: 80 a6 a0 00 cmp %i2, 0 200c8b4: 32 bf ff ed bne,a 200c868 <_Watchdog_Adjust+0x40> <== ALWAYS TAKEN 200c8b8: c2 07 40 00 ld [ %i5 ], %g1 } break; } } _ISR_Enable( level ); 200c8bc: 7f ff da ef call 2003478 200c8c0: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 0200af18 <_Watchdog_Remove>: */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 200af18: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 200af1c: 7f ff dd b4 call 20025ec 200af20: ba 10 00 18 mov %i0, %i5 previous_state = the_watchdog->state; 200af24: f0 06 20 08 ld [ %i0 + 8 ], %i0 switch ( previous_state ) { 200af28: 80 a6 20 01 cmp %i0, 1 200af2c: 22 80 00 1d be,a 200afa0 <_Watchdog_Remove+0x88> 200af30: c0 27 60 08 clr [ %i5 + 8 ] 200af34: 0a 80 00 1c bcs 200afa4 <_Watchdog_Remove+0x8c> 200af38: 03 00 80 71 sethi %hi(0x201c400), %g1 200af3c: 80 a6 20 03 cmp %i0, 3 200af40: 18 80 00 19 bgu 200afa4 <_Watchdog_Remove+0x8c> <== NEVER TAKEN 200af44: 01 00 00 00 nop 200af48: c2 07 40 00 ld [ %i5 ], %g1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 200af4c: c0 27 60 08 clr [ %i5 + 8 ] next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 200af50: c4 00 40 00 ld [ %g1 ], %g2 200af54: 80 a0 a0 00 cmp %g2, 0 200af58: 02 80 00 07 be 200af74 <_Watchdog_Remove+0x5c> 200af5c: 05 00 80 71 sethi %hi(0x201c400), %g2 next_watchdog->delta_interval += the_watchdog->delta_interval; 200af60: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 200af64: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 200af68: 84 00 c0 02 add %g3, %g2, %g2 200af6c: c4 20 60 10 st %g2, [ %g1 + 0x10 ] if ( _Watchdog_Sync_count ) 200af70: 05 00 80 71 sethi %hi(0x201c400), %g2 200af74: c4 00 a3 bc ld [ %g2 + 0x3bc ], %g2 ! 201c7bc <_Watchdog_Sync_count> 200af78: 80 a0 a0 00 cmp %g2, 0 200af7c: 22 80 00 07 be,a 200af98 <_Watchdog_Remove+0x80> 200af80: c4 07 60 04 ld [ %i5 + 4 ], %g2 _Watchdog_Sync_level = _ISR_Nest_level; 200af84: 05 00 80 72 sethi %hi(0x201c800), %g2 200af88: c6 00 a0 e8 ld [ %g2 + 0xe8 ], %g3 ! 201c8e8 <_Per_CPU_Information+0x8> 200af8c: 05 00 80 71 sethi %hi(0x201c400), %g2 200af90: c6 20 a3 5c st %g3, [ %g2 + 0x35c ] ! 201c75c <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 200af94: c4 07 60 04 ld [ %i5 + 4 ], %g2 next->previous = previous; 200af98: c4 20 60 04 st %g2, [ %g1 + 4 ] previous->next = next; 200af9c: c2 20 80 00 st %g1, [ %g2 ] _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 200afa0: 03 00 80 71 sethi %hi(0x201c400), %g1 200afa4: c2 00 63 c0 ld [ %g1 + 0x3c0 ], %g1 ! 201c7c0 <_Watchdog_Ticks_since_boot> 200afa8: c2 27 60 18 st %g1, [ %i5 + 0x18 ] _ISR_Enable( level ); 200afac: 7f ff dd 94 call 20025fc 200afb0: 01 00 00 00 nop return( previous_state ); } 200afb4: 81 c7 e0 08 ret 200afb8: 81 e8 00 00 restore =============================================================================== 0200c170 <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 200c170: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 200c174: 7f ff db 8d call 2002fa8 200c178: ba 10 00 18 mov %i0, %i5 200c17c: b0 10 00 08 mov %o0, %i0 printk( "Watchdog Chain: %s %p\n", name, header ); 200c180: 11 00 80 71 sethi %hi(0x201c400), %o0 200c184: 94 10 00 19 mov %i1, %o2 200c188: 90 12 22 80 or %o0, 0x280, %o0 200c18c: 7f ff e3 74 call 2004f5c 200c190: 92 10 00 1d mov %i5, %o1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 200c194: f8 06 40 00 ld [ %i1 ], %i4 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 200c198: b2 06 60 04 add %i1, 4, %i1 if ( !_Chain_Is_empty( header ) ) { 200c19c: 80 a7 00 19 cmp %i4, %i1 200c1a0: 12 80 00 04 bne 200c1b0 <_Watchdog_Report_chain+0x40> 200c1a4: 92 10 00 1c mov %i4, %o1 _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); 200c1a8: 10 80 00 0d b 200c1dc <_Watchdog_Report_chain+0x6c> 200c1ac: 11 00 80 71 sethi %hi(0x201c400), %o0 node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 200c1b0: 40 00 00 0f call 200c1ec <_Watchdog_Report> 200c1b4: 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 ) 200c1b8: f8 07 00 00 ld [ %i4 ], %i4 Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; 200c1bc: 80 a7 00 19 cmp %i4, %i1 200c1c0: 12 bf ff fc bne 200c1b0 <_Watchdog_Report_chain+0x40> <== NEVER TAKEN 200c1c4: 92 10 00 1c mov %i4, %o1 { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 200c1c8: 11 00 80 71 sethi %hi(0x201c400), %o0 200c1cc: 92 10 00 1d mov %i5, %o1 200c1d0: 7f ff e3 63 call 2004f5c 200c1d4: 90 12 22 98 or %o0, 0x298, %o0 200c1d8: 30 80 00 03 b,a 200c1e4 <_Watchdog_Report_chain+0x74> } else { printk( "Chain is empty\n" ); 200c1dc: 7f ff e3 60 call 2004f5c 200c1e0: 90 12 22 a8 or %o0, 0x2a8, %o0 } _ISR_Enable( level ); 200c1e4: 7f ff db 75 call 2002fb8 200c1e8: 81 e8 00 00 restore =============================================================================== 0200aeb0 <_Workspace_String_duplicate>: char *_Workspace_String_duplicate( const char *string, size_t len ) { 200aeb0: 9d e3 bf a0 save %sp, -96, %sp char *dup = _Workspace_Allocate(len + 1); 200aeb4: 7f ff ff e3 call 200ae40 <_Workspace_Allocate> 200aeb8: 90 06 60 01 add %i1, 1, %o0 if (dup != NULL) { 200aebc: ba 92 20 00 orcc %o0, 0, %i5 200aec0: 02 80 00 05 be 200aed4 <_Workspace_String_duplicate+0x24> <== NEVER TAKEN 200aec4: 92 10 00 18 mov %i0, %o1 dup [len] = '\0'; 200aec8: c0 2f 40 19 clrb [ %i5 + %i1 ] memcpy(dup, string, len); 200aecc: 40 00 11 43 call 200f3d8 200aed0: 94 10 00 19 mov %i1, %o2 } return dup; } 200aed4: 81 c7 e0 08 ret 200aed8: 91 e8 00 1d restore %g0, %i5, %o0 =============================================================================== 020084a8 : rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 20084a8: 9d e3 bf 98 save %sp, -104, %sp 20084ac: 10 80 00 09 b 20084d0 20084b0: ba 10 00 18 mov %i0, %i5 while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL ) { rtems_event_set out; sc = rtems_event_receive( 20084b4: 92 10 20 00 clr %o1 20084b8: 94 10 00 1a mov %i2, %o2 20084bc: 7f ff fd 03 call 20078c8 20084c0: 96 07 bf fc add %fp, -4, %o3 ) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( 20084c4: 80 a2 20 00 cmp %o0, 0 20084c8: 32 80 00 09 bne,a 20084ec <== ALWAYS TAKEN 20084cc: f8 26 c0 00 st %i4, [ %i3 ] */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 20084d0: 40 00 01 6b call 2008a7c <_Chain_Get> 20084d4: 90 10 00 1d mov %i5, %o0 sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 20084d8: b8 92 20 00 orcc %o0, 0, %i4 20084dc: 02 bf ff f6 be 20084b4 20084e0: 90 10 00 19 mov %i1, %o0 20084e4: 90 10 20 00 clr %o0 timeout, &out ); } *node_ptr = node; 20084e8: f8 26 c0 00 st %i4, [ %i3 ] return sc; } 20084ec: 81 c7 e0 08 ret 20084f0: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 0200a53c : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 200a53c: 9d e3 bf a0 save %sp, -96, %sp uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 200a540: 80 a6 20 00 cmp %i0, 0 200a544: 02 80 00 1e be 200a5bc <== NEVER TAKEN 200a548: ba 10 20 01 mov 1, %i5 return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) 200a54c: 35 00 80 7c sethi %hi(0x201f000), %i2 #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 200a550: 83 2f 60 02 sll %i5, 2, %g1 if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) 200a554: 84 16 a1 38 or %i2, 0x138, %g2 200a558: c2 00 80 01 ld [ %g2 + %g1 ], %g1 200a55c: 80 a0 60 00 cmp %g1, 0 200a560: 22 80 00 14 be,a 200a5b0 200a564: ba 07 60 01 inc %i5 continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 200a568: f6 00 60 04 ld [ %g1 + 4 ], %i3 if ( !information ) 200a56c: 80 a6 e0 00 cmp %i3, 0 200a570: 12 80 00 0b bne 200a59c 200a574: b8 10 20 01 mov 1, %i4 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 200a578: 10 80 00 0e b 200a5b0 200a57c: ba 07 60 01 inc %i5 information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 200a580: 83 2f 20 02 sll %i4, 2, %g1 200a584: d0 00 80 01 ld [ %g2 + %g1 ], %o0 if ( !the_thread ) 200a588: 80 a2 20 00 cmp %o0, 0 200a58c: 02 80 00 04 be 200a59c 200a590: b8 07 20 01 inc %i4 continue; (*routine)(the_thread); 200a594: 9f c6 00 00 call %i0 200a598: 01 00 00 00 nop information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 200a59c: c2 16 e0 10 lduh [ %i3 + 0x10 ], %g1 200a5a0: 80 a7 00 01 cmp %i4, %g1 200a5a4: 28 bf ff f7 bleu,a 200a580 200a5a8: c4 06 e0 1c ld [ %i3 + 0x1c ], %g2 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 200a5ac: ba 07 60 01 inc %i5 200a5b0: 80 a7 60 04 cmp %i5, 4 200a5b4: 12 bf ff e8 bne 200a554 200a5b8: 83 2f 60 02 sll %i5, 2, %g1 200a5bc: 81 c7 e0 08 ret 200a5c0: 81 e8 00 00 restore =============================================================================== 02016098 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 2016098: 9d e3 bf a0 save %sp, -96, %sp register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 201609c: 80 a6 20 00 cmp %i0, 0 20160a0: 02 80 00 39 be 2016184 20160a4: 82 10 20 03 mov 3, %g1 return RTEMS_INVALID_NAME; if ( !starting_address ) 20160a8: 80 a6 60 00 cmp %i1, 0 20160ac: 02 80 00 36 be 2016184 20160b0: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; if ( !id ) 20160b4: 80 a7 60 00 cmp %i5, 0 20160b8: 02 80 00 33 be 2016184 <== NEVER TAKEN 20160bc: 80 a6 e0 00 cmp %i3, 0 return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 20160c0: 02 80 00 31 be 2016184 20160c4: 82 10 20 08 mov 8, %g1 20160c8: 80 a6 a0 00 cmp %i2, 0 20160cc: 02 80 00 2e be 2016184 20160d0: 80 a6 80 1b cmp %i2, %i3 20160d4: 0a 80 00 2c bcs 2016184 20160d8: 80 8e e0 07 btst 7, %i3 20160dc: 12 80 00 2a bne 2016184 20160e0: 80 8e 60 07 btst 7, %i1 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 20160e4: 12 80 00 28 bne 2016184 20160e8: 82 10 20 09 mov 9, %g1 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 20160ec: 03 00 80 ed sethi %hi(0x203b400), %g1 20160f0: c4 00 61 80 ld [ %g1 + 0x180 ], %g2 ! 203b580 <_Thread_Dispatch_disable_level> 20160f4: 84 00 a0 01 inc %g2 20160f8: c4 20 61 80 st %g2, [ %g1 + 0x180 ] return _Thread_Dispatch_disable_level; 20160fc: c2 00 61 80 ld [ %g1 + 0x180 ], %g1 * This function allocates a partition control block from * the inactive chain of free partition control blocks. */ RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Allocate ( void ) { return (Partition_Control *) _Objects_Allocate( &_Partition_Information ); 2016100: 23 00 80 ec sethi %hi(0x203b000), %l1 2016104: 40 00 12 d7 call 201ac60 <_Objects_Allocate> 2016108: 90 14 63 94 or %l1, 0x394, %o0 ! 203b394 <_Partition_Information> _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 201610c: a0 92 20 00 orcc %o0, 0, %l0 2016110: 32 80 00 06 bne,a 2016128 2016114: f8 24 20 1c st %i4, [ %l0 + 0x1c ] _Thread_Enable_dispatch(); 2016118: 40 00 17 f0 call 201c0d8 <_Thread_Enable_dispatch> 201611c: 01 00 00 00 nop return RTEMS_TOO_MANY; 2016120: 10 80 00 19 b 2016184 2016124: 82 10 20 05 mov 5, %g1 ! 5 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, length / buffer_size, buffer_size ); 2016128: 92 10 00 1b mov %i3, %o1 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 201612c: f2 24 20 10 st %i1, [ %l0 + 0x10 ] the_partition->length = length; 2016130: f4 24 20 14 st %i2, [ %l0 + 0x14 ] the_partition->buffer_size = buffer_size; 2016134: f6 24 20 18 st %i3, [ %l0 + 0x18 ] the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; 2016138: c0 24 20 20 clr [ %l0 + 0x20 ] _Chain_Initialize( &the_partition->Memory, starting_address, length / buffer_size, buffer_size ); 201613c: 40 00 54 2d call 202b1f0 <.udiv> 2016140: 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, 2016144: 92 10 00 19 mov %i1, %o1 length / buffer_size, buffer_size ); 2016148: 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, 201614c: 96 10 00 1b mov %i3, %o3 2016150: b8 04 20 24 add %l0, 0x24, %i4 2016154: 40 00 0c df call 20194d0 <_Chain_Initialize> 2016158: 90 10 00 1c mov %i4, %o0 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 201615c: c4 14 20 0a lduh [ %l0 + 0xa ], %g2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 2016160: a2 14 63 94 or %l1, 0x394, %l1 2016164: c6 04 60 1c ld [ %l1 + 0x1c ], %g3 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 2016168: c2 04 20 08 ld [ %l0 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 201616c: 85 28 a0 02 sll %g2, 2, %g2 2016170: e0 20 c0 02 st %l0, [ %g3 + %g2 ] information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 2016174: f0 24 20 0c st %i0, [ %l0 + 0xc ] name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 2016178: 40 00 17 d8 call 201c0d8 <_Thread_Enable_dispatch> 201617c: c2 27 40 00 st %g1, [ %i5 ] return RTEMS_SUCCESSFUL; 2016180: 82 10 20 00 clr %g1 } 2016184: 81 c7 e0 08 ret 2016188: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 0203dc08 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 203dc08: 9d e3 bf 98 save %sp, -104, %sp 203dc0c: 11 00 81 b8 sethi %hi(0x206e000), %o0 203dc10: 92 10 00 18 mov %i0, %o1 203dc14: 90 12 21 40 or %o0, 0x140, %o0 203dc18: 7f ff 44 ad call 200eecc <_Objects_Get> 203dc1c: 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 ) { 203dc20: c2 07 bf fc ld [ %fp + -4 ], %g1 203dc24: 80 a0 60 00 cmp %g1, 0 203dc28: 12 80 00 6a bne 203ddd0 203dc2c: ba 10 00 08 mov %o0, %i5 203dc30: 37 00 81 b7 sethi %hi(0x206dc00), %i3 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 203dc34: c4 02 20 40 ld [ %o0 + 0x40 ], %g2 203dc38: b6 16 e2 70 or %i3, 0x270, %i3 203dc3c: c2 06 e0 0c ld [ %i3 + 0xc ], %g1 203dc40: 80 a0 80 01 cmp %g2, %g1 203dc44: 02 80 00 06 be 203dc5c 203dc48: 80 a6 60 00 cmp %i1, 0 _Thread_Enable_dispatch(); 203dc4c: 7f ff 48 54 call 200fd9c <_Thread_Enable_dispatch> 203dc50: b0 10 20 17 mov 0x17, %i0 return RTEMS_NOT_OWNER_OF_RESOURCE; 203dc54: 81 c7 e0 08 ret 203dc58: 81 e8 00 00 restore } if ( length == RTEMS_PERIOD_STATUS ) { 203dc5c: 12 80 00 0d bne 203dc90 203dc60: 01 00 00 00 nop switch ( the_period->state ) { 203dc64: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 203dc68: 80 a0 60 04 cmp %g1, 4 203dc6c: 18 80 00 05 bgu 203dc80 <== NEVER TAKEN 203dc70: b0 10 20 00 clr %i0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 203dc74: 05 00 81 9f sethi %hi(0x2067c00), %g2 203dc78: 84 10 a0 90 or %g2, 0x90, %g2 ! 2067c90 203dc7c: f0 08 80 01 ldub [ %g2 + %g1 ], %i0 case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 203dc80: 7f ff 48 47 call 200fd9c <_Thread_Enable_dispatch> 203dc84: 01 00 00 00 nop return( return_value ); 203dc88: 81 c7 e0 08 ret 203dc8c: 81 e8 00 00 restore } _ISR_Disable( level ); 203dc90: 7f ff 18 b4 call 2003f60 203dc94: 01 00 00 00 nop 203dc98: b4 10 00 08 mov %o0, %i2 if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { 203dc9c: f8 07 60 38 ld [ %i5 + 0x38 ], %i4 203dca0: 80 a7 20 00 cmp %i4, 0 203dca4: 12 80 00 15 bne 203dcf8 203dca8: 80 a7 20 02 cmp %i4, 2 _ISR_Enable( level ); 203dcac: 7f ff 18 b1 call 2003f70 203dcb0: 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 ); 203dcb4: 90 10 00 1d mov %i5, %o0 203dcb8: 7f ff ff ba call 203dba0 <_Rate_monotonic_Initiate_statistics> 203dcbc: f2 27 60 3c st %i1, [ %i5 + 0x3c ] the_period->state = RATE_MONOTONIC_ACTIVE; 203dcc0: 82 10 20 02 mov 2, %g1 203dcc4: c2 27 60 38 st %g1, [ %i5 + 0x38 ] Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 203dcc8: 03 00 80 f7 sethi %hi(0x203dc00), %g1 203dccc: 82 10 61 dc or %g1, 0x1dc, %g1 ! 203dddc <_Rate_monotonic_Timeout> Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 203dcd0: c0 27 60 18 clr [ %i5 + 0x18 ] the_watchdog->routine = routine; 203dcd4: c2 27 60 2c st %g1, [ %i5 + 0x2c ] the_watchdog->id = id; 203dcd8: f0 27 60 30 st %i0, [ %i5 + 0x30 ] the_watchdog->user_data = user_data; 203dcdc: c0 27 60 34 clr [ %i5 + 0x34 ] Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 203dce0: f2 27 60 1c st %i1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 203dce4: 11 00 81 b7 sethi %hi(0x206dc00), %o0 203dce8: 92 07 60 10 add %i5, 0x10, %o1 203dcec: 7f ff 4b 5f call 2010a68 <_Watchdog_Insert> 203dcf0: 90 12 21 00 or %o0, 0x100, %o0 203dcf4: 30 80 00 1b b,a 203dd60 _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { 203dcf8: 12 80 00 1e bne 203dd70 203dcfc: 80 a7 20 04 cmp %i4, 4 /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 203dd00: 7f ff ff 5f call 203da7c <_Rate_monotonic_Update_statistics> 203dd04: 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; 203dd08: 82 10 20 01 mov 1, %g1 the_period->next_length = length; 203dd0c: 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; 203dd10: c2 27 60 38 st %g1, [ %i5 + 0x38 ] the_period->next_length = length; _ISR_Enable( level ); 203dd14: 7f ff 18 97 call 2003f70 203dd18: 90 10 00 1a mov %i2, %o0 _Thread_Executing->Wait.id = the_period->Object.id; 203dd1c: d0 06 e0 0c ld [ %i3 + 0xc ], %o0 203dd20: c2 07 60 08 ld [ %i5 + 8 ], %g1 _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 203dd24: 13 00 00 10 sethi %hi(0x4000), %o1 203dd28: 7f ff 4a 44 call 2010638 <_Thread_Set_state> 203dd2c: c2 22 20 20 st %g1, [ %o0 + 0x20 ] /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 203dd30: 7f ff 18 8c call 2003f60 203dd34: 01 00 00 00 nop local_state = the_period->state; 203dd38: f4 07 60 38 ld [ %i5 + 0x38 ], %i2 the_period->state = RATE_MONOTONIC_ACTIVE; 203dd3c: f8 27 60 38 st %i4, [ %i5 + 0x38 ] _ISR_Enable( level ); 203dd40: 7f ff 18 8c call 2003f70 203dd44: 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 ) 203dd48: 80 a6 a0 03 cmp %i2, 3 203dd4c: 12 80 00 05 bne 203dd60 203dd50: 01 00 00 00 nop _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 203dd54: d0 06 e0 0c ld [ %i3 + 0xc ], %o0 203dd58: 7f ff 47 32 call 200fa20 <_Thread_Clear_state> 203dd5c: 13 00 00 10 sethi %hi(0x4000), %o1 _Thread_Enable_dispatch(); 203dd60: 7f ff 48 0f call 200fd9c <_Thread_Enable_dispatch> 203dd64: b0 10 20 00 clr %i0 return RTEMS_SUCCESSFUL; 203dd68: 81 c7 e0 08 ret 203dd6c: 81 e8 00 00 restore } if ( the_period->state == RATE_MONOTONIC_EXPIRED ) { 203dd70: 12 bf ff b9 bne 203dc54 <== NEVER TAKEN 203dd74: b0 10 20 04 mov 4, %i0 /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 203dd78: 7f ff ff 41 call 203da7c <_Rate_monotonic_Update_statistics> 203dd7c: 90 10 00 1d mov %i5, %o0 _ISR_Enable( level ); 203dd80: 7f ff 18 7c call 2003f70 203dd84: 90 10 00 1a mov %i2, %o0 the_period->state = RATE_MONOTONIC_ACTIVE; 203dd88: 82 10 20 02 mov 2, %g1 203dd8c: 92 07 60 10 add %i5, 0x10, %o1 203dd90: c2 27 60 38 st %g1, [ %i5 + 0x38 ] the_period->next_length = length; 203dd94: f2 27 60 3c st %i1, [ %i5 + 0x3c ] Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 203dd98: f2 27 60 1c st %i1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 203dd9c: 11 00 81 b7 sethi %hi(0x206dc00), %o0 203dda0: 7f ff 4b 32 call 2010a68 <_Watchdog_Insert> 203dda4: 90 12 21 00 or %o0, 0x100, %o0 ! 206dd00 <_Watchdog_Ticks_chain> 203dda8: d0 07 60 40 ld [ %i5 + 0x40 ], %o0 203ddac: d2 07 60 3c ld [ %i5 + 0x3c ], %o1 203ddb0: 03 00 81 a6 sethi %hi(0x2069800), %g1 203ddb4: c2 00 61 a4 ld [ %g1 + 0x1a4 ], %g1 ! 20699a4 <_Scheduler+0x34> 203ddb8: 9f c0 40 00 call %g1 203ddbc: 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(); 203ddc0: 7f ff 47 f7 call 200fd9c <_Thread_Enable_dispatch> 203ddc4: 01 00 00 00 nop return RTEMS_TIMEOUT; 203ddc8: 81 c7 e0 08 ret 203ddcc: 81 e8 00 00 restore #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 203ddd0: b0 10 20 04 mov 4, %i0 } 203ddd4: 81 c7 e0 08 ret 203ddd8: 81 e8 00 00 restore =============================================================================== 02029a5c : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 2029a5c: 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 ) 2029a60: 80 a6 60 00 cmp %i1, 0 2029a64: 02 80 00 75 be 2029c38 <== NEVER TAKEN 2029a68: 90 10 00 18 mov %i0, %o0 return; (*print)( context, "Period information by period\n" ); 2029a6c: 13 00 81 8b sethi %hi(0x2062c00), %o1 2029a70: 9f c6 40 00 call %i1 2029a74: 92 12 60 b0 or %o1, 0xb0, %o1 ! 2062cb0 <_TOD_Days_per_month+0x68> #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 2029a78: 90 10 00 18 mov %i0, %o0 2029a7c: 13 00 81 8b sethi %hi(0x2062c00), %o1 2029a80: 9f c6 40 00 call %i1 2029a84: 92 12 60 d0 or %o1, 0xd0, %o1 ! 2062cd0 <_TOD_Days_per_month+0x88> (*print)( context, "--- Wall times are in seconds ---\n" ); 2029a88: 90 10 00 18 mov %i0, %o0 2029a8c: 13 00 81 8b sethi %hi(0x2062c00), %o1 2029a90: 9f c6 40 00 call %i1 2029a94: 92 12 60 f8 or %o1, 0xf8, %o1 ! 2062cf8 <_TOD_Days_per_month+0xb0> Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 2029a98: 90 10 00 18 mov %i0, %o0 2029a9c: 13 00 81 8b sethi %hi(0x2062c00), %o1 2029aa0: 9f c6 40 00 call %i1 2029aa4: 92 12 61 20 or %o1, 0x120, %o1 ! 2062d20 <_TOD_Days_per_month+0xd8> #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 2029aa8: 90 10 00 18 mov %i0, %o0 2029aac: 13 00 81 8b sethi %hi(0x2062c00), %o1 2029ab0: 9f c6 40 00 call %i1 2029ab4: 92 12 61 70 or %o1, 0x170, %o1 ! 2062d70 <_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 ; 2029ab8: 03 00 81 b8 sethi %hi(0x206e000), %g1 rtems_object_get_name( the_status.owner, sizeof(name), name ); /* * Print part of report line that is not dependent on granularity */ (*print)( context, 2029abc: 21 00 81 8b sethi %hi(0x2062c00), %l0 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, 2029ac0: 35 00 81 8b sethi %hi(0x2062c00), %i2 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, 2029ac4: 37 00 81 8b sethi %hi(0x2062c00), %i3 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 2029ac8: 39 00 81 90 sethi %hi(0x2064000), %i4 /* * 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 ; 2029acc: fa 00 61 48 ld [ %g1 + 0x148 ], %i5 rtems_object_get_name( the_status.owner, sizeof(name), name ); /* * Print part of report line that is not dependent on granularity */ (*print)( context, 2029ad0: a0 14 21 c0 or %l0, 0x1c0, %l0 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, 2029ad4: b4 16 a1 d8 or %i2, 0x1d8, %i2 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, 2029ad8: b6 16 e1 f8 or %i3, 0x1f8, %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 ; 2029adc: 10 80 00 52 b 2029c24 2029ae0: b8 17 22 90 or %i4, 0x290, %i4 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 2029ae4: 40 00 4f 0c call 203d714 2029ae8: 92 07 bf a0 add %fp, -96, %o1 if ( status != RTEMS_SUCCESSFUL ) 2029aec: 80 a2 20 00 cmp %o0, 0 2029af0: 32 80 00 4d bne,a 2029c24 2029af4: ba 07 60 01 inc %i5 #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 ); 2029af8: 92 07 bf d8 add %fp, -40, %o1 2029afc: 40 00 4f 76 call 203d8d4 2029b00: 90 10 00 1d mov %i5, %o0 #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 2029b04: d0 07 bf d8 ld [ %fp + -40 ], %o0 2029b08: 92 10 20 05 mov 5, %o1 2029b0c: 7f ff 8c d5 call 200ce60 2029b10: 94 07 bf f8 add %fp, -8, %o2 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 2029b14: d8 1f bf a0 ldd [ %fp + -96 ], %o4 2029b18: 92 10 00 10 mov %l0, %o1 2029b1c: 90 10 00 18 mov %i0, %o0 2029b20: 94 10 00 1d mov %i5, %o2 2029b24: 9f c6 40 00 call %i1 2029b28: 96 07 bf f8 add %fp, -8, %o3 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 2029b2c: d2 07 bf a0 ld [ %fp + -96 ], %o1 2029b30: 80 a2 60 00 cmp %o1, 0 2029b34: 12 80 00 07 bne 2029b50 2029b38: 94 07 bf f0 add %fp, -16, %o2 (*print)( context, "\n" ); 2029b3c: 90 10 00 18 mov %i0, %o0 2029b40: 9f c6 40 00 call %i1 2029b44: 92 10 00 1c mov %i4, %o1 continue; 2029b48: 10 80 00 37 b 2029c24 2029b4c: ba 07 60 01 inc %i5 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 ); 2029b50: 40 00 04 f0 call 202af10 <_Timespec_Divide_by_integer> 2029b54: 90 07 bf b8 add %fp, -72, %o0 (*print)( context, 2029b58: d0 07 bf ac ld [ %fp + -84 ], %o0 2029b5c: 40 00 c2 b7 call 205a638 <.div> 2029b60: 92 10 23 e8 mov 0x3e8, %o1 2029b64: a6 10 00 08 mov %o0, %l3 2029b68: d0 07 bf b4 ld [ %fp + -76 ], %o0 2029b6c: 40 00 c2 b3 call 205a638 <.div> 2029b70: 92 10 23 e8 mov 0x3e8, %o1 2029b74: c2 07 bf f0 ld [ %fp + -16 ], %g1 2029b78: a2 10 00 08 mov %o0, %l1 2029b7c: d0 07 bf f4 ld [ %fp + -12 ], %o0 2029b80: e8 07 bf a8 ld [ %fp + -88 ], %l4 2029b84: e4 07 bf b0 ld [ %fp + -80 ], %l2 2029b88: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 2029b8c: 40 00 c2 ab call 205a638 <.div> 2029b90: 92 10 23 e8 mov 0x3e8, %o1 2029b94: 96 10 00 13 mov %l3, %o3 2029b98: 98 10 00 12 mov %l2, %o4 2029b9c: 9a 10 00 11 mov %l1, %o5 2029ba0: 94 10 00 14 mov %l4, %o2 2029ba4: d0 23 a0 60 st %o0, [ %sp + 0x60 ] 2029ba8: 92 10 00 1a mov %i2, %o1 2029bac: 9f c6 40 00 call %i1 2029bb0: 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); 2029bb4: d2 07 bf a0 ld [ %fp + -96 ], %o1 2029bb8: 94 07 bf f0 add %fp, -16, %o2 2029bbc: 40 00 04 d5 call 202af10 <_Timespec_Divide_by_integer> 2029bc0: 90 07 bf d0 add %fp, -48, %o0 (*print)( context, 2029bc4: d0 07 bf c4 ld [ %fp + -60 ], %o0 2029bc8: 40 00 c2 9c call 205a638 <.div> 2029bcc: 92 10 23 e8 mov 0x3e8, %o1 2029bd0: a6 10 00 08 mov %o0, %l3 2029bd4: d0 07 bf cc ld [ %fp + -52 ], %o0 2029bd8: 40 00 c2 98 call 205a638 <.div> 2029bdc: 92 10 23 e8 mov 0x3e8, %o1 2029be0: c2 07 bf f0 ld [ %fp + -16 ], %g1 2029be4: a2 10 00 08 mov %o0, %l1 2029be8: d0 07 bf f4 ld [ %fp + -12 ], %o0 2029bec: e8 07 bf c0 ld [ %fp + -64 ], %l4 2029bf0: e4 07 bf c8 ld [ %fp + -56 ], %l2 2029bf4: 92 10 23 e8 mov 0x3e8, %o1 2029bf8: 40 00 c2 90 call 205a638 <.div> 2029bfc: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 2029c00: 92 10 00 1b mov %i3, %o1 2029c04: d0 23 a0 60 st %o0, [ %sp + 0x60 ] 2029c08: 94 10 00 14 mov %l4, %o2 2029c0c: 90 10 00 18 mov %i0, %o0 2029c10: 96 10 00 13 mov %l3, %o3 2029c14: 98 10 00 12 mov %l2, %o4 2029c18: 9f c6 40 00 call %i1 2029c1c: 9a 10 00 11 mov %l1, %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 ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 2029c20: 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 ; id <= _Rate_monotonic_Information.maximum_id ; 2029c24: 03 00 81 b8 sethi %hi(0x206e000), %g1 /* * 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 ; 2029c28: c2 00 61 4c ld [ %g1 + 0x14c ], %g1 ! 206e14c <_Rate_monotonic_Information+0xc> 2029c2c: 80 a7 40 01 cmp %i5, %g1 2029c30: 08 bf ff ad bleu 2029ae4 2029c34: 90 10 00 1d mov %i5, %o0 2029c38: 81 c7 e0 08 ret 2029c3c: 81 e8 00 00 restore =============================================================================== 020088f0 : return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { 20088f0: 9d e3 bf a0 save %sp, -96, %sp void *ptr = NULL; rtems_chain_control *free_chain = &control->free_chain; rtems_rbtree_control *page_tree = &control->page_tree; uintptr_t page_alignment = control->page_alignment; 20088f4: f8 06 20 30 ld [ %i0 + 0x30 ], %i4 #include static uintptr_t align_up(uintptr_t page_alignment, uintptr_t value) { uintptr_t excess = value % page_alignment; 20088f8: 90 10 00 19 mov %i1, %o0 20088fc: 92 10 00 1c mov %i4, %o1 2008900: 40 00 41 ac call 2018fb0 <.urem> 2008904: ba 10 00 18 mov %i0, %i5 if (excess > 0) { 2008908: 80 a2 20 00 cmp %o0, 0 200890c: 02 80 00 04 be 200891c <== ALWAYS TAKEN 2008910: b6 10 00 19 mov %i1, %i3 value += page_alignment - excess; 2008914: b8 06 40 1c add %i1, %i4, %i4 <== NOT EXECUTED 2008918: b6 27 00 08 sub %i4, %o0, %i3 <== NOT EXECUTED rtems_chain_control *free_chain = &control->free_chain; rtems_rbtree_control *page_tree = &control->page_tree; uintptr_t page_alignment = control->page_alignment; uintptr_t aligned_size = align_up(page_alignment, size); if (size > 0 && size <= aligned_size) { 200891c: 80 a6 c0 19 cmp %i3, %i1 2008920: 0a 80 00 31 bcs 20089e4 <== NEVER TAKEN 2008924: 80 a6 60 00 cmp %i1, 0 2008928: 02 80 00 2f be 20089e4 200892c: 84 07 60 04 add %i5, 4, %g2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 2008930: c2 07 40 00 ld [ %i5 ], %g1 size_t size ) { rtems_chain_node *current = rtems_chain_first(free_chain); const rtems_chain_node *tail = rtems_chain_tail(free_chain); rtems_rbheap_page *big_enough = NULL; 2008934: 10 80 00 06 b 200894c 2008938: b2 10 20 00 clr %i1 while (current != tail && big_enough == NULL) { rtems_rbheap_page *free_page = (rtems_rbheap_page *) current; if (free_page->size >= size) { 200893c: 80 a0 c0 1b cmp %g3, %i3 2008940: b2 40 3f ff addx %g0, -1, %i1 2008944: b2 08 40 19 and %g1, %i1, %i1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next( Chain_Node *the_node ) { return the_node->next; 2008948: c2 00 40 00 ld [ %g1 ], %g1 { rtems_chain_node *current = rtems_chain_first(free_chain); const rtems_chain_node *tail = rtems_chain_tail(free_chain); rtems_rbheap_page *big_enough = NULL; while (current != tail && big_enough == NULL) { 200894c: 80 a6 60 00 cmp %i1, 0 2008950: 12 80 00 04 bne 2008960 2008954: 80 a0 40 02 cmp %g1, %g2 2008958: 32 bf ff f9 bne,a 200893c 200895c: c6 00 60 1c ld [ %g1 + 0x1c ], %g3 uintptr_t aligned_size = align_up(page_alignment, size); if (size > 0 && size <= aligned_size) { rtems_rbheap_page *free_page = search_free_page(free_chain, aligned_size); if (free_page != NULL) { 2008960: 80 a6 60 00 cmp %i1, 0 2008964: 02 80 00 16 be 20089bc 2008968: b0 10 20 00 clr %i0 uintptr_t free_size = free_page->size; 200896c: f4 06 60 1c ld [ %i1 + 0x1c ], %i2 if (free_size > aligned_size) { 2008970: 80 a6 80 1b cmp %i2, %i3 2008974: 28 80 00 14 bleu,a 20089c4 2008978: c4 06 40 00 ld [ %i1 ], %g2 rtems_rbheap_page *new_page = get_page(control); 200897c: 7f ff ff 72 call 2008744 2008980: 90 10 00 1d mov %i5, %o0 if (new_page != NULL) { 2008984: b8 92 20 00 orcc %o0, 0, %i4 2008988: 02 80 00 0d be 20089bc <== NEVER TAKEN 200898c: b4 26 80 1b sub %i2, %i3, %i2 uintptr_t new_free_size = free_size - aligned_size; free_page->size = new_free_size; new_page->begin = free_page->begin + new_free_size; 2008990: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 rtems_rbheap_page *new_page = get_page(control); if (new_page != NULL) { uintptr_t new_free_size = free_size - aligned_size; free_page->size = new_free_size; 2008994: f4 26 60 1c st %i2, [ %i1 + 0x1c ] new_page->begin = free_page->begin + new_free_size; new_page->size = aligned_size; 2008998: f6 27 20 1c st %i3, [ %i4 + 0x1c ] if (new_page != NULL) { uintptr_t new_free_size = free_size - aligned_size; free_page->size = new_free_size; new_page->begin = free_page->begin + new_free_size; 200899c: b4 06 80 01 add %i2, %g1, %i2 */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = node->previous = NULL; 20089a0: c0 27 20 04 clr [ %i4 + 4 ] 20089a4: f4 27 20 18 st %i2, [ %i4 + 0x18 ] 20089a8: c0 27 00 00 clr [ %i4 ] static void insert_into_tree( rtems_rbtree_control *tree, rtems_rbheap_page *page ) { _RBTree_Insert_unprotected(tree, &page->tree_node); 20089ac: 90 07 60 18 add %i5, 0x18, %o0 20089b0: 40 00 06 d7 call 200a50c <_RBTree_Insert_unprotected> 20089b4: 92 07 20 08 add %i4, 8, %o1 free_page->size = new_free_size; new_page->begin = free_page->begin + new_free_size; new_page->size = aligned_size; rtems_chain_set_off_chain(&new_page->chain_node); insert_into_tree(page_tree, new_page); ptr = (void *) new_page->begin; 20089b8: f0 07 20 18 ld [ %i4 + 0x18 ], %i0 20089bc: 81 c7 e0 08 ret 20089c0: 81 e8 00 00 restore { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 20089c4: c2 06 60 04 ld [ %i1 + 4 ], %g1 } } else { rtems_chain_extract_unprotected(&free_page->chain_node); rtems_chain_set_off_chain(&free_page->chain_node); ptr = (void *) free_page->begin; 20089c8: f0 06 60 18 ld [ %i1 + 0x18 ], %i0 next->previous = previous; 20089cc: c2 20 a0 04 st %g1, [ %g2 + 4 ] previous->next = next; 20089d0: c4 20 40 00 st %g2, [ %g1 ] */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = node->previous = NULL; 20089d4: c0 26 60 04 clr [ %i1 + 4 ] 20089d8: c0 26 40 00 clr [ %i1 ] 20089dc: 81 c7 e0 08 ret 20089e0: 81 e8 00 00 restore return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { void *ptr = NULL; 20089e4: b0 10 20 00 clr %i0 } } } return ptr; } 20089e8: 81 c7 e0 08 ret 20089ec: 81 e8 00 00 restore =============================================================================== 02008b84 : void rtems_rbheap_extend_page_pool_with_malloc(rtems_rbheap_control *control) { 2008b84: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED rtems_rbheap_page *page = malloc(sizeof(*page)); 2008b88: 7f ff ed 90 call 20041c8 <== NOT EXECUTED 2008b8c: 90 10 20 20 mov 0x20, %o0 <== NOT EXECUTED if (page != NULL) { 2008b90: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 2008b94: 02 80 00 07 be 2008bb0 <== NOT EXECUTED 2008b98: 82 06 20 0c add %i0, 0xc, %g1 <== NOT EXECUTED Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 2008b9c: c2 22 20 04 st %g1, [ %o0 + 4 ] <== NOT EXECUTED before_node = after_node->next; 2008ba0: c2 06 20 0c ld [ %i0 + 0xc ], %g1 <== NOT EXECUTED after_node->next = the_node; 2008ba4: d0 26 20 0c st %o0, [ %i0 + 0xc ] <== NOT EXECUTED the_node->next = before_node; 2008ba8: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED before_node->previous = the_node; 2008bac: d0 20 60 04 st %o0, [ %g1 + 4 ] <== NOT EXECUTED 2008bb0: 81 c7 e0 08 ret <== NOT EXECUTED 2008bb4: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 020089f0 : _RBTree_Extract_unprotected(page_tree, &b->tree_node); } } rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr) { 20089f0: 9d e3 bf 80 save %sp, -128, %sp #define NULL_PAGE rtems_rbheap_page_of_node(NULL) static rtems_rbheap_page *find(rtems_rbtree_control *page_tree, uintptr_t key) { rtems_rbheap_page page = { .begin = key }; 20089f4: 92 10 20 00 clr %o1 20089f8: 90 07 bf e0 add %fp, -32, %o0 20089fc: 94 10 20 20 mov 0x20, %o2 2008a00: 40 00 1f 70 call 20107c0 2008a04: ba 10 00 18 mov %i0, %i5 RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; 2008a08: b8 10 20 00 clr %i4 2008a0c: f2 27 bf f8 st %i1, [ %fp + -8 ] RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; 2008a10: 10 80 00 12 b 2008a58 2008a14: f6 06 20 1c ld [ %i0 + 0x1c ], %i3 RBTree_Node* found = NULL; int compare_result; while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); 2008a18: 90 07 bf e8 add %fp, -24, %o0 2008a1c: 9f c0 40 00 call %g1 2008a20: 92 10 00 1b mov %i3, %o1 if ( _RBTree_Is_equal( compare_result ) ) { 2008a24: 80 a2 20 00 cmp %o0, 0 2008a28: 12 80 00 07 bne 2008a44 2008a2c: 83 3a 20 1f sra %o0, 0x1f, %g1 found = iter_node; if ( the_rbtree->is_unique ) 2008a30: c2 0f 60 2c ldub [ %i5 + 0x2c ], %g1 2008a34: 80 a0 60 00 cmp %g1, 0 2008a38: 12 80 00 0c bne 2008a68 <== ALWAYS TAKEN 2008a3c: b8 10 00 1b mov %i3, %i4 break; } RBTree_Direction dir = 2008a40: 83 3a 20 1f sra %o0, 0x1f, %g1 <== NOT EXECUTED 2008a44: 90 20 40 08 sub %g1, %o0, %o0 2008a48: 91 32 20 1f srl %o0, 0x1f, %o0 (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; 2008a4c: 91 2a 20 02 sll %o0, 2, %o0 2008a50: b6 06 c0 08 add %i3, %o0, %i3 2008a54: f6 06 e0 04 ld [ %i3 + 4 ], %i3 ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { 2008a58: 80 a6 e0 00 cmp %i3, 0 2008a5c: 32 bf ff ef bne,a 2008a18 2008a60: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 2008a64: b6 10 00 1c mov %i4, %i3 return rtems_rbheap_page_of_node( 2008a68: b8 06 ff f8 add %i3, -8, %i4 rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_control *free_chain = &control->free_chain; rtems_rbtree_control *page_tree = &control->page_tree; rtems_rbheap_page *page = find(page_tree, (uintptr_t) ptr); if (page != NULL_PAGE) { 2008a6c: 80 a7 3f f8 cmp %i4, -8 2008a70: 02 80 00 41 be 2008b74 2008a74: 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); 2008a78: c4 06 ff f8 ld [ %i3 + -8 ], %g2 2008a7c: 80 a0 a0 00 cmp %g2, 0 2008a80: 12 80 00 05 bne 2008a94 2008a84: 82 10 20 00 clr %g1 add_to_chain(free_chain, b); _RBTree_Extract_unprotected(page_tree, &b->tree_node); } } rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr) 2008a88: c2 07 20 04 ld [ %i4 + 4 ], %g1 2008a8c: 80 a0 00 01 cmp %g0, %g1 2008a90: 82 60 3f ff subx %g0, -1, %g1 rtems_chain_control *free_chain = &control->free_chain; rtems_rbtree_control *page_tree = &control->page_tree; rtems_rbheap_page *page = find(page_tree, (uintptr_t) ptr); if (page != NULL_PAGE) { if (!rtems_rbheap_is_page_free(page)) { 2008a94: 80 a0 60 00 cmp %g1, 0 2008a98: 02 80 00 37 be 2008b74 2008a9c: b0 10 20 0e mov 0xe, %i0 rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_control *free_chain = &control->free_chain; rtems_rbtree_control *page_tree = &control->page_tree; 2008aa0: b6 07 60 18 add %i5, 0x18, %i3 const rtems_rbtree_control *page_tree, const rtems_rbheap_page *page, RBTree_Direction dir ) { return rtems_rbheap_page_of_node( 2008aa4: b0 07 20 08 add %i4, 8, %i0 2008aa8: 94 10 20 00 clr %o2 2008aac: 92 10 00 18 mov %i0, %o1 2008ab0: 40 00 07 1e call 200a728 <_RBTree_Next_unprotected> 2008ab4: 90 10 00 1b mov %i3, %o0 2008ab8: 92 10 00 18 mov %i0, %o1 2008abc: b2 10 00 08 mov %o0, %i1 2008ac0: b4 02 3f f8 add %o0, -8, %i2 2008ac4: 94 10 20 01 mov 1, %o2 2008ac8: 40 00 07 18 call 200a728 <_RBTree_Next_unprotected> 2008acc: 90 10 00 1b mov %i3, %o0 2008ad0: 96 02 3f f8 add %o0, -8, %o3 rtems_rbtree_control *page_tree, rtems_rbheap_page *a, rtems_rbheap_page *b ) { if (b != NULL_PAGE && rtems_rbheap_is_page_free(b)) { 2008ad4: 80 a2 ff f8 cmp %o3, -8 2008ad8: 22 80 00 11 be,a 2008b1c 2008adc: c2 07 40 00 ld [ %i5 ], %g1 2008ae0: c4 02 3f f8 ld [ %o0 + -8 ], %g2 2008ae4: 80 a0 a0 00 cmp %g2, 0 2008ae8: 12 80 00 05 bne 2008afc 2008aec: 82 10 20 00 clr %g1 add_to_chain(free_chain, b); _RBTree_Extract_unprotected(page_tree, &b->tree_node); } } rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr) 2008af0: c2 02 e0 04 ld [ %o3 + 4 ], %g1 2008af4: 80 a0 00 01 cmp %g0, %g1 2008af8: 82 60 3f ff subx %g0, -1, %g1 rtems_rbtree_control *page_tree, rtems_rbheap_page *a, rtems_rbheap_page *b ) { if (b != NULL_PAGE && rtems_rbheap_is_page_free(b)) { 2008afc: 80 a0 60 00 cmp %g1, 0 2008b00: 32 80 00 07 bne,a 2008b1c 2008b04: c2 07 40 00 ld [ %i5 ], %g1 2008b08: 90 10 00 1d mov %i5, %o0 2008b0c: 92 10 00 1b mov %i3, %o1 2008b10: 7f ff ff 1c call 2008780 2008b14: 94 10 00 1c mov %i4, %o2 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 2008b18: c2 07 40 00 ld [ %i5 ], %g1 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 2008b1c: fa 27 20 04 st %i5, [ %i4 + 4 ] before_node = after_node->next; after_node->next = the_node; 2008b20: f8 27 40 00 st %i4, [ %i5 ] the_node->next = before_node; 2008b24: c2 27 00 00 st %g1, [ %i4 ] before_node->previous = the_node; 2008b28: f8 20 60 04 st %i4, [ %g1 + 4 ] 2008b2c: 80 a6 bf f8 cmp %i2, -8 2008b30: 02 80 00 11 be 2008b74 2008b34: b0 10 20 00 clr %i0 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 2008b38: c4 06 7f f8 ld [ %i1 + -8 ], %g2 2008b3c: 80 a0 a0 00 cmp %g2, 0 2008b40: 12 80 00 05 bne 2008b54 2008b44: 82 10 20 00 clr %g1 add_to_chain(free_chain, b); _RBTree_Extract_unprotected(page_tree, &b->tree_node); } } rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr) 2008b48: c2 06 a0 04 ld [ %i2 + 4 ], %g1 2008b4c: 80 a0 00 01 cmp %g0, %g1 2008b50: 82 60 3f ff subx %g0, -1, %g1 rtems_rbtree_control *page_tree, rtems_rbheap_page *a, rtems_rbheap_page *b ) { if (b != NULL_PAGE && rtems_rbheap_is_page_free(b)) { 2008b54: 80 a0 60 00 cmp %g1, 0 2008b58: 12 80 00 07 bne 2008b74 2008b5c: b0 10 20 00 clr %i0 2008b60: 90 10 00 1d mov %i5, %o0 2008b64: 92 10 00 1b mov %i3, %o1 2008b68: 94 10 00 1c mov %i4, %o2 2008b6c: 7f ff ff 05 call 2008780 2008b70: 96 10 00 1a mov %i2, %o3 } else { sc = RTEMS_INVALID_ID; } return sc; } 2008b74: 81 c7 e0 08 ret 2008b78: 81 e8 00 00 restore =============================================================================== 020177d8 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 20177d8: 9d e3 bf 98 save %sp, -104, %sp 20177dc: 90 10 00 18 mov %i0, %o0 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 20177e0: 80 a6 60 00 cmp %i1, 0 20177e4: 02 80 00 2e be 201789c 20177e8: b0 10 20 0a mov 0xa, %i0 return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 20177ec: 40 00 12 48 call 201c10c <_Thread_Get> 20177f0: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 20177f4: c2 07 bf fc ld [ %fp + -4 ], %g1 ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 20177f8: b8 10 00 08 mov %o0, %i4 switch ( location ) { 20177fc: 80 a0 60 00 cmp %g1, 0 2017800: 12 80 00 27 bne 201789c 2017804: b0 10 20 04 mov 4, %i0 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 2017808: fa 02 21 50 ld [ %o0 + 0x150 ], %i5 asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 201780c: c2 07 60 0c ld [ %i5 + 0xc ], %g1 2017810: 80 a0 60 00 cmp %g1, 0 2017814: 02 80 00 24 be 20178a4 2017818: 01 00 00 00 nop if ( asr->is_enabled ) { 201781c: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 2017820: 80 a0 60 00 cmp %g1, 0 2017824: 02 80 00 15 be 2017878 2017828: 01 00 00 00 nop rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 201782c: 7f ff e3 49 call 2010550 2017830: 01 00 00 00 nop *signal_set |= signals; 2017834: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 2017838: b2 10 40 19 or %g1, %i1, %i1 201783c: f2 27 60 14 st %i1, [ %i5 + 0x14 ] _ISR_Enable( _level ); 2017840: 7f ff e3 48 call 2010560 2017844: 01 00 00 00 nop _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 2017848: 03 00 80 ed sethi %hi(0x203b400), %g1 201784c: 82 10 63 c0 or %g1, 0x3c0, %g1 ! 203b7c0 <_Per_CPU_Information> 2017850: c4 00 60 08 ld [ %g1 + 8 ], %g2 2017854: 80 a0 a0 00 cmp %g2, 0 2017858: 02 80 00 0f be 2017894 201785c: 01 00 00 00 nop 2017860: c4 00 60 0c ld [ %g1 + 0xc ], %g2 2017864: 80 a7 00 02 cmp %i4, %g2 2017868: 12 80 00 0b bne 2017894 <== NEVER TAKEN 201786c: 84 10 20 01 mov 1, %g2 _Thread_Dispatch_necessary = true; 2017870: c4 28 60 18 stb %g2, [ %g1 + 0x18 ] 2017874: 30 80 00 08 b,a 2017894 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 2017878: 7f ff e3 36 call 2010550 201787c: 01 00 00 00 nop *signal_set |= signals; 2017880: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 2017884: b2 10 40 19 or %g1, %i1, %i1 2017888: f2 27 60 18 st %i1, [ %i5 + 0x18 ] _ISR_Enable( _level ); 201788c: 7f ff e3 35 call 2010560 2017890: 01 00 00 00 nop } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 2017894: 40 00 12 11 call 201c0d8 <_Thread_Enable_dispatch> 2017898: b0 10 20 00 clr %i0 ! 0 return RTEMS_SUCCESSFUL; 201789c: 81 c7 e0 08 ret 20178a0: 81 e8 00 00 restore } _Thread_Enable_dispatch(); 20178a4: 40 00 12 0d call 201c0d8 <_Thread_Enable_dispatch> 20178a8: b0 10 20 0b mov 0xb, %i0 return RTEMS_NOT_DEFINED; 20178ac: 81 c7 e0 08 ret 20178b0: 81 e8 00 00 restore =============================================================================== 0200e5cc : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 200e5cc: 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 ) 200e5d0: 80 a6 a0 00 cmp %i2, 0 200e5d4: 02 80 00 5a be 200e73c 200e5d8: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 200e5dc: 03 00 80 72 sethi %hi(0x201c800), %g1 200e5e0: f8 00 60 ec ld [ %g1 + 0xec ], %i4 ! 201c8ec <_Per_CPU_Information+0xc> api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 200e5e4: c2 0f 20 70 ldub [ %i4 + 0x70 ], %g1 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 200e5e8: fa 07 21 50 ld [ %i4 + 0x150 ], %i5 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 200e5ec: 80 a0 00 01 cmp %g0, %g1 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 200e5f0: c2 07 20 78 ld [ %i4 + 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; 200e5f4: b6 60 3f ff subx %g0, -1, %i3 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 200e5f8: 80 a0 60 00 cmp %g1, 0 200e5fc: 02 80 00 03 be 200e608 200e600: b7 2e e0 08 sll %i3, 8, %i3 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 200e604: b6 16 e2 00 or %i3, 0x200, %i3 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 200e608: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 200e60c: 80 a0 00 01 cmp %g0, %g1 old_mode |= _ISR_Get_level(); 200e610: 7f ff f3 63 call 200b39c <_CPU_ISR_Get_level> 200e614: a0 60 3f ff subx %g0, -1, %l0 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; 200e618: a1 2c 20 0a sll %l0, 0xa, %l0 200e61c: a0 14 00 08 or %l0, %o0, %l0 old_mode |= _ISR_Get_level(); 200e620: b6 14 00 1b or %l0, %i3, %i3 *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 200e624: 80 8e 61 00 btst 0x100, %i1 200e628: 02 80 00 06 be 200e640 200e62c: 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; 200e630: 82 0e 21 00 and %i0, 0x100, %g1 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 200e634: 80 a0 00 01 cmp %g0, %g1 200e638: 82 60 3f ff subx %g0, -1, %g1 200e63c: c2 2f 20 70 stb %g1, [ %i4 + 0x70 ] if ( mask & RTEMS_TIMESLICE_MASK ) { 200e640: 80 8e 62 00 btst 0x200, %i1 200e644: 02 80 00 0b be 200e670 200e648: 80 8e 60 0f btst 0xf, %i1 if ( _Modes_Is_timeslice(mode_set) ) { 200e64c: 80 8e 22 00 btst 0x200, %i0 200e650: 22 80 00 07 be,a 200e66c 200e654: c0 27 20 78 clr [ %i4 + 0x78 ] executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 200e658: 82 10 20 01 mov 1, %g1 200e65c: c2 27 20 78 st %g1, [ %i4 + 0x78 ] executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 200e660: 03 00 80 71 sethi %hi(0x201c400), %g1 200e664: c2 00 62 14 ld [ %g1 + 0x214 ], %g1 ! 201c614 <_Thread_Ticks_per_timeslice> 200e668: c2 27 20 74 st %g1, [ %i4 + 0x74 ] } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 200e66c: 80 8e 60 0f btst 0xf, %i1 200e670: 02 80 00 06 be 200e688 200e674: 80 8e 64 00 btst 0x400, %i1 */ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level ( Modes_Control mode_set ) { return ( mode_set & RTEMS_INTERRUPT_MASK ); 200e678: 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 ) ); 200e67c: 7f ff cf e0 call 20025fc 200e680: 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 ) { 200e684: 80 8e 64 00 btst 0x400, %i1 200e688: 02 80 00 14 be 200e6d8 200e68c: 88 10 20 00 clr %g4 is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 200e690: c4 0f 60 08 ldub [ %i5 + 8 ], %g2 */ RTEMS_INLINE_ROUTINE bool _Modes_Is_asr_disabled ( Modes_Control mode_set ) { return (mode_set & RTEMS_ASR_MASK) == RTEMS_NO_ASR; 200e694: b0 0e 24 00 and %i0, 0x400, %i0 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 200e698: 80 a0 00 18 cmp %g0, %i0 200e69c: 82 60 3f ff subx %g0, -1, %g1 is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 200e6a0: 80 a0 40 02 cmp %g1, %g2 200e6a4: 22 80 00 0e be,a 200e6dc 200e6a8: 03 00 80 72 sethi %hi(0x201c800), %g1 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 200e6ac: 7f ff cf d0 call 20025ec 200e6b0: c2 2f 60 08 stb %g1, [ %i5 + 8 ] _signals = information->signals_pending; 200e6b4: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 information->signals_pending = information->signals_posted; 200e6b8: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 information->signals_posted = _signals; 200e6bc: c2 27 60 14 st %g1, [ %i5 + 0x14 ] rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); _signals = information->signals_pending; information->signals_pending = information->signals_posted; 200e6c0: c4 27 60 18 st %g2, [ %i5 + 0x18 ] information->signals_posted = _signals; _ISR_Enable( _level ); 200e6c4: 7f ff cf ce call 20025fc 200e6c8: 01 00 00 00 nop asr->is_enabled = is_asr_enabled; _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { 200e6cc: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 200e6d0: 80 a0 00 01 cmp %g0, %g1 200e6d4: 88 40 20 00 addx %g0, 0, %g4 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 200e6d8: 03 00 80 72 sethi %hi(0x201c800), %g1 200e6dc: c4 00 60 08 ld [ %g1 + 8 ], %g2 ! 201c808 <_System_state_Current> 200e6e0: 80 a0 a0 03 cmp %g2, 3 200e6e4: 12 80 00 16 bne 200e73c 200e6e8: 82 10 20 00 clr %g1 bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; 200e6ec: 07 00 80 72 sethi %hi(0x201c800), %g3 if ( are_signals_pending || 200e6f0: 80 89 20 ff btst 0xff, %g4 bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; 200e6f4: 86 10 e0 e0 or %g3, 0xe0, %g3 if ( are_signals_pending || 200e6f8: 12 80 00 0a bne 200e720 200e6fc: c4 00 e0 0c ld [ %g3 + 0xc ], %g2 200e700: c6 00 e0 10 ld [ %g3 + 0x10 ], %g3 200e704: 80 a0 80 03 cmp %g2, %g3 200e708: 02 80 00 0d be 200e73c 200e70c: 01 00 00 00 nop (!_Thread_Is_heir( executing ) && executing->is_preemptible) ) { 200e710: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 200e714: 80 a0 a0 00 cmp %g2, 0 200e718: 02 80 00 09 be 200e73c <== NEVER TAKEN 200e71c: 01 00 00 00 nop _Thread_Dispatch_necessary = true; 200e720: 84 10 20 01 mov 1, %g2 ! 1 200e724: 03 00 80 72 sethi %hi(0x201c800), %g1 200e728: 82 10 60 e0 or %g1, 0xe0, %g1 ! 201c8e0 <_Per_CPU_Information> 200e72c: c4 28 60 18 stb %g2, [ %g1 + 0x18 ] if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); 200e730: 7f ff ee 1a call 2009f98 <_Thread_Dispatch> 200e734: 01 00 00 00 nop } return RTEMS_SUCCESSFUL; 200e738: 82 10 20 00 clr %g1 ! 0 } 200e73c: 81 c7 e0 08 ret 200e740: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 0200bac4 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 200bac4: 9d e3 bf 98 save %sp, -104, %sp register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 200bac8: 80 a6 60 00 cmp %i1, 0 200bacc: 02 80 00 07 be 200bae8 200bad0: 90 10 00 18 mov %i0, %o0 RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && ( the_priority <= RTEMS_MAXIMUM_PRIORITY ) ); 200bad4: 03 00 80 7e sethi %hi(0x201f800), %g1 200bad8: c2 08 61 14 ldub [ %g1 + 0x114 ], %g1 ! 201f914 200badc: 80 a6 40 01 cmp %i1, %g1 200bae0: 18 80 00 1c bgu 200bb50 200bae4: b0 10 20 13 mov 0x13, %i0 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 200bae8: 80 a6 a0 00 cmp %i2, 0 200baec: 02 80 00 19 be 200bb50 200baf0: b0 10 20 09 mov 9, %i0 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 200baf4: 40 00 09 86 call 200e10c <_Thread_Get> 200baf8: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 200bafc: c2 07 bf fc ld [ %fp + -4 ], %g1 200bb00: 80 a0 60 00 cmp %g1, 0 200bb04: 12 80 00 13 bne 200bb50 200bb08: b0 10 20 04 mov 4, %i0 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 200bb0c: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 200bb10: 80 a6 60 00 cmp %i1, 0 200bb14: 02 80 00 0d be 200bb48 200bb18: c2 26 80 00 st %g1, [ %i2 ] the_thread->real_priority = new_priority; if ( the_thread->resource_count == 0 || 200bb1c: c2 02 20 1c ld [ %o0 + 0x1c ], %g1 200bb20: 80 a0 60 00 cmp %g1, 0 200bb24: 02 80 00 06 be 200bb3c 200bb28: f2 22 20 18 st %i1, [ %o0 + 0x18 ] 200bb2c: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 200bb30: 80 a0 40 19 cmp %g1, %i1 200bb34: 08 80 00 05 bleu 200bb48 <== ALWAYS TAKEN 200bb38: 01 00 00 00 nop the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 200bb3c: 92 10 00 19 mov %i1, %o1 200bb40: 40 00 08 41 call 200dc44 <_Thread_Change_priority> 200bb44: 94 10 20 00 clr %o2 } _Thread_Enable_dispatch(); 200bb48: 40 00 09 64 call 200e0d8 <_Thread_Enable_dispatch> 200bb4c: b0 10 20 00 clr %i0 return RTEMS_SUCCESSFUL; 200bb50: 81 c7 e0 08 ret 200bb54: 81 e8 00 00 restore =============================================================================== 02018200 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 2018200: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 2018204: 11 00 80 ee sethi %hi(0x203b800), %o0 2018208: 92 10 00 18 mov %i0, %o1 201820c: 90 12 20 64 or %o0, 0x64, %o0 2018210: 40 00 0b df call 201b18c <_Objects_Get> 2018214: 94 07 bf fc add %fp, -4, %o2 Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 2018218: c2 07 bf fc ld [ %fp + -4 ], %g1 201821c: 80 a0 60 00 cmp %g1, 0 2018220: 12 80 00 0c bne 2018250 2018224: 01 00 00 00 nop case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 2018228: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 201822c: 80 a0 60 04 cmp %g1, 4 2018230: 02 80 00 04 be 2018240 <== NEVER TAKEN 2018234: 01 00 00 00 nop (void) _Watchdog_Remove( &the_timer->Ticker ); 2018238: 40 00 13 c4 call 201d148 <_Watchdog_Remove> 201823c: 90 02 20 10 add %o0, 0x10, %o0 _Thread_Enable_dispatch(); 2018240: 40 00 0f a6 call 201c0d8 <_Thread_Enable_dispatch> 2018244: b0 10 20 00 clr %i0 return RTEMS_SUCCESSFUL; 2018248: 81 c7 e0 08 ret 201824c: 81 e8 00 00 restore case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 2018250: 81 c7 e0 08 ret 2018254: 91 e8 20 04 restore %g0, 4, %o0 =============================================================================== 02018714 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 2018714: 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; 2018718: 03 00 80 ee sethi %hi(0x203b800), %g1 201871c: e0 00 60 a4 ld [ %g1 + 0xa4 ], %l0 ! 203b8a4 <_Timer_server> rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 2018720: ba 10 00 18 mov %i0, %i5 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) 2018724: 80 a4 20 00 cmp %l0, 0 2018728: 02 80 00 3b be 2018814 201872c: b0 10 20 0e mov 0xe, %i0 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 2018730: 03 00 80 ed sethi %hi(0x203b400), %g1 2018734: c2 08 61 90 ldub [ %g1 + 0x190 ], %g1 ! 203b590 <_TOD_Is_set> 2018738: 80 a0 60 00 cmp %g1, 0 201873c: 02 80 00 36 be 2018814 <== NEVER TAKEN 2018740: b0 10 20 0b mov 0xb, %i0 return RTEMS_NOT_DEFINED; if ( !routine ) 2018744: 80 a6 a0 00 cmp %i2, 0 2018748: 02 80 00 33 be 2018814 201874c: b0 10 20 09 mov 9, %i0 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 2018750: 90 10 00 19 mov %i1, %o0 2018754: 7f ff f3 8f call 2015590 <_TOD_Validate> 2018758: b0 10 20 14 mov 0x14, %i0 201875c: 80 8a 20 ff btst 0xff, %o0 2018760: 02 80 00 2f be 201881c 2018764: 01 00 00 00 nop return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 2018768: 7f ff f3 4f call 20154a4 <_TOD_To_seconds> 201876c: 90 10 00 19 mov %i1, %o0 if ( seconds <= _TOD_Seconds_since_epoch() ) 2018770: 23 00 80 ed sethi %hi(0x203b400), %l1 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 2018774: b2 10 00 08 mov %o0, %i1 2018778: d0 1c 62 10 ldd [ %l1 + 0x210 ], %o0 201877c: 94 10 20 00 clr %o2 2018780: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 2018784: 40 00 4c 25 call 202b818 <__divdi3> 2018788: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 if ( seconds <= _TOD_Seconds_since_epoch() ) 201878c: 80 a6 40 09 cmp %i1, %o1 2018790: 08 80 00 21 bleu 2018814 2018794: 11 00 80 ee sethi %hi(0x203b800), %o0 2018798: 92 10 00 1d mov %i5, %o1 201879c: 90 12 20 64 or %o0, 0x64, %o0 20187a0: 40 00 0a 7b call 201b18c <_Objects_Get> 20187a4: 94 07 bf fc add %fp, -4, %o2 return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 20187a8: c2 07 bf fc ld [ %fp + -4 ], %g1 20187ac: b8 10 00 08 mov %o0, %i4 20187b0: 80 a0 60 00 cmp %g1, 0 20187b4: 12 80 00 18 bne 2018814 20187b8: b0 10 20 04 mov 4, %i0 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 20187bc: 40 00 12 63 call 201d148 <_Watchdog_Remove> 20187c0: 90 02 20 10 add %o0, 0x10, %o0 20187c4: d0 1c 62 10 ldd [ %l1 + 0x210 ], %o0 the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 20187c8: 82 10 20 03 mov 3, %g1 20187cc: 94 10 20 00 clr %o2 20187d0: c2 27 20 38 st %g1, [ %i4 + 0x38 ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 20187d4: c0 27 20 18 clr [ %i4 + 0x18 ] the_watchdog->routine = routine; 20187d8: f4 27 20 2c st %i2, [ %i4 + 0x2c ] the_watchdog->id = id; 20187dc: fa 27 20 30 st %i5, [ %i4 + 0x30 ] the_watchdog->user_data = user_data; 20187e0: f6 27 20 34 st %i3, [ %i4 + 0x34 ] 20187e4: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 20187e8: 40 00 4c 0c call 202b818 <__divdi3> 20187ec: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _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 ); 20187f0: c2 04 20 04 ld [ %l0 + 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(); 20187f4: b2 26 40 09 sub %i1, %o1, %i1 (*timer_server->schedule_operation)( timer_server, the_timer ); 20187f8: 90 10 00 10 mov %l0, %o0 20187fc: 92 10 00 1c mov %i4, %o1 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 2018800: f2 27 20 1c st %i1, [ %i4 + 0x1c ] (*timer_server->schedule_operation)( timer_server, the_timer ); 2018804: 9f c0 40 00 call %g1 2018808: b0 10 20 00 clr %i0 _Thread_Enable_dispatch(); 201880c: 40 00 0e 33 call 201c0d8 <_Thread_Enable_dispatch> 2018810: 01 00 00 00 nop return RTEMS_SUCCESSFUL; 2018814: 81 c7 e0 08 ret 2018818: 81 e8 00 00 restore case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 201881c: 81 c7 e0 08 ret 2018820: 81 e8 00 00 restore